MCPcopy Create free account
hub / github.com/garrytan/gstack / runImport

Function runImport

test/gstack-codex-session-import.test.ts:63–77  ·  view source on GitHub ↗
(sessionPath: string)

Source from the content-addressed store, hash-verified

61}
62
63function runImport(sessionPath: string): { stdout: string; stderr: string; status: number } {
64 const env: Record<string, string> = {};
65 for (const [k, v] of Object.entries(process.env)) {
66 if (v !== undefined) env[k] = v;
67 }
68 env.GSTACK_STATE_ROOT = stateRoot;
69 env.GSTACK_QUESTION_LOG_NO_DERIVE = '1';
70 delete env.GSTACK_HOME;
71 const res = spawnSync(BIN, [sessionPath], { env, encoding: 'utf-8', cwd: ROOT });
72 return {
73 stdout: res.stdout ?? '',
74 stderr: res.stderr ?? '',
75 status: res.status ?? -1,
76 };
77}
78
79function readImportedEvents(): Array<Record<string, unknown>> {
80 const f = path.join(stateRoot, 'projects', cwdSlug, 'question-log.jsonl');

Calls 1

spawnSyncFunction · 0.85

Tested by

no test coverage detected