@reticlehq/core 3.6.0 → 3.7.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 (90) hide show
  1. package/dist/artifacts/artifacts-entry.d.ts +2 -0
  2. package/dist/artifacts/artifacts-entry.js +2 -0
  3. package/dist/artifacts/drive-script.d.ts +158 -52
  4. package/dist/artifacts/drive-script.js +24 -1
  5. package/dist/artifacts/flow-constants.d.ts +18 -0
  6. package/dist/artifacts/flow-constants.js +20 -0
  7. package/dist/artifacts/flow-results.d.ts +450 -0
  8. package/dist/artifacts/flow-results.js +1 -0
  9. package/dist/artifacts/flow-types.d.ts +25 -437
  10. package/dist/artifacts/flow-types.js +5 -2
  11. package/dist/artifacts/harness-credits.d.ts +39 -0
  12. package/dist/artifacts/harness-credits.js +69 -0
  13. package/dist/artifacts/harness-map.d.ts +98 -0
  14. package/dist/artifacts/harness-map.js +36 -0
  15. package/dist/artifacts/impact.d.ts +354 -145
  16. package/dist/artifacts/impact.js +66 -48
  17. package/dist/artifacts/journal.d.ts +56 -5
  18. package/dist/artifacts/journal.js +26 -0
  19. package/dist/artifacts/screenshot-upload.d.ts +51 -0
  20. package/dist/artifacts/screenshot-upload.js +26 -0
  21. package/dist/hooks/hook-events.d.ts +4 -4
  22. package/dist/hud-entry.d.ts +1 -0
  23. package/dist/hud-entry.js +2 -0
  24. package/dist/index.d.ts +5 -0
  25. package/dist/index.js +5 -0
  26. package/dist/onboarding.d.ts +8 -0
  27. package/dist/onboarding.js +6 -0
  28. package/dist/realm/registry.js +19 -1
  29. package/dist/schema/command-message.json +30 -0
  30. package/dist/schema/command-name.json +3 -1
  31. package/dist/schema/event-payloads.json +40 -2
  32. package/dist/schema/reticle-message.json +30 -0
  33. package/dist/telemetry-bug.d.ts +169 -0
  34. package/dist/telemetry-bug.js +123 -0
  35. package/dist/telemetry-entry.d.ts +1 -0
  36. package/dist/telemetry-entry.js +1 -0
  37. package/dist/telemetry-feedback.d.ts +2 -2
  38. package/dist/telemetry-refusal.d.ts +2 -2
  39. package/dist/telemetry-session.d.ts +74 -0
  40. package/dist/telemetry-session.js +54 -0
  41. package/dist/telemetry-signals.d.ts +339 -0
  42. package/dist/telemetry-signals.js +138 -0
  43. package/dist/telemetry.d.ts +300 -254
  44. package/dist/telemetry.js +40 -115
  45. package/dist/verdict/disparity.d.ts +105 -0
  46. package/dist/verdict/disparity.js +40 -0
  47. package/dist/verdict/findings.d.ts +6 -0
  48. package/dist/verdict/findings.js +9 -0
  49. package/dist/verdict/instrumentation-coverage.d.ts +115 -0
  50. package/dist/verdict/instrumentation-coverage.js +226 -0
  51. package/dist/verdict/instrumentation-gap.js +1 -1
  52. package/dist/verdict/intent.d.ts +19 -5
  53. package/dist/verdict/intent.js +13 -1
  54. package/dist/verdict/predicate-tree.d.ts +15 -0
  55. package/dist/verdict/predicate-tree.js +21 -0
  56. package/dist/verdict/predicate.d.ts +14 -0
  57. package/dist/verdict/predicate.js +87 -3
  58. package/dist/verdict/security.d.ts +25 -0
  59. package/dist/verdict/security.js +82 -0
  60. package/dist/verdict/verification-run.d.ts +620 -32
  61. package/dist/verdict/verification-run.js +82 -0
  62. package/dist/wire/constants/constants.d.ts +15 -16
  63. package/dist/wire/constants/constants.js +16 -17
  64. package/dist/wire/constants/hud-controls.js +17 -5
  65. package/dist/wire/constants/hud-use.d.ts +29 -4
  66. package/dist/wire/constants/hud-use.js +26 -4
  67. package/dist/wire/constants/mcp-wire.d.ts +10 -0
  68. package/dist/wire/constants/mcp-wire.js +10 -0
  69. package/dist/wire/constants/reticle-chrome.d.ts +19 -0
  70. package/dist/wire/constants/reticle-chrome.js +19 -0
  71. package/dist/wire/constants/session-constants.d.ts +15 -2
  72. package/dist/wire/constants/session-constants.js +15 -2
  73. package/dist/wire/desktop-contract.d.ts +8 -0
  74. package/dist/wire/desktop-contract.js +11 -0
  75. package/dist/wire/event-payloads.d.ts +56 -4
  76. package/dist/wire/event-payloads.js +17 -0
  77. package/dist/wire/messages.d.ts +105 -32
  78. package/dist/wire/messages.js +9 -1
  79. package/dist/wire/platform-link.d.ts +77 -0
  80. package/dist/wire/platform-link.js +45 -0
  81. package/dist/wire/tool-names.d.ts +2 -0
  82. package/dist/wire/tool-names.js +2 -0
  83. package/dist/wire/types.d.ts +19 -6
  84. package/dist/wire/types.js +5 -0
  85. package/dist/words/notices.d.ts +1 -1
  86. package/dist/words/notices.js +1 -1
  87. package/dist/words/upgrade.js +1 -1
  88. package/dist/words/writing-rule.d.ts +14 -0
  89. package/dist/words/writing-rule.js +17 -0
  90. package/package.json +1 -1
@@ -140,47 +140,8 @@ export const AccountStateSchema = z.object({
140
140
  email: z.string().optional(),
141
141
  host: z.string().optional(),
142
142
  });
143
- /**
144
- * The standing offer on the autonomous harness, as the daemon last heard it from the platform.
145
- *
146
- * `claimed` is the only field that decides whether anything is shown, and ABSENCE of this whole
147
- * object means "we do not know" — never "not claimed". That distinction is the difference between
148
- * an offer and a nag: a machine that is offline, unlinked, or paired with an older daemon has not
149
- * told us the person still needs this, and advertising at them anyway is how a dev-only HUD gets
150
- * switched off for good. The account field beside this one already carries that warning; it applies
151
- * here with more force, because this one is marketing.
152
- */
153
- export const HarnessOfferSchema = z.object({
154
- /** True once this org has claimed. A claimed offer is shown as remaining time, never as a pitch. */
155
- claimed: z.boolean(),
156
- /** When the free period ends, epoch ms. Absent when nothing has been claimed. */
157
- expiresAt: z.number().optional(),
158
- /** Whole days left, already computed — the HUD has no clock worth trusting for this. */
159
- daysRemaining: z.number().optional(),
160
- /** Where claiming happens. Absent ⇒ the HUD shows nothing, because a pitch with no door is noise. */
161
- claimUrl: z.string().optional(),
162
- /**
163
- * Whether a drive could actually run if the offer were taken.
164
- *
165
- * Entitlement is not readiness. A workspace can be fully entitled against a deployment that holds
166
- * no key for its provider, and then every signal reads healthy while a drive cannot start —
167
- * including the card, which would sell three free months of something unusable and burn the one
168
- * claim the person gets. Absent means "not told", which is treated as drivable for the same
169
- * reason `claimed` is required and the rest are not: silence from an older platform must not
170
- * switch the feature off.
171
- */
172
- drivable: z.boolean().optional(),
173
- /**
174
- * Whether claiming would still grant anything.
175
- *
176
- * Carried separately because `claimed` is "running RIGHT NOW", and an expired free period reads
177
- * `claimed: false` — the same as never having taken it. Without this the HUD would advertise a
178
- * three-month offer to the one group of people who can never accept it again, which is worse than
179
- * saying nothing at all. Absent ⇒ treated as still offerable: an older platform that does not
180
- * report it also has no expiries to get wrong.
181
- */
182
- eligible: z.boolean().optional(),
183
- });
143
+ /** The grant Harness credits came from: sign-up, the card-started trial, or a paid plan. */
144
+ export const CreditKind = { FREE: 'free', TRIAL: 'trial', PAID: 'paid' };
184
145
  /**
185
146
  * What the platform says about autonomous driving for this project.
186
147
  *
@@ -189,16 +150,69 @@ export const HarnessOfferSchema = z.object({
189
150
  */
190
151
  export const HarnessConfigSchema = z.object({
191
152
  provider: z.string(),
192
- /** The switch somebody set. The platform's default is on. */
153
+ /** The switch somebody set. Off for a new project: the Harness is opt-in. */
193
154
  harnessEnabled: z.boolean(),
194
155
  /** Whether this workspace may drive on OUR model spend. Never folded into the switch. */
195
156
  harnessEntitled: z.boolean(),
196
157
  /** Whether the selected provider has a usable platform key. Older daemons may omit it. */
197
158
  providerReady: z.boolean().optional(),
198
159
  /** Harness credits used and held this 30 days; one is one Harness decision. Absent: unbounded or unknown. */
199
- credits: z.object({ used: z.number().int().min(0), limit: z.number().int().min(0) }).optional(),
160
+ credits: z
161
+ .object({
162
+ used: z.number().int().min(0),
163
+ limit: z.number().int().min(0),
164
+ /** The grant they came from. Optional on the wire: an older platform omits it. */
165
+ kind: z.enum([CreditKind.FREE, CreditKind.TRIAL, CreditKind.PAID]).optional(),
166
+ /** Whole days the grant has left, counted by the daemon from the platform's end date. */
167
+ daysLeft: z.number().int().min(0).optional(),
168
+ })
169
+ .optional(),
200
170
  /** The platform this answer came from, so the HUD's links go there and not to the hosted one. */
201
171
  platformUrl: z.string().optional(),
172
+ /**
173
+ * The platform's own Harness coverage gate, which it enforces. The HUD prefers it to the daemon's
174
+ * local score; absent from an older platform, which leaves the local score to decide.
175
+ */
176
+ gate: z
177
+ .object({
178
+ unlocked: z.boolean(),
179
+ /** floor(score × 100); absent before any app reported. */
180
+ percent: z.number().int().min(0).max(100).optional(),
181
+ reason: z.string().max(400).optional(),
182
+ prompt: z.string().max(4000).optional(),
183
+ })
184
+ .optional(),
185
+ /** The plan in force: which grant, trial days left, seats. Absent from a platform that sent none. */
186
+ plan: z
187
+ .object({
188
+ kind: z.enum([CreditKind.FREE, CreditKind.TRIAL, CreditKind.PAID]),
189
+ daysLeft: z.number().int().min(0).optional(),
190
+ seats: z.number().int().min(0).optional(),
191
+ })
192
+ .optional(),
193
+ /** Harness runs the platform holds for this project. Absent: the platform did not say. */
194
+ harnessRuns: z.number().int().min(0).optional(),
195
+ /** Memory entries the platform holds for this project. Absent: the platform did not say. */
196
+ memoryEntries: z.number().int().min(0).optional(),
197
+ });
198
+ /** The Harness drive running in this tab's project, so the panel can show progress and Stop. */
199
+ export const HarnessDriveSchema = z.object({ runId: z.string(), steps: z.number().int().min(0) });
200
+ /** The longest note a person can send their coding agent from the HUD. */
201
+ export const AGENT_NOTE_MAX = 500;
202
+ /** How many of a tab's latest notes the HUD shows. */
203
+ export const AGENT_NOTES_SHOWN = 5;
204
+ const AGENT_LABEL_MAX = 64;
205
+ /** A note sent to the coding agent from this tab. `seen` only once an agent's tool call took it. */
206
+ export const AgentNoteSchema = z.object({
207
+ text: z.string().max(AGENT_NOTE_MAX),
208
+ seen: z.boolean(),
209
+ /** Which agent took it, when the daemon knows. */
210
+ by: z.string().max(AGENT_LABEL_MAX).optional(),
211
+ });
212
+ /** The coding agents attached to the daemon now (friendly names), and this tab's latest notes. */
213
+ export const AgentLinkSchema = z.object({
214
+ agents: z.array(z.string().max(AGENT_LABEL_MAX)).max(8),
215
+ notes: z.array(AgentNoteSchema).max(AGENT_NOTES_SHOWN),
202
216
  });
203
217
  export const ImpactSnapshotSchema = z.object({
204
218
  schemaVersion: z.number().int().positive(),
@@ -218,11 +232,6 @@ export const ImpactSnapshotSchema = z.object({
218
232
  * kind of nag that gets a dev-only HUD switched off for good.
219
233
  */
220
234
  account: AccountStateSchema.optional(),
221
- /**
222
- * The harness offer, when the daemon knows it. Absent is "unknown" and shows nothing — see
223
- * `HarnessOfferSchema` for why that asymmetry is deliberate.
224
- */
225
- harnessOffer: HarnessOfferSchema.optional(),
226
235
  /**
227
236
  * The harness switch and whether this workspace may drive on our spend.
228
237
  *
@@ -236,6 +245,10 @@ export const ImpactSnapshotSchema = z.object({
236
245
  * cannot be honoured is worse than showing none.
237
246
  */
238
247
  harnessConfig: HarnessConfigSchema.optional(),
248
+ /** The drive running now, when there is one. Absent: nothing is driving. */
249
+ harnessDrive: HarnessDriveSchema.optional(),
250
+ /** Who is coding against this daemon, and what this tab said to them. Absent: an older daemon. */
251
+ agent: AgentLinkSchema.optional(),
239
252
  /**
240
253
  * The rail's notices, already chosen for this machine by the daemon (see `hud-notices.ts`).
241
254
  * Absent means the daemon has nothing newer than the SDK's bundled slides, which then show.
@@ -255,6 +268,11 @@ export const ImpactSnapshotSchema = z.object({
255
268
  * push, and the sentence describing it). Loose here, shaped by the daemon's sync-status.
256
269
  */
257
270
  sync: z.record(z.unknown()).optional(),
271
+ /**
272
+ * How much of THIS tab's app Reticle sees, and the prompt that asks a coding agent to close the
273
+ * rest (`covered`, `total`, `missing`, `prompt`). Loose here, shaped by the daemon's coverageOf.
274
+ */
275
+ instrumentation: z.record(z.unknown()).optional(),
258
276
  });
259
277
  /** Empty counters - the starting point for a fresh store and the identity for merges. */
260
278
  export function emptyImpactCounts() {
@@ -90,17 +90,24 @@ export declare const JournalActionSchema: z.ZodObject<{
90
90
  driver: string;
91
91
  persona?: string | undefined;
92
92
  }>>;
93
+ /**
94
+ * The MCP client that made this call, as its handshake named it (`claude-code`, `cursor`…). Read
95
+ * per call rather than at session end: by teardown the agent has often detached, and two agents on
96
+ * one daemon cannot be told apart from anything but the call itself.
97
+ */
98
+ agent: z.ZodOptional<z.ZodString>;
93
99
  }, "strip", z.ZodTypeAny, {
94
100
  at: number;
95
101
  tool: string;
96
- args: Record<string, unknown>;
97
102
  actionId: string;
103
+ args: Record<string, unknown>;
98
104
  v: 1;
99
105
  tRange: {
100
106
  from: number;
101
107
  to: number;
102
108
  };
103
109
  settled?: boolean | undefined;
110
+ agent?: string | undefined;
104
111
  effect?: unknown;
105
112
  settledInMs?: number | undefined;
106
113
  seqRange?: {
@@ -122,6 +129,7 @@ export declare const JournalActionSchema: z.ZodObject<{
122
129
  to: number;
123
130
  };
124
131
  settled?: boolean | undefined;
132
+ agent?: string | undefined;
125
133
  effect?: unknown;
126
134
  args?: Record<string, unknown> | undefined;
127
135
  settledInMs?: number | undefined;
@@ -211,6 +219,13 @@ export declare const JournalVerdictEffectSchema: z.ZodObject<{
211
219
  }>;
212
220
  /** `file:line` for the element driven, when the page told us one. */
213
221
  source: z.ZodOptional<z.ZodString>;
222
+ /**
223
+ * What the check saw, in the engine's words ("present, visible, disabled"), when it said. Kept so
224
+ * a failed check can say what it found rather than only that the claim did not hold.
225
+ */
226
+ observed: z.ZodOptional<z.ZodString>;
227
+ /** What the check required, in the engine's words ("an element … in state 'enabled'"). */
228
+ expected: z.ZodOptional<z.ZodString>;
214
229
  /**
215
230
  * Which source of truth answering the claim required -- the predicate's own kind.
216
231
  *
@@ -247,6 +262,26 @@ export declare const JournalVerdictEffectSchema: z.ZodObject<{
247
262
  * Absent is not `false`. `false` says the claim came afterwards; absent says nobody recorded which.
248
263
  */
249
264
  declaredBeforeActing: z.ZodOptional<z.ZodBoolean>;
265
+ /**
266
+ * The requests seen in a failed check's window: method, url, status and a short excerpt of the
267
+ * (already redacted) response, so a failure's page can show the call that explains it.
268
+ */
269
+ net: z.ZodOptional<z.ZodArray<z.ZodObject<{
270
+ method: z.ZodString;
271
+ url: z.ZodString;
272
+ status: z.ZodOptional<z.ZodNumber>;
273
+ body: z.ZodOptional<z.ZodString>;
274
+ }, "strip", z.ZodTypeAny, {
275
+ method: string;
276
+ url: string;
277
+ status?: number | undefined;
278
+ body?: string | undefined;
279
+ }, {
280
+ method: string;
281
+ url: string;
282
+ status?: number | undefined;
283
+ body?: string | undefined;
284
+ }>, "many">>;
250
285
  /**
251
286
  * What kind of evidence bought the answer -- the grade the verdict actually proved.
252
287
  *
@@ -274,22 +309,38 @@ export declare const JournalVerdictEffectSchema: z.ZodObject<{
274
309
  */
275
310
  reason: z.ZodOptional<z.ZodString>;
276
311
  }, "strip", z.ZodTypeAny, {
277
- claim: string;
278
312
  verified: "yes" | "no" | "unknown" | "no-fault";
313
+ claim: string;
314
+ net?: {
315
+ method: string;
316
+ url: string;
317
+ status?: number | undefined;
318
+ body?: string | undefined;
319
+ }[] | undefined;
279
320
  kind?: "signal" | "net" | "state" | "element" | "text" | "route" | "console" | "animation" | "settled" | "compare" | "allOf" | "anyOf" | "not" | undefined;
321
+ expected?: string | undefined;
322
+ source?: string | undefined;
280
323
  declaredBeforeActing?: boolean | undefined;
324
+ observed?: string | undefined;
281
325
  grade?: string | undefined;
282
326
  couldNotSee?: string[] | undefined;
283
327
  reason?: string | undefined;
284
- source?: string | undefined;
285
328
  }, {
286
- claim: string;
287
329
  verified: "yes" | "no" | "unknown" | "no-fault";
330
+ claim: string;
331
+ net?: {
332
+ method: string;
333
+ url: string;
334
+ status?: number | undefined;
335
+ body?: string | undefined;
336
+ }[] | undefined;
288
337
  kind?: "signal" | "net" | "state" | "element" | "text" | "route" | "console" | "animation" | "settled" | "compare" | "allOf" | "anyOf" | "not" | undefined;
338
+ expected?: string | undefined;
339
+ source?: string | undefined;
289
340
  declaredBeforeActing?: boolean | undefined;
341
+ observed?: string | undefined;
290
342
  grade?: string | undefined;
291
343
  couldNotSee?: string[] | undefined;
292
344
  reason?: string | undefined;
293
- source?: string | undefined;
294
345
  }>;
295
346
  export type JournalVerdictEffect = z.infer<typeof JournalVerdictEffectSchema>;
@@ -51,6 +51,12 @@ export const JournalActionSchema = z.object({
51
51
  at: z.number().int().min(0),
52
52
  /** Set only when the Harness drove this action; absent means the connected agent did. */
53
53
  drivenBy: DrivenBySchema.optional(),
54
+ /**
55
+ * The MCP client that made this call, as its handshake named it (`claude-code`, `cursor`…). Read
56
+ * per call rather than at session end: by teardown the agent has often detached, and two agents on
57
+ * one daemon cannot be told apart from anything but the call itself.
58
+ */
59
+ agent: z.string().min(1).max(TRANSPORT_LIMITS.MAX_REF_LENGTH).optional(),
54
60
  });
55
61
  /**
56
62
  * The report written beside `events.jsonl` when its byte ceiling refuses a batch.
@@ -107,6 +113,13 @@ export const JournalVerdictEffectSchema = z.object({
107
113
  verified: z.nativeEnum(Verified),
108
114
  /** `file:line` for the element driven, when the page told us one. */
109
115
  source: z.string().max(TRANSPORT_LIMITS.MAX_URL_LENGTH).optional(),
116
+ /**
117
+ * What the check saw, in the engine's words ("present, visible, disabled"), when it said. Kept so
118
+ * a failed check can say what it found rather than only that the claim did not hold.
119
+ */
120
+ observed: z.string().max(TRANSPORT_LIMITS.MAX_STRING_LENGTH).optional(),
121
+ /** What the check required, in the engine's words ("an element … in state 'enabled'"). */
122
+ expected: z.string().max(TRANSPORT_LIMITS.MAX_STRING_LENGTH).optional(),
110
123
  /**
111
124
  * Which source of truth answering the claim required -- the predicate's own kind.
112
125
  *
@@ -129,6 +142,19 @@ export const JournalVerdictEffectSchema = z.object({
129
142
  * Absent is not `false`. `false` says the claim came afterwards; absent says nobody recorded which.
130
143
  */
131
144
  declaredBeforeActing: z.boolean().optional(),
145
+ /**
146
+ * The requests seen in a failed check's window: method, url, status and a short excerpt of the
147
+ * (already redacted) response, so a failure's page can show the call that explains it.
148
+ */
149
+ net: z
150
+ .array(z.object({
151
+ method: z.string().max(TRANSPORT_LIMITS.MAX_COMMAND_NAME_LENGTH),
152
+ url: z.string().max(TRANSPORT_LIMITS.MAX_URL_LENGTH),
153
+ status: z.number().optional(),
154
+ body: z.string().max(TRANSPORT_LIMITS.MAX_STRING_LENGTH).optional(),
155
+ }))
156
+ .max(5)
157
+ .optional(),
132
158
  /**
133
159
  * What kind of evidence bought the answer -- the grade the verdict actually proved.
134
160
  *
@@ -0,0 +1,51 @@
1
+ import { z } from 'zod';
2
+ /**
3
+ * The body of `POST /v1/runs/:runId/screenshots` — one step screenshot, sent once, after the
4
+ * platform has accepted its run. One schema for both ends, so the daemon cannot send a field the
5
+ * platform does not read.
6
+ *
7
+ * `jpeg` is base64 of real JPEG bytes, and `sha256` is of those decoded bytes. The platform answers
8
+ * 201 stored, 200 already held (same run, seq and sha256), 404 run not found, 400 invalid, 413 too
9
+ * large, 409 too many for one run or a different image already at that seq (a seq is never reused).
10
+ */
11
+ /** The platform's bound on every text field of an upload. */
12
+ export declare const UPLOAD_TEXT_MAX = 300;
13
+ export declare const ScreenshotUploadSchema: z.ZodObject<{
14
+ seq: z.ZodNumber;
15
+ file: z.ZodString;
16
+ step: z.ZodOptional<z.ZodString>;
17
+ tool: z.ZodOptional<z.ZodString>;
18
+ /** The check this picture is of, so the platform's run page can show it beside that check. */
19
+ checkId: z.ZodOptional<z.ZodString>;
20
+ source: z.ZodNativeEnum<{
21
+ readonly BROWSER: "browser";
22
+ readonly RENDERED: "rendered";
23
+ }>;
24
+ width: z.ZodNumber;
25
+ height: z.ZodNumber;
26
+ sha256: z.ZodString;
27
+ jpeg: z.ZodString;
28
+ }, "strip", z.ZodTypeAny, {
29
+ file: string;
30
+ source: "browser" | "rendered";
31
+ width: number;
32
+ height: number;
33
+ sha256: string;
34
+ seq: number;
35
+ jpeg: string;
36
+ step?: string | undefined;
37
+ tool?: string | undefined;
38
+ checkId?: string | undefined;
39
+ }, {
40
+ file: string;
41
+ source: "browser" | "rendered";
42
+ width: number;
43
+ height: number;
44
+ sha256: string;
45
+ seq: number;
46
+ jpeg: string;
47
+ step?: string | undefined;
48
+ tool?: string | undefined;
49
+ checkId?: string | undefined;
50
+ }>;
51
+ export type ScreenshotUpload = z.infer<typeof ScreenshotUploadSchema>;
@@ -0,0 +1,26 @@
1
+ import { z } from 'zod';
2
+ import { ScreenshotSource } from '../verdict/verification-run.js';
3
+ /**
4
+ * The body of `POST /v1/runs/:runId/screenshots` — one step screenshot, sent once, after the
5
+ * platform has accepted its run. One schema for both ends, so the daemon cannot send a field the
6
+ * platform does not read.
7
+ *
8
+ * `jpeg` is base64 of real JPEG bytes, and `sha256` is of those decoded bytes. The platform answers
9
+ * 201 stored, 200 already held (same run, seq and sha256), 404 run not found, 400 invalid, 413 too
10
+ * large, 409 too many for one run or a different image already at that seq (a seq is never reused).
11
+ */
12
+ /** The platform's bound on every text field of an upload. */
13
+ export const UPLOAD_TEXT_MAX = 300;
14
+ export const ScreenshotUploadSchema = z.object({
15
+ seq: z.number().int().min(0),
16
+ file: z.string().min(1).max(UPLOAD_TEXT_MAX),
17
+ step: z.string().min(1).max(UPLOAD_TEXT_MAX).optional(),
18
+ tool: z.string().min(1).max(UPLOAD_TEXT_MAX).optional(),
19
+ /** The check this picture is of, so the platform's run page can show it beside that check. */
20
+ checkId: z.string().min(1).max(UPLOAD_TEXT_MAX).optional(),
21
+ source: z.nativeEnum(ScreenshotSource),
22
+ width: z.number().int().min(0),
23
+ height: z.number().int().min(0),
24
+ sha256: z.string().regex(/^[0-9a-f]{64}$/),
25
+ jpeg: z.string().min(1),
26
+ });
@@ -68,8 +68,8 @@ export declare const VerdictHookPayloadSchema: z.ZodObject<{
68
68
  }, "strip", z.ZodTypeAny, {
69
69
  event: "verdict";
70
70
  at: string;
71
- tool: string;
72
71
  verified: string;
72
+ tool: string;
73
73
  url?: string | undefined;
74
74
  projectId?: string | undefined;
75
75
  sessionId?: string | undefined;
@@ -77,8 +77,8 @@ export declare const VerdictHookPayloadSchema: z.ZodObject<{
77
77
  }, {
78
78
  event: "verdict";
79
79
  at: string;
80
- tool: string;
81
80
  verified: string;
81
+ tool: string;
82
82
  url?: string | undefined;
83
83
  projectId?: string | undefined;
84
84
  sessionId?: string | undefined;
@@ -183,8 +183,8 @@ export declare const HookPayloadSchema: z.ZodDiscriminatedUnion<"event", [z.ZodO
183
183
  }, "strip", z.ZodTypeAny, {
184
184
  event: "verdict";
185
185
  at: string;
186
- tool: string;
187
186
  verified: string;
187
+ tool: string;
188
188
  url?: string | undefined;
189
189
  projectId?: string | undefined;
190
190
  sessionId?: string | undefined;
@@ -192,8 +192,8 @@ export declare const HookPayloadSchema: z.ZodDiscriminatedUnion<"event", [z.ZodO
192
192
  }, {
193
193
  event: "verdict";
194
194
  at: string;
195
- tool: string;
196
195
  verified: string;
196
+ tool: string;
197
197
  url?: string | undefined;
198
198
  projectId?: string | undefined;
199
199
  sessionId?: string | undefined;
@@ -8,3 +8,4 @@
8
8
  */
9
9
  export * from './wire/constants/hud-controls.js';
10
10
  export * from './artifacts/hud-notices.js';
11
+ export * from './artifacts/harness-credits.js';
package/dist/hud-entry.js CHANGED
@@ -9,3 +9,5 @@
9
9
  export * from './wire/constants/hud-controls.js';
10
10
  // The rail's notices: read by the daemon that chooses them and the lazy panel that renders them.
11
11
  export * from './artifacts/hud-notices.js';
12
+ // Harness credits: the HUD's row says what the daemon's refusal says.
13
+ export * from './artifacts/harness-credits.js';
package/dist/index.d.ts CHANGED
@@ -34,6 +34,7 @@ export * from './verdict/verdict-attribution.js';
34
34
  export * from './verdict/verify-progress.js';
35
35
  export * from './wire/constants/session-constants.js';
36
36
  export * from './wire/constants/hud-use.js';
37
+ export * from './wire/constants/reticle-chrome.js';
37
38
  export * from './wire/platform-link.js';
38
39
  export * from './wire/constants/discovery.js';
39
40
  export * from './identity/document-identity.js';
@@ -47,6 +48,7 @@ export * from './artifacts/flow-types.js';
47
48
  export * from './artifacts/step-effect.js';
48
49
  export * from './artifacts/flow-composition.js';
49
50
  export * from './verdict/verification-run.js';
51
+ export * from './verdict/disparity.js';
50
52
  export * from './wire/types.js';
51
53
  export * from './identity/brand.js';
52
54
  export * from './wire/net.js';
@@ -68,6 +70,7 @@ export * from './registry/project-registry.js';
68
70
  export * from './verdict/intent.js';
69
71
  export * from './verdict/run-context.js';
70
72
  export * from './verdict/instrumentation-gap.js';
73
+ export * from './verdict/instrumentation-coverage.js';
71
74
  export * from './verdict/security.js';
72
75
  export * from './wire/redaction.js';
73
76
  export * from './wire/state-select.js';
@@ -84,6 +87,7 @@ export * from './wire/channel.js';
84
87
  export * from './verdict/revision.js';
85
88
  export * from './realm/registry.js';
86
89
  export * from './telemetry-session.js';
90
+ export * from './telemetry-signals.js';
87
91
  export * from './telemetry-license.js';
88
92
  export * from './telemetry-feedback.js';
89
93
  export * from './artifacts/impact.js';
@@ -91,3 +95,4 @@ export * from './artifacts/impact-savings.js';
91
95
  export { CONTRACT_FINGERPRINT, CONTRACT_PARTS, RETIRED_WIRE_NAMES, fnv1a, fingerprintOf, } from './identity/contract-fingerprint.js';
92
96
  export { fingerprintFinding, type FindingIdentity } from './verdict/finding-fingerprint.js';
93
97
  export * from './words/unreachable-notice.js';
98
+ export * from './words/writing-rule.js';
package/dist/index.js CHANGED
@@ -36,6 +36,7 @@ export * from './verdict/verdict-attribution.js';
36
36
  export * from './verdict/verify-progress.js'; // VerifyPhase — what a run is doing while it is still doing it
37
37
  export * from './wire/constants/session-constants.js';
38
38
  export * from './wire/constants/hud-use.js'; // where the HUD sits, for HUD_USED events
39
+ export * from './wire/constants/reticle-chrome.js'; // Reticle's own UI, hidden from every capture
39
40
  export * from './wire/platform-link.js'; // daemon <-> platform: capabilities, drive spec, tool session
40
41
  export * from './wire/constants/discovery.js'; // the call-the-founder invitation, one link for every surface
41
42
  export * from './identity/document-identity.js'; // which document an observation belongs to
@@ -60,6 +61,7 @@ export * from './artifacts/flow-types.js'; // FlowStep, FlowExpect, replay resul
60
61
  export * from './artifacts/step-effect.js'; // StepEffect: a leaf, so the page never downloads it
61
62
  export * from './artifacts/flow-composition.js'; // canFollow: may B replay straight after A
62
63
  export * from './verdict/verification-run.js'; // run/verdict shapes for the CI surface
64
+ export * from './verdict/disparity.js';
63
65
  export * from './wire/types.js';
64
66
  export * from './identity/brand.js'; // RunId / SessionId / ProjectId / Ref brands + validators
65
67
  export * from './wire/net.js'; // NetInitiator / ipc:// scheme — network + desktop-IPC call vocabulary
@@ -87,6 +89,7 @@ export * from './registry/project-registry.js'; // projectId -> directory, so a
87
89
  export * from './verdict/intent.js'; // what a change was supposed to make true, captured while somebody knows
88
90
  export * from './verdict/run-context.js'; // what a run established, folded and capped, for the agent to pull back
89
91
  export * from './verdict/instrumentation-gap.js'; // what Reticle could not see, and the change that would let it
92
+ export * from './verdict/instrumentation-coverage.js'; // how much of an app Reticle sees, and the prompt that closes the rest
90
93
  export * from './verdict/security.js'; // sanitize/serialize helpers shared by browser + server
91
94
  export * from './wire/redaction.js'; // isSensitiveKey / scrubKnownSecrets — the shared redaction rules
92
95
  export * from './wire/state-select.js'; // selectPath / capDepth — shared by browser SDK + server fallback
@@ -111,6 +114,7 @@ export * from './realm/registry.js';
111
114
  // from the protocol. What core re-exports are the few names this repository has always spelled its
112
115
  // own way -- see wire/channel.ts, which imports the rule rather than restating it.
113
116
  export * from './telemetry-session.js'; // the session/project rollup payloads
117
+ export * from './telemetry-signals.js'; // account, client, HUD, link and Harness-run signals
114
118
  export * from './telemetry-license.js'; // LicenseActivation — shared by the licence gate and telemetry
115
119
  export * from './telemetry-feedback.js'; // the two things a PERSON writes: feedback + a self-declared identity
116
120
  export * from './artifacts/impact.js'; // the user's own record of what Reticle has done for them (local only)
@@ -118,3 +122,4 @@ export * from './artifacts/impact-savings.js'; // the savings model - one file,
118
122
  export { CONTRACT_FINGERPRINT, CONTRACT_PARTS, RETIRED_WIRE_NAMES, fnv1a, fingerprintOf, } from './identity/contract-fingerprint.js';
119
123
  export { fingerprintFinding } from './verdict/finding-fingerprint.js';
120
124
  export * from './words/unreachable-notice.js'; // the page's unreachable warning, as a contract the daemon parses
125
+ export * from './words/writing-rule.js'; // how agents write the text Reticle keeps (ASD-STE100, about 80%)
@@ -94,6 +94,12 @@ export declare const OnboardingStepSchema: z.ZodObject<{
94
94
  * neither: a human abandons a step, an agent's run exits.
95
95
  */
96
96
  unattended: z.ZodOptional<z.ZodBoolean>;
97
+ /**
98
+ * The first time this machine + project crossed this step, ever. The daemon's "first" steps are
99
+ * claimed on disk and fire once; absent on a step that is not a first, and on one reported from a
100
+ * home that could not be written (which fires once per process instead).
101
+ */
102
+ firstEver: z.ZodOptional<z.ZodBoolean>;
97
103
  }, "strip", z.ZodTypeAny, {
98
104
  step: string;
99
105
  status: "skipped" | "completed" | "failed" | "started" | "abandoned";
@@ -102,6 +108,7 @@ export declare const OnboardingStepSchema: z.ZodObject<{
102
108
  stack?: string | undefined;
103
109
  elapsedMs?: number | undefined;
104
110
  unattended?: boolean | undefined;
111
+ firstEver?: boolean | undefined;
105
112
  }, {
106
113
  step: string;
107
114
  status: "skipped" | "completed" | "failed" | "started" | "abandoned";
@@ -110,5 +117,6 @@ export declare const OnboardingStepSchema: z.ZodObject<{
110
117
  stack?: string | undefined;
111
118
  elapsedMs?: number | undefined;
112
119
  unattended?: boolean | undefined;
120
+ firstEver?: boolean | undefined;
113
121
  }>;
114
122
  export type OnboardingStep = z.infer<typeof OnboardingStepSchema>;
@@ -138,4 +138,10 @@ export const OnboardingStepSchema = z.object({
138
138
  * neither: a human abandons a step, an agent's run exits.
139
139
  */
140
140
  unattended: z.boolean().optional(),
141
+ /**
142
+ * The first time this machine + project crossed this step, ever. The daemon's "first" steps are
143
+ * claimed on disk and fire once; absent on a step that is not a first, and on one reported from a
144
+ * home that could not be written (which fires once per process instead).
145
+ */
146
+ firstEver: z.boolean().optional(),
141
147
  });
@@ -21,6 +21,7 @@
21
21
  import { Surface } from 'open-verification';
22
22
  import { AppRuntime } from '../telemetry-feedback.js';
23
23
  import { PlatformProfile } from '../wire/platform.js';
24
+ import { RETICLE_URL_PARAM } from '../wire/constants/constants.js';
24
25
  /**
25
26
  * Every realm Reticle knows about.
26
27
  *
@@ -166,9 +167,26 @@ export function subjectOf(facts) {
166
167
  // first document is known, never as a substitute for one.
167
168
  instance: facts.currentDocumentId ?? facts.id,
168
169
  ...(epoch === undefined ? {} : { epoch }),
169
- locator: facts.url,
170
+ // The app's address: the marks Reticle puts on a tab to adopt it are not part of it.
171
+ locator: withoutReticleMarks(facts.url),
170
172
  };
171
173
  }
174
+ const RETICLE_MARKS = new Set(Object.values(RETICLE_URL_PARAM));
175
+ /** `url` without Reticle's own query params; returned as given when it does not parse. */
176
+ function withoutReticleMarks(url) {
177
+ try {
178
+ const parsed = new URL(url);
179
+ if (![...parsed.searchParams.keys()].some((key) => RETICLE_MARKS.has(key)))
180
+ return url;
181
+ for (const key of [...parsed.searchParams.keys()])
182
+ if (RETICLE_MARKS.has(key))
183
+ parsed.searchParams.delete(key);
184
+ return parsed.href;
185
+ }
186
+ catch {
187
+ return url;
188
+ }
189
+ }
172
190
  /**
173
191
  * Which realm a project on disk is, judged only by its markers.
174
192
  *
@@ -33,6 +33,36 @@
33
33
  "enum": [
34
34
  "harness"
35
35
  ]
36
+ },
37
+ "outward": {
38
+ "type": "object",
39
+ "properties": {
40
+ "allowed": {
41
+ "type": "array",
42
+ "items": {
43
+ "type": "string",
44
+ "enum": [
45
+ "invite",
46
+ "send",
47
+ "share",
48
+ "delete",
49
+ "pay",
50
+ "publish",
51
+ "revoke",
52
+ "transfer",
53
+ "sign out",
54
+ "change role",
55
+ "create key",
56
+ "change state"
57
+ ]
58
+ },
59
+ "maxItems": 16
60
+ }
61
+ },
62
+ "required": [
63
+ "allowed"
64
+ ],
65
+ "additionalProperties": false
36
66
  }
37
67
  },
38
68
  "required": [
@@ -21,11 +21,13 @@
21
21
  "presenter",
22
22
  "impact",
23
23
  "capture",
24
+ "render",
24
25
  "navigate",
25
26
  "refresh",
26
27
  "flows",
27
28
  "flow.progress",
28
- "plan"
29
+ "plan",
30
+ "markers"
29
31
  ]
30
32
  }
31
33
  },