mirror of
https://github.com/KeygraphHQ/shannon.git
synced 2026-06-02 21:52:16 +02:00
refactor: modularize claude-executor and extract shared utilities
- Extract message handling into src/ai/message-handlers.ts with pure functions - Extract output formatting into src/ai/output-formatters.ts - Extract progress management into src/ai/progress-manager.ts - Add audit-logger.ts with Null Object pattern for optional logging - Add shared utilities: formatting.ts, file-io.ts, functional.ts - Consolidate getPromptNameForAgent into src/types/agents.ts
This commit is contained in:
+23
-4
@@ -47,10 +47,6 @@ export type PlaywrightAgent =
|
||||
|
||||
export type AgentValidator = (sourceDir: string) => Promise<boolean>;
|
||||
|
||||
export type AgentValidatorMap = Record<AgentName, AgentValidator>;
|
||||
|
||||
export type McpAgentMapping = Record<PromptName, PlaywrightAgent>;
|
||||
|
||||
export type AgentStatus =
|
||||
| 'pending'
|
||||
| 'in_progress'
|
||||
@@ -63,3 +59,26 @@ export interface AgentDefinition {
|
||||
displayName: string;
|
||||
prerequisites: AgentName[];
|
||||
}
|
||||
|
||||
/**
|
||||
* Maps an agent name to its corresponding prompt file name.
|
||||
*/
|
||||
export function getPromptNameForAgent(agentName: AgentName): PromptName {
|
||||
const mappings: Record<AgentName, PromptName> = {
|
||||
'pre-recon': 'pre-recon-code',
|
||||
'recon': 'recon',
|
||||
'injection-vuln': 'vuln-injection',
|
||||
'xss-vuln': 'vuln-xss',
|
||||
'auth-vuln': 'vuln-auth',
|
||||
'ssrf-vuln': 'vuln-ssrf',
|
||||
'authz-vuln': 'vuln-authz',
|
||||
'injection-exploit': 'exploit-injection',
|
||||
'xss-exploit': 'exploit-xss',
|
||||
'auth-exploit': 'exploit-auth',
|
||||
'ssrf-exploit': 'exploit-ssrf',
|
||||
'authz-exploit': 'exploit-authz',
|
||||
'report': 'report-executive',
|
||||
};
|
||||
|
||||
return mappings[agentName];
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user