@opencx/widget-react-headless 5.1.0 → 5.3.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/dist/index.cjs CHANGED
@@ -1,4 +1,4 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const c=require("react"),W=require("@opencx/widget-core"),o=require("zod/v4"),P=require("zod/v3");require("react/jsx-runtime");const O=require("zod");function ua(t){const e=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(t){for(const r in t)if(r!=="default"){const a=Object.getOwnPropertyDescriptor(t,r);Object.defineProperty(e,r,a.get?a:{enumerable:!0,get:()=>t[r]})}}return e.default=t,Object.freeze(e)}const Zt=ua(o),ca="5.1.0";function J(t){return c.useSyncExternalStore(t.subscribe,t.get,t.get)}function da({turnSources:t,liveItems:e,isStreaming:r,lastMessageIsFromUser:a}){var i;if(r||a)return null;const s=e.length>0?e:(i=t.at(-1))==null?void 0:i.items;return s?pa(s):null}function pa(t){for(let e=t.length-1;e>=0;e--){const r=t[e];if((r==null?void 0:r.kind)==="questions")return r.request}return null}var hr="vercel.ai.error",fa=Symbol.for(hr),qt,Wt,de=class vr extends(Wt=Error,qt=fa,Wt){constructor({name:e,message:r,cause:a}){super(r),this[qt]=!0,this.name=e,this.cause=a}static isInstance(e){return vr.hasMarker(e,hr)}static hasMarker(e,r){const a=Symbol.for(r);return e!=null&&typeof e=="object"&&a in e&&typeof e[a]=="boolean"&&e[a]===!0}};function yr(t){return t==null?"unknown error":typeof t=="string"?t:t instanceof Error?t.toString():JSON.stringify(t)}var br="AI_InvalidArgumentError",Cr=`vercel.ai.error.${br}`,ma=Symbol.for(Cr),Kt,Bt,ga=class extends(Bt=de,Kt=ma,Bt){constructor({message:t,cause:e,argument:r}){super({name:br,message:t,cause:e}),this[Kt]=!0,this.argument=r}static isInstance(t){return de.hasMarker(t,Cr)}},Sr="AI_JSONParseError",Er=`vercel.ai.error.${Sr}`,ha=Symbol.for(Er),Vt,Jt,Ht=class extends(Jt=de,Vt=ha,Jt){constructor({text:t,cause:e}){super({name:Sr,message:`JSON parsing failed: Text: ${t}.
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const c=require("react"),W=require("@opencx/widget-core"),o=require("zod/v4"),P=require("zod/v3");require("react/jsx-runtime");const O=require("zod");function ua(t){const e=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(t){for(const r in t)if(r!=="default"){const a=Object.getOwnPropertyDescriptor(t,r);Object.defineProperty(e,r,a.get?a:{enumerable:!0,get:()=>t[r]})}}return e.default=t,Object.freeze(e)}const Zt=ua(o),ca="5.3.0";function J(t){return c.useSyncExternalStore(t.subscribe,t.get,t.get)}function da({turnSources:t,liveItems:e,isStreaming:r,lastMessageIsFromUser:a}){var i;if(r||a)return null;const s=e.length>0?e:(i=t.at(-1))==null?void 0:i.items;return s?pa(s):null}function pa(t){for(let e=t.length-1;e>=0;e--){const r=t[e];if((r==null?void 0:r.kind)==="questions")return r.request}return null}var hr="vercel.ai.error",fa=Symbol.for(hr),qt,Wt,de=class vr extends(Wt=Error,qt=fa,Wt){constructor({name:e,message:r,cause:a}){super(r),this[qt]=!0,this.name=e,this.cause=a}static isInstance(e){return vr.hasMarker(e,hr)}static hasMarker(e,r){const a=Symbol.for(r);return e!=null&&typeof e=="object"&&a in e&&typeof e[a]=="boolean"&&e[a]===!0}};function yr(t){return t==null?"unknown error":typeof t=="string"?t:t instanceof Error?t.toString():JSON.stringify(t)}var br="AI_InvalidArgumentError",Cr=`vercel.ai.error.${br}`,ma=Symbol.for(Cr),Kt,Bt,ga=class extends(Bt=de,Kt=ma,Bt){constructor({message:t,cause:e,argument:r}){super({name:br,message:t,cause:e}),this[Kt]=!0,this.argument=r}static isInstance(t){return de.hasMarker(t,Cr)}},Sr="AI_JSONParseError",Er=`vercel.ai.error.${Sr}`,ha=Symbol.for(Er),Vt,Jt,Ht=class extends(Jt=de,Vt=ha,Jt){constructor({text:t,cause:e}){super({name:Sr,message:`JSON parsing failed: Text: ${t}.
2
2
  Error message: ${yr(e)}`,cause:e}),this[Vt]=!0,this.text=t}static isInstance(t){return de.hasMarker(t,Er)}},wr="AI_TypeValidationError",zr=`vercel.ai.error.${wr}`,va=Symbol.for(zr),Yt,Gt,Ne=class St extends(Gt=de,Yt=va,Gt){constructor({value:e,cause:r,context:a}){let s="Type validation failed";if(a!=null&&a.field&&(s+=` for ${a.field}`),a!=null&&a.entityName||a!=null&&a.entityId){s+=" (";const i=[];a.entityName&&i.push(a.entityName),a.entityId&&i.push(`id: "${a.entityId}"`),s+=i.join(", "),s+=")"}super({name:wr,message:`${s}: Value: ${JSON.stringify(e)}.
3
3
  Error message: ${yr(r)}`,cause:r}),this[Yt]=!0,this.value=e,this.context=a}static isInstance(e){return de.hasMarker(e,zr)}static wrap({value:e,cause:r,context:a}){var s,i,l;return St.isInstance(r)&&r.value===e&&((s=r.context)==null?void 0:s.field)===(a==null?void 0:a.field)&&((i=r.context)==null?void 0:i.entityName)===(a==null?void 0:a.entityName)&&((l=r.context)==null?void 0:l.entityId)===(a==null?void 0:a.entityId)?r:new St({value:e,cause:r,context:a})}};class gt extends Error{constructor(e,r){super(e),this.name="ParseError",this.type=r.type,this.field=r.field,this.value=r.value,this.line=r.line}}const Qt=10,ya=13,we=32;function ht(t){}function ba(t){if(typeof t=="function")throw new TypeError("`config` must be an object, got a function instead. Did you mean `createParser({onEvent: fn})`?");const{onEvent:e=ht,onError:r=ht,onRetry:a=ht,onComment:s,maxBufferSize:i}=t,l=[];let n=0,m=!0,u,f="",p=0,S,y=!1;function R(h){if(y)throw new Error("Cannot feed parser: it was terminated after exceeding the configured max buffer size. Call `reset()` to resume parsing.");if(m&&(m=!1,h.charCodeAt(0)===239&&h.charCodeAt(1)===187&&h.charCodeAt(2)===191&&(h=h.slice(3))),l.length===0){const v=w(h);v!==""&&(l.push(v),n=v.length),T();return}if(h.indexOf(`
4
4
  `)===-1&&h.indexOf("\r")===-1){l.push(h),n+=h.length,T();return}l.push(h);const g=l.join("");l.length=0,n=0;const b=w(g);b!==""&&(l.push(b),n=b.length),T()}function T(){i!==void 0&&(n+f.length<=i||(y=!0,l.length=0,n=0,u=void 0,f="",p=0,S=void 0,r(new gt(`Buffered data exceeded max buffer size of ${i} characters`,{type:"max-buffer-size-exceeded"}))))}function w(h){let g=0;if(h.indexOf("\r")===-1){let b=h.indexOf(`
package/dist/index.js CHANGED
@@ -5,7 +5,7 @@ import { z as o } from "zod/v4";
5
5
  import { ZodFirstPartyTypeKind as P } from "zod/v3";
6
6
  import "react/jsx-runtime";
7
7
  import { z as N } from "zod";
8
- const Ra = "5.1.0";
8
+ const Ra = "5.3.0";
9
9
  function G(t) {
10
10
  return Ke(t.subscribe, t.get, t.get);
11
11
  }
@@ -1,7 +1,7 @@
1
1
  declare const _default: {
2
2
  "name": "@opencx/widget-react-headless",
3
3
  "private": false,
4
- "version": "5.1.0",
4
+ "version": "5.3.0",
5
5
  "type": "module",
6
6
  "repository": {
7
7
  "type": "git",
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@opencx/widget-react-headless",
3
3
  "private": false,
4
- "version": "5.1.0",
4
+ "version": "5.3.0",
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.1.0"
23
+ "@opencx/widget-core": "5.3.0"
24
24
  },
25
25
  "peerDependencies": {
26
26
  "@types/react": ">=18 <20",
@@ -37,8 +37,8 @@
37
37
  "react": "^19.2.8",
38
38
  "react-dom": "^19.2.8",
39
39
  "react-test-renderer": "^19.2.8",
40
- "@opencx/eslint-config": "0.0.1",
41
- "@opencx/tsconfig": "0.0.2"
40
+ "@opencx/tsconfig": "0.0.2",
41
+ "@opencx/eslint-config": "0.0.1"
42
42
  },
43
43
  "scripts": {
44
44
  "clean": "rm -rf node_modules dist .turbo",