export interface ParsedCallAgentTarget { agent: string; role?: string; backend?: string; isolate?: boolean; } /** * Normalize model-supplied call_agent `agent` strings. * * Preferred concrete form is backend name (llmBackends.name), not role: * roles like `cheap` are optional aliases and often unset. * * - `agim` / `native` → agim * - `agim/native` → agim + isolate (default model) * - `agim/` / `agim:` → backend if configured, else role if bound * - legacy `agim/native` slash form kept for old schema copy */ export declare function parseCallAgentTarget(raw: string): ParsedCallAgentTarget; export interface SubagentSpawnInput { agent: string; /** llmRoles key, e.g. `cheap` → flash (optional alias; prefer backend). */ role?: string; /** Explicit llmBackends name (preferred same-family pin). */ backend?: string; /** Allow same-agent nested spawn with isolated context (same or default model). */ isolate?: boolean; } /** Keys accepted on a native `call_agent` / `call_agents` task object. */ export declare const CALL_AGENT_TASK_KEYS: readonly ["agent", "prompt", "role", "backend", "isolate", "outputFormat", "maxDepth", "allowedTools"]; /** Extra keys the CLI MCP / PI bus payload may carry. */ export declare const CALL_AGENT_CLI_EXTRA_KEYS: readonly ["timeoutMs", "inputs", "expectOutputs"]; export declare const CALL_AGENTS_ROOT_KEYS: readonly ["tasks"]; export interface ParsedCallAgentTask { agent: string; prompt: string; role?: string; backend?: string; isolate?: boolean; outputFormat?: string; /** Absolute subtree depth ceiling (clamped to AGIM_A2A_MAX_DEPTH at spawn). */ maxDepth?: number; /** Same-family Agim only: advertise/allow only these tool names. */ allowedTools?: string[]; } export type ParseCallAgentResult = { ok: true; task: ParsedCallAgentTask; } | { ok: false; error: string; }; /** * Fail-loud parse of one call_agent / call_agents task object. * Unknown keys are refused (capability seam: do not silently drop fields). */ export declare function parseCallAgentTask(raw: unknown, opts?: { extraKeys?: readonly string[]; path?: string; }): ParseCallAgentResult; /** Fail-loud parse of `call_agents` root `{ tasks: [...] }`. */ export declare function parseCallAgentsArgs(raw: unknown, opts?: { extraTaskKeys?: readonly string[]; path?: string; }): { ok: true; tasks: ParsedCallAgentTask[]; } | { ok: false; error: string; }; /** Append an explicit output-format contract to the child brief. */ export declare function applyCallAgentOutputFormat(prompt: string, outputFormat?: string): string; /** * Intersect child `allowedTools` with an inherited parent allowlist. * Missing child list inherits the parent; empty intersection fails loud. */ export declare function intersectAllowedTools(parent: readonly string[] | undefined, child: readonly string[] | undefined): { ok: true; tools?: string[]; } | { ok: false; error: string; }; /** Clamp spawn `maxDepth` to the global + inherited subtree ceiling. */ export declare function resolveSubtreeMaxDepth(opts: { requested?: number; inherited?: number; globalMax: number; }): { ok: true; maxDepth: number; } | { ok: false; error: string; }; export type ResolvedSubagentSpawn = { ok: true; agent: string; /** Backend name for Agim Agent (`AgentSendOpts.model`). */ model?: string; role?: string; /** True when this is a same-agent nested spawn (must pass A2A self-call gate). */ isolate: boolean; /** Same registry agent as the caller (incl. agim/native aliases). */ sameAgent: boolean; /** UI / activity label, e.g. `agim/cheap` or `claude-code`. */ label: string; } | { ok: false; error: string; }; /** True when caller and target resolve to the same registered agent. */ export declare function isSameAgent(callerAgent: string, targetAgent: string): boolean; /** Case-insensitive backend name lookup → canonical name. */ export declare function resolveBackendName(name: string): string | null; export declare function formatSubagentLabel(agent: string, opts?: { role?: string; backend?: string; }): string; /** * Resolve call_agent / spawn_subagent arguments into a concrete target. * Same-agent calls require isolate, role, or backend (vacuous self-call rejected). * * Prefer `backend` (concrete llmBackends.name). `role` is an optional alias * (e.g. cheap) and fails closed when unbound — do not assume cheap exists. */ export declare function resolveSubagentSpawn(input: SubagentSpawnInput, callerAgent: string): ResolvedSubagentSpawn; //# sourceMappingURL=subagent.d.ts.map