@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
@@ -3,7 +3,7 @@
3
3
  * as its own subject, and re-exported from there, so every `@reticlehq/core/telemetry` import still
4
4
  * reaches it.
5
5
  */
6
- import { z } from 'zod';
6
+ import * as z from 'zod';
7
7
  /**
8
8
  * How Reticle came to find a defect. Four routes, in descending order of "a human would have missed
9
9
  * this": a contradiction is invisible to someone watching the screen, a crawl finding required no
@@ -61,7 +61,7 @@ export type BugAttribution = (typeof BugAttribution)[keyof typeof BugAttribution
61
61
  * user's app — THAT a class of defect was found, never WHAT it was in.
62
62
  */
63
63
  export declare const BugFoundSchema: z.ZodObject<{
64
- source: z.ZodNativeEnum<{
64
+ source: z.ZodEnum<{
65
65
  /** Channels disagreed — the false green. A passing screen sitting on a failed write. */
66
66
  readonly CONTRADICTION: "contradiction";
67
67
  /** `reticle_crawl` found it autonomously, with nobody writing a test. */
@@ -71,47 +71,11 @@ export declare const BugFoundSchema: z.ZodObject<{
71
71
  /** An assertion the agent declared did not hold. */
72
72
  readonly ASSERTION: "assertion";
73
73
  }>;
74
- /** The classified kind from Reticle's own findings vocabulary. */
75
74
  kind: z.ZodString;
76
- /**
77
- * True when the defect PRESENTED AS SUCCESS — the screen advanced, the assertion passed, the click
78
- * looked fine — while another channel showed it had not.
79
- *
80
- * Defined by the presentation rather than by "an assertion passed", because the same defect arrives
81
- * both ways: through `reticle_assert` there IS a passing assertion to contradict, and through
82
- * `reticle_crawl` there is no assertion at all and the UI simply moved on over a failed write. Both
83
- * are the thing a human watching the screen cannot see, and that is what the flag has to mean if
84
- * the number is going to be published.
85
- *
86
- * The subset worth naming separately, because it is the only category Reticle can claim as uniquely
87
- * its own: every other kind of bug is findable by a careful human or an ordinary test.
88
- */
89
75
  falseGreen: z.ZodBoolean;
90
- /** Which tool surfaced it. */
91
76
  tool: z.ZodOptional<z.ZodString>;
92
- /**
93
- * TRUE when this KIND was already reported in this session — i.e. this is another INSTANCE of a
94
- * defect already counted, not another defect.
95
- *
96
- * Both numbers are claims, and they are different ones. "Reticle found N defects" is the headline;
97
- * "users hit them M times" is the frequency that says which ones actually cost anybody anything.
98
- * Without this flag the event stream answers only the second while looking like it answers the
99
- * first, so any distinct-defect count read off it is silently inflated — the exact way a published
100
- * number goes wrong. Count `repeat: false` for distinct, count everything for instances.
101
- *
102
- * Scoped to the SESSION, because that is the only identity available: the payload deliberately
103
- * carries no selector, URL or app detail, so the same defect in two sessions cannot be recognised
104
- * as one — and must not be, since that would need data this event refuses to collect.
105
- */
106
77
  repeat: z.ZodBoolean;
107
- /**
108
- * Whose fault it was, ALWAYS present — `unclassified` when the evidence cannot say, never absent.
109
- *
110
- * Absence and "the evidence could not say" are different facts, and only one of them is a
111
- * measurement. Count `attribution: 'app'` for defects found in anybody's product; see
112
- * `BugAttribution` for why `app` needs positive evidence.
113
- */
114
- attribution: z.ZodNativeEnum<{
78
+ attribution: z.ZodEnum<{
115
79
  /** A defect in the app under test — the only bucket that belongs in a published defect count. */
116
80
  readonly APP: "app";
117
81
  /** The agent's own call was wrong: a path, store or target that never existed. Teach the agent. */
@@ -128,42 +92,7 @@ export declare const BugFoundSchema: z.ZodObject<{
128
92
  */
129
93
  readonly UNCLASSIFIED: "unclassified";
130
94
  }>;
131
- /**
132
- * A stable hash identifying THIS defect across sessions — same kind at the same route = same
133
- * fingerprint, regardless of when or where it was found.
134
- *
135
- * The inputs (route, selector) never travel raw — only the 8-char hex hash does, following the
136
- * same privacy pattern as `projectId`. The analytics side groups on it to answer "was this bug
137
- * fixed?" (the fingerprint stops appearing) and to deduplicate the same defect found by parallel
138
- * agents in one run.
139
- *
140
- * OPTIONAL because old senders and the `reticle verify` CLI path do not yet compute it. Absent
141
- * means "not fingerprinted", never "a different defect from one that has a fingerprint".
142
- */
143
95
  fingerprint: z.ZodOptional<z.ZodString>;
144
- /**
145
- * Which hit of this `fingerprint` in the session, from 1. Two hits of one defect used to be
146
- * byte-identical rows, so a duplicated delivery and a real second hit could not be told apart.
147
- * `occurrence: 1` is the distinct defect within a session. Absent on older senders.
148
- */
149
96
  occurrence: z.ZodOptional<z.ZodNumber>;
150
- }, "strip", z.ZodTypeAny, {
151
- kind: string;
152
- source: "replay" | "contradiction" | "crawl" | "assertion";
153
- attribution: "reticle" | "request" | "app" | "unclassified";
154
- falseGreen: boolean;
155
- repeat: boolean;
156
- tool?: string | undefined;
157
- fingerprint?: string | undefined;
158
- occurrence?: number | undefined;
159
- }, {
160
- kind: string;
161
- source: "replay" | "contradiction" | "crawl" | "assertion";
162
- attribution: "reticle" | "request" | "app" | "unclassified";
163
- falseGreen: boolean;
164
- repeat: boolean;
165
- tool?: string | undefined;
166
- fingerprint?: string | undefined;
167
- occurrence?: number | undefined;
168
- }>;
97
+ }, z.core.$strip>;
169
98
  export type BugFound = z.infer<typeof BugFoundSchema>;
@@ -3,7 +3,7 @@
3
3
  * as its own subject, and re-exported from there, so every `@reticlehq/core/telemetry` import still
4
4
  * reaches it.
5
5
  */
6
- import { z } from 'zod';
6
+ import * as z from 'zod';
7
7
  /**
8
8
  * How Reticle came to find a defect. Four routes, in descending order of "a human would have missed
9
9
  * this": a contradiction is invisible to someone watching the screen, a crawl finding required no
@@ -3,7 +3,7 @@
3
3
  *
4
4
  * The event kinds, their zod schemas, and the two payloads a PERSON writes (feedback + identity).
5
5
  * Separate from the root entry point because this is a different wire from the browser↔bridge one:
6
- * it goes to the capture endpoint, not to the agent. See docs/telemetry-contract.md.
6
+ * it goes to the capture endpoint, not to the agent. See contributing/telemetry/contract.md.
7
7
  *
8
8
  * Every name below is ALSO exported from the root entry point, which stays as it was.
9
9
  */
@@ -3,7 +3,7 @@
3
3
  *
4
4
  * The event kinds, their zod schemas, and the two payloads a PERSON writes (feedback + identity).
5
5
  * Separate from the root entry point because this is a different wire from the browser↔bridge one:
6
- * it goes to the capture endpoint, not to the agent. See docs/telemetry-contract.md.
6
+ * it goes to the capture endpoint, not to the agent. See contributing/telemetry/contract.md.
7
7
  *
8
8
  * Every name below is ALSO exported from the root entry point, which stays as it was.
9
9
  */
@@ -10,7 +10,7 @@
10
10
  * `reticle_feedback` or a human ran `reticle feedback`; an `Identity` exists because a human ran
11
11
  * `reticle identify`. There is no code path to either that a person did not start.
12
12
  */
13
- import { z } from 'zod';
13
+ import * as z from 'zod';
14
14
  /** Who authored the feedback. Agents report failures; humans also rate the experience. */
15
15
  export declare const FeedbackSource: {
16
16
  readonly AGENT: "agent";
@@ -64,6 +64,8 @@ export declare const FeedbackKind: {
64
64
  readonly EXPERIENCE: "experience";
65
65
  };
66
66
  export type FeedbackKind = (typeof FeedbackKind)[keyof typeof FeedbackKind];
67
+ /** Every feedback kind as one `<a|b>` choice for help text. Derived, so no kind is left out. */
68
+ export declare const FEEDBACK_KIND_CHOICES: string;
67
69
  /** Which shell the verified app runs in. Mirrors the SDK's own `PAGE_HEALTH` runtime report. */
68
70
  export declare const AppRuntime: {
69
71
  readonly WEB: "web";
@@ -118,6 +120,10 @@ export declare const FEEDBACK_RATING_MIN = 1;
118
120
  export declare const FEEDBACK_RATING_MAX = 5;
119
121
  /** Cap for the structured why/impact/workaround fields — prose, but bounded prose. */
120
122
  export declare const FEEDBACK_FIELD_MAX = 1000;
123
+ /** The longest reply address a feedback report takes: the longest address mail can carry. */
124
+ export declare const FEEDBACK_CONTACT_MAX = 254;
125
+ /** True for one plain reply address that a feedback report may carry. */
126
+ export declare function isFeedbackContact(value: string): boolean;
121
127
  /**
122
128
  * The feedback body. Everything here is either author-written (`text`, `trace`, `rating`) or
123
129
  * environment context detected locally (`stack`, `runtime`, `engine`, …) — the context is what turns
@@ -128,11 +134,11 @@ export declare const FEEDBACK_FIELD_MAX = 1000;
128
134
  * is scraped — someone typed or wrote them), capped, and redacted client-side before the wire.
129
135
  */
130
136
  export declare const FeedbackSchema: z.ZodObject<{
131
- source: z.ZodNativeEnum<{
137
+ source: z.ZodEnum<{
132
138
  readonly AGENT: "agent";
133
139
  readonly HUMAN: "human";
134
140
  }>;
135
- kind: z.ZodNativeEnum<{
141
+ kind: z.ZodEnum<{
136
142
  /** A tool misbehaved: wrong result, crash, or a contract it did not honor. */
137
143
  readonly BUG: "bug";
138
144
  /** Reticle could not observe something the agent needed — a blind spot, not a defect. */
@@ -172,109 +178,37 @@ export declare const FeedbackSchema: z.ZodObject<{
172
178
  */
173
179
  readonly EXPERIENCE: "experience";
174
180
  }>;
175
- /** The author's account. For an agent: what failed and why (its RCA). For a human: their words. */
176
181
  text: z.ZodString;
177
- /** Agent-side only: the call/response trail that led to the failure, so the RCA is reproducible. */
178
182
  trace: z.ZodOptional<z.ZodString>;
179
- /** Human-side only: 1–5. The single number that trends without reading a word. */
180
183
  rating: z.ZodOptional<z.ZodNumber>;
181
- /**
182
- * WHY it is wanted — the goal behind the request, not the request itself.
183
- *
184
- * The most common way a feature request wastes everyone's time is arriving as a solution with the
185
- * problem stripped off. "Add a `waitForIdle` tool" is a guess about implementation; "I need to know
186
- * the page stopped changing before I assert" is a requirement, and it may already have an answer.
187
- */
188
184
  need: z.ZodOptional<z.ZodString>;
189
- /** What measurably gets better — fewer calls, fewer retries, a verdict that stops being ambiguous. */
190
185
  impact: z.ZodOptional<z.ZodString>;
191
- /**
192
- * How the author works around it TODAY. Usually the most valuable field in the whole report.
193
- *
194
- * A workaround is evidence rather than opinion: it shows what the agent actually did, proves the
195
- * need is real enough to have cost it something, and frequently reveals that the missing feature is
196
- * a worse fix than removing whatever forced the workaround.
197
- */
198
186
  currentApproach: z.ZodOptional<z.ZodString>;
199
- /**
200
- * The MODEL the agent is running, self-reported.
201
- *
202
- * Not obtainable any other way: MCP's `clientInfo` carries a client name and version and has no
203
- * concept of a model, so the transport cannot say. The agent knows, and this report is already
204
- * something the agent authored — so asking is both the only mechanism and a reliable one.
205
- *
206
- * It matters more than it looks: a limitation that blocks a smaller model may be a docs problem
207
- * rather than a missing feature, and a request from a frontier model is evidence the surface itself
208
- * is short. Without it, every request looks the same.
209
- */
210
187
  model: z.ZodOptional<z.ZodString>;
211
- /** The MCP client's own version, alongside its name — so "cursor 0.42 specifically" is answerable. */
212
188
  clientVersion: z.ZodOptional<z.ZodString>;
213
- /** The framework detected in the project (`next`, `vite`, `sveltekit`, `vue`, `astro`, …). */
214
189
  stack: z.ZodOptional<z.ZodString>;
215
- /**
216
- * The MAJOR version of that framework ("15", "19"). Major only, deliberately: it is what actually
217
- * segments a bug ("breaks on React 19" is a work item; "breaks on 19.0.0-rc.1-canary" is noise),
218
- * and a full version string is high-cardinality enough to start narrowing down who sent it.
219
- */
220
190
  stackMajor: z.ZodOptional<z.ZodNumber>;
221
- runtime: z.ZodOptional<z.ZodNativeEnum<{
191
+ runtime: z.ZodOptional<z.ZodEnum<{
222
192
  readonly WEB: "web";
223
193
  readonly ELECTRON: "electron";
224
194
  readonly TAURI: "tauri";
225
195
  }>>;
226
- engine: z.ZodOptional<z.ZodNativeEnum<{
196
+ engine: z.ZodOptional<z.ZodEnum<{
227
197
  readonly BLINK: "blink";
228
198
  readonly GECKO: "gecko";
229
199
  readonly WEBKIT: "webkit";
230
200
  }>>;
231
- driver: z.ZodOptional<z.ZodNativeEnum<{
201
+ driver: z.ZodOptional<z.ZodEnum<{
232
202
  readonly CDP: "cdp";
233
203
  readonly SDK: "sdk";
234
204
  }>>;
235
- /** The MCP client on the other end (`claude-code`, `cursor`, …) — self-reported at initialize. */
236
205
  client: z.ZodOptional<z.ZodString>;
237
- mcpScope: z.ZodOptional<z.ZodNativeEnum<{
206
+ mcpScope: z.ZodOptional<z.ZodEnum<{
238
207
  readonly USER: "user";
239
208
  readonly PROJECT: "project";
240
209
  }>>;
241
- }, "strip", z.ZodTypeAny, {
242
- text: string;
243
- kind: "bug" | "gap" | "ambiguity" | "feature_request" | "improvement" | "experience";
244
- source: "agent" | "human";
245
- impact?: string | undefined;
246
- model?: string | undefined;
247
- trace?: string | undefined;
248
- rating?: number | undefined;
249
- need?: string | undefined;
250
- currentApproach?: string | undefined;
251
- clientVersion?: string | undefined;
252
- stack?: string | undefined;
253
- stackMajor?: number | undefined;
254
- runtime?: "web" | "electron" | "tauri" | undefined;
255
- engine?: "blink" | "gecko" | "webkit" | undefined;
256
- driver?: "cdp" | "sdk" | undefined;
257
- client?: string | undefined;
258
- mcpScope?: "project" | "user" | undefined;
259
- }, {
260
- text: string;
261
- kind: "bug" | "gap" | "ambiguity" | "feature_request" | "improvement" | "experience";
262
- source: "agent" | "human";
263
- impact?: string | undefined;
264
- model?: string | undefined;
265
- trace?: string | undefined;
266
- rating?: number | undefined;
267
- need?: string | undefined;
268
- currentApproach?: string | undefined;
269
- clientVersion?: string | undefined;
270
- stack?: string | undefined;
271
- stackMajor?: number | undefined;
272
- runtime?: "web" | "electron" | "tauri" | undefined;
273
- engine?: "blink" | "gecko" | "webkit" | undefined;
274
- driver?: "cdp" | "sdk" | undefined;
275
- client?: string | undefined;
276
- mcpScope?: "project" | "user" | undefined;
277
- }>;
210
+ contact: z.ZodOptional<z.ZodString>;
211
+ }, z.core.$strip>;
278
212
  export type Feedback = z.infer<typeof FeedbackSchema>;
279
213
  /** What Reticle is being used for. Self-declared; never inferred. */
280
214
  export declare const UsageContextKind: {
@@ -290,7 +224,7 @@ export type UsageContextKind = (typeof UsageContextKind)[keyof typeof UsageConte
290
224
  * say "this is a company" without saying which, or name the company without leaving an email.
291
225
  */
292
226
  export declare const IdentitySchema: z.ZodObject<{
293
- context: z.ZodNativeEnum<{
227
+ context: z.ZodEnum<{
294
228
  readonly COMPANY: "company";
295
229
  readonly SIDE_PROJECT: "side_project";
296
230
  readonly OPEN_SOURCE: "open_source";
@@ -298,13 +232,5 @@ export declare const IdentitySchema: z.ZodObject<{
298
232
  }>;
299
233
  company: z.ZodOptional<z.ZodString>;
300
234
  email: z.ZodOptional<z.ZodString>;
301
- }, "strip", z.ZodTypeAny, {
302
- context: "company" | "side_project" | "open_source" | "learning";
303
- company?: string | undefined;
304
- email?: string | undefined;
305
- }, {
306
- context: "company" | "side_project" | "open_source" | "learning";
307
- company?: string | undefined;
308
- email?: string | undefined;
309
- }>;
235
+ }, z.core.$strip>;
310
236
  export type Identity = z.infer<typeof IdentitySchema>;
@@ -10,7 +10,7 @@
10
10
  * `reticle_feedback` or a human ran `reticle feedback`; an `Identity` exists because a human ran
11
11
  * `reticle identify`. There is no code path to either that a person did not start.
12
12
  */
13
- import { z } from 'zod';
13
+ import * as z from 'zod';
14
14
  /** Who authored the feedback. Agents report failures; humans also rate the experience. */
15
15
  export const FeedbackSource = {
16
16
  AGENT: 'agent',
@@ -62,6 +62,8 @@ export const FeedbackKind = {
62
62
  */
63
63
  EXPERIENCE: 'experience',
64
64
  };
65
+ /** Every feedback kind as one `<a|b>` choice for help text. Derived, so no kind is left out. */
66
+ export const FEEDBACK_KIND_CHOICES = `<${Object.values(FeedbackKind).join('|')}>`;
65
67
  /** Which shell the verified app runs in. Mirrors the SDK's own `PAGE_HEALTH` runtime report. */
66
68
  export const AppRuntime = {
67
69
  WEB: 'web',
@@ -111,6 +113,17 @@ export const FEEDBACK_RATING_MIN = 1;
111
113
  export const FEEDBACK_RATING_MAX = 5;
112
114
  /** Cap for the structured why/impact/workaround fields — prose, but bounded prose. */
113
115
  export const FEEDBACK_FIELD_MAX = 1000;
116
+ /** The longest reply address a feedback report takes: the longest address mail can carry. */
117
+ export const FEEDBACK_CONTACT_MAX = 254;
118
+ /**
119
+ * One plain address: no spaces, one `@`, and a dot in the domain. A simple shape, not full RFC 5322:
120
+ * it refuses a list, a name with an address, and text that is not an address at all.
121
+ */
122
+ const FEEDBACK_CONTACT_SHAPE = /^[^\s@,;<>]+@[^\s@,;<>]+\.[^\s@,;<>]+$/;
123
+ /** True for one plain reply address that a feedback report may carry. */
124
+ export function isFeedbackContact(value) {
125
+ return value.length <= FEEDBACK_CONTACT_MAX && FEEDBACK_CONTACT_SHAPE.test(value);
126
+ }
114
127
  /**
115
128
  * The feedback body. Everything here is either author-written (`text`, `trace`, `rating`) or
116
129
  * environment context detected locally (`stack`, `runtime`, `engine`, …) — the context is what turns
@@ -175,6 +188,12 @@ export const FeedbackSchema = z.object({
175
188
  /** The MCP client on the other end (`claude-code`, `cursor`, …) — self-reported at initialize. */
176
189
  client: z.string().min(1).max(64).optional(),
177
190
  mcpScope: z.nativeEnum(McpScope).optional(),
191
+ /**
192
+ * A reply address, so the maintainers can answer. Present ONLY when the person gave it for this
193
+ * purpose (`reticle feedback --contact`, or the agent relayed one the user typed). The one
194
+ * personal value this channel carries, and never taken from anywhere else.
195
+ */
196
+ contact: z.string().max(FEEDBACK_CONTACT_MAX).refine(isFeedbackContact).optional(),
178
197
  });
179
198
  /** What Reticle is being used for. Self-declared; never inferred. */
180
199
  export const UsageContextKind = {
@@ -5,7 +5,7 @@
5
5
  * `error-recovery.ts` is graded against. `NoSessionReason` has its own module because it refines
6
6
  * exactly one member of the enum below.
7
7
  */
8
- import { z } from 'zod';
8
+ import * as z from 'zod';
9
9
  /**
10
10
  * WHY a tool could not do what was asked.
11
11
  *
@@ -36,9 +36,8 @@ export declare const RefusalReason: {
36
36
  export type RefusalReason = (typeof RefusalReason)[keyof typeof RefusalReason];
37
37
  /** One tool call that could not be served. */
38
38
  export declare const ToolRefusalSchema: z.ZodObject<{
39
- /** Which tool. A name from our own fixed namespace, never app data. */
40
39
  tool: z.ZodString;
41
- reason: z.ZodNativeEnum<{
40
+ reason: z.ZodEnum<{
42
41
  /** There was no app to reach: nothing connected, no session by that id, or several with none named. */
43
42
  readonly NO_SESSION: "no_session";
44
43
  /** The target did not exist: a stale ref, a missing baseline, an option value the select has not got. */
@@ -52,14 +51,7 @@ export declare const ToolRefusalSchema: z.ZodObject<{
52
51
  /** A refusal this list does not name. A classifier that cannot say "I don't know" lies instead. */
53
52
  readonly OTHER: "other";
54
53
  }>;
55
- /**
56
- * For `no_session` only: WHICH no-session situation, from core's closed `NoSessionReason`.
57
- *
58
- * Rides the refusal rather than the profile because this is where the diagnosis is actually
59
- * COMPUTED - `project_profiled` fires once at daemon start, before any tool call has failed, so
60
- * it cannot carry a reason that does not exist yet. Absent on every other refusal reason.
61
- */
62
- noSessionReason: z.ZodOptional<z.ZodNativeEnum<{
54
+ noSessionReason: z.ZodOptional<z.ZodEnum<{
63
55
  readonly AUTH_REFUSED: "auth_refused";
64
56
  readonly LEASE_EXPIRED: "lease_expired";
65
57
  readonly TAB_GONE: "tab_gone";
@@ -72,25 +64,6 @@ export declare const ToolRefusalSchema: z.ZodObject<{
72
64
  readonly NO_CONFIG: "no_config";
73
65
  readonly SDK_NOT_REACHING_DAEMON: "sdk_not_reaching_daemon";
74
66
  }>>;
75
- /**
76
- * TRUE when the call immediately before this one was the SAME tool, also refused.
77
- *
78
- * Reported on the RETRY rather than on the first refusal, because the first refusal has to be sent
79
- * at the moment it happens: deferring it until the next call is known would lose it entirely for
80
- * the agent that gives up, and that agent is the whole population this event exists to describe.
81
- * So count `retried: true` for retries; the ratio against all refusals is whether the diagnosis
82
- * gets anybody unstuck.
83
- */
84
67
  retried: z.ZodBoolean;
85
- }, "strip", z.ZodTypeAny, {
86
- tool: string;
87
- reason: "other" | "no_session" | "no_match" | "unsupported" | "bad_args" | "not_ready";
88
- retried: boolean;
89
- noSessionReason?: "auth_refused" | "lease_expired" | "tab_gone" | "navigated_away" | "route_server_error" | "app_not_reopened" | "config_elsewhere" | "no_listener_no_config" | "no_listener" | "no_config" | "sdk_not_reaching_daemon" | undefined;
90
- }, {
91
- tool: string;
92
- reason: "other" | "no_session" | "no_match" | "unsupported" | "bad_args" | "not_ready";
93
- retried: boolean;
94
- noSessionReason?: "auth_refused" | "lease_expired" | "tab_gone" | "navigated_away" | "route_server_error" | "app_not_reopened" | "config_elsewhere" | "no_listener_no_config" | "no_listener" | "no_config" | "sdk_not_reaching_daemon" | undefined;
95
- }>;
68
+ }, z.core.$strip>;
96
69
  export type ToolRefusal = z.infer<typeof ToolRefusalSchema>;
@@ -5,7 +5,7 @@
5
5
  * `error-recovery.ts` is graded against. `NoSessionReason` has its own module because it refines
6
6
  * exactly one member of the enum below.
7
7
  */
8
- import { z } from 'zod';
8
+ import * as z from 'zod';
9
9
  import { NoSessionReason } from './words/no-session-reason.js';
10
10
  /**
11
11
  * WHY a tool could not do what was asked.