import type { CancelTurnInput, CancelTurnResult, DispatchSessionInput, Runtime, SessionCommand, SessionCommandResult } from "#channel/types.js"; import { type Run, type StartOptionsWithoutDeploymentId, type WorkflowFunction, type WorkflowMetadata } from "#internal/workflow/runtime.js"; import type { RuntimeCompiledArtifactsSource } from "#runtime/compiled-artifacts-source.js"; import { type SessionHandoffStart } from "#execution/session/entry-input.js"; import type { SessionCheckpoint } from "#execution/session/handoff.js"; import type { DynamicSubagentAgentConfig } from "#runtime/subagents/dynamic-agent-config.js"; interface WorkflowHookRecord { readonly runId: string; } /** * Stable workflow reference used by `start()` to locate the workflow * entrypoint registered by the Workflow DevKit builder. The id omits * the package version stamp so the long-lived owner can rotate across * deployments without rewriting the registry key. */ export declare const workflowEntryReference: { workflowId: string; }; /** Stable workflow reference for session deadline timers. */ export declare const sessionTimeoutWorkflowReference: { workflowId: string; }; /** Stable workflow reference for authored workflow tool runs. */ export declare const workflowToolRunWorkflowReference: { workflowId: string; }; /** * Creates a workflow-backed runtime whose current owner executes turns and * whose original run retains the public event stream across owner handoffs. */ export declare function createWorkflowRuntime(config: { readonly compiledArtifactsSource: RuntimeCompiledArtifactsSource; readonly dynamicSubagentAgentConfig?: DynamicSubagentAgentConfig; readonly nodeId?: string; }): Runtime; export type SessionOwnerStartInput = SessionHandoffStart & { readonly activationToken: string; /** Original run whose stream stays the public session stream. */ readonly anchorRunId: string; readonly checkpoint: SessionCheckpoint; readonly targetDeploymentId: string; }; /** Starts a successor owner and binds its output to the original session stream. */ export declare function startSessionOwnerStep(input: SessionOwnerStartInput): Promise; /** * Sends one command to a session through its stable command inbox. A caller * holding the session id asked for that exact session, so a send to a * stranded one is refused rather than replaced. */ export declare function dispatchWorkflowSessionCommand(input: DispatchSessionInput): Promise>; /** Requests cancellation through a session's stable command inbox. */ export declare function requestWorkflowTurnCancellation(input: CancelTurnInput): Promise; /** * Resolves hook ownership for replay-idempotent work already running inside a * durable step. Request handlers must return from start/resume acceptance and * leave ownership arbitration to the workflow. */ export declare function waitForCommandHookOwner(token: string): Promise; /** Starts a workflow on the deployment executing this call. */ export declare function startWorkflowOnCurrentDeployment(workflow: WorkflowFunction | WorkflowMetadata, args: TArgs, options?: StartOptionsWithoutDeploymentId): Promise | Run>; export {};