mirror of
https://github.com/catlog22/Claude-Code-Workflow.git
synced 2026-02-13 02:41:50 +08:00
feat: Implement association tree for LSP-based code relationship discovery
- Add `association_tree` module with components for building and processing call association trees using LSP call hierarchy capabilities. - Introduce `AssociationTreeBuilder` for constructing call trees from seed locations with depth-first expansion. - Create data structures: `TreeNode`, `CallTree`, and `UniqueNode` for representing nodes and relationships in the call tree. - Implement `ResultDeduplicator` to extract unique nodes from call trees and assign relevance scores based on depth, frequency, and kind. - Add unit tests for `AssociationTreeBuilder` and `ResultDeduplicator` to ensure functionality and correctness.
This commit is contained in:
@@ -72,6 +72,44 @@ export function getActiveExecutions(): ActiveExecution[] {
|
||||
return Array.from(activeExecutions.values());
|
||||
}
|
||||
|
||||
/**
|
||||
* Update active execution state from hook events
|
||||
* Called by hooks-routes when CLI events are received from terminal execution
|
||||
*/
|
||||
export function updateActiveExecution(event: {
|
||||
type: 'started' | 'output' | 'completed';
|
||||
executionId: string;
|
||||
tool?: string;
|
||||
mode?: string;
|
||||
prompt?: string;
|
||||
output?: string;
|
||||
success?: boolean;
|
||||
}): void {
|
||||
const { type, executionId, tool, mode, prompt, output, success } = event;
|
||||
|
||||
if (type === 'started') {
|
||||
// Create new active execution
|
||||
activeExecutions.set(executionId, {
|
||||
id: executionId,
|
||||
tool: tool || 'unknown',
|
||||
mode: mode || 'analysis',
|
||||
prompt: (prompt || '').substring(0, 500),
|
||||
startTime: Date.now(),
|
||||
output: '',
|
||||
status: 'running'
|
||||
});
|
||||
} else if (type === 'output') {
|
||||
// Append output to existing execution
|
||||
const activeExec = activeExecutions.get(executionId);
|
||||
if (activeExec && output) {
|
||||
activeExec.output += output;
|
||||
}
|
||||
} else if (type === 'completed') {
|
||||
// Remove from active executions
|
||||
activeExecutions.delete(executionId);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Handle CLI routes
|
||||
* @returns true if route was handled, false otherwise
|
||||
|
||||
Reference in New Issue
Block a user