@novoagents/react 0.2.0-alpha.0 → 0.2.0-alpha.2

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/CHANGELOG.md CHANGED
@@ -1,5 +1,23 @@
1
1
  # Changelog
2
2
 
3
+ ## Unreleased
4
+
5
+ ## 0.2.0-alpha.2 - 2026-07-15
6
+
7
+ - Updates the packed `novoagents` dependency to 0.4.0-alpha.2, so React run
8
+ hooks consume targeted `data-novo-model-step-restart` retractions through the
9
+ canonical browser controller.
10
+
11
+ ## 0.2.0-alpha.1 - 2026-07-14
12
+
13
+ - `useNovoRun` normalizes `enabled` and `runKey` before its dependency arrays,
14
+ so identity toggles (`enabled: undefined <-> true`, `runKey: undefined <->
15
+ null`) no longer dispose and recreate a live controller.
16
+ - Picks up `novoagents` 0.4.0-alpha.1 controller fixes: fatal (non-retried)
17
+ initial-connect errors, per-drop `transportError` publication, a final
18
+ `disposed` snapshot published before listeners detach, and interaction-race
19
+ hardening.
20
+
3
21
  ## 0.2.0-alpha.0 - 2026-07-14
4
22
 
5
23
  - Replaced the alpha store/transport hooks with effect-owned bindings over the
package/README.md CHANGED
@@ -5,6 +5,10 @@ Headless React bindings for the canonical browser run controller in
5
5
  accepts a Novo API key. Browser requests go only to your authenticated proxy
6
6
  routes.
7
7
 
8
+ ```sh
9
+ npm install novoagents@alpha @novoagents/react@alpha
10
+ ```
11
+
8
12
  ```tsx
9
13
  'use client';
10
14
 
@@ -60,5 +64,6 @@ There are no compatibility aliases for the alpha API.
60
64
 
61
65
  ## Publishing
62
66
 
63
- Publish with `pnpm publish`: pnpm rewrites the `workspace:*` dependency on
64
- `novoagents` to the packed version.
67
+ After publishing `novoagents`, publish with
68
+ `pnpm publish --access public --tag alpha`: pnpm rewrites the `workspace:*`
69
+ dependency on `novoagents` to the packed version.
@@ -54,34 +54,38 @@ export function useNovoRun(options) {
54
54
  slotRef.current ??= createControllerSlot();
55
55
  const slot = slotRef.current;
56
56
  const ownedRunKeyRef = useRef(UNOWNED_RUN_KEY);
57
+ // Normalize before any dependency array: `enabled: undefined <-> true` and
58
+ // `runKey: undefined <-> null` toggles are identity changes and must not
59
+ // dispose and recreate a live controller.
60
+ const enabled = options.enabled !== false;
61
+ const runKey = options.runKey ?? null;
57
62
  useEffect(() => {
58
- if (options.enabled === false) {
63
+ if (!enabled) {
59
64
  slot.setController(undefined);
60
65
  return;
61
66
  }
62
67
  const controller = factoryRef.current();
63
- ownedRunKeyRef.current = options.runKey ?? null;
68
+ ownedRunKeyRef.current = runKey;
64
69
  slot.setController(controller);
65
70
  return () => {
66
71
  controller.stop();
67
72
  controller.dispose();
68
- if (ownedRunKeyRef.current === (options.runKey ?? null)) {
73
+ if (ownedRunKeyRef.current === runKey) {
69
74
  ownedRunKeyRef.current = UNOWNED_RUN_KEY;
70
75
  }
71
76
  if (slot.getController() === controller)
72
77
  slot.setController(undefined);
73
78
  };
74
- }, [options.enabled, options.runKey, slot]);
79
+ }, [enabled, runKey, slot]);
75
80
  useEffect(() => {
76
- if (options.enabled !== false &&
81
+ if (enabled &&
77
82
  options.autoStart !== false &&
78
- ownedRunKeyRef.current === (options.runKey ?? null)) {
83
+ ownedRunKeyRef.current === runKey) {
79
84
  void slot.getController()?.start();
80
85
  }
81
- }, [options.autoStart, options.enabled, options.runKey, slot]);
86
+ }, [options.autoStart, enabled, runKey, slot]);
82
87
  const observedState = useSyncExternalStore(slot.subscribe, slot.getSnapshot, () => NOVO_IDLE_RUN_STATE);
83
- const ownsRenderedKey = options.enabled !== false &&
84
- ownedRunKeyRef.current === (options.runKey ?? null);
88
+ const ownsRenderedKey = enabled && ownedRunKeyRef.current === runKey;
85
89
  const state = ownsRenderedKey
86
90
  ? observedState
87
91
  : NOVO_IDLE_RUN_STATE;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@novoagents/react",
3
- "version": "0.2.0-alpha.0",
3
+ "version": "0.2.0-alpha.2",
4
4
  "description": "Browser-safe React hooks for Novo Agents streams and interactions.",
5
5
  "license": "UNLICENSED",
6
6
  "type": "module",
@@ -23,7 +23,7 @@
23
23
  "access": "public"
24
24
  },
25
25
  "dependencies": {
26
- "novoagents": "0.4.0-alpha.0"
26
+ "novoagents": "0.4.0-alpha.2"
27
27
  },
28
28
  "peerDependencies": {
29
29
  "react": "^18.0.0 || ^19.0.0"
@@ -41,7 +41,8 @@
41
41
  "scripts": {
42
42
  "build": "tsc -p tsconfig.json && node scripts/check-dist.mjs",
43
43
  "clean": "rm -rf dist",
44
- "test": "vitest run",
44
+ "test": "vitest run && pnpm run test:react18",
45
+ "test:react18": "node scripts/test-react18.mjs",
45
46
  "typecheck": "tsc -p tsconfig.json --noEmit"
46
47
  }
47
48
  }