agent-run-inspector 0.10.4 → 0.10.5

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 CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "agent-run-inspector",
3
- "version": "0.10.4",
3
+ "version": "0.10.5",
4
4
  "description": "Local, read-only inspector for Claude Code and Codex CLI agent runs.",
5
5
  "keywords": [
6
6
  "claude-code",
@@ -26,6 +26,17 @@ const textOf = (c) => (typeof c === 'string' ? c : Array.isArray(c) ? c.map((b)
26
26
 
27
27
  /** The bot's slug when `cwd` is an Orca bot's home folder, else undefined. */
28
28
  export const botOf = (cwd) => (typeof cwd === 'string' ? BOT_CWD.exec(cwd)?.[1] : undefined);
29
+ /** The bot's slug from Claude Code's project folder name (`-Users-me--orca-bots-<slug>`), for a file with no cwd. */
30
+ export const botOfProject = (dir) => (typeof dir === 'string' ? /--orca-bots-(.+)$/.exec(dir)?.[1] : undefined);
31
+
32
+ // Orca names each run of a bot with a `custom-title` record (its first line): "Home" for a chat, and its own
33
+ // scheduled runs "Look around" (a short read-only pass that suggests next steps) and "Tidy-up" (memory upkeep).
34
+ const ROUTINES = new Set(['Look around', 'Tidy-up']);
35
+ /** The run's name when it is one of a bot's routine runs, from the file's first records, else undefined. */
36
+ export const routineOf = (head) => {
37
+ const t = head.find((r) => r?.type === 'custom-title')?.customTitle;
38
+ return ROUTINES.has(t) ? t : undefined;
39
+ };
29
40
 
30
41
  /** { task, dispatch } when this user record is Orca's dispatch prompt (call it on a file's first user record
31
42
  * only); with `helper: true` when it is Orca's branch-name helper quoting that prompt. */
@@ -12,7 +12,13 @@ import { linkCodexAgents } from '../adapters/codex/agents.js';
12
12
  import { AgentCollector, buildSessionTree } from '../adapters/claude-code/agents.js';
13
13
  import { ENDS_TURN, isLocalCommand, shutdownSignal } from '../adapters/claude-code/index.js';
14
14
  import { BackgroundTasks } from '../adapters/claude-code/tools.js';
15
- import { botOf } from '../adapters/claude-code/orca.js';
15
+ import { botOf, botOfProject, routineOf } from '../adapters/claude-code/orca.js';
16
+
17
+ // One of a bot's routine runs (Look around, Tidy-up): named so, and shown quieter in the list.
18
+ const routineFields = (bot, head) => {
19
+ const name = bot ? routineOf(head) : undefined;
20
+ return name ? { title: name, routine: true } : {};
21
+ };
16
22
  import { mapUsage } from '../adapters/codex/llm.js';
17
23
  import { MSG } from '../strings.js';
18
24
 
@@ -124,11 +130,12 @@ function quickClaude(entry, store, now) {
124
130
  for (const r of readTail(store, entry.main.fileId, entry.main.size, TITLE_SCAN_BYTES)) if (r.type === 'assistant') bg.onAssistant(r); else if (r.type === 'user') bg.onUser(r);
125
131
  }
126
132
  const running = (recent(last) && (!turnEnded || bg.open.size > 0)) || childRunning;
127
- const bot = botOf(cwd);
133
+ const bot = botOf(cwd) ?? (cwd ? undefined : botOfProject(entry.project));
128
134
  return base(entry, {
129
135
  ...(title ? { title } : {}),
130
136
  ...(bot ? { bot } : {}),
131
- project: lastSeg(cwd) || entry.project || '',
137
+ ...routineFields(bot, head),
138
+ project: lastSeg(cwd) || bot || entry.project || '',
132
139
  ...(cwd ? { cwd } : {}),
133
140
  ...(branch ? { branch } : {}),
134
141
  start: first ?? entry.main.mtimeMs,
@@ -250,7 +257,9 @@ export function openEntry(entry, store, now) {
250
257
  const m = root.meta();
251
258
  meta = m ? { cwd: m.cwd, branch: m.branch, project: lastSeg(m.cwd) } : { title: MSG.unknownFormat };
252
259
  }
253
- return { summary: fullSummary(entry, spans, meta), spans, markers, turns };
260
+ const summary = fullSummary(entry, spans, meta);
261
+ if (summary.bot) Object.assign(summary, routineFields(summary.bot, readHead(store, entry.main.fileId, entry.main.size)));
262
+ return { summary, spans, markers, turns };
254
263
  }
255
264
 
256
265
  export function fullSummary(entry, spans, meta) {
@@ -281,11 +290,11 @@ export function fullSummary(entry, spans, meta) {
281
290
  }
282
291
  totals.usd = llmCount > 0 && usdKnown ? usd : null;
283
292
  const title = meta.title;
284
- const bot = entry.source === 'claude-code' ? botOf(meta.cwd) : undefined;
293
+ const bot = entry.source === 'claude-code' ? botOf(meta.cwd) ?? (meta.cwd ? undefined : botOfProject(entry.project)) : undefined;
285
294
  return base(entry, {
286
295
  ...(title ? { title } : {}),
287
296
  ...(bot ? { bot } : {}),
288
- project: meta.project ?? '',
297
+ project: meta.project || bot || '',
289
298
  ...(meta.cwd ? { cwd: meta.cwd } : {}),
290
299
  ...(meta.branch ? { branch: meta.branch } : {}),
291
300
  start: session?.start ?? 0,
package/web/app.css CHANGED
@@ -115,6 +115,9 @@ body.resizing { cursor: col-resize; user-select: none; }
115
115
  .pi { width: 12px; height: 12px; fill: light-dark(var(--il), var(--id)); flex: none; }
116
116
  .sess .proj { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 12em; }
117
117
  .sess .t .dot { margin-left: auto; }
118
+ /* An Orca bot's scheduled runs (Look around, Tidy-up): quieter, back to full on hover, focus or selection */
119
+ .sess.routine:not([aria-current]):not(:hover):not(:focus-visible) { opacity: 0.55; }
120
+ .sess.routine .t .name { font-weight: 400; }
118
121
  .origin { font-size: 11px; color: var(--faint); border: 1px solid var(--line-2); border-radius: 4px; padding: 0 4px; }
119
122
  .link { color: var(--accent); text-decoration: underline; display: block; margin-top: 8px; }
120
123
  .link:hover { text-decoration: none; }
@@ -117,6 +117,7 @@ export function sessionRow(s, { selected = false, now = Date.now(), group = null
117
117
  row.dataset.id = s.id;
118
118
  row.draggable = true; // onto a group chip
119
119
  if (selected) row.setAttribute('aria-current', 'true');
120
+ if (s.routine) { row.classList.add('routine'); row.title = S.list.routineTip; } // an Orca bot's scheduled run
120
121
  const t = el('div', 't');
121
122
  const badge = el('span', `badge ${s.source === 'codex' ? 'cx' : 'cc'}`, S.sourceBadge[s.source] ?? '?');
122
123
  badge.title = S.sourceTip(S.source[s.source] ?? s.source);
package/web/strings.js CHANGED
@@ -34,6 +34,7 @@ export const S = {
34
34
  untitled: 'Untitled session',
35
35
  bot: 'Bot',
36
36
  botTip: (name) => `Orca bot "${name}": its workers are folded into this run`,
37
+ routineTip: "One of the Orca bot's scheduled runs (Look around: a short read-only check that suggests next steps; Tidy-up: memory upkeep)",
37
38
  searchPlaceholder: 'Search title or project',
38
39
  sourceLabel: 'Tool',
39
40
  periodLabel: 'Period',