MCPcopy Create free account
hub / github.com/TraderAlice/OpenAlice / extractHeadlessSessionId

Function extractHeadlessSessionId

src/workspaces/adapters/opencode.ts:116–123  ·  view source on GitHub ↗
(line: string)

Source from the content-addressed store, hash-verified

114 // (`ses_…`) from the first line (verified 2026-06-11) — resumable via
115 // `opencode --session <id>`.
116 extractHeadlessSessionId(line: string): string | null {
117 try {
118 const evt = JSON.parse(line) as Record<string, unknown>;
119 return typeof evt['sessionID'] === 'string' ? evt['sessionID'] : null;
120 } catch {
121 return null;
122 }
123 },
124
125 composeEnv(ctx: SpawnContext): Record<string, string> {
126 const env: Record<string, string> = {

Callers

nothing calls this directly

Calls 1

parseMethod · 0.80

Tested by

no test coverage detected