import type { SubagentManager } from '../../subagent.js'; import type { ReadScopeInputs } from '../../subagent-read-scope.js'; import type { BackgroundAgentRegistry } from '../../background-registry.js'; import type { ModelProvider } from '../../provider.js'; import type { AgentModelInput, IAgentSession } from '../../types.js'; import type { AgentConfig } from '../../types/config-types.js'; import type { ChildProviderFactoryArgs } from '../nesting.js'; import type { AgentRegistry } from '../../agents/index.js'; import type { SkillExecutor } from '../skill-executor.js'; import type { Surface } from '../../awareness/types.js'; import type { TraceSink } from '../../trace/index.js'; import type { InboundAttachmentReader } from '../../content/attachment-registry.js'; import type { DelegationBudget } from '../delegation-budget.js'; import type { QueuedNoteClaim } from '../subagent/queued-note.js'; import type { PromotedSubagentInfo } from '../subagent/foreground-promotion.js'; export type { PromotedSubagentInfo, QueuedNoteClaim }; export interface SubagentExecutorContext { subagentManager: SubagentManager; parentSession: Pick & Partial>; defaultConfig: Pick; surface?: Surface; resolveApiKeyForModel?: (model: string) => string | undefined; defaultSubagentModel: AgentModelInput; childProviderFactory?: (args: ChildProviderFactoryArgs) => ModelProvider; childSkillExecutorFactory?: (depth: number, maxDepth: number, signal: AbortSignal, inheritedCwd?: string, inheritedReadScope?: ReadScopeInputs, skillDispatchName?: string) => SkillExecutor; depth: number; maxDepth?: number; backgroundRegistry?: BackgroundAgentRegistry; cwd?: string; traceWriter?: TraceSink; workspaceStore?: import('../../workspace/index.js').WorkspaceStore; delegationBudget?: DelegationBudget; allowedTools?: string[]; readOnlyBash?: boolean; nestedAgentAllowlist?: readonly string[]; agentRegistry?: AgentRegistry; inboundAttachmentRegistry?: InboundAttachmentReader; parentModel?: AgentModelInput; } export interface SubagentControl { hasPromotableForeground(): boolean; promoteActiveForeground(queuedNote?: QueuedNoteClaim): Promise; hasActiveForeground(): boolean; cancelActiveForeground(): Promise; }