MCPcopy Create free account
hub / github.com/UsefulSoftwareCo/executor / resetExecutorState

Function resetExecutorState

apps/desktop/src/main/reset-state.ts:40–53  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

38 * responsible for stopping the sidecar first and restarting it after.
39 */
40export const resetExecutorState = (): ResetStateResult => {
41 const dataDir = join(homedir(), ".executor");
42 const backupDir = join(dataDir, "backups", backupStamp());
43 mkdirSync(backupDir, { recursive: true });
44 const moved: string[] = [];
45 for (const entry of STATE_ENTRIES) {
46 const from = join(dataDir, entry);
47 if (!existsSync(from)) continue;
48 renameSync(from, join(backupDir, entry));
49 moved.push(entry);
50 }
51 log.info("[reset-state] moved executor state to backup", { backupDir, moved });
52 return { backupDir, moved };
53};
54
55/**
56 * Confirmation dialog shared by every surface that offers a reset. Returns

Callers 2

registerIpcHandlersFunction · 0.90

Calls 3

backupStampFunction · 0.85
pushMethod · 0.80
infoMethod · 0.65

Tested by

no test coverage detected