claude-code-watch 0.0.15 → 0.0.16
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/package.json +1 -1
- package/public/index.html +6 -1
- package/src/parser/parser.js +7 -2
package/package.json
CHANGED
package/public/index.html
CHANGED
|
@@ -200,6 +200,7 @@ body {
|
|
|
200
200
|
.stream-line.tool-output { color: var(--green); }
|
|
201
201
|
.stream-line.text { color: var(--text); }
|
|
202
202
|
.stream-line.hook { color: var(--cyan); }
|
|
203
|
+
.stream-line .hook-label { color: var(--dim); }
|
|
203
204
|
.stream-line.diag { color: var(--red); }
|
|
204
205
|
.stream-line.debug { color: var(--gray); }
|
|
205
206
|
.stream-line.marker { color: var(--dim); }
|
|
@@ -983,7 +984,11 @@ function renderItem(item) {
|
|
|
983
984
|
if (item.toolName) label += ' ' + item.toolName;
|
|
984
985
|
if (item.durationMs > 0) label += ' ' + fmtDur(item.durationMs);
|
|
985
986
|
lines.push({ cls: agentTagCls, text: `<span class="tag-label">${esc(agentName + sep + label)}</span>${tsHtml}`, html: true });
|
|
986
|
-
|
|
987
|
+
if (item.hookCommand) lines.push({ cls: 'stream-line hook', text: `<span class="hook-label">command:</span> ${esc(item.hookCommand)}`, html: true });
|
|
988
|
+
if (item.hookContent) {
|
|
989
|
+
for (const l of truncContent(item.hookContent)) lines.push({ cls: 'stream-line hook', text: `<span class="hook-label">content:</span> ${esc(l)}`, html: true });
|
|
990
|
+
}
|
|
991
|
+
for (const l of truncContent(item.content)) lines.push({ cls: 'stream-line hook', text: `<span class="hook-label">stdout:</span> ${esc(l)}`, html: true });
|
|
987
992
|
break;
|
|
988
993
|
}
|
|
989
994
|
case 'diagnostics': {
|
package/src/parser/parser.js
CHANGED
|
@@ -28,6 +28,7 @@ function makeItem(overrides = {}) {
|
|
|
28
28
|
return {
|
|
29
29
|
type: '', sessionID: '', agentID: '', agentName: '', timestamp: 0,
|
|
30
30
|
content: '', toolName: '', toolID: '', durationMs: 0,
|
|
31
|
+
hookContent: '', hookCommand: '',
|
|
31
32
|
inputTokens: 0, outputTokens: 0, cacheCreationTokens: 0, cacheReadTokens: 0,
|
|
32
33
|
model: '',
|
|
33
34
|
...overrides,
|
|
@@ -212,14 +213,18 @@ function parseAttachment(raw, timestamp) {
|
|
|
212
213
|
const name = agentDisplayName(raw.agentId);
|
|
213
214
|
switch (raw.attachment.type) {
|
|
214
215
|
case 'hook_success': {
|
|
215
|
-
const
|
|
216
|
+
const stdout = (raw.attachment.stdout || '').replace(/\n$/, '');
|
|
217
|
+
const stdin = raw.attachment.content || '';
|
|
218
|
+
const hookContent = stdin && stdin !== stdout ? stdin : '';
|
|
216
219
|
return [makeItem({
|
|
217
220
|
type: StreamItemType.HOOK_OUTPUT,
|
|
218
221
|
sessionID: raw.sessionId,
|
|
219
222
|
agentID: raw.agentId || '',
|
|
220
223
|
agentName: name,
|
|
221
224
|
toolName: raw.attachment.hookName || '',
|
|
222
|
-
content:
|
|
225
|
+
content: stdout,
|
|
226
|
+
hookContent: hookContent,
|
|
227
|
+
hookCommand: raw.attachment.command || '',
|
|
223
228
|
durationMs: raw.attachment.durationMs || 0,
|
|
224
229
|
timestamp,
|
|
225
230
|
})];
|