@reticlehq/core 2.0.1 → 2.2.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 (70) hide show
  1. package/LICENSE +201 -112
  2. package/NOTICE +5 -0
  3. package/dist/brand.d.ts +32 -3
  4. package/dist/brand.d.ts.map +1 -1
  5. package/dist/brand.js +9 -4
  6. package/dist/brand.js.map +1 -1
  7. package/dist/consequence.d.ts +31 -0
  8. package/dist/consequence.d.ts.map +1 -0
  9. package/dist/consequence.js +45 -0
  10. package/dist/consequence.js.map +1 -0
  11. package/dist/constants.d.ts +161 -5
  12. package/dist/constants.d.ts.map +1 -1
  13. package/dist/constants.js +156 -5
  14. package/dist/constants.js.map +1 -1
  15. package/dist/daemon-registry.d.ts +5 -5
  16. package/dist/daemon-registry.d.ts.map +1 -1
  17. package/dist/daemon-registry.js +5 -5
  18. package/dist/daemon-registry.js.map +1 -1
  19. package/dist/event-payloads.d.ts +502 -0
  20. package/dist/event-payloads.d.ts.map +1 -0
  21. package/dist/event-payloads.js +138 -0
  22. package/dist/event-payloads.js.map +1 -0
  23. package/dist/flow-constants.d.ts +2 -2
  24. package/dist/flow-constants.js +7 -7
  25. package/dist/flow-constants.js.map +1 -1
  26. package/dist/flow-types.d.ts +156 -32
  27. package/dist/flow-types.d.ts.map +1 -1
  28. package/dist/flow-types.js +23 -1
  29. package/dist/flow-types.js.map +1 -1
  30. package/dist/index.d.ts +19 -6
  31. package/dist/index.d.ts.map +1 -1
  32. package/dist/index.js +26 -11
  33. package/dist/index.js.map +1 -1
  34. package/dist/journal.d.ts +90 -0
  35. package/dist/journal.d.ts.map +1 -0
  36. package/dist/journal.js +38 -0
  37. package/dist/journal.js.map +1 -0
  38. package/dist/messages.d.ts +118 -16
  39. package/dist/messages.d.ts.map +1 -1
  40. package/dist/messages.js +15 -2
  41. package/dist/messages.js.map +1 -1
  42. package/dist/notices.d.ts +4 -4
  43. package/dist/notices.js +4 -4
  44. package/dist/redaction.d.ts +4 -0
  45. package/dist/redaction.d.ts.map +1 -0
  46. package/dist/redaction.js +33 -0
  47. package/dist/redaction.js.map +1 -0
  48. package/dist/schema/event-message.json +23 -1
  49. package/dist/schema/event-type.json +10 -1
  50. package/dist/schema/reticle-event.json +23 -1
  51. package/dist/schema/reticle-message.json +23 -1
  52. package/dist/session-constants.d.ts +2 -2
  53. package/dist/session-constants.js +2 -2
  54. package/dist/state-select.d.ts.map +1 -1
  55. package/dist/state-select.js +21 -5
  56. package/dist/state-select.js.map +1 -1
  57. package/dist/toon.d.ts +13 -12
  58. package/dist/toon.d.ts.map +1 -1
  59. package/dist/toon.js +37 -20
  60. package/dist/toon.js.map +1 -1
  61. package/dist/types.d.ts +80 -18
  62. package/dist/types.d.ts.map +1 -1
  63. package/dist/types.js +9 -3
  64. package/dist/types.js.map +1 -1
  65. package/dist/upgrade.d.ts +5 -5
  66. package/dist/upgrade.js +3 -3
  67. package/dist/verification-run.d.ts +25 -23
  68. package/dist/verification-run.d.ts.map +1 -1
  69. package/dist/verification-run.js +1 -1
  70. package/package.json +6 -2
@@ -4,6 +4,11 @@
4
4
  */
5
5
  export declare const RETICLE_DEFAULT_PORT = 4400;
6
6
  export declare const RETICLE_WS_PATH = "/reticle";
7
+ /** Agent↔server MCP wire paths — served by the daemon HTTP plane, forwarded by the stdio proxy. */
8
+ export declare const MCP_SSE_PATH = "/mcp/sse";
9
+ export declare const MCP_MESSAGE_PATH = "/mcp/message";
10
+ /** Local-only daemon introspection — `reticle status` GETs this for sessions + health at a glance. */
11
+ export declare const STATUS_PATH = "/status";
7
12
  export declare const RETICLE_PROTOCOL_VERSION = 1;
8
13
  /**
9
14
  * The one place the bridge WebSocket URL is built. The SDK connect default, the vite/next snippet
@@ -49,6 +54,8 @@ export declare const ReticleEnv: {
49
54
  readonly IDLE_SHUTDOWN: "RETICLE_IDLE_SHUTDOWN_MS";
50
55
  /** Directory holding the auto-provisioned pairing token. Defaults to ~/.reticle; relocatable for CI. */
51
56
  readonly PAIRING_TOKEN_DIR: "RETICLE_PAIRING_TOKEN_DIR";
57
+ /** Force the durable causal journal off (`0`/`false`/`off`) or on (`1`/`true`/`on`); default on. */
58
+ readonly JOURNAL: "RETICLE_JOURNAL";
52
59
  };
53
60
  /** Hard transport bounds shared by the browser and bridge. */
54
61
  export declare const TRANSPORT_LIMITS: {
@@ -68,6 +75,9 @@ export declare const TRANSPORT_LIMITS: {
68
75
  readonly MAX_COMMAND_NAME_LENGTH: 128;
69
76
  readonly MAX_REF_LENGTH: 128;
70
77
  readonly MAX_ERROR_LENGTH: 4096;
78
+ /** Cap on a captured stack trace before it crosses the wire — the console observer and both React
79
+ * error hooks (error-boundary, hydration-error) all truncate to this, so it is one fact. */
80
+ readonly MAX_STACK_LENGTH: 4000;
71
81
  readonly MAX_SERIALIZE_DEPTH: 8;
72
82
  readonly MAX_COLLECTION_ITEMS: 200;
73
83
  readonly MAX_OBJECT_KEYS: 200;
@@ -79,6 +89,14 @@ export declare const TRANSPORT_LIMITS: {
79
89
  };
80
90
  /** Replacement used when sensitive data is removed before crossing the bridge. */
81
91
  export declare const REDACTED_VALUE = "[REDACTED]";
92
+ /**
93
+ * The attribute the build plugin stamps on JSX host elements as `file:line:column`, so the browser SDK
94
+ * and the React adapter can map a DOM node back to its source file (the source-pointer feature, needed
95
+ * on React 19 which dropped _debugSource). Read here by both packages — it was duplicated as a local
96
+ * const in dom/source.ts AND dom/query.ts and inlined as a literal in the React adapter. The stamper
97
+ * (@reticlehq/babel-plugin, separate build tooling) stamps this same literal and MUST match it.
98
+ */
99
+ export declare const DATA_RETICLE_SOURCE_ATTR = "data-reticle-source";
82
100
  /** Explicit opt-in argument required for potentially destructive actions. */
83
101
  export declare const DANGEROUS_ACTION_CONFIRM_ARG = "confirmDangerous";
84
102
  /** Schema version stamped onto compiled replay programs. */
@@ -91,13 +109,29 @@ export declare const ReticleDir: {
91
109
  readonly BASELINES_SUBDIR: "baselines";
92
110
  /** cross-run memory — outcomes of past runs (the "did it behave like last time?" file). */
93
111
  readonly PROJECT_FILE: "project.json";
94
- /** opt-in pixel baselines — .reticle/visual/<name>.png + <name>.diff.png. */
112
+ /** opt-in pixel baselines —.reticle/visual/<name>.png + <name>.diff.png. */
95
113
  readonly VISUAL_SUBDIR: "visual";
96
- /** verification-run artifacts — .reticle/runs/<runId>.json (the OEM/CI-consumable verdict). */
114
+ /** verification-run artifacts —.reticle/runs/<runId>.json (the OEM/CI-consumable verdict). */
97
115
  readonly RUNS_SUBDIR: "runs";
116
+ /** fail-to-pass bug capsules —.reticle/capsules/<id>.json (a minimal failing flow + its evidence). */
117
+ readonly CAPSULES_SUBDIR: "capsules";
118
+ /** durable causal journal —.reticle/sessions/<id>/{events,actions}.jsonl (the substrate). */
119
+ readonly SESSIONS_SUBDIR: "sessions";
120
+ /** append-only event ledger inside a session dir (one ReticleEvent per line). */
121
+ readonly JOURNAL_EVENTS_FILE: "events.jsonl";
122
+ /** append-only action ledger inside a session dir (one JournalAction per line). */
123
+ readonly JOURNAL_ACTIONS_FILE: "actions.jsonl";
124
+ /** learned expected-envelopes per route, accumulated across runs (the deviation-report baseline). */
125
+ readonly ENVELOPES_FILE: "envelopes.json";
126
+ /** learned ambient (action-less churn) region map — excluded from settle/summaries/envelopes. */
127
+ readonly AMBIENT_FILE: "ambient.json";
128
+ /** per-flow flake ledger — replay outcomes that decide intermittent-failure quarantine. */
129
+ readonly FLAKE_FILE: "flake.json";
130
+ /** Per-flow assertion tiers recorded on each PASSING replay — the gate's anti-downgrade baseline. */
131
+ readonly TIERS_FILE: "assertion-tiers.json";
98
132
  /**
99
133
  * Auto-provisioned bridge pairing token, stored at ~/.reticle/pairing-token (mode 0600). Written by
100
- * the daemon, read Node-side by the build plugins to inject into connect(). A browser sandbox cannot
134
+ * the daemon, read Node-side by the build plugins to inject into connect. A browser sandbox cannot
101
135
  * read it, so a rogue localhost app can't present it — that's what stops cross-app session hijack.
102
136
  */
103
137
  readonly PAIRING_TOKEN_FILE: "pairing-token";
@@ -145,6 +179,10 @@ export declare const CRAWL_DEFAULTS: {
145
179
  /** HTTP status at/above which a response counts as a failed request. */
146
180
  readonly FAILED_STATUS: 400;
147
181
  };
182
+ /** Default max wait for reticle_assert / reticle_wait_for / reticle_act_and_wait when the caller gives
183
+ * no `timeout_ms`. One fact, shared by the server tools and the @reticlehq/test matchers so the test
184
+ * package's assumption can't silently diverge from the server default. */
185
+ export declare const DEFAULT_ASSERT_TIMEOUT_MS = 4000;
148
186
  /** How long to wait between npm registry update checks (24 h). */
149
187
  export declare const UpdateCheckIntervalMs: number;
150
188
  /** Schema version stamped into contract.json so a reader can reject/upgrade old files. */
@@ -173,25 +211,56 @@ export declare const EventType: {
173
211
  readonly DOM_TEXT: "dom.text";
174
212
  readonly NET_REQUEST: "net.request";
175
213
  readonly NET_PENDING: "net.pending";
214
+ /** An SSE (EventSource) or WebSocket frame — a message on a long-lived streaming connection. */
215
+ readonly NET_STREAM: "net.stream";
216
+ /** A web-perf metric a screenshot can't verify: LCP, cumulative layout shift, or a long task. */
217
+ readonly PERF: "perf";
176
218
  readonly ROUTE_CHANGE: "route.change";
177
219
  readonly CONSOLE_LOG: "console.log";
178
220
  readonly CONSOLE_WARN: "console.warn";
179
221
  readonly CONSOLE_ERROR: "console.error";
222
+ readonly CONSOLE_INFO: "console.info";
223
+ readonly CONSOLE_DEBUG: "console.debug";
180
224
  readonly ERROR_UNCAUGHT: "error.uncaught";
181
225
  readonly VISIBLE_SHOWN: "visible.shown";
182
- readonly VISIBLE_HIDDEN: "visible.hidden";
183
226
  readonly ANIM_START: "anim.start";
184
227
  readonly ANIM_END: "anim.end";
185
228
  readonly SCROLL_POSITION: "scroll.position";
186
229
  readonly REVEAL_SHOWN: "reveal.shown";
187
230
  readonly SIGNAL: "signal";
188
231
  readonly STATE_CHANGE: "state.change";
232
+ /** a write to localStorage/sessionStorage/cookies — `data: { area, key, old?, new? }` (values redacted). */
233
+ readonly STORAGE_CHANGE: "storage.change";
189
234
  /** page-level visibility/focus health (distinct from element-level VISIBLE_*). */
190
235
  readonly PAGE_HEALTH: "page.health";
236
+ /** aggregated React commits over a throttle window (dev builds) — `data: { commits }`. Commit storms /
237
+ * wasted re-renders show up here without a per-render flood. */
238
+ readonly RENDER_COMMIT: "render.commit";
239
+ /** element focus moved — `data: { to, from, toBody }`. Focus dropping to body after an act is a regression. */
240
+ readonly FOCUS_CHANGE: "focus.change";
191
241
  /** browser → bridge: a human recording compiled in-page. */
192
242
  readonly FLOW_RECORDED: "flow.recorded";
193
243
  /** synthetic: browser transport queue overflowed; events were dropped. `data: { dropped: number }`. */
194
244
  readonly TRANSPORT_OVERFLOW: "transport.overflow";
245
+ /**
246
+ * synthetic: a per-channel cap truncated a batch (e.g. a DOM mutation flood). `data: { channel, dropped }`.
247
+ * Marks downstream rollups/envelopes as built on incomplete data — a ledger that lies at scale is worse
248
+ * than no ledger, so truncation is never silent.
249
+ */
250
+ readonly TRUNCATED: "truncated";
251
+ /**
252
+ * synthetic: the SDK detected a region it CANNOT observe (a cross-origin iframe, a closed shadow root).
253
+ * `data: { kind: BlindSpotKind, count }`. Surfaced on results as `coverage: partial` so a green never
254
+ * implies it saw everything.
255
+ */
256
+ readonly BLIND_SPOT: "blind-spot";
257
+ /**
258
+ * synthetic (driven only): CDP/Playwright-authoritative network detail for a response the in-page
259
+ * fetch/XHR wrapper also saw — full response headers + authoritative status/mimeType the page-side
260
+ * wrapper can't reach. `data: { url, method?, status, headers, resourceType? }`. Merged onto the
261
+ * matching in-page NET_REQUEST so the driven view never loses fidelity to an outside-in tool.
262
+ */
263
+ readonly NET_DETAIL: "net.detail";
195
264
  /**
196
265
  * Live-control: browser → bridge. A human acted on the presenter panel.
197
266
  * `data: { kind: HumanControlKind; text?: string }`. Rides the existing EventMessage.
@@ -206,6 +275,91 @@ export declare const EventType: {
206
275
  readonly HUMAN_MARK: "human.mark";
207
276
  };
208
277
  export type EventType = (typeof EventType)[keyof typeof EventType];
278
+ /**
279
+ * Named phenomena the perception layer detects deterministically over the journal — capsules and
280
+ * deviation reports lead with these names, not raw events. The library grows in later releases; the
281
+ * mechanism (versioned matchers + evidence templates) lands now.
282
+ */
283
+ export declare const PhenomenonType: {
284
+ /** An act dispatched but the app did nothing — no DOM/net/route/signal in its window. */
285
+ readonly DEAD_CLICK: "dead-click";
286
+ /** A click landed before hydration attached handlers — a silent no-op. */
287
+ readonly PRE_HYDRATION_CLICK: "pre-hydration-click";
288
+ /** A 5xx response that occurred while the page was hidden — looks fine, isn't. */
289
+ readonly HIDDEN_500: "hidden-500";
290
+ /** A request started and never completed within the window — a hung/in-flight request. */
291
+ readonly HUNG_REQUEST: "hung-request";
292
+ /** A React error boundary caught and swallowed — a fine-looking fallback over a broken feature. */
293
+ readonly SWALLOWED_ERROR: "swallowed-error";
294
+ };
295
+ export type PhenomenonType = (typeof PhenomenonType)[keyof typeof PhenomenonType];
296
+ /** Signal the React adapter fires once hydration commits (handlers attached). Shared browser↔server. */
297
+ export declare const RETICLE_HYDRATION_SIGNAL = "reticle:hydration-complete";
298
+ /**
299
+ * The registered-store name the React adapter uses for render stats, read via reticle_state. It crosses
300
+ * the wire as a store id AND the browser SDK special-cases it as reticle-owned (so it isn't flagged as
301
+ * an unregistered store), so the name is one fact in core — a rename in the adapter must not silently
302
+ * stop the SDK's owned-store matching.
303
+ */
304
+ export declare const RETICLE_RENDERS_STORE = "__reticle_renders";
305
+ /**
306
+ * Signal the React adapter fires when an error boundary catches (dev-only). Carried on the signal channel
307
+ * (the SDK's public emit surface) so the server sees a boundary that swallowed — the purest "looks fine,
308
+ * isn't", invisible to every other channel. `data: { message, stack?, componentStack? }`.
309
+ */
310
+ export declare const RETICLE_ERROR_BOUNDARY_SIGNAL = "reticle:error-boundary";
311
+ /**
312
+ * Signal the React adapter fires on a hydration mismatch — server-rendered markup that disagrees with the
313
+ * client's first render. React reports these as *recoverable* errors (`hydrateRoot(el, App,
314
+ * { onRecoverableError })`); a mismatch silently discards the SSR DOM and re-renders on the client, so the
315
+ * page "looks fine" while event handlers, form state, or scroll position were lost — invisible to DOM/
316
+ * network/console. `data: { message, stack?, componentStack? }`.
317
+ */
318
+ export declare const RETICLE_HYDRATION_ERROR_SIGNAL = "reticle:hydration-error";
319
+ /** The observation channel a TRUNCATED event names, so downstream knows WHICH data is incomplete. */
320
+ export declare const TruncationChannel: {
321
+ readonly DOM: "dom";
322
+ };
323
+ export type TruncationChannel = (typeof TruncationChannel)[keyof typeof TruncationChannel];
324
+ /**
325
+ * A region the SDK cannot see into — surfaced (never hidden) so a result's coverage reads honestly.
326
+ * Crosses the wire in a BLIND_SPOT event's `kind`, so it lives in core (the contract), not the server.
327
+ */
328
+ export declare const BlindSpotKind: {
329
+ readonly CLOSED_SHADOW_ROOT: "closed-shadow-root";
330
+ readonly CROSS_ORIGIN_IFRAME: "cross-origin-iframe";
331
+ readonly VIRTUALIZED_UNMOUNTED: "virtualized-unmounted";
332
+ /**
333
+ * Something wrapped `fetch` before we did, so the request we record is not necessarily the request
334
+ * that leaves. Wrappers chain outermost-first: anything installed EARLIER sits below us and mutates
335
+ * after we have read `init.body`. An interceptor initialised before connect(), or a polyfill, does
336
+ * exactly that. Unfixable from inside the page — there is no "patch last" primitive — so it is
337
+ * declared instead, and a verdict over it reports partial coverage rather than implying we saw the wire.
338
+ */
339
+ readonly WRAPPED_NETWORK: "wrapped-network";
340
+ };
341
+ export type BlindSpotKind = (typeof BlindSpotKind)[keyof typeof BlindSpotKind];
342
+ /**
343
+ * How an event was linked to the action it is attributed to. `window` means the SDK stamped the
344
+ * currently-active action's id onto every event observed between that action's dispatch and its
345
+ * settle — a time-window heuristic, not proven dataflow. It is the only tier available until
346
+ * commit-stream linking upgrades it; the label stays on so a chain is never presented as dataflow
347
+ * truth (see plan risk register).
348
+ */
349
+ export declare const EventAttribution: {
350
+ readonly WINDOW: "window";
351
+ };
352
+ export type EventAttribution = (typeof EventAttribution)[keyof typeof EventAttribution];
353
+ /** The web-perf metrics carried in an EventType.PERF event's `metric` field. */
354
+ export declare const PerfMetric: {
355
+ /** Largest Contentful Paint (ms). */
356
+ readonly LCP: "lcp";
357
+ /** Cumulative Layout Shift (unitless, running sum). */
358
+ readonly CLS: "cls";
359
+ /** A long task blocking the main thread (ms). */
360
+ readonly LONGTASK: "longtask";
361
+ };
362
+ export type PerfMetric = (typeof PerfMetric)[keyof typeof PerfMetric];
209
363
  /** Which input path executed an action — native (CDP/Playwright) vs synthetic dispatchEvent. */
210
364
  export declare const InputMode: {
211
365
  readonly REAL: "real";
@@ -315,7 +469,7 @@ export declare const QueryBy: {
315
469
  readonly TESTID: "testid";
316
470
  readonly ALT: "alt";
317
471
  /** Resolve by component identity / source location (auto-anchors — addresses any element with
318
- * no hand-added testid). Pair with ElementQuery.component and/or .source. */
472
+ * no hand-added testid). Pair with ElementQuery.component and/or.source. */
319
473
  readonly COMPONENT: "component";
320
474
  };
321
475
  export type QueryBy = (typeof QueryBy)[keyof typeof QueryBy];
@@ -332,6 +486,8 @@ export declare const ReticleCommand: {
332
486
  readonly CLOCK: "clock";
333
487
  readonly CAPABILITIES: "capabilities";
334
488
  readonly STATE_READ: "state_read";
489
+ /** Read localStorage / sessionStorage / readable cookies (sensitive keys redacted). */
490
+ readonly STORAGE_READ: "storage_read";
335
491
  /** scroll a ref's nearest scrollable container by ~a viewport (virtualized lists). */
336
492
  readonly SCROLL: "scroll";
337
493
  /** Session lifecycle: agent tunes the presenter session (e.g. idle-end timeout) for the app's needs. */
@@ -1 +1 @@
1
- {"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../src/constants.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,eAAO,MAAM,oBAAoB,OAAO,CAAC;AACzC,eAAO,MAAM,eAAe,aAAa,CAAC;AAC1C,eAAO,MAAM,wBAAwB,IAAI,CAAC;AAE1C;;;;;GAKG;AACH,wBAAgB,WAAW,CAAC,IAAI,GAAE,MAA6B,EAAE,IAAI,SAAc,GAAG,MAAM,CAE3F;AAED;;;;;GAKG;AACH,eAAO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C;AAE7D,2FAA2F;AAC3F,eAAO,MAAM,cAAc;;;;;;;;;;;;IAYzB,uFAAuF;;IAEvF,sFAAsF;;IAEtF,wGAAwG;;IAExG;;;OAGG;;IAEH,+DAA+D;;IAE/D,sGAAsG;;IAEtG;;;;OAIG;;CAEK,CAAC;AACX,MAAM,MAAM,cAAc,GAAG,CAAC,OAAO,cAAc,CAAC,CAAC,MAAM,OAAO,cAAc,CAAC,CAAC;AAElF,mFAAmF;AACnF,eAAO,MAAM,aAAa;;;;CAIhB,CAAC;AACX,MAAM,MAAM,aAAa,GAAG,CAAC,OAAO,aAAa,CAAC,CAAC,MAAM,OAAO,aAAa,CAAC,CAAC;AAE/E,0CAA0C;AAC1C,eAAO,MAAM,YAAY;;;;CAIf,CAAC;AACX,MAAM,MAAM,YAAY,GAAG,CAAC,OAAO,YAAY,CAAC,CAAC,MAAM,OAAO,YAAY,CAAC,CAAC;AAE5E,uEAAuE;AACvE,eAAO,MAAM,WAAW;;;;;CAKd,CAAC;AACX,MAAM,MAAM,WAAW,GAAG,CAAC,OAAO,WAAW,CAAC,CAAC,MAAM,OAAO,WAAW,CAAC,CAAC"}
package/dist/constants.js CHANGED
@@ -4,6 +4,11 @@
4
4
  */
5
5
  export const RETICLE_DEFAULT_PORT = 4400;
6
6
  export const RETICLE_WS_PATH = '/reticle';
7
+ /** Agent↔server MCP wire paths — served by the daemon HTTP plane, forwarded by the stdio proxy. */
8
+ export const MCP_SSE_PATH = '/mcp/sse';
9
+ export const MCP_MESSAGE_PATH = '/mcp/message';
10
+ /** Local-only daemon introspection — `reticle status` GETs this for sessions + health at a glance. */
11
+ export const STATUS_PATH = '/status';
7
12
  export const RETICLE_PROTOCOL_VERSION = 1;
8
13
  /**
9
14
  * The one place the bridge WebSocket URL is built. The SDK connect default, the vite/next snippet
@@ -51,6 +56,8 @@ export const ReticleEnv = {
51
56
  IDLE_SHUTDOWN: 'RETICLE_IDLE_SHUTDOWN_MS',
52
57
  /** Directory holding the auto-provisioned pairing token. Defaults to ~/.reticle; relocatable for CI. */
53
58
  PAIRING_TOKEN_DIR: 'RETICLE_PAIRING_TOKEN_DIR',
59
+ /** Force the durable causal journal off (`0`/`false`/`off`) or on (`1`/`true`/`on`); default on. */
60
+ JOURNAL: 'RETICLE_JOURNAL',
54
61
  };
55
62
  /** Hard transport bounds shared by the browser and bridge. */
56
63
  export const TRANSPORT_LIMITS = {
@@ -70,6 +77,9 @@ export const TRANSPORT_LIMITS = {
70
77
  MAX_COMMAND_NAME_LENGTH: 128,
71
78
  MAX_REF_LENGTH: 128,
72
79
  MAX_ERROR_LENGTH: 4096,
80
+ /** Cap on a captured stack trace before it crosses the wire — the console observer and both React
81
+ * error hooks (error-boundary, hydration-error) all truncate to this, so it is one fact. */
82
+ MAX_STACK_LENGTH: 4000,
73
83
  MAX_SERIALIZE_DEPTH: 8,
74
84
  MAX_COLLECTION_ITEMS: 200,
75
85
  MAX_OBJECT_KEYS: 200,
@@ -81,6 +91,14 @@ export const TRANSPORT_LIMITS = {
81
91
  };
82
92
  /** Replacement used when sensitive data is removed before crossing the bridge. */
83
93
  export const REDACTED_VALUE = '[REDACTED]';
94
+ /**
95
+ * The attribute the build plugin stamps on JSX host elements as `file:line:column`, so the browser SDK
96
+ * and the React adapter can map a DOM node back to its source file (the source-pointer feature, needed
97
+ * on React 19 which dropped _debugSource). Read here by both packages — it was duplicated as a local
98
+ * const in dom/source.ts AND dom/query.ts and inlined as a literal in the React adapter. The stamper
99
+ * (@reticlehq/babel-plugin, separate build tooling) stamps this same literal and MUST match it.
100
+ */
101
+ export const DATA_RETICLE_SOURCE_ATTR = 'data-reticle-source';
84
102
  /** Explicit opt-in argument required for potentially destructive actions. */
85
103
  export const DANGEROUS_ACTION_CONFIRM_ARG = 'confirmDangerous';
86
104
  /** Schema version stamped onto compiled replay programs. */
@@ -93,13 +111,29 @@ export const ReticleDir = {
93
111
  BASELINES_SUBDIR: 'baselines',
94
112
  /** cross-run memory — outcomes of past runs (the "did it behave like last time?" file). */
95
113
  PROJECT_FILE: 'project.json',
96
- /** opt-in pixel baselines — .reticle/visual/<name>.png + <name>.diff.png. */
114
+ /** opt-in pixel baselines —.reticle/visual/<name>.png + <name>.diff.png. */
97
115
  VISUAL_SUBDIR: 'visual',
98
- /** verification-run artifacts — .reticle/runs/<runId>.json (the OEM/CI-consumable verdict). */
116
+ /** verification-run artifacts —.reticle/runs/<runId>.json (the OEM/CI-consumable verdict). */
99
117
  RUNS_SUBDIR: 'runs',
118
+ /** fail-to-pass bug capsules —.reticle/capsules/<id>.json (a minimal failing flow + its evidence). */
119
+ CAPSULES_SUBDIR: 'capsules',
120
+ /** durable causal journal —.reticle/sessions/<id>/{events,actions}.jsonl (the substrate). */
121
+ SESSIONS_SUBDIR: 'sessions',
122
+ /** append-only event ledger inside a session dir (one ReticleEvent per line). */
123
+ JOURNAL_EVENTS_FILE: 'events.jsonl',
124
+ /** append-only action ledger inside a session dir (one JournalAction per line). */
125
+ JOURNAL_ACTIONS_FILE: 'actions.jsonl',
126
+ /** learned expected-envelopes per route, accumulated across runs (the deviation-report baseline). */
127
+ ENVELOPES_FILE: 'envelopes.json',
128
+ /** learned ambient (action-less churn) region map — excluded from settle/summaries/envelopes. */
129
+ AMBIENT_FILE: 'ambient.json',
130
+ /** per-flow flake ledger — replay outcomes that decide intermittent-failure quarantine. */
131
+ FLAKE_FILE: 'flake.json',
132
+ /** Per-flow assertion tiers recorded on each PASSING replay — the gate's anti-downgrade baseline. */
133
+ TIERS_FILE: 'assertion-tiers.json',
100
134
  /**
101
135
  * Auto-provisioned bridge pairing token, stored at ~/.reticle/pairing-token (mode 0600). Written by
102
- * the daemon, read Node-side by the build plugins to inject into connect(). A browser sandbox cannot
136
+ * the daemon, read Node-side by the build plugins to inject into connect. A browser sandbox cannot
103
137
  * read it, so a rogue localhost app can't present it — that's what stops cross-app session hijack.
104
138
  */
105
139
  PAIRING_TOKEN_FILE: 'pairing-token',
@@ -145,6 +179,10 @@ export const CRAWL_DEFAULTS = {
145
179
  /** HTTP status at/above which a response counts as a failed request. */
146
180
  FAILED_STATUS: 400,
147
181
  };
182
+ /** Default max wait for reticle_assert / reticle_wait_for / reticle_act_and_wait when the caller gives
183
+ * no `timeout_ms`. One fact, shared by the server tools and the @reticlehq/test matchers so the test
184
+ * package's assumption can't silently diverge from the server default. */
185
+ export const DEFAULT_ASSERT_TIMEOUT_MS = 4000;
148
186
  /** How long to wait between npm registry update checks (24 h). */
149
187
  export const UpdateCheckIntervalMs = 24 * 60 * 60 * 1000;
150
188
  /** Schema version stamped into contract.json so a reader can reject/upgrade old files. */
@@ -172,25 +210,56 @@ export const EventType = {
172
210
  DOM_TEXT: 'dom.text',
173
211
  NET_REQUEST: 'net.request',
174
212
  NET_PENDING: 'net.pending',
213
+ /** An SSE (EventSource) or WebSocket frame — a message on a long-lived streaming connection. */
214
+ NET_STREAM: 'net.stream',
215
+ /** A web-perf metric a screenshot can't verify: LCP, cumulative layout shift, or a long task. */
216
+ PERF: 'perf',
175
217
  ROUTE_CHANGE: 'route.change',
176
218
  CONSOLE_LOG: 'console.log',
177
219
  CONSOLE_WARN: 'console.warn',
178
220
  CONSOLE_ERROR: 'console.error',
221
+ CONSOLE_INFO: 'console.info',
222
+ CONSOLE_DEBUG: 'console.debug',
179
223
  ERROR_UNCAUGHT: 'error.uncaught',
180
224
  VISIBLE_SHOWN: 'visible.shown',
181
- VISIBLE_HIDDEN: 'visible.hidden',
182
225
  ANIM_START: 'anim.start',
183
226
  ANIM_END: 'anim.end',
184
227
  SCROLL_POSITION: 'scroll.position',
185
228
  REVEAL_SHOWN: 'reveal.shown',
186
229
  SIGNAL: 'signal',
187
230
  STATE_CHANGE: 'state.change',
231
+ /** a write to localStorage/sessionStorage/cookies — `data: { area, key, old?, new? }` (values redacted). */
232
+ STORAGE_CHANGE: 'storage.change',
188
233
  /** page-level visibility/focus health (distinct from element-level VISIBLE_*). */
189
234
  PAGE_HEALTH: 'page.health',
235
+ /** aggregated React commits over a throttle window (dev builds) — `data: { commits }`. Commit storms /
236
+ * wasted re-renders show up here without a per-render flood. */
237
+ RENDER_COMMIT: 'render.commit',
238
+ /** element focus moved — `data: { to, from, toBody }`. Focus dropping to body after an act is a regression. */
239
+ FOCUS_CHANGE: 'focus.change',
190
240
  /** browser → bridge: a human recording compiled in-page. */
191
241
  FLOW_RECORDED: 'flow.recorded',
192
242
  /** synthetic: browser transport queue overflowed; events were dropped. `data: { dropped: number }`. */
193
243
  TRANSPORT_OVERFLOW: 'transport.overflow',
244
+ /**
245
+ * synthetic: a per-channel cap truncated a batch (e.g. a DOM mutation flood). `data: { channel, dropped }`.
246
+ * Marks downstream rollups/envelopes as built on incomplete data — a ledger that lies at scale is worse
247
+ * than no ledger, so truncation is never silent.
248
+ */
249
+ TRUNCATED: 'truncated',
250
+ /**
251
+ * synthetic: the SDK detected a region it CANNOT observe (a cross-origin iframe, a closed shadow root).
252
+ * `data: { kind: BlindSpotKind, count }`. Surfaced on results as `coverage: partial` so a green never
253
+ * implies it saw everything.
254
+ */
255
+ BLIND_SPOT: 'blind-spot',
256
+ /**
257
+ * synthetic (driven only): CDP/Playwright-authoritative network detail for a response the in-page
258
+ * fetch/XHR wrapper also saw — full response headers + authoritative status/mimeType the page-side
259
+ * wrapper can't reach. `data: { url, method?, status, headers, resourceType? }`. Merged onto the
260
+ * matching in-page NET_REQUEST so the driven view never loses fidelity to an outside-in tool.
261
+ */
262
+ NET_DETAIL: 'net.detail',
194
263
  /**
195
264
  * Live-control: browser → bridge. A human acted on the presenter panel.
196
265
  * `data: { kind: HumanControlKind; text?: string }`. Rides the existing EventMessage.
@@ -204,6 +273,86 @@ export const EventType = {
204
273
  */
205
274
  HUMAN_MARK: 'human.mark',
206
275
  };
276
+ /**
277
+ * Named phenomena the perception layer detects deterministically over the journal — capsules and
278
+ * deviation reports lead with these names, not raw events. The library grows in later releases; the
279
+ * mechanism (versioned matchers + evidence templates) lands now.
280
+ */
281
+ export const PhenomenonType = {
282
+ /** An act dispatched but the app did nothing — no DOM/net/route/signal in its window. */
283
+ DEAD_CLICK: 'dead-click',
284
+ /** A click landed before hydration attached handlers — a silent no-op. */
285
+ PRE_HYDRATION_CLICK: 'pre-hydration-click',
286
+ /** A 5xx response that occurred while the page was hidden — looks fine, isn't. */
287
+ HIDDEN_500: 'hidden-500',
288
+ /** A request started and never completed within the window — a hung/in-flight request. */
289
+ HUNG_REQUEST: 'hung-request',
290
+ /** A React error boundary caught and swallowed — a fine-looking fallback over a broken feature. */
291
+ SWALLOWED_ERROR: 'swallowed-error',
292
+ };
293
+ /** Signal the React adapter fires once hydration commits (handlers attached). Shared browser↔server. */
294
+ export const RETICLE_HYDRATION_SIGNAL = 'reticle:hydration-complete';
295
+ /**
296
+ * The registered-store name the React adapter uses for render stats, read via reticle_state. It crosses
297
+ * the wire as a store id AND the browser SDK special-cases it as reticle-owned (so it isn't flagged as
298
+ * an unregistered store), so the name is one fact in core — a rename in the adapter must not silently
299
+ * stop the SDK's owned-store matching.
300
+ */
301
+ export const RETICLE_RENDERS_STORE = '__reticle_renders';
302
+ /**
303
+ * Signal the React adapter fires when an error boundary catches (dev-only). Carried on the signal channel
304
+ * (the SDK's public emit surface) so the server sees a boundary that swallowed — the purest "looks fine,
305
+ * isn't", invisible to every other channel. `data: { message, stack?, componentStack? }`.
306
+ */
307
+ export const RETICLE_ERROR_BOUNDARY_SIGNAL = 'reticle:error-boundary';
308
+ /**
309
+ * Signal the React adapter fires on a hydration mismatch — server-rendered markup that disagrees with the
310
+ * client's first render. React reports these as *recoverable* errors (`hydrateRoot(el, App,
311
+ * { onRecoverableError })`); a mismatch silently discards the SSR DOM and re-renders on the client, so the
312
+ * page "looks fine" while event handlers, form state, or scroll position were lost — invisible to DOM/
313
+ * network/console. `data: { message, stack?, componentStack? }`.
314
+ */
315
+ export const RETICLE_HYDRATION_ERROR_SIGNAL = 'reticle:hydration-error';
316
+ /** The observation channel a TRUNCATED event names, so downstream knows WHICH data is incomplete. */
317
+ export const TruncationChannel = {
318
+ DOM: 'dom',
319
+ };
320
+ /**
321
+ * A region the SDK cannot see into — surfaced (never hidden) so a result's coverage reads honestly.
322
+ * Crosses the wire in a BLIND_SPOT event's `kind`, so it lives in core (the contract), not the server.
323
+ */
324
+ export const BlindSpotKind = {
325
+ CLOSED_SHADOW_ROOT: 'closed-shadow-root',
326
+ CROSS_ORIGIN_IFRAME: 'cross-origin-iframe',
327
+ VIRTUALIZED_UNMOUNTED: 'virtualized-unmounted',
328
+ /**
329
+ * Something wrapped `fetch` before we did, so the request we record is not necessarily the request
330
+ * that leaves. Wrappers chain outermost-first: anything installed EARLIER sits below us and mutates
331
+ * after we have read `init.body`. An interceptor initialised before connect(), or a polyfill, does
332
+ * exactly that. Unfixable from inside the page — there is no "patch last" primitive — so it is
333
+ * declared instead, and a verdict over it reports partial coverage rather than implying we saw the wire.
334
+ */
335
+ WRAPPED_NETWORK: 'wrapped-network',
336
+ };
337
+ /**
338
+ * How an event was linked to the action it is attributed to. `window` means the SDK stamped the
339
+ * currently-active action's id onto every event observed between that action's dispatch and its
340
+ * settle — a time-window heuristic, not proven dataflow. It is the only tier available until
341
+ * commit-stream linking upgrades it; the label stays on so a chain is never presented as dataflow
342
+ * truth (see plan risk register).
343
+ */
344
+ export const EventAttribution = {
345
+ WINDOW: 'window',
346
+ };
347
+ /** The web-perf metrics carried in an EventType.PERF event's `metric` field. */
348
+ export const PerfMetric = {
349
+ /** Largest Contentful Paint (ms). */
350
+ LCP: 'lcp',
351
+ /** Cumulative Layout Shift (unitless, running sum). */
352
+ CLS: 'cls',
353
+ /** A long task blocking the main thread (ms). */
354
+ LONGTASK: 'longtask',
355
+ };
207
356
  /** Which input path executed an action — native (CDP/Playwright) vs synthetic dispatchEvent. */
208
357
  export const InputMode = {
209
358
  REAL: 'real',
@@ -294,7 +443,7 @@ export const QueryBy = {
294
443
  TESTID: 'testid',
295
444
  ALT: 'alt',
296
445
  /** Resolve by component identity / source location (auto-anchors — addresses any element with
297
- * no hand-added testid). Pair with ElementQuery.component and/or .source. */
446
+ * no hand-added testid). Pair with ElementQuery.component and/or.source. */
298
447
  COMPONENT: 'component',
299
448
  };
300
449
  /** Commands the bridge sends to the browser SDK (the `name` field of a CommandMessage). */
@@ -310,6 +459,8 @@ export const ReticleCommand = {
310
459
  CLOCK: 'clock',
311
460
  CAPABILITIES: 'capabilities',
312
461
  STATE_READ: 'state_read',
462
+ /** Read localStorage / sessionStorage / readable cookies (sensitive keys redacted). */
463
+ STORAGE_READ: 'storage_read',
313
464
  /** scroll a ref's nearest scrollable container by ~a viewport (virtualized lists). */
314
465
  SCROLL: 'scroll',
315
466
  /** Session lifecycle: agent tunes the presenter session (e.g. idle-end timeout) for the app's needs. */
@@ -1 +1 @@
1
- {"version":3,"file":"constants.js","sourceRoot":"","sources":["../src/constants.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,MAAM,CAAC,MAAM,oBAAoB,GAAG,IAAI,CAAC;AACzC,MAAM,CAAC,MAAM,eAAe,GAAG,UAAU,CAAC;AAC1C,MAAM,CAAC,MAAM,wBAAwB,GAAG,CAAC,CAAC;AAE1C;;;;;GAKG;AACH,MAAM,UAAU,WAAW,CAAC,OAAe,oBAAoB,EAAE,IAAI,GAAG,WAAW;IACjF,OAAO,QAAQ,IAAI,IAAI,MAAM,CAAC,IAAI,CAAC,GAAG,eAAe,EAAE,CAAC;AAC1D,CAAC;AAED;;;;;GAKG;AACH,MAAM,CAAC,MAAM,iBAAiB,GAAG;IAC/B,OAAO,EAAE,mBAAmB;IAC5B,OAAO,EAAE,mBAAmB;CACpB,CAAC;AAEX,yGAAyG;AACzG,MAAM,CAAC,MAAM,aAAa,GAAG,WAAW,CAAC;AAEzC;;;;GAIG;AACH,MAAM,CAAC,MAAM,UAAU,GAAG;IACxB,yFAAyF;IACzF,KAAK,EAAE,eAAe;IACtB,+FAA+F;IAC/F,IAAI,EAAE,cAAc;IACpB,2DAA2D;IAC3D,eAAe,EAAE,yBAAyB;IAC1C,sCAAsC;IACtC,IAAI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,EAAE,MAAM;IACZ,OAAO,EAAE,SAAS;IAClB,MAAM,EAAE,QAAQ;CACR,CAAC;AAGX,0CAA0C;AAC1C,MAAM,CAAC,MAAM,YAAY,GAAG;IAC1B,IAAI,EAAE,MAAM;IACZ,WAAW,EAAE,aAAa;IAC1B,MAAM,EAAE,QAAQ;CACR,CAAC;AAGX,uEAAuE;AACvE,MAAM,CAAC,MAAM,WAAW,GAAG;IACzB,KAAK,EAAE,OAAO;IACd,OAAO,EAAE,SAAS;IAClB,cAAc,EAAE,gBAAgB;IAChC,KAAK,EAAE,OAAO;CACN,CAAC"}
@@ -1,5 +1,5 @@
1
1
  import { z } from 'zod';
2
- /** The registry filename for a daemon on `port` (sibling of daemon-<port>.pid / .log). */
2
+ /** The registry filename for a daemon on `port` (sibling of daemon-<port>.pid /.log). */
3
3
  export declare function daemonRegistryFileName(port: number): string;
4
4
  /** Extract the port from a registry filename, or null when the name isn't a registry entry. */
5
5
  export declare function daemonRegistryPort(fileName: string): number | null;
@@ -27,10 +27,10 @@ export type DaemonRegistryEntry = z.infer<typeof DaemonRegistryEntrySchema>;
27
27
  /**
28
28
  * Pick the daemon port an app should connect to, given the registry entries, the app's projectId, and
29
29
  * a liveness probe. Pure so both the vite and next plugins share one rule and it's unit-testable:
30
- * 1. drop dead daemons (crashed, stale entry);
31
- * 2. among the living, prefer the one whose projectId matches the app's — lowest port wins on a tie;
32
- * 3. return null when nothing matches, so the caller falls back to the default port (never guesses a
33
- * mismatched daemon — a wrong auto-connect is worse than the honest default).
30
+ * 1. drop dead daemons (crashed, stale entry);
31
+ * 2. among the living, prefer the one whose projectId matches the app's — lowest port wins on a tie;
32
+ * 3. return null when nothing matches, so the caller falls back to the default port (never guesses a
33
+ * mismatched daemon — a wrong auto-connect is worse than the honest default).
34
34
  */
35
35
  export declare function pickDaemonPort(entries: readonly DaemonRegistryEntry[], projectId: string | undefined, isAlive: (pid: number) => boolean): number | null;
36
36
  //# sourceMappingURL=daemon-registry.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"daemon-registry.d.ts","sourceRoot":"","sources":["../src/daemon-registry.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAaxB,0FAA0F;AAC1F,wBAAgB,sBAAsB,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAE3D;AAED,+FAA+F;AAC/F,wBAAgB,kBAAkB,CAAC,QAAQ,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI,CAMlE;AAED,+FAA+F;AAC/F,eAAO,MAAM,yBAAyB;;;;;;;;;;;;;;;;;;EAMpC,CAAC;AACH,MAAM,MAAM,mBAAmB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,yBAAyB,CAAC,CAAC;AAE5E;;;;;;;GAOG;AACH,wBAAgB,cAAc,CAC5B,OAAO,EAAE,SAAS,mBAAmB,EAAE,EACvC,SAAS,EAAE,MAAM,GAAG,SAAS,EAC7B,OAAO,EAAE,CAAC,GAAG,EAAE,MAAM,KAAK,OAAO,GAChC,MAAM,GAAG,IAAI,CAOf"}
1
+ {"version":3,"file":"daemon-registry.d.ts","sourceRoot":"","sources":["../src/daemon-registry.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAaxB,yFAAyF;AACzF,wBAAgB,sBAAsB,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAE3D;AAED,+FAA+F;AAC/F,wBAAgB,kBAAkB,CAAC,QAAQ,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI,CAMlE;AAED,+FAA+F;AAC/F,eAAO,MAAM,yBAAyB;;;;;;;;;;;;;;;;;;EAMpC,CAAC;AACH,MAAM,MAAM,mBAAmB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,yBAAyB,CAAC,CAAC;AAE5E;;;;;;;GAOG;AACH,wBAAgB,cAAc,CAC5B,OAAO,EAAE,SAAS,mBAAmB,EAAE,EACvC,SAAS,EAAE,MAAM,GAAG,SAAS,EAC7B,OAAO,EAAE,CAAC,GAAG,EAAE,MAAM,KAAK,OAAO,GAChC,MAAM,GAAG,IAAI,CAOf"}
@@ -8,7 +8,7 @@ import { z } from 'zod';
8
8
  */
9
9
  const DAEMON_REGISTRY_PREFIX = 'daemon-';
10
10
  const DAEMON_REGISTRY_SUFFIX = '.json';
11
- /** The registry filename for a daemon on `port` (sibling of daemon-<port>.pid / .log). */
11
+ /** The registry filename for a daemon on `port` (sibling of daemon-<port>.pid /.log). */
12
12
  export function daemonRegistryFileName(port) {
13
13
  return `${DAEMON_REGISTRY_PREFIX}${String(port)}${DAEMON_REGISTRY_SUFFIX}`;
14
14
  }
@@ -31,10 +31,10 @@ export const DaemonRegistryEntrySchema = z.object({
31
31
  /**
32
32
  * Pick the daemon port an app should connect to, given the registry entries, the app's projectId, and
33
33
  * a liveness probe. Pure so both the vite and next plugins share one rule and it's unit-testable:
34
- * 1. drop dead daemons (crashed, stale entry);
35
- * 2. among the living, prefer the one whose projectId matches the app's — lowest port wins on a tie;
36
- * 3. return null when nothing matches, so the caller falls back to the default port (never guesses a
37
- * mismatched daemon — a wrong auto-connect is worse than the honest default).
34
+ * 1. drop dead daemons (crashed, stale entry);
35
+ * 2. among the living, prefer the one whose projectId matches the app's — lowest port wins on a tie;
36
+ * 3. return null when nothing matches, so the caller falls back to the default port (never guesses a
37
+ * mismatched daemon — a wrong auto-connect is worse than the honest default).
38
38
  */
39
39
  export function pickDaemonPort(entries, projectId, isAlive) {
40
40
  if (projectId === undefined || projectId.length === 0)
@@ -1 +1 @@
1
- {"version":3,"file":"daemon-registry.js","sourceRoot":"","sources":["../src/daemon-registry.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB;;;;;;GAMG;AAEH,MAAM,sBAAsB,GAAG,SAAS,CAAC;AACzC,MAAM,sBAAsB,GAAG,OAAO,CAAC;AAEvC,0FAA0F;AAC1F,MAAM,UAAU,sBAAsB,C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