MCPcopy Create free account
hub / github.com/SethGammon/Citadel / runSession

Function runSession

scripts/local-daemon.js:67–84  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

65}
66
67function runSession() {
68 return new Promise((resolve) => {
69 const cmd = 'claude';
70 const cliArgs = ['--dangerously-skip-permissions', '-p', '/do continue'];
71 if (opts.dryRun) {
72 log(`DRY RUN would spawn: ${cmd} ${cliArgs.join(' ')}`);
73 return resolve(0);
74 }
75 const proc = spawn(cmd, cliArgs, {
76 cwd: ROOT,
77 stdio: 'inherit',
78 env: { ...process.env, CLAUDE_NON_INTERACTIVE: '1' },
79 shell: process.platform === 'win32',
80 });
81 proc.on('close', (code) => resolve(code ?? 0));
82 proc.on('error', (err) => { log(`spawn error: ${err.message}`); resolve(1); });
83 });
84}
85
86async function sleep(ms) { return new Promise((r) => setTimeout(r, ms)); }
87

Callers 1

mainFunction · 0.85

Calls 1

logFunction · 0.85

Tested by

no test coverage detected