@opencx/widget-react-headless 5.7.0 → 5.7.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.
@@ -1,7 +1,7 @@
1
1
  declare const _default: {
2
2
  "name": "@opencx/widget-react-headless",
3
3
  "private": false,
4
- "version": "5.7.0",
4
+ "version": "5.7.2",
5
5
  "type": "module",
6
6
  "repository": {
7
7
  "type": "git",
@@ -38,6 +38,14 @@ declare const _default: {
38
38
  "react": ">=18 <20",
39
39
  "react-dom": ">=18 <20"
40
40
  },
41
+ "peerDependenciesMeta": {
42
+ "react-dom": {
43
+ "optional": true
44
+ },
45
+ "@types/react-dom": {
46
+ "optional": true
47
+ }
48
+ },
41
49
  "devDependencies": {
42
50
  "@ai-sdk/react": "4.0.154",
43
51
  "@opencx/eslint-config": "workspace:*",
@@ -48,7 +56,8 @@ declare const _default: {
48
56
  "ai": "^7.0.150",
49
57
  "react": "^19.2.8",
50
58
  "react-dom": "^19.2.8",
51
- "react-test-renderer": "^19.2.8"
59
+ "react-test-renderer": "^19.2.8",
60
+ "whatwg-fetch": "3.6.20"
52
61
  }
53
62
  }
54
63
  ;
@@ -15,6 +15,15 @@ export type AgentChatTransportOptions = {
15
15
  headers: () => Record<string, string>;
16
16
  /** Sends and resumes the stream; the global fetch when omitted. */
17
17
  fetch?: typeof fetch;
18
+ /**
19
+ * Reads the reply when `fetch` returns a response with no readable body,
20
+ * such as a React Native `streamingFetch` that rebuilt the response with
21
+ * the global `Response`. Resolved per failure; undefined means no
22
+ * recovery.
23
+ */
24
+ recoveryFetch?: () => typeof fetch | undefined;
25
+ /** A reply `fetch` could not read (`error`) was read through `recoveryFetch`. */
26
+ onRecovered?: (phase: 'send' | 'resume', error: Error) => void;
18
27
  };
19
28
  /**
20
29
  * The reconnect URL carrying the embed's presentation choices. Built as a
@@ -1 +1 @@
1
- {"version":3,"file":"agent-chat-transport.d.ts","sourceRoot":"","sources":["../../../src/agent-chat/agent-chat-transport.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAC;AACxD,OAAO,EAAE,oBAAoB,EAAE,KAAK,SAAS,EAAE,MAAM,IAAI,CAAC;AAE1D,0FAA0F;AAC1F,MAAM,MAAM,yBAAyB,GAAG;IACtC,uDAAuD;IACvD,GAAG,EAAE,MAAM,CAAC;IACZ,2EAA2E;IAC3E,YAAY,EAAE,CAAC,SAAS,EAAE,MAAM,KAAK,MAAM,CAAC;IAC5C;;;;;OAKG;IACH,OAAO,EAAE,MAAM,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IACtC,mEAAmE;IACnE,KAAK,CAAC,EAAE,OAAO,KAAK,CAAC;CACtB,CAAC;AAEF;;;;GAIG;AACH,wBAAgB,wBAAwB,CACtC,GAAG,EAAE,MAAM,EACX,YAAY,EAAE,YAAY,CAAC,cAAc,CAAC,GACzC,MAAM,CAUR;AAED,gFAAgF;AAChF,wBAAgB,0BAA0B,CAAC,OAAO,EAAE,yBAAyB,IACnE,QAAQ;IAAE,EAAE,EAAE,MAAM,CAAA;CAAE;;;EAI/B;AAED;;;;GAIG;AACH,wBAAgB,uBAAuB,CACrC,OAAO,EAAE,yBAAyB,GACjC,oBAAoB,CAAC,SAAS,CAAC,CAUjC"}
1
+ {"version":3,"file":"agent-chat-transport.d.ts","sourceRoot":"","sources":["../../../src/agent-chat/agent-chat-transport.ts"],"names":[],"mappings":"AAAA,OAAO,EAAO,KAAK,YAAY,EAAE,MAAM,qBAAqB,CAAC;AAC7D,OAAO,EACL,oBAAoB,EAEpB,KAAK,SAAS,EACf,MAAM,IAAI,CAAC;AAEZ,0FAA0F;AAC1F,MAAM,MAAM,yBAAyB,GAAG;IACtC,uDAAuD;IACvD,GAAG,EAAE,MAAM,CAAC;IACZ,2EAA2E;IAC3E,YAAY,EAAE,CAAC,SAAS,EAAE,MAAM,KAAK,MAAM,CAAC;IAC5C;;;;;OAKG;IACH,OAAO,EAAE,MAAM,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IACtC,mEAAmE;IACnE,KAAK,CAAC,EAAE,OAAO,KAAK,CAAC;IACrB;;;;;OAKG;IACH,aAAa,CAAC,EAAE,MAAM,OAAO,KAAK,GAAG,SAAS,CAAC;IAC/C,iFAAiF;IACjF,WAAW,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,GAAG,QAAQ,EAAE,KAAK,EAAE,KAAK,KAAK,IAAI,CAAC;CAChE,CAAC;AAEF;;;;GAIG;AACH,wBAAgB,wBAAwB,CACtC,GAAG,EAAE,MAAM,EACX,YAAY,EAAE,YAAY,CAAC,cAAc,CAAC,GACzC,MAAM,CAUR;AAED,gFAAgF;AAChF,wBAAgB,0BAA0B,CAAC,OAAO,EAAE,yBAAyB,IACnE,QAAQ;IAAE,EAAE,EAAE,MAAM,CAAA;CAAE;;;EAI/B;AA4HD;;;;GAIG;AACH,wBAAgB,uBAAuB,CACrC,OAAO,EAAE,yBAAyB,GACjC,oBAAoB,CAAC,SAAS,CAAC,CAEjC"}
@@ -0,0 +1,7 @@
1
+ import { ClientStreamErrorReport } from '@opencx/widget-core';
2
+ /**
3
+ * What may be said about a failed stream: the error's class and a fixed
4
+ * category, never its message (that can carry the host app's own data).
5
+ */
6
+ export declare function describeStreamError(error: Error): Pick<ClientStreamErrorReport, 'kind' | 'error_name' | 'http_status'>;
7
+ //# sourceMappingURL=describe-stream-error.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"describe-stream-error.d.ts","sourceRoot":"","sources":["../../../src/agent-chat/describe-stream-error.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,qBAAqB,CAAC;AAMnE;;;GAGG;AACH,wBAAgB,mBAAmB,CACjC,KAAK,EAAE,KAAK,GACX,IAAI,CAAC,uBAAuB,EAAE,MAAM,GAAG,YAAY,GAAG,aAAa,CAAC,CA0BtE"}
@@ -1 +1 @@
1
- {"version":3,"file":"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G,IAAI,CAAC;IACzB,iBAAiB,EAAE,cAAc,EAAE,CAAC;CACrC;;;IA8pCG,+DAA+D;;IAE/D,wEAAwE;;IAExE,yEAAyE;;;;;8BAvjB7D,MAAM;;;8BA4LR,MAAM,WAEV,MAAM,GACN,SAAS,GACT,MAAM,GACN,QAAQ,GACR,aAAa,GACb,WAAW,GACX,UAAU,WACL,MAAM,SACR;QACL,QAAQ,EAAE;YACR,GAAG,EAAE,MAAM,CAAC;YACZ,IAAI,EAAE,MAAM,CAAC;YACb,IAAI,EAAE,MAAM,CAAC;YACb,QAAQ,CAAC,EAAE,OAAO,CAAC;SACpB,EAAE,CAAC;QACJ,SAAS,EAAE,OAAO,CAAC;KACpB;;wCAgDO,iBAAiB;gCAiBkB,MAAM,WAAW,OAAO;;;EAuTxE"}
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@opencx/widget-react-headless",
3
3
  "private": false,
4
- "version": "5.7.0",
4
+ "version": "5.7.2",
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.7.0"
23
+ "@opencx/widget-core": "5.7.2"
24
24
  },
25
25
  "peerDependencies": {
26
26
  "@types/react": ">=18 <20",
@@ -28,6 +28,14 @@
28
28
  "react": ">=18 <20",
29
29
  "react-dom": ">=18 <20"
30
30
  },
31
+ "peerDependenciesMeta": {
32
+ "react-dom": {
33
+ "optional": true
34
+ },
35
+ "@types/react-dom": {
36
+ "optional": true
37
+ }
38
+ },
31
39
  "devDependencies": {
32
40
  "@ai-sdk/react": "4.0.154",
33
41
  "@types/react": "^19.2.18",
@@ -37,6 +45,7 @@
37
45
  "react": "^19.2.8",
38
46
  "react-dom": "^19.2.8",
39
47
  "react-test-renderer": "^19.2.8",
48
+ "whatwg-fetch": "3.6.20",
40
49
  "@opencx/eslint-config": "0.0.1",
41
50
  "@opencx/tsconfig": "0.0.2"
42
51
  },