@rubytech/create-maxy-code 0.1.292 → 0.1.294
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/package-lock.json +18 -1
- package/payload/platform/plugins/admin/skills/platform-architecture/SKILL.md +4 -2
- package/payload/platform/plugins/docs/references/admin-ui.md +2 -0
- package/payload/platform/plugins/docs/references/platform.md +1 -1
- package/payload/platform/services/claude-session-manager/dist/http-server.d.ts.map +1 -1
- package/payload/platform/services/claude-session-manager/dist/http-server.js +5 -0
- package/payload/platform/services/claude-session-manager/dist/http-server.js.map +1 -1
- package/payload/platform/services/claude-session-manager/dist/public-agent-reachability.d.ts +1 -1
- package/payload/platform/services/claude-session-manager/dist/public-agent-reachability.d.ts.map +1 -1
- package/payload/platform/services/claude-session-manager/dist/public-agent-reachability.js +1 -1
- package/payload/platform/services/claude-session-manager/dist/public-agent-reachability.js.map +1 -1
- package/payload/platform/services/webchat-channel/dist/server.d.ts +37 -1
- package/payload/platform/services/webchat-channel/dist/server.d.ts.map +1 -1
- package/payload/platform/services/webchat-channel/dist/server.js +43 -13
- package/payload/platform/services/webchat-channel/dist/server.js.map +1 -1
- package/payload/platform/services/whatsapp-channel/dist/server.d.ts +37 -1
- package/payload/platform/services/whatsapp-channel/dist/server.d.ts.map +1 -1
- package/payload/platform/services/whatsapp-channel/dist/server.js +43 -13
- package/payload/platform/services/whatsapp-channel/dist/server.js.map +1 -1
- package/payload/server/{chunk-QDCBAHPI.js → chunk-7H4KMTMC.js} +1 -1
- package/payload/server/maxy-edge.js +1 -1
- package/payload/server/public/assets/AdminShell-t3IuI7JZ.js +1 -0
- package/payload/server/public/assets/Checkbox-DxOCnNT7.js +1 -0
- package/payload/server/public/assets/Transcript-BIhFafaZ.js +1 -0
- package/payload/server/public/assets/admin-CGjBmQRF.js +1 -0
- package/payload/server/public/assets/{arc-yRinR5h4.js → arc-CL2g6wtE.js} +1 -1
- package/payload/server/public/assets/architecture-YZFGNWBL-DLCnSHk9.js +1 -0
- package/payload/server/public/assets/{architectureDiagram-Q4EWVU46-d4iT6VnY.js → architectureDiagram-Q4EWVU46-B6pI_4kf.js} +1 -1
- package/payload/server/public/assets/{blockDiagram-DXYQGD6D-o5Tjd8VR.js → blockDiagram-DXYQGD6D-OTjX8onE.js} +1 -1
- package/payload/server/public/assets/browser-Bf0v--kb.js +1 -0
- package/payload/server/public/assets/{c4Diagram-AHTNJAMY-B8IQ2a83.js → c4Diagram-AHTNJAMY-d3BJbhwh.js} +1 -1
- package/payload/server/public/assets/channel-BEqls8-f.js +1 -0
- package/payload/server/public/assets/chat-DJ3nvES3.js +1 -0
- package/payload/server/public/assets/{chunk-2KRD3SAO-DAJbbBPY.js → chunk-2KRD3SAO-CjdgBkCI.js} +1 -1
- package/payload/server/public/assets/chunk-336JU56O-77Kuo1_M.js +2 -0
- package/payload/server/public/assets/chunk-426QAEUC-TEFdhIy5.js +1 -0
- package/payload/server/public/assets/{chunk-4BX2VUAB-BTCTbhtf.js → chunk-4BX2VUAB-CJ-bacvW.js} +1 -1
- package/payload/server/public/assets/{chunk-4TB4RGXK-k-V-xUC9.js → chunk-4TB4RGXK-C7oTm4E0.js} +1 -1
- package/payload/server/public/assets/{chunk-55IACEB6-BY026nUv.js → chunk-55IACEB6-BGVu8gHm.js} +1 -1
- package/payload/server/public/assets/{chunk-5FUZZQ4R-DMLY3acx.js → chunk-5FUZZQ4R-BBHRG4DD.js} +1 -1
- package/payload/server/public/assets/{chunk-5PVQY5BW-Dw-Sd9tl.js → chunk-5PVQY5BW-BbxYk0vN.js} +1 -1
- package/payload/server/public/assets/{chunk-67CJDMHE-Dl7bLJGe.js → chunk-67CJDMHE-DCXRVLld.js} +1 -1
- package/payload/server/public/assets/{chunk-7N4EOEYR-CFBOyqnD.js → chunk-7N4EOEYR-Cb8gnv2L.js} +1 -1
- package/payload/server/public/assets/{chunk-AA7GKIK3-BnnqjSlh.js → chunk-AA7GKIK3-BDKd8RHS.js} +1 -1
- package/payload/server/public/assets/{chunk-BSJP7CBP-DKCTDAZE.js → chunk-BSJP7CBP-C-a5U7hf.js} +1 -1
- package/payload/server/public/assets/{chunk-CIAEETIT-jjeAEkQy.js → chunk-CIAEETIT-C2s4AWWp.js} +1 -1
- package/payload/server/public/assets/{chunk-EDXVE4YY-DtpX8vYJ.js → chunk-EDXVE4YY-C_NxZc3q.js} +1 -1
- package/payload/server/public/assets/{chunk-ENJZ2VHE-TxT7_-ER.js → chunk-ENJZ2VHE-CP-iwXd0.js} +1 -1
- package/payload/server/public/assets/{chunk-FMBD7UC4-B0zglVlf.js → chunk-FMBD7UC4-Cb04mvB7.js} +1 -1
- package/payload/server/public/assets/{chunk-FOC6F5B3-COVX_UuK.js → chunk-FOC6F5B3-B1tHdg5H.js} +1 -1
- package/payload/server/public/assets/{chunk-ICPOFSXX-CPrjaFl6.js → chunk-ICPOFSXX-BlGsRet_.js} +2 -2
- package/payload/server/public/assets/{chunk-K5T4RW27-Bav1KRIS.js → chunk-K5T4RW27-I1-reqf9.js} +1 -1
- package/payload/server/public/assets/{chunk-KGLVRYIC-nj7A12cJ.js → chunk-KGLVRYIC-Dz5VoWZh.js} +1 -1
- package/payload/server/public/assets/{chunk-LIHQZDEY-BmMkL9jD.js → chunk-LIHQZDEY-CJVhgo59.js} +1 -1
- package/payload/server/public/assets/{chunk-ORNJ4GCN-BvGwrI3j.js → chunk-ORNJ4GCN-B236VjaQ.js} +1 -1
- package/payload/server/public/assets/{chunk-OYMX7WX6-CmoWgYtj.js → chunk-OYMX7WX6-CqSmIaQf.js} +1 -1
- package/payload/server/public/assets/chunk-QZHKN3VN-CcHV2DdO.js +1 -0
- package/payload/server/public/assets/{chunk-U2HBQHQK-stvjyyuR.js → chunk-U2HBQHQK-CeMKC3D0.js} +1 -1
- package/payload/server/public/assets/{chunk-X2U36JSP-qAuy5Y44.js → chunk-X2U36JSP-DK30THxZ.js} +1 -1
- package/payload/server/public/assets/{chunk-XPW4576I-DpLw5_cw.js → chunk-XPW4576I-DVW18Ukl.js} +1 -1
- package/payload/server/public/assets/{chunk-YZCP3GAM-Vk12yILs.js → chunk-YZCP3GAM-DxfWX7Ap.js} +1 -1
- package/payload/server/public/assets/{chunk-ZZ45TVLE-WJVrlWz_.js → chunk-ZZ45TVLE-BEQSVm39.js} +1 -1
- package/payload/server/public/assets/classDiagram-6PBFFD2Q-CtuzQYGd.js +1 -0
- package/payload/server/public/assets/classDiagram-v2-HSJHXN6E-CnyF9bus.js +1 -0
- package/payload/server/public/assets/clone-HKYySpjZ.js +1 -0
- package/payload/server/public/assets/{cose-bilkent-S5V4N54A-bCIQHniJ.js → cose-bilkent-S5V4N54A-BcEd1xsZ.js} +1 -1
- package/payload/server/public/assets/{dagre--B-g8MLT.js → dagre-Ch3nCevh.js} +1 -1
- package/payload/server/public/assets/{dagre-KV5264BT-BHFfoLq0.js → dagre-KV5264BT-BBzAnJNh.js} +1 -1
- package/payload/server/public/assets/data-BNqGUTEs.js +1 -0
- package/payload/server/public/assets/{diagram-5BDNPKRD-TvCFSaXd.js → diagram-5BDNPKRD-BG13t9mu.js} +1 -1
- package/payload/server/public/assets/{diagram-G4DWMVQ6-8flGaFB_.js → diagram-G4DWMVQ6-DYh2zRvB.js} +1 -1
- package/payload/server/public/assets/{diagram-MMDJMWI5-Dag0WBhV.js → diagram-MMDJMWI5-CNMjDPoP.js} +1 -1
- package/payload/server/public/assets/{diagram-TYMM5635-u7wh2Nwj.js → diagram-TYMM5635-BAb8gFOW.js} +1 -1
- package/payload/server/public/assets/{erDiagram-SMLLAGMA-DBTHDFh_.js → erDiagram-SMLLAGMA-Dy4ADi6A.js} +1 -1
- package/payload/server/public/assets/file-download-BUeQHzJD.js +1 -0
- package/payload/server/public/assets/{flatten-CpKIi5d2.js → flatten-E2Sr0FeD.js} +1 -1
- package/payload/server/public/assets/{flowDiagram-DWJPFMVM-C4bd2cb-.js → flowDiagram-DWJPFMVM-DSMf9IO0.js} +1 -1
- package/payload/server/public/assets/{ganttDiagram-T4ZO3ILL-DrfpI4Gl.js → ganttDiagram-T4ZO3ILL-DRj0wip6.js} +1 -1
- package/payload/server/public/assets/gitGraph-7Q5UKJZL-DOHzO_KB.js +1 -0
- package/payload/server/public/assets/{gitGraphDiagram-UUTBAWPF-a_WyzWRQ.js → gitGraphDiagram-UUTBAWPF-D5s87wIr.js} +1 -1
- package/payload/server/public/assets/{graph-qR6IbCv1.js → graph-C4FX88ML.js} +19 -19
- package/payload/server/public/assets/graph-labels-DsXyfwKP.js +1 -0
- package/payload/server/public/assets/{graphlib-B85zmy3s.js → graphlib-DBueCu-j.js} +1 -1
- package/payload/server/public/assets/info-OMHHGYJF-CgstATO5.js +1 -0
- package/payload/server/public/assets/infoDiagram-42DDH7IO--6bwMJZM.js +2 -0
- package/payload/server/public/assets/{isEmpty-C3Vxk1It.js → isEmpty-CLz-UprQ.js} +1 -1
- package/payload/server/public/assets/{ishikawaDiagram-UXIWVN3A-3jXIqGtb.js → ishikawaDiagram-UXIWVN3A-BoMwv4cD.js} +1 -1
- package/payload/server/public/assets/{journeyDiagram-VCZTEJTY-BXrBb8KE.js → journeyDiagram-VCZTEJTY-BkKxK7iC.js} +1 -1
- package/payload/server/public/assets/{useSelectionMode-CQBRZjvc.css → jsx-runtime-61OZ_8PV.css} +1 -1
- package/payload/server/public/assets/jsx-runtime-GpAtq6d8.js +9 -0
- package/payload/server/public/assets/{kanban-definition-6JOO6SKY-Dc5vZnuT.js → kanban-definition-6JOO6SKY-BSrkzXlb.js} +1 -1
- package/payload/server/public/assets/{line-x0RuVReA.js → line-CMDTDopn.js} +1 -1
- package/payload/server/public/assets/{linear-Cdt0EBMa.js → linear-CKifLODy.js} +1 -1
- package/payload/server/public/assets/{mermaid-parser.core-CBRGDK2w.js → mermaid-parser.core-CEH6m0Lv.js} +2 -2
- package/payload/server/public/assets/mermaid.core-DyAGyaJG.js +11 -0
- package/payload/server/public/assets/mic-BXINsrwF.js +1 -0
- package/payload/server/public/assets/{mindmap-definition-QFDTVHPH-Bw-hRp-Y.js → mindmap-definition-QFDTVHPH-DLZa0d69.js} +1 -1
- package/payload/server/public/assets/{ordinal-BLrOss5K.js → ordinal-5RtyPJVt.js} +1 -1
- package/payload/server/public/assets/packet-4T2RLAQJ-BRSJpaWt.js +1 -0
- package/payload/server/public/assets/pie-ZZUOXDRM-B5VBvTzX.js +1 -0
- package/payload/server/public/assets/{pieDiagram-DEJITSTG-C2DTjmdf.js → pieDiagram-DEJITSTG-zTOJvniq.js} +1 -1
- package/payload/server/public/assets/{public-tk3PfPWF.js → public-Cya9ie76.js} +5 -5
- package/payload/server/public/assets/{quadrantDiagram-34T5L4WZ-Ffhnv5Ih.js → quadrantDiagram-34T5L4WZ-CHzDGI4U.js} +1 -1
- package/payload/server/public/assets/radar-PYXPWWZC-CWBqEfap.js +1 -0
- package/payload/server/public/assets/{reduce-C5tBOlxC.js → reduce-B3Mw_0s1.js} +1 -1
- package/payload/server/public/assets/{requirementDiagram-MS252O5E-y7-gOSmI.js → requirementDiagram-MS252O5E-CrrYBRTT.js} +1 -1
- package/payload/server/public/assets/{sankeyDiagram-XADWPNL6-CMwArh7T.js → sankeyDiagram-XADWPNL6-EEi77dbS.js} +1 -1
- package/payload/server/public/assets/{sequenceDiagram-FGHM5R23-C8obTGl1.js → sequenceDiagram-FGHM5R23-BNeO1Hdg.js} +1 -1
- package/payload/server/public/assets/sliders-horizontal-CUmlgKbR.js +1 -0
- package/payload/server/public/assets/{stateDiagram-FHFEXIEX-BZHsj7kJ.js → stateDiagram-FHFEXIEX-9Zyf6fFj.js} +1 -1
- package/payload/server/public/assets/stateDiagram-v2-QKLJ7IA2-PeqMIgxs.js +1 -0
- package/payload/server/public/assets/{timeline-definition-GMOUNBTQ-D-fo_L7-.js → timeline-definition-GMOUNBTQ-DRCVn4rg.js} +1 -1
- package/payload/server/public/assets/treeView-SZITEDCU-D8zjIvCq.js +1 -0
- package/payload/server/public/assets/treemap-W4RFUUIX-DQW69zQK.js +1 -0
- package/payload/server/public/assets/useSelectionMode-CVoG6qb0.js +5 -0
- package/payload/server/public/assets/{vennDiagram-DHZGUBPP--aEWsS70.js → vennDiagram-DHZGUBPP-CNaA1Bcg.js} +1 -1
- package/payload/server/public/assets/wardley-RL74JXVD-CDTm6Cdu.js +1 -0
- package/payload/server/public/assets/{wardleyDiagram-NUSXRM2D-DFWrB0Kk.js → wardleyDiagram-NUSXRM2D-9BoBW3Oo.js} +1 -1
- package/payload/server/public/assets/{xychartDiagram-5P7HB3ND-DZsTZHC6.js → xychartDiagram-5P7HB3ND-CAXyPTsj.js} +1 -1
- package/payload/server/public/browser.html +7 -6
- package/payload/server/public/chat.html +10 -6
- package/payload/server/public/data.html +6 -7
- package/payload/server/public/graph.html +10 -8
- package/payload/server/public/index.html +9 -8
- package/payload/server/public/public.html +6 -4
- package/payload/server/server.js +358 -247
- package/payload/server/public/assets/AdminShell-CpRQprdb.js +0 -1
- package/payload/server/public/assets/Checkbox-hYA5LjZ5.js +0 -1
- package/payload/server/public/assets/SidebarSplitter-D0mErwLL.js +0 -1
- package/payload/server/public/assets/Transcript-BaC574J0.js +0 -1
- package/payload/server/public/assets/admin-BVasculM.js +0 -1
- package/payload/server/public/assets/architecture-YZFGNWBL-B2UAw-4R.js +0 -1
- package/payload/server/public/assets/browser-CwU2ReNI.js +0 -1
- package/payload/server/public/assets/channel-CizJU0ud.js +0 -1
- package/payload/server/public/assets/chat-NxS8JsVQ.js +0 -1
- package/payload/server/public/assets/chunk-336JU56O-1-fVU2_7.js +0 -2
- package/payload/server/public/assets/chunk-426QAEUC-CAPR5ZG1.js +0 -1
- package/payload/server/public/assets/chunk-QZHKN3VN-COXR_N4N.js +0 -1
- package/payload/server/public/assets/classDiagram-6PBFFD2Q-kzz9ab1y.js +0 -1
- package/payload/server/public/assets/classDiagram-v2-HSJHXN6E-NFfOmc0C.js +0 -1
- package/payload/server/public/assets/clone-C15qvnbX.js +0 -1
- package/payload/server/public/assets/data-CebDWao6.js +0 -1
- package/payload/server/public/assets/gitGraph-7Q5UKJZL-CwwaM7ed.js +0 -1
- package/payload/server/public/assets/graph-labels-DznU92XA.js +0 -1
- package/payload/server/public/assets/info-OMHHGYJF-CiiU112m.js +0 -1
- package/payload/server/public/assets/infoDiagram-42DDH7IO-g9Re1Ubl.js +0 -2
- package/payload/server/public/assets/mermaid.core-DeYYeYyM.js +0 -11
- package/payload/server/public/assets/packet-4T2RLAQJ-Bq_zPNb3.js +0 -1
- package/payload/server/public/assets/pie-ZZUOXDRM-R-cewHYM.js +0 -1
- package/payload/server/public/assets/radar-PYXPWWZC-CZpBUjmo.js +0 -1
- package/payload/server/public/assets/stateDiagram-v2-QKLJ7IA2-fK1TrvKX.js +0 -1
- package/payload/server/public/assets/treeView-SZITEDCU-CjsdVrjr.js +0 -1
- package/payload/server/public/assets/treemap-W4RFUUIX-BZ8peN4O.js +0 -1
- package/payload/server/public/assets/useSelectionMode-CJ2UADOe.js +0 -13
- package/payload/server/public/assets/wardley-RL74JXVD-BYLmRSDV.js +0 -1
- /package/payload/server/public/assets/{_baseFor-WfS9pKAn.js → _baseFor-DVaNaTfF.js} +0 -0
- /package/payload/server/public/assets/{array-HeX70jSN.js → array-8_H1156C.js} +0 -0
- /package/payload/server/public/assets/{cytoscape.esm-CDZo0kst.js → cytoscape.esm-h10p_6j-.js} +0 -0
- /package/payload/server/public/assets/{defaultLocale-GJwWH1Jr.js → defaultLocale-pD7tFa1r.js} +0 -0
- /package/payload/server/public/assets/{dist-ePW3hz19.js → dist-DHQbMi0P.js} +0 -0
- /package/payload/server/public/assets/{AdminShell-qc_xy7Az.css → file-download-qc_xy7Az.css} +0 -0
- /package/payload/server/public/assets/{init-BPLPMQ3Y.js → init-CwJ4b81e.js} +0 -0
- /package/payload/server/public/assets/{katex-CKZ-HWMQ.js → katex-DJPjIBAI.js} +0 -0
- /package/payload/server/public/assets/{path-YdFzr2W6.js → path-CK8wrAxY.js} +0 -0
- /package/payload/server/public/assets/{rough.esm-HAx67Hnb.js → rough.esm-Dwml_la6.js} +0 -0
- /package/payload/server/public/assets/{src-DssjGmtU.js → src-CglFLxOI.js} +0 -0
package/payload/server/server.js
CHANGED
|
@@ -97,7 +97,7 @@ import {
|
|
|
97
97
|
vncLog,
|
|
98
98
|
walkPremiumBundles,
|
|
99
99
|
writeAdminUserAndPerson
|
|
100
|
-
} from "./chunk-
|
|
100
|
+
} from "./chunk-7H4KMTMC.js";
|
|
101
101
|
import {
|
|
102
102
|
__commonJS,
|
|
103
103
|
__toESM
|
|
@@ -7706,9 +7706,44 @@ var whatsapp_reader_default = app5;
|
|
|
7706
7706
|
import { basename as basename3, dirname as dirname2 } from "path";
|
|
7707
7707
|
import { join as join10 } from "path";
|
|
7708
7708
|
var WEBCHAT_ADMIN_KEY = "webchat-admin";
|
|
7709
|
+
var NO_INDICATORS = {
|
|
7710
|
+
activity: null,
|
|
7711
|
+
permissionMode: null,
|
|
7712
|
+
effectivePermissionMode: null,
|
|
7713
|
+
model: null
|
|
7714
|
+
};
|
|
7715
|
+
var indicatorsErrorLogged = false;
|
|
7716
|
+
var INDICATORS_TIMEOUT_MS = 1500;
|
|
7717
|
+
async function fetchComposerIndicators(sessionId) {
|
|
7718
|
+
let port2;
|
|
7719
|
+
try {
|
|
7720
|
+
port2 = requirePortEnv("CLAUDE_SESSION_MANAGER_PORT", { tag: "webchat:session" });
|
|
7721
|
+
} catch {
|
|
7722
|
+
return NO_INDICATORS;
|
|
7723
|
+
}
|
|
7724
|
+
try {
|
|
7725
|
+
const res = await fetch(`http://127.0.0.1:${port2}/${sessionId}/meta`, {
|
|
7726
|
+
signal: AbortSignal.timeout(INDICATORS_TIMEOUT_MS)
|
|
7727
|
+
});
|
|
7728
|
+
if (!res.ok) return NO_INDICATORS;
|
|
7729
|
+
const body = await res.json();
|
|
7730
|
+
return {
|
|
7731
|
+
activity: typeof body.activity === "string" ? body.activity : null,
|
|
7732
|
+
permissionMode: typeof body.permissionMode === "string" ? body.permissionMode : null,
|
|
7733
|
+
effectivePermissionMode: typeof body.effectivePermissionMode === "string" ? body.effectivePermissionMode : null,
|
|
7734
|
+
model: typeof body.model === "string" ? body.model : null
|
|
7735
|
+
};
|
|
7736
|
+
} catch (err) {
|
|
7737
|
+
if (!indicatorsErrorLogged) {
|
|
7738
|
+
indicatorsErrorLogged = true;
|
|
7739
|
+
console.error(`[webchat:session] indicators-unavailable detail=${err instanceof Error ? err.message : String(err)} (logged once per process)`);
|
|
7740
|
+
}
|
|
7741
|
+
return NO_INDICATORS;
|
|
7742
|
+
}
|
|
7743
|
+
}
|
|
7709
7744
|
function createWebchatRoutes(deps) {
|
|
7710
|
-
const
|
|
7711
|
-
|
|
7745
|
+
const app49 = new Hono();
|
|
7746
|
+
app49.post("/send", requireAdminSession, async (c) => {
|
|
7712
7747
|
const body = await c.req.json().catch(() => null);
|
|
7713
7748
|
const text = body?.text;
|
|
7714
7749
|
if (typeof text !== "string" || text.length === 0) {
|
|
@@ -7725,7 +7760,7 @@ function createWebchatRoutes(deps) {
|
|
|
7725
7760
|
await deps.handleInbound({ role: "admin", accountId, key: WEBCHAT_ADMIN_KEY, text });
|
|
7726
7761
|
return c.json({ ok: true });
|
|
7727
7762
|
});
|
|
7728
|
-
|
|
7763
|
+
app49.get("/session", requireAdminSession, async (c) => {
|
|
7729
7764
|
let accountId;
|
|
7730
7765
|
try {
|
|
7731
7766
|
accountId = resolvePlatformAccountId();
|
|
@@ -7745,10 +7780,90 @@ function createWebchatRoutes(deps) {
|
|
|
7745
7780
|
}
|
|
7746
7781
|
}
|
|
7747
7782
|
}
|
|
7748
|
-
|
|
7783
|
+
const indicators = await fetchComposerIndicators(sessionId);
|
|
7784
|
+
return c.json({ sessionId, projectDir, ...indicators });
|
|
7749
7785
|
});
|
|
7750
|
-
return
|
|
7786
|
+
return app49;
|
|
7787
|
+
}
|
|
7788
|
+
|
|
7789
|
+
// server/routes/webchat-greeting.ts
|
|
7790
|
+
var OUTSTANDING_TASK_STATUSES = ["pending", "active", "running"];
|
|
7791
|
+
var UPCOMING_EVENT_STATUSES = ["scheduled", "due"];
|
|
7792
|
+
var TASK_ITEMS_CAP = 5;
|
|
7793
|
+
var EVENTS_CYPHER = `
|
|
7794
|
+
MATCH (e:Event)
|
|
7795
|
+
WHERE e.accountId = $accountId
|
|
7796
|
+
AND e.eventStatus IN $statuses
|
|
7797
|
+
AND coalesce(e.nextRun, e.startDate) >= $now
|
|
7798
|
+
RETURN e.eventId AS eventId, e.name AS name,
|
|
7799
|
+
coalesce(e.nextRun, e.startDate) AS at
|
|
7800
|
+
ORDER BY at ASC
|
|
7801
|
+
LIMIT 5`;
|
|
7802
|
+
var TASKS_CYPHER = `
|
|
7803
|
+
MATCH (t:Task)
|
|
7804
|
+
WHERE t.accountId = $accountId
|
|
7805
|
+
AND t.status IN $statuses
|
|
7806
|
+
WITH t ORDER BY coalesce(t.createdAt, '') ASC
|
|
7807
|
+
WITH collect({ taskId: t.taskId, name: t.name, status: t.status }) AS all
|
|
7808
|
+
RETURN all[0..${TASK_ITEMS_CAP}] AS items, size(all) AS total`;
|
|
7809
|
+
var app6 = new Hono();
|
|
7810
|
+
app6.get("/", requireAdminSession, async (c) => {
|
|
7811
|
+
const cacheKey = c.var.cacheKey;
|
|
7812
|
+
const accountId = getAccountIdForSession(cacheKey);
|
|
7813
|
+
if (!accountId) {
|
|
7814
|
+
console.error("[webchat:greeting] op=read-failed reason=no-account-for-session");
|
|
7815
|
+
return c.json({ ok: false });
|
|
7816
|
+
}
|
|
7817
|
+
const started = Date.now();
|
|
7818
|
+
let session;
|
|
7819
|
+
try {
|
|
7820
|
+
session = getSession();
|
|
7821
|
+
const { events, tasks } = await session.executeRead(
|
|
7822
|
+
async (tx) => {
|
|
7823
|
+
const now = (/* @__PURE__ */ new Date()).toISOString();
|
|
7824
|
+
const eventsResult = await tx.run(EVENTS_CYPHER, {
|
|
7825
|
+
accountId,
|
|
7826
|
+
statuses: UPCOMING_EVENT_STATUSES,
|
|
7827
|
+
now
|
|
7828
|
+
});
|
|
7829
|
+
const tasksResult = await tx.run(TASKS_CYPHER, {
|
|
7830
|
+
accountId,
|
|
7831
|
+
statuses: OUTSTANDING_TASK_STATUSES
|
|
7832
|
+
});
|
|
7833
|
+
const events2 = eventsResult.records.map((r) => ({
|
|
7834
|
+
eventId: String(r.get("eventId")),
|
|
7835
|
+
name: String(r.get("name")),
|
|
7836
|
+
at: String(r.get("at"))
|
|
7837
|
+
}));
|
|
7838
|
+
const tasksRecord = tasksResult.records[0];
|
|
7839
|
+
const rawTotal = tasksRecord ? r2n(tasksRecord.get("total")) : 0;
|
|
7840
|
+
const tasks2 = {
|
|
7841
|
+
items: tasksRecord ? tasksRecord.get("items") : [],
|
|
7842
|
+
total: rawTotal
|
|
7843
|
+
};
|
|
7844
|
+
return { events: events2, tasks: tasks2 };
|
|
7845
|
+
}
|
|
7846
|
+
);
|
|
7847
|
+
console.log(
|
|
7848
|
+
`[webchat:greeting] op=read account=${accountId.slice(0, 8)} events=${events.length} tasks=${tasks.total} ms=${Date.now() - started}`
|
|
7849
|
+
);
|
|
7850
|
+
return c.json({ ok: true, events, tasks });
|
|
7851
|
+
} catch (err) {
|
|
7852
|
+
const detail = err instanceof Error ? err.message : String(err);
|
|
7853
|
+
console.error(`[webchat:greeting] op=read-failed reason=${detail}`);
|
|
7854
|
+
return c.json({ ok: false });
|
|
7855
|
+
} finally {
|
|
7856
|
+
await session?.close();
|
|
7857
|
+
}
|
|
7858
|
+
});
|
|
7859
|
+
function r2n(value) {
|
|
7860
|
+
if (typeof value === "number") return value;
|
|
7861
|
+
if (value && typeof value === "object" && "low" in value) {
|
|
7862
|
+
return Number(value.low);
|
|
7863
|
+
}
|
|
7864
|
+
return Number(value ?? 0);
|
|
7751
7865
|
}
|
|
7866
|
+
var webchat_greeting_default = app6;
|
|
7752
7867
|
|
|
7753
7868
|
// server/routes/telegram.ts
|
|
7754
7869
|
import { homedir } from "os";
|
|
@@ -7830,8 +7945,8 @@ async function sendTelegram(botToken, chatId, text) {
|
|
|
7830
7945
|
return { ok: false, error: e instanceof Error ? e.message : String(e) };
|
|
7831
7946
|
}
|
|
7832
7947
|
}
|
|
7833
|
-
var
|
|
7834
|
-
|
|
7948
|
+
var app7 = new Hono();
|
|
7949
|
+
app7.post("/", async (c) => {
|
|
7835
7950
|
const botParam = c.req.query("bot");
|
|
7836
7951
|
const botType = botParam === "admin" ? "admin" : botParam === "public" ? "public" : null;
|
|
7837
7952
|
if (!botType) {
|
|
@@ -7902,7 +8017,7 @@ app6.post("/", async (c) => {
|
|
|
7902
8017
|
})();
|
|
7903
8018
|
return c.json({ ok: true }, 200);
|
|
7904
8019
|
});
|
|
7905
|
-
var telegram_default =
|
|
8020
|
+
var telegram_default = app7;
|
|
7906
8021
|
|
|
7907
8022
|
// server/routes/onboarding.ts
|
|
7908
8023
|
import { spawn, spawnSync as spawnSync2, execFileSync as execFileSync2 } from "child_process";
|
|
@@ -8089,11 +8204,11 @@ async function waitForAuthPage(timeoutMs = 2e4) {
|
|
|
8089
8204
|
}
|
|
8090
8205
|
return false;
|
|
8091
8206
|
}
|
|
8092
|
-
var
|
|
8093
|
-
|
|
8207
|
+
var app8 = new Hono();
|
|
8208
|
+
app8.get("/claude-auth", async (c) => {
|
|
8094
8209
|
return c.json({ authenticated: await checkAuthStatus() });
|
|
8095
8210
|
});
|
|
8096
|
-
|
|
8211
|
+
app8.post("/claude-auth", async (c) => {
|
|
8097
8212
|
let body = {};
|
|
8098
8213
|
try {
|
|
8099
8214
|
body = await c.req.json();
|
|
@@ -8163,7 +8278,7 @@ app7.post("/claude-auth", async (c) => {
|
|
|
8163
8278
|
await waitForAuthPage(2e4);
|
|
8164
8279
|
return c.json({ started: true, transport });
|
|
8165
8280
|
});
|
|
8166
|
-
|
|
8281
|
+
app8.post("/set-pin", async (c) => {
|
|
8167
8282
|
let existingUsers = null;
|
|
8168
8283
|
try {
|
|
8169
8284
|
existingUsers = readUsersFile2();
|
|
@@ -8265,7 +8380,7 @@ ${body.pin}
|
|
|
8265
8380
|
}
|
|
8266
8381
|
return c.json({ ok: true });
|
|
8267
8382
|
});
|
|
8268
|
-
|
|
8383
|
+
app8.delete("/set-pin", async (c) => {
|
|
8269
8384
|
let users = null;
|
|
8270
8385
|
try {
|
|
8271
8386
|
users = readUsersFile2();
|
|
@@ -8299,7 +8414,7 @@ app7.delete("/set-pin", async (c) => {
|
|
|
8299
8414
|
}
|
|
8300
8415
|
return c.json({ ok: true });
|
|
8301
8416
|
});
|
|
8302
|
-
var onboarding_default =
|
|
8417
|
+
var onboarding_default = app8;
|
|
8303
8418
|
|
|
8304
8419
|
// server/routes/client-error.ts
|
|
8305
8420
|
import { appendFileSync, existsSync as existsSync11, renameSync as renameSync2, statSync as statSync6 } from "fs";
|
|
@@ -8355,8 +8470,8 @@ function rotateIfNeeded() {
|
|
|
8355
8470
|
console.error(`[client-error] log rotation failed: ${err instanceof Error ? err.message : String(err)}`);
|
|
8356
8471
|
}
|
|
8357
8472
|
}
|
|
8358
|
-
var
|
|
8359
|
-
|
|
8473
|
+
var app9 = new Hono();
|
|
8474
|
+
app9.post("/", async (c) => {
|
|
8360
8475
|
const client = resolveClientIp(
|
|
8361
8476
|
c.env?.incoming?.socket?.remoteAddress,
|
|
8362
8477
|
c.req.header("x-forwarded-for")
|
|
@@ -8458,7 +8573,7 @@ app8.post("/", async (c) => {
|
|
|
8458
8573
|
}
|
|
8459
8574
|
return c.json({ ok: true });
|
|
8460
8575
|
});
|
|
8461
|
-
var client_error_default =
|
|
8576
|
+
var client_error_default = app9;
|
|
8462
8577
|
|
|
8463
8578
|
// server/routes/admin/session.ts
|
|
8464
8579
|
import { randomUUID as randomUUID8 } from "crypto";
|
|
@@ -8516,8 +8631,8 @@ async function createAdminSession(accountId, thinkingView, userId, userName, rol
|
|
|
8516
8631
|
sessionId: initialSessionId
|
|
8517
8632
|
};
|
|
8518
8633
|
}
|
|
8519
|
-
var
|
|
8520
|
-
|
|
8634
|
+
var app10 = new Hono();
|
|
8635
|
+
app10.get("/", async (c) => {
|
|
8521
8636
|
const signedSessionToken = c.req.query("session_key");
|
|
8522
8637
|
if (!signedSessionToken) {
|
|
8523
8638
|
return c.json({ error: "Invalid or expired admin session" }, 401);
|
|
@@ -8563,7 +8678,7 @@ app9.get("/", async (c) => {
|
|
|
8563
8678
|
sessionId: getSessionIdForSession(cacheKey) ?? null
|
|
8564
8679
|
});
|
|
8565
8680
|
});
|
|
8566
|
-
|
|
8681
|
+
app10.post("/", async (c) => {
|
|
8567
8682
|
let body;
|
|
8568
8683
|
try {
|
|
8569
8684
|
body = await c.req.json();
|
|
@@ -8626,7 +8741,7 @@ app9.post("/", async (c) => {
|
|
|
8626
8741
|
const payload = await createAdminSession(selected.accountId, selected.config.thinkingView, userId, userName, selected.role, avatar);
|
|
8627
8742
|
return c.json(payload);
|
|
8628
8743
|
});
|
|
8629
|
-
var session_default =
|
|
8744
|
+
var session_default = app10;
|
|
8630
8745
|
|
|
8631
8746
|
// server/routes/admin/logs.ts
|
|
8632
8747
|
import { existsSync as existsSync13, readdirSync as readdirSync8, readFileSync as readFileSync14, statSync as statSync7 } from "fs";
|
|
@@ -8649,8 +8764,8 @@ function resolveSessionLogPaths(filename, logDirs) {
|
|
|
8649
8764
|
|
|
8650
8765
|
// server/routes/admin/logs.ts
|
|
8651
8766
|
var TAIL_BYTES = 8192;
|
|
8652
|
-
var
|
|
8653
|
-
|
|
8767
|
+
var app11 = new Hono();
|
|
8768
|
+
app11.get("/", async (c) => {
|
|
8654
8769
|
const fileParam = c.req.query("file");
|
|
8655
8770
|
const typeParam = c.req.query("type");
|
|
8656
8771
|
const sessionIdParam = c.req.query("sessionId");
|
|
@@ -8792,12 +8907,12 @@ app10.get("/", async (c) => {
|
|
|
8792
8907
|
}
|
|
8793
8908
|
return c.json({ logs });
|
|
8794
8909
|
});
|
|
8795
|
-
var logs_default =
|
|
8910
|
+
var logs_default = app11;
|
|
8796
8911
|
|
|
8797
8912
|
// server/routes/admin/claude-info.ts
|
|
8798
8913
|
import { execFileSync as execFileSync3 } from "child_process";
|
|
8799
|
-
var
|
|
8800
|
-
|
|
8914
|
+
var app12 = new Hono();
|
|
8915
|
+
app12.get("/", (c) => {
|
|
8801
8916
|
let version = "unknown";
|
|
8802
8917
|
try {
|
|
8803
8918
|
const raw = execFileSync3("claude", ["--version"], { encoding: "utf-8", timeout: 5e3 });
|
|
@@ -8815,14 +8930,14 @@ app11.get("/", (c) => {
|
|
|
8815
8930
|
const thinkingView = resolvedAccount?.config.thinkingView ?? "default";
|
|
8816
8931
|
return c.json({ version, account, model, thinkingView });
|
|
8817
8932
|
});
|
|
8818
|
-
var claude_info_default =
|
|
8933
|
+
var claude_info_default = app12;
|
|
8819
8934
|
|
|
8820
8935
|
// server/routes/admin/attachment.ts
|
|
8821
8936
|
import { readFile as readFile2, readdir } from "fs/promises";
|
|
8822
8937
|
import { existsSync as existsSync14 } from "fs";
|
|
8823
8938
|
import { resolve as resolve12 } from "path";
|
|
8824
|
-
var
|
|
8825
|
-
|
|
8939
|
+
var app13 = new Hono();
|
|
8940
|
+
app13.get("/:attachmentId", requireAdminSession, async (c) => {
|
|
8826
8941
|
const attachmentId = c.req.param("attachmentId");
|
|
8827
8942
|
const cacheKey = c.var.cacheKey;
|
|
8828
8943
|
const accountId = getAccountIdForSession(cacheKey);
|
|
@@ -8861,13 +8976,13 @@ app12.get("/:attachmentId", requireAdminSession, async (c) => {
|
|
|
8861
8976
|
}
|
|
8862
8977
|
});
|
|
8863
8978
|
});
|
|
8864
|
-
var attachment_default =
|
|
8979
|
+
var attachment_default = app13;
|
|
8865
8980
|
|
|
8866
8981
|
// server/routes/admin/agents.ts
|
|
8867
8982
|
import { resolve as resolve13 } from "path";
|
|
8868
8983
|
import { readdirSync as readdirSync9, readFileSync as readFileSync15, existsSync as existsSync15, rmSync } from "fs";
|
|
8869
|
-
var
|
|
8870
|
-
|
|
8984
|
+
var app14 = new Hono();
|
|
8985
|
+
app14.get("/", (c) => {
|
|
8871
8986
|
const account = resolveAccount();
|
|
8872
8987
|
if (!account) return c.json({ agents: [] });
|
|
8873
8988
|
const agentsDir = resolve13(account.accountDir, "agents");
|
|
@@ -8897,7 +9012,7 @@ app13.get("/", (c) => {
|
|
|
8897
9012
|
}
|
|
8898
9013
|
return c.json({ agents });
|
|
8899
9014
|
});
|
|
8900
|
-
|
|
9015
|
+
app14.delete("/:slug", async (c) => {
|
|
8901
9016
|
const slug = c.req.param("slug");
|
|
8902
9017
|
const account = resolveAccount();
|
|
8903
9018
|
if (!account) return c.json({ error: "No account resolved" }, 400);
|
|
@@ -8927,7 +9042,7 @@ app13.delete("/:slug", async (c) => {
|
|
|
8927
9042
|
return c.json({ error: "Failed to delete agent" }, 500);
|
|
8928
9043
|
}
|
|
8929
9044
|
});
|
|
8930
|
-
|
|
9045
|
+
app14.post("/:slug/project", async (c) => {
|
|
8931
9046
|
const slug = c.req.param("slug");
|
|
8932
9047
|
const account = resolveAccount();
|
|
8933
9048
|
if (!account) return c.json({ error: "No account resolved" }, 400);
|
|
@@ -8949,7 +9064,7 @@ app13.post("/:slug/project", async (c) => {
|
|
|
8949
9064
|
return c.json({ error: `Projection failed: ${msg}` }, 500);
|
|
8950
9065
|
}
|
|
8951
9066
|
});
|
|
8952
|
-
var agents_default =
|
|
9067
|
+
var agents_default = app14;
|
|
8953
9068
|
|
|
8954
9069
|
// server/routes/admin/sessions.ts
|
|
8955
9070
|
import crypto2 from "crypto";
|
|
@@ -9221,8 +9336,8 @@ function formatAge(updatedAtStr) {
|
|
|
9221
9336
|
return "unknown";
|
|
9222
9337
|
}
|
|
9223
9338
|
}
|
|
9224
|
-
var
|
|
9225
|
-
|
|
9339
|
+
var app15 = new Hono();
|
|
9340
|
+
app15.get("/", requireAdminSession, async (c) => {
|
|
9226
9341
|
const cacheKey = c.var.cacheKey;
|
|
9227
9342
|
const accountId = getAccountIdForSession(cacheKey);
|
|
9228
9343
|
if (!accountId) return c.json({ error: "Account not found for session" }, 401);
|
|
@@ -9252,7 +9367,7 @@ app14.get("/", requireAdminSession, async (c) => {
|
|
|
9252
9367
|
return c.json({ error: "Failed to fetch sessions" }, 500);
|
|
9253
9368
|
}
|
|
9254
9369
|
});
|
|
9255
|
-
|
|
9370
|
+
app15.post("/new", requireAdminSession, async (c) => {
|
|
9256
9371
|
const oldCacheKey = c.var.cacheKey;
|
|
9257
9372
|
console.log(`[admin-chat] new-conversation outcome=ingress cacheKey=${oldCacheKey.slice(0, 8)}`);
|
|
9258
9373
|
const accountId = getAccountIdForSession(oldCacheKey);
|
|
@@ -9269,7 +9384,7 @@ app14.post("/new", requireAdminSession, async (c) => {
|
|
|
9269
9384
|
console.log(`[admin-chat] new-conversation outcome=ok oldKey=${oldCacheKey.slice(0, 8)} newKey=${newCacheKey.slice(0, 8)}`);
|
|
9270
9385
|
return c.json({ session_key: newSignedSessionToken, sessionId: null });
|
|
9271
9386
|
});
|
|
9272
|
-
|
|
9387
|
+
app15.post("/switch", requireAdminSession, async (c) => {
|
|
9273
9388
|
const cacheKey = c.var.cacheKey;
|
|
9274
9389
|
const accountId = getAccountIdForSession(cacheKey);
|
|
9275
9390
|
const userId = getUserIdForSession(cacheKey);
|
|
@@ -9297,7 +9412,7 @@ app14.post("/switch", requireAdminSession, async (c) => {
|
|
|
9297
9412
|
console.log(`[session-switch] from=${cacheKey.slice(0, 8)} to=${targetCacheKey.slice(0, 8)} targetConvId=${targetSessionId?.slice(0, 8) ?? "none"} accountId=${accountId.slice(0, 8)}`);
|
|
9298
9413
|
return c.json({ session_key: targetSignedSessionToken, sessionId: targetSessionId });
|
|
9299
9414
|
});
|
|
9300
|
-
|
|
9415
|
+
app15.delete("/:id", requireAdminSession, async (c) => {
|
|
9301
9416
|
const sessionId = c.req.param("id");
|
|
9302
9417
|
const cacheKey = c.var.cacheKey;
|
|
9303
9418
|
const accountId = getAccountIdForSession(cacheKey);
|
|
@@ -9342,7 +9457,7 @@ app14.delete("/:id", requireAdminSession, async (c) => {
|
|
|
9342
9457
|
500
|
|
9343
9458
|
);
|
|
9344
9459
|
});
|
|
9345
|
-
|
|
9460
|
+
app15.post("/:id/resume", async (c) => {
|
|
9346
9461
|
const sessionId = c.req.param("id");
|
|
9347
9462
|
const t0 = Date.now();
|
|
9348
9463
|
const signedSessionToken = c.req.query("session_key") ?? "";
|
|
@@ -9611,7 +9726,7 @@ app14.post("/:id/resume", async (c) => {
|
|
|
9611
9726
|
}
|
|
9612
9727
|
});
|
|
9613
9728
|
});
|
|
9614
|
-
|
|
9729
|
+
app15.put("/:id/label", requireAdminSession, async (c) => {
|
|
9615
9730
|
const sessionId = c.req.param("id");
|
|
9616
9731
|
const cacheKey = c.var.cacheKey;
|
|
9617
9732
|
let body;
|
|
@@ -9637,7 +9752,7 @@ app14.put("/:id/label", requireAdminSession, async (c) => {
|
|
|
9637
9752
|
return c.json({ error: "Failed to rename session" }, 500);
|
|
9638
9753
|
}
|
|
9639
9754
|
});
|
|
9640
|
-
var sessions_default =
|
|
9755
|
+
var sessions_default = app15;
|
|
9641
9756
|
|
|
9642
9757
|
// app/lib/claude-agent/spawn-context.ts
|
|
9643
9758
|
import { existsSync as existsSync17, readFileSync as readFileSync16, readdirSync as readdirSync10, statSync as statSync8 } from "fs";
|
|
@@ -9962,7 +10077,7 @@ async function refuseIfClaudeAuthDead(c, route, sessionId) {
|
|
|
9962
10077
|
503
|
|
9963
10078
|
);
|
|
9964
10079
|
}
|
|
9965
|
-
var
|
|
10080
|
+
var app16 = new Hono();
|
|
9966
10081
|
async function performSpawnWithInitialMessage(args) {
|
|
9967
10082
|
const ownerStart = Date.now();
|
|
9968
10083
|
const aboutOwner = await resolveOwnerProfileBlock(args.senderId, args.userId);
|
|
@@ -10039,8 +10154,8 @@ function mintTranscriptEdge(sessionId, claudeSessionId, accountId) {
|
|
|
10039
10154
|
if (!sessionId || !claudeSessionId) return;
|
|
10040
10155
|
void linkConversationTranscript(sessionId, claudeSessionId, accountId);
|
|
10041
10156
|
}
|
|
10042
|
-
|
|
10043
|
-
|
|
10157
|
+
app16.use("*", requireAdminSession);
|
|
10158
|
+
app16.post("/", async (c) => {
|
|
10044
10159
|
const routeStart = Date.now();
|
|
10045
10160
|
const cacheKey = c.get("cacheKey") ?? "";
|
|
10046
10161
|
let body = {};
|
|
@@ -10083,18 +10198,18 @@ app15.post("/", async (c) => {
|
|
|
10083
10198
|
console.log(`${TAG23} route-done surface=cookie status=${response.status} route-ms=${Date.now() - routeStart}`);
|
|
10084
10199
|
return response;
|
|
10085
10200
|
});
|
|
10086
|
-
var claude_sessions_default =
|
|
10201
|
+
var claude_sessions_default = app16;
|
|
10087
10202
|
|
|
10088
10203
|
// server/routes/admin/log-ingest.ts
|
|
10089
10204
|
var TAG24 = "[log-ingest]";
|
|
10090
10205
|
var TAG_PATTERN = /^[A-Za-z0-9_:-]{1,32}$/;
|
|
10091
10206
|
var LEVELS = /* @__PURE__ */ new Set(["debug", "info", "warn", "error"]);
|
|
10092
10207
|
var MAX_LINE_BYTES = 4096;
|
|
10093
|
-
var
|
|
10208
|
+
var app17 = new Hono();
|
|
10094
10209
|
function isLoopbackAddr(addr) {
|
|
10095
10210
|
return addr === "127.0.0.1" || addr === "::1" || addr === "::ffff:127.0.0.1";
|
|
10096
10211
|
}
|
|
10097
|
-
|
|
10212
|
+
app17.post("/", async (c) => {
|
|
10098
10213
|
const remoteAddr = c.env?.incoming?.socket?.remoteAddress ?? "";
|
|
10099
10214
|
if (!isLoopbackAddr(remoteAddr)) {
|
|
10100
10215
|
console.error(`${TAG24} reject reason=non-loopback remoteAddr=${remoteAddr}`);
|
|
@@ -10137,7 +10252,7 @@ app16.post("/", async (c) => {
|
|
|
10137
10252
|
else console.log(formatted);
|
|
10138
10253
|
return c.json({ ok: true }, 200);
|
|
10139
10254
|
});
|
|
10140
|
-
var log_ingest_default =
|
|
10255
|
+
var log_ingest_default = app17;
|
|
10141
10256
|
|
|
10142
10257
|
// server/routes/admin/events.ts
|
|
10143
10258
|
var ALLOWED_EVENTS = /* @__PURE__ */ new Set([
|
|
@@ -10146,8 +10261,8 @@ var ALLOWED_EVENTS = /* @__PURE__ */ new Set([
|
|
|
10146
10261
|
"device-url:vnc-surface-shown",
|
|
10147
10262
|
"device-url:malformed"
|
|
10148
10263
|
]);
|
|
10149
|
-
var
|
|
10150
|
-
|
|
10264
|
+
var app18 = new Hono();
|
|
10265
|
+
app18.post("/", async (c) => {
|
|
10151
10266
|
const TAG32 = "[admin:events]";
|
|
10152
10267
|
let body;
|
|
10153
10268
|
try {
|
|
@@ -10178,7 +10293,7 @@ app17.post("/", async (c) => {
|
|
|
10178
10293
|
console.error(`[${event}] ${formatted}`);
|
|
10179
10294
|
return c.json({ ok: true });
|
|
10180
10295
|
});
|
|
10181
|
-
var events_default =
|
|
10296
|
+
var events_default = app18;
|
|
10182
10297
|
|
|
10183
10298
|
// server/routes/admin/files.ts
|
|
10184
10299
|
import { createReadStream as createReadStream2 } from "fs";
|
|
@@ -11086,8 +11201,8 @@ async function knowledgeDocOwnedByAccount(accountId, attachmentId) {
|
|
|
11086
11201
|
await session.close();
|
|
11087
11202
|
}
|
|
11088
11203
|
}
|
|
11089
|
-
var
|
|
11090
|
-
|
|
11204
|
+
var app19 = new Hono();
|
|
11205
|
+
app19.get("/", requireAdminSession, async (c) => {
|
|
11091
11206
|
const cacheKey = c.var.cacheKey;
|
|
11092
11207
|
const accountId = getAccountIdForSession(cacheKey);
|
|
11093
11208
|
if (!accountId) {
|
|
@@ -11153,7 +11268,7 @@ app18.get("/", requireAdminSession, async (c) => {
|
|
|
11153
11268
|
return c.json({ error: message }, 500);
|
|
11154
11269
|
}
|
|
11155
11270
|
});
|
|
11156
|
-
|
|
11271
|
+
app19.get("/download", requireAdminSession, async (c) => {
|
|
11157
11272
|
const cacheKey = c.var.cacheKey;
|
|
11158
11273
|
const accountId = getAccountIdForSession(cacheKey);
|
|
11159
11274
|
if (!accountId) {
|
|
@@ -11217,7 +11332,7 @@ app18.get("/download", requireAdminSession, async (c) => {
|
|
|
11217
11332
|
return c.json({ error: message }, 500);
|
|
11218
11333
|
}
|
|
11219
11334
|
});
|
|
11220
|
-
|
|
11335
|
+
app19.post("/upload", requireAdminSession, async (c) => {
|
|
11221
11336
|
const cacheKey = c.var.cacheKey;
|
|
11222
11337
|
const accountId = getAccountIdForSession(cacheKey);
|
|
11223
11338
|
if (!accountId) {
|
|
@@ -11278,7 +11393,7 @@ app18.post("/upload", requireAdminSession, async (c) => {
|
|
|
11278
11393
|
mimeType: file.type
|
|
11279
11394
|
});
|
|
11280
11395
|
});
|
|
11281
|
-
|
|
11396
|
+
app19.delete("/", requireAdminSession, async (c) => {
|
|
11282
11397
|
const cacheKey = c.var.cacheKey;
|
|
11283
11398
|
const accountId = getAccountIdForSession(cacheKey);
|
|
11284
11399
|
if (!accountId) {
|
|
@@ -11354,7 +11469,7 @@ app18.delete("/", requireAdminSession, async (c) => {
|
|
|
11354
11469
|
return c.json({ error: message }, 500);
|
|
11355
11470
|
}
|
|
11356
11471
|
});
|
|
11357
|
-
var files_default =
|
|
11472
|
+
var files_default = app19;
|
|
11358
11473
|
|
|
11359
11474
|
// ../lib/graph-search/src/index.ts
|
|
11360
11475
|
var import_dist = __toESM(require_dist());
|
|
@@ -12119,8 +12234,8 @@ var DEFAULT_LIMIT = 20;
|
|
|
12119
12234
|
var MAX_LIMIT = 2e3;
|
|
12120
12235
|
var MESSAGE_FAMILY_LABELS = ["Message", "UserMessage", "AssistantMessage", "WhatsAppMessage"];
|
|
12121
12236
|
var CONVERSATION_PARENT_LABELS = /* @__PURE__ */ new Set(["AdminConversation", "PublicConversation"]);
|
|
12122
|
-
var
|
|
12123
|
-
|
|
12237
|
+
var app20 = new Hono();
|
|
12238
|
+
app20.get("/", requireAdminSession, async (c) => {
|
|
12124
12239
|
const cacheKey = c.var.cacheKey;
|
|
12125
12240
|
const q = (c.req.query("q") ?? "").trim();
|
|
12126
12241
|
const rawLimit = c.req.query("limit");
|
|
@@ -12256,7 +12371,7 @@ app19.get("/", requireAdminSession, async (c) => {
|
|
|
12256
12371
|
await session.close();
|
|
12257
12372
|
}
|
|
12258
12373
|
});
|
|
12259
|
-
var graph_search_default =
|
|
12374
|
+
var graph_search_default = app20;
|
|
12260
12375
|
|
|
12261
12376
|
// server/routes/admin/graph-subgraph.ts
|
|
12262
12377
|
import neo4j from "neo4j-driver";
|
|
@@ -12340,8 +12455,8 @@ var STRIPPED_PROPERTIES = /* @__PURE__ */ new Set([
|
|
|
12340
12455
|
"otpCode",
|
|
12341
12456
|
"cacheKey"
|
|
12342
12457
|
]);
|
|
12343
|
-
var
|
|
12344
|
-
|
|
12458
|
+
var app21 = new Hono();
|
|
12459
|
+
app21.get("/", requireAdminSession, async (c) => {
|
|
12345
12460
|
const cacheKey = c.var.cacheKey;
|
|
12346
12461
|
const accountId = getAccountIdForSession(cacheKey);
|
|
12347
12462
|
if (!accountId) {
|
|
@@ -12924,12 +13039,12 @@ function pruneNode(node, warnedClasses, conversationWarnings) {
|
|
|
12924
13039
|
}
|
|
12925
13040
|
return trashed ? { id: node.id, labels, properties, trashed: true } : { id: node.id, labels, properties };
|
|
12926
13041
|
}
|
|
12927
|
-
var graph_subgraph_default =
|
|
13042
|
+
var graph_subgraph_default = app21;
|
|
12928
13043
|
|
|
12929
13044
|
// server/routes/admin/graph-delete.ts
|
|
12930
13045
|
var ALLOWED_BY = ["graph-page", "graph-drag-trash", "graph-side-panel-trash"];
|
|
12931
|
-
var
|
|
12932
|
-
|
|
13046
|
+
var app22 = new Hono();
|
|
13047
|
+
app22.post("/", requireAdminSession, async (c) => {
|
|
12933
13048
|
const cacheKey = c.var.cacheKey;
|
|
12934
13049
|
const accountId = getAccountIdForSession(cacheKey);
|
|
12935
13050
|
if (!accountId) {
|
|
@@ -13091,11 +13206,11 @@ app21.post("/", requireAdminSession, async (c) => {
|
|
|
13091
13206
|
}
|
|
13092
13207
|
}
|
|
13093
13208
|
});
|
|
13094
|
-
var graph_delete_default =
|
|
13209
|
+
var graph_delete_default = app22;
|
|
13095
13210
|
|
|
13096
13211
|
// server/routes/admin/graph-restore.ts
|
|
13097
|
-
var
|
|
13098
|
-
|
|
13212
|
+
var app23 = new Hono();
|
|
13213
|
+
app23.post("/", requireAdminSession, async (c) => {
|
|
13099
13214
|
const cacheKey = c.var.cacheKey;
|
|
13100
13215
|
const accountId = getAccountIdForSession(cacheKey);
|
|
13101
13216
|
if (!accountId) {
|
|
@@ -13159,11 +13274,11 @@ app22.post("/", requireAdminSession, async (c) => {
|
|
|
13159
13274
|
}
|
|
13160
13275
|
}
|
|
13161
13276
|
});
|
|
13162
|
-
var graph_restore_default =
|
|
13277
|
+
var graph_restore_default = app23;
|
|
13163
13278
|
|
|
13164
13279
|
// server/routes/admin/graph-labels-in-graph.ts
|
|
13165
|
-
var
|
|
13166
|
-
|
|
13280
|
+
var app24 = new Hono();
|
|
13281
|
+
app24.get("/", requireAdminSession, async (c) => {
|
|
13167
13282
|
const cacheKey = c.var.cacheKey;
|
|
13168
13283
|
const accountId = getAccountIdForSession(cacheKey);
|
|
13169
13284
|
if (!accountId) {
|
|
@@ -13229,11 +13344,11 @@ var LABELS_IN_GRAPH_CYPHER = `
|
|
|
13229
13344
|
sum(halfEdges) AS relDegree
|
|
13230
13345
|
RETURN label, nodeCount, relDegree
|
|
13231
13346
|
`;
|
|
13232
|
-
var graph_labels_in_graph_default =
|
|
13347
|
+
var graph_labels_in_graph_default = app24;
|
|
13233
13348
|
|
|
13234
13349
|
// server/routes/admin/graph-default-view.ts
|
|
13235
|
-
var
|
|
13236
|
-
|
|
13350
|
+
var app25 = new Hono();
|
|
13351
|
+
app25.get("/", requireAdminSession, async (c) => {
|
|
13237
13352
|
const cacheKey = c.var.cacheKey;
|
|
13238
13353
|
const accountId = getAccountIdForSession(cacheKey);
|
|
13239
13354
|
const userId = getUserIdForSession(cacheKey);
|
|
@@ -13271,7 +13386,7 @@ app24.get("/", requireAdminSession, async (c) => {
|
|
|
13271
13386
|
}
|
|
13272
13387
|
}
|
|
13273
13388
|
});
|
|
13274
|
-
|
|
13389
|
+
app25.put("/", requireAdminSession, async (c) => {
|
|
13275
13390
|
const cacheKey = c.var.cacheKey;
|
|
13276
13391
|
const accountId = getAccountIdForSession(cacheKey);
|
|
13277
13392
|
const userId = getUserIdForSession(cacheKey);
|
|
@@ -13360,7 +13475,7 @@ var WRITE_CYPHER = `
|
|
|
13360
13475
|
p.updatedAt = $updatedAt
|
|
13361
13476
|
RETURN p.labels AS labels
|
|
13362
13477
|
`;
|
|
13363
|
-
var graph_default_view_default =
|
|
13478
|
+
var graph_default_view_default = app25;
|
|
13364
13479
|
|
|
13365
13480
|
// server/routes/admin/sidebar-artefacts.ts
|
|
13366
13481
|
import { readdir as readdir4, stat as stat5 } from "fs/promises";
|
|
@@ -13372,8 +13487,8 @@ function toDataRootRelPath(absPath) {
|
|
|
13372
13487
|
if (absPath !== DATA_ROOT && !absPath.startsWith(DATA_ROOT + sep6)) return null;
|
|
13373
13488
|
return relative3(DATA_ROOT, absPath);
|
|
13374
13489
|
}
|
|
13375
|
-
var
|
|
13376
|
-
|
|
13490
|
+
var app26 = new Hono();
|
|
13491
|
+
app26.get("/", requireAdminSession, async (c) => {
|
|
13377
13492
|
const cacheKey = c.var.cacheKey;
|
|
13378
13493
|
const accountId = getAccountIdForSession(cacheKey);
|
|
13379
13494
|
if (!accountId) {
|
|
@@ -13536,11 +13651,11 @@ function isWithin(target, root) {
|
|
|
13536
13651
|
const rel = relative3(root, target);
|
|
13537
13652
|
return !rel.startsWith("..") && !isAbsolute(rel);
|
|
13538
13653
|
}
|
|
13539
|
-
var sidebar_artefacts_default =
|
|
13654
|
+
var sidebar_artefacts_default = app26;
|
|
13540
13655
|
|
|
13541
13656
|
// server/routes/admin/session-delete.ts
|
|
13542
|
-
var
|
|
13543
|
-
|
|
13657
|
+
var app27 = new Hono();
|
|
13658
|
+
app27.post("/", requireAdminSession, async (c) => {
|
|
13544
13659
|
let body;
|
|
13545
13660
|
try {
|
|
13546
13661
|
body = await c.req.json();
|
|
@@ -13578,11 +13693,11 @@ app26.post("/", requireAdminSession, async (c) => {
|
|
|
13578
13693
|
console.error(`[session-delete] sessionId=${sessionId} delete-status=${del.status}`);
|
|
13579
13694
|
return c.json({ error: `manager-status-${del.status}` }, 502);
|
|
13580
13695
|
});
|
|
13581
|
-
var session_delete_default =
|
|
13696
|
+
var session_delete_default = app27;
|
|
13582
13697
|
|
|
13583
13698
|
// server/routes/admin/session-stop.ts
|
|
13584
|
-
var
|
|
13585
|
-
|
|
13699
|
+
var app28 = new Hono();
|
|
13700
|
+
app28.post("/", requireAdminSession, async (c) => {
|
|
13586
13701
|
let body;
|
|
13587
13702
|
try {
|
|
13588
13703
|
body = await c.req.json();
|
|
@@ -13607,11 +13722,11 @@ app27.post("/", requireAdminSession, async (c) => {
|
|
|
13607
13722
|
console.error(`[session-stop] sessionId=${sessionId} manager-status=${res.status}`);
|
|
13608
13723
|
return c.json({ error: `manager-status-${res.status}` }, 502);
|
|
13609
13724
|
});
|
|
13610
|
-
var session_stop_default =
|
|
13725
|
+
var session_stop_default = app28;
|
|
13611
13726
|
|
|
13612
13727
|
// server/routes/admin/session-archive.ts
|
|
13613
|
-
var
|
|
13614
|
-
|
|
13728
|
+
var app29 = new Hono();
|
|
13729
|
+
app29.post("/", requireAdminSession, async (c) => {
|
|
13615
13730
|
let body;
|
|
13616
13731
|
try {
|
|
13617
13732
|
body = await c.req.json();
|
|
@@ -13659,11 +13774,11 @@ app28.post("/", requireAdminSession, async (c) => {
|
|
|
13659
13774
|
console.error(`[session-archive] sessionId=${sessionId.slice(0, 8)} manager-status=${res.status}`);
|
|
13660
13775
|
return c.json({ error: `manager-status-${res.status}` }, 502);
|
|
13661
13776
|
});
|
|
13662
|
-
var session_archive_default =
|
|
13777
|
+
var session_archive_default = app29;
|
|
13663
13778
|
|
|
13664
13779
|
// server/routes/admin/session-rc-spawn.ts
|
|
13665
|
-
var
|
|
13666
|
-
|
|
13780
|
+
var app30 = new Hono();
|
|
13781
|
+
app30.post("/", requireAdminSession, async (c) => {
|
|
13667
13782
|
let body;
|
|
13668
13783
|
try {
|
|
13669
13784
|
body = await c.req.json();
|
|
@@ -13697,7 +13812,7 @@ app29.post("/", requireAdminSession, async (c) => {
|
|
|
13697
13812
|
}
|
|
13698
13813
|
return c.json(parsed ?? {});
|
|
13699
13814
|
});
|
|
13700
|
-
var session_rc_spawn_default =
|
|
13815
|
+
var session_rc_spawn_default = app30;
|
|
13701
13816
|
|
|
13702
13817
|
// server/routes/admin/system-stats.ts
|
|
13703
13818
|
import { readFile as readFile5 } from "fs/promises";
|
|
@@ -13794,8 +13909,8 @@ async function sample() {
|
|
|
13794
13909
|
if (process.platform === "linux") return sampleLinux();
|
|
13795
13910
|
return sampleOsFallback();
|
|
13796
13911
|
}
|
|
13797
|
-
var
|
|
13798
|
-
|
|
13912
|
+
var app31 = new Hono();
|
|
13913
|
+
app31.get("/", async (c) => {
|
|
13799
13914
|
const started = Date.now();
|
|
13800
13915
|
if (!inflight) {
|
|
13801
13916
|
inflight = sample().finally(() => {
|
|
@@ -13818,7 +13933,7 @@ app30.get("/", async (c) => {
|
|
|
13818
13933
|
return c.json({ degraded: true, reason, sampledAtMs: Date.now() });
|
|
13819
13934
|
}
|
|
13820
13935
|
});
|
|
13821
|
-
var system_stats_default =
|
|
13936
|
+
var system_stats_default = app31;
|
|
13822
13937
|
|
|
13823
13938
|
// server/routes/admin/health.ts
|
|
13824
13939
|
import { existsSync as existsSync20, readFileSync as readFileSync18 } from "fs";
|
|
@@ -13863,8 +13978,8 @@ async function probeConversationDb() {
|
|
|
13863
13978
|
});
|
|
13864
13979
|
}
|
|
13865
13980
|
}
|
|
13866
|
-
var
|
|
13867
|
-
|
|
13981
|
+
var app32 = new Hono();
|
|
13982
|
+
app32.get("/", async (c) => {
|
|
13868
13983
|
const version = readVersion();
|
|
13869
13984
|
const probe = await probeConversationDb();
|
|
13870
13985
|
const uptimeMs = Date.now() - new Date(PROCESS_STARTED_AT).getTime();
|
|
@@ -13886,7 +14001,7 @@ app31.get("/", async (c) => {
|
|
|
13886
14001
|
uptimeMs
|
|
13887
14002
|
});
|
|
13888
14003
|
});
|
|
13889
|
-
var health_default2 =
|
|
14004
|
+
var health_default2 = app32;
|
|
13890
14005
|
|
|
13891
14006
|
// server/routes/admin/linkedin-ingest.ts
|
|
13892
14007
|
import { randomUUID as randomUUID9 } from "crypto";
|
|
@@ -13988,8 +14103,8 @@ function buildInitialMessage(env) {
|
|
|
13988
14103
|
}
|
|
13989
14104
|
return header;
|
|
13990
14105
|
}
|
|
13991
|
-
var
|
|
13992
|
-
|
|
14106
|
+
var app33 = new Hono();
|
|
14107
|
+
app33.post("/", requireAdminSession, async (c) => {
|
|
13993
14108
|
let body;
|
|
13994
14109
|
try {
|
|
13995
14110
|
body = await c.req.json();
|
|
@@ -14034,7 +14149,7 @@ app32.post("/", requireAdminSession, async (c) => {
|
|
|
14034
14149
|
);
|
|
14035
14150
|
return c.json({ ok: true, dispatchId: envelope.dispatchId, taskId: spawned.sessionId }, 202);
|
|
14036
14151
|
});
|
|
14037
|
-
var linkedin_ingest_default =
|
|
14152
|
+
var linkedin_ingest_default = app33;
|
|
14038
14153
|
|
|
14039
14154
|
// server/routes/admin/post-turn-context.ts
|
|
14040
14155
|
import neo4j2 from "neo4j-driver";
|
|
@@ -14076,8 +14191,8 @@ function pruneProperties(raw) {
|
|
|
14076
14191
|
}
|
|
14077
14192
|
return out;
|
|
14078
14193
|
}
|
|
14079
|
-
var
|
|
14080
|
-
|
|
14194
|
+
var app34 = new Hono();
|
|
14195
|
+
app34.get("/", async (c) => {
|
|
14081
14196
|
const remoteAddr = c.env?.incoming?.socket?.remoteAddress ?? "";
|
|
14082
14197
|
if (!isLoopbackAddr2(remoteAddr)) {
|
|
14083
14198
|
console.error(`${TAG26} reject reason=non-loopback remoteAddr=${remoteAddr}`);
|
|
@@ -14137,7 +14252,7 @@ app33.get("/", async (c) => {
|
|
|
14137
14252
|
await session.close();
|
|
14138
14253
|
}
|
|
14139
14254
|
});
|
|
14140
|
-
var post_turn_context_default =
|
|
14255
|
+
var post_turn_context_default = app34;
|
|
14141
14256
|
|
|
14142
14257
|
// server/routes/admin/public-session-context.ts
|
|
14143
14258
|
import neo4j3 from "neo4j-driver";
|
|
@@ -14179,8 +14294,8 @@ function pruneProperties2(raw) {
|
|
|
14179
14294
|
}
|
|
14180
14295
|
return out;
|
|
14181
14296
|
}
|
|
14182
|
-
var
|
|
14183
|
-
|
|
14297
|
+
var app35 = new Hono();
|
|
14298
|
+
app35.get("/", async (c) => {
|
|
14184
14299
|
const remoteAddr = c.env?.incoming?.socket?.remoteAddress ?? "";
|
|
14185
14300
|
if (!isLoopbackAddr3(remoteAddr)) {
|
|
14186
14301
|
console.error(`${TAG27} reject reason=non-loopback remoteAddr=${remoteAddr}`);
|
|
@@ -14239,15 +14354,15 @@ app34.get("/", async (c) => {
|
|
|
14239
14354
|
await session.close();
|
|
14240
14355
|
}
|
|
14241
14356
|
});
|
|
14242
|
-
var public_session_context_default =
|
|
14357
|
+
var public_session_context_default = app35;
|
|
14243
14358
|
|
|
14244
14359
|
// server/routes/admin/public-session-exit.ts
|
|
14245
14360
|
var TAG28 = "[public-session-exit-route]";
|
|
14246
14361
|
function isLoopbackAddr4(addr) {
|
|
14247
14362
|
return addr === "127.0.0.1" || addr === "::1" || addr === "::ffff:127.0.0.1";
|
|
14248
14363
|
}
|
|
14249
|
-
var
|
|
14250
|
-
|
|
14364
|
+
var app36 = new Hono();
|
|
14365
|
+
app36.post("/", async (c) => {
|
|
14251
14366
|
const remoteAddr = c.env?.incoming?.socket?.remoteAddress ?? "";
|
|
14252
14367
|
if (!isLoopbackAddr4(remoteAddr)) {
|
|
14253
14368
|
console.error(`${TAG28} reject reason=non-loopback remoteAddr=${remoteAddr}`);
|
|
@@ -14274,15 +14389,15 @@ app35.post("/", async (c) => {
|
|
|
14274
14389
|
handlePublicSessionExit(sessionId);
|
|
14275
14390
|
return c.json({ ok: true });
|
|
14276
14391
|
});
|
|
14277
|
-
var public_session_exit_default =
|
|
14392
|
+
var public_session_exit_default = app36;
|
|
14278
14393
|
|
|
14279
14394
|
// server/routes/admin/access-session-evict.ts
|
|
14280
14395
|
var TAG29 = "[access-session-evict]";
|
|
14281
14396
|
function isLoopbackAddr5(addr) {
|
|
14282
14397
|
return addr === "127.0.0.1" || addr === "::1" || addr === "::ffff:127.0.0.1";
|
|
14283
14398
|
}
|
|
14284
|
-
var
|
|
14285
|
-
|
|
14399
|
+
var app37 = new Hono();
|
|
14400
|
+
app37.post("/", async (c) => {
|
|
14286
14401
|
const remoteAddr = c.env?.incoming?.socket?.remoteAddress ?? "";
|
|
14287
14402
|
if (!isLoopbackAddr5(remoteAddr)) {
|
|
14288
14403
|
console.error(`${TAG29} reject reason=non-loopback remoteAddr=${remoteAddr}`);
|
|
@@ -14310,11 +14425,11 @@ app36.post("/", async (c) => {
|
|
|
14310
14425
|
console.log(`${TAG29} grantId=${grantId} dropped=${dropped}`);
|
|
14311
14426
|
return c.json({ ok: true, dropped });
|
|
14312
14427
|
});
|
|
14313
|
-
var access_session_evict_default =
|
|
14428
|
+
var access_session_evict_default = app37;
|
|
14314
14429
|
|
|
14315
14430
|
// server/routes/admin/browser.ts
|
|
14316
|
-
var
|
|
14317
|
-
|
|
14431
|
+
var app38 = new Hono();
|
|
14432
|
+
app38.post("/launch", requireAdminSession, async (c) => {
|
|
14318
14433
|
try {
|
|
14319
14434
|
const transport = resolveBrowserTransport(c.req.raw, c.env?.incoming?.socket?.remoteAddress);
|
|
14320
14435
|
console.error(`[admin/browser/launch] op=request transport=${transport}`);
|
|
@@ -14342,41 +14457,41 @@ app37.post("/launch", requireAdminSession, async (c) => {
|
|
|
14342
14457
|
);
|
|
14343
14458
|
}
|
|
14344
14459
|
});
|
|
14345
|
-
var browser_default =
|
|
14460
|
+
var browser_default = app38;
|
|
14346
14461
|
|
|
14347
14462
|
// server/routes/admin/index.ts
|
|
14348
|
-
var
|
|
14349
|
-
|
|
14350
|
-
|
|
14351
|
-
|
|
14352
|
-
|
|
14353
|
-
|
|
14354
|
-
|
|
14355
|
-
|
|
14356
|
-
|
|
14357
|
-
|
|
14358
|
-
|
|
14359
|
-
|
|
14360
|
-
|
|
14361
|
-
|
|
14362
|
-
|
|
14363
|
-
|
|
14364
|
-
|
|
14365
|
-
|
|
14366
|
-
|
|
14367
|
-
|
|
14368
|
-
|
|
14369
|
-
|
|
14370
|
-
|
|
14371
|
-
|
|
14372
|
-
|
|
14373
|
-
|
|
14374
|
-
|
|
14375
|
-
|
|
14376
|
-
|
|
14377
|
-
|
|
14378
|
-
|
|
14379
|
-
var admin_default =
|
|
14463
|
+
var app39 = new Hono();
|
|
14464
|
+
app39.route("/session", session_default);
|
|
14465
|
+
app39.route("/logs", logs_default);
|
|
14466
|
+
app39.route("/claude-info", claude_info_default);
|
|
14467
|
+
app39.route("/attachment", attachment_default);
|
|
14468
|
+
app39.route("/agents", agents_default);
|
|
14469
|
+
app39.route("/sessions", sessions_default);
|
|
14470
|
+
app39.route("/claude-sessions", claude_sessions_default);
|
|
14471
|
+
app39.route("/log-ingest", log_ingest_default);
|
|
14472
|
+
app39.route("/events", events_default);
|
|
14473
|
+
app39.route("/files", files_default);
|
|
14474
|
+
app39.route("/graph-search", graph_search_default);
|
|
14475
|
+
app39.route("/graph-subgraph", graph_subgraph_default);
|
|
14476
|
+
app39.route("/graph-delete", graph_delete_default);
|
|
14477
|
+
app39.route("/graph-restore", graph_restore_default);
|
|
14478
|
+
app39.route("/graph-labels-in-graph", graph_labels_in_graph_default);
|
|
14479
|
+
app39.route("/graph-default-view", graph_default_view_default);
|
|
14480
|
+
app39.route("/sidebar-artefacts", sidebar_artefacts_default);
|
|
14481
|
+
app39.route("/sidebar-sessions", sidebar_sessions_default);
|
|
14482
|
+
app39.route("/session-delete", session_delete_default);
|
|
14483
|
+
app39.route("/session-stop", session_stop_default);
|
|
14484
|
+
app39.route("/session-archive", session_archive_default);
|
|
14485
|
+
app39.route("/browser", browser_default);
|
|
14486
|
+
app39.route("/session-rc-spawn", session_rc_spawn_default);
|
|
14487
|
+
app39.route("/system-stats", system_stats_default);
|
|
14488
|
+
app39.route("/health-brand", health_default2);
|
|
14489
|
+
app39.route("/linkedin-ingest", linkedin_ingest_default);
|
|
14490
|
+
app39.route("/post-turn-context", post_turn_context_default);
|
|
14491
|
+
app39.route("/public-session-context", public_session_context_default);
|
|
14492
|
+
app39.route("/public-session-exit", public_session_exit_default);
|
|
14493
|
+
app39.route("/access-session-evict", access_session_evict_default);
|
|
14494
|
+
var admin_default = app39;
|
|
14380
14495
|
|
|
14381
14496
|
// app/lib/access-gate.ts
|
|
14382
14497
|
import neo4j4 from "neo4j-driver";
|
|
@@ -14590,8 +14705,8 @@ async function generateNewMagicToken(grantId) {
|
|
|
14590
14705
|
var TAG30 = "[access-verify]";
|
|
14591
14706
|
var MINT_TAG = "[access-session-mint]";
|
|
14592
14707
|
var COOKIE_NAME = "__access_session";
|
|
14593
|
-
var
|
|
14594
|
-
|
|
14708
|
+
var app40 = new Hono();
|
|
14709
|
+
app40.post("/", async (c) => {
|
|
14595
14710
|
const ip = c.var.clientIp || "unknown";
|
|
14596
14711
|
let body;
|
|
14597
14712
|
try {
|
|
@@ -14673,7 +14788,7 @@ app39.post("/", async (c) => {
|
|
|
14673
14788
|
displayName: grant.displayName
|
|
14674
14789
|
});
|
|
14675
14790
|
});
|
|
14676
|
-
var verify_token_default =
|
|
14791
|
+
var verify_token_default = app40;
|
|
14677
14792
|
|
|
14678
14793
|
// app/lib/access-email.ts
|
|
14679
14794
|
import { spawn as spawn2 } from "child_process";
|
|
@@ -14736,9 +14851,9 @@ async function sendMagicLinkEmail(payload) {
|
|
|
14736
14851
|
|
|
14737
14852
|
// server/routes/access/request-magic-link.ts
|
|
14738
14853
|
var TAG31 = "[access-request-link]";
|
|
14739
|
-
var
|
|
14854
|
+
var app41 = new Hono();
|
|
14740
14855
|
var VISITOR_MESSAGE = "If that email is on the invite list, a fresh link is on the way.";
|
|
14741
|
-
|
|
14856
|
+
app41.post("/", async (c) => {
|
|
14742
14857
|
let body;
|
|
14743
14858
|
try {
|
|
14744
14859
|
body = await c.req.json();
|
|
@@ -14812,13 +14927,13 @@ app40.post("/", async (c) => {
|
|
|
14812
14927
|
);
|
|
14813
14928
|
return c.json({ message: VISITOR_MESSAGE }, 200);
|
|
14814
14929
|
});
|
|
14815
|
-
var request_magic_link_default =
|
|
14930
|
+
var request_magic_link_default = app41;
|
|
14816
14931
|
|
|
14817
14932
|
// server/routes/access/index.ts
|
|
14818
|
-
var
|
|
14819
|
-
|
|
14820
|
-
|
|
14821
|
-
var access_default =
|
|
14933
|
+
var app42 = new Hono();
|
|
14934
|
+
app42.route("/verify-token", verify_token_default);
|
|
14935
|
+
app42.route("/request-magic-link", request_magic_link_default);
|
|
14936
|
+
var access_default = app42;
|
|
14822
14937
|
|
|
14823
14938
|
// server/routes/sites.ts
|
|
14824
14939
|
import { existsSync as existsSync21, readFileSync as readFileSync20, realpathSync as realpathSync5, statSync as statSync9 } from "fs";
|
|
@@ -14853,8 +14968,8 @@ function getExt(p) {
|
|
|
14853
14968
|
if (idx < p.lastIndexOf("/")) return "";
|
|
14854
14969
|
return p.slice(idx).toLowerCase();
|
|
14855
14970
|
}
|
|
14856
|
-
var
|
|
14857
|
-
|
|
14971
|
+
var app43 = new Hono();
|
|
14972
|
+
app43.get("/:rel{.*}", (c) => {
|
|
14858
14973
|
const reqPath = c.req.path;
|
|
14859
14974
|
const rawRel = c.req.param("rel") ?? "";
|
|
14860
14975
|
const trimmed = rawRel.replace(/^\/+/, "").replace(/\/+$/, "");
|
|
@@ -14957,7 +15072,7 @@ app42.get("/:rel{.*}", (c) => {
|
|
|
14957
15072
|
"X-Content-Type-Options": "nosniff"
|
|
14958
15073
|
});
|
|
14959
15074
|
});
|
|
14960
|
-
var sites_default =
|
|
15075
|
+
var sites_default = app43;
|
|
14961
15076
|
|
|
14962
15077
|
// app/lib/visitor-token.ts
|
|
14963
15078
|
import { createHmac, randomBytes, timingSafeEqual } from "crypto";
|
|
@@ -15057,7 +15172,7 @@ function readBrandConfig() {
|
|
|
15057
15172
|
}
|
|
15058
15173
|
|
|
15059
15174
|
// server/routes/visitor-consent.ts
|
|
15060
|
-
var
|
|
15175
|
+
var app44 = new Hono();
|
|
15061
15176
|
var CONSENT_COOKIE_NAME = "mxy_consent";
|
|
15062
15177
|
var CONSENT_COOKIE_MAX_AGE_SECONDS = 60 * 60 * 24 * 365;
|
|
15063
15178
|
var DEFAULT_CONSENT_COPY = {
|
|
@@ -15102,17 +15217,17 @@ function siteSlugFromReferer(referer) {
|
|
|
15102
15217
|
return "";
|
|
15103
15218
|
}
|
|
15104
15219
|
}
|
|
15105
|
-
|
|
15220
|
+
app44.options("/consent", (c) => {
|
|
15106
15221
|
const origin = getOrigin(c);
|
|
15107
15222
|
setCorsHeaders(c, origin);
|
|
15108
15223
|
return c.body(null, 204);
|
|
15109
15224
|
});
|
|
15110
|
-
|
|
15225
|
+
app44.options("/brand-config", (c) => {
|
|
15111
15226
|
const origin = getOrigin(c);
|
|
15112
15227
|
setCorsHeaders(c, origin);
|
|
15113
15228
|
return c.body(null, 204);
|
|
15114
15229
|
});
|
|
15115
|
-
|
|
15230
|
+
app44.post("/consent", async (c) => {
|
|
15116
15231
|
const origin = getOrigin(c);
|
|
15117
15232
|
setCorsHeaders(c, origin);
|
|
15118
15233
|
let raw;
|
|
@@ -15152,7 +15267,7 @@ app43.post("/consent", async (c) => {
|
|
|
15152
15267
|
console.log(`[consent] ${parsed.decision} site=${site} brand=${brandName} tokenBound=${tokenBound}`);
|
|
15153
15268
|
return c.body(null, 204);
|
|
15154
15269
|
});
|
|
15155
|
-
|
|
15270
|
+
app44.get("/brand-config", (c) => {
|
|
15156
15271
|
const origin = getOrigin(c);
|
|
15157
15272
|
setCorsHeaders(c, origin);
|
|
15158
15273
|
const brand = readBrandConfig();
|
|
@@ -15162,7 +15277,7 @@ app43.get("/brand-config", (c) => {
|
|
|
15162
15277
|
c.header("Cache-Control", "public, max-age=300");
|
|
15163
15278
|
return c.json({ consent: { copy, palette } });
|
|
15164
15279
|
});
|
|
15165
|
-
var visitor_consent_default =
|
|
15280
|
+
var visitor_consent_default = app44;
|
|
15166
15281
|
|
|
15167
15282
|
// server/routes/listings.ts
|
|
15168
15283
|
function getCookie(headerValue, name) {
|
|
@@ -15189,8 +15304,8 @@ function appendConsentParams(pageUrl, token) {
|
|
|
15189
15304
|
}
|
|
15190
15305
|
var SAFE_SLUG_RE = /^[a-z0-9](?:[a-z0-9-]{0,118}[a-z0-9])?$/;
|
|
15191
15306
|
var CHAT_SESSION_KEY_RE = /^[A-Za-z0-9][A-Za-z0-9_-]{7,127}$/;
|
|
15192
|
-
var
|
|
15193
|
-
|
|
15307
|
+
var app45 = new Hono();
|
|
15308
|
+
app45.get("/:slug/click", async (c) => {
|
|
15194
15309
|
const slug = c.req.param("slug") ?? "";
|
|
15195
15310
|
const rawSession = c.req.query("session") ?? "";
|
|
15196
15311
|
const sessionKey = CHAT_SESSION_KEY_RE.test(rawSession) ? rawSession : "invalid";
|
|
@@ -15254,10 +15369,10 @@ app44.get("/:slug/click", async (c) => {
|
|
|
15254
15369
|
console.log(`[property-card-click] sessionKey=${sessionKey} listingSlug=${slug} consent=${consentCookie ?? "absent"} ts=${(/* @__PURE__ */ new Date()).toISOString()}`);
|
|
15255
15370
|
return c.redirect(redirectUrl, 302);
|
|
15256
15371
|
});
|
|
15257
|
-
var listings_default =
|
|
15372
|
+
var listings_default = app45;
|
|
15258
15373
|
|
|
15259
15374
|
// server/routes/visitor-event.ts
|
|
15260
|
-
var
|
|
15375
|
+
var app46 = new Hono();
|
|
15261
15376
|
var BOT_UA_RE = /\b(bot|crawl|spider|slurp|headlesschrome|phantomjs|googlebot|bingbot|yandex|baiduspider|ahrefsbot|semrushbot|mj12bot|dotbot|petalbot)\b/i;
|
|
15262
15377
|
var buckets = /* @__PURE__ */ new Map();
|
|
15263
15378
|
var RATE_LIMIT = 60;
|
|
@@ -15324,12 +15439,12 @@ function originAllowed(origin, allowlist) {
|
|
|
15324
15439
|
return false;
|
|
15325
15440
|
}
|
|
15326
15441
|
}
|
|
15327
|
-
|
|
15442
|
+
app46.options("/event", (c) => {
|
|
15328
15443
|
const origin = getOrigin2(c);
|
|
15329
15444
|
setCorsHeaders2(c, origin);
|
|
15330
15445
|
return c.body(null, 204);
|
|
15331
15446
|
});
|
|
15332
|
-
|
|
15447
|
+
app46.post("/event", async (c) => {
|
|
15333
15448
|
const origin = getOrigin2(c);
|
|
15334
15449
|
setCorsHeaders2(c, origin);
|
|
15335
15450
|
const ua = c.req.header("user-agent") ?? "";
|
|
@@ -15534,7 +15649,7 @@ async function writeEvent(opts) {
|
|
|
15534
15649
|
);
|
|
15535
15650
|
}
|
|
15536
15651
|
}
|
|
15537
|
-
var visitor_event_default =
|
|
15652
|
+
var visitor_event_default = app46;
|
|
15538
15653
|
|
|
15539
15654
|
// server/routes/session.ts
|
|
15540
15655
|
import { resolve as resolve24 } from "path";
|
|
@@ -15580,8 +15695,8 @@ function withVisitorCookie(response, visitorId) {
|
|
|
15580
15695
|
headers
|
|
15581
15696
|
});
|
|
15582
15697
|
}
|
|
15583
|
-
var
|
|
15584
|
-
|
|
15698
|
+
var app47 = new Hono();
|
|
15699
|
+
app47.post("/", async (c) => {
|
|
15585
15700
|
let body;
|
|
15586
15701
|
try {
|
|
15587
15702
|
body = await c.req.json();
|
|
@@ -15792,7 +15907,7 @@ app46.post("/", async (c) => {
|
|
|
15792
15907
|
newVisitorId
|
|
15793
15908
|
);
|
|
15794
15909
|
});
|
|
15795
|
-
var session_default2 =
|
|
15910
|
+
var session_default2 = app47;
|
|
15796
15911
|
|
|
15797
15912
|
// app/lib/graph-health.ts
|
|
15798
15913
|
var import_dist4 = __toESM(require_dist3(), 1);
|
|
@@ -16282,8 +16397,8 @@ var streamSSE = (c, cb, onError) => {
|
|
|
16282
16397
|
|
|
16283
16398
|
// app/lib/whatsapp/gateway/routes.ts
|
|
16284
16399
|
function createWaChannelRoutes(deps) {
|
|
16285
|
-
const
|
|
16286
|
-
|
|
16400
|
+
const app49 = new Hono();
|
|
16401
|
+
app49.get("/wa-channel/inbound", (c) => {
|
|
16287
16402
|
const senderId = c.req.query("senderId");
|
|
16288
16403
|
if (!senderId) return c.json({ error: "senderId required" }, 400);
|
|
16289
16404
|
return streamSSE(c, async (stream2) => {
|
|
@@ -16301,7 +16416,7 @@ function createWaChannelRoutes(deps) {
|
|
|
16301
16416
|
}
|
|
16302
16417
|
});
|
|
16303
16418
|
});
|
|
16304
|
-
|
|
16419
|
+
app49.post("/wa-channel/reply", async (c) => {
|
|
16305
16420
|
const body = await c.req.json().catch(() => null);
|
|
16306
16421
|
const senderId = body?.senderId;
|
|
16307
16422
|
const text = body?.text;
|
|
@@ -16322,7 +16437,7 @@ function createWaChannelRoutes(deps) {
|
|
|
16322
16437
|
console.error(`[whatsapp-native] op=reply-dispatch senderId=${senderId} bytes=${bytes}`);
|
|
16323
16438
|
return c.json({ ok: true });
|
|
16324
16439
|
});
|
|
16325
|
-
|
|
16440
|
+
app49.post("/wa-channel/reply-document", async (c) => {
|
|
16326
16441
|
const body = await c.req.json().catch(() => null);
|
|
16327
16442
|
const senderId = body?.senderId;
|
|
16328
16443
|
const files = body?.files;
|
|
@@ -16361,7 +16476,7 @@ function createWaChannelRoutes(deps) {
|
|
|
16361
16476
|
}
|
|
16362
16477
|
return c.json({ ok: true, results });
|
|
16363
16478
|
});
|
|
16364
|
-
|
|
16479
|
+
app49.post("/wa-channel/ready", async (c) => {
|
|
16365
16480
|
const body = await c.req.json().catch(() => null);
|
|
16366
16481
|
const senderId = body?.senderId;
|
|
16367
16482
|
if (typeof senderId !== "string") {
|
|
@@ -16370,7 +16485,7 @@ function createWaChannelRoutes(deps) {
|
|
|
16370
16485
|
deps.onReady?.(senderId);
|
|
16371
16486
|
return c.json({ ok: true });
|
|
16372
16487
|
});
|
|
16373
|
-
|
|
16488
|
+
app49.post("/wa-channel/received", async (c) => {
|
|
16374
16489
|
const body = await c.req.json().catch(() => null);
|
|
16375
16490
|
const senderId = body?.senderId;
|
|
16376
16491
|
const waMessageId = body?.waMessageId;
|
|
@@ -16380,7 +16495,7 @@ function createWaChannelRoutes(deps) {
|
|
|
16380
16495
|
deps.onReceived?.(senderId, waMessageId);
|
|
16381
16496
|
return c.json({ ok: true });
|
|
16382
16497
|
});
|
|
16383
|
-
return
|
|
16498
|
+
return app49;
|
|
16384
16499
|
}
|
|
16385
16500
|
|
|
16386
16501
|
// app/lib/whatsapp/gateway/wa-gateway.ts
|
|
@@ -16611,8 +16726,8 @@ var InboundHub2 = class {
|
|
|
16611
16726
|
|
|
16612
16727
|
// app/lib/webchat/gateway/routes.ts
|
|
16613
16728
|
function createWebchatChannelRoutes(deps) {
|
|
16614
|
-
const
|
|
16615
|
-
|
|
16729
|
+
const app49 = new Hono();
|
|
16730
|
+
app49.get("/webchat-channel/inbound", (c) => {
|
|
16616
16731
|
const key = c.req.query("key");
|
|
16617
16732
|
if (!key) return c.json({ error: "key required" }, 400);
|
|
16618
16733
|
return streamSSE(c, async (stream2) => {
|
|
@@ -16630,7 +16745,7 @@ function createWebchatChannelRoutes(deps) {
|
|
|
16630
16745
|
}
|
|
16631
16746
|
});
|
|
16632
16747
|
});
|
|
16633
|
-
|
|
16748
|
+
app49.post("/webchat-channel/reply", async (c) => {
|
|
16634
16749
|
const body = await c.req.json().catch(() => null);
|
|
16635
16750
|
const key = body?.key;
|
|
16636
16751
|
const text = body?.text;
|
|
@@ -16640,7 +16755,7 @@ function createWebchatChannelRoutes(deps) {
|
|
|
16640
16755
|
deps.onReply?.(key, Buffer.byteLength(text, "utf8"));
|
|
16641
16756
|
return c.json({ ok: true });
|
|
16642
16757
|
});
|
|
16643
|
-
|
|
16758
|
+
app49.post("/webchat-channel/ready", async (c) => {
|
|
16644
16759
|
const body = await c.req.json().catch(() => null);
|
|
16645
16760
|
const key = body?.key;
|
|
16646
16761
|
if (typeof key !== "string") {
|
|
@@ -16649,7 +16764,7 @@ function createWebchatChannelRoutes(deps) {
|
|
|
16649
16764
|
deps.onReady?.(key);
|
|
16650
16765
|
return c.json({ ok: true });
|
|
16651
16766
|
});
|
|
16652
|
-
|
|
16767
|
+
app49.post("/webchat-channel/received", async (c) => {
|
|
16653
16768
|
const body = await c.req.json().catch(() => null);
|
|
16654
16769
|
const key = body?.key;
|
|
16655
16770
|
const messageId = body?.messageId;
|
|
@@ -16659,7 +16774,7 @@ function createWebchatChannelRoutes(deps) {
|
|
|
16659
16774
|
deps.onReceived?.(key, messageId);
|
|
16660
16775
|
return c.json({ ok: true });
|
|
16661
16776
|
});
|
|
16662
|
-
return
|
|
16777
|
+
return app49;
|
|
16663
16778
|
}
|
|
16664
16779
|
|
|
16665
16780
|
// app/lib/webchat/gateway/webchat-gateway.ts
|
|
@@ -17158,7 +17273,7 @@ watchFile(ALIAS_DOMAINS_PATH, { interval: 2e3 }, () => {
|
|
|
17158
17273
|
function isPublicHost(host) {
|
|
17159
17274
|
return host.startsWith("public.") || aliasDomains.has(host);
|
|
17160
17275
|
}
|
|
17161
|
-
var
|
|
17276
|
+
var app48 = new Hono();
|
|
17162
17277
|
var nativeFileFollowers = /* @__PURE__ */ new Map();
|
|
17163
17278
|
var waGateway = new WaGateway({
|
|
17164
17279
|
gatewayUrl: `http://127.0.0.1:${process.env.MAXY_UI_INTERNAL_PORT ?? ""}`,
|
|
@@ -17214,7 +17329,7 @@ var waGateway = new WaGateway({
|
|
|
17214
17329
|
nativeFileFollowers.set(senderId, ac);
|
|
17215
17330
|
}
|
|
17216
17331
|
});
|
|
17217
|
-
|
|
17332
|
+
app48.route("/", waGateway.routes());
|
|
17218
17333
|
waGateway.startSweeper();
|
|
17219
17334
|
var webchatGateway = new WebchatGateway({
|
|
17220
17335
|
gatewayUrl: `http://127.0.0.1:${process.env.MAXY_UI_INTERNAL_PORT ?? ""}`,
|
|
@@ -17237,10 +17352,10 @@ var webchatGateway = new WebchatGateway({
|
|
|
17237
17352
|
}
|
|
17238
17353
|
}
|
|
17239
17354
|
});
|
|
17240
|
-
|
|
17355
|
+
app48.route("/", webchatGateway.routes());
|
|
17241
17356
|
webchatGateway.startSweeper();
|
|
17242
|
-
|
|
17243
|
-
|
|
17357
|
+
app48.use("*", clientIpMiddleware);
|
|
17358
|
+
app48.use("*", async (c, next) => {
|
|
17244
17359
|
await next();
|
|
17245
17360
|
c.header("X-Content-Type-Options", "nosniff");
|
|
17246
17361
|
c.header("Referrer-Policy", "strict-origin-when-cross-origin");
|
|
@@ -17250,7 +17365,7 @@ app47.use("*", async (c, next) => {
|
|
|
17250
17365
|
);
|
|
17251
17366
|
});
|
|
17252
17367
|
var HTTP_LOG_PATHS = /* @__PURE__ */ new Set(["/vnc-viewer.html", "/vnc-popout.html"]);
|
|
17253
|
-
|
|
17368
|
+
app48.use("*", async (c, next) => {
|
|
17254
17369
|
if (!HTTP_LOG_PATHS.has(c.req.path)) {
|
|
17255
17370
|
await next();
|
|
17256
17371
|
return;
|
|
@@ -17268,7 +17383,7 @@ app47.use("*", async (c, next) => {
|
|
|
17268
17383
|
});
|
|
17269
17384
|
}
|
|
17270
17385
|
});
|
|
17271
|
-
|
|
17386
|
+
app48.use("*", async (c, next) => {
|
|
17272
17387
|
const host = (c.req.header("host") ?? "").split(":")[0];
|
|
17273
17388
|
if (!isPublicHost(host)) {
|
|
17274
17389
|
await next();
|
|
@@ -17299,7 +17414,7 @@ function resolveRemoteAuthOpts() {
|
|
|
17299
17414
|
return brandLoginOpts;
|
|
17300
17415
|
}
|
|
17301
17416
|
var MAX_LOGIN_BODY = 8 * 1024;
|
|
17302
|
-
|
|
17417
|
+
app48.post("/__remote-auth/login", async (c) => {
|
|
17303
17418
|
const client = clientFrom(c);
|
|
17304
17419
|
const clientIp = client.ip || "unknown";
|
|
17305
17420
|
if (!requestIsTlsTerminated(c)) {
|
|
@@ -17344,7 +17459,7 @@ app47.post("/__remote-auth/login", async (c) => {
|
|
|
17344
17459
|
}
|
|
17345
17460
|
});
|
|
17346
17461
|
});
|
|
17347
|
-
|
|
17462
|
+
app48.get("/__remote-auth/logout", (c) => {
|
|
17348
17463
|
const client = clientFrom(c);
|
|
17349
17464
|
const clientIp = client.ip || "unknown";
|
|
17350
17465
|
console.error(`[remote-auth] logout ip=${clientIp}`);
|
|
@@ -17357,7 +17472,7 @@ app47.get("/__remote-auth/logout", (c) => {
|
|
|
17357
17472
|
}
|
|
17358
17473
|
});
|
|
17359
17474
|
});
|
|
17360
|
-
|
|
17475
|
+
app48.post("/__remote-auth/change-password", async (c) => {
|
|
17361
17476
|
const client = clientFrom(c);
|
|
17362
17477
|
const clientIp = client.ip || "unknown";
|
|
17363
17478
|
const rateLimited = checkRateLimit(client);
|
|
@@ -17408,13 +17523,13 @@ app47.post("/__remote-auth/change-password", async (c) => {
|
|
|
17408
17523
|
return c.html(renderLoginPage({ ...resolveRemoteAuthOpts(), mode: "change", changeError: "Failed to save password", redirect }), 200);
|
|
17409
17524
|
}
|
|
17410
17525
|
});
|
|
17411
|
-
|
|
17526
|
+
app48.get("/__remote-auth/setup", (c) => {
|
|
17412
17527
|
if (isRemoteAuthConfigured()) {
|
|
17413
17528
|
return c.redirect("/");
|
|
17414
17529
|
}
|
|
17415
17530
|
return c.html(renderLoginPage({ ...resolveRemoteAuthOpts(), mode: "setup" }), 200);
|
|
17416
17531
|
});
|
|
17417
|
-
|
|
17532
|
+
app48.post("/__remote-auth/set-initial-password", async (c) => {
|
|
17418
17533
|
if (isRemoteAuthConfigured()) {
|
|
17419
17534
|
return c.redirect("/");
|
|
17420
17535
|
}
|
|
@@ -17452,10 +17567,10 @@ app47.post("/__remote-auth/set-initial-password", async (c) => {
|
|
|
17452
17567
|
return c.html(renderLoginPage({ ...resolveRemoteAuthOpts(), mode: "setup", setupError: "Failed to save password. Please try again." }), 200);
|
|
17453
17568
|
}
|
|
17454
17569
|
});
|
|
17455
|
-
|
|
17570
|
+
app48.get("/api/remote-auth/status", (c) => {
|
|
17456
17571
|
return c.json({ configured: isRemoteAuthConfigured() });
|
|
17457
17572
|
});
|
|
17458
|
-
|
|
17573
|
+
app48.post("/api/remote-auth/set-password", async (c) => {
|
|
17459
17574
|
let body;
|
|
17460
17575
|
try {
|
|
17461
17576
|
body = await c.req.json();
|
|
@@ -17486,9 +17601,9 @@ app47.post("/api/remote-auth/set-password", async (c) => {
|
|
|
17486
17601
|
return c.json({ error: "Failed to save password" }, 500);
|
|
17487
17602
|
}
|
|
17488
17603
|
});
|
|
17489
|
-
|
|
17604
|
+
app48.route("/api/_client-error", client_error_default);
|
|
17490
17605
|
console.log("[client-error-route] mounted");
|
|
17491
|
-
|
|
17606
|
+
app48.use("*", async (c, next) => {
|
|
17492
17607
|
const host = (c.req.header("host") ?? "").split(":")[0];
|
|
17493
17608
|
const path2 = c.req.path;
|
|
17494
17609
|
if (path2 === "/favicon.ico" || path2.startsWith("/assets/") || path2.startsWith("/brand/")) {
|
|
@@ -17521,16 +17636,17 @@ app47.use("*", async (c, next) => {
|
|
|
17521
17636
|
console.error(`[remote-auth] login required ip=${clientIp} path=${path2} ${disambig}`);
|
|
17522
17637
|
return c.html(renderLoginPage({ ...resolveRemoteAuthOpts(), redirect: path2 }), 200);
|
|
17523
17638
|
});
|
|
17524
|
-
|
|
17525
|
-
|
|
17526
|
-
|
|
17527
|
-
|
|
17528
|
-
|
|
17529
|
-
|
|
17530
|
-
|
|
17531
|
-
|
|
17532
|
-
|
|
17533
|
-
|
|
17639
|
+
app48.route("/api/health", health_default);
|
|
17640
|
+
app48.route("/api/chat", chat_default);
|
|
17641
|
+
app48.route("/api/whatsapp", whatsapp_default);
|
|
17642
|
+
app48.route("/api/whatsapp-reader", whatsapp_reader_default);
|
|
17643
|
+
app48.route("/api/webchat", createWebchatRoutes({ handleInbound: (input) => webchatGateway.handleInbound(input) }));
|
|
17644
|
+
app48.route("/api/webchat/greeting", webchat_greeting_default);
|
|
17645
|
+
app48.route("/api/telegram", telegram_default);
|
|
17646
|
+
app48.route("/api/onboarding", onboarding_default);
|
|
17647
|
+
app48.route("/api/admin", admin_default);
|
|
17648
|
+
app48.route("/api/access", access_default);
|
|
17649
|
+
app48.route("/api/session", session_default2);
|
|
17534
17650
|
var SAFE_SLUG_RE2 = /^[a-z][a-z0-9-]{2,49}$/;
|
|
17535
17651
|
var SAFE_FILENAME_RE = /^[a-z0-9_][a-z0-9_.-]{0,99}$/i;
|
|
17536
17652
|
var IMAGE_MIME = {
|
|
@@ -17542,7 +17658,7 @@ var IMAGE_MIME = {
|
|
|
17542
17658
|
".svg": "image/svg+xml",
|
|
17543
17659
|
".ico": "image/x-icon"
|
|
17544
17660
|
};
|
|
17545
|
-
|
|
17661
|
+
app48.get("/agent-assets/:slug/:filename", (c) => {
|
|
17546
17662
|
const slug = c.req.param("slug");
|
|
17547
17663
|
const filename = c.req.param("filename");
|
|
17548
17664
|
if (!SAFE_SLUG_RE2.test(slug)) {
|
|
@@ -17577,7 +17693,7 @@ app47.get("/agent-assets/:slug/:filename", (c) => {
|
|
|
17577
17693
|
"Cache-Control": "public, max-age=3600"
|
|
17578
17694
|
});
|
|
17579
17695
|
});
|
|
17580
|
-
|
|
17696
|
+
app48.get("/generated/:filename", (c) => {
|
|
17581
17697
|
const filename = c.req.param("filename");
|
|
17582
17698
|
if (!SAFE_FILENAME_RE.test(filename) || filename.includes("..")) {
|
|
17583
17699
|
console.error(`[generated] serve file=${filename} status=403`);
|
|
@@ -17607,10 +17723,10 @@ app47.get("/generated/:filename", (c) => {
|
|
|
17607
17723
|
"Cache-Control": "public, max-age=86400"
|
|
17608
17724
|
});
|
|
17609
17725
|
});
|
|
17610
|
-
|
|
17611
|
-
|
|
17612
|
-
|
|
17613
|
-
|
|
17726
|
+
app48.route("/sites", sites_default);
|
|
17727
|
+
app48.route("/listings", listings_default);
|
|
17728
|
+
app48.route("/v", visitor_event_default);
|
|
17729
|
+
app48.route("/v", visitor_consent_default);
|
|
17614
17730
|
var htmlCache = /* @__PURE__ */ new Map();
|
|
17615
17731
|
var brandLogoPath = "/brand/maxy-monochrome.png";
|
|
17616
17732
|
var brandIconPath = "/brand/maxy-monochrome.png";
|
|
@@ -17741,7 +17857,7 @@ function escapeHtml(s) {
|
|
|
17741
17857
|
function agentUnavailableHtml() {
|
|
17742
17858
|
return `<!doctype html><html lang="en"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1"><title>${escapeHtml(BRAND.productName)}</title></head><body style="font-family:system-ui,sans-serif;max-width:32rem;margin:4rem auto;padding:0 1.5rem;color:#222"><h1 style="font-size:1.25rem">Agent unavailable</h1><p>This agent isn't available right now. If you reached this page from a saved link, the agent may have been turned off.</p></body></html>`;
|
|
17743
17859
|
}
|
|
17744
|
-
|
|
17860
|
+
app48.get("/", (c) => {
|
|
17745
17861
|
const host = (c.req.header("host") ?? "").split(":")[0];
|
|
17746
17862
|
if (isPublicHost(host)) {
|
|
17747
17863
|
const defaultSlug = resolveDefaultSlug();
|
|
@@ -17757,12 +17873,12 @@ app47.get("/", (c) => {
|
|
|
17757
17873
|
}
|
|
17758
17874
|
return c.html(cachedHtml("index.html"));
|
|
17759
17875
|
});
|
|
17760
|
-
|
|
17876
|
+
app48.get("/public", (c) => {
|
|
17761
17877
|
const host = (c.req.header("host") ?? "").split(":")[0];
|
|
17762
17878
|
if (isPublicHost(host)) return c.text("Not found", 404);
|
|
17763
17879
|
return c.html(cachedHtml("public.html"));
|
|
17764
17880
|
});
|
|
17765
|
-
|
|
17881
|
+
app48.get("/public-chat", (c) => {
|
|
17766
17882
|
const host = (c.req.header("host") ?? "").split(":")[0];
|
|
17767
17883
|
if (isPublicHost(host)) return c.text("Not found", 404);
|
|
17768
17884
|
return c.html(cachedHtml("public.html"));
|
|
@@ -17781,9 +17897,9 @@ async function logViewerFetch(c, next) {
|
|
|
17781
17897
|
duration_ms: Date.now() - start
|
|
17782
17898
|
});
|
|
17783
17899
|
}
|
|
17784
|
-
|
|
17785
|
-
|
|
17786
|
-
|
|
17900
|
+
app48.use("/vnc-viewer.html", logViewerFetch);
|
|
17901
|
+
app48.use("/vnc-popout.html", logViewerFetch);
|
|
17902
|
+
app48.get("/vnc-popout.html", (c) => {
|
|
17787
17903
|
let html = htmlCache.get("vnc-popout.html");
|
|
17788
17904
|
if (!html) {
|
|
17789
17905
|
html = readFileSync24(resolve27(process.cwd(), "public", "vnc-popout.html"), "utf-8");
|
|
@@ -17796,7 +17912,7 @@ app47.get("/vnc-popout.html", (c) => {
|
|
|
17796
17912
|
}
|
|
17797
17913
|
return c.html(html);
|
|
17798
17914
|
});
|
|
17799
|
-
|
|
17915
|
+
app48.post("/api/vnc/client-event", async (c) => {
|
|
17800
17916
|
let body;
|
|
17801
17917
|
try {
|
|
17802
17918
|
body = await c.req.json();
|
|
@@ -17817,35 +17933,30 @@ app47.post("/api/vnc/client-event", async (c) => {
|
|
|
17817
17933
|
});
|
|
17818
17934
|
return c.json({ ok: true });
|
|
17819
17935
|
});
|
|
17820
|
-
|
|
17936
|
+
app48.get("/g/:slug", (c) => {
|
|
17821
17937
|
return c.html(brandedPublicHtml());
|
|
17822
17938
|
});
|
|
17823
|
-
|
|
17939
|
+
app48.get("/graph", (c) => {
|
|
17824
17940
|
const host = (c.req.header("host") ?? "").split(":")[0];
|
|
17825
17941
|
if (isPublicHost(host)) return c.text("Not found", 404);
|
|
17826
17942
|
return c.html(cachedHtml("graph.html"));
|
|
17827
17943
|
});
|
|
17828
|
-
|
|
17944
|
+
app48.get("/chat", (c) => {
|
|
17829
17945
|
const host = (c.req.header("host") ?? "").split(":")[0];
|
|
17830
17946
|
if (isPublicHost(host)) return c.text("Not found", 404);
|
|
17831
17947
|
return c.html(cachedHtml("chat.html"));
|
|
17832
17948
|
});
|
|
17833
|
-
|
|
17834
|
-
const host = (c.req.header("host") ?? "").split(":")[0];
|
|
17835
|
-
if (isPublicHost(host)) return c.text("Not found", 404);
|
|
17836
|
-
return c.html(cachedHtml("sessions.html"));
|
|
17837
|
-
});
|
|
17838
|
-
app47.get("/data", (c) => {
|
|
17949
|
+
app48.get("/data", (c) => {
|
|
17839
17950
|
const host = (c.req.header("host") ?? "").split(":")[0];
|
|
17840
17951
|
if (isPublicHost(host)) return c.text("Not found", 404);
|
|
17841
17952
|
return c.html(cachedHtml("data.html"));
|
|
17842
17953
|
});
|
|
17843
|
-
|
|
17954
|
+
app48.get("/browser", (c) => {
|
|
17844
17955
|
const host = (c.req.header("host") ?? "").split(":")[0];
|
|
17845
17956
|
if (isPublicHost(host)) return c.text("Not found", 404);
|
|
17846
17957
|
return c.html(cachedHtml("browser.html"));
|
|
17847
17958
|
});
|
|
17848
|
-
|
|
17959
|
+
app48.get("/:slug", async (c, next) => {
|
|
17849
17960
|
const slug = c.req.param("slug");
|
|
17850
17961
|
if (AGENT_SLUG_PATTERN.test(`/${slug}`)) {
|
|
17851
17962
|
const account = resolveAccount();
|
|
@@ -17860,13 +17971,13 @@ app47.get("/:slug", async (c, next) => {
|
|
|
17860
17971
|
await next();
|
|
17861
17972
|
});
|
|
17862
17973
|
if (brandFaviconPath !== "/favicon.ico") {
|
|
17863
|
-
|
|
17974
|
+
app48.get("/favicon.ico", (c) => {
|
|
17864
17975
|
c.header("Cache-Control", "public, max-age=300");
|
|
17865
17976
|
return c.redirect(brandFaviconPath, 302);
|
|
17866
17977
|
});
|
|
17867
17978
|
}
|
|
17868
|
-
|
|
17869
|
-
|
|
17979
|
+
app48.use("/*", serveStatic({ root: "./public" }));
|
|
17980
|
+
app48.all("*", (c) => {
|
|
17870
17981
|
const host = (c.req.header("host") ?? "").split(":")[0];
|
|
17871
17982
|
const path2 = c.req.path;
|
|
17872
17983
|
if (isPublicHost(host)) {
|
|
@@ -17880,7 +17991,7 @@ app47.all("*", (c) => {
|
|
|
17880
17991
|
});
|
|
17881
17992
|
var port = requirePortEnv("MAXY_UI_INTERNAL_PORT", { tag: "ui-server" });
|
|
17882
17993
|
var hostname = process.env.HOSTNAME ?? "127.0.0.1";
|
|
17883
|
-
var httpServer = serve({ fetch:
|
|
17994
|
+
var httpServer = serve({ fetch: app48.fetch, port, hostname });
|
|
17884
17995
|
console.log(`${BRAND.productName} listening on http://${hostname}:${port}`);
|
|
17885
17996
|
startAuthHealthHeartbeat();
|
|
17886
17997
|
{
|
|
@@ -17919,7 +18030,7 @@ for (const m of SUBAPP_MANIFEST) {
|
|
|
17919
18030
|
}
|
|
17920
18031
|
try {
|
|
17921
18032
|
const registered = [];
|
|
17922
|
-
for (const r of
|
|
18033
|
+
for (const r of app48.routes ?? []) {
|
|
17923
18034
|
if (typeof r.path !== "string" || r.path.includes(":") || r.path.includes("*")) continue;
|
|
17924
18035
|
if (AGENT_SLUG_PATTERN.test(r.path)) {
|
|
17925
18036
|
registered.push({ method: (r.method ?? "ALL").toUpperCase(), path: r.path });
|