Lines 22-62javascript
22 for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
27 return function (mod) {
28 if (mod && mod.__esModule) return mod;
30 if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
31 __setModuleDefault(result, mod);
35Object.defineProperty(exports, "__esModule", { value: true });
36exports.CheckpointManager = void 0;
37exports.isMutatingTool = isMutatingTool;
38exports.isPotentiallyMutatingBash = isPotentiallyMutatingBash;
39const fs = __importStar(require("fs"));
40const os = __importStar(require("os"));
41const path = __importStar(require("path"));
42const crypto = __importStar(require("crypto"));
43const child_process_1 = require("child_process");
44// ─── Checkpoint / Rewind ────────────────────────────────────────────────────
LowWeak Crypto
Package source references weak cryptographic algorithms.
dist/checkpoint/manager.jsView on unpkg · L42 46// Snapshots the pre-mutation state of every file a tool is about to change, so
47// the user can rewind the filesystem (and conversation) back to any earlier
48// turn — the same safety net Claude Code's /rewind provides.
50// A "turn" maps 1:1 to a user message. The client calls beginTurn() before the
51// agent runs, the loop records file snapshots as mutating tools fire, and
52// commitTurn() seals the turn into history. restore(id) rolls the working tree
53// back to the state it had just BEFORE that turn ran.
55// Persistence: turns are written to ~/.nexrall/checkpoints/<key>/ on commit,
56// where <key> hashes workDir + an optional session scope. A reload of the CLI
57// or the VS Code window therefore no longer wipes rewind history — resuming
58// the same session in the same directory restores the full checkpoint list.
60// Bash awareness: file snapshots can only cover tool-driven edits. Shell
61// commands (sed -i, git checkout, codemods…) mutate files invisibly. The loop
62// calls recordBashCommand() for potentially-mutating bash; we (a) count them