@reticlehq/core 3.10.2 → 3.10.4

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 (38) hide show
  1. package/dist/artifacts/harness-credits.d.ts +1 -1
  2. package/dist/artifacts/harness-credits.js +1 -1
  3. package/dist/artifacts/impact-constants.d.ts +22 -0
  4. package/dist/artifacts/impact-constants.js +17 -0
  5. package/dist/artifacts/impact.d.ts +0 -16
  6. package/dist/artifacts/impact.js +2 -11
  7. package/dist/browser-brand.d.ts +28 -0
  8. package/dist/browser-brand.js +27 -0
  9. package/dist/identity/github-action.d.ts +2 -2
  10. package/dist/identity/github-action.js +1 -1
  11. package/dist/index.d.ts +5 -0
  12. package/dist/index.js +7 -0
  13. package/dist/page-entry.d.ts +53 -0
  14. package/dist/page-entry.js +53 -0
  15. package/dist/telemetry-entry.d.ts +1 -0
  16. package/dist/telemetry-entry.js +2 -0
  17. package/dist/telemetry-feedback.d.ts +0 -22
  18. package/dist/telemetry-feedback.js +0 -21
  19. package/dist/telemetry.d.ts +2 -2
  20. package/dist/telemetry.js +2 -1
  21. package/dist/verdict/instrumentation-coverage.js +1 -1
  22. package/dist/verdict/step-screenshot.d.ts +24 -0
  23. package/dist/verdict/step-screenshot.js +24 -0
  24. package/dist/verdict/verification-run.d.ts +0 -27
  25. package/dist/verdict/verification-run.js +0 -26
  26. package/dist/wire/constants/constants.d.ts +8 -8
  27. package/dist/wire/constants/constants.js +8 -8
  28. package/dist/wire/coverage-marker.d.ts +23 -0
  29. package/dist/wire/coverage-marker.js +22 -0
  30. package/dist/wire/event-payloads.js +1 -1
  31. package/dist/wire/messages.d.ts +0 -5
  32. package/dist/wire/messages.js +1 -4
  33. package/dist/wire/page-parse.d.ts +37 -0
  34. package/dist/wire/page-parse.js +207 -0
  35. package/dist/wire/platform-link.d.ts +0 -17
  36. package/dist/wire/platform-link.js +0 -16
  37. package/dist/wire/types.d.ts +5 -0
  38. package/package.json +6 -2
@@ -8,7 +8,7 @@
8
8
  *
9
9
  * Served from `@reticlehq/core/hud` only: from the root entry it rode into every page's first load.
10
10
  */
11
- import { CreditKind } from './impact.js';
11
+ import { CreditKind } from './impact-constants.js';
12
12
  /** The trial a card starts. Not on the wire; the platform's own sentence names it the same. */
13
13
  export declare const TRIAL_DAYS = 14;
14
14
  /**
@@ -8,7 +8,7 @@
8
8
  *
9
9
  * Served from `@reticlehq/core/hud` only: from the root entry it rode into every page's first load.
10
10
  */
11
- import { CreditKind } from './impact.js';
11
+ import { CreditKind } from './impact-constants.js';
12
12
  /** The trial a card starts. Not on the wire; the platform's own sentence names it the same. */
13
13
  export const TRIAL_DAYS = 14;
14
14
  /**
@@ -0,0 +1,22 @@
1
+ /**
2
+ * Plain constants of the impact snapshot the HUD shows.
3
+ *
4
+ * No zod here: the SDK reads these on the way in, and a module that builds classic zod schemas
5
+ * brings about 85 KB onto every page (#2369).
6
+ */
7
+ /** The grant credits came from: sign-up, the card-started trial, or a paid plan. */
8
+ export declare const CreditKind: {
9
+ readonly FREE: "free";
10
+ readonly TRIAL: "trial";
11
+ readonly PAID: "paid";
12
+ };
13
+ export type CreditKind = (typeof CreditKind)[keyof typeof CreditKind];
14
+ /**
15
+ * How many recent defects a scope remembers.
16
+ *
17
+ * Small on purpose. `counts.failed` already says HOW MANY defects there have been; this list exists
18
+ * so the HUD can say WHICH ONES, and a panel in the corner of somebody's app is not a triage queue.
19
+ * Ten is enough to recognise what is currently broken and short enough that the record stays a
20
+ * counters file rather than becoming a log.
21
+ */
22
+ export declare const IMPACT_DEFECT_LIMIT = 10;
@@ -0,0 +1,17 @@
1
+ /**
2
+ * Plain constants of the impact snapshot the HUD shows.
3
+ *
4
+ * No zod here: the SDK reads these on the way in, and a module that builds classic zod schemas
5
+ * brings about 85 KB onto every page (#2369).
6
+ */
7
+ /** The grant credits came from: sign-up, the card-started trial, or a paid plan. */
8
+ export const CreditKind = { FREE: 'free', TRIAL: 'trial', PAID: 'paid' };
9
+ /**
10
+ * How many recent defects a scope remembers.
11
+ *
12
+ * Small on purpose. `counts.failed` already says HOW MANY defects there have been; this list exists
13
+ * so the HUD can say WHICH ONES, and a panel in the corner of somebody's app is not a triage queue.
14
+ * Ten is enough to recognise what is currently broken and short enough that the record stays a
15
+ * counters file rather than becoming a log.
16
+ */
17
+ export const IMPACT_DEFECT_LIMIT = 10;
@@ -80,15 +80,6 @@ export declare const ImpactSavingsSchema: z.ZodObject<{
80
80
  }, z.core.$strip>;
81
81
  }, z.core.$strip>;
82
82
  export type ImpactSavings = z.infer<typeof ImpactSavingsSchema>;
83
- /**
84
- * How many recent defects a scope remembers.
85
- *
86
- * Small on purpose. `counts.failed` already says HOW MANY defects there have been; this list exists
87
- * so the HUD can say WHICH ONES, and a panel in the corner of somebody's app is not a triage queue.
88
- * Ten is enough to recognise what is currently broken and short enough that the record stays a
89
- * counters file rather than becoming a log.
90
- */
91
- export declare const IMPACT_DEFECT_LIMIT = 10;
92
83
  /**
93
84
  * One defect, as the HUD shows it.
94
85
  *
@@ -183,13 +174,6 @@ export declare const AccountStateSchema: z.ZodObject<{
183
174
  host: z.ZodOptional<z.ZodString>;
184
175
  }, z.core.$strip>;
185
176
  export type AccountState = z.infer<typeof AccountStateSchema>;
186
- /** The grant credits came from: sign-up, the card-started trial, or a paid plan. */
187
- export declare const CreditKind: {
188
- readonly FREE: "free";
189
- readonly TRIAL: "trial";
190
- readonly PAID: "paid";
191
- };
192
- export type CreditKind = (typeof CreditKind)[keyof typeof CreditKind];
193
177
  /**
194
178
  * What the platform says about autonomous driving for this project.
195
179
  *
@@ -1,4 +1,6 @@
1
1
  import * as z from 'zod';
2
+ // Plain constants live in a zod-free module, so the SDK reads them without zod (#2369).
3
+ import { CreditKind } from './impact-constants.js';
2
4
  /**
3
5
  * The impact record: what Reticle has actually done for this user, and what that is worth.
4
6
  *
@@ -76,15 +78,6 @@ export const ImpactSavingsSchema = z.object({
76
78
  /** Minutes not spent, vs the re-prompt cycle a false green costs. */
77
79
  minutes: ImpactEstimateSchema,
78
80
  });
79
- /**
80
- * How many recent defects a scope remembers.
81
- *
82
- * Small on purpose. `counts.failed` already says HOW MANY defects there have been; this list exists
83
- * so the HUD can say WHICH ONES, and a panel in the corner of somebody's app is not a triage queue.
84
- * Ten is enough to recognise what is currently broken and short enough that the record stays a
85
- * counters file rather than becoming a log.
86
- */
87
- export const IMPACT_DEFECT_LIMIT = 10;
88
81
  /**
89
82
  * One defect, as the HUD shows it.
90
83
  *
@@ -140,8 +133,6 @@ export const AccountStateSchema = z.object({
140
133
  email: z.string().optional(),
141
134
  host: z.string().optional(),
142
135
  });
143
- /** The grant credits came from: sign-up, the card-started trial, or a paid plan. */
144
- export const CreditKind = { FREE: 'free', TRIAL: 'trial', PAID: 'paid' };
145
136
  /**
146
137
  * What the platform says about autonomous driving for this project.
147
138
  *
@@ -0,0 +1,28 @@
1
+ /**
2
+ * The browser a page runs in, by brand.
3
+ *
4
+ * No zod here: the SDK reads these on the way in, and a module that builds classic zod schemas
5
+ * brings about 85 KB onto every page (#2369).
6
+ */
7
+ /**
8
+ * The browser BRAND behind the connected page — the axis `engine` cannot answer.
9
+ *
10
+ * Chrome, Edge, Arc, Dia, Brave and Opera are all `blink`, and the most common mode by far is
11
+ * `attached`: Reticle launched nothing, so the page itself is the only thing that knows which
12
+ * browser it is. A CLOSED list on purpose — the raw UA string and a raw `userAgentData` brand are
13
+ * both unbounded and fingerprintable, so anything unrecognised reports `OTHER` rather than
14
+ * forwarding an unrecognised name.
15
+ */
16
+ export declare const BrowserBrand: {
17
+ readonly CHROME: "chrome";
18
+ readonly EDGE: "edge";
19
+ readonly ARC: "arc";
20
+ readonly DIA: "dia";
21
+ readonly BRAVE: "brave";
22
+ readonly OPERA: "opera";
23
+ readonly FIREFOX: "firefox";
24
+ readonly SAFARI: "safari";
25
+ /** Anything we do not recognise — including a Chromium that names no brand at all. */
26
+ readonly OTHER: "other";
27
+ };
28
+ export type BrowserBrand = (typeof BrowserBrand)[keyof typeof BrowserBrand];
@@ -0,0 +1,27 @@
1
+ /**
2
+ * The browser a page runs in, by brand.
3
+ *
4
+ * No zod here: the SDK reads these on the way in, and a module that builds classic zod schemas
5
+ * brings about 85 KB onto every page (#2369).
6
+ */
7
+ /**
8
+ * The browser BRAND behind the connected page — the axis `engine` cannot answer.
9
+ *
10
+ * Chrome, Edge, Arc, Dia, Brave and Opera are all `blink`, and the most common mode by far is
11
+ * `attached`: Reticle launched nothing, so the page itself is the only thing that knows which
12
+ * browser it is. A CLOSED list on purpose — the raw UA string and a raw `userAgentData` brand are
13
+ * both unbounded and fingerprintable, so anything unrecognised reports `OTHER` rather than
14
+ * forwarding an unrecognised name.
15
+ */
16
+ export const BrowserBrand = {
17
+ CHROME: 'chrome',
18
+ EDGE: 'edge',
19
+ ARC: 'arc',
20
+ DIA: 'dia',
21
+ BRAVE: 'brave',
22
+ OPERA: 'opera',
23
+ FIREFOX: 'firefox',
24
+ SAFARI: 'safari',
25
+ /** Anything we do not recognise — including a Chromium that names no brand at all. */
26
+ OTHER: 'other',
27
+ };
@@ -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.2";
7
- export declare const RETICLE_ACTION_USES = "reticlehq/reticle/action@v3.10.2";
6
+ export declare const RETICLE_ACTION_VERSION = "3.10.4";
7
+ export declare const RETICLE_ACTION_USES = "reticlehq/reticle/action@v3.10.4";
@@ -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.2';
6
+ export const RETICLE_ACTION_VERSION = '3.10.4';
7
7
  export const RETICLE_ACTION_USES = `reticlehq/reticle/action@v${RETICLE_ACTION_VERSION}`;
package/dist/index.d.ts CHANGED
@@ -49,6 +49,11 @@ export * from './wire/constants/determinism.js';
49
49
  export * from './identity/document-identity.js';
50
50
  export * from './identity/edit-epoch.js';
51
51
  export * from './wire/messages.js';
52
+ export * from './wire/page-parse.js';
53
+ export * from './wire/coverage-marker.js';
54
+ export * from './verdict/step-screenshot.js';
55
+ export * from './browser-brand.js';
56
+ export * from './artifacts/impact-constants.js';
52
57
  export * from './wire/production/hello-mode.js';
53
58
  export * from './wire/production/production-policy.js';
54
59
  export * from './wire/production/activation-ticket.js';
package/dist/index.js CHANGED
@@ -51,6 +51,13 @@ export * from './wire/constants/determinism.js'; // the clock and random source
51
51
  export * from './identity/document-identity.js'; // which document an observation belongs to
52
52
  export * from './identity/edit-epoch.js'; // which round of source edits an observation belongs to
53
53
  export * from './wire/messages.js'; // ReticleEvent + the message schemas
54
+ // zod-free modules the SDK reads on the way in. Exported here, not through the classic module
55
+ // beside them: a name that passes through a module keeps all of its schemas on the page (#2369).
56
+ export * from './wire/page-parse.js'; // the two messages a page reads on the way in, checked without zod
57
+ export * from './wire/coverage-marker.js';
58
+ export * from './verdict/step-screenshot.js';
59
+ export * from './browser-brand.js';
60
+ export * from './artifacts/impact-constants.js';
54
61
  export * from './wire/production/hello-mode.js'; // HelloEnv / HelloScope: a leaf the SDK sends
55
62
  export * from './wire/production/production-policy.js'; // the production action policy: rules + refused requests
56
63
  export * from './wire/production/activation-ticket.js'; // the signed ticket a live page checks before it loads the SDK
@@ -0,0 +1,53 @@
1
+ /**
2
+ * `@reticlehq/core/page` — what the SDK reads on a page's first load, and nothing that needs zod.
3
+ *
4
+ * The SDK imports this entry, not core's root, for every value it uses on the way in. The root
5
+ * exports every module in core, schemas included, and a bundler that sees the root on the first
6
+ * load also puts there every module a later chunk uses through it: one schema brought most of zod
7
+ * (about 95 KB) onto every page (#2369). Only zod-free modules are named here.
8
+ * `first-load-size.test.ts` fails when zod reaches the first load.
9
+ *
10
+ * Generated from the SDK's imports. A value the SDK needs on the way in is added here, from the
11
+ * module that defines it.
12
+ */
13
+ export { AnchorKind, AnnotationKind, DEGRADED_ANCHOR_ROLE, FLOW_FILE_VERSION, RecorderPhase, } from './artifacts/flow-constants.js';
14
+ export { ACT_STEP_TOOL } from './artifacts/flow-step-tool.js';
15
+ export { CreditKind, IMPACT_DEFECT_LIMIT } from './artifacts/impact-constants.js';
16
+ export { BrowserBrand } from './browser-brand.js';
17
+ export { asRef } from './identity/brand.js';
18
+ export { CONTRACT_FINGERPRINT, CONTRACT_PARTS, fnv1a } from './identity/contract-fingerprint.js';
19
+ export { newDocumentId } from './identity/document-identity.js';
20
+ export { NO_EDITS_OBSERVED } from './identity/edit-epoch.js';
21
+ export { DATA_RETICLE_SOURCE_ATTR, RETICLE_ROOT_GLOBAL, RETICLE_SDK_VERSION_GLOBAL, } from './identity/source-constants.js';
22
+ export { ALTERNATIVE_TESTID_ATTRS, DEFAULT_TESTID_ATTR, TESTID_ATTR_PATTERN, } from './identity/testid-attribute.js';
23
+ export { PredicateKind } from './verdict/consequence.js';
24
+ export { SESSION_REF } from './verdict/predicate-tree.js';
25
+ export { OutwardAction, isDangerousActionText, isDangerousNavigation, isInertHref, isLocalPage, isLoopbackHostname, isPaymentField, outwardActionOf, outwardRefusal, withoutFilenameTokens, } from './verdict/security.js';
26
+ export { STEP_SCREENSHOT } from './verdict/step-screenshot.js';
27
+ export { BlindSpotKind } from './verdict/verified-constants.js';
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';
30
+ export { ANIMATION_TARGET_ARG } from './wire/constants/animation-command.js';
31
+ export { DROPPED_PRE_ATTACH_FIELD, PRE_ATTACH_FIELD, RETICLE_PRE_ATTACH_ERRORS, } from './wire/constants/console-event.js';
32
+ export { 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
+ export { DETERMINISM_GLOBAL_KEY } from './wire/constants/determinism.js';
34
+ 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';
36
+ export { FlowProgressStatus, HUD_RELOAD_TO_RESTORE, HudCorner, HudPanel, HudPromptSurface, HudToggle, HudView, HudVisibility, ScriptStatus, } from './wire/constants/hud-use.js';
37
+ export { MatchArg } from './wire/constants/match-args.js';
38
+ export { ResponseBodyReason } from './wire/constants/response-body-reason.js';
39
+ export { RETICLE_OVERLAY_SELECTOR } from './wire/constants/reticle-chrome.js';
40
+ export { HealthReason, HumanControlKind, MarkAnchorStrategy, SESSION_AUTO, SESSION_HEALTH, SESSION_LIFECYCLE, SessionState, isSessionState, } from './wire/constants/session-constants.js';
41
+ export { CoverageMarker, SOURCE_MAPPING_CAPABILITY } from './wire/coverage-marker.js';
42
+ export { RETICLE_IPC_GLOBAL, RETICLE_TAURI_CAPTURE_COMMAND } from './wire/desktop-contract.js';
43
+ export { CHURN_TYPES } from './wire/event-classification.js';
44
+ export { isGlobalPress, pressKeyFromArgs, pressKeysFromArgs } from './wire/global-press.js';
45
+ export { clampHoldMs } from './wire/hold.js';
46
+ export { IPC_URL_SCHEME, IpcStatus, NEXT_ACTION_FIELD, NEXT_ACTION_HEADER, NetInitiator, REQUEST_SHAPE_FIELD, REQUEST_SHAPE_NONE, } from './wire/net.js';
47
+ export { CommandActor, parseCommandMessage, parseElementQuery } from './wire/page-parse.js';
48
+ export { PlatformProfile } from './wire/platform.js';
49
+ export { HelloInstrumentation } from './wire/production/hello-mode.js';
50
+ export { buildRedactionPolicy, isSensitiveKey, netUrlFields, redactUrl, scrubKnownSecrets, setActiveRedactionPolicy, wireRedactionKeys, } from './wire/redaction.js';
51
+ export { capDepth, selectPath } from './wire/state-select.js';
52
+ export { PresenterTone, isPresenterTone } from './words/notices.js';
53
+ export { UNREACHABLE_NOTICE_PREFIX } from './words/unreachable-notice.js';
@@ -0,0 +1,53 @@
1
+ /**
2
+ * `@reticlehq/core/page` — what the SDK reads on a page's first load, and nothing that needs zod.
3
+ *
4
+ * The SDK imports this entry, not core's root, for every value it uses on the way in. The root
5
+ * exports every module in core, schemas included, and a bundler that sees the root on the first
6
+ * load also puts there every module a later chunk uses through it: one schema brought most of zod
7
+ * (about 95 KB) onto every page (#2369). Only zod-free modules are named here.
8
+ * `first-load-size.test.ts` fails when zod reaches the first load.
9
+ *
10
+ * Generated from the SDK's imports. A value the SDK needs on the way in is added here, from the
11
+ * module that defines it.
12
+ */
13
+ export { AnchorKind, AnnotationKind, DEGRADED_ANCHOR_ROLE, FLOW_FILE_VERSION, RecorderPhase, } from './artifacts/flow-constants.js';
14
+ export { ACT_STEP_TOOL } from './artifacts/flow-step-tool.js';
15
+ export { CreditKind, IMPACT_DEFECT_LIMIT } from './artifacts/impact-constants.js';
16
+ export { BrowserBrand } from './browser-brand.js';
17
+ export { asRef } from './identity/brand.js';
18
+ export { CONTRACT_FINGERPRINT, CONTRACT_PARTS, fnv1a } from './identity/contract-fingerprint.js';
19
+ export { newDocumentId } from './identity/document-identity.js';
20
+ export { NO_EDITS_OBSERVED } from './identity/edit-epoch.js';
21
+ export { DATA_RETICLE_SOURCE_ATTR, RETICLE_ROOT_GLOBAL, RETICLE_SDK_VERSION_GLOBAL, } from './identity/source-constants.js';
22
+ export { ALTERNATIVE_TESTID_ATTRS, DEFAULT_TESTID_ATTR, TESTID_ATTR_PATTERN, } from './identity/testid-attribute.js';
23
+ export { PredicateKind } from './verdict/consequence.js';
24
+ export { SESSION_REF } from './verdict/predicate-tree.js';
25
+ export { OutwardAction, isDangerousActionText, isDangerousNavigation, isInertHref, isLocalPage, isLoopbackHostname, isPaymentField, outwardActionOf, outwardRefusal, withoutFilenameTokens, } from './verdict/security.js';
26
+ export { STEP_SCREENSHOT } from './verdict/step-screenshot.js';
27
+ export { BlindSpotKind } from './verdict/verified-constants.js';
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';
30
+ export { ANIMATION_TARGET_ARG } from './wire/constants/animation-command.js';
31
+ export { DROPPED_PRE_ATTACH_FIELD, PRE_ATTACH_FIELD, RETICLE_PRE_ATTACH_ERRORS, } from './wire/constants/console-event.js';
32
+ export { 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
+ export { DETERMINISM_GLOBAL_KEY } from './wire/constants/determinism.js';
34
+ 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';
36
+ export { FlowProgressStatus, HUD_RELOAD_TO_RESTORE, HudCorner, HudPanel, HudPromptSurface, HudToggle, HudView, HudVisibility, ScriptStatus, } from './wire/constants/hud-use.js';
37
+ export { MatchArg } from './wire/constants/match-args.js';
38
+ export { ResponseBodyReason } from './wire/constants/response-body-reason.js';
39
+ export { RETICLE_OVERLAY_SELECTOR } from './wire/constants/reticle-chrome.js';
40
+ export { HealthReason, HumanControlKind, MarkAnchorStrategy, SESSION_AUTO, SESSION_HEALTH, SESSION_LIFECYCLE, SessionState, isSessionState, } from './wire/constants/session-constants.js';
41
+ export { CoverageMarker, SOURCE_MAPPING_CAPABILITY } from './wire/coverage-marker.js';
42
+ export { RETICLE_IPC_GLOBAL, RETICLE_TAURI_CAPTURE_COMMAND } from './wire/desktop-contract.js';
43
+ export { CHURN_TYPES } from './wire/event-classification.js';
44
+ export { isGlobalPress, pressKeyFromArgs, pressKeysFromArgs } from './wire/global-press.js';
45
+ export { clampHoldMs } from './wire/hold.js';
46
+ export { IPC_URL_SCHEME, IpcStatus, NEXT_ACTION_FIELD, NEXT_ACTION_HEADER, NetInitiator, REQUEST_SHAPE_FIELD, REQUEST_SHAPE_NONE, } from './wire/net.js';
47
+ export { CommandActor, parseCommandMessage, parseElementQuery } from './wire/page-parse.js';
48
+ export { PlatformProfile } from './wire/platform.js';
49
+ export { HelloInstrumentation } from './wire/production/hello-mode.js';
50
+ export { buildRedactionPolicy, isSensitiveKey, netUrlFields, redactUrl, scrubKnownSecrets, setActiveRedactionPolicy, wireRedactionKeys, } from './wire/redaction.js';
51
+ export { capDepth, selectPath } from './wire/state-select.js';
52
+ export { PresenterTone, isPresenterTone } from './words/notices.js';
53
+ export { UNREACHABLE_NOTICE_PREFIX } from './words/unreachable-notice.js';
@@ -13,4 +13,5 @@ export * from './telemetry-refusal.js';
13
13
  export * from './telemetry-session.js';
14
14
  export * from './telemetry-license.js';
15
15
  export * from './telemetry-feedback.js';
16
+ export * from './browser-brand.js';
16
17
  export * from './telemetry-signals.js';
@@ -13,4 +13,6 @@ export * from './telemetry-refusal.js';
13
13
  export * from './telemetry-session.js';
14
14
  export * from './telemetry-license.js';
15
15
  export * from './telemetry-feedback.js';
16
+ // Moved out of telemetry-feedback.ts so the SDK reads it without zod (#2373); still exported here.
17
+ export * from './browser-brand.js';
16
18
  export * from './telemetry-signals.js';
@@ -80,28 +80,6 @@ export declare const BrowserEngine: {
80
80
  readonly WEBKIT: "webkit";
81
81
  };
82
82
  export type BrowserEngine = (typeof BrowserEngine)[keyof typeof BrowserEngine];
83
- /**
84
- * The browser BRAND behind the connected page — the axis `engine` cannot answer.
85
- *
86
- * Chrome, Edge, Arc, Dia, Brave and Opera are all `blink`, and the most common mode by far is
87
- * `attached`: Reticle launched nothing, so the page itself is the only thing that knows which
88
- * browser it is. A CLOSED list on purpose — the raw UA string and a raw `userAgentData` brand are
89
- * both unbounded and fingerprintable, so anything unrecognised reports `OTHER` rather than
90
- * forwarding an unrecognised name.
91
- */
92
- export declare const BrowserBrand: {
93
- readonly CHROME: "chrome";
94
- readonly EDGE: "edge";
95
- readonly ARC: "arc";
96
- readonly DIA: "dia";
97
- readonly BRAVE: "brave";
98
- readonly OPERA: "opera";
99
- readonly FIREFOX: "firefox";
100
- readonly SAFARI: "safari";
101
- /** Anything we do not recognise — including a Chromium that names no brand at all. */
102
- readonly OTHER: "other";
103
- };
104
- export type BrowserBrand = (typeof BrowserBrand)[keyof typeof BrowserBrand];
105
83
  /** How Reticle reaches the page: a driven CDP browser, or the SDK inside the human's own browser. */
106
84
  export declare const PageDriver: {
107
85
  readonly CDP: "cdp";
@@ -76,27 +76,6 @@ export const BrowserEngine = {
76
76
  GECKO: 'gecko',
77
77
  WEBKIT: 'webkit',
78
78
  };
79
- /**
80
- * The browser BRAND behind the connected page — the axis `engine` cannot answer.
81
- *
82
- * Chrome, Edge, Arc, Dia, Brave and Opera are all `blink`, and the most common mode by far is
83
- * `attached`: Reticle launched nothing, so the page itself is the only thing that knows which
84
- * browser it is. A CLOSED list on purpose — the raw UA string and a raw `userAgentData` brand are
85
- * both unbounded and fingerprintable, so anything unrecognised reports `OTHER` rather than
86
- * forwarding an unrecognised name.
87
- */
88
- export const BrowserBrand = {
89
- CHROME: 'chrome',
90
- EDGE: 'edge',
91
- ARC: 'arc',
92
- DIA: 'dia',
93
- BRAVE: 'brave',
94
- OPERA: 'opera',
95
- FIREFOX: 'firefox',
96
- SAFARI: 'safari',
97
- /** Anything we do not recognise — including a Chromium that names no brand at all. */
98
- OTHER: 'other',
99
- };
100
79
  /** How Reticle reaches the page: a driven CDP browser, or the SDK inside the human's own browser. */
101
80
  export const PageDriver = {
102
81
  CDP: 'cdp',
@@ -371,8 +371,8 @@ export declare const CrashSchema: z.ZodObject<{
371
371
  errno: z.ZodOptional<z.ZodString>;
372
372
  loopback: z.ZodOptional<z.ZodBoolean>;
373
373
  port: z.ZodOptional<z.ZodEnum<{
374
- reticle: "reticle";
375
374
  other: "other";
375
+ reticle: "reticle";
376
376
  }>>;
377
377
  internalFrame: z.ZodOptional<z.ZodString>;
378
378
  }, z.core.$strip>;
@@ -1352,8 +1352,8 @@ export declare const TelemetryEventSchema: z.ZodObject<{
1352
1352
  errno: z.ZodOptional<z.ZodString>;
1353
1353
  loopback: z.ZodOptional<z.ZodBoolean>;
1354
1354
  port: z.ZodOptional<z.ZodEnum<{
1355
- reticle: "reticle";
1356
1355
  other: "other";
1356
+ reticle: "reticle";
1357
1357
  }>>;
1358
1358
  internalFrame: z.ZodOptional<z.ZodString>;
1359
1359
  }, z.core.$strip>>;
package/dist/telemetry.js CHANGED
@@ -23,7 +23,8 @@ 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 { BrowserBrand, FeedbackSchema } from './telemetry-feedback.js';
26
+ import { FeedbackSchema } from './telemetry-feedback.js';
27
+ import { BrowserBrand } from './browser-brand.js';
27
28
  import { CaptureLoss, VerifiedReason } from './verdict/verified-constants.js';
28
29
  import { IdentitySchema } from './telemetry-feedback.js';
29
30
  import { LicenseActivation } from './telemetry-license.js';
@@ -14,7 +14,7 @@
14
14
  import * as z from 'zod';
15
15
  import { ChannelId } from 'open-verification';
16
16
  import { InstrumentationGapKind, fixForGap } from './instrumentation-gap.js';
17
- import { CoverageMarker, SOURCE_MAPPING_CAPABILITY } from '../wire/platform-link.js';
17
+ import { CoverageMarker, SOURCE_MAPPING_CAPABILITY } from '../wire/coverage-marker.js';
18
18
  /** The eight things that decide how strong a verdict on this app can be. */
19
19
  export const CoverageCapability = {
20
20
  PAGE_CONNECTED: 'page connected',
@@ -0,0 +1,24 @@
1
+ /**
2
+ * Where a run keeps its step screenshots.
3
+ *
4
+ * No zod here: the SDK reads these on the way in, and a module that builds classic zod schemas
5
+ * brings about 85 KB onto every page (#2369).
6
+ */
7
+ /** How a step screenshot is taken and kept — shared by the daemon, the SDK and the platform. */
8
+ export declare const STEP_SCREENSHOT: {
9
+ /** `.reticle/visual/runs/<runId>/<seq>-<tool>.jpg` */
10
+ readonly RUNS_DIR: "runs";
11
+ /** One line per landed screenshot, beside the images: what the run artifact and the upload read. */
12
+ readonly MANIFEST_FILE: "shots.jsonl";
13
+ readonly JPEG_QUALITY: 0.7;
14
+ readonly MAX_SIDE_PX: 1600;
15
+ /** The platform refuses more than this for one run, so the daemon stops taking them there. */
16
+ readonly MAX_PER_RUN: 300;
17
+ /** The platform refuses an image larger than this, decoded. */
18
+ readonly MAX_BYTES: number;
19
+ /**
20
+ * The `tool` of a frame: a picture taken between steps while Reticle drives a tab, about once a
21
+ * second. Frames share the run's `seq`, so the shots in `seq` order play the run as a film.
22
+ */
23
+ readonly FRAME_TOOL: "frame";
24
+ };
@@ -0,0 +1,24 @@
1
+ /**
2
+ * Where a run keeps its step screenshots.
3
+ *
4
+ * No zod here: the SDK reads these on the way in, and a module that builds classic zod schemas
5
+ * brings about 85 KB onto every page (#2369).
6
+ */
7
+ /** How a step screenshot is taken and kept — shared by the daemon, the SDK and the platform. */
8
+ export const STEP_SCREENSHOT = {
9
+ /** `.reticle/visual/runs/<runId>/<seq>-<tool>.jpg` */
10
+ RUNS_DIR: 'runs',
11
+ /** One line per landed screenshot, beside the images: what the run artifact and the upload read. */
12
+ MANIFEST_FILE: 'shots.jsonl',
13
+ JPEG_QUALITY: 0.7,
14
+ MAX_SIDE_PX: 1600,
15
+ /** The platform refuses more than this for one run, so the daemon stops taking them there. */
16
+ MAX_PER_RUN: 300,
17
+ /** The platform refuses an image larger than this, decoded. */
18
+ MAX_BYTES: 1.5 * 1024 * 1024,
19
+ /**
20
+ * The `tool` of a frame: a picture taken between steps while Reticle drives a tab, about once a
21
+ * second. Frames share the run's `seq`, so the shots in `seq` order play the run as a film.
22
+ */
23
+ FRAME_TOOL: 'frame',
24
+ };
@@ -10,7 +10,6 @@
10
10
  * logic), no `any` (opaque evidence is `z.unknown`), and every domain string is a named constant.
11
11
  */
12
12
  import * as z from 'zod';
13
- import { PredicateKind } from './consequence.js';
14
13
  import { Verified } from './verified-constants.js';
15
14
  /** Schema version stamped into every run file so a reader can reject/upgrade old artifacts. */
16
15
  export declare const RUN_FILE_VERSION = 3;
@@ -71,14 +70,6 @@ export declare function driveFlowStatus(checks: {
71
70
  failed: number;
72
71
  goalMet?: boolean | undefined;
73
72
  }): RunFlowStatus;
74
- /**
75
- * The kind of standalone assertion captured outside a flow.
76
- *
77
- * This is `PredicateKind` -- the vocabulary assertions are written in -- and not a second list: two
78
- * lists drift, and an artifact can only record what somebody can actually assert. Re-exported so
79
- * the places that read it from this file still can.
80
- */
81
- export { PredicateKind };
82
73
  /**
83
74
  * What a check came out as.
84
75
  *
@@ -210,24 +201,6 @@ export declare const ScreenshotSource: {
210
201
  readonly RENDERED: "rendered";
211
202
  };
212
203
  export type ScreenshotSource = (typeof ScreenshotSource)[keyof typeof ScreenshotSource];
213
- /** How a step screenshot is taken and kept — shared by the daemon, the SDK and the platform. */
214
- export declare const STEP_SCREENSHOT: {
215
- /** `.reticle/visual/runs/<runId>/<seq>-<tool>.jpg` */
216
- readonly RUNS_DIR: "runs";
217
- /** One line per landed screenshot, beside the images: what the run artifact and the upload read. */
218
- readonly MANIFEST_FILE: "shots.jsonl";
219
- readonly JPEG_QUALITY: 0.7;
220
- readonly MAX_SIDE_PX: 1600;
221
- /** The platform refuses more than this for one run, so the daemon stops taking them there. */
222
- readonly MAX_PER_RUN: 300;
223
- /** The platform refuses an image larger than this, decoded. */
224
- readonly MAX_BYTES: number;
225
- /**
226
- * The `tool` of a frame: a picture taken between steps while Reticle drives a tab, about once a
227
- * second. Frames share the run's `seq`, so the shots in `seq` order play the run as a film.
228
- */
229
- readonly FRAME_TOOL: "frame";
230
- };
231
204
  /** One step's screenshot as a run artifact records it. `file` is relative to the run's directory. */
232
205
  export declare const StepScreenshotSchema: z.ZodObject<{
233
206
  file: z.ZodString;
@@ -103,14 +103,6 @@ export function driveFlowStatus(checks) {
103
103
  }
104
104
  return 0 < checks.held && false !== checks.goalMet ? RunFlowStatus.PASS : RunFlowStatus.SKIPPED;
105
105
  }
106
- /**
107
- * The kind of standalone assertion captured outside a flow.
108
- *
109
- * This is `PredicateKind` -- the vocabulary assertions are written in -- and not a second list: two
110
- * lists drift, and an artifact can only record what somebody can actually assert. Re-exported so
111
- * the places that read it from this file still can.
112
- */
113
- export { PredicateKind };
114
106
  /**
115
107
  * What a check came out as.
116
108
  *
@@ -217,24 +209,6 @@ export const ScreenshotSource = {
217
209
  BROWSER: 'browser',
218
210
  RENDERED: 'rendered',
219
211
  };
220
- /** How a step screenshot is taken and kept — shared by the daemon, the SDK and the platform. */
221
- export const STEP_SCREENSHOT = {
222
- /** `.reticle/visual/runs/<runId>/<seq>-<tool>.jpg` */
223
- RUNS_DIR: 'runs',
224
- /** One line per landed screenshot, beside the images: what the run artifact and the upload read. */
225
- MANIFEST_FILE: 'shots.jsonl',
226
- JPEG_QUALITY: 0.7,
227
- MAX_SIDE_PX: 1600,
228
- /** The platform refuses more than this for one run, so the daemon stops taking them there. */
229
- MAX_PER_RUN: 300,
230
- /** The platform refuses an image larger than this, decoded. */
231
- MAX_BYTES: 1.5 * 1024 * 1024,
232
- /**
233
- * The `tool` of a frame: a picture taken between steps while Reticle drives a tab, about once a
234
- * second. Frames share the run's `seq`, so the shots in `seq` order play the run as a film.
235
- */
236
- FRAME_TOOL: 'frame',
237
- };
238
212
  /** One step's screenshot as a run artifact records it. `file` is relative to the run's directory. */
239
213
  export const StepScreenshotSchema = z.object({
240
214
  file: z.string(),
@@ -712,6 +712,8 @@ export interface ComponentStateResult {
712
712
  /** Element states the assertion engine can check. */
713
713
  export declare const ElementState: {
714
714
  readonly VISIBLE: "visible";
715
+ /** Rendered on screen (not CSS-hidden), regardless of aria-hidden (#1648). */
716
+ readonly PAINTED: "painted";
715
717
  readonly HIDDEN: "hidden";
716
718
  readonly ENABLED: "enabled";
717
719
  readonly DISABLED: "disabled";
@@ -826,20 +828,18 @@ export declare const MessageKind: {
826
828
  };
827
829
  export type MessageKind = (typeof MessageKind)[keyof typeof MessageKind];
828
830
  /**
829
- * WHY a lease came back `ready: false`. Each reason wants a different next action — check the
830
- * install, recover a wedged tab, or bring a hidden one to the front — so they get names rather
831
- * than sharing a bare `false`.
831
+ * Why a lease returned `ready: false`. Names each distinct recovery action rather than a bare false.
832
832
  */
833
833
  export declare const LeaseNotReadyReason: {
834
- /** No SDK dialled in within the wait. The install is the thing to look at. */
834
+ /** No SDK dialled in within the wait. */
835
835
  readonly SDK_NEVER_DIALLED: "sdk_never_dialled";
836
- /** One dialled in and stopped answering: the tab is attached but wedged. */
836
+ /** SDK dialled in and stopped answering; tab is wedged. */
837
837
  readonly SDK_STOPPED_ANSWERING: "sdk_stopped_answering";
838
- /** The SDK answers, but its tab is hidden: timers and rAF are throttled, so nothing on it verifies. */
838
+ /** SDK answers but tab is hidden; timers and rAF are throttled. */
839
839
  readonly TAB_HIDDEN: "tab_hidden";
840
- /** The page is not an HTML document (an `.svg`, for example), so the zero-install reader did not run. */
840
+ /** Non-HTML document; zero-install reader did not run. */
841
841
  readonly NOT_HTML_DOCUMENT: "not_html_document";
842
- /** The zero-install reader failed, for example because the tab closed during setup. */
842
+ /** Zero-install reader failed. */
843
843
  readonly READER_FAILED: "reader_failed";
844
844
  };
845
845
  export type LeaseNotReadyReason = (typeof LeaseNotReadyReason)[keyof typeof LeaseNotReadyReason];
@@ -734,6 +734,8 @@ export const ComponentStateReason = {
734
734
  /** Element states the assertion engine can check. */
735
735
  export const ElementState = {
736
736
  VISIBLE: 'visible',
737
+ /** Rendered on screen (not CSS-hidden), regardless of aria-hidden (#1648). */
738
+ PAINTED: 'painted',
737
739
  HIDDEN: 'hidden',
738
740
  ENABLED: 'enabled',
739
741
  DISABLED: 'disabled',
@@ -842,19 +844,17 @@ export const MessageKind = {
842
844
  EVENT: 'event',
843
845
  };
844
846
  /**
845
- * WHY a lease came back `ready: false`. Each reason wants a different next action — check the
846
- * install, recover a wedged tab, or bring a hidden one to the front — so they get names rather
847
- * than sharing a bare `false`.
847
+ * Why a lease returned `ready: false`. Names each distinct recovery action rather than a bare false.
848
848
  */
849
849
  export const LeaseNotReadyReason = {
850
- /** No SDK dialled in within the wait. The install is the thing to look at. */
850
+ /** No SDK dialled in within the wait. */
851
851
  SDK_NEVER_DIALLED: 'sdk_never_dialled',
852
- /** One dialled in and stopped answering: the tab is attached but wedged. */
852
+ /** SDK dialled in and stopped answering; tab is wedged. */
853
853
  SDK_STOPPED_ANSWERING: 'sdk_stopped_answering',
854
- /** The SDK answers, but its tab is hidden: timers and rAF are throttled, so nothing on it verifies. */
854
+ /** SDK answers but tab is hidden; timers and rAF are throttled. */
855
855
  TAB_HIDDEN: 'tab_hidden',
856
- /** The page is not an HTML document (an `.svg`, for example), so the zero-install reader did not run. */
856
+ /** Non-HTML document; zero-install reader did not run. */
857
857
  NOT_HTML_DOCUMENT: 'not_html_document',
858
- /** The zero-install reader failed, for example because the tab closed during setup. */
858
+ /** Zero-install reader failed. */
859
859
  READER_FAILED: 'reader_failed',
860
860
  };
@@ -0,0 +1,23 @@
1
+ /**
2
+ * What a page shows about how well Reticle can see it.
3
+ *
4
+ * No zod here: the SDK reads these on the way in, and a module that builds classic zod schemas
5
+ * brings about 85 KB onto every page (#2369).
6
+ */
7
+ /**
8
+ * Markers a daemon adds to an app's `channels` beside the protocol channel ids, for the two
9
+ * capabilities no channel names. Sent only on evidence, never while the gap that names the same
10
+ * capability is recorded: absence of both reads as "not seen yet", never as covered.
11
+ */
12
+ export declare const CoverageMarker: {
13
+ /** The page carries `data-reticle-source` (the build plugin is active). */
14
+ readonly SOURCE: "source";
15
+ /** The app's snapshots show `data-testid` on its controls. */
16
+ readonly TESTID: "testid";
17
+ };
18
+ export type CoverageMarker = (typeof CoverageMarker)[keyof typeof CoverageMarker];
19
+ /**
20
+ * The file:line capability's name (`CoverageCapability.SOURCE_MAPPING` is this). Here, beside the
21
+ * markers, so a page can say it does not apply without loading the coverage rules into first load.
22
+ */
23
+ export declare const SOURCE_MAPPING_CAPABILITY = "file:line source mapping";
@@ -0,0 +1,22 @@
1
+ /**
2
+ * What a page shows about how well Reticle can see it.
3
+ *
4
+ * No zod here: the SDK reads these on the way in, and a module that builds classic zod schemas
5
+ * brings about 85 KB onto every page (#2369).
6
+ */
7
+ /**
8
+ * Markers a daemon adds to an app's `channels` beside the protocol channel ids, for the two
9
+ * capabilities no channel names. Sent only on evidence, never while the gap that names the same
10
+ * capability is recorded: absence of both reads as "not seen yet", never as covered.
11
+ */
12
+ export const CoverageMarker = {
13
+ /** The page carries `data-reticle-source` (the build plugin is active). */
14
+ SOURCE: 'source',
15
+ /** The app's snapshots show `data-testid` on its controls. */
16
+ TESTID: 'testid',
17
+ };
18
+ /**
19
+ * The file:line capability's name (`CoverageCapability.SOURCE_MAPPING` is this). Here, beside the
20
+ * markers, so a page can say it does not apply without loading the coverage rules into first load.
21
+ */
22
+ export const SOURCE_MAPPING_CAPABILITY = 'file:line source mapping';
@@ -3,7 +3,7 @@ import { CanvasTrigger, EventType, MediaEvent, PerfMetric } from './constants/co
3
3
  import { FieldChangeField, FieldChangeKind, LivePoliteness, RouteChangeHow, ROUTE_CHANGE_HOW_FIELD, ScrollDirection, StorageArea, StreamDirection, StreamTransport, } from './constants/event-types.js';
4
4
  import { ResponseBodyReason } from './constants/response-body-reason.js';
5
5
  import { BlindSpotKind } from '../verdict/verified-constants.js';
6
- import { BrowserBrand } from '../telemetry-feedback.js';
6
+ import { BrowserBrand } from '../browser-brand.js';
7
7
  import { HudUseDataSchema, HumanControlDataSchema, HumanMarkDataSchema } from './messages.js';
8
8
  import { DepartedNetField, NEXT_ACTION_FIELD, REQUEST_SHAPE_FIELD } from './net.js';
9
9
  /**
@@ -200,11 +200,6 @@ export declare const HelloMessageSchema: z.ZodObject<{
200
200
  }, z.core.$strip>;
201
201
  export type HelloMessage = z.infer<typeof HelloMessageSchema>;
202
202
  /** Agent -> browser request, routed by the bridge with a correlation id. */
203
- /** Who sent a command: the Harness, or (when absent) the agent connected to the daemon. */
204
- export declare const CommandActor: {
205
- readonly HARNESS: "harness";
206
- };
207
- export type CommandActor = (typeof CommandActor)[keyof typeof CommandActor];
208
203
  export declare const CommandMessageSchema: z.ZodObject<{
209
204
  kind: z.ZodLiteral<"command">;
210
205
  id: z.ZodString;
@@ -9,6 +9,7 @@ import { PlatformProfile } from './platform.js';
9
9
  import { ChannelId } from './channel.js';
10
10
  import { HelloEnv, HelloInstrumentation, HelloScope } from './production/hello-mode.js';
11
11
  import { OutwardAction } from '../verdict/security.js';
12
+ import { CommandActor } from './page-parse.js';
12
13
  const sessionIdSchema = z.string().min(1).max(TRANSPORT_LIMITS.MAX_SESSION_ID_LENGTH);
13
14
  const refSchema = z.string().max(TRANSPORT_LIMITS.MAX_REF_LENGTH);
14
15
  const documentIdSchema = z.string().min(1).max(DOCUMENT_ID_LENGTH);
@@ -267,10 +268,6 @@ export const HelloMessageSchema = z.object({
267
268
  .optional(),
268
269
  });
269
270
  /** Agent -> browser request, routed by the bridge with a correlation id. */
270
- /** Who sent a command: the Harness, or (when absent) the agent connected to the daemon. */
271
- export const CommandActor = {
272
- HARNESS: 'harness',
273
- };
274
271
  export const CommandMessageSchema = z.object({
275
272
  kind: z.literal(MessageKind.COMMAND),
276
273
  id: z.string().min(1).max(TRANSPORT_LIMITS.MAX_COMMAND_ID_LENGTH),
@@ -0,0 +1,37 @@
1
+ /**
2
+ * The two messages a page reads on the way in, checked without zod.
3
+ *
4
+ * Every page that loads the SDK downloads what its first load imports. A zod schema there brings
5
+ * most of zod with it: one classic schema is about 85 KB, and zod mini beside a classic schema in a
6
+ * later chunk brings zod's whole core (#2369). So the page checks a command and an element query
7
+ * with these functions, and zod stays in the chunks a page fetches later.
8
+ *
9
+ * `CommandMessageSchema` (messages.ts) and `ElementQuerySchema` (types.ts) stay the definitions.
10
+ * `page-parse.test.ts` drives both with generated input and fails when the two answers differ.
11
+ *
12
+ * Only zod-free modules are imported here. `first-load-size.test.ts` fails when zod reaches the
13
+ * first load.
14
+ */
15
+ import type { CommandMessage } from './messages.js';
16
+ import type { ElementQuery } from './types.js';
17
+ /** Who sent a command: the Harness, or (when absent) the agent connected to the daemon. */
18
+ export declare const CommandActor: {
19
+ readonly HARNESS: "harness";
20
+ };
21
+ export type CommandActor = (typeof CommandActor)[keyof typeof CommandActor];
22
+ /** How many outward actions one Harness command may allow. Same bound as `CommandMessageSchema`. */
23
+ export declare const MAX_OUTWARD_ALLOWED = 16;
24
+ /** What a check returns: the value as the schema would output it, or why it was refused. */
25
+ export type PageParse<T> = {
26
+ readonly ok: true;
27
+ readonly value: T;
28
+ } | {
29
+ readonly ok: false;
30
+ readonly error: string;
31
+ };
32
+ /** True for an attribute NAME. `attrs` projects attributes; `name=value` is not a filter. */
33
+ export declare function isAttrName(name: string): boolean;
34
+ /** A command from the agent, as `CommandMessageSchema` reads it. Unknown keys are dropped. */
35
+ export declare function parseCommandMessage(input: unknown): PageParse<CommandMessage>;
36
+ /** An element query, as `ElementQuerySchema` reads it. An unknown key is refused. */
37
+ export declare function parseElementQuery(input: unknown): PageParse<ElementQuery>;
@@ -0,0 +1,207 @@
1
+ /**
2
+ * The two messages a page reads on the way in, checked without zod.
3
+ *
4
+ * Every page that loads the SDK downloads what its first load imports. A zod schema there brings
5
+ * most of zod with it: one classic schema is about 85 KB, and zod mini beside a classic schema in a
6
+ * later chunk brings zod's whole core (#2369). So the page checks a command and an element query
7
+ * with these functions, and zod stays in the chunks a page fetches later.
8
+ *
9
+ * `CommandMessageSchema` (messages.ts) and `ElementQuerySchema` (types.ts) stay the definitions.
10
+ * `page-parse.test.ts` drives both with generated input and fails when the two answers differ.
11
+ *
12
+ * Only zod-free modules are imported here. `first-load-size.test.ts` fails when zod reaches the
13
+ * first load.
14
+ */
15
+ import { MessageKind, QueryBy, TRANSPORT_LIMITS } from './constants/constants.js';
16
+ import { OutwardAction } from '../verdict/security.js';
17
+ /** Who sent a command: the Harness, or (when absent) the agent connected to the daemon. */
18
+ export const CommandActor = {
19
+ HARNESS: 'harness',
20
+ };
21
+ /** How many outward actions one Harness command may allow. Same bound as `CommandMessageSchema`. */
22
+ export const MAX_OUTWARD_ALLOWED = 16;
23
+ /** The one key a copy must not assign: it would set the copy's prototype, not a field. */
24
+ const PROTO_KEY = '__proto__';
25
+ function isFields(value) {
26
+ return 'object' === typeof value && value !== null && !Array.isArray(value);
27
+ }
28
+ /**
29
+ * A plain object, as zod's `isPlainObject` reads it: an object literal, or one with no prototype.
30
+ * An array, a class instance or a value with a changed prototype is not one.
31
+ */
32
+ function isPlainFields(value) {
33
+ if (!isFields(value)) {
34
+ return false;
35
+ }
36
+ const ctor = Reflect.get(value, 'constructor');
37
+ if (ctor === undefined || 'function' !== typeof ctor) {
38
+ return true;
39
+ }
40
+ const prototype = Reflect.get(ctor, 'prototype');
41
+ return isFields(prototype) && Object.prototype.hasOwnProperty.call(prototype, 'isPrototypeOf');
42
+ }
43
+ /**
44
+ * The record `z.record(z.string(), z.unknown())` outputs: a fresh object with the input's own
45
+ * enumerable keys. `__proto__` is skipped, as zod skips it, so a key cannot replace the prototype.
46
+ */
47
+ function copyRecord(input) {
48
+ // `fromEntries` defines data properties and never calls a setter, so no key can reach a prototype.
49
+ return Object.fromEntries(Object.entries(input).filter(([key]) => PROTO_KEY !== key));
50
+ }
51
+ function refuse(error) {
52
+ return { ok: false, error };
53
+ }
54
+ function oneOf(table, value) {
55
+ return 'string' === typeof value && Object.values(table).includes(value);
56
+ }
57
+ /** A string of `min` to `max` characters, as `z.string().min(min).max(max)` counts them. */
58
+ function isText(value, min, max) {
59
+ return 'string' === typeof value && value.length >= min && value.length <= max;
60
+ }
61
+ /** True for an attribute NAME. `attrs` projects attributes; `name=value` is not a filter. */
62
+ export function isAttrName(name) {
63
+ return !name.includes('=');
64
+ }
65
+ /** A command from the agent, as `CommandMessageSchema` reads it. Unknown keys are dropped. */
66
+ export function parseCommandMessage(input) {
67
+ if (!isFields(input)) {
68
+ return refuse('a command is an object');
69
+ }
70
+ if (input['kind'] !== MessageKind.COMMAND) {
71
+ return refuse(`\`kind\` is not "${MessageKind.COMMAND}"`);
72
+ }
73
+ if (!isText(input['id'], 1, TRANSPORT_LIMITS.MAX_COMMAND_ID_LENGTH)) {
74
+ return refuse(`\`id\` is not a string of 1 to ${String(TRANSPORT_LIMITS.MAX_COMMAND_ID_LENGTH)} characters`);
75
+ }
76
+ const sessionId = input['sessionId'];
77
+ if (sessionId !== undefined && !isText(sessionId, 1, TRANSPORT_LIMITS.MAX_SESSION_ID_LENGTH)) {
78
+ return refuse(`\`sessionId\` is not a string of 1 to ${String(TRANSPORT_LIMITS.MAX_SESSION_ID_LENGTH)} characters`);
79
+ }
80
+ if (!isText(input['name'], 1, TRANSPORT_LIMITS.MAX_COMMAND_NAME_LENGTH)) {
81
+ return refuse(`\`name\` is not a string of 1 to ${String(TRANSPORT_LIMITS.MAX_COMMAND_NAME_LENGTH)} characters`);
82
+ }
83
+ const rawArgs = input['args'] === undefined ? {} : input['args'];
84
+ if (!isPlainFields(rawArgs)) {
85
+ return refuse('`args` is not an object');
86
+ }
87
+ const args = copyRecord(rawArgs);
88
+ const by = input['by'];
89
+ if (by !== undefined && !oneOf(CommandActor, by)) {
90
+ return refuse('`by` is not a known actor');
91
+ }
92
+ const outward = input['outward'];
93
+ let allowed;
94
+ if (outward !== undefined) {
95
+ const list = isFields(outward) ? outward['allowed'] : undefined;
96
+ if (!Array.isArray(list) ||
97
+ list.length > MAX_OUTWARD_ALLOWED ||
98
+ !list.every((a) => oneOf(OutwardAction, a))) {
99
+ return refuse(`\`outward.allowed\` is not a list of at most ${String(MAX_OUTWARD_ALLOWED)} outward actions`);
100
+ }
101
+ allowed = list;
102
+ }
103
+ const value = { kind: MessageKind.COMMAND, id: input['id'], name: input['name'], args };
104
+ if ('sessionId' in input) {
105
+ value['sessionId'] = sessionId;
106
+ }
107
+ if ('by' in input) {
108
+ value['by'] = by;
109
+ }
110
+ if ('outward' in input) {
111
+ value['outward'] = allowed === undefined ? undefined : { allowed };
112
+ }
113
+ return { ok: true, value: value };
114
+ }
115
+ /** The keys of an element query that hold an optional string. */
116
+ const QUERY_TEXT_KEYS = [
117
+ 'value',
118
+ 'role',
119
+ 'name',
120
+ 'text',
121
+ 'label',
122
+ 'placeholder',
123
+ 'testid',
124
+ 'alt',
125
+ 'component',
126
+ 'scope',
127
+ ];
128
+ /** The keys of an element query that hold an optional boolean. */
129
+ const QUERY_FLAG_KEYS = ['self', 'matchCase'];
130
+ const QUERY_KEYS = new Set([
131
+ 'by',
132
+ 'attrs',
133
+ 'source',
134
+ ...QUERY_TEXT_KEYS,
135
+ ...QUERY_FLAG_KEYS,
136
+ ]);
137
+ const SOURCE_KEYS = new Set(['file', 'line', 'column']);
138
+ /** A finite number, as zod 4's `z.number()` accepts it. */
139
+ function isNumber(value) {
140
+ return 'number' === typeof value && Number.isFinite(value);
141
+ }
142
+ function sourceError(source) {
143
+ if (!isFields(source)) {
144
+ return '`source` is not an object';
145
+ }
146
+ const unknown = Object.keys(source).find((key) => !SOURCE_KEYS.has(key));
147
+ if (unknown !== undefined) {
148
+ return `\`source\` has an unknown key: "${unknown}"`;
149
+ }
150
+ if ('string' !== typeof source['file'] || !isNumber(source['line'])) {
151
+ return '`source` needs a string `file` and a number `line`';
152
+ }
153
+ if (source['column'] !== undefined && !isNumber(source['column'])) {
154
+ return '`source.column` is not a number';
155
+ }
156
+ return undefined;
157
+ }
158
+ /** An element query, as `ElementQuerySchema` reads it. An unknown key is refused. */
159
+ export function parseElementQuery(input) {
160
+ if (!isFields(input)) {
161
+ return refuse('a query is an object');
162
+ }
163
+ const unknown = Object.keys(input).find((key) => !QUERY_KEYS.has(key));
164
+ if (unknown !== undefined) {
165
+ return refuse(`the query has an unknown key: "${unknown}"`);
166
+ }
167
+ if (input['by'] !== undefined && !oneOf(QueryBy, input['by'])) {
168
+ return refuse('`by` is not a known query kind');
169
+ }
170
+ for (const key of QUERY_TEXT_KEYS) {
171
+ if (input[key] !== undefined && 'string' !== typeof input[key]) {
172
+ return refuse(`\`${key}\` is not a string`);
173
+ }
174
+ }
175
+ for (const key of QUERY_FLAG_KEYS) {
176
+ if (input[key] !== undefined && 'boolean' !== typeof input[key]) {
177
+ return refuse(`\`${key}\` is not a boolean`);
178
+ }
179
+ }
180
+ const attrs = input['attrs'];
181
+ if (attrs !== undefined) {
182
+ if (!Array.isArray(attrs) || !attrs.every((a) => 'string' === typeof a)) {
183
+ return refuse('`attrs` is not a list of attribute names');
184
+ }
185
+ const pair = attrs.find((a) => !isAttrName(a));
186
+ if (pair !== undefined) {
187
+ return refuse(`\`attrs\` takes attribute NAMES only, not \`name=value\` — got ${JSON.stringify(pair)}. ` +
188
+ 'It PROJECTS each attribute onto the match, it does not filter on it.');
189
+ }
190
+ }
191
+ const source = input['source'];
192
+ if (source !== undefined) {
193
+ const error = sourceError(source);
194
+ if (error !== undefined) {
195
+ return refuse(error);
196
+ }
197
+ }
198
+ // Fresh objects and arrays, as zod outputs them: the caller never holds the input's own.
199
+ const value = { ...input };
200
+ if (Array.isArray(attrs)) {
201
+ value['attrs'] = [...attrs];
202
+ }
203
+ if (isFields(source)) {
204
+ value['source'] = { ...source };
205
+ }
206
+ return { ok: true, value };
207
+ }
@@ -226,20 +226,3 @@ export interface LinkUnsyncedRoot {
226
226
  /** The project the folder belongs to, so a board lists only its own. Absent when none is named. */
227
227
  projectId?: string;
228
228
  }
229
- /**
230
- * Markers a daemon adds to an app's `channels` beside the protocol channel ids, for the two
231
- * capabilities no channel names. Sent only on evidence, never while the gap that names the same
232
- * capability is recorded: absence of both reads as "not seen yet", never as covered.
233
- */
234
- export declare const CoverageMarker: {
235
- /** The page carries `data-reticle-source` (the build plugin is active). */
236
- readonly SOURCE: "source";
237
- /** The app's snapshots show `data-testid` on its controls. */
238
- readonly TESTID: "testid";
239
- };
240
- export type CoverageMarker = (typeof CoverageMarker)[keyof typeof CoverageMarker];
241
- /**
242
- * The file:line capability's name (`CoverageCapability.SOURCE_MAPPING` is this). Here, beside the
243
- * markers, so a page can say it does not apply without loading the coverage rules into first load.
244
- */
245
- export declare const SOURCE_MAPPING_CAPABILITY = "file:line source mapping";
@@ -222,19 +222,3 @@ export const LinkReportKey = {
222
222
  };
223
223
  /** How many recorded gaps one app reports. */
224
224
  export const LINK_APP_GAPS_MAX = 20;
225
- /**
226
- * Markers a daemon adds to an app's `channels` beside the protocol channel ids, for the two
227
- * capabilities no channel names. Sent only on evidence, never while the gap that names the same
228
- * capability is recorded: absence of both reads as "not seen yet", never as covered.
229
- */
230
- export const CoverageMarker = {
231
- /** The page carries `data-reticle-source` (the build plugin is active). */
232
- SOURCE: 'source',
233
- /** The app's snapshots show `data-testid` on its controls. */
234
- TESTID: 'testid',
235
- };
236
- /**
237
- * The file:line capability's name (`CoverageCapability.SOURCE_MAPPING` is this). Here, beside the
238
- * markers, so a page can say it does not apply without loading the coverage rules into first load.
239
- */
240
- export const SOURCE_MAPPING_CAPABILITY = 'file:line source mapping';
@@ -228,6 +228,11 @@ export interface QueryEmptyHint {
228
228
  * to three, ranked by role and then by name similarity. Advice for one retry, never a match.
229
229
  */
230
230
  nearest?: NearestTarget[];
231
+ /**
232
+ * Present only when an element search in state 'visible' or 'inViewport' missed, but a matching
233
+ * element IS painted on screen and excluded from the accessible tree by aria-hidden="true" (#1648).
234
+ */
235
+ ariaHiddenState?: boolean;
231
236
  }
232
237
  /**
233
238
  * One target near a query that matched nothing. `name` is cut at 60 characters, and
package/package.json CHANGED
@@ -1,11 +1,15 @@
1
1
  {
2
2
  "name": "@reticlehq/core",
3
- "version": "3.10.2",
3
+ "version": "3.10.4",
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 and open-verification.",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",
7
7
  "types": "./dist/index.d.ts",
8
8
  "exports": {
9
+ "./page": {
10
+ "types": "./dist/page-entry.d.ts",
11
+ "default": "./dist/page-entry.js"
12
+ },
9
13
  ".": {
10
14
  "types": "./dist/index.d.ts",
11
15
  "default": "./dist/index.js"
@@ -47,7 +51,7 @@
47
51
  },
48
52
  "dependencies": {
49
53
  "zod": "^4.6.6",
50
- "open-verification": "1.1.0"
54
+ "open-verification": "1.2.0"
51
55
  },
52
56
  "devDependencies": {
53
57
  "fast-check": "^4.10.2"