@rubytech/create-realagent 1.0.716 → 1.0.717
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 +51 -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 +17 -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/graph-qKc9cr2K.js +50 -0
- package/payload/server/public/graph.html +1 -1
- package/payload/server/server.js +56 -1
- package/payload/server/public/assets/graph-CkcuUDtA.js +0 -50
|
@@ -5,7 +5,7 @@
|
|
|
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-qKc9cr2K.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-C-H-0vwA.js">
|
|
11
11
|
<link rel="modulepreload" crossorigin href="/assets/Checkbox-DzNre1pt.js">
|
package/payload/server/server.js
CHANGED
|
@@ -10749,6 +10749,8 @@ 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;
|
|
10752
10754
|
async function handleNeighbourhood(c, accountId) {
|
|
10753
10755
|
const elementId = c.req.query("elementId");
|
|
10754
10756
|
if (!elementId) {
|
|
@@ -10759,11 +10761,30 @@ async function handleNeighbourhood(c, accountId) {
|
|
|
10759
10761
|
}
|
|
10760
10762
|
const includeAgentActions = c.req.query("includeAgentActions") === "1";
|
|
10761
10763
|
const agentActionLabels = includeAgentActions ? [] : [...AGENT_ACTION_LABELS];
|
|
10764
|
+
const q = (c.req.query("q") ?? "").trim();
|
|
10765
|
+
const rawLimit = c.req.query("limit");
|
|
10766
|
+
const parsedLimit = rawLimit ? parseInt(rawLimit, 10) : NEIGHBOURHOOD_SEARCH_DEFAULT_LIMIT;
|
|
10767
|
+
const searchLimit = Number.isFinite(parsedLimit) && parsedLimit > 0 ? Math.min(parsedLimit, NEIGHBOURHOOD_SEARCH_MAX_LIMIT) : NEIGHBOURHOOD_SEARCH_DEFAULT_LIMIT;
|
|
10762
10768
|
const started = Date.now();
|
|
10763
10769
|
const session = getSession();
|
|
10764
10770
|
try {
|
|
10771
|
+
let allowedIds = null;
|
|
10772
|
+
if (q) {
|
|
10773
|
+
const searchRes = await hybrid(session, embed, {
|
|
10774
|
+
query: q,
|
|
10775
|
+
accountId,
|
|
10776
|
+
labels: [],
|
|
10777
|
+
limit: searchLimit,
|
|
10778
|
+
degradeOnEmbedFailure: true,
|
|
10779
|
+
expandHops: 0
|
|
10780
|
+
});
|
|
10781
|
+
allowedIds = searchRes.results.map((r) => r.nodeId);
|
|
10782
|
+
}
|
|
10783
|
+
const cypher = allowedIds !== null ? NEIGHBOURHOOD_SEARCH_INTERSECT_CYPHER : NEIGHBOURHOOD_CYPHER;
|
|
10784
|
+
const cypherParams = { accountId, elementId, agentActionLabels };
|
|
10785
|
+
if (allowedIds !== null) cypherParams.allowedIds = allowedIds;
|
|
10765
10786
|
const result = await session.executeRead(async (tx) => {
|
|
10766
|
-
return await tx.run(
|
|
10787
|
+
return await tx.run(cypher, cypherParams);
|
|
10767
10788
|
});
|
|
10768
10789
|
const record = result.records[0];
|
|
10769
10790
|
const rawNodes = record?.get("nodes") ?? [];
|
|
@@ -10782,6 +10803,11 @@ async function handleNeighbourhood(c, accountId) {
|
|
|
10782
10803
|
console.error(
|
|
10783
10804
|
`[graph-page] load mode=neighbourhood account=${accountId} agentActions=${includeAgentActions} elementId=${elementId} nodes=${nodes.length} edges=${edges.length} ms=${elapsed}`
|
|
10784
10805
|
);
|
|
10806
|
+
if (allowedIds !== null) {
|
|
10807
|
+
console.error(
|
|
10808
|
+
`[graph-page] neighbourhood-search-intersect q="${q}" allowed=${allowedIds.length} root=${elementId} rendered=${nodes.length}`
|
|
10809
|
+
);
|
|
10810
|
+
}
|
|
10785
10811
|
return c.json({ nodes, edges });
|
|
10786
10812
|
} catch (err) {
|
|
10787
10813
|
const elapsed = Date.now() - started;
|
|
@@ -10888,6 +10914,35 @@ var NEIGHBOURHOOD_CYPHER = `
|
|
|
10888
10914
|
[x IN windowNodes | {id: elementId(x), labels: labels(x), properties: ${CONVERSATION_PROPS_PROJECTION}}] AS nodes,
|
|
10889
10915
|
[e IN rawEdges WHERE e IS NOT NULL] AS edges
|
|
10890
10916
|
`;
|
|
10917
|
+
var NEIGHBOURHOOD_SEARCH_INTERSECT_CYPHER = `
|
|
10918
|
+
MATCH (n)
|
|
10919
|
+
WHERE elementId(n) = $elementId
|
|
10920
|
+
AND n.accountId = $accountId
|
|
10921
|
+
AND NOT n:Trashed
|
|
10922
|
+
AND n.deletedAt IS NULL
|
|
10923
|
+
OPTIONAL MATCH (n)-[]-(m)
|
|
10924
|
+
WHERE m.accountId = $accountId
|
|
10925
|
+
AND NOT m:Trashed
|
|
10926
|
+
AND m.deletedAt IS NULL
|
|
10927
|
+
AND NOT any(lbl IN labels(m) WHERE lbl IN $agentActionLabels)
|
|
10928
|
+
AND elementId(m) IN $allowedIds
|
|
10929
|
+
WITH n, collect(DISTINCT m) AS neighbours
|
|
10930
|
+
WITH [n] + [x IN neighbours WHERE x IS NOT NULL] AS windowNodes
|
|
10931
|
+
WITH windowNodes, [x IN windowNodes | elementId(x)] AS windowIds
|
|
10932
|
+
UNWIND windowNodes AS w
|
|
10933
|
+
OPTIONAL MATCH (w)-[r]-(o)
|
|
10934
|
+
WHERE elementId(o) IN windowIds
|
|
10935
|
+
WITH windowNodes,
|
|
10936
|
+
collect(DISTINCT CASE WHEN r IS NULL THEN null ELSE {
|
|
10937
|
+
id: elementId(r),
|
|
10938
|
+
from: elementId(startNode(r)),
|
|
10939
|
+
to: elementId(endNode(r)),
|
|
10940
|
+
type: type(r)
|
|
10941
|
+
} END) AS rawEdges
|
|
10942
|
+
RETURN
|
|
10943
|
+
[x IN windowNodes | {id: elementId(x), labels: labels(x), properties: ${CONVERSATION_PROPS_PROJECTION}}] AS nodes,
|
|
10944
|
+
[e IN rawEdges WHERE e IS NOT NULL] AS edges
|
|
10945
|
+
`;
|
|
10891
10946
|
var KNOWN_DRIVER_CLASS_NAMES = /* @__PURE__ */ new Set([
|
|
10892
10947
|
"DateTime",
|
|
10893
10948
|
"Date",
|