@reticlehq/core 3.6.0 → 3.8.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/activation-entry.d.ts +9 -0
- package/dist/activation-entry.js +9 -0
- package/dist/artifacts/artifacts-entry.d.ts +2 -0
- package/dist/artifacts/artifacts-entry.js +2 -0
- package/dist/artifacts/drive-script.d.ts +222 -116
- package/dist/artifacts/drive-script.js +24 -1
- package/dist/artifacts/flow-constants.d.ts +33 -0
- package/dist/artifacts/flow-constants.js +35 -0
- package/dist/artifacts/flow-expect-flat.d.ts +8 -8
- package/dist/artifacts/flow-results.d.ts +461 -0
- package/dist/artifacts/flow-results.js +1 -0
- package/dist/artifacts/flow-types.d.ts +177 -543
- package/dist/artifacts/flow-types.js +17 -2
- package/dist/artifacts/harness-credits.d.ts +42 -0
- package/dist/artifacts/harness-credits.js +72 -0
- package/dist/artifacts/harness-map.d.ts +98 -0
- package/dist/artifacts/harness-map.js +36 -0
- package/dist/artifacts/impact.d.ts +355 -149
- package/dist/artifacts/impact.js +84 -49
- package/dist/artifacts/journal.d.ts +81 -11
- package/dist/artifacts/journal.js +39 -0
- package/dist/artifacts/prompt-context.d.ts +12 -0
- package/dist/artifacts/prompt-context.js +14 -3
- package/dist/artifacts/screenshot-upload.d.ts +51 -0
- package/dist/artifacts/screenshot-upload.js +26 -0
- package/dist/graph/app-graph.d.ts +137 -0
- package/dist/graph/app-graph.js +498 -0
- package/dist/hooks/hook-events.d.ts +26 -26
- package/dist/hud-entry.d.ts +1 -0
- package/dist/hud-entry.js +2 -0
- package/dist/identity/checkout.d.ts +41 -0
- package/dist/identity/checkout.js +118 -0
- package/dist/identity/state-dir.d.ts +23 -0
- package/dist/identity/state-dir.js +43 -0
- package/dist/index.d.ts +15 -0
- package/dist/index.js +15 -0
- package/dist/onboarding.d.ts +30 -1
- package/dist/onboarding.js +25 -0
- package/dist/realm/registry.js +19 -1
- package/dist/registry/dev-server-registry.d.ts +2 -2
- package/dist/schema/command-message.json +30 -0
- package/dist/schema/command-name.json +3 -1
- package/dist/schema/event-message.json +3 -1
- package/dist/schema/event-payloads.json +156 -3
- package/dist/schema/event-type.json +3 -1
- package/dist/schema/hello-message.json +21 -0
- package/dist/schema/reticle-event.json +3 -1
- package/dist/schema/reticle-message.json +54 -1
- package/dist/telemetry-bug.d.ts +169 -0
- package/dist/telemetry-bug.js +123 -0
- package/dist/telemetry-entry.d.ts +2 -1
- package/dist/telemetry-entry.js +2 -1
- package/dist/telemetry-feedback.d.ts +16 -2
- package/dist/telemetry-feedback.js +19 -0
- package/dist/telemetry-session.d.ts +91 -2
- package/dist/telemetry-session.js +65 -0
- package/dist/telemetry-signals.d.ts +557 -0
- package/dist/telemetry-signals.js +225 -0
- package/dist/telemetry.d.ts +649 -296
- package/dist/telemetry.js +110 -119
- package/dist/verdict/check-sentence.d.ts +34 -0
- package/dist/verdict/check-sentence.js +228 -0
- package/dist/verdict/consequence.d.ts +15 -0
- package/dist/verdict/consequence.js +11 -0
- package/dist/verdict/disparity.d.ts +105 -0
- package/dist/verdict/disparity.js +40 -0
- package/dist/verdict/findings.d.ts +16 -0
- package/dist/verdict/findings.js +22 -0
- package/dist/verdict/instrumentation-coverage.d.ts +84 -0
- package/dist/verdict/instrumentation-coverage.js +182 -0
- package/dist/verdict/instrumentation-gap.d.ts +79 -0
- package/dist/verdict/instrumentation-gap.js +65 -1
- package/dist/verdict/intent.d.ts +19 -5
- package/dist/verdict/intent.js +13 -1
- package/dist/verdict/predicate-tree.d.ts +17 -0
- package/dist/verdict/predicate-tree.js +37 -0
- package/dist/verdict/predicate.d.ts +16 -1
- package/dist/verdict/predicate.js +188 -13
- package/dist/verdict/property-assertion.d.ts +2 -2
- package/dist/verdict/run-report.d.ts +166 -0
- package/dist/verdict/run-report.js +53 -0
- package/dist/verdict/security.d.ts +60 -1
- package/dist/verdict/security.js +174 -12
- package/dist/verdict/verification-run.d.ts +713 -68
- package/dist/verdict/verification-run.js +113 -0
- package/dist/verdict/verify-progress.d.ts +6 -6
- package/dist/wire/constants/constants.d.ts +69 -155
- package/dist/wire/constants/constants.js +78 -159
- package/dist/wire/constants/discovery.d.ts +4 -4
- package/dist/wire/constants/discovery.js +4 -4
- package/dist/wire/constants/event-types.d.ts +35 -1
- package/dist/wire/constants/event-types.js +33 -1
- package/dist/wire/constants/hud-controls.js +15 -5
- package/dist/wire/constants/hud-use.d.ts +33 -4
- package/dist/wire/constants/hud-use.js +30 -4
- package/dist/wire/constants/mcp-wire.d.ts +26 -0
- package/dist/wire/constants/mcp-wire.js +26 -0
- package/dist/wire/constants/response-body-reason.d.ts +19 -0
- package/dist/wire/constants/response-body-reason.js +18 -0
- package/dist/wire/constants/reticle-chrome.d.ts +19 -0
- package/dist/wire/constants/reticle-chrome.js +19 -0
- package/dist/wire/constants/reticle-env.d.ts +138 -0
- package/dist/wire/constants/reticle-env.js +138 -0
- package/dist/wire/constants/session-constants.d.ts +26 -2
- package/dist/wire/constants/session-constants.js +26 -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 +202 -36
- package/dist/wire/event-payloads.js +100 -16
- package/dist/wire/messages.d.ts +193 -54
- package/dist/wire/messages.js +25 -1
- package/dist/wire/narrow.d.ts +6 -0
- package/dist/wire/narrow.js +26 -0
- package/dist/wire/next-step.d.ts +90 -0
- package/dist/wire/next-step.js +37 -0
- package/dist/wire/platform-link.d.ts +84 -0
- package/dist/wire/platform-link.js +57 -6
- package/dist/wire/production/activation-ticket.d.ts +64 -0
- package/dist/wire/production/activation-ticket.js +148 -0
- package/dist/wire/production/hello-mode.d.ts +35 -0
- package/dist/wire/production/hello-mode.js +32 -0
- package/dist/wire/production/production-policy.d.ts +138 -0
- package/dist/wire/production/production-policy.js +133 -0
- package/dist/wire/tool-names.d.ts +4 -0
- package/dist/wire/tool-names.js +4 -0
- package/dist/wire/types.d.ts +90 -52
- 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 +5 -1
|
@@ -0,0 +1,225 @@
|
|
|
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, how a Harness run started and ended, and what happened to the MCP proxy and
|
|
5
|
+
* its daemon when the link failed.
|
|
6
|
+
*
|
|
7
|
+
* Its own file so the vocabulary has one home and `telemetry.ts` only wires it in. Every value here is
|
|
8
|
+
* a closed set, a boolean or a bucket: none of these fields can carry a URL, a path, a name or text.
|
|
9
|
+
*/
|
|
10
|
+
import { z } from 'zod';
|
|
11
|
+
import { HudPanel, HudPromptSurface } from './wire/constants/hud-use.js';
|
|
12
|
+
/**
|
|
13
|
+
* Where this machine stands with the platform, on every event. `linked` implies signed in OR an
|
|
14
|
+
* api key in the environment: a project with a working link reports to a workspace either way.
|
|
15
|
+
*/
|
|
16
|
+
export const TelemetryAccountState = {
|
|
17
|
+
SIGNED_OUT: 'signed_out',
|
|
18
|
+
SIGNED_IN: 'signed_in',
|
|
19
|
+
LINKED: 'linked',
|
|
20
|
+
};
|
|
21
|
+
/**
|
|
22
|
+
* Which coding agent an event came from, normalised from the MCP handshake's `clientInfo.name`, else
|
|
23
|
+
* from a marker the agent sets in the environment of what it spawns. `other` is a client that named
|
|
24
|
+
* itself and is not on this list; absent means nothing said.
|
|
25
|
+
*/
|
|
26
|
+
export const AgentClient = {
|
|
27
|
+
CLAUDE_CODE: 'claude_code',
|
|
28
|
+
CLAUDE_DESKTOP: 'claude_desktop',
|
|
29
|
+
CODEX: 'codex',
|
|
30
|
+
CURSOR: 'cursor',
|
|
31
|
+
GEMINI_CLI: 'gemini_cli',
|
|
32
|
+
ANTIGRAVITY: 'antigravity',
|
|
33
|
+
WINDSURF: 'windsurf',
|
|
34
|
+
CLINE: 'cline',
|
|
35
|
+
OPENCODE: 'opencode',
|
|
36
|
+
ZED: 'zed',
|
|
37
|
+
VSCODE: 'vscode',
|
|
38
|
+
OTHER: 'other',
|
|
39
|
+
};
|
|
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 const LaunchMethod = {
|
|
46
|
+
NPX: 'npx',
|
|
47
|
+
GLOBAL: 'global',
|
|
48
|
+
PROJECT: 'project',
|
|
49
|
+
OTHER: 'other',
|
|
50
|
+
};
|
|
51
|
+
/** A count, bucketed: an exact number of tabs or journeys starts to describe one app. */
|
|
52
|
+
export const CountBucket = {
|
|
53
|
+
ZERO: '0',
|
|
54
|
+
ONE: '1',
|
|
55
|
+
TWO_THREE: '2-3',
|
|
56
|
+
FOUR_NINE: '4-9',
|
|
57
|
+
TEN_PLUS: '10+',
|
|
58
|
+
};
|
|
59
|
+
export function countBucket(n) {
|
|
60
|
+
if (n <= 0)
|
|
61
|
+
return CountBucket.ZERO;
|
|
62
|
+
if (1 === n)
|
|
63
|
+
return CountBucket.ONE;
|
|
64
|
+
if (n <= 3)
|
|
65
|
+
return CountBucket.TWO_THREE;
|
|
66
|
+
if (n <= 9)
|
|
67
|
+
return CountBucket.FOUR_NINE;
|
|
68
|
+
return CountBucket.TEN_PLUS;
|
|
69
|
+
}
|
|
70
|
+
/** `hud_viewed` / `hud_signin_prompted`: which page or prompt, and how many tabs had a HUD. */
|
|
71
|
+
export const HudEventSchema = z.object({
|
|
72
|
+
view: z.nativeEnum(HudPanel).optional(),
|
|
73
|
+
surface: z.nativeEnum(HudPromptSurface).optional(),
|
|
74
|
+
tabs: z.nativeEnum(CountBucket).optional(),
|
|
75
|
+
});
|
|
76
|
+
/** How a project got linked to a workspace on this machine. */
|
|
77
|
+
export const PlatformLinkVia = {
|
|
78
|
+
/** `reticle connect`: sign in, link and sync in one command. */
|
|
79
|
+
CONNECT: 'connect',
|
|
80
|
+
/** The HUD's "Link this project" / "Save runs for your team". */
|
|
81
|
+
HUD: 'hud',
|
|
82
|
+
/** A bare `reticle link`. */
|
|
83
|
+
LINK: 'link',
|
|
84
|
+
};
|
|
85
|
+
export const PlatformLinkSchema = z.object({ via: z.nativeEnum(PlatformLinkVia) });
|
|
86
|
+
export const HarnessRunPhase = { STARTED: 'started', COMPLETED: 'completed' };
|
|
87
|
+
/** How a Harness run ended. `blocked` is a refusal before it drove (gate, credits, switched off). */
|
|
88
|
+
export const HarnessRunOutcome = {
|
|
89
|
+
PROVED: 'proved',
|
|
90
|
+
NOT_PROVED: 'not_proved',
|
|
91
|
+
FAILED: 'failed',
|
|
92
|
+
BLOCKED: 'blocked',
|
|
93
|
+
STOPPED: 'stopped',
|
|
94
|
+
};
|
|
95
|
+
/**
|
|
96
|
+
* Why a Harness run did not drive: only on a `blocked` or `failed` run. Closed, and read off the
|
|
97
|
+
* refusal that stopped it, never off its sentence, so a reworded message cannot change the count.
|
|
98
|
+
*/
|
|
99
|
+
export const HarnessRunReason = {
|
|
100
|
+
/** The project has no platform link, so there is nowhere to drive from. */
|
|
101
|
+
NOT_LINKED: 'not_linked',
|
|
102
|
+
/** The platform did not confirm the drive in time, or answered something unreadable. */
|
|
103
|
+
PLATFORM_UNREACHABLE: 'platform_unreachable',
|
|
104
|
+
/** The Harness is switched off for this project (the default until somebody turns it on). */
|
|
105
|
+
HARNESS_OFF: 'harness_off',
|
|
106
|
+
/** The workspace has no credits left. */
|
|
107
|
+
NO_CREDITS: 'no_credits',
|
|
108
|
+
/** The workspace has not claimed the Harness. */
|
|
109
|
+
NOT_ENTITLED: 'not_entitled',
|
|
110
|
+
/** An older build refused for low instrumentation. No longer sent: the Harness has no coverage gate. */
|
|
111
|
+
COVERAGE_GATE: 'coverage_gate',
|
|
112
|
+
/** The page and the daemon come from different builds, so every step would answer unknown. */
|
|
113
|
+
VERSION_SKEW: 'version_skew',
|
|
114
|
+
/** The drive started and broke. */
|
|
115
|
+
BROKEN: 'broken',
|
|
116
|
+
/** A refusal this list does not name. A growing count here is a gap in this list. */
|
|
117
|
+
OTHER: 'other',
|
|
118
|
+
};
|
|
119
|
+
/** Who started a Harness run. `dashboard` is a run started from the platform's chat. */
|
|
120
|
+
export const HarnessRunSource = {
|
|
121
|
+
AGENT: 'agent',
|
|
122
|
+
HUD: 'hud',
|
|
123
|
+
DASHBOARD: 'dashboard',
|
|
124
|
+
CLI_TRY: 'cli_try',
|
|
125
|
+
PLAN: 'plan',
|
|
126
|
+
};
|
|
127
|
+
/** `harness_run`: one `started` and one `completed` per run. */
|
|
128
|
+
export const HarnessRunSchema = z.object({
|
|
129
|
+
phase: z.nativeEnum(HarnessRunPhase),
|
|
130
|
+
source: z.nativeEnum(HarnessRunSource),
|
|
131
|
+
/** The run drives on the platform (always, today), as opposed to an injected local driver. */
|
|
132
|
+
hosted: z.boolean(),
|
|
133
|
+
/** Only on `completed`. */
|
|
134
|
+
outcome: z.nativeEnum(HarnessRunOutcome).optional(),
|
|
135
|
+
/** Only on `completed`: journeys the run answered, and how many of those replayed with no model. */
|
|
136
|
+
journeys: z.nativeEnum(CountBucket).optional(),
|
|
137
|
+
replayed: z.nativeEnum(CountBucket).optional(),
|
|
138
|
+
/** Only on a `blocked` or `failed` run: why it did not drive. */
|
|
139
|
+
reason: z.nativeEnum(HarnessRunReason).optional(),
|
|
140
|
+
});
|
|
141
|
+
/**
|
|
142
|
+
* The envelope fields and blocks this file adds to `TelemetryEventSchema`, spread into it there.
|
|
143
|
+
* Every one optional: an older sender has none of them.
|
|
144
|
+
*/
|
|
145
|
+
export const SIGNAL_FIELDS = {
|
|
146
|
+
/** Signed out, signed in, or signed in AND this project linked to a workspace. */
|
|
147
|
+
accountState: z.nativeEnum(TelemetryAccountState).optional(),
|
|
148
|
+
/** This project reports to a workspace. */
|
|
149
|
+
linked: z.boolean().optional(),
|
|
150
|
+
/**
|
|
151
|
+
* The platform's id for the linked workspace (`orgId` in `.reticle/cloud.json`): a pseudonymous
|
|
152
|
+
* key the platform joins its own records on. Never the workspace NAME, never an email.
|
|
153
|
+
*/
|
|
154
|
+
workspaceId: z.string().min(1).max(128).optional(),
|
|
155
|
+
/** Which coding agent this event came from, normalised. Absent when nothing said. */
|
|
156
|
+
client: z.nativeEnum(AgentClient).optional(),
|
|
157
|
+
/** How the running `reticle` was launched. */
|
|
158
|
+
launch: z.nativeEnum(LaunchMethod).optional(),
|
|
159
|
+
/** Only on `hud_viewed` / `hud_signin_prompted`. */
|
|
160
|
+
hud: HudEventSchema.optional(),
|
|
161
|
+
/** Only on `platform_linked`. */
|
|
162
|
+
link: PlatformLinkSchema.optional(),
|
|
163
|
+
/** Only on `harness_run`. */
|
|
164
|
+
harness: HarnessRunSchema.optional(),
|
|
165
|
+
};
|
|
166
|
+
// ── Transport: what happens to the MCP proxy and its daemon when the link fails ──
|
|
167
|
+
// No block below carries a path, a port, a pid or a message.
|
|
168
|
+
/**
|
|
169
|
+
* The socket error code behind a drop, as a closed set. Anything else reports `other`, so a new code
|
|
170
|
+
* cannot put free text on the wire.
|
|
171
|
+
*/
|
|
172
|
+
export const OutageErrCode = {
|
|
173
|
+
ECONNRESET: 'ECONNRESET',
|
|
174
|
+
ECONNREFUSED: 'ECONNREFUSED',
|
|
175
|
+
EPIPE: 'EPIPE',
|
|
176
|
+
ETIMEDOUT: 'ETIMEDOUT',
|
|
177
|
+
OTHER: 'other',
|
|
178
|
+
};
|
|
179
|
+
/** Why the MCP proxy process left. Each member names one exit path in the proxy. */
|
|
180
|
+
export const ProxyExitReason = {
|
|
181
|
+
/** The client closed stdin. The normal end of a session. */
|
|
182
|
+
STDIN_END: 'stdin_end',
|
|
183
|
+
/** The client link was quiet for the idle window, with no work in flight. */
|
|
184
|
+
IDLE: 'idle',
|
|
185
|
+
/** Too many client-pipe disconnects since the last usable session: the client is gone. */
|
|
186
|
+
CLIENT_GONE_STORM: 'client_gone_storm',
|
|
187
|
+
/** The proxy could not start a daemon and had no way to continue. */
|
|
188
|
+
WAKE_FAILED: 'wake_failed',
|
|
189
|
+
};
|
|
190
|
+
/** `mcp_proxy_exited`: the agent's MCP server process ended, and the agent lost its tools. */
|
|
191
|
+
export const ProxyExitSchema = z.object({
|
|
192
|
+
reason: z.nativeEnum(ProxyExitReason),
|
|
193
|
+
/** How long the proxy process ran. */
|
|
194
|
+
uptimeMs: z.number().int().nonnegative(),
|
|
195
|
+
/** How many times the proxy lost its daemon stream in its life. */
|
|
196
|
+
drops: z.number().int().nonnegative(),
|
|
197
|
+
/** How many `tools/call` requests the client sent through this proxy. */
|
|
198
|
+
toolCalls: z.number().int().nonnegative(),
|
|
199
|
+
proxyId: z.string().min(1).max(64).optional(),
|
|
200
|
+
});
|
|
201
|
+
/** `daemon_died_unclean`: a daemon start found the pidfile of a daemon that never stopped cleanly. */
|
|
202
|
+
export const DaemonDeathSchema = z.object({
|
|
203
|
+
/** Time from the dead daemon's start (its pidfile write) to this discovery. */
|
|
204
|
+
ageMs: z.number().int().nonnegative(),
|
|
205
|
+
});
|
|
206
|
+
/** What held the port when a wake was refused. */
|
|
207
|
+
export const WakeRefusalPresence = {
|
|
208
|
+
/** Something that is not a Reticle daemon holds the port. */
|
|
209
|
+
FOREIGN: 'foreign',
|
|
210
|
+
/** A Reticle daemon for a different project holds the port. */
|
|
211
|
+
OTHER_PROJECT: 'other_project',
|
|
212
|
+
};
|
|
213
|
+
/** `wake_refused`: the proxy would not use the daemon port it found. */
|
|
214
|
+
export const WakeRefusalSchema = z.object({
|
|
215
|
+
presence: z.nativeEnum(WakeRefusalPresence),
|
|
216
|
+
});
|
|
217
|
+
/** The blocks this file adds to `TelemetryEventSchema`, spread into it there. */
|
|
218
|
+
export const TRANSPORT_FIELDS = {
|
|
219
|
+
/** Only on `mcp_proxy_exited`. */
|
|
220
|
+
proxyExit: ProxyExitSchema.optional(),
|
|
221
|
+
/** Only on `daemon_died_unclean`. */
|
|
222
|
+
daemonDeath: DaemonDeathSchema.optional(),
|
|
223
|
+
/** Only on `wake_refused`. */
|
|
224
|
+
wakeRefusal: WakeRefusalSchema.optional(),
|
|
225
|
+
};
|