@axiomatic-labs/claudeflow 2.13.29 → 2.13.30

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.
Files changed (2) hide show
  1. package/lib/panel.js +19 -5
  2. package/package.json +1 -1
package/lib/panel.js CHANGED
@@ -353,6 +353,12 @@ function listLogEvents(cwd, { limit = 200, before = null, type = 'all' } = {}) {
353
353
  if (type === 'reminder' && !r.type.startsWith('reminder')) continue;
354
354
  }
355
355
  // Strip large `content` from list view; clients fetch it via /api/logs/:id
356
+ // Old sidecars (pre-token-estimate) lack `contentTokens`. Backfill on
357
+ // the fly using the same chars/4 heuristic — keeps the UI consistent
358
+ // for events captured before the upgrade.
359
+ const tokens = typeof r.contentTokens === 'number'
360
+ ? r.contentTokens
361
+ : (r.contentBytes ? Math.round(r.contentBytes / 4) : 0);
356
362
  entries.push({
357
363
  id: r.id,
358
364
  timestamp: r.timestamp,
@@ -362,6 +368,7 @@ function listLogEvents(cwd, { limit = 200, before = null, type = 'all' } = {}) {
362
368
  handler: r.handler,
363
369
  summary: r.summary,
364
370
  contentBytes: r.contentBytes || 0,
371
+ contentTokens: tokens,
365
372
  activeReminderIds: r.activeReminderIds || null,
366
373
  });
367
374
  }
@@ -901,8 +908,9 @@ async function viewLogDetail(id) {
901
908
  html += '<h4 style="margin-top:14px">Active reminders at fire time</h4>';
902
909
  html += '<p class="sub">' + ev.activeReminderIds.map(escapeHtml).join(', ') + '</p>';
903
910
  }
904
- if (typeof ev.contentBytes === 'number') {
905
- html += '<h4 style="margin-top:14px">Injected content (' + fmtBytes(ev.contentBytes) + ')</h4>';
911
+ if (typeof ev.contentBytes === 'number' && ev.contentBytes > 0) {
912
+ const tokens = typeof ev.contentTokens === 'number' ? ev.contentTokens : Math.round(ev.contentBytes / 4);
913
+ html += '<h4 style="margin-top:14px">Injected content — ≈' + tokens.toLocaleString() + ' tokens <span class="muted" style="font-size:11px">(approx · ' + fmtBytes(ev.contentBytes) + ' raw)</span></h4>';
906
914
  }
907
915
  if (typeof ev.content === 'string' && ev.content.length > 0) {
908
916
  html += '<pre>' + escapeHtml(ev.content) + '</pre>';
@@ -947,12 +955,18 @@ function renderLogs() {
947
955
  const badge = isReminder
948
956
  ? '<span class="badge info" style="background:rgba(88,166,255,0.18); color:#58a6ff">REMINDER</span>'
949
957
  : '<span class="badge err">ENFORCEMENT</span>';
950
- const sizeStr = e.contentBytes ? fmtBytes(e.contentBytes) : '—';
958
+ const tokensStr = e.contentTokens
959
+ ? \`≈\${e.contentTokens.toLocaleString()}\`
960
+ : '—';
961
+ const bytesStr = e.contentBytes ? fmtBytes(e.contentBytes) : '';
962
+ const tokensTitle = e.contentBytes
963
+ ? \`≈\${e.contentTokens} tokens (approx, chars/4 heuristic) · \${fmtBytes(e.contentBytes)} raw\`
964
+ : 'No content (enforcement-silenced)';
951
965
  return \`<tr>
952
966
  <td class="logs-time"><span title="\${escapeHtml(e.timestamp)}">\${escapeHtml(fmtLocalTime(e.timestamp))}</span><br><span class="muted" style="font-size:11px">\${fmtRelativeTime(e.timestamp)}</span></td>
953
967
  <td>\${badge}</td>
954
968
  <td class="logs-handler"><span class="muted">\${escapeHtml(e.event)}</span><br>\${escapeHtml(e.handler)}\${e.matcher ? \` <span class="muted">(\${escapeHtml(e.matcher)})</span>\` : ''}</td>
955
- <td class="logs-size">\${sizeStr}</td>
969
+ <td class="logs-size" title="\${escapeHtml(tokensTitle)}">\${tokensStr}\${bytesStr ? \`<br><span class="muted" style="font-size:11px">\${bytesStr}</span>\` : ''}</td>
956
970
  <td><button class="logs-view" data-log-id="\${escapeHtml(e.id)}">View</button></td>
957
971
  </tr>\`;
958
972
  }).join('');
@@ -972,7 +986,7 @@ function renderLogs() {
972
986
  <button id="logs-reload">Reload</button>
973
987
  </div>
974
988
  \${empty || \`<table class="logs-table">
975
- <thead><tr><th>Time</th><th>Type</th><th>Handler</th><th>Size</th><th></th></tr></thead>
989
+ <thead><tr><th>Time</th><th>Type</th><th>Handler</th><th title="Approximate token count (chars/4 heuristic — within ±10–15% of Claude's actual tokenizer for markdown/code mix)">≈ Tokens</th><th></th></tr></thead>
976
990
  <tbody>\${rows}</tbody>
977
991
  </table>\`}
978
992
  \${logsState.allLoaded || logsState.entries.length === 0 ? '' : '<div style="margin-top:12px"><button id="logs-load-more">Load older</button></div>'}\`;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@axiomatic-labs/claudeflow",
3
- "version": "2.13.29",
3
+ "version": "2.13.30",
4
4
  "description": "Claudeflow — AI-powered development toolkit for Claude Code. Skills, agents, hooks, and quality gates that ship production apps.",
5
5
  "bin": {
6
6
  "claudeflow": "./bin/cli.js"