@reticlehq/core 3.2.0 → 3.4.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 (91) hide show
  1. package/README.md +1 -1
  2. package/dist/artifacts/flow-composition.d.ts +3 -2
  3. package/dist/artifacts/flow-constants.d.ts +68 -2
  4. package/dist/artifacts/flow-constants.js +84 -2
  5. package/dist/artifacts/flow-expect-flat.d.ts +260 -0
  6. package/dist/artifacts/flow-expect-flat.js +284 -0
  7. package/dist/artifacts/flow-mutation-target.d.ts +0 -1
  8. package/dist/artifacts/flow-mutation-target.js +30 -2
  9. package/dist/artifacts/flow-step-tool.d.ts +2 -0
  10. package/dist/artifacts/flow-types.d.ts +1285 -1343
  11. package/dist/artifacts/flow-types.js +111 -140
  12. package/dist/artifacts/impact.d.ts +48 -20
  13. package/dist/artifacts/impact.js +11 -0
  14. package/dist/artifacts/journal.d.ts +34 -6
  15. package/dist/artifacts/journal.js +13 -0
  16. package/dist/hooks/hook-events.d.ts +18 -18
  17. package/dist/hud-entry.d.ts +9 -0
  18. package/dist/hud-entry.js +9 -0
  19. package/dist/identity/source-constants.d.ts +11 -0
  20. package/dist/identity/source-constants.js +11 -0
  21. package/dist/index.d.ts +9 -0
  22. package/dist/index.js +25 -1
  23. package/dist/onboarding.d.ts +2 -2
  24. package/dist/realm/registry.d.ts +0 -8
  25. package/dist/realm/registry.js +1 -11
  26. package/dist/registry/daemon-registry.d.ts +14 -4
  27. package/dist/registry/daemon-registry.js +20 -4
  28. package/dist/schema/event-message.json +3 -1
  29. package/dist/schema/event-payloads.json +72 -0
  30. package/dist/schema/event-type.json +3 -1
  31. package/dist/schema/reticle-event.json +3 -1
  32. package/dist/schema/reticle-message.json +3 -1
  33. package/dist/source-constants.cjs +1 -0
  34. package/dist/source-constants.d.cts +1 -0
  35. package/dist/telemetry-feedback.d.ts +6 -6
  36. package/dist/telemetry-refusal.d.ts +5 -4
  37. package/dist/telemetry-session.d.ts +25 -2
  38. package/dist/telemetry-session.js +13 -0
  39. package/dist/telemetry.d.ts +130 -102
  40. package/dist/verdict/compare-source.d.ts +80 -0
  41. package/dist/verdict/compare-source.js +93 -0
  42. package/dist/verdict/consequence.d.ts +12 -0
  43. package/dist/verdict/consequence.js +15 -0
  44. package/dist/verdict/instrumentation-gap.js +1 -1
  45. package/dist/verdict/intent.d.ts +24 -0
  46. package/dist/verdict/intent.js +66 -10
  47. package/dist/verdict/predicate-tree.d.ts +82 -0
  48. package/dist/verdict/predicate-tree.js +186 -0
  49. package/dist/verdict/predicate.d.ts +138 -0
  50. package/dist/verdict/predicate.js +430 -0
  51. package/dist/verdict/property-assertion.d.ts +191 -0
  52. package/dist/verdict/property-assertion.js +42 -0
  53. package/dist/verdict/security.js +16 -4
  54. package/dist/verdict/verdict-attribution.d.ts +52 -0
  55. package/dist/verdict/verdict-attribution.js +87 -0
  56. package/dist/verdict/verification-run.d.ts +330 -83
  57. package/dist/verdict/verification-run.js +44 -1
  58. package/dist/verdict/verified-constants.d.ts +9 -0
  59. package/dist/verdict/verified-constants.js +9 -0
  60. package/dist/wire/channel.d.ts +10 -0
  61. package/dist/wire/channel.js +25 -0
  62. package/dist/wire/constants/constants.d.ts +65 -102
  63. package/dist/wire/constants/constants.js +79 -101
  64. package/dist/wire/constants/discovery.d.ts +25 -0
  65. package/dist/wire/constants/discovery.js +25 -0
  66. package/dist/wire/constants/event-types.d.ts +122 -0
  67. package/dist/wire/constants/event-types.js +121 -0
  68. package/dist/wire/constants/hud-controls.d.ts +19 -0
  69. package/dist/wire/constants/hud-controls.js +95 -0
  70. package/dist/wire/constants/hud-use.d.ts +27 -0
  71. package/dist/wire/constants/hud-use.js +24 -0
  72. package/dist/wire/constants/session-constants.d.ts +10 -0
  73. package/dist/wire/constants/session-constants.js +10 -0
  74. package/dist/wire/event-payloads.d.ts +72 -13
  75. package/dist/wire/event-payloads.js +26 -4
  76. package/dist/wire/messages.d.ts +97 -56
  77. package/dist/wire/messages.js +17 -0
  78. package/dist/wire/net.d.ts +35 -0
  79. package/dist/wire/net.js +41 -0
  80. package/dist/wire/redaction.js +17 -0
  81. package/dist/wire/state-select.d.ts +2 -1
  82. package/dist/wire/state-select.js +56 -3
  83. package/dist/wire/toon.d.ts +1 -1
  84. package/dist/wire/toon.js +30 -8
  85. package/dist/wire/types.d.ts +119 -94
  86. package/dist/wire/types.js +23 -1
  87. package/dist/words/no-session-reason.d.ts +7 -0
  88. package/dist/words/no-session-reason.js +7 -0
  89. package/dist/words/notices.d.ts +7 -0
  90. package/dist/words/notices.js +9 -2
  91. package/package.json +7 -2
@@ -0,0 +1,25 @@
1
+ /**
2
+ * The invitation to talk to the people building Reticle.
3
+ *
4
+ * One link and one set of words for every surface that offers it — the CLI report, the session end,
5
+ * the in-page panel, the moment Reticle failed somebody, and the agent's instructions — so changing
6
+ * the booking link is a one-line edit and no surface can drift to a dead one.
7
+ *
8
+ * Always for the HUMAN. The agent's wording asks it to OFFER the link and never to act on it: an agent
9
+ * that books a call or submits an email on somebody's behalf is the outbound instruction a careful
10
+ * evaluator reads as a reason not to install.
11
+ */
12
+ /** The booking link published on reticle.sh. */
13
+ export declare const DISCOVERY_CALL_URL = "https://calendar.app.google/h9NRDbBBQetyTzWM6";
14
+ /** Where a person writes to the founder directly. */
15
+ export declare const FOUNDER_EMAIL = "hey@reticle.sh";
16
+ /** A mailto for that address, subject filled so the note is findable in the inbox. A literal: see first-load-size. */
17
+ export declare const FOUNDER_MAILTO = "mailto:hey@reticle.sh?subject=Reticle%20feedback";
18
+ /** How somebody leaves an email instead — opt-in, saved locally, undone with `--forget`. */
19
+ export declare const DISCOVERY_EMAIL_COMMAND = "npx @reticlehq/server identify --context company --email you@company.com";
20
+ export declare const DiscoveryInvite: {
21
+ /** Shown to the person using Reticle. */
22
+ readonly HUMAN: "Stuck, or want Reticle to work differently? Talk to the founder: https://calendar.app.google/h9NRDbBBQetyTzWM6 · or leave your email: npx @reticlehq/server identify --context company --email you@company.com";
23
+ /** Read by the agent, which passes it on rather than acting on it. */
24
+ readonly AGENT: "If the person you are working with is stuck or Reticle got in their way, offer them a call with the founder (https://calendar.app.google/h9NRDbBBQetyTzWM6) or the email command (npx @reticlehq/server identify --context company --email you@company.com). Offer it; never book a call or submit an email for them.";
25
+ };
@@ -0,0 +1,25 @@
1
+ /**
2
+ * The invitation to talk to the people building Reticle.
3
+ *
4
+ * One link and one set of words for every surface that offers it — the CLI report, the session end,
5
+ * the in-page panel, the moment Reticle failed somebody, and the agent's instructions — so changing
6
+ * the booking link is a one-line edit and no surface can drift to a dead one.
7
+ *
8
+ * Always for the HUMAN. The agent's wording asks it to OFFER the link and never to act on it: an agent
9
+ * that books a call or submits an email on somebody's behalf is the outbound instruction a careful
10
+ * evaluator reads as a reason not to install.
11
+ */
12
+ /** The booking link published on reticle.sh. */
13
+ export const DISCOVERY_CALL_URL = 'https://calendar.app.google/h9NRDbBBQetyTzWM6';
14
+ /** Where a person writes to the founder directly. */
15
+ export const FOUNDER_EMAIL = 'hey@reticle.sh';
16
+ /** A mailto for that address, subject filled so the note is findable in the inbox. A literal: see first-load-size. */
17
+ export const FOUNDER_MAILTO = 'mailto:hey@reticle.sh?subject=Reticle%20feedback';
18
+ /** How somebody leaves an email instead — opt-in, saved locally, undone with `--forget`. */
19
+ export const DISCOVERY_EMAIL_COMMAND = 'npx @reticlehq/server identify --context company --email you@company.com';
20
+ export const DiscoveryInvite = {
21
+ /** Shown to the person using Reticle. */
22
+ HUMAN: `Stuck, or want Reticle to work differently? Talk to the founder: ${DISCOVERY_CALL_URL} · or leave your email: ${DISCOVERY_EMAIL_COMMAND}`,
23
+ /** Read by the agent, which passes it on rather than acting on it. */
24
+ AGENT: `If the person you are working with is stuck or Reticle got in their way, offer them a call with the founder (${DISCOVERY_CALL_URL}) or the email command (${DISCOVERY_EMAIL_COMMAND}). Offer it; never book a call or submit an email for them.`,
25
+ };
@@ -0,0 +1,122 @@
1
+ /**
2
+ * The event vocabulary: every normalized type the ring buffer can hold.
3
+ *
4
+ * Split out of `constants.ts` when that file crossed the 1000-line cap while gaining a channel for
5
+ * form fields. Cohesive on its own terms, and the most-read list in the contract: this is the set an
6
+ * observer produces, a predicate reasons over and a replayed step's digest counts, and each member
7
+ * carries the argument for why that channel exists at all.
8
+ *
9
+ * Re-exported from `constants.ts`, so `EventType` stays one import path for everyone outside core.
10
+ */
11
+ export declare const EventType: {
12
+ readonly DOM_ADDED: "dom.added";
13
+ readonly DOM_REMOVED: "dom.removed";
14
+ readonly DOM_ATTR: "dom.attr";
15
+ readonly DOM_TEXT: "dom.text";
16
+ readonly NET_REQUEST: "net.request";
17
+ readonly NET_PENDING: "net.pending";
18
+ /** An SSE (EventSource) or WebSocket frame — a message on a long-lived streaming connection. */
19
+ readonly NET_STREAM: "net.stream";
20
+ /** A web-perf metric a screenshot can't verify: LCP, cumulative layout shift, or a long task. */
21
+ readonly PERF: "perf";
22
+ readonly ROUTE_CHANGE: "route.change";
23
+ readonly CONSOLE_LOG: "console.log";
24
+ readonly CONSOLE_WARN: "console.warn";
25
+ readonly CONSOLE_ERROR: "console.error";
26
+ readonly CONSOLE_INFO: "console.info";
27
+ readonly CONSOLE_DEBUG: "console.debug";
28
+ readonly ERROR_UNCAUGHT: "error.uncaught";
29
+ readonly VISIBLE_SHOWN: "visible.shown";
30
+ readonly ANIM_START: "anim.start";
31
+ readonly ANIM_END: "anim.end";
32
+ readonly SCROLL_POSITION: "scroll.position";
33
+ readonly REVEAL_SHOWN: "reveal.shown";
34
+ readonly SIGNAL: "signal";
35
+ readonly STATE_CHANGE: "state.change";
36
+ /** a write to localStorage/sessionStorage/cookies — `data: { area, key, old?, new? }` (values redacted). */
37
+ readonly STORAGE_CHANGE: "storage.change";
38
+ /** page-level visibility/focus health (distinct from element-level VISIBLE_*). */
39
+ readonly PAGE_HEALTH: "page.health";
40
+ /**
41
+ * synthetic: the page called window.open, so the consequence of what was just clicked may live in
42
+ * another browsing context this one cannot observe (an OAuth popup is the archetype).
43
+ * `data: { href }` — the URL the page asked to open, when it named one.
44
+ */
45
+ readonly CONTEXT_OPENED: "context.opened";
46
+ /**
47
+ * The app opened a native `alert`/`confirm`/`prompt` while Reticle was driving it.
48
+ *
49
+ * Recorded because Reticle ANSWERS these rather than letting them block — a native dialog halts
50
+ * the main thread, and the SDK's own message pump is on that thread, so one `confirm` behind a
51
+ * driven click made the tab permanently unresponsive with no recovery from inside the session.
52
+ * Answering silently would trade a wedge for an invisible one, so the question the app asked, and
53
+ * the answer given, ride out as an event.
54
+ */
55
+ readonly DIALOG_OPENED: "dialog.opened";
56
+ /** aggregated React commits over a throttle window (dev builds) — `data: { commits }`. Commit storms /
57
+ * wasted re-renders show up here without a per-render flood. */
58
+ readonly RENDER_COMMIT: "render.commit";
59
+ /** element focus moved — `data: { to, from, toBody }`. Focus dropping to body after an act is a regression. */
60
+ readonly FOCUS_CHANGE: "focus.change";
61
+ /**
62
+ * a form field's value moved — `data: { field, kind, value?, redacted?, length }`.
63
+ *
64
+ * The DOM observer never saw this: `value` is in its attribute allowlist, but React and every
65
+ * controlled input set the PROPERTY, so `MutationObserver` does not fire. `value` is omitted and
66
+ * `redacted` set for a password, a sensitive name, or a payment autocomplete hint; `length` is
67
+ * always present, because "it was wiped" is assertable without carrying anybody's data.
68
+ */
69
+ readonly FIELD_CHANGE: "field.change";
70
+ /** browser → bridge: a human recording compiled in-page. */
71
+ readonly FLOW_RECORDED: "flow.recorded";
72
+ /** synthetic: browser transport queue overflowed; events were dropped. `data: { dropped: number }`. */
73
+ readonly TRANSPORT_OVERFLOW: "transport.overflow";
74
+ /**
75
+ * synthetic: a per-channel cap truncated a batch (e.g. a DOM mutation flood). `data: { channel, dropped }`.
76
+ * Marks downstream rollups/envelopes as built on incomplete data — a ledger that lies at scale is worse
77
+ * than no ledger, so truncation is never silent.
78
+ */
79
+ readonly TRUNCATED: "truncated";
80
+ /**
81
+ * synthetic: the SDK detected a region it CANNOT observe (a cross-origin iframe, a closed shadow root).
82
+ * `data: { kind: BlindSpotKind, count }`. Surfaced on results as `coverage: partial` so a green never
83
+ * implies it saw everything.
84
+ */
85
+ readonly BLIND_SPOT: "blind-spot";
86
+ /** synthetic: the SDK ITSELF failed (an observer threw). `data: { site, message, errorType }`.
87
+ * Rides the existing bridge — no outbound request. See browser/observers/sdk-failure.ts. */
88
+ readonly SDK_FAILED: "sdk.failed";
89
+ /**
90
+ * synthetic (driven only): CDP/Playwright-authoritative network detail for a response the in-page
91
+ * fetch/XHR wrapper also saw — full response headers + authoritative status/mimeType the page-side
92
+ * wrapper can't reach. `data: { url, method?, status, headers, resourceType? }`. Merged onto the
93
+ * matching in-page NET_REQUEST so the driven view never loses fidelity to an outside-in tool.
94
+ */
95
+ readonly NET_DETAIL: "net.detail";
96
+ /**
97
+ * Live-control: browser → bridge. A human acted on the presenter panel.
98
+ * `data: { kind: HumanControlKind; text?: string }`. Rides the existing EventMessage.
99
+ */
100
+ readonly HUMAN_CONTROL: "human.control";
101
+ /**
102
+ * Human review: browser → bridge. A human pinned a mistake to an element on the running page
103
+ * (the "annotate the bug where you see it" loop). `data` narrows to HumanMarkDataSchema — a note
104
+ * plus a re-resolvable element anchor (and its source file:line when the framework stamped one) so
105
+ * the agent that drains the mark knows exactly which element and which source to fix.
106
+ */
107
+ readonly HUMAN_MARK: "human.mark";
108
+ /**
109
+ * The app produced a FILE — a Blob handed to `URL.createObjectURL`, usually saved by clicking an
110
+ * anchor with `download`. `data: { filename?, mimeType, bytes, lines?, preview? }`. The one artifact
111
+ * class no outside-the-browser tool can inspect: it never crosses the network, so there is no
112
+ * request to intercept. See `observers/download.ts` for the defect that motivated it.
113
+ */
114
+ readonly DOWNLOAD: "download";
115
+ /**
116
+ * Browser -> bridge: a person used the HUD — pressed a control, or the HUD changed how it sits.
117
+ * `data` narrows to HudUseDataSchema: names only. Telemetry, not evidence: the session takes it
118
+ * off the wire before the buffer, so no verdict, settle or agent read ever sees it.
119
+ */
120
+ readonly HUD_USED: "hud.used";
121
+ };
122
+ export type EventType = (typeof EventType)[keyof typeof EventType];
@@ -0,0 +1,121 @@
1
+ /**
2
+ * The event vocabulary: every normalized type the ring buffer can hold.
3
+ *
4
+ * Split out of `constants.ts` when that file crossed the 1000-line cap while gaining a channel for
5
+ * form fields. Cohesive on its own terms, and the most-read list in the contract: this is the set an
6
+ * observer produces, a predicate reasons over and a replayed step's digest counts, and each member
7
+ * carries the argument for why that channel exists at all.
8
+ *
9
+ * Re-exported from `constants.ts`, so `EventType` stays one import path for everyone outside core.
10
+ */
11
+ export const EventType = {
12
+ DOM_ADDED: 'dom.added',
13
+ DOM_REMOVED: 'dom.removed',
14
+ DOM_ATTR: 'dom.attr',
15
+ DOM_TEXT: 'dom.text',
16
+ NET_REQUEST: 'net.request',
17
+ NET_PENDING: 'net.pending',
18
+ /** An SSE (EventSource) or WebSocket frame — a message on a long-lived streaming connection. */
19
+ NET_STREAM: 'net.stream',
20
+ /** A web-perf metric a screenshot can't verify: LCP, cumulative layout shift, or a long task. */
21
+ PERF: 'perf',
22
+ ROUTE_CHANGE: 'route.change',
23
+ CONSOLE_LOG: 'console.log',
24
+ CONSOLE_WARN: 'console.warn',
25
+ CONSOLE_ERROR: 'console.error',
26
+ CONSOLE_INFO: 'console.info',
27
+ CONSOLE_DEBUG: 'console.debug',
28
+ ERROR_UNCAUGHT: 'error.uncaught',
29
+ VISIBLE_SHOWN: 'visible.shown',
30
+ ANIM_START: 'anim.start',
31
+ ANIM_END: 'anim.end',
32
+ SCROLL_POSITION: 'scroll.position',
33
+ REVEAL_SHOWN: 'reveal.shown',
34
+ SIGNAL: 'signal',
35
+ STATE_CHANGE: 'state.change',
36
+ /** a write to localStorage/sessionStorage/cookies — `data: { area, key, old?, new? }` (values redacted). */
37
+ STORAGE_CHANGE: 'storage.change',
38
+ /** page-level visibility/focus health (distinct from element-level VISIBLE_*). */
39
+ PAGE_HEALTH: 'page.health',
40
+ /**
41
+ * synthetic: the page called window.open, so the consequence of what was just clicked may live in
42
+ * another browsing context this one cannot observe (an OAuth popup is the archetype).
43
+ * `data: { href }` — the URL the page asked to open, when it named one.
44
+ */
45
+ CONTEXT_OPENED: 'context.opened',
46
+ /**
47
+ * The app opened a native `alert`/`confirm`/`prompt` while Reticle was driving it.
48
+ *
49
+ * Recorded because Reticle ANSWERS these rather than letting them block — a native dialog halts
50
+ * the main thread, and the SDK's own message pump is on that thread, so one `confirm` behind a
51
+ * driven click made the tab permanently unresponsive with no recovery from inside the session.
52
+ * Answering silently would trade a wedge for an invisible one, so the question the app asked, and
53
+ * the answer given, ride out as an event.
54
+ */
55
+ DIALOG_OPENED: 'dialog.opened',
56
+ /** aggregated React commits over a throttle window (dev builds) — `data: { commits }`. Commit storms /
57
+ * wasted re-renders show up here without a per-render flood. */
58
+ RENDER_COMMIT: 'render.commit',
59
+ /** element focus moved — `data: { to, from, toBody }`. Focus dropping to body after an act is a regression. */
60
+ FOCUS_CHANGE: 'focus.change',
61
+ /**
62
+ * a form field's value moved — `data: { field, kind, value?, redacted?, length }`.
63
+ *
64
+ * The DOM observer never saw this: `value` is in its attribute allowlist, but React and every
65
+ * controlled input set the PROPERTY, so `MutationObserver` does not fire. `value` is omitted and
66
+ * `redacted` set for a password, a sensitive name, or a payment autocomplete hint; `length` is
67
+ * always present, because "it was wiped" is assertable without carrying anybody's data.
68
+ */
69
+ FIELD_CHANGE: 'field.change',
70
+ /** browser → bridge: a human recording compiled in-page. */
71
+ FLOW_RECORDED: 'flow.recorded',
72
+ /** synthetic: browser transport queue overflowed; events were dropped. `data: { dropped: number }`. */
73
+ TRANSPORT_OVERFLOW: 'transport.overflow',
74
+ /**
75
+ * synthetic: a per-channel cap truncated a batch (e.g. a DOM mutation flood). `data: { channel, dropped }`.
76
+ * Marks downstream rollups/envelopes as built on incomplete data — a ledger that lies at scale is worse
77
+ * than no ledger, so truncation is never silent.
78
+ */
79
+ TRUNCATED: 'truncated',
80
+ /**
81
+ * synthetic: the SDK detected a region it CANNOT observe (a cross-origin iframe, a closed shadow root).
82
+ * `data: { kind: BlindSpotKind, count }`. Surfaced on results as `coverage: partial` so a green never
83
+ * implies it saw everything.
84
+ */
85
+ BLIND_SPOT: 'blind-spot',
86
+ /** synthetic: the SDK ITSELF failed (an observer threw). `data: { site, message, errorType }`.
87
+ * Rides the existing bridge — no outbound request. See browser/observers/sdk-failure.ts. */
88
+ SDK_FAILED: 'sdk.failed',
89
+ /**
90
+ * synthetic (driven only): CDP/Playwright-authoritative network detail for a response the in-page
91
+ * fetch/XHR wrapper also saw — full response headers + authoritative status/mimeType the page-side
92
+ * wrapper can't reach. `data: { url, method?, status, headers, resourceType? }`. Merged onto the
93
+ * matching in-page NET_REQUEST so the driven view never loses fidelity to an outside-in tool.
94
+ */
95
+ NET_DETAIL: 'net.detail',
96
+ /**
97
+ * Live-control: browser → bridge. A human acted on the presenter panel.
98
+ * `data: { kind: HumanControlKind; text?: string }`. Rides the existing EventMessage.
99
+ */
100
+ HUMAN_CONTROL: 'human.control',
101
+ /**
102
+ * Human review: browser → bridge. A human pinned a mistake to an element on the running page
103
+ * (the "annotate the bug where you see it" loop). `data` narrows to HumanMarkDataSchema — a note
104
+ * plus a re-resolvable element anchor (and its source file:line when the framework stamped one) so
105
+ * the agent that drains the mark knows exactly which element and which source to fix.
106
+ */
107
+ HUMAN_MARK: 'human.mark',
108
+ /**
109
+ * The app produced a FILE — a Blob handed to `URL.createObjectURL`, usually saved by clicking an
110
+ * anchor with `download`. `data: { filename?, mimeType, bytes, lines?, preview? }`. The one artifact
111
+ * class no outside-the-browser tool can inspect: it never crosses the network, so there is no
112
+ * request to intercept. See `observers/download.ts` for the defect that motivated it.
113
+ */
114
+ DOWNLOAD: 'download',
115
+ /**
116
+ * Browser -> bridge: a person used the HUD — pressed a control, or the HUD changed how it sits.
117
+ * `data` narrows to HudUseDataSchema: names only. Telemetry, not evidence: the session takes it
118
+ * off the wire before the buffer, so no verdict, settle or agent read ever sees it.
119
+ */
120
+ HUD_USED: 'hud.used',
121
+ };
@@ -0,0 +1,19 @@
1
+ /**
2
+ * What a person did with the in-page HUD, as names only.
3
+ *
4
+ * The HUD is where a human meets Reticle, and nothing measured it: which controls get used, which
5
+ * panel is open, whether the HUD spends its life as a bubble or open, which settings get changed.
6
+ * Every id is the name of a control Reticle rendered, never text from the page, a flow name or a
7
+ * URL: the telemetry contract's "names, never values". A control whose id is not listed here is
8
+ * dropped at the daemon rather than counted, so a new control cannot leak free text by accident;
9
+ * the browser test that walks the rendered HUD fails if any control has no id in this list.
10
+ */
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"];
13
+ /**
14
+ * Is this a control id the HUD renders?
15
+ *
16
+ * The set is built on first use rather than at module scope: core's root entry is on every page
17
+ * load, and a Set constructed at the top of a module is a side effect no bundler can drop.
18
+ */
19
+ export declare function isHudControl(id: string): boolean;
@@ -0,0 +1,95 @@
1
+ /**
2
+ * What a person did with the in-page HUD, as names only.
3
+ *
4
+ * The HUD is where a human meets Reticle, and nothing measured it: which controls get used, which
5
+ * panel is open, whether the HUD spends its life as a bubble or open, which settings get changed.
6
+ * Every id is the name of a control Reticle rendered, never text from the page, a flow name or a
7
+ * URL: the telemetry contract's "names, never values". A control whose id is not listed here is
8
+ * dropped at the daemon rather than counted, so a new control cannot leak free text by accident;
9
+ * the browser test that walks the rendered HUD fails if any control has no id in this list.
10
+ */
11
+ /** Controls whose id is the attribute name alone (`data-reticle-pause` -> `pause`). */
12
+ const PLAIN_CONTROLS = [
13
+ 'fab',
14
+ 'pause',
15
+ 'chat-toggle',
16
+ 'markers-btn',
17
+ 'end',
18
+ 'clear-marks',
19
+ 'copy-marks',
20
+ 'copy',
21
+ 'export',
22
+ 'annotate-btn',
23
+ 'report-btn',
24
+ 'settings-btn',
25
+ 'min-btn',
26
+ 'chat-min',
27
+ 'chat-pill',
28
+ 'replay',
29
+ 'carousel-dot',
30
+ 'carousel-close',
31
+ 'offer-claim',
32
+ 'talk-book',
33
+ 'account-signin',
34
+ 'account-trigger',
35
+ 'account-signout',
36
+ 'account-dashboard',
37
+ 'sync-now',
38
+ 'report-scope',
39
+ 'report-close',
40
+ 'share-x',
41
+ 'share-in',
42
+ 'share-copy',
43
+ 'refer',
44
+ 'settings-close',
45
+ 'settings-help',
46
+ 'settings-reset',
47
+ 'settings-mcp',
48
+ 'feedback-email',
49
+ 'feedback-call',
50
+ 'workspace-btn',
51
+ 'workspace-copy',
52
+ 'mark-cancel',
53
+ 'mark-send',
54
+ ];
55
+ /** The attributes whose value is part of the id. Read by the browser to build one. */
56
+ export const HUD_KEYED_ATTRS = [
57
+ 'setting',
58
+ 'check',
59
+ 'settings-cycle',
60
+ 'theme',
61
+ 'tour-target',
62
+ 'link',
63
+ ];
64
+ /** Controls whose id also carries a key Reticle authored (`data-reticle-setting="x"` -> `setting.x`). */
65
+ const KEYED_CONTROLS = {
66
+ setting: [
67
+ 'autoOpenChat',
68
+ 'showTimestamps',
69
+ 'showTally',
70
+ 'reactComponents',
71
+ 'hideUntilRestart',
72
+ 'harnessEnabled',
73
+ 'reduceMotion',
74
+ 'ambientGlow',
75
+ ],
76
+ check: ['blockPageInteractions', 'clearOnCopy'],
77
+ 'settings-cycle': ['outputDetail'],
78
+ theme: ['signal', 'traffic', 'mono', 'neon', 'ember'],
79
+ 'tour-target': ['copy', 'back', 'done', 'next', 'skip'],
80
+ link: ['docs', 'github', 'site', 'discord', 'defect', 'dashboard'],
81
+ };
82
+ let controls;
83
+ /**
84
+ * Is this a control id the HUD renders?
85
+ *
86
+ * The set is built on first use rather than at module scope: core's root entry is on every page
87
+ * load, and a Set constructed at the top of a module is a side effect no bundler can drop.
88
+ */
89
+ export function isHudControl(id) {
90
+ controls ??= new Set([
91
+ ...PLAIN_CONTROLS,
92
+ ...Object.entries(KEYED_CONTROLS).flatMap(([attr, keys]) => keys.map((k) => `${attr}.${k}`)),
93
+ ]);
94
+ return controls.has(id);
95
+ }
@@ -0,0 +1,27 @@
1
+ /**
2
+ * Where the in-page HUD sits and what was switched, for HUD_USED events.
3
+ *
4
+ * Kept apart from the control list in `hud-controls.ts`: the wire schema needs these small enums on
5
+ * every page load, and the list is only needed by the HUD itself and by the daemon that counts it.
6
+ */
7
+ /** How the HUD sits on the page: the round bubble, the bare toolbar, or open on a panel. */
8
+ export declare const HudView: {
9
+ readonly BUBBLE: "bubble";
10
+ readonly COLLAPSED: "collapsed";
11
+ readonly EXPANDED: "expanded";
12
+ };
13
+ export type HudView = (typeof HudView)[keyof typeof HudView];
14
+ /** Which panel is showing, when the HUD is open. */
15
+ export declare const HudPanel: {
16
+ readonly CHAT: "chat";
17
+ readonly SETTINGS: "settings";
18
+ readonly REPORT: "report";
19
+ readonly NONE: "none";
20
+ };
21
+ export type HudPanel = (typeof HudPanel)[keyof typeof HudPanel];
22
+ /** What a toggle was switched to; absent for a plain press. */
23
+ export declare const HudToggle: {
24
+ readonly ON: "on";
25
+ readonly OFF: "off";
26
+ };
27
+ export type HudToggle = (typeof HudToggle)[keyof typeof HudToggle];
@@ -0,0 +1,24 @@
1
+ /**
2
+ * Where the in-page HUD sits and what was switched, for HUD_USED events.
3
+ *
4
+ * Kept apart from the control list in `hud-controls.ts`: the wire schema needs these small enums on
5
+ * every page load, and the list is only needed by the HUD itself and by the daemon that counts it.
6
+ */
7
+ /** How the HUD sits on the page: the round bubble, the bare toolbar, or open on a panel. */
8
+ export const HudView = {
9
+ BUBBLE: 'bubble',
10
+ COLLAPSED: 'collapsed',
11
+ EXPANDED: 'expanded',
12
+ };
13
+ /** Which panel is showing, when the HUD is open. */
14
+ export const HudPanel = {
15
+ CHAT: 'chat',
16
+ SETTINGS: 'settings',
17
+ REPORT: 'report',
18
+ NONE: 'none',
19
+ };
20
+ /** What a toggle was switched to; absent for a plain press. */
21
+ export const HudToggle = {
22
+ ON: 'on',
23
+ OFF: 'off',
24
+ };
@@ -81,6 +81,16 @@ export declare const SESSION_HEALTH: {
81
81
  readonly HEARTBEAT_MS: 5000;
82
82
  /** lastSeenMs beyond this ⇒ throttled (≈ 2 missed heartbeats). */
83
83
  readonly STALE_THRESHOLD_MS: 12000;
84
+ /**
85
+ * Fraction of the event ledger's cap past which its size is reported on the health block.
86
+ *
87
+ * A quarter, not a near-miss threshold. The point is to be visible while there is still room to
88
+ * act: a ledger reported only at 90% of its cap tells an agent about a problem it can no longer
89
+ * do anything about, and the case this exists for (a repeating error writing as fast as it can) crosses
90
+ * the last tenth in minutes. Below a quarter the field is absent, so a healthy session carries
91
+ * nothing.
92
+ */
93
+ readonly LEDGER_NOTICE_FRACTION: 0.25;
84
94
  };
85
95
  /**
86
96
  * Server-authoritative session liveness. The browser-side idle timer is throttled in a backgrounded
@@ -79,6 +79,16 @@ export const SESSION_HEALTH = {
79
79
  HEARTBEAT_MS: 5_000,
80
80
  /** lastSeenMs beyond this ⇒ throttled (≈ 2 missed heartbeats). */
81
81
  STALE_THRESHOLD_MS: 12_000,
82
+ /**
83
+ * Fraction of the event ledger's cap past which its size is reported on the health block.
84
+ *
85
+ * A quarter, not a near-miss threshold. The point is to be visible while there is still room to
86
+ * act: a ledger reported only at 90% of its cap tells an agent about a problem it can no longer
87
+ * do anything about, and the case this exists for (a repeating error writing as fast as it can) crosses
88
+ * the last tenth in minutes. Below a quarter the field is absent, so a healthy session carries
89
+ * nothing.
90
+ */
91
+ LEDGER_NOTICE_FRACTION: 0.25,
82
92
  };
83
93
  /**
84
94
  * Server-authoritative session liveness. The browser-side idle timer is throttled in a backgrounded