@reticlehq/core 3.10.10 → 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 (56) 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 +6 -3
  7. package/dist/page-entry.js +6 -3
  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-refusal.d.ts +4 -0
  21. package/dist/telemetry-refusal.js +2 -0
  22. package/dist/telemetry.d.ts +24 -0
  23. package/dist/telemetry.js +6 -1
  24. package/dist/verdict/check-sentence.js +8 -1
  25. package/dist/verdict/findings.d.ts +23 -0
  26. package/dist/verdict/findings.js +19 -0
  27. package/dist/verdict/property-assertion.d.ts +5 -0
  28. package/dist/verdict/property-assertion.js +36 -0
  29. package/dist/wire/click-input.d.ts +22 -1
  30. package/dist/wire/click-input.js +35 -1
  31. package/dist/wire/constants/constants.d.ts +18 -3
  32. package/dist/wire/constants/constants.js +19 -3
  33. package/dist/wire/constants/dialog-consent.d.ts +20 -0
  34. package/dist/wire/constants/dialog-consent.js +20 -0
  35. package/dist/wire/constants/event-types.d.ts +10 -0
  36. package/dist/wire/constants/event-types.js +10 -0
  37. package/dist/wire/constants/match-args.d.ts +2 -0
  38. package/dist/wire/constants/match-args.js +2 -0
  39. package/dist/wire/constants/navigate-history.d.ts +29 -0
  40. package/dist/wire/constants/navigate-history.js +27 -0
  41. package/dist/wire/constants/render-stats.d.ts +24 -0
  42. package/dist/wire/constants/render-stats.js +22 -0
  43. package/dist/wire/constants/window-arrangement.d.ts +16 -0
  44. package/dist/wire/constants/window-arrangement.js +16 -0
  45. package/dist/wire/event-payloads.d.ts +4 -1
  46. package/dist/wire/event-payloads.js +19 -2
  47. package/dist/wire/messages.d.ts +13 -0
  48. package/dist/wire/messages.js +15 -0
  49. package/dist/wire/production/production-policy.d.ts +6 -1
  50. package/dist/wire/production/production-policy.js +6 -1
  51. package/dist/wire/tool-names.d.ts +10 -0
  52. package/dist/wire/tool-names.js +10 -0
  53. package/dist/wire/types.d.ts +8 -0
  54. package/dist/words/faded-reason.d.ts +11 -0
  55. package/dist/words/faded-reason.js +15 -0
  56. package/package.json +1 -1
@@ -134,6 +134,13 @@ export const HelloMessageSchema = z.object({
134
134
  * ⇒ resolution falls back to origin + recency.
135
135
  */
136
136
  projectId: sessionIdSchema.optional(),
137
+ /**
138
+ * The project directory this page was built from.
139
+ *
140
+ * The build plugin sends it. A page reached through a port forward reports a directory that is
141
+ * not on the machine the daemon runs on. Absent on an older SDK.
142
+ */
143
+ root: z.string().min(1).max(TRANSPORT_LIMITS.MAX_URL_LENGTH).optional(),
137
144
  adapters: z
138
145
  .array(z.string().max(TRANSPORT_LIMITS.MAX_ADAPTER_NAME_LENGTH))
139
146
  .max(TRANSPORT_LIMITS.MAX_ADAPTERS),
@@ -290,6 +297,14 @@ export const CommandResultSchema = z.object({
290
297
  result: z.unknown().optional(),
291
298
  error: z.string().max(TRANSPORT_LIMITS.MAX_ERROR_LENGTH).optional(),
292
299
  });
300
+ /**
301
+ * The `result` of the page's reply to the `history` command (#1844). `ok: true` means the page sent
302
+ * the move, not that the tab arrived. `ok: false` means the page refused it, and `reason` says why.
303
+ */
304
+ export const HistoryReplySchema = z.discriminatedUnion('ok', [
305
+ z.object({ ok: z.literal(true) }),
306
+ z.object({ ok: z.literal(false), reason: z.string().optional() }),
307
+ ]);
293
308
  /** Browser -> bridge streamed observation. */
294
309
  export const EventMessageSchema = z.object({
295
310
  kind: z.literal(MessageKind.EVENT),
@@ -18,11 +18,16 @@ export declare const ProductionRule: {
18
18
  readonly OBSERVE_ONLY: "the session scope is observe, so it does not act";
19
19
  /** The drive stays on the origin it was activated for. */
20
20
  readonly OFF_ORIGIN: "leave the activated origin";
21
+ /**
22
+ * Back and Forward land on whatever entry the browser has, which can be another origin. Unlike a
23
+ * URL, that target cannot be checked against the origin first, so the move is refused (#1844).
24
+ */
25
+ readonly HISTORY_MOVE: "move through the tab history, to a page that cannot be checked first";
21
26
  /** The nonce's time is up; the drive is over. */
22
27
  readonly EXPIRED: "the session nonce expired";
23
28
  };
24
29
  export type ProductionRule = (typeof ProductionRule)[keyof typeof ProductionRule];
25
- /** The rules an intent can allow. The other three are never lifted. */
30
+ /** The rules an intent can allow. The other four are never lifted. */
26
31
  export declare const LIFTABLE_PRODUCTION_RULES: readonly ["payment or checkout", "delete a workspace or project", "revoke or rotate a key", "send an invite or email", "cancel a subscription", "change a member's role"];
27
32
  export type LiftableProductionRule = (typeof LIFTABLE_PRODUCTION_RULES)[number];
28
33
  /**
@@ -19,10 +19,15 @@ export const ProductionRule = {
19
19
  OBSERVE_ONLY: 'the session scope is observe, so it does not act',
20
20
  /** The drive stays on the origin it was activated for. */
21
21
  OFF_ORIGIN: 'leave the activated origin',
22
+ /**
23
+ * Back and Forward land on whatever entry the browser has, which can be another origin. Unlike a
24
+ * URL, that target cannot be checked against the origin first, so the move is refused (#1844).
25
+ */
26
+ HISTORY_MOVE: 'move through the tab history, to a page that cannot be checked first',
22
27
  /** The nonce's time is up; the drive is over. */
23
28
  EXPIRED: 'the session nonce expired',
24
29
  };
25
- /** The rules an intent can allow. The other three are never lifted. */
30
+ /** The rules an intent can allow. The other four are never lifted. */
26
31
  export const LIFTABLE_PRODUCTION_RULES = [
27
32
  ProductionRule.PAYMENT,
28
33
  ProductionRule.DELETE_WORKSPACE,
@@ -108,6 +108,16 @@ export declare const ReticleTool: {
108
108
  readonly RESUME: "reticle_resume";
109
109
  /** Live-control: drain the human→agent inbox (explicit poll). */
110
110
  readonly MESSAGES: "reticle_messages";
111
+ /**
112
+ * A board of named values that every session and agent on this bridge can read and write: how a
113
+ * desktop session, a browser session and a plan of the Harness pass a value to each other.
114
+ */
115
+ readonly BOARD: "reticle_board";
116
+ /**
117
+ * Join a tab that is open in the person's own browser (their mail, a cloud console), over the
118
+ * browser's debugging port, as a session: the reader is put in the tab, not in a tab of its own.
119
+ */
120
+ readonly ATTACH_TAB: "reticle_attach_tab";
111
121
  /** Human review: list the mistakes the human pinned to elements, and resolve them once fixed. */
112
122
  readonly REVIEW: "reticle_review";
113
123
  /** First-run readiness: block briefly until the app's SDK connects (smooths the init→connect race). */
@@ -118,6 +118,16 @@ export const ReticleTool = {
118
118
  RESUME: 'reticle_resume',
119
119
  /** Live-control: drain the human→agent inbox (explicit poll). */
120
120
  MESSAGES: 'reticle_messages',
121
+ /**
122
+ * A board of named values that every session and agent on this bridge can read and write: how a
123
+ * desktop session, a browser session and a plan of the Harness pass a value to each other.
124
+ */
125
+ BOARD: 'reticle_board',
126
+ /**
127
+ * Join a tab that is open in the person's own browser (their mail, a cloud console), over the
128
+ * browser's debugging port, as a session: the reader is put in the tab, not in a tab of its own.
129
+ */
130
+ ATTACH_TAB: 'reticle_attach_tab',
121
131
  /** Human review: list the mistakes the human pinned to elements, and resolve them once fixed. */
122
132
  REVIEW: 'reticle_review',
123
133
  /** First-run readiness: block briefly until the app's SDK connects (smooths the init→connect race). */
@@ -113,6 +113,14 @@ export interface MatchResult {
113
113
  * the caller needs this to tell the two apart before it judges a property on what it was given.
114
114
  */
115
115
  fullText?: true;
116
+ /**
117
+ * Present, and true, only when the page honoured `MatchArg.OUTSIDE_VIRTUALIZED` and proved it: the
118
+ * `scope` is a ref to a live element that is not inside a virtualized list and does not contain
119
+ * one, and no match is inside one. An unmounted row of such a list then cannot hold a match. A page
120
+ * too old to know the argument ignores it and does not send the field, so a caller that does not
121
+ * see it must not assume the proof.
122
+ */
123
+ outsideVirtualized?: true;
116
124
  /**
117
125
  * True when a `scope` was given but resolved to nothing (the container was unmounted or the selector
118
126
  * matched no element). The search returns zero matches WITHOUT falling back to the whole page, and
@@ -0,0 +1,11 @@
1
+ /**
2
+ * The words that start an `unreadable` reason when the composed opacity hides the text.
3
+ *
4
+ * `@reticlehq/browser` writes the reason and `@reticlehq/engine` reads it back to add advice. The two
5
+ * packages do not import each other, so the prefix lives here and both sides use it.
6
+ */
7
+ export declare const FADED_REASON_PREFIX = "the composed opacity is";
8
+ /** The reason the browser gives for text hidden by opacity. The opacity follows, to two decimals. */
9
+ export declare function fadedReason(opacity: number): string;
10
+ /** True when a reason says that opacity hid the text. */
11
+ export declare function isFadedReason(reason: string): boolean;
@@ -0,0 +1,15 @@
1
+ /**
2
+ * The words that start an `unreadable` reason when the composed opacity hides the text.
3
+ *
4
+ * `@reticlehq/browser` writes the reason and `@reticlehq/engine` reads it back to add advice. The two
5
+ * packages do not import each other, so the prefix lives here and both sides use it.
6
+ */
7
+ export const FADED_REASON_PREFIX = 'the composed opacity is';
8
+ /** The reason the browser gives for text hidden by opacity. The opacity follows, to two decimals. */
9
+ export function fadedReason(opacity) {
10
+ return `${FADED_REASON_PREFIX} ${opacity.toFixed(2)}`;
11
+ }
12
+ /** True when a reason says that opacity hid the text. */
13
+ export function isFadedReason(reason) {
14
+ return reason.includes(FADED_REASON_PREFIX);
15
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@reticlehq/core",
3
- "version": "3.10.10",
3
+ "version": "3.11.0",
4
4
  "description": "The Reticle foundation: the shared wire contract — types, zod schemas, constants, messages, and the isomorphic kernel that every Reticle package (browser SDK, server, kits, test harness) imports. Depends only on zod and open-verification.",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",