Fully autonomous AI Agents system capable of performing complex penetration testing tasks
Go ai-agentsai-security-toolanthropicautonomous-agentsgolanggptgraphqlmulti-agent-systemoffensive-securityopen-sourceopenaipenetration-testingpenetration-testing-toolsreactsecurity-automationsecurity-testingsecurity-toolsself-hosted
refactor(markdown-editor): standardize file prefix + add index barrel
Sergey Kozyrenkoc699c152a3fa
diff --git a/frontend/src/components/shared/markdown-editor/index.ts b/frontend/src/components/shared/markdown-editor/index.tsnew file mode 100644index 00000000..26616d05--- /dev/null+++ b/frontend/src/components/shared/markdown-editor/index.ts@@ -0,0 +1,5 @@+export { MarkdownEditor } from './markdown-editor';+export type { MarkdownEditorHandle, MarkdownEditorProps } from './markdown-editor';+export { findVariableUseRanges, VARIABLE_RE, variableProbe } from './markdown-editor-variable-highlight';+export { EditorViewModeToggle } from './markdown-editor-view-mode';+export type { EditorViewMode } from './markdown-editor-view-mode';diff --git a/frontend/src/components/shared/markdown-editor/editor-content-integrity.test.ts b/frontend/src/components/shared/markdown-editor/markdown-editor-content-integrity.test.tssimilarity index 100%rename from frontend/src/components/shared/markdown-editor/editor-content-integrity.test.tsrename to frontend/src/components/shared/markdown-editor/markdown-editor-content-integrity.test.tsdiff --git a/frontend/src/components/shared/markdown-editor/markdown-editor-extensions.test.ts b/frontend/src/components/shared/markdown-editor/markdown-editor-extensions.test.tsindex a143c680..779df673 100644--- a/frontend/src/components/shared/markdown-editor/markdown-editor-extensions.test.ts+++ b/frontend/src/components/shared/markdown-editor/markdown-editor-extensions.test.ts@@ -1,8 +1,8 @@import { Editor } from '@tiptap/core';import { beforeAll, describe, expect, it } from 'vitest';-import { findVariableOccurrences } from './editor-variable-highlight';import { createMarkdownExtensions } from './markdown-editor-extensions';+import { findVariableOccurrences } from './markdown-editor-variable-highlight';beforeAll(() => {document.elementFromPoint = () => null;diff --git a/frontend/src/components/shared/markdown-editor/markdown-editor-extensions.ts b/frontend/src/components/shared/markdown-editor/markdown-editor-extensions.tsindex 72b4eddc..6d78e9f4 100644--- a/frontend/src/components/shared/markdown-editor/markdown-editor-extensions.ts+++ b/frontend/src/components/shared/markdown-editor/markdown-editor-extensions.ts@@ -4,10 +4,10 @@ import { TableCell, TableHeader, TableRow } from '@tiptap/extension-table';import { Placeholder } from '@tiptap/extensions';import StarterKit from '@tiptap/starter-kit';-import { createMarkdownLayer, MarkdownTable } from './editor-markdown';-import { MarkdownPaste } from './editor-paste';-import { TagHighlight } from './editor-tag-highlight';-import { VariableHighlight } from './editor-variable-highlight';+import { createMarkdownLayer, MarkdownTable } from './markdown-editor-marked';+import { MarkdownPaste } from './markdown-editor-paste';+import { TagHighlight } from './markdown-editor-tag-highlight';+import { VariableHighlight } from './markdown-editor-variable-highlight';const dropUnderscore = (rules: { find: unknown }[]) =>rules.filter((rule) => !(rule.find instanceof RegExp && rule.find.source.includes('_')));diff --git a/frontend/src/components/shared/markdown-editor/editor-highlight-regex.test.ts b/frontend/src/components/shared/markdown-editor/markdown-editor-highlight.test.tssimilarity index 96%rename from frontend/src/components/shared/markdown-editor/editor-highlight-regex.test.tsrename to frontend/src/components/shared/markdown-editor/markdown-editor-highlight.test.tsindex 28cd0f38..4b38dfbe 100644--- a/frontend/src/components/shared/markdown-editor/editor-highlight-regex.test.ts+++ b/frontend/src/components/shared/markdown-editor/markdown-editor-highlight.test.ts@@ -1,7 +1,7 @@import { describe, expect, it } from 'vitest';-import { TAG_RE } from './editor-tag-highlight';-import { findVariableUseRanges, VARIABLE_RE, variableProbe } from './editor-variable-highlight';+import { TAG_RE } from './markdown-editor-tag-highlight';+import { findVariableUseRanges, VARIABLE_RE, variableProbe } from './markdown-editor-variable-highlight';const matches = (re: RegExp, text: string) => [...text.matchAll(re)].map((m) => m[0]);diff --git a/frontend/src/components/shared/markdown-editor/editor-indented-fence.test.ts b/frontend/src/components/shared/markdown-editor/markdown-editor-indented-fence.test.tssimilarity index 100%rename from frontend/src/components/shared/markdown-editor/editor-indented-fence.test.tsrename to frontend/src/components/shared/markdown-editor/markdown-editor-indented-fence.test.tsdiff --git a/frontend/src/components/shared/markdown-editor/editor-inline-scan.ts b/frontend/src/components/shared/markdown-editor/markdown-editor-inline-scan.tssimilarity index 100%rename from frontend/src/components/shared/markdown-editor/editor-inline-scan.tsrename to frontend/src/components/shared/markdown-editor/markdown-editor-inline-scan.tsdiff --git a/frontend/src/components/shared/markdown-editor/editor-markdown.ts b/frontend/src/components/shared/markdown-editor/markdown-editor-marked.tssimilarity index 100%rename from frontend/src/components/shared/markdown-editor/editor-markdown.tsrename to frontend/src/components/shared/markdown-editor/markdown-editor-marked.tsdiff --git a/frontend/src/components/shared/markdown-editor/editor-paste.test.ts b/frontend/src/components/shared/markdown-editor/markdown-editor-paste.test.tssimilarity index 98%rename from frontend/src/components/shared/markdown-editor/editor-paste.test.tsrename to frontend/src/components/shared/markdown-editor/markdown-editor-paste.test.tsindex bbad3da9..78da1f11 100644--- a/frontend/src/components/shared/markdown-editor/editor-paste.test.ts+++ b/frontend/src/components/shared/markdown-editor/markdown-editor-paste.test.ts@@ -2,8 +2,8 @@ import { Editor } from '@tiptap/core';import { Slice } from '@tiptap/pm/model';import { beforeAll, describe, expect, it } from 'vitest';-import { shouldParseMarkdownOnPaste } from './editor-paste';import { createMarkdownExtensions } from './markdown-editor-extensions';+import { shouldParseMarkdownOnPaste } from './markdown-editor-paste';beforeAll(() => {document.elementFromPoint = () => null;diff --git a/frontend/src/components/shared/markdown-editor/editor-paste.ts b/frontend/src/components/shared/markdown-editor/markdown-editor-paste.tssimilarity index 100%rename from frontend/src/components/shared/markdown-editor/editor-paste.tsrename to frontend/src/components/shared/markdown-editor/markdown-editor-paste.tsdiff --git a/frontend/src/components/shared/markdown-editor/editor-tag-highlight.ts b/frontend/src/components/shared/markdown-editor/markdown-editor-tag-highlight.tssimilarity index 96%rename from frontend/src/components/shared/markdown-editor/editor-tag-highlight.tsrename to frontend/src/components/shared/markdown-editor/markdown-editor-tag-highlight.tsindex cc535cc9..4fc81113 100644--- a/frontend/src/components/shared/markdown-editor/editor-tag-highlight.ts+++ b/frontend/src/components/shared/markdown-editor/markdown-editor-tag-highlight.ts@@ -4,7 +4,7 @@ import { Extension } from '@tiptap/core';import { Plugin, PluginKey } from '@tiptap/pm/state';import { Decoration, DecorationSet } from '@tiptap/pm/view';-import { collectInlineMatches } from './editor-inline-scan';+import { collectInlineMatches } from './markdown-editor-inline-scan';// Highlights xml-like tags (<container_environment>, </language_policy>, <specialist name="x">)// as VIEW-ONLY decorations — same byte-neutral approach as editor-variable-highlight. A node woulddiff --git a/frontend/src/components/shared/markdown-editor/editor-variable-highlight.ts b/frontend/src/components/shared/markdown-editor/markdown-editor-variable-highlight.tssimilarity index 97%rename from frontend/src/components/shared/markdown-editor/editor-variable-highlight.tsrename to frontend/src/components/shared/markdown-editor/markdown-editor-variable-highlight.tsindex 428af626..5707d270 100644--- a/frontend/src/components/shared/markdown-editor/editor-variable-highlight.ts+++ b/frontend/src/components/shared/markdown-editor/markdown-editor-variable-highlight.ts@@ -4,7 +4,7 @@ import { Extension } from '@tiptap/core';import { Plugin, PluginKey } from '@tiptap/pm/state';import { Decoration, DecorationSet } from '@tiptap/pm/view';-import { collectInlineMatches } from './editor-inline-scan';+import { collectInlineMatches } from './markdown-editor-inline-scan';// Highlights Go-template actions ({{.Var}}, {{- if .X}}, {{end}}, {{.A | upper}}, …) as VIEW-ONLY// decorations. Decorations never touch the document, so getMarkdown() stays byte-identical, and {{ }}diff --git a/frontend/src/components/shared/markdown-editor/editor-view-mode.tsx b/frontend/src/components/shared/markdown-editor/markdown-editor-view-mode.tsxsimilarity index 100%rename from frontend/src/components/shared/markdown-editor/editor-view-mode.tsxrename to frontend/src/components/shared/markdown-editor/markdown-editor-view-mode.tsxdiff --git a/frontend/src/components/shared/markdown-editor/markdown-editor.tsx b/frontend/src/components/shared/markdown-editor/markdown-editor.tsxindex 3520f360..4c73eb59 100644--- a/frontend/src/components/shared/markdown-editor/markdown-editor.tsx+++ b/frontend/src/components/shared/markdown-editor/markdown-editor.tsx@@ -29,8 +29,8 @@ import { Separator } from '@/components/ui/separator';import { Toggle } from '@/components/ui/toggle';import { cn } from '@/lib/utils';-import { findVariableOccurrences } from './editor-variable-highlight';import { createMarkdownExtensions } from './markdown-editor-extensions';+import { findVariableOccurrences } from './markdown-editor-variable-highlight';export interface MarkdownEditorHandle {cycleToVariable: (variable: string) => boolean;diff --git a/frontend/src/features/knowledges/knowledge-form-controls.tsx b/frontend/src/features/knowledges/knowledge-form-controls.tsxindex b1617c3b..f79c7865 100644--- a/frontend/src/features/knowledges/knowledge-form-controls.tsx+++ b/frontend/src/features/knowledges/knowledge-form-controls.tsx@@ -5,8 +5,7 @@ import type {KnowledgeGuideType as KnowledgeGuideTypeT,} from '@/graphql/types';-import { type EditorViewMode } from '@/components/shared/markdown-editor/editor-view-mode';-import { MarkdownEditor } from '@/components/shared/markdown-editor/markdown-editor';+import { type EditorViewMode, MarkdownEditor } from '@/components/shared/markdown-editor';import {Autocomplete,AutocompleteContent,diff --git a/frontend/src/features/knowledges/knowledge-form-layout.tsx b/frontend/src/features/knowledges/knowledge-form-layout.tsxindex 4d54d194..328ea0e5 100644--- a/frontend/src/features/knowledges/knowledge-form-layout.tsx+++ b/frontend/src/features/knowledges/knowledge-form-layout.tsx@@ -3,7 +3,7 @@ import type { Control } from 'react-hook-form';import type { KnowledgeDocumentFragmentFragment } from '@/graphql/types';import { DetailTwoPanelLayout } from '@/components/shared/detail-two-panel-layout';-import { type EditorViewMode } from '@/components/shared/markdown-editor/editor-view-mode';+import { type EditorViewMode } from '@/components/shared/markdown-editor';import { Badge } from '@/components/ui/badge';import type { FormValues } from './knowledge-form';diff --git a/frontend/src/features/knowledges/knowledge-form.tsx b/frontend/src/features/knowledges/knowledge-form.tsxindex ea5d6847..da7af2c3 100644--- a/frontend/src/features/knowledges/knowledge-form.tsx+++ b/frontend/src/features/knowledges/knowledge-form.tsx@@ -14,7 +14,7 @@ import type {} from '@/graphql/types';import { AppHeaderAction } from '@/components/layouts/app/app-header';-import { type EditorViewMode } from '@/components/shared/markdown-editor/editor-view-mode';+import { type EditorViewMode } from '@/components/shared/markdown-editor';import { UnsavedChangesDialog, useUnsavedChangesGuard } from '@/components/shared/unsaved-changes';import { Form } from '@/components/ui/form';import { Spinner } from '@/components/ui/spinner';diff --git a/frontend/src/features/knowledges/knowledge-header.tsx b/frontend/src/features/knowledges/knowledge-header.tsxindex 5296cdfb..970e9657 100644--- a/frontend/src/features/knowledges/knowledge-header.tsx+++ b/frontend/src/features/knowledges/knowledge-header.tsx@@ -15,7 +15,7 @@ import {DetailNavigationToolbar,} from '@/components/shared/detail-navigation';import { InlineEditInput, useInlineEdit } from '@/components/shared/inline-edit';-import { type EditorViewMode, EditorViewModeToggle } from '@/components/shared/markdown-editor/editor-view-mode';+import { type EditorViewMode, EditorViewModeToggle } from '@/components/shared/markdown-editor';import { Badge } from '@/components/ui/badge';import { Breadcrumb, BreadcrumbItem, BreadcrumbList, BreadcrumbPage } from '@/components/ui/breadcrumb';import { Button } from '@/components/ui/button';diff --git a/frontend/src/pages/settings/settings-prompt.tsx b/frontend/src/pages/settings/settings-prompt.tsxindex 9d04ee2f..7b5279d0 100644--- a/frontend/src/pages/settings/settings-prompt.tsx+++ b/frontend/src/pages/settings/settings-prompt.tsx@@ -47,12 +47,11 @@ import type {ValidatePromptMutation,} from '@/graphql/types';-import { type EditorViewMode, EditorViewModeToggle } from '@/components/shared/markdown-editor/editor-view-mode';+import { type EditorViewMode, EditorViewModeToggle, findVariableUseRanges, type MarkdownEditorHandle, VARIABLE_RE, variableProbe } from '@/components/shared/markdown-editor';type AgentPrompt = AgentPrompts;type AgentPrompts = { human?: DefaultPrompt; system: DefaultPrompt };-import type { MarkdownEditorHandle } from '@/components/shared/markdown-editor/markdown-editor';import {AppHeader,@@ -63,7 +62,6 @@ import {} from '@/components/layouts/app/app-header';import ConfirmationDialog from '@/components/shared/confirmation-dialog';import { DetailTwoPanelLayout } from '@/components/shared/detail-two-panel-layout';-import { findVariableUseRanges, VARIABLE_RE, variableProbe } from '@/components/shared/markdown-editor/editor-variable-highlight';import { UnsavedChangesDialog, useUnsavedChangesGuard } from '@/components/shared/unsaved-changes';import { Alert, AlertDescription, AlertTitle } from '@/components/ui/alert';import { Badge } from '@/components/ui/badge';@@ -94,7 +92,7 @@ import { cn } from '@/lib/utils';// Dynamic-only import: a static import would merge the tiptap editor chunk into this route bundle.const MarkdownEditor = lazy(() =>- import('@/components/shared/markdown-editor/markdown-editor').then((module) => ({ default: module.MarkdownEditor })),+ import('@/components/shared/markdown-editor').then((module) => ({ default: module.MarkdownEditor })),);const systemFormSchema = z.object({diff --git a/frontend/src/pages/templates/template.tsx b/frontend/src/pages/templates/template.tsxindex f191abbc..3657f8bd 100644--- a/frontend/src/pages/templates/template.tsx+++ b/frontend/src/pages/templates/template.tsx@@ -18,7 +18,7 @@ import {} from '@/components/shared/detail-navigation';import { DetailTwoPanelLayout } from '@/components/shared/detail-two-panel-layout';import { InlineEditInput, useInlineEdit } from '@/components/shared/inline-edit';-import { type EditorViewMode, EditorViewModeToggle } from '@/components/shared/markdown-editor/editor-view-mode';+import { type EditorViewMode, EditorViewModeToggle } from '@/components/shared/markdown-editor';import { UnsavedChangesDialog, useUnsavedChangesGuard } from '@/components/shared/unsaved-changes';import { Badge } from '@/components/ui/badge';import { Breadcrumb, BreadcrumbItem, BreadcrumbList, BreadcrumbPage } from '@/components/ui/breadcrumb';@@ -46,7 +46,7 @@ import { cn } from '@/lib/utils';import { type Template, useTemplates } from '@/providers/templates-provider';const MarkdownEditor = lazy(() =>- import('@/components/shared/markdown-editor/markdown-editor').then((module) => ({ default: module.MarkdownEditor })),+ import('@/components/shared/markdown-editor').then((module) => ({ default: module.MarkdownEditor })),);const formSchema = z.object({