worktrust 0.11.7 → 0.11.8

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.
@@ -1,18 +1,18 @@
1
1
  /**
2
- * THE MENU'S DEEPER LEVELS (CLI 0.11.7): Remote Agent ›, its projects, roots, allowed modes and connections, and the history and
2
+ * THE MENU'S DEEPER LEVELS (CLI 0.11.7; 0.11.8: every item says in one sentence what it does, `info`, beside its command, `hint`): Remote Agent ›, its projects, roots, allowed modes and connections, and the history and
3
3
  * preservation choices. Each item still runs one direct command (runShown), named in its muted line; this file only reads
4
4
  * the remote settings to label the items and never writes one itself: a change goes through the command, so it goes
5
5
  * through applySettingsChange (remote-settings.mjs) like a typed one. Folders are chosen without typing (folder-picker.mjs).
6
6
  */
7
7
  import { homedir } from "node:os";
8
8
  import { join } from "node:path";
9
- import { choose, muted, runShown, typed } from "./cli-menu.mjs";
9
+ import { choose, runShown, typed } from "./cli-menu.mjs";
10
10
  import { makeProjectsFolder, pickFolder, pickerCommand, suggestedFolders } from "./folder-picker.mjs";
11
11
  import { connections } from "./remote-connections.mjs";
12
12
  import { loadIdentity, loadProjects, loadRoots, loadSettings } from "./remote-store.mjs";
13
13
  import { allowedModes } from "./remote-settings.mjs";
14
14
 
15
- const BACK = { label: "← Back", back: true };
15
+ const BACK = { label: "← Back", hint: "Esc", info: "Returns to the list before this one.", back: true };
16
16
  const tilde = (path) => (path.startsWith(homedir()) ? `~${path.slice(homedir().length)}` : path);
17
17
 
18
18
  /** Loop one level: each pick runs, Back or Esc returns; a pick that returns false ends the menu (Ctrl+C after a command). */
@@ -37,9 +37,9 @@ async function addRoots(term, io, header) {
37
37
  const have = new Set(loadRoots().map((r) => r.path));
38
38
  const offered = suggestedFolders().filter((f) => !have.has(f.path));
39
39
  const items = [
40
- ...offered.map((f) => ({ label: `${tilde(f.path)} ${muted(`${f.projects} project${f.projects === 1 ? "" : "s"} found`)}`, tick: true, path: f.path })),
41
- { label: "+ Make a new folder for my projects", make: true, hint: "~/Projects by default; new projects in it get git init" },
42
- { label: "Choose another folder…", pick: true, hint: "the system's folder picker" },
40
+ ...offered.map((f) => ({ label: tilde(f.path), note: { text: `${f.projects} project${f.projects === 1 ? "" : "s"} found`, tone: "dim" }, info: "Space ticks it; Enter adds the ticked folders as roots.", tick: true, path: f.path })),
41
+ { label: "+ Make a new folder for my projects", make: true, hint: "npx worktrust remote roots add <folder> --git-init", info: "Asks for a name (Projects by default), makes the folder in your home folder and adds it; new projects in it get git init." },
42
+ { label: "Choose another folder…", pick: true, hint: "npx worktrust remote roots add <folder>", info: "Opens the system's folder picker and adds the folder you choose." },
43
43
  BACK,
44
44
  ];
45
45
  const picked = await choose(term, { header, title: "Add folders where your projects live", items, multi: true });
@@ -49,7 +49,7 @@ async function addRoots(term, io, header) {
49
49
  if (picked.item.make) {
50
50
  const name = await typed(term, "Name of the new folder in your home folder:", "Projects");
51
51
  term.enter();
52
- if (name) { const made = makeProjectsFolder(name); if (made.ok) chosen.push({ path: made.path, gitInit: true }); else { term.write(` ${made.reason}\n`); await term.key(); } }
52
+ if (name) { const made = makeProjectsFolder(name); if (made.ok) chosen.push({ path: made.path, gitInit: true }); else { term.write(` ${made.reason}\n`); await term.anyKey(); } }
53
53
  }
54
54
  if (picked.item.pick) { const path = await chooseFolder(term); term.enter(); if (path) chosen.push({ path, gitInit: false }); }
55
55
  for (const c of chosen) if ((await runShown(term, io, ["remote", "roots", "add", c.path, ...(c.gitInit ? ["--git-init"] : [])])) === false) return false;
@@ -58,16 +58,16 @@ async function addRoots(term, io, header) {
58
58
 
59
59
  function rootsMenu(term, io, header) {
60
60
  return level(term, header, "Roots for new projects", () => [
61
- { label: "+ Add folders", hint: "npx worktrust remote roots add <folder> a phone opens the projects in it and may create new ones", run: () => addRoots(term, io, header) },
62
- ...loadRoots().map((r) => ({ label: `Remove ${tilde(r.path)}`, hint: `npx worktrust remote roots remove ${tilde(r.path)}`, run: () => runShown(term, io, ["remote", "roots", "remove", r.path]) })),
61
+ { label: "+ Add folders", hint: "npx worktrust remote roots add <folder>", info: "Opens a list of folders to tick. A phone may open the projects in a root and create new ones there.", run: () => addRoots(term, io, header) },
62
+ ...loadRoots().map((r) => ({ label: `Remove ${tilde(r.path)}`, hint: `npx worktrust remote roots remove ${tilde(r.path)}`, info: "Takes this folder off the list; a phone can no longer open or create projects in it. No file is touched.", run: () => runShown(term, io, ["remote", "roots", "remove", r.path]) })),
63
63
  BACK,
64
64
  ]);
65
65
  }
66
66
 
67
67
  function projectsMenu(term, io, header) {
68
68
  return level(term, header, "Projects a phone may steer an agent in", () => [
69
- { label: "+ Add a project folder…", hint: "npx worktrust remote projects add <folder> the system's folder picker", run: async () => { const path = await chooseFolder(term); term.enter(); return path ? runShown(term, io, ["remote", "projects", "add", path]) : true; } },
70
- ...loadProjects().map((p) => ({ label: `Remove ${tilde(p.path)}`, hint: `npx worktrust remote projects remove ${tilde(p.path)}`, run: () => runShown(term, io, ["remote", "projects", "remove", p.path]) })),
69
+ { label: "+ Add a project folder…", hint: "npx worktrust remote projects add <folder>", info: "Opens the system's folder picker; a phone may then steer an agent in the folder you choose.", run: async () => { const path = await chooseFolder(term); term.enter(); return path ? runShown(term, io, ["remote", "projects", "add", path]) : true; } },
70
+ ...loadProjects().map((p) => ({ label: `Remove ${tilde(p.path)}`, hint: `npx worktrust remote projects remove ${tilde(p.path)}`, info: "Takes this folder off the list; a phone can no longer start an agent in it. No file is touched.", run: () => runShown(term, io, ["remote", "projects", "remove", p.path]) })),
71
71
  BACK,
72
72
  ]);
73
73
  }
@@ -75,14 +75,14 @@ function projectsMenu(term, io, header) {
75
75
  function modesMenu(term, io, header) {
76
76
  return level(term, header, "Agent modes a phone may start here", () => {
77
77
  const allowed = allowedModes(loadSettings());
78
- const toggle = (mode, words) => ({ label: `${words}: ${allowed.includes(mode) ? "allowed" : "not allowed"}`, hint: `npx worktrust remote modes ${allowed.includes(mode) ? "deny" : "allow"} ${mode}${mode === "auto" ? " allowing auto allows edit too" : ""}`,
78
+ const toggle = (mode, words) => ({ label: `${words}: ${allowed.includes(mode) ? "allowed" : "not allowed"}`, hint: `npx worktrust remote modes ${allowed.includes(mode) ? "deny" : "allow"} ${mode}`, info: allowed.includes(mode) ? `Stops a phone from starting an agent in this mode${mode === "edit" ? "; auto goes with it" : ""}.` : `Lets a phone start an agent in this mode${mode === "auto" ? "; allowing auto allows edit too" : ""}.`,
79
79
  run: () => runShown(term, io, ["remote", "modes", allowed.includes(mode) ? "deny" : "allow", mode]) });
80
80
  return [
81
- { label: "Manual (asks for every change): always allowed", disabled: true },
82
- { label: "Plan (read-only): always allowed", disabled: true },
81
+ { label: "Manual (asks for every change): always allowed", info: "Always there: the agent asks you before every change.", disabled: true },
82
+ { label: "Plan (read-only): always allowed", info: "Always there: the agent reads and plans, and changes nothing.", disabled: true },
83
83
  toggle("edit", "Edit automatically"),
84
84
  toggle("auto", "Auto (the agent's own automatic mode)"),
85
- { label: "Status", hint: "npx worktrust remote modes status", run: () => runShown(term, io, ["remote", "modes", "status"]) },
85
+ { label: "Status", hint: "npx worktrust remote modes status", info: "Shows which modes a phone may start here. It only reads.", run: () => runShown(term, io, ["remote", "modes", "status"]) },
86
86
  BACK,
87
87
  ];
88
88
  });
@@ -92,10 +92,10 @@ function connectionsMenu(term, io, header) {
92
92
  return level(term, header, "Connections to this computer", () => {
93
93
  const list = connections();
94
94
  return [
95
- { label: "List them", hint: "npx worktrust remote connections", run: () => runShown(term, io, ["remote", "connections"]) },
96
- ...list.filter((c) => c.state === "pending").map((c) => ({ label: `Confirm ${c.name} (pending)`, hint: `npx worktrust remote phones confirm ${c.fingerprint}`, run: () => runShown(term, io, ["remote", "phones", "confirm", c.fingerprint]) })),
97
- ...list.map((c) => ({ label: `${c.name} · ${c.kind} · ${c.fingerprint}`, hint: `npx worktrust remote disconnect ${c.n} Enter: disconnect (asks twice)`, run: () => runShown(term, io, ["remote", "disconnect", c.fingerprint]) })),
98
- ...(list.length > 0 ? [{ label: "Close all connections", hint: "npx worktrust remote disconnect --all type close all to confirm", run: () => runShown(term, io, ["remote", "disconnect", "--all"]) }] : []),
95
+ { label: "List them", hint: "npx worktrust remote connections", info: "Shows every phone and browser linked to this computer. It only reads.", run: () => runShown(term, io, ["remote", "connections"]) },
96
+ ...list.filter((c) => c.state === "pending").map((c) => ({ label: `Confirm ${c.name} (pending)`, hint: `npx worktrust remote phones confirm ${c.fingerprint}`, info: "Confirms this pending link, so it may steer agents here. Check the fingerprint on the device first.", run: () => runShown(term, io, ["remote", "phones", "confirm", c.fingerprint]) })),
97
+ ...list.map((c) => ({ label: `${c.name} · ${c.kind} · ${c.fingerprint}`, hint: `npx worktrust remote disconnect ${c.n}`, info: "Closes this connection; that device has to be linked again to come back. It asks twice.", run: () => runShown(term, io, ["remote", "disconnect", c.fingerprint]) })),
98
+ ...(list.length > 0 ? [{ label: "Close all connections", hint: "npx worktrust remote disconnect --all", info: "Closes every connection to this computer. You type close all to confirm.", run: () => runShown(term, io, ["remote", "disconnect", "--all"]) }] : []),
99
99
  BACK,
100
100
  ];
101
101
  });
@@ -105,22 +105,22 @@ function connectionsMenu(term, io, header) {
105
105
  export function remoteMenu(term, io, header) {
106
106
  return level(term, header, "Remote Agent", () => {
107
107
  const approved = Boolean(loadIdentity()), settings = loadSettings();
108
- const approveMenu = { label: approved ? "Approved ✓ · approve again ›" : "Approve this computer ›", hint: approved ? "npx worktrust remote app --repair new keys for this computer" : "npx worktrust remote app | web",
108
+ const approveMenu = { label: approved ? "Approved ✓ · approve again ›" : "Approve this computer ›", hint: approved ? "npx worktrust remote app --repair" : "npx worktrust remote app | web", info: approved ? "Opens the two ways to approve this computer again; that gives it new keys, and linked phones link again." : "Opens the two ways to approve this computer for Remote Agent. Nothing changes yet.",
109
109
  run: () => level(term, header, approved ? "Approve this computer again (new keys)" : "Approve this computer", () => [
110
- { label: "With the WorkTrust app", hint: `npx worktrust remote app${approved ? " --repair" : ""} a QR here, approved on your phone`, run: () => runShown(term, io, ["remote", "app", ...(approved ? ["--repair"] : [])]) },
111
- { label: "In the browser", hint: `npx worktrust remote web${approved ? " --repair" : ""}`, run: () => runShown(term, io, ["remote", "web", ...(approved ? ["--repair"] : [])]) },
110
+ { label: "With the WorkTrust app", hint: `npx worktrust remote app${approved ? " --repair" : ""}`, info: "Shows a QR here; you scan it with the WorkTrust app and approve this computer on your phone.", run: () => runShown(term, io, ["remote", "app", ...(approved ? ["--repair"] : [])]) },
111
+ { label: "In the browser", hint: `npx worktrust remote web${approved ? " --repair" : ""}`, info: "Opens WorkTrust in your browser, where you approve this computer.", run: () => runShown(term, io, ["remote", "web", ...(approved ? ["--repair"] : [])]) },
112
112
  BACK,
113
113
  ]) };
114
- const link = { label: "Link a phone (QR here)", hint: "npx worktrust remote pair", run: () => runShown(term, io, ["remote", "pair"]) };
114
+ const link = { label: "Link a phone (QR here)", hint: "npx worktrust remote pair", info: "Shows a QR here; scanning it with the WorkTrust app links that phone to this computer.", run: () => runShown(term, io, ["remote", "pair"]) };
115
115
  const paused = settings.paused !== null;
116
116
  return [
117
117
  ...(approved ? [link, approveMenu] : [approveMenu, link]),
118
- { label: "Projects ›", hint: "npx worktrust remote projects", run: () => projectsMenu(term, io, header) },
119
- { label: "Roots for new projects ›", hint: "npx worktrust remote roots", run: () => rootsMenu(term, io, header) },
120
- { label: "Allowed modes ›", hint: "npx worktrust remote modes", run: () => modesMenu(term, io, header) },
121
- { label: "Connections ›", hint: "npx worktrust remote connections", run: () => connectionsMenu(term, io, header) },
122
- { label: paused ? "Resume" : "Pause", hint: `npx worktrust remote ${paused ? "resume" : "pause"}`, run: () => runShown(term, io, ["remote", paused ? "resume" : "pause"]) },
123
- { label: "Status", hint: "npx worktrust remote status", run: () => runShown(term, io, ["remote", "status"]) },
118
+ { label: "Projects ›", hint: "npx worktrust remote projects", info: "Opens the folders a phone may steer an agent in, to add or remove one.", run: () => projectsMenu(term, io, header) },
119
+ { label: "Roots for new projects ›", hint: "npx worktrust remote roots", info: "Opens the folders whose projects a phone may open, and where it may create new ones.", run: () => rootsMenu(term, io, header) },
120
+ { label: "Allowed modes ›", hint: "npx worktrust remote modes", info: "Opens the agent modes a phone may start here: this computer is the ceiling.", run: () => modesMenu(term, io, header) },
121
+ { label: "Connections ›", hint: "npx worktrust remote connections", info: "Opens the phones and browsers linked here, to confirm or close one.", run: () => connectionsMenu(term, io, header) },
122
+ { label: paused ? "Resume" : "Pause", hint: `npx worktrust remote ${paused ? "resume" : "pause"}`, info: paused ? "Lets linked phones steer agents here again." : "Stops every phone from steering agents here until you resume; links and settings stay.", run: () => runShown(term, io, ["remote", paused ? "resume" : "pause"]) },
123
+ { label: "Status", hint: "npx worktrust remote status", info: "Shows whether Remote Agent is on, its service and what is linked. It only reads.", run: () => runShown(term, io, ["remote", "status"]) },
124
124
  BACK,
125
125
  ];
126
126
  });
@@ -128,21 +128,21 @@ export function remoteMenu(term, io, header) {
128
128
 
129
129
  export function historyMenu(term, io, header) {
130
130
  return level(term, header, "Import earlier history", () => [
131
- { label: "This computer's earlier sessions", hint: "npx worktrust history shows the plan, asks first", run: () => runShown(term, io, ["history"]) },
132
- { label: "From your local archive", hint: "npx worktrust history --from-archive", run: () => runShown(term, io, ["history", "--from-archive"]) },
133
- { label: "From a ChatGPT or Claude export…", hint: "npx worktrust history --export <path> reconstructed, never verified hours", run: async () => { const path = await typed(term, "The export's path (the zip, its folder or conversations.json):", join(homedir(), "Downloads")); term.enter(); return path ? runShown(term, io, ["history", "--export", path]) : true; } },
134
- { label: "From a copied session folder…", hint: "npx worktrust history --from-folder <dir>", run: async () => { const path = await chooseFolder(term); term.enter(); return path ? runShown(term, io, ["history", "--from-folder", path]) : true; } },
131
+ { label: "This computer's earlier sessions", hint: "npx worktrust history", info: "Sends the sessions your AI apps still hold here as history. It shows the plan and asks first.", run: () => runShown(term, io, ["history"]) },
132
+ { label: "From your local archive", hint: "npx worktrust history --from-archive", info: "Sends what your local archive holds of sessions your AI apps already deleted. It shows the plan and asks first.", run: () => runShown(term, io, ["history", "--from-archive"]) },
133
+ { label: "From a ChatGPT or Claude export…", hint: "npx worktrust history --export <path>", info: "Asks for the export's path, then shows the plan and asks. These hours are reconstructed, never verified hours.", run: async () => { const path = await typed(term, "The export's path (the zip, its folder or conversations.json):", join(homedir(), "Downloads")); term.enter(); return path ? runShown(term, io, ["history", "--export", path]) : true; } },
134
+ { label: "From a copied session folder…", hint: "npx worktrust history --from-folder <dir>", info: "Opens the folder picker for your own copy of a session folder, then shows the plan and asks. Reconstructed hours.", run: async () => { const path = await chooseFolder(term); term.enter(); return path ? runShown(term, io, ["history", "--from-folder", path]) : true; } },
135
135
  BACK,
136
136
  ]);
137
137
  }
138
138
 
139
139
  export function preserveMenu(term, io, header) {
140
140
  return level(term, header, "Preserve evidence", () => [
141
- { label: "How long each AI app keeps its sessions", hint: "npx worktrust preserve local only", run: () => runShown(term, io, ["preserve"]) },
142
- { label: "Keep them longer", hint: "npx worktrust preserve --apply asks per change", run: () => runShown(term, io, ["preserve", "--apply"]) },
143
- { label: "Make a local archive", hint: "npx worktrust preserve --archive", run: () => runShown(term, io, ["preserve", "--archive"]) },
144
- { label: "Check the archive", hint: "npx worktrust preserve --verify", run: () => runShown(term, io, ["preserve", "--verify"]) },
145
- { label: "Count hours from the archive", hint: "npx worktrust preserve --summary", run: () => runShown(term, io, ["preserve", "--summary"]) },
141
+ { label: "How long each AI app keeps its sessions", hint: "npx worktrust preserve", info: "Shows a report of how long each AI app here keeps its sessions. Nothing is changed or sent.", run: () => runShown(term, io, ["preserve"]) },
142
+ { label: "Keep them longer", hint: "npx worktrust preserve --apply", info: "Sets your AI apps to keep their sessions longer. It asks per change and backs each file up first.", run: () => runShown(term, io, ["preserve", "--apply"]) },
143
+ { label: "Make a local archive", hint: "npx worktrust preserve --archive", info: "Writes a metadata-only, hash-chained record of the measured days to ~/AI-Evidence. Nothing is sent.", run: () => runShown(term, io, ["preserve", "--archive"]) },
144
+ { label: "Check the archive", hint: "npx worktrust preserve --verify", info: "Checks that record: every hash, the chain, each day's root and signature. It only reads.", run: () => runShown(term, io, ["preserve", "--verify"]) },
145
+ { label: "Count hours from the archive", hint: "npx worktrust preserve --summary", info: "Counts hours, tokens per model and parallel sessions from that record. It only reads.", run: () => runShown(term, io, ["preserve", "--summary"]) },
146
146
  BACK,
147
147
  ]);
148
148
  }
package/cli-menu.mjs CHANGED
@@ -8,59 +8,111 @@
8
8
  * Each item runs the direct command it shows in its muted line, as a child of this CLI with the terminal handed over
9
9
  * (io.runCli), so people learn the short form and every command keeps its own questions and its own guards. Keys: ↑/↓
10
10
  * move, Enter opens, Esc or ← goes back one level, q quits from the top, 1 to 9 jump, Ctrl+C quits. Raw mode and the
11
- * cursor are restored on every way out (quit, Ctrl+C, an error). NO_COLOR is respected.
11
+ * cursor are restored on every way out (quit, Ctrl+C, an error).
12
+ *
13
+ * 0.11.8 (owner, 2026-11-13): Update comes first and says whether there is something to update; every item carries one plain
14
+ * sentence under it; the menu is redrawn IN PLACE (createTerminal) and never left in the scrollback; colours carry meaning
15
+ * and are off wherever cli-colour.mjs says so (NO_COLOR, --no-color, a pipe). A terminal without cursor addressing
16
+ * (TERM=dumb) gets no menu: the bare command runs as it always did.
12
17
  */
13
18
  import { emitKeypressEvents } from "node:readline";
14
19
  import { createInterface } from "node:readline/promises";
20
+ import { busyWith, clip, coloursFor, visibleLength } from "./cli-colour.mjs";
15
21
  import { loadIdentity, loadSettings } from "./remote-store.mjs";
16
22
 
17
23
  /** Whether bare `npx worktrust` opens the menu here. Pure: the caller passes what it knows. */
18
- export function menuWanted({ args = [], env = {}, stdinTTY = false, stdoutTTY = false, agentShell = null } = {}) {
24
+ export function menuWanted({ args: given = [], env = {}, stdinTTY = false, stdoutTTY = false, agentShell = null } = {}) {
25
+ const args = given.filter((arg) => arg !== "--no-color" && arg !== "--no-colour"); // how it looks, not what it does
19
26
  if (args.length !== 0 || !stdinTTY || !stdoutTTY || agentShell) return false;
20
27
  if (env.WORKTRUST_MENU === "off" || env.WORKTRUST_RELAYED === "1" || env.WORKTRUST_HOOK_INPUT || env.WORKTRUST_MCP_TOKEN) return false;
28
+ if (env.TERM === "dumb") return false; // no cursor addressing: the menu could only be printed again and again
21
29
  return true;
22
30
  }
23
31
 
24
- const colour = () => !process.env.NO_COLOR && process.env.TERM !== "dumb";
25
- const paint = (code, text) => (colour() ? `\x1b[${code}m${text}\x1b[0m` : text);
26
- export const muted = (text) => paint("2", text);
27
- const strong = (text) => paint("1", text);
28
- const chosen = (text) => (colour() ? `\x1b[7m${text}\x1b[0m` : `> ${text}`);
32
+ /** The menu's painters: by this process's own terminal, environment and arguments (cli-colour.mjs colourWanted). */
33
+ let paint = coloursFor(process.stdout);
34
+ export const muted = (text) => paint.dim(text);
29
35
 
30
- /** The terminal, in raw mode while a list waits for a key; restore() always puts it back. */
36
+ /**
37
+ * The terminal, in raw mode while a list waits for a key; restore() always puts it back.
38
+ *
39
+ * THE MENU IS REDRAWN IN PLACE (0.11.8, owner 2026-11-13: the whole menu stood four times in the scrollback before the chosen
40
+ * command ran). 0.11.7 cleared the screen for every redraw, and a terminal keeps a cleared screen in its scrollback: each arrow
41
+ * key and each return from a command left one more copy. Now draw() remembers how many lines the menu took and the next
42
+ * draw goes the cursor up that many, clears to the end of the screen and writes the new lines, in ONE write (no flicker).
43
+ * erase() takes the menu's own lines away before anything else speaks (a command's output, a question), so what stays in
44
+ * the scrollback is what happened, never a menu. A resize cannot trust the count (lines may have wrapped): reset() clears
45
+ * the visible screen once and the menu is drawn once. No line ever wraps: draw() cuts each to the terminal's width.
46
+ */
31
47
  export function createTerminal(input = process.stdin, output = process.stdout) {
32
- let raw = false;
33
- const write = (text) => output.write(text);
34
- const enter = () => { emitKeypressEvents(input); if (input.isTTY && !raw) { input.setRawMode(true); raw = true; } input.resume(); write("\x1b[?25l"); };
35
- const restore = () => { if (input.isTTY && raw) { try { input.setRawMode(false); } catch { /* gone */ } raw = false; } input.pause(); write("\x1b[?25h"); };
48
+ let raw = false, drawn = 0;
49
+ const size = () => ({ columns: output.columns || 80, rows: output.rows || 24 });
50
+ const up = () => (drawn > 0 ? `\x1b[${drawn}A\r\x1b[J` : "");
51
+ const draw = (lines) => { const { columns } = size(); output.write(`${up()}${lines.map((line) => clip(line, columns - 1)).join("\n")}\n`); drawn = lines.length; };
52
+ const erase = () => { if (drawn > 0) output.write(up()); drawn = 0; };
53
+ const reset = () => { output.write("\x1b[H\x1b[J"); drawn = 0; };
54
+ /** Text that is not the menu (a reason, a result): the menu's lines go first, and the next draw starts below it. */
55
+ const write = (text) => { erase(); output.write(text); };
56
+ const enter = () => { emitKeypressEvents(input); if (input.isTTY && !raw) { input.setRawMode(true); raw = true; } input.resume(); output.write("\x1b[?25l"); };
57
+ const restore = () => { if (input.isTTY && raw) { try { input.setRawMode(false); } catch { /* gone */ } raw = false; } input.pause(); output.write("\x1b[?25h"); };
58
+ /** The next key, or { name: "resize" } once the terminal's size has settled (many resize events, one answer). */
36
59
  const key = () => new Promise((resolve) => {
37
- const on = (str, k = {}) => { input.off("keypress", on); resolve({ str, name: k.name ?? str, ctrl: Boolean(k.ctrl) }); };
38
- input.on("keypress", on);
60
+ let timer = null;
61
+ const done = (value) => { input.off("keypress", onKey); output.off?.("resize", onResize); clearTimeout(timer); resolve(value); };
62
+ const onKey = (str, k = {}) => done({ str, name: k.name ?? str, ctrl: Boolean(k.ctrl) });
63
+ const onResize = () => { clearTimeout(timer); timer = setTimeout(() => done({ name: "resize" }), 60); };
64
+ input.on("keypress", onKey);
65
+ output.on?.("resize", onResize);
39
66
  });
40
- return { write, enter, restore, key, clear: () => write(colour() ? "\x1b[2J\x1b[H" : "\n") };
67
+ /** A real key: a resize while "Press any key" stands is not one. */
68
+ const anyKey = async () => { for (;;) { const k = await key(); if (k.name !== "resize") return k; } };
69
+ return { write, draw, erase, reset, size, enter, restore, key, anyKey };
70
+ }
71
+
72
+ /**
73
+ * The lines of one list, as text. Pure: `view` is what choose holds, `columns` and `rows` the terminal's size. Each item is
74
+ * its label with the command it runs dimmed beside it, and under it ONE plain sentence saying what it does and what Enter
75
+ * does (owner, 2026-11-13; folded over two lines where the terminal is narrow). The chosen item is marked by `>` and by its ground, never by colour alone. A list taller than
76
+ * the terminal first keeps the sentence for the chosen item only, then shows the items around it: a menu taller than the
77
+ * screen could not be redrawn in place.
78
+ */
79
+ export function menuFrame({ header = [], title = null, items, at = 0, ticked = new Set(), multi = false, top = false, footer = null }, { rows = 24, columns = 100, p = paint } = {}) {
80
+ const head = [...header, ...(title ? ["", ` ${p.bold(title)}`] : []), ""];
81
+ const foot = ["", ` ${p.dim(footer ?? (multi ? "↑/↓ move · Space tick · Enter confirm · Esc back" : `↑/↓ move · Enter open · ${top ? "q quit" : "Esc back"} · 1-9 jump`))}`];
82
+ const room = Math.max(3, rows - 1 - head.length - foot.length);
83
+ const box = (item) => (multi && item.tick ? `[${ticked.has(item.label) ? "x" : " "}] ` : "");
84
+ const named = (item) => `${box(item)}${item.label}${item.note ? ` · ${item.note.text}` : ""}`;
85
+ // The commands stand in one column beside the names (a name longer than 44 pushes only its own command).
86
+ const column = Math.min(44, Math.max(0, ...items.filter((item) => item.hint).map((item) => visibleLength(named(item)))));
87
+ const line = (item, i) => {
88
+ const label = ` ${i < 9 ? i + 1 : " "} ${box(item)}${item.label} `;
89
+ const note = item.note ? `· ${p[item.note.tone]?.(item.note.text) ?? item.note.text}` : "";
90
+ const name = i === at ? p.inverse(label) : item.disabled ? p.dim(label) : p.bold(label);
91
+ return `${i === at ? ">" : " "} ${name}${note}${item.hint ? `${" ".repeat(Math.max(0, column - visibleLength(named(item))) + 3)}${p.dim(item.hint)}` : ""}`;
92
+ };
93
+ // The sentence, on a narrow terminal over two lines at most: folded at a space, never cut by the terminal itself.
94
+ const fold = (text, width) => { if (text.length <= width) return [text]; const cut = text.lastIndexOf(" ", width); return cut < 20 ? [text] : [text.slice(0, cut), text.slice(cut + 1)]; };
95
+ const about = (item) => (item.info ? fold(item.info, Math.max(30, columns - 9)).map((part) => ` ${part}`) : []);
96
+ const all = items.map((item, i) => ({ i, lines: [line(item, i), ...about(item)] }));
97
+ if (all.reduce((n, entry) => n + entry.lines.length, 0) <= room) return [...head, ...all.flatMap((entry) => entry.lines), ...foot];
98
+ const short = items.map((item, i) => (i === at ? [line(item, i), ...about(item)] : [line(item, i)]));
99
+ if (items.length + 2 <= room) return [...head, ...short.flat(), ...foot];
100
+ const span = Math.max(1, room - 4), from = Math.max(0, Math.min(at - Math.floor(span / 2), items.length - span));
101
+ return [...head, ` ${p.dim(from > 0 ? "↑ more" : "")}`, ...short.slice(from, from + span).flat(), ` ${p.dim(from + span < items.length ? "↓ more" : "")}`, ...foot];
41
102
  }
42
103
 
43
104
  /**
44
105
  * One list: → { item } (Enter or a digit), "back" (Esc, ←), "quit" (q at the top, Ctrl+C). `items`: { label, hint?, info?,
45
- * disabled? }. `multi`: Space ticks an item that has `tick: true`; the ticked items come back as `ticked`.
106
+ * note?, disabled? }. `multi`: Space ticks an item that has `tick: true`; the ticked items come back as `ticked`. `header`:
107
+ * the lines, or a function giving them, asked at every draw so a state a command just changed shows at once.
46
108
  */
47
109
  export async function choose(term, { header = [], title, items, top = false, multi = false, footer = null }) {
48
110
  let at = Math.max(0, items.findIndex((i) => !i.disabled));
49
111
  const ticked = new Set(items.filter((i) => i.ticked).map((i) => i.label));
50
112
  for (;;) {
51
- term.clear();
52
- for (const line of header) term.write(`${line}\n`);
53
- if (title) term.write(`\n ${strong(title)}\n`);
54
- term.write("\n");
55
- items.forEach((item, i) => {
56
- const n = i < 9 ? `${i + 1}` : " ";
57
- const box = multi && item.tick ? `[${ticked.has(item.label) ? "x" : " "}] ` : "";
58
- const label = `${n} ${box}${item.label}`;
59
- term.write(` ${i === at ? chosen(` ${label} `) : item.disabled ? muted(` ${label} `) : ` ${label} `}\n`);
60
- if (item.hint) term.write(` ${muted(item.hint)}\n`);
61
- });
62
- term.write(`\n ${muted(footer ?? (multi ? "↑/↓ move · Space tick · Enter confirm · Esc back" : `↑/↓ move · Enter open · ${top ? "q quit" : "Esc back"} · 1-9 jump`))}\n`);
113
+ term.draw(menuFrame({ header: typeof header === "function" ? header() : header, title, items, at, ticked, multi, top, footer }, term.size()));
63
114
  const k = await term.key();
115
+ if (k.name === "resize") { term.reset(); continue; }
64
116
  if (k.ctrl && k.name === "c") return "quit";
65
117
  if (k.name === "up" || k.name === "k") { do at = (at - 1 + items.length) % items.length; while (items[at].disabled); continue; }
66
118
  if (k.name === "down" || k.name === "j") { do at = (at + 1) % items.length; while (items[at].disabled); continue; }
@@ -74,6 +126,7 @@ export async function choose(term, { header = [], title, items, top = false, mul
74
126
 
75
127
  /** A line of text typed at the keyboard (out of raw mode), the default already there to edit; null when left empty. */
76
128
  export async function typed(term, question, value = "") {
129
+ term.erase();
77
130
  term.restore();
78
131
  const prompt = createInterface({ input: process.stdin, output: process.stdout });
79
132
  const answer = prompt.question(` ${question} `);
@@ -86,20 +139,40 @@ export async function typed(term, question, value = "") {
86
139
  /** While a command runs, Ctrl+C is the command's (it reaches the child too); the menu stays. */
87
140
  let busy = false;
88
141
 
89
- /** Run one direct command with the terminal handed over, then wait for a key before the menu comes back. */
142
+ /**
143
+ * Run one direct command with the terminal handed over, then wait for a key before the menu comes back. The menu's own
144
+ * lines are taken away first, so the scrollback reads: the command, its output, how it ended. The menu is then drawn once
145
+ * below (the next draw starts fresh).
146
+ */
90
147
  export async function runShown(term, io, args, label = null) {
91
148
  term.restore();
92
149
  busy = true;
93
- term.clear();
94
- process.stdout.write(` ${muted(`› npx worktrust ${args.join(" ")}`.trimEnd())}${label ? ` ${label}` : ""}\n\n`);
150
+ term.write(` ${muted(`› npx worktrust ${args.join(" ")}`.trimEnd())}${label ? ` ${label}` : ""}\n\n`);
95
151
  let code = 1;
96
152
  try { code = await io.runCli(args); } catch { code = 1; } finally { busy = false; }
97
153
  term.enter();
98
- term.write(`\n ${muted(code === 0 ? "Done." : "It ended with a message above.")} ${muted("Press any key for the menu.")}\n`);
99
- const k = await term.key();
154
+ term.write(`\n ${code === 0 ? paint.green("✓ Done.") : paint.yellow("! It ended with a message above.")} ${muted("Press any key for the menu.")}\n`);
155
+ const k = await term.anyKey();
100
156
  return !(k.ctrl && k.name === "c");
101
157
  }
102
158
 
159
+ /** What the Remote Agent item says where this Node has no WebSocket; Enter opens the ways forward (node-guide.mjs). */
160
+ export const REMOTE_NEEDS = "Needs Node 22.4 or later; the Python package bundles one. Enter shows the ways to get there.";
161
+
162
+ const newer = (a, b) => { const x = String(a).split(".").map(Number), y = String(b).split(".").map(Number); for (let i = 0; i < 3; i += 1) if (x[i] !== y[i]) return x[i] > y[i]; return false; };
163
+
164
+ /**
165
+ * What the Update item says beside its name (owner, 2026-11-13), from the state read again after every command, so it is
166
+ * true the moment an update finishes: this computer's installed version behind this CLI's ("0.11.7 → 0.11.8 available"),
167
+ * a newer CLI published than the one running, or "up to date (0.11.8)". Null when this computer is not connected.
168
+ */
169
+ export function updateNote(state) {
170
+ if (!state.connected) return null;
171
+ if (state.installed && newer(state.version, state.installed)) return { text: `${state.installed} → ${state.version} available`, tone: "yellow", behind: "computer" };
172
+ if (state.latest && newer(state.latest, state.version)) return { text: `${state.version} → ${state.latest} available`, tone: "yellow", behind: "cli" };
173
+ return { text: `up to date (${state.version})`, tone: "green", behind: null };
174
+ }
175
+
103
176
  /** The header: the version, a newer one when the check says so, and this computer's state in one line. */
104
177
  export function headerLines(state) {
105
178
  const remote = (() => {
@@ -110,15 +183,45 @@ export function headerLines(state) {
110
183
  } catch { return "unknown"; }
111
184
  })();
112
185
  return [
113
- ` ${strong(`WorkTrust CLI ${state.version}`)}${state.latest ? ` ${paint("33", `a new version is available: ${state.latest}`)}` : ""}`,
186
+ ` ${paint.bold(`WorkTrust CLI ${state.version}`)}${state.latest ? ` ${paint.yellow(`! ${state.latest} is out: quit, then npx -y worktrust@latest`)}` : ""}`,
114
187
  ` ${state.connected ? `Connected as ${state.account ?? "this computer's account (not recorded: run Check this computer)"}` : "Not connected yet"} · Remote Agent ${remote}`,
115
188
  ];
116
189
  }
117
190
 
118
- /** The top of the menu. `io`: { runCli(args) → Promise<code>, state() → { version, latest, account, connected, door } }. */
191
+ /**
192
+ * The top list (owner, 2026-11-13): Update first, then Check, then the rest as before. Pure but for the `run` closures.
193
+ * `open(args)` runs one direct command; `sub` holds the deeper levels.
194
+ */
195
+ export function topItems(state, open = () => true, sub = {}) {
196
+ const door = state.door === "off" ? "Off" : "On";
197
+ const note = updateNote(state);
198
+ const updateInfo = !state.connected ? "Needs a connected computer first: Check this computer connects it."
199
+ : note.behind === "cli" ? `A newer CLI is out. Quit (q) and run npx -y worktrust@latest to get it; Enter here refreshes this computer with ${state.version}.`
200
+ : note.behind === "computer" ? `Brings this computer's hook and AI-app doors from ${state.installed} to ${state.version}; your key and pairing stay.`
201
+ : "Brings this computer's hook and AI-app doors to this version again; your key and pairing stay.";
202
+ return [
203
+ { label: "Update WorkTrust", note, hint: "npx worktrust update", info: updateInfo, run: () => open(["update"]) },
204
+ { label: "Check this computer", hint: "npx worktrust", info: state.connected ? "Shows what is coupled here and finishes what still waits; a change asks first." : "Connects this computer: shows the plan, asks, then you approve it in your browser.", run: () => open([]) },
205
+ // Node before 22.4 has no WebSocket (0.11.8): the item stays, says why, and Enter opens the ways forward, not the levels.
206
+ state.remoteBlocked
207
+ ? { label: "Remote Agent", note: { text: "needs Node 22.4+", tone: "yellow" }, hint: "npx worktrust remote …", info: REMOTE_NEEDS, run: () => open(["remote"]) }
208
+ : { label: "Remote Agent ›", hint: "npx worktrust remote …", info: "Opens the choices for steering this computer's agents from your phone. Nothing changes yet.", run: () => sub.remote?.() },
209
+ { label: "Import earlier history ›", hint: "npx worktrust history …", info: "Opens the ways to send earlier sessions as history. Each one shows its plan and asks first.", run: () => sub.history?.() },
210
+ { label: "Preserve evidence ›", hint: "npx worktrust preserve …", info: "Opens the ways to keep your AI history on this computer. Nothing is sent.", run: () => sub.preserve?.() },
211
+ { label: `WorkTrust in your AI apps: ${door}`, hint: `npx worktrust mcp ${door === "On" ? "off" : "on"}`, info: door === "On" ? "Takes the WorkTrust door out of every AI app here; the session hook keeps measuring your hours." : "Puts the WorkTrust door back in your AI apps, so your AI can log finished work.", run: () => open(["mcp", door === "On" ? "off" : "on"]) },
212
+ { label: "Status", hint: "npx worktrust status", info: "Shows the key, the hook, the door and what this computer measured. It only reads.", run: () => open(["status"]) },
213
+ { label: "Disconnect this computer", hint: "npx worktrust disconnect", info: "Takes WorkTrust out of every AI app here and ends this computer's key. It asks first.", run: () => open(["disconnect"]) },
214
+ { label: "Help · all commands", hint: "npx worktrust help", info: "Lists every command and option. Tip: npx -y worktrust skips npm's own \"Ok to proceed?\" question.", run: () => open(["help"]) },
215
+ { label: "Quit", hint: "q", info: "Leaves the menu. Nothing keeps running.", quit: true },
216
+ ];
217
+ }
218
+
219
+ /** The top of the menu. `io`: { runCli(args) → Promise<code>, state() → { version, installed, latest, account, connected, door } }. */
220
+ // (remoteBlocked is added here: whether this Node lacks the WebSocket Remote Agent needs.)
119
221
  export async function runMenu(io) {
222
+ paint = coloursFor(process.stdout);
120
223
  const term = createTerminal();
121
- const quit = () => { term.restore(); process.stdout.write("\n"); };
224
+ const quit = () => { term.erase(); term.restore(); };
122
225
  const onSignal = () => { if (busy) return; quit(); process.exit(130); };
123
226
  process.on("SIGINT", onSignal);
124
227
  process.on("SIGTERM", onSignal);
@@ -126,21 +229,10 @@ export async function runMenu(io) {
126
229
  term.enter();
127
230
  const { remoteMenu, historyMenu, preserveMenu } = await import("./cli-menu-remote.mjs");
128
231
  for (;;) {
129
- const state = await io.state();
130
- const header = headerLines(state);
131
- const door = state.door === "off" ? "Off" : "On";
132
- const items = [
133
- { label: "Check this computer", hint: state.connected ? "npx worktrust what is coupled here" : "npx worktrust connect this computer", run: () => runShown(term, io, []) },
134
- { label: "Update WorkTrust", hint: "npx worktrust update", run: () => runShown(term, io, ["update"]) },
135
- { label: "Remote Agent ›", hint: "npx worktrust remote …", run: () => remoteMenu(term, io, header) },
136
- { label: "Import earlier history ›", hint: "npx worktrust history …", run: () => historyMenu(term, io, header) },
137
- { label: "Preserve evidence ›", hint: "npx worktrust preserve …", run: () => preserveMenu(term, io, header) },
138
- { label: `WorkTrust in your AI apps: ${door}`, hint: `npx worktrust mcp ${door === "On" ? "off" : "on"} your hours stay measured by the session hook`, run: () => runShown(term, io, ["mcp", door === "On" ? "off" : "on"]) },
139
- { label: "Status", hint: "npx worktrust status", run: () => runShown(term, io, ["status"]) },
140
- { label: "Disconnect this computer", hint: "npx worktrust disconnect asks first", run: () => runShown(term, io, ["disconnect"]) },
141
- { label: "Help · all commands", hint: "npx worktrust help", run: () => runShown(term, io, ["help"]) },
142
- { label: "Quit", hint: "q", quit: true },
143
- ];
232
+ // Read again after every command: the version line and the Update item say the new state the moment an update ends.
233
+ const state = { ...(await busyWith("Reading this computer's state", () => io.state())), remoteBlocked: typeof globalThis.WebSocket !== "function" };
234
+ const header = () => headerLines(state);
235
+ const items = topItems(state, (args) => runShown(term, io, args), { remote: () => remoteMenu(term, io, header), history: () => historyMenu(term, io, header), preserve: () => preserveMenu(term, io, header) });
144
236
  const picked = await choose(term, { header, items, top: true });
145
237
  if (picked === "quit" || picked === "back" || picked.item.quit) break;
146
238
  if ((await picked.item.run()) === false) break;
@@ -1 +1 @@
1
- {"keyId":"608168ccdef72562fc91f9c0f9f2c2d6876bece7f7362cb545b818f7947da6b5","payload":{"files":{"chat-exports.mjs":"f026c5a063f62c22ba6f25474a9d9fdbb6074beebbfe1faff2a876c437a1a000","claude-mod.mjs":"02d86b0cdddf39879efc5194c0a5be6b41456faedec28963dc123a4e88dc3942","cli-menu-remote.mjs":"b7dc18ced2b9cedec5e2263f42265973fcb96b16e34b88ac91e8b53c8be62c68","cli-menu.mjs":"6cf2b7b510bd4c81818885afddb5da0e9c60c4bcdf36280497f7ba3d4ebf30e6","commit-rules.mjs":"e94cc32a5415f6d9e978145ab9505ac4ae0bac9431e6e9104b9b37155260b51f","config-edits.mjs":"527a7674f9d52b284bfda3b8089eb4b930a709bf14aedbec7f6eef1e59ef52ee","count-behaviour.mjs":"06b0ecbc222087160dc64c0b302391631e8e799038364c317c6cd28449c5044d","credential-store.mjs":"a4b3540a61f4ce19e535c7f1d260c0d817686cd066d559a76db2ab108144abba","credential-vault-scripts.mjs":"7e42fe1db3885c2dec6f1de87bebfbefe2292d29179a68f3da87d19eb6c7704b","credential-vault.mjs":"279baabb217e2a3f170e8d7f2b271a88484531f9031c441360ea91561a70da99","export-facts.mjs":"3bbb46c80e8678b5cea7e15dcbfc456a2b48595053241c2b3cea508092f9b917","folder-picker.mjs":"daeb379626d5716f91f588064c6b4083618279320c006c177960cc93f056d96a","git-commits.mjs":"af0ed45a2a42c8e17cabfb3649a2f524dbf80230f8a6ec1c6b775fed7d34dc9c","history-outbox.mjs":"85c70389effc5b4ec9d9b33af9192314e67f47af2752515b42a7959344ce2354","history-progress.mjs":"dcc25ee94b727f2605a763349a4d8764640335d6cf0043fb6108cebeed16dcb9","log-session.mjs":"167fe3718415fe690c9e4f7a3a993520e8c652edcf61184cc14cfec2db67d7bc","orchestration-contract.mjs":"ec08f303a166365b99e70b675de4cfe76c6156c2567e14b5569f6d992f0231b7","orchestration-evidence.mjs":"d0d06cecf0eb08e5c6e653c62a4f45b1eddf2119c2acb8341056b34f488d214a","orchestration-report.mjs":"d4e0a9ad8e4a01b462d22c6b1866aac291565c533ff476085d3367cb6d59bc1b","package-integrity.mjs":"a8210c9494a56bfb9a5ea3d10064c7a269f0b6330c0af7c0700e706c3c0224e3","preserve-lines.mjs":"2df64a69687aa51219bf7b86b88d175cc50990fa29574b31897e41a9ebeecf43","preserve-summary.mjs":"137f781ed7021596a3f0ea67afcf2ab8616ac293f833dbb8f176e838e0ed8321","preserve.mjs":"cd111cae0f53a25a2d878a158479abfb1ace353361454843f91a16d241101d46","project-modes.mjs":"ada26e68297fbeb90e4e91d75a90fd2d7cc107b999a9702840675b5a7529463e","remote-adapter-claude-code.mjs":"6db24891f7b0c56c00b337e52f4d4aeb8c9a0413b3bf46d0fc8a45328ea71b3e","remote-adapter-codex.mjs":"d2fd6c61d9e3c4a45e9b10da1aa3c15d45c86629d6456e4a8d25ad95b13eb209","remote-adapter-opencode.mjs":"ddd7f3ec0b4ba92f4744453d60fda338b63550e3ec7b23fa3acc668df1d64eb7","remote-adapter-terminal.mjs":"9237d3747a25126fcdad42c0eab10e69393754388a6014b30fb0890b9c735888","remote-admin.mjs":"ac4d434c0a374159b27accac3fdd0324ff96ffe32227fba054cc62d00e58d35b","remote-agent-switch.mjs":"7ff5448f29f05a47d7298d730b21243a1bcf8a215b434a0c7fbf5f3cb0889041","remote-approval-bridge.mjs":"092f17b7969e4f35bea064315d04dcde1faa6a3fd3e737dcc05aece82c7a37c4","remote-approvals.mjs":"63847226e398f9eb5b8d3989ba2b2436fbedd898385eb5f2f63bbdf07fbe6852","remote-attachments.mjs":"2e9c1277329a45cf26c0c62abda632cf0ab9fad78d0504416ecee9805220e16c","remote-cdp.mjs":"70e333a1ebe845e872cc3a703a0a507391f8ce59640bdbd662bdad55eeff216b","remote-changes.mjs":"2141fece4961a5bc1bb1b046f78222812617457b1ba6452275eac6a897e62e19","remote-claude-events.mjs":"58822471203c6a1b66cf81c115c4d713657c3dea5c7b98df959f894ee5b2e704","remote-claude-progress.mjs":"2ca626d3dbc16d8d570abe1df6477b7e44ffb43c1d9145228ec5ea1928e415ca","remote-cli.mjs":"33a6194e0653b78cf075edd2aae083179af2ca9aeae190a225aeeabb03a43f67","remote-coalesce.mjs":"cb0967d9cfe81e3892bcade8349d6814db98be8c2adbdb54df0b8d1b142f65d1","remote-codex-events.mjs":"58657d6070a50c837737cb85f5a1eaf9c2cbc4e1adfe3e970748ab3b2af94631","remote-connections.mjs":"e24ff04ed61647e164b6f055d4f691366f3204fe445140afc5f34abbed5d4080","remote-countdown.mjs":"85cf2d01fe5ca49895e08a3d5de346bb5e4a8dd31b9fda3fd9f9534d9e1e47cf","remote-daemon.mjs":"94d4896b0e1203f7a5bc7224a6221a36f4c20be89caee78b3ab37b9b6a2dac1d","remote-endorse.mjs":"89eda4883567176703e01e44d83e987271bc2a6134e108f517b3b213719a21f9","remote-inventory.mjs":"a8245604d41373819738eaf06ec1d2242cb5f7b2e60aa316f31d2f8742b8c70d","remote-journal.mjs":"907ebd48c53162b22dc743ef95b53c1a6be6886a7495605b5cfa820b8de9d330","remote-live-preview.mjs":"faa70f9260ac05037204c2a0c3facf4ffe42f68408948390b341b453a2932289","remote-opencode-events.mjs":"3108375501ead2c2c78bce1435cc2a9fe6d2af1d7ff1fb42e12ff3e0f5d9af9c","remote-opencode-session.mjs":"681b201d833a7d7d025122b3a79663bcdc0a989aefd39d8018a28113d8810caf","remote-pairing.mjs":"d8c2aba394fe73d850ea000c758e6b926c87b122eaf5c6aa92ec1183e90f90e1","remote-pipeline-config.mjs":"00cde6a61ce21144c51ac56fce42fee159aa9dba6586218a7ea790ce4a6bd40b","remote-pipeline-parsers.mjs":"43ca0d332d7bc883c4759a754a555815ae5dfe133446b91ba9f2e48a350fa20f","remote-pipeline.mjs":"b856ead989b29ddb618ef69bbacd104bae2b02c9d1c5214291d08ce469a8b24e","remote-policy.mjs":"16ea015ad5de3c357bce730ea8ea98571dc981d8591fb5156b1941b2c557a381","remote-preview.mjs":"fe504ad6f83dcb4a4ebdcc018686a9a5a900c47cdf8c45b75e7d02e2f3056155","remote-projects.mjs":"ec8c530ad3e880bca21a4d4078ecd68b6aaafcc442b50087127868d952034d5f","remote-protocol.mjs":"93f8c2031895d4e01006a1951d7c0e79ef71b86b2777eed5dfa966ab131e446d","remote-qr.mjs":"b80e2b4a5bc020cf6ed92e91d06b327cb5197de1c35b3445a0fc2c7a3bf1ab3f","remote-release-plans.mjs":"11884a62b7d6dcccb5e154a26603bdf650f7b40f946329fb174d8c13729bec74","remote-releases.mjs":"fb08b72593ea00013c8b679e0c0d7dee95b0fd7cc5fd31b80ac575d0e340927d","remote-run.mjs":"c180c401613e0c01dfc471bb6226ebb035a7299839f81c6e38ff714d75d68c3f","remote-screen-approvals.mjs":"c43ab286d36a38d17639d155782ffa017f1a9b6806a09b82ed0142a1290b6000","remote-screen-push.mjs":"4ee8bd48d24b2c87581e9f33d8354a86381f7febd82f89ed509a7a87c1442608","remote-screen-states.mjs":"7c3c86a584bebf52461f3cab39c05ea2a13910061704d48fc622956e842940f7","remote-service.mjs":"a3a5502e0f6f43b04e37ee778f43d88f4c219776439cfed0d8fa0b511e0c9637","remote-session-list.mjs":"494fdbe20f0542806ac6c42ad149c52e2d3ace23a3a7567f96dc7e80d092c727","remote-sessions.mjs":"1efb7869cef6090cbbeae15ff1e5ffe99dca3742f9c245686d6758bb705587d6","remote-settings.mjs":"ca16f39416a457bd5ceb1df847596e1b4bcd2894310eb6514664a619dee4981f","remote-steered.mjs":"d7afde92c62c87abbdb84b0cfea2eea4752e90a2e453e52a54812c4fe0395190","remote-steering.mjs":"7ba22e6110cea3ac75a4f084f8f92a5bd90c31a19d3ce58a88a0843bdadea834","remote-store.mjs":"7226d006d03788ea2a8de30226ab5f6bf45b1bcbb10ee7d4e28bf2c3cca5a2a7","remote-terminal-cli.mjs":"82a048b75e412d0b6db076afbb84cab7c754dec72b6c8b6af4d4906b38e988a7","remote-terminal-sessions.mjs":"6ab51824890a18768d23cedc499f3840b2b02a8ed651463c1fe2d74dd352a361","remote-transport.mjs":"68650fd77ea09b5762377f87cabdc1c73a34d77324aa5bf0cd9742094a50c32b","runtime-install.mjs":"aab47b52c79d726ef428a24f982c648fa3f1c2dc2b574f633611d02924864e5f","self-update.mjs":"378e3620d48c72cf0bf812be408883b995cdb2223de34a20f762dd73eeffb258","session-databases.mjs":"a16ffbc50ccc0e78f370ebe07f871d1a80f1977472e478e3599e7abfdc90c1b7","session-local-models.mjs":"bacd38ff8dd3056b552982ec52eb57c7b8ca86e1a46cd4cba30fc340e3e28fd4","setup-mcp.mjs":"b732e3dd9b3e522b7cc8acf167ce28ba8f1a8dee797ee15bd7c3b02919b13e6f","stack-rules.mjs":"b23c56e72ec56ba02b17ed895f869172d988c468a697e8d6026b0e268f61e489","stretch-evidence.mjs":"5f5667b92adf11b1a5a6330a0f26dd6db73d56fe60823d9a5246dab71d27d380","transcript-readers.mjs":"e9f20415c2b5d62a09f35a63075002ebd1da56edb32f242d52822d58ecbd8ac3","worktrust-launch.mjs":"84801bd29d472d48188c126b9ebe3989a3132b54e13cc4fe534ff7c383a294ee","worktrust.mjs":"a42bf1c5ad9b74bae6109eb6ac3259ded36c4fd26a4ee72fbf67076e0e849177"},"format":"worktrust-package/1","kind":"engine","version":"0.11.7"},"signature":"2cN0AVHJqNjetQViHZHjJfPeoWSe3C3gU1Va8FD_1F0XjkzVE_vBYul0Acd13Mg5lfmmye7rTCWRcbhIY3KIBw"}
1
+ {"keyId":"608168ccdef72562fc91f9c0f9f2c2d6876bece7f7362cb545b818f7947da6b5","payload":{"files":{"chat-exports.mjs":"f026c5a063f62c22ba6f25474a9d9fdbb6074beebbfe1faff2a876c437a1a000","claude-mod.mjs":"02d86b0cdddf39879efc5194c0a5be6b41456faedec28963dc123a4e88dc3942","cli-colour.mjs":"fa16b61ad179999c5c5365255182acf69bcba1eb5f5ce7b0e1e18c11f56130ae","cli-menu-remote.mjs":"6477b3c6986290a9ac70f1f7310abcc0415dfbe9e08f412c48dd41b60c4b6c44","cli-menu.mjs":"566a8cb60a050a506101b2900358d31c05907d66565ff194cd8efe9039e04ca5","commit-rules.mjs":"e94cc32a5415f6d9e978145ab9505ac4ae0bac9431e6e9104b9b37155260b51f","config-edits.mjs":"527a7674f9d52b284bfda3b8089eb4b930a709bf14aedbec7f6eef1e59ef52ee","count-behaviour.mjs":"06b0ecbc222087160dc64c0b302391631e8e799038364c317c6cd28449c5044d","credential-store.mjs":"a4b3540a61f4ce19e535c7f1d260c0d817686cd066d559a76db2ab108144abba","credential-vault-scripts.mjs":"7e42fe1db3885c2dec6f1de87bebfbefe2292d29179a68f3da87d19eb6c7704b","credential-vault.mjs":"279baabb217e2a3f170e8d7f2b271a88484531f9031c441360ea91561a70da99","export-facts.mjs":"3bbb46c80e8678b5cea7e15dcbfc456a2b48595053241c2b3cea508092f9b917","folder-picker.mjs":"daeb379626d5716f91f588064c6b4083618279320c006c177960cc93f056d96a","git-commits.mjs":"af0ed45a2a42c8e17cabfb3649a2f524dbf80230f8a6ec1c6b775fed7d34dc9c","history-outbox.mjs":"85c70389effc5b4ec9d9b33af9192314e67f47af2752515b42a7959344ce2354","history-progress.mjs":"dcc25ee94b727f2605a763349a4d8764640335d6cf0043fb6108cebeed16dcb9","log-session.mjs":"167fe3718415fe690c9e4f7a3a993520e8c652edcf61184cc14cfec2db67d7bc","node-guide.mjs":"5bf52c5028b07a80ec4d41be365eb025dfce74328f41f928a26ce6737b1f9cc4","orchestration-contract.mjs":"ec08f303a166365b99e70b675de4cfe76c6156c2567e14b5569f6d992f0231b7","orchestration-evidence.mjs":"d0d06cecf0eb08e5c6e653c62a4f45b1eddf2119c2acb8341056b34f488d214a","orchestration-report.mjs":"d4e0a9ad8e4a01b462d22c6b1866aac291565c533ff476085d3367cb6d59bc1b","package-integrity.mjs":"a8210c9494a56bfb9a5ea3d10064c7a269f0b6330c0af7c0700e706c3c0224e3","preserve-lines.mjs":"2df64a69687aa51219bf7b86b88d175cc50990fa29574b31897e41a9ebeecf43","preserve-summary.mjs":"137f781ed7021596a3f0ea67afcf2ab8616ac293f833dbb8f176e838e0ed8321","preserve.mjs":"cd111cae0f53a25a2d878a158479abfb1ace353361454843f91a16d241101d46","project-modes.mjs":"ada26e68297fbeb90e4e91d75a90fd2d7cc107b999a9702840675b5a7529463e","remote-adapter-claude-code.mjs":"6db24891f7b0c56c00b337e52f4d4aeb8c9a0413b3bf46d0fc8a45328ea71b3e","remote-adapter-codex.mjs":"d2fd6c61d9e3c4a45e9b10da1aa3c15d45c86629d6456e4a8d25ad95b13eb209","remote-adapter-opencode.mjs":"ddd7f3ec0b4ba92f4744453d60fda338b63550e3ec7b23fa3acc668df1d64eb7","remote-adapter-terminal.mjs":"9237d3747a25126fcdad42c0eab10e69393754388a6014b30fb0890b9c735888","remote-admin.mjs":"ac4d434c0a374159b27accac3fdd0324ff96ffe32227fba054cc62d00e58d35b","remote-agent-switch.mjs":"7ff5448f29f05a47d7298d730b21243a1bcf8a215b434a0c7fbf5f3cb0889041","remote-approval-bridge.mjs":"092f17b7969e4f35bea064315d04dcde1faa6a3fd3e737dcc05aece82c7a37c4","remote-approvals.mjs":"63847226e398f9eb5b8d3989ba2b2436fbedd898385eb5f2f63bbdf07fbe6852","remote-attachments.mjs":"2e9c1277329a45cf26c0c62abda632cf0ab9fad78d0504416ecee9805220e16c","remote-cdp.mjs":"70e333a1ebe845e872cc3a703a0a507391f8ce59640bdbd662bdad55eeff216b","remote-changes.mjs":"2141fece4961a5bc1bb1b046f78222812617457b1ba6452275eac6a897e62e19","remote-claude-events.mjs":"58822471203c6a1b66cf81c115c4d713657c3dea5c7b98df959f894ee5b2e704","remote-claude-progress.mjs":"2ca626d3dbc16d8d570abe1df6477b7e44ffb43c1d9145228ec5ea1928e415ca","remote-cli.mjs":"651a7f16e7475029985007ea97f4b838f8378ab620d3f3c2ab718da155fce94d","remote-coalesce.mjs":"cb0967d9cfe81e3892bcade8349d6814db98be8c2adbdb54df0b8d1b142f65d1","remote-codex-events.mjs":"58657d6070a50c837737cb85f5a1eaf9c2cbc4e1adfe3e970748ab3b2af94631","remote-connections.mjs":"e24ff04ed61647e164b6f055d4f691366f3204fe445140afc5f34abbed5d4080","remote-countdown.mjs":"85cf2d01fe5ca49895e08a3d5de346bb5e4a8dd31b9fda3fd9f9534d9e1e47cf","remote-daemon.mjs":"94d4896b0e1203f7a5bc7224a6221a36f4c20be89caee78b3ab37b9b6a2dac1d","remote-endorse.mjs":"89eda4883567176703e01e44d83e987271bc2a6134e108f517b3b213719a21f9","remote-inventory.mjs":"a8245604d41373819738eaf06ec1d2242cb5f7b2e60aa316f31d2f8742b8c70d","remote-journal.mjs":"907ebd48c53162b22dc743ef95b53c1a6be6886a7495605b5cfa820b8de9d330","remote-live-preview.mjs":"faa70f9260ac05037204c2a0c3facf4ffe42f68408948390b341b453a2932289","remote-opencode-events.mjs":"3108375501ead2c2c78bce1435cc2a9fe6d2af1d7ff1fb42e12ff3e0f5d9af9c","remote-opencode-session.mjs":"681b201d833a7d7d025122b3a79663bcdc0a989aefd39d8018a28113d8810caf","remote-pairing.mjs":"d8c2aba394fe73d850ea000c758e6b926c87b122eaf5c6aa92ec1183e90f90e1","remote-pipeline-config.mjs":"00cde6a61ce21144c51ac56fce42fee159aa9dba6586218a7ea790ce4a6bd40b","remote-pipeline-parsers.mjs":"43ca0d332d7bc883c4759a754a555815ae5dfe133446b91ba9f2e48a350fa20f","remote-pipeline.mjs":"b856ead989b29ddb618ef69bbacd104bae2b02c9d1c5214291d08ce469a8b24e","remote-policy.mjs":"16ea015ad5de3c357bce730ea8ea98571dc981d8591fb5156b1941b2c557a381","remote-preview.mjs":"fe504ad6f83dcb4a4ebdcc018686a9a5a900c47cdf8c45b75e7d02e2f3056155","remote-projects.mjs":"ec8c530ad3e880bca21a4d4078ecd68b6aaafcc442b50087127868d952034d5f","remote-protocol.mjs":"93f8c2031895d4e01006a1951d7c0e79ef71b86b2777eed5dfa966ab131e446d","remote-qr.mjs":"b80e2b4a5bc020cf6ed92e91d06b327cb5197de1c35b3445a0fc2c7a3bf1ab3f","remote-release-plans.mjs":"11884a62b7d6dcccb5e154a26603bdf650f7b40f946329fb174d8c13729bec74","remote-releases.mjs":"fb08b72593ea00013c8b679e0c0d7dee95b0fd7cc5fd31b80ac575d0e340927d","remote-run.mjs":"c180c401613e0c01dfc471bb6226ebb035a7299839f81c6e38ff714d75d68c3f","remote-screen-approvals.mjs":"c43ab286d36a38d17639d155782ffa017f1a9b6806a09b82ed0142a1290b6000","remote-screen-push.mjs":"4ee8bd48d24b2c87581e9f33d8354a86381f7febd82f89ed509a7a87c1442608","remote-screen-states.mjs":"7c3c86a584bebf52461f3cab39c05ea2a13910061704d48fc622956e842940f7","remote-service.mjs":"a3a5502e0f6f43b04e37ee778f43d88f4c219776439cfed0d8fa0b511e0c9637","remote-session-list.mjs":"494fdbe20f0542806ac6c42ad149c52e2d3ace23a3a7567f96dc7e80d092c727","remote-sessions.mjs":"1efb7869cef6090cbbeae15ff1e5ffe99dca3742f9c245686d6758bb705587d6","remote-settings.mjs":"ca16f39416a457bd5ceb1df847596e1b4bcd2894310eb6514664a619dee4981f","remote-steered.mjs":"d7afde92c62c87abbdb84b0cfea2eea4752e90a2e453e52a54812c4fe0395190","remote-steering.mjs":"7ba22e6110cea3ac75a4f084f8f92a5bd90c31a19d3ce58a88a0843bdadea834","remote-store.mjs":"7226d006d03788ea2a8de30226ab5f6bf45b1bcbb10ee7d4e28bf2c3cca5a2a7","remote-terminal-cli.mjs":"82a048b75e412d0b6db076afbb84cab7c754dec72b6c8b6af4d4906b38e988a7","remote-terminal-sessions.mjs":"6ab51824890a18768d23cedc499f3840b2b02a8ed651463c1fe2d74dd352a361","remote-transport.mjs":"68650fd77ea09b5762377f87cabdc1c73a34d77324aa5bf0cd9742094a50c32b","runtime-install.mjs":"aab47b52c79d726ef428a24f982c648fa3f1c2dc2b574f633611d02924864e5f","self-update.mjs":"378e3620d48c72cf0bf812be408883b995cdb2223de34a20f762dd73eeffb258","session-databases.mjs":"a16ffbc50ccc0e78f370ebe07f871d1a80f1977472e478e3599e7abfdc90c1b7","session-local-models.mjs":"bacd38ff8dd3056b552982ec52eb57c7b8ca86e1a46cd4cba30fc340e3e28fd4","setup-mcp.mjs":"b732e3dd9b3e522b7cc8acf167ce28ba8f1a8dee797ee15bd7c3b02919b13e6f","stack-rules.mjs":"b23c56e72ec56ba02b17ed895f869172d988c468a697e8d6026b0e268f61e489","stretch-evidence.mjs":"5f5667b92adf11b1a5a6330a0f26dd6db73d56fe60823d9a5246dab71d27d380","transcript-readers.mjs":"e9f20415c2b5d62a09f35a63075002ebd1da56edb32f242d52822d58ecbd8ac3","worktrust-launch.mjs":"84801bd29d472d48188c126b9ebe3989a3132b54e13cc4fe534ff7c383a294ee","worktrust.mjs":"81a0b8f83b5c0bbbd8c4599071585520cb6ad1ebaa2e5824c51bb5f6dd0ab6e8"},"format":"worktrust-package/1","kind":"engine","version":"0.11.8"},"signature":"OQuLPGd_-Uen4RtstQufMNJjjOg7v3NMIm74SPIv8gj9KBPM-Q-GSQ7lFSbKc46oqCQf2ceeMFO3rehwjG2OBA"}