orquesta-agent 0.2.212 → 0.2.215

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,28 @@
1
+ import { AgentLogEntry } from './types/agent-logs.js';
2
+ interface TailerHandle {
3
+ stop: () => void;
4
+ }
5
+ export interface StartTranscriptTailOptions {
6
+ /** Exact `<id>.jsonl` to watch (the --session-id we passed), or null on resume. */
7
+ sessionFileId: string | null;
8
+ /** Session start epoch ms — used to pick the newest file on the resume path. */
9
+ startedAtMs: number;
10
+ /**
11
+ * Returns the prompt id the dashboard currently has open for THIS turn, so the
12
+ * broadcast log can be tagged. May be undefined between turns; entries are still
13
+ * broadcast (the dashboard attaches them to its active prompt).
14
+ */
15
+ getPromptId: () => string | undefined;
16
+ /** Called for every structured entry parsed from the transcript. */
17
+ onLog: (entry: AgentLogEntry) => void;
18
+ /** Optional logger for diagnostics (best-effort, never throws). */
19
+ log?: (msg: string) => void;
20
+ }
21
+ /**
22
+ * Begin tailing the Claude transcript for a session. Returns a handle with
23
+ * `stop()`. Safe to call even if the file never appears — it self-cancels after
24
+ * DISCOVERY_TIMEOUT_MS. Never throws.
25
+ */
26
+ export declare function startTranscriptTail(opts: StartTranscriptTailOptions): TailerHandle;
27
+ export {};
28
+ //# sourceMappingURL=claude-transcript.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"claude-transcript.d.ts","sourceRoot":"","sources":["../src/claude-transcript.ts"],"names":[],"mappings":"AA8BA,OAAO,EACL,aAAa,EAKd,MAAM,uBAAuB,CAAA;AAO9B,UAAU,YAAY;IACpB,IAAI,EAAE,MAAM,IAAI,CAAA;CACjB;AAwID,MAAM,WAAW,0BAA0B;IACzC,mFAAmF;IACnF,aAAa,EAAE,MAAM,GAAG,IAAI,CAAA;IAC5B,gFAAgF;IAChF,WAAW,EAAE,MAAM,CAAA;IACnB;;;;OAIG;IACH,WAAW,EAAE,MAAM,MAAM,GAAG,SAAS,CAAA;IACrC,oEAAoE;IACpE,KAAK,EAAE,CAAC,KAAK,EAAE,aAAa,KAAK,IAAI,CAAA;IACrC,mEAAmE;IACnE,GAAG,CAAC,EAAE,CAAC,GAAG,EAAE,MAAM,KAAK,IAAI,CAAA;CAC5B;AAED;;;;GAIG;AACH,wBAAgB,mBAAmB,CAAC,IAAI,EAAE,0BAA0B,GAAG,YAAY,CA+ElF"}
@@ -0,0 +1,249 @@
1
+ /**
2
+ * Claude Code transcript tailer.
3
+ *
4
+ * Interactive `claude` sessions render their conversation as a TUI in the
5
+ * terminal's alternate screen. Scraping that screen (what the dashboard used to
6
+ * do) only ever recovered status-bar chrome and partial keystrokes — never the
7
+ * actual tool calls, results, or assistant text. So the persisted agent_logs for
8
+ * an interactive session were precarious noise.
9
+ *
10
+ * Claude Code ALSO writes a structured, append-only transcript to disk at
11
+ * ~/.claude/projects/<encoded-cwd>/<session-id>.jsonl
12
+ * — one JSON object per line: user turns, assistant turns (text + tool_use +
13
+ * thinking blocks), and tool_result turns. This module tails that file and maps
14
+ * each event to a structured AgentLogEntry, which the agent broadcasts so the
15
+ * dashboard can persist rich, structured logs (tool_call / tool_result / output /
16
+ * thinking) with a populated `details` column — exactly like dispatch/hook
17
+ * prompts.
18
+ *
19
+ * The agent pins the file name by passing `--session-id <uuid>` to claude, so we
20
+ * know precisely which file to watch. On `--continue` (resume) we can't control
21
+ * the id, so the caller passes `null` and we adopt the newest *.jsonl whose mtime
22
+ * is at/after the session start.
23
+ *
24
+ * Cross-platform: pure fs polling (no fs.watch — flaky on network/Windows FS),
25
+ * os.homedir() + path.join everywhere. Read-only, best-effort: any error is
26
+ * swallowed so a tailer hiccup can never disrupt the live session.
27
+ */
28
+ import * as fs from 'fs';
29
+ import * as path from 'path';
30
+ import * as os from 'os';
31
+ import { createThinkingLog, createToolCallLog, createToolResultLog, createOutputLog, } from './types/agent-logs.js';
32
+ /** Poll cadence for both file discovery and tailing new bytes. */
33
+ const POLL_INTERVAL_MS = 500;
34
+ /** Give up waiting for the transcript file to appear after this long. */
35
+ const DISCOVERY_TIMEOUT_MS = 60_000;
36
+ /** Root dir where Claude Code stores per-project transcripts. */
37
+ function claudeProjectsRoot() {
38
+ return path.join(os.homedir(), '.claude', 'projects');
39
+ }
40
+ /**
41
+ * Find the transcript file for this session.
42
+ * - When `sessionFileId` is set, the file is `<sessionFileId>.jsonl` under SOME
43
+ * project subdir (the encoding of cwd → dir name is claude-internal, so we glob
44
+ * by name across project dirs rather than recompute it).
45
+ * - Otherwise (resume) pick the newest *.jsonl modified at/after `sinceMs`.
46
+ */
47
+ function findTranscriptFile(sessionFileId, sinceMs) {
48
+ const root = claudeProjectsRoot();
49
+ let projectDirs;
50
+ try {
51
+ projectDirs = fs.readdirSync(root).map(d => path.join(root, d));
52
+ }
53
+ catch {
54
+ return null; // ~/.claude/projects doesn't exist yet
55
+ }
56
+ if (sessionFileId) {
57
+ const target = `${sessionFileId}.jsonl`;
58
+ for (const dir of projectDirs) {
59
+ const candidate = path.join(dir, target);
60
+ try {
61
+ if (fs.statSync(candidate).isFile())
62
+ return candidate;
63
+ }
64
+ catch { /* not in this project dir */ }
65
+ }
66
+ return null;
67
+ }
68
+ // Resume path: newest jsonl touched since the session started.
69
+ let newest = null;
70
+ for (const dir of projectDirs) {
71
+ let entries;
72
+ try {
73
+ entries = fs.readdirSync(dir);
74
+ }
75
+ catch {
76
+ continue;
77
+ }
78
+ for (const name of entries) {
79
+ if (!name.endsWith('.jsonl'))
80
+ continue;
81
+ const file = path.join(dir, name);
82
+ try {
83
+ const st = fs.statSync(file);
84
+ if (!st.isFile() || st.mtimeMs < sinceMs - 2000)
85
+ continue;
86
+ if (!newest || st.mtimeMs > newest.mtimeMs)
87
+ newest = { file, mtimeMs: st.mtimeMs };
88
+ }
89
+ catch { /* race: file vanished */ }
90
+ }
91
+ }
92
+ return newest?.file ?? null;
93
+ }
94
+ /**
95
+ * Map one parsed transcript JSON object to zero or more structured log entries.
96
+ * `toolNames` carries tool_use_id → tool name across turns so a later
97
+ * tool_result (which only references the id) can be labelled with its tool.
98
+ */
99
+ function mapTranscriptEntry(obj, promptId, toolNames) {
100
+ const out = [];
101
+ const type = obj.type;
102
+ const message = obj.message;
103
+ if (!message || !Array.isArray(message.content)) {
104
+ // Some lines (summary/system) have no message content — nothing to log.
105
+ return out;
106
+ }
107
+ const content = message.content;
108
+ if (type === 'assistant') {
109
+ for (const block of content) {
110
+ const btype = block.type;
111
+ if (btype === 'text' && typeof block.text === 'string' && block.text.trim()) {
112
+ out.push(createOutputLog(block.text, 'markdown', 'info', promptId));
113
+ }
114
+ else if (btype === 'thinking' && typeof block.thinking === 'string' && block.thinking.trim()) {
115
+ out.push(createThinkingLog(block.thinking, 'info', promptId));
116
+ }
117
+ else if (btype === 'tool_use' && typeof block.name === 'string') {
118
+ const id = typeof block.id === 'string' ? block.id : undefined;
119
+ if (id)
120
+ toolNames.set(id, block.name);
121
+ out.push(createToolCallLog(block.name, block.input || {}, 'info', promptId, id));
122
+ }
123
+ }
124
+ }
125
+ else if (type === 'user') {
126
+ // User turns are either the operator's prompt (skip — we already have it as
127
+ // the prompt content) or tool_result blocks coming back from a prior call.
128
+ for (const block of content) {
129
+ if (block.type !== 'tool_result')
130
+ continue;
131
+ const id = typeof block.tool_use_id === 'string' ? block.tool_use_id : undefined;
132
+ const name = (id && toolNames.get(id)) || 'tool';
133
+ const isError = block.is_error === true;
134
+ out.push(createToolResultLog(name, !isError, isError ? undefined : stringifyToolResult(block.content), isError ? stringifyToolResult(block.content) : undefined, undefined, promptId, id));
135
+ }
136
+ }
137
+ return out;
138
+ }
139
+ /** Tool result content can be a string or an array of {type:'text',text} blocks. */
140
+ function stringifyToolResult(content) {
141
+ if (typeof content === 'string')
142
+ return content;
143
+ if (Array.isArray(content)) {
144
+ return content
145
+ .map(c => {
146
+ if (typeof c === 'string')
147
+ return c;
148
+ if (c && typeof c === 'object' && typeof c.text === 'string') {
149
+ return c.text;
150
+ }
151
+ return '';
152
+ })
153
+ .filter(Boolean)
154
+ .join('\n');
155
+ }
156
+ return '';
157
+ }
158
+ /**
159
+ * Begin tailing the Claude transcript for a session. Returns a handle with
160
+ * `stop()`. Safe to call even if the file never appears — it self-cancels after
161
+ * DISCOVERY_TIMEOUT_MS. Never throws.
162
+ */
163
+ export function startTranscriptTail(opts) {
164
+ let stopped = false;
165
+ let timer = null;
166
+ let resolvedFile = null;
167
+ let offset = 0;
168
+ let partial = '';
169
+ const toolNames = new Map();
170
+ const discoveryDeadline = opts.startedAtMs + DISCOVERY_TIMEOUT_MS;
171
+ const schedule = () => {
172
+ if (stopped)
173
+ return;
174
+ timer = setTimeout(tick, POLL_INTERVAL_MS);
175
+ };
176
+ const tick = () => {
177
+ if (stopped)
178
+ return;
179
+ try {
180
+ if (!resolvedFile) {
181
+ resolvedFile = findTranscriptFile(opts.sessionFileId, opts.startedAtMs);
182
+ if (!resolvedFile) {
183
+ if (Date.now() > discoveryDeadline) {
184
+ opts.log?.('[transcript] file never appeared — giving up');
185
+ stopped = true;
186
+ return;
187
+ }
188
+ return schedule();
189
+ }
190
+ opts.log?.(`[transcript] tailing ${resolvedFile}`);
191
+ }
192
+ // Read any bytes appended since last offset.
193
+ const st = fs.statSync(resolvedFile);
194
+ if (st.size < offset) {
195
+ // File truncated/rotated — restart from the top.
196
+ offset = 0;
197
+ partial = '';
198
+ }
199
+ if (st.size > offset) {
200
+ const fd = fs.openSync(resolvedFile, 'r');
201
+ try {
202
+ const len = st.size - offset;
203
+ const buf = Buffer.alloc(len);
204
+ fs.readSync(fd, buf, 0, len, offset);
205
+ offset = st.size;
206
+ partial += buf.toString('utf-8');
207
+ }
208
+ finally {
209
+ fs.closeSync(fd);
210
+ }
211
+ // Process complete lines; keep the trailing partial for next tick.
212
+ const lines = partial.split('\n');
213
+ partial = lines.pop() ?? '';
214
+ const promptId = opts.getPromptId();
215
+ for (const line of lines) {
216
+ const trimmed = line.trim();
217
+ if (!trimmed)
218
+ continue;
219
+ let obj;
220
+ try {
221
+ obj = JSON.parse(trimmed);
222
+ }
223
+ catch {
224
+ continue; // partial/corrupt line — skip
225
+ }
226
+ for (const entry of mapTranscriptEntry(obj, promptId, toolNames)) {
227
+ try {
228
+ opts.onLog(entry);
229
+ }
230
+ catch { /* sink swallows */ }
231
+ }
232
+ }
233
+ }
234
+ }
235
+ catch (err) {
236
+ opts.log?.(`[transcript] tick error: ${err instanceof Error ? err.message : String(err)}`);
237
+ }
238
+ schedule();
239
+ };
240
+ schedule();
241
+ return {
242
+ stop: () => {
243
+ stopped = true;
244
+ if (timer)
245
+ clearTimeout(timer);
246
+ },
247
+ };
248
+ }
249
+ //# sourceMappingURL=claude-transcript.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"claude-transcript.js","sourceRoot":"","sources":["../src/claude-transcript.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AACH,OAAO,KAAK,EAAE,MAAM,IAAI,CAAA;AACxB,OAAO,KAAK,IAAI,MAAM,MAAM,CAAA;AAC5B,OAAO,KAAK,EAAE,MAAM,IAAI,CAAA;AACxB,OAAO,EAEL,iBAAiB,EACjB,iBAAiB,EACjB,mBAAmB,EACnB,eAAe,GAChB,MAAM,uBAAuB,CAAA;AAE9B,kEAAkE;AAClE,MAAM,gBAAgB,GAAG,GAAG,CAAA;AAC5B,yEAAyE;AACzE,MAAM,oBAAoB,GAAG,MAAM,CAAA;AAMnC,iEAAiE;AACjE,SAAS,kBAAkB;IACzB,OAAO,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC,OAAO,EAAE,EAAE,SAAS,EAAE,UAAU,CAAC,CAAA;AACvD,CAAC;AAED;;;;;;GAMG;AACH,SAAS,kBAAkB,CAAC,aAA4B,EAAE,OAAe;IACvE,MAAM,IAAI,GAAG,kBAAkB,EAAE,CAAA;IACjC,IAAI,WAAqB,CAAA;IACzB,IAAI,CAAC;QACH,WAAW,GAAG,EAAE,CAAC,WAAW,CAAC,IAAI,CAAC,CAAC,GAAG,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WAAW;IAC1B,SAAS,EAAE,MAAM,CAAA;IACjB,UAAU,EAAE,MAAM,GAAG,IAAI,CAAA;IACzB,YAAY,EAAE,MAAM,GAAG,IAAI,CAAA;IAC3B,gBAAgB,EAAE,MAAM,CAAA;IACxB,MAAM,EAAE,MAAM,CAAA;IACd,OAAO,CAAC,EAAE,QAAQ,GAAG,UAAU,GAAG,MAAM,CAAA;CACzC;AAED;;;;GAIG;AACH,wBAAgB,cAAc,IAAI,WAAW,EAAE,CAe9C;AAED;;;GAGG;AACH,wBAAgB,gBAAgB,IAAI;IAAE,MAAM,EAAE,OAAO,CAAC;IAAC,SAAS,EAAE,MAAM,GAAG,IAAI,CAAC;IAAC,gBAAgB,EAAE,MAAM,GAAG,IAAI,CAAC;IAAC,MAAM,EAAE,MAAM,GAAG,IAAI,CAAC;IAAC,OAAO,CAAC,EAAE,QAAQ,GAAG,UAAU,GAAG,MAAM,CAAC;IAAC,QAAQ,EAAE,WAAW,EAAE,CAAA;CAAE,CAe3M;AAsBD;;;GAGG;AACH,wBAAgB,gBAAgB,CAAC,SAAS,CAAC,EAAE,MAAM,GAAG,IAAI,CAoBzD"}
package/dist/executor.js CHANGED
@@ -6,6 +6,28 @@ import { spawn, execSync } from 'child_process';
6
6
  // can't load — Interactive Session is the only feature that hard-requires it.
7
7
  let ptySpawn = null;
8
8
  let ptyLoadError = null;
9
+ // On-disk self-heal for the native PTY binding. The standalone bun binary
10
+ // compiles node-pty as `--external`, so it is NOT embedded and cannot be
11
+ // resolved from the $bunfs root at runtime — interactive sessions then fail on
12
+ // EVERY standalone install, on every platform (one-shot prompts are unaffected).
13
+ // As a self-heal we keep a user-writable cache of the prebuilt binding under the
14
+ // agent's home dir and, when the normal resolution fails, load it from there —
15
+ // or, if it's missing, fetch it with a plain (non-global, NO-root) `npm install`.
16
+ // node-pty-prebuilt-multiarch ships N-API prebuilds, so no build toolchain is
17
+ // needed and bun loads the prebuilt `.node` + the on-disk spawn-helper directly
18
+ // (the cache is a real directory, unlike $bunfs). Keep NODE_PTY_VERSION in sync
19
+ // with the package.json dependency.
20
+ const NODE_PTY_PKG = '@homebridge/node-pty-prebuilt-multiarch';
21
+ const NODE_PTY_VERSION = '0.13.1';
22
+ function nativeCacheRoot() {
23
+ return path.join(os.homedir(), '.orquesta-agent', 'native');
24
+ }
25
+ function nativeCacheEntry() {
26
+ return path.join(nativeCacheRoot(), 'node_modules', '@homebridge', 'node-pty-prebuilt-multiarch');
27
+ }
28
+ // Attempt the (slow) npm provisioning at most once per process so a box that
29
+ // genuinely can't install (no Node/npm) doesn't re-run it on every Start Session.
30
+ let ptyProvisionAttempted = false;
9
31
  // Lazy + RETRYABLE binding load. The old code imported once at module load and
10
32
  // cached a failure for the daemon's entire lifetime, so a broken/partial binding
11
33
  // install (e.g. an interrupted npm) poisoned interactive sessions forever — even
@@ -16,6 +38,8 @@ let ptyLoadError = null;
16
38
  async function loadPtySpawn() {
17
39
  if (ptySpawn)
18
40
  return ptySpawn;
41
+ // 1. Normal resolution — works for npm/Node installs (binding in node_modules).
42
+ // Keep the specifier a literal so the bundler honours the `--external` mark.
19
43
  try {
20
44
  const pty = await import('@homebridge/node-pty-prebuilt-multiarch');
21
45
  ptySpawn = pty.spawn;
@@ -24,12 +48,53 @@ async function loadPtySpawn() {
24
48
  }
25
49
  catch (err) {
26
50
  ptyLoadError = err instanceof Error ? `${err.message}` : String(err);
27
- return null;
28
51
  }
52
+ // 2. On-disk cache — load a previously self-healed binding. The standalone
53
+ // binary can't EMBED node-pty, but it can `require` an absolute on-disk path.
54
+ const loadFromCache = () => {
55
+ try {
56
+ const pty = nodeRequire(nativeCacheEntry());
57
+ ptySpawn = pty.spawn;
58
+ ptyLoadError = null;
59
+ return true;
60
+ }
61
+ catch (err) {
62
+ ptyLoadError = err instanceof Error ? `${err.message}` : String(err);
63
+ return false;
64
+ }
65
+ };
66
+ if (fs.existsSync(path.join(nativeCacheEntry(), 'package.json')) && loadFromCache()) {
67
+ return ptySpawn;
68
+ }
69
+ // 3. Self-heal: fetch the prebuilt binding into the user-writable cache (no
70
+ // `-g`, no root) and load it. Needs npm on PATH; on a truly no-Node box
71
+ // this is impossible and we surface an honest error (see the caller).
72
+ if (!ptyProvisionAttempted) {
73
+ ptyProvisionAttempted = true;
74
+ try {
75
+ const root = nativeCacheRoot();
76
+ fs.mkdirSync(root, { recursive: true });
77
+ logger.info(`Provisioning PTY binding (${NODE_PTY_PKG}@${NODE_PTY_VERSION}) into ${root} for interactive sessions…`);
78
+ // `--prefix` installs into <root>/node_modules without touching any global
79
+ // prefix. shell:true is implicit for execSync; on Windows npm is npm.cmd,
80
+ // which the default cmd.exe shell resolves.
81
+ execSync(`npm install ${NODE_PTY_PKG}@${NODE_PTY_VERSION} --no-save --no-audit --no-fund --loglevel=error --prefix "${root}"`, { stdio: 'pipe', timeout: 180000 });
82
+ if (loadFromCache()) {
83
+ logger.info('PTY binding provisioned; interactive sessions enabled.');
84
+ return ptySpawn;
85
+ }
86
+ }
87
+ catch (err) {
88
+ const m = err instanceof Error ? `${err.message}` : String(err);
89
+ ptyLoadError = `self-heal npm install failed: ${m}`;
90
+ }
91
+ }
92
+ return null;
29
93
  }
30
94
  import * as fs from 'fs';
31
95
  import * as path from 'path';
32
96
  import * as os from 'os';
97
+ import { randomUUID } from 'crypto';
33
98
  import { fileURLToPath } from 'url';
34
99
  import { createRequire } from 'module';
35
100
  import * as logger from './logger.js';
@@ -39,7 +104,8 @@ const nodeRequire = createRequire(import.meta.url);
39
104
  import { isSandboxAvailable, buildBwrapArgs, shQuote, ensureStrictProjectDirs, encodeClaudeProjectDir } from './sandbox.js';
40
105
  import { parseCoordSpec, runCoordination } from './coordination.js';
41
106
  import { parseSudosudoInstallSpec, runSudosudoInstall } from './sudosudo.js';
42
- import { sendOutput, sendComplete, sendError, sendSupervisionRequest, sendExecutionResumed, updatePromptStatus, persistOutputLogs, clearOutputBuffer, sendRequirement, persistRequirement, sendQAInstructions, persistQAInstructions, sendPlanItemsGenerated, sendSessionOutput, sendSessionStarted, sendSessionEnded, sendSessionError, reportAgentError } from './supabase.js';
107
+ import { sendOutput, sendComplete, sendError, sendSupervisionRequest, sendExecutionResumed, updatePromptStatus, persistOutputLogs, clearOutputBuffer, sendRequirement, persistRequirement, sendQAInstructions, persistQAInstructions, sendPlanItemsGenerated, sendSessionOutput, sendSessionStarted, sendSessionEnded, sendSessionError, sendSessionLog, reportAgentError } from './supabase.js';
108
+ import { startTranscriptTail } from './claude-transcript.js';
43
109
  import { createThinkingLog, createToolCallLog, createToolResultLog, createOutputLog, createErrorLog, createSystemLog, } from './types/agent-logs.js';
44
110
  /**
45
111
  * Build args for the `script` PTY wrapper, accounting for BSD vs util-linux differences.
@@ -3282,7 +3348,7 @@ export async function startSession(options) {
3282
3348
  await loadPtySpawn();
3283
3349
  if (!ptySpawn) {
3284
3350
  const detail = ptyLoadError ? ` (load error: ${ptyLoadError})` : '';
3285
- const msg = `Interactive sessions need the @homebridge/node-pty-prebuilt-multiarch binding, which isn't loading on this VM${detail}. The agent retries this every time you start a session, so if you just reinstalled, click Start Session again. If it keeps failing: reinstall the agent (npm i -g orquesta-agent@latest), then restart the daemon (e.g. sudo systemctl restart orquesta-agent) so it runs from the fresh install. Platform without prebuilds (Alpine/MUSL)? Install build tools first: apt install -y make gcc g++ python3.`;
3351
+ const msg = `Interactive sessions need the node-pty binding${detail}. The agent tries to self-heal by fetching the prebuilt binding into ~/.orquesta-agent/native via a local npm install (no root) this needs Node + npm on PATH. If it keeps failing, this box most likely has no Node: install Node 20+, or reinstall the agent under Node (npm i -g orquesta-agent@latest) and restart the daemon, then click Start Session again. Alpine/MUSL (no prebuild): also install build tools (apk/apt add make gcc g++ python3).`;
3286
3352
  logger.error(msg);
3287
3353
  sendSessionError(channel, sessionId, msg);
3288
3354
  void reportAgentError('error', 'session_spawn', 'node-pty binding failed to load', { ptyLoadError, sessionId });
@@ -3383,6 +3449,23 @@ export async function startSession(options) {
3383
3449
  logger.info(`[Session] Resuming most recent conversation (--continue) for ${cliCommand}`);
3384
3450
  }
3385
3451
  }
3452
+ // Pin the transcript file name so the structured-log tailer
3453
+ // (claude-transcript.ts) knows exactly which ~/.claude/projects/<cwd>/<id>.jsonl
3454
+ // to follow. claude only:
3455
+ // - --resume <id>: claude appends to that same <id>.jsonl → tail it directly.
3456
+ // - fresh session: mint a uuid + pass --session-id (can't combine with resume).
3457
+ // - plain --continue: claude reattaches its OWN prior id (unknown to us) → null,
3458
+ // and the tailer adopts the newest transcript touched since startup.
3459
+ let claudeTranscriptId = null;
3460
+ if (cliCommand === 'claude') {
3461
+ if (resumeSessionId) {
3462
+ claudeTranscriptId = resumeSessionId;
3463
+ }
3464
+ else if (!resume) {
3465
+ claudeTranscriptId = randomUUID();
3466
+ ptyArgs.push('--session-id', claudeTranscriptId);
3467
+ }
3468
+ }
3386
3469
  // Per-project endpoint override (only the orquesta CLI understands --endpoint).
3387
3470
  if (cliCommand === 'orquesta' && globalCliEndpoint) {
3388
3471
  ptyArgs.push('--endpoint', globalCliEndpoint);
@@ -3467,6 +3550,7 @@ export async function startSession(options) {
3467
3550
  pendingPhoneTimer: null,
3468
3551
  lastPtyOutputAt: Date.now(),
3469
3552
  rogerthatWatcher: null,
3553
+ transcriptTail: null,
3470
3554
  };
3471
3555
  sessions.set(sessionId, session);
3472
3556
  ensureSessionReaper(); // reap this session if it's later abandoned without session:end
@@ -3474,6 +3558,25 @@ export async function startSession(options) {
3474
3558
  // the PTY as if the operator had typed it, so they can hold a full
3475
3559
  // conversation from the phone without touching the dashboard.
3476
3560
  session.rogerthatWatcher = startRogerthatMonitor(sessionId);
3561
+ // Tail claude's on-disk transcript and broadcast STRUCTURED logs (tool_call /
3562
+ // tool_result / output / thinking) so the dashboard persists a rich timeline
3563
+ // instead of scraped terminal chrome. claude only: orquesta-cli self-reports
3564
+ // via its prompt-reporter, and kimi has no structured transcript yet.
3565
+ if (cliCommand === 'claude') {
3566
+ session.transcriptTail = startTranscriptTail({
3567
+ sessionFileId: claudeTranscriptId,
3568
+ startedAtMs: startTime,
3569
+ // The agent has no per-turn promptId (the dashboard owns it), so we tag the
3570
+ // broadcast with none — the dashboard attaches each entry to its active prompt.
3571
+ getPromptId: () => undefined,
3572
+ onLog: (entry) => {
3573
+ if (!sessions.get(sessionId)?.isActive)
3574
+ return;
3575
+ void sendSessionLog(channel, sessionId, entry);
3576
+ },
3577
+ log: (msg) => logger.debug(`[Session ${sessionId}] ${msg}`),
3578
+ });
3579
+ }
3477
3580
  // Send session:started only after Claude produces its first output.
3478
3581
  // This ensures the UI doesn't activate the input field before Claude is
3479
3582
  // actually ready — early input would otherwise be silently ignored.
@@ -3559,6 +3662,10 @@ export async function startSession(options) {
3559
3662
  exitingSession.rogerthatWatcher?.close();
3560
3663
  }
3561
3664
  catch { /* already closed */ }
3665
+ try {
3666
+ exitingSession.transcriptTail?.stop();
3667
+ }
3668
+ catch { /* already stopped */ }
3562
3669
  if (exitingSession.pendingPhoneTimer) {
3563
3670
  clearTimeout(exitingSession.pendingPhoneTimer);
3564
3671
  exitingSession.pendingPhoneTimer = null;
@@ -3882,6 +3989,10 @@ export function terminateSession(sessionId) {
3882
3989
  s.rogerthatWatcher?.close();
3883
3990
  }
3884
3991
  catch { /* already closed */ }
3992
+ try {
3993
+ s.transcriptTail?.stop();
3994
+ }
3995
+ catch { /* already stopped */ }
3885
3996
  if (s.pendingPhoneTimer) {
3886
3997
  clearTimeout(s.pendingPhoneTimer);
3887
3998
  s.pendingPhoneTimer = null;