@reticlehq/core 3.10.11 → 3.11.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 (54) hide show
  1. package/dist/artifacts/flow-results.d.ts +34 -0
  2. package/dist/identity/github-action.d.ts +2 -2
  3. package/dist/identity/github-action.js +1 -1
  4. package/dist/index.d.ts +6 -0
  5. package/dist/index.js +6 -0
  6. package/dist/page-entry.d.ts +5 -2
  7. package/dist/page-entry.js +5 -2
  8. package/dist/realm/picture-text.d.ts +22 -0
  9. package/dist/realm/picture-text.js +19 -0
  10. package/dist/realm/registry.d.ts +15 -0
  11. package/dist/realm/registry.js +38 -2
  12. package/dist/schema/command-name.json +1 -0
  13. package/dist/schema/event-payloads.json +12 -0
  14. package/dist/schema/hello-message.json +5 -0
  15. package/dist/schema/reticle-message.json +5 -0
  16. package/dist/telemetry-bug.d.ts +7 -0
  17. package/dist/telemetry-bug.js +3 -0
  18. package/dist/telemetry-feedback.d.ts +15 -0
  19. package/dist/telemetry-feedback.js +7 -1
  20. package/dist/telemetry.d.ts +23 -0
  21. package/dist/telemetry.js +6 -1
  22. package/dist/verdict/check-sentence.js +8 -1
  23. package/dist/verdict/findings.d.ts +23 -0
  24. package/dist/verdict/findings.js +19 -0
  25. package/dist/verdict/property-assertion.d.ts +5 -0
  26. package/dist/verdict/property-assertion.js +36 -0
  27. package/dist/wire/click-input.d.ts +22 -1
  28. package/dist/wire/click-input.js +35 -1
  29. package/dist/wire/constants/constants.d.ts +13 -3
  30. package/dist/wire/constants/constants.js +14 -3
  31. package/dist/wire/constants/dialog-consent.d.ts +20 -0
  32. package/dist/wire/constants/dialog-consent.js +20 -0
  33. package/dist/wire/constants/event-types.d.ts +10 -0
  34. package/dist/wire/constants/event-types.js +10 -0
  35. package/dist/wire/constants/match-args.d.ts +2 -0
  36. package/dist/wire/constants/match-args.js +2 -0
  37. package/dist/wire/constants/navigate-history.d.ts +29 -0
  38. package/dist/wire/constants/navigate-history.js +27 -0
  39. package/dist/wire/constants/render-stats.d.ts +24 -0
  40. package/dist/wire/constants/render-stats.js +22 -0
  41. package/dist/wire/constants/window-arrangement.d.ts +16 -0
  42. package/dist/wire/constants/window-arrangement.js +16 -0
  43. package/dist/wire/event-payloads.d.ts +4 -1
  44. package/dist/wire/event-payloads.js +19 -2
  45. package/dist/wire/messages.d.ts +13 -0
  46. package/dist/wire/messages.js +15 -0
  47. package/dist/wire/production/production-policy.d.ts +6 -1
  48. package/dist/wire/production/production-policy.js +6 -1
  49. package/dist/wire/tool-names.d.ts +10 -0
  50. package/dist/wire/tool-names.js +10 -0
  51. package/dist/wire/types.d.ts +8 -0
  52. package/dist/words/faded-reason.d.ts +11 -0
  53. package/dist/words/faded-reason.js +15 -0
  54. package/package.json +1 -1
@@ -7,6 +7,7 @@
7
7
  * flow's types" still answers for both halves.
8
8
  */
9
9
  import type { Contradiction } from '../verdict/findings.js';
10
+ import type { VerifiedReason } from '../verdict/verified-constants.js';
10
11
  import type { DriftReason, HealStatus, ReplayStatus, SuiteIsolation, SuiteStopReason, SuiteVerdictStatus } from './flow-constants.js';
11
12
  /**
12
13
  * A legible-drift record returned when an anchor misses at replay.
@@ -286,6 +287,14 @@ export interface SuiteVerdict {
286
287
  flow: string;
287
288
  reason: string;
288
289
  }[];
290
+ /**
291
+ * Flows whose replay stopped waiting for a page that was not hydrated (`FlowReplayResult`
292
+ * `hydrationWait`), from every run, passed or not. A step on such a page ran before React
293
+ * attached its handlers. Omitted when no wait reached its bound.
294
+ */
295
+ hydrationWaits?: ({
296
+ flow: string;
297
+ } & HydrationWait)[];
289
298
  /**
290
299
  * Flows that have both passed AND failed on UNCHANGED code — intermittent, not regressions.
291
300
  *
@@ -419,6 +428,12 @@ export interface FlowReplayResult {
419
428
  * stayed inside the budget.
420
429
  */
421
430
  startPageWait?: StartPageWait;
431
+ /**
432
+ * Set when replay stopped waiting for a page that was not hydrated, at the bound. The steps on
433
+ * that page then ran before React attached all of its event handlers (#1654). The most recent
434
+ * such wait when the flow opened more than one page.
435
+ */
436
+ hydrationWait?: HydrationWait;
422
437
  /**
423
438
  * Set on an `ok` replay whose flow cannot fail: it asserts no observable consequence, or has no
424
439
  * steps at all. The replay genuinely completed, so the status stays `ok` — but a bare `ok` read
@@ -429,6 +444,13 @@ export interface FlowReplayResult {
429
444
  unverifiable?: {
430
445
  reason: string;
431
446
  };
447
+ /**
448
+ * The clause that decided this replay, from the set every verdict tool uses. `status` says what
449
+ * happened; this says why, so a caller can choose its next step without reading the prose.
450
+ * `reticle_flow_replay` always sets it. A replay path that knows a narrower cause than its status
451
+ * (a lost document) sets it first.
452
+ */
453
+ verifiedReason?: VerifiedReason;
432
454
  /**
433
455
  * The confident rebind proposals aggregated across drifted steps (additive,
434
456
  * optional — present only when at least one drifted step has a confident nearest match).
@@ -465,6 +487,18 @@ export interface StartPageWait {
465
487
  /** What the tab said the last time replay asked. True when replay gave up means it gave up at the cap. */
466
488
  stillLoading: boolean;
467
489
  }
490
+ /** How long replay waited for a page that did not hydrate inside the bound. */
491
+ export interface HydrationWait {
492
+ /** From the start of the wait to replay giving up. */
493
+ waitedMs: number;
494
+ /** The bound the wait reached. */
495
+ budgetMs: number;
496
+ /**
497
+ * True when the page said `pending` the last time replay asked. False when the page did not
498
+ * answer in time, so replay could not tell.
499
+ */
500
+ stillPending: boolean;
501
+ }
468
502
  /** A concrete, confidence-scored rebind proposed for one drifted step. */
469
503
  export interface HealProposal {
470
504
  /** 0-based step index in the flow. */
@@ -3,5 +3,5 @@
3
3
  * `scripts/set-version.mjs` writes the version on each release, and `version-lockstep.test.ts`
4
4
  * fails when a doc pins another tag.
5
5
  */
6
- export declare const RETICLE_ACTION_VERSION = "3.10.11";
7
- export declare const RETICLE_ACTION_USES = "reticlehq/reticle/action@v3.10.11";
6
+ export declare const RETICLE_ACTION_VERSION = "3.11.0";
7
+ export declare const RETICLE_ACTION_USES = "reticlehq/reticle/action@v3.11.0";
@@ -3,5 +3,5 @@
3
3
  * `scripts/set-version.mjs` writes the version on each release, and `version-lockstep.test.ts`
4
4
  * fails when a doc pins another tag.
5
5
  */
6
- export const RETICLE_ACTION_VERSION = '3.10.11';
6
+ export const RETICLE_ACTION_VERSION = '3.11.0';
7
7
  export const RETICLE_ACTION_USES = `reticlehq/reticle/action@v${RETICLE_ACTION_VERSION}`;
package/dist/index.d.ts CHANGED
@@ -25,6 +25,7 @@ export * from './artifacts/flow-unreached.js';
25
25
  export * from './artifacts/flow-mutation-target.js';
26
26
  export * from './graph/app-graph.js';
27
27
  export * from './wire/constants/constants.js';
28
+ export * from './wire/constants/window-arrangement.js';
28
29
  export * from './wire/constants/animation-command.js';
29
30
  export * from './wire/constants/response-body-reason.js';
30
31
  export * from './wire/constants/console-event.js';
@@ -44,6 +45,9 @@ export * from './wire/constants/hud-use.js';
44
45
  export * from './wire/constants/reticle-chrome.js';
45
46
  export * from './wire/platform-link.js';
46
47
  export * from './wire/constants/match-args.js';
48
+ export * from './wire/constants/dialog-consent.js';
49
+ export * from './wire/constants/render-stats.js';
50
+ export * from './wire/constants/navigate-history.js';
47
51
  export * from './wire/constants/discovery.js';
48
52
  export * from './wire/constants/determinism.js';
49
53
  export * from './identity/document-identity.js';
@@ -107,6 +111,7 @@ export * from './wire/platform.js';
107
111
  export * from './wire/channel.js';
108
112
  export * from './verdict/revision.js';
109
113
  export * from './realm/registry.js';
114
+ export * from './realm/picture-text.js';
110
115
  export * from './telemetry-session.js';
111
116
  export * from './telemetry-signals.js';
112
117
  export * from './telemetry-license.js';
@@ -116,4 +121,5 @@ export * from './artifacts/impact-savings.js';
116
121
  export { CONTRACT_FINGERPRINT, CONTRACT_PARTS, RETIRED_WIRE_NAMES, fnv1a, fingerprintOf, } from './identity/contract-fingerprint.js';
117
122
  export { fingerprintFinding, type FindingIdentity } from './verdict/finding-fingerprint.js';
118
123
  export * from './words/unreachable-notice.js';
124
+ export * from './words/faded-reason.js';
119
125
  export * from './words/writing-rule.js';
package/dist/index.js CHANGED
@@ -26,6 +26,7 @@ export * from './artifacts/flow-unreached.js'; // unreachedRoutes — known rout
26
26
  export * from './artifacts/flow-mutation-target.js'; // what a flow says it depends on: mutationTargetsFor + perturbationFor
27
27
  export * from './graph/app-graph.js'; // the App Graph: an app as screens, actions, requests; one fold for cloud and daemon
28
28
  export * from './wire/constants/constants.js'; // EventType, ActionType, wire constants, TRANSPORT_LIMITS, …
29
+ export * from './wire/constants/window-arrangement.js'; // WindowArrangement — what `window` does with a window
29
30
  export * from './wire/constants/animation-command.js'; // reticle_animations argument names
30
31
  export * from './wire/constants/response-body-reason.js'; // why a NET_REQUEST carries no response body (#1520)
31
32
  export * from './wire/constants/console-event.js'; // console payload fields (CONSOLE_EVENT) and the pre-attach error buffer (#1540)
@@ -46,6 +47,9 @@ export * from './wire/constants/hud-use.js'; // where the HUD sits, for HUD_USED
46
47
  export * from './wire/constants/reticle-chrome.js'; // Reticle's own UI, hidden from every capture
47
48
  export * from './wire/platform-link.js'; // daemon <-> platform: capabilities, drive spec, tool session
48
49
  export * from './wire/constants/match-args.js'; // the arguments of the `match` command
50
+ export * from './wire/constants/dialog-consent.js'; // the positive yes to an action's confirm()
51
+ export * from './wire/constants/render-stats.js'; // the fields of the React adapter's render store
52
+ export * from './wire/constants/navigate-history.js'; // reticle_navigate { history } and the `history` command (#1844)
49
53
  export * from './wire/constants/discovery.js'; // the call-the-founder invitation, one link for every surface
50
54
  export * from './wire/constants/determinism.js'; // the clock and random source of a deterministic lease
51
55
  export * from './identity/document-identity.js'; // which document an observation belongs to
@@ -128,6 +132,7 @@ export * from './wire/platform.js';
128
132
  export * from './wire/channel.js';
129
133
  export * from './verdict/revision.js';
130
134
  export * from './realm/registry.js';
135
+ export * from './realm/picture-text.js'; // the words a desktop realm read in its picture
131
136
  // The protocol is NOT re-exported here, deliberately.
132
137
  //
133
138
  // `open-verification` is the specification this codebase implements, and it is a separate
@@ -145,4 +150,5 @@ export * from './artifacts/impact-savings.js'; // the savings model - one file,
145
150
  export { CONTRACT_FINGERPRINT, CONTRACT_PARTS, RETIRED_WIRE_NAMES, fnv1a, fingerprintOf, } from './identity/contract-fingerprint.js';
146
151
  export { fingerprintFinding } from './verdict/finding-fingerprint.js';
147
152
  export * from './words/unreachable-notice.js'; // the page's unreachable warning, as a contract the daemon parses
153
+ export * from './words/faded-reason.js'; // the reason the browser gives for opacity-hidden text, read back by the engine
148
154
  export * from './words/writing-rule.js'; // how agents write the text Reticle keeps (ASD-STE100, about 80%)
@@ -26,15 +26,18 @@ export { OutwardAction, dangerousActionWord, dangerousNavigationReason, destruct
26
26
  export { STEP_SCREENSHOT } from './verdict/step-screenshot.js';
27
27
  export { BlindSpotKind } from './verdict/verified-constants.js';
28
28
  export { ChannelId } from './wire/channel.js';
29
- export { ACT_POINT_ARG, ClickButton, DRAG_TO_POINT_ARG, actPointProblem, boxFractionFromArgs, clickButtonFromArgs, clickInputProblem, pointInBox, } from './wire/click-input.js';
29
+ export { ACT_POINT_ARG, ClickButton, DRAG_TO_POINT_ARG, desktopArgProblem, DRAG_TO_REF_ARG, actPointProblem, boxFractionFromArgs, clickButtonFromArgs, clickInputProblem, pointInBox, } from './wire/click-input.js';
30
30
  export { ANIMATION_TARGET_ARG } from './wire/constants/animation-command.js';
31
31
  export { DROPPED_PRE_ATTACH_FIELD, PRE_ATTACH_FIELD, RETICLE_PRE_ATTACH_ERRORS, } from './wire/constants/console-event.js';
32
32
  export { ALLOW_OCCLUDED_ARG, ActionType, ActionWarning, ComponentStateReason, DANGEROUS_ACTION_CONFIRM_ARG, DEFAULT_PLATFORM_URL, ElementState, INSPECT_IN_VIEWPORT_FIELD, INSPECT_REVEAL_ARG, MessageKind, NATIVE_INPUT_ARG, PerfMetric, PresenterMode, QueryBy, REDACTED_VALUE, RETICLE_BUSY_SIGNAL, RETICLE_DEFAULT_PORT, RETICLE_PROTOCOL_VERSION, RETICLE_RENDERS_STORE, RETICLE_SESSION_STORAGE_KEY, RETICLE_URL_PARAM, RETICLE_WS_PATH, ReticleCommand, SettleReason, SnapshotMode, TRANSPORT_LIMITS, TruncationChannel, VisualReason, bridgeWsUrl, } from './wire/constants/constants.js';
33
33
  export { DETERMINISM_GLOBAL_KEY } from './wire/constants/determinism.js';
34
+ export { DIALOG_CONSENT_ARG } from './wire/constants/dialog-consent.js';
35
+ export { WINDOW_NEEDS_DESKTOP_MSG } from './wire/constants/window-arrangement.js';
34
36
  export { DISCOVERY_CALL_URL, FOUNDER_EMAIL, FOUNDER_MAILTO } from './wire/constants/discovery.js';
35
- export { CanvasTrigger, EventType, FieldChangeField, FieldChangeKind, LivePoliteness, MediaEvent, ROUTE_CHANGE_HOW_FIELD, RouteChangeHow, ScrollDirection, StorageArea, StreamDirection, StreamTransport, } from './wire/constants/event-types.js';
37
+ export { CanvasTrigger, EventType, FieldChangeField, FieldChangeKind, INSIDE_FIELD, LivePoliteness, MediaEvent, ROUTE_CHANGE_HOW_FIELD, RouteChangeHow, ScrollDirection, StorageArea, StreamDirection, StreamTransport, } from './wire/constants/event-types.js';
36
38
  export { FlowProgressStatus, HUD_RELOAD_TO_RESTORE, HudCorner, HudPanel, HudPromptSurface, HudToggle, HudView, HudVisibility, ScriptStatus, } from './wire/constants/hud-use.js';
37
39
  export { MatchArg } from './wire/constants/match-args.js';
40
+ export { HISTORY_DIRECTION_ARG, NavigateHistory, NavigateHistoryRefusal, } from './wire/constants/navigate-history.js';
38
41
  export { ResponseBodyReason } from './wire/constants/response-body-reason.js';
39
42
  export { RETICLE_OVERLAY_SELECTOR } from './wire/constants/reticle-chrome.js';
40
43
  export { HealthReason, HumanControlKind, MarkAnchorStrategy, SESSION_AUTO, SESSION_HEALTH, SESSION_LIFECYCLE, SessionState, isSessionState, } from './wire/constants/session-constants.js';
@@ -26,15 +26,18 @@ export { OutwardAction, dangerousActionWord, dangerousNavigationReason, destruct
26
26
  export { STEP_SCREENSHOT } from './verdict/step-screenshot.js';
27
27
  export { BlindSpotKind } from './verdict/verified-constants.js';
28
28
  export { ChannelId } from './wire/channel.js';
29
- export { ACT_POINT_ARG, ClickButton, DRAG_TO_POINT_ARG, actPointProblem, boxFractionFromArgs, clickButtonFromArgs, clickInputProblem, pointInBox, } from './wire/click-input.js';
29
+ export { ACT_POINT_ARG, ClickButton, DRAG_TO_POINT_ARG, desktopArgProblem, DRAG_TO_REF_ARG, actPointProblem, boxFractionFromArgs, clickButtonFromArgs, clickInputProblem, pointInBox, } from './wire/click-input.js';
30
30
  export { ANIMATION_TARGET_ARG } from './wire/constants/animation-command.js';
31
31
  export { DROPPED_PRE_ATTACH_FIELD, PRE_ATTACH_FIELD, RETICLE_PRE_ATTACH_ERRORS, } from './wire/constants/console-event.js';
32
32
  export { ALLOW_OCCLUDED_ARG, ActionType, ActionWarning, ComponentStateReason, DANGEROUS_ACTION_CONFIRM_ARG, DEFAULT_PLATFORM_URL, ElementState, INSPECT_IN_VIEWPORT_FIELD, INSPECT_REVEAL_ARG, MessageKind, NATIVE_INPUT_ARG, PerfMetric, PresenterMode, QueryBy, REDACTED_VALUE, RETICLE_BUSY_SIGNAL, RETICLE_DEFAULT_PORT, RETICLE_PROTOCOL_VERSION, RETICLE_RENDERS_STORE, RETICLE_SESSION_STORAGE_KEY, RETICLE_URL_PARAM, RETICLE_WS_PATH, ReticleCommand, SettleReason, SnapshotMode, TRANSPORT_LIMITS, TruncationChannel, VisualReason, bridgeWsUrl, } from './wire/constants/constants.js';
33
33
  export { DETERMINISM_GLOBAL_KEY } from './wire/constants/determinism.js';
34
+ export { DIALOG_CONSENT_ARG } from './wire/constants/dialog-consent.js';
35
+ export { WINDOW_NEEDS_DESKTOP_MSG } from './wire/constants/window-arrangement.js';
34
36
  export { DISCOVERY_CALL_URL, FOUNDER_EMAIL, FOUNDER_MAILTO } from './wire/constants/discovery.js';
35
- export { CanvasTrigger, EventType, FieldChangeField, FieldChangeKind, LivePoliteness, MediaEvent, ROUTE_CHANGE_HOW_FIELD, RouteChangeHow, ScrollDirection, StorageArea, StreamDirection, StreamTransport, } from './wire/constants/event-types.js';
37
+ export { CanvasTrigger, EventType, FieldChangeField, FieldChangeKind, INSIDE_FIELD, LivePoliteness, MediaEvent, ROUTE_CHANGE_HOW_FIELD, RouteChangeHow, ScrollDirection, StorageArea, StreamDirection, StreamTransport, } from './wire/constants/event-types.js';
36
38
  export { FlowProgressStatus, HUD_RELOAD_TO_RESTORE, HudCorner, HudPanel, HudPromptSurface, HudToggle, HudView, HudVisibility, ScriptStatus, } from './wire/constants/hud-use.js';
37
39
  export { MatchArg } from './wire/constants/match-args.js';
40
+ export { HISTORY_DIRECTION_ARG, NavigateHistory, NavigateHistoryRefusal, } from './wire/constants/navigate-history.js';
38
41
  export { ResponseBodyReason } from './wire/constants/response-body-reason.js';
39
42
  export { RETICLE_OVERLAY_SELECTOR } from './wire/constants/reticle-chrome.js';
40
43
  export { HealthReason, HumanControlKind, MarkAnchorStrategy, SESSION_AUTO, SESSION_HEALTH, SESSION_LIFECYCLE, SessionState, isSessionState, } from './wire/constants/session-constants.js';
@@ -0,0 +1,22 @@
1
+ /**
2
+ * The words a desktop realm read in its picture of a window, each with its box in the pixels of
3
+ * the picture. A canvas, a game or a remote desktop has no elements: the box of a word is the
4
+ * point an agent gives to a click (`args.point`). The realm sends them with the picture, and the
5
+ * daemon passes them to the agent.
6
+ */
7
+ import * as z from 'zod';
8
+ /** The most words of one picture that the daemon passes on. */
9
+ export declare const MAX_PICTURE_TEXTS = 200;
10
+ export declare const PictureTextSchema: z.ZodObject<{
11
+ text: z.ZodString;
12
+ box: z.ZodArray<z.ZodNumber>;
13
+ }, z.core.$strip>;
14
+ export type PictureText = z.infer<typeof PictureTextSchema>;
15
+ /** The words, and how many the realm left out (unsure, or past the most). */
16
+ export declare const PictureTextsSchema: z.ZodObject<{
17
+ texts: z.ZodArray<z.ZodObject<{
18
+ text: z.ZodString;
19
+ box: z.ZodArray<z.ZodNumber>;
20
+ }, z.core.$strip>>;
21
+ textsCut: z.ZodOptional<z.ZodNumber>;
22
+ }, z.core.$strip>;
@@ -0,0 +1,19 @@
1
+ /**
2
+ * The words a desktop realm read in its picture of a window, each with its box in the pixels of
3
+ * the picture. A canvas, a game or a remote desktop has no elements: the box of a word is the
4
+ * point an agent gives to a click (`args.point`). The realm sends them with the picture, and the
5
+ * daemon passes them to the agent.
6
+ */
7
+ import * as z from 'zod';
8
+ /** The most words of one picture that the daemon passes on. */
9
+ export const MAX_PICTURE_TEXTS = 200;
10
+ export const PictureTextSchema = z.object({
11
+ text: z.string().max(200),
12
+ /** x, y, width and height, in the pixels of the picture. */
13
+ box: z.array(z.number()).length(4),
14
+ });
15
+ /** The words, and how many the realm left out (unsure, or past the most). */
16
+ export const PictureTextsSchema = z.object({
17
+ texts: z.array(PictureTextSchema).max(MAX_PICTURE_TEXTS),
18
+ textsCut: z.number().int().nonnegative().optional(),
19
+ });
@@ -128,6 +128,21 @@ export declare function isKnownRealm(runtime: string | undefined): runtime is Ap
128
128
  */
129
129
  export declare function registerRealm(runtime: string, traits: RealmTraits): void;
130
130
  /** Every runtime this process understands: the built-ins, plus whatever a host registered. */
131
+ /**
132
+ * True for the name of any realm: a built-in one, or one that a host registered. `isKnownRealm`
133
+ * answers for the built-in realms only, and narrows to their type.
134
+ */
135
+ export declare function isRealmName(runtime: string | undefined): runtime is string;
136
+ /**
137
+ * True for a realm that reaches the bridge as a peer, with no SDK in the subject. Advice to
138
+ * instrument the application (a build plugin, a store, a signal) does not apply to it.
139
+ */
140
+ export declare function isPeerRealm(runtime: string | undefined): boolean;
141
+ /**
142
+ * The runtime that a computer peer reports: a whole application, read through the operating
143
+ * system, with no SDK in it. A realm of Reticle, so it has no extension prefix.
144
+ */
145
+ export declare const COMPUTER_RUNTIME: "computer";
131
146
  export declare function knownRuntimes(): string[];
132
147
  /** Forget every registered realm. For tests and for a host rebuilding its own registry. */
133
148
  export declare function resetRegisteredRealms(): void;
@@ -19,7 +19,7 @@
19
19
  * code that runs them. This table holds facts you could write on an index card.
20
20
  */
21
21
  import { Surface } from 'open-verification';
22
- import { AppRuntime } from '../telemetry-feedback.js';
22
+ import { AppRuntime, TelemetryRuntime } from '../telemetry-feedback.js';
23
23
  import { PlatformProfile } from '../wire/platform.js';
24
24
  import { RETICLE_URL_PARAM } from '../wire/constants/constants.js';
25
25
  /**
@@ -128,6 +128,42 @@ export function registerRealm(runtime, traits) {
128
128
  REGISTERED.set(runtime, traits);
129
129
  }
130
130
  /** Every runtime this process understands: the built-ins, plus whatever a host registered. */
131
+ /**
132
+ * True for the name of any realm: a built-in one, or one that a host registered. `isKnownRealm`
133
+ * answers for the built-in realms only, and narrows to their type.
134
+ */
135
+ export function isRealmName(runtime) {
136
+ return (isKnownRealm(runtime) ||
137
+ (runtime !== undefined && (REGISTERED.has(runtime) || Object.hasOwn(PEER_REALMS, runtime))));
138
+ }
139
+ /**
140
+ * True for a realm that reaches the bridge as a peer, with no SDK in the subject. Advice to
141
+ * instrument the application (a build plugin, a store, a signal) does not apply to it.
142
+ */
143
+ export function isPeerRealm(runtime) {
144
+ return runtime !== undefined && Object.hasOwn(PEER_REALMS, runtime);
145
+ }
146
+ /**
147
+ * The runtime that a computer peer reports: a whole application, read through the operating
148
+ * system, with no SDK in it. A realm of Reticle, so it has no extension prefix.
149
+ */
150
+ export const COMPUTER_RUNTIME = TelemetryRuntime.COMPUTER;
151
+ /**
152
+ * Realms that reach the bridge as a peer and are not a runtime of the SDK. They are not in
153
+ * `REALMS`, because `AppRuntime` is what the SDK in a page reports and what telemetry carries.
154
+ */
155
+ const PEER_REALMS = {
156
+ // Not a web view in a shell: there is no page, no IPC between halves and no rendering engine.
157
+ [COMPUTER_RUNTIME]: {
158
+ surface: Surface.DESKTOP,
159
+ isDesktopShell: false,
160
+ usesWebKit: false,
161
+ ownsCoverageKinds: false,
162
+ // A picture of the screen is not a picture of a page: in the folder of the pages, a desktop
163
+ // `home` and a page `home` were one file.
164
+ hasOwnBaselineDirectory: true,
165
+ },
166
+ };
131
167
  export function knownRuntimes() {
132
168
  return [...Object.keys(REALMS), ...REGISTERED.keys()];
133
169
  }
@@ -139,7 +175,7 @@ export function realmOf(runtime) {
139
175
  const name = runtime ?? '';
140
176
  if (Object.hasOwn(REALMS, name))
141
177
  return REALMS[name];
142
- return REGISTERED.get(name) ?? REALMS[AppRuntime.WEB];
178
+ return REGISTERED.get(name) ?? PEER_REALMS[name] ?? REALMS[AppRuntime.WEB];
143
179
  }
144
180
  /**
145
181
  * The protocol's surface for a realm.
@@ -23,6 +23,7 @@
23
23
  "render",
24
24
  "navigate",
25
25
  "refresh",
26
+ "history",
26
27
  "flows",
27
28
  "flow.progress",
28
29
  "plan",
@@ -40,6 +40,12 @@
40
40
  },
41
41
  "old": {
42
42
  "type": "string"
43
+ },
44
+ "inside": {
45
+ "type": "array",
46
+ "items": {
47
+ "type": "string"
48
+ }
43
49
  }
44
50
  },
45
51
  "required": [
@@ -69,6 +75,12 @@
69
75
  "assertive",
70
76
  "polite"
71
77
  ]
78
+ },
79
+ "inside": {
80
+ "type": "array",
81
+ "items": {
82
+ "type": "string"
83
+ }
72
84
  }
73
85
  },
74
86
  "required": [
@@ -30,6 +30,11 @@
30
30
  "minLength": 1,
31
31
  "maxLength": 128
32
32
  },
33
+ "root": {
34
+ "type": "string",
35
+ "minLength": 1,
36
+ "maxLength": 4096
37
+ },
33
38
  "adapters": {
34
39
  "maxItems": 32,
35
40
  "type": "array",
@@ -32,6 +32,11 @@
32
32
  "minLength": 1,
33
33
  "maxLength": 128
34
34
  },
35
+ "root": {
36
+ "type": "string",
37
+ "minLength": 1,
38
+ "maxLength": 4096
39
+ },
35
40
  "adapters": {
36
41
  "maxItems": 32,
37
42
  "type": "array",
@@ -94,5 +94,12 @@ export declare const BugFoundSchema: z.ZodObject<{
94
94
  }>;
95
95
  fingerprint: z.ZodOptional<z.ZodString>;
96
96
  occurrence: z.ZodOptional<z.ZodNumber>;
97
+ runtime: z.ZodOptional<z.ZodEnum<{
98
+ readonly COMPUTER: "computer";
99
+ readonly OTHER: "other";
100
+ readonly WEB: "web";
101
+ readonly ELECTRON: "electron";
102
+ readonly TAURI: "tauri";
103
+ }>>;
97
104
  }, z.core.$strip>;
98
105
  export type BugFound = z.infer<typeof BugFoundSchema>;
@@ -4,6 +4,7 @@
4
4
  * reaches it.
5
5
  */
6
6
  import * as z from 'zod';
7
+ import { TelemetryRuntime } from './telemetry-feedback.js';
7
8
  /**
8
9
  * How Reticle came to find a defect. Four routes, in descending order of "a human would have missed
9
10
  * this": a contradiction is invisible to someone watching the screen, a crawl finding required no
@@ -120,4 +121,6 @@ export const BugFoundSchema = z.object({
120
121
  * `occurrence: 1` is the distinct defect within a session. Absent on older senders.
121
122
  */
122
123
  occurrence: z.number().int().positive().optional(),
124
+ /** The runtime of the session where it was found: the browser, Electron, Tauri or the computer. */
125
+ runtime: z.nativeEnum(TelemetryRuntime).optional(),
123
126
  });
@@ -73,6 +73,19 @@ export declare const AppRuntime: {
73
73
  readonly TAURI: "tauri";
74
74
  };
75
75
  export type AppRuntime = (typeof AppRuntime)[keyof typeof AppRuntime];
76
+ /**
77
+ * The runtime of a session as telemetry names it: a runtime of the SDK, Reticle's computer (an
78
+ * application read through the operating system), or `other` for a realm that a host registered.
79
+ * The name of a registered realm is never sent.
80
+ */
81
+ export declare const TelemetryRuntime: {
82
+ readonly COMPUTER: "computer";
83
+ readonly OTHER: "other";
84
+ readonly WEB: "web";
85
+ readonly ELECTRON: "electron";
86
+ readonly TAURI: "tauri";
87
+ };
88
+ export type TelemetryRuntime = (typeof TelemetryRuntime)[keyof typeof TelemetryRuntime];
76
89
  /** The rendering engine behind the connected page — coarse on purpose (three values, not a UA string). */
77
90
  export declare const BrowserEngine: {
78
91
  readonly BLINK: "blink";
@@ -167,6 +180,8 @@ export declare const FeedbackSchema: z.ZodObject<{
167
180
  stack: z.ZodOptional<z.ZodString>;
168
181
  stackMajor: z.ZodOptional<z.ZodNumber>;
169
182
  runtime: z.ZodOptional<z.ZodEnum<{
183
+ readonly COMPUTER: "computer";
184
+ readonly OTHER: "other";
170
185
  readonly WEB: "web";
171
186
  readonly ELECTRON: "electron";
172
187
  readonly TAURI: "tauri";
@@ -70,6 +70,12 @@ export const AppRuntime = {
70
70
  ELECTRON: 'electron',
71
71
  TAURI: 'tauri',
72
72
  };
73
+ /**
74
+ * The runtime of a session as telemetry names it: a runtime of the SDK, Reticle's computer (an
75
+ * application read through the operating system), or `other` for a realm that a host registered.
76
+ * The name of a registered realm is never sent.
77
+ */
78
+ export const TelemetryRuntime = { ...AppRuntime, COMPUTER: 'computer', OTHER: 'other' };
73
79
  /** The rendering engine behind the connected page — coarse on purpose (three values, not a UA string). */
74
80
  export const BrowserEngine = {
75
81
  BLINK: 'blink',
@@ -161,7 +167,7 @@ export const FeedbackSchema = z.object({
161
167
  * and a full version string is high-cardinality enough to start narrowing down who sent it.
162
168
  */
163
169
  stackMajor: z.number().int().nonnegative().optional(),
164
- runtime: z.nativeEnum(AppRuntime).optional(),
170
+ runtime: z.nativeEnum(TelemetryRuntime).optional(),
165
171
  engine: z.nativeEnum(BrowserEngine).optional(),
166
172
  driver: z.nativeEnum(PageDriver).optional(),
167
173
  /** The MCP client on the other end (`claude-code`, `cursor`, …) — self-reported at initialize. */
@@ -319,6 +319,13 @@ export declare const VerificationSchema: z.ZodObject<{
319
319
  /** A model inside the daemon drove this, on the user's behalf. */
320
320
  readonly HARNESS: "harness";
321
321
  }>>;
322
+ runtime: z.ZodOptional<z.ZodEnum<{
323
+ readonly COMPUTER: "computer";
324
+ readonly OTHER: "other";
325
+ readonly WEB: "web";
326
+ readonly ELECTRON: "electron";
327
+ readonly TAURI: "tauri";
328
+ }>>;
322
329
  sdkVersion: z.ZodOptional<z.ZodString>;
323
330
  }, z.core.$strip>;
324
331
  export type Verification = z.infer<typeof VerificationSchema>;
@@ -1098,6 +1105,8 @@ export declare const TelemetryEventSchema: z.ZodObject<{
1098
1105
  stack: z.ZodOptional<z.ZodString>;
1099
1106
  stackMajor: z.ZodOptional<z.ZodNumber>;
1100
1107
  runtime: z.ZodOptional<z.ZodEnum<{
1108
+ readonly COMPUTER: "computer";
1109
+ readonly OTHER: "other";
1101
1110
  readonly WEB: "web";
1102
1111
  readonly ELECTRON: "electron";
1103
1112
  readonly TAURI: "tauri";
@@ -1322,6 +1331,13 @@ export declare const TelemetryEventSchema: z.ZodObject<{
1322
1331
  /** A model inside the daemon drove this, on the user's behalf. */
1323
1332
  readonly HARNESS: "harness";
1324
1333
  }>>;
1334
+ runtime: z.ZodOptional<z.ZodEnum<{
1335
+ readonly COMPUTER: "computer";
1336
+ readonly OTHER: "other";
1337
+ readonly WEB: "web";
1338
+ readonly ELECTRON: "electron";
1339
+ readonly TAURI: "tauri";
1340
+ }>>;
1325
1341
  sdkVersion: z.ZodOptional<z.ZodString>;
1326
1342
  }, z.core.$strip>>;
1327
1343
  versionChange: z.ZodOptional<z.ZodObject<{
@@ -1494,6 +1510,13 @@ export declare const TelemetryEventSchema: z.ZodObject<{
1494
1510
  }>;
1495
1511
  fingerprint: z.ZodOptional<z.ZodString>;
1496
1512
  occurrence: z.ZodOptional<z.ZodNumber>;
1513
+ runtime: z.ZodOptional<z.ZodEnum<{
1514
+ readonly COMPUTER: "computer";
1515
+ readonly OTHER: "other";
1516
+ readonly WEB: "web";
1517
+ readonly ELECTRON: "electron";
1518
+ readonly TAURI: "tauri";
1519
+ }>>;
1497
1520
  }, z.core.$strip>>;
1498
1521
  refusal: z.ZodOptional<z.ZodObject<{
1499
1522
  tool: z.ZodString;
package/dist/telemetry.js CHANGED
@@ -23,7 +23,7 @@ import { NextStepOffered, OnboardingPhase, OnboardingStepSchema, OnboardingStepS
23
23
  export { NextStepOffered, OnboardingPhase, OnboardingStepSchema, OnboardingStepStatus, OnboardingStop, OnboardingSteps, };
24
24
  import { ToolRefusalSchema } from './telemetry-refusal.js';
25
25
  import { MachineSnapshotSchema, ProjectProfileSchema, SessionSummarySchema, } from './telemetry-session.js';
26
- import { FeedbackSchema } from './telemetry-feedback.js';
26
+ import { FeedbackSchema, TelemetryRuntime } from './telemetry-feedback.js';
27
27
  import { BrowserBrand } from './browser-brand.js';
28
28
  import { CaptureLoss, VerifiedReason } from './verdict/verified-constants.js';
29
29
  import { IdentitySchema } from './telemetry-feedback.js';
@@ -373,6 +373,11 @@ export const VerificationSchema = z.object({
373
373
  */
374
374
  driven: z.nativeEnum(VerificationDriver).optional(),
375
375
  /** The page SDK version from its HELLO: our own release number, or `other`. Absent if unsaid. */
376
+ /**
377
+ * The runtime of the session: a page (`web`), a desktop shell, or Reticle's computer. Without it a
378
+ * verdict on a desktop application could not be told from one on a page.
379
+ */
380
+ runtime: z.nativeEnum(TelemetryRuntime).optional(),
376
381
  sdkVersion: z.string().min(1).max(32).optional(),
377
382
  });
378
383
  /** Which way the installed version moved, and between which versions. */
@@ -1,4 +1,5 @@
1
1
  import { PredicateKind } from './consequence.js';
2
+ import { describePropertyAssertion } from './property-assertion.js';
2
3
  /** Joins the parts of a conjunction in one sentence. */
3
4
  const PART_GAP = '; ';
4
5
  const ALL_OF_LEAD = 'Not all of these happened: ';
@@ -31,7 +32,13 @@ function noun(predicate) {
31
32
  case PredicateKind.NET:
32
33
  return `a ${predicate.method === undefined ? '' : `${predicate.method} `}request${predicate.urlContains === undefined ? '' : ` to ${predicate.urlContains}`}`;
33
34
  case PredicateKind.TEXT:
34
- return `the text "${predicate.contains ?? ''}"`;
35
+ if (predicate.contains !== undefined) {
36
+ return `the text "${predicate.contains}"`;
37
+ }
38
+ if (predicate.satisfies !== undefined) {
39
+ return `text ${describePropertyAssertion(predicate.satisfies)}`;
40
+ }
41
+ return 'the text';
35
42
  case PredicateKind.SIGNAL:
36
43
  return predicate.name === undefined ? 'a signal' : `the app reporting "${predicate.name}"`;
37
44
  case PredicateKind.ROUTE:
@@ -2,6 +2,7 @@
2
2
  * What a verification can FIND — the vocabulary of faults and contradictions shared by the crawl,
3
3
  * the contradiction hunter and the tools that report them.
4
4
  */
5
+ import { z } from 'zod';
5
6
  import { ChannelId } from '../wire/channel.js';
6
7
  /**
7
8
  * Cross-channel contradictions: two observation channels making INCOMPATIBLE claims about the same
@@ -33,7 +34,29 @@ export interface Contradiction {
33
34
  counter: string;
34
35
  /** Concrete evidence, so the agent can go straight to the call or the control. */
35
36
  detail: string;
37
+ /**
38
+ * How many entries `detail` does not name, when it lists only some of them. Absent when the
39
+ * list is whole.
40
+ */
41
+ omitted?: number;
42
+ /**
43
+ * `true` when `detail` lists only some of the entries, or shortens one. Absent when the list is
44
+ * whole.
45
+ */
46
+ truncated?: true;
36
47
  }
48
+ /**
49
+ * The wire shape of a `Contradiction`, for a tool's output schema. A validating client removes a
50
+ * field that the schema does not list, so `omitted` and `truncated` must be listed here (#2496).
51
+ */
52
+ export declare const ContradictionSchema: z.ZodObject<{
53
+ kind: z.ZodString;
54
+ claim: z.ZodString;
55
+ counter: z.ZodString;
56
+ detail: z.ZodString;
57
+ omitted: z.ZodOptional<z.ZodNumber>;
58
+ truncated: z.ZodOptional<z.ZodLiteral<true>>;
59
+ }, z.core.$strip>;
37
60
  export declare const ContradictionKind: {
38
61
  /** The screen moved forward while a request in the same window failed — the swallowed rejection. */
39
62
  readonly UI_ADVANCED_REQUEST_FAILED: "ui-advanced-request-failed";
@@ -2,7 +2,26 @@
2
2
  * What a verification can FIND — the vocabulary of faults and contradictions shared by the crawl,
3
3
  * the contradiction hunter and the tools that report them.
4
4
  */
5
+ import { z } from 'zod';
5
6
  import { ChannelId, disagreementCanConvict } from '../wire/channel.js';
7
+ /**
8
+ * The wire shape of a `Contradiction`, for a tool's output schema. A validating client removes a
9
+ * field that the schema does not list, so `omitted` and `truncated` must be listed here (#2496).
10
+ */
11
+ export const ContradictionSchema = z.object({
12
+ kind: z.string(),
13
+ claim: z.string(),
14
+ counter: z.string(),
15
+ detail: z.string(),
16
+ omitted: z
17
+ .number()
18
+ .optional()
19
+ .describe('How many entries `detail` does not name. Absent when the list is whole.'),
20
+ truncated: z
21
+ .literal(true)
22
+ .optional()
23
+ .describe('true when `detail` lists only some entries, or shortens one. Absent when the list is whole.'),
24
+ });
6
25
  export const ContradictionKind = {
7
26
  /** The screen moved forward while a request in the same window failed — the swallowed rejection. */
8
27
  UI_ADVANCED_REQUEST_FAILED: 'ui-advanced-request-failed',
@@ -111,3 +111,8 @@ export declare const propertyAssertionSchema: z.ZodDiscriminatedUnion<[z.ZodObje
111
111
  tolerance: z.ZodOptional<z.ZodNumber>;
112
112
  }, z.core.$strict>>;
113
113
  }, z.core.$strict>], "property">;
114
+ /**
115
+ * A short phrase describing a property assertion for claim titles and sentences.
116
+ * e.g. "matching /\d+ items/", "that is non-empty"
117
+ */
118
+ export declare function describePropertyAssertion(assertion: PropertyAssertion): string;