shadow-claw 1.29.0 → 1.30.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.agents/skills/main/skill-creator/SKILL.md +3 -2
- package/.agents/skills/main/skill-creator/references/frontmatter-spec.md +5 -3
- package/.well-known/agent-skills/index.json +1 -1
- package/.well-known/mcp/server-card.json +1 -1
- package/.well-known/mcp.json +1 -1
- package/dist/lib/{app-routes-CqBOeA5q.js → app-routes-BAEMLu9g.js} +3 -2
- package/dist/lib/app-routes-BAEMLu9g.js.map +1 -0
- package/dist/lib/{bundler-8JNIKwOs.js → bundler-CsL7hHMq.js} +4 -9
- package/dist/lib/{bundler-8JNIKwOs.js.map → bundler-CsL7hHMq.js.map} +1 -1
- package/dist/lib/components/index.js +26 -26
- package/dist/lib/components/settings/shadow-claw-accounts.js +1 -1
- package/dist/lib/components/settings/shadow-claw-channel-config.js +1 -1
- package/dist/lib/components/settings/shadow-claw-control-plane.js +1 -1
- package/dist/lib/components/settings/shadow-claw-git.js +1 -1
- package/dist/lib/components/settings/shadow-claw-integrations.js +1 -1
- package/dist/lib/components/settings/shadow-claw-llm.js +1 -1
- package/dist/lib/components/settings/shadow-claw-mcp-remote.js +1 -1
- package/dist/lib/components/settings/shadow-claw-networking.js +1 -1
- package/dist/lib/components/settings/shadow-claw-notifications.js +1 -1
- package/dist/lib/components/settings/shadow-claw-peerjs.js +1 -1
- package/dist/lib/components/settings/shadow-claw-storage.js +1 -1
- package/dist/lib/components/settings/shadow-claw-task-server.js +1 -1
- package/dist/lib/components/settings/shadow-claw-webvm.js +1 -1
- package/dist/lib/components/shadow-claw-a2ui.js +1 -1
- package/dist/lib/components/shadow-claw-accounts.js +1 -1
- package/dist/lib/components/shadow-claw-channel-config.js +1 -1
- package/dist/lib/components/shadow-claw-channels.js +1 -1
- package/dist/lib/components/shadow-claw-chat.js +1 -1
- package/dist/lib/components/shadow-claw-control-plane.js +1 -1
- package/dist/lib/components/shadow-claw-conversations.js +1 -1
- package/dist/lib/components/shadow-claw-file-viewer.js +1 -1
- package/dist/lib/components/shadow-claw-files.js +1 -1
- package/dist/lib/components/shadow-claw-git.js +1 -1
- package/dist/lib/components/shadow-claw-integrations.js +1 -1
- package/dist/lib/components/shadow-claw-llm.js +1 -1
- package/dist/lib/components/shadow-claw-mcp-remote.js +1 -1
- package/dist/lib/components/shadow-claw-networking.js +1 -1
- package/dist/lib/components/shadow-claw-notifications.js +1 -1
- package/dist/lib/components/shadow-claw-page-header.js +1 -1
- package/dist/lib/components/shadow-claw-pages.js +1 -1
- package/dist/lib/components/shadow-claw-peerjs.js +1 -1
- package/dist/lib/components/shadow-claw-settings.js +1 -1
- package/dist/lib/components/shadow-claw-storage.js +1 -1
- package/dist/lib/components/shadow-claw-task-server.js +1 -1
- package/dist/lib/components/shadow-claw-tasks.js +1 -1
- package/dist/lib/components/shadow-claw-terminal.js +1 -1
- package/dist/lib/components/shadow-claw-tools.js +1 -1
- package/dist/lib/components/shadow-claw-webvm.js +1 -1
- package/dist/lib/components/shadow-claw.js +1 -1
- package/dist/lib/{config--CFrw3J3.js → config-DjZ9QWc4.js} +2 -2
- package/dist/lib/{config--CFrw3J3.js.map → config-DjZ9QWc4.js.map} +1 -1
- package/dist/lib/{configurePeerJs-DG4hliKp.js → configurePeerJs-H0WaoT0w.js} +3 -3
- package/dist/lib/{configurePeerJs-DG4hliKp.js.map → configurePeerJs-H0WaoT0w.js.map} +1 -1
- package/dist/lib/{connections-DwjzwVz0.js → connections-BURqMIUv.js} +2 -2
- package/dist/lib/{connections-DwjzwVz0.js.map → connections-BURqMIUv.js.map} +1 -1
- package/dist/lib/content/markdown-links.d.ts +19 -0
- package/dist/lib/core/app-routes.d.ts +1 -0
- package/dist/lib/{downloadGroupFile-DmcBQU1n.js → downloadGroupFile-B8J4up2a.js} +2 -2
- package/dist/lib/{downloadGroupFile-DmcBQU1n.js.map → downloadGroupFile-B8J4up2a.js.map} +1 -1
- package/dist/lib/{file-viewer-C3YKnq_-.js → file-viewer-CwvhxAAG.js} +5 -5
- package/dist/lib/{file-viewer-C3YKnq_-.js.map → file-viewer-CwvhxAAG.js.map} +1 -1
- package/dist/lib/{getGroupDir-m0f-ekgX.js → getGroupDir-QrN2aTo8.js} +4 -4
- package/dist/lib/{getGroupDir-m0f-ekgX.js.map → getGroupDir-QrN2aTo8.js.map} +1 -1
- package/dist/lib/{git-C-Q6-IVe.js → git-DhZoe1SE.js} +3 -3
- package/dist/lib/{git-C-Q6-IVe.js.map → git-DhZoe1SE.js.map} +1 -1
- package/dist/lib/{iframe-sanitizer-CUqHuWQ-.js → iframe-sanitizer-Bujgq14T.js} +2 -2
- package/dist/lib/{iframe-sanitizer-CUqHuWQ-.js.map → iframe-sanitizer-Bujgq14T.js.map} +1 -1
- package/dist/lib/index.js +27 -27
- package/dist/lib/{initChatSplitResize-yyBTU6h9.js → initChatSplitResize-BjiWoqC_.js} +2 -2
- package/dist/lib/{initChatSplitResize-yyBTU6h9.js.map → initChatSplitResize-BjiWoqC_.js.map} +1 -1
- package/dist/lib/{initControlPlane-DnpAzphg.js → initControlPlane-C9JxQCDh.js} +16 -16
- package/dist/lib/{initControlPlane-DnpAzphg.js.map → initControlPlane-C9JxQCDh.js.map} +1 -1
- package/dist/lib/{markdown-DgdSt2GD.js → markdown-DYHmNjC4.js} +126 -5
- package/dist/lib/markdown-DYHmNjC4.js.map +1 -0
- package/dist/lib/{mcp-reconnect-C86MR3z8.js → mcp-reconnect-BxJ77WSb.js} +2 -2
- package/dist/lib/{mcp-reconnect-C86MR3z8.js.map → mcp-reconnect-BxJ77WSb.js.map} +1 -1
- package/dist/lib/{memoryStorage-UR8E8K-H.js → memoryStorage-D3FBwO9T.js} +2 -2
- package/dist/lib/{memoryStorage-UR8E8K-H.js.map → memoryStorage-D3FBwO9T.js.map} +1 -1
- package/dist/lib/{orchestrator-ClXbJ4Mb.js → orchestrator-C6dc-2OQ.js} +130 -27
- package/dist/lib/{orchestrator-ClXbJ4Mb.js.map → orchestrator-C6dc-2OQ.js.map} +1 -1
- package/dist/lib/{orchestrator-CjEau_RG.js → orchestrator-DVkyd8K9.js} +27 -17
- package/dist/lib/orchestrator-DVkyd8K9.js.map +1 -0
- package/dist/lib/{peerjs-BdfpltIe.js → peerjs-BUS9O04I.js} +274 -60
- package/dist/lib/peerjs-BUS9O04I.js.map +1 -0
- package/dist/lib/{push-client-DjwKknNg.js → push-client-4JsQGmQa.js} +3 -3
- package/dist/lib/{push-client-DjwKknNg.js.map → push-client-4JsQGmQa.js.map} +1 -1
- package/dist/lib/{readGroupFileBytes-C8oOe8Iu.js → readGroupFileBytes-CSA7u-nJ.js} +2 -2
- package/dist/lib/{readGroupFileBytes-C8oOe8Iu.js.map → readGroupFileBytes-CSA7u-nJ.js.map} +1 -1
- package/dist/lib/{shadow-claw-DcPGKenn.js → shadow-claw-BMoF8Auf.js} +11 -11
- package/dist/lib/{shadow-claw-DcPGKenn.js.map → shadow-claw-BMoF8Auf.js.map} +1 -1
- package/dist/lib/{shadow-claw-a2ui-CpZUTzlh.js → shadow-claw-a2ui-2I5nffIn.js} +2 -2
- package/dist/lib/{shadow-claw-a2ui-CpZUTzlh.js.map → shadow-claw-a2ui-2I5nffIn.js.map} +1 -1
- package/dist/lib/{shadow-claw-accounts-03oJ__XC.js → shadow-claw-accounts-BCjlgvzy.js} +3 -3
- package/dist/lib/{shadow-claw-accounts-03oJ__XC.js.map → shadow-claw-accounts-BCjlgvzy.js.map} +1 -1
- package/dist/lib/{shadow-claw-channel-config-DEL-aZ7N.js → shadow-claw-channel-config-CxQAmlDE.js} +3 -3
- package/dist/lib/{shadow-claw-channel-config-DEL-aZ7N.js.map → shadow-claw-channel-config-CxQAmlDE.js.map} +1 -1
- package/dist/lib/{shadow-claw-channels-BgaJiPdE.js → shadow-claw-channels-CuYMUVAG.js} +3 -3
- package/dist/lib/{shadow-claw-channels-BgaJiPdE.js.map → shadow-claw-channels-CuYMUVAG.js.map} +1 -1
- package/dist/lib/{shadow-claw-chat-mXPQZbwT.js → shadow-claw-chat-RFtPmmyl.js} +13 -12
- package/dist/lib/shadow-claw-chat-RFtPmmyl.js.map +1 -0
- package/dist/lib/{shadow-claw-control-plane-DO6foOLV.js → shadow-claw-control-plane-siqmRzR1.js} +7 -7
- package/dist/lib/{shadow-claw-control-plane-DO6foOLV.js.map → shadow-claw-control-plane-siqmRzR1.js.map} +1 -1
- package/dist/lib/{shadow-claw-conversations-BLwHTwdW.js → shadow-claw-conversations-DygK5y1e.js} +7 -7
- package/dist/lib/{shadow-claw-conversations-BLwHTwdW.js.map → shadow-claw-conversations-DygK5y1e.js.map} +1 -1
- package/dist/lib/{shadow-claw-file-viewer-BSbZvSl-.js → shadow-claw-file-viewer-DGMA7d7H.js} +11 -11
- package/dist/lib/shadow-claw-file-viewer-DGMA7d7H.js.map +1 -0
- package/dist/lib/{shadow-claw-files-BLVr9Pua.js → shadow-claw-files-CgD1B9J7.js} +8 -8
- package/dist/lib/{shadow-claw-files-BLVr9Pua.js.map → shadow-claw-files-CgD1B9J7.js.map} +1 -1
- package/dist/lib/{shadow-claw-git-CHC1H86J.js → shadow-claw-git-Bw1jGRrf.js} +6 -6
- package/dist/lib/{shadow-claw-git-CHC1H86J.js.map → shadow-claw-git-Bw1jGRrf.js.map} +1 -1
- package/dist/lib/{shadow-claw-integrations-Ds-CLPhj.js → shadow-claw-integrations-ChaXtvsg.js} +4 -4
- package/dist/lib/{shadow-claw-integrations-Ds-CLPhj.js.map → shadow-claw-integrations-ChaXtvsg.js.map} +1 -1
- package/dist/lib/{shadow-claw-llm-CKXfxd3D.js → shadow-claw-llm-CDM4Akjc.js} +6 -6
- package/dist/lib/{shadow-claw-llm-CKXfxd3D.js.map → shadow-claw-llm-CDM4Akjc.js.map} +1 -1
- package/dist/lib/{shadow-claw-mcp-remote-CT5Q-54E.js → shadow-claw-mcp-remote-BLxs_Z4I.js} +4 -4
- package/dist/lib/{shadow-claw-mcp-remote-CT5Q-54E.js.map → shadow-claw-mcp-remote-BLxs_Z4I.js.map} +1 -1
- package/dist/lib/{shadow-claw-networking-dpYvfchh.js → shadow-claw-networking-BYt-kMSI.js} +2 -2
- package/dist/lib/{shadow-claw-networking-dpYvfchh.js.map → shadow-claw-networking-BYt-kMSI.js.map} +1 -1
- package/dist/lib/{shadow-claw-notifications-_YeAVPga.js → shadow-claw-notifications-Dpe4EtZI.js} +3 -3
- package/dist/lib/{shadow-claw-notifications-_YeAVPga.js.map → shadow-claw-notifications-Dpe4EtZI.js.map} +1 -1
- package/dist/lib/{shadow-claw-page-header-Cti2fzf-.js → shadow-claw-page-header-P4EvWyUr.js} +2 -2
- package/dist/lib/{shadow-claw-page-header-Cti2fzf-.js.map → shadow-claw-page-header-P4EvWyUr.js.map} +1 -1
- package/dist/lib/{shadow-claw-pages-DVzZriZ7.js → shadow-claw-pages-DWd_c4d6.js} +10 -10
- package/dist/lib/{shadow-claw-pages-DVzZriZ7.js.map → shadow-claw-pages-DWd_c4d6.js.map} +1 -1
- package/dist/lib/{shadow-claw-peerjs-BvixjeBz.js → shadow-claw-peerjs-D928817m.js} +3 -3
- package/dist/lib/{shadow-claw-peerjs-BvixjeBz.js.map → shadow-claw-peerjs-D928817m.js.map} +1 -1
- package/dist/lib/{shadow-claw-settings-DV9-gD4Q.js → shadow-claw-settings-C8OPrSqs.js} +8 -8
- package/dist/lib/{shadow-claw-settings-DV9-gD4Q.js.map → shadow-claw-settings-C8OPrSqs.js.map} +1 -1
- package/dist/lib/{shadow-claw-storage-Bv__kXG6.js → shadow-claw-storage-CZ2uZJNw.js} +5 -5
- package/dist/lib/{shadow-claw-storage-Bv__kXG6.js.map → shadow-claw-storage-CZ2uZJNw.js.map} +1 -1
- package/dist/lib/{shadow-claw-task-server-DNOe8PWK.js → shadow-claw-task-server-CLT018BX.js} +2 -2
- package/dist/lib/{shadow-claw-task-server-DNOe8PWK.js.map → shadow-claw-task-server-CLT018BX.js.map} +1 -1
- package/dist/lib/{shadow-claw-tasks-qmcDT4PU.js → shadow-claw-tasks-D5h-lGmq.js} +9 -8
- package/dist/lib/shadow-claw-tasks-D5h-lGmq.js.map +1 -0
- package/dist/lib/{shadow-claw-terminal-0QUWP8of.js → shadow-claw-terminal-Cy1O6KVM.js} +2 -2
- package/dist/lib/{shadow-claw-terminal-0QUWP8of.js.map → shadow-claw-terminal-Cy1O6KVM.js.map} +1 -1
- package/dist/lib/{shadow-claw-tools-Bs_bmI6-.js → shadow-claw-tools-CVD06bCR.js} +9 -9
- package/dist/lib/{shadow-claw-tools-Bs_bmI6-.js.map → shadow-claw-tools-CVD06bCR.js.map} +1 -1
- package/dist/lib/{shadow-claw-webvm-DYaoL7QY.js → shadow-claw-webvm-DoGl5ZSJ.js} +3 -3
- package/dist/lib/{shadow-claw-webvm-DYaoL7QY.js.map → shadow-claw-webvm-DoGl5ZSJ.js.map} +1 -1
- package/dist/lib/subsystems/channels/peerjs.d.ts +37 -4
- package/dist/lib/subsystems/channels/room.d.ts +4 -0
- package/dist/lib/{syncWebMcpRegistration-BhbqI6R2.js → syncWebMcpRegistration-BeYkQEvj.js} +5 -5
- package/dist/lib/{syncWebMcpRegistration-BhbqI6R2.js.map → syncWebMcpRegistration-BeYkQEvj.js.map} +1 -1
- package/dist/lib/tools-C3Kft940.js +1 -0
- package/dist/lib/{tools-DBaMRiEu.js → tools-DKzPWc0q.js} +2 -2
- package/dist/lib/{tools-DBaMRiEu.js.map → tools-DKzPWc0q.js.map} +1 -1
- package/dist/lib/{tools-DwwB9RBa.js → tools-DqcJe8LS.js} +5 -5
- package/dist/lib/{tools-DwwB9RBa.js.map → tools-DqcJe8LS.js.map} +1 -1
- package/dist/lib/{trusted-types-Dx0RZlrd.js → trusted-types-Oz7xXJAY.js} +4 -4
- package/dist/lib/{trusted-types-Dx0RZlrd.js.map → trusted-types-Oz7xXJAY.js.map} +1 -1
- package/dist/lib/utils/index.js +1 -1
- package/dist/lib/utils/namespacedStorage.js +1 -1
- package/dist/lib/utils/utils.js +1 -1
- package/dist/lib/{webmcp-j_1_T3wf.js → webmcp-BC8_WafM.js} +4 -4
- package/dist/lib/{webmcp-j_1_T3wf.js.map → webmcp-BC8_WafM.js.map} +1 -1
- package/dist/lib/worker/utils/system-prompt.d.ts +4 -1
- package/dist/public/.agents/skills/main/skill-creator/SKILL.md +3 -2
- package/dist/public/.agents/skills/main/skill-creator/references/frontmatter-spec.md +5 -3
- package/dist/public/.well-known/agent-skills/index.json +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/agent.worker.js +18 -17
- package/dist/public/app-routes-BMQ4HFaM.js +1 -0
- package/dist/public/{bundler-Ca-Xwln8.js → bundler-0if-QelV.js} +4 -4
- package/dist/public/{config-CrHchneq.js → config-Bnwx4EfS.js} +1 -1
- package/dist/public/{configurePeerJs-B470pdeU.js → configurePeerJs-DkyGvwk_.js} +1 -1
- package/dist/public/{connections-DvbgdkaB.js → connections-6575KDGE.js} +1 -1
- package/dist/public/{custom-element-security-FU04Cq05.js → custom-element-security-BQJQ_oKz.js} +1 -1
- package/dist/public/docs/example/article/index.html +2 -2
- package/dist/public/docs/publishing/index.html +2 -2
- package/dist/public/docs/skill-creator/index.html +2 -2
- package/dist/public/docs/subsystems/skills.md +3 -1
- package/dist/public/{downloadGroupFile-D8KRJGGL.js → downloadGroupFile-Wo1Sxdhr.js} +1 -1
- package/dist/public/{e2e-bridge-CSW0S5Yz.js → e2e-bridge-CvLCUU2O.js} +1 -1
- package/dist/public/{file-viewer-Cs-riNvy.js → file-viewer-CIjqAvNF.js} +1 -1
- package/dist/public/{getGroupDir-P1h9wl6S.js → getGroupDir-BwprrdrQ.js} +1 -1
- package/dist/public/{git-7Vq_SJSp.js → git-BSnY2D-A.js} +2 -2
- package/dist/public/{iframe-sanitizer-y2Z1pPwY.js → iframe-sanitizer-viROQkRn.js} +1 -1
- package/dist/public/index.html +2 -2
- package/dist/public/index.js +1 -1
- package/dist/public/{initChatSplitResize-CzV2E7Ul.js → initChatSplitResize-BA18wLQQ.js} +1 -1
- package/dist/public/{initControlPlane-BqCY0NQy.js → initControlPlane-L96uJkRA.js} +1 -1
- package/dist/public/main/index.html +2 -2
- package/dist/public/main/memory/index.html +2 -2
- package/dist/public/{markdown-Cw7vCtTg.js → markdown-DGjZAm_w.js} +17 -14
- package/dist/public/{mcp-reconnect-9emsqGRe.js → mcp-reconnect-CBHuaYdF.js} +1 -1
- package/dist/public/{memoryStorage-C0KvLNUp.js → memoryStorage-C1llaYus.js} +1 -1
- package/dist/public/orchestrator-C0VOoTiK.js +15 -0
- package/dist/public/{orchestrator-DpkkeD6T.js → orchestrator-DMWi--Dc.js} +20 -19
- package/dist/public/peerjs-Bf6ZxfbA.js +1 -0
- package/dist/public/{push-client-CHjSbrWs.js → push-client-BD4YalBa.js} +1 -1
- package/dist/public/service-worker.js +1 -1
- package/dist/public/{shadow-claw-BBPV_9X8.js → shadow-claw-DRy-D4Qi.js} +2 -2
- package/dist/public/{shadow-claw-accounts-xUOLBsQZ.js → shadow-claw-accounts-DnfmA8cb.js} +1 -1
- package/dist/public/{shadow-claw-channels-BJvrKQjg.js → shadow-claw-channels-8UkycZAa.js} +1 -1
- package/dist/public/{shadow-claw-chat-BG2EaRaw.js → shadow-claw-chat-Cf5LUiul.js} +9 -9
- package/dist/public/{shadow-claw-control-plane-BBa7WbTg.js → shadow-claw-control-plane-UsBF-Nvd.js} +2 -2
- package/dist/public/{shadow-claw-conversations-CFaWFmkm.js → shadow-claw-conversations-Aoe61Y21.js} +1 -1
- package/dist/public/{shadow-claw-file-viewer-Z-GIKaE9.js → shadow-claw-file-viewer-D28dSSEn.js} +6 -6
- package/dist/public/{shadow-claw-files-BBx4iMsk.js → shadow-claw-files-CaDUlPEU.js} +1 -1
- package/dist/public/{shadow-claw-git-vTOKatwd.js → shadow-claw-git-DYNcZMWA.js} +2 -2
- package/dist/public/{shadow-claw-integrations-BBVnO0Fc.js → shadow-claw-integrations-BJf_hQVv.js} +1 -1
- package/dist/public/{shadow-claw-llm-Ce1Ax6-x.js → shadow-claw-llm-BqK2SIRf.js} +2 -2
- package/dist/public/{shadow-claw-mcp-remote-Bkx0gsmF.js → shadow-claw-mcp-remote-B_dDG990.js} +1 -1
- package/dist/public/{shadow-claw-networking-q4XIzdB5.js → shadow-claw-networking-D8LxOofv.js} +1 -1
- package/dist/public/{shadow-claw-notifications-D2cz0gmm.js → shadow-claw-notifications-DpVyiNG_.js} +1 -1
- package/dist/public/{shadow-claw-page-header-BccSHItx.js → shadow-claw-page-header-DdC7bJuW.js} +1 -1
- package/dist/public/{shadow-claw-pages-3335lmSC.js → shadow-claw-pages-CYMl4J-6.js} +3 -3
- package/dist/public/{shadow-claw-settings-4ptYuJwO.js → shadow-claw-settings-Da_8Oy3O.js} +3 -3
- package/dist/public/{shadow-claw-storage-bIrPKFhF.js → shadow-claw-storage-DXIm86_-.js} +1 -1
- package/dist/public/{shadow-claw-task-server-5yqVBxy1.js → shadow-claw-task-server-BCceBD0G.js} +1 -1
- package/dist/public/{shadow-claw-tasks-DcqYHPLZ.js → shadow-claw-tasks-BW1QZ5L3.js} +19 -19
- package/dist/public/{shadow-claw-terminal-fARaDONr.js → shadow-claw-terminal-vqfsxhcK.js} +1 -1
- package/dist/public/{shadow-claw-tools-paEAhcJr.js → shadow-claw-tools-l0Jsa7UJ.js} +1 -1
- package/dist/public/{shadow-claw-webvm-CbzH_vyX.js → shadow-claw-webvm-CDPOWZm7.js} +1 -1
- package/dist/public/skills/main/skill-creator/SKILL.md +3 -2
- package/dist/public/skills/main/skill-creator/references/frontmatter-spec.md +5 -3
- package/dist/public/static-main-manifest.json +2 -2
- package/dist/public/{syncWebMcpRegistration-CWSYaHex.js → syncWebMcpRegistration-5b5FkP9_.js} +1 -1
- package/dist/public/tools-B-PzsLc2.js +1 -0
- package/dist/public/{tools-C8x3nmo4.js → tools-CcgG5XuA.js} +1 -1
- package/dist/public/{tools-DvckJZG2.js → tools-VSOY66vs.js} +1 -1
- package/dist/public/{webmcp-DAjmliCx.js → webmcp-DBONjQWd.js} +1 -1
- package/dist/server.js +2 -2
- package/package.json +2 -2
- package/src/__mocks__/marked.cjs +14 -0
- package/src/components/shadow-claw-chat/shadow-claw-chat.test.ts +17 -0
- package/src/components/shadow-claw-chat/shadow-claw-chat.ts +5 -1
- package/src/components/shadow-claw-file-viewer/shadow-claw-file-viewer.test.ts +78 -0
- package/src/components/shadow-claw-file-viewer/shadow-claw-file-viewer.ts +6 -2
- package/src/components/shadow-claw-pages/utils/resolveWorkspaceLinkPath.test.ts +56 -0
- package/src/components/shadow-claw-tasks/shadow-claw-tasks.test.ts +22 -0
- package/src/components/shadow-claw-tasks/shadow-claw-tasks.ts +5 -1
- package/src/content/markdown-links.test.ts +109 -0
- package/src/content/markdown-links.ts +187 -0
- package/src/content/markdown.test.ts +33 -0
- package/src/content/markdown.ts +6 -1
- package/src/core/app-routes.test.ts +65 -0
- package/src/core/app-routes.ts +1 -1
- package/src/core/orchestrator/orchestrator.ts +3 -0
- package/src/core/orchestrator/utils/compactContext.ts +2 -0
- package/src/core/orchestrator/utils/invokeAgent.ts +1 -0
- package/src/subsystems/accounts/service-accounts.test.ts +0 -1
- package/src/subsystems/channels/peerjs.test.ts +479 -1
- package/src/subsystems/channels/peerjs.ts +420 -75
- package/src/subsystems/channels/room.test.ts +35 -0
- package/src/subsystems/channels/room.ts +15 -0
- package/src/subsystems/skills/activateSkill.test.ts +38 -5
- package/src/subsystems/skills/activateSkill.ts +25 -3
- package/src/subsystems/skills/parseSkill.test.ts +71 -0
- package/src/subsystems/skills/parseSkill.ts +185 -25
- package/src/subsystems/tools/files.ts +4 -4
- package/src/worker/tools/spawn-subagent/spawn-subagent.test.ts +22 -23
- package/src/worker/tools/workspace/send-file.test.ts +24 -1
- package/src/worker/tools/workspace/send-file.ts +6 -3
- package/src/worker/utils/handleCompact.test.ts +3 -4
- package/src/worker/utils/handleInvoke.test.ts +13 -11
- package/src/worker/utils/handleInvoke.ts +3 -0
- package/src/worker/utils/handleMessage.test.ts +0 -1
- package/src/worker/utils/post.test.ts +3 -4
- package/src/worker/utils/sandboxedEval.test.ts +1 -2
- package/src/worker/utils/system-prompt.test.ts +59 -0
- package/src/worker/utils/system-prompt.ts +21 -1
- package/src/worker/utils/withRetry.test.ts +3 -16
- package/dist/lib/app-routes-CqBOeA5q.js.map +0 -1
- package/dist/lib/markdown-DgdSt2GD.js.map +0 -1
- package/dist/lib/orchestrator-CjEau_RG.js.map +0 -1
- package/dist/lib/peerjs-BdfpltIe.js.map +0 -1
- package/dist/lib/shadow-claw-chat-mXPQZbwT.js.map +0 -1
- package/dist/lib/shadow-claw-file-viewer-BSbZvSl-.js.map +0 -1
- package/dist/lib/shadow-claw-tasks-qmcDT4PU.js.map +0 -1
- package/dist/lib/tools-D4Pp-nUw.js +0 -1
- package/dist/public/app-routes-Bs-riIvr.js +0 -1
- package/dist/public/orchestrator-BWkHHO9Y.js +0 -15
- package/dist/public/peerjs-tf2EmWjB.js +0 -1
- package/dist/public/tools-COduyYJ0.js +0 -1
package/src/core/app-routes.ts
CHANGED
|
@@ -31,7 +31,7 @@ function encodePathSegment(value: string): string {
|
|
|
31
31
|
return encodeURIComponent(value);
|
|
32
32
|
}
|
|
33
33
|
|
|
34
|
-
function decodePathSegment(value: string): string {
|
|
34
|
+
export function decodePathSegment(value: string): string {
|
|
35
35
|
try {
|
|
36
36
|
return decodeURIComponent(value);
|
|
37
37
|
} catch {
|
|
@@ -260,6 +260,7 @@ export class Orchestrator {
|
|
|
260
260
|
});
|
|
261
261
|
|
|
262
262
|
this.roomChannel.setManager(this.roomManager);
|
|
263
|
+
this.roomChannel.setPeerJs(this.peerjs);
|
|
263
264
|
this.peerjs.setRoomNotificationHandler((from, method, params) =>
|
|
264
265
|
this.roomManager.handleNotification(from, method, params),
|
|
265
266
|
);
|
|
@@ -567,6 +568,8 @@ export class Orchestrator {
|
|
|
567
568
|
activeTools,
|
|
568
569
|
toolsStore.systemPromptOverride,
|
|
569
570
|
peerState,
|
|
571
|
+
undefined,
|
|
572
|
+
{ groupId },
|
|
570
573
|
);
|
|
571
574
|
|
|
572
575
|
const groups = await listGroups(db);
|
|
@@ -10,6 +10,7 @@ class MockDataConnection {
|
|
|
10
10
|
open = true;
|
|
11
11
|
peer: string;
|
|
12
12
|
remotePeerId: string;
|
|
13
|
+
_chunkedData: Record<string, any> = {};
|
|
13
14
|
|
|
14
15
|
send = jest.fn();
|
|
15
16
|
private handlers: Map<string, EventHandler[]> = new Map();
|
|
@@ -19,6 +20,13 @@ class MockDataConnection {
|
|
|
19
20
|
this.peer = remotePeerId;
|
|
20
21
|
}
|
|
21
22
|
|
|
23
|
+
_handleChunk(data: any) {
|
|
24
|
+
const id = data.__peerData;
|
|
25
|
+
const chunkInfo = this._chunkedData[id] || { count: 0, total: data.total };
|
|
26
|
+
chunkInfo.count++;
|
|
27
|
+
this._chunkedData[id] = chunkInfo;
|
|
28
|
+
}
|
|
29
|
+
|
|
22
30
|
close() {
|
|
23
31
|
this.emit("close");
|
|
24
32
|
}
|
|
@@ -106,7 +114,9 @@ jest.unstable_mockModule("../../utils/utils.js", () => ({
|
|
|
106
114
|
computeSha256: jest.fn(async () => "mock-hash"),
|
|
107
115
|
}));
|
|
108
116
|
|
|
109
|
-
const { PeerJsChannel } = await import("./peerjs.js");
|
|
117
|
+
const { PeerJsChannel, transferProgressSignal } = await import("./peerjs.js");
|
|
118
|
+
const { writeGroupFileBytes } =
|
|
119
|
+
(await import("../../storage/writeGroupFileBytes.js")) as any;
|
|
110
120
|
|
|
111
121
|
function flushMicrotasks(): Promise<void> {
|
|
112
122
|
return new Promise((r) => setTimeout(r, 10));
|
|
@@ -695,6 +705,49 @@ describe("PeerJsChannel", () => {
|
|
|
695
705
|
});
|
|
696
706
|
});
|
|
697
707
|
|
|
708
|
+
it("intercepts _handleChunk on incoming DataConnection and updates transferProgressSignal", async () => {
|
|
709
|
+
const ch = new PeerJsChannel();
|
|
710
|
+
ch.configure("my-id", []);
|
|
711
|
+
ch.start();
|
|
712
|
+
|
|
713
|
+
await flushMicrotasks();
|
|
714
|
+
|
|
715
|
+
const incomingConn = new MockDataConnection("remote-chunk-peer");
|
|
716
|
+
lastPeerInstance!.emit("connection", incomingConn);
|
|
717
|
+
incomingConn.emit("open");
|
|
718
|
+
|
|
719
|
+
const { transferProgressSignal } = await import("./peerjs.js");
|
|
720
|
+
transferProgressSignal.set(null);
|
|
721
|
+
|
|
722
|
+
// Simulate first chunk arriving
|
|
723
|
+
incomingConn._handleChunk({
|
|
724
|
+
__peerData: 42,
|
|
725
|
+
n: 0,
|
|
726
|
+
total: 5,
|
|
727
|
+
data: new Uint8Array([1, 2, 3]),
|
|
728
|
+
});
|
|
729
|
+
|
|
730
|
+
expect(transferProgressSignal.get()).toEqual({
|
|
731
|
+
count: 1,
|
|
732
|
+
total: 5,
|
|
733
|
+
direction: "receive",
|
|
734
|
+
});
|
|
735
|
+
|
|
736
|
+
// Simulate second chunk arriving
|
|
737
|
+
incomingConn._handleChunk({
|
|
738
|
+
__peerData: 42,
|
|
739
|
+
n: 1,
|
|
740
|
+
total: 5,
|
|
741
|
+
data: new Uint8Array([4, 5, 6]),
|
|
742
|
+
});
|
|
743
|
+
|
|
744
|
+
expect(transferProgressSignal.get()).toEqual({
|
|
745
|
+
count: 2,
|
|
746
|
+
total: 5,
|
|
747
|
+
direction: "receive",
|
|
748
|
+
});
|
|
749
|
+
});
|
|
750
|
+
|
|
698
751
|
it("sends file attachments and markdown links over DataConnection", async () => {
|
|
699
752
|
const ch = new PeerJsChannel();
|
|
700
753
|
ch.configure("my-id", []);
|
|
@@ -719,6 +772,344 @@ describe("PeerJsChannel", () => {
|
|
|
719
772
|
);
|
|
720
773
|
});
|
|
721
774
|
|
|
775
|
+
it("chunks outbound file attachments into __file_header and __file_chunk frames", async () => {
|
|
776
|
+
const ch = new PeerJsChannel();
|
|
777
|
+
ch.configure("my-id", []);
|
|
778
|
+
ch.start();
|
|
779
|
+
|
|
780
|
+
await flushMicrotasks();
|
|
781
|
+
|
|
782
|
+
const incomingConn = new MockDataConnection("remote-peer-files");
|
|
783
|
+
lastPeerInstance!.emit("connection", incomingConn);
|
|
784
|
+
incomingConn.emit("open");
|
|
785
|
+
|
|
786
|
+
await ch.send("peer:remote-peer-files", "See [notes](notes.txt)", [
|
|
787
|
+
{ path: "image.png", mimeType: "image/png" } as any,
|
|
788
|
+
]);
|
|
789
|
+
|
|
790
|
+
// Verify header contains totalChunks
|
|
791
|
+
expect(incomingConn.send).toHaveBeenCalledWith(
|
|
792
|
+
expect.objectContaining({
|
|
793
|
+
type: "__file_header",
|
|
794
|
+
name: "image.png",
|
|
795
|
+
mimeType: "image/png",
|
|
796
|
+
totalChunks: expect.any(Number),
|
|
797
|
+
}),
|
|
798
|
+
);
|
|
799
|
+
|
|
800
|
+
// Verify chunk frame was sent
|
|
801
|
+
expect(incomingConn.send).toHaveBeenCalledWith(
|
|
802
|
+
expect.objectContaining({
|
|
803
|
+
type: "__file_chunk",
|
|
804
|
+
name: "image.png",
|
|
805
|
+
index: 0,
|
|
806
|
+
totalChunks: expect.any(Number),
|
|
807
|
+
data: expect.any(ArrayBuffer),
|
|
808
|
+
}),
|
|
809
|
+
);
|
|
810
|
+
});
|
|
811
|
+
|
|
812
|
+
it("reassembles inbound __file_chunk frames and writes complete file to DB", async () => {
|
|
813
|
+
const ch = new PeerJsChannel();
|
|
814
|
+
ch.configure("my-id", []);
|
|
815
|
+
ch.start();
|
|
816
|
+
|
|
817
|
+
await flushMicrotasks();
|
|
818
|
+
|
|
819
|
+
const incomingConn = new MockDataConnection("remote-peer-chunk-sender");
|
|
820
|
+
lastPeerInstance!.emit("connection", incomingConn);
|
|
821
|
+
incomingConn.emit("open");
|
|
822
|
+
|
|
823
|
+
transferProgressSignal.set(null);
|
|
824
|
+
|
|
825
|
+
// Inbound header
|
|
826
|
+
incomingConn.emit("data", {
|
|
827
|
+
type: "__file_header",
|
|
828
|
+
id: "tx-1",
|
|
829
|
+
name: "test.bin",
|
|
830
|
+
mimeType: "application/octet-stream",
|
|
831
|
+
size: 6,
|
|
832
|
+
totalChunks: 2,
|
|
833
|
+
chunkSize: 3,
|
|
834
|
+
});
|
|
835
|
+
|
|
836
|
+
// Inbound chunk 0
|
|
837
|
+
incomingConn.emit("data", {
|
|
838
|
+
type: "__file_chunk",
|
|
839
|
+
id: "tx-1",
|
|
840
|
+
name: "test.bin",
|
|
841
|
+
index: 0,
|
|
842
|
+
totalChunks: 2,
|
|
843
|
+
data: new Uint8Array([10, 20, 30]).buffer,
|
|
844
|
+
});
|
|
845
|
+
|
|
846
|
+
expect(transferProgressSignal.get()).toEqual({
|
|
847
|
+
count: 1,
|
|
848
|
+
total: 2,
|
|
849
|
+
direction: "receive",
|
|
850
|
+
});
|
|
851
|
+
expect(writeGroupFileBytes).not.toHaveBeenCalled();
|
|
852
|
+
|
|
853
|
+
// Inbound chunk 1
|
|
854
|
+
incomingConn.emit("data", {
|
|
855
|
+
type: "__file_chunk",
|
|
856
|
+
id: "tx-1",
|
|
857
|
+
name: "test.bin",
|
|
858
|
+
index: 1,
|
|
859
|
+
totalChunks: 2,
|
|
860
|
+
data: new Uint8Array([40, 50, 60]).buffer,
|
|
861
|
+
});
|
|
862
|
+
|
|
863
|
+
expect(transferProgressSignal.get()).toEqual({
|
|
864
|
+
count: 2,
|
|
865
|
+
total: 2,
|
|
866
|
+
direction: "receive",
|
|
867
|
+
});
|
|
868
|
+
|
|
869
|
+
await flushMicrotasks();
|
|
870
|
+
|
|
871
|
+
expect(writeGroupFileBytes).toHaveBeenCalledWith(
|
|
872
|
+
expect.anything(),
|
|
873
|
+
"peer:remote-peer-chunk-sender",
|
|
874
|
+
"test.bin",
|
|
875
|
+
new Uint8Array([10, 20, 30, 40, 50, 60]),
|
|
876
|
+
);
|
|
877
|
+
});
|
|
878
|
+
|
|
879
|
+
it("reassembles out-of-order __file_chunk frames correctly", async () => {
|
|
880
|
+
const ch = new PeerJsChannel();
|
|
881
|
+
ch.configure("my-id", []);
|
|
882
|
+
ch.start();
|
|
883
|
+
|
|
884
|
+
await flushMicrotasks();
|
|
885
|
+
|
|
886
|
+
const incomingConn = new MockDataConnection("remote-peer-ooo");
|
|
887
|
+
lastPeerInstance!.emit("connection", incomingConn);
|
|
888
|
+
incomingConn.emit("open");
|
|
889
|
+
|
|
890
|
+
incomingConn.emit("data", {
|
|
891
|
+
type: "__file_header",
|
|
892
|
+
id: "tx-ooo",
|
|
893
|
+
name: "ooo.bin",
|
|
894
|
+
mimeType: "application/octet-stream",
|
|
895
|
+
size: 9,
|
|
896
|
+
totalChunks: 3,
|
|
897
|
+
chunkSize: 3,
|
|
898
|
+
});
|
|
899
|
+
|
|
900
|
+
// Send chunk index 2 first
|
|
901
|
+
incomingConn.emit("data", {
|
|
902
|
+
type: "__file_chunk",
|
|
903
|
+
id: "tx-ooo",
|
|
904
|
+
name: "ooo.bin",
|
|
905
|
+
index: 2,
|
|
906
|
+
totalChunks: 3,
|
|
907
|
+
data: new Uint8Array([7, 8, 9]).buffer,
|
|
908
|
+
});
|
|
909
|
+
|
|
910
|
+
// Then chunk index 0
|
|
911
|
+
incomingConn.emit("data", {
|
|
912
|
+
type: "__file_chunk",
|
|
913
|
+
id: "tx-ooo",
|
|
914
|
+
name: "ooo.bin",
|
|
915
|
+
index: 0,
|
|
916
|
+
totalChunks: 3,
|
|
917
|
+
data: new Uint8Array([1, 2, 3]).buffer,
|
|
918
|
+
});
|
|
919
|
+
|
|
920
|
+
// Finally chunk index 1
|
|
921
|
+
incomingConn.emit("data", {
|
|
922
|
+
type: "__file_chunk",
|
|
923
|
+
id: "tx-ooo",
|
|
924
|
+
name: "ooo.bin",
|
|
925
|
+
index: 1,
|
|
926
|
+
totalChunks: 3,
|
|
927
|
+
data: new Uint8Array([4, 5, 6]).buffer,
|
|
928
|
+
});
|
|
929
|
+
|
|
930
|
+
await flushMicrotasks();
|
|
931
|
+
|
|
932
|
+
expect(writeGroupFileBytes).toHaveBeenCalledWith(
|
|
933
|
+
expect.anything(),
|
|
934
|
+
"peer:remote-peer-ooo",
|
|
935
|
+
"ooo.bin",
|
|
936
|
+
new Uint8Array([1, 2, 3, 4, 5, 6, 7, 8, 9]),
|
|
937
|
+
);
|
|
938
|
+
});
|
|
939
|
+
|
|
940
|
+
it("does not flicker or overwrite transferProgressSignal when raw chunks arrive during an application file transfer", async () => {
|
|
941
|
+
const ch = new PeerJsChannel();
|
|
942
|
+
ch.configure("my-id", []);
|
|
943
|
+
ch.start();
|
|
944
|
+
|
|
945
|
+
await flushMicrotasks();
|
|
946
|
+
|
|
947
|
+
const incomingConn = new MockDataConnection("remote-peer-flicker-test");
|
|
948
|
+
lastPeerInstance!.emit("connection", incomingConn);
|
|
949
|
+
incomingConn.emit("open");
|
|
950
|
+
|
|
951
|
+
transferProgressSignal.set(null);
|
|
952
|
+
|
|
953
|
+
// Inbound application file header for a 10-chunk file
|
|
954
|
+
incomingConn.emit("data", {
|
|
955
|
+
type: "__file_header",
|
|
956
|
+
id: "tx-flicker",
|
|
957
|
+
name: "test-flicker.bin",
|
|
958
|
+
mimeType: "application/octet-stream",
|
|
959
|
+
size: 100,
|
|
960
|
+
totalChunks: 10,
|
|
961
|
+
chunkSize: 10,
|
|
962
|
+
});
|
|
963
|
+
|
|
964
|
+
// Transfer progress is immediately initialized upon header receipt
|
|
965
|
+
expect(transferProgressSignal.get()).toEqual({
|
|
966
|
+
count: 0,
|
|
967
|
+
total: 10,
|
|
968
|
+
direction: "receive",
|
|
969
|
+
});
|
|
970
|
+
|
|
971
|
+
// Simulate a raw PeerJS binarypack frame chunk arriving on the connection
|
|
972
|
+
// (e.g. if the message was fragmented at the WebRTC layer)
|
|
973
|
+
incomingConn._handleChunk({
|
|
974
|
+
__peerData: 99,
|
|
975
|
+
n: 0,
|
|
976
|
+
total: 2,
|
|
977
|
+
data: new Uint8Array([1, 2]),
|
|
978
|
+
});
|
|
979
|
+
|
|
980
|
+
// The raw PeerJS frame must NOT overwrite the application file progress with count: 1, total: 2
|
|
981
|
+
expect(transferProgressSignal.get()).toEqual({
|
|
982
|
+
count: 0,
|
|
983
|
+
total: 10,
|
|
984
|
+
direction: "receive",
|
|
985
|
+
});
|
|
986
|
+
|
|
987
|
+
// Deliver application chunk 0
|
|
988
|
+
incomingConn.emit("data", {
|
|
989
|
+
type: "__file_chunk",
|
|
990
|
+
id: "tx-flicker",
|
|
991
|
+
name: "test-flicker.bin",
|
|
992
|
+
index: 0,
|
|
993
|
+
totalChunks: 10,
|
|
994
|
+
data: new Uint8Array([1, 2, 3, 4, 5, 6, 7, 8, 9, 10]).buffer,
|
|
995
|
+
});
|
|
996
|
+
|
|
997
|
+
expect(transferProgressSignal.get()).toEqual({
|
|
998
|
+
count: 1,
|
|
999
|
+
total: 10,
|
|
1000
|
+
direction: "receive",
|
|
1001
|
+
});
|
|
1002
|
+
|
|
1003
|
+
// Simulate second subchunk of the raw frame completing (which previously triggered setTimeout(() => null, 1500))
|
|
1004
|
+
incomingConn._handleChunk({
|
|
1005
|
+
__peerData: 99,
|
|
1006
|
+
n: 1,
|
|
1007
|
+
total: 2,
|
|
1008
|
+
data: new Uint8Array([3, 4]),
|
|
1009
|
+
});
|
|
1010
|
+
|
|
1011
|
+
// Still unaffected
|
|
1012
|
+
expect(transferProgressSignal.get()).toEqual({
|
|
1013
|
+
count: 1,
|
|
1014
|
+
total: 10,
|
|
1015
|
+
direction: "receive",
|
|
1016
|
+
});
|
|
1017
|
+
});
|
|
1018
|
+
|
|
1019
|
+
it("cancels pending clear timeouts when subsequent chunks arrive", async () => {
|
|
1020
|
+
const ch = new PeerJsChannel();
|
|
1021
|
+
ch.configure("my-id", []);
|
|
1022
|
+
ch.start();
|
|
1023
|
+
|
|
1024
|
+
await flushMicrotasks();
|
|
1025
|
+
|
|
1026
|
+
jest.useFakeTimers();
|
|
1027
|
+
try {
|
|
1028
|
+
const incomingConn = new MockDataConnection("remote-peer-timer-test");
|
|
1029
|
+
lastPeerInstance!.emit("connection", incomingConn);
|
|
1030
|
+
incomingConn.emit("open");
|
|
1031
|
+
|
|
1032
|
+
transferProgressSignal.set(null);
|
|
1033
|
+
|
|
1034
|
+
// Header
|
|
1035
|
+
incomingConn.emit("data", {
|
|
1036
|
+
type: "__file_header",
|
|
1037
|
+
id: "tx-timer",
|
|
1038
|
+
name: "timer.bin",
|
|
1039
|
+
mimeType: "application/octet-stream",
|
|
1040
|
+
size: 20,
|
|
1041
|
+
totalChunks: 2,
|
|
1042
|
+
chunkSize: 10,
|
|
1043
|
+
});
|
|
1044
|
+
|
|
1045
|
+
expect(transferProgressSignal.get()).toEqual({
|
|
1046
|
+
count: 0,
|
|
1047
|
+
total: 2,
|
|
1048
|
+
direction: "receive",
|
|
1049
|
+
});
|
|
1050
|
+
|
|
1051
|
+
// Chunk 0
|
|
1052
|
+
incomingConn.emit("data", {
|
|
1053
|
+
type: "__file_chunk",
|
|
1054
|
+
id: "tx-timer",
|
|
1055
|
+
name: "timer.bin",
|
|
1056
|
+
index: 0,
|
|
1057
|
+
totalChunks: 2,
|
|
1058
|
+
data: new Uint8Array(10).buffer,
|
|
1059
|
+
});
|
|
1060
|
+
|
|
1061
|
+
expect(transferProgressSignal.get()).toEqual({
|
|
1062
|
+
count: 1,
|
|
1063
|
+
total: 2,
|
|
1064
|
+
direction: "receive",
|
|
1065
|
+
});
|
|
1066
|
+
|
|
1067
|
+
// Advance timer by 1000ms (not yet 1500ms)
|
|
1068
|
+
jest.advanceTimersByTime(1000);
|
|
1069
|
+
|
|
1070
|
+
// Progress should still be 1/2
|
|
1071
|
+
expect(transferProgressSignal.get()).toEqual({
|
|
1072
|
+
count: 1,
|
|
1073
|
+
total: 2,
|
|
1074
|
+
direction: "receive",
|
|
1075
|
+
});
|
|
1076
|
+
|
|
1077
|
+
// Deliver chunk 1
|
|
1078
|
+
incomingConn.emit("data", {
|
|
1079
|
+
type: "__file_chunk",
|
|
1080
|
+
id: "tx-timer",
|
|
1081
|
+
name: "timer.bin",
|
|
1082
|
+
index: 1,
|
|
1083
|
+
totalChunks: 2,
|
|
1084
|
+
data: new Uint8Array(10).buffer,
|
|
1085
|
+
});
|
|
1086
|
+
|
|
1087
|
+
expect(transferProgressSignal.get()).toEqual({
|
|
1088
|
+
count: 2,
|
|
1089
|
+
total: 2,
|
|
1090
|
+
direction: "receive",
|
|
1091
|
+
});
|
|
1092
|
+
|
|
1093
|
+
// Advance another 1000ms (total 2000ms from start, but only 1000ms from chunk 1)
|
|
1094
|
+
jest.advanceTimersByTime(1000);
|
|
1095
|
+
|
|
1096
|
+
// Progress must NOT have reset to null yet (as 1500ms hasn't passed since chunk 1 completed)
|
|
1097
|
+
expect(transferProgressSignal.get()).toEqual({
|
|
1098
|
+
count: 2,
|
|
1099
|
+
total: 2,
|
|
1100
|
+
direction: "receive",
|
|
1101
|
+
});
|
|
1102
|
+
|
|
1103
|
+
// Advance remaining 600ms (now 1600ms from completion)
|
|
1104
|
+
jest.advanceTimersByTime(600);
|
|
1105
|
+
|
|
1106
|
+
// Now it should be cleared
|
|
1107
|
+
expect(transferProgressSignal.get()).toBeNull();
|
|
1108
|
+
} finally {
|
|
1109
|
+
jest.useRealTimers();
|
|
1110
|
+
}
|
|
1111
|
+
});
|
|
1112
|
+
|
|
722
1113
|
it("sends A2UI and A2UIAction envelopes", async () => {
|
|
723
1114
|
const ch = new PeerJsChannel();
|
|
724
1115
|
ch.configure("my-id", []);
|
|
@@ -885,5 +1276,92 @@ describe("PeerJsChannel", () => {
|
|
|
885
1276
|
|
|
886
1277
|
ch.stop();
|
|
887
1278
|
});
|
|
1279
|
+
|
|
1280
|
+
it("streams attachments to all room members with room groupId in file header", async () => {
|
|
1281
|
+
const ch = new PeerJsChannel();
|
|
1282
|
+
ch.configure("my-id", []);
|
|
1283
|
+
ch.start();
|
|
1284
|
+
|
|
1285
|
+
await flushMicrotasks();
|
|
1286
|
+
|
|
1287
|
+
const memberConn1 = new MockDataConnection("peer-1");
|
|
1288
|
+
const memberConn2 = new MockDataConnection("peer-2");
|
|
1289
|
+
lastPeerInstance!.emit("connection", memberConn1);
|
|
1290
|
+
lastPeerInstance!.emit("connection", memberConn2);
|
|
1291
|
+
memberConn1.emit("open");
|
|
1292
|
+
memberConn2.emit("open");
|
|
1293
|
+
|
|
1294
|
+
const room = {
|
|
1295
|
+
roomId: "test-room",
|
|
1296
|
+
name: "Test Room",
|
|
1297
|
+
hostPeerId: "my-id",
|
|
1298
|
+
members: [
|
|
1299
|
+
{ peerId: "my-id", alias: "Me", kind: "agent" as const },
|
|
1300
|
+
{ peerId: "peer-1", alias: "Peer 1", kind: "human" as const },
|
|
1301
|
+
{ peerId: "peer-2", alias: "Peer 2", kind: "human" as const },
|
|
1302
|
+
],
|
|
1303
|
+
createdAt: 1,
|
|
1304
|
+
};
|
|
1305
|
+
|
|
1306
|
+
await (ch as any).sendAttachmentsToRoom(room, "room:test-room", [
|
|
1307
|
+
{ path: "shared.pdf", mimeType: "application/pdf" } as any,
|
|
1308
|
+
]);
|
|
1309
|
+
|
|
1310
|
+
expect(memberConn1.send).toHaveBeenCalledWith(
|
|
1311
|
+
expect.objectContaining({
|
|
1312
|
+
type: "__file_header",
|
|
1313
|
+
name: "shared.pdf",
|
|
1314
|
+
groupId: "room:test-room",
|
|
1315
|
+
}),
|
|
1316
|
+
);
|
|
1317
|
+
expect(memberConn2.send).toHaveBeenCalledWith(
|
|
1318
|
+
expect.objectContaining({
|
|
1319
|
+
type: "__file_header",
|
|
1320
|
+
name: "shared.pdf",
|
|
1321
|
+
groupId: "room:test-room",
|
|
1322
|
+
}),
|
|
1323
|
+
);
|
|
1324
|
+
});
|
|
1325
|
+
|
|
1326
|
+
it("saves inbound file to target room groupId when specified in __file_header", async () => {
|
|
1327
|
+
const ch = new PeerJsChannel();
|
|
1328
|
+
ch.configure("my-id", []);
|
|
1329
|
+
ch.start();
|
|
1330
|
+
|
|
1331
|
+
await flushMicrotasks();
|
|
1332
|
+
|
|
1333
|
+
const incomingConn = new MockDataConnection("remote-peer-sender");
|
|
1334
|
+
lastPeerInstance!.emit("connection", incomingConn);
|
|
1335
|
+
incomingConn.emit("open");
|
|
1336
|
+
|
|
1337
|
+
incomingConn.emit("data", {
|
|
1338
|
+
type: "__file_header",
|
|
1339
|
+
id: "room-tx-1",
|
|
1340
|
+
name: "room-file.txt",
|
|
1341
|
+
mimeType: "text/plain",
|
|
1342
|
+
size: 3,
|
|
1343
|
+
totalChunks: 1,
|
|
1344
|
+
chunkSize: 10,
|
|
1345
|
+
groupId: "room:target-room",
|
|
1346
|
+
});
|
|
1347
|
+
|
|
1348
|
+
incomingConn.emit("data", {
|
|
1349
|
+
type: "__file_chunk",
|
|
1350
|
+
id: "room-tx-1",
|
|
1351
|
+
name: "room-file.txt",
|
|
1352
|
+
index: 0,
|
|
1353
|
+
totalChunks: 1,
|
|
1354
|
+
data: new Uint8Array([1, 2, 3]).buffer,
|
|
1355
|
+
});
|
|
1356
|
+
|
|
1357
|
+
await flushMicrotasks();
|
|
1358
|
+
|
|
1359
|
+
expect(writeGroupFileBytes).toHaveBeenCalledWith(
|
|
1360
|
+
expect.anything(),
|
|
1361
|
+
"room:target-room",
|
|
1362
|
+
"room-file.txt",
|
|
1363
|
+
new Uint8Array([1, 2, 3]),
|
|
1364
|
+
);
|
|
1365
|
+
});
|
|
888
1366
|
});
|
|
889
1367
|
});
|