@dorywoof/agentreplay 0.0.0-stage → 0.2.0

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.
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 agentreplay contributors
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md CHANGED
@@ -1,3 +1,134 @@
1
- # Temporary Holding Version
1
+ <h1 align="center">agentreplay</h1>
2
2
 
3
- This version is a temporary placeholder for this package. An operational version to replace this has been submitted for review and is awaiting a staged release.
3
+ <p align="center">
4
+ <b>Turn any AI coding agent session into a shareable, video-like replay.</b><br>
5
+ Claude Code · Codex · Gemini CLI · OpenCode · Cline · Roo · Kilo · Copilot CLI · Qwen · Amp · Aider · any chat log<br>
6
+ One command. One self-contained HTML file. Secrets stripped before you share.
7
+ </p>
8
+
9
+ <p align="center">
10
+ <code>npx @dorywoof/agentreplay</code>
11
+ </p>
12
+
13
+ <p align="center">
14
+ <a href="https://dorywoof.github.io/agentreplay/"><b>▶ Try the live demo</b></a>
15
+ </p>
16
+
17
+ <p align="center">
18
+ <a href="https://dorywoof.github.io/agentreplay/"><img src="docs/demo.gif" alt="agentreplay playing back a Claude Code session: prompts, tool calls, diffs, a failing test and the fix" width="800"></a>
19
+ </p>
20
+
21
+ ---
22
+
23
+ You just watched an AI agent build a feature in 6 minutes. Now you want to show someone — but all you have is a 4 MB JSONL file nobody can read.
24
+
25
+ **agentreplay** turns that log into a page that *plays back* the session: prompts, reasoning, every tool call, every diff, with a scrubbable timeline and a summary card that says what it did, how long it took and what it cost.
26
+
27
+ ## Features
28
+
29
+ - ▶️ **Plays like a video.** Events appear in order with condensed timing; scrub, skip, pause, or change speed. Edits, errors and prompts are marked on the timeline.
30
+ - 🤝 **Works with (almost) every agent.** Built-in support for 11 coding agents, plus a universal parser that understands Anthropic, OpenAI and Gemini message formats. Point it at any JSON or JSONL chat log and it will try to replay it.
31
+ - 💸 **Cost and token panel.** Input, output and cache tokens. Shows the real cost when the agent records it (Cline, Roo, OpenCode), otherwise an estimate at list prices.
32
+ - 🔒 **Safe to share by default.** API keys, tokens, JWTs, private keys, passwords in env assignments, e-mail addresses and your home directory are redacted *before* the HTML is written. The footer says what was removed.
33
+ - 📝 **Real diffs.** Edits are shown as red and green diffs with a per-file `+/-` summary: Claude's `Edit`/`Write`, Codex `apply_patch`, Cline/Roo/Aider SEARCH/REPLACE blocks, OpenCode and Gemini edit tools.
34
+ - 📦 **One file, zero dependencies.** The output is one HTML file that works offline. Host it anywhere: GitHub Pages, a gist, Slack, e-mail.
35
+ - 🌗 Light and dark themes, works on phones, and keyboard shortcuts (`space`, `←` `→`, `Home`, `End`).
36
+
37
+ ## Quick start
38
+
39
+ ```bash
40
+ npx @dorywoof/agentreplay # replays your most recent session and opens it
41
+ ```
42
+
43
+ ```bash
44
+ npx @dorywoof/agentreplay --list # pick from recent sessions of every agent
45
+ npx @dorywoof/agentreplay --pick 3
46
+ npx @dorywoof/agentreplay path/to/session.jsonl -o my-replay.html
47
+ npx @dorywoof/agentreplay --agents # which agents were found on this machine
48
+ ```
49
+
50
+ Requires Node 18+. Nothing is uploaded anywhere: everything happens on your machine.
51
+
52
+ ### Where sessions live
53
+
54
+ Sessions are found automatically. You can also pass any file directly.
55
+
56
+ | Agent | `--agent` | Where it looks |
57
+ |---|---|---|
58
+ | Claude Code | `claude` | `~/.claude/projects/*/*.jsonl` |
59
+ | Codex | `codex` | `~/.codex/sessions/**/rollout-*.jsonl` |
60
+ | Gemini CLI | `gemini` | `~/.gemini/tmp/*/chats/*.json(l)` |
61
+ | Qwen Code | `qwen` | `~/.qwen/projects/*/chats/*.jsonl` |
62
+ | OpenCode | `opencode` | `~/.local/share/opencode/`: `storage/` JSON, `opencode.db`, or an `opencode export` file |
63
+ | Cline | `cline` | VS Code / Cursor / Windsurf globalStorage `saoudrizwan.claude-dev/tasks/*`, `~/.cline/data/tasks/*` |
64
+ | Roo Code | `roo` | globalStorage `rooveterinaryinc.roo-cline/tasks/*` |
65
+ | Kilo Code | `kilo` | globalStorage `kilocode.kilo-code/tasks/*` |
66
+ | GitHub Copilot CLI | `copilot` | `~/.copilot/session-state/**/*.jsonl` |
67
+ | Amp | `amp` | `~/.local/share/amp/threads/*.json` |
68
+ | Aider | `aider` | `.aider.chat.history.md` in the current folder |
69
+ | Anything else | `generic` | Pass the file: Anthropic / OpenAI / Gemini-style messages in JSON or JSONL |
70
+
71
+ `CLAUDE_CONFIG_DIR`, `CODEX_HOME`, `GEMINI_DIR`, `QWEN_DATA_DIR`, `AMP_DATA_DIR`, `COPILOT_HOME` and `XDG_DATA_HOME` are respected. Reading `opencode.db` needs Node 22.5+ (built-in SQLite).
72
+
73
+ > Only Claude Code and Codex have been tested against real logs so far. The others are built from their documented formats and tested with fixtures. If a session from your agent doesn't replay correctly, please [open an issue](https://github.com/dorywoof/agentreplay/issues) with a redacted sample.
74
+
75
+ ## Options
76
+
77
+ ```
78
+ -o, --out <file> output HTML path (default: ./replay-<id>.html)
79
+ -a, --agent <name> only one agent (see the table above)
80
+ -t, --title <text> override the replay title
81
+ --no-thinking hide thinking / reasoning blocks
82
+ --no-redact keep secrets, e-mails and home paths (not for sharing!)
83
+ --keep-paths redact secrets but keep file paths as-is
84
+ --pricing <file> JSON with custom $/1M token prices per model
85
+ --json print the normalized session JSON instead of HTML
86
+ --no-open don't open the replay in a browser
87
+ ```
88
+
89
+ **URL tricks:** add `#e42` to open a replay at event 42, or `?static` to show the whole session at once with no animation.
90
+
91
+ ## Sharing a replay
92
+
93
+ The output is a static file, so any of these work:
94
+
95
+ - **GitHub Pages:** commit `replay.html` to a `gh-pages` branch.
96
+ - **Gist:** upload it, then open it through a gist-preview service.
97
+ - **Netlify / Vercel drop:** drag and drop the file.
98
+
99
+ > ⚠️ Redaction catches common secret formats, but it can't know everything that is private to you. Skim the replay before posting it publicly.
100
+
101
+ ## About the cost estimate
102
+
103
+ When the agent records what a session cost (Cline, Roo, Kilo, OpenCode), that number is shown. Otherwise cost is estimated from public per-token API list prices (including cache reads and writes) for the Claude models it knows about. If you're on a subscription plan, it shows what the session *would* cost on the API. For models it has no price for, only token counts are shown. You can supply your own prices:
104
+
105
+ ```json
106
+ { "gpt-6.1": { "input": 1.25, "output": 10, "cacheRead": 0.125 } }
107
+ ```
108
+
109
+ ```bash
110
+ npx @dorywoof/agentreplay --pricing prices.json
111
+ ```
112
+
113
+ ## Roadmap
114
+
115
+ - [ ] Cursor and Windsurf built-in chat (stored in proprietary SQLite blobs)
116
+ - [ ] Goose, Crush, Droid and Kiro sessions
117
+ - [ ] Export to GIF / MP4 for social posts
118
+ - [ ] Subagent (sidechain) lanes
119
+ - [ ] `agentreplay publish`: one-command upload to a gist
120
+ - [ ] Combine several sessions into one replay
121
+
122
+ Ideas and PRs are welcome. Adding a new agent usually means a few lines in `src/parsers/agents.js` that find its files and hand them to the universal parser.
123
+
124
+ ## Development
125
+
126
+ ```bash
127
+ npm test # node:test, no dependencies
128
+ node scripts/make-demo.js # regenerate examples/demo-session.jsonl
129
+ npm run demo # render examples/demo.html
130
+ ```
131
+
132
+ ## License
133
+
134
+ MIT
@@ -0,0 +1,162 @@
1
+ #!/usr/bin/env node
2
+ import fs from 'node:fs';
3
+ import path from 'node:path';
4
+ import { spawn } from 'node:child_process';
5
+ import { parseArgs } from 'node:util';
6
+ import { listSessions, detectAgent, preview, PARSERS } from '../src/discover.js';
7
+ import { createRedactor } from '../src/redact.js';
8
+ import { computeStats } from '../src/stats.js';
9
+ import { loadPricing } from '../src/pricing.js';
10
+ import { renderHtml } from '../src/render.js';
11
+
12
+ const HELP = `
13
+ agentreplay — turn an AI coding session into a shareable replay
14
+
15
+ Usage
16
+ agentreplay replay your most recent session
17
+ agentreplay <session.jsonl> replay a specific log file
18
+ agentreplay --list list recent sessions
19
+ agentreplay --pick 3 replay #3 from --list
20
+ agentreplay --agents show supported agents and what was found
21
+
22
+ Options
23
+ -o, --out <file> output HTML path (default: ./replay-<id>.html)
24
+ -a, --agent <name> only one agent: claude, codex, gemini, qwen, opencode,
25
+ cline, roo, kilo, copilot, amp, aider, generic
26
+ -t, --title <text> override the replay title
27
+ --no-thinking hide thinking / reasoning blocks
28
+ --no-redact keep secrets, e-mails and home paths (not for sharing!)
29
+ --keep-paths redact secrets but keep file paths as-is
30
+ --pricing <file> JSON with custom $/1M token prices per model
31
+ --json print the normalized session JSON instead of HTML
32
+ --no-open don't open the replay in a browser
33
+ -h, --help show this help
34
+ `;
35
+
36
+ const { values: opts, positionals } = parseArgs({
37
+ allowPositionals: true,
38
+ options: {
39
+ out: { type: 'string', short: 'o' },
40
+ agent: { type: 'string', short: 'a' },
41
+ title: { type: 'string', short: 't' },
42
+ list: { type: 'boolean', short: 'l' },
43
+ agents: { type: 'boolean' },
44
+ pick: { type: 'string', short: 'p' },
45
+ 'no-thinking': { type: 'boolean' },
46
+ 'no-redact': { type: 'boolean' },
47
+ 'keep-paths': { type: 'boolean' },
48
+ pricing: { type: 'string' },
49
+ json: { type: 'boolean' },
50
+ 'no-open': { type: 'boolean' },
51
+ help: { type: 'boolean', short: 'h' },
52
+ },
53
+ });
54
+
55
+ const dim = (s) => (process.stdout.isTTY ? `\x1b[2m${s}\x1b[0m` : s);
56
+ const bold = (s) => (process.stdout.isTTY ? `\x1b[1m${s}\x1b[0m` : s);
57
+
58
+ function fail(msg) {
59
+ console.error(`agentreplay: ${msg}`);
60
+ process.exit(1);
61
+ }
62
+
63
+ function ago(ms) {
64
+ const m = Math.round((Date.now() - ms) / 60000);
65
+ if (m < 60) return `${m}m ago`;
66
+ if (m < 60 * 24) return `${Math.round(m / 60)}h ago`;
67
+ return `${Math.round(m / 1440)}d ago`;
68
+ }
69
+
70
+ function main() {
71
+ if (opts.help) return console.log(HELP);
72
+ if (opts.agent && !PARSERS[opts.agent]) fail(`unknown agent "${opts.agent}" (one of: ${Object.keys(PARSERS).join(', ')})`);
73
+
74
+ if (opts.agents) {
75
+ console.log(bold('Supported agents') + dim(' (sessions found on this machine)') + '\n');
76
+ for (const [key, src] of Object.entries(PARSERS)) {
77
+ if (key === 'generic') continue;
78
+ const n = listSessions({ agent: key }).length;
79
+ console.log(` ${key.padEnd(9)} ${src.label.padEnd(13)} ${n ? bold(String(n)) : dim('0')}`);
80
+ }
81
+ console.log('\n' + dim('Any other JSON / JSONL chat log works too: agentreplay path/to/log.json'));
82
+ return;
83
+ }
84
+
85
+ if (opts.list) {
86
+ const sessions = listSessions({ agent: opts.agent }).slice(0, 20);
87
+ if (!sessions.length) fail('no agent sessions found on this machine. Pass a log file path instead.');
88
+ sessions.forEach((s, i) => {
89
+ const tag = PARSERS[s.agent].label.padEnd(12);
90
+ console.log(`${bold(String(i + 1).padStart(2))} ${tag} ${dim(ago(s.mtime).padEnd(8))} ${preview(s.file, s.agent)}`);
91
+ });
92
+ console.log(dim('\nReplay one with: agentreplay --pick <n>'));
93
+ return;
94
+ }
95
+
96
+ let file, agent;
97
+ if (positionals[0]) {
98
+ file = path.resolve(positionals[0]);
99
+ if (!fs.existsSync(file.split('#')[0])) fail(`file not found: ${file}`);
100
+ agent = opts.agent || detectAgent(file);
101
+ if (!agent) fail('could not find a conversation in this file. Run agentreplay --agents to see supported formats.');
102
+ } else {
103
+ const sessions = listSessions({ agent: opts.agent });
104
+ if (!sessions.length) fail('no agent sessions found on this machine. Pass a log file path instead.');
105
+ const idx = opts.pick ? Number(opts.pick) - 1 : 0;
106
+ if (!sessions[idx]) fail(`no session #${opts.pick} — run with --list to see what's available`);
107
+ ({ file, agent } = sessions[idx]);
108
+ }
109
+
110
+ let session = PARSERS[agent].parse(file);
111
+ if (opts.title) session.title = opts.title;
112
+ if (opts['no-thinking']) session.events = session.events.filter((e) => e.kind !== 'thinking');
113
+ if (!session.events.length) fail('this session has no messages to replay');
114
+
115
+ let redactions = null;
116
+ if (!opts['no-redact']) {
117
+ const r = createRedactor({ paths: !opts['keep-paths'] });
118
+ session = r.redact(session);
119
+ redactions = r.counts;
120
+ }
121
+
122
+ const stats = computeStats(session, loadPricing(opts.pricing));
123
+
124
+ if (opts.json) {
125
+ process.stdout.write(JSON.stringify({ ...session, stats }, null, 2) + '\n');
126
+ return;
127
+ }
128
+
129
+ const out = path.resolve(opts.out || `replay-${String(session.id).replace(/[^w-]/g, '').slice(0, 12) || 'session'}.html`);
130
+ fs.mkdirSync(path.dirname(out), { recursive: true });
131
+ fs.writeFileSync(out, renderHtml(session, stats, { redactions }));
132
+
133
+ const mins = Math.max(1, Math.round(stats.activeMs / 60000));
134
+ const cost = stats.cost != null ? ` · ~$${stats.cost.toFixed(2)}` : '';
135
+ console.log(`${bold('✓')} ${session.agent} · ${session.title || 'Untitled'}`);
136
+ console.log(dim(` ${session.events.length} events · ${stats.toolCalls} tool calls · ${stats.files.length} files · ${mins} min${cost}`));
137
+ if (redactions) {
138
+ const total = Object.values(redactions).reduce((a, b) => a + b, 0);
139
+ if (total) console.log(dim(` redacted: ${Object.entries(redactions).map(([k, v]) => `${v} ${k}`).join(', ')}`));
140
+ } else {
141
+ console.log(' ⚠ redaction is OFF — check the file before sharing it');
142
+ }
143
+ console.log(` → ${out}`);
144
+
145
+ if (!opts['no-open'] && !process.env.CI) openFile(out);
146
+ }
147
+
148
+ function openFile(file) {
149
+ const [cmd, args] =
150
+ process.platform === 'win32'
151
+ ? ['cmd', ['/c', 'start', '""', file]]
152
+ : process.platform === 'darwin'
153
+ ? ['open', [file]]
154
+ : ['xdg-open', [file]];
155
+ try {
156
+ spawn(cmd, args, { stdio: 'ignore', detached: true, windowsVerbatimArguments: process.platform === 'win32' }).unref();
157
+ } catch {
158
+ /* no browser available — the path is already printed */
159
+ }
160
+ }
161
+
162
+ main();
package/package.json CHANGED
@@ -1,6 +1,52 @@
1
1
  {
2
2
  "name": "@dorywoof/agentreplay",
3
- "version": "0.0.0-stage",
4
- "stub": true,
5
- "description": "Temporary package placeholder for staged publishing"
6
- }
3
+ "version": "0.2.0",
4
+ "description": "Turn any AI coding agent session (Claude Code, Codex, Gemini CLI, OpenCode, Cline, Roo, Copilot CLI, Aider, …) into a shareable, video-like HTML replay with cost stats and secret redaction.",
5
+ "homepage": "https://github.com/dorywoof/agentreplay#readme",
6
+ "repository": {
7
+ "type": "git",
8
+ "url": "git+https://github.com/dorywoof/agentreplay.git"
9
+ },
10
+ "bugs": {
11
+ "url": "https://github.com/dorywoof/agentreplay/issues"
12
+ },
13
+ "type": "module",
14
+ "bin": {
15
+ "agentreplay": "bin/agentreplay.js"
16
+ },
17
+ "files": [
18
+ "bin",
19
+ "src",
20
+ "README.md",
21
+ "LICENSE"
22
+ ],
23
+ "scripts": {
24
+ "test": "node --test test/",
25
+ "demo": "node bin/agentreplay.js examples/demo-session.jsonl -o examples/demo.html --no-open"
26
+ },
27
+ "engines": {
28
+ "node": ">=18"
29
+ },
30
+ "keywords": [
31
+ "claude-code",
32
+ "codex",
33
+ "ai-agent",
34
+ "replay",
35
+ "session",
36
+ "transcript",
37
+ "llm",
38
+ "cli",
39
+ "gemini-cli",
40
+ "opencode",
41
+ "cline",
42
+ "roo-code",
43
+ "kilo-code",
44
+ "copilot",
45
+ "qwen-code",
46
+ "amp",
47
+ "aider",
48
+ "chat-log",
49
+ "transcript-viewer"
50
+ ],
51
+ "license": "MIT"
52
+ }
@@ -0,0 +1,109 @@
1
+ import fs from 'node:fs';
2
+ import os from 'node:os';
3
+ import path from 'node:path';
4
+ import { readJsonl, stripHarnessTags } from './util.js';
5
+ import * as claudeParser from './parsers/claude.js';
6
+ import * as codexParser from './parsers/codex.js';
7
+ import * as agents from './parsers/agents.js';
8
+ import * as universal from './parsers/universal.js';
9
+
10
+ const home = os.homedir();
11
+
12
+ const claude = {
13
+ label: 'Claude Code',
14
+ // projects/<project>/<session>.jsonl — subagent logs nested deeper are skipped
15
+ find: () => agents.walk(path.join(process.env.CLAUDE_CONFIG_DIR || path.join(home, '.claude'), 'projects'), 1, (n) => n.endsWith('.jsonl')),
16
+ parse: (f) => claudeParser.parse(f),
17
+ };
18
+ const codex = {
19
+ label: 'Codex',
20
+ find: () => agents.walk(path.join(process.env.CODEX_HOME || path.join(home, '.codex'), 'sessions'), 4, (n) => n.endsWith('.jsonl')),
21
+ parse: (f) => codexParser.parse(f),
22
+ };
23
+
24
+ /** Every agent we know how to find and replay. Keys are what --agent accepts. */
25
+ export const PARSERS = {
26
+ claude,
27
+ codex,
28
+ gemini: agents.gemini,
29
+ qwen: agents.qwen,
30
+ opencode: agents.opencode,
31
+ cline: agents.cline,
32
+ roo: agents.roo,
33
+ kilo: agents.kilo,
34
+ copilot: agents.copilot,
35
+ amp: agents.amp,
36
+ aider: agents.aider,
37
+ generic: agents.generic,
38
+ };
39
+
40
+ function mtimeOf(ref) {
41
+ try {
42
+ return fs.statSync(ref.split('#')[0]).mtimeMs;
43
+ } catch {
44
+ return 0;
45
+ }
46
+ }
47
+
48
+ /** All sessions found on this machine, newest first. */
49
+ export function listSessions({ agent } = {}) {
50
+ const found = [];
51
+ for (const [key, src] of Object.entries(PARSERS)) {
52
+ if (agent && agent !== key) continue;
53
+ let files = [];
54
+ try {
55
+ files = src.find();
56
+ } catch {
57
+ /* a broken store for one agent shouldn't hide the others */
58
+ }
59
+ for (const file of files) found.push({ agent: key, file, mtime: mtimeOf(file) });
60
+ }
61
+ return found.sort((a, b) => b.mtime - a.mtime);
62
+ }
63
+
64
+ /** Pick the parser for an arbitrary file path. */
65
+ export function detectAgent(file) {
66
+ const base = path.basename(file);
67
+ if (base === 'api_conversation_history.json' || base === 'ui_messages.json') {
68
+ for (const k of ['roo', 'kilo', 'cline']) if (PARSERS[k].match(file)) return k;
69
+ return 'cline';
70
+ }
71
+ if (file.endsWith('.md')) return 'aider';
72
+ if (file.includes('.db#') || base === 'opencode.db') return 'opencode';
73
+ for (const k of ['gemini', 'qwen', 'amp', 'copilot', 'opencode']) if (PARSERS[k].match(file)) return k;
74
+ if (file.endsWith('.jsonl')) {
75
+ const records = readJsonl(file).slice(0, 50);
76
+ if (codexParser.detect(records)) return 'codex';
77
+ if (claudeParser.detect(records)) return 'claude';
78
+ }
79
+ if (universal.detect(file)) return 'generic';
80
+ return null;
81
+ }
82
+
83
+ /** Cheap one-line preview for --list. */
84
+ export function preview(file, agent) {
85
+ try {
86
+ if (agent === 'claude' || agent === 'codex') return previewJsonl(file);
87
+ const s = PARSERS[agent].parse(file);
88
+ return s.title || '(no prompt)';
89
+ } catch {
90
+ return '(unreadable)';
91
+ }
92
+ }
93
+
94
+ function previewJsonl(file) {
95
+ const records = readJsonl(file);
96
+ for (const r of records) if (r.type === 'ai-title' && r.aiTitle) return r.aiTitle;
97
+ for (const r of records) {
98
+ if (r.isMeta || r.isSidechain) continue;
99
+ const isUser = r.type === 'user' || (r.payload?.type === 'message' && r.payload.role === 'user');
100
+ if (!isUser) continue;
101
+ const c = r.message?.content ?? r.payload.content;
102
+ const blocks = typeof c === 'string' ? [c] : Array.isArray(c) ? c.map((b) => (b.type === 'tool_result' ? '' : b.text || '')) : [];
103
+ for (const b of blocks) {
104
+ const clean = stripHarnessTags(b);
105
+ if (clean && !clean.startsWith('<')) return clean.split('\n')[0].slice(0, 70);
106
+ }
107
+ }
108
+ return '(no prompt)';
109
+ }