worktrust 0.10.15 → 0.10.16
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 +1 -1
- package/log-session.mjs +2 -2
- package/package.json +1 -1
- package/transcript-readers.mjs +32 -0
- package/worktrust.mjs +1 -1
package/README.md
CHANGED
|
@@ -226,7 +226,7 @@ nothing it does not:
|
|
|
226
226
|
| `retrieval` | retrieval and grounding: searches (grep, rg, find, Grep, Glob, a web search, an MCP search tool), the same search again, a search followed by a read or a change (found) or by another search (again), searches before the first change and right after a failure, and deliveries with docs, tests or a search since the last change (grounded); counts only, nothing searched is kept (0.9.9) |
|
|
227
227
|
| `window` | the context window, from the token counts the AI app writes beside each answer (input plus cached, once per message): the peak a turn carried, the turns over 100k, 200k and 500k, the growth from the first quarter of answers to the last, and compactions near the peak; counts only, nothing of what the context held (0.10.0) |
|
|
228
228
|
| `review` | reviewing the agent: reviews while it worked, the middle interval, subagent runs reviewed, and what a review led to (a change of course, a change, a check); counts only (0.10.1) |
|
|
229
|
-
| `live` | counted inside Claude Code by the WorkTrust mod, only when you turned it on (`worktrust mod install`, 0.10.15): permission questions put to you and how many you answered yes or no (not in auto mode, where a classifier answers), model requests per effort level, how many models answered and requests sent to another model, the highest context fill and plan-limit use as percentages, compactions you asked for or that ran by themselves, subagents started (built-in, your own, in the background, forks) and teammates, and how many other mods, MCP servers and own agent types were active; counts only, never a prompt, an answer, a command, a path or a name |
|
|
229
|
+
| `live` | counted inside Claude Code by the WorkTrust mod, only when you turned it on (`worktrust mod install`, 0.10.15): permission questions put to you and how many you answered yes or no (not in auto mode, where a classifier answers), model requests per effort level, how many models answered and requests sent to another model, the highest context fill and plan-limit use as percentages, compactions you asked for or that ran by themselves, subagents started (built-in, your own, in the background, forks) and teammates, and how many other mods, MCP servers and own agent types were active; counts only, never a prompt, an answer, a command, a path or a name. From 0.10.16 a Codex session carries the same keys read from its own rollout, with nothing installed: each turn's effort level, the models, and the highest context fill and plan-limit use |
|
|
230
230
|
| `collector_version` | the CLI version that measured it |
|
|
231
231
|
| `seq`, `prev`, `hash` | the line's place, the hash of the line before it, and its own hash |
|
|
232
232
|
|
package/log-session.mjs
CHANGED
|
@@ -263,7 +263,7 @@ const excluded = (path) => excludes.some((text) => text && path.includes(text));
|
|
|
263
263
|
* reader), the database clients in session-databases.mjs. The install copies both into ~/.worktrust with this hook.
|
|
264
264
|
* Without them this hook still reads Claude Code; the never-matching patterns keep every other client out.
|
|
265
265
|
*/
|
|
266
|
-
const { CODEX_ROLLOUT = /(?!)/, codexIdOf = (file) => String(file).split(/[\\/]/).at(-1).replace(/\.jsonl$/, ""), antigravityIdOf = (file) => String(file).split(/[\\/]/).at(-4), codexLines, codexRolloutFiles = function* () {}, codexCwd = () => null, ANTIGRAVITY_TRANSCRIPT = /(?!)/, antigravityLines, antigravityRoots = () => [], antigravityTranscripts = function* () {}, antigravityContext = () => ({}), rememberAntigravity = () => null } = (await import("./transcript-readers.mjs").catch(() => null)) ?? {};
|
|
266
|
+
const { CODEX_ROLLOUT = /(?!)/, codexIdOf = (file) => String(file).split(/[\\/]/).at(-1).replace(/\.jsonl$/, ""), antigravityIdOf = (file) => String(file).split(/[\\/]/).at(-4), codexLines, codexRolloutFiles = function* () {}, codexCwd = () => null, ANTIGRAVITY_TRANSCRIPT = /(?!)/, antigravityLines, antigravityRoots = () => [], antigravityTranscripts = function* () {}, antigravityContext = () => ({}), rememberAntigravity = () => null, codexLive = () => null } = (await import("./transcript-readers.mjs").catch(() => null)) ?? {};
|
|
267
267
|
// THE STRETCH'S DERIVED RECORD (0.7.4: split from this file): tool calls named by kind, verification, recovery, delegation,
|
|
268
268
|
// context and routing, for the local archive only. A copy without the module still measures and sends exactly as before.
|
|
269
269
|
const { callOf = (block) => ({ id: block.id, kinds: [], family: String(block.name), digest: "" }), deriveStretch = () => ({}), complexityOf = null, resultOf = (block) => ({ id: block.tool_use_id, failed: block.is_error === true, refusal: null }) } = (await import("./stretch-evidence.mjs").catch(() => null)) ?? {};
|
|
@@ -272,7 +272,7 @@ const { DATABASE_SESSION = /(?!)/, databaseLines = () => null, databaseSessions
|
|
|
272
272
|
// imports the same reader); `--history --export <path>` sends its conversations as RECONSTRUCTED days, never measured, never tokens.
|
|
273
273
|
const { EXPORT_CLIENTS = [], EXPORT_TITLES = {}, exportSessions = null, exportRef = null, readExport = null, findExports = null } = (await import("./chat-exports.mjs").catch(() => null)) ?? {};
|
|
274
274
|
const { modCounts = () => null } = (await import("./claude-mod.mjs").catch(() => null)) ?? {}; // 0.10.15: the WorkTrust mod's live counts per Claude Code session and day; absent → no `live` group, never zeros
|
|
275
|
-
const liveOf = (file, day) => modCounts(String(file).split(/[\\/]/).pop().replace(/\.jsonl$/, ""), day);
|
|
275
|
+
const liveOf = (file, day) => modCounts(String(file).split(/[\\/]/).pop().replace(/\.jsonl$/, ""), day) ?? codexLive(file, day); // 0.10.16: a Codex rollout's own
|
|
276
276
|
const { stackOfFiles = () => [], displayStackOfFiles = () => [] } = (await import("./stack-rules.mjs").catch(() => null)) ?? {}; // 0.10.11: core's stack rules and the display-only keys (tools_seen), generated (build-stack-rules --check); absent → nothing named, never a guess
|
|
277
277
|
const EXPORT_PATHS = []; for (let i = 0; i < args.length; i += 1) if (args[i] === "--export" && args[i + 1]) EXPORT_PATHS.push(args[i + 1]);
|
|
278
278
|
const DATABASE_CLIENTS = ["hermes", "goose", "opencode", "openclaw", "cursor", "copilot"]; // the registry's keys, the name each line carries
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "worktrust",
|
|
3
|
-
"version": "0.10.
|
|
3
|
+
"version": "0.10.16",
|
|
4
4
|
"description": "Couple this computer to WorkTrust: approve a code in your browser, and every AI app here reports what you built. Metadata only, no dependencies.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"bin": {
|
package/transcript-readers.mjs
CHANGED
|
@@ -102,6 +102,38 @@ export function* codexLines(records) {
|
|
|
102
102
|
}
|
|
103
103
|
}
|
|
104
104
|
/** Every rollout under a Codex sessions root, in a stable order. */
|
|
105
|
+
/**
|
|
106
|
+
* WHAT A CODEX ROLLOUT SHOWS OF HOW THE PERSON STEERS (CLI 0.10.16, owner 2026-10-16): the same `live` keys the WorkTrust
|
|
107
|
+
* mod fills inside Claude Code, read from what Codex itself writes, so nothing is installed. Per UTC day of one rollout:
|
|
108
|
+
* each turn by its effort level (`turn_context.effort`; per TURN here, per request in Claude Code), the models that
|
|
109
|
+
* answered, the highest context fill (a request's input tokens over the model's window) and the highest plan-limit use
|
|
110
|
+
* (`rate_limits.primary`/`secondary.used_percent`), as whole percentages. Compactions and subagents stay out: the rollout
|
|
111
|
+
* does not say who started them, and a guess is noise. Null when the day shows none of it.
|
|
112
|
+
*/
|
|
113
|
+
const EFFORT_LEVELS = new Set(["low", "medium", "high", "xhigh", "max"]);
|
|
114
|
+
export function codexLive(file, day) {
|
|
115
|
+
if (!CODEX_ROLLOUT.test(String(file)) || !/^\d{4}-\d{2}-\d{2}$/.test(String(day))) return null;
|
|
116
|
+
let text; try { text = readFileSync(file, "utf8"); } catch { return null; }
|
|
117
|
+
const out = {}, models = new Set();
|
|
118
|
+
const peak = (key, value) => { if (Number.isFinite(value)) { const v = Math.max(0, Math.min(100, Math.round(value))); if (v > 0 && (out[key] ?? 0) < v) out[key] = v; } };
|
|
119
|
+
for (const raw of text.split("\n")) {
|
|
120
|
+
if (!raw.includes(day)) continue;
|
|
121
|
+
let record; try { record = JSON.parse(raw); } catch { continue; }
|
|
122
|
+
if (String(record?.timestamp ?? "").slice(0, 10) !== day) continue;
|
|
123
|
+
const p = record?.payload && typeof record.payload === "object" ? record.payload : {};
|
|
124
|
+
if (record.type === "turn_context") {
|
|
125
|
+
if (typeof p.effort === "string" && EFFORT_LEVELS.has(p.effort)) out[`effort_${p.effort}`] = Math.min(100000, (out[`effort_${p.effort}`] ?? 0) + 1);
|
|
126
|
+
if (typeof p.model === "string" && p.model) models.add(p.model);
|
|
127
|
+
} else if (record.type === "event_msg" && p.type === "token_count") {
|
|
128
|
+
const window = p.info?.model_context_window, input = p.info?.last_token_usage?.input_tokens;
|
|
129
|
+
if (Number.isFinite(window) && window > 0 && Number.isFinite(input)) peak("context_peak_pct", (input / window) * 100);
|
|
130
|
+
for (const limit of [p.rate_limits?.primary, p.rate_limits?.secondary]) peak("limit_peak_pct", limit?.used_percent);
|
|
131
|
+
}
|
|
132
|
+
}
|
|
133
|
+
if (models.size > 0) out.models = models.size;
|
|
134
|
+
return Object.keys(out).length > 0 ? out : null;
|
|
135
|
+
}
|
|
136
|
+
|
|
105
137
|
export function* codexRolloutFiles(root) {
|
|
106
138
|
let entries = []; try { entries = readdirSync(root, { withFileTypes: true }); } catch { return; }
|
|
107
139
|
for (const entry of entries.sort((a, b) => a.name.localeCompare(b.name))) {
|
package/worktrust.mjs
CHANGED
|
@@ -83,7 +83,7 @@ const command = args.includes("--help") ? "help" : args.includes("--version") ?
|
|
|
83
83
|
const flag = (name) => { const at = args.indexOf(`--${name}`); return at >= 0 ? args[at + 1] : undefined; };
|
|
84
84
|
const has = (name) => args.includes(`--${name}`);
|
|
85
85
|
/** This CLI's version, said to the door so the app can tell which computer runs an old one (check-cli-package holds it equal to package.json). */
|
|
86
|
-
const CLI_VERSION = "0.10.
|
|
86
|
+
const CLI_VERSION = "0.10.16";
|
|
87
87
|
const ORIGIN = (flag("origin") ?? process.env.WORKTRUST_ORIGIN ?? "https://app.worktrust.io").replace(/\/$/, "");
|
|
88
88
|
const MCP = flag("url") ?? process.env.WORKTRUST_MCP_URL ?? `${ORIGIN}/api/mcp`;
|
|
89
89
|
const HOME_DIR = join(homedir(), ".worktrust");
|