shadok-ai 0.19.48 → 0.19.50
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/README.md +7 -1
- package/dist/server.js +8 -2
- package/dist/server.js.map +1 -1
- package/dist/token-stats.d.ts +7 -0
- package/dist/token-stats.js +17 -0
- package/dist/token-stats.js.map +1 -1
- package/package.json +1 -1
- package/public/index.html +28 -1
package/README.md
CHANGED
|
@@ -237,7 +237,13 @@ Enter to skip; you can add it later from the web UI).
|
|
|
237
237
|
API, so nothing is billed per token; the figure is what those tokens would cost
|
|
238
238
|
at Anthropic API list prices, a way to compare agents rather than an invoice. It
|
|
239
239
|
also shows how long the agent has been **up** (session age, which survives
|
|
240
|
-
restarts)
|
|
240
|
+
restarts), when it **last respawned** (the running process's start), and the
|
|
241
|
+
**model** it runs on — both what it is *set* to (the pick, the profile's, or
|
|
242
|
+
the instance default) and, after its first reply, the concrete model that
|
|
243
|
+
actually produced its **last message** (`set → actual`), read from the
|
|
244
|
+
transcript. That last-message model is the only place the real model is
|
|
245
|
+
observable: the *setting* is empty for "Claude Code's own default", so an agent
|
|
246
|
+
on the default shows which model it resolved to only here. The
|
|
241
247
|
figures are the **real** per-message counts the API reported (only the *cost* is
|
|
242
248
|
notional), and they include the agent's **subagents** — the Task-tool children
|
|
243
249
|
write their own transcripts, so a delegating agent's true total is mostly there;
|
package/dist/server.js
CHANGED
|
@@ -48,7 +48,7 @@ import { parseSkillMeta, prepromptParts, prepromptFingerprint, stalenessReasons,
|
|
|
48
48
|
import { ensureSpawnHelperExecutable } from "./node-pty-fix.js";
|
|
49
49
|
import { TmuxPilot, tmuxAvailable, tmuxHasSession, tmuxKillSession, tmuxPaneCwd, tmuxSessionCreated } from "./tmux.js";
|
|
50
50
|
import { scanUsageSamples, scanUsageSamplesAsync, subagentDirFor, sessionFilePath, tailSession, clearTailPos, seedTailPos, isNothingToShow, newestTranscriptById } from "./tail.js";
|
|
51
|
-
import { windowStats } from "./token-stats.js";
|
|
51
|
+
import { windowStats, latestModel } from "./token-stats.js";
|
|
52
52
|
import { strandedWorktreePlan } from "./worktree-relocate.js";
|
|
53
53
|
import { detectFork, rootIdOfFile } from "./forktrace.js";
|
|
54
54
|
import { computePace, paceBlock, WINDOW_SEC } from "./pace.js";
|
|
@@ -2941,7 +2941,13 @@ app.get("/channels/stats", async (req, res) => {
|
|
|
2941
2941
|
// delegating agent reads far cheaper than it was.
|
|
2942
2942
|
const subs = await subagentSamples(mainFile);
|
|
2943
2943
|
const windows = windowStats([...mainSamples, ...subs], Date.now());
|
|
2944
|
-
|
|
2944
|
+
// The model that produced this agent's most recent message — the resolved
|
|
2945
|
+
// name (e.g. "claude-opus-4-8"), the only place the REAL model is observable.
|
|
2946
|
+
// `model` above is just the --model setting (empty for the default). Computed
|
|
2947
|
+
// from the agent's OWN samples, never the subagents' (a child's model is not
|
|
2948
|
+
// the agent's). Reflects the last message as of this request — see the client.
|
|
2949
|
+
const lastModel = latestModel(mainSamples);
|
|
2950
|
+
res.json({ windows, upSince, lastRespawn, model, lastModel });
|
|
2945
2951
|
});
|
|
2946
2952
|
// The instance-wide total, for the header ⋯ menu's "Instance stats". A dormant
|
|
2947
2953
|
// agent's scan is cached by (mtime,size), so re-opening only stat()s unchanged
|