(line: string)
| 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> = { |