clawprobe 1.2.3 → 1.3.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/README.md +18 -23
- package/README.zh-CN.md +1 -1
- package/dist/cli/commands/live.d.ts +3 -0
- package/dist/cli/commands/live.d.ts.map +1 -1
- package/dist/cli/commands/live.js +191 -59
- package/dist/cli/commands/live.js.map +1 -1
- package/dist/core/live-stream.d.ts +41 -5
- package/dist/core/live-stream.d.ts.map +1 -1
- package/dist/core/live-stream.js +173 -32
- package/dist/core/live-stream.js.map +1 -1
- package/dist/index.js +12 -2
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
- package/README.ja.md +0 -407
package/README.md
CHANGED
|
@@ -15,7 +15,7 @@ Token usage. API cost. Context health. Smart alerts. All in one place — withou
|
|
|
15
15
|
|
|
16
16
|
If you find clawprobe useful, please consider giving it a ⭐ on [GitHub](https://github.com/seekcontext/ClawProbe) — it really helps!
|
|
17
17
|
|
|
18
|
-
[English](./README.md) · [简体中文](./README.zh-CN.md)
|
|
18
|
+
[English](./README.md) · [简体中文](./README.zh-CN.md)
|
|
19
19
|
|
|
20
20
|
[Why clawprobe](#why-clawprobe) •
|
|
21
21
|
[Quick Start](#quick-start) •
|
|
@@ -146,39 +146,34 @@ clawprobe top --agent coder # target a specific agent
|
|
|
146
146
|
|
|
147
147
|
### `clawprobe live` — Real-Time Activity Stream
|
|
148
148
|
|
|
149
|
-
|
|
149
|
+
Run it in a side terminal: each turn has a header (optional user preview), a wait line that matches your session (`waiting for assistant…` vs `reasoning (pending)…`), tool calls, **`└─ ok` / `└─ error`** result lines with duration and exit code when the transcript includes them, then **`done`** with tokens. Model and thinking level come from `session_meta` lines in the JSONL.
|
|
150
150
|
|
|
151
151
|
```
|
|
152
152
|
$ clawprobe live
|
|
153
153
|
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
📖
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
⚠ Bash failed — exit code 1
|
|
164
|
-
💻 Bash npm test -- --filter auth
|
|
165
|
-
✓ Turn done +1,247 tokens out
|
|
166
|
-
|
|
167
|
-
─── Turn 2 03/24 16:43 ─────────────────────────────────────────────────────
|
|
168
|
-
💭 thinking…
|
|
169
|
-
📖 Read src/auth/token.ts
|
|
154
|
+
16:41:02 ◆ model moonshot/kimi-k2.5 · thinking off
|
|
155
|
+
|
|
156
|
+
16:41:10 ● Turn 1
|
|
157
|
+
… waiting for assistant…
|
|
158
|
+
16:41:12 📖 read SKILL.md
|
|
159
|
+
└─ ok 15.2s exit 0
|
|
160
|
+
16:41:28 💻 exec curl wttr.in/…
|
|
161
|
+
└─ ok 0.6s exit 0
|
|
162
|
+
16:41:29 ● done +263 tok
|
|
170
163
|
```
|
|
171
164
|
|
|
172
165
|
Unlike `clawprobe top` (periodic full-screen refresh), `live` is chronological and scrollable — you can scroll back to see what happened earlier in the session.
|
|
173
166
|
|
|
174
167
|
```bash
|
|
175
|
-
clawprobe live
|
|
176
|
-
clawprobe live --history
|
|
177
|
-
clawprobe live --
|
|
178
|
-
clawprobe live --
|
|
168
|
+
clawprobe live # watch the active session from now
|
|
169
|
+
clawprobe live --history # replay from session start
|
|
170
|
+
clawprobe live --density compact # tools only; hide successful result lines
|
|
171
|
+
clawprobe live --density verbose # + stopReason, tool call ids, result previews
|
|
172
|
+
clawprobe live --plain # ASCII-friendly (no emoji)
|
|
173
|
+
clawprobe live --file <path> # watch a specific .jsonl transcript
|
|
179
174
|
```
|
|
180
175
|
|
|
181
|
-
|
|
176
|
+
Interactive keys: **`+` / `-`** cycle density, **`h`** help, **`q`** or **`Ctrl+C`** quit.
|
|
182
177
|
|
|
183
178
|
---
|
|
184
179
|
|
package/README.zh-CN.md
CHANGED
|
@@ -15,7 +15,7 @@ Token 用量、API 成本、上下文健康度、智能告警 —— 一站式
|
|
|
15
15
|
|
|
16
16
|
如果你觉得 clawprobe 有用,欢迎在 [GitHub](https://github.com/seekcontext/ClawProbe) 上给它点个 ⭐ —— 这对项目很有帮助!
|
|
17
17
|
|
|
18
|
-
[English](./README.md) · [简体中文](./README.zh-CN.md)
|
|
18
|
+
[English](./README.md) · [简体中文](./README.zh-CN.md)
|
|
19
19
|
|
|
20
20
|
[为什么选择 clawprobe](#为什么选择-clawprobe) •
|
|
21
21
|
[快速开始](#快速开始) •
|
|
@@ -1,8 +1,11 @@
|
|
|
1
1
|
import { ResolvedConfig } from "../../core/config.js";
|
|
2
|
+
export type LiveDensity = "compact" | "normal" | "verbose";
|
|
2
3
|
interface LiveOptions {
|
|
3
4
|
agent?: string;
|
|
4
5
|
history?: boolean;
|
|
5
6
|
file?: string;
|
|
7
|
+
density?: LiveDensity;
|
|
8
|
+
plain?: boolean;
|
|
6
9
|
}
|
|
7
10
|
export declare function runLive(cfg: ResolvedConfig, opts: LiveOptions): Promise<void>;
|
|
8
11
|
export {};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"live.d.ts","sourceRoot":"","sources":["../../../src/cli/commands/live.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAC;AAatD,UAAU,WAAW;IACnB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,IAAI,CAAC,EAAE,MAAM,CAAC;
|
|
1
|
+
{"version":3,"file":"live.d.ts","sourceRoot":"","sources":["../../../src/cli/commands/live.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAC;AAatD,MAAM,MAAM,WAAW,GAAG,SAAS,GAAG,QAAQ,GAAG,SAAS,CAAC;AAE3D,UAAU,WAAW;IACnB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,OAAO,CAAC,EAAE,WAAW,CAAC;IACtB,KAAK,CAAC,EAAE,OAAO,CAAC;CACjB;AA2PD,wBAAsB,OAAO,CAC3B,GAAG,EAAE,cAAc,EACnB,IAAI,EAAE,WAAW,GAChB,OAAO,CAAC,IAAI,CAAC,CA4Jf"}
|
|
@@ -4,6 +4,47 @@ import chalk from "chalk";
|
|
|
4
4
|
import { getActiveSession, findJsonlPath, } from "../../core/session-store.js";
|
|
5
5
|
import { startLiveStream, findMostRecentJsonl, getToolIcon, } from "../../core/live-stream.js";
|
|
6
6
|
import { LOCAL_TZ } from "../format.js";
|
|
7
|
+
function glyphsFor(plain) {
|
|
8
|
+
if (plain) {
|
|
9
|
+
return {
|
|
10
|
+
turn: "*",
|
|
11
|
+
done: "+",
|
|
12
|
+
compact: "#",
|
|
13
|
+
subagent: ">",
|
|
14
|
+
tree: "+--",
|
|
15
|
+
reasoning: "~",
|
|
16
|
+
awaiting: "...",
|
|
17
|
+
};
|
|
18
|
+
}
|
|
19
|
+
return {
|
|
20
|
+
turn: "●",
|
|
21
|
+
done: "●",
|
|
22
|
+
compact: "◆",
|
|
23
|
+
subagent: "◇",
|
|
24
|
+
tree: "└─",
|
|
25
|
+
reasoning: "·",
|
|
26
|
+
awaiting: "…",
|
|
27
|
+
};
|
|
28
|
+
}
|
|
29
|
+
function toolIcon(name, plain) {
|
|
30
|
+
if (plain) {
|
|
31
|
+
const map = {
|
|
32
|
+
read: "[R]",
|
|
33
|
+
write: "[W]",
|
|
34
|
+
edit: "[E]",
|
|
35
|
+
exec: "[$]",
|
|
36
|
+
glob: "[G]",
|
|
37
|
+
web_search: "[S]",
|
|
38
|
+
web_fetch: "[U]",
|
|
39
|
+
memory_search: "[M]",
|
|
40
|
+
memory_get: "[m]",
|
|
41
|
+
message: "[@]",
|
|
42
|
+
sessions_spawn: "[A]",
|
|
43
|
+
};
|
|
44
|
+
return map[name] ?? "[?]";
|
|
45
|
+
}
|
|
46
|
+
return getToolIcon(name);
|
|
47
|
+
}
|
|
7
48
|
// ── Formatting helpers ────────────────────────────────────────────────────────
|
|
8
49
|
function fmtTime(ms) {
|
|
9
50
|
return new Intl.DateTimeFormat("en-US", {
|
|
@@ -21,62 +62,115 @@ function fmtTokens(n) {
|
|
|
21
62
|
return `${(n / 1_000).toFixed(1)}K`;
|
|
22
63
|
return String(n);
|
|
23
64
|
}
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
65
|
+
function fmtDuration(ms) {
|
|
66
|
+
if (ms == null || ms < 0)
|
|
67
|
+
return "";
|
|
68
|
+
if (ms >= 1000)
|
|
69
|
+
return `${(ms / 1000).toFixed(1)}s`;
|
|
70
|
+
return `${Math.round(ms)}ms`;
|
|
71
|
+
}
|
|
72
|
+
function renderEvent(event, o) {
|
|
30
73
|
const time = fmtTime(event.timestamp);
|
|
31
|
-
// Invisible padding matching the time string length for continuation lines
|
|
32
74
|
const pad = " ".repeat(time.length);
|
|
75
|
+
const dim = (s) => (o.color ? chalk.dim(s) : s);
|
|
76
|
+
const bold = (s) => (o.color ? chalk.bold(s) : s);
|
|
77
|
+
const cyan = (s) => (o.color ? chalk.cyan(s) : s);
|
|
78
|
+
const green = (s) => (o.color ? chalk.green(s) : s);
|
|
79
|
+
const red = (s) => (o.color ? chalk.red(s) : s);
|
|
80
|
+
const yellow = (s) => (o.color ? chalk.yellow(s) : s);
|
|
81
|
+
const magenta = (s) => (o.color ? chalk.magenta(s) : s);
|
|
33
82
|
switch (event.kind) {
|
|
34
|
-
case "
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
83
|
+
case "session_meta": {
|
|
84
|
+
const parts = [];
|
|
85
|
+
if (event.model)
|
|
86
|
+
parts.push(`model ${event.model}`);
|
|
87
|
+
if (event.thinkingLevel)
|
|
88
|
+
parts.push(`thinking ${event.thinkingLevel}`);
|
|
89
|
+
if (parts.length === 0)
|
|
90
|
+
return null;
|
|
91
|
+
return dim(` ${time} ${o.glyphs.compact} ${parts.join(" · ")}`);
|
|
92
|
+
}
|
|
93
|
+
case "turn_start": {
|
|
94
|
+
const lines = [];
|
|
95
|
+
const head = o.density === "compact"
|
|
96
|
+
? `\n${bold(` ${time} ${o.glyphs.turn} T${event.turnIndex ?? "?"}`)}`
|
|
97
|
+
: `\n${bold(` ${time} ${o.glyphs.turn} Turn ${event.turnIndex ?? "?"}`)}`;
|
|
98
|
+
lines.push(head);
|
|
99
|
+
if (o.density !== "compact" &&
|
|
100
|
+
event.userPreview &&
|
|
101
|
+
event.userPreview.length > 0) {
|
|
102
|
+
const maxU = Math.max(24, o.W - 8);
|
|
103
|
+
lines.push(dim(` ${pad} ${event.userPreview.slice(0, maxU)}`));
|
|
104
|
+
}
|
|
105
|
+
return lines.join("\n");
|
|
106
|
+
}
|
|
107
|
+
case "thinking": {
|
|
38
108
|
if (event.thinkingContent) {
|
|
39
|
-
|
|
40
|
-
const maxLen = Math.max(20, W - 14);
|
|
109
|
+
const maxLen = Math.max(20, o.W - 18);
|
|
41
110
|
const snippet = event.thinkingContent.slice(0, maxLen);
|
|
42
|
-
|
|
111
|
+
const prefix = o.plain ? `${o.glyphs.reasoning} ` : "· ";
|
|
112
|
+
return dim(` ${time} ${prefix}${snippet}`);
|
|
113
|
+
}
|
|
114
|
+
if (event.pendingKind === "reasoning_pending") {
|
|
115
|
+
return dim(` ${pad} ${o.glyphs.awaiting} reasoning (pending)…`);
|
|
116
|
+
}
|
|
117
|
+
if (event.pendingKind === "awaiting") {
|
|
118
|
+
return dim(` ${pad} ${o.glyphs.awaiting} waiting for assistant…`);
|
|
43
119
|
}
|
|
44
|
-
|
|
45
|
-
|
|
120
|
+
return dim(` ${pad} ${o.glyphs.awaiting} waiting…`);
|
|
121
|
+
}
|
|
46
122
|
case "tool_call": {
|
|
47
|
-
const icon =
|
|
123
|
+
const icon = toolIcon(event.tool ?? "", o.plain);
|
|
48
124
|
const nameRaw = event.tool ?? "unknown";
|
|
49
|
-
// Pad to align summaries: use 16 chars to accommodate OpenClaw names like "memory_search"
|
|
50
125
|
const PAD = 16;
|
|
51
126
|
const namePadded = nameRaw + " ".repeat(Math.max(0, PAD - nameRaw.length));
|
|
52
|
-
const name =
|
|
53
|
-
const maxSummaryLen = Math.max(15, W - (10 + PAD +
|
|
127
|
+
const name = cyan(namePadded);
|
|
128
|
+
const maxSummaryLen = Math.max(15, o.W - (10 + PAD + 8));
|
|
54
129
|
const summary = event.toolSummary
|
|
55
|
-
?
|
|
130
|
+
? dim(event.toolSummary.slice(0, maxSummaryLen))
|
|
131
|
+
: "";
|
|
132
|
+
const idSuffix = o.density === "verbose" && event.toolCallId
|
|
133
|
+
? dim(` ${event.toolCallId}`)
|
|
56
134
|
: "";
|
|
57
|
-
return ` ${time} ${icon} ${name}${summary}`;
|
|
135
|
+
return ` ${time} ${icon} ${name}${summary}${idSuffix}`;
|
|
58
136
|
}
|
|
59
|
-
case "tool_result":
|
|
60
|
-
// Only surface errors — success is implicit and would be too noisy
|
|
137
|
+
case "tool_result": {
|
|
61
138
|
if (event.toolError) {
|
|
62
|
-
|
|
139
|
+
const dur = fmtDuration(event.durationMs);
|
|
140
|
+
const durPart = dur ? ` ${dur}` : "";
|
|
141
|
+
const ex = event.exitCode != null ? ` exit ${event.exitCode}` : "";
|
|
142
|
+
return red(` ${pad} ${o.glyphs.tree} error${durPart}${ex}`);
|
|
63
143
|
}
|
|
64
|
-
|
|
144
|
+
if (o.density === "compact")
|
|
145
|
+
return null;
|
|
146
|
+
const dur = fmtDuration(event.durationMs);
|
|
147
|
+
const durPart = dur ? dim(` ${dur}`) : "";
|
|
148
|
+
const ex = event.exitCode != null ? dim(` exit ${event.exitCode}`) : "";
|
|
149
|
+
const ok = o.color ? chalk.greenBright("ok") : "ok";
|
|
150
|
+
let line = ` ${pad} ${o.glyphs.tree} ${ok}${durPart}${ex}`;
|
|
151
|
+
if (o.density === "verbose" && event.resultPreview) {
|
|
152
|
+
const maxR = Math.max(20, o.W - 12);
|
|
153
|
+
line += `\n ${pad} ${dim(event.resultPreview.slice(0, maxR))}`;
|
|
154
|
+
}
|
|
155
|
+
return line;
|
|
156
|
+
}
|
|
65
157
|
case "turn_end": {
|
|
66
158
|
const toks = event.tokensOut
|
|
67
|
-
?
|
|
159
|
+
? dim(` +${fmtTokens(event.tokensOut)} tok`)
|
|
68
160
|
: "";
|
|
69
|
-
|
|
161
|
+
const sr = o.density === "verbose" && event.stopReason
|
|
162
|
+
? dim(` ${event.stopReason}`)
|
|
163
|
+
: "";
|
|
164
|
+
return green(` ${time} ${o.glyphs.done} done${toks}${sr}`);
|
|
70
165
|
}
|
|
71
166
|
case "compaction":
|
|
72
|
-
return
|
|
167
|
+
return yellow(` ${time} ${o.glyphs.compact} compact (context summarized)`);
|
|
73
168
|
case "subagent_start": {
|
|
74
169
|
const summary = event.toolSummary
|
|
75
|
-
?
|
|
170
|
+
? dim(` ${event.toolSummary.slice(0, Math.max(15, o.W - 40))}`)
|
|
76
171
|
: "";
|
|
77
|
-
return
|
|
172
|
+
return magenta(` ${time} ${o.glyphs.subagent} subagent${summary}`);
|
|
78
173
|
}
|
|
79
|
-
// session_start is printed as a header block by the main loop
|
|
80
174
|
case "session_start":
|
|
81
175
|
return null;
|
|
82
176
|
default:
|
|
@@ -84,23 +178,27 @@ function renderEvent(event, W) {
|
|
|
84
178
|
}
|
|
85
179
|
}
|
|
86
180
|
// ── Session header ────────────────────────────────────────────────────────────
|
|
87
|
-
function printSessionHeader(sessionKey, jsonlPath, W) {
|
|
88
|
-
const hr = chalk.dim("─".repeat(W));
|
|
181
|
+
function printSessionHeader(sessionKey, jsonlPath, W, color) {
|
|
182
|
+
const hr = color ? chalk.dim("─".repeat(W)) : "─".repeat(W);
|
|
89
183
|
const maxKeyLen = W - 14;
|
|
90
184
|
const shortKey = sessionKey.length > maxKeyLen
|
|
91
185
|
? sessionKey.slice(0, maxKeyLen - 3) + "…"
|
|
92
186
|
: sessionKey;
|
|
93
187
|
const fileName = path.basename(jsonlPath);
|
|
188
|
+
const b = (s) => (color ? chalk.bold(s) : s);
|
|
189
|
+
const d = (s) => (color ? chalk.dim(s) : s);
|
|
94
190
|
console.log(hr);
|
|
95
|
-
console.log(` ${
|
|
96
|
-
console.log(
|
|
191
|
+
console.log(` ${b("Session:")} ${d(shortKey)}`);
|
|
192
|
+
console.log(d(` file: ${fileName}`));
|
|
97
193
|
console.log(hr);
|
|
98
194
|
}
|
|
99
|
-
// ── Main command
|
|
195
|
+
// ── Main command ─────────────────────────────────────────────────────────────
|
|
100
196
|
export async function runLive(cfg, opts) {
|
|
101
197
|
const W = process.stdout.columns || 80;
|
|
102
|
-
const
|
|
103
|
-
|
|
198
|
+
const color = !!opts.plain ? false : !process.env["NO_COLOR"] && process.stdout.isTTY;
|
|
199
|
+
let density = opts.density ?? "normal";
|
|
200
|
+
const plain = !!opts.plain;
|
|
201
|
+
const hr = color ? chalk.dim("─".repeat(W)) : "─".repeat(W);
|
|
104
202
|
const nowStr = new Intl.DateTimeFormat("en-US", {
|
|
105
203
|
timeZone: LOCAL_TZ,
|
|
106
204
|
year: "numeric",
|
|
@@ -113,26 +211,26 @@ export async function runLive(cfg, opts) {
|
|
|
113
211
|
})
|
|
114
212
|
.format(new Date())
|
|
115
213
|
.replace(",", "");
|
|
116
|
-
const titleText = "clawprobe live
|
|
214
|
+
const titleText = "clawprobe live (+/- density · h help · q quit)";
|
|
117
215
|
const titlePad = Math.max(0, W - titleText.length - nowStr.length);
|
|
118
|
-
|
|
119
|
-
|
|
216
|
+
const title = (color ? chalk.bold("clawprobe live") : "clawprobe live") +
|
|
217
|
+
(color
|
|
218
|
+
? chalk.dim(" (+/- density · h help · q quit)")
|
|
219
|
+
: " (+/- density · h help · q quit)") +
|
|
120
220
|
" ".repeat(titlePad) +
|
|
121
|
-
chalk.dim(nowStr));
|
|
221
|
+
(color ? chalk.dim(nowStr) : nowStr);
|
|
222
|
+
console.log(title);
|
|
122
223
|
console.log(hr);
|
|
123
224
|
console.log();
|
|
124
|
-
// ── Resolve JSONL path ──────────────────────────────────────────────────────
|
|
125
225
|
let jsonlPath = null;
|
|
126
|
-
// Explicit --file override
|
|
127
226
|
if (opts.file) {
|
|
128
227
|
if (!fs.existsSync(opts.file)) {
|
|
129
|
-
console.error(chalk.red(`Error: file not found: ${opts.file}`));
|
|
228
|
+
console.error(color ? chalk.red(`Error: file not found: ${opts.file}`) : `Error: file not found: ${opts.file}`);
|
|
130
229
|
process.exit(1);
|
|
131
230
|
}
|
|
132
231
|
jsonlPath = opts.file;
|
|
133
232
|
}
|
|
134
233
|
else {
|
|
135
|
-
// Auto-detect: prefer sessions.json active session, fall back to most recent file
|
|
136
234
|
const sessionEntry = getActiveSession(cfg.sessionsDir);
|
|
137
235
|
if (sessionEntry) {
|
|
138
236
|
jsonlPath = findJsonlPath(cfg.sessionsDir, sessionEntry);
|
|
@@ -142,21 +240,23 @@ export async function runLive(cfg, opts) {
|
|
|
142
240
|
}
|
|
143
241
|
}
|
|
144
242
|
if (!jsonlPath) {
|
|
145
|
-
console.log(
|
|
146
|
-
"
|
|
243
|
+
console.log(color
|
|
244
|
+
? chalk.dim(" No active session found.\n" +
|
|
245
|
+
" Start OpenClaw, send a message, then run clawprobe live again.")
|
|
246
|
+
: " No active session found.\n Start OpenClaw, send a message, then run clawprobe live again.");
|
|
147
247
|
return;
|
|
148
248
|
}
|
|
149
|
-
// Determine session key for display
|
|
150
249
|
const sessionEntry = getActiveSession(cfg.sessionsDir);
|
|
151
250
|
const displayKey = sessionEntry?.sessionKey ?? path.basename(jsonlPath, ".jsonl");
|
|
152
|
-
printSessionHeader(displayKey, jsonlPath, W);
|
|
251
|
+
printSessionHeader(displayKey, jsonlPath, W, color);
|
|
153
252
|
if (opts.history) {
|
|
154
|
-
console.log(chalk.dim(" (replaying history…)\n"));
|
|
253
|
+
console.log(color ? chalk.dim(" (replaying history…)\n") : " (replaying history…)\n");
|
|
155
254
|
}
|
|
156
255
|
else {
|
|
157
|
-
console.log(
|
|
256
|
+
console.log(color
|
|
257
|
+
? chalk.dim(" Watching for new events. Claude Code–style timeline: tools show results; thinking only when enabled.\n")
|
|
258
|
+
: " Watching for new events.\n");
|
|
158
259
|
}
|
|
159
|
-
// ── Keyboard: quit on 'q' or Ctrl+C ────────────────────────────────────────
|
|
160
260
|
const controller = new AbortController();
|
|
161
261
|
function quit() {
|
|
162
262
|
controller.abort();
|
|
@@ -167,9 +267,30 @@ export async function runLive(cfg, opts) {
|
|
|
167
267
|
catch { /* ignore */ }
|
|
168
268
|
}
|
|
169
269
|
process.stdin.pause();
|
|
170
|
-
console.log("\n" + chalk.dim(" stopped."));
|
|
270
|
+
console.log("\n" + (color ? chalk.dim(" stopped.") : " stopped."));
|
|
171
271
|
process.exit(0);
|
|
172
272
|
}
|
|
273
|
+
function cycleDensity(dir) {
|
|
274
|
+
const order = ["compact", "normal", "verbose"];
|
|
275
|
+
const i = order.indexOf(density);
|
|
276
|
+
const next = (i + dir + order.length) % order.length;
|
|
277
|
+
density = order[next];
|
|
278
|
+
const label = color
|
|
279
|
+
? chalk.dim(` [density: ${density}]`)
|
|
280
|
+
: ` [density: ${density}]`;
|
|
281
|
+
console.log(label);
|
|
282
|
+
}
|
|
283
|
+
function printHelp() {
|
|
284
|
+
const lines = [
|
|
285
|
+
" h, ? this help",
|
|
286
|
+
" + more verbose (compact → normal → verbose)",
|
|
287
|
+
" - less verbose",
|
|
288
|
+
" q quit",
|
|
289
|
+
];
|
|
290
|
+
for (const L of lines) {
|
|
291
|
+
console.log(color ? chalk.dim(L) : L);
|
|
292
|
+
}
|
|
293
|
+
}
|
|
173
294
|
if (process.stdin.isTTY) {
|
|
174
295
|
process.stdin.setRawMode(true);
|
|
175
296
|
process.stdin.resume();
|
|
@@ -177,17 +298,28 @@ export async function runLive(cfg, opts) {
|
|
|
177
298
|
process.stdin.on("data", (key) => {
|
|
178
299
|
if (key === "q" || key === "\u0003")
|
|
179
300
|
quit();
|
|
301
|
+
if (key === "+" || key === "=")
|
|
302
|
+
cycleDensity(1);
|
|
303
|
+
if (key === "-" || key === "_")
|
|
304
|
+
cycleDensity(-1);
|
|
305
|
+
if (key === "h" || key === "?" || key === "H")
|
|
306
|
+
printHelp();
|
|
180
307
|
});
|
|
181
308
|
}
|
|
182
309
|
process.on("SIGINT", quit);
|
|
183
310
|
process.on("SIGTERM", quit);
|
|
184
|
-
// ── Stream loop ─────────────────────────────────────────────────────────────
|
|
185
311
|
await startLiveStream(jsonlPath, (event) => {
|
|
186
|
-
const
|
|
312
|
+
const glyphs = glyphsFor(plain);
|
|
313
|
+
const line = renderEvent(event, {
|
|
314
|
+
W,
|
|
315
|
+
density,
|
|
316
|
+
plain,
|
|
317
|
+
color,
|
|
318
|
+
glyphs,
|
|
319
|
+
});
|
|
187
320
|
if (line !== null) {
|
|
188
321
|
console.log(line);
|
|
189
322
|
}
|
|
190
|
-
}, controller.signal, !opts.history
|
|
191
|
-
);
|
|
323
|
+
}, controller.signal, !opts.history);
|
|
192
324
|
}
|
|
193
325
|
//# sourceMappingURL=live.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"live.js","sourceRoot":"","sources":["../../../src/cli/commands/live.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,IAAI,CAAC;AACpB,OAAO,IAAI,MAAM,MAAM,CAAC;AACxB,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAO,EACL,gBAAgB,EAChB,aAAa,GACd,MAAM,6BAA6B,CAAC;AACrC,OAAO,EACL,eAAe,EACf,mBAAmB,EACnB,WAAW,GAEZ,MAAM,2BAA2B,CAAC;AACnC,OAAO,EAAE,QAAQ,EAAE,MAAM,cAAc,CAAC;AAQxC,iFAAiF;AAEjF,SAAS,OAAO,CAAC,EAAU;IACzB,OAAO,IAAI,IAAI,CAAC,cAAc,CAAC,OAAO,EAAE;QACtC,QAAQ,EAAE,QAAQ;QAClB,IAAI,EAAE,SAAS;QACf,MAAM,EAAE,SAAS;QACjB,MAAM,EAAE,SAAS;QACjB,MAAM,EAAE,KAAK;KACd,CAAC,CA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AC,MAAM,CAAC,CAAC;QAClC,OAAO,CAAC,KAAK,CAAC,EAAE,CAAC,MAAM,EAAE,CAAC,GAAW,EAAE,EAAE;YACvC,IAAI,GAAG,KAAK,GAAG,IAAI,GAAG,KAAK,QAAQ;gBAAE,IAAI,EAAE,CAAC;YAC5C,IAAI,GAAG,KAAK,GAAG,IAAI,GAAG,KAAK,GAAG;gBAAE,YAAY,CAAC,CAAC,CAAC,CAAC;YAChD,IAAI,GAAG,KAAK,GAAG,IAAI,GAAG,KAAK,GAAG;gBAAE,YAAY,CAAC,CAAC,CAAC,CAAC,CAAC;YACjD,IAAI,GAAG,KAAK,GAAG,IAAI,GAAG,KAAK,GAAG,IAAI,GAAG,KAAK,GAAG;gBAAE,SAAS,EAAE,CAAC;QAC7D,CAAC,CAAC,CAAC;IACL,CAAC;IAED,OAAO,CAAC,EAAE,CAAC,QAAQ,EAAE,IAAI,CAAC,CAAC;IAC3B,OAAO,CAAC,EAAE,CAAC,SAAS,EAAE,IAAI,CAAC,CAAC;IAE5B,MAAM,eAAe,CACnB,SAAS,EACT,CAAC,KAAgB,EAAE,EAAE;QACnB,MAAM,MAAM,GAAG,SAAS,CAAC,KAAK,CAAC,CAAC;QAChC,MAAM,IAAI,GAAG,WAAW,CAAC,KAAK,EAAE;YAC9B,CAAC;YACD,OAAO;YACP,KAAK;YACL,KAAK;YACL,MAAM;SACP,CAAC,CAAC;QACH,IAAI,IAAI,KAAK,IAAI,EAAE,CAAC;YAClB,OAAO,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC;QACpB,CAAC;IACH,CAAC,EACD,UAAU,CAAC,MAAM,EACjB,CAAC,IAAI,CAAC,OAAO,CACd,CAAC;AACJ,CAAC"}
|
|
@@ -1,30 +1,67 @@
|
|
|
1
1
|
import type { JournalEntry } from "./jsonl-parser.js";
|
|
2
|
-
export type LiveEventKind = "session_start" | "turn_start" | "thinking" | "tool_call" | "tool_result" | "turn_end" | "compaction" | "subagent_start";
|
|
2
|
+
export type LiveEventKind = "session_start" | "session_meta" | "turn_start" | "thinking" | "tool_call" | "tool_result" | "turn_end" | "compaction" | "subagent_start";
|
|
3
|
+
/** Speculative phase after user message, before JSONL assistant row (honest vs Claude-style UX). */
|
|
4
|
+
export type LivePendingKind = "awaiting" | "reasoning_pending";
|
|
3
5
|
export interface LiveEvent {
|
|
4
6
|
kind: LiveEventKind;
|
|
5
7
|
/** Unix milliseconds */
|
|
6
8
|
timestamp: number;
|
|
7
|
-
/** Tool name (tool_call / subagent_start) */
|
|
9
|
+
/** Tool name (tool_call / tool_result / subagent_start) */
|
|
8
10
|
tool?: string;
|
|
11
|
+
/** OpenClaw / Claude tool call id (pair call ↔ result) */
|
|
12
|
+
toolCallId?: string;
|
|
9
13
|
/** Human-readable summary of tool input */
|
|
10
14
|
toolSummary?: string;
|
|
11
15
|
/** Whether the tool result was an error (tool_result) */
|
|
12
16
|
toolError?: boolean;
|
|
13
17
|
/** Turn counter since stream started */
|
|
14
18
|
turnIndex?: number;
|
|
19
|
+
/** One-line user text after stripping channel metadata (turn_start) */
|
|
20
|
+
userPreview?: string;
|
|
15
21
|
/** Output tokens (turn_end) */
|
|
16
22
|
tokensOut?: number;
|
|
17
23
|
/** Model name (tool_call / turn_end) */
|
|
18
24
|
model?: string;
|
|
25
|
+
/** API stop reason when present (turn_end) */
|
|
26
|
+
stopReason?: string;
|
|
19
27
|
/** Actual thinking content snippet (thinking event, when available from JSONL) */
|
|
20
28
|
thinkingContent?: string;
|
|
29
|
+
/** Synthetic “waiting” line after turn_start — never labeled “thinking” when reasoning is off */
|
|
30
|
+
pendingKind?: LivePendingKind;
|
|
31
|
+
/** session_meta: thinking level from JSONL */
|
|
32
|
+
thinkingLevel?: string;
|
|
33
|
+
/** session_meta: provider id */
|
|
34
|
+
provider?: string;
|
|
35
|
+
/** Tool result: wall time from OpenClaw details */
|
|
36
|
+
durationMs?: number;
|
|
37
|
+
/** Tool result: process exit code when present */
|
|
38
|
+
exitCode?: number | null;
|
|
39
|
+
/** Tool result: truncated stdout-style preview (verbose mode) */
|
|
40
|
+
resultPreview?: string;
|
|
21
41
|
}
|
|
22
42
|
export declare function getToolIcon(name: string): string;
|
|
23
43
|
export declare function summarizeToolInput(name: string, input: Record<string, unknown>): string;
|
|
24
|
-
interface
|
|
44
|
+
export interface LiveParseCtx {
|
|
25
45
|
turnCounter: number;
|
|
46
|
+
/** Latest effective thinking level from JSONL (`unknown` until first `thinking_level_change`) */
|
|
47
|
+
thinkingLevel: string;
|
|
48
|
+
/** e.g. moonshot/kimi-k2.5 */
|
|
49
|
+
modelLabel: string | null;
|
|
50
|
+
provider: string | null;
|
|
26
51
|
}
|
|
27
|
-
export declare function
|
|
52
|
+
export declare function createLiveParseCtx(): LiveParseCtx;
|
|
53
|
+
/** True when the session may emit reasoning blocks (not “off”). */
|
|
54
|
+
export declare function isReasoningLevelEnabled(level: string): boolean;
|
|
55
|
+
/**
|
|
56
|
+
* Apply OpenClaw journal rows that affect session display (before message parsing).
|
|
57
|
+
* Mutates ctx; returns a session_meta event when something changed.
|
|
58
|
+
*/
|
|
59
|
+
export declare function applyJournalMeta(entry: JournalEntry, ctx: LiveParseCtx): LiveEvent | null;
|
|
60
|
+
/**
|
|
61
|
+
* Strip Feishu/Telegram-style wrappers; return a one-line preview for the turn header.
|
|
62
|
+
*/
|
|
63
|
+
export declare function extractUserPreview(content: unknown[]): string | undefined;
|
|
64
|
+
export declare function entryToLiveEvents(entry: JournalEntry, ctx: LiveParseCtx): LiveEvent[];
|
|
28
65
|
/**
|
|
29
66
|
* Tail a JSONL file, parsing new entries every 100ms and emitting LiveEvents.
|
|
30
67
|
*
|
|
@@ -37,5 +74,4 @@ export declare function startLiveStream(filePath: string, onEvent: (event: LiveE
|
|
|
37
74
|
* Falls back to the most recent file overall.
|
|
38
75
|
*/
|
|
39
76
|
export declare function findMostRecentJsonl(sessionsDir: string): string | null;
|
|
40
|
-
export {};
|
|
41
77
|
//# sourceMappingURL=live-stream.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"live-stream.d.ts","sourceRoot":"","sources":["../../src/core/live-stream.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,YAAY,EAA4B,MAAM,mBAAmB,CAAC;AAIhF,MAAM,MAAM,aAAa,GACrB,eAAe,GACf,YAAY,GACZ,UAAU,GACV,WAAW,GACX,aAAa,GACb,UAAU,GACV,YAAY,GACZ,gBAAgB,CAAC;AAErB,MAAM,WAAW,SAAS;IACxB,IAAI,EAAE,aAAa,CAAC;IACpB,wBAAwB;IACxB,SAAS,EAAE,MAAM,CAAC;IAClB,
|
|
1
|
+
{"version":3,"file":"live-stream.d.ts","sourceRoot":"","sources":["../../src/core/live-stream.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,YAAY,EAA4B,MAAM,mBAAmB,CAAC;AAIhF,MAAM,MAAM,aAAa,GACrB,eAAe,GACf,cAAc,GACd,YAAY,GACZ,UAAU,GACV,WAAW,GACX,aAAa,GACb,UAAU,GACV,YAAY,GACZ,gBAAgB,CAAC;AAErB,oGAAoG;AACpG,MAAM,MAAM,eAAe,GAAG,UAAU,GAAG,mBAAmB,CAAC;AAE/D,MAAM,WAAW,SAAS;IACxB,IAAI,EAAE,aAAa,CAAC;IACpB,wBAAwB;IACxB,SAAS,EAAE,MAAM,CAAC;IAClB,2DAA2D;IAC3D,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,0DAA0D;IAC1D,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,2CAA2C;IAC3C,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,yDAAyD;IACzD,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,wCAAwC;IACxC,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,uEAAuE;IACvE,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,+BAA+B;IAC/B,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,wCAAwC;IACxC,KAAK,CAAC,EAAE,MAAM,CAA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