MCPcopy
hub / github.com/Doorman11991/smallcode / getSnapshotManager

Function getSnapshotManager

src/session/snapshot.js:222–233  ·  view source on GitHub ↗
(options)

Source from the content-addressed store, hash-verified

220let _instance = null;
221
222function getSnapshotManager(options) {
223 const wantedCwd = (options && options.workdir) || process.cwd();
224 if (_instance && _instance.workdir === wantedCwd) return _instance;
225 // cwd changed — abandon old (any open checkpoint is discarded silently) and rebuild
226 _instance = new SnapshotManager({
227 workdir: wantedCwd,
228 snapshotDir: (options && options.snapshotDir),
229 disable: (options && options.disable),
230 autoRollback: (options && options.autoRollback),
231 });
232 return _instance;
233}
234
235function resetSnapshotManager() {
236 if (_instance) {

Callers 3

verifyAndFixCompiledFunction · 0.85
runAgentLoopFunction · 0.85
executeToolFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected