@rubytech/create-maxy-code 0.1.579 → 0.1.580
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/payload/platform/lib/telegram-media/dist/index.d.ts +45 -0
- package/payload/platform/lib/telegram-media/dist/index.d.ts.map +1 -0
- package/payload/platform/lib/telegram-media/dist/index.js +89 -0
- package/payload/platform/lib/telegram-media/dist/index.js.map +1 -0
- package/payload/platform/lib/telegram-media/src/__tests__/telegram-media.test.ts +104 -0
- package/payload/platform/lib/telegram-media/src/index.ts +102 -0
- package/payload/platform/lib/telegram-media/tsconfig.json +9 -0
- package/payload/platform/lib/telegram-media/vitest.config.ts +9 -0
- package/payload/platform/package.json +2 -2
- package/payload/platform/plugins/admin/PLUGIN.md +2 -2
- package/payload/platform/plugins/admin/hooks/__tests__/archive-ingest-surface-gate.test.sh +22 -0
- package/payload/platform/plugins/admin/hooks/__tests__/fs-schema-guard.test.sh +34 -0
- package/payload/platform/plugins/admin/hooks/__tests__/quote-path-write-gate.test.sh +25 -0
- package/payload/platform/plugins/admin/hooks/archive-ingest-surface-gate.sh +11 -4
- package/payload/platform/plugins/admin/hooks/fs-schema-guard.sh +2 -2
- package/payload/platform/plugins/admin/hooks/quote-path-write-gate.sh +6 -3
- package/payload/platform/plugins/admin/skills/whats-new/SKILL.md +7 -0
- package/payload/platform/plugins/cloudflare/mcp/__tests__/portal-schema-shape.test.ts +23 -0
- package/payload/platform/plugins/cloudflare/mcp/__tests__/portal-visit-status-write.test.ts +175 -3
- package/payload/platform/plugins/cloudflare/mcp/__tests__/portal-visits-scope.test.ts +101 -0
- package/payload/platform/plugins/cloudflare/skills/data-portal/schema.sql +35 -1
- package/payload/platform/plugins/cloudflare/skills/data-portal/template/functions/api/visit-status.ts +73 -8
- package/payload/platform/plugins/cloudflare/skills/data-portal/template/functions/api/visits.ts +59 -8
- package/payload/platform/plugins/telegram/.claude-plugin/plugin.json +1 -1
- package/payload/platform/plugins/telegram/PLUGIN.md +23 -3
- package/payload/platform/plugins/telegram/mcp/dist/__tests__/api-census.test.js +99 -1
- package/payload/platform/plugins/telegram/mcp/dist/__tests__/api-census.test.js.map +1 -1
- package/payload/platform/plugins/telegram/mcp/dist/__tests__/ask-tool.test.d.ts +2 -0
- package/payload/platform/plugins/telegram/mcp/dist/__tests__/ask-tool.test.d.ts.map +1 -0
- package/payload/platform/plugins/telegram/mcp/dist/__tests__/ask-tool.test.js +226 -0
- package/payload/platform/plugins/telegram/mcp/dist/__tests__/ask-tool.test.js.map +1 -0
- package/payload/platform/plugins/telegram/mcp/dist/__tests__/card-store.test.d.ts +2 -0
- package/payload/platform/plugins/telegram/mcp/dist/__tests__/card-store.test.d.ts.map +1 -0
- package/payload/platform/plugins/telegram/mcp/dist/__tests__/card-store.test.js +143 -0
- package/payload/platform/plugins/telegram/mcp/dist/__tests__/card-store.test.js.map +1 -0
- package/payload/platform/plugins/telegram/mcp/dist/__tests__/card-tool.test.d.ts +2 -0
- package/payload/platform/plugins/telegram/mcp/dist/__tests__/card-tool.test.d.ts.map +1 -0
- package/payload/platform/plugins/telegram/mcp/dist/__tests__/card-tool.test.js +197 -0
- package/payload/platform/plugins/telegram/mcp/dist/__tests__/card-tool.test.js.map +1 -0
- package/payload/platform/plugins/telegram/mcp/dist/__tests__/invoice-tool.test.d.ts +2 -0
- package/payload/platform/plugins/telegram/mcp/dist/__tests__/invoice-tool.test.d.ts.map +1 -0
- package/payload/platform/plugins/telegram/mcp/dist/__tests__/invoice-tool.test.js +196 -0
- package/payload/platform/plugins/telegram/mcp/dist/__tests__/invoice-tool.test.js.map +1 -0
- package/payload/platform/plugins/telegram/mcp/dist/__tests__/media-fetch-tool.test.d.ts +2 -0
- package/payload/platform/plugins/telegram/mcp/dist/__tests__/media-fetch-tool.test.d.ts.map +1 -0
- package/payload/platform/plugins/telegram/mcp/dist/__tests__/media-fetch-tool.test.js +95 -0
- package/payload/platform/plugins/telegram/mcp/dist/__tests__/media-fetch-tool.test.js.map +1 -0
- package/payload/platform/plugins/telegram/mcp/dist/__tests__/media-send-tool.test.d.ts +2 -0
- package/payload/platform/plugins/telegram/mcp/dist/__tests__/media-send-tool.test.d.ts.map +1 -0
- package/payload/platform/plugins/telegram/mcp/dist/__tests__/media-send-tool.test.js +293 -0
- package/payload/platform/plugins/telegram/mcp/dist/__tests__/media-send-tool.test.js.map +1 -0
- package/payload/platform/plugins/telegram/mcp/dist/__tests__/schemas.test.d.ts +2 -0
- package/payload/platform/plugins/telegram/mcp/dist/__tests__/schemas.test.d.ts.map +1 -0
- package/payload/platform/plugins/telegram/mcp/dist/__tests__/schemas.test.js +130 -0
- package/payload/platform/plugins/telegram/mcp/dist/__tests__/schemas.test.js.map +1 -0
- package/payload/platform/plugins/telegram/mcp/dist/__tests__/thread-tool.test.d.ts +2 -0
- package/payload/platform/plugins/telegram/mcp/dist/__tests__/thread-tool.test.d.ts.map +1 -0
- package/payload/platform/plugins/telegram/mcp/dist/__tests__/thread-tool.test.js +119 -0
- package/payload/platform/plugins/telegram/mcp/dist/__tests__/thread-tool.test.js.map +1 -0
- package/payload/platform/plugins/telegram/mcp/dist/index.js +71 -66
- package/payload/platform/plugins/telegram/mcp/dist/index.js.map +1 -1
- package/payload/platform/plugins/telegram/mcp/dist/lib/account-write.d.ts +15 -0
- package/payload/platform/plugins/telegram/mcp/dist/lib/account-write.d.ts.map +1 -1
- package/payload/platform/plugins/telegram/mcp/dist/lib/account-write.js +27 -10
- package/payload/platform/plugins/telegram/mcp/dist/lib/account-write.js.map +1 -1
- package/payload/platform/plugins/telegram/mcp/dist/lib/api-census.d.ts +34 -0
- package/payload/platform/plugins/telegram/mcp/dist/lib/api-census.d.ts.map +1 -1
- package/payload/platform/plugins/telegram/mcp/dist/lib/api-census.js +106 -0
- package/payload/platform/plugins/telegram/mcp/dist/lib/api-census.js.map +1 -1
- package/payload/platform/plugins/telegram/mcp/dist/lib/card-store.d.ts +41 -0
- package/payload/platform/plugins/telegram/mcp/dist/lib/card-store.d.ts.map +1 -0
- package/payload/platform/plugins/telegram/mcp/dist/lib/card-store.js +120 -0
- package/payload/platform/plugins/telegram/mcp/dist/lib/card-store.js.map +1 -0
- package/payload/platform/plugins/telegram/mcp/dist/tools/ask.d.ts +73 -0
- package/payload/platform/plugins/telegram/mcp/dist/tools/ask.d.ts.map +1 -0
- package/payload/platform/plugins/telegram/mcp/dist/tools/ask.js +270 -0
- package/payload/platform/plugins/telegram/mcp/dist/tools/ask.js.map +1 -0
- package/payload/platform/plugins/telegram/mcp/dist/tools/card.d.ts +34 -0
- package/payload/platform/plugins/telegram/mcp/dist/tools/card.d.ts.map +1 -0
- package/payload/platform/plugins/telegram/mcp/dist/tools/card.js +134 -0
- package/payload/platform/plugins/telegram/mcp/dist/tools/card.js.map +1 -0
- package/payload/platform/plugins/telegram/mcp/dist/tools/invoice.d.ts +70 -0
- package/payload/platform/plugins/telegram/mcp/dist/tools/invoice.d.ts.map +1 -0
- package/payload/platform/plugins/telegram/mcp/dist/tools/invoice.js +232 -0
- package/payload/platform/plugins/telegram/mcp/dist/tools/invoice.js.map +1 -0
- package/payload/platform/plugins/telegram/mcp/dist/tools/media-fetch.d.ts +42 -0
- package/payload/platform/plugins/telegram/mcp/dist/tools/media-fetch.d.ts.map +1 -0
- package/payload/platform/plugins/telegram/mcp/dist/tools/media-fetch.js +92 -0
- package/payload/platform/plugins/telegram/mcp/dist/tools/media-fetch.js.map +1 -0
- package/payload/platform/plugins/telegram/mcp/dist/tools/media-send.d.ts +76 -0
- package/payload/platform/plugins/telegram/mcp/dist/tools/media-send.d.ts.map +1 -0
- package/payload/platform/plugins/telegram/mcp/dist/tools/media-send.js +288 -0
- package/payload/platform/plugins/telegram/mcp/dist/tools/media-send.js.map +1 -0
- package/payload/platform/plugins/telegram/mcp/dist/tools/schemas.d.ts +250 -0
- package/payload/platform/plugins/telegram/mcp/dist/tools/schemas.d.ts.map +1 -0
- package/payload/platform/plugins/telegram/mcp/dist/tools/schemas.js +400 -0
- package/payload/platform/plugins/telegram/mcp/dist/tools/schemas.js.map +1 -0
- package/payload/platform/plugins/telegram/mcp/dist/tools/thread.d.ts +38 -0
- package/payload/platform/plugins/telegram/mcp/dist/tools/thread.d.ts.map +1 -0
- package/payload/platform/plugins/telegram/mcp/dist/tools/thread.js +120 -0
- package/payload/platform/plugins/telegram/mcp/dist/tools/thread.js.map +1 -0
- package/payload/platform/plugins/telegram/mcp/vitest.config.ts +14 -0
- package/payload/platform/plugins/telegram/skills/build/SKILL.md +161 -21
- package/payload/platform/scripts/__tests__/hook-matcher-dispatch.test.sh +163 -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 +6 -1
- 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 +6 -6
- package/payload/server/public/agents.html +5 -5
- package/payload/server/public/assets/{AdminLoginScreens-Bus-Y-rG.js → AdminLoginScreens-Dxv5t1YY.js} +1 -1
- package/payload/server/public/assets/AdminLoginScreens-Dxv5t1YY.js.br +0 -0
- package/payload/server/public/assets/AdminLoginScreens-Dxv5t1YY.js.gz +0 -0
- package/payload/server/public/assets/{AdminShell-Bsm7q3CW.js → AdminShell-BMslfZxN.js} +1 -1
- package/payload/server/public/assets/AdminShell-BMslfZxN.js.br +0 -0
- package/payload/server/public/assets/AdminShell-BMslfZxN.js.gz +0 -0
- package/payload/server/public/assets/{activity-BWqrCyYM.js → activity-kQ3w70LJ.js} +1 -1
- package/payload/server/public/assets/activity-kQ3w70LJ.js.br +0 -0
- package/payload/server/public/assets/activity-kQ3w70LJ.js.gz +0 -0
- package/payload/server/public/assets/{admin-zly7Y6EZ.js → admin-DapcMKCG.js} +1 -1
- package/payload/server/public/assets/admin-DapcMKCG.js.br +0 -0
- package/payload/server/public/assets/admin-DapcMKCG.js.gz +0 -0
- package/payload/server/public/assets/{agents-BsxGD1V1.js → agents-Cn_bZgnD.js} +1 -1
- package/payload/server/public/assets/agents-Cn_bZgnD.js.br +0 -0
- package/payload/server/public/assets/agents-Cn_bZgnD.js.gz +0 -0
- package/payload/server/public/assets/{browser-CRLxTaw2.js → browser-BE-GDk5-.js} +1 -1
- package/payload/server/public/assets/browser-BE-GDk5-.js.br +0 -0
- package/payload/server/public/assets/browser-BE-GDk5-.js.gz +0 -0
- package/payload/server/public/assets/{calendar-Bmp6qI_P.js → calendar-Di7BEHHN.js} +1 -1
- package/payload/server/public/assets/calendar-Di7BEHHN.js.br +0 -0
- package/payload/server/public/assets/calendar-Di7BEHHN.js.gz +0 -0
- package/payload/server/public/assets/chat-DLmikhie.js +1 -0
- package/payload/server/public/assets/chat-DLmikhie.js.br +1 -0
- package/payload/server/public/assets/chat-DLmikhie.js.gz +0 -0
- package/payload/server/public/assets/chevron-left-Id9VAZAz.js +1 -0
- package/payload/server/public/assets/chevron-left-Id9VAZAz.js.br +0 -0
- package/payload/server/public/assets/clock-DKpWWJbJ.js +1 -0
- package/payload/server/public/assets/clock-DKpWWJbJ.js.br +0 -0
- package/payload/server/public/assets/{copy-Bcjpxqzn.js → copy-nkxspu2J.js} +1 -1
- package/payload/server/public/assets/copy-nkxspu2J.js.br +0 -0
- package/payload/server/public/assets/copy-nkxspu2J.js.gz +0 -0
- package/payload/server/public/assets/data-C1_m9Xyf.js +1 -0
- package/payload/server/public/assets/data-C1_m9Xyf.js.br +0 -0
- package/payload/server/public/assets/data-C1_m9Xyf.js.gz +0 -0
- package/payload/server/public/assets/{field-ChKB2l_d.js → field-2rIXxGMt.js} +1 -1
- package/payload/server/public/assets/field-2rIXxGMt.js.br +0 -0
- package/payload/server/public/assets/field-2rIXxGMt.js.gz +0 -0
- package/payload/server/public/assets/{file-text-COZcf7mU.js → file-text-CdSqrscg.js} +1 -1
- package/payload/server/public/assets/file-text-CdSqrscg.js.br +0 -0
- package/payload/server/public/assets/file-text-CdSqrscg.js.gz +0 -0
- package/payload/server/public/assets/{graph-nnV47iqM.js → graph-BfBHHXaC.js} +1 -1
- package/payload/server/public/assets/graph-BfBHHXaC.js.br +0 -0
- package/payload/server/public/assets/graph-BfBHHXaC.js.gz +0 -0
- package/payload/server/public/assets/{graph-labels-x-1MT-3c.js → graph-labels-CHW2aBke.js} +1 -1
- package/payload/server/public/assets/graph-labels-CHW2aBke.js.br +0 -0
- package/payload/server/public/assets/graph-labels-CHW2aBke.js.gz +0 -0
- package/payload/server/public/assets/jsx-runtime-D43jgaWP.css +1 -0
- package/payload/server/public/assets/jsx-runtime-D43jgaWP.css.br +0 -0
- package/payload/server/public/assets/jsx-runtime-D43jgaWP.css.gz +0 -0
- package/payload/server/public/assets/{operator-BAO0-mjU.js → operator-BOiL8sxx.js} +1 -1
- package/payload/server/public/assets/operator-BOiL8sxx.js.br +0 -0
- package/payload/server/public/assets/operator-BOiL8sxx.js.gz +0 -0
- package/payload/server/public/assets/page-CZ6tyH8t.js +1 -0
- package/payload/server/public/assets/page-CZ6tyH8t.js.br +0 -0
- package/payload/server/public/assets/page-CZ6tyH8t.js.gz +0 -0
- package/payload/server/public/assets/{page-B-F08pod.js → page-Cd36Y0h6.js} +1 -1
- package/payload/server/public/assets/page-Cd36Y0h6.js.br +0 -0
- package/payload/server/public/assets/page-Cd36Y0h6.js.gz +0 -0
- package/payload/server/public/assets/play-7LTxCuLX.js +1 -0
- package/payload/server/public/assets/play-7LTxCuLX.js.br +0 -0
- package/payload/server/public/assets/play-7LTxCuLX.js.gz +0 -0
- package/payload/server/public/assets/{public-_HJsUohA.js → public-CVBav4FQ.js} +1 -1
- package/payload/server/public/assets/public-CVBav4FQ.js.br +0 -0
- package/payload/server/public/assets/public-CVBav4FQ.js.gz +0 -0
- package/payload/server/public/assets/{rotate-ccw-DJeAnYLQ.js → rotate-ccw-J9f-GWjm.js} +1 -1
- package/payload/server/public/assets/rotate-ccw-J9f-GWjm.js.br +0 -0
- package/payload/server/public/assets/rotate-ccw-J9f-GWjm.js.gz +0 -0
- package/payload/server/public/assets/{routines-CoIVXRCB.js → routines-C1AB-3FR.js} +1 -1
- package/payload/server/public/assets/routines-C1AB-3FR.js.br +0 -0
- package/payload/server/public/assets/routines-C1AB-3FR.js.gz +0 -0
- package/payload/server/public/assets/{skills-BjHt5lDG.js → skills-C4EfNKEx.js} +1 -1
- package/payload/server/public/assets/skills-C4EfNKEx.js.br +0 -0
- package/payload/server/public/assets/skills-C4EfNKEx.js.gz +0 -0
- package/payload/server/public/assets/{tasks-iUFfeA9_.js → tasks-DszD3aZl.js} +1 -1
- package/payload/server/public/assets/tasks-DszD3aZl.js.br +0 -0
- package/payload/server/public/assets/tasks-DszD3aZl.js.gz +0 -0
- package/payload/server/public/assets/{triangle-alert-Dwa986Gg.js → triangle-alert-B5WAyAkC.js} +1 -1
- package/payload/server/public/assets/triangle-alert-B5WAyAkC.js.br +4 -0
- package/payload/server/public/assets/triangle-alert-B5WAyAkC.js.gz +0 -0
- package/payload/server/public/assets/{useCopyFeedback-B1Jp6CsE.js → useCopyFeedback-B2nuNNJw.js} +1 -1
- package/payload/server/public/assets/useCopyFeedback-B2nuNNJw.js.br +0 -0
- package/payload/server/public/assets/useCopyFeedback-B2nuNNJw.js.gz +0 -0
- package/payload/server/public/assets/{useMediaQuery-CVZYjRf6.js → useMediaQuery-DUPJPHQt.js} +1 -1
- package/payload/server/public/assets/useMediaQuery-DUPJPHQt.js.br +0 -0
- package/payload/server/public/assets/useMediaQuery-DUPJPHQt.js.gz +0 -0
- package/payload/server/public/assets/{useVoiceRecorder-D5b4r4z0.js → useVoiceRecorder-BEgr0nHN.js} +1 -1
- package/payload/server/public/assets/useVoiceRecorder-BEgr0nHN.js.br +0 -0
- package/payload/server/public/assets/useVoiceRecorder-BEgr0nHN.js.gz +0 -0
- package/payload/server/public/assets/{wrench-BD7xwbV1.js → wrench-DZJZm17j.js} +1 -1
- package/payload/server/public/assets/wrench-DZJZm17j.js.br +0 -0
- package/payload/server/public/assets/wrench-DZJZm17j.js.gz +0 -0
- package/payload/server/public/browser.html +5 -5
- package/payload/server/public/calendar.html +8 -8
- package/payload/server/public/chat.html +14 -14
- package/payload/server/public/data.html +12 -12
- package/payload/server/public/field.html +3 -3
- package/payload/server/public/graph.html +10 -10
- package/payload/server/public/index.html +14 -14
- package/payload/server/public/operator.html +15 -15
- package/payload/server/public/public.html +14 -14
- package/payload/server/public/routines.html +8 -8
- package/payload/server/public/skills.html +6 -6
- package/payload/server/public/tasks.html +7 -7
- package/payload/server/server.js +965 -687
- package/payload/server/public/assets/AdminLoginScreens-Bus-Y-rG.js.br +0 -0
- package/payload/server/public/assets/AdminLoginScreens-Bus-Y-rG.js.gz +0 -0
- package/payload/server/public/assets/AdminShell-Bsm7q3CW.js.br +0 -0
- package/payload/server/public/assets/AdminShell-Bsm7q3CW.js.gz +0 -0
- package/payload/server/public/assets/activity-BWqrCyYM.js.br +0 -0
- package/payload/server/public/assets/activity-BWqrCyYM.js.gz +0 -0
- package/payload/server/public/assets/admin-zly7Y6EZ.js.br +0 -0
- package/payload/server/public/assets/admin-zly7Y6EZ.js.gz +0 -0
- package/payload/server/public/assets/agents-BsxGD1V1.js.br +0 -0
- package/payload/server/public/assets/agents-BsxGD1V1.js.gz +0 -0
- package/payload/server/public/assets/browser-CRLxTaw2.js.br +0 -0
- package/payload/server/public/assets/browser-CRLxTaw2.js.gz +0 -0
- package/payload/server/public/assets/calendar-Bmp6qI_P.js.br +0 -0
- package/payload/server/public/assets/calendar-Bmp6qI_P.js.gz +0 -0
- package/payload/server/public/assets/chat-ChObDKHy.js +0 -1
- package/payload/server/public/assets/chat-ChObDKHy.js.br +0 -0
- package/payload/server/public/assets/chat-ChObDKHy.js.gz +0 -0
- package/payload/server/public/assets/chevron-left-D2l4jMcd.js +0 -1
- package/payload/server/public/assets/chevron-left-D2l4jMcd.js.br +0 -0
- package/payload/server/public/assets/clock-CMdfsroW.js +0 -1
- package/payload/server/public/assets/clock-CMdfsroW.js.br +0 -0
- package/payload/server/public/assets/clock-CMdfsroW.js.gz +0 -0
- package/payload/server/public/assets/copy-Bcjpxqzn.js.br +0 -0
- package/payload/server/public/assets/copy-Bcjpxqzn.js.gz +0 -0
- package/payload/server/public/assets/data-CFB5Lgw-.js +0 -1
- package/payload/server/public/assets/data-CFB5Lgw-.js.br +0 -0
- package/payload/server/public/assets/data-CFB5Lgw-.js.gz +0 -0
- package/payload/server/public/assets/field-ChKB2l_d.js.br +0 -0
- package/payload/server/public/assets/field-ChKB2l_d.js.gz +0 -0
- package/payload/server/public/assets/file-text-COZcf7mU.js.br +0 -0
- package/payload/server/public/assets/file-text-COZcf7mU.js.gz +0 -0
- package/payload/server/public/assets/graph-labels-x-1MT-3c.js.br +0 -0
- package/payload/server/public/assets/graph-labels-x-1MT-3c.js.gz +0 -0
- package/payload/server/public/assets/graph-nnV47iqM.js.br +0 -0
- package/payload/server/public/assets/graph-nnV47iqM.js.gz +0 -0
- package/payload/server/public/assets/jsx-runtime-CeNZasfC.css +0 -1
- package/payload/server/public/assets/jsx-runtime-CeNZasfC.css.br +0 -0
- package/payload/server/public/assets/jsx-runtime-CeNZasfC.css.gz +0 -0
- package/payload/server/public/assets/operator-BAO0-mjU.js.br +0 -0
- package/payload/server/public/assets/operator-BAO0-mjU.js.gz +0 -0
- package/payload/server/public/assets/page-B-F08pod.js.br +0 -0
- package/payload/server/public/assets/page-B-F08pod.js.gz +0 -0
- package/payload/server/public/assets/page-BMOCy2aD.js +0 -1
- package/payload/server/public/assets/page-BMOCy2aD.js.br +0 -0
- package/payload/server/public/assets/page-BMOCy2aD.js.gz +0 -0
- package/payload/server/public/assets/play-DFtlk8Zs.js +0 -1
- package/payload/server/public/assets/play-DFtlk8Zs.js.br +0 -0
- package/payload/server/public/assets/play-DFtlk8Zs.js.gz +0 -0
- package/payload/server/public/assets/public-_HJsUohA.js.br +0 -0
- package/payload/server/public/assets/public-_HJsUohA.js.gz +0 -0
- package/payload/server/public/assets/rotate-ccw-DJeAnYLQ.js.br +0 -0
- package/payload/server/public/assets/rotate-ccw-DJeAnYLQ.js.gz +0 -0
- package/payload/server/public/assets/routines-CoIVXRCB.js.br +0 -0
- package/payload/server/public/assets/routines-CoIVXRCB.js.gz +0 -0
- package/payload/server/public/assets/skills-BjHt5lDG.js.br +0 -0
- package/payload/server/public/assets/skills-BjHt5lDG.js.gz +0 -0
- package/payload/server/public/assets/tasks-iUFfeA9_.js.br +0 -0
- package/payload/server/public/assets/tasks-iUFfeA9_.js.gz +0 -0
- package/payload/server/public/assets/triangle-alert-Dwa986Gg.js.br +0 -0
- package/payload/server/public/assets/triangle-alert-Dwa986Gg.js.gz +0 -0
- package/payload/server/public/assets/useCopyFeedback-B1Jp6CsE.js.br +0 -0
- package/payload/server/public/assets/useCopyFeedback-B1Jp6CsE.js.gz +0 -0
- package/payload/server/public/assets/useMediaQuery-CVZYjRf6.js.br +0 -0
- package/payload/server/public/assets/useMediaQuery-CVZYjRf6.js.gz +0 -0
- package/payload/server/public/assets/useVoiceRecorder-D5b4r4z0.js.br +0 -0
- package/payload/server/public/assets/useVoiceRecorder-D5b4r4z0.js.gz +0 -0
- package/payload/server/public/assets/wrench-BD7xwbV1.js.br +0 -0
- package/payload/server/public/assets/wrench-BD7xwbV1.js.gz +0 -0
- /package/payload/server/public/assets/{jsx-runtime-CjJ246F7.js → jsx-runtime-Cjug_Cyb.js} +0 -0
- /package/payload/server/public/assets/{jsx-runtime-CjJ246F7.js.br → jsx-runtime-Cjug_Cyb.js.br} +0 -0
- /package/payload/server/public/assets/{jsx-runtime-CjJ246F7.js.gz → jsx-runtime-Cjug_Cyb.js.gz} +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: build
|
|
3
|
-
description: Build your own Telegram functionality on this install — cards with buttons, editing a card in place, answering a button press, opening a Mini App inside the chat,
|
|
3
|
+
description: Build your own Telegram functionality on this install — cards with buttons, editing a card in place, answering a button press, opening a Mini App inside the chat, sending and fetching files, polls and locations, invoices and Telegram Stars, threading a chat per job, and reaching any of the 185 Bot API methods through telegram-api. Use when the operator wants Telegram to do something the named tools do not already do.
|
|
4
4
|
---
|
|
5
5
|
|
|
6
6
|
# Build a Telegram surface
|
|
@@ -17,11 +17,16 @@ and this skill says how to call it.
|
|
|
17
17
|
|
|
18
18
|
## What you have
|
|
19
19
|
|
|
20
|
-
|
|
20
|
+
Ten named tools for the common paths, and one passthrough for everything else.
|
|
21
21
|
|
|
22
22
|
| Tool | Use it for |
|
|
23
23
|
|---|---|
|
|
24
|
-
| `
|
|
24
|
+
| `mcp__telegram__telegram-card` | Posting a card, or editing the one your key already names |
|
|
25
|
+
| `mcp__telegram__telegram-ask` | Polls, checklists, locations, venues, contacts, dice |
|
|
26
|
+
| `mcp__telegram__telegram-media-send` | Sending a photo, file, video, audio or album, and editing media or captions |
|
|
27
|
+
| `mcp__telegram__telegram-media-fetch` | Fetching a file by `file_id` |
|
|
28
|
+
| `mcp__telegram__telegram-invoice` | Invoices, invoice links, checkout answers, Telegram Stars |
|
|
29
|
+
| `mcp__telegram__telegram-thread` | Forum topics, one thread per job |
|
|
25
30
|
| `mcp__telegram__message-history` | Reading what arrived |
|
|
26
31
|
| `mcp__telegram__telegram-webhook-register` | Registering a bot's webhook. The only sanctioned path |
|
|
27
32
|
| `mcp__telegram__telegram-menu-button` | The permanent Mini App button in a bot's chats |
|
|
@@ -45,42 +50,60 @@ Each refusal names the tool that owns the capability instead.
|
|
|
45
50
|
|
|
46
51
|
### 1. A card with buttons
|
|
47
52
|
|
|
48
|
-
Use `
|
|
53
|
+
Use `telegram-card` with `buttons`. `callbackData` is what comes back on a press, capped by
|
|
49
54
|
Telegram at 1 to 64 bytes; longer data is refused with nothing in our logs to explain it. Put an id
|
|
50
55
|
in it, not a sentence.
|
|
51
56
|
|
|
52
57
|
```
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
58
|
+
telegram-card botId=<id> chatId=<chat> text="Job 4102, Ladywell Prospect"
|
|
59
|
+
buttons=[[{text:"Accept", callbackData:"j4102:accept"},
|
|
60
|
+
{text:"On site", callbackData:"j4102:onsite"}]]
|
|
56
61
|
```
|
|
57
62
|
|
|
58
63
|
### 2. Changing that card in place
|
|
59
64
|
|
|
60
|
-
|
|
65
|
+
Give the same card a `key` and every later call edits it instead of stacking a new one below:
|
|
61
66
|
|
|
62
67
|
```
|
|
63
|
-
telegram-
|
|
64
|
-
|
|
65
|
-
|
|
68
|
+
telegram-card botId=<id> chatId=<chat> key="j4102" text="Job 4102, Ladywell Prospect"
|
|
69
|
+
telegram-card botId=<id> chatId=<chat> key="j4102" text="Job 4102 — on site"
|
|
70
|
+
buttons=[[{text:"Complete", callbackData:"j4102:done"}]]
|
|
66
71
|
```
|
|
67
72
|
|
|
73
|
+
The first call posts and remembers the message id; the second edits it. The key is scoped to that
|
|
74
|
+
bot and chat, so the same key in another chat is another card.
|
|
75
|
+
|
|
68
76
|
Telegram answers `ok:false` with `Bad Request: message is not modified` when the new text and markup
|
|
69
|
-
are identical to the old.
|
|
77
|
+
are identical to the old. `telegram-card` reports that as `outcome=unchanged` and returns success,
|
|
78
|
+
not an error: re-posting an idempotent card is the normal case, not a failure to retry.
|
|
79
|
+
|
|
80
|
+
A card Telegram will no longer edit answers `ok:false` with `Bad Request: message to edit not found`.
|
|
81
|
+
`telegram-card` relays that as an error rather than silently posting a new card: the same string
|
|
82
|
+
comes back for messages Telegram simply refuses to edit, not only for deleted ones, so a
|
|
83
|
+
clear-and-repost would post a duplicate on every call instead of surfacing one failure. Recover by
|
|
84
|
+
calling again with no `key` for a one-off, or with a new `key` for a card you will keep editing.
|
|
85
|
+
|
|
86
|
+
A key untouched for 7 days stops being edited in place: the next call with it posts fresh and starts
|
|
87
|
+
a new card. Every post or successful edit resets that clock, so a card you touch daily never expires
|
|
88
|
+
underneath you. The ceiling is what keeps `telegram-cards.json` bounded, and it is why a card whose
|
|
89
|
+
message was deleted heals on its own inside a week with nobody clearing anything.
|
|
70
90
|
|
|
71
91
|
### 3. Answering the press
|
|
72
92
|
|
|
73
93
|
A press spins Telegram's own progress indicator for 15 seconds unless the bot answers. On this
|
|
74
94
|
install the inbound route already answers every press, including refusals, so you do not normally
|
|
75
|
-
call this yourself. When you build a surface that answers out of band,
|
|
76
|
-
`
|
|
77
|
-
|
|
95
|
+
call this yourself. When you build a surface that answers out of band, pass `callbackQueryId` to
|
|
96
|
+
`telegram-card` and set `alert` to turn the toast into a dialog.
|
|
97
|
+
|
|
98
|
+
`telegram-card` answers the press **after** it posts or edits the card. Telegram refuses a callback
|
|
99
|
+
id older than its window, and answering first would let a stale id block the card update, which is
|
|
100
|
+
the work that matters. A failed answer is still reported, alongside what the send achieved.
|
|
78
101
|
|
|
79
102
|
### 4. A Mini App inside the chat
|
|
80
103
|
|
|
81
104
|
A `url` button sends the person out to the device browser, where Telegram passes no identity at all.
|
|
82
105
|
A `web_app` button opens the page inside Telegram and hands it `initData`. Use `webAppUrl` on a
|
|
83
|
-
`
|
|
106
|
+
`telegram-card` button, or `telegram-menu-button` for a permanent one.
|
|
84
107
|
|
|
85
108
|
Verify `initData` server-side before trusting a single field of it: the `hash` parameter is an
|
|
86
109
|
HMAC-SHA-256 of the data-check-string, keyed by the HMAC-SHA-256 of the bot token with the constant
|
|
@@ -89,15 +112,118 @@ implementation on this install is the field sheet's route; read it rather than w
|
|
|
89
112
|
|
|
90
113
|
### 5. Sending a file
|
|
91
114
|
|
|
92
|
-
`
|
|
93
|
-
|
|
115
|
+
`telegram-media-send` reaches Telegram all three documented ways, and you say which by which field
|
|
116
|
+
you fill. Exactly one of the three, never two:
|
|
117
|
+
|
|
118
|
+
```
|
|
119
|
+
telegram-media-send botId=<id> chatId=<chat> kind=photo filePath="/abs/path/before.jpg"
|
|
120
|
+
caption="Before"
|
|
121
|
+
telegram-media-send botId=<id> chatId=<chat> kind=photo fileId=<file_id from an earlier message>
|
|
122
|
+
telegram-media-send botId=<id> chatId=<chat> kind=document url="https://example.com/spec.pdf"
|
|
123
|
+
```
|
|
124
|
+
|
|
125
|
+
A `file_id` Telegram gave you earlier is always cheaper than re-uploading the same bytes. A URL has
|
|
126
|
+
Telegram fetch the file itself, so the bytes never leave the origin through us.
|
|
127
|
+
|
|
128
|
+
An album is 2 to 10 items and mixes the three freely; any local path in it sends the whole album as
|
|
129
|
+
one multipart request:
|
|
130
|
+
|
|
131
|
+
```
|
|
132
|
+
telegram-media-send botId=<id> chatId=<chat> kind=group
|
|
133
|
+
items=[{type:"photo", filePath:"/abs/1.jpg", caption:"Before"},
|
|
134
|
+
{type:"photo", filePath:"/abs/2.jpg"},
|
|
135
|
+
{type:"photo", fileId:<file_id>}]
|
|
136
|
+
```
|
|
137
|
+
|
|
138
|
+
`editCaption` changes a caption in place and `editMedia` swaps the file itself, which needs
|
|
139
|
+
`mediaType` because Telegram's media object carries its own type where a send method's name supplies
|
|
140
|
+
it. One exception worth knowing: Telegram does not accept a video note by URL, so `kind=videoNote`
|
|
141
|
+
with `url` is refused here rather than 400ing on the wire.
|
|
142
|
+
|
|
143
|
+
### 6. Reading a file someone sent you
|
|
144
|
+
|
|
145
|
+
Files attached to an inbound message are already downloaded and their paths are on the turn; just
|
|
146
|
+
`Read` them. `telegram-media-fetch` is for a `file_id` you learned about later:
|
|
147
|
+
|
|
148
|
+
```
|
|
149
|
+
telegram-media-fetch botId=<id> fileId=<file_id from the message>
|
|
150
|
+
```
|
|
151
|
+
|
|
152
|
+
It saves to `/tmp/maxy-media` and returns the absolute path. Telegram's `getFile` refuses above
|
|
153
|
+
20 MB and says so; that refusal is relayed to you verbatim.
|
|
154
|
+
|
|
155
|
+
### 7. A thread per job
|
|
156
|
+
|
|
157
|
+
`telegram-thread` creates a forum topic, so one chat carries a separate thread per job:
|
|
158
|
+
|
|
159
|
+
```
|
|
160
|
+
telegram-thread botId=<id> chatId=<chat> action=create name="Job 4102"
|
|
161
|
+
telegram-thread botId=<id> chatId=<chat> action=close messageThreadId=<id create returned>
|
|
162
|
+
```
|
|
163
|
+
|
|
164
|
+
Telegram allows a topic in a forum supergroup **or in a private chat with a user**. The private-chat
|
|
165
|
+
form needs forum topic mode enabled on the bot: `sendMessage`'s `message_thread_id` is documented as
|
|
166
|
+
working "for forum supergroups and private chats of bots with forum topic mode enabled only", so
|
|
167
|
+
without it the topic exists and nothing can be sent into it.
|
|
168
|
+
|
|
169
|
+
### 8. Asking a question, or sending a place
|
|
170
|
+
|
|
171
|
+
`telegram-ask` covers the structured sends. A poll takes its answers as plain strings:
|
|
172
|
+
|
|
173
|
+
```
|
|
174
|
+
telegram-ask botId=<id> chatId=<chat> kind=poll question="Which slot suits?"
|
|
175
|
+
options=["9am","2pm","Either"]
|
|
176
|
+
```
|
|
177
|
+
|
|
178
|
+
A quiz is the same call with `pollType=quiz` and `correctOptionIds`. `stopPoll` closes one you sent,
|
|
179
|
+
by `messageId`.
|
|
180
|
+
|
|
181
|
+
A live location is a pin that keeps moving. Send it with `livePeriod` in seconds, then move it with
|
|
182
|
+
`editLiveLocation` and end it with `stopLiveLocation`, both addressing the same `messageId`:
|
|
94
183
|
|
|
95
184
|
```
|
|
96
|
-
telegram-
|
|
97
|
-
|
|
185
|
+
telegram-ask botId=<id> chatId=<chat> kind=location latitude=51.5074 longitude=-0.1278
|
|
186
|
+
livePeriod=3600
|
|
187
|
+
telegram-ask botId=<id> chatId=<chat> kind=editLiveLocation messageId=<id> latitude=51.51
|
|
188
|
+
longitude=-0.13
|
|
98
189
|
```
|
|
99
190
|
|
|
100
|
-
|
|
191
|
+
`venue`, `contact` and `dice` are one call each. The two checklist kinds need
|
|
192
|
+
`businessConnectionId`: Telegram sends a checklist only on behalf of a connected business account,
|
|
193
|
+
and refuses without it.
|
|
194
|
+
|
|
195
|
+
### 9. Charging for something
|
|
196
|
+
|
|
197
|
+
`telegram-invoice` takes Telegram Stars with `currency=XTR` and no provider token, or a real
|
|
198
|
+
currency through a token from BotFather. Amounts are whole numbers in the currency's smallest unit,
|
|
199
|
+
so £4.50 is 450 and a 500-star price is 500.
|
|
200
|
+
|
|
201
|
+
```
|
|
202
|
+
telegram-invoice botId=<id> action=send chatId=<chat> title="Emergency callout"
|
|
203
|
+
description="Same-day attendance, first hour" payload="job-4102" currency="XTR"
|
|
204
|
+
prices=[{label:"Callout", amount:500}]
|
|
205
|
+
```
|
|
206
|
+
|
|
207
|
+
`action=link` returns a payable URL instead of posting into a chat, which is what you want for a
|
|
208
|
+
link you paste somewhere else. Don't pass buttons: Telegram requires the first button of an invoice
|
|
209
|
+
keyboard to be a Pay button, and leaving the keyboard off gets that button for free.
|
|
210
|
+
|
|
211
|
+
`payload` is your own reference. It is never shown to the payer and it comes back on the
|
|
212
|
+
successful-payment update, which is how a payment is matched to a job.
|
|
213
|
+
|
|
214
|
+
Set `isFlexible` and Telegram sends a shipping query mid-checkout; answer it with
|
|
215
|
+
`action=answerShipping`, and answer the pre-checkout query that follows within ten seconds with
|
|
216
|
+
`action=answerPreCheckout`. `ok=false` on either needs `errorMessage`, which Telegram shows the
|
|
217
|
+
payer verbatim. `balance`, `transactions`, `refund` and `editSubscription` are the Stars controls.
|
|
218
|
+
|
|
219
|
+
### Ephemeral messages
|
|
220
|
+
|
|
221
|
+
There is no `sendEphemeralMessage`. Ephemerality is a parameter, not a method: Bot API 10.2 added
|
|
222
|
+
`receiver_user_id` and `callback_query_id` to `sendMessage`, `sendPhoto`, `sendDocument` and ten
|
|
223
|
+
other send methods. The resulting message has `message_id: 0` and carries its identity in
|
|
224
|
+
`ephemeral_message_id`, which is what `editEphemeralMessageText` and `deleteEphemeralMessage`
|
|
225
|
+
address. Send one through `telegram-api`; no named tool covers it, because nothing on this install
|
|
226
|
+
sends group messages visible to a single user.
|
|
101
227
|
|
|
102
228
|
## Reading the method list
|
|
103
229
|
|
|
@@ -108,3 +234,17 @@ is what exists, not what each one takes.
|
|
|
108
234
|
|
|
109
235
|
A method absent from that list is still relayed, so a method Telegram adds after this list was taken
|
|
110
236
|
works without waiting for a release here. `telegram-api-census` is what reports the gap.
|
|
237
|
+
|
|
238
|
+
### What stays in the passthrough, and why
|
|
239
|
+
|
|
240
|
+
Named tools own the conversation, structured-input, media-in, media-out, payments and threading
|
|
241
|
+
buckets: 39 methods in all. These stay on `telegram-api` deliberately, because they are config-time
|
|
242
|
+
rather than per-turn: membership (23 methods), business-account (12), bot-self-config (19, including
|
|
243
|
+
the four managed-bot token methods), org-verification (4) and chat-cosmetic (6).
|
|
244
|
+
|
|
245
|
+
These are out of scope for this install altogether and will not get a tool: stickers (16),
|
|
246
|
+
gifts and stars (12), transport (6), games (3), passport (1).
|
|
247
|
+
|
|
248
|
+
A handful of fields on owned methods are not exposed by their tool, because nothing here sets them:
|
|
249
|
+
message entities, thumbnails, suggested-post parameters, message effects, provider data, and the
|
|
250
|
+
per-message ephemeral parameters. Reach those through `telegram-api`, naming the method directly.
|
|
@@ -0,0 +1,163 @@
|
|
|
1
|
+
#!/usr/bin/env bash
|
|
2
|
+
# Task 2545 — a hook registered on a literal tool-name matcher in
|
|
3
|
+
# account-settings.json must name that tool in its own dispatch.
|
|
4
|
+
#
|
|
5
|
+
# Three hooks were registered on a matcher they sent straight to a catch-all
|
|
6
|
+
# unread, so the fences they enforce were reachable by choosing the other write
|
|
7
|
+
# tool. The registration side cannot see it: the reconcile's hookRegistration
|
|
8
|
+
# audit checks that a hook IS registered for a matcher, never that it reads it.
|
|
9
|
+
#
|
|
10
|
+
# The rule: a hook that gates on an explicit set of LITERAL tool names must
|
|
11
|
+
# carry, in that set, every literal matcher it is registered on.
|
|
12
|
+
#
|
|
13
|
+
# - A matcher is literal when it is one tool name with no regex metacharacter.
|
|
14
|
+
# An alternation matcher is split on `|` and each literal part checked.
|
|
15
|
+
# Regex matchers and matcher-less entries name no tool, so they are skipped.
|
|
16
|
+
# - A hook's literal set is read from four constructs: bash
|
|
17
|
+
# `case "$TOOL_NAME" in <arms>`, bash `[ "$TOOL_NAME" = "X" ]` and `!=`,
|
|
18
|
+
# embedded-python `== "X"` / `!= "X"` against tool_name, and embedded-python
|
|
19
|
+
# `in` / `not in ("A", "B")`. A case arm carrying a glob is not a literal.
|
|
20
|
+
# - A hook whose set comes out empty gates on no literal set at all: it either
|
|
21
|
+
# matches by suffix or reads the name only to log it, so it acts on whatever
|
|
22
|
+
# it is registered for and there is nothing here to compare. Skipped.
|
|
23
|
+
#
|
|
24
|
+
# Comments are stripped before the scan. A tool name in a header paragraph is
|
|
25
|
+
# prose, not dispatch, and counting it would report green on a hook that still
|
|
26
|
+
# exits 0 unread.
|
|
27
|
+
#
|
|
28
|
+
# The pair count and the pin below exist because a check that passes on a zero
|
|
29
|
+
# count cannot tell healthy from not-measuring: a refactor that made every hook
|
|
30
|
+
# unparseable would otherwise report success having compared nothing.
|
|
31
|
+
set -uo pipefail
|
|
32
|
+
DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
|
|
33
|
+
PLATFORM="$DIR/../.."
|
|
34
|
+
SETTINGS="$PLATFORM/templates/account-settings.json"
|
|
35
|
+
[ -f "$SETTINGS" ] || { echo "FAIL: $SETTINGS is missing" >&2; exit 1; }
|
|
36
|
+
|
|
37
|
+
python3 - "$SETTINGS" "$PLATFORM" <<'PY'
|
|
38
|
+
import json, os, re, sys
|
|
39
|
+
|
|
40
|
+
settings_path, platform_root = sys.argv[1], sys.argv[2]
|
|
41
|
+
settings = json.load(open(settings_path, encoding="utf-8"))
|
|
42
|
+
|
|
43
|
+
LITERAL = re.compile(r"\A[A-Za-z0-9_-]+\Z")
|
|
44
|
+
# The one hook this check was written for. If a refactor makes its dispatch
|
|
45
|
+
# unreadable to the parser below, coverage is lost silently; this pin says so.
|
|
46
|
+
PINNED = "fs-schema-guard.sh"
|
|
47
|
+
|
|
48
|
+
|
|
49
|
+
def strip_comments(src):
|
|
50
|
+
keep = []
|
|
51
|
+
for line in src.splitlines():
|
|
52
|
+
s = line.lstrip()
|
|
53
|
+
keep.append("" if s.startswith("#") or s.startswith("//") else line)
|
|
54
|
+
return "\n".join(keep)
|
|
55
|
+
|
|
56
|
+
|
|
57
|
+
def tool_case_blocks(src):
|
|
58
|
+
"""Body text of every `case "$TOOL_NAME" in` block, depth-counted so a nested
|
|
59
|
+
case on a different variable cannot end the scan at the wrong esac."""
|
|
60
|
+
blocks = []
|
|
61
|
+
for m in re.finditer(r'case\s+"\$TOOL_NAME"\s+in', src):
|
|
62
|
+
start, depth, end = m.end(), 1, len(src)
|
|
63
|
+
for t in re.finditer(r"\bcase\b|\besac\b", src[start:]):
|
|
64
|
+
depth += 1 if t.group() == "case" else -1
|
|
65
|
+
if depth == 0:
|
|
66
|
+
end = start + t.start()
|
|
67
|
+
break
|
|
68
|
+
blocks.append(src[start:end])
|
|
69
|
+
return blocks
|
|
70
|
+
|
|
71
|
+
|
|
72
|
+
def literal_tool_names(src):
|
|
73
|
+
"""Every literal tool name the source gates on. Empty means it gates on no
|
|
74
|
+
literal set."""
|
|
75
|
+
names = set()
|
|
76
|
+
|
|
77
|
+
def add(word):
|
|
78
|
+
w = word.strip().strip('"').strip("'")
|
|
79
|
+
if LITERAL.match(w):
|
|
80
|
+
names.add(w)
|
|
81
|
+
|
|
82
|
+
for block in tool_case_blocks(src):
|
|
83
|
+
for arm in re.finditer(r"(?:\A|;;)\s*\(?\s*([^()\n;]+?)\)", block):
|
|
84
|
+
for part in arm.group(1).split("|"):
|
|
85
|
+
add(part)
|
|
86
|
+
|
|
87
|
+
for m in re.finditer(r'"\$TOOL_NAME"\s*(?:!=|==|=)\s*"?([A-Za-z0-9_-]+)"?', src):
|
|
88
|
+
add(m.group(1))
|
|
89
|
+
|
|
90
|
+
for line in src.splitlines():
|
|
91
|
+
if "tool_name" not in line:
|
|
92
|
+
continue
|
|
93
|
+
for m in re.finditer(r'tool_name.*?(?:==|!=)\s*"([^"]+)"', line):
|
|
94
|
+
add(m.group(1))
|
|
95
|
+
for m in re.finditer(r"tool_name.*?\b(?:not\s+in|in)\s*\(([^)]*)\)", line):
|
|
96
|
+
for q in re.findall(r'"([^"]*)"', m.group(1)):
|
|
97
|
+
add(q)
|
|
98
|
+
return names
|
|
99
|
+
|
|
100
|
+
|
|
101
|
+
def literal_matchers(matcher):
|
|
102
|
+
"""Literal tool names a matcher string names. A regex part names none."""
|
|
103
|
+
if not matcher:
|
|
104
|
+
return []
|
|
105
|
+
return [p for p in matcher.split("|") if LITERAL.match(p)]
|
|
106
|
+
|
|
107
|
+
|
|
108
|
+
sources = {}
|
|
109
|
+
pairs = 0
|
|
110
|
+
skipped_hooks = set()
|
|
111
|
+
failures = []
|
|
112
|
+
|
|
113
|
+
for event, entries in settings.get("hooks", {}).items():
|
|
114
|
+
for entry in entries:
|
|
115
|
+
tools = literal_matchers(entry.get("matcher", ""))
|
|
116
|
+
if not tools:
|
|
117
|
+
continue
|
|
118
|
+
for hook in entry.get("hooks", []):
|
|
119
|
+
cmd = hook.get("command", "")
|
|
120
|
+
m = re.search(r"\$PLATFORM_ROOT/(\S+)", cmd)
|
|
121
|
+
if not m:
|
|
122
|
+
continue
|
|
123
|
+
rel = m.group(1)
|
|
124
|
+
path = os.path.join(platform_root, rel)
|
|
125
|
+
name = os.path.basename(rel)
|
|
126
|
+
# Keyed on the path, not the basename: two plugins may each ship a
|
|
127
|
+
# hook of the same name, and reusing one's parsed set for the other
|
|
128
|
+
# would report on a file that was never read.
|
|
129
|
+
if rel not in sources:
|
|
130
|
+
try:
|
|
131
|
+
sources[rel] = literal_tool_names(
|
|
132
|
+
strip_comments(open(path, encoding="utf-8").read())
|
|
133
|
+
)
|
|
134
|
+
except OSError:
|
|
135
|
+
failures.append(f"{name}: registered in {event} but not readable at {path}")
|
|
136
|
+
sources[rel] = set()
|
|
137
|
+
gated = sources[rel]
|
|
138
|
+
if not gated:
|
|
139
|
+
skipped_hooks.add(rel)
|
|
140
|
+
continue
|
|
141
|
+
for tool in tools:
|
|
142
|
+
pairs += 1
|
|
143
|
+
if tool not in gated:
|
|
144
|
+
failures.append(
|
|
145
|
+
f"{name}: registered on {event} matcher '{tool}' but its dispatch "
|
|
146
|
+
f"names only {sorted(gated)} — every '{tool}' reaches the catch-all unread"
|
|
147
|
+
)
|
|
148
|
+
|
|
149
|
+
for f in failures:
|
|
150
|
+
print(f"FAIL: {f}", file=sys.stderr)
|
|
151
|
+
|
|
152
|
+
print(f"[hook-matcher-dispatch] pairs={pairs} literal-set-hooks={len(sources) - len(skipped_hooks)} "
|
|
153
|
+
f"skipped={len(skipped_hooks)} failures={len(failures)}")
|
|
154
|
+
|
|
155
|
+
if pairs == 0:
|
|
156
|
+
print("FAIL: no (hook, matcher) pair was compared — the parser reads nothing", file=sys.stderr)
|
|
157
|
+
sys.exit(1)
|
|
158
|
+
compared = {os.path.basename(r) for r in sources if r not in skipped_hooks}
|
|
159
|
+
if PINNED not in compared:
|
|
160
|
+
print(f"FAIL: {PINNED} was not compared against any matcher — coverage lost", file=sys.stderr)
|
|
161
|
+
sys.exit(1)
|
|
162
|
+
sys.exit(1 if failures else 0)
|
|
163
|
+
PY
|
|
@@ -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,EA2B7C,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,EA2B7C,CAAA;AAED,gEAAgE;AAChE,eAAO,MAAM,yBAAyB,EAAE,SAAS,MAAM,EAkXtD,CAAA"}
|
package/payload/platform/services/claude-session-manager/dist/canonical-tool-names.generated.js
CHANGED
|
@@ -353,11 +353,16 @@ export const CANONICAL_MAXY_TOOL_NAMES = [
|
|
|
353
353
|
"mcp__plugin_storage-broker_storage-broker__storage-r2-object-get",
|
|
354
354
|
"mcp__plugin_storage-broker_storage-broker__storage-r2-object-list",
|
|
355
355
|
"mcp__plugin_storage-broker_storage-broker__storage-r2-object-put",
|
|
356
|
-
"mcp__plugin_telegram_telegram__message",
|
|
357
356
|
"mcp__plugin_telegram_telegram__message-history",
|
|
358
357
|
"mcp__plugin_telegram_telegram__telegram-api",
|
|
359
358
|
"mcp__plugin_telegram_telegram__telegram-api-census",
|
|
359
|
+
"mcp__plugin_telegram_telegram__telegram-ask",
|
|
360
|
+
"mcp__plugin_telegram_telegram__telegram-card",
|
|
361
|
+
"mcp__plugin_telegram_telegram__telegram-invoice",
|
|
362
|
+
"mcp__plugin_telegram_telegram__telegram-media-fetch",
|
|
363
|
+
"mcp__plugin_telegram_telegram__telegram-media-send",
|
|
360
364
|
"mcp__plugin_telegram_telegram__telegram-menu-button",
|
|
365
|
+
"mcp__plugin_telegram_telegram__telegram-thread",
|
|
361
366
|
"mcp__plugin_telegram_telegram__telegram-webhook-register",
|
|
362
367
|
"mcp__plugin_url-get_url-get__url-get",
|
|
363
368
|
"mcp__plugin_voice-mirror_voice-mirror__voice-distil-profile",
|
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,OAAO;IACP,KAAK;IACL,SAAS;IACT,WAAW;IACX,UAAU;IACV,UAAU;IACV,OAAO;IACP,YAAY;IACZ,QAAQ;IACR,OAAO;IACP,cAAc;IACd,WAAW;IACX,UAAU;IACV,QAAQ;IACR,QAAQ;IACR,SAAS;IACT,YAAY;IACZ,WAAW;IAC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D;IAChD,0CAA0C;IAC1C,0CAA0C;IAC1C,kDAAkD;IAClD,yCAAyC;IACzC,kDAAkD;IAClD,2CAA2C;IAC3C,yCAAyC;IACzC,2CAA2C;IAC3C,4CAA4C;IAC5C,mDAAmD;IACnD,uDAAuD;IACvD,4DAA4D;IAC5D,sDAAsD;IACtD,sDAAsD;IACtD,qDAAqD;IACrD,wDAAwD;IACxD,oDAAoD;IACpD,uDAAuD;IACvD,sDAAsD;IACtD,oDAAoD;IACpD,4CAA4C;IAC5C,iDAAiD;IACjD,iDAAiD;IACjD,sDAAsD;IACtD,kDAAkD;IAClD,sDAAsD;IACtD,kDAAkD;IAClD,gDAAgD;IAChD,uDAAuD;IACvD,iDAAiD;IACjD,kDAAkD;IAClD,gDAAgD;IAChD,mDAAmD;IACnD,mDAAmD;IACnD,yDAAyD;IACzD,4DAA4D;IAC5D,6DAA6D;IAC7D,2DAA2D;IAC3D,2DAA2D;IAC3D,+DAA+D;IAC/D,+DAA+D;IAC/D,+DAA+D;IAC/D,0DAA0D;IAC1D,6DAA6D;IAC7D,6DAA6D;IAC7D,8DAA8D;IAC9D,8DAA8D;IAC9D,8DAA8D;IAC9D,qDAAqD;IACrD,sDAAsD;IACtD,2DAA2D;IAC3D,iDAAiD;IACjD,sDAAsD;IACtD,uDAAuD;IACvD,yDAAyD;IACzD,oDAAoD;IACpD,iEAAiE;IACjE,mDAAmD;IACnD,wDAAwD;IACxD,iDAAiD;IACjD,wDAAwD;IACxD,kDAAkD;IAClD,kDAAkD;IAClD,oDAAoD;IACpD,oDAAoD;IACpD,iDAAiD;IACjD,8DAA8D;IAC9D,4DAA4D;IAC5D,6DAA6D;IAC7D,gEAAgE;IAChE,iEAAiE;IACjE,iEAAiE;IACjE,qEAAqE;IACrE,mEAAmE;IACnE,qEAAqE;IACrE,kEAAkE;IAClE,mEAAmE;IACnE,kEAAkE;IAClE,
|
|
1
|
+
{"version":3,"file":"canonical-tool-names.generated.js","sourceRoot":"","sources":["../src/canonical-tool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E;IACjE,mDAAmD;IACnD,wDAAwD;IACxD,iDAAiD;IACjD,wDAAwD;IACxD,kDAAkD;IAClD,kDAAkD;IAClD,oDAAoD;IACpD,oDAAoD;IACpD,iDAAiD;IACjD,8DAA8D;IAC9D,4DAA4D;IAC5D,6DAA6D;IAC7D,gEAAgE;IAChE,iEAAiE;IACjE,iEAAiE;IACjE,qEAAqE;IACrE,mEAAmE;IACnE,qEAAqE;IACrE,kEAAkE;IAClE,mEAAmE;IACnE,kEAAkE;IAClE,gDAAgD;IAChD,6CAA6C;IAC7C,oDAAoD;IACpD,6CAA6C;IAC7C,8CAA8C;IAC9C,iDAAiD;IACjD,qDAAqD;IACrD,oDAAoD;IACpD,qDAAqD;IACrD,gDAAgD;IAChD,0DAA0D;IAC1D,sCAAsC;IACtC,6DAA6D;IAC7D,kEAAkE;IAClE,8DAA8D;IAC9D,oEAAoE;IACpE,0DAA0D;IAC1D,kDAAkD;IAClD,gDAAgD;IAChD,kEAAkE;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,
|
|
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__telegram-card, 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-signature-set, mcp__plugin_email_email__email-sending-identity-set, 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-draft-list, 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_outlook_outlook__outlook-shared-mailbox-add, mcp__plugin_outlook_outlook__outlook-shared-mailbox-remove, 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-runs, 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,13 +5,13 @@
|
|
|
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-kQ3w70LJ.js"></script>
|
|
9
9
|
<link rel="modulepreload" crossorigin href="/assets/chunk-BycB0eMI.js">
|
|
10
|
-
<link rel="modulepreload" crossorigin href="/assets/jsx-runtime-
|
|
11
|
-
<link rel="modulepreload" crossorigin href="/assets/useMediaQuery-
|
|
12
|
-
<link rel="modulepreload" crossorigin href="/assets/AdminShell-
|
|
13
|
-
<link rel="modulepreload" crossorigin href="/assets/triangle-alert-
|
|
14
|
-
<link rel="stylesheet" crossorigin href="/assets/jsx-runtime-
|
|
10
|
+
<link rel="modulepreload" crossorigin href="/assets/jsx-runtime-Cjug_Cyb.js">
|
|
11
|
+
<link rel="modulepreload" crossorigin href="/assets/useMediaQuery-DUPJPHQt.js">
|
|
12
|
+
<link rel="modulepreload" crossorigin href="/assets/AdminShell-BMslfZxN.js">
|
|
13
|
+
<link rel="modulepreload" crossorigin href="/assets/triangle-alert-B5WAyAkC.js">
|
|
14
|
+
<link rel="stylesheet" crossorigin href="/assets/jsx-runtime-D43jgaWP.css">
|
|
15
15
|
<link rel="stylesheet" crossorigin href="/assets/useMediaQuery-DXAuc8G-.css">
|
|
16
16
|
<link rel="stylesheet" href="/brand-defaults.css">
|
|
17
17
|
</head>
|
|
@@ -5,12 +5,12 @@
|
|
|
5
5
|
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
|
6
6
|
<title>Agents — Maxy</title>
|
|
7
7
|
<link rel="icon" href="/favicon.ico">
|
|
8
|
-
<script type="module" crossorigin src="/assets/agents-
|
|
8
|
+
<script type="module" crossorigin src="/assets/agents-Cn_bZgnD.js"></script>
|
|
9
9
|
<link rel="modulepreload" crossorigin href="/assets/chunk-BycB0eMI.js">
|
|
10
|
-
<link rel="modulepreload" crossorigin href="/assets/jsx-runtime-
|
|
11
|
-
<link rel="modulepreload" crossorigin href="/assets/useMediaQuery-
|
|
12
|
-
<link rel="modulepreload" crossorigin href="/assets/AdminShell-
|
|
13
|
-
<link rel="stylesheet" crossorigin href="/assets/jsx-runtime-
|
|
10
|
+
<link rel="modulepreload" crossorigin href="/assets/jsx-runtime-Cjug_Cyb.js">
|
|
11
|
+
<link rel="modulepreload" crossorigin href="/assets/useMediaQuery-DUPJPHQt.js">
|
|
12
|
+
<link rel="modulepreload" crossorigin href="/assets/AdminShell-BMslfZxN.js">
|
|
13
|
+
<link rel="stylesheet" crossorigin href="/assets/jsx-runtime-D43jgaWP.css">
|
|
14
14
|
<link rel="stylesheet" crossorigin href="/assets/useMediaQuery-DXAuc8G-.css">
|
|
15
15
|
<link rel="stylesheet" href="/brand-defaults.css">
|
|
16
16
|
</head>
|
package/payload/server/public/assets/{AdminLoginScreens-Bus-Y-rG.js → AdminLoginScreens-Dxv5t1YY.js}
RENAMED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{o as e}from"./chunk-BycB0eMI.js";import{i as t,t as n}from"./jsx-runtime-CjJ246F7.js";import{O as r,Q as i,et as a,rt as o}from"./useMediaQuery-CVZYjRf6.js";import{A as s}from"./useVoiceRecorder-D5b4r4z0.js";import{A as c,O as l,k as u,p as d}from"./AdminShell-Bsm7q3CW.js";var f=e(t(),1);function p(e=`admin`){let[t,n]=(0,f.useState)(`loading`),[r,i]=(0,f.useState)(``),[a,l]=(0,f.useState)(``),[u,d]=(0,f.useState)(``),[p,m]=(0,f.useState)(!1),[h,g]=(0,f.useState)(!1),[_,v]=(0,f.useState)(!1),[y,b]=(0,f.useState)(!1),[x,S]=(0,f.useState)(!1),[C,w]=(0,f.useState)(null),[T,E]=(0,f.useState)(null),[D,O]=(0,f.useState)(void 0),[k,A]=(0,f.useState)(null),[j,M]=(0,f.useState)(void 0),[N,P]=(0,f.useState)(null),[F,I]=(0,f.useState)(null),[L,R]=(0,f.useState)(void 0),z=(0,f.useRef)(void 0),[B,V]=(0,f.useState)(!1),[H,U]=(0,f.useState)(!0);(0,f.useEffect)(()=>{typeof window>`u`||fetch(`/api/remote-auth/status`).then(e=>e.ok?e.json():null).then(e=>{e?.configured&&V(!0)}).catch(()=>{})},[]);let W=(0,f.useRef)(null),G=(0,f.useRef)(null);(0,f.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();w(r.session_key),I(r.sessionId??null),O(r.businessName),A(r.role??null),M(r.userName===void 0?null:r.userName),P(r.avatar??null);let i=s(r.thinkingView);return z.current=i,R(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}U(!!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,f.useEffect)(()=>{t===`chat`&&C&&fetch(`/api/admin/claude-info?session_key=${encodeURIComponent(C)}`).then(e=>{if(e.ok)return e.json()}).then(e=>{e&&E(e)}).catch(()=>{})},[t,C]);let K=(0,f.useRef)(null);(0,f.useEffect)(()=>{if(t!==`chat`)return;let e=setInterval(async()=>{try{let e=await fetch(`/api/health`);if(e.ok){let t=await e.json();U(t.auth_status!==`dead`&&t.auth_status!==`missing`)}}catch{}if(C)try{let e=await fetch(`/api/admin/session?session_key=${encodeURIComponent(C)}`);if(e.status!==401)return;let t=(await e.clone().json().catch(()=>null))?.code??`unknown-401`;if(t===`remote-auth-required`){o(`heartbeat`,`/api/admin/session`);return}console.warn(`[admin-auth] outcome=heartbeat-detected-expiry code=${t}`),K.current?.()}catch{}},300*1e3);return()=>clearInterval(e)},[t,C]),(0,f.useEffect)(()=>{t===`connect-claude`&&fetch(`/api/health`).then(e=>e.ok?e.json():null).then(e=>{e?.claude_authenticated&&(U(!0),n(`enter-pin`))}).catch(()=>{})},[t]);async function q(e,t){g(!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`){o(`enter-pin`,`/api/admin/session`);return}d(e.error||`Invalid PIN`);return}let a=await r.json();w(a.session_key),I(a.sessionId??null),O(a.businessName),A(a.role??null),M(a.userName===void 0?null:a.userName),P(a.avatar??null);let c=s(a.thinkingView);z.current=c,R(c);try{sessionStorage.setItem(`maxy-admin-session-key`,a.session_key)}catch{}i(``),n(`chat`)}catch(e){console.error(`[admin] connection error:`,e),d(`Could not connect.`)}finally{g(!1)}}let J=(0,f.useCallback)(async e=>{if(e.preventDefault(),h)return;d(``);let t=a.trim();if(!t){d(`Please enter your name.`);return}if(r.length<4){d(`PIN must be at least 4 characters.`);return}let s=r;g(!0);try{let e=await fetch(`/api/onboarding/set-pin`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify({pin:s,name:t})});if(!e.ok){let t=await e.json().catch(()=>({}));if(e.status===401&&t?.code===`remote-auth-required`){o(`set-pin`,`/api/onboarding/set-pin`);return}if(e.status===409){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`):d(t.error||`Failed to set PIN.`)}else n(`enter-pin`)}catch{n(`enter-pin`)}return}d(t.error||`Failed to set PIN.`);return}let r=await fetch(`/api/health`);if((r.ok?await r.json():null)?.claude_authenticated){await q(s);return}i(``),n(`connect-claude`)}catch(e){console.error(`[admin] connection error:`,e),d(`Could not connect.`)}finally{g(!1)}},[r,h,a]),Y=(0,f.useCallback)(async e=>{e.preventDefault(),d(``),await q(r)},[r]),X=(0,f.useCallback)(async()=>{S(!0);try{if(!await c())return console.warn(`[admin-ui] claude-disconnect not verified — credentials may persist; staying put`),!1;U(!1),w(null),A(null),M(void 0),P(null);try{sessionStorage.removeItem(`maxy-admin-session-key`)}catch{}return n(`connect-claude`),!0}finally{S(!1)}},[]),Z=(0,f.useCallback)(()=>{w(null),A(null),M(void 0),P(null);try{sessionStorage.removeItem(`maxy-admin-session-key`)}catch{}i(``),d(``),n(`enter-pin`)},[]);return(0,f.useEffect)(()=>{K.current=Z},[Z]),{appState:t,setAppState:n,pin:r,setPin:i,operatorName:a,setOperatorName:l,pinError:u,setPinError:d,showPin:p,setShowPin:m,pinLoading:h,authPolling:_,setAuthPolling:v,authLoading:y,setAuthLoading:b,disconnecting:x,cacheKey:C,setCacheKey:w,claudeInfo:T,setClaudeInfo:E,businessName:D,role:k,userName:j,userAvatar:N,sessionId:F,setSessionId:I,expandAll:L,setExpandAll:R,expandAllDefaultRef:z,remoteAuthEnabled:B,claudeConnected:H,pinInputRef:W,setPinFormRef:G,handleSetPin:J,handleLogin:Y,handleDisconnect:X,handleLogout:Z}}var m=n();function h({inputRef:e,value:t,onChange:n,onComplete:r,showPin:i,autoFocus:a}){let o=(0,f.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,m.jsx)(`div`,{className:`pin-field`,children:Array.from({length:6}).map((n,r)=>(0,m.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 g(e){let{pin:t,setPin:n,showPin:r,setShowPin:o,pinLoading:s,pinError:c,pinInputRef:d,setPinFormRef:f,onSubmit:p,operatorName:g,setOperatorName:_}=e;return(0,m.jsx)(`div`,{className:`connect-page`,children:(0,m.jsxs)(`div`,{className:`connect-content`,children:[(0,m.jsx)(`img`,{src:a,alt:i.productName,className:`connect-logo connect-logo--maxy`}),!i.logoContainsName&&(0,m.jsxs)(`h1`,{className:`connect-title`,children:[`Welcome to `,i.productName]}),(0,m.jsxs)(`p`,{className:`connect-subtitle`,children:[`Tell `,i.productName,` who you are, then choose a PIN.`]}),(0,m.jsxs)(`form`,{ref:f,onSubmit:p,className:`connect-pin-form`,children:[(0,m.jsxs)(`div`,{className:`pin-input-row`,children:[(0,m.jsx)(`input`,{type:`text`,className:`connect-name-input`,placeholder:`Your full name`,value:g,onChange:e=>_(e.target.value),autoComplete:`name`,autoFocus:!0,required:!0,"aria-label":`Your full name`}),(0,m.jsx)(`div`,{style:{width:38,flexShrink:0},"aria-hidden":`true`})]}),(0,m.jsxs)(`div`,{className:`pin-input-row`,children:[(0,m.jsx)(h,{inputRef:d,value:t,onChange:n,onComplete:()=>{},showPin:r}),(0,m.jsx)(l,{variant:`send`,type:`submit`,disabled:!t||!g.trim(),loading:s,"aria-label":`Set PIN`,children:(0,m.jsxs)(`svg`,{viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`2`,strokeLinecap:`round`,strokeLinejoin:`round`,children:[(0,m.jsx)(`line`,{x1:`5`,y1:`12`,x2:`19`,y2:`12`}),(0,m.jsx)(`polyline`,{points:`12 5 19 12 12 19`})]})})]}),(0,m.jsx)(u,{checked:r,onChange:()=>o(e=>!e),label:`Show PIN`})]}),c&&(0,m.jsx)(`p`,{className:`admin-pin-error`,children:c})]})})}function _(e){let{pin:t,setPin:n,showPin:r,setShowPin:o,pinLoading:s,pinError:c,pinInputRef:d,onSubmit:f,remoteAuthEnabled:p,onSignOutRemote:g}=e;return(0,m.jsxs)(`div`,{className:`connect-page`,children:[p&&g&&(0,m.jsx)(`button`,{type:`button`,className:`connect-signout`,onClick:g,children:`Sign out`}),(0,m.jsxs)(`div`,{className:`connect-content`,children:[(0,m.jsx)(`img`,{src:a,alt:i.productName,className:`connect-logo connect-logo--maxy`}),!i.logoContainsName&&(0,m.jsx)(`h1`,{className:`connect-title`,children:i.productName}),(0,m.jsxs)(`form`,{onSubmit:f,className:`connect-pin-form`,children:[(0,m.jsxs)(`div`,{className:`pin-input-row`,children:[(0,m.jsx)(h,{inputRef:d,value:t,onChange:n,onComplete:()=>{},showPin:r,autoFocus:!0}),(0,m.jsx)(l,{variant:`send`,type:`submit`,disabled:!t,loading:s,children:(0,m.jsxs)(`svg`,{viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`2`,strokeLinecap:`round`,strokeLinejoin:`round`,children:[(0,m.jsx)(`line`,{x1:`5`,y1:`12`,x2:`19`,y2:`12`}),(0,m.jsx)(`polyline`,{points:`12 5 19 12 12 19`})]})})]}),(0,m.jsx)(`div`,{className:`pin-options`,children:(0,m.jsx)(u,{checked:r,onChange:()=>o(e=>!e),label:`Show PIN`})})]}),c&&(0,m.jsx)(`p`,{className:`admin-pin-error`,children:c})]})]})}function v(e){let{authPolling:t,setAuthPolling:n,authLoading:r,setAuthLoading:o,pinError:s,setPinError:c,setAppState:u}=e,[p,h]=(0,f.useState)(!1),[g,_]=(0,f.useState)(!1),[v,y]=(0,f.useState)(``),[b,x]=(0,f.useState)(``),[S,C]=(0,f.useState)(``),[w,T]=(0,f.useState)(null),[E,D]=(0,f.useState)(null),[O,k]=(0,f.useState)(!1),A=(0,f.useRef)(0);(0,f.useEffect)(()=>{try{D(sessionStorage.getItem(`maxy-admin-session-key`))}catch{}k(!0)},[]);async function j(){C(``);try{let e=await(await fetch(`/api/onboarding/claude-auth`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify({action:`paste-code`,code:b})})).json();e.accepted?(C(`Code submitted. Finishing sign-in…`),x(``)):C(e.error||`Could not submit code.`)}catch(e){console.error(`[admin] paste-code error:`,e),C(`Could not submit code.`)}}async function M(){_(!0),c(``);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?h(!0):e.error&&c(e.error)}catch(e){console.error(`[admin] browser launch error:`,e),c(`Could not launch browser.`)}_(!1)}async function N(){let e=++A.current;o(!0),c(``);try{let t=await(await fetch(`/api/onboarding/claude-auth`,{method:`POST`})).json();if(t.started){n(!0),h(!0),o(!1),y(t.transport||``);for(let t=0;t<120;t++){if(await new Promise(e=>setTimeout(e,2e3)),A.current!==e)return;let t=await(await fetch(`/api/onboarding/claude-auth`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify({action:`wait`})})).json();if(typeof t.authTargetId==`string`&&T(t.authTargetId),t.authenticated){await fetch(`/api/onboarding/claude-auth`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify({action:`stop`})}),u(`enter-pin`);return}}c(`Timed out waiting for sign-in. Try again.`),n(!1)}else t.error&&c(t.error)}catch(e){console.error(`[admin] auth flow error:`,e),c(`Could not start auth flow.`)}o(!1)}async function P(){A.current++,await fetch(`/api/onboarding/claude-auth`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify({action:`stop`})}),n(!1),c(``)}return t||p?(0,m.jsxs)(`div`,{style:{display:`flex`,flexDirection:`column`,height:`100dvh`,overflow:`auto`},children:[(0,m.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,m.jsx)(`button`,{onClick:P,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,m.jsx)(`button`,{onClick:()=>h(!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,m.jsx)(`img`,{src:`/brand/claude.png`,alt:`Claude`,className:`chat-logo`}),(0,m.jsx)(`h1`,{className:`chat-tagline`,children:`Connect Claude`}),(0,m.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,m.jsx)(`div`,{style:{marginTop:`12px`},children:(0,m.jsx)(l,{variant:`primary`,onClick:N,disabled:r,children:r?(0,m.jsxs)(m.Fragment,{children:[(0,m.jsx)(`span`,{className:`spin`,style:{display:`inline-block`},children:`✱`}),` Connecting…`]}):`Sign in to Claude`})}),t&&v===`native`&&(0,m.jsxs)(`div`,{style:{marginTop:`14px`,maxWidth:`420px`,margin:`14px auto 0`,display:`flex`,flexDirection:`column`,gap:`8px`},children:[(0,m.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,m.jsxs)(`div`,{style:{display:`flex`,gap:`8px`},children:[(0,m.jsx)(`input`,{type:`text`,value:b,onChange:e=>x(e.target.value),placeholder:`Paste code or redirect URL`,style:{flex:1,padding:`8px 10px`,fontSize:`13px`,border:`1px solid #ccc`,borderRadius:`6px`}}),(0,m.jsx)(l,{variant:`primary`,onClick:j,disabled:!b.trim(),children:`Submit`})]}),S&&(0,m.jsx)(`p`,{style:{fontSize:`12px`,color:`#999`,margin:0},children:S})]})]}),(0,m.jsx)(`div`,{style:{flex:1,display:`flex`,flexDirection:`column`,minHeight:0,gap:`10px`,padding:`0 0 16px`},children:O&&(0,m.jsx)(d,{preferTargetId:w,cacheKey:E,chrome:!1})}),s&&(0,m.jsx)(`p`,{className:`admin-pin-error`,style:{textAlign:`center`,padding:`0 20px 16px`},children:s})]}):(0,m.jsx)(`div`,{className:`connect-page`,children:(0,m.jsxs)(`div`,{className:`connect-content`,children:[(0,m.jsxs)(`div`,{className:`connect-logos`,children:[(0,m.jsx)(`div`,{className:`connect-logo-wrap`,children:(0,m.jsx)(`img`,{src:`/brand/claude.png`,alt:`Claude`,className:`connect-logo`})}),(0,m.jsx)(`svg`,{className:`connect-arrow`,viewBox:`0 0 48 24`,fill:`none`,xmlns:`http://www.w3.org/2000/svg`,children:(0,m.jsx)(`path`,{d:`M0 12h44m0 0l-8-8m8 8l-8 8`,stroke:`currentColor`,strokeWidth:`2`,strokeLinecap:`round`,strokeLinejoin:`round`})}),(0,m.jsxs)(`div`,{className:`connect-logo-wrap`,children:[(0,m.jsx)(`img`,{src:a,alt:i.productName,className:`connect-logo connect-logo--maxy`}),!i.logoContainsName&&(0,m.jsx)(`span`,{className:`connect-logo-label`,children:i.productName})]})]}),(0,m.jsxs)(`h1`,{className:`connect-title`,children:[`Connect Claude to power `,i.productName]}),(0,m.jsx)(`p`,{className:`connect-subtitle`,children:`Sign in with your Anthropic account to get started.`}),(0,m.jsx)(l,{variant:`primary`,onClick:N,disabled:r,children:r?(0,m.jsxs)(m.Fragment,{children:[(0,m.jsx)(`span`,{className:`spin`,style:{display:`inline-block`},children:`✱`}),` Connecting…`]}):`Sign in to Claude`}),(0,m.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,m.jsx)(`button`,{onClick:M,disabled:g,style:{marginTop:`12px`,background:`none`,border:`none`,color:`var(--color-primary, #666)`,fontSize:`13px`,cursor:`pointer`,textDecoration:`underline`,textUnderlineOffset:`3px`},children:g?`Launching…`:`Open browser first`}),s&&(0,m.jsx)(`p`,{className:`admin-pin-error`,children:s})]})})}function y({auth:e}){return e.appState===`loading`?(0,m.jsx)(r,{surface:`gate`}):e.appState===`set-pin`?(0,m.jsx)(g,{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,m.jsx)(v,{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,m.jsx)(_,{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:()=>{window.location.href=`/__remote-auth/logout`}}):null}export{p as n,y as t};
|
|
1
|
+
import{o as e}from"./chunk-BycB0eMI.js";import{i as t,t as n}from"./jsx-runtime-Cjug_Cyb.js";import{O as r,Q as i,et as a,rt as o}from"./useMediaQuery-DUPJPHQt.js";import{A as s}from"./useVoiceRecorder-BEgr0nHN.js";import{A as c,O as l,k as u,p as d}from"./AdminShell-BMslfZxN.js";var f=e(t(),1);function p(e=`admin`){let[t,n]=(0,f.useState)(`loading`),[r,i]=(0,f.useState)(``),[a,l]=(0,f.useState)(``),[u,d]=(0,f.useState)(``),[p,m]=(0,f.useState)(!1),[h,g]=(0,f.useState)(!1),[_,v]=(0,f.useState)(!1),[y,b]=(0,f.useState)(!1),[x,S]=(0,f.useState)(!1),[C,w]=(0,f.useState)(null),[T,E]=(0,f.useState)(null),[D,O]=(0,f.useState)(void 0),[k,A]=(0,f.useState)(null),[j,M]=(0,f.useState)(void 0),[N,P]=(0,f.useState)(null),[F,I]=(0,f.useState)(null),[L,R]=(0,f.useState)(void 0),z=(0,f.useRef)(void 0),[B,V]=(0,f.useState)(!1),[H,U]=(0,f.useState)(!0);(0,f.useEffect)(()=>{typeof window>`u`||fetch(`/api/remote-auth/status`).then(e=>e.ok?e.json():null).then(e=>{e?.configured&&V(!0)}).catch(()=>{})},[]);let W=(0,f.useRef)(null),G=(0,f.useRef)(null);(0,f.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();w(r.session_key),I(r.sessionId??null),O(r.businessName),A(r.role??null),M(r.userName===void 0?null:r.userName),P(r.avatar??null);let i=s(r.thinkingView);return z.current=i,R(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}U(!!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,f.useEffect)(()=>{t===`chat`&&C&&fetch(`/api/admin/claude-info?session_key=${encodeURIComponent(C)}`).then(e=>{if(e.ok)return e.json()}).then(e=>{e&&E(e)}).catch(()=>{})},[t,C]);let K=(0,f.useRef)(null);(0,f.useEffect)(()=>{if(t!==`chat`)return;let e=setInterval(async()=>{try{let e=await fetch(`/api/health`);if(e.ok){let t=await e.json();U(t.auth_status!==`dead`&&t.auth_status!==`missing`)}}catch{}if(C)try{let e=await fetch(`/api/admin/session?session_key=${encodeURIComponent(C)}`);if(e.status!==401)return;let t=(await e.clone().json().catch(()=>null))?.code??`unknown-401`;if(t===`remote-auth-required`){o(`heartbeat`,`/api/admin/session`);return}console.warn(`[admin-auth] outcome=heartbeat-detected-expiry code=${t}`),K.current?.()}catch{}},300*1e3);return()=>clearInterval(e)},[t,C]),(0,f.useEffect)(()=>{t===`connect-claude`&&fetch(`/api/health`).then(e=>e.ok?e.json():null).then(e=>{e?.claude_authenticated&&(U(!0),n(`enter-pin`))}).catch(()=>{})},[t]);async function q(e,t){g(!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`){o(`enter-pin`,`/api/admin/session`);return}d(e.error||`Invalid PIN`);return}let a=await r.json();w(a.session_key),I(a.sessionId??null),O(a.businessName),A(a.role??null),M(a.userName===void 0?null:a.userName),P(a.avatar??null);let c=s(a.thinkingView);z.current=c,R(c);try{sessionStorage.setItem(`maxy-admin-session-key`,a.session_key)}catch{}i(``),n(`chat`)}catch(e){console.error(`[admin] connection error:`,e),d(`Could not connect.`)}finally{g(!1)}}let J=(0,f.useCallback)(async e=>{if(e.preventDefault(),h)return;d(``);let t=a.trim();if(!t){d(`Please enter your name.`);return}if(r.length<4){d(`PIN must be at least 4 characters.`);return}let s=r;g(!0);try{let e=await fetch(`/api/onboarding/set-pin`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify({pin:s,name:t})});if(!e.ok){let t=await e.json().catch(()=>({}));if(e.status===401&&t?.code===`remote-auth-required`){o(`set-pin`,`/api/onboarding/set-pin`);return}if(e.status===409){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`):d(t.error||`Failed to set PIN.`)}else n(`enter-pin`)}catch{n(`enter-pin`)}return}d(t.error||`Failed to set PIN.`);return}let r=await fetch(`/api/health`);if((r.ok?await r.json():null)?.claude_authenticated){await q(s);return}i(``),n(`connect-claude`)}catch(e){console.error(`[admin] connection error:`,e),d(`Could not connect.`)}finally{g(!1)}},[r,h,a]),Y=(0,f.useCallback)(async e=>{e.preventDefault(),d(``),await q(r)},[r]),X=(0,f.useCallback)(async()=>{S(!0);try{if(!await c())return console.warn(`[admin-ui] claude-disconnect not verified — credentials may persist; staying put`),!1;U(!1),w(null),A(null),M(void 0),P(null);try{sessionStorage.removeItem(`maxy-admin-session-key`)}catch{}return n(`connect-claude`),!0}finally{S(!1)}},[]),Z=(0,f.useCallback)(()=>{w(null),A(null),M(void 0),P(null);try{sessionStorage.removeItem(`maxy-admin-session-key`)}catch{}i(``),d(``),n(`enter-pin`)},[]);return(0,f.useEffect)(()=>{K.current=Z},[Z]),{appState:t,setAppState:n,pin:r,setPin:i,operatorName:a,setOperatorName:l,pinError:u,setPinError:d,showPin:p,setShowPin:m,pinLoading:h,authPolling:_,setAuthPolling:v,authLoading:y,setAuthLoading:b,disconnecting:x,cacheKey:C,setCacheKey:w,claudeInfo:T,setClaudeInfo:E,businessName:D,role:k,userName:j,userAvatar:N,sessionId:F,setSessionId:I,expandAll:L,setExpandAll:R,expandAllDefaultRef:z,remoteAuthEnabled:B,claudeConnected:H,pinInputRef:W,setPinFormRef:G,handleSetPin:J,handleLogin:Y,handleDisconnect:X,handleLogout:Z}}var m=n();function h({inputRef:e,value:t,onChange:n,onComplete:r,showPin:i,autoFocus:a}){let o=(0,f.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,m.jsx)(`div`,{className:`pin-field`,children:Array.from({length:6}).map((n,r)=>(0,m.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 g(e){let{pin:t,setPin:n,showPin:r,setShowPin:o,pinLoading:s,pinError:c,pinInputRef:d,setPinFormRef:f,onSubmit:p,operatorName:g,setOperatorName:_}=e;return(0,m.jsx)(`div`,{className:`connect-page`,children:(0,m.jsxs)(`div`,{className:`connect-content`,children:[(0,m.jsx)(`img`,{src:a,alt:i.productName,className:`connect-logo connect-logo--maxy`}),!i.logoContainsName&&(0,m.jsxs)(`h1`,{className:`connect-title`,children:[`Welcome to `,i.productName]}),(0,m.jsxs)(`p`,{className:`connect-subtitle`,children:[`Tell `,i.productName,` who you are, then choose a PIN.`]}),(0,m.jsxs)(`form`,{ref:f,onSubmit:p,className:`connect-pin-form`,children:[(0,m.jsxs)(`div`,{className:`pin-input-row`,children:[(0,m.jsx)(`input`,{type:`text`,className:`connect-name-input`,placeholder:`Your full name`,value:g,onChange:e=>_(e.target.value),autoComplete:`name`,autoFocus:!0,required:!0,"aria-label":`Your full name`}),(0,m.jsx)(`div`,{style:{width:38,flexShrink:0},"aria-hidden":`true`})]}),(0,m.jsxs)(`div`,{className:`pin-input-row`,children:[(0,m.jsx)(h,{inputRef:d,value:t,onChange:n,onComplete:()=>{},showPin:r}),(0,m.jsx)(l,{variant:`send`,type:`submit`,disabled:!t||!g.trim(),loading:s,"aria-label":`Set PIN`,children:(0,m.jsxs)(`svg`,{viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`2`,strokeLinecap:`round`,strokeLinejoin:`round`,children:[(0,m.jsx)(`line`,{x1:`5`,y1:`12`,x2:`19`,y2:`12`}),(0,m.jsx)(`polyline`,{points:`12 5 19 12 12 19`})]})})]}),(0,m.jsx)(u,{checked:r,onChange:()=>o(e=>!e),label:`Show PIN`})]}),c&&(0,m.jsx)(`p`,{className:`admin-pin-error`,children:c})]})})}function _(e){let{pin:t,setPin:n,showPin:r,setShowPin:o,pinLoading:s,pinError:c,pinInputRef:d,onSubmit:f,remoteAuthEnabled:p,onSignOutRemote:g}=e;return(0,m.jsxs)(`div`,{className:`connect-page`,children:[p&&g&&(0,m.jsx)(`button`,{type:`button`,className:`connect-signout`,onClick:g,children:`Sign out`}),(0,m.jsxs)(`div`,{className:`connect-content`,children:[(0,m.jsx)(`img`,{src:a,alt:i.productName,className:`connect-logo connect-logo--maxy`}),!i.logoContainsName&&(0,m.jsx)(`h1`,{className:`connect-title`,children:i.productName}),(0,m.jsxs)(`form`,{onSubmit:f,className:`connect-pin-form`,children:[(0,m.jsxs)(`div`,{className:`pin-input-row`,children:[(0,m.jsx)(h,{inputRef:d,value:t,onChange:n,onComplete:()=>{},showPin:r,autoFocus:!0}),(0,m.jsx)(l,{variant:`send`,type:`submit`,disabled:!t,loading:s,children:(0,m.jsxs)(`svg`,{viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`2`,strokeLinecap:`round`,strokeLinejoin:`round`,children:[(0,m.jsx)(`line`,{x1:`5`,y1:`12`,x2:`19`,y2:`12`}),(0,m.jsx)(`polyline`,{points:`12 5 19 12 12 19`})]})})]}),(0,m.jsx)(`div`,{className:`pin-options`,children:(0,m.jsx)(u,{checked:r,onChange:()=>o(e=>!e),label:`Show PIN`})})]}),c&&(0,m.jsx)(`p`,{className:`admin-pin-error`,children:c})]})]})}function v(e){let{authPolling:t,setAuthPolling:n,authLoading:r,setAuthLoading:o,pinError:s,setPinError:c,setAppState:u}=e,[p,h]=(0,f.useState)(!1),[g,_]=(0,f.useState)(!1),[v,y]=(0,f.useState)(``),[b,x]=(0,f.useState)(``),[S,C]=(0,f.useState)(``),[w,T]=(0,f.useState)(null),[E,D]=(0,f.useState)(null),[O,k]=(0,f.useState)(!1),A=(0,f.useRef)(0);(0,f.useEffect)(()=>{try{D(sessionStorage.getItem(`maxy-admin-session-key`))}catch{}k(!0)},[]);async function j(){C(``);try{let e=await(await fetch(`/api/onboarding/claude-auth`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify({action:`paste-code`,code:b})})).json();e.accepted?(C(`Code submitted. Finishing sign-in…`),x(``)):C(e.error||`Could not submit code.`)}catch(e){console.error(`[admin] paste-code error:`,e),C(`Could not submit code.`)}}async function M(){_(!0),c(``);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?h(!0):e.error&&c(e.error)}catch(e){console.error(`[admin] browser launch error:`,e),c(`Could not launch browser.`)}_(!1)}async function N(){let e=++A.current;o(!0),c(``);try{let t=await(await fetch(`/api/onboarding/claude-auth`,{method:`POST`})).json();if(t.started){n(!0),h(!0),o(!1),y(t.transport||``);for(let t=0;t<120;t++){if(await new Promise(e=>setTimeout(e,2e3)),A.current!==e)return;let t=await(await fetch(`/api/onboarding/claude-auth`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify({action:`wait`})})).json();if(typeof t.authTargetId==`string`&&T(t.authTargetId),t.authenticated){await fetch(`/api/onboarding/claude-auth`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify({action:`stop`})}),u(`enter-pin`);return}}c(`Timed out waiting for sign-in. Try again.`),n(!1)}else t.error&&c(t.error)}catch(e){console.error(`[admin] auth flow error:`,e),c(`Could not start auth flow.`)}o(!1)}async function P(){A.current++,await fetch(`/api/onboarding/claude-auth`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify({action:`stop`})}),n(!1),c(``)}return t||p?(0,m.jsxs)(`div`,{style:{display:`flex`,flexDirection:`column`,height:`100dvh`,overflow:`auto`},children:[(0,m.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,m.jsx)(`button`,{onClick:P,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,m.jsx)(`button`,{onClick:()=>h(!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,m.jsx)(`img`,{src:`/brand/claude.png`,alt:`Claude`,className:`chat-logo`}),(0,m.jsx)(`h1`,{className:`chat-tagline`,children:`Connect Claude`}),(0,m.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,m.jsx)(`div`,{style:{marginTop:`12px`},children:(0,m.jsx)(l,{variant:`primary`,onClick:N,disabled:r,children:r?(0,m.jsxs)(m.Fragment,{children:[(0,m.jsx)(`span`,{className:`spin`,style:{display:`inline-block`},children:`✱`}),` Connecting…`]}):`Sign in to Claude`})}),t&&v===`native`&&(0,m.jsxs)(`div`,{style:{marginTop:`14px`,maxWidth:`420px`,margin:`14px auto 0`,display:`flex`,flexDirection:`column`,gap:`8px`},children:[(0,m.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,m.jsxs)(`div`,{style:{display:`flex`,gap:`8px`},children:[(0,m.jsx)(`input`,{type:`text`,value:b,onChange:e=>x(e.target.value),placeholder:`Paste code or redirect URL`,style:{flex:1,padding:`8px 10px`,fontSize:`13px`,border:`1px solid #ccc`,borderRadius:`6px`}}),(0,m.jsx)(l,{variant:`primary`,onClick:j,disabled:!b.trim(),children:`Submit`})]}),S&&(0,m.jsx)(`p`,{style:{fontSize:`12px`,color:`#999`,margin:0},children:S})]})]}),(0,m.jsx)(`div`,{style:{flex:1,display:`flex`,flexDirection:`column`,minHeight:0,gap:`10px`,padding:`0 0 16px`},children:O&&(0,m.jsx)(d,{preferTargetId:w,cacheKey:E,chrome:!1})}),s&&(0,m.jsx)(`p`,{className:`admin-pin-error`,style:{textAlign:`center`,padding:`0 20px 16px`},children:s})]}):(0,m.jsx)(`div`,{className:`connect-page`,children:(0,m.jsxs)(`div`,{className:`connect-content`,children:[(0,m.jsxs)(`div`,{className:`connect-logos`,children:[(0,m.jsx)(`div`,{className:`connect-logo-wrap`,children:(0,m.jsx)(`img`,{src:`/brand/claude.png`,alt:`Claude`,className:`connect-logo`})}),(0,m.jsx)(`svg`,{className:`connect-arrow`,viewBox:`0 0 48 24`,fill:`none`,xmlns:`http://www.w3.org/2000/svg`,children:(0,m.jsx)(`path`,{d:`M0 12h44m0 0l-8-8m8 8l-8 8`,stroke:`currentColor`,strokeWidth:`2`,strokeLinecap:`round`,strokeLinejoin:`round`})}),(0,m.jsxs)(`div`,{className:`connect-logo-wrap`,children:[(0,m.jsx)(`img`,{src:a,alt:i.productName,className:`connect-logo connect-logo--maxy`}),!i.logoContainsName&&(0,m.jsx)(`span`,{className:`connect-logo-label`,children:i.productName})]})]}),(0,m.jsxs)(`h1`,{className:`connect-title`,children:[`Connect Claude to power `,i.productName]}),(0,m.jsx)(`p`,{className:`connect-subtitle`,children:`Sign in with your Anthropic account to get started.`}),(0,m.jsx)(l,{variant:`primary`,onClick:N,disabled:r,children:r?(0,m.jsxs)(m.Fragment,{children:[(0,m.jsx)(`span`,{className:`spin`,style:{display:`inline-block`},children:`✱`}),` Connecting…`]}):`Sign in to Claude`}),(0,m.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,m.jsx)(`button`,{onClick:M,disabled:g,style:{marginTop:`12px`,background:`none`,border:`none`,color:`var(--color-primary, #666)`,fontSize:`13px`,cursor:`pointer`,textDecoration:`underline`,textUnderlineOffset:`3px`},children:g?`Launching…`:`Open browser first`}),s&&(0,m.jsx)(`p`,{className:`admin-pin-error`,children:s})]})})}function y({auth:e}){return e.appState===`loading`?(0,m.jsx)(r,{surface:`gate`}):e.appState===`set-pin`?(0,m.jsx)(g,{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,m.jsx)(v,{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,m.jsx)(_,{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:()=>{window.location.href=`/__remote-auth/logout`}}):null}export{p as n,y as t};
|
|
Binary file
|
|
Binary file
|