/** * Minimal run tracing. * * This ships with the first executable version rather than being deferred to a * later observability phase. Tool-selection and iteration failures are the two * things most likely to go wrong in an orchestrator, and both are close to * undiagnosable without a record of what was chosen and why. Full trace replay * can wait; knowing which model ran, which tools it picked, and why the run * stopped cannot. * * Arguments are sanitized before they are recorded, because tool arguments * routinely carry tokens and paths that must not reach a log. */ export interface GatewayTraceRecord { runId?: string; query: string; startedAt: string; roleBindings: Record; capabilities?: string[]; plannedTasks: Array<{ id: string; role: string; objective: string; tools: string[]; }>; toolCalls: Array<{ taskId: string; tool: string; args: unknown; ok?: boolean; latencyMs?: number; errorCode?: string; }>; rounds: number; finalizerMode?: string; completionReason?: string; status?: string; durationMs?: number; warnings: string[]; } export declare const redactSecretValues: (value: string) => string; /** * Redacts sensitive-looking values and truncates long ones. Applied to every * argument before it is recorded or printed. */ export declare const sanitizeArgs: (value: unknown, depth?: number) => unknown; export interface GatewayTracerOptions { /** Print progress to stderr as the run proceeds. */ verbose?: boolean; write?: (line: string) => void; } export declare class GatewayTracer { private readonly options; private readonly record; private readonly startedMs; constructor(query: string, options?: GatewayTracerOptions); private emit; setRunId(runId: string): void; setRoleBindings(bindings: Record): void; recordPlan(input: { capabilities?: string[]; tasks: Array<{ id: string; workerRole: string; objective: string; toolsAllowed?: string[]; }>; }): void; recordToolCall(input: { taskId: string; tool: string; args: unknown; }): void; recordToolResult(input: { taskId: string; tool: string; ok: boolean; latencyMs: number; errorCode?: string; }): void; recordRound(round: number): void; addWarning(warning: string): void; finish(input: { status: string; finalizerMode?: string; completionReason?: string; warnings?: string[]; }): GatewayTraceRecord; snapshot(): GatewayTraceRecord; /** Human-readable summary printed by `codali ask --trace`. */ render(): string; } //# sourceMappingURL=GatewayTracer.d.ts.map