@reticlehq/core 3.5.0 → 3.6.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.
Files changed (72) hide show
  1. package/dist/artifacts/artifacts-entry.d.ts +2 -0
  2. package/dist/artifacts/artifacts-entry.js +2 -0
  3. package/dist/artifacts/drive-script.d.ts +1298 -0
  4. package/dist/artifacts/drive-script.js +197 -0
  5. package/dist/artifacts/flow-constants.d.ts +1 -0
  6. package/dist/artifacts/flow-constants.js +1 -0
  7. package/dist/artifacts/flow-types.d.ts +60 -0
  8. package/dist/artifacts/flow-types.js +10 -0
  9. package/dist/artifacts/hud-notices.d.ts +134 -0
  10. package/dist/artifacts/hud-notices.js +124 -0
  11. package/dist/artifacts/impact.d.ts +135 -44
  12. package/dist/artifacts/impact.js +25 -0
  13. package/dist/artifacts/journal.d.ts +49 -0
  14. package/dist/artifacts/journal.js +15 -0
  15. package/dist/artifacts/prompt-context.d.ts +105 -0
  16. package/dist/artifacts/prompt-context.js +108 -0
  17. package/dist/desktop-contract.cjs +1 -0
  18. package/dist/desktop-contract.d.cts +1 -0
  19. package/dist/hud-entry.d.ts +1 -0
  20. package/dist/hud-entry.js +2 -0
  21. package/dist/identity/contract-fingerprint.d.ts +9 -0
  22. package/dist/identity/contract-fingerprint.js +12 -0
  23. package/dist/identity/testid-attribute.d.ts +18 -0
  24. package/dist/identity/testid-attribute.js +24 -0
  25. package/dist/index.d.ts +4 -1
  26. package/dist/index.js +4 -1
  27. package/dist/onboarding.d.ts +2 -2
  28. package/dist/schema/command-message.json +6 -0
  29. package/dist/schema/command-name.json +3 -1
  30. package/dist/schema/event-payloads.json +16 -0
  31. package/dist/schema/reticle-message.json +6 -0
  32. package/dist/telemetry-refusal.d.ts +3 -2
  33. package/dist/telemetry-session.d.ts +5 -1
  34. package/dist/telemetry-session.js +3 -1
  35. package/dist/telemetry.d.ts +36 -28
  36. package/dist/tour.d.ts +1 -0
  37. package/dist/tour.js +13 -5
  38. package/dist/verdict/consequence.d.ts +3 -0
  39. package/dist/verdict/findings.d.ts +5 -0
  40. package/dist/verdict/findings.js +7 -0
  41. package/dist/verdict/predicate.d.ts +14 -0
  42. package/dist/verdict/predicate.js +7 -12
  43. package/dist/verdict/verdict-attribution.js +1 -0
  44. package/dist/verdict/verification-run.d.ts +18 -0
  45. package/dist/verdict/verification-run.js +8 -0
  46. package/dist/verdict/verified-constants.d.ts +19 -0
  47. package/dist/verdict/verified-constants.js +22 -0
  48. package/dist/wire/constants/constants.d.ts +44 -15
  49. package/dist/wire/constants/constants.js +44 -15
  50. package/dist/wire/constants/hud-controls.d.ts +1 -1
  51. package/dist/wire/constants/hud-controls.js +21 -0
  52. package/dist/wire/constants/hud-use.d.ts +64 -1
  53. package/dist/wire/constants/hud-use.js +40 -1
  54. package/dist/wire/constants/session-constants.d.ts +8 -0
  55. package/dist/wire/constants/session-constants.js +8 -0
  56. package/dist/wire/desktop-contract.d.ts +3 -0
  57. package/dist/wire/desktop-contract.js +3 -0
  58. package/dist/wire/event-payloads.d.ts +25 -4
  59. package/dist/wire/event-payloads.js +10 -0
  60. package/dist/wire/global-press.d.ts +34 -3
  61. package/dist/wire/global-press.js +91 -3
  62. package/dist/wire/hold.d.ts +14 -0
  63. package/dist/wire/hold.js +18 -0
  64. package/dist/wire/messages.d.ts +42 -18
  65. package/dist/wire/messages.js +8 -0
  66. package/dist/wire/platform-link.d.ts +161 -0
  67. package/dist/wire/platform-link.js +189 -0
  68. package/dist/wire/types.d.ts +7 -0
  69. package/dist/words/no-session-reason.d.ts +7 -0
  70. package/dist/words/no-session-reason.js +7 -0
  71. package/dist/words/notices.js +4 -2
  72. package/package.json +1 -1
@@ -106,6 +106,11 @@ export declare const VerifiedReason: {
106
106
  readonly CONTRADICTED: "contradicted";
107
107
  /** The consequence was already true beforehand, so it proves nothing about the action. */
108
108
  readonly ALREADY_TRUE: "already_true";
109
+ /**
110
+ * The consequence held, but only on elements that are hidden: a `text` or stateless `element`
111
+ * check matches DOM presence, so a success template still hidden in the DOM passed it.
112
+ */
113
+ readonly HIDDEN_MATCH: "hidden_match";
109
114
  /** The capture was not clean, so a green would only describe what happened to be observed. */
110
115
  readonly UNCLEAN_CAPTURE: "unclean_capture";
111
116
  /**
@@ -190,6 +195,20 @@ export type CaptureLoss = (typeof CaptureLoss)[keyof typeof CaptureLoss];
190
195
  */
191
196
  export declare const CDP_NO_PROVIDER_REASON = "no-cdp-provider";
192
197
  export declare const CDP_NO_PROVIDER_RECOMMENDATION = "this needs a Reticle-driven browser (it is applied through CDP, which the always-on SDK cannot do) \u2014 start with `reticle drive <url>` or set RETICLE_CDP_URL";
198
+ /**
199
+ * What `reticle_viewport` answers when nothing can resize the page (#1273).
200
+ *
201
+ * On an SDK-only tab — the one the person opened themselves — the refusal is inherent: a page cannot
202
+ * resize its own window. But a LEASED tab is a Playwright-owned page and CAN be resized, and the
203
+ * tool already takes that route when there is one. The generic recommendation above named only the
204
+ * routes that need a human (`reticle drive`, `RETICLE_CDP_URL`), so an agent that was refused had
205
+ * no way to learn that one call of its own would have worked.
206
+ *
207
+ * Neither `reticle_lease` nor `reticle_viewport` is on the default advertised surface, so the lease
208
+ * is named the way a caller can actually reach it: through `reticle_run`. The human routes stay,
209
+ * second, for the agent that wants to drive the person's own tab.
210
+ */
211
+ export declare const VIEWPORT_NO_PROVIDER_RECOMMENDATION: string;
193
212
  /**
194
213
  * A region the SDK cannot see into — surfaced (never hidden) so a result's coverage reads honestly.
195
214
  * Crosses the wire in a BLIND_SPOT event's `kind`, so it lives in core (the contract), not the server.
@@ -105,6 +105,11 @@ export const VerifiedReason = {
105
105
  CONTRADICTED: 'contradicted',
106
106
  /** The consequence was already true beforehand, so it proves nothing about the action. */
107
107
  ALREADY_TRUE: 'already_true',
108
+ /**
109
+ * The consequence held, but only on elements that are hidden: a `text` or stateless `element`
110
+ * check matches DOM presence, so a success template still hidden in the DOM passed it.
111
+ */
112
+ HIDDEN_MATCH: 'hidden_match',
108
113
  /** The capture was not clean, so a green would only describe what happened to be observed. */
109
114
  UNCLEAN_CAPTURE: 'unclean_capture',
110
115
  /**
@@ -187,6 +192,23 @@ export const CaptureLoss = {
187
192
  */
188
193
  export const CDP_NO_PROVIDER_REASON = 'no-cdp-provider';
189
194
  export const CDP_NO_PROVIDER_RECOMMENDATION = 'this needs a Reticle-driven browser (it is applied through CDP, which the always-on SDK cannot do) — start with `reticle drive <url>` or set RETICLE_CDP_URL';
195
+ /**
196
+ * What `reticle_viewport` answers when nothing can resize the page (#1273).
197
+ *
198
+ * On an SDK-only tab — the one the person opened themselves — the refusal is inherent: a page cannot
199
+ * resize its own window. But a LEASED tab is a Playwright-owned page and CAN be resized, and the
200
+ * tool already takes that route when there is one. The generic recommendation above named only the
201
+ * routes that need a human (`reticle drive`, `RETICLE_CDP_URL`), so an agent that was refused had
202
+ * no way to learn that one call of its own would have worked.
203
+ *
204
+ * Neither `reticle_lease` nor `reticle_viewport` is on the default advertised surface, so the lease
205
+ * is named the way a caller can actually reach it: through `reticle_run`. The human routes stay,
206
+ * second, for the agent that wants to drive the person's own tab.
207
+ */
208
+ export const VIEWPORT_NO_PROVIDER_RECOMMENDATION = 'a page cannot resize its own window, but a leased tab can be resized — acquire one with ' +
209
+ 'reticle_run { tool: "reticle_lease", args: { action: "acquire", url } }, then call reticle_viewport ' +
210
+ 'again with the sessionId it returns. To resize the tab you already have open instead, start with ' +
211
+ '`reticle drive <url>` or set RETICLE_CDP_URL';
190
212
  /**
191
213
  * A region the SDK cannot see into — surfaced (never hidden) so a result's coverage reads honestly.
192
214
  * Crosses the wire in a BLIND_SPOT event's `kind`, so it lives in core (the contract), not the server.
@@ -94,6 +94,12 @@ export declare const RETICLE_URL_PARAM: {
94
94
  * needs (nobody is sitting in front of it) without touching identity.
95
95
  */
96
96
  readonly OPENED: "__reticle_opened";
97
+ /**
98
+ * How the HUD starts on a page Reticle opened: `shown`, `hidden` or `removed` (`HudVisibility`).
99
+ * On the URL rather than a command because a command sent before the HUD mounts is lost, and a
100
+ * headless drive should never paint a HUD it was asked not to.
101
+ */
102
+ readonly HUD: "__reticle_hud";
97
103
  };
98
104
  /** The loopback bind address. The daemon/bridge bind here by default — never expose Reticle off-host. */
99
105
  export declare const LOOPBACK_HOST = "127.0.0.1";
@@ -103,6 +109,9 @@ export declare const LOOPBACK_HOST = "127.0.0.1";
103
109
  * here and nowhere else. The values are the literal process.env keys.
104
110
  */
105
111
  export declare const ReticleEnv: {
112
+ /** "0"/"false"/"off" turns off telemetry and every optional outbound call; DO_NOT_TRACK too. */
113
+ readonly TELEMETRY: "RETICLE_TELEMETRY";
114
+ readonly DO_NOT_TRACK: "DO_NOT_TRACK";
106
115
  /** Shared-secret the browser SDK must present in HELLO; absent ⇒ loopback-trust only. */
107
116
  readonly TOKEN: "RETICLE_TOKEN";
108
117
  /** Bridge bind host. Defaults to loopback; setting anything else is opt-in remote exposure. */
@@ -117,6 +126,8 @@ export declare const ReticleEnv: {
117
126
  readonly STATE_DIR: "RETICLE_STATE_DIR";
118
127
  /** Attach to an already-running browser over CDP instead of launching one. */
119
128
  readonly CDP_URL: "RETICLE_CDP_URL";
129
+ /** The Chromium executable to launch, in place of Playwright's own build or an installed Chrome. */
130
+ readonly CHROMIUM_PATH: "RETICLE_CHROMIUM_PATH";
120
131
  /** Max simultaneous leased headless contexts in the browser pool (resource cap). */
121
132
  readonly MAX_CONTEXTS: "RETICLE_MAX_CONTEXTS";
122
133
  /**
@@ -339,8 +350,9 @@ export declare const ReticleDir: {
339
350
  /**
340
351
  * the user's own record of what Reticle has done for them — .reticle/impact.json.
341
352
  *
342
- * Local only, never uploaded, and deliberately NOT part of telemetry: telemetry answers questions
343
- * about the product; this answers the user's question about their own work.
353
+ * NOT telemetry: telemetry answers questions about the product; this answers the user's question
354
+ * about their own work. A linked project's copy syncs to the user's own dashboard (the sync cycle's
355
+ * `impact` kind); the machine-wide copy in `~/.reticle` never leaves the machine.
344
356
  */
345
357
  readonly IMPACT_FILE: "impact.json";
346
358
  /** what changes were SUPPOSED to make true —.reticle/intent.json (git-checked, reviewed) */
@@ -355,14 +367,6 @@ export declare const ReticleDir: {
355
367
  * classified nor ignored.
356
368
  */
357
369
  readonly INTENT_SUBDIR: "intent";
358
- /**
359
- * what a drive types into a field, keyed by the field's label —.reticle/fill-values.json.
360
- *
361
- * Git-checked on purpose. A generated value is paid for once and then belongs to the project: the
362
- * next drive reuses it for free, a replay sends exactly what the recording sent, and a human who
363
- * dislikes one can edit the file rather than argue with a model.
364
- */
365
- readonly FILL_VALUES_FILE: "fill-values.json";
366
370
  /** opt-in pixel baselines —.reticle/visual/<name>.png + <name>.diff.png. */
367
371
  readonly VISUAL_SUBDIR: "visual";
368
372
  /** verification-run artifacts —.reticle/runs/<runId>.json (the OEM/CI-consumable verdict). */
@@ -377,6 +381,8 @@ export declare const ReticleDir: {
377
381
  * in three separate files, so the guard could not see it and nobody was ever asked.
378
382
  */
379
383
  readonly FEEDBACK_SUBDIR: "feedback";
384
+ /** Every Harness drive plan, and how each journey went — .reticle/plans/<when>-<planId>.json. */
385
+ readonly PLANS_SUBDIR: "plans";
380
386
  /** durable causal journal —.reticle/sessions/<id>/{events,actions}.jsonl (the substrate). */
381
387
  readonly SESSIONS_SUBDIR: "sessions";
382
388
  /** append-only event ledger inside a session dir (one ReticleEvent per line). */
@@ -400,6 +406,11 @@ export declare const ReticleDir: {
400
406
  readonly FLAKE_FILE: "flake.json";
401
407
  /** The app-wide coverage ledger — see server features/exhaust/ledger.ts. */
402
408
  readonly COVERAGE_FILE: "coverage.json";
409
+ /** Human review marks (HUD notes), pending and resolved — see server portal/session/human. */
410
+ readonly NOTES_FILE: "notes.json";
411
+ /** The user's latest request, as the agent relayed it. Local: it is the user's own words. */
412
+ readonly REQUEST_FILE: "request.json";
413
+ readonly PLATFORM_MOMENTS_FILE: "platform-moments.json";
403
414
  /**
404
415
  * the project's cloud binding — .reticle/cloud.json, written by `reticle link`. Git-checked and
405
416
  * non-secret: the project id, the API origin, and where its dashboard lives. The KEY lives in
@@ -603,6 +614,16 @@ export type InputMode = (typeof InputMode)[keyof typeof InputMode];
603
614
  export declare const InputModeReason: {
604
615
  readonly NOT_POINTER: "not-a-pointer-action";
605
616
  readonly SYNTHETIC_CLICK_PREFERRED: "synthetic-click-preferred";
617
+ /** A `press` that NAMED an element stays synthetic: dispatching at that element reaches it
618
+ * exactly, while a real keyboard sends the key to whatever holds focus. */
619
+ readonly SYNTHETIC_ELEMENT_PRESS_PREFERRED: "synthetic-element-press-preferred";
620
+ /** A `press` that named `keys` — several keys held down TOGETHER — stays synthetic: only the
621
+ * in-page dispatcher implements the down-in-order / up-in-reverse sequence. */
622
+ readonly SYNTHETIC_MULTI_KEY_PRESS_PREFERRED: "synthetic-multi-key-press-preferred";
623
+ /** A `press` that named an explicit `code` stays synthetic: the real driver presses by KEY name and
624
+ * cannot send a physical `code` that disagrees with it (`text:'z', code:'KeyY'` on a non-US
625
+ * layout), so a real chord would strike a different key than the one asked for. */
626
+ readonly SYNTHETIC_KEY_CODE_PRESS_PREFERRED: "synthetic-key-code-press-preferred";
606
627
  readonly PAGE_NOT_CORRELATED: "page-not-correlated-to-a-cdp-target";
607
628
  readonly ELEMENT_NOT_LOCATABLE: "element-not-locatable";
608
629
  readonly DRAG_TARGET_UNRESOLVED: "drag-target-unresolved";
@@ -641,6 +662,14 @@ export declare const DriveErrorCode: {
641
662
  readonly PLAYWRIGHT_MISSING: "playwright_missing";
642
663
  readonly LAUNCH_FAILED: "launch_failed";
643
664
  readonly NAVIGATE_FAILED: "navigate_failed";
665
+ /**
666
+ * A key could not be RELEASED after it was pressed. Distinct from every other drive failure
667
+ * because the browser is left in an unknown state: the key may still be down. The caller must
668
+ * not answer that by replaying the press synthetically — the replay lands on top of a keyboard
669
+ * that is already holding something, which is exactly the corruption the release exists to
670
+ * prevent.
671
+ */
672
+ readonly RELEASE_FAILED: "release_failed";
644
673
  };
645
674
  export type DriveErrorCode = (typeof DriveErrorCode)[keyof typeof DriveErrorCode];
646
675
  /** Human-facing message when the optional playwright dep is absent. */
@@ -809,12 +838,12 @@ export declare const ReticleCommand: {
809
838
  readonly NAVIGATE: "navigate";
810
839
  /** Reload the page. `args: { hard?: boolean }` — hard clears the cache via location replace trick. */
811
840
  readonly REFRESH: "refresh";
812
- /**
813
- * Bridge → browser: the saved flows the human can replay from the panel.
814
- * `args: { flows: [{ name, start? }] }` — `start` is the first step's testid anchor, a page hint the
815
- * HUD uses to show a flow only where it can begin. Absent when the first step isn't testid-anchored.
816
- */
841
+ /** Bridge → browser: replayable flows, `{ flows: [{ name, start? }] }`; `start` = first testid. */
817
842
  readonly FLOWS: "flows";
843
+ /** Bridge → browser: a HUD replay's progress, `{ name, done, total, status }`. */
844
+ readonly FLOW_PROGRESS: "flow.progress";
845
+ /** Bridge → browser: the Harness's drive plan and each part's status, a `PlanView`. */
846
+ readonly PLAN: "plan";
818
847
  };
819
848
  export type ReticleCommand = (typeof ReticleCommand)[keyof typeof ReticleCommand];
820
849
  /** Presenter intent shown to the human watcher: is the agent reading or acting? */
@@ -96,6 +96,12 @@ export const RETICLE_URL_PARAM = {
96
96
  * needs (nobody is sitting in front of it) without touching identity.
97
97
  */
98
98
  OPENED: '__reticle_opened',
99
+ /**
100
+ * How the HUD starts on a page Reticle opened: `shown`, `hidden` or `removed` (`HudVisibility`).
101
+ * On the URL rather than a command because a command sent before the HUD mounts is lost, and a
102
+ * headless drive should never paint a HUD it was asked not to.
103
+ */
104
+ HUD: '__reticle_hud',
99
105
  };
100
106
  /** The loopback bind address. The daemon/bridge bind here by default — never expose Reticle off-host. */
101
107
  export const LOOPBACK_HOST = '127.0.0.1';
@@ -105,6 +111,9 @@ export const LOOPBACK_HOST = '127.0.0.1';
105
111
  * here and nowhere else. The values are the literal process.env keys.
106
112
  */
107
113
  export const ReticleEnv = {
114
+ /** "0"/"false"/"off" turns off telemetry and every optional outbound call; DO_NOT_TRACK too. */
115
+ TELEMETRY: 'RETICLE_TELEMETRY',
116
+ DO_NOT_TRACK: 'DO_NOT_TRACK',
108
117
  /** Shared-secret the browser SDK must present in HELLO; absent ⇒ loopback-trust only. */
109
118
  TOKEN: 'RETICLE_TOKEN',
110
119
  /** Bridge bind host. Defaults to loopback; setting anything else is opt-in remote exposure. */
@@ -119,6 +128,8 @@ export const ReticleEnv = {
119
128
  STATE_DIR: 'RETICLE_STATE_DIR',
120
129
  /** Attach to an already-running browser over CDP instead of launching one. */
121
130
  CDP_URL: 'RETICLE_CDP_URL',
131
+ /** The Chromium executable to launch, in place of Playwright's own build or an installed Chrome. */
132
+ CHROMIUM_PATH: 'RETICLE_CHROMIUM_PATH',
122
133
  /** Max simultaneous leased headless contexts in the browser pool (resource cap). */
123
134
  MAX_CONTEXTS: 'RETICLE_MAX_CONTEXTS',
124
135
  /**
@@ -373,8 +384,9 @@ export const ReticleDir = {
373
384
  /**
374
385
  * the user's own record of what Reticle has done for them — .reticle/impact.json.
375
386
  *
376
- * Local only, never uploaded, and deliberately NOT part of telemetry: telemetry answers questions
377
- * about the product; this answers the user's question about their own work.
387
+ * NOT telemetry: telemetry answers questions about the product; this answers the user's question
388
+ * about their own work. A linked project's copy syncs to the user's own dashboard (the sync cycle's
389
+ * `impact` kind); the machine-wide copy in `~/.reticle` never leaves the machine.
378
390
  */
379
391
  IMPACT_FILE: 'impact.json',
380
392
  /** what changes were SUPPOSED to make true —.reticle/intent.json (git-checked, reviewed) */
@@ -389,14 +401,6 @@ export const ReticleDir = {
389
401
  * classified nor ignored.
390
402
  */
391
403
  INTENT_SUBDIR: 'intent',
392
- /**
393
- * what a drive types into a field, keyed by the field's label —.reticle/fill-values.json.
394
- *
395
- * Git-checked on purpose. A generated value is paid for once and then belongs to the project: the
396
- * next drive reuses it for free, a replay sends exactly what the recording sent, and a human who
397
- * dislikes one can edit the file rather than argue with a model.
398
- */
399
- FILL_VALUES_FILE: 'fill-values.json',
400
404
  /** opt-in pixel baselines —.reticle/visual/<name>.png + <name>.diff.png. */
401
405
  VISUAL_SUBDIR: 'visual',
402
406
  /** verification-run artifacts —.reticle/runs/<runId>.json (the OEM/CI-consumable verdict). */
@@ -411,6 +415,8 @@ export const ReticleDir = {
411
415
  * in three separate files, so the guard could not see it and nobody was ever asked.
412
416
  */
413
417
  FEEDBACK_SUBDIR: 'feedback',
418
+ /** Every Harness drive plan, and how each journey went — .reticle/plans/<when>-<planId>.json. */
419
+ PLANS_SUBDIR: 'plans',
414
420
  /** durable causal journal —.reticle/sessions/<id>/{events,actions}.jsonl (the substrate). */
415
421
  SESSIONS_SUBDIR: 'sessions',
416
422
  /** append-only event ledger inside a session dir (one ReticleEvent per line). */
@@ -434,6 +440,11 @@ export const ReticleDir = {
434
440
  FLAKE_FILE: 'flake.json',
435
441
  /** The app-wide coverage ledger — see server features/exhaust/ledger.ts. */
436
442
  COVERAGE_FILE: 'coverage.json',
443
+ /** Human review marks (HUD notes), pending and resolved — see server portal/session/human. */
444
+ NOTES_FILE: 'notes.json',
445
+ /** The user's latest request, as the agent relayed it. Local: it is the user's own words. */
446
+ REQUEST_FILE: 'request.json',
447
+ PLATFORM_MOMENTS_FILE: 'platform-moments.json', // moments already said, so each is said once
437
448
  /**
438
449
  * the project's cloud binding — .reticle/cloud.json, written by `reticle link`. Git-checked and
439
450
  * non-secret: the project id, the API origin, and where its dashboard lives. The KEY lives in
@@ -642,6 +653,16 @@ export const InputModeReason = {
642
653
  // Clicks default to the occlusion-honest synthetic path ("don't click, run the code") even with a
643
654
  // provider configured; pass action arg native:true to force a trusted native click when needed.
644
655
  SYNTHETIC_CLICK_PREFERRED: 'synthetic-click-preferred',
656
+ /** A `press` that NAMED an element stays synthetic: dispatching at that element reaches it
657
+ * exactly, while a real keyboard sends the key to whatever holds focus. */
658
+ SYNTHETIC_ELEMENT_PRESS_PREFERRED: 'synthetic-element-press-preferred',
659
+ /** A `press` that named `keys` — several keys held down TOGETHER — stays synthetic: only the
660
+ * in-page dispatcher implements the down-in-order / up-in-reverse sequence. */
661
+ SYNTHETIC_MULTI_KEY_PRESS_PREFERRED: 'synthetic-multi-key-press-preferred',
662
+ /** A `press` that named an explicit `code` stays synthetic: the real driver presses by KEY name and
663
+ * cannot send a physical `code` that disagrees with it (`text:'z', code:'KeyY'` on a non-US
664
+ * layout), so a real chord would strike a different key than the one asked for. */
665
+ SYNTHETIC_KEY_CODE_PRESS_PREFERRED: 'synthetic-key-code-press-preferred',
645
666
  PAGE_NOT_CORRELATED: 'page-not-correlated-to-a-cdp-target', // no CDP page matches session.url
646
667
  ELEMENT_NOT_LOCATABLE: 'element-not-locatable', // INSPECT returned no box (off-screen/stale ref)
647
668
  DRAG_TARGET_UNRESOLVED: 'drag-target-unresolved', // drag toRef missing or not locatable
@@ -678,6 +699,14 @@ export const DriveErrorCode = {
678
699
  PLAYWRIGHT_MISSING: 'playwright_missing',
679
700
  LAUNCH_FAILED: 'launch_failed',
680
701
  NAVIGATE_FAILED: 'navigate_failed',
702
+ /**
703
+ * A key could not be RELEASED after it was pressed. Distinct from every other drive failure
704
+ * because the browser is left in an unknown state: the key may still be down. The caller must
705
+ * not answer that by replaying the press synthetically — the replay lands on top of a keyboard
706
+ * that is already holding something, which is exactly the corruption the release exists to
707
+ * prevent.
708
+ */
709
+ RELEASE_FAILED: 'release_failed',
681
710
  };
682
711
  /** Human-facing message when the optional playwright dep is absent. */
683
712
  export const DRIVE_PLAYWRIGHT_MISSING_MSG = "reticle drive needs the optional 'playwright' package — install it: pnpm add -D playwright && npx playwright install chromium";
@@ -824,12 +853,12 @@ export const ReticleCommand = {
824
853
  NAVIGATE: 'navigate',
825
854
  /** Reload the page. `args: { hard?: boolean }` — hard clears the cache via location replace trick. */
826
855
  REFRESH: 'refresh',
827
- /**
828
- * Bridge → browser: the saved flows the human can replay from the panel.
829
- * `args: { flows: [{ name, start? }] }` — `start` is the first step's testid anchor, a page hint the
830
- * HUD uses to show a flow only where it can begin. Absent when the first step isn't testid-anchored.
831
- */
856
+ /** Bridge → browser: replayable flows, `{ flows: [{ name, start? }] }`; `start` = first testid. */
832
857
  FLOWS: 'flows',
858
+ /** Bridge → browser: a HUD replay's progress, `{ name, done, total, status }`. */
859
+ FLOW_PROGRESS: 'flow.progress',
860
+ /** Bridge → browser: the Harness's drive plan and each part's status, a `PlanView`. */
861
+ PLAN: 'plan',
833
862
  };
834
863
  /** Presenter intent shown to the human watcher: is the agent reading or acting? */
835
864
  export const PresenterMode = {
@@ -9,7 +9,7 @@
9
9
  * the browser test that walks the rendered HUD fails if any control has no id in this list.
10
10
  */
11
11
  /** The attributes whose value is part of the id. Read by the browser to build one. */
12
- export declare const HUD_KEYED_ATTRS: readonly ["setting", "check", "settings-cycle", "theme", "tour-target", "link"];
12
+ export declare const HUD_KEYED_ATTRS: readonly ["setting", "check", "settings-cycle", "theme", "tour-target", "link", "annotation-tab", "chat-view-btn"];
13
13
  /**
14
14
  * Is this a control id the HUD renders?
15
15
  *
@@ -25,9 +25,15 @@ const PLAIN_CONTROLS = [
25
25
  'min-btn',
26
26
  'chat-min',
27
27
  'chat-pill',
28
+ 'chat-impact',
29
+ 'copy-all-notes',
30
+ 'promo-link',
28
31
  'replay',
29
32
  'carousel-dot',
33
+ 'carousel-prev',
34
+ 'carousel-next',
30
35
  'carousel-close',
36
+ 'page-close',
31
37
  'offer-claim',
32
38
  'talk-book',
33
39
  'account-signin',
@@ -45,12 +51,23 @@ const PLAIN_CONTROLS = [
45
51
  'settings-help',
46
52
  'settings-reset',
47
53
  'settings-mcp',
54
+ 'settings-kill',
48
55
  'feedback-email',
49
56
  'feedback-call',
50
57
  'workspace-btn',
51
58
  'workspace-copy',
52
59
  'mark-cancel',
53
60
  'mark-send',
61
+ // The Agent Log's own Harness switch; the Settings one is `setting.harnessEnabled`.
62
+ 'harness-switch',
63
+ // "See all" beside the Agent Log's replay row, and below Impact's recent bugs.
64
+ 'flows-all',
65
+ 'defects-all',
66
+ // "See the logs" beside a replay the person started from a chip.
67
+ 'see-logs',
68
+ // The Harness plan board on the Agent Log: hide it, or open one journey's steps.
69
+ 'plan-close',
70
+ 'plan-journey',
54
71
  ];
55
72
  /** The attributes whose value is part of the id. Read by the browser to build one. */
56
73
  export const HUD_KEYED_ATTRS = [
@@ -60,6 +77,8 @@ export const HUD_KEYED_ATTRS = [
60
77
  'theme',
61
78
  'tour-target',
62
79
  'link',
80
+ 'annotation-tab',
81
+ 'chat-view-btn',
63
82
  ];
64
83
  /** Controls whose id also carries a key Reticle authored (`data-reticle-setting="x"` -> `setting.x`). */
65
84
  const KEYED_CONTROLS = {
@@ -78,6 +97,8 @@ const KEYED_CONTROLS = {
78
97
  theme: ['signal', 'traffic', 'mono', 'neon', 'ember'],
79
98
  'tour-target': ['copy', 'back', 'done', 'next', 'skip'],
80
99
  link: ['docs', 'github', 'site', 'discord', 'defect', 'dashboard'],
100
+ 'annotation-tab': ['current', 'history'],
101
+ 'chat-view-btn': ['activity', 'flows', 'annotations'],
81
102
  };
82
103
  let controls;
83
104
  /**
@@ -11,9 +11,15 @@ export declare const HudView: {
11
11
  readonly EXPANDED: "expanded";
12
12
  };
13
13
  export type HudView = (typeof HudView)[keyof typeof HudView];
14
- /** Which panel is showing, when the HUD is open. */
14
+ /**
15
+ * Which page is showing, when the HUD is open: the Agent Log (`chat`), the Flows and Notes pages
16
+ * inside it, Impact (`report`) or Settings. Timed per page, so how long somebody spends on each is a
17
+ * number rather than a guess.
18
+ */
15
19
  export declare const HudPanel: {
16
20
  readonly CHAT: "chat";
21
+ readonly FLOWS: "flows";
22
+ readonly NOTES: "notes";
17
23
  readonly SETTINGS: "settings";
18
24
  readonly REPORT: "report";
19
25
  readonly NONE: "none";
@@ -25,3 +31,60 @@ export declare const HudToggle: {
25
31
  readonly OFF: "off";
26
32
  };
27
33
  export type HudToggle = (typeof HudToggle)[keyof typeof HudToggle];
34
+ /**
35
+ * What an agent may do with the HUD when it sits over what it has to test (reticle_session tune).
36
+ * `removed` takes it off the page until the next reload; `hidden` keeps it ready to come back.
37
+ */
38
+ export declare const HudVisibility: {
39
+ readonly SHOWN: "shown";
40
+ readonly HIDDEN: "hidden";
41
+ readonly REMOVED: "removed";
42
+ };
43
+ export type HudVisibility = (typeof HudVisibility)[keyof typeof HudVisibility];
44
+ /** The corner an agent can move the HUD to; `bottom-right` is where it docks by default. */
45
+ export declare const HudCorner: {
46
+ readonly TOP_LEFT: "top-left";
47
+ readonly TOP_RIGHT: "top-right";
48
+ readonly BOTTOM_LEFT: "bottom-left";
49
+ readonly BOTTOM_RIGHT: "bottom-right";
50
+ };
51
+ export type HudCorner = (typeof HudCorner)[keyof typeof HudCorner];
52
+ /** Where a replay the human started from the HUD stands, for the chip's progress bar. */
53
+ export declare const FlowProgressStatus: {
54
+ readonly PLAYING: "playing";
55
+ readonly PASSED: "passed";
56
+ readonly FAILED: "failed";
57
+ };
58
+ export type FlowProgressStatus = (typeof FlowProgressStatus)[keyof typeof FlowProgressStatus];
59
+ /** Where one part of a Harness drive plan stands. */
60
+ export declare const ScriptStatus: {
61
+ readonly PENDING: "pending";
62
+ readonly RUNNING: "running";
63
+ readonly PASSED: "passed";
64
+ readonly FAILED: "failed";
65
+ /** Never started: something it needed failed. */
66
+ readonly BLOCKED: "blocked";
67
+ /** A branch case whose condition did not hold. Not a failure. */
68
+ readonly NOT_TAKEN: "not-taken";
69
+ };
70
+ export type ScriptStatus = (typeof ScriptStatus)[keyof typeof ScriptStatus];
71
+ /** The HUD's picture of a drive plan: lanes side by side, journeys in order, steps inside. */
72
+ export interface PlanView {
73
+ /** Lanes that may run at once. */
74
+ parallel: number;
75
+ lanes: {
76
+ id: string;
77
+ journeys: {
78
+ id: string;
79
+ title: string;
80
+ persona?: string;
81
+ /** Journeys in earlier lanes this one waits on. */
82
+ waitsOn: string[];
83
+ status: ScriptStatus;
84
+ steps: {
85
+ label: string;
86
+ status: ScriptStatus;
87
+ }[];
88
+ }[];
89
+ }[];
90
+ }
@@ -10,9 +10,15 @@ export const HudView = {
10
10
  COLLAPSED: 'collapsed',
11
11
  EXPANDED: 'expanded',
12
12
  };
13
- /** Which panel is showing, when the HUD is open. */
13
+ /**
14
+ * Which page is showing, when the HUD is open: the Agent Log (`chat`), the Flows and Notes pages
15
+ * inside it, Impact (`report`) or Settings. Timed per page, so how long somebody spends on each is a
16
+ * number rather than a guess.
17
+ */
14
18
  export const HudPanel = {
15
19
  CHAT: 'chat',
20
+ FLOWS: 'flows',
21
+ NOTES: 'notes',
16
22
  SETTINGS: 'settings',
17
23
  REPORT: 'report',
18
24
  NONE: 'none',
@@ -22,3 +28,36 @@ export const HudToggle = {
22
28
  ON: 'on',
23
29
  OFF: 'off',
24
30
  };
31
+ /**
32
+ * What an agent may do with the HUD when it sits over what it has to test (reticle_session tune).
33
+ * `removed` takes it off the page until the next reload; `hidden` keeps it ready to come back.
34
+ */
35
+ export const HudVisibility = {
36
+ SHOWN: 'shown',
37
+ HIDDEN: 'hidden',
38
+ REMOVED: 'removed',
39
+ };
40
+ /** The corner an agent can move the HUD to; `bottom-right` is where it docks by default. */
41
+ export const HudCorner = {
42
+ TOP_LEFT: 'top-left',
43
+ TOP_RIGHT: 'top-right',
44
+ BOTTOM_LEFT: 'bottom-left',
45
+ BOTTOM_RIGHT: 'bottom-right',
46
+ };
47
+ /** Where a replay the human started from the HUD stands, for the chip's progress bar. */
48
+ export const FlowProgressStatus = {
49
+ PLAYING: 'playing',
50
+ PASSED: 'passed',
51
+ FAILED: 'failed',
52
+ };
53
+ /** Where one part of a Harness drive plan stands. */
54
+ export const ScriptStatus = {
55
+ PENDING: 'pending',
56
+ RUNNING: 'running',
57
+ PASSED: 'passed',
58
+ FAILED: 'failed',
59
+ /** Never started: something it needed failed. */
60
+ BLOCKED: 'blocked',
61
+ /** A branch case whose condition did not hold. Not a failure. */
62
+ NOT_TAKEN: 'not-taken',
63
+ };
@@ -35,6 +35,14 @@ export declare const HumanControlKind: {
35
35
  * what to send is the daemon's question, and a panel that named artifacts could disagree with it.
36
36
  */
37
37
  readonly SYNC: "sync";
38
+ /**
39
+ * Human pressed Sign in in the panel. Carries nothing.
40
+ *
41
+ * A page cannot write `~/.reticle`, so the panel used to copy `reticle login` and stop there: a
42
+ * dead end for anybody who does not live in a terminal. The daemon owns the credential, so it
43
+ * starts the same browser approval flow `reticle login` does and the panel repaints when it lands.
44
+ */
45
+ readonly SIGNIN: "signin";
38
46
  /**
39
47
  * Human flipped the harness switch in the panel. `text` carries `on` or `off`.
40
48
  *
@@ -36,6 +36,14 @@ export const HumanControlKind = {
36
36
  * what to send is the daemon's question, and a panel that named artifacts could disagree with it.
37
37
  */
38
38
  SYNC: 'sync',
39
+ /**
40
+ * Human pressed Sign in in the panel. Carries nothing.
41
+ *
42
+ * A page cannot write `~/.reticle`, so the panel used to copy `reticle login` and stop there: a
43
+ * dead end for anybody who does not live in a terminal. The daemon owns the credential, so it
44
+ * starts the same browser approval flow `reticle login` does and the panel repaints when it lands.
45
+ */
46
+ SIGNIN: 'signin',
39
47
  /**
40
48
  * Human flipped the harness switch in the panel. `text` carries `on` or `off`.
41
49
  *
@@ -20,6 +20,8 @@
20
20
  export declare const RETICLE_IPC_GLOBAL = "__reticleIpc";
21
21
  /** The ipcMain channel the capture helper answers, invoked by the preload on the SDK's behalf. */
22
22
  export declare const RETICLE_CAPTURE_CHANNEL = "__reticle:capture";
23
+ /** The ipcMain channel that answers which window asked: the label the app registered it under. */
24
+ export declare const RETICLE_WINDOW_CHANNEL = "__reticle:window";
23
25
  /**
24
26
  * Filename prefix for a screenshot the main process writes to the OS temp directory.
25
27
  *
@@ -61,6 +63,7 @@ export declare const RETICLE_NOT_COMPOSITED: string;
61
63
  export declare const DESKTOP_CONTRACT: {
62
64
  readonly RETICLE_IPC_GLOBAL: "__reticleIpc";
63
65
  readonly RETICLE_CAPTURE_CHANNEL: "__reticle:capture";
66
+ readonly RETICLE_WINDOW_CHANNEL: "__reticle:window";
64
67
  readonly RETICLE_CAPTURE_FILE_PREFIX: "reticle-capture-";
65
68
  readonly RETICLE_TAURI_CAPTURE_COMMAND: "reticle_capture";
66
69
  readonly RETICLE_FULL_PAGE_UNSUPPORTED: string;
@@ -21,6 +21,8 @@ import { VisualReason } from './constants/constants.js';
21
21
  export const RETICLE_IPC_GLOBAL = '__reticleIpc';
22
22
  /** The ipcMain channel the capture helper answers, invoked by the preload on the SDK's behalf. */
23
23
  export const RETICLE_CAPTURE_CHANNEL = '__reticle:capture';
24
+ /** The ipcMain channel that answers which window asked: the label the app registered it under. */
25
+ export const RETICLE_WINDOW_CHANNEL = '__reticle:window';
24
26
  /**
25
27
  * Filename prefix for a screenshot the main process writes to the OS temp directory.
26
28
  *
@@ -62,6 +64,7 @@ export const RETICLE_NOT_COMPOSITED = VisualReason.NOT_COMPOSITED;
62
64
  export const DESKTOP_CONTRACT = {
63
65
  RETICLE_IPC_GLOBAL,
64
66
  RETICLE_CAPTURE_CHANNEL,
67
+ RETICLE_WINDOW_CHANNEL,
65
68
  RETICLE_CAPTURE_FILE_PREFIX,
66
69
  RETICLE_TAURI_CAPTURE_COMMAND,
67
70
  RETICLE_FULL_PAGE_UNSUPPORTED,