@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
@@ -9,7 +9,7 @@
9
9
  * `z.nativeEnum`, timestamps are epoch-ms NUMBERS (the clock is injected — never read inside pure
10
10
  * logic), no `any` (opaque evidence is `z.unknown`), and every domain string is a named constant.
11
11
  */
12
- import { z } from 'zod';
12
+ import * as z from 'zod';
13
13
  import { SubjectRefSchema } from 'open-verification';
14
14
  import { PredicateKind } from './consequence.js';
15
15
  import { Verified } from './verified-constants.js';
@@ -98,8 +98,9 @@ export const RunFlowStatus = {
98
98
  * a drive with nothing failed was reported "1 broken" before this rule was one rule.
99
99
  */
100
100
  export function driveFlowStatus(checks) {
101
- if (0 < checks.failed)
101
+ if (0 < checks.failed) {
102
102
  return RunFlowStatus.FAIL;
103
+ }
103
104
  return 0 < checks.held && false !== checks.goalMet ? RunFlowStatus.PASS : RunFlowStatus.SKIPPED;
104
105
  }
105
106
  /**
@@ -228,6 +229,11 @@ export const STEP_SCREENSHOT = {
228
229
  MAX_PER_RUN: 300,
229
230
  /** The platform refuses an image larger than this, decoded. */
230
231
  MAX_BYTES: 1.5 * 1024 * 1024,
232
+ /**
233
+ * The `tool` of a frame: a picture taken between steps while Reticle drives a tab, about once a
234
+ * second. Frames share the run's `seq`, so the shots in `seq` order play the run as a film.
235
+ */
236
+ FRAME_TOOL: 'frame',
231
237
  };
232
238
  /** One step's screenshot as a run artifact records it. `file` is relative to the run's directory. */
233
239
  export const StepScreenshotSchema = z.object({
@@ -352,8 +358,15 @@ export const RunCheckSchema = z.object({
352
358
  checkId: z.string().optional(),
353
359
  /** The journal action that produced it, kept on this machine to pair it with its screenshot. */
354
360
  actionId: z.string().optional(),
355
- /** The declared intent this check was taken for, by id: what it proves, named rather than timed. */
361
+ /**
362
+ * What this check proves: the agent's `intent` (a sentence, or the id of a declared intent), else a
363
+ * sentence the engine built from the predicate in the failure voice — see `intentDerived`.
364
+ */
356
365
  intent: z.string().optional(),
366
+ /** True when `intent` was built from the predicate, not given by the agent. */
367
+ intentDerived: z.boolean().optional(),
368
+ /** The index of the `allOf` part that failed, so a title can name the one thing that did not happen. */
369
+ failedPart: z.number().int().min(0).optional(),
357
370
  /** What the page looked like when this check was decided. */
358
371
  screenshot: StepScreenshotSchema.optional(),
359
372
  /**
@@ -395,8 +408,8 @@ export const VerificationEvidenceSchema = z.object({
395
408
  .array(z.object({
396
409
  store: z.string(),
397
410
  path: z.string(),
398
- expected: z.unknown(),
399
- actual: z.unknown(),
411
+ expected: z.unknown().optional(),
412
+ actual: z.unknown().optional(),
400
413
  ok: z.boolean(),
401
414
  }))
402
415
  .default([]),
@@ -464,6 +477,12 @@ export const ReticleVerificationRunSchema = z.object({
464
477
  name: z.string(),
465
478
  framework: z.nativeEnum(RunFramework),
466
479
  commit: z.string().optional(),
480
+ /**
481
+ * The git branch of the checkout that served the page. Several agents can drive one project at
482
+ * once, each in its own worktree; the branch tells their runs apart. Optional and additive: an
483
+ * older reader strips it and keeps the run.
484
+ */
485
+ branch: z.string().optional(),
467
486
  env: z.nativeEnum(RunEnv).optional(),
468
487
  previewUrl: z.string().optional(),
469
488
  }),
@@ -472,6 +491,18 @@ export const ReticleVerificationRunSchema = z.object({
472
491
  kind: z.nativeEnum(RunAgentKind),
473
492
  model: z.string().optional(),
474
493
  }),
494
+ /**
495
+ * The episode that produced this run: `.reticle/episodes/<episodeId>.jsonl` on the machine that
496
+ * ran it. Joins the run to every tool call the agent made, exactly. Absent when no episode was
497
+ * written (the journal off, a CI run with no agent).
498
+ */
499
+ episodeId: z.string().optional(),
500
+ /**
501
+ * The coding agent's own session id, as its MCP server announced it (Claude Code's
502
+ * `CLAUDE_CODE_SESSION_ID`, the `session_id` its hooks receive). Joins the run to the agent
503
+ * hooks' `agent-<session>.jsonl` exactly, even with two sessions of one agent in a project.
504
+ */
505
+ agentSession: z.string().optional(),
475
506
  trigger: z.object({
476
507
  kind: z.nativeEnum(RunTrigger),
477
508
  diffRef: z.string().optional(),
@@ -505,7 +536,7 @@ export const ReticleVerificationRunSchema = z.object({
505
536
  * schema loads with every page; its shape is `PromptContextSchema` in `@reticlehq/core/artifacts`,
506
537
  * which the daemon writes and reads it with.
507
538
  */
508
- context: z.record(z.unknown()).optional(),
539
+ context: z.record(z.string(), z.unknown()).optional(),
509
540
  changedFiles: z.array(RunChangedFileSchema).default([]),
510
541
  flows: z.array(RunFlowResultSchema).default([]),
511
542
  checks: z.array(RunCheckSchema).default([]),
@@ -19,7 +19,7 @@
19
19
  * - **`total` is known before the loop starts**, because "step 3" without "of 12" tells a reader
20
20
  * nothing about whether to keep waiting, which is the entire question they are asking.
21
21
  */
22
- import { z } from 'zod';
22
+ import * as z from 'zod';
23
23
  /** The phases a run passes through, in the order they occur. */
24
24
  export declare const VerifyPhase: {
25
25
  /** Opening the bridge connection. Fast, and the first thing that can fail. */
@@ -46,84 +46,42 @@ export declare const VERIFY_PROGRESS_NAME_MAX = 120;
46
46
  /** How many events a receiver keeps for one run. A walk nobody can scroll is not more honest. */
47
47
  export declare const VERIFY_PROGRESS_MAX_EVENTS = 200;
48
48
  export declare const verifyProgressEventSchema: z.ZodObject<{
49
- phase: z.ZodEnum<["connecting", "waiting_for_app", "flows_found", "flow_started", "flow_finished", "grading", "pushed"]>;
50
- /** 0-based position in the suite. Absent on phases that are not about one flow. */
49
+ phase: z.ZodEnum<{
50
+ connecting: "connecting";
51
+ waiting_for_app: "waiting_for_app";
52
+ flows_found: "flows_found";
53
+ flow_started: "flow_started";
54
+ flow_finished: "flow_finished";
55
+ grading: "grading";
56
+ pushed: "pushed";
57
+ }>;
51
58
  index: z.ZodOptional<z.ZodNumber>;
52
- /** How many flows the run will replay. Present from `flows_found` onwards. */
53
59
  total: z.ZodOptional<z.ZodNumber>;
54
- /** The flow being replayed. Absent on phases that are not about one flow. */
55
60
  name: z.ZodOptional<z.ZodString>;
56
- /** Did that flow replay cleanly? A convenience for rendering, never a verdict. */
57
61
  ok: z.ZodOptional<z.ZodBoolean>;
58
- /** When the emitter saw it, from the injected clock — never `Date.now()` in logic. */
59
62
  at: z.ZodNumber;
60
- }, "strip", z.ZodTypeAny, {
61
- at: number;
62
- phase: "connecting" | "waiting_for_app" | "flows_found" | "flow_started" | "flow_finished" | "grading" | "pushed";
63
- ok?: boolean | undefined;
64
- name?: string | undefined;
65
- total?: number | undefined;
66
- index?: number | undefined;
67
- }, {
68
- at: number;
69
- phase: "connecting" | "waiting_for_app" | "flows_found" | "flow_started" | "flow_finished" | "grading" | "pushed";
70
- ok?: boolean | undefined;
71
- name?: string | undefined;
72
- total?: number | undefined;
73
- index?: number | undefined;
74
- }>;
63
+ }, z.core.$strip>;
75
64
  export type VerifyProgressEvent = z.infer<typeof verifyProgressEventSchema>;
76
65
  /** The batch shape a run posts. Batched because one request per flow is a request per flow. */
77
66
  export declare const verifyProgressBatchSchema: z.ZodObject<{
78
67
  runId: z.ZodString;
79
68
  events: z.ZodArray<z.ZodObject<{
80
- phase: z.ZodEnum<["connecting", "waiting_for_app", "flows_found", "flow_started", "flow_finished", "grading", "pushed"]>;
81
- /** 0-based position in the suite. Absent on phases that are not about one flow. */
69
+ phase: z.ZodEnum<{
70
+ connecting: "connecting";
71
+ waiting_for_app: "waiting_for_app";
72
+ flows_found: "flows_found";
73
+ flow_started: "flow_started";
74
+ flow_finished: "flow_finished";
75
+ grading: "grading";
76
+ pushed: "pushed";
77
+ }>;
82
78
  index: z.ZodOptional<z.ZodNumber>;
83
- /** How many flows the run will replay. Present from `flows_found` onwards. */
84
79
  total: z.ZodOptional<z.ZodNumber>;
85
- /** The flow being replayed. Absent on phases that are not about one flow. */
86
80
  name: z.ZodOptional<z.ZodString>;
87
- /** Did that flow replay cleanly? A convenience for rendering, never a verdict. */
88
81
  ok: z.ZodOptional<z.ZodBoolean>;
89
- /** When the emitter saw it, from the injected clock — never `Date.now()` in logic. */
90
82
  at: z.ZodNumber;
91
- }, "strip", z.ZodTypeAny, {
92
- at: number;
93
- phase: "connecting" | "waiting_for_app" | "flows_found" | "flow_started" | "flow_finished" | "grading" | "pushed";
94
- ok?: boolean | undefined;
95
- name?: string | undefined;
96
- total?: number | undefined;
97
- index?: number | undefined;
98
- }, {
99
- at: number;
100
- phase: "connecting" | "waiting_for_app" | "flows_found" | "flow_started" | "flow_finished" | "grading" | "pushed";
101
- ok?: boolean | undefined;
102
- name?: string | undefined;
103
- total?: number | undefined;
104
- index?: number | undefined;
105
- }>, "many">;
106
- }, "strip", z.ZodTypeAny, {
107
- runId: string;
108
- events: {
109
- at: number;
110
- phase: "connecting" | "waiting_for_app" | "flows_found" | "flow_started" | "flow_finished" | "grading" | "pushed";
111
- ok?: boolean | undefined;
112
- name?: string | undefined;
113
- total?: number | undefined;
114
- index?: number | undefined;
115
- }[];
116
- }, {
117
- runId: string;
118
- events: {
119
- at: number;
120
- phase: "connecting" | "waiting_for_app" | "flows_found" | "flow_started" | "flow_finished" | "grading" | "pushed";
121
- ok?: boolean | undefined;
122
- name?: string | undefined;
123
- total?: number | undefined;
124
- index?: number | undefined;
125
- }[];
126
- }>;
83
+ }, z.core.$strip>>;
84
+ }, z.core.$strip>;
127
85
  export type VerifyProgressBatch = z.infer<typeof verifyProgressBatchSchema>;
128
86
  /** Truncate a user-supplied flow name to the wire bound, so a caller cannot overflow the schema. */
129
87
  export declare const boundFlowName: (name: string) => string;
@@ -19,7 +19,7 @@
19
19
  * - **`total` is known before the loop starts**, because "step 3" without "of 12" tells a reader
20
20
  * nothing about whether to keep waiting, which is the entire question they are asking.
21
21
  */
22
- import { z } from 'zod';
22
+ import * as z from 'zod';
23
23
  /** The phases a run passes through, in the order they occur. */
24
24
  export const VerifyPhase = {
25
25
  /** Opening the bridge connection. Fast, and the first thing that can fail. */
@@ -28,6 +28,12 @@ export declare const MCP_SERVER_NAME = "reticle";
28
28
  export declare const MCP_SHUTDOWN_EVENT = "reticle-shutdown";
29
29
  /** Local-only daemon introspection — `reticle status` GETs this for sessions + health at a glance. */
30
30
  export declare const STATUS_PATH = "/status";
31
+ /**
32
+ * Local-only stop request — `reticle stop` and `reticle kill` POST here first, with the pairing token
33
+ * as a bearer token. It runs the daemon's normal shutdown path. A signal cannot do that on Windows,
34
+ * where it ends the process at once.
35
+ */
36
+ export declare const SHUTDOWN_PATH = "/shutdown";
31
37
  /**
32
38
  * Query flag on STATUS_PATH: the caller (a running `reticle init`) is waiting on this daemon, so it
33
39
  * must not idle out yet. Without it the daemon init started exited mid-wait on a slow desktop build.
@@ -101,140 +107,7 @@ export declare const RETICLE_URL_PARAM: {
101
107
  };
102
108
  /** The loopback bind address. The daemon/bridge bind here by default — never expose Reticle off-host. */
103
109
  export declare const LOOPBACK_HOST = "127.0.0.1";
104
- /**
105
- * Every environment variable Reticle reads, named once. A misspelled inline env string silently
106
- * disables the control it gates (e.g. a typo'd `RETICLE_TOKEN` would disable auth) — so the names live
107
- * here and nowhere else. The values are the literal process.env keys.
108
- */
109
- export declare const ReticleEnv: {
110
- /** "0"/"false"/"off" turns off telemetry and every optional outbound call; DO_NOT_TRACK too. */
111
- readonly TELEMETRY: "RETICLE_TELEMETRY";
112
- readonly DO_NOT_TRACK: "DO_NOT_TRACK";
113
- /** Shared-secret the browser SDK must present in HELLO; absent ⇒ loopback-trust only. */
114
- readonly TOKEN: "RETICLE_TOKEN";
115
- /** Bridge bind host. Defaults to loopback; setting anything else is opt-in remote exposure. */
116
- readonly HOST: "RETICLE_HOST";
117
- /** Comma-separated WS Origin allow-list for the bridge. */
118
- readonly ALLOWED_ORIGINS: "RETICLE_ALLOWED_ORIGINS";
119
- /** Bridge/daemon WS port override. */
120
- readonly PORT: "RETICLE_PORT";
121
- /** Daemon state — pidfiles, discovery registry, logs. Defaults to `~/.reticle`. Overridable
122
- * because a read-only $HOME (sandboxed agent, locked-down Windows profile, container) otherwise
123
- * makes the daemon unstartable with a raw EACCES naming nothing. Reported by a Windows user. */
124
- readonly STATE_DIR: "RETICLE_STATE_DIR";
125
- /** Attach to an already-running browser over CDP instead of launching one. */
126
- readonly CDP_URL: "RETICLE_CDP_URL";
127
- /** The Chromium executable to launch, in place of Playwright's own build or an installed Chrome. */
128
- readonly CHROMIUM_PATH: "RETICLE_CHROMIUM_PATH";
129
- /** Max simultaneous leased headless contexts in the browser pool (resource cap). */
130
- readonly MAX_CONTEXTS: "RETICLE_MAX_CONTEXTS";
131
- /**
132
- * Inbound events per second before the bridge starts SAMPLING (never disconnecting).
133
- *
134
- * Raise it for a legitimately busy app — a streaming dashboard, a live grid — rather than accept
135
- * partial coverage. Free and local: the daemon runs on the same machine, so a higher ceiling costs
136
- * nothing to anyone.
137
- */
138
- readonly MAX_MESSAGES_PER_SECOND: "RETICLE_MAX_MESSAGES_PER_SECOND";
139
- /** Bearer token required by the optional `reticle serve --http` verify endpoint. */
140
- readonly VERIFY_TOKEN: "RETICLE_VERIFY_TOKEN";
141
- /** Ms of continuous idleness (no agent, no browser session, no lease) before the daemon self-exits;
142
- * `0` disables. Keeps Reticle from lingering on a user's machine after the editor closes. */
143
- readonly IDLE_SHUTDOWN: "RETICLE_IDLE_SHUTDOWN_MS";
144
- /** Idle re-check cadence (default 30s). Overridable so daemon-lifecycle-test can watch a full
145
- * exit/wake cycle in seconds rather than minutes. */
146
- readonly IDLE_CHECK: "RETICLE_IDLE_CHECK_MS";
147
- /**
148
- * Grace for a daemon with an agent ATTACHED. Longer than the base on purpose: quiet with a client
149
- * present means a slow install or a thinking human, not an unwanted daemon — a flat 5 minutes was
150
- * killing live runs mid-install. Derived from the base when unset.
151
- */
152
- readonly IDLE_ATTACHED: "RETICLE_IDLE_ATTACHED_MS";
153
- /**
154
- * How often the daemon writes `reticle_daemon_alive`, so a GAP in its log is evidence it died.
155
- *
156
- * Overridable for the same reason the idle windows are: a spec that has to prove "a killed daemon
157
- * is distinguishable from a tidy one" cannot wait 30 seconds per beat, and a spec that instead
158
- * re-implements the cadence is insensitive to the thing it claims to guard.
159
- */
160
- readonly HEARTBEAT: "RETICLE_HEARTBEAT_MS";
161
- /** Directory holding the auto-provisioned pairing token. Defaults to ~/.reticle; relocatable for CI. */
162
- readonly PAIRING_TOKEN_DIR: "RETICLE_PAIRING_TOKEN_DIR";
163
- /** Force the durable causal journal off (`0`/`false`/`off`) or on (`1`/`true`/`on`); default on. */
164
- readonly JOURNAL: "RETICLE_JOURNAL";
165
- /**
166
- * Verbose internal flow tracing for people working ON Reticle (`1`/`true`/`on`); default off.
167
- *
168
- * Distinct from the journal, which records what the AGENT did to the app. This records what
169
- * RETICLE did to answer it: one line per internal stage, with its duration and nesting, so a
170
- * developer can see which code a tool call actually went through and where the time went.
171
- * Off by default and free when off — a trace on every tool call is a cost on the hot path.
172
- */
173
- readonly TRACE: "RETICLE_TRACE";
174
- /**
175
- * How many consecutive reconnects the MCP proxy attempts before it stops retrying and goes
176
- * dormant. Overridable for the same reason the idle windows are: the real budget takes MINUTES to
177
- * exhaust, so the one spec that proves the proxy SURVIVES exhaustion could not run at all without
178
- * shortening it. A budget nobody can reach in a test is a budget nobody tests.
179
- */
180
- readonly RECONNECT_ATTEMPTS: "RETICLE_RECONNECT_ATTEMPTS";
181
- /** Quiet window before an abandoned MCP stdio proxy exits; `0` disables the watcher. */
182
- readonly MCP_PROXY_IDLE: "RETICLE_MCP_PROXY_IDLE_MS";
183
- /**
184
- * API key for the harness — the model that drives the app when no coding agent is in the loop.
185
- *
186
- * The standard Anthropic name, on purpose: a machine that can already run a coding agent can
187
- * already run the harness, with nothing to configure. Absent ⇒ the harness is simply unavailable
188
- * and every other part of Reticle is unaffected.
189
- */
190
- readonly HARNESS_KEY: "ANTHROPIC_API_KEY";
191
- /** Model the harness drives with. Defaults to a small one — see `DEFAULT_HARNESS_MODEL`. */
192
- readonly HARNESS_MODEL: "RETICLE_HARNESS_MODEL";
193
- /** Base URL for the harness's model API, for a proxy or a gateway. */
194
- readonly HARNESS_BASE_URL: "RETICLE_HARNESS_BASE_URL";
195
- /** Hard ceiling on harness model turns in one drive. Bounds cost, not value. */
196
- readonly HARNESS_MAX_STEPS: "RETICLE_HARNESS_MAX_STEPS";
197
- /** The free drive `reticle try` was granted, sent on every Harness call it bills. */
198
- readonly DRIVE_ID: "RETICLE_DRIVE_ID";
199
- /**
200
- * Which model backs the harness driver: `anthropic` (the default) or `jev`.
201
- *
202
- * Two drivers exist because the driver's job turns out not to need a text generator. It picks the
203
- * next action and says what it expects; the verdict is decided afterwards by the engine, with no
204
- * model anywhere near it. A System One model answers typed questions against a state, which is
205
- * exactly that job and none of the rest, so it can drive without being able to generate a
206
- * sentence. Unset keeps the existing behaviour for everybody who has not asked for this.
207
- */
208
- readonly HARNESS_DRIVER: "RETICLE_HARNESS_DRIVER";
209
- /**
210
- * A direct Jev key, for this repo's own benchmarks and for anyone holding a TypeSafe account.
211
- *
212
- * Users are not expected to have one. The ordinary path is the key they already minted on the
213
- * platform (`RETICLE_API_KEY`), which reaches Jev through the proxy at `RETICLE_CLOUD_URL` —
214
- * this variable is the escape hatch that skips it, and it takes precedence when both are set so
215
- * that a developer debugging the upstream is never silently talking to the proxy instead.
216
- */
217
- readonly HARNESS_JEV_KEY: "JEV_API_KEY";
218
- /** Base URL for the Jev API, for a proxy or a gateway. Defaults to TypeSafe's own endpoint. */
219
- readonly HARNESS_JEV_URL: "RETICLE_HARNESS_JEV_URL";
220
- /** A direct OpenAI key. As with Jev, the ordinary path is the platform key and its proxy. */
221
- readonly HARNESS_OPENAI_KEY: "OPENAI_API_KEY";
222
- /** Model the OpenAI driver uses. Defaults to a small one — see `DEFAULT_OPENAI_MODEL`. */
223
- readonly HARNESS_OPENAI_MODEL: "RETICLE_HARNESS_OPENAI_MODEL";
224
- /**
225
- * The API key minted on the platform, and the host it belongs to.
226
- *
227
- * Read through `apiKeyFrom()`, never directly — see the note on that function for why there are
228
- * two names for one key and why neither may be dropped.
229
- */
230
- readonly API_KEY: "RETICLE_API_KEY";
231
- /** The name this key had until 2026-09. Still honoured; see `apiKeyFrom()`. */
232
- readonly CLOUD_KEY: "RETICLE_CLOUD_KEY";
233
- /** The platform host. Read through `cloudUrlFrom()`, which also accepts `URL`. */
234
- readonly CLOUD_URL: "RETICLE_CLOUD_URL";
235
- /** The short name for `CLOUD_URL`, which people type first. `CLOUD_URL` wins when both are set. */
236
- readonly URL: "RETICLE_URL";
237
- };
110
+ export { ReticleEnv } from './reticle-env.js';
238
111
  /**
239
112
  * The platform API key, whichever name it arrives under.
240
113
  *
@@ -337,8 +210,27 @@ export declare const DANGEROUS_ACTION_CONFIRM_ARG = "confirmDangerous";
337
210
  * through the SDK instead.
338
211
  */
339
212
  export declare const NATIVE_INPUT_ARG = "native";
213
+ /**
214
+ * INSPECT argument: scroll an off-viewport element to the center before it is measured. The real-input
215
+ * path sends it, because a real pointer aimed at an off-viewport box lands on nothing (#1711).
216
+ */
217
+ export declare const INSPECT_REVEAL_ARG = "reveal";
218
+ /**
219
+ * INSPECT result field, present only when `INSPECT_REVEAL_ARG` was sent: whether the element's center
220
+ * is inside the viewport, measured after the scroll. An SDK that predates it omits it, and a caller
221
+ * must read that absence as unknown, never as out of view.
222
+ */
223
+ export declare const INSPECT_IN_VIEWPORT_FIELD = "inViewport";
340
224
  /** Schema version stamped onto compiled replay programs. */
341
225
  export declare const REPLAY_PROGRAM_VERSION = 1;
226
+ /**
227
+ * The instruction files `reticle init` writes its Reticle section into, and the line that opens the
228
+ * section. `init` writes it and the server reads it, so both take it from here.
229
+ */
230
+ export declare const AgentRules: {
231
+ readonly FILES: readonly ["CLAUDE.md", "AGENTS.md"];
232
+ readonly BEGIN: "<!-- reticle:begin (managed by `reticle init` — edit outside these markers) -->";
233
+ };
342
234
  /** The git-checked Reticle workspace directory + its layout. No free strings. */
343
235
  export declare const ReticleDir: {
344
236
  readonly ROOT: ".reticle";
@@ -371,6 +263,8 @@ export declare const ReticleDir: {
371
263
  readonly VISUAL_SUBDIR: "visual";
372
264
  /** verification-run artifacts —.reticle/runs/<runId>.json (the OEM/CI-consumable verdict). */
373
265
  readonly RUNS_SUBDIR: "runs";
266
+ /** Dev-server logs, only when the state home cannot be written. Machine-local, like `runs/`. */
267
+ readonly LOGS_SUBDIR: "logs";
374
268
  /** fail-to-pass bug capsules —.reticle/capsules/<id>.json (a minimal failing flow + its evidence). */
375
269
  readonly CAPSULES_SUBDIR: "capsules";
376
270
  /**
@@ -385,6 +279,11 @@ export declare const ReticleDir: {
385
279
  readonly PLANS_SUBDIR: "plans";
386
280
  /** durable causal journal —.reticle/sessions/<id>/{events,actions}.jsonl (the substrate). */
387
281
  readonly SESSIONS_SUBDIR: "sessions";
282
+ /**
283
+ * Every tool call an agent made, in full, with what it did to the page —
284
+ * .reticle/episodes/<connection>.jsonl. Local evidence: never committed, never sent.
285
+ */
286
+ readonly EPISODES_SUBDIR: "episodes";
388
287
  /** append-only event ledger inside a session dir (one ReticleEvent per line). */
389
288
  readonly JOURNAL_EVENTS_FILE: "events.jsonl";
390
289
  /** append-only action ledger inside a session dir (one JournalAction per line). */
@@ -407,8 +306,12 @@ export declare const ReticleDir: {
407
306
  readonly COVERAGE_FILE: "coverage.json";
408
307
  /** Human review marks (HUD notes), pending and resolved — see server portal/session/human. */
409
308
  readonly NOTES_FILE: "notes.json";
410
- /** The user's latest request, as the agent relayed it. Local: it is the user's own words. */
309
+ /** The user's latest request: the newest prompt the hook captured, or the one the agent relayed. Local. */
411
310
  readonly REQUEST_FILE: "request.json";
311
+ /** Every prompt the agent hook captured, one JSON line each, oldest first. `request.json` holds the newest. */
312
+ readonly REQUESTS_LOG_FILE: "requests.jsonl";
313
+ /** The prompt history moved aside when `requests.jsonl` fills. The same words, so the same rule. */
314
+ readonly REQUESTS_LOG_ROTATED_FILE: "requests.1.jsonl";
412
315
  readonly APP_NOTES_FILE: "app-notes.json";
413
316
  readonly PLATFORM_MOMENTS_FILE: "platform-moments.json";
414
317
  /**
@@ -470,6 +373,7 @@ export declare const VisualReason: {
470
373
  readonly BASELINE_MISSING: "baseline-missing";
471
374
  readonly DIMENSION_MISMATCH: "dimension-mismatch";
472
375
  readonly FULL_PAGE_UNSUPPORTED: "full-page-unsupported";
376
+ readonly CROP_UNSUPPORTED: "crop-unsupported";
473
377
  readonly NOT_COMPOSITED: "window-not-composited";
474
378
  };
475
379
  export type VisualReason = (typeof VisualReason)[keyof typeof VisualReason];
@@ -514,8 +418,8 @@ export declare const ContractReadError: {
514
418
  readonly MALFORMED: "contract-malformed";
515
419
  };
516
420
  export type ContractReadError = (typeof ContractReadError)[keyof typeof ContractReadError];
517
- import { EventType } from './event-types.js';
518
- export { EventType };
421
+ import { CanvasTrigger, EventType, MediaEvent } from './event-types.js';
422
+ export { CanvasTrigger, EventType, MediaEvent };
519
423
  /** Bounds for the per-session ring buffer. */
520
424
  export declare const RING_BUFFER_DEFAULTS: {
521
425
  readonly MAX_EVENTS: 2000;
@@ -542,6 +446,11 @@ export declare const PhenomenonType: {
542
446
  export type PhenomenonType = (typeof PhenomenonType)[keyof typeof PhenomenonType];
543
447
  /** Signal the React adapter fires once hydration commits (handlers attached). Shared browser↔server. */
544
448
  export declare const RETICLE_HYDRATION_SIGNAL = "reticle:hydration-complete";
449
+ /**
450
+ * Work the app declared it is doing (`reticle.busy(work)`): `{ delta: 1 }` when it starts and
451
+ * `{ delta: -1 }` when it ends. `settled` counts it as in flight, like a request. Shared browser↔server.
452
+ */
453
+ export declare const RETICLE_BUSY_SIGNAL = "reticle:busy";
545
454
  /**
546
455
  * The registered-store name the React adapter uses for render stats, read via reticle_state. It crosses
547
456
  * the wire as a store id AND the browser SDK special-cases it as reticle-owned (so it isn't flagged as
@@ -637,6 +546,10 @@ export declare const InputModeReason: {
637
546
  * permanent for the session, not a transient downgrade, so it should stop asking.
638
547
  */
639
548
  readonly NOT_CONFIGURED: "real-input-not-configured-for-this-session";
549
+ readonly TARGET_NOT_FOCUSABLE: "target-cannot-hold-focus";
550
+ /** A production drive presses only in the page. A native key goes to whatever holds focus, so
551
+ * the production policy could not judge the control it pressed. */
552
+ readonly PRODUCTION_PRESS_IN_PAGE: "production-drive-presses-in-page";
640
553
  };
641
554
  export type InputModeReason = (typeof InputModeReason)[keyof typeof InputModeReason];
642
555
  /** Best-effort caveats attached to action results so the agent can interpret a no-op. */
@@ -650,11 +563,9 @@ export declare const ActionWarning: {
650
563
  * actionable. Scroll it into a clear area or dismiss the overlay on top.
651
564
  */
652
565
  readonly 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";
653
- /**
654
- * A document-key press (Escape, Tab, a modifier shortcut) was dispatched at the focused
655
- * element or the document. No named target was given, so the effect must not claim one.
656
- */
566
+ /** A document-key press (Escape, Tab, a shortcut) went to the focused element or document. */
657
567
  readonly GLOBAL_PRESS: "press landed on the focused element or document — no named target was given, so this effect does not claim one";
568
+ readonly 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";
658
569
  };
659
570
  export type ActionWarning = (typeof ActionWarning)[keyof typeof ActionWarning];
660
571
  /** Failure modes when Reticle launches/drives its own browser (`reticle drive`). */
@@ -881,5 +792,9 @@ export declare const LeaseNotReadyReason: {
881
792
  readonly SDK_STOPPED_ANSWERING: "sdk_stopped_answering";
882
793
  /** The SDK answers, but its tab is hidden: timers and rAF are throttled, so nothing on it verifies. */
883
794
  readonly TAB_HIDDEN: "tab_hidden";
795
+ /** The page is not an HTML document (an `.svg`, for example), so the zero-install reader did not run. */
796
+ readonly NOT_HTML_DOCUMENT: "not_html_document";
797
+ /** The zero-install reader failed, for example because the tab closed during setup. */
798
+ readonly READER_FAILED: "reader_failed";
884
799
  };
885
800
  export type LeaseNotReadyReason = (typeof LeaseNotReadyReason)[keyof typeof LeaseNotReadyReason];