@axiom-lattice/gateway 4.2.5 → 4.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.
Files changed (24) hide show
  1. package/dist/embed/agent-chat-loader.js +1 -1
  2. package/dist/embed/{embed-page-AgentDetailSideApp-YPN3NDEA.js → embed-page-AgentDetailSideApp-7FH2JSZI.js} +1 -1
  3. package/dist/embed/{embed-page-AgentGovernanceWorkbench-FAZQNPAM.js → embed-page-AgentGovernanceWorkbench-Y5F3ZPYC.js} +1 -1
  4. package/dist/embed/{embed-page-MessageGraph-CEOPX4GM.js → embed-page-MessageGraph-ONODQPG4.js} +1 -1
  5. package/dist/embed/{embed-page-ReactChart-NZAYQOQH.js → embed-page-ReactChart-GZQSKCUG.js} +1 -1
  6. package/dist/embed/{embed-page-TasksSideApp-3EAPMISU.js → embed-page-TasksSideApp-HYKCJ356.js} +1 -1
  7. package/dist/embed/{embed-page-TeamWorkspace-HB7ER45L.js → embed-page-TeamWorkspace-IOHS4RJV.js} +1 -1
  8. package/dist/embed/{embed-page-TopologyRuntimeView-O7JPR22B.js → embed-page-TopologyRuntimeView-QLMZ4OE7.js} +1 -1
  9. package/dist/embed/{embed-page-WorkflowAutomationView-OUXOBHXC.js → embed-page-WorkflowAutomationView-FJJSGY7Z.js} +1 -1
  10. package/dist/embed/{embed-page-chunk-TQPMRDLI.js → embed-page-chunk-6LL6YULZ.js} +1 -1
  11. package/dist/embed/{embed-page-chunk-6C2UZV63.js → embed-page-chunk-D3NRIME3.js} +1 -1
  12. package/dist/embed/embed-page-chunk-EMPMOO53.js +466 -0
  13. package/dist/embed/{embed-page-chunk-ILNGM4RN.js → embed-page-chunk-FXTSVMPN.js} +89 -38
  14. package/dist/embed/{embed-page-chunk-GCDGRO6A.js → embed-page-chunk-L7RMIQ7C.js} +9 -9
  15. package/dist/embed/{embed-page-chunk-4SKSUBXL.js → embed-page-chunk-MCUFFMAW.js} +110 -109
  16. package/dist/embed/{embed-page-chunk-U6JBLAYD.js → embed-page-chunk-SMQZEZYG.js} +1 -1
  17. package/dist/embed/{embed-page-chunk-RTVQJYET.js → embed-page-chunk-VVYB3C4O.js} +1 -1
  18. package/dist/embed/embed-page.js +3 -3
  19. package/dist/index.js +138 -144
  20. package/dist/index.js.map +1 -1
  21. package/dist/index.mjs +16 -22
  22. package/dist/index.mjs.map +1 -1
  23. package/package.json +7 -7
  24. package/dist/embed/embed-page-chunk-5XKUKLZQ.js +0 -467
@@ -1,4 +1,4 @@
1
- import{e as T}from"./embed-page-chunk-5XKUKLZQ.js";import{Ha as L,p as O,r as P}from"./embed-page-chunk-4SKSUBXL.js";import{a as $}from"./embed-page-chunk-MB65DZAX.js";import{Fa as N,La as C,Z as v,va as S}from"./embed-page-chunk-O4QK5LWZ.js";import{a as z}from"./embed-page-chunk-4BKXE5ON.js";import{e as b}from"./embed-page-chunk-6Y3UYJ6Z.js";var u=b(z());var k={pending:"#7A7A7A",in_progress:"#3b82f6",review:"#f59e0b",failed:"#ef4444",interrupted:"#8b5cf6",completed:"#22c55e",cancelled:"#9ca3af"},w={high:{label:"High",color:"#ef4444"},medium:{label:"Medium",color:"#f59e0b"},low:{label:"Low",color:"#22c55e"}},Y=240,V=72;function F(e,o){if(e.parentId&&e.parentId!==e.id&&o.has(e.parentId))return e.parentId;for(let g of e.dependencies??[])if(g!==e.id&&o.has(g))return g}function R(e,o){let c=o?.hideCompleted??!1?e.filter(t=>!T(t.status)):e,m=new Map(c.map(t=>[t.id,t])),a=new Map;for(let t of c)a.set(t.id,F(t,m));let h=new Set;for(let t of a.keys()){if(h.has(t))continue;let f=new Map,l=t,x=0;for(;l!==void 0&&!h.has(l)&&!f.has(l);)f.set(l,x),x+=1,l=a.get(l);if(l!==void 0&&f.has(l)){let i=f.get(l);for(let[s,p]of f)p>=i&&h.add(s)}}for(let t of h)a.set(t,void 0);let r=new Map;for(let t of c)r.set(t.id,[]);for(let t of c){let f=a.get(t.id);f!==void 0&&r.get(f).push(t.id)}let d=t=>({task:m.get(t),children:(r.get(t)??[]).map(d)});return c.filter(t=>a.get(t.id)===void 0).map(t=>d(t.id))}var n=b($()),{Text:B}=C,U=16,j=3,G=L(({css:e,token:o})=>({root:e`
1
+ import{a as T}from"./embed-page-chunk-EMPMOO53.js";import{Ma as L,u as O,w as P}from"./embed-page-chunk-MCUFFMAW.js";import{a as $}from"./embed-page-chunk-MB65DZAX.js";import{Fa as N,La as C,Z as v,va as S}from"./embed-page-chunk-O4QK5LWZ.js";import{a as z}from"./embed-page-chunk-4BKXE5ON.js";import{e as b}from"./embed-page-chunk-6Y3UYJ6Z.js";var u=b(z());var k={pending:"#7A7A7A",in_progress:"#3b82f6",review:"#f59e0b",failed:"#ef4444",interrupted:"#8b5cf6",completed:"#22c55e",cancelled:"#9ca3af"},w={high:{label:"High",color:"#ef4444"},medium:{label:"Medium",color:"#f59e0b"},low:{label:"Low",color:"#22c55e"}},Y=240,V=72;function F(e,o){if(e.parentId&&e.parentId!==e.id&&o.has(e.parentId))return e.parentId;for(let g of e.dependencies??[])if(g!==e.id&&o.has(g))return g}function R(e,o){let c=o?.hideCompleted??!1?e.filter(t=>!T(t.status)):e,m=new Map(c.map(t=>[t.id,t])),a=new Map;for(let t of c)a.set(t.id,F(t,m));let h=new Set;for(let t of a.keys()){if(h.has(t))continue;let f=new Map,l=t,x=0;for(;l!==void 0&&!h.has(l)&&!f.has(l);)f.set(l,x),x+=1,l=a.get(l);if(l!==void 0&&f.has(l)){let i=f.get(l);for(let[s,p]of f)p>=i&&h.add(s)}}for(let t of h)a.set(t,void 0);let r=new Map;for(let t of c)r.set(t.id,[]);for(let t of c){let f=a.get(t.id);f!==void 0&&r.get(f).push(t.id)}let d=t=>({task:m.get(t),children:(r.get(t)??[]).map(d)});return c.filter(t=>a.get(t.id)===void 0).map(t=>d(t.id))}var n=b($()),{Text:B}=C,U=16,j=3,G=L(({css:e,token:o})=>({root:e`
2
2
  display: flex;
3
3
  flex-direction: column;
4
4
  height: 100%;
@@ -1 +1 @@
1
- import{Ka as n}from"./embed-page-chunk-4SKSUBXL.js";import{k as i,l as p,p as s}from"./embed-page-chunk-KFUAWYJ7.js";import{a as d}from"./embed-page-chunk-MB65DZAX.js";import{e as a}from"./embed-page-chunk-6Y3UYJ6Z.js";var e=a(d()),P=({defaultWorkspaceId:t,defaultProjectId:o,children:r})=>{let c=p("__GLOBAL__");return(0,e.jsx)(n,{workspaceId:t,projectId:o,client:c,children:r})},f=({children:t,defaultProjectId:o,defaultWorkspaceId:r})=>{let{config:{baseURL:c}}=s();return(0,e.jsx)(i,{config:{baseURL:c,apiKey:"",assistantId:"__GLOBAL__",transport:"sse"},children:(0,e.jsx)(P,{defaultWorkspaceId:r,defaultProjectId:o,children:t})})},I=f;export{f as a,I as b};
1
+ import{Pa as n}from"./embed-page-chunk-MCUFFMAW.js";import{k as i,l as p,p as s}from"./embed-page-chunk-KFUAWYJ7.js";import{a as d}from"./embed-page-chunk-MB65DZAX.js";import{e as a}from"./embed-page-chunk-6Y3UYJ6Z.js";var e=a(d()),P=({defaultWorkspaceId:t,defaultProjectId:o,children:r})=>{let c=p("__GLOBAL__");return(0,e.jsx)(n,{workspaceId:t,projectId:o,client:c,children:r})},f=({children:t,defaultProjectId:o,defaultWorkspaceId:r})=>{let{config:{baseURL:c}}=s();return(0,e.jsx)(i,{config:{baseURL:c,apiKey:"",assistantId:"__GLOBAL__",transport:"sse"},children:(0,e.jsx)(P,{defaultWorkspaceId:r,defaultProjectId:o,children:t})})},I=f;export{f as a,I as b};
@@ -1,6 +1,6 @@
1
- import{h as b}from"./embed-page-chunk-ILNGM4RN.js";import"./embed-page-chunk-5XKUKLZQ.js";import"./embed-page-chunk-ZTRCHYWV.js";import"./embed-page-chunk-RTVQJYET.js";import"./embed-page-chunk-4SKSUBXL.js";import"./embed-page-chunk-KFUAWYJ7.js";import{a as c}from"./embed-page-chunk-MB65DZAX.js";import"./embed-page-chunk-VW3NF5NT.js";import"./embed-page-chunk-5JDQ456X.js";import"./embed-page-chunk-Z7USDLHI.js";import{a as u}from"./embed-page-chunk-O4QK5LWZ.js";import"./embed-page-chunk-4BKXE5ON.js";import"./embed-page-chunk-IX4WLWCY.js";import"./embed-page-chunk-EUOOO2LS.js";import{b as k,e as s}from"./embed-page-chunk-6Y3UYJ6Z.js";var f=k(l=>{"use strict";var g=u();l.createRoot=g.createRoot,l.hydrateRoot=g.hydrateRoot;var F});var R=s(f()),v=s(u());var E="axiom-web-app-embed";var y=["axiom:hello","axiom:identity","axiom:send"];function h(e,t){return{source:E,version:1,type:e,payload:t}}function x(e,t){if(typeof e!="object"||e===null)return null;let n=e;return n.source!==E||n.version!==1||typeof n.type!="string"||!t.includes(n.type)?null:{type:n.type,payload:n.payload}}var p=s(c()),S=/^[A-Za-z0-9._:@-]{1,128}$/,D="Open this chat from the host page embed to start chatting.",T="axiom-embed-root",w="axiom-embed-style",_=32768,L=`
2
- html, body, #${T} { height: 100%; margin: 0; }
1
+ import{h as f}from"./embed-page-chunk-FXTSVMPN.js";import"./embed-page-chunk-EMPMOO53.js";import"./embed-page-chunk-ZTRCHYWV.js";import"./embed-page-chunk-VVYB3C4O.js";import"./embed-page-chunk-MCUFFMAW.js";import"./embed-page-chunk-KFUAWYJ7.js";import{a as b}from"./embed-page-chunk-MB65DZAX.js";import"./embed-page-chunk-VW3NF5NT.js";import"./embed-page-chunk-5JDQ456X.js";import"./embed-page-chunk-Z7USDLHI.js";import{a as g}from"./embed-page-chunk-O4QK5LWZ.js";import"./embed-page-chunk-4BKXE5ON.js";import"./embed-page-chunk-IX4WLWCY.js";import"./embed-page-chunk-EUOOO2LS.js";import{b as U,e as s}from"./embed-page-chunk-6Y3UYJ6Z.js";var h=U(d=>{"use strict";var E=g();d.createRoot=E.createRoot,d.hydrateRoot=E.hydrateRoot;var ee});var T=s(h()),k=s(g());var y="axiom-web-app-embed";var x=["axiom:hello","axiom:identity","axiom:send","axiom:config"];function w(e,t){return{source:y,version:1,type:e,payload:t}}var N=6,z=40,B=500;function H(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<=z&&typeof t.text=="string"&&t.text.length>=1&&t.text.length<=B}function Q(e){if(!Array.isArray(e))return[];let t=[];for(let n of e){if(t.length>=N)break;H(n)&&t.push({label:n.label,text:n.text})}return t}function _(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 r=Q(t.quicks);(r.length>0||t.quicks.length===0)&&(n.quicks=r)}return n.welcome===void 0&&n.quicks===void 0?null:n}function R(e,t){if(typeof e!="object"||e===null)return null;let n=e;return n.source!==y||n.version!==1||typeof n.type!="string"||!t.includes(n.type)?null:{type:n.type,payload:n.payload}}var p=s(b()),P=/^[A-Za-z0-9._:@-]{1,128}$/,q="Open this chat from the host page embed to start chatting.",v="axiom-embed-root",C="axiom-embed-style",A=32768,G=`
2
+ html, body, #${v} { height: 100%; margin: 0; }
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={webAppId:null,hostOrigin:null,root:null,booted:!1,sendApi:null,pendingSends:[]},m=null;function N(){let e=/^\/api\/web-apps\/([^/]+)\/chat$/.exec(window.location.pathname);if(!e)return null;let t;try{t=decodeURIComponent(e[1])}catch{return null}return S.test(t)?t:null}function U(){return new URLSearchParams(window.location.search).get("mode")==="embed"}function A(){return document.getElementById(T)??document.getElementById("root")}function M(e){return o.root===null&&(o.root=(0,R.createRoot)(e)),o.root}function r(e,t){if(window.parent===window)return;let n=o.hostOrigin;n!==null&&window.parent.postMessage(h(e,t),n)}function d(e,t){let n=A();n!==null&&(0,v.flushSync)(()=>{M(n).render((0,p.jsx)("div",{className:"axiom-embed-card","data-axiom-embed-state":e,role:e==="error"?"alert":"status",children:t}))})}function z(){if(document.getElementById(w)!==null)return;let e=document.createElement("style");e.id=w,e.textContent=L,document.head.appendChild(e)}function B(e){if(typeof e!="object"||e===null)return null;let t=e.userId;return typeof t=="string"&&S.test(t)?t:null}function H(e){let t=typeof e=="object"&&e!==null?e.text:void 0;if(typeof t!="string"){r("axiom:error",{code:"INVALID_REQUEST",message:"axiom:send payload must be { text: string }"});return}let n=t.trim();if(!n){r("axiom:error",{code:"INVALID_REQUEST",message:"axiom:send text must not be empty"});return}if(n.length>_){r("axiom:error",{code:"INVALID_REQUEST",message:`axiom:send text exceeds the ${_} character limit`});return}let a=o.sendApi;if(a===null){o.pendingSends.push(n);return}a.sendMessage(n)}function G(e){o.sendApi=e;let t=o.pendingSends.splice(0);setTimeout(()=>{for(let n of t)o.sendApi?.sendMessage(n)},0)}function Y(e){if(o.booted)return;let t=o.webAppId;if(t===null){r("axiom:error",{code:"WEB_APP_NOT_FOUND",message:"The embed page URL does not contain a valid web app id"}),d("error","WEB_APP_NOT_FOUND: The embed page URL does not contain a valid web app id");return}let n=A();if(n===null)return;o.booted=!0;let a=U();a&&z();let I=i=>{r("axiom:error",{code:i.code,message:i.message}),i.retryable||d("error",`${i.code}: ${i.message}`)},P=i=>{G(i)},C=i=>{r("axiom:message",i)};M(n).render((0,p.jsx)(b,{className:a?"axiom-embed-fill":void 0,gatewayUrl:window.location.origin,webAppId:t,identity:{mode:"unverified",userId:e},onError:I,onChatReady:P,onChatMessage:C}))}function V(e){let t=B(e);if(t===null){r("axiom:error",{code:"USER_ID_REQUIRED",message:"A valid embed user identity is required"}),d("error","USER_ID_REQUIRED: A valid embed user identity is required");return}Y(t)}function j(e){if(e.source!==window.parent||typeof e.origin!="string"||e.origin.length===0)return;let t=x(e.data,y);t&&(o.hostOrigin=e.origin,t.type==="axiom:hello"?r("axiom:ready",{features:[]}):t.type==="axiom:identity"?V(t.payload):t.type==="axiom:send"&&H(t.payload))}function O(){m!==null&&window.removeEventListener("message",m),o.webAppId=N(),o.hostOrigin=null,o.root=null,o.booted=!1,o.sendApi=null,o.pendingSends=[];let e=t=>{j(t)};m=e,window.addEventListener("message",e),d("guidance",D)}O();
6
+ `,o={webAppId:null,hostOrigin:null,root:null,booted:!1,userId:null,hostConfig:null,sendApi:null,pendingSends:[]},m=null;function j(){let e=/^\/api\/web-apps\/([^/]+)\/chat$/.exec(window.location.pathname);if(!e)return null;let t;try{t=decodeURIComponent(e[1])}catch{return null}return P.test(t)?t:null}function Y(){return new URLSearchParams(window.location.search).get("mode")==="embed"}function u(){return document.getElementById(v)??document.getElementById("root")}function M(e){return o.root===null&&(o.root=(0,T.createRoot)(e)),o.root}function a(e,t){if(window.parent===window)return;let n=o.hostOrigin;n!==null&&window.parent.postMessage(w(e,t),n)}function l(e,t){let n=u();n!==null&&(0,k.flushSync)(()=>{M(n).render((0,p.jsx)("div",{className:"axiom-embed-card","data-axiom-embed-state":e,role:e==="error"?"alert":"status",children:t}))})}function V(){if(document.getElementById(C)!==null)return;let e=document.createElement("style");e.id=C,e.textContent=G,document.head.appendChild(e)}function F(e){if(typeof e!="object"||e===null)return null;let t=e.userId;return typeof t=="string"&&P.test(t)?t:null}function W(e){let t=typeof e=="object"&&e!==null?e.text:void 0;if(typeof t!="string"){a("axiom:error",{code:"INVALID_REQUEST",message:"axiom:send payload must be { text: string }"});return}let n=t.trim();if(!n){a("axiom:error",{code:"INVALID_REQUEST",message:"axiom:send text must not be empty"});return}if(n.length>A){a("axiom:error",{code:"INVALID_REQUEST",message:`axiom:send text exceeds the ${A} character limit`});return}let r=o.sendApi;if(r===null){o.pendingSends.push(n);return}r.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 S(){let e=o.webAppId,t=o.userId;if(e===null||t===null)return;let n=u();if(n===null)return;let r=Y();r&&V();let O=i=>{a("axiom:error",{code:i.code,message:i.message}),i.retryable||l("error",`${i.code}: ${i.message}`)},D=i=>{X(i)},L=i=>{a("axiom:message",i)},c=o.hostConfig;M(n).render((0,p.jsx)(f,{className:r?"axiom-embed-fill":void 0,gatewayUrl:window.location.origin,webAppId:e,identity:{mode:"unverified",userId:t},welcome:c?.welcome,quickPrompts:c?.quicks,onError:O,onChatReady:D,onChatMessage:L}))}function $(e){if(!o.booted){if(o.webAppId===null){a("axiom:error",{code:"WEB_APP_NOT_FOUND",message:"The embed page URL does not contain a valid web app id"}),l("error","WEB_APP_NOT_FOUND: The embed page URL does not contain a valid web app id");return}u()!==null&&(o.booted=!0,o.userId=e,S())}}function K(e){let t=_(e);t!==null&&(o.hostConfig=t,o.booted&&S())}function Z(e){let t=F(e);if(t===null){a("axiom:error",{code:"USER_ID_REQUIRED",message:"A valid embed user identity is required"}),l("error","USER_ID_REQUIRED: A valid embed user identity is required");return}$(t)}function J(e){if(e.source!==window.parent||typeof e.origin!="string"||e.origin.length===0)return;let t=R(e.data,x);t&&(o.hostOrigin=e.origin,t.type==="axiom:hello"?a("axiom:ready",{features:[]}):t.type==="axiom:identity"?Z(t.payload):t.type==="axiom:config"?K(t.payload):t.type==="axiom:send"&&W(t.payload))}function I(){m!==null&&window.removeEventListener("message",m),o.webAppId=j(),o.hostOrigin=null,o.root=null,o.booted=!1,o.userId=null,o.hostConfig=null,o.sendApi=null,o.pendingSends=[];let e=t=>{J(t)};m=e,window.addEventListener("message",e),l("guidance",q)}I();