@reticlehq/core 3.7.0 → 3.8.1

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 (138) hide show
  1. package/dist/activation-entry.d.ts +9 -0
  2. package/dist/activation-entry.js +9 -0
  3. package/dist/artifacts/drive-script.d.ts +84 -1217
  4. package/dist/artifacts/drive-script.js +1 -1
  5. package/dist/artifacts/flow-constants.d.ts +15 -0
  6. package/dist/artifacts/flow-constants.js +15 -0
  7. package/dist/artifacts/flow-expect-flat.d.ts +8 -192
  8. package/dist/artifacts/flow-expect-flat.js +2 -2
  9. package/dist/artifacts/flow-results.d.ts +26 -0
  10. package/dist/artifacts/flow-types.d.ts +212 -2295
  11. package/dist/artifacts/flow-types.js +14 -2
  12. package/dist/artifacts/harness-credits.d.ts +6 -3
  13. package/dist/artifacts/harness-credits.js +9 -6
  14. package/dist/artifacts/harness-map.d.ts +8 -69
  15. package/dist/artifacts/harness-map.js +1 -1
  16. package/dist/artifacts/hud-notices.d.ts +8 -82
  17. package/dist/artifacts/hud-notices.js +1 -1
  18. package/dist/artifacts/impact.d.ts +104 -1665
  19. package/dist/artifacts/impact.js +38 -21
  20. package/dist/artifacts/journal.d.ts +15 -231
  21. package/dist/artifacts/journal.js +15 -2
  22. package/dist/artifacts/prompt-context.d.ts +7 -33
  23. package/dist/artifacts/prompt-context.js +15 -4
  24. package/dist/artifacts/screenshot-upload.d.ts +3 -26
  25. package/dist/artifacts/screenshot-upload.js +1 -1
  26. package/dist/graph/app-graph.d.ts +137 -0
  27. package/dist/graph/app-graph.js +498 -0
  28. package/dist/hooks/hook-events.d.ts +15 -171
  29. package/dist/hooks/hook-events.js +1 -1
  30. package/dist/hud-entry.js +1 -1
  31. package/dist/identity/checkout.d.ts +41 -0
  32. package/dist/identity/checkout.js +118 -0
  33. package/dist/identity/state-dir.d.ts +23 -0
  34. package/dist/identity/state-dir.js +43 -0
  35. package/dist/index.d.ts +10 -0
  36. package/dist/index.js +10 -0
  37. package/dist/onboarding.d.ts +23 -52
  38. package/dist/onboarding.js +20 -1
  39. package/dist/registry/daemon-registry.d.ts +2 -14
  40. package/dist/registry/daemon-registry.js +1 -1
  41. package/dist/registry/dev-server-registry.d.ts +2 -31
  42. package/dist/registry/dev-server-registry.js +1 -1
  43. package/dist/registry/project-registry.d.ts +4 -32
  44. package/dist/registry/project-registry.js +1 -1
  45. package/dist/schema/command-message.json +65 -68
  46. package/dist/schema/command-name.json +29 -33
  47. package/dist/schema/command-result.json +25 -30
  48. package/dist/schema/event-message.json +104 -101
  49. package/dist/schema/event-payloads.json +246 -108
  50. package/dist/schema/event-type.json +47 -48
  51. package/dist/schema/hello-message.json +150 -133
  52. package/dist/schema/reticle-event.json +98 -94
  53. package/dist/schema/reticle-message.json +338 -310
  54. package/dist/telemetry-bug.d.ts +4 -75
  55. package/dist/telemetry-bug.js +1 -1
  56. package/dist/telemetry-entry.d.ts +1 -1
  57. package/dist/telemetry-entry.js +1 -1
  58. package/dist/telemetry-feedback.d.ts +17 -91
  59. package/dist/telemetry-feedback.js +20 -1
  60. package/dist/telemetry-refusal.d.ts +4 -31
  61. package/dist/telemetry-refusal.js +1 -1
  62. package/dist/telemetry-session.d.ts +45 -624
  63. package/dist/telemetry-session.js +25 -12
  64. package/dist/telemetry-signals.d.ts +211 -86
  65. package/dist/telemetry-signals.js +100 -2
  66. package/dist/telemetry.d.ts +321 -1691
  67. package/dist/telemetry.js +72 -6
  68. package/dist/verdict/check-sentence.d.ts +34 -0
  69. package/dist/verdict/check-sentence.js +228 -0
  70. package/dist/verdict/compare-source.d.ts +1 -1
  71. package/dist/verdict/compare-source.js +1 -1
  72. package/dist/verdict/consequence.d.ts +15 -0
  73. package/dist/verdict/consequence.js +11 -0
  74. package/dist/verdict/disparity.d.ts +8 -56
  75. package/dist/verdict/disparity.js +1 -1
  76. package/dist/verdict/findings.d.ts +10 -0
  77. package/dist/verdict/findings.js +13 -0
  78. package/dist/verdict/instrumentation-coverage.d.ts +6 -37
  79. package/dist/verdict/instrumentation-coverage.js +15 -59
  80. package/dist/verdict/instrumentation-gap.d.ts +72 -0
  81. package/dist/verdict/instrumentation-gap.js +64 -0
  82. package/dist/verdict/intent.d.ts +25 -224
  83. package/dist/verdict/intent.js +1 -1
  84. package/dist/verdict/predicate-tree.d.ts +2 -0
  85. package/dist/verdict/predicate-tree.js +16 -0
  86. package/dist/verdict/predicate.d.ts +3 -2
  87. package/dist/verdict/predicate.js +107 -16
  88. package/dist/verdict/property-assertion.d.ts +23 -101
  89. package/dist/verdict/property-assertion.js +1 -1
  90. package/dist/verdict/run-report.d.ts +71 -0
  91. package/dist/verdict/run-report.js +53 -0
  92. package/dist/verdict/security.d.ts +48 -2
  93. package/dist/verdict/security.js +185 -18
  94. package/dist/verdict/verification-run.d.ts +124 -1623
  95. package/dist/verdict/verification-run.js +37 -6
  96. package/dist/verdict/verify-progress.d.ts +22 -64
  97. package/dist/verdict/verify-progress.js +1 -1
  98. package/dist/wire/constants/constants.d.ts +56 -141
  99. package/dist/wire/constants/constants.js +64 -144
  100. package/dist/wire/constants/discovery.d.ts +4 -4
  101. package/dist/wire/constants/discovery.js +4 -4
  102. package/dist/wire/constants/event-types.d.ts +37 -1
  103. package/dist/wire/constants/event-types.js +35 -1
  104. package/dist/wire/constants/hud-controls.js +0 -2
  105. package/dist/wire/constants/hud-use.d.ts +4 -0
  106. package/dist/wire/constants/hud-use.js +4 -0
  107. package/dist/wire/constants/mcp-wire.d.ts +16 -0
  108. package/dist/wire/constants/mcp-wire.js +16 -0
  109. package/dist/wire/constants/response-body-reason.d.ts +19 -0
  110. package/dist/wire/constants/response-body-reason.js +18 -0
  111. package/dist/wire/constants/reticle-env.d.ts +140 -0
  112. package/dist/wire/constants/reticle-env.js +140 -0
  113. package/dist/wire/constants/session-constants.d.ts +11 -0
  114. package/dist/wire/constants/session-constants.js +11 -0
  115. package/dist/wire/event-payloads.d.ts +173 -629
  116. package/dist/wire/event-payloads.js +107 -23
  117. package/dist/wire/event-priority.js +1 -0
  118. package/dist/wire/messages.d.ts +90 -713
  119. package/dist/wire/messages.js +19 -3
  120. package/dist/wire/narrow.d.ts +6 -0
  121. package/dist/wire/narrow.js +26 -0
  122. package/dist/wire/next-step.d.ts +50 -0
  123. package/dist/wire/next-step.js +37 -0
  124. package/dist/wire/platform-link.d.ts +7 -0
  125. package/dist/wire/platform-link.js +14 -8
  126. package/dist/wire/production/activation-ticket.d.ts +64 -0
  127. package/dist/wire/production/activation-ticket.js +148 -0
  128. package/dist/wire/production/hello-mode.d.ts +35 -0
  129. package/dist/wire/production/hello-mode.js +32 -0
  130. package/dist/wire/production/production-policy.d.ts +92 -0
  131. package/dist/wire/production/production-policy.js +133 -0
  132. package/dist/wire/tool-names.d.ts +2 -0
  133. package/dist/wire/tool-names.js +2 -0
  134. package/dist/wire/types.d.ts +102 -700
  135. package/dist/wire/types.js +5 -5
  136. package/dist/words/upgrade.d.ts +3 -13
  137. package/dist/words/upgrade.js +1 -1
  138. package/package.json +7 -4
@@ -2,6 +2,7 @@
2
2
  * Wire-level constants. No free strings anywhere in Reticle reference these directly —
3
3
  * every string/number that crosses the browser <-> bridge <-> agent boundary is named here.
4
4
  */
5
+ import { ReticleEnv } from './reticle-env.js';
5
6
  export const RETICLE_DEFAULT_PORT = 4400;
6
7
  export const RETICLE_WS_PATH = '/reticle';
7
8
  export * from './mcp-wire.js';
@@ -28,6 +29,12 @@ export const MCP_SERVER_NAME = 'reticle';
28
29
  export const MCP_SHUTDOWN_EVENT = 'reticle-shutdown';
29
30
  /** Local-only daemon introspection — `reticle status` GETs this for sessions + health at a glance. */
30
31
  export const STATUS_PATH = '/status';
32
+ /**
33
+ * Local-only stop request — `reticle stop` and `reticle kill` POST here first, with the pairing token
34
+ * as a bearer token. It runs the daemon's normal shutdown path. A signal cannot do that on Windows,
35
+ * where it ends the process at once.
36
+ */
37
+ export const SHUTDOWN_PATH = '/shutdown';
31
38
  /**
32
39
  * Query flag on STATUS_PATH: the caller (a running `reticle init`) is waiting on this daemon, so it
33
40
  * must not idle out yet. Without it the daemon init started exited mid-wait on a slow desktop build.
@@ -103,140 +110,7 @@ export const RETICLE_URL_PARAM = {
103
110
  };
104
111
  /** The loopback bind address. The daemon/bridge bind here by default — never expose Reticle off-host. */
105
112
  export const LOOPBACK_HOST = '127.0.0.1';
106
- /**
107
- * Every environment variable Reticle reads, named once. A misspelled inline env string silently
108
- * disables the control it gates (e.g. a typo'd `RETICLE_TOKEN` would disable auth) — so the names live
109
- * here and nowhere else. The values are the literal process.env keys.
110
- */
111
- export const ReticleEnv = {
112
- /** "0"/"false"/"off" turns off telemetry and every optional outbound call; DO_NOT_TRACK too. */
113
- TELEMETRY: 'RETICLE_TELEMETRY',
114
- DO_NOT_TRACK: 'DO_NOT_TRACK',
115
- /** Shared-secret the browser SDK must present in HELLO; absent ⇒ loopback-trust only. */
116
- TOKEN: 'RETICLE_TOKEN',
117
- /** Bridge bind host. Defaults to loopback; setting anything else is opt-in remote exposure. */
118
- HOST: 'RETICLE_HOST',
119
- /** Comma-separated WS Origin allow-list for the bridge. */
120
- ALLOWED_ORIGINS: 'RETICLE_ALLOWED_ORIGINS',
121
- /** Bridge/daemon WS port override. */
122
- PORT: 'RETICLE_PORT',
123
- /** Daemon state — pidfiles, discovery registry, logs. Defaults to `~/.reticle`. Overridable
124
- * because a read-only $HOME (sandboxed agent, locked-down Windows profile, container) otherwise
125
- * makes the daemon unstartable with a raw EACCES naming nothing. Reported by a Windows user. */
126
- STATE_DIR: 'RETICLE_STATE_DIR',
127
- /** Attach to an already-running browser over CDP instead of launching one. */
128
- CDP_URL: 'RETICLE_CDP_URL',
129
- /** The Chromium executable to launch, in place of Playwright's own build or an installed Chrome. */
130
- CHROMIUM_PATH: 'RETICLE_CHROMIUM_PATH',
131
- /** Max simultaneous leased headless contexts in the browser pool (resource cap). */
132
- MAX_CONTEXTS: 'RETICLE_MAX_CONTEXTS',
133
- /**
134
- * Inbound events per second before the bridge starts SAMPLING (never disconnecting).
135
- *
136
- * Raise it for a legitimately busy app — a streaming dashboard, a live grid — rather than accept
137
- * partial coverage. Free and local: the daemon runs on the same machine, so a higher ceiling costs
138
- * nothing to anyone.
139
- */
140
- MAX_MESSAGES_PER_SECOND: 'RETICLE_MAX_MESSAGES_PER_SECOND',
141
- /** Bearer token required by the optional `reticle serve --http` verify endpoint. */
142
- VERIFY_TOKEN: 'RETICLE_VERIFY_TOKEN',
143
- /** Ms of continuous idleness (no agent, no browser session, no lease) before the daemon self-exits;
144
- * `0` disables. Keeps Reticle from lingering on a user's machine after the editor closes. */
145
- IDLE_SHUTDOWN: 'RETICLE_IDLE_SHUTDOWN_MS',
146
- /** Idle re-check cadence (default 30s). Overridable so daemon-lifecycle-test can watch a full
147
- * exit/wake cycle in seconds rather than minutes. */
148
- IDLE_CHECK: 'RETICLE_IDLE_CHECK_MS',
149
- /**
150
- * Grace for a daemon with an agent ATTACHED. Longer than the base on purpose: quiet with a client
151
- * present means a slow install or a thinking human, not an unwanted daemon — a flat 5 minutes was
152
- * killing live runs mid-install. Derived from the base when unset.
153
- */
154
- IDLE_ATTACHED: 'RETICLE_IDLE_ATTACHED_MS',
155
- /**
156
- * How often the daemon writes `reticle_daemon_alive`, so a GAP in its log is evidence it died.
157
- *
158
- * Overridable for the same reason the idle windows are: a spec that has to prove "a killed daemon
159
- * is distinguishable from a tidy one" cannot wait 30 seconds per beat, and a spec that instead
160
- * re-implements the cadence is insensitive to the thing it claims to guard.
161
- */
162
- HEARTBEAT: 'RETICLE_HEARTBEAT_MS',
163
- /** Directory holding the auto-provisioned pairing token. Defaults to ~/.reticle; relocatable for CI. */
164
- PAIRING_TOKEN_DIR: 'RETICLE_PAIRING_TOKEN_DIR',
165
- /** Force the durable causal journal off (`0`/`false`/`off`) or on (`1`/`true`/`on`); default on. */
166
- JOURNAL: 'RETICLE_JOURNAL',
167
- /**
168
- * Verbose internal flow tracing for people working ON Reticle (`1`/`true`/`on`); default off.
169
- *
170
- * Distinct from the journal, which records what the AGENT did to the app. This records what
171
- * RETICLE did to answer it: one line per internal stage, with its duration and nesting, so a
172
- * developer can see which code a tool call actually went through and where the time went.
173
- * Off by default and free when off — a trace on every tool call is a cost on the hot path.
174
- */
175
- TRACE: 'RETICLE_TRACE',
176
- /**
177
- * How many consecutive reconnects the MCP proxy attempts before it stops retrying and goes
178
- * dormant. Overridable for the same reason the idle windows are: the real budget takes MINUTES to
179
- * exhaust, so the one spec that proves the proxy SURVIVES exhaustion could not run at all without
180
- * shortening it. A budget nobody can reach in a test is a budget nobody tests.
181
- */
182
- RECONNECT_ATTEMPTS: 'RETICLE_RECONNECT_ATTEMPTS',
183
- /** Quiet window before an abandoned MCP stdio proxy exits; `0` disables the watcher. */
184
- MCP_PROXY_IDLE: 'RETICLE_MCP_PROXY_IDLE_MS',
185
- /**
186
- * API key for the harness — the model that drives the app when no coding agent is in the loop.
187
- *
188
- * The standard Anthropic name, on purpose: a machine that can already run a coding agent can
189
- * already run the harness, with nothing to configure. Absent ⇒ the harness is simply unavailable
190
- * and every other part of Reticle is unaffected.
191
- */
192
- HARNESS_KEY: 'ANTHROPIC_API_KEY',
193
- /** Model the harness drives with. Defaults to a small one — see `DEFAULT_HARNESS_MODEL`. */
194
- HARNESS_MODEL: 'RETICLE_HARNESS_MODEL',
195
- /** Base URL for the harness's model API, for a proxy or a gateway. */
196
- HARNESS_BASE_URL: 'RETICLE_HARNESS_BASE_URL',
197
- /** Hard ceiling on harness model turns in one drive. Bounds cost, not value. */
198
- HARNESS_MAX_STEPS: 'RETICLE_HARNESS_MAX_STEPS',
199
- /** The free drive `reticle try` was granted, sent on every Harness call it bills. */
200
- DRIVE_ID: 'RETICLE_DRIVE_ID',
201
- /**
202
- * Which model backs the harness driver: `anthropic` (the default) or `jev`.
203
- *
204
- * Two drivers exist because the driver's job turns out not to need a text generator. It picks the
205
- * next action and says what it expects; the verdict is decided afterwards by the engine, with no
206
- * model anywhere near it. A System One model answers typed questions against a state, which is
207
- * exactly that job and none of the rest, so it can drive without being able to generate a
208
- * sentence. Unset keeps the existing behaviour for everybody who has not asked for this.
209
- */
210
- HARNESS_DRIVER: 'RETICLE_HARNESS_DRIVER',
211
- /**
212
- * A direct Jev key, for this repo's own benchmarks and for anyone holding a TypeSafe account.
213
- *
214
- * Users are not expected to have one. The ordinary path is the key they already minted on the
215
- * platform (`RETICLE_API_KEY`), which reaches Jev through the proxy at `RETICLE_CLOUD_URL` —
216
- * this variable is the escape hatch that skips it, and it takes precedence when both are set so
217
- * that a developer debugging the upstream is never silently talking to the proxy instead.
218
- */
219
- HARNESS_JEV_KEY: 'JEV_API_KEY',
220
- /** Base URL for the Jev API, for a proxy or a gateway. Defaults to TypeSafe's own endpoint. */
221
- HARNESS_JEV_URL: 'RETICLE_HARNESS_JEV_URL',
222
- /** A direct OpenAI key. As with Jev, the ordinary path is the platform key and its proxy. */
223
- HARNESS_OPENAI_KEY: 'OPENAI_API_KEY',
224
- /** Model the OpenAI driver uses. Defaults to a small one — see `DEFAULT_OPENAI_MODEL`. */
225
- HARNESS_OPENAI_MODEL: 'RETICLE_HARNESS_OPENAI_MODEL',
226
- /**
227
- * The API key minted on the platform, and the host it belongs to.
228
- *
229
- * Read through `apiKeyFrom()`, never directly — see the note on that function for why there are
230
- * two names for one key and why neither may be dropped.
231
- */
232
- API_KEY: 'RETICLE_API_KEY',
233
- /** The name this key had until 2026-09. Still honoured; see `apiKeyFrom()`. */
234
- CLOUD_KEY: 'RETICLE_CLOUD_KEY',
235
- /** The platform host. Read through `cloudUrlFrom()`, which also accepts `URL`. */
236
- CLOUD_URL: 'RETICLE_CLOUD_URL',
237
- /** The short name for `CLOUD_URL`, which people type first. `CLOUD_URL` wins when both are set. */
238
- URL: 'RETICLE_URL',
239
- };
113
+ export { ReticleEnv } from './reticle-env.js';
240
114
  /**
241
115
  * The platform API key, whichever name it arrives under.
242
116
  *
@@ -255,16 +129,18 @@ export const ReticleEnv = {
255
129
  */
256
130
  export function apiKeyFrom(env) {
257
131
  const current = env[ReticleEnv.API_KEY];
258
- if (current !== undefined && 0 < current.length)
132
+ if (current !== undefined && 0 < current.length) {
259
133
  return current;
134
+ }
260
135
  const legacy = env[ReticleEnv.CLOUD_KEY];
261
136
  return legacy !== undefined && 0 < legacy.length ? legacy : undefined;
262
137
  }
263
138
  /** The platform URL, under either name — one function so no caller forgets the second. */
264
139
  export function cloudUrlFrom(env) {
265
140
  const canonical = env[ReticleEnv.CLOUD_URL];
266
- if (canonical !== undefined && 0 < canonical.length)
141
+ if (canonical !== undefined && 0 < canonical.length) {
267
142
  return canonical;
143
+ }
268
144
  const short = env[ReticleEnv.URL];
269
145
  return short !== undefined && 0 < short.length ? short : undefined;
270
146
  }
@@ -274,8 +150,9 @@ export const DEFAULT_PLATFORM_URL = 'https://app.reticle.sh';
274
150
  export function platformUrlFrom(env) {
275
151
  // A loop, not /\/+$/: that pattern is polynomial on a value made of many slashes.
276
152
  let url = cloudUrlFrom(env) ?? DEFAULT_PLATFORM_URL;
277
- while (url.endsWith('/'))
153
+ while (url.endsWith('/')) {
278
154
  url = url.slice(0, -1);
155
+ }
279
156
  return url;
280
157
  }
281
158
  /**
@@ -371,8 +248,27 @@ export const DANGEROUS_ACTION_CONFIRM_ARG = 'confirmDangerous';
371
248
  * through the SDK instead.
372
249
  */
373
250
  export const NATIVE_INPUT_ARG = 'native';
251
+ /**
252
+ * INSPECT argument: scroll an off-viewport element to the center before it is measured. The real-input
253
+ * path sends it, because a real pointer aimed at an off-viewport box lands on nothing (#1711).
254
+ */
255
+ export const INSPECT_REVEAL_ARG = 'reveal';
256
+ /**
257
+ * INSPECT result field, present only when `INSPECT_REVEAL_ARG` was sent: whether the element's center
258
+ * is inside the viewport, measured after the scroll. An SDK that predates it omits it, and a caller
259
+ * must read that absence as unknown, never as out of view.
260
+ */
261
+ export const INSPECT_IN_VIEWPORT_FIELD = 'inViewport';
374
262
  /** Schema version stamped onto compiled replay programs. */
375
263
  export const REPLAY_PROGRAM_VERSION = 1;
264
+ /**
265
+ * The instruction files `reticle init` writes its Reticle section into, and the line that opens the
266
+ * section. `init` writes it and the server reads it, so both take it from here.
267
+ */
268
+ export const AgentRules = {
269
+ FILES: ['CLAUDE.md', 'AGENTS.md'],
270
+ BEGIN: '<!-- reticle:begin (managed by `reticle init` — edit outside these markers) -->',
271
+ };
376
272
  /** The git-checked Reticle workspace directory + its layout. No free strings. */
377
273
  export const ReticleDir = {
378
274
  ROOT: '.reticle',
@@ -405,6 +301,8 @@ export const ReticleDir = {
405
301
  VISUAL_SUBDIR: 'visual',
406
302
  /** verification-run artifacts —.reticle/runs/<runId>.json (the OEM/CI-consumable verdict). */
407
303
  RUNS_SUBDIR: 'runs',
304
+ /** Dev-server logs, only when the state home cannot be written. Machine-local, like `runs/`. */
305
+ LOGS_SUBDIR: 'logs',
408
306
  /** fail-to-pass bug capsules —.reticle/capsules/<id>.json (a minimal failing flow + its evidence). */
409
307
  CAPSULES_SUBDIR: 'capsules',
410
308
  /**
@@ -419,6 +317,11 @@ export const ReticleDir = {
419
317
  PLANS_SUBDIR: 'plans',
420
318
  /** durable causal journal —.reticle/sessions/<id>/{events,actions}.jsonl (the substrate). */
421
319
  SESSIONS_SUBDIR: 'sessions',
320
+ /**
321
+ * Every tool call an agent made, in full, with what it did to the page —
322
+ * .reticle/episodes/<connection>.jsonl. Local evidence: never committed, never sent.
323
+ */
324
+ EPISODES_SUBDIR: 'episodes',
422
325
  /** append-only event ledger inside a session dir (one ReticleEvent per line). */
423
326
  JOURNAL_EVENTS_FILE: 'events.jsonl',
424
327
  /** append-only action ledger inside a session dir (one JournalAction per line). */
@@ -441,8 +344,12 @@ export const ReticleDir = {
441
344
  COVERAGE_FILE: 'coverage.json',
442
345
  /** Human review marks (HUD notes), pending and resolved — see server portal/session/human. */
443
346
  NOTES_FILE: 'notes.json',
444
- /** The user's latest request, as the agent relayed it. Local: it is the user's own words. */
347
+ /** The user's latest request: the newest prompt the hook captured, or the one the agent relayed. Local. */
445
348
  REQUEST_FILE: 'request.json',
349
+ /** Every prompt the agent hook captured, one JSON line each, oldest first. `request.json` holds the newest. */
350
+ REQUESTS_LOG_FILE: 'requests.jsonl',
351
+ /** The prompt history moved aside when `requests.jsonl` fills. The same words, so the same rule. */
352
+ REQUESTS_LOG_ROTATED_FILE: 'requests.1.jsonl',
446
353
  APP_NOTES_FILE: 'app-notes.json', // confirmed targeting hints for the next session; never evidence
447
354
  PLATFORM_MOMENTS_FILE: 'platform-moments.json', // moments already said, so each is said once
448
355
  /**
@@ -507,6 +414,8 @@ export const VisualReason = {
507
414
  // quietly downgraded: a caller who asked for the whole scroll height and silently got the visible
508
415
  // part would bank a baseline that says nothing about the content below the fold.
509
416
  FULL_PAGE_UNSUPPORTED: 'full-page-unsupported',
417
+ // Desktop capture returns the whole window and cannot honor clip or ref.
418
+ CROP_UNSUPPORTED: 'crop-unsupported',
510
419
  // The shell answered, and the window had no composited frame to photograph yet. Distinct from
511
420
  // CAPTURE_FAILED on purpose: the capture ran and the window was empty, which is a timing fact
512
421
  // about the window rather than a failure of the capture path. Electron's `capturePage()` returns
@@ -556,8 +465,8 @@ export const ContractReadError = {
556
465
  };
557
466
  // The event vocabulary lives beside this file and is re-exported here, so `EventType` stays one
558
467
  // import path for every consumer. See event-types.ts for why it moved.
559
- import { EventType } from './event-types.js';
560
- export { EventType };
468
+ import { CanvasTrigger, EventType, MediaEvent } from './event-types.js';
469
+ export { CanvasTrigger, EventType, MediaEvent };
561
470
  /** Bounds for the per-session ring buffer. */
562
471
  export const RING_BUFFER_DEFAULTS = {
563
472
  MAX_EVENTS: 2000,
@@ -583,6 +492,11 @@ export const PhenomenonType = {
583
492
  };
584
493
  /** Signal the React adapter fires once hydration commits (handlers attached). Shared browser↔server. */
585
494
  export const RETICLE_HYDRATION_SIGNAL = 'reticle:hydration-complete';
495
+ /**
496
+ * Work the app declared it is doing (`reticle.busy(work)`): `{ delta: 1 }` when it starts and
497
+ * `{ delta: -1 }` when it ends. `settled` counts it as in flight, like a request. Shared browser↔server.
498
+ */
499
+ export const RETICLE_BUSY_SIGNAL = 'reticle:busy';
586
500
  /**
587
501
  * The registered-store name the React adapter uses for render stats, read via reticle_state. It crosses
588
502
  * the wire as a store id AND the browser SDK special-cases it as reticle-owned (so it isn't flagged as
@@ -676,6 +590,10 @@ export const InputModeReason = {
676
590
  * permanent for the session, not a transient downgrade, so it should stop asking.
677
591
  */
678
592
  NOT_CONFIGURED: 'real-input-not-configured-for-this-session',
593
+ TARGET_NOT_FOCUSABLE: 'target-cannot-hold-focus', // lease press: the named element took no focus
594
+ /** A production drive presses only in the page. A native key goes to whatever holds focus, so
595
+ * the production policy could not judge the control it pressed. */
596
+ PRODUCTION_PRESS_IN_PAGE: 'production-drive-presses-in-page',
679
597
  };
680
598
  /** Best-effort caveats attached to action results so the agent can interpret a no-op. */
681
599
  export const ActionWarning = {
@@ -688,11 +606,9 @@ export const ActionWarning = {
688
606
  * actionable. Scroll it into a clear area or dismiss the overlay on top.
689
607
  */
690
608
  CLICK_OCCLUDED: 'target is visually occluded by another element; a real user could not click it (synthetic dispatch still delivered the event) — dismiss the overlay or scroll the target clear',
691
- /**
692
- * A document-key press (Escape, Tab, a modifier shortcut) was dispatched at the focused
693
- * element or the document. No named target was given, so the effect must not claim one.
694
- */
609
+ /** A document-key press (Escape, Tab, a shortcut) went to the focused element or document. */
695
610
  GLOBAL_PRESS: 'press landed on the focused element or document — no named target was given, so this effect does not claim one',
611
+ CLICK_NOT_A_CONTROL: 'target is not a control and sits inside none (no button/link/input role, onclick, tabindex or pointer cursor), so a click on it may do nothing — if nothing happened, target the control inside it by role',
696
612
  };
697
613
  /** Failure modes when Reticle launches/drives its own browser (`reticle drive`). */
698
614
  export const DriveErrorCode = {
@@ -892,4 +808,8 @@ export const LeaseNotReadyReason = {
892
808
  SDK_STOPPED_ANSWERING: 'sdk_stopped_answering',
893
809
  /** The SDK answers, but its tab is hidden: timers and rAF are throttled, so nothing on it verifies. */
894
810
  TAB_HIDDEN: 'tab_hidden',
811
+ /** The page is not an HTML document (an `.svg`, for example), so the zero-install reader did not run. */
812
+ NOT_HTML_DOCUMENT: 'not_html_document',
813
+ /** The zero-install reader failed, for example because the tab closed during setup. */
814
+ READER_FAILED: 'reader_failed',
895
815
  };
@@ -15,11 +15,11 @@ export declare const DISCOVERY_CALL_URL = "https://calendar.app.google/h9NRDbBBQ
15
15
  export declare const FOUNDER_EMAIL = "hey@reticle.sh";
16
16
  /** A mailto for that address, subject filled so the note is findable in the inbox. A literal: see first-load-size. */
17
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";
18
+ /** How somebody leaves an email instead: a note with a reply address, sent only when they run it. */
19
+ export declare const DISCOVERY_EMAIL_COMMAND = "npx @reticlehq/server feedback --contact you@company.com \"what you are building\"";
20
20
  export declare const DiscoveryInvite: {
21
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";
22
+ readonly HUMAN: "Stuck, or want Reticle to work differently? Talk to the founder: https://calendar.app.google/h9NRDbBBQetyTzWM6 · or send a note with your email: npx @reticlehq/server feedback --contact you@company.com \"what you are building\"";
23
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.";
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 a note with their email (npx @reticlehq/server feedback --contact you@company.com \"what you are building\"). Offer it; never book a call or submit an email for them.";
25
25
  };
@@ -15,11 +15,11 @@ export const DISCOVERY_CALL_URL = 'https://calendar.app.google/h9NRDbBBQetyTzWM6
15
15
  export const FOUNDER_EMAIL = 'hey@reticle.sh';
16
16
  /** A mailto for that address, subject filled so the note is findable in the inbox. A literal: see first-load-size. */
17
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';
18
+ /** How somebody leaves an email instead: a note with a reply address, sent only when they run it. */
19
+ export const DISCOVERY_EMAIL_COMMAND = 'npx @reticlehq/server feedback --contact you@company.com "what you are building"';
20
20
  export const DiscoveryInvite = {
21
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}`,
22
+ HUMAN: `Stuck, or want Reticle to work differently? Talk to the founder: ${DISCOVERY_CALL_URL} · or send a note with your email: ${DISCOVERY_EMAIL_COMMAND}`,
23
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.`,
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 a note with their email (${DISCOVERY_EMAIL_COMMAND}). Offer it; never book a call or submit an email for them.`,
25
25
  };
@@ -59,12 +59,15 @@ export declare const EventType: {
59
59
  /** element focus moved — `data: { to, from, toBody }`. Focus dropping to body after an act is a regression. */
60
60
  readonly FOCUS_CHANGE: "focus.change";
61
61
  /**
62
- * a form field's value moved — `data: { field, kind, value?, redacted?, length }`.
62
+ * a form field's value moved — `data: { field, kind, value?, checked?, previous?, previousChecked?, redacted?, length }`.
63
63
  *
64
64
  * The DOM observer never saw this: `value` is in its attribute allowlist, but React and every
65
65
  * controlled input set the PROPERTY, so `MutationObserver` does not fire. `value` is omitted and
66
66
  * `redacted` set for a password, a sensitive name, or a payment autocomplete hint; `length` is
67
67
  * always present, because "it was wiped" is assertable without carrying anybody's data.
68
+ * `checked` is the checkbox/radio property (`value` there is the HTML value, usually `"on"`).
69
+ * `kind: "settled"` is a read after the action's handlers; `previous` / `previousChecked` are
70
+ * the pre-action reading, so a restore is distinguishable from a render.
68
71
  */
69
72
  readonly FIELD_CHANGE: "field.change";
70
73
  /** browser → bridge: a human recording compiled in-page. */
@@ -93,6 +96,8 @@ export declare const EventType: {
93
96
  * matching in-page NET_REQUEST so the driven view never loses fidelity to an outside-in tool.
94
97
  */
95
98
  readonly NET_DETAIL: "net.detail";
99
+ /** SDK response body captured after headers. Matched to its NET_REQUEST by id, method and URL. */
100
+ readonly NET_RESPONSE_BODY: "net.response-body";
96
101
  /**
97
102
  * Live-control: browser → bridge. A human acted on the presenter panel.
98
103
  * `data: { kind: HumanControlKind; text?: string }`. Rides the existing EventMessage.
@@ -118,5 +123,36 @@ export declare const EventType: {
118
123
  * off the wire before the buffer, so no verdict, settle or agent read ever sees it.
119
124
  */
120
125
  readonly HUD_USED: "hud.used";
126
+ /**
127
+ * A `<video>` or `<audio>` changed playback state: `data: { event, tag, currentTime, duration?,
128
+ * readyState, paused }`. The event's own `t` orders it against the network, which is what a media
129
+ * defect ("Ready before the response arrived") is: an ordering in time no DOM count shows.
130
+ */
131
+ readonly MEDIA_STATE: "media.state";
132
+ /**
133
+ * A `<canvas>` drew something different: `data: { digest, width, height, mean }`. A hash of a
134
+ * 16x16 sample of its pixels and their mean colour, emitted only when the digest changes. What a
135
+ * canvas shows never reaches the DOM, so without this a canvas app's output is invisible.
136
+ */
137
+ readonly CANVAS_DIGEST: "canvas.digest";
121
138
  };
122
139
  export type EventType = (typeof EventType)[keyof typeof EventType];
140
+ /** The media events `MEDIA_STATE` reports. Not `timeupdate`: it fires several times a second. */
141
+ export declare const MediaEvent: {
142
+ readonly PLAY: "play";
143
+ readonly PLAYING: "playing";
144
+ readonly PAUSE: "pause";
145
+ readonly SEEKED: "seeked";
146
+ readonly ENDED: "ended";
147
+ readonly LOADED_DATA: "loadeddata";
148
+ readonly CAN_PLAY: "canplay";
149
+ readonly WAITING: "waiting";
150
+ readonly ERROR: "error";
151
+ };
152
+ export type MediaEvent = (typeof MediaEvent)[keyof typeof MediaEvent];
153
+ /** What took a `CANVAS_DIGEST`: the 500 ms poll, or the end of an act (inside its window). */
154
+ export declare const CanvasTrigger: {
155
+ readonly POLL: "poll";
156
+ readonly ACT: "act";
157
+ };
158
+ export type CanvasTrigger = (typeof CanvasTrigger)[keyof typeof CanvasTrigger];
@@ -59,12 +59,15 @@ export const EventType = {
59
59
  /** element focus moved — `data: { to, from, toBody }`. Focus dropping to body after an act is a regression. */
60
60
  FOCUS_CHANGE: 'focus.change',
61
61
  /**
62
- * a form field's value moved — `data: { field, kind, value?, redacted?, length }`.
62
+ * a form field's value moved — `data: { field, kind, value?, checked?, previous?, previousChecked?, redacted?, length }`.
63
63
  *
64
64
  * The DOM observer never saw this: `value` is in its attribute allowlist, but React and every
65
65
  * controlled input set the PROPERTY, so `MutationObserver` does not fire. `value` is omitted and
66
66
  * `redacted` set for a password, a sensitive name, or a payment autocomplete hint; `length` is
67
67
  * always present, because "it was wiped" is assertable without carrying anybody's data.
68
+ * `checked` is the checkbox/radio property (`value` there is the HTML value, usually `"on"`).
69
+ * `kind: "settled"` is a read after the action's handlers; `previous` / `previousChecked` are
70
+ * the pre-action reading, so a restore is distinguishable from a render.
68
71
  */
69
72
  FIELD_CHANGE: 'field.change',
70
73
  /** browser → bridge: a human recording compiled in-page. */
@@ -93,6 +96,8 @@ export const EventType = {
93
96
  * matching in-page NET_REQUEST so the driven view never loses fidelity to an outside-in tool.
94
97
  */
95
98
  NET_DETAIL: 'net.detail',
99
+ /** SDK response body captured after headers. Matched to its NET_REQUEST by id, method and URL. */
100
+ NET_RESPONSE_BODY: 'net.response-body',
96
101
  /**
97
102
  * Live-control: browser → bridge. A human acted on the presenter panel.
98
103
  * `data: { kind: HumanControlKind; text?: string }`. Rides the existing EventMessage.
@@ -118,4 +123,33 @@ export const EventType = {
118
123
  * off the wire before the buffer, so no verdict, settle or agent read ever sees it.
119
124
  */
120
125
  HUD_USED: 'hud.used',
126
+ /**
127
+ * A `<video>` or `<audio>` changed playback state: `data: { event, tag, currentTime, duration?,
128
+ * readyState, paused }`. The event's own `t` orders it against the network, which is what a media
129
+ * defect ("Ready before the response arrived") is: an ordering in time no DOM count shows.
130
+ */
131
+ MEDIA_STATE: 'media.state',
132
+ /**
133
+ * A `<canvas>` drew something different: `data: { digest, width, height, mean }`. A hash of a
134
+ * 16x16 sample of its pixels and their mean colour, emitted only when the digest changes. What a
135
+ * canvas shows never reaches the DOM, so without this a canvas app's output is invisible.
136
+ */
137
+ CANVAS_DIGEST: 'canvas.digest',
138
+ };
139
+ /** The media events `MEDIA_STATE` reports. Not `timeupdate`: it fires several times a second. */
140
+ export const MediaEvent = {
141
+ PLAY: 'play',
142
+ PLAYING: 'playing',
143
+ PAUSE: 'pause',
144
+ SEEKED: 'seeked',
145
+ ENDED: 'ended',
146
+ LOADED_DATA: 'loadeddata',
147
+ CAN_PLAY: 'canplay',
148
+ WAITING: 'waiting',
149
+ ERROR: 'error',
150
+ };
151
+ /** What took a `CANVAS_DIGEST`: the 500 ms poll, or the end of an act (inside its window). */
152
+ export const CanvasTrigger = {
153
+ POLL: 'poll',
154
+ ACT: 'act',
121
155
  };
@@ -70,8 +70,6 @@ const PLAIN_CONTROLS = [
70
70
  'harness-toggle',
71
71
  // Link this project, on the Harness page.
72
72
  'harness-link',
73
- // Below the coverage gate: copy the prompt that closes it, for the coding agent.
74
- 'harness-copy-prompt',
75
73
  // The coding-agent block on the Agent Log: copy a prompt when none is connected.
76
74
  'agent-copy',
77
75
  // "See all" below Impact's recent bugs.
@@ -56,6 +56,10 @@ export declare const HudVisibility: {
56
56
  readonly REMOVED: "removed";
57
57
  };
58
58
  export type HudVisibility = (typeof HudVisibility)[keyof typeof HudVisibility];
59
+ /** Minimum Reticle SDK version supporting HUD placement/visibility controls via session tune. */
60
+ export declare const HUD_MIN_SDK_VERSION = "3.6.0";
61
+ /** Wire diagnostic returned when an agent attempts to position a HUD that was previously removed. */
62
+ export declare const HUD_RELOAD_TO_RESTORE = "reload to restore";
59
63
  /** The corner an agent can move the HUD to; `bottom-right` is where it docks by default. */
60
64
  export declare const HudCorner: {
61
65
  readonly TOP_LEFT: "top-left";
@@ -51,6 +51,10 @@ export const HudVisibility = {
51
51
  HIDDEN: 'hidden',
52
52
  REMOVED: 'removed',
53
53
  };
54
+ /** Minimum Reticle SDK version supporting HUD placement/visibility controls via session tune. */
55
+ export const HUD_MIN_SDK_VERSION = '3.6.0';
56
+ /** Wire diagnostic returned when an agent attempts to position a HUD that was previously removed. */
57
+ export const HUD_RELOAD_TO_RESTORE = 'reload to restore';
54
58
  /** The corner an agent can move the HUD to; `bottom-right` is where it docks by default. */
55
59
  export const HudCorner = {
56
60
  TOP_LEFT: 'top-left',
@@ -8,3 +8,19 @@ export declare const MCP_SSE_PATH = "/mcp/sse";
8
8
  export declare const MCP_MESSAGE_PATH = "/mcp/message";
9
9
  /** Directory the MCP proxy was started in. One daemon serves every project, and this says which. */
10
10
  export declare const MCP_CLIENT_DIRECTORY_HEADER = "x-reticle-client-directory";
11
+ /**
12
+ * Query parameter on the SSE connect: one id per MCP proxy process. A reconnect from the same
13
+ * process sends the same id, so the daemon knows it is the same agent coming back.
14
+ */
15
+ export declare const PROXY_ID_PARAM = "proxyId";
16
+ /**
17
+ * How long the daemon waits after the last agent detaches before it ends the browser sessions. A
18
+ * proxy that reconnects inside this window keeps them.
19
+ */
20
+ export declare const AGENT_DETACH_GRACE_MS = 10000;
21
+ /**
22
+ * How long the daemon waits for a leased tab to close before it gives up on it. After this time it
23
+ * frees the slot and closes the browser that holds the tab, so a close that never returns cannot
24
+ * keep the tab open.
25
+ */
26
+ export declare const LEASE_CLOSE_TIMEOUT_MS = 5000;
@@ -8,3 +8,19 @@ export const MCP_SSE_PATH = '/mcp/sse';
8
8
  export const MCP_MESSAGE_PATH = '/mcp/message';
9
9
  /** Directory the MCP proxy was started in. One daemon serves every project, and this says which. */
10
10
  export const MCP_CLIENT_DIRECTORY_HEADER = 'x-reticle-client-directory';
11
+ /**
12
+ * Query parameter on the SSE connect: one id per MCP proxy process. A reconnect from the same
13
+ * process sends the same id, so the daemon knows it is the same agent coming back.
14
+ */
15
+ export const PROXY_ID_PARAM = 'proxyId';
16
+ /**
17
+ * How long the daemon waits after the last agent detaches before it ends the browser sessions. A
18
+ * proxy that reconnects inside this window keeps them.
19
+ */
20
+ export const AGENT_DETACH_GRACE_MS = 10_000;
21
+ /**
22
+ * How long the daemon waits for a leased tab to close before it gives up on it. After this time it
23
+ * frees the slot and closes the browser that holds the tab, so a close that never returns cannot
24
+ * keep the tab open.
25
+ */
26
+ export const LEASE_CLOSE_TIMEOUT_MS = 5_000;
@@ -0,0 +1,19 @@
1
+ /**
2
+ * Why a NET_REQUEST's `responseBody` is absent, or present when the app never asked for bodies.
3
+ *
4
+ * `ERROR_STATUS` marks a body recorded only because the call failed. The other three explain why a
5
+ * body is not available while capture is on (#1520). Without them, a skipped body looked
6
+ * like capture switched off, so a body clause answered `no` and told the caller to enable a setting
7
+ * that was already on. No reason on a body-less call means capture was off, or the SDK predates this.
8
+ */
9
+ export declare const ResponseBodyReason: {
10
+ /** Recorded only because the response was an error; the app did not ask for bodies. */
11
+ readonly ERROR_STATUS: "error-status";
12
+ /** An unsupported stream format, such as ndjson, which the SDK does not read. */
13
+ readonly STREAMING: "streaming";
14
+ /** A binary or other non-text type, which is not recorded. */
15
+ readonly NOT_TEXT: "not-text";
16
+ /** A body still being captured, or one that could not be read before its deadline or at all. */
17
+ readonly UNREADABLE: "unreadable";
18
+ };
19
+ export type ResponseBodyReason = (typeof ResponseBodyReason)[keyof typeof ResponseBodyReason];
@@ -0,0 +1,18 @@
1
+ /**
2
+ * Why a NET_REQUEST's `responseBody` is absent, or present when the app never asked for bodies.
3
+ *
4
+ * `ERROR_STATUS` marks a body recorded only because the call failed. The other three explain why a
5
+ * body is not available while capture is on (#1520). Without them, a skipped body looked
6
+ * like capture switched off, so a body clause answered `no` and told the caller to enable a setting
7
+ * that was already on. No reason on a body-less call means capture was off, or the SDK predates this.
8
+ */
9
+ export const ResponseBodyReason = {
10
+ /** Recorded only because the response was an error; the app did not ask for bodies. */
11
+ ERROR_STATUS: 'error-status',
12
+ /** An unsupported stream format, such as ndjson, which the SDK does not read. */
13
+ STREAMING: 'streaming',
14
+ /** A binary or other non-text type, which is not recorded. */
15
+ NOT_TEXT: 'not-text',
16
+ /** A body still being captured, or one that could not be read before its deadline or at all. */
17
+ UNREADABLE: 'unreadable',
18
+ };