import { logger as rootLogger } from '../logger.js'; import type { ToolDispatcher } from './tool-dispatcher.js'; import type { ToolDef } from './provider-base.js'; /** v1.2.121 — opt-in in-process native self-spawn. Default OFF so * call_agent('native') uses callAgentByName (full A2A job/audit parity). * Set AGIM_NATIVE_CALL_AGENT_IN_PROCESS=on to re-enable the latency fast path. */ export declare function isInProcessSpawnEnabled(): boolean; /** Per-turn caller identity. Matches the subset of `RunContext` the * agim RPC handlers consume + the optional `agent` for A2A self-call * detection. */ export interface AgimDispatcherCtx { platform: string; channelId: string; threadId: string; userId: string; /** Calling agent name. A2A uses this to reject self-calls. */ callerAgent: string; /** Optional pino-compatible logger for the RouteContext A2A needs. */ logger?: typeof rootLogger; /** Optional A2A depth — defaults to 0 for native-originated calls. */ callerDepth?: number; /** v1.2.139 — caller's PlanMode flag at dispatch time. When true the * parent thread has `/plan on`, so any sub-agent we spawn MUST also * run read-only. Resolved by native/index.ts via * effectivePlanModeOn(planThreadKey) before building the dispatcher. */ callerPlanMode?: boolean; /** The parent turn's inline-job id (cli.ts stamps routeCtx.parentJobId on * every inbound turn). Threaded into callAgentByName so the A2A callee row * gets parent_id set — without it native-originated A2A jobs have a NULL * parent_id and the web `/api/a2a/*` views (which filter parent_id IS NOT * NULL) show them as 0. */ parentJobId?: number; /** Web chat activity accordion — forwarded into callAgentByName so A2A * emits "Waiting for subagent" steps on the parent turn. */ onToolActivity?: import('../types.js').AgentSendOpts['onToolActivity']; } /** v1.2.139 — env-driven output cap. When a sub-agent's reply exceeds * this, the dispatcher returns a short head + tail and stashes the full * text into viewer-paste (when configured) so the model can still cite * it. Default 8 KB: enough for typical CR reports / research summaries, * small enough that 2-3 stacked sub-agents don't blow the parent's * context budget. Set 0 to disable truncation. */ export declare function resolveSubAgentOutputCap(): number; /** v1.2.139 — one-shot transient retry. Mirrors the streamWithFirstTokenRetry * pattern: if the underlying provider/CLI tripped a 5xx / socket reset / quick * timeout, retry exactly once. Permanent errors (4xx, schema fail, model * refusals) keep the original behaviour (no retry). */ export declare function isTransientSubAgentError(msg: string): boolean; /** v1.2.139 — apply the byte cap to a sub-agent reply, optionally * spilling the full text into viewer-paste so the model can reference * the spill URL. Returns the (possibly truncated) text the dispatcher * should hand to the agent loop. */ export declare function applyOutputCap(raw: string, agentName: string, jobId: number | null): string; /** * Tool roster the LLM sees. JSON Schemas are kept terse — they match * the RPC handlers' real expectations without copying claude-code's * MCP server's full prose docstrings, which can grow to multi-KB. */ export declare function getAgimTools(): ToolDef[]; /** Build a dispatcher closure over the per-turn IM context. */ export declare function buildAgimDispatcher(ctx: AgimDispatcherCtx): ToolDispatcher; //# sourceMappingURL=agim-dispatcher.d.ts.map