@opencx/widget-react-headless 5.4.1 → 5.4.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/dist/index.cjs +1 -1
- package/dist/index.js +1 -1
- package/dist/package.json.d.ts +1 -1
- package/package.json +4 -4
package/dist/index.cjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const c=require("react"),$=require("@opencx/widget-core"),o=require("zod/v4"),P=require("zod/v3");require("react/jsx-runtime");const N=require("zod");function da(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=da(o),pa="5.4.
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const c=require("react"),$=require("@opencx/widget-core"),o=require("zod/v4"),P=require("zod/v3");require("react/jsx-runtime");const N=require("zod");function da(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=da(o),pa="5.4.2";function V(t){return c.useSyncExternalStore(t.subscribe,t.get,t.get)}function fa({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?ma(s):null}function ma(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",ga=Symbol.for(hr),qt,Wt,de=class vr extends(Wt=Error,qt=ga,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}`,ha=Symbol.for(Cr),Kt,Vt,va=class extends(Vt=de,Kt=ha,Vt){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}`,ya=Symbol.for(Er),Bt,Jt,Ht=class extends(Jt=de,Bt=ya,Jt){constructor({text:t,cause:e}){super({name:Sr,message:`JSON parsing failed: Text: ${t}.
|
|
2
2
|
Error message: ${yr(e)}`,cause:e}),this[Bt]=!0,this.text=t}static isInstance(t){return de.hasMarker(t,Er)}},wr="AI_TypeValidationError",Ir=`vercel.ai.error.${wr}`,ba=Symbol.for(Ir),Yt,Gt,Ne=class St extends(Gt=de,Yt=ba,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,Ir)}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,Ca=13,we=32;function ht(t){}function Sa(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="",d=0,S,y=!1;function O(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),z();return}if(h.indexOf(`
|
|
4
4
|
`)===-1&&h.indexOf("\r")===-1){l.push(h),n+=h.length,z();return}l.push(h);const g=l.join("");l.length=0,n=0;const b=w(g);b!==""&&(l.push(b),n=b.length),z()}function z(){i!==void 0&&(n+f.length<=i||(y=!0,l.length=0,n=0,u=void 0,f="",d=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
package/dist/package.json.d.ts
CHANGED
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@opencx/widget-react-headless",
|
|
3
3
|
"private": false,
|
|
4
|
-
"version": "5.4.
|
|
4
|
+
"version": "5.4.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.4.
|
|
23
|
+
"@opencx/widget-core": "5.4.2"
|
|
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/
|
|
41
|
-
"@opencx/
|
|
40
|
+
"@opencx/eslint-config": "0.0.1",
|
|
41
|
+
"@opencx/tsconfig": "0.0.2"
|
|
42
42
|
},
|
|
43
43
|
"scripts": {
|
|
44
44
|
"clean": "rm -rf node_modules dist .turbo",
|