agent-run-inspector 0.9.0 → 0.9.2
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/prices.json +31 -1
- package/src/adapters/claude-code/index.js +11 -2
- package/src/index/summary.js +6 -3
package/package.json
CHANGED
package/prices.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"unit": "USD per 1M tokens",
|
|
3
|
-
"asOf": "2026-11-
|
|
3
|
+
"asOf": "2026-11-19",
|
|
4
4
|
"notes": [
|
|
5
5
|
"Anthropic cacheWrite is the 5-minute rate (1-hour writes cost more). OpenAI cacheWrite is the 30-minute rate (12-hour writes cost more); null = the page lists no write price.",
|
|
6
6
|
"OpenAI short context is input up to 272K tokens; longContext holds the >272K rates where OpenAI lists them.",
|
|
@@ -197,6 +197,36 @@
|
|
|
197
197
|
"source": "Supplied by the user from OpenAI API rates (2026-11-16)",
|
|
198
198
|
"asOf": "2026-11-16"
|
|
199
199
|
},
|
|
200
|
+
"gpt-6.2-astra": {
|
|
201
|
+
"input": 8,
|
|
202
|
+
"output": 40,
|
|
203
|
+
"cacheRead": 0.4,
|
|
204
|
+
"cacheWrite": 10,
|
|
205
|
+
"longContext": {
|
|
206
|
+
"above": 272000,
|
|
207
|
+
"input": 16,
|
|
208
|
+
"output": 60,
|
|
209
|
+
"cacheRead": 0.8,
|
|
210
|
+
"cacheWrite": 20
|
|
211
|
+
},
|
|
212
|
+
"source": "https://developers.openai.com/api/docs/pricing",
|
|
213
|
+
"asOf": "2026-11-19"
|
|
214
|
+
},
|
|
215
|
+
"gpt-6.2-sol": {
|
|
216
|
+
"input": 2,
|
|
217
|
+
"output": 10,
|
|
218
|
+
"cacheRead": 0.1,
|
|
219
|
+
"cacheWrite": 2.5,
|
|
220
|
+
"longContext": {
|
|
221
|
+
"above": 272000,
|
|
222
|
+
"input": 4,
|
|
223
|
+
"output": 15,
|
|
224
|
+
"cacheRead": 0.2,
|
|
225
|
+
"cacheWrite": 5
|
|
226
|
+
},
|
|
227
|
+
"source": "https://developers.openai.com/api/docs/pricing",
|
|
228
|
+
"asOf": "2026-11-19"
|
|
229
|
+
},
|
|
200
230
|
"gpt-6-astra": {
|
|
201
231
|
"input": 10,
|
|
202
232
|
"output": 50,
|
|
@@ -24,6 +24,15 @@ export function shutdownSignal(rec) {
|
|
|
24
24
|
return Array.isArray(c) && c.every((b) => b?.type === 'tool_result') ? undefined : false;
|
|
25
25
|
}
|
|
26
26
|
|
|
27
|
+
/**
|
|
28
|
+
* A slash command Claude Code ran itself (/clear, /usage, /model ...): its records say nothing about a turn.
|
|
29
|
+
* A command that prompts the model is followed by a real prompt record, which starts the turn.
|
|
30
|
+
*/
|
|
31
|
+
export const isLocalCommand = (rec) => {
|
|
32
|
+
const c = rec?.message?.content;
|
|
33
|
+
return typeof c === 'string' && /^\s*<(command-name|local-command-stdout|local-command-stderr|local-command-caveat)>/.test(c);
|
|
34
|
+
};
|
|
35
|
+
|
|
27
36
|
/** Id of the root agent span under the session span (Codex: `cx:<sid>:main`). */
|
|
28
37
|
export const rootAgentId = (sessionId) => `${sessionId}:main`;
|
|
29
38
|
|
|
@@ -55,7 +64,7 @@ export class ClaudeCodeSession {
|
|
|
55
64
|
this.title = undefined;
|
|
56
65
|
// The last turn closed and nothing came after it: the model's final answer (stop_reason end_turn)
|
|
57
66
|
// or system/turn_duration (not written for every turn).
|
|
58
|
-
this.turnEnded =
|
|
67
|
+
this.turnEnded = true; // no turn yet (a file /clear started holds only command records)
|
|
59
68
|
this.shutDown = false; // see shutdownSignal
|
|
60
69
|
this.cwd = undefined;
|
|
61
70
|
this.branch = undefined;
|
|
@@ -125,7 +134,7 @@ export class ClaudeCodeSession {
|
|
|
125
134
|
this.bg.onAssistant(rec);
|
|
126
135
|
break;
|
|
127
136
|
case 'user':
|
|
128
|
-
this.turnEnded = false;
|
|
137
|
+
if (!isLocalCommand(rec)) this.turnEnded = false;
|
|
129
138
|
this.bg.onUser(rec);
|
|
130
139
|
this.tools.onUser(rec, ts);
|
|
131
140
|
this.agents.onUser(rec, ts);
|
package/src/index/summary.js
CHANGED
|
@@ -10,7 +10,7 @@ import { HEAD_BYTES, TAIL_BYTES, TITLE_SCAN_BYTES, findLastTitle, readEnds, read
|
|
|
10
10
|
import { createCodexParser } from '../adapters/codex/index.js';
|
|
11
11
|
import { linkCodexAgents } from '../adapters/codex/agents.js';
|
|
12
12
|
import { AgentCollector, buildSessionTree } from '../adapters/claude-code/agents.js';
|
|
13
|
-
import { ENDS_TURN, shutdownSignal } from '../adapters/claude-code/index.js';
|
|
13
|
+
import { ENDS_TURN, isLocalCommand, shutdownSignal } from '../adapters/claude-code/index.js';
|
|
14
14
|
import { BackgroundTasks } from '../adapters/claude-code/tools.js';
|
|
15
15
|
import { mapUsage } from '../adapters/codex/llm.js';
|
|
16
16
|
import { MSG } from '../strings.js';
|
|
@@ -45,7 +45,7 @@ function subFinished(store, sub) {
|
|
|
45
45
|
}
|
|
46
46
|
|
|
47
47
|
// The record that says whether a Claude Code thread is mid-turn, and whether that turn ended.
|
|
48
|
-
const turnRec = (tail) => lastOf(tail, (r) => r.type === 'user' || r.type === 'assistant' || (r.type === 'system' && r.subtype === 'turn_duration'));
|
|
48
|
+
const turnRec = (tail) => lastOf(tail, (r) => (r.type === 'user' && !isLocalCommand(r)) || r.type === 'assistant' || (r.type === 'system' && r.subtype === 'turn_duration'));
|
|
49
49
|
const ended = (r) => r?.type === 'system' || (r?.type === 'assistant' && ENDS_TURN.has(r.message?.stop_reason));
|
|
50
50
|
|
|
51
51
|
// Teammates the lead stopped (TaskStop) or heard shut down, from the lead's tail: name -> time.
|
|
@@ -104,7 +104,10 @@ function quickClaude(entry, store, now) {
|
|
|
104
104
|
}
|
|
105
105
|
const recent = (t) => now - t < RUNNING_MS && now >= t;
|
|
106
106
|
// The main thread's last turn ended (a final answer or system/turn_duration last): it waits for the user.
|
|
107
|
-
|
|
107
|
+
// No turn record at all: done when the tail holds only command records (a file /clear started); otherwise
|
|
108
|
+
// the tail may just sit inside one huge record, so keep the old reading (not ended).
|
|
109
|
+
const lastTurn = turnRec(tail);
|
|
110
|
+
const turnEnded = lastTurn ? ended(lastTurn) : tail.some(isLocalCommand);
|
|
108
111
|
// ...but a sub-agent or teammate still writing keeps the run going (same rule as the full parse).
|
|
109
112
|
const stopped = entry.subs.some((s) => s.mate) ? stoppedMates(tail) : new Map();
|
|
110
113
|
const childRunning = entry.subs.some((s) => recent(s.mtimeMs) && (s.mate ? !mateDone(store, s, stopped) : !subFinished(store, s)));
|