@reticlehq/core 3.7.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 (108) 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 +64 -64
  4. package/dist/artifacts/flow-constants.d.ts +15 -0
  5. package/dist/artifacts/flow-constants.js +15 -0
  6. package/dist/artifacts/flow-expect-flat.d.ts +8 -8
  7. package/dist/artifacts/flow-results.d.ts +11 -0
  8. package/dist/artifacts/flow-types.d.ts +164 -118
  9. package/dist/artifacts/flow-types.js +12 -0
  10. package/dist/artifacts/harness-credits.d.ts +6 -3
  11. package/dist/artifacts/harness-credits.js +9 -6
  12. package/dist/artifacts/harness-map.d.ts +6 -6
  13. package/dist/artifacts/impact.d.ts +77 -80
  14. package/dist/artifacts/impact.js +34 -17
  15. package/dist/artifacts/journal.d.ts +25 -6
  16. package/dist/artifacts/journal.js +13 -0
  17. package/dist/artifacts/prompt-context.d.ts +12 -0
  18. package/dist/artifacts/prompt-context.js +14 -3
  19. package/dist/graph/app-graph.d.ts +137 -0
  20. package/dist/graph/app-graph.js +498 -0
  21. package/dist/hooks/hook-events.d.ts +22 -22
  22. package/dist/hud-entry.js +1 -1
  23. package/dist/identity/checkout.d.ts +41 -0
  24. package/dist/identity/checkout.js +118 -0
  25. package/dist/identity/state-dir.d.ts +23 -0
  26. package/dist/identity/state-dir.js +43 -0
  27. package/dist/index.d.ts +10 -0
  28. package/dist/index.js +10 -0
  29. package/dist/onboarding.d.ts +22 -1
  30. package/dist/onboarding.js +19 -0
  31. package/dist/registry/dev-server-registry.d.ts +2 -2
  32. package/dist/schema/event-message.json +3 -1
  33. package/dist/schema/event-payloads.json +116 -1
  34. package/dist/schema/event-type.json +3 -1
  35. package/dist/schema/hello-message.json +21 -0
  36. package/dist/schema/reticle-event.json +3 -1
  37. package/dist/schema/reticle-message.json +24 -1
  38. package/dist/telemetry-bug.d.ts +6 -6
  39. package/dist/telemetry-entry.d.ts +1 -1
  40. package/dist/telemetry-entry.js +1 -1
  41. package/dist/telemetry-feedback.d.ts +14 -0
  42. package/dist/telemetry-feedback.js +19 -0
  43. package/dist/telemetry-refusal.d.ts +2 -2
  44. package/dist/telemetry-session.d.ts +23 -8
  45. package/dist/telemetry-session.js +15 -4
  46. package/dist/telemetry-signals.d.ts +227 -9
  47. package/dist/telemetry-signals.js +88 -1
  48. package/dist/telemetry.d.ts +379 -72
  49. package/dist/telemetry.js +71 -5
  50. package/dist/verdict/check-sentence.d.ts +34 -0
  51. package/dist/verdict/check-sentence.js +228 -0
  52. package/dist/verdict/consequence.d.ts +15 -0
  53. package/dist/verdict/consequence.js +11 -0
  54. package/dist/verdict/findings.d.ts +10 -0
  55. package/dist/verdict/findings.js +13 -0
  56. package/dist/verdict/instrumentation-coverage.d.ts +3 -34
  57. package/dist/verdict/instrumentation-coverage.js +14 -58
  58. package/dist/verdict/instrumentation-gap.d.ts +79 -0
  59. package/dist/verdict/instrumentation-gap.js +64 -0
  60. package/dist/verdict/predicate-tree.d.ts +2 -0
  61. package/dist/verdict/predicate-tree.js +16 -0
  62. package/dist/verdict/predicate.d.ts +2 -1
  63. package/dist/verdict/predicate.js +103 -12
  64. package/dist/verdict/property-assertion.d.ts +2 -2
  65. package/dist/verdict/run-report.d.ts +166 -0
  66. package/dist/verdict/run-report.js +53 -0
  67. package/dist/verdict/security.d.ts +36 -2
  68. package/dist/verdict/security.js +94 -14
  69. package/dist/verdict/verification-run.d.ts +95 -38
  70. package/dist/verdict/verification-run.js +33 -2
  71. package/dist/verdict/verify-progress.d.ts +6 -6
  72. package/dist/wire/constants/constants.d.ts +56 -141
  73. package/dist/wire/constants/constants.js +64 -144
  74. package/dist/wire/constants/discovery.d.ts +4 -4
  75. package/dist/wire/constants/discovery.js +4 -4
  76. package/dist/wire/constants/event-types.d.ts +35 -1
  77. package/dist/wire/constants/event-types.js +33 -1
  78. package/dist/wire/constants/hud-controls.js +0 -2
  79. package/dist/wire/constants/hud-use.d.ts +4 -0
  80. package/dist/wire/constants/hud-use.js +4 -0
  81. package/dist/wire/constants/mcp-wire.d.ts +16 -0
  82. package/dist/wire/constants/mcp-wire.js +16 -0
  83. package/dist/wire/constants/response-body-reason.d.ts +19 -0
  84. package/dist/wire/constants/response-body-reason.js +18 -0
  85. package/dist/wire/constants/reticle-env.d.ts +138 -0
  86. package/dist/wire/constants/reticle-env.js +138 -0
  87. package/dist/wire/constants/session-constants.d.ts +11 -0
  88. package/dist/wire/constants/session-constants.js +11 -0
  89. package/dist/wire/event-payloads.d.ts +150 -36
  90. package/dist/wire/event-payloads.js +83 -16
  91. package/dist/wire/messages.d.ts +102 -36
  92. package/dist/wire/messages.js +16 -0
  93. package/dist/wire/narrow.d.ts +6 -0
  94. package/dist/wire/narrow.js +26 -0
  95. package/dist/wire/next-step.d.ts +90 -0
  96. package/dist/wire/next-step.js +37 -0
  97. package/dist/wire/platform-link.d.ts +7 -0
  98. package/dist/wire/platform-link.js +12 -6
  99. package/dist/wire/production/activation-ticket.d.ts +64 -0
  100. package/dist/wire/production/activation-ticket.js +148 -0
  101. package/dist/wire/production/hello-mode.d.ts +35 -0
  102. package/dist/wire/production/hello-mode.js +32 -0
  103. package/dist/wire/production/production-policy.d.ts +138 -0
  104. package/dist/wire/production/production-policy.js +133 -0
  105. package/dist/wire/tool-names.d.ts +2 -0
  106. package/dist/wire/tool-names.js +2 -0
  107. package/dist/wire/types.d.ts +73 -48
  108. package/package.json +5 -1
@@ -43,6 +43,20 @@
43
43
  "type": "string",
44
44
  "maxLength": 512
45
45
  },
46
+ "env": {
47
+ "type": "string",
48
+ "enum": [
49
+ "development",
50
+ "production"
51
+ ]
52
+ },
53
+ "scope": {
54
+ "type": "string",
55
+ "enum": [
56
+ "observe",
57
+ "act"
58
+ ]
59
+ },
46
60
  "platform": {
47
61
  "type": "string",
48
62
  "enum": [
@@ -119,6 +133,13 @@
119
133
  "sourceMapping": {
120
134
  "type": "boolean"
121
135
  },
136
+ "instrumentation": {
137
+ "type": "string",
138
+ "enum": [
139
+ "installed",
140
+ "injected"
141
+ ]
142
+ },
122
143
  "sdkVersion": {
123
144
  "type": "string",
124
145
  "maxLength": 128
@@ -298,7 +319,9 @@
298
319
  "human.control",
299
320
  "human.mark",
300
321
  "download",
301
- "hud.used"
322
+ "hud.used",
323
+ "media.state",
324
+ "canvas.digest"
302
325
  ]
303
326
  },
304
327
  "sessionId": {
@@ -148,20 +148,20 @@ export declare const BugFoundSchema: z.ZodObject<{
148
148
  */
149
149
  occurrence: z.ZodOptional<z.ZodNumber>;
150
150
  }, "strip", z.ZodTypeAny, {
151
+ repeat: boolean;
151
152
  kind: string;
152
- source: "replay" | "contradiction" | "crawl" | "assertion";
153
- attribution: "reticle" | "request" | "app" | "unclassified";
153
+ source: "replay" | "assertion" | "contradiction" | "crawl";
154
+ attribution: "app" | "reticle" | "request" | "unclassified";
154
155
  falseGreen: boolean;
155
- repeat: boolean;
156
156
  tool?: string | undefined;
157
157
  fingerprint?: string | undefined;
158
158
  occurrence?: number | undefined;
159
159
  }, {
160
+ repeat: boolean;
160
161
  kind: string;
161
- source: "replay" | "contradiction" | "crawl" | "assertion";
162
- attribution: "reticle" | "request" | "app" | "unclassified";
162
+ source: "replay" | "assertion" | "contradiction" | "crawl";
163
+ attribution: "app" | "reticle" | "request" | "unclassified";
163
164
  falseGreen: boolean;
164
- repeat: boolean;
165
165
  tool?: string | undefined;
166
166
  fingerprint?: string | undefined;
167
167
  occurrence?: number | undefined;
@@ -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
  */
@@ -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
@@ -238,6 +244,12 @@ export declare const FeedbackSchema: z.ZodObject<{
238
244
  readonly USER: "user";
239
245
  readonly PROJECT: "project";
240
246
  }>>;
247
+ /**
248
+ * A reply address, so the maintainers can answer. Present ONLY when the person gave it for this
249
+ * purpose (`reticle feedback --contact`, or the agent relayed one the user typed). The one
250
+ * personal value this channel carries, and never taken from anywhere else.
251
+ */
252
+ contact: z.ZodOptional<z.ZodEffects<z.ZodString, string, string>>;
241
253
  }, "strip", z.ZodTypeAny, {
242
254
  text: string;
243
255
  kind: "bug" | "gap" | "ambiguity" | "feature_request" | "improvement" | "experience";
@@ -256,6 +268,7 @@ export declare const FeedbackSchema: z.ZodObject<{
256
268
  driver?: "cdp" | "sdk" | undefined;
257
269
  client?: string | undefined;
258
270
  mcpScope?: "project" | "user" | undefined;
271
+ contact?: string | undefined;
259
272
  }, {
260
273
  text: string;
261
274
  kind: "bug" | "gap" | "ambiguity" | "feature_request" | "improvement" | "experience";
@@ -274,6 +287,7 @@ export declare const FeedbackSchema: z.ZodObject<{
274
287
  driver?: "cdp" | "sdk" | undefined;
275
288
  client?: string | undefined;
276
289
  mcpScope?: "project" | "user" | undefined;
290
+ contact?: string | undefined;
277
291
  }>;
278
292
  export type Feedback = z.infer<typeof FeedbackSchema>;
279
293
  /** What Reticle is being used for. Self-declared; never inferred. */
@@ -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 = {
@@ -83,13 +83,13 @@ export declare const ToolRefusalSchema: z.ZodObject<{
83
83
  */
84
84
  retried: z.ZodBoolean;
85
85
  }, "strip", z.ZodTypeAny, {
86
- tool: string;
87
86
  reason: "other" | "no_session" | "no_match" | "unsupported" | "bad_args" | "not_ready";
87
+ tool: string;
88
88
  retried: boolean;
89
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
90
  }, {
91
- tool: string;
92
91
  reason: "other" | "no_session" | "no_match" | "unsupported" | "bad_args" | "not_ready";
92
+ tool: string;
93
93
  retried: boolean;
94
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
95
  }>;
@@ -13,9 +13,9 @@ import { z } from 'zod';
13
13
  export declare const AgentNudgeKind: {
14
14
  /** Unlinked, after the first verdict: `reticle connect` keeps it and lets the Harness test the app. */
15
15
  readonly CONNECT: "connect";
16
- /** Linked, below the Harness's coverage: close the named gaps. */
16
+ /** An older build's "close the gaps" advisory. No longer sent: the Harness has no coverage gate. */
17
17
  readonly CLOSE_GAPS: "close_gaps";
18
- /** Linked, at the Harness's coverage with the Harness off: the user can switch it on. */
18
+ /** Linked, with the Harness off: the user can switch it on. */
19
19
  readonly SWITCH_ON: "switch_on";
20
20
  /** Harness on, and the agent is driving a long journey by hand: hand it to explore. */
21
21
  readonly EXPLORE: "explore";
@@ -428,6 +428,17 @@ export declare const SessionSummarySchema: z.ZodObject<{
428
428
  * difference between a smooth install and one that needed a second step nobody documented.
429
429
  */
430
430
  msToFirstApp: z.ZodOptional<z.ZodNumber>;
431
+ /**
432
+ * The SDK version of the last page that connected to this daemon, from its HELLO. Our own
433
+ * release number, or `other`. Absent when no page announced one.
434
+ */
435
+ sdkVersion: z.ZodOptional<z.ZodString>;
436
+ /**
437
+ * Tool calls made before the first app connected. Session lifetime, like `appConnects`: read the
438
+ * last row, never sum. Absent when there were none. With `appConnects: 0`, it is an agent that
439
+ * worked against a daemon with no app, which sends no verdict and often no refusal.
440
+ */
441
+ toolCallsBeforeApp: z.ZodOptional<z.ZodNumber>;
431
442
  /**
432
443
  * What state the AGENT's work was in when the session ended. Absent on a periodic flush.
433
444
  *
@@ -541,16 +552,16 @@ export declare const SessionSummarySchema: z.ZodObject<{
541
552
  nudgesShown: z.ZodOptional<z.ZodRecord<z.ZodNativeEnum<{
542
553
  /** Unlinked, after the first verdict: `reticle connect` keeps it and lets the Harness test the app. */
543
554
  readonly CONNECT: "connect";
544
- /** Linked, below the Harness's coverage: close the named gaps. */
555
+ /** An older build's "close the gaps" advisory. No longer sent: the Harness has no coverage gate. */
545
556
  readonly CLOSE_GAPS: "close_gaps";
546
- /** Linked, at the Harness's coverage with the Harness off: the user can switch it on. */
557
+ /** Linked, with the Harness off: the user can switch it on. */
547
558
  readonly SWITCH_ON: "switch_on";
548
559
  /** Harness on, and the agent is driving a long journey by hand: hand it to explore. */
549
560
  readonly EXPLORE: "explore";
550
561
  }>, z.ZodNumber>>;
551
562
  /**
552
- * Harness drives refused for coverage below the gate, by coverage bucket (`CoverageBucket`).
553
- * Windowed; absent when none was refused.
563
+ * Harness drives an older build refused for low coverage, by coverage bucket (`CoverageBucket`).
564
+ * No longer sent: the Harness has no coverage gate. Kept so an older daemon's events still parse.
554
565
  */
555
566
  harnessRefusedCoverage: z.ZodOptional<z.ZodRecord<z.ZodNativeEnum<{
556
567
  readonly B0: "0-19";
@@ -582,6 +593,7 @@ export declare const SessionSummarySchema: z.ZodObject<{
582
593
  verifications: number;
583
594
  final: boolean;
584
595
  surface?: string | undefined;
596
+ sdkVersion?: string | undefined;
585
597
  errors?: {
586
598
  message: string;
587
599
  count: number;
@@ -630,6 +642,7 @@ export declare const SessionSummarySchema: z.ZodObject<{
630
642
  clientVersions?: Record<string, string> | undefined;
631
643
  appConnects?: number | undefined;
632
644
  msToFirstApp?: number | undefined;
645
+ toolCallsBeforeApp?: number | undefined;
633
646
  endReason?: "verified" | "abandoned" | "never_used" | "explored" | "client_left" | undefined;
634
647
  feedbackPrompted?: number | undefined;
635
648
  errorClasses?: Record<string, number> | undefined;
@@ -658,6 +671,7 @@ export declare const SessionSummarySchema: z.ZodObject<{
658
671
  verifications: number;
659
672
  final: boolean;
660
673
  surface?: string | undefined;
674
+ sdkVersion?: string | undefined;
661
675
  errors?: {
662
676
  message: string;
663
677
  count: number;
@@ -706,6 +720,7 @@ export declare const SessionSummarySchema: z.ZodObject<{
706
720
  clientVersions?: Record<string, string> | undefined;
707
721
  appConnects?: number | undefined;
708
722
  msToFirstApp?: number | undefined;
723
+ toolCallsBeforeApp?: number | undefined;
709
724
  endReason?: "verified" | "abandoned" | "never_used" | "explored" | "client_left" | undefined;
710
725
  feedbackPrompted?: number | undefined;
711
726
  errorClasses?: Record<string, number> | undefined;
@@ -919,7 +934,7 @@ export declare const ProjectProfileSchema: z.ZodObject<{
919
934
  featureDepth: number;
920
935
  stack?: string | undefined;
921
936
  stackMajor?: number | undefined;
922
- size?: "medium" | "tiny" | "small" | "large" | "huge" | undefined;
937
+ size?: "small" | "medium" | "tiny" | "large" | "huge" | undefined;
923
938
  stackSource?: "cwd" | "workspace" | undefined;
924
939
  stackUnknownReason?: "no_app_found" | "manifest_unrecognised" | "workspace_apps_unrecognised" | "workspace_root_no_apps" | "discovery_failed" | undefined;
925
940
  monorepo?: boolean | undefined;
@@ -939,7 +954,7 @@ export declare const ProjectProfileSchema: z.ZodObject<{
939
954
  featureDepth: number;
940
955
  stack?: string | undefined;
941
956
  stackMajor?: number | undefined;
942
- size?: "medium" | "tiny" | "small" | "large" | "huge" | undefined;
957
+ size?: "small" | "medium" | "tiny" | "large" | "huge" | undefined;
943
958
  stackSource?: "cwd" | "workspace" | undefined;
944
959
  stackUnknownReason?: "no_app_found" | "manifest_unrecognised" | "workspace_apps_unrecognised" | "workspace_root_no_apps" | "discovery_failed" | undefined;
945
960
  monorepo?: boolean | undefined;
@@ -13,9 +13,9 @@ import { z } from 'zod';
13
13
  export const AgentNudgeKind = {
14
14
  /** Unlinked, after the first verdict: `reticle connect` keeps it and lets the Harness test the app. */
15
15
  CONNECT: 'connect',
16
- /** Linked, below the Harness's coverage: close the named gaps. */
16
+ /** An older build's "close the gaps" advisory. No longer sent: the Harness has no coverage gate. */
17
17
  CLOSE_GAPS: 'close_gaps',
18
- /** Linked, at the Harness's coverage with the Harness off: the user can switch it on. */
18
+ /** Linked, with the Harness off: the user can switch it on. */
19
19
  SWITCH_ON: 'switch_on',
20
20
  /** Harness on, and the agent is driving a long journey by hand: hand it to explore. */
21
21
  EXPLORE: 'explore',
@@ -300,6 +300,17 @@ export const SessionSummarySchema = z.object({
300
300
  * difference between a smooth install and one that needed a second step nobody documented.
301
301
  */
302
302
  msToFirstApp: z.number().int().nonnegative().optional(),
303
+ /**
304
+ * The SDK version of the last page that connected to this daemon, from its HELLO. Our own
305
+ * release number, or `other`. Absent when no page announced one.
306
+ */
307
+ sdkVersion: z.string().min(1).max(32).optional(),
308
+ /**
309
+ * Tool calls made before the first app connected. Session lifetime, like `appConnects`: read the
310
+ * last row, never sum. Absent when there were none. With `appConnects: 0`, it is an agent that
311
+ * worked against a daemon with no app, which sends no verdict and often no refusal.
312
+ */
313
+ toolCallsBeforeApp: z.number().int().nonnegative().optional(),
303
314
  /**
304
315
  * What state the AGENT's work was in when the session ended. Absent on a periodic flush.
305
316
  *
@@ -412,8 +423,8 @@ export const SessionSummarySchema = z.object({
412
423
  */
413
424
  nudgesShown: z.record(z.nativeEnum(AgentNudgeKind), z.number().int().positive()).optional(),
414
425
  /**
415
- * Harness drives refused for coverage below the gate, by coverage bucket (`CoverageBucket`).
416
- * Windowed; absent when none was refused.
426
+ * Harness drives an older build refused for low coverage, by coverage bucket (`CoverageBucket`).
427
+ * No longer sent: the Harness has no coverage gate. Kept so an older daemon's events still parse.
417
428
  */
418
429
  harnessRefusedCoverage: z
419
430
  .record(z.nativeEnum(CoverageBucket), z.number().int().positive())
@@ -1,7 +1,8 @@
1
1
  /**
2
2
  * The product signals the event set could not answer: who is signed in, which workspace and which
3
3
  * agent client an event belongs to, which HUD page was opened, which sign-in prompts were seen, when a
4
- * project was linked, and how a Harness run started and ended.
4
+ * project was linked, how a Harness run started and ended, and what happened to the MCP proxy and
5
+ * its daemon when the link failed.
5
6
  *
6
7
  * Its own file so the vocabulary has one home and `telemetry.ts` only wires it in. Every value here is
7
8
  * a closed set, a boolean or a bucket: none of these fields can carry a URL, a path, a name or text.
@@ -113,9 +114,9 @@ export declare const PlatformLinkSchema: z.ZodObject<{
113
114
  readonly LINK: "link";
114
115
  }>;
115
116
  }, "strip", z.ZodTypeAny, {
116
- via: "hud" | "link" | "connect";
117
+ via: "link" | "hud" | "connect";
117
118
  }, {
118
- via: "hud" | "link" | "connect";
119
+ via: "link" | "hud" | "connect";
119
120
  }>;
120
121
  export type PlatformLink = z.infer<typeof PlatformLinkSchema>;
121
122
  export declare const HarnessRunPhase: {
@@ -132,6 +133,31 @@ export declare const HarnessRunOutcome: {
132
133
  readonly STOPPED: "stopped";
133
134
  };
134
135
  export type HarnessRunOutcome = (typeof HarnessRunOutcome)[keyof typeof HarnessRunOutcome];
136
+ /**
137
+ * Why a Harness run did not drive: only on a `blocked` or `failed` run. Closed, and read off the
138
+ * refusal that stopped it, never off its sentence, so a reworded message cannot change the count.
139
+ */
140
+ export declare const HarnessRunReason: {
141
+ /** The project has no platform link, so there is nowhere to drive from. */
142
+ readonly NOT_LINKED: "not_linked";
143
+ /** The platform did not confirm the drive in time, or answered something unreadable. */
144
+ readonly PLATFORM_UNREACHABLE: "platform_unreachable";
145
+ /** The Harness is switched off for this project (the default until somebody turns it on). */
146
+ readonly HARNESS_OFF: "harness_off";
147
+ /** The workspace has no credits left. */
148
+ readonly NO_CREDITS: "no_credits";
149
+ /** The workspace has not claimed the Harness. */
150
+ readonly NOT_ENTITLED: "not_entitled";
151
+ /** An older build refused for low instrumentation. No longer sent: the Harness has no coverage gate. */
152
+ readonly COVERAGE_GATE: "coverage_gate";
153
+ /** The page and the daemon come from different builds, so every step would answer unknown. */
154
+ readonly VERSION_SKEW: "version_skew";
155
+ /** The drive started and broke. */
156
+ readonly BROKEN: "broken";
157
+ /** A refusal this list does not name. A growing count here is a gap in this list. */
158
+ readonly OTHER: "other";
159
+ };
160
+ export type HarnessRunReason = (typeof HarnessRunReason)[keyof typeof HarnessRunReason];
135
161
  /** Who started a Harness run. `dashboard` is a run started from the platform's chat. */
136
162
  export declare const HarnessRunSource: {
137
163
  readonly AGENT: "agent";
@@ -179,20 +205,43 @@ export declare const HarnessRunSchema: z.ZodObject<{
179
205
  readonly FOUR_NINE: "4-9";
180
206
  readonly TEN_PLUS: "10+";
181
207
  }>>;
208
+ /** Only on a `blocked` or `failed` run: why it did not drive. */
209
+ reason: z.ZodOptional<z.ZodNativeEnum<{
210
+ /** The project has no platform link, so there is nowhere to drive from. */
211
+ readonly NOT_LINKED: "not_linked";
212
+ /** The platform did not confirm the drive in time, or answered something unreadable. */
213
+ readonly PLATFORM_UNREACHABLE: "platform_unreachable";
214
+ /** The Harness is switched off for this project (the default until somebody turns it on). */
215
+ readonly HARNESS_OFF: "harness_off";
216
+ /** The workspace has no credits left. */
217
+ readonly NO_CREDITS: "no_credits";
218
+ /** The workspace has not claimed the Harness. */
219
+ readonly NOT_ENTITLED: "not_entitled";
220
+ /** An older build refused for low instrumentation. No longer sent: the Harness has no coverage gate. */
221
+ readonly COVERAGE_GATE: "coverage_gate";
222
+ /** The page and the daemon come from different builds, so every step would answer unknown. */
223
+ readonly VERSION_SKEW: "version_skew";
224
+ /** The drive started and broke. */
225
+ readonly BROKEN: "broken";
226
+ /** A refusal this list does not name. A growing count here is a gap in this list. */
227
+ readonly OTHER: "other";
228
+ }>>;
182
229
  }, "strip", z.ZodTypeAny, {
183
230
  source: "plan" | "agent" | "hud" | "dashboard" | "cli_try";
184
231
  phase: "completed" | "started";
185
232
  hosted: boolean;
233
+ reason?: "version_skew" | "other" | "not_linked" | "platform_unreachable" | "harness_off" | "no_credits" | "not_entitled" | "coverage_gate" | "broken" | undefined;
234
+ replayed?: "0" | "1" | "2-3" | "4-9" | "10+" | undefined;
186
235
  outcome?: "proved" | "failed" | "blocked" | "not_proved" | "stopped" | undefined;
187
236
  journeys?: "0" | "1" | "2-3" | "4-9" | "10+" | undefined;
188
- replayed?: "0" | "1" | "2-3" | "4-9" | "10+" | undefined;
189
237
  }, {
190
238
  source: "plan" | "agent" | "hud" | "dashboard" | "cli_try";
191
239
  phase: "completed" | "started";
192
240
  hosted: boolean;
241
+ reason?: "version_skew" | "other" | "not_linked" | "platform_unreachable" | "harness_off" | "no_credits" | "not_entitled" | "coverage_gate" | "broken" | undefined;
242
+ replayed?: "0" | "1" | "2-3" | "4-9" | "10+" | undefined;
193
243
  outcome?: "proved" | "failed" | "blocked" | "not_proved" | "stopped" | undefined;
194
244
  journeys?: "0" | "1" | "2-3" | "4-9" | "10+" | undefined;
195
- replayed?: "0" | "1" | "2-3" | "4-9" | "10+" | undefined;
196
245
  }>;
197
246
  export type HarnessRun = z.infer<typeof HarnessRunSchema>;
198
247
  /**
@@ -279,9 +328,9 @@ export declare const SIGNAL_FIELDS: {
279
328
  readonly LINK: "link";
280
329
  }>;
281
330
  }, "strip", z.ZodTypeAny, {
282
- via: "hud" | "link" | "connect";
331
+ via: "link" | "hud" | "connect";
283
332
  }, {
284
- via: "hud" | "link" | "connect";
333
+ via: "link" | "hud" | "connect";
285
334
  }>>;
286
335
  /** Only on `harness_run`. */
287
336
  harness: z.ZodOptional<z.ZodObject<{
@@ -321,19 +370,188 @@ export declare const SIGNAL_FIELDS: {
321
370
  readonly FOUR_NINE: "4-9";
322
371
  readonly TEN_PLUS: "10+";
323
372
  }>>;
373
+ /** Only on a `blocked` or `failed` run: why it did not drive. */
374
+ reason: z.ZodOptional<z.ZodNativeEnum<{
375
+ /** The project has no platform link, so there is nowhere to drive from. */
376
+ readonly NOT_LINKED: "not_linked";
377
+ /** The platform did not confirm the drive in time, or answered something unreadable. */
378
+ readonly PLATFORM_UNREACHABLE: "platform_unreachable";
379
+ /** The Harness is switched off for this project (the default until somebody turns it on). */
380
+ readonly HARNESS_OFF: "harness_off";
381
+ /** The workspace has no credits left. */
382
+ readonly NO_CREDITS: "no_credits";
383
+ /** The workspace has not claimed the Harness. */
384
+ readonly NOT_ENTITLED: "not_entitled";
385
+ /** An older build refused for low instrumentation. No longer sent: the Harness has no coverage gate. */
386
+ readonly COVERAGE_GATE: "coverage_gate";
387
+ /** The page and the daemon come from different builds, so every step would answer unknown. */
388
+ readonly VERSION_SKEW: "version_skew";
389
+ /** The drive started and broke. */
390
+ readonly BROKEN: "broken";
391
+ /** A refusal this list does not name. A growing count here is a gap in this list. */
392
+ readonly OTHER: "other";
393
+ }>>;
324
394
  }, "strip", z.ZodTypeAny, {
325
395
  source: "plan" | "agent" | "hud" | "dashboard" | "cli_try";
326
396
  phase: "completed" | "started";
327
397
  hosted: boolean;
398
+ reason?: "version_skew" | "other" | "not_linked" | "platform_unreachable" | "harness_off" | "no_credits" | "not_entitled" | "coverage_gate" | "broken" | undefined;
399
+ replayed?: "0" | "1" | "2-3" | "4-9" | "10+" | undefined;
328
400
  outcome?: "proved" | "failed" | "blocked" | "not_proved" | "stopped" | undefined;
329
401
  journeys?: "0" | "1" | "2-3" | "4-9" | "10+" | undefined;
330
- replayed?: "0" | "1" | "2-3" | "4-9" | "10+" | undefined;
331
402
  }, {
332
403
  source: "plan" | "agent" | "hud" | "dashboard" | "cli_try";
333
404
  phase: "completed" | "started";
334
405
  hosted: boolean;
406
+ reason?: "version_skew" | "other" | "not_linked" | "platform_unreachable" | "harness_off" | "no_credits" | "not_entitled" | "coverage_gate" | "broken" | undefined;
407
+ replayed?: "0" | "1" | "2-3" | "4-9" | "10+" | undefined;
335
408
  outcome?: "proved" | "failed" | "blocked" | "not_proved" | "stopped" | undefined;
336
409
  journeys?: "0" | "1" | "2-3" | "4-9" | "10+" | undefined;
337
- replayed?: "0" | "1" | "2-3" | "4-9" | "10+" | undefined;
410
+ }>>;
411
+ };
412
+ /**
413
+ * The socket error code behind a drop, as a closed set. Anything else reports `other`, so a new code
414
+ * cannot put free text on the wire.
415
+ */
416
+ export declare const OutageErrCode: {
417
+ readonly ECONNRESET: "ECONNRESET";
418
+ readonly ECONNREFUSED: "ECONNREFUSED";
419
+ readonly EPIPE: "EPIPE";
420
+ readonly ETIMEDOUT: "ETIMEDOUT";
421
+ readonly OTHER: "other";
422
+ };
423
+ export type OutageErrCode = (typeof OutageErrCode)[keyof typeof OutageErrCode];
424
+ /** Why the MCP proxy process left. Each member names one exit path in the proxy. */
425
+ export declare const ProxyExitReason: {
426
+ /** The client closed stdin. The normal end of a session. */
427
+ readonly STDIN_END: "stdin_end";
428
+ /** The client link was quiet for the idle window, with no work in flight. */
429
+ readonly IDLE: "idle";
430
+ /** Too many client-pipe disconnects since the last usable session: the client is gone. */
431
+ readonly CLIENT_GONE_STORM: "client_gone_storm";
432
+ /** The proxy could not start a daemon and had no way to continue. */
433
+ readonly WAKE_FAILED: "wake_failed";
434
+ };
435
+ export type ProxyExitReason = (typeof ProxyExitReason)[keyof typeof ProxyExitReason];
436
+ /** `mcp_proxy_exited`: the agent's MCP server process ended, and the agent lost its tools. */
437
+ export declare const ProxyExitSchema: z.ZodObject<{
438
+ reason: z.ZodNativeEnum<{
439
+ /** The client closed stdin. The normal end of a session. */
440
+ readonly STDIN_END: "stdin_end";
441
+ /** The client link was quiet for the idle window, with no work in flight. */
442
+ readonly IDLE: "idle";
443
+ /** Too many client-pipe disconnects since the last usable session: the client is gone. */
444
+ readonly CLIENT_GONE_STORM: "client_gone_storm";
445
+ /** The proxy could not start a daemon and had no way to continue. */
446
+ readonly WAKE_FAILED: "wake_failed";
447
+ }>;
448
+ /** How long the proxy process ran. */
449
+ uptimeMs: z.ZodNumber;
450
+ /** How many times the proxy lost its daemon stream in its life. */
451
+ drops: z.ZodNumber;
452
+ /** How many `tools/call` requests the client sent through this proxy. */
453
+ toolCalls: z.ZodNumber;
454
+ proxyId: z.ZodOptional<z.ZodString>;
455
+ }, "strip", z.ZodTypeAny, {
456
+ reason: "idle" | "stdin_end" | "client_gone_storm" | "wake_failed";
457
+ toolCalls: number;
458
+ uptimeMs: number;
459
+ drops: number;
460
+ proxyId?: string | undefined;
461
+ }, {
462
+ reason: "idle" | "stdin_end" | "client_gone_storm" | "wake_failed";
463
+ toolCalls: number;
464
+ uptimeMs: number;
465
+ drops: number;
466
+ proxyId?: string | undefined;
467
+ }>;
468
+ export type ProxyExit = z.infer<typeof ProxyExitSchema>;
469
+ /** `daemon_died_unclean`: a daemon start found the pidfile of a daemon that never stopped cleanly. */
470
+ export declare const DaemonDeathSchema: z.ZodObject<{
471
+ /** Time from the dead daemon's start (its pidfile write) to this discovery. */
472
+ ageMs: z.ZodNumber;
473
+ }, "strip", z.ZodTypeAny, {
474
+ ageMs: number;
475
+ }, {
476
+ ageMs: number;
477
+ }>;
478
+ export type DaemonDeath = z.infer<typeof DaemonDeathSchema>;
479
+ /** What held the port when a wake was refused. */
480
+ export declare const WakeRefusalPresence: {
481
+ /** Something that is not a Reticle daemon holds the port. */
482
+ readonly FOREIGN: "foreign";
483
+ /** A Reticle daemon for a different project holds the port. */
484
+ readonly OTHER_PROJECT: "other_project";
485
+ };
486
+ export type WakeRefusalPresence = (typeof WakeRefusalPresence)[keyof typeof WakeRefusalPresence];
487
+ /** `wake_refused`: the proxy would not use the daemon port it found. */
488
+ export declare const WakeRefusalSchema: z.ZodObject<{
489
+ presence: z.ZodNativeEnum<{
490
+ /** Something that is not a Reticle daemon holds the port. */
491
+ readonly FOREIGN: "foreign";
492
+ /** A Reticle daemon for a different project holds the port. */
493
+ readonly OTHER_PROJECT: "other_project";
494
+ }>;
495
+ }, "strip", z.ZodTypeAny, {
496
+ presence: "foreign" | "other_project";
497
+ }, {
498
+ presence: "foreign" | "other_project";
499
+ }>;
500
+ export type WakeRefusal = z.infer<typeof WakeRefusalSchema>;
501
+ /** The blocks this file adds to `TelemetryEventSchema`, spread into it there. */
502
+ export declare const TRANSPORT_FIELDS: {
503
+ /** Only on `mcp_proxy_exited`. */
504
+ proxyExit: z.ZodOptional<z.ZodObject<{
505
+ reason: z.ZodNativeEnum<{
506
+ /** The client closed stdin. The normal end of a session. */
507
+ readonly STDIN_END: "stdin_end";
508
+ /** The client link was quiet for the idle window, with no work in flight. */
509
+ readonly IDLE: "idle";
510
+ /** Too many client-pipe disconnects since the last usable session: the client is gone. */
511
+ readonly CLIENT_GONE_STORM: "client_gone_storm";
512
+ /** The proxy could not start a daemon and had no way to continue. */
513
+ readonly WAKE_FAILED: "wake_failed";
514
+ }>;
515
+ /** How long the proxy process ran. */
516
+ uptimeMs: z.ZodNumber;
517
+ /** How many times the proxy lost its daemon stream in its life. */
518
+ drops: z.ZodNumber;
519
+ /** How many `tools/call` requests the client sent through this proxy. */
520
+ toolCalls: z.ZodNumber;
521
+ proxyId: z.ZodOptional<z.ZodString>;
522
+ }, "strip", z.ZodTypeAny, {
523
+ reason: "idle" | "stdin_end" | "client_gone_storm" | "wake_failed";
524
+ toolCalls: number;
525
+ uptimeMs: number;
526
+ drops: number;
527
+ proxyId?: string | undefined;
528
+ }, {
529
+ reason: "idle" | "stdin_end" | "client_gone_storm" | "wake_failed";
530
+ toolCalls: number;
531
+ uptimeMs: number;
532
+ drops: number;
533
+ proxyId?: string | undefined;
534
+ }>>;
535
+ /** Only on `daemon_died_unclean`. */
536
+ daemonDeath: z.ZodOptional<z.ZodObject<{
537
+ /** Time from the dead daemon's start (its pidfile write) to this discovery. */
538
+ ageMs: z.ZodNumber;
539
+ }, "strip", z.ZodTypeAny, {
540
+ ageMs: number;
541
+ }, {
542
+ ageMs: number;
543
+ }>>;
544
+ /** Only on `wake_refused`. */
545
+ wakeRefusal: z.ZodOptional<z.ZodObject<{
546
+ presence: z.ZodNativeEnum<{
547
+ /** Something that is not a Reticle daemon holds the port. */
548
+ readonly FOREIGN: "foreign";
549
+ /** A Reticle daemon for a different project holds the port. */
550
+ readonly OTHER_PROJECT: "other_project";
551
+ }>;
552
+ }, "strip", z.ZodTypeAny, {
553
+ presence: "foreign" | "other_project";
554
+ }, {
555
+ presence: "foreign" | "other_project";
338
556
  }>>;
339
557
  };