@axiom-lattice/react-sdk 10.8.0 → 10.9.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.
Files changed (62) hide show
  1. package/dist/{AgentDetailSideApp-MC2QAFUQ.mjs → AgentDetailSideApp-KIJALOS5.mjs} +7 -7
  2. package/dist/{AgentGovernanceWorkbench-PR2CUMHR.mjs → AgentGovernanceWorkbench-MQX3BH35.mjs} +8 -8
  3. package/dist/{AgentWebAppProvider-CIabimVC.d.mts → AgentWebAppProvider-x5lVhkhO.d.mts} +6 -0
  4. package/dist/{AgentWebAppProvider-CIabimVC.d.ts → AgentWebAppProvider-x5lVhkhO.d.ts} +6 -0
  5. package/dist/{MessageGraph-IUDE2EDC.mjs → MessageGraph-6EQTQAAR.mjs} +2 -2
  6. package/dist/{ReactChart-TPOQ6BXW.mjs → ReactChart-DZICSFTV.mjs} +2 -2
  7. package/dist/{TasksSideApp-QDLOQLZS.mjs → TasksSideApp-CLHMMR4L.mjs} +3 -3
  8. package/dist/{TopologyRuntimeView-JKGKNV7C.mjs → TopologyRuntimeView-BLBB5PQP.mjs} +3 -3
  9. package/dist/{WorkflowAutomationView-5AJ2QGM2.mjs → WorkflowAutomationView-IPW72SR6.mjs} +5 -5
  10. package/dist/agent-chat-loader.js +1 -1
  11. package/dist/{chunk-IIB5BEMF.mjs → chunk-2BFZHC3S.mjs} +2 -2
  12. package/dist/{chunk-BFKG2OIX.mjs → chunk-3S4RAOOF.mjs} +4 -4
  13. package/dist/{chunk-WCBQEED7.mjs → chunk-6XN2KL76.mjs} +2 -2
  14. package/dist/{chunk-DTZPCOY2.mjs → chunk-FVJMVJR2.mjs} +4 -2
  15. package/dist/chunk-FVJMVJR2.mjs.map +1 -0
  16. package/dist/{chunk-4AQVKTZZ.mjs → chunk-J7NG35IU.mjs} +2 -2
  17. package/dist/{chunk-25QAUXI3.mjs → chunk-OTQDEU5U.mjs} +10 -9
  18. package/dist/chunk-OTQDEU5U.mjs.map +1 -0
  19. package/dist/{chunk-YGZX4CDC.mjs → chunk-QJTPXXPS.mjs} +4 -4
  20. package/dist/{chunk-PPMYPBGP.mjs → chunk-YGNARZGO.mjs} +10 -10
  21. package/dist/{embed-page-AgentDetailSideApp-L2GPADRT.js → embed-page-AgentDetailSideApp-OXIDUA5Q.js} +1 -1
  22. package/dist/{embed-page-AgentGovernanceWorkbench-YXVJ5FJK.js → embed-page-AgentGovernanceWorkbench-AMQYURAT.js} +1 -1
  23. package/dist/{embed-page-MessageGraph-IFPNLCXQ.js → embed-page-MessageGraph-3DHT34VK.js} +1 -1
  24. package/dist/{embed-page-ReactChart-LBU6Y2BP.js → embed-page-ReactChart-V7HF2DHF.js} +1 -1
  25. package/dist/{embed-page-TasksSideApp-GRQXWFJ2.js → embed-page-TasksSideApp-KTQESBCT.js} +1 -1
  26. package/dist/{embed-page-TopologyRuntimeView-MAQLZ4DX.js → embed-page-TopologyRuntimeView-MIDX2DWN.js} +1 -1
  27. package/dist/{embed-page-WorkflowAutomationView-VZPD4WA3.js → embed-page-WorkflowAutomationView-4IR6R7HJ.js} +1 -1
  28. package/dist/{embed-page-chunk-R4YUWCMY.js → embed-page-chunk-3KAR3CFT.js} +1 -1
  29. package/dist/{embed-page-chunk-2XQNSJVY.js → embed-page-chunk-6X6A2D25.js} +5 -5
  30. package/dist/{embed-page-chunk-7PUQYEF4.js → embed-page-chunk-CEOKXM64.js} +1 -1
  31. package/dist/{embed-page-chunk-BMLFBT5Q.js → embed-page-chunk-TA3SPNRO.js} +1 -1
  32. package/dist/{embed-page-chunk-OXQV7DZF.js → embed-page-chunk-W6NJJTMF.js} +1 -1
  33. package/dist/embed-page-chunk-YVQDSZ77.js +8 -0
  34. package/dist/embed-page.js +3 -3
  35. package/dist/index.d.mts +7 -1
  36. package/dist/index.d.ts +7 -1
  37. package/dist/index.js +7 -4
  38. package/dist/index.js.map +1 -1
  39. package/dist/index.mjs +8 -8
  40. package/dist/web-app.d.mts +2 -2
  41. package/dist/web-app.d.ts +2 -2
  42. package/dist/web-app.js +7 -4
  43. package/dist/web-app.js.map +1 -1
  44. package/dist/web-app.mjs +5 -4
  45. package/dist/web-app.mjs.map +1 -1
  46. package/package.json +1 -1
  47. package/dist/chunk-25QAUXI3.mjs.map +0 -1
  48. package/dist/chunk-DTZPCOY2.mjs.map +0 -1
  49. package/dist/embed-page-chunk-PNDVX33M.js +0 -8
  50. /package/dist/{AgentDetailSideApp-MC2QAFUQ.mjs.map → AgentDetailSideApp-KIJALOS5.mjs.map} +0 -0
  51. /package/dist/{AgentGovernanceWorkbench-PR2CUMHR.mjs.map → AgentGovernanceWorkbench-MQX3BH35.mjs.map} +0 -0
  52. /package/dist/{MessageGraph-IUDE2EDC.mjs.map → MessageGraph-6EQTQAAR.mjs.map} +0 -0
  53. /package/dist/{ReactChart-TPOQ6BXW.mjs.map → ReactChart-DZICSFTV.mjs.map} +0 -0
  54. /package/dist/{TasksSideApp-QDLOQLZS.mjs.map → TasksSideApp-CLHMMR4L.mjs.map} +0 -0
  55. /package/dist/{TopologyRuntimeView-JKGKNV7C.mjs.map → TopologyRuntimeView-BLBB5PQP.mjs.map} +0 -0
  56. /package/dist/{WorkflowAutomationView-5AJ2QGM2.mjs.map → WorkflowAutomationView-IPW72SR6.mjs.map} +0 -0
  57. /package/dist/{chunk-IIB5BEMF.mjs.map → chunk-2BFZHC3S.mjs.map} +0 -0
  58. /package/dist/{chunk-BFKG2OIX.mjs.map → chunk-3S4RAOOF.mjs.map} +0 -0
  59. /package/dist/{chunk-WCBQEED7.mjs.map → chunk-6XN2KL76.mjs.map} +0 -0
  60. /package/dist/{chunk-4AQVKTZZ.mjs.map → chunk-J7NG35IU.mjs.map} +0 -0
  61. /package/dist/{chunk-YGZX4CDC.mjs.map → chunk-QJTPXXPS.mjs.map} +0 -0
  62. /package/dist/{chunk-PPMYPBGP.mjs.map → chunk-YGNARZGO.mjs.map} +0 -0
@@ -1,6 +1,6 @@
1
- import{b as h}from"./embed-page-chunk-PNDVX33M.js";import"./embed-page-chunk-2XQNSJVY.js";import"./embed-page-chunk-YVSU7QNV.js";import"./embed-page-chunk-J5PATYOM.js";import"./embed-page-chunk-FYIVKZA2.js";import"./embed-page-chunk-DRFSCATD.js";import"./embed-page-chunk-SEDNN2BM.js";import"./embed-page-chunk-BNA3NXXX.js";import"./embed-page-chunk-ECVOVKFZ.js";import{a as E}from"./embed-page-chunk-L2PNY33P.js";import"./embed-page-chunk-DLSQ2OWQ.js";import"./embed-page-chunk-F52TPGBP.js";import"./embed-page-chunk-WMHFEZXB.js";import{a as g}from"./embed-page-chunk-QWLZN3EX.js";import"./embed-page-chunk-MPQBYKDM.js";import"./embed-page-chunk-3KBY77YU.js";import"./embed-page-chunk-U2CG7PH5.js";import{b as f}from"./embed-page-chunk-6IIMW7OG.js";import{c as z,e as l}from"./embed-page-chunk-45A47GH2.js";var x=z(m=>{"use strict";var y=g();m.createRoot=y.createRoot,m.hydrateRoot=y.hydrateRoot;var te});var I=l(x()),T=l(g());var w="axiom-web-app-embed";var _=["axiom:hello","axiom:identity","axiom:send","axiom:config"];function R(e,t){return{source:w,version:1,type:e,payload:t}}var B=6,H=40,Q=500;function q(e){if(typeof e!="object"||e===null||Array.isArray(e))return!1;let t=e,n=Object.keys(t);return n.length!==2||!n.includes("label")||!n.includes("text")?!1:typeof t.label=="string"&&t.label.length>=1&&t.label.length<=H&&typeof t.text=="string"&&t.text.length>=1&&t.text.length<=Q}function G(e){if(!Array.isArray(e))return[];let t=[];for(let n of e){if(t.length>=B)break;q(n)&&t.push({label:n.label,text:n.text})}return t}function A(e){if(typeof e!="object"||e===null)return null;let t=e,n={};if(typeof t.welcome=="string"&&t.welcome.length>0&&(n.welcome=t.welcome),Array.isArray(t.quicks)){let a=G(t.quicks);(a.length>0||t.quicks.length===0)&&(n.quicks=a)}return n.welcome===void 0&&n.quicks===void 0?null:n}function C(e,t){if(typeof e!="object"||e===null)return null;let n=e;return n.source!==w||n.version!==1||typeof n.type!="string"||!t.includes(n.type)?null:{type:n.type,payload:n.payload}}var r=l(E()),M=/^[A-Za-z0-9._:@-]{1,128}$/,v="axiom-embed-root",k="axiom-embed-style",P=32768,j=`
2
- html, body, #${v} { height: 100%; margin: 0; overflow: hidden; }
1
+ import{b as y}from"./embed-page-chunk-YVQDSZ77.js";import"./embed-page-chunk-6X6A2D25.js";import"./embed-page-chunk-YVSU7QNV.js";import"./embed-page-chunk-J5PATYOM.js";import"./embed-page-chunk-FYIVKZA2.js";import"./embed-page-chunk-DRFSCATD.js";import"./embed-page-chunk-SEDNN2BM.js";import"./embed-page-chunk-BNA3NXXX.js";import"./embed-page-chunk-ECVOVKFZ.js";import{a as E}from"./embed-page-chunk-L2PNY33P.js";import"./embed-page-chunk-DLSQ2OWQ.js";import"./embed-page-chunk-F52TPGBP.js";import"./embed-page-chunk-WMHFEZXB.js";import{a as g}from"./embed-page-chunk-QWLZN3EX.js";import"./embed-page-chunk-MPQBYKDM.js";import"./embed-page-chunk-3KBY77YU.js";import"./embed-page-chunk-U2CG7PH5.js";import{b as f}from"./embed-page-chunk-6IIMW7OG.js";import{c as B,e as d}from"./embed-page-chunk-45A47GH2.js";var x=B(u=>{"use strict";var h=g();u.createRoot=h.createRoot,u.hydrateRoot=h.hydrateRoot;var ne});var S=d(x()),T=d(g());var w="axiom-web-app-embed";var _=["axiom:hello","axiom:identity","axiom:send","axiom:config"];function R(t,e){return{source:w,version:1,type:t,payload:e}}var z=["omit","same-origin","include"],H=6,Q=40,q=500;function G(t){if(typeof t!="object"||t===null||Array.isArray(t))return!1;let e=t,n=Object.keys(e);return n.length!==2||!n.includes("label")||!n.includes("text")?!1:typeof e.label=="string"&&e.label.length>=1&&e.label.length<=Q&&typeof e.text=="string"&&e.text.length>=1&&e.text.length<=q}function j(t){if(!Array.isArray(t))return[];let e=[];for(let n of t){if(e.length>=H)break;G(n)&&e.push({label:n.label,text:n.text})}return e}function A(t){if(typeof t!="object"||t===null)return null;let e=t,n={};if(typeof e.welcome=="string"&&e.welcome.length>0&&(n.welcome=e.welcome),Array.isArray(e.quicks)){let a=j(e.quicks);(a.length>0||e.quicks.length===0)&&(n.quicks=a)}return typeof e.credentials=="string"&&z.includes(e.credentials)&&(n.credentials=e.credentials),n.welcome===void 0&&n.quicks===void 0&&n.credentials===void 0?null:n}function C(t,e){if(typeof t!="object"||t===null)return null;let n=t;return n.source!==w||n.version!==1||typeof n.type!="string"||!e.includes(n.type)?null:{type:n.type,payload:n.payload}}var r=d(E()),k=/^[A-Za-z0-9._:@-]{1,128}$/,P="axiom-embed-root",M="axiom-embed-style",I=32768,Y=`
2
+ html, body, #${P} { height: 100%; margin: 0; overflow: hidden; }
3
3
  .axiom-embed-fill { height: 100% !important; min-height: 0 !important; }
4
4
  .axiom-embed-card { display: flex; align-items: center; justify-content: center; height: 100%; margin: 0; font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif; font-size: 14px; color: #64748b; padding: 24px; box-sizing: border-box; text-align: center; }
5
5
  .axiom-embed-loading { color: #64748b; }
6
- `,o={baseUrl:"",webAppId:null,hostOrigin:null,root:null,booted:!1,userId:null,hostConfig:null,sendApi:null,pendingSends:[]},u=null;function Y(){let e=/^(.*?)\/api\/web-apps\/([^/]+)\/chat$/.exec(window.location.pathname);if(!e)return{baseUrl:window.location.origin,webAppId:null};let t;try{t=decodeURIComponent(e[2])}catch{return{baseUrl:window.location.origin,webAppId:null}}return M.test(t)?{baseUrl:`${window.location.origin}${e[1]}`,webAppId:t}:{baseUrl:window.location.origin,webAppId:null}}function $(){return new URLSearchParams(window.location.search).get("mode")==="embed"}function p(){return document.getElementById(v)??document.getElementById("root")}function S(e){return o.root===null&&(o.root=(0,I.createRoot)(e)),o.root}function s(e,t){if(window.parent===window)return;let n=o.hostOrigin;n!==null&&window.parent.postMessage(R(e,t),n)}var c=f.messages;function d(e,t){let n=p();n!==null&&(0,T.flushSync)(()=>{S(n).render((0,r.jsx)("div",{className:"axiom-embed-card","data-axiom-embed-state":e,role:e==="error"?"alert":"status",children:t}))})}function V(){if(document.getElementById(k)!==null)return;let e=document.createElement("style");e.id=k,e.textContent=j,document.head.appendChild(e)}function F(e){if(typeof e!="object"||e===null)return null;let t=e.userId;return typeof t=="string"&&M.test(t)?t:null}function W(e){let t=typeof e=="object"&&e!==null?e.text:void 0;if(typeof t!="string"){s("axiom:error",{code:"INVALID_REQUEST",message:"axiom:send payload must be { text: string }"});return}let n=t.trim();if(!n){s("axiom:error",{code:"INVALID_REQUEST",message:"axiom:send text must not be empty"});return}if(n.length>P){s("axiom:error",{code:"INVALID_REQUEST",message:`axiom:send text exceeds the ${P} character limit`});return}let a=o.sendApi;if(a===null){o.pendingSends.push(n);return}a.sendMessage(n)}function X(e){o.sendApi=e;let t=o.pendingSends.splice(0);setTimeout(()=>{for(let n of t)o.sendApi?.sendMessage(n)},0)}function O(){let e=o.webAppId,t=o.userId;if(e===null||t===null)return;let n=p();if(n===null)return;let a=$();a&&V();let D=i=>{s("axiom:error",{code:i.code,message:i.message}),i.retryable||d("error",`${i.code}: ${i.message}`)},L=i=>{X(i)},N=i=>{s("axiom:message",i)},b=o.hostConfig;S(n).render((0,r.jsx)(h,{className:a?"axiom-embed-fill":void 0,gatewayUrl:o.baseUrl,webAppId:e,identity:{mode:"unverified",userId:t},welcome:b?.welcome,quickPrompts:b?.quicks,onError:D,onChatReady:L,onChatMessage:N}))}function K(e){if(!o.booted){if(o.webAppId===null){s("axiom:error",{code:"WEB_APP_NOT_FOUND",message:"The embed page URL does not contain a valid web app id"}),d("error",(0,r.jsxs)(r.Fragment,{children:["WEB_APP_NOT_FOUND: ",c["integration.embed.webAppNotFound"]]}));return}p()!==null&&(o.booted=!0,o.userId=e,O())}}function Z(e){let t=A(e);t!==null&&(o.hostConfig=t,o.booted&&O())}function J(e){let t=F(e);if(t===null){s("axiom:error",{code:"USER_ID_REQUIRED",message:"A valid embed user identity is required"}),d("error",(0,r.jsxs)(r.Fragment,{children:["USER_ID_REQUIRED: ",c["integration.embed.userIdRequired"]]}));return}K(t)}function ee(e){if(e.source!==window.parent||typeof e.origin!="string"||e.origin.length===0)return;let t=C(e.data,_);t&&(o.hostOrigin=e.origin,t.type==="axiom:hello"?s("axiom:ready",{features:[]}):t.type==="axiom:identity"?J(t.payload):t.type==="axiom:config"?Z(t.payload):t.type==="axiom:send"&&W(t.payload))}function U(){u!==null&&window.removeEventListener("message",u);let e=Y();o.baseUrl=e.baseUrl,o.webAppId=e.webAppId,o.hostOrigin=null,o.root=null,o.booted=!1,o.userId=null,o.hostConfig=null,o.sendApi=null,o.pendingSends=[];let t=n=>{ee(n)};u=t,window.addEventListener("message",t),d("guidance",c["integration.embed.guidance"])}U();
6
+ `,o={baseUrl:"",webAppId:null,hostOrigin:null,root:null,booted:!1,userId:null,hostConfig:null,sendApi:null,pendingSends:[]},p=null;function $(){let t=/^(.*?)\/api\/web-apps\/([^/]+)\/chat$/.exec(window.location.pathname);if(!t)return{baseUrl:window.location.origin,webAppId:null};let e;try{e=decodeURIComponent(t[2])}catch{return{baseUrl:window.location.origin,webAppId:null}}return k.test(e)?{baseUrl:`${window.location.origin}${t[1]}`,webAppId:e}:{baseUrl:window.location.origin,webAppId:null}}function V(){return new URLSearchParams(window.location.search).get("mode")==="embed"}function c(){return document.getElementById(P)??document.getElementById("root")}function v(t){return o.root===null&&(o.root=(0,S.createRoot)(t)),o.root}function s(t,e){if(window.parent===window)return;let n=o.hostOrigin;n!==null&&window.parent.postMessage(R(t,e),n)}var b=f.messages;function l(t,e){let n=c();n!==null&&(0,T.flushSync)(()=>{v(n).render((0,r.jsx)("div",{className:"axiom-embed-card","data-axiom-embed-state":t,role:t==="error"?"alert":"status",children:e}))})}function F(){if(document.getElementById(M)!==null)return;let t=document.createElement("style");t.id=M,t.textContent=Y,document.head.appendChild(t)}function W(t){if(typeof t!="object"||t===null)return null;let e=t.userId;return typeof e=="string"&&k.test(e)?e:null}function X(t){let e=typeof t=="object"&&t!==null?t.text:void 0;if(typeof e!="string"){s("axiom:error",{code:"INVALID_REQUEST",message:"axiom:send payload must be { text: string }"});return}let n=e.trim();if(!n){s("axiom:error",{code:"INVALID_REQUEST",message:"axiom:send text must not be empty"});return}if(n.length>I){s("axiom:error",{code:"INVALID_REQUEST",message:`axiom:send text exceeds the ${I} character limit`});return}let a=o.sendApi;if(a===null){o.pendingSends.push(n);return}a.sendMessage(n)}function K(t){o.sendApi=t;let e=o.pendingSends.splice(0);setTimeout(()=>{for(let n of e)o.sendApi?.sendMessage(n)},0)}function O(){let t=o.webAppId,e=o.userId;if(t===null||e===null)return;let n=c();if(n===null)return;let a=V();a&&F();let U=i=>{s("axiom:error",{code:i.code,message:i.message}),i.retryable||l("error",`${i.code}: ${i.message}`)},L=i=>{K(i)},N=i=>{s("axiom:message",i)},m=o.hostConfig;v(n).render((0,r.jsx)(y,{className:a?"axiom-embed-fill":void 0,gatewayUrl:o.baseUrl,webAppId:t,identity:{mode:"unverified",userId:e},welcome:m?.welcome,quickPrompts:m?.quicks,credentials:m?.credentials,onError:U,onChatReady:L,onChatMessage:N}))}function Z(t){if(!o.booted){if(o.webAppId===null){s("axiom:error",{code:"WEB_APP_NOT_FOUND",message:"The embed page URL does not contain a valid web app id"}),l("error",(0,r.jsxs)(r.Fragment,{children:["WEB_APP_NOT_FOUND: ",b["integration.embed.webAppNotFound"]]}));return}c()!==null&&(o.booted=!0,o.userId=t,O())}}function J(t){let e=A(t);e!==null&&(o.hostConfig=e,o.booted&&O())}function ee(t){let e=W(t);if(e===null){s("axiom:error",{code:"USER_ID_REQUIRED",message:"A valid embed user identity is required"}),l("error",(0,r.jsxs)(r.Fragment,{children:["USER_ID_REQUIRED: ",b["integration.embed.userIdRequired"]]}));return}Z(e)}function te(t){if(t.source!==window.parent||typeof t.origin!="string"||t.origin.length===0)return;let e=C(t.data,_);e&&(o.hostOrigin=t.origin,e.type==="axiom:hello"?s("axiom:ready",{features:[]}):e.type==="axiom:identity"?ee(e.payload):e.type==="axiom:config"?J(e.payload):e.type==="axiom:send"&&X(e.payload))}function D(){p!==null&&window.removeEventListener("message",p);let t=$();o.baseUrl=t.baseUrl,o.webAppId=t.webAppId,o.hostOrigin=null,o.root=null,o.booted=!1,o.userId=null,o.hostConfig=null,o.sendApi=null,o.pendingSends=[];let e=n=>{te(n)};p=e,window.addEventListener("message",e),l("guidance",b["integration.embed.guidance"])}D();
package/dist/index.d.mts CHANGED
@@ -14,7 +14,7 @@ import { MessageInstance } from 'antd/es/message/interface';
14
14
  import { Prompts } from '@ant-design/x';
15
15
  import { GetProp, ThemeConfig } from 'antd';
16
16
  export { ThemeConfig } from 'antd';
17
- import { A as AgentWebAppIdentity, a as AgentWebAppRuntimeClientError } from './AgentWebAppProvider-CIabimVC.mjs';
17
+ import { A as AgentWebAppIdentity, a as AgentWebAppRuntimeClientError } from './AgentWebAppProvider-x5lVhkhO.mjs';
18
18
  import { NodeProps, Node } from '@xyflow/react';
19
19
 
20
20
  type ChunkHandler = (chunk: MessageChunk) => void;
@@ -8288,6 +8288,12 @@ interface AgentChatAppProps {
8288
8288
  onChatMessage?: EmbedChatMessageHandler;
8289
8289
  /** Test seam for the HTTP layer (bootstrap + runtime console mirror). */
8290
8290
  fetch?: typeof globalThis.fetch;
8291
+ /**
8292
+ * Fetch credentials mode for bootstrap/runtime requests. Defaults to
8293
+ * `"omit"` (no cookies). Set `"same-origin"` when a same-origin
8294
+ * proxy/session cookie must accompany runtime calls.
8295
+ */
8296
+ credentials?: RequestCredentials;
8291
8297
  /** Class name applied to the root chat shell. */
8292
8298
  className?: string;
8293
8299
  /** Host-supplied chat welcome text; overrides the publication appearance. */
package/dist/index.d.ts CHANGED
@@ -14,7 +14,7 @@ import { MessageInstance } from 'antd/es/message/interface';
14
14
  import { Prompts } from '@ant-design/x';
15
15
  import { GetProp, ThemeConfig } from 'antd';
16
16
  export { ThemeConfig } from 'antd';
17
- import { A as AgentWebAppIdentity, a as AgentWebAppRuntimeClientError } from './AgentWebAppProvider-CIabimVC.js';
17
+ import { A as AgentWebAppIdentity, a as AgentWebAppRuntimeClientError } from './AgentWebAppProvider-x5lVhkhO.js';
18
18
  import { NodeProps, Node } from '@xyflow/react';
19
19
 
20
20
  type ChunkHandler = (chunk: MessageChunk) => void;
@@ -8288,6 +8288,12 @@ interface AgentChatAppProps {
8288
8288
  onChatMessage?: EmbedChatMessageHandler;
8289
8289
  /** Test seam for the HTTP layer (bootstrap + runtime console mirror). */
8290
8290
  fetch?: typeof globalThis.fetch;
8291
+ /**
8292
+ * Fetch credentials mode for bootstrap/runtime requests. Defaults to
8293
+ * `"omit"` (no cookies). Set `"same-origin"` when a same-origin
8294
+ * proxy/session cookie must accompany runtime calls.
8295
+ */
8296
+ credentials?: RequestCredentials;
8291
8297
  /** Class name applied to the root chat shell. */
8292
8298
  className?: string;
8293
8299
  /** Host-supplied chat welcome text; overrides the publication appearance. */
package/dist/index.js CHANGED
@@ -151339,11 +151339,13 @@ var init_client = __esm({
151339
151339
  this.options = options;
151340
151340
  this.baseUrl = `${options.gatewayUrl.replace(/\/+$/, "")}/api/web-apps/${encodeURIComponent(options.webAppId)}/runtime`;
151341
151341
  this.fetchImplementation = _nullishCoalesce(options.fetch, () => ( globalThis.fetch.bind(globalThis)));
151342
+ this.credentials = _nullishCoalesce(options.credentials, () => ( "omit"));
151342
151343
  this.translate = options.translate;
151343
151344
  }
151344
151345
 
151345
151346
 
151346
151347
 
151348
+
151347
151349
  async bootstrap(selection2 = {}, signal) {
151348
151350
  return this.request("bootstrap", parseBootstrap, { query: selection2, signal });
151349
151351
  }
@@ -151551,7 +151553,7 @@ var init_client = __esm({
151551
151553
  headers.set("Content-Type", "application/json");
151552
151554
  body = JSON.stringify(options.body);
151553
151555
  }
151554
- return this.fetchImplementation(url, { method: _nullishCoalesce(options.method, () => ( "GET")), headers, body, signal: options.signal, credentials: "omit" });
151556
+ return this.fetchImplementation(url, { method: _nullishCoalesce(options.method, () => ( "GET")), headers, body, signal: options.signal, credentials: this.credentials });
151555
151557
  }
151556
151558
  async throwResponseError(response) {
151557
151559
  let value;
@@ -151787,7 +151789,7 @@ function identityScopeKey(identity9) {
151787
151789
  }
151788
151790
  function AgentChatApp(props) {
151789
151791
  validateProps(props);
151790
- const scopeKey = `${props.gatewayUrl}\0${props.webAppId}\0${identityScopeKey(props.identity)}`;
151792
+ const scopeKey = `${props.gatewayUrl}\0${props.webAppId}\0${identityScopeKey(props.identity)}\0${_nullishCoalesce(props.credentials, () => ( "omit"))}`;
151791
151793
  const storageKey = _nullishCoalesce(props.storageKey, () => ( DEFAULT_LOCALE_STORAGE_KEY));
151792
151794
  const initialLocale = _react.useMemo.call(void 0,
151793
151795
  () => _nullishCoalesce(_nullishCoalesce(props.locale, () => ( readStoredLocale(storageKey))), () => ( "en-US")),
@@ -151809,7 +151811,7 @@ function AgentChatApp(props) {
151809
151811
  )
151810
151812
  );
151811
151813
  }
151812
- function ScopedAgentChatApp({ gatewayUrl, webAppId, identity: identity9, onError, onChatReady, onChatMessage, fetch: fetchImplementation, className, welcome, quickPrompts, locale: locale3 = "en-US" }) {
151814
+ function ScopedAgentChatApp({ gatewayUrl, webAppId, identity: identity9, onError, onChatReady, onChatMessage, fetch: fetchImplementation, credentials, className, welcome, quickPrompts, locale: locale3 = "en-US" }) {
151813
151815
  const t4 = useT();
151814
151816
  const [state2, setState] = _react.useState.call(void 0, { status: "loading" });
151815
151817
  const identityRef = _react.useRef.call(void 0, identity9);
@@ -151833,7 +151835,8 @@ function ScopedAgentChatApp({ gatewayUrl, webAppId, identity: identity9, onError
151833
151835
  }
151834
151836
  },
151835
151837
  translate: t4,
151836
- ...fetchImplementation ? { fetch: fetchImplementation } : {}
151838
+ ...fetchImplementation ? { fetch: fetchImplementation } : {},
151839
+ ...credentials ? { credentials } : {}
151837
151840
  });
151838
151841
  }
151839
151842
  _react.useEffect.call(void 0, () => installRuntimeUploadAuth({ gatewayUrl, webAppId, identity: identity9 }), [gatewayUrl, webAppId, identity9]);