@opencx/widget-react-headless 5.0.0-beta.3 → 5.0.0-beta.5

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.
@@ -1,7 +1,7 @@
1
1
  declare const _default: {
2
2
  "name": "@opencx/widget-react-headless",
3
3
  "private": false,
4
- "version": "5.0.0-beta.3",
4
+ "version": "5.0.0-beta.5",
5
5
  "type": "module",
6
6
  "repository": {
7
7
  "type": "git",
@@ -10,11 +10,12 @@ declare const _default: {
10
10
  "scripts": {
11
11
  "clean": "rm -rf node_modules dist .turbo",
12
12
  "clean:dist": "rm -rf dist .turbo",
13
- "build": "vite build",
13
+ "build": "NODE_ENV=production vite build && node ../../scripts/check-production-build.mjs dist",
14
14
  "test": "vitest run",
15
15
  "type-check": "tsc --noEmit",
16
16
  "lint": "eslint .",
17
- "format": "prettier --write ."
17
+ "format": "prettier --write .",
18
+ "prepack": "node ../../scripts/check-production-build.mjs dist"
18
19
  },
19
20
  "files": [
20
21
  "dist"
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=use-agent-chat.follow-up.spec.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"use-agent-chat.follow-up.spec.d.ts","sourceRoot":"","sources":["../../../../src/agent-chat/__tests__/use-agent-chat.follow-up.spec.tsx"],"names":[],"mappings":""}
@@ -12,16 +12,9 @@ export type AgentChatPageEffect = {
12
12
  *
13
13
  * - **Streaming** is driven by `status` ('submitted' | 'streaming' | 'ready').
14
14
  * - **Resume** is native (`resume: true` reconnects to a live turn on mount).
15
- * - **Steering**: a message sent while a turn is STREAMING enters the
16
- * transcript at once and is POSTed at once; the backend steers it into the
17
- * live turn (`data-turn-steered`), whose single reply — still rendering on
18
- * this engine's stream, untouched — answers both messages. When the live
19
- * turn cannot take it (already over), the backend opens a new turn for it
20
- * on that request's stream, which is replayed here via resume.
21
- * - **Multi-send queues** cover the gaps steering cannot: a turn that has
22
- * not started streaming yet, a stop awaiting its ACK, and the post-turn
23
- * reconcile window. A queued message is held in a queue pill above the
24
- * composer and enters the transcript when its own turn starts.
15
+ * - **Multi-send queues** hold follow-ups until the active reply has settled
16
+ * and its persisted rows have been reconciled. Each queued message enters
17
+ * the transcript when its own turn starts.
25
18
  * - **Stop cancels the RESPONSE, not the conversation**: it aborts the client
26
19
  * stream and POSTs `/stop` so the server cancels generation, then the next
27
20
  * queued message (if any) is sent to the API immediately. The queue is
@@ -1 +1 @@
1
- {"version":3,"file":"useAgentChat.d.ts","sourceRoot":"","sources":["../../../src/agent-chat/useAgentChat.ts"],"names":[],"mappings":"AACA,OAAO,EAOL,KAAK,YAAY,EACjB,KAAK,SAAS,EACd,KAAK,cAAc,EACpB,MAAM,qBAAqB,CAAC;AAU7B,OAAO,EAAqB,KAAK,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AAEhF,OAAO,EAGL,KAAK,gBAAgB,EACtB,MAAM,sBAAsB,CAAC;AAS9B,gFAAgF;AAChF,MAAM,MAAM,mBAAmB,GAAG;IAChC,GAAG,EAAE,MAAM,CAAC;IACZ,IAAI,EAAE,mBAAmB,CAAC;IAC1B,KAAK,EAAE,OAAO,CAAC;CAChB,CAAC;AAqBF;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AACH,wBAAgB,YAAY,CAAC,EAC3B,SAAS,EACT,MAAM,EACN,SAAS,EACT,iBAAiB,GAClB,EAAE;IACD,SAAS,EAAE,SAAS,CAAC;IACrB,MAAM,EAAE,YAAY,CAAC;IACrB,SAAS,EAAE,MAAM,GAAG,IAAI,CAAC;IACzB,iBAAiB,EAAE,cAAc,EAAE,CAAC;CACrC;;;IAq1BG,+DAA+D;;IAE/D,wEAAwE;;IAExE,yEAAyE;;;;8BAlS9B,MAAM;;;EA0SpD"}
1
+ {"version":3,"file":"useAgentChat.d.ts","sourceRoot":"","sources":["../../../src/agent-chat/useAgentChat.ts"],"names":[],"mappings":"AACA,OAAO,EAOL,KAAK,YAAY,EACjB,KAAK,SAAS,EACd,KAAK,cAAc,EACpB,MAAM,qBAAqB,CAAC;AAU7B,OAAO,EAAqB,KAAK,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AAEhF,OAAO,EAGL,KAAK,gBAAgB,EACtB,MAAM,sBAAsB,CAAC;AAQ9B,gFAAgF;AAChF,MAAM,MAAM,mBAAmB,GAAG;IAChC,GAAG,EAAE,MAAM,CAAC;IACZ,IAAI,EAAE,mBAAmB,CAAC;IAC1B,KAAK,EAAE,OAAO,CAAC;CAChB,CAAC;AAqBF;;;;;;;;;;;;;;;;GAgBG;AACH,wBAAgB,YAAY,CAAC,EAC3B,SAAS,EACT,MAAM,EACN,SAAS,EACT,iBAAiB,GAClB,EAAE;IACD,SAAS,EAAE,SAAS,CAAC;IACrB,MAAM,EAAE,YAAY,CAAC;IACrB,SAAS,EAAE,MAAM,GAAG,IAAI,CAAC;IACzB,iBAAiB,EAAE,cAAc,EAAE,CAAC;CACrC;;;IAiwBG,+DAA+D;;IAE/D,wEAAwE;;IAExE,yEAAyE;;;;8BAtT9B,MAAM;;;EA8TpD"}
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@opencx/widget-react-headless",
3
3
  "private": false,
4
- "version": "5.0.0-beta.3",
4
+ "version": "5.0.0-beta.5",
5
5
  "type": "module",
6
6
  "repository": {
7
7
  "type": "git",
@@ -20,7 +20,7 @@
20
20
  "dependencies": {
21
21
  "uuid": "^11.0.4",
22
22
  "zod": "^4.3.6",
23
- "@opencx/widget-core": "5.0.0-beta.3"
23
+ "@opencx/widget-core": "5.0.0-beta.5"
24
24
  },
25
25
  "peerDependencies": {
26
26
  "@types/react": ">=18 <20",
@@ -41,7 +41,7 @@
41
41
  "scripts": {
42
42
  "clean": "rm -rf node_modules dist .turbo",
43
43
  "clean:dist": "rm -rf dist .turbo",
44
- "build": "vite build",
44
+ "build": "NODE_ENV=production vite build && node ../../scripts/check-production-build.mjs dist",
45
45
  "test": "vitest run",
46
46
  "type-check": "tsc --noEmit",
47
47
  "lint": "eslint .",
@@ -1,2 +0,0 @@
1
- export {};
2
- //# sourceMappingURL=use-agent-chat.steer.spec.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"use-agent-chat.steer.spec.d.ts","sourceRoot":"","sources":["../../../../src/agent-chat/__tests__/use-agent-chat.steer.spec.tsx"],"names":[],"mappings":""}
@@ -1,35 +0,0 @@
1
- import { UIMessageChunk } from 'ai';
2
- /**
3
- * What the v5 stream endpoint did with a message POSTed while the session
4
- * already had a live turn. Decided by the FIRST chunk of the request's own
5
- * stream:
6
- * - `steered`: the message joined the live turn (`data-turn-steered` is the
7
- * only chunk); the live turn's stream — already rendering — answers it.
8
- * - `turn`: the live turn did not take it, so the backend superseded that
9
- * turn and opened a new one for this message on THIS stream. The caller
10
- * drops this copy and replays the new turn through the engine's own
11
- * stream (the session's resume pointer moved to it).
12
- * - `failed`: the turn errored before producing anything.
13
- * - `silent`: the stream ended with no chunk at all — the reply was withheld
14
- * (assist draft, handoff); the transcript rows say what happened.
15
- */
16
- export type SteerOutcome = {
17
- kind: 'steered';
18
- } | {
19
- kind: 'turn';
20
- } | {
21
- kind: 'failed';
22
- errorText: string;
23
- } | {
24
- kind: 'silent';
25
- };
26
- /**
27
- * Classify a steer attempt from its stream's first DECISIVE chunk, then
28
- * release the stream. The backend heartbeats (`data-keepalive`) while the
29
- * request waits to be steered or for a fallback turn's first chunk — those
30
- * decide nothing and are skipped. Releasing never cancels the server turn
31
- * (resumable streams treat a client drop as a disconnect), so the `turn`
32
- * case can be replayed.
33
- */
34
- export declare function readSteerOutcome(stream: ReadableStream<UIMessageChunk>): Promise<SteerOutcome>;
35
- //# sourceMappingURL=steer-into-live-turn.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"steer-into-live-turn.d.ts","sourceRoot":"","sources":["../../../src/agent-chat/steer-into-live-turn.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,IAAI,CAAC;AAEzC;;;;;;;;;;;;;GAaG;AACH,MAAM,MAAM,YAAY,GACpB;IAAE,IAAI,EAAE,SAAS,CAAA;CAAE,GACnB;IAAE,IAAI,EAAE,MAAM,CAAA;CAAE,GAChB;IAAE,IAAI,EAAE,QAAQ,CAAC;IAAC,SAAS,EAAE,MAAM,CAAA;CAAE,GACrC;IAAE,IAAI,EAAE,QAAQ,CAAA;CAAE,CAAC;AAEvB;;;;;;;GAOG;AACH,wBAAsB,gBAAgB,CACpC,MAAM,EAAE,cAAc,CAAC,cAAc,CAAC,GACrC,OAAO,CAAC,YAAY,CAAC,CAgBvB"}