worktrust 0.10.13 → 0.10.15
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/AGENTS.md +5 -0
- package/README.md +25 -3
- package/SECURITY.md +41 -0
- package/claude-mod.mjs +230 -0
- package/log-session.mjs +8 -5
- package/orchestration-contract.mjs +155 -0
- package/orchestration-evidence.mjs +59 -0
- package/orchestration-report.mjs +28 -0
- package/package.json +6 -2
- package/worktrust.mjs +57 -5
package/AGENTS.md
CHANGED
|
@@ -16,6 +16,11 @@ the variables your client sets, do not run it through another shell, and do not
|
|
|
16
16
|
The session hook and the MCP door are started by your client itself and are meant to run; leave their configuration as
|
|
17
17
|
the person set it. This does not authorize an agent to invoke `preserve` through another entry point. Even `status`
|
|
18
18
|
can inspect local evidence and check the registry; do not run it as a generic repository inventory command.
|
|
19
|
+
The new `orchestration report --file` command reads a person's explicitly selected agent metadata
|
|
20
|
+
and is person-only too. Repository maintenance tests may use synthetic recordings. Python SDK
|
|
21
|
+
events remain application reports: do not manufacture security events, verification or success,
|
|
22
|
+
and do not describe them as independently measured capability. See `docs/AGENT-OBSERVATIONS.md`
|
|
23
|
+
in the monorepo for the contract and the private Sources page.
|
|
19
24
|
|
|
20
25
|
## Do not report work you did not see
|
|
21
26
|
|
package/README.md
CHANGED
|
@@ -17,10 +17,19 @@ curl -fsSO https://app.worktrust.io/counter/worktrust.mjs && node worktrust.mjs
|
|
|
17
17
|
```
|
|
18
18
|
|
|
19
19
|
**Python tool runners:** this repository also builds `worktrust` for `uvx` and `pipx` from the
|
|
20
|
-
same measurement modules.
|
|
20
|
+
same measurement modules. Native wheels (0.10.13+) include a pinned official Node runtime,
|
|
21
21
|
so that route needs no separate Node/npm installation. See the
|
|
22
22
|
[Python distribution](https://github.com/fhomey/worktrust-cli/tree/main/python) for supported
|
|
23
|
-
platforms
|
|
23
|
+
platforms and installation commands, and the official [PyPI project](https://pypi.org/project/worktrust/)
|
|
24
|
+
for published versions. npm and Python versions are checked together.
|
|
25
|
+
|
|
26
|
+
```sh
|
|
27
|
+
uvx worktrust@latest preserve
|
|
28
|
+
pipx run --no-cache worktrust preserve
|
|
29
|
+
```
|
|
30
|
+
|
|
31
|
+
Omit `preserve` to connect your computer. These runners install and invoke the same CLI;
|
|
32
|
+
they do not automatically instrument Python applications or measure different activity.
|
|
24
33
|
|
|
25
34
|
Connecting through the Python package installs the runtime and engine in an immutable directory
|
|
26
35
|
under `~/.worktrust/installations/`; client hooks use that persistent path, so clearing a tool-runner
|
|
@@ -28,6 +37,18 @@ cache does not break the coupling. Updates retain older installations for runnin
|
|
|
28
37
|
Run `worktrust disconnect` before removing an installed Python tool if you also want to remove its
|
|
29
38
|
WorkTrust coupling. Disconnect removes the key and client wiring; it leaves runtime files in place.
|
|
30
39
|
|
|
40
|
+
**Agent observations (requires 0.10.14+):** the optional Python
|
|
41
|
+
`worktrust_cli.telemetry` SDK lets an application explicitly record parent/child runs, its own
|
|
42
|
+
token counters, token budgets, checks and security events in a local file. The shared engine
|
|
43
|
+
inspects it with `worktrust orchestration report --file agent-events.jsonl`, without uploading.
|
|
44
|
+
The private platform import is Sources → Agent teams when that platform change is deployed.
|
|
45
|
+
These are application reports, not human hours or independently verified outcomes. Installing
|
|
46
|
+
through npm, uvx or pipx alone does not instrument agents. See the Python README for the opt-in
|
|
47
|
+
SDK, fixed metadata fields, consent and local deletion. Install `worktrust>=0.10.14` in the
|
|
48
|
+
agent application's own Python environment to import the SDK; a uvx/pipx tool environment
|
|
49
|
+
is separate. Check the registry for availability: a GitHub release awaiting approval is not
|
|
50
|
+
a completed npm or PyPI publication.
|
|
51
|
+
|
|
31
52
|
**No account? Keep your history anyway.** Claude Code and Gemini CLI delete their sessions after 30
|
|
32
53
|
days by default, and a deleted session can never be measured again. `npx worktrust@latest preserve` shows what
|
|
33
54
|
each AI app on this computer keeps, keeps it longer on your yes, and writes a local, metadata-only
|
|
@@ -205,6 +226,7 @@ nothing it does not:
|
|
|
205
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) |
|
|
206
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) |
|
|
207
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 |
|
|
208
230
|
| `collector_version` | the CLI version that measured it |
|
|
209
231
|
| `seq`, `prev`, `hash` | the line's place, the hash of the line before it, and its own hash |
|
|
210
232
|
|
|
@@ -351,7 +373,7 @@ which would delete every password on the computer, and many people rightly keep
|
|
|
351
373
|
| **Reads** | Which AI apps are installed (the settings folders of Claude Code, Codex, Cursor, Gemini CLI, Antigravity, VS Code, Windsurf, Hermes Agent, Goose, OpenCode, OpenClaw), and the chats Cursor and Copilot keep (clocks, models and token counts only). Afterwards, the session hook reads Claude Code's, Codex's and Antigravity's session files, the session databases of Hermes, Goose, OpenCode and OpenClaw, and the chats Cursor and Copilot keep, on this computer to measure durations and token counts. |
|
|
352
374
|
| **Writes** | The key file (above). In each AI app's MCP settings (`~/.claude.json` through `claude mcp`, `~/.cursor/mcp.json`, `~/.codex/config.toml`, `~/.gemini/settings.json`, `~/.gemini/config/mcp_config.json` (Antigravity), VS Code's `mcp.json`, Windsurf's `mcp_config.json`, Hermes's and Goose's `config.yaml`, OpenCode's `opencode.json`, OpenClaw through `openclaw mcp set`) a WorkTrust entry that runs the local bridge, with no key in it; three hooks in `~/.claude/settings.json`; the bridge, the hook and the counter in `~/.worktrust/`. |
|
|
353
375
|
| **Sends, to pair** | This computer's system (macOS, Windows, Linux) and host name. WorkTrust also records the network address the request arrives from, as a security record kept 90 days and seen only by WorkTrust staff (to answer a theft or fraud report). |
|
|
354
|
-
| **Sends, afterwards** | Per measured stretch of work, and nothing else: its durations (`seconds`, `duration_basis`, `model_seconds`, `tool_seconds`, `human_seconds`, `idle_seconds`), token counts (`tokens_in`, `tokens_out`, `tokens_cache_read`, `tokens_cache_write`, `token_basis`), the model's name (`model`), the kind of work and one layer keyword such as frontend or backend (`title`, `kind`, `layer`, `layers`), closed technology keys (`stack`) and separate display-only tool keys (`tools_seen`), counts of how you work (`exchanges`, `turn_basis`, `agent_runs`, `agent_seconds`, `agent_peak`, `interrupts`, `steers`), when it began and ended and your computer's offset from UTC (`started_at`, `at`, `utc_offset`), what the CLI derived from the stretch as kinds and counts (`evidence`: checks run and failed, delivery steps and whether a check passed first, recoveries, delegation, context, routing, steering, refusals, planning, files and test files changed, the complexity class; never a word, a command or a path; since 0.8.3), a hash of the session and the day (`stretch_ref`), `steered_from` when it ran over SSH, and, so the work can be matched to GitHub, the repository as its remote's owner/name (`repo`, only for a repository on GitHub, GitLab or Bitbucket, the hosts WorkTrust can couple; never one on your own or a client's server) and the hashes of the commits made in the stretch (`commits`, never their messages). |
|
|
376
|
+
| **Sends, afterwards** | Per measured stretch of work, and nothing else: its durations (`seconds`, `duration_basis`, `model_seconds`, `tool_seconds`, `human_seconds`, `idle_seconds`), token counts (`tokens_in`, `tokens_out`, `tokens_cache_read`, `tokens_cache_write`, `token_basis`), the model's name (`model`), the kind of work and one layer keyword such as frontend or backend (`title`, `kind`, `layer`, `layers`), closed technology keys (`stack`) and separate display-only tool keys (`tools_seen`), counts of how you work (`exchanges`, `turn_basis`, `agent_runs`, `agent_seconds`, `agent_peak`, `interrupts`, `steers`), when it began and ended and your computer's offset from UTC (`started_at`, `at`, `utc_offset`), what the CLI derived from the stretch as kinds and counts (`evidence`: checks run and failed, delivery steps and whether a check passed first, recoveries, delegation, context, routing, steering, refusals, planning, files and test files changed, the complexity class; with the WorkTrust mod on, its `live` counts from inside Claude Code: permission answers, effort levels, context and plan-limit peaks, subagents and setup; never a word, a command or a path; since 0.8.3, `live` since 0.10.15), a hash of the session and the day (`stretch_ref`), `steered_from` when it ran over SSH, and, so the work can be matched to GitHub, the repository as its remote's owner/name (`repo`, only for a repository on GitHub, GitLab or Bitbucket, the hosts WorkTrust can couple; never one on your own or a client's server) and the hashes of the commits made in the stretch (`commits`, never their messages). |
|
|
355
377
|
| **Never sends** | Prompts, answers, code, file names or paths, commit messages, branch names, or the name of your local folder (a repository is named only as its remote's owner/name, above). The door has no field for them and refuses a submission that carries them. |
|
|
356
378
|
|
|
357
379
|
## Why you can check it
|
package/SECURITY.md
CHANGED
|
@@ -71,3 +71,44 @@ Check the particular published version's attestation and compare its contents to
|
|
|
71
71
|
relying on those properties. A manifest flag or matching version string alone is not proof that an
|
|
72
72
|
artifact was built from reviewed source. `npm audit signatures` can inspect an installed dependency
|
|
73
73
|
tree; verification coverage and failures must be reported for that actual installation.
|
|
74
|
+
|
|
75
|
+
|
|
76
|
+
## The WorkTrust mod for Claude Code (0.10.15, opt-in)
|
|
77
|
+
|
|
78
|
+
`worktrust mod install` asks, then writes a Claude Code plugin to `~/.worktrust/claude-mod` and names
|
|
79
|
+
that directory in `~/.claude/settings.json` (`env.CLAUDE_CODE_PLUGIN_DIRS`, the file backed up beside
|
|
80
|
+
itself first). Claude Code 2.1.287 or later loads it in every session. It runs inside Claude Code
|
|
81
|
+
with your permissions, as every mod does, and Claude Code's own validator lists what it may do:
|
|
82
|
+
twelve events it observes, and three calls: `fs.write` (its one counts file per session under
|
|
83
|
+
`~/.worktrust/claude-mod-counts`), `session.id` and `tool.list`. It makes no network request, starts
|
|
84
|
+
no process, calls no model, rewrites no prompt or tool call (each hook hands back exactly what Claude
|
|
85
|
+
Code gave it) and keeps no text: only integer counts in a closed list (`claude-mod.mjs`,
|
|
86
|
+
`MOD_FIELDS`). The session hook sends those counts with the session's stretch as `evidence.live`;
|
|
87
|
+
the platform keeps only the listed keys, from a CLI key alone, and shows them to you alone.
|
|
88
|
+
`worktrust mod remove` and `worktrust disconnect` take it out of the settings and delete the plugin
|
|
89
|
+
and its counts.
|
|
90
|
+
|
|
91
|
+
## Python distribution and explicit agent observations
|
|
92
|
+
|
|
93
|
+
The official [PyPI package](https://pypi.org/project/worktrust/) runs the same measurement
|
|
94
|
+
modules as npm. Supported wheels include the pinned Node runtime; invocation does not download
|
|
95
|
+
Node, fall back to PATH or relay to a newer npm version. Package-manager installation and
|
|
96
|
+
upgrades can contact registries. Use the README for platform requirements and update commands.
|
|
97
|
+
|
|
98
|
+
From 0.10.14, the optional Python recorder writes explicitly supplied UUIDs, dates, fixed event
|
|
99
|
+
categories and counts to a newly chosen local file, with `consent=True`. It makes no network
|
|
100
|
+
requests and does not discover agents or inspect their prompts, outputs, model names or code.
|
|
101
|
+
The local `orchestration report --file` command also sends nothing. Recordings are bounded;
|
|
102
|
+
existing files and symlink paths are refused. The requested file mode is 0600; Windows folder
|
|
103
|
+
ACLs and other processes running as the same user remain outside that protection.
|
|
104
|
+
|
|
105
|
+
These observations are application reports, including reported checks and security events.
|
|
106
|
+
They do not independently establish successful outcomes, prompt-injection resistance, human
|
|
107
|
+
hours or capability. Parent/child elapsed time includes waiting and must not be summed as
|
|
108
|
+
human work. Missing token coverage remains unknown; providers must supply exclusive deltas.
|
|
109
|
+
|
|
110
|
+
The separate private platform import requires a deployed platform feature and explicit browser
|
|
111
|
+
selection and consent. It is not an automatic SDK upload or an MCP submission. Deleting a local
|
|
112
|
+
recording does not erase a separately imported copy; delete that copy through the private app.
|
|
113
|
+
See the service [privacy policy](https://worktrust.io/privacy) and
|
|
114
|
+
[support](https://worktrust.io/support) for account data requests.
|
package/claude-mod.mjs
ADDED
|
@@ -0,0 +1,230 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* THE WORKTRUST MOD FOR CLAUDE CODE (owner, 2026-10-16: "implement mods so we can collect additional data relevant to
|
|
3
|
+
* human-AI capability"). Claude Code 2.1.287 runs mods: plugins whose functions run INSIDE Claude Code on its events
|
|
4
|
+
* (docs/CLAUDE-CODE-MOD.md). This file is the whole of ours, and how the CLI puts it in place and reads it back.
|
|
5
|
+
*
|
|
6
|
+
* WHAT IT ADDS, ONLY WHAT A TRANSCRIPT CANNOT SHOW (owner: "what fits and adds value, without noise"):
|
|
7
|
+
* oversight a permission question put to the PERSON, and whether they said yes or no (a transcript shows a refusal,
|
|
8
|
+
* never an approval after a question); not counted where a classifier or a mode answers instead
|
|
9
|
+
* effort each model request by its effort level, how many models answered, requests on another model than
|
|
10
|
+
* the main conversation's (routing)
|
|
11
|
+
* context the peak context fill and the peak plan-limit use, as percentages; compactions asked for or automatic
|
|
12
|
+
* delegation subagents started (built-in, the person's own, in the background, forks), teammates; and the setup in
|
|
13
|
+
* force: other mods, MCP servers and the person's own agent types, as counts
|
|
14
|
+
*
|
|
15
|
+
* WHAT IT NEVER DOES: it reads no text it keeps (a prompt, an answer, a command, a path, a name), it makes no network
|
|
16
|
+
* call, it changes no event (every hook returns what `next` gave it), and it writes one file per session of integer
|
|
17
|
+
* counts under ~/.worktrust/claude-mod-counts. The CLI reads that file when it reports the session's stretch and sends
|
|
18
|
+
* the counts, as the `live` evidence group, through the same signed door as everything else; the door keeps only the
|
|
19
|
+
* keys of `MOD_FIELDS` (packages/core/src/stretch-evidence.ts holds the same list, check-cli-package holds them equal).
|
|
20
|
+
* The figures reach the person's own mirror and nothing that scores: no dimension, no level, no passport, until they
|
|
21
|
+
* are validated (CLAUDE.md rules 6 and 11; the owner's choice, 2026-10-16).
|
|
22
|
+
*/
|
|
23
|
+
import { existsSync, mkdirSync, readFileSync, renameSync, rmSync, writeFileSync } from "node:fs";
|
|
24
|
+
import { homedir } from "node:os";
|
|
25
|
+
import { join } from "node:path";
|
|
26
|
+
|
|
27
|
+
export const MOD_NAME = "worktrust-measure";
|
|
28
|
+
export const MOD_VERSION = "1.0.0";
|
|
29
|
+
/** The first Claude Code whose terminal runs installed mods (the Desktop app from 2.1.286). */
|
|
30
|
+
export const MIN_CLAUDE_CODE = "2.1.287";
|
|
31
|
+
|
|
32
|
+
/** The closed list of what the mod counts: integers per UTC day; the two `_pct` fields are peaks from 0 to 100. */
|
|
33
|
+
export const MOD_FIELDS = [
|
|
34
|
+
"asked", "approved", "declined",
|
|
35
|
+
"effort_low", "effort_medium", "effort_high", "effort_xhigh", "effort_max", "models", "routed",
|
|
36
|
+
"context_peak_pct", "limit_peak_pct", "compact_manual", "compact_auto",
|
|
37
|
+
"spawned_builtin", "spawned_custom", "spawned_background", "forks", "teammates",
|
|
38
|
+
"mods", "mcp_servers", "custom_agents",
|
|
39
|
+
];
|
|
40
|
+
export const PEAK_FIELDS = ["context_peak_pct", "limit_peak_pct"];
|
|
41
|
+
|
|
42
|
+
/**
|
|
43
|
+
* The mod itself: a hooks module as Claude Code loads it (`register(on)`), written out by `installMod`. Plain
|
|
44
|
+
* JavaScript, no import, so the file Claude Code runs is the text below and nothing else; `claude plugin validate`
|
|
45
|
+
* lists what it uses: the events below, `fs.write`, `session.id` and `tool.list`.
|
|
46
|
+
*/
|
|
47
|
+
export const REGISTER_SOURCE = `// WorkTrust measure ${MOD_VERSION}: counts what a transcript cannot show, never a word of the session.
|
|
48
|
+
// Every hook returns what next() gave it: this mod observes and changes nothing. Written by the WorkTrust CLI.
|
|
49
|
+
const FIELDS = ${JSON.stringify(MOD_FIELDS)};
|
|
50
|
+
const PEAKS = new Set(${JSON.stringify(PEAK_FIELDS)});
|
|
51
|
+
const NOBODY_ASKED = new Set(["auto", "dontAsk", "bypassPermissions"]);
|
|
52
|
+
const EFFORTS = new Set(["low", "medium", "high", "xhigh", "max"]);
|
|
53
|
+
const days = {};
|
|
54
|
+
let file = null, session = null, mode = "default", main = null, dirty = false, written = 0;
|
|
55
|
+
const seen = { models: new Set(), servers: new Set(), agents: new Set(), mods: new Set() };
|
|
56
|
+
const asked = new Set();
|
|
57
|
+
const day = () => new Date().toISOString().slice(0, 10);
|
|
58
|
+
const row = () => (days[day()] ??= {});
|
|
59
|
+
const bump = (key) => { const r = row(); r[key] = Math.min(100000, (r[key] ?? 0) + 1); dirty = true; };
|
|
60
|
+
const set = (key, value) => { const r = row(); const v = Math.max(0, Math.min(PEAKS.has(key) ? 100 : 100000, Math.round(value))); if ((r[key] ?? -1) < v) { r[key] = v; dirty = true; } };
|
|
61
|
+
// The file's text when it is due (at most every five seconds, or now at the session's end); null when nothing changed.
|
|
62
|
+
function due(now) {
|
|
63
|
+
if (!file || !dirty || (!now && Date.now() - written < 5000)) return null;
|
|
64
|
+
dirty = false; written = Date.now();
|
|
65
|
+
const clean = {};
|
|
66
|
+
for (const [d, r] of Object.entries(days)) clean[d] = Object.fromEntries(FIELDS.filter((k) => Number.isInteger(r[k]) && r[k] > 0).map((k) => [k, r[k]]));
|
|
67
|
+
return JSON.stringify({ v: 1, mod: "${MOD_NAME}@${MOD_VERSION}", session, days: clean });
|
|
68
|
+
}
|
|
69
|
+
const MCP = /^mcp__(.+?)__/;
|
|
70
|
+
|
|
71
|
+
export function register(on) {
|
|
72
|
+
on("session.start", async ($, e, next) => {
|
|
73
|
+
try {
|
|
74
|
+
session = String(await $.session.id()).replace(/[^A-Za-z0-9_-]/g, "").slice(0, 80) || null;
|
|
75
|
+
const root = String($.plugin.root).replace(/[\\/]+$/, "");
|
|
76
|
+
if (session) file = root.replace(/[\\/][^\\/]+$/, "") + "/claude-mod-counts/" + session + ".json";
|
|
77
|
+
for (const tool of await $.tool.list()) { const m = MCP.exec(String(tool.name ?? "")); if (m) seen.servers.add(m[1]); }
|
|
78
|
+
set("mcp_servers", seen.servers.size);
|
|
79
|
+
set("mods", seen.mods.size);
|
|
80
|
+
set("custom_agents", seen.agents.size);
|
|
81
|
+
} catch {}
|
|
82
|
+
return next(e);
|
|
83
|
+
});
|
|
84
|
+
// The other mods the person runs, by count: a fact of their setup, never a name kept.
|
|
85
|
+
on("plugin.register", async ($, e, next) => {
|
|
86
|
+
try { if (e.tier === "user" && e.name !== "${MOD_NAME}") { seen.mods.add(e.name); set("mods", seen.mods.size); } } catch {}
|
|
87
|
+
return next(e);
|
|
88
|
+
});
|
|
89
|
+
// Their own agent types, offered beside the built-in ones.
|
|
90
|
+
on("agent.offer", async ($, e, next) => {
|
|
91
|
+
try { if (e.provider?.tier !== "core") { seen.agents.add(e.agent); set("custom_agents", seen.agents.size); } } catch {}
|
|
92
|
+
return next(e);
|
|
93
|
+
});
|
|
94
|
+
// Who answers a permission question: the person, unless a mode or a classifier does.
|
|
95
|
+
on("classic.UserPromptSubmit", async ($, e, next) => {
|
|
96
|
+
try { if (typeof e.permission_mode === "string") mode = e.permission_mode; } catch {}
|
|
97
|
+
return next(e);
|
|
98
|
+
});
|
|
99
|
+
on("tool.check", async ($, e, next) => {
|
|
100
|
+
const verdict = await next(e);
|
|
101
|
+
try { if (verdict?.decision === "ask" && !verdict.decider && !NOBODY_ASKED.has(mode) && e.tool_use_id) { asked.add(e.tool_use_id); bump("asked"); } } catch {}
|
|
102
|
+
return verdict;
|
|
103
|
+
});
|
|
104
|
+
on("tool.call", async ($, e, next) => {
|
|
105
|
+
const result = await next(e);
|
|
106
|
+
try { if (e.tool_use_id && asked.delete(e.tool_use_id)) bump(result && "deny" in result && typeof result.deny === "string" ? "declined" : "approved"); } catch {}
|
|
107
|
+
return result;
|
|
108
|
+
});
|
|
109
|
+
on("turn.step", async function* ($, e, next) {
|
|
110
|
+
try {
|
|
111
|
+
if (!e.agentId) main = e.model;
|
|
112
|
+
if (typeof e.effort === "string" && EFFORTS.has(e.effort)) bump("effort_" + e.effort);
|
|
113
|
+
if (e.model) { seen.models.add(e.model); set("models", seen.models.size); }
|
|
114
|
+
if (e.agentId && main && e.model && e.model !== main) bump("routed");
|
|
115
|
+
} catch {}
|
|
116
|
+
return yield* next(e);
|
|
117
|
+
});
|
|
118
|
+
on("agent.spawn", async ($, e, next) => {
|
|
119
|
+
try {
|
|
120
|
+
if (e.isTeammate) bump("teammates");
|
|
121
|
+
else if (e.fork) bump("forks");
|
|
122
|
+
else bump(e.provider?.tier === "core" ? "spawned_builtin" : "spawned_custom");
|
|
123
|
+
if (e.background) bump("spawned_background");
|
|
124
|
+
} catch {}
|
|
125
|
+
return next(e);
|
|
126
|
+
});
|
|
127
|
+
on("session.compact", async ($, e, next) => {
|
|
128
|
+
try { bump(e.trigger === "manual" ? "compact_manual" : "compact_auto"); } catch {}
|
|
129
|
+
return next(e);
|
|
130
|
+
});
|
|
131
|
+
on("session.measure", async ($, e, next) => {
|
|
132
|
+
try {
|
|
133
|
+
if (Number.isFinite(e.context?.percent)) set("context_peak_pct", e.context.percent);
|
|
134
|
+
for (const limit of e.rateLimits ?? []) if (Number.isFinite(limit?.percentUsed)) set("limit_peak_pct", limit.percentUsed);
|
|
135
|
+
} catch {}
|
|
136
|
+
return next(e);
|
|
137
|
+
});
|
|
138
|
+
on("turn.complete", async ($, e, next) => {
|
|
139
|
+
try { const text = due(false); if (text) await $.fs.write(file, text); } catch {}
|
|
140
|
+
return next(e);
|
|
141
|
+
});
|
|
142
|
+
on("session.end", async ($, e, next) => {
|
|
143
|
+
try { const text = due(true); if (text) await $.fs.write(file, text); } catch {}
|
|
144
|
+
return next(e);
|
|
145
|
+
});
|
|
146
|
+
}
|
|
147
|
+
`;
|
|
148
|
+
|
|
149
|
+
export const PLUGIN_JSON = { name: MOD_NAME, version: MOD_VERSION, description: "WorkTrust: counts how you work with Claude Code (permission answers, effort levels, context peaks, subagents), never a word of the session. Counts stay on this computer until the WorkTrust CLI reports a session.", author: { name: "WorkTrust", url: "https://worktrust.io" }, homepage: "https://worktrust.io", license: "MIT" };
|
|
150
|
+
export const HOOKS_JSON = { modules: ["./register.js"] };
|
|
151
|
+
|
|
152
|
+
const dirs = (home) => ({ plugin: join(home, ".worktrust", "claude-mod"), counts: join(home, ".worktrust", "claude-mod-counts"), settings: join(home, ".claude", "settings.json") });
|
|
153
|
+
const SEP = process.platform === "win32" ? ";" : ":";
|
|
154
|
+
const readSettings = (file) => (existsSync(file) ? JSON.parse(readFileSync(file, "utf8")) : {});
|
|
155
|
+
function writeSettings(file, settings) {
|
|
156
|
+
mkdirSync(join(file, ".."), { recursive: true });
|
|
157
|
+
if (existsSync(file)) writeFileSync(`${file}.worktrust-backup`, readFileSync(file));
|
|
158
|
+
writeFileSync(`${file}.worktrust-tmp`, JSON.stringify(settings, null, 2));
|
|
159
|
+
renameSync(`${file}.worktrust-tmp`, file);
|
|
160
|
+
}
|
|
161
|
+
|
|
162
|
+
/**
|
|
163
|
+
* Writes the mod to ~/.worktrust/claude-mod and names that directory in Claude Code's own settings
|
|
164
|
+
* (`env.CLAUDE_CODE_PLUGIN_DIRS`, the documented way to load a plugin directory in every session), keeping any
|
|
165
|
+
* directory already named there. The settings file is backed up beside itself first. Idempotent: a second run
|
|
166
|
+
* rewrites the files and changes no setting.
|
|
167
|
+
*/
|
|
168
|
+
export function installMod(home = homedir()) {
|
|
169
|
+
const at = dirs(home);
|
|
170
|
+
mkdirSync(join(at.plugin, ".claude-plugin"), { recursive: true });
|
|
171
|
+
mkdirSync(join(at.plugin, "hooks"), { recursive: true });
|
|
172
|
+
mkdirSync(at.counts, { recursive: true });
|
|
173
|
+
writeFileSync(join(at.plugin, ".claude-plugin", "plugin.json"), JSON.stringify(PLUGIN_JSON, null, 2) + "\n");
|
|
174
|
+
writeFileSync(join(at.plugin, "hooks", "hooks.json"), JSON.stringify(HOOKS_JSON, null, 2) + "\n");
|
|
175
|
+
writeFileSync(join(at.plugin, "hooks", "register.js"), REGISTER_SOURCE);
|
|
176
|
+
const settings = readSettings(at.settings);
|
|
177
|
+
const named = String(settings.env?.CLAUDE_CODE_PLUGIN_DIRS ?? "").split(SEP).filter(Boolean);
|
|
178
|
+
if (named.includes(at.plugin)) return { dir: at.plugin, settingsChanged: false };
|
|
179
|
+
settings.env = { ...(settings.env ?? {}), CLAUDE_CODE_PLUGIN_DIRS: [...named, at.plugin].join(SEP) };
|
|
180
|
+
writeSettings(at.settings, settings);
|
|
181
|
+
return { dir: at.plugin, settingsChanged: true };
|
|
182
|
+
}
|
|
183
|
+
|
|
184
|
+
/** Takes the mod out of Claude Code's settings and deletes it and the counts it kept. Other named directories stay. */
|
|
185
|
+
export function uninstallMod(home = homedir()) {
|
|
186
|
+
const at = dirs(home);
|
|
187
|
+
const settings = readSettings(at.settings);
|
|
188
|
+
const named = String(settings.env?.CLAUDE_CODE_PLUGIN_DIRS ?? "").split(SEP).filter(Boolean);
|
|
189
|
+
let settingsChanged = false;
|
|
190
|
+
if (named.includes(at.plugin)) {
|
|
191
|
+
const rest = named.filter((one) => one !== at.plugin);
|
|
192
|
+
const env = { ...settings.env };
|
|
193
|
+
if (rest.length) env.CLAUDE_CODE_PLUGIN_DIRS = rest.join(SEP); else delete env.CLAUDE_CODE_PLUGIN_DIRS;
|
|
194
|
+
if (Object.keys(env).length) settings.env = env; else delete settings.env;
|
|
195
|
+
writeSettings(at.settings, settings);
|
|
196
|
+
settingsChanged = true;
|
|
197
|
+
}
|
|
198
|
+
rmSync(at.plugin, { recursive: true, force: true });
|
|
199
|
+
rmSync(at.counts, { recursive: true, force: true });
|
|
200
|
+
return { settingsChanged };
|
|
201
|
+
}
|
|
202
|
+
|
|
203
|
+
/** Whether the mod is in place: its file written and its directory named in Claude Code's settings. */
|
|
204
|
+
export function modInstalled(home = homedir()) {
|
|
205
|
+
const at = dirs(home);
|
|
206
|
+
if (!existsSync(join(at.plugin, "hooks", "register.js"))) return false;
|
|
207
|
+
try { return String(readSettings(at.settings).env?.CLAUDE_CODE_PLUGIN_DIRS ?? "").split(SEP).includes(at.plugin); } catch { return false; }
|
|
208
|
+
}
|
|
209
|
+
|
|
210
|
+
/**
|
|
211
|
+
* The counts the mod kept for one Claude Code session on one UTC day, as the `live` evidence group: only the keys of
|
|
212
|
+
* `MOD_FIELDS`, only positive integers (the peaks at most 100, the rest at most 100,000). Null when the mod kept
|
|
213
|
+
* nothing for that session and day, so a stretch without the mod carries no group at all, never zeros.
|
|
214
|
+
*/
|
|
215
|
+
export function modCounts(sessionId, day, home = homedir()) {
|
|
216
|
+
if (!/^[A-Za-z0-9_-]{1,80}$/.test(String(sessionId ?? "")) || !/^\d{4}-\d{2}-\d{2}$/.test(String(day ?? ""))) return null;
|
|
217
|
+
const file = join(dirs(home).counts, `${sessionId}.json`);
|
|
218
|
+
if (!existsSync(file)) return null;
|
|
219
|
+
let kept;
|
|
220
|
+
try { kept = JSON.parse(readFileSync(file, "utf8")); } catch { return null; }
|
|
221
|
+
const row = kept?.days?.[day];
|
|
222
|
+
if (!row || typeof row !== "object") return null;
|
|
223
|
+
const out = {};
|
|
224
|
+
for (const key of MOD_FIELDS) {
|
|
225
|
+
const value = row[key];
|
|
226
|
+
if (!Number.isInteger(value) || value <= 0) continue;
|
|
227
|
+
out[key] = Math.min(PEAK_FIELDS.includes(key) ? 100 : 100000, value);
|
|
228
|
+
}
|
|
229
|
+
return Object.keys(out).length ? out : null;
|
|
230
|
+
}
|
package/log-session.mjs
CHANGED
|
@@ -271,11 +271,13 @@ const { DATABASE_SESSION = /(?!)/, databaseLines = () => null, databaseSessions
|
|
|
271
271
|
// A WEB CHAT'S DATA EXPORT AS HISTORY (0.10.10, owner 2026-10-10): chat-exports.mjs reads a ChatGPT or Claude export (the counter
|
|
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
|
+
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);
|
|
274
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
|
|
275
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]);
|
|
276
278
|
const DATABASE_CLIENTS = ["hermes", "goose", "opencode", "openclaw", "cursor", "copilot"]; // the registry's keys, the name each line carries
|
|
277
279
|
const LIVE_SOURCE = new RegExp(`^(codex|antigravity|${DATABASE_CLIENTS.join("|")}):`); // a sweep entry's id → the client it names (every database client, 0.6.16)
|
|
278
|
-
const READER_FILES = ["transcript-readers.mjs", "session-databases.mjs", "stretch-evidence.mjs", "chat-exports.mjs", "stack-rules.mjs"]; // 0.7.4: the derived record travels with the hook; 0.10.10: the export reader; 0.10.11: the stack rules
|
|
280
|
+
const READER_FILES = ["transcript-readers.mjs", "session-databases.mjs", "stretch-evidence.mjs", "chat-exports.mjs", "stack-rules.mjs", "claude-mod.mjs"]; // 0.7.4: the derived record travels with the hook; 0.10.10: the export reader; 0.10.11: the stack rules; 0.10.15: the mod
|
|
279
281
|
/** The readers go where the hook and the counter run: copied from beside this file, else (or for a newer counter) from the deployment. */
|
|
280
282
|
async function installReaders(origin, fromNetwork = false) {
|
|
281
283
|
let installed = true;
|
|
@@ -415,7 +417,7 @@ function stretchesOf(file, since) {
|
|
|
415
417
|
messages.sort((a, b) => a.at - b.at);
|
|
416
418
|
const byDay = byDayOf(messages);
|
|
417
419
|
const agents = agentsByDay(file, since);
|
|
418
|
-
return [...byDay.entries()].sort(([a], [b]) => a.localeCompare(b)).map(([day, ofDay]) => { const stretch = measure(cwd, ofDay); return stretch && { ...stretch, ref: stretchRef(file, day), steered, agents: agents.get(day) ?? null }; }).filter(Boolean);
|
|
420
|
+
return [...byDay.entries()].sort(([a], [b]) => a.localeCompare(b)).map(([day, ofDay]) => { const stretch = measure(cwd, ofDay); return stretch && { ...stretch, ref: stretchRef(file, day), steered, agents: agents.get(day) ?? null, live: liveOf(file, day) }; }).filter(Boolean);
|
|
419
421
|
}
|
|
420
422
|
|
|
421
423
|
/**
|
|
@@ -666,6 +668,7 @@ function payloadFor(stretch) {
|
|
|
666
668
|
const coauthored = cwd && touched.shas.length > 0 ? git(cwd, "log", "--no-walk", "--format=%(trailers:key=Co-authored-by,valueonly,separator=%x01)%x00", ...touched.shas.slice(0, 50)).split("\0").filter((entry, index) => index < Math.min(50, touched.shas.length) && AI_COAUTHOR.test(entry)).length : 0;
|
|
667
669
|
const route = { ...(stretch.derived?.route ?? {}), ...(touched.committed ? gitRouteOf(cwd, touched.shas, changed) : {}) };
|
|
668
670
|
const derived = stretch.derived ? { ...stretch.derived, ...(Object.keys(route).length > 0 ? { route } : {}), ...(changed.length > 0 ? { changes: { files: changed.length, test_files: tests } } : {}), ...(touched.shas.length > 0 ? { authorship: { commits: Math.min(50, touched.shas.length), ai_coauthored: coauthored } } : {}), ...(contextFilesOf(changed) ? { context_files: contextFilesOf(changed) } : {}), ...(complexityOf ? { complexity: complexityOf(stretch.derived, { layers: Math.max(layers.length, layer ? 1 : 0), agentRuns: stretch.agents?.runs ?? 0, agentPeak: stretch.agents?.peak ?? 0, seconds: stretch.seconds }) } : {}) } : null;
|
|
671
|
+
const evidence = derived || stretch.live ? { ...(derived ?? {}), ...(stretch.live ? { live: stretch.live } : {}) } : null; // 0.10.15: the mod's counts ride as their own group
|
|
669
672
|
const payload = {
|
|
670
673
|
title: layer ? `AI-assisted work · ${layer}` : "AI-assisted work",
|
|
671
674
|
kind,
|
|
@@ -698,12 +701,12 @@ function payloadFor(stretch) {
|
|
|
698
701
|
...(stretch.steers > 0 ? { steers: Math.min(10000, stretch.steers) } : {}),
|
|
699
702
|
...(stretch.agents && stretch.agents.runs > 0 ? { agent_runs: Math.min(AGENT_RUNS_MAX, stretch.agents.runs), agent_seconds: Math.min(AGENT_SECONDS_MAX, stretch.agents.seconds), agent_peak: Math.min(AGENT_RUNS_MAX, stretch.agents.peak) } : {}),
|
|
700
703
|
// THE STRETCH'S EVIDENCE (0.8.3): what the CLI derived from it here, kinds and counts only (stretch-evidence.mjs); the door keeps it from a CLI key alone.
|
|
701
|
-
...(
|
|
704
|
+
...(evidence ? { evidence } : {}),
|
|
702
705
|
at: new Date(stretch.to).toISOString(),
|
|
703
706
|
};
|
|
704
707
|
// WHAT STAYS ON THIS COMPUTER (0.7.1): the stretch's derived record rides beside the payload for the local archive, never in it.
|
|
705
708
|
// The same record rides beside the payload for the local archive (preserve --archive).
|
|
706
|
-
if (
|
|
709
|
+
if (evidence) DERIVED.set(payload, evidence);
|
|
707
710
|
return payload;
|
|
708
711
|
}
|
|
709
712
|
|
|
@@ -845,7 +848,7 @@ function historyEntries(floor = null, all = false) {
|
|
|
845
848
|
// The live window belongs to the hook: a stretch that log_work may still report is not history.
|
|
846
849
|
if (!all && Date.now() - last < WINDOW_HOURS * 3600_000) continue;
|
|
847
850
|
// The same measure as a live day (seconds, layers, tokens, turns, model); history differs only in the door it goes through.
|
|
848
|
-
const entry = payloadFor({ ...measure(cwd, messages), ref: stretchRef(file, day), steered, agents: agents.get(day) ?? null });
|
|
851
|
+
const entry = payloadFor({ ...measure(cwd, messages), ref: stretchRef(file, day), steered, agents: agents.get(day) ?? null, live: liveOf(file, day) });
|
|
849
852
|
if (CODEX_ROLLOUT.test(file)) entrySource.set(entry, "codex");
|
|
850
853
|
if (ANTIGRAVITY_TRANSCRIPT.test(file)) entrySource.set(entry, "antigravity");
|
|
851
854
|
if (DATABASE_SESSION.test(file)) entrySource.set(entry, file.slice(0, file.indexOf(":")));
|
|
@@ -0,0 +1,155 @@
|
|
|
1
|
+
// GENERATED by scripts/build-orchestration-evidence.mjs; edit packages/core/src/orchestration-contract.ts.
|
|
2
|
+
/** Explicit application reports, never verified human work. No names, prompts or provider payloads. */
|
|
3
|
+
export const ORCHESTRATION_LIMITS = { bytes: 262144, lineBytes: 4096, events: 2048, runs: 64, elapsed: 604800000, tokens: 1000000000 };
|
|
4
|
+
export const AGENT_ROLES = ["orchestrator", "worker", "reviewer", "researcher", "verifier", "other"];
|
|
5
|
+
export const AGENT_TASK_KINDS = ["build", "fix", "review", "research", "decide", "other"];
|
|
6
|
+
export const SECURITY_EVENT_CODES = ["injection_candidate_seen", "injection_ignored", "injection_followed", "untrusted_instruction_escalated", "external_instruction_override_attempt", "suspicious_tool_blocked"];
|
|
7
|
+
export const INTERVENTION_CODES = ["challenge", "reframe", "alternative", "verification_request"];
|
|
8
|
+
export const USAGE_KEYS = ["input_uncached_tokens", "cache_read_tokens", "cache_write_tokens", "output_tokens"];
|
|
9
|
+
const uuid = (value) => typeof value === "string" && value.length === 36 && /^[0-9a-f]{8}-[0-9a-f]{4}-4[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$/.test(value);
|
|
10
|
+
const integer = (value, max, min = 0) => typeof value === "number" && Number.isInteger(value) && value >= min && value <= max;
|
|
11
|
+
const object = (value) => value !== null && typeof value === "object" && !Array.isArray(value) && Object.getPrototypeOf(value) === Object.prototype;
|
|
12
|
+
const fail = () => { throw new Error("invalid_orchestration_recording"); };
|
|
13
|
+
const exact = (row, required, optional = []) => {
|
|
14
|
+
if (required.some((key) => !Object.hasOwn(row, key)) || Object.keys(row).some((key) => !required.includes(key) && !optional.includes(key)))
|
|
15
|
+
fail();
|
|
16
|
+
};
|
|
17
|
+
const includes = (list, value) => typeof value === "string" && list.includes(value);
|
|
18
|
+
const bytes = (text) => new TextEncoder().encode(text).length;
|
|
19
|
+
/** Stable identity for duplicate comparison, also independent of JSON object key order. */
|
|
20
|
+
export function orchestrationCanonical(value) {
|
|
21
|
+
if (Array.isArray(value))
|
|
22
|
+
return `[${value.map(orchestrationCanonical).join(",")}]`;
|
|
23
|
+
if (object(value))
|
|
24
|
+
return `{${Object.keys(value).sort().map((key) => `${JSON.stringify(key)}:${orchestrationCanonical(value[key])}`).join(",")}}`;
|
|
25
|
+
return JSON.stringify(value) ?? fail();
|
|
26
|
+
}
|
|
27
|
+
function header(row) {
|
|
28
|
+
if (row.schema !== 1 || !uuid(row.session_id) || typeof row.started_at !== "string" || !/^\d{4}-\d\d-\d\dT\d\d:\d\d:\d\d\.\d{3}Z$/.test(row.started_at))
|
|
29
|
+
fail();
|
|
30
|
+
const date = new Date(row.started_at);
|
|
31
|
+
if (!Number.isFinite(date.getTime()) || date.toISOString() !== row.started_at)
|
|
32
|
+
fail();
|
|
33
|
+
}
|
|
34
|
+
function event(value) {
|
|
35
|
+
if (!object(value) || bytes(JSON.stringify(value)) > ORCHESTRATION_LIMITS.lineBytes)
|
|
36
|
+
fail();
|
|
37
|
+
const row = value;
|
|
38
|
+
const base = ["event_id", "run_id", "sequence", "elapsed_ms", "kind"];
|
|
39
|
+
if (!uuid(row.event_id) || !uuid(row.run_id) || !integer(row.sequence, ORCHESTRATION_LIMITS.events, 1) || !integer(row.elapsed_ms, ORCHESTRATION_LIMITS.elapsed))
|
|
40
|
+
fail();
|
|
41
|
+
switch (row.kind) {
|
|
42
|
+
case "run_started":
|
|
43
|
+
exact(row, [...base, "agent_id", "agent_version", "role", "task_kind"], ["parent_run_id"]);
|
|
44
|
+
if (!uuid(row.agent_id) || !uuid(row.agent_version) || !includes(AGENT_ROLES, row.role) || !includes(AGENT_TASK_KINDS, row.task_kind) || (Object.hasOwn(row, "parent_run_id") && !uuid(row.parent_run_id)))
|
|
45
|
+
fail();
|
|
46
|
+
break;
|
|
47
|
+
case "run_finished":
|
|
48
|
+
exact(row, [...base, "status"]);
|
|
49
|
+
if (!includes(["succeeded", "failed", "cancelled"], row.status))
|
|
50
|
+
fail();
|
|
51
|
+
break;
|
|
52
|
+
case "usage":
|
|
53
|
+
exact(row, [...base, "scope"], USAGE_KEYS);
|
|
54
|
+
if (row.scope !== "own" || !USAGE_KEYS.some((key) => Object.hasOwn(row, key)) || USAGE_KEYS.some((key) => Object.hasOwn(row, key) && !integer(row[key], ORCHESTRATION_LIMITS.tokens)))
|
|
55
|
+
fail();
|
|
56
|
+
break;
|
|
57
|
+
case "budget":
|
|
58
|
+
exact(row, [...base, "token_limit"]);
|
|
59
|
+
if (!integer(row.token_limit, ORCHESTRATION_LIMITS.tokens, 1))
|
|
60
|
+
fail();
|
|
61
|
+
break;
|
|
62
|
+
case "security":
|
|
63
|
+
exact(row, [...base, "code", "source"]);
|
|
64
|
+
if (!includes(SECURITY_EVENT_CODES, row.code) || !includes(["client_report", "boundary_report"], row.source))
|
|
65
|
+
fail();
|
|
66
|
+
break;
|
|
67
|
+
case "verification":
|
|
68
|
+
exact(row, [...base, "result"]);
|
|
69
|
+
if (!includes(["passed", "failed"], row.result))
|
|
70
|
+
fail();
|
|
71
|
+
break;
|
|
72
|
+
case "intervention":
|
|
73
|
+
exact(row, [...base, "code"]);
|
|
74
|
+
if (!includes(INTERVENTION_CODES, row.code))
|
|
75
|
+
fail();
|
|
76
|
+
break;
|
|
77
|
+
default: fail();
|
|
78
|
+
}
|
|
79
|
+
// Reconstruct through JSON: no caller-owned references or getters reach storage/summary.
|
|
80
|
+
return JSON.parse(JSON.stringify(row));
|
|
81
|
+
}
|
|
82
|
+
/** Validates every event and graph edge. Reorders replay deterministically; repeated IDs must be identical. */
|
|
83
|
+
export function validateOrchestrationRecording(input) {
|
|
84
|
+
if (!object(input) || bytes(JSON.stringify(input)) > ORCHESTRATION_LIMITS.bytes)
|
|
85
|
+
fail();
|
|
86
|
+
const row = input;
|
|
87
|
+
exact(row, ["schema", "session_id", "started_at", "events"]);
|
|
88
|
+
header(row);
|
|
89
|
+
if (!Array.isArray(row.events) || row.events.length === 0 || row.events.length > ORCHESTRATION_LIMITS.events)
|
|
90
|
+
fail();
|
|
91
|
+
const unique = new Map();
|
|
92
|
+
for (const raw of row.events) {
|
|
93
|
+
const item = event(raw), prior = unique.get(item.event_id);
|
|
94
|
+
if (prior && orchestrationCanonical(prior) !== orchestrationCanonical(item))
|
|
95
|
+
fail();
|
|
96
|
+
unique.set(item.event_id, item);
|
|
97
|
+
}
|
|
98
|
+
const events = [...unique.values()].sort((a, b) => a.sequence - b.sequence);
|
|
99
|
+
const starts = new Map();
|
|
100
|
+
const finishes = new Set(), used = new Set(), budgets = new Set();
|
|
101
|
+
let previousSequence = 0, previousElapsed = 0;
|
|
102
|
+
for (const item of events) {
|
|
103
|
+
if (item.sequence !== previousSequence + 1 || item.elapsed_ms < previousElapsed)
|
|
104
|
+
fail();
|
|
105
|
+
previousSequence = item.sequence;
|
|
106
|
+
previousElapsed = item.elapsed_ms;
|
|
107
|
+
if (item.kind === "run_started") {
|
|
108
|
+
if (starts.has(item.run_id) || (item.parent_run_id && (!starts.has(item.parent_run_id) || finishes.has(item.parent_run_id))))
|
|
109
|
+
fail();
|
|
110
|
+
starts.set(item.run_id, item);
|
|
111
|
+
if (starts.size > ORCHESTRATION_LIMITS.runs)
|
|
112
|
+
fail();
|
|
113
|
+
}
|
|
114
|
+
else {
|
|
115
|
+
if (!starts.has(item.run_id) || finishes.has(item.run_id))
|
|
116
|
+
fail();
|
|
117
|
+
if (item.kind === "run_finished") {
|
|
118
|
+
// A parent cannot finish before its active children. Interrupted recordings keep it open.
|
|
119
|
+
if ([...starts.values()].some((start) => start.parent_run_id === item.run_id && !finishes.has(start.run_id)))
|
|
120
|
+
fail();
|
|
121
|
+
finishes.add(item.run_id);
|
|
122
|
+
}
|
|
123
|
+
if (item.kind === "usage")
|
|
124
|
+
used.add(item.run_id);
|
|
125
|
+
if (item.kind === "budget") {
|
|
126
|
+
if (budgets.has(item.run_id) || used.has(item.run_id))
|
|
127
|
+
fail();
|
|
128
|
+
budgets.add(item.run_id);
|
|
129
|
+
}
|
|
130
|
+
}
|
|
131
|
+
}
|
|
132
|
+
return { schema: 1, session_id: row.session_id, started_at: row.started_at, events };
|
|
133
|
+
}
|
|
134
|
+
/** JSONL is an explicit opt-in file; an incomplete last line is rejected, never silently truncated. */
|
|
135
|
+
export function parseOrchestrationJsonl(text) {
|
|
136
|
+
if (typeof text !== "string" || bytes(text) > ORCHESTRATION_LIMITS.bytes)
|
|
137
|
+
fail();
|
|
138
|
+
const lines = text.replace(/\r\n/g, "\n").split("\n");
|
|
139
|
+
if (lines.at(-1) === "")
|
|
140
|
+
lines.pop();
|
|
141
|
+
if (lines.length < 2 || lines.some((line) => !line || bytes(line) > ORCHESTRATION_LIMITS.lineBytes))
|
|
142
|
+
fail();
|
|
143
|
+
let rows;
|
|
144
|
+
try {
|
|
145
|
+
rows = lines.map((line) => JSON.parse(line));
|
|
146
|
+
}
|
|
147
|
+
catch {
|
|
148
|
+
return fail();
|
|
149
|
+
}
|
|
150
|
+
if (!object(rows[0]))
|
|
151
|
+
fail();
|
|
152
|
+
const first = rows[0];
|
|
153
|
+
exact(first, ["schema", "session_id", "started_at"]);
|
|
154
|
+
return validateOrchestrationRecording({ ...first, events: rows.slice(1) });
|
|
155
|
+
}
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
// GENERATED by scripts/build-orchestration-evidence.mjs; edit packages/core/src/orchestration-evidence.ts.
|
|
2
|
+
/** Descriptive application telemetry. No scoring, hiring inference or autonomous-to-human time conversion. */
|
|
3
|
+
import { USAGE_KEYS, validateOrchestrationRecording } from "./orchestration-contract.mjs";
|
|
4
|
+
export * from "./orchestration-contract.mjs";
|
|
5
|
+
function summarizeRun(start, events) {
|
|
6
|
+
const end = events.find((item) => item.kind === "run_finished");
|
|
7
|
+
const usages = events.filter((item) => item.kind === "usage");
|
|
8
|
+
const completeUsage = usages.length > 0 && usages.every((item) => USAGE_KEYS.every((key) => item[key] !== undefined));
|
|
9
|
+
const counts = Object.fromEntries(USAGE_KEYS.map((key) => [key, usages.reduce((sum, item) => sum + (item[key] ?? 0), 0)]));
|
|
10
|
+
const total = completeUsage ? USAGE_KEYS.reduce((sum, key) => sum + counts[key], 0) : null;
|
|
11
|
+
const input = counts.input_uncached_tokens + counts.cache_read_tokens + counts.cache_write_tokens;
|
|
12
|
+
const budget = events.find((item) => item.kind === "budget");
|
|
13
|
+
const checks = events.filter((item) => item.kind === "verification");
|
|
14
|
+
const security = {}, interventions = {};
|
|
15
|
+
for (const item of events) {
|
|
16
|
+
if (item.kind === "security")
|
|
17
|
+
security[item.code] = (security[item.code] ?? 0) + 1;
|
|
18
|
+
if (item.kind === "intervention")
|
|
19
|
+
interventions[item.code] = (interventions[item.code] ?? 0) + 1;
|
|
20
|
+
}
|
|
21
|
+
const limit = budget?.kind === "budget" ? budget.token_limit : null;
|
|
22
|
+
return {
|
|
23
|
+
run_id: start.run_id, ...(start.parent_run_id ? { parent_run_id: start.parent_run_id } : {}), agent_id: start.agent_id, agent_version: start.agent_version,
|
|
24
|
+
role: start.role, task_kind: start.task_kind, status: end?.kind === "run_finished" ? end.status : "incomplete", elapsed_ms: end ? end.elapsed_ms - start.elapsed_ms : null,
|
|
25
|
+
tokens_total: total, cache_share: completeUsage && input > 0 ? counts.cache_read_tokens / input : null, token_limit: limit,
|
|
26
|
+
budget_exceeded: total !== null && limit !== null ? total > limit : null,
|
|
27
|
+
verification: checks.length ? { passed: checks.filter((item) => item.kind === "verification" && item.result === "passed").length, failed: checks.filter((item) => item.kind === "verification" && item.result === "failed").length } : null,
|
|
28
|
+
security, interventions,
|
|
29
|
+
};
|
|
30
|
+
}
|
|
31
|
+
/** One engine for CLI and platform. Missing counters stay unknown; finished means reported, not accepted by a customer. */
|
|
32
|
+
export function summarizeOrchestration(input) {
|
|
33
|
+
const recording = validateOrchestrationRecording(input);
|
|
34
|
+
const starts = recording.events.filter((item) => item.kind === "run_started");
|
|
35
|
+
const runs = starts.map((start) => summarizeRun(start, recording.events.filter((item) => item.run_id === start.run_id)));
|
|
36
|
+
const allComplete = runs.every((run) => run.elapsed_ms !== null);
|
|
37
|
+
const boundaryCounts = new Map();
|
|
38
|
+
for (const item of recording.events) {
|
|
39
|
+
if (item.kind !== "run_started" && item.kind !== "run_finished")
|
|
40
|
+
continue;
|
|
41
|
+
boundaryCounts.set(item.elapsed_ms, (boundaryCounts.get(item.elapsed_ms) ?? 0) + (item.kind === "run_started" ? 1 : -1));
|
|
42
|
+
}
|
|
43
|
+
let active = 0, peak = 0, union = 0, previous = 0;
|
|
44
|
+
for (const [elapsed, delta] of [...boundaryCounts].sort((a, b) => a[0] - b[0])) {
|
|
45
|
+
if (active > 0)
|
|
46
|
+
union += elapsed - previous;
|
|
47
|
+
active += delta;
|
|
48
|
+
peak = Math.max(peak, active);
|
|
49
|
+
previous = elapsed;
|
|
50
|
+
}
|
|
51
|
+
return {
|
|
52
|
+
provenance: "application_reported", session_id: recording.session_id, started_at: recording.started_at, runs,
|
|
53
|
+
coverage: { runs: runs.length, complete_runs: runs.filter((run) => run.elapsed_ms !== null).length, usage_runs: runs.filter((run) => run.tokens_total !== null).length, events: recording.events.length },
|
|
54
|
+
elapsed_ms: allComplete ? union : null, agent_run_ms: allComplete ? runs.reduce((sum, run) => sum + (run.elapsed_ms ?? 0), 0) : null,
|
|
55
|
+
// A run rounded to zero milliseconds is below this clock's resolution, not proof of zero simultaneous runs.
|
|
56
|
+
peak_concurrency: allComplete && runs.every((run) => (run.elapsed_ms ?? 0) > 0) ? peak : null,
|
|
57
|
+
tokens_total: runs.every((run) => run.tokens_total !== null) ? runs.reduce((sum, run) => sum + (run.tokens_total ?? 0), 0) : null,
|
|
58
|
+
};
|
|
59
|
+
}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
/** Explicit local metadata file only. No home discovery, credentials, uploads or clocks invented here. */
|
|
2
|
+
import { constants, openSync, closeSync, fstatSync, lstatSync, readSync } from "node:fs";
|
|
3
|
+
import { parseOrchestrationJsonl, summarizeOrchestration } from "./orchestration-evidence.mjs";
|
|
4
|
+
|
|
5
|
+
export function reportFile(args) {
|
|
6
|
+
if (args.length !== 3 || args[0] !== "report" || args[1] !== "--file" || !args[2]) {
|
|
7
|
+
process.stderr.write("Usage: worktrust orchestration report --file recording.jsonl\n");
|
|
8
|
+
process.exitCode = 1;
|
|
9
|
+
return;
|
|
10
|
+
}
|
|
11
|
+
let fd;
|
|
12
|
+
try {
|
|
13
|
+
const before = lstatSync(args[2]);
|
|
14
|
+
if (!before.isFile() || before.isSymbolicLink()) throw Error("invalid");
|
|
15
|
+
fd = openSync(args[2], constants.O_RDONLY | (constants.O_NOFOLLOW ?? 0) | (constants.O_NONBLOCK ?? 0));
|
|
16
|
+
const info = fstatSync(fd);
|
|
17
|
+
if (!info.isFile() || info.size > 262144 || info.dev !== before.dev || info.ino !== before.ino) throw Error("invalid");
|
|
18
|
+
const bytes = Buffer.alloc(262145);
|
|
19
|
+
let length = 0, received;
|
|
20
|
+
do { received = readSync(fd, bytes, length, bytes.length - length, null); length += received; } while (received && length < bytes.length);
|
|
21
|
+
if (length > 262144) throw Error("invalid");
|
|
22
|
+
const recording = parseOrchestrationJsonl(new TextDecoder("utf-8", { fatal: true }).decode(bytes.subarray(0, length)));
|
|
23
|
+
process.stdout.write(JSON.stringify(summarizeOrchestration(recording), null, 2) + "\n");
|
|
24
|
+
} catch {
|
|
25
|
+
process.stderr.write("Orchestration recording refused: use a regular, bounded file with valid metadata.\n");
|
|
26
|
+
process.exitCode = 1;
|
|
27
|
+
} finally { if (fd !== undefined) closeSync(fd); }
|
|
28
|
+
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "worktrust",
|
|
3
|
-
"version": "0.10.
|
|
3
|
+
"version": "0.10.15",
|
|
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": {
|
|
@@ -25,7 +25,11 @@
|
|
|
25
25
|
"SECURITY.md",
|
|
26
26
|
"LICENSE",
|
|
27
27
|
"AGENTS.md",
|
|
28
|
-
"CLAUDE.md"
|
|
28
|
+
"CLAUDE.md",
|
|
29
|
+
"orchestration-contract.mjs",
|
|
30
|
+
"orchestration-evidence.mjs",
|
|
31
|
+
"orchestration-report.mjs",
|
|
32
|
+
"claude-mod.mjs"
|
|
29
33
|
],
|
|
30
34
|
"engines": {
|
|
31
35
|
"node": ">=18"
|
package/worktrust.mjs
CHANGED
|
@@ -75,7 +75,7 @@ import { homedir, hostname, platform } from "node:os";
|
|
|
75
75
|
import { dirname, join } from "node:path";
|
|
76
76
|
import { createInterface } from "node:readline/promises";
|
|
77
77
|
import { createInterface as lines } from "node:readline";
|
|
78
|
-
import { fileURLToPath } from "node:url";
|
|
78
|
+
import { fileURLToPath, pathToFileURL } from "node:url";
|
|
79
79
|
|
|
80
80
|
const args = process.argv.slice(2);
|
|
81
81
|
const VALUED = ["--name", "--origin", "--url", "--export", "--from-folder"];
|
|
@@ -83,14 +83,14 @@ 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.15";
|
|
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");
|
|
90
90
|
const HERE = dirname(fileURLToPath(import.meta.url));
|
|
91
|
-
const SCRIPTS = ["setup-mcp.mjs", "log-session.mjs", "count-behaviour.mjs", "transcript-readers.mjs", "session-databases.mjs", "config-edits.mjs", "stretch-evidence.mjs", "chat-exports.mjs", "stack-rules.mjs", "runtime-install.mjs"];
|
|
91
|
+
const SCRIPTS = ["setup-mcp.mjs", "log-session.mjs", "count-behaviour.mjs", "transcript-readers.mjs", "session-databases.mjs", "config-edits.mjs", "stretch-evidence.mjs", "chat-exports.mjs", "stack-rules.mjs", "runtime-install.mjs", "orchestration-contract.mjs", "orchestration-evidence.mjs", "orchestration-report.mjs", "claude-mod.mjs"];
|
|
92
92
|
/** The modules the scripts import by name from beside them; a download keeps that name. */
|
|
93
|
-
const IMPORTED = new Set(["transcript-readers.mjs", "session-databases.mjs", "config-edits.mjs", "stretch-evidence.mjs", "chat-exports.mjs", "stack-rules.mjs", "runtime-install.mjs"]);
|
|
93
|
+
const IMPORTED = new Set(["transcript-readers.mjs", "session-databases.mjs", "config-edits.mjs", "stretch-evidence.mjs", "chat-exports.mjs", "stack-rules.mjs", "runtime-install.mjs", "orchestration-contract.mjs", "orchestration-evidence.mjs", "orchestration-report.mjs"]);
|
|
94
94
|
const downloaded = (name) => (IMPORTED.has(name) ? name : `${name}.download.mjs`);
|
|
95
95
|
const BUNDLED = SCRIPTS.every((name) => existsSync(join(HERE, name)));
|
|
96
96
|
const PLACEHOLDER = `wt_${"0".repeat(43)}`;
|
|
@@ -1012,6 +1012,8 @@ async function disconnect() {
|
|
|
1012
1012
|
if (!(await ask("Continue?"))) { say(" Stopped. Nothing was changed."); return; }
|
|
1013
1013
|
await run(paths["setup-mcp.mjs"], ["--remove", "--write"], PLACEHOLDER);
|
|
1014
1014
|
await run(paths["log-session.mjs"], ["--uninstall", "--purge"], PLACEHOLDER);
|
|
1015
|
+
// 0.10.15: the WorkTrust mod goes with the coupling, and what it counted with it.
|
|
1016
|
+
try { const mod = await import(pathToFileURL(paths["claude-mod.mjs"]).href); if (mod.modInstalled()) { mod.uninstallMod(); say(" ✓ The WorkTrust mod is out of Claude Code, and what it counted is deleted."); } } catch { /* never installed */ }
|
|
1015
1017
|
if (removeCodexNotify()) say(" ✓ Codex no longer wakes the session hook.");
|
|
1016
1018
|
if (removeAntigravityHook()) say(" ✓ Antigravity no longer wakes the session hook.");
|
|
1017
1019
|
previousNote.save(keyStore.load());
|
|
@@ -1023,6 +1025,47 @@ async function disconnect() {
|
|
|
1023
1025
|
say(" Done. Revoke the key in WorkTrust to finish.");
|
|
1024
1026
|
}
|
|
1025
1027
|
|
|
1028
|
+
/**
|
|
1029
|
+
* THE WORKTRUST MOD FOR CLAUDE CODE (0.10.15, owner 2026-10-16; claude-mod.mjs, docs/CLAUDE-CODE-MOD.md). The person turns
|
|
1030
|
+
* it on and off here; nothing else installs it. On: Claude Code (2.1.287 or later) loads it in every session, and it
|
|
1031
|
+
* counts, per session and day, what a transcript cannot show. Its counts stay in ~/.worktrust/claude-mod-counts until
|
|
1032
|
+
* the session hook reports that session's stretch, beside the rest; they reach the person's own mirror, never a score.
|
|
1033
|
+
*/
|
|
1034
|
+
async function mod() {
|
|
1035
|
+
const paths = await scripts();
|
|
1036
|
+
const kit = await import(pathToFileURL(paths["claude-mod.mjs"]).href);
|
|
1037
|
+
const sub = args[1] ?? "status";
|
|
1038
|
+
const on = kit.modInstalled();
|
|
1039
|
+
say();
|
|
1040
|
+
say(` WorkTrust mod for Claude Code · ${on ? "on" : "off"}`);
|
|
1041
|
+
say();
|
|
1042
|
+
if (sub === "install") {
|
|
1043
|
+
say(" It runs inside Claude Code and counts, per session and day, what a transcript cannot show:");
|
|
1044
|
+
say(" · permission questions put to you, and how often you said yes or no");
|
|
1045
|
+
say(" · model requests per effort level, the models that answered, requests sent to another model");
|
|
1046
|
+
say(" · the peak context fill and plan-limit use, compactions you asked for or that ran by themselves");
|
|
1047
|
+
say(" · subagents and teammates started, and how many mods, MCP servers and own agent types are active");
|
|
1048
|
+
say(" Counts only: never a prompt, an answer, a command, a file or a name. It sends nothing itself: your session hook");
|
|
1049
|
+
say(" reports the counts with the session, and they show in your own mirror, not on your passport.");
|
|
1050
|
+
say(` It names ~/.worktrust/claude-mod in ~/.claude/settings.json (CLAUDE_CODE_PLUGIN_DIRS), backed up first. Claude Code ${kit.MIN_CLAUDE_CODE} or later.`);
|
|
1051
|
+
say();
|
|
1052
|
+
if (on && !has("yes")) { kit.installMod(); say(" Already on. Its file is refreshed; nothing else changed."); return; }
|
|
1053
|
+
if (!(await ask("Turn it on?"))) { say(" Stopped. Nothing was changed."); return; }
|
|
1054
|
+
const done = kit.installMod();
|
|
1055
|
+
say(` ✓ On: ${done.dir}${done.settingsChanged ? " (named in ~/.claude/settings.json)" : ""}. Start a new Claude Code session, or run /reload-plugins in an open one.`);
|
|
1056
|
+
say(" In Claude Code, /plugin then shows: 1 mod active · worktrust-measure.");
|
|
1057
|
+
return;
|
|
1058
|
+
}
|
|
1059
|
+
if (sub === "remove" || sub === "uninstall") {
|
|
1060
|
+
if (!on) { say(" It is not on. Nothing to remove."); return; }
|
|
1061
|
+
if (!(await ask("Turn it off and delete what it counted?"))) { say(" Stopped. Nothing was changed."); return; }
|
|
1062
|
+
kit.uninstallMod();
|
|
1063
|
+
say(" ✓ Off. It is out of ~/.claude/settings.json and its counts are deleted. Counts already reported stay in your mirror.");
|
|
1064
|
+
return;
|
|
1065
|
+
}
|
|
1066
|
+
say(on ? " On: Claude Code loads it in every new session. `worktrust mod remove` turns it off." : " Off. `worktrust mod install` shows what it counts and asks first.");
|
|
1067
|
+
}
|
|
1068
|
+
|
|
1026
1069
|
async function status() {
|
|
1027
1070
|
const servers = {};
|
|
1028
1071
|
try {
|
|
@@ -1115,6 +1158,10 @@ function help() {
|
|
|
1115
1158
|
say(" days this computer's own sessions lack, reconstructed, never verified hours (asks first)");
|
|
1116
1159
|
say(" worktrust disconnect take WorkTrust out of every AI app here (asks first)");
|
|
1117
1160
|
say(" worktrust status what is coupled here");
|
|
1161
|
+
say(" worktrust orchestration report --file recording.jsonl inspect local agent metadata; sends nothing");
|
|
1162
|
+
say(" worktrust mod the WorkTrust mod for Claude Code: what it counts, and whether it is on");
|
|
1163
|
+
say(" install turn it on: counts permission answers, effort levels, context peaks and subagents (asks first)");
|
|
1164
|
+
say(" remove turn it off and delete what it counted");
|
|
1118
1165
|
say(" worktrust preserve keep your AI history: the report, then the settings and a local archive, each on your yes");
|
|
1119
1166
|
say(" --apply keep them: asks per change, backs the file up first (--yes: no question)");
|
|
1120
1167
|
say(" --archive [dir] a local, metadata-only, hash-chained record of the measured days (~/AI-Evidence)");
|
|
@@ -1130,7 +1177,7 @@ function help() {
|
|
|
1130
1177
|
// before anything is read or written, --yes included. The hook and the MCP bridge are started by the agent's client
|
|
1131
1178
|
// itself and stay as they are; `status` only reads.
|
|
1132
1179
|
const AGENT_ENV = ["CLAUDECODE", "CLAUDE_CODE_ENTRYPOINT", "CODEX_SANDBOX", "CODEX_CI", "GEMINI_CLI", "CURSOR_AGENT", "OPENCODE", "CLINE_ACTIVE", "AIDER_CHAT", "ANTIGRAVITY_AGENT", "WINDSURF_AGENT"];
|
|
1133
|
-
const PERSON_ONLY = new Set(["default", "connect", "update", "history", "disconnect", "preserve", "codex", "antigravity", "sources", "web", "import"]);
|
|
1180
|
+
const PERSON_ONLY = new Set(["default", "connect", "update", "history", "disconnect", "preserve", "codex", "antigravity", "sources", "web", "import", "orchestration", "mod"]);
|
|
1134
1181
|
const agentShell = AGENT_ENV.find((name) => process.env[name] && process.env[name] !== "0");
|
|
1135
1182
|
if (agentShell && PERSON_ONLY.has(command)) {
|
|
1136
1183
|
say();
|
|
@@ -1193,4 +1240,9 @@ else if (command === "antigravity") await offerAntigravity();
|
|
|
1193
1240
|
else if (command === "disconnect") await disconnect();
|
|
1194
1241
|
else if (command === "status") await status();
|
|
1195
1242
|
else if (command === "preserve") await preserve();
|
|
1243
|
+
else if (command === "mod") await mod();
|
|
1244
|
+
else if (command === "orchestration") {
|
|
1245
|
+
if (!["orchestration-report.mjs", "orchestration-evidence.mjs", "orchestration-contract.mjs"].every((name) => existsSync(join(HERE, name)))) fail("Local agent reports need the complete WorkTrust npm/Python package or preservation kit. No file was read or sent.");
|
|
1246
|
+
const { reportFile } = await import("./orchestration-report.mjs"); reportFile(args.slice(1));
|
|
1247
|
+
}
|
|
1196
1248
|
else help();
|