@rubytech/create-maxy 1.0.795 → 1.0.796
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/plugins/docs/references/internals.md +4 -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/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/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-StzFnTQB.js +352 -0
- package/payload/server/public/assets/data-BvV94XHO.js +1 -0
- package/payload/server/public/assets/graph-BOKpKqLw.js +1 -0
- package/payload/server/public/assets/page-DItB4skl.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 +22 -12
- 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-BOKpKqLw.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-DItB4skl.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>Maxy</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-StzFnTQB.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-DItB4skl.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">
|
package/payload/server/server.js
CHANGED
|
@@ -49,14 +49,12 @@ import {
|
|
|
49
49
|
vncLog,
|
|
50
50
|
waitForExit,
|
|
51
51
|
writeChromiumWrapper
|
|
52
|
-
} from "./chunk-
|
|
52
|
+
} from "./chunk-KM23Y7SY.js";
|
|
53
53
|
import {
|
|
54
54
|
ACCOUNTS_DIR,
|
|
55
55
|
GREETING_DIRECTIVE,
|
|
56
56
|
HAIKU_MODEL,
|
|
57
57
|
PLATFORM_ROOT,
|
|
58
|
-
__commonJS,
|
|
59
|
-
__toESM,
|
|
60
58
|
agentLogStream,
|
|
61
59
|
backfillNullUserIdConversations,
|
|
62
60
|
bindVisitorToGroup,
|
|
@@ -103,6 +101,7 @@ import {
|
|
|
103
101
|
resolveAgentConfig,
|
|
104
102
|
resolveDefaultAgentSlug,
|
|
105
103
|
resolveUserAccounts,
|
|
104
|
+
runBootMigrations,
|
|
106
105
|
setAgentSessionId,
|
|
107
106
|
setConversationIdForSession,
|
|
108
107
|
setGroupContextForSession,
|
|
@@ -113,7 +112,11 @@ import {
|
|
|
113
112
|
verifyAndGetConversationUpdatedAt,
|
|
114
113
|
verifyConversationOwnership,
|
|
115
114
|
writeAdminUserAndPerson
|
|
116
|
-
} from "./chunk-
|
|
115
|
+
} from "./chunk-BURNRCKP.js";
|
|
116
|
+
import {
|
|
117
|
+
__commonJS,
|
|
118
|
+
__toESM
|
|
119
|
+
} from "./chunk-JSBRDJBE.js";
|
|
117
120
|
|
|
118
121
|
// ../lib/graph-trash/dist/index.js
|
|
119
122
|
var require_dist = __commonJS({
|
|
@@ -4726,7 +4729,7 @@ app2.post("/", async (c) => {
|
|
|
4726
4729
|
}
|
|
4727
4730
|
const cookieHeader = c.req.header("cookie");
|
|
4728
4731
|
if (body.session_key && typeof body.session_key === "string") {
|
|
4729
|
-
if (validateSession(body.session_key, "public")) {
|
|
4732
|
+
if (validateSession(body.session_key, "public").ok) {
|
|
4730
4733
|
const storedAgent = getAgentNameForSession(body.session_key);
|
|
4731
4734
|
if (storedAgent && storedAgent !== agentSlug) {
|
|
4732
4735
|
console.log(`[session] hot-resume agent mismatch: session=${body.session_key.slice(0, 8)}\u2026 has=${storedAgent} requested=${agentSlug} \u2014 creating new session`);
|
|
@@ -5414,7 +5417,7 @@ app3.post("/", async (c) => {
|
|
|
5414
5417
|
if (!session_key) {
|
|
5415
5418
|
return c.json({ error: "session_key required" }, 400);
|
|
5416
5419
|
}
|
|
5417
|
-
if (!validateSession(session_key, "public")) {
|
|
5420
|
+
if (!validateSession(session_key, "public").ok) {
|
|
5418
5421
|
return c.json({ error: "Invalid or expired session" }, 401);
|
|
5419
5422
|
}
|
|
5420
5423
|
const files = formData.getAll("attachments");
|
|
@@ -5483,7 +5486,7 @@ app3.post("/", async (c) => {
|
|
|
5483
5486
|
if (!message) {
|
|
5484
5487
|
return c.json({ error: "message required" }, 400);
|
|
5485
5488
|
}
|
|
5486
|
-
if (!validateSession(session_key, "public")) {
|
|
5489
|
+
if (!validateSession(session_key, "public").ok) {
|
|
5487
5490
|
return c.json({ error: "Invalid or expired session" }, 401);
|
|
5488
5491
|
}
|
|
5489
5492
|
}
|
|
@@ -5623,7 +5626,7 @@ app4.get("/messages", async (c) => {
|
|
|
5623
5626
|
if (isNaN(sinceDate.getTime())) {
|
|
5624
5627
|
return c.json({ error: "Invalid since parameter \u2014 expected ISO 8601" }, 400);
|
|
5625
5628
|
}
|
|
5626
|
-
if (!validateSession(sessionKey, "public")) {
|
|
5629
|
+
if (!validateSession(sessionKey, "public").ok) {
|
|
5627
5630
|
return c.json({ error: "Session expired" }, 401);
|
|
5628
5631
|
}
|
|
5629
5632
|
const groupSlug = getGroupSlugForSession(sessionKey);
|
|
@@ -6247,7 +6250,7 @@ app5.post("/create-credentials", async (c) => {
|
|
|
6247
6250
|
const { session_key, password } = body;
|
|
6248
6251
|
if (!session_key || typeof session_key !== "string") return c.json({ error: "session_key required" }, 400);
|
|
6249
6252
|
if (!password || typeof password !== "string") return c.json({ error: "password required" }, 400);
|
|
6250
|
-
if (!validateSession(session_key, "public")) {
|
|
6253
|
+
if (!validateSession(session_key, "public").ok) {
|
|
6251
6254
|
return c.json({ error: "Invalid or expired session" }, 401);
|
|
6252
6255
|
}
|
|
6253
6256
|
const grant = getGrantForSession(session_key);
|
|
@@ -7813,7 +7816,7 @@ async function createAdminSession(accountId, thinkingView, userId, userName, rol
|
|
|
7813
7816
|
var app10 = new Hono();
|
|
7814
7817
|
app10.get("/", async (c) => {
|
|
7815
7818
|
const sessionKey = c.req.query("session_key");
|
|
7816
|
-
if (!sessionKey || !validateSession(sessionKey, "admin")) {
|
|
7819
|
+
if (!sessionKey || !validateSession(sessionKey, "admin").ok) {
|
|
7817
7820
|
return c.json({ error: "Invalid or expired admin session" }, 401);
|
|
7818
7821
|
}
|
|
7819
7822
|
const accountId = getAccountIdForSession(sessionKey);
|
|
@@ -8210,7 +8213,7 @@ var app11 = new Hono();
|
|
|
8210
8213
|
app11.post("/cancel", requireAdminSession, async (c) => {
|
|
8211
8214
|
const session_key = c.var.sessionKey;
|
|
8212
8215
|
try {
|
|
8213
|
-
const { interruptClient: interruptClient2 } = await import("./client-pool-
|
|
8216
|
+
const { interruptClient: interruptClient2 } = await import("./client-pool-PV45NUTN.js");
|
|
8214
8217
|
await interruptClient2(session_key);
|
|
8215
8218
|
return c.json({ ok: true });
|
|
8216
8219
|
} catch (err) {
|
|
@@ -12538,7 +12541,7 @@ app35.post("/api/remote-auth/set-password", async (c) => {
|
|
|
12538
12541
|
} catch {
|
|
12539
12542
|
return c.json({ error: "Invalid request" }, 400);
|
|
12540
12543
|
}
|
|
12541
|
-
if (!body.session_key || !validateSession(body.session_key, "admin")) {
|
|
12544
|
+
if (!body.session_key || !validateSession(body.session_key, "admin").ok) {
|
|
12542
12545
|
return c.json({ error: "Unauthorized" }, 401);
|
|
12543
12546
|
}
|
|
12544
12547
|
if (!body.password) {
|
|
@@ -12953,6 +12956,13 @@ try {
|
|
|
12953
12956
|
console.error(`[session] backfill startup failed: ${err instanceof Error ? err.message : String(err)}`);
|
|
12954
12957
|
}
|
|
12955
12958
|
})();
|
|
12959
|
+
(async () => {
|
|
12960
|
+
try {
|
|
12961
|
+
await runBootMigrations();
|
|
12962
|
+
} catch (err) {
|
|
12963
|
+
console.error(`[migration] runBootMigrations rejected: ${err instanceof Error ? err.message : String(err)}`);
|
|
12964
|
+
}
|
|
12965
|
+
})();
|
|
12956
12966
|
(async () => {
|
|
12957
12967
|
try {
|
|
12958
12968
|
await startReviewDetector();
|