@reticlehq/browser 2.13.1 → 2.14.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 (196) hide show
  1. package/dist/actions/actions-dom.d.ts +0 -20
  2. package/dist/actions/actions-dom.js +0 -66
  3. package/dist/actions/actions-press.d.ts +10 -0
  4. package/dist/actions/actions-press.js +77 -0
  5. package/dist/actions/actions.d.ts +0 -89
  6. package/dist/actions/actions.js +24 -358
  7. package/dist/actions/appeared-text.d.ts +0 -20
  8. package/dist/actions/appeared-text.js +0 -36
  9. package/dist/actions/danger-context.d.ts +3 -0
  10. package/dist/actions/danger-context.js +39 -0
  11. package/dist/actions/scroll.d.ts +0 -9
  12. package/dist/actions/scroll.js +0 -7
  13. package/dist/actions/synthetic-input.d.ts +0 -7
  14. package/dist/actions/synthetic-input.js +0 -27
  15. package/dist/actions/value-input.d.ts +0 -30
  16. package/dist/actions/value-input.js +0 -33
  17. package/dist/commands/commands.d.ts +0 -2
  18. package/dist/commands/commands.js +0 -67
  19. package/dist/connect-options.d.ts +2 -96
  20. package/dist/dom/a11y.d.ts +0 -29
  21. package/dist/dom/a11y.js +1 -88
  22. package/dist/dom/auto-anchor.d.ts +0 -40
  23. package/dist/dom/auto-anchor.js +0 -33
  24. package/dist/dom/chart.d.ts +0 -61
  25. package/dist/dom/chart.js +0 -60
  26. package/dist/dom/desktop-capture.d.ts +0 -30
  27. package/dist/dom/desktop-capture.js +0 -72
  28. package/dist/dom/dom-ignore.d.ts +0 -30
  29. package/dist/dom/dom-ignore.js +0 -47
  30. package/dist/dom/occlusion.d.ts +0 -7
  31. package/dist/dom/occlusion.js +0 -7
  32. package/dist/dom/query.d.ts +0 -14
  33. package/dist/dom/query.js +48 -214
  34. package/dist/dom/realm.d.ts +0 -20
  35. package/dist/dom/realm.js +0 -28
  36. package/dist/dom/refs.d.ts +0 -76
  37. package/dist/dom/refs.js +2 -133
  38. package/dist/dom/shadow-registry.d.ts +0 -33
  39. package/dist/dom/shadow-registry.js +2 -72
  40. package/dist/dom/snapshot.d.ts +2 -43
  41. package/dist/dom/snapshot.js +26 -151
  42. package/dist/dom/source.d.ts +0 -44
  43. package/dist/dom/source.js +0 -45
  44. package/dist/dom/theme.d.ts +0 -37
  45. package/dist/dom/theme.js +2 -52
  46. package/dist/dom/virtualized.d.ts +0 -17
  47. package/dist/dom/virtualized.js +0 -27
  48. package/dist/edit-epoch.d.ts +0 -22
  49. package/dist/edit-epoch.js +0 -52
  50. package/dist/index.js +1 -23
  51. package/dist/observers/animation.d.ts +0 -1
  52. package/dist/observers/animation.js +0 -3
  53. package/dist/observers/blind-spots.d.ts +0 -26
  54. package/dist/observers/blind-spots.js +2 -61
  55. package/dist/observers/console.d.ts +1 -2
  56. package/dist/observers/console.js +41 -30
  57. package/dist/observers/context-open.d.ts +1 -11
  58. package/dist/observers/context-open.js +10 -14
  59. package/dist/observers/departure.d.ts +3 -0
  60. package/dist/observers/departure.js +52 -0
  61. package/dist/observers/dialogs.d.ts +2 -0
  62. package/dist/observers/dialogs.js +39 -0
  63. package/dist/observers/dom.js +0 -44
  64. package/dist/observers/download.d.ts +1 -2
  65. package/dist/observers/download.js +38 -55
  66. package/dist/observers/focus.d.ts +0 -6
  67. package/dist/observers/focus.js +0 -7
  68. package/dist/observers/frames.d.ts +0 -9
  69. package/dist/observers/frames.js +1 -28
  70. package/dist/observers/health.d.ts +0 -5
  71. package/dist/observers/health.js +1 -33
  72. package/dist/observers/install-all.d.ts +2 -0
  73. package/dist/observers/install-all.js +26 -27
  74. package/dist/observers/ipc.d.ts +0 -25
  75. package/dist/observers/ipc.js +0 -65
  76. package/dist/observers/navigation.d.ts +2 -0
  77. package/dist/observers/navigation.js +33 -0
  78. package/dist/observers/network-body.d.ts +5 -28
  79. package/dist/observers/network-body.js +11 -108
  80. package/dist/observers/network-redact.d.ts +1 -20
  81. package/dist/observers/network-redact.js +1 -80
  82. package/dist/observers/network-stream.d.ts +0 -21
  83. package/dist/observers/network-stream.js +1 -44
  84. package/dist/observers/network.d.ts +2 -26
  85. package/dist/observers/network.js +177 -294
  86. package/dist/observers/perf.d.ts +0 -10
  87. package/dist/observers/perf.js +0 -16
  88. package/dist/observers/route.d.ts +1 -2
  89. package/dist/observers/route.js +13 -19
  90. package/dist/observers/scroll.d.ts +0 -1
  91. package/dist/observers/scroll.js +0 -9
  92. package/dist/observers/sdk-failure.d.ts +1 -9
  93. package/dist/observers/sdk-failure.js +1 -30
  94. package/dist/observers/state.d.ts +1 -11
  95. package/dist/observers/state.js +13 -41
  96. package/dist/observers/storage.d.ts +0 -14
  97. package/dist/observers/storage.js +10 -34
  98. package/dist/observers/types.d.ts +0 -15
  99. package/dist/observers/types.js +0 -14
  100. package/dist/patching/capture-method.d.ts +0 -24
  101. package/dist/patching/capture-method.js +0 -26
  102. package/dist/presenter/overlay.d.ts +0 -1
  103. package/dist/presenter/overlay.js +0 -1
  104. package/dist/presenter/presenter-brand.d.ts +0 -19
  105. package/dist/presenter/presenter-brand.js +0 -21
  106. package/dist/presenter/presenter-config.d.ts +1 -105
  107. package/dist/presenter/presenter-config.js +2 -91
  108. package/dist/presenter/presenter-controls.d.ts +0 -29
  109. package/dist/presenter/presenter-controls.js +3 -131
  110. package/dist/presenter/presenter-dock-layout.d.ts +0 -3
  111. package/dist/presenter/presenter-dock-layout.js +0 -4
  112. package/dist/presenter/presenter-drag.d.ts +2 -24
  113. package/dist/presenter/presenter-drag.js +0 -26
  114. package/dist/presenter/presenter-effects.d.ts +0 -9
  115. package/dist/presenter/presenter-effects.js +0 -9
  116. package/dist/presenter/presenter-glow.d.ts +0 -21
  117. package/dist/presenter/presenter-glow.js +1 -27
  118. package/dist/presenter/presenter-heroicons-data.d.ts +0 -8
  119. package/dist/presenter/presenter-heroicons-data.js +0 -8
  120. package/dist/presenter/presenter-hud-chrome.d.ts +0 -10
  121. package/dist/presenter/presenter-hud-chrome.js +0 -10
  122. package/dist/presenter/presenter-icons.d.ts +0 -6
  123. package/dist/presenter/presenter-icons.js +0 -6
  124. package/dist/presenter/presenter-log.d.ts +0 -38
  125. package/dist/presenter/presenter-log.js +1 -45
  126. package/dist/presenter/presenter-report-copy.d.ts +5 -66
  127. package/dist/presenter/presenter-report-copy.js +5 -66
  128. package/dist/presenter/presenter-report-styles.d.ts +0 -6
  129. package/dist/presenter/presenter-report-styles.js +6 -6
  130. package/dist/presenter/presenter-report.d.ts +4 -7
  131. package/dist/presenter/presenter-report.js +18 -76
  132. package/dist/presenter/presenter-run-state.d.ts +0 -7
  133. package/dist/presenter/presenter-run-state.js +0 -5
  134. package/dist/presenter/presenter-settings-styles.d.ts +0 -1
  135. package/dist/presenter/presenter-settings-styles.js +0 -1
  136. package/dist/presenter/presenter-settings.d.ts +1 -23
  137. package/dist/presenter/presenter-settings.js +1 -31
  138. package/dist/presenter/presenter-shell-styles.js +2 -5
  139. package/dist/presenter/presenter-shell.d.ts +2 -18
  140. package/dist/presenter/presenter-shell.js +1 -73
  141. package/dist/presenter/presenter-styles.d.ts +0 -9
  142. package/dist/presenter/presenter-styles.js +0 -9
  143. package/dist/presenter/presenter-tally.d.ts +0 -5
  144. package/dist/presenter/presenter-tally.js +0 -4
  145. package/dist/presenter/presenter-test-helpers.d.ts +0 -2
  146. package/dist/presenter/presenter-test-helpers.js +0 -2
  147. package/dist/presenter/presenter-verbs.js +0 -7
  148. package/dist/presenter/presenter-workspace.d.ts +0 -4
  149. package/dist/presenter/presenter-workspace.js +1 -8
  150. package/dist/presenter/presenter.d.ts +0 -60
  151. package/dist/presenter/presenter.js +4 -118
  152. package/dist/recorder/recorder-styles.d.ts +0 -6
  153. package/dist/recorder/recorder-styles.js +0 -6
  154. package/dist/recorder/recorder.d.ts +0 -34
  155. package/dist/recorder/recorder.js +0 -49
  156. package/dist/registry/adapters.d.ts +0 -10
  157. package/dist/registry/adapters.js +0 -10
  158. package/dist/registry/auto-testids.d.ts +0 -19
  159. package/dist/registry/auto-testids.js +1 -21
  160. package/dist/registry/capabilities.d.ts +0 -31
  161. package/dist/registry/capabilities.js +1 -46
  162. package/dist/registry/commit-and-signal.d.ts +0 -6
  163. package/dist/registry/commit-and-signal.js +1 -7
  164. package/dist/registry/domains.d.ts +0 -8
  165. package/dist/registry/domains.js +0 -7
  166. package/dist/registry/emitter.d.ts +0 -14
  167. package/dist/registry/emitter.js +0 -10
  168. package/dist/registry/store-adapters.d.ts +0 -186
  169. package/dist/registry/store-adapters.js +0 -163
  170. package/dist/registry/stores.d.ts +0 -33
  171. package/dist/registry/stores.js +0 -59
  172. package/dist/reticle-presenter-helpers.d.ts +0 -13
  173. package/dist/reticle-presenter-helpers.js +0 -14
  174. package/dist/reticle.d.ts +1 -52
  175. package/dist/reticle.js +20 -145
  176. package/dist/review/annotator-styles.js +0 -7
  177. package/dist/review/annotator.d.ts +2 -13
  178. package/dist/review/annotator.js +0 -40
  179. package/dist/review/mark-anchor.d.ts +0 -11
  180. package/dist/review/mark-anchor.js +0 -8
  181. package/dist/security/serialization.d.ts +0 -20
  182. package/dist/security/serialization.js +1 -66
  183. package/dist/session-continuity.d.ts +0 -16
  184. package/dist/session-continuity.js +1 -20
  185. package/dist/timers/clock.d.ts +1 -14
  186. package/dist/timers/clock.js +59 -60
  187. package/dist/timers/native-console.js +0 -4
  188. package/dist/timers/native-timers.d.ts +0 -25
  189. package/dist/timers/native-timers.js +3 -33
  190. package/dist/transport/transport.d.ts +0 -51
  191. package/dist/transport/transport.js +3 -129
  192. package/dist/transport/unreachable-message.d.ts +0 -17
  193. package/dist/transport/unreachable-message.js +0 -17
  194. package/dist/util/captured-method.d.ts +0 -35
  195. package/dist/util/captured-method.js +0 -35
  196. package/package.json +2 -2
@@ -1,22 +1,3 @@
1
- /**
2
- * The artwork constants are annotated `: string` deliberately.
3
- *
4
- * Without the annotation TypeScript infers a literal type, and every one of these SVG and HTML
5
- * strings is copied verbatim into the emitted `.d.ts` as its own type. That duplicated the artwork
6
- * into the published package twice over: this file's declarations alone were 16KB of a 900KB
7
- * budget, carrying type information nobody can use - no caller cares about the literal type of a
8
- * `<path d=...>`.
9
- */
10
- /**
11
- * Brand marks, inlined. The SDK is bundled into someone else's page: it cannot read
12
- * `assets/logo/*.svg` from disk at runtime and must never fetch from our own domain, so the mark
13
- * lives here as a string (same precedent as SEND_ICON in presenter-controls.ts).
14
- * Minified - editor metadata, clip paths, masks and sub-0.01 precision stripped - and painted
15
- * with `currentColor` so the mark tracks --reticle-fg instead of hardcoding the export's #FAFAFA.
16
- */
17
- /** Accessible name of the HUD. */
18
1
  export declare const BRAND_NAME = "Reticle";
19
- /** Mark alone (shown in the FAB and compact toolbar). */
20
2
  export declare const MARK_SVG: string;
21
- /** Collapsed FAB control - Reticle mark only. */
22
3
  export declare const FAB_TOGGLE_HTML: string;
@@ -1,26 +1,5 @@
1
- /**
2
- * The artwork constants are annotated `: string` deliberately.
3
- *
4
- * Without the annotation TypeScript infers a literal type, and every one of these SVG and HTML
5
- * strings is copied verbatim into the emitted `.d.ts` as its own type. That duplicated the artwork
6
- * into the published package twice over: this file's declarations alone were 16KB of a 900KB
7
- * budget, carrying type information nobody can use - no caller cares about the literal type of a
8
- * `<path d=...>`.
9
- */
10
- /**
11
- * Brand marks, inlined. The SDK is bundled into someone else's page: it cannot read
12
- * `assets/logo/*.svg` from disk at runtime and must never fetch from our own domain, so the mark
13
- * lives here as a string (same precedent as SEND_ICON in presenter-controls.ts).
14
- * Minified - editor metadata, clip paths, masks and sub-0.01 precision stripped - and painted
15
- * with `currentColor` so the mark tracks --reticle-fg instead of hardcoding the export's #FAFAFA.
16
- */
17
- /** Accessible name of the HUD. */
18
1
  export const BRAND_NAME = 'Reticle';
19
- /** The two glyph paths of the mark. */
20
2
  const MARK_PATHS = `<path d="M92.82 92.16C93.07 93.4 91.77 94.4 90.63 93.83C89.62 93.33 88.62 92.82 87.63 92.3C71.14 83.78 54.79 72.27 39.61 57.96C39.09 57.49 38.57 56.98 38.06 56.49C22.45 41.52 9.78 25.14 .33 8.52C0.29 8.45 .25 8.38 .2 8.31C-0.44 7.2 .51 5.84 1.79 6.05L24.07 9.71C43.06 12.83 60.63 11.75 75.55 6.53L93.95 .09C95.15-0.33 96.31 .78 95.93 1.98L90.1 20.49C85.37 35.48 84.9 52.97 88.69 71.73L92.83 92.16H92.82Z"/><path d="M58.72 89.23L6.15 92.8C5.24 92.86 4.48 92.13 4.51 91.22L6.56 30.39C6.61 28.91 8.51 28.36 9.35 29.57C16.23 39.43 24.98 52.35 33.01 61.26C41.05 70.17 50.6 78.72 59.62 86.56C60.65 87.45 60.08 89.13 58.72 89.23Z"/>`;
21
- /** Mark alone (shown in the FAB and compact toolbar). */
22
3
  export const MARK_SVG = `<svg class="reticle-mark" viewBox="0 0 96 94" fill="currentColor" aria-hidden="true">${MARK_PATHS}</svg>`;
23
- /** FAB-sized mark for the collapsed circular control. */
24
4
  const FAB_MARK_SVG = `<svg class="reticle-fab-mark" viewBox="0 0 96 94" fill="currentColor" aria-hidden="true">${MARK_PATHS}</svg>`;
25
- /** Collapsed FAB control - Reticle mark only. */
26
5
  export const FAB_TOGGLE_HTML = `<button type="button" class="reticle-fab" data-reticle-fab aria-label="Start ${BRAND_NAME}" aria-expanded="false">${FAB_MARK_SVG}<span class="reticle-fab-pulse" aria-hidden="true"></span><span data-reticle-mark-count class="reticle-fab-badge" hidden>0</span></button>`;
@@ -1,14 +1,4 @@
1
1
  import type { ControlHandler } from './presenter-controls.js';
2
- /**
3
- * Presenter tunables + option surface. Split out of presenter.ts so that file is just the controller
4
- * under the size cap; these are pure declarations (interfaces + named constants), no behavior. None
5
- * cross the browser↔bridge↔agent wire, so they live here, not in @reticlehq/core.
6
- */
7
- /**
8
- * Border behavior.
9
- * - 'session': base border persists connect→disconnect; the busy machine drives only the shimmer.
10
- * - 'busy': back-compat - the busy machine toggles the base border on/off.
11
- */
12
2
  export declare const BorderMode: {
13
3
  readonly SESSION: "session";
14
4
  readonly BUSY: "busy";
@@ -20,179 +10,85 @@ export declare const BUSY_ON = "1";
20
10
  export declare const BUSY_OFF = "0";
21
11
  export interface PresenterOptions {
22
12
  paceMs?: number;
23
- /** Injected monotonic clock for the glow state machine (tests drive transitions). */
24
13
  now?: () => number;
25
- /** Quiet window before busy -> fading. Overridable so tests run fast. */
26
14
  idleAfterMs?: number;
27
- /** Fade duration before fading -> idle (keep in sync with the glow CSS opacity transition). */
28
15
  glowFadeMs?: number;
29
- /** Liveness heartbeat interval (ms). Overridable so tests run fast. */
30
16
  heartbeatMs?: number;
31
- /** Quiet (ms) after which the act strip shows the live "idle · {duration}" clock. Test-overridable. */
32
17
  idleNoticeMs?: number;
33
- /** Quiet (ms) after which the session AUTO-ENDS (glow off, panel kept). Default 5min; agent-tunable. */
34
18
  idleEndMs?: number;
35
- /** Session id, surfaced in the exported run state. */
36
19
  sessionId?: string;
37
- /** Deprecated: accepted for source compat; the live log no longer auto-expires. */
38
20
  narrationDwellMs?: number;
39
- /**
40
- * 'session' (default): base border persists connect→disconnect, busy machine drives only the
41
- * shimmer. 'busy': back-compat - busy machine toggles the base border on/off.
42
- */
43
21
  border?: BorderMode;
44
- /** Max accumulated activity-log rows before the oldest are pruned. Default 50. */
45
22
  logMax?: number;
46
- /** Called when the human clicks pause/resume/end or sends a message from the panel. */
47
23
  onControl?: ControlHandler;
48
- /** Overridable ended-border fade delay (native timer). Default 4000. */
49
24
  endedFadeMs?: number;
50
25
  }
51
26
  export declare const DEFAULT_PACE = 450;
52
- /**
53
- * The pace to actually use: the default in a browser a human is watching, zero in an automated one.
54
- *
55
- * The HUD paces `beforeAct` so a person can see the cursor reach the element before it fires. In a
56
- * headless browser that is 450ms of nothing, charged to the agent, on every action. Measured with
57
- * RETICLE_TRACE across the e2e battery: 42 `act` round-trips, 40 of them in a 452–460ms band -
58
- * a fixed cost, not app work - 19.7 SECONDS in total, 98.5% of all time the battery spent in the
59
- * browser, while every other command ran in 1–4ms.
60
- *
61
- * `navigator.webdriver` is the discriminator because it is exactly the question being asked: true
62
- * under automation (Playwright, CDP, the browser pool's leased tabs, CI), false in the dev browser
63
- * a human has open - the case the HUD exists for, which keeps its pacing untouched.
64
- *
65
- * An EXPLICIT `paceMs` always wins: a recorded demo runs under automation and still wants the glide,
66
- * and an option that quietly ignores what the caller asked for is worse than no option.
67
- */
68
27
  export declare function effectivePaceMs(requested: number | undefined, nav?: Navigator | undefined): number;
69
- /**
70
- * Glow state machine phases (exposed via glowPhase for tests). A burst of activity flips the
71
- * border IN once on the first activity, holds steady (the slow reticle-pulse breathing keeps running
72
- * uninterrupted - no per-action restart/strobe), then fades OUT once after a quiet window.
73
- */
74
28
  export declare const GlowPhase: {
75
29
  readonly IDLE: "idle";
76
30
  readonly BUSY: "busy";
77
31
  readonly FADING: "fading";
78
32
  };
79
33
  export type GlowPhase = (typeof GlowPhase)[keyof typeof GlowPhase];
80
- /** Quiet window before busy -> fading. */
81
34
  export declare const IDLE_AFTER_MS = 700;
82
- /** Liveness heartbeat: how often the act strip refreshes its "idle · {duration}" clock. */
83
35
  export declare const HEARTBEAT_MS = 1000;
84
- /**
85
- * After this much quiet, the act strip stops showing the last action and starts a LIVE, ticking
86
- * "◌ idle · {duration} since last action" - so a watcher can tell a 3s think from a dead agent
87
- * (the killer gap: a frozen panel used to look identical whether the agent paused or stopped).
88
- */
89
36
  export declare const IDLE_NOTICE_MS = 4000;
90
- /** Act-strip copy (presenter-only UI). */
91
37
  export declare const ACT_STRIP: {
92
38
  readonly READY: "Ready";
93
39
  readonly IDLE_PREFIX: "idle · ";
94
40
  readonly NOW: "now";
95
41
  readonly SINCE_LAST: " since last action";
96
42
  };
97
- /** Default session-idle-end: after this much quiet the session auto-ends (glow off, panel persists
98
- * for analysis). Agent-tweakable via reticle_session { idleEndMs } for the app's needs. */
99
43
  export declare const IDLE_END_MS = 300000;
100
- /** Floor for a tweaked idle-end so the agent can't set a uselessly tiny window. */
101
44
  export declare const IDLE_END_MIN_MS = 5000;
102
- /** Must match the glow CSS opacity transition.25s) so phase reaches idle after the fade paints. */
103
45
  export declare const GLOW_FADE_MS = 250;
104
46
  export declare const GLOW_ON = "1";
105
47
  export declare const GLOW_OFF = "0";
106
48
  export declare const DATA_ON = "data-on";
107
- /** The overlay root's state attribute, which the shell styles resolve colour against. */
108
49
  export declare const STATE_ATTR = "data-reticle-state";
109
- /**
110
- * Not a SessionState: there is no session. It is the absence of one, said out loud.
111
- *
112
- * Kept off `SessionState` deliberately — that enum crosses the wire, and this state exists only
113
- * because nothing crossed the wire.
114
- */
115
50
  export declare const UNREACHABLE_STATE = "unreachable";
116
- /** Overlay-root attribute toggled when the HUD is collapsed to the FAB. */
117
51
  export declare const MIN_ATTR = "data-reticle-min";
118
- /** Overlay-root attribute toggled when the agent chat panel is open. */
119
52
  export declare const CHAT_ATTR = "data-reticle-chat";
120
- /** Fixed dock wrapper that stacks chat above the morphing HUD shell. */
121
53
  export declare const DOCK_ATTR = "data-reticle-dock";
122
- /** Collapsed circular control that expands the toolbar. */
123
54
  export declare const FAB_ATTR = "data-reticle-fab";
124
- /** Toolbar chat toggle button. */
125
55
  export declare const CHAT_TOGGLE_ATTR = "data-reticle-chat-toggle";
126
- /** Agent chat panel anchored to the dock. */
127
56
  export declare const CHAT_PANEL_ATTR = "data-reticle-chat-panel";
128
- /** Chat panel opens above or below the HUD bar depending on viewport space. */
129
57
  export declare const CHAT_PLACEMENT_ATTR = "data-reticle-chat-placement";
130
- /** Settings card opens above or below the HUD bar depending on viewport space. */
131
58
  export declare const SETTINGS_PLACEMENT_ATTR = "data-reticle-settings-placement";
132
- /** Horizontal alignment of dock-anchored panels (start = left, end = right). */
133
59
  export declare const DOCK_ALIGN_ATTR = "data-reticle-dock-align";
134
60
  export declare const Placement: {
135
61
  readonly ABOVE: "above";
136
62
  readonly BELOW: "below";
137
63
  };
138
- /** Show/hide annotation markers. */
139
64
  export declare const MARKERS_BTN_ATTR = "data-reticle-markers-btn";
140
- /** Clear every annotation on the page. */
141
65
  export declare const CLEAR_MARKS_ATTR = "data-reticle-clear-marks";
142
- /** Collapsed FAB annotation-count badge. */
143
66
  export declare const MARK_COUNT_ATTR = "data-reticle-mark-count";
144
- /**
145
- * Turn annotation on and off from the toolbar.
146
- *
147
- * Annotation used to be reachable only as a side effect of expanding the HUD, which meant there was
148
- * no way to keep the HUD open and stop annotating, and nothing on screen said the mode existed at
149
- * all. It is a mode the user chooses, so it gets a control they can see and press.
150
- */
151
67
  export declare const ANNOTATE_BTN_ATTR = "data-reticle-annotate-btn";
152
- /** Minimise the agent chat back to the toolbar, without collapsing the whole HUD. */
153
68
  export declare const CHAT_MIN_ATTR = "data-reticle-chat-min";
154
- /** Overlay flag: is the impact report on screen. */
155
69
  export declare const REPORT_ATTR = "data-reticle-report";
156
- /** The report panel itself. */
157
70
  export declare const REPORT_PANEL_ATTR = "data-reticle-report-panel";
158
- /** The report's close button. */
159
71
  export declare const REPORT_CLOSE_ATTR = "data-reticle-report-close";
160
- /** The toolbar button that opens the report. */
161
72
  export declare const REPORT_BTN_ATTR = "data-reticle-report-btn";
162
- /** The capsule that stands in for the chat while it is minimised - state dot + last action. */
163
73
  export declare const CHAT_PILL_ATTR = "data-reticle-chat-pill";
164
- /** Settings gear is open - the card sits above the dock. */
165
74
  export declare const SETTINGS_ATTR = "data-reticle-settings";
166
75
  export declare const SETTINGS_BTN_ATTR = "data-reticle-settings-btn";
167
76
  export declare const SETTINGS_PANEL_ATTR = "data-reticle-settings-panel";
168
77
  export declare const SETTINGS_CLOSE_ATTR = "data-reticle-settings-close";
169
78
  export declare const SETTING_KEY_ATTR = "data-reticle-setting";
170
79
  export declare const SETTINGS_STORAGE_KEY = "reticle-presenter-settings";
171
- /** Accent swatch applied to the dock chrome. */
172
- /** Overlay flag: is the page-edge glow wanted at all (user setting). */
173
80
  export declare const AMBIENT_GLOW_ATTR = "data-reticle-ambient-glow";
174
- /** Overlay mirror of the activity strip's liveness, so CSS can pick the ACTIVE status colour. */
175
81
  export declare const LIVENESS_ATTR = "data-reticle-live";
176
- /** When 1, a transparent blocker captures page pointer events. */
177
82
  export declare const BLOCK_ATTR = "data-reticle-block";
178
- /** When 1, the dock is hidden until the page reloads. */
179
83
  export declare const HIDDEN_UNTIL_RESTART_ATTR = "data-reticle-hidden";
180
- /** When 0, activity-log timestamps are hidden. */
181
84
  export declare const LOG_TIMESTAMPS_ATTR = "data-reticle-log-ts";
182
- /** When 1, the chat panel uses a narrower width. */
183
- /** When 1, HUD motion is reduced for accessibility. */
184
85
  export declare const REDUCE_MOTION_ATTR = "data-reticle-reduce-motion";
185
- /** Docs opened from the settings footer. */
186
86
  export declare const MCP_DOCS_URL: string;
187
- /** HUD has been dragged off the default dock - positioned with explicit left/top. */
188
87
  export declare const HUD_DRAGGED_ATTR = "data-dragged";
189
- /** CSS custom properties written when the HUD is dragged. */
190
88
  export declare const HUD_POS_X_VAR = "--reticle-hud-x";
191
89
  export declare const HUD_POS_Y_VAR = "--reticle-hud-y";
192
- /** Pointer movement below this threshold is treated as a click, not a drag. */
193
90
  export declare const HUD_DRAG_THRESHOLD_PX = 4;
194
- /** Minimum gap between a dragged HUD and the viewport edge. */
195
91
  export declare const HUD_DOCK_MARGIN_PX = 8;
196
- /** Interactive nodes inside the drag handle that must not start a drag (not the FAB itself). */
197
92
  export declare const HUD_DRAG_IGNORE_SEL: string;
198
93
  export declare const THROTTLED_ATTR = "data-reticle-throttled";
94
+ export declare const Z_HUD_TOOLTIP = 100;
@@ -1,163 +1,74 @@
1
- /**
2
- * Presenter tunables + option surface. Split out of presenter.ts so that file is just the controller
3
- * under the size cap; these are pure declarations (interfaces + named constants), no behavior. None
4
- * cross the browser↔bridge↔agent wire, so they live here, not in @reticlehq/core.
5
- */
6
- /**
7
- * Border behavior.
8
- * - 'session': base border persists connect→disconnect; the busy machine drives only the shimmer.
9
- * - 'busy': back-compat - the busy machine toggles the base border on/off.
10
- */
11
1
  export const BorderMode = { SESSION: 'session', BUSY: 'busy' };
12
2
  export const DEFAULT_BORDER_MODE = BorderMode.SESSION;
13
3
  export const DATA_BUSY = 'data-busy';
14
4
  export const BUSY_ON = '1';
15
5
  export const BUSY_OFF = '0';
16
6
  export const DEFAULT_PACE = 450;
17
- /**
18
- * The pace to actually use: the default in a browser a human is watching, zero in an automated one.
19
- *
20
- * The HUD paces `beforeAct` so a person can see the cursor reach the element before it fires. In a
21
- * headless browser that is 450ms of nothing, charged to the agent, on every action. Measured with
22
- * RETICLE_TRACE across the e2e battery: 42 `act` round-trips, 40 of them in a 452–460ms band -
23
- * a fixed cost, not app work - 19.7 SECONDS in total, 98.5% of all time the battery spent in the
24
- * browser, while every other command ran in 1–4ms.
25
- *
26
- * `navigator.webdriver` is the discriminator because it is exactly the question being asked: true
27
- * under automation (Playwright, CDP, the browser pool's leased tabs, CI), false in the dev browser
28
- * a human has open - the case the HUD exists for, which keeps its pacing untouched.
29
- *
30
- * An EXPLICIT `paceMs` always wins: a recorded demo runs under automation and still wants the glide,
31
- * and an option that quietly ignores what the caller asked for is worse than no option.
32
- */
33
7
  export function effectivePaceMs(requested, nav = 'undefined' === typeof navigator ? undefined : navigator) {
34
8
  if (requested !== undefined)
35
9
  return requested;
36
10
  return true === nav?.webdriver ? 0 : DEFAULT_PACE;
37
11
  }
38
- /**
39
- * Glow state machine phases (exposed via glowPhase for tests). A burst of activity flips the
40
- * border IN once on the first activity, holds steady (the slow reticle-pulse breathing keeps running
41
- * uninterrupted - no per-action restart/strobe), then fades OUT once after a quiet window.
42
- */
43
12
  export const GlowPhase = {
44
13
  IDLE: 'idle',
45
14
  BUSY: 'busy',
46
15
  FADING: 'fading',
47
16
  };
48
- /** Quiet window before busy -> fading. */
49
17
  export const IDLE_AFTER_MS = 700;
50
- /** Liveness heartbeat: how often the act strip refreshes its "idle · {duration}" clock. */
51
18
  export const HEARTBEAT_MS = 1000;
52
- /**
53
- * After this much quiet, the act strip stops showing the last action and starts a LIVE, ticking
54
- * "◌ idle · {duration} since last action" - so a watcher can tell a 3s think from a dead agent
55
- * (the killer gap: a frozen panel used to look identical whether the agent paused or stopped).
56
- */
57
19
  export const IDLE_NOTICE_MS = 4000;
58
- /** Act-strip copy (presenter-only UI). */
59
20
  export const ACT_STRIP = {
60
21
  READY: 'Ready',
61
22
  IDLE_PREFIX: 'idle · ',
62
23
  NOW: 'now',
63
24
  SINCE_LAST: ' since last action',
64
25
  };
65
- /** Default session-idle-end: after this much quiet the session auto-ends (glow off, panel persists
66
- * for analysis). Agent-tweakable via reticle_session { idleEndMs } for the app's needs. */
67
26
  export const IDLE_END_MS = 300_000;
68
- /** Floor for a tweaked idle-end so the agent can't set a uselessly tiny window. */
69
27
  export const IDLE_END_MIN_MS = 5_000;
70
- /** Must match the glow CSS opacity transition.25s) so phase reaches idle after the fade paints. */
71
28
  export const GLOW_FADE_MS = 250;
72
29
  export const GLOW_ON = '1';
73
30
  export const GLOW_OFF = '0';
74
31
  export const DATA_ON = 'data-on';
75
- /** The overlay root's state attribute, which the shell styles resolve colour against. */
76
32
  export const STATE_ATTR = 'data-reticle-state';
77
- /**
78
- * Not a SessionState: there is no session. It is the absence of one, said out loud.
79
- *
80
- * Kept off `SessionState` deliberately — that enum crosses the wire, and this state exists only
81
- * because nothing crossed the wire.
82
- */
83
33
  export const UNREACHABLE_STATE = 'unreachable';
84
- /** Overlay-root attribute toggled when the HUD is collapsed to the FAB. */
85
34
  export const MIN_ATTR = 'data-reticle-min';
86
- /** Overlay-root attribute toggled when the agent chat panel is open. */
87
35
  export const CHAT_ATTR = 'data-reticle-chat';
88
- /** Fixed dock wrapper that stacks chat above the morphing HUD shell. */
89
36
  export const DOCK_ATTR = 'data-reticle-dock';
90
- /** Collapsed circular control that expands the toolbar. */
91
37
  export const FAB_ATTR = 'data-reticle-fab';
92
- /** Toolbar chat toggle button. */
93
38
  export const CHAT_TOGGLE_ATTR = 'data-reticle-chat-toggle';
94
- /** Agent chat panel anchored to the dock. */
95
39
  export const CHAT_PANEL_ATTR = 'data-reticle-chat-panel';
96
- /** Chat panel opens above or below the HUD bar depending on viewport space. */
97
40
  export const CHAT_PLACEMENT_ATTR = 'data-reticle-chat-placement';
98
- /** Settings card opens above or below the HUD bar depending on viewport space. */
99
41
  export const SETTINGS_PLACEMENT_ATTR = 'data-reticle-settings-placement';
100
- /** Horizontal alignment of dock-anchored panels (start = left, end = right). */
101
42
  export const DOCK_ALIGN_ATTR = 'data-reticle-dock-align';
102
43
  export const Placement = { ABOVE: 'above', BELOW: 'below' };
103
- /** Show/hide annotation markers. */
104
44
  export const MARKERS_BTN_ATTR = 'data-reticle-markers-btn';
105
- /** Clear every annotation on the page. */
106
45
  export const CLEAR_MARKS_ATTR = 'data-reticle-clear-marks';
107
- /** Collapsed FAB annotation-count badge. */
108
46
  export const MARK_COUNT_ATTR = 'data-reticle-mark-count';
109
- /**
110
- * Turn annotation on and off from the toolbar.
111
- *
112
- * Annotation used to be reachable only as a side effect of expanding the HUD, which meant there was
113
- * no way to keep the HUD open and stop annotating, and nothing on screen said the mode existed at
114
- * all. It is a mode the user chooses, so it gets a control they can see and press.
115
- */
116
47
  export const ANNOTATE_BTN_ATTR = 'data-reticle-annotate-btn';
117
- /** Minimise the agent chat back to the toolbar, without collapsing the whole HUD. */
118
48
  export const CHAT_MIN_ATTR = 'data-reticle-chat-min';
119
- /** Overlay flag: is the impact report on screen. */
120
49
  export const REPORT_ATTR = 'data-reticle-report';
121
- /** The report panel itself. */
122
50
  export const REPORT_PANEL_ATTR = 'data-reticle-report-panel';
123
- /** The report's close button. */
124
51
  export const REPORT_CLOSE_ATTR = 'data-reticle-report-close';
125
- /** The toolbar button that opens the report. */
126
52
  export const REPORT_BTN_ATTR = 'data-reticle-report-btn';
127
- /** The capsule that stands in for the chat while it is minimised - state dot + last action. */
128
53
  export const CHAT_PILL_ATTR = 'data-reticle-chat-pill';
129
- /** Settings gear is open - the card sits above the dock. */
130
54
  export const SETTINGS_ATTR = 'data-reticle-settings';
131
55
  export const SETTINGS_BTN_ATTR = 'data-reticle-settings-btn';
132
56
  export const SETTINGS_PANEL_ATTR = 'data-reticle-settings-panel';
133
57
  export const SETTINGS_CLOSE_ATTR = 'data-reticle-settings-close';
134
58
  export const SETTING_KEY_ATTR = 'data-reticle-setting';
135
59
  export const SETTINGS_STORAGE_KEY = 'reticle-presenter-settings';
136
- /** Accent swatch applied to the dock chrome. */
137
- /** Overlay flag: is the page-edge glow wanted at all (user setting). */
138
60
  export const AMBIENT_GLOW_ATTR = 'data-reticle-ambient-glow';
139
- /** Overlay mirror of the activity strip's liveness, so CSS can pick the ACTIVE status colour. */
140
61
  export const LIVENESS_ATTR = 'data-reticle-live';
141
- /** When 1, a transparent blocker captures page pointer events. */
142
62
  export const BLOCK_ATTR = 'data-reticle-block';
143
- /** When 1, the dock is hidden until the page reloads. */
144
63
  export const HIDDEN_UNTIL_RESTART_ATTR = 'data-reticle-hidden';
145
- /** When 0, activity-log timestamps are hidden. */
146
64
  export const LOG_TIMESTAMPS_ATTR = 'data-reticle-log-ts';
147
- /** When 1, the chat panel uses a narrower width. */
148
- /** When 1, HUD motion is reduced for accessibility. */
149
65
  export const REDUCE_MOTION_ATTR = 'data-reticle-reduce-motion';
150
- /** Docs opened from the settings footer. */
151
66
  export const MCP_DOCS_URL = 'https://github.com/reticlehq/reticle/blob/main/docs/getting-started.md';
152
- /** HUD has been dragged off the default dock - positioned with explicit left/top. */
153
67
  export const HUD_DRAGGED_ATTR = 'data-dragged';
154
- /** CSS custom properties written when the HUD is dragged. */
155
68
  export const HUD_POS_X_VAR = '--reticle-hud-x';
156
69
  export const HUD_POS_Y_VAR = '--reticle-hud-y';
157
- /** Pointer movement below this threshold is treated as a click, not a drag. */
158
70
  export const HUD_DRAG_THRESHOLD_PX = 4;
159
- /** Minimum gap between a dragged HUD and the viewport edge. */
160
71
  export const HUD_DOCK_MARGIN_PX = 8;
161
- /** Interactive nodes inside the drag handle that must not start a drag (not the FAB itself). */
162
- export const HUD_DRAG_IGNORE_SEL = '[data-reticle-pause], [data-reticle-annotate-btn], [data-reticle-markers-btn], [data-reticle-clear-marks], [data-reticle-end], [data-reticle-min-btn], [data-reticle-settings-btn], [data-reticle-settings-panel], [data-reticle-report-btn], [data-reticle-report-panel], [data-reticle-chat-panel], [data-reticle-chat-toggle], [data-reticle-workspace-btn], [data-reticle-workspace-menu], [data-reticle-copy], [data-reticle-export], [data-reticle-send], input, textarea, select, a, .reticle-head-ctl, [data-reticle-tally], .reticle-maxhint';
72
+ export const HUD_DRAG_IGNORE_SEL = '[data-reticle-pause], [data-reticle-annotate-btn], [data-reticle-markers-btn], [data-reticle-clear-marks], [data-reticle-end], [data-reticle-min-btn], [data-reticle-settings-btn], [data-reticle-settings-panel], [data-reticle-report-btn], [data-reticle-report-panel], [data-reticle-chat-panel], [data-reticle-chat-toggle], [data-reticle-workspace-btn], [data-reticle-workspace-menu], [data-reticle-copy], [data-reticle-export], input, textarea, select, a, .reticle-head-ctl, [data-reticle-tally], .reticle-maxhint';
163
73
  export const THROTTLED_ATTR = 'data-reticle-throttled';
74
+ export const Z_HUD_TOOLTIP = 100;
@@ -1,21 +1,14 @@
1
1
  import { HumanControlKind, PresenterTone, SessionState } from '@reticlehq/core';
2
- /** Border fade-out delay after a session ends (native timer; presenter-only tunable). */
3
2
  export declare const ENDED_FADE_MS = 4000;
4
- /** Payload the panel hands to its host when the human drives a control. */
5
3
  export interface ControlIntent {
6
4
  kind: HumanControlKind;
7
5
  text?: string;
8
6
  }
9
7
  export type ControlHandler = (intent: ControlIntent) => void;
10
- /** CSS for the control surface (injected with the rest of the presenter stylesheet). */
11
8
  export declare const CONTROLS_CSS: string;
12
- /** Icon toolbar: pause, chat, markers, end, clear - copy/export appear after a run ends. */
13
9
  export declare const CONTROLS_TOOLBAR_HTML: string;
14
- /** Banner markup (between head and log, hidden unless ended). */
15
10
  export declare const CONTROLS_BANNER_HTML = "<div data-reticle-banner class=\"reticle-banner\">Session ended</div>";
16
- /** Replay-a-flow row (between log and footer); buttons are filled in by setFlows once flows arrive. */
17
11
  export declare const CONTROLS_FLOWS_HTML = "<div data-reticle-flows class=\"reticle-flows\"><span class=\"reticle-flows-cap\">Replay a flow</span></div>";
18
- /** Footer markup: composer only (export icons live in the toolbar). */
19
12
  export declare const CONTROLS_FOOT_HTML: string;
20
13
  interface ControlPanelHost {
21
14
  emit: (kind: HumanControlKind, text?: string) => void;
@@ -25,36 +18,14 @@ interface ControlPanelHost {
25
18
  clearRunLog?: () => void;
26
19
  onStateChange?: (state: SessionState) => void;
27
20
  }
28
- /**
29
- * The live-control panel: owns the control element refs, the SessionState, the ended-fade timer,
30
- * the DOM wiring, and the data-reticle-state visual machine. Split out of Presenter to keep both files
31
- * under the 500-line cap. A click handler both emits a control AND optimistically applies state; the
32
- * server's PRESENTER echo re-syncs via setState only (never emits) so a control is delivered once.
33
- */
34
21
  export declare class ControlPanel {
35
22
  #private;
36
23
  constructor(host: ControlPanelHost);
37
24
  get state(): SessionState;
38
- /** Query control refs out of the mounted root and bind the DOM listeners, then paint active. */
39
25
  mount(root: HTMLElement, glow: HTMLElement | undefined): void;
40
- /** Clear any pending ended-fade timer (called from Presenter.destroy). */
41
26
  teardown(): void;
42
- /** Render the replayable-flow chips from the server push. Each ▶ click re-runs that flow, no agent.
43
- * Takes the raw wire value and narrows it here (the panel is the consumer of this push). */
44
27
  setFlows(flows: unknown): void;
45
- /**
46
- * Re-render the replay chips for the CURRENT page. A flow "starts here" iff its first step's anchor
47
- * (a testid `start` hint) is present in the live DOM; flows with no start hint (signal/role-first,
48
- * un-checkable) always show. Called on connect and on every route change so the list tracks the page -
49
- * so you never see (or click) a flow that can't replay from where you are. Existing flows benefit
50
- * without re-recording, since the hint is derived from the first step, not stored on the flow.
51
- */
52
28
  refilterFlows(): void;
53
- /**
54
- * Drive the panel's visual state. Idempotent; NEVER emits a control - the shared path for both the
55
- * optimistic local click and the authoritative server PRESENTER echo. Only the ended-border fade
56
- * touches a clock, via the injected native timer.
57
- */
58
29
  setState(state: SessionState, text?: string, tone?: PresenterTone): void;
59
30
  }
60
31
  export {};