import type { AgentServiceSandboxToolsOptions, AgentServiceSandboxToolsResult } from "../../sandbox/index.js"; import { createToolsFromRemoteDefinitions, type HostToolSet, type RemoteMCPToolSourceConfig, type RemoteToolSource, type ToolExecutionContext } from "../../tool/index.js"; import type { InferSchema } from "../../extensions/schema/index.js"; import type { AgentSystem } from "../types.js"; import type { ChildRunExecutionResult } from "../child-run/execution-snapshot.js"; import type { ConversationRunEvent } from "../conversation/run-events.js"; import { type StartedHostedChildForkRuntime, type StartHostedChildForkRuntimeWithHostToolsInput } from "./child-fork-runtime-start.js"; import { prepareDefaultHostedChildForkSandboxToolSources } from "./child-fork-tool-sources.js"; import type { AgentServiceMcpServerConfig } from "../service/mcp-server-config.js"; import { type MutableAgentProjectContext } from "../project/context.js"; import { type HostedDurableChildInvokeResult } from "./durable-child-fork-execution.js"; import type { HostedChildRunIdentifiers } from "./child-status.js"; import { type HostedChildForkRuntimeConfig, type HostedChildForkToolInput, type HostedChildInvocationContext } from "./child-tool-input.js"; import type { DefaultHostedChildForkToolAssemblySourceResult } from "./child-requested-tools.js"; import type { RuntimeClientProfile } from "../runtime/client-profile.js"; import type { RuntimeLoadSkillToolContext } from "../runtime/load-skill-tool.js"; import type { RuntimeReasoningOption } from "../types.js"; import { type HostedProjectReferenceResolver } from "./project-reference-resolver.js"; import { type HostedRunEventWriterCapability } from "./child-run-event-writer-token.js"; /** Context for default hosted invoke agent. */ export type DefaultHostedInvokeAgentContext = MutableAgentProjectContext & { authToken: string; clientProfile?: RuntimeClientProfile | null; model?: string; conversationId?: string; parentRunId?: string; parentMessageId?: string; veryfrontInvocationContext?: HostedChildInvocationContext; publishParentRunEvents?: (events: ConversationRunEvent[]) => Promise | void; availableToolNames?: string[]; steeringRevision?: number; }; /** Configuration used by default hosted invoke agent. */ export type DefaultHostedInvokeAgentConfig = { apiUrl: string; apiMcpUrl: string; studioMcpUrl?: string | null; mcpServers?: readonly AgentServiceMcpServerConfig[]; enableDurableInvokeAgent?: boolean; }; /** Resolved project-agent settings applied to a fixed hosted child run. */ export type DefaultHostedChildAgentExecutionConfig = { system: AgentSystem; model?: string; temperature?: number; maxSteps?: number; thinking?: HostedChildForkToolInput["thinking"]; toolNames?: string[]; /** * Tool names the child's agent configuration denied explicitly (`false` * entries). An authorization ceiling for child execution: explicit * `invoke_agent` tool requests cannot re-enable them, and they are removed * from the assembled fork tool sources. */ deniedToolNames?: string[]; mcpServers?: readonly AgentServiceMcpServerConfig[]; availableSkillIds?: string[]; skillSelectorPolicy?: import("../../skill/selector.js").ResolvedSkillSelectorPolicy; skillSourcePaths?: Readonly>; loadedSkillResponses?: RuntimeLoadSkillToolContext["loadedSkillResponses"]; loadedSkillReferenceResponses?: RuntimeLoadSkillToolContext["loadedSkillReferenceResponses"]; delegateIds?: string[]; }; /** Public API contract for default hosted invoke agent logger. */ export type DefaultHostedInvokeAgentLogger = { debug(message: string, metadata?: Record): void; info(message: string, metadata?: Record): void; warn(message: string, metadata?: Record): void; error(message: string, metadata?: Record): void; }; /** Public API contract for default hosted invoke agent trace attributes. */ export type DefaultHostedInvokeAgentTraceAttributes = Record; /** Public API contract for default hosted invoke agent trace. */ export type DefaultHostedInvokeAgentTrace = (operationName: string, operation: () => TResult) => TResult; /** Result returned from default hosted invoke agent tool. */ export type DefaultHostedInvokeAgentToolResult = ChildRunExecutionResult | HostedDurableChildInvokeResult; /** Public API contract for default hosted invoke agent project refresh. */ export type DefaultHostedInvokeAgentProjectRefresh = (context: TContext) => Promise | void; /** * Options for the default hosted invoke-agent tool. * `runEventWriterCapability` carries the current parent run's authority and is * delegated internally after each durable child run is persisted. */ export type DefaultHostedInvokeAgentToolOptions = { context: TContext; /** Opaque exact-parent authority used to persist durable delegated child events. */ runEventWriterCapability?: HostedRunEventWriterCapability; getConfig: () => DefaultHostedInvokeAgentConfig; logger: DefaultHostedInvokeAgentLogger; trace: DefaultHostedInvokeAgentTrace; setTraceAttributes: (attributes: DefaultHostedInvokeAgentTraceAttributes) => void; createBashTool: AgentServiceSandboxToolsOptions["createBashTool"]; resolveModelId: (model: string) => string; resolveProvider: (modelId: string) => string; resolveProviderOptions?: (forkModel: string, thinkingConfig: HostedChildForkRuntimeConfig["thinkingConfig"]) => Record | undefined; resolveReasoning?: (forkModel: string, thinkingConfig: HostedChildForkRuntimeConfig["thinkingConfig"]) => RuntimeReasoningOption | undefined; resolveModelThinking?: (modelId: string) => HostedChildForkRuntimeConfig["thinkingConfig"]; shouldRethrowError?: (error: unknown) => boolean; buildGlobalTools?: (context: TContext, childAgentId: string, childConfig?: DefaultHostedChildAgentExecutionConfig, durableChildRun?: HostedChildRunIdentifiers) => HostToolSet; resolveChildAgentExecutionConfig?: (childAgentId: string, projectId: string) => Promise; resolveProjectReference?: HostedProjectReferenceResolver; refreshProjectSkillIds?: DefaultHostedInvokeAgentProjectRefresh; /** Require durable child lifecycle even when legacy generic delegation is disabled. */ requireDurableInvokeAgent?: boolean; defaultModel?: string; defaultMaxSteps?: number; resolveChildAgentId?: (input: DefaultHostedInvokeAgentInput) => string; createAgentServiceSandboxTools?: (input: AgentServiceSandboxToolsOptions) => Promise; createRemoteToolSource?: (config: RemoteMCPToolSourceConfig) => RemoteToolSource; createToolsFromRemoteDefinitions?: typeof createToolsFromRemoteDefinitions; createLiveStudioTools?: Parameters[0]["createLiveStudioTools"]; startRuntime?: (input: StartHostedChildForkRuntimeWithHostToolsInput) => StartedHostedChildForkRuntime | Promise; }; export declare const getDefaultHostedInvokeAgentSelectionSchema: () => import("../../internal-agents/schema.js").Schema; }>>; /** Schema for default hosted invoke agent selection. * @deprecated Use getDefaultHostedInvokeAgentSelectionSchema() */ export declare const defaultHostedInvokeAgentSelectionSchema: import("../../internal-agents/schema.js").Schema; }>>; export declare const getDefaultHostedInvokeAgentInputSchema: () => import("../../internal-agents/schema.js").Schema<{ description: string; prompt: string; context: Record; } & { project_reference?: string | undefined; tools?: string[] | undefined; model?: string | undefined; temperature?: number | undefined; thinking?: number | undefined; max_steps?: number | undefined; result_mode?: "summary" | "full" | "structured" | undefined; } & { agent_id: string; }>; /** Schema for default hosted invoke agent input. * @deprecated Use getDefaultHostedInvokeAgentInputSchema() */ export declare const defaultHostedInvokeAgentInputSchema: import("../../internal-agents/schema.js").Schema<{ description: string; prompt: string; context: Record; } & { project_reference?: string | undefined; tools?: string[] | undefined; model?: string | undefined; temperature?: number | undefined; thinking?: number | undefined; max_steps?: number | undefined; result_mode?: "summary" | "full" | "structured" | undefined; } & { agent_id: string; }>; /** Input payload for default hosted invoke agent. */ type ParsedDefaultHostedInvokeAgentInput = InferSchema>; export type DefaultHostedInvokeAgentInput = Omit & { context?: ParsedDefaultHostedInvokeAgentInput["context"]; }; /** * Removes explicitly denied tool names from the assembled fork tool set. The * assembled sources contain the full discovered and remote catalogs, so an * unrestricted child selector (or an explicit request) would otherwise still * surface a tool the child's agent configuration switched off. */ declare function withoutDeniedForkTools(toolSources: DefaultHostedChildForkToolAssemblySourceResult, deniedToolNames: readonly string[] | undefined): DefaultHostedChildForkToolAssemblySourceResult; declare function applyChildAgentExecutionConfig(input: DefaultHostedInvokeAgentInput, childConfig: DefaultHostedChildAgentExecutionConfig | undefined): DefaultHostedInvokeAgentInput; /** Test-only helpers for fixed-target hosted delegation behavior. */ export declare const defaultHostedInvokeAgentToolInternals: { applyChildAgentExecutionConfig: typeof applyChildAgentExecutionConfig; withoutDeniedForkTools: typeof withoutDeniedForkTools; }; /** Execute default hosted invoke agent tool. */ export declare function executeDefaultHostedInvokeAgentTool(options: DefaultHostedInvokeAgentToolOptions, input: DefaultHostedInvokeAgentInput, childAgentId: string, executionContext?: ToolExecutionContext): Promise; /** Create default hosted invoke agent tool. */ export declare function createDefaultHostedInvokeAgentTool(options: DefaultHostedInvokeAgentToolOptions): import("../../tool/types.js").Tool; export {}; //# sourceMappingURL=default-invoke-agent-tool.d.ts.map