shadow-claw 1.40.0 → 1.41.0
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/.well-known/mcp/server-card.json +2 -2
- package/.well-known/mcp/servers.json +1 -1
- package/.well-known/mcp.json +2 -2
- package/README.md +1 -0
- package/dist/cli/build/build.js +1 -1
- package/dist/cli/{chunk-Bfz2NYgD.js → chunk-0IeC97mU.js} +7 -7
- package/dist/cli/chunk-3oLxlxPn.js +1 -0
- package/dist/cli/{chunk-BXg4-9Rq2.js → chunk-8CrZyP1b2.js} +1 -1
- package/dist/cli/{chunk-BP5Hg6CM.js → chunk-B--ueArB.js} +1 -1
- package/dist/cli/chunk-BIh7rXlJ2.js +1 -0
- package/dist/cli/{chunk-Drr0VSGA2.js → chunk-BKnTOLLS2.js} +1 -1
- package/dist/cli/{chunk-C5PuRV08.js → chunk-BLMC1Bxv.js} +1 -1
- package/dist/cli/{chunk-B2tNSlFy2.js → chunk-BOigzz2U2.js} +1 -1
- package/dist/cli/{chunk-DOf3DZdR.js → chunk-BOzn335y.js} +1 -1
- package/dist/cli/chunk-BjOeVLb42.js +1 -0
- package/dist/cli/{chunk-DqTx0rRp2.js → chunk-Bjqh5_SU2.js} +1 -1
- package/dist/cli/chunk-BqWBd_jF2.js +1 -0
- package/dist/cli/{chunk-Bc9nRNyN.js → chunk-BvVUnHTq.js} +12 -9
- package/dist/cli/{chunk-DIbSoQmd2.js → chunk-C6FFByBU2.js} +2 -2
- package/dist/cli/{chunk-Drq18VZe.js → chunk-C9-aL3rF.js} +1 -1
- package/dist/cli/{chunk-BUhqHeEA2.js → chunk-C9czddEh2.js} +2 -2
- package/dist/cli/chunk-CCx8WOwz2.js +1 -0
- package/dist/cli/{chunk-BkMSjVJb.js → chunk-CK6ejMig.js} +1 -1
- package/dist/cli/chunk-CUUERioR2.js +1 -0
- package/dist/cli/chunk-CXAobnJd.js +1 -0
- package/dist/cli/chunk-CY1X0pOF2.js +1 -0
- package/dist/cli/chunk-CZvvgLVv.js +1 -0
- package/dist/cli/chunk-CbcwbfJB.js +1 -0
- package/dist/cli/{chunk-quilB3TV2.js → chunk-Ci9OJGcd2.js} +1 -1
- package/dist/cli/chunk-Cj9wl0qx.js +1 -0
- package/dist/cli/{chunk-3gRhOmGo2.js → chunk-CjJsVrKI2.js} +1 -1
- package/dist/cli/{chunk-CmEfzm-_.js → chunk-ClPZ4Rea.js} +1 -1
- package/dist/cli/{chunk-WMPAfIvV2.js → chunk-DHJCGRuG2.js} +1 -1
- package/dist/cli/{chunk-C7Y2xIk4.js → chunk-DKVkYTV9.js} +1 -1
- package/dist/cli/chunk-DR2XtWRo.js +1 -0
- package/dist/cli/{chunk-DID5VvOG.js → chunk-DTES-dE6.js} +3 -3
- package/dist/cli/{chunk-BiVJVh_S.js → chunk-DUlIqkaX.js} +7 -7
- package/dist/cli/{chunk-CkpueGaZ2.js → chunk-DjWle8FF2.js} +1 -1
- package/dist/cli/{chunk-CSvHmNOk.js → chunk-DmRXVLfy.js} +1 -1
- package/dist/cli/{chunk-BT1xXZn72.js → chunk-HlSiTC-u2.js} +1 -1
- package/dist/cli/{chunk-da0bsiOn.js → chunk-P4JSeFBI.js} +1 -1
- package/dist/cli/chunk-UcNbHaRQ.js +1 -0
- package/dist/cli/{chunk-BXFHFbEd.js → chunk-UweLmfQS.js} +1 -1
- package/dist/cli/chunk-bQQkVCw-.js +94 -0
- package/dist/cli/{chunk-CGiXWHTi2.js → chunk-gwpxl-0W2.js} +1 -1
- package/dist/cli/{chunk-NH8koEis2.js → chunk-nmDhxXH_2.js} +1 -1
- package/dist/cli/chunk-p0n_c-I2.js +1 -0
- package/dist/cli/{chunk-D7xP72La.js → chunk-q7r4FosZ.js} +1 -1
- package/dist/cli/cli.js +3 -3
- package/dist/cli/prerender/dsd-shell/prerender-dsd-shell.js +1 -1
- package/dist/electron/main.cjs +1 -1
- package/dist/headless-agent.js +1 -1
- package/dist/lib/{app-routes-BAEMLu9g.js → app-routes-CKkiX12g.js} +7 -2
- package/dist/lib/app-routes-CKkiX12g.js.map +1 -0
- package/dist/lib/components/index.js +26 -26
- package/dist/lib/components/settings/shadow-claw-accounts.js +1 -1
- package/dist/lib/components/settings/shadow-claw-channel-config.js +1 -1
- package/dist/lib/components/settings/shadow-claw-control-plane.js +1 -1
- package/dist/lib/components/settings/shadow-claw-git.js +1 -1
- package/dist/lib/components/settings/shadow-claw-integrations.js +1 -1
- package/dist/lib/components/settings/shadow-claw-llm.js +1 -1
- package/dist/lib/components/settings/shadow-claw-mcp-remote.js +1 -1
- package/dist/lib/components/settings/shadow-claw-networking.js +1 -1
- package/dist/lib/components/settings/shadow-claw-notifications.js +1 -1
- package/dist/lib/components/settings/shadow-claw-peerjs.js +1 -1
- package/dist/lib/components/settings/shadow-claw-storage.js +1 -1
- package/dist/lib/components/settings/shadow-claw-task-server.js +1 -1
- package/dist/lib/components/settings/shadow-claw-webvm.js +1 -1
- package/dist/lib/components/shadow-claw/utils/syncSlottedSidebarActiveLinks.d.ts +10 -0
- package/dist/lib/components/shadow-claw-a2ui.js +1 -1
- package/dist/lib/components/shadow-claw-accounts.js +1 -1
- package/dist/lib/components/shadow-claw-channel-config.js +1 -1
- package/dist/lib/components/shadow-claw-channels.js +1 -1
- package/dist/lib/components/shadow-claw-chat.js +1 -1
- package/dist/lib/components/shadow-claw-control-plane.js +1 -1
- package/dist/lib/components/shadow-claw-conversations.js +1 -1
- package/dist/lib/components/shadow-claw-file-viewer/shadow-claw-file-viewer.d.ts +1 -1
- package/dist/lib/components/shadow-claw-file-viewer.js +1 -1
- package/dist/lib/components/shadow-claw-files.js +1 -1
- package/dist/lib/components/shadow-claw-git.js +1 -1
- package/dist/lib/components/shadow-claw-integrations.js +1 -1
- package/dist/lib/components/shadow-claw-llm.js +1 -1
- package/dist/lib/components/shadow-claw-mcp-remote.js +1 -1
- package/dist/lib/components/shadow-claw-networking.js +1 -1
- package/dist/lib/components/shadow-claw-notifications.js +1 -1
- package/dist/lib/components/shadow-claw-page-header.js +1 -1
- package/dist/lib/components/shadow-claw-pages.js +1 -1
- package/dist/lib/components/shadow-claw-peerjs.js +1 -1
- package/dist/lib/components/shadow-claw-settings.js +1 -1
- package/dist/lib/components/shadow-claw-storage.js +1 -1
- package/dist/lib/components/shadow-claw-task-server.js +1 -1
- package/dist/lib/components/shadow-claw-tasks.js +1 -1
- package/dist/lib/components/shadow-claw-terminal.js +1 -1
- package/dist/lib/components/shadow-claw-tools.js +1 -1
- package/dist/lib/components/shadow-claw-webvm.js +1 -1
- package/dist/lib/components/shadow-claw.js +1 -1
- package/dist/lib/{config-CPHDmyTx.js → config-DZkF9LiO.js} +2 -2
- package/dist/lib/{config-CPHDmyTx.js.map → config-DZkF9LiO.js.map} +1 -1
- package/dist/lib/{configurePeerJs-BsJoycQd.js → configurePeerJs-B3IE9BY2.js} +3 -3
- package/dist/lib/{configurePeerJs-BsJoycQd.js.map → configurePeerJs-B3IE9BY2.js.map} +1 -1
- package/dist/lib/{connections-BdIru7bF.js → connections-CalJGWvZ.js} +2 -2
- package/dist/lib/{connections-BdIru7bF.js.map → connections-CalJGWvZ.js.map} +1 -1
- package/dist/lib/core/orchestrator/orchestrator-state.d.ts +2 -1
- package/dist/lib/core/orchestrator/orchestrator.d.ts +2 -1
- package/dist/lib/core/orchestrator/utils/operations/task.d.ts +1 -0
- package/dist/lib/{downloadGroupFile-Dn0KsMlV.js → downloadGroupFile-DDE1fIhJ.js} +2 -2
- package/dist/lib/{downloadGroupFile-Dn0KsMlV.js.map → downloadGroupFile-DDE1fIhJ.js.map} +1 -1
- package/dist/lib/{file-viewer-BYrXXu-X.js → file-viewer-Bll2EoGc.js} +5 -5
- package/dist/lib/{file-viewer-BYrXXu-X.js.map → file-viewer-Bll2EoGc.js.map} +1 -1
- package/dist/lib/{getGroupDir-DF-RZO8X.js → getGroupDir-MHv7Lvmp.js} +4 -4
- package/dist/lib/{getGroupDir-DF-RZO8X.js.map → getGroupDir-MHv7Lvmp.js.map} +1 -1
- package/dist/lib/{git-s_0cgKm1.js → git-Bv_M3dgw.js} +3 -3
- package/dist/lib/{git-s_0cgKm1.js.map → git-Bv_M3dgw.js.map} +1 -1
- package/dist/lib/{iframe-sanitizer-DFdda1jJ.js → iframe-sanitizer-C7ZGDjEI.js} +2 -2
- package/dist/lib/{iframe-sanitizer-DFdda1jJ.js.map → iframe-sanitizer-C7ZGDjEI.js.map} +1 -1
- package/dist/lib/{iframe-storage-proxy-qrhZmQyO.js → iframe-storage-proxy-CR8ZYHPd.js} +2 -2
- package/dist/lib/{iframe-storage-proxy-qrhZmQyO.js.map → iframe-storage-proxy-CR8ZYHPd.js.map} +1 -1
- package/dist/lib/index.js +27 -27
- package/dist/lib/{initChatSplitResize-DuNlwCuI.js → initChatSplitResize-DiKTI-wk.js} +2 -2
- package/dist/lib/{initChatSplitResize-DuNlwCuI.js.map → initChatSplitResize-DiKTI-wk.js.map} +1 -1
- package/dist/lib/{initControlPlane-D4UZ4EhV.js → initControlPlane-CzjtQ4aM.js} +15 -15
- package/dist/lib/{initControlPlane-D4UZ4EhV.js.map → initControlPlane-CzjtQ4aM.js.map} +1 -1
- package/dist/lib/{markdown-CRRwbN9h.js → markdown-k8wA9LKy.js} +4 -4
- package/dist/lib/{markdown-CRRwbN9h.js.map → markdown-k8wA9LKy.js.map} +1 -1
- package/dist/lib/{mcp-reconnect-COdZ-cea.js → mcp-reconnect-CGIdfZnS.js} +2 -2
- package/dist/lib/{mcp-reconnect-COdZ-cea.js.map → mcp-reconnect-CGIdfZnS.js.map} +1 -1
- package/dist/lib/{memoryStorage-BsMe2FOQ.js → memoryStorage-DL-Bo3dh.js} +2 -2
- package/dist/lib/{memoryStorage-BsMe2FOQ.js.map → memoryStorage-DL-Bo3dh.js.map} +1 -1
- package/dist/lib/{orchestrator-D9f5fDCb.js → orchestrator-DKHCoikY.js} +11 -11
- package/dist/lib/{orchestrator-D9f5fDCb.js.map → orchestrator-DKHCoikY.js.map} +1 -1
- package/dist/lib/{orchestrator-Bq9ft3uG.js → orchestrator-Dn1ZOz9B.js} +20 -24
- package/dist/lib/orchestrator-Dn1ZOz9B.js.map +1 -0
- package/dist/lib/{peerjs-6u8KtenE.js → peerjs-BK41iBvP.js} +7 -7
- package/dist/lib/{peerjs-6u8KtenE.js.map → peerjs-BK41iBvP.js.map} +1 -1
- package/dist/lib/{push-client-DCnB2-OU.js → push-client-DKgVFD2Z.js} +3 -3
- package/dist/lib/{push-client-DCnB2-OU.js.map → push-client-DKgVFD2Z.js.map} +1 -1
- package/dist/lib/{readGroupFileBytes-nKNJ6sbl.js → readGroupFileBytes-CgU_UfGv.js} +2 -2
- package/dist/lib/{readGroupFileBytes-nKNJ6sbl.js.map → readGroupFileBytes-CgU_UfGv.js.map} +1 -1
- package/dist/lib/{shadow-claw-MumteAJy.js → shadow-claw-CtCj5Rn_.js} +121 -16
- package/dist/lib/shadow-claw-CtCj5Rn_.js.map +1 -0
- package/dist/lib/{shadow-claw-a2ui-Dipe8nY2.js → shadow-claw-a2ui-CvK5w940.js} +2 -2
- package/dist/lib/{shadow-claw-a2ui-Dipe8nY2.js.map → shadow-claw-a2ui-CvK5w940.js.map} +1 -1
- package/dist/lib/{shadow-claw-accounts-BgCkz3Zv.js → shadow-claw-accounts-Br3XdHro.js} +3 -3
- package/dist/lib/{shadow-claw-accounts-BgCkz3Zv.js.map → shadow-claw-accounts-Br3XdHro.js.map} +1 -1
- package/dist/lib/{shadow-claw-channel-config-CIm_Bxd2.js → shadow-claw-channel-config-Da2dN19M.js} +3 -3
- package/dist/lib/{shadow-claw-channel-config-CIm_Bxd2.js.map → shadow-claw-channel-config-Da2dN19M.js.map} +1 -1
- package/dist/lib/{shadow-claw-channels-CaceK52s.js → shadow-claw-channels-BofYHgz8.js} +3 -3
- package/dist/lib/{shadow-claw-channels-CaceK52s.js.map → shadow-claw-channels-BofYHgz8.js.map} +1 -1
- package/dist/lib/{shadow-claw-chat-BD18-mAR.js → shadow-claw-chat-Dw32DPV2.js} +12 -12
- package/dist/lib/{shadow-claw-chat-BD18-mAR.js.map → shadow-claw-chat-Dw32DPV2.js.map} +1 -1
- package/dist/lib/{shadow-claw-control-plane-U6LsfRPm.js → shadow-claw-control-plane-CwFotFDh.js} +7 -7
- package/dist/lib/{shadow-claw-control-plane-U6LsfRPm.js.map → shadow-claw-control-plane-CwFotFDh.js.map} +1 -1
- package/dist/lib/{shadow-claw-conversations-CDsza_oB.js → shadow-claw-conversations-0UXge23k.js} +5 -5
- package/dist/lib/{shadow-claw-conversations-CDsza_oB.js.map → shadow-claw-conversations-0UXge23k.js.map} +1 -1
- package/dist/lib/{shadow-claw-file-viewer-CMOnFmcP.js → shadow-claw-file-viewer-CAsn9NxH.js} +30 -30
- package/dist/lib/{shadow-claw-file-viewer-CMOnFmcP.js.map → shadow-claw-file-viewer-CAsn9NxH.js.map} +1 -1
- package/dist/lib/{shadow-claw-files-BI0P3m8a.js → shadow-claw-files-xGGhsHNH.js} +9 -9
- package/dist/lib/{shadow-claw-files-BI0P3m8a.js.map → shadow-claw-files-xGGhsHNH.js.map} +1 -1
- package/dist/lib/{shadow-claw-git-xRApLEMN.js → shadow-claw-git-B606hcMU.js} +6 -6
- package/dist/lib/{shadow-claw-git-xRApLEMN.js.map → shadow-claw-git-B606hcMU.js.map} +1 -1
- package/dist/lib/{shadow-claw-integrations-B2e1Nfg1.js → shadow-claw-integrations-Bwq5cba1.js} +4 -4
- package/dist/lib/{shadow-claw-integrations-B2e1Nfg1.js.map → shadow-claw-integrations-Bwq5cba1.js.map} +1 -1
- package/dist/lib/{shadow-claw-llm-Bc2mWuGb.js → shadow-claw-llm-BgpcMBIy.js} +6 -6
- package/dist/lib/{shadow-claw-llm-Bc2mWuGb.js.map → shadow-claw-llm-BgpcMBIy.js.map} +1 -1
- package/dist/lib/{shadow-claw-mcp-remote-D_Bh3aeC.js → shadow-claw-mcp-remote-DvQCA-Bk.js} +4 -4
- package/dist/lib/{shadow-claw-mcp-remote-D_Bh3aeC.js.map → shadow-claw-mcp-remote-DvQCA-Bk.js.map} +1 -1
- package/dist/lib/{shadow-claw-networking-F5W3n5ci.js → shadow-claw-networking-Cxvf9c7E.js} +2 -2
- package/dist/lib/{shadow-claw-networking-F5W3n5ci.js.map → shadow-claw-networking-Cxvf9c7E.js.map} +1 -1
- package/dist/lib/{shadow-claw-notifications-lvMt9WJ1.js → shadow-claw-notifications-CGVcFYBy.js} +3 -3
- package/dist/lib/{shadow-claw-notifications-lvMt9WJ1.js.map → shadow-claw-notifications-CGVcFYBy.js.map} +1 -1
- package/dist/lib/{shadow-claw-page-header-6gq6EMqX.js → shadow-claw-page-header-DAYz3I_o.js} +2 -2
- package/dist/lib/{shadow-claw-page-header-6gq6EMqX.js.map → shadow-claw-page-header-DAYz3I_o.js.map} +1 -1
- package/dist/lib/{shadow-claw-pages-Bo8_z2S-.js → shadow-claw-pages-BLeEZb9k.js} +24 -12
- package/dist/lib/shadow-claw-pages-BLeEZb9k.js.map +1 -0
- package/dist/lib/{shadow-claw-peerjs-DRTLCVDQ.js → shadow-claw-peerjs-BcFnbK74.js} +3 -3
- package/dist/lib/{shadow-claw-peerjs-DRTLCVDQ.js.map → shadow-claw-peerjs-BcFnbK74.js.map} +1 -1
- package/dist/lib/{shadow-claw-settings-D00B4p4L.js → shadow-claw-settings-B7o0Z4hu.js} +9 -9
- package/dist/lib/{shadow-claw-settings-D00B4p4L.js.map → shadow-claw-settings-B7o0Z4hu.js.map} +1 -1
- package/dist/lib/{shadow-claw-storage-DgMe7-Zo.js → shadow-claw-storage-afMVqB7E.js} +5 -5
- package/dist/lib/{shadow-claw-storage-DgMe7-Zo.js.map → shadow-claw-storage-afMVqB7E.js.map} +1 -1
- package/dist/lib/{shadow-claw-task-server-D103YOuI.js → shadow-claw-task-server-B9-MQjl6.js} +2 -2
- package/dist/lib/{shadow-claw-task-server-D103YOuI.js.map → shadow-claw-task-server-B9-MQjl6.js.map} +1 -1
- package/dist/lib/{shadow-claw-tasks-6OhALkq1.js → shadow-claw-tasks-Dc4BC-t-.js} +8 -8
- package/dist/lib/{shadow-claw-tasks-6OhALkq1.js.map → shadow-claw-tasks-Dc4BC-t-.js.map} +1 -1
- package/dist/lib/{shadow-claw-terminal-BGtxA1qD.js → shadow-claw-terminal-BINcTdsk.js} +2 -2
- package/dist/lib/{shadow-claw-terminal-BGtxA1qD.js.map → shadow-claw-terminal-BINcTdsk.js.map} +1 -1
- package/dist/lib/{shadow-claw-tools-OeIwAnnd.js → shadow-claw-tools-BjFgXNLR.js} +7 -7
- package/dist/lib/{shadow-claw-tools-OeIwAnnd.js.map → shadow-claw-tools-BjFgXNLR.js.map} +1 -1
- package/dist/lib/{shadow-claw-webvm-gVFZ197u.js → shadow-claw-webvm-Xe3ByMDw.js} +3 -3
- package/dist/lib/{shadow-claw-webvm-gVFZ197u.js.map → shadow-claw-webvm-Xe3ByMDw.js.map} +1 -1
- package/dist/lib/subsystems/mcp/webmcp.d.ts +64 -0
- package/dist/lib/{syncWebMcpRegistration-Bbph0XZl.js → syncWebMcpRegistration-D7alChz0.js} +21 -6
- package/dist/lib/syncWebMcpRegistration-D7alChz0.js.map +1 -0
- package/dist/lib/{tools-D0OlSzMD.js → tools-Cmhpk3X8.js} +4 -4
- package/dist/lib/{tools-D0OlSzMD.js.map → tools-Cmhpk3X8.js.map} +1 -1
- package/dist/lib/utils/index.js +1 -1
- package/dist/lib/utils/namespacedStorage.js +1 -1
- package/dist/lib/utils/utils.js +1 -1
- package/dist/lib/{utils-DYdrO2KI.js → utils-CzgKe_XZ.js} +4 -4
- package/dist/lib/{utils-DYdrO2KI.js.map → utils-CzgKe_XZ.js.map} +1 -1
- package/dist/lib/{webmcp-D2bocsgh.js → webmcp-oEP9YpR2.js} +119 -3
- package/dist/lib/{webmcp-D2bocsgh.js.map → webmcp-oEP9YpR2.js.map} +1 -1
- package/dist/public/.well-known/mcp/server-card.json +2 -2
- package/dist/public/.well-known/mcp/servers.json +1 -1
- package/dist/public/.well-known/mcp.json +2 -2
- package/dist/public/AGENTS.md +2 -1
- package/dist/public/README.md +1 -0
- package/dist/public/agent.worker.js +1 -1
- package/dist/public/app-routes-C6-H2zPH.js +1 -0
- package/dist/public/components/shadow-claw/shadow-claw.css +1 -1
- package/dist/public/components/shadow-claw/shadow-claw.html +1 -1
- package/dist/public/components/shadow-claw-pages/shadow-claw-pages.css +1 -1
- package/dist/public/{config-D4lVqMs8.js → config-Dewnqegf.js} +1 -1
- package/dist/public/{configurePeerJs-DDOAVSaH.js → configurePeerJs-CaPU2sN5.js} +1 -1
- package/dist/public/{connections-CiukjGiH.js → connections-CwE7jE9l.js} +1 -1
- package/dist/public/{custom-element-security-piU2U-Ec.js → custom-element-security-DLgHMf5R.js} +1 -1
- package/dist/public/docs/decisions/native-web-components-and-signals.md +1 -1
- package/dist/public/docs/example/article/index.html +5 -5
- package/dist/public/docs/guides/publishing-to-github-pages.md +49 -6
- package/dist/public/docs/publishing/index.html +5 -5
- package/dist/public/docs/skill-creator/index.html +5 -5
- package/dist/public/docs/subsystems/pages.md +10 -3
- package/dist/public/docs/subsystems/webmcp.md +89 -1
- package/dist/public/{downloadGroupFile-BiZQYY-O.js → downloadGroupFile-ChWHuap_.js} +1 -1
- package/dist/public/e2e/README.md +2 -2
- package/dist/public/{e2e-bridge-CybB810Q.js → e2e-bridge-BkaldjV2.js} +1 -1
- package/dist/public/{file-viewer-DLUBvOVD.js → file-viewer-Df4qUJCn.js} +1 -1
- package/dist/public/{getGroupDir-CLz5c8cg.js → getGroupDir-CeSr4fzS.js} +1 -1
- package/dist/public/{git-Ba8AeviI.js → git-Bscc1tK-.js} +2 -2
- package/dist/public/{iframe-sanitizer-CKOO7cxp.js → iframe-sanitizer-BVdkQsor.js} +1 -1
- package/dist/public/{iframe-storage-proxy-BvRiccH0.js → iframe-storage-proxy-Cg8aFw7o.js} +1 -1
- package/dist/public/index.css +1 -1
- package/dist/public/index.html +5 -5
- package/dist/public/index.js +1 -1
- package/dist/public/{initChatSplitResize-osJXM2gu.js → initChatSplitResize-C3Rp1LeZ.js} +1 -1
- package/dist/public/{initControlPlane-CNggzsRw.js → initControlPlane-C1pnzG16.js} +1 -1
- package/dist/public/llms.txt +1 -1
- package/dist/public/main/index.html +5 -5
- package/dist/public/main/memory/index.html +5 -5
- package/dist/public/{markdown-CZA-Ye2Q.js → markdown-D3A902nT.js} +1 -1
- package/dist/public/{mcp-reconnect-BK1bYBdC.js → mcp-reconnect-BJWxQBm_.js} +1 -1
- package/dist/public/{memoryStorage-Bew1X8Uy.js → memoryStorage-ykv-Ri-y.js} +1 -1
- package/dist/public/{orchestrator-D6tel2Zp.js → orchestrator-BVnC4Vtt.js} +2 -2
- package/dist/public/{orchestrator-BLkS_jpm.js → orchestrator-CQcc7OFA.js} +2 -2
- package/dist/public/{peerjs-CYs1F7sq.js → peerjs-CYC2cI1Y.js} +1 -1
- package/dist/public/{push-client-_HUyJlFJ.js → push-client-BJrnOULM.js} +1 -1
- package/dist/public/service-worker/fetch-proxy.js +1 -1
- package/dist/public/service-worker.js +1 -1
- package/dist/public/{shadow-claw-DmrxnX3Q.js → shadow-claw-WwfOu-tu.js} +33 -3
- package/dist/public/{shadow-claw-accounts-BqGrm47Z.js → shadow-claw-accounts-BFZxrPsH.js} +1 -1
- package/dist/public/{shadow-claw-channels-Ci2UPaaA.js → shadow-claw-channels-C0w0c1EF.js} +1 -1
- package/dist/public/{shadow-claw-chat-BxR6cBYQ.js → shadow-claw-chat-DIJ0A-QN.js} +1 -1
- package/dist/public/{shadow-claw-control-plane-C1A-CZ9H.js → shadow-claw-control-plane-DZoxUd-1.js} +2 -2
- package/dist/public/{shadow-claw-conversations-DcwG05-H.js → shadow-claw-conversations-DMyG_5zj.js} +1 -1
- package/dist/public/{shadow-claw-file-viewer-a_uRA30F.js → shadow-claw-file-viewer-DYgZjZb9.js} +2 -2
- package/dist/public/{shadow-claw-files-B774Xz1d.js → shadow-claw-files-DIOUdKJr.js} +1 -1
- package/dist/public/{shadow-claw-git-CTIPP0vs.js → shadow-claw-git-if5S0QJr.js} +2 -2
- package/dist/public/{shadow-claw-integrations-CjtkA6l0.js → shadow-claw-integrations-BQt4hcWe.js} +1 -1
- package/dist/public/{shadow-claw-llm-DfmITHde.js → shadow-claw-llm-9uf1KFA0.js} +2 -2
- package/dist/public/{shadow-claw-mcp-remote-BPuV22So.js → shadow-claw-mcp-remote-COpNIzJd.js} +1 -1
- package/dist/public/{shadow-claw-networking-DEMMygy0.js → shadow-claw-networking-AOVRUn6B.js} +1 -1
- package/dist/public/{shadow-claw-notifications-B9Xhcj1P.js → shadow-claw-notifications-CKB-W1TA.js} +1 -1
- package/dist/public/{shadow-claw-page-header-CAXokjQy.js → shadow-claw-page-header-D4LmUigA.js} +1 -1
- package/dist/public/{shadow-claw-pages-BRQw8bTm.js → shadow-claw-pages-BpHRY4vH.js} +12 -3
- package/dist/public/{shadow-claw-settings-BGrDNyqh.js → shadow-claw-settings-CE-aUo_J.js} +3 -3
- package/dist/public/{shadow-claw-storage-DK3pf11w.js → shadow-claw-storage-CFKC-Y3V.js} +1 -1
- package/dist/public/{shadow-claw-task-server-CMp5Vjza.js → shadow-claw-task-server-B_ZjqK4B.js} +1 -1
- package/dist/public/{shadow-claw-tasks-BO8aXM2B.js → shadow-claw-tasks-CGsEv48K.js} +1 -1
- package/dist/public/{shadow-claw-terminal-BSeTuyDa.js → shadow-claw-terminal-DcaS7cPH.js} +1 -1
- package/dist/public/{shadow-claw-tools-Bj6DLZ-2.js → shadow-claw-tools-Cnu9hKy0.js} +1 -1
- package/dist/public/{shadow-claw-webvm-M7d5RH8H.js → shadow-claw-webvm-BB8SFvJ8.js} +1 -1
- package/dist/public/syncWebMcpRegistration-D2Zx4oA1.js +1 -0
- package/dist/public/theme-init.js +1 -1
- package/dist/public/{tools-nysPKnGT.js → tools-sOLCHTj8.js} +1 -1
- package/dist/public/{webmcp-Bo3KTgRb.js → webmcp-YFt6vM1_.js} +1 -1
- package/dist/server.js +189 -189
- package/package.json +1 -1
- package/src/cli/cli.ts +2 -2
- package/src/cli/prerender/dsd-shell/prerender-dsd-shell.test.ts +4 -1
- package/src/cli/prerender/dsd-shell/prerender-dsd-shell.ts +7 -1
- package/src/cli/prerender/utils/insert-before-closing-head.test.ts +12 -0
- package/src/cli/prerender/utils/insert-before-closing-head.ts +4 -6
- package/src/cli/site-config/apply.test.ts +90 -0
- package/src/cli/site-config/apply.ts +181 -13
- package/src/components/shadow-claw/shadow-claw.css +26 -0
- package/src/components/shadow-claw/shadow-claw.html +4 -0
- package/src/components/shadow-claw/utils/applyRoute.ts +3 -0
- package/src/components/shadow-claw/utils/bindEventListeners.test.ts +6 -0
- package/src/components/shadow-claw/utils/bindEventListeners.ts +30 -1
- package/src/components/shadow-claw/utils/getRoute.test.ts +52 -0
- package/src/components/shadow-claw/utils/getRoute.ts +18 -0
- package/src/components/shadow-claw/utils/navigateToRoute.test.ts +21 -0
- package/src/components/shadow-claw/utils/navigateToRoute.ts +10 -0
- package/src/components/shadow-claw/utils/sidebarVisibility.ts +12 -4
- package/src/components/shadow-claw/utils/syncSlottedSidebarActiveLinks.test.ts +93 -0
- package/src/components/shadow-claw/utils/syncSlottedSidebarActiveLinks.ts +100 -0
- package/src/components/shadow-claw-file-viewer/shadow-claw-file-viewer.ts +31 -31
- package/src/components/shadow-claw-pages/shadow-claw-pages.css +10 -1
- package/src/components/shadow-claw-pages/utils/removePreviewIframe.ts +3 -0
- package/src/core/effect.test.ts +19 -0
- package/src/core/orchestrator/orchestrator-state.ts +2 -1
- package/src/core/orchestrator/orchestrator.test.ts +686 -5
- package/src/core/orchestrator/orchestrator.ts +3 -10
- package/src/core/orchestrator/utils/compactContext.test.ts +423 -121
- package/src/core/orchestrator/utils/configurePeerJs.test.ts +27 -0
- package/src/core/orchestrator/utils/deliverResponse.test.ts +127 -0
- package/src/core/orchestrator/utils/dispatchSubagentInvoke.test.ts +23 -0
- package/src/core/orchestrator/utils/enqueue.test.ts +520 -86
- package/src/core/orchestrator/utils/handleWorkerMessage.test.ts +664 -144
- package/src/core/orchestrator/utils/initTasks.node.test.ts +147 -0
- package/src/core/orchestrator/utils/initTasks.test.ts +926 -191
- package/src/core/orchestrator/utils/initTasks.ts +5 -4
- package/src/core/orchestrator/utils/invokeAgent.test.ts +563 -110
- package/src/core/orchestrator/utils/invokeAgent.ts +8 -10
- package/src/core/orchestrator/utils/loadChannelConfigurations.test.ts +50 -0
- package/src/core/orchestrator/utils/operations/channel.test.ts +377 -170
- package/src/core/orchestrator/utils/operations/provider.test.ts +663 -85
- package/src/core/orchestrator/utils/operations/room.test.ts +74 -11
- package/src/core/orchestrator/utils/operations/task.test.ts +452 -56
- package/src/core/orchestrator/utils/operations/task.ts +1 -1
- package/src/core/orchestrator/utils/operations/vm.test.ts +66 -7
- package/src/core/orchestrator/utils/parseDirectToolCommand.test.ts +6 -0
- package/src/core/orchestrator/utils/settings.test.ts +248 -81
- package/src/core/orchestrator/utils/setupPushTaskListener.test.ts +58 -0
- package/src/core/orchestrator/utils/syncWebMcpRegistration.test.ts +392 -64
- package/src/core/orchestrator/utils/syncWebMcpRegistration.ts +32 -3
- package/src/server/middleware/static-files.test.ts +36 -0
- package/src/server/middleware/static-files.ts +14 -6
- package/src/server/routes/mcp.ts +2 -2
- package/src/storage/staticRouting.test.ts +36 -0
- package/src/storage/staticRouting.ts +31 -3
- package/src/stores/file-viewer.test.ts +11 -0
- package/src/stores/theme.test.ts +41 -2
- package/src/stores/toast.test.ts +25 -0
- package/src/subsystems/mcp/webmcp.test.ts +255 -0
- package/src/subsystems/mcp/webmcp.ts +253 -0
- package/src/worker/tools/bash/native-bash-executor.test.ts +31 -1
- package/src/worker/tools/git/utils/extractConflictPaths.test.ts +24 -0
- package/src/worker/tools/git/utils/parseConflictRegions.test.ts +46 -0
- package/src/worker/tools/git/utils/resolveCorsProxy.test.ts +26 -5
- package/src/worker/tools/git/utils/truncateSnippet.test.ts +16 -0
- package/src/worker/tools/node-transformers-executor.test.ts +105 -6
- package/src/worker/tools/remote-mcp/remote-mcp.test.ts +172 -47
- package/src/worker/tools/remote-mcp/utils/formatListToolsOutput.test.ts +19 -0
- package/src/worker/tools/remote-mcp/utils/isMcpReauthError.test.ts +45 -0
- package/src/worker/tools/remote-mcp/utils/resolveMcpReauth.test.ts +48 -0
- package/src/worker/tools/rooms/list-room-members.test.ts +24 -10
- package/src/worker/tools/tasks/list-tasks.test.ts +39 -8
- package/src/worker/tools/tasks/update-task.test.ts +78 -14
- package/src/worker/tools/ui/javascript.test.ts +70 -17
- package/src/worker/tools/ui/list-tool-profiles.test.ts +31 -9
- package/dist/cli/chunk-00GAzVPl2.js +0 -1
- package/dist/cli/chunk-2hnFoNNC.js +0 -1
- package/dist/cli/chunk-BKQL4nzF2.js +0 -1
- package/dist/cli/chunk-BQ4K3fqj2.js +0 -1
- package/dist/cli/chunk-BVCGo6uf2.js +0 -1
- package/dist/cli/chunk-BcTH_-FL.js +0 -1
- package/dist/cli/chunk-BmD_sPRt.js +0 -1
- package/dist/cli/chunk-BsxNqqer.js +0 -1
- package/dist/cli/chunk-CCcF5T-c.js +0 -1
- package/dist/cli/chunk-CFhvwUeL.js +0 -91
- package/dist/cli/chunk-CwWtvULn.js +0 -1
- package/dist/cli/chunk-Drf-hXIR2.js +0 -1
- package/dist/cli/chunk-Dt5HNYVi.js +0 -1
- package/dist/cli/chunk-DwZQi9Ax.js +0 -1
- package/dist/cli/chunk-m9ZX7TyF2.js +0 -1
- package/dist/lib/app-routes-BAEMLu9g.js.map +0 -1
- package/dist/lib/orchestrator-Bq9ft3uG.js.map +0 -1
- package/dist/lib/shadow-claw-MumteAJy.js.map +0 -1
- package/dist/lib/shadow-claw-pages-Bo8_z2S-.js.map +0 -1
- package/dist/lib/syncWebMcpRegistration-Bbph0XZl.js.map +0 -1
- package/dist/public/app-routes-BMQ4HFaM.js +0 -1
- package/dist/public/syncWebMcpRegistration-4bT0YUyZ.js +0 -1
|
@@ -1,52 +1,128 @@
|
|
|
1
|
-
import { jest } from "@jest/globals";
|
|
1
|
+
import { beforeEach, describe, expect, it, jest } from "@jest/globals";
|
|
2
|
+
import { DEFAULT_GROUP_ID } from "../../../../config/config.js";
|
|
3
|
+
import type { MessageAttachment } from "../../../../content/types.js";
|
|
4
|
+
import type { ShadowClawDatabase } from "../../../../db/db.js";
|
|
5
|
+
import type {
|
|
6
|
+
Channel,
|
|
7
|
+
ChannelType,
|
|
8
|
+
} from "../../../../subsystems/channels/types.js";
|
|
9
|
+
import type { OrchestratorState } from "../../orchestrator-state.js";
|
|
2
10
|
|
|
3
|
-
|
|
4
|
-
|
|
11
|
+
const mockDefaultSetConfig =
|
|
12
|
+
jest.fn<
|
|
13
|
+
(_db: ShadowClawDatabase, _key: string, _val: string) => Promise<void>
|
|
14
|
+
>();
|
|
15
|
+
const mockDefaultGetConfig =
|
|
16
|
+
jest.fn<
|
|
17
|
+
(_db: ShadowClawDatabase, _key: string) => Promise<string | undefined>
|
|
18
|
+
>();
|
|
19
|
+
const mockEncryptValue = jest.fn<(val: string) => Promise<string | null>>();
|
|
20
|
+
const mockDecryptValue = jest.fn<(val: string) => Promise<string | null>>();
|
|
21
|
+
const mockSetRemoteAgentTyping =
|
|
22
|
+
jest.fn<(groupId: string, typing: boolean) => void>();
|
|
23
|
+
|
|
24
|
+
jest.unstable_mockModule("../../../../db/setConfig.js", () => ({
|
|
25
|
+
setConfig: mockDefaultSetConfig,
|
|
26
|
+
}));
|
|
27
|
+
|
|
28
|
+
jest.unstable_mockModule("../../../../db/getConfig.js", () => ({
|
|
29
|
+
getConfig: mockDefaultGetConfig,
|
|
30
|
+
}));
|
|
31
|
+
|
|
32
|
+
jest.unstable_mockModule("../../../../security/crypto.js", () => ({
|
|
33
|
+
encryptValue: mockEncryptValue,
|
|
34
|
+
decryptValue: mockDecryptValue,
|
|
35
|
+
}));
|
|
36
|
+
|
|
37
|
+
jest.unstable_mockModule("../../../../stores/orchestrator.js", () => ({
|
|
38
|
+
orchestratorStore: {
|
|
39
|
+
setRemoteAgentTyping: mockSetRemoteAgentTyping,
|
|
40
|
+
},
|
|
41
|
+
}));
|
|
42
|
+
|
|
43
|
+
const {
|
|
44
|
+
applyAllChannelRunningStates,
|
|
45
|
+
applyChannelRunningState,
|
|
46
|
+
clearPeerJsTypingState,
|
|
47
|
+
configureIMessage,
|
|
48
|
+
configureTelegram,
|
|
5
49
|
getChannelByType,
|
|
6
50
|
getChannelEnabled,
|
|
51
|
+
getChannelEnabledConfigKey,
|
|
52
|
+
getChannelTypeForGroup,
|
|
53
|
+
getIMessageConfig,
|
|
7
54
|
getPeerJsConfig,
|
|
8
55
|
getTelegramConfig,
|
|
9
|
-
getIMessageConfig,
|
|
10
|
-
getChannelEnabledConfigKey,
|
|
11
|
-
shouldRunChannel,
|
|
12
|
-
applyAllChannelRunningStates,
|
|
13
|
-
clearPeerJsTypingState,
|
|
14
56
|
loadChannelEnabled,
|
|
57
|
+
saveSecretConfig,
|
|
15
58
|
setChannelEnabled,
|
|
59
|
+
shouldRunChannel,
|
|
16
60
|
submitMessage,
|
|
17
|
-
|
|
18
|
-
configureIMessage,
|
|
19
|
-
configureTelegram,
|
|
20
|
-
} from "./channel.js";
|
|
61
|
+
} = await import("./channel.js");
|
|
21
62
|
|
|
22
|
-
|
|
23
|
-
|
|
63
|
+
interface MockChannel extends Channel {
|
|
64
|
+
ensureConnected?: (force: boolean) => void;
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
function makeChannel(
|
|
68
|
+
running = false,
|
|
69
|
+
ensureConnected?: (force: boolean) => void,
|
|
70
|
+
): MockChannel {
|
|
71
|
+
const ch: MockChannel = {
|
|
72
|
+
running,
|
|
73
|
+
start: jest.fn(),
|
|
74
|
+
stop: jest.fn(),
|
|
75
|
+
submit: jest.fn(),
|
|
76
|
+
configure: jest.fn(),
|
|
77
|
+
} as unknown as MockChannel;
|
|
78
|
+
if (ensureConnected) {
|
|
79
|
+
ch.ensureConnected = ensureConnected;
|
|
80
|
+
}
|
|
81
|
+
return ch;
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
interface MockOrchestratorState {
|
|
85
|
+
browserChat: MockChannel;
|
|
86
|
+
telegram: MockChannel;
|
|
87
|
+
imessage: MockChannel;
|
|
88
|
+
peerjs: MockChannel;
|
|
89
|
+
channelEnabledByType: Partial<Record<ChannelType, boolean>>;
|
|
90
|
+
telegramBotToken: string;
|
|
91
|
+
telegramChatIds: string[];
|
|
92
|
+
telegramUseProxy: boolean;
|
|
93
|
+
imessageServerUrl: string;
|
|
94
|
+
imessageApiKey: string;
|
|
95
|
+
imessageChatIds: string[];
|
|
96
|
+
peerjsMyAlias: string;
|
|
97
|
+
peerjsMyPeerId: string;
|
|
98
|
+
peerjsPeerAliases: Record<string, string>;
|
|
99
|
+
peerjsServerHost: string;
|
|
100
|
+
peerjsServerPath: string;
|
|
101
|
+
peerjsServerPort: number;
|
|
102
|
+
peerjsServerSecure: boolean;
|
|
103
|
+
peerjsTrustedPeerIds: string[];
|
|
104
|
+
}
|
|
24
105
|
|
|
25
|
-
function makeState(overrides: Partial<
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
stop: jest.fn(),
|
|
40
|
-
configure: jest.fn(),
|
|
41
|
-
} as any,
|
|
42
|
-
peerjs: { start: jest.fn(), stop: jest.fn(), configure: jest.fn() } as any,
|
|
43
|
-
channelEnabledByType: { telegram: false, imessage: false, peerjs: false },
|
|
106
|
+
function makeState(overrides: Partial<MockOrchestratorState> = {}) {
|
|
107
|
+
const defaultChannelEnabled: Record<ChannelType, boolean> = {
|
|
108
|
+
browser: true,
|
|
109
|
+
telegram: false,
|
|
110
|
+
imessage: false,
|
|
111
|
+
peerjs: false,
|
|
112
|
+
room: false,
|
|
113
|
+
};
|
|
114
|
+
const base: MockOrchestratorState = {
|
|
115
|
+
browserChat: makeChannel(),
|
|
116
|
+
telegram: makeChannel(),
|
|
117
|
+
imessage: makeChannel(),
|
|
118
|
+
peerjs: makeChannel(),
|
|
119
|
+
channelEnabledByType: { ...defaultChannelEnabled },
|
|
44
120
|
telegramBotToken: "",
|
|
45
|
-
telegramChatIds: [],
|
|
121
|
+
telegramChatIds: [] as string[],
|
|
46
122
|
telegramUseProxy: false,
|
|
47
123
|
imessageServerUrl: "",
|
|
48
124
|
imessageApiKey: "",
|
|
49
|
-
imessageChatIds: [],
|
|
125
|
+
imessageChatIds: [] as string[],
|
|
50
126
|
peerjsMyAlias: "",
|
|
51
127
|
peerjsMyPeerId: "",
|
|
52
128
|
peerjsPeerAliases: {},
|
|
@@ -54,30 +130,45 @@ function makeState(overrides: Partial<OrchestratorState> = {}) {
|
|
|
54
130
|
peerjsServerPath: "/",
|
|
55
131
|
peerjsServerPort: 443,
|
|
56
132
|
peerjsServerSecure: true,
|
|
57
|
-
peerjsTrustedPeerIds: [],
|
|
58
|
-
|
|
59
|
-
|
|
133
|
+
peerjsTrustedPeerIds: [] as string[],
|
|
134
|
+
};
|
|
135
|
+
const merged = Object.assign(base, overrides);
|
|
136
|
+
if (overrides.channelEnabledByType) {
|
|
137
|
+
merged.channelEnabledByType = {
|
|
138
|
+
...defaultChannelEnabled,
|
|
139
|
+
...overrides.channelEnabledByType,
|
|
140
|
+
};
|
|
141
|
+
}
|
|
142
|
+
return merged as unknown as OrchestratorState;
|
|
60
143
|
}
|
|
61
144
|
|
|
62
145
|
describe("channel operations", () => {
|
|
146
|
+
const mockDb = {} as ShadowClawDatabase;
|
|
147
|
+
|
|
148
|
+
beforeEach(() => {
|
|
149
|
+
jest.clearAllMocks();
|
|
150
|
+
mockDefaultSetConfig.mockResolvedValue(undefined);
|
|
151
|
+
mockDefaultGetConfig.mockResolvedValue(undefined);
|
|
152
|
+
mockEncryptValue.mockImplementation(async (val) => `enc:${val}`);
|
|
153
|
+
});
|
|
154
|
+
|
|
63
155
|
it("getChannelTypeForGroup returns registered type or default browser", () => {
|
|
64
156
|
const stateWithRegistry = {
|
|
65
157
|
channelRegistry: {
|
|
66
|
-
getChannelType:
|
|
67
|
-
gId.startsWith("tg:") ? "telegram" : null,
|
|
68
|
-
),
|
|
158
|
+
getChannelType: (gId: string) =>
|
|
159
|
+
gId.startsWith("tg:") ? ("telegram" as ChannelType) : null,
|
|
69
160
|
},
|
|
70
161
|
};
|
|
71
|
-
expect(getChannelTypeForGroup(stateWithRegistry
|
|
162
|
+
expect(getChannelTypeForGroup(stateWithRegistry, "tg:123")).toBe(
|
|
72
163
|
"telegram",
|
|
73
164
|
);
|
|
74
|
-
expect(getChannelTypeForGroup(stateWithRegistry
|
|
165
|
+
expect(getChannelTypeForGroup(stateWithRegistry, "br:main")).toBe(
|
|
75
166
|
"browser",
|
|
76
167
|
);
|
|
77
168
|
expect(getChannelTypeForGroup({}, "br:main")).toBe("browser");
|
|
78
169
|
});
|
|
79
170
|
|
|
80
|
-
it("getChannelByType returns the correct channel", () => {
|
|
171
|
+
it("getChannelByType returns the correct channel or null for unknown", () => {
|
|
81
172
|
const state = makeState();
|
|
82
173
|
expect(getChannelByType(state, "browser")).toBe(state.browserChat);
|
|
83
174
|
expect(getChannelByType(state, "telegram")).toBe(state.telegram);
|
|
@@ -86,214 +177,306 @@ describe("channel operations", () => {
|
|
|
86
177
|
expect(getChannelByType(state, "unknown" as ChannelType)).toBeNull();
|
|
87
178
|
});
|
|
88
179
|
|
|
89
|
-
it("getChannelEnabled
|
|
180
|
+
it("getChannelEnabled returns true for browser and checks map for others", () => {
|
|
90
181
|
const state = makeState({
|
|
91
182
|
channelEnabledByType: {
|
|
92
183
|
telegram: true,
|
|
93
184
|
imessage: false,
|
|
94
185
|
peerjs: false,
|
|
95
|
-
}
|
|
186
|
+
},
|
|
96
187
|
});
|
|
97
188
|
expect(getChannelEnabled(state, "browser")).toBe(true);
|
|
98
189
|
expect(getChannelEnabled(state, "telegram")).toBe(true);
|
|
99
190
|
expect(getChannelEnabled(state, "imessage")).toBe(false);
|
|
100
191
|
});
|
|
101
192
|
|
|
102
|
-
it("
|
|
193
|
+
it("getChannelEnabledConfigKey formats key properly", () => {
|
|
194
|
+
expect(getChannelEnabledConfigKey("telegram")).toBe(
|
|
195
|
+
"channel_enabled:telegram",
|
|
196
|
+
);
|
|
197
|
+
});
|
|
198
|
+
|
|
199
|
+
it("getTelegramConfig, getIMessageConfig, and getPeerJsConfig return current config", () => {
|
|
103
200
|
const state = makeState({
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
imessage: true,
|
|
107
|
-
peerjs: true,
|
|
108
|
-
} as any,
|
|
109
|
-
telegramBotToken: "tok-1",
|
|
110
|
-
telegramChatIds: ["chat-1"],
|
|
201
|
+
telegramBotToken: "tok",
|
|
202
|
+
telegramChatIds: ["tg1"],
|
|
111
203
|
telegramUseProxy: true,
|
|
112
|
-
imessageServerUrl: "http://
|
|
113
|
-
imessageApiKey: "key
|
|
114
|
-
imessageChatIds: ["
|
|
115
|
-
peerjsMyAlias: "
|
|
116
|
-
peerjsMyPeerId: "
|
|
117
|
-
peerjsPeerAliases: {
|
|
118
|
-
peerjsServerHost: "
|
|
119
|
-
peerjsServerPath: "/
|
|
204
|
+
imessageServerUrl: "http://imsg",
|
|
205
|
+
imessageApiKey: "key",
|
|
206
|
+
imessageChatIds: ["im1"],
|
|
207
|
+
peerjsMyAlias: "alias",
|
|
208
|
+
peerjsMyPeerId: "peer1",
|
|
209
|
+
peerjsPeerAliases: { p2: "a2" },
|
|
210
|
+
peerjsServerHost: "host",
|
|
211
|
+
peerjsServerPath: "/p",
|
|
120
212
|
peerjsServerPort: 9000,
|
|
121
213
|
peerjsServerSecure: false,
|
|
122
|
-
peerjsTrustedPeerIds: ["
|
|
214
|
+
peerjsTrustedPeerIds: ["trust1"],
|
|
123
215
|
});
|
|
124
216
|
|
|
125
217
|
expect(getTelegramConfig(state)).toEqual({
|
|
126
|
-
botToken: "tok
|
|
127
|
-
chatIds: ["
|
|
128
|
-
enabled:
|
|
218
|
+
botToken: "tok",
|
|
219
|
+
chatIds: ["tg1"],
|
|
220
|
+
enabled: false,
|
|
129
221
|
useProxy: true,
|
|
130
222
|
});
|
|
131
223
|
|
|
132
224
|
expect(getIMessageConfig(state)).toEqual({
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
225
|
+
apiKey: "key",
|
|
226
|
+
chatIds: ["im1"],
|
|
227
|
+
enabled: false,
|
|
228
|
+
serverUrl: "http://imsg",
|
|
137
229
|
});
|
|
138
230
|
|
|
139
231
|
expect(getPeerJsConfig(state)).toEqual({
|
|
140
|
-
enabled:
|
|
141
|
-
myAlias: "
|
|
142
|
-
myPeerId: "
|
|
143
|
-
peerAliases: {
|
|
144
|
-
serverHost: "
|
|
145
|
-
serverPath: "/
|
|
232
|
+
enabled: false,
|
|
233
|
+
myAlias: "alias",
|
|
234
|
+
myPeerId: "peer1",
|
|
235
|
+
peerAliases: { p2: "a2" },
|
|
236
|
+
serverHost: "host",
|
|
237
|
+
serverPath: "/p",
|
|
146
238
|
serverPort: 9000,
|
|
147
239
|
serverSecure: false,
|
|
148
|
-
trustedPeerIds: ["
|
|
240
|
+
trustedPeerIds: ["trust1"],
|
|
149
241
|
});
|
|
150
242
|
});
|
|
151
243
|
|
|
152
|
-
it("
|
|
153
|
-
expect(getChannelEnabledConfigKey("telegram")).toBe(
|
|
154
|
-
"channel_enabled:telegram",
|
|
155
|
-
);
|
|
156
|
-
expect(getChannelEnabledConfigKey("imessage")).toBe(
|
|
157
|
-
"channel_enabled:imessage",
|
|
158
|
-
);
|
|
159
|
-
});
|
|
160
|
-
|
|
161
|
-
it("shouldRunChannel works", () => {
|
|
244
|
+
it("shouldRunChannel evaluates readiness for each channel type", () => {
|
|
162
245
|
const state = makeState({
|
|
163
246
|
channelEnabledByType: {
|
|
164
247
|
telegram: true,
|
|
165
|
-
peerjs: false,
|
|
166
248
|
imessage: true,
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
249
|
+
peerjs: true,
|
|
250
|
+
custom: true,
|
|
251
|
+
} as unknown as Record<ChannelType, boolean>,
|
|
252
|
+
telegramBotToken: "tok",
|
|
253
|
+
imessageServerUrl: "http://imsg",
|
|
170
254
|
peerjsMyPeerId: "peer1",
|
|
171
255
|
});
|
|
256
|
+
|
|
172
257
|
expect(shouldRunChannel(state, "browser")).toBe(true);
|
|
173
258
|
expect(shouldRunChannel(state, "telegram")).toBe(true);
|
|
174
259
|
expect(shouldRunChannel(state, "imessage")).toBe(true);
|
|
175
|
-
expect(shouldRunChannel(state, "peerjs")).toBe(
|
|
176
|
-
|
|
260
|
+
expect(shouldRunChannel(state, "peerjs")).toBe(true);
|
|
261
|
+
expect(shouldRunChannel(state, "custom" as ChannelType)).toBe(true);
|
|
177
262
|
|
|
178
|
-
|
|
179
|
-
const
|
|
263
|
+
// When disabled
|
|
264
|
+
const disabledState = makeState();
|
|
265
|
+
expect(shouldRunChannel(disabledState, "telegram")).toBe(false);
|
|
266
|
+
|
|
267
|
+
// When enabled but missing token/url/id
|
|
268
|
+
const incompleteState = makeState({
|
|
180
269
|
channelEnabledByType: {
|
|
181
270
|
telegram: true,
|
|
182
|
-
imessage:
|
|
183
|
-
peerjs:
|
|
184
|
-
}
|
|
185
|
-
telegramBotToken: "token",
|
|
271
|
+
imessage: true,
|
|
272
|
+
peerjs: true,
|
|
273
|
+
},
|
|
186
274
|
});
|
|
275
|
+
expect(shouldRunChannel(incompleteState, "telegram")).toBe(false);
|
|
276
|
+
expect(shouldRunChannel(incompleteState, "imessage")).toBe(false);
|
|
277
|
+
expect(shouldRunChannel(incompleteState, "peerjs")).toBe(false);
|
|
278
|
+
});
|
|
187
279
|
|
|
188
|
-
|
|
189
|
-
|
|
280
|
+
it("applyChannelRunningState handles null channel, starting, stopping, and ensureConnected", () => {
|
|
281
|
+
const state = makeState();
|
|
282
|
+
|
|
283
|
+
// Unknown channel does nothing
|
|
284
|
+
expect(() =>
|
|
285
|
+
applyChannelRunningState(state, "unknown" as ChannelType),
|
|
286
|
+
).not.toThrow();
|
|
287
|
+
|
|
288
|
+
// Not running and should run -> starts channel
|
|
289
|
+
state.channelEnabledByType.telegram = true;
|
|
290
|
+
state.telegramBotToken = "token";
|
|
291
|
+
applyChannelRunningState(state, "telegram");
|
|
190
292
|
expect(state.telegram.start).toHaveBeenCalled();
|
|
191
|
-
|
|
192
|
-
|
|
293
|
+
|
|
294
|
+
// Already running and should run -> calls ensureConnected if present
|
|
295
|
+
const ensureMock = jest.fn();
|
|
296
|
+
const runningTelegram = makeChannel(true, ensureMock);
|
|
297
|
+
const runningState = makeState({
|
|
298
|
+
channelEnabledByType: { telegram: true, imessage: false, peerjs: false },
|
|
299
|
+
telegramBotToken: "token",
|
|
300
|
+
telegram: runningTelegram,
|
|
301
|
+
});
|
|
302
|
+
|
|
303
|
+
applyChannelRunningState(runningState, "telegram", true);
|
|
304
|
+
expect(ensureMock).toHaveBeenCalledWith(true);
|
|
305
|
+
|
|
306
|
+
// Running but should not run -> stops channel
|
|
307
|
+
const shouldStopTelegram = makeChannel(true);
|
|
308
|
+
const stopState = makeState({
|
|
309
|
+
telegram: shouldStopTelegram,
|
|
310
|
+
});
|
|
311
|
+
applyChannelRunningState(stopState, "telegram");
|
|
312
|
+
expect(shouldStopTelegram.stop).toHaveBeenCalled();
|
|
193
313
|
});
|
|
194
314
|
|
|
195
|
-
it("
|
|
196
|
-
const ensureConnectedMock = jest.fn();
|
|
315
|
+
it("applyAllChannelRunningStates applies state across all remote channels", () => {
|
|
197
316
|
const state = makeState({
|
|
198
|
-
channelEnabledByType: { telegram: true
|
|
317
|
+
channelEnabledByType: { telegram: true, imessage: false, peerjs: false },
|
|
199
318
|
telegramBotToken: "token",
|
|
200
|
-
telegram: {
|
|
201
|
-
running: true,
|
|
202
|
-
start: jest.fn(),
|
|
203
|
-
stop: jest.fn(),
|
|
204
|
-
ensureConnected: ensureConnectedMock,
|
|
205
|
-
} as any,
|
|
206
319
|
});
|
|
207
320
|
|
|
208
|
-
applyAllChannelRunningStates(state
|
|
209
|
-
expect(
|
|
321
|
+
applyAllChannelRunningStates(state);
|
|
322
|
+
expect(state.telegram.start).toHaveBeenCalled();
|
|
210
323
|
});
|
|
211
324
|
|
|
212
|
-
it("clearPeerJsTypingState
|
|
213
|
-
|
|
325
|
+
it("clearPeerJsTypingState clears typing indicators on orchestratorStore", () => {
|
|
326
|
+
mockSetRemoteAgentTyping.mockClear();
|
|
327
|
+
clearPeerJsTypingState("group-123");
|
|
328
|
+
expect(mockSetRemoteAgentTyping).toHaveBeenCalledWith("group-123", false);
|
|
214
329
|
});
|
|
215
330
|
|
|
216
|
-
it("loadChannelEnabled
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
.mockResolvedValueOnce("false" as never)
|
|
221
|
-
.mockResolvedValueOnce(undefined as never);
|
|
222
|
-
|
|
223
|
-
expect(
|
|
224
|
-
await loadChannelEnabled("telegram", {} as any, mockGetConfig as any),
|
|
225
|
-
).toBe(true);
|
|
226
|
-
expect(
|
|
227
|
-
await loadChannelEnabled("telegram", {} as any, mockGetConfig as any),
|
|
228
|
-
).toBe(false);
|
|
229
|
-
expect(
|
|
230
|
-
await loadChannelEnabled("telegram", {} as any, mockGetConfig as any),
|
|
231
|
-
).toBe(false);
|
|
232
|
-
});
|
|
331
|
+
it("loadChannelEnabled uses default getConfig or passed getConfig", async () => {
|
|
332
|
+
mockDefaultGetConfig.mockResolvedValueOnce("true");
|
|
333
|
+
const loadedDefault = await loadChannelEnabled("telegram", mockDb);
|
|
334
|
+
expect(loadedDefault).toBe(true);
|
|
233
335
|
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
336
|
+
const customGetConfig = jest
|
|
337
|
+
.fn<
|
|
338
|
+
(_db: ShadowClawDatabase, _key: string) => Promise<string | undefined>
|
|
339
|
+
>()
|
|
340
|
+
.mockResolvedValue("false");
|
|
341
|
+
const loadedCustom = await loadChannelEnabled(
|
|
342
|
+
"imessage",
|
|
343
|
+
mockDb,
|
|
344
|
+
customGetConfig,
|
|
345
|
+
);
|
|
346
|
+
expect(loadedCustom).toBe(false);
|
|
239
347
|
|
|
240
|
-
await
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
true,
|
|
245
|
-
mockSetConfig as any,
|
|
348
|
+
const loadedMissing = await loadChannelEnabled(
|
|
349
|
+
"telegram",
|
|
350
|
+
mockDb,
|
|
351
|
+
async () => undefined,
|
|
246
352
|
);
|
|
247
|
-
expect(
|
|
353
|
+
expect(loadedMissing).toBe(false);
|
|
248
354
|
|
|
249
|
-
await
|
|
250
|
-
state,
|
|
251
|
-
{} as any,
|
|
355
|
+
const loadedEmpty = await loadChannelEnabled(
|
|
252
356
|
"telegram",
|
|
253
|
-
|
|
254
|
-
|
|
357
|
+
mockDb,
|
|
358
|
+
async () => "",
|
|
255
359
|
);
|
|
256
|
-
expect(
|
|
257
|
-
|
|
258
|
-
|
|
360
|
+
expect(loadedEmpty).toBe(false);
|
|
361
|
+
});
|
|
362
|
+
|
|
363
|
+
it("setChannelEnabled uses default setConfig or passed setConfig", async () => {
|
|
364
|
+
const state = makeState();
|
|
365
|
+
await setChannelEnabled(state, mockDb, "telegram", true);
|
|
366
|
+
expect(state.channelEnabledByType.telegram).toBe(true);
|
|
367
|
+
expect(mockDefaultSetConfig).toHaveBeenCalledWith(
|
|
368
|
+
mockDb,
|
|
259
369
|
"channel_enabled:telegram",
|
|
260
370
|
"true",
|
|
261
371
|
);
|
|
262
|
-
|
|
372
|
+
|
|
373
|
+
const customSetConfig = jest
|
|
374
|
+
.fn<
|
|
375
|
+
(_db: ShadowClawDatabase, _key: string, _val: string) => Promise<void>
|
|
376
|
+
>()
|
|
377
|
+
.mockResolvedValue(undefined);
|
|
378
|
+
await setChannelEnabled(state, mockDb, "imessage", false, customSetConfig);
|
|
379
|
+
expect(state.channelEnabledByType.imessage).toBe(false);
|
|
380
|
+
expect(customSetConfig).toHaveBeenCalledWith(
|
|
381
|
+
mockDb,
|
|
382
|
+
"channel_enabled:imessage",
|
|
383
|
+
"false",
|
|
384
|
+
);
|
|
385
|
+
|
|
386
|
+
// channelType === "browser" returns early without setting config
|
|
387
|
+
mockDefaultSetConfig.mockClear();
|
|
388
|
+
await setChannelEnabled(state, mockDb, "browser", true);
|
|
389
|
+
expect(mockDefaultSetConfig).not.toHaveBeenCalled();
|
|
263
390
|
});
|
|
264
391
|
|
|
265
|
-
it("submitMessage proxies call to browserChat", () => {
|
|
392
|
+
it("submitMessage proxies call to browserChat with explicit and default arguments", () => {
|
|
266
393
|
const state = makeState();
|
|
267
|
-
|
|
394
|
+
const attachments: MessageAttachment[] = [];
|
|
395
|
+
submitMessage(state, "Hello agent", "group-1", attachments);
|
|
268
396
|
expect(state.browserChat.submit).toHaveBeenCalledWith(
|
|
269
397
|
"Hello agent",
|
|
270
398
|
"group-1",
|
|
399
|
+
attachments,
|
|
400
|
+
undefined,
|
|
401
|
+
);
|
|
402
|
+
|
|
403
|
+
submitMessage(state, "Default params test");
|
|
404
|
+
expect(state.browserChat.submit).toHaveBeenCalledWith(
|
|
405
|
+
"Default params test",
|
|
406
|
+
DEFAULT_GROUP_ID,
|
|
271
407
|
[],
|
|
272
408
|
undefined,
|
|
273
409
|
);
|
|
274
410
|
});
|
|
275
411
|
|
|
276
|
-
it("
|
|
277
|
-
const
|
|
278
|
-
|
|
279
|
-
|
|
412
|
+
it("applyChannelRunningState handles running channel without ensureConnected", () => {
|
|
413
|
+
const state = makeState({
|
|
414
|
+
telegram: makeChannel(true),
|
|
415
|
+
channelEnabledByType: { telegram: true, imessage: false, peerjs: false },
|
|
416
|
+
telegramBotToken: "tok",
|
|
417
|
+
});
|
|
418
|
+
applyChannelRunningState(state, "telegram");
|
|
419
|
+
expect(state.telegram.start).not.toHaveBeenCalled();
|
|
280
420
|
});
|
|
281
421
|
|
|
282
|
-
it("
|
|
422
|
+
it("saveSecretConfig handles empty, encrypted values, and encryption errors", async () => {
|
|
423
|
+
const mockSetConfig = jest
|
|
424
|
+
.fn<
|
|
425
|
+
(_db: ShadowClawDatabase, _key: string, _val: string) => Promise<void>
|
|
426
|
+
>()
|
|
427
|
+
.mockResolvedValue(undefined);
|
|
428
|
+
|
|
429
|
+
// Empty value clears config
|
|
430
|
+
await saveSecretConfig(mockDb, "key1", "", mockSetConfig);
|
|
431
|
+
expect(mockSetConfig).toHaveBeenCalledWith(mockDb, "key1", "");
|
|
432
|
+
|
|
433
|
+
// Non-empty value encrypts and sets config
|
|
434
|
+
await saveSecretConfig(mockDb, "key2", "super-secret", mockSetConfig);
|
|
435
|
+
expect(mockEncryptValue).toHaveBeenCalledWith("super-secret");
|
|
436
|
+
expect(mockSetConfig).toHaveBeenCalledWith(
|
|
437
|
+
mockDb,
|
|
438
|
+
"key2",
|
|
439
|
+
"enc:super-secret",
|
|
440
|
+
);
|
|
441
|
+
|
|
442
|
+
// Uses default setConfig when omitted
|
|
443
|
+
await saveSecretConfig(mockDb, "key3", "val");
|
|
444
|
+
expect(mockDefaultSetConfig).toHaveBeenCalledWith(
|
|
445
|
+
mockDb,
|
|
446
|
+
"key3",
|
|
447
|
+
"enc:val",
|
|
448
|
+
);
|
|
449
|
+
|
|
450
|
+
// Throws if encryptValue returns null/empty
|
|
451
|
+
mockEncryptValue.mockResolvedValueOnce(null);
|
|
452
|
+
await expect(
|
|
453
|
+
saveSecretConfig(mockDb, "key4", "failed-val"),
|
|
454
|
+
).rejects.toThrow("Failed to encrypt secret config for key4");
|
|
455
|
+
});
|
|
456
|
+
|
|
457
|
+
it("configureIMessage and configureTelegram use custom and default configs", async () => {
|
|
283
458
|
const state = makeState({
|
|
284
|
-
channelEnabledByType: { telegram: true, imessage: true
|
|
459
|
+
channelEnabledByType: { telegram: true, imessage: true, peerjs: false },
|
|
285
460
|
});
|
|
286
|
-
const mockSetConfig = jest
|
|
287
|
-
|
|
461
|
+
const mockSetConfig = jest
|
|
462
|
+
.fn<
|
|
463
|
+
(_db: ShadowClawDatabase, _key: string, _val: string) => Promise<void>
|
|
464
|
+
>()
|
|
465
|
+
.mockResolvedValue(undefined);
|
|
466
|
+
const mockSaveSecret = jest
|
|
467
|
+
.fn<
|
|
468
|
+
(_db: ShadowClawDatabase, _key: string, _val: string) => Promise<void>
|
|
469
|
+
>()
|
|
470
|
+
.mockResolvedValue(undefined);
|
|
288
471
|
|
|
289
472
|
await configureIMessage(
|
|
290
473
|
state,
|
|
291
|
-
|
|
474
|
+
mockDb,
|
|
292
475
|
"http://imessage.local/",
|
|
293
476
|
"secret-key",
|
|
294
477
|
["chat1", "chat2"],
|
|
295
|
-
mockSetConfig
|
|
296
|
-
mockSaveSecret
|
|
478
|
+
mockSetConfig,
|
|
479
|
+
mockSaveSecret,
|
|
297
480
|
);
|
|
298
481
|
|
|
299
482
|
expect(state.imessage.stop).toHaveBeenCalled();
|
|
@@ -304,14 +487,27 @@ describe("channel operations", () => {
|
|
|
304
487
|
);
|
|
305
488
|
expect(state.imessage.start).toHaveBeenCalled();
|
|
306
489
|
|
|
490
|
+
// configureIMessage with defaults and empty url
|
|
491
|
+
const stateImDisabled = makeState({
|
|
492
|
+
channelEnabledByType: { telegram: false, imessage: false, peerjs: false },
|
|
493
|
+
});
|
|
494
|
+
await configureIMessage(stateImDisabled, mockDb, "", "", []);
|
|
495
|
+
expect(stateImDisabled.imessage.start).not.toHaveBeenCalled();
|
|
496
|
+
|
|
497
|
+
// configureIMessage with url but channel disabled
|
|
498
|
+
await configureIMessage(stateImDisabled, mockDb, "http://imsg.local", "k", [
|
|
499
|
+
"c",
|
|
500
|
+
]);
|
|
501
|
+
expect(stateImDisabled.imessage.start).not.toHaveBeenCalled();
|
|
502
|
+
|
|
307
503
|
await configureTelegram(
|
|
308
504
|
state,
|
|
309
|
-
|
|
505
|
+
mockDb,
|
|
310
506
|
"telegram-token",
|
|
311
507
|
["tg-chat-1"],
|
|
312
508
|
true,
|
|
313
|
-
mockSetConfig
|
|
314
|
-
mockSaveSecret
|
|
509
|
+
mockSetConfig,
|
|
510
|
+
mockSaveSecret,
|
|
315
511
|
);
|
|
316
512
|
|
|
317
513
|
expect(state.telegram.stop).toHaveBeenCalled();
|
|
@@ -321,5 +517,16 @@ describe("channel operations", () => {
|
|
|
321
517
|
true,
|
|
322
518
|
);
|
|
323
519
|
expect(state.telegram.start).toHaveBeenCalled();
|
|
520
|
+
|
|
521
|
+
// Call configureTelegram with defaults and empty token
|
|
522
|
+
const stateTgDisabled = makeState({
|
|
523
|
+
channelEnabledByType: { telegram: false, imessage: false, peerjs: false },
|
|
524
|
+
});
|
|
525
|
+
await configureTelegram(stateTgDisabled, mockDb, "", []);
|
|
526
|
+
expect(stateTgDisabled.telegram.start).not.toHaveBeenCalled();
|
|
527
|
+
|
|
528
|
+
// Call configureTelegram with token but channel disabled
|
|
529
|
+
await configureTelegram(stateTgDisabled, mockDb, "valid-token", ["chat"]);
|
|
530
|
+
expect(stateTgDisabled.telegram.start).not.toHaveBeenCalled();
|
|
324
531
|
});
|
|
325
532
|
});
|