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
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
import { loadWorkspaceConfig } from "./load-workspace-config.js";
|
|
2
|
+
import { mkdtemp, rm, writeFile, mkdir } from "node:fs/promises";
|
|
3
|
+
import os from "node:os";
|
|
4
|
+
import path from "node:path";
|
|
5
|
+
|
|
6
|
+
describe("load-workspace-config", () => {
|
|
7
|
+
let tmpDir: string;
|
|
8
|
+
|
|
9
|
+
beforeEach(async () => {
|
|
10
|
+
tmpDir = await mkdtemp(path.join(os.tmpdir(), "sc-cfg-test-"));
|
|
11
|
+
});
|
|
12
|
+
|
|
13
|
+
afterEach(async () => {
|
|
14
|
+
await rm(tmpDir, { recursive: true, force: true });
|
|
15
|
+
});
|
|
16
|
+
|
|
17
|
+
it("returns null when no config exists", async () => {
|
|
18
|
+
const res = await loadWorkspaceConfig(tmpDir);
|
|
19
|
+
expect(res).toBeNull();
|
|
20
|
+
});
|
|
21
|
+
|
|
22
|
+
it("loads shadow-claw.config.json from workspace", async () => {
|
|
23
|
+
const cfgPath = path.join(tmpDir, "shadow-claw.config.json");
|
|
24
|
+
await writeFile(cfgPath, JSON.stringify({ model: "test-model" }), "utf8");
|
|
25
|
+
|
|
26
|
+
const res = await loadWorkspaceConfig(tmpDir);
|
|
27
|
+
expect(res).not.toBeNull();
|
|
28
|
+
expect(res?.configPath).toBe(cfgPath);
|
|
29
|
+
expect(res?.config.model).toBe("test-model");
|
|
30
|
+
});
|
|
31
|
+
|
|
32
|
+
it("loads config from contentRoot", async () => {
|
|
33
|
+
const contentDir = path.join(tmpDir, "content");
|
|
34
|
+
await mkdir(contentDir, { recursive: true });
|
|
35
|
+
const cfgPath = path.join(contentDir, "site-config.json");
|
|
36
|
+
await writeFile(cfgPath, JSON.stringify({ siteName: "My Site" }), "utf8");
|
|
37
|
+
|
|
38
|
+
const res = await loadWorkspaceConfig(undefined, contentDir);
|
|
39
|
+
expect(res).not.toBeNull();
|
|
40
|
+
expect(res?.configPath).toBe(cfgPath);
|
|
41
|
+
expect((res?.config as any).siteName).toBe("My Site");
|
|
42
|
+
});
|
|
43
|
+
|
|
44
|
+
it("checks parent directory when workspace is .cache", async () => {
|
|
45
|
+
const cacheDir = path.join(tmpDir, ".cache");
|
|
46
|
+
await mkdir(cacheDir, { recursive: true });
|
|
47
|
+
const cfgPath = path.join(tmpDir, "shadowclaw.config.json");
|
|
48
|
+
await writeFile(cfgPath, JSON.stringify({ provider: "local" }), "utf8");
|
|
49
|
+
|
|
50
|
+
const res = await loadWorkspaceConfig(cacheDir);
|
|
51
|
+
expect(res).not.toBeNull();
|
|
52
|
+
expect(res?.configPath).toBe(cfgPath);
|
|
53
|
+
expect(res?.config.provider).toBe("local");
|
|
54
|
+
});
|
|
55
|
+
|
|
56
|
+
it("handles malformed JSON gracefully", async () => {
|
|
57
|
+
const cfgPath = path.join(tmpDir, "shadow-claw.config.json");
|
|
58
|
+
await writeFile(cfgPath, "{ malformed json", "utf8");
|
|
59
|
+
|
|
60
|
+
const res = await loadWorkspaceConfig(tmpDir);
|
|
61
|
+
expect(res).toBeNull();
|
|
62
|
+
});
|
|
63
|
+
});
|
|
@@ -1242,5 +1242,103 @@ describe("local-models", () => {
|
|
|
1242
1242
|
globalThis.fetch = originalFetch;
|
|
1243
1243
|
}
|
|
1244
1244
|
});
|
|
1245
|
+
|
|
1246
|
+
it("allows selecting llamafile options 5 through 10", async () => {
|
|
1247
|
+
for (const choice of ["5", "6", "7", "8", "9", "10"]) {
|
|
1248
|
+
const mockStdin = new PassThrough();
|
|
1249
|
+
const mockStdout = new Writable({
|
|
1250
|
+
write(chunk, _encoding, callback) {
|
|
1251
|
+
const str = chunk.toString();
|
|
1252
|
+
if (str.includes("Enter choice [1-12]")) {
|
|
1253
|
+
setImmediate(() => mockStdin.write(`${choice}\n`));
|
|
1254
|
+
} else if (str.includes("Download model weights now?")) {
|
|
1255
|
+
setImmediate(() => mockStdin.write("n\n"));
|
|
1256
|
+
}
|
|
1257
|
+
callback();
|
|
1258
|
+
},
|
|
1259
|
+
});
|
|
1260
|
+
const result = await promptForAgentModel({
|
|
1261
|
+
workspaceDir: tmpDir,
|
|
1262
|
+
contentRoot: tmpDir,
|
|
1263
|
+
cacheDir: tmpDir,
|
|
1264
|
+
stdin: mockStdin,
|
|
1265
|
+
stdout: mockStdout,
|
|
1266
|
+
isTTY: true,
|
|
1267
|
+
});
|
|
1268
|
+
expect(result.providerId).toBe("llamafile");
|
|
1269
|
+
}
|
|
1270
|
+
});
|
|
1271
|
+
|
|
1272
|
+
it("allows direct entry of agentfile, llamafile, openrouter, and onnx models at the main prompt", async () => {
|
|
1273
|
+
const inputs = [
|
|
1274
|
+
{ in: "helper.agentfile", p: "agentfile", m: "helper.agentfile" },
|
|
1275
|
+
{ in: "worker.llamafile", p: "llamafile", m: "worker.llamafile" },
|
|
1276
|
+
{ in: "meta-llama/llama-3", p: "openrouter", m: "meta-llama/llama-3" },
|
|
1277
|
+
{
|
|
1278
|
+
in: "custom-onnx-model",
|
|
1279
|
+
p: "transformers_js_local",
|
|
1280
|
+
m: "custom-onnx-model",
|
|
1281
|
+
},
|
|
1282
|
+
];
|
|
1283
|
+
|
|
1284
|
+
for (const item of inputs) {
|
|
1285
|
+
const mockStdin = new PassThrough();
|
|
1286
|
+
const mockStdout = new Writable({
|
|
1287
|
+
write(chunk, _encoding, callback) {
|
|
1288
|
+
const str = chunk.toString();
|
|
1289
|
+
if (str.includes("Enter choice [1-12]")) {
|
|
1290
|
+
setImmediate(() => mockStdin.write(`${item.in}\n`));
|
|
1291
|
+
} else if (str.includes("Download model weights now?")) {
|
|
1292
|
+
setImmediate(() => mockStdin.write("n\n"));
|
|
1293
|
+
}
|
|
1294
|
+
callback();
|
|
1295
|
+
},
|
|
1296
|
+
});
|
|
1297
|
+
const result = await promptForAgentModel({
|
|
1298
|
+
workspaceDir: tmpDir,
|
|
1299
|
+
contentRoot: tmpDir,
|
|
1300
|
+
cacheDir: tmpDir,
|
|
1301
|
+
stdin: mockStdin,
|
|
1302
|
+
stdout: mockStdout,
|
|
1303
|
+
isTTY: true,
|
|
1304
|
+
});
|
|
1305
|
+
expect(result.providerId).toBe(item.p);
|
|
1306
|
+
expect(result.model).toBe(item.m);
|
|
1307
|
+
}
|
|
1308
|
+
});
|
|
1309
|
+
|
|
1310
|
+
it("tests isLlamafileLocallyCached and isAgentfileLocallyCached paths", () => {
|
|
1311
|
+
const realFile = path.join(tmpDir, "model.llamafile");
|
|
1312
|
+
fs.writeFileSync(realFile, "binary content", "utf8");
|
|
1313
|
+
|
|
1314
|
+
expect(isLlamafileLocallyCached(realFile)).toBe(true);
|
|
1315
|
+
expect(isLlamafileLocallyCached(realFile, tmpDir)).toBe(true);
|
|
1316
|
+
|
|
1317
|
+
const agentFile = path.join(tmpDir, "model.agentfile");
|
|
1318
|
+
fs.writeFileSync(agentFile, "agent content", "utf8");
|
|
1319
|
+
|
|
1320
|
+
expect(isAgentfileLocallyCached(agentFile)).toBe(true);
|
|
1321
|
+
expect(isAgentfileLocallyCached(agentFile, tmpDir)).toBe(true);
|
|
1322
|
+
|
|
1323
|
+
// Part file returns false
|
|
1324
|
+
const cacheDir = getLlamafileCacheDir(tmpDir);
|
|
1325
|
+
fs.mkdirSync(cacheDir, { recursive: true });
|
|
1326
|
+
fs.writeFileSync(
|
|
1327
|
+
path.join(cacheDir, "test.llamafile.part"),
|
|
1328
|
+
"incomplete",
|
|
1329
|
+
"utf8",
|
|
1330
|
+
);
|
|
1331
|
+
expect(isLlamafileLocallyCached("test.llamafile", tmpDir)).toBe(false);
|
|
1332
|
+
|
|
1333
|
+
// Cache dirs with and without custom dir
|
|
1334
|
+
expect(getLlamafileCacheDir()).toContain("llamafile");
|
|
1335
|
+
expect(getAgentfileCacheDir()).toContain("agentfile");
|
|
1336
|
+
expect(getLlamafileCacheDir(tmpDir)).toBe(
|
|
1337
|
+
path.resolve(tmpDir, "llamafile"),
|
|
1338
|
+
);
|
|
1339
|
+
expect(getAgentfileCacheDir(tmpDir)).toBe(
|
|
1340
|
+
path.resolve(tmpDir, "agentfile"),
|
|
1341
|
+
);
|
|
1342
|
+
});
|
|
1245
1343
|
});
|
|
1246
1344
|
});
|
|
@@ -205,9 +205,48 @@ describe("progress-bar", () => {
|
|
|
205
205
|
total: 1000,
|
|
206
206
|
});
|
|
207
207
|
bar.update({ status: "done", file: "model.onnx" });
|
|
208
|
-
bar.finish();
|
|
209
|
-
|
|
210
208
|
expect(output).toBe("");
|
|
211
209
|
});
|
|
210
|
+
|
|
211
|
+
it("handles failure message with prior files in TTY mode", () => {
|
|
212
|
+
let output = "";
|
|
213
|
+
const mockStream = {
|
|
214
|
+
isTTY: true,
|
|
215
|
+
write: (str: string) => {
|
|
216
|
+
output += str;
|
|
217
|
+
},
|
|
218
|
+
};
|
|
219
|
+
|
|
220
|
+
const bar = createCliProgressBar({
|
|
221
|
+
modelId: "bad-model",
|
|
222
|
+
stream: mockStream,
|
|
223
|
+
isTTY: true,
|
|
224
|
+
});
|
|
225
|
+
|
|
226
|
+
bar.update({ status: "progress", file: "part.bin", progress: 10 });
|
|
227
|
+
bar.fail("Custom failure occurred");
|
|
228
|
+
expect(output).toContain("Custom failure occurred");
|
|
229
|
+
});
|
|
230
|
+
|
|
231
|
+
it("handles done status directly in non-TTY mode without prior entry and formatBytes negative decimals", () => {
|
|
232
|
+
let output = "";
|
|
233
|
+
const mockStream = {
|
|
234
|
+
isTTY: false,
|
|
235
|
+
write: (str: string) => {
|
|
236
|
+
output += str;
|
|
237
|
+
},
|
|
238
|
+
};
|
|
239
|
+
|
|
240
|
+
const bar = createCliProgressBar({
|
|
241
|
+
modelId: "quick-model",
|
|
242
|
+
stream: mockStream,
|
|
243
|
+
isTTY: false,
|
|
244
|
+
});
|
|
245
|
+
|
|
246
|
+
bar.update({ status: "done", file: "direct-done.bin" });
|
|
247
|
+
expect(output).toContain("[Download] Finished file: direct-done.bin");
|
|
248
|
+
|
|
249
|
+
expect(formatBytes(1536, -1)).toBe("2 KB");
|
|
250
|
+
});
|
|
212
251
|
});
|
|
213
252
|
});
|
|
@@ -96,6 +96,39 @@ describe("src/cli/utils/resolve-cache-dir.ts", () => {
|
|
|
96
96
|
expect(resolved).toBe(path.resolve(tempDir, ".legacy-cache"));
|
|
97
97
|
});
|
|
98
98
|
|
|
99
|
+
it("checks pages/site-config.json and shadowclaw.config.json variants and handles malformed JSON", async () => {
|
|
100
|
+
// Malformed JSON should be ignored
|
|
101
|
+
const badConfigPath = path.join(tempDir, "shadow-claw-config.json");
|
|
102
|
+
await fs.writeFile(badConfigPath, "{ bad json", "utf8");
|
|
103
|
+
expect(readConfigFileCacheDir(tempDir)).toBeNull();
|
|
104
|
+
await fs.unlink(badConfigPath);
|
|
105
|
+
|
|
106
|
+
// shadowclaw.config.json variant
|
|
107
|
+
const shadowclawPath = path.join(tempDir, "shadowclaw.config.json");
|
|
108
|
+
await fs.writeFile(
|
|
109
|
+
shadowclawPath,
|
|
110
|
+
JSON.stringify({ cacheDir: "sc-variant-cache" }),
|
|
111
|
+
"utf8",
|
|
112
|
+
);
|
|
113
|
+
expect(readConfigFileCacheDir(tempDir)).toBe(
|
|
114
|
+
path.resolve(tempDir, "sc-variant-cache"),
|
|
115
|
+
);
|
|
116
|
+
await fs.unlink(shadowclawPath);
|
|
117
|
+
|
|
118
|
+
// pages/site-config.json variant
|
|
119
|
+
const pagesDir = path.join(tempDir, "pages");
|
|
120
|
+
await fs.mkdir(pagesDir, { recursive: true });
|
|
121
|
+
const pagesSiteConfig = path.join(pagesDir, "site-config.json");
|
|
122
|
+
await fs.writeFile(
|
|
123
|
+
pagesSiteConfig,
|
|
124
|
+
JSON.stringify({ cacheDir: "pages-sub-cache" }),
|
|
125
|
+
"utf8",
|
|
126
|
+
);
|
|
127
|
+
expect(readConfigFileCacheDir(tempDir)).toBe(
|
|
128
|
+
path.resolve(tempDir, "pages-sub-cache"),
|
|
129
|
+
);
|
|
130
|
+
});
|
|
131
|
+
|
|
99
132
|
it("respects explicit --tmp option", async () => {
|
|
100
133
|
const result = await resolveCacheDir({
|
|
101
134
|
contentRoot: tempDir,
|
|
@@ -366,4 +399,32 @@ describe("src/cli/utils/resolve-cache-dir.ts", () => {
|
|
|
366
399
|
expect(exitCode).toBe(130);
|
|
367
400
|
expect(output).toContain("Operation cancelled.");
|
|
368
401
|
});
|
|
402
|
+
|
|
403
|
+
it("handles explicit databaseDir ending in /database and non-/database", async () => {
|
|
404
|
+
const res1 = await resolveCacheDir({
|
|
405
|
+
contentRoot: tempDir,
|
|
406
|
+
databaseDir: "my-cache/database",
|
|
407
|
+
});
|
|
408
|
+
expect(res1.databaseDir).toBe(path.resolve(tempDir, "my-cache/database"));
|
|
409
|
+
expect(res1.cacheDir).toBe(path.resolve(tempDir, "my-cache"));
|
|
410
|
+
|
|
411
|
+
const res2 = await resolveCacheDir({
|
|
412
|
+
contentRoot: tempDir,
|
|
413
|
+
databaseDir: "custom-db-dir",
|
|
414
|
+
});
|
|
415
|
+
expect(res2.databaseDir).toBe(path.resolve(tempDir, "custom-db-dir"));
|
|
416
|
+
expect(res2.cacheDir).toBe(path.resolve(tempDir));
|
|
417
|
+
});
|
|
418
|
+
|
|
419
|
+
it("reads server.cacheDir from site-config.json", async () => {
|
|
420
|
+
const cfgPath = path.join(tempDir, "site-config.json");
|
|
421
|
+
await fs.writeFile(
|
|
422
|
+
cfgPath,
|
|
423
|
+
JSON.stringify({ server: { cacheDir: "server-cache" } }),
|
|
424
|
+
"utf8",
|
|
425
|
+
);
|
|
426
|
+
|
|
427
|
+
const res = await resolveCacheDir({ contentRoot: tempDir });
|
|
428
|
+
expect(res.cacheDir).toBe(path.resolve(tempDir, "server-cache"));
|
|
429
|
+
});
|
|
369
430
|
});
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { getProjectRoot } from "./resolve-project-root.js";
|
|
2
|
+
import { pathToFileURL } from "node:url";
|
|
3
|
+
|
|
4
|
+
describe("resolve-project-root", () => {
|
|
5
|
+
it("resolves the shadow-claw project root from current module url", () => {
|
|
6
|
+
const root = getProjectRoot();
|
|
7
|
+
expect(root).toContain("shadow-claw");
|
|
8
|
+
});
|
|
9
|
+
|
|
10
|
+
it("throws when shadow-claw package.json cannot be found", () => {
|
|
11
|
+
expect(() => {
|
|
12
|
+
getProjectRoot(pathToFileURL("/").href);
|
|
13
|
+
}).toThrow(
|
|
14
|
+
"Could not find shadow-claw project root containing package.json",
|
|
15
|
+
);
|
|
16
|
+
});
|
|
17
|
+
});
|
|
@@ -94,6 +94,44 @@ describe("src/cli/utils/stdin.ts - readStdin", () => {
|
|
|
94
94
|
expect(result).toBe(json);
|
|
95
95
|
expect(JSON.parse(result!)).toEqual({ text: "hello", tone: "happy" });
|
|
96
96
|
});
|
|
97
|
+
|
|
98
|
+
it("resolves null on timeoutMs expiration and destroys stream", async () => {
|
|
99
|
+
const stream = new Readable({ read() {} });
|
|
100
|
+
const result = await readStdin({ stdin: stream, timeoutMs: 50 });
|
|
101
|
+
expect(result).toBeNull();
|
|
102
|
+
});
|
|
103
|
+
|
|
104
|
+
it("handles Buffer chunks, timer cleanup on end or error, and default process.stdin", async () => {
|
|
105
|
+
const stream = new Readable({
|
|
106
|
+
read() {
|
|
107
|
+
this.push(Buffer.from("buffer data"));
|
|
108
|
+
this.push(null);
|
|
109
|
+
},
|
|
110
|
+
});
|
|
111
|
+
(stream as any).setEncoding = null;
|
|
112
|
+
(stream as any).isTTY = false;
|
|
113
|
+
const res = await readStdin({ stdin: stream, timeoutMs: 5000 });
|
|
114
|
+
expect(res).toBe("buffer data");
|
|
115
|
+
|
|
116
|
+
const errStream = new Readable({
|
|
117
|
+
read() {
|
|
118
|
+
this.emit("error", new Error("with timer error"));
|
|
119
|
+
},
|
|
120
|
+
});
|
|
121
|
+
(errStream as any).isTTY = false;
|
|
122
|
+
await expect(
|
|
123
|
+
readStdin({ stdin: errStream, timeoutMs: 5000 }),
|
|
124
|
+
).rejects.toThrow("with timer error");
|
|
125
|
+
|
|
126
|
+
const origIsTTY = process.stdin.isTTY;
|
|
127
|
+
try {
|
|
128
|
+
(process.stdin as any).isTTY = true;
|
|
129
|
+
const defRes = await readStdin();
|
|
130
|
+
expect(defRes).toBeNull();
|
|
131
|
+
} finally {
|
|
132
|
+
(process.stdin as any).isTTY = origIsTTY;
|
|
133
|
+
}
|
|
134
|
+
});
|
|
97
135
|
});
|
|
98
136
|
|
|
99
137
|
describe("src/cli/utils/stdin.ts - mapTextToToolInput", () => {
|
|
@@ -1,4 +1,11 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import {
|
|
2
|
+
describe,
|
|
3
|
+
it,
|
|
4
|
+
expect,
|
|
5
|
+
beforeEach,
|
|
6
|
+
afterEach,
|
|
7
|
+
jest,
|
|
8
|
+
} from "@jest/globals";
|
|
2
9
|
import { Readable } from "node:stream";
|
|
3
10
|
import { mkdtemp, readFile, rm } from "node:fs/promises";
|
|
4
11
|
import { tmpdir } from "node:os";
|
|
@@ -55,6 +62,29 @@ describe("src/cli/utils/stdio.ts", () => {
|
|
|
55
62
|
const result = await readStdin({ stdin: mockStdin, force: true });
|
|
56
63
|
expect(result).toBe("forced stream content");
|
|
57
64
|
});
|
|
65
|
+
|
|
66
|
+
it("returns null on stream error", async () => {
|
|
67
|
+
const mockStdin = new Readable({
|
|
68
|
+
read() {
|
|
69
|
+
this.emit("error", new Error("stream read failure"));
|
|
70
|
+
},
|
|
71
|
+
});
|
|
72
|
+
(mockStdin as any).isTTY = false;
|
|
73
|
+
const result = await readStdin({ stdin: mockStdin });
|
|
74
|
+
expect(result).toBeNull();
|
|
75
|
+
});
|
|
76
|
+
|
|
77
|
+
it("resolves immediately when stream readableEnded is already true", async () => {
|
|
78
|
+
const mockStdin = new Readable({
|
|
79
|
+
read() {
|
|
80
|
+
this.push(null);
|
|
81
|
+
},
|
|
82
|
+
});
|
|
83
|
+
(mockStdin as any).isTTY = false;
|
|
84
|
+
Object.defineProperty(mockStdin, "readableEnded", { get: () => true });
|
|
85
|
+
const result = await readStdin({ stdin: mockStdin });
|
|
86
|
+
expect(result).toBe("");
|
|
87
|
+
});
|
|
58
88
|
});
|
|
59
89
|
|
|
60
90
|
describe("readInputOrStdin", () => {
|
|
@@ -130,5 +160,25 @@ describe("src/cli/utils/stdio.ts", () => {
|
|
|
130
160
|
const content = await readFile(targetFile, "utf8");
|
|
131
161
|
expect(JSON.parse(content)).toEqual({ success: true, count: 42 });
|
|
132
162
|
});
|
|
163
|
+
|
|
164
|
+
it("logs string and JSON to console when output is not specified and quiet is false", async () => {
|
|
165
|
+
const logSpy = jest.spyOn(console, "log").mockImplementation(() => {});
|
|
166
|
+
try {
|
|
167
|
+
await writeOutput("console text output");
|
|
168
|
+
expect(logSpy).toHaveBeenCalledWith("console text output");
|
|
169
|
+
|
|
170
|
+
await writeOutput({ count: 1 });
|
|
171
|
+
expect(logSpy).toHaveBeenCalledWith(
|
|
172
|
+
JSON.stringify({ count: 1 }, null, 2),
|
|
173
|
+
);
|
|
174
|
+
|
|
175
|
+
// When quiet is true, does not log
|
|
176
|
+
logSpy.mockClear();
|
|
177
|
+
await writeOutput("quiet text", { quiet: true });
|
|
178
|
+
expect(logSpy).not.toHaveBeenCalled();
|
|
179
|
+
} finally {
|
|
180
|
+
logSpy.mockRestore();
|
|
181
|
+
}
|
|
182
|
+
});
|
|
133
183
|
});
|
|
134
184
|
});
|
|
@@ -44,4 +44,13 @@ describe("suppressExperimentalWarnings", () => {
|
|
|
44
44
|
expect(captured!.warning).toBe("Some other warning");
|
|
45
45
|
expect(captured!.args[0]).toBe("UserWarning");
|
|
46
46
|
});
|
|
47
|
+
|
|
48
|
+
it("is idempotent when called multiple times or when emitWarning is absent", () => {
|
|
49
|
+
suppressExperimentalWarnings();
|
|
50
|
+
// Second call should return early
|
|
51
|
+
expect(() => suppressExperimentalWarnings()).not.toThrow();
|
|
52
|
+
|
|
53
|
+
process.emitWarning = undefined as any;
|
|
54
|
+
expect(() => suppressExperimentalWarnings()).not.toThrow();
|
|
55
|
+
});
|
|
47
56
|
});
|