import type { SessionAuth, SessionParent } from "#context/session-context.js"; import type { AgentSessionContext } from "#execution/agent-sessions/context.js"; import type { HarnessSessionBase } from "#harness/types.js"; import type { RuntimeToolResultActionResult, RuntimeWorkflowTaskRequest, WorkflowToolRunEntry } from "#shared/action-types.js"; import type { WorkflowToolRunAddress, WorkflowToolRunInput } from "#execution/tools/workflow/types.js"; import type { WorkflowToolRunOwner } from "#execution/tools/workflow/messages.js"; /** Starts a new run for each dispatch attempt. Call from a `"use step"` body. */ export declare function startWorkflowToolRun(input: Omit): Promise; /** Everything the session knows when it starts one workflow tool call's run. */ export interface StartWorkflowTaskInput { /** Captured for this call, as the context of the sessions opened for it. */ readonly agentContext: AgentSessionContext; /** The caller's auth the session admits the call with. */ readonly auth: SessionAuth; readonly batchEvent: { readonly sequence: number; readonly stepIndex: number; readonly turnId: string; }; readonly owner: WorkflowToolRunOwner; readonly parentSession: SessionParent | undefined; readonly session: HarnessSessionBase; readonly task: RuntimeWorkflowTaskRequest; } /** Starts the run for one call, which invokes `entry`. */ export declare function startWorkflowToolCallRun(input: StartWorkflowTaskInput, entry: WorkflowToolRunEntry): Promise; /** Starts the run of an `execute` call the turn waits on and records it on the owning session. */ export declare function startWorkflowTask(input: StartWorkflowTaskInput): Promise<{ readonly result?: RuntimeToolResultActionResult; readonly session: HarnessSessionBase; }>; /** The call's tool result when its run could not start. */ export declare function startFailureResult(task: RuntimeWorkflowTaskRequest, error: unknown): RuntimeToolResultActionResult;