import type { Provider, ThinkingLevel } from "@kenkaiiii/gg-ai"; import type { AgentDefinition } from "../core/agents.js"; export declare const SUB_AGENT_MAX_TURNS = 50; /** * Sub-agents get at most ONE turn-budget extension. A child's extensions run * inside a single parent turn, so a child extending itself twice multiplies * against the parent's own budget. */ export declare const SUB_AGENT_MAX_TURN_EXTENSIONS = 1; export declare const SUB_AGENT_MAX_OUTPUT_CHARS = 100000; export declare const SUB_AGENT_MAX_OUTPUT_LINES = 500; export declare const SUB_AGENT_MAX_STDERR_CHARS = 10000; export declare const SUB_AGENT_TIMEOUT_MS: number; export declare const SUB_AGENT_DEPTH_ENV = "GG_SUBAGENT_DEPTH"; export declare const MAX_BLOCKING_SUBAGENT_DEPTH = 3; export interface SubAgentTokenUsage { /** Fresh, non-cached input reported by the normalized provider adapter. */ input: number; output: number; cacheRead?: number; /** Fresh input written into the provider cache (separate on Anthropic). */ cacheWrite?: number; } export interface SubAgentSelection { agentDef?: AgentDefinition; provider: Provider; parentModel: string; model: string; } export declare function resolveAgentDefinition(agents: AgentDefinition[], requestedName?: string): AgentDefinition | undefined; export declare function selectSubAgent(agents: AgentDefinition[], requestedName: string | undefined, provider: Provider, parentModel: string): SubAgentSelection; /** * Resolve which model a named agent runs on. * * The choice is declared in the agent's `model:` frontmatter, never inferred. * This used to guess: any agent without bash/write/edit was treated as * "read-only" and silently routed to the provider's cheapest tier — so every * research, recon and audit agent always ran on a Haiku-class model, invisibly * and with no way to override it. Defaulting to the parent's model instead * makes a downgrade opt-in and one line of frontmatter away. */ export declare function resolveAgentModel(agentDef: AgentDefinition | undefined, provider: Provider, parentModel: string): string; /** * Render the agent roster for a tool description. * * Both delegation tools use this: the dispatcher picks an agent from the tool * schema alone, so a tool that omits the roster leaves the model guessing a * name — which either errors or, worse, silently spawns a generic child. */ export declare function renderAgentRoster(agents: readonly AgentDefinition[]): string; export declare function childThinkingLevel(level: ThinkingLevel | undefined): ThinkingLevel | undefined; export declare function subAgentCacheKey(parentCacheKey: string | undefined, model: string, agentName?: string): string | undefined; export declare function currentSubAgentDepth(env?: NodeJS.ProcessEnv): number; export declare function childSubAgentEnv(env?: NodeJS.ProcessEnv): NodeJS.ProcessEnv; export declare function resolveSubAgentCliEntry(env?: NodeJS.ProcessEnv): string; export declare function boundSubAgentOutput(raw: string): string; //# sourceMappingURL=subagent-shared.d.ts.map