feat: add experimental support for AST parsing and static graph indexing

- Introduced CLI options for using AST grep parsers and enabling static graph relationships during indexing.
- Updated configuration management to load new settings for AST parsing and static graph types.
- Enhanced AST grep processor to handle imports with aliases and improve relationship tracking.
- Modified TreeSitter parsers to support synthetic module scopes for better static graph persistence.
- Implemented global relationship updates in the incremental indexer for static graph expansion.
- Added new ArtifactTag and FloatingFileBrowser components to the frontend for improved terminal dashboard functionality.
- Created utility functions for detecting CCW artifacts in terminal output with associated tests.
This commit is contained in:
catlog22
2026-02-15 23:12:06 +08:00
parent 48a6a1f2aa
commit 8938c47f88
39 changed files with 2956 additions and 297 deletions

View File

@@ -9,6 +9,7 @@ import { useIntl } from 'react-intl';
import {
SplitSquareHorizontal,
SplitSquareVertical,
FolderOpen,
Eraser,
AlertTriangle,
X,
@@ -21,6 +22,7 @@ import {
} from 'lucide-react';
import { cn } from '@/lib/utils';
import { TerminalInstance } from './TerminalInstance';
import { FloatingFileBrowser } from './FloatingFileBrowser';
import {
useTerminalGridStore,
selectTerminalGridPanes,
@@ -37,6 +39,8 @@ import {
} from '@/stores/issueQueueIntegrationStore';
import { useCliSessionStore } from '@/stores/cliSessionStore';
import { getAllPaneIds } from '@/lib/layout-utils';
import { sendCliSessionText } from '@/lib/api';
import { useWorkflowStore, selectProjectPath } from '@/stores/workflowStore';
import type { PaneId } from '@/stores/viewerStore';
import type { TerminalStatus } from '@/types/terminal-dashboard';
@@ -75,6 +79,10 @@ export function TerminalPane({ paneId }: TerminalPaneProps) {
const isFocused = focusedPaneId === paneId;
const canClose = getAllPaneIds(layout).length > 1;
const projectPath = useWorkflowStore(selectProjectPath);
const [isFileBrowserOpen, setIsFileBrowserOpen] = useState(false);
const [initialFileBrowserPath, setInitialFileBrowserPath] = useState<string | null>(null);
// Session data
const groups = useSessionManagerStore(selectGroups);
const terminalMetas = useSessionManagerStore(selectTerminalMetas);
@@ -146,6 +154,25 @@ export function TerminalPane({ paneId }: TerminalPaneProps) {
}
}, [paneId, sessionId, assignSession]);
const handleOpenFileBrowser = useCallback(() => {
setInitialFileBrowserPath(null);
setIsFileBrowserOpen(true);
}, []);
const handleRevealPath = useCallback((path: string) => {
setInitialFileBrowserPath(path);
setIsFileBrowserOpen(true);
}, []);
const handleInsertPath = useCallback((path: string) => {
if (!sessionId) return;
sendCliSessionText(
sessionId,
{ text: path, appendNewline: false },
projectPath ?? undefined
).catch((err) => console.error('[TerminalPane] insert path failed:', err));
}, [sessionId, projectPath]);
const handleRestart = useCallback(async () => {
if (!sessionId || isRestarting) return;
setIsRestarting(true);
@@ -291,6 +318,19 @@ export function TerminalPane({ paneId }: TerminalPaneProps) {
</button>
</>
)}
<button
onClick={handleOpenFileBrowser}
disabled={!projectPath}
className={cn(
'p-1 rounded hover:bg-muted transition-colors',
projectPath
? 'text-muted-foreground hover:text-foreground'
: 'text-muted-foreground/40 cursor-not-allowed'
)}
title={formatMessage({ id: 'terminalDashboard.fileBrowser.open' })}
>
<FolderOpen className="w-3.5 h-3.5" />
</button>
{alertCount > 0 && (
<span className="flex items-center gap-0.5 px-1 text-destructive">
<AlertTriangle className="w-3 h-3" />
@@ -314,7 +354,7 @@ export function TerminalPane({ paneId }: TerminalPaneProps) {
{/* Terminal content */}
{sessionId ? (
<div className="flex-1 min-h-0">
<TerminalInstance sessionId={sessionId} />
<TerminalInstance sessionId={sessionId} onRevealPath={handleRevealPath} />
</div>
) : (
<div className="flex-1 flex items-center justify-center text-muted-foreground">
@@ -329,6 +369,17 @@ export function TerminalPane({ paneId }: TerminalPaneProps) {
</div>
</div>
)}
<FloatingFileBrowser
isOpen={isFileBrowserOpen}
onClose={() => {
setIsFileBrowserOpen(false);
setInitialFileBrowserPath(null);
}}
rootPath={projectPath ?? '/'}
onInsertPath={sessionId ? handleInsertPath : undefined}
initialSelectedPath={initialFileBrowserPath}
/>
</div>
);
}