import type { RuntimeStore, WorkflowRun } from '../engine/runtime.js'; import { type NativeDeltaOperationResult } from './native-delta-spec.js'; import { type NativePortableArchiveTransaction } from './native-portable-transactions.js'; import type { NativePortableSpecChange, NativePortableState } from './native-portable-types.js'; import type { NativeProjectPaths } from './native-types.js'; export interface NativePortableArchiveResult { change: string; archiveDir: string; transactionId: string; state: NativePortableState; } export interface NativePortableArchiveSpecPreview { readonly capability: string; readonly operation: NativePortableSpecChange['operation']; readonly source: string | null; readonly delta_source?: string; readonly delta_operations?: readonly NativeDeltaOperationResult[]; } export declare class NativePortableArchiveRequiresReverificationError extends Error { readonly state: NativePortableState; constructor(state: NativePortableState); } export declare function nativePortableArchiveDirectory(paths: NativeProjectPaths, state: NativePortableState): string; export declare function hasNativePortableArchiveRecovery(paths: NativeProjectPaths, name: string): Promise; export declare function inspectNativePortableArchive(options: { paths: NativeProjectPaths; name: string; /** SDK Run state is authoritative for new changes; legacy callers omit this. */ state?: NativePortableState; /** Confirmed SDK candidates must stay current even during transaction recovery. */ requireCurrentAcceptance?: boolean; /** SDK 已校验用户确认报告的 hash,沿用该报告的版本,不在预检中改写。 */ verificationReportStateVersion?: number; derivedReport?: boolean; }): Promise<{ ready: boolean; blockers: string[]; capabilityPeers: string[]; archiveDir: string; stateVersion: number; requiresReverification: boolean; specPreview: NativePortableArchiveSpecPreview[]; }>; /** Apply canonical Specs for an SDK-owned Run without committing a second workflow state file. */ export declare function applyNativeSdkArchiveSpecs(options: { paths: NativeProjectPaths; state: NativePortableState; verificationReportStateVersion?: number; derivedReport?: boolean; }): Promise; export declare function inspectNativeSdkArchiveSpecs(options: { paths: NativeProjectPaths; state: NativePortableState; }): Promise<{ transactionId: string; archiveRef: string; stateVersion: number; specCount: number; }>; interface NativeSdkArchiveReceipt { runId: string; change: string; archiveRef: string; transactionId: string; stateVersion: number; reportSha256?: string | null; verificationResultHash?: string; preservedReportsRef?: string; specs: Array<{ capability: string; operation?: string; resultHash?: string | null; }>; } export declare function finalizeNativeSdkArchive(options: { paths: NativeProjectPaths; state: NativePortableState; runId: string; transactionId: string; archiveRef: string; priorReportSha256?: string; /** 已持有 mutation lock;只核对候选,不再获取同一锁。 */ validateCandidate?: () => Promise; derivedReport?: { preservedReportsRef: string; optionalView?: boolean; write: (file: string) => Promise; }; }): Promise; export declare function inspectNativeSdkArchiveFinalization(options: { paths: NativeProjectPaths; state: NativePortableState; runId: string; archiveRef?: string; history?: boolean; verificationResultHash?: string; allowMissingReport?: boolean; }): Promise; export declare function validateNativeSdkArchiveReceipt(options: { paths: NativeProjectPaths; state: NativePortableState; runId: string; archiveRef?: string; }, value: unknown): Promise; /** 旧文档流程复用当前 Spec/归档事务,只转换业务状态,不恢复检查执行。 */ export declare function archiveNativePortableChange(options: { paths: NativeProjectPaths; name: string; }): Promise; /** Commit a recovered prewrite failure only while no Archive writer has started. */ export declare function commitNativeSdkArchiveFailure(options: { projectRoot: string; store: RuntimeStore; runId: string; expectedRevision: number | null; next: WorkflowRun; actionId: string; state: NativePortableState; }): Promise; export {}; //# sourceMappingURL=native-portable-archive.d.ts.map