@rubytech/create-realagent 1.0.795 → 1.0.798
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/package.json +1 -1
- package/payload/platform/neo4j/migrations/003-person-name-eradicate.cypher +24 -0
- package/payload/platform/neo4j/schema.cypher +34 -0
- package/payload/platform/plugins/admin/PLUGIN.md +4 -0
- package/payload/platform/plugins/admin/hooks/pre-tool-use.sh +9 -5
- package/payload/platform/plugins/admin/mcp/dist/index.js +54 -18
- package/payload/platform/plugins/admin/mcp/dist/index.js.map +1 -1
- package/payload/platform/plugins/docs/references/internals.md +8 -0
- package/payload/platform/plugins/docs/references/settings.md +6 -0
- package/payload/platform/plugins/memory/PLUGIN.md +4 -2
- package/payload/platform/plugins/memory/mcp/dist/lib/__tests__/schema-loader.test.js +11 -0
- package/payload/platform/plugins/memory/mcp/dist/lib/__tests__/schema-loader.test.js.map +1 -1
- package/payload/platform/plugins/memory/mcp/dist/lib/__tests__/schema-validator.test.js +124 -1
- package/payload/platform/plugins/memory/mcp/dist/lib/__tests__/schema-validator.test.js.map +1 -1
- package/payload/platform/plugins/memory/mcp/dist/lib/schema-loader.d.ts +12 -0
- package/payload/platform/plugins/memory/mcp/dist/lib/schema-loader.d.ts.map +1 -1
- package/payload/platform/plugins/memory/mcp/dist/lib/schema-loader.js +41 -2
- package/payload/platform/plugins/memory/mcp/dist/lib/schema-loader.js.map +1 -1
- package/payload/platform/plugins/memory/mcp/dist/lib/schema-validator.d.ts +9 -0
- package/payload/platform/plugins/memory/mcp/dist/lib/schema-validator.d.ts.map +1 -1
- package/payload/platform/plugins/memory/mcp/dist/lib/schema-validator.js +44 -0
- package/payload/platform/plugins/memory/mcp/dist/lib/schema-validator.js.map +1 -1
- package/payload/platform/plugins/memory/mcp/dist/tools/__tests__/memory-archive-write.test.js +20 -2
- package/payload/platform/plugins/memory/mcp/dist/tools/__tests__/memory-archive-write.test.js.map +1 -1
- package/payload/platform/plugins/memory/mcp/dist/tools/memory-archive-write.d.ts +1 -1
- package/payload/platform/plugins/memory/mcp/dist/tools/memory-archive-write.d.ts.map +1 -1
- package/payload/platform/plugins/memory/mcp/dist/tools/memory-archive-write.js +0 -1
- package/payload/platform/plugins/memory/mcp/dist/tools/memory-archive-write.js.map +1 -1
- package/payload/platform/plugins/memory/references/schema-base.md +11 -1
- package/payload/platform/plugins/whatsapp/mcp/dist/call-api.d.ts +14 -0
- package/payload/platform/plugins/whatsapp/mcp/dist/call-api.d.ts.map +1 -0
- package/payload/platform/plugins/whatsapp/mcp/dist/call-api.js +42 -0
- package/payload/platform/plugins/whatsapp/mcp/dist/call-api.js.map +1 -0
- package/payload/platform/plugins/whatsapp/mcp/dist/index.js +50 -19
- package/payload/platform/plugins/whatsapp/mcp/dist/index.js.map +1 -1
- package/payload/platform/scripts/logs-read.sh +17 -12
- package/payload/platform/templates/agents/admin/IDENTITY.md +6 -0
- package/payload/server/chunk-BURNRCKP.js +3405 -0
- package/payload/server/chunk-JSBRDJBE.js +30 -0
- package/payload/server/chunk-KM23Y7SY.js +9896 -0
- package/payload/server/chunk-SBHI2NMF.js +9910 -0
- package/payload/server/chunk-WHF6YXJ5.js +3456 -0
- package/payload/server/client-pool-4YDRTKAT.js +29 -0
- package/payload/server/client-pool-PV45NUTN.js +29 -0
- package/payload/server/maxy-edge.js +3 -2
- package/payload/server/neo4j-migrations-IUSBODOP.js +51 -0
- package/payload/server/public/assets/admin-C0lKk6WM.js +352 -0
- package/payload/server/public/assets/data-BvV94XHO.js +1 -0
- package/payload/server/public/assets/graph-CBu0rtrP.js +1 -0
- package/payload/server/public/assets/page-BNM63zsb.js +50 -0
- package/payload/server/public/assets/page-DM19J3ur.js +1 -0
- package/payload/server/public/assets/useAdminFetch-iYCQ9lT0.js +1 -0
- package/payload/server/public/data.html +3 -3
- package/payload/server/public/graph.html +3 -3
- package/payload/server/public/index.html +4 -4
- package/payload/server/server.js +470 -137
- package/payload/server/public/assets/admin-D8wbpnrW.js +0 -352
- package/payload/server/public/assets/data-BhrQjgR5.js +0 -1
- package/payload/server/public/assets/graph-Jj7seS-w.js +0 -1
- package/payload/server/public/assets/page-DIG7s5Jp.js +0 -1
- package/payload/server/public/assets/page-sZb3wcOM.js +0 -50
- package/payload/server/public/assets/share-2-BndjMKeG.js +0 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{o as e}from"./chunk-DD-I1_y5.js";import{n as t,o as n,r,t as i}from"./jsx-runtime-DJER3a7U.js";import{a,c as o,i as s,l as c,o as l,r as u,s as d,t as f}from"./useAdminFetch-iYCQ9lT0.js";var p=r(`circle-arrow-up`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`m16 12-4-4-4 4`,key:`177agl`}],[`path`,{d:`M12 16V8`,key:`1sbj14`}]]),m=r(`download`,[[`path`,{d:`M12 15V3`,key:`m9g1x1`}],[`path`,{d:`M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4`,key:`ih7n3h`}],[`path`,{d:`m7 10 5 5 5-5`,key:`brsn70`}]]),h=r(`file`,[[`path`,{d:`M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z`,key:`1oefj6`}],[`path`,{d:`M14 2v5a1 1 0 0 0 1 1h5`,key:`wfsgrz`}]]),g=r(`folder`,[[`path`,{d:`M20 20a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2h-7.9a2 2 0 0 1-1.69-.9L9.6 3.9A2 2 0 0 0 7.93 3H4a2 2 0 0 0-2 2v13a2 2 0 0 0 2 2Z`,key:`1kt360`}]]),_=r(`upload`,[[`path`,{d:`M12 3v12`,key:`1x0j5s`}],[`path`,{d:`m17 8-5-5-5 5`,key:`7q97r8`}],[`path`,{d:`M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4`,key:`ih7n3h`}]]),v=e(n(),1),y=i();function b(){let[e,t]=(0,v.useState)(null),[n,r]=(0,v.useState)(!1);return(0,v.useEffect)(()=>{let e=!1,n=null;try{n=sessionStorage.getItem(`maxy-admin-session-key`)}catch{}if(!n){t(null),r(!0);return}return fetch(`/api/admin/session?session_key=${encodeURIComponent(n)}`).then(i=>{if(!e){if(i.status===401){try{sessionStorage.removeItem(`maxy-admin-session-key`)}catch{}window.location.href=`/`;return}t(n),r(!0)}}).catch(()=>{e||(t(n),r(!0))}),()=>{e=!0}},[]),n?e?(0,y.jsxs)(`div`,{className:`data-page`,children:[(0,y.jsxs)(`header`,{className:`data-header`,children:[(0,y.jsxs)(`h1`,{className:`data-title`,children:[(0,y.jsx)(c,{size:18}),` Data`]}),(0,y.jsx)(S,{})]}),(0,y.jsx)(x,{sessionKey:e})]}):(0,y.jsxs)(`div`,{className:`data-page`,children:[(0,y.jsx)(`header`,{className:`data-header`,children:(0,y.jsxs)(`h1`,{className:`data-title`,children:[(0,y.jsx)(c,{size:18}),` Data`]})}),(0,y.jsxs)(`div`,{className:`data-empty`,children:[(0,y.jsx)(`p`,{children:`You are not signed in.`}),(0,y.jsxs)(`p`,{children:[`Open the `,(0,y.jsx)(`a`,{href:`/`,className:`data-link`,children:`main admin page`}),` and log in, then return here.`]})]})]}):(0,y.jsx)(`div`,{className:`data-page`,children:(0,y.jsxs)(`div`,{className:`data-loading`,children:[(0,y.jsx)(d,{size:18,className:`spin`}),` Loading…`]})})}function x({sessionKey:e}){let{adminFetch:t,sessionKey:n,sessionRefetchNonce:r,banner:i,reloadToLogin:a}=f({initialSessionKey:e,surface:`data`});return(0,y.jsxs)(`main`,{className:`data-main`,children:[i&&(0,y.jsx)(`button`,{type:`button`,className:`data-session-banner`,onClick:a,"data-reason":i.reason,children:i.message}),(0,y.jsx)(C,{adminFetch:t,sessionRefetchNonce:r}),(0,y.jsx)(O,{adminFetch:t,sessionKey:n,sessionRefetchNonce:r})]})}function S(){let[e,t]=(0,v.useState)(!1),n=(0,v.useRef)(null);(0,v.useEffect)(()=>{if(!e)return;let r=e=>{n.current&&(n.current.contains(e.target)||t(!1))},i=e=>{e.key===`Escape`&&t(!1)};return document.addEventListener(`mousedown`,r),document.addEventListener(`keydown`,i),()=>{document.removeEventListener(`mousedown`,r),document.removeEventListener(`keydown`,i)}},[e]);let r=(0,v.useCallback)(()=>{try{sessionStorage.removeItem(`maxy-admin-session-key`)}catch{}window.location.href=`/`},[]);return(0,y.jsxs)(`div`,{className:`chat-burger-wrap`,ref:n,children:[(0,y.jsx)(`button`,{type:`button`,className:`chat-burger`,onClick:()=>t(e=>!e),"aria-label":`Menu`,"aria-haspopup":`true`,"aria-expanded":e,children:(0,y.jsx)(a,{size:20})}),e&&(0,y.jsxs)(`div`,{className:`chat-menu`,children:[(0,y.jsxs)(`button`,{type:`button`,className:`chat-menu-item`,onClick:()=>{t(!1),window.location.href=`/`},children:[(0,y.jsx)(o,{size:14}),` Chat`]}),(0,y.jsxs)(`button`,{type:`button`,className:`chat-menu-item`,onClick:()=>{t(!1),window.location.href=`/graph`},children:[(0,y.jsx)(u,{size:14}),` Graph`]}),(0,y.jsx)(`div`,{className:`chat-menu-divider`}),(0,y.jsxs)(`button`,{type:`button`,className:`chat-menu-item`,onClick:()=>{t(!1),r()},children:[(0,y.jsx)(l,{size:14}),` Log out`]})]})]})}function C({adminFetch:e,sessionRefetchNonce:t}){let[n,r]=(0,v.useState)(``),[i,a]=(0,v.useState)(``),[o,c]=(0,v.useState)(null),[l,u]=(0,v.useState)(!1),[f,p]=(0,v.useState)(null);return(0,v.useEffect)(()=>{let e=n.trim();if(!e){a(``),c(null);return}let t=setTimeout(()=>a(e),300);return()=>clearTimeout(t)},[n]),(0,v.useEffect)(()=>{if(!i)return;let t=!1;return u(!0),p(null),e(`/api/admin/graph-search?q=${encodeURIComponent(i)}&limit=20`).then(async e=>{let t=await e.json().catch(()=>({error:`HTTP ${e.status}`}));if(!e.ok)throw Error(t.error??`HTTP ${e.status}`);return t}).then(e=>{t||c(e.results)}).catch(e=>{t||p(e instanceof Error?e.message:String(e))}).finally(()=>{t||u(!1)}),()=>{t=!0}},[i,e,t]),(0,y.jsxs)(`section`,{className:`data-panel`,children:[(0,y.jsx)(`h2`,{className:`data-panel-title`,children:`Search`}),(0,y.jsx)(`p`,{className:`data-panel-subtitle`,children:`Find anything in your knowledge base by keyword.`}),(0,y.jsxs)(`div`,{className:`data-search-input`,children:[(0,y.jsx)(s,{size:14}),(0,y.jsx)(`input`,{type:`text`,placeholder:`Search your knowledge…`,value:n,onChange:e=>r(e.target.value),autoFocus:!0,autoComplete:`off`,spellCheck:!1}),l&&(0,y.jsx)(d,{size:14,className:`spin`})]}),f&&(0,y.jsxs)(`div`,{className:`data-error`,children:[`Search failed: `,f]}),o&&!l&&(0,y.jsxs)(`div`,{className:`data-results-meta`,children:[o.length,` result`,o.length===1?``:`s`]}),o&&o.length===0&&!l&&(0,y.jsx)(`div`,{className:`data-empty-results`,children:`No matches. Try a different keyword.`}),o&&o.length>0&&(0,y.jsx)(`ul`,{className:`data-results`,children:o.map(e=>(0,y.jsx)(w,{hit:e},e.nodeId))})]})}function w({hit:e}){let t=E(e.properties),n=D(e.properties),r=T(e.labels),[i,a]=(0,v.useState)(!1),o=n&&n.length>280,s=i||!o?n:n?.slice(0,280)+`…`;return(0,y.jsxs)(`li`,{className:`data-result`,children:[r&&(0,y.jsx)(`div`,{className:`data-result-header`,children:(0,y.jsx)(`span`,{className:`data-result-labels`,children:r})}),t&&(0,y.jsx)(`div`,{className:`data-result-title`,children:t}),n&&(0,y.jsx)(`pre`,{className:`data-result-body`,children:s}),o&&(0,y.jsx)(`button`,{type:`button`,className:`data-result-toggle`,onClick:()=>a(e=>!e),children:i?`Show less`:`Show more`})]})}function T(e){if(e.length===0)return null;let t=e[0].replace(/([a-z])([A-Z])/g,`$1 $2`);return t.charAt(0).toUpperCase()+t.slice(1).toLowerCase()}function E(e){for(let t of[`title`,`name`,`summary`,`headline`]){let n=e[t];if(typeof n==`string`&&n.length>0)return n.length>140?n.slice(0,140)+`…`:n}return null}function D(e){for(let t of[`content`,`summary`,`body`,`description`,`text`]){let n=e[t];if(typeof n==`string`&&n.length>0)return n}return null}function O({adminFetch:e,sessionKey:n,sessionRefetchNonce:r}){let[i,a]=(0,v.useState)(`.`),[o,s]=(0,v.useState)(null),[c,l]=(0,v.useState)([]),[u,f]=(0,v.useState)(!1),[b,x]=(0,v.useState)(null),[S,C]=(0,v.useState)(!1),[w,T]=(0,v.useState)(null),[E,D]=(0,v.useState)(null),[O,j]=(0,v.useState)(null),[M,N]=(0,v.useState)(null),P=(0,v.useRef)(null),[F,I]=(0,v.useState)(0);(0,v.useEffect)(()=>{let t=!1;return f(!0),x(null),e(`/api/admin/files?path=${encodeURIComponent(i===`.`?``:i)}`).then(async e=>{let t=await e.json().catch(()=>({error:`HTTP ${e.status}`}));if(!e.ok)throw Error(t.error??`HTTP ${e.status}`);return t}).then(e=>{t||(s(e.entries),l(e.displayPath??[]))}).catch(e=>{t||(s([]),l([]),x(e instanceof Error?e.message:String(e)))}).finally(()=>{t||f(!1)}),()=>{t=!0}},[e,i,F,r]);let L=(0,v.useCallback)(e=>{a(e)},[]),R=(0,v.useCallback)(()=>{if(i===`.`||i===``)return;let e=i.split(`/`).filter(Boolean);e.pop(),a(e.length===0?`.`:e.join(`/`))},[i]),z=(0,v.useCallback)(e=>{let t=i===`.`?e.name:`${i}/${e.name}`,r=`/api/admin/files/download?session_key=${encodeURIComponent(n)}&path=${encodeURIComponent(t)}`,a=document.createElement(`a`);a.href=r,a.rel=`noopener noreferrer`,document.body.appendChild(a),a.click(),a.remove()},[i,n]),B=(0,v.useCallback)(()=>{P.current?.click()},[]),V=(0,v.useCallback)(e=>{D(null),N(e.name)},[]),H=(0,v.useCallback)(()=>{N(null)},[]),U=(0,v.useCallback)(async t=>{let n=i===`.`?t.name:`${i}/${t.name}`;D(null),N(null),j(t.name);try{let t=await e(`/api/admin/files?path=${encodeURIComponent(n)}`,{method:`DELETE`}),r=await t.json().catch(()=>({error:`HTTP ${t.status}`}));if(!t.ok)throw Error(r.error??`HTTP ${t.status}`);I(e=>e+1)}catch(e){D(e instanceof Error?e.message:String(e))}finally{j(null)}},[i,e]);(0,v.useEffect)(()=>{if(!M)return;let e=e=>{e.key===`Escape`&&N(null)};return document.addEventListener(`keydown`,e),()=>document.removeEventListener(`keydown`,e)},[M]);let W=(0,v.useCallback)(async e=>{T(null),C(!0);try{let t=new FormData;t.append(`session_key`,n),t.append(`file`,e);let r=await fetch(`/api/admin/files/upload`,{method:`POST`,body:t}),i=await r.json().catch(()=>({error:`HTTP ${r.status}`}));if(!r.ok)throw Error(i.error??`HTTP ${r.status}`);a(i.path.split(`/`).slice(0,-1).join(`/`)||`.`),I(e=>e+1)}catch(e){T(e instanceof Error?e.message:String(e))}finally{C(!1),P.current&&(P.current.value=``)}},[n]);return(0,y.jsxs)(`section`,{className:`data-panel`,children:[(0,y.jsxs)(`div`,{className:`data-panel-heading`,children:[(0,y.jsx)(`h2`,{className:`data-panel-title`,children:`Files`}),(0,y.jsxs)(`div`,{className:`data-file-actions`,children:[(0,y.jsxs)(`button`,{type:`button`,className:`data-btn`,onClick:B,disabled:S,children:[S?(0,y.jsx)(d,{size:14,className:`spin`}):(0,y.jsx)(_,{size:14}),` Upload`]}),(0,y.jsx)(`input`,{type:`file`,ref:P,hidden:!0,onChange:e=>{let t=e.target.files?.[0];t&&W(t)}})]})]}),(0,y.jsxs)(`p`,{className:`data-panel-subtitle`,children:[`Everything under your install's `,(0,y.jsx)(`code`,{children:`data/`}),` directory. Click a folder to open it, a file to download it. Uploads go to `,(0,y.jsx)(`code`,{children:`data/uploads/`}),`.`]}),(0,y.jsxs)(`div`,{className:`data-breadcrumbs`,children:[(0,y.jsx)(`button`,{type:`button`,className:`data-crumb`,onClick:()=>L(`.`),children:`data`}),c.map((e,t)=>{let n=c.slice(0,t+1).map(e=>e.name).join(`/`);return(0,y.jsxs)(`span`,{className:`data-crumb-wrap`,children:[(0,y.jsx)(`span`,{className:`data-crumb-sep`,children:`/`}),(0,y.jsx)(`button`,{type:`button`,className:`data-crumb`,onClick:()=>L(n),title:e.name,children:e.displayName??e.name})]},n)}),i!==`.`&&(0,y.jsxs)(`button`,{type:`button`,className:`data-btn data-btn-ghost data-up-btn`,onClick:R,children:[(0,y.jsx)(p,{size:14}),` Up`]})]}),w&&(0,y.jsxs)(`div`,{className:`data-error`,children:[`Upload failed: `,w]}),E&&(0,y.jsxs)(`div`,{className:`data-error`,children:[`Delete failed: `,E]}),b&&(0,y.jsx)(`div`,{className:`data-error`,children:b}),u&&(0,y.jsxs)(`div`,{className:`data-loading`,children:[(0,y.jsx)(d,{size:14,className:`spin`}),` Loading…`]}),!u&&o&&o.length===0&&!b&&(0,y.jsx)(`div`,{className:`data-empty-results`,children:`Empty directory.`}),!u&&o&&o.length>0&&(0,y.jsx)(`ul`,{className:`data-entries`,children:o.map(e=>{let n=e.displayName??e.name,r=O===e.name,a=M===e.name;return(0,y.jsx)(`li`,{className:`data-entry`,children:e.kind===`directory`?(0,y.jsxs)(`button`,{type:`button`,className:`data-entry-btn`,onClick:()=>L(i===`.`?e.name:`${i}/${e.name}`),children:[(0,y.jsx)(g,{size:14}),(0,y.jsx)(`span`,{className:`data-entry-name`,title:e.name,children:n})]}):e.kind===`file`?(0,y.jsxs)(y.Fragment,{children:[(0,y.jsxs)(`button`,{type:`button`,className:`data-entry-btn`,onClick:()=>z(e),title:`Download ${n}`,disabled:a,children:[(0,y.jsx)(h,{size:14}),(0,y.jsx)(`span`,{className:`data-entry-name`,title:e.name,children:n}),(0,y.jsxs)(`span`,{className:`data-entry-meta`,title:`Modified ${A(e.modifiedAt)}`,children:[k(e.sizeBytes),` · `,A(e.modifiedAt)]}),(0,y.jsx)(m,{size:12,className:`data-entry-download-icon`})]}),a?(0,y.jsxs)(`div`,{className:`data-entry-confirm`,role:`group`,"aria-label":`Confirm delete ${n}`,children:[(0,y.jsx)(`span`,{className:`data-entry-confirm-label`,children:`Delete?`}),(0,y.jsx)(`button`,{type:`button`,className:`data-entry-confirm-yes`,onClick:()=>U(e),autoFocus:!0,children:`Yes`}),(0,y.jsx)(`button`,{type:`button`,className:`data-entry-confirm-no`,onClick:H,children:`No`})]}):(0,y.jsx)(`button`,{type:`button`,className:`data-entry-delete`,onClick:()=>V(e),disabled:r,title:`Delete ${n}`,"aria-label":`Delete ${n}`,children:r?(0,y.jsx)(d,{size:14,className:`spin`}):(0,y.jsx)(t,{size:14})})]}):(0,y.jsxs)(`div`,{className:`data-entry-btn data-entry-disabled`,children:[(0,y.jsx)(h,{size:14}),(0,y.jsx)(`span`,{className:`data-entry-name`,children:n}),(0,y.jsx)(`span`,{className:`data-entry-meta`,children:`special`})]})},e.name)})})]})}function k(e){return e==null?``:e<1024?`${e} B`:e<1024*1024?`${(e/1024).toFixed(1)} KB`:e<1024*1024*1024?`${(e/1024/1024).toFixed(1)} MB`:`${(e/1024/1024/1024).toFixed(1)} GB`}function A(e){try{let t=new Date(e);if(isNaN(t.getTime()))return`—`;let n=typeof navigator<`u`?navigator.languages&&navigator.languages.length>0?[...navigator.languages]:[navigator.language]:void 0;return t.toLocaleString(n,{dateStyle:`medium`,timeStyle:`short`})}catch{return`—`}}export{m as i,x as n,h as r,b as t};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{o as e}from"./chunk-DD-I1_y5.js";import{o as t,r as n}from"./jsx-runtime-DJER3a7U.js";var r=n(`database`,[[`ellipse`,{cx:`12`,cy:`5`,rx:`9`,ry:`3`,key:`msslwz`}],[`path`,{d:`M3 5V19A9 3 0 0 0 21 19V5`,key:`1wlel7`}],[`path`,{d:`M3 12A9 3 0 0 0 21 12`,key:`mv7ke4`}]]),i=n(`house`,[[`path`,{d:`M15 21v-8a1 1 0 0 0-1-1h-4a1 1 0 0 0-1 1v8`,key:`5wwlr5`}],[`path`,{d:`M3 10a2 2 0 0 1 .709-1.528l7-6a2 2 0 0 1 2.582 0l7 6A2 2 0 0 1 21 10v9a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2z`,key:`r6nss1`}]]),a=n(`loader-circle`,[[`path`,{d:`M21 12a9 9 0 1 1-6.219-8.56`,key:`13zald`}]]),o=n(`log-out`,[[`path`,{d:`m16 17 5-5-5-5`,key:`1bji2h`}],[`path`,{d:`M21 12H9`,key:`dn1m92`}],[`path`,{d:`M9 21H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h4`,key:`1uf3rs`}]]),s=n(`menu`,[[`path`,{d:`M4 5h16`,key:`1tepv9`}],[`path`,{d:`M4 12h16`,key:`1lakjw`}],[`path`,{d:`M4 19h16`,key:`1djgab`}]]),c=n(`search`,[[`path`,{d:`m21 21-4.34-4.34`,key:`14j7rj`}],[`circle`,{cx:`11`,cy:`11`,r:`8`,key:`4ej97u`}]]),l=n(`share-2`,[[`circle`,{cx:`18`,cy:`5`,r:`3`,key:`gq8acd`}],[`circle`,{cx:`6`,cy:`12`,r:`3`,key:`w7nqdw`}],[`circle`,{cx:`18`,cy:`19`,r:`3`,key:`1xt0gg`}],[`line`,{x1:`8.59`,x2:`15.42`,y1:`13.51`,y2:`17.49`,key:`47mynk`}],[`line`,{x1:`15.41`,x2:`8.59`,y1:`6.51`,y2:`10.49`,key:`1n3mei`}]]),u=`maxy-admin-session`,d=typeof BroadcastChannel<`u`;function f(e){if(typeof e!=`object`||!e)return!1;let t=e;return t.type===`rotation`&&typeof t.newKey==`string`&&t.newKey.length>0&&(t.surface===`chat`||t.surface===`graph`||t.surface===`data`)&&typeof t.ts==`number`}function p(e,t){if(!d){console.log(`[admin-session-broadcast] outcome=skipped reason=broadcastchannel-unavailable surface=${t}`);return}let n=new BroadcastChannel(u);try{let r={type:`rotation`,newKey:e,surface:t,ts:Date.now()};n.postMessage(r),console.log(`[admin-session-broadcast] outcome=sent newKey=${e.slice(0,8)} surface=${t}`)}finally{n.close()}}function m(e){if(!d)return()=>{};let t=new BroadcastChannel(u),n=t=>{if(!f(t.data)){console.warn(`[admin-session-broadcast] outcome=received-malformed payload=${JSON.stringify(t.data)}`);return}e(t.data)};return t.addEventListener(`message`,n),()=>{t.removeEventListener(`message`,n),t.close()}}var h=e(t(),1),g=`maxy-admin-session-key`;function _(e,t){return`${e}${e.includes(`?`)?`&`:`?`}session_key=${encodeURIComponent(t)}`}async function v(e){let t;try{t=await e.clone().json()}catch{return`parse-failed`}if(typeof t!=`object`||!t)return`unknown-401`;let n=t.code;return n===`session-missing`||n===`session-not-registered`||n===`session-expired-age`||n===`grant-expired`?n:`unknown-401`}function y(){try{return sessionStorage.getItem(g)}catch{return null}}function b(e){let{initialSessionKey:t,surface:n}=e,[r,i]=(0,h.useState)(t),a=(0,h.useRef)(t);(0,h.useEffect)(()=>{a.current=r},[r]),(0,h.useEffect)(()=>{t!==a.current&&(i(t),a.current=t,s(e=>e+1))},[t]);let[o,s]=(0,h.useState)(0),[c,l]=(0,h.useState)(null);(0,h.useEffect)(()=>m(e=>{let t=a.current.slice(0,8),r=e.newKey.slice(0,8);e.newKey!==a.current&&(console.log(`[admin-session-broadcast] outcome=received oldKey=${t} newKey=${r} surface=${n} senderSurface=${e.surface}`),i(e.newKey),s(e=>e+1),l(null))}),[n]);let u=(0,h.useCallback)(()=>{try{sessionStorage.removeItem(g)}catch{}window.location.href=`/`},[]);return{adminFetch:(0,h.useCallback)(async(e,t)=>{let r=a.current,o=_(e,r),c=await fetch(o,t);if(c.status!==401)return c;let d=await v(c);if(d===`session-missing`)return console.warn(`[useAdminFetch] outcome=redirect-to-login reason=${d} surface=${n} path=${e}`),u(),c;if(d!==`session-not-registered`)return console.warn(`[useAdminFetch] outcome=redirect-to-login reason=${d} surface=${n} path=${e}`),l({message:`Your admin session has expired. Click to reload and sign in.`,reason:d}),c;let f=y();if(!f||f===r)return console.warn(`[useAdminFetch] outcome=redirect-to-login reason=session-not-registered-no-fresh-key surface=${n} path=${e}`),l({message:`Your admin session was renewed in another tab. Click to reload.`,reason:`session-not-registered`}),c;i(f),a.current=f,s(e=>e+1),console.log(`[useAdminFetch] outcome=retry-after-rotation oldKey=${r.slice(0,8)} newKey=${f.slice(0,8)} surface=${n} path=${e}`);let p=_(e,f),m=await fetch(p,t);return m.status===401&&(console.warn(`[useAdminFetch] outcome=redirect-to-login reason=second-401-after-retry surface=${n} path=${e}`),l({message:`Your admin session has expired. Click to reload and sign in.`,reason:`session-not-registered`})),m},[u,n]),sessionKey:r,sessionRefetchNonce:o,banner:c,reloadToLogin:u}}export{s as a,i as c,c as i,r as l,p as n,o,l as r,a as s,b as t};
|
|
@@ -5,11 +5,11 @@
|
|
|
5
5
|
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
|
6
6
|
<title>Data — Maxy</title>
|
|
7
7
|
<link rel="icon" href="/favicon.ico">
|
|
8
|
-
<script type="module" crossorigin src="/assets/data-
|
|
8
|
+
<script type="module" crossorigin src="/assets/data-BvV94XHO.js"></script>
|
|
9
9
|
<link rel="modulepreload" crossorigin href="/assets/chunk-DD-I1_y5.js">
|
|
10
10
|
<link rel="modulepreload" crossorigin href="/assets/jsx-runtime-DJER3a7U.js">
|
|
11
|
-
<link rel="modulepreload" crossorigin href="/assets/
|
|
12
|
-
<link rel="modulepreload" crossorigin href="/assets/page-
|
|
11
|
+
<link rel="modulepreload" crossorigin href="/assets/useAdminFetch-iYCQ9lT0.js">
|
|
12
|
+
<link rel="modulepreload" crossorigin href="/assets/page-DM19J3ur.js">
|
|
13
13
|
<link rel="stylesheet" crossorigin href="/assets/jsx-runtime-foO6ZMix.css">
|
|
14
14
|
</head>
|
|
15
15
|
<body>
|
|
@@ -5,12 +5,12 @@
|
|
|
5
5
|
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
|
6
6
|
<title>Graph — Maxy</title>
|
|
7
7
|
<link rel="icon" href="/favicon.ico">
|
|
8
|
-
<script type="module" crossorigin src="/assets/graph-
|
|
8
|
+
<script type="module" crossorigin src="/assets/graph-CBu0rtrP.js"></script>
|
|
9
9
|
<link rel="modulepreload" crossorigin href="/assets/chunk-DD-I1_y5.js">
|
|
10
10
|
<link rel="modulepreload" crossorigin href="/assets/jsx-runtime-DJER3a7U.js">
|
|
11
11
|
<link rel="modulepreload" crossorigin href="/assets/Checkbox-BruL6MSR.js">
|
|
12
|
-
<link rel="modulepreload" crossorigin href="/assets/
|
|
13
|
-
<link rel="modulepreload" crossorigin href="/assets/page-
|
|
12
|
+
<link rel="modulepreload" crossorigin href="/assets/useAdminFetch-iYCQ9lT0.js">
|
|
13
|
+
<link rel="modulepreload" crossorigin href="/assets/page-BNM63zsb.js">
|
|
14
14
|
<link rel="stylesheet" crossorigin href="/assets/jsx-runtime-foO6ZMix.css">
|
|
15
15
|
</head>
|
|
16
16
|
<body>
|
|
@@ -5,15 +5,15 @@
|
|
|
5
5
|
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
|
6
6
|
<title>Real Agent</title>
|
|
7
7
|
<link rel="icon" href="/favicon.ico">
|
|
8
|
-
<script type="module" crossorigin src="/assets/admin-
|
|
8
|
+
<script type="module" crossorigin src="/assets/admin-C0lKk6WM.js"></script>
|
|
9
9
|
<link rel="modulepreload" crossorigin href="/assets/chunk-DD-I1_y5.js">
|
|
10
10
|
<link rel="modulepreload" crossorigin href="/assets/jsx-runtime-DJER3a7U.js">
|
|
11
11
|
<link rel="modulepreload" crossorigin href="/assets/preload-helper-qlgyTAkD.js">
|
|
12
12
|
<link rel="modulepreload" crossorigin href="/assets/Checkbox-BruL6MSR.js">
|
|
13
13
|
<link rel="modulepreload" crossorigin href="/assets/useVoiceRecorder-D_8P7xJU.js">
|
|
14
|
-
<link rel="modulepreload" crossorigin href="/assets/
|
|
15
|
-
<link rel="modulepreload" crossorigin href="/assets/page-
|
|
16
|
-
<link rel="modulepreload" crossorigin href="/assets/page-
|
|
14
|
+
<link rel="modulepreload" crossorigin href="/assets/useAdminFetch-iYCQ9lT0.js">
|
|
15
|
+
<link rel="modulepreload" crossorigin href="/assets/page-DM19J3ur.js">
|
|
16
|
+
<link rel="modulepreload" crossorigin href="/assets/page-BNM63zsb.js">
|
|
17
17
|
<link rel="stylesheet" crossorigin href="/assets/jsx-runtime-foO6ZMix.css">
|
|
18
18
|
<link rel="stylesheet" crossorigin href="/assets/admin-CWMpccrR.css">
|
|
19
19
|
<link rel="stylesheet" href="/brand-defaults.css">
|