@rubytech/create-maxy 1.0.716 → 1.0.718
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/lib/graph-search/src/__tests__/fulltext-coverage.test.ts +5 -0
- package/payload/platform/neo4j/schema.cypher +6 -2
- package/payload/platform/plugins/docs/references/graph.md +8 -0
- package/payload/platform/plugins/linkedin-import/skills/linkedin-import/references/connections.md +3 -1
- package/payload/platform/plugins/memory/mcp/dist/tools/__tests__/memory-archive-write.test.d.ts +2 -0
- package/payload/platform/plugins/memory/mcp/dist/tools/__tests__/memory-archive-write.test.d.ts.map +1 -0
- package/payload/platform/plugins/memory/mcp/dist/tools/__tests__/memory-archive-write.test.js +66 -0
- package/payload/platform/plugins/memory/mcp/dist/tools/__tests__/memory-archive-write.test.js.map +1 -0
- package/payload/platform/plugins/memory/mcp/dist/tools/memory-archive-write.d.ts +2 -0
- 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 +24 -5
- package/payload/platform/plugins/memory/mcp/dist/tools/memory-archive-write.js.map +1 -1
- package/payload/platform/plugins/memory/mcp/package.json +4 -2
- package/payload/platform/plugins/memory/mcp/vitest.config.ts +15 -0
- package/payload/server/public/assets/{Checkbox-DzNre1pt.js → Checkbox-B27PGbJv.js} +1 -1
- package/payload/server/public/assets/{admin-BtlXk1uc.js → admin-yP0pMsyg.js} +1 -1
- package/payload/server/public/assets/{data-BTKZGy84.js → data-BjvXXGwS.js} +1 -1
- package/payload/server/public/assets/{file-DTW7TZ7G.js → file-BiJ8_BAu.js} +1 -1
- package/payload/server/public/assets/graph-DhNy70eS.js +50 -0
- package/payload/server/public/assets/{house-DKctRD9t.js → house-LA8c3EDI.js} +1 -1
- package/payload/server/public/assets/{jsx-runtime-97_Z_wBZ.css → jsx-runtime-ZGLWRuk_.css} +1 -1
- package/payload/server/public/assets/{public-CYQSF6Xf.js → public-MQEVLEBN.js} +1 -1
- package/payload/server/public/assets/{share-2--beVI26B.js → share-2-Dnzn5HkU.js} +1 -1
- package/payload/server/public/assets/{useVoiceRecorder-CACPhPdW.js → useVoiceRecorder-CBEZM7Sh.js} +1 -1
- package/payload/server/public/assets/{x-DGk8kvbj.js → x-CEAmP595.js} +1 -1
- package/payload/server/public/data.html +6 -6
- package/payload/server/public/graph.html +7 -7
- package/payload/server/public/index.html +8 -8
- package/payload/server/public/public.html +5 -5
- package/payload/server/server.js +134 -6
- package/payload/server/public/assets/graph-CkcuUDtA.js +0 -50
- /package/payload/server/public/assets/{jsx-runtime-C-H-0vwA.js → jsx-runtime-BkCc5_JK.js} +0 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as e}from"./jsx-runtime-
|
|
1
|
+
import{r as e}from"./jsx-runtime-BkCc5_JK.js";var t=e(`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`}]]),n=e(`loader-circle`,[[`path`,{d:`M21 12a9 9 0 1 1-6.219-8.56`,key:`13zald`}]]),r=e(`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`}]]),i=e(`menu`,[[`path`,{d:`M4 5h16`,key:`1tepv9`}],[`path`,{d:`M4 12h16`,key:`1lakjw`}],[`path`,{d:`M4 19h16`,key:`1djgab`}]]),a=e(`search`,[[`path`,{d:`m21 21-4.34-4.34`,key:`14j7rj`}],[`circle`,{cx:`11`,cy:`11`,r:`8`,key:`4ej97u`}]]),o=e(`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`}]]);export{n as a,r as i,a as n,t as o,i as r,o as t};
|
package/payload/server/public/assets/{useVoiceRecorder-CACPhPdW.js → useVoiceRecorder-CBEZM7Sh.js}
RENAMED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/mermaid.core-C3TZA9fX.js","assets/preload-helper-BEFjQwLd.js","assets/dist-BKbAaes5.js","assets/chunk-DD-I1_y5.js","assets/chunk-U2HBQHQK-BLgNHWFf.js","assets/src-BvrHnOMG.js","assets/chunk-5PVQY5BW-CLNppenz.js","assets/chunk-ICPOFSXX-DEZT2XyQ.js","assets/_baseFor-WfS9pKAn.js","assets/isEmpty-C3Vxk1It.js","assets/chunk-336JU56O-Dszn2qEY.js","assets/chunk-5FUZZQ4R-CXZykYh_.js","assets/chunk-X2U36JSP-DHYLiYqc.js","assets/chunk-ZZ45TVLE-B5dCmOpH.js","assets/rough.esm-HAx67Hnb.js","assets/chunk-ENJZ2VHE-CuXW3Isg.js","assets/line-BhOwLD_o.js","assets/path-YdFzr2W6.js","assets/array-HeX70jSN.js","assets/chunk-BSJP7CBP-Cd9H-V61.js","assets/chunk-426QAEUC-tWQOa3-I.js","assets/chunk-XPW4576I-DBdiQ3Zy.js"])))=>i.map(i=>d[i]);
|
|
2
|
-
import{o as e,r as t,t as n}from"./chunk-DD-I1_y5.js";import{n as r,o as i,r as a,t as o}from"./jsx-runtime-
|
|
2
|
+
import{o as e,r as t,t as n}from"./chunk-DD-I1_y5.js";import{n as r,o as i,r as a,t as o}from"./jsx-runtime-BkCc5_JK.js";import{t as s}from"./Checkbox-B27PGbJv.js";import{t as c}from"./preload-helper-BEFjQwLd.js";var l=a(`check`,[[`path`,{d:`M20 6 9 17l-5-5`,key:`1gmf2c`}]]),u=a(`chevron-down`,[[`path`,{d:`m6 9 6 6 6-6`,key:`qrunsl`}]]),d=a(`copy`,[[`rect`,{width:`14`,height:`14`,x:`8`,y:`8`,rx:`2`,ry:`2`,key:`17jyea`}],[`path`,{d:`M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2`,key:`zix9uf`}]]),f=a(`file-code`,[[`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`}],[`path`,{d:`M10 12.5 8 15l2 2.5`,key:`1tg20x`}],[`path`,{d:`m14 12.5 2 2.5-2 2.5`,key:`yinavb`}]]),p=a(`file-text`,[[`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`}],[`path`,{d:`M10 9H8`,key:`b1mrlr`}],[`path`,{d:`M16 13H8`,key:`t4e002`}],[`path`,{d:`M16 17H8`,key:`z1uh3a`}]]),m=a(`globe`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`M12 2a14.5 14.5 0 0 0 0 20 14.5 14.5 0 0 0 0-20`,key:`13o1zl`}],[`path`,{d:`M2 12h20`,key:`9i4pu4`}]]),h=a(`mic`,[[`path`,{d:`M12 19v3`,key:`npa21l`}],[`path`,{d:`M19 10v2a7 7 0 0 1-14 0v-2`,key:`1vc78b`}],[`rect`,{x:`9`,y:`2`,width:`6`,height:`13`,rx:`3`,key:`s6n7sd`}]]),g=a(`paperclip`,[[`path`,{d:`m16 6-8.414 8.586a2 2 0 0 0 2.829 2.829l8.414-8.586a4 4 0 1 0-5.657-5.657l-8.379 8.551a6 6 0 1 0 8.485 8.485l8.379-8.551`,key:`1miecu`}]]),_=a(`pause`,[[`rect`,{x:`14`,y:`3`,width:`5`,height:`18`,rx:`1`,key:`kaeet6`}],[`rect`,{x:`5`,y:`3`,width:`5`,height:`18`,rx:`1`,key:`1wsw3u`}]]),v=a(`play`,[[`path`,{d:`M5 5a2 2 0 0 1 3.008-1.728l11.997 6.998a2 2 0 0 1 .003 3.458l-12 7A2 2 0 0 1 5 19z`,key:`10ikf1`}]]),y=a(`square-check-big`,[[`path`,{d:`M21 10.656V19a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h12.344`,key:`2acyp4`}],[`path`,{d:`m9 11 3 3L22 4`,key:`1pflzl`}]]),b=a(`triangle-alert`,[[`path`,{d:`m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3`,key:`wmoenq`}],[`path`,{d:`M12 9v4`,key:`juzpu7`}],[`path`,{d:`M12 17h.01`,key:`p32p05`}]]),x=e(i(),1);async function S(e){if(navigator.clipboard)try{return await navigator.clipboard.writeText(e),!0}catch{}try{let t=document.createElement(`textarea`);t.value=e,t.style.position=`fixed`,t.style.opacity=`0`,document.body.appendChild(t),t.select();let n=document.execCommand(`copy`);return document.body.removeChild(t),n}catch{return!1}}function C(){let[e,t]=(0,x.useState)(!1),[n,r]=(0,x.useState)(new Set),[i,a]=(0,x.useState)(!1),o=(0,x.useRef)(null);(0,x.useEffect)(()=>()=>{o.current!==null&&clearTimeout(o.current)},[]);let s=(0,x.useCallback)(()=>{t(!0),r(new Set)},[]),c=(0,x.useCallback)(()=>{t(!1),r(new Set)},[]),l=(0,x.useCallback)(e=>{r(t=>{let n=new Set(t);return n.has(e)?n.delete(e):n.add(e),n})},[]),u=(0,x.useCallback)(e=>{e.length!==0&&r(t=>e.every(e=>t.has(e))?new Set:new Set(e))},[]),d=(0,x.useCallback)(()=>{o.current!==null&&(clearTimeout(o.current),o.current=null)},[]),f=(0,x.useCallback)(e=>({onPointerDown:()=>{o.current=setTimeout(()=>{t(!0),r(new Set([e])),o.current=null},500)},onPointerUp:d,onPointerLeave:d,onPointerCancel:d}),[d]),p=(0,x.useCallback)(e=>{a(e?`copied`:`failed`),setTimeout(()=>a(!1),1500)},[]);return{selectionMode:e,selectedItems:n,copyToast:i,longPressProps:f,enterSelection:s,exitSelection:c,toggleSelectItem:l,selectAll:u,copySelected:(0,x.useCallback)(async(e,t)=>{let r=[...n].sort(t).map(t=>e(t)).filter(Boolean);r.length>0&&p(await S(r.join(`
|
|
3
3
|
|
|
4
4
|
---
|
|
5
5
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as e}from"./jsx-runtime-
|
|
1
|
+
import{r as e}from"./jsx-runtime-BkCc5_JK.js";var t=e(`rotate-ccw`,[[`path`,{d:`M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8`,key:`1357e3`}],[`path`,{d:`M3 3v5h5`,key:`1xhq8a`}]]),n=e(`x`,[[`path`,{d:`M18 6 6 18`,key:`1bl5f8`}],[`path`,{d:`m6 6 12 12`,key:`d8bk6v`}]]);export{t as n,n as t};
|
|
@@ -5,13 +5,13 @@
|
|
|
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-BjvXXGwS.js"></script>
|
|
9
9
|
<link rel="modulepreload" crossorigin href="/assets/chunk-DD-I1_y5.js">
|
|
10
|
-
<link rel="modulepreload" crossorigin href="/assets/jsx-runtime-
|
|
11
|
-
<link rel="modulepreload" crossorigin href="/assets/share-2
|
|
12
|
-
<link rel="modulepreload" crossorigin href="/assets/file-
|
|
13
|
-
<link rel="modulepreload" crossorigin href="/assets/house-
|
|
14
|
-
<link rel="stylesheet" crossorigin href="/assets/jsx-runtime-
|
|
10
|
+
<link rel="modulepreload" crossorigin href="/assets/jsx-runtime-BkCc5_JK.js">
|
|
11
|
+
<link rel="modulepreload" crossorigin href="/assets/share-2-Dnzn5HkU.js">
|
|
12
|
+
<link rel="modulepreload" crossorigin href="/assets/file-BiJ8_BAu.js">
|
|
13
|
+
<link rel="modulepreload" crossorigin href="/assets/house-LA8c3EDI.js">
|
|
14
|
+
<link rel="stylesheet" crossorigin href="/assets/jsx-runtime-ZGLWRuk_.css">
|
|
15
15
|
</head>
|
|
16
16
|
<body>
|
|
17
17
|
<div id="root"></div>
|
|
@@ -5,14 +5,14 @@
|
|
|
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-DhNy70eS.js"></script>
|
|
9
9
|
<link rel="modulepreload" crossorigin href="/assets/chunk-DD-I1_y5.js">
|
|
10
|
-
<link rel="modulepreload" crossorigin href="/assets/jsx-runtime-
|
|
11
|
-
<link rel="modulepreload" crossorigin href="/assets/Checkbox-
|
|
12
|
-
<link rel="modulepreload" crossorigin href="/assets/share-2
|
|
13
|
-
<link rel="modulepreload" crossorigin href="/assets/house-
|
|
14
|
-
<link rel="modulepreload" crossorigin href="/assets/x-
|
|
15
|
-
<link rel="stylesheet" crossorigin href="/assets/jsx-runtime-
|
|
10
|
+
<link rel="modulepreload" crossorigin href="/assets/jsx-runtime-BkCc5_JK.js">
|
|
11
|
+
<link rel="modulepreload" crossorigin href="/assets/Checkbox-B27PGbJv.js">
|
|
12
|
+
<link rel="modulepreload" crossorigin href="/assets/share-2-Dnzn5HkU.js">
|
|
13
|
+
<link rel="modulepreload" crossorigin href="/assets/house-LA8c3EDI.js">
|
|
14
|
+
<link rel="modulepreload" crossorigin href="/assets/x-CEAmP595.js">
|
|
15
|
+
<link rel="stylesheet" crossorigin href="/assets/jsx-runtime-ZGLWRuk_.css">
|
|
16
16
|
</head>
|
|
17
17
|
<body>
|
|
18
18
|
<div id="root"></div>
|
|
@@ -5,16 +5,16 @@
|
|
|
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-yP0pMsyg.js"></script>
|
|
9
9
|
<link rel="modulepreload" crossorigin href="/assets/chunk-DD-I1_y5.js">
|
|
10
|
-
<link rel="modulepreload" crossorigin href="/assets/jsx-runtime-
|
|
10
|
+
<link rel="modulepreload" crossorigin href="/assets/jsx-runtime-BkCc5_JK.js">
|
|
11
11
|
<link rel="modulepreload" crossorigin href="/assets/preload-helper-BEFjQwLd.js">
|
|
12
|
-
<link rel="modulepreload" crossorigin href="/assets/Checkbox-
|
|
13
|
-
<link rel="modulepreload" crossorigin href="/assets/useVoiceRecorder-
|
|
14
|
-
<link rel="modulepreload" crossorigin href="/assets/share-2
|
|
15
|
-
<link rel="modulepreload" crossorigin href="/assets/file-
|
|
16
|
-
<link rel="modulepreload" crossorigin href="/assets/x-
|
|
17
|
-
<link rel="stylesheet" crossorigin href="/assets/jsx-runtime-
|
|
12
|
+
<link rel="modulepreload" crossorigin href="/assets/Checkbox-B27PGbJv.js">
|
|
13
|
+
<link rel="modulepreload" crossorigin href="/assets/useVoiceRecorder-CBEZM7Sh.js">
|
|
14
|
+
<link rel="modulepreload" crossorigin href="/assets/share-2-Dnzn5HkU.js">
|
|
15
|
+
<link rel="modulepreload" crossorigin href="/assets/file-BiJ8_BAu.js">
|
|
16
|
+
<link rel="modulepreload" crossorigin href="/assets/x-CEAmP595.js">
|
|
17
|
+
<link rel="stylesheet" crossorigin href="/assets/jsx-runtime-ZGLWRuk_.css">
|
|
18
18
|
<link rel="stylesheet" href="/brand-defaults.css">
|
|
19
19
|
</head>
|
|
20
20
|
<body>
|
|
@@ -5,13 +5,13 @@
|
|
|
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/public-
|
|
8
|
+
<script type="module" crossorigin src="/assets/public-MQEVLEBN.js"></script>
|
|
9
9
|
<link rel="modulepreload" crossorigin href="/assets/chunk-DD-I1_y5.js">
|
|
10
|
-
<link rel="modulepreload" crossorigin href="/assets/jsx-runtime-
|
|
10
|
+
<link rel="modulepreload" crossorigin href="/assets/jsx-runtime-BkCc5_JK.js">
|
|
11
11
|
<link rel="modulepreload" crossorigin href="/assets/preload-helper-BEFjQwLd.js">
|
|
12
|
-
<link rel="modulepreload" crossorigin href="/assets/Checkbox-
|
|
13
|
-
<link rel="modulepreload" crossorigin href="/assets/useVoiceRecorder-
|
|
14
|
-
<link rel="stylesheet" crossorigin href="/assets/jsx-runtime-
|
|
12
|
+
<link rel="modulepreload" crossorigin href="/assets/Checkbox-B27PGbJv.js">
|
|
13
|
+
<link rel="modulepreload" crossorigin href="/assets/useVoiceRecorder-CBEZM7Sh.js">
|
|
14
|
+
<link rel="stylesheet" crossorigin href="/assets/jsx-runtime-ZGLWRuk_.css">
|
|
15
15
|
<link rel="stylesheet" href="/brand-defaults.css">
|
|
16
16
|
</head>
|
|
17
17
|
<body>
|
package/payload/server/server.js
CHANGED
|
@@ -10731,7 +10731,7 @@ async function handleDefault(c, accountId) {
|
|
|
10731
10731
|
const warnedClasses = /* @__PURE__ */ new Set();
|
|
10732
10732
|
const conversationWarnings = { loggedMissingMessageCount: false };
|
|
10733
10733
|
const nodes = result.rawNodes.map((n) => pruneNode(n, warnedClasses, conversationWarnings));
|
|
10734
|
-
const edges = result.rawEdges.filter((e) => e && e.id != null);
|
|
10734
|
+
const edges = result.rawEdges.filter((e) => e && e.id != null).map((e) => pruneEdge(e, warnedClasses));
|
|
10735
10735
|
const trashedSuffix = includeTrashed ? " includeTrashed=1" : "";
|
|
10736
10736
|
console.error(
|
|
10737
10737
|
`[graph-page] load mode=default account=${accountId} agentActions=${includeAgentActions} labels=${labels.join(",")}${trashedSuffix} nodes=${nodes.length} edges=${edges.length} ms=${elapsed}`
|
|
@@ -10749,6 +10749,9 @@ async function handleDefault(c, accountId) {
|
|
|
10749
10749
|
}
|
|
10750
10750
|
}
|
|
10751
10751
|
}
|
|
10752
|
+
var NEIGHBOURHOOD_SEARCH_DEFAULT_LIMIT = 100;
|
|
10753
|
+
var NEIGHBOURHOOD_SEARCH_MAX_LIMIT = 2e3;
|
|
10754
|
+
var NEIGHBOURHOOD_LIMIT = 2e3;
|
|
10752
10755
|
async function handleNeighbourhood(c, accountId) {
|
|
10753
10756
|
const elementId = c.req.query("elementId");
|
|
10754
10757
|
if (!elementId) {
|
|
@@ -10759,11 +10762,38 @@ async function handleNeighbourhood(c, accountId) {
|
|
|
10759
10762
|
}
|
|
10760
10763
|
const includeAgentActions = c.req.query("includeAgentActions") === "1";
|
|
10761
10764
|
const agentActionLabels = includeAgentActions ? [] : [...AGENT_ACTION_LABELS];
|
|
10765
|
+
const q = (c.req.query("q") ?? "").trim();
|
|
10766
|
+
const rawLimit = c.req.query("limit");
|
|
10767
|
+
const parsedLimit = rawLimit ? parseInt(rawLimit, 10) : NEIGHBOURHOOD_SEARCH_DEFAULT_LIMIT;
|
|
10768
|
+
const searchLimit = Number.isFinite(parsedLimit) && parsedLimit > 0 ? Math.min(parsedLimit, NEIGHBOURHOOD_SEARCH_MAX_LIMIT) : NEIGHBOURHOOD_SEARCH_DEFAULT_LIMIT;
|
|
10762
10769
|
const started = Date.now();
|
|
10763
10770
|
const session = getSession();
|
|
10764
10771
|
try {
|
|
10772
|
+
let allowedIds = null;
|
|
10773
|
+
if (q) {
|
|
10774
|
+
const searchRes = await hybrid(session, embed, {
|
|
10775
|
+
query: q,
|
|
10776
|
+
accountId,
|
|
10777
|
+
labels: [],
|
|
10778
|
+
limit: searchLimit,
|
|
10779
|
+
degradeOnEmbedFailure: true,
|
|
10780
|
+
expandHops: 0
|
|
10781
|
+
});
|
|
10782
|
+
allowedIds = searchRes.results.map((r) => r.nodeId);
|
|
10783
|
+
}
|
|
10784
|
+
const cypher = allowedIds !== null ? NEIGHBOURHOOD_SEARCH_INTERSECT_CYPHER : NEIGHBOURHOOD_CYPHER;
|
|
10785
|
+
const cypherParams = {
|
|
10786
|
+
accountId,
|
|
10787
|
+
elementId,
|
|
10788
|
+
agentActionLabels,
|
|
10789
|
+
// `neo4j.int` keeps the LIMIT value as a 64-bit Integer on the wire —
|
|
10790
|
+
// bare JS `number` works on Pi 4 today but errors on driver versions
|
|
10791
|
+
// that strictly type-check LIMIT clauses against Long.
|
|
10792
|
+
neighbourhoodLimit: neo4j2.int(NEIGHBOURHOOD_LIMIT)
|
|
10793
|
+
};
|
|
10794
|
+
if (allowedIds !== null) cypherParams.allowedIds = allowedIds;
|
|
10765
10795
|
const result = await session.executeRead(async (tx) => {
|
|
10766
|
-
return await tx.run(
|
|
10796
|
+
return await tx.run(cypher, cypherParams);
|
|
10767
10797
|
});
|
|
10768
10798
|
const record = result.records[0];
|
|
10769
10799
|
const rawNodes = record?.get("nodes") ?? [];
|
|
@@ -10778,10 +10808,15 @@ async function handleNeighbourhood(c, accountId) {
|
|
|
10778
10808
|
const warnedClasses = /* @__PURE__ */ new Set();
|
|
10779
10809
|
const conversationWarnings = { loggedMissingMessageCount: false };
|
|
10780
10810
|
const nodes = rawNodes.map((n) => pruneNode(n, warnedClasses, conversationWarnings));
|
|
10781
|
-
const edges = rawEdges.filter((e) => e && e.id != null);
|
|
10811
|
+
const edges = rawEdges.filter((e) => e && e.id != null).map((e) => pruneEdge(e, warnedClasses));
|
|
10782
10812
|
console.error(
|
|
10783
10813
|
`[graph-page] load mode=neighbourhood account=${accountId} agentActions=${includeAgentActions} elementId=${elementId} nodes=${nodes.length} edges=${edges.length} ms=${elapsed}`
|
|
10784
10814
|
);
|
|
10815
|
+
if (allowedIds !== null) {
|
|
10816
|
+
console.error(
|
|
10817
|
+
`[graph-page] neighbourhood-search-intersect q="${q}" allowed=${allowedIds.length} root=${elementId} rendered=${nodes.length}`
|
|
10818
|
+
);
|
|
10819
|
+
}
|
|
10785
10820
|
return c.json({ nodes, edges });
|
|
10786
10821
|
} catch (err) {
|
|
10787
10822
|
const elapsed = Date.now() - started;
|
|
@@ -10825,7 +10860,8 @@ var DEFAULT_FETCH_CYPHER = `
|
|
|
10825
10860
|
id: elementId(r),
|
|
10826
10861
|
from: elementId(startNode(r)),
|
|
10827
10862
|
to: elementId(endNode(r)),
|
|
10828
|
-
type: type(r)
|
|
10863
|
+
type: type(r),
|
|
10864
|
+
properties: properties(r)
|
|
10829
10865
|
} END) AS rawEdges
|
|
10830
10866
|
RETURN
|
|
10831
10867
|
[x IN nodes | {id: elementId(x), labels: labels(x), properties: ${CONVERSATION_PROPS_PROJECTION}}] AS nodes,
|
|
@@ -10854,7 +10890,8 @@ var DEFAULT_FETCH_CYPHER_INCLUDE_TRASHED = `
|
|
|
10854
10890
|
id: elementId(r),
|
|
10855
10891
|
from: elementId(startNode(r)),
|
|
10856
10892
|
to: elementId(endNode(r)),
|
|
10857
|
-
type: type(r)
|
|
10893
|
+
type: type(r),
|
|
10894
|
+
properties: properties(r)
|
|
10858
10895
|
} END) AS rawEdges
|
|
10859
10896
|
RETURN
|
|
10860
10897
|
[x IN nodes | {id: elementId(x), labels: labels(x), properties: ${CONVERSATION_PROPS_PROJECTION}}] AS nodes,
|
|
@@ -10871,6 +10908,40 @@ var NEIGHBOURHOOD_CYPHER = `
|
|
|
10871
10908
|
AND NOT m:Trashed
|
|
10872
10909
|
AND m.deletedAt IS NULL
|
|
10873
10910
|
AND NOT any(lbl IN labels(m) WHERE lbl IN $agentActionLabels)
|
|
10911
|
+
WITH n, m
|
|
10912
|
+
LIMIT $neighbourhoodLimit
|
|
10913
|
+
WITH n, collect(DISTINCT m) AS neighbours
|
|
10914
|
+
WITH [n] + [x IN neighbours WHERE x IS NOT NULL] AS windowNodes
|
|
10915
|
+
WITH windowNodes, [x IN windowNodes | elementId(x)] AS windowIds
|
|
10916
|
+
UNWIND windowNodes AS w
|
|
10917
|
+
OPTIONAL MATCH (w)-[r]-(o)
|
|
10918
|
+
WHERE elementId(o) IN windowIds
|
|
10919
|
+
WITH windowNodes,
|
|
10920
|
+
collect(DISTINCT CASE WHEN r IS NULL THEN null ELSE {
|
|
10921
|
+
id: elementId(r),
|
|
10922
|
+
from: elementId(startNode(r)),
|
|
10923
|
+
to: elementId(endNode(r)),
|
|
10924
|
+
type: type(r),
|
|
10925
|
+
properties: properties(r)
|
|
10926
|
+
} END) AS rawEdges
|
|
10927
|
+
RETURN
|
|
10928
|
+
[x IN windowNodes | {id: elementId(x), labels: labels(x), properties: ${CONVERSATION_PROPS_PROJECTION}}] AS nodes,
|
|
10929
|
+
[e IN rawEdges WHERE e IS NOT NULL] AS edges
|
|
10930
|
+
`;
|
|
10931
|
+
var NEIGHBOURHOOD_SEARCH_INTERSECT_CYPHER = `
|
|
10932
|
+
MATCH (n)
|
|
10933
|
+
WHERE elementId(n) = $elementId
|
|
10934
|
+
AND n.accountId = $accountId
|
|
10935
|
+
AND NOT n:Trashed
|
|
10936
|
+
AND n.deletedAt IS NULL
|
|
10937
|
+
OPTIONAL MATCH (n)-[]-(m)
|
|
10938
|
+
WHERE m.accountId = $accountId
|
|
10939
|
+
AND NOT m:Trashed
|
|
10940
|
+
AND m.deletedAt IS NULL
|
|
10941
|
+
AND NOT any(lbl IN labels(m) WHERE lbl IN $agentActionLabels)
|
|
10942
|
+
AND elementId(m) IN $allowedIds
|
|
10943
|
+
WITH n, m
|
|
10944
|
+
LIMIT $neighbourhoodLimit
|
|
10874
10945
|
WITH n, collect(DISTINCT m) AS neighbours
|
|
10875
10946
|
WITH [n] + [x IN neighbours WHERE x IS NOT NULL] AS windowNodes
|
|
10876
10947
|
WITH windowNodes, [x IN windowNodes | elementId(x)] AS windowIds
|
|
@@ -10882,7 +10953,8 @@ var NEIGHBOURHOOD_CYPHER = `
|
|
|
10882
10953
|
id: elementId(r),
|
|
10883
10954
|
from: elementId(startNode(r)),
|
|
10884
10955
|
to: elementId(endNode(r)),
|
|
10885
|
-
type: type(r)
|
|
10956
|
+
type: type(r),
|
|
10957
|
+
properties: properties(r)
|
|
10886
10958
|
} END) AS rawEdges
|
|
10887
10959
|
RETURN
|
|
10888
10960
|
[x IN windowNodes | {id: elementId(x), labels: labels(x), properties: ${CONVERSATION_PROPS_PROJECTION}}] AS nodes,
|
|
@@ -10897,6 +10969,44 @@ var KNOWN_DRIVER_CLASS_NAMES = /* @__PURE__ */ new Set([
|
|
|
10897
10969
|
"Duration",
|
|
10898
10970
|
"Integer"
|
|
10899
10971
|
]);
|
|
10972
|
+
function isStructuralInteger(value) {
|
|
10973
|
+
if (value === null || typeof value !== "object") return false;
|
|
10974
|
+
const v = value;
|
|
10975
|
+
return typeof v.low === "number" && typeof v.high === "number" && Object.keys(v).length === 2;
|
|
10976
|
+
}
|
|
10977
|
+
function integerLikeToScalar(v) {
|
|
10978
|
+
if (v.high === 0 && v.low >= 0) return v.low;
|
|
10979
|
+
if (v.high === -1 && v.low < 0) return v.low;
|
|
10980
|
+
const big = BigInt(v.high) << 32n | BigInt(v.low) & 0xffffffffn;
|
|
10981
|
+
return big.toString();
|
|
10982
|
+
}
|
|
10983
|
+
function isStructuralTemporal(value) {
|
|
10984
|
+
if (value === null || typeof value !== "object") return false;
|
|
10985
|
+
const v = value;
|
|
10986
|
+
return "year" in v && "month" in v && "day" in v && isStructuralInteger(v.year) && isStructuralInteger(v.month) && isStructuralInteger(v.day);
|
|
10987
|
+
}
|
|
10988
|
+
function structuralTemporalToIso(v) {
|
|
10989
|
+
const lowOf = (k) => v[k].low | 0;
|
|
10990
|
+
const y = String(lowOf("year")).padStart(4, "0");
|
|
10991
|
+
const m = String(lowOf("month")).padStart(2, "0");
|
|
10992
|
+
const d = String(lowOf("day")).padStart(2, "0");
|
|
10993
|
+
if (!("hour" in v)) return `${y}-${m}-${d}`;
|
|
10994
|
+
const hh = String(lowOf("hour")).padStart(2, "0");
|
|
10995
|
+
const mm = String(lowOf("minute")).padStart(2, "0");
|
|
10996
|
+
const ss = String(lowOf("second")).padStart(2, "0");
|
|
10997
|
+
const ns = "nanosecond" in v ? lowOf("nanosecond") : 0;
|
|
10998
|
+
const frac = ns ? "." + String(ns).padStart(9, "0").replace(/0+$/, "").slice(0, 9) : "";
|
|
10999
|
+
if (!("timeZoneOffsetSeconds" in v)) {
|
|
11000
|
+
return `${y}-${m}-${d}T${hh}:${mm}:${ss}${frac}`;
|
|
11001
|
+
}
|
|
11002
|
+
const tz = lowOf("timeZoneOffsetSeconds");
|
|
11003
|
+
if (tz === 0) return `${y}-${m}-${d}T${hh}:${mm}:${ss}${frac}Z`;
|
|
11004
|
+
const sign = tz >= 0 ? "+" : "-";
|
|
11005
|
+
const absTz = Math.abs(tz);
|
|
11006
|
+
const tzH = String(Math.floor(absTz / 3600)).padStart(2, "0");
|
|
11007
|
+
const tzM = String(Math.floor(absTz % 3600 / 60)).padStart(2, "0");
|
|
11008
|
+
return `${y}-${m}-${d}T${hh}:${mm}:${ss}${frac}${sign}${tzH}:${tzM}`;
|
|
11009
|
+
}
|
|
10900
11010
|
function convertNeo4jValue(value, warnedClasses) {
|
|
10901
11011
|
if (neo4j2.isDateTime(value) || neo4j2.isDate(value) || neo4j2.isLocalDateTime(value) || neo4j2.isLocalTime(value) || neo4j2.isTime(value) || neo4j2.isDuration(value)) {
|
|
10902
11012
|
return value.toString();
|
|
@@ -10904,6 +11014,13 @@ function convertNeo4jValue(value, warnedClasses) {
|
|
|
10904
11014
|
if (neo4j2.isInt(value)) {
|
|
10905
11015
|
return value.inSafeRange() ? value.toNumber() : value.toString();
|
|
10906
11016
|
}
|
|
11017
|
+
if (isStructuralInteger(value)) {
|
|
11018
|
+
const v = value;
|
|
11019
|
+
return integerLikeToScalar(v);
|
|
11020
|
+
}
|
|
11021
|
+
if (isStructuralTemporal(value)) {
|
|
11022
|
+
return structuralTemporalToIso(value);
|
|
11023
|
+
}
|
|
10907
11024
|
if (Array.isArray(value)) {
|
|
10908
11025
|
return value.map((v) => convertNeo4jValue(v, warnedClasses));
|
|
10909
11026
|
}
|
|
@@ -10927,6 +11044,17 @@ function convertNeo4jValue(value, warnedClasses) {
|
|
|
10927
11044
|
}
|
|
10928
11045
|
return value;
|
|
10929
11046
|
}
|
|
11047
|
+
function pruneEdge(edge, warnedClasses) {
|
|
11048
|
+
if (!edge.properties || Object.keys(edge.properties).length === 0) {
|
|
11049
|
+
return edge;
|
|
11050
|
+
}
|
|
11051
|
+
const properties = {};
|
|
11052
|
+
for (const [key, value] of Object.entries(edge.properties)) {
|
|
11053
|
+
if (STRIPPED_PROPERTIES.has(key)) continue;
|
|
11054
|
+
properties[key] = convertNeo4jValue(value, warnedClasses);
|
|
11055
|
+
}
|
|
11056
|
+
return { ...edge, properties };
|
|
11057
|
+
}
|
|
10930
11058
|
function pruneNode(node, warnedClasses, conversationWarnings) {
|
|
10931
11059
|
const properties = {};
|
|
10932
11060
|
for (const [key, value] of Object.entries(node.properties ?? {})) {
|