b62abfea4c
Introduce small/medium/large model tiers so agents use the appropriate model for their task complexity. Pre-recon uses Opus (large) for deep source code analysis, most agents use Sonnet (medium), and report uses Haiku (small) for summarization. - Add src/ai/models.ts with ModelTier type and resolveModel() - Add modelTier field to AgentDefinition - Refactor claude-executor env var passthrough into loop - Add Bedrock credential validation in preflight and CLI - Pass through Bedrock and model env vars in docker-compose
78 lines
1.7 KiB
TypeScript
78 lines
1.7 KiB
TypeScript
// Copyright (C) 2025 Keygraph, Inc.
|
|
//
|
|
// This program is free software: you can redistribute it and/or modify
|
|
// it under the terms of the GNU Affero General Public License version 3
|
|
// as published by the Free Software Foundation.
|
|
|
|
/**
|
|
* Agent type definitions
|
|
*/
|
|
|
|
/**
|
|
* List of all agents in execution order.
|
|
* Used for iteration during resume state checking.
|
|
*/
|
|
export const ALL_AGENTS = [
|
|
'pre-recon',
|
|
'recon',
|
|
'injection-vuln',
|
|
'xss-vuln',
|
|
'auth-vuln',
|
|
'ssrf-vuln',
|
|
'authz-vuln',
|
|
'injection-exploit',
|
|
'xss-exploit',
|
|
'auth-exploit',
|
|
'ssrf-exploit',
|
|
'authz-exploit',
|
|
'report',
|
|
] as const;
|
|
|
|
/**
|
|
* Agent name type derived from ALL_AGENTS.
|
|
* This ensures type safety and prevents drift between type and array.
|
|
*/
|
|
export type AgentName = typeof ALL_AGENTS[number];
|
|
|
|
export type PlaywrightAgent =
|
|
| 'playwright-agent1'
|
|
| 'playwright-agent2'
|
|
| 'playwright-agent3'
|
|
| 'playwright-agent4'
|
|
| 'playwright-agent5';
|
|
|
|
import type { ActivityLogger } from './activity-logger.js';
|
|
|
|
export type AgentValidator = (sourceDir: string, logger: ActivityLogger) => Promise<boolean>;
|
|
|
|
export type AgentStatus =
|
|
| 'pending'
|
|
| 'in_progress'
|
|
| 'completed'
|
|
| 'failed'
|
|
| 'rolled-back';
|
|
|
|
export interface AgentDefinition {
|
|
name: AgentName;
|
|
displayName: string;
|
|
prerequisites: AgentName[];
|
|
promptTemplate: string;
|
|
deliverableFilename: string;
|
|
modelTier?: 'small' | 'medium' | 'large';
|
|
}
|
|
|
|
/**
|
|
* Vulnerability types supported by the pipeline.
|
|
*/
|
|
export type VulnType = 'injection' | 'xss' | 'auth' | 'ssrf' | 'authz';
|
|
|
|
/**
|
|
* Decision returned by queue validation for exploitation phase.
|
|
*/
|
|
export interface ExploitationDecision {
|
|
shouldExploit: boolean;
|
|
shouldRetry: boolean;
|
|
vulnerabilityCount: number;
|
|
vulnType: VulnType;
|
|
}
|