@rubytech/create-maxy-code 0.1.497 → 0.1.498

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.
Files changed (192) hide show
  1. package/package.json +1 -1
  2. package/payload/platform/plugins/admin/skills/platform-architecture/SKILL.md +53 -7
  3. package/payload/platform/plugins/docs/references/admin-ui.md +36 -6
  4. package/payload/platform/plugins/docs/references/sweep-guide.md +16 -0
  5. package/payload/platform/plugins/memory/PLUGIN.md +2 -0
  6. package/payload/platform/plugins/memory/mcp/dist/index.js +2 -2
  7. package/payload/platform/plugins/memory/mcp/dist/index.js.map +1 -1
  8. package/payload/platform/plugins/memory/mcp/dist/scripts/__tests__/dream-cycle-sweep-decision.test.d.ts +2 -0
  9. package/payload/platform/plugins/memory/mcp/dist/scripts/__tests__/dream-cycle-sweep-decision.test.d.ts.map +1 -0
  10. package/payload/platform/plugins/memory/mcp/dist/scripts/__tests__/dream-cycle-sweep-decision.test.js +84 -0
  11. package/payload/platform/plugins/memory/mcp/dist/scripts/__tests__/dream-cycle-sweep-decision.test.js.map +1 -0
  12. package/payload/platform/plugins/memory/mcp/dist/scripts/dream-cycle-sweep-decision.d.ts +54 -0
  13. package/payload/platform/plugins/memory/mcp/dist/scripts/dream-cycle-sweep-decision.d.ts.map +1 -0
  14. package/payload/platform/plugins/memory/mcp/dist/scripts/dream-cycle-sweep-decision.js +58 -0
  15. package/payload/platform/plugins/memory/mcp/dist/scripts/dream-cycle-sweep-decision.js.map +1 -0
  16. package/payload/platform/plugins/memory/mcp/dist/scripts/dream-cycle-sweep.d.ts +30 -0
  17. package/payload/platform/plugins/memory/mcp/dist/scripts/dream-cycle-sweep.d.ts.map +1 -0
  18. package/payload/platform/plugins/memory/mcp/dist/scripts/dream-cycle-sweep.js +204 -0
  19. package/payload/platform/plugins/memory/mcp/dist/scripts/dream-cycle-sweep.js.map +1 -0
  20. package/payload/platform/plugins/memory/mcp/dist/tools/__tests__/conversation-archive-derive-insights.test.js +30 -0
  21. package/payload/platform/plugins/memory/mcp/dist/tools/__tests__/conversation-archive-derive-insights.test.js.map +1 -1
  22. package/payload/platform/plugins/memory/mcp/dist/tools/conversation-archive-derive-insights.d.ts +4 -2
  23. package/payload/platform/plugins/memory/mcp/dist/tools/conversation-archive-derive-insights.d.ts.map +1 -1
  24. package/payload/platform/plugins/memory/mcp/dist/tools/conversation-archive-derive-insights.js +38 -0
  25. package/payload/platform/plugins/memory/mcp/dist/tools/conversation-archive-derive-insights.js.map +1 -1
  26. package/payload/platform/plugins/memory/mcp/vitest.config.ts +2 -0
  27. package/payload/platform/plugins/memory/skills/conversation-archive-enrich/SKILL.md +10 -4
  28. package/payload/platform/plugins/sweep/PLUGIN.md +5 -1
  29. package/payload/platform/plugins/sweep/skills/email-graph-sweep/SKILL.md +165 -0
  30. package/payload/server/package.json +2 -1
  31. package/payload/server/public/activity.html +6 -6
  32. package/payload/server/public/assets/{AdminLoginScreens-BXDYzNbq.js → AdminLoginScreens-Ce5aBBWF.js} +1 -1
  33. package/payload/server/public/assets/AdminShell-BFVVkWFC.js +2 -0
  34. package/payload/server/public/assets/{activity-cVe5ZnG7.js → activity-CKUYOLd2.js} +1 -1
  35. package/payload/server/public/assets/admin-BWb8me-E.js +1 -0
  36. package/payload/server/public/assets/{arc-BrHWN2Kr.js → arc-CpWWSum8.js} +1 -1
  37. package/payload/server/public/assets/architecture-YZFGNWBL-D-AX2VuA.js +1 -0
  38. package/payload/server/public/assets/{architectureDiagram-Q4EWVU46-1OxSL3rT.js → architectureDiagram-Q4EWVU46-D2EzaII0.js} +1 -1
  39. package/payload/server/public/assets/{blockDiagram-DXYQGD6D-C6yKiblF.js → blockDiagram-DXYQGD6D-8kDpaNSZ.js} +1 -1
  40. package/payload/server/public/assets/{bot-Bb8yj02k.js → bot-DESMpxSQ.js} +1 -1
  41. package/payload/server/public/assets/{browser-BdWeCfYJ.js → browser-CpLq_DIo.js} +1 -1
  42. package/payload/server/public/assets/{c4Diagram-AHTNJAMY-BzTyHS1I.js → c4Diagram-AHTNJAMY-CbwmZpK3.js} +1 -1
  43. package/payload/server/public/assets/{calendar-B4KbpiXR.js → calendar-ClOwyuz-.js} +1 -1
  44. package/payload/server/public/assets/channel-DZ5sh6YQ.js +1 -0
  45. package/payload/server/public/assets/chat-qtOiJX-Y.js +1 -0
  46. package/payload/server/public/assets/chevron-left-BzIg4in6.js +1 -0
  47. package/payload/server/public/assets/chevron-right-BcFSa9C3.js +1 -0
  48. package/payload/server/public/assets/{chunk-2KRD3SAO-BGAUfWvM.js → chunk-2KRD3SAO-PFheZ9mw.js} +1 -1
  49. package/payload/server/public/assets/{chunk-336JU56O-M1H_u2Qv.js → chunk-336JU56O-CCFOp5VK.js} +2 -2
  50. package/payload/server/public/assets/chunk-426QAEUC-CcjBLp4a.js +1 -0
  51. package/payload/server/public/assets/{chunk-4BX2VUAB-CkxXXCiF.js → chunk-4BX2VUAB-Hz4JWOf2.js} +1 -1
  52. package/payload/server/public/assets/{chunk-4TB4RGXK-DPWZYGHH.js → chunk-4TB4RGXK-4xeV0s85.js} +1 -1
  53. package/payload/server/public/assets/{chunk-55IACEB6-CBkNmqrt.js → chunk-55IACEB6-4QKgBpoh.js} +1 -1
  54. package/payload/server/public/assets/{chunk-5FUZZQ4R-uIqIu9ha.js → chunk-5FUZZQ4R-ms3K6Z5z.js} +1 -1
  55. package/payload/server/public/assets/{chunk-5PVQY5BW-B_S7XzpE.js → chunk-5PVQY5BW-CIC4GIGi.js} +1 -1
  56. package/payload/server/public/assets/{chunk-67CJDMHE-BbMV1lgW.js → chunk-67CJDMHE-B-XrWVmV.js} +1 -1
  57. package/payload/server/public/assets/{chunk-7N4EOEYR-C49Mv-nQ.js → chunk-7N4EOEYR-C7ECOUYQ.js} +1 -1
  58. package/payload/server/public/assets/{chunk-AA7GKIK3-Dy_pJOp_.js → chunk-AA7GKIK3-DOZ6Fxwk.js} +1 -1
  59. package/payload/server/public/assets/{chunk-BSJP7CBP-Ce-OmPqn.js → chunk-BSJP7CBP-4cJ_b0c6.js} +1 -1
  60. package/payload/server/public/assets/{chunk-CIAEETIT-tnjq-APC.js → chunk-CIAEETIT--mhZipWM.js} +1 -1
  61. package/payload/server/public/assets/{chunk-EDXVE4YY-uzO7kO4e.js → chunk-EDXVE4YY-jZpVwob_.js} +1 -1
  62. package/payload/server/public/assets/{chunk-ENJZ2VHE-DQMOsG1f.js → chunk-ENJZ2VHE-Nn-p-xIA.js} +1 -1
  63. package/payload/server/public/assets/{chunk-FMBD7UC4-Top6y08S.js → chunk-FMBD7UC4-DyNpcKOS.js} +1 -1
  64. package/payload/server/public/assets/{chunk-FOC6F5B3-B9LPNCUS.js → chunk-FOC6F5B3-C0P8q1uz.js} +1 -1
  65. package/payload/server/public/assets/{chunk-ICPOFSXX-DeIt3WoY.js → chunk-ICPOFSXX-CdXQ5SfI.js} +2 -2
  66. package/payload/server/public/assets/{chunk-K5T4RW27-DAnRM04h.js → chunk-K5T4RW27-BVZJKKsT.js} +1 -1
  67. package/payload/server/public/assets/{chunk-KGLVRYIC-C0QYcbLe.js → chunk-KGLVRYIC-QlVWTe0V.js} +1 -1
  68. package/payload/server/public/assets/{chunk-LIHQZDEY-BjvA5ykt.js → chunk-LIHQZDEY-CpGVZutP.js} +1 -1
  69. package/payload/server/public/assets/{chunk-ORNJ4GCN-Cs46Gj7z.js → chunk-ORNJ4GCN-WVcS6fUC.js} +1 -1
  70. package/payload/server/public/assets/{chunk-OYMX7WX6-CBHIFMBx.js → chunk-OYMX7WX6-B7hiSTed.js} +1 -1
  71. package/payload/server/public/assets/chunk-QZHKN3VN-B2WjDYBE.js +1 -0
  72. package/payload/server/public/assets/{chunk-U2HBQHQK-5_DL8yx6.js → chunk-U2HBQHQK-DJPnZxGy.js} +1 -1
  73. package/payload/server/public/assets/{chunk-X2U36JSP-BDCaWRe9.js → chunk-X2U36JSP-DilBs1Yc.js} +1 -1
  74. package/payload/server/public/assets/{chunk-XPW4576I-B10QuxYb.js → chunk-XPW4576I-B5-uyrJ0.js} +1 -1
  75. package/payload/server/public/assets/{chunk-YZCP3GAM-81jJqyDd.js → chunk-YZCP3GAM-BNO4z0Mv.js} +1 -1
  76. package/payload/server/public/assets/{chunk-ZZ45TVLE-DGx3J6Dx.js → chunk-ZZ45TVLE-BzHMQpip.js} +1 -1
  77. package/payload/server/public/assets/classDiagram-6PBFFD2Q-CT3jNrze.js +1 -0
  78. package/payload/server/public/assets/classDiagram-v2-HSJHXN6E-DJRsjAkC.js +1 -0
  79. package/payload/server/public/assets/clock-Dr3NGtjR.js +1 -0
  80. package/payload/server/public/assets/clone-FcEDnoMT.js +1 -0
  81. package/payload/server/public/assets/{cose-bilkent-S5V4N54A-CRDvLRXs.js → cose-bilkent-S5V4N54A-3DWYmn1o.js} +1 -1
  82. package/payload/server/public/assets/{dagre--rdjN6xZ.js → dagre-Cpy31xJW.js} +1 -1
  83. package/payload/server/public/assets/{dagre-KV5264BT-DHbVQPnV.js → dagre-KV5264BT-C8fyxHFd.js} +1 -1
  84. package/payload/server/public/assets/data-BjqC4hyM.js +1 -0
  85. package/payload/server/public/assets/{diagram-5BDNPKRD-D8HC1Idg.js → diagram-5BDNPKRD-ycyhnLvr.js} +1 -1
  86. package/payload/server/public/assets/{diagram-G4DWMVQ6-evvg8aey.js → diagram-G4DWMVQ6-BkeYicIt.js} +1 -1
  87. package/payload/server/public/assets/{diagram-MMDJMWI5-4hZuk-Dd.js → diagram-MMDJMWI5-BcGZU-Q3.js} +1 -1
  88. package/payload/server/public/assets/{diagram-TYMM5635-Cwei1ql9.js → diagram-TYMM5635-DuBDCFb_.js} +1 -1
  89. package/payload/server/public/assets/{dist-B2N0v8hZ.js → dist-BYc_arNy.js} +1 -1
  90. package/payload/server/public/assets/{erDiagram-SMLLAGMA-BG5OK4Fx.js → erDiagram-SMLLAGMA-DmkeOzvp.js} +1 -1
  91. package/payload/server/public/assets/{flatten-naJ5PJ4f.js → flatten-QjnJ1Gcl.js} +1 -1
  92. package/payload/server/public/assets/{flowDiagram-DWJPFMVM-CPB_poda.js → flowDiagram-DWJPFMVM-CkE-pjuB.js} +1 -1
  93. package/payload/server/public/assets/{ganttDiagram-T4ZO3ILL-CD6BL1UP.js → ganttDiagram-T4ZO3ILL-Cjiy3kvE.js} +1 -1
  94. package/payload/server/public/assets/gitGraph-7Q5UKJZL-D1uhnP9U.js +1 -0
  95. package/payload/server/public/assets/{gitGraphDiagram-UUTBAWPF-C-e8FDGn.js → gitGraphDiagram-UUTBAWPF-CsI4lKZm.js} +1 -1
  96. package/payload/server/public/assets/{graph-COyGp2x1.js → graph-B7niLM97.js} +3 -3
  97. package/payload/server/public/assets/{graph-labels-CR-HqNdV.js → graph-labels-DykmXYHA.js} +1 -1
  98. package/payload/server/public/assets/{graphlib-CdCZY1Mj.js → graphlib-BkXxC6D5.js} +1 -1
  99. package/payload/server/public/assets/info-OMHHGYJF-oNm27GAV.js +1 -0
  100. package/payload/server/public/assets/infoDiagram-42DDH7IO-LxTftqyS.js +2 -0
  101. package/payload/server/public/assets/{isEmpty-Bnpg7b8f.js → isEmpty-BavJI9Cn.js} +1 -1
  102. package/payload/server/public/assets/{ishikawaDiagram-UXIWVN3A-CFLhfPpo.js → ishikawaDiagram-UXIWVN3A-D8lZtjRc.js} +1 -1
  103. package/payload/server/public/assets/{journeyDiagram-VCZTEJTY-BN0PaMgT.js → journeyDiagram-VCZTEJTY-kLE7SiR_.js} +1 -1
  104. package/payload/server/public/assets/{kanban-definition-6JOO6SKY-CmRilACp.js → kanban-definition-6JOO6SKY-ove6JuD3.js} +1 -1
  105. package/payload/server/public/assets/{line-DR6Zk7d6.js → line-CZMSoxM6.js} +1 -1
  106. package/payload/server/public/assets/{linear-CAOWPodQ.js → linear-Be8IK9hK.js} +1 -1
  107. package/payload/server/public/assets/{maximize-2-ne1kaQlS.js → maximize-2-BbzPm7o8.js} +1 -1
  108. package/payload/server/public/assets/{mermaid-parser.core-0vmQl6Gn.js → mermaid-parser.core-BBADqbnp.js} +2 -2
  109. package/payload/server/public/assets/{mermaid.core-DWgpHiLh.js → mermaid.core-mH3N7K0I.js} +3 -3
  110. package/payload/server/public/assets/{mindmap-definition-QFDTVHPH-CViR7VGV.js → mindmap-definition-QFDTVHPH-BjwwwWil.js} +1 -1
  111. package/payload/server/public/assets/operator-icJwMkZF.js +1 -0
  112. package/payload/server/public/assets/{ordinal-Wx4m9zHk.js → ordinal-BHeIKG-K.js} +1 -1
  113. package/payload/server/public/assets/packet-4T2RLAQJ-eQNVGiK3.js +1 -0
  114. package/payload/server/public/assets/page-DUgrGrJp.js +1 -0
  115. package/payload/server/public/assets/{page-DwfYACyC.js → page-iG57nKOg.js} +4 -4
  116. package/payload/server/public/assets/{pdf-render-0hyh3Jlf.js → pdf-render-fJz4vym9.js} +1 -1
  117. package/payload/server/public/assets/pie-ZZUOXDRM-E1u-48rt.js +1 -0
  118. package/payload/server/public/assets/{pieDiagram-DEJITSTG-B7YQ1_Kr.js → pieDiagram-DEJITSTG-D-lXWWta.js} +1 -1
  119. package/payload/server/public/assets/{public-BACeh5xm.js → public-CkOumzpf.js} +1 -1
  120. package/payload/server/public/assets/{quadrantDiagram-34T5L4WZ-Dxs0nGu5.js → quadrantDiagram-34T5L4WZ-13QyG_AO.js} +1 -1
  121. package/payload/server/public/assets/radar-PYXPWWZC-Cn2cGN90.js +1 -0
  122. package/payload/server/public/assets/{reduce-BUmc8RDR.js → reduce-Fm685to3.js} +1 -1
  123. package/payload/server/public/assets/{requirementDiagram-MS252O5E-DDNYDqZc.js → requirementDiagram-MS252O5E-Bx45Bgn4.js} +1 -1
  124. package/payload/server/public/assets/{rotate-ccw-tY4mfSrJ.js → rotate-ccw-L42fL8ey.js} +1 -1
  125. package/payload/server/public/assets/routines-JOV6xdYh.js +1 -0
  126. package/payload/server/public/assets/{sankeyDiagram-XADWPNL6-DLWoegU5.js → sankeyDiagram-XADWPNL6-Cj-Gq25v.js} +1 -1
  127. package/payload/server/public/assets/{sequenceDiagram-FGHM5R23-DINNPlTY.js → sequenceDiagram-FGHM5R23-B8RDRq93.js} +1 -1
  128. package/payload/server/public/assets/{src-DHSQDYx-.js → src-D3VYuW_Z.js} +1 -1
  129. package/payload/server/public/assets/{stateDiagram-FHFEXIEX-Dsan8EIl.js → stateDiagram-FHFEXIEX-DoyFF1Kl.js} +1 -1
  130. package/payload/server/public/assets/stateDiagram-v2-QKLJ7IA2-Bml-X4-H.js +1 -0
  131. package/payload/server/public/assets/{tasks-C4nPXsbX.js → tasks-GNtvZL8F.js} +1 -1
  132. package/payload/server/public/assets/{time-entry-format-CmqjpGG2.js → time-entry-format-BreNpFLJ.js} +1 -1
  133. package/payload/server/public/assets/{timeline-definition-GMOUNBTQ-CISzecz5.js → timeline-definition-GMOUNBTQ-Df4RQXm6.js} +1 -1
  134. package/payload/server/public/assets/treeView-SZITEDCU-CimabhXy.js +1 -0
  135. package/payload/server/public/assets/treemap-W4RFUUIX-Cg264rpM.js +1 -0
  136. package/payload/server/public/assets/{triangle-alert-DKZ69dOa.js → triangle-alert-DumCWC08.js} +1 -1
  137. package/payload/server/public/assets/{useCopyFeedback-Cf5jFDR5.js → useCopyFeedback-DHCtz8qX.js} +1 -1
  138. package/payload/server/public/assets/useSubAccountSwitcher-Bc7XHr0L.js +9 -0
  139. package/payload/server/public/assets/{useSubAccountSwitcher-DFnDNIDO.css → useSubAccountSwitcher-DPHQJO7E.css} +1 -1
  140. package/payload/server/public/assets/{useVoiceRecorder-BVdKbTku.js → useVoiceRecorder-Cu6zvuFx.js} +2 -2
  141. package/payload/server/public/assets/{vennDiagram-DHZGUBPP-Bh2s76nJ.js → vennDiagram-DHZGUBPP-D2o5og9l.js} +1 -1
  142. package/payload/server/public/assets/wardley-RL74JXVD-tbgfCg0E.js +1 -0
  143. package/payload/server/public/assets/{wardleyDiagram-NUSXRM2D-Grzw0FHg.js → wardleyDiagram-NUSXRM2D-BDueObbS.js} +1 -1
  144. package/payload/server/public/assets/wrench-iWkROE1V.js +1 -0
  145. package/payload/server/public/assets/{xychartDiagram-5P7HB3ND-7pY90HjH.js → xychartDiagram-5P7HB3ND-BTYs4Fgh.js} +1 -1
  146. package/payload/server/public/browser.html +5 -5
  147. package/payload/server/public/calendar.html +8 -7
  148. package/payload/server/public/chat.html +15 -14
  149. package/payload/server/public/data.html +12 -12
  150. package/payload/server/public/graph.html +10 -10
  151. package/payload/server/public/index.html +16 -16
  152. package/payload/server/public/operator.html +16 -15
  153. package/payload/server/public/public.html +15 -14
  154. package/payload/server/public/routines.html +20 -0
  155. package/payload/server/public/tasks.html +7 -7
  156. package/payload/server/server.js +417 -203
  157. package/payload/server/public/assets/AdminShell-CiTHCp5t.js +0 -2
  158. package/payload/server/public/assets/admin-BbcLizN0.js +0 -1
  159. package/payload/server/public/assets/architecture-YZFGNWBL-CZQzGRSM.js +0 -1
  160. package/payload/server/public/assets/channel-uhtvXKHn.js +0 -1
  161. package/payload/server/public/assets/chat-BEcbZB3e.js +0 -1
  162. package/payload/server/public/assets/chevron-left-Cy_RXwhn.js +0 -1
  163. package/payload/server/public/assets/chevron-right-CEjdB4AT.js +0 -1
  164. package/payload/server/public/assets/chunk-426QAEUC-D4XtWgLR.js +0 -1
  165. package/payload/server/public/assets/chunk-QZHKN3VN-Qlc2PFAj.js +0 -1
  166. package/payload/server/public/assets/classDiagram-6PBFFD2Q-CBH5ngSm.js +0 -1
  167. package/payload/server/public/assets/classDiagram-v2-HSJHXN6E-Ck3eNZce.js +0 -1
  168. package/payload/server/public/assets/clone-Cv8evfNb.js +0 -1
  169. package/payload/server/public/assets/data-L-hMHLBN.js +0 -1
  170. package/payload/server/public/assets/gitGraph-7Q5UKJZL-CBZPQJLj.js +0 -1
  171. package/payload/server/public/assets/info-OMHHGYJF-1vIoX-kP.js +0 -1
  172. package/payload/server/public/assets/infoDiagram-42DDH7IO-BDInZV9G.js +0 -2
  173. package/payload/server/public/assets/operator-Q0F_EEyq.js +0 -1
  174. package/payload/server/public/assets/packet-4T2RLAQJ-CTU0gCGb.js +0 -1
  175. package/payload/server/public/assets/page-bRjlk8Dt.js +0 -1
  176. package/payload/server/public/assets/pie-ZZUOXDRM-D-EEHxhC.js +0 -1
  177. package/payload/server/public/assets/radar-PYXPWWZC-DHXATZGB.js +0 -1
  178. package/payload/server/public/assets/stateDiagram-v2-QKLJ7IA2-B4yeYYgL.js +0 -1
  179. package/payload/server/public/assets/treeView-SZITEDCU-CC7ouMFd.js +0 -1
  180. package/payload/server/public/assets/treemap-W4RFUUIX-CaCg27im.js +0 -1
  181. package/payload/server/public/assets/useSubAccountSwitcher-DdctgpPL.js +0 -9
  182. package/payload/server/public/assets/wardley-RL74JXVD-bMPsqQZ7.js +0 -1
  183. /package/payload/server/public/assets/{_baseFor-k8hYPe-U.js → _baseFor-Bvwvhrz4.js} +0 -0
  184. /package/payload/server/public/assets/{array-BFDiaBgf.js → array-D3d-WgFW.js} +0 -0
  185. /package/payload/server/public/assets/{chunk-TPjIAO9U.js → chunk-fQC6bEKA.js} +0 -0
  186. /package/payload/server/public/assets/{cytoscape.esm-Ch0xptA4.js → cytoscape.esm-Cun-OM6a.js} +0 -0
  187. /package/payload/server/public/assets/{defaultLocale-ZeknFqNe.js → defaultLocale-CisKV5Ew.js} +0 -0
  188. /package/payload/server/public/assets/{init-0VJVrkRJ.js → init-D9ZOVaZ3.js} +0 -0
  189. /package/payload/server/public/assets/{katex-Br7bH10N.js → katex-C-3ZDK8o.js} +0 -0
  190. /package/payload/server/public/assets/{path-INs8XTPH.js → path-BMOgQSLM.js} +0 -0
  191. /package/payload/server/public/assets/{preload-helper-CH6UZRzu.js → preload-helper-DL2DwvxV.js} +0 -0
  192. /package/payload/server/public/assets/{rough.esm-DU9bZLvZ.js → rough.esm-BrTFrov0.js} +0 -0
@@ -7176,8 +7176,8 @@ function webchatTurnTimeoutMs() {
7176
7176
  return Number(process.env.WEBCHAT_TURN_TIMEOUT_MS ?? String(2 * 6e4));
7177
7177
  }
7178
7178
  function createChatRoutes(deps) {
7179
- const app65 = new Hono();
7180
- app65.post("/", async (c) => {
7179
+ const app66 = new Hono();
7180
+ app66.post("/", async (c) => {
7181
7181
  console.log(`[chat-route] entered route=public method=POST`);
7182
7182
  const contentType = c.req.header("content-type") ?? "";
7183
7183
  const account = resolveAccount();
@@ -7441,7 +7441,7 @@ ${result.result.text}` : result.result.text;
7441
7441
  }
7442
7442
  });
7443
7443
  });
7444
- return app65;
7444
+ return app66;
7445
7445
  }
7446
7446
 
7447
7447
  // app/lib/channel-pty-bridge/admin-session-id.ts
@@ -7475,8 +7475,8 @@ function isLoopbackAddr(addr) {
7475
7475
  return addr === "127.0.0.1" || addr === "::1" || addr === "::ffff:127.0.0.1";
7476
7476
  }
7477
7477
  function createScheduleInjectRoutes(deps) {
7478
- const app65 = new Hono();
7479
- app65.post("/", async (c) => {
7478
+ const app66 = new Hono();
7479
+ app66.post("/", async (c) => {
7480
7480
  const env = c.env;
7481
7481
  const remoteAddr = env?.incoming?.socket?.remoteAddress ?? "";
7482
7482
  if (!isLoopbackAddr(remoteAddr)) {
@@ -7577,7 +7577,7 @@ function createScheduleInjectRoutes(deps) {
7577
7577
  console.error(`${TAG20} op=inject-spawn eventId=${eventId} sessionId=${sessionId} result=ok status=-`);
7578
7578
  return c.json({ ok: true }, 200);
7579
7579
  });
7580
- return app65;
7580
+ return app66;
7581
7581
  }
7582
7582
 
7583
7583
  // server/index.ts
@@ -8774,6 +8774,23 @@ function filterConversationsForSubAccount(conversations, managerPhones) {
8774
8774
  }
8775
8775
  return out;
8776
8776
  }
8777
+ function unionThread(a, b) {
8778
+ const seen = /* @__PURE__ */ new Set();
8779
+ const merged = [];
8780
+ for (const rec of [...a, ...b]) {
8781
+ if (seen.has(rec.messageId)) continue;
8782
+ seen.add(rec.messageId);
8783
+ merged.push(rec);
8784
+ }
8785
+ return merged.sort((x, y) => Date.parse(x.dateSent) - Date.parse(y.dateSent));
8786
+ }
8787
+ function unionConversationMaps(a, b) {
8788
+ const out = /* @__PURE__ */ new Map();
8789
+ for (const jid of /* @__PURE__ */ new Set([...a.keys(), ...b.keys()])) {
8790
+ out.set(jid, unionThread(a.get(jid) ?? [], b.get(jid) ?? []));
8791
+ }
8792
+ return out;
8793
+ }
8777
8794
 
8778
8795
  // app/lib/whatsapp/authorize-recall-read.ts
8779
8796
  function authorizeRecallRead(input) {
@@ -9263,7 +9280,10 @@ app2.get("/conversations", (c) => {
9263
9280
  const projecting = projection.managerPhones != null;
9264
9281
  const managerPhonesBound = projection.managerPhones?.length ?? 0;
9265
9282
  const allConversations = readAllConversations(storeAccountId);
9266
- const scoped = projection.managerPhones ? filterConversationsForSubAccount(allConversations, projection.managerPhones) : allConversations;
9283
+ const scoped = projection.managerPhones ? unionConversationMaps(
9284
+ filterConversationsForSubAccount(allConversations, projection.managerPhones),
9285
+ readAllConversations(resolveReadStoreKey(requestedAccountId))
9286
+ ) : allConversations;
9267
9287
  const conversations = [...scoped.entries()].map(([jid, messages]) => {
9268
9288
  const last = messages.length > 0 ? messages[messages.length - 1] : null;
9269
9289
  return {
@@ -9302,12 +9322,20 @@ app2.get("/messages", (c) => {
9302
9322
  projection.managerPhones,
9303
9323
  conversationCounterpartyPhone(jid, storeMessages[0]?.senderTelephone ?? "")
9304
9324
  );
9305
- const bounded = counterpartyBound ? storeMessages : [];
9325
+ const ownStoreAccountId = projecting ? resolveReadStoreKey(requestedAccountId) : storeAccountId;
9326
+ const houseThread = counterpartyBound ? storeMessages : [];
9327
+ const ownThread = projecting ? readConversation(ownStoreAccountId, jid) : [];
9328
+ const sourceById = /* @__PURE__ */ new Map();
9329
+ for (const m of houseThread) if (!sourceById.has(m.messageId)) sourceById.set(m.messageId, storeAccountId);
9330
+ for (const m of ownThread) if (!sourceById.has(m.messageId)) sourceById.set(m.messageId, ownStoreAccountId);
9331
+ const bounded = projecting ? unionThread(houseThread, ownThread) : houseThread;
9306
9332
  const limited = effectiveLimit ? bounded.slice(-effectiveLimit) : bounded;
9307
- const threadReactions = foldReactions(readReactions(storeAccountId, jid));
9333
+ const threadReactions = foldReactions(
9334
+ projecting ? [...readReactions(storeAccountId, jid), ...readReactions(ownStoreAccountId, jid)] : readReactions(storeAccountId, jid)
9335
+ );
9308
9336
  let withAttachments = 0;
9309
9337
  const messages = limited.map((m) => {
9310
- const attachment = recallAttachment(storeAccountId, m.attachmentId);
9338
+ const attachment = recallAttachment(sourceById.get(m.messageId) ?? storeAccountId, m.attachmentId);
9311
9339
  if (attachment) withAttachments += 1;
9312
9340
  const reactions = threadReactions.get(m.msgKeyId);
9313
9341
  return {
@@ -13791,8 +13819,8 @@ async function reapplyLeversViaManager() {
13791
13819
  var WEBCHAT_SEND_TURN_WINDOW_MS = Number(process.env.WEBCHAT_SEND_TURN_WINDOW_MS ?? String(15e3));
13792
13820
  var sendSeq = 0;
13793
13821
  function createWebchatRoutes(deps) {
13794
- const app65 = new Hono();
13795
- app65.post("/send", requireAdminSession, async (c) => {
13822
+ const app66 = new Hono();
13823
+ app66.post("/send", requireAdminSession, async (c) => {
13796
13824
  let accountId;
13797
13825
  try {
13798
13826
  accountId = resolvePlatformAccountId();
@@ -13995,7 +14023,7 @@ ${note}` : note;
13995
14023
  if (turnTimer.unref) turnTimer.unref();
13996
14024
  return c.json({ ok: true });
13997
14025
  });
13998
- app65.post("/interrupt", requireAdminSession, async (c) => {
14026
+ app66.post("/interrupt", requireAdminSession, async (c) => {
13999
14027
  const cacheKey = c.get("cacheKey");
14000
14028
  const requesterUserId = (cacheKey ? getUserIdForSession(cacheKey) : void 0) ?? null;
14001
14029
  const primaryUserId = resolvePrimaryAdminUserId();
@@ -14023,7 +14051,7 @@ ${note}` : note;
14023
14051
  }
14024
14052
  return c.json({ ok: true, stopped: outcome.stopped, intId: outcome.intId, deadChild: outcome.deadChild }, 200);
14025
14053
  });
14026
- app65.post("/settings", requireAdminSession, async (c) => {
14054
+ app66.post("/settings", requireAdminSession, async (c) => {
14027
14055
  const body = await c.req.json().catch(() => null);
14028
14056
  const op = body?.op;
14029
14057
  const value = body?.value;
@@ -14063,7 +14091,7 @@ ${note}` : note;
14063
14091
  console.log(`[webchat:settings] op=${op} outcome=accepted value=${value} settingsApplied=${settingsApplied}`);
14064
14092
  return c.json({ ok: true, settingsApplied });
14065
14093
  });
14066
- app65.get("/session", requireAdminSession, async (c) => {
14094
+ app66.get("/session", requireAdminSession, async (c) => {
14067
14095
  let accountId;
14068
14096
  try {
14069
14097
  accountId = resolvePlatformAccountId();
@@ -14141,7 +14169,7 @@ ${note}` : note;
14141
14169
  const indicators = await fetchComposerIndicators(sessionId);
14142
14170
  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) });
14143
14171
  });
14144
- app65.post("/permission-verdict", requireAdminSession, async (c) => {
14172
+ app66.post("/permission-verdict", requireAdminSession, async (c) => {
14145
14173
  const body = await c.req.json().catch(() => null);
14146
14174
  const sessionId = body?.sessionId;
14147
14175
  const requestId = body?.request_id;
@@ -14158,7 +14186,7 @@ ${note}` : note;
14158
14186
  const ok = deps.resolvePermissionVerdict?.(`session:${sessionId}`, requestId, behavior) ?? false;
14159
14187
  return c.json({ ok });
14160
14188
  });
14161
- return app65;
14189
+ return app66;
14162
14190
  }
14163
14191
 
14164
14192
  // server/routes/webchat-greeting.ts
@@ -23530,6 +23558,161 @@ app46.get("/booking-link", requireAdminSession, (c) => {
23530
23558
  });
23531
23559
  var calendar_default = app46;
23532
23560
 
23561
+ // server/routes/admin/routines.ts
23562
+ import cronParser from "cron-parser";
23563
+ var { parseExpression } = cronParser;
23564
+ var app47 = new Hono();
23565
+ var AUTOMATION_WHERE = "(e.recurrence IS NOT NULL OR e.agentChannel IS NOT NULL OR e.actionPlugin IS NOT NULL)";
23566
+ var ROUTINE_COLS = `e.eventId AS eventId, e.name AS name, e.eventStatus AS eventStatus,
23567
+ e.recurrence AS recurrence, e.nextRun AS nextRun, e.lastTriggered AS lastTriggered,
23568
+ e.timezone AS timezone, e.startDate AS startDate,
23569
+ e.agentChannel AS agentChannel, e.agentDestination AS agentDestination, e.agentPrompt AS agentPrompt,
23570
+ e.actionPlugin AS actionPlugin, e.actionTool AS actionTool, e.actionArgs AS actionArgs,
23571
+ e.notes AS notes, e.lastDispatchResult AS lastDispatchResult, e.lastDispatchAt AS lastDispatchAt`;
23572
+ function mapRoutine(r) {
23573
+ const g = (k) => r.get(k) ?? null;
23574
+ return {
23575
+ eventId: g("eventId"),
23576
+ name: g("name"),
23577
+ eventStatus: g("eventStatus"),
23578
+ recurrence: g("recurrence"),
23579
+ nextRun: g("nextRun"),
23580
+ lastTriggered: g("lastTriggered"),
23581
+ timezone: g("timezone"),
23582
+ startDate: g("startDate"),
23583
+ agentChannel: g("agentChannel"),
23584
+ agentDestination: g("agentDestination"),
23585
+ agentPrompt: g("agentPrompt"),
23586
+ actionPlugin: g("actionPlugin"),
23587
+ actionTool: g("actionTool"),
23588
+ actionArgs: g("actionArgs"),
23589
+ notes: g("notes"),
23590
+ lastDispatchResult: g("lastDispatchResult"),
23591
+ lastDispatchAt: g("lastDispatchAt")
23592
+ };
23593
+ }
23594
+ app47.get("/", requireAdminSession, async (c) => {
23595
+ const accountId = getAccountIdForSession(c.var.cacheKey);
23596
+ if (!accountId) {
23597
+ console.error('[admin:routines] op=list auth-rejected reason="no account for session"');
23598
+ return c.json({ error: "Account not found for session" }, 401);
23599
+ }
23600
+ const session = getSession();
23601
+ try {
23602
+ const res = await session.run(
23603
+ `MATCH (e:Event {accountId: $accountId})
23604
+ WHERE ${AUTOMATION_WHERE}
23605
+ RETURN ${ROUTINE_COLS}
23606
+ ORDER BY e.nextRun`,
23607
+ { accountId }
23608
+ );
23609
+ const routines = res.records.map(mapRoutine);
23610
+ console.log(`[admin:routines] op=list accountId=${accountId.slice(0, 8)} count=${routines.length}`);
23611
+ return c.json({ routines });
23612
+ } catch (err) {
23613
+ const message = err instanceof Error ? err.message : String(err);
23614
+ console.error(`[admin:routines] op=list-fail err="${message}"`);
23615
+ return c.json({ error: `Routines unavailable: ${message}` }, 503);
23616
+ } finally {
23617
+ await session.close();
23618
+ }
23619
+ });
23620
+ app47.get("/:eventId", requireAdminSession, async (c) => {
23621
+ const accountId = getAccountIdForSession(c.var.cacheKey);
23622
+ if (!accountId) return c.json({ error: "Account not found for session" }, 401);
23623
+ const eventId = c.req.param("eventId");
23624
+ const session = getSession();
23625
+ try {
23626
+ const res = await session.run(
23627
+ `MATCH (e:Event {eventId: $eventId, accountId: $accountId})
23628
+ WHERE ${AUTOMATION_WHERE}
23629
+ RETURN ${ROUTINE_COLS}`,
23630
+ { eventId, accountId }
23631
+ );
23632
+ const found = res.records.length > 0;
23633
+ console.log(`[admin:routines] op=get id=${eventId.slice(0, 8)} found=${found}`);
23634
+ if (!found) return c.json({ error: "Routine not found" }, 404);
23635
+ return c.json({ routine: mapRoutine(res.records[0]) });
23636
+ } catch (err) {
23637
+ const message = err instanceof Error ? err.message : String(err);
23638
+ console.error(`[admin:routines] op=get-fail id=${eventId.slice(0, 8)} err="${message}"`);
23639
+ return c.json({ error: `Routine unavailable: ${message}` }, 503);
23640
+ } finally {
23641
+ await session.close();
23642
+ }
23643
+ });
23644
+ app47.patch("/:eventId", requireAdminSession, async (c) => {
23645
+ const accountId = getAccountIdForSession(c.var.cacheKey);
23646
+ if (!accountId) return c.json({ error: "Account not found for session" }, 401);
23647
+ const eventId = c.req.param("eventId");
23648
+ const body = await c.req.json().catch(() => ({}));
23649
+ const setClauses = [];
23650
+ const params = { eventId, accountId };
23651
+ const fields = [];
23652
+ let nextRunLog = "unchanged";
23653
+ if (typeof body.agentPrompt === "string") {
23654
+ setClauses.push("e.agentPrompt = $agentPrompt");
23655
+ params.agentPrompt = body.agentPrompt;
23656
+ fields.push("agentPrompt");
23657
+ }
23658
+ if (typeof body.recurrence === "string") {
23659
+ const tzSession = getSession();
23660
+ let timezone = null;
23661
+ try {
23662
+ const tzRes = await tzSession.run(
23663
+ `MATCH (e:Event {eventId: $eventId, accountId: $accountId}) RETURN e.timezone AS timezone`,
23664
+ { eventId, accountId }
23665
+ );
23666
+ timezone = tzRes.records[0]?.get("timezone") ?? null;
23667
+ } catch (err) {
23668
+ const message = err instanceof Error ? err.message : String(err);
23669
+ console.error(`[admin:routines] op=patch id=${eventId.slice(0, 8)} outcome=rejected reason=tz-read-fail err="${message}"`);
23670
+ return c.json({ error: `Routine unavailable: ${message}` }, 503);
23671
+ } finally {
23672
+ await tzSession.close();
23673
+ }
23674
+ try {
23675
+ const interval = parseExpression(body.recurrence, { currentDate: /* @__PURE__ */ new Date(), tz: timezone ?? void 0 });
23676
+ const nextRun = interval.next().toISOString();
23677
+ setClauses.push("e.recurrence = $recurrence", "e.nextRun = $nextRun");
23678
+ params.recurrence = body.recurrence;
23679
+ params.nextRun = nextRun;
23680
+ fields.push("recurrence");
23681
+ nextRunLog = nextRun;
23682
+ } catch (err) {
23683
+ const reason = err instanceof Error ? err.message : String(err);
23684
+ console.error(`[admin:routines] op=patch id=${eventId.slice(0, 8)} outcome=rejected reason=invalid-cron cron=${body.recurrence}`);
23685
+ return c.json({ error: `Invalid recurrence: ${reason}` }, 400);
23686
+ }
23687
+ }
23688
+ if (setClauses.length === 0) return c.json({ error: "No editable fields supplied" }, 400);
23689
+ setClauses.push("e.updatedAt = $updatedAt");
23690
+ params.updatedAt = (/* @__PURE__ */ new Date()).toISOString();
23691
+ const session = getSession();
23692
+ try {
23693
+ const res = await session.run(
23694
+ `MATCH (e:Event {eventId: $eventId, accountId: $accountId})
23695
+ WHERE ${AUTOMATION_WHERE}
23696
+ SET ${setClauses.join(", ")}
23697
+ RETURN ${ROUTINE_COLS}`,
23698
+ params
23699
+ );
23700
+ if (res.records.length === 0) {
23701
+ console.error(`[admin:routines] op=patch id=${eventId.slice(0, 8)} outcome=rejected reason=not-found`);
23702
+ return c.json({ error: "Routine not found" }, 404);
23703
+ }
23704
+ console.log(`[admin:routines] op=patch id=${eventId.slice(0, 8)} fields=${fields.join("+")} outcome=ok nextRun=${nextRunLog} cron=${params.recurrence ?? "unchanged"}`);
23705
+ return c.json({ routine: mapRoutine(res.records[0]) });
23706
+ } catch (err) {
23707
+ const message = err instanceof Error ? err.message : String(err);
23708
+ console.error(`[admin:routines] op=patch id=${eventId.slice(0, 8)} outcome=rejected reason=${message}`);
23709
+ return c.json({ error: `Update failed: ${message}` }, 503);
23710
+ } finally {
23711
+ await session.close();
23712
+ }
23713
+ });
23714
+ var routines_default = app47;
23715
+
23533
23716
  // app/lib/time-entry-format.ts
23534
23717
  function secondsBetween(startIso, endIso) {
23535
23718
  const s = Date.parse(startIso);
@@ -23551,8 +23734,8 @@ function toNum(v) {
23551
23734
  var TAG39 = "[task-timer]";
23552
23735
  var COMPLETED = /* @__PURE__ */ new Set(["completed"]);
23553
23736
  var HIDDEN_FROM_OPEN = /* @__PURE__ */ new Set(["completed", "cancelled"]);
23554
- var app47 = new Hono();
23555
- app47.get("/", requireAdminSession, async (c) => {
23737
+ var app48 = new Hono();
23738
+ app48.get("/", requireAdminSession, async (c) => {
23556
23739
  const cacheKey = c.var.cacheKey;
23557
23740
  const accountId = getAccountIdForSession(cacheKey);
23558
23741
  if (!accountId) {
@@ -23639,13 +23822,13 @@ app47.get("/", requireAdminSession, async (c) => {
23639
23822
  await session.close();
23640
23823
  }
23641
23824
  });
23642
- var tasks_list_default = app47;
23825
+ var tasks_list_default = app48;
23643
23826
 
23644
23827
  // server/routes/admin/task-timer-start.ts
23645
23828
  import { randomUUID as randomUUID14 } from "crypto";
23646
23829
  var TAG40 = "[task-timer]";
23647
- var app48 = new Hono();
23648
- app48.post("/", requireAdminSession, async (c) => {
23830
+ var app49 = new Hono();
23831
+ app49.post("/", requireAdminSession, async (c) => {
23649
23832
  const cacheKey = c.var.cacheKey;
23650
23833
  const accountId = getAccountIdForSession(cacheKey);
23651
23834
  if (!accountId) return c.json({ error: "Account not found for session" }, 401);
@@ -23700,13 +23883,13 @@ app48.post("/", requireAdminSession, async (c) => {
23700
23883
  await session.close();
23701
23884
  }
23702
23885
  });
23703
- var task_timer_start_default = app48;
23886
+ var task_timer_start_default = app49;
23704
23887
 
23705
23888
  // server/routes/admin/task-timer-stop.ts
23706
23889
  import neo4j5 from "neo4j-driver";
23707
23890
  var TAG41 = "[task-timer]";
23708
- var app49 = new Hono();
23709
- app49.post("/", requireAdminSession, async (c) => {
23891
+ var app50 = new Hono();
23892
+ app50.post("/", requireAdminSession, async (c) => {
23710
23893
  const cacheKey = c.var.cacheKey;
23711
23894
  const accountId = getAccountIdForSession(cacheKey);
23712
23895
  if (!accountId) return c.json({ error: "Account not found for session" }, 401);
@@ -23773,12 +23956,12 @@ app49.post("/", requireAdminSession, async (c) => {
23773
23956
  await session.close();
23774
23957
  }
23775
23958
  });
23776
- var task_timer_stop_default = app49;
23959
+ var task_timer_stop_default = app50;
23777
23960
 
23778
23961
  // server/routes/admin/task-complete.ts
23779
23962
  var TAG42 = "[task-timer]";
23780
- var app50 = new Hono();
23781
- app50.post("/", requireAdminSession, async (c) => {
23963
+ var app51 = new Hono();
23964
+ app51.post("/", requireAdminSession, async (c) => {
23782
23965
  const cacheKey = c.var.cacheKey;
23783
23966
  const accountId = getAccountIdForSession(cacheKey);
23784
23967
  if (!accountId) return c.json({ error: "Account not found for session" }, 401);
@@ -23816,14 +23999,14 @@ app50.post("/", requireAdminSession, async (c) => {
23816
23999
  await session.close();
23817
24000
  }
23818
24001
  });
23819
- var task_complete_default = app50;
24002
+ var task_complete_default = app51;
23820
24003
 
23821
24004
  // server/routes/admin/task-time-adjust.ts
23822
24005
  import { randomUUID as randomUUID15 } from "crypto";
23823
24006
  import neo4j6 from "neo4j-driver";
23824
24007
  var TAG43 = "[task-time-adjust]";
23825
- var app51 = new Hono();
23826
- app51.post("/", requireAdminSession, async (c) => {
24008
+ var app52 = new Hono();
24009
+ app52.post("/", requireAdminSession, async (c) => {
23827
24010
  const cacheKey = c.var.cacheKey;
23828
24011
  const accountId = getAccountIdForSession(cacheKey);
23829
24012
  if (!accountId) return c.json({ error: "Account not found for session" }, 401);
@@ -23897,11 +24080,11 @@ app51.post("/", requireAdminSession, async (c) => {
23897
24080
  await session.close();
23898
24081
  }
23899
24082
  });
23900
- var task_time_adjust_default = app51;
24083
+ var task_time_adjust_default = app52;
23901
24084
 
23902
24085
  // server/routes/admin/activity.ts
23903
24086
  import { readdirSync as readdirSync24 } from "fs";
23904
- var app52 = new Hono();
24087
+ var app53 = new Hono();
23905
24088
  var TAG44 = "[activity]";
23906
24089
  function resolveHouseAccountId(accounts) {
23907
24090
  const houses = accounts.filter((a) => a.config.role === "house");
@@ -23923,7 +24106,7 @@ function countAccountDirsOnDisk() {
23923
24106
  return null;
23924
24107
  }
23925
24108
  }
23926
- app52.get("/", requireAdminSession, async (c) => {
24109
+ app53.get("/", requireAdminSession, async (c) => {
23927
24110
  const req = requestToken();
23928
24111
  const cacheKey = c.var.cacheKey;
23929
24112
  const caller2 = getAccountIdForSession(cacheKey) ?? null;
@@ -24032,60 +24215,61 @@ app52.get("/", requireAdminSession, async (c) => {
24032
24215
  }
24033
24216
  });
24034
24217
  });
24035
- var activity_default = app52;
24218
+ var activity_default = app53;
24036
24219
 
24037
24220
  // server/routes/admin/index.ts
24038
- var app53 = new Hono();
24039
- app53.route("/session", session_default);
24040
- app53.route("/accounts", accounts_default);
24041
- app53.route("/logs", logs_default);
24042
- app53.route("/claude-info", claude_info_default);
24043
- app53.route("/attachment", attachment_default);
24044
- app53.route("/agents", agents_default);
24045
- app53.route("/sessions", sessions_default);
24046
- app53.route("/claude-sessions", claude_sessions_default);
24047
- app53.route("/log-ingest", log_ingest_default);
24048
- app53.route("/events", events_default);
24049
- app53.route("/files", files_default);
24050
- app53.route("/graph-search", graph_search_default);
24051
- app53.route("/graph-subgraph", graph_subgraph_default);
24052
- app53.route("/graph-delete", graph_delete_default);
24053
- app53.route("/graph-restore", graph_restore_default);
24054
- app53.route("/graph-labels-in-graph", graph_labels_in_graph_default);
24055
- app53.route("/graph-default-view", graph_default_view_default);
24056
- app53.route("/sidebar-artefacts", sidebar_artefacts_default);
24057
- app53.route("/sidebar-sessions", sidebar_sessions_default);
24058
- app53.route("/session-delete", session_delete_default);
24059
- app53.route("/session-stop", session_stop_default);
24060
- app53.route("/session-archive", session_archive_default);
24061
- app53.route("/session-rename", session_rename_default);
24062
- app53.route("/session-usage", session_usage_default);
24063
- app53.route("/browser", browser_default);
24064
- app53.route("/session-rc-spawn", session_rc_spawn_default);
24065
- app53.route("/session-reseat", session_reseat_default);
24066
- app53.route("/system-stats", system_stats_default);
24067
- app53.route("/health-brand", health_default2);
24068
- app53.route("/linkedin-ingest", linkedin_ingest_default);
24069
- app53.route("/post-turn-context", post_turn_context_default);
24070
- app53.route("/public-session-context", public_session_context_default);
24071
- app53.route("/public-session-exit", public_session_exit_default);
24072
- app53.route("/access-session-evict", access_session_evict_default);
24073
- app53.route("/enrol-person", enrol_person_default);
24074
- app53.route("/calendar", calendar_default);
24075
- app53.route("/tasks-list", tasks_list_default);
24076
- app53.route("/task-timer-start", task_timer_start_default);
24077
- app53.route("/task-timer-stop", task_timer_stop_default);
24078
- app53.route("/task-complete", task_complete_default);
24079
- app53.route("/task-time-adjust", task_time_adjust_default);
24080
- app53.route("/activity", activity_default);
24081
- var admin_default = app53;
24221
+ var app54 = new Hono();
24222
+ app54.route("/session", session_default);
24223
+ app54.route("/accounts", accounts_default);
24224
+ app54.route("/logs", logs_default);
24225
+ app54.route("/claude-info", claude_info_default);
24226
+ app54.route("/attachment", attachment_default);
24227
+ app54.route("/agents", agents_default);
24228
+ app54.route("/sessions", sessions_default);
24229
+ app54.route("/claude-sessions", claude_sessions_default);
24230
+ app54.route("/log-ingest", log_ingest_default);
24231
+ app54.route("/events", events_default);
24232
+ app54.route("/files", files_default);
24233
+ app54.route("/graph-search", graph_search_default);
24234
+ app54.route("/graph-subgraph", graph_subgraph_default);
24235
+ app54.route("/graph-delete", graph_delete_default);
24236
+ app54.route("/graph-restore", graph_restore_default);
24237
+ app54.route("/graph-labels-in-graph", graph_labels_in_graph_default);
24238
+ app54.route("/graph-default-view", graph_default_view_default);
24239
+ app54.route("/sidebar-artefacts", sidebar_artefacts_default);
24240
+ app54.route("/sidebar-sessions", sidebar_sessions_default);
24241
+ app54.route("/session-delete", session_delete_default);
24242
+ app54.route("/session-stop", session_stop_default);
24243
+ app54.route("/session-archive", session_archive_default);
24244
+ app54.route("/session-rename", session_rename_default);
24245
+ app54.route("/session-usage", session_usage_default);
24246
+ app54.route("/browser", browser_default);
24247
+ app54.route("/session-rc-spawn", session_rc_spawn_default);
24248
+ app54.route("/session-reseat", session_reseat_default);
24249
+ app54.route("/system-stats", system_stats_default);
24250
+ app54.route("/health-brand", health_default2);
24251
+ app54.route("/linkedin-ingest", linkedin_ingest_default);
24252
+ app54.route("/post-turn-context", post_turn_context_default);
24253
+ app54.route("/public-session-context", public_session_context_default);
24254
+ app54.route("/public-session-exit", public_session_exit_default);
24255
+ app54.route("/access-session-evict", access_session_evict_default);
24256
+ app54.route("/enrol-person", enrol_person_default);
24257
+ app54.route("/calendar", calendar_default);
24258
+ app54.route("/routines", routines_default);
24259
+ app54.route("/tasks-list", tasks_list_default);
24260
+ app54.route("/task-timer-start", task_timer_start_default);
24261
+ app54.route("/task-timer-stop", task_timer_stop_default);
24262
+ app54.route("/task-complete", task_complete_default);
24263
+ app54.route("/task-time-adjust", task_time_adjust_default);
24264
+ app54.route("/activity", activity_default);
24265
+ var admin_default = app54;
24082
24266
 
24083
24267
  // server/routes/access/verify-token.ts
24084
24268
  var TAG45 = "[access-verify]";
24085
24269
  var MINT_TAG = "[access-session-mint]";
24086
24270
  var COOKIE_NAME = "__access_session";
24087
- var app54 = new Hono();
24088
- app54.post("/", async (c) => {
24271
+ var app55 = new Hono();
24272
+ app55.post("/", async (c) => {
24089
24273
  const ip = c.var.clientIp || "unknown";
24090
24274
  let body;
24091
24275
  try {
@@ -24167,7 +24351,7 @@ app54.post("/", async (c) => {
24167
24351
  displayName: grant.displayName
24168
24352
  });
24169
24353
  });
24170
- var verify_token_default = app54;
24354
+ var verify_token_default = app55;
24171
24355
 
24172
24356
  // app/lib/access-email.ts
24173
24357
  import { spawn as spawn2 } from "child_process";
@@ -24230,9 +24414,9 @@ async function sendMagicLinkEmail(payload) {
24230
24414
 
24231
24415
  // server/routes/access/request-magic-link.ts
24232
24416
  var TAG46 = "[access-request-link]";
24233
- var app55 = new Hono();
24417
+ var app56 = new Hono();
24234
24418
  var VISITOR_MESSAGE = "If that email is on the invite list, a fresh link is on the way.";
24235
- app55.post("/", async (c) => {
24419
+ app56.post("/", async (c) => {
24236
24420
  let body;
24237
24421
  try {
24238
24422
  body = await c.req.json();
@@ -24306,13 +24490,13 @@ app55.post("/", async (c) => {
24306
24490
  );
24307
24491
  return c.json({ message: VISITOR_MESSAGE }, 200);
24308
24492
  });
24309
- var request_magic_link_default = app55;
24493
+ var request_magic_link_default = app56;
24310
24494
 
24311
24495
  // server/routes/access/index.ts
24312
- var app56 = new Hono();
24313
- app56.route("/verify-token", verify_token_default);
24314
- app56.route("/request-magic-link", request_magic_link_default);
24315
- var access_default = app56;
24496
+ var app57 = new Hono();
24497
+ app57.route("/verify-token", verify_token_default);
24498
+ app57.route("/request-magic-link", request_magic_link_default);
24499
+ var access_default = app57;
24316
24500
 
24317
24501
  // server/routes/sites.ts
24318
24502
  import { existsSync as existsSync36, readFileSync as readFileSync39, realpathSync as realpathSync7, statSync as statSync14 } from "fs";
@@ -24347,8 +24531,8 @@ function getExt(p) {
24347
24531
  if (idx < p.lastIndexOf("/")) return "";
24348
24532
  return p.slice(idx).toLowerCase();
24349
24533
  }
24350
- var app57 = new Hono();
24351
- app57.get("/:rel{.*}", (c) => {
24534
+ var app58 = new Hono();
24535
+ app58.get("/:rel{.*}", (c) => {
24352
24536
  const reqPath = c.req.path;
24353
24537
  const rawRel = c.req.param("rel") ?? "";
24354
24538
  const trimmed = rawRel.replace(/^\/+/, "").replace(/\/+$/, "");
@@ -24451,7 +24635,7 @@ app57.get("/:rel{.*}", (c) => {
24451
24635
  "X-Content-Type-Options": "nosniff"
24452
24636
  });
24453
24637
  });
24454
- var sites_default = app57;
24638
+ var sites_default = app58;
24455
24639
 
24456
24640
  // app/lib/visitor-token.ts
24457
24641
  import { createHmac, randomBytes, timingSafeEqual } from "crypto";
@@ -24551,7 +24735,7 @@ function readBrandConfig() {
24551
24735
  }
24552
24736
 
24553
24737
  // server/routes/visitor-consent.ts
24554
- var app58 = new Hono();
24738
+ var app59 = new Hono();
24555
24739
  var CONSENT_COOKIE_NAME = "mxy_consent";
24556
24740
  var CONSENT_COOKIE_MAX_AGE_SECONDS = 60 * 60 * 24 * 365;
24557
24741
  var DEFAULT_CONSENT_COPY = {
@@ -24596,17 +24780,17 @@ function siteSlugFromReferer(referer) {
24596
24780
  return "";
24597
24781
  }
24598
24782
  }
24599
- app58.options("/consent", (c) => {
24783
+ app59.options("/consent", (c) => {
24600
24784
  const origin = getOrigin(c);
24601
24785
  setCorsHeaders(c, origin);
24602
24786
  return c.body(null, 204);
24603
24787
  });
24604
- app58.options("/brand-config", (c) => {
24788
+ app59.options("/brand-config", (c) => {
24605
24789
  const origin = getOrigin(c);
24606
24790
  setCorsHeaders(c, origin);
24607
24791
  return c.body(null, 204);
24608
24792
  });
24609
- app58.post("/consent", async (c) => {
24793
+ app59.post("/consent", async (c) => {
24610
24794
  const origin = getOrigin(c);
24611
24795
  setCorsHeaders(c, origin);
24612
24796
  let raw;
@@ -24646,7 +24830,7 @@ app58.post("/consent", async (c) => {
24646
24830
  console.log(`[consent] ${parsed.decision} site=${site} brand=${brandName} tokenBound=${tokenBound}`);
24647
24831
  return c.body(null, 204);
24648
24832
  });
24649
- app58.get("/brand-config", (c) => {
24833
+ app59.get("/brand-config", (c) => {
24650
24834
  const origin = getOrigin(c);
24651
24835
  setCorsHeaders(c, origin);
24652
24836
  const brand = readBrandConfig();
@@ -24656,7 +24840,7 @@ app58.get("/brand-config", (c) => {
24656
24840
  c.header("Cache-Control", "public, max-age=300");
24657
24841
  return c.json({ consent: { copy, palette } });
24658
24842
  });
24659
- var visitor_consent_default = app58;
24843
+ var visitor_consent_default = app59;
24660
24844
 
24661
24845
  // server/routes/listings.ts
24662
24846
  function getCookie(headerValue, name) {
@@ -24683,8 +24867,8 @@ function appendConsentParams(pageUrl, token) {
24683
24867
  }
24684
24868
  var SAFE_SLUG_RE = /^[a-z0-9](?:[a-z0-9-]{0,118}[a-z0-9])?$/;
24685
24869
  var CHAT_SESSION_KEY_RE = /^[A-Za-z0-9][A-Za-z0-9_-]{7,127}$/;
24686
- var app59 = new Hono();
24687
- app59.get("/:slug/click", async (c) => {
24870
+ var app60 = new Hono();
24871
+ app60.get("/:slug/click", async (c) => {
24688
24872
  const slug = c.req.param("slug") ?? "";
24689
24873
  const rawSession = c.req.query("session") ?? "";
24690
24874
  const sessionKey = CHAT_SESSION_KEY_RE.test(rawSession) ? rawSession : "invalid";
@@ -24748,10 +24932,10 @@ app59.get("/:slug/click", async (c) => {
24748
24932
  console.log(`[property-card-click] sessionKey=${sessionKey} listingSlug=${slug} consent=${consentCookie ?? "absent"} ts=${(/* @__PURE__ */ new Date()).toISOString()}`);
24749
24933
  return c.redirect(redirectUrl, 302);
24750
24934
  });
24751
- var listings_default = app59;
24935
+ var listings_default = app60;
24752
24936
 
24753
24937
  // server/routes/visitor-event.ts
24754
- var app60 = new Hono();
24938
+ var app61 = new Hono();
24755
24939
  var BOT_UA_RE = /\b(bot|crawl|spider|slurp|headlesschrome|phantomjs|googlebot|bingbot|yandex|baiduspider|ahrefsbot|semrushbot|mj12bot|dotbot|petalbot)\b/i;
24756
24940
  var buckets = /* @__PURE__ */ new Map();
24757
24941
  var RATE_LIMIT = 60;
@@ -24827,12 +25011,12 @@ function originAllowed(origin, allowlist) {
24827
25011
  return false;
24828
25012
  }
24829
25013
  }
24830
- app60.options("/event", (c) => {
25014
+ app61.options("/event", (c) => {
24831
25015
  const origin = getOrigin2(c);
24832
25016
  setCorsHeaders2(c, origin);
24833
25017
  return c.body(null, 204);
24834
25018
  });
24835
- app60.post("/event", async (c) => {
25019
+ app61.post("/event", async (c) => {
24836
25020
  const origin = getOrigin2(c);
24837
25021
  setCorsHeaders2(c, origin);
24838
25022
  const ua = c.req.header("user-agent") ?? "";
@@ -25037,7 +25221,7 @@ async function writeEvent(opts) {
25037
25221
  );
25038
25222
  }
25039
25223
  }
25040
- var visitor_event_default = app60;
25224
+ var visitor_event_default = app61;
25041
25225
 
25042
25226
  // server/routes/session.ts
25043
25227
  import { resolve as resolve33 } from "path";
@@ -25083,8 +25267,8 @@ function withVisitorCookie(response, visitorId) {
25083
25267
  headers
25084
25268
  });
25085
25269
  }
25086
- var app61 = new Hono();
25087
- app61.post("/", async (c) => {
25270
+ var app62 = new Hono();
25271
+ app62.post("/", async (c) => {
25088
25272
  let body;
25089
25273
  try {
25090
25274
  body = await c.req.json();
@@ -25231,7 +25415,7 @@ app61.post("/", async (c) => {
25231
25415
  newVisitorId
25232
25416
  );
25233
25417
  });
25234
- var session_default2 = app61;
25418
+ var session_default2 = app62;
25235
25419
 
25236
25420
  // server/lib/calendar-slots.ts
25237
25421
  var WEEKDAYS = ["sun", "mon", "tue", "wed", "thu", "fri", "sat"];
@@ -25314,17 +25498,17 @@ function computeOpenSlots(config, busy, fromISO, toISO) {
25314
25498
  }
25315
25499
 
25316
25500
  // server/routes/calendar-public.ts
25317
- var app62 = new Hono();
25501
+ var app63 = new Hono();
25318
25502
  function setCors(c) {
25319
25503
  c.header("Access-Control-Allow-Origin", "*");
25320
25504
  c.header("Access-Control-Allow-Methods", "GET, OPTIONS");
25321
25505
  c.header("Access-Control-Allow-Headers", "content-type");
25322
25506
  }
25323
- app62.options("/free-busy", (c) => {
25507
+ app63.options("/free-busy", (c) => {
25324
25508
  setCors(c);
25325
25509
  return c.body(null, 204);
25326
25510
  });
25327
- app62.get("/free-busy", async (c) => {
25511
+ app63.get("/free-busy", async (c) => {
25328
25512
  setCors(c);
25329
25513
  const from = c.req.query("from");
25330
25514
  const to = c.req.query("to");
@@ -25380,14 +25564,14 @@ app62.get("/free-busy", async (c) => {
25380
25564
  await session.close();
25381
25565
  }
25382
25566
  });
25383
- var calendar_public_default = app62;
25567
+ var calendar_public_default = app63;
25384
25568
 
25385
25569
  // server/routes/portal-fetch.ts
25386
25570
  import { createReadStream as createReadStream3 } from "fs";
25387
25571
  import { stat as stat8, readFile as readFile8, realpath } from "fs/promises";
25388
25572
  import { join as join44, resolve as resolve34, sep as sep9 } from "path";
25389
25573
  import { Readable as Readable3 } from "stream";
25390
- var app63 = new Hono();
25574
+ var app64 = new Hono();
25391
25575
  var TAG47 = "[portal-fetch]";
25392
25576
  async function verifySignature(secret, accountId, relPath, expiresAtMs, signature, nowMs) {
25393
25577
  if (!secret || !signature) return false;
@@ -25550,9 +25734,9 @@ async function handle(c, headOnly) {
25550
25734
  }
25551
25735
  });
25552
25736
  }
25553
- app63.get("/fetch", (c) => handle(c, false));
25554
- app63.on("HEAD", "/fetch", (c) => handle(c, true));
25555
- var portal_fetch_default = app63;
25737
+ app64.get("/fetch", (c) => handle(c, false));
25738
+ app64.on("HEAD", "/fetch", (c) => handle(c, true));
25739
+ var portal_fetch_default = app64;
25556
25740
 
25557
25741
  // app/lib/timeentry-census.ts
25558
25742
  var TAG48 = "[timeentry-census]";
@@ -26612,8 +26796,8 @@ var streamSSE = (c, cb, onError) => {
26612
26796
 
26613
26797
  // app/lib/whatsapp/gateway/routes.ts
26614
26798
  function createWaChannelRoutes(deps) {
26615
- const app65 = new Hono();
26616
- app65.get("/wa-channel/inbound", (c) => {
26799
+ const app66 = new Hono();
26800
+ app66.get("/wa-channel/inbound", (c) => {
26617
26801
  const senderId = c.req.query("senderId");
26618
26802
  if (!senderId) return c.json({ error: "senderId required" }, 400);
26619
26803
  return streamSSE(c, async (stream2) => {
@@ -26631,7 +26815,7 @@ function createWaChannelRoutes(deps) {
26631
26815
  }
26632
26816
  });
26633
26817
  });
26634
- app65.post("/wa-channel/reply", async (c) => {
26818
+ app66.post("/wa-channel/reply", async (c) => {
26635
26819
  const body = await c.req.json().catch(() => null);
26636
26820
  const senderId = body?.senderId;
26637
26821
  const text = body?.text;
@@ -26652,7 +26836,7 @@ function createWaChannelRoutes(deps) {
26652
26836
  console.error(`[whatsapp-native] op=reply-dispatch senderId=${senderId} bytes=${bytes}`);
26653
26837
  return c.json({ ok: true });
26654
26838
  });
26655
- app65.post("/wa-channel/reply-document", async (c) => {
26839
+ app66.post("/wa-channel/reply-document", async (c) => {
26656
26840
  const body = await c.req.json().catch(() => null);
26657
26841
  const senderId = body?.senderId;
26658
26842
  const files = body?.files;
@@ -26691,7 +26875,7 @@ function createWaChannelRoutes(deps) {
26691
26875
  }
26692
26876
  return c.json({ ok: true, results });
26693
26877
  });
26694
- app65.post("/wa-channel/ready", async (c) => {
26878
+ app66.post("/wa-channel/ready", async (c) => {
26695
26879
  const body = await c.req.json().catch(() => null);
26696
26880
  const senderId = body?.senderId;
26697
26881
  if (typeof senderId !== "string") {
@@ -26700,7 +26884,7 @@ function createWaChannelRoutes(deps) {
26700
26884
  deps.onReady?.(senderId);
26701
26885
  return c.json({ ok: true });
26702
26886
  });
26703
- app65.post("/wa-channel/received", async (c) => {
26887
+ app66.post("/wa-channel/received", async (c) => {
26704
26888
  const body = await c.req.json().catch(() => null);
26705
26889
  const senderId = body?.senderId;
26706
26890
  const waMessageId = body?.waMessageId;
@@ -26710,7 +26894,7 @@ function createWaChannelRoutes(deps) {
26710
26894
  deps.onReceived?.(senderId, waMessageId);
26711
26895
  return c.json({ ok: true });
26712
26896
  });
26713
- app65.post("/wa-channel/turn-end", async (c) => {
26897
+ app66.post("/wa-channel/turn-end", async (c) => {
26714
26898
  const body = await c.req.json().catch(() => null);
26715
26899
  const senderId = body?.senderId;
26716
26900
  const sessionId = body?.sessionId;
@@ -26743,7 +26927,7 @@ function createWaChannelRoutes(deps) {
26743
26927
  console.error(`[whatsapp-native] op=turn-end sessionId=${sid} replied=no delivered=none`);
26744
26928
  return c.json({ ok: true, delivered: "none" });
26745
26929
  });
26746
- return app65;
26930
+ return app66;
26747
26931
  }
26748
26932
 
26749
26933
  // app/lib/whatsapp/gateway/wa-gateway.ts
@@ -27161,8 +27345,8 @@ var import_dist8 = __toESM(require_dist(), 1);
27161
27345
 
27162
27346
  // app/lib/webchat/gateway/routes.ts
27163
27347
  function createWebchatChannelRoutes(deps) {
27164
- const app65 = new Hono();
27165
- app65.get("/webchat-channel/inbound", (c) => {
27348
+ const app66 = new Hono();
27349
+ app66.get("/webchat-channel/inbound", (c) => {
27166
27350
  const key = c.req.query("key");
27167
27351
  if (!key) return c.json({ error: "key required" }, 400);
27168
27352
  return streamSSE(c, async (stream2) => {
@@ -27180,7 +27364,7 @@ function createWebchatChannelRoutes(deps) {
27180
27364
  }
27181
27365
  });
27182
27366
  });
27183
- app65.post("/webchat-channel/reply", async (c) => {
27367
+ app66.post("/webchat-channel/reply", async (c) => {
27184
27368
  const body = await c.req.json().catch(() => null);
27185
27369
  const key = body?.key;
27186
27370
  const text = body?.text;
@@ -27190,7 +27374,7 @@ function createWebchatChannelRoutes(deps) {
27190
27374
  deps.onReply?.(key, text);
27191
27375
  return c.json({ ok: true });
27192
27376
  });
27193
- app65.post("/webchat-channel/connector-auth", async (c) => {
27377
+ app66.post("/webchat-channel/connector-auth", async (c) => {
27194
27378
  const body = await c.req.json().catch(() => null);
27195
27379
  const key = body?.key;
27196
27380
  const sessionId = body?.sessionId;
@@ -27203,7 +27387,7 @@ function createWebchatChannelRoutes(deps) {
27203
27387
  const result = await deps.onConnectorAuth({ key, sessionId, name, completed });
27204
27388
  return c.json(result);
27205
27389
  });
27206
- app65.post("/webchat-channel/ready", async (c) => {
27390
+ app66.post("/webchat-channel/ready", async (c) => {
27207
27391
  const body = await c.req.json().catch(() => null);
27208
27392
  const key = body?.key;
27209
27393
  if (typeof key !== "string") {
@@ -27212,7 +27396,7 @@ function createWebchatChannelRoutes(deps) {
27212
27396
  deps.onReady?.(key);
27213
27397
  return c.json({ ok: true });
27214
27398
  });
27215
- app65.post("/webchat-channel/permission-request", async (c) => {
27399
+ app66.post("/webchat-channel/permission-request", async (c) => {
27216
27400
  const body = await c.req.json().catch(() => null);
27217
27401
  const key = body?.key;
27218
27402
  const requestId = body?.request_id;
@@ -27226,7 +27410,7 @@ function createWebchatChannelRoutes(deps) {
27226
27410
  const verdict = await deps.awaitPermissionVerdict({ key, requestId, toolName, description, inputPreview });
27227
27411
  return c.json(verdict);
27228
27412
  });
27229
- app65.post("/webchat-channel/received", async (c) => {
27413
+ app66.post("/webchat-channel/received", async (c) => {
27230
27414
  const body = await c.req.json().catch(() => null);
27231
27415
  const key = body?.key;
27232
27416
  const messageId = body?.messageId;
@@ -27236,7 +27420,7 @@ function createWebchatChannelRoutes(deps) {
27236
27420
  deps.onReceived?.(key, messageId);
27237
27421
  return c.json({ ok: true });
27238
27422
  });
27239
- app65.post("/webchat-channel/turn-end", async (c) => {
27423
+ app66.post("/webchat-channel/turn-end", async (c) => {
27240
27424
  const body = await c.req.json().catch(() => null);
27241
27425
  const key = body?.key;
27242
27426
  const sessionId = body?.sessionId;
@@ -27259,7 +27443,7 @@ function createWebchatChannelRoutes(deps) {
27259
27443
  console.error(`[webchat-native] op=turn-end channel=webchat key=${k} sessionId=${sid} replied=no delivered=none`);
27260
27444
  return c.json({ ok: true, delivered: "none" });
27261
27445
  });
27262
- return app65;
27446
+ return app66;
27263
27447
  }
27264
27448
 
27265
27449
  // app/lib/webchat/gateway/webchat-gateway.ts
@@ -28346,8 +28530,8 @@ var import_dist9 = __toESM(require_dist(), 1);
28346
28530
 
28347
28531
  // app/lib/telegram/gateway/routes.ts
28348
28532
  function createTelegramChannelRoutes(deps) {
28349
- const app65 = new Hono();
28350
- app65.get("/tg-channel/inbound", (c) => {
28533
+ const app66 = new Hono();
28534
+ app66.get("/tg-channel/inbound", (c) => {
28351
28535
  const key = c.req.query("key");
28352
28536
  if (!key) return c.json({ error: "key required" }, 400);
28353
28537
  return streamSSE(c, async (stream2) => {
@@ -28365,7 +28549,7 @@ function createTelegramChannelRoutes(deps) {
28365
28549
  }
28366
28550
  });
28367
28551
  });
28368
- app65.post("/tg-channel/reply", async (c) => {
28552
+ app66.post("/tg-channel/reply", async (c) => {
28369
28553
  const body = await c.req.json().catch(() => null);
28370
28554
  const key = body?.key;
28371
28555
  const text = body?.text;
@@ -28381,7 +28565,7 @@ function createTelegramChannelRoutes(deps) {
28381
28565
  console.error(`[telegram-native] op=reply key=${key} bytes=${Buffer.byteLength(text, "utf8")}`);
28382
28566
  return c.json({ ok: true });
28383
28567
  });
28384
- app65.post("/tg-channel/ready", async (c) => {
28568
+ app66.post("/tg-channel/ready", async (c) => {
28385
28569
  const body = await c.req.json().catch(() => null);
28386
28570
  const key = body?.key;
28387
28571
  if (typeof key !== "string") {
@@ -28390,7 +28574,7 @@ function createTelegramChannelRoutes(deps) {
28390
28574
  deps.onReady?.(key);
28391
28575
  return c.json({ ok: true });
28392
28576
  });
28393
- app65.post("/tg-channel/received", async (c) => {
28577
+ app66.post("/tg-channel/received", async (c) => {
28394
28578
  const body = await c.req.json().catch(() => null);
28395
28579
  const key = body?.key;
28396
28580
  const messageId = body?.messageId;
@@ -28400,7 +28584,7 @@ function createTelegramChannelRoutes(deps) {
28400
28584
  deps.onReceived?.(key, messageId);
28401
28585
  return c.json({ ok: true });
28402
28586
  });
28403
- app65.post("/tg-channel/turn-end", async (c) => {
28587
+ app66.post("/tg-channel/turn-end", async (c) => {
28404
28588
  const body = await c.req.json().catch(() => null);
28405
28589
  const key = body?.key;
28406
28590
  const sessionId = body?.sessionId;
@@ -28433,7 +28617,7 @@ function createTelegramChannelRoutes(deps) {
28433
28617
  console.error(`[telegram-native] op=turn-end key=${key} sessionId=${sid} replied=no delivered=none`);
28434
28618
  return c.json({ ok: true, delivered: "none" });
28435
28619
  });
28436
- return app65;
28620
+ return app66;
28437
28621
  }
28438
28622
 
28439
28623
  // app/lib/telegram/gateway/telegram-gateway.ts
@@ -29338,7 +29522,7 @@ watchFile(ALIAS_DOMAINS_PATH, { interval: 2e3 }, () => {
29338
29522
  function isPublicHost(host) {
29339
29523
  return host.startsWith("public.") || aliasDomains.has(host);
29340
29524
  }
29341
- var app64 = new Hono();
29525
+ var app65 = new Hono();
29342
29526
  function resolveChannelOverride(accountId, channel, senderId) {
29343
29527
  try {
29344
29528
  const dir = listValidAccounts().find((a) => a.accountId === accountId)?.accountDir;
@@ -29514,7 +29698,7 @@ var waGateway = new WaGateway({
29514
29698
  nativeFileFollowers.set(senderId, ac);
29515
29699
  }
29516
29700
  });
29517
- app64.route("/", waGateway.routes());
29701
+ app65.route("/", waGateway.routes());
29518
29702
  waGateway.startSweeper();
29519
29703
  function runDuplicateSenderAudit() {
29520
29704
  try {
@@ -29637,7 +29821,7 @@ var webchatGateway = new WebchatGateway({
29637
29821
  firePublicSessionEndReview: (input) => firePublicSessionEndReview(input)
29638
29822
  });
29639
29823
  setWebchatGateway(webchatGateway);
29640
- app64.route("/", webchatGateway.routes());
29824
+ app65.route("/", webchatGateway.routes());
29641
29825
  webchatGateway.startSweeper();
29642
29826
  webchatGateway.startPublicReaper();
29643
29827
  var telegramFileFollowers = /* @__PURE__ */ new Map();
@@ -29681,7 +29865,7 @@ var telegramGateway = new TelegramGateway({
29681
29865
  }
29682
29866
  });
29683
29867
  setTelegramGateway(telegramGateway);
29684
- app64.route("/", telegramGateway.routes());
29868
+ app65.route("/", telegramGateway.routes());
29685
29869
  telegramGateway.startSweeper();
29686
29870
  var chatRoutes = createChatRoutes({
29687
29871
  handleInbound: (input) => webchatGateway.handleInbound(input),
@@ -29715,19 +29899,19 @@ var scheduleInjectRoutes = createScheduleInjectRoutes({
29715
29899
  return managed.account;
29716
29900
  }
29717
29901
  });
29718
- app64.route("/api/channel/schedule-inject", scheduleInjectRoutes);
29719
- app64.use("*", clientIpMiddleware);
29902
+ app65.route("/api/channel/schedule-inject", scheduleInjectRoutes);
29903
+ app65.use("*", clientIpMiddleware);
29720
29904
  function allowsSameOriginFraming(path3) {
29721
29905
  return path3 === "/vnc-viewer.html" || path3.startsWith("/api/admin/attachment/") || path3.startsWith("/api/public-reader/attachment/") || path3 === "/api/admin/files/download";
29722
29906
  }
29723
- app64.use("*", async (c, next) => {
29907
+ app65.use("*", async (c, next) => {
29724
29908
  await next();
29725
29909
  c.header("X-Content-Type-Options", "nosniff");
29726
29910
  c.header("Referrer-Policy", "strict-origin-when-cross-origin");
29727
29911
  c.header("X-Frame-Options", allowsSameOriginFraming(c.req.path) ? "SAMEORIGIN" : "DENY");
29728
29912
  });
29729
29913
  var HTTP_LOG_PATHS = /* @__PURE__ */ new Set(["/vnc-viewer.html", "/vnc-popout.html"]);
29730
- app64.use("*", async (c, next) => {
29914
+ app65.use("*", async (c, next) => {
29731
29915
  if (!HTTP_LOG_PATHS.has(c.req.path)) {
29732
29916
  await next();
29733
29917
  return;
@@ -29745,7 +29929,7 @@ app64.use("*", async (c, next) => {
29745
29929
  });
29746
29930
  }
29747
29931
  });
29748
- app64.use("*", async (c, next) => {
29932
+ app65.use("*", async (c, next) => {
29749
29933
  const host = (c.req.header("host") ?? "").split(":")[0];
29750
29934
  if (isOperatorHost(host, getOperatorDomains()) || !isPublicHost(host)) {
29751
29935
  await next();
@@ -29783,7 +29967,7 @@ function resolveRemoteAuthOpts(c) {
29783
29967
  return { ...brandLoginOpts, origin };
29784
29968
  }
29785
29969
  var MAX_LOGIN_BODY = 8 * 1024;
29786
- app64.post("/__remote-auth/login", async (c) => {
29970
+ app65.post("/__remote-auth/login", async (c) => {
29787
29971
  const client = clientFrom(c);
29788
29972
  const clientIp = client.ip || "unknown";
29789
29973
  if (!requestIsTlsTerminated(c)) {
@@ -29828,7 +30012,7 @@ app64.post("/__remote-auth/login", async (c) => {
29828
30012
  }
29829
30013
  });
29830
30014
  });
29831
- app64.get("/__remote-auth/logout", (c) => {
30015
+ app65.get("/__remote-auth/logout", (c) => {
29832
30016
  const client = clientFrom(c);
29833
30017
  const clientIp = client.ip || "unknown";
29834
30018
  console.error(`[remote-auth] logout ip=${clientIp}`);
@@ -29841,7 +30025,7 @@ app64.get("/__remote-auth/logout", (c) => {
29841
30025
  }
29842
30026
  });
29843
30027
  });
29844
- app64.post("/__remote-auth/change-password", async (c) => {
30028
+ app65.post("/__remote-auth/change-password", async (c) => {
29845
30029
  const client = clientFrom(c);
29846
30030
  const clientIp = client.ip || "unknown";
29847
30031
  const rateLimited = checkRateLimit(client);
@@ -29900,13 +30084,13 @@ app64.post("/__remote-auth/change-password", async (c) => {
29900
30084
  return c.html(renderLoginPage({ ...resolveRemoteAuthOpts(c), mode: "change", changeError: "Failed to save password", redirect }), 200);
29901
30085
  }
29902
30086
  });
29903
- app64.get("/__remote-auth/setup", (c) => {
30087
+ app65.get("/__remote-auth/setup", (c) => {
29904
30088
  if (isRemoteAuthConfigured()) {
29905
30089
  return c.redirect("/");
29906
30090
  }
29907
30091
  return c.html(renderLoginPage({ ...resolveRemoteAuthOpts(c), mode: "setup" }), 200);
29908
30092
  });
29909
- app64.post("/__remote-auth/set-initial-password", async (c) => {
30093
+ app65.post("/__remote-auth/set-initial-password", async (c) => {
29910
30094
  if (isRemoteAuthConfigured()) {
29911
30095
  return c.redirect("/");
29912
30096
  }
@@ -29944,10 +30128,10 @@ app64.post("/__remote-auth/set-initial-password", async (c) => {
29944
30128
  return c.html(renderLoginPage({ ...resolveRemoteAuthOpts(c), mode: "setup", setupError: "Failed to save password. Please try again." }), 200);
29945
30129
  }
29946
30130
  });
29947
- app64.get("/api/remote-auth/status", (c) => {
30131
+ app65.get("/api/remote-auth/status", (c) => {
29948
30132
  return c.json({ configured: isRemoteAuthConfigured() });
29949
30133
  });
29950
- app64.post("/api/remote-auth/set-password", async (c) => {
30134
+ app65.post("/api/remote-auth/set-password", async (c) => {
29951
30135
  let body;
29952
30136
  try {
29953
30137
  body = await c.req.json();
@@ -29986,10 +30170,10 @@ app64.post("/api/remote-auth/set-password", async (c) => {
29986
30170
  return c.json({ error: "Failed to save password" }, 500);
29987
30171
  }
29988
30172
  });
29989
- app64.route("/api/_client-error", client_error_default);
30173
+ app65.route("/api/_client-error", client_error_default);
29990
30174
  console.log("[client-error-route] mounted");
29991
30175
  var PWA_PUBLIC_PATHS = /* @__PURE__ */ new Set(["/sw.js", ...PWA_SURFACES.map((s) => s.manifestPath)]);
29992
- app64.use("*", async (c, next) => {
30176
+ app65.use("*", async (c, next) => {
29993
30177
  const host = (c.req.header("host") ?? "").split(":")[0];
29994
30178
  const path3 = c.req.path;
29995
30179
  if (path3 === "/favicon.ico" || path3.startsWith("/assets/") || path3.startsWith("/brand/") || // Public free/busy is read by the booking page (a separate Cloudflare Pages
@@ -30033,28 +30217,28 @@ app64.use("*", async (c, next) => {
30033
30217
  }
30034
30218
  return c.html(renderLoginPage({ ...resolveRemoteAuthOpts(c), redirect: path3 }), 200);
30035
30219
  });
30036
- app64.route("/api/health", health_default);
30037
- app64.route("/api/chat", chatRoutes);
30038
- app64.route("/api/whatsapp", whatsapp_default);
30039
- app64.route("/api/storage", storage_broker_default);
30040
- app64.route("/api/whatsapp-reader", whatsapp_reader_default);
30041
- app64.route("/api/public-reader", public_reader_default);
30042
- app64.route("/api/webchat", createWebchatRoutes({
30220
+ app65.route("/api/health", health_default);
30221
+ app65.route("/api/chat", chatRoutes);
30222
+ app65.route("/api/whatsapp", whatsapp_default);
30223
+ app65.route("/api/storage", storage_broker_default);
30224
+ app65.route("/api/whatsapp-reader", whatsapp_reader_default);
30225
+ app65.route("/api/public-reader", public_reader_default);
30226
+ app65.route("/api/webchat", createWebchatRoutes({
30043
30227
  handleInbound: (input) => webchatGateway.handleInbound(input),
30044
30228
  // Task 940 — the permission relay's pointer read + verdict write.
30045
30229
  pendingPromptFor: (key) => webchatGateway.pendingPromptFor(key),
30046
30230
  deliveryFailureFor: (key) => webchatGateway.deliveryFailureFor(key),
30047
30231
  resolvePermissionVerdict: (key, requestId, behavior) => webchatGateway.resolvePermissionVerdict(key, requestId, behavior)
30048
30232
  }));
30049
- app64.route("/api/webchat/greeting", webchat_greeting_default);
30050
- app64.route("/api/telegram", telegram_default);
30051
- app64.route("/api/quickbooks", quickbooks_default);
30052
- app64.route("/api/onboarding", onboarding_default);
30053
- app64.route("/api/admin", admin_default);
30054
- app64.route("/api/access", access_default);
30055
- app64.route("/api/session", session_default2);
30056
- app64.route("/api/calendar", calendar_public_default);
30057
- app64.route("/api/portal", portal_fetch_default);
30233
+ app65.route("/api/webchat/greeting", webchat_greeting_default);
30234
+ app65.route("/api/telegram", telegram_default);
30235
+ app65.route("/api/quickbooks", quickbooks_default);
30236
+ app65.route("/api/onboarding", onboarding_default);
30237
+ app65.route("/api/admin", admin_default);
30238
+ app65.route("/api/access", access_default);
30239
+ app65.route("/api/session", session_default2);
30240
+ app65.route("/api/calendar", calendar_public_default);
30241
+ app65.route("/api/portal", portal_fetch_default);
30058
30242
  var SAFE_SLUG_RE2 = /^[a-z][a-z0-9-]{2,49}$/;
30059
30243
  var SAFE_FILENAME_RE = /^[a-z0-9_][a-z0-9_.-]{0,99}$/i;
30060
30244
  var IMAGE_MIME = {
@@ -30066,7 +30250,7 @@ var IMAGE_MIME = {
30066
30250
  ".svg": "image/svg+xml",
30067
30251
  ".ico": "image/x-icon"
30068
30252
  };
30069
- app64.get("/agent-assets/:slug/:filename", (c) => {
30253
+ app65.get("/agent-assets/:slug/:filename", (c) => {
30070
30254
  const slug = c.req.param("slug");
30071
30255
  const filename = c.req.param("filename");
30072
30256
  if (!SAFE_SLUG_RE2.test(slug)) {
@@ -30101,7 +30285,7 @@ app64.get("/agent-assets/:slug/:filename", (c) => {
30101
30285
  "Cache-Control": "public, max-age=3600"
30102
30286
  });
30103
30287
  });
30104
- app64.get("/generated/:filename", (c) => {
30288
+ app65.get("/generated/:filename", (c) => {
30105
30289
  const filename = c.req.param("filename");
30106
30290
  if (!SAFE_FILENAME_RE.test(filename) || filename.includes("..")) {
30107
30291
  console.error(`[generated] serve file=${filename} status=403`);
@@ -30131,10 +30315,10 @@ app64.get("/generated/:filename", (c) => {
30131
30315
  "Cache-Control": "public, max-age=86400"
30132
30316
  });
30133
30317
  });
30134
- app64.route("/sites", sites_default);
30135
- app64.route("/listings", listings_default);
30136
- app64.route("/v", visitor_event_default);
30137
- app64.route("/v", visitor_consent_default);
30318
+ app65.route("/sites", sites_default);
30319
+ app65.route("/listings", listings_default);
30320
+ app65.route("/v", visitor_event_default);
30321
+ app65.route("/v", visitor_consent_default);
30138
30322
  var htmlCache = /* @__PURE__ */ new Map();
30139
30323
  var brandLogoPath = "/brand/maxy-monochrome.png";
30140
30324
  var brandIconPath = "/brand/maxy-monochrome.png";
@@ -30289,7 +30473,7 @@ function brandedPublicHtml(agentSlug) {
30289
30473
  function agentUnavailableHtml() {
30290
30474
  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>`;
30291
30475
  }
30292
- app64.get("/", (c) => {
30476
+ app65.get("/", (c) => {
30293
30477
  const host = (c.req.header("host") ?? "").split(":")[0];
30294
30478
  const klass = classifyHost(host, getOperatorDomains(), isPublicHost);
30295
30479
  if (klass === "operator") {
@@ -30311,12 +30495,12 @@ app64.get("/", (c) => {
30311
30495
  console.log(`[host-class] host=${host} class=admin served=index.html`);
30312
30496
  return c.html(cachedHtml("index.html"));
30313
30497
  });
30314
- app64.get("/public", (c) => {
30498
+ app65.get("/public", (c) => {
30315
30499
  const host = (c.req.header("host") ?? "").split(":")[0];
30316
30500
  if (isPublicHost(host)) return c.text("Not found", 404);
30317
30501
  return c.html(cachedHtml("public.html"));
30318
30502
  });
30319
- app64.get("/public-chat", (c) => {
30503
+ app65.get("/public-chat", (c) => {
30320
30504
  const host = (c.req.header("host") ?? "").split(":")[0];
30321
30505
  if (isPublicHost(host)) return c.text("Not found", 404);
30322
30506
  return c.html(cachedHtml("public.html"));
@@ -30335,9 +30519,9 @@ async function logViewerFetch(c, next) {
30335
30519
  duration_ms: Date.now() - start
30336
30520
  });
30337
30521
  }
30338
- app64.use("/vnc-viewer.html", logViewerFetch);
30339
- app64.use("/vnc-popout.html", logViewerFetch);
30340
- app64.get("/vnc-popout.html", (c) => {
30522
+ app65.use("/vnc-viewer.html", logViewerFetch);
30523
+ app65.use("/vnc-popout.html", logViewerFetch);
30524
+ app65.get("/vnc-popout.html", (c) => {
30341
30525
  let html = htmlCache.get("vnc-popout.html");
30342
30526
  if (!html) {
30343
30527
  html = readFileSync45(resolve41(process.cwd(), "public", "vnc-popout.html"), "utf-8");
@@ -30350,7 +30534,7 @@ app64.get("/vnc-popout.html", (c) => {
30350
30534
  }
30351
30535
  return c.html(html);
30352
30536
  });
30353
- app64.post("/api/vnc/client-event", async (c) => {
30537
+ app65.post("/api/vnc/client-event", async (c) => {
30354
30538
  let body;
30355
30539
  try {
30356
30540
  body = await c.req.json();
@@ -30371,11 +30555,11 @@ app64.post("/api/vnc/client-event", async (c) => {
30371
30555
  });
30372
30556
  return c.json({ ok: true });
30373
30557
  });
30374
- app64.get("/g/:slug", (c) => {
30558
+ app65.get("/g/:slug", (c) => {
30375
30559
  return c.html(brandedPublicHtml(resolveDefaultSlug() ?? void 0));
30376
30560
  });
30377
30561
  for (const pwa of PWA_SURFACES) {
30378
- app64.get(pwa.manifestPath, (c) => {
30562
+ app65.get(pwa.manifestPath, (c) => {
30379
30563
  const manifest = buildManifest(pwa, {
30380
30564
  productName: BRAND.productName,
30381
30565
  appIcon192: brandAppIcon192Path,
@@ -30391,7 +30575,7 @@ for (const pwa of PWA_SURFACES) {
30391
30575
  return c.body(JSON.stringify(manifest));
30392
30576
  });
30393
30577
  }
30394
- app64.get("/sw.js", (c) => {
30578
+ app65.get("/sw.js", (c) => {
30395
30579
  if (SW_SOURCE == null) {
30396
30580
  console.error("[pwa] op=sw status=500 reason=sw-source-missing");
30397
30581
  return c.text("Service worker unavailable", 500);
@@ -30400,12 +30584,12 @@ app64.get("/sw.js", (c) => {
30400
30584
  console.log(`[pwa] op=sw status=200 ct=${SW_CONTENT_TYPE}`);
30401
30585
  return c.body(SW_SOURCE);
30402
30586
  });
30403
- app64.get("/graph", (c) => {
30587
+ app65.get("/graph", (c) => {
30404
30588
  const host = (c.req.header("host") ?? "").split(":")[0];
30405
30589
  if (isPublicHost(host) || isOperatorHost(host, getOperatorDomains())) return c.text("Not found", 404);
30406
30590
  return c.html(cachedHtml("graph.html"));
30407
30591
  });
30408
- app64.get("/chat", (c) => {
30592
+ app65.get("/chat", (c) => {
30409
30593
  const host = (c.req.header("host") ?? "").split(":")[0];
30410
30594
  if (isOperatorHost(host, getOperatorDomains())) {
30411
30595
  console.log(`[host-class] host=${host} class=operator served=operator.html`);
@@ -30414,32 +30598,37 @@ app64.get("/chat", (c) => {
30414
30598
  if (isPublicHost(host)) return c.text("Not found", 404);
30415
30599
  return c.html(cachedHtml("chat.html"));
30416
30600
  });
30417
- app64.get("/data", (c) => {
30601
+ app65.get("/data", (c) => {
30418
30602
  const host = (c.req.header("host") ?? "").split(":")[0];
30419
30603
  if (isPublicHost(host)) return c.text("Not found", 404);
30420
30604
  return c.html(cachedHtml("data.html"));
30421
30605
  });
30422
- app64.get("/tasks", (c) => {
30606
+ app65.get("/tasks", (c) => {
30423
30607
  const host = (c.req.header("host") ?? "").split(":")[0];
30424
30608
  if (isPublicHost(host)) return c.text("Not found", 404);
30425
30609
  return c.html(cachedHtml("tasks.html"));
30426
30610
  });
30427
- app64.get("/activity", (c) => {
30611
+ app65.get("/activity", (c) => {
30428
30612
  const host = (c.req.header("host") ?? "").split(":")[0];
30429
30613
  if (isPublicHost(host)) return c.text("Not found", 404);
30430
30614
  return c.html(cachedHtml("activity.html"));
30431
30615
  });
30432
- app64.get("/calendar", (c) => {
30616
+ app65.get("/calendar", (c) => {
30433
30617
  const host = (c.req.header("host") ?? "").split(":")[0];
30434
30618
  if (isPublicHost(host)) return c.text("Not found", 404);
30435
30619
  return c.html(cachedHtml("calendar.html"));
30436
30620
  });
30437
- app64.get("/browser", (c) => {
30621
+ app65.get("/routines", (c) => {
30622
+ const host = (c.req.header("host") ?? "").split(":")[0];
30623
+ if (isPublicHost(host)) return c.text("Not found", 404);
30624
+ return c.html(cachedHtml("routines.html"));
30625
+ });
30626
+ app65.get("/browser", (c) => {
30438
30627
  const host = (c.req.header("host") ?? "").split(":")[0];
30439
30628
  if (isPublicHost(host) || isOperatorHost(host, getOperatorDomains())) return c.text("Not found", 404);
30440
30629
  return c.html(cachedHtml("browser.html"));
30441
30630
  });
30442
- app64.get("/:slug", async (c, next) => {
30631
+ app65.get("/:slug", async (c, next) => {
30443
30632
  const slug = c.req.param("slug");
30444
30633
  if (AGENT_SLUG_PATTERN.test(`/${slug}`)) {
30445
30634
  const account = resolveAccount();
@@ -30454,13 +30643,13 @@ app64.get("/:slug", async (c, next) => {
30454
30643
  await next();
30455
30644
  });
30456
30645
  if (brandFaviconPath !== "/favicon.ico") {
30457
- app64.get("/favicon.ico", (c) => {
30646
+ app65.get("/favicon.ico", (c) => {
30458
30647
  c.header("Cache-Control", "public, max-age=300");
30459
30648
  return c.redirect(brandFaviconPath, 302);
30460
30649
  });
30461
30650
  }
30462
- app64.use("/*", serveStatic({ root: "./public" }));
30463
- app64.all("*", (c) => {
30651
+ app65.use("/*", serveStatic({ root: "./public" }));
30652
+ app65.all("*", (c) => {
30464
30653
  const host = (c.req.header("host") ?? "").split(":")[0];
30465
30654
  const path3 = c.req.path;
30466
30655
  if (isPublicHost(host)) {
@@ -30474,7 +30663,7 @@ app64.all("*", (c) => {
30474
30663
  });
30475
30664
  var port = requirePortEnv("MAXY_UI_INTERNAL_PORT", { tag: "ui-server" });
30476
30665
  var hostname = process.env.HOSTNAME ?? "127.0.0.1";
30477
- var httpServer = serve({ fetch: app64.fetch, port, hostname });
30666
+ var httpServer = serve({ fetch: app65.fetch, port, hostname });
30478
30667
  console.log(`${BRAND.productName} listening on http://${hostname}:${port}`);
30479
30668
  {
30480
30669
  const reconcilePlatformRoot = process.env.MAXY_PLATFORM_ROOT ?? join47(__dirname, "..");
@@ -30516,6 +30705,31 @@ console.log(`${BRAND.productName} listening on http://${hostname}:${port}`);
30516
30705
  }
30517
30706
  });
30518
30707
  }
30708
+ {
30709
+ const DREAM_CYCLE_SWEEP_INTERVAL_MS = 36e5;
30710
+ const dreamPlatformRoot = process.env.MAXY_PLATFORM_ROOT ?? join47(__dirname, "..");
30711
+ const dreamSweepScript = resolve41(dreamPlatformRoot, "plugins/memory/mcp/dist/scripts/dream-cycle-sweep.js");
30712
+ registerLoop({
30713
+ name: "dream-cycle-sweep",
30714
+ intervalMs: DREAM_CYCLE_SWEEP_INTERVAL_MS,
30715
+ firstRunDelayMs: 3e4,
30716
+ detached: true,
30717
+ run: (ctx) => {
30718
+ if (!existsSync42(dreamSweepScript)) return;
30719
+ try {
30720
+ const child = spawn3(process.execPath, [dreamSweepScript], {
30721
+ env: { ...process.env, PLATFORM_ROOT: dreamPlatformRoot },
30722
+ stdio: "inherit"
30723
+ });
30724
+ child.unref();
30725
+ ctx.child(child.pid);
30726
+ child.on("error", (err) => console.error(`[dream-cycle-sweep] spawn-failed err="${err.message}"`));
30727
+ } catch (err) {
30728
+ console.error(`[dream-cycle-sweep] spawn-failed err="${err.message}"`);
30729
+ }
30730
+ }
30731
+ });
30732
+ }
30519
30733
  {
30520
30734
  const outlookPlatformRoot = process.env.MAXY_PLATFORM_ROOT ?? join47(__dirname, "..");
30521
30735
  const outlookScript = resolve41(outlookPlatformRoot, "plugins/outlook/mcp/dist/scripts/complete-registration.js");
@@ -30825,7 +31039,7 @@ for (const m of SUBAPP_MANIFEST) {
30825
31039
  }
30826
31040
  try {
30827
31041
  const registered = [];
30828
- for (const r of app64.routes ?? []) {
31042
+ for (const r of app65.routes ?? []) {
30829
31043
  if (typeof r.path !== "string" || r.path.includes(":") || r.path.includes("*")) continue;
30830
31044
  if (AGENT_SLUG_PATTERN.test(r.path)) {
30831
31045
  registered.push({ method: (r.method ?? "ALL").toUpperCase(), path: r.path });