import type { HostToolTraceAttributes } from "../../tool/index.js"; import type { AgentSystem } from "../types.js"; import { type HostedDurableChildForkRunContext } from "./child-fork-run-context.js"; import { type DefaultHostedChildForkToolAssemblyResult } from "./child-requested-tools.js"; import { type HostedChildForkInstructionsContext } from "./child-fork-instructions.js"; import { type HostedChildForkRuntimeStepSystemResolver } from "./child-fork-step-message-preparation.js"; import { type StartedHostedChildForkRuntime, type StartHostedChildForkRuntimeWithHostToolsInput } from "./child-fork-runtime-start.js"; import { type AgentRuntimeForkStepRunner } from "../streaming/fork-runtime-stream.js"; import { type HostedRunEventWriterCapability } from "./child-run-event-writer-token.js"; import type { ChildRunExecutionResult, ChildRunExecutionSnapshot } from "../child-run/execution-snapshot.js"; import type { ChildRunResultMode } from "../child-run/result-summary.js"; import type { RuntimeReasoningOption } from "../types.js"; import type { HostedConversationRunChunkMirrorTraceAttributes } from "../conversation/run-chunk-mirror.js"; import type { HostedChildExecutionLogEntry } from "./child-execution-logging.js"; import type { HostedChildForkStreamLogger, HostedChildForkStreamTraceInput } from "./child-fork-stream-execution.js"; import type { HostedChildRunIdentifiers } from "./child-status.js"; import { type HostedChildForkRuntimeConfig, type HostedChildForkToolInput, type HostedChildInvocationContext, type ResolveHostedChildForkRuntimeConfigInput } from "./child-tool-input.js"; import type { SourceIntegrationPolicyManifest } from "../../integrations/source-policy.js"; import { type HostedProjectReferenceResolver } from "./project-reference-resolver.js"; /** Default value for hosted child fork stream idle timeout ms. */ export declare const DEFAULT_HOSTED_CHILD_FORK_STREAM_IDLE_TIMEOUT_MS = 45000; /** Default value for hosted child fork stream active tool timeout ms. */ export declare const DEFAULT_HOSTED_CHILD_FORK_STREAM_ACTIVE_TOOL_TIMEOUT_MS: number; /** Default value for hosted child fork stream post tool idle timeout ms. */ export declare const DEFAULT_HOSTED_CHILD_FORK_STREAM_POST_TOOL_IDLE_TIMEOUT_MS: number; /** Default value for hosted child fork stream finalization timeout ms. */ export declare const DEFAULT_HOSTED_CHILD_FORK_STREAM_FINALIZATION_TIMEOUT_MS = 10000; /** Default value for hosted child status poll interval ms. */ export declare const DEFAULT_HOSTED_CHILD_STATUS_POLL_INTERVAL_MS = 2000; /** Public API contract for hosted child fork execution instrumentation. */ export type HostedChildForkExecutionInstrumentation = { trace?: (operationName: string, operation: () => TResult) => TResult; setTraceAttributes?: (attributes: TAttributes | HostedConversationRunChunkMirrorTraceAttributes) => void; buildToolTraceAttributes?: (input: { toolName: string; toolCallId: string | undefined; }) => TAttributes | undefined; tracePart?: (input: HostedChildForkStreamTraceInput) => void | Promise; debug?: (message: string, metadata?: Record) => void; warn?: (message: string, metadata?: Record) => void; error?: (message: string, metadata?: Record) => void; }; export type HostedChildForkExecutionRunContextFactoryInput = { authToken: string; apiUrl: string; /** Exact-child durable event-writer authority. */ runEventWriterCapability?: HostedRunEventWriterCapability; durableChildRun?: HostedChildRunIdentifiers; conversationId?: string; parentRunId?: string; description: string; instrumentation?: HostedChildForkExecutionInstrumentation; pendingToolLogWriter?: { warn: (message: string, metadata?: Record) => void; }; }; /** * Input for a hosted child fork whose tools are already prepared. * Durable execution requires a capability bound to `durableChildRun.childRunId`. */ export type ExecuteHostedChildForkWithPreparedToolsInput = { authToken: string; apiUrl: string; /** Exact-child authority required when `durableChildRun` is present. */ runEventWriterCapability?: HostedRunEventWriterCapability; projectId?: string | null; description: string; kind: string; provider: string; forkModel: string; temperature?: number; maxSteps: number; effectivePrompt: string; forkContext?: HostedChildForkInstructionsContext; toolAssembly: DefaultHostedChildForkToolAssemblyResult; abortSignal?: AbortSignal; durableChildRun?: HostedChildRunIdentifiers; parentConversationId?: string; conversationId?: string; parentRunId?: string; parentMessageId?: string; trustedInvocationContext?: HostedChildInvocationContext; pendingToolLogWriter?: { warn: (message: string, metadata?: Record) => void; }; logger?: HostedChildForkStreamLogger; instrumentation?: HostedChildForkExecutionInstrumentation; providerOptions?: Record; reasoning?: RuntimeReasoningOption; sourceIntegrationPolicy?: SourceIntegrationPolicyManifest; maxContinuationSteps?: number; resolveSystem?: HostedChildForkRuntimeStepSystemResolver; buildInstructions?: () => AgentSystem; onBeforeStop?: StartHostedChildForkRuntimeWithHostToolsInput["onBeforeStop"]; runStep?: AgentRuntimeForkStepRunner; createRunContext?: (input: HostedChildForkExecutionRunContextFactoryInput) => HostedDurableChildForkRunContext; startRuntime?: (input: StartHostedChildForkRuntimeWithHostToolsInput) => StartedHostedChildForkRuntime | Promise; childRunMonitorPollIntervalMs?: number; idleTimeoutMs?: number; activeToolTimeoutMs?: number; postToolIdleTimeoutMs?: number; finalizationTimeoutMs?: number; startTime?: number; resultMode?: ChildRunResultMode; onSettled?: (snapshot: ChildRunExecutionSnapshot) => void | Promise; writeLog?: (entry: HostedChildExecutionLogEntry) => void; shouldRethrowError?: (error: unknown) => boolean; }; /** * Options for executing a hosted child-fork tool input. * When `durableChildRun` is present, `runEventWriterCapability` must carry * exact-child authority; parent and sibling capabilities fail before dispatch. */ export type ExecuteHostedChildForkToolInputOptions = Omit, "description" | "provider" | "forkModel" | "maxSteps" | "effectivePrompt" | "toolAssembly" | "providerOptions" | "reasoning"> & { forkInput: HostedChildForkToolInput; toolCallId: string; defaultModel: string; defaultMaxSteps: number; contextModel?: string; onRequestedProjectId?: (projectId: string, projectSlug?: string) => void | Promise; resolveProjectReference?: HostedProjectReferenceResolver; prepareToolAssembly: (input: { runtimeConfig: HostedChildForkRuntimeConfig; requestedTools?: HostedChildForkToolInput["tools"]; abortSignal?: AbortSignal; }) => DefaultHostedChildForkToolAssemblyResult | Promise; resolveModelId: ResolveHostedChildForkRuntimeConfigInput["resolveModelId"]; resolveProvider: ResolveHostedChildForkRuntimeConfigInput["resolveProvider"]; resolveProviderOptions?: (forkModel: string, thinkingConfig: HostedChildForkRuntimeConfig["thinkingConfig"]) => Record | undefined; resolveReasoning?: (forkModel: string, thinkingConfig: HostedChildForkRuntimeConfig["thinkingConfig"]) => RuntimeReasoningOption | undefined; resolveModelThinking?: ResolveHostedChildForkRuntimeConfigInput["resolveModelThinking"]; onRuntimeConfig?: (runtimeConfig: HostedChildForkRuntimeConfig) => void | Promise; inputAlreadyHasInvocationContext?: boolean; }; /** Input payload for execute hosted child fork tool. */ export declare function executeHostedChildForkToolInput(input: ExecuteHostedChildForkToolInputOptions): Promise; /** Execute hosted child fork with prepared tools. */ export declare function executeHostedChildForkWithPreparedTools(input: ExecuteHostedChildForkWithPreparedToolsInput): Promise; //# sourceMappingURL=child-fork-execution-runner.d.ts.map