export type ActionIntent = 'MUTATE' | 'NOOP' | 'UNKNOWN'; export interface TextPatch { oldText: string; newText: string; occurrence?: number; } export interface FileAction { path: string; operation: 'CREATE' | 'MODIFY' | 'DELETE' | 'READ' | 'PATCH'; intent: ActionIntent; content?: string; patches?: TextPatch[]; contentHash?: string; description?: string; } export type VerificationStatus = 'verified' | 'noop' | 'failed' | 'drift'; export interface ActionResult { action: FileAction; status: VerificationStatus; detail: string; before?: FileSnapshotSummary; after?: FileSnapshotSummary; } export interface SWDRunResult { success: boolean; results: ActionResult[]; rolledBack: boolean; rollbackErrors: string[]; errors: string[]; } export interface SWDOptions { dryRun?: boolean; strict?: boolean; enableRollback?: boolean; maxWritableActionContentBytes?: number; maxPatchBytes?: number; onAction?: (action: FileAction) => void; onVerify?: (result: ActionResult) => void; onRollback?: (path: string, success: boolean, error?: string) => void; } export interface FileSnapshot { path: string; exists: boolean; size: number; mtime: number; hash: string; content: Buffer | null; } export interface FileSnapshotSummary { path: string; exists: boolean; size: number; mtime: number; hash: string; } export declare const MAX_WRITABLE_ACTION_CONTENT_BYTES = 200000; export declare const MAX_PATCH_BYTES = 80000; /** * Authoritative filesystem execution kernel. * Lifecycle: Plan → Snapshot_Before → Execute → Snapshot_After → Verify → Commit/Rollback */ export declare class SWDEngine { private options; constructor(options?: SWDOptions); run(actions: FileAction[]): Promise; private executeAction; private verifyInternal; private performRollback; } export declare function resolveSafePath(unsafePath: string): string; export declare function snapshotFile(safeAbsPath: string): FileSnapshot; export declare function parseActions(output: string): FileAction[]; export declare function summarizeActions(output: string, userInput: string): string; //# sourceMappingURL=swd.d.ts.map