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.
Files changed (277) hide show
  1. package/.agents/skills/main/skill-creator/SKILL.md +3 -2
  2. package/.agents/skills/main/skill-creator/references/frontmatter-spec.md +5 -3
  3. package/.well-known/agent-skills/index.json +1 -1
  4. package/.well-known/mcp/server-card.json +1 -1
  5. package/.well-known/mcp.json +1 -1
  6. package/dist/lib/{app-routes-CqBOeA5q.js → app-routes-BAEMLu9g.js} +3 -2
  7. package/dist/lib/app-routes-BAEMLu9g.js.map +1 -0
  8. package/dist/lib/{bundler-8JNIKwOs.js → bundler-CsL7hHMq.js} +4 -9
  9. package/dist/lib/{bundler-8JNIKwOs.js.map → bundler-CsL7hHMq.js.map} +1 -1
  10. package/dist/lib/components/index.js +26 -26
  11. package/dist/lib/components/settings/shadow-claw-accounts.js +1 -1
  12. package/dist/lib/components/settings/shadow-claw-channel-config.js +1 -1
  13. package/dist/lib/components/settings/shadow-claw-control-plane.js +1 -1
  14. package/dist/lib/components/settings/shadow-claw-git.js +1 -1
  15. package/dist/lib/components/settings/shadow-claw-integrations.js +1 -1
  16. package/dist/lib/components/settings/shadow-claw-llm.js +1 -1
  17. package/dist/lib/components/settings/shadow-claw-mcp-remote.js +1 -1
  18. package/dist/lib/components/settings/shadow-claw-networking.js +1 -1
  19. package/dist/lib/components/settings/shadow-claw-notifications.js +1 -1
  20. package/dist/lib/components/settings/shadow-claw-peerjs.js +1 -1
  21. package/dist/lib/components/settings/shadow-claw-storage.js +1 -1
  22. package/dist/lib/components/settings/shadow-claw-task-server.js +1 -1
  23. package/dist/lib/components/settings/shadow-claw-webvm.js +1 -1
  24. package/dist/lib/components/shadow-claw-a2ui.js +1 -1
  25. package/dist/lib/components/shadow-claw-accounts.js +1 -1
  26. package/dist/lib/components/shadow-claw-channel-config.js +1 -1
  27. package/dist/lib/components/shadow-claw-channels.js +1 -1
  28. package/dist/lib/components/shadow-claw-chat.js +1 -1
  29. package/dist/lib/components/shadow-claw-control-plane.js +1 -1
  30. package/dist/lib/components/shadow-claw-conversations.js +1 -1
  31. package/dist/lib/components/shadow-claw-file-viewer.js +1 -1
  32. package/dist/lib/components/shadow-claw-files.js +1 -1
  33. package/dist/lib/components/shadow-claw-git.js +1 -1
  34. package/dist/lib/components/shadow-claw-integrations.js +1 -1
  35. package/dist/lib/components/shadow-claw-llm.js +1 -1
  36. package/dist/lib/components/shadow-claw-mcp-remote.js +1 -1
  37. package/dist/lib/components/shadow-claw-networking.js +1 -1
  38. package/dist/lib/components/shadow-claw-notifications.js +1 -1
  39. package/dist/lib/components/shadow-claw-page-header.js +1 -1
  40. package/dist/lib/components/shadow-claw-pages.js +1 -1
  41. package/dist/lib/components/shadow-claw-peerjs.js +1 -1
  42. package/dist/lib/components/shadow-claw-settings.js +1 -1
  43. package/dist/lib/components/shadow-claw-storage.js +1 -1
  44. package/dist/lib/components/shadow-claw-task-server.js +1 -1
  45. package/dist/lib/components/shadow-claw-tasks.js +1 -1
  46. package/dist/lib/components/shadow-claw-terminal.js +1 -1
  47. package/dist/lib/components/shadow-claw-tools.js +1 -1
  48. package/dist/lib/components/shadow-claw-webvm.js +1 -1
  49. package/dist/lib/components/shadow-claw.js +1 -1
  50. package/dist/lib/{config--CFrw3J3.js → config-DjZ9QWc4.js} +2 -2
  51. package/dist/lib/{config--CFrw3J3.js.map → config-DjZ9QWc4.js.map} +1 -1
  52. package/dist/lib/{configurePeerJs-DG4hliKp.js → configurePeerJs-H0WaoT0w.js} +3 -3
  53. package/dist/lib/{configurePeerJs-DG4hliKp.js.map → configurePeerJs-H0WaoT0w.js.map} +1 -1
  54. package/dist/lib/{connections-DwjzwVz0.js → connections-BURqMIUv.js} +2 -2
  55. package/dist/lib/{connections-DwjzwVz0.js.map → connections-BURqMIUv.js.map} +1 -1
  56. package/dist/lib/content/markdown-links.d.ts +19 -0
  57. package/dist/lib/core/app-routes.d.ts +1 -0
  58. package/dist/lib/{downloadGroupFile-DmcBQU1n.js → downloadGroupFile-B8J4up2a.js} +2 -2
  59. package/dist/lib/{downloadGroupFile-DmcBQU1n.js.map → downloadGroupFile-B8J4up2a.js.map} +1 -1
  60. package/dist/lib/{file-viewer-C3YKnq_-.js → file-viewer-CwvhxAAG.js} +5 -5
  61. package/dist/lib/{file-viewer-C3YKnq_-.js.map → file-viewer-CwvhxAAG.js.map} +1 -1
  62. package/dist/lib/{getGroupDir-m0f-ekgX.js → getGroupDir-QrN2aTo8.js} +4 -4
  63. package/dist/lib/{getGroupDir-m0f-ekgX.js.map → getGroupDir-QrN2aTo8.js.map} +1 -1
  64. package/dist/lib/{git-C-Q6-IVe.js → git-DhZoe1SE.js} +3 -3
  65. package/dist/lib/{git-C-Q6-IVe.js.map → git-DhZoe1SE.js.map} +1 -1
  66. package/dist/lib/{iframe-sanitizer-CUqHuWQ-.js → iframe-sanitizer-Bujgq14T.js} +2 -2
  67. package/dist/lib/{iframe-sanitizer-CUqHuWQ-.js.map → iframe-sanitizer-Bujgq14T.js.map} +1 -1
  68. package/dist/lib/index.js +27 -27
  69. package/dist/lib/{initChatSplitResize-yyBTU6h9.js → initChatSplitResize-BjiWoqC_.js} +2 -2
  70. package/dist/lib/{initChatSplitResize-yyBTU6h9.js.map → initChatSplitResize-BjiWoqC_.js.map} +1 -1
  71. package/dist/lib/{initControlPlane-DnpAzphg.js → initControlPlane-C9JxQCDh.js} +16 -16
  72. package/dist/lib/{initControlPlane-DnpAzphg.js.map → initControlPlane-C9JxQCDh.js.map} +1 -1
  73. package/dist/lib/{markdown-DgdSt2GD.js → markdown-DYHmNjC4.js} +126 -5
  74. package/dist/lib/markdown-DYHmNjC4.js.map +1 -0
  75. package/dist/lib/{mcp-reconnect-C86MR3z8.js → mcp-reconnect-BxJ77WSb.js} +2 -2
  76. package/dist/lib/{mcp-reconnect-C86MR3z8.js.map → mcp-reconnect-BxJ77WSb.js.map} +1 -1
  77. package/dist/lib/{memoryStorage-UR8E8K-H.js → memoryStorage-D3FBwO9T.js} +2 -2
  78. package/dist/lib/{memoryStorage-UR8E8K-H.js.map → memoryStorage-D3FBwO9T.js.map} +1 -1
  79. package/dist/lib/{orchestrator-ClXbJ4Mb.js → orchestrator-C6dc-2OQ.js} +130 -27
  80. package/dist/lib/{orchestrator-ClXbJ4Mb.js.map → orchestrator-C6dc-2OQ.js.map} +1 -1
  81. package/dist/lib/{orchestrator-CjEau_RG.js → orchestrator-DVkyd8K9.js} +27 -17
  82. package/dist/lib/orchestrator-DVkyd8K9.js.map +1 -0
  83. package/dist/lib/{peerjs-BdfpltIe.js → peerjs-BUS9O04I.js} +274 -60
  84. package/dist/lib/peerjs-BUS9O04I.js.map +1 -0
  85. package/dist/lib/{push-client-DjwKknNg.js → push-client-4JsQGmQa.js} +3 -3
  86. package/dist/lib/{push-client-DjwKknNg.js.map → push-client-4JsQGmQa.js.map} +1 -1
  87. package/dist/lib/{readGroupFileBytes-C8oOe8Iu.js → readGroupFileBytes-CSA7u-nJ.js} +2 -2
  88. package/dist/lib/{readGroupFileBytes-C8oOe8Iu.js.map → readGroupFileBytes-CSA7u-nJ.js.map} +1 -1
  89. package/dist/lib/{shadow-claw-DcPGKenn.js → shadow-claw-BMoF8Auf.js} +11 -11
  90. package/dist/lib/{shadow-claw-DcPGKenn.js.map → shadow-claw-BMoF8Auf.js.map} +1 -1
  91. package/dist/lib/{shadow-claw-a2ui-CpZUTzlh.js → shadow-claw-a2ui-2I5nffIn.js} +2 -2
  92. package/dist/lib/{shadow-claw-a2ui-CpZUTzlh.js.map → shadow-claw-a2ui-2I5nffIn.js.map} +1 -1
  93. package/dist/lib/{shadow-claw-accounts-03oJ__XC.js → shadow-claw-accounts-BCjlgvzy.js} +3 -3
  94. package/dist/lib/{shadow-claw-accounts-03oJ__XC.js.map → shadow-claw-accounts-BCjlgvzy.js.map} +1 -1
  95. package/dist/lib/{shadow-claw-channel-config-DEL-aZ7N.js → shadow-claw-channel-config-CxQAmlDE.js} +3 -3
  96. package/dist/lib/{shadow-claw-channel-config-DEL-aZ7N.js.map → shadow-claw-channel-config-CxQAmlDE.js.map} +1 -1
  97. package/dist/lib/{shadow-claw-channels-BgaJiPdE.js → shadow-claw-channels-CuYMUVAG.js} +3 -3
  98. package/dist/lib/{shadow-claw-channels-BgaJiPdE.js.map → shadow-claw-channels-CuYMUVAG.js.map} +1 -1
  99. package/dist/lib/{shadow-claw-chat-mXPQZbwT.js → shadow-claw-chat-RFtPmmyl.js} +13 -12
  100. package/dist/lib/shadow-claw-chat-RFtPmmyl.js.map +1 -0
  101. package/dist/lib/{shadow-claw-control-plane-DO6foOLV.js → shadow-claw-control-plane-siqmRzR1.js} +7 -7
  102. package/dist/lib/{shadow-claw-control-plane-DO6foOLV.js.map → shadow-claw-control-plane-siqmRzR1.js.map} +1 -1
  103. package/dist/lib/{shadow-claw-conversations-BLwHTwdW.js → shadow-claw-conversations-DygK5y1e.js} +7 -7
  104. package/dist/lib/{shadow-claw-conversations-BLwHTwdW.js.map → shadow-claw-conversations-DygK5y1e.js.map} +1 -1
  105. package/dist/lib/{shadow-claw-file-viewer-BSbZvSl-.js → shadow-claw-file-viewer-DGMA7d7H.js} +11 -11
  106. package/dist/lib/shadow-claw-file-viewer-DGMA7d7H.js.map +1 -0
  107. package/dist/lib/{shadow-claw-files-BLVr9Pua.js → shadow-claw-files-CgD1B9J7.js} +8 -8
  108. package/dist/lib/{shadow-claw-files-BLVr9Pua.js.map → shadow-claw-files-CgD1B9J7.js.map} +1 -1
  109. package/dist/lib/{shadow-claw-git-CHC1H86J.js → shadow-claw-git-Bw1jGRrf.js} +6 -6
  110. package/dist/lib/{shadow-claw-git-CHC1H86J.js.map → shadow-claw-git-Bw1jGRrf.js.map} +1 -1
  111. package/dist/lib/{shadow-claw-integrations-Ds-CLPhj.js → shadow-claw-integrations-ChaXtvsg.js} +4 -4
  112. package/dist/lib/{shadow-claw-integrations-Ds-CLPhj.js.map → shadow-claw-integrations-ChaXtvsg.js.map} +1 -1
  113. package/dist/lib/{shadow-claw-llm-CKXfxd3D.js → shadow-claw-llm-CDM4Akjc.js} +6 -6
  114. package/dist/lib/{shadow-claw-llm-CKXfxd3D.js.map → shadow-claw-llm-CDM4Akjc.js.map} +1 -1
  115. package/dist/lib/{shadow-claw-mcp-remote-CT5Q-54E.js → shadow-claw-mcp-remote-BLxs_Z4I.js} +4 -4
  116. package/dist/lib/{shadow-claw-mcp-remote-CT5Q-54E.js.map → shadow-claw-mcp-remote-BLxs_Z4I.js.map} +1 -1
  117. package/dist/lib/{shadow-claw-networking-dpYvfchh.js → shadow-claw-networking-BYt-kMSI.js} +2 -2
  118. package/dist/lib/{shadow-claw-networking-dpYvfchh.js.map → shadow-claw-networking-BYt-kMSI.js.map} +1 -1
  119. package/dist/lib/{shadow-claw-notifications-_YeAVPga.js → shadow-claw-notifications-Dpe4EtZI.js} +3 -3
  120. package/dist/lib/{shadow-claw-notifications-_YeAVPga.js.map → shadow-claw-notifications-Dpe4EtZI.js.map} +1 -1
  121. package/dist/lib/{shadow-claw-page-header-Cti2fzf-.js → shadow-claw-page-header-P4EvWyUr.js} +2 -2
  122. package/dist/lib/{shadow-claw-page-header-Cti2fzf-.js.map → shadow-claw-page-header-P4EvWyUr.js.map} +1 -1
  123. package/dist/lib/{shadow-claw-pages-DVzZriZ7.js → shadow-claw-pages-DWd_c4d6.js} +10 -10
  124. package/dist/lib/{shadow-claw-pages-DVzZriZ7.js.map → shadow-claw-pages-DWd_c4d6.js.map} +1 -1
  125. package/dist/lib/{shadow-claw-peerjs-BvixjeBz.js → shadow-claw-peerjs-D928817m.js} +3 -3
  126. package/dist/lib/{shadow-claw-peerjs-BvixjeBz.js.map → shadow-claw-peerjs-D928817m.js.map} +1 -1
  127. package/dist/lib/{shadow-claw-settings-DV9-gD4Q.js → shadow-claw-settings-C8OPrSqs.js} +8 -8
  128. package/dist/lib/{shadow-claw-settings-DV9-gD4Q.js.map → shadow-claw-settings-C8OPrSqs.js.map} +1 -1
  129. package/dist/lib/{shadow-claw-storage-Bv__kXG6.js → shadow-claw-storage-CZ2uZJNw.js} +5 -5
  130. package/dist/lib/{shadow-claw-storage-Bv__kXG6.js.map → shadow-claw-storage-CZ2uZJNw.js.map} +1 -1
  131. package/dist/lib/{shadow-claw-task-server-DNOe8PWK.js → shadow-claw-task-server-CLT018BX.js} +2 -2
  132. package/dist/lib/{shadow-claw-task-server-DNOe8PWK.js.map → shadow-claw-task-server-CLT018BX.js.map} +1 -1
  133. package/dist/lib/{shadow-claw-tasks-qmcDT4PU.js → shadow-claw-tasks-D5h-lGmq.js} +9 -8
  134. package/dist/lib/shadow-claw-tasks-D5h-lGmq.js.map +1 -0
  135. package/dist/lib/{shadow-claw-terminal-0QUWP8of.js → shadow-claw-terminal-Cy1O6KVM.js} +2 -2
  136. package/dist/lib/{shadow-claw-terminal-0QUWP8of.js.map → shadow-claw-terminal-Cy1O6KVM.js.map} +1 -1
  137. package/dist/lib/{shadow-claw-tools-Bs_bmI6-.js → shadow-claw-tools-CVD06bCR.js} +9 -9
  138. package/dist/lib/{shadow-claw-tools-Bs_bmI6-.js.map → shadow-claw-tools-CVD06bCR.js.map} +1 -1
  139. package/dist/lib/{shadow-claw-webvm-DYaoL7QY.js → shadow-claw-webvm-DoGl5ZSJ.js} +3 -3
  140. package/dist/lib/{shadow-claw-webvm-DYaoL7QY.js.map → shadow-claw-webvm-DoGl5ZSJ.js.map} +1 -1
  141. package/dist/lib/subsystems/channels/peerjs.d.ts +37 -4
  142. package/dist/lib/subsystems/channels/room.d.ts +4 -0
  143. package/dist/lib/{syncWebMcpRegistration-BhbqI6R2.js → syncWebMcpRegistration-BeYkQEvj.js} +5 -5
  144. package/dist/lib/{syncWebMcpRegistration-BhbqI6R2.js.map → syncWebMcpRegistration-BeYkQEvj.js.map} +1 -1
  145. package/dist/lib/tools-C3Kft940.js +1 -0
  146. package/dist/lib/{tools-DBaMRiEu.js → tools-DKzPWc0q.js} +2 -2
  147. package/dist/lib/{tools-DBaMRiEu.js.map → tools-DKzPWc0q.js.map} +1 -1
  148. package/dist/lib/{tools-DwwB9RBa.js → tools-DqcJe8LS.js} +5 -5
  149. package/dist/lib/{tools-DwwB9RBa.js.map → tools-DqcJe8LS.js.map} +1 -1
  150. package/dist/lib/{trusted-types-Dx0RZlrd.js → trusted-types-Oz7xXJAY.js} +4 -4
  151. package/dist/lib/{trusted-types-Dx0RZlrd.js.map → trusted-types-Oz7xXJAY.js.map} +1 -1
  152. package/dist/lib/utils/index.js +1 -1
  153. package/dist/lib/utils/namespacedStorage.js +1 -1
  154. package/dist/lib/utils/utils.js +1 -1
  155. package/dist/lib/{webmcp-j_1_T3wf.js → webmcp-BC8_WafM.js} +4 -4
  156. package/dist/lib/{webmcp-j_1_T3wf.js.map → webmcp-BC8_WafM.js.map} +1 -1
  157. package/dist/lib/worker/utils/system-prompt.d.ts +4 -1
  158. package/dist/public/.agents/skills/main/skill-creator/SKILL.md +3 -2
  159. package/dist/public/.agents/skills/main/skill-creator/references/frontmatter-spec.md +5 -3
  160. package/dist/public/.well-known/agent-skills/index.json +1 -1
  161. package/dist/public/.well-known/mcp/server-card.json +1 -1
  162. package/dist/public/.well-known/mcp.json +1 -1
  163. package/dist/public/agent.worker.js +18 -17
  164. package/dist/public/app-routes-BMQ4HFaM.js +1 -0
  165. package/dist/public/{bundler-Ca-Xwln8.js → bundler-0if-QelV.js} +4 -4
  166. package/dist/public/{config-CrHchneq.js → config-Bnwx4EfS.js} +1 -1
  167. package/dist/public/{configurePeerJs-B470pdeU.js → configurePeerJs-DkyGvwk_.js} +1 -1
  168. package/dist/public/{connections-DvbgdkaB.js → connections-6575KDGE.js} +1 -1
  169. package/dist/public/{custom-element-security-FU04Cq05.js → custom-element-security-BQJQ_oKz.js} +1 -1
  170. package/dist/public/docs/example/article/index.html +2 -2
  171. package/dist/public/docs/publishing/index.html +2 -2
  172. package/dist/public/docs/skill-creator/index.html +2 -2
  173. package/dist/public/docs/subsystems/skills.md +3 -1
  174. package/dist/public/{downloadGroupFile-D8KRJGGL.js → downloadGroupFile-Wo1Sxdhr.js} +1 -1
  175. package/dist/public/{e2e-bridge-CSW0S5Yz.js → e2e-bridge-CvLCUU2O.js} +1 -1
  176. package/dist/public/{file-viewer-Cs-riNvy.js → file-viewer-CIjqAvNF.js} +1 -1
  177. package/dist/public/{getGroupDir-P1h9wl6S.js → getGroupDir-BwprrdrQ.js} +1 -1
  178. package/dist/public/{git-7Vq_SJSp.js → git-BSnY2D-A.js} +2 -2
  179. package/dist/public/{iframe-sanitizer-y2Z1pPwY.js → iframe-sanitizer-viROQkRn.js} +1 -1
  180. package/dist/public/index.html +2 -2
  181. package/dist/public/index.js +1 -1
  182. package/dist/public/{initChatSplitResize-CzV2E7Ul.js → initChatSplitResize-BA18wLQQ.js} +1 -1
  183. package/dist/public/{initControlPlane-BqCY0NQy.js → initControlPlane-L96uJkRA.js} +1 -1
  184. package/dist/public/main/index.html +2 -2
  185. package/dist/public/main/memory/index.html +2 -2
  186. package/dist/public/{markdown-Cw7vCtTg.js → markdown-DGjZAm_w.js} +17 -14
  187. package/dist/public/{mcp-reconnect-9emsqGRe.js → mcp-reconnect-CBHuaYdF.js} +1 -1
  188. package/dist/public/{memoryStorage-C0KvLNUp.js → memoryStorage-C1llaYus.js} +1 -1
  189. package/dist/public/orchestrator-C0VOoTiK.js +15 -0
  190. package/dist/public/{orchestrator-DpkkeD6T.js → orchestrator-DMWi--Dc.js} +20 -19
  191. package/dist/public/peerjs-Bf6ZxfbA.js +1 -0
  192. package/dist/public/{push-client-CHjSbrWs.js → push-client-BD4YalBa.js} +1 -1
  193. package/dist/public/service-worker.js +1 -1
  194. package/dist/public/{shadow-claw-BBPV_9X8.js → shadow-claw-DRy-D4Qi.js} +2 -2
  195. package/dist/public/{shadow-claw-accounts-xUOLBsQZ.js → shadow-claw-accounts-DnfmA8cb.js} +1 -1
  196. package/dist/public/{shadow-claw-channels-BJvrKQjg.js → shadow-claw-channels-8UkycZAa.js} +1 -1
  197. package/dist/public/{shadow-claw-chat-BG2EaRaw.js → shadow-claw-chat-Cf5LUiul.js} +9 -9
  198. package/dist/public/{shadow-claw-control-plane-BBa7WbTg.js → shadow-claw-control-plane-UsBF-Nvd.js} +2 -2
  199. package/dist/public/{shadow-claw-conversations-CFaWFmkm.js → shadow-claw-conversations-Aoe61Y21.js} +1 -1
  200. package/dist/public/{shadow-claw-file-viewer-Z-GIKaE9.js → shadow-claw-file-viewer-D28dSSEn.js} +6 -6
  201. package/dist/public/{shadow-claw-files-BBx4iMsk.js → shadow-claw-files-CaDUlPEU.js} +1 -1
  202. package/dist/public/{shadow-claw-git-vTOKatwd.js → shadow-claw-git-DYNcZMWA.js} +2 -2
  203. package/dist/public/{shadow-claw-integrations-BBVnO0Fc.js → shadow-claw-integrations-BJf_hQVv.js} +1 -1
  204. package/dist/public/{shadow-claw-llm-Ce1Ax6-x.js → shadow-claw-llm-BqK2SIRf.js} +2 -2
  205. package/dist/public/{shadow-claw-mcp-remote-Bkx0gsmF.js → shadow-claw-mcp-remote-B_dDG990.js} +1 -1
  206. package/dist/public/{shadow-claw-networking-q4XIzdB5.js → shadow-claw-networking-D8LxOofv.js} +1 -1
  207. package/dist/public/{shadow-claw-notifications-D2cz0gmm.js → shadow-claw-notifications-DpVyiNG_.js} +1 -1
  208. package/dist/public/{shadow-claw-page-header-BccSHItx.js → shadow-claw-page-header-DdC7bJuW.js} +1 -1
  209. package/dist/public/{shadow-claw-pages-3335lmSC.js → shadow-claw-pages-CYMl4J-6.js} +3 -3
  210. package/dist/public/{shadow-claw-settings-4ptYuJwO.js → shadow-claw-settings-Da_8Oy3O.js} +3 -3
  211. package/dist/public/{shadow-claw-storage-bIrPKFhF.js → shadow-claw-storage-DXIm86_-.js} +1 -1
  212. package/dist/public/{shadow-claw-task-server-5yqVBxy1.js → shadow-claw-task-server-BCceBD0G.js} +1 -1
  213. package/dist/public/{shadow-claw-tasks-DcqYHPLZ.js → shadow-claw-tasks-BW1QZ5L3.js} +19 -19
  214. package/dist/public/{shadow-claw-terminal-fARaDONr.js → shadow-claw-terminal-vqfsxhcK.js} +1 -1
  215. package/dist/public/{shadow-claw-tools-paEAhcJr.js → shadow-claw-tools-l0Jsa7UJ.js} +1 -1
  216. package/dist/public/{shadow-claw-webvm-CbzH_vyX.js → shadow-claw-webvm-CDPOWZm7.js} +1 -1
  217. package/dist/public/skills/main/skill-creator/SKILL.md +3 -2
  218. package/dist/public/skills/main/skill-creator/references/frontmatter-spec.md +5 -3
  219. package/dist/public/static-main-manifest.json +2 -2
  220. package/dist/public/{syncWebMcpRegistration-CWSYaHex.js → syncWebMcpRegistration-5b5FkP9_.js} +1 -1
  221. package/dist/public/tools-B-PzsLc2.js +1 -0
  222. package/dist/public/{tools-C8x3nmo4.js → tools-CcgG5XuA.js} +1 -1
  223. package/dist/public/{tools-DvckJZG2.js → tools-VSOY66vs.js} +1 -1
  224. package/dist/public/{webmcp-DAjmliCx.js → webmcp-DBONjQWd.js} +1 -1
  225. package/dist/server.js +2 -2
  226. package/package.json +2 -2
  227. package/src/__mocks__/marked.cjs +14 -0
  228. package/src/components/shadow-claw-chat/shadow-claw-chat.test.ts +17 -0
  229. package/src/components/shadow-claw-chat/shadow-claw-chat.ts +5 -1
  230. package/src/components/shadow-claw-file-viewer/shadow-claw-file-viewer.test.ts +78 -0
  231. package/src/components/shadow-claw-file-viewer/shadow-claw-file-viewer.ts +6 -2
  232. package/src/components/shadow-claw-pages/utils/resolveWorkspaceLinkPath.test.ts +56 -0
  233. package/src/components/shadow-claw-tasks/shadow-claw-tasks.test.ts +22 -0
  234. package/src/components/shadow-claw-tasks/shadow-claw-tasks.ts +5 -1
  235. package/src/content/markdown-links.test.ts +109 -0
  236. package/src/content/markdown-links.ts +187 -0
  237. package/src/content/markdown.test.ts +33 -0
  238. package/src/content/markdown.ts +6 -1
  239. package/src/core/app-routes.test.ts +65 -0
  240. package/src/core/app-routes.ts +1 -1
  241. package/src/core/orchestrator/orchestrator.ts +3 -0
  242. package/src/core/orchestrator/utils/compactContext.ts +2 -0
  243. package/src/core/orchestrator/utils/invokeAgent.ts +1 -0
  244. package/src/subsystems/accounts/service-accounts.test.ts +0 -1
  245. package/src/subsystems/channels/peerjs.test.ts +479 -1
  246. package/src/subsystems/channels/peerjs.ts +420 -75
  247. package/src/subsystems/channels/room.test.ts +35 -0
  248. package/src/subsystems/channels/room.ts +15 -0
  249. package/src/subsystems/skills/activateSkill.test.ts +38 -5
  250. package/src/subsystems/skills/activateSkill.ts +25 -3
  251. package/src/subsystems/skills/parseSkill.test.ts +71 -0
  252. package/src/subsystems/skills/parseSkill.ts +185 -25
  253. package/src/subsystems/tools/files.ts +4 -4
  254. package/src/worker/tools/spawn-subagent/spawn-subagent.test.ts +22 -23
  255. package/src/worker/tools/workspace/send-file.test.ts +24 -1
  256. package/src/worker/tools/workspace/send-file.ts +6 -3
  257. package/src/worker/utils/handleCompact.test.ts +3 -4
  258. package/src/worker/utils/handleInvoke.test.ts +13 -11
  259. package/src/worker/utils/handleInvoke.ts +3 -0
  260. package/src/worker/utils/handleMessage.test.ts +0 -1
  261. package/src/worker/utils/post.test.ts +3 -4
  262. package/src/worker/utils/sandboxedEval.test.ts +1 -2
  263. package/src/worker/utils/system-prompt.test.ts +59 -0
  264. package/src/worker/utils/system-prompt.ts +21 -1
  265. package/src/worker/utils/withRetry.test.ts +3 -16
  266. package/dist/lib/app-routes-CqBOeA5q.js.map +0 -1
  267. package/dist/lib/markdown-DgdSt2GD.js.map +0 -1
  268. package/dist/lib/orchestrator-CjEau_RG.js.map +0 -1
  269. package/dist/lib/peerjs-BdfpltIe.js.map +0 -1
  270. package/dist/lib/shadow-claw-chat-mXPQZbwT.js.map +0 -1
  271. package/dist/lib/shadow-claw-file-viewer-BSbZvSl-.js.map +0 -1
  272. package/dist/lib/shadow-claw-tasks-qmcDT4PU.js.map +0 -1
  273. package/dist/lib/tools-D4Pp-nUw.js +0 -1
  274. package/dist/public/app-routes-Bs-riIvr.js +0 -1
  275. package/dist/public/orchestrator-BWkHHO9Y.js +0 -15
  276. package/dist/public/peerjs-tf2EmWjB.js +0 -1
  277. package/dist/public/tools-COduyYJ0.js +0 -1
@@ -1,9 +1,9 @@
1
1
  import { n as __exportAll } from "./rolldown-runtime-DZ8SGSJo.js";
2
2
  import { t as txPromise } from "./txPromise-CuGh-TGK.js";
3
- import { r as CONFIG_KEYS, x as OPFS_ROOT } from "./config--CFrw3J3.js";
4
- import { i as getDeploymentNamespace } from "./app-routes-CqBOeA5q.js";
3
+ import { r as CONFIG_KEYS, x as OPFS_ROOT } from "./config-DjZ9QWc4.js";
4
+ import { a as getDeploymentNamespace } from "./app-routes-BAEMLu9g.js";
5
5
  import { t as getConfig } from "./getConfig-BxxXMyuM.js";
6
- import { t as getMemoryOpfsRoot } from "./memoryStorage-UR8E8K-H.js";
6
+ import { t as getMemoryOpfsRoot } from "./memoryStorage-D3FBwO9T.js";
7
7
 
8
8
  //#region src/storage/getNestedDir.ts
9
9
  /**
@@ -169,4 +169,4 @@ async function getGroupDir(db, groupId) {
169
169
 
170
170
  //#endregion
171
171
  export { getStorageStatus as a, resetStorageDirectory as c, getStorageRoot as i, setStorageRoot as l, getGroupDir_exports as n, invalidateStorageRoot as o, getOpfsRootDirName as r, isStaleHandleError as s, getGroupDir as t };
172
- //# sourceMappingURL=getGroupDir-m0f-ekgX.js.map
172
+ //# sourceMappingURL=getGroupDir-QrN2aTo8.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"getGroupDir-m0f-ekgX.js","names":[],"sources":["../../src/storage/getNestedDir.ts","../../src/db/deleteConfig.ts","../../src/storage/storage.ts","../../src/storage/getGroupDir.ts"],"sourcesContent":["/**\n * Get a handle to a nested directory, creating intermediate dirs.\n */\nexport async function getNestedDir(\n root: FileSystemDirectoryHandle,\n ...segments: string[]\n): Promise<FileSystemDirectoryHandle> {\n let current = root;\n\n for (const seg of segments) {\n const child = await current.getDirectoryHandle(seg, { create: true });\n\n // Guard against stale handles (e.g. Electron after app restart) where\n // getDirectoryHandle returns the same directory instead of navigating.\n if (\n typeof current.isSameEntry === \"function\" &&\n (await current.isSameEntry(child))\n ) {\n throw new Error(\n `Directory navigation failed: \"${seg}\" resolved to the same directory as its parent. ` +\n \"The stored directory handle may be stale — try re-selecting the storage folder.\",\n );\n }\n\n current = child;\n }\n\n return current;\n}\n","import { txPromise } from \"./txPromise.js\";\nimport type { ShadowClawDatabase } from \"./types.js\";\n\n/**\n * Delete a config value\n */\nexport function deleteConfig(\n db: ShadowClawDatabase,\n key: string,\n): Promise<void> {\n return txPromise(db, \"config\", \"readwrite\", (store) =>\n store.delete(key),\n ).then(() => undefined);\n}\n","import { CONFIG_KEYS, OPFS_ROOT } from \"../config/config.js\";\nimport { getDeploymentNamespace } from \"../core/app-routes.js\";\nimport { deleteConfig } from \"../db/deleteConfig.js\";\nimport { getConfig } from \"../db/getConfig.js\";\nimport { getMemoryOpfsRoot } from \"./memoryStorage.js\";\nimport type { ShadowClawDatabase } from \"../db/types.js\";\n\nexport interface StorageStatus {\n type: \"opfs\" | \"local\";\n permission: \"granted\" | \"denied\" | \"prompt\";\n name: string | null;\n}\n\nlet explicitRoot: FileSystemDirectoryHandle | null = null;\n\n/**\n * Verify whether a directory handle is actually functional by attempting\n * to iterate its entries.\n */\nasync function probeHandleAccess(\n handle: FileSystemDirectoryHandle,\n reportedPermission: \"granted\" | \"denied\" | \"prompt\",\n): Promise<\"granted\" | \"denied\" | \"prompt\"> {\n try {\n const iter = (handle as any).entries();\n await iter.next();\n\n // I/O succeeded — the handle is functional regardless of what\n // queryPermission reported.\n\n return \"granted\";\n } catch {\n return reportedPermission;\n }\n}\n\n/**\n * Get the OPFS root directory name taking into account deployment namespace.\n */\nexport function getOpfsRootDirName(): string {\n const ns = getDeploymentNamespace();\n\n return ns ? `${OPFS_ROOT}-${ns}` : OPFS_ROOT;\n}\n\nasync function getOpfsRoot(): Promise<FileSystemDirectoryHandle> {\n try {\n if (\n typeof navigator !== \"undefined\" &&\n navigator.storage &&\n typeof navigator.storage.getDirectory === \"function\"\n ) {\n const opfsRoot = await navigator.storage.getDirectory();\n const opfsRootName = getOpfsRootDirName();\n\n return await opfsRoot.getDirectoryHandle(opfsRootName, {\n create: true,\n });\n }\n } catch (err) {\n console.warn(\n \"OPFS is unavailable (e.g. Firefox Private Browsing). Using in-memory storage fallback:\",\n err,\n );\n }\n\n return getMemoryOpfsRoot();\n}\n\n/**\n * Determine whether a value behaves like a FileSystemDirectoryHandle.\n */\nfunction isDirectoryHandle(handle: any): handle is FileSystemDirectoryHandle {\n if (!handle || typeof handle !== \"object\") {\n return false;\n }\n\n const ctor = globalThis.FileSystemDirectoryHandle;\n if (typeof ctor !== \"undefined\" && handle instanceof ctor) {\n return true;\n }\n\n return (\n typeof handle.getDirectoryHandle === \"function\" &&\n typeof handle.getFileHandle === \"function\"\n );\n}\n\n/**\n * Get the current storage root handle.\n */\nexport async function getStorageRoot(\n db: ShadowClawDatabase,\n): Promise<FileSystemDirectoryHandle> {\n if (explicitRoot) {\n return explicitRoot;\n }\n\n try {\n const storedHandle = await getConfig(db, CONFIG_KEYS.STORAGE_HANDLE);\n if (isDirectoryHandle(storedHandle)) {\n const handle = storedHandle as any;\n // Check if we still have permission (main thread only)\n if (typeof handle.queryPermission === \"function\") {\n const status = await handle.queryPermission({\n mode: \"readwrite\",\n });\n\n // Electron (and some other embedders) report \"prompt\" even when the\n // handle is functional. Try to silently re-activate the permission\n // so downstream code doesn't hit stale-handle errors.\n if (\n status !== \"granted\" &&\n typeof handle.requestPermission === \"function\"\n ) {\n try {\n await handle.requestPermission({ mode: \"readwrite\" });\n } catch {\n // requestPermission may throw in some contexts — that's OK\n }\n }\n }\n\n // If we have a handle but no permission, we still return it so tools\n // fail with a clear \"permission denied\" error instead of silently\n // falling back to OPFS and causing \"split brain\".\n\n return handle;\n }\n } catch (err) {\n console.warn(\"Failed to retrieve local storage handle from DB:\", err);\n }\n\n // Fallback to OPFS root only if NO local handle is configured\n\n return getOpfsRoot();\n}\n\n/**\n * Set an explicit storage root handle (used to sync handle to workers).\n */\nexport function setStorageRoot(handle: FileSystemDirectoryHandle): void {\n explicitRoot = handle;\n}\n\n/**\n * Clear the cached storage root so the next call to getStorageRoot()\n * re-acquires a fresh handle. Call this when an InvalidStateError\n * indicates the cached handle has gone stale.\n */\nexport function invalidateStorageRoot() {\n explicitRoot = null;\n}\n\n/**\n * Detect a stale-handle DOMException (\"InvalidStateError\") thrown by\n * the File System Access API when the underlying entry has changed\n * since the handle was obtained.\n */\nexport function isStaleHandleError(err: unknown): boolean {\n if (!(err instanceof DOMException)) {\n return false;\n }\n\n return err.name === \"InvalidStateError\";\n}\n\n/**\n * Reset storage to use browser-internal OPFS.\n */\nexport async function resetStorageDirectory(\n db: ShadowClawDatabase,\n): Promise<void> {\n await deleteConfig(db, CONFIG_KEYS.STORAGE_HANDLE);\n\n explicitRoot = null;\n}\n\n/**\n * Get the current storage status.\n */\nexport async function getStorageStatus(\n db: ShadowClawDatabase,\n): Promise<StorageStatus> {\n if (explicitRoot) {\n try {\n const permission = await (explicitRoot as any).queryPermission({\n mode: \"readwrite\",\n });\n\n // Electron may report \"prompt\" even when the handle works.\n // Test actual functionality before reporting the permission level.\n const effectivePermission =\n permission === \"granted\"\n ? \"granted\"\n : await probeHandleAccess(explicitRoot, permission);\n\n return {\n type: \"local\",\n permission: effectivePermission,\n name: explicitRoot.name,\n };\n } catch {\n // If queryPermission fails, explicitRoot might be stale\n console.warn(\"Getting storage status failed for explicit storage root.\");\n }\n }\n\n try {\n const storedHandle = await getConfig(db, CONFIG_KEYS.STORAGE_HANDLE);\n\n if (isDirectoryHandle(storedHandle)) {\n const handle = storedHandle as any;\n const permission = await handle.queryPermission({\n mode: \"readwrite\",\n });\n\n const effectivePermission =\n permission === \"granted\"\n ? \"granted\"\n : await probeHandleAccess(handle, permission);\n\n return {\n type: \"local\",\n permission: effectivePermission,\n name: handle.name,\n };\n }\n } catch (err) {\n console.warn(\"Failed to check storage status:\", err);\n }\n\n return { type: \"opfs\", permission: \"granted\", name: \"OPFS\" };\n}\n","import { getNestedDir } from \"./getNestedDir.js\";\nimport { getStorageRoot } from \"./storage.js\";\nimport type { ShadowClawDatabase } from \"../db/types.js\";\n\n/**\n * Get the group workspace directory.\n */\nexport async function getGroupDir(\n db: ShadowClawDatabase,\n groupId: string,\n): Promise<FileSystemDirectoryHandle> {\n const root = await getStorageRoot(db);\n // Sanitize groupId for filesystem: replace colons with dashes\n const safeId = groupId.replace(/:/g, \"-\");\n\n return getNestedDir(root, \"groups\", safeId);\n}\n"],"mappings":"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"}
1
+ {"version":3,"file":"getGroupDir-QrN2aTo8.js","names":[],"sources":["../../src/storage/getNestedDir.ts","../../src/db/deleteConfig.ts","../../src/storage/storage.ts","../../src/storage/getGroupDir.ts"],"sourcesContent":["/**\n * Get a handle to a nested directory, creating intermediate dirs.\n */\nexport async function getNestedDir(\n root: FileSystemDirectoryHandle,\n ...segments: string[]\n): Promise<FileSystemDirectoryHandle> {\n let current = root;\n\n for (const seg of segments) {\n const child = await current.getDirectoryHandle(seg, { create: true });\n\n // Guard against stale handles (e.g. Electron after app restart) where\n // getDirectoryHandle returns the same directory instead of navigating.\n if (\n typeof current.isSameEntry === \"function\" &&\n (await current.isSameEntry(child))\n ) {\n throw new Error(\n `Directory navigation failed: \"${seg}\" resolved to the same directory as its parent. ` +\n \"The stored directory handle may be stale — try re-selecting the storage folder.\",\n );\n }\n\n current = child;\n }\n\n return current;\n}\n","import { txPromise } from \"./txPromise.js\";\nimport type { ShadowClawDatabase } from \"./types.js\";\n\n/**\n * Delete a config value\n */\nexport function deleteConfig(\n db: ShadowClawDatabase,\n key: string,\n): Promise<void> {\n return txPromise(db, \"config\", \"readwrite\", (store) =>\n store.delete(key),\n ).then(() => undefined);\n}\n","import { CONFIG_KEYS, OPFS_ROOT } from \"../config/config.js\";\nimport { getDeploymentNamespace } from \"../core/app-routes.js\";\nimport { deleteConfig } from \"../db/deleteConfig.js\";\nimport { getConfig } from \"../db/getConfig.js\";\nimport { getMemoryOpfsRoot } from \"./memoryStorage.js\";\nimport type { ShadowClawDatabase } from \"../db/types.js\";\n\nexport interface StorageStatus {\n type: \"opfs\" | \"local\";\n permission: \"granted\" | \"denied\" | \"prompt\";\n name: string | null;\n}\n\nlet explicitRoot: FileSystemDirectoryHandle | null = null;\n\n/**\n * Verify whether a directory handle is actually functional by attempting\n * to iterate its entries.\n */\nasync function probeHandleAccess(\n handle: FileSystemDirectoryHandle,\n reportedPermission: \"granted\" | \"denied\" | \"prompt\",\n): Promise<\"granted\" | \"denied\" | \"prompt\"> {\n try {\n const iter = (handle as any).entries();\n await iter.next();\n\n // I/O succeeded — the handle is functional regardless of what\n // queryPermission reported.\n\n return \"granted\";\n } catch {\n return reportedPermission;\n }\n}\n\n/**\n * Get the OPFS root directory name taking into account deployment namespace.\n */\nexport function getOpfsRootDirName(): string {\n const ns = getDeploymentNamespace();\n\n return ns ? `${OPFS_ROOT}-${ns}` : OPFS_ROOT;\n}\n\nasync function getOpfsRoot(): Promise<FileSystemDirectoryHandle> {\n try {\n if (\n typeof navigator !== \"undefined\" &&\n navigator.storage &&\n typeof navigator.storage.getDirectory === \"function\"\n ) {\n const opfsRoot = await navigator.storage.getDirectory();\n const opfsRootName = getOpfsRootDirName();\n\n return await opfsRoot.getDirectoryHandle(opfsRootName, {\n create: true,\n });\n }\n } catch (err) {\n console.warn(\n \"OPFS is unavailable (e.g. Firefox Private Browsing). Using in-memory storage fallback:\",\n err,\n );\n }\n\n return getMemoryOpfsRoot();\n}\n\n/**\n * Determine whether a value behaves like a FileSystemDirectoryHandle.\n */\nfunction isDirectoryHandle(handle: any): handle is FileSystemDirectoryHandle {\n if (!handle || typeof handle !== \"object\") {\n return false;\n }\n\n const ctor = globalThis.FileSystemDirectoryHandle;\n if (typeof ctor !== \"undefined\" && handle instanceof ctor) {\n return true;\n }\n\n return (\n typeof handle.getDirectoryHandle === \"function\" &&\n typeof handle.getFileHandle === \"function\"\n );\n}\n\n/**\n * Get the current storage root handle.\n */\nexport async function getStorageRoot(\n db: ShadowClawDatabase,\n): Promise<FileSystemDirectoryHandle> {\n if (explicitRoot) {\n return explicitRoot;\n }\n\n try {\n const storedHandle = await getConfig(db, CONFIG_KEYS.STORAGE_HANDLE);\n if (isDirectoryHandle(storedHandle)) {\n const handle = storedHandle as any;\n // Check if we still have permission (main thread only)\n if (typeof handle.queryPermission === \"function\") {\n const status = await handle.queryPermission({\n mode: \"readwrite\",\n });\n\n // Electron (and some other embedders) report \"prompt\" even when the\n // handle is functional. Try to silently re-activate the permission\n // so downstream code doesn't hit stale-handle errors.\n if (\n status !== \"granted\" &&\n typeof handle.requestPermission === \"function\"\n ) {\n try {\n await handle.requestPermission({ mode: \"readwrite\" });\n } catch {\n // requestPermission may throw in some contexts — that's OK\n }\n }\n }\n\n // If we have a handle but no permission, we still return it so tools\n // fail with a clear \"permission denied\" error instead of silently\n // falling back to OPFS and causing \"split brain\".\n\n return handle;\n }\n } catch (err) {\n console.warn(\"Failed to retrieve local storage handle from DB:\", err);\n }\n\n // Fallback to OPFS root only if NO local handle is configured\n\n return getOpfsRoot();\n}\n\n/**\n * Set an explicit storage root handle (used to sync handle to workers).\n */\nexport function setStorageRoot(handle: FileSystemDirectoryHandle): void {\n explicitRoot = handle;\n}\n\n/**\n * Clear the cached storage root so the next call to getStorageRoot()\n * re-acquires a fresh handle. Call this when an InvalidStateError\n * indicates the cached handle has gone stale.\n */\nexport function invalidateStorageRoot() {\n explicitRoot = null;\n}\n\n/**\n * Detect a stale-handle DOMException (\"InvalidStateError\") thrown by\n * the File System Access API when the underlying entry has changed\n * since the handle was obtained.\n */\nexport function isStaleHandleError(err: unknown): boolean {\n if (!(err instanceof DOMException)) {\n return false;\n }\n\n return err.name === \"InvalidStateError\";\n}\n\n/**\n * Reset storage to use browser-internal OPFS.\n */\nexport async function resetStorageDirectory(\n db: ShadowClawDatabase,\n): Promise<void> {\n await deleteConfig(db, CONFIG_KEYS.STORAGE_HANDLE);\n\n explicitRoot = null;\n}\n\n/**\n * Get the current storage status.\n */\nexport async function getStorageStatus(\n db: ShadowClawDatabase,\n): Promise<StorageStatus> {\n if (explicitRoot) {\n try {\n const permission = await (explicitRoot as any).queryPermission({\n mode: \"readwrite\",\n });\n\n // Electron may report \"prompt\" even when the handle works.\n // Test actual functionality before reporting the permission level.\n const effectivePermission =\n permission === \"granted\"\n ? \"granted\"\n : await probeHandleAccess(explicitRoot, permission);\n\n return {\n type: \"local\",\n permission: effectivePermission,\n name: explicitRoot.name,\n };\n } catch {\n // If queryPermission fails, explicitRoot might be stale\n console.warn(\"Getting storage status failed for explicit storage root.\");\n }\n }\n\n try {\n const storedHandle = await getConfig(db, CONFIG_KEYS.STORAGE_HANDLE);\n\n if (isDirectoryHandle(storedHandle)) {\n const handle = storedHandle as any;\n const permission = await handle.queryPermission({\n mode: \"readwrite\",\n });\n\n const effectivePermission =\n permission === \"granted\"\n ? \"granted\"\n : await probeHandleAccess(handle, permission);\n\n return {\n type: \"local\",\n permission: effectivePermission,\n name: handle.name,\n };\n }\n } catch (err) {\n console.warn(\"Failed to check storage status:\", err);\n }\n\n return { type: \"opfs\", permission: \"granted\", name: \"OPFS\" };\n}\n","import { getNestedDir } from \"./getNestedDir.js\";\nimport { getStorageRoot } from \"./storage.js\";\nimport type { ShadowClawDatabase } from \"../db/types.js\";\n\n/**\n * Get the group workspace directory.\n */\nexport async function getGroupDir(\n db: ShadowClawDatabase,\n groupId: string,\n): Promise<FileSystemDirectoryHandle> {\n const root = await getStorageRoot(db);\n // Sanitize groupId for filesystem: replace colons with dashes\n const safeId = groupId.replace(/:/g, \"-\");\n\n return getNestedDir(root, \"groups\", safeId);\n}\n"],"mappings":"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"}
@@ -1,5 +1,5 @@
1
1
  import { i as __toESM, r as __require, t as __commonJSMin } from "./rolldown-runtime-DZ8SGSJo.js";
2
- import { a as DEFAULT_DEV_PORT, i as DEFAULT_DEV_HOST } from "./config--CFrw3J3.js";
2
+ import { a as DEFAULT_DEV_PORT, i as DEFAULT_DEV_HOST } from "./config-DjZ9QWc4.js";
3
3
  import { t as require_browser$11 } from "./browser-FvTfy_Ym.js";
4
4
  import { t as require_buffer$1 } from "./buffer-BEXn271X.js";
5
5
  import { C as require_safe_buffer$4, E as require_events, S as require_string_decoder$2, T as require_inherits_browser, _ as require_type, a as require_common$2, f as require_call_bound, i as require_messages, n as require_inflate$1, o as require_zstream, r as require_deflate$1, s as require_is_typed_array, t as require_constants$1, w as require_browser$12, x as require_stream_browserify } from "./constants-CS4AQDNE.js";
@@ -37703,7 +37703,7 @@ async function initGitFs() {
37703
37703
  opfsRoot = await navigator.storage.getDirectory();
37704
37704
  } catch (err) {
37705
37705
  console.warn("OPFS is unavailable for git root, falling back to memory:", err);
37706
- const { getMemoryOpfsRoot } = await import("./memoryStorage-UR8E8K-H.js").then((n) => n.n);
37706
+ const { getMemoryOpfsRoot } = await import("./memoryStorage-D3FBwO9T.js").then((n) => n.n);
37707
37707
  opfsRoot = getMemoryOpfsRoot();
37708
37708
  }
37709
37709
  _fs = makeDirHandleFs(opfsRoot);
@@ -38619,4 +38619,4 @@ async function gitUnstage({ repo, filepath, groupRoot }) {
38619
38619
 
38620
38620
  //#endregion
38621
38621
  export { buildAuthCallbacks, ensureCoreFilemodeFalse, ensureDir, getProxyUrl, getRemoteUrl, gitAdd, gitBranch, gitCheckout, gitClone, gitCommit, gitConfig, gitCurrentBranch, gitDeleteBranch, gitDeleteRepo, gitDiff, gitFetch, gitInit, gitListBranches, gitListRepos, gitListTags, gitLog, gitMerge, gitPull, gitPush, gitReadFileAtRef, gitRemote, gitReset, gitShow, gitStatus, gitTag, gitUnstage, initGitContext, initGitFs, makeDirHandleFs, makeOpfsFs, repoDir, repoNameFromUrl, rmdirRecursive };
38622
- //# sourceMappingURL=git-C-Q6-IVe.js.map
38622
+ //# sourceMappingURL=git-DhZoe1SE.js.map