@rubytech/create-sitedesk-code 0.1.523 → 0.1.524
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/payload/platform/lib/agent-dispatch-rule/dist/index.d.ts +99 -0
- package/payload/platform/lib/agent-dispatch-rule/dist/index.d.ts.map +1 -0
- package/payload/platform/lib/agent-dispatch-rule/dist/index.js +228 -0
- package/payload/platform/lib/agent-dispatch-rule/dist/index.js.map +1 -0
- package/payload/platform/lib/agent-dispatch-rule/package.json +6 -0
- package/payload/platform/lib/agent-dispatch-rule/src/__tests__/rule.test.ts +384 -0
- package/payload/platform/lib/agent-dispatch-rule/src/index.ts +269 -0
- package/payload/platform/lib/agent-dispatch-rule/tsconfig.json +9 -0
- package/payload/platform/lib/agent-dispatch-rule/vitest.config.ts +9 -0
- package/payload/platform/lib/routine-templates/dist/roster.js +1 -1
- package/payload/platform/lib/routine-templates/src/roster.ts +1 -1
- package/payload/platform/package.json +2 -2
- package/payload/platform/plugins/admin/PLUGIN.md +1 -0
- package/payload/platform/plugins/admin/hooks/__tests__/mailbox-inject.test.sh +501 -0
- package/payload/platform/plugins/admin/hooks/mailbox-inject.sh +299 -0
- package/payload/platform/plugins/admin/skills/platform-architecture/SKILL.md +54 -21
- package/payload/platform/plugins/admin/skills/whats-new/SKILL.md +6 -0
- package/payload/platform/plugins/docs/references/admin-ui.md +49 -18
- package/payload/platform/plugins/docs/references/workflows.md +4 -2
- package/payload/platform/plugins/email/mcp/dist/__tests__/email-status.test.js +72 -1
- package/payload/platform/plugins/email/mcp/dist/__tests__/email-status.test.js.map +1 -1
- package/payload/platform/plugins/email/mcp/dist/__tests__/mailbox-resolve.test.js +4 -1
- package/payload/platform/plugins/email/mcp/dist/__tests__/mailbox-resolve.test.js.map +1 -1
- package/payload/platform/plugins/email/mcp/dist/lib/credentials.d.ts.map +1 -1
- package/payload/platform/plugins/email/mcp/dist/lib/credentials.js +4 -2
- package/payload/platform/plugins/email/mcp/dist/lib/credentials.js.map +1 -1
- package/payload/platform/plugins/email/mcp/dist/tools/email-status.d.ts +0 -6
- package/payload/platform/plugins/email/mcp/dist/tools/email-status.d.ts.map +1 -1
- package/payload/platform/plugins/email/mcp/dist/tools/email-status.js +24 -2
- package/payload/platform/plugins/email/mcp/dist/tools/email-status.js.map +1 -1
- package/payload/platform/plugins/email/references/email-reference.md +1 -1
- package/payload/platform/plugins/outlook/mcp/dist/__tests__/mail-search-delegated-ids.test.d.ts +2 -0
- package/payload/platform/plugins/outlook/mcp/dist/__tests__/mail-search-delegated-ids.test.d.ts.map +1 -0
- package/payload/platform/plugins/outlook/mcp/dist/__tests__/mail-search-delegated-ids.test.js +322 -0
- package/payload/platform/plugins/outlook/mcp/dist/__tests__/mail-search-delegated-ids.test.js.map +1 -0
- package/payload/platform/plugins/outlook/mcp/dist/__tests__/mailbox-registry.test.js +21 -1
- package/payload/platform/plugins/outlook/mcp/dist/__tests__/mailbox-registry.test.js.map +1 -1
- package/payload/platform/plugins/outlook/mcp/dist/auth/mailbox-registry.d.ts +13 -0
- package/payload/platform/plugins/outlook/mcp/dist/auth/mailbox-registry.d.ts.map +1 -1
- package/payload/platform/plugins/outlook/mcp/dist/auth/mailbox-registry.js +16 -0
- package/payload/platform/plugins/outlook/mcp/dist/auth/mailbox-registry.js.map +1 -1
- package/payload/platform/plugins/outlook/mcp/dist/index.js +5 -5
- package/payload/platform/plugins/outlook/mcp/dist/index.js.map +1 -1
- package/payload/platform/plugins/outlook/mcp/dist/lib/graph-client.d.ts.map +1 -1
- package/payload/platform/plugins/outlook/mcp/dist/lib/graph-client.js +6 -0
- package/payload/platform/plugins/outlook/mcp/dist/lib/graph-client.js.map +1 -1
- package/payload/platform/plugins/outlook/mcp/dist/tools/mail-search.d.ts +7 -0
- package/payload/platform/plugins/outlook/mcp/dist/tools/mail-search.d.ts.map +1 -1
- package/payload/platform/plugins/outlook/mcp/dist/tools/mail-search.js +122 -8
- package/payload/platform/plugins/outlook/mcp/dist/tools/mail-search.js.map +1 -1
- package/payload/platform/plugins/scheduling/PLUGIN.md +20 -1
- package/payload/platform/plugins/scheduling/mcp/dist/index.js +6 -4
- package/payload/platform/plugins/scheduling/mcp/dist/index.js.map +1 -1
- package/payload/platform/plugins/scheduling/mcp/dist/lib/__tests__/agent-dispatch.test.js +8 -36
- package/payload/platform/plugins/scheduling/mcp/dist/lib/__tests__/agent-dispatch.test.js.map +1 -1
- package/payload/platform/plugins/scheduling/mcp/dist/lib/agent-dispatch.d.ts +10 -65
- package/payload/platform/plugins/scheduling/mcp/dist/lib/agent-dispatch.d.ts.map +1 -1
- package/payload/platform/plugins/scheduling/mcp/dist/lib/agent-dispatch.js +29 -122
- package/payload/platform/plugins/scheduling/mcp/dist/lib/agent-dispatch.js.map +1 -1
- package/payload/platform/plugins/scheduling/mcp/dist/tools/__tests__/schedule-update-status.test.d.ts +2 -0
- package/payload/platform/plugins/scheduling/mcp/dist/tools/__tests__/schedule-update-status.test.d.ts.map +1 -0
- package/payload/platform/plugins/scheduling/mcp/dist/tools/__tests__/schedule-update-status.test.js +305 -0
- package/payload/platform/plugins/scheduling/mcp/dist/tools/__tests__/schedule-update-status.test.js.map +1 -0
- package/payload/platform/plugins/scheduling/mcp/dist/tools/schedule-update.d.ts +46 -1
- package/payload/platform/plugins/scheduling/mcp/dist/tools/schedule-update.d.ts.map +1 -1
- package/payload/platform/plugins/scheduling/mcp/dist/tools/schedule-update.js +172 -4
- package/payload/platform/plugins/scheduling/mcp/dist/tools/schedule-update.js.map +1 -1
- package/payload/platform/plugins/scheduling/skills/routine-control/SKILL.md +48 -0
- package/payload/platform/plugins/sweep/skills/email-graph-sweep/SKILL.md +21 -7
- package/payload/platform/scripts/__tests__/mailbox-inject-registered.test.sh +80 -0
- package/payload/platform/scripts/lib/__tests__/account-settings-mailbox-inject.test.sh +166 -0
- package/payload/platform/scripts/lib/account-settings-mailbox-inject.sh +91 -0
- package/payload/platform/scripts/lib/provision-account-dir.sh +1 -0
- package/payload/platform/scripts/setup-account.sh +15 -0
- package/payload/server/public/activity.html +5 -5
- package/payload/server/public/agents.html +4 -4
- package/payload/server/public/assets/{AdminLoginScreens-uknqh2Pm.js → AdminLoginScreens-BgDjueVe.js} +1 -1
- package/payload/server/public/assets/AdminLoginScreens-BgDjueVe.js.br +0 -0
- package/payload/server/public/assets/AdminLoginScreens-BgDjueVe.js.gz +0 -0
- package/payload/server/public/assets/{AdminShell-GqtMImyQ.js → AdminShell-YctTrR-D.js} +1 -1
- package/payload/server/public/assets/AdminShell-YctTrR-D.js.br +0 -0
- package/payload/server/public/assets/AdminShell-YctTrR-D.js.gz +0 -0
- package/payload/server/public/assets/{activity-B4KfMJqO.js → activity-DGQt5ys_.js} +1 -1
- package/payload/server/public/assets/activity-DGQt5ys_.js.br +0 -0
- package/payload/server/public/assets/activity-DGQt5ys_.js.gz +0 -0
- package/payload/server/public/assets/admin-DnUxbB3P.js +1 -0
- package/payload/server/public/assets/admin-DnUxbB3P.js.br +0 -0
- package/payload/server/public/assets/admin-DnUxbB3P.js.gz +0 -0
- package/payload/server/public/assets/agents-Bc2LZjwC.js +1 -0
- package/payload/server/public/assets/agents-Bc2LZjwC.js.br +0 -0
- package/payload/server/public/assets/agents-Bc2LZjwC.js.gz +0 -0
- package/payload/server/public/assets/{arc-DaI5MLTq.js → arc-DaudCnXg.js} +1 -1
- package/payload/server/public/assets/arc-DaudCnXg.js.br +0 -0
- package/payload/server/public/assets/arc-DaudCnXg.js.gz +0 -0
- package/payload/server/public/assets/architecture-YZFGNWBL-DPFsm5jD.js +1 -0
- package/payload/server/public/assets/architecture-YZFGNWBL-DPFsm5jD.js.br +0 -0
- package/payload/server/public/assets/{architectureDiagram-Q4EWVU46-CBGVUEN9.js → architectureDiagram-Q4EWVU46-BEEC3s7i.js} +1 -1
- package/payload/server/public/assets/architectureDiagram-Q4EWVU46-BEEC3s7i.js.br +0 -0
- package/payload/server/public/assets/architectureDiagram-Q4EWVU46-BEEC3s7i.js.gz +0 -0
- package/payload/server/public/assets/{blockDiagram-DXYQGD6D-DS6dS4GZ.js → blockDiagram-DXYQGD6D-BIWyfb18.js} +1 -1
- package/payload/server/public/assets/blockDiagram-DXYQGD6D-BIWyfb18.js.br +0 -0
- package/payload/server/public/assets/blockDiagram-DXYQGD6D-BIWyfb18.js.gz +0 -0
- package/payload/server/public/assets/{browser-B3hSzI3O.js → browser-BtF7SzvG.js} +1 -1
- package/payload/server/public/assets/browser-BtF7SzvG.js.br +0 -0
- package/payload/server/public/assets/browser-BtF7SzvG.js.gz +0 -0
- package/payload/server/public/assets/{c4Diagram-AHTNJAMY-hBSBUZPt.js → c4Diagram-AHTNJAMY--h6oE2cv.js} +1 -1
- package/payload/server/public/assets/c4Diagram-AHTNJAMY--h6oE2cv.js.br +0 -0
- package/payload/server/public/assets/{c4Diagram-AHTNJAMY-hBSBUZPt.js.gz → c4Diagram-AHTNJAMY--h6oE2cv.js.gz} +0 -0
- package/payload/server/public/assets/{calendar-BggxXxhS.js → calendar-D25EhXbD.js} +1 -1
- package/payload/server/public/assets/calendar-D25EhXbD.js.br +0 -0
- package/payload/server/public/assets/calendar-D25EhXbD.js.gz +0 -0
- package/payload/server/public/assets/channel-TwxCDSpK.js +1 -0
- package/payload/server/public/assets/channel-TwxCDSpK.js.br +0 -0
- package/payload/server/public/assets/chat-z4jsHFXg.js +1 -0
- package/payload/server/public/assets/chat-z4jsHFXg.js.br +0 -0
- package/payload/server/public/assets/chat-z4jsHFXg.js.gz +0 -0
- package/payload/server/public/assets/chevron-left-BD09SN6R.js +1 -0
- package/payload/server/public/assets/chevron-right-ChmWeo7T.js +1 -0
- package/payload/server/public/assets/chevron-right-ChmWeo7T.js.br +0 -0
- package/payload/server/public/assets/{chunk-2KRD3SAO-B6koUoB7.js → chunk-2KRD3SAO-BwEVlnxo.js} +1 -1
- package/payload/server/public/assets/chunk-2KRD3SAO-BwEVlnxo.js.br +0 -0
- package/payload/server/public/assets/chunk-2KRD3SAO-BwEVlnxo.js.gz +0 -0
- package/payload/server/public/assets/{chunk-336JU56O-BF6BRh8u.js → chunk-336JU56O-DQddTATH.js} +2 -2
- package/payload/server/public/assets/chunk-336JU56O-DQddTATH.js.br +0 -0
- package/payload/server/public/assets/chunk-336JU56O-DQddTATH.js.gz +0 -0
- package/payload/server/public/assets/chunk-426QAEUC-BDC8wptW.js +1 -0
- package/payload/server/public/assets/chunk-426QAEUC-BDC8wptW.js.br +0 -0
- package/payload/server/public/assets/chunk-426QAEUC-BDC8wptW.js.gz +0 -0
- package/payload/server/public/assets/{chunk-4BX2VUAB-7sO95xR2.js → chunk-4BX2VUAB-C5p3xTC6.js} +1 -1
- package/payload/server/public/assets/chunk-4BX2VUAB-C5p3xTC6.js.br +0 -0
- package/payload/server/public/assets/chunk-4BX2VUAB-C5p3xTC6.js.gz +0 -0
- package/payload/server/public/assets/{chunk-4TB4RGXK-GCTndJYx.js → chunk-4TB4RGXK-gClfNc1w.js} +1 -1
- package/payload/server/public/assets/chunk-4TB4RGXK-gClfNc1w.js.br +0 -0
- package/payload/server/public/assets/chunk-4TB4RGXK-gClfNc1w.js.gz +0 -0
- package/payload/server/public/assets/{chunk-55IACEB6-ggIJf_TC.js → chunk-55IACEB6-DDU_m1ra.js} +1 -1
- package/payload/server/public/assets/chunk-55IACEB6-DDU_m1ra.js.br +0 -0
- package/payload/server/public/assets/chunk-55IACEB6-DDU_m1ra.js.gz +0 -0
- package/payload/server/public/assets/{chunk-5FUZZQ4R-DeGmkimt.js → chunk-5FUZZQ4R-CZ2jQWNR.js} +1 -1
- package/payload/server/public/assets/chunk-5FUZZQ4R-CZ2jQWNR.js.br +0 -0
- package/payload/server/public/assets/chunk-5FUZZQ4R-CZ2jQWNR.js.gz +0 -0
- package/payload/server/public/assets/{chunk-5PVQY5BW-aFIQKk_U.js → chunk-5PVQY5BW-kcZ5kfTg.js} +1 -1
- package/payload/server/public/assets/chunk-5PVQY5BW-kcZ5kfTg.js.br +0 -0
- package/payload/server/public/assets/chunk-5PVQY5BW-kcZ5kfTg.js.gz +0 -0
- package/payload/server/public/assets/{chunk-67CJDMHE-LS8rUbii.js → chunk-67CJDMHE-9W0Qv0jm.js} +1 -1
- package/payload/server/public/assets/chunk-67CJDMHE-9W0Qv0jm.js.br +0 -0
- package/payload/server/public/assets/chunk-67CJDMHE-9W0Qv0jm.js.gz +0 -0
- package/payload/server/public/assets/{chunk-7N4EOEYR-JKOVngS0.js → chunk-7N4EOEYR-B3gqydR3.js} +1 -1
- package/payload/server/public/assets/chunk-7N4EOEYR-B3gqydR3.js.br +0 -0
- package/payload/server/public/assets/chunk-7N4EOEYR-B3gqydR3.js.gz +0 -0
- package/payload/server/public/assets/{chunk-AA7GKIK3-CoXnTVK6.js → chunk-AA7GKIK3-DW8a-2NK.js} +1 -1
- package/payload/server/public/assets/chunk-AA7GKIK3-DW8a-2NK.js.br +4 -0
- package/payload/server/public/assets/chunk-AA7GKIK3-DW8a-2NK.js.gz +0 -0
- package/payload/server/public/assets/{chunk-BSJP7CBP-CcsqObFg.js → chunk-BSJP7CBP-DqXIO_5R.js} +1 -1
- package/payload/server/public/assets/chunk-BSJP7CBP-DqXIO_5R.js.br +0 -0
- package/payload/server/public/assets/chunk-BSJP7CBP-DqXIO_5R.js.gz +0 -0
- package/payload/server/public/assets/{chunk-CIAEETIT-CpsybR7q.js → chunk-CIAEETIT-BMJfgj2u.js} +1 -1
- package/payload/server/public/assets/chunk-CIAEETIT-BMJfgj2u.js.br +0 -0
- package/payload/server/public/assets/chunk-CIAEETIT-BMJfgj2u.js.gz +0 -0
- package/payload/server/public/assets/{chunk-EDXVE4YY-BZ2I9PSq.js → chunk-EDXVE4YY-BxdLPk0b.js} +1 -1
- package/payload/server/public/assets/chunk-EDXVE4YY-BxdLPk0b.js.br +0 -0
- package/payload/server/public/assets/chunk-EDXVE4YY-BxdLPk0b.js.gz +0 -0
- package/payload/server/public/assets/{chunk-ENJZ2VHE-DbTwt6OZ.js → chunk-ENJZ2VHE-Cfe2DCjQ.js} +1 -1
- package/payload/server/public/assets/chunk-ENJZ2VHE-Cfe2DCjQ.js.br +0 -0
- package/payload/server/public/assets/chunk-ENJZ2VHE-Cfe2DCjQ.js.gz +0 -0
- package/payload/server/public/assets/{chunk-FMBD7UC4-D27VnSCa.js → chunk-FMBD7UC4-CdPjwbtf.js} +1 -1
- package/payload/server/public/assets/chunk-FMBD7UC4-CdPjwbtf.js.br +0 -0
- package/payload/server/public/assets/chunk-FMBD7UC4-CdPjwbtf.js.gz +0 -0
- package/payload/server/public/assets/{chunk-FOC6F5B3-C0tU2UFl.js → chunk-FOC6F5B3-Dl6l1KAh.js} +1 -1
- package/payload/server/public/assets/chunk-FOC6F5B3-Dl6l1KAh.js.br +0 -0
- package/payload/server/public/assets/chunk-FOC6F5B3-Dl6l1KAh.js.gz +0 -0
- package/payload/server/public/assets/{chunk-ICPOFSXX-UPPu2OIq.js → chunk-ICPOFSXX-PnsGrqtx.js} +2 -2
- package/payload/server/public/assets/chunk-ICPOFSXX-PnsGrqtx.js.br +0 -0
- package/payload/server/public/assets/chunk-ICPOFSXX-PnsGrqtx.js.gz +0 -0
- package/payload/server/public/assets/{chunk-K5T4RW27-DIKxqyYw.js → chunk-K5T4RW27--g29_wjW.js} +1 -1
- package/payload/server/public/assets/chunk-K5T4RW27--g29_wjW.js.br +0 -0
- package/payload/server/public/assets/chunk-K5T4RW27--g29_wjW.js.gz +0 -0
- package/payload/server/public/assets/{chunk-KGLVRYIC-CiL4YVLo.js → chunk-KGLVRYIC-CI77ENeO.js} +1 -1
- package/payload/server/public/assets/chunk-KGLVRYIC-CI77ENeO.js.br +3 -0
- package/payload/server/public/assets/chunk-KGLVRYIC-CI77ENeO.js.gz +0 -0
- package/payload/server/public/assets/{chunk-LIHQZDEY-ejKezVlD.js → chunk-LIHQZDEY-CE-XByg6.js} +1 -1
- package/payload/server/public/assets/chunk-LIHQZDEY-CE-XByg6.js.br +0 -0
- package/payload/server/public/assets/chunk-LIHQZDEY-CE-XByg6.js.gz +0 -0
- package/payload/server/public/assets/{chunk-ORNJ4GCN-Cc0vqc-D.js → chunk-ORNJ4GCN-DkjJQQSm.js} +1 -1
- package/payload/server/public/assets/chunk-ORNJ4GCN-DkjJQQSm.js.br +0 -0
- package/payload/server/public/assets/chunk-ORNJ4GCN-DkjJQQSm.js.gz +0 -0
- package/payload/server/public/assets/{chunk-OYMX7WX6-Drxn1qG0.js → chunk-OYMX7WX6-DhogFeD7.js} +1 -1
- package/payload/server/public/assets/chunk-OYMX7WX6-DhogFeD7.js.br +0 -0
- package/payload/server/public/assets/chunk-OYMX7WX6-DhogFeD7.js.gz +0 -0
- package/payload/server/public/assets/chunk-QZHKN3VN-DnqqL1de.js +1 -0
- package/payload/server/public/assets/chunk-QZHKN3VN-DnqqL1de.js.br +0 -0
- package/payload/server/public/assets/chunk-QZHKN3VN-DnqqL1de.js.gz +0 -0
- package/payload/server/public/assets/{chunk-U2HBQHQK-DnbQIkRP.js → chunk-U2HBQHQK-CeaRXuiO.js} +1 -1
- package/payload/server/public/assets/chunk-U2HBQHQK-CeaRXuiO.js.br +0 -0
- package/payload/server/public/assets/chunk-U2HBQHQK-CeaRXuiO.js.gz +0 -0
- package/payload/server/public/assets/{chunk-X2U36JSP-CauTSVWg.js → chunk-X2U36JSP-BqxXeOqf.js} +1 -1
- package/payload/server/public/assets/chunk-X2U36JSP-BqxXeOqf.js.br +0 -0
- package/payload/server/public/assets/chunk-X2U36JSP-BqxXeOqf.js.gz +0 -0
- package/payload/server/public/assets/{chunk-XPW4576I-DZqqB9Zi.js → chunk-XPW4576I-DtqJwn2x.js} +1 -1
- package/payload/server/public/assets/chunk-XPW4576I-DtqJwn2x.js.br +0 -0
- package/payload/server/public/assets/chunk-XPW4576I-DtqJwn2x.js.gz +0 -0
- package/payload/server/public/assets/{chunk-YZCP3GAM-BGHo4Li-.js → chunk-YZCP3GAM-COBlEwQw.js} +1 -1
- package/payload/server/public/assets/chunk-YZCP3GAM-COBlEwQw.js.br +0 -0
- package/payload/server/public/assets/chunk-YZCP3GAM-COBlEwQw.js.gz +0 -0
- package/payload/server/public/assets/{chunk-ZZ45TVLE-DWGJKPd7.js → chunk-ZZ45TVLE-CcL088y6.js} +1 -1
- package/payload/server/public/assets/chunk-ZZ45TVLE-CcL088y6.js.br +0 -0
- package/payload/server/public/assets/chunk-ZZ45TVLE-CcL088y6.js.gz +0 -0
- package/payload/server/public/assets/classDiagram-6PBFFD2Q-Bc3P4dpc.js +1 -0
- package/payload/server/public/assets/classDiagram-6PBFFD2Q-Bc3P4dpc.js.br +0 -0
- package/payload/server/public/assets/classDiagram-6PBFFD2Q-Bc3P4dpc.js.gz +0 -0
- package/payload/server/public/assets/classDiagram-v2-HSJHXN6E-DgEF_rR_.js +1 -0
- package/payload/server/public/assets/classDiagram-v2-HSJHXN6E-DgEF_rR_.js.br +0 -0
- package/payload/server/public/assets/classDiagram-v2-HSJHXN6E-DgEF_rR_.js.gz +0 -0
- package/payload/server/public/assets/clock-Yqf7Ke7I.js +1 -0
- package/payload/server/public/assets/clock-Yqf7Ke7I.js.br +0 -0
- package/payload/server/public/assets/clock-Yqf7Ke7I.js.gz +0 -0
- package/payload/server/public/assets/clone-B3vq32j7.js +1 -0
- package/payload/server/public/assets/{cose-bilkent-S5V4N54A-D-95BzXL.js → cose-bilkent-S5V4N54A-kEHVkDNn.js} +1 -1
- package/payload/server/public/assets/cose-bilkent-S5V4N54A-kEHVkDNn.js.br +0 -0
- package/payload/server/public/assets/cose-bilkent-S5V4N54A-kEHVkDNn.js.gz +0 -0
- package/payload/server/public/assets/{dagre-BZYNBHvT.js → dagre-D2wUw1zC.js} +1 -1
- package/payload/server/public/assets/dagre-D2wUw1zC.js.br +0 -0
- package/payload/server/public/assets/dagre-D2wUw1zC.js.gz +0 -0
- package/payload/server/public/assets/{dagre-KV5264BT-DyU4HQLQ.js → dagre-KV5264BT-BWfTDwEs.js} +1 -1
- package/payload/server/public/assets/dagre-KV5264BT-BWfTDwEs.js.br +0 -0
- package/payload/server/public/assets/dagre-KV5264BT-BWfTDwEs.js.gz +0 -0
- package/payload/server/public/assets/data-RmnKj5nC.js +1 -0
- package/payload/server/public/assets/data-RmnKj5nC.js.br +2 -0
- package/payload/server/public/assets/data-RmnKj5nC.js.gz +0 -0
- package/payload/server/public/assets/{diagram-5BDNPKRD-CCttJ9XA.js → diagram-5BDNPKRD-Tl9dS8w0.js} +1 -1
- package/payload/server/public/assets/diagram-5BDNPKRD-Tl9dS8w0.js.br +0 -0
- package/payload/server/public/assets/diagram-5BDNPKRD-Tl9dS8w0.js.gz +0 -0
- package/payload/server/public/assets/{diagram-G4DWMVQ6-DvkpgSLO.js → diagram-G4DWMVQ6-CeSe6TMu.js} +1 -1
- package/payload/server/public/assets/diagram-G4DWMVQ6-CeSe6TMu.js.br +0 -0
- package/payload/server/public/assets/diagram-G4DWMVQ6-CeSe6TMu.js.gz +0 -0
- package/payload/server/public/assets/{diagram-MMDJMWI5-DHmW5Y9k.js → diagram-MMDJMWI5-DYBNJCmk.js} +1 -1
- package/payload/server/public/assets/diagram-MMDJMWI5-DYBNJCmk.js.br +0 -0
- package/payload/server/public/assets/diagram-MMDJMWI5-DYBNJCmk.js.gz +0 -0
- package/payload/server/public/assets/{diagram-TYMM5635-C6T4hwzO.js → diagram-TYMM5635-BmpUGltx.js} +1 -1
- package/payload/server/public/assets/diagram-TYMM5635-BmpUGltx.js.br +0 -0
- package/payload/server/public/assets/diagram-TYMM5635-BmpUGltx.js.gz +0 -0
- package/payload/server/public/assets/{erDiagram-SMLLAGMA-5v_o7s3T.js → erDiagram-SMLLAGMA-DuwuNGqx.js} +1 -1
- package/payload/server/public/assets/erDiagram-SMLLAGMA-DuwuNGqx.js.br +0 -0
- package/payload/server/public/assets/erDiagram-SMLLAGMA-DuwuNGqx.js.gz +0 -0
- package/payload/server/public/assets/file-download-CiGklOfA.js +1 -0
- package/payload/server/public/assets/file-download-CiGklOfA.js.br +0 -0
- package/payload/server/public/assets/file-download-CiGklOfA.js.gz +0 -0
- package/payload/server/public/assets/{file-text-BKs9eyiw.js → file-text-XjJPULAZ.js} +1 -1
- package/payload/server/public/assets/file-text-XjJPULAZ.js.br +0 -0
- package/payload/server/public/assets/file-text-XjJPULAZ.js.gz +0 -0
- package/payload/server/public/assets/{flatten-BtIc9jX7.js → flatten-Bu-b1uTY.js} +1 -1
- package/payload/server/public/assets/flatten-Bu-b1uTY.js.br +0 -0
- package/payload/server/public/assets/flatten-Bu-b1uTY.js.gz +0 -0
- package/payload/server/public/assets/{flowDiagram-DWJPFMVM-3UhCDsjt.js → flowDiagram-DWJPFMVM-Bpp8P6Ba.js} +1 -1
- package/payload/server/public/assets/flowDiagram-DWJPFMVM-Bpp8P6Ba.js.br +0 -0
- package/payload/server/public/assets/flowDiagram-DWJPFMVM-Bpp8P6Ba.js.gz +0 -0
- package/payload/server/public/assets/{ganttDiagram-T4ZO3ILL-F2zgHIIQ.js → ganttDiagram-T4ZO3ILL-CE6ppjB4.js} +1 -1
- package/payload/server/public/assets/ganttDiagram-T4ZO3ILL-CE6ppjB4.js.br +0 -0
- package/payload/server/public/assets/ganttDiagram-T4ZO3ILL-CE6ppjB4.js.gz +0 -0
- package/payload/server/public/assets/gitGraph-7Q5UKJZL-B0OUwOUx.js +1 -0
- package/payload/server/public/assets/gitGraph-7Q5UKJZL-B0OUwOUx.js.br +0 -0
- package/payload/server/public/assets/{gitGraphDiagram-UUTBAWPF-oQc1N3dT.js → gitGraphDiagram-UUTBAWPF-BdK1GjPr.js} +1 -1
- package/payload/server/public/assets/gitGraphDiagram-UUTBAWPF-BdK1GjPr.js.br +0 -0
- package/payload/server/public/assets/gitGraphDiagram-UUTBAWPF-BdK1GjPr.js.gz +0 -0
- package/payload/server/public/assets/{graph-DTi71NaZ.js → graph-BjHJ0z_6.js} +1 -1
- package/payload/server/public/assets/graph-BjHJ0z_6.js.br +0 -0
- package/payload/server/public/assets/graph-BjHJ0z_6.js.gz +0 -0
- package/payload/server/public/assets/{graph-labels-BT3S6e9H.js → graph-labels-D-0u37KA.js} +1 -1
- package/payload/server/public/assets/graph-labels-D-0u37KA.js.br +0 -0
- package/payload/server/public/assets/graph-labels-D-0u37KA.js.gz +0 -0
- package/payload/server/public/assets/{graphlib-DY4-AT2Q.js → graphlib-CHEXylyU.js} +1 -1
- package/payload/server/public/assets/graphlib-CHEXylyU.js.br +0 -0
- package/payload/server/public/assets/graphlib-CHEXylyU.js.gz +0 -0
- package/payload/server/public/assets/info-OMHHGYJF-C_8TwPDe.js +1 -0
- package/payload/server/public/assets/info-OMHHGYJF-C_8TwPDe.js.br +0 -0
- package/payload/server/public/assets/infoDiagram-42DDH7IO-msfwyvbV.js +2 -0
- package/payload/server/public/assets/infoDiagram-42DDH7IO-msfwyvbV.js.br +0 -0
- package/payload/server/public/assets/infoDiagram-42DDH7IO-msfwyvbV.js.gz +0 -0
- package/payload/server/public/assets/{isEmpty-Bu4fZ8Kf.js → isEmpty-CjH0UASp.js} +1 -1
- package/payload/server/public/assets/isEmpty-CjH0UASp.js.br +0 -0
- package/payload/server/public/assets/isEmpty-CjH0UASp.js.gz +0 -0
- package/payload/server/public/assets/{ishikawaDiagram-UXIWVN3A-wJhSOkuw.js → ishikawaDiagram-UXIWVN3A-CgkVZ4-3.js} +1 -1
- package/payload/server/public/assets/ishikawaDiagram-UXIWVN3A-CgkVZ4-3.js.br +0 -0
- package/payload/server/public/assets/ishikawaDiagram-UXIWVN3A-CgkVZ4-3.js.gz +0 -0
- package/payload/server/public/assets/{journeyDiagram-VCZTEJTY-DgadC6Pz.js → journeyDiagram-VCZTEJTY-ByUPv8q6.js} +1 -1
- package/payload/server/public/assets/journeyDiagram-VCZTEJTY-ByUPv8q6.js.br +0 -0
- package/payload/server/public/assets/journeyDiagram-VCZTEJTY-ByUPv8q6.js.gz +0 -0
- package/payload/server/public/assets/{kanban-definition-6JOO6SKY-Bs4nQqXI.js → kanban-definition-6JOO6SKY-CFinqhpu.js} +1 -1
- package/payload/server/public/assets/kanban-definition-6JOO6SKY-CFinqhpu.js.br +0 -0
- package/payload/server/public/assets/kanban-definition-6JOO6SKY-CFinqhpu.js.gz +0 -0
- package/payload/server/public/assets/{line-Bnmxy1hO.js → line-Y4ns5Ghi.js} +1 -1
- package/payload/server/public/assets/line-Y4ns5Ghi.js.br +0 -0
- package/payload/server/public/assets/line-Y4ns5Ghi.js.gz +0 -0
- package/payload/server/public/assets/{linear-RvwZxFzh.js → linear-l39GooQ5.js} +1 -1
- package/payload/server/public/assets/linear-l39GooQ5.js.br +0 -0
- package/payload/server/public/assets/linear-l39GooQ5.js.gz +0 -0
- package/payload/server/public/assets/{maximize-2-zC94tsxY.js → maximize-2-BJ9S-nfS.js} +1 -1
- package/payload/server/public/assets/maximize-2-BJ9S-nfS.js.br +0 -0
- package/payload/server/public/assets/maximize-2-BJ9S-nfS.js.gz +0 -0
- package/payload/server/public/assets/{mermaid-parser.core-DeNV8RtA.js → mermaid-parser.core-5w0T1dRj.js} +2 -2
- package/payload/server/public/assets/mermaid-parser.core-5w0T1dRj.js.br +0 -0
- package/payload/server/public/assets/mermaid-parser.core-5w0T1dRj.js.gz +0 -0
- package/payload/server/public/assets/{mermaid.core-BU9IiSCP.js → mermaid.core-DBADY5VW.js} +3 -3
- package/payload/server/public/assets/mermaid.core-DBADY5VW.js.br +0 -0
- package/payload/server/public/assets/mermaid.core-DBADY5VW.js.gz +0 -0
- package/payload/server/public/assets/{mindmap-definition-QFDTVHPH-D1PMUxxm.js → mindmap-definition-QFDTVHPH-rHz37loq.js} +1 -1
- package/payload/server/public/assets/mindmap-definition-QFDTVHPH-rHz37loq.js.br +0 -0
- package/payload/server/public/assets/mindmap-definition-QFDTVHPH-rHz37loq.js.gz +0 -0
- package/payload/server/public/assets/{operator-BtWNEMh-.js → operator-Cay4rOOK.js} +1 -1
- package/payload/server/public/assets/operator-Cay4rOOK.js.br +0 -0
- package/payload/server/public/assets/operator-Cay4rOOK.js.gz +0 -0
- package/payload/server/public/assets/{ordinal-C2TEWKNu.js → ordinal-D6D6WcTC.js} +1 -1
- package/payload/server/public/assets/ordinal-D6D6WcTC.js.br +0 -0
- package/payload/server/public/assets/ordinal-D6D6WcTC.js.gz +0 -0
- package/payload/server/public/assets/packet-4T2RLAQJ-CCQdbIqO.js +1 -0
- package/payload/server/public/assets/packet-4T2RLAQJ-CCQdbIqO.js.br +0 -0
- package/payload/server/public/assets/{page-Ccl0FazM.js → page-Cci_j_y7.js} +3 -3
- package/payload/server/public/assets/page-Cci_j_y7.js.br +0 -0
- package/payload/server/public/assets/page-Cci_j_y7.js.gz +0 -0
- package/payload/server/public/assets/page-shuh4ES9.js +1 -0
- package/payload/server/public/assets/page-shuh4ES9.js.br +0 -0
- package/payload/server/public/assets/page-shuh4ES9.js.gz +0 -0
- package/payload/server/public/assets/{pdf-render-C257cidb.js → pdf-render-BSgBp8Fr.js} +1 -1
- package/payload/server/public/assets/pdf-render-BSgBp8Fr.js.br +0 -0
- package/payload/server/public/assets/pdf-render-BSgBp8Fr.js.gz +0 -0
- package/payload/server/public/assets/pie-ZZUOXDRM-Bdw3Iqs7.js +1 -0
- package/payload/server/public/assets/pie-ZZUOXDRM-Bdw3Iqs7.js.br +0 -0
- package/payload/server/public/assets/{pieDiagram-DEJITSTG-BzdNzoKA.js → pieDiagram-DEJITSTG-as0e_DSH.js} +1 -1
- package/payload/server/public/assets/pieDiagram-DEJITSTG-as0e_DSH.js.br +0 -0
- package/payload/server/public/assets/pieDiagram-DEJITSTG-as0e_DSH.js.gz +0 -0
- package/payload/server/public/assets/{public-BpC6cn9S.js → public-BbJcQGsO.js} +1 -1
- package/payload/server/public/assets/public-BbJcQGsO.js.br +0 -0
- package/payload/server/public/assets/public-BbJcQGsO.js.gz +0 -0
- package/payload/server/public/assets/{quadrantDiagram-34T5L4WZ-oFr1MJRO.js → quadrantDiagram-34T5L4WZ-B4t8HO9J.js} +1 -1
- package/payload/server/public/assets/quadrantDiagram-34T5L4WZ-B4t8HO9J.js.br +0 -0
- package/payload/server/public/assets/quadrantDiagram-34T5L4WZ-B4t8HO9J.js.gz +0 -0
- package/payload/server/public/assets/radar-PYXPWWZC-D3FUdA3r.js +1 -0
- package/payload/server/public/assets/radar-PYXPWWZC-D3FUdA3r.js.br +0 -0
- package/payload/server/public/assets/{reduce-BGpN5lgn.js → reduce-BtXXK8Ma.js} +1 -1
- package/payload/server/public/assets/reduce-BtXXK8Ma.js.br +0 -0
- package/payload/server/public/assets/reduce-BtXXK8Ma.js.gz +0 -0
- package/payload/server/public/assets/{requirementDiagram-MS252O5E-C9QBQxDh.js → requirementDiagram-MS252O5E-yxh30zHX.js} +1 -1
- package/payload/server/public/assets/requirementDiagram-MS252O5E-yxh30zHX.js.br +0 -0
- package/payload/server/public/assets/requirementDiagram-MS252O5E-yxh30zHX.js.gz +0 -0
- package/payload/server/public/assets/{rotate-ccw-BNcqbHkZ.js → rotate-ccw-jeSVwUAv.js} +1 -1
- package/payload/server/public/assets/rotate-ccw-jeSVwUAv.js.br +0 -0
- package/payload/server/public/assets/rotate-ccw-jeSVwUAv.js.gz +0 -0
- package/payload/server/public/assets/routines-D3M1Wh3a.js +1 -0
- package/payload/server/public/assets/routines-D3M1Wh3a.js.br +0 -0
- package/payload/server/public/assets/routines-D3M1Wh3a.js.gz +0 -0
- package/payload/server/public/assets/{sankeyDiagram-XADWPNL6-c_y3bvVv.js → sankeyDiagram-XADWPNL6-j-k9Wfty.js} +1 -1
- package/payload/server/public/assets/sankeyDiagram-XADWPNL6-j-k9Wfty.js.br +0 -0
- package/payload/server/public/assets/sankeyDiagram-XADWPNL6-j-k9Wfty.js.gz +0 -0
- package/payload/server/public/assets/{sequenceDiagram-FGHM5R23-YwlCBPHE.js → sequenceDiagram-FGHM5R23-DGLgcLhC.js} +1 -1
- package/payload/server/public/assets/sequenceDiagram-FGHM5R23-DGLgcLhC.js.br +0 -0
- package/payload/server/public/assets/sequenceDiagram-FGHM5R23-DGLgcLhC.js.gz +0 -0
- package/payload/server/public/assets/{skills-COLAw_jt.js → skills-Bhej2ub1.js} +1 -1
- package/payload/server/public/assets/skills-Bhej2ub1.js.br +0 -0
- package/payload/server/public/assets/skills-Bhej2ub1.js.gz +0 -0
- package/payload/server/public/assets/{stateDiagram-FHFEXIEX-BFE3e-FM.js → stateDiagram-FHFEXIEX-C9p1OUMI.js} +1 -1
- package/payload/server/public/assets/stateDiagram-FHFEXIEX-C9p1OUMI.js.br +0 -0
- package/payload/server/public/assets/stateDiagram-FHFEXIEX-C9p1OUMI.js.gz +0 -0
- package/payload/server/public/assets/stateDiagram-v2-QKLJ7IA2-Bf808Apk.js +1 -0
- package/payload/server/public/assets/stateDiagram-v2-QKLJ7IA2-Bf808Apk.js.br +0 -0
- package/payload/server/public/assets/stateDiagram-v2-QKLJ7IA2-Bf808Apk.js.gz +0 -0
- package/payload/server/public/assets/{tasks-CZDQI4nB.js → tasks-qY-dtOI2.js} +1 -1
- package/payload/server/public/assets/tasks-qY-dtOI2.js.br +0 -0
- package/payload/server/public/assets/tasks-qY-dtOI2.js.gz +0 -0
- package/payload/server/public/assets/{time-entry-format-laTFzawg.js → time-entry-format-r5UY9rjG.js} +1 -1
- package/payload/server/public/assets/time-entry-format-r5UY9rjG.js.br +0 -0
- package/payload/server/public/assets/time-entry-format-r5UY9rjG.js.gz +0 -0
- package/payload/server/public/assets/{timeline-definition-GMOUNBTQ-azqhmRwZ.js → timeline-definition-GMOUNBTQ-B1g7pgkH.js} +1 -1
- package/payload/server/public/assets/timeline-definition-GMOUNBTQ-B1g7pgkH.js.br +0 -0
- package/payload/server/public/assets/timeline-definition-GMOUNBTQ-B1g7pgkH.js.gz +0 -0
- package/payload/server/public/assets/treeView-SZITEDCU-DetKw0D0.js +1 -0
- package/payload/server/public/assets/treeView-SZITEDCU-DetKw0D0.js.br +0 -0
- package/payload/server/public/assets/treemap-W4RFUUIX-zQkIANxW.js +1 -0
- package/payload/server/public/assets/treemap-W4RFUUIX-zQkIANxW.js.br +0 -0
- package/payload/server/public/assets/{triangle-alert-DrwqhEog.js → triangle-alert--PCKaewD.js} +1 -1
- package/payload/server/public/assets/triangle-alert--PCKaewD.js.br +2 -0
- package/payload/server/public/assets/triangle-alert--PCKaewD.js.gz +0 -0
- package/payload/server/public/assets/{useCopyFeedback-Cxme5GK6.js → useCopyFeedback-Dg5lNgqH.js} +1 -1
- package/payload/server/public/assets/useCopyFeedback-Dg5lNgqH.js.br +0 -0
- package/payload/server/public/assets/useCopyFeedback-Dg5lNgqH.js.gz +0 -0
- package/payload/server/public/assets/useSubAccountSwitcher-BYfe9vj8.css +1 -0
- package/payload/server/public/assets/useSubAccountSwitcher-BYfe9vj8.css.br +0 -0
- package/payload/server/public/assets/useSubAccountSwitcher-BYfe9vj8.css.gz +0 -0
- package/payload/server/public/assets/{useVoiceRecorder-DUBpVa2T.js → useVoiceRecorder-BY6ZsGMH.js} +2 -2
- package/payload/server/public/assets/useVoiceRecorder-BY6ZsGMH.js.br +0 -0
- package/payload/server/public/assets/useVoiceRecorder-BY6ZsGMH.js.gz +0 -0
- package/payload/server/public/assets/{vennDiagram-DHZGUBPP-Da2RfFs8.js → vennDiagram-DHZGUBPP-D2ZjFfh4.js} +1 -1
- package/payload/server/public/assets/vennDiagram-DHZGUBPP-D2ZjFfh4.js.br +0 -0
- package/payload/server/public/assets/vennDiagram-DHZGUBPP-D2ZjFfh4.js.gz +0 -0
- package/payload/server/public/assets/wardley-RL74JXVD-DkQV3DvB.js +1 -0
- package/payload/server/public/assets/wardley-RL74JXVD-DkQV3DvB.js.br +0 -0
- package/payload/server/public/assets/{wardleyDiagram-NUSXRM2D-HdrdBYES.js → wardleyDiagram-NUSXRM2D-BFAhfkD8.js} +1 -1
- package/payload/server/public/assets/wardleyDiagram-NUSXRM2D-BFAhfkD8.js.br +0 -0
- package/payload/server/public/assets/wardleyDiagram-NUSXRM2D-BFAhfkD8.js.gz +0 -0
- package/payload/server/public/assets/{wrench-DWuxPnzF.js → wrench-Bw1FMolk.js} +1 -1
- package/payload/server/public/assets/wrench-Bw1FMolk.js.br +0 -0
- package/payload/server/public/assets/wrench-Bw1FMolk.js.gz +0 -0
- package/payload/server/public/assets/{xychartDiagram-5P7HB3ND-DMk6rTcQ.js → xychartDiagram-5P7HB3ND-Dt94h2RQ.js} +1 -1
- package/payload/server/public/assets/xychartDiagram-5P7HB3ND-Dt94h2RQ.js.br +0 -0
- package/payload/server/public/assets/xychartDiagram-5P7HB3ND-Dt94h2RQ.js.gz +0 -0
- package/payload/server/public/brand-defaults.css +1 -0
- package/payload/server/public/browser.html +4 -4
- package/payload/server/public/calendar.html +7 -7
- package/payload/server/public/chat.html +14 -14
- package/payload/server/public/data.html +13 -12
- package/payload/server/public/graph.html +9 -9
- package/payload/server/public/index.html +16 -15
- package/payload/server/public/operator.html +15 -15
- package/payload/server/public/public.html +14 -14
- package/payload/server/public/routines.html +7 -6
- package/payload/server/public/skills.html +5 -5
- package/payload/server/public/tasks.html +6 -6
- package/payload/server/server.js +744 -425
- package/payload/server/public/assets/AdminLoginScreens-uknqh2Pm.js.br +0 -0
- package/payload/server/public/assets/AdminLoginScreens-uknqh2Pm.js.gz +0 -0
- package/payload/server/public/assets/AdminShell-GqtMImyQ.js.br +0 -0
- package/payload/server/public/assets/AdminShell-GqtMImyQ.js.gz +0 -0
- package/payload/server/public/assets/activity-B4KfMJqO.js.br +0 -0
- package/payload/server/public/assets/activity-B4KfMJqO.js.gz +0 -0
- package/payload/server/public/assets/admin-DxCZeVw0.js +0 -1
- package/payload/server/public/assets/admin-DxCZeVw0.js.br +0 -0
- package/payload/server/public/assets/admin-DxCZeVw0.js.gz +0 -0
- package/payload/server/public/assets/agents-BtwBuO4G.js +0 -1
- package/payload/server/public/assets/agents-BtwBuO4G.js.br +0 -0
- package/payload/server/public/assets/agents-BtwBuO4G.js.gz +0 -0
- package/payload/server/public/assets/arc-DaI5MLTq.js.br +0 -0
- package/payload/server/public/assets/arc-DaI5MLTq.js.gz +0 -0
- package/payload/server/public/assets/architecture-YZFGNWBL-DWZIX5aV.js +0 -1
- package/payload/server/public/assets/architecture-YZFGNWBL-DWZIX5aV.js.br +0 -0
- package/payload/server/public/assets/architectureDiagram-Q4EWVU46-CBGVUEN9.js.br +0 -0
- package/payload/server/public/assets/architectureDiagram-Q4EWVU46-CBGVUEN9.js.gz +0 -0
- package/payload/server/public/assets/blockDiagram-DXYQGD6D-DS6dS4GZ.js.br +0 -0
- package/payload/server/public/assets/blockDiagram-DXYQGD6D-DS6dS4GZ.js.gz +0 -0
- package/payload/server/public/assets/browser-B3hSzI3O.js.br +0 -0
- package/payload/server/public/assets/browser-B3hSzI3O.js.gz +0 -0
- package/payload/server/public/assets/c4Diagram-AHTNJAMY-hBSBUZPt.js.br +0 -0
- package/payload/server/public/assets/calendar-BggxXxhS.js.br +0 -0
- package/payload/server/public/assets/calendar-BggxXxhS.js.gz +0 -0
- package/payload/server/public/assets/channel-BEokjAeE.js +0 -1
- package/payload/server/public/assets/channel-BEokjAeE.js.br +0 -0
- package/payload/server/public/assets/chat-flivHt0t.js +0 -1
- package/payload/server/public/assets/chat-flivHt0t.js.br +0 -0
- package/payload/server/public/assets/chat-flivHt0t.js.gz +0 -0
- package/payload/server/public/assets/chevron-left-nVRThX7f.js +0 -1
- package/payload/server/public/assets/chevron-right-CLqfrkRA.js +0 -1
- package/payload/server/public/assets/chevron-right-CLqfrkRA.js.br +0 -0
- package/payload/server/public/assets/chunk-2KRD3SAO-B6koUoB7.js.br +0 -0
- package/payload/server/public/assets/chunk-2KRD3SAO-B6koUoB7.js.gz +0 -0
- package/payload/server/public/assets/chunk-336JU56O-BF6BRh8u.js.br +0 -0
- package/payload/server/public/assets/chunk-336JU56O-BF6BRh8u.js.gz +0 -0
- package/payload/server/public/assets/chunk-426QAEUC-pbQ4PWBU.js +0 -1
- package/payload/server/public/assets/chunk-426QAEUC-pbQ4PWBU.js.br +0 -0
- package/payload/server/public/assets/chunk-426QAEUC-pbQ4PWBU.js.gz +0 -0
- package/payload/server/public/assets/chunk-4BX2VUAB-7sO95xR2.js.br +0 -0
- package/payload/server/public/assets/chunk-4BX2VUAB-7sO95xR2.js.gz +0 -0
- package/payload/server/public/assets/chunk-4TB4RGXK-GCTndJYx.js.br +0 -0
- package/payload/server/public/assets/chunk-4TB4RGXK-GCTndJYx.js.gz +0 -0
- package/payload/server/public/assets/chunk-55IACEB6-ggIJf_TC.js.br +0 -0
- package/payload/server/public/assets/chunk-55IACEB6-ggIJf_TC.js.gz +0 -0
- package/payload/server/public/assets/chunk-5FUZZQ4R-DeGmkimt.js.br +0 -0
- package/payload/server/public/assets/chunk-5FUZZQ4R-DeGmkimt.js.gz +0 -0
- package/payload/server/public/assets/chunk-5PVQY5BW-aFIQKk_U.js.br +0 -0
- package/payload/server/public/assets/chunk-5PVQY5BW-aFIQKk_U.js.gz +0 -0
- package/payload/server/public/assets/chunk-67CJDMHE-LS8rUbii.js.br +0 -2
- package/payload/server/public/assets/chunk-67CJDMHE-LS8rUbii.js.gz +0 -0
- package/payload/server/public/assets/chunk-7N4EOEYR-JKOVngS0.js.br +0 -2
- package/payload/server/public/assets/chunk-7N4EOEYR-JKOVngS0.js.gz +0 -0
- package/payload/server/public/assets/chunk-AA7GKIK3-CoXnTVK6.js.br +0 -0
- package/payload/server/public/assets/chunk-AA7GKIK3-CoXnTVK6.js.gz +0 -0
- package/payload/server/public/assets/chunk-BSJP7CBP-CcsqObFg.js.br +0 -0
- package/payload/server/public/assets/chunk-BSJP7CBP-CcsqObFg.js.gz +0 -0
- package/payload/server/public/assets/chunk-CIAEETIT-CpsybR7q.js.br +0 -0
- package/payload/server/public/assets/chunk-CIAEETIT-CpsybR7q.js.gz +0 -0
- package/payload/server/public/assets/chunk-EDXVE4YY-BZ2I9PSq.js.br +0 -0
- package/payload/server/public/assets/chunk-EDXVE4YY-BZ2I9PSq.js.gz +0 -0
- package/payload/server/public/assets/chunk-ENJZ2VHE-DbTwt6OZ.js.br +0 -0
- package/payload/server/public/assets/chunk-ENJZ2VHE-DbTwt6OZ.js.gz +0 -0
- package/payload/server/public/assets/chunk-FMBD7UC4-D27VnSCa.js.br +0 -0
- package/payload/server/public/assets/chunk-FMBD7UC4-D27VnSCa.js.gz +0 -0
- package/payload/server/public/assets/chunk-FOC6F5B3-C0tU2UFl.js.br +0 -0
- package/payload/server/public/assets/chunk-FOC6F5B3-C0tU2UFl.js.gz +0 -0
- package/payload/server/public/assets/chunk-ICPOFSXX-UPPu2OIq.js.br +0 -0
- package/payload/server/public/assets/chunk-ICPOFSXX-UPPu2OIq.js.gz +0 -0
- package/payload/server/public/assets/chunk-K5T4RW27-DIKxqyYw.js.br +0 -0
- package/payload/server/public/assets/chunk-K5T4RW27-DIKxqyYw.js.gz +0 -0
- package/payload/server/public/assets/chunk-KGLVRYIC-CiL4YVLo.js.br +0 -0
- package/payload/server/public/assets/chunk-KGLVRYIC-CiL4YVLo.js.gz +0 -0
- package/payload/server/public/assets/chunk-LIHQZDEY-ejKezVlD.js.br +0 -0
- package/payload/server/public/assets/chunk-LIHQZDEY-ejKezVlD.js.gz +0 -0
- package/payload/server/public/assets/chunk-ORNJ4GCN-Cc0vqc-D.js.br +0 -0
- package/payload/server/public/assets/chunk-ORNJ4GCN-Cc0vqc-D.js.gz +0 -0
- package/payload/server/public/assets/chunk-OYMX7WX6-Drxn1qG0.js.br +0 -0
- package/payload/server/public/assets/chunk-OYMX7WX6-Drxn1qG0.js.gz +0 -0
- package/payload/server/public/assets/chunk-QZHKN3VN-Dhlh7Pkk.js +0 -1
- package/payload/server/public/assets/chunk-QZHKN3VN-Dhlh7Pkk.js.br +0 -0
- package/payload/server/public/assets/chunk-QZHKN3VN-Dhlh7Pkk.js.gz +0 -0
- package/payload/server/public/assets/chunk-U2HBQHQK-DnbQIkRP.js.br +0 -0
- package/payload/server/public/assets/chunk-U2HBQHQK-DnbQIkRP.js.gz +0 -0
- package/payload/server/public/assets/chunk-X2U36JSP-CauTSVWg.js.br +0 -0
- package/payload/server/public/assets/chunk-X2U36JSP-CauTSVWg.js.gz +0 -0
- package/payload/server/public/assets/chunk-XPW4576I-DZqqB9Zi.js.br +0 -0
- package/payload/server/public/assets/chunk-XPW4576I-DZqqB9Zi.js.gz +0 -0
- package/payload/server/public/assets/chunk-YZCP3GAM-BGHo4Li-.js.br +0 -0
- package/payload/server/public/assets/chunk-YZCP3GAM-BGHo4Li-.js.gz +0 -0
- package/payload/server/public/assets/chunk-ZZ45TVLE-DWGJKPd7.js.br +0 -0
- package/payload/server/public/assets/chunk-ZZ45TVLE-DWGJKPd7.js.gz +0 -0
- package/payload/server/public/assets/classDiagram-6PBFFD2Q-D2z_ZV1x.js +0 -1
- package/payload/server/public/assets/classDiagram-6PBFFD2Q-D2z_ZV1x.js.br +0 -0
- package/payload/server/public/assets/classDiagram-6PBFFD2Q-D2z_ZV1x.js.gz +0 -0
- package/payload/server/public/assets/classDiagram-v2-HSJHXN6E-BJwJoNEK.js +0 -1
- package/payload/server/public/assets/classDiagram-v2-HSJHXN6E-BJwJoNEK.js.br +0 -0
- package/payload/server/public/assets/classDiagram-v2-HSJHXN6E-BJwJoNEK.js.gz +0 -0
- package/payload/server/public/assets/clock-Dj3SRZKo.js +0 -1
- package/payload/server/public/assets/clock-Dj3SRZKo.js.br +0 -0
- package/payload/server/public/assets/clock-Dj3SRZKo.js.gz +0 -0
- package/payload/server/public/assets/clone-Bn7XXVhr.js +0 -1
- package/payload/server/public/assets/clone-Bn7XXVhr.js.br +0 -0
- package/payload/server/public/assets/cose-bilkent-S5V4N54A-D-95BzXL.js.br +0 -0
- package/payload/server/public/assets/cose-bilkent-S5V4N54A-D-95BzXL.js.gz +0 -0
- package/payload/server/public/assets/dagre-BZYNBHvT.js.br +0 -0
- package/payload/server/public/assets/dagre-BZYNBHvT.js.gz +0 -0
- package/payload/server/public/assets/dagre-KV5264BT-DyU4HQLQ.js.br +0 -0
- package/payload/server/public/assets/dagre-KV5264BT-DyU4HQLQ.js.gz +0 -0
- package/payload/server/public/assets/data-Ckjkne54.js +0 -1
- package/payload/server/public/assets/data-Ckjkne54.js.br +0 -3
- package/payload/server/public/assets/data-Ckjkne54.js.gz +0 -0
- package/payload/server/public/assets/diagram-5BDNPKRD-CCttJ9XA.js.br +0 -0
- package/payload/server/public/assets/diagram-5BDNPKRD-CCttJ9XA.js.gz +0 -0
- package/payload/server/public/assets/diagram-G4DWMVQ6-DvkpgSLO.js.br +0 -0
- package/payload/server/public/assets/diagram-G4DWMVQ6-DvkpgSLO.js.gz +0 -0
- package/payload/server/public/assets/diagram-MMDJMWI5-DHmW5Y9k.js.br +0 -0
- package/payload/server/public/assets/diagram-MMDJMWI5-DHmW5Y9k.js.gz +0 -0
- package/payload/server/public/assets/diagram-TYMM5635-C6T4hwzO.js.br +0 -0
- package/payload/server/public/assets/diagram-TYMM5635-C6T4hwzO.js.gz +0 -0
- package/payload/server/public/assets/erDiagram-SMLLAGMA-5v_o7s3T.js.br +0 -0
- package/payload/server/public/assets/erDiagram-SMLLAGMA-5v_o7s3T.js.gz +0 -0
- package/payload/server/public/assets/file-text-BKs9eyiw.js.br +0 -0
- package/payload/server/public/assets/file-text-BKs9eyiw.js.gz +0 -0
- package/payload/server/public/assets/flatten-BtIc9jX7.js.br +0 -0
- package/payload/server/public/assets/flatten-BtIc9jX7.js.gz +0 -0
- package/payload/server/public/assets/flowDiagram-DWJPFMVM-3UhCDsjt.js.br +0 -0
- package/payload/server/public/assets/flowDiagram-DWJPFMVM-3UhCDsjt.js.gz +0 -0
- package/payload/server/public/assets/ganttDiagram-T4ZO3ILL-F2zgHIIQ.js.br +0 -0
- package/payload/server/public/assets/ganttDiagram-T4ZO3ILL-F2zgHIIQ.js.gz +0 -0
- package/payload/server/public/assets/gitGraph-7Q5UKJZL-C-FvNTHZ.js +0 -1
- package/payload/server/public/assets/gitGraph-7Q5UKJZL-C-FvNTHZ.js.br +0 -0
- package/payload/server/public/assets/gitGraphDiagram-UUTBAWPF-oQc1N3dT.js.br +0 -0
- package/payload/server/public/assets/gitGraphDiagram-UUTBAWPF-oQc1N3dT.js.gz +0 -0
- package/payload/server/public/assets/graph-DTi71NaZ.js.br +0 -0
- package/payload/server/public/assets/graph-DTi71NaZ.js.gz +0 -0
- package/payload/server/public/assets/graph-labels-BT3S6e9H.js.br +0 -0
- package/payload/server/public/assets/graph-labels-BT3S6e9H.js.gz +0 -0
- package/payload/server/public/assets/graphlib-DY4-AT2Q.js.br +0 -0
- package/payload/server/public/assets/graphlib-DY4-AT2Q.js.gz +0 -0
- package/payload/server/public/assets/info-OMHHGYJF-BjLPgHAC.js +0 -1
- package/payload/server/public/assets/info-OMHHGYJF-BjLPgHAC.js.br +0 -0
- package/payload/server/public/assets/infoDiagram-42DDH7IO-CXNKLTui.js +0 -2
- package/payload/server/public/assets/infoDiagram-42DDH7IO-CXNKLTui.js.br +0 -0
- package/payload/server/public/assets/infoDiagram-42DDH7IO-CXNKLTui.js.gz +0 -0
- package/payload/server/public/assets/isEmpty-Bu4fZ8Kf.js.br +0 -0
- package/payload/server/public/assets/isEmpty-Bu4fZ8Kf.js.gz +0 -0
- package/payload/server/public/assets/ishikawaDiagram-UXIWVN3A-wJhSOkuw.js.br +0 -0
- package/payload/server/public/assets/ishikawaDiagram-UXIWVN3A-wJhSOkuw.js.gz +0 -0
- package/payload/server/public/assets/journeyDiagram-VCZTEJTY-DgadC6Pz.js.br +0 -0
- package/payload/server/public/assets/journeyDiagram-VCZTEJTY-DgadC6Pz.js.gz +0 -0
- package/payload/server/public/assets/kanban-definition-6JOO6SKY-Bs4nQqXI.js.br +0 -0
- package/payload/server/public/assets/kanban-definition-6JOO6SKY-Bs4nQqXI.js.gz +0 -0
- package/payload/server/public/assets/line-Bnmxy1hO.js.br +0 -0
- package/payload/server/public/assets/line-Bnmxy1hO.js.gz +0 -0
- package/payload/server/public/assets/linear-RvwZxFzh.js.br +0 -0
- package/payload/server/public/assets/linear-RvwZxFzh.js.gz +0 -0
- package/payload/server/public/assets/maximize-2-zC94tsxY.js.br +0 -0
- package/payload/server/public/assets/maximize-2-zC94tsxY.js.gz +0 -0
- package/payload/server/public/assets/mermaid-parser.core-DeNV8RtA.js.br +0 -0
- package/payload/server/public/assets/mermaid-parser.core-DeNV8RtA.js.gz +0 -0
- package/payload/server/public/assets/mermaid.core-BU9IiSCP.js.br +0 -0
- package/payload/server/public/assets/mermaid.core-BU9IiSCP.js.gz +0 -0
- package/payload/server/public/assets/mindmap-definition-QFDTVHPH-D1PMUxxm.js.br +0 -0
- package/payload/server/public/assets/mindmap-definition-QFDTVHPH-D1PMUxxm.js.gz +0 -0
- package/payload/server/public/assets/operator-BtWNEMh-.js.br +0 -0
- package/payload/server/public/assets/operator-BtWNEMh-.js.gz +0 -0
- package/payload/server/public/assets/ordinal-C2TEWKNu.js.br +0 -0
- package/payload/server/public/assets/ordinal-C2TEWKNu.js.gz +0 -0
- package/payload/server/public/assets/packet-4T2RLAQJ-BBAZASfb.js +0 -1
- package/payload/server/public/assets/packet-4T2RLAQJ-BBAZASfb.js.br +0 -0
- package/payload/server/public/assets/page-BFm91p0e.js +0 -1
- package/payload/server/public/assets/page-BFm91p0e.js.br +0 -0
- package/payload/server/public/assets/page-BFm91p0e.js.gz +0 -0
- package/payload/server/public/assets/page-Ccl0FazM.js.br +0 -0
- package/payload/server/public/assets/page-Ccl0FazM.js.gz +0 -0
- package/payload/server/public/assets/pdf-render-C257cidb.js.br +0 -0
- package/payload/server/public/assets/pdf-render-C257cidb.js.gz +0 -0
- package/payload/server/public/assets/pie-ZZUOXDRM-CCJUnMeG.js +0 -1
- package/payload/server/public/assets/pie-ZZUOXDRM-CCJUnMeG.js.br +0 -0
- package/payload/server/public/assets/pieDiagram-DEJITSTG-BzdNzoKA.js.br +0 -0
- package/payload/server/public/assets/pieDiagram-DEJITSTG-BzdNzoKA.js.gz +0 -0
- package/payload/server/public/assets/public-BpC6cn9S.js.br +0 -0
- package/payload/server/public/assets/public-BpC6cn9S.js.gz +0 -0
- package/payload/server/public/assets/quadrantDiagram-34T5L4WZ-oFr1MJRO.js.br +0 -0
- package/payload/server/public/assets/quadrantDiagram-34T5L4WZ-oFr1MJRO.js.gz +0 -0
- package/payload/server/public/assets/radar-PYXPWWZC-BsRU8Aep.js +0 -1
- package/payload/server/public/assets/radar-PYXPWWZC-BsRU8Aep.js.br +0 -0
- package/payload/server/public/assets/reduce-BGpN5lgn.js.br +0 -0
- package/payload/server/public/assets/reduce-BGpN5lgn.js.gz +0 -0
- package/payload/server/public/assets/requirementDiagram-MS252O5E-C9QBQxDh.js.br +0 -0
- package/payload/server/public/assets/requirementDiagram-MS252O5E-C9QBQxDh.js.gz +0 -0
- package/payload/server/public/assets/rotate-ccw-BNcqbHkZ.js.br +0 -0
- package/payload/server/public/assets/rotate-ccw-BNcqbHkZ.js.gz +0 -0
- package/payload/server/public/assets/routines-D5iia-XG.js +0 -1
- package/payload/server/public/assets/routines-D5iia-XG.js.br +0 -0
- package/payload/server/public/assets/routines-D5iia-XG.js.gz +0 -0
- package/payload/server/public/assets/sankeyDiagram-XADWPNL6-c_y3bvVv.js.br +0 -0
- package/payload/server/public/assets/sankeyDiagram-XADWPNL6-c_y3bvVv.js.gz +0 -0
- package/payload/server/public/assets/sequenceDiagram-FGHM5R23-YwlCBPHE.js.br +0 -0
- package/payload/server/public/assets/sequenceDiagram-FGHM5R23-YwlCBPHE.js.gz +0 -0
- package/payload/server/public/assets/skills-COLAw_jt.js.br +0 -0
- package/payload/server/public/assets/skills-COLAw_jt.js.gz +0 -0
- package/payload/server/public/assets/stateDiagram-FHFEXIEX-BFE3e-FM.js.br +0 -0
- package/payload/server/public/assets/stateDiagram-FHFEXIEX-BFE3e-FM.js.gz +0 -0
- package/payload/server/public/assets/stateDiagram-v2-QKLJ7IA2-CpjB4ykI.js +0 -1
- package/payload/server/public/assets/stateDiagram-v2-QKLJ7IA2-CpjB4ykI.js.br +0 -4
- package/payload/server/public/assets/stateDiagram-v2-QKLJ7IA2-CpjB4ykI.js.gz +0 -0
- package/payload/server/public/assets/tasks-CZDQI4nB.js.br +0 -0
- package/payload/server/public/assets/tasks-CZDQI4nB.js.gz +0 -0
- package/payload/server/public/assets/time-entry-format-laTFzawg.js.br +0 -0
- package/payload/server/public/assets/time-entry-format-laTFzawg.js.gz +0 -0
- package/payload/server/public/assets/timeline-definition-GMOUNBTQ-azqhmRwZ.js.br +0 -0
- package/payload/server/public/assets/timeline-definition-GMOUNBTQ-azqhmRwZ.js.gz +0 -0
- package/payload/server/public/assets/treeView-SZITEDCU-BDzhKA6v.js +0 -1
- package/payload/server/public/assets/treeView-SZITEDCU-BDzhKA6v.js.br +0 -0
- package/payload/server/public/assets/treemap-W4RFUUIX-epHpdeWa.js +0 -1
- package/payload/server/public/assets/treemap-W4RFUUIX-epHpdeWa.js.br +0 -0
- package/payload/server/public/assets/triangle-alert-DrwqhEog.js.br +0 -0
- package/payload/server/public/assets/triangle-alert-DrwqhEog.js.gz +0 -0
- package/payload/server/public/assets/useCopyFeedback-Cxme5GK6.js.br +0 -0
- package/payload/server/public/assets/useCopyFeedback-Cxme5GK6.js.gz +0 -0
- package/payload/server/public/assets/useSubAccountSwitcher-B-K8y5a4.css +0 -1
- package/payload/server/public/assets/useSubAccountSwitcher-B-K8y5a4.css.br +0 -0
- package/payload/server/public/assets/useSubAccountSwitcher-B-K8y5a4.css.gz +0 -0
- package/payload/server/public/assets/useVoiceRecorder-DUBpVa2T.js.br +0 -0
- package/payload/server/public/assets/useVoiceRecorder-DUBpVa2T.js.gz +0 -0
- package/payload/server/public/assets/vennDiagram-DHZGUBPP-Da2RfFs8.js.br +0 -0
- package/payload/server/public/assets/vennDiagram-DHZGUBPP-Da2RfFs8.js.gz +0 -0
- package/payload/server/public/assets/wardley-RL74JXVD-DNSZCrxV.js +0 -1
- package/payload/server/public/assets/wardley-RL74JXVD-DNSZCrxV.js.br +0 -0
- package/payload/server/public/assets/wardleyDiagram-NUSXRM2D-HdrdBYES.js.br +0 -0
- package/payload/server/public/assets/wardleyDiagram-NUSXRM2D-HdrdBYES.js.gz +0 -0
- package/payload/server/public/assets/wrench-DWuxPnzF.js.br +0 -0
- package/payload/server/public/assets/wrench-DWuxPnzF.js.gz +0 -0
- package/payload/server/public/assets/xychartDiagram-5P7HB3ND-DMk6rTcQ.js.br +0 -0
- package/payload/server/public/assets/xychartDiagram-5P7HB3ND-DMk6rTcQ.js.gz +0 -0
- /package/payload/server/public/assets/{_baseFor-Be3EKK3K.js → _baseFor-B12He5Rp.js} +0 -0
- /package/payload/server/public/assets/{_baseFor-Be3EKK3K.js.br → _baseFor-B12He5Rp.js.br} +0 -0
- /package/payload/server/public/assets/{_baseFor-Be3EKK3K.js.gz → _baseFor-B12He5Rp.js.gz} +0 -0
- /package/payload/server/public/assets/{array-X0JlPOfd.js → array-DO1uCttT.js} +0 -0
- /package/payload/server/public/assets/{array-X0JlPOfd.js.br → array-DO1uCttT.js.br} +0 -0
- /package/payload/server/public/assets/{cytoscape.esm-CI2IWMLB.js → cytoscape.esm-DFn2foqy.js} +0 -0
- /package/payload/server/public/assets/{cytoscape.esm-CI2IWMLB.js.br → cytoscape.esm-DFn2foqy.js.br} +0 -0
- /package/payload/server/public/assets/{cytoscape.esm-CI2IWMLB.js.gz → cytoscape.esm-DFn2foqy.js.gz} +0 -0
- /package/payload/server/public/assets/{defaultLocale-B6RGN4id.js → defaultLocale-ieI3yFoA.js} +0 -0
- /package/payload/server/public/assets/{defaultLocale-B6RGN4id.js.br → defaultLocale-ieI3yFoA.js.br} +0 -0
- /package/payload/server/public/assets/{defaultLocale-B6RGN4id.js.gz → defaultLocale-ieI3yFoA.js.gz} +0 -0
- /package/payload/server/public/assets/{dist-QvbmK1IP.js → dist-DlU7AEeD.js} +0 -0
- /package/payload/server/public/assets/{dist-QvbmK1IP.js.br → dist-DlU7AEeD.js.br} +0 -0
- /package/payload/server/public/assets/{dist-QvbmK1IP.js.gz → dist-DlU7AEeD.js.gz} +0 -0
- /package/payload/server/public/assets/{init-BmUWJJHz.js → init-BCRlEgNP.js} +0 -0
- /package/payload/server/public/assets/{init-BmUWJJHz.js.br → init-BCRlEgNP.js.br} +0 -0
- /package/payload/server/public/assets/{init-BmUWJJHz.js.gz → init-BCRlEgNP.js.gz} +0 -0
- /package/payload/server/public/assets/{katex-BjZuzSQn.js → katex-gkTaZgi6.js} +0 -0
- /package/payload/server/public/assets/{katex-BjZuzSQn.js.br → katex-gkTaZgi6.js.br} +0 -0
- /package/payload/server/public/assets/{katex-BjZuzSQn.js.gz → katex-gkTaZgi6.js.gz} +0 -0
- /package/payload/server/public/assets/{path-CoPyR7c2.js → path-DTmzQFjQ.js} +0 -0
- /package/payload/server/public/assets/{path-CoPyR7c2.js.br → path-DTmzQFjQ.js.br} +0 -0
- /package/payload/server/public/assets/{path-CoPyR7c2.js.gz → path-DTmzQFjQ.js.gz} +0 -0
- /package/payload/server/public/assets/{preload-helper-BQrMkyGX.js → preload-helper-eAV8hweq.js} +0 -0
- /package/payload/server/public/assets/{preload-helper-BQrMkyGX.js.br → preload-helper-eAV8hweq.js.br} +0 -0
- /package/payload/server/public/assets/{preload-helper-BQrMkyGX.js.gz → preload-helper-eAV8hweq.js.gz} +0 -0
- /package/payload/server/public/assets/{rough.esm-jSt7UMyi.js → rough.esm-BFJ-MgcB.js} +0 -0
- /package/payload/server/public/assets/{rough.esm-jSt7UMyi.js.br → rough.esm-BFJ-MgcB.js.br} +0 -0
- /package/payload/server/public/assets/{rough.esm-jSt7UMyi.js.gz → rough.esm-BFJ-MgcB.js.gz} +0 -0
- /package/payload/server/public/assets/{src-C2WwTWSY.js → src-9CNk4JU0.js} +0 -0
- /package/payload/server/public/assets/{src-C2WwTWSY.js.br → src-9CNk4JU0.js.br} +0 -0
- /package/payload/server/public/assets/{src-C2WwTWSY.js.gz → src-9CNk4JU0.js.gz} +0 -0
- /package/payload/server/public/assets/{useSubAccountSwitcher-C_1E11Dv.js → useSubAccountSwitcher-CnpeWIYq.js} +0 -0
- /package/payload/server/public/assets/{useSubAccountSwitcher-C_1E11Dv.js.br → useSubAccountSwitcher-CnpeWIYq.js.br} +0 -0
- /package/payload/server/public/assets/{useSubAccountSwitcher-C_1E11Dv.js.gz → useSubAccountSwitcher-CnpeWIYq.js.gz} +0 -0
package/payload/server/server.js
CHANGED
|
@@ -1798,10 +1798,10 @@ var require_dist5 = __commonJS({
|
|
|
1798
1798
|
});
|
|
1799
1799
|
|
|
1800
1800
|
// server/index.ts
|
|
1801
|
-
import { readFileSync as
|
|
1801
|
+
import { readFileSync as readFileSync45, existsSync as existsSync48, watchFile, readdirSync as readdirSync28, statSync as statSync25 } from "fs";
|
|
1802
1802
|
import { spawn as spawn3 } from "child_process";
|
|
1803
1803
|
import { createHash as createHash7 } from "crypto";
|
|
1804
|
-
import { resolve as
|
|
1804
|
+
import { resolve as resolve43, join as join52, basename as basename16 } from "path";
|
|
1805
1805
|
import { homedir as homedir4 } from "os";
|
|
1806
1806
|
|
|
1807
1807
|
// server/lib/route-cache-watchers.ts
|
|
@@ -2367,11 +2367,11 @@ function staticCacheHeaders(root) {
|
|
|
2367
2367
|
}
|
|
2368
2368
|
|
|
2369
2369
|
// server/lib/static-mounts.ts
|
|
2370
|
-
function mountStaticFiles(
|
|
2371
|
-
|
|
2372
|
-
|
|
2373
|
-
|
|
2374
|
-
|
|
2370
|
+
function mountStaticFiles(app76, root) {
|
|
2371
|
+
app76.use("/*", staticCacheHeaders(root));
|
|
2372
|
+
app76.use("/assets/*", assetsVary);
|
|
2373
|
+
app76.use("/assets/*", serveStatic({ root, precompressed: true }));
|
|
2374
|
+
app76.use("/*", serveStatic({ root }));
|
|
2375
2375
|
}
|
|
2376
2376
|
var assetsVary = async (c, next) => {
|
|
2377
2377
|
await next();
|
|
@@ -3308,20 +3308,20 @@ function buildX11Env(chromiumWrapperPath, transport = "vnc") {
|
|
|
3308
3308
|
|
|
3309
3309
|
// server/routes/health.ts
|
|
3310
3310
|
function checkPort(port2, timeoutMs = 500) {
|
|
3311
|
-
return new Promise((
|
|
3311
|
+
return new Promise((resolve44) => {
|
|
3312
3312
|
const socket = createConnection2(port2, "127.0.0.1");
|
|
3313
3313
|
socket.setTimeout(timeoutMs);
|
|
3314
3314
|
socket.once("connect", () => {
|
|
3315
3315
|
socket.destroy();
|
|
3316
|
-
|
|
3316
|
+
resolve44(true);
|
|
3317
3317
|
});
|
|
3318
3318
|
socket.once("error", () => {
|
|
3319
3319
|
socket.destroy();
|
|
3320
|
-
|
|
3320
|
+
resolve44(false);
|
|
3321
3321
|
});
|
|
3322
3322
|
socket.once("timeout", () => {
|
|
3323
3323
|
socket.destroy();
|
|
3324
|
-
|
|
3324
|
+
resolve44(false);
|
|
3325
3325
|
});
|
|
3326
3326
|
});
|
|
3327
3327
|
}
|
|
@@ -3582,8 +3582,8 @@ function webchatTurnTimeoutMs() {
|
|
|
3582
3582
|
return Number(process.env.WEBCHAT_TURN_TIMEOUT_MS ?? String(2 * 6e4));
|
|
3583
3583
|
}
|
|
3584
3584
|
function createChatRoutes(deps) {
|
|
3585
|
-
const
|
|
3586
|
-
|
|
3585
|
+
const app76 = new Hono();
|
|
3586
|
+
app76.post("/", async (c) => {
|
|
3587
3587
|
console.log(`[chat-route] entered route=public method=POST`);
|
|
3588
3588
|
const contentType = c.req.header("content-type") ?? "";
|
|
3589
3589
|
const account = resolveAccount();
|
|
@@ -3855,7 +3855,7 @@ ${result.result.text}` : result.result.text;
|
|
|
3855
3855
|
}
|
|
3856
3856
|
});
|
|
3857
3857
|
});
|
|
3858
|
-
return
|
|
3858
|
+
return app76;
|
|
3859
3859
|
}
|
|
3860
3860
|
|
|
3861
3861
|
// server/routes/channel/schedule-inject.ts
|
|
@@ -4799,8 +4799,8 @@ function transcriptBoundary(sessionKey) {
|
|
|
4799
4799
|
}
|
|
4800
4800
|
}
|
|
4801
4801
|
function createScheduleInjectRoutes(deps) {
|
|
4802
|
-
const
|
|
4803
|
-
|
|
4802
|
+
const app76 = new Hono();
|
|
4803
|
+
app76.post("/", async (c) => {
|
|
4804
4804
|
const env = c.env;
|
|
4805
4805
|
const remoteAddr = env?.incoming?.socket?.remoteAddress ?? "";
|
|
4806
4806
|
if (!isLoopbackAddr(remoteAddr)) {
|
|
@@ -4902,7 +4902,7 @@ function createScheduleInjectRoutes(deps) {
|
|
|
4902
4902
|
console.error(`${TAG5} op=inject-spawn eventId=${eventId} sessionId=${sessionId} result=ok status=-`);
|
|
4903
4903
|
return c.json({ ok: true, sessionKey: sessionId, ...transcriptBoundary(sessionId) }, 200);
|
|
4904
4904
|
});
|
|
4905
|
-
return
|
|
4905
|
+
return app76;
|
|
4906
4906
|
}
|
|
4907
4907
|
|
|
4908
4908
|
// server/index.ts
|
|
@@ -5012,7 +5012,7 @@ async function defaultResolve(accountId) {
|
|
|
5012
5012
|
return resolveSocket2(accountId);
|
|
5013
5013
|
}
|
|
5014
5014
|
async function fetchAvatar(accountId, jid, deps = {}) {
|
|
5015
|
-
const
|
|
5015
|
+
const resolve44 = deps.resolve;
|
|
5016
5016
|
const httpGet = deps.httpGet ?? defaultHttpGet;
|
|
5017
5017
|
const maxAgeMs = deps.maxAgeMs ?? DEFAULT_MAX_AGE_MS;
|
|
5018
5018
|
const cached3 = readAvatar(accountId, jid);
|
|
@@ -5022,7 +5022,7 @@ async function fetchAvatar(accountId, jid, deps = {}) {
|
|
|
5022
5022
|
return "fresh";
|
|
5023
5023
|
}
|
|
5024
5024
|
console.log(`${TAG6} op=cache jid=${jid} hit=false ageMs=${ageMs2}`);
|
|
5025
|
-
const res =
|
|
5025
|
+
const res = resolve44 ? resolve44(accountId) : await defaultResolve(accountId);
|
|
5026
5026
|
if (!res.ok) {
|
|
5027
5027
|
console.log(`${TAG6} op=no-socket jid=${jid} account=${accountId.slice(0, 8)} reason=${res.reason}`);
|
|
5028
5028
|
return "no-socket";
|
|
@@ -5991,8 +5991,8 @@ async function startLogin(opts) {
|
|
|
5991
5991
|
await clearAuth(authDir);
|
|
5992
5992
|
let resolveCode = null;
|
|
5993
5993
|
let rejectCode = null;
|
|
5994
|
-
const codePromise = new Promise((
|
|
5995
|
-
resolveCode =
|
|
5994
|
+
const codePromise = new Promise((resolve44, reject) => {
|
|
5995
|
+
resolveCode = resolve44;
|
|
5996
5996
|
rejectCode = reject;
|
|
5997
5997
|
});
|
|
5998
5998
|
const codeTimer = setTimeout(
|
|
@@ -11430,8 +11430,8 @@ async function reapplyLeversViaManager() {
|
|
|
11430
11430
|
var WEBCHAT_SEND_TURN_WINDOW_MS = Number(process.env.WEBCHAT_SEND_TURN_WINDOW_MS ?? String(15e3));
|
|
11431
11431
|
var sendSeq = 0;
|
|
11432
11432
|
function createWebchatRoutes(deps) {
|
|
11433
|
-
const
|
|
11434
|
-
|
|
11433
|
+
const app76 = new Hono();
|
|
11434
|
+
app76.post("/send", requireAdminSession, async (c) => {
|
|
11435
11435
|
let accountId;
|
|
11436
11436
|
try {
|
|
11437
11437
|
accountId = resolvePlatformAccountId();
|
|
@@ -11629,7 +11629,7 @@ ${note}` : note;
|
|
|
11629
11629
|
if (turnTimer.unref) turnTimer.unref();
|
|
11630
11630
|
return c.json({ ok: true });
|
|
11631
11631
|
});
|
|
11632
|
-
|
|
11632
|
+
app76.post("/interrupt", requireAdminSession, async (c) => {
|
|
11633
11633
|
const cacheKey = c.get("cacheKey");
|
|
11634
11634
|
const requesterUserId = (cacheKey ? getUserIdForSession(cacheKey) : void 0) ?? null;
|
|
11635
11635
|
const primaryUserId = resolvePrimaryAdminUserId();
|
|
@@ -11657,7 +11657,7 @@ ${note}` : note;
|
|
|
11657
11657
|
}
|
|
11658
11658
|
return c.json({ ok: true, stopped: outcome.stopped, intId: outcome.intId, deadChild: outcome.deadChild }, 200);
|
|
11659
11659
|
});
|
|
11660
|
-
|
|
11660
|
+
app76.post("/settings", requireAdminSession, async (c) => {
|
|
11661
11661
|
const body = await c.req.json().catch(() => null);
|
|
11662
11662
|
const op = body?.op;
|
|
11663
11663
|
const value = body?.value;
|
|
@@ -11693,7 +11693,7 @@ ${note}` : note;
|
|
|
11693
11693
|
console.log(`[webchat:settings] op=${op} outcome=accepted accountId=${account.accountId.slice(0, 8)} value=${value} settingsApplied=${settingsApplied}`);
|
|
11694
11694
|
return c.json({ ok: true, settingsApplied });
|
|
11695
11695
|
});
|
|
11696
|
-
|
|
11696
|
+
app76.get("/session", requireAdminSession, async (c) => {
|
|
11697
11697
|
let accountId;
|
|
11698
11698
|
try {
|
|
11699
11699
|
accountId = resolvePlatformAccountId();
|
|
@@ -11766,7 +11766,7 @@ ${note}` : note;
|
|
|
11766
11766
|
const indicators = await fetchComposerIndicators(sessionId);
|
|
11767
11767
|
return c.json({ sessionId, projectDir, source, sizeBytes: jsonlSizeBytes(projectDir, sessionId), pendingPermissionPrompt: deps.pendingPromptFor?.(`session:${sessionId}`) ?? null, deliveryFailure: deps.deliveryFailureFor?.(`session:${sessionId}`) ?? null, ...indicators, ...readLevers(account) });
|
|
11768
11768
|
});
|
|
11769
|
-
|
|
11769
|
+
app76.post("/permission-verdict", requireAdminSession, async (c) => {
|
|
11770
11770
|
const body = await c.req.json().catch(() => null);
|
|
11771
11771
|
const sessionId = body?.sessionId;
|
|
11772
11772
|
const requestId = body?.request_id;
|
|
@@ -11783,7 +11783,7 @@ ${note}` : note;
|
|
|
11783
11783
|
const ok = deps.resolvePermissionVerdict?.(`session:${sessionId}`, requestId, behavior) ?? false;
|
|
11784
11784
|
return c.json({ ok });
|
|
11785
11785
|
});
|
|
11786
|
-
return
|
|
11786
|
+
return app76;
|
|
11787
11787
|
}
|
|
11788
11788
|
|
|
11789
11789
|
// server/routes/webchat-greeting.ts
|
|
@@ -13139,15 +13139,15 @@ function operatorRoleFor(config, userId) {
|
|
|
13139
13139
|
async function buildAccountOptionList(accounts, userId) {
|
|
13140
13140
|
const houseAccount = accounts.find((a) => a.config.role === "house");
|
|
13141
13141
|
console.log(`[admin-accounts] op=list count=${accounts.length} house=${houseAccount?.accountId ?? "none"}`);
|
|
13142
|
-
const
|
|
13142
|
+
const resolve44 = async (a) => {
|
|
13143
13143
|
const businessName = await fetchAccountName(a.accountId) || void 0;
|
|
13144
13144
|
return { accountId: a.accountId, businessName, role: operatorRoleFor(a.config, userId), isHouse: a.config.role === "house" };
|
|
13145
13145
|
};
|
|
13146
13146
|
const houseOptions = await Promise.all(
|
|
13147
|
-
accounts.filter((a) => a.config.role === "house").map(
|
|
13147
|
+
accounts.filter((a) => a.config.role === "house").map(resolve44)
|
|
13148
13148
|
);
|
|
13149
13149
|
const nonHouseOptions = await Promise.all(
|
|
13150
|
-
accounts.filter((a) => a.config.role !== "house").map(
|
|
13150
|
+
accounts.filter((a) => a.config.role !== "house").map(resolve44)
|
|
13151
13151
|
);
|
|
13152
13152
|
const sortKey = (o) => (o.businessName || o.accountId).toLowerCase();
|
|
13153
13153
|
nonHouseOptions.sort((x, y) => {
|
|
@@ -15902,18 +15902,18 @@ var ALLOWED_EVENTS = /* @__PURE__ */ new Set([
|
|
|
15902
15902
|
]);
|
|
15903
15903
|
var app24 = new Hono();
|
|
15904
15904
|
app24.post("/", async (c) => {
|
|
15905
|
-
const
|
|
15905
|
+
const TAG50 = "[admin:events]";
|
|
15906
15906
|
let body;
|
|
15907
15907
|
try {
|
|
15908
15908
|
body = await c.req.json();
|
|
15909
15909
|
} catch (err) {
|
|
15910
15910
|
const detail = err instanceof Error ? err.message : String(err);
|
|
15911
|
-
console.error(`${
|
|
15911
|
+
console.error(`${TAG50} reject reason=body-not-json detail=${detail}`);
|
|
15912
15912
|
return c.json({ ok: false, detail: "Request body was not valid JSON" }, 400);
|
|
15913
15913
|
}
|
|
15914
15914
|
const event = typeof body.event === "string" ? body.event : "";
|
|
15915
15915
|
if (!ALLOWED_EVENTS.has(event)) {
|
|
15916
|
-
console.error(`${
|
|
15916
|
+
console.error(`${TAG50} reject reason=event-not-allowed event=${JSON.stringify(event)}`);
|
|
15917
15917
|
return c.json({ ok: false, detail: `Event "${event}" is not allowed` }, 400);
|
|
15918
15918
|
}
|
|
15919
15919
|
const rawFields = body.fields && typeof body.fields === "object" ? body.fields : {};
|
|
@@ -22504,9 +22504,111 @@ var data_portal_default = app50;
|
|
|
22504
22504
|
// server/routes/admin/routines.ts
|
|
22505
22505
|
import cronParser from "cron-parser";
|
|
22506
22506
|
import { int as int2 } from "neo4j-driver";
|
|
22507
|
+
|
|
22508
|
+
// ../lib/agent-dispatch-rule/src/index.ts
|
|
22509
|
+
import { readFileSync as readFileSync36 } from "fs";
|
|
22510
|
+
import { resolve as resolve30 } from "path";
|
|
22511
|
+
function normalizeE1642(value) {
|
|
22512
|
+
let candidate = value.trim().replace(/[\s\-().]/g, "");
|
|
22513
|
+
candidate = candidate.replace(/^whatsapp:/i, "");
|
|
22514
|
+
if (candidate.startsWith("+")) candidate = candidate.slice(1);
|
|
22515
|
+
else if (candidate.startsWith("00")) candidate = candidate.slice(2);
|
|
22516
|
+
if (!/^\d+$/.test(candidate)) return "";
|
|
22517
|
+
return candidate;
|
|
22518
|
+
}
|
|
22519
|
+
function phonesMatch2(a, b) {
|
|
22520
|
+
const na = normalizeE1642(a);
|
|
22521
|
+
const nb = normalizeE1642(b);
|
|
22522
|
+
return na.length > 0 && na === nb;
|
|
22523
|
+
}
|
|
22524
|
+
function readChannelAdmins(accountDir, channel) {
|
|
22525
|
+
let config = {};
|
|
22526
|
+
try {
|
|
22527
|
+
config = JSON.parse(readFileSync36(resolve30(accountDir, "account.json"), "utf-8"));
|
|
22528
|
+
} catch {
|
|
22529
|
+
config = {};
|
|
22530
|
+
}
|
|
22531
|
+
if (channel === "whatsapp") {
|
|
22532
|
+
const wa = config.whatsapp ?? {};
|
|
22533
|
+
const adminPhones = Array.isArray(wa.adminPhones) ? wa.adminPhones.filter((p) => typeof p === "string") : [];
|
|
22534
|
+
const managersRaw = wa.accountManagers ?? {};
|
|
22535
|
+
const accountManagers = {};
|
|
22536
|
+
for (const [k, v] of Object.entries(managersRaw)) {
|
|
22537
|
+
if (typeof v === "string") accountManagers[k] = v;
|
|
22538
|
+
else if (v && typeof v === "object" && typeof v.managesAccount === "string") {
|
|
22539
|
+
const mode = v.mode;
|
|
22540
|
+
if (mode === void 0 || mode === "active") {
|
|
22541
|
+
accountManagers[k] = v.managesAccount;
|
|
22542
|
+
}
|
|
22543
|
+
}
|
|
22544
|
+
}
|
|
22545
|
+
return { adminPhones, accountManagers };
|
|
22546
|
+
}
|
|
22547
|
+
const tg = config.telegram ?? {};
|
|
22548
|
+
const adminUsers = Array.isArray(tg.adminUsers) ? tg.adminUsers.filter((u) => typeof u === "number") : [];
|
|
22549
|
+
return { adminUsers };
|
|
22550
|
+
}
|
|
22551
|
+
function registeredAccountForDestination(houseDir, houseAccountId, destination) {
|
|
22552
|
+
const { adminPhones, accountManagers } = readChannelAdmins(houseDir, "whatsapp");
|
|
22553
|
+
for (const [managerPhone, subAccountId] of Object.entries(accountManagers)) {
|
|
22554
|
+
if (subAccountId && phonesMatch2(managerPhone, destination)) return subAccountId;
|
|
22555
|
+
}
|
|
22556
|
+
if (adminPhones.some((p) => phonesMatch2(p, destination))) return houseAccountId;
|
|
22557
|
+
return null;
|
|
22558
|
+
}
|
|
22559
|
+
function validateAgentDestination(accountsDir, houseAccountId, creatingAccountId, channel, destination) {
|
|
22560
|
+
if (channel === "whatsapp") {
|
|
22561
|
+
const houseDir = resolve30(accountsDir, houseAccountId);
|
|
22562
|
+
const registered = registeredAccountForDestination(houseDir, houseAccountId, destination);
|
|
22563
|
+
if (registered === null) return { valid: false, reason: "not-registered" };
|
|
22564
|
+
if (creatingAccountId === houseAccountId) return { valid: true };
|
|
22565
|
+
if (registered === creatingAccountId) return { valid: true };
|
|
22566
|
+
return {
|
|
22567
|
+
valid: false,
|
|
22568
|
+
reason: "cross-account",
|
|
22569
|
+
destinationAccount: registered,
|
|
22570
|
+
scheduleAccount: creatingAccountId
|
|
22571
|
+
};
|
|
22572
|
+
}
|
|
22573
|
+
const { adminUsers } = readChannelAdmins(resolve30(accountsDir, creatingAccountId), "telegram");
|
|
22574
|
+
const asNumber = Number(destination);
|
|
22575
|
+
const ok = Number.isInteger(asNumber) && adminUsers.includes(asNumber);
|
|
22576
|
+
return ok ? { valid: true } : { valid: false, reason: "not-registered" };
|
|
22577
|
+
}
|
|
22578
|
+
function listDispatchDestinations(input) {
|
|
22579
|
+
const { accountsDir, houseAccountId, accountId } = input;
|
|
22580
|
+
const managers = [];
|
|
22581
|
+
const admins = [];
|
|
22582
|
+
if (houseAccountId !== null) {
|
|
22583
|
+
const houseDir = resolve30(accountsDir, houseAccountId);
|
|
22584
|
+
const { adminPhones, accountManagers } = readChannelAdmins(houseDir, "whatsapp");
|
|
22585
|
+
const seen = /* @__PURE__ */ new Set();
|
|
22586
|
+
for (const [phone, subAccountId] of Object.entries(accountManagers)) {
|
|
22587
|
+
const key = normalizeE1642(phone);
|
|
22588
|
+
if (key.length === 0 || seen.has(key)) continue;
|
|
22589
|
+
if (accountId !== houseAccountId && subAccountId !== accountId) continue;
|
|
22590
|
+
seen.add(key);
|
|
22591
|
+
managers.push({ channel: "whatsapp", destination: phone, label: "Account manager" });
|
|
22592
|
+
}
|
|
22593
|
+
for (const phone of adminPhones) {
|
|
22594
|
+
const key = normalizeE1642(phone);
|
|
22595
|
+
if (key.length === 0 || seen.has(key)) continue;
|
|
22596
|
+
if (accountId !== houseAccountId) continue;
|
|
22597
|
+
seen.add(key);
|
|
22598
|
+
admins.push({ channel: "whatsapp", destination: phone, label: "House admin" });
|
|
22599
|
+
}
|
|
22600
|
+
}
|
|
22601
|
+
const { adminUsers } = readChannelAdmins(resolve30(accountsDir, accountId), "telegram");
|
|
22602
|
+
const telegram = [...adminUsers].sort((a, b) => a - b).map((id) => ({ channel: "telegram", destination: String(id), label: "Telegram admin" }));
|
|
22603
|
+
const byDestination = (a, b) => a.destination.localeCompare(b.destination);
|
|
22604
|
+
return [...managers.sort(byDestination), ...admins.sort(byDestination), ...telegram];
|
|
22605
|
+
}
|
|
22606
|
+
|
|
22607
|
+
// server/routes/admin/routines.ts
|
|
22507
22608
|
var { parseExpression } = cronParser;
|
|
22508
22609
|
var app51 = new Hono();
|
|
22509
22610
|
var AUTOMATION_WHERE = "(e.recurrence IS NOT NULL OR e.agentChannel IS NOT NULL OR e.actionPlugin IS NOT NULL)";
|
|
22611
|
+
var DISPATCH_CHANNELS = /* @__PURE__ */ new Set(["whatsapp", "telegram"]);
|
|
22510
22612
|
var ROUTINE_COLS = `e.eventId AS eventId, e.name AS name, e.eventStatus AS eventStatus,
|
|
22511
22613
|
e.recurrence AS recurrence, e.nextRun AS nextRun, e.lastTriggered AS lastTriggered,
|
|
22512
22614
|
e.timezone AS timezone, e.startDate AS startDate,
|
|
@@ -22622,6 +22724,74 @@ function mapRun(props) {
|
|
|
22622
22724
|
error: props.error ?? null
|
|
22623
22725
|
};
|
|
22624
22726
|
}
|
|
22727
|
+
var RUN_CSV_COLUMNS = [
|
|
22728
|
+
"runId",
|
|
22729
|
+
"eventId",
|
|
22730
|
+
"kind",
|
|
22731
|
+
"mode",
|
|
22732
|
+
"status",
|
|
22733
|
+
"target",
|
|
22734
|
+
"scheduledFor",
|
|
22735
|
+
"startedAt",
|
|
22736
|
+
"endedAt",
|
|
22737
|
+
"finishedAt",
|
|
22738
|
+
"ranMs",
|
|
22739
|
+
"httpStatus",
|
|
22740
|
+
"dispatchResult",
|
|
22741
|
+
"sessionKey",
|
|
22742
|
+
"transcriptOffset",
|
|
22743
|
+
"bounded",
|
|
22744
|
+
"error"
|
|
22745
|
+
];
|
|
22746
|
+
function csvField(v) {
|
|
22747
|
+
if (v === null || v === void 0) return "";
|
|
22748
|
+
const s = String(v);
|
|
22749
|
+
return /["\r\n,]/.test(s) ? `"${s.replace(/"/g, '""')}"` : s;
|
|
22750
|
+
}
|
|
22751
|
+
function toCsv(rows) {
|
|
22752
|
+
const lines = [RUN_CSV_COLUMNS.join(",")];
|
|
22753
|
+
for (const row of rows) {
|
|
22754
|
+
lines.push(RUN_CSV_COLUMNS.map((k) => csvField(row[k])).join(","));
|
|
22755
|
+
}
|
|
22756
|
+
return lines.join("\r\n") + "\r\n";
|
|
22757
|
+
}
|
|
22758
|
+
function countCsvDataRows(csv) {
|
|
22759
|
+
let rows = 0;
|
|
22760
|
+
let inQuotes = false;
|
|
22761
|
+
let sawContent = false;
|
|
22762
|
+
for (let i = 0; i < csv.length; i++) {
|
|
22763
|
+
const ch = csv[i];
|
|
22764
|
+
if (inQuotes) {
|
|
22765
|
+
if (ch === '"') {
|
|
22766
|
+
if (csv[i + 1] === '"') i++;
|
|
22767
|
+
else inQuotes = false;
|
|
22768
|
+
}
|
|
22769
|
+
continue;
|
|
22770
|
+
}
|
|
22771
|
+
if (ch === '"') {
|
|
22772
|
+
inQuotes = true;
|
|
22773
|
+
sawContent = true;
|
|
22774
|
+
continue;
|
|
22775
|
+
}
|
|
22776
|
+
if (ch === "\n") {
|
|
22777
|
+
if (sawContent) rows++;
|
|
22778
|
+
sawContent = false;
|
|
22779
|
+
continue;
|
|
22780
|
+
}
|
|
22781
|
+
if (ch !== "\r") sawContent = true;
|
|
22782
|
+
}
|
|
22783
|
+
if (sawContent) rows++;
|
|
22784
|
+
return Math.max(rows - 1, 0);
|
|
22785
|
+
}
|
|
22786
|
+
function runsCsvGuard(csv, expected) {
|
|
22787
|
+
const emitted = countCsvDataRows(csv);
|
|
22788
|
+
return emitted === expected ? { ok: true } : { ok: false, emitted };
|
|
22789
|
+
}
|
|
22790
|
+
function runsCsvFilename(name, eventId, date) {
|
|
22791
|
+
const clean = (s) => s.toLowerCase().replace(/[^a-z0-9]+/g, "-").replace(/^-+|-+$/g, "");
|
|
22792
|
+
const slug = clean(name ?? "").slice(0, 48).replace(/-+$/, "");
|
|
22793
|
+
return `${slug || clean(eventId.slice(0, 8)) || "routine"}-runs-${date}.csv`;
|
|
22794
|
+
}
|
|
22625
22795
|
app51.get("/:eventId/runs", requireAdminSession, async (c) => {
|
|
22626
22796
|
const accountId = getAccountIdForSession(c.var.cacheKey);
|
|
22627
22797
|
if (!accountId) {
|
|
@@ -22652,6 +22822,53 @@ app51.get("/:eventId/runs", requireAdminSession, async (c) => {
|
|
|
22652
22822
|
await session.close();
|
|
22653
22823
|
}
|
|
22654
22824
|
});
|
|
22825
|
+
app51.get("/:eventId/runs.csv", requireAdminSession, async (c) => {
|
|
22826
|
+
const accountId = getAccountIdForSession(c.var.cacheKey);
|
|
22827
|
+
const eventId = c.req.param("eventId");
|
|
22828
|
+
if (!accountId) {
|
|
22829
|
+
console.error('[admin:routines] op=runs-export auth-rejected reason="no account for session"');
|
|
22830
|
+
return c.json({ error: "Account not found for session" }, 401);
|
|
22831
|
+
}
|
|
22832
|
+
const session = getSession();
|
|
22833
|
+
try {
|
|
22834
|
+
const res = await session.run(
|
|
22835
|
+
`MATCH (r:RoutineRun)-[:RUN_OF]->(e:Event {eventId: $eventId, accountId: $accountId})
|
|
22836
|
+
WHERE r.accountId = $accountId
|
|
22837
|
+
RETURN r, e.name AS name
|
|
22838
|
+
ORDER BY r.startedAt DESC`,
|
|
22839
|
+
{ eventId, accountId }
|
|
22840
|
+
);
|
|
22841
|
+
if (res.records.length === 0) {
|
|
22842
|
+
console.error(`[admin:routines] op=runs-export id=${eventId.slice(0, 8)} rows=0 bytes=0 outcome=not-found`);
|
|
22843
|
+
return c.json({ error: "No runs for this routine" }, 404);
|
|
22844
|
+
}
|
|
22845
|
+
const rows = res.records.map(
|
|
22846
|
+
(rec) => mapRun(rec.get("r").properties)
|
|
22847
|
+
);
|
|
22848
|
+
const name = res.records[0].get("name") ?? null;
|
|
22849
|
+
const csv = toCsv(rows);
|
|
22850
|
+
const bytes = Buffer.byteLength(csv, "utf-8");
|
|
22851
|
+
const guard = runsCsvGuard(csv, rows.length);
|
|
22852
|
+
if (!guard.ok) {
|
|
22853
|
+
console.error(
|
|
22854
|
+
`[admin:routines] op=runs-export id=${eventId.slice(0, 8)} rows=${guard.emitted} bytes=${bytes} outcome=mismatch expected=${rows.length}`
|
|
22855
|
+
);
|
|
22856
|
+
return c.json({ error: "Failed to produce a complete run history" }, 500);
|
|
22857
|
+
}
|
|
22858
|
+
const filename = runsCsvFilename(name, eventId, (/* @__PURE__ */ new Date()).toISOString().slice(0, 10));
|
|
22859
|
+
console.log(`[admin:routines] op=runs-export id=${eventId.slice(0, 8)} rows=${rows.length} bytes=${bytes} outcome=ok`);
|
|
22860
|
+
return c.body(csv, 200, {
|
|
22861
|
+
"content-type": "text/csv; charset=utf-8",
|
|
22862
|
+
"content-disposition": `attachment; filename="${filename}"`
|
|
22863
|
+
});
|
|
22864
|
+
} catch (err) {
|
|
22865
|
+
const message = err instanceof Error ? err.message : String(err);
|
|
22866
|
+
console.error(`[admin:routines] op=runs-export id=${eventId.slice(0, 8)} outcome=error err="${message}"`);
|
|
22867
|
+
return c.json({ error: `Run export failed: ${message}` }, 503);
|
|
22868
|
+
} finally {
|
|
22869
|
+
await session.close();
|
|
22870
|
+
}
|
|
22871
|
+
});
|
|
22655
22872
|
app51.get("/:eventId", requireAdminSession, async (c) => {
|
|
22656
22873
|
const accountId = getAccountIdForSession(c.var.cacheKey);
|
|
22657
22874
|
if (!accountId) return c.json({ error: "Account not found for session" }, 401);
|
|
@@ -22681,33 +22898,110 @@ app51.patch("/:eventId", requireAdminSession, async (c) => {
|
|
|
22681
22898
|
if (!accountId) return c.json({ error: "Account not found for session" }, 401);
|
|
22682
22899
|
const eventId = c.req.param("eventId");
|
|
22683
22900
|
const body = await c.req.json().catch(() => ({}));
|
|
22901
|
+
const id82 = eventId.slice(0, 8);
|
|
22684
22902
|
const setClauses = [];
|
|
22685
22903
|
const params = { eventId, accountId };
|
|
22686
22904
|
const fields = [];
|
|
22687
22905
|
let nextRunLog = "unchanged";
|
|
22688
|
-
|
|
22689
|
-
|
|
22690
|
-
|
|
22691
|
-
|
|
22692
|
-
|
|
22693
|
-
|
|
22694
|
-
|
|
22695
|
-
|
|
22696
|
-
|
|
22697
|
-
|
|
22906
|
+
let bindingLog = "";
|
|
22907
|
+
const hasChannel = "agentChannel" in body;
|
|
22908
|
+
const hasDestination = "agentDestination" in body;
|
|
22909
|
+
const bindingTouched = hasChannel || hasDestination;
|
|
22910
|
+
const clearing = bindingTouched && body.agentChannel === null && body.agentDestination === null;
|
|
22911
|
+
const binding = bindingTouched && typeof body.agentChannel === "string" && body.agentChannel.length > 0 && typeof body.agentDestination === "string" && body.agentDestination.length > 0;
|
|
22912
|
+
if (bindingTouched && !clearing && !binding) {
|
|
22913
|
+
console.error(`[admin:routines] op=patch id=${id82} fields=agentChannel+agentDestination outcome=rejected reason=partial-binding`);
|
|
22914
|
+
return c.json({ error: "A dispatch binding needs both a channel and a destination, or both cleared." }, 400);
|
|
22915
|
+
}
|
|
22916
|
+
if (binding && !DISPATCH_CHANNELS.has(body.agentChannel)) {
|
|
22917
|
+
console.error(`[admin:routines] op=patch id=${id82} fields=agentChannel+agentDestination outcome=rejected reason=invalid-channel channel=${body.agentChannel}`);
|
|
22918
|
+
return c.json({ error: `Unknown dispatch channel "${body.agentChannel}".` }, 400);
|
|
22919
|
+
}
|
|
22920
|
+
let timezone = null;
|
|
22921
|
+
let storedPrompt = null;
|
|
22922
|
+
let storedRecurrence = null;
|
|
22923
|
+
let storedActionPlugin = null;
|
|
22924
|
+
if (typeof body.recurrence === "string" || binding || clearing) {
|
|
22925
|
+
const preSession = getSession();
|
|
22698
22926
|
try {
|
|
22699
|
-
const
|
|
22700
|
-
`MATCH (e:Event {eventId: $eventId, accountId: $accountId})
|
|
22927
|
+
const pre = await preSession.run(
|
|
22928
|
+
`MATCH (e:Event {eventId: $eventId, accountId: $accountId})
|
|
22929
|
+
RETURN e.timezone AS timezone, e.agentPrompt AS agentPrompt,
|
|
22930
|
+
e.recurrence AS recurrence, e.actionPlugin AS actionPlugin`,
|
|
22701
22931
|
{ eventId, accountId }
|
|
22702
22932
|
);
|
|
22703
|
-
timezone =
|
|
22933
|
+
timezone = pre.records[0]?.get("timezone") ?? null;
|
|
22934
|
+
storedPrompt = pre.records[0]?.get("agentPrompt") ?? null;
|
|
22935
|
+
storedRecurrence = pre.records[0]?.get("recurrence") ?? null;
|
|
22936
|
+
storedActionPlugin = pre.records[0]?.get("actionPlugin") ?? null;
|
|
22704
22937
|
} catch (err) {
|
|
22705
22938
|
const message = err instanceof Error ? err.message : String(err);
|
|
22706
|
-
console.error(`[admin:routines] op=patch id=${
|
|
22939
|
+
console.error(`[admin:routines] op=patch id=${id82} outcome=rejected reason=tz-read-fail err="${message}"`);
|
|
22707
22940
|
return c.json({ error: `Routine unavailable: ${message}` }, 503);
|
|
22708
22941
|
} finally {
|
|
22709
|
-
await
|
|
22942
|
+
await preSession.close();
|
|
22943
|
+
}
|
|
22944
|
+
}
|
|
22945
|
+
if (binding) {
|
|
22946
|
+
if (storedActionPlugin !== null) {
|
|
22947
|
+
console.error(`[admin:routines] op=patch id=${id82} fields=agentChannel+agentDestination outcome=rejected reason=action-routine`);
|
|
22948
|
+
return c.json(
|
|
22949
|
+
{ error: "This routine runs a tool. Binding a dispatch would stop the tool running, so it is refused; make a separate routine for the dispatch." },
|
|
22950
|
+
400
|
|
22951
|
+
);
|
|
22952
|
+
}
|
|
22953
|
+
const effectivePrompt = typeof body.agentPrompt === "string" ? body.agentPrompt : storedPrompt ?? "";
|
|
22954
|
+
if (effectivePrompt.trim().length === 0) {
|
|
22955
|
+
console.error(`[admin:routines] op=patch id=${id82} fields=agentChannel+agentDestination outcome=rejected reason=no-prompt`);
|
|
22956
|
+
return c.json({ error: "A bound routine needs an instruction, or it will fire and do nothing." }, 400);
|
|
22957
|
+
}
|
|
22958
|
+
const channel = body.agentChannel;
|
|
22959
|
+
const destination = body.agentDestination;
|
|
22960
|
+
let houseAccountId;
|
|
22961
|
+
try {
|
|
22962
|
+
houseAccountId = channel === "whatsapp" ? resolveHouseOrSoleAccountId(ACCOUNTS_DIR) : accountId;
|
|
22963
|
+
} catch (err) {
|
|
22964
|
+
const message = err instanceof Error ? err.message : String(err);
|
|
22965
|
+
console.error(`[admin:routines] op=patch id=${id82} fields=agentChannel+agentDestination outcome=rejected reason=house-unresolved err="${message}"`);
|
|
22966
|
+
return c.json({ error: `WhatsApp destinations cannot be validated on this install: ${message}` }, 503);
|
|
22710
22967
|
}
|
|
22968
|
+
const check = validateAgentDestination(ACCOUNTS_DIR, houseAccountId, accountId, channel, destination);
|
|
22969
|
+
if (!check.valid) {
|
|
22970
|
+
console.error(`[admin:routines] op=patch id=${id82} fields=agentChannel+agentDestination outcome=rejected reason=${check.reason}`);
|
|
22971
|
+
return c.json(
|
|
22972
|
+
{
|
|
22973
|
+
error: check.reason === "cross-account" ? `That destination belongs to a different account on ${channel}.` : `That destination is not a registered admin or account manager on ${channel}.`
|
|
22974
|
+
},
|
|
22975
|
+
400
|
|
22976
|
+
);
|
|
22977
|
+
}
|
|
22978
|
+
setClauses.push("e.agentChannel = $agentChannel", "e.agentDestination = $agentDestination");
|
|
22979
|
+
params.agentChannel = channel;
|
|
22980
|
+
params.agentDestination = destination;
|
|
22981
|
+
fields.push("agentChannel", "agentDestination");
|
|
22982
|
+
bindingLog = ` channel=${channel} destination=${destination.slice(-4)}`;
|
|
22983
|
+
}
|
|
22984
|
+
if (clearing) {
|
|
22985
|
+
const keepsRow = typeof body.recurrence === "string" || storedRecurrence !== null || storedActionPlugin !== null;
|
|
22986
|
+
if (!keepsRow) {
|
|
22987
|
+
console.error(`[admin:routines] op=patch id=${id82} fields=agentChannel+agentDestination outcome=rejected reason=clear-would-orphan`);
|
|
22988
|
+
return c.json(
|
|
22989
|
+
{ error: "Clearing the dispatch on a one-time routine would leave nothing to show. Give it a schedule first, or delete it." },
|
|
22990
|
+
400
|
|
22991
|
+
);
|
|
22992
|
+
}
|
|
22993
|
+
setClauses.push("e.agentChannel = null", "e.agentDestination = null");
|
|
22994
|
+
fields.push("agentChannel", "agentDestination");
|
|
22995
|
+
bindingLog = " channel=none destination=none";
|
|
22996
|
+
}
|
|
22997
|
+
if (typeof body.agentPrompt === "string") {
|
|
22998
|
+
setClauses.push("e.agentPrompt = $agentPrompt");
|
|
22999
|
+
params.agentPrompt = body.agentPrompt;
|
|
23000
|
+
fields.push("agentPrompt");
|
|
23001
|
+
setClauses.push("e.operatorEdited = $operatorEdited");
|
|
23002
|
+
params.operatorEdited = (/* @__PURE__ */ new Date()).toISOString();
|
|
23003
|
+
}
|
|
23004
|
+
if (typeof body.recurrence === "string") {
|
|
22711
23005
|
try {
|
|
22712
23006
|
const interval = parseExpression(body.recurrence, { currentDate: /* @__PURE__ */ new Date(), tz: timezone ?? void 0 });
|
|
22713
23007
|
const nextRun = interval.next().toISOString();
|
|
@@ -22718,7 +23012,7 @@ app51.patch("/:eventId", requireAdminSession, async (c) => {
|
|
|
22718
23012
|
nextRunLog = nextRun;
|
|
22719
23013
|
} catch (err) {
|
|
22720
23014
|
const reason = err instanceof Error ? err.message : String(err);
|
|
22721
|
-
console.error(`[admin:routines] op=patch id=${
|
|
23015
|
+
console.error(`[admin:routines] op=patch id=${id82} outcome=rejected reason=invalid-cron cron=${body.recurrence}`);
|
|
22722
23016
|
return c.json({ error: `Invalid recurrence: ${reason}` }, 400);
|
|
22723
23017
|
}
|
|
22724
23018
|
}
|
|
@@ -22735,14 +23029,14 @@ app51.patch("/:eventId", requireAdminSession, async (c) => {
|
|
|
22735
23029
|
params
|
|
22736
23030
|
);
|
|
22737
23031
|
if (res.records.length === 0) {
|
|
22738
|
-
console.error(`[admin:routines] op=patch id=${
|
|
23032
|
+
console.error(`[admin:routines] op=patch id=${id82} outcome=rejected reason=not-found`);
|
|
22739
23033
|
return c.json({ error: "Routine not found" }, 404);
|
|
22740
23034
|
}
|
|
22741
|
-
console.log(`[admin:routines] op=patch id=${
|
|
23035
|
+
console.log(`[admin:routines] op=patch id=${id82} fields=${fields.join("+")} outcome=ok nextRun=${nextRunLog} cron=${params.recurrence ?? "unchanged"}${bindingLog}`);
|
|
22742
23036
|
return c.json({ routine: mapRoutine(res.records[0]) });
|
|
22743
23037
|
} catch (err) {
|
|
22744
23038
|
const message = err instanceof Error ? err.message : String(err);
|
|
22745
|
-
console.error(`[admin:routines] op=patch id=${
|
|
23039
|
+
console.error(`[admin:routines] op=patch id=${id82} outcome=rejected reason=${message}`);
|
|
22746
23040
|
return c.json({ error: `Update failed: ${message}` }, 503);
|
|
22747
23041
|
} finally {
|
|
22748
23042
|
await session.close();
|
|
@@ -22971,8 +23265,8 @@ app51.delete("/:eventId", requireAdminSession, async (c) => {
|
|
|
22971
23265
|
var routines_default = app51;
|
|
22972
23266
|
|
|
22973
23267
|
// server/routes/admin/skills.ts
|
|
22974
|
-
import { existsSync as existsSync39, readdirSync as readdirSync24, readFileSync as
|
|
22975
|
-
import { resolve as
|
|
23268
|
+
import { existsSync as existsSync39, readdirSync as readdirSync24, readFileSync as readFileSync37, rmSync as rmSync4 } from "fs";
|
|
23269
|
+
import { resolve as resolve31 } from "path";
|
|
22976
23270
|
var app52 = new Hono();
|
|
22977
23271
|
var NAME_RE = /^[a-z0-9][a-z0-9-]*$/;
|
|
22978
23272
|
function splitSkillMd(text) {
|
|
@@ -23010,18 +23304,18 @@ app52.get("/", requireAdminSession, async (c) => {
|
|
|
23010
23304
|
}
|
|
23011
23305
|
ensureAccountWatchers(acct.accountId, acct.accountDir);
|
|
23012
23306
|
const { value, state } = await getOrCompute("skills", acct.accountId, async () => {
|
|
23013
|
-
const pluginsDir =
|
|
23307
|
+
const pluginsDir = resolve31(acct.accountDir, "plugins");
|
|
23014
23308
|
const skills = [];
|
|
23015
23309
|
let pluginCount = 0;
|
|
23016
23310
|
for (const plugin of subdirs2(pluginsDir)) {
|
|
23017
23311
|
pluginCount++;
|
|
23018
|
-
const skillsDir =
|
|
23312
|
+
const skillsDir = resolve31(pluginsDir, plugin, "skills");
|
|
23019
23313
|
for (const skill of subdirs2(skillsDir)) {
|
|
23020
|
-
const skillMd =
|
|
23314
|
+
const skillMd = resolve31(skillsDir, skill, "SKILL.md");
|
|
23021
23315
|
if (!existsSync39(skillMd)) continue;
|
|
23022
23316
|
try {
|
|
23023
|
-
const { frontmatter } = splitSkillMd(
|
|
23024
|
-
const refsDir =
|
|
23317
|
+
const { frontmatter } = splitSkillMd(readFileSync37(skillMd, "utf-8"));
|
|
23318
|
+
const refsDir = resolve31(skillsDir, skill, "references");
|
|
23025
23319
|
const refCount = existsSync39(refsDir) ? readdirSync24(refsDir, { withFileTypes: true }).filter((e) => e.isFile()).length : 0;
|
|
23026
23320
|
skills.push({ plugin, skill, description: frontmatter.description, refCount });
|
|
23027
23321
|
} catch (err) {
|
|
@@ -23044,14 +23338,14 @@ app52.get("/:plugin/:skill", requireAdminSession, async (c) => {
|
|
|
23044
23338
|
console.error(`[admin:skills] op=get outcome=rejected reason=invalid-name plugin="${plugin}" skill="${skill}"`);
|
|
23045
23339
|
return c.json({ error: "Invalid plugin or skill name" }, 400);
|
|
23046
23340
|
}
|
|
23047
|
-
const skillDir =
|
|
23048
|
-
const skillMd =
|
|
23341
|
+
const skillDir = resolve31(acct.accountDir, "plugins", plugin, "skills", skill);
|
|
23342
|
+
const skillMd = resolve31(skillDir, "SKILL.md");
|
|
23049
23343
|
const found = existsSync39(skillMd);
|
|
23050
23344
|
console.log(`[admin:skills] op=get plugin=${plugin} skill=${skill} found=${found}`);
|
|
23051
23345
|
if (!found) return c.json({ error: "Skill not found" }, 404);
|
|
23052
23346
|
try {
|
|
23053
|
-
const { frontmatter, body } = splitSkillMd(
|
|
23054
|
-
const refsDir =
|
|
23347
|
+
const { frontmatter, body } = splitSkillMd(readFileSync37(skillMd, "utf-8"));
|
|
23348
|
+
const refsDir = resolve31(skillDir, "references");
|
|
23055
23349
|
const references = existsSync39(refsDir) ? readdirSync24(refsDir, { withFileTypes: true }).filter((e) => e.isFile()).map((e) => e.name).sort() : [];
|
|
23056
23350
|
return c.json({ skill: { plugin, skill, frontmatter, body, references } });
|
|
23057
23351
|
} catch (err) {
|
|
@@ -23069,10 +23363,10 @@ app52.delete("/:plugin/:skill", requireAdminSession, async (c) => {
|
|
|
23069
23363
|
console.error(`[admin:skills] op=delete outcome=rejected reason=invalid-name plugin="${plugin}" skill="${skill}"`);
|
|
23070
23364
|
return c.json({ error: "Invalid plugin or skill name" }, 400);
|
|
23071
23365
|
}
|
|
23072
|
-
const pluginDir =
|
|
23073
|
-
const skillsDir =
|
|
23074
|
-
const skillDir =
|
|
23075
|
-
if (!existsSync39(
|
|
23366
|
+
const pluginDir = resolve31(acct.accountDir, "plugins", plugin);
|
|
23367
|
+
const skillsDir = resolve31(pluginDir, "skills");
|
|
23368
|
+
const skillDir = resolve31(skillsDir, skill);
|
|
23369
|
+
if (!existsSync39(resolve31(skillDir, "SKILL.md"))) {
|
|
23076
23370
|
console.error(`[admin:skills] op=delete outcome=rejected reason=not-found plugin=${plugin} skill=${skill}`);
|
|
23077
23371
|
return c.json({ error: "Skill not found" }, 404);
|
|
23078
23372
|
}
|
|
@@ -23552,8 +23846,8 @@ app57.post("/", requireAdminSession, async (c) => {
|
|
|
23552
23846
|
var task_time_adjust_default = app57;
|
|
23553
23847
|
|
|
23554
23848
|
// app/lib/admin-roster.ts
|
|
23555
|
-
import { existsSync as existsSync40, readdirSync as readdirSync25, readFileSync as
|
|
23556
|
-
import { resolve as
|
|
23849
|
+
import { existsSync as existsSync40, readdirSync as readdirSync25, readFileSync as readFileSync38 } from "fs";
|
|
23850
|
+
import { resolve as resolve32 } from "path";
|
|
23557
23851
|
function readHouseAdminUserIds(accountsDir = ACCOUNTS_DIR) {
|
|
23558
23852
|
let entries2;
|
|
23559
23853
|
try {
|
|
@@ -23562,10 +23856,10 @@ function readHouseAdminUserIds(accountsDir = ACCOUNTS_DIR) {
|
|
|
23562
23856
|
return [];
|
|
23563
23857
|
}
|
|
23564
23858
|
for (const entry of entries2) {
|
|
23565
|
-
const cfgPath =
|
|
23859
|
+
const cfgPath = resolve32(accountsDir, entry, "account.json");
|
|
23566
23860
|
if (!existsSync40(cfgPath)) continue;
|
|
23567
23861
|
try {
|
|
23568
|
-
const cfg = JSON.parse(
|
|
23862
|
+
const cfg = JSON.parse(readFileSync38(cfgPath, "utf-8"));
|
|
23569
23863
|
if (cfg.role !== "house") continue;
|
|
23570
23864
|
if (!Array.isArray(cfg.admins)) return [];
|
|
23571
23865
|
return cfg.admins.map(
|
|
@@ -23891,10 +24185,34 @@ app61.get("/", requireAdminSession, async (c) => {
|
|
|
23891
24185
|
});
|
|
23892
24186
|
var admin_users_list_default = app61;
|
|
23893
24187
|
|
|
24188
|
+
// server/routes/admin/dispatch-destinations.ts
|
|
24189
|
+
var TAG37 = "[admin:routines]";
|
|
24190
|
+
var app62 = new Hono();
|
|
24191
|
+
app62.get("/", requireAdminSession, async (c) => {
|
|
24192
|
+
const accountId = getAccountIdForSession(c.var.cacheKey);
|
|
24193
|
+
if (!accountId) {
|
|
24194
|
+
console.error(`${TAG37} op=destinations auth-rejected reason="no account for session"`);
|
|
24195
|
+
return c.json({ error: "Account not found for session" }, 401);
|
|
24196
|
+
}
|
|
24197
|
+
let houseAccountId = null;
|
|
24198
|
+
try {
|
|
24199
|
+
houseAccountId = resolveHouseOrSoleAccountId(ACCOUNTS_DIR);
|
|
24200
|
+
} catch (err) {
|
|
24201
|
+
const message = err instanceof Error ? err.message : String(err);
|
|
24202
|
+
console.error(`${TAG37} op=destinations account=${accountId.slice(0, 8)} outcome=house-unresolved reason="${message}"`);
|
|
24203
|
+
}
|
|
24204
|
+
const destinations = listDispatchDestinations({ accountsDir: ACCOUNTS_DIR, houseAccountId, accountId });
|
|
24205
|
+
console.log(
|
|
24206
|
+
`${TAG37} op=destinations account=${accountId.slice(0, 8)} count=${destinations.length}` + (houseAccountId === null ? " outcome=house-unresolved" : "")
|
|
24207
|
+
);
|
|
24208
|
+
return c.json({ destinations });
|
|
24209
|
+
});
|
|
24210
|
+
var dispatch_destinations_default = app62;
|
|
24211
|
+
|
|
23894
24212
|
// server/routes/admin/activity.ts
|
|
23895
24213
|
import { readdirSync as readdirSync26 } from "fs";
|
|
23896
|
-
var
|
|
23897
|
-
var
|
|
24214
|
+
var app63 = new Hono();
|
|
24215
|
+
var TAG38 = "[activity]";
|
|
23898
24216
|
function resolveHouseAccountId(accounts) {
|
|
23899
24217
|
const houses = accounts.filter((a) => a.config.role === "house");
|
|
23900
24218
|
if (houses.length === 1) return { accountId: houses[0].accountId, reason: "house" };
|
|
@@ -23915,7 +24233,7 @@ function countAccountDirsOnDisk() {
|
|
|
23915
24233
|
return null;
|
|
23916
24234
|
}
|
|
23917
24235
|
}
|
|
23918
|
-
|
|
24236
|
+
app63.get("/", requireAdminSession, async (c) => {
|
|
23919
24237
|
const req = requestToken();
|
|
23920
24238
|
const cacheKey = c.var.cacheKey;
|
|
23921
24239
|
const caller2 = getAccountIdForSession(cacheKey) ?? null;
|
|
@@ -23923,19 +24241,19 @@ app62.get("/", requireAdminSession, async (c) => {
|
|
|
23923
24241
|
const house = resolveHouseAccountId(valid);
|
|
23924
24242
|
const isHouse = caller2 !== null && house.accountId !== null && caller2 === house.accountId;
|
|
23925
24243
|
console.log(
|
|
23926
|
-
`${
|
|
24244
|
+
`${TAG38} op=request req=${req} caller=${short(caller2)} house=${isHouse} houseVia=${house.reason}`
|
|
23927
24245
|
);
|
|
23928
24246
|
if (!isHouse) {
|
|
23929
24247
|
const reason = house.accountId === null ? house.reason : "not-house";
|
|
23930
24248
|
console.error(
|
|
23931
|
-
`${
|
|
24249
|
+
`${TAG38} op=gate req=${req} decision=deny reason=${reason} caller=${short(caller2)} houseAcct=${short(house.accountId)} accounts=${valid.length}`
|
|
23932
24250
|
);
|
|
23933
24251
|
return c.json({ error: "house-only" }, 403);
|
|
23934
24252
|
}
|
|
23935
|
-
console.log(`${
|
|
24253
|
+
console.log(`${TAG38} op=gate req=${req} decision=allow caller=${short(caller2)} via=${house.reason}`);
|
|
23936
24254
|
const onDisk = countAccountDirsOnDisk();
|
|
23937
24255
|
console.log(
|
|
23938
|
-
`${
|
|
24256
|
+
`${TAG38} op=accounts req=${req} onDisk=${onDisk ?? "unknown"} valid=${valid.length} ids=${valid.map((a) => short(a.accountId)).join(",")}`
|
|
23939
24257
|
);
|
|
23940
24258
|
const start = Date.now();
|
|
23941
24259
|
let res;
|
|
@@ -23951,17 +24269,17 @@ app62.get("/", requireAdminSession, async (c) => {
|
|
|
23951
24269
|
});
|
|
23952
24270
|
} catch (err) {
|
|
23953
24271
|
console.error(
|
|
23954
|
-
`${
|
|
24272
|
+
`${TAG38} op=manager-fail req=${req} reason=unreachable err=${err instanceof Error ? err.message : String(err)}`
|
|
23955
24273
|
);
|
|
23956
24274
|
return c.json({ error: "manager-unreachable" }, 502);
|
|
23957
24275
|
}
|
|
23958
24276
|
if (res.status !== 200) {
|
|
23959
|
-
console.error(`${
|
|
24277
|
+
console.error(`${TAG38} op=manager-fail req=${req} reason=status status=${res.status}`);
|
|
23960
24278
|
return c.json({ error: `manager-status-${res.status}` }, 502);
|
|
23961
24279
|
}
|
|
23962
24280
|
const body = await res.json().catch(() => null);
|
|
23963
24281
|
if (!body || !Array.isArray(body.rows)) {
|
|
23964
|
-
console.error(`${
|
|
24282
|
+
console.error(`${TAG38} op=manager-fail req=${req} reason=bad-json`);
|
|
23965
24283
|
return c.json({ error: "manager-bad-json" }, 502);
|
|
23966
24284
|
}
|
|
23967
24285
|
const rows = body.rows;
|
|
@@ -23972,10 +24290,10 @@ app62.get("/", requireAdminSession, async (c) => {
|
|
|
23972
24290
|
const ageNull = rows.filter((r) => r.ageMs === null).length;
|
|
23973
24291
|
const sidecarNull = rows.filter((r) => r.sidecarMissing).length;
|
|
23974
24292
|
console.log(
|
|
23975
|
-
`${
|
|
24293
|
+
`${TAG38} op=census req=${req} ageMs=${censusAgeMs ?? "none"} live=${census?.live ?? "none"} cpuNull=${census?.cpuNull ?? "none"} rows=${rows.length} ageNull=${ageNull} sidecarNull=${sidecarNull}`
|
|
23976
24294
|
);
|
|
23977
24295
|
console.log(
|
|
23978
|
-
`${
|
|
24296
|
+
`${TAG38} op=response req=${req} rows=${rows.length} accounts=${valid.length} untagged=${untaggedCount} meteringFailed=${meteringFailed} ms=${Date.now() - start}`
|
|
23979
24297
|
);
|
|
23980
24298
|
const names = {};
|
|
23981
24299
|
await Promise.all(
|
|
@@ -23994,7 +24312,7 @@ app62.get("/", requireAdminSession, async (c) => {
|
|
|
23994
24312
|
return acc;
|
|
23995
24313
|
}, {});
|
|
23996
24314
|
console.log(
|
|
23997
|
-
`${
|
|
24315
|
+
`${TAG38} op=loops req=${req} armed=${armed2} rendered=${loopRows.length} procPct=${cpu.processPct?.toFixed(1) ?? "null"} attributedPct=${cpu.attributedPct?.toFixed(1) ?? "null"} ` + Object.entries(byState).map(([s, n]) => `${s}=${n}`).join(" ")
|
|
23998
24316
|
);
|
|
23999
24317
|
return c.json({
|
|
24000
24318
|
rows,
|
|
@@ -24024,68 +24342,69 @@ app62.get("/", requireAdminSession, async (c) => {
|
|
|
24024
24342
|
}
|
|
24025
24343
|
});
|
|
24026
24344
|
});
|
|
24027
|
-
var activity_default =
|
|
24345
|
+
var activity_default = app63;
|
|
24028
24346
|
|
|
24029
24347
|
// server/routes/admin/index.ts
|
|
24030
|
-
var
|
|
24031
|
-
|
|
24032
|
-
|
|
24033
|
-
|
|
24034
|
-
|
|
24035
|
-
|
|
24036
|
-
|
|
24037
|
-
|
|
24038
|
-
|
|
24039
|
-
|
|
24040
|
-
|
|
24041
|
-
|
|
24042
|
-
|
|
24043
|
-
|
|
24044
|
-
|
|
24045
|
-
|
|
24046
|
-
|
|
24047
|
-
|
|
24048
|
-
|
|
24049
|
-
|
|
24050
|
-
|
|
24051
|
-
|
|
24052
|
-
|
|
24053
|
-
|
|
24054
|
-
|
|
24055
|
-
|
|
24056
|
-
|
|
24057
|
-
|
|
24058
|
-
|
|
24059
|
-
|
|
24060
|
-
|
|
24061
|
-
|
|
24062
|
-
|
|
24063
|
-
|
|
24064
|
-
|
|
24065
|
-
|
|
24066
|
-
|
|
24067
|
-
|
|
24068
|
-
|
|
24069
|
-
|
|
24070
|
-
|
|
24071
|
-
|
|
24072
|
-
|
|
24073
|
-
|
|
24074
|
-
|
|
24075
|
-
|
|
24076
|
-
|
|
24077
|
-
|
|
24078
|
-
|
|
24079
|
-
|
|
24080
|
-
|
|
24081
|
-
|
|
24348
|
+
var app64 = new Hono();
|
|
24349
|
+
app64.route("/session", session_default);
|
|
24350
|
+
app64.route("/accounts", accounts_default);
|
|
24351
|
+
app64.route("/logs", logs_default);
|
|
24352
|
+
app64.route("/claude-info", claude_info_default);
|
|
24353
|
+
app64.route("/attachment", attachment_default);
|
|
24354
|
+
app64.route("/session-upload", session_upload_default);
|
|
24355
|
+
app64.route("/agents", agents_default);
|
|
24356
|
+
app64.route("/sessions", sessions_default);
|
|
24357
|
+
app64.route("/claude-sessions", claude_sessions_default);
|
|
24358
|
+
app64.route("/log-ingest", log_ingest_default);
|
|
24359
|
+
app64.route("/events", events_default);
|
|
24360
|
+
app64.route("/files", files_default);
|
|
24361
|
+
app64.route("/graph-search", graph_search_default);
|
|
24362
|
+
app64.route("/graph-subgraph", graph_subgraph_default);
|
|
24363
|
+
app64.route("/graph-delete", graph_delete_default);
|
|
24364
|
+
app64.route("/graph-restore", graph_restore_default);
|
|
24365
|
+
app64.route("/graph-labels-in-graph", graph_labels_in_graph_default);
|
|
24366
|
+
app64.route("/graph-default-view", graph_default_view_default);
|
|
24367
|
+
app64.route("/sidebar-artefacts", sidebar_artefacts_default);
|
|
24368
|
+
app64.route("/sidebar-sessions", sidebar_sessions_default);
|
|
24369
|
+
app64.route("/session-delete", session_delete_default);
|
|
24370
|
+
app64.route("/session-stop", session_stop_default);
|
|
24371
|
+
app64.route("/session-archive", session_archive_default);
|
|
24372
|
+
app64.route("/session-rename", session_rename_default);
|
|
24373
|
+
app64.route("/session-usage", session_usage_default);
|
|
24374
|
+
app64.route("/browser", browser_default);
|
|
24375
|
+
app64.route("/session-rc-spawn", session_rc_spawn_default);
|
|
24376
|
+
app64.route("/session-reseat", session_reseat_default);
|
|
24377
|
+
app64.route("/system-stats", system_stats_default);
|
|
24378
|
+
app64.route("/health-brand", health_default2);
|
|
24379
|
+
app64.route("/linkedin-ingest", linkedin_ingest_default);
|
|
24380
|
+
app64.route("/post-turn-context", post_turn_context_default);
|
|
24381
|
+
app64.route("/public-session-context", public_session_context_default);
|
|
24382
|
+
app64.route("/public-session-exit", public_session_exit_default);
|
|
24383
|
+
app64.route("/access-session-evict", access_session_evict_default);
|
|
24384
|
+
app64.route("/enrol-person", enrol_person_default);
|
|
24385
|
+
app64.route("/calendar", calendar_default);
|
|
24386
|
+
app64.route("/data-portal", data_portal_default);
|
|
24387
|
+
app64.route("/routines", routines_default);
|
|
24388
|
+
app64.route("/skills", skills_default);
|
|
24389
|
+
app64.route("/tasks-list", tasks_list_default);
|
|
24390
|
+
app64.route("/task-timer-start", task_timer_start_default);
|
|
24391
|
+
app64.route("/task-timer-stop", task_timer_stop_default);
|
|
24392
|
+
app64.route("/task-complete", task_complete_default);
|
|
24393
|
+
app64.route("/task-time-adjust", task_time_adjust_default);
|
|
24394
|
+
app64.route("/task-assign", task_assign_default);
|
|
24395
|
+
app64.route("/task-session-open", task_session_open_default);
|
|
24396
|
+
app64.route("/task-session-link", task_session_link_default);
|
|
24397
|
+
app64.route("/admin-users-list", admin_users_list_default);
|
|
24398
|
+
app64.route("/dispatch-destinations", dispatch_destinations_default);
|
|
24399
|
+
app64.route("/activity", activity_default);
|
|
24400
|
+
var admin_default = app64;
|
|
24082
24401
|
|
|
24083
24402
|
// server/routes/access/verify-token.ts
|
|
24084
|
-
var
|
|
24403
|
+
var TAG39 = "[access-verify]";
|
|
24085
24404
|
var MINT_TAG = "[access-session-mint]";
|
|
24086
24405
|
var COOKIE_NAME = "__access_session";
|
|
24087
|
-
var
|
|
24088
|
-
|
|
24406
|
+
var app65 = new Hono();
|
|
24407
|
+
app65.post("/", async (c) => {
|
|
24089
24408
|
const ip = c.var.clientIp || "unknown";
|
|
24090
24409
|
let body;
|
|
24091
24410
|
try {
|
|
@@ -24100,39 +24419,39 @@ app64.post("/", async (c) => {
|
|
|
24100
24419
|
}
|
|
24101
24420
|
const rateMsg = checkAccessRateLimit(ip, agentSlug);
|
|
24102
24421
|
if (rateMsg) {
|
|
24103
|
-
console.error(`${
|
|
24422
|
+
console.error(`${TAG39} grantId=- agentSlug=${agentSlug} result=rate-limited ip=${ip}`);
|
|
24104
24423
|
return c.json({ error: rateMsg }, 429);
|
|
24105
24424
|
}
|
|
24106
24425
|
const grant = await findGrantByMagicToken(token);
|
|
24107
24426
|
if (!grant) {
|
|
24108
24427
|
recordAccessFailedAttempt(ip, agentSlug);
|
|
24109
|
-
console.error(`${
|
|
24428
|
+
console.error(`${TAG39} grantId=- agentSlug=${agentSlug} result=notfound ip=${ip}`);
|
|
24110
24429
|
return c.json({ error: "invalid-or-expired-link" }, 401);
|
|
24111
24430
|
}
|
|
24112
24431
|
if (grant.agentSlug !== agentSlug) {
|
|
24113
24432
|
recordAccessFailedAttempt(ip, agentSlug);
|
|
24114
24433
|
console.error(
|
|
24115
|
-
`${
|
|
24434
|
+
`${TAG39} grantId=${grant.grantId} agentSlug=${agentSlug} result=agent-mismatch grantAgent=${grant.agentSlug} ip=${ip}`
|
|
24116
24435
|
);
|
|
24117
24436
|
return c.json({ error: "invalid-or-expired-link" }, 401);
|
|
24118
24437
|
}
|
|
24119
24438
|
if (grant.status === "expired" || grant.status === "revoked") {
|
|
24120
24439
|
recordAccessFailedAttempt(ip, agentSlug);
|
|
24121
24440
|
console.error(
|
|
24122
|
-
`${
|
|
24441
|
+
`${TAG39} grantId=${grant.grantId} agentSlug=${agentSlug} result=expired status=${grant.status} ip=${ip}`
|
|
24123
24442
|
);
|
|
24124
24443
|
return c.json({ error: "access-no-longer-valid" }, 401);
|
|
24125
24444
|
}
|
|
24126
24445
|
if (grant.expiresAt !== null && grant.expiresAt < Date.now()) {
|
|
24127
24446
|
recordAccessFailedAttempt(ip, agentSlug);
|
|
24128
24447
|
console.error(
|
|
24129
|
-
`${
|
|
24448
|
+
`${TAG39} grantId=${grant.grantId} agentSlug=${agentSlug} result=expired reason=expiresAt-past ip=${ip}`
|
|
24130
24449
|
);
|
|
24131
24450
|
return c.json({ error: "access-no-longer-valid" }, 401);
|
|
24132
24451
|
}
|
|
24133
24452
|
if (!grant.sliceToken) {
|
|
24134
24453
|
console.error(
|
|
24135
|
-
`${
|
|
24454
|
+
`${TAG39} grantId=${grant.grantId} agentSlug=${agentSlug} result=no-slice-token reason=schema-violation`
|
|
24136
24455
|
);
|
|
24137
24456
|
return c.json({ error: "grant-misconfigured" }, 500);
|
|
24138
24457
|
}
|
|
@@ -24148,12 +24467,12 @@ app64.post("/", async (c) => {
|
|
|
24148
24467
|
await consumeMagicTokenAndActivate(grant.grantId);
|
|
24149
24468
|
} catch (err) {
|
|
24150
24469
|
console.error(
|
|
24151
|
-
`${
|
|
24470
|
+
`${TAG39} grantId=${grant.grantId} agentSlug=${agentSlug} result=consume-failed err="${err instanceof Error ? err.message : String(err)}"`
|
|
24152
24471
|
);
|
|
24153
24472
|
return c.json({ error: "verification-failed" }, 500);
|
|
24154
24473
|
}
|
|
24155
24474
|
clearAccessRateLimit(ip, agentSlug);
|
|
24156
|
-
console.log(`${
|
|
24475
|
+
console.log(`${TAG39} grantId=${grant.grantId} agentSlug=${agentSlug} result=ok ip=${ip}`);
|
|
24157
24476
|
console.log(
|
|
24158
24477
|
`${MINT_TAG} grantId=${grant.grantId} sliceToken=${grant.sliceToken.slice(0, 8)} agentSlug=${agentSlug} personId=${grant.personId ?? "none"}`
|
|
24159
24478
|
);
|
|
@@ -24167,13 +24486,13 @@ app64.post("/", async (c) => {
|
|
|
24167
24486
|
displayName: grant.displayName
|
|
24168
24487
|
});
|
|
24169
24488
|
});
|
|
24170
|
-
var verify_token_default =
|
|
24489
|
+
var verify_token_default = app65;
|
|
24171
24490
|
|
|
24172
24491
|
// app/lib/access-email.ts
|
|
24173
24492
|
import { spawn as spawn2 } from "child_process";
|
|
24174
|
-
import { resolve as
|
|
24175
|
-
var PLATFORM_ROOT5 = process.env.MAXY_PLATFORM_ROOT ??
|
|
24176
|
-
var SEND_SCRIPT =
|
|
24493
|
+
import { resolve as resolve33 } from "path";
|
|
24494
|
+
var PLATFORM_ROOT5 = process.env.MAXY_PLATFORM_ROOT ?? resolve33(process.cwd(), "..");
|
|
24495
|
+
var SEND_SCRIPT = resolve33(
|
|
24177
24496
|
PLATFORM_ROOT5,
|
|
24178
24497
|
"plugins",
|
|
24179
24498
|
"email",
|
|
@@ -24229,10 +24548,10 @@ async function sendMagicLinkEmail(payload) {
|
|
|
24229
24548
|
}
|
|
24230
24549
|
|
|
24231
24550
|
// server/routes/access/request-magic-link.ts
|
|
24232
|
-
var
|
|
24233
|
-
var
|
|
24551
|
+
var TAG40 = "[access-request-link]";
|
|
24552
|
+
var app66 = new Hono();
|
|
24234
24553
|
var VISITOR_MESSAGE = "If that email is on the invite list, a fresh link is on the way.";
|
|
24235
|
-
|
|
24554
|
+
app66.post("/", async (c) => {
|
|
24236
24555
|
let body;
|
|
24237
24556
|
try {
|
|
24238
24557
|
body = await c.req.json();
|
|
@@ -24246,18 +24565,18 @@ app65.post("/", async (c) => {
|
|
|
24246
24565
|
}
|
|
24247
24566
|
const rateMsg = checkRequestLinkRateLimit(contactValue);
|
|
24248
24567
|
if (rateMsg) {
|
|
24249
|
-
console.error(`${
|
|
24568
|
+
console.error(`${TAG40} contactValue=${maskContact(contactValue)} result=rate-limited`);
|
|
24250
24569
|
return c.json({ error: rateMsg }, 429);
|
|
24251
24570
|
}
|
|
24252
24571
|
recordRequestLinkAttempt(contactValue);
|
|
24253
24572
|
const accountId = process.env.ACCOUNT_ID ?? "";
|
|
24254
24573
|
if (!accountId) {
|
|
24255
|
-
console.error(`${
|
|
24574
|
+
console.error(`${TAG40} contactValue=${maskContact(contactValue)} result=no-account-id`);
|
|
24256
24575
|
return c.json({ message: VISITOR_MESSAGE }, 200);
|
|
24257
24576
|
}
|
|
24258
24577
|
const grant = await findActiveGrantByContact(contactValue, agentSlug, accountId);
|
|
24259
24578
|
if (!grant) {
|
|
24260
|
-
console.log(`${
|
|
24579
|
+
console.log(`${TAG40} contactValue=${maskContact(contactValue)} result=notfound`);
|
|
24261
24580
|
return c.json({ message: VISITOR_MESSAGE }, 200);
|
|
24262
24581
|
}
|
|
24263
24582
|
let token;
|
|
@@ -24265,7 +24584,7 @@ app65.post("/", async (c) => {
|
|
|
24265
24584
|
token = await generateNewMagicToken(grant.grantId);
|
|
24266
24585
|
} catch (err) {
|
|
24267
24586
|
console.error(
|
|
24268
|
-
`${
|
|
24587
|
+
`${TAG40} contactValue=${maskContact(contactValue)} result=mint-failed err="${err instanceof Error ? err.message : String(err)}"`
|
|
24269
24588
|
);
|
|
24270
24589
|
return c.json({ message: VISITOR_MESSAGE }, 200);
|
|
24271
24590
|
}
|
|
@@ -24297,26 +24616,26 @@ app65.post("/", async (c) => {
|
|
|
24297
24616
|
});
|
|
24298
24617
|
if (!sendResult.ok) {
|
|
24299
24618
|
console.error(
|
|
24300
|
-
`${
|
|
24619
|
+
`${TAG40} contactValue=${maskContact(contactValue)} result=send-failed err="${sendResult.error}"`
|
|
24301
24620
|
);
|
|
24302
24621
|
return c.json({ message: VISITOR_MESSAGE }, 200);
|
|
24303
24622
|
}
|
|
24304
24623
|
console.log(
|
|
24305
|
-
`${
|
|
24624
|
+
`${TAG40} contactValue=${maskContact(contactValue)} result=ok messageId=${sendResult.messageId}`
|
|
24306
24625
|
);
|
|
24307
24626
|
return c.json({ message: VISITOR_MESSAGE }, 200);
|
|
24308
24627
|
});
|
|
24309
|
-
var request_magic_link_default =
|
|
24628
|
+
var request_magic_link_default = app66;
|
|
24310
24629
|
|
|
24311
24630
|
// server/routes/access/index.ts
|
|
24312
|
-
var
|
|
24313
|
-
|
|
24314
|
-
|
|
24315
|
-
var access_default =
|
|
24631
|
+
var app67 = new Hono();
|
|
24632
|
+
app67.route("/verify-token", verify_token_default);
|
|
24633
|
+
app67.route("/request-magic-link", request_magic_link_default);
|
|
24634
|
+
var access_default = app67;
|
|
24316
24635
|
|
|
24317
24636
|
// server/routes/sites.ts
|
|
24318
|
-
import { existsSync as existsSync41, readFileSync as
|
|
24319
|
-
import { resolve as
|
|
24637
|
+
import { existsSync as existsSync41, readFileSync as readFileSync39, realpathSync as realpathSync8, statSync as statSync22 } from "fs";
|
|
24638
|
+
import { resolve as resolve34 } from "path";
|
|
24320
24639
|
var SAFE_SEG_RE = /^[a-z0-9_][a-z0-9_.-]{0,99}$/i;
|
|
24321
24640
|
var MIME = {
|
|
24322
24641
|
".html": "text/html; charset=utf-8",
|
|
@@ -24347,8 +24666,8 @@ function getExt(p) {
|
|
|
24347
24666
|
if (idx < p.lastIndexOf("/")) return "";
|
|
24348
24667
|
return p.slice(idx).toLowerCase();
|
|
24349
24668
|
}
|
|
24350
|
-
var
|
|
24351
|
-
|
|
24669
|
+
var app68 = new Hono();
|
|
24670
|
+
app68.get("/:rel{.*}", (c) => {
|
|
24352
24671
|
const reqPath = c.req.path;
|
|
24353
24672
|
const rawRel = c.req.param("rel") ?? "";
|
|
24354
24673
|
const trimmed = rawRel.replace(/^\/+/, "").replace(/\/+$/, "");
|
|
@@ -24373,8 +24692,8 @@ app67.get("/:rel{.*}", (c) => {
|
|
|
24373
24692
|
}
|
|
24374
24693
|
segments.push(seg);
|
|
24375
24694
|
}
|
|
24376
|
-
const rootDir =
|
|
24377
|
-
let filePath = segments.length === 0 ? rootDir :
|
|
24695
|
+
const rootDir = resolve34(account.accountDir, "sites");
|
|
24696
|
+
let filePath = segments.length === 0 ? rootDir : resolve34(rootDir, ...segments);
|
|
24378
24697
|
if (filePath !== rootDir && !filePath.startsWith(rootDir + "/")) {
|
|
24379
24698
|
console.error(`[sites] path-traversal-rejected path=${reqPath} reason=escape status=403`);
|
|
24380
24699
|
return c.text("Forbidden", 403);
|
|
@@ -24394,7 +24713,7 @@ app67.get("/:rel{.*}", (c) => {
|
|
|
24394
24713
|
return c.redirect(target, 301);
|
|
24395
24714
|
}
|
|
24396
24715
|
if (stat11?.isDirectory()) {
|
|
24397
|
-
filePath =
|
|
24716
|
+
filePath = resolve34(filePath, "index.html");
|
|
24398
24717
|
}
|
|
24399
24718
|
if (!filePath.startsWith(rootDir + "/")) {
|
|
24400
24719
|
console.error(`[sites] path-traversal-rejected path=${reqPath} reason=escape status=403`);
|
|
@@ -24419,7 +24738,7 @@ app67.get("/:rel{.*}", (c) => {
|
|
|
24419
24738
|
}
|
|
24420
24739
|
let body;
|
|
24421
24740
|
try {
|
|
24422
|
-
body =
|
|
24741
|
+
body = readFileSync39(realPath);
|
|
24423
24742
|
} catch (err) {
|
|
24424
24743
|
const code = err?.code;
|
|
24425
24744
|
if (code === "EISDIR") {
|
|
@@ -24451,11 +24770,11 @@ app67.get("/:rel{.*}", (c) => {
|
|
|
24451
24770
|
"X-Content-Type-Options": "nosniff"
|
|
24452
24771
|
});
|
|
24453
24772
|
});
|
|
24454
|
-
var sites_default =
|
|
24773
|
+
var sites_default = app68;
|
|
24455
24774
|
|
|
24456
24775
|
// app/lib/visitor-token.ts
|
|
24457
24776
|
import { createHmac, randomBytes, timingSafeEqual } from "crypto";
|
|
24458
|
-
import { mkdirSync as mkdirSync8, readFileSync as
|
|
24777
|
+
import { mkdirSync as mkdirSync8, readFileSync as readFileSync40, writeFileSync as writeFileSync14 } from "fs";
|
|
24459
24778
|
import { dirname as dirname15 } from "path";
|
|
24460
24779
|
var TOKEN_PREFIX = "v1.";
|
|
24461
24780
|
var SECRET_BYTES = 32;
|
|
@@ -24464,7 +24783,7 @@ var cachedSecret = null;
|
|
|
24464
24783
|
function getSecret() {
|
|
24465
24784
|
if (cachedSecret) return cachedSecret;
|
|
24466
24785
|
try {
|
|
24467
|
-
const hex2 =
|
|
24786
|
+
const hex2 = readFileSync40(VISITOR_TOKEN_SECRET_FILE, "utf-8").trim();
|
|
24468
24787
|
if (hex2.length === SECRET_BYTES * 2) {
|
|
24469
24788
|
cachedSecret = Buffer.from(hex2, "hex");
|
|
24470
24789
|
return cachedSecret;
|
|
@@ -24478,7 +24797,7 @@ function getSecret() {
|
|
|
24478
24797
|
console.log(`[visitor-token] secret minted path=${VISITOR_TOKEN_SECRET_FILE}`);
|
|
24479
24798
|
} catch {
|
|
24480
24799
|
}
|
|
24481
|
-
const hex =
|
|
24800
|
+
const hex = readFileSync40(VISITOR_TOKEN_SECRET_FILE, "utf-8").trim();
|
|
24482
24801
|
cachedSecret = Buffer.from(hex, "hex");
|
|
24483
24802
|
return cachedSecret;
|
|
24484
24803
|
}
|
|
@@ -24531,7 +24850,7 @@ var VISITOR_COOKIE_NAME = "mxy_v";
|
|
|
24531
24850
|
var VISITOR_COOKIE_MAX_AGE_SECONDS = Math.floor(DEFAULT_TTL_MS / 1e3);
|
|
24532
24851
|
|
|
24533
24852
|
// app/lib/brand-config.ts
|
|
24534
|
-
import { existsSync as existsSync42, readFileSync as
|
|
24853
|
+
import { existsSync as existsSync42, readFileSync as readFileSync41 } from "fs";
|
|
24535
24854
|
import { join as join47 } from "path";
|
|
24536
24855
|
var cached2 = null;
|
|
24537
24856
|
var cachedAttempted = false;
|
|
@@ -24543,7 +24862,7 @@ function readBrandConfig() {
|
|
|
24543
24862
|
const brandPath = join47(platformRoot5, "config", "brand.json");
|
|
24544
24863
|
if (!existsSync42(brandPath)) return null;
|
|
24545
24864
|
try {
|
|
24546
|
-
cached2 = JSON.parse(
|
|
24865
|
+
cached2 = JSON.parse(readFileSync41(brandPath, "utf-8"));
|
|
24547
24866
|
return cached2;
|
|
24548
24867
|
} catch {
|
|
24549
24868
|
return null;
|
|
@@ -24551,7 +24870,7 @@ function readBrandConfig() {
|
|
|
24551
24870
|
}
|
|
24552
24871
|
|
|
24553
24872
|
// server/routes/visitor-consent.ts
|
|
24554
|
-
var
|
|
24873
|
+
var app69 = new Hono();
|
|
24555
24874
|
var CONSENT_COOKIE_NAME = "mxy_consent";
|
|
24556
24875
|
var CONSENT_COOKIE_MAX_AGE_SECONDS = 60 * 60 * 24 * 365;
|
|
24557
24876
|
var DEFAULT_CONSENT_COPY = {
|
|
@@ -24596,17 +24915,17 @@ function siteSlugFromReferer(referer) {
|
|
|
24596
24915
|
return "";
|
|
24597
24916
|
}
|
|
24598
24917
|
}
|
|
24599
|
-
|
|
24918
|
+
app69.options("/consent", (c) => {
|
|
24600
24919
|
const origin = getOrigin(c);
|
|
24601
24920
|
setCorsHeaders(c, origin);
|
|
24602
24921
|
return c.body(null, 204);
|
|
24603
24922
|
});
|
|
24604
|
-
|
|
24923
|
+
app69.options("/brand-config", (c) => {
|
|
24605
24924
|
const origin = getOrigin(c);
|
|
24606
24925
|
setCorsHeaders(c, origin);
|
|
24607
24926
|
return c.body(null, 204);
|
|
24608
24927
|
});
|
|
24609
|
-
|
|
24928
|
+
app69.post("/consent", async (c) => {
|
|
24610
24929
|
const origin = getOrigin(c);
|
|
24611
24930
|
setCorsHeaders(c, origin);
|
|
24612
24931
|
let raw;
|
|
@@ -24646,7 +24965,7 @@ app68.post("/consent", async (c) => {
|
|
|
24646
24965
|
console.log(`[consent] ${parsed.decision} site=${site} brand=${brandName} tokenBound=${tokenBound}`);
|
|
24647
24966
|
return c.body(null, 204);
|
|
24648
24967
|
});
|
|
24649
|
-
|
|
24968
|
+
app69.get("/brand-config", (c) => {
|
|
24650
24969
|
const origin = getOrigin(c);
|
|
24651
24970
|
setCorsHeaders(c, origin);
|
|
24652
24971
|
const brand = readBrandConfig();
|
|
@@ -24656,7 +24975,7 @@ app68.get("/brand-config", (c) => {
|
|
|
24656
24975
|
c.header("Cache-Control", "public, max-age=300");
|
|
24657
24976
|
return c.json({ consent: { copy, palette } });
|
|
24658
24977
|
});
|
|
24659
|
-
var visitor_consent_default =
|
|
24978
|
+
var visitor_consent_default = app69;
|
|
24660
24979
|
|
|
24661
24980
|
// server/routes/listings.ts
|
|
24662
24981
|
function getCookie(headerValue, name) {
|
|
@@ -24683,8 +25002,8 @@ function appendConsentParams(pageUrl, token) {
|
|
|
24683
25002
|
}
|
|
24684
25003
|
var SAFE_SLUG_RE = /^[a-z0-9](?:[a-z0-9-]{0,118}[a-z0-9])?$/;
|
|
24685
25004
|
var CHAT_SESSION_KEY_RE = /^[A-Za-z0-9][A-Za-z0-9_-]{7,127}$/;
|
|
24686
|
-
var
|
|
24687
|
-
|
|
25005
|
+
var app70 = new Hono();
|
|
25006
|
+
app70.get("/:slug/click", async (c) => {
|
|
24688
25007
|
const slug = c.req.param("slug") ?? "";
|
|
24689
25008
|
const rawSession = c.req.query("session") ?? "";
|
|
24690
25009
|
const sessionKey = CHAT_SESSION_KEY_RE.test(rawSession) ? rawSession : "invalid";
|
|
@@ -24748,10 +25067,10 @@ app69.get("/:slug/click", async (c) => {
|
|
|
24748
25067
|
console.log(`[property-card-click] sessionKey=${sessionKey} listingSlug=${slug} consent=${consentCookie ?? "absent"} ts=${(/* @__PURE__ */ new Date()).toISOString()}`);
|
|
24749
25068
|
return c.redirect(redirectUrl, 302);
|
|
24750
25069
|
});
|
|
24751
|
-
var listings_default =
|
|
25070
|
+
var listings_default = app70;
|
|
24752
25071
|
|
|
24753
25072
|
// server/routes/visitor-event.ts
|
|
24754
|
-
var
|
|
25073
|
+
var app71 = new Hono();
|
|
24755
25074
|
var BOT_UA_RE = /\b(bot|crawl|spider|slurp|headlesschrome|phantomjs|googlebot|bingbot|yandex|baiduspider|ahrefsbot|semrushbot|mj12bot|dotbot|petalbot)\b/i;
|
|
24756
25075
|
var buckets = /* @__PURE__ */ new Map();
|
|
24757
25076
|
var RATE_LIMIT = 60;
|
|
@@ -24827,12 +25146,12 @@ function originAllowed(origin, allowlist) {
|
|
|
24827
25146
|
return false;
|
|
24828
25147
|
}
|
|
24829
25148
|
}
|
|
24830
|
-
|
|
25149
|
+
app71.options("/event", (c) => {
|
|
24831
25150
|
const origin = getOrigin2(c);
|
|
24832
25151
|
setCorsHeaders2(c, origin);
|
|
24833
25152
|
return c.body(null, 204);
|
|
24834
25153
|
});
|
|
24835
|
-
|
|
25154
|
+
app71.post("/event", async (c) => {
|
|
24836
25155
|
const origin = getOrigin2(c);
|
|
24837
25156
|
setCorsHeaders2(c, origin);
|
|
24838
25157
|
const ua = c.req.header("user-agent") ?? "";
|
|
@@ -25037,17 +25356,17 @@ async function writeEvent(opts) {
|
|
|
25037
25356
|
);
|
|
25038
25357
|
}
|
|
25039
25358
|
}
|
|
25040
|
-
var visitor_event_default =
|
|
25359
|
+
var visitor_event_default = app71;
|
|
25041
25360
|
|
|
25042
25361
|
// server/routes/session.ts
|
|
25043
|
-
import { resolve as
|
|
25362
|
+
import { resolve as resolve35 } from "path";
|
|
25044
25363
|
import { existsSync as existsSync43, writeFileSync as writeFileSync15, mkdirSync as mkdirSync9 } from "fs";
|
|
25045
25364
|
var UUID_RE4 = /^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i;
|
|
25046
25365
|
function writeBrandingCache(accountId, agentSlug, branding) {
|
|
25047
25366
|
try {
|
|
25048
|
-
const cacheDir =
|
|
25367
|
+
const cacheDir = resolve35(MAXY_DIR, "branding-cache", accountId);
|
|
25049
25368
|
mkdirSync9(cacheDir, { recursive: true });
|
|
25050
|
-
writeFileSync15(
|
|
25369
|
+
writeFileSync15(resolve35(cacheDir, `${agentSlug}.json`), JSON.stringify(branding), "utf-8");
|
|
25051
25370
|
} catch (err) {
|
|
25052
25371
|
console.error(`[branding] cache write failed: ${err instanceof Error ? err.message : String(err)}`);
|
|
25053
25372
|
}
|
|
@@ -25083,8 +25402,8 @@ function withVisitorCookie(response, visitorId) {
|
|
|
25083
25402
|
headers
|
|
25084
25403
|
});
|
|
25085
25404
|
}
|
|
25086
|
-
var
|
|
25087
|
-
|
|
25405
|
+
var app72 = new Hono();
|
|
25406
|
+
app72.post("/", async (c) => {
|
|
25088
25407
|
let body;
|
|
25089
25408
|
try {
|
|
25090
25409
|
body = await c.req.json();
|
|
@@ -25124,8 +25443,8 @@ app71.post("/", async (c) => {
|
|
|
25124
25443
|
}
|
|
25125
25444
|
let agentConfig = null;
|
|
25126
25445
|
if (account) {
|
|
25127
|
-
const agentDir =
|
|
25128
|
-
if (!existsSync43(agentDir) || !existsSync43(
|
|
25446
|
+
const agentDir = resolve35(account.accountDir, "agents", agentSlug);
|
|
25447
|
+
if (!existsSync43(agentDir) || !existsSync43(resolve35(agentDir, "config.json"))) {
|
|
25129
25448
|
return c.json({ error: "Agent not found" }, 404);
|
|
25130
25449
|
}
|
|
25131
25450
|
agentConfig = resolveAgentConfig(account.accountDir, agentSlug);
|
|
@@ -25231,7 +25550,7 @@ app71.post("/", async (c) => {
|
|
|
25231
25550
|
newVisitorId
|
|
25232
25551
|
);
|
|
25233
25552
|
});
|
|
25234
|
-
var session_default2 =
|
|
25553
|
+
var session_default2 = app72;
|
|
25235
25554
|
|
|
25236
25555
|
// server/lib/calendar-slots.ts
|
|
25237
25556
|
var WEEKDAYS = ["sun", "mon", "tue", "wed", "thu", "fri", "sat"];
|
|
@@ -25314,17 +25633,17 @@ function computeOpenSlots(config, busy, fromISO, toISO) {
|
|
|
25314
25633
|
}
|
|
25315
25634
|
|
|
25316
25635
|
// server/routes/calendar-public.ts
|
|
25317
|
-
var
|
|
25636
|
+
var app73 = new Hono();
|
|
25318
25637
|
function setCors(c) {
|
|
25319
25638
|
c.header("Access-Control-Allow-Origin", "*");
|
|
25320
25639
|
c.header("Access-Control-Allow-Methods", "GET, OPTIONS");
|
|
25321
25640
|
c.header("Access-Control-Allow-Headers", "content-type");
|
|
25322
25641
|
}
|
|
25323
|
-
|
|
25642
|
+
app73.options("/free-busy", (c) => {
|
|
25324
25643
|
setCors(c);
|
|
25325
25644
|
return c.body(null, 204);
|
|
25326
25645
|
});
|
|
25327
|
-
|
|
25646
|
+
app73.get("/free-busy", async (c) => {
|
|
25328
25647
|
setCors(c);
|
|
25329
25648
|
const from = c.req.query("from");
|
|
25330
25649
|
const to = c.req.query("to");
|
|
@@ -25380,15 +25699,15 @@ app72.get("/free-busy", async (c) => {
|
|
|
25380
25699
|
await session.close();
|
|
25381
25700
|
}
|
|
25382
25701
|
});
|
|
25383
|
-
var calendar_public_default =
|
|
25702
|
+
var calendar_public_default = app73;
|
|
25384
25703
|
|
|
25385
25704
|
// server/routes/portal-fetch.ts
|
|
25386
25705
|
import { createReadStream as createReadStream3 } from "fs";
|
|
25387
25706
|
import { stat as stat8, readFile as readFile11, realpath } from "fs/promises";
|
|
25388
|
-
import { join as join48, resolve as
|
|
25707
|
+
import { join as join48, resolve as resolve36, sep as sep11 } from "path";
|
|
25389
25708
|
import { Readable as Readable3 } from "stream";
|
|
25390
|
-
var
|
|
25391
|
-
var
|
|
25709
|
+
var app74 = new Hono();
|
|
25710
|
+
var TAG41 = "[portal-fetch]";
|
|
25392
25711
|
async function verifySignature(secret, accountId, relPath, expiresAtMs, signature, nowMs) {
|
|
25393
25712
|
if (!secret || !signature) return false;
|
|
25394
25713
|
if (!Number.isFinite(expiresAtMs) || expiresAtMs <= nowMs) return false;
|
|
@@ -25438,19 +25757,19 @@ ${expiresAtMs}`)
|
|
|
25438
25757
|
return diff === 0;
|
|
25439
25758
|
}
|
|
25440
25759
|
async function readAccountSecret(accountId) {
|
|
25441
|
-
const path =
|
|
25760
|
+
const path = resolve36(DATA_ROOT, "accounts", accountId, "secrets", "data-portal.env");
|
|
25442
25761
|
let text;
|
|
25443
25762
|
try {
|
|
25444
25763
|
text = await readFile11(path, "utf8");
|
|
25445
25764
|
} catch {
|
|
25446
|
-
console.error(`${
|
|
25765
|
+
console.error(`${TAG41} op=no-secret account="${accountId}" path="${path}"`);
|
|
25447
25766
|
return "";
|
|
25448
25767
|
}
|
|
25449
25768
|
for (const line of text.split("\n")) {
|
|
25450
25769
|
const m = line.match(/^PORTAL_FETCH_SECRET=(.*)$/);
|
|
25451
25770
|
if (m) return m[1].trim();
|
|
25452
25771
|
}
|
|
25453
|
-
console.error(`${
|
|
25772
|
+
console.error(`${TAG41} op=no-secret account="${accountId}" reason=key-absent path="${path}"`);
|
|
25454
25773
|
return "";
|
|
25455
25774
|
}
|
|
25456
25775
|
function isValidAccountId2(value) {
|
|
@@ -25474,7 +25793,7 @@ async function resolveFetchTarget(accountDir, relPath, ownerId) {
|
|
|
25474
25793
|
const exposeFolders = await readExposeFolders2(accountDir);
|
|
25475
25794
|
const { exposed } = resolveExposedDirs(schemaText, exposeFolders);
|
|
25476
25795
|
if (exposed.length === 0 && !ownerId) return { ok: false, reason: "not-exposed" };
|
|
25477
|
-
const lexical =
|
|
25796
|
+
const lexical = resolve36(accountDir, relPath);
|
|
25478
25797
|
let root;
|
|
25479
25798
|
let absolute;
|
|
25480
25799
|
try {
|
|
@@ -25510,33 +25829,33 @@ async function handle(c, headOnly) {
|
|
|
25510
25829
|
const sig = c.req.query("sig") ?? "";
|
|
25511
25830
|
const owner = c.req.query("owner") ?? "";
|
|
25512
25831
|
console.log(
|
|
25513
|
-
`${
|
|
25832
|
+
`${TAG41} op=request account=${q(accountId)} path=${q(relPath)} owner=${q(owner)} head=${headOnly}`
|
|
25514
25833
|
);
|
|
25515
25834
|
if (!isValidAccountId2(accountId)) {
|
|
25516
|
-
console.error(`${
|
|
25835
|
+
console.error(`${TAG41} op=denied account=${q(accountId)} reason=account-id`);
|
|
25517
25836
|
return c.json({ ok: false, error: "denied" }, 401);
|
|
25518
25837
|
}
|
|
25519
25838
|
const secret = await readAccountSecret(accountId);
|
|
25520
25839
|
const verified = owner ? await verifyOwnUploadSignature(secret, accountId, owner, relPath, exp, sig, Date.now()) : await verifySignature(secret, accountId, relPath, exp, sig, Date.now());
|
|
25521
25840
|
if (!verified) {
|
|
25522
|
-
console.error(`${
|
|
25841
|
+
console.error(`${TAG41} op=denied account=${q(accountId)} reason=secret`);
|
|
25523
25842
|
return c.json({ ok: false, error: "denied" }, 401);
|
|
25524
25843
|
}
|
|
25525
25844
|
const target = await resolveFetchTarget(
|
|
25526
|
-
|
|
25845
|
+
resolve36(DATA_ROOT, "accounts", accountId),
|
|
25527
25846
|
relPath,
|
|
25528
25847
|
owner || void 0
|
|
25529
25848
|
);
|
|
25530
25849
|
if (!target.ok) {
|
|
25531
25850
|
const op = target.reason === "enoent" ? "miss" : "denied";
|
|
25532
|
-
console.error(`${
|
|
25851
|
+
console.error(`${TAG41} op=${op} account=${accountId} reason=${target.reason}`);
|
|
25533
25852
|
return c.json({ ok: false, error: "not found" }, 404);
|
|
25534
25853
|
}
|
|
25535
25854
|
if (headOnly) {
|
|
25536
|
-
console.log(`${
|
|
25855
|
+
console.log(`${TAG41} op=served account=${accountId} bytes=${target.sizeBytes} head=true`);
|
|
25537
25856
|
return c.body(null, 200);
|
|
25538
25857
|
}
|
|
25539
|
-
console.log(`${
|
|
25858
|
+
console.log(`${TAG41} op=served account=${accountId} bytes=${target.sizeBytes}`);
|
|
25540
25859
|
return new Response(Readable3.toWeb(createReadStream3(target.absolute)), {
|
|
25541
25860
|
status: 200,
|
|
25542
25861
|
headers: {
|
|
@@ -25550,12 +25869,12 @@ async function handle(c, headOnly) {
|
|
|
25550
25869
|
}
|
|
25551
25870
|
});
|
|
25552
25871
|
}
|
|
25553
|
-
|
|
25554
|
-
|
|
25555
|
-
var portal_fetch_default =
|
|
25872
|
+
app74.get("/fetch", (c) => handle(c, false));
|
|
25873
|
+
app74.on("HEAD", "/fetch", (c) => handle(c, true));
|
|
25874
|
+
var portal_fetch_default = app74;
|
|
25556
25875
|
|
|
25557
25876
|
// app/lib/timeentry-census.ts
|
|
25558
|
-
var
|
|
25877
|
+
var TAG42 = "[timeentry-census]";
|
|
25559
25878
|
function reconcileTimeEntries(rows, now, horizonMs) {
|
|
25560
25879
|
const openEntries = rows.openEntries.length;
|
|
25561
25880
|
let oldestOpenAgeMs = 0;
|
|
@@ -25595,12 +25914,12 @@ async function runTimeEntryCensusOnce(session, now, horizonMs) {
|
|
|
25595
25914
|
sumAdjustments: toNum(r.get("sumAdjustments"))
|
|
25596
25915
|
}));
|
|
25597
25916
|
const finding = reconcileTimeEntries({ openEntries, taskSums }, now, horizonMs);
|
|
25598
|
-
const line = `${
|
|
25917
|
+
const line = `${TAG42} openEntries=${finding.openEntries} oldestOpenAgeMin=${finding.oldestOpenAgeMin} maxOpenPerAccount=${finding.maxOpenPerAccount} driftTasks=${finding.driftTasks}`;
|
|
25599
25918
|
if (finding.alarm) console.error(`${line} alarm=true`);
|
|
25600
25919
|
else console.log(line);
|
|
25601
25920
|
return finding;
|
|
25602
25921
|
} catch (err) {
|
|
25603
|
-
console.error(`${
|
|
25922
|
+
console.error(`${TAG42} error="${err instanceof Error ? err.message : String(err)}"`);
|
|
25604
25923
|
return null;
|
|
25605
25924
|
}
|
|
25606
25925
|
}
|
|
@@ -25614,13 +25933,13 @@ function startTimeEntryCensus(openSession, opts = {}) {
|
|
|
25614
25933
|
try {
|
|
25615
25934
|
session = openSession();
|
|
25616
25935
|
} catch (err) {
|
|
25617
|
-
console.error(`${
|
|
25936
|
+
console.error(`${TAG42} open-session-failed error="${err instanceof Error ? err.message : String(err)}"`);
|
|
25618
25937
|
return;
|
|
25619
25938
|
}
|
|
25620
25939
|
try {
|
|
25621
25940
|
await runTimeEntryCensusOnce(session, Date.now(), horizonMs);
|
|
25622
25941
|
} catch (err) {
|
|
25623
|
-
console.error(`${
|
|
25942
|
+
console.error(`${TAG42} tick-failed error="${err instanceof Error ? err.message : String(err)}"`);
|
|
25624
25943
|
} finally {
|
|
25625
25944
|
try {
|
|
25626
25945
|
await session.close();
|
|
@@ -25637,7 +25956,7 @@ function startTimeEntryCensus(openSession, opts = {}) {
|
|
|
25637
25956
|
}
|
|
25638
25957
|
|
|
25639
25958
|
// app/lib/ledger-census.ts
|
|
25640
|
-
import { readdirSync as readdirSync27, readFileSync as
|
|
25959
|
+
import { readdirSync as readdirSync27, readFileSync as readFileSync42, statSync as statSync23 } from "fs";
|
|
25641
25960
|
import { join as join49 } from "path";
|
|
25642
25961
|
|
|
25643
25962
|
// ../lib/ledger-core/dist/reconcile.js
|
|
@@ -25681,7 +26000,7 @@ function formatCensusLine(f) {
|
|
|
25681
26000
|
}
|
|
25682
26001
|
|
|
25683
26002
|
// app/lib/ledger-census.ts
|
|
25684
|
-
var
|
|
26003
|
+
var TAG43 = "[ledger-census]";
|
|
25685
26004
|
var DAY_MS = 864e5;
|
|
25686
26005
|
function countWriteRejects24h(logDir, now) {
|
|
25687
26006
|
let entries2;
|
|
@@ -25695,7 +26014,7 @@ function countWriteRejects24h(logDir, now) {
|
|
|
25695
26014
|
const path = join49(logDir, name);
|
|
25696
26015
|
try {
|
|
25697
26016
|
if (now - statSync23(path).mtimeMs > DAY_MS) continue;
|
|
25698
|
-
for (const line of
|
|
26017
|
+
for (const line of readFileSync42(path, "utf8").split("\n")) {
|
|
25699
26018
|
if (line.includes("[graph-write] reject")) total += 1;
|
|
25700
26019
|
}
|
|
25701
26020
|
} catch {
|
|
@@ -25757,7 +26076,7 @@ async function runLedgerCensusOnce(session, now) {
|
|
|
25757
26076
|
else console.log(line);
|
|
25758
26077
|
return finding;
|
|
25759
26078
|
} catch (err) {
|
|
25760
|
-
console.error(`${
|
|
26079
|
+
console.error(`${TAG43} error="${err instanceof Error ? err.message : String(err)}"`);
|
|
25761
26080
|
return null;
|
|
25762
26081
|
}
|
|
25763
26082
|
}
|
|
@@ -25770,7 +26089,7 @@ function startLedgerCensus(openSession, opts = {}) {
|
|
|
25770
26089
|
session = openSession();
|
|
25771
26090
|
} catch (err) {
|
|
25772
26091
|
console.error(
|
|
25773
|
-
`${
|
|
26092
|
+
`${TAG43} open-session-failed error="${err instanceof Error ? err.message : String(err)}"`
|
|
25774
26093
|
);
|
|
25775
26094
|
return;
|
|
25776
26095
|
}
|
|
@@ -25778,7 +26097,7 @@ function startLedgerCensus(openSession, opts = {}) {
|
|
|
25778
26097
|
await runLedgerCensusOnce(session, Date.now());
|
|
25779
26098
|
} catch (err) {
|
|
25780
26099
|
console.error(
|
|
25781
|
-
`${
|
|
26100
|
+
`${TAG43} tick-failed error="${err instanceof Error ? err.message : String(err)}"`
|
|
25782
26101
|
);
|
|
25783
26102
|
} finally {
|
|
25784
26103
|
try {
|
|
@@ -25796,7 +26115,7 @@ function startLedgerCensus(openSession, opts = {}) {
|
|
|
25796
26115
|
}
|
|
25797
26116
|
|
|
25798
26117
|
// app/lib/conversation-audit.ts
|
|
25799
|
-
var
|
|
26118
|
+
var TAG44 = "[conversation-audit]";
|
|
25800
26119
|
async function runConversationAudit() {
|
|
25801
26120
|
const session = getSession();
|
|
25802
26121
|
try {
|
|
@@ -25833,12 +26152,12 @@ async function runConversationAudit() {
|
|
|
25833
26152
|
multiAnchored: Number(multiRec?.get("multiAnchored") ?? 0)
|
|
25834
26153
|
};
|
|
25835
26154
|
console.error(
|
|
25836
|
-
`${
|
|
26155
|
+
`${TAG44} channel=whatsapp total=${result.total} senders=${result.senders} multiAnchored=${result.multiAnchored} unreconciled=${result.unreconciled} unpairable=${result.unpairable}`
|
|
25837
26156
|
);
|
|
25838
26157
|
return result;
|
|
25839
26158
|
} catch (err) {
|
|
25840
26159
|
const reason = err instanceof Error ? `${err.name}:${err.message.slice(0, 200)}` : String(err).slice(0, 200);
|
|
25841
|
-
console.error(`${
|
|
26160
|
+
console.error(`${TAG44} op=failed reason=${reason}`);
|
|
25842
26161
|
return null;
|
|
25843
26162
|
} finally {
|
|
25844
26163
|
await session.close();
|
|
@@ -25964,7 +26283,7 @@ function startGraphHealthTimer() {
|
|
|
25964
26283
|
|
|
25965
26284
|
// app/lib/file-watcher.ts
|
|
25966
26285
|
import * as fsp2 from "fs/promises";
|
|
25967
|
-
import { resolve as
|
|
26286
|
+
import { resolve as resolve37, sep as sep12 } from "path";
|
|
25968
26287
|
var ACCOUNT_UUID_RE3 = /^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i;
|
|
25969
26288
|
var DEFAULT_COALESCE_MS = 500;
|
|
25970
26289
|
var ROOTS = ["accounts"];
|
|
@@ -25983,7 +26302,7 @@ async function startFileWatcher(opts = {}) {
|
|
|
25983
26302
|
const dropFn = opts.drop ?? dropFileIndex;
|
|
25984
26303
|
for (const r of ROOTS) {
|
|
25985
26304
|
try {
|
|
25986
|
-
await fsp2.mkdir(
|
|
26305
|
+
await fsp2.mkdir(resolve37(dataRoot, r), { recursive: true });
|
|
25987
26306
|
} catch (err) {
|
|
25988
26307
|
console.error(
|
|
25989
26308
|
`[file-watcher] start-failed root="${r}" err="${err.message}" \u2014 index will be maintained by the 5-min reconcile backstop only`
|
|
@@ -26004,7 +26323,7 @@ async function startFileWatcher(opts = {}) {
|
|
|
26004
26323
|
timers.set(relativePath, t);
|
|
26005
26324
|
}
|
|
26006
26325
|
async function runHook(relativePath, accountId) {
|
|
26007
|
-
const absolute =
|
|
26326
|
+
const absolute = resolve37(dataRoot, relativePath);
|
|
26008
26327
|
let exists = false;
|
|
26009
26328
|
try {
|
|
26010
26329
|
const st = await fsp2.stat(absolute);
|
|
@@ -26028,7 +26347,7 @@ async function startFileWatcher(opts = {}) {
|
|
|
26028
26347
|
}
|
|
26029
26348
|
}
|
|
26030
26349
|
async function watchRoot(rootName) {
|
|
26031
|
-
const absRoot =
|
|
26350
|
+
const absRoot = resolve37(dataRoot, rootName);
|
|
26032
26351
|
try {
|
|
26033
26352
|
const iter = fsp2.watch(absRoot, { recursive: true, signal: controller.signal });
|
|
26034
26353
|
for await (const event of iter) {
|
|
@@ -26067,7 +26386,7 @@ async function startFileWatcher(opts = {}) {
|
|
|
26067
26386
|
|
|
26068
26387
|
// app/lib/migrate-uploads.ts
|
|
26069
26388
|
import { mkdir as mkdir4, readdir as readdir6, rename as rename4, rm as rm3 } from "fs/promises";
|
|
26070
|
-
import { dirname as dirname16, relative as relative8, resolve as
|
|
26389
|
+
import { dirname as dirname16, relative as relative8, resolve as resolve38 } from "path";
|
|
26071
26390
|
var ACCOUNT_UUID_RE4 = /^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i;
|
|
26072
26391
|
async function walkFiles(dir) {
|
|
26073
26392
|
const out = [];
|
|
@@ -26078,7 +26397,7 @@ async function walkFiles(dir) {
|
|
|
26078
26397
|
return out;
|
|
26079
26398
|
}
|
|
26080
26399
|
for (const e of entries2) {
|
|
26081
|
-
const abs =
|
|
26400
|
+
const abs = resolve38(dir, e.name);
|
|
26082
26401
|
if (e.isDirectory()) {
|
|
26083
26402
|
out.push(...await walkFiles(abs));
|
|
26084
26403
|
} else if (e.isFile()) {
|
|
@@ -26098,7 +26417,7 @@ async function relocateTree(srcDir, destDir, dataRoot, accountId, session) {
|
|
|
26098
26417
|
let moved = 0;
|
|
26099
26418
|
for (const oldAbs of files) {
|
|
26100
26419
|
const suffix = relative8(srcDir, oldAbs);
|
|
26101
|
-
const newAbs =
|
|
26420
|
+
const newAbs = resolve38(destDir, suffix);
|
|
26102
26421
|
await mkdir4(dirname16(newAbs), { recursive: true });
|
|
26103
26422
|
await rename4(oldAbs, newAbs);
|
|
26104
26423
|
moved++;
|
|
@@ -26125,7 +26444,7 @@ async function relocateTree(srcDir, destDir, dataRoot, accountId, session) {
|
|
|
26125
26444
|
}
|
|
26126
26445
|
async function migrateUploads(opts = {}) {
|
|
26127
26446
|
const dataRoot = opts.dataRoot ?? DATA_ROOT;
|
|
26128
|
-
const oldRoot =
|
|
26447
|
+
const oldRoot = resolve38(dataRoot, "uploads");
|
|
26129
26448
|
let topEntries;
|
|
26130
26449
|
try {
|
|
26131
26450
|
topEntries = await readdir6(oldRoot, { withFileTypes: true });
|
|
@@ -26146,8 +26465,8 @@ async function migrateUploads(opts = {}) {
|
|
|
26146
26465
|
const name = entry.name;
|
|
26147
26466
|
if (ACCOUNT_UUID_RE4.test(name)) {
|
|
26148
26467
|
moved += await relocateTree(
|
|
26149
|
-
|
|
26150
|
-
|
|
26468
|
+
resolve38(oldRoot, name),
|
|
26469
|
+
resolve38(dataRoot, "accounts", name, "uploads"),
|
|
26151
26470
|
dataRoot,
|
|
26152
26471
|
name,
|
|
26153
26472
|
session
|
|
@@ -26159,8 +26478,8 @@ async function migrateUploads(opts = {}) {
|
|
|
26159
26478
|
continue;
|
|
26160
26479
|
}
|
|
26161
26480
|
moved += await relocateTree(
|
|
26162
|
-
|
|
26163
|
-
|
|
26481
|
+
resolve38(oldRoot, "public"),
|
|
26482
|
+
resolve38(dataRoot, "accounts", installAccountId, "uploads", "public"),
|
|
26164
26483
|
dataRoot,
|
|
26165
26484
|
null,
|
|
26166
26485
|
// public uploads carry no graph nodes
|
|
@@ -26732,8 +27051,8 @@ var streamSSE = (c, cb, onError) => {
|
|
|
26732
27051
|
|
|
26733
27052
|
// app/lib/whatsapp/gateway/routes.ts
|
|
26734
27053
|
function createWaChannelRoutes(deps) {
|
|
26735
|
-
const
|
|
26736
|
-
|
|
27054
|
+
const app76 = new Hono();
|
|
27055
|
+
app76.get("/wa-channel/inbound", (c) => {
|
|
26737
27056
|
const senderId = c.req.query("senderId");
|
|
26738
27057
|
if (!senderId) return c.json({ error: "senderId required" }, 400);
|
|
26739
27058
|
return streamSSE(c, async (stream2) => {
|
|
@@ -26751,7 +27070,7 @@ function createWaChannelRoutes(deps) {
|
|
|
26751
27070
|
}
|
|
26752
27071
|
});
|
|
26753
27072
|
});
|
|
26754
|
-
|
|
27073
|
+
app76.post("/wa-channel/reply", async (c) => {
|
|
26755
27074
|
const body = await c.req.json().catch(() => null);
|
|
26756
27075
|
const senderId = body?.senderId;
|
|
26757
27076
|
const text = body?.text;
|
|
@@ -26773,7 +27092,7 @@ function createWaChannelRoutes(deps) {
|
|
|
26773
27092
|
deps.onReplyDispatch?.(senderId, Date.now());
|
|
26774
27093
|
return c.json({ ok: true });
|
|
26775
27094
|
});
|
|
26776
|
-
|
|
27095
|
+
app76.post("/wa-channel/reply-document", async (c) => {
|
|
26777
27096
|
const body = await c.req.json().catch(() => null);
|
|
26778
27097
|
const senderId = body?.senderId;
|
|
26779
27098
|
const files = body?.files;
|
|
@@ -26812,7 +27131,7 @@ function createWaChannelRoutes(deps) {
|
|
|
26812
27131
|
}
|
|
26813
27132
|
return c.json({ ok: true, results });
|
|
26814
27133
|
});
|
|
26815
|
-
|
|
27134
|
+
app76.post("/wa-channel/ready", async (c) => {
|
|
26816
27135
|
const body = await c.req.json().catch(() => null);
|
|
26817
27136
|
const senderId = body?.senderId;
|
|
26818
27137
|
if (typeof senderId !== "string") {
|
|
@@ -26821,7 +27140,7 @@ function createWaChannelRoutes(deps) {
|
|
|
26821
27140
|
deps.onReady?.(senderId);
|
|
26822
27141
|
return c.json({ ok: true });
|
|
26823
27142
|
});
|
|
26824
|
-
|
|
27143
|
+
app76.post("/wa-channel/received", async (c) => {
|
|
26825
27144
|
const body = await c.req.json().catch(() => null);
|
|
26826
27145
|
const senderId = body?.senderId;
|
|
26827
27146
|
const waMessageId = body?.waMessageId;
|
|
@@ -26831,7 +27150,7 @@ function createWaChannelRoutes(deps) {
|
|
|
26831
27150
|
deps.onReceived?.(senderId, waMessageId);
|
|
26832
27151
|
return c.json({ ok: true });
|
|
26833
27152
|
});
|
|
26834
|
-
|
|
27153
|
+
app76.post("/wa-channel/turn-end", async (c) => {
|
|
26835
27154
|
const body = await c.req.json().catch(() => null);
|
|
26836
27155
|
const senderId = body?.senderId;
|
|
26837
27156
|
const sessionId = body?.sessionId;
|
|
@@ -26877,7 +27196,7 @@ function createWaChannelRoutes(deps) {
|
|
|
26877
27196
|
console.error(`[whatsapp-native] op=turn-end ${decision} delivered=none`);
|
|
26878
27197
|
return c.json({ ok: true, delivered: "none" });
|
|
26879
27198
|
});
|
|
26880
|
-
return
|
|
27199
|
+
return app76;
|
|
26881
27200
|
}
|
|
26882
27201
|
|
|
26883
27202
|
// app/lib/whatsapp/gateway/wa-gateway.ts
|
|
@@ -27386,8 +27705,8 @@ var InboundHub2 = class {
|
|
|
27386
27705
|
|
|
27387
27706
|
// app/lib/webchat/gateway/routes.ts
|
|
27388
27707
|
function createWebchatChannelRoutes(deps) {
|
|
27389
|
-
const
|
|
27390
|
-
|
|
27708
|
+
const app76 = new Hono();
|
|
27709
|
+
app76.get("/webchat-channel/inbound", (c) => {
|
|
27391
27710
|
const key = c.req.query("key");
|
|
27392
27711
|
if (!key) return c.json({ error: "key required" }, 400);
|
|
27393
27712
|
const role = c.req.query("role");
|
|
@@ -27412,7 +27731,7 @@ function createWebchatChannelRoutes(deps) {
|
|
|
27412
27731
|
}
|
|
27413
27732
|
});
|
|
27414
27733
|
});
|
|
27415
|
-
|
|
27734
|
+
app76.post("/webchat-channel/reply", async (c) => {
|
|
27416
27735
|
const body = await c.req.json().catch(() => null);
|
|
27417
27736
|
const key = body?.key;
|
|
27418
27737
|
const text = body?.text;
|
|
@@ -27422,7 +27741,7 @@ function createWebchatChannelRoutes(deps) {
|
|
|
27422
27741
|
deps.onReply?.(key, text);
|
|
27423
27742
|
return c.json({ ok: true });
|
|
27424
27743
|
});
|
|
27425
|
-
|
|
27744
|
+
app76.post("/webchat-channel/connector-auth", async (c) => {
|
|
27426
27745
|
const body = await c.req.json().catch(() => null);
|
|
27427
27746
|
const key = body?.key;
|
|
27428
27747
|
const sessionId = body?.sessionId;
|
|
@@ -27435,7 +27754,7 @@ function createWebchatChannelRoutes(deps) {
|
|
|
27435
27754
|
const result = await deps.onConnectorAuth({ key, sessionId, name, completed });
|
|
27436
27755
|
return c.json(result);
|
|
27437
27756
|
});
|
|
27438
|
-
|
|
27757
|
+
app76.post("/webchat-channel/ready", async (c) => {
|
|
27439
27758
|
const body = await c.req.json().catch(() => null);
|
|
27440
27759
|
const key = body?.key;
|
|
27441
27760
|
if (typeof key !== "string") {
|
|
@@ -27444,7 +27763,7 @@ function createWebchatChannelRoutes(deps) {
|
|
|
27444
27763
|
deps.onReady?.(key);
|
|
27445
27764
|
return c.json({ ok: true });
|
|
27446
27765
|
});
|
|
27447
|
-
|
|
27766
|
+
app76.post("/webchat-channel/permission-request", async (c) => {
|
|
27448
27767
|
const body = await c.req.json().catch(() => null);
|
|
27449
27768
|
const key = body?.key;
|
|
27450
27769
|
const requestId = body?.request_id;
|
|
@@ -27458,7 +27777,7 @@ function createWebchatChannelRoutes(deps) {
|
|
|
27458
27777
|
const verdict = await deps.awaitPermissionVerdict({ key, requestId, toolName, description, inputPreview });
|
|
27459
27778
|
return c.json(verdict);
|
|
27460
27779
|
});
|
|
27461
|
-
|
|
27780
|
+
app76.post("/webchat-channel/received", async (c) => {
|
|
27462
27781
|
const body = await c.req.json().catch(() => null);
|
|
27463
27782
|
const key = body?.key;
|
|
27464
27783
|
const messageId = body?.messageId;
|
|
@@ -27468,7 +27787,7 @@ function createWebchatChannelRoutes(deps) {
|
|
|
27468
27787
|
deps.onReceived?.(key, messageId);
|
|
27469
27788
|
return c.json({ ok: true });
|
|
27470
27789
|
});
|
|
27471
|
-
|
|
27790
|
+
app76.post("/webchat-channel/turn-end", async (c) => {
|
|
27472
27791
|
const body = await c.req.json().catch(() => null);
|
|
27473
27792
|
const key = body?.key;
|
|
27474
27793
|
const sessionId = body?.sessionId;
|
|
@@ -27488,7 +27807,7 @@ function createWebchatChannelRoutes(deps) {
|
|
|
27488
27807
|
deps.onTurnEnd?.(key, role);
|
|
27489
27808
|
return c.json({ ok: true });
|
|
27490
27809
|
});
|
|
27491
|
-
return
|
|
27810
|
+
return app76;
|
|
27492
27811
|
}
|
|
27493
27812
|
|
|
27494
27813
|
// app/lib/webchat/gateway/webchat-gateway.ts
|
|
@@ -27546,16 +27865,16 @@ var WebchatGateway = class _WebchatGateway {
|
|
|
27546
27865
|
* The public /api/chat route awaits this to return the reply on the same SSE
|
|
27547
27866
|
* response, preserving the pre-756 POST→single-blob browser contract. */
|
|
27548
27867
|
awaitReply(key, timeoutMs) {
|
|
27549
|
-
return new Promise((
|
|
27868
|
+
return new Promise((resolve44) => {
|
|
27550
27869
|
const timer = setTimeout(() => {
|
|
27551
27870
|
this.replyAwaiters.delete(key);
|
|
27552
|
-
|
|
27871
|
+
resolve44({ timeout: true });
|
|
27553
27872
|
}, timeoutMs);
|
|
27554
27873
|
if (timer.unref) timer.unref();
|
|
27555
27874
|
this.replyAwaiters.set(key, (r) => {
|
|
27556
27875
|
clearTimeout(timer);
|
|
27557
27876
|
this.replyAwaiters.delete(key);
|
|
27558
|
-
|
|
27877
|
+
resolve44(r);
|
|
27559
27878
|
});
|
|
27560
27879
|
});
|
|
27561
27880
|
}
|
|
@@ -27566,11 +27885,11 @@ var WebchatGateway = class _WebchatGateway {
|
|
|
27566
27885
|
* terminal dialog stays answerable). */
|
|
27567
27886
|
awaitPermissionVerdict(p, timeoutMs) {
|
|
27568
27887
|
const k = _WebchatGateway.promptKey(p.key, p.requestId);
|
|
27569
|
-
return new Promise((
|
|
27888
|
+
return new Promise((resolve44) => {
|
|
27570
27889
|
this.pendingPrompts.get(k)?.resolve({ timeout: true });
|
|
27571
27890
|
const timer = setTimeout(() => {
|
|
27572
27891
|
this.pendingPrompts.delete(k);
|
|
27573
|
-
|
|
27892
|
+
resolve44({ timeout: true });
|
|
27574
27893
|
}, timeoutMs);
|
|
27575
27894
|
if (timer.unref) timer.unref();
|
|
27576
27895
|
this.pendingPrompts.set(k, {
|
|
@@ -27580,7 +27899,7 @@ var WebchatGateway = class _WebchatGateway {
|
|
|
27580
27899
|
clearTimeout(timer);
|
|
27581
27900
|
this.pendingPrompts.delete(k);
|
|
27582
27901
|
this.deps.onPointerChange?.(p.key);
|
|
27583
|
-
|
|
27902
|
+
resolve44(r);
|
|
27584
27903
|
}
|
|
27585
27904
|
});
|
|
27586
27905
|
console.error(`[webchat:perm] op=open key=${keyDisplay(p.key)} id=${p.requestId} tool=${p.toolName}`);
|
|
@@ -28156,7 +28475,7 @@ async function fanOut(subscribers, text, onError, tag) {
|
|
|
28156
28475
|
|
|
28157
28476
|
// app/lib/webchat/file-delivery.ts
|
|
28158
28477
|
import { realpathSync as realpathSync9 } from "fs";
|
|
28159
|
-
import { resolve as
|
|
28478
|
+
import { resolve as resolve39 } from "path";
|
|
28160
28479
|
|
|
28161
28480
|
// app/lib/channel-pty-bridge/file-delivery.ts
|
|
28162
28481
|
var SEND_USER_FILE = "SendUserFile";
|
|
@@ -28247,29 +28566,29 @@ function makeFileDelivery(opts) {
|
|
|
28247
28566
|
}
|
|
28248
28567
|
|
|
28249
28568
|
// app/lib/webchat/file-delivery.ts
|
|
28250
|
-
var
|
|
28569
|
+
var TAG45 = "[webchat-adaptor]";
|
|
28251
28570
|
function platformRoot2() {
|
|
28252
28571
|
return process.env.MAXY_PLATFORM_ROOT || "";
|
|
28253
28572
|
}
|
|
28254
28573
|
function makeWebchatSendFile(entry) {
|
|
28255
28574
|
return async (filePath) => {
|
|
28256
28575
|
if (!entry.accountId) {
|
|
28257
|
-
console.error(`${
|
|
28576
|
+
console.error(`${TAG45} file-delivery reject reason=no-account sender=${entry.senderId}`);
|
|
28258
28577
|
return { ok: false, error: "no-account" };
|
|
28259
28578
|
}
|
|
28260
|
-
const accountDir =
|
|
28579
|
+
const accountDir = resolve39(platformRoot2(), "..", "data/accounts", entry.accountId);
|
|
28261
28580
|
try {
|
|
28262
28581
|
const resolved = realpathSync9(filePath);
|
|
28263
28582
|
const accountResolved = realpathSync9(accountDir);
|
|
28264
28583
|
if (!resolved.startsWith(accountResolved + "/")) {
|
|
28265
|
-
console.error(`${
|
|
28584
|
+
console.error(`${TAG45} file-delivery reject reason=outside_account_directory sender=${entry.senderId}`);
|
|
28266
28585
|
return { ok: false, error: "outside-account" };
|
|
28267
28586
|
}
|
|
28268
28587
|
return { ok: true };
|
|
28269
28588
|
} catch (err) {
|
|
28270
28589
|
const code = err.code;
|
|
28271
28590
|
console.error(
|
|
28272
|
-
`${
|
|
28591
|
+
`${TAG45} file-delivery reject reason=${code === "ENOENT" ? "not-found" : "path-error"} sender=${entry.senderId}`
|
|
28273
28592
|
);
|
|
28274
28593
|
return { ok: false, error: code === "ENOENT" ? "not-found" : "path-error" };
|
|
28275
28594
|
}
|
|
@@ -28278,7 +28597,7 @@ function makeWebchatSendFile(entry) {
|
|
|
28278
28597
|
function makeWebchatFileDelivery(entry) {
|
|
28279
28598
|
return makeFileDelivery({
|
|
28280
28599
|
entry,
|
|
28281
|
-
tag:
|
|
28600
|
+
tag: TAG45,
|
|
28282
28601
|
channel: "webchat",
|
|
28283
28602
|
sendFile: makeWebchatSendFile(entry),
|
|
28284
28603
|
deferUntilVerdict: true
|
|
@@ -28340,7 +28659,7 @@ function buildPublicWebchatSpawnRequest(input) {
|
|
|
28340
28659
|
}
|
|
28341
28660
|
|
|
28342
28661
|
// app/lib/whatsapp/inbound/file-delivery-bridge.ts
|
|
28343
|
-
var
|
|
28662
|
+
var TAG46 = "[whatsapp-adaptor]";
|
|
28344
28663
|
var SEND_USER_FILE2 = "SendUserFile";
|
|
28345
28664
|
var WHATSAPP_SEND_DOCUMENT = "whatsapp-send-document";
|
|
28346
28665
|
function platformRoot3() {
|
|
@@ -28358,7 +28677,7 @@ function makeWhatsAppSendFile(entry, maxyAccountId) {
|
|
|
28358
28677
|
});
|
|
28359
28678
|
if (result.ok) return { ok: true };
|
|
28360
28679
|
console.error(
|
|
28361
|
-
`${
|
|
28680
|
+
`${TAG46} file-delivery reject reason=send-failed sender=${entry.senderId} status=${result.status} message=${result.error}`
|
|
28362
28681
|
);
|
|
28363
28682
|
return { ok: false, error: result.error };
|
|
28364
28683
|
};
|
|
@@ -28366,7 +28685,7 @@ function makeWhatsAppSendFile(entry, maxyAccountId) {
|
|
|
28366
28685
|
function makeWhatsAppFileDelivery(entry, maxyAccountId) {
|
|
28367
28686
|
const shared = makeFileDelivery({
|
|
28368
28687
|
entry,
|
|
28369
|
-
tag:
|
|
28688
|
+
tag: TAG46,
|
|
28370
28689
|
channel: "whatsapp",
|
|
28371
28690
|
sendFile: makeWhatsAppSendFile(entry, maxyAccountId)
|
|
28372
28691
|
});
|
|
@@ -28401,7 +28720,7 @@ function makeWhatsAppFileDelivery(entry, maxyAccountId) {
|
|
|
28401
28720
|
if (!delivered) {
|
|
28402
28721
|
const fileField = call.filePath !== void 0 ? ` file=${call.filePath}` : "";
|
|
28403
28722
|
console.error(
|
|
28404
|
-
`${
|
|
28723
|
+
`${TAG46} file-delivery-unreconciled sender=${entry.senderId} sessionId=${sid} tool=${WHATSAPP_SEND_DOCUMENT}${fileField}`
|
|
28405
28724
|
);
|
|
28406
28725
|
}
|
|
28407
28726
|
}
|
|
@@ -28584,8 +28903,8 @@ var InboundHub3 = class {
|
|
|
28584
28903
|
|
|
28585
28904
|
// app/lib/telegram/gateway/routes.ts
|
|
28586
28905
|
function createTelegramChannelRoutes(deps) {
|
|
28587
|
-
const
|
|
28588
|
-
|
|
28906
|
+
const app76 = new Hono();
|
|
28907
|
+
app76.get("/tg-channel/inbound", (c) => {
|
|
28589
28908
|
const key = c.req.query("key");
|
|
28590
28909
|
if (!key) return c.json({ error: "key required" }, 400);
|
|
28591
28910
|
return streamSSE(c, async (stream2) => {
|
|
@@ -28603,7 +28922,7 @@ function createTelegramChannelRoutes(deps) {
|
|
|
28603
28922
|
}
|
|
28604
28923
|
});
|
|
28605
28924
|
});
|
|
28606
|
-
|
|
28925
|
+
app76.post("/tg-channel/reply", async (c) => {
|
|
28607
28926
|
const body = await c.req.json().catch(() => null);
|
|
28608
28927
|
const key = body?.key;
|
|
28609
28928
|
const text = body?.text;
|
|
@@ -28619,7 +28938,7 @@ function createTelegramChannelRoutes(deps) {
|
|
|
28619
28938
|
console.error(`[telegram-native] op=reply key=${key} bytes=${Buffer.byteLength(text, "utf8")}`);
|
|
28620
28939
|
return c.json({ ok: true });
|
|
28621
28940
|
});
|
|
28622
|
-
|
|
28941
|
+
app76.post("/tg-channel/ready", async (c) => {
|
|
28623
28942
|
const body = await c.req.json().catch(() => null);
|
|
28624
28943
|
const key = body?.key;
|
|
28625
28944
|
if (typeof key !== "string") {
|
|
@@ -28628,7 +28947,7 @@ function createTelegramChannelRoutes(deps) {
|
|
|
28628
28947
|
deps.onReady?.(key);
|
|
28629
28948
|
return c.json({ ok: true });
|
|
28630
28949
|
});
|
|
28631
|
-
|
|
28950
|
+
app76.post("/tg-channel/received", async (c) => {
|
|
28632
28951
|
const body = await c.req.json().catch(() => null);
|
|
28633
28952
|
const key = body?.key;
|
|
28634
28953
|
const messageId = body?.messageId;
|
|
@@ -28638,7 +28957,7 @@ function createTelegramChannelRoutes(deps) {
|
|
|
28638
28957
|
deps.onReceived?.(key, messageId);
|
|
28639
28958
|
return c.json({ ok: true });
|
|
28640
28959
|
});
|
|
28641
|
-
|
|
28960
|
+
app76.post("/tg-channel/turn-end", async (c) => {
|
|
28642
28961
|
const body = await c.req.json().catch(() => null);
|
|
28643
28962
|
const key = body?.key;
|
|
28644
28963
|
const sessionId = body?.sessionId;
|
|
@@ -28671,7 +28990,7 @@ function createTelegramChannelRoutes(deps) {
|
|
|
28671
28990
|
console.error(`[telegram-native] op=turn-end key=${key} sessionId=${sid} replied=no delivered=none`);
|
|
28672
28991
|
return c.json({ ok: true, delivered: "none" });
|
|
28673
28992
|
});
|
|
28674
|
-
return
|
|
28993
|
+
return app76;
|
|
28675
28994
|
}
|
|
28676
28995
|
|
|
28677
28996
|
// app/lib/telegram/gateway/telegram-gateway.ts
|
|
@@ -28821,8 +29140,8 @@ function buildTelegramSpawnRequest(input) {
|
|
|
28821
29140
|
// app/lib/telegram/outbound/send-document.ts
|
|
28822
29141
|
import { realpathSync as realpathSync10 } from "fs";
|
|
28823
29142
|
import { readFile as readFile14, stat as stat10 } from "fs/promises";
|
|
28824
|
-
import { resolve as
|
|
28825
|
-
var
|
|
29143
|
+
import { resolve as resolve40, basename as basename15 } from "path";
|
|
29144
|
+
var TAG47 = "[telegram:outbound]";
|
|
28826
29145
|
var TELEGRAM_DOCUMENT_MAX_BYTES = 50 * 1024 * 1024;
|
|
28827
29146
|
async function sendTelegramDocument(input) {
|
|
28828
29147
|
const { botToken, chatId, filePath, caption, maxyAccountId, platformRoot: platformRoot5 } = input;
|
|
@@ -28832,17 +29151,17 @@ async function sendTelegramDocument(input) {
|
|
|
28832
29151
|
if (!maxyAccountId || !platformRoot5) {
|
|
28833
29152
|
return { ok: false, status: 400, error: "Cannot validate file path: missing account or platform context" };
|
|
28834
29153
|
}
|
|
28835
|
-
const accountDir =
|
|
29154
|
+
const accountDir = resolve40(platformRoot5, "..", "data/accounts", maxyAccountId);
|
|
28836
29155
|
let accountResolved;
|
|
28837
29156
|
try {
|
|
28838
29157
|
accountResolved = realpathSync10(accountDir);
|
|
28839
29158
|
} catch (err) {
|
|
28840
29159
|
const code = err.code;
|
|
28841
29160
|
if (code === "ENOENT") {
|
|
28842
|
-
console.error(`${
|
|
29161
|
+
console.error(`${TAG47} document ENOENT scope=account-dir accountDir=${accountDir} maxyAccountId=${maxyAccountId}`);
|
|
28843
29162
|
return { ok: false, status: 500, error: `Account directory not resolvable for ${maxyAccountId}` };
|
|
28844
29163
|
}
|
|
28845
|
-
console.error(`${
|
|
29164
|
+
console.error(`${TAG47} document path error scope=account-dir maxyAccountId=${maxyAccountId}: ${String(err)}`);
|
|
28846
29165
|
return { ok: false, status: 500, error: String(err) };
|
|
28847
29166
|
}
|
|
28848
29167
|
let resolvedPath;
|
|
@@ -28851,14 +29170,14 @@ async function sendTelegramDocument(input) {
|
|
|
28851
29170
|
} catch (err) {
|
|
28852
29171
|
const code = err.code;
|
|
28853
29172
|
if (code === "ENOENT") {
|
|
28854
|
-
console.error(`${
|
|
29173
|
+
console.error(`${TAG47} document ENOENT scope=file path=${filePath} maxyAccountId=${maxyAccountId}`);
|
|
28855
29174
|
return { ok: false, status: 404, error: `File not found: ${filePath}` };
|
|
28856
29175
|
}
|
|
28857
|
-
console.error(`${
|
|
29176
|
+
console.error(`${TAG47} document path error scope=file maxyAccountId=${maxyAccountId}: ${String(err)}`);
|
|
28858
29177
|
return { ok: false, status: 500, error: String(err) };
|
|
28859
29178
|
}
|
|
28860
29179
|
if (!resolvedPath.startsWith(accountResolved + "/")) {
|
|
28861
|
-
console.error(`${
|
|
29180
|
+
console.error(`${TAG47} document REJECTED reason=outside_account_directory maxyAccountId=${maxyAccountId}`);
|
|
28862
29181
|
return { ok: false, status: 403, error: "Access denied: file is outside the account directory" };
|
|
28863
29182
|
}
|
|
28864
29183
|
const fileStat = await stat10(resolvedPath);
|
|
@@ -28891,13 +29210,13 @@ async function sendTelegramDocument(input) {
|
|
|
28891
29210
|
error = e instanceof Error ? e.message : String(e);
|
|
28892
29211
|
}
|
|
28893
29212
|
console.error(
|
|
28894
|
-
`${
|
|
29213
|
+
`${TAG47} sent document to=${chatId} file=${filename} bytes=${fileStat.size} ok=${ok}` + (messageId !== void 0 ? ` id=${messageId}` : "")
|
|
28895
29214
|
);
|
|
28896
29215
|
return ok ? { ok: true, messageId } : { ok: false, status: 500, error };
|
|
28897
29216
|
}
|
|
28898
29217
|
|
|
28899
29218
|
// app/lib/telegram/outbound/file-delivery.ts
|
|
28900
|
-
var
|
|
29219
|
+
var TAG48 = "[telegram:outbound]";
|
|
28901
29220
|
function platformRoot4() {
|
|
28902
29221
|
return process.env.MAXY_PLATFORM_ROOT || "";
|
|
28903
29222
|
}
|
|
@@ -28909,11 +29228,11 @@ function makeTelegramSendFile(entry) {
|
|
|
28909
29228
|
botToken = (entry.role === "admin" ? tg?.adminBotToken : tg?.publicBotToken) ?? null;
|
|
28910
29229
|
}
|
|
28911
29230
|
if (!botToken) {
|
|
28912
|
-
console.error(`${
|
|
29231
|
+
console.error(`${TAG48} file-delivery reject reason=no-bot-token sender=${entry.senderId} role=${entry.role}`);
|
|
28913
29232
|
return { ok: false, error: "no-bot-token" };
|
|
28914
29233
|
}
|
|
28915
29234
|
if (entry.replyTarget == null) {
|
|
28916
|
-
console.error(`${
|
|
29235
|
+
console.error(`${TAG48} file-delivery reject reason=no-reply-target sender=${entry.senderId} role=${entry.role}`);
|
|
28917
29236
|
return { ok: false, error: "no-reply-target" };
|
|
28918
29237
|
}
|
|
28919
29238
|
const result = await sendTelegramDocument({
|
|
@@ -28930,7 +29249,7 @@ function makeTelegramSendFile(entry) {
|
|
|
28930
29249
|
function makeTelegramFileDelivery(entry) {
|
|
28931
29250
|
return makeFileDelivery({
|
|
28932
29251
|
entry,
|
|
28933
|
-
tag:
|
|
29252
|
+
tag: TAG48,
|
|
28934
29253
|
channel: "telegram",
|
|
28935
29254
|
sendFile: makeTelegramSendFile(entry)
|
|
28936
29255
|
});
|
|
@@ -28971,7 +29290,7 @@ function startTelegramNativeFileFollower(input) {
|
|
|
28971
29290
|
|
|
28972
29291
|
// app/lib/channel-pty-bridge/public-session-end-review.ts
|
|
28973
29292
|
import { randomUUID as randomUUID12 } from "crypto";
|
|
28974
|
-
var
|
|
29293
|
+
var TAG49 = "[public-session-review]";
|
|
28975
29294
|
var CONSUMED_CAP = 500;
|
|
28976
29295
|
var consumed = /* @__PURE__ */ new Set();
|
|
28977
29296
|
function consumeOnce(sessionId) {
|
|
@@ -28998,7 +29317,7 @@ async function fetchJsonl(sessionId) {
|
|
|
28998
29317
|
return await res.text();
|
|
28999
29318
|
} catch (err) {
|
|
29000
29319
|
console.error(
|
|
29001
|
-
`${
|
|
29320
|
+
`${TAG49} jsonl-fetch-failed sessionId=${sessionId} err="${err instanceof Error ? err.message : String(err)}"`
|
|
29002
29321
|
);
|
|
29003
29322
|
return null;
|
|
29004
29323
|
}
|
|
@@ -29022,7 +29341,7 @@ async function fetchPriorWrites(sliceToken, accountId) {
|
|
|
29022
29341
|
const res = await fetch(url);
|
|
29023
29342
|
if (!res.ok) {
|
|
29024
29343
|
console.error(
|
|
29025
|
-
`${
|
|
29344
|
+
`${TAG49} prior-writes-fetch-failed sliceToken=${sliceToken.slice(0, 8)} status=${res.status}`
|
|
29026
29345
|
);
|
|
29027
29346
|
return [];
|
|
29028
29347
|
}
|
|
@@ -29030,7 +29349,7 @@ async function fetchPriorWrites(sliceToken, accountId) {
|
|
|
29030
29349
|
return Array.isArray(body.writes) ? body.writes : [];
|
|
29031
29350
|
} catch (err) {
|
|
29032
29351
|
console.error(
|
|
29033
|
-
`${
|
|
29352
|
+
`${TAG49} prior-writes-fetch-threw sliceToken=${sliceToken.slice(0, 8)} err="${err instanceof Error ? err.message : String(err)}"`
|
|
29034
29353
|
);
|
|
29035
29354
|
return [];
|
|
29036
29355
|
}
|
|
@@ -29059,7 +29378,7 @@ function composeInitialMessage(input) {
|
|
|
29059
29378
|
}
|
|
29060
29379
|
async function dispatchReviewer(input, initialMessage) {
|
|
29061
29380
|
const sessionId = randomUUID12();
|
|
29062
|
-
console.log(`${
|
|
29381
|
+
console.log(`${TAG49} route target=rc-spawn sessionId=${sessionId.slice(0, 8)} sourceSession=${input.sessionId.slice(0, 8)}`);
|
|
29063
29382
|
const spawned = await managerRcSpawn({
|
|
29064
29383
|
sessionId,
|
|
29065
29384
|
initialMessage,
|
|
@@ -29079,21 +29398,21 @@ async function firePublicSessionEndReview(input) {
|
|
|
29079
29398
|
const dispatchedAt = Date.now();
|
|
29080
29399
|
if (consumed.has(input.sessionId)) {
|
|
29081
29400
|
console.log(
|
|
29082
|
-
`${
|
|
29401
|
+
`${TAG49} dispatchFor=${input.dispatchFor} sessionId=${input.sessionId} sliceToken=${sliceShort} personId=${personField} result=skipped-already-reviewed`
|
|
29083
29402
|
);
|
|
29084
29403
|
return;
|
|
29085
29404
|
}
|
|
29086
29405
|
const jsonl = await fetchJsonl(input.sessionId);
|
|
29087
29406
|
if (!jsonl) {
|
|
29088
29407
|
console.log(
|
|
29089
|
-
`${
|
|
29408
|
+
`${TAG49} dispatchFor=${input.dispatchFor} sessionId=${input.sessionId} sliceToken=${sliceShort} personId=${personField} result=skipped-jsonl-missing`
|
|
29090
29409
|
);
|
|
29091
29410
|
return;
|
|
29092
29411
|
}
|
|
29093
29412
|
const operatorTurns = countOperatorTurns(jsonl);
|
|
29094
29413
|
if (operatorTurns === 0) {
|
|
29095
29414
|
console.log(
|
|
29096
|
-
`${
|
|
29415
|
+
`${TAG49} dispatchFor=${input.dispatchFor} sessionId=${input.sessionId} sliceToken=${sliceShort} personId=${personField} result=skipped-no-turns`
|
|
29097
29416
|
);
|
|
29098
29417
|
return;
|
|
29099
29418
|
}
|
|
@@ -29107,19 +29426,19 @@ async function firePublicSessionEndReview(input) {
|
|
|
29107
29426
|
});
|
|
29108
29427
|
if (!consumeOnce(input.sessionId)) {
|
|
29109
29428
|
console.log(
|
|
29110
|
-
`${
|
|
29429
|
+
`${TAG49} dispatchFor=${input.dispatchFor} sessionId=${input.sessionId} sliceToken=${sliceShort} personId=${personField} result=skipped-already-reviewed`
|
|
29111
29430
|
);
|
|
29112
29431
|
return;
|
|
29113
29432
|
}
|
|
29114
29433
|
const dispatched = await dispatchReviewer(input, initialMessage);
|
|
29115
29434
|
if (!dispatched.ok) {
|
|
29116
29435
|
console.error(
|
|
29117
|
-
`${
|
|
29436
|
+
`${TAG49} dispatchFor=${input.dispatchFor} sessionId=${input.sessionId} sliceToken=${sliceShort} personId=${personField} result=skipped-spawn-failed reason=${dispatched.reason}`
|
|
29118
29437
|
);
|
|
29119
29438
|
return;
|
|
29120
29439
|
}
|
|
29121
29440
|
console.log(
|
|
29122
|
-
`${
|
|
29441
|
+
`${TAG49} dispatchFor=${input.dispatchFor} sessionId=${input.sessionId} sliceToken=${sliceShort} personId=${personField} result=dispatched managerSessionId=${dispatched.managerSessionId} operatorTurns=${operatorTurns} priorWrites=${priorWrites.length} ms=${Date.now() - dispatchedAt}`
|
|
29123
29442
|
);
|
|
29124
29443
|
}
|
|
29125
29444
|
|
|
@@ -29240,14 +29559,14 @@ function resolveScheduledEffectiveAccountForInstall(accountDir, destination) {
|
|
|
29240
29559
|
}
|
|
29241
29560
|
|
|
29242
29561
|
// server/lib/booking-site-accounts.ts
|
|
29243
|
-
import { existsSync as existsSync46, readFileSync as
|
|
29244
|
-
import { resolve as
|
|
29562
|
+
import { existsSync as existsSync46, readFileSync as readFileSync43 } from "fs";
|
|
29563
|
+
import { resolve as resolve41 } from "path";
|
|
29245
29564
|
function listBookingSiteAccounts(accounts) {
|
|
29246
29565
|
return accounts.filter((a) => {
|
|
29247
|
-
const availPath =
|
|
29566
|
+
const availPath = resolve41(a.accountDir, "calendar-availability.json");
|
|
29248
29567
|
if (!existsSync46(availPath)) return false;
|
|
29249
29568
|
try {
|
|
29250
|
-
const cfg = JSON.parse(
|
|
29569
|
+
const cfg = JSON.parse(readFileSync43(availPath, "utf-8"));
|
|
29251
29570
|
return typeof cfg.bookingDbName === "string" && cfg.bookingDbName.length > 0;
|
|
29252
29571
|
} catch {
|
|
29253
29572
|
return false;
|
|
@@ -29285,8 +29604,8 @@ function broadcastAdminShutdown(reason) {
|
|
|
29285
29604
|
|
|
29286
29605
|
// ../lib/entitlement/src/index.ts
|
|
29287
29606
|
import { createPublicKey, createHash as createHash6, verify as cryptoVerify } from "crypto";
|
|
29288
|
-
import { existsSync as existsSync47, readFileSync as
|
|
29289
|
-
import { resolve as
|
|
29607
|
+
import { existsSync as existsSync47, readFileSync as readFileSync44, statSync as statSync24 } from "fs";
|
|
29608
|
+
import { resolve as resolve42 } from "path";
|
|
29290
29609
|
|
|
29291
29610
|
// ../lib/entitlement/src/canonicalize.ts
|
|
29292
29611
|
function canonicalize(value) {
|
|
@@ -29321,7 +29640,7 @@ var PUBKEY_SHA256 = "8eee6bcb33545fd13b16d3199a5735ca5db5062834c7b49dfe4f23801d9
|
|
|
29321
29640
|
var GRACE_DAYS = 7;
|
|
29322
29641
|
var GRACE_MS = GRACE_DAYS * 24 * 60 * 60 * 1e3;
|
|
29323
29642
|
function pubkeyPath(brand) {
|
|
29324
|
-
return
|
|
29643
|
+
return resolve42(brand.platformRoot, "lib", "entitlement", "rubytech-pubkey.pem");
|
|
29325
29644
|
}
|
|
29326
29645
|
var memo = null;
|
|
29327
29646
|
function memoKey(mtimeMs, account) {
|
|
@@ -29333,7 +29652,7 @@ function resolveEntitlement(brand, account) {
|
|
|
29333
29652
|
if (brand.commercialMode !== true) {
|
|
29334
29653
|
return logResolved(implicitTrust(account), null);
|
|
29335
29654
|
}
|
|
29336
|
-
const entitlementPath =
|
|
29655
|
+
const entitlementPath = resolve42(brand.configDir, "entitlement.json");
|
|
29337
29656
|
if (!existsSync47(entitlementPath)) {
|
|
29338
29657
|
return logResolved(anonymousFallback("missing"), { reason: "missing" });
|
|
29339
29658
|
}
|
|
@@ -29349,7 +29668,7 @@ function resolveEntitlement(brand, account) {
|
|
|
29349
29668
|
function verifyAndResolve(brand, entitlementPath, account) {
|
|
29350
29669
|
let pubkeyPem;
|
|
29351
29670
|
try {
|
|
29352
|
-
pubkeyPem =
|
|
29671
|
+
pubkeyPem = readFileSync44(pubkeyPath(brand), "utf-8");
|
|
29353
29672
|
} catch (err) {
|
|
29354
29673
|
return logResolved(anonymousFallback("pubkey-missing"), {
|
|
29355
29674
|
reason: "pubkey-missing"
|
|
@@ -29363,7 +29682,7 @@ function verifyAndResolve(brand, entitlementPath, account) {
|
|
|
29363
29682
|
}
|
|
29364
29683
|
let envelope;
|
|
29365
29684
|
try {
|
|
29366
|
-
envelope = JSON.parse(
|
|
29685
|
+
envelope = JSON.parse(readFileSync44(entitlementPath, "utf-8"));
|
|
29367
29686
|
} catch {
|
|
29368
29687
|
return logResolved(anonymousFallback("malformed"), { reason: "malformed" });
|
|
29369
29688
|
}
|
|
@@ -29532,7 +29851,7 @@ if (BRAND_JSON_PATH && !existsSync48(BRAND_JSON_PATH)) {
|
|
|
29532
29851
|
}
|
|
29533
29852
|
if (BRAND_JSON_PATH && existsSync48(BRAND_JSON_PATH)) {
|
|
29534
29853
|
try {
|
|
29535
|
-
const parsed = JSON.parse(
|
|
29854
|
+
const parsed = JSON.parse(readFileSync45(BRAND_JSON_PATH, "utf-8"));
|
|
29536
29855
|
BRAND = { ...BRAND, ...parsed };
|
|
29537
29856
|
} catch (err) {
|
|
29538
29857
|
console.error(`[brand] Failed to parse brand.json: ${err.message}`);
|
|
@@ -29568,7 +29887,7 @@ var ALIAS_DOMAINS_PATH = join52(homedir4(), BRAND.configDir, "alias-domains.json
|
|
|
29568
29887
|
function loadAliasDomains() {
|
|
29569
29888
|
try {
|
|
29570
29889
|
if (!existsSync48(ALIAS_DOMAINS_PATH)) return null;
|
|
29571
|
-
const parsed = JSON.parse(
|
|
29890
|
+
const parsed = JSON.parse(readFileSync45(ALIAS_DOMAINS_PATH, "utf-8"));
|
|
29572
29891
|
if (!Array.isArray(parsed)) {
|
|
29573
29892
|
console.error("[alias-domains] malformed alias-domains.json \u2014 expected array");
|
|
29574
29893
|
return null;
|
|
@@ -29594,7 +29913,7 @@ startManagerEventsSubscriber();
|
|
|
29594
29913
|
function isPublicHost(host) {
|
|
29595
29914
|
return host.startsWith("public.") || aliasDomains.has(host);
|
|
29596
29915
|
}
|
|
29597
|
-
var
|
|
29916
|
+
var app75 = new Hono();
|
|
29598
29917
|
function resolveChannelOverride(accountId, channel, senderId) {
|
|
29599
29918
|
try {
|
|
29600
29919
|
const dir = listValidAccounts().find((a) => a.accountId === accountId)?.accountDir;
|
|
@@ -29643,7 +29962,7 @@ var waGateway = new WaGateway({
|
|
|
29643
29962
|
fetchStandingRules: fetchAccountStandingRules,
|
|
29644
29963
|
resolveSessionOverride: (accountId, senderId) => resolveChannelOverride(accountId, "whatsapp", senderId),
|
|
29645
29964
|
gatewayUrl: `http://127.0.0.1:${process.env.MAXY_UI_INTERNAL_PORT ?? ""}`,
|
|
29646
|
-
serverPath: process.env.MAXY_WA_CHANNEL_SERVER_PATH ??
|
|
29965
|
+
serverPath: process.env.MAXY_WA_CHANNEL_SERVER_PATH ?? resolve43(process.env.MAXY_PLATFORM_ROOT ?? join52(__dirname, ".."), "services/whatsapp-channel/dist/server.js"),
|
|
29647
29966
|
// Task 751 / 1390 — file delivery on the native channel. `maxyAccountId` (the
|
|
29648
29967
|
// path-validation scope) is the sender's effective SESSION account, resolved
|
|
29649
29968
|
// once at the inbound gate and threaded here via the gateway's per-sender doc
|
|
@@ -29658,7 +29977,7 @@ var waGateway = new WaGateway({
|
|
|
29658
29977
|
caption,
|
|
29659
29978
|
accountId,
|
|
29660
29979
|
maxyAccountId,
|
|
29661
|
-
platformRoot:
|
|
29980
|
+
platformRoot: resolve43(process.env.MAXY_PLATFORM_ROOT ?? join52(__dirname, ".."))
|
|
29662
29981
|
});
|
|
29663
29982
|
return result.ok ? { ok: true, messageId: result.messageId } : { ok: false, error: result.error };
|
|
29664
29983
|
},
|
|
@@ -29771,7 +30090,7 @@ var waGateway = new WaGateway({
|
|
|
29771
30090
|
nativeFileFollowers.set(senderId, ac);
|
|
29772
30091
|
}
|
|
29773
30092
|
});
|
|
29774
|
-
|
|
30093
|
+
app75.route("/", waGateway.routes());
|
|
29775
30094
|
waGateway.startSweeper();
|
|
29776
30095
|
registerLoop({
|
|
29777
30096
|
name: "whatsapp-link-census",
|
|
@@ -29908,7 +30227,7 @@ var webchatGateway = new WebchatGateway({
|
|
|
29908
30227
|
firePublicSessionEndReview: (input) => firePublicSessionEndReview(input)
|
|
29909
30228
|
});
|
|
29910
30229
|
setWebchatGateway(webchatGateway);
|
|
29911
|
-
|
|
30230
|
+
app75.route("/", webchatGateway.routes());
|
|
29912
30231
|
webchatGateway.startSweeper();
|
|
29913
30232
|
webchatGateway.startPublicReaper();
|
|
29914
30233
|
var telegramFileFollowers = /* @__PURE__ */ new Map();
|
|
@@ -29952,7 +30271,7 @@ var telegramGateway = new TelegramGateway({
|
|
|
29952
30271
|
}
|
|
29953
30272
|
});
|
|
29954
30273
|
setTelegramGateway(telegramGateway);
|
|
29955
|
-
|
|
30274
|
+
app75.route("/", telegramGateway.routes());
|
|
29956
30275
|
telegramGateway.startSweeper();
|
|
29957
30276
|
var chatRoutes = createChatRoutes({
|
|
29958
30277
|
handleInbound: (input) => webchatGateway.handleInbound(input),
|
|
@@ -29991,19 +30310,19 @@ var scheduleInjectRoutes = createScheduleInjectRoutes({
|
|
|
29991
30310
|
// and why the real dependencies are bound there rather than assembled here.
|
|
29992
30311
|
effectiveAccountFor: resolveScheduledEffectiveAccountForInstall
|
|
29993
30312
|
});
|
|
29994
|
-
|
|
29995
|
-
|
|
30313
|
+
app75.route("/api/channel/schedule-inject", scheduleInjectRoutes);
|
|
30314
|
+
app75.use("*", clientIpMiddleware);
|
|
29996
30315
|
function allowsSameOriginFraming(path) {
|
|
29997
30316
|
return path === "/vnc-viewer.html" || path.startsWith("/api/admin/attachment/") || path.startsWith("/api/public-reader/attachment/") || path === "/api/admin/files/download" || path === "/api/admin/session-upload";
|
|
29998
30317
|
}
|
|
29999
|
-
|
|
30318
|
+
app75.use("*", async (c, next) => {
|
|
30000
30319
|
await next();
|
|
30001
30320
|
c.header("X-Content-Type-Options", "nosniff");
|
|
30002
30321
|
c.header("Referrer-Policy", "strict-origin-when-cross-origin");
|
|
30003
30322
|
c.header("X-Frame-Options", allowsSameOriginFraming(c.req.path) ? "SAMEORIGIN" : "DENY");
|
|
30004
30323
|
});
|
|
30005
30324
|
var HTTP_LOG_PATHS = /* @__PURE__ */ new Set(["/vnc-viewer.html", "/vnc-popout.html"]);
|
|
30006
|
-
|
|
30325
|
+
app75.use("*", async (c, next) => {
|
|
30007
30326
|
if (!HTTP_LOG_PATHS.has(c.req.path)) {
|
|
30008
30327
|
await next();
|
|
30009
30328
|
return;
|
|
@@ -30021,7 +30340,7 @@ app74.use("*", async (c, next) => {
|
|
|
30021
30340
|
});
|
|
30022
30341
|
}
|
|
30023
30342
|
});
|
|
30024
|
-
|
|
30343
|
+
app75.use("*", async (c, next) => {
|
|
30025
30344
|
const host = (c.req.header("host") ?? "").split(":")[0];
|
|
30026
30345
|
if (isOperatorHost(host, getOperatorDomains()) || !isPublicHost(host)) {
|
|
30027
30346
|
await next();
|
|
@@ -30059,7 +30378,7 @@ function resolveRemoteAuthOpts(c) {
|
|
|
30059
30378
|
return { ...brandLoginOpts, origin };
|
|
30060
30379
|
}
|
|
30061
30380
|
var MAX_LOGIN_BODY = 8 * 1024;
|
|
30062
|
-
|
|
30381
|
+
app75.post("/__remote-auth/login", async (c) => {
|
|
30063
30382
|
const client = clientFrom(c);
|
|
30064
30383
|
const clientIp = client.ip || "unknown";
|
|
30065
30384
|
if (!requestIsTlsTerminated(c)) {
|
|
@@ -30104,7 +30423,7 @@ app74.post("/__remote-auth/login", async (c) => {
|
|
|
30104
30423
|
}
|
|
30105
30424
|
});
|
|
30106
30425
|
});
|
|
30107
|
-
|
|
30426
|
+
app75.get("/__remote-auth/logout", (c) => {
|
|
30108
30427
|
const client = clientFrom(c);
|
|
30109
30428
|
const clientIp = client.ip || "unknown";
|
|
30110
30429
|
console.error(`[remote-auth] logout ip=${clientIp}`);
|
|
@@ -30117,7 +30436,7 @@ app74.get("/__remote-auth/logout", (c) => {
|
|
|
30117
30436
|
}
|
|
30118
30437
|
});
|
|
30119
30438
|
});
|
|
30120
|
-
|
|
30439
|
+
app75.post("/__remote-auth/change-password", async (c) => {
|
|
30121
30440
|
const client = clientFrom(c);
|
|
30122
30441
|
const clientIp = client.ip || "unknown";
|
|
30123
30442
|
const rateLimited = checkRateLimit(client);
|
|
@@ -30176,13 +30495,13 @@ app74.post("/__remote-auth/change-password", async (c) => {
|
|
|
30176
30495
|
return c.html(renderLoginPage({ ...resolveRemoteAuthOpts(c), mode: "change", changeError: "Failed to save password", redirect }), 200);
|
|
30177
30496
|
}
|
|
30178
30497
|
});
|
|
30179
|
-
|
|
30498
|
+
app75.get("/__remote-auth/setup", (c) => {
|
|
30180
30499
|
if (isRemoteAuthConfigured()) {
|
|
30181
30500
|
return c.redirect("/");
|
|
30182
30501
|
}
|
|
30183
30502
|
return c.html(renderLoginPage({ ...resolveRemoteAuthOpts(c), mode: "setup" }), 200);
|
|
30184
30503
|
});
|
|
30185
|
-
|
|
30504
|
+
app75.post("/__remote-auth/set-initial-password", async (c) => {
|
|
30186
30505
|
if (isRemoteAuthConfigured()) {
|
|
30187
30506
|
return c.redirect("/");
|
|
30188
30507
|
}
|
|
@@ -30220,10 +30539,10 @@ app74.post("/__remote-auth/set-initial-password", async (c) => {
|
|
|
30220
30539
|
return c.html(renderLoginPage({ ...resolveRemoteAuthOpts(c), mode: "setup", setupError: "Failed to save password. Please try again." }), 200);
|
|
30221
30540
|
}
|
|
30222
30541
|
});
|
|
30223
|
-
|
|
30542
|
+
app75.get("/api/remote-auth/status", (c) => {
|
|
30224
30543
|
return c.json({ configured: isRemoteAuthConfigured() });
|
|
30225
30544
|
});
|
|
30226
|
-
|
|
30545
|
+
app75.post("/api/remote-auth/set-password", async (c) => {
|
|
30227
30546
|
let body;
|
|
30228
30547
|
try {
|
|
30229
30548
|
body = await c.req.json();
|
|
@@ -30262,10 +30581,10 @@ app74.post("/api/remote-auth/set-password", async (c) => {
|
|
|
30262
30581
|
return c.json({ error: "Failed to save password" }, 500);
|
|
30263
30582
|
}
|
|
30264
30583
|
});
|
|
30265
|
-
|
|
30584
|
+
app75.route("/api/_client-error", client_error_default);
|
|
30266
30585
|
console.log("[client-error-route] mounted");
|
|
30267
30586
|
var PWA_PUBLIC_PATHS = /* @__PURE__ */ new Set(["/sw.js", ...PWA_SURFACES.map((s) => s.manifestPath)]);
|
|
30268
|
-
|
|
30587
|
+
app75.use("*", async (c, next) => {
|
|
30269
30588
|
const host = (c.req.header("host") ?? "").split(":")[0];
|
|
30270
30589
|
const path = c.req.path;
|
|
30271
30590
|
if (path === "/favicon.ico" || path.startsWith("/assets/") || path.startsWith("/brand/") || // Public free/busy is read by the booking page (a separate Cloudflare Pages
|
|
@@ -30309,30 +30628,30 @@ app74.use("*", async (c, next) => {
|
|
|
30309
30628
|
}
|
|
30310
30629
|
return c.html(renderLoginPage({ ...resolveRemoteAuthOpts(c), redirect: path }), 200);
|
|
30311
30630
|
});
|
|
30312
|
-
|
|
30313
|
-
|
|
30314
|
-
|
|
30315
|
-
|
|
30316
|
-
|
|
30317
|
-
|
|
30318
|
-
|
|
30319
|
-
|
|
30320
|
-
|
|
30631
|
+
app75.route("/api/health", health_default);
|
|
30632
|
+
app75.route("/api/chat", chatRoutes);
|
|
30633
|
+
app75.route("/api/whatsapp", whatsapp_default);
|
|
30634
|
+
app75.route("/api/storage", storage_broker_default);
|
|
30635
|
+
app75.route("/api/whatsapp-reader", whatsapp_reader_default);
|
|
30636
|
+
app75.route("/api/session-reader", session_reader_default);
|
|
30637
|
+
app75.route("/api/operator-conversations", operator_conversations_default);
|
|
30638
|
+
app75.route("/api/public-reader", public_reader_default);
|
|
30639
|
+
app75.route("/api/webchat", createWebchatRoutes({
|
|
30321
30640
|
handleInbound: (input) => webchatGateway.handleInbound(input),
|
|
30322
30641
|
// Task 940 — the permission relay's pointer read + verdict write.
|
|
30323
30642
|
pendingPromptFor: (key) => webchatGateway.pendingPromptFor(key),
|
|
30324
30643
|
deliveryFailureFor: (key) => webchatGateway.deliveryFailureFor(key),
|
|
30325
30644
|
resolvePermissionVerdict: (key, requestId, behavior) => webchatGateway.resolvePermissionVerdict(key, requestId, behavior)
|
|
30326
30645
|
}));
|
|
30327
|
-
|
|
30328
|
-
|
|
30329
|
-
|
|
30330
|
-
|
|
30331
|
-
|
|
30332
|
-
|
|
30333
|
-
|
|
30334
|
-
|
|
30335
|
-
|
|
30646
|
+
app75.route("/api/webchat/greeting", webchat_greeting_default);
|
|
30647
|
+
app75.route("/api/telegram", telegram_default);
|
|
30648
|
+
app75.route("/api/quickbooks", quickbooks_default);
|
|
30649
|
+
app75.route("/api/onboarding", onboarding_default);
|
|
30650
|
+
app75.route("/api/admin", admin_default);
|
|
30651
|
+
app75.route("/api/access", access_default);
|
|
30652
|
+
app75.route("/api/session", session_default2);
|
|
30653
|
+
app75.route("/api/calendar", calendar_public_default);
|
|
30654
|
+
app75.route("/api/portal", portal_fetch_default);
|
|
30336
30655
|
var SAFE_SLUG_RE2 = /^[a-z][a-z0-9-]{2,49}$/;
|
|
30337
30656
|
var SAFE_FILENAME_RE = /^[a-z0-9_][a-z0-9_.-]{0,99}$/i;
|
|
30338
30657
|
var IMAGE_MIME = {
|
|
@@ -30344,7 +30663,7 @@ var IMAGE_MIME = {
|
|
|
30344
30663
|
".svg": "image/svg+xml",
|
|
30345
30664
|
".ico": "image/x-icon"
|
|
30346
30665
|
};
|
|
30347
|
-
|
|
30666
|
+
app75.get("/agent-assets/:slug/:filename", (c) => {
|
|
30348
30667
|
const slug = c.req.param("slug");
|
|
30349
30668
|
const filename = c.req.param("filename");
|
|
30350
30669
|
if (!SAFE_SLUG_RE2.test(slug)) {
|
|
@@ -30360,8 +30679,8 @@ app74.get("/agent-assets/:slug/:filename", (c) => {
|
|
|
30360
30679
|
console.error(`[agent-assets] no-account slug=${slug} file=${filename}`);
|
|
30361
30680
|
return c.text("Not found", 404);
|
|
30362
30681
|
}
|
|
30363
|
-
const filePath =
|
|
30364
|
-
const expectedDir =
|
|
30682
|
+
const filePath = resolve43(account.accountDir, "agents", slug, "assets", filename);
|
|
30683
|
+
const expectedDir = resolve43(account.accountDir, "agents", slug, "assets");
|
|
30365
30684
|
if (!filePath.startsWith(expectedDir + "/")) {
|
|
30366
30685
|
console.error(`[agent-assets] path-traversal-rejected slug=${slug} file=${filename}`);
|
|
30367
30686
|
return c.text("Forbidden", 403);
|
|
@@ -30373,13 +30692,13 @@ app74.get("/agent-assets/:slug/:filename", (c) => {
|
|
|
30373
30692
|
const ext = "." + filename.split(".").pop()?.toLowerCase();
|
|
30374
30693
|
const contentType = IMAGE_MIME[ext] || "application/octet-stream";
|
|
30375
30694
|
console.log(`[agent-assets] serve slug=${slug} file=${filename} status=200`);
|
|
30376
|
-
const body =
|
|
30695
|
+
const body = readFileSync45(filePath);
|
|
30377
30696
|
return c.body(body, 200, {
|
|
30378
30697
|
"Content-Type": contentType,
|
|
30379
30698
|
"Cache-Control": "public, max-age=3600"
|
|
30380
30699
|
});
|
|
30381
30700
|
});
|
|
30382
|
-
|
|
30701
|
+
app75.get("/generated/:filename", (c) => {
|
|
30383
30702
|
const filename = c.req.param("filename");
|
|
30384
30703
|
if (!SAFE_FILENAME_RE.test(filename) || filename.includes("..")) {
|
|
30385
30704
|
console.error(`[generated] serve file=${filename} status=403`);
|
|
@@ -30390,8 +30709,8 @@ app74.get("/generated/:filename", (c) => {
|
|
|
30390
30709
|
console.error(`[generated] serve file=${filename} status=404`);
|
|
30391
30710
|
return c.text("Not found", 404);
|
|
30392
30711
|
}
|
|
30393
|
-
const filePath =
|
|
30394
|
-
const expectedDir =
|
|
30712
|
+
const filePath = resolve43(account.accountDir, "generated", filename);
|
|
30713
|
+
const expectedDir = resolve43(account.accountDir, "generated");
|
|
30395
30714
|
if (!filePath.startsWith(expectedDir + "/")) {
|
|
30396
30715
|
console.error(`[generated] serve file=${filename} status=403`);
|
|
30397
30716
|
return c.text("Forbidden", 403);
|
|
@@ -30403,22 +30722,22 @@ app74.get("/generated/:filename", (c) => {
|
|
|
30403
30722
|
const ext = "." + filename.split(".").pop()?.toLowerCase();
|
|
30404
30723
|
const contentType = IMAGE_MIME[ext] || "application/octet-stream";
|
|
30405
30724
|
console.log(`[generated] serve file=${filename} status=200`);
|
|
30406
|
-
const body =
|
|
30725
|
+
const body = readFileSync45(filePath);
|
|
30407
30726
|
return c.body(body, 200, {
|
|
30408
30727
|
"Content-Type": contentType,
|
|
30409
30728
|
"Cache-Control": "public, max-age=86400"
|
|
30410
30729
|
});
|
|
30411
30730
|
});
|
|
30412
|
-
|
|
30413
|
-
|
|
30414
|
-
|
|
30415
|
-
|
|
30731
|
+
app75.route("/sites", sites_default);
|
|
30732
|
+
app75.route("/listings", listings_default);
|
|
30733
|
+
app75.route("/v", visitor_event_default);
|
|
30734
|
+
app75.route("/v", visitor_consent_default);
|
|
30416
30735
|
var htmlCache = /* @__PURE__ */ new Map();
|
|
30417
30736
|
var brandLogoPath = "/brand/maxy-monochrome.png";
|
|
30418
30737
|
var brandIconPath = "/brand/maxy-monochrome.png";
|
|
30419
30738
|
if (BRAND_JSON_PATH && existsSync48(BRAND_JSON_PATH)) {
|
|
30420
30739
|
try {
|
|
30421
|
-
const fullBrand = JSON.parse(
|
|
30740
|
+
const fullBrand = JSON.parse(readFileSync45(BRAND_JSON_PATH, "utf-8"));
|
|
30422
30741
|
if (fullBrand.assets?.logo) brandLogoPath = `/brand/${fullBrand.assets.logo}`;
|
|
30423
30742
|
brandIconPath = fullBrand.assets?.icon ? `/brand/${fullBrand.assets.icon}` : brandLogoPath;
|
|
30424
30743
|
} catch {
|
|
@@ -30445,11 +30764,11 @@ var brandScript = `<script>window.__BRAND__=${JSON.stringify({
|
|
|
30445
30764
|
var brandThemeColor = BRAND.defaultColors?.primary ?? "#000000";
|
|
30446
30765
|
var brandBackgroundColor = BRAND.defaultColors?.background ?? "#ffffff";
|
|
30447
30766
|
var brandAppIconsExist = [brandAppIcon192Path, brandAppIcon512Path, brandMaskableIconPath].every(
|
|
30448
|
-
(p) => existsSync48(
|
|
30767
|
+
(p) => existsSync48(resolve43(process.cwd(), "public", p.replace(/^\//, "")))
|
|
30449
30768
|
);
|
|
30450
30769
|
var SW_SOURCE = (() => {
|
|
30451
30770
|
try {
|
|
30452
|
-
return
|
|
30771
|
+
return readFileSync45(resolve43(process.cwd(), "public", "sw.js"), "utf-8");
|
|
30453
30772
|
} catch {
|
|
30454
30773
|
return null;
|
|
30455
30774
|
}
|
|
@@ -30459,7 +30778,7 @@ function readInstalledVersion() {
|
|
|
30459
30778
|
if (!PLATFORM_ROOT6) return "unknown";
|
|
30460
30779
|
const versionFile = join52(PLATFORM_ROOT6, "config", `.${BRAND.hostname}-version`);
|
|
30461
30780
|
if (!existsSync48(versionFile)) return "unknown";
|
|
30462
|
-
const content =
|
|
30781
|
+
const content = readFileSync45(versionFile, "utf-8").trim();
|
|
30463
30782
|
return content || "unknown";
|
|
30464
30783
|
} catch {
|
|
30465
30784
|
return "unknown";
|
|
@@ -30470,7 +30789,7 @@ var versionScript = `<script>window.__MAXY_VERSION__=${JSON.stringify(INSTALLED_
|
|
|
30470
30789
|
function cachedHtml(file) {
|
|
30471
30790
|
let html = htmlCache.get(file);
|
|
30472
30791
|
if (!html) {
|
|
30473
|
-
html =
|
|
30792
|
+
html = readFileSync45(resolve43(process.cwd(), "public", file), "utf-8");
|
|
30474
30793
|
const productNameEsc = escapeHtml(BRAND.productName);
|
|
30475
30794
|
html = html.replace(/<title>([^<]*)<\/title>/, (_match, inner) => `<title>${escapeHtml(inner).replace(/Maxy/g, productNameEsc)}</title>`);
|
|
30476
30795
|
html = html.replace('href="/favicon.ico"', `href="${escapeHtml(brandFaviconPath)}"`);
|
|
@@ -30493,7 +30812,7 @@ function loadBrandingCache(agentSlug) {
|
|
|
30493
30812
|
if (!accountId) return null;
|
|
30494
30813
|
const cachePath = join52(configDir, "branding-cache", accountId, `${agentSlug}.json`);
|
|
30495
30814
|
if (!existsSync48(cachePath)) return null;
|
|
30496
|
-
return JSON.parse(
|
|
30815
|
+
return JSON.parse(readFileSync45(cachePath, "utf-8"));
|
|
30497
30816
|
} catch {
|
|
30498
30817
|
return null;
|
|
30499
30818
|
}
|
|
@@ -30537,7 +30856,7 @@ function brandedPublicHtml(agentSlug) {
|
|
|
30537
30856
|
function agentUnavailableHtml() {
|
|
30538
30857
|
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>`;
|
|
30539
30858
|
}
|
|
30540
|
-
|
|
30859
|
+
app75.get("/", (c) => {
|
|
30541
30860
|
const host = (c.req.header("host") ?? "").split(":")[0];
|
|
30542
30861
|
const klass = classifyHost(host, getOperatorDomains(), isPublicHost);
|
|
30543
30862
|
if (klass === "operator") {
|
|
@@ -30559,12 +30878,12 @@ app74.get("/", (c) => {
|
|
|
30559
30878
|
console.log(`[host-class] host=${host} class=admin served=index.html`);
|
|
30560
30879
|
return c.html(cachedHtml("index.html"));
|
|
30561
30880
|
});
|
|
30562
|
-
|
|
30881
|
+
app75.get("/public", (c) => {
|
|
30563
30882
|
const host = (c.req.header("host") ?? "").split(":")[0];
|
|
30564
30883
|
if (isPublicHost(host)) return c.text("Not found", 404);
|
|
30565
30884
|
return c.html(cachedHtml("public.html"));
|
|
30566
30885
|
});
|
|
30567
|
-
|
|
30886
|
+
app75.get("/public-chat", (c) => {
|
|
30568
30887
|
const host = (c.req.header("host") ?? "").split(":")[0];
|
|
30569
30888
|
if (isPublicHost(host)) return c.text("Not found", 404);
|
|
30570
30889
|
return c.html(cachedHtml("public.html"));
|
|
@@ -30583,12 +30902,12 @@ async function logViewerFetch(c, next) {
|
|
|
30583
30902
|
duration_ms: Date.now() - start
|
|
30584
30903
|
});
|
|
30585
30904
|
}
|
|
30586
|
-
|
|
30587
|
-
|
|
30588
|
-
|
|
30905
|
+
app75.use("/vnc-viewer.html", logViewerFetch);
|
|
30906
|
+
app75.use("/vnc-popout.html", logViewerFetch);
|
|
30907
|
+
app75.get("/vnc-popout.html", (c) => {
|
|
30589
30908
|
let html = htmlCache.get("vnc-popout.html");
|
|
30590
30909
|
if (!html) {
|
|
30591
|
-
html =
|
|
30910
|
+
html = readFileSync45(resolve43(process.cwd(), "public", "vnc-popout.html"), "utf-8");
|
|
30592
30911
|
const name = escapeHtml(BRAND.productName);
|
|
30593
30912
|
html = html.replace("<title>Browser \u2014 Maxy</title>", `<title>${name}</title>`);
|
|
30594
30913
|
html = html.replace("</head>", ` ${brandScript}
|
|
@@ -30598,7 +30917,7 @@ app74.get("/vnc-popout.html", (c) => {
|
|
|
30598
30917
|
}
|
|
30599
30918
|
return c.html(html);
|
|
30600
30919
|
});
|
|
30601
|
-
|
|
30920
|
+
app75.post("/api/vnc/client-event", async (c) => {
|
|
30602
30921
|
let body;
|
|
30603
30922
|
try {
|
|
30604
30923
|
body = await c.req.json();
|
|
@@ -30619,11 +30938,11 @@ app74.post("/api/vnc/client-event", async (c) => {
|
|
|
30619
30938
|
});
|
|
30620
30939
|
return c.json({ ok: true });
|
|
30621
30940
|
});
|
|
30622
|
-
|
|
30941
|
+
app75.get("/g/:slug", (c) => {
|
|
30623
30942
|
return c.html(brandedPublicHtml(resolveDefaultSlug() ?? void 0));
|
|
30624
30943
|
});
|
|
30625
30944
|
for (const pwa of PWA_SURFACES) {
|
|
30626
|
-
|
|
30945
|
+
app75.get(pwa.manifestPath, (c) => {
|
|
30627
30946
|
const manifest = buildManifest(pwa, {
|
|
30628
30947
|
productName: BRAND.productName,
|
|
30629
30948
|
appIcon192: brandAppIcon192Path,
|
|
@@ -30639,7 +30958,7 @@ for (const pwa of PWA_SURFACES) {
|
|
|
30639
30958
|
return c.body(JSON.stringify(manifest));
|
|
30640
30959
|
});
|
|
30641
30960
|
}
|
|
30642
|
-
|
|
30961
|
+
app75.get("/sw.js", (c) => {
|
|
30643
30962
|
if (SW_SOURCE == null) {
|
|
30644
30963
|
console.error("[pwa] op=sw status=500 reason=sw-source-missing");
|
|
30645
30964
|
return c.text("Service worker unavailable", 500);
|
|
@@ -30648,12 +30967,12 @@ app74.get("/sw.js", (c) => {
|
|
|
30648
30967
|
console.log(`[pwa] op=sw status=200 ct=${SW_CONTENT_TYPE}`);
|
|
30649
30968
|
return c.body(SW_SOURCE);
|
|
30650
30969
|
});
|
|
30651
|
-
|
|
30970
|
+
app75.get("/graph", (c) => {
|
|
30652
30971
|
const host = (c.req.header("host") ?? "").split(":")[0];
|
|
30653
30972
|
if (isPublicHost(host) || isOperatorHost(host, getOperatorDomains())) return c.text("Not found", 404);
|
|
30654
30973
|
return c.html(cachedHtml("graph.html"));
|
|
30655
30974
|
});
|
|
30656
|
-
|
|
30975
|
+
app75.get("/chat", (c) => {
|
|
30657
30976
|
const host = (c.req.header("host") ?? "").split(":")[0];
|
|
30658
30977
|
if (isOperatorHost(host, getOperatorDomains())) {
|
|
30659
30978
|
console.log(`[host-class] host=${host} class=operator served=operator.html`);
|
|
@@ -30662,47 +30981,47 @@ app74.get("/chat", (c) => {
|
|
|
30662
30981
|
if (isPublicHost(host)) return c.text("Not found", 404);
|
|
30663
30982
|
return c.html(cachedHtml("chat.html"));
|
|
30664
30983
|
});
|
|
30665
|
-
|
|
30984
|
+
app75.get("/data", (c) => {
|
|
30666
30985
|
const host = (c.req.header("host") ?? "").split(":")[0];
|
|
30667
30986
|
if (isPublicHost(host)) return c.text("Not found", 404);
|
|
30668
30987
|
return c.html(cachedHtml("data.html"));
|
|
30669
30988
|
});
|
|
30670
|
-
|
|
30989
|
+
app75.get("/tasks", (c) => {
|
|
30671
30990
|
const host = (c.req.header("host") ?? "").split(":")[0];
|
|
30672
30991
|
if (isPublicHost(host)) return c.text("Not found", 404);
|
|
30673
30992
|
return c.html(cachedHtml("tasks.html"));
|
|
30674
30993
|
});
|
|
30675
|
-
|
|
30994
|
+
app75.get("/activity", (c) => {
|
|
30676
30995
|
const host = (c.req.header("host") ?? "").split(":")[0];
|
|
30677
30996
|
if (isPublicHost(host)) return c.text("Not found", 404);
|
|
30678
30997
|
return c.html(cachedHtml("activity.html"));
|
|
30679
30998
|
});
|
|
30680
|
-
|
|
30999
|
+
app75.get("/calendar", (c) => {
|
|
30681
31000
|
const host = (c.req.header("host") ?? "").split(":")[0];
|
|
30682
31001
|
if (isPublicHost(host)) return c.text("Not found", 404);
|
|
30683
31002
|
return c.html(cachedHtml("calendar.html"));
|
|
30684
31003
|
});
|
|
30685
|
-
|
|
31004
|
+
app75.get("/routines", (c) => {
|
|
30686
31005
|
const host = (c.req.header("host") ?? "").split(":")[0];
|
|
30687
31006
|
if (isPublicHost(host)) return c.text("Not found", 404);
|
|
30688
31007
|
return c.html(cachedHtml("routines.html"));
|
|
30689
31008
|
});
|
|
30690
|
-
|
|
31009
|
+
app75.get("/skills", (c) => {
|
|
30691
31010
|
const host = (c.req.header("host") ?? "").split(":")[0];
|
|
30692
31011
|
if (isPublicHost(host)) return c.text("Not found", 404);
|
|
30693
31012
|
return c.html(cachedHtml("skills.html"));
|
|
30694
31013
|
});
|
|
30695
|
-
|
|
31014
|
+
app75.get("/agents", (c) => {
|
|
30696
31015
|
const host = (c.req.header("host") ?? "").split(":")[0];
|
|
30697
31016
|
if (isPublicHost(host)) return c.text("Not found", 404);
|
|
30698
31017
|
return c.html(cachedHtml("agents.html"));
|
|
30699
31018
|
});
|
|
30700
|
-
|
|
31019
|
+
app75.get("/browser", (c) => {
|
|
30701
31020
|
const host = (c.req.header("host") ?? "").split(":")[0];
|
|
30702
31021
|
if (isPublicHost(host) || isOperatorHost(host, getOperatorDomains())) return c.text("Not found", 404);
|
|
30703
31022
|
return c.html(cachedHtml("browser.html"));
|
|
30704
31023
|
});
|
|
30705
|
-
|
|
31024
|
+
app75.get("/:slug", async (c, next) => {
|
|
30706
31025
|
const slug = c.req.param("slug");
|
|
30707
31026
|
if (AGENT_SLUG_PATTERN.test(`/${slug}`)) {
|
|
30708
31027
|
const account = resolveAccount();
|
|
@@ -30717,13 +31036,13 @@ app74.get("/:slug", async (c, next) => {
|
|
|
30717
31036
|
await next();
|
|
30718
31037
|
});
|
|
30719
31038
|
if (brandFaviconPath !== "/favicon.ico") {
|
|
30720
|
-
|
|
31039
|
+
app75.get("/favicon.ico", (c) => {
|
|
30721
31040
|
c.header("Cache-Control", "public, max-age=300");
|
|
30722
31041
|
return c.redirect(brandFaviconPath, 302);
|
|
30723
31042
|
});
|
|
30724
31043
|
}
|
|
30725
|
-
mountStaticFiles(
|
|
30726
|
-
|
|
31044
|
+
mountStaticFiles(app75, "./public");
|
|
31045
|
+
app75.all("*", (c) => {
|
|
30727
31046
|
const host = (c.req.header("host") ?? "").split(":")[0];
|
|
30728
31047
|
const path = c.req.path;
|
|
30729
31048
|
if (isPublicHost(host)) {
|
|
@@ -30737,11 +31056,11 @@ app74.all("*", (c) => {
|
|
|
30737
31056
|
});
|
|
30738
31057
|
var port = requirePortEnv("MAXY_UI_INTERNAL_PORT", { tag: "ui-server" });
|
|
30739
31058
|
var hostname = process.env.HOSTNAME ?? "127.0.0.1";
|
|
30740
|
-
var httpServer = serve({ fetch:
|
|
31059
|
+
var httpServer = serve({ fetch: app75.fetch, port, hostname });
|
|
30741
31060
|
console.log(`${BRAND.productName} listening on http://${hostname}:${port}`);
|
|
30742
31061
|
{
|
|
30743
31062
|
const reconcilePlatformRoot = process.env.MAXY_PLATFORM_ROOT ?? join52(__dirname, "..");
|
|
30744
|
-
const reconcileScript =
|
|
31063
|
+
const reconcileScript = resolve43(reconcilePlatformRoot, "plugins/scheduling/mcp/dist/scripts/reconcile-bookings.js");
|
|
30745
31064
|
const runReconcile = (ctx) => {
|
|
30746
31065
|
if (!existsSync48(reconcileScript)) return;
|
|
30747
31066
|
try {
|
|
@@ -30782,7 +31101,7 @@ console.log(`${BRAND.productName} listening on http://${hostname}:${port}`);
|
|
|
30782
31101
|
{
|
|
30783
31102
|
const DREAM_CYCLE_SWEEP_INTERVAL_MS = 36e5;
|
|
30784
31103
|
const dreamPlatformRoot = process.env.MAXY_PLATFORM_ROOT ?? join52(__dirname, "..");
|
|
30785
|
-
const dreamSweepScript =
|
|
31104
|
+
const dreamSweepScript = resolve43(dreamPlatformRoot, "plugins/memory/mcp/dist/scripts/dream-cycle-sweep.js");
|
|
30786
31105
|
registerLoop({
|
|
30787
31106
|
name: "dream-cycle-sweep",
|
|
30788
31107
|
intervalMs: DREAM_CYCLE_SWEEP_INTERVAL_MS,
|
|
@@ -30806,7 +31125,7 @@ console.log(`${BRAND.productName} listening on http://${hostname}:${port}`);
|
|
|
30806
31125
|
}
|
|
30807
31126
|
{
|
|
30808
31127
|
const outlookPlatformRoot = process.env.MAXY_PLATFORM_ROOT ?? join52(__dirname, "..");
|
|
30809
|
-
const outlookScript =
|
|
31128
|
+
const outlookScript = resolve43(outlookPlatformRoot, "plugins/outlook/mcp/dist/scripts/complete-registration.js");
|
|
30810
31129
|
const OUTLOOK_COMPLETE_INTERVAL_MS = 3e4;
|
|
30811
31130
|
const runOutlookComplete = (ctx) => {
|
|
30812
31131
|
if (!existsSync48(outlookScript)) return;
|
|
@@ -30832,7 +31151,7 @@ console.log(`${BRAND.productName} listening on http://${hostname}:${port}`);
|
|
|
30832
31151
|
}
|
|
30833
31152
|
{
|
|
30834
31153
|
const auditRoot = process.env.MAXY_PLATFORM_ROOT ?? join52(__dirname, "..");
|
|
30835
|
-
const strandedAccountsDir =
|
|
31154
|
+
const strandedAccountsDir = resolve43(auditRoot, "..", "data/accounts");
|
|
30836
31155
|
const STRANDED_AUDIT_INTERVAL_MS = 3e5;
|
|
30837
31156
|
const STRANDED_AGE_MS = 16 * 6e4;
|
|
30838
31157
|
const STRANDED_UUID_RE = /^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i;
|
|
@@ -30842,7 +31161,7 @@ console.log(`${BRAND.productName} listening on http://${hostname}:${port}`);
|
|
|
30842
31161
|
const now = Date.now();
|
|
30843
31162
|
for (const name of readdirSync28(strandedAccountsDir)) {
|
|
30844
31163
|
if (!STRANDED_UUID_RE.test(name)) continue;
|
|
30845
|
-
const pendingPath2 =
|
|
31164
|
+
const pendingPath2 = resolve43(strandedAccountsDir, name, "secrets/outlook/pending-devicecode.enc");
|
|
30846
31165
|
if (!existsSync48(pendingPath2)) continue;
|
|
30847
31166
|
const ageMs2 = now - statSync25(pendingPath2).mtimeMs;
|
|
30848
31167
|
if (ageMs2 > STRANDED_AGE_MS) {
|
|
@@ -30862,7 +31181,7 @@ console.log(`${BRAND.productName} listening on http://${hostname}:${port}`);
|
|
|
30862
31181
|
}
|
|
30863
31182
|
{
|
|
30864
31183
|
const googleRoot = process.env.MAXY_PLATFORM_ROOT ?? join52(__dirname, "..");
|
|
30865
|
-
const googleAccountsDir =
|
|
31184
|
+
const googleAccountsDir = resolve43(googleRoot, "..", "data/accounts");
|
|
30866
31185
|
const GOOGLE_PENDING_AUDIT_INTERVAL_MS = 3e5;
|
|
30867
31186
|
const runGooglePendingAuditSafe = () => {
|
|
30868
31187
|
try {
|
|
@@ -30877,7 +31196,7 @@ console.log(`${BRAND.productName} listening on http://${hostname}:${port}`);
|
|
|
30877
31196
|
firstRunDelayMs: 27e3,
|
|
30878
31197
|
run: runGooglePendingAuditSafe
|
|
30879
31198
|
});
|
|
30880
|
-
const googleAuditScript =
|
|
31199
|
+
const googleAuditScript = resolve43(googleRoot, "plugins/google/mcp/dist/scripts/account-audit.js");
|
|
30881
31200
|
const GOOGLE_ACCOUNT_AUDIT_INTERVAL_MS = 36e5;
|
|
30882
31201
|
const runGoogleAccountAudit = (ctx) => {
|
|
30883
31202
|
if (!existsSync48(googleAuditScript)) return;
|
|
@@ -30973,7 +31292,7 @@ console.log(`${BRAND.productName} listening on http://${hostname}:${port}`);
|
|
|
30973
31292
|
}
|
|
30974
31293
|
{
|
|
30975
31294
|
const publishPlatformRoot = process.env.MAXY_PLATFORM_ROOT ?? join52(__dirname, "..");
|
|
30976
|
-
const publishScript =
|
|
31295
|
+
const publishScript = resolve43(publishPlatformRoot, "plugins/scheduling/mcp/dist/scripts/publish-availability.js");
|
|
30977
31296
|
const PUBLISH_INTERVAL_MS = 3e5;
|
|
30978
31297
|
const bookingAccounts = () => {
|
|
30979
31298
|
try {
|
|
@@ -31003,21 +31322,21 @@ console.log(`${BRAND.productName} listening on http://${hostname}:${port}`);
|
|
|
31003
31322
|
}
|
|
31004
31323
|
};
|
|
31005
31324
|
const auditSnapshotAge = (account) => {
|
|
31006
|
-
const availPath =
|
|
31325
|
+
const availPath = resolve43(account.accountDir, "calendar-availability.json");
|
|
31007
31326
|
let hasBookingSite = false;
|
|
31008
31327
|
try {
|
|
31009
31328
|
if (existsSync48(availPath)) {
|
|
31010
|
-
const cfg = JSON.parse(
|
|
31329
|
+
const cfg = JSON.parse(readFileSync45(availPath, "utf-8"));
|
|
31011
31330
|
hasBookingSite = typeof cfg.bookingDbName === "string" && cfg.bookingDbName.length > 0;
|
|
31012
31331
|
}
|
|
31013
31332
|
} catch {
|
|
31014
31333
|
}
|
|
31015
31334
|
if (!hasBookingSite) return;
|
|
31016
|
-
const statePath =
|
|
31335
|
+
const statePath = resolve43(account.accountDir, "state", "booking-availability", "last-publish.json");
|
|
31017
31336
|
let lastSuccessAt = null;
|
|
31018
31337
|
if (existsSync48(statePath)) {
|
|
31019
31338
|
try {
|
|
31020
|
-
const rec = JSON.parse(
|
|
31339
|
+
const rec = JSON.parse(readFileSync45(statePath, "utf-8"));
|
|
31021
31340
|
lastSuccessAt = rec.lastSuccessAt ?? null;
|
|
31022
31341
|
} catch {
|
|
31023
31342
|
console.error(`[calendar-availability] op=audit accountId=${account.accountId} snapshotAgeMs=na reason=bad-state-file`);
|
|
@@ -31050,7 +31369,7 @@ startTimeEntryCensus(() => getSession());
|
|
|
31050
31369
|
startLedgerCensus(() => getSession());
|
|
31051
31370
|
{
|
|
31052
31371
|
const auditPlatformRoot = process.env.MAXY_PLATFORM_ROOT ?? join52(__dirname, "..");
|
|
31053
|
-
const auditScript =
|
|
31372
|
+
const auditScript = resolve43(auditPlatformRoot, "plugins/connector/mcp/dist/scripts/audit-connectors.js");
|
|
31054
31373
|
const auditLogDir = process.env.LOG_DIR ?? LOG_DIR;
|
|
31055
31374
|
const CONNECTOR_AUDIT_INTERVAL_MS = 3e5;
|
|
31056
31375
|
const runConnectorAudit = (ctx) => {
|
|
@@ -31134,7 +31453,7 @@ for (const m of SUBAPP_MANIFEST) {
|
|
|
31134
31453
|
}
|
|
31135
31454
|
try {
|
|
31136
31455
|
const registered = [];
|
|
31137
|
-
for (const r of
|
|
31456
|
+
for (const r of app75.routes ?? []) {
|
|
31138
31457
|
if (typeof r.path !== "string" || r.path.includes(":") || r.path.includes("*")) continue;
|
|
31139
31458
|
if (AGENT_SLUG_PATTERN.test(r.path)) {
|
|
31140
31459
|
registered.push({ method: (r.method ?? "ALL").toUpperCase(), path: r.path });
|
|
@@ -31178,7 +31497,7 @@ async function runAdminUserReconcileTick() {
|
|
|
31178
31497
|
console.error("[adminuser-self-heal] skip reason=no-users-file");
|
|
31179
31498
|
return;
|
|
31180
31499
|
}
|
|
31181
|
-
const usersRaw =
|
|
31500
|
+
const usersRaw = readFileSync45(USERS_FILE, "utf-8").trim();
|
|
31182
31501
|
if (!usersRaw) {
|
|
31183
31502
|
console.error("[adminuser-self-heal] skip reason=empty-users-file");
|
|
31184
31503
|
return;
|
|
@@ -31231,7 +31550,7 @@ registerLoop({
|
|
|
31231
31550
|
var USERS_RECONCILE_INTERVAL_MS = 60 * 60 * 1e3;
|
|
31232
31551
|
function countUsersRows() {
|
|
31233
31552
|
if (!existsSync48(USERS_FILE)) return 0;
|
|
31234
|
-
const raw =
|
|
31553
|
+
const raw = readFileSync45(USERS_FILE, "utf-8").trim();
|
|
31235
31554
|
if (!raw) return 0;
|
|
31236
31555
|
const users = JSON.parse(raw);
|
|
31237
31556
|
return users.filter((u) => typeof u.userId === "string").length;
|
|
@@ -31365,7 +31684,7 @@ if (bootAccountConfig?.whatsapp) {
|
|
|
31365
31684
|
}
|
|
31366
31685
|
init({
|
|
31367
31686
|
configDir: configDirForWhatsApp,
|
|
31368
|
-
platformRoot:
|
|
31687
|
+
platformRoot: resolve43(process.env.MAXY_PLATFORM_ROOT ?? join52(__dirname, "..")),
|
|
31369
31688
|
accountConfig: bootAccountConfig,
|
|
31370
31689
|
// Task 2074 — enrich with the sub-account name and fan out to every open
|
|
31371
31690
|
// admin SSE stream. Fire-and-forget: the manager's persist path must not
|