@clipy/cli 0.15.0 → 0.16.0

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.
@@ -0,0 +1,265 @@
1
+ /**
2
+ * Host process probes for Chrome for Clipy's ownership checks: which process
3
+ * listens on a TCP port, what argv a process was launched with, and how to stop
4
+ * one. Ownership is load-bearing (a PID or port can be reused by an unrelated
5
+ * process), so a probe that cannot run says so (`supported: false`) instead of
6
+ * answering "not ours". The caller turns that into an explicit error rather
7
+ * than a misleading "not owned" or, worse, adopting a process it never verified.
8
+ *
9
+ * The probes dispatch on the HOST (`process.platform`), never on a platform
10
+ * argument: they spawn real host tools.
11
+ *
12
+ * macOS / Linux: `lsof` for the listener, `ps` for the command line.
13
+ * Windows: `netstat -ano` for the listener (parsed by shape, not by the
14
+ * localized state word), `Get-CimInstance Win32_Process` for the
15
+ * command line (wmic is deprecated and absent on new installs),
16
+ * `taskkill` for the process tree.
17
+ */
18
+ import { spawnSync } from "node:child_process";
19
+ import { join } from "node:path";
20
+ const PROBE_TIMEOUT_MS = 10_000;
21
+ function systemTool(relative, fallback) {
22
+ const root = process.env.SystemRoot ?? process.env.windir;
23
+ // An absolute System32 path keeps a same-named file on PATH from answering.
24
+ return root ? join(root, "System32", relative) : fallback;
25
+ }
26
+ function run(cmd, args) {
27
+ const result = spawnSync(cmd, args, { encoding: "utf8", timeout: PROBE_TIMEOUT_MS, windowsHide: true });
28
+ if (result.error) {
29
+ const code = result.error.code;
30
+ return { ok: false, reason: code === "ENOENT" ? `\`${cmd}\` is not installed` : `\`${cmd}\` failed: ${result.error.message}` };
31
+ }
32
+ return { ok: true, stdout: result.stdout ?? "", stderr: result.stderr ?? "", status: result.status };
33
+ }
34
+ // ---------------------------------------------------------------------------
35
+ // Listening socket owner
36
+ // ---------------------------------------------------------------------------
37
+ /** The PID listening on `port`, or null when nothing listens there. */
38
+ export function listenerPid(port) {
39
+ if (process.platform === "win32") {
40
+ const out = run(systemTool("netstat.exe", "netstat"), ["-ano"]);
41
+ if (!out.ok)
42
+ return { supported: false, reason: out.reason };
43
+ if (out.status !== 0)
44
+ return { supported: false, reason: `netstat exited with status ${out.status}` };
45
+ return { supported: true, value: parseNetstatListener(out.stdout, port) };
46
+ }
47
+ const out = run("lsof", ["-ti", `tcp:${port}`, "-sTCP:LISTEN"]);
48
+ if (!out.ok)
49
+ return { supported: false, reason: out.reason };
50
+ const pid = Number.parseInt(out.stdout.trim().split("\n")[0] ?? "", 10);
51
+ if (Number.isInteger(pid) && pid > 0)
52
+ return { supported: true, value: pid };
53
+ // lsof exits 1 both for "nothing matched" (silent) and for real errors
54
+ // (a diagnostic on stderr). Its routine "WARNING: can't stat …" lines for
55
+ // unrelated mounts are not errors.
56
+ const diagnostic = out.stderr.split("\n").map((l) => l.trim()).filter((l) => l && !/WARNING/i.test(l));
57
+ if (out.status !== 0 && (out.status !== 1 || diagnostic.length > 0)) {
58
+ return { supported: false, reason: `lsof exited with status ${out.status}${diagnostic[0] ? `: ${diagnostic[0]}` : ""}` };
59
+ }
60
+ return { supported: true, value: null };
61
+ }
62
+ /**
63
+ * Picks the listener for `port` out of `netstat -ano`. The state column is
64
+ * localized ("LISTENING", "ABHÖREN", …), so a row is recognised as a listener
65
+ * by its shape: a TCP socket whose foreign end is port 0 (`0.0.0.0:0`,
66
+ * `[::]:0`). Connected sockets always carry a real foreign port.
67
+ */
68
+ export function parseNetstatListener(output, port) {
69
+ for (const line of output.split(/\r?\n/)) {
70
+ const cols = line.trim().split(/\s+/);
71
+ if (cols.length < 4 || cols[0]?.toUpperCase() !== "TCP")
72
+ continue;
73
+ const local = cols[1] ?? "";
74
+ const foreign = cols[2] ?? "";
75
+ if (portOf(local) !== port || portOf(foreign) !== 0)
76
+ continue;
77
+ const pid = Number.parseInt(cols[cols.length - 1] ?? "", 10);
78
+ if (Number.isInteger(pid) && pid > 0)
79
+ return pid;
80
+ }
81
+ return null;
82
+ }
83
+ function portOf(address) {
84
+ const idx = address.lastIndexOf(":");
85
+ if (idx < 0)
86
+ return null;
87
+ const tail = address.slice(idx + 1);
88
+ return /^\d+$/.test(tail) ? Number(tail) : null;
89
+ }
90
+ export function processArgs(pid) {
91
+ if (process.platform === "win32") {
92
+ // The pid is a validated integer; nothing user-controlled reaches the script.
93
+ if (!Number.isInteger(pid) || pid <= 0)
94
+ return { supported: true, value: null };
95
+ const script = "$ErrorActionPreference='Stop';" +
96
+ "[Console]::OutputEncoding=[System.Text.Encoding]::UTF8;" +
97
+ `$p=Get-CimInstance -ClassName Win32_Process -Filter 'ProcessId=${pid}';` +
98
+ "if($p -and $p.CommandLine){[Console]::Out.Write($p.CommandLine)}";
99
+ const out = run(systemTool(join("WindowsPowerShell", "v1.0", "powershell.exe"), "powershell"), [
100
+ "-NoProfile", "-NonInteractive", "-Command", script,
101
+ ]);
102
+ if (!out.ok)
103
+ return { supported: false, reason: out.reason };
104
+ if (out.status !== 0)
105
+ return { supported: false, reason: `Get-CimInstance Win32_Process exited with status ${out.status}` };
106
+ const line = out.stdout.trim();
107
+ if (!line)
108
+ return unreadable(pid, "its command line is not readable");
109
+ // Tokens compare exactly, so a profile path with spaces (quoted on the
110
+ // command line) still matches the argument we passed to spawn.
111
+ const argv = new Set(splitWindowsCommandLine(line));
112
+ return { supported: true, value: (args) => args.every((arg) => argv.has(arg)) };
113
+ }
114
+ const out = run("ps", ["-ww", "-p", String(pid), "-o", "command="]);
115
+ if (!out.ok)
116
+ return { supported: false, reason: out.reason };
117
+ const command = out.stdout.trim();
118
+ if (out.status !== 0 || !command)
119
+ return unreadable(pid, `ps exited with status ${out.status}`);
120
+ // ps joins argv with spaces, so it cannot be split back unambiguously; match
121
+ // each whole argument (spaces included) bounded by whitespace instead.
122
+ return {
123
+ supported: true,
124
+ value: (args) => args.every((arg) => {
125
+ const escaped = arg.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
126
+ return new RegExp(`(?:^|\\s)${escaped}(?=\\s|$)`).test(command);
127
+ }),
128
+ };
129
+ }
130
+ function unreadable(pid, reason) {
131
+ return processExists(pid)
132
+ ? { supported: false, reason: `pid ${pid} is running but ${reason}` }
133
+ : { supported: true, value: null };
134
+ }
135
+ /**
136
+ * Splits a Windows command line into argv using the MSVC runtime rules that
137
+ * CommandLineToArgvW follows and that libuv's quoting (Node's spawn) targets:
138
+ * the program name ends at the first unquoted whitespace and takes quotes
139
+ * literally around it; afterwards, 2n backslashes before a quote yield n and
140
+ * toggle quoting, 2n+1 yield n plus a literal quote, `""` inside quotes is a
141
+ * literal quote, and backslashes elsewhere are literal.
142
+ */
143
+ export function splitWindowsCommandLine(line) {
144
+ const argv = [];
145
+ let i = 0;
146
+ const n = line.length;
147
+ const isSpace = (ch) => ch === " " || ch === "\t";
148
+ // Program name: no escape processing.
149
+ while (i < n && isSpace(line[i]))
150
+ i++;
151
+ if (i < n) {
152
+ let prog = "";
153
+ let quoted = false;
154
+ for (; i < n; i++) {
155
+ const ch = line[i];
156
+ if (ch === '"')
157
+ quoted = !quoted;
158
+ else if (isSpace(ch) && !quoted)
159
+ break;
160
+ else
161
+ prog += ch;
162
+ }
163
+ argv.push(prog);
164
+ }
165
+ while (i < n) {
166
+ while (i < n && isSpace(line[i]))
167
+ i++;
168
+ if (i >= n)
169
+ break;
170
+ let arg = "";
171
+ let quoted = false;
172
+ while (i < n) {
173
+ const ch = line[i];
174
+ if (ch === "\\") {
175
+ let slashes = 0;
176
+ while (i < n && line[i] === "\\") {
177
+ slashes++;
178
+ i++;
179
+ }
180
+ if (line[i] === '"') {
181
+ arg += "\\".repeat(Math.floor(slashes / 2));
182
+ if (slashes % 2 === 1) {
183
+ arg += '"';
184
+ i++;
185
+ }
186
+ }
187
+ else {
188
+ arg += "\\".repeat(slashes);
189
+ }
190
+ continue;
191
+ }
192
+ if (ch === '"') {
193
+ if (quoted && line[i + 1] === '"') {
194
+ arg += '"';
195
+ i += 2;
196
+ continue;
197
+ }
198
+ quoted = !quoted;
199
+ i++;
200
+ continue;
201
+ }
202
+ if (isSpace(ch) && !quoted)
203
+ break;
204
+ arg += ch;
205
+ i++;
206
+ }
207
+ argv.push(arg);
208
+ }
209
+ return argv;
210
+ }
211
+ // ---------------------------------------------------------------------------
212
+ // Termination
213
+ // ---------------------------------------------------------------------------
214
+ /**
215
+ * Asks a process to exit (`force: false`) or kills it (`force: true`).
216
+ *
217
+ * POSIX: SIGTERM / SIGKILL to the pid, exactly as before.
218
+ * Windows: there are no signals. `process.kill` maps every signal to
219
+ * TerminateProcess on that ONE pid, which hard-kills Chrome's browser process
220
+ * (unflushed profile writes, such as a fresh sign-in, can be lost) and orphans
221
+ * its helpers. A graceful stop is `taskkill` without /F on the browser pid: it
222
+ * posts WM_CLOSE, and Chrome shuts its own helpers down. (Adding /T would aim
223
+ * WM_CLOSE at windowless helpers too, which always "fails".) The escalation is
224
+ * `/T /F`, which takes the whole tree.
225
+ *
226
+ * Throws when the request could not be delivered (no such process, access
227
+ * denied), matching process.kill so callers keep one error path.
228
+ */
229
+ /** Liveness without a signal. On Windows process.kill(pid, 0) opens the process
230
+ * and reports, which is exactly what is wanted here. */
231
+ export function processExists(pid) {
232
+ if (!Number.isInteger(pid) || pid <= 0)
233
+ return false;
234
+ try {
235
+ process.kill(pid, 0);
236
+ return true;
237
+ }
238
+ catch (error) {
239
+ // EPERM: it exists but belongs to someone else.
240
+ return error.code === "EPERM";
241
+ }
242
+ }
243
+ export function terminateProcess(pid, force) {
244
+ if (!Number.isInteger(pid) || pid <= 0)
245
+ throw new Error(`invalid pid ${pid}`);
246
+ if (process.platform !== "win32") {
247
+ process.kill(pid, force ? "SIGKILL" : "SIGTERM");
248
+ return;
249
+ }
250
+ const out = run(systemTool("taskkill.exe", "taskkill"), ["/PID", String(pid), ...(force ? ["/T", "/F"] : [])]);
251
+ if (!out.ok) {
252
+ // No taskkill (a stripped image): TerminateProcess on the pid is still a stop.
253
+ process.kill(pid, "SIGTERM");
254
+ return;
255
+ }
256
+ if (out.status !== 0) {
257
+ // Gone already: report it the way process.kill does (ESRCH).
258
+ if (!processExists(pid))
259
+ throw Object.assign(new Error(`no such process ${pid}`), { code: "ESRCH" });
260
+ // Alive but nothing to close (e.g. mid-startup, no window yet): only /F stops it.
261
+ if (!force)
262
+ return terminateProcess(pid, true);
263
+ throw new Error(`taskkill could not stop pid ${pid} (status ${out.status})`);
264
+ }
265
+ }
package/dist/skill.js CHANGED
@@ -15,7 +15,7 @@ description: Read and create Clipy screen recordings, turn screenshots or tool-n
15
15
 
16
16
  # Clipy — recordings you can read AND make
17
17
 
18
- Written for @clipy/cli + @clipy/mcp 0.15.0 (the two versions move in lockstep). If
18
+ Written for @clipy/cli + @clipy/mcp 0.16.0 (the two versions move in lockstep). If
19
19
  \`clipy --version\` reports older, upgrade first: \`npm i -g @clipy/cli@latest\`.
20
20
 
21
21
  Clipy (clipy.online) is the screen recorder built to be agent-readable. Every
@@ -278,13 +278,29 @@ WHAT must be verified, and WHETHER the target depends on an existing login.
278
278
  real session. Prefer the current agent/browser tool's own WebM/MP4 or
279
279
  screenshots and hand them to \`clipy proof\`. For continuous native proof,
280
280
  use \`clipy sources --json\`, select the exact Chrome/app window, and record
281
- its starting screen area with \`--source mac-screen --window <exact-id>\`.
282
- - **Interactive Windows/Linux desktop:** the Mac bridge is unavailable. Reuse
283
- the existing browser/computer-use tool's video or screenshots with
284
- \`clipy proof\`; otherwise use Playwright with an existing approved auth
285
- state. Never fall back to whole-display capture silently.
281
+ that window by itself with \`--source mac-screen --window <exact-id>\`
282
+ (windows on top of it stay out, so the user can keep working, when the
283
+ start JSON reports \`windowCapture: "window"\`; an older Clipy app
284
+ reports \`"area"\` and records whatever is on top of the window).
285
+ - **Interactive Linux desktop (X11):** \`--source screen\` records the real
286
+ screen with the CLI itself, no app needed: \`clipy sources --json\`, then
287
+ \`--source screen --window <exact-id>\` for one window or
288
+ \`--display <id>\`. Check \`windowCapture\` in the start JSON before
289
+ relying on the window being isolated: \`"window"\` is its own pixels
290
+ (complete under a compositor, black where covered without one);
291
+ \`"area"\` (ffmpeg older than 5.1) is the screen area it covers, so keep
292
+ it in front, because anything on top of it is recorded. On Wayland the
293
+ real screen is refused (it needs the desktop's consent dialog); use
294
+ \`--virtual-display\` instead.
295
+ - **Interactive Windows desktop:** there is no real-screen path for agents
296
+ yet. Reuse the existing browser/computer-use tool's video or screenshots
297
+ with \`clipy proof\`, or \`--source chrome-for-clipy\` for a browser tab.
298
+ Never fall back to whole-display capture silently.
286
299
  - **SSH server / container / CI:** assume there is no usable desktop session.
287
- For public routes, isolated headless Playwright is appropriate. For
300
+ On Linux, \`clipy session run --source screen --virtual-display -- <cmd>\`
301
+ gives the agent a private X display (Xvfb) to run any GUI app on and
302
+ records it; the command gets \`DISPLAY\`. For public routes, isolated
303
+ headless Playwright is appropriate. For
288
304
  authenticated routes, first reuse the repository's test login,
289
305
  Playwright \`storageState\`, init script, or existing agent-owned browser
290
306
  recording. If none exists, report the authentication blocker; do not type
@@ -297,10 +313,11 @@ WHAT must be verified, and WHETHER the target depends on an existing login.
297
313
  (see the Chrome for Clipy section below). It records tab audio without
298
314
  a manual capture-picker step; it uses a dedicated browser the
299
315
  user signed into once, never their daily one.
300
- - **The user asks you to record yourself doing something in the browser,
301
- and does not need marks:** \`--source chrome-extension\` (see "Recording
302
- through the Clipy extension" below). Same dedicated browser; the Clipy
303
- extension records and uploads the tab.
316
+ - **The user asks you to record yourself doing something in the browser
317
+ (a walkthrough, an SOP, docs, a verification) while they keep working:**
318
+ \`--source chrome-extension\` (see "Recording through the Clipy
319
+ extension" below). Same dedicated browser; the Clipy extension records
320
+ the tab in the background and uploads it.
304
321
 
305
322
  Before capture, visibly confirm the resolved target: expected URL, expected
306
323
  signed-in/signed-out state, expected account/role when it is safe to display, and
@@ -516,6 +533,16 @@ AUDIO, no human gesture, and keeps recording across navigations and while the
516
533
  tab is backgrounded. The session starts the browser if needed, opens --url in
517
534
  the recorded tab, and stopping never closes the browser.
518
535
 
536
+ It runs alongside the user, not in front of them: on macOS it launches without
537
+ taking focus from the app they are in, and the user keeps their own cursor and
538
+ keyboard while you drive it. Keep it that way. Open extra tabs with CDP
539
+ \`Target.createTarget\` and \`background: true\`, not Playwright \`newPage()\`,
540
+ and never call \`bringToFront()\` or \`Target.activateTarget\`: each of those
541
+ pulls Chrome in front of the user's work. (During a \`--source chrome-for-clipy\`
542
+ recording Clipy hands focus back after a \`newPage()\`; during an extension
543
+ recording or outside a recording it cannot.) \`clipy chrome start
544
+ --foreground\` is for when the user needs the window, for example to sign in.
545
+
519
546
  Use it when the verification needs sound (a player, a call UI, TTS), a
520
547
  tab-exact frame with zero desktop clutter, or a standing signed-in identity for
521
548
  automation. Do NOT treat it as the user's daily browser: it is a separate
@@ -524,21 +551,27 @@ process while CDP is open. Browser automation setup is opt-in. Install with
524
551
  \`clipy setup <agent> --with-browser\` or \`clipy chrome start\`, only when the
525
552
  user asked for browser automation.
526
553
 
527
- ### Recording through the Clipy extension (no marks)
554
+ ### Recording through the Clipy extension
528
555
 
529
556
  clipy chrome setup --json # one-time; quick check when already ready
530
- clipy session start --source chrome-extension --url <page> --json
531
- # drive the tab showing <page> over cdpHttpUrl with Playwright
557
+ clipy session start --source chrome-extension --url <page> --name "<title>" --json
558
+ # drive the tab whose CDP target id is the output's targetId (or attach to pageWsUrl)
559
+ clipy mark "Opened Settings > Billing" # one mark per meaningful step
532
560
  clipy session stop --json # returns shareUrl + contextUrl
533
561
 
534
- The Clipy extension inside Chrome for Clipy records the tab (video and tab
535
- audio) with no click, because Chrome for Clipy launches with
562
+ The Clipy extension inside Chrome for Clipy records the tab (picture only;
563
+ add \`--tab-audio\` for its sound, but detected speech then replaces your
564
+ marks as the transcript) with no click, because Chrome for Clipy launches with
536
565
  \`--allowlisted-extension-id\`. \`clipy chrome setup\` waits up to 15 minutes
537
566
  for the two steps only the user can do in the Chrome for Clipy window: click
538
567
  "Add to Chrome" on the extension page it opens, and sign in to Clipy. Relay
539
- those instructions and never try to do either yourself. \`clipy mark\` and
540
- \`clipy chapter\` are refused on this source; use \`--source chrome-for-clipy\`
541
- when you need them. Full agent instructions:
568
+ those instructions and never try to do either yourself. The recorded tab opens
569
+ in the background: never bring it to the front, drive it step by step over CDP,
570
+ and the user keeps working in other tabs or apps meanwhile. These recordings
571
+ are silent, so your marks become the transcript, the summary and the steps an
572
+ SOP or doc is written from: mark each step as you take it. \`--observed\` /
573
+ \`--verdict\` attested marks work; Clipy-evaluated \`--assert-*\` marks do not
574
+ (the extension, not Clipy, owns the page). Full agent instructions:
542
575
  https://clipy.online/docs/chrome-for-clipy.md
543
576
 
544
577
  ### Assert what you claim (two provenances, never pooled)
@@ -721,8 +754,9 @@ Clipy will NEVER bring a window or tab to the front for you. It cannot know whic
721
754
  tab/page/simulator you mean, and on --source mac-screen it may not be recording a
722
755
  browser at all. Focusing the right surface is YOUR job — do it before \`session start\`
723
756
  (e.g. activate the tab with your own tooling), then confirm with the reported title.
724
- Note the title and screen area are fixed at START time. Moving the window does not
725
- move the recording, and anything entering that area is filmed.
757
+ Note the title is fixed at START time. A \`--window\` recording is that window's own
758
+ pixels: it follows the window if it moves and windows on top of it are not filmed,
759
+ so it does not need to stay in front, but it must show the right tab.
726
760
  - On \`clipy record --source mac-screen\`, \`--for\` is capped at 1740s (the app
727
761
  auto-stops at 1800s).
728
762
  - If a human presses Stop inside the app during your session, \`session stop\` /
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@clipy/cli",
3
- "version": "0.15.0",
3
+ "version": "0.16.0",
4
4
  "description": "Command-line interface for Clipy \u2014 list, search, and read your screen recordings' transcripts, AI summaries, and key moments from the terminal.",
5
5
  "license": "MIT",
6
6
  "type": "module",
@@ -41,11 +41,11 @@
41
41
  "start": "node dist/index.js",
42
42
  "test:auth": "npm run build && node scripts/mock-auth-server.test.mjs && node scripts/doctor.test.mjs && node scripts/open-url.test.mjs",
43
43
  "test:proof": "npm run build && node scripts/proof-frames.test.mjs",
44
- "test:setup": "npm run build && node scripts/setup.test.mjs && node scripts/chrome-for-clipy.test.mjs && node scripts/capture-title.test.mjs",
44
+ "test:setup": "npm run build && node scripts/setup.test.mjs && node scripts/chrome-for-clipy.test.mjs && node scripts/extension-abort.test.mjs && node scripts/capture-title.test.mjs && node scripts/cdp-client.test.mjs",
45
45
  "test:memory": "npm run build && node scripts/memory-search.test.mjs",
46
46
  "test:chrome-capture": "npm run build && node scripts/chrome-capture.test.mjs",
47
- "test:session": "npm run build && node scripts/auth-guard.test.mjs && node scripts/session-control.test.mjs",
48
- "test": "npm run test:auth && npm run test:session && node scripts/setup.test.mjs && node scripts/chrome-for-clipy.test.mjs && node scripts/capture-title.test.mjs && node scripts/transcript-replace.test.mjs && node scripts/proof-frames.test.mjs && node scripts/memory-search.test.mjs && node scripts/agent-readiness.test.mjs && node scripts/context-sync.test.mjs && node scripts/context-frames.test.mjs && node scripts/context-youtube-transcript.test.mjs && node scripts/context-youtube-url-lang.test.mjs && node scripts/context-loom-url.test.mjs && node scripts/context-loom-import.test.mjs && node scripts/context-retry.test.mjs && node scripts/context-json-envelope.test.mjs && node scripts/context-ytdlp-update.test.mjs",
47
+ "test:session": "npm run build && node scripts/auth-guard.test.mjs && node scripts/session-control.test.mjs && node scripts/cdp-diagnostics.test.mjs && node scripts/linux-screen.test.mjs",
48
+ "test": "npm run test:auth && npm run test:session && node scripts/setup.test.mjs && node scripts/chrome-for-clipy.test.mjs && node scripts/extension-abort.test.mjs && node scripts/capture-title.test.mjs && node scripts/cdp-client.test.mjs && node scripts/transcript-replace.test.mjs && node scripts/proof-frames.test.mjs && node scripts/memory-search.test.mjs && node scripts/agent-readiness.test.mjs && node scripts/context-sync.test.mjs && node scripts/context-frames.test.mjs && node scripts/context-youtube-transcript.test.mjs && node scripts/context-youtube-url-lang.test.mjs && node scripts/context-loom-url.test.mjs && node scripts/context-loom-import.test.mjs && node scripts/context-retry.test.mjs && node scripts/context-json-envelope.test.mjs && node scripts/context-ytdlp-update.test.mjs",
49
49
  "prebuild": "node scripts/sync-context-core.mjs",
50
50
  "test:context": "npm run build && node scripts/agent-readiness.test.mjs && node scripts/context-sync.test.mjs && node scripts/context-frames.test.mjs && node scripts/context-youtube-transcript.test.mjs && node scripts/context-youtube-url-lang.test.mjs && node scripts/context-loom-url.test.mjs && node scripts/context-loom-import.test.mjs && node scripts/context-retry.test.mjs && node scripts/context-json-envelope.test.mjs && node scripts/context-ytdlp-update.test.mjs"
51
51
  },