shadow-claw 1.51.0 → 1.52.1
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 +1 -1
- package/.well-known/mcp.json +1 -1
- package/README.md +10 -10
- package/dist/cli/build/build.js +1 -1
- package/dist/cli/{chunk-Dtse8rAn.js → chunk-5ryVpyup.js} +1 -1
- package/dist/cli/chunk-Aq3057Xo.js +1 -0
- package/dist/cli/{chunk-4CZJpLqA.js → chunk-BV9JBYpl.js} +2 -2
- package/dist/cli/{chunk-mbFAP9Ev.js → chunk-BZI3bWDA.js} +1 -1
- package/dist/cli/chunk-BaUCHRPD.js +1 -0
- package/dist/cli/{chunk-vzUrhBN5.js → chunk-BdbEt6gM.js} +1 -1
- package/dist/cli/{chunk-DYq-orHK.js → chunk-BgTv9w0K.js} +1 -1
- package/dist/cli/{chunk-BU8UG4L_.js → chunk-BiWLawPV.js} +1 -1
- package/dist/cli/chunk-BkLnHJeo.js +1 -0
- package/dist/cli/{chunk-BqfPWIBf.js → chunk-BzWY1sKE.js} +1 -1
- package/dist/cli/{chunk-DajM7Kro.js → chunk-C79eIU-4.js} +1 -1
- package/dist/cli/{chunk-CI9r1AM5.js → chunk-CDw214Zi.js} +1 -1
- package/dist/cli/chunk-CNqc7LLn.js +1 -0
- package/dist/cli/{chunk-CEhU-Ah-.js → chunk-CWW7dqIv.js} +1 -1
- package/dist/cli/{chunk-BT_C3OlA.js → chunk-CcSTYHtR.js} +1 -1
- package/dist/cli/chunk-ClOfk6Ga.js +1 -0
- package/dist/cli/chunk-ComXUwW0.js +1 -0
- package/dist/cli/{chunk-lL1BhHVe.js → chunk-CooeO4UQ.js} +1 -1
- package/dist/cli/{chunk-khr7--yI.js → chunk-CtfWY4G6.js} +1 -1
- package/dist/cli/{chunk-C4iW1XuQ.js → chunk-DFgSiYMW.js} +1 -1
- package/dist/cli/chunk-DGBnjngK.js +1 -0
- package/dist/cli/{chunk-D7bFIUK3.js → chunk-DGu1OhJs.js} +1 -1
- package/dist/cli/{chunk-CzfOerQR.js → chunk-DIjCY0Wf.js} +1 -1
- package/dist/cli/{chunk-D-iqEY5G.js → chunk-DJ_LeQtz.js} +1 -1
- package/dist/cli/{chunk-BmEsDkRK.js → chunk-DQRu-9wO.js} +1 -1
- package/dist/cli/{chunk-DojiYody.js → chunk-DToVgO9a.js} +1 -1
- package/dist/cli/{chunk-De5a_Rlp.js → chunk-DVbNkQRL.js} +1 -1
- package/dist/cli/{chunk-c8MIYB2y.js → chunk-Ddtzaj43.js} +1 -1
- package/dist/cli/{chunk-aJ6fufe-.js → chunk-DiqS56rD.js} +1 -1
- package/dist/cli/{chunk-CeUEmZNt.js → chunk-DnRcu9b4.js} +1 -1
- package/dist/cli/chunk-DtgZDsJA.js +1 -0
- package/dist/cli/{chunk-DVMcK7g6.js → chunk-Du4qvxo_.js} +2 -2
- package/dist/cli/{chunk-CegcvNc9.js → chunk-Dz5_hgvL.js} +8 -8
- package/dist/cli/{chunk-Cd4Dv5Eq.js → chunk-I3mxEelq.js} +1 -1
- package/dist/cli/{chunk-Do3VICh1.js → chunk-IU2SH_ti.js} +1 -1
- package/dist/cli/{chunk-BQveaAaD.js → chunk-NC8XsSSA.js} +1 -1
- package/dist/cli/{chunk-D702W_Ry.js → chunk-Q4BZ9QN9.js} +1 -1
- package/dist/cli/chunk-WTlDd4Ou.js +1 -0
- package/dist/cli/chunk-XGzq5joC.js +1 -0
- package/dist/cli/{chunk-ar7eAlxK.js → chunk-aJfaGe2s.js} +8 -8
- package/dist/cli/chunk-bPVrFlmk.js +1 -0
- package/dist/cli/{chunk-C6jii2Fl.js → chunk-d5hIhj8t.js} +1 -1
- package/dist/cli/chunk-jXJHKxdR.js +1 -0
- package/dist/cli/{chunk-C3dTAmV_.js → chunk-rstVU7U0.js} +1 -1
- package/dist/cli/{chunk-DGfTzQui.js → chunk-t72uObQ7.js} +1 -1
- package/dist/cli/{chunk-DDgfljzN.js → chunk-vq8xlroY.js} +1 -1
- package/dist/cli/cli.js +1 -1
- package/dist/headless-agent.js +1 -1
- package/dist/lib/components/common/shadow-claw-provider-model-picker.js +1 -1
- package/dist/lib/components/index.js +27 -27
- 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/model-ranking.d.ts +12 -0
- 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-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/shadow-claw-chat.d.ts +1 -0
- 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.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-provider-model-picker.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/config.d.ts +2 -1
- package/dist/lib/{config-DxDaVDTn.js → config-DFLs7eoC.js} +3 -2
- package/dist/lib/config-DFLs7eoC.js.map +1 -0
- package/dist/lib/{configurePeerJs-ScwZiGbF.js → configurePeerJs-DJ0H6e6s.js} +3 -3
- package/dist/lib/{configurePeerJs-ScwZiGbF.js.map → configurePeerJs-DJ0H6e6s.js.map} +1 -1
- package/dist/lib/{connections-D82zele0.js → connections-DT3nPylw.js} +2 -2
- package/dist/lib/{connections-D82zele0.js.map → connections-DT3nPylw.js.map} +1 -1
- package/dist/lib/{downloadGroupFile-D7-5y6NI.js → downloadGroupFile-DMnAiPj4.js} +2 -2
- package/dist/lib/{downloadGroupFile-D7-5y6NI.js.map → downloadGroupFile-DMnAiPj4.js.map} +1 -1
- package/dist/lib/{file-viewer-BMvvndPQ.js → file-viewer-OHmGC_l7.js} +5 -5
- package/dist/lib/{file-viewer-BMvvndPQ.js.map → file-viewer-OHmGC_l7.js.map} +1 -1
- package/dist/lib/{getGroupDir-BidwYPfP.js → getGroupDir-mTV2Iz2b.js} +3 -3
- package/dist/lib/{getGroupDir-BidwYPfP.js.map → getGroupDir-mTV2Iz2b.js.map} +1 -1
- package/dist/lib/{git-CXmWufWS.js → git-CGdKghMC.js} +3 -3
- package/dist/lib/{git-CXmWufWS.js.map → git-CGdKghMC.js.map} +1 -1
- package/dist/lib/index.js +28 -28
- package/dist/lib/{initChatSplitResize-tvUZ-wsp.js → initChatSplitResize-B8zHHQdm.js} +2 -2
- package/dist/lib/{initChatSplitResize-tvUZ-wsp.js.map → initChatSplitResize-B8zHHQdm.js.map} +1 -1
- package/dist/lib/{initControlPlane-Dnjkb-6J.js → initControlPlane-BczrlTf3.js} +14 -14
- package/dist/lib/{initControlPlane-Dnjkb-6J.js.map → initControlPlane-BczrlTf3.js.map} +1 -1
- package/dist/lib/{markdown-WCXar9C8.js → markdown-D-7Cjyye.js} +3 -3
- package/dist/lib/{markdown-WCXar9C8.js.map → markdown-D-7Cjyye.js.map} +1 -1
- package/dist/lib/{mcp-reconnect-WTOQONHZ.js → mcp-reconnect-Czf7QCCv.js} +2 -2
- package/dist/lib/{mcp-reconnect-WTOQONHZ.js.map → mcp-reconnect-Czf7QCCv.js.map} +1 -1
- package/dist/lib/{memoryStorage-Bo2Wpfmg.js → memoryStorage-CXyKsKMo.js} +2 -2
- package/dist/lib/{memoryStorage-Bo2Wpfmg.js.map → memoryStorage-CXyKsKMo.js.map} +1 -1
- package/dist/lib/model-ranking-Bo8CpGH1.js +116 -0
- package/dist/lib/model-ranking-Bo8CpGH1.js.map +1 -0
- package/dist/lib/{orchestrator-Crw4btGn.js → orchestrator-BK138MkV.js} +10 -10
- package/dist/lib/{orchestrator-Crw4btGn.js.map → orchestrator-BK138MkV.js.map} +1 -1
- package/dist/lib/{orchestrator-Dro541iH.js → orchestrator-BtbxiPQB.js} +17 -16
- package/dist/lib/{orchestrator-Dro541iH.js.map → orchestrator-BtbxiPQB.js.map} +1 -1
- package/dist/lib/{peerjs-D741bHrf.js → peerjs-QJr03K9F.js} +7 -7
- package/dist/lib/{peerjs-D741bHrf.js.map → peerjs-QJr03K9F.js.map} +1 -1
- package/dist/lib/{prompt-api-D9XdrCep.js → prompt-api-vf351sf2.js} +2 -19
- package/dist/lib/{prompt-api-D9XdrCep.js.map → prompt-api-vf351sf2.js.map} +1 -1
- package/dist/lib/{push-client-DKFUY_Ti.js → push-client-BOHgqHbk.js} +4 -4
- package/dist/lib/{push-client-DKFUY_Ti.js.map → push-client-BOHgqHbk.js.map} +1 -1
- package/dist/lib/{readGroupFileBytes-C8Xqlb8l.js → readGroupFileBytes-CRA6dmgT.js} +2 -2
- package/dist/lib/{readGroupFileBytes-C8Xqlb8l.js.map → readGroupFileBytes-CRA6dmgT.js.map} +1 -1
- package/dist/lib/{shadow-claw-a2ui-CPydWVdW.js → shadow-claw-a2ui-DbZa4Gxp.js} +2 -2
- package/dist/lib/{shadow-claw-a2ui-CPydWVdW.js.map → shadow-claw-a2ui-DbZa4Gxp.js.map} +1 -1
- package/dist/lib/{shadow-claw-accounts-CUypXc3I.js → shadow-claw-accounts-B6OW2NVD.js} +3 -3
- package/dist/lib/{shadow-claw-accounts-CUypXc3I.js.map → shadow-claw-accounts-B6OW2NVD.js.map} +1 -1
- package/dist/lib/{shadow-claw-channel-config-D_Vb2ous.js → shadow-claw-channel-config-F_EJ-uK2.js} +3 -3
- package/dist/lib/{shadow-claw-channel-config-D_Vb2ous.js.map → shadow-claw-channel-config-F_EJ-uK2.js.map} +1 -1
- package/dist/lib/{shadow-claw-channels-hgjjzvRr.js → shadow-claw-channels-XYylMpjg.js} +3 -3
- package/dist/lib/{shadow-claw-channels-hgjjzvRr.js.map → shadow-claw-channels-XYylMpjg.js.map} +1 -1
- package/dist/lib/{shadow-claw-chat-D69IiLXd.js → shadow-claw-chat-dbK_DGO_.js} +124 -38
- package/dist/lib/shadow-claw-chat-dbK_DGO_.js.map +1 -0
- package/dist/lib/{shadow-claw-control-plane-zBYlFvzQ.js → shadow-claw-control-plane-BJKkmahQ.js} +7 -7
- package/dist/lib/{shadow-claw-control-plane-zBYlFvzQ.js.map → shadow-claw-control-plane-BJKkmahQ.js.map} +1 -1
- package/dist/lib/{shadow-claw-conversations-1GW8_e8o.js → shadow-claw-conversations-BKSsMYTc.js} +6 -6
- package/dist/lib/{shadow-claw-conversations-1GW8_e8o.js.map → shadow-claw-conversations-BKSsMYTc.js.map} +1 -1
- package/dist/lib/{shadow-claw-D3z3tFyE.js → shadow-claw-eBB2dbpd.js} +11 -11
- package/dist/lib/{shadow-claw-D3z3tFyE.js.map → shadow-claw-eBB2dbpd.js.map} +1 -1
- package/dist/lib/{shadow-claw-file-viewer-DI4r7Th9.js → shadow-claw-file-viewer-BqChtTvM.js} +8 -8
- package/dist/lib/{shadow-claw-file-viewer-DI4r7Th9.js.map → shadow-claw-file-viewer-BqChtTvM.js.map} +1 -1
- package/dist/lib/{shadow-claw-files-BM7qW3TW.js → shadow-claw-files-Bu7VCQw6.js} +9 -9
- package/dist/lib/{shadow-claw-files-BM7qW3TW.js.map → shadow-claw-files-Bu7VCQw6.js.map} +1 -1
- package/dist/lib/{shadow-claw-git-BBTiTYIn.js → shadow-claw-git-CdPPN6Qb.js} +6 -6
- package/dist/lib/{shadow-claw-git-BBTiTYIn.js.map → shadow-claw-git-CdPPN6Qb.js.map} +1 -1
- package/dist/lib/{shadow-claw-integrations-DTY3E545.js → shadow-claw-integrations-DehqBSRe.js} +4 -4
- package/dist/lib/{shadow-claw-integrations-DTY3E545.js.map → shadow-claw-integrations-DehqBSRe.js.map} +1 -1
- package/dist/lib/{shadow-claw-llm-AJwzkOGo.js → shadow-claw-llm-COZkufA8.js} +13 -11
- package/dist/lib/shadow-claw-llm-COZkufA8.js.map +1 -0
- package/dist/lib/{shadow-claw-mcp-remote-n7YXKxmv.js → shadow-claw-mcp-remote-axF50-le.js} +4 -4
- package/dist/lib/{shadow-claw-mcp-remote-n7YXKxmv.js.map → shadow-claw-mcp-remote-axF50-le.js.map} +1 -1
- package/dist/lib/{shadow-claw-networking-B3leDgZ4.js → shadow-claw-networking-BT_Rxj36.js} +2 -2
- package/dist/lib/{shadow-claw-networking-B3leDgZ4.js.map → shadow-claw-networking-BT_Rxj36.js.map} +1 -1
- package/dist/lib/{shadow-claw-notifications-Bm2aHQ0U.js → shadow-claw-notifications-ClqAXDDN.js} +3 -3
- package/dist/lib/{shadow-claw-notifications-Bm2aHQ0U.js.map → shadow-claw-notifications-ClqAXDDN.js.map} +1 -1
- package/dist/lib/{shadow-claw-page-header-BBqSWlhP.js → shadow-claw-page-header-bigC_h6U.js} +2 -2
- package/dist/lib/{shadow-claw-page-header-BBqSWlhP.js.map → shadow-claw-page-header-bigC_h6U.js.map} +1 -1
- package/dist/lib/{shadow-claw-pages-BFOcluFY.js → shadow-claw-pages-CjHS50HN.js} +10 -10
- package/dist/lib/{shadow-claw-pages-BFOcluFY.js.map → shadow-claw-pages-CjHS50HN.js.map} +1 -1
- package/dist/lib/{shadow-claw-peerjs-BvD_MH_l.js → shadow-claw-peerjs-CvcH2DkA.js} +3 -3
- package/dist/lib/{shadow-claw-peerjs-BvD_MH_l.js.map → shadow-claw-peerjs-CvcH2DkA.js.map} +1 -1
- package/dist/lib/{shadow-claw-provider-model-picker-CsA-507a.js → shadow-claw-provider-model-picker-fcVQdDtQ.js} +2 -2
- package/dist/lib/{shadow-claw-provider-model-picker-CsA-507a.js.map → shadow-claw-provider-model-picker-fcVQdDtQ.js.map} +1 -1
- package/dist/lib/{shadow-claw-settings-CZgGMz0a.js → shadow-claw-settings-CkO6JjA4.js} +6 -6
- package/dist/lib/{shadow-claw-settings-CZgGMz0a.js.map → shadow-claw-settings-CkO6JjA4.js.map} +1 -1
- package/dist/lib/{shadow-claw-storage-BTUpEKO0.js → shadow-claw-storage-10w-y8vL.js} +5 -5
- package/dist/lib/{shadow-claw-storage-BTUpEKO0.js.map → shadow-claw-storage-10w-y8vL.js.map} +1 -1
- package/dist/lib/{shadow-claw-task-server-B1X2AYyZ.js → shadow-claw-task-server-U98sZxPu.js} +2 -2
- package/dist/lib/{shadow-claw-task-server-B1X2AYyZ.js.map → shadow-claw-task-server-U98sZxPu.js.map} +1 -1
- package/dist/lib/{shadow-claw-tasks-BYtaRUAd.js → shadow-claw-tasks-DrSVUOsP.js} +8 -8
- package/dist/lib/{shadow-claw-tasks-BYtaRUAd.js.map → shadow-claw-tasks-DrSVUOsP.js.map} +1 -1
- package/dist/lib/{shadow-claw-terminal-LGuXKu77.js → shadow-claw-terminal-B7HYLuce.js} +2 -2
- package/dist/lib/{shadow-claw-terminal-LGuXKu77.js.map → shadow-claw-terminal-B7HYLuce.js.map} +1 -1
- package/dist/lib/{shadow-claw-tools-C_S-xXVG.js → shadow-claw-tools-BKrXzZfF.js} +7 -7
- package/dist/lib/{shadow-claw-tools-C_S-xXVG.js.map → shadow-claw-tools-BKrXzZfF.js.map} +1 -1
- package/dist/lib/{shadow-claw-webvm-Cab1n1bu.js → shadow-claw-webvm-Duwa5oiW.js} +3 -3
- package/dist/lib/{shadow-claw-webvm-Cab1n1bu.js.map → shadow-claw-webvm-Duwa5oiW.js.map} +1 -1
- package/dist/lib/{syncWebMcpRegistration-Dy5NS_4G.js → syncWebMcpRegistration-BOx-0F6_.js} +5 -5
- package/dist/lib/{syncWebMcpRegistration-Dy5NS_4G.js.map → syncWebMcpRegistration-BOx-0F6_.js.map} +1 -1
- package/dist/lib/{tools-B7gC1eb_.js → tools-BEuBatUs.js} +4 -4
- package/dist/lib/{tools-B7gC1eb_.js.map → tools-BEuBatUs.js.map} +1 -1
- package/dist/lib/utils/index.js +1 -1
- package/dist/lib/utils/utils.js +1 -1
- package/dist/lib/{utils-D_ylqOY-.js → utils-D8AxCH6m.js} +2 -2
- package/dist/lib/{utils-D_ylqOY-.js.map → utils-D8AxCH6m.js.map} +1 -1
- package/dist/lib/{webmcp-CkYINKJj.js → webmcp-BjfVWX1K.js} +2 -2
- package/dist/lib/{webmcp-CkYINKJj.js.map → webmcp-BjfVWX1K.js.map} +1 -1
- package/dist/public/.well-known/mcp/server-card.json +1 -1
- package/dist/public/.well-known/mcp.json +1 -1
- package/dist/public/AGENTS.md +1 -1
- package/dist/public/README.md +10 -10
- package/dist/public/agent.worker.js +1 -1
- package/dist/public/components/shadow-claw-chat/shadow-claw-chat.html +1 -1
- package/dist/public/config-071HSho8.js +1 -0
- package/dist/public/{configurePeerJs-DQQ6YL-5.js → configurePeerJs-DL-LurJY.js} +1 -1
- package/dist/public/{connections-CRNk2FxF.js → connections-Bb0rBpV-.js} +1 -1
- package/dist/public/{custom-element-security-3_FKCXcg.js → custom-element-security-Td4vrRc_.js} +1 -1
- package/dist/public/docs/README.md +1 -1
- package/dist/public/docs/architecture/orchestrator.md +2 -2
- package/dist/public/docs/architecture/overview.md +3 -3
- package/dist/public/docs/architecture/worker-protocol.md +29 -29
- package/dist/public/docs/example/article/index.html +1 -1
- package/dist/public/docs/example/article.html +1 -1
- package/dist/public/docs/publishing/index.html +1 -1
- package/dist/public/docs/publishing.html +1 -1
- package/dist/public/docs/skill-creator/index.html +1 -1
- package/dist/public/docs/skill-creator.html +1 -1
- package/dist/public/docs/subsystems/local-models.md +1 -1
- package/dist/public/docs/subsystems/providers.md +12 -5
- package/dist/public/{downloadGroupFile-wkdhVgrZ.js → downloadGroupFile-Unq8_7D9.js} +1 -1
- package/dist/public/e2e/README.md +2 -2
- package/dist/public/{e2e-bridge-DnFHPuwg.js → e2e-bridge-Dbc9fCDq.js} +1 -1
- package/dist/public/{file-viewer-C92v4Ggd.js → file-viewer-QkCuknFn.js} +1 -1
- package/dist/public/{getGroupDir-BGGIJL4Y.js → getGroupDir-Bj5XCflQ.js} +1 -1
- package/dist/public/{git-BH6qyToB.js → git-Bhz4YHc8.js} +2 -2
- package/dist/public/index.html +1 -1
- package/dist/public/index.js +1 -1
- package/dist/public/{initChatSplitResize--RH5kzVF.js → initChatSplitResize-KNL9Oh7s.js} +1 -1
- package/dist/public/{initControlPlane-yPJ3ajkj.js → initControlPlane-D2fVhRFC.js} +1 -1
- package/dist/public/llms.txt +1 -1
- package/dist/public/main/index.html +1 -1
- package/dist/public/main/memory/index.html +1 -1
- package/dist/public/main/memory.html +1 -1
- package/dist/public/main.html +1 -1
- package/dist/public/{markdown-CA0v11cd.js → markdown-By6gdUvF.js} +1 -1
- package/dist/public/{mcp-reconnect-uyNSigzu.js → mcp-reconnect-CDRJPuoN.js} +1 -1
- package/dist/public/{memoryStorage-DjPNAT5t.js → memoryStorage-C-ao9y-j.js} +1 -1
- package/dist/public/model-ranking-DUdrFOcC.js +1 -0
- package/dist/public/{orchestrator-DTzgyL23.js → orchestrator-B7MpomoG.js} +2 -2
- package/dist/public/{orchestrator-Cmr69pMC.js → orchestrator-C8aIHbDy.js} +2 -2
- package/dist/public/{peerjs-Br38mUFC.js → peerjs-DwGjY5VX.js} +1 -1
- package/dist/public/prompt-api-BWe_j3Wg.js +1 -0
- package/dist/public/{push-client-CB8haOGC.js → push-client-o8g5_EOe.js} +1 -1
- package/dist/public/service-worker.js +1 -1
- package/dist/public/{shadow-claw-RuFQ2Ej5.js → shadow-claw-T9oPpqxT.js} +2 -2
- package/dist/public/{shadow-claw-accounts-BMsEItB6.js → shadow-claw-accounts-BbNPiiaV.js} +1 -1
- package/dist/public/{shadow-claw-channels-Q_AXuEaI.js → shadow-claw-channels-CHGtPkfY.js} +1 -1
- package/dist/public/{shadow-claw-chat-DZQ3OaH7.js → shadow-claw-chat-3TmjJA6-.js} +90 -23
- package/dist/public/{shadow-claw-control-plane-CyXA8tB8.js → shadow-claw-control-plane-BAFT06LL.js} +2 -2
- package/dist/public/{shadow-claw-conversations-BLKtlvHe.js → shadow-claw-conversations-DsQ_kxWm.js} +1 -1
- package/dist/public/{shadow-claw-file-viewer-CVLDfpZe.js → shadow-claw-file-viewer-hBxTknL2.js} +1 -1
- package/dist/public/{shadow-claw-files-DB6VVjir.js → shadow-claw-files-Daw6IIrJ.js} +1 -1
- package/dist/public/{shadow-claw-git-D57bTSMF.js → shadow-claw-git-CxGwyxim.js} +2 -2
- package/dist/public/{shadow-claw-integrations-BOwhUY-4.js → shadow-claw-integrations-DnIr6xp-.js} +1 -1
- package/dist/public/{shadow-claw-llm-CYenm-mm.js → shadow-claw-llm-Bc6tZ8kk.js} +3 -3
- package/dist/public/{shadow-claw-mcp-remote-CJ-Ckl0j.js → shadow-claw-mcp-remote-nGPpFpI-.js} +1 -1
- package/dist/public/{shadow-claw-networking-Cut76YQL.js → shadow-claw-networking-B6YgtiA7.js} +1 -1
- package/dist/public/{shadow-claw-notifications-C3kYCrIa.js → shadow-claw-notifications-BSxifptS.js} +1 -1
- package/dist/public/{shadow-claw-page-header-Dd7QafUk.js → shadow-claw-page-header-LzVgEn46.js} +1 -1
- package/dist/public/{shadow-claw-pages-BWtVtwTG.js → shadow-claw-pages-IW_LNEL_.js} +2 -2
- package/dist/public/{shadow-claw-settings-Bj7jnngO.js → shadow-claw-settings-DGkwt1ge.js} +2 -2
- package/dist/public/{shadow-claw-storage-CMSzQs1-.js → shadow-claw-storage-DX_4T7KR.js} +1 -1
- package/dist/public/{shadow-claw-task-server-CFclo7UX.js → shadow-claw-task-server-DTsbEs5z.js} +1 -1
- package/dist/public/{shadow-claw-tasks-ClDdeB6Z.js → shadow-claw-tasks-rr6fMxAM.js} +1 -1
- package/dist/public/{shadow-claw-terminal-3ysWZJix.js → shadow-claw-terminal-C7DhrrX6.js} +1 -1
- package/dist/public/{shadow-claw-tools-DQVwpTcZ.js → shadow-claw-tools-DcQroojH.js} +1 -1
- package/dist/public/{shadow-claw-webvm-Cnxz04Fk.js → shadow-claw-webvm-bZj44Did.js} +1 -1
- package/dist/public/{syncWebMcpRegistration-QwnLMAK3.js → syncWebMcpRegistration-XJjIlDNO.js} +1 -1
- package/dist/public/{tools-DvQ_ngXn.js → tools-BpZh7hgB.js} +1 -1
- package/dist/public/{webmcp-CJymew4t.js → webmcp-CkfDZfZ0.js} +1 -1
- package/dist/server.js +1 -1
- package/package.json +1 -1
- package/src/cli/build/build.test.ts +95 -0
- package/src/cli/build/build.ts +5 -1
- package/src/cli/commands/agent.test.ts +134 -0
- package/src/cli/commands/backup.test.ts +85 -0
- package/src/cli/commands/clients.test.ts +32 -0
- package/src/cli/commands/mcp.test.ts +260 -1
- package/src/cli/commands/send-file.test.ts +73 -0
- package/src/cli/commands/send.test.ts +58 -0
- package/src/cli/commands/tasks.test.ts +78 -0
- package/src/cli/commands/webrtc-listen.test.ts +74 -0
- package/src/cli/tools/assert-version-bump.test.ts +30 -1
- package/src/cli/tools/file-search-replace.test.ts +33 -1
- package/src/cli/tools/patch-service-worker-trusted-types.test.ts +24 -1
- package/src/cli/tools/touch-nojekyll.test.ts +12 -0
- package/src/cli/tools/version.test.ts +109 -5
- package/src/cli/utils/agent-core.test.ts +40 -0
- package/src/cli/utils/control-client.test.ts +239 -2
- package/src/cli/utils/load-workspace-config.test.ts +63 -0
- package/src/cli/utils/local-models.test.ts +98 -0
- package/src/cli/utils/progress-bar.test.ts +41 -2
- package/src/cli/utils/resolve-cache-dir.test.ts +61 -0
- package/src/cli/utils/resolve-project-root.test.ts +17 -0
- package/src/cli/utils/stdin.test.ts +38 -0
- package/src/cli/utils/stdio.test.ts +51 -1
- package/src/cli/utils/suppress-warnings.test.ts +9 -0
- package/src/cli/utils/webrtc-control-client.test.ts +569 -0
- package/src/common/utils/frontmatter.test.ts +117 -0
- package/src/components/common/help/providers.test.ts +67 -0
- package/src/components/common/shadow-claw-provider-model-picker/shadow-claw-provider-model-picker.test.ts +121 -0
- package/src/components/settings/shadow-claw-accounts/shadow-claw-accounts.test.ts +131 -0
- package/src/components/settings/shadow-claw-git/shadow-claw-git.test.ts +130 -0
- package/src/components/settings/shadow-claw-integrations/connection-test-auth.test.ts +12 -0
- package/src/components/settings/shadow-claw-integrations/shadow-claw-integrations.test.ts +328 -0
- package/src/components/settings/shadow-claw-llm/model-ranking.test.ts +121 -7
- package/src/components/settings/shadow-claw-llm/model-ranking.ts +97 -0
- package/src/components/settings/shadow-claw-llm/shadow-claw-llm.test.ts +565 -8
- package/src/components/settings/shadow-claw-llm/shadow-claw-llm.ts +15 -5
- package/src/components/settings/shadow-claw-mcp-remote/shadow-claw-mcp-remote.test.ts +459 -0
- package/src/components/settings/shadow-claw-networking/shadow-claw-networking.test.ts +88 -0
- package/src/components/settings/shadow-claw-notifications/shadow-claw-notifications.test.ts +92 -0
- package/src/components/settings/shadow-claw-peerjs/shadow-claw-peerjs.test.ts +127 -0
- package/src/components/settings/shadow-claw-storage/shadow-claw-storage.test.ts +173 -0
- package/src/components/settings/shadow-claw-task-server/shadow-claw-task-server.test.ts +62 -0
- package/src/components/settings/shadow-claw-webvm/shadow-claw-webvm.test.ts +104 -0
- package/src/components/shadow-claw/shadow-claw.test.ts +112 -0
- package/src/components/shadow-claw-a2ui/shadow-claw-a2ui.test.ts +109 -0
- package/src/components/shadow-claw-chat/shadow-claw-chat.html +81 -14
- package/src/components/shadow-claw-chat/shadow-claw-chat.test.ts +73 -0
- package/src/components/shadow-claw-chat/shadow-claw-chat.trusted-types.test.ts +3 -0
- package/src/components/shadow-claw-chat/shadow-claw-chat.ts +79 -32
- package/src/components/shadow-claw-conversations/shadow-claw-conversations.test.ts +361 -0
- package/src/components/shadow-claw-dialog/shadow-claw-dialog.test.ts +76 -0
- package/src/components/shadow-claw-file-viewer/shadow-claw-file-viewer.test.ts +307 -0
- package/src/components/shadow-claw-files/shadow-claw-files.test.ts +398 -1
- package/src/components/shadow-claw-pages/shadow-claw-pages.test.ts +85 -0
- package/src/components/shadow-claw-pages/shadow-claw-pages.ts +2 -1
- package/src/components/shadow-claw-pdf-viewer/shadow-claw-pdf-viewer.test.ts +229 -0
- package/src/components/shadow-claw-settings/shadow-claw-settings.test.ts +233 -0
- package/src/components/shadow-claw-tasks/shadow-claw-tasks.test.ts +223 -1
- package/src/components/shadow-claw-toast/shadow-claw-toast.test.ts +79 -0
- package/src/components/shadow-claw-tools/shadow-claw-tools.test.ts +229 -1
- package/src/config/config.test.ts +4 -4
- package/src/config/config.ts +2 -1
- package/src/core/orchestrator/orchestrator.test.ts +2 -1
- package/src/core/orchestrator/utils/initTasks.ts +5 -4
- package/src/server/logger.test.ts +57 -0
- package/src/server/peer.test.ts +47 -0
- package/src/server/routes/gemini.test.ts +244 -0
- package/src/server/server-peer.test.ts +245 -11
- package/src/server/services/llamafile-manager.test.ts +668 -0
- package/src/share-target/pending-shares.test.ts +90 -0
- package/src/shell/fs.test.ts +125 -0
- package/src/shell/shell.test.ts +8 -0
- package/src/subsystems/git/credentials.test.ts +260 -0
- package/src/subsystems/git/git.test.ts +64 -0
- package/src/subsystems/providers/executeNativeAiTask.test.ts +78 -0
- package/src/subsystems/providers/utils/parseLocalModelToolCall.test.ts +57 -0
- package/src/worker/tools/builtin-ai/builtin-ai.test.ts +88 -0
- package/src/worker/tools/email/email.test.ts +358 -0
- package/src/worker/tools/email/utils/resolveIntegrationEmailAuth.test.ts +120 -0
- package/src/worker/tools/email/utils/resolveUniqueAttachmentPath.test.ts +80 -0
- package/src/worker/tools/fetch-file/fetch-file.test.ts +111 -0
- package/src/worker/tools/fetch-url/fetch-url.test.ts +295 -0
- package/dist/cli/chunk-B3S061IE.js +0 -1
- package/dist/cli/chunk-BUJdF9o3.js +0 -1
- package/dist/cli/chunk-BX0R2gIY.js +0 -1
- package/dist/cli/chunk-BoiPfhwJ.js +0 -1
- package/dist/cli/chunk-BtJYj7vB.js +0 -1
- package/dist/cli/chunk-BwXrZVeU.js +0 -1
- package/dist/cli/chunk-CaWh9Pru.js +0 -1
- package/dist/cli/chunk-Ck4ePI8z.js +0 -1
- package/dist/cli/chunk-Ctg-SXcP.js +0 -1
- package/dist/cli/chunk-DTKv1-tk.js +0 -1
- package/dist/cli/chunk-DdYpd9Nu.js +0 -1
- package/dist/cli/chunk-DflhmBY2.js +0 -1
- package/dist/lib/config-DxDaVDTn.js.map +0 -1
- package/dist/lib/model-ranking-CDXs7hkK.js +0 -57
- package/dist/lib/model-ranking-CDXs7hkK.js.map +0 -1
- package/dist/lib/shadow-claw-chat-D69IiLXd.js.map +0 -1
- package/dist/lib/shadow-claw-llm-AJwzkOGo.js.map +0 -1
- package/dist/public/config-Dqn5OMfC.js +0 -1
- package/dist/public/model-ranking-DLIC9IDU.js +0 -1
- package/dist/public/prompt-api-B-8N-MRY.js +0 -11
|
@@ -2,6 +2,7 @@ import {
|
|
|
2
2
|
parseLocalModelToolCall,
|
|
3
3
|
parseLocalModelToolCalls,
|
|
4
4
|
convertToolSchemasToOpenAI,
|
|
5
|
+
createToolCallStreamFilter,
|
|
5
6
|
} from "./parseLocalModelToolCall.js";
|
|
6
7
|
|
|
7
8
|
describe("parseLocalModelToolCall", () => {
|
|
@@ -342,4 +343,60 @@ describe("convertToolSchemasToOpenAI", () => {
|
|
|
342
343
|
expect(typeof params.properties.dataModel.properties).toBe("object");
|
|
343
344
|
expect(params.properties.value.type).toBe("string");
|
|
344
345
|
});
|
|
346
|
+
|
|
347
|
+
describe("createToolCallStreamFilter", () => {
|
|
348
|
+
it("handles undefined onToken callback gracefully", () => {
|
|
349
|
+
const filter = createToolCallStreamFilter();
|
|
350
|
+
expect(() => {
|
|
351
|
+
filter.onToken("token");
|
|
352
|
+
filter.finalize(false);
|
|
353
|
+
}).not.toThrow();
|
|
354
|
+
});
|
|
355
|
+
|
|
356
|
+
it("suppresses tokens when a tool call prefix is detected", () => {
|
|
357
|
+
const emitted: string[] = [];
|
|
358
|
+
const filter = createToolCallStreamFilter((t) => emitted.push(t));
|
|
359
|
+
|
|
360
|
+
filter.onToken("call");
|
|
361
|
+
filter.onToken(":fetch_url");
|
|
362
|
+
filter.onToken('{"url":"https://example.com"}');
|
|
363
|
+
filter.finalize(true);
|
|
364
|
+
|
|
365
|
+
expect(emitted).toEqual([]);
|
|
366
|
+
});
|
|
367
|
+
|
|
368
|
+
it("emits normal text after buffering non-prefix token", () => {
|
|
369
|
+
const emitted: string[] = [];
|
|
370
|
+
const filter = createToolCallStreamFilter((t) => emitted.push(t));
|
|
371
|
+
|
|
372
|
+
filter.onToken("The ");
|
|
373
|
+
filter.onToken("weather ");
|
|
374
|
+
filter.onToken("is sunny.");
|
|
375
|
+
filter.finalize(false);
|
|
376
|
+
|
|
377
|
+
expect(emitted.join("")).toBe("The weather is sunny.");
|
|
378
|
+
});
|
|
379
|
+
|
|
380
|
+
it("flushes remaining buffered text on finalize when not a tool call", () => {
|
|
381
|
+
const emitted: string[] = [];
|
|
382
|
+
const filter = createToolCallStreamFilter((t) => emitted.push(t));
|
|
383
|
+
|
|
384
|
+
filter.onToken("c");
|
|
385
|
+
filter.onToken("at");
|
|
386
|
+
filter.finalize(false);
|
|
387
|
+
|
|
388
|
+
expect(emitted.join("")).toBe("cat");
|
|
389
|
+
});
|
|
390
|
+
|
|
391
|
+
it("suppresses <|tool_call and other XML-style prefixes", () => {
|
|
392
|
+
const emitted: string[] = [];
|
|
393
|
+
const filter = createToolCallStreamFilter((t) => emitted.push(t));
|
|
394
|
+
|
|
395
|
+
filter.onToken("<|tool_call");
|
|
396
|
+
filter.onToken(">call:bash{}");
|
|
397
|
+
filter.finalize(true);
|
|
398
|
+
|
|
399
|
+
expect(emitted).toEqual([]);
|
|
400
|
+
});
|
|
401
|
+
});
|
|
345
402
|
});
|
|
@@ -11,6 +11,7 @@ let executeRewriteText: any;
|
|
|
11
11
|
let executeProofreadText: any;
|
|
12
12
|
let executeDetectLanguage: any;
|
|
13
13
|
let executeTranslateText: any;
|
|
14
|
+
let executeEmbedText: any;
|
|
14
15
|
|
|
15
16
|
describe("builtin-ai worker tools", () => {
|
|
16
17
|
beforeAll(async () => {
|
|
@@ -21,6 +22,7 @@ describe("builtin-ai worker tools", () => {
|
|
|
21
22
|
executeProofreadText = mod.executeProofreadText;
|
|
22
23
|
executeDetectLanguage = mod.executeDetectLanguage;
|
|
23
24
|
executeTranslateText = mod.executeTranslateText;
|
|
25
|
+
executeEmbedText = mod.executeEmbedText;
|
|
24
26
|
});
|
|
25
27
|
|
|
26
28
|
beforeEach(() => {
|
|
@@ -45,6 +47,19 @@ describe("builtin-ai worker tools", () => {
|
|
|
45
47
|
});
|
|
46
48
|
};
|
|
47
49
|
|
|
50
|
+
const mockMainThreadReject = (err: any) => {
|
|
51
|
+
mockPost.mockImplementationOnce((msg: any) => {
|
|
52
|
+
if (msg.type === "request-native-ai-task") {
|
|
53
|
+
setTimeout(() => {
|
|
54
|
+
const resolvers = (globalThis as any).pendingNativeAiResolvers;
|
|
55
|
+
if (resolvers && resolvers[msg.payload.id]) {
|
|
56
|
+
resolvers[msg.payload.id].reject(err);
|
|
57
|
+
}
|
|
58
|
+
}, 0);
|
|
59
|
+
}
|
|
60
|
+
});
|
|
61
|
+
};
|
|
62
|
+
|
|
48
63
|
describe("executeSummarizeText", () => {
|
|
49
64
|
it("returns error message when text is missing", async () => {
|
|
50
65
|
const res = await executeSummarizeText({});
|
|
@@ -264,5 +279,78 @@ describe("builtin-ai worker tools", () => {
|
|
|
264
279
|
}),
|
|
265
280
|
);
|
|
266
281
|
});
|
|
282
|
+
|
|
283
|
+
it("handles error during translate", async () => {
|
|
284
|
+
mockMainThreadReject(new Error("Translation failed"));
|
|
285
|
+
const res = await executeTranslateText({
|
|
286
|
+
text: "Hello",
|
|
287
|
+
sourceLanguage: "en",
|
|
288
|
+
targetLanguage: "fr",
|
|
289
|
+
});
|
|
290
|
+
expect(res).toContain("Error translating text: Translation failed");
|
|
291
|
+
});
|
|
292
|
+
});
|
|
293
|
+
|
|
294
|
+
describe("executeEmbedText", () => {
|
|
295
|
+
it("returns error message when text is missing", async () => {
|
|
296
|
+
const res1 = await executeEmbedText({});
|
|
297
|
+
expect(res1).toBe("Error: text is required for embed_text");
|
|
298
|
+
|
|
299
|
+
const res2 = await executeEmbedText({ text: [] });
|
|
300
|
+
expect(res2).toBe("Error: text is required for embed_text");
|
|
301
|
+
});
|
|
302
|
+
|
|
303
|
+
it("posts request to main thread and returns output", async () => {
|
|
304
|
+
mockMainThreadResponse([0.1, 0.2, 0.3]);
|
|
305
|
+
const res = await executeEmbedText({
|
|
306
|
+
text: "Embed this",
|
|
307
|
+
taskType: "query",
|
|
308
|
+
});
|
|
309
|
+
expect(JSON.parse(res)).toEqual([0.1, 0.2, 0.3]);
|
|
310
|
+
expect(mockPost).toHaveBeenCalledWith(
|
|
311
|
+
expect.objectContaining({
|
|
312
|
+
type: "request-native-ai-task",
|
|
313
|
+
payload: expect.objectContaining({
|
|
314
|
+
taskType: "semantic-embedder",
|
|
315
|
+
input: expect.objectContaining({
|
|
316
|
+
text: "Embed this",
|
|
317
|
+
taskType: "query",
|
|
318
|
+
}),
|
|
319
|
+
}),
|
|
320
|
+
}),
|
|
321
|
+
);
|
|
322
|
+
});
|
|
323
|
+
|
|
324
|
+
it("handles error during embedding", async () => {
|
|
325
|
+
mockMainThreadReject(new Error("Model unavailable"));
|
|
326
|
+
const res = await executeEmbedText({ text: "Embed this" });
|
|
327
|
+
expect(res).toContain("Error generating embeddings: Model unavailable");
|
|
328
|
+
});
|
|
329
|
+
});
|
|
330
|
+
|
|
331
|
+
describe("error handling for remaining tools", () => {
|
|
332
|
+
it("handles write text rejection", async () => {
|
|
333
|
+
mockMainThreadReject(new Error("Write error"));
|
|
334
|
+
const res = await executeWriteText({ prompt: "Write something" });
|
|
335
|
+
expect(res).toContain("Error writing text: Write error");
|
|
336
|
+
});
|
|
337
|
+
|
|
338
|
+
it("handles rewrite text rejection", async () => {
|
|
339
|
+
mockMainThreadReject(new Error("Rewrite error"));
|
|
340
|
+
const res = await executeRewriteText({ text: "Rewrite something" });
|
|
341
|
+
expect(res).toContain("Error rewriting text: Rewrite error");
|
|
342
|
+
});
|
|
343
|
+
|
|
344
|
+
it("handles proofread rejection", async () => {
|
|
345
|
+
mockMainThreadReject(new Error("Proofread error"));
|
|
346
|
+
const res = await executeProofreadText({ text: "Proofread something" });
|
|
347
|
+
expect(res).toContain("Error proofreading text: Proofread error");
|
|
348
|
+
});
|
|
349
|
+
|
|
350
|
+
it("handles detect language rejection", async () => {
|
|
351
|
+
mockMainThreadReject(new Error("Detect error"));
|
|
352
|
+
const res = await executeDetectLanguage({ text: "Detect something" });
|
|
353
|
+
expect(res).toContain("Error detecting language: Detect error");
|
|
354
|
+
});
|
|
267
355
|
});
|
|
268
356
|
});
|
|
@@ -463,6 +463,364 @@ describe("worker/tools/email", () => {
|
|
|
463
463
|
expect(deleteMsgResult).toContain('"deleted": [');
|
|
464
464
|
});
|
|
465
465
|
|
|
466
|
+
it("send_message handles missing SMTP host, attachment read failure, and oauth 401 retry", async () => {
|
|
467
|
+
// Missing SMTP host
|
|
468
|
+
mockGetEmailConnection.mockResolvedValueOnce({
|
|
469
|
+
id: "conn-no-smtp",
|
|
470
|
+
pluginId: "imap",
|
|
471
|
+
enabled: true,
|
|
472
|
+
config: {},
|
|
473
|
+
credentialRef: {
|
|
474
|
+
authType: "basic_userpass",
|
|
475
|
+
encryptedSecret: "enc:pw",
|
|
476
|
+
username: "user@example.com",
|
|
477
|
+
},
|
|
478
|
+
});
|
|
479
|
+
|
|
480
|
+
const noSmtpResult = await executeManageEmailTool(
|
|
481
|
+
{} as any,
|
|
482
|
+
{
|
|
483
|
+
action: "send_message",
|
|
484
|
+
connection_id: "conn-no-smtp",
|
|
485
|
+
to: ["a@b.com"],
|
|
486
|
+
subject: "Test",
|
|
487
|
+
body: "Hello",
|
|
488
|
+
},
|
|
489
|
+
"group-1",
|
|
490
|
+
);
|
|
491
|
+
expect(noSmtpResult).toContain("missing SMTP host");
|
|
492
|
+
|
|
493
|
+
// Attachment read error
|
|
494
|
+
mockGetEmailConnection.mockResolvedValueOnce({
|
|
495
|
+
id: "conn-att-fail",
|
|
496
|
+
pluginId: "imap",
|
|
497
|
+
enabled: true,
|
|
498
|
+
config: { smtpHost: "smtp.example.com" },
|
|
499
|
+
credentialRef: {
|
|
500
|
+
authType: "basic_userpass",
|
|
501
|
+
encryptedSecret: "enc:pw",
|
|
502
|
+
username: "user@example.com",
|
|
503
|
+
},
|
|
504
|
+
});
|
|
505
|
+
mockReadGroupFileBytes.mockRejectedValueOnce(new Error("File not found"));
|
|
506
|
+
|
|
507
|
+
const attFailResult = await executeManageEmailTool(
|
|
508
|
+
{} as any,
|
|
509
|
+
{
|
|
510
|
+
action: "send_message",
|
|
511
|
+
connection_id: "conn-att-fail",
|
|
512
|
+
to: ["a@b.com"],
|
|
513
|
+
subject: "Test",
|
|
514
|
+
body: "Hello",
|
|
515
|
+
attachments: ["missing.txt"],
|
|
516
|
+
},
|
|
517
|
+
"group-1",
|
|
518
|
+
);
|
|
519
|
+
expect(attFailResult).toContain(
|
|
520
|
+
"Attachment file not found or unreadable: missing.txt",
|
|
521
|
+
);
|
|
522
|
+
|
|
523
|
+
// OAuth 401 retry
|
|
524
|
+
mockGetEmailConnection.mockResolvedValueOnce({
|
|
525
|
+
id: "conn-oauth-send",
|
|
526
|
+
pluginId: "imap",
|
|
527
|
+
enabled: true,
|
|
528
|
+
config: { smtpHost: "smtp.example.com" },
|
|
529
|
+
credentialRef: {
|
|
530
|
+
authType: "oauth",
|
|
531
|
+
accountId: "acct-send",
|
|
532
|
+
providerId: "google",
|
|
533
|
+
username: "user@example.com",
|
|
534
|
+
},
|
|
535
|
+
});
|
|
536
|
+
mockResolveServiceCredentials
|
|
537
|
+
.mockResolvedValueOnce({ token: "token-s1" })
|
|
538
|
+
.mockResolvedValueOnce({ token: "token-s2" });
|
|
539
|
+
|
|
540
|
+
(global.fetch as any)
|
|
541
|
+
.mockResolvedValueOnce({
|
|
542
|
+
ok: false,
|
|
543
|
+
status: 401,
|
|
544
|
+
statusText: "Unauthorized",
|
|
545
|
+
json: async () => ({ error: "unauthorized" }),
|
|
546
|
+
})
|
|
547
|
+
.mockResolvedValueOnce({
|
|
548
|
+
ok: true,
|
|
549
|
+
status: 200,
|
|
550
|
+
json: async () => ({ sent: true, refreshed: true }),
|
|
551
|
+
});
|
|
552
|
+
|
|
553
|
+
const retrySendResult = await executeManageEmailTool(
|
|
554
|
+
{} as any,
|
|
555
|
+
{
|
|
556
|
+
action: "send_message",
|
|
557
|
+
connection_id: "conn-oauth-send",
|
|
558
|
+
to: ["target@example.com"],
|
|
559
|
+
subject: "Test",
|
|
560
|
+
body: "Hello",
|
|
561
|
+
},
|
|
562
|
+
"group-1",
|
|
563
|
+
);
|
|
564
|
+
expect(retrySendResult).toContain('"refreshed": true');
|
|
565
|
+
});
|
|
566
|
+
|
|
567
|
+
it("download_attachments handles missing IMAP host, oauth 401 retry, and failed response", async () => {
|
|
568
|
+
// Missing IMAP host
|
|
569
|
+
mockGetEmailConnection.mockResolvedValueOnce({
|
|
570
|
+
id: "conn-no-imap",
|
|
571
|
+
pluginId: "imap",
|
|
572
|
+
enabled: true,
|
|
573
|
+
config: {},
|
|
574
|
+
credentialRef: {
|
|
575
|
+
authType: "basic_userpass",
|
|
576
|
+
encryptedSecret: "enc:pw",
|
|
577
|
+
username: "user@example.com",
|
|
578
|
+
},
|
|
579
|
+
});
|
|
580
|
+
|
|
581
|
+
const noImapResult = await executeManageEmailTool(
|
|
582
|
+
{} as any,
|
|
583
|
+
{
|
|
584
|
+
action: "download_attachments",
|
|
585
|
+
connection_id: "conn-no-imap",
|
|
586
|
+
message_uid: 10,
|
|
587
|
+
},
|
|
588
|
+
"group-1",
|
|
589
|
+
);
|
|
590
|
+
expect(noImapResult).toContain("missing IMAP host");
|
|
591
|
+
|
|
592
|
+
// OAuth 401 retry & download failure response
|
|
593
|
+
mockGetEmailConnection.mockResolvedValue({
|
|
594
|
+
id: "conn-oauth-dl",
|
|
595
|
+
pluginId: "imap",
|
|
596
|
+
enabled: true,
|
|
597
|
+
config: { host: "imap.example.com" },
|
|
598
|
+
credentialRef: {
|
|
599
|
+
authType: "oauth",
|
|
600
|
+
accountId: "acct-dl",
|
|
601
|
+
providerId: "google",
|
|
602
|
+
username: "user@example.com",
|
|
603
|
+
},
|
|
604
|
+
});
|
|
605
|
+
mockResolveServiceCredentials
|
|
606
|
+
.mockResolvedValueOnce({ token: "token-dl1" })
|
|
607
|
+
.mockResolvedValueOnce({ token: "token-dl2" });
|
|
608
|
+
|
|
609
|
+
(global.fetch as any)
|
|
610
|
+
.mockResolvedValueOnce({
|
|
611
|
+
ok: false,
|
|
612
|
+
status: 401,
|
|
613
|
+
statusText: "Unauthorized",
|
|
614
|
+
json: async () => ({ error: "unauthorized" }),
|
|
615
|
+
})
|
|
616
|
+
.mockResolvedValueOnce({
|
|
617
|
+
ok: false,
|
|
618
|
+
status: 500,
|
|
619
|
+
statusText: "Server Error",
|
|
620
|
+
json: async () => ({ error: "disk error" }),
|
|
621
|
+
});
|
|
622
|
+
|
|
623
|
+
const failDlResult = await executeManageEmailTool(
|
|
624
|
+
{} as any,
|
|
625
|
+
{
|
|
626
|
+
action: "download_attachments",
|
|
627
|
+
connection_id: "conn-oauth-dl",
|
|
628
|
+
message_uid: 10,
|
|
629
|
+
},
|
|
630
|
+
"group-1",
|
|
631
|
+
);
|
|
632
|
+
expect(failDlResult).toContain(
|
|
633
|
+
"IMAP attachment download failed (500): disk error",
|
|
634
|
+
);
|
|
635
|
+
});
|
|
636
|
+
|
|
637
|
+
it("mark_as_read handles oauth 401 retry and failed response", async () => {
|
|
638
|
+
mockGetEmailConnection.mockResolvedValue({
|
|
639
|
+
id: "conn-oauth-mark",
|
|
640
|
+
pluginId: "imap",
|
|
641
|
+
enabled: true,
|
|
642
|
+
config: { host: "imap.example.com" },
|
|
643
|
+
credentialRef: {
|
|
644
|
+
authType: "oauth",
|
|
645
|
+
accountId: "acct-mark",
|
|
646
|
+
providerId: "google",
|
|
647
|
+
username: "user@example.com",
|
|
648
|
+
},
|
|
649
|
+
});
|
|
650
|
+
mockResolveServiceCredentials
|
|
651
|
+
.mockResolvedValueOnce({ token: "token-m1" })
|
|
652
|
+
.mockResolvedValueOnce({ token: "token-m2" });
|
|
653
|
+
|
|
654
|
+
(global.fetch as any)
|
|
655
|
+
.mockResolvedValueOnce({
|
|
656
|
+
ok: false,
|
|
657
|
+
status: 401,
|
|
658
|
+
statusText: "Unauthorized",
|
|
659
|
+
json: async () => ({ error: "unauthorized" }),
|
|
660
|
+
})
|
|
661
|
+
.mockResolvedValueOnce({
|
|
662
|
+
ok: false,
|
|
663
|
+
status: 400,
|
|
664
|
+
statusText: "Bad Request",
|
|
665
|
+
json: async () => ({ error: "invalid uids" }),
|
|
666
|
+
});
|
|
667
|
+
|
|
668
|
+
const failMarkResult = await executeManageEmailTool(
|
|
669
|
+
{} as any,
|
|
670
|
+
{
|
|
671
|
+
action: "mark_as_read",
|
|
672
|
+
connection_id: "conn-oauth-mark",
|
|
673
|
+
message_uids: [999],
|
|
674
|
+
},
|
|
675
|
+
"group-1",
|
|
676
|
+
);
|
|
677
|
+
expect(failMarkResult).toContain("IMAP modify failed (400): invalid uids");
|
|
678
|
+
|
|
679
|
+
// Plugin doesn't support messages.read
|
|
680
|
+
mockGetEmailPluginManifest.mockReturnValueOnce({
|
|
681
|
+
id: "imap",
|
|
682
|
+
name: "IMAP",
|
|
683
|
+
actions: ["messages.send"],
|
|
684
|
+
});
|
|
685
|
+
mockGetEmailConnection.mockResolvedValueOnce({
|
|
686
|
+
id: "conn-unsupported",
|
|
687
|
+
pluginId: "imap",
|
|
688
|
+
enabled: true,
|
|
689
|
+
config: { host: "imap.example.com" },
|
|
690
|
+
credentialRef: {
|
|
691
|
+
authType: "basic_userpass",
|
|
692
|
+
username: "u",
|
|
693
|
+
encryptedSecret: "enc:pw",
|
|
694
|
+
},
|
|
695
|
+
});
|
|
696
|
+
const unsuppResult = await executeManageEmailTool(
|
|
697
|
+
{} as any,
|
|
698
|
+
{
|
|
699
|
+
action: "mark_as_read",
|
|
700
|
+
connection_id: "conn-unsupported",
|
|
701
|
+
message_uids: [1],
|
|
702
|
+
},
|
|
703
|
+
"group-1",
|
|
704
|
+
);
|
|
705
|
+
expect(unsuppResult).toContain("does not support inbox message updates");
|
|
706
|
+
|
|
707
|
+
// Missing IMAP host in mark_as_read
|
|
708
|
+
mockGetEmailConnection.mockResolvedValueOnce({
|
|
709
|
+
id: "conn-no-host",
|
|
710
|
+
pluginId: "imap",
|
|
711
|
+
enabled: true,
|
|
712
|
+
config: {},
|
|
713
|
+
credentialRef: {
|
|
714
|
+
authType: "basic_userpass",
|
|
715
|
+
username: "u",
|
|
716
|
+
encryptedSecret: "enc:pw",
|
|
717
|
+
},
|
|
718
|
+
});
|
|
719
|
+
const noHostResult = await executeManageEmailTool(
|
|
720
|
+
{} as any,
|
|
721
|
+
{
|
|
722
|
+
action: "mark_as_read",
|
|
723
|
+
connection_id: "conn-no-host",
|
|
724
|
+
message_uids: [1],
|
|
725
|
+
},
|
|
726
|
+
"group-1",
|
|
727
|
+
);
|
|
728
|
+
expect(noHostResult).toContain("missing IMAP host");
|
|
729
|
+
|
|
730
|
+
// OAuth 401 retry where refreshedAuth returns an error string
|
|
731
|
+
mockGetEmailConnection.mockResolvedValueOnce({
|
|
732
|
+
id: "conn-oauth-fail-refresh",
|
|
733
|
+
pluginId: "imap",
|
|
734
|
+
enabled: true,
|
|
735
|
+
config: { host: "imap.example.com" },
|
|
736
|
+
credentialRef: {
|
|
737
|
+
authType: "oauth",
|
|
738
|
+
accountId: "acc-refresh",
|
|
739
|
+
username: "u",
|
|
740
|
+
},
|
|
741
|
+
});
|
|
742
|
+
mockResolveServiceCredentials
|
|
743
|
+
.mockResolvedValueOnce({ token: "initial-token" })
|
|
744
|
+
.mockResolvedValueOnce(null); // Second resolve fails
|
|
745
|
+
(global.fetch as any).mockResolvedValueOnce({
|
|
746
|
+
ok: false,
|
|
747
|
+
status: 401,
|
|
748
|
+
statusText: "Unauthorized",
|
|
749
|
+
json: async () => ({}),
|
|
750
|
+
});
|
|
751
|
+
const refreshFailResult = await executeManageEmailTool(
|
|
752
|
+
{} as any,
|
|
753
|
+
{
|
|
754
|
+
action: "mark_as_read",
|
|
755
|
+
connection_id: "conn-oauth-fail-refresh",
|
|
756
|
+
message_uids: [1],
|
|
757
|
+
},
|
|
758
|
+
"group-1",
|
|
759
|
+
);
|
|
760
|
+
expect(refreshFailResult).toContain("OAuth account reconnect required");
|
|
761
|
+
});
|
|
762
|
+
|
|
763
|
+
it("download_attachments validates missing uid, disabled connection, and not found", async () => {
|
|
764
|
+
// Missing uid
|
|
765
|
+
mockGetEmailConnection.mockResolvedValueOnce({
|
|
766
|
+
id: "conn-uid",
|
|
767
|
+
pluginId: "imap",
|
|
768
|
+
enabled: true,
|
|
769
|
+
config: {},
|
|
770
|
+
});
|
|
771
|
+
const noUid = await executeManageEmailTool(
|
|
772
|
+
{} as any,
|
|
773
|
+
{ action: "download_attachments", connection_id: "conn-uid" },
|
|
774
|
+
"group-1",
|
|
775
|
+
);
|
|
776
|
+
expect(noUid).toContain("requires message_uid");
|
|
777
|
+
|
|
778
|
+
// Disabled connection
|
|
779
|
+
mockGetEmailConnection.mockResolvedValueOnce({
|
|
780
|
+
id: "conn-disabled",
|
|
781
|
+
pluginId: "imap",
|
|
782
|
+
enabled: false,
|
|
783
|
+
config: {},
|
|
784
|
+
});
|
|
785
|
+
const disabledRes = await executeManageEmailTool(
|
|
786
|
+
{} as any,
|
|
787
|
+
{
|
|
788
|
+
action: "download_attachments",
|
|
789
|
+
connection_id: "conn-disabled",
|
|
790
|
+
message_uid: 1,
|
|
791
|
+
},
|
|
792
|
+
"group-1",
|
|
793
|
+
);
|
|
794
|
+
expect(disabledRes).toContain("is disabled");
|
|
795
|
+
|
|
796
|
+
// Not found
|
|
797
|
+
mockGetEmailConnection.mockResolvedValueOnce(null);
|
|
798
|
+
mockListEmailConnections.mockResolvedValueOnce([]);
|
|
799
|
+
const notFoundRes = await executeManageEmailTool(
|
|
800
|
+
{} as any,
|
|
801
|
+
{
|
|
802
|
+
action: "download_attachments",
|
|
803
|
+
connection_id: "conn-missing",
|
|
804
|
+
message_uid: 1,
|
|
805
|
+
},
|
|
806
|
+
"group-1",
|
|
807
|
+
);
|
|
808
|
+
expect(notFoundRes).toContain(
|
|
809
|
+
"Integration connection not found: conn-missing",
|
|
810
|
+
);
|
|
811
|
+
});
|
|
812
|
+
|
|
813
|
+
it("returns error on unsupported manage_email action", async () => {
|
|
814
|
+
const result = await executeManageEmailTool(
|
|
815
|
+
{} as any,
|
|
816
|
+
{ action: "unknown_action" },
|
|
817
|
+
"group-1",
|
|
818
|
+
);
|
|
819
|
+
expect(result).toBe(
|
|
820
|
+
"Error: Unsupported manage_email action: unknown_action",
|
|
821
|
+
);
|
|
822
|
+
});
|
|
823
|
+
|
|
466
824
|
it("parses email attachment inputs and guesses mime types correctly", async () => {
|
|
467
825
|
const { asEmailAttachmentInputs } =
|
|
468
826
|
await import("./utils/asEmailAttachmentInputs.js");
|
|
@@ -0,0 +1,120 @@
|
|
|
1
|
+
import { jest } from "@jest/globals";
|
|
2
|
+
|
|
3
|
+
let resolveIntegrationEmailAuth: any;
|
|
4
|
+
let mockResolveServiceCredentials: any;
|
|
5
|
+
let mockDecryptValue: any;
|
|
6
|
+
|
|
7
|
+
describe("resolveIntegrationEmailAuth", () => {
|
|
8
|
+
beforeEach(async () => {
|
|
9
|
+
jest.resetModules();
|
|
10
|
+
mockDecryptValue = jest.fn(async () => "password123");
|
|
11
|
+
mockResolveServiceCredentials = jest.fn();
|
|
12
|
+
|
|
13
|
+
jest.unstable_mockModule("../../../../security/crypto.js", () => ({
|
|
14
|
+
decryptValue: mockDecryptValue,
|
|
15
|
+
}));
|
|
16
|
+
|
|
17
|
+
jest.unstable_mockModule(
|
|
18
|
+
"../../../../subsystems/accounts/service-accounts.js",
|
|
19
|
+
() => ({
|
|
20
|
+
resolveServiceCredentials: mockResolveServiceCredentials,
|
|
21
|
+
}),
|
|
22
|
+
);
|
|
23
|
+
|
|
24
|
+
const mod = await import("./resolveIntegrationEmailAuth.js");
|
|
25
|
+
resolveIntegrationEmailAuth = mod.resolveIntegrationEmailAuth;
|
|
26
|
+
});
|
|
27
|
+
|
|
28
|
+
it("returns error when username is missing", async () => {
|
|
29
|
+
const conn: any = {
|
|
30
|
+
id: "conn-1",
|
|
31
|
+
config: {},
|
|
32
|
+
};
|
|
33
|
+
const result = await resolveIntegrationEmailAuth({} as any, conn, {});
|
|
34
|
+
expect(result).toBe(
|
|
35
|
+
"Error: Integration connection conn-1 is missing username credentials.",
|
|
36
|
+
);
|
|
37
|
+
});
|
|
38
|
+
|
|
39
|
+
it("handles OAuth connection missing linked accountId", async () => {
|
|
40
|
+
const conn: any = {
|
|
41
|
+
id: "conn-2",
|
|
42
|
+
config: { username: "user@test.com" },
|
|
43
|
+
credentialRef: { authType: "oauth" },
|
|
44
|
+
};
|
|
45
|
+
const result = await resolveIntegrationEmailAuth({} as any, conn, {});
|
|
46
|
+
expect(result).toBe(
|
|
47
|
+
"Error: Integration connection conn-2 is missing linked OAuth account.",
|
|
48
|
+
);
|
|
49
|
+
});
|
|
50
|
+
|
|
51
|
+
it("handles OAuth reconnect required when creds cannot be resolved or lack token", async () => {
|
|
52
|
+
mockResolveServiceCredentials.mockResolvedValueOnce(null);
|
|
53
|
+
|
|
54
|
+
const conn: any = {
|
|
55
|
+
id: "conn-3",
|
|
56
|
+
config: { username: "user@test.com" },
|
|
57
|
+
credentialRef: {
|
|
58
|
+
authType: "oauth",
|
|
59
|
+
accountId: "acc-1",
|
|
60
|
+
providerId: "google",
|
|
61
|
+
},
|
|
62
|
+
};
|
|
63
|
+
|
|
64
|
+
const result = await resolveIntegrationEmailAuth({} as any, conn, {});
|
|
65
|
+
expect(result).toContain(
|
|
66
|
+
"OAuth account reconnect required for integration conn-3",
|
|
67
|
+
);
|
|
68
|
+
expect(result).toContain("Connect OAuth for google");
|
|
69
|
+
});
|
|
70
|
+
|
|
71
|
+
it("handles OAuth success", async () => {
|
|
72
|
+
mockResolveServiceCredentials.mockResolvedValueOnce({
|
|
73
|
+
token: "oauth-tok-123",
|
|
74
|
+
});
|
|
75
|
+
|
|
76
|
+
const conn: any = {
|
|
77
|
+
id: "conn-oauth-ok",
|
|
78
|
+
config: { username: "user@test.com" },
|
|
79
|
+
credentialRef: {
|
|
80
|
+
authType: "oauth",
|
|
81
|
+
accountId: "acc-1",
|
|
82
|
+
providerId: "google",
|
|
83
|
+
},
|
|
84
|
+
};
|
|
85
|
+
|
|
86
|
+
const result = await resolveIntegrationEmailAuth({} as any, conn, {});
|
|
87
|
+
expect(result).toEqual({
|
|
88
|
+
authType: "oauth",
|
|
89
|
+
username: "user@test.com",
|
|
90
|
+
accessToken: "oauth-tok-123",
|
|
91
|
+
});
|
|
92
|
+
});
|
|
93
|
+
|
|
94
|
+
it("returns error when basic password credentials are missing", async () => {
|
|
95
|
+
mockDecryptValue.mockResolvedValueOnce(null);
|
|
96
|
+
const conn: any = {
|
|
97
|
+
id: "conn-4",
|
|
98
|
+
config: { username: "user@test.com" },
|
|
99
|
+
credentialRef: { authType: "basic_userpass" },
|
|
100
|
+
};
|
|
101
|
+
const result = await resolveIntegrationEmailAuth({} as any, conn, {});
|
|
102
|
+
expect(result).toBe(
|
|
103
|
+
"Error: Integration connection conn-4 is missing password credentials.",
|
|
104
|
+
);
|
|
105
|
+
});
|
|
106
|
+
|
|
107
|
+
it("resolves basic auth with password", async () => {
|
|
108
|
+
const conn: any = {
|
|
109
|
+
id: "conn-5",
|
|
110
|
+
config: { username: "user@test.com" },
|
|
111
|
+
credentialRef: { authType: "basic_userpass", encryptedSecret: "enc:pw" },
|
|
112
|
+
};
|
|
113
|
+
const result = await resolveIntegrationEmailAuth({} as any, conn, {});
|
|
114
|
+
expect(result).toEqual({
|
|
115
|
+
authType: "basic_userpass",
|
|
116
|
+
username: "user@test.com",
|
|
117
|
+
password: "password123",
|
|
118
|
+
});
|
|
119
|
+
});
|
|
120
|
+
});
|