@reticlehq/core 3.6.0 → 3.8.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 (133) hide show
  1. package/dist/activation-entry.d.ts +9 -0
  2. package/dist/activation-entry.js +9 -0
  3. package/dist/artifacts/artifacts-entry.d.ts +2 -0
  4. package/dist/artifacts/artifacts-entry.js +2 -0
  5. package/dist/artifacts/drive-script.d.ts +222 -116
  6. package/dist/artifacts/drive-script.js +24 -1
  7. package/dist/artifacts/flow-constants.d.ts +33 -0
  8. package/dist/artifacts/flow-constants.js +35 -0
  9. package/dist/artifacts/flow-expect-flat.d.ts +8 -8
  10. package/dist/artifacts/flow-results.d.ts +461 -0
  11. package/dist/artifacts/flow-results.js +1 -0
  12. package/dist/artifacts/flow-types.d.ts +177 -543
  13. package/dist/artifacts/flow-types.js +17 -2
  14. package/dist/artifacts/harness-credits.d.ts +42 -0
  15. package/dist/artifacts/harness-credits.js +72 -0
  16. package/dist/artifacts/harness-map.d.ts +98 -0
  17. package/dist/artifacts/harness-map.js +36 -0
  18. package/dist/artifacts/impact.d.ts +355 -149
  19. package/dist/artifacts/impact.js +84 -49
  20. package/dist/artifacts/journal.d.ts +81 -11
  21. package/dist/artifacts/journal.js +39 -0
  22. package/dist/artifacts/prompt-context.d.ts +12 -0
  23. package/dist/artifacts/prompt-context.js +14 -3
  24. package/dist/artifacts/screenshot-upload.d.ts +51 -0
  25. package/dist/artifacts/screenshot-upload.js +26 -0
  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 +26 -26
  29. package/dist/hud-entry.d.ts +1 -0
  30. package/dist/hud-entry.js +2 -0
  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 +15 -0
  36. package/dist/index.js +15 -0
  37. package/dist/onboarding.d.ts +30 -1
  38. package/dist/onboarding.js +25 -0
  39. package/dist/realm/registry.js +19 -1
  40. package/dist/registry/dev-server-registry.d.ts +2 -2
  41. package/dist/schema/command-message.json +30 -0
  42. package/dist/schema/command-name.json +3 -1
  43. package/dist/schema/event-message.json +3 -1
  44. package/dist/schema/event-payloads.json +156 -3
  45. package/dist/schema/event-type.json +3 -1
  46. package/dist/schema/hello-message.json +21 -0
  47. package/dist/schema/reticle-event.json +3 -1
  48. package/dist/schema/reticle-message.json +54 -1
  49. package/dist/telemetry-bug.d.ts +169 -0
  50. package/dist/telemetry-bug.js +123 -0
  51. package/dist/telemetry-entry.d.ts +2 -1
  52. package/dist/telemetry-entry.js +2 -1
  53. package/dist/telemetry-feedback.d.ts +16 -2
  54. package/dist/telemetry-feedback.js +19 -0
  55. package/dist/telemetry-session.d.ts +91 -2
  56. package/dist/telemetry-session.js +65 -0
  57. package/dist/telemetry-signals.d.ts +557 -0
  58. package/dist/telemetry-signals.js +225 -0
  59. package/dist/telemetry.d.ts +649 -296
  60. package/dist/telemetry.js +110 -119
  61. package/dist/verdict/check-sentence.d.ts +34 -0
  62. package/dist/verdict/check-sentence.js +228 -0
  63. package/dist/verdict/consequence.d.ts +15 -0
  64. package/dist/verdict/consequence.js +11 -0
  65. package/dist/verdict/disparity.d.ts +105 -0
  66. package/dist/verdict/disparity.js +40 -0
  67. package/dist/verdict/findings.d.ts +16 -0
  68. package/dist/verdict/findings.js +22 -0
  69. package/dist/verdict/instrumentation-coverage.d.ts +84 -0
  70. package/dist/verdict/instrumentation-coverage.js +182 -0
  71. package/dist/verdict/instrumentation-gap.d.ts +79 -0
  72. package/dist/verdict/instrumentation-gap.js +65 -1
  73. package/dist/verdict/intent.d.ts +19 -5
  74. package/dist/verdict/intent.js +13 -1
  75. package/dist/verdict/predicate-tree.d.ts +17 -0
  76. package/dist/verdict/predicate-tree.js +37 -0
  77. package/dist/verdict/predicate.d.ts +16 -1
  78. package/dist/verdict/predicate.js +188 -13
  79. package/dist/verdict/property-assertion.d.ts +2 -2
  80. package/dist/verdict/run-report.d.ts +166 -0
  81. package/dist/verdict/run-report.js +53 -0
  82. package/dist/verdict/security.d.ts +60 -1
  83. package/dist/verdict/security.js +174 -12
  84. package/dist/verdict/verification-run.d.ts +713 -68
  85. package/dist/verdict/verification-run.js +113 -0
  86. package/dist/verdict/verify-progress.d.ts +6 -6
  87. package/dist/wire/constants/constants.d.ts +69 -155
  88. package/dist/wire/constants/constants.js +78 -159
  89. package/dist/wire/constants/discovery.d.ts +4 -4
  90. package/dist/wire/constants/discovery.js +4 -4
  91. package/dist/wire/constants/event-types.d.ts +35 -1
  92. package/dist/wire/constants/event-types.js +33 -1
  93. package/dist/wire/constants/hud-controls.js +15 -5
  94. package/dist/wire/constants/hud-use.d.ts +33 -4
  95. package/dist/wire/constants/hud-use.js +30 -4
  96. package/dist/wire/constants/mcp-wire.d.ts +26 -0
  97. package/dist/wire/constants/mcp-wire.js +26 -0
  98. package/dist/wire/constants/response-body-reason.d.ts +19 -0
  99. package/dist/wire/constants/response-body-reason.js +18 -0
  100. package/dist/wire/constants/reticle-chrome.d.ts +19 -0
  101. package/dist/wire/constants/reticle-chrome.js +19 -0
  102. package/dist/wire/constants/reticle-env.d.ts +138 -0
  103. package/dist/wire/constants/reticle-env.js +138 -0
  104. package/dist/wire/constants/session-constants.d.ts +26 -2
  105. package/dist/wire/constants/session-constants.js +26 -2
  106. package/dist/wire/desktop-contract.d.ts +8 -0
  107. package/dist/wire/desktop-contract.js +11 -0
  108. package/dist/wire/event-payloads.d.ts +202 -36
  109. package/dist/wire/event-payloads.js +100 -16
  110. package/dist/wire/messages.d.ts +193 -54
  111. package/dist/wire/messages.js +25 -1
  112. package/dist/wire/narrow.d.ts +6 -0
  113. package/dist/wire/narrow.js +26 -0
  114. package/dist/wire/next-step.d.ts +90 -0
  115. package/dist/wire/next-step.js +37 -0
  116. package/dist/wire/platform-link.d.ts +84 -0
  117. package/dist/wire/platform-link.js +57 -6
  118. package/dist/wire/production/activation-ticket.d.ts +64 -0
  119. package/dist/wire/production/activation-ticket.js +148 -0
  120. package/dist/wire/production/hello-mode.d.ts +35 -0
  121. package/dist/wire/production/hello-mode.js +32 -0
  122. package/dist/wire/production/production-policy.d.ts +138 -0
  123. package/dist/wire/production/production-policy.js +133 -0
  124. package/dist/wire/tool-names.d.ts +4 -0
  125. package/dist/wire/tool-names.js +4 -0
  126. package/dist/wire/types.d.ts +90 -52
  127. package/dist/wire/types.js +5 -0
  128. package/dist/words/notices.d.ts +1 -1
  129. package/dist/words/notices.js +1 -1
  130. package/dist/words/upgrade.js +1 -1
  131. package/dist/words/writing-rule.d.ts +14 -0
  132. package/dist/words/writing-rule.js +17 -0
  133. package/package.json +5 -1
@@ -11,18 +11,32 @@ export const HudView = {
11
11
  EXPANDED: 'expanded',
12
12
  };
13
13
  /**
14
- * Which page is showing, when the HUD is open: the Agent Log (`chat`), the Flows and Notes pages
15
- * inside it, Impact (`report`) or Settings. Timed per page, so how long somebody spends on each is a
16
- * number rather than a guess.
14
+ * Which page is showing, when the HUD is open: the Agent Log (`chat`), the Flows, Notes and Harness
15
+ * pages inside it, Impact (`report`), Settings, or the account menu open over any of them. Timed per
16
+ * page, so how long somebody spends on each is a number rather than a guess.
17
+ *
18
+ * `harness` and `account` were missing, so the Harness page was timed as `chat` (it opens over the
19
+ * Agent Log) and an open account menu was not seen at all.
17
20
  */
18
21
  export const HudPanel = {
19
22
  CHAT: 'chat',
20
23
  FLOWS: 'flows',
21
24
  NOTES: 'notes',
25
+ HARNESS: 'harness',
22
26
  SETTINGS: 'settings',
23
27
  REPORT: 'report',
28
+ ACCOUNT: 'account',
24
29
  NONE: 'none',
25
30
  };
31
+ /**
32
+ * Where the HUD asked somebody to sign in or link this project: the rail card under every page, the
33
+ * Harness page's own sign-in / link control, or the header's "Save runs for your team".
34
+ */
35
+ export const HudPromptSurface = {
36
+ RAIL: 'rail',
37
+ HARNESS: 'harness',
38
+ HEADER: 'header',
39
+ };
26
40
  /** What a toggle was switched to; absent for a plain press. */
27
41
  export const HudToggle = {
28
42
  ON: 'on',
@@ -37,6 +51,10 @@ export const HudVisibility = {
37
51
  HIDDEN: 'hidden',
38
52
  REMOVED: 'removed',
39
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';
40
58
  /** The corner an agent can move the HUD to; `bottom-right` is where it docks by default. */
41
59
  export const HudCorner = {
42
60
  TOP_LEFT: 'top-left',
@@ -58,6 +76,14 @@ export const ScriptStatus = {
58
76
  FAILED: 'failed',
59
77
  /** Never started: something it needed failed. */
60
78
  BLOCKED: 'blocked',
61
- /** A branch case whose condition did not hold. Not a failure. */
79
+ /**
80
+ * A branch case whose condition did not hold, or a step the destructive-action guard stopped
81
+ * because nobody acknowledged it. Not a failure.
82
+ */
62
83
  NOT_TAKEN: 'not-taken',
84
+ /**
85
+ * Ran, and decided nothing: its end was on the page before it acted, or it reached its goal with
86
+ * no check that could have gone red. Neither proved nor a failure.
87
+ */
88
+ UNDECIDED: 'undecided',
63
89
  };
@@ -0,0 +1,26 @@
1
+ /**
2
+ * The agent-to-daemon MCP wire: the paths the daemon's HTTP plane serves and the stdio proxy forwards,
3
+ * and the header that says which project a call comes from. Kept apart from constants.ts, which is at
4
+ * its line cap, and re-exported from it so every import stays as it was.
5
+ */
6
+ /** Agent↔server MCP wire paths — served by the daemon HTTP plane, forwarded by the stdio proxy. */
7
+ export declare const MCP_SSE_PATH = "/mcp/sse";
8
+ export declare const MCP_MESSAGE_PATH = "/mcp/message";
9
+ /** Directory the MCP proxy was started in. One daemon serves every project, and this says which. */
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;
@@ -0,0 +1,26 @@
1
+ /**
2
+ * The agent-to-daemon MCP wire: the paths the daemon's HTTP plane serves and the stdio proxy forwards,
3
+ * and the header that says which project a call comes from. Kept apart from constants.ts, which is at
4
+ * its line cap, and re-exported from it so every import stays as it was.
5
+ */
6
+ /** Agent↔server MCP wire paths — served by the daemon HTTP plane, forwarded by the stdio proxy. */
7
+ export const MCP_SSE_PATH = '/mcp/sse';
8
+ export const MCP_MESSAGE_PATH = '/mcp/message';
9
+ /** Directory the MCP proxy was started in. One daemon serves every project, and this says which. */
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 mark a body
5
+ * the SDK skipped ON PURPOSE while body capture was 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
+ /** A stream (`text/event-stream`, ndjson): never read, because reading it would hang the app. */
13
+ readonly STREAMING: "streaming";
14
+ /** A binary or other non-text type, which is not recorded. */
15
+ readonly NOT_TEXT: "not-text";
16
+ /** A text body that could not be read before the read 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 mark a body
5
+ * the SDK skipped ON PURPOSE while body capture was 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
+ /** A stream (`text/event-stream`, ndjson): never read, because reading it would hang the app. */
13
+ STREAMING: 'streaming',
14
+ /** A binary or other non-text type, which is not recorded. */
15
+ NOT_TEXT: 'not-text',
16
+ /** A text body that could not be read before the read deadline, or at all. */
17
+ UNREADABLE: 'unreadable',
18
+ };
@@ -0,0 +1,19 @@
1
+ /**
2
+ * Reticle's own UI in the page, as one selector list both the SDK and the daemon read.
3
+ *
4
+ * The presenter overlay (cursor, HUD, glow), the annotator's marks, the action blocker and the
5
+ * first-run tour. The SDK keeps them out of snapshots and queries; the daemon hides them from every
6
+ * screenshot. They lived in the browser adapter alone, so the daemon's two capture paths each
7
+ * hard-coded their own idea of "our chrome": the driven path hid `[data-reticle-overlay]` only, and
8
+ * the lease path hid nothing, so a lease baseline captured the HUD and its activity log and a HUD
9
+ * change read as an app regression (#1355).
10
+ */
11
+ export declare const RETICLE_OVERLAY_SELECTOR = "[data-reticle-overlay],[data-reticle-cursor],[data-reticle-hud],[data-reticle-glow],[data-reticle-mark],[data-reticle-blocker],[data-reticle-tour]";
12
+ /**
13
+ * A stylesheet that hides Reticle's own UI for one capture, without touching the page under test.
14
+ *
15
+ * `display:none` rather than `visibility`: an expanded HUD at a mobile viewport covers most of the
16
+ * frame, and a hidden-but-laid-out panel still pushes nothing, but a `display:none` one is what a
17
+ * page without Reticle would have looked like.
18
+ */
19
+ export declare const HIDE_RETICLE_CHROME_CSS = "[data-reticle-overlay],[data-reticle-cursor],[data-reticle-hud],[data-reticle-glow],[data-reticle-mark],[data-reticle-blocker],[data-reticle-tour]{display:none !important}";
@@ -0,0 +1,19 @@
1
+ /**
2
+ * Reticle's own UI in the page, as one selector list both the SDK and the daemon read.
3
+ *
4
+ * The presenter overlay (cursor, HUD, glow), the annotator's marks, the action blocker and the
5
+ * first-run tour. The SDK keeps them out of snapshots and queries; the daemon hides them from every
6
+ * screenshot. They lived in the browser adapter alone, so the daemon's two capture paths each
7
+ * hard-coded their own idea of "our chrome": the driven path hid `[data-reticle-overlay]` only, and
8
+ * the lease path hid nothing, so a lease baseline captured the HUD and its activity log and a HUD
9
+ * change read as an app regression (#1355).
10
+ */
11
+ export const RETICLE_OVERLAY_SELECTOR = '[data-reticle-overlay],[data-reticle-cursor],[data-reticle-hud],[data-reticle-glow],[data-reticle-mark],[data-reticle-blocker],[data-reticle-tour]';
12
+ /**
13
+ * A stylesheet that hides Reticle's own UI for one capture, without touching the page under test.
14
+ *
15
+ * `display:none` rather than `visibility`: an expanded HUD at a mobile viewport covers most of the
16
+ * frame, and a hidden-but-laid-out panel still pushes nothing, but a `display:none` one is what a
17
+ * page without Reticle would have looked like.
18
+ */
19
+ export const HIDE_RETICLE_CHROME_CSS = `${RETICLE_OVERLAY_SELECTOR}{display:none !important}`;
@@ -0,0 +1,138 @@
1
+ /**
2
+ * Every environment variable Reticle reads, named once. A misspelled inline env string silently
3
+ * disables the control it gates (e.g. a typo'd `RETICLE_TOKEN` would disable auth) — so the names live
4
+ * here and nowhere else. The values are the literal process.env keys.
5
+ */
6
+ export declare const ReticleEnv: {
7
+ /** "0"/"false"/"off" turns off telemetry and every optional outbound call; DO_NOT_TRACK too. */
8
+ readonly TELEMETRY: "RETICLE_TELEMETRY";
9
+ readonly DO_NOT_TRACK: "DO_NOT_TRACK";
10
+ /** Shared-secret the browser SDK must present in HELLO; absent ⇒ loopback-trust only. */
11
+ readonly TOKEN: "RETICLE_TOKEN";
12
+ /** Bridge bind host. Defaults to loopback; setting anything else is opt-in remote exposure. */
13
+ readonly HOST: "RETICLE_HOST";
14
+ /** Comma-separated WS Origin allow-list for the bridge. */
15
+ readonly ALLOWED_ORIGINS: "RETICLE_ALLOWED_ORIGINS";
16
+ /** Bridge/daemon WS port override. */
17
+ readonly PORT: "RETICLE_PORT";
18
+ /** Daemon state — pidfiles, discovery registry, logs. Defaults to `~/.reticle`. Overridable
19
+ * because a read-only $HOME (sandboxed agent, locked-down Windows profile, container) otherwise
20
+ * makes the daemon unstartable with a raw EACCES naming nothing. Reported by a Windows user. */
21
+ readonly STATE_DIR: "RETICLE_STATE_DIR";
22
+ /** Attach to an already-running browser over CDP instead of launching one. */
23
+ readonly CDP_URL: "RETICLE_CDP_URL";
24
+ /** The Chromium executable to launch, in place of Playwright's own build or an installed Chrome. */
25
+ readonly CHROMIUM_PATH: "RETICLE_CHROMIUM_PATH";
26
+ /** Max simultaneous leased headless contexts in the browser pool (resource cap). */
27
+ readonly MAX_CONTEXTS: "RETICLE_MAX_CONTEXTS";
28
+ /**
29
+ * Inbound events per second before the bridge starts SAMPLING (never disconnecting).
30
+ *
31
+ * Raise it for a legitimately busy app — a streaming dashboard, a live grid — rather than accept
32
+ * partial coverage. Free and local: the daemon runs on the same machine, so a higher ceiling costs
33
+ * nothing to anyone.
34
+ */
35
+ readonly MAX_MESSAGES_PER_SECOND: "RETICLE_MAX_MESSAGES_PER_SECOND";
36
+ /** Bearer token required by the optional `reticle serve --http` verify endpoint. */
37
+ readonly VERIFY_TOKEN: "RETICLE_VERIFY_TOKEN";
38
+ /** Ms of continuous idleness (no agent, no browser session, no lease) before the daemon self-exits;
39
+ * `0` disables. Keeps Reticle from lingering on a user's machine after the editor closes. */
40
+ readonly IDLE_SHUTDOWN: "RETICLE_IDLE_SHUTDOWN_MS";
41
+ /** Idle re-check cadence (default 30s). Overridable so daemon-lifecycle-test can watch a full
42
+ * exit/wake cycle in seconds rather than minutes. */
43
+ readonly IDLE_CHECK: "RETICLE_IDLE_CHECK_MS";
44
+ /**
45
+ * Grace for a daemon with an agent ATTACHED. Longer than the base on purpose: quiet with a client
46
+ * present means a slow install or a thinking human, not an unwanted daemon — a flat 5 minutes was
47
+ * killing live runs mid-install. Derived from the base when unset.
48
+ */
49
+ readonly IDLE_ATTACHED: "RETICLE_IDLE_ATTACHED_MS";
50
+ /**
51
+ * How often the daemon writes `reticle_daemon_alive`, so a GAP in its log is evidence it died.
52
+ *
53
+ * Overridable for the same reason the idle windows are: a spec that has to prove "a killed daemon
54
+ * is distinguishable from a tidy one" cannot wait 30 seconds per beat, and a spec that instead
55
+ * re-implements the cadence is insensitive to the thing it claims to guard.
56
+ */
57
+ readonly HEARTBEAT: "RETICLE_HEARTBEAT_MS";
58
+ /** Directory holding the auto-provisioned pairing token. Defaults to ~/.reticle; relocatable for CI. */
59
+ readonly PAIRING_TOKEN_DIR: "RETICLE_PAIRING_TOKEN_DIR";
60
+ /** Force the durable causal journal off (`0`/`false`/`off`) or on (`1`/`true`/`on`); default on. */
61
+ readonly JOURNAL: "RETICLE_JOURNAL";
62
+ /**
63
+ * Verbose internal flow tracing for people working ON Reticle (`1`/`true`/`on`); default off.
64
+ *
65
+ * Distinct from the journal, which records what the AGENT did to the app. This records what
66
+ * RETICLE did to answer it: one line per internal stage, with its duration and nesting, so a
67
+ * developer can see which code a tool call actually went through and where the time went.
68
+ * Off by default and free when off — a trace on every tool call is a cost on the hot path.
69
+ */
70
+ readonly TRACE: "RETICLE_TRACE";
71
+ /**
72
+ * How many consecutive reconnects the MCP proxy attempts before it stops retrying and goes
73
+ * dormant. Overridable for the same reason the idle windows are: the real budget takes MINUTES to
74
+ * exhaust, so the one spec that proves the proxy SURVIVES exhaustion could not run at all without
75
+ * shortening it. A budget nobody can reach in a test is a budget nobody tests.
76
+ */
77
+ readonly RECONNECT_ATTEMPTS: "RETICLE_RECONNECT_ATTEMPTS";
78
+ /** Quiet window before an abandoned MCP stdio proxy exits; `0` disables the watcher. */
79
+ readonly MCP_PROXY_IDLE: "RETICLE_MCP_PROXY_IDLE_MS";
80
+ /**
81
+ * API key for the harness — the model that drives the app when no coding agent is in the loop.
82
+ *
83
+ * The standard Anthropic name, on purpose: a machine that can already run a coding agent can
84
+ * already run the harness, with nothing to configure. Absent ⇒ the harness is simply unavailable
85
+ * and every other part of Reticle is unaffected.
86
+ */
87
+ readonly HARNESS_KEY: "ANTHROPIC_API_KEY";
88
+ /** Model the harness drives with. Defaults to a small one — see `DEFAULT_HARNESS_MODEL`. */
89
+ readonly HARNESS_MODEL: "RETICLE_HARNESS_MODEL";
90
+ /** Base URL for the harness's model API, for a proxy or a gateway. */
91
+ readonly HARNESS_BASE_URL: "RETICLE_HARNESS_BASE_URL";
92
+ /** Hard ceiling on harness model turns in one drive. Bounds cost, not value. */
93
+ readonly HARNESS_MAX_STEPS: "RETICLE_HARNESS_MAX_STEPS";
94
+ /** The free drive `reticle try` was granted, sent on every Harness call it bills. */
95
+ readonly DRIVE_ID: "RETICLE_DRIVE_ID";
96
+ /**
97
+ * Which model backs the harness driver: `anthropic` (the default) or `jev`.
98
+ *
99
+ * Two drivers exist because the driver's job turns out not to need a text generator. It picks the
100
+ * next action and says what it expects; the verdict is decided afterwards by the engine, with no
101
+ * model anywhere near it. A System One model answers typed questions against a state, which is
102
+ * exactly that job and none of the rest, so it can drive without being able to generate a
103
+ * sentence. Unset keeps the existing behaviour for everybody who has not asked for this.
104
+ */
105
+ readonly HARNESS_DRIVER: "RETICLE_HARNESS_DRIVER";
106
+ /**
107
+ * A direct Jev key, for this repo's own benchmarks and for anyone holding a TypeSafe account.
108
+ *
109
+ * Users are not expected to have one. The ordinary path is the key they already minted on the
110
+ * platform (`RETICLE_API_KEY`), which reaches Jev through the proxy at `RETICLE_CLOUD_URL` —
111
+ * this variable is the escape hatch that skips it, and it takes precedence when both are set so
112
+ * that a developer debugging the upstream is never silently talking to the proxy instead.
113
+ */
114
+ readonly HARNESS_JEV_KEY: "JEV_API_KEY";
115
+ /** Base URL for the Jev API, for a proxy or a gateway. Defaults to TypeSafe's own endpoint. */
116
+ readonly HARNESS_JEV_URL: "RETICLE_HARNESS_JEV_URL";
117
+ /** A direct OpenAI key. As with Jev, the ordinary path is the platform key and its proxy. */
118
+ readonly HARNESS_OPENAI_KEY: "OPENAI_API_KEY";
119
+ /** Model the OpenAI driver uses. Defaults to a small one — see `DEFAULT_OPENAI_MODEL`. */
120
+ readonly HARNESS_OPENAI_MODEL: "RETICLE_HARNESS_OPENAI_MODEL";
121
+ /**
122
+ * The API key minted on the platform, and the host it belongs to.
123
+ *
124
+ * Read through `apiKeyFrom()`, never directly — see the note on that function for why there are
125
+ * two names for one key and why neither may be dropped.
126
+ */
127
+ readonly API_KEY: "RETICLE_API_KEY";
128
+ /** The name this key had until 2026-09. Still honoured; see `apiKeyFrom()`. */
129
+ readonly CLOUD_KEY: "RETICLE_CLOUD_KEY";
130
+ /** The platform host. Read through `cloudUrlFrom()`, which also accepts `URL`. */
131
+ readonly CLOUD_URL: "RETICLE_CLOUD_URL";
132
+ /** The short name for `CLOUD_URL`, which people type first. `CLOUD_URL` wins when both are set. */
133
+ readonly URL: "RETICLE_URL";
134
+ /** "0"/"false"/"off" stops `reticle hook prompt` writing prompts, on this whole machine. */
135
+ readonly PROMPT_CAPTURE: "RETICLE_PROMPT_CAPTURE";
136
+ /** "0"/"false"/"off" stops the daemon's background sync, on this whole machine. */
137
+ readonly BACKGROUND_SYNC: "RETICLE_BACKGROUND_SYNC";
138
+ };
@@ -0,0 +1,138 @@
1
+ /**
2
+ * Every environment variable Reticle reads, named once. A misspelled inline env string silently
3
+ * disables the control it gates (e.g. a typo'd `RETICLE_TOKEN` would disable auth) — so the names live
4
+ * here and nowhere else. The values are the literal process.env keys.
5
+ */
6
+ export const ReticleEnv = {
7
+ /** "0"/"false"/"off" turns off telemetry and every optional outbound call; DO_NOT_TRACK too. */
8
+ TELEMETRY: 'RETICLE_TELEMETRY',
9
+ DO_NOT_TRACK: 'DO_NOT_TRACK',
10
+ /** Shared-secret the browser SDK must present in HELLO; absent ⇒ loopback-trust only. */
11
+ TOKEN: 'RETICLE_TOKEN',
12
+ /** Bridge bind host. Defaults to loopback; setting anything else is opt-in remote exposure. */
13
+ HOST: 'RETICLE_HOST',
14
+ /** Comma-separated WS Origin allow-list for the bridge. */
15
+ ALLOWED_ORIGINS: 'RETICLE_ALLOWED_ORIGINS',
16
+ /** Bridge/daemon WS port override. */
17
+ PORT: 'RETICLE_PORT',
18
+ /** Daemon state — pidfiles, discovery registry, logs. Defaults to `~/.reticle`. Overridable
19
+ * because a read-only $HOME (sandboxed agent, locked-down Windows profile, container) otherwise
20
+ * makes the daemon unstartable with a raw EACCES naming nothing. Reported by a Windows user. */
21
+ STATE_DIR: 'RETICLE_STATE_DIR',
22
+ /** Attach to an already-running browser over CDP instead of launching one. */
23
+ CDP_URL: 'RETICLE_CDP_URL',
24
+ /** The Chromium executable to launch, in place of Playwright's own build or an installed Chrome. */
25
+ CHROMIUM_PATH: 'RETICLE_CHROMIUM_PATH',
26
+ /** Max simultaneous leased headless contexts in the browser pool (resource cap). */
27
+ MAX_CONTEXTS: 'RETICLE_MAX_CONTEXTS',
28
+ /**
29
+ * Inbound events per second before the bridge starts SAMPLING (never disconnecting).
30
+ *
31
+ * Raise it for a legitimately busy app — a streaming dashboard, a live grid — rather than accept
32
+ * partial coverage. Free and local: the daemon runs on the same machine, so a higher ceiling costs
33
+ * nothing to anyone.
34
+ */
35
+ MAX_MESSAGES_PER_SECOND: 'RETICLE_MAX_MESSAGES_PER_SECOND',
36
+ /** Bearer token required by the optional `reticle serve --http` verify endpoint. */
37
+ VERIFY_TOKEN: 'RETICLE_VERIFY_TOKEN',
38
+ /** Ms of continuous idleness (no agent, no browser session, no lease) before the daemon self-exits;
39
+ * `0` disables. Keeps Reticle from lingering on a user's machine after the editor closes. */
40
+ IDLE_SHUTDOWN: 'RETICLE_IDLE_SHUTDOWN_MS',
41
+ /** Idle re-check cadence (default 30s). Overridable so daemon-lifecycle-test can watch a full
42
+ * exit/wake cycle in seconds rather than minutes. */
43
+ IDLE_CHECK: 'RETICLE_IDLE_CHECK_MS',
44
+ /**
45
+ * Grace for a daemon with an agent ATTACHED. Longer than the base on purpose: quiet with a client
46
+ * present means a slow install or a thinking human, not an unwanted daemon — a flat 5 minutes was
47
+ * killing live runs mid-install. Derived from the base when unset.
48
+ */
49
+ IDLE_ATTACHED: 'RETICLE_IDLE_ATTACHED_MS',
50
+ /**
51
+ * How often the daemon writes `reticle_daemon_alive`, so a GAP in its log is evidence it died.
52
+ *
53
+ * Overridable for the same reason the idle windows are: a spec that has to prove "a killed daemon
54
+ * is distinguishable from a tidy one" cannot wait 30 seconds per beat, and a spec that instead
55
+ * re-implements the cadence is insensitive to the thing it claims to guard.
56
+ */
57
+ HEARTBEAT: 'RETICLE_HEARTBEAT_MS',
58
+ /** Directory holding the auto-provisioned pairing token. Defaults to ~/.reticle; relocatable for CI. */
59
+ PAIRING_TOKEN_DIR: 'RETICLE_PAIRING_TOKEN_DIR',
60
+ /** Force the durable causal journal off (`0`/`false`/`off`) or on (`1`/`true`/`on`); default on. */
61
+ JOURNAL: 'RETICLE_JOURNAL',
62
+ /**
63
+ * Verbose internal flow tracing for people working ON Reticle (`1`/`true`/`on`); default off.
64
+ *
65
+ * Distinct from the journal, which records what the AGENT did to the app. This records what
66
+ * RETICLE did to answer it: one line per internal stage, with its duration and nesting, so a
67
+ * developer can see which code a tool call actually went through and where the time went.
68
+ * Off by default and free when off — a trace on every tool call is a cost on the hot path.
69
+ */
70
+ TRACE: 'RETICLE_TRACE',
71
+ /**
72
+ * How many consecutive reconnects the MCP proxy attempts before it stops retrying and goes
73
+ * dormant. Overridable for the same reason the idle windows are: the real budget takes MINUTES to
74
+ * exhaust, so the one spec that proves the proxy SURVIVES exhaustion could not run at all without
75
+ * shortening it. A budget nobody can reach in a test is a budget nobody tests.
76
+ */
77
+ RECONNECT_ATTEMPTS: 'RETICLE_RECONNECT_ATTEMPTS',
78
+ /** Quiet window before an abandoned MCP stdio proxy exits; `0` disables the watcher. */
79
+ MCP_PROXY_IDLE: 'RETICLE_MCP_PROXY_IDLE_MS',
80
+ /**
81
+ * API key for the harness — the model that drives the app when no coding agent is in the loop.
82
+ *
83
+ * The standard Anthropic name, on purpose: a machine that can already run a coding agent can
84
+ * already run the harness, with nothing to configure. Absent ⇒ the harness is simply unavailable
85
+ * and every other part of Reticle is unaffected.
86
+ */
87
+ HARNESS_KEY: 'ANTHROPIC_API_KEY',
88
+ /** Model the harness drives with. Defaults to a small one — see `DEFAULT_HARNESS_MODEL`. */
89
+ HARNESS_MODEL: 'RETICLE_HARNESS_MODEL',
90
+ /** Base URL for the harness's model API, for a proxy or a gateway. */
91
+ HARNESS_BASE_URL: 'RETICLE_HARNESS_BASE_URL',
92
+ /** Hard ceiling on harness model turns in one drive. Bounds cost, not value. */
93
+ HARNESS_MAX_STEPS: 'RETICLE_HARNESS_MAX_STEPS',
94
+ /** The free drive `reticle try` was granted, sent on every Harness call it bills. */
95
+ DRIVE_ID: 'RETICLE_DRIVE_ID',
96
+ /**
97
+ * Which model backs the harness driver: `anthropic` (the default) or `jev`.
98
+ *
99
+ * Two drivers exist because the driver's job turns out not to need a text generator. It picks the
100
+ * next action and says what it expects; the verdict is decided afterwards by the engine, with no
101
+ * model anywhere near it. A System One model answers typed questions against a state, which is
102
+ * exactly that job and none of the rest, so it can drive without being able to generate a
103
+ * sentence. Unset keeps the existing behaviour for everybody who has not asked for this.
104
+ */
105
+ HARNESS_DRIVER: 'RETICLE_HARNESS_DRIVER',
106
+ /**
107
+ * A direct Jev key, for this repo's own benchmarks and for anyone holding a TypeSafe account.
108
+ *
109
+ * Users are not expected to have one. The ordinary path is the key they already minted on the
110
+ * platform (`RETICLE_API_KEY`), which reaches Jev through the proxy at `RETICLE_CLOUD_URL` —
111
+ * this variable is the escape hatch that skips it, and it takes precedence when both are set so
112
+ * that a developer debugging the upstream is never silently talking to the proxy instead.
113
+ */
114
+ HARNESS_JEV_KEY: 'JEV_API_KEY',
115
+ /** Base URL for the Jev API, for a proxy or a gateway. Defaults to TypeSafe's own endpoint. */
116
+ HARNESS_JEV_URL: 'RETICLE_HARNESS_JEV_URL',
117
+ /** A direct OpenAI key. As with Jev, the ordinary path is the platform key and its proxy. */
118
+ HARNESS_OPENAI_KEY: 'OPENAI_API_KEY',
119
+ /** Model the OpenAI driver uses. Defaults to a small one — see `DEFAULT_OPENAI_MODEL`. */
120
+ HARNESS_OPENAI_MODEL: 'RETICLE_HARNESS_OPENAI_MODEL',
121
+ /**
122
+ * The API key minted on the platform, and the host it belongs to.
123
+ *
124
+ * Read through `apiKeyFrom()`, never directly — see the note on that function for why there are
125
+ * two names for one key and why neither may be dropped.
126
+ */
127
+ API_KEY: 'RETICLE_API_KEY',
128
+ /** The name this key had until 2026-09. Still honoured; see `apiKeyFrom()`. */
129
+ CLOUD_KEY: 'RETICLE_CLOUD_KEY',
130
+ /** The platform host. Read through `cloudUrlFrom()`, which also accepts `URL`. */
131
+ CLOUD_URL: 'RETICLE_CLOUD_URL',
132
+ /** The short name for `CLOUD_URL`, which people type first. `CLOUD_URL` wins when both are set. */
133
+ URL: 'RETICLE_URL',
134
+ /** "0"/"false"/"off" stops `reticle hook prompt` writing prompts, on this whole machine. */
135
+ PROMPT_CAPTURE: 'RETICLE_PROMPT_CAPTURE',
136
+ /** "0"/"false"/"off" stops the daemon's background sync, on this whole machine. */
137
+ BACKGROUND_SYNC: 'RETICLE_BACKGROUND_SYNC',
138
+ };
@@ -24,6 +24,11 @@ export declare const HumanControlKind: {
24
24
  readonly PAUSE: "pause";
25
25
  readonly RESUME: "resume";
26
26
  readonly END: "end";
27
+ /**
28
+ * A note the human typed for the agent. Only an older SDK sends it: the current HUD has no note
29
+ * box. Protocol 1 still accepts that SDK, so keep this kind. Without it, its notes are dropped
30
+ * with no error.
31
+ */
27
32
  readonly MESSAGE: "message";
28
33
  /** Human clicked ▶ on a saved flow in the panel — replay it (no agent). `text` carries the name. */
29
34
  readonly REPLAY: "replay";
@@ -38,9 +43,9 @@ export declare const HumanControlKind: {
38
43
  /**
39
44
  * Human pressed Sign in in the panel. Carries nothing.
40
45
  *
41
- * A page cannot write `~/.reticle`, so the panel used to copy `reticle login` and stop there: a
46
+ * A page cannot write `~/.reticle`, so the panel used to copy `reticle connect` and stop there: a
42
47
  * dead end for anybody who does not live in a terminal. The daemon owns the credential, so it
43
- * starts the same browser approval flow `reticle login` does and the panel repaints when it lands.
48
+ * starts the same browser approval flow `reticle connect` does and the panel repaints when it lands.
44
49
  */
45
50
  readonly SIGNIN: "signin";
46
51
  /**
@@ -57,6 +62,19 @@ export declare const HumanControlKind: {
57
62
  * and an impatient finger both need.
58
63
  */
59
64
  readonly HARNESS: "harness";
65
+ /**
66
+ * Human pressed Run Harness in the panel. `text` carries the persona, or nothing. The daemon asks
67
+ * the platform for the drive's grant and starts it exactly as an agent's explore would.
68
+ */
69
+ readonly HARNESS_RUN: "harness-run";
70
+ /** Human pressed Stop on the drive running in this tab. Carries nothing. */
71
+ readonly HARNESS_STOP: "harness-stop";
72
+ /**
73
+ * Human pressed Link this project on the Harness page. Carries nothing: the daemon links the
74
+ * project of the tab that asked, as `reticle connect` would from that folder, and every panel
75
+ * repaints when the link file lands.
76
+ */
77
+ readonly HARNESS_LINK: "harness-link";
60
78
  };
61
79
  export type HumanControlKind = (typeof HumanControlKind)[keyof typeof HumanControlKind];
62
80
  /**
@@ -130,6 +148,12 @@ export declare const SESSION_LIFECYCLE: {
130
148
  readonly DAEMON_IDLE_SHUTDOWN_MS: 300000;
131
149
  /** How often the daemon checks whether it has gone idle. Unref'd, so it never keeps the process up. */
132
150
  readonly DAEMON_IDLE_CHECK_MS: 30000;
151
+ /**
152
+ * An agent that attached this recently still counts as attached for the idle check. A client that
153
+ * starts a new MCP proxy for each turn (Codex) detaches between turns, and a used daemon must not
154
+ * exit and cold-start again for each turn.
155
+ */
156
+ readonly DAEMON_AGENT_RECENT_MS: 1800000;
133
157
  };
134
158
  /**
135
159
  * Coding-agent session hygiene thresholds. Coding agents (Claude Code, Codex, Cursor) often
@@ -25,6 +25,11 @@ export const HumanControlKind = {
25
25
  PAUSE: 'pause',
26
26
  RESUME: 'resume',
27
27
  END: 'end',
28
+ /**
29
+ * A note the human typed for the agent. Only an older SDK sends it: the current HUD has no note
30
+ * box. Protocol 1 still accepts that SDK, so keep this kind. Without it, its notes are dropped
31
+ * with no error.
32
+ */
28
33
  MESSAGE: 'message',
29
34
  /** Human clicked ▶ on a saved flow in the panel — replay it (no agent). `text` carries the name. */
30
35
  REPLAY: 'replay',
@@ -39,9 +44,9 @@ export const HumanControlKind = {
39
44
  /**
40
45
  * Human pressed Sign in in the panel. Carries nothing.
41
46
  *
42
- * A page cannot write `~/.reticle`, so the panel used to copy `reticle login` and stop there: a
47
+ * A page cannot write `~/.reticle`, so the panel used to copy `reticle connect` and stop there: a
43
48
  * dead end for anybody who does not live in a terminal. The daemon owns the credential, so it
44
- * starts the same browser approval flow `reticle login` does and the panel repaints when it lands.
49
+ * starts the same browser approval flow `reticle connect` does and the panel repaints when it lands.
45
50
  */
46
51
  SIGNIN: 'signin',
47
52
  /**
@@ -58,6 +63,19 @@ export const HumanControlKind = {
58
63
  * and an impatient finger both need.
59
64
  */
60
65
  HARNESS: 'harness',
66
+ /**
67
+ * Human pressed Run Harness in the panel. `text` carries the persona, or nothing. The daemon asks
68
+ * the platform for the drive's grant and starts it exactly as an agent's explore would.
69
+ */
70
+ HARNESS_RUN: 'harness-run',
71
+ /** Human pressed Stop on the drive running in this tab. Carries nothing. */
72
+ HARNESS_STOP: 'harness-stop',
73
+ /**
74
+ * Human pressed Link this project on the Harness page. Carries nothing: the daemon links the
75
+ * project of the tab that asked, as `reticle connect` would from that folder, and every panel
76
+ * repaints when the link file lands.
77
+ */
78
+ HARNESS_LINK: 'harness-link',
61
79
  };
62
80
  /**
63
81
  * Human review marks: the durability tier of the anchor that pins a mark to an element. Mirrors the
@@ -128,6 +146,12 @@ export const SESSION_LIFECYCLE = {
128
146
  DAEMON_IDLE_SHUTDOWN_MS: 300_000,
129
147
  /** How often the daemon checks whether it has gone idle. Unref'd, so it never keeps the process up. */
130
148
  DAEMON_IDLE_CHECK_MS: 30_000,
149
+ /**
150
+ * An agent that attached this recently still counts as attached for the idle check. A client that
151
+ * starts a new MCP proxy for each turn (Codex) detaches between turns, and a used daemon must not
152
+ * exit and cold-start again for each turn.
153
+ */
154
+ DAEMON_AGENT_RECENT_MS: 1_800_000,
131
155
  };
132
156
  /**
133
157
  * Coding-agent session hygiene thresholds. Coding agents (Claude Code, Codex, Cursor) often
@@ -38,6 +38,14 @@ export declare const RETICLE_CAPTURE_FILE_PREFIX = "reticle-capture-";
38
38
  * gets screenshots by adding ONE Rust command and nothing at all on the JavaScript side.
39
39
  */
40
40
  export declare const RETICLE_TAURI_CAPTURE_COMMAND = "reticle_capture";
41
+ /**
42
+ * The words `reticle-tauri` refuses a capture with in a release build without its `in-release`
43
+ * feature (`INERT_IN_RELEASE` in the crate's lib.rs). The daemon reads them to say THAT, not the web
44
+ * answer: an agent told "start with `reticle drive <url>`" about a desktop app had nothing to act on.
45
+ */
46
+ export declare const RETICLE_TAURI_INERT_MARKER = "inert in a release build";
47
+ /** What the agent is told when the Tauri build it drives has Reticle's capture compiled out. */
48
+ export declare const TAURI_INERT_RECOMMENDATION: string;
41
49
  /**
42
50
  * What a shell answers when asked for `fullPage` it cannot produce.
43
51
  *
@@ -39,6 +39,17 @@ export const RETICLE_CAPTURE_FILE_PREFIX = 'reticle-capture-';
39
39
  * gets screenshots by adding ONE Rust command and nothing at all on the JavaScript side.
40
40
  */
41
41
  export const RETICLE_TAURI_CAPTURE_COMMAND = 'reticle_capture';
42
+ /**
43
+ * The words `reticle-tauri` refuses a capture with in a release build without its `in-release`
44
+ * feature (`INERT_IN_RELEASE` in the crate's lib.rs). The daemon reads them to say THAT, not the web
45
+ * answer: an agent told "start with `reticle drive <url>`" about a desktop app had nothing to act on.
46
+ */
47
+ export const RETICLE_TAURI_INERT_MARKER = 'inert in a release build';
48
+ /** What the agent is told when the Tauri build it drives has Reticle's capture compiled out. */
49
+ export const TAURI_INERT_RECOMMENDATION = 'the Reticle Tauri capture is off in this release build: reticle-tauri does nothing in a release ' +
50
+ 'build unless its `in-release` feature is on. Drive the dev build (`tauri dev`), or for a release ' +
51
+ 'build you test with Reticle set `reticle-tauri = { version = "…", features = ["in-release"] }` in ' +
52
+ 'src-tauri/Cargo.toml and rebuild';
42
53
  /**
43
54
  * What a shell answers when asked for `fullPage` it cannot produce.
44
55
  *