@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.
- package/dist/{AgentDetailSideApp-MC2QAFUQ.mjs → AgentDetailSideApp-KIJALOS5.mjs} +7 -7
- package/dist/{AgentGovernanceWorkbench-PR2CUMHR.mjs → AgentGovernanceWorkbench-MQX3BH35.mjs} +8 -8
- package/dist/{AgentWebAppProvider-CIabimVC.d.mts → AgentWebAppProvider-x5lVhkhO.d.mts} +6 -0
- package/dist/{AgentWebAppProvider-CIabimVC.d.ts → AgentWebAppProvider-x5lVhkhO.d.ts} +6 -0
- package/dist/{MessageGraph-IUDE2EDC.mjs → MessageGraph-6EQTQAAR.mjs} +2 -2
- package/dist/{ReactChart-TPOQ6BXW.mjs → ReactChart-DZICSFTV.mjs} +2 -2
- package/dist/{TasksSideApp-QDLOQLZS.mjs → TasksSideApp-CLHMMR4L.mjs} +3 -3
- package/dist/{TopologyRuntimeView-JKGKNV7C.mjs → TopologyRuntimeView-BLBB5PQP.mjs} +3 -3
- package/dist/{WorkflowAutomationView-5AJ2QGM2.mjs → WorkflowAutomationView-IPW72SR6.mjs} +5 -5
- package/dist/agent-chat-loader.js +1 -1
- package/dist/{chunk-IIB5BEMF.mjs → chunk-2BFZHC3S.mjs} +2 -2
- package/dist/{chunk-BFKG2OIX.mjs → chunk-3S4RAOOF.mjs} +4 -4
- package/dist/{chunk-WCBQEED7.mjs → chunk-6XN2KL76.mjs} +2 -2
- package/dist/{chunk-DTZPCOY2.mjs → chunk-FVJMVJR2.mjs} +4 -2
- package/dist/chunk-FVJMVJR2.mjs.map +1 -0
- package/dist/{chunk-4AQVKTZZ.mjs → chunk-J7NG35IU.mjs} +2 -2
- package/dist/{chunk-25QAUXI3.mjs → chunk-OTQDEU5U.mjs} +10 -9
- package/dist/chunk-OTQDEU5U.mjs.map +1 -0
- package/dist/{chunk-YGZX4CDC.mjs → chunk-QJTPXXPS.mjs} +4 -4
- package/dist/{chunk-PPMYPBGP.mjs → chunk-YGNARZGO.mjs} +10 -10
- package/dist/{embed-page-AgentDetailSideApp-L2GPADRT.js → embed-page-AgentDetailSideApp-OXIDUA5Q.js} +1 -1
- package/dist/{embed-page-AgentGovernanceWorkbench-YXVJ5FJK.js → embed-page-AgentGovernanceWorkbench-AMQYURAT.js} +1 -1
- package/dist/{embed-page-MessageGraph-IFPNLCXQ.js → embed-page-MessageGraph-3DHT34VK.js} +1 -1
- package/dist/{embed-page-ReactChart-LBU6Y2BP.js → embed-page-ReactChart-V7HF2DHF.js} +1 -1
- package/dist/{embed-page-TasksSideApp-GRQXWFJ2.js → embed-page-TasksSideApp-KTQESBCT.js} +1 -1
- package/dist/{embed-page-TopologyRuntimeView-MAQLZ4DX.js → embed-page-TopologyRuntimeView-MIDX2DWN.js} +1 -1
- package/dist/{embed-page-WorkflowAutomationView-VZPD4WA3.js → embed-page-WorkflowAutomationView-4IR6R7HJ.js} +1 -1
- package/dist/{embed-page-chunk-R4YUWCMY.js → embed-page-chunk-3KAR3CFT.js} +1 -1
- package/dist/{embed-page-chunk-2XQNSJVY.js → embed-page-chunk-6X6A2D25.js} +5 -5
- package/dist/{embed-page-chunk-7PUQYEF4.js → embed-page-chunk-CEOKXM64.js} +1 -1
- package/dist/{embed-page-chunk-BMLFBT5Q.js → embed-page-chunk-TA3SPNRO.js} +1 -1
- package/dist/{embed-page-chunk-OXQV7DZF.js → embed-page-chunk-W6NJJTMF.js} +1 -1
- package/dist/embed-page-chunk-YVQDSZ77.js +8 -0
- package/dist/embed-page.js +3 -3
- package/dist/index.d.mts +7 -1
- package/dist/index.d.ts +7 -1
- package/dist/index.js +7 -4
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +8 -8
- package/dist/web-app.d.mts +2 -2
- package/dist/web-app.d.ts +2 -2
- package/dist/web-app.js +7 -4
- package/dist/web-app.js.map +1 -1
- package/dist/web-app.mjs +5 -4
- package/dist/web-app.mjs.map +1 -1
- package/package.json +1 -1
- package/dist/chunk-25QAUXI3.mjs.map +0 -1
- package/dist/chunk-DTZPCOY2.mjs.map +0 -1
- package/dist/embed-page-chunk-PNDVX33M.js +0 -8
- /package/dist/{AgentDetailSideApp-MC2QAFUQ.mjs.map → AgentDetailSideApp-KIJALOS5.mjs.map} +0 -0
- /package/dist/{AgentGovernanceWorkbench-PR2CUMHR.mjs.map → AgentGovernanceWorkbench-MQX3BH35.mjs.map} +0 -0
- /package/dist/{MessageGraph-IUDE2EDC.mjs.map → MessageGraph-6EQTQAAR.mjs.map} +0 -0
- /package/dist/{ReactChart-TPOQ6BXW.mjs.map → ReactChart-DZICSFTV.mjs.map} +0 -0
- /package/dist/{TasksSideApp-QDLOQLZS.mjs.map → TasksSideApp-CLHMMR4L.mjs.map} +0 -0
- /package/dist/{TopologyRuntimeView-JKGKNV7C.mjs.map → TopologyRuntimeView-BLBB5PQP.mjs.map} +0 -0
- /package/dist/{WorkflowAutomationView-5AJ2QGM2.mjs.map → WorkflowAutomationView-IPW72SR6.mjs.map} +0 -0
- /package/dist/{chunk-IIB5BEMF.mjs.map → chunk-2BFZHC3S.mjs.map} +0 -0
- /package/dist/{chunk-BFKG2OIX.mjs.map → chunk-3S4RAOOF.mjs.map} +0 -0
- /package/dist/{chunk-WCBQEED7.mjs.map → chunk-6XN2KL76.mjs.map} +0 -0
- /package/dist/{chunk-4AQVKTZZ.mjs.map → chunk-J7NG35IU.mjs.map} +0 -0
- /package/dist/{chunk-YGZX4CDC.mjs.map → chunk-QJTPXXPS.mjs.map} +0 -0
- /package/dist/{chunk-PPMYPBGP.mjs.map → chunk-YGNARZGO.mjs.map} +0 -0
package/dist/embed-page.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import{b as
|
|
2
|
-
html, body, #${
|
|
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:[]},
|
|
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-
|
|
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-
|
|
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:
|
|
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]);
|