//#region src/types/index.d.ts /** Whether an agent's prompt extends the host's system prompt or replaces it. */ type SystemPromptMode = 'append' | 'replace'; /** * A ceiling on how many tool calls a child may make. * * `soft` nudges, `hard` blocks. `block` narrows enforcement to named tools, or * `'*'` for all of them. */ interface ToolBudgetConfig { soft?: number; hard: number; block?: string[] | '*'; } //#endregion //#region src/types/agent.d.ts /** Which directories a discovery pass should read. */ type AgentScope = 'user' | 'project' | 'both'; /** * Where an agent definition came from. * * The order matters: a project agent shadows a user agent of the same name, * which in turn shadows one staged by a plugin. */ type AgentSource = 'plugin' | 'user' | 'project'; /** Whether a child starts from a clean context or forks the parent's. */ type AgentDefaultContext = 'fresh' | 'fork'; type AgentMemoryScope = 'project' | 'user'; interface AgentMemoryConfig { enabled?: boolean; scope?: AgentMemoryScope; maxEntries?: number; } /** Records that a model came from a settings default rather than frontmatter. */ interface AgentModelSourceInfo { type: 'subagents.defaultModel' | 'packages.team.defaultModel'; scope: 'user' | 'project' | 'package'; path: string; model: string; } /** * The frontmatter fields a builtin agent's override may restate. * * Overriding a builtin captures the original values so the override can be * removed later and the builtin restored exactly, which is why this is a * snapshot rather than a diff. */ interface BuiltinAgentOverrideBase { description?: string; tools?: string[]; model?: string; fallbackModels?: string[]; thinking?: string | false; systemPromptMode?: SystemPromptMode; inheritProjectContext?: boolean; inheritSkills?: boolean; skills?: string[]; skillPath?: string[]; extensions?: string[]; subagentOnlyExtensions?: string[]; output?: string; defaultReads?: string[]; defaultProgress?: boolean; defaultContext?: AgentDefaultContext; defaultTimeoutMs?: number; /** Which runtime executes this agent. Defaults to the in-process `pi` SDK path. */ runtime?: string; interactive?: boolean; maxSubagentDepth?: number; completionGuard?: boolean; toolBudget?: ToolBudgetConfig; memory?: AgentMemoryConfig; systemPrompt?: string; disabled?: boolean; } /** Which settings file overrode a builtin, and what it looked like before. */ interface BuiltinAgentOverrideInfo { scope: 'user' | 'project'; path: string; base: BuiltinAgentOverrideBase; } /** * A fully resolved agent definition. * * Resolved means frontmatter has been merged with settings defaults and any * builtin override, so consumers never re-apply precedence themselves. */ interface AgentConfig { name: string; /** Unqualified name, when the agent is namespaced by a package. */ localName?: string; packageName?: string; description: string; tools?: string[]; mcpDirectTools?: string[]; model?: string; fallbackModels?: string[]; thinking?: string | false; systemPromptMode: SystemPromptMode; inheritProjectContext: boolean; /** Controls Pi ambient skill discovery only; explicit named `skills` remain available. */ inheritSkills: boolean; defaultContext?: AgentDefaultContext; defaultTimeoutMs?: number; /** Which runtime executes this agent. Defaults to the in-process `pi` SDK path. */ runtime?: string; systemPrompt: string; source: AgentSource; filePath: string; /** Explicit named skill requirements projected into Pi child prompts. */ skills?: string[]; /** Lookup roots for explicit skill names; relative roots resolve from the request cwd. */ skillPath?: string[]; extensions?: string[]; /** True when `extensions` came from a settings default, not from frontmatter. */ extensionsFromDefault?: boolean; subagentOnlyExtensions?: string[]; output?: string; defaultReads?: string[]; defaultProgress?: boolean; interactive?: boolean; maxSubagentDepth?: number; completionGuard?: boolean; toolBudget?: ToolBudgetConfig; memory?: AgentMemoryConfig; disabled?: boolean; /** Frontmatter keys this package does not interpret, preserved for round-tripping. */ extraFields?: Record; override?: BuiltinAgentOverrideInfo; modelSource?: AgentModelSourceInfo; } //#endregion //#region src/services/subagentLaunchContract/index.d.ts interface SubagentLaunchContractInput { agent: string; cwd: string; task?: string; agentScope?: AgentScope; context?: 'fresh' | 'fork'; skill?: string | string[] | boolean; artifacts?: boolean; } interface SubagentLaunchContract { agent: AgentConfig; cwd: string; context: 'fresh' | 'fork'; } type SubagentLaunchContractResult = { ok: true; contract: SubagentLaunchContract; } | { ok: false; code: 'invalid_cwd' | 'missing_agent'; message: string; }; /** Lightweight public availability check using Doom Team's discovery rules. */ export declare function resolveSubagentLaunchContract(input: SubagentLaunchContractInput): Promise; //#endregion export type { SubagentLaunchContract, SubagentLaunchContractInput, SubagentLaunchContractResult }; //# sourceMappingURL=index.d.mts.map