shadow-claw 1.34.5 → 1.36.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 (208) hide show
  1. package/.well-known/mcp/server-card.json +1 -1
  2. package/.well-known/mcp.json +1 -1
  3. package/README.md +5 -1
  4. package/dist/cli/build/build.js +1 -1
  5. package/dist/cli/{chunk-B4a6SyOL.js → chunk-6dsqmo6-.js} +3 -3
  6. package/dist/cli/chunk-BCLxzLO92.js +5 -0
  7. package/dist/cli/chunk-BHNCi3ui2.js +1 -0
  8. package/dist/cli/chunk-BMPhLSn8.js +1 -0
  9. package/dist/cli/chunk-BMW6QB5-2.js +27 -0
  10. package/dist/cli/chunk-BQCWtrzh.js +1 -0
  11. package/dist/cli/chunk-BQCWtrzh2.js +1 -0
  12. package/dist/cli/chunk-BT2f5jvi.js +1 -0
  13. package/dist/cli/chunk-BdJUjMuz.js +1 -0
  14. package/dist/cli/{chunk-DoHbMaWn.js → chunk-BwtEsB9s.js} +6 -6
  15. package/dist/cli/chunk-C47WdxKx2.js +1 -0
  16. package/dist/cli/{chunk-BRiGkTIi.js → chunk-CAqvQuGr.js} +1 -1
  17. package/dist/cli/{chunk-DoVxObGa2.js → chunk-CHzhUS1N2.js} +1 -1
  18. package/dist/cli/chunk-CUMlq7Jw2.js +263 -0
  19. package/dist/cli/chunk-CXi9LU9e2.js +110 -0
  20. package/dist/cli/chunk-ChefnX-r.js +110 -0
  21. package/dist/cli/{chunk-zvi71-77.js → chunk-D3JxbzjI2.js} +15 -15
  22. package/dist/cli/chunk-D7VYMl092.js +1 -0
  23. package/dist/cli/chunk-DMRbWmO2.js +1 -0
  24. package/dist/cli/chunk-DNIduiJ82.js +91 -0
  25. package/dist/cli/{chunk-C4UfzPK4.js → chunk-DTbrldk_.js} +1 -1
  26. package/dist/cli/chunk-DZ8YBXax.js +969 -0
  27. package/dist/cli/chunk-DduRvw8B2.js +1 -0
  28. package/dist/cli/chunk-DnYxGjdu2.js +1 -0
  29. package/dist/cli/chunk-Du5qiUIk.js +2 -0
  30. package/dist/cli/chunk-Ea7nXmgb2.js +1 -0
  31. package/dist/cli/{chunk-D9dku_3t.js → chunk-EohNY8vW.js} +1 -1
  32. package/dist/cli/chunk-LIIpZlwP2.js +1 -0
  33. package/dist/cli/chunk-LIJZHJml2.js +1 -0
  34. package/dist/cli/chunk-MHBh2BgF2.js +91 -0
  35. package/dist/cli/{chunk-BQ7lHA7c.js → chunk-SKgLGyTY.js} +1 -1
  36. package/dist/cli/chunk-kcJSXcbq2.js +1 -0
  37. package/dist/cli/chunk-rJtMBaNB.js +2 -0
  38. package/dist/cli/cli.js +12 -11
  39. package/dist/headless-agent.js +191 -187
  40. package/dist/lib/components/index.js +21 -21
  41. package/dist/lib/components/settings/shadow-claw-channel-config.js +1 -1
  42. package/dist/lib/components/settings/shadow-claw-control-plane.js +1 -1
  43. package/dist/lib/components/settings/shadow-claw-git.js +1 -1
  44. package/dist/lib/components/settings/shadow-claw-llm.js +1 -1
  45. package/dist/lib/components/settings/shadow-claw-networking.js +1 -1
  46. package/dist/lib/components/settings/shadow-claw-notifications.js +1 -1
  47. package/dist/lib/components/settings/shadow-claw-peerjs.js +1 -1
  48. package/dist/lib/components/settings/shadow-claw-storage.js +1 -1
  49. package/dist/lib/components/settings/shadow-claw-task-server.js +1 -1
  50. package/dist/lib/components/settings/shadow-claw-webvm.js +1 -1
  51. package/dist/lib/components/shadow-claw-channel-config.js +1 -1
  52. package/dist/lib/components/shadow-claw-channels.js +1 -1
  53. package/dist/lib/components/shadow-claw-chat.js +1 -1
  54. package/dist/lib/components/shadow-claw-control-plane.js +1 -1
  55. package/dist/lib/components/shadow-claw-conversations.js +1 -1
  56. package/dist/lib/components/shadow-claw-file-viewer.js +1 -1
  57. package/dist/lib/components/shadow-claw-files.js +1 -1
  58. package/dist/lib/components/shadow-claw-git.js +1 -1
  59. package/dist/lib/components/shadow-claw-llm.js +1 -1
  60. package/dist/lib/components/shadow-claw-networking.js +1 -1
  61. package/dist/lib/components/shadow-claw-notifications.js +1 -1
  62. package/dist/lib/components/shadow-claw-pages.js +1 -1
  63. package/dist/lib/components/shadow-claw-peerjs.js +1 -1
  64. package/dist/lib/components/shadow-claw-settings.js +1 -1
  65. package/dist/lib/components/shadow-claw-storage.js +1 -1
  66. package/dist/lib/components/shadow-claw-task-server.js +1 -1
  67. package/dist/lib/components/shadow-claw-tasks.js +1 -1
  68. package/dist/lib/components/shadow-claw-terminal.js +1 -1
  69. package/dist/lib/components/shadow-claw-tools.js +1 -1
  70. package/dist/lib/components/shadow-claw-webvm.js +1 -1
  71. package/dist/lib/components/shadow-claw.js +1 -1
  72. package/dist/lib/{configurePeerJs-DSRcNp3v.js → configurePeerJs-CdPzmpyI.js} +2 -2
  73. package/dist/lib/{configurePeerJs-DSRcNp3v.js.map → configurePeerJs-CdPzmpyI.js.map} +1 -1
  74. package/dist/lib/index.js +21 -21
  75. package/dist/lib/{initControlPlane-CWfE_Oan.js → initControlPlane-BLymRW34.js} +7 -7
  76. package/dist/lib/{initControlPlane-CWfE_Oan.js.map → initControlPlane-BLymRW34.js.map} +1 -1
  77. package/dist/lib/{orchestrator-BEUug1TW.js → orchestrator-DZkhJj7f.js} +13 -2
  78. package/dist/lib/{orchestrator-BEUug1TW.js.map → orchestrator-DZkhJj7f.js.map} +1 -1
  79. package/dist/lib/{orchestrator-CGUzfGbE.js → orchestrator-ZsQTRknI.js} +5 -5
  80. package/dist/lib/{orchestrator-CGUzfGbE.js.map → orchestrator-ZsQTRknI.js.map} +1 -1
  81. package/dist/lib/{peerjs-BSD88rT3.js → peerjs-CJYfnR5V.js} +3 -3
  82. package/dist/lib/{peerjs-BSD88rT3.js.map → peerjs-CJYfnR5V.js.map} +1 -1
  83. package/dist/lib/{push-client-CC3qifgc.js → push-client-C9hIPqLZ.js} +2 -2
  84. package/dist/lib/{push-client-CC3qifgc.js.map → push-client-C9hIPqLZ.js.map} +1 -1
  85. package/dist/lib/{shadow-claw-BWS-UVnE.js → shadow-claw-8qL2-QoK.js} +4 -4
  86. package/dist/lib/{shadow-claw-BWS-UVnE.js.map → shadow-claw-8qL2-QoK.js.map} +1 -1
  87. package/dist/lib/{shadow-claw-channel-config-DwMn3nFJ.js → shadow-claw-channel-config-CvnbqGBy.js} +3 -3
  88. package/dist/lib/{shadow-claw-channel-config-DwMn3nFJ.js.map → shadow-claw-channel-config-CvnbqGBy.js.map} +1 -1
  89. package/dist/lib/{shadow-claw-channels-BdE4cUlx.js → shadow-claw-channels-CkCvjWn1.js} +2 -2
  90. package/dist/lib/{shadow-claw-channels-BdE4cUlx.js.map → shadow-claw-channels-CkCvjWn1.js.map} +1 -1
  91. package/dist/lib/{shadow-claw-chat-DqaMoE9C.js → shadow-claw-chat-B1YEHKN3.js} +3 -3
  92. package/dist/lib/{shadow-claw-chat-DqaMoE9C.js.map → shadow-claw-chat-B1YEHKN3.js.map} +1 -1
  93. package/dist/lib/{shadow-claw-control-plane-D3DUDO29.js → shadow-claw-control-plane-jjo789IE.js} +6 -6
  94. package/dist/lib/{shadow-claw-control-plane-D3DUDO29.js.map → shadow-claw-control-plane-jjo789IE.js.map} +1 -1
  95. package/dist/lib/{shadow-claw-conversations-XT-OXogj.js → shadow-claw-conversations-MMT7wYH3.js} +2 -2
  96. package/dist/lib/{shadow-claw-conversations-XT-OXogj.js.map → shadow-claw-conversations-MMT7wYH3.js.map} +1 -1
  97. package/dist/lib/{shadow-claw-file-viewer-DJqxyd97.js → shadow-claw-file-viewer-qSkD1RQK.js} +2 -2
  98. package/dist/lib/{shadow-claw-file-viewer-DJqxyd97.js.map → shadow-claw-file-viewer-qSkD1RQK.js.map} +1 -1
  99. package/dist/lib/{shadow-claw-files-CUEJlA1o.js → shadow-claw-files-Cg8ycQ_N.js} +2 -2
  100. package/dist/lib/{shadow-claw-files-CUEJlA1o.js.map → shadow-claw-files-Cg8ycQ_N.js.map} +1 -1
  101. package/dist/lib/{shadow-claw-git-D_iVcb86.js → shadow-claw-git-gaClz-ZC.js} +3 -3
  102. package/dist/lib/{shadow-claw-git-D_iVcb86.js.map → shadow-claw-git-gaClz-ZC.js.map} +1 -1
  103. package/dist/lib/{shadow-claw-llm-C2msAsyU.js → shadow-claw-llm-DyOz0qzT.js} +2 -2
  104. package/dist/lib/{shadow-claw-llm-C2msAsyU.js.map → shadow-claw-llm-DyOz0qzT.js.map} +1 -1
  105. package/dist/lib/{shadow-claw-networking-D2NvodC-.js → shadow-claw-networking-B2xx0UUR.js} +2 -2
  106. package/dist/lib/{shadow-claw-networking-D2NvodC-.js.map → shadow-claw-networking-B2xx0UUR.js.map} +1 -1
  107. package/dist/lib/{shadow-claw-notifications-BcvVn_vu.js → shadow-claw-notifications-BjKfZy0k.js} +2 -2
  108. package/dist/lib/{shadow-claw-notifications-BcvVn_vu.js.map → shadow-claw-notifications-BjKfZy0k.js.map} +1 -1
  109. package/dist/lib/{shadow-claw-pages-CTMXRhEX.js → shadow-claw-pages-CJ2tsMtL.js} +2 -2
  110. package/dist/lib/{shadow-claw-pages-CTMXRhEX.js.map → shadow-claw-pages-CJ2tsMtL.js.map} +1 -1
  111. package/dist/lib/{shadow-claw-peerjs-C2YvypqM.js → shadow-claw-peerjs-CazCkXQ1.js} +3 -3
  112. package/dist/lib/{shadow-claw-peerjs-C2YvypqM.js.map → shadow-claw-peerjs-CazCkXQ1.js.map} +1 -1
  113. package/dist/lib/{shadow-claw-settings-B0hiDwEt.js → shadow-claw-settings-qro6pO9I.js} +2 -2
  114. package/dist/lib/{shadow-claw-settings-B0hiDwEt.js.map → shadow-claw-settings-qro6pO9I.js.map} +1 -1
  115. package/dist/lib/{shadow-claw-storage-Dt4yg4Q4.js → shadow-claw-storage-ewDdvCGa.js} +2 -2
  116. package/dist/lib/{shadow-claw-storage-Dt4yg4Q4.js.map → shadow-claw-storage-ewDdvCGa.js.map} +1 -1
  117. package/dist/lib/{shadow-claw-task-server-B2gbZaz4.js → shadow-claw-task-server-DpqQcNIs.js} +2 -2
  118. package/dist/lib/{shadow-claw-task-server-B2gbZaz4.js.map → shadow-claw-task-server-DpqQcNIs.js.map} +1 -1
  119. package/dist/lib/{shadow-claw-tasks-Bxq-niuM.js → shadow-claw-tasks-B2fMF4qE.js} +2 -2
  120. package/dist/lib/{shadow-claw-tasks-Bxq-niuM.js.map → shadow-claw-tasks-B2fMF4qE.js.map} +1 -1
  121. package/dist/lib/{shadow-claw-terminal-BfbW3xtg.js → shadow-claw-terminal-B25kQJC3.js} +2 -2
  122. package/dist/lib/{shadow-claw-terminal-BfbW3xtg.js.map → shadow-claw-terminal-B25kQJC3.js.map} +1 -1
  123. package/dist/lib/{shadow-claw-tools-BNSAaK0Y.js → shadow-claw-tools-B0y8JzoA.js} +10 -3
  124. package/dist/lib/{shadow-claw-tools-BNSAaK0Y.js.map → shadow-claw-tools-B0y8JzoA.js.map} +1 -1
  125. package/dist/lib/{shadow-claw-webvm-Dc2KmEXq.js → shadow-claw-webvm-CoCedIza.js} +2 -2
  126. package/dist/lib/{shadow-claw-webvm-Dc2KmEXq.js.map → shadow-claw-webvm-CoCedIza.js.map} +1 -1
  127. package/dist/lib/{syncWebMcpRegistration-BIL83P0Q.js → syncWebMcpRegistration-JKLALq4e.js} +2 -2
  128. package/dist/lib/{syncWebMcpRegistration-BIL83P0Q.js.map → syncWebMcpRegistration-JKLALq4e.js.map} +1 -1
  129. package/dist/lib/worker/utils/sandboxedEval.d.ts +8 -0
  130. package/dist/public/.well-known/mcp/server-card.json +1 -1
  131. package/dist/public/.well-known/mcp.json +1 -1
  132. package/dist/public/AGENTS.md +1 -1
  133. package/dist/public/README.md +5 -1
  134. package/dist/public/agent.worker.js +1 -1
  135. package/dist/public/components/shadow-claw-tools/shadow-claw-tools.html +1 -1
  136. package/dist/public/{configurePeerJs-B925t9C7.js → configurePeerJs-BrHeJGw1.js} +1 -1
  137. package/dist/public/docs/decisions/headless-cli-agent-participant.md +1 -1
  138. package/dist/public/docs/example/article/index.html +1 -1
  139. package/dist/public/docs/publishing/index.html +1 -1
  140. package/dist/public/docs/skill-creator/index.html +1 -1
  141. package/dist/public/docs/subsystems/cli.md +43 -32
  142. package/dist/public/docs/subsystems/skills.md +17 -0
  143. package/dist/public/docs/subsystems/tools.md +1 -1
  144. package/dist/public/e2e/README.md +2 -2
  145. package/dist/public/{e2e-bridge-CE1xleGn.js → e2e-bridge-D_lyH__p.js} +1 -1
  146. package/dist/public/{executeTool-DtTrsZHV.js → executeTool-b6DnRhcv.js} +2 -1
  147. package/dist/public/{file-viewer-LEEStSq-.js → file-viewer-CKrQoxZi.js} +1 -1
  148. package/dist/public/index.html +1 -1
  149. package/dist/public/index.js +1 -1
  150. package/dist/public/{initControlPlane-e2JgxXEb.js → initControlPlane-Dn-XFuxg.js} +1 -1
  151. package/dist/public/llms.txt +2 -0
  152. package/dist/public/main/index.html +1 -1
  153. package/dist/public/main/memory/index.html +1 -1
  154. package/dist/public/{orchestrator-Baif6kmu.js → orchestrator-0BnBtxHO.js} +3 -2
  155. package/dist/public/{orchestrator-TndREZPL.js → orchestrator-C3GKZriH.js} +1 -1
  156. package/dist/public/{peerjs-DE6WF3h2.js → peerjs-CgfLEp2N.js} +1 -1
  157. package/dist/public/{push-client-B_IkTpNm.js → push-client-D6DLiY1s.js} +1 -1
  158. package/dist/public/service-worker.js +1 -1
  159. package/dist/public/{shadow-claw-channels-BCGz36Zl.js → shadow-claw-channels-DSijinZ9.js} +1 -1
  160. package/dist/public/{shadow-claw-chat-H9U9jbqD.js → shadow-claw-chat-BeHlAjnA.js} +1 -1
  161. package/dist/public/{shadow-claw-control-plane-CeKh64s2.js → shadow-claw-control-plane-BfF_AZSg.js} +2 -2
  162. package/dist/public/{shadow-claw-conversations-C26t1HXN.js → shadow-claw-conversations-Bb_2bVLJ.js} +1 -1
  163. package/dist/public/{shadow-claw-DBeXILmk.js → shadow-claw-f71DlRdV.js} +2 -2
  164. package/dist/public/{shadow-claw-file-viewer-DWUoTjkr.js → shadow-claw-file-viewer-B67000Mm.js} +1 -1
  165. package/dist/public/{shadow-claw-files-BQ8DSX-z.js → shadow-claw-files-DeZZYt01.js} +1 -1
  166. package/dist/public/{shadow-claw-git-CIXyISw-.js → shadow-claw-git-Ccy25LuW.js} +2 -2
  167. package/dist/public/{shadow-claw-llm-D_GpOSZE.js → shadow-claw-llm-XjYcTlXT.js} +1 -1
  168. package/dist/public/{shadow-claw-networking-BYp5K3B7.js → shadow-claw-networking-efXQtydQ.js} +1 -1
  169. package/dist/public/{shadow-claw-notifications-ZiXmPweY.js → shadow-claw-notifications-Cq2ZSeJa.js} +1 -1
  170. package/dist/public/{shadow-claw-pages-BHXwf3BD.js → shadow-claw-pages-BVFNSSb1.js} +1 -1
  171. package/dist/public/{shadow-claw-settings-BfvDvt9c.js → shadow-claw-settings-B3sHxPh9.js} +2 -2
  172. package/dist/public/{shadow-claw-storage-Bvn85DII.js → shadow-claw-storage-DNdlzCgC.js} +1 -1
  173. package/dist/public/{shadow-claw-task-server-DZL_d8FC.js → shadow-claw-task-server-BJq0rpju.js} +1 -1
  174. package/dist/public/{shadow-claw-tasks-Cy8jzd8q.js → shadow-claw-tasks-CkF1uMeZ.js} +1 -1
  175. package/dist/public/{shadow-claw-terminal-BgEXr82T.js → shadow-claw-terminal-CnHhcpA-.js} +1 -1
  176. package/dist/public/{shadow-claw-tools-BjnssRSi.js → shadow-claw-tools-iw0fljud.js} +8 -1
  177. package/dist/public/{shadow-claw-webvm-tZ1VDoVA.js → shadow-claw-webvm-Bliu4V__.js} +1 -1
  178. package/dist/public/{syncWebMcpRegistration-CLMvJ4kV.js → syncWebMcpRegistration-D91usEMu.js} +1 -1
  179. package/package.json +1 -1
  180. package/src/cli/build/build.test.ts +11 -0
  181. package/src/cli/build/build.ts +10 -9
  182. package/src/cli/cli.ts +31 -2
  183. package/src/cli/commands/agent.test.ts +421 -0
  184. package/src/cli/commands/agent.ts +270 -20
  185. package/src/cli/commands/skills-index.test.ts +84 -2
  186. package/src/cli/commands/skills-index.ts +20 -2
  187. package/src/components/shadow-claw-tools/shadow-claw-tools.html +7 -0
  188. package/src/worker/headless-agent.ts +14 -0
  189. package/src/worker/headless-types.ts +39 -0
  190. package/src/worker/utils/native-eval-executor.test.ts +36 -0
  191. package/src/worker/utils/native-eval-executor.ts +58 -0
  192. package/src/worker/utils/sandboxedEval.ts +36 -0
  193. package/dist/cli/chunk-1BmpU7jO2.js +0 -1
  194. package/dist/cli/chunk-54Euq8Ji2.js +0 -1
  195. package/dist/cli/chunk-BTitwCgT2.js +0 -88
  196. package/dist/cli/chunk-Bjh76Dai.js +0 -1081
  197. package/dist/cli/chunk-C2HeZQ6K.js +0 -1
  198. package/dist/cli/chunk-Cdq9DIrc.js +0 -1
  199. package/dist/cli/chunk-CxdpafWg.js +0 -1
  200. package/dist/cli/chunk-DBk6e4N-.js +0 -1
  201. package/dist/cli/chunk-DEy72ZNV2.js +0 -88
  202. package/dist/cli/chunk-Da1BZyqf.js +0 -1
  203. package/dist/cli/chunk-FHsJD-Sf2.js +0 -27
  204. package/dist/cli/chunk-JBAAPRpe.js +0 -2
  205. package/dist/cli/chunk-aWgoVB7x2.js +0 -1
  206. package/dist/cli/chunk-hOceZVB92.js +0 -371
  207. package/dist/cli/chunk-pwNc6VtC2.js +0 -1
  208. package/dist/cli/chunk-uOnw3tuc.js +0 -2
@@ -0,0 +1 @@
1
+ import{r as e}from"./chunk-CUMlq7Jw2.js";export{e as orchestratorStore};
@@ -1 +1 @@
1
- import{t as e}from"./chunk-uAI_Zi6n.js";import{existsSync as t}from"node:fs";import n from"node:path";import{pathToFileURL as r}from"node:url";import i from"node:process";const a=e(import.meta.url);let o=null;async function s(){if(o)return o;let e=i.env.NODE_ENV===`test`,s=n.join(a,`dist/headless-agent.js`);if(!e&&t(s))return o=await import(r(s).href),o;try{return o={...await import(`./chunk-DEy72ZNV2.js`)},o}catch{try{return o={...await import(`./chunk-DEy72ZNV2.js`)},o}catch(e){if(t(s))return o={...await import(r(s).href)},o;throw e}}}export{s as t};
1
+ import{t as e}from"./chunk-uAI_Zi6n.js";import{existsSync as t}from"node:fs";import n from"node:path";import{pathToFileURL as r}from"node:url";import i from"node:process";const a=e(import.meta.url);let o=null;async function s(){if(o)return o;let e=i.env.NODE_ENV===`test`,s=n.join(a,`dist/headless-agent.js`);if(!e&&t(s))return o=await import(r(s).href),o;try{return o={...await import(`./chunk-MHBh2BgF2.js`)},o}catch{try{return o={...await import(`./chunk-MHBh2BgF2.js`)},o}catch(e){if(t(s))return o={...await import(r(s).href)},o;throw e}}}export{s as t};
@@ -1,4 +1,4 @@
1
- import{a as e,i as t}from"./chunk-BkKN8FNP.js";import{Buffer as n}from"buffer";import r from"isomorphic-git";globalThis.Buffer||(globalThis.Buffer=n);function i(e){try{let t=typeof location<`u`&&location.origin?location.origin:typeof globalThis<`u`&&globalThis.location?.origin?globalThis.location.origin:`http://127.0.0.1:8888`,n=new URL(e,t).hostname.toLowerCase();if(n===`localhost`||n===`127.0.0.1`||n===`::1`||n===`[::1]`)return`loopback`;if(/^(10\.|172\.(1[6-9]|2\d|3[01])\.|192\.168\.)/.test(n)||!n.includes(`.`)||n.endsWith(`.local`)||n.endsWith(`.lan`)||n.endsWith(`.home`)||n.endsWith(`.internal`))return`private`}catch{}}const a={async request({url:e,method:t=`GET`,headers:n={},body:r}){r&&=await o(r);let a=i(e),c={method:t,headers:n,body:r,credentials:`omit`};a&&(c.targetAddressSpace=a);let l=await fetch(e,c),u=l.body&&typeof l.body.getReader==`function`?s(l.body):[new Uint8Array(await l.arrayBuffer())],d={};for(let[e,t]of l.headers.entries())d[e]=t;return{url:l.url,method:t,statusCode:l.status,statusMessage:l.statusText,body:u,headers:d}}};async function o(e){let t=[];if(e[Symbol.asyncIterator])for await(let n of e)t.push(n);else if(e[Symbol.iterator])for(let n of e)t.push(n);else if(e.next){let n=await e.nexT();for(;!n.done;)t.push(n.value),n=await e.nexT()}else return e;let n=t.reduce((e,t)=>e+t.length,0),r=new Uint8Array(n),i=0;for(let e of t)r.set(e,i),i+=e.length;return r}function s(e){let t=e.getReader();return{next(){return t.read()},return(){return t.releaseLock(),{}},[Symbol.asyncIterator](){return this}}}let c=null,l=null,u=null,d=null,f=null;function p(e){return e.trim().replace(/^[\\/]+/,``).replace(/[\\/]+$/,``).split(/[\\/]+/).filter(e=>e!==`.`&&e!==``).join(`/`)}const m=new class{_map=new Map;_maxSize;constructor(e=2048){this._maxSize=e}clear(){this._map.clear()}get(e){let t=this._map.get(e);return t!==void 0&&(this._map.delete(e),this._map.set(e,t)),t}invalidate(e){let t=e.endsWith(`/`)?e:e+`/`;for(let n of this._map.keys())(n===e||n.startsWith(t))&&this._map.delete(n)}set(e,t){if(this._map.size>=this._maxSize){let e=this._map.keys().next().value;e!==void 0&&this._map.delete(e)}this._map.set(e,t)}};async function h(e,t,n={},r=``){let i=e,a=r;for(let e of t){a=a?`${a}/${e}`:e;let t=m.get(a);t&&!n.create?i=t:(i=await i.getDirectoryHandle(e,{create:n.create??!1}),m.set(a,i))}return i}async function g(e,t,n={}){let r=p(t),i=r.split(`/`).filter(Boolean);if(i.length===0)return e;let a=await h(e,i.slice(0,-1),n),o=i[i.length-1];if(n.forceFile||o.includes(`.`))try{return await a.getFileHandle(o,{create:n.create??!1})}catch{}try{let e=await a.getDirectoryHandle(o,{create:n.create??!1}),t=r;return m.set(t,e),e}catch{return await a.getFileHandle(o,{create:n.create??!1})}}async function _(e,t,n={}){let r=p(t).split(`/`).filter(Boolean);return r.length===0?e:h(e,r,n)}async function v(e,t,n={}){let r=p(t).split(`/`).filter(Boolean);if(r.length===0)throw Error(`Cannot resolve '.' as file`);return(await h(e,r.slice(0,-1),n)).getFileHandle(r[r.length-1],{create:n.create??!1})}async function y(e,t){let n=p(t).split(`/`).filter(Boolean);if(n.length===0)throw Error(`Cannot get parent of root`);let r=n[n.length-1];return[await h(e,n.slice(0,-1)),r]}function b(e){return e.trim().replace(/\\/g,`/`).replace(/^\/+/,``).replace(/^\.\//,``)}function x(e){let t=new Map,n=`repos/.git-modes`;function r(e){return e.replace(/\\/g,`/`.replace(/^\/+/,``))}async function i(){try{let r=await(await(await v(e,n)).getFile()).text(),i=JSON.parse(r);for(let[e,n]of i)t.set(e,n)}catch{}}let a=null;function o(){a===null&&(a=setTimeout(async()=>{a=null;try{let r=await(await v(e,n,{create:!0})).createWritable(),i=JSON.stringify([...t.entries()]);await r.write(new TextEncoder().encode(i)),await r.close()}catch{}},500))}let s=i(),c={async readFile(t,n){let r=await(await(await v(e,t)).getFile()).arrayBuffer(),i=typeof n==`string`?n:n?.encoding;return i===`utf8`||i===`utf-8`?new TextDecoder().decode(r):new Uint8Array(r)},async writeFile(n,i,a){let s=await(await v(e,n,{create:!0})).createWritable();typeof i==`string`&&(i=new TextEncoder().encode(i)),await s.write(i),await s.close();let c=typeof a==`object`&&a?a.mode:void 0,l=r(n);if(c!=null){let e=(c&73)!=0;t.set(l,e?33261:33188),o()}else t.has(l)||t.set(l,33188)},async mkdir(t){await _(e,t,{create:!0})},async rmdir(n){let[i,a]=await y(e,n);await i.removeEntry(a,{recursive:!0});let o=r(n)+`/`;for(let e of t.keys())(e===r(n)||e.startsWith(o))&&t.delete(e);m.invalidate(p(n))},async readdir(t){let n=await _(e,t),r=[];for await(let[e]of n.entries())r.push(e);return r},async stat(n){await s;let i;try{i=await g(e,n)}catch{let e=Error(`ENOENT: no such file or directory, stat '${n}'`);throw e.code=`ENOENT`,e}if(i.kind===`directory`){let e=new Date;return{isDirectory:()=>!0,isFile:()=>!1,isSymbolicLink:()=>!1,size:0,mtimeMs:Date.now(),mode:16877,ino:0,dev:0,nlink:1,uid:0,gid:0,ctime:e,mtime:e}}else{let e=await i.getFile(),a=new Date(e.lastModified),o=r(n),s=t.get(o)??33188;return{isDirectory:()=>!1,isFile:()=>!0,isSymbolicLink:()=>!1,size:e.size,mtimeMs:e.lastModified,mode:s,ino:0,dev:0,nlink:1,uid:0,gid:0,ctime:a,mtime:a}}},async lstat(e){return c.stat(e)},async unlink(n){let[i,a]=await y(e,n);await i.removeEntry(a),t.delete(r(n))},async symlink(e,t){throw Error(`OPFS does not support symlinks`)},async readlink(e){return await c.readFile(e,`utf8`)}};return{promises:c}}const ee=x,S=`repos`;function C(n,r,i){if(n===`custom`&&r)return r;if(n===`public`)return`https://www.cors-anywhere.com`;let a=i||(typeof globalThis<`u`&&globalThis.location?globalThis.location:typeof self<`u`&&self.location?self.location:typeof window<`u`&&window.location?window.location:null),o=a?.protocol||``,s=o===`https:`||o===`https`||typeof a?.origin==`string`&&a.origin.startsWith(`https:`)||typeof a?.href==`string`&&a.href.startsWith(`https://`)?`https:`:`http:`,c=a?.host||``,l=a?.hostname||``,u=l===`localhost`||l===`127.0.0.1`||l===`::1`||l===`[::1]`||l===`0.0.0.0`||c.startsWith(`localhost:`)||c.startsWith(`127.0.0.1:`)||c.startsWith(`[::1]:`),d=a&&(a.protocol===`file:`||l&&(l.endsWith(`.github.io`)||l.endsWith(`.pages.dev`)));return c&&(u||!d)?`${s}//${c}/git-proxy`:`${s}//${t}:${e}/git-proxy`}async function w(){return f||=(async()=>{if(c=r,l=a,!u){let e;try{e=await navigator.storage.getDirectory()}catch(t){console.warn(`OPFS is unavailable for git root, falling back to memory:`,t);let{getMemoryOpfsRoot:n}=await import(`./chunk-Da1BZyqf.js`);e=n()}u=x(e),d=u.promises}})(),await f,{git:c,http:l,fs:u,pfs:d}}async function T(e){let t=await w();if(e){let n=x(e);return{git:t.git,http:t.http,fs:n,pfs:n.promises,repoDirFn:e=>`repos/${e}`}}return{...t,repoDirFn:D}}function E(e){return(e.replace(/\/+$/,``).split(`/`).pop()||`repo`).replace(/\.git$/,``)}function D(e){return`${S}/${e}`}async function O(e,t,n){try{await e.getConfig({fs:t,dir:n,path:`core.filemode`})!==!1&&await e.setConfig({fs:t,dir:n,path:`core.filemode`,value:!1})}catch(e){console.error(`Failed to set core.filemode=false:`,e)}}async function k(e,t){try{await e.mkdir(t)}catch{}}function A({token:e,username:t,password:n}={}){if(!e&&!t)return{};let r;e?r={Authorization:`Basic ${btoa(`${e}:x-oauth-basic`)}`}:t&&(r={Authorization:`Basic ${btoa(`${t}:${n||``}`)}`});let i=()=>e?{username:e,password:`x-oauth-basic`}:t?{username:t,password:n||``}:{cancel:!0},a=()=>({cancel:!0});return{...r?{headers:r}:{},onAuth:i,onAuthFailure:a}}async function j({url:e,branch:t,depth:n=20,corsProxy:r,name:i,token:a,username:o,password:s,groupRoot:c}){let{git:l,http:u,fs:d,pfs:f,repoDirFn:p}=await T(c),m=i||E(e),h=p(m);r||=C(`local`),await k(f,S),await k(f,h);let g=A({token:a,username:o,password:s});try{let i={fs:d,http:u,dir:h,url:e,singleBranch:!0,depth:n,corsProxy:r,...g};t&&(i.ref=t),await l.clone(i)}catch{try{let i={fs:d,http:u,dir:h,url:e,singleBranch:!0,depth:n,corsProxy:r,...g};t&&(i.ref=t),await l.fetch(i)}catch{try{await Q(f,h),await k(f,h);let i={fs:d,http:u,dir:h,url:e,singleBranch:!0,depth:n,corsProxy:r,...g};t&&(i.ref=t),await l.clone(i)}catch(t){throw Error(`Failed to clone/fetch ${e}: ${t instanceof Error?t.message:String(t)}`)}}}return await O(l,d,h),m}async function M({repo:e,ref:t,groupRoot:n}){let{git:r,fs:i,repoDirFn:a}=await T(n),o=a(e);return await r.checkout({fs:i,dir:o,ref:t,force:!0}),`Checked out ${t} in ${e}`}async function N({repo:e,name:t,checkout:n=!1,startPoint:r,groupRoot:i}){let{git:a,fs:o,repoDirFn:s}=await T(i),c=s(e),l={fs:o,dir:c,ref:t};return r&&(l.object=r),await a.branch(l),n?(await a.checkout({fs:o,dir:c,ref:t}),`Created and switched to branch ${t} in ${e}`):`Created branch ${t} in ${e}`}async function P({repo:e,groupRoot:t}){let{git:n,fs:r,repoDirFn:i}=await T(t),a=i(e);await O(n,r,a);let o=await n.statusMatrix({fs:r,dir:a});if(o.length===0)return`Empty repository.`;let s=[];for(let[e,t,n,r]of o){let i=``;if(t===0&&n===2&&r===2)i=`added`;else if(t===0&&n===2&&r===0)i=`new (unstaged)`;else if(t===1&&n===2&&r===2)i=`modified (staged)`;else if(t===1&&n===2&&r===1)i=`modified`;else if(t===1&&n===0&&r===0)i=`deleted`;else if(t===1&&n===1&&r===1)continue;else i=`[${t},${n},${r}]`;s.push(`${i}: ${e}`)}return s.length===0?`On branch ${await n.currentBranch({fs:r,dir:a})||`(detached HEAD)`}\nNothing to commit, working tree clean.`:`On branch ${await n.currentBranch({fs:r,dir:a})||`(detached HEAD)`}\n${s.join(`
1
+ import{a as e,i as t}from"./chunk-BkKN8FNP.js";import{Buffer as n}from"buffer";import r from"isomorphic-git";globalThis.Buffer||(globalThis.Buffer=n);function i(e){try{let t=typeof location<`u`&&location.origin?location.origin:typeof globalThis<`u`&&globalThis.location?.origin?globalThis.location.origin:`http://127.0.0.1:8888`,n=new URL(e,t).hostname.toLowerCase();if(n===`localhost`||n===`127.0.0.1`||n===`::1`||n===`[::1]`)return`loopback`;if(/^(10\.|172\.(1[6-9]|2\d|3[01])\.|192\.168\.)/.test(n)||!n.includes(`.`)||n.endsWith(`.local`)||n.endsWith(`.lan`)||n.endsWith(`.home`)||n.endsWith(`.internal`))return`private`}catch{}}const a={async request({url:e,method:t=`GET`,headers:n={},body:r}){r&&=await o(r);let a=i(e),c={method:t,headers:n,body:r,credentials:`omit`};a&&(c.targetAddressSpace=a);let l=await fetch(e,c),u=l.body&&typeof l.body.getReader==`function`?s(l.body):[new Uint8Array(await l.arrayBuffer())],d={};for(let[e,t]of l.headers.entries())d[e]=t;return{url:l.url,method:t,statusCode:l.status,statusMessage:l.statusText,body:u,headers:d}}};async function o(e){let t=[];if(e[Symbol.asyncIterator])for await(let n of e)t.push(n);else if(e[Symbol.iterator])for(let n of e)t.push(n);else if(e.next){let n=await e.nexT();for(;!n.done;)t.push(n.value),n=await e.nexT()}else return e;let n=t.reduce((e,t)=>e+t.length,0),r=new Uint8Array(n),i=0;for(let e of t)r.set(e,i),i+=e.length;return r}function s(e){let t=e.getReader();return{next(){return t.read()},return(){return t.releaseLock(),{}},[Symbol.asyncIterator](){return this}}}let c=null,l=null,u=null,d=null,f=null;function p(e){return e.trim().replace(/^[\\/]+/,``).replace(/[\\/]+$/,``).split(/[\\/]+/).filter(e=>e!==`.`&&e!==``).join(`/`)}const m=new class{_map=new Map;_maxSize;constructor(e=2048){this._maxSize=e}clear(){this._map.clear()}get(e){let t=this._map.get(e);return t!==void 0&&(this._map.delete(e),this._map.set(e,t)),t}invalidate(e){let t=e.endsWith(`/`)?e:e+`/`;for(let n of this._map.keys())(n===e||n.startsWith(t))&&this._map.delete(n)}set(e,t){if(this._map.size>=this._maxSize){let e=this._map.keys().next().value;e!==void 0&&this._map.delete(e)}this._map.set(e,t)}};async function h(e,t,n={},r=``){let i=e,a=r;for(let e of t){a=a?`${a}/${e}`:e;let t=m.get(a);t&&!n.create?i=t:(i=await i.getDirectoryHandle(e,{create:n.create??!1}),m.set(a,i))}return i}async function g(e,t,n={}){let r=p(t),i=r.split(`/`).filter(Boolean);if(i.length===0)return e;let a=await h(e,i.slice(0,-1),n),o=i[i.length-1];if(n.forceFile||o.includes(`.`))try{return await a.getFileHandle(o,{create:n.create??!1})}catch{}try{let e=await a.getDirectoryHandle(o,{create:n.create??!1}),t=r;return m.set(t,e),e}catch{return await a.getFileHandle(o,{create:n.create??!1})}}async function _(e,t,n={}){let r=p(t).split(`/`).filter(Boolean);return r.length===0?e:h(e,r,n)}async function v(e,t,n={}){let r=p(t).split(`/`).filter(Boolean);if(r.length===0)throw Error(`Cannot resolve '.' as file`);return(await h(e,r.slice(0,-1),n)).getFileHandle(r[r.length-1],{create:n.create??!1})}async function y(e,t){let n=p(t).split(`/`).filter(Boolean);if(n.length===0)throw Error(`Cannot get parent of root`);let r=n[n.length-1];return[await h(e,n.slice(0,-1)),r]}function b(e){return e.trim().replace(/\\/g,`/`).replace(/^\/+/,``).replace(/^\.\//,``)}function x(e){let t=new Map,n=`repos/.git-modes`;function r(e){return e.replace(/\\/g,`/`.replace(/^\/+/,``))}async function i(){try{let r=await(await(await v(e,n)).getFile()).text(),i=JSON.parse(r);for(let[e,n]of i)t.set(e,n)}catch{}}let a=null;function o(){a===null&&(a=setTimeout(async()=>{a=null;try{let r=await(await v(e,n,{create:!0})).createWritable(),i=JSON.stringify([...t.entries()]);await r.write(new TextEncoder().encode(i)),await r.close()}catch{}},500))}let s=i(),c={async readFile(t,n){let r=await(await(await v(e,t)).getFile()).arrayBuffer(),i=typeof n==`string`?n:n?.encoding;return i===`utf8`||i===`utf-8`?new TextDecoder().decode(r):new Uint8Array(r)},async writeFile(n,i,a){let s=await(await v(e,n,{create:!0})).createWritable();typeof i==`string`&&(i=new TextEncoder().encode(i)),await s.write(i),await s.close();let c=typeof a==`object`&&a?a.mode:void 0,l=r(n);if(c!=null){let e=(c&73)!=0;t.set(l,e?33261:33188),o()}else t.has(l)||t.set(l,33188)},async mkdir(t){await _(e,t,{create:!0})},async rmdir(n){let[i,a]=await y(e,n);await i.removeEntry(a,{recursive:!0});let o=r(n)+`/`;for(let e of t.keys())(e===r(n)||e.startsWith(o))&&t.delete(e);m.invalidate(p(n))},async readdir(t){let n=await _(e,t),r=[];for await(let[e]of n.entries())r.push(e);return r},async stat(n){await s;let i;try{i=await g(e,n)}catch{let e=Error(`ENOENT: no such file or directory, stat '${n}'`);throw e.code=`ENOENT`,e}if(i.kind===`directory`){let e=new Date;return{isDirectory:()=>!0,isFile:()=>!1,isSymbolicLink:()=>!1,size:0,mtimeMs:Date.now(),mode:16877,ino:0,dev:0,nlink:1,uid:0,gid:0,ctime:e,mtime:e}}else{let e=await i.getFile(),a=new Date(e.lastModified),o=r(n),s=t.get(o)??33188;return{isDirectory:()=>!1,isFile:()=>!0,isSymbolicLink:()=>!1,size:e.size,mtimeMs:e.lastModified,mode:s,ino:0,dev:0,nlink:1,uid:0,gid:0,ctime:a,mtime:a}}},async lstat(e){return c.stat(e)},async unlink(n){let[i,a]=await y(e,n);await i.removeEntry(a),t.delete(r(n))},async symlink(e,t){throw Error(`OPFS does not support symlinks`)},async readlink(e){return await c.readFile(e,`utf8`)}};return{promises:c}}const ee=x,S=`repos`;function C(n,r,i){if(n===`custom`&&r)return r;if(n===`public`)return`https://www.cors-anywhere.com`;let a=i||(typeof globalThis<`u`&&globalThis.location?globalThis.location:typeof self<`u`&&self.location?self.location:typeof window<`u`&&window.location?window.location:null),o=a?.protocol||``,s=o===`https:`||o===`https`||typeof a?.origin==`string`&&a.origin.startsWith(`https:`)||typeof a?.href==`string`&&a.href.startsWith(`https://`)?`https:`:`http:`,c=a?.host||``,l=a?.hostname||``,u=l===`localhost`||l===`127.0.0.1`||l===`::1`||l===`[::1]`||l===`0.0.0.0`||c.startsWith(`localhost:`)||c.startsWith(`127.0.0.1:`)||c.startsWith(`[::1]:`),d=a&&(a.protocol===`file:`||l&&(l.endsWith(`.github.io`)||l.endsWith(`.pages.dev`)));return c&&(u||!d)?`${s}//${c}/git-proxy`:`${s}//${t}:${e}/git-proxy`}async function w(){return f||=(async()=>{if(c=r,l=a,!u){let e;try{e=await navigator.storage.getDirectory()}catch(t){console.warn(`OPFS is unavailable for git root, falling back to memory:`,t);let{getMemoryOpfsRoot:n}=await import(`./chunk-Da1BZyqf2.js`);e=n()}u=x(e),d=u.promises}})(),await f,{git:c,http:l,fs:u,pfs:d}}async function T(e){let t=await w();if(e){let n=x(e);return{git:t.git,http:t.http,fs:n,pfs:n.promises,repoDirFn:e=>`repos/${e}`}}return{...t,repoDirFn:D}}function E(e){return(e.replace(/\/+$/,``).split(`/`).pop()||`repo`).replace(/\.git$/,``)}function D(e){return`${S}/${e}`}async function O(e,t,n){try{await e.getConfig({fs:t,dir:n,path:`core.filemode`})!==!1&&await e.setConfig({fs:t,dir:n,path:`core.filemode`,value:!1})}catch(e){console.error(`Failed to set core.filemode=false:`,e)}}async function k(e,t){try{await e.mkdir(t)}catch{}}function A({token:e,username:t,password:n}={}){if(!e&&!t)return{};let r;e?r={Authorization:`Basic ${btoa(`${e}:x-oauth-basic`)}`}:t&&(r={Authorization:`Basic ${btoa(`${t}:${n||``}`)}`});let i=()=>e?{username:e,password:`x-oauth-basic`}:t?{username:t,password:n||``}:{cancel:!0},a=()=>({cancel:!0});return{...r?{headers:r}:{},onAuth:i,onAuthFailure:a}}async function j({url:e,branch:t,depth:n=20,corsProxy:r,name:i,token:a,username:o,password:s,groupRoot:c}){let{git:l,http:u,fs:d,pfs:f,repoDirFn:p}=await T(c),m=i||E(e),h=p(m);r||=C(`local`),await k(f,S),await k(f,h);let g=A({token:a,username:o,password:s});try{let i={fs:d,http:u,dir:h,url:e,singleBranch:!0,depth:n,corsProxy:r,...g};t&&(i.ref=t),await l.clone(i)}catch{try{let i={fs:d,http:u,dir:h,url:e,singleBranch:!0,depth:n,corsProxy:r,...g};t&&(i.ref=t),await l.fetch(i)}catch{try{await Q(f,h),await k(f,h);let i={fs:d,http:u,dir:h,url:e,singleBranch:!0,depth:n,corsProxy:r,...g};t&&(i.ref=t),await l.clone(i)}catch(t){throw Error(`Failed to clone/fetch ${e}: ${t instanceof Error?t.message:String(t)}`)}}}return await O(l,d,h),m}async function M({repo:e,ref:t,groupRoot:n}){let{git:r,fs:i,repoDirFn:a}=await T(n),o=a(e);return await r.checkout({fs:i,dir:o,ref:t,force:!0}),`Checked out ${t} in ${e}`}async function N({repo:e,name:t,checkout:n=!1,startPoint:r,groupRoot:i}){let{git:a,fs:o,repoDirFn:s}=await T(i),c=s(e),l={fs:o,dir:c,ref:t};return r&&(l.object=r),await a.branch(l),n?(await a.checkout({fs:o,dir:c,ref:t}),`Created and switched to branch ${t} in ${e}`):`Created branch ${t} in ${e}`}async function P({repo:e,groupRoot:t}){let{git:n,fs:r,repoDirFn:i}=await T(t),a=i(e);await O(n,r,a);let o=await n.statusMatrix({fs:r,dir:a});if(o.length===0)return`Empty repository.`;let s=[];for(let[e,t,n,r]of o){let i=``;if(t===0&&n===2&&r===2)i=`added`;else if(t===0&&n===2&&r===0)i=`new (unstaged)`;else if(t===1&&n===2&&r===2)i=`modified (staged)`;else if(t===1&&n===2&&r===1)i=`modified`;else if(t===1&&n===0&&r===0)i=`deleted`;else if(t===1&&n===1&&r===1)continue;else i=`[${t},${n},${r}]`;s.push(`${i}: ${e}`)}return s.length===0?`On branch ${await n.currentBranch({fs:r,dir:a})||`(detached HEAD)`}\nNothing to commit, working tree clean.`:`On branch ${await n.currentBranch({fs:r,dir:a})||`(detached HEAD)`}\n${s.join(`
2
2
  `)}`}async function F({repo:e,ref:t,depth:n=10,groupRoot:r}){let{git:i,fs:a,repoDirFn:o}=await T(r),s={fs:a,dir:o(e),depth:n};t&&(s.ref=t);let c=await i.log(s);return c.length===0?`No commits found.`:c.map(e=>{let t=e.commit,n=new Date(t.author.timestamp*1e3).toISOString();return`${e.oid} ${n} ${t.author.name} — ${t.message.trim().split(`
3
3
  `)[0]}`}).join(`
4
4
  `)}async function I({repo:e,ref1:t,ref2:n,groupRoot:r}){let{git:i,fs:a,repoDirFn:o}=await T(r),s=o(e),c=a.promises;if(await O(i,a,s),!t&&!n){let e=(await i.statusMatrix({fs:a,dir:s})).filter(([,e,t])=>!(e===1&&t===1));if(e.length===0)return`No differences.`;let t=[];for(let[n,r,o]of e)try{if(r===0&&o===2){let e=(await R(c,s,n)).split(`