/** * Types for the wave sub-agent group orchestration module. * * Two-level state machines: * Group: waiting_deps → creating_worktree → running → committing → done_* * Agent: pending → queued → running → done_* | blocked | timed_out */ import { z } from 'zod'; import type { ToolHandlerContext } from '../types.js'; export type GroupState = 'waiting_deps' | 'creating_worktree' | 'running' | 'committing' | 'done_success' | 'done_failed' | 'done_timeout'; export declare const GROUP_TERMINAL_STATES: ReadonlySet; /** * Valid group state transitions. */ export declare const GROUP_TRANSITIONS: ReadonlyMap>; export declare function isValidGroupTransition(from: GroupState, to: GroupState): boolean; export declare function isGroupTerminal(state: GroupState): boolean; export type AgentState = 'pending' | 'queued' | 'running' | 'done_success' | 'done_failed' | 'blocked' | 'timed_out'; export declare const AGENT_TERMINAL_STATES: ReadonlySet; /** * Valid agent state transitions. * Note: running → queued is the retry path. */ export declare const AGENT_TRANSITIONS: ReadonlyMap>; export declare function isValidAgentTransition(from: AgentState, to: AgentState): boolean; export declare function isAgentTerminal(state: AgentState): boolean; export interface AgentRecord { alias: string; state: AgentState; taskId?: string; prompt: string; role?: string; specialization?: string; dependsOn: string[]; attempts: number; maxAttempts: number; error?: string; startedAt?: string; completedAt?: string; pid?: number; } export interface GroupRecord { id: string; state: GroupState; agents: AgentRecord[]; branch: string; worktreePath: string; baseCwd: string; baseCommit: string; dependsOn: string[]; groupName?: string; createdAt: string; completedAt?: string; commitSha?: string; error?: string; } export interface OrchestratorOptions { groupId: string; baseCwd: string; agents: AgentSpec[]; commonContext?: string; commonContextFiles?: ContextFileSpec[]; dependsOn: string[]; append: boolean; appendToGroupTaskId?: string; groupName?: string; callbackUri?: string; timeoutMs: number; sendProgress: ToolHandlerContext['sendProgress']; } export interface OrchestratorResult { groupId: string; groupName?: string; state: GroupState; branch: string; worktreePath: string; baseCommit: string; commitSha?: string; agentResults: AgentResultSummary[]; durationMs: number; error?: string; } export interface AgentResultSummary { alias: string; state: AgentState; taskId?: string; attempts: number; durationMs?: number; error?: string; } export interface DagNode { alias: string; dependsOn: string[]; state: AgentState; } export interface DagValidationResult { valid: boolean; errors: string[]; order: string[]; } export declare const ContextFileSpecSchema: z.ZodObject<{ path: z.ZodString; description: z.ZodOptional; start_line: z.ZodOptional; end_line: z.ZodOptional; }, z.core.$strip>; export type ContextFileSpec = z.infer; export declare const AgentSpecSchema: z.ZodObject<{ alias: z.ZodString; prompt: z.ZodString; role: z.ZodOptional>; specialization: z.ZodOptional; context_files: z.ZodOptional; start_line: z.ZodOptional; end_line: z.ZodOptional; }, z.core.$strip>>>; reasoningEffort: z.ZodOptional>>; sandbox: z.ZodOptional>>; depends_on: z.ZodOptional>; maxAttempts: z.ZodOptional>; }, z.core.$strip>; export type AgentSpec = z.infer; export declare const MAX_AGENTS_PER_GROUP: number; export declare const SpawnAgentGroupSchema: z.ZodObject<{ agents: z.ZodArray>; specialization: z.ZodOptional; context_files: z.ZodOptional; start_line: z.ZodOptional; end_line: z.ZodOptional; }, z.core.$strip>>>; reasoningEffort: z.ZodOptional>>; sandbox: z.ZodOptional>>; depends_on: z.ZodOptional>; maxAttempts: z.ZodOptional>; }, z.core.$strip>>; commonContext: z.ZodOptional; commonContextFiles: z.ZodOptional; start_line: z.ZodOptional; end_line: z.ZodOptional; }, z.core.$strip>>>; dependsOn: z.ZodOptional>; append: z.ZodOptional>; appendToGroupTaskId: z.ZodOptional; groupName: z.ZodOptional; workingDirectory: z.ZodOptional; callbackUri: z.ZodOptional; }, z.core.$strip>; export type SpawnAgentGroupArgs = z.infer; /** Fixed 30-minute timeout for the entire tool call. */ export declare const GROUP_TIMEOUT_MS: number; /** Retry backoff delay in milliseconds. */ export declare const RETRY_BACKOFF_MS = 2000; /** Default max retry attempts per agent. */ export declare const DEFAULT_MAX_ATTEMPTS = 2; /** Dependency polling interval in milliseconds. */ export declare const DEP_POLL_INTERVAL_MS = 2000; /** Stream verbosity levels. */ export type StreamVerbosity = 'low' | 'medium' | 'high'; export declare function getStreamVerbosity(): StreamVerbosity; //# sourceMappingURL=types.d.ts.map