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

Function writeSessionFile

test/gstack-codex-session-import.test.ts:35–45  ·  view source on GitHub ↗
(events: Array<Record<string, unknown>>, sessionId = 'sess-fixture')

Source from the content-addressed store, hash-verified

33});
34
35function writeSessionFile(events: Array<Record<string, unknown>>, sessionId = 'sess-fixture'): string {
36 const p = path.join(stateRoot, 'rollout-fixture.jsonl');
37 const meta = {
38 timestamp: new Date().toISOString(),
39 type: 'session_meta',
40 payload: { id: sessionId, cwd: fixtureCwd },
41 };
42 const lines = [JSON.stringify(meta), ...events.map((e) => JSON.stringify(e))];
43 fs.writeFileSync(p, lines.join('\n') + '\n');
44 return p;
45}
46
47function agentMessage(text: string): Record<string, unknown> {
48 return {

Calls

no outgoing calls

Tested by

no test coverage detected