import { type RuntimeValue } from './runtime-json.js'; export type RuntimeActionStatus = 'pending' | 'running' | 'unknown' | 'succeeded' | 'failed' | 'cancelled'; export type RuntimeRetryPolicy = 'idempotent' | 'reconcile' | 'manual'; export interface RuntimeArtifactRef { uri: string; sha256: string; } export interface RuntimeClaim { executorId: string; sessionId?: string; /** 关联当前执行尝试,不代表宿主证明或用户授权。 */ token: string; } export interface RuntimeOutcome { actionId: string; attempt: number; inputHash: string; claimToken: string; outcomeId: string; status: 'succeeded' | 'failed'; output: RuntimeValue; artifacts?: RuntimeArtifactRef[]; summary?: string; event?: string; } /** 原领取方确认执行及其子任务已经停止;不声明外部副作用已撤销。 */ export interface RuntimeStoppedAction { actionId: string; attempt: number; inputHash: string; claimToken: string; evidence: string; } export interface RuntimeAction { protocolVersion: 1; id: string; runId: string; stepId: string; type: string; ref?: string; attempt: number; input: RuntimeValue; inputHash: string; status: RuntimeActionStatus; retry: RuntimeRetryPolicy; requiredCapabilities: string[]; claim?: RuntimeClaim; executionOrigin?: { workflow: { id: string; version: string; hash: string; }; }; executionStop?: RuntimeStoppedAction; outcome?: RuntimeOutcome; receipts: { outcomeId: string; hash: string; }[]; rejectedOutcomes?: { outcome: RuntimeOutcome; code: 'OUTPUT_INVALID' | 'OUTCOME_REJECTED' | 'OUTCOME_PROCESSING_ERROR'; reason: string; }[]; reconciliations: { attempt: number; resolution: 'not-executed'; evidence: RuntimeValue; }[]; reason?: string; cancellation?: RuntimeStoppedAction; } export interface CreateRuntimeActionOptions { id: string; runId: string; stepId: string; type: string; ref?: string; input: unknown; attempt?: number; retry?: RuntimeRetryPolicy; requiredCapabilities?: string[]; } export declare function createRuntimeAction(options: CreateRuntimeActionOptions): RuntimeAction; /** 调度器拥有输入快照,后续仅替换,不修改既有上游结果。公开工厂仍隔离外部输入。 */ export declare function createRuntimeActionSnapshot(options: CreateRuntimeActionOptions): RuntimeAction; export declare function claimRuntimeAction(action: RuntimeAction, input: RuntimeClaim & { attempt: number; inputHash: string; executionOrigin?: RuntimeAction['executionOrigin']; }): RuntimeAction; export declare function recordRuntimeOutcome(action: RuntimeAction, outcome: RuntimeOutcome): { action: RuntimeAction; duplicate: boolean; }; export declare function markRuntimeActionUnknown(action: RuntimeAction, reason: string): RuntimeAction; export declare function retryRuntimeAction(action: RuntimeAction, reconciliation?: { resolution: 'not-executed'; evidence: unknown; }): RuntimeAction; export declare function cancelRuntimeAction(action: RuntimeAction, reason: string): RuntimeAction; export declare function acknowledgeRuntimeActionCancellation(action: RuntimeAction, stopped: RuntimeStoppedAction): RuntimeAction; /** 原执行者确认终态任务已停止,不改变已经确认的执行结果。 */ export declare function acknowledgeRuntimeActionStopped(action: RuntimeAction, stopped: RuntimeStoppedAction): RuntimeAction; export declare function parseRuntimeOutcome(value: unknown): RuntimeOutcome; /** 在持久化/传输边界恢复记录,不从缺失字段推断执行归属或成功状态。 */ export declare function parseRuntimeAction(value: unknown): RuntimeAction; /** 调用者已完成整个 Run 的 JSON 校验和隔离复制,逐项校验时复用该副本。 */ export declare function validateRuntimeActionSnapshot(data: RuntimeValue, inputHash?: string): RuntimeAction; //# sourceMappingURL=runtime-action.d.ts.map