@rubytech/create-maxy-code 0.1.496 → 0.1.497
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/docs/superpowers/plans/2026-07-24-task-1942-subaccount-switcher-brand-head.md +327 -0
- package/payload/platform/docs/superpowers/specs/2026-07-24-task-1942-subaccount-switcher-brand-head-design.md +35 -0
- package/payload/platform/plugins/admin/skills/platform-architecture/SKILL.md +20 -6
- package/payload/platform/plugins/docs/references/admin-ui.md +14 -4
- package/payload/platform/plugins/docs/references/outlook-guide.md +5 -1
- package/payload/platform/plugins/outlook/.claude-plugin/plugin.json +1 -1
- package/payload/platform/plugins/outlook/PLUGIN.md +6 -2
- package/payload/platform/plugins/outlook/mcp/dist/__tests__/dispatch-grouping.test.d.ts +2 -0
- package/payload/platform/plugins/outlook/mcp/dist/__tests__/dispatch-grouping.test.d.ts.map +1 -0
- package/payload/platform/plugins/outlook/mcp/dist/__tests__/dispatch-grouping.test.js +54 -0
- package/payload/platform/plugins/outlook/mcp/dist/__tests__/dispatch-grouping.test.js.map +1 -0
- package/payload/platform/plugins/outlook/mcp/dist/__tests__/fetch-body-fromname.test.d.ts +2 -0
- package/payload/platform/plugins/outlook/mcp/dist/__tests__/fetch-body-fromname.test.d.ts.map +1 -0
- package/payload/platform/plugins/outlook/mcp/dist/__tests__/fetch-body-fromname.test.js +19 -0
- package/payload/platform/plugins/outlook/mcp/dist/__tests__/fetch-body-fromname.test.js.map +1 -0
- package/payload/platform/plugins/outlook/mcp/dist/__tests__/mail-ingest-decisions.test.d.ts +2 -0
- package/payload/platform/plugins/outlook/mcp/dist/__tests__/mail-ingest-decisions.test.d.ts.map +1 -0
- package/payload/platform/plugins/outlook/mcp/dist/__tests__/mail-ingest-decisions.test.js +20 -0
- package/payload/platform/plugins/outlook/mcp/dist/__tests__/mail-ingest-decisions.test.js.map +1 -0
- package/payload/platform/plugins/outlook/mcp/dist/index.js +21 -0
- package/payload/platform/plugins/outlook/mcp/dist/index.js.map +1 -1
- package/payload/platform/plugins/outlook/mcp/dist/lib/conversation-archive-dispatch.d.ts +40 -0
- package/payload/platform/plugins/outlook/mcp/dist/lib/conversation-archive-dispatch.d.ts.map +1 -0
- package/payload/platform/plugins/outlook/mcp/dist/lib/conversation-archive-dispatch.js +143 -0
- package/payload/platform/plugins/outlook/mcp/dist/lib/conversation-archive-dispatch.js.map +1 -0
- package/payload/platform/plugins/outlook/mcp/dist/lib/neo4j.d.ts +5 -0
- package/payload/platform/plugins/outlook/mcp/dist/lib/neo4j.d.ts.map +1 -0
- package/payload/platform/plugins/outlook/mcp/dist/lib/neo4j.js +44 -0
- package/payload/platform/plugins/outlook/mcp/dist/lib/neo4j.js.map +1 -0
- package/payload/platform/plugins/outlook/mcp/dist/tools/mail-fetch-body.d.ts +14 -0
- package/payload/platform/plugins/outlook/mcp/dist/tools/mail-fetch-body.d.ts.map +1 -1
- package/payload/platform/plugins/outlook/mcp/dist/tools/mail-fetch-body.js +13 -1
- package/payload/platform/plugins/outlook/mcp/dist/tools/mail-fetch-body.js.map +1 -1
- package/payload/platform/plugins/outlook/mcp/dist/tools/mail-ingest.d.ts +27 -0
- package/payload/platform/plugins/outlook/mcp/dist/tools/mail-ingest.d.ts.map +1 -0
- package/payload/platform/plugins/outlook/mcp/dist/tools/mail-ingest.js +69 -0
- package/payload/platform/plugins/outlook/mcp/dist/tools/mail-ingest.js.map +1 -0
- package/payload/platform/plugins/outlook/mcp/package.json +1 -0
- package/payload/platform/plugins/outlook/references/graph-surfaces.md +10 -1
- package/payload/platform/plugins/outlook/skills/outlook/SKILL.md +4 -0
- package/payload/platform/plugins/outlook/skills/outlook-mail-ingest/SKILL.md +85 -0
- package/payload/platform/services/claude-session-manager/dist/canonical-tool-names.generated.d.ts.map +1 -1
- package/payload/platform/services/claude-session-manager/dist/canonical-tool-names.generated.js +1 -0
- package/payload/platform/services/claude-session-manager/dist/canonical-tool-names.generated.js.map +1 -1
- package/payload/platform/templates/specialists/agents/personal-assistant.md +1 -1
- package/payload/server/public/activity.html +5 -5
- package/payload/server/public/assets/{AdminLoginScreens-CFF28MGy.js → AdminLoginScreens-BXDYzNbq.js} +1 -1
- package/payload/server/public/assets/AdminShell-CiTHCp5t.js +2 -0
- package/payload/server/public/assets/{activity-CElZcdjR.js → activity-cVe5ZnG7.js} +1 -1
- package/payload/server/public/assets/admin-BbcLizN0.js +1 -0
- package/payload/server/public/assets/{arc-CFMJyMm-.js → arc-BrHWN2Kr.js} +1 -1
- package/payload/server/public/assets/architecture-YZFGNWBL-CZQzGRSM.js +1 -0
- package/payload/server/public/assets/{architectureDiagram-Q4EWVU46-CiSSgdL8.js → architectureDiagram-Q4EWVU46-1OxSL3rT.js} +1 -1
- package/payload/server/public/assets/{blockDiagram-DXYQGD6D-_sXtIW5c.js → blockDiagram-DXYQGD6D-C6yKiblF.js} +1 -1
- package/payload/server/public/assets/{bot-Q-JmeVT3.js → bot-Bb8yj02k.js} +1 -1
- package/payload/server/public/assets/{browser-BrfPJMYF.js → browser-BdWeCfYJ.js} +1 -1
- package/payload/server/public/assets/{c4Diagram-AHTNJAMY-Bh7OAMXs.js → c4Diagram-AHTNJAMY-BzTyHS1I.js} +1 -1
- package/payload/server/public/assets/calendar-B4KbpiXR.js +1 -0
- package/payload/server/public/assets/channel-uhtvXKHn.js +1 -0
- package/payload/server/public/assets/chat-BEcbZB3e.js +1 -0
- package/payload/server/public/assets/chevron-left-Cy_RXwhn.js +1 -0
- package/payload/server/public/assets/chevron-right-CEjdB4AT.js +1 -0
- package/payload/server/public/assets/{chunk-2KRD3SAO-D4fktAwW.js → chunk-2KRD3SAO-BGAUfWvM.js} +1 -1
- package/payload/server/public/assets/{chunk-336JU56O-CcQoKH2G.js → chunk-336JU56O-M1H_u2Qv.js} +2 -2
- package/payload/server/public/assets/chunk-426QAEUC-D4XtWgLR.js +1 -0
- package/payload/server/public/assets/{chunk-4BX2VUAB-C13Wz3zS.js → chunk-4BX2VUAB-CkxXXCiF.js} +1 -1
- package/payload/server/public/assets/{chunk-4TB4RGXK-BL48D7gN.js → chunk-4TB4RGXK-DPWZYGHH.js} +1 -1
- package/payload/server/public/assets/{chunk-55IACEB6-TmOKdy8a.js → chunk-55IACEB6-CBkNmqrt.js} +1 -1
- package/payload/server/public/assets/{chunk-5FUZZQ4R-DZ_jSF6N.js → chunk-5FUZZQ4R-uIqIu9ha.js} +1 -1
- package/payload/server/public/assets/{chunk-5PVQY5BW-De4G1vfV.js → chunk-5PVQY5BW-B_S7XzpE.js} +1 -1
- package/payload/server/public/assets/{chunk-67CJDMHE-Cif9Uu5C.js → chunk-67CJDMHE-BbMV1lgW.js} +1 -1
- package/payload/server/public/assets/{chunk-7N4EOEYR-WjTHCXnd.js → chunk-7N4EOEYR-C49Mv-nQ.js} +1 -1
- package/payload/server/public/assets/{chunk-AA7GKIK3-CwCfdQmb.js → chunk-AA7GKIK3-Dy_pJOp_.js} +1 -1
- package/payload/server/public/assets/{chunk-BSJP7CBP-9A67yXwT.js → chunk-BSJP7CBP-Ce-OmPqn.js} +1 -1
- package/payload/server/public/assets/{chunk-CIAEETIT-DPMiWSBi.js → chunk-CIAEETIT-tnjq-APC.js} +1 -1
- package/payload/server/public/assets/{chunk-EDXVE4YY-C2f_Qvx-.js → chunk-EDXVE4YY-uzO7kO4e.js} +1 -1
- package/payload/server/public/assets/{chunk-ENJZ2VHE-B-Q9EbSQ.js → chunk-ENJZ2VHE-DQMOsG1f.js} +1 -1
- package/payload/server/public/assets/{chunk-FMBD7UC4-Bmt_ZRlV.js → chunk-FMBD7UC4-Top6y08S.js} +1 -1
- package/payload/server/public/assets/{chunk-FOC6F5B3-DfGJGxpX.js → chunk-FOC6F5B3-B9LPNCUS.js} +1 -1
- package/payload/server/public/assets/{chunk-ICPOFSXX-Wyym1Q8K.js → chunk-ICPOFSXX-DeIt3WoY.js} +2 -2
- package/payload/server/public/assets/{chunk-K5T4RW27-DMpoaqw2.js → chunk-K5T4RW27-DAnRM04h.js} +1 -1
- package/payload/server/public/assets/{chunk-KGLVRYIC-DYUFgri2.js → chunk-KGLVRYIC-C0QYcbLe.js} +1 -1
- package/payload/server/public/assets/{chunk-LIHQZDEY-x3LmeKmx.js → chunk-LIHQZDEY-BjvA5ykt.js} +1 -1
- package/payload/server/public/assets/{chunk-ORNJ4GCN-BeuNAWkW.js → chunk-ORNJ4GCN-Cs46Gj7z.js} +1 -1
- package/payload/server/public/assets/{chunk-OYMX7WX6-BUWVAfQA.js → chunk-OYMX7WX6-CBHIFMBx.js} +1 -1
- package/payload/server/public/assets/chunk-QZHKN3VN-Qlc2PFAj.js +1 -0
- package/payload/server/public/assets/{chunk-U2HBQHQK-DKS5adQo.js → chunk-U2HBQHQK-5_DL8yx6.js} +1 -1
- package/payload/server/public/assets/{chunk-X2U36JSP-CT_UM4IN.js → chunk-X2U36JSP-BDCaWRe9.js} +1 -1
- package/payload/server/public/assets/{chunk-XPW4576I-ByFnN4JO.js → chunk-XPW4576I-B10QuxYb.js} +1 -1
- package/payload/server/public/assets/{chunk-YZCP3GAM-DCetC20J.js → chunk-YZCP3GAM-81jJqyDd.js} +1 -1
- package/payload/server/public/assets/{chunk-ZZ45TVLE-Bh1QIv8N.js → chunk-ZZ45TVLE-DGx3J6Dx.js} +1 -1
- package/payload/server/public/assets/classDiagram-6PBFFD2Q-CBH5ngSm.js +1 -0
- package/payload/server/public/assets/classDiagram-v2-HSJHXN6E-Ck3eNZce.js +1 -0
- package/payload/server/public/assets/clone-Cv8evfNb.js +1 -0
- package/payload/server/public/assets/{cose-bilkent-S5V4N54A-DgLEaApT.js → cose-bilkent-S5V4N54A-CRDvLRXs.js} +1 -1
- package/payload/server/public/assets/{dagre-unhMIyVo.js → dagre--rdjN6xZ.js} +1 -1
- package/payload/server/public/assets/{dagre-KV5264BT-BfkUPrEV.js → dagre-KV5264BT-DHbVQPnV.js} +1 -1
- package/payload/server/public/assets/data-L-hMHLBN.js +1 -0
- package/payload/server/public/assets/{diagram-5BDNPKRD-BjjwcTD9.js → diagram-5BDNPKRD-D8HC1Idg.js} +1 -1
- package/payload/server/public/assets/{diagram-G4DWMVQ6-BbgWtVSS.js → diagram-G4DWMVQ6-evvg8aey.js} +1 -1
- package/payload/server/public/assets/{diagram-MMDJMWI5-DyAnkWGy.js → diagram-MMDJMWI5-4hZuk-Dd.js} +1 -1
- package/payload/server/public/assets/{diagram-TYMM5635-SAMMoLxq.js → diagram-TYMM5635-Cwei1ql9.js} +1 -1
- package/payload/server/public/assets/{erDiagram-SMLLAGMA-Cvo-5-fD.js → erDiagram-SMLLAGMA-BG5OK4Fx.js} +1 -1
- package/payload/server/public/assets/{flatten-BXzaHgtL.js → flatten-naJ5PJ4f.js} +1 -1
- package/payload/server/public/assets/{flowDiagram-DWJPFMVM-y3o2Ycld.js → flowDiagram-DWJPFMVM-CPB_poda.js} +1 -1
- package/payload/server/public/assets/{ganttDiagram-T4ZO3ILL-BEm_CQaK.js → ganttDiagram-T4ZO3ILL-CD6BL1UP.js} +1 -1
- package/payload/server/public/assets/gitGraph-7Q5UKJZL-CBZPQJLj.js +1 -0
- package/payload/server/public/assets/{gitGraphDiagram-UUTBAWPF-CqmOxS7F.js → gitGraphDiagram-UUTBAWPF-C-e8FDGn.js} +1 -1
- package/payload/server/public/assets/{graph-BLO4nVi3.js → graph-COyGp2x1.js} +3 -3
- package/payload/server/public/assets/{graph-labels-ibEi7ggo.js → graph-labels-CR-HqNdV.js} +1 -1
- package/payload/server/public/assets/{graphlib-_HfbQcBf.js → graphlib-CdCZY1Mj.js} +1 -1
- package/payload/server/public/assets/info-OMHHGYJF-1vIoX-kP.js +1 -0
- package/payload/server/public/assets/infoDiagram-42DDH7IO-BDInZV9G.js +2 -0
- package/payload/server/public/assets/{isEmpty-uB1dEu_Z.js → isEmpty-Bnpg7b8f.js} +1 -1
- package/payload/server/public/assets/{ishikawaDiagram-UXIWVN3A-C_d0vcZC.js → ishikawaDiagram-UXIWVN3A-CFLhfPpo.js} +1 -1
- package/payload/server/public/assets/{journeyDiagram-VCZTEJTY-DsjRBqlW.js → journeyDiagram-VCZTEJTY-BN0PaMgT.js} +1 -1
- package/payload/server/public/assets/{kanban-definition-6JOO6SKY-BwtK6LS-.js → kanban-definition-6JOO6SKY-CmRilACp.js} +1 -1
- package/payload/server/public/assets/{line-szBCFOLJ.js → line-DR6Zk7d6.js} +1 -1
- package/payload/server/public/assets/{linear-X3O7lwK3.js → linear-CAOWPodQ.js} +1 -1
- package/payload/server/public/assets/{maximize-2-CezchDEF.js → maximize-2-ne1kaQlS.js} +1 -1
- package/payload/server/public/assets/{mermaid-parser.core-BavvMAhU.js → mermaid-parser.core-0vmQl6Gn.js} +2 -2
- package/payload/server/public/assets/{mermaid.core-Br2F9Hdm.js → mermaid.core-DWgpHiLh.js} +3 -3
- package/payload/server/public/assets/{mindmap-definition-QFDTVHPH-4qlwXoJ-.js → mindmap-definition-QFDTVHPH-CViR7VGV.js} +1 -1
- package/payload/server/public/assets/operator-Q0F_EEyq.js +1 -0
- package/payload/server/public/assets/{ordinal-CZY9laxg.js → ordinal-Wx4m9zHk.js} +1 -1
- package/payload/server/public/assets/packet-4T2RLAQJ-CTU0gCGb.js +1 -0
- package/payload/server/public/assets/{page-BL1ko2_-.js → page-DwfYACyC.js} +4 -4
- package/payload/server/public/assets/page-bRjlk8Dt.js +1 -0
- package/payload/server/public/assets/{pdf-render-H884L3EI.js → pdf-render-0hyh3Jlf.js} +1 -1
- package/payload/server/public/assets/pie-ZZUOXDRM-D-EEHxhC.js +1 -0
- package/payload/server/public/assets/{pieDiagram-DEJITSTG-BbXryIg0.js → pieDiagram-DEJITSTG-B7YQ1_Kr.js} +1 -1
- package/payload/server/public/assets/{public-DxfSLhNp.js → public-BACeh5xm.js} +1 -1
- package/payload/server/public/assets/{quadrantDiagram-34T5L4WZ-BHLjcvh3.js → quadrantDiagram-34T5L4WZ-Dxs0nGu5.js} +1 -1
- package/payload/server/public/assets/radar-PYXPWWZC-DHXATZGB.js +1 -0
- package/payload/server/public/assets/{reduce-BGQzAenn.js → reduce-BUmc8RDR.js} +1 -1
- package/payload/server/public/assets/{requirementDiagram-MS252O5E-BXaVO0lk.js → requirementDiagram-MS252O5E-DDNYDqZc.js} +1 -1
- package/payload/server/public/assets/{rotate-ccw-CWvGAut4.js → rotate-ccw-tY4mfSrJ.js} +1 -1
- package/payload/server/public/assets/{sankeyDiagram-XADWPNL6-CmN1s17Q.js → sankeyDiagram-XADWPNL6-DLWoegU5.js} +1 -1
- package/payload/server/public/assets/{sequenceDiagram-FGHM5R23-DC08e5NY.js → sequenceDiagram-FGHM5R23-DINNPlTY.js} +1 -1
- package/payload/server/public/assets/{stateDiagram-FHFEXIEX-DnoQMuOW.js → stateDiagram-FHFEXIEX-Dsan8EIl.js} +1 -1
- package/payload/server/public/assets/stateDiagram-v2-QKLJ7IA2-B4yeYYgL.js +1 -0
- package/payload/server/public/assets/{tasks-DlXIN3v3.js → tasks-C4nPXsbX.js} +1 -1
- package/payload/server/public/assets/{time-entry-format-VzHwljTv.js → time-entry-format-CmqjpGG2.js} +1 -1
- package/payload/server/public/assets/{timeline-definition-GMOUNBTQ-eTn3uRaH.js → timeline-definition-GMOUNBTQ-CISzecz5.js} +1 -1
- package/payload/server/public/assets/treeView-SZITEDCU-CC7ouMFd.js +1 -0
- package/payload/server/public/assets/treemap-W4RFUUIX-CaCg27im.js +1 -0
- package/payload/server/public/assets/{triangle-alert-C5BpoPlq.js → triangle-alert-DKZ69dOa.js} +1 -1
- package/payload/server/public/assets/{useCopyFeedback-h1qT8mpZ.js → useCopyFeedback-Cf5jFDR5.js} +1 -1
- package/payload/server/public/assets/useSubAccountSwitcher-DFnDNIDO.css +1 -0
- package/payload/server/public/assets/useSubAccountSwitcher-DdctgpPL.js +9 -0
- package/payload/server/public/assets/{useVoiceRecorder-kqMitFlk.js → useVoiceRecorder-BVdKbTku.js} +2 -2
- package/payload/server/public/assets/{vennDiagram-DHZGUBPP-DNx6o_ZQ.js → vennDiagram-DHZGUBPP-Bh2s76nJ.js} +1 -1
- package/payload/server/public/assets/wardley-RL74JXVD-bMPsqQZ7.js +1 -0
- package/payload/server/public/assets/{wardleyDiagram-NUSXRM2D-BZOchqF3.js → wardleyDiagram-NUSXRM2D-Grzw0FHg.js} +1 -1
- package/payload/server/public/assets/{xychartDiagram-5P7HB3ND-ZBEGH6ZI.js → xychartDiagram-5P7HB3ND-7pY90HjH.js} +1 -1
- package/payload/server/public/browser.html +4 -4
- package/payload/server/public/calendar.html +6 -6
- package/payload/server/public/chat.html +13 -14
- package/payload/server/public/data.html +11 -11
- package/payload/server/public/graph.html +9 -10
- package/payload/server/public/index.html +15 -16
- package/payload/server/public/operator.html +14 -15
- package/payload/server/public/public.html +13 -14
- package/payload/server/public/tasks.html +6 -6
- package/payload/server/public/assets/AdminShell-ClIT8c0K.js +0 -2
- package/payload/server/public/assets/admin-BHiA9_Ks.js +0 -1
- package/payload/server/public/assets/architecture-YZFGNWBL-Cypt5qHL.js +0 -1
- package/payload/server/public/assets/calendar-D45S_aal.js +0 -1
- package/payload/server/public/assets/channel-BMyXE4zc.js +0 -1
- package/payload/server/public/assets/chat-gy8scQov.js +0 -1
- package/payload/server/public/assets/chevron-down-CdxvexgY.js +0 -1
- package/payload/server/public/assets/chevron-left-D5LLz6ke.js +0 -1
- package/payload/server/public/assets/chevron-right-DzPmwDew.js +0 -1
- package/payload/server/public/assets/chunk-426QAEUC-Xu6JKP4d.js +0 -1
- package/payload/server/public/assets/chunk-QZHKN3VN-7_kS3RBy.js +0 -1
- package/payload/server/public/assets/classDiagram-6PBFFD2Q-DJqbNcuC.js +0 -1
- package/payload/server/public/assets/classDiagram-v2-HSJHXN6E-CGglqfQA.js +0 -1
- package/payload/server/public/assets/clone-BiTMTzp_.js +0 -1
- package/payload/server/public/assets/data-CUsNHUpu.js +0 -1
- package/payload/server/public/assets/gitGraph-7Q5UKJZL-C_-XjxLd.js +0 -1
- package/payload/server/public/assets/info-OMHHGYJF-BH8yDCfL.js +0 -1
- package/payload/server/public/assets/infoDiagram-42DDH7IO-DyDXyJ6U.js +0 -2
- package/payload/server/public/assets/operator-B-3vkwO8.js +0 -1
- package/payload/server/public/assets/packet-4T2RLAQJ-Bajcns4r.js +0 -1
- package/payload/server/public/assets/page-BbxoY4QI.js +0 -1
- package/payload/server/public/assets/pie-ZZUOXDRM-D7hjM5w1.js +0 -1
- package/payload/server/public/assets/radar-PYXPWWZC-B46d5x7a.js +0 -1
- package/payload/server/public/assets/stateDiagram-v2-QKLJ7IA2-CrstH34p.js +0 -1
- package/payload/server/public/assets/treeView-SZITEDCU-3XQh5xQ1.js +0 -1
- package/payload/server/public/assets/treemap-W4RFUUIX-DwR-_l5z.js +0 -1
- package/payload/server/public/assets/useSubAccountSwitcher-DDStL7Nt.js +0 -9
- package/payload/server/public/assets/useSubAccountSwitcher-DnfX9Uxe.css +0 -1
- package/payload/server/public/assets/wardley-RL74JXVD-DZp9oCGv.js +0 -1
- /package/payload/server/public/assets/{_baseFor-CMWvz0uA.js → _baseFor-k8hYPe-U.js} +0 -0
- /package/payload/server/public/assets/{array-Cny_NT6T.js → array-BFDiaBgf.js} +0 -0
- /package/payload/server/public/assets/{cytoscape.esm-De0CCmB2.js → cytoscape.esm-Ch0xptA4.js} +0 -0
- /package/payload/server/public/assets/{defaultLocale-BahRht8U.js → defaultLocale-ZeknFqNe.js} +0 -0
- /package/payload/server/public/assets/{dist-C9D_xz81.js → dist-B2N0v8hZ.js} +0 -0
- /package/payload/server/public/assets/{init-DoIvjoJ_.js → init-0VJVrkRJ.js} +0 -0
- /package/payload/server/public/assets/{katex-Bfn1OZEl.js → katex-Br7bH10N.js} +0 -0
- /package/payload/server/public/assets/{path-CTezU8L5.js → path-INs8XTPH.js} +0 -0
- /package/payload/server/public/assets/{preload-helper-D_sPnjeL.js → preload-helper-CH6UZRzu.js} +0 -0
- /package/payload/server/public/assets/{rough.esm-BJo4pvXu.js → rough.esm-DU9bZLvZ.js} +0 -0
- /package/payload/server/public/assets/{src-BTKk8KAG.js → src-DHSQDYx-.js} +0 -0
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
import { runMailFetchBody } from "./mail-fetch-body.js";
|
|
2
|
+
import { dispatchOutlookMessagesToConversationArchive, } from "../lib/conversation-archive-dispatch.js";
|
|
3
|
+
/**
|
|
4
|
+
* Split decisions into ingest ids + a discard count. Refuses an empty array
|
|
5
|
+
* (nothing to do) or a duplicate messageId (ambiguous disposition) so the
|
|
6
|
+
* operator re-issues a clean set rather than a silent partial ingest. Unlike
|
|
7
|
+
* email-ingest there is no staged batch or high-water mark to guard: the ids
|
|
8
|
+
* are explicit and the per-message decision holds over exactly this call.
|
|
9
|
+
*/
|
|
10
|
+
export function validateDecisions(decisions) {
|
|
11
|
+
if (decisions.length === 0) {
|
|
12
|
+
throw new Error("Refusing to ingest — no decisions passed. List messages with outlook-mail-list or outlook-mail-search first, then pass a disposition for each.");
|
|
13
|
+
}
|
|
14
|
+
const seen = new Set();
|
|
15
|
+
const toIngest = [];
|
|
16
|
+
let discarded = 0;
|
|
17
|
+
for (const d of decisions) {
|
|
18
|
+
const id = d.messageId.trim();
|
|
19
|
+
if (!id)
|
|
20
|
+
throw new Error(`Decision had a blank messageId: ${JSON.stringify(d)}`);
|
|
21
|
+
if (seen.has(id)) {
|
|
22
|
+
throw new Error(`Refusing to ingest — duplicate messageId "${id}". Pass one disposition per message.`);
|
|
23
|
+
}
|
|
24
|
+
seen.add(id);
|
|
25
|
+
if (d.disposition === "ingest")
|
|
26
|
+
toIngest.push(id);
|
|
27
|
+
else
|
|
28
|
+
discarded++;
|
|
29
|
+
}
|
|
30
|
+
return { toIngest, discarded };
|
|
31
|
+
}
|
|
32
|
+
/**
|
|
33
|
+
* Write operator-reviewed messages into the business graph. For each `ingest`
|
|
34
|
+
* decision the full body + envelope is fetched, threads are grouped by
|
|
35
|
+
* conversationId, participants are resolved closed-set against Neo4j, and each
|
|
36
|
+
* resolvable thread is dispatched through the shared conversation-archive
|
|
37
|
+
* script. Unresolved-address threads are skipped and reported.
|
|
38
|
+
*/
|
|
39
|
+
export async function runMailIngest(config, params) {
|
|
40
|
+
const { toIngest, discarded } = validateDecisions(params.decisions);
|
|
41
|
+
const messages = [];
|
|
42
|
+
for (const messageId of toIngest) {
|
|
43
|
+
const body = await runMailFetchBody(config, { messageId });
|
|
44
|
+
messages.push({
|
|
45
|
+
messageId: body.id,
|
|
46
|
+
conversationId: body.conversationId,
|
|
47
|
+
fromAddress: body.from,
|
|
48
|
+
fromName: body.fromName,
|
|
49
|
+
toAddresses: body.to,
|
|
50
|
+
ccAddresses: body.cc,
|
|
51
|
+
subject: body.subject,
|
|
52
|
+
bodyText: body.body,
|
|
53
|
+
receivedDateTime: body.receivedDateTime,
|
|
54
|
+
accountId: config.accountId,
|
|
55
|
+
});
|
|
56
|
+
console.error(`[outlook-mcp] mail-ingest op=ingest id=${body.id} conversationId=${body.conversationId ?? "none"} disposition=ingest`);
|
|
57
|
+
}
|
|
58
|
+
const { threadsDispatched, threadsSkipped, unresolvedAddresses } = await dispatchOutlookMessagesToConversationArchive(messages);
|
|
59
|
+
console.error(`[outlook-mcp] mail-ingest op=summary ingested=${toIngest.length} discarded=${discarded} threadsDispatched=${threadsDispatched} threadsSkipped=${threadsSkipped} unresolved=${unresolvedAddresses.length}`);
|
|
60
|
+
const lines = [
|
|
61
|
+
`Ingested ${toIngest.length} message(s); discarded ${discarded}.`,
|
|
62
|
+
`Graph: ${threadsDispatched} thread(s) dispatched to conversation-archive, ${threadsSkipped} skipped.`,
|
|
63
|
+
];
|
|
64
|
+
if (unresolvedAddresses.length > 0) {
|
|
65
|
+
lines.push(`Unresolved sender/recipient addresses (no :Person or :AdminUser carries these emails — add them to the graph and re-run outlook-mail-ingest to land their threads): ${unresolvedAddresses.join(", ")}`);
|
|
66
|
+
}
|
|
67
|
+
return lines.join("\n");
|
|
68
|
+
}
|
|
69
|
+
//# sourceMappingURL=mail-ingest.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1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AAmB,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,CACxM,CAAC;IACJ,CAAC;IACD,OAAO,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;AAC1B,CAAC"}
|
|
@@ -76,7 +76,8 @@ Reads the COMPLETE body (not `bodyPreview`). `body.contentType` is `html` or `te
|
|
|
76
76
|
{
|
|
77
77
|
id: string;
|
|
78
78
|
subject: string | null;
|
|
79
|
-
from: string | null;
|
|
79
|
+
from: string | null; // from.emailAddress.address
|
|
80
|
+
fromName: string | null; // from.emailAddress.name (additive) — the sender display name outlook-mail-ingest carries into the archive
|
|
80
81
|
to: string[]; // toRecipients[].emailAddress.address
|
|
81
82
|
cc: string[];
|
|
82
83
|
receivedDateTime: string;
|
|
@@ -124,6 +125,14 @@ Recoverable — moves to Deleted Items, never hard-deletes or expunges. An id al
|
|
|
124
125
|
|
|
125
126
|
**Returned shape:** `{ moved: string[]; notMoved: string[] }`.
|
|
126
127
|
|
|
128
|
+
## outlook-mail-ingest
|
|
129
|
+
|
|
130
|
+
**No direct Graph mutation.** Per approved message it calls `runMailFetchBody`'s `GET /me/messages/{id}?$select=…,body` to read the full body + envelope (including `conversationId` and the additive `fromName`). The graph write is delegated: threads are grouped by `conversationId`, participants resolve closed-set against Neo4j (`UNWIND $addresses … WHERE (p:Person OR p:AdminUser) AND p.accountId=$accountId AND toLower(p.email)=addr`), and each resolvable thread is written by spawning `plugins/memory/bin/conversation-archive-ingest.sh <thread.json> --source email --participant-person-ids <elementIds> --scope admin --session-id outlook-<uuid>`. The thread JSON is `[{from:{name,email}, date, bodyText}]`, the shape the shared `email` normaliser consumes. An unresolved From/To/Cc address skips its whole thread; no `:Person` is auto-created. This is the plugin's only Neo4j coupling (`neo4j-driver`, `lib/neo4j.ts`).
|
|
131
|
+
|
|
132
|
+
**Input:** `{ decisions: [{ messageId, disposition: "ingest" | "discard" }], mailbox? }`. Refuses an empty array and a duplicate messageId.
|
|
133
|
+
|
|
134
|
+
**Returned shape:** a plain-text summary — ingested/discarded counts, threads dispatched/skipped, and any unresolved addresses.
|
|
135
|
+
|
|
127
136
|
## outlook-mail-otp-extract
|
|
128
137
|
|
|
129
138
|
**Endpoints:** `GET /me/mailFolders/Inbox/messages?$top=15&$orderby=receivedDateTime DESC&$select=id,subject,from,receivedDateTime` to list candidates, then `outlook-mail-fetch-body`'s `GET /me/messages/{id}?$select=…,body` per sender-matched candidate. Scans immediately, then polls every 5 s until a code is found or `timeout` seconds (default 60) elapse. `extractOtpFromText` is shared verbatim with the `email` plugin.
|
|
@@ -60,6 +60,10 @@ The revoke path below is scoped to one specific, visible failure. It is not a ge
|
|
|
60
60
|
- `outlook-mail-reply messageId=<id> body=<text>` — reply in-thread. Threads natively (the original conversation is preserved). `replyAll=true` replies to the sender and every original recipient; `cc`/`bcc` add recipients; `attachments` is an array of file paths inside the account directory (up to 25 MB per file). The body is plain text, prepended above the quoted original. Needs `Mail.ReadWrite` + `Mail.Send`.
|
|
61
61
|
- `outlook-mail-delete ids=[<id>...]` — move messages to Deleted Items. RECOVERABLE: it never hard-deletes or expunges, so recovery is possible from the mailbox's Deleted Items. Pass the ids from a prior list/search. An id already gone is reported not-moved without failing the rest. Needs `Mail.ReadWrite`.
|
|
62
62
|
|
|
63
|
+
## Ingesting mail into memory
|
|
64
|
+
|
|
65
|
+
Writing operator-reviewed messages into the business graph is the `outlook-mail-ingest` skill (its own SKILL.md), which drives the list, summarise, ask, ingest loop over `outlook-mail-ingest`.
|
|
66
|
+
|
|
63
67
|
## One-time codes (OTP)
|
|
64
68
|
|
|
65
69
|
- `outlook-mail-otp-extract sender=<domain>` — poll the inbox for a verification code from a sender (e.g. `cloudflare.com`). Optional `subjectPattern` (regex) and `timeout` (seconds, default 60). Reads full bodies to extract the code. Used during service authentication.
|
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: outlook-mail-ingest
|
|
3
|
+
description: "Operator-initiated Outlook mail ingestion. Activate when the operator asks to check, triage, or pull Outlook mail into memory ('check my Outlook', 'ingest these Outlook messages', 'pull that thread into the graph'). Drives a list, summarise, ask, ingest loop using the outlook-mail-list / outlook-mail-search and outlook-mail-ingest tools. Human-in-the-loop: nothing enters the graph without an explicit operator decision per message."
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Outlook mail ingestion
|
|
7
|
+
|
|
8
|
+
Invoked from `specialists:personal-assistant`.
|
|
9
|
+
|
|
10
|
+
Operator-initiated, human-in-the-loop ingestion of an Outlook mailbox into the business graph. Reviewed messages become `:ConversationArchive {source:'email'}` threads. A message enters the graph only when the operator says so, and only the ones they pick. There is no background poll, no automatic classifier, no silent writes.
|
|
11
|
+
|
|
12
|
+
This is the Microsoft Graph analogue of the IMAP `email-ingest` skill. It differs in one structural way: Outlook reads are stateless Graph calls, so there is no staged batch and no high-water mark. You list with the ordinary read tools and pass the exact message ids you want to `outlook-mail-ingest`.
|
|
13
|
+
|
|
14
|
+
## When to activate
|
|
15
|
+
|
|
16
|
+
Activate when the operator wants to bring Outlook mail into the agent's memory. Typical phrasings:
|
|
17
|
+
|
|
18
|
+
- "Check my Outlook."
|
|
19
|
+
- "Ingest these Outlook messages."
|
|
20
|
+
- "Pull that Outlook thread into the graph."
|
|
21
|
+
|
|
22
|
+
Do not activate for:
|
|
23
|
+
|
|
24
|
+
- Reading or searching mail already in the mailbox or the graph. Those are `outlook-mail-list`, `outlook-mail-search`, `outlook-mail-fetch-body`.
|
|
25
|
+
- Drafting or sending. Those are `outlook-draft`, `outlook-mail-reply`, `outlook-mail-send`.
|
|
26
|
+
- Setup, status, or OTP extraction. Those are direct tool calls.
|
|
27
|
+
|
|
28
|
+
## Flow
|
|
29
|
+
|
|
30
|
+
### 1. List
|
|
31
|
+
|
|
32
|
+
Call `outlook-mail-list` (or `outlook-mail-search` for a sender or subject filter). Both return a preview per message with its id, sender, subject, and `receivedDateTime`. They write nothing to the graph.
|
|
33
|
+
|
|
34
|
+
An account can hold more than one mailbox. When it does, every operational tool refuses unless it names one, and the refusal lists the connected mailboxes. That refusal means "say which mailbox", not "there is no mail". Resolve it with `outlook-mailbox-list`, then pass `mailbox` and carry on.
|
|
35
|
+
|
|
36
|
+
Reads page beyond the newest window. When a response carries a `nextCursor`, older messages remain behind it; pass the cursor back to page on. Absence of a `nextCursor` is the only thing that means you saw everything in range.
|
|
37
|
+
|
|
38
|
+
### 2. Summarise
|
|
39
|
+
|
|
40
|
+
Present the listed messages to the operator as a numbered or per-id summary. For each, surface the sender, the subject, and a one-line gist from the preview. Where a message is obviously one or the other, suggest a disposition ("newsletter, looks like discard"; "thread reply from a known correspondent, looks like ingest"). The suggestion is a hint, never an action; the operator decides.
|
|
41
|
+
|
|
42
|
+
There is no screener. If a message looks like phishing, say so in plain English so the operator can discard it by eye.
|
|
43
|
+
|
|
44
|
+
### 3. Ask
|
|
45
|
+
|
|
46
|
+
Ask the operator to confirm a disposition for every message you intend to ingest. Either a blanket call ("ingest all", "discard the rest") that you turn into the per-message map, or an explicit per-message choice ("ingest 1, 2, 4; discard 3"). If the operator answers ambiguously ("the work ones"), restate the messages you think they mean and confirm before proceeding. Never guess.
|
|
47
|
+
|
|
48
|
+
### 4. Ingest
|
|
49
|
+
|
|
50
|
+
Call `outlook-mail-ingest` with a `decisions` array: one `{ messageId, disposition }` per message, `disposition` being `ingest` or `discard`. The tool refuses an empty array and refuses a duplicate messageId, so pass a clean set with one disposition per id.
|
|
51
|
+
|
|
52
|
+
For each `ingest` message the tool fetches the full body and envelope, groups messages into threads by Graph `conversationId`, and resolves every From/To/Cc address closed-set against the graph. An address that does not already resolve to a `:Person` or `:AdminUser` for this account causes its whole thread to skip; the tool returns the unresolved addresses. It never creates a `:Person`.
|
|
53
|
+
|
|
54
|
+
On success the tool returns a one-line summary: how many were ingested, how many discarded, how many threads dispatched or skipped, and any unresolved addresses.
|
|
55
|
+
|
|
56
|
+
### 5. Confirm
|
|
57
|
+
|
|
58
|
+
Echo the tool's summary back to the operator in one sentence. If any thread was skipped for an unresolved address, tell the operator which address, and that adding that person to the graph and re-running will land the thread. If they want to draft a reply to anything just ingested, hand off to the Outlook compose tools.
|
|
59
|
+
|
|
60
|
+
## Edge cases
|
|
61
|
+
|
|
62
|
+
| Situation | Behaviour |
|
|
63
|
+
|-----------|-----------|
|
|
64
|
+
| The list returns zero messages | Tell the operator and stop. Do not call `outlook-mail-ingest`. |
|
|
65
|
+
| An address on a thread does not resolve | The thread is skipped and the address is returned. Surface it; the operator adds the person to the graph, then re-runs for that message. |
|
|
66
|
+
| Operator wants to ingest some now and review the rest later | Fine. Ids are explicit, so ingest exactly the ones decided now and list the rest again later. There is no high-water mark to advance and nothing is silently dropped. |
|
|
67
|
+
| Operator abandons mid-flow | Do not call `outlook-mail-ingest`. Nothing was staged and nothing changes. |
|
|
68
|
+
| A tool errors (Graph down, auth failure) | Surface the error verbatim. Do not retry silently. |
|
|
69
|
+
|
|
70
|
+
## Out of scope
|
|
71
|
+
|
|
72
|
+
- Automatic re-screening or classification. The operator is the screener.
|
|
73
|
+
- Scheduled or recurring ingestion. The operator initiates every cycle.
|
|
74
|
+
- Attachment ingest. This skill lands text threads only.
|
|
75
|
+
- Other channels. WhatsApp, IMAP email, and the public web have their own ingestion paths.
|
|
76
|
+
|
|
77
|
+
## Observability
|
|
78
|
+
|
|
79
|
+
Each ingest emits tagged lines the operator can grep:
|
|
80
|
+
|
|
81
|
+
- `[outlook-mcp] mail-ingest op=ingest id=<id> conversationId=<id> disposition=ingest` per approved message.
|
|
82
|
+
- `[outlook-mcp] mail-ingest op=thread-dispatched root=<key> messages=<n> participants=<n>` per landed thread.
|
|
83
|
+
- `[outlook-mcp] mail-ingest op=summary ingested=<n> discarded=<m> threadsDispatched=<n> threadsSkipped=<n> unresolved=<n>` once per call.
|
|
84
|
+
|
|
85
|
+
A complete cycle is greppable as the `[outlook-mcp] mail-ingest` lines for one session. A `threadsSkipped` above zero with an `unresolved` count is the closed-set resolution refusing an unknown participant, not a failure.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"canonical-tool-names.generated.d.ts","sourceRoot":"","sources":["../src/canonical-tool-names.generated.ts"],"names":[],"mappings":"AAQA,+EAA+E;AAC/E,eAAO,MAAM,gBAAgB,EAAE,SAAS,MAAM,EAyB7C,CAAA;AAED,gEAAgE;AAChE,eAAO,MAAM,yBAAyB,EAAE,SAAS,MAAM,
|
|
1
|
+
{"version":3,"file":"canonical-tool-names.generated.d.ts","sourceRoot":"","sources":["../src/canonical-tool-names.generated.ts"],"names":[],"mappings":"AAQA,+EAA+E;AAC/E,eAAO,MAAM,gBAAgB,EAAE,SAAS,MAAM,EAyB7C,CAAA;AAED,gEAAgE;AAChE,eAAO,MAAM,yBAAyB,EAAE,SAAS,MAAM,EA+TtD,CAAA"}
|
package/payload/platform/services/claude-session-manager/dist/canonical-tool-names.generated.js
CHANGED
|
@@ -260,6 +260,7 @@ export const CANONICAL_MAXY_TOOL_NAMES = [
|
|
|
260
260
|
"mcp__plugin_outlook_outlook__outlook-mail-attachment",
|
|
261
261
|
"mcp__plugin_outlook_outlook__outlook-mail-delete",
|
|
262
262
|
"mcp__plugin_outlook_outlook__outlook-mail-fetch-body",
|
|
263
|
+
"mcp__plugin_outlook_outlook__outlook-mail-ingest",
|
|
263
264
|
"mcp__plugin_outlook_outlook__outlook-mail-list",
|
|
264
265
|
"mcp__plugin_outlook_outlook__outlook-mail-otp-extract",
|
|
265
266
|
"mcp__plugin_outlook_outlook__outlook-mail-reply",
|
package/payload/platform/services/claude-session-manager/dist/canonical-tool-names.generated.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"canonical-tool-names.generated.js","sourceRoot":"","sources":["../src/canonical-tool-names.generated.ts"],"names":[],"mappings":"AAAA,mCAAmC;AACnC,kEAAkE;AAClE,yDAAyD;AACzD,kFAAkF;AAClF,EAAE;AACF,yEAAyE;AACzE,6DAA6D;AAE7D,+EAA+E;AAC/E,MAAM,CAAC,MAAM,gBAAgB,GAAsB;IACjD,O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kD;IAClD,mDAAmD;IACnD,+CAA+C;IAC/C,gDAAgD;IAChD,gDAAgD;IAChD,kDAAkD;IAClD,oDAAoD;CACrD,CAAA"}
|
|
1
|
+
{"version":3,"file":"canonical-tool-names.generated.js","sourceRoot":"","sources":["../src/canonical-tool-names.generated.ts"],"names":[],"mappings":"AAAA,mCAAmC;AACnC,kEAAkE;AAClE,yDAAyD;AACzD,kFAAkF;AAClF,EAAE;AACF,yEAAyE;AACzE,6DAA6D;AAE7D,+EAA+E;AAC/E,MAAM,CAAC,MAAM,gBAAgB,GAAsB;IACjD,OAAO;IACP,KAAK;IACL,SAAS;IACT,WAAW;IACX,UAAU;IACV,OAAO;IACP,YAAY;IACZ,QAAQ;IACR,OAAO;IACP,cAAc;IACd,UAAU;IACV,QAAQ;IACR,QAAQ;IACR,SAAS;IACT,YAAY;IACZ,WAAW;IACX,YAAY;IACZ,gBAAgB;IAChB,UAAU;IACV,SAAS;IACT,cAAc;IACd,UAAU;IACV,MAAM;IACN,WAAW;CACZ,CAAA;AAED,gEAAgE;AAChE,MAAM,CAAC,MAAM,yBAAyB,GAAsB;IAC1D,yCAAyC;IACzC,yCAAyC;IACzC,kDAAkD;IAClD,sDAAsD;IACtD,yCAAyC;IACzC,yCAAyC;IACzC,uCAAuC;IACvC,wCAAwC;IACxC,iDAAiD;IACjD,yCAAyC;IACzC,iDAAiD;IACjD,yCAAyC;IACzC,sCAAsC;IACtC,yCAAyC;IACzC,wCAAwC;IACxC,oCAAoC;IACpC,yCAAyC;IACzC,qCAAqC;IACrC,uCAAuC;IACvC,2CAA2C;IAC3C,4CAA4C;IAC5C,qCAAqC;IACrC,yCAAyC;IACzC,4CAA4C;IAC5C,0CAA0C;IAC1C,2CAA2C;IAC3C,oCAAoC;IACpC,sCAAsC;IACtC,0CAA0C;IAC1C,uCAAuC;IACvC,sCAAsC;IACtC,sDAAsD;IACtD,mDAAmD;IACnD,6CAA6C;IAC7C,wCAAwC;IACxC,yCAAyC;IACzC,qCAAqC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;IAClE,uDAAuD;IACvD,oDAAoD;IACpD,oDAAoD;IACpD,qDAAqD;IACrD,oDAAoD;IACpD,kDAAkD;IAClD,+CAA+C;IAC/C,oDAAoD;IACpD,gDAAgD;IAChD,yCAAyC;IACzC,uCAAuC;IACvC,oCAAoC;IACpC,qCAAqC;IACrC,uCAAuC;IACvC,qCAAqC;IACrC,yCAAyC;IACzC,qCAAqC;IACrC,sCAAsC;IACtC,oCAAoC;IACpC,iCAAiC;IACjC,kCAAkC;IAClC,mCAAmC;IACnC,oCAAoC;IACpC,oCAAoC;IACpC,kDAAkD;IAClD,kDAAkD;IAClD,mDAAmD;IACnD,+CAA+C;IAC/C,gDAAgD;IAChD,gDAAgD;IAChD,kDAAkD;IAClD,oDAAoD;CACrD,CAAA"}
|
|
@@ -3,7 +3,7 @@ name: personal-assistant
|
|
|
3
3
|
description: "Platform settings, messaging channels (Telegram, WhatsApp, email, Outlook), and browser automation, plus mechanical calendar subtasks you hand it with the facts already resolved (export these event IDs to .ics, parse this inbound .ics). Delegate when the work is configuring the platform, sending or reading messages, or driving a browser. Do not delegate calendar reasoning or an availability-affecting booking: only your admin session sees the connector-backed real calendar, so the specialist would answer from the internal scheduling store alone and miss it. You own what is on the calendar and what booking against it does."
|
|
4
4
|
summary: "Handles the operational tasks you'd give a personal assistant: scheduling meetings, managing your platform settings, connecting messaging channels, and completing browser-based tasks on your behalf."
|
|
5
5
|
model: claude-sonnet-5
|
|
6
|
-
tools: Skill, mcp__plugin_admin_admin__system-status, mcp__plugin_admin_admin__brand-settings, mcp__plugin_admin_admin__account-manage, mcp__plugin_admin_admin__account-update, mcp__plugin_admin_admin__logs-read, mcp__plugin_admin_admin__plugin-read, mcp__plugin_admin_admin__wifi, mcp__plugin_contacts_contacts__contact-create, mcp__plugin_contacts_contacts__contact-lookup, mcp__plugin_contacts_contacts__contact-update, mcp__plugin_contacts_contacts__contact-delete, mcp__plugin_contacts_contacts__contact-list, mcp__plugin_contacts_contacts__contact-export, mcp__plugin_contacts_contacts__contact-erase, mcp__plugin_contacts_contacts__group-create, mcp__plugin_contacts_contacts__group-manage, mcp__plugin_telegram_telegram__message, mcp__plugin_telegram_telegram__message-history, mcp__plugin_telegram_telegram__telegram-webhook-register, mcp__plugin_whatsapp_whatsapp__whatsapp-login-start, mcp__plugin_whatsapp_whatsapp__whatsapp-login-wait, mcp__plugin_whatsapp_whatsapp__whatsapp-status, mcp__plugin_whatsapp_whatsapp__whatsapp-disconnect, mcp__plugin_whatsapp_whatsapp__whatsapp-config, mcp__plugin_whatsapp_whatsapp__whatsapp-activity, mcp__plugin_whatsapp_whatsapp__whatsapp-conversations, mcp__plugin_whatsapp_whatsapp__whatsapp-messages, mcp__plugin_whatsapp_whatsapp__whatsapp-conversation-graph-state, mcp__plugin_whatsapp_whatsapp__whatsapp-group-info, mcp__plugin_whatsapp_whatsapp__whatsapp-send-admin, mcp__plugin_whatsapp_whatsapp__whatsapp-reply, mcp__plugin_email_email__email-provider-info, mcp__plugin_email_email__email-setup, mcp__plugin_email_email__email-read, mcp__plugin_email_email__email-fetch-body, mcp__plugin_email_email__email-fetch-attachment, mcp__plugin_email_email__email-send, mcp__plugin_email_email__email-draft, mcp__plugin_email_email__email-draft-edit, mcp__plugin_email_email__email-draft-send, mcp__plugin_email_email__email-reply, mcp__plugin_email_email__email-search, mcp__plugin_email_email__email-delete, mcp__plugin_email_email__email-graph-query, mcp__plugin_email_email__email-otp-extract, mcp__plugin_email_email__email-status, mcp__plugin_email_email__email-fetch, mcp__plugin_email_email__email-ingest, mcp__plugin_outlook_outlook__outlook-account-register, mcp__plugin_outlook_outlook__outlook-account-register-poll, mcp__plugin_outlook_outlook__outlook-mail-list, mcp__plugin_outlook_outlook__outlook-mail-search, mcp__plugin_outlook_outlook__outlook-mail-fetch-body, mcp__plugin_outlook_outlook__outlook-mail-attachment, mcp__plugin_outlook_outlook__outlook-mail-reply, mcp__plugin_outlook_outlook__outlook-mail-delete, mcp__plugin_outlook_outlook__outlook-mail-otp-extract, mcp__plugin_outlook_outlook__outlook-mail-send, mcp__plugin_outlook_outlook__outlook-draft, mcp__plugin_outlook_outlook__outlook-draft-edit, mcp__plugin_outlook_outlook__outlook-draft-send, mcp__plugin_outlook_outlook__outlook-calendar-list, mcp__plugin_outlook_outlook__outlook-calendar-event, mcp__plugin_outlook_outlook__outlook-calendar-create, mcp__plugin_outlook_outlook__outlook-calendar-update, mcp__plugin_outlook_outlook__outlook-calendar-cancel, mcp__plugin_outlook_outlook__outlook-calendar-respond, mcp__plugin_outlook_outlook__outlook-calendar-freebusy, mcp__plugin_outlook_outlook__outlook-contacts-list, mcp__plugin_outlook_outlook__outlook-mailbox-info, mcp__plugin_outlook_outlook__outlook-mailbox-list, mcp__plugin_google_google__google-account-register, mcp__plugin_google_google__google-account-register-poll, mcp__plugin_google_google__google-account-register-submit, mcp__plugin_google_google__google-calendar-list, mcp__plugin_google_google__google-calendar-event, mcp__plugin_google_google__google-calendar-create, mcp__plugin_google_google__google-calendar-update, mcp__plugin_google_google__google-calendar-cancel, mcp__plugin_google_google__google-calendar-respond, mcp__plugin_google_google__google-calendar-freebusy, mcp__plugin_google_google__google-account-info, mcp__plugin_google_google__google-account-list, mcp__plugin_scheduling_scheduling__schedule-event, mcp__plugin_scheduling_scheduling__schedule-list, mcp__plugin_scheduling_scheduling__schedule-get, mcp__plugin_scheduling_scheduling__schedule-update, mcp__plugin_scheduling_scheduling__schedule-cancel, mcp__plugin_scheduling_scheduling__schedule-export-ics, mcp__plugin_scheduling_scheduling__schedule-import-ics, mcp__plugin_scheduling_scheduling__time-resolve, mcp__plugin_memory_memory__memory-search, mcp__plugin_memory_memory__profile-update, mcp__plugin_url-get_url-get__url-get, mcp__plugin_browser_browser__browser-render, mcp__plugin_browser_browser__browser-navigate, mcp__plugin_browser_browser__browser-snapshot, mcp__plugin_browser_browser__browser-click, mcp__plugin_browser_browser__browser-fill, mcp__plugin_browser_browser__browser-fill-form, mcp__plugin_browser_browser__browser-type, mcp__plugin_browser_browser__browser-press-key, mcp__plugin_browser_browser__browser-hover, mcp__plugin_browser_browser__browser-select-option, mcp__plugin_browser_browser__browser-wait-for, mcp__plugin_browser_browser__browser-handle-dialog, mcp__plugin_browser_browser__browser-evaluate, mcp__plugin_browser_browser__browser-console-messages, mcp__plugin_browser_browser__browser-tabs, mcp__plugin_browser_browser__browser-pdf-save, mcp__plugin_browser_browser__browser-screenshot, mcp__plugin_browser_browser__browser-resize
|
|
6
|
+
tools: Skill, mcp__plugin_admin_admin__system-status, mcp__plugin_admin_admin__brand-settings, mcp__plugin_admin_admin__account-manage, mcp__plugin_admin_admin__account-update, mcp__plugin_admin_admin__logs-read, mcp__plugin_admin_admin__plugin-read, mcp__plugin_admin_admin__wifi, mcp__plugin_contacts_contacts__contact-create, mcp__plugin_contacts_contacts__contact-lookup, mcp__plugin_contacts_contacts__contact-update, mcp__plugin_contacts_contacts__contact-delete, mcp__plugin_contacts_contacts__contact-list, mcp__plugin_contacts_contacts__contact-export, mcp__plugin_contacts_contacts__contact-erase, mcp__plugin_contacts_contacts__group-create, mcp__plugin_contacts_contacts__group-manage, mcp__plugin_telegram_telegram__message, mcp__plugin_telegram_telegram__message-history, mcp__plugin_telegram_telegram__telegram-webhook-register, mcp__plugin_whatsapp_whatsapp__whatsapp-login-start, mcp__plugin_whatsapp_whatsapp__whatsapp-login-wait, mcp__plugin_whatsapp_whatsapp__whatsapp-status, mcp__plugin_whatsapp_whatsapp__whatsapp-disconnect, mcp__plugin_whatsapp_whatsapp__whatsapp-config, mcp__plugin_whatsapp_whatsapp__whatsapp-activity, mcp__plugin_whatsapp_whatsapp__whatsapp-conversations, mcp__plugin_whatsapp_whatsapp__whatsapp-messages, mcp__plugin_whatsapp_whatsapp__whatsapp-conversation-graph-state, mcp__plugin_whatsapp_whatsapp__whatsapp-group-info, mcp__plugin_whatsapp_whatsapp__whatsapp-send-admin, mcp__plugin_whatsapp_whatsapp__whatsapp-reply, mcp__plugin_email_email__email-provider-info, mcp__plugin_email_email__email-setup, mcp__plugin_email_email__email-read, mcp__plugin_email_email__email-fetch-body, mcp__plugin_email_email__email-fetch-attachment, mcp__plugin_email_email__email-send, mcp__plugin_email_email__email-draft, mcp__plugin_email_email__email-draft-edit, mcp__plugin_email_email__email-draft-send, mcp__plugin_email_email__email-reply, mcp__plugin_email_email__email-search, mcp__plugin_email_email__email-delete, mcp__plugin_email_email__email-graph-query, mcp__plugin_email_email__email-otp-extract, mcp__plugin_email_email__email-status, mcp__plugin_email_email__email-fetch, mcp__plugin_email_email__email-ingest, mcp__plugin_outlook_outlook__outlook-account-register, mcp__plugin_outlook_outlook__outlook-account-register-poll, mcp__plugin_outlook_outlook__outlook-mail-list, mcp__plugin_outlook_outlook__outlook-mail-search, mcp__plugin_outlook_outlook__outlook-mail-fetch-body, mcp__plugin_outlook_outlook__outlook-mail-attachment, mcp__plugin_outlook_outlook__outlook-mail-reply, mcp__plugin_outlook_outlook__outlook-mail-delete, mcp__plugin_outlook_outlook__outlook-mail-ingest, mcp__plugin_outlook_outlook__outlook-mail-otp-extract, mcp__plugin_outlook_outlook__outlook-mail-send, mcp__plugin_outlook_outlook__outlook-draft, mcp__plugin_outlook_outlook__outlook-draft-edit, mcp__plugin_outlook_outlook__outlook-draft-send, mcp__plugin_outlook_outlook__outlook-calendar-list, mcp__plugin_outlook_outlook__outlook-calendar-event, mcp__plugin_outlook_outlook__outlook-calendar-create, mcp__plugin_outlook_outlook__outlook-calendar-update, mcp__plugin_outlook_outlook__outlook-calendar-cancel, mcp__plugin_outlook_outlook__outlook-calendar-respond, mcp__plugin_outlook_outlook__outlook-calendar-freebusy, mcp__plugin_outlook_outlook__outlook-contacts-list, mcp__plugin_outlook_outlook__outlook-mailbox-info, mcp__plugin_outlook_outlook__outlook-mailbox-list, mcp__plugin_google_google__google-account-register, mcp__plugin_google_google__google-account-register-poll, mcp__plugin_google_google__google-account-register-submit, mcp__plugin_google_google__google-calendar-list, mcp__plugin_google_google__google-calendar-event, mcp__plugin_google_google__google-calendar-create, mcp__plugin_google_google__google-calendar-update, mcp__plugin_google_google__google-calendar-cancel, mcp__plugin_google_google__google-calendar-respond, mcp__plugin_google_google__google-calendar-freebusy, mcp__plugin_google_google__google-account-info, mcp__plugin_google_google__google-account-list, mcp__plugin_scheduling_scheduling__schedule-event, mcp__plugin_scheduling_scheduling__schedule-list, mcp__plugin_scheduling_scheduling__schedule-get, mcp__plugin_scheduling_scheduling__schedule-update, mcp__plugin_scheduling_scheduling__schedule-cancel, mcp__plugin_scheduling_scheduling__schedule-export-ics, mcp__plugin_scheduling_scheduling__schedule-import-ics, mcp__plugin_scheduling_scheduling__time-resolve, mcp__plugin_memory_memory__memory-search, mcp__plugin_memory_memory__profile-update, mcp__plugin_url-get_url-get__url-get, mcp__plugin_browser_browser__browser-render, mcp__plugin_browser_browser__browser-navigate, mcp__plugin_browser_browser__browser-snapshot, mcp__plugin_browser_browser__browser-click, mcp__plugin_browser_browser__browser-fill, mcp__plugin_browser_browser__browser-fill-form, mcp__plugin_browser_browser__browser-type, mcp__plugin_browser_browser__browser-press-key, mcp__plugin_browser_browser__browser-hover, mcp__plugin_browser_browser__browser-select-option, mcp__plugin_browser_browser__browser-wait-for, mcp__plugin_browser_browser__browser-handle-dialog, mcp__plugin_browser_browser__browser-evaluate, mcp__plugin_browser_browser__browser-console-messages, mcp__plugin_browser_browser__browser-tabs, mcp__plugin_browser_browser__browser-pdf-save, mcp__plugin_browser_browser__browser-screenshot, mcp__plugin_browser_browser__browser-resize
|
|
7
7
|
pattern_deliverable: false
|
|
8
8
|
---
|
|
9
9
|
|
|
@@ -5,12 +5,12 @@
|
|
|
5
5
|
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
|
6
6
|
<title>Activity — Maxy</title>
|
|
7
7
|
<link rel="icon" href="/favicon.ico">
|
|
8
|
-
<script type="module" crossorigin src="/assets/activity-
|
|
8
|
+
<script type="module" crossorigin src="/assets/activity-cVe5ZnG7.js"></script>
|
|
9
9
|
<link rel="modulepreload" crossorigin href="/assets/chunk-TPjIAO9U.js">
|
|
10
|
-
<link rel="modulepreload" crossorigin href="/assets/useSubAccountSwitcher-
|
|
11
|
-
<link rel="modulepreload" crossorigin href="/assets/AdminShell-
|
|
12
|
-
<link rel="modulepreload" crossorigin href="/assets/triangle-alert-
|
|
13
|
-
<link rel="stylesheet" crossorigin href="/assets/useSubAccountSwitcher-
|
|
10
|
+
<link rel="modulepreload" crossorigin href="/assets/useSubAccountSwitcher-DdctgpPL.js">
|
|
11
|
+
<link rel="modulepreload" crossorigin href="/assets/AdminShell-CiTHCp5t.js">
|
|
12
|
+
<link rel="modulepreload" crossorigin href="/assets/triangle-alert-DKZ69dOa.js">
|
|
13
|
+
<link rel="stylesheet" crossorigin href="/assets/useSubAccountSwitcher-DFnDNIDO.css">
|
|
14
14
|
<link rel="stylesheet" href="/brand-defaults.css">
|
|
15
15
|
</head>
|
|
16
16
|
<body>
|
package/payload/server/public/assets/{AdminLoginScreens-CFF28MGy.js → AdminLoginScreens-BXDYzNbq.js}
RENAMED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{o as e}from"./chunk-TPjIAO9U.js";import{I as t,P as n,R as r,U as i,z as a}from"./useSubAccountSwitcher-DDStL7Nt.js";import{D as o}from"./useVoiceRecorder-kqMitFlk.js";import{_ as s,v as c,y as l}from"./AdminShell-ClIT8c0K.js";var u=`admin-landing-redirected`,d=`/graph`;function f(e){return e.variant===`operator`?!1:e.appState===`chat`&&!e.alreadyRedirected}var p=e(i(),1);function m(e=`admin`){let[t,n]=(0,p.useState)(`loading`),[r,i]=(0,p.useState)(``),[s,c]=(0,p.useState)(``),[m,h]=(0,p.useState)(``),[g,_]=(0,p.useState)(!1),[v,y]=(0,p.useState)(!1),[b,x]=(0,p.useState)(!1),[S,C]=(0,p.useState)(!1),[w,T]=(0,p.useState)(!1),[E,D]=(0,p.useState)(null),[O,k]=(0,p.useState)(null),[A,j]=(0,p.useState)(void 0),[M,N]=(0,p.useState)(null),[P,F]=(0,p.useState)(void 0),[I,L]=(0,p.useState)(null),[R,z]=(0,p.useState)(null),[B,V]=(0,p.useState)(void 0),H=(0,p.useRef)(void 0),[U,W]=(0,p.useState)(!1),[G,K]=(0,p.useState)(!0);(0,p.useEffect)(()=>{typeof window>`u`||fetch(`/api/remote-auth/status`).then(e=>e.ok?e.json():null).then(e=>{e?.configured&&W(!0)}).catch(()=>{})},[]);let q=(0,p.useRef)(null),J=(0,p.useRef)(null);(0,p.useEffect)(()=>{async function e(){let e=null;try{e=sessionStorage.getItem(`maxy-admin-session-key`)}catch{}if(!e)return!1;try{let t=await fetch(`/api/admin/session?session_key=${encodeURIComponent(e)}`);if(t.status===401){try{sessionStorage.removeItem(`maxy-admin-session-key`)}catch{}return!1}if(!t.ok)return!1;let r=await t.json();D(r.session_key),z(r.sessionId??null),j(r.businessName),N(r.role??null),F(r.userName===void 0?null:r.userName),L(r.avatar??null);let i=o(r.thinkingView);return H.current=i,V(i),n(`chat`),!0}catch(e){return console.error(`[admin] session restore failed:`,e),!1}}async function t(r=2){try{let i=await fetch(`/api/health`);if(!i.ok){if(r>0)return await new Promise(e=>setTimeout(e,1500)),t(r-1);console.error(`[admin] health check returned ${i.status} after retries`),n(`set-pin`);return}let a=await i.json();if(!a.pin_configured){n(`set-pin`);return}K(!!a.claude_authenticated);let o=!1;try{o=new URLSearchParams(window.location.search).get(`connect`)===`claude`}catch{}if(o){try{let e=new URL(window.location.href);e.searchParams.delete(`connect`),window.history.replaceState(null,``,e.pathname+e.search+e.hash)}catch{}if(!a.claude_authenticated){n(`connect-claude`);return}}if(await e())return;n(`enter-pin`)}catch(e){if(r>0)return await new Promise(e=>setTimeout(e,1500)),t(r-1);console.error(`[admin] health check failed:`,e),n(`set-pin`)}}t()},[]),(0,p.useEffect)(()=>{t===`chat`&&fetch(`/api/admin/claude-info`).then(e=>{if(e.ok)return e.json()}).then(e=>{e&&k(e)}).catch(()=>{})},[t]),(0,p.useEffect)(()=>{if(typeof window>`u`)return;let n=!1;try{n=sessionStorage.getItem(u)===`1`}catch{}if(f({appState:t,alreadyRedirected:n,variant:e})){try{sessionStorage.setItem(u,`1`)}catch{}console.info(`[admin-ui] landing-redirect target=${d}`),window.location.replace(d)}},[t,e]);let Y=(0,p.useRef)(null);(0,p.useEffect)(()=>{if(t!==`chat`)return;let e=setInterval(async()=>{try{let e=await fetch(`/api/health`);if(e.ok){let t=await e.json();K(t.auth_status!==`dead`&&t.auth_status!==`missing`)}}catch{}if(E)try{let e=await fetch(`/api/admin/session?session_key=${encodeURIComponent(E)}`);if(e.status!==401)return;let t=(await e.clone().json().catch(()=>null))?.code??`unknown-401`;if(t===`remote-auth-required`){a(`heartbeat`,`/api/admin/session`);return}console.warn(`[admin-auth] outcome=heartbeat-detected-expiry code=${t}`),Y.current?.()}catch{}},300*1e3);return()=>clearInterval(e)},[t,E]),(0,p.useEffect)(()=>{t===`connect-claude`&&fetch(`/api/health`).then(e=>e.ok?e.json():null).then(e=>{e?.claude_authenticated&&(K(!0),n(`enter-pin`))}).catch(()=>{})},[t]);async function X(e,t){y(!0);try{let r=await fetch(`/api/admin/session`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify({pin:e,...t?{accountId:t}:{}})});if(!r.ok){let e=await r.json().catch(()=>({}));if(r.status===401&&e?.code===`remote-auth-required`){a(`enter-pin`,`/api/admin/session`);return}h(e.error||`Invalid PIN`);return}let s=await r.json();D(s.session_key),z(s.sessionId??null),j(s.businessName),N(s.role??null),F(s.userName===void 0?null:s.userName),L(s.avatar??null);let c=o(s.thinkingView);H.current=c,V(c);try{sessionStorage.setItem(`maxy-admin-session-key`,s.session_key)}catch{}i(``),n(`chat`)}catch(e){console.error(`[admin] connection error:`,e),h(`Could not connect.`)}finally{y(!1)}}let Z=(0,p.useCallback)(async e=>{if(e.preventDefault(),v)return;h(``);let t=s.trim();if(!t){h(`Please enter your name.`);return}if(r.length<4){h(`PIN must be at least 4 characters.`);return}let o=r;y(!0);try{let e=await fetch(`/api/onboarding/set-pin`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify({pin:o,name:t})});if(!e.ok){let t=await e.json().catch(()=>({}));if(e.status===401&&t?.code===`remote-auth-required`){a(`set-pin`,`/api/onboarding/set-pin`);return}if(e.status===409){console.log(`[admin] PIN already configured — re-checking health`);try{let e=await fetch(`/api/health`);if(e.ok){let r=await e.json();r.pin_configured&&r.claude_authenticated?n(`enter-pin`):r.pin_configured?n(`connect-claude`):h(t.error||`Failed to set PIN.`)}else n(`enter-pin`)}catch{n(`enter-pin`)}return}h(t.error||`Failed to set PIN.`);return}let r=await fetch(`/api/health`);if((r.ok?await r.json():null)?.claude_authenticated){await X(o);return}i(``),n(`connect-claude`)}catch(e){console.error(`[admin] connection error:`,e),h(`Could not connect.`)}finally{y(!1)}},[r,v,s]),Q=(0,p.useCallback)(async e=>{e.preventDefault(),h(``),await X(r)},[r]),ee=(0,p.useCallback)(async()=>{T(!0);try{if(!await l())return console.warn(`[admin-ui] claude-disconnect not verified — credentials may persist; staying put`),!1;K(!1),D(null),N(null),F(void 0),L(null);try{sessionStorage.removeItem(`maxy-admin-session-key`),sessionStorage.removeItem(u)}catch{}return n(`connect-claude`),!0}finally{T(!1)}},[]),$=(0,p.useCallback)(()=>{D(null),N(null),F(void 0),L(null);try{sessionStorage.removeItem(`maxy-admin-session-key`),sessionStorage.removeItem(u)}catch{}i(``),h(``),n(`enter-pin`)},[]);return(0,p.useEffect)(()=>{Y.current=$},[$]),{appState:t,setAppState:n,pin:r,setPin:i,operatorName:s,setOperatorName:c,pinError:m,setPinError:h,showPin:g,setShowPin:_,pinLoading:v,authPolling:b,setAuthPolling:x,authLoading:S,setAuthLoading:C,disconnecting:w,cacheKey:E,setCacheKey:D,claudeInfo:O,setClaudeInfo:k,businessName:A,role:M,userName:P,userAvatar:I,sessionId:R,setSessionId:z,expandAll:B,setExpandAll:V,expandAllDefaultRef:H,remoteAuthEnabled:U,claudeConnected:G,pinInputRef:q,setPinFormRef:J,handleSetPin:Z,handleLogin:Q,handleDisconnect:ee,handleLogout:$}}var h=r();function g({inputRef:e,value:t,onChange:n,onComplete:r,showPin:i,autoFocus:a}){let o=(0,p.useRef)([]);function s(e,r){r.key===`Backspace`?(r.preventDefault(),t[e]?n(t.slice(0,e)+t.slice(e+1)):e>0&&(n(t.slice(0,e-1)+t.slice(e)),o.current[e-1]?.focus())):r.key===`ArrowLeft`&&e>0?o.current[e-1]?.focus():r.key===`ArrowRight`&&e<5?o.current[e+1]?.focus():r.key===`Enter`&&(r.preventDefault(),r.currentTarget.form?.requestSubmit())}function c(e,i){let a=i.nativeEvent.data;if(!a||!/^\d$/.test(a))return;let s=t.split(``);for(s[e]=a;s.length<e;)s.push(``);let c=s.join(``).replace(/\D/g,``).slice(0,6);n(c),c.length===6?r?.(c):e<5&&o.current[e+1]?.focus()}function l(e){e.preventDefault();let t=e.clipboardData.getData(`text`).replace(/\D/g,``).slice(0,6);t&&(n(t),t.length===6?r?.(t):o.current[t.length]?.focus())}return(0,h.jsx)(`div`,{className:`pin-field`,children:Array.from({length:6}).map((n,r)=>(0,h.jsx)(`input`,{ref:t=>{o.current[r]=t,r===0&&e&&(e.current=t)},type:`text`,inputMode:`numeric`,className:`pin-box${t[r]?` pin-box-filled`:``}`,value:t[r]?i?t[r]:`•`:``,onKeyDown:e=>s(r,e),onInput:e=>c(r,e),onPaste:l,onFocus:e=>e.target.select(),autoFocus:a&&r===0,autoComplete:`off`,maxLength:1,"aria-label":`PIN digit ${r+1}`},r))})}function _(e){let{pin:r,setPin:i,showPin:a,setShowPin:o,pinLoading:l,pinError:u,pinInputRef:d,setPinFormRef:f,onSubmit:p,operatorName:m,setOperatorName:_}=e;return(0,h.jsx)(`div`,{className:`connect-page`,children:(0,h.jsxs)(`div`,{className:`connect-content`,children:[(0,h.jsx)(`img`,{src:t,alt:n.productName,className:`connect-logo connect-logo--maxy`}),!n.logoContainsName&&(0,h.jsxs)(`h1`,{className:`connect-title`,children:[`Welcome to `,n.productName]}),(0,h.jsxs)(`p`,{className:`connect-subtitle`,children:[`Tell `,n.productName,` who you are, then choose a PIN.`]}),(0,h.jsxs)(`form`,{ref:f,onSubmit:p,className:`connect-pin-form`,children:[(0,h.jsxs)(`div`,{className:`pin-input-row`,children:[(0,h.jsx)(`input`,{type:`text`,className:`connect-name-input`,placeholder:`Your full name`,value:m,onChange:e=>_(e.target.value),autoComplete:`name`,autoFocus:!0,required:!0,"aria-label":`Your full name`}),(0,h.jsx)(`div`,{style:{width:38,flexShrink:0},"aria-hidden":`true`})]}),(0,h.jsxs)(`div`,{className:`pin-input-row`,children:[(0,h.jsx)(g,{inputRef:d,value:r,onChange:i,onComplete:()=>{},showPin:a}),(0,h.jsx)(s,{variant:`send`,type:`submit`,disabled:!r||!m.trim(),loading:l,"aria-label":`Set PIN`,children:(0,h.jsxs)(`svg`,{viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`2`,strokeLinecap:`round`,strokeLinejoin:`round`,children:[(0,h.jsx)(`line`,{x1:`5`,y1:`12`,x2:`19`,y2:`12`}),(0,h.jsx)(`polyline`,{points:`12 5 19 12 12 19`})]})})]}),(0,h.jsx)(c,{checked:a,onChange:()=>o(e=>!e),label:`Show PIN`})]}),u&&(0,h.jsx)(`p`,{className:`admin-pin-error`,children:u})]})})}function v(e){let{pin:r,setPin:i,showPin:a,setShowPin:o,pinLoading:l,pinError:u,pinInputRef:d,onSubmit:f,remoteAuthEnabled:p,onSignOutRemote:m}=e;return(0,h.jsxs)(`div`,{className:`connect-page`,children:[p&&m&&(0,h.jsx)(`button`,{type:`button`,className:`connect-signout`,onClick:m,children:`Sign out`}),(0,h.jsxs)(`div`,{className:`connect-content`,children:[(0,h.jsx)(`img`,{src:t,alt:n.productName,className:`connect-logo connect-logo--maxy`}),!n.logoContainsName&&(0,h.jsx)(`h1`,{className:`connect-title`,children:n.productName}),(0,h.jsxs)(`form`,{onSubmit:f,className:`connect-pin-form`,children:[(0,h.jsxs)(`div`,{className:`pin-input-row`,children:[(0,h.jsx)(g,{inputRef:d,value:r,onChange:i,onComplete:()=>{},showPin:a,autoFocus:!0}),(0,h.jsx)(s,{variant:`send`,type:`submit`,disabled:!r,loading:l,children:(0,h.jsxs)(`svg`,{viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`2`,strokeLinecap:`round`,strokeLinejoin:`round`,children:[(0,h.jsx)(`line`,{x1:`5`,y1:`12`,x2:`19`,y2:`12`}),(0,h.jsx)(`polyline`,{points:`12 5 19 12 12 19`})]})})]}),(0,h.jsx)(`div`,{className:`pin-options`,children:(0,h.jsx)(c,{checked:a,onChange:()=>o(e=>!e),label:`Show PIN`})})]}),u&&(0,h.jsx)(`p`,{className:`admin-pin-error`,children:u})]})]})}function y(e){let{authPolling:r,setAuthPolling:i,authLoading:a,setAuthLoading:o,pinError:c,setPinError:l,setAppState:u}=e,[d,f]=(0,p.useState)(!1),[m,g]=(0,p.useState)(!1),[_,v]=(0,p.useState)(``),[y,b]=(0,p.useState)(``),[x,S]=(0,p.useState)(``);async function C(){S(``);try{let e=await(await fetch(`/api/onboarding/claude-auth`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify({action:`paste-code`,code:y})})).json();e.accepted?(S(`Code submitted. Finishing sign-in…`),b(``)):S(e.error||`Could not submit code.`)}catch(e){console.error(`[admin] paste-code error:`,e),S(`Could not submit code.`)}}async function w(){g(!0),l(``);try{let e=await(await fetch(`/api/onboarding/claude-auth`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify({action:`launch-browser`})})).json();e.launched?f(!0):e.error&&l(e.error)}catch(e){console.error(`[admin] browser launch error:`,e),l(`Could not launch browser.`)}g(!1)}async function T(){o(!0),l(``);try{let e=await(await fetch(`/api/onboarding/claude-auth`,{method:`POST`})).json();if(e.started){i(!0),f(!0),o(!1),v(e.transport||``);for(let e=0;e<120;e++)if(await new Promise(e=>setTimeout(e,2e3)),(await(await fetch(`/api/onboarding/claude-auth`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify({action:`wait`})})).json()).authenticated){await fetch(`/api/onboarding/claude-auth`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify({action:`stop`})}),u(`enter-pin`);return}l(`Timed out waiting for sign-in. Try again.`),i(!1)}else e.error&&l(e.error)}catch(e){console.error(`[admin] auth flow error:`,e),l(`Could not start auth flow.`)}o(!1)}async function E(){await fetch(`/api/onboarding/claude-auth`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify({action:`stop`})}),i(!1),l(``)}return r||d?(0,h.jsxs)(`div`,{style:{display:`flex`,flexDirection:`column`,height:`100dvh`,overflow:`auto`},children:[(0,h.jsxs)(`header`,{className:`chat-header`,style:{paddingBottom:`12px`,flexShrink:0,position:`relative`,maxWidth:`680px`,width:`100%`,margin:`0 auto`,padding:`24px 20px 12px`},children:[r?(0,h.jsx)(`button`,{onClick:E,style:{position:`absolute`,top:`12px`,right:`12px`,background:`none`,border:`none`,color:`#999`,fontSize:`13px`,cursor:`pointer`,padding:`4px 8px`},"aria-label":`Cancel`,children:`✕`}):(0,h.jsx)(`button`,{onClick:()=>f(!1),style:{position:`absolute`,top:`12px`,right:`12px`,background:`none`,border:`none`,color:`#999`,fontSize:`13px`,cursor:`pointer`,padding:`4px 8px`},"aria-label":`Close browser`,children:`✕`}),(0,h.jsx)(`img`,{src:`/brand/claude.png`,alt:`Claude`,className:`chat-logo`}),(0,h.jsx)(`h1`,{className:`chat-tagline`,children:`Connect Claude`}),(0,h.jsx)(`p`,{className:`chat-intro`,children:r?`Sign in and authorize in the browser below.`:`Open your email or prepare your accounts, then sign in.`}),!r&&(0,h.jsx)(`div`,{style:{marginTop:`12px`},children:(0,h.jsx)(s,{variant:`primary`,onClick:T,disabled:a,children:a?(0,h.jsxs)(h.Fragment,{children:[(0,h.jsx)(`span`,{className:`spin`,style:{display:`inline-block`},children:`✱`}),` Connecting…`]}):`Sign in to Claude`})}),r&&_===`native`&&(0,h.jsxs)(`div`,{style:{marginTop:`14px`,maxWidth:`420px`,margin:`14px auto 0`,display:`flex`,flexDirection:`column`,gap:`8px`},children:[(0,h.jsx)(`label`,{style:{fontSize:`12px`,color:`#999`,lineHeight:1.4},children:`If the browser didn't finish sign-in, paste the code or full redirect URL from Claude's page:`}),(0,h.jsxs)(`div`,{style:{display:`flex`,gap:`8px`},children:[(0,h.jsx)(`input`,{type:`text`,value:y,onChange:e=>b(e.target.value),placeholder:`Paste code or redirect URL`,style:{flex:1,padding:`8px 10px`,fontSize:`13px`,border:`1px solid #ccc`,borderRadius:`6px`}}),(0,h.jsx)(s,{variant:`primary`,onClick:C,disabled:!y.trim(),children:`Submit`})]}),x&&(0,h.jsx)(`p`,{style:{fontSize:`12px`,color:`#999`,margin:0},children:x})]})]}),(0,h.jsx)(`div`,{style:{flex:1,display:`flex`,flexDirection:`column`,minHeight:0,gap:`10px`,padding:`0 0 16px`},children:(0,h.jsx)(`iframe`,{src:`/vnc-viewer.html`,style:{flex:1,width:`100%`,minHeight:0,border:`none`,background:`#111`,display:`block`},title:`Claude Sign-in`})}),c&&(0,h.jsx)(`p`,{className:`admin-pin-error`,style:{textAlign:`center`,padding:`0 20px 16px`},children:c})]}):(0,h.jsx)(`div`,{className:`connect-page`,children:(0,h.jsxs)(`div`,{className:`connect-content`,children:[(0,h.jsxs)(`div`,{className:`connect-logos`,children:[(0,h.jsx)(`div`,{className:`connect-logo-wrap`,children:(0,h.jsx)(`img`,{src:`/brand/claude.png`,alt:`Claude`,className:`connect-logo`})}),(0,h.jsx)(`svg`,{className:`connect-arrow`,viewBox:`0 0 48 24`,fill:`none`,xmlns:`http://www.w3.org/2000/svg`,children:(0,h.jsx)(`path`,{d:`M0 12h44m0 0l-8-8m8 8l-8 8`,stroke:`currentColor`,strokeWidth:`2`,strokeLinecap:`round`,strokeLinejoin:`round`})}),(0,h.jsxs)(`div`,{className:`connect-logo-wrap`,children:[(0,h.jsx)(`img`,{src:t,alt:n.productName,className:`connect-logo connect-logo--maxy`}),!n.logoContainsName&&(0,h.jsx)(`span`,{className:`connect-logo-label`,children:n.productName})]})]}),(0,h.jsxs)(`h1`,{className:`connect-title`,children:[`Connect Claude to power `,n.productName]}),(0,h.jsx)(`p`,{className:`connect-subtitle`,children:`Sign in with your Anthropic account to get started.`}),(0,h.jsx)(s,{variant:`primary`,onClick:T,disabled:a,children:a?(0,h.jsxs)(h.Fragment,{children:[(0,h.jsx)(`span`,{className:`spin`,style:{display:`inline-block`},children:`✱`}),` Connecting…`]}):`Sign in to Claude`}),(0,h.jsx)(`p`,{style:{marginTop:`6px`,fontSize:`11px`,color:`#999`,maxWidth:`300px`,textAlign:`center`,lineHeight:`1.4`},children:`First time? You may need to sign into your email and Anthropic account in the browser before connecting.`}),(0,h.jsx)(`button`,{onClick:w,disabled:m,style:{marginTop:`12px`,background:`none`,border:`none`,color:`var(--color-primary, #666)`,fontSize:`13px`,cursor:`pointer`,textDecoration:`underline`,textUnderlineOffset:`3px`},children:m?`Launching…`:`Open browser first`}),c&&(0,h.jsx)(`p`,{className:`admin-pin-error`,children:c})]})})}function b({auth:e}){return e.appState===`loading`?(0,h.jsx)(`div`,{className:`connect-page`}):e.appState===`set-pin`?(0,h.jsx)(_,{pin:e.pin,setPin:e.setPin,showPin:e.showPin,setShowPin:e.setShowPin,pinLoading:e.pinLoading,pinError:e.pinError,pinInputRef:e.pinInputRef,setPinFormRef:e.setPinFormRef,onSubmit:e.handleSetPin,operatorName:e.operatorName,setOperatorName:e.setOperatorName}):e.appState===`connect-claude`?(0,h.jsx)(y,{authPolling:e.authPolling,setAuthPolling:e.setAuthPolling,authLoading:e.authLoading,setAuthLoading:e.setAuthLoading,pinError:e.pinError,setPinError:e.setPinError,setAppState:e.setAppState}):e.appState===`enter-pin`?(0,h.jsx)(v,{pin:e.pin,setPin:e.setPin,showPin:e.showPin,setShowPin:e.setShowPin,pinLoading:e.pinLoading,pinError:e.pinError,pinInputRef:e.pinInputRef,onSubmit:e.handleLogin,remoteAuthEnabled:e.remoteAuthEnabled,onSignOutRemote:()=>{console.info(`[admin-ui] remote-auth sign-out → /__remote-auth/logout`),window.location.href=`/__remote-auth/logout`}}):null}export{m as n,b as t};
|
|
1
|
+
import{o as e}from"./chunk-TPjIAO9U.js";import{B as t,F as n,L as r,W as i,z as a}from"./useSubAccountSwitcher-DdctgpPL.js";import{D as o}from"./useVoiceRecorder-BVdKbTku.js";import{b as s,v as c,y as l}from"./AdminShell-CiTHCp5t.js";var u=`admin-landing-redirected`,d=`/graph`;function f(e){return e.variant===`operator`?!1:e.appState===`chat`&&!e.alreadyRedirected}var p=e(i(),1);function m(e=`admin`){let[n,r]=(0,p.useState)(`loading`),[i,a]=(0,p.useState)(``),[c,l]=(0,p.useState)(``),[m,h]=(0,p.useState)(``),[g,_]=(0,p.useState)(!1),[v,y]=(0,p.useState)(!1),[b,x]=(0,p.useState)(!1),[S,C]=(0,p.useState)(!1),[w,T]=(0,p.useState)(!1),[E,D]=(0,p.useState)(null),[O,k]=(0,p.useState)(null),[A,j]=(0,p.useState)(void 0),[M,N]=(0,p.useState)(null),[P,F]=(0,p.useState)(void 0),[I,L]=(0,p.useState)(null),[R,z]=(0,p.useState)(null),[B,V]=(0,p.useState)(void 0),H=(0,p.useRef)(void 0),[U,W]=(0,p.useState)(!1),[G,K]=(0,p.useState)(!0);(0,p.useEffect)(()=>{typeof window>`u`||fetch(`/api/remote-auth/status`).then(e=>e.ok?e.json():null).then(e=>{e?.configured&&W(!0)}).catch(()=>{})},[]);let q=(0,p.useRef)(null),J=(0,p.useRef)(null);(0,p.useEffect)(()=>{async function e(){let e=null;try{e=sessionStorage.getItem(`maxy-admin-session-key`)}catch{}if(!e)return!1;try{let t=await fetch(`/api/admin/session?session_key=${encodeURIComponent(e)}`);if(t.status===401){try{sessionStorage.removeItem(`maxy-admin-session-key`)}catch{}return!1}if(!t.ok)return!1;let n=await t.json();D(n.session_key),z(n.sessionId??null),j(n.businessName),N(n.role??null),F(n.userName===void 0?null:n.userName),L(n.avatar??null);let i=o(n.thinkingView);return H.current=i,V(i),r(`chat`),!0}catch(e){return console.error(`[admin] session restore failed:`,e),!1}}async function t(n=2){try{let i=await fetch(`/api/health`);if(!i.ok){if(n>0)return await new Promise(e=>setTimeout(e,1500)),t(n-1);console.error(`[admin] health check returned ${i.status} after retries`),r(`set-pin`);return}let a=await i.json();if(!a.pin_configured){r(`set-pin`);return}K(!!a.claude_authenticated);let o=!1;try{o=new URLSearchParams(window.location.search).get(`connect`)===`claude`}catch{}if(o){try{let e=new URL(window.location.href);e.searchParams.delete(`connect`),window.history.replaceState(null,``,e.pathname+e.search+e.hash)}catch{}if(!a.claude_authenticated){r(`connect-claude`);return}}if(await e())return;r(`enter-pin`)}catch(e){if(n>0)return await new Promise(e=>setTimeout(e,1500)),t(n-1);console.error(`[admin] health check failed:`,e),r(`set-pin`)}}t()},[]),(0,p.useEffect)(()=>{n===`chat`&&fetch(`/api/admin/claude-info`).then(e=>{if(e.ok)return e.json()}).then(e=>{e&&k(e)}).catch(()=>{})},[n]),(0,p.useEffect)(()=>{if(typeof window>`u`)return;let t=!1;try{t=sessionStorage.getItem(u)===`1`}catch{}if(f({appState:n,alreadyRedirected:t,variant:e})){try{sessionStorage.setItem(u,`1`)}catch{}console.info(`[admin-ui] landing-redirect target=${d}`),window.location.replace(d)}},[n,e]);let Y=(0,p.useRef)(null);(0,p.useEffect)(()=>{if(n!==`chat`)return;let e=setInterval(async()=>{try{let e=await fetch(`/api/health`);if(e.ok){let t=await e.json();K(t.auth_status!==`dead`&&t.auth_status!==`missing`)}}catch{}if(E)try{let e=await fetch(`/api/admin/session?session_key=${encodeURIComponent(E)}`);if(e.status!==401)return;let n=(await e.clone().json().catch(()=>null))?.code??`unknown-401`;if(n===`remote-auth-required`){t(`heartbeat`,`/api/admin/session`);return}console.warn(`[admin-auth] outcome=heartbeat-detected-expiry code=${n}`),Y.current?.()}catch{}},300*1e3);return()=>clearInterval(e)},[n,E]),(0,p.useEffect)(()=>{n===`connect-claude`&&fetch(`/api/health`).then(e=>e.ok?e.json():null).then(e=>{e?.claude_authenticated&&(K(!0),r(`enter-pin`))}).catch(()=>{})},[n]);async function X(e,n){y(!0);try{let i=await fetch(`/api/admin/session`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify({pin:e,...n?{accountId:n}:{}})});if(!i.ok){let e=await i.json().catch(()=>({}));if(i.status===401&&e?.code===`remote-auth-required`){t(`enter-pin`,`/api/admin/session`);return}h(e.error||`Invalid PIN`);return}let s=await i.json();D(s.session_key),z(s.sessionId??null),j(s.businessName),N(s.role??null),F(s.userName===void 0?null:s.userName),L(s.avatar??null);let c=o(s.thinkingView);H.current=c,V(c);try{sessionStorage.setItem(`maxy-admin-session-key`,s.session_key)}catch{}a(``),r(`chat`)}catch(e){console.error(`[admin] connection error:`,e),h(`Could not connect.`)}finally{y(!1)}}let Z=(0,p.useCallback)(async e=>{if(e.preventDefault(),v)return;h(``);let n=c.trim();if(!n){h(`Please enter your name.`);return}if(i.length<4){h(`PIN must be at least 4 characters.`);return}let o=i;y(!0);try{let e=await fetch(`/api/onboarding/set-pin`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify({pin:o,name:n})});if(!e.ok){let n=await e.json().catch(()=>({}));if(e.status===401&&n?.code===`remote-auth-required`){t(`set-pin`,`/api/onboarding/set-pin`);return}if(e.status===409){console.log(`[admin] PIN already configured — re-checking health`);try{let e=await fetch(`/api/health`);if(e.ok){let t=await e.json();t.pin_configured&&t.claude_authenticated?r(`enter-pin`):t.pin_configured?r(`connect-claude`):h(n.error||`Failed to set PIN.`)}else r(`enter-pin`)}catch{r(`enter-pin`)}return}h(n.error||`Failed to set PIN.`);return}let i=await fetch(`/api/health`);if((i.ok?await i.json():null)?.claude_authenticated){await X(o);return}a(``),r(`connect-claude`)}catch(e){console.error(`[admin] connection error:`,e),h(`Could not connect.`)}finally{y(!1)}},[i,v,c]),Q=(0,p.useCallback)(async e=>{e.preventDefault(),h(``),await X(i)},[i]),ee=(0,p.useCallback)(async()=>{T(!0);try{if(!await s())return console.warn(`[admin-ui] claude-disconnect not verified — credentials may persist; staying put`),!1;K(!1),D(null),N(null),F(void 0),L(null);try{sessionStorage.removeItem(`maxy-admin-session-key`),sessionStorage.removeItem(u)}catch{}return r(`connect-claude`),!0}finally{T(!1)}},[]),$=(0,p.useCallback)(()=>{D(null),N(null),F(void 0),L(null);try{sessionStorage.removeItem(`maxy-admin-session-key`),sessionStorage.removeItem(u)}catch{}a(``),h(``),r(`enter-pin`)},[]);return(0,p.useEffect)(()=>{Y.current=$},[$]),{appState:n,setAppState:r,pin:i,setPin:a,operatorName:c,setOperatorName:l,pinError:m,setPinError:h,showPin:g,setShowPin:_,pinLoading:v,authPolling:b,setAuthPolling:x,authLoading:S,setAuthLoading:C,disconnecting:w,cacheKey:E,setCacheKey:D,claudeInfo:O,setClaudeInfo:k,businessName:A,role:M,userName:P,userAvatar:I,sessionId:R,setSessionId:z,expandAll:B,setExpandAll:V,expandAllDefaultRef:H,remoteAuthEnabled:U,claudeConnected:G,pinInputRef:q,setPinFormRef:J,handleSetPin:Z,handleLogin:Q,handleDisconnect:ee,handleLogout:$}}var h=a();function g({inputRef:e,value:t,onChange:n,onComplete:r,showPin:i,autoFocus:a}){let o=(0,p.useRef)([]);function s(e,r){r.key===`Backspace`?(r.preventDefault(),t[e]?n(t.slice(0,e)+t.slice(e+1)):e>0&&(n(t.slice(0,e-1)+t.slice(e)),o.current[e-1]?.focus())):r.key===`ArrowLeft`&&e>0?o.current[e-1]?.focus():r.key===`ArrowRight`&&e<5?o.current[e+1]?.focus():r.key===`Enter`&&(r.preventDefault(),r.currentTarget.form?.requestSubmit())}function c(e,i){let a=i.nativeEvent.data;if(!a||!/^\d$/.test(a))return;let s=t.split(``);for(s[e]=a;s.length<e;)s.push(``);let c=s.join(``).replace(/\D/g,``).slice(0,6);n(c),c.length===6?r?.(c):e<5&&o.current[e+1]?.focus()}function l(e){e.preventDefault();let t=e.clipboardData.getData(`text`).replace(/\D/g,``).slice(0,6);t&&(n(t),t.length===6?r?.(t):o.current[t.length]?.focus())}return(0,h.jsx)(`div`,{className:`pin-field`,children:Array.from({length:6}).map((n,r)=>(0,h.jsx)(`input`,{ref:t=>{o.current[r]=t,r===0&&e&&(e.current=t)},type:`text`,inputMode:`numeric`,className:`pin-box${t[r]?` pin-box-filled`:``}`,value:t[r]?i?t[r]:`•`:``,onKeyDown:e=>s(r,e),onInput:e=>c(r,e),onPaste:l,onFocus:e=>e.target.select(),autoFocus:a&&r===0,autoComplete:`off`,maxLength:1,"aria-label":`PIN digit ${r+1}`},r))})}function _(e){let{pin:t,setPin:i,showPin:a,setShowPin:o,pinLoading:s,pinError:u,pinInputRef:d,setPinFormRef:f,onSubmit:p,operatorName:m,setOperatorName:_}=e;return(0,h.jsx)(`div`,{className:`connect-page`,children:(0,h.jsxs)(`div`,{className:`connect-content`,children:[(0,h.jsx)(`img`,{src:r,alt:n.productName,className:`connect-logo connect-logo--maxy`}),!n.logoContainsName&&(0,h.jsxs)(`h1`,{className:`connect-title`,children:[`Welcome to `,n.productName]}),(0,h.jsxs)(`p`,{className:`connect-subtitle`,children:[`Tell `,n.productName,` who you are, then choose a PIN.`]}),(0,h.jsxs)(`form`,{ref:f,onSubmit:p,className:`connect-pin-form`,children:[(0,h.jsxs)(`div`,{className:`pin-input-row`,children:[(0,h.jsx)(`input`,{type:`text`,className:`connect-name-input`,placeholder:`Your full name`,value:m,onChange:e=>_(e.target.value),autoComplete:`name`,autoFocus:!0,required:!0,"aria-label":`Your full name`}),(0,h.jsx)(`div`,{style:{width:38,flexShrink:0},"aria-hidden":`true`})]}),(0,h.jsxs)(`div`,{className:`pin-input-row`,children:[(0,h.jsx)(g,{inputRef:d,value:t,onChange:i,onComplete:()=>{},showPin:a}),(0,h.jsx)(c,{variant:`send`,type:`submit`,disabled:!t||!m.trim(),loading:s,"aria-label":`Set PIN`,children:(0,h.jsxs)(`svg`,{viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`2`,strokeLinecap:`round`,strokeLinejoin:`round`,children:[(0,h.jsx)(`line`,{x1:`5`,y1:`12`,x2:`19`,y2:`12`}),(0,h.jsx)(`polyline`,{points:`12 5 19 12 12 19`})]})})]}),(0,h.jsx)(l,{checked:a,onChange:()=>o(e=>!e),label:`Show PIN`})]}),u&&(0,h.jsx)(`p`,{className:`admin-pin-error`,children:u})]})})}function v(e){let{pin:t,setPin:i,showPin:a,setShowPin:o,pinLoading:s,pinError:u,pinInputRef:d,onSubmit:f,remoteAuthEnabled:p,onSignOutRemote:m}=e;return(0,h.jsxs)(`div`,{className:`connect-page`,children:[p&&m&&(0,h.jsx)(`button`,{type:`button`,className:`connect-signout`,onClick:m,children:`Sign out`}),(0,h.jsxs)(`div`,{className:`connect-content`,children:[(0,h.jsx)(`img`,{src:r,alt:n.productName,className:`connect-logo connect-logo--maxy`}),!n.logoContainsName&&(0,h.jsx)(`h1`,{className:`connect-title`,children:n.productName}),(0,h.jsxs)(`form`,{onSubmit:f,className:`connect-pin-form`,children:[(0,h.jsxs)(`div`,{className:`pin-input-row`,children:[(0,h.jsx)(g,{inputRef:d,value:t,onChange:i,onComplete:()=>{},showPin:a,autoFocus:!0}),(0,h.jsx)(c,{variant:`send`,type:`submit`,disabled:!t,loading:s,children:(0,h.jsxs)(`svg`,{viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`2`,strokeLinecap:`round`,strokeLinejoin:`round`,children:[(0,h.jsx)(`line`,{x1:`5`,y1:`12`,x2:`19`,y2:`12`}),(0,h.jsx)(`polyline`,{points:`12 5 19 12 12 19`})]})})]}),(0,h.jsx)(`div`,{className:`pin-options`,children:(0,h.jsx)(l,{checked:a,onChange:()=>o(e=>!e),label:`Show PIN`})})]}),u&&(0,h.jsx)(`p`,{className:`admin-pin-error`,children:u})]})]})}function y(e){let{authPolling:t,setAuthPolling:i,authLoading:a,setAuthLoading:o,pinError:s,setPinError:l,setAppState:u}=e,[d,f]=(0,p.useState)(!1),[m,g]=(0,p.useState)(!1),[_,v]=(0,p.useState)(``),[y,b]=(0,p.useState)(``),[x,S]=(0,p.useState)(``);async function C(){S(``);try{let e=await(await fetch(`/api/onboarding/claude-auth`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify({action:`paste-code`,code:y})})).json();e.accepted?(S(`Code submitted. Finishing sign-in…`),b(``)):S(e.error||`Could not submit code.`)}catch(e){console.error(`[admin] paste-code error:`,e),S(`Could not submit code.`)}}async function w(){g(!0),l(``);try{let e=await(await fetch(`/api/onboarding/claude-auth`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify({action:`launch-browser`})})).json();e.launched?f(!0):e.error&&l(e.error)}catch(e){console.error(`[admin] browser launch error:`,e),l(`Could not launch browser.`)}g(!1)}async function T(){o(!0),l(``);try{let e=await(await fetch(`/api/onboarding/claude-auth`,{method:`POST`})).json();if(e.started){i(!0),f(!0),o(!1),v(e.transport||``);for(let e=0;e<120;e++)if(await new Promise(e=>setTimeout(e,2e3)),(await(await fetch(`/api/onboarding/claude-auth`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify({action:`wait`})})).json()).authenticated){await fetch(`/api/onboarding/claude-auth`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify({action:`stop`})}),u(`enter-pin`);return}l(`Timed out waiting for sign-in. Try again.`),i(!1)}else e.error&&l(e.error)}catch(e){console.error(`[admin] auth flow error:`,e),l(`Could not start auth flow.`)}o(!1)}async function E(){await fetch(`/api/onboarding/claude-auth`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify({action:`stop`})}),i(!1),l(``)}return t||d?(0,h.jsxs)(`div`,{style:{display:`flex`,flexDirection:`column`,height:`100dvh`,overflow:`auto`},children:[(0,h.jsxs)(`header`,{className:`chat-header`,style:{paddingBottom:`12px`,flexShrink:0,position:`relative`,maxWidth:`680px`,width:`100%`,margin:`0 auto`,padding:`24px 20px 12px`},children:[t?(0,h.jsx)(`button`,{onClick:E,style:{position:`absolute`,top:`12px`,right:`12px`,background:`none`,border:`none`,color:`#999`,fontSize:`13px`,cursor:`pointer`,padding:`4px 8px`},"aria-label":`Cancel`,children:`✕`}):(0,h.jsx)(`button`,{onClick:()=>f(!1),style:{position:`absolute`,top:`12px`,right:`12px`,background:`none`,border:`none`,color:`#999`,fontSize:`13px`,cursor:`pointer`,padding:`4px 8px`},"aria-label":`Close browser`,children:`✕`}),(0,h.jsx)(`img`,{src:`/brand/claude.png`,alt:`Claude`,className:`chat-logo`}),(0,h.jsx)(`h1`,{className:`chat-tagline`,children:`Connect Claude`}),(0,h.jsx)(`p`,{className:`chat-intro`,children:t?`Sign in and authorize in the browser below.`:`Open your email or prepare your accounts, then sign in.`}),!t&&(0,h.jsx)(`div`,{style:{marginTop:`12px`},children:(0,h.jsx)(c,{variant:`primary`,onClick:T,disabled:a,children:a?(0,h.jsxs)(h.Fragment,{children:[(0,h.jsx)(`span`,{className:`spin`,style:{display:`inline-block`},children:`✱`}),` Connecting…`]}):`Sign in to Claude`})}),t&&_===`native`&&(0,h.jsxs)(`div`,{style:{marginTop:`14px`,maxWidth:`420px`,margin:`14px auto 0`,display:`flex`,flexDirection:`column`,gap:`8px`},children:[(0,h.jsx)(`label`,{style:{fontSize:`12px`,color:`#999`,lineHeight:1.4},children:`If the browser didn't finish sign-in, paste the code or full redirect URL from Claude's page:`}),(0,h.jsxs)(`div`,{style:{display:`flex`,gap:`8px`},children:[(0,h.jsx)(`input`,{type:`text`,value:y,onChange:e=>b(e.target.value),placeholder:`Paste code or redirect URL`,style:{flex:1,padding:`8px 10px`,fontSize:`13px`,border:`1px solid #ccc`,borderRadius:`6px`}}),(0,h.jsx)(c,{variant:`primary`,onClick:C,disabled:!y.trim(),children:`Submit`})]}),x&&(0,h.jsx)(`p`,{style:{fontSize:`12px`,color:`#999`,margin:0},children:x})]})]}),(0,h.jsx)(`div`,{style:{flex:1,display:`flex`,flexDirection:`column`,minHeight:0,gap:`10px`,padding:`0 0 16px`},children:(0,h.jsx)(`iframe`,{src:`/vnc-viewer.html`,style:{flex:1,width:`100%`,minHeight:0,border:`none`,background:`#111`,display:`block`},title:`Claude Sign-in`})}),s&&(0,h.jsx)(`p`,{className:`admin-pin-error`,style:{textAlign:`center`,padding:`0 20px 16px`},children:s})]}):(0,h.jsx)(`div`,{className:`connect-page`,children:(0,h.jsxs)(`div`,{className:`connect-content`,children:[(0,h.jsxs)(`div`,{className:`connect-logos`,children:[(0,h.jsx)(`div`,{className:`connect-logo-wrap`,children:(0,h.jsx)(`img`,{src:`/brand/claude.png`,alt:`Claude`,className:`connect-logo`})}),(0,h.jsx)(`svg`,{className:`connect-arrow`,viewBox:`0 0 48 24`,fill:`none`,xmlns:`http://www.w3.org/2000/svg`,children:(0,h.jsx)(`path`,{d:`M0 12h44m0 0l-8-8m8 8l-8 8`,stroke:`currentColor`,strokeWidth:`2`,strokeLinecap:`round`,strokeLinejoin:`round`})}),(0,h.jsxs)(`div`,{className:`connect-logo-wrap`,children:[(0,h.jsx)(`img`,{src:r,alt:n.productName,className:`connect-logo connect-logo--maxy`}),!n.logoContainsName&&(0,h.jsx)(`span`,{className:`connect-logo-label`,children:n.productName})]})]}),(0,h.jsxs)(`h1`,{className:`connect-title`,children:[`Connect Claude to power `,n.productName]}),(0,h.jsx)(`p`,{className:`connect-subtitle`,children:`Sign in with your Anthropic account to get started.`}),(0,h.jsx)(c,{variant:`primary`,onClick:T,disabled:a,children:a?(0,h.jsxs)(h.Fragment,{children:[(0,h.jsx)(`span`,{className:`spin`,style:{display:`inline-block`},children:`✱`}),` Connecting…`]}):`Sign in to Claude`}),(0,h.jsx)(`p`,{style:{marginTop:`6px`,fontSize:`11px`,color:`#999`,maxWidth:`300px`,textAlign:`center`,lineHeight:`1.4`},children:`First time? You may need to sign into your email and Anthropic account in the browser before connecting.`}),(0,h.jsx)(`button`,{onClick:w,disabled:m,style:{marginTop:`12px`,background:`none`,border:`none`,color:`var(--color-primary, #666)`,fontSize:`13px`,cursor:`pointer`,textDecoration:`underline`,textUnderlineOffset:`3px`},children:m?`Launching…`:`Open browser first`}),s&&(0,h.jsx)(`p`,{className:`admin-pin-error`,children:s})]})})}function b({auth:e}){return e.appState===`loading`?(0,h.jsx)(`div`,{className:`connect-page`}):e.appState===`set-pin`?(0,h.jsx)(_,{pin:e.pin,setPin:e.setPin,showPin:e.showPin,setShowPin:e.setShowPin,pinLoading:e.pinLoading,pinError:e.pinError,pinInputRef:e.pinInputRef,setPinFormRef:e.setPinFormRef,onSubmit:e.handleSetPin,operatorName:e.operatorName,setOperatorName:e.setOperatorName}):e.appState===`connect-claude`?(0,h.jsx)(y,{authPolling:e.authPolling,setAuthPolling:e.setAuthPolling,authLoading:e.authLoading,setAuthLoading:e.setAuthLoading,pinError:e.pinError,setPinError:e.setPinError,setAppState:e.setAppState}):e.appState===`enter-pin`?(0,h.jsx)(v,{pin:e.pin,setPin:e.setPin,showPin:e.showPin,setShowPin:e.setShowPin,pinLoading:e.pinLoading,pinError:e.pinError,pinInputRef:e.pinInputRef,onSubmit:e.handleLogin,remoteAuthEnabled:e.remoteAuthEnabled,onSignOutRemote:()=>{console.info(`[admin-ui] remote-auth sign-out → /__remote-auth/logout`),window.location.href=`/__remote-auth/logout`}}):null}export{m as n,b as t};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{o as e}from"./chunk-TPjIAO9U.js";import{A as t,C as n,D as r,E as i,F as a,I as o,M as s,N as c,O as l,P as u,R as d,S as f,T as p,U as m,W as h,_ as g,a as _,b as ee,d as te,f as v,g as y,h as ne,k as b,m as x,o as re,r as S,t as ie,u as ae,v as oe,w as C,x as se,y as w,z as ce}from"./useSubAccountSwitcher-DdctgpPL.js";async function le(){try{let e=await fetch(`/api/onboarding/claude-auth`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify({action:`logout`})});return e.ok?(await e.json().catch(()=>({})))?.logged_out===!0:(console.error(`[admin-ui] claude-logout http-status=${e.status}`),!1)}catch(e){return console.error(`[admin-ui] claude-logout fetch failed: ${e instanceof Error?e.message:String(e)}`),!1}}var T=ce();function ue({checked:e,onChange:t,label:n,disabled:r,ariaLabel:i=n}){return(0,T.jsxs)(`label`,{className:`maxy-checkbox${r?` maxy-checkbox--disabled`:``}`,children:[(0,T.jsx)(`input`,{type:`checkbox`,"aria-label":i,checked:e,onChange:e=>t(e.target.checked),disabled:r}),(0,T.jsx)(`span`,{className:`maxy-checkbox__box`,children:`✱`}),n&&(0,T.jsx)(`span`,{className:`maxy-checkbox__label`,children:n})]})}var E=e(h(),1),D={sm:14,md:16,lg:18},O={sm:30,md:38,lg:46};function k({variant:e=`primary`,size:t=`md`,icon:n,iconPosition:r=`leading`,loading:i=!1,fullWidth:a=!1,disabled:o=!1,type:s=`button`,onClick:c,"aria-label":l,"aria-pressed":u,style:d,className:f,children:p}){let m=[`btn`,`btn--${e}`,t===`md`?``:`btn--${t}`,a?`btn--full`:``,f].filter(Boolean).join(` `),h=D[t],g={...e===`send`?{width:O[t],height:O[t]}:{},...d},_=Object.keys(g).length>0;return(0,T.jsxs)(`button`,{type:s,className:m,disabled:i||o,onClick:c,"aria-label":l,"aria-pressed":u,style:_?g:void 0,children:[(0,T.jsxs)(`span`,{className:`btn__content`,style:{visibility:i?`hidden`:`visible`},children:[n&&r===`leading`&&(0,T.jsx)(n,{size:h}),p,n&&r===`trailing`&&(0,T.jsx)(n,{size:h})]}),i&&(0,T.jsx)(`span`,{className:`btn__spinner`,children:`✱`})]})}var de=u(`archive-restore`,[[`rect`,{width:`20`,height:`5`,x:`2`,y:`3`,rx:`1`,key:`1wp1u1`}],[`path`,{d:`M4 8v11a2 2 0 0 0 2 2h2`,key:`tvwodi`}],[`path`,{d:`M20 8v11a2 2 0 0 1-2 2h-2`,key:`1gkqxj`}],[`path`,{d:`m9 15 3-3 3 3`,key:`1pd0qc`}],[`path`,{d:`M12 12v9`,key:`192myk`}]]),fe=u(`archive`,[[`rect`,{width:`20`,height:`5`,x:`2`,y:`3`,rx:`1`,key:`1wp1u1`}],[`path`,{d:`M4 8v11a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8`,key:`1s80jp`}],[`path`,{d:`M10 12h4`,key:`a56b0p`}]]),A=u(`chevron-down`,[[`path`,{d:`m6 9 6 6 6-6`,key:`qrunsl`}]]),pe=u(`ellipsis-vertical`,[[`circle`,{cx:`12`,cy:`12`,r:`1`,key:`41hilf`}],[`circle`,{cx:`12`,cy:`5`,r:`1`,key:`gxeob9`}],[`circle`,{cx:`12`,cy:`19`,r:`1`,key:`lyex9k`}]]),me=u(`gauge`,[[`path`,{d:`m12 14 4-4`,key:`9kzdfg`}],[`path`,{d:`M3.34 19a10 10 0 1 1 17.32 0`,key:`19p75a`}]]),j=u(`list-todo`,[[`path`,{d:`M13 5h8`,key:`a7qcls`}],[`path`,{d:`M13 12h8`,key:`h98zly`}],[`path`,{d:`M13 19h8`,key:`c3s6r1`}],[`path`,{d:`m3 17 2 2 4-4`,key:`1jhpwq`}],[`rect`,{x:`3`,y:`4`,width:`6`,height:`6`,rx:`1`,key:`cif1o7`}]]),he=u(`message-square`,[[`path`,{d:`M22 17a2 2 0 0 1-2 2H6.828a2 2 0 0 0-1.414.586l-2.202 2.202A.71.71 0 0 1 2 21.286V5a2 2 0 0 1 2-2h16a2 2 0 0 1 2 2z`,key:`18887p`}]]),ge=u(`panel-left`,[[`rect`,{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`,key:`afitv7`}],[`path`,{d:`M9 3v18`,key:`fh3hqa`}]]),_e=u(`sliders-horizontal`,[[`path`,{d:`M10 5H3`,key:`1qgfaw`}],[`path`,{d:`M12 19H3`,key:`yhmn1j`}],[`path`,{d:`M14 3v4`,key:`1sua03`}],[`path`,{d:`M16 17v4`,key:`1q0r14`}],[`path`,{d:`M21 12h-9`,key:`1o4lsq`}],[`path`,{d:`M21 19h-5`,key:`1rlt1p`}],[`path`,{d:`M21 5h-7`,key:`1oszz2`}],[`path`,{d:`M8 10v4`,key:`tgpxqk`}],[`path`,{d:`M8 12H3`,key:`a7s4jb`}]]),ve=u(`waypoints`,[[`path`,{d:`m10.586 5.414-5.172 5.172`,key:`4mc350`}],[`path`,{d:`m18.586 13.414-5.172 5.172`,key:`8c96vv`}],[`path`,{d:`M6 12h12`,key:`8npq4p`}],[`circle`,{cx:`12`,cy:`20`,r:`2`,key:`144qzu`}],[`circle`,{cx:`12`,cy:`4`,r:`2`,key:`muu5ef`}],[`circle`,{cx:`20`,cy:`12`,r:`2`,key:`1xzzfp`}],[`circle`,{cx:`4`,cy:`12`,r:`2`,key:`1hvhnz`}]]);function ye({connected:e,onConnectClaude:t}){return e?(0,T.jsxs)(`span`,{className:`claude-status-pill`,"data-connected":`true`,title:`Claude is connected`,children:[(0,T.jsx)(`img`,{src:`/brand/claude.png`,alt:``,className:`claude-status-pill__mark`}),(0,T.jsx)(`span`,{className:`claude-status-pill__label`,children:`Connected`}),(0,T.jsx)(`span`,{className:`claude-status-pill__dot claude-status-pill__dot--live`,"aria-hidden":`true`})]}):(0,T.jsxs)(`button`,{type:`button`,className:`claude-status-pill claude-status-pill--action`,"data-connected":`false`,onClick:t,title:`Connect Claude`,children:[(0,T.jsx)(`img`,{src:`/brand/claude.png`,alt:``,className:`claude-status-pill__mark`}),(0,T.jsx)(`span`,{className:`claude-status-pill__label`,children:`Connect`}),(0,T.jsx)(`span`,{className:`claude-status-pill__dot claude-status-pill__dot--down`,"aria-hidden":`true`})]})}function be(e){return e===`/`||e===``?`Dashboard`:e.startsWith(`/chat`)?`Chat`:e.startsWith(`/tasks`)?`Tasks`:e.startsWith(`/data`)?`Data`:e.startsWith(`/calendar`)?`Calendar`:e.startsWith(`/graph`)?`Graph`:e.startsWith(`/activity`)?`Activity`:e.startsWith(`/browser`)?`Browser`:`Dashboard`}function xe({title:e,sidebarOpen:t,onToggleSidebar:n,claudeConnected:r,onConnectClaude:i}){let a=e??be(typeof window<`u`?window.location.pathname:`/`),o=r!==void 0&&i!==void 0;return(0,T.jsxs)(`header`,{className:`admin-page-header`,children:[(0,T.jsxs)(`button`,{type:`button`,className:`admin-page-header__toggle`,"aria-label":t?`Hide sidebar`:`Show sidebar`,title:t?`Hide sidebar`:`Show sidebar`,"aria-expanded":t,onClick:n,children:[(0,T.jsx)(ge,{className:`admin-page-header__toggle-desktop`,size:18,strokeWidth:1.75}),(0,T.jsx)(C,{className:`admin-page-header__toggle-mobile`,size:22,strokeWidth:1.75})]}),(0,T.jsx)(`h1`,{className:`admin-page-header__title`,children:a}),o&&(0,T.jsx)(`div`,{className:`admin-page-header__right`,children:(0,T.jsx)(ye,{connected:r,onConnectClaude:i})})]})}var Se=[{label:`Home`,href:`/`,Icon:i,match:e=>e===`/`||e===``},{label:`Chat`,href:`/chat`,Icon:n,match:e=>e.startsWith(`/chat`)},{label:`Tasks`,href:`/tasks`,Icon:j,match:e=>e.startsWith(`/tasks`)},{label:`Data`,href:`/data`,Icon:t,match:e=>e.startsWith(`/data`)},{label:`Calendar`,href:`/calendar`,Icon:s,match:e=>e.startsWith(`/calendar`)}],M=[{label:`Chat`,href:`/`,Icon:n,match:e=>e===`/`||e===``||e.startsWith(`/chat`)},{label:`Data`,href:`/data`,Icon:t,match:e=>e.startsWith(`/data`)}];function Ce(e){let t=Se.find(t=>t.match(e));return t?t.href:`/`}function we({variant:e=`admin`,onOpenConversations:t}={}){let r=typeof window<`u`?window.location.pathname:`/`,i=e===`operator`?M:Se,a=e===`operator`?M.find(e=>e.match(r))?.href??`/`:Ce(r),o=e=>{let t=e.href===a,{Icon:n}=e;return(0,T.jsxs)(`a`,{href:e.href,className:`bottom-tab${t?` is-active`:``}`,"aria-current":t?`page`:void 0,children:[(0,T.jsx)(n,{size:19,strokeWidth:1.75}),(0,T.jsx)(`span`,{className:`bottom-tab__label`,children:e.label})]},e.href)};return(0,T.jsxs)(`nav`,{className:`bottom-tab-bar`,"aria-label":`Primary`,children:[i.slice(0,1).map(o),e===`operator`&&t&&(0,T.jsxs)(`button`,{type:`button`,className:`bottom-tab`,onClick:t,children:[(0,T.jsx)(n,{size:19,strokeWidth:1.75}),(0,T.jsx)(`span`,{className:`bottom-tab__label`,children:`Conversations`})]}),i.slice(1).map(o)]})}var N=`maxy-shell-side-px`;function Te(){if(typeof window>`u`)return 0;let e=document.querySelector(`.platform > .artefact`)?.getBoundingClientRect();return e&&e.width>0?Math.round(e.width):0}function Ee(e){if(typeof window>`u`)return e;let t=window.innerWidth,n=Math.max(248,t-480-Te());return Math.min(Math.max(e,248),n)}function De(){if(typeof window>`u`)return 264;try{let e=window.localStorage.getItem(N);if(!e)return 264;let t=parseInt(e,10);if(!Number.isFinite(t))return console.warn(`[admin-ui] sidebar-width-parse-failed stored=${JSON.stringify(e)} fallback=264`),264;if(t>=248)return Ee(t)}catch{}return 264}function Oe({targetSelector:e=`.platform`}){let t=(0,E.useRef)(null),[n,r]=(0,E.useState)(()=>De()),i=(0,E.useRef)(n);(0,E.useLayoutEffect)(()=>{let t=document.querySelector(e);!t||!(t instanceof HTMLElement)||(t.style.setProperty(`--side-px`,`${n}px`),i.current=n)},[n,e]);let a=(0,E.useCallback)(()=>{r(e=>{let t=Ee(e);return t===e?e:t})},[]);(0,E.useEffect)(()=>{a(),window.addEventListener(`resize`,a);let t=document.querySelector(e),n=null;return t instanceof HTMLElement&&(n=new MutationObserver(a),n.observe(t,{attributes:!0,attributeFilter:[`data-artefact`,`class`]})),()=>{window.removeEventListener(`resize`,a),n?.disconnect()}},[a,e]);let o=e=>{e.preventDefault();let n=t.current;if(!n)return;n.setPointerCapture(e.pointerId),n.classList.add(`dragging`);let a=!1,o=e=>{a=!0,r(Ee(Math.round(e.clientX)))},s=()=>{if(n.releasePointerCapture(e.pointerId),n.classList.remove(`dragging`),window.removeEventListener(`pointermove`,o),window.removeEventListener(`pointerup`,s),!a)return;let t=i.current;try{window.localStorage.setItem(N,String(t))}catch{}console.info(`[admin-ui] sidebar-resize px=${t}`)};window.addEventListener(`pointermove`,o),window.addEventListener(`pointerup`,s)},s=()=>{let e=Ee(264);r(e);try{window.localStorage.removeItem(N)}catch{}console.info(`[admin-ui] sidebar-resize px=${e}`)};return(0,T.jsx)(`div`,{ref:t,className:`side-resize-handle`,role:`separator`,"aria-orientation":`vertical`,"aria-label":`Resize sidebar`,onPointerDown:o,onDoubleClick:s})}var ke=m();function Ae(e){return Math.max(14,e/2-386)}function je(e){return e.left===0&&e.top===0&&e.width===0&&e.height===0}var Me={position:`fixed`,visibility:`hidden`};function P({anchorRef:e,onClose:t,className:n,role:r,ariaLabel:i,anchorId:a,children:o}){let s=(0,E.useRef)(null),[c,l]=(0,E.useState)(Me),u=(0,E.useRef)(null),d=(0,E.useCallback)(()=>{let t=s.current;if(!t)return;let r=e.current,i=[n,a].filter(Boolean).join(`:`)||`unknown`,o=t.getBoundingClientRect(),c=window.innerWidth,d=window.innerHeight,f=o.width>0&&o.height>0,p=r?r.getBoundingClientRect():null,m=(e,t)=>console.error(`[anchored-popover] op=offscreen id=${i} left=${e} top=${t} w=${o.width} h=${o.height} viewport=${c},${d}`),h=e=>{e!==u.current&&(u.current=e,console.log(e))};if(h(`[anchored-popover] op=anchor id=${i} present=${!!r} rect=${p?`${p.left},${p.top},${p.width},${p.height}`:`none`}`),!p){let e=Math.max(4,c-o.width-Ae(c)),t=Math.max(4,d-o.height-14);l({position:`fixed`,left:e,top:t,visibility:`visible`}),h(`[anchored-popover] op=placed id=${i} left=${e} top=${t} w=${o.width} h=${o.height} flipped=false clampedLeft=false clampedRight=false`);return}if(f&&je(p)){l(Me),m(p.left,p.top);return}let g=p.right-o.width,_=c-o.width-4,ee=!1,te=!1;g>_&&(g=_,ee=!0),g<4&&(g=4,te=!0);let v=d-p.bottom-4,y=p.top-4,ne=o.height+8<=v?!1:o.height+8<=y?!0:y>v,b=Math.max(0,ne?y:v),x=ne?Math.max(4,p.top-Math.min(o.height,b)):p.bottom;l({position:`fixed`,left:g,top:x,maxHeight:b,visibility:`visible`}),h(`[anchored-popover] op=placed id=${i} left=${g} top=${x} w=${o.width} h=${o.height} maxH=${b} flipped=${ne} clampedLeft=${te} clampedRight=${ee}`);let re=Math.min(o.height,b);f&&(g+o.width<=0||g>=c||x+re<=0||x>=d)&&m(g,x)},[e,a,n]);return(0,E.useLayoutEffect)(()=>{if(d(),typeof ResizeObserver>`u`)return;let e=new ResizeObserver(()=>d());return s.current&&e.observe(s.current),()=>e.disconnect()},[d]),(0,E.useEffect)(()=>{let n=e=>{e.key===`Escape`&&t()},r=n=>{let r=n.target;e.current?.contains(r)||s.current?.contains(r)||t()},i=n=>{let r=e.current;r&&n.target instanceof Node&&n.target.contains(r)&&t()},a=()=>t();return document.addEventListener(`keydown`,n),document.addEventListener(`pointerdown`,r),window.addEventListener(`scroll`,i,!0),window.addEventListener(`resize`,a),()=>{document.removeEventListener(`keydown`,n),document.removeEventListener(`pointerdown`,r),window.removeEventListener(`scroll`,i,!0),window.removeEventListener(`resize`,a)}},[e,t]),(0,ke.createPortal)((0,T.jsx)(`div`,{ref:s,className:n,role:r,"aria-label":i,style:c,children:o}),document.body)}function Ne({actions:e,disabled:t}){let[n,r]=(0,E.useState)(!1),[i,a]=(0,E.useState)(null),o=(0,E.useRef)(null),s=(0,E.useCallback)(()=>{r(!1),a(null)},[]);return(0,T.jsxs)(`div`,{className:`conv-actions`,children:[(0,T.jsx)(`button`,{ref:o,type:`button`,className:`conv-action conv-actions-overflow`,onClick:()=>r(e=>!e),disabled:t,"aria-haspopup":`menu`,"aria-expanded":n,"aria-label":`Session actions`,title:`Session actions`,children:(0,T.jsx)(C,{size:12})}),n&&(0,T.jsx)(P,{anchorRef:o,onClose:s,className:`conv-actions-menu`,role:`menu`,children:e.map(e=>e.panel?(0,T.jsxs)(`div`,{className:`conv-actions-menu-disclosure`,children:[(0,T.jsxs)(`button`,{type:`button`,role:`menuitem`,"aria-haspopup":`dialog`,"aria-expanded":i===e.key,disabled:t,onClick:()=>a(t=>t===e.key?null:e.key),children:[e.icon,(0,T.jsx)(`span`,{children:e.menuLabel})]}),i===e.key&&(0,T.jsx)(`div`,{className:`conv-actions-menu-panel`,children:e.panel()})]},e.key):(0,T.jsxs)(`button`,{type:`button`,role:`menuitem`,className:e.danger?`conv-action-danger`:void 0,"aria-busy":e.busy,disabled:t,onClick:t=>{e.onClick?.(t),s()},children:[e.icon,(0,T.jsx)(`span`,{children:e.menuLabel})]},e.key))})]})}var F=`claude-opus-4-8[1m]`,I=`claude-sonnet-5`,Pe=`claude-haiku-4-5`,L={[F]:`Opus 4.8 (1M context)`,[I]:`Sonnet 5`,[Pe]:`Haiku 4.5`};function Fe(e){return L[e]??e}var R=[F,I,Pe];function z(e){return e.replace(/\[1m\]$/,``)}function Ie(e){return R.find(t=>z(t)===z(e))??e}var B=[`default`,`acceptEdits`,`plan`,`auto`,`bypassPermissions`],Le=[`low`,`medium`,`high`,`xhigh`];[...B],[...Le],[...Le];var Re=[F,I,Pe],V={default:`Ask permissions`,acceptEdits:`Accept edits`,plan:`Plan mode`,auto:`Auto mode`,bypassPermissions:`Bypass permissions`},ze=B.map(e=>({value:e,label:V[e]??e})),H={low:`Low`,medium:`Medium`,high:`High`,xhigh:`Highest`},U=Le.map(e=>({value:e,label:H[e]??e}));function Be(e){if(e){let t=Re.find(t=>z(t)===z(e));if(t)return t}return F}function Ve({row:e,adminFetch:t,onError:n}){let[r,i]=(0,E.useState)(()=>Be(e.model)),[a,o]=(0,E.useState)(``),[s,c]=(0,E.useState)(``),[l,u]=(0,E.useState)(!1),d=(0,E.useRef)(!1);(0,E.useEffect)(()=>{i(Be(e.model))},[e.model]);let f=async()=>{if(!d.current){d.current=!0,u(!0);try{let i=await t(`/api/admin/session-reseat`,{method:`POST`,headers:{"content-type":`application/json`},body:JSON.stringify({fromSessionId:e.sessionId,model:r,...a?{permissionMode:a}:{},...s?{effort:s}:{}})});if(!i.ok){n(`Could not reset ${e.title} (status ${i.status})`),console.error(`[admin-ui] dashboard-reseat-failed sessionId=${e.sessionId} status=${i.status}`),d.current=!1,u(!1);return}let o=await i.json().catch(()=>({}));o.target?window.location.assign(o.target):(n(`Reset of ${e.title} returned no target`),d.current=!1,u(!1))}catch(t){n(`Could not reset ${e.title} (network error)`),console.error(`[admin-ui] dashboard-reseat-failed sessionId=${e.sessionId} error=${t instanceof Error?t.message:String(t)}`),d.current=!1,u(!1)}}};return(0,T.jsxs)(T.Fragment,{children:[(0,T.jsxs)(`label`,{className:`reseat-field`,children:[(0,T.jsx)(`span`,{children:`Model`}),(0,T.jsx)(`select`,{"data-kind":`model`,value:r,disabled:l,onChange:e=>i(e.target.value),children:Re.map(e=>(0,T.jsx)(`option`,{value:e,children:Fe(e)},e))})]}),(0,T.jsxs)(`label`,{className:`reseat-field`,children:[(0,T.jsx)(`span`,{children:`Mode`}),(0,T.jsxs)(`select`,{"data-kind":`mode`,value:a,disabled:l,onChange:e=>o(e.target.value),children:[(0,T.jsx)(`option`,{value:``,children:`Keep current`}),ze.map(e=>(0,T.jsx)(`option`,{value:e.value,children:e.label},e.value))]})]}),(0,T.jsxs)(`label`,{className:`reseat-field`,children:[(0,T.jsx)(`span`,{children:`Effort`}),(0,T.jsxs)(`select`,{"data-kind":`effort`,value:s,disabled:l,onChange:e=>c(e.target.value),children:[(0,T.jsx)(`option`,{value:``,children:`Keep current`}),U.map(e=>(0,T.jsx)(`option`,{value:e.value,children:e.label},e.value))]})]}),(0,T.jsx)(`button`,{type:`button`,className:`reseat-apply`,disabled:l,"aria-busy":l,onClick:()=>void f(),children:l?(0,T.jsxs)(T.Fragment,{children:[(0,T.jsx)(p,{size:12,className:`spin`,"aria-hidden":`true`}),`Resetting…`]}):`Reset`})]})}function He(e){if(e<60)return`${e}s`;let t=Math.floor(e/60),n=e%60;return n>0?`${t}m ${n}s`:`${t}m`}function Ue(e){return e>=1e3?`${(e/1e3).toFixed(1)}k`:String(e)}function We({target:e,anchorEl:t,onConfirm:n,onCancel:r}){let i=(0,E.useRef)(null);return i.current=t,e?(0,T.jsxs)(P,{anchorRef:i,onClose:r,className:`conv-delete-confirm`,role:`alertdialog`,ariaLabel:`Confirm delete session`,children:[(0,T.jsxs)(`div`,{className:`claude-info-header`,children:[(0,T.jsx)(`span`,{children:`Delete this conversation?`}),(0,T.jsx)(`button`,{className:`claude-info-close`,onClick:r,"aria-label":`Close`,children:`✕`})]}),(0,T.jsxs)(`div`,{className:`claude-info-section`,style:{padding:`12px 14px`,fontSize:`11px`,color:`var(--text-secondary)`},children:[(0,T.jsxs)(`div`,{className:`conv-delete-target`,children:[(0,T.jsx)(`span`,{className:`conv-delete-label`,title:e.title,children:e.title||`Untitled session`}),(0,T.jsx)(`code`,{className:`conv-delete-id`,title:e.sessionId,children:e.sessionId.slice(0,8)})]}),(0,T.jsx)(`div`,{style:{marginTop:`8px`},children:`This permanently removes the transcript. It is not moved to Archive and cannot be recovered.`}),e.live&&(0,T.jsx)(`div`,{style:{marginTop:`8px`},children:`This session is running; deleting stops it first.`})]}),(0,T.jsxs)(`div`,{className:`claude-info-section`,style:{display:`flex`,gap:`8px`,padding:`10px 14px`},children:[(0,T.jsx)(k,{variant:`danger`,size:`sm`,style:{flex:1},onClick:n,children:`Delete`}),(0,T.jsx)(k,{variant:`secondary`,size:`sm`,style:{flex:1},onClick:r,children:`Cancel`})]})]}):null}function Ge({open:e,count:t,liveCount:n,onConfirm:r,onCancel:i}){if(!e)return null;let a=t===1?``:`s`;return(0,T.jsx)(`div`,{className:`claude-info-overlay`,onClick:i,children:(0,T.jsxs)(`div`,{className:`claude-info-modal`,onClick:e=>e.stopPropagation(),role:`alertdialog`,"aria-label":`Confirm delete sessions`,children:[(0,T.jsxs)(`div`,{className:`claude-info-header`,children:[(0,T.jsxs)(`span`,{children:[`Delete `,t,` conversation`,a,`?`]}),(0,T.jsx)(`button`,{className:`claude-info-close`,onClick:i,"aria-label":`Close`,children:`✕`})]}),(0,T.jsxs)(`div`,{className:`claude-info-section`,style:{padding:`12px 14px`,fontSize:`11px`,color:`var(--text-secondary)`},children:[`This permanently removes `,t,` transcript`,a,`. `,t===1?`It is`:`They are`,` not moved to Archive and cannot be recovered.`,n>0&&(0,T.jsxs)(`div`,{style:{marginTop:`8px`},children:[n,` `,n===1?`is`:`are`,` running and will be stopped first.`]})]}),(0,T.jsxs)(`div`,{className:`claude-info-section`,style:{display:`flex`,gap:`8px`,padding:`10px 14px`},children:[(0,T.jsxs)(k,{variant:`danger`,size:`sm`,style:{flex:1},onClick:r,children:[`Delete `,t]}),(0,T.jsx)(k,{variant:`secondary`,size:`sm`,style:{flex:1},onClick:i,children:`Cancel`})]})]})})}var Ke=`auth-refresh-failed`;function qe({error:e,onClose:t}){if(!e)return null;let n=e.reason===Ke,r=n?`Claude sign-in expired`:`Session didn’t open`,i=n?`Your claude.ai login has expired. Re-authenticate to resume sessions.`:`The session did not bind within 60 seconds, so there is no live conversation to open.`;return(0,T.jsx)(`div`,{className:`claude-info-overlay`,onClick:t,children:(0,T.jsxs)(`div`,{className:`claude-info-modal`,onClick:e=>e.stopPropagation(),role:`alertdialog`,"aria-label":`Session could not be opened`,children:[(0,T.jsxs)(`div`,{className:`claude-info-header`,children:[(0,T.jsx)(`span`,{children:r}),(0,T.jsx)(`button`,{className:`claude-info-close`,onClick:t,"aria-label":`Close`,children:`✕`})]}),(0,T.jsxs)(`div`,{className:`claude-info-section`,style:{padding:`12px 14px`,fontSize:`11px`,color:`var(--text-secondary)`},children:[i,(0,T.jsxs)(`div`,{className:`claude-info-row`,style:{marginTop:`8px`},children:[(0,T.jsx)(`span`,{className:`claude-info-label`,children:`Reason`}),(0,T.jsx)(`span`,{className:`claude-info-value`,children:e.reason})]}),e.sessionId&&(0,T.jsxs)(`div`,{className:`claude-info-row`,children:[(0,T.jsx)(`span`,{className:`claude-info-label`,children:`Session`}),(0,T.jsxs)(`span`,{className:`claude-info-value`,children:[e.sessionId.slice(0,8),`…`]})]})]})]})})}function Je(e){let{show:t,onClose:n,claudeInfo:r,messages:i,sessionElapsed:a,sessionId:o,cacheKey:s}=e,[c,l]=(0,E.useState)(null);if(!t)return null;let u=i.flatMap(e=>e.events?.filter(e=>e.type===`usage`)??[]),d=u.at(-1),f=d?.peak_request_pct==null?d?.context_window?Math.round((d.input_tokens+d.cache_creation_tokens+d.cache_read_tokens)/d.context_window*100):0:Math.round(d.peak_request_pct*100),p=u.reduce((e,t)=>e+t.input_tokens+t.cache_creation_tokens+t.cache_read_tokens+t.output_tokens,0),m=i.flatMap(e=>e.events?.filter(e=>e.type===`rate_limit`)??[]).at(-1),h=u.reduce((e,t)=>e+(t.total_cost_usd??0),0),g=r?.account?.subscriptionType,_=e=>{let t=e*1e3-Date.now();if(t<=0)return`now`;let n=Math.floor(t/36e5),r=Math.floor(t%36e5/6e4);return n>0?`${n}h ${r}m`:`${r}m`};return(0,T.jsx)(`div`,{className:`claude-info-overlay`,onClick:n,children:(0,T.jsxs)(`div`,{className:`claude-info-modal`,onClick:e=>e.stopPropagation(),children:[(0,T.jsxs)(`div`,{className:`claude-info-header`,children:[(0,T.jsx)(`img`,{src:`/brand/claude.png`,alt:`Claude`,className:`claude-info-icon`}),(0,T.jsx)(`span`,{children:`Claude Code`}),(0,T.jsx)(`button`,{className:`claude-info-close`,onClick:n,"aria-label":`Close`,children:`✕`})]}),(0,T.jsxs)(`div`,{className:`claude-info-section`,children:[(0,T.jsxs)(`div`,{className:`claude-info-row`,children:[(0,T.jsx)(`span`,{className:`claude-info-label`,children:`Version`}),(0,T.jsx)(`span`,{className:`claude-info-value`,children:r?r.version:`…`})]}),(0,T.jsxs)(`div`,{className:`claude-info-row`,children:[(0,T.jsx)(`span`,{className:`claude-info-label`,children:`Email`}),(0,T.jsx)(`span`,{className:`claude-info-value`,children:r?.account?.email??`…`})]})]}),(g||m||h>0)&&(0,T.jsxs)(`div`,{className:`claude-info-section`,children:[g&&(0,T.jsxs)(`div`,{className:`claude-info-row`,children:[(0,T.jsx)(`span`,{className:`claude-info-label`,children:`Plan`}),(0,T.jsx)(`span`,{className:`claude-info-value`,style:{textTransform:`capitalize`},children:g})]}),m&&(0,T.jsxs)(T.Fragment,{children:[(0,T.jsxs)(`div`,{className:`claude-info-row`,children:[(0,T.jsx)(`span`,{className:`claude-info-label`,children:`Usage`}),(0,T.jsxs)(`span`,{className:`claude-info-value`,children:[Math.round(m.utilization*100),`%`]})]}),(0,T.jsxs)(`div`,{className:`claude-info-row`,children:[(0,T.jsx)(`span`,{className:`claude-info-label`,children:`Resets in`}),(0,T.jsx)(`span`,{className:`claude-info-value`,children:_(m.resetsAt)})]}),m.isUsingOverage&&(0,T.jsxs)(`div`,{className:`claude-info-row`,children:[(0,T.jsx)(`span`,{className:`claude-info-label`,children:`Overage`}),(0,T.jsx)(`span`,{className:`claude-info-value`,children:`Active`})]})]}),h>0&&(0,T.jsxs)(`div`,{className:`claude-info-row`,children:[(0,T.jsx)(`span`,{className:`claude-info-label`,children:`Session cost`}),(0,T.jsxs)(`span`,{className:`claude-info-value`,children:[`$`,h<.01?h.toFixed(4):h.toFixed(2)]})]})]}),(0,T.jsxs)(`div`,{className:`claude-info-section`,children:[(0,T.jsxs)(`div`,{className:`claude-info-row`,children:[(0,T.jsx)(`span`,{className:`claude-info-label`,children:`Model`}),(0,T.jsx)(`span`,{className:`claude-info-value`,children:r?.model??`…`})]}),(0,T.jsxs)(`div`,{className:`claude-info-row`,children:[(0,T.jsx)(`span`,{className:`claude-info-label`,children:`Context used`}),(0,T.jsx)(`span`,{className:`claude-info-value`,children:f>0?`${f}%`:`—`})]}),(0,T.jsxs)(`div`,{className:`claude-info-row`,children:[(0,T.jsx)(`span`,{className:`claude-info-label`,children:`Tokens`}),(0,T.jsx)(`span`,{className:`claude-info-value`,children:p>0?Ue(p):`—`})]}),(0,T.jsxs)(`div`,{className:`claude-info-row`,children:[(0,T.jsx)(`span`,{className:`claude-info-label`,children:`Session`}),(0,T.jsx)(`span`,{className:`claude-info-value`,children:He(a)})]}),(o||s)&&(()=>{let e=o??s??``;return(0,T.jsxs)(`div`,{className:`claude-info-row`,children:[(0,T.jsx)(`span`,{className:`claude-info-label`,children:`Session`}),(0,T.jsx)(`button`,{type:`button`,className:`claude-info-value claude-info-id-copy`,title:`${e} (${o?`flushed`:`pre-flush`}) — click to copy`,onClick:async()=>{l(await S(e)?`copied`:`failed`),setTimeout(()=>l(null),1200)},children:c===`copied`?`copied ✓`:c===`failed`?`copy failed ✕`:`${e.slice(0,8)}…`})]})})()]})]})})}function Ye({open:e,onConnect:t,onClose:n}){return e?(0,T.jsx)(`div`,{className:`claude-info-overlay`,onClick:n,children:(0,T.jsxs)(`div`,{className:`claude-info-modal`,onClick:e=>e.stopPropagation(),role:`alertdialog`,"aria-label":`Claude is not connected`,children:[(0,T.jsxs)(`div`,{className:`claude-info-header`,children:[(0,T.jsx)(`span`,{children:`Claude isn’t connected`}),(0,T.jsx)(`button`,{className:`claude-info-close`,onClick:n,"aria-label":`Close`,children:`✕`})]}),(0,T.jsxs)(`div`,{className:`claude-info-section`,style:{padding:`12px 14px`,fontSize:`11px`,color:`var(--text-secondary)`,display:`flex`,flexDirection:`column`,gap:`10px`},children:[(0,T.jsx)(`span`,{children:`This needs Claude, which is currently disconnected. Connect to continue — the rest of the dashboard stays available either way.`}),(0,T.jsxs)(`div`,{style:{display:`flex`,gap:`8px`,alignItems:`center`},children:[(0,T.jsx)(k,{variant:`primary`,size:`sm`,onClick:t,children:`Connect Claude`}),(0,T.jsx)(`button`,{type:`button`,className:`claude-info-close`,style:{fontSize:`11px`},onClick:n,children:`Not now`})]})]})]})}):null}function W(e){let t=Math.round(e/6e4),n=Math.floor(t/60),r=t%60;return`${n}h ${String(r).padStart(2,`0`)}m`}function Xe(e){return e.activeMs.thinking+e.activeMs.messaging+e.activeMs.toolUse}function G(e){return e.toLocaleString(`en-GB`)}function Ze(e){return`£${e.toFixed(2)}`}function Qe(e){let t=[`Day`,`Active`,`Output tokens`,`Input tokens`,`Cache write`,`Cache read`,`Opus 4.8 (GBP)`,`Sonnet 4.6 (GBP)`],n=(e,t)=>[e,W(Xe(t)),String(t.tokens.output),String(t.tokens.input),String(t.tokens.cacheWrite),String(t.tokens.cacheRead),t.costGBP.opus.toFixed(2),t.costGBP.sonnet.toFixed(2)];return[t,...e.days.map(e=>n(e.date,e)),n(`TOTAL (${e.days.length} d)`,e.totals)].map(e=>e.join(`,`)).join(`
|
|
2
|
+
`)}function $e({label:e,d:t,bold:n}){let r=n?`th`:`td`;return(0,T.jsxs)(`tr`,{className:n?`usage-total-row`:void 0,children:[(0,T.jsx)(r,{className:`usage-day`,children:e}),(0,T.jsx)(r,{children:W(Xe(t))}),(0,T.jsx)(r,{children:G(t.tokens.output)}),(0,T.jsx)(r,{children:G(t.tokens.input)}),(0,T.jsx)(r,{children:G(t.tokens.cacheWrite)}),(0,T.jsx)(r,{children:G(t.tokens.cacheRead)}),(0,T.jsx)(r,{children:Ze(t.costGBP.opus)}),(0,T.jsx)(r,{children:Ze(t.costGBP.sonnet)})]})}function et({show:e,onClose:t,anchorEl:n,sessionId:r,summary:i,loading:a,error:o}){let s=(0,E.useRef)(null);if(s.current=n,!e)return null;let c=!!i&&i.days.length>0;return(0,T.jsxs)(P,{anchorRef:s,onClose:t,className:`usage-popover`,role:`dialog`,ariaLabel:`Session usage and cost`,anchorId:r??void 0,children:[(0,T.jsxs)(`div`,{className:`claude-info-header`,children:[(0,T.jsxs)(`span`,{children:[`Usage & cost`,r?` · ${r.slice(0,8)}`:``]}),c&&(0,T.jsx)(`button`,{className:`usage-download`,onClick:()=>{if(!i)return;let e=new Blob([Qe(i)],{type:`text/csv;charset=utf-8`}),t=URL.createObjectURL(e),n=document.createElement(`a`);n.href=t,n.download=`usage-${r?r.slice(0,8):`session`}.csv`,document.body.appendChild(n),n.click(),n.remove(),URL.revokeObjectURL(t)},"aria-label":`Download as CSV`,title:`Download as CSV`,children:(0,T.jsx)(b,{size:14})}),(0,T.jsx)(`button`,{className:`claude-info-close`,onClick:t,"aria-label":`Close`,children:(0,T.jsx)(y,{size:14})})]}),(0,T.jsxs)(`div`,{className:`claude-info-section usage-body`,children:[a&&(0,T.jsx)(`div`,{className:`usage-note`,children:`Computing usage…`}),!a&&o&&(0,T.jsx)(`div`,{className:`usage-note usage-error`,children:o}),!a&&!o&&i&&i.days.length===0&&(0,T.jsx)(`div`,{className:`usage-note`,children:`No usage recorded for this session yet.`}),!a&&!o&&i&&i.days.length>0&&(0,T.jsxs)(T.Fragment,{children:[(0,T.jsx)(`div`,{className:`usage-table-scroll`,children:(0,T.jsxs)(`table`,{className:`usage-table`,children:[(0,T.jsx)(`thead`,{children:(0,T.jsxs)(`tr`,{children:[(0,T.jsx)(`th`,{className:`usage-day`,children:`Day`}),(0,T.jsx)(`th`,{children:`Active`}),(0,T.jsx)(`th`,{children:`Output tok`}),(0,T.jsx)(`th`,{children:`Input tok`}),(0,T.jsx)(`th`,{children:`Cache write`}),(0,T.jsx)(`th`,{children:`Cache read`}),(0,T.jsx)(`th`,{children:`Opus 4.8 (£)`}),(0,T.jsx)(`th`,{children:`Sonnet 4.6 (£)`})]})}),(0,T.jsxs)(`tbody`,{children:[i.days.map(e=>(0,T.jsx)($e,{label:e.date,d:e},e.date)),(0,T.jsx)($e,{label:`TOTAL (${i.days.length} d)`,d:i.totals,bold:!0})]})]})}),(0,T.jsxs)(`div`,{className:`usage-note usage-caveats`,children:[`Prices dated `,i.pricing.opusPriceDate,` · £/$ `,i.pricing.usdPerGbp,` · Sonnet tokenizer factor `,i.pricing.tokenizerFactor,`. Idle human-wait dominates the calendar span; cache-read tokens dominate cost; Sonnet is a tokenizer-adjusted estimate.`]})]})]})]})}var tt=`https://claude.ai/code`,nt=200,rt=[500,1e3,1500,2e3,2500,3e3,3e3];function it(e,t,n){if(e&&n.target)return{kind:`navigate`,url:n.target,sameOrigin:!0};let r=n.slug??n.bridgeSessionId??null;if(e&&r)return{kind:`navigate`,url:`${tt}/${r}`,sameOrigin:!1};let i=n.reason||n.error||`status ${t}`;return{kind:`error`,sessionId:n.sessionId??null,reason:i}}function at(e){if(!e)return``;let t=Date.parse(e);return Number.isFinite(t)?new Date(t).toLocaleString(void 0,{dateStyle:`medium`,timeStyle:`short`}):``}function ot(e){let{businessName:u,cacheKey:m,onConnectClaude:h,role:te,userName:y,userAvatar:b,onSelectProjects:S,onSelectTasks:ie,onCloseMobileDrawer:C,collapsed:ce,onSelectData:le,initialDataSurface:D=!1,onLogout:O,onDisconnect:k,disconnecting:ge,claudeConnected:ye=!0,subAccounts:be,activeAccountId:xe,switchingAccount:Se,onSwitchAccount:M,refreshAccounts:Ce,onOpenConversations:we}=e,N=x(m),Te=(0,E.useCallback)(e=>({key:`reseat`,label:`Reset session ${e.title} (model, mode, effort)`,menuLabel:`Reset`,title:`Reset — move this session onto a chosen model, mode, and effort`,icon:(0,T.jsx)(_e,{size:12}),panel:()=>(0,T.jsx)(Ve,{row:e,adminFetch:N,onError:e=>z({message:e,failed:!0})})}),[N]),Ee=a.productName,De=u||Ee,Oe=typeof y==`string`?y:y===null?`name unavailable`:De,ke=(Oe.trim().charAt(0)||`?`).toUpperCase(),[Ae,je]=(0,E.useState)(D?`data`:`sessions`),[Me,P]=(0,E.useState)(!1),[F,I]=(0,E.useState)(!1),Pe=!ce&&(be?.length??0)>1&&!!M,L=be?.find(e=>e.isHouse)??null,Fe=(0,E.useCallback)(()=>{if(L){if(L.accountId===xe){console.info(`[admin-ui] op=subaccount-switch-house anchor=brand-icon accountId=${L.accountId.slice(0,8)} switched=false reason=already-house`);return}console.info(`[admin-ui] op=subaccount-switch-house anchor=brand-icon accountId=${L.accountId.slice(0,8)} switched=true`),I(!1),M?.(L.accountId)}},[L,xe,M]),[R,z]=(0,E.useState)(null),[Ie,B]=(0,E.useState)(null),[Le,Re]=(0,E.useState)(!1),[V,ze]=(0,E.useState)([]),[H]=(0,E.useState)(()=>typeof window>`u`?null:new URLSearchParams(window.location.search).get(`session`)),[U,Be]=(0,E.useState)(!1),[He,Ue]=(0,E.useState)(null),[Ke,Je]=(0,E.useState)(!1),[W,Xe]=(0,E.useState)(!1),[G,Ze]=(0,E.useState)(!1),[Qe,$e]=(0,E.useState)(null),[tt,ot]=(0,E.useState)(new Set),st=(0,E.useRef)(new Map),[K,ut]=(0,E.useState)(!1),[q,dt]=(0,E.useState)(new Set),[ft,pt]=(0,E.useState)(!1),[J,mt]=(0,E.useState)(null),[ht,gt]=(0,E.useState)(new Set),[_t,vt]=(0,E.useState)(new Set),[yt,bt]=(0,E.useState)(new Set),[Y,xt]=(0,E.useState)(null),[St,X]=(0,E.useState)(``),[Ct,wt]=(0,E.useState)(!1),[Tt,Et]=(0,E.useState)(null),[Dt,Ot]=(0,E.useState)(null),[kt,At]=(0,E.useState)(!1),[jt,Mt]=(0,E.useState)(null),[Z,Nt]=(0,E.useState)(!1),Pt=(0,E.useRef)(0);(0,E.useEffect)(()=>{if(!R)return;let e=setTimeout(()=>z(null),2500);return()=>clearTimeout(e)},[R]);let Ft=H!=null&&V.some(e=>e.sessionId===H);(0,E.useEffect)(()=>{H==null||!U||console.info(`[sidebar-sessions] op=select-highlight session=${H.slice(0,8)} matched=${Ft}`)},[H,Ft,U]);let Q=(0,E.useCallback)(async()=>{if(!m)return null;let e=++Pt.current;Je(!0),Ue(null);try{let t=await N(`/api/admin/sidebar-sessions`);if(!t.ok)throw Error(`status ${t.status}`);let n=await t.json(),r=n.sessions??[];return e===Pt.current?(ze(r),$e(n.accountId??null),Be(!0),r):(console.info(`[admin-ui] sidebar-sessions-stale-response-dropped token=${e}`),r)}catch(t){let n=t instanceof Error?t.message:String(t);return e===Pt.current&&Ue(`Failed to load sessions: ${n}`),console.error(`[admin-ui] sidebar-sessions fetch failed: ${n}`),null}finally{e===Pt.current&&Je(!1)}},[m,N]);(0,E.useEffect)(()=>{!m||U||Q()},[m,U,Q]),(0,E.useEffect)(()=>{if(!m)return;let e=null;function t(){console.info(`[admin-ui] sidebar-refresh surface=sessions trigger=poll`),Q()}function n(){e===null&&(e=setInterval(t,ct))}function r(){e!==null&&(clearInterval(e),e=null)}function i(){document.hidden?r():(t(),n())}return document.hidden||n(),document.addEventListener(`visibilitychange`,i),()=>{r(),document.removeEventListener(`visibilitychange`,i)}},[m,Q]);let It=()=>{console.info(`[admin-ui] sidebar-refresh surface=sessions trigger=manual`),Q()},Lt=()=>{je(`data`),console.info(`[admin-ui] sidebar-nav surface=data collapsed=${ce}`),le(),C()},$=typeof window<`u`&&window.location?.pathname||`/`,Rt=Ae===`data`,zt=typeof window<`u`&&window.location?.search||``,Bt=new URLSearchParams(zt),Vt=Bt.has(`label`)&&!Bt.has(`nodeId`),Ht=e=>{C(),window.location.href=e},Ut=[{key:`dashboard`,label:`Dashboard`,icon:(0,T.jsx)(i,{size:17,strokeWidth:1.75}),active:$===`/`&&!Rt,onClick:()=>Ht(`/`)},{key:`chat`,label:`Chat`,icon:(0,T.jsx)(n,{size:17,strokeWidth:1.75}),active:$.startsWith(`/chat`),onClick:()=>Ht(`/chat`)},{key:`tasks`,label:`Tasks`,icon:(0,T.jsx)(j,{size:17,strokeWidth:1.75}),active:$.startsWith(`/tasks`),onClick:()=>{ie(),C()}},{key:`calendar`,label:`Calendar`,icon:(0,T.jsx)(s,{size:17,strokeWidth:1.75}),active:$.startsWith(`/calendar`),onClick:()=>Ht(`/calendar`)},{key:`data`,label:`Data`,icon:(0,T.jsx)(t,{size:17,strokeWidth:1.75}),active:Rt,onClick:Lt},{key:`container`,label:d().term,icon:(0,T.jsx)(w,{size:17,strokeWidth:1.75}),active:$.startsWith(`/graph`)&&Vt,onClick:()=>{S(),C()}},{key:`graph`,label:`Graph`,icon:(0,T.jsx)(ve,{size:17,strokeWidth:1.75}),active:$.startsWith(`/graph`)&&!Vt,onClick:()=>Ht(`/graph`)},{key:`activity`,label:`Activity`,icon:(0,T.jsx)(c,{size:17,strokeWidth:1.75}),active:$.startsWith(`/activity`),onClick:()=>Ht(`/activity`)},{key:`browser`,label:`Browser`,icon:(0,T.jsx)(r,{size:17,strokeWidth:1.75}),active:$.startsWith(`/browser`),onClick:()=>Ht(`/browser`)}],Wt=(0,E.useCallback)(async e=>{if(ht.has(e.sessionId))return;gt(t=>{let n=new Set(t);return n.add(e.sessionId),n});let t=window.open(``,`_blank`);try{let n=await N(`/api/admin/session-rc-spawn`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify({sessionId:e.sessionId,name:e.title||e.sessionId,...e.accountId?{targetAccountId:e.accountId}:{}})}),r=await n.json().catch(()=>({})),i=it(n.ok,n.status,{...r,sessionId:r.sessionId??e.sessionId});console.info(`[admin-ui] sidebar-session-resume sessionId=${e.sessionId} status=${n.status} outcome=${i.kind} slug=${r.slug??r.bridgeSessionId??`none`}`),i.kind===`navigate`?(C(),t?t.location.href=i.url:window.open(i.url,`_blank`)):(t?.close(),console.error(`[admin-ui] sidebar-session-resume-failed sessionId=${e.sessionId} status=${n.status} reason=${i.reason}`),B(i))}catch(n){t?.close();let r=n instanceof Error?n.message:String(n);console.error(`[admin-ui] sidebar-session-resume-failed sessionId=${e.sessionId} error=${r}`),B({sessionId:e.sessionId,reason:r})}finally{gt(t=>{let n=new Set(t);return n.delete(e.sessionId),n})}},[N,C,ht]),Gt=(0,E.useCallback)(async e=>{let t=e.slice(0,8);for(let n=1;n<=rt.length;n++){await new Promise(e=>setTimeout(e,rt[n-1]));let r=await Q();if(r&&r.some(t=>t.sessionId===e)){console.info(`[admin-ui] sidebar-new-session-converged sessionId=${t} via=retry attempts=${n}`);return}}console.error(`[admin-ui] sidebar-new-session-converge-timeout sessionId=${t}`)},[Q]),Kt=(0,E.useCallback)(async()=>{if(!Z){Nt(!0);try{let e=await N(`/api/admin/session-rc-spawn`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify({})}),t=await e.json().catch(()=>({})),n=it(e.ok,e.status,t);console.info(`[admin-ui] sidebar-new-session-spawned status=${e.status} outcome=${n.kind} slug=${t.slug??t.bridgeSessionId??`none`}`),n.kind===`navigate`?n.sameOrigin?window.location.assign(n.url):(window.open(n.url,`_blank`),t.sessionId?Gt(t.sessionId):console.error(`[admin-ui] sidebar-new-session-converge-skipped reason=no-session-id`)):e.status===503||n.reason===`claude-auth-dead`?(console.info(`[admin-ui] op=llm-action-blocked action=spawn reason=claude-disconnected`),Re(!0)):(console.error(`[admin-ui] sidebar-new-session-failed status=${e.status} reason=${n.reason}`),B(n))}catch(e){let t=e instanceof Error?e.message:String(e);console.error(`[admin-ui] sidebar-new-session-failed error=${t}`),B({sessionId:null,reason:t})}finally{Nt(!1)}}},[N,Z,Gt]),qt=(0,E.useCallback)((e,t)=>{e.stopPropagation(),mt(t)},[]),Jt=(0,E.useCallback)(async(e,t)=>{e.stopPropagation(),Et(t),Ot(null),Mt(null),At(!0);try{let e=await N(`/api/admin/session-usage?sessionId=${encodeURIComponent(t.sessionId)}`),n=await e.json().catch(()=>({}));e.ok?Ot(n):Mt(n.error??`status ${e.status}`)}catch(e){Mt(e instanceof Error?e.message:String(e))}finally{At(!1)}},[N]),Yt=(0,E.useCallback)(async(e,t={})=>{let n=t.refresh??!0;if(tt.has(e.sessionId))return!1;ot(t=>{let n=new Set(t);return n.add(e.sessionId),n});try{let t=await N(`/api/admin/session-delete`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify({sessionId:e.sessionId})});if(!t.ok){let n=await t.json().catch(()=>({}));return console.error(`[admin-ui] sidebar-session-delete-failed sessionId=${e.sessionId} status=${t.status} error=${n.error??`unknown`}`),z({message:`Delete failed: ${n.error??`status ${t.status}`}`,failed:!0}),!1}let r=await t.json();return console.info(`[admin-ui] sidebar-session-delete sessionId=${e.sessionId} live=${e.live} confirmed=true pidKilled=${r.pidKilled??`?`} deleted=${r.deleted??`?`}`),ze(t=>t.filter(t=>t.sessionId!==e.sessionId)),n&&Q(),!0}catch(t){let n=t instanceof Error?t.message:String(t);return console.error(`[admin-ui] sidebar-session-delete-failed sessionId=${e.sessionId} error=${n}`),z({message:`Delete failed: ${n}`,failed:!0}),!1}finally{ot(t=>{let n=new Set(t);return n.delete(e.sessionId),n})}},[N,tt,Q]),Xt=(0,E.useCallback)(e=>{dt(t=>{let n=new Set(t);return n.has(e)?n.delete(e):n.add(e),n})},[]),Zt=(0,E.useCallback)(()=>{ut(!1),dt(new Set)},[]),Qt=(0,E.useCallback)(async()=>{let e=[...q].map(e=>V.find(t=>t.sessionId===e)).filter(e=>!!e),t=e.filter(e=>e.live).length;console.info(`[admin-ui] sidebar-bulk-delete op=start count=${e.length} live=${t}`);let n=(await Promise.all(e.map(e=>Yt(e,{refresh:!1})))).filter(Boolean).length;console.info(`[admin-ui] sidebar-bulk-delete op=done requested=${e.length} ok=${n} failed=${e.length-n}`),Q(),Zt()},[q,V,Yt,Q,Zt]),$t=(0,E.useCallback)(async(e,t)=>{if(e.stopPropagation(),!_t.has(t.sessionId)){vt(e=>{let n=new Set(e);return n.add(t.sessionId),n});try{let e=await N(`/api/admin/session-stop`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify({sessionId:t.sessionId})});if(!e.ok){let n=await e.json().catch(()=>({}));console.error(`[admin-ui] sidebar-session-stop-failed sessionId=${t.sessionId} status=${e.status} error=${n.error??`unknown`}`),z({message:`Stop failed: ${n.error??`status ${e.status}`}`,failed:!0});return}console.info(`[admin-ui] sidebar-session-stop sessionId=${t.sessionId}`),Q()}catch(e){let n=e instanceof Error?e.message:String(e);console.error(`[admin-ui] sidebar-session-stop-failed sessionId=${t.sessionId} error=${n}`),z({message:`Stop failed: ${n}`,failed:!0})}finally{vt(e=>{let n=new Set(e);return n.delete(t.sessionId),n})}}},[N,_t,Q]),en=(0,E.useCallback)(async(e,t,n)=>{if(e.stopPropagation(),!yt.has(t.sessionId)){bt(e=>{let n=new Set(e);return n.add(t.sessionId),n});try{let e=await N(`/api/admin/session-archive`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify({sessionId:t.sessionId,mode:n})});if(!e.ok){let r=await e.json().catch(()=>({})),i=r.detail??r.error??`status ${e.status}`;console.error(`[admin-ui] sidebar-session-archive-failed sessionId=${t.sessionId} mode=${n} status=${e.status} error=${r.error??`unknown`}`),z({message:`${n===`archive`?`Archive`:`Unarchive`} failed: ${i}`,failed:!0});return}console.info(`[admin-ui] sidebar-session-archive sessionId=${t.sessionId} mode=${n}`),Q()}catch(e){let r=e instanceof Error?e.message:String(e);console.error(`[admin-ui] sidebar-session-archive-failed sessionId=${t.sessionId} mode=${n} error=${r}`),z({message:`${n===`archive`?`Archive`:`Unarchive`} failed: ${r}`,failed:!0})}finally{bt(e=>{let n=new Set(e);return n.delete(t.sessionId),n})}}},[N,yt,Q]),tn=(0,E.useCallback)(async e=>{let t=St.trim();if(!t){z({message:`Title can’t be empty`,failed:!0});return}if(t.length>nt){z({message:`Title too long (max ${nt})`,failed:!0});return}wt(!0);try{let n=await N(`/api/admin/session-rename`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify({sessionId:e.sessionId,title:t})});if(!n.ok){let t=await n.json().catch(()=>({})),r=t.reason??t.error??`status ${n.status}`;console.error(`[admin-ui] sidebar-session-rename sessionId=${e.sessionId.slice(0,8)} outcome=rejected reason=${r}`),z({message:`Rename failed: ${r}`,failed:!0});return}console.info(`[admin-ui] sidebar-session-rename sessionId=${e.sessionId.slice(0,8)} outcome=ok`),xt(null),X(``),Q()}catch(t){let n=t instanceof Error?t.message:String(t);console.error(`[admin-ui] sidebar-session-rename sessionId=${e.sessionId.slice(0,8)} outcome=rejected reason=${n}`),z({message:`Rename failed: ${n}`,failed:!0})}finally{wt(!1)}},[N,St,Q]);return(0,T.jsxs)(`aside`,{className:`side`,children:[(0,T.jsxs)(`div`,{className:`side-brand`,children:[Pe?(0,T.jsxs)(T.Fragment,{children:[(0,T.jsx)(`button`,{type:`button`,className:`side-brand-icon-btn`,"aria-label":`Switch to house account`,disabled:!L,onClick:Fe,children:(0,T.jsx)(`img`,{className:`side-brand-icon`,src:o,alt:``,"aria-hidden":`true`})}),(0,T.jsxs)(`button`,{type:`button`,className:`side-brand-trigger`,"aria-haspopup":`menu`,"aria-expanded":F,"aria-label":`Switch sub-account`,onClick:()=>{let e=!F;I(e),e&&Ce?.(),console.info(`[admin-ui] op=subaccount-switcher-toggle anchor=brand-head open=${e} available=true accounts=${be?.length??0}`)},children:[(0,T.jsxs)(`span`,{className:`side-brand-lockup`,children:[(0,T.jsx)(`span`,{className:`side-brand-business`,children:De}),(0,T.jsx)(`span`,{className:`side-brand-product`,children:a.productName})]}),(0,T.jsx)(A,{size:14,className:`side-brand-caret`,"aria-hidden":`true`})]})]}):(0,T.jsxs)(T.Fragment,{children:[(0,T.jsx)(`img`,{className:`side-brand-icon`,src:o,alt:``,"aria-hidden":`true`}),(0,T.jsxs)(`span`,{className:`side-brand-lockup`,children:[(0,T.jsx)(`span`,{className:`side-brand-business`,children:De}),(0,T.jsx)(`span`,{className:`side-brand-product`,children:a.productName})]})]}),F&&(0,T.jsxs)(T.Fragment,{children:[(0,T.jsx)(`div`,{className:`side-brand-scrim`,"aria-hidden":`true`,onClick:()=>I(!1)}),(0,T.jsx)(ne,{open:F,accounts:be??[],activeAccountId:xe??null,switching:Se??!1,onSelect:e=>M?.(e),onClose:()=>I(!1)})]})]}),(0,T.jsx)(`nav`,{className:`side-nav`,children:Ut.map(e=>(0,T.jsxs)(`button`,{type:`button`,className:`admin-row nav-row${e.active?` active`:``}`,"aria-current":e.active?`page`:void 0,onClick:e.onClick,children:[e.icon,(0,T.jsx)(`span`,{className:`label`,children:e.label}),(0,T.jsx)(`span`,{className:`kbd`})]},e.key))}),(()=>{let e=V.filter(e=>W?!0:!e.isSubagent).filter(e=>G?!0:!e.archived),t=V.some(e=>e.isSubagent),n=V.some(e=>e.archived);return(0,T.jsx)(`div`,{className:`side-sessions`,children:(0,T.jsxs)(`div`,{className:`side-list`,children:[(0,T.jsxs)(`div`,{className:`group-head`,children:[(0,T.jsx)(`span`,{children:`Sessions`}),(0,T.jsxs)(`span`,{className:`group-head-meta`,children:[(0,T.jsx)(`button`,{type:`button`,className:`group-head-select${K?` active`:``}`,"aria-pressed":K,title:K?`Exit select mode`:`Select multiple sessions to delete`,onClick:()=>{ut(e=>!e),dt(new Set),xt(null),X(``)},children:`Select`}),(0,T.jsx)(`button`,{type:`button`,className:`group-head-refresh`,title:`Refresh sessions`,"aria-label":`Refresh sessions`,onClick:It,disabled:Ke,children:(0,T.jsx)(ee,{size:12,className:Ke?`spinning`:void 0})}),(0,T.jsx)(`span`,{children:Ke?`…`:String(e.length)}),(0,T.jsxs)(`button`,{type:`button`,className:`admin-btn-cta side-sessions-new`,onClick:Kt,disabled:Z,"aria-busy":Z,"aria-label":Z?`Spawning session`:`New session`,title:Z?`Spawning session`:`New session`,children:[Z?(0,T.jsx)(p,{size:13,className:`spinning`}):(0,T.jsx)(se,{size:13}),(0,T.jsx)(`span`,{children:Z?`Spawning…`:`New session`})]})]})]}),K&&(0,T.jsxs)(`div`,{className:`session-select-bar`,children:[(0,T.jsxs)(`span`,{className:`session-select-count`,children:[q.size,` selected`]}),(0,T.jsxs)(`button`,{type:`button`,className:`session-select-delete`,disabled:q.size===0,onClick:()=>pt(!0),children:[`Delete `,q.size]}),(0,T.jsx)(`button`,{type:`button`,className:`session-select-cancel`,onClick:Zt,children:`Cancel`})]}),Qe&&(0,T.jsx)(`div`,{className:`side-account-id`,title:`This install's accountId. The first 8 characters match the truncated UUID label on the live Remote Control daemon entry in claude.ai/code.`,children:(0,T.jsx)(`code`,{children:Qe})}),(t||n)&&(0,T.jsxs)(`div`,{className:`artefact-filter-chips`,children:[t&&(0,T.jsx)(`button`,{type:`button`,className:`artefact-filter-chip${W?` active`:``}`,"aria-pressed":W,onClick:()=>Xe(e=>!e),title:W?`Hide subagent sessions`:`Show subagent sessions`,children:`Subagents`}),n&&(0,T.jsx)(`button`,{type:`button`,className:`artefact-filter-chip${G?` active`:``}`,"aria-pressed":G,onClick:()=>Ze(e=>!e),title:G?`Hide archived sessions`:`Show archived sessions`,children:`Archived`})]}),He&&(0,T.jsx)(`div`,{className:`conv`,style:{color:`var(--text-tertiary)`,cursor:`default`},children:He}),U&&!He&&e.length===0&&(0,T.jsx)(`div`,{className:`conv`,style:{color:`var(--text-tertiary)`,cursor:`default`},children:`No sessions yet`}),e.map(e=>{let t=at(e.startedAt),n=ht.has(e.sessionId),r=tt.has(e.sessionId),i=_t.has(e.sessionId),a=yt.has(e.sessionId),o=n||r||i||a,s=()=>{window.location.assign(`/chat?session=${e.sessionId}`)},c=[{key:`open`,label:`Resume session ${e.title} in claude.ai/code`,menuLabel:`Resume in claude.ai/code`,title:`Resume in a fresh local Remote Control PTY`,icon:(0,T.jsx)(l,{size:12}),busy:n,onClick:()=>{Wt(e)}},{key:`message`,label:`Open session ${e.title} in admin webchat`,menuLabel:`Open in webchat`,title:`Open in admin webchat (/chat) — sending resumes this session`,icon:(0,T.jsx)(he,{size:12}),onClick:()=>{s()}},{key:`usage`,label:`Usage and cost for session ${e.title}`,menuLabel:`Usage & cost`,title:`Per-day active time, tokens, and estimated GBP cost`,icon:(0,T.jsx)(me,{size:12}),onClick:t=>{Jt(t,e)}},...e.live?[{key:`stop`,label:`Stop session ${e.title}`,menuLabel:`Stop`,title:`Stop session process (keeps the conversation, can resume later)`,icon:(0,T.jsx)(oe,{size:12}),busy:i,onClick:t=>{$t(t,e)}}]:[],e.archived?{key:`unarchive`,label:`Unarchive session ${e.title}`,menuLabel:`Unarchive`,title:`Unarchive (move back to the active list)`,icon:(0,T.jsx)(de,{size:12}),busy:a,onClick:t=>{en(t,e,`unarchive`)}}:{key:`archive`,label:`Archive session ${e.title}`,menuLabel:`Archive`,title:`Archive (hide from the list, keeps the conversation resumable)`,icon:(0,T.jsx)(fe,{size:12}),busy:a,onClick:t=>{en(t,e,`archive`)}},{key:`rename`,label:`Rename session ${e.title}`,menuLabel:`Rename`,title:`Rename this session`,icon:(0,T.jsx)(f,{size:12}),busy:Ct&&Y===e.sessionId,onClick:t=>{t.stopPropagation(),xt(e.sessionId),X(e.personName??e.title)}},{key:`delete`,label:`Delete session ${e.title}`,menuLabel:`Delete`,title:`Delete session (stops the process, removes the conversation)`,icon:(0,T.jsx)(g,{size:12}),danger:!0,busy:r,onClick:t=>{qt(t,e)}},Te({sessionId:e.sessionId,model:e.model??null,title:e.personName??e.title})],u=e.channel===`whatsapp`?` conv-channel-whatsapp`:e.channel===`telegram`?` conv-channel-telegram`:``,d=e.channel===`whatsapp`||e.channel===`telegram`||e.channel===`webchat`,p=re.includes(e.channel??``)&&e.senderId&&e.titleSource===`prefix`?_({operatorName:e.personName??null,whatsappName:e.whatsappName??null,senderId:e.senderId,title:e.title}):e.personName??e.title;return(0,T.jsxs)(`div`,{ref:t=>{let n=st.current;t?n.set(e.sessionId,t):n.delete(e.sessionId)},className:`conv conv-with-actions${u}${e.sessionId===H?` active`:``}`,children:[(0,T.jsxs)(`div`,{className:`conv-main-static conv-main-clickable`,role:`button`,tabIndex:0,"aria-label":`Open ${p} in webchat`,onClick:()=>{if(Y!==e.sessionId){if(K){Xt(e.sessionId);return}s()}},onKeyDown:t=>{Y!==e.sessionId&&(t.key===`Enter`||t.key===` `)&&(t.preventDefault(),K?Xt(e.sessionId):s())},children:[K&&(0,T.jsx)(`span`,{className:`conv-select-check`,onClick:e=>e.stopPropagation(),children:(0,T.jsx)(ue,{checked:q.has(e.sessionId),ariaLabel:`Select ${p}`,onChange:()=>Xt(e.sessionId)})}),(0,T.jsx)(`span`,{className:`conv-live-dot`,"data-live":e.live?`1`:`0`,"aria-label":e.live?`live session`:`ended session`}),(0,T.jsxs)(`span`,{className:`conv-stack`,children:[(0,T.jsxs)(`span`,{className:`conv-name-line`,children:[d&&(0,T.jsx)(ae,{channel:e.channel,size:13}),Y===e.sessionId?(0,T.jsx)(`input`,{className:`conv-name conv-name-edit`,autoFocus:!0,onFocus:e=>e.currentTarget.select(),value:St,disabled:Ct,"aria-label":`New title for session ${e.title}`,onChange:e=>X(e.target.value),onClick:e=>e.stopPropagation(),onKeyDown:t=>{t.key===`Enter`?(t.preventDefault(),tn(e)):t.key===`Escape`&&(t.preventDefault(),xt(null),X(``))},onBlur:()=>{Y===e.sessionId&&!Ct&&(xt(null),X(``))}}):(0,T.jsx)(`span`,{className:`conv-name`,title:p,children:p})]}),(0,T.jsxs)(`span`,{className:`conv-timestamp`,children:[(0,T.jsx)(`code`,{className:`conv-session-id`,title:`First 8 characters of this session's id — distinguishes rows with identical auto-titles. The resume/delete buttons act on the full id.`,children:e.sessionId.slice(0,8)}),t&&(0,T.jsxs)(`span`,{children:[` · `,t]})]})]})]}),!K&&(0,T.jsx)(Ne,{actions:c,disabled:o})]},e.sessionId)})]})})})(),(0,T.jsxs)(`div`,{className:`side-foot`,children:[(0,T.jsx)(`div`,{className:`avatar`,children:b?(0,T.jsx)(`img`,{src:b,alt:Oe}):ke}),(0,T.jsxs)(`div`,{className:`who`,children:[(0,T.jsx)(`span`,{className:`name`,children:Oe}),(0,T.jsx)(lt,{})]}),(0,T.jsx)(`button`,{type:`button`,className:`side-foot-kebab`,"aria-label":`Account menu`,"aria-haspopup":`menu`,"aria-expanded":Me,onClick:()=>P(e=>!e),children:(0,T.jsx)(pe,{size:16})}),Me&&(0,T.jsxs)(T.Fragment,{children:[(0,T.jsx)(`div`,{className:`side-foot-menu-scrim`,"aria-hidden":`true`,onClick:()=>P(!1)}),(0,T.jsx)(`div`,{className:`side-foot-menu`,role:`menu`,children:(0,T.jsx)(v,{variant:`admin`,onCloseMenu:()=>P(!1),onLogout:O??(()=>{}),onDisconnect:k,disconnecting:ge,claudeConnected:ye,onConnectClaude:h,cacheKey:m,onOpenConversations:we})})]})]}),R&&(0,T.jsx)(`div`,{className:`copy-toast${R.failed?` copy-toast-failed`:``}`,role:`status`,children:R.message}),(0,T.jsx)(qe,{error:Ie,onClose:()=>B(null)}),(0,T.jsx)(Ye,{open:Le,onConnect:()=>{Re(!1),h?.()},onClose:()=>Re(!1)}),(0,T.jsx)(We,{target:J,anchorEl:J?st.current.get(J.sessionId)??null:null,onCancel:()=>mt(null),onConfirm:()=>{let e=J;mt(null),e&&Yt(e)}},J?.sessionId??`none`),(0,T.jsx)(Ge,{open:ft,count:q.size,liveCount:V.filter(e=>q.has(e.sessionId)&&e.live).length,onConfirm:()=>{pt(!1),Qt()},onCancel:()=>pt(!1)}),(0,T.jsx)(et,{show:Tt!==null,onClose:()=>{Et(null),Ot(null),Mt(null)},anchorEl:Tt?st.current.get(Tt.sessionId)??null:null,sessionId:Tt?.sessionId??null,summary:Dt,loading:kt,error:jt},Tt?.sessionId??`none`)]})}var st=5e3,ct=3e4;function lt(){let[e,t]=(0,E.useState)(null);if((0,E.useEffect)(()=>{let e=!1,n=null;async function r(){try{let n=await fetch(`/api/admin/system-stats`);if(!n.ok){console.error(`[admin-ui] system-stats-fetch-failed status=${n.status}`);return}let r=await n.json();e||t(r)}catch(e){console.error(`[admin-ui] system-stats-fetch-failed reason=${e instanceof Error?e.message:String(e)}`)}}function i(){n===null&&(r(),n=setInterval(()=>{r()},st))}function a(){n!==null&&(clearInterval(n),n=null)}function o(){document.hidden?a():i()}return document.hidden||i(),document.addEventListener(`visibilitychange`,o),()=>{e=!0,a(),document.removeEventListener(`visibilitychange`,o)}},[]),!e||e.platform===`darwin`)return null;let n=e.cpuPct,r=e.memUsedPct,i=n!==null&&n>=.9,a=n!==null&&n>=.98,o=r!==null&&r>=.9,s=r!==null&&r>=.98,c=i||o,l=a||s,u=e=>e===null?`—`:`${Math.round(e*100)}%`,d=[`system-stats`];return c&&d.push(`system-stats--warn`),l&&d.push(`system-stats--crit`),(0,T.jsxs)(`span`,{className:d.join(` `),role:`status`,"aria-label":`host CPU and RAM`,children:[(0,T.jsxs)(`span`,{className:i?`system-stats__fig system-stats__fig--warn`:`system-stats__fig`,children:[`CPU `,u(n)]}),` · `,(0,T.jsxs)(`span`,{className:o?`system-stats__fig system-stats__fig--warn`:`system-stats__fig`,children:[`RAM `,u(r)]})]})}var K=`admin-sidebar-collapsed`,ut=`admin-sidebar-drawer-open`,q=1080;function dt(){if(typeof window>`u`)return!1;let e=null;try{e=window.sessionStorage.getItem(K)}catch{e=null}return e===null?typeof window.matchMedia==`function`?window.matchMedia(`(min-width: 721px) and (max-width: ${q}px)`).matches:!1:e===`1`}function ft(e){if(!(typeof window>`u`))try{e?window.sessionStorage.setItem(K,`1`):window.sessionStorage.removeItem(K)}catch{}}function pt(){if(typeof window>`u`)return!1;try{return window.sessionStorage.getItem(ut)===`1`}catch{return!1}}function J(e){if(!(typeof window>`u`))try{e?window.sessionStorage.setItem(ut,`1`):window.sessionStorage.removeItem(ut)}catch{}}function mt(e){let[t,n]=(0,E.useState)(()=>typeof window>`u`||typeof window.matchMedia!=`function`?!1:window.matchMedia(e).matches);return(0,E.useEffect)(()=>{if(typeof window>`u`||typeof window.matchMedia!=`function`)return;let t=window.matchMedia(e),r=()=>n(t.matches);return r(),t.addEventListener(`change`,r),()=>t.removeEventListener(`change`,r)},[e]),t}var ht=720;function gt(e,t){return e===`/`?{via:`in-place`}:{via:`navigate`,href:`/?wa=${encodeURIComponent(t.remoteJid??``)}&acct=${encodeURIComponent(t.accountId??``)}`}}function _t(e){return e===`/`?{via:`in-place`}:{via:`navigate`,href:`/?data=1`}}function vt(e,t){if(e!==`/`)return null;let n=new URLSearchParams(t),r=n.get(`wa`),i=n.get(`acct`);return!r||!i?null:{sessionId:``,projectDir:``,title:``,senderId:null,startedAt:``,channel:`whatsapp`,role:`public`,operatorName:null,whatsappName:null,lastMessageAt:null,modelGated:!1,model:null,source:`store`,accountId:i,remoteJid:r}}function yt(e,t){return e===`/`?new URLSearchParams(t).has(`data`):!1}function bt(e,t){return t===`operator`&&e===`chat`||e===`dashboard`?`/`:e===`data`?`/data`:e===`graph`?`/graph`:e===`calendar`?`/calendar`:e===`chat`?`/chat`:e===`activity`?`/activity`:`/browser`}function Y(e){let{cacheKey:t,businessName:n,variant:r=`admin`,onLogout:i,onDisconnect:a,disconnecting:o,claudeConnected:s,onConnectClaude:c,userName:l,userAvatar:u,role:f,onOpenConversations:p,children:m,footer:h}=e,{subAccounts:g,activeAccountId:_,switching:ee,switchAccount:v,refreshAccounts:y}=ie(t),[ne,b]=(0,E.useState)(!0);(0,E.useEffect)(()=>{if(s!==void 0||r!==`admin`)return;let e=!1,t=async()=>{try{let t=await fetch(`/api/health`);if(!t.ok)return;let n=await t.json();e||b(n.auth_status!==`dead`&&n.auth_status!==`missing`)}catch{}};t();let n=setInterval(t,6e4);return()=>{e=!0,clearInterval(n)}},[s,r]);let x=s??ne,re=c??(()=>{window.location.assign(`/?connect=claude`)}),[S,ae]=(0,E.useState)(()=>dt()),[oe,C]=(0,E.useState)(!1),se=(0,E.useRef)(!0);(0,E.useEffect)(()=>{if(se.current){se.current=!1;return}C(!0);let e=setTimeout(()=>C(!1),260);return()=>clearTimeout(e)},[S]);let[w,ce]=(0,E.useState)(()=>pt()),le=mt(`(max-width: ${ht}px)`),[ue,D]=(0,E.useState)(()=>typeof window>`u`||yt(window.location.pathname,window.location.search)?null:vt(window.location.pathname,window.location.search)),[O,k]=(0,E.useState)(()=>typeof window>`u`?!1:yt(window.location.pathname,window.location.search)),[de]=(0,E.useState)(()=>O),fe=(0,E.useCallback)(e=>{ft(e),ae(e)},[]),A=(0,E.useCallback)(e=>{J(e),ce(e)},[]);(0,E.useEffect)(()=>{if(typeof window>`u`)return;let e=window.location?.pathname??``;console.info(`[admin-ui] shell-mount route=${e} variant=${r} sidebar=${r===`operator`?`none`:`present`} collapsed=${S} drawer=${w}`)},[]),(0,E.useEffect)(()=>{typeof window>`u`||!ue||(console.info(`[admin-ui] wa-hydrate route=/ remoteJid=${ue.remoteJid??``}`),window.history.replaceState(null,``,`/`))},[]),(0,E.useEffect)(()=>{typeof window>`u`||!O||(console.info(`[admin-ui] data-hydrate route=/`),window.history.replaceState(null,``,`/`))},[]);let pe=(0,E.useCallback)(e=>{if(k(!1),e===null){D(null);return}let t=typeof window<`u`?window.location.pathname:`/`,n=gt(t,e);console.info(`[admin-ui] wa-open route=${t} via=${n.via} sessionId=${e.sessionId.slice(0,8)}`),n.via===`in-place`?D(e):window.location.href=n.href},[]),me=(0,E.useCallback)(()=>{let e=typeof window<`u`?window.location.pathname:`/`,t=_t(e);if(console.info(`[admin-ui] data-open route=${e} via=${t.via}`),t.via===`navigate`){window.location.href=t.href;return}D(null),k(!0)},[]),j=le?w:!S,he=(0,E.useCallback)(()=>{if(!(typeof window>`u`))if(window.matchMedia(`(max-width: ${ht}px)`).matches){let e=w;console.info(`[admin-ui] header-sidebar-toggle from=${e?`open`:`closed`} mode=drawer`),A(!e)}else{let e=S;console.info(`[admin-ui] header-sidebar-toggle from=${e?`closed`:`open`} mode=collapse`),fe(!e)}},[S,w,fe,A]),ge=(0,E.useCallback)(e=>{let t=bt(e,r);console.info(`[admin-ui] header-menu-nav target=${e} dest=${t}`),window.location.href=t},[r]),_e={collapsed:S,mobileDrawerOpen:w,sidebarOpen:j,onToggleSidebar:he,setMobileDrawerOpen:A,selectedWhatsapp:ue,onClearWhatsapp:()=>D(null),onSelectWhatsappConversation:pe,dataOpen:O};return r===`operator`?(0,T.jsxs)(`div`,{className:`admin-shell admin-page admin-shell-root`,children:[(0,T.jsx)(te,{businessName:n,variant:r,onNavigate:ge,onOpenConversations:p,onToggleSidebar:he,sidebarOpen:j,onLogout:i,onDisconnect:a,disconnecting:o,cacheKey:t,subAccounts:g,activeAccountId:_,switchingAccount:ee,onSwitchAccount:v,refreshAccounts:y}),(0,T.jsx)(`div`,{className:`platform platform-operator`,children:typeof m==`function`?m(_e):m}),(0,T.jsx)(we,{variant:`operator`,onOpenConversations:p}),h]}):(0,T.jsxs)(`div`,{className:`admin-shell admin-page admin-shell-root`,children:[(0,T.jsxs)(`div`,{className:`platform${w?` menu-open`:``}${!le&&S?` sidebar-collapsed`:``}${oe?` sidebar-animating`:``}`,"data-artefact":`closed`,children:[(0,T.jsx)(ot,{businessName:n,cacheKey:t,onConnectClaude:re,role:f??null,userName:l,userAvatar:u??null,onSelectProjects:()=>{window.location.href=`/graph?label=${d().label}`},onSelectTasks:()=>{window.location.href=`/tasks`},onCloseMobileDrawer:()=>A(!1),collapsed:S,mobileDrawerOpen:w,onSelectData:me,onCloseData:()=>k(!1),initialDataSurface:de,onLogout:i,onDisconnect:a,disconnecting:o,claudeConnected:x,subAccounts:g,activeAccountId:_,switchingAccount:ee,onSwitchAccount:v,refreshAccounts:y,onOpenConversations:p}),!le&&(0,T.jsx)(Oe,{}),(0,T.jsx)(xe,{sidebarOpen:j,onToggleSidebar:he,claudeConnected:x,onConnectClaude:re}),typeof m==`function`?m(_e):m]}),w&&(0,T.jsx)(`div`,{className:`sidebar-backdrop menu-open`,"aria-hidden":`true`,onClick:()=>A(!1)}),(0,T.jsx)(we,{}),h]})}export{de as _,Je as a,le as b,I as c,_e as d,j as f,fe as g,A as h,Ye as i,Ie as l,pe as m,mt as n,Pe as o,me as p,it as r,F as s,Y as t,Fe as u,k as v,ue as y};
|