@rubytech/create-realagent 1.0.661 → 1.0.663
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/schema.cypher +18 -0
- package/payload/platform/plugins/docs/references/memory-guide.md +4 -2
- package/payload/platform/plugins/docs/references/platform.md +2 -0
- package/payload/platform/plugins/docs/references/troubleshooting.md +13 -0
- package/payload/server/public/assets/{admin-CZ3-YQhl.js → admin-C9qoVb2l.js} +62 -62
- package/payload/server/public/assets/{data-BmeeI1Ix.js → data-C-WE3FGr.js} +1 -1
- package/payload/server/public/assets/{file-D4Qulqz_.js → file-lmzx24EO.js} +1 -1
- package/payload/server/public/assets/{graph-MoIys9Ub.js → graph-DkjvCb8B.js} +17 -17
- package/payload/server/public/assets/{house-B0Hukxjp.js → house-ClhI06TA.js} +1 -1
- package/payload/server/public/assets/{jsx-runtime-C6owBiFB.css → jsx-runtime-CLCFnMYD.css} +1 -1
- package/payload/server/public/assets/{public-LvjJTLGn.js → public-Dz33-dIE.js} +1 -1
- package/payload/server/public/assets/{share-2-BafZBLp9.js → share-2-MZ4MqbjS.js} +1 -1
- package/payload/server/public/assets/{useVoiceRecorder-dLOpmcYJ.js → useVoiceRecorder-Cm0G51D_.js} +1 -1
- package/payload/server/public/assets/{x-BOZIeV0f.js → x-CLhtM_Mh.js} +1 -1
- package/payload/server/public/data.html +6 -6
- package/payload/server/public/graph.html +6 -6
- package/payload/server/public/index.html +7 -7
- package/payload/server/public/public.html +4 -4
- package/payload/server/server.js +248 -72
- /package/payload/server/public/assets/{jsx-runtime-CmCvZzVE.js → jsx-runtime-ImbU973I.js} +0 -0
package/payload/server/public/assets/{useVoiceRecorder-dLOpmcYJ.js → useVoiceRecorder-Cm0G51D_.js}
RENAMED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/mermaid.core-CCUSwZB_.js","assets/preload-helper-qlgyTAkD.js","assets/dist-CrzV1W3-.js","assets/chunk-DD-I1_y5.js","assets/chunk-U2HBQHQK-BZnA7c4T.js","assets/src-Bo15iQ7w.js","assets/chunk-5PVQY5BW-RhIfPCRB.js","assets/chunk-ICPOFSXX-Di63NBur.js","assets/_baseFor-Dn4GSmI6.js","assets/isEmpty-h-wRi_o9.js","assets/chunk-336JU56O-BpATJiGl.js","assets/chunk-5FUZZQ4R-BoTfWHuW.js","assets/chunk-X2U36JSP-DpQ2OA_c.js","assets/chunk-ZZ45TVLE-DBSm41oP.js","assets/rough.esm-NLRoWnq-.js","assets/chunk-ENJZ2VHE-CNHjq5xK.js","assets/line-DlKKhwkO.js","assets/path-7vUsG-o2.js","assets/array-DJN9YAVf.js","assets/chunk-BSJP7CBP-CTsYuARh.js","assets/chunk-426QAEUC-Wz6Bpsil.js","assets/chunk-XPW4576I-BccP1mlQ.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-ImbU973I.js";import{t as s}from"./preload-helper-qlgyTAkD.js";var c=a(`check`,[[`path`,{d:`M20 6 9 17l-5-5`,key:`1gmf2c`}]]),l=a(`chevron-down`,[[`path`,{d:`m6 9 6 6 6-6`,key:`qrunsl`}]]),u=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`}]]),d=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`}]]),f=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`}]]),p=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`}]]),m=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`}]]),h=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`}]]),g=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`}]]),_=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`}]]),v=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`}]]),y=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`}]]),b=e(i(),1);async function x(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 S(){let[e,t]=(0,b.useState)(!1),[n,r]=(0,b.useState)(new Set),[i,a]=(0,b.useState)(!1),o=(0,b.useRef)(null);(0,b.useEffect)(()=>()=>{o.current!==null&&clearTimeout(o.current)},[]);let s=(0,b.useCallback)(()=>{t(!0),r(new Set)},[]),c=(0,b.useCallback)(()=>{t(!1),r(new Set)},[]),l=(0,b.useCallback)(e=>{r(t=>{let n=new Set(t);return n.has(e)?n.delete(e):n.add(e),n})},[]),u=(0,b.useCallback)(()=>{o.current!==null&&(clearTimeout(o.current),o.current=null)},[]),d=(0,b.useCallback)(e=>({onPointerDown:()=>{o.current=setTimeout(()=>{t(!0),r(new Set([e])),o.current=null},500)},onPointerUp:u,onPointerLeave:u,onPointerCancel:u}),[u]),f=(0,b.useCallback)(e=>{a(e?`copied`:`failed`),setTimeout(()=>a(!1),1500)},[]);return{selectionMode:e,selectedItems:n,copyToast:i,longPressProps:d,enterSelection:s,exitSelection:c,toggleSelectItem:l,copySelected:(0,b.useCallback)(async(e,t)=>{let r=[...n].sort(t).map(t=>e(t)).filter(Boolean);r.length>0&&f(await x(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-ImbU973I.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-C-WE3FGr.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-ImbU973I.js">
|
|
11
|
+
<link rel="modulepreload" crossorigin href="/assets/share-2-MZ4MqbjS.js">
|
|
12
|
+
<link rel="modulepreload" crossorigin href="/assets/file-lmzx24EO.js">
|
|
13
|
+
<link rel="modulepreload" crossorigin href="/assets/house-ClhI06TA.js">
|
|
14
|
+
<link rel="stylesheet" crossorigin href="/assets/jsx-runtime-CLCFnMYD.css">
|
|
15
15
|
</head>
|
|
16
16
|
<body>
|
|
17
17
|
<div id="root"></div>
|
|
@@ -5,13 +5,13 @@
|
|
|
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-DkjvCb8B.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/house-
|
|
13
|
-
<link rel="modulepreload" crossorigin href="/assets/x-
|
|
14
|
-
<link rel="stylesheet" crossorigin href="/assets/jsx-runtime-
|
|
10
|
+
<link rel="modulepreload" crossorigin href="/assets/jsx-runtime-ImbU973I.js">
|
|
11
|
+
<link rel="modulepreload" crossorigin href="/assets/share-2-MZ4MqbjS.js">
|
|
12
|
+
<link rel="modulepreload" crossorigin href="/assets/house-ClhI06TA.js">
|
|
13
|
+
<link rel="modulepreload" crossorigin href="/assets/x-CLhtM_Mh.js">
|
|
14
|
+
<link rel="stylesheet" crossorigin href="/assets/jsx-runtime-CLCFnMYD.css">
|
|
15
15
|
</head>
|
|
16
16
|
<body>
|
|
17
17
|
<div id="root"></div>
|
|
@@ -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-C9qoVb2l.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-ImbU973I.js">
|
|
11
11
|
<link rel="modulepreload" crossorigin href="/assets/preload-helper-qlgyTAkD.js">
|
|
12
|
-
<link rel="modulepreload" crossorigin href="/assets/useVoiceRecorder-
|
|
13
|
-
<link rel="modulepreload" crossorigin href="/assets/share-2-
|
|
14
|
-
<link rel="modulepreload" crossorigin href="/assets/file-
|
|
15
|
-
<link rel="modulepreload" crossorigin href="/assets/x-
|
|
16
|
-
<link rel="stylesheet" crossorigin href="/assets/jsx-runtime-
|
|
12
|
+
<link rel="modulepreload" crossorigin href="/assets/useVoiceRecorder-Cm0G51D_.js">
|
|
13
|
+
<link rel="modulepreload" crossorigin href="/assets/share-2-MZ4MqbjS.js">
|
|
14
|
+
<link rel="modulepreload" crossorigin href="/assets/file-lmzx24EO.js">
|
|
15
|
+
<link rel="modulepreload" crossorigin href="/assets/x-CLhtM_Mh.js">
|
|
16
|
+
<link rel="stylesheet" crossorigin href="/assets/jsx-runtime-CLCFnMYD.css">
|
|
17
17
|
<link rel="stylesheet" crossorigin href="/assets/admin-kHJ-D0s7.css">
|
|
18
18
|
<link rel="stylesheet" href="/brand-defaults.css">
|
|
19
19
|
</head>
|
|
@@ -5,12 +5,12 @@
|
|
|
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/public-
|
|
8
|
+
<script type="module" crossorigin src="/assets/public-Dz33-dIE.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-ImbU973I.js">
|
|
11
11
|
<link rel="modulepreload" crossorigin href="/assets/preload-helper-qlgyTAkD.js">
|
|
12
|
-
<link rel="modulepreload" crossorigin href="/assets/useVoiceRecorder-
|
|
13
|
-
<link rel="stylesheet" crossorigin href="/assets/jsx-runtime-
|
|
12
|
+
<link rel="modulepreload" crossorigin href="/assets/useVoiceRecorder-Cm0G51D_.js">
|
|
13
|
+
<link rel="stylesheet" crossorigin href="/assets/jsx-runtime-CLCFnMYD.css">
|
|
14
14
|
<link rel="stylesheet" href="/brand-defaults.css">
|
|
15
15
|
</head>
|
|
16
16
|
<body>
|
package/payload/server/server.js
CHANGED
|
@@ -1201,14 +1201,14 @@ var Hono = class _Hono {
|
|
|
1201
1201
|
* app.route("/api", app2) // GET /api/user
|
|
1202
1202
|
* ```
|
|
1203
1203
|
*/
|
|
1204
|
-
route(path2,
|
|
1204
|
+
route(path2, app35) {
|
|
1205
1205
|
const subApp = this.basePath(path2);
|
|
1206
|
-
|
|
1206
|
+
app35.routes.map((r) => {
|
|
1207
1207
|
let handler;
|
|
1208
|
-
if (
|
|
1208
|
+
if (app35.errorHandler === errorHandler) {
|
|
1209
1209
|
handler = r.handler;
|
|
1210
1210
|
} else {
|
|
1211
|
-
handler = async (c, next) => (await compose([],
|
|
1211
|
+
handler = async (c, next) => (await compose([], app35.errorHandler)(c, () => r.handler(c, next))).res;
|
|
1212
1212
|
handler[COMPOSED_HANDLER] = r.handler;
|
|
1213
1213
|
}
|
|
1214
1214
|
subApp.#addRoute(r.method, r.path, handler);
|
|
@@ -20899,7 +20899,7 @@ var ALL_GRAPH_LABELS = Object.freeze(
|
|
|
20899
20899
|
Object.keys(GRAPH_LABEL_COLOURS)
|
|
20900
20900
|
);
|
|
20901
20901
|
var HIDDEN_BY_DEFAULT_LABELS = Object.freeze(
|
|
20902
|
-
/* @__PURE__ */ new Set(["Chunk"])
|
|
20902
|
+
/* @__PURE__ */ new Set(["Chunk", "GraphPreference"])
|
|
20903
20903
|
);
|
|
20904
20904
|
function isKnownLabel(label) {
|
|
20905
20905
|
return Object.prototype.hasOwnProperty.call(GRAPH_LABEL_COLOURS, label);
|
|
@@ -21299,9 +21299,183 @@ app28.post("/", requireAdminSession, async (c) => {
|
|
|
21299
21299
|
});
|
|
21300
21300
|
var graph_restore_default = app28;
|
|
21301
21301
|
|
|
21302
|
-
// server/routes/admin/
|
|
21302
|
+
// server/routes/admin/graph-labels-in-graph.ts
|
|
21303
21303
|
var app29 = new Hono2();
|
|
21304
|
-
app29.
|
|
21304
|
+
app29.get("/", requireAdminSession, async (c) => {
|
|
21305
|
+
const sessionKey = c.var.sessionKey;
|
|
21306
|
+
const accountId = getAccountIdForSession(sessionKey);
|
|
21307
|
+
if (!accountId) {
|
|
21308
|
+
console.error('[graph-page] labels-in-graph-rejected reason="no account for session"');
|
|
21309
|
+
return c.json({ error: "Account not found for session" }, 401);
|
|
21310
|
+
}
|
|
21311
|
+
const started = Date.now();
|
|
21312
|
+
const session = getSession();
|
|
21313
|
+
try {
|
|
21314
|
+
const hidden = [...HIDDEN_BY_DEFAULT_LABELS];
|
|
21315
|
+
const result = await session.executeRead(async (tx) => {
|
|
21316
|
+
return await tx.run(LABELS_IN_GRAPH_CYPHER, { accountId, hidden });
|
|
21317
|
+
});
|
|
21318
|
+
const record = result.records[0];
|
|
21319
|
+
const rawLabels = record?.get("labels") ?? [];
|
|
21320
|
+
const labels = [...new Set(rawLabels)].sort();
|
|
21321
|
+
const elapsed = Date.now() - started;
|
|
21322
|
+
console.error(
|
|
21323
|
+
`[graph-page] labels-in-graph account=${accountId} labels=${labels.join(",")} ms=${elapsed}`
|
|
21324
|
+
);
|
|
21325
|
+
return c.json({ labels });
|
|
21326
|
+
} catch (err) {
|
|
21327
|
+
const elapsed = Date.now() - started;
|
|
21328
|
+
const message = err instanceof Error ? err.message : String(err);
|
|
21329
|
+
console.error(
|
|
21330
|
+
`[graph-page] labels-in-graph-rejected account=${accountId} reason="${message}" ms=${elapsed}`
|
|
21331
|
+
);
|
|
21332
|
+
return c.json({ error: `Graph labels unavailable: ${message}` }, 503);
|
|
21333
|
+
} finally {
|
|
21334
|
+
try {
|
|
21335
|
+
await session.close();
|
|
21336
|
+
} catch {
|
|
21337
|
+
}
|
|
21338
|
+
}
|
|
21339
|
+
});
|
|
21340
|
+
var LABELS_IN_GRAPH_CYPHER = `
|
|
21341
|
+
MATCH (n)
|
|
21342
|
+
WHERE n.accountId = $accountId
|
|
21343
|
+
AND NOT n:Trashed
|
|
21344
|
+
AND n.deletedAt IS NULL
|
|
21345
|
+
UNWIND labels(n) AS lbl
|
|
21346
|
+
WITH DISTINCT lbl
|
|
21347
|
+
WHERE NOT lbl IN $hidden
|
|
21348
|
+
RETURN collect(lbl) AS labels
|
|
21349
|
+
`;
|
|
21350
|
+
var graph_labels_in_graph_default = app29;
|
|
21351
|
+
|
|
21352
|
+
// server/routes/admin/graph-default-view.ts
|
|
21353
|
+
var app30 = new Hono2();
|
|
21354
|
+
app30.get("/", requireAdminSession, async (c) => {
|
|
21355
|
+
const sessionKey = c.var.sessionKey;
|
|
21356
|
+
const accountId = getAccountIdForSession(sessionKey);
|
|
21357
|
+
const userId = getUserIdForSession(sessionKey);
|
|
21358
|
+
if (!accountId || !userId) {
|
|
21359
|
+
console.error('[graph-page] default-view-rejected reason="missing account or user context"');
|
|
21360
|
+
return c.json({ error: "Account and user context required for default view" }, 401);
|
|
21361
|
+
}
|
|
21362
|
+
const started = Date.now();
|
|
21363
|
+
const session = getSession();
|
|
21364
|
+
try {
|
|
21365
|
+
const result = await session.executeRead(async (tx) => {
|
|
21366
|
+
return await tx.run(READ_CYPHER, { accountId, userId });
|
|
21367
|
+
});
|
|
21368
|
+
const record = result.records[0];
|
|
21369
|
+
const rawLabels = record?.get("labels");
|
|
21370
|
+
const rawIncludeTrashed = record?.get("includeTrashed");
|
|
21371
|
+
const labels = Array.isArray(rawLabels) ? rawLabels : [];
|
|
21372
|
+
const includeTrashed = rawIncludeTrashed === true;
|
|
21373
|
+
const elapsed = Date.now() - started;
|
|
21374
|
+
console.error(
|
|
21375
|
+
`[graph-page] default-view-load account=${accountId} labels=${labels.join(",")} includeTrashed=${includeTrashed ? 1 : 0} ms=${elapsed}`
|
|
21376
|
+
);
|
|
21377
|
+
return c.json({ labels, includeTrashed });
|
|
21378
|
+
} catch (err) {
|
|
21379
|
+
const elapsed = Date.now() - started;
|
|
21380
|
+
const message = err instanceof Error ? err.message : String(err);
|
|
21381
|
+
console.error(
|
|
21382
|
+
`[graph-page] default-view-rejected op=load account=${accountId} reason="${message}" ms=${elapsed}`
|
|
21383
|
+
);
|
|
21384
|
+
return c.json({ error: `Graph default view unavailable: ${message}` }, 503);
|
|
21385
|
+
} finally {
|
|
21386
|
+
try {
|
|
21387
|
+
await session.close();
|
|
21388
|
+
} catch {
|
|
21389
|
+
}
|
|
21390
|
+
}
|
|
21391
|
+
});
|
|
21392
|
+
app30.put("/", requireAdminSession, async (c) => {
|
|
21393
|
+
const sessionKey = c.var.sessionKey;
|
|
21394
|
+
const accountId = getAccountIdForSession(sessionKey);
|
|
21395
|
+
const userId = getUserIdForSession(sessionKey);
|
|
21396
|
+
if (!accountId || !userId) {
|
|
21397
|
+
console.error('[graph-page] default-view-rejected reason="missing account or user context"');
|
|
21398
|
+
return c.json({ error: "Account and user context required for default view" }, 401);
|
|
21399
|
+
}
|
|
21400
|
+
const body = await safeJson(c);
|
|
21401
|
+
if (!body) {
|
|
21402
|
+
return c.json({ error: "Request body must be JSON" }, 400);
|
|
21403
|
+
}
|
|
21404
|
+
const validation = validateBody2(body);
|
|
21405
|
+
if (!validation.ok) {
|
|
21406
|
+
console.error(
|
|
21407
|
+
`[graph-page] default-view-rejected op=save account=${accountId} reason="${validation.reason}"`
|
|
21408
|
+
);
|
|
21409
|
+
return c.json({ error: validation.reason }, 400);
|
|
21410
|
+
}
|
|
21411
|
+
const { labels, includeTrashed } = validation;
|
|
21412
|
+
const session = getSession();
|
|
21413
|
+
try {
|
|
21414
|
+
await session.executeWrite(async (tx) => {
|
|
21415
|
+
return await tx.run(WRITE_CYPHER, {
|
|
21416
|
+
accountId,
|
|
21417
|
+
userId,
|
|
21418
|
+
labels,
|
|
21419
|
+
includeTrashed,
|
|
21420
|
+
updatedAt: (/* @__PURE__ */ new Date()).toISOString()
|
|
21421
|
+
});
|
|
21422
|
+
});
|
|
21423
|
+
console.error(
|
|
21424
|
+
`[graph-page] default-view-save account=${accountId} labels=${labels.join(",")} includeTrashed=${includeTrashed ? 1 : 0}`
|
|
21425
|
+
);
|
|
21426
|
+
return c.json({ labels, includeTrashed });
|
|
21427
|
+
} catch (err) {
|
|
21428
|
+
const message = err instanceof Error ? err.message : String(err);
|
|
21429
|
+
console.error(
|
|
21430
|
+
`[graph-page] default-view-rejected op=save account=${accountId} reason="${message}"`
|
|
21431
|
+
);
|
|
21432
|
+
return c.json({ error: `Failed to save graph default view: ${message}` }, 503);
|
|
21433
|
+
} finally {
|
|
21434
|
+
try {
|
|
21435
|
+
await session.close();
|
|
21436
|
+
} catch {
|
|
21437
|
+
}
|
|
21438
|
+
}
|
|
21439
|
+
});
|
|
21440
|
+
function validateBody2(body) {
|
|
21441
|
+
if (!Array.isArray(body.labels)) {
|
|
21442
|
+
return { ok: false, reason: "labels must be an array of strings" };
|
|
21443
|
+
}
|
|
21444
|
+
if (typeof body.includeTrashed !== "boolean") {
|
|
21445
|
+
return { ok: false, reason: "includeTrashed must be a boolean" };
|
|
21446
|
+
}
|
|
21447
|
+
const seen = /* @__PURE__ */ new Set();
|
|
21448
|
+
for (const lbl of body.labels) {
|
|
21449
|
+
if (typeof lbl !== "string") {
|
|
21450
|
+
return { ok: false, reason: "labels must be an array of strings" };
|
|
21451
|
+
}
|
|
21452
|
+
if (!isKnownLabel(lbl)) {
|
|
21453
|
+
return { ok: false, reason: `unknown label "${lbl}" \u2014 not registered in graph-labels.ts` };
|
|
21454
|
+
}
|
|
21455
|
+
if (isHiddenByDefault(lbl)) {
|
|
21456
|
+
return { ok: false, reason: `label "${lbl}" is hidden by default and cannot be a default view selection` };
|
|
21457
|
+
}
|
|
21458
|
+
seen.add(lbl);
|
|
21459
|
+
}
|
|
21460
|
+
const labels = [...seen].sort();
|
|
21461
|
+
return { ok: true, labels, includeTrashed: body.includeTrashed };
|
|
21462
|
+
}
|
|
21463
|
+
var READ_CYPHER = `
|
|
21464
|
+
OPTIONAL MATCH (p:GraphPreference {accountId: $accountId, userId: $userId})
|
|
21465
|
+
RETURN p.labels AS labels, p.includeTrashed AS includeTrashed
|
|
21466
|
+
`;
|
|
21467
|
+
var WRITE_CYPHER = `
|
|
21468
|
+
MERGE (p:GraphPreference {accountId: $accountId, userId: $userId})
|
|
21469
|
+
SET p.labels = $labels,
|
|
21470
|
+
p.includeTrashed = $includeTrashed,
|
|
21471
|
+
p.updatedAt = $updatedAt
|
|
21472
|
+
RETURN p.labels AS labels
|
|
21473
|
+
`;
|
|
21474
|
+
var graph_default_view_default = app30;
|
|
21475
|
+
|
|
21476
|
+
// server/routes/admin/file-attach.ts
|
|
21477
|
+
var app31 = new Hono2();
|
|
21478
|
+
app31.post("/", async (c) => {
|
|
21305
21479
|
try {
|
|
21306
21480
|
const body = await c.req.json();
|
|
21307
21481
|
const { filePath, accountId } = body;
|
|
@@ -21324,11 +21498,11 @@ app29.post("/", async (c) => {
|
|
|
21324
21498
|
return c.json({ error: message }, 500);
|
|
21325
21499
|
}
|
|
21326
21500
|
});
|
|
21327
|
-
var file_attach_default =
|
|
21501
|
+
var file_attach_default = app31;
|
|
21328
21502
|
|
|
21329
21503
|
// server/routes/admin/adherence.ts
|
|
21330
|
-
var
|
|
21331
|
-
|
|
21504
|
+
var app32 = new Hono2();
|
|
21505
|
+
app32.get("/", requireAdminSession, async (c) => {
|
|
21332
21506
|
const agent = c.req.query("agent") ?? "admin";
|
|
21333
21507
|
const includeBlock = c.req.query("block") === "1";
|
|
21334
21508
|
const account = resolveAccount();
|
|
@@ -21349,32 +21523,34 @@ app30.get("/", requireAdminSession, async (c) => {
|
|
|
21349
21523
|
return c.json({ error: "Failed to read adherence ledger", agent }, 500);
|
|
21350
21524
|
}
|
|
21351
21525
|
});
|
|
21352
|
-
var adherence_default =
|
|
21526
|
+
var adherence_default = app32;
|
|
21353
21527
|
|
|
21354
21528
|
// server/routes/admin/index.ts
|
|
21355
|
-
var
|
|
21356
|
-
|
|
21357
|
-
|
|
21358
|
-
|
|
21359
|
-
|
|
21360
|
-
|
|
21361
|
-
|
|
21362
|
-
|
|
21363
|
-
|
|
21364
|
-
|
|
21365
|
-
|
|
21366
|
-
|
|
21367
|
-
|
|
21368
|
-
|
|
21369
|
-
|
|
21370
|
-
|
|
21371
|
-
|
|
21372
|
-
|
|
21373
|
-
|
|
21374
|
-
|
|
21375
|
-
|
|
21376
|
-
|
|
21377
|
-
|
|
21529
|
+
var app33 = new Hono2();
|
|
21530
|
+
app33.route("/session", session_default2);
|
|
21531
|
+
app33.route("/chat", chat_default2);
|
|
21532
|
+
app33.route("/compact", compact_default);
|
|
21533
|
+
app33.route("/logs", logs_default);
|
|
21534
|
+
app33.route("/claude-info", claude_info_default);
|
|
21535
|
+
app33.route("/attachment", attachment_default);
|
|
21536
|
+
app33.route("/account", account_default);
|
|
21537
|
+
app33.route("/agents", agents_default);
|
|
21538
|
+
app33.route("/version", version_default);
|
|
21539
|
+
app33.route("/sessions", sessions_default);
|
|
21540
|
+
app33.route("/browser", browser_default);
|
|
21541
|
+
app33.route("/device-browser", device_browser_default);
|
|
21542
|
+
app33.route("/events", events_default);
|
|
21543
|
+
app33.route("/cloudflare", cloudflare_default);
|
|
21544
|
+
app33.route("/files", files_default);
|
|
21545
|
+
app33.route("/graph-search", graph_search_default);
|
|
21546
|
+
app33.route("/graph-subgraph", graph_subgraph_default);
|
|
21547
|
+
app33.route("/graph-delete", graph_delete_default);
|
|
21548
|
+
app33.route("/graph-restore", graph_restore_default);
|
|
21549
|
+
app33.route("/graph-labels-in-graph", graph_labels_in_graph_default);
|
|
21550
|
+
app33.route("/graph-default-view", graph_default_view_default);
|
|
21551
|
+
app33.route("/file-attach", file_attach_default);
|
|
21552
|
+
app33.route("/adherence", adherence_default);
|
|
21553
|
+
var admin_default = app33;
|
|
21378
21554
|
|
|
21379
21555
|
// server/index.ts
|
|
21380
21556
|
var PLATFORM_ROOT11 = process.env.MAXY_PLATFORM_ROOT || "";
|
|
@@ -21432,9 +21608,9 @@ watchFile(ALIAS_DOMAINS_PATH2, { interval: 2e3 }, () => {
|
|
|
21432
21608
|
function isPublicHost(host) {
|
|
21433
21609
|
return host.startsWith("public.") || aliasDomains.has(host);
|
|
21434
21610
|
}
|
|
21435
|
-
var
|
|
21436
|
-
|
|
21437
|
-
|
|
21611
|
+
var app34 = new Hono2();
|
|
21612
|
+
app34.use("*", clientIpMiddleware);
|
|
21613
|
+
app34.use("*", async (c, next) => {
|
|
21438
21614
|
await next();
|
|
21439
21615
|
c.header("X-Content-Type-Options", "nosniff");
|
|
21440
21616
|
c.header("Referrer-Policy", "strict-origin-when-cross-origin");
|
|
@@ -21457,7 +21633,7 @@ var PUBLIC_ALLOWED_PREFIXES = [
|
|
|
21457
21633
|
"/g/"
|
|
21458
21634
|
];
|
|
21459
21635
|
var PUBLIC_ALLOWED_EXACT = ["/favicon.ico"];
|
|
21460
|
-
|
|
21636
|
+
app34.use("*", async (c, next) => {
|
|
21461
21637
|
const host = (c.req.header("host") ?? "").split(":")[0];
|
|
21462
21638
|
if (!isPublicHost(host)) {
|
|
21463
21639
|
await next();
|
|
@@ -21497,7 +21673,7 @@ function resolveRemoteAuthOpts() {
|
|
|
21497
21673
|
return brandLoginOpts;
|
|
21498
21674
|
}
|
|
21499
21675
|
var MAX_LOGIN_BODY = 8 * 1024;
|
|
21500
|
-
|
|
21676
|
+
app34.post("/__remote-auth/login", async (c) => {
|
|
21501
21677
|
const clientIp = c.var.clientIp || "unknown";
|
|
21502
21678
|
const rateLimited = checkRateLimit(clientIp);
|
|
21503
21679
|
if (rateLimited) {
|
|
@@ -21533,7 +21709,7 @@ app32.post("/__remote-auth/login", async (c) => {
|
|
|
21533
21709
|
}
|
|
21534
21710
|
});
|
|
21535
21711
|
});
|
|
21536
|
-
|
|
21712
|
+
app34.get("/__remote-auth/logout", (c) => {
|
|
21537
21713
|
const cookieHeader = c.req.header("cookie");
|
|
21538
21714
|
const token = parseCookie(cookieHeader, "__remote_session");
|
|
21539
21715
|
if (token) invalidateRemoteSession(token);
|
|
@@ -21546,7 +21722,7 @@ app32.get("/__remote-auth/logout", (c) => {
|
|
|
21546
21722
|
}
|
|
21547
21723
|
});
|
|
21548
21724
|
});
|
|
21549
|
-
|
|
21725
|
+
app34.post("/__remote-auth/change-password", async (c) => {
|
|
21550
21726
|
const clientIp = c.var.clientIp || "unknown";
|
|
21551
21727
|
const rateLimited = checkRateLimit(clientIp);
|
|
21552
21728
|
if (rateLimited) {
|
|
@@ -21595,13 +21771,13 @@ app32.post("/__remote-auth/change-password", async (c) => {
|
|
|
21595
21771
|
return c.html(renderLoginPage({ ...resolveRemoteAuthOpts(), mode: "change", changeError: "Failed to save password", redirect }), 200);
|
|
21596
21772
|
}
|
|
21597
21773
|
});
|
|
21598
|
-
|
|
21774
|
+
app34.get("/__remote-auth/setup", (c) => {
|
|
21599
21775
|
if (isRemoteAuthConfigured()) {
|
|
21600
21776
|
return c.redirect("/");
|
|
21601
21777
|
}
|
|
21602
21778
|
return c.html(renderLoginPage({ ...resolveRemoteAuthOpts(), mode: "setup" }), 200);
|
|
21603
21779
|
});
|
|
21604
|
-
|
|
21780
|
+
app34.post("/__remote-auth/set-initial-password", async (c) => {
|
|
21605
21781
|
if (isRemoteAuthConfigured()) {
|
|
21606
21782
|
return c.redirect("/");
|
|
21607
21783
|
}
|
|
@@ -21637,10 +21813,10 @@ app32.post("/__remote-auth/set-initial-password", async (c) => {
|
|
|
21637
21813
|
return c.html(renderLoginPage({ ...resolveRemoteAuthOpts(), mode: "setup", setupError: "Failed to save password. Please try again." }), 200);
|
|
21638
21814
|
}
|
|
21639
21815
|
});
|
|
21640
|
-
|
|
21816
|
+
app34.get("/api/remote-auth/status", (c) => {
|
|
21641
21817
|
return c.json({ configured: isRemoteAuthConfigured() });
|
|
21642
21818
|
});
|
|
21643
|
-
|
|
21819
|
+
app34.post("/api/remote-auth/set-password", async (c) => {
|
|
21644
21820
|
let body;
|
|
21645
21821
|
try {
|
|
21646
21822
|
body = await c.req.json();
|
|
@@ -21670,9 +21846,9 @@ app32.post("/api/remote-auth/set-password", async (c) => {
|
|
|
21670
21846
|
return c.json({ error: "Failed to save password" }, 500);
|
|
21671
21847
|
}
|
|
21672
21848
|
});
|
|
21673
|
-
|
|
21849
|
+
app34.route("/api/_client-error", client_error_default);
|
|
21674
21850
|
console.log("[client-error-route] mounted");
|
|
21675
|
-
|
|
21851
|
+
app34.use("*", async (c, next) => {
|
|
21676
21852
|
const host = (c.req.header("host") ?? "").split(":")[0];
|
|
21677
21853
|
const path2 = c.req.path;
|
|
21678
21854
|
if (path2 === "/favicon.ico" || path2.startsWith("/assets/") || path2.startsWith("/brand/")) {
|
|
@@ -21712,15 +21888,15 @@ function parseCookie(cookieHeader, name) {
|
|
|
21712
21888
|
return null;
|
|
21713
21889
|
}
|
|
21714
21890
|
}
|
|
21715
|
-
|
|
21716
|
-
|
|
21717
|
-
|
|
21718
|
-
|
|
21719
|
-
|
|
21720
|
-
|
|
21721
|
-
|
|
21722
|
-
|
|
21723
|
-
|
|
21891
|
+
app34.route("/api/health", health_default);
|
|
21892
|
+
app34.route("/api/session", session_default);
|
|
21893
|
+
app34.route("/api/chat", chat_default);
|
|
21894
|
+
app34.route("/api/group", group_default);
|
|
21895
|
+
app34.route("/api/access", access_default);
|
|
21896
|
+
app34.route("/api/telegram", telegram_default);
|
|
21897
|
+
app34.route("/api/whatsapp", whatsapp_default);
|
|
21898
|
+
app34.route("/api/onboarding", onboarding_default);
|
|
21899
|
+
app34.route("/api/admin", admin_default);
|
|
21724
21900
|
var SAFE_SLUG_RE = /^[a-z][a-z0-9-]{2,49}$/;
|
|
21725
21901
|
var SAFE_FILENAME_RE = /^[a-z0-9_][a-z0-9_.-]{0,99}$/i;
|
|
21726
21902
|
var IMAGE_MIME = {
|
|
@@ -21732,7 +21908,7 @@ var IMAGE_MIME = {
|
|
|
21732
21908
|
".svg": "image/svg+xml",
|
|
21733
21909
|
".ico": "image/x-icon"
|
|
21734
21910
|
};
|
|
21735
|
-
|
|
21911
|
+
app34.get("/agent-assets/:slug/:filename", (c) => {
|
|
21736
21912
|
const slug = c.req.param("slug");
|
|
21737
21913
|
const filename = c.req.param("filename");
|
|
21738
21914
|
if (!SAFE_SLUG_RE.test(slug)) {
|
|
@@ -21767,7 +21943,7 @@ app32.get("/agent-assets/:slug/:filename", (c) => {
|
|
|
21767
21943
|
"Cache-Control": "public, max-age=3600"
|
|
21768
21944
|
});
|
|
21769
21945
|
});
|
|
21770
|
-
|
|
21946
|
+
app34.get("/generated/:filename", (c) => {
|
|
21771
21947
|
const filename = c.req.param("filename");
|
|
21772
21948
|
if (!SAFE_FILENAME_RE.test(filename) || filename.includes("..")) {
|
|
21773
21949
|
console.error(`[generated] serve file=${filename} status=403`);
|
|
@@ -21932,7 +22108,7 @@ function brandedPublicHtml(agentSlug) {
|
|
|
21932
22108
|
function escapeHtml2(s) {
|
|
21933
22109
|
return s.replace(/&/g, "&").replace(/"/g, """).replace(/</g, "<").replace(/>/g, ">");
|
|
21934
22110
|
}
|
|
21935
|
-
|
|
22111
|
+
app34.get("/", (c) => {
|
|
21936
22112
|
const host = (c.req.header("host") ?? "").split(":")[0];
|
|
21937
22113
|
if (isPublicHost(host)) {
|
|
21938
22114
|
const defaultSlug = resolveDefaultSlug();
|
|
@@ -21940,12 +22116,12 @@ app32.get("/", (c) => {
|
|
|
21940
22116
|
}
|
|
21941
22117
|
return c.html(cachedHtml("index.html"));
|
|
21942
22118
|
});
|
|
21943
|
-
|
|
22119
|
+
app34.get("/public", (c) => {
|
|
21944
22120
|
const host = (c.req.header("host") ?? "").split(":")[0];
|
|
21945
22121
|
if (isPublicHost(host)) return c.text("Not found", 404);
|
|
21946
22122
|
return c.html(cachedHtml("public.html"));
|
|
21947
22123
|
});
|
|
21948
|
-
|
|
22124
|
+
app34.get("/chat", (c) => {
|
|
21949
22125
|
const host = (c.req.header("host") ?? "").split(":")[0];
|
|
21950
22126
|
if (isPublicHost(host)) return c.text("Not found", 404);
|
|
21951
22127
|
return c.html(cachedHtml("public.html"));
|
|
@@ -21964,9 +22140,9 @@ async function logViewerFetch(c, next) {
|
|
|
21964
22140
|
duration_ms: Date.now() - start
|
|
21965
22141
|
});
|
|
21966
22142
|
}
|
|
21967
|
-
|
|
21968
|
-
|
|
21969
|
-
|
|
22143
|
+
app34.use("/vnc-viewer.html", logViewerFetch);
|
|
22144
|
+
app34.use("/vnc-popout.html", logViewerFetch);
|
|
22145
|
+
app34.get("/vnc-popout.html", (c) => {
|
|
21970
22146
|
let html = htmlCache.get("vnc-popout.html");
|
|
21971
22147
|
if (!html) {
|
|
21972
22148
|
html = readFileSync26(resolve30(process.cwd(), "public", "vnc-popout.html"), "utf-8");
|
|
@@ -21979,7 +22155,7 @@ app32.get("/vnc-popout.html", (c) => {
|
|
|
21979
22155
|
}
|
|
21980
22156
|
return c.html(html);
|
|
21981
22157
|
});
|
|
21982
|
-
|
|
22158
|
+
app34.post("/api/vnc/client-event", async (c) => {
|
|
21983
22159
|
let body;
|
|
21984
22160
|
try {
|
|
21985
22161
|
body = await c.req.json();
|
|
@@ -22000,20 +22176,20 @@ app32.post("/api/vnc/client-event", async (c) => {
|
|
|
22000
22176
|
});
|
|
22001
22177
|
return c.json({ ok: true });
|
|
22002
22178
|
});
|
|
22003
|
-
|
|
22179
|
+
app34.get("/g/:slug", (c) => {
|
|
22004
22180
|
return c.html(brandedPublicHtml());
|
|
22005
22181
|
});
|
|
22006
|
-
|
|
22182
|
+
app34.get("/graph", (c) => {
|
|
22007
22183
|
const host = (c.req.header("host") ?? "").split(":")[0];
|
|
22008
22184
|
if (isPublicHost(host)) return c.text("Not found", 404);
|
|
22009
22185
|
return c.html(cachedHtml("graph.html"));
|
|
22010
22186
|
});
|
|
22011
|
-
|
|
22187
|
+
app34.get("/data", (c) => {
|
|
22012
22188
|
const host = (c.req.header("host") ?? "").split(":")[0];
|
|
22013
22189
|
if (isPublicHost(host)) return c.text("Not found", 404);
|
|
22014
22190
|
return c.html(cachedHtml("data.html"));
|
|
22015
22191
|
});
|
|
22016
|
-
|
|
22192
|
+
app34.get("/:slug", async (c, next) => {
|
|
22017
22193
|
const slug = c.req.param("slug");
|
|
22018
22194
|
if (AGENT_SLUG_PATTERN.test(`/${slug}`)) {
|
|
22019
22195
|
const branding = loadBrandingCache(slug);
|
|
@@ -22022,10 +22198,10 @@ app32.get("/:slug", async (c, next) => {
|
|
|
22022
22198
|
}
|
|
22023
22199
|
await next();
|
|
22024
22200
|
});
|
|
22025
|
-
|
|
22201
|
+
app34.use("/*", serveStatic({ root: "./public" }));
|
|
22026
22202
|
var port = parseInt(process.env.PORT ?? "19200", 10);
|
|
22027
22203
|
var hostname = process.env.HOSTNAME ?? "0.0.0.0";
|
|
22028
|
-
var httpServer = serve({ fetch:
|
|
22204
|
+
var httpServer = serve({ fetch: app34.fetch, port, hostname });
|
|
22029
22205
|
attachVncWsProxy(httpServer, {
|
|
22030
22206
|
isPublicHost,
|
|
22031
22207
|
upstreamHost: "127.0.0.1",
|
|
@@ -22071,7 +22247,7 @@ for (const m of SUBAPP_MANIFEST) {
|
|
|
22071
22247
|
}
|
|
22072
22248
|
try {
|
|
22073
22249
|
const registered = [];
|
|
22074
|
-
for (const r of
|
|
22250
|
+
for (const r of app34.routes ?? []) {
|
|
22075
22251
|
if (typeof r.path !== "string" || r.path.includes(":") || r.path.includes("*")) continue;
|
|
22076
22252
|
if (AGENT_SLUG_PATTERN.test(r.path)) {
|
|
22077
22253
|
registered.push({ method: (r.method ?? "ALL").toUpperCase(), path: r.path });
|
|
File without changes
|