@rubytech/create-realagent 1.0.813 → 1.0.815

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 (34) hide show
  1. package/package.json +1 -1
  2. package/payload/platform/lib/graph-search/dist/index.d.ts +12 -0
  3. package/payload/platform/lib/graph-search/dist/index.d.ts.map +1 -1
  4. package/payload/platform/lib/graph-search/dist/index.js +17 -1
  5. package/payload/platform/lib/graph-search/dist/index.js.map +1 -1
  6. package/payload/platform/lib/graph-search/src/__tests__/hybrid.test.ts +72 -0
  7. package/payload/platform/lib/graph-search/src/index.ts +29 -1
  8. package/payload/platform/plugins/admin/skills/onboarding/SKILL.md +2 -0
  9. package/payload/platform/plugins/docs/references/cloudflare.md +2 -0
  10. package/payload/platform/plugins/docs/references/platform.md +2 -0
  11. package/payload/server/chunk-42BMMSRN.js +10066 -0
  12. package/payload/server/chunk-52LIWKMM.js +1032 -0
  13. package/payload/server/client-pool-AIYWSJBR.js +31 -0
  14. package/payload/server/maxy-edge.js +2 -2
  15. package/payload/server/public/assets/{Checkbox-L-AVlzpu.js → Checkbox-DZxF6s72.js} +1 -1
  16. package/payload/server/public/assets/admin-CTb65MiO.js +352 -0
  17. package/payload/server/public/assets/data-BO12TydY.js +1 -0
  18. package/payload/server/public/assets/graph-XIePTyWQ.js +1 -0
  19. package/payload/server/public/assets/{jsx-runtime-B4OPP5PQ.css → jsx-runtime-Cb4WEnIV.css} +1 -1
  20. package/payload/server/public/assets/page-BLanFGXC.js +1 -0
  21. package/payload/server/public/assets/{page-CGTUVIDm.js → page-DuwlF8N5.js} +2 -2
  22. package/payload/server/public/assets/{public-BLPUQVy7.js → public-BqeUfasT.js} +1 -1
  23. package/payload/server/public/assets/{useAdminFetch-zpmdQvyy.js → useAdminFetch-DLGqK3Fs.js} +1 -1
  24. package/payload/server/public/assets/{useVoiceRecorder-18dZkZGR.js → useVoiceRecorder-CHPkBGVV.js} +1 -1
  25. package/payload/server/public/data.html +5 -5
  26. package/payload/server/public/graph.html +6 -6
  27. package/payload/server/public/index.html +8 -8
  28. package/payload/server/public/public.html +5 -5
  29. package/payload/server/server.js +82 -5
  30. package/payload/server/public/assets/admin-D_1VXUmN.js +0 -352
  31. package/payload/server/public/assets/data-qc5_bVVg.js +0 -1
  32. package/payload/server/public/assets/graph-Dy65Y3T3.js +0 -1
  33. package/payload/server/public/assets/page-sZ6T4GwW.js +0 -1
  34. /package/payload/server/public/assets/{jsx-runtime-DOYWvSKw.js → jsx-runtime-BZMOvG0f.js} +0 -0
@@ -1 +0,0 @@
1
- import{i as e,t}from"./jsx-runtime-DOYWvSKw.js";import{t as n}from"./page-sZ6T4GwW.js";import"./useAdminFetch-zpmdQvyy.js";var r=e(),i=t();(0,r.createRoot)(document.getElementById(`root`)).render((0,i.jsx)(n,{}));
@@ -1 +0,0 @@
1
- import{i as e,t}from"./jsx-runtime-DOYWvSKw.js";import{n}from"./page-CGTUVIDm.js";import"./useAdminFetch-zpmdQvyy.js";import"./Checkbox-L-AVlzpu.js";var r=e(),i=t();(0,r.createRoot)(document.getElementById(`root`)).render((0,i.jsx)(n,{}));
@@ -1 +0,0 @@
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-DOYWvSKw.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-zpmdQvyy.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)}&labels=*&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};