claude-code-watch 0.0.15 → 0.0.17
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 +16 -1
- package/src/parser/parser.js +7 -2
- package/src/server/server.js +3 -1
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); }
|
|
@@ -319,6 +320,7 @@ body {
|
|
|
319
320
|
<span class="sep">│</span>
|
|
320
321
|
<span id="item-count">0 items</span>
|
|
321
322
|
<span class="sep">│</span>
|
|
323
|
+
<span id="footer-version" style="margin-left:auto;font-size:10px;color:var(--dim)"></span>
|
|
322
324
|
</div>
|
|
323
325
|
|
|
324
326
|
<script src="vendor/highlight.min.js"></script>
|
|
@@ -379,6 +381,7 @@ let showText = true;
|
|
|
379
381
|
let showHook = true;
|
|
380
382
|
let showActivity = true;
|
|
381
383
|
let autoDiscovery = true;
|
|
384
|
+
let appVersion = '';
|
|
382
385
|
|
|
383
386
|
let renderPending = false;
|
|
384
387
|
|
|
@@ -505,6 +508,7 @@ function handleMessage(msg) {
|
|
|
505
508
|
case 'autoDiscoveryChanged': autoDiscovery = msg.payload.enabled; scheduleRender(); break;
|
|
506
509
|
case 'context': contextData = msg.payload; scheduleRender(); break;
|
|
507
510
|
case 'config':
|
|
511
|
+
if (msg.payload.version) appVersion = msg.payload.version;
|
|
508
512
|
if (msg.payload.collapseAfter > 0 && !collapseTimer) {
|
|
509
513
|
applyCollapsePolicy(msg.payload.collapseAfter);
|
|
510
514
|
}
|
|
@@ -983,7 +987,11 @@ function renderItem(item) {
|
|
|
983
987
|
if (item.toolName) label += ' ' + item.toolName;
|
|
984
988
|
if (item.durationMs > 0) label += ' ' + fmtDur(item.durationMs);
|
|
985
989
|
lines.push({ cls: agentTagCls, text: `<span class="tag-label">${esc(agentName + sep + label)}</span>${tsHtml}`, html: true });
|
|
986
|
-
|
|
990
|
+
if (item.hookCommand) lines.push({ cls: 'stream-line hook', text: `<span class="hook-label">command:</span> ${esc(item.hookCommand)}`, html: true });
|
|
991
|
+
if (item.hookContent) {
|
|
992
|
+
for (const l of truncContent(item.hookContent)) lines.push({ cls: 'stream-line hook', text: `<span class="hook-label">content:</span> ${esc(l)}`, html: true });
|
|
993
|
+
}
|
|
994
|
+
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
995
|
break;
|
|
988
996
|
}
|
|
989
997
|
case 'diagnostics': {
|
|
@@ -1046,6 +1054,13 @@ function refreshButtons() {
|
|
|
1046
1054
|
}
|
|
1047
1055
|
}
|
|
1048
1056
|
tokenInfo.textContent = tokStr;
|
|
1057
|
+
|
|
1058
|
+
// Footer version
|
|
1059
|
+
const vEl = document.getElementById('footer-version');
|
|
1060
|
+
if (vEl) {
|
|
1061
|
+
const v = appVersion ? `v${appVersion}` : '';
|
|
1062
|
+
vEl.innerHTML = `${v ? v + ' · ' : ''}<a href="https://github.com/shuxuecode/claude-watch" target="_blank" rel="noopener" style="color:var(--dim);display:inline-flex;align-items:center;gap:3px"><svg viewBox="0 0 16 16" width="12" height="12" fill="currentColor" style="vertical-align:middle"><path d="M8 0C3.58 0 0 3.58 0 8c0 3.54 2.29 6.53 5.47 7.59.4.07.55-.17.55-.38 0-.19-.01-.82-.01-1.49-2.01.37-2.53-.49-2.69-.94-.09-.23-.48-.94-.82-1.13-.28-.15-.68-.52-.01-.53.63-.01 1.08.58 1.23.82.72 1.21 1.87.87 2.33.66.07-.52.28-.87.51-1.07-1.78-.2-3.64-.89-3.64-3.95 0-.87.31-1.59.82-2.15-.08-.2-.36-1.02.08-2.12 0 0 .67-.21 2.2.82.64-.18 1.32-.27 2-.27.68 0 1.36.09 2 .27 1.53-1.04 2.2-.82 2.2-.82.44 1.1.16 1.92.08 2.12.51.56.82 1.27.82 2.15 0 3.07-1.87 3.75-3.65 3.95.29.25.54.73.54 1.48 0 1.07-.01 1.93-.01 2.2 0 .21.15.46.55.38A8.013 8.013 0 0016 8c0-4.42-3.58-8-8-8z"/></svg>claude-watch</a>`;
|
|
1063
|
+
}
|
|
1049
1064
|
}
|
|
1050
1065
|
|
|
1051
1066
|
// ══════════════════════════════════════════════════════════════════════════════
|
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
|
})];
|
package/src/server/server.js
CHANGED
|
@@ -10,6 +10,8 @@ var { WebSocketServer } = require('ws');
|
|
|
10
10
|
var { Watcher, listSessions, listActiveSessions } = require('../watcher/watcher');
|
|
11
11
|
var { setDebugAll, contextWindowFor } = require('../parser/parser');
|
|
12
12
|
|
|
13
|
+
var PACKAGE_VERSION = require('../../package.json').version;
|
|
14
|
+
|
|
13
15
|
var MIME = {
|
|
14
16
|
'.html': 'text/html; charset=utf-8',
|
|
15
17
|
'.css': 'text/css; charset=utf-8',
|
|
@@ -306,7 +308,7 @@ class DashboardServer {
|
|
|
306
308
|
}
|
|
307
309
|
|
|
308
310
|
sendConfig(ws) {
|
|
309
|
-
this.send(ws, 'config', { collapseAfter: this.collapseAfterMs });
|
|
311
|
+
this.send(ws, 'config', { collapseAfter: this.collapseAfterMs, version: PACKAGE_VERSION });
|
|
310
312
|
}
|
|
311
313
|
|
|
312
314
|
setupWatcher(watcherOpts) {
|