@reticlehq/core 2.6.0 → 2.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/constants.d.ts +25 -1
- package/dist/constants.js +30 -1
- package/dist/desktop-contract.cjs +1 -0
- package/dist/desktop-contract.d.cts +1 -0
- package/dist/desktop-contract.d.ts +10 -0
- package/dist/desktop-contract.js +10 -0
- package/dist/findings.d.ts +31 -0
- package/dist/findings.js +39 -0
- package/dist/flow-constants.d.ts +2 -0
- package/dist/flow-constants.js +2 -0
- package/dist/notices.d.ts +2 -2
- package/dist/notices.js +2 -2
- package/dist/telemetry-session.d.ts +22 -6
- package/dist/telemetry-session.js +20 -6
- package/dist/telemetry.d.ts +499 -33
- package/dist/telemetry.js +236 -14
- package/dist/types.d.ts +12 -0
- package/dist/types.js +10 -0
- package/dist/verified-constants.d.ts +23 -0
- package/dist/verified-constants.js +22 -0
- package/package.json +1 -1
package/dist/telemetry.js
CHANGED
|
@@ -18,7 +18,7 @@
|
|
|
18
18
|
import { z } from 'zod';
|
|
19
19
|
import { MachineSnapshotSchema, ProjectProfileSchema, SessionSummarySchema, } from './telemetry-session.js';
|
|
20
20
|
import { BrowserBrand, FeedbackSchema } from './telemetry-feedback.js';
|
|
21
|
-
import { VerifiedReason } from './verified-constants.js';
|
|
21
|
+
import { CaptureLoss, VerifiedReason } from './verified-constants.js';
|
|
22
22
|
import { IdentitySchema } from './telemetry-feedback.js';
|
|
23
23
|
/** Bump when the event shape changes so the analytics side can segment old senders. */
|
|
24
24
|
export const TELEMETRY_EVENT_VERSION = 3;
|
|
@@ -108,6 +108,26 @@ export const TelemetryEventKind = {
|
|
|
108
108
|
* identical to healthy usage in every other metric.
|
|
109
109
|
*/
|
|
110
110
|
MCP_CLIENT_CONNECTED: 'mcp_client_connected',
|
|
111
|
+
/**
|
|
112
|
+
* An app carrying the SDK connected to this daemon for the first time in its life.
|
|
113
|
+
*
|
|
114
|
+
* THE funnel step, and the one nothing could measure. Reticle's install has two halves — register
|
|
115
|
+
* the MCP server so the agent has the tools, and get the SDK into a running page so there is
|
|
116
|
+
* something for those tools to look at — and they are done at different times, by different
|
|
117
|
+
* commands, often in different directories. Almost everyone completes the first. The second is
|
|
118
|
+
* where the users go.
|
|
119
|
+
*
|
|
120
|
+
* Everything that existed before answered a different question. `daemon_started` and
|
|
121
|
+
* `mcp_client_connected` describe the agent half only. `session_appConnects` describes the app
|
|
122
|
+
* half but is a WINDOW counter: it resets on every flush, so a user whose app connected in one
|
|
123
|
+
* window reads zero in every other, and the population it under-counts is exactly the population
|
|
124
|
+
* being measured. A funnel built on it reported fewer instrumented users than there were users
|
|
125
|
+
* calling tools, which is impossible on its face and was the first sign the field was unusable.
|
|
126
|
+
*
|
|
127
|
+
* Fired ONCE per daemon run, on the first connect only — so `daemon_started` → `app_instrumented`
|
|
128
|
+
* is a real rate rather than an inference, and a reconnecting page cannot inflate it.
|
|
129
|
+
*/
|
|
130
|
+
APP_INSTRUMENTED: 'app_instrumented',
|
|
111
131
|
/**
|
|
112
132
|
* The agent LOST its Reticle tools — the worst thing this product does to anyone, and until now
|
|
113
133
|
* completely invisible in the field.
|
|
@@ -143,6 +163,19 @@ export const TelemetryEventKind = {
|
|
|
143
163
|
* human watching the screen would have caught" is the argument.
|
|
144
164
|
*/
|
|
145
165
|
BUG_FOUND: 'bug_found',
|
|
166
|
+
/**
|
|
167
|
+
* A tool could not do what was asked, and said so.
|
|
168
|
+
*
|
|
169
|
+
* The refusal path already computes a precise diagnosis, hands it to the agent as prose, and then
|
|
170
|
+
* throws it away. So the largest cohort in the funnel — the users who connect an agent and never
|
|
171
|
+
* drive — is visible only by subtraction, and the three genuinely different situations behind it
|
|
172
|
+
* (nothing was ever wired here, the app is not running, a session was lost) arrive as one silence.
|
|
173
|
+
*
|
|
174
|
+
* `noSessionErrors` on the session summary counts one of those causes and only at the end of a
|
|
175
|
+
* session, without the tool, without the discriminator, and without whether the agent tried again.
|
|
176
|
+
* This carries the fact at the moment it happens. See issue #172.
|
|
177
|
+
*/
|
|
178
|
+
TOOL_REFUSED: 'tool_refused',
|
|
146
179
|
};
|
|
147
180
|
/**
|
|
148
181
|
* Events that belong to a DAEMON RUN, and therefore carry `sessionId`.
|
|
@@ -160,11 +193,13 @@ const SESSION_SCOPED = new Set([
|
|
|
160
193
|
TelemetryEventKind.DAEMON_STOPPED,
|
|
161
194
|
TelemetryEventKind.SESSION_PROGRESS,
|
|
162
195
|
TelemetryEventKind.MCP_CLIENT_CONNECTED,
|
|
196
|
+
TelemetryEventKind.APP_INSTRUMENTED,
|
|
163
197
|
TelemetryEventKind.PROJECT_PROFILED,
|
|
164
198
|
TelemetryEventKind.VERIFICATION_COMPLETED,
|
|
165
199
|
TelemetryEventKind.BUG_FOUND,
|
|
166
200
|
TelemetryEventKind.RUNTIME_CRASHED,
|
|
167
201
|
TelemetryEventKind.FEEDBACK_SUBMITTED,
|
|
202
|
+
TelemetryEventKind.TOOL_REFUSED,
|
|
168
203
|
]);
|
|
169
204
|
/** True when this event happened inside a daemon run, so a `sessionId` on it means something. */
|
|
170
205
|
export function isSessionScoped(kind) {
|
|
@@ -194,7 +229,7 @@ export const TelemetryActor = {
|
|
|
194
229
|
* property the funnel actually needs: `init` runs in the app directory and the daemon is spawned from
|
|
195
230
|
* wherever the agent's client happens to sit, so an id that changes with the working directory
|
|
196
231
|
* severs the two halves of the funnel. Only `cwd` has that defect, and it is now the last resort
|
|
197
|
-
* rather than the first fallback —
|
|
232
|
+
* rather than the first fallback — the field showed many ids minted for a single project.
|
|
198
233
|
*/
|
|
199
234
|
export const ProjectIdSource = {
|
|
200
235
|
/** Hash of the shared git origin — the same on every clone, so cross-machine counting is valid. */
|
|
@@ -267,6 +302,18 @@ export const VerificationSchema = z.object({
|
|
|
267
302
|
* no clause behind it, and an older SDK reports none. Absent means unclassified, never guessed.
|
|
268
303
|
*/
|
|
269
304
|
reason: z.nativeEnum(VerifiedReason).optional(),
|
|
305
|
+
/**
|
|
306
|
+
* WHAT was lost, when `reason` is `unclean_capture` — see `CaptureLoss`.
|
|
307
|
+
*
|
|
308
|
+
* The three causes belong to three different owners and need three different fixes, and without
|
|
309
|
+
* this they are one bar. The one time we had to answer it the data could not, and the answer
|
|
310
|
+
* turned out to be that our own eviction counter was miscounting.
|
|
311
|
+
*
|
|
312
|
+
* ONE value, not a list: `losses` can hold several and a multi-value property is not something a
|
|
313
|
+
* dashboard can group by, so the FIRST is sent and the order in the producers is the order of
|
|
314
|
+
* ownership — ours before the page's. Absent on every verdict whose capture was clean.
|
|
315
|
+
*/
|
|
316
|
+
uncleanLoss: z.nativeEnum(CaptureLoss).optional(),
|
|
270
317
|
});
|
|
271
318
|
/** Which way the installed version moved, and between which versions. */
|
|
272
319
|
export const VersionChangeSchema = z.object({
|
|
@@ -395,15 +442,23 @@ export const BugSource = {
|
|
|
395
442
|
* WHOSE fault the defect was.
|
|
396
443
|
*
|
|
397
444
|
* `bugsFound` is the number this product would most like to publish, and it is not publishable
|
|
398
|
-
* without this.
|
|
399
|
-
*
|
|
400
|
-
*
|
|
401
|
-
*
|
|
445
|
+
* without this. It shipped twice and was wrong both times: across two full real drives EVERY
|
|
446
|
+
* `attribution: 'app'` was a misattribution, so a single session would have published defects
|
|
447
|
+
* against a customer's product that did not exist. A metric confidently wrong about whose fault
|
|
448
|
+
* something is, is worse than no metric — it is the number a founder steers on, and it points at the
|
|
449
|
+
* customer. It was removed, and an ABSENT field then made "nobody classified this" and "we looked
|
|
450
|
+
* and could not tell" the same fact, which is the other half of the same problem.
|
|
451
|
+
*
|
|
452
|
+
* So it is back with two rules, and both are what the earlier versions lacked:
|
|
402
453
|
*
|
|
403
|
-
*
|
|
404
|
-
*
|
|
405
|
-
*
|
|
406
|
-
*
|
|
454
|
+
* 1. **Always present.** `UNCLASSIFIED` is a value, not a gap. Absence would mean an old sender or a
|
|
455
|
+
* path that forgot; a value means the classifier ran and declined.
|
|
456
|
+
* 2. **`APP` requires POSITIVE evidence** — something the app itself did: a request that came back
|
|
457
|
+
* failed, a signal the app fired carrying data that disagrees with its own screen, a written
|
|
458
|
+
* field echoed back changed. Never "nothing else explained it". Core already draws exactly this
|
|
459
|
+
* line for the verdict, in `ABSENCE_DERIVED_CONTRADICTIONS`, and that is the line reused rather
|
|
460
|
+
* than a second judgement invented next to it — every one of the historical misattributions was
|
|
461
|
+
* an absence-derived kind, so this rule produces zero of them on the same data.
|
|
407
462
|
*/
|
|
408
463
|
export const BugAttribution = {
|
|
409
464
|
/** A defect in the app under test — the only bucket that belongs in a published defect count. */
|
|
@@ -412,6 +467,15 @@ export const BugAttribution = {
|
|
|
412
467
|
REQUEST: 'request',
|
|
413
468
|
/** Reticle could not see or could not drive. Our bug, or our configuration. Ship a fix. */
|
|
414
469
|
RETICLE: 'reticle',
|
|
470
|
+
/**
|
|
471
|
+
* The classifier looked and the evidence could not say.
|
|
472
|
+
*
|
|
473
|
+
* The honest majority, and it must stay a value rather than becoming a gap: a failed
|
|
474
|
+
* `element.present` covers "the button is missing", "the API is down" and "the agent mistyped a
|
|
475
|
+
* testid" identically, and an owner invented for it would put a guess into the one number we
|
|
476
|
+
* intend to publish. Exclude it from a defect count; never fold it into `app`.
|
|
477
|
+
*/
|
|
478
|
+
UNCLASSIFIED: 'unclassified',
|
|
415
479
|
};
|
|
416
480
|
/**
|
|
417
481
|
* One defect Reticle found in the app under test.
|
|
@@ -456,10 +520,56 @@ export const BugFoundSchema = z.object({
|
|
|
456
520
|
*/
|
|
457
521
|
repeat: z.boolean(),
|
|
458
522
|
/**
|
|
459
|
-
* Whose fault it was
|
|
460
|
-
*
|
|
523
|
+
* Whose fault it was, ALWAYS present — `unclassified` when the evidence cannot say, never absent.
|
|
524
|
+
*
|
|
525
|
+
* Absence and "we looked and could not tell" are different facts, and only one of them is a
|
|
526
|
+
* measurement. Count `attribution: 'app'` for defects found in anybody's product; see
|
|
527
|
+
* `BugAttribution` for why `app` needs positive evidence.
|
|
528
|
+
*/
|
|
529
|
+
attribution: z.nativeEnum(BugAttribution),
|
|
530
|
+
});
|
|
531
|
+
/**
|
|
532
|
+
* WHY a tool could not do what was asked.
|
|
533
|
+
*
|
|
534
|
+
* Derived from the refusal paths that actually exist rather than invented: every member below is a
|
|
535
|
+
* bucket over `error-recovery.ts`'s recovery table, which is the single place a thrown message is
|
|
536
|
+
* turned into a next action. That table is the vocabulary; this is its coarse grouping, and a new
|
|
537
|
+
* entry there cannot compile without being classified here.
|
|
538
|
+
*
|
|
539
|
+
* The five that matter belong to four different owners, which is the whole reason for splitting
|
|
540
|
+
* them: `no_session` is the install's second half never happening, `bad_args` is the agent's own
|
|
541
|
+
* call, `not_ready` is the environment, and `no_match` / `unsupported` are the app and our own
|
|
542
|
+
* capability surface. One undifferentiated "the agent stopped" number cannot be acted on by anyone.
|
|
543
|
+
*/
|
|
544
|
+
export const RefusalReason = {
|
|
545
|
+
/** There was no app to reach: nothing connected, no session by that id, or several with none named. */
|
|
546
|
+
NO_SESSION: 'no_session',
|
|
547
|
+
/** The target did not exist: a stale ref, a missing baseline, an option value the select has not got. */
|
|
548
|
+
NO_MATCH: 'no_match',
|
|
549
|
+
/** Reticle refuses to pretend: a rich-text surface, a disabled field, a destructive control. */
|
|
550
|
+
UNSUPPORTED: 'unsupported',
|
|
551
|
+
/** The call did not match the schema, or named a value our own validators reject. */
|
|
552
|
+
BAD_ARGS: 'bad_args',
|
|
553
|
+
/** Nothing is wrong with the call; the world is not ready — a throttled tab, a timeout, no browser. */
|
|
554
|
+
NOT_READY: 'not_ready',
|
|
555
|
+
/** A refusal this list does not name. A classifier that cannot say "I don't know" lies instead. */
|
|
556
|
+
OTHER: 'other',
|
|
557
|
+
};
|
|
558
|
+
/** One tool call that could not be served. */
|
|
559
|
+
export const ToolRefusalSchema = z.object({
|
|
560
|
+
/** Which tool. A name from our own fixed namespace, never app data. */
|
|
561
|
+
tool: z.string().min(1).max(64),
|
|
562
|
+
reason: z.nativeEnum(RefusalReason),
|
|
563
|
+
/**
|
|
564
|
+
* TRUE when the call immediately before this one was the SAME tool, also refused.
|
|
565
|
+
*
|
|
566
|
+
* Reported on the RETRY rather than on the first refusal, because the first refusal has to be sent
|
|
567
|
+
* at the moment it happens: deferring it until the next call is known would lose it entirely for
|
|
568
|
+
* the agent that gives up, and that agent is the whole population this event exists to describe.
|
|
569
|
+
* So count `retried: true` for retries; the ratio against all refusals is whether our diagnosis
|
|
570
|
+
* gets anybody unstuck.
|
|
461
571
|
*/
|
|
462
|
-
|
|
572
|
+
retried: z.boolean(),
|
|
463
573
|
});
|
|
464
574
|
/** An MCP client attaching. Separates "installed and running" from "someone is actually using it". */
|
|
465
575
|
export const McpConnectionSchema = z.object({
|
|
@@ -474,6 +584,22 @@ export const McpConnectionSchema = z.object({
|
|
|
474
584
|
/** Which client, from its own handshake (`claude-code`, `cursor`). */
|
|
475
585
|
client: z.string().min(1).max(64).optional(),
|
|
476
586
|
});
|
|
587
|
+
/**
|
|
588
|
+
* `app_instrumented`: an app carrying the SDK reached this daemon for the first time.
|
|
589
|
+
*
|
|
590
|
+
* The install has two halves — the MCP server registered so the agent has the tools, and the SDK
|
|
591
|
+
* loaded by a running page so there is something to look at — and this is the only signal for the
|
|
592
|
+
* second. Deliberately carries NO stack and no framework: `project_profiled` already reports both
|
|
593
|
+
* for the same daemon run, and the two join on `sessionId`.
|
|
594
|
+
*/
|
|
595
|
+
export const AppInstrumentationSchema = z.object({
|
|
596
|
+
/** Whether `reticle init` had been run in this directory (a projectId is stamped). */
|
|
597
|
+
initialized: z.boolean(),
|
|
598
|
+
/** Whether an MCP client was already attached when the app arrived. */
|
|
599
|
+
agentAttached: z.boolean(),
|
|
600
|
+
/** How long the daemon had been up. Large values mean Reticle sat there with nothing wired. */
|
|
601
|
+
msToFirstApp: z.number().int().nonnegative(),
|
|
602
|
+
});
|
|
477
603
|
/**
|
|
478
604
|
* WHICH stage of an MCP outage this is. Reported at most twice per proxy process, and the two are
|
|
479
605
|
* different facts: `first` says the session lost its tools at all, `budget_spent` says the proxy
|
|
@@ -519,7 +645,7 @@ export const McpOutageSchema = z.object({
|
|
|
519
645
|
/**
|
|
520
646
|
* In-flight tool calls this drop actually killed — the only part an agent can FEEL.
|
|
521
647
|
*
|
|
522
|
-
* Without it every drop looks equally bad.
|
|
648
|
+
* Without it every drop looks equally bad. In the field almost every outage was
|
|
523
649
|
* `stage: first` with `attempts: 1`** — the stream ended once and the proxy reconnected, which for
|
|
524
650
|
* an agent with nothing in flight is invisible. Reading that 321 as "the agent lost its tools 321
|
|
525
651
|
* times" overstates the problem by roughly the whole number, and buries the one drop that mattered.
|
|
@@ -529,6 +655,73 @@ export const McpOutageSchema = z.object({
|
|
|
529
655
|
*/
|
|
530
656
|
pendingLost: z.number().int().nonnegative().optional(),
|
|
531
657
|
});
|
|
658
|
+
/**
|
|
659
|
+
* WHICH published route brought this install in.
|
|
660
|
+
*
|
|
661
|
+
* Four routes ship at once — the SKILL.md paste URL, an `npx skills add` package, a Claude Code
|
|
662
|
+
* plugin, and docs.reticle.sh — and not one install can be attributed to any of them today. Every
|
|
663
|
+
* decision about where to spend effort on distribution is therefore made blind.
|
|
664
|
+
*
|
|
665
|
+
* The value is NEVER inferred. It is read from a single explicit marker (`RETICLE_INSTALL_SOURCE`)
|
|
666
|
+
* that a channel sets on itself, narrowed against this list, and anything else reports `UNKNOWN`.
|
|
667
|
+
* That is deliberate and it means `unknown` will stay large: a guessed attribution is worse than no
|
|
668
|
+
* attribution, because a distribution decision made on a guess is indistinguishable from one made on
|
|
669
|
+
* a measurement. Read a small `unknown` as a marker that spread, never as success.
|
|
670
|
+
*
|
|
671
|
+
* What the marker CANNOT be derived from, and why nothing here tries:
|
|
672
|
+
* - `npm_config_user_agent` says npm/pnpm ran us. Every one of these routes runs through npx, so it
|
|
673
|
+
* separates none of them.
|
|
674
|
+
* - The presence of `.claude-plugin/` or an installed skill directory says a plugin or a skill is
|
|
675
|
+
* present in the repo, not that it is the thing that ran `init` — and both are present at once on
|
|
676
|
+
* any machine that has tried more than one route.
|
|
677
|
+
* - A first-run heuristic on which command ran first says nothing about who told the user to run it.
|
|
678
|
+
*/
|
|
679
|
+
export const InstallSource = {
|
|
680
|
+
/** The canonical SKILL.md paste URL — the marker is in the command SKILL.md tells the agent to run. */
|
|
681
|
+
SKILL_FILE: 'skill_file',
|
|
682
|
+
/** The `npx skills add` package, which ships its own copy of the skill carrying its own marker. */
|
|
683
|
+
NPX_SKILL: 'npx_skill',
|
|
684
|
+
/** The Claude Code plugin, which sets the marker in the `env` of the MCP server it registers. */
|
|
685
|
+
PLUGIN: 'plugin',
|
|
686
|
+
/** docs.reticle.sh, whose install snippets carry the marker. */
|
|
687
|
+
DOCS_SITE: 'docs_site',
|
|
688
|
+
/** The repository README's install snippet. */
|
|
689
|
+
README: 'readme',
|
|
690
|
+
/** Somebody typed the command with no channel in front of it. Only ever self-declared. */
|
|
691
|
+
CLI_DIRECT: 'cli_direct',
|
|
692
|
+
/** No marker, or one this list does not name. The honest answer, and expected to dominate. */
|
|
693
|
+
UNKNOWN: 'unknown',
|
|
694
|
+
};
|
|
695
|
+
/**
|
|
696
|
+
* Why a run LOOKS automated, when `CI` alone does not say so.
|
|
697
|
+
*
|
|
698
|
+
* Advisory only — see the `automation` field on the event and `automation-hint.ts` for what these
|
|
699
|
+
* are and, more importantly, what they are not allowed to be used for.
|
|
700
|
+
*/
|
|
701
|
+
export const AutomationHint = {
|
|
702
|
+
/** A container runtime marker is present at the filesystem root. */
|
|
703
|
+
CONTAINER: 'container',
|
|
704
|
+
/** A hosted dev environment declared itself (Codespaces, Gitpod, Cloud Shell, dev container). */
|
|
705
|
+
HOSTED_WORKSPACE: 'hosted_workspace',
|
|
706
|
+
/** Neither end of the process is attached to a terminal. The weakest of the three. */
|
|
707
|
+
NO_TTY: 'no_tty',
|
|
708
|
+
};
|
|
709
|
+
/**
|
|
710
|
+
* What `init` SAW after it finished writing, when it stayed to look.
|
|
711
|
+
*
|
|
712
|
+
* The install has two halves — register the MCP server so the agent has the tools, and get the SDK
|
|
713
|
+
* into a running page so there is something to look at — and nothing joined "init finished" to "an
|
|
714
|
+
* app connected". `init` exited 0 having written files, and the second half was completed by far
|
|
715
|
+
* fewer people than the first with no event able to tell the two apart.
|
|
716
|
+
*/
|
|
717
|
+
export const InitConfirmation = {
|
|
718
|
+
/** An app carrying the SDK reached the daemon while `init` watched. This is what installed means. */
|
|
719
|
+
CONNECTED: 'connected',
|
|
720
|
+
/** Nothing was listening on the bridge port, so no session could arrive. Not a failed install. */
|
|
721
|
+
NO_DAEMON: 'no_daemon',
|
|
722
|
+
/** A daemon was up and no app connected inside the window — the dev server is the outstanding step. */
|
|
723
|
+
NO_SESSION: 'no_session',
|
|
724
|
+
};
|
|
532
725
|
/** How `reticle init` went. The onboarding funnel, which had no instrumentation whatsoever. */
|
|
533
726
|
export const InitOutcomeSchema = z.object({
|
|
534
727
|
ok: z.boolean(),
|
|
@@ -538,6 +731,14 @@ export const InitOutcomeSchema = z.object({
|
|
|
538
731
|
stack: z.string().max(64).optional(),
|
|
539
732
|
/** Whether the MCP registration step succeeded — the step most likely to fail silently. */
|
|
540
733
|
mcpRegistered: z.boolean().optional(),
|
|
734
|
+
/**
|
|
735
|
+
* What `init` saw when it waited for an app to connect.
|
|
736
|
+
*
|
|
737
|
+
* ABSENT means it never looked, which is the honest answer for every scripted run: `init` only
|
|
738
|
+
* waits when a human is at the terminal. Read an absent value as "not measured", never as a
|
|
739
|
+
* failure to connect, or the funnel reads scripted installs as losses.
|
|
740
|
+
*/
|
|
741
|
+
confirmation: z.nativeEnum(InitConfirmation).optional(),
|
|
541
742
|
});
|
|
542
743
|
/**
|
|
543
744
|
* One anonymous telemetry event. `anonymousId` and the optional hashed `projectId` are the only
|
|
@@ -571,6 +772,16 @@ export const TelemetryEventSchema = z.object({
|
|
|
571
772
|
version: z.string().min(1).max(64),
|
|
572
773
|
/** Runs inside CI? Separates real human DAU from pipeline traffic (both matter, differently). */
|
|
573
774
|
ci: z.boolean(),
|
|
775
|
+
/**
|
|
776
|
+
* ADVISORY hint that this run looks automated, when something beyond `CI` suggests it.
|
|
777
|
+
*
|
|
778
|
+
* `ci` reads one environment variable, which is right for a GitHub Actions runner and blind to a
|
|
779
|
+
* cloud agent sandbox — our own gate has landed in the user data with `ci: false`. This is the
|
|
780
|
+
* second angle, and it is NEVER a filter: people work in containers, in Codespaces, and over ssh
|
|
781
|
+
* with no terminal. Never exclude a row because this is set; absent means nothing looked
|
|
782
|
+
* automated, not that a human was present. See automation-hint.ts for the rejected signals.
|
|
783
|
+
*/
|
|
784
|
+
automation: z.nativeEnum(AutomationHint).optional(),
|
|
574
785
|
/**
|
|
575
786
|
* What `projectId` was derived from. On EVERY event, not just the profile, because the core
|
|
576
787
|
* counting questions ("users per project", "projects per user") run over all events and need to
|
|
@@ -617,6 +828,17 @@ export const TelemetryEventSchema = z.object({
|
|
|
617
828
|
init: InitOutcomeSchema.optional(),
|
|
618
829
|
/** Only on `bug_found`. */
|
|
619
830
|
bug: BugFoundSchema.optional(),
|
|
831
|
+
/** Only on `tool_refused`: which tool, why, and whether the agent tried the same thing again. */
|
|
832
|
+
refusal: ToolRefusalSchema.optional(),
|
|
620
833
|
/** Only on `mcp_connection_lost`: which stage of the outage, why, and after how many retries. */
|
|
621
834
|
outage: McpOutageSchema.optional(),
|
|
835
|
+
/** Only on `app_instrumented`: the install's second half finally happening. */
|
|
836
|
+
instrumentation: AppInstrumentationSchema.optional(),
|
|
837
|
+
/**
|
|
838
|
+
* Only on `reticle_installed` / `init_completed`: which published route brought this install in.
|
|
839
|
+
*
|
|
840
|
+
* A scalar rather than a block because it belongs to two different events that have no payload in
|
|
841
|
+
* common, and because there is exactly one fact to carry. Absent on every other kind.
|
|
842
|
+
*/
|
|
843
|
+
installSource: z.nativeEnum(InstallSource).optional(),
|
|
622
844
|
});
|
package/dist/types.d.ts
CHANGED
|
@@ -44,6 +44,16 @@ export declare const ElementQuerySchema: z.ZodObject<{
|
|
|
44
44
|
}>>;
|
|
45
45
|
/** CSS selector or ref to scope the search. */
|
|
46
46
|
scope: z.ZodOptional<z.ZodString>;
|
|
47
|
+
/**
|
|
48
|
+
* Return the `scope` element ITSELF rather than searching inside it.
|
|
49
|
+
*
|
|
50
|
+
* Every other path excludes the scope root by construction, so a layout container with no role,
|
|
51
|
+
* name, testid or text of its own was unreachable — and that is routinely the element carrying the
|
|
52
|
+
* handler. Reported from the field: "click the empty region of this row" is an ordinary user
|
|
53
|
+
* action (dismiss, deselect, close, marquee-select) that could not be expressed at all, and the
|
|
54
|
+
* verification was handed back to the human. Requires `scope`.
|
|
55
|
+
*/
|
|
56
|
+
self: z.ZodOptional<z.ZodBoolean>;
|
|
47
57
|
}, "strip", z.ZodTypeAny, {
|
|
48
58
|
testid?: string | undefined;
|
|
49
59
|
role?: string | undefined;
|
|
@@ -62,6 +72,7 @@ export declare const ElementQuerySchema: z.ZodObject<{
|
|
|
62
72
|
by?: "testid" | "role" | "component" | "text" | "label" | "placeholder" | "alt" | undefined;
|
|
63
73
|
attrs?: string[] | undefined;
|
|
64
74
|
scope?: string | undefined;
|
|
75
|
+
self?: boolean | undefined;
|
|
65
76
|
}, {
|
|
66
77
|
testid?: string | undefined;
|
|
67
78
|
role?: string | undefined;
|
|
@@ -80,6 +91,7 @@ export declare const ElementQuerySchema: z.ZodObject<{
|
|
|
80
91
|
by?: "testid" | "role" | "component" | "text" | "label" | "placeholder" | "alt" | undefined;
|
|
81
92
|
attrs?: string[] | undefined;
|
|
82
93
|
scope?: string | undefined;
|
|
94
|
+
self?: boolean | undefined;
|
|
83
95
|
}>;
|
|
84
96
|
export type ElementQuery = z.infer<typeof ElementQuerySchema>;
|
|
85
97
|
/** Compact semantic descriptor of one element surfaced to the agent. */
|
package/dist/types.js
CHANGED
|
@@ -26,6 +26,16 @@ export const ElementQuerySchema = z.object({
|
|
|
26
26
|
.optional(),
|
|
27
27
|
/** CSS selector or ref to scope the search. */
|
|
28
28
|
scope: z.string().optional(),
|
|
29
|
+
/**
|
|
30
|
+
* Return the `scope` element ITSELF rather than searching inside it.
|
|
31
|
+
*
|
|
32
|
+
* Every other path excludes the scope root by construction, so a layout container with no role,
|
|
33
|
+
* name, testid or text of its own was unreachable — and that is routinely the element carrying the
|
|
34
|
+
* handler. Reported from the field: "click the empty region of this row" is an ordinary user
|
|
35
|
+
* action (dismiss, deselect, close, marquee-select) that could not be expressed at all, and the
|
|
36
|
+
* verification was handed back to the human. Requires `scope`.
|
|
37
|
+
*/
|
|
38
|
+
self: z.boolean().optional(),
|
|
29
39
|
});
|
|
30
40
|
/** One named flow advertised by the app (mirrors the browser CapabilityFlow). */
|
|
31
41
|
export const CapabilityFlowSchema = z.object({
|
|
@@ -74,6 +74,29 @@ export declare const VerifiedReason: {
|
|
|
74
74
|
readonly PROVED: "proved";
|
|
75
75
|
};
|
|
76
76
|
export type VerifiedReason = (typeof VerifiedReason)[keyof typeof VerifiedReason];
|
|
77
|
+
/**
|
|
78
|
+
* WHAT made a capture unclean — the closed vocabulary behind `UNCLEAN_CAPTURE`.
|
|
79
|
+
*
|
|
80
|
+
* `unclean_capture` names three losses that belong to three different owners and need three
|
|
81
|
+
* different fixes: our server buffer, our browser transport, and a boundary in the page that nobody
|
|
82
|
+
* can see through. Until this existed they arrived as one value on a dashboard and as one sentence
|
|
83
|
+
* of free prose in `integrity.issues`, which is not something a query can group by.
|
|
84
|
+
*
|
|
85
|
+
* That cost real time. `unclean_capture` became a large share of all `unknown` verdicts in the
|
|
86
|
+
* field, and answering "which of the three?" took reading the eviction policy, because the data
|
|
87
|
+
* could not say. It was the first one, and it was a false alarm.
|
|
88
|
+
*/
|
|
89
|
+
export declare const CaptureLoss: {
|
|
90
|
+
/** The server ring buffer evicted scarce evidence that belonged to the observation window. */
|
|
91
|
+
readonly BUFFER_LOSS: "buffer_loss";
|
|
92
|
+
/** The browser-side queue overflowed, so part of the window never reached the daemon at all. */
|
|
93
|
+
readonly TRANSPORT_GAP: "transport_gap";
|
|
94
|
+
/** A region the SDK cannot see through — a cross-origin frame, a closed shadow root. */
|
|
95
|
+
readonly BLIND_SPOT: "blind_spot";
|
|
96
|
+
/** A loss we have not classified. A classifier that cannot say "I don't know" lies instead. */
|
|
97
|
+
readonly OTHER: "other";
|
|
98
|
+
};
|
|
99
|
+
export type CaptureLoss = (typeof CaptureLoss)[keyof typeof CaptureLoss];
|
|
77
100
|
/**
|
|
78
101
|
* Actionable companion to NO_PROVIDER for the tools that genuinely intercept or capture through CDP
|
|
79
102
|
* — network mocking and viewport control — which is NOT "visual capture".
|
|
@@ -72,6 +72,28 @@ export const VerifiedReason = {
|
|
|
72
72
|
/** Held at a real grade over a clean capture with no channel disagreeing. */
|
|
73
73
|
PROVED: 'proved',
|
|
74
74
|
};
|
|
75
|
+
/**
|
|
76
|
+
* WHAT made a capture unclean — the closed vocabulary behind `UNCLEAN_CAPTURE`.
|
|
77
|
+
*
|
|
78
|
+
* `unclean_capture` names three losses that belong to three different owners and need three
|
|
79
|
+
* different fixes: our server buffer, our browser transport, and a boundary in the page that nobody
|
|
80
|
+
* can see through. Until this existed they arrived as one value on a dashboard and as one sentence
|
|
81
|
+
* of free prose in `integrity.issues`, which is not something a query can group by.
|
|
82
|
+
*
|
|
83
|
+
* That cost real time. `unclean_capture` became a large share of all `unknown` verdicts in the
|
|
84
|
+
* field, and answering "which of the three?" took reading the eviction policy, because the data
|
|
85
|
+
* could not say. It was the first one, and it was a false alarm.
|
|
86
|
+
*/
|
|
87
|
+
export const CaptureLoss = {
|
|
88
|
+
/** The server ring buffer evicted scarce evidence that belonged to the observation window. */
|
|
89
|
+
BUFFER_LOSS: 'buffer_loss',
|
|
90
|
+
/** The browser-side queue overflowed, so part of the window never reached the daemon at all. */
|
|
91
|
+
TRANSPORT_GAP: 'transport_gap',
|
|
92
|
+
/** A region the SDK cannot see through — a cross-origin frame, a closed shadow root. */
|
|
93
|
+
BLIND_SPOT: 'blind_spot',
|
|
94
|
+
/** A loss we have not classified. A classifier that cannot say "I don't know" lies instead. */
|
|
95
|
+
OTHER: 'other',
|
|
96
|
+
};
|
|
75
97
|
/**
|
|
76
98
|
* Actionable companion to NO_PROVIDER for the tools that genuinely intercept or capture through CDP
|
|
77
99
|
* — network mocking and viewport control — which is NOT "visual capture".
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@reticlehq/core",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.8.0",
|
|
4
4
|
"description": "The Reticle foundation: the shared wire contract — types, zod schemas, constants, messages, and the isomorphic kernel that every Reticle package (browser SDK, server, kits, test harness) imports. Depends only on zod.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/index.js",
|