worktrust 0.10.10 → 0.10.11
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 +5 -2
- package/package.json +2 -1
- package/stack-rules.mjs +153 -0
- package/worktrust.mjs +9 -9
package/README.md
CHANGED
|
@@ -339,7 +339,7 @@ which would delete every password on the computer, and many people rightly keep
|
|
|
339
339
|
| **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. |
|
|
340
340
|
| **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/`. |
|
|
341
341
|
| **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). |
|
|
342
|
-
| **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`), 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). |
|
|
342
|
+
| **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`), the technologies the touched files name as keys from WorkTrust's closed list (`stack`, `tools_seen`: a `.tsx` file names TypeScript and React, a `Dockerfile` names Docker; read off the paths with the same rules the record uses, since 0.10.11; never a path), 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). |
|
|
343
343
|
| **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. |
|
|
344
344
|
|
|
345
345
|
## Why you can check it
|
package/log-session.mjs
CHANGED
|
@@ -274,10 +274,11 @@ const { DATABASE_SESSION = /(?!)/, databaseLines = () => null, databaseSessions
|
|
|
274
274
|
// 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
|
|
275
275
|
// imports the same reader); `--history --export <path>` sends its conversations as RECONSTRUCTED days, never measured, never tokens.
|
|
276
276
|
const { EXPORT_CLIENTS = [], EXPORT_TITLES = {}, exportSessions = null, exportRef = null, readExport = null, findExports = null } = (await import("./chat-exports.mjs").catch(() => null)) ?? {};
|
|
277
|
+
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
278
|
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
279
|
const DATABASE_CLIENTS = ["hermes", "goose", "opencode", "openclaw", "cursor", "copilot"]; // the registry's keys, the name each line carries
|
|
279
280
|
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)
|
|
280
|
-
const READER_FILES = ["transcript-readers.mjs", "session-databases.mjs", "stretch-evidence.mjs", "chat-exports.mjs"]; // 0.7.4: the derived record travels with the hook; 0.10.10: the export reader
|
|
281
|
+
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
|
|
281
282
|
/** The readers go where the hook and the counter run: copied from beside this file, else (or for a newer counter) from the deployment. */
|
|
282
283
|
async function installReaders(origin, fromNetwork = false) {
|
|
283
284
|
let installed = true;
|
|
@@ -657,7 +658,7 @@ function payloadFor(stretch) {
|
|
|
657
658
|
const cwd = stretch.cwd && existsSync(stretch.cwd) ? stretch.cwd : null;
|
|
658
659
|
const repo = cwd ? repoOf(cwd) : null;
|
|
659
660
|
const touched = cwd ? pathsTouched(cwd, new Date(stretch.from).toISOString(), new Date(stretch.to).toISOString()) : { paths: [], committed: false, shas: [] };
|
|
660
|
-
const { layer, layers } = layersOf(touched.paths);
|
|
661
|
+
const { layer, layers } = layersOf(touched.paths), stack = stackOfFiles(touched.paths), toolsSeen = displayStackOfFiles(touched.paths); // 0.10.11: the stack and the tools seen, from the same paths, keys only, two fields
|
|
661
662
|
// The seventh kind, used as it is defined: a stretch that changed no artefact is knowing
|
|
662
663
|
// something, not building something, and it earns neither an artefact's nor a validation's credit.
|
|
663
664
|
const kind = touched.paths.length === 0 ? "researched" : touched.committed ? "changed" : "built";
|
|
@@ -673,6 +674,8 @@ function payloadFor(stretch) {
|
|
|
673
674
|
kind,
|
|
674
675
|
...(layer ? { layer } : {}),
|
|
675
676
|
...(layers.length > 1 ? { layers } : {}),
|
|
677
|
+
...(stack.length > 0 ? { stack } : {}),
|
|
678
|
+
...(toolsSeen.length > 0 ? { tools_seen: toolsSeen } : {}), // its own line: the payload allowlist (hook-presence) reads the key here
|
|
676
679
|
// Both, or neither: seconds without a basis is exactly the ambiguity the record is trying to
|
|
677
680
|
// lose, and a basis without seconds says nothing.
|
|
678
681
|
...(stretch.seconds !== null ? { seconds: stretch.seconds, duration_basis: "measured" } : {}),
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "worktrust",
|
|
3
|
-
"version": "0.10.
|
|
3
|
+
"version": "0.10.11",
|
|
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": {
|
|
@@ -19,6 +19,7 @@
|
|
|
19
19
|
"preserve-lines.mjs",
|
|
20
20
|
"stretch-evidence.mjs",
|
|
21
21
|
"chat-exports.mjs",
|
|
22
|
+
"stack-rules.mjs",
|
|
22
23
|
"README.md",
|
|
23
24
|
"SECURITY.md",
|
|
24
25
|
"LICENSE",
|
package/stack-rules.mjs
ADDED
|
@@ -0,0 +1,153 @@
|
|
|
1
|
+
// GENERATED by scripts/build-stack-rules.mjs from packages/core/src/scoring/stack.ts and packages/core/src/stack-display.ts (the sources of truth). Do not edit:
|
|
2
|
+
// `node scripts/build-stack-rules.mjs` rewrites it and `--check` refuses a copy that drifted from core, in either direction.
|
|
3
|
+
/**
|
|
4
|
+
* WHICH TECHNOLOGY A STRETCH TOUCHED, read off file PATHS and sent as keys from core's closed list (owner, 2026-10-10:
|
|
5
|
+
* recognition stays FILES ONLY: a file names it, never a dependency list, never code content). The hook reads the same
|
|
6
|
+
* paths it already reads for the layers; the paths never travel, only the keys.
|
|
7
|
+
*/
|
|
8
|
+
export const TECHNOLOGIES = [
|
|
9
|
+
"typescript", "javascript", "python", "go", "rust", "java", "kotlin", "swift", "csharp", "ruby", "php", "cpp", "sql", "shell",
|
|
10
|
+
"react", "nextjs", "vue", "svelte", "angular", "reactNative", "expo", "tailwind", "nodejs", "django", "fastapi", "rails", "dotnet", "spring", "flutter",
|
|
11
|
+
"postgres", "supabase", "prisma", "graphql", "docker", "kubernetes", "terraform", "githubActions", "vercel", "aws", "gcp", "azure",
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
"redis", "sqlite", "vitest", "jest", "playwright", "storybook", "cloudflare", "deno", "bun", "drizzle", "vite", "webpack", "electron", "firebase", "sentry", "mcp", "claude",
|
|
16
|
+
|
|
17
|
+
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
|
|
21
|
+
"retrieval", "pgvector", "pinecone", "weaviate", "qdrant", "chroma", "langchain", "llamaindex",
|
|
22
|
+
];
|
|
23
|
+
const BY_EXTENSION = [
|
|
24
|
+
[/\.(ts|mts|cts)$/i, ["typescript"]],
|
|
25
|
+
[/\.tsx$/i, ["typescript", "react"]],
|
|
26
|
+
[/\.jsx$/i, ["javascript", "react"]],
|
|
27
|
+
[/\.(js|mjs|cjs)$/i, ["javascript"]],
|
|
28
|
+
[/\.py$/i, ["python"]],
|
|
29
|
+
[/\.go$/i, ["go"]],
|
|
30
|
+
[/\.rs$/i, ["rust"]],
|
|
31
|
+
[/\.java$/i, ["java"]],
|
|
32
|
+
[/\.kt$/i, ["kotlin"]],
|
|
33
|
+
[/\.swift$/i, ["swift"]],
|
|
34
|
+
[/\.cs$/i, ["csharp"]],
|
|
35
|
+
[/\.rb$/i, ["ruby"]],
|
|
36
|
+
[/\.php$/i, ["php"]],
|
|
37
|
+
[/\.(c|cc|cpp|h|hpp)$/i, ["cpp"]],
|
|
38
|
+
[/\.sql$/i, ["sql"]],
|
|
39
|
+
[/\.(sqlite|sqlite3)$/i, ["sqlite"]],
|
|
40
|
+
[/\.(sh|bash|zsh)$/i, ["shell"]],
|
|
41
|
+
[/\.vue$/i, ["vue"]],
|
|
42
|
+
[/\.svelte$/i, ["svelte"]],
|
|
43
|
+
[/\.dart$/i, ["flutter"]],
|
|
44
|
+
[/\.prisma$/i, ["prisma"]],
|
|
45
|
+
[/\.(graphql|gql)$/i, ["graphql"]],
|
|
46
|
+
[/\.tf$/i, ["terraform"]],
|
|
47
|
+
];
|
|
48
|
+
const BY_NAME = [
|
|
49
|
+
[/(^|\/)next\.config\.(js|mjs|ts)$/i, ["nextjs"]],
|
|
50
|
+
[/(^|\/)tailwind\.config\.(js|mjs|ts)$|(^|\/)postcss\.config\./i, ["tailwind"]],
|
|
51
|
+
[/(^|\/)package(-lock)?\.json$|(^|\/)pnpm-lock\.yaml$|(^|\/)yarn\.lock$/i, ["nodejs"]],
|
|
52
|
+
[/(^|\/)app\.json$|(^|\/)eas\.json$/i, ["expo", "reactNative"]],
|
|
53
|
+
[/(^|\/)angular\.json$/i, ["angular"]],
|
|
54
|
+
[/(^|\/)manage\.py$|(^|\/)settings\.py$/i, ["django"]],
|
|
55
|
+
[/(^|\/)(requirements\.txt|pyproject\.toml|Pipfile)$/i, ["python"]],
|
|
56
|
+
[/(^|\/)Gemfile(\.lock)?$|(^|\/)config\/routes\.rb$/i, ["rails"]],
|
|
57
|
+
[/\.csproj$|(^|\/)Program\.cs$/i, ["dotnet"]],
|
|
58
|
+
[/(^|\/)pom\.xml$|(^|\/)build\.gradle(\.kts)?$/i, ["spring"]],
|
|
59
|
+
[/(^|\/)pubspec\.yaml$/i, ["flutter"]],
|
|
60
|
+
[/(^|\/)supabase\//i, ["supabase", "postgres"]],
|
|
61
|
+
[/(^|\/)(Dockerfile|docker-compose[^/]*\.ya?ml)$/i, ["docker"]],
|
|
62
|
+
[/(^|\/)(k8s|kubernetes|helm)\//i, ["kubernetes"]],
|
|
63
|
+
[/(^|\/)\.github\/workflows\//i, ["githubActions"]],
|
|
64
|
+
[/(^|\/)vercel\.json$/i, ["vercel"]],
|
|
65
|
+
[/(^|\/)(cloudformation|cdk)\/|(^|\/)serverless\.ya?ml$/i, ["aws"]],
|
|
66
|
+
[/(^|\/)app\.yaml$|(^|\/)cloudbuild\.ya?ml$/i, ["gcp"]],
|
|
67
|
+
[/(^|\/)azure-pipelines\.ya?ml$|(^|\/)host\.json$/i, ["azure"]],
|
|
68
|
+
[/(^|\/)redis\.conf$|(^|\/)redis\//i, ["redis"]],
|
|
69
|
+
[/(^|\/)vitest\.(config|workspace)\.[cm]?[jt]s$/i, ["vitest"]],
|
|
70
|
+
[/(^|\/)jest\.config\.[cm]?[jt]s$|(^|\/)jest\.setup\.[cm]?[jt]s$/i, ["jest"]],
|
|
71
|
+
[/(^|\/)playwright\.config\.[cm]?[jt]s$/i, ["playwright"]],
|
|
72
|
+
[/(^|\/)\.storybook\/|\.stories\.[jt]sx?$/i, ["storybook"]],
|
|
73
|
+
[/(^|\/)wrangler\.(toml|jsonc?)$/i, ["cloudflare"]],
|
|
74
|
+
[/(^|\/)deno\.(jsonc?|lock)$/i, ["deno"]],
|
|
75
|
+
[/(^|\/)bun\.lockb?$|(^|\/)bunfig\.toml$/i, ["bun"]],
|
|
76
|
+
[/(^|\/)drizzle\.config\.[cm]?[jt]s$|(^|\/)drizzle\//i, ["drizzle"]],
|
|
77
|
+
[/(^|\/)vite\.config\.[cm]?[jt]s$/i, ["vite"]],
|
|
78
|
+
[/(^|\/)webpack\.config\.[cm]?[jt]s$/i, ["webpack"]],
|
|
79
|
+
[/(^|\/)electron-builder\.(ya?ml|json)$|(^|\/)electron\.vite\.config\.[cm]?[jt]s$/i, ["electron"]],
|
|
80
|
+
[/(^|\/)firebase\.json$|(^|\/)\.firebaserc$/i, ["firebase"]],
|
|
81
|
+
[/(^|\/)sentry\.[a-z]+\.config\.[cm]?[jt]s$/i, ["sentry"]],
|
|
82
|
+
[/(^|\/)\.mcp\.json$|(^|\/)mcp\.json$/i, ["mcp"]],
|
|
83
|
+
[/(^|\/)\.claude\/|(^|\/)CLAUDE\.md$/i, ["claude"]],
|
|
84
|
+
[/(^|\/)(rag|retrieval|embeddings?|vector[-_]?stores?)(\/|\.)/i, ["retrieval"]],
|
|
85
|
+
[/(^|\/)pgvector(\/|\.)|(^|\/)migrations?\/[^/]*(vector|embedding)[^/]*\.sql$/i, ["pgvector", "retrieval"]],
|
|
86
|
+
[/(^|\/)pinecone[^/]*(\/|\.)/i, ["pinecone", "retrieval"]],
|
|
87
|
+
[/(^|\/)weaviate[^/]*(\/|\.)/i, ["weaviate", "retrieval"]],
|
|
88
|
+
[/(^|\/)qdrant[^/]*(\/|\.)/i, ["qdrant", "retrieval"]],
|
|
89
|
+
[/(^|\/)chroma(\/|\.sqlite3$)/i, ["chroma", "retrieval"]],
|
|
90
|
+
[/(^|\/)langchain[^/]*(\/|\.)|(^|\/)langgraph\.json$/i, ["langchain"]],
|
|
91
|
+
[/(^|\/)llama[-_]?index[^/]*(\/|\.)/i, ["llamaindex", "retrieval"]],
|
|
92
|
+
];
|
|
93
|
+
/** One path → its technologies, sorted; the manifest rules first, then the extension rules, as core reads it. */
|
|
94
|
+
export function stackOfFile(path) {
|
|
95
|
+
const found = new Set();
|
|
96
|
+
for (const [pattern, keys] of BY_NAME) if (pattern.test(path)) for (const key of keys) found.add(key);
|
|
97
|
+
for (const [pattern, keys] of BY_EXTENSION) if (pattern.test(path)) for (const key of keys) found.add(key);
|
|
98
|
+
return [...found].sort();
|
|
99
|
+
}
|
|
100
|
+
/** Many paths → the union, sorted; keys only. */
|
|
101
|
+
export function stackOfFiles(paths) {
|
|
102
|
+
const found = new Set();
|
|
103
|
+
for (const path of paths) for (const key of stackOfFile(path)) found.add(key);
|
|
104
|
+
return [...found].sort();
|
|
105
|
+
}
|
|
106
|
+
/**
|
|
107
|
+
* TOOLS SEEN IN THE FILES (owner, 2026-10-10): the display-only keys beside the frozen engine list, the same rule (a file
|
|
108
|
+
* names it), sent apart as `tools_seen` so no scoring reader of `stack` ever sees them.
|
|
109
|
+
*/
|
|
110
|
+
export const DISPLAY_TECHNOLOGIES = [
|
|
111
|
+
"npm",
|
|
112
|
+
"cli",
|
|
113
|
+
"pytorch",
|
|
114
|
+
"huggingface",
|
|
115
|
+
"onnx",
|
|
116
|
+
"tensorflow",
|
|
117
|
+
"jupyter",
|
|
118
|
+
"gguf",
|
|
119
|
+
"ollama",
|
|
120
|
+
"mlflow",
|
|
121
|
+
"wandb",
|
|
122
|
+
"dvc",
|
|
123
|
+
];
|
|
124
|
+
const DISPLAY_BY_NAME = [
|
|
125
|
+
[/(^|\/)\.npm(ignore|rc)$/i, ["npm"]],
|
|
126
|
+
[/(^|\/)bin\/[^/]+$/i, ["cli"]],
|
|
127
|
+
[/(^|\/)tokenizer(_config)?\.json$/i, ["huggingface"]],
|
|
128
|
+
[/(^|\/)saved_model\.pb$/i, ["tensorflow"]],
|
|
129
|
+
[/(^|\/)Modelfile$/, ["ollama"]],
|
|
130
|
+
[/(^|\/)mlruns\//i, ["mlflow"]],
|
|
131
|
+
[/(^|\/)wandb\//i, ["wandb"]],
|
|
132
|
+
[/(^|\/)dvc\.yaml$/i, ["dvc"]],
|
|
133
|
+
];
|
|
134
|
+
const DISPLAY_BY_EXTENSION = [
|
|
135
|
+
[/\.(pt|pth|ckpt)$/i, ["pytorch"]],
|
|
136
|
+
[/\.safetensors$/i, ["huggingface"]],
|
|
137
|
+
[/\.onnx$/i, ["onnx"]],
|
|
138
|
+
[/\.(tflite|h5|keras)$/i, ["tensorflow"]],
|
|
139
|
+
[/\.ipynb$/i, ["jupyter"]],
|
|
140
|
+
[/\.gguf$/i, ["gguf"]],
|
|
141
|
+
[/\.dvc$/i, ["dvc"]],
|
|
142
|
+
];
|
|
143
|
+
export function displayStackOfFile(path) {
|
|
144
|
+
const found = new Set();
|
|
145
|
+
for (const [pattern, keys] of DISPLAY_BY_NAME) if (pattern.test(path)) for (const key of keys) found.add(key);
|
|
146
|
+
for (const [pattern, keys] of DISPLAY_BY_EXTENSION) if (pattern.test(path)) for (const key of keys) found.add(key);
|
|
147
|
+
return [...found].sort();
|
|
148
|
+
}
|
|
149
|
+
export function displayStackOfFiles(paths) {
|
|
150
|
+
const found = new Set();
|
|
151
|
+
for (const path of paths) for (const key of displayStackOfFile(path)) found.add(key);
|
|
152
|
+
return [...found].sort();
|
|
153
|
+
}
|
package/worktrust.mjs
CHANGED
|
@@ -83,14 +83,14 @@ const command = args.find((arg, at) => !arg.startsWith("--") && !(at > 0 && VALU
|
|
|
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.11";
|
|
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"];
|
|
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"];
|
|
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"]);
|
|
93
|
+
const IMPORTED = new Set(["transcript-readers.mjs", "session-databases.mjs", "config-edits.mjs", "stretch-evidence.mjs", "chat-exports.mjs", "stack-rules.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)}`;
|
|
@@ -1017,15 +1017,15 @@ async function measuredHere() {
|
|
|
1017
1017
|
let m = null;
|
|
1018
1018
|
try { m = JSON.parse(read.out.trim().split("\n").filter((text) => text.startsWith("{")).pop()); } catch { return; }
|
|
1019
1019
|
if (!m || !m.stretches) { say(" Measured here, last 30 days: no finished work stretch yet."); return; }
|
|
1020
|
-
const of = (part, whole,
|
|
1020
|
+
const of = (part, whole, one, many) => `${part} of ${whole} ${whole === 1 ? one : many}`;
|
|
1021
1021
|
say();
|
|
1022
1022
|
say(` Measured here, last 30 days: ${m.stretches} work stretch${m.stretches === 1 ? "" : "es"} · ${m.hours >= 1 ? `${m.hours} h` : "under 1 h"}`);
|
|
1023
|
-
if (m.delivered) say(` verified before delivery ${of(m.verified_first, m.delivered, "stretches that delivered")}`);
|
|
1024
|
-
if (m.failures) say(` recovered failures ${of(m.recovered, m.failures, "failed tool calls")} (${m.blind_retries} retried unchanged)`);
|
|
1025
|
-
if (m.steers) say(` steering that worked ${of(m.effective_steers, m.steers, "times you stepped in")}`);
|
|
1023
|
+
if (m.delivered) say(` verified before delivery ${of(m.verified_first, m.delivered, "stretch that delivered", "stretches that delivered")}`);
|
|
1024
|
+
if (m.failures) say(` recovered failures ${of(m.recovered, m.failures, "failed tool call", "failed tool calls")} (${m.blind_retries} retried unchanged)`);
|
|
1025
|
+
if (m.steers) say(` steering that worked ${of(m.effective_steers, m.steers, "time you stepped in", "times you stepped in")}`);
|
|
1026
1026
|
if (m.refused || m.guard_denied) say(` refused ${m.refused} by you · ${m.guard_denied} by a guard`);
|
|
1027
|
-
if (m.planned) say(` planned ${m.planned}
|
|
1028
|
-
if (m.files) say(` tests among changed files ${of(m.test_files, m.files, "files")}`);
|
|
1027
|
+
if (m.planned) say(` planned ${m.planned} stretch${m.planned === 1 ? "" : "es"} with a to-do list`);
|
|
1028
|
+
if (m.files) say(` tests among changed files ${of(m.test_files, m.files, "file", "files")}`);
|
|
1029
1029
|
const tiers = Object.entries(m.complexity ?? {}).sort();
|
|
1030
1030
|
if (tiers.length) say(` task complexity ${tiers.map(([tier, n]) => `${tier} ${n}`).join(" · ")}`);
|
|
1031
1031
|
say(" Sent with each stretch as kinds and counts, never text. Keep your own copy: npx worktrust@latest preserve");
|