@axiom-lattice/gateway 4.2.4 → 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 (28) hide show
  1. package/dist/embed/agent-chat-loader.js +1 -1
  2. package/dist/embed/{embed-page-AgentDetailSideApp-3LBCEKFU.js → embed-page-AgentDetailSideApp-7FH2JSZI.js} +1 -1
  3. package/dist/embed/{embed-page-AgentGovernanceWorkbench-K3JUQNBW.js → embed-page-AgentGovernanceWorkbench-Y5F3ZPYC.js} +1 -1
  4. package/dist/embed/{embed-page-MessageGraph-3X4ROEN6.js → embed-page-MessageGraph-ONODQPG4.js} +1 -1
  5. package/dist/embed/{embed-page-ReactChart-F6VYCIYY.js → embed-page-ReactChart-GZQSKCUG.js} +1 -1
  6. package/dist/embed/{embed-page-SkillFlow-3CF7R3CW.js → embed-page-SkillFlow-TPESM4DI.js} +1 -1
  7. package/dist/embed/{embed-page-TasksSideApp-3WRDBZU3.js → embed-page-TasksSideApp-HYKCJ356.js} +1 -1
  8. package/dist/embed/{embed-page-TeamWorkspace-6JSMZYUF.js → embed-page-TeamWorkspace-IOHS4RJV.js} +1 -1
  9. package/dist/embed/{embed-page-TopologyRuntimeView-YDFENLHH.js → embed-page-TopologyRuntimeView-QLMZ4OE7.js} +1 -1
  10. package/dist/embed/{embed-page-WorkflowAutomationView-MP5B7Q2Q.js → embed-page-WorkflowAutomationView-FJJSGY7Z.js} +1 -1
  11. package/dist/embed/{embed-page-chunk-QEYWJHEK.js → embed-page-chunk-6LL6YULZ.js} +1 -1
  12. package/dist/embed/{embed-page-chunk-UOL6CUAL.js → embed-page-chunk-D3NRIME3.js} +1 -1
  13. package/dist/embed/embed-page-chunk-EMPMOO53.js +466 -0
  14. package/dist/embed/{embed-page-chunk-GDTBDOUE.js → embed-page-chunk-FXTSVMPN.js} +89 -38
  15. package/dist/embed/embed-page-chunk-KFUAWYJ7.js +5 -0
  16. package/dist/embed/{embed-page-chunk-IRP6JSSX.js → embed-page-chunk-L7RMIQ7C.js} +9 -9
  17. package/dist/embed/{embed-page-chunk-YMJGPA3F.js → embed-page-chunk-MCUFFMAW.js} +116 -124
  18. package/dist/embed/{embed-page-chunk-PAJ5NG2Z.js → embed-page-chunk-SMQZEZYG.js} +1 -1
  19. package/dist/embed/{embed-page-chunk-FFO7CAYL.js → embed-page-chunk-VVYB3C4O.js} +1 -1
  20. package/dist/embed/{embed-page-chunk-RVXX5HKF.js → embed-page-chunk-ZTRCHYWV.js} +1 -1
  21. package/dist/embed/embed-page.js +3 -3
  22. package/dist/index.js +239 -144
  23. package/dist/index.js.map +1 -1
  24. package/dist/index.mjs +117 -22
  25. package/dist/index.mjs.map +1 -1
  26. package/package.json +7 -7
  27. package/dist/embed/embed-page-chunk-B2E2XOH2.js +0 -467
  28. package/dist/embed/embed-page-chunk-URNZX66S.js +0 -5
@@ -1,4 +1,4 @@
1
- import{e as T}from"./embed-page-chunk-B2E2XOH2.js";import{Ha as L,p as O,r as P}from"./embed-page-chunk-YMJGPA3F.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-YMJGPA3F.js";import{k as i,l as p,p as s}from"./embed-page-chunk-URNZX66S.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 +1 @@
1
- import{q as D}from"./embed-page-chunk-URNZX66S.js";import{a as M}from"./embed-page-chunk-MB65DZAX.js";import{Ja as I,La as R,W as x,oa as k,ra as n,ta as m,xa as h,ya as z,yc as B}from"./embed-page-chunk-O4QK5LWZ.js";import{a as L}from"./embed-page-chunk-4BKXE5ON.js";import{e as S}from"./embed-page-chunk-6Y3UYJ6Z.js";var f=S(L());var e=S(M()),{TextArea:A}=m,{Text:r}=R,V=({open:g,onCancel:C,onSuccess:q,skill:a})=>{let[y]=n.useForm(),[N,T]=(0,f.useState)(!1),{post:P,put:O}=D(),{token:o}=I.useToken(),c=!!a,p=[{key:"category",value:"global"}],[u,d]=(0,f.useState)(p);(0,f.useEffect)(()=>{g&&a?(y.setFieldsValue({name:a.name,description:a.description,license:a.license||"",compatibility:a.compatibility||"",content:a.content||""}),a.metadata?d(Object.entries(a.metadata).map(([t,l])=>({key:t,value:l}))):d(p)):g&&!a&&(y.resetFields(),d(p))},[g,a]);let j=async()=>{try{let t=await y.validateFields();T(!0);let l=u.length>0?u.reduce((F,v)=>(v.key&&(F[v.key]=v.value),F),{}):void 0,i={id:t.name,name:t.name,description:t.description,license:t.license||void 0,compatibility:t.compatibility||void 0,metadata:l,content:t.content||void 0,subSkills:void 0},s;c?s=await O(`/api/skills/${a.id}`,i):s=await P("/api/skills",i),s.success?(h.success(c?"Skill updated successfully":"Skill created successfully"),y.resetFields(),d(p),q?.(),C()):h.error(s.message||(c?"Failed to update skill":"Failed to create skill"))}catch(t){if(t.errorFields)return;h.error(t.message||(c?"An error occurred while updating the skill":"An error occurred while creating the skill"))}finally{T(!1)}},b=()=>{y.resetFields(),d(p),C()},w=(t,l,i)=>{let s=[...u];s[t]={...s[t],[l]:i},d(s)},E=()=>{d([...u,{key:"",value:""}])};return(0,e.jsx)(z,{title:c?"Edit Skill":"Create New Skill",open:g,onCancel:b,footer:null,width:520,destroyOnClose:!0,styles:{body:{padding:16}},children:(0,e.jsx)(n,{form:y,layout:"vertical",onFinish:j,autoComplete:"off",children:(0,e.jsxs)("div",{style:{display:"flex",flexDirection:"column",gap:12},children:[(0,e.jsxs)("div",{style:{display:"flex",flexDirection:"column",gap:6},children:[(0,e.jsx)(r,{style:{fontSize:12,color:o.colorTextSecondary},children:"Name"}),(0,e.jsx)(n.Item,{name:"name",rules:[{required:!0,message:"Please enter skill name"},{pattern:/^[a-z0-9]+(-[a-z0-9]+)*$/,message:"Name must be lowercase alphanumeric with single hyphens (e.g., 'my-skill')"},{min:1,max:64,message:"Name must be 1-64 characters"}],style:{marginBottom:0},children:(0,e.jsx)(m,{placeholder:"e.g., data-analysis",disabled:c})})]}),(0,e.jsxs)("div",{style:{display:"flex",flexDirection:"column",gap:6},children:[(0,e.jsx)(r,{style:{fontSize:12,color:o.colorTextSecondary},children:"Description"}),(0,e.jsx)(n.Item,{name:"description",rules:[{required:!0,message:"Please enter skill description"}],style:{marginBottom:0},children:(0,e.jsx)(A,{placeholder:"Description",autoSize:{minRows:2,maxRows:4}})})]}),(0,e.jsxs)("div",{style:{display:"flex",flexDirection:"column",gap:6},children:[(0,e.jsx)(r,{style:{fontSize:12,color:o.colorTextSecondary},children:"License"}),(0,e.jsx)(n.Item,{name:"license",style:{marginBottom:0},children:(0,e.jsx)(m,{placeholder:"License"})})]}),(0,e.jsxs)("div",{style:{display:"flex",flexDirection:"column",gap:6},children:[(0,e.jsx)(r,{style:{fontSize:12,color:o.colorTextSecondary},children:"Compatibility"}),(0,e.jsx)(n.Item,{name:"compatibility",style:{marginBottom:0},children:(0,e.jsx)(m,{placeholder:"Compatibility"})})]}),(0,e.jsxs)("div",{style:{display:"flex",flexDirection:"column",gap:6},children:[(0,e.jsxs)("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between",gap:8},children:[(0,e.jsx)(r,{style:{fontSize:12,color:o.colorTextSecondary,fontWeight:500},children:"Metadata"}),(0,e.jsx)(x,{size:"small",icon:(0,e.jsx)(B,{}),onClick:E,children:"Add"})]}),(0,e.jsxs)(k,{direction:"vertical",size:8,style:{width:"100%"},children:[u.length===0&&(0,e.jsx)(r,{style:{fontSize:11,color:o.colorTextTertiary},children:"No metadata yet. Use Add to create one."}),u.map((t,l)=>(0,e.jsxs)("div",{style:{display:"flex",flexDirection:"column",gap:4,width:"100%"},children:[(0,e.jsxs)(r,{style:{fontSize:11,color:o.colorTextSecondary},children:["Meta ",l+1]}),(0,e.jsxs)(k,{style:{width:"100%"},size:8,wrap:!0,children:[(0,e.jsx)(m,{value:t.key,placeholder:"Key",style:{width:140},onChange:i=>w(l,"key",i.target.value)}),(0,e.jsx)(m,{value:t.value,placeholder:"Value",style:{flex:1,minWidth:200},onChange:i=>w(l,"value",i.target.value)})]})]},l))]})]}),(0,e.jsxs)("div",{style:{display:"flex",flexDirection:"column",gap:6},children:[(0,e.jsx)(r,{style:{fontSize:12,color:o.colorTextSecondary},children:"Content"}),(0,e.jsx)(n.Item,{name:"content",style:{marginBottom:0},children:(0,e.jsx)(A,{placeholder:"Content",autoSize:{minRows:4,maxRows:8}})})]}),(0,e.jsxs)("div",{style:{display:"flex",alignItems:"center",justifyContent:"flex-end",gap:8,marginTop:8},children:[(0,e.jsx)(x,{onClick:b,children:"Cancel"}),(0,e.jsx)(x,{type:"primary",htmlType:"submit",loading:N,children:c?"Save Changes":"Create Skill"})]})]})})})},H=V;export{H as a};
1
+ import{q as D}from"./embed-page-chunk-KFUAWYJ7.js";import{a as M}from"./embed-page-chunk-MB65DZAX.js";import{Ja as I,La as R,W as x,oa as k,ra as n,ta as m,xa as h,ya as z,yc as B}from"./embed-page-chunk-O4QK5LWZ.js";import{a as L}from"./embed-page-chunk-4BKXE5ON.js";import{e as S}from"./embed-page-chunk-6Y3UYJ6Z.js";var f=S(L());var e=S(M()),{TextArea:A}=m,{Text:r}=R,V=({open:g,onCancel:C,onSuccess:q,skill:a})=>{let[y]=n.useForm(),[N,T]=(0,f.useState)(!1),{post:P,put:O}=D(),{token:o}=I.useToken(),c=!!a,p=[{key:"category",value:"global"}],[u,d]=(0,f.useState)(p);(0,f.useEffect)(()=>{g&&a?(y.setFieldsValue({name:a.name,description:a.description,license:a.license||"",compatibility:a.compatibility||"",content:a.content||""}),a.metadata?d(Object.entries(a.metadata).map(([t,l])=>({key:t,value:l}))):d(p)):g&&!a&&(y.resetFields(),d(p))},[g,a]);let j=async()=>{try{let t=await y.validateFields();T(!0);let l=u.length>0?u.reduce((F,v)=>(v.key&&(F[v.key]=v.value),F),{}):void 0,i={id:t.name,name:t.name,description:t.description,license:t.license||void 0,compatibility:t.compatibility||void 0,metadata:l,content:t.content||void 0,subSkills:void 0},s;c?s=await O(`/api/skills/${a.id}`,i):s=await P("/api/skills",i),s.success?(h.success(c?"Skill updated successfully":"Skill created successfully"),y.resetFields(),d(p),q?.(),C()):h.error(s.message||(c?"Failed to update skill":"Failed to create skill"))}catch(t){if(t.errorFields)return;h.error(t.message||(c?"An error occurred while updating the skill":"An error occurred while creating the skill"))}finally{T(!1)}},b=()=>{y.resetFields(),d(p),C()},w=(t,l,i)=>{let s=[...u];s[t]={...s[t],[l]:i},d(s)},E=()=>{d([...u,{key:"",value:""}])};return(0,e.jsx)(z,{title:c?"Edit Skill":"Create New Skill",open:g,onCancel:b,footer:null,width:520,destroyOnClose:!0,styles:{body:{padding:16}},children:(0,e.jsx)(n,{form:y,layout:"vertical",onFinish:j,autoComplete:"off",children:(0,e.jsxs)("div",{style:{display:"flex",flexDirection:"column",gap:12},children:[(0,e.jsxs)("div",{style:{display:"flex",flexDirection:"column",gap:6},children:[(0,e.jsx)(r,{style:{fontSize:12,color:o.colorTextSecondary},children:"Name"}),(0,e.jsx)(n.Item,{name:"name",rules:[{required:!0,message:"Please enter skill name"},{pattern:/^[a-z0-9]+(-[a-z0-9]+)*$/,message:"Name must be lowercase alphanumeric with single hyphens (e.g., 'my-skill')"},{min:1,max:64,message:"Name must be 1-64 characters"}],style:{marginBottom:0},children:(0,e.jsx)(m,{placeholder:"e.g., data-analysis",disabled:c})})]}),(0,e.jsxs)("div",{style:{display:"flex",flexDirection:"column",gap:6},children:[(0,e.jsx)(r,{style:{fontSize:12,color:o.colorTextSecondary},children:"Description"}),(0,e.jsx)(n.Item,{name:"description",rules:[{required:!0,message:"Please enter skill description"}],style:{marginBottom:0},children:(0,e.jsx)(A,{placeholder:"Description",autoSize:{minRows:2,maxRows:4}})})]}),(0,e.jsxs)("div",{style:{display:"flex",flexDirection:"column",gap:6},children:[(0,e.jsx)(r,{style:{fontSize:12,color:o.colorTextSecondary},children:"License"}),(0,e.jsx)(n.Item,{name:"license",style:{marginBottom:0},children:(0,e.jsx)(m,{placeholder:"License"})})]}),(0,e.jsxs)("div",{style:{display:"flex",flexDirection:"column",gap:6},children:[(0,e.jsx)(r,{style:{fontSize:12,color:o.colorTextSecondary},children:"Compatibility"}),(0,e.jsx)(n.Item,{name:"compatibility",style:{marginBottom:0},children:(0,e.jsx)(m,{placeholder:"Compatibility"})})]}),(0,e.jsxs)("div",{style:{display:"flex",flexDirection:"column",gap:6},children:[(0,e.jsxs)("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between",gap:8},children:[(0,e.jsx)(r,{style:{fontSize:12,color:o.colorTextSecondary,fontWeight:500},children:"Metadata"}),(0,e.jsx)(x,{size:"small",icon:(0,e.jsx)(B,{}),onClick:E,children:"Add"})]}),(0,e.jsxs)(k,{direction:"vertical",size:8,style:{width:"100%"},children:[u.length===0&&(0,e.jsx)(r,{style:{fontSize:11,color:o.colorTextTertiary},children:"No metadata yet. Use Add to create one."}),u.map((t,l)=>(0,e.jsxs)("div",{style:{display:"flex",flexDirection:"column",gap:4,width:"100%"},children:[(0,e.jsxs)(r,{style:{fontSize:11,color:o.colorTextSecondary},children:["Meta ",l+1]}),(0,e.jsxs)(k,{style:{width:"100%"},size:8,wrap:!0,children:[(0,e.jsx)(m,{value:t.key,placeholder:"Key",style:{width:140},onChange:i=>w(l,"key",i.target.value)}),(0,e.jsx)(m,{value:t.value,placeholder:"Value",style:{flex:1,minWidth:200},onChange:i=>w(l,"value",i.target.value)})]})]},l))]})]}),(0,e.jsxs)("div",{style:{display:"flex",flexDirection:"column",gap:6},children:[(0,e.jsx)(r,{style:{fontSize:12,color:o.colorTextSecondary},children:"Content"}),(0,e.jsx)(n.Item,{name:"content",style:{marginBottom:0},children:(0,e.jsx)(A,{placeholder:"Content",autoSize:{minRows:4,maxRows:8}})})]}),(0,e.jsxs)("div",{style:{display:"flex",alignItems:"center",justifyContent:"flex-end",gap:8,marginTop:8},children:[(0,e.jsx)(x,{onClick:b,children:"Cancel"}),(0,e.jsx)(x,{type:"primary",htmlType:"submit",loading:N,children:c?"Save Changes":"Create Skill"})]})]})})})},H=V;export{H as a};
@@ -1,6 +1,6 @@
1
- import{h as b}from"./embed-page-chunk-GDTBDOUE.js";import"./embed-page-chunk-B2E2XOH2.js";import"./embed-page-chunk-RVXX5HKF.js";import"./embed-page-chunk-FFO7CAYL.js";import"./embed-page-chunk-YMJGPA3F.js";import"./embed-page-chunk-URNZX66S.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();