@reticlehq/react 2.1.0 → 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.
package/NOTICE ADDED
@@ -0,0 +1,5 @@
1
+ Reticle
2
+ Copyright 2026 Reticle Labs
3
+
4
+ This product includes software developed at Reticle Labs.
5
+ Licensed under the Apache License, Version 2.0.
@@ -0,0 +1,54 @@
1
+ /**
2
+ * Read a React component's state from a page that never installed Reticle.
3
+ *
4
+ * `identify`/`readState` in this package read the same fiber, but they run IN-PROCESS: they close
5
+ * over module helpers and are called by the SDK the app loaded. The zero-install path has no SDK — the
6
+ * daemon is attached to an arbitrary page over CDP — so the reader has to travel INTO the page as
7
+ * text and run there, which means it can reference nothing outside itself. That single constraint,
8
+ * self-containment, is the reason this is a separate file rather than a reuse of `readState`.
9
+ *
10
+ * It works because the thing it reads is React's, not Reticle's: React stamps `__reactFiber$…` on
11
+ * every host element regardless of what instrumentation is present. This is the same hook
12
+ * react-devtools-mcp uses, which is exactly the tool the zero-install tier exists to reach parity
13
+ * with — reusing our own algorithm rather than adopting theirs.
14
+ *
15
+ * What it CANNOT recover is the SDK-exclusive surface, and that limit is honest and load-bearing: no
16
+ * custom signals (the app never emitted them), no registered store by name (`registerStore` was never
17
+ * called), and no build-time `file:line` (the plugin never ran). Those are precisely the
18
+ * inside-the-app truths the SDK is for. The capability report the CDP session emits must declare their
19
+ * absence so a thin-tier green never implies the full one.
20
+ */
21
+ /** The shape the injected reader returns. Mirrors ComponentStateResult but is defined here so the
22
+ * parser has no dependency on the in-process types (they may serialize differently). */
23
+ export interface CdpComponentRead {
24
+ ok: boolean;
25
+ reason?: string;
26
+ component?: string;
27
+ /** Positional hook states — React exposes no hook names, so order is the only key. */
28
+ hooks?: unknown[];
29
+ }
30
+ /**
31
+ * The reader, as a self-contained function.
32
+ *
33
+ * MUST reference nothing outside its own body: it is serialized with `.toString()` and evaluated in a
34
+ * page that has none of this module's scope. That is enforced by a test that runs it through
35
+ * `new Function` with an empty scope, so a stray closure reference fails loudly rather than throwing
36
+ * `X is not defined` only on the live CDP path.
37
+ *
38
+ * Bounds and fail-soft behaviour match the in-process reader: cap the hook walk, guard cycles, and
39
+ * degrade to `{ok:false, reason}` rather than throwing across the CDP boundary (where a throw becomes
40
+ * an opaque evaluation error).
41
+ */
42
+ export declare function readComponentAt(el: Element | null): CdpComponentRead;
43
+ /**
44
+ * The JS expression string to hand to `page.evaluate` / CDP `Runtime.evaluate`.
45
+ *
46
+ * Built from `readComponentAt.toString()` so the injected code and the unit-tested code are the SAME
47
+ * source — there is no second hand-maintained copy to drift. `selector` is JSON-encoded so a testid
48
+ * containing a quote cannot break out of the expression.
49
+ */
50
+ export declare function buildReaderExpression(selector: string): string;
51
+ /** Validate a raw CDP evaluation result into a typed read, so a malformed injection is caught here
52
+ * rather than surfacing as a confusing tool output. */
53
+ export declare function parseComponentRead(raw: unknown): CdpComponentRead;
54
+ //# sourceMappingURL=cdp-reader.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"cdp-reader.d.ts","sourceRoot":"","sources":["../src/cdp-reader.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AAEH;yFACyF;AACzF,MAAM,WAAW,gBAAgB;IAC/B,EAAE,EAAE,OAAO,CAAC;IACZ,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,sFAAsF;IACtF,KAAK,CAAC,EAAE,OAAO,EAAE,CAAC;CACnB;AAED;;;;;;;;;;;GAWG;AACH,wBAAgB,eAAe,CAAC,EAAE,EAAE,OAAO,GAAG,IAAI,GAAG,gBAAgB,CAwCpE;AAED;;;;;;GAMG;AACH,wBAAgB,qBAAqB,CAAC,QAAQ,EAAE,MAAM,GAAG,MAAM,CAE9D;AAED;wDACwD;AACxD,wBAAgB,kBAAkB,CAAC,GAAG,EAAE,OAAO,GAAG,gBAAgB,CASjE"}
@@ -0,0 +1,95 @@
1
+ /**
2
+ * Read a React component's state from a page that never installed Reticle.
3
+ *
4
+ * `identify`/`readState` in this package read the same fiber, but they run IN-PROCESS: they close
5
+ * over module helpers and are called by the SDK the app loaded. The zero-install path has no SDK — the
6
+ * daemon is attached to an arbitrary page over CDP — so the reader has to travel INTO the page as
7
+ * text and run there, which means it can reference nothing outside itself. That single constraint,
8
+ * self-containment, is the reason this is a separate file rather than a reuse of `readState`.
9
+ *
10
+ * It works because the thing it reads is React's, not Reticle's: React stamps `__reactFiber$…` on
11
+ * every host element regardless of what instrumentation is present. This is the same hook
12
+ * react-devtools-mcp uses, which is exactly the tool the zero-install tier exists to reach parity
13
+ * with — reusing our own algorithm rather than adopting theirs.
14
+ *
15
+ * What it CANNOT recover is the SDK-exclusive surface, and that limit is honest and load-bearing: no
16
+ * custom signals (the app never emitted them), no registered store by name (`registerStore` was never
17
+ * called), and no build-time `file:line` (the plugin never ran). Those are precisely the
18
+ * inside-the-app truths the SDK is for. The capability report the CDP session emits must declare their
19
+ * absence so a thin-tier green never implies the full one.
20
+ */
21
+ /**
22
+ * The reader, as a self-contained function.
23
+ *
24
+ * MUST reference nothing outside its own body: it is serialized with `.toString()` and evaluated in a
25
+ * page that has none of this module's scope. That is enforced by a test that runs it through
26
+ * `new Function` with an empty scope, so a stray closure reference fails loudly rather than throwing
27
+ * `X is not defined` only on the live CDP path.
28
+ *
29
+ * Bounds and fail-soft behaviour match the in-process reader: cap the hook walk, guard cycles, and
30
+ * degrade to `{ok:false, reason}` rather than throwing across the CDP boundary (where a throw becomes
31
+ * an opaque evaluation error).
32
+ */
33
+ export function readComponentAt(el) {
34
+ if (el === null)
35
+ return { ok: false, reason: 'no-element' };
36
+ try {
37
+ const FIBER_PREFIXES = ['__reactFiber$', '__reactInternalInstance$'];
38
+ const key = Object.keys(el).find((k) => FIBER_PREFIXES.some((p) => k.startsWith(p)));
39
+ if (key === undefined)
40
+ return { ok: false, reason: 'no-fiber' };
41
+ let fiber = el[key];
42
+ // Climb to the nearest function-component fiber; host fibers (strings) carry no hook state.
43
+ let guard = 0;
44
+ while (fiber !== null &&
45
+ fiber !== undefined &&
46
+ typeof fiber.type !== 'function' &&
47
+ guard < 200) {
48
+ fiber = fiber.return;
49
+ guard += 1;
50
+ }
51
+ if (fiber === null || fiber === undefined)
52
+ return { ok: false, reason: 'no-component-fiber' };
53
+ const type = fiber.type;
54
+ const component = type?.displayName ?? type?.name ?? undefined;
55
+ const hooks = [];
56
+ let hook = fiber.memoizedState;
57
+ let i = 0;
58
+ while (hook !== null && typeof hook === 'object' && i < 100) {
59
+ const state = hook.memoizedState;
60
+ // Only carry JSON-serializable primitives/plain values across the boundary; a function or DOM
61
+ // node in a hook (a ref, a callback) is dropped rather than breaking the whole read.
62
+ hooks.push(typeof state === 'function' ? '[fn]' : state);
63
+ const next = hook.next;
64
+ if (next === null || typeof next !== 'object')
65
+ break;
66
+ hook = next;
67
+ i += 1;
68
+ }
69
+ return component === undefined ? { ok: true, hooks } : { ok: true, component, hooks };
70
+ }
71
+ catch {
72
+ return { ok: false, reason: 'read-threw' };
73
+ }
74
+ }
75
+ /**
76
+ * The JS expression string to hand to `page.evaluate` / CDP `Runtime.evaluate`.
77
+ *
78
+ * Built from `readComponentAt.toString()` so the injected code and the unit-tested code are the SAME
79
+ * source — there is no second hand-maintained copy to drift. `selector` is JSON-encoded so a testid
80
+ * containing a quote cannot break out of the expression.
81
+ */
82
+ export function buildReaderExpression(selector) {
83
+ return `(${readComponentAt.toString()})(document.querySelector(${JSON.stringify(selector)}))`;
84
+ }
85
+ /** Validate a raw CDP evaluation result into a typed read, so a malformed injection is caught here
86
+ * rather than surfacing as a confusing tool output. */
87
+ export function parseComponentRead(raw) {
88
+ if (typeof raw !== 'object' ||
89
+ raw === null ||
90
+ typeof raw.ok !== 'boolean') {
91
+ return { ok: false, reason: 'malformed-read' };
92
+ }
93
+ return raw;
94
+ }
95
+ //# sourceMappingURL=cdp-reader.js.map
@@ -0,0 +1 @@
1
+ {"version":3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SAAS,EACjD,CAAC;QACD,OAAO,EAAE,EAAE,EAAE,KAAK,EAAE,MAAM,EAAE,gBAAgB,EAAE,CAAC;IACjD,CAAC;IACD,OAAO,GAAuB,CAAC;AACjC,CAAC"}
@@ -0,0 +1,17 @@
1
+ /**
2
+ * Throttled commit aggregator (render stream). React can commit many times per frame; emitting a
3
+ * RENDER_COMMIT event per commit would flood the ledger. This accumulates commits and flushes the COUNT
4
+ * once per throttle window (a scheduled tick), so a commit storm shows up as one event carrying its
5
+ * magnitude. The scheduler is injected, keeping the accumulate/flush logic pure and unit-testable.
6
+ */
7
+ export interface CommitAggregator {
8
+ onCommit(): void;
9
+ }
10
+ export interface CommitAggregatorOptions {
11
+ /** Injected scheduler (rAF / setTimeout) — deterministic in tests. */
12
+ schedule: (fn: () => void) => void;
13
+ /** Called once per window with the number of commits accumulated since the last flush. */
14
+ flush: (commits: number) => void;
15
+ }
16
+ export declare function createCommitAggregator(options: CommitAggregatorOptions): CommitAggregator;
17
+ //# sourceMappingURL=commit-aggregator.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"commit-aggregator.d.ts","sourceRoot":"","sources":["../src/commit-aggregator.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,MAAM,WAAW,gBAAgB;IAC/B,QAAQ,IAAI,IAAI,CAAC;CAClB;AAED,MAAM,WAAW,uBAAuB;IACtC,sEAAsE;IACtE,QAAQ,EAAE,CAAC,EAAE,EAAE,MAAM,IAAI,KAAK,IAAI,CAAC;IACnC,0FAA0F;IAC1F,KAAK,EAAE,CAAC,OAAO,EAAE,MAAM,KAAK,IAAI,CAAC;CAClC;AAED,wBAAgB,sBAAsB,CAAC,OAAO,EAAE,uBAAuB,GAAG,gBAAgB,CAgBzF"}
@@ -0,0 +1,20 @@
1
+ export function createCommitAggregator(options) {
2
+ let pending = 0;
3
+ let scheduled = false;
4
+ return {
5
+ onCommit() {
6
+ pending += 1;
7
+ if (scheduled)
8
+ return;
9
+ scheduled = true;
10
+ options.schedule(() => {
11
+ scheduled = false;
12
+ const commits = pending;
13
+ pending = 0;
14
+ if (commits > 0)
15
+ options.flush(commits);
16
+ });
17
+ },
18
+ };
19
+ }
20
+ //# sourceMappingURL=commit-aggregator.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"commit-aggregator.js","sourceRoot":"","sources":["../src/commit-aggregator.ts"],"names":[],"mappings":"AAiBA,MAAM,UAAU,sBAAsB,CAAC,OAAgC;IACrE,IAAI,OAAO,GAAG,CAAC,CAAC;IAChB,IAAI,SAAS,GAAG,KAAK,CAAC;IACtB,OAAO;QACL,QAAQ;YACN,OAAO,IAAI,CAAC,CAAC;YACb,IAAI,SAAS;gBAAE,OAAO;YACtB,SAAS,GAAG,IAAI,CAAC;YACjB,OAAO,CAAC,QAAQ,CAAC,GAAG,EAAE;gBACpB,SAAS,GAAG,KAAK,CAAC;gBAClB,MAAM,OAAO,GAAG,OAAO,CAAC;gBACxB,OAAO,GAAG,CAAC,CAAC;gBACZ,IAAI,OAAO,GAAG,CAAC;oBAAE,OAAO,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC;YAC1C,CAAC,CAAC,CAAC;QACL,CAAC;KACF,CAAC;AACJ,CAAC"}
@@ -0,0 +1,14 @@
1
+ export interface ErrorBoundaryData {
2
+ message: string;
3
+ stack?: string;
4
+ componentStack?: string;
5
+ }
6
+ /** Pure: shape a boundary catch into the reported payload (message + capped stacks). */
7
+ export declare function buildErrorBoundaryData(error: unknown, errorInfo?: {
8
+ componentStack?: string | null;
9
+ }): ErrorBoundaryData;
10
+ /** Pass to React 19 `createRoot(el, { onCaughtError })`. Emits the catch on the signal channel. */
11
+ export declare function reticleOnCaughtError(error: unknown, errorInfo?: {
12
+ componentStack?: string | null;
13
+ }): void;
14
+ //# sourceMappingURL=error-boundary.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"error-boundary.d.ts","sourceRoot":"","sources":["../src/error-boundary.ts"],"names":[],"mappings":"AAYA,MAAM,WAAW,iBAAiB;IAChC,OAAO,EAAE,MAAM,CAAC;IAChB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,cAAc,CAAC,EAAE,MAAM,CAAC;CACzB;AAOD,wFAAwF;AACxF,wBAAgB,sBAAsB,CACpC,KAAK,EAAE,OAAO,EACd,SAAS,CAAC,EAAE;IAAE,cAAc,CAAC,EAAE,MAAM,GAAG,IAAI,CAAA;CAAE,GAC7C,iBAAiB,CASnB;AAED,mGAAmG;AACnG,wBAAgB,oBAAoB,CAClC,KAAK,EAAE,OAAO,EACd,SAAS,CAAC,EAAE;IAAE,cAAc,CAAC,EAAE,MAAM,GAAG,IAAI,CAAA;CAAE,GAC7C,IAAI,CAQN"}
@@ -0,0 +1,32 @@
1
+ import { RETICLE_ERROR_BOUNDARY_SIGNAL, TRANSPORT_LIMITS } from '@reticlehq/core';
2
+ /**
3
+ * React error-boundary capture, dev-only). A boundary that catches and swallows renders a fallback
4
+ * that "looks fine" while the feature is broken — invisible to DOM/network/console channels. React 19's
5
+ * `createRoot(el, { onCaughtError })` reports every boundary catch; pass `reticleOnCaughtError` there and
6
+ * the catch surfaces on the signal channel (the SDK's public emit surface). Pure formatter is unit-tested;
7
+ * the handler is thin glue that emits via the SDK instance if present.
8
+ */
9
+ const MAX_STACK_LEN = TRANSPORT_LIMITS.MAX_STACK_LENGTH;
10
+ function cap(value) {
11
+ if (value === undefined || value.length === 0)
12
+ return undefined;
13
+ return value.length > MAX_STACK_LEN ? value.slice(0, MAX_STACK_LEN) : value;
14
+ }
15
+ /** Pure: shape a boundary catch into the reported payload (message + capped stacks). */
16
+ export function buildErrorBoundaryData(error, errorInfo) {
17
+ const message = error instanceof Error ? error.message : String(error);
18
+ const stack = cap(error instanceof Error ? error.stack : undefined);
19
+ const componentStack = cap(errorInfo?.componentStack ?? undefined);
20
+ return {
21
+ message,
22
+ ...(stack === undefined ? {} : { stack }),
23
+ ...(componentStack === undefined ? {} : { componentStack }),
24
+ };
25
+ }
26
+ /** Pass to React 19 `createRoot(el, { onCaughtError })`. Emits the catch on the signal channel. */
27
+ export function reticleOnCaughtError(error, errorInfo) {
28
+ const data = buildErrorBoundaryData(error, errorInfo);
29
+ const instance = globalThis.__reticleInstance;
30
+ instance?.signal?.(RETICLE_ERROR_BOUNDARY_SIGNAL, { ...data });
31
+ }
32
+ //# sourceMappingURL=error-boundary.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"error-boundary.js","sourceRoot":"","sources":["../src/error-boundary.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,6BAA6B,EAAE,gBAAgB,EAAE,MAAM,iBAAiB,CAAC;AAElF;;;;;;GAMG;AAEH,MAAM,aAAa,GAAG,gBAAgB,CAAC,gBAAgB,CAAC;AAQxD,SAAS,GAAG,CAAC,KAAyB;IACpC,IAAI,KAAK,KAAK,SAAS,IAAI,KAAK,CAAC,MAAM,KAAK,CAAC;QAAE,OAAO,SAAS,CAAC;IAChE,OAAO,KAAK,CAAC,MAAM,GAAG,aAAa,CAAC,CAAC,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC,EAAE,aAAa,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC;AAC9E,CAAC;AAED,wFAAwF;AACxF,MAAM,UAAU,sBAAsB,CACpC,KAAc,EACd,SAA8C;IAE9C,MAAM,OAAO,GAAG,KAAK,YAAY,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;IACvE,MAAM,KAAK,GAAG,GAAG,CAAC,KAAK,YAAY,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC;IACpE,MAAM,cAAc,GAAG,GAAG,CAAC,SAAS,EAAE,cAAc,IAAI,SAAS,CAAC,CAAC;IACnE,OAAO;QACL,OAAO;QACP,GAAG,CAAC,KAAK,KAAK,SAAS,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,EAAE,KAAK,EAAE,CAAC;QACzC,GAAG,CAAC,cAAc,KAAK,SAAS,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,EAAE,cAAc,EAAE,CAAC;KAC5D,CAAC;AACJ,CAAC;AAED,mGAAmG;AACnG,MAAM,UAAU,oBAAoB,CAClC,KAAc,EACd,SAA8C;IAE9C,MAAM,IAAI,GAAG,sBAAsB,CAAC,KAAK,EAAE,SAAS,CAAC,CAAC;IACtD,MAAM,QAAQ,GACZ,UAGD,CAAC,iBAAiB,CAAC;IACpB,QAAQ,EAAE,MAAM,EAAE,CAAC,6BAA6B,EAAE,EAAE,GAAG,IAAI,EAAE,CAAC,CAAC;AACjE,CAAC"}
@@ -0,0 +1,22 @@
1
+ /**
2
+ * Whether a recoverable error is a hydration mismatch. React phrases these with "hydrat"/"does not match
3
+ * server-rendered" in dev, and as `Minified React error #<code>` for the hydration codes in prod.
4
+ */
5
+ export declare function isHydrationMismatch(error: unknown): boolean;
6
+ export interface HydrationErrorData {
7
+ message: string;
8
+ stack?: string;
9
+ componentStack?: string;
10
+ }
11
+ /** Pure: shape a hydration mismatch into the reported payload (message + capped stacks). */
12
+ export declare function buildHydrationErrorData(error: unknown, errorInfo?: {
13
+ componentStack?: string | null;
14
+ }): HydrationErrorData;
15
+ /**
16
+ * Pass to React 19 `hydrateRoot(el, App, { onRecoverableError })`. Emits ONLY hydration mismatches on the
17
+ * signal channel — other recoverable errors are React's normal self-healing and not a Reticle finding.
18
+ */
19
+ export declare function reticleOnRecoverableError(error: unknown, errorInfo?: {
20
+ componentStack?: string | null;
21
+ }): void;
22
+ //# sourceMappingURL=hydration-error.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"hydration-error.d.ts","sourceRoot":"","sources":["../src/hydration-error.ts"],"names":[],"mappings":"AA8BA;;;GAGG;AACH,wBAAgB,mBAAmB,CAAC,KAAK,EAAE,OAAO,GAAG,OAAO,CAM3D;AAED,MAAM,WAAW,kBAAkB;IACjC,OAAO,EAAE,MAAM,CAAC;IAChB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,cAAc,CAAC,EAAE,MAAM,CAAC;CACzB;AAED,4FAA4F;AAC5F,wBAAgB,uBAAuB,CACrC,KAAK,EAAE,OAAO,EACd,SAAS,CAAC,EAAE;IAAE,cAAc,CAAC,EAAE,MAAM,GAAG,IAAI,CAAA;CAAE,GAC7C,kBAAkB,CASpB;AAED;;;GAGG;AACH,wBAAgB,yBAAyB,CACvC,KAAK,EAAE,OAAO,EACd,SAAS,CAAC,EAAE;IAAE,cAAc,CAAC,EAAE,MAAM,GAAG,IAAI,CAAA;CAAE,GAC7C,IAAI,CASN"}
@@ -0,0 +1,62 @@
1
+ import { RETICLE_HYDRATION_ERROR_SIGNAL, TRANSPORT_LIMITS } from '@reticlehq/core';
2
+ /**
3
+ * React hydration-mismatch capture. A mismatch — server-rendered markup disagreeing with the
4
+ * client's first render — is reported by React as a *recoverable* error, not thrown: React discards the
5
+ * SSR DOM and re-renders on the client, so the page "looks fine" while handlers/form-state/scroll were
6
+ * silently lost. Invisible to DOM/network/console; only an in-app hook sees it. Pass `reticleOnRecoverableError`
7
+ * to `hydrateRoot(el, App, { onRecoverableError })` and a mismatch surfaces on the signal channel.
8
+ * Pure classifier + shaper are unit-tested; the handler is thin glue that emits via the SDK if present.
9
+ */
10
+ const MAX_STACK_LEN = TRANSPORT_LIMITS.MAX_STACK_LENGTH;
11
+ /** Minified React error codes that denote a hydration mismatch (react.dev/errors/<code>). */
12
+ const HYDRATION_ERROR_CODES = new Set([
13
+ '418',
14
+ '419',
15
+ '420',
16
+ '421',
17
+ '422',
18
+ '423',
19
+ '424',
20
+ '425',
21
+ ]);
22
+ function cap(value) {
23
+ if (value === undefined || value.length === 0)
24
+ return undefined;
25
+ return value.length > MAX_STACK_LEN ? value.slice(0, MAX_STACK_LEN) : value;
26
+ }
27
+ /**
28
+ * Whether a recoverable error is a hydration mismatch. React phrases these with "hydrat"/"does not match
29
+ * server-rendered" in dev, and as `Minified React error #<code>` for the hydration codes in prod.
30
+ */
31
+ export function isHydrationMismatch(error) {
32
+ const message = error instanceof Error ? error.message : String(error);
33
+ if (/hydrat/i.test(message))
34
+ return true;
35
+ if (/does not match (the )?server-rendered/i.test(message))
36
+ return true;
37
+ const minified = /Minified React error #(\d+)/.exec(message);
38
+ return minified !== null && minified[1] !== undefined && HYDRATION_ERROR_CODES.has(minified[1]);
39
+ }
40
+ /** Pure: shape a hydration mismatch into the reported payload (message + capped stacks). */
41
+ export function buildHydrationErrorData(error, errorInfo) {
42
+ const message = error instanceof Error ? error.message : String(error);
43
+ const stack = cap(error instanceof Error ? error.stack : undefined);
44
+ const componentStack = cap(errorInfo?.componentStack ?? undefined);
45
+ return {
46
+ message,
47
+ ...(stack === undefined ? {} : { stack }),
48
+ ...(componentStack === undefined ? {} : { componentStack }),
49
+ };
50
+ }
51
+ /**
52
+ * Pass to React 19 `hydrateRoot(el, App, { onRecoverableError })`. Emits ONLY hydration mismatches on the
53
+ * signal channel — other recoverable errors are React's normal self-healing and not a Reticle finding.
54
+ */
55
+ export function reticleOnRecoverableError(error, errorInfo) {
56
+ if (!isHydrationMismatch(error))
57
+ return;
58
+ const data = buildHydrationErrorData(error, errorInfo);
59
+ const instance = globalThis.__reticleInstance;
60
+ instance?.signal?.(RETICLE_HYDRATION_ERROR_SIGNAL, { ...data });
61
+ }
62
+ //# sourceMappingURL=hydration-error.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"hydration-error.js","sourceRoot":"","sources":["../src/hydration-error.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,8BAA8B,EAAE,gBAAgB,EAAE,MAAM,iBAAiB,CAAC;AAEnF;;;;;;;GAOG;AAEH,MAAM,aAAa,GAAG,gBAAgB,CAAC,gBAAgB,CAAC;AAExD,6FAA6F;AAC7F,MAAM,qBAAqB,GAAwB,IAAI,GAAG,CAAC;IACzD,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;IACL,KAAK;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AAc,IAAI,SAAS,CAAC,CAAC;IACnE,OAAO;QACL,OAAO;QACP,GAAG,CAAC,KAAK,KAAK,SAAS,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,EAAE,KAAK,EAAE,CAAC;QACzC,GAAG,CAAC,cAAc,KAAK,SAAS,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,EAAE,cAAc,EAAE,CAAC;KAC5D,CAAC;AACJ,CAAC;AAED;;;GAGG;AACH,MAAM,UAAU,yBAAyB,CACvC,KAAc,EACd,SAA8C;IAE9C,IAAI,CAAC,mBAAmB,CAAC,KAAK,CAAC;QAAE,OAAO;IACxC,MAAM,IAAI,GAAG,uBAAuB,CAAC,KAAK,EAAE,SAAS,CAAC,CAAC;IACvD,MAAM,QAAQ,GACZ,UAGD,CAAC,iBAAiB,CAAC;IACpB,QAAQ,EAAE,MAAM,EAAE,CAAC,8BAA8B,EAAE,EAAE,GAAG,IAAI,EAAE,CAAC,CAAC;AAClE,CAAC"}
@@ -0,0 +1,17 @@
1
+ /**
2
+ * React hydration detection — a science-backed differentiator. The published literature says no agent
3
+ * framework can detect hydration completion from OUTSIDE the page: pre-hydration clicks are silent no-ops,
4
+ * and only an in-app SDK knows when handlers attached. React's FIRST commit (via the DevTools commit hook)
5
+ * is the hydration/initial-mount boundary — so the first commit is "handlers attached". We emit a
6
+ * `reticle:hydration-complete` signal exactly once, letting the agent wait for interactivity instead of
7
+ * clicking into the void. Pure tracker; the commit hook drives it, the SDK emits the signal.
8
+ */
9
+ /** The signal fired once React has committed its first render (handlers attached). */
10
+ export declare const HYDRATION_COMPLETE_SIGNAL = "reticle:hydration-complete";
11
+ export interface HydrationTracker {
12
+ /** Call on every React commit; fires `onHydrated` exactly once, on the first. */
13
+ onCommit(): void;
14
+ isHydrated(): boolean;
15
+ }
16
+ export declare function createHydrationTracker(onHydrated: () => void): HydrationTracker;
17
+ //# sourceMappingURL=hydration.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"hydration.d.ts","sourceRoot":"","sources":["../src/hydration.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAIH,sFAAsF;AACtF,eAAO,MAAM,yBAAyB,+BAA2B,CAAC;AAElE,MAAM,WAAW,gBAAgB;IAC/B,iFAAiF;IACjF,QAAQ,IAAI,IAAI,CAAC;IACjB,UAAU,IAAI,OAAO,CAAC;CACvB;AAED,wBAAgB,sBAAsB,CAAC,UAAU,EAAE,MAAM,IAAI,GAAG,gBAAgB,CAU/E"}
@@ -0,0 +1,24 @@
1
+ /**
2
+ * React hydration detection — a science-backed differentiator. The published literature says no agent
3
+ * framework can detect hydration completion from OUTSIDE the page: pre-hydration clicks are silent no-ops,
4
+ * and only an in-app SDK knows when handlers attached. React's FIRST commit (via the DevTools commit hook)
5
+ * is the hydration/initial-mount boundary — so the first commit is "handlers attached". We emit a
6
+ * `reticle:hydration-complete` signal exactly once, letting the agent wait for interactivity instead of
7
+ * clicking into the void. Pure tracker; the commit hook drives it, the SDK emits the signal.
8
+ */
9
+ import { RETICLE_HYDRATION_SIGNAL } from '@reticlehq/core';
10
+ /** The signal fired once React has committed its first render (handlers attached). */
11
+ export const HYDRATION_COMPLETE_SIGNAL = RETICLE_HYDRATION_SIGNAL;
12
+ export function createHydrationTracker(onHydrated) {
13
+ let hydrated = false;
14
+ return {
15
+ onCommit() {
16
+ if (hydrated)
17
+ return;
18
+ hydrated = true;
19
+ onHydrated();
20
+ },
21
+ isHydrated: () => hydrated,
22
+ };
23
+ }
24
+ //# sourceMappingURL=hydration.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"hydration.js","sourceRoot":"","sources":["../src/hydration.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,EAAE,wBAAwB,EAAE,MAAM,iBAAiB,CAAC;AAE3D,sFAAsF;AACtF,MAAM,CAAC,MAAM,yBAAyB,GAAG,wBAAwB,CAAC;AAQlE,MAAM,UAAU,sBAAsB,CAAC,UAAsB;IAC3D,IAAI,QAAQ,GAAG,KAAK,CAAC;IACrB,OAAO;QACL,QAAQ;YACN,IAAI,QAAQ;gBAAE,OAAO;YACrB,QAAQ,GAAG,IAAI,CAAC;YAChB,UAAU,EAAE,CAAC;QACf,CAAC;QACD,UAAU,EAAE,GAAY,EAAE,CAAC,QAAQ;KACpC,CAAC;AACJ,CAAC"}
package/dist/index.d.ts CHANGED
@@ -12,5 +12,10 @@ export declare function hasHoverHandlers(el: Element): boolean;
12
12
  /** Register the React adapter so `reticle.inspect` returns component stack + source file. */
13
13
  export declare function install(): void;
14
14
  export { installRenderMeter, resetRenderMeter, getRenderStats, type RenderStats, } from './render-meter.js';
15
+ export { HYDRATION_COMPLETE_SIGNAL, createHydrationTracker, type HydrationTracker, } from './hydration.js';
16
+ export { buildErrorBoundaryData, reticleOnCaughtError, type ErrorBoundaryData, } from './error-boundary.js';
17
+ export { buildHydrationErrorData, isHydrationMismatch, reticleOnRecoverableError, type HydrationErrorData, } from './hydration-error.js';
18
+ export { createCommitAggregator, type CommitAggregator } from './commit-aggregator.js';
19
+ export { readComponentAt, buildReaderExpression, parseComponentRead, type CdpComponentRead, } from './cdp-reader.js';
15
20
  export * from '@reticlehq/browser';
16
21
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAmB,KAAK,aAAa,EAAwB,MAAM,oBAAoB,CAAC;AAC/F,OAAO,EAAwB,KAAK,oBAAoB,EAAE,MAAM,iBAAiB,CAAC;AAmElF,0FAA0F;AAC1F,wBAAgB,QAAQ,CAAC,EAAE,EAAE,OAAO,GAAG,aAAa,GAAG,IAAI,CAmC1D;AAkED,wBAAgB,SAAS,CAAC,EAAE,EAAE,OAAO,GAAG,oBAAoB,CA0B3D;AASD;;;;GAIG;AACH,wBAAgB,gBAAgB,CAAC,EAAE,EAAE,OAAO,GAAG,OAAO,CAMrD;AAID,6FAA6F;AAC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ED
@@ -1,5 +1,5 @@
1
1
  import { registerAdapter } from '@reticlehq/browser';
2
- import { ComponentStateReason } from '@reticlehq/core';
2
+ import { ComponentStateReason, DATA_RETICLE_SOURCE_ATTR, } from '@reticlehq/core';
3
3
  const FIBER_PREFIXES = ['__reactFiber$', '__reactInternalInstance$'];
4
4
  const MAX_DEPTH = 200;
5
5
  const MAX_HOOKS = 100;
@@ -79,8 +79,8 @@ export function identify(el) {
79
79
  return info;
80
80
  }
81
81
  function sourceFromAttribute(el) {
82
- const stamped = el.closest('[data-reticle-source]');
83
- const raw = stamped?.getAttribute('data-reticle-source');
82
+ const stamped = el.closest(`[${DATA_RETICLE_SOURCE_ATTR}]`);
83
+ const raw = stamped?.getAttribute(DATA_RETICLE_SOURCE_ATTR);
84
84
  if (raw === null || raw === undefined)
85
85
  return undefined;
86
86
  const match = /^(.*):(\d+):(\d+)$/.exec(raw);
@@ -205,6 +205,13 @@ export function install() {
205
205
  registerAdapter({ name: 'react', identify, readState, hasHoverHandlers });
206
206
  }
207
207
  export { installRenderMeter, resetRenderMeter, getRenderStats, } from './render-meter.js';
208
+ export { HYDRATION_COMPLETE_SIGNAL, createHydrationTracker, } from './hydration.js';
209
+ export { buildErrorBoundaryData, reticleOnCaughtError, } from './error-boundary.js';
210
+ export { buildHydrationErrorData, isHydrationMismatch, reticleOnRecoverableError, } from './hydration-error.js';
211
+ export { createCommitAggregator } from './commit-aggregator.js';
212
+ // Zero-install component read: a self-contained fiber walker that runs INSIDE a page over CDP, for a
213
+ // page that never installed the SDK. react-devtools-mcp parity, reusing our own algorithm.
214
+ export { readComponentAt, buildReaderExpression, parseComponentRead, } from './cdp-reader.js';
208
215
  // This package IS the React kit: one install gives an app dev the full browser-side surface
209
216
  // (the `reticle` instance + all sensing) plus this React adapter. Re-exporting the sensor here is
210
217
  // what lets `reticle init` wire a single dependency (`@reticlehq/react`) instead of making the app
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":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AuB,EACvB,mBAAmB,EACnB,yBAAyB,GAE1B,MAAM,sBAAsB,CAAC;AAC9B,OAAO,EAAE,sBAAsB,EAAyB,MAAM,wBAAwB,CAAC;AAEvF,qGAAqG;AACrG,2FAA2F;AAC3F,OAAO,EACL,eAAe,EACf,qBAAqB,EACrB,kBAAkB,GAEnB,MAAM,iBAAiB,CAAC;AAEzB,4FAA4F;AAC5F,kGAAkG;AAClG,mGAAmG;AACnG,kGAAkG;AAClG,sFAAsF;AACtF,cAAc,oBAAoB,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"render-meter.d.ts","sourceRoot":"","sources":["../src/render-meter.ts"],"names":[],"mappings":"AAwCA,6FAA6F;AAC7F,MAAM,WAAW,WAAW;IAC1B,6FAA6F;IAC7F,OAAO,EAAE,MAAM,CAAC;CACjB;AAED,wBAAgB,cAAc,IAAI,WAAW,CAE5C;AAED,8FAA8F;AAC9F,wBAAgB,gBAAgB,IAAI,IAAI,CAEvC;AAED;;;GAGG;AACH,wBAAgB,kBAAkB,IAAI,IAAI,CAsCzC"}
1
+ {"version":3,"file":"render-meter.d.ts","sourceRoot":"","sources":["../src/render-meter.ts"],"names":[],"mappings":"AA0EA,6FAA6F;AAC7F,MAAM,WAAW,WAAW;IAC1B,6FAA6F;IAC7F,OAAO,EAAE,MAAM,CAAC;CACjB;AAED,wBAAgB,cAAc,IAAI,WAAW,CAE5C;AAED,8FAA8F;AAC9F,wBAAgB,gBAAgB,IAAI,IAAI,CAEvC;AAED;;;GAGG;AACH,wBAAgB,kBAAkB,IAAI,IAAI,CAoCzC"}
@@ -16,9 +16,41 @@
16
16
  * complete minimal hook. MUST be installed before `react-dom` initializes (React reads the hook at
17
17
  * renderer-inject time) — import this as the first side-effect in the app entry, before React.
18
18
  */
19
+ import { RETICLE_RENDERS_STORE } from '@reticlehq/core';
19
20
  import { registerStore } from '@reticlehq/browser';
21
+ import { HYDRATION_COMPLETE_SIGNAL, createHydrationTracker } from './hydration.js';
22
+ import { createCommitAggregator } from './commit-aggregator.js';
20
23
  const HOOK_KEY = '__REACT_DEVTOOLS_GLOBAL_HOOK__';
21
- const RENDER_STORE = '__reticle_renders';
24
+ const RENDER_STORE = RETICLE_RENDERS_STORE;
25
+ // Fire the hydration-complete signal (once, on the first commit) via the SDK instance if it is present.
26
+ // Structural access avoids importing the whole Reticle type into this tooling module.
27
+ const hydration = createHydrationTracker(() => {
28
+ const instance = globalThis
29
+ .__reticleInstance;
30
+ instance?.signal?.(HYDRATION_COMPLETE_SIGNAL);
31
+ });
32
+ // Access the SDK instance structurally (avoids importing the whole Reticle type into this tooling module).
33
+ function reticleInstance() {
34
+ return globalThis
35
+ .__reticleInstance;
36
+ }
37
+ // Emit the render stream as aggregated RENDER_COMMIT events, throttled to one flush per frame so a commit
38
+ // storm is one event of magnitude N, never a per-render flood. requestAnimationFrame when available.
39
+ const commitStream = createCommitAggregator({
40
+ schedule: (fn) => {
41
+ if (typeof requestAnimationFrame === 'function')
42
+ requestAnimationFrame(() => fn());
43
+ else
44
+ setTimeout(fn, 16);
45
+ },
46
+ flush: (n) => reticleInstance()?.renderCommit?.(n),
47
+ });
48
+ /** One React commit: bump the counter, fire hydration on the first, and feed the throttled stream. */
49
+ function onReactCommit() {
50
+ commits += 1;
51
+ hydration.onCommit();
52
+ commitStream.onCommit();
53
+ }
22
54
  let commits = 0;
23
55
  let installed = false;
24
56
  function noop() {
@@ -48,9 +80,7 @@ export function installRenderMeter() {
48
80
  renderers: new Map(),
49
81
  inject: () => 1,
50
82
  onScheduleFiberRoot: noop,
51
- onCommitFiberRoot: () => {
52
- commits += 1;
53
- },
83
+ onCommitFiberRoot: onReactCommit,
54
84
  onPostCommitFiberRoot: noop,
55
85
  onCommitFiberUnmount: noop,
56
86
  };
@@ -60,7 +90,7 @@ export function installRenderMeter() {
60
90
  ? existing.onCommitFiberRoot.bind(existing)
61
91
  : undefined;
62
92
  existing.onCommitFiberRoot = (...args) => {
63
- commits += 1;
93
+ onReactCommit();
64
94
  if (original !== undefined) {
65
95
  try {
66
96
  original(...args);
@@ -1 +1 @@
1
- {"version":3,"file":"render-meter.js","sourceRoot":"","sources":["../src/render-meter.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;GAiBG;AACH,OAAO,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AAEnD,MAAM,QAAQ,GAAG,gCAAgC,CAAC;AAClD,MAAM,YAAY,GAAG,mBAAmB,CAAC;AAYzC,IAAI,OAAO,GAAG,CAAC,CAAC;AAChB,IAAI,SAAS,GAAG,KAAK,CAAC;AAEtB,SAAS,IAAI;IACX,yEAAyE;AAC3E,CAAC;AAQD,MAAM,UAAU,cAAc;IAC5B,OAAO,EAAE,OAAO,EAAE,CAAC;AACrB,CAAC;AAED,8FAA8F;AAC9F,MAAM,UAAU,gBAAgB;IAC9B,OAAO,GAAG,CAAC,CAAC;AACd,CAAC;AAED;;;GAGG;AACH,MAAM,UAAU,kBAAkB;IAChC,IAAI,SAAS;QAAE,OAAO;IACtB,SAAS,GAAG,IAAI,CAAC;IACjB,IAAI,CAAC;QACH,MAAM,IAAI,GAAG,UAAiE,CAAC;QAC/E,MAAM,QAAQ,GAAG,IAAI,CAAC,QAAQ,CAAC,CAAC;QAChC,IAAI,QAAQ,KAAK,SAAS,EAAE,CAAC;YAC3B,IAAI,CAAC,QAAQ,CAAC,GAAG;gBACf,aAAa,EAAE,IAAI;gBACnB,SAAS,EAAE,IAAI,GAAG,EAAE;gBACpB,MAAM,EAAE,GAAG,EAAE,CAAC,CAAC;gBACf,mBAAmB,EAAE,IAAI;gBACzB,iBAAiB,EAAE,GAAG,EAAE;oBACtB,OAAO,IAAI,CAAC,CAAC;gBACf,CAAC;gBACD,qBAAqB,EAAE,IAAI;gBAC3B,oBAAoB,EAAE,IAAI;aAC3B,CAAC;QACJ,CAAC;aAAM,CAAC;YACN,MAAM,QAAQ,GACZ,OAAO,QAAQ,CAAC,iBAAiB,KAAK,UAAU;gBAC9C,CAAC,CAAC,Q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IAAI;gBACzB,iBAAiB,EAAE,aAAa;gBAChC,qBAAqB,EAAE,IAAI;gBAC3B,oBAAoB,EAAE,IAAI;aAC3B,CAAC;QACJ,CAAC;aAAM,CAAC;YACN,MAAM,QAAQ,GACZ,OAAO,QAAQ,CAAC,iBAAiB,KAAK,UAAU;gBAC9C,CAAC,CAAC,QAAQ,CAAC,iBAAiB,CAAC,IAAI,CAAC,QAAQ,CAAC;gBAC3C,CAAC,CAAC,SAAS,CAAC;YAChB,QAAQ,CAAC,iBAAiB,GAAG,CAAC,GAAG,IAAe,EAAE,EAAE;gBAClD,aAAa,EAAE,CAAC;gBAChB,IAAI,QAAQ,KAAK,SAAS,EAAE,CAAC;oBAC3B,IAAI,CAAC;wBACH,QAAQ,CAAC,GAAG,IAAI,CAAC,CAAC;oBACpB,CAAC;oBAAC,MAAM,CAAC;wBACP,2DAA2D;oBAC7D,CAAC;gBACH,CAAC;YACH,CAAC,CAAC;QACJ,CAAC;QACD,aAAa,CAAC,YAAY,EAAE,GAAG,EAAE,CAAC,cAAc,EAAE,CAAC,CAAC;IACtD,CAAC;IAAC,MAAM,CAAC;QACP,8BAA8B;IAChC,CAAC;AACH,CAAC"}
@@ -0,0 +1,24 @@
1
+ /**
2
+ * Register React state that has no readable store object — Context, `useState`, `useReducer`.
3
+ *
4
+ * Every other state library can be adapted because it owns a store instance you can call `getState`
5
+ * on from anywhere. React's built-in state owns nothing of the kind: the value lives inside the fiber
6
+ * tree, and the only "subscription" is a re-render. There is no public API to read it from outside a
7
+ * component, so no adapter over React's surface can exist — the direction has to be inverted. The
8
+ * component that holds the value pushes it out on every render where it changed.
9
+ *
10
+ * That inversion is why this is a hook and lives in `@reticlehq/react/store` rather than beside the
11
+ * other adapters: it is the one case that requires running inside React. This subpath is also the only
12
+ * module in the package that imports `react` at all — the main entry stays import-free so the adapter
13
+ * keeps working in builds where React is not resolvable.
14
+ *
15
+ * ```tsx
16
+ * function CartProvider({ children }) {
17
+ * const [cart, dispatch] = useReducer(cartReducer, initial);
18
+ * useReticleStore('cart', cart); // one line; agent can now read + assert on cart
19
+ * return <CartContext.Provider value={cart}>{children}</CartContext.Provider>;
20
+ * }
21
+ * ```
22
+ */
23
+ export declare function useReticleStore(name: string, value: unknown): void;
24
+ //# sourceMappingURL=store.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"store.d.ts","sourceRoot":"","sources":["../src/store.ts"],"names":[],"mappings":"AAGA;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH,wBAAgB,eAAe,CAAC,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,OAAO,GAAG,IAAI,CAmBlE"}
package/dist/store.js ADDED
@@ -0,0 +1,44 @@
1
+ import { useEffect, useRef } from 'react';
2
+ import { pushStore, registerStore, unregisterStore } from '@reticlehq/browser';
3
+ /**
4
+ * Register React state that has no readable store object — Context, `useState`, `useReducer`.
5
+ *
6
+ * Every other state library can be adapted because it owns a store instance you can call `getState`
7
+ * on from anywhere. React's built-in state owns nothing of the kind: the value lives inside the fiber
8
+ * tree, and the only "subscription" is a re-render. There is no public API to read it from outside a
9
+ * component, so no adapter over React's surface can exist — the direction has to be inverted. The
10
+ * component that holds the value pushes it out on every render where it changed.
11
+ *
12
+ * That inversion is why this is a hook and lives in `@reticlehq/react/store` rather than beside the
13
+ * other adapters: it is the one case that requires running inside React. This subpath is also the only
14
+ * module in the package that imports `react` at all — the main entry stays import-free so the adapter
15
+ * keeps working in builds where React is not resolvable.
16
+ *
17
+ * ```tsx
18
+ * function CartProvider({ children }) {
19
+ * const [cart, dispatch] = useReducer(cartReducer, initial);
20
+ * useReticleStore('cart', cart); // one line; agent can now read + assert on cart
21
+ * return <CartContext.Provider value={cart}>{children}</CartContext.Provider>;
22
+ * }
23
+ * ```
24
+ */
25
+ export function useReticleStore(name, value) {
26
+ // Created once and kept in a ref: a store rebuilt each render would hand every listener a dead
27
+ // closure, so STATE_CHANGE would fire against a store nothing is subscribed to any more.
28
+ const handle = useRef(null);
29
+ handle.current ??= pushStore(value);
30
+ useEffect(() => {
31
+ const current = handle.current;
32
+ if (current === null)
33
+ return;
34
+ registerStore(name, current.store);
35
+ return () => unregisterStore(name);
36
+ }, [name]);
37
+ // Push AFTER commit, not during render. Notifying subscribers mid-render would emit a state change
38
+ // for a value the DOM has not shown yet, and an agent comparing store against screen at that moment
39
+ // would see a desync that does not exist — a false positive manufactured by the instrumentation.
40
+ useEffect(() => {
41
+ handle.current?.push(value);
42
+ }, [value]);
43
+ }
44
+ //# sourceMappingURL=store.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"store.js","sourceRoot":"","sources":["../src/store.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,EAAE,MAAM,OAAO,CAAC;AAC1C,OAAO,EAAE,SAAS,EAAE,aAAa,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAC;AAE/E;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH,MAAM,UAAU,eAAe,CAAC,IAAY,EAAE,KAAc;IAC1D,+FAA+F;IAC/F,yFAAyF;IACzF,MAAM,MAAM,GAAG,MAAM,CAAsC,IAAI,CAAC,CAAC;IACjE,MAAM,CAAC,OAAO,KAAK,SAAS,CAAC,KAAK,CAAC,CAAC;IAEpC,SAAS,CAAC,GAAG,EAAE;QACb,MAAM,OAAO,GAAG,MAAM,CAAC,OAAO,CAAC;QAC/B,IAAI,OAAO,KAAK,IAAI;YAAE,OAAO;QAC7B,aAAa,CAAC,IAAI,EAAE,OAAO,CAAC,KAAK,CAAC,CAAC;QACnC,OAAO,GAAG,EAAE,CAAC,eAAe,CAAC,IAAI,CAAC,CAAC;IACrC,CAAC,EAAE,CAAC,IAAI,CAAC,CAAC,CAAC;IAEX,mGAAmG;IACnG,oGAAoG;IACpG,iGAAiG;IACjG,SAAS,CAAC,GAAG,EAAE;QACb,MAAM,CAAC,OAAO,EAAE,IAAI,CAAC,KAAK,CAAC,CAAC;IAC9B,CAAC,EAAE,CAAC,KAAK,CAAC,CAAC,CAAC;AACd,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@reticlehq/react",
3
- "version": "2.1.0",
3
+ "version": "2.2.0",
4
4
  "description": "Reticle React adapter — maps a DOM ref to its component stack and source file via the fiber tree.",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",
@@ -9,11 +9,15 @@
9
9
  ".": {
10
10
  "types": "./dist/index.d.ts",
11
11
  "default": "./dist/index.js"
12
+ },
13
+ "./store": {
14
+ "types": "./dist/store.d.ts",
15
+ "default": "./dist/store.js"
12
16
  }
13
17
  },
14
18
  "dependencies": {
15
- "@reticlehq/core": "2.1.0",
16
- "@reticlehq/browser": "2.1.0"
19
+ "@reticlehq/browser": "2.2.0",
20
+ "@reticlehq/core": "2.2.0"
17
21
  },
18
22
  "peerDependencies": {
19
23
  "react": ">=18"
@@ -25,7 +29,10 @@
25
29
  },
26
30
  "devDependencies": {
27
31
  "@types/react": "^19.0.0",
28
- "jsdom": "^26.0.0"
32
+ "jsdom": "^26.0.0",
33
+ "react": "^19.0.0",
34
+ "react-dom": "^19.0.0",
35
+ "@types/react-dom": "^19.0.0"
29
36
  },
30
37
  "license": "Apache-2.0",
31
38
  "author": "Reticle contributors",
@@ -38,7 +45,8 @@
38
45
  "bugs": "https://github.com/reticlehq/reticle/issues",
39
46
  "files": [
40
47
  "dist",
41
- "README.md"
48
+ "README.md",
49
+ "NOTICE"
42
50
  ],
43
51
  "sideEffects": false,
44
52
  "keywords": [
@@ -50,6 +58,9 @@
50
58
  "publishConfig": {
51
59
  "access": "public"
52
60
  },
61
+ "engines": {
62
+ "node": ">=20.0.0"
63
+ },
53
64
  "scripts": {
54
65
  "build": "tsc -b",
55
66
  "typecheck": "tsc -b",