@clipy/cli 0.8.4 → 0.8.6

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 CHANGED
@@ -362,7 +362,7 @@ The leading `[verification]` note reports the two provenances as **separate segm
362
362
  never pools them:
363
363
 
364
364
  ```text
365
- [verification] 2 clipy-verified: 1 passed, 1 failed, 1 unverified · 3 driver-attested: 2 passed, 1 failed
365
+ [verification] 3 clipy-verified: 1 passed, 1 failed, 1 unverified · 3 driver-attested: 2 passed, 1 failed
366
366
  ```
367
367
 
368
368
  An empty segment is omitted; with only clipy-verified marks the rendering stays the legacy
@@ -455,11 +455,49 @@ clipy mark "fix applied — retesting"
455
455
  clipy session stop # uploads, prints the share link
456
456
  ```
457
457
 
458
+ **Agent recordings don't take your microphone.** On `--source mac-screen` the default is
459
+ **system audio on, mic off** — an agent recording on your behalf isn't the same consent as
460
+ you clicking Record, and nobody asked for the room (or whatever call you're on) to be
461
+ captured; agent narration rides on marks, not speech. `--mic` opts in; `--no-system-audio`
462
+ opts out of system audio. Both are mac-screen only — headless web captures are silent, so
463
+ passing them on the web path is a usage error. The resolved config is printed
464
+ (`audio: system on, mic off`) and returned as a sibling `audio` field in `--json`.
465
+
466
+ Two things can go wrong, and both fail closed toward "assume the mic is live". If your Clipy
467
+ app is too old to control audio at all, the CLI says so **before recording starts** — the
468
+ timing is the point, since a warning printed after the fact is an autopsy on a mic that was
469
+ already open. If a new-enough app never confirms what it applied, you get the same warning
470
+ after start. Either way the message means **we do not know that the mic is off**: believe it
471
+ and update the app rather than trusting the flag you passed.
472
+
458
473
  `--window` takes a window id from `clipy sources`, or an app/title substring
459
474
  (case-insensitive; ambiguous matches list the candidates instead of guessing).
460
475
  `--display <id>` records a specific display. Both also work on one-shot
461
476
  `clipy record --source mac-screen --for 30`.
462
477
 
478
+ #### Confirm the camera before you burn six minutes
479
+
480
+ On start Clipy prints the surface it actually resolved, read live from the app:
481
+
482
+ ```text
483
+ recording window: "Redemptions · Admin — Chrome" (id 157)
484
+ ```
485
+
486
+ `session start --json` and `record --json` carry the same as `source: {kind, id, title}`,
487
+ in the **same shape** as each entry's `source` in `clipy sources --json`, so you can
488
+ compare what you picked against what the camera reports without transforming either.
489
+
490
+ **Check it against the surface you're driving, and abort on a mismatch.** Driver-attested
491
+ marks prove what *you* observed — they say nothing about what the camera saw. If you drive
492
+ a background tab of the recorded window, you get a truthful "10 passed" tally over footage
493
+ of a different tab: worse than no evidence, because the tally vouches for the wrong footage.
494
+
495
+ **Clipy will never bring a window or tab to the front for you.** It can't know which
496
+ tab/page/simulator you mean, and on `--source mac-screen` it may not be recording a browser
497
+ at all — focusing the right surface is the caller's job. Do it before `session start`, then
498
+ confirm with the reported title. (That title is read at start time; the camera follows the
499
+ window, so switching tabs mid-recording changes what's filmed without changing the title.)
500
+
463
501
  ## Scripting
464
502
 
465
503
  Every command has machine-readable output. `--json` is supported on **`list`, `search`,
package/dist/index.js CHANGED
@@ -27,7 +27,7 @@ import { createServer } from "node:net";
27
27
  import { createServer as createHttpServer } from "node:http";
28
28
  import { CLIPY_SKILL_MD } from "./skill.js";
29
29
  import { browserLogin, shouldUseManualLogin } from "./browserLogin.js";
30
- import { BridgeUnavailableError, bridgeRequest, inspectBridge, listSources, readBridgeInfo, resolveCaptureSource, windowLabel, probeSocketOpenable, probeBridgeHandshake, bridgeInfoFromFile, bridgeAppOutdated, MIN_BRIDGE_APP_VERSION, } from "./macBridge.js";
30
+ import { BridgeUnavailableError, bridgeRequest, inspectBridge, listSources, readBridgeInfo, resolveCaptureSource, windowLabel, probeSocketOpenable, probeBridgeHandshake, bridgeInfoFromFile, bridgeAppOutdated, MIN_BRIDGE_APP_VERSION, describeWindow, describeDisplay, } from "./macBridge.js";
31
31
  // Exit quietly when stdout/stderr close early (e.g. `clipy list | head`).
32
32
  for (const stream of [process.stdout, process.stderr]) {
33
33
  stream.on("error", (e) => {
@@ -334,10 +334,20 @@ ${c.bold("RECORD")} ${c.dim("(needs an API key with the \"ingest\" permission)")
334
334
  ${c.bold("SESSION")} ${c.dim("(agent works, Clipy records — one active session per directory)")}
335
335
  ${c.dim("--source mac-screen on record/session records the REAL screen via the")}
336
336
  ${c.dim("running Clipy Mac app (consent-gated, indicator always visible).")}
337
+ ${c.dim("On start it prints the resolved surface — recording window: \"<title>\" (id N).")}
338
+ ${c.dim("CONFIRM that matches what you are driving: attested marks prove what YOU saw,")}
339
+ ${c.dim("not what the camera saw. Clipy never fronts a window/tab for you.")}
337
340
  ${c.dim("Target one window or display instead of the whole screen:")}
338
- sources List capturable displays + windows (ids for --window/--display)
341
+ sources [--json] List capturable displays + windows (ids for --window/--display).
342
+ --json gives each entry a "source" {kind,id,title}
343
+ matching what session start/record report, so you
344
+ can compare pick-vs-camera directly
339
345
  --window "<title|app|id>" Record just that window (e.g. --window Chrome)
340
346
  --display <id> Record a specific display
347
+ --mic Opt IN to microphone capture (default: mic OFF —
348
+ an agent recording for you is not the same consent
349
+ as you clicking Record, so we never take the room)
350
+ --no-system-audio Opt OUT of system audio (default: system audio ON)
341
351
  session start --url <app> [--max <sec>] [--title <t>] [--type <kind>] [--expose-cdp]
342
352
  Start recording in a background daemon and
343
353
  return immediately (auto-stops + uploads at
@@ -2439,6 +2449,86 @@ async function resolveBridgeTarget(info, opts) {
2439
2449
  die(e.message);
2440
2450
  }
2441
2451
  }
2452
+ const CAPTURE_SOURCE_NOTE = "compare this against the surface your driver is acting on; Clipy will never focus or foreground a window/tab for you";
2453
+ /** Build the reported capture source. With no --window/--display the Mac app
2454
+ * records its default, which IS a display capture — so the kind is "display"
2455
+ * (never "mac-screen", which names the transport). We don't know WHICH display
2456
+ * without resolving one, so id/title are omitted rather than guessed. */
2457
+ function captureSourceResult(resolved) {
2458
+ if (resolved)
2459
+ return { ...resolved, note: CAPTURE_SOURCE_NOTE };
2460
+ return { kind: "display", note: CAPTURE_SOURCE_NOTE };
2461
+ }
2462
+ /** Human-readable resolved audio, e.g. "system on, mic off". */
2463
+ function describeAudio(a) {
2464
+ return `system ${a.includeSystemAudio ? "on" : "off"}, mic ${a.includeMic ? "ON" : "off"}`;
2465
+ }
2466
+ /**
2467
+ * Read the audio config the APP echoed back from `start` (agent_bridge.rs echoes
2468
+ * the resolved options). Returns null when the app didn't echo — which is exactly
2469
+ * how we detect a desktop build that predates agent audio handling and silently
2470
+ * ignored our request. Capability detection beats a hardcoded version compare:
2471
+ * it reports what actually happened rather than what a version number implies.
2472
+ */
2473
+ function echoedAudio(startResult) {
2474
+ const a = startResult.audio;
2475
+ if (!a || typeof a !== "object")
2476
+ return null;
2477
+ if (typeof a.includeSystemAudio !== "boolean" || typeof a.includeMic !== "boolean")
2478
+ return null;
2479
+ return { includeSystemAudio: a.includeSystemAudio, includeMic: a.includeMic };
2480
+ }
2481
+ /**
2482
+ * Bridge protocol version that introduced agent audio control — an honoured
2483
+ * `audio` object and a mic that defaults OFF. Mirrors PROTOCOL_VERSION in
2484
+ * desktop/src-tauri/src/agent_bridge.rs, whose own comment is the contract:
2485
+ * below this, the app silently ignores the field and records with ITS defaults.
2486
+ */
2487
+ const AUDIO_PROTOCOL_VERSION = 2;
2488
+ /**
2489
+ * Warn BEFORE `start` when the running app can't honour the audio request.
2490
+ * The timing is the entire point. The echo check below can only report what
2491
+ * happened once the mic has already been live for the length of the recording,
2492
+ * and a privacy flag must not fail open for that long. The discovery file
2493
+ * carries protocolVersion, so we can say it while the camera is still off.
2494
+ *
2495
+ * Returns true when it fired, so the post-start check doesn't say it twice.
2496
+ */
2497
+ function warnAudioUncontrollable(protocolVersion, requested, emit) {
2498
+ if (protocolVersion >= AUDIO_PROTOCOL_VERSION)
2499
+ return false;
2500
+ emit(c.yellow(`warning: this Clipy app speaks bridge protocol v${protocolVersion} and cannot apply audio settings ` +
2501
+ `(needs v${AUDIO_PROTOCOL_VERSION}) — it will record with the APP's own defaults, so your ` +
2502
+ `MICROPHONE MAY BE RECORDING. Update the Clipy app (https://clipy.online/download) to make ` +
2503
+ `"${describeAudio(requested)}" take effect.`));
2504
+ return true;
2505
+ }
2506
+ /**
2507
+ * Report the audio that was actually applied, and warn loudly when the app did
2508
+ * not confirm it. The dangerous direction is the silent one: on a desktop build
2509
+ * that ignores the audio field, "mic off" is what we asked for and MIC ON is what
2510
+ * happens — so an unconfirmed request is a privacy warning, not a footnote.
2511
+ *
2512
+ * This is the second of two gates. `warnAudioUncontrollable` catches the known
2513
+ * case from the version alone before recording starts; this catches the app that
2514
+ * claims the protocol but doesn't echo, which is an anomaly rather than an old
2515
+ * build. Both fail closed toward "assume the mic is live".
2516
+ */
2517
+ function reportAudio(requested, applied, emit, alreadyWarned = false) {
2518
+ // Same reasoning as warnAudioUncontrollable's emitter: the informational line
2519
+ // may be suppressed under --json, the privacy warning may not.
2520
+ const warn = (m) => process.stderr.write(`${m}\n`);
2521
+ if (!applied) {
2522
+ if (!alreadyWarned) {
2523
+ warn(c.yellow(`warning: this Clipy app did not confirm the audio settings, so it may be recording with its ` +
2524
+ `own defaults and your MICROPHONE MAY BE RECORDING. ` +
2525
+ `Update the Clipy app (https://clipy.online/download) to make "${describeAudio(requested)}" take effect.`));
2526
+ }
2527
+ return requested;
2528
+ }
2529
+ emit(`${c.dim("audio:")} ${describeAudio(applied)}`);
2530
+ return applied;
2531
+ }
2442
2532
  /** One-shot real-screen recording through the running Clipy app. */
2443
2533
  async function cmdRecordMac(opts) {
2444
2534
  // A real-screen capture is one continuous take — there are no viewport passes
@@ -2454,6 +2544,11 @@ async function cmdRecordMac(opts) {
2454
2544
  };
2455
2545
  const target = await resolveBridgeTarget(info, opts);
2456
2546
  log(`${c.dim(`asking the Clipy app (v${info.appVersion}) to record ${target?.label ?? "the screen"}…`)}`);
2547
+ // Name the surface the camera resolved to, live, before the capture burns time.
2548
+ if (target) {
2549
+ log(`${c.bold(`recording ${target.resolved.kind}:`)} "${target.resolved.title}" (id ${target.resolved.id})\n` +
2550
+ `${c.dim("confirm that is the surface you are driving — Clipy never brings it to the front for you.")}`);
2551
+ }
2457
2552
  // --type on the mac path: the current Clipy app doesn't forward recordingKind
2458
2553
  // from the bridge to its raw-upload/complete call (its AgentCompleteExtras has
2459
2554
  // no such field — desktop follow-up). We still send it (serde ignores unknown
@@ -2462,8 +2557,15 @@ async function cmdRecordMac(opts) {
2462
2557
  if (opts.recordingKind) {
2463
2558
  log(c.yellow(`note: --type is not applied to --source mac-screen recordings yet (needs a Clipy app update)`));
2464
2559
  }
2560
+ // Before the camera turns on, not after — see warnAudioUncontrollable().
2561
+ // Deliberately NOT `log`: a "your mic may be live" warning must survive
2562
+ // --json, and stderr never corrupts the JSON on stdout.
2563
+ const audioUncontrollable = warnAudioUncontrollable(info.protocolVersion, opts.audio, (m) => process.stderr.write(`${m}\n`));
2465
2564
  const notes = resolveNarrationNotes(opts.notes, [0]);
2466
- await bridgeRequest(info, "start", {
2565
+ const startResult = await bridgeRequest(info, "start", {
2566
+ // Explicit, never implicit: an absent field would fall through to the app's
2567
+ // interactive defaults on older builds (mic ON) — see reportAudio().
2568
+ audio: { includeSystemAudio: opts.audio.includeSystemAudio, includeMic: opts.audio.includeMic },
2467
2569
  // The recording is stopped by us after forSec; maxSec is the safety net
2468
2570
  // in case this CLI process dies mid-wait.
2469
2571
  maxSec: Math.min(opts.forSec + 60, 1800),
@@ -2473,6 +2575,7 @@ async function cmdRecordMac(opts) {
2473
2575
  notes: notes.map((n) => ({ startMs: n.startMs, text: n.text })),
2474
2576
  ...(target ? { source: target.source } : {}),
2475
2577
  });
2578
+ const appliedAudio = reportAudio(opts.audio, echoedAudio(startResult), log, audioUncontrollable);
2476
2579
  log(`${c.dim(`recording for ${opts.forSec}s…`)}`);
2477
2580
  await new Promise((r) => setTimeout(r, opts.forSec * 1000));
2478
2581
  log(`${c.dim("stopping + uploading…")}`);
@@ -2480,6 +2583,12 @@ async function cmdRecordMac(opts) {
2480
2583
  return {
2481
2584
  publicId: String(result.publicId ?? ""),
2482
2585
  shareUrl: String(result.shareUrl ?? ""),
2586
+ // The surface the camera actually filmed, for `record --json`.
2587
+ source: captureSourceResult(target?.resolved),
2588
+ // Sibling, NOT inside `source`: audio is a property of the capture, not of
2589
+ // the surface — folding it in would muddy `source` and break its shape
2590
+ // parity with `clipy sources --json` entries.
2591
+ audio: appliedAudio,
2483
2592
  };
2484
2593
  }
2485
2594
  function macSessionState(info, maxSec) {
@@ -2546,7 +2655,12 @@ async function cmdSessionStart(ctx, opts) {
2546
2655
  if (opts.recordingKind && !opts.json) {
2547
2656
  process.stderr.write(`${c.yellow("note: --type is not applied to --source mac-screen recordings yet (needs a Clipy app update)")}\n`);
2548
2657
  }
2549
- await bridgeRequest(info, "start", {
2658
+ // Before the camera turns on, not after — see warnAudioUncontrollable().
2659
+ const audioUncontrollable = warnAudioUncontrollable(info.protocolVersion, opts.audio, (m) => process.stderr.write(`${m}\n`));
2660
+ const startResult = await bridgeRequest(info, "start", {
2661
+ // Explicit, never implicit — see reportAudio(): an absent field falls
2662
+ // through to the app's interactive defaults (mic ON) on older builds.
2663
+ audio: { includeSystemAudio: opts.audio.includeSystemAudio, includeMic: opts.audio.includeMic },
2550
2664
  maxSec,
2551
2665
  title: opts.name,
2552
2666
  description: opts.description,
@@ -2554,11 +2668,29 @@ async function cmdSessionStart(ctx, opts) {
2554
2668
  ...(target ? { source: target.source } : {}),
2555
2669
  });
2556
2670
  writeSessionState(file, macSessionState(info, maxSec));
2671
+ const appliedAudio = reportAudio(opts.audio, echoedAudio(startResult), (m) => process.stderr.write(`${m}\n`), audioUncontrollable);
2557
2672
  if (opts.json) {
2558
- printJson({ state: "recording", source: "mac-screen", maxSec, target: target?.label });
2673
+ printJson({
2674
+ state: "recording",
2675
+ // The transport, kept as a top-level string so callers that parsed the
2676
+ // old `source: "mac-screen"` still find it — `source` is now the
2677
+ // structured object describing what the camera points at.
2678
+ captureMode: "mac-screen",
2679
+ maxSec,
2680
+ target: target?.label,
2681
+ source: captureSourceResult(target?.resolved),
2682
+ audio: appliedAudio,
2683
+ });
2559
2684
  return;
2560
2685
  }
2561
2686
  process.stdout.write(`${c.green("✓")} the Clipy app is recording ${target ? target.label : "your screen"} (max ${maxSec}s)\n`);
2687
+ // Say plainly what the camera is filming, BEFORE the usage hints. A driver
2688
+ // working a background tab of this window would otherwise discover the
2689
+ // mismatch only after the recording is spent.
2690
+ if (target) {
2691
+ process.stdout.write(`${c.bold(`recording ${target.resolved.kind}:`)} "${target.resolved.title}" (id ${target.resolved.id})\n` +
2692
+ `${c.dim("confirm that is the surface you are driving — Clipy never brings it to the front for you.")}\n`);
2693
+ }
2562
2694
  process.stdout.write(`${c.dim("while it runs:")} clipy mark "what just happened"\n` +
2563
2695
  `${c.dim("when finished:")} clipy session stop ${c.dim("· discard:")} clipy session abort\n`);
2564
2696
  return;
@@ -3903,7 +4035,7 @@ async function cmdAgents(ctx, sub, targetRaw, json) {
3903
4035
  // command's shape without trial-and-error. Bump GUIDE_SCHEMA_VERSION when the
3904
4036
  // contract changes.
3905
4037
  // ---------------------------------------------------------------------------
3906
- const GUIDE_SCHEMA_VERSION = 10;
4038
+ const GUIDE_SCHEMA_VERSION = 11;
3907
4039
  function cmdGuide(json) {
3908
4040
  if (!json) {
3909
4041
  process.stdout.write(HELP);
@@ -3960,7 +4092,7 @@ function cmdGuide(json) {
3960
4092
  cmdDoc("chapter", "clipy chapter \"<label>\" [--json]", "Mark a BEFORE/AFTER section boundary in the active recording (stored as '=== CHAPTER: <label> ==='). The PR-review shape: demo the base branch, run `clipy chapter \"AFTER — fix applied\"`, swap branches + restart the dev server, demo the fix — one video carrying both states. Works on web + --source mac-screen sessions.", ["--json"]),
3961
4093
  cmdDoc("doctor", "clipy doctor [--json]", "One-shot health check: API key + whoami round-trip, Mac agent bridge (exists/parses/pid/appVersion>=" + MIN_BRIDGE_APP_VERSION + "), Playwright resolvability (and the resolved path/node_modules dir), and install mode (npx/global/local) — each a pass/warn/fail with a fix hint; exits non-zero if any check fails", ["--json"]),
3962
4094
  cmdDoc("playwright-path", "clipy playwright-path [--json]", "Print the node_modules directory of the Playwright this CLI resolves, so your own --expose-cdp driver scripts can load the same copy: NODE_PATH=$(clipy playwright-path) node driver.js. Exits 1 (empty stdout) if Playwright is unresolvable. --json prints {path, nodeModulesDir, source}", ["--json"]),
3963
- cmdDoc("sources", "clipy sources [--json]", "List displays + windows the Clipy Mac app can capture — ids feed --window/--display"),
4095
+ cmdDoc("sources", "clipy sources [--json]", "List displays + windows the Clipy Mac app can capture — ids feed --window/--display. --json gives each entry a `source` {kind,id,title} in the SAME shape session start/record report for the resolved capture, so a caller can compare what it picked against what the camera reports without transforming either."),
3964
4096
  cmdDoc("agents", "clipy agents <status|install|uninstall> <claude|codex|cursor>", "Install the bundled Clipy skill for a coding agent; install triggers a browser login first when no key is configured (interactive terminals only)"),
3965
4097
  cmdDoc("guide", "clipy guide --json", "This manifest"),
3966
4098
  cmdDoc("mcp", "clipy mcp", "Run the Clipy MCP server (wraps npx -y @clipy/mcp)"),
@@ -3972,6 +4104,8 @@ function cmdGuide(json) {
3972
4104
  "Headless captures have no audio: --note flags and session marks become the transcript, labeled agent-narration.",
3973
4105
  "--note is absolute ('12: text') or pass-scoped ('pass2: text' / 'pass2@5: text'); pass-scoped notes anchor to the real start of a --viewports pass, so they don't drift when load time shifts the pass boundaries. A malformed pass note (e.g. 'pass2 text' with no colon) is a usage error, not silently demoted.",
3974
4106
  "--type declares what a recording IS (bug_report/feature_request/product_demo/walkthrough_tutorial/feedback_review/discussion_talk/other, plus short aliases) so the AI summary doesn't misread a demo as a bug report. Applied on web today; --source mac-screen support is pending a Clipy app update.",
4107
+ "AUDIO on --source mac-screen: agent screen recordings do NOT capture the microphone by default (system audio ON, mic OFF). An agent recording on your behalf is not the same consent as a human clicking Record — nobody asked for the room, or whatever call you are on, to be captured — and agent narration rides on marks, not speech. Opt in with --mic; opt out of system audio with --no-system-audio. Both are --source mac-screen only: headless web captures are silent, so passing them on the web path is a usage error (exit 2). The resolved config is printed (`audio: system on, mic off`) and returned as a sibling `audio` {includeSystemAudio, includeMic} in --json — sibling, not inside `source`, because audio is a property of the capture, not of the surface. IMPORTANT: the CLI reports the config the APP echoed back, and if the app does not echo one (a desktop build predating agent audio control) it WARNS that the app is using its own defaults and the microphone may be recording — update the Clipy app to make the setting take effect.",
4108
+ "CONFIRM THE CAMERA on --source mac-screen. `session start` and `record` print the surface they resolved, read LIVE from the app at start time — `recording window: \"<title>\" (id 157)` — and `session start --json` / `record --json` carry it as `source: {kind, id, title}`, the SAME shape each entry's `source` takes in `clipy sources --json`, so a caller can compare its pick against the camera with a direct object comparison. Check it and abort on mismatch: driver-attested marks prove what the DRIVER observed and say nothing about what the camera saw, so driving a background tab of the recorded window yields a truthful 'N passed' tally over footage of something else — worse than no evidence, because the tally vouches for the wrong footage. Clipy will NEVER activate or foreground a window/tab: it cannot know which tab/page/simulator you mean (on mac-screen it may not be recording a browser at all), so focusing the right surface is the caller's job, done before session start. The reported title is read at START time; the camera follows the window, so a mid-recording tab switch changes what is filmed without changing the title.",
3975
4109
  "Clipy is a RECORDER, not a driver. When you drive the browser yourself (the usual agent case), the primary path is: record the real app (--source mac-screen --window '<app>', or your own driven browser) and attach evidence with driver-attested marks — `clipy mark \"<claim>\" --observed \"<values you read>\" --verdict pass|fail` — plus `clipy chapter` for before/after. Clipy holds the ledger; it does not drive. The owned-browser auth flags (--storage-state/--user-data-dir/--profile-directory/--cookie/--local-storage/--init-script) are the AGENTLESS/CI fallback for when nothing is driving and Clipy needs its own logged-in context. Provenance is never pooled: driver-attested marks render '[≈ ASSERT driver-attested; observed=…]' / '[≈ FAILED …]' (hedge glyph) and clipy-evaluated ones '[assert ✓ verified-by-clipy; …]' / '[ASSERT ✗ verified-by-clipy; …]' (✓/✗ are reserved for what Clipy itself checked), and the [verification] note counts them in separate segments. The honesty rule: driver-attested means Clipy vouches the agent SAID it, not that Clipy verified it.",
3976
4110
  "Assertion marks are the differentiator: assert what you claim. `clipy mark \"X\" --assert-selector '.status' --assert-text Active` records X only alongside the live-page truth — the daemon runs the check against its Playwright page and annotates the mark ✓/✗ with what it actually observed, so a false claim cannot pass as fact in the transcript. --fail-mode abort turns a failed assertion into a discarded session (nothing uploaded, non-zero exit). Assertions need a web session and the daemon's control endpoint (started by clipy 0.6+); they are rejected on --source mac-screen.",
3977
4111
  "A mark is NEVER dropped, and a late verdict never rewrites it. If the daemon can't be reached to evaluate an assertion (its event loop briefly starved during a dev-server recompile), `clipy mark` records the narration anyway tagged '[ASSERT ⚠ clipy could not evaluate — <reason>]', prints a loud ⚠, and exits 0 — an unverified claim is flagged, never promoted to a ✓. The tally's third bucket counts these: '[verification] N assertion(s): P passed, F failed, K unverified' (the ', K unverified' clause is omitted when K=0). That ⚠ is the MARK OF RECORD: if the daemon was only slow and evaluates the same claim later, that verdict judged a LATER page state, so it does NOT overwrite the ⚠ — it's recorded as a separate '[late check of \"…\" — evaluated Ns after the claim: …]' note at its own time and counts toward none of P/F/K. Plain non-asserted marks the daemon later processes are just deduped (exactly once).",
@@ -4068,6 +4202,8 @@ async function main() {
4068
4202
  output: { type: "string", short: "o" },
4069
4203
  srt: { type: "boolean", default: false },
4070
4204
  "marks-only": { type: "boolean", default: false },
4205
+ mic: { type: "boolean", default: false },
4206
+ "no-system-audio": { type: "boolean", default: false },
4071
4207
  vtt: { type: "boolean", default: false },
4072
4208
  for: { type: "string" },
4073
4209
  timeout: { type: "string" },
@@ -4167,6 +4303,14 @@ async function main() {
4167
4303
  }
4168
4304
  return pd;
4169
4305
  };
4306
+ // Audio applies only to real-screen capture. Headless Playwright captures are
4307
+ // SILENT, so accepting these there would imply audio we cannot record.
4308
+ const audioFlagsPresent = Boolean(values.mic || values["no-system-audio"]);
4309
+ const audioChoice = () => ({
4310
+ includeSystemAudio: !values["no-system-audio"],
4311
+ includeMic: Boolean(values.mic),
4312
+ });
4313
+ const webAudioGuard = "--mic/--no-system-audio apply to --source mac-screen only — headless web captures record no audio at all, so there is nothing to turn on or off";
4170
4314
  const macAuthGuard = "auth state (--storage-state/--user-data-dir/--cookie/--local-storage/--init-script) applies to headless web capture — --source mac-screen records the real, already-logged-in screen";
4171
4315
  switch (command) {
4172
4316
  case "login":
@@ -4269,7 +4413,14 @@ async function main() {
4269
4413
  try {
4270
4414
  const sources = await listSources(readBridgeInfo());
4271
4415
  if (json) {
4272
- printJson(sources);
4416
+ // Each entry carries the SAME `source` descriptor shape that
4417
+ // `session start --json` / `record --json` report for the resolved
4418
+ // capture, so a caller can compare "what I picked" against "what the
4419
+ // camera reports" with a direct object comparison — no transforming.
4420
+ printJson({
4421
+ displays: sources.displays.map((d) => ({ ...d, source: describeDisplay(d) })),
4422
+ windows: sources.windows.map((w) => ({ ...w, source: describeWindow(w) })),
4423
+ });
4273
4424
  return;
4274
4425
  }
4275
4426
  process.stdout.write(`${c.bold("DISPLAYS")}\n`);
@@ -4300,6 +4451,8 @@ async function main() {
4300
4451
  }
4301
4452
  if (source === "mac-screen" && authFlagsPresent)
4302
4453
  die(macAuthGuard, 2);
4454
+ if (source !== "mac-screen" && audioFlagsPresent)
4455
+ die(webAudioGuard, 2);
4303
4456
  const recordingKind = values.type ? requireRecordingKind(String(values.type)) : undefined;
4304
4457
  if (source === "mac-screen") {
4305
4458
  const noteFlags = values.note ?? [];
@@ -4311,6 +4464,7 @@ async function main() {
4311
4464
  }
4312
4465
  try {
4313
4466
  const result = await cmdRecordMac({
4467
+ audio: audioChoice(),
4314
4468
  forSec,
4315
4469
  name: (values.title ?? values.name)?.trim() ||
4316
4470
  undefined,
@@ -4325,7 +4479,7 @@ async function main() {
4325
4479
  await waitForArtifacts(ctx, result.publicId).catch(() => { });
4326
4480
  }
4327
4481
  if (json) {
4328
- printJson({ id: result.publicId, shareUrl: result.shareUrl });
4482
+ printJson({ id: result.publicId, shareUrl: result.shareUrl, source: result.source });
4329
4483
  }
4330
4484
  else {
4331
4485
  process.stdout.write(`${c.green("✓")} recorded — ${c.bold(result.shareUrl)}\n`);
@@ -4379,6 +4533,8 @@ async function main() {
4379
4533
  }
4380
4534
  if (source === "mac-screen" && authFlagsPresent)
4381
4535
  die(macAuthGuard, 2);
4536
+ if (source !== "mac-screen" && audioFlagsPresent)
4537
+ die(webAudioGuard, 2);
4382
4538
  const url = values.url?.trim() || positionalUrl;
4383
4539
  if (!url && source === "web") {
4384
4540
  die("usage: clipy session start --url <http(s) url> [--max <sec>] [--source web|mac-screen]", 2);
@@ -4400,6 +4556,7 @@ async function main() {
4400
4556
  auth: authCapture(),
4401
4557
  userDataDir: userDataDir(),
4402
4558
  profileDirectory: profileDirectory(),
4559
+ audio: audioChoice(),
4403
4560
  };
4404
4561
  };
4405
4562
  if (sub === "start") {
package/dist/macBridge.js CHANGED
@@ -249,6 +249,25 @@ export async function listSources(info) {
249
249
  export function windowLabel(w) {
250
250
  return w.title ? `${w.app_name} — ${w.title}` : w.app_name;
251
251
  }
252
+ export function describeWindow(w) {
253
+ return {
254
+ kind: "window",
255
+ id: w.id,
256
+ // A window can legitimately have no title (some app shells); naming the app
257
+ // is honest, inventing a title would not be.
258
+ title: w.title || w.app_name || `window ${w.id}`,
259
+ app: w.app_name,
260
+ };
261
+ }
262
+ export function describeDisplay(d) {
263
+ return {
264
+ kind: "display",
265
+ id: d.id,
266
+ // Displays have no title; fall back to the name, then the identifier +
267
+ // bounds, so the field is never an empty string.
268
+ title: d.name || `display ${d.id} (${d.width}×${d.height})`,
269
+ };
270
+ }
252
271
  /**
253
272
  * Resolves --window/--display flags to a CaptureSource. A numeric value is
254
273
  * treated as an id from `clipy sources`; anything else is a case-insensitive
@@ -286,7 +305,11 @@ export async function resolveCaptureSource(info, opts) {
286
305
  const list = matches.map((w) => ` ${w.id} ${windowLabel(w)}`).join("\n");
287
306
  throw new Error(`"${q}" matches ${matches.length} windows — use the id instead:\n${list}`);
288
307
  }
289
- return { source: { type: "window", id: matches[0].id }, label: windowLabel(matches[0]) };
308
+ return {
309
+ source: { type: "window", id: matches[0].id },
310
+ label: windowLabel(matches[0]),
311
+ resolved: describeWindow(matches[0]),
312
+ };
290
313
  }
291
314
  if (opts.display) {
292
315
  const q = opts.display.trim();
@@ -304,6 +327,7 @@ export async function resolveCaptureSource(info, opts) {
304
327
  return {
305
328
  source: { type: "display", id: matches[0].id },
306
329
  label: matches[0].name || `display ${matches[0].id}`,
330
+ resolved: describeDisplay(matches[0]),
307
331
  };
308
332
  }
309
333
  throw new Error("resolveCaptureSource called without --window or --display");
package/dist/skill.js CHANGED
@@ -15,7 +15,7 @@ description: Read and create Clipy screen recordings. Use when the user shares a
15
15
 
16
16
  # Clipy — recordings you can read AND make
17
17
 
18
- Written for @clipy/cli + @clipy/mcp 0.8.4 (the two versions move in lockstep). If
18
+ Written for @clipy/cli + @clipy/mcp 0.8.6 (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
@@ -202,8 +202,8 @@ Attach the values YOU observed and your verdict:
202
202
  Renders as \`… [≈ ASSERT driver-attested; observed=<your values>]\` (pass) or
203
203
  \`… [≈ FAILED driver-attested; observed=…]\` (fail) — a HEDGE glyph, never ✓/✗:
204
204
  those are reserved for marks Clipy itself checked, so a skim tells the two apart
205
- by shape before you read a word. Both
206
- flags are required together, and a mark carries exactly ONE provenance — combining
205
+ by shape before you read a word. Both flags are required together, and a mark
206
+ carries exactly ONE provenance — combining
207
207
  them with --assert-* is a usage error. Works in EVERY session type, including
208
208
  \`--source mac-screen\`.
209
209
 
@@ -343,6 +343,30 @@ time.
343
343
  case-insensitive app/title substring; ambiguous matches list candidates).
344
344
  \`--display <id>\` targets a whole display. The two are mutually exclusive;
345
345
  default is the primary display.
346
+
347
+ ### CONFIRM THE CAMERA BEFORE YOU BURN SIX MINUTES
348
+
349
+ On start, Clipy prints the surface it resolved, read live from the app:
350
+
351
+ recording window: "Redemptions · Admin — Chrome" (id 157)
352
+
353
+ \`session start --json\` / \`record --json\` carry the same thing as
354
+ \`source: {kind, id, title}\`, in the SAME shape as each entry's \`source\` in
355
+ \`clipy sources --json\` — so you can compare what you picked against what the
356
+ camera reports with a direct object comparison.
357
+
358
+ CHECK IT AGAINST THE SURFACE YOU ARE DRIVING, AND ABORT ON MISMATCH. Driver-attested
359
+ marks prove what YOU observed; they say nothing about what the camera saw. Drive a
360
+ background tab of the recorded window and you get a truthful "10 passed" tally over
361
+ footage of something else — worse than no evidence, because the tally vouches for the
362
+ wrong footage. One comparison at second one beats discovering it at minute six.
363
+
364
+ Clipy will NEVER bring a window or tab to the front for you. It cannot know which
365
+ tab/page/simulator you mean, and on --source mac-screen it may not be recording a
366
+ browser at all. Focusing the right surface is YOUR job — do it before \`session start\`
367
+ (e.g. activate the tab with your own tooling), then confirm with the reported title.
368
+ Note the title is read at START time; if you switch tabs mid-recording the camera
369
+ follows the window, not your driver.
346
370
  - On \`clipy record --source mac-screen\`, \`--for\` is capped at 1740s (the app
347
371
  auto-stops at 1800s).
348
372
  - If a human presses Stop inside the app during your session, \`session stop\` /
@@ -350,6 +374,36 @@ time.
350
374
  by the app, so treat it as done: fetch the share/context link rather than
351
375
  retrying.
352
376
 
377
+ ### THE MICROPHONE IS OFF BY DEFAULT — KEEP IT THAT WAY UNLESS ASKED
378
+
379
+ Agent screen recordings do NOT capture the microphone. The default is system audio
380
+ ON, mic OFF, and that asymmetry is deliberate: system audio captures the machine,
381
+ the mic captures the ROOM. A person clicking Record chose to be heard. You starting
382
+ a recording on their behalf is not that same consent, and nobody asked for their
383
+ call, their kitchen, or whoever else is nearby to be on a shareable link. Your
384
+ narration rides on marks, not speech, so the mic buys the recording nothing by
385
+ default.
386
+
387
+ - \`--mic\` opts in. Only pass it when the user asked for their voice in the
388
+ recording — treat it as an instruction to obtain, never a default you restore
389
+ because audio "seems better".
390
+ - \`--no-system-audio\` opts out of system audio.
391
+ - Both are \`--source mac-screen\` ONLY. Headless web captures record no audio at
392
+ all, so passing either on the web path is a usage error (exit 2) rather than a
393
+ silently ignored flag.
394
+
395
+ The resolved config is printed (\`audio: system on, mic off\`) and returned as a
396
+ sibling \`audio\` object in \`--json\`. Read it rather than assuming your flags won:
397
+
398
+ - If the Clipy app is too old to control audio, the CLI warns BEFORE recording
399
+ starts that the app's own defaults are in force and the mic may be live.
400
+ - If the app claims audio control but never confirms what it applied, you get the
401
+ same warning after start.
402
+
403
+ Either way the warning means the same thing: WE DO NOT KNOW that the mic is off.
404
+ Believe it, tell the user, and update the app — do not report a recording as
405
+ mic-free on the strength of the flag you passed.
406
+
353
407
  ## Rules for recording (follow strictly)
354
408
 
355
409
  - Record ONLY when the user asked you to make a recording, or when a shareable
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@clipy/cli",
3
- "version": "0.8.4",
3
+ "version": "0.8.6",
4
4
  "description": "Command-line interface for Clipy — list, search, and read your screen recordings' transcripts, AI summaries, and key moments from the terminal.",
5
5
  "license": "MIT",
6
6
  "type": "module",