import type { SessionContext } from "#context/session-context.js";
import type { WorkflowToolContext } from "#tools/workflow-definition.js";
import { type WorkflowToolRunOutcome, type WorkflowToolRunOwner, type WorkflowToolRunRef } from "#execution/tools/workflow/messages.js";
import type { JsonObject, JsonValue } from "#shared/json.js";
export interface WorkflowBodyDefinition {
    /** Snapshot added for new runs; absent only when resuming an older durable payload. */
    readonly agents?: WorkflowToolContext["agents"];
    readonly callId: string;
    /**
     * Whether the owning session can reach a human. `false` makes `ctx.ask()`
     * resolve as `unavailable` instead of waiting for an answer no one can give.
     */
    readonly canRequestInput?: boolean;
    readonly executeInput?: JsonValue;
    readonly input: JsonObject;
    readonly session: SessionContext["session"];
    readonly stepIndex: number;
    readonly toolName: string;
    readonly workflowId: string;
}
export interface WorkflowBodyInput extends WorkflowBodyDefinition {
    readonly owner: WorkflowToolRunOwner;
}
export interface WorkflowBodyResult {
    readonly outcome: WorkflowToolRunOutcome;
    readonly reportCount: number;
}
/** Executes one registered workflow body and reports progress to its owner. */
export declare function executeWorkflowBody(input: WorkflowBodyInput & {
    readonly execution: "background" | "blocking";
    readonly runId?: string;
}, signal: AbortSignal): Promise<WorkflowBodyResult>;
export declare function createWorkflowBodyRef(input: WorkflowBodyDefinition & {
    readonly execution: "background" | "blocking";
    readonly runId?: string;
}): WorkflowToolRunRef;
