@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.
- package/dist/artifacts/artifacts-entry.d.ts +2 -0
- package/dist/artifacts/artifacts-entry.js +2 -0
- package/dist/artifacts/drive-script.d.ts +158 -52
- package/dist/artifacts/drive-script.js +24 -1
- package/dist/artifacts/flow-constants.d.ts +18 -0
- package/dist/artifacts/flow-constants.js +20 -0
- package/dist/artifacts/flow-results.d.ts +450 -0
- package/dist/artifacts/flow-results.js +1 -0
- package/dist/artifacts/flow-types.d.ts +25 -437
- package/dist/artifacts/flow-types.js +5 -2
- package/dist/artifacts/harness-credits.d.ts +39 -0
- package/dist/artifacts/harness-credits.js +69 -0
- package/dist/artifacts/harness-map.d.ts +98 -0
- package/dist/artifacts/harness-map.js +36 -0
- package/dist/artifacts/impact.d.ts +354 -145
- package/dist/artifacts/impact.js +66 -48
- package/dist/artifacts/journal.d.ts +56 -5
- package/dist/artifacts/journal.js +26 -0
- package/dist/artifacts/screenshot-upload.d.ts +51 -0
- package/dist/artifacts/screenshot-upload.js +26 -0
- package/dist/hooks/hook-events.d.ts +4 -4
- package/dist/hud-entry.d.ts +1 -0
- package/dist/hud-entry.js +2 -0
- package/dist/index.d.ts +5 -0
- package/dist/index.js +5 -0
- package/dist/onboarding.d.ts +8 -0
- package/dist/onboarding.js +6 -0
- package/dist/realm/registry.js +19 -1
- package/dist/schema/command-message.json +30 -0
- package/dist/schema/command-name.json +3 -1
- package/dist/schema/event-payloads.json +40 -2
- package/dist/schema/reticle-message.json +30 -0
- package/dist/telemetry-bug.d.ts +169 -0
- package/dist/telemetry-bug.js +123 -0
- package/dist/telemetry-entry.d.ts +1 -0
- package/dist/telemetry-entry.js +1 -0
- package/dist/telemetry-feedback.d.ts +2 -2
- package/dist/telemetry-refusal.d.ts +2 -2
- package/dist/telemetry-session.d.ts +74 -0
- package/dist/telemetry-session.js +54 -0
- package/dist/telemetry-signals.d.ts +339 -0
- package/dist/telemetry-signals.js +138 -0
- package/dist/telemetry.d.ts +300 -254
- package/dist/telemetry.js +40 -115
- package/dist/verdict/disparity.d.ts +105 -0
- package/dist/verdict/disparity.js +40 -0
- package/dist/verdict/findings.d.ts +6 -0
- package/dist/verdict/findings.js +9 -0
- package/dist/verdict/instrumentation-coverage.d.ts +115 -0
- package/dist/verdict/instrumentation-coverage.js +226 -0
- package/dist/verdict/instrumentation-gap.js +1 -1
- package/dist/verdict/intent.d.ts +19 -5
- package/dist/verdict/intent.js +13 -1
- package/dist/verdict/predicate-tree.d.ts +15 -0
- package/dist/verdict/predicate-tree.js +21 -0
- package/dist/verdict/predicate.d.ts +14 -0
- package/dist/verdict/predicate.js +87 -3
- package/dist/verdict/security.d.ts +25 -0
- package/dist/verdict/security.js +82 -0
- package/dist/verdict/verification-run.d.ts +620 -32
- package/dist/verdict/verification-run.js +82 -0
- package/dist/wire/constants/constants.d.ts +15 -16
- package/dist/wire/constants/constants.js +16 -17
- package/dist/wire/constants/hud-controls.js +17 -5
- package/dist/wire/constants/hud-use.d.ts +29 -4
- package/dist/wire/constants/hud-use.js +26 -4
- package/dist/wire/constants/mcp-wire.d.ts +10 -0
- package/dist/wire/constants/mcp-wire.js +10 -0
- package/dist/wire/constants/reticle-chrome.d.ts +19 -0
- package/dist/wire/constants/reticle-chrome.js +19 -0
- package/dist/wire/constants/session-constants.d.ts +15 -2
- package/dist/wire/constants/session-constants.js +15 -2
- package/dist/wire/desktop-contract.d.ts +8 -0
- package/dist/wire/desktop-contract.js +11 -0
- package/dist/wire/event-payloads.d.ts +56 -4
- package/dist/wire/event-payloads.js +17 -0
- package/dist/wire/messages.d.ts +105 -32
- package/dist/wire/messages.js +9 -1
- package/dist/wire/platform-link.d.ts +77 -0
- package/dist/wire/platform-link.js +45 -0
- package/dist/wire/tool-names.d.ts +2 -0
- package/dist/wire/tool-names.js +2 -0
- package/dist/wire/types.d.ts +19 -6
- package/dist/wire/types.js +5 -0
- package/dist/words/notices.d.ts +1 -1
- package/dist/words/notices.js +1 -1
- package/dist/words/upgrade.js +1 -1
- package/dist/words/writing-rule.d.ts +14 -0
- package/dist/words/writing-rule.js +17 -0
- package/package.json +1 -1
|
@@ -0,0 +1,339 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The product signals the event set could not answer: who is signed in, which workspace and which
|
|
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.
|
|
5
|
+
*
|
|
6
|
+
* Its own file so the vocabulary has one home and `telemetry.ts` only wires it in. Every value here is
|
|
7
|
+
* a closed set, a boolean or a bucket: none of these fields can carry a URL, a path, a name or text.
|
|
8
|
+
*/
|
|
9
|
+
import { z } from 'zod';
|
|
10
|
+
/**
|
|
11
|
+
* Where this machine stands with the platform, on every event. `linked` implies signed in OR an
|
|
12
|
+
* api key in the environment: a project with a working link reports to a workspace either way.
|
|
13
|
+
*/
|
|
14
|
+
export declare const TelemetryAccountState: {
|
|
15
|
+
readonly SIGNED_OUT: "signed_out";
|
|
16
|
+
readonly SIGNED_IN: "signed_in";
|
|
17
|
+
readonly LINKED: "linked";
|
|
18
|
+
};
|
|
19
|
+
export type TelemetryAccountState = (typeof TelemetryAccountState)[keyof typeof TelemetryAccountState];
|
|
20
|
+
/**
|
|
21
|
+
* Which coding agent an event came from, normalised from the MCP handshake's `clientInfo.name`, else
|
|
22
|
+
* from a marker the agent sets in the environment of what it spawns. `other` is a client that named
|
|
23
|
+
* itself and is not on this list; absent means nothing said.
|
|
24
|
+
*/
|
|
25
|
+
export declare const AgentClient: {
|
|
26
|
+
readonly CLAUDE_CODE: "claude_code";
|
|
27
|
+
readonly CLAUDE_DESKTOP: "claude_desktop";
|
|
28
|
+
readonly CODEX: "codex";
|
|
29
|
+
readonly CURSOR: "cursor";
|
|
30
|
+
readonly GEMINI_CLI: "gemini_cli";
|
|
31
|
+
readonly ANTIGRAVITY: "antigravity";
|
|
32
|
+
readonly WINDSURF: "windsurf";
|
|
33
|
+
readonly CLINE: "cline";
|
|
34
|
+
readonly OPENCODE: "opencode";
|
|
35
|
+
readonly ZED: "zed";
|
|
36
|
+
readonly VSCODE: "vscode";
|
|
37
|
+
readonly OTHER: "other";
|
|
38
|
+
};
|
|
39
|
+
export type AgentClient = (typeof AgentClient)[keyof typeof AgentClient];
|
|
40
|
+
/**
|
|
41
|
+
* How the running `reticle` was launched, read from where its own entry script sits: an npx cache,
|
|
42
|
+
* a global install, or a project's `node_modules`. Only the bucket leaves the machine, never the path.
|
|
43
|
+
* It is not the install CHANNEL (`installSource`): every channel can end in any of these.
|
|
44
|
+
*/
|
|
45
|
+
export declare const LaunchMethod: {
|
|
46
|
+
readonly NPX: "npx";
|
|
47
|
+
readonly GLOBAL: "global";
|
|
48
|
+
readonly PROJECT: "project";
|
|
49
|
+
readonly OTHER: "other";
|
|
50
|
+
};
|
|
51
|
+
export type LaunchMethod = (typeof LaunchMethod)[keyof typeof LaunchMethod];
|
|
52
|
+
/** A count, bucketed: an exact number of tabs or journeys starts to describe one app. */
|
|
53
|
+
export declare const CountBucket: {
|
|
54
|
+
readonly ZERO: "0";
|
|
55
|
+
readonly ONE: "1";
|
|
56
|
+
readonly TWO_THREE: "2-3";
|
|
57
|
+
readonly FOUR_NINE: "4-9";
|
|
58
|
+
readonly TEN_PLUS: "10+";
|
|
59
|
+
};
|
|
60
|
+
export type CountBucket = (typeof CountBucket)[keyof typeof CountBucket];
|
|
61
|
+
export declare function countBucket(n: number): CountBucket;
|
|
62
|
+
/** `hud_viewed` / `hud_signin_prompted`: which page or prompt, and how many tabs had a HUD. */
|
|
63
|
+
export declare const HudEventSchema: z.ZodObject<{
|
|
64
|
+
view: z.ZodOptional<z.ZodNativeEnum<{
|
|
65
|
+
readonly CHAT: "chat";
|
|
66
|
+
readonly FLOWS: "flows";
|
|
67
|
+
readonly NOTES: "notes";
|
|
68
|
+
readonly HARNESS: "harness";
|
|
69
|
+
readonly SETTINGS: "settings";
|
|
70
|
+
readonly REPORT: "report";
|
|
71
|
+
readonly ACCOUNT: "account";
|
|
72
|
+
readonly NONE: "none";
|
|
73
|
+
}>>;
|
|
74
|
+
surface: z.ZodOptional<z.ZodNativeEnum<{
|
|
75
|
+
readonly RAIL: "rail";
|
|
76
|
+
readonly HARNESS: "harness";
|
|
77
|
+
readonly HEADER: "header";
|
|
78
|
+
}>>;
|
|
79
|
+
tabs: z.ZodOptional<z.ZodNativeEnum<{
|
|
80
|
+
readonly ZERO: "0";
|
|
81
|
+
readonly ONE: "1";
|
|
82
|
+
readonly TWO_THREE: "2-3";
|
|
83
|
+
readonly FOUR_NINE: "4-9";
|
|
84
|
+
readonly TEN_PLUS: "10+";
|
|
85
|
+
}>>;
|
|
86
|
+
}, "strip", z.ZodTypeAny, {
|
|
87
|
+
surface?: "harness" | "rail" | "header" | undefined;
|
|
88
|
+
view?: "flows" | "harness" | "none" | "chat" | "notes" | "settings" | "report" | "account" | undefined;
|
|
89
|
+
tabs?: "0" | "1" | "2-3" | "4-9" | "10+" | undefined;
|
|
90
|
+
}, {
|
|
91
|
+
surface?: "harness" | "rail" | "header" | undefined;
|
|
92
|
+
view?: "flows" | "harness" | "none" | "chat" | "notes" | "settings" | "report" | "account" | undefined;
|
|
93
|
+
tabs?: "0" | "1" | "2-3" | "4-9" | "10+" | undefined;
|
|
94
|
+
}>;
|
|
95
|
+
export type HudEvent = z.infer<typeof HudEventSchema>;
|
|
96
|
+
/** How a project got linked to a workspace on this machine. */
|
|
97
|
+
export declare const PlatformLinkVia: {
|
|
98
|
+
/** `reticle connect`: sign in, link and sync in one command. */
|
|
99
|
+
readonly CONNECT: "connect";
|
|
100
|
+
/** The HUD's "Link this project" / "Save runs for your team". */
|
|
101
|
+
readonly HUD: "hud";
|
|
102
|
+
/** A bare `reticle link`. */
|
|
103
|
+
readonly LINK: "link";
|
|
104
|
+
};
|
|
105
|
+
export type PlatformLinkVia = (typeof PlatformLinkVia)[keyof typeof PlatformLinkVia];
|
|
106
|
+
export declare const PlatformLinkSchema: z.ZodObject<{
|
|
107
|
+
via: z.ZodNativeEnum<{
|
|
108
|
+
/** `reticle connect`: sign in, link and sync in one command. */
|
|
109
|
+
readonly CONNECT: "connect";
|
|
110
|
+
/** The HUD's "Link this project" / "Save runs for your team". */
|
|
111
|
+
readonly HUD: "hud";
|
|
112
|
+
/** A bare `reticle link`. */
|
|
113
|
+
readonly LINK: "link";
|
|
114
|
+
}>;
|
|
115
|
+
}, "strip", z.ZodTypeAny, {
|
|
116
|
+
via: "hud" | "link" | "connect";
|
|
117
|
+
}, {
|
|
118
|
+
via: "hud" | "link" | "connect";
|
|
119
|
+
}>;
|
|
120
|
+
export type PlatformLink = z.infer<typeof PlatformLinkSchema>;
|
|
121
|
+
export declare const HarnessRunPhase: {
|
|
122
|
+
readonly STARTED: "started";
|
|
123
|
+
readonly COMPLETED: "completed";
|
|
124
|
+
};
|
|
125
|
+
export type HarnessRunPhase = (typeof HarnessRunPhase)[keyof typeof HarnessRunPhase];
|
|
126
|
+
/** How a Harness run ended. `blocked` is a refusal before it drove (gate, credits, switched off). */
|
|
127
|
+
export declare const HarnessRunOutcome: {
|
|
128
|
+
readonly PROVED: "proved";
|
|
129
|
+
readonly NOT_PROVED: "not_proved";
|
|
130
|
+
readonly FAILED: "failed";
|
|
131
|
+
readonly BLOCKED: "blocked";
|
|
132
|
+
readonly STOPPED: "stopped";
|
|
133
|
+
};
|
|
134
|
+
export type HarnessRunOutcome = (typeof HarnessRunOutcome)[keyof typeof HarnessRunOutcome];
|
|
135
|
+
/** Who started a Harness run. `dashboard` is a run started from the platform's chat. */
|
|
136
|
+
export declare const HarnessRunSource: {
|
|
137
|
+
readonly AGENT: "agent";
|
|
138
|
+
readonly HUD: "hud";
|
|
139
|
+
readonly DASHBOARD: "dashboard";
|
|
140
|
+
readonly CLI_TRY: "cli_try";
|
|
141
|
+
readonly PLAN: "plan";
|
|
142
|
+
};
|
|
143
|
+
export type HarnessRunSource = (typeof HarnessRunSource)[keyof typeof HarnessRunSource];
|
|
144
|
+
/** `harness_run`: one `started` and one `completed` per run. */
|
|
145
|
+
export declare const HarnessRunSchema: z.ZodObject<{
|
|
146
|
+
phase: z.ZodNativeEnum<{
|
|
147
|
+
readonly STARTED: "started";
|
|
148
|
+
readonly COMPLETED: "completed";
|
|
149
|
+
}>;
|
|
150
|
+
source: z.ZodNativeEnum<{
|
|
151
|
+
readonly AGENT: "agent";
|
|
152
|
+
readonly HUD: "hud";
|
|
153
|
+
readonly DASHBOARD: "dashboard";
|
|
154
|
+
readonly CLI_TRY: "cli_try";
|
|
155
|
+
readonly PLAN: "plan";
|
|
156
|
+
}>;
|
|
157
|
+
/** The run drives on the platform (always, today), as opposed to an injected local driver. */
|
|
158
|
+
hosted: z.ZodBoolean;
|
|
159
|
+
/** Only on `completed`. */
|
|
160
|
+
outcome: z.ZodOptional<z.ZodNativeEnum<{
|
|
161
|
+
readonly PROVED: "proved";
|
|
162
|
+
readonly NOT_PROVED: "not_proved";
|
|
163
|
+
readonly FAILED: "failed";
|
|
164
|
+
readonly BLOCKED: "blocked";
|
|
165
|
+
readonly STOPPED: "stopped";
|
|
166
|
+
}>>;
|
|
167
|
+
/** Only on `completed`: journeys the run answered, and how many of those replayed with no model. */
|
|
168
|
+
journeys: z.ZodOptional<z.ZodNativeEnum<{
|
|
169
|
+
readonly ZERO: "0";
|
|
170
|
+
readonly ONE: "1";
|
|
171
|
+
readonly TWO_THREE: "2-3";
|
|
172
|
+
readonly FOUR_NINE: "4-9";
|
|
173
|
+
readonly TEN_PLUS: "10+";
|
|
174
|
+
}>>;
|
|
175
|
+
replayed: z.ZodOptional<z.ZodNativeEnum<{
|
|
176
|
+
readonly ZERO: "0";
|
|
177
|
+
readonly ONE: "1";
|
|
178
|
+
readonly TWO_THREE: "2-3";
|
|
179
|
+
readonly FOUR_NINE: "4-9";
|
|
180
|
+
readonly TEN_PLUS: "10+";
|
|
181
|
+
}>>;
|
|
182
|
+
}, "strip", z.ZodTypeAny, {
|
|
183
|
+
source: "plan" | "agent" | "hud" | "dashboard" | "cli_try";
|
|
184
|
+
phase: "completed" | "started";
|
|
185
|
+
hosted: boolean;
|
|
186
|
+
outcome?: "proved" | "failed" | "blocked" | "not_proved" | "stopped" | undefined;
|
|
187
|
+
journeys?: "0" | "1" | "2-3" | "4-9" | "10+" | undefined;
|
|
188
|
+
replayed?: "0" | "1" | "2-3" | "4-9" | "10+" | undefined;
|
|
189
|
+
}, {
|
|
190
|
+
source: "plan" | "agent" | "hud" | "dashboard" | "cli_try";
|
|
191
|
+
phase: "completed" | "started";
|
|
192
|
+
hosted: boolean;
|
|
193
|
+
outcome?: "proved" | "failed" | "blocked" | "not_proved" | "stopped" | undefined;
|
|
194
|
+
journeys?: "0" | "1" | "2-3" | "4-9" | "10+" | undefined;
|
|
195
|
+
replayed?: "0" | "1" | "2-3" | "4-9" | "10+" | undefined;
|
|
196
|
+
}>;
|
|
197
|
+
export type HarnessRun = z.infer<typeof HarnessRunSchema>;
|
|
198
|
+
/**
|
|
199
|
+
* The envelope fields and blocks this file adds to `TelemetryEventSchema`, spread into it there.
|
|
200
|
+
* Every one optional: an older sender has none of them.
|
|
201
|
+
*/
|
|
202
|
+
export declare const SIGNAL_FIELDS: {
|
|
203
|
+
/** Signed out, signed in, or signed in AND this project linked to a workspace. */
|
|
204
|
+
accountState: z.ZodOptional<z.ZodNativeEnum<{
|
|
205
|
+
readonly SIGNED_OUT: "signed_out";
|
|
206
|
+
readonly SIGNED_IN: "signed_in";
|
|
207
|
+
readonly LINKED: "linked";
|
|
208
|
+
}>>;
|
|
209
|
+
/** This project reports to a workspace. */
|
|
210
|
+
linked: z.ZodOptional<z.ZodBoolean>;
|
|
211
|
+
/**
|
|
212
|
+
* The platform's id for the linked workspace (`orgId` in `.reticle/cloud.json`): a pseudonymous
|
|
213
|
+
* key the platform joins its own records on. Never the workspace NAME, never an email.
|
|
214
|
+
*/
|
|
215
|
+
workspaceId: z.ZodOptional<z.ZodString>;
|
|
216
|
+
/** Which coding agent this event came from, normalised. Absent when nothing said. */
|
|
217
|
+
client: z.ZodOptional<z.ZodNativeEnum<{
|
|
218
|
+
readonly CLAUDE_CODE: "claude_code";
|
|
219
|
+
readonly CLAUDE_DESKTOP: "claude_desktop";
|
|
220
|
+
readonly CODEX: "codex";
|
|
221
|
+
readonly CURSOR: "cursor";
|
|
222
|
+
readonly GEMINI_CLI: "gemini_cli";
|
|
223
|
+
readonly ANTIGRAVITY: "antigravity";
|
|
224
|
+
readonly WINDSURF: "windsurf";
|
|
225
|
+
readonly CLINE: "cline";
|
|
226
|
+
readonly OPENCODE: "opencode";
|
|
227
|
+
readonly ZED: "zed";
|
|
228
|
+
readonly VSCODE: "vscode";
|
|
229
|
+
readonly OTHER: "other";
|
|
230
|
+
}>>;
|
|
231
|
+
/** How the running `reticle` was launched. */
|
|
232
|
+
launch: z.ZodOptional<z.ZodNativeEnum<{
|
|
233
|
+
readonly NPX: "npx";
|
|
234
|
+
readonly GLOBAL: "global";
|
|
235
|
+
readonly PROJECT: "project";
|
|
236
|
+
readonly OTHER: "other";
|
|
237
|
+
}>>;
|
|
238
|
+
/** Only on `hud_viewed` / `hud_signin_prompted`. */
|
|
239
|
+
hud: z.ZodOptional<z.ZodObject<{
|
|
240
|
+
view: z.ZodOptional<z.ZodNativeEnum<{
|
|
241
|
+
readonly CHAT: "chat";
|
|
242
|
+
readonly FLOWS: "flows";
|
|
243
|
+
readonly NOTES: "notes";
|
|
244
|
+
readonly HARNESS: "harness";
|
|
245
|
+
readonly SETTINGS: "settings";
|
|
246
|
+
readonly REPORT: "report";
|
|
247
|
+
readonly ACCOUNT: "account";
|
|
248
|
+
readonly NONE: "none";
|
|
249
|
+
}>>;
|
|
250
|
+
surface: z.ZodOptional<z.ZodNativeEnum<{
|
|
251
|
+
readonly RAIL: "rail";
|
|
252
|
+
readonly HARNESS: "harness";
|
|
253
|
+
readonly HEADER: "header";
|
|
254
|
+
}>>;
|
|
255
|
+
tabs: z.ZodOptional<z.ZodNativeEnum<{
|
|
256
|
+
readonly ZERO: "0";
|
|
257
|
+
readonly ONE: "1";
|
|
258
|
+
readonly TWO_THREE: "2-3";
|
|
259
|
+
readonly FOUR_NINE: "4-9";
|
|
260
|
+
readonly TEN_PLUS: "10+";
|
|
261
|
+
}>>;
|
|
262
|
+
}, "strip", z.ZodTypeAny, {
|
|
263
|
+
surface?: "harness" | "rail" | "header" | undefined;
|
|
264
|
+
view?: "flows" | "harness" | "none" | "chat" | "notes" | "settings" | "report" | "account" | undefined;
|
|
265
|
+
tabs?: "0" | "1" | "2-3" | "4-9" | "10+" | undefined;
|
|
266
|
+
}, {
|
|
267
|
+
surface?: "harness" | "rail" | "header" | undefined;
|
|
268
|
+
view?: "flows" | "harness" | "none" | "chat" | "notes" | "settings" | "report" | "account" | undefined;
|
|
269
|
+
tabs?: "0" | "1" | "2-3" | "4-9" | "10+" | undefined;
|
|
270
|
+
}>>;
|
|
271
|
+
/** Only on `platform_linked`. */
|
|
272
|
+
link: z.ZodOptional<z.ZodObject<{
|
|
273
|
+
via: z.ZodNativeEnum<{
|
|
274
|
+
/** `reticle connect`: sign in, link and sync in one command. */
|
|
275
|
+
readonly CONNECT: "connect";
|
|
276
|
+
/** The HUD's "Link this project" / "Save runs for your team". */
|
|
277
|
+
readonly HUD: "hud";
|
|
278
|
+
/** A bare `reticle link`. */
|
|
279
|
+
readonly LINK: "link";
|
|
280
|
+
}>;
|
|
281
|
+
}, "strip", z.ZodTypeAny, {
|
|
282
|
+
via: "hud" | "link" | "connect";
|
|
283
|
+
}, {
|
|
284
|
+
via: "hud" | "link" | "connect";
|
|
285
|
+
}>>;
|
|
286
|
+
/** Only on `harness_run`. */
|
|
287
|
+
harness: z.ZodOptional<z.ZodObject<{
|
|
288
|
+
phase: z.ZodNativeEnum<{
|
|
289
|
+
readonly STARTED: "started";
|
|
290
|
+
readonly COMPLETED: "completed";
|
|
291
|
+
}>;
|
|
292
|
+
source: z.ZodNativeEnum<{
|
|
293
|
+
readonly AGENT: "agent";
|
|
294
|
+
readonly HUD: "hud";
|
|
295
|
+
readonly DASHBOARD: "dashboard";
|
|
296
|
+
readonly CLI_TRY: "cli_try";
|
|
297
|
+
readonly PLAN: "plan";
|
|
298
|
+
}>;
|
|
299
|
+
/** The run drives on the platform (always, today), as opposed to an injected local driver. */
|
|
300
|
+
hosted: z.ZodBoolean;
|
|
301
|
+
/** Only on `completed`. */
|
|
302
|
+
outcome: z.ZodOptional<z.ZodNativeEnum<{
|
|
303
|
+
readonly PROVED: "proved";
|
|
304
|
+
readonly NOT_PROVED: "not_proved";
|
|
305
|
+
readonly FAILED: "failed";
|
|
306
|
+
readonly BLOCKED: "blocked";
|
|
307
|
+
readonly STOPPED: "stopped";
|
|
308
|
+
}>>;
|
|
309
|
+
/** Only on `completed`: journeys the run answered, and how many of those replayed with no model. */
|
|
310
|
+
journeys: z.ZodOptional<z.ZodNativeEnum<{
|
|
311
|
+
readonly ZERO: "0";
|
|
312
|
+
readonly ONE: "1";
|
|
313
|
+
readonly TWO_THREE: "2-3";
|
|
314
|
+
readonly FOUR_NINE: "4-9";
|
|
315
|
+
readonly TEN_PLUS: "10+";
|
|
316
|
+
}>>;
|
|
317
|
+
replayed: z.ZodOptional<z.ZodNativeEnum<{
|
|
318
|
+
readonly ZERO: "0";
|
|
319
|
+
readonly ONE: "1";
|
|
320
|
+
readonly TWO_THREE: "2-3";
|
|
321
|
+
readonly FOUR_NINE: "4-9";
|
|
322
|
+
readonly TEN_PLUS: "10+";
|
|
323
|
+
}>>;
|
|
324
|
+
}, "strip", z.ZodTypeAny, {
|
|
325
|
+
source: "plan" | "agent" | "hud" | "dashboard" | "cli_try";
|
|
326
|
+
phase: "completed" | "started";
|
|
327
|
+
hosted: boolean;
|
|
328
|
+
outcome?: "proved" | "failed" | "blocked" | "not_proved" | "stopped" | undefined;
|
|
329
|
+
journeys?: "0" | "1" | "2-3" | "4-9" | "10+" | undefined;
|
|
330
|
+
replayed?: "0" | "1" | "2-3" | "4-9" | "10+" | undefined;
|
|
331
|
+
}, {
|
|
332
|
+
source: "plan" | "agent" | "hud" | "dashboard" | "cli_try";
|
|
333
|
+
phase: "completed" | "started";
|
|
334
|
+
hosted: boolean;
|
|
335
|
+
outcome?: "proved" | "failed" | "blocked" | "not_proved" | "stopped" | undefined;
|
|
336
|
+
journeys?: "0" | "1" | "2-3" | "4-9" | "10+" | undefined;
|
|
337
|
+
replayed?: "0" | "1" | "2-3" | "4-9" | "10+" | undefined;
|
|
338
|
+
}>>;
|
|
339
|
+
};
|
|
@@ -0,0 +1,138 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The product signals the event set could not answer: who is signed in, which workspace and which
|
|
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.
|
|
5
|
+
*
|
|
6
|
+
* Its own file so the vocabulary has one home and `telemetry.ts` only wires it in. Every value here is
|
|
7
|
+
* a closed set, a boolean or a bucket: none of these fields can carry a URL, a path, a name or text.
|
|
8
|
+
*/
|
|
9
|
+
import { z } from 'zod';
|
|
10
|
+
import { HudPanel, HudPromptSurface } from './wire/constants/hud-use.js';
|
|
11
|
+
/**
|
|
12
|
+
* Where this machine stands with the platform, on every event. `linked` implies signed in OR an
|
|
13
|
+
* api key in the environment: a project with a working link reports to a workspace either way.
|
|
14
|
+
*/
|
|
15
|
+
export const TelemetryAccountState = {
|
|
16
|
+
SIGNED_OUT: 'signed_out',
|
|
17
|
+
SIGNED_IN: 'signed_in',
|
|
18
|
+
LINKED: 'linked',
|
|
19
|
+
};
|
|
20
|
+
/**
|
|
21
|
+
* Which coding agent an event came from, normalised from the MCP handshake's `clientInfo.name`, else
|
|
22
|
+
* from a marker the agent sets in the environment of what it spawns. `other` is a client that named
|
|
23
|
+
* itself and is not on this list; absent means nothing said.
|
|
24
|
+
*/
|
|
25
|
+
export const AgentClient = {
|
|
26
|
+
CLAUDE_CODE: 'claude_code',
|
|
27
|
+
CLAUDE_DESKTOP: 'claude_desktop',
|
|
28
|
+
CODEX: 'codex',
|
|
29
|
+
CURSOR: 'cursor',
|
|
30
|
+
GEMINI_CLI: 'gemini_cli',
|
|
31
|
+
ANTIGRAVITY: 'antigravity',
|
|
32
|
+
WINDSURF: 'windsurf',
|
|
33
|
+
CLINE: 'cline',
|
|
34
|
+
OPENCODE: 'opencode',
|
|
35
|
+
ZED: 'zed',
|
|
36
|
+
VSCODE: 'vscode',
|
|
37
|
+
OTHER: 'other',
|
|
38
|
+
};
|
|
39
|
+
/**
|
|
40
|
+
* How the running `reticle` was launched, read from where its own entry script sits: an npx cache,
|
|
41
|
+
* a global install, or a project's `node_modules`. Only the bucket leaves the machine, never the path.
|
|
42
|
+
* It is not the install CHANNEL (`installSource`): every channel can end in any of these.
|
|
43
|
+
*/
|
|
44
|
+
export const LaunchMethod = {
|
|
45
|
+
NPX: 'npx',
|
|
46
|
+
GLOBAL: 'global',
|
|
47
|
+
PROJECT: 'project',
|
|
48
|
+
OTHER: 'other',
|
|
49
|
+
};
|
|
50
|
+
/** A count, bucketed: an exact number of tabs or journeys starts to describe one app. */
|
|
51
|
+
export const CountBucket = {
|
|
52
|
+
ZERO: '0',
|
|
53
|
+
ONE: '1',
|
|
54
|
+
TWO_THREE: '2-3',
|
|
55
|
+
FOUR_NINE: '4-9',
|
|
56
|
+
TEN_PLUS: '10+',
|
|
57
|
+
};
|
|
58
|
+
export function countBucket(n) {
|
|
59
|
+
if (n <= 0)
|
|
60
|
+
return CountBucket.ZERO;
|
|
61
|
+
if (1 === n)
|
|
62
|
+
return CountBucket.ONE;
|
|
63
|
+
if (n <= 3)
|
|
64
|
+
return CountBucket.TWO_THREE;
|
|
65
|
+
if (n <= 9)
|
|
66
|
+
return CountBucket.FOUR_NINE;
|
|
67
|
+
return CountBucket.TEN_PLUS;
|
|
68
|
+
}
|
|
69
|
+
/** `hud_viewed` / `hud_signin_prompted`: which page or prompt, and how many tabs had a HUD. */
|
|
70
|
+
export const HudEventSchema = z.object({
|
|
71
|
+
view: z.nativeEnum(HudPanel).optional(),
|
|
72
|
+
surface: z.nativeEnum(HudPromptSurface).optional(),
|
|
73
|
+
tabs: z.nativeEnum(CountBucket).optional(),
|
|
74
|
+
});
|
|
75
|
+
/** How a project got linked to a workspace on this machine. */
|
|
76
|
+
export const PlatformLinkVia = {
|
|
77
|
+
/** `reticle connect`: sign in, link and sync in one command. */
|
|
78
|
+
CONNECT: 'connect',
|
|
79
|
+
/** The HUD's "Link this project" / "Save runs for your team". */
|
|
80
|
+
HUD: 'hud',
|
|
81
|
+
/** A bare `reticle link`. */
|
|
82
|
+
LINK: 'link',
|
|
83
|
+
};
|
|
84
|
+
export const PlatformLinkSchema = z.object({ via: z.nativeEnum(PlatformLinkVia) });
|
|
85
|
+
export const HarnessRunPhase = { STARTED: 'started', COMPLETED: 'completed' };
|
|
86
|
+
/** How a Harness run ended. `blocked` is a refusal before it drove (gate, credits, switched off). */
|
|
87
|
+
export const HarnessRunOutcome = {
|
|
88
|
+
PROVED: 'proved',
|
|
89
|
+
NOT_PROVED: 'not_proved',
|
|
90
|
+
FAILED: 'failed',
|
|
91
|
+
BLOCKED: 'blocked',
|
|
92
|
+
STOPPED: 'stopped',
|
|
93
|
+
};
|
|
94
|
+
/** Who started a Harness run. `dashboard` is a run started from the platform's chat. */
|
|
95
|
+
export const HarnessRunSource = {
|
|
96
|
+
AGENT: 'agent',
|
|
97
|
+
HUD: 'hud',
|
|
98
|
+
DASHBOARD: 'dashboard',
|
|
99
|
+
CLI_TRY: 'cli_try',
|
|
100
|
+
PLAN: 'plan',
|
|
101
|
+
};
|
|
102
|
+
/** `harness_run`: one `started` and one `completed` per run. */
|
|
103
|
+
export const HarnessRunSchema = z.object({
|
|
104
|
+
phase: z.nativeEnum(HarnessRunPhase),
|
|
105
|
+
source: z.nativeEnum(HarnessRunSource),
|
|
106
|
+
/** The run drives on the platform (always, today), as opposed to an injected local driver. */
|
|
107
|
+
hosted: z.boolean(),
|
|
108
|
+
/** Only on `completed`. */
|
|
109
|
+
outcome: z.nativeEnum(HarnessRunOutcome).optional(),
|
|
110
|
+
/** Only on `completed`: journeys the run answered, and how many of those replayed with no model. */
|
|
111
|
+
journeys: z.nativeEnum(CountBucket).optional(),
|
|
112
|
+
replayed: z.nativeEnum(CountBucket).optional(),
|
|
113
|
+
});
|
|
114
|
+
/**
|
|
115
|
+
* The envelope fields and blocks this file adds to `TelemetryEventSchema`, spread into it there.
|
|
116
|
+
* Every one optional: an older sender has none of them.
|
|
117
|
+
*/
|
|
118
|
+
export const SIGNAL_FIELDS = {
|
|
119
|
+
/** Signed out, signed in, or signed in AND this project linked to a workspace. */
|
|
120
|
+
accountState: z.nativeEnum(TelemetryAccountState).optional(),
|
|
121
|
+
/** This project reports to a workspace. */
|
|
122
|
+
linked: z.boolean().optional(),
|
|
123
|
+
/**
|
|
124
|
+
* The platform's id for the linked workspace (`orgId` in `.reticle/cloud.json`): a pseudonymous
|
|
125
|
+
* key the platform joins its own records on. Never the workspace NAME, never an email.
|
|
126
|
+
*/
|
|
127
|
+
workspaceId: z.string().min(1).max(128).optional(),
|
|
128
|
+
/** Which coding agent this event came from, normalised. Absent when nothing said. */
|
|
129
|
+
client: z.nativeEnum(AgentClient).optional(),
|
|
130
|
+
/** How the running `reticle` was launched. */
|
|
131
|
+
launch: z.nativeEnum(LaunchMethod).optional(),
|
|
132
|
+
/** Only on `hud_viewed` / `hud_signin_prompted`. */
|
|
133
|
+
hud: HudEventSchema.optional(),
|
|
134
|
+
/** Only on `platform_linked`. */
|
|
135
|
+
link: PlatformLinkSchema.optional(),
|
|
136
|
+
/** Only on `harness_run`. */
|
|
137
|
+
harness: HarnessRunSchema.optional(),
|
|
138
|
+
};
|