import { type BaseLlm } from '@google/adk'; import type { StorageAdapter } from '../collector/types.js'; import { type QueryOptions } from '../debug/queries.js'; import { type SpecialistSpec } from './specialists.js'; export interface InvestigationStep { agent: string; tool: string; args: Record; } /** What the orchestrator did, in order: specialist calls, their answers, its own text. */ export interface TranscriptEntry { kind: 'call' | 'result' | 'text'; agent: string; content: string; } export interface InvestigatorOptions { storage: StorageAdapter; model: BaseLlm | string; queryOptions?: QueryOptions; /** Called for every tool call, specialists included — the chat shows these while the agents work. */ onStep?: (step: InvestigationStep) => void; /** Default: the built-in latency, error and traffic specialists. */ specialists?: SpecialistSpec[]; } export declare function isLeakedToolCall(text: string): boolean; export declare function createInvestigator(options: InvestigatorOptions): { startSession: (sessionId?: string) => Promise; /** Forgets a conversation and its history. */ endSession(sessionId: string): Promise; /** * Runs one investigation; resolves with the final report and every tool call made on the way. * Pass the sessionId from a previous answer to continue that conversation. Safe to call concurrently (per session: one at a time). */ ask(question: string, call?: { onStep?: (step: InvestigationStep) => void; /** Called with each data tool's result — the chat builds evidence cards from these. */ onResult?: (step: InvestigationStep, result: unknown) => void; sessionId?: string; /** Stops the run: ADK cancels between steps, and a model that supports it drops the call in flight. */ signal?: AbortSignal; }): Promise<{ text: string; sessionId: string; steps: InvestigationStep[]; transcript: TranscriptEntry[]; error?: string; }>; }; export type Investigator = ReturnType;