shadow-claw 1.51.0 → 1.52.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 (296) hide show
  1. package/.well-known/mcp/server-card.json +1 -1
  2. package/.well-known/mcp.json +1 -1
  3. package/README.md +1 -1
  4. package/dist/cli/{chunk-Dtse8rAn.js → chunk-5ryVpyup.js} +1 -1
  5. package/dist/cli/chunk-Aq3057Xo.js +1 -0
  6. package/dist/cli/{chunk-4CZJpLqA.js → chunk-BV9JBYpl.js} +2 -2
  7. package/dist/cli/{chunk-mbFAP9Ev.js → chunk-BZI3bWDA.js} +1 -1
  8. package/dist/cli/chunk-BaUCHRPD.js +1 -0
  9. package/dist/cli/{chunk-vzUrhBN5.js → chunk-BdbEt6gM.js} +1 -1
  10. package/dist/cli/{chunk-BU8UG4L_.js → chunk-BiWLawPV.js} +1 -1
  11. package/dist/cli/chunk-BkLnHJeo.js +1 -0
  12. package/dist/cli/{chunk-BqfPWIBf.js → chunk-BzWY1sKE.js} +1 -1
  13. package/dist/cli/{chunk-DajM7Kro.js → chunk-C79eIU-4.js} +1 -1
  14. package/dist/cli/{chunk-CI9r1AM5.js → chunk-CDw214Zi.js} +1 -1
  15. package/dist/cli/chunk-CNqc7LLn.js +1 -0
  16. package/dist/cli/{chunk-CEhU-Ah-.js → chunk-CWW7dqIv.js} +1 -1
  17. package/dist/cli/{chunk-BT_C3OlA.js → chunk-CcSTYHtR.js} +1 -1
  18. package/dist/cli/chunk-ClOfk6Ga.js +1 -0
  19. package/dist/cli/chunk-ComXUwW0.js +1 -0
  20. package/dist/cli/{chunk-lL1BhHVe.js → chunk-CooeO4UQ.js} +1 -1
  21. package/dist/cli/{chunk-khr7--yI.js → chunk-CtfWY4G6.js} +1 -1
  22. package/dist/cli/{chunk-C4iW1XuQ.js → chunk-DFgSiYMW.js} +1 -1
  23. package/dist/cli/chunk-DGBnjngK.js +1 -0
  24. package/dist/cli/{chunk-D7bFIUK3.js → chunk-DGu1OhJs.js} +1 -1
  25. package/dist/cli/{chunk-CzfOerQR.js → chunk-DIjCY0Wf.js} +1 -1
  26. package/dist/cli/{chunk-D-iqEY5G.js → chunk-DJ_LeQtz.js} +1 -1
  27. package/dist/cli/{chunk-BmEsDkRK.js → chunk-DQRu-9wO.js} +1 -1
  28. package/dist/cli/{chunk-DojiYody.js → chunk-DToVgO9a.js} +1 -1
  29. package/dist/cli/{chunk-De5a_Rlp.js → chunk-DVbNkQRL.js} +1 -1
  30. package/dist/cli/{chunk-c8MIYB2y.js → chunk-Ddtzaj43.js} +1 -1
  31. package/dist/cli/{chunk-aJ6fufe-.js → chunk-DiqS56rD.js} +1 -1
  32. package/dist/cli/{chunk-CeUEmZNt.js → chunk-DnRcu9b4.js} +1 -1
  33. package/dist/cli/chunk-DtgZDsJA.js +1 -0
  34. package/dist/cli/{chunk-DVMcK7g6.js → chunk-Du4qvxo_.js} +2 -2
  35. package/dist/cli/{chunk-CegcvNc9.js → chunk-Dz5_hgvL.js} +8 -8
  36. package/dist/cli/{chunk-Cd4Dv5Eq.js → chunk-I3mxEelq.js} +1 -1
  37. package/dist/cli/{chunk-Do3VICh1.js → chunk-IU2SH_ti.js} +1 -1
  38. package/dist/cli/{chunk-BQveaAaD.js → chunk-NC8XsSSA.js} +1 -1
  39. package/dist/cli/{chunk-D702W_Ry.js → chunk-Q4BZ9QN9.js} +1 -1
  40. package/dist/cli/chunk-WTlDd4Ou.js +1 -0
  41. package/dist/cli/chunk-XGzq5joC.js +1 -0
  42. package/dist/cli/{chunk-ar7eAlxK.js → chunk-aJfaGe2s.js} +8 -8
  43. package/dist/cli/chunk-bPVrFlmk.js +1 -0
  44. package/dist/cli/chunk-jXJHKxdR.js +1 -0
  45. package/dist/cli/{chunk-C3dTAmV_.js → chunk-rstVU7U0.js} +1 -1
  46. package/dist/cli/{chunk-DGfTzQui.js → chunk-t72uObQ7.js} +1 -1
  47. package/dist/cli/{chunk-DDgfljzN.js → chunk-vq8xlroY.js} +1 -1
  48. package/dist/cli/cli.js +1 -1
  49. package/dist/headless-agent.js +1 -1
  50. package/dist/lib/components/common/shadow-claw-provider-model-picker.js +1 -1
  51. package/dist/lib/components/index.js +27 -27
  52. package/dist/lib/components/settings/shadow-claw-accounts.js +1 -1
  53. package/dist/lib/components/settings/shadow-claw-channel-config.js +1 -1
  54. package/dist/lib/components/settings/shadow-claw-control-plane.js +1 -1
  55. package/dist/lib/components/settings/shadow-claw-git.js +1 -1
  56. package/dist/lib/components/settings/shadow-claw-integrations.js +1 -1
  57. package/dist/lib/components/settings/shadow-claw-llm/model-ranking.d.ts +12 -0
  58. package/dist/lib/components/settings/shadow-claw-llm.js +1 -1
  59. package/dist/lib/components/settings/shadow-claw-mcp-remote.js +1 -1
  60. package/dist/lib/components/settings/shadow-claw-networking.js +1 -1
  61. package/dist/lib/components/settings/shadow-claw-notifications.js +1 -1
  62. package/dist/lib/components/settings/shadow-claw-peerjs.js +1 -1
  63. package/dist/lib/components/settings/shadow-claw-storage.js +1 -1
  64. package/dist/lib/components/settings/shadow-claw-task-server.js +1 -1
  65. package/dist/lib/components/settings/shadow-claw-webvm.js +1 -1
  66. package/dist/lib/components/shadow-claw-a2ui.js +1 -1
  67. package/dist/lib/components/shadow-claw-accounts.js +1 -1
  68. package/dist/lib/components/shadow-claw-channel-config.js +1 -1
  69. package/dist/lib/components/shadow-claw-channels.js +1 -1
  70. package/dist/lib/components/shadow-claw-chat/shadow-claw-chat.d.ts +1 -0
  71. package/dist/lib/components/shadow-claw-chat.js +1 -1
  72. package/dist/lib/components/shadow-claw-control-plane.js +1 -1
  73. package/dist/lib/components/shadow-claw-conversations.js +1 -1
  74. package/dist/lib/components/shadow-claw-file-viewer.js +1 -1
  75. package/dist/lib/components/shadow-claw-files.js +1 -1
  76. package/dist/lib/components/shadow-claw-git.js +1 -1
  77. package/dist/lib/components/shadow-claw-integrations.js +1 -1
  78. package/dist/lib/components/shadow-claw-llm.js +1 -1
  79. package/dist/lib/components/shadow-claw-mcp-remote.js +1 -1
  80. package/dist/lib/components/shadow-claw-networking.js +1 -1
  81. package/dist/lib/components/shadow-claw-notifications.js +1 -1
  82. package/dist/lib/components/shadow-claw-page-header.js +1 -1
  83. package/dist/lib/components/shadow-claw-pages.js +1 -1
  84. package/dist/lib/components/shadow-claw-peerjs.js +1 -1
  85. package/dist/lib/components/shadow-claw-provider-model-picker.js +1 -1
  86. package/dist/lib/components/shadow-claw-settings.js +1 -1
  87. package/dist/lib/components/shadow-claw-storage.js +1 -1
  88. package/dist/lib/components/shadow-claw-task-server.js +1 -1
  89. package/dist/lib/components/shadow-claw-tasks.js +1 -1
  90. package/dist/lib/components/shadow-claw-terminal.js +1 -1
  91. package/dist/lib/components/shadow-claw-tools.js +1 -1
  92. package/dist/lib/components/shadow-claw-webvm.js +1 -1
  93. package/dist/lib/components/shadow-claw.js +1 -1
  94. package/dist/lib/config/config.d.ts +2 -1
  95. package/dist/lib/{config-DxDaVDTn.js → config-DFLs7eoC.js} +3 -2
  96. package/dist/lib/config-DFLs7eoC.js.map +1 -0
  97. package/dist/lib/{configurePeerJs-ScwZiGbF.js → configurePeerJs-DJ0H6e6s.js} +3 -3
  98. package/dist/lib/{configurePeerJs-ScwZiGbF.js.map → configurePeerJs-DJ0H6e6s.js.map} +1 -1
  99. package/dist/lib/{connections-D82zele0.js → connections-DT3nPylw.js} +2 -2
  100. package/dist/lib/{connections-D82zele0.js.map → connections-DT3nPylw.js.map} +1 -1
  101. package/dist/lib/{downloadGroupFile-D7-5y6NI.js → downloadGroupFile-DMnAiPj4.js} +2 -2
  102. package/dist/lib/{downloadGroupFile-D7-5y6NI.js.map → downloadGroupFile-DMnAiPj4.js.map} +1 -1
  103. package/dist/lib/{file-viewer-BMvvndPQ.js → file-viewer-OHmGC_l7.js} +5 -5
  104. package/dist/lib/{file-viewer-BMvvndPQ.js.map → file-viewer-OHmGC_l7.js.map} +1 -1
  105. package/dist/lib/{getGroupDir-BidwYPfP.js → getGroupDir-mTV2Iz2b.js} +3 -3
  106. package/dist/lib/{getGroupDir-BidwYPfP.js.map → getGroupDir-mTV2Iz2b.js.map} +1 -1
  107. package/dist/lib/{git-CXmWufWS.js → git-CGdKghMC.js} +3 -3
  108. package/dist/lib/{git-CXmWufWS.js.map → git-CGdKghMC.js.map} +1 -1
  109. package/dist/lib/index.js +28 -28
  110. package/dist/lib/{initChatSplitResize-tvUZ-wsp.js → initChatSplitResize-B8zHHQdm.js} +2 -2
  111. package/dist/lib/{initChatSplitResize-tvUZ-wsp.js.map → initChatSplitResize-B8zHHQdm.js.map} +1 -1
  112. package/dist/lib/{initControlPlane-Dnjkb-6J.js → initControlPlane-BczrlTf3.js} +14 -14
  113. package/dist/lib/{initControlPlane-Dnjkb-6J.js.map → initControlPlane-BczrlTf3.js.map} +1 -1
  114. package/dist/lib/{markdown-WCXar9C8.js → markdown-D-7Cjyye.js} +3 -3
  115. package/dist/lib/{markdown-WCXar9C8.js.map → markdown-D-7Cjyye.js.map} +1 -1
  116. package/dist/lib/{mcp-reconnect-WTOQONHZ.js → mcp-reconnect-Czf7QCCv.js} +2 -2
  117. package/dist/lib/{mcp-reconnect-WTOQONHZ.js.map → mcp-reconnect-Czf7QCCv.js.map} +1 -1
  118. package/dist/lib/{memoryStorage-Bo2Wpfmg.js → memoryStorage-CXyKsKMo.js} +2 -2
  119. package/dist/lib/{memoryStorage-Bo2Wpfmg.js.map → memoryStorage-CXyKsKMo.js.map} +1 -1
  120. package/dist/lib/model-ranking-Bo8CpGH1.js +116 -0
  121. package/dist/lib/model-ranking-Bo8CpGH1.js.map +1 -0
  122. package/dist/lib/{orchestrator-Crw4btGn.js → orchestrator-BK138MkV.js} +10 -10
  123. package/dist/lib/{orchestrator-Crw4btGn.js.map → orchestrator-BK138MkV.js.map} +1 -1
  124. package/dist/lib/{orchestrator-Dro541iH.js → orchestrator-BtbxiPQB.js} +17 -16
  125. package/dist/lib/{orchestrator-Dro541iH.js.map → orchestrator-BtbxiPQB.js.map} +1 -1
  126. package/dist/lib/{peerjs-D741bHrf.js → peerjs-QJr03K9F.js} +7 -7
  127. package/dist/lib/{peerjs-D741bHrf.js.map → peerjs-QJr03K9F.js.map} +1 -1
  128. package/dist/lib/{prompt-api-D9XdrCep.js → prompt-api-vf351sf2.js} +2 -19
  129. package/dist/lib/{prompt-api-D9XdrCep.js.map → prompt-api-vf351sf2.js.map} +1 -1
  130. package/dist/lib/{push-client-DKFUY_Ti.js → push-client-BOHgqHbk.js} +4 -4
  131. package/dist/lib/{push-client-DKFUY_Ti.js.map → push-client-BOHgqHbk.js.map} +1 -1
  132. package/dist/lib/{readGroupFileBytes-C8Xqlb8l.js → readGroupFileBytes-CRA6dmgT.js} +2 -2
  133. package/dist/lib/{readGroupFileBytes-C8Xqlb8l.js.map → readGroupFileBytes-CRA6dmgT.js.map} +1 -1
  134. package/dist/lib/{shadow-claw-a2ui-CPydWVdW.js → shadow-claw-a2ui-DbZa4Gxp.js} +2 -2
  135. package/dist/lib/{shadow-claw-a2ui-CPydWVdW.js.map → shadow-claw-a2ui-DbZa4Gxp.js.map} +1 -1
  136. package/dist/lib/{shadow-claw-accounts-CUypXc3I.js → shadow-claw-accounts-B6OW2NVD.js} +3 -3
  137. package/dist/lib/{shadow-claw-accounts-CUypXc3I.js.map → shadow-claw-accounts-B6OW2NVD.js.map} +1 -1
  138. package/dist/lib/{shadow-claw-channel-config-D_Vb2ous.js → shadow-claw-channel-config-F_EJ-uK2.js} +3 -3
  139. package/dist/lib/{shadow-claw-channel-config-D_Vb2ous.js.map → shadow-claw-channel-config-F_EJ-uK2.js.map} +1 -1
  140. package/dist/lib/{shadow-claw-channels-hgjjzvRr.js → shadow-claw-channels-XYylMpjg.js} +3 -3
  141. package/dist/lib/{shadow-claw-channels-hgjjzvRr.js.map → shadow-claw-channels-XYylMpjg.js.map} +1 -1
  142. package/dist/lib/{shadow-claw-chat-D69IiLXd.js → shadow-claw-chat-dbK_DGO_.js} +124 -38
  143. package/dist/lib/shadow-claw-chat-dbK_DGO_.js.map +1 -0
  144. package/dist/lib/{shadow-claw-control-plane-zBYlFvzQ.js → shadow-claw-control-plane-BJKkmahQ.js} +7 -7
  145. package/dist/lib/{shadow-claw-control-plane-zBYlFvzQ.js.map → shadow-claw-control-plane-BJKkmahQ.js.map} +1 -1
  146. package/dist/lib/{shadow-claw-conversations-1GW8_e8o.js → shadow-claw-conversations-BKSsMYTc.js} +6 -6
  147. package/dist/lib/{shadow-claw-conversations-1GW8_e8o.js.map → shadow-claw-conversations-BKSsMYTc.js.map} +1 -1
  148. package/dist/lib/{shadow-claw-D3z3tFyE.js → shadow-claw-eBB2dbpd.js} +11 -11
  149. package/dist/lib/{shadow-claw-D3z3tFyE.js.map → shadow-claw-eBB2dbpd.js.map} +1 -1
  150. package/dist/lib/{shadow-claw-file-viewer-DI4r7Th9.js → shadow-claw-file-viewer-BqChtTvM.js} +8 -8
  151. package/dist/lib/{shadow-claw-file-viewer-DI4r7Th9.js.map → shadow-claw-file-viewer-BqChtTvM.js.map} +1 -1
  152. package/dist/lib/{shadow-claw-files-BM7qW3TW.js → shadow-claw-files-Bu7VCQw6.js} +9 -9
  153. package/dist/lib/{shadow-claw-files-BM7qW3TW.js.map → shadow-claw-files-Bu7VCQw6.js.map} +1 -1
  154. package/dist/lib/{shadow-claw-git-BBTiTYIn.js → shadow-claw-git-CdPPN6Qb.js} +6 -6
  155. package/dist/lib/{shadow-claw-git-BBTiTYIn.js.map → shadow-claw-git-CdPPN6Qb.js.map} +1 -1
  156. package/dist/lib/{shadow-claw-integrations-DTY3E545.js → shadow-claw-integrations-DehqBSRe.js} +4 -4
  157. package/dist/lib/{shadow-claw-integrations-DTY3E545.js.map → shadow-claw-integrations-DehqBSRe.js.map} +1 -1
  158. package/dist/lib/{shadow-claw-llm-AJwzkOGo.js → shadow-claw-llm-COZkufA8.js} +13 -11
  159. package/dist/lib/shadow-claw-llm-COZkufA8.js.map +1 -0
  160. package/dist/lib/{shadow-claw-mcp-remote-n7YXKxmv.js → shadow-claw-mcp-remote-axF50-le.js} +4 -4
  161. package/dist/lib/{shadow-claw-mcp-remote-n7YXKxmv.js.map → shadow-claw-mcp-remote-axF50-le.js.map} +1 -1
  162. package/dist/lib/{shadow-claw-networking-B3leDgZ4.js → shadow-claw-networking-BT_Rxj36.js} +2 -2
  163. package/dist/lib/{shadow-claw-networking-B3leDgZ4.js.map → shadow-claw-networking-BT_Rxj36.js.map} +1 -1
  164. package/dist/lib/{shadow-claw-notifications-Bm2aHQ0U.js → shadow-claw-notifications-ClqAXDDN.js} +3 -3
  165. package/dist/lib/{shadow-claw-notifications-Bm2aHQ0U.js.map → shadow-claw-notifications-ClqAXDDN.js.map} +1 -1
  166. package/dist/lib/{shadow-claw-page-header-BBqSWlhP.js → shadow-claw-page-header-bigC_h6U.js} +2 -2
  167. package/dist/lib/{shadow-claw-page-header-BBqSWlhP.js.map → shadow-claw-page-header-bigC_h6U.js.map} +1 -1
  168. package/dist/lib/{shadow-claw-pages-BFOcluFY.js → shadow-claw-pages-kA2qa-4B.js} +9 -9
  169. package/dist/lib/{shadow-claw-pages-BFOcluFY.js.map → shadow-claw-pages-kA2qa-4B.js.map} +1 -1
  170. package/dist/lib/{shadow-claw-peerjs-BvD_MH_l.js → shadow-claw-peerjs-CvcH2DkA.js} +3 -3
  171. package/dist/lib/{shadow-claw-peerjs-BvD_MH_l.js.map → shadow-claw-peerjs-CvcH2DkA.js.map} +1 -1
  172. package/dist/lib/{shadow-claw-provider-model-picker-CsA-507a.js → shadow-claw-provider-model-picker-fcVQdDtQ.js} +2 -2
  173. package/dist/lib/{shadow-claw-provider-model-picker-CsA-507a.js.map → shadow-claw-provider-model-picker-fcVQdDtQ.js.map} +1 -1
  174. package/dist/lib/{shadow-claw-settings-CZgGMz0a.js → shadow-claw-settings-CkO6JjA4.js} +6 -6
  175. package/dist/lib/{shadow-claw-settings-CZgGMz0a.js.map → shadow-claw-settings-CkO6JjA4.js.map} +1 -1
  176. package/dist/lib/{shadow-claw-storage-BTUpEKO0.js → shadow-claw-storage-10w-y8vL.js} +5 -5
  177. package/dist/lib/{shadow-claw-storage-BTUpEKO0.js.map → shadow-claw-storage-10w-y8vL.js.map} +1 -1
  178. package/dist/lib/{shadow-claw-task-server-B1X2AYyZ.js → shadow-claw-task-server-U98sZxPu.js} +2 -2
  179. package/dist/lib/{shadow-claw-task-server-B1X2AYyZ.js.map → shadow-claw-task-server-U98sZxPu.js.map} +1 -1
  180. package/dist/lib/{shadow-claw-tasks-BYtaRUAd.js → shadow-claw-tasks-DrSVUOsP.js} +8 -8
  181. package/dist/lib/{shadow-claw-tasks-BYtaRUAd.js.map → shadow-claw-tasks-DrSVUOsP.js.map} +1 -1
  182. package/dist/lib/{shadow-claw-terminal-LGuXKu77.js → shadow-claw-terminal-B7HYLuce.js} +2 -2
  183. package/dist/lib/{shadow-claw-terminal-LGuXKu77.js.map → shadow-claw-terminal-B7HYLuce.js.map} +1 -1
  184. package/dist/lib/{shadow-claw-tools-C_S-xXVG.js → shadow-claw-tools-BKrXzZfF.js} +7 -7
  185. package/dist/lib/{shadow-claw-tools-C_S-xXVG.js.map → shadow-claw-tools-BKrXzZfF.js.map} +1 -1
  186. package/dist/lib/{shadow-claw-webvm-Cab1n1bu.js → shadow-claw-webvm-Duwa5oiW.js} +3 -3
  187. package/dist/lib/{shadow-claw-webvm-Cab1n1bu.js.map → shadow-claw-webvm-Duwa5oiW.js.map} +1 -1
  188. package/dist/lib/{syncWebMcpRegistration-Dy5NS_4G.js → syncWebMcpRegistration-BOx-0F6_.js} +5 -5
  189. package/dist/lib/{syncWebMcpRegistration-Dy5NS_4G.js.map → syncWebMcpRegistration-BOx-0F6_.js.map} +1 -1
  190. package/dist/lib/{tools-B7gC1eb_.js → tools-BEuBatUs.js} +4 -4
  191. package/dist/lib/{tools-B7gC1eb_.js.map → tools-BEuBatUs.js.map} +1 -1
  192. package/dist/lib/utils/index.js +1 -1
  193. package/dist/lib/utils/utils.js +1 -1
  194. package/dist/lib/{utils-D_ylqOY-.js → utils-D8AxCH6m.js} +2 -2
  195. package/dist/lib/{utils-D_ylqOY-.js.map → utils-D8AxCH6m.js.map} +1 -1
  196. package/dist/lib/{webmcp-CkYINKJj.js → webmcp-BjfVWX1K.js} +2 -2
  197. package/dist/lib/{webmcp-CkYINKJj.js.map → webmcp-BjfVWX1K.js.map} +1 -1
  198. package/dist/public/.well-known/mcp/server-card.json +1 -1
  199. package/dist/public/.well-known/mcp.json +1 -1
  200. package/dist/public/README.md +1 -1
  201. package/dist/public/agent.worker.js +1 -1
  202. package/dist/public/components/shadow-claw-chat/shadow-claw-chat.html +1 -1
  203. package/dist/public/config-071HSho8.js +1 -0
  204. package/dist/public/{configurePeerJs-DQQ6YL-5.js → configurePeerJs-DL-LurJY.js} +1 -1
  205. package/dist/public/{connections-CRNk2FxF.js → connections-Bb0rBpV-.js} +1 -1
  206. package/dist/public/{custom-element-security-3_FKCXcg.js → custom-element-security-Td4vrRc_.js} +1 -1
  207. package/dist/public/docs/example/article/index.html +1 -1
  208. package/dist/public/docs/example/article.html +1 -1
  209. package/dist/public/docs/publishing/index.html +1 -1
  210. package/dist/public/docs/publishing.html +1 -1
  211. package/dist/public/docs/skill-creator/index.html +1 -1
  212. package/dist/public/docs/skill-creator.html +1 -1
  213. package/dist/public/docs/subsystems/providers.md +1 -1
  214. package/dist/public/{downloadGroupFile-wkdhVgrZ.js → downloadGroupFile-Unq8_7D9.js} +1 -1
  215. package/dist/public/{e2e-bridge-DnFHPuwg.js → e2e-bridge-Dbc9fCDq.js} +1 -1
  216. package/dist/public/{file-viewer-C92v4Ggd.js → file-viewer-QkCuknFn.js} +1 -1
  217. package/dist/public/{getGroupDir-BGGIJL4Y.js → getGroupDir-Bj5XCflQ.js} +1 -1
  218. package/dist/public/{git-BH6qyToB.js → git-Bhz4YHc8.js} +2 -2
  219. package/dist/public/index.html +1 -1
  220. package/dist/public/index.js +1 -1
  221. package/dist/public/{initChatSplitResize--RH5kzVF.js → initChatSplitResize-KNL9Oh7s.js} +1 -1
  222. package/dist/public/{initControlPlane-yPJ3ajkj.js → initControlPlane-D2fVhRFC.js} +1 -1
  223. package/dist/public/main/index.html +1 -1
  224. package/dist/public/main/memory/index.html +1 -1
  225. package/dist/public/main/memory.html +1 -1
  226. package/dist/public/main.html +1 -1
  227. package/dist/public/{markdown-CA0v11cd.js → markdown-By6gdUvF.js} +1 -1
  228. package/dist/public/{mcp-reconnect-uyNSigzu.js → mcp-reconnect-CDRJPuoN.js} +1 -1
  229. package/dist/public/{memoryStorage-DjPNAT5t.js → memoryStorage-C-ao9y-j.js} +1 -1
  230. package/dist/public/model-ranking-DUdrFOcC.js +1 -0
  231. package/dist/public/{orchestrator-DTzgyL23.js → orchestrator-B7MpomoG.js} +2 -2
  232. package/dist/public/{orchestrator-Cmr69pMC.js → orchestrator-C8aIHbDy.js} +2 -2
  233. package/dist/public/{peerjs-Br38mUFC.js → peerjs-DwGjY5VX.js} +1 -1
  234. package/dist/public/prompt-api-BWe_j3Wg.js +1 -0
  235. package/dist/public/{push-client-CB8haOGC.js → push-client-o8g5_EOe.js} +1 -1
  236. package/dist/public/service-worker.js +1 -1
  237. package/dist/public/{shadow-claw-RuFQ2Ej5.js → shadow-claw-Ba2ZFE9m.js} +2 -2
  238. package/dist/public/{shadow-claw-accounts-BMsEItB6.js → shadow-claw-accounts-BbNPiiaV.js} +1 -1
  239. package/dist/public/{shadow-claw-channels-Q_AXuEaI.js → shadow-claw-channels-CHGtPkfY.js} +1 -1
  240. package/dist/public/{shadow-claw-chat-DZQ3OaH7.js → shadow-claw-chat-3TmjJA6-.js} +90 -23
  241. package/dist/public/{shadow-claw-control-plane-CyXA8tB8.js → shadow-claw-control-plane-BAFT06LL.js} +2 -2
  242. package/dist/public/{shadow-claw-conversations-BLKtlvHe.js → shadow-claw-conversations-DsQ_kxWm.js} +1 -1
  243. package/dist/public/{shadow-claw-file-viewer-CVLDfpZe.js → shadow-claw-file-viewer-hBxTknL2.js} +1 -1
  244. package/dist/public/{shadow-claw-files-DB6VVjir.js → shadow-claw-files-Daw6IIrJ.js} +1 -1
  245. package/dist/public/{shadow-claw-git-D57bTSMF.js → shadow-claw-git-CxGwyxim.js} +2 -2
  246. package/dist/public/{shadow-claw-integrations-BOwhUY-4.js → shadow-claw-integrations-DnIr6xp-.js} +1 -1
  247. package/dist/public/{shadow-claw-llm-CYenm-mm.js → shadow-claw-llm-Bc6tZ8kk.js} +3 -3
  248. package/dist/public/{shadow-claw-mcp-remote-CJ-Ckl0j.js → shadow-claw-mcp-remote-nGPpFpI-.js} +1 -1
  249. package/dist/public/{shadow-claw-networking-Cut76YQL.js → shadow-claw-networking-B6YgtiA7.js} +1 -1
  250. package/dist/public/{shadow-claw-notifications-C3kYCrIa.js → shadow-claw-notifications-BSxifptS.js} +1 -1
  251. package/dist/public/{shadow-claw-page-header-Dd7QafUk.js → shadow-claw-page-header-LzVgEn46.js} +1 -1
  252. package/dist/public/{shadow-claw-pages-BWtVtwTG.js → shadow-claw-pages-Cy6T0G9y.js} +1 -1
  253. package/dist/public/{shadow-claw-settings-Bj7jnngO.js → shadow-claw-settings-DGkwt1ge.js} +2 -2
  254. package/dist/public/{shadow-claw-storage-CMSzQs1-.js → shadow-claw-storage-DX_4T7KR.js} +1 -1
  255. package/dist/public/{shadow-claw-task-server-CFclo7UX.js → shadow-claw-task-server-DTsbEs5z.js} +1 -1
  256. package/dist/public/{shadow-claw-tasks-ClDdeB6Z.js → shadow-claw-tasks-rr6fMxAM.js} +1 -1
  257. package/dist/public/{shadow-claw-terminal-3ysWZJix.js → shadow-claw-terminal-C7DhrrX6.js} +1 -1
  258. package/dist/public/{shadow-claw-tools-DQVwpTcZ.js → shadow-claw-tools-DcQroojH.js} +1 -1
  259. package/dist/public/{shadow-claw-webvm-Cnxz04Fk.js → shadow-claw-webvm-bZj44Did.js} +1 -1
  260. package/dist/public/{syncWebMcpRegistration-QwnLMAK3.js → syncWebMcpRegistration-XJjIlDNO.js} +1 -1
  261. package/dist/public/{tools-DvQ_ngXn.js → tools-BpZh7hgB.js} +1 -1
  262. package/dist/public/{webmcp-CJymew4t.js → webmcp-CkfDZfZ0.js} +1 -1
  263. package/dist/server.js +1 -1
  264. package/package.json +1 -1
  265. package/src/components/settings/shadow-claw-llm/model-ranking.test.ts +121 -7
  266. package/src/components/settings/shadow-claw-llm/model-ranking.ts +97 -0
  267. package/src/components/settings/shadow-claw-llm/shadow-claw-llm.test.ts +35 -0
  268. package/src/components/settings/shadow-claw-llm/shadow-claw-llm.ts +15 -5
  269. package/src/components/shadow-claw-chat/shadow-claw-chat.html +81 -14
  270. package/src/components/shadow-claw-chat/shadow-claw-chat.test.ts +73 -0
  271. package/src/components/shadow-claw-chat/shadow-claw-chat.trusted-types.test.ts +3 -0
  272. package/src/components/shadow-claw-chat/shadow-claw-chat.ts +79 -32
  273. package/src/config/config.test.ts +4 -4
  274. package/src/config/config.ts +2 -1
  275. package/src/core/orchestrator/orchestrator.test.ts +2 -1
  276. package/src/core/orchestrator/utils/initTasks.ts +5 -4
  277. package/dist/cli/chunk-B3S061IE.js +0 -1
  278. package/dist/cli/chunk-BUJdF9o3.js +0 -1
  279. package/dist/cli/chunk-BX0R2gIY.js +0 -1
  280. package/dist/cli/chunk-BoiPfhwJ.js +0 -1
  281. package/dist/cli/chunk-BtJYj7vB.js +0 -1
  282. package/dist/cli/chunk-BwXrZVeU.js +0 -1
  283. package/dist/cli/chunk-CaWh9Pru.js +0 -1
  284. package/dist/cli/chunk-Ck4ePI8z.js +0 -1
  285. package/dist/cli/chunk-Ctg-SXcP.js +0 -1
  286. package/dist/cli/chunk-DTKv1-tk.js +0 -1
  287. package/dist/cli/chunk-DdYpd9Nu.js +0 -1
  288. package/dist/cli/chunk-DflhmBY2.js +0 -1
  289. package/dist/lib/config-DxDaVDTn.js.map +0 -1
  290. package/dist/lib/model-ranking-CDXs7hkK.js +0 -57
  291. package/dist/lib/model-ranking-CDXs7hkK.js.map +0 -1
  292. package/dist/lib/shadow-claw-chat-D69IiLXd.js.map +0 -1
  293. package/dist/lib/shadow-claw-llm-AJwzkOGo.js.map +0 -1
  294. package/dist/public/config-Dqn5OMfC.js +0 -1
  295. package/dist/public/model-ranking-DLIC9IDU.js +0 -1
  296. package/dist/public/prompt-api-B-8N-MRY.js +0 -11
@@ -1,4 +1,4 @@
1
- import{i as e,t}from"./rolldown-runtime-DBVvNlSN.js";import{a as n,i as r}from"./config-Dqn5OMfC.js";import{t as i}from"./browser-B1SoUj6D.js";import{r as a}from"./headless-D6caaop6.js";import{t as o}from"./buffer-B98mcmH0.js";import{a as s,i as c,n as l,o as u,r as d,t as f}from"./constants-DySRhLEI.js";import{t as p}from"./sha1-C0wdnAzD.js";var m=/* @__PURE__ */ t(((t,n)=>{var r=/* @__PURE__ */ e(i()),a=function(e){if(e||={},this.Promise=e.Promise||Promise,this.queues=Object.create(null),this.domainReentrant=e.domainReentrant||!1,this.domainReentrant){if(r.default===void 0||r.default.domain===void 0)throw Error("Domain-reentrant locks require `process.domain` to exist. Please flip `opts.domainReentrant = false`, use a NodeJS version that still implements Domain, or install a browser polyfill.");this.domains=Object.create(null)}this.timeout=e.timeout||a.DEFAULT_TIMEOUT,this.maxOccupationTime=e.maxOccupationTime||a.DEFAULT_MAX_OCCUPATION_TIME,this.maxExecutionTime=e.maxExecutionTime||a.DEFAULT_MAX_EXECUTION_TIME,this.maxPending=e.maxPending===1/0||Number.isInteger(e.maxPending)&&e.maxPending>=0?e.maxPending:a.DEFAULT_MAX_PENDING};a.DEFAULT_TIMEOUT=0,a.DEFAULT_MAX_OCCUPATION_TIME=0,a.DEFAULT_MAX_EXECUTION_TIME=0,a.DEFAULT_MAX_PENDING=1e3,a.prototype.acquire=function(e,t,n,i){if(Array.isArray(e))return this._acquireBatch(e,t,n,i);if(typeof t!=`function`)throw Error(`You must pass a function to execute`);var a=null,o=null,s=null;typeof n!=`function`&&(i=n,n=null,s=new this.Promise(function(e,t){a=e,o=t})),i||={};var c=!1,l=null,u=null,d=null,f=this,p=function(t,r,i){u&&=(clearTimeout(u),null),d&&=(clearTimeout(d),null),t&&(f.queues[e]&&f.queues[e].length===0&&delete f.queues[e],f.domainReentrant&&delete f.domains[e]),c||=(s?r?o(r):a(i):typeof n==`function`&&n(r,i),!0),t&&f.queues[e]&&f.queues[e].length>0&&f.queues[e].shift()()},m=function(n){if(c)return p(n);l&&=(clearTimeout(l),null),f.domainReentrant&&n&&(f.domains[e]=r.default.domain);var a=i.maxExecutionTime||f.maxExecutionTime;if(a&&(d=setTimeout(function(){f.queues[e]&&p(n,/* @__PURE__ */ Error(`Maximum execution time is exceeded `+e))},a)),t.length===1){var o=!1;try{t(function(e,t){o||(o=!0,p(n,e,t))})}catch(e){o||(o=!0,p(n,e))}}else f._promiseTry(function(){return t()}).then(function(e){p(n,void 0,e)},function(e){p(n,e)})};f.domainReentrant&&r.default.domain&&(m=r.default.domain.bind(m));var h=i.maxPending||f.maxPending;if(!f.queues[e])f.queues[e]=[],m(!0);else if(f.domainReentrant&&r.default.domain&&r.default.domain===f.domains[e])m(!1);else if(f.queues[e].length>=h)p(!1,/* @__PURE__ */ Error(`Too many pending tasks in queue `+e));else{var g=function(){m(!0)};i.skipQueue?f.queues[e].unshift(g):f.queues[e].push(g);var _=i.timeout||f.timeout;_&&(l=setTimeout(function(){l=null,p(!1,/* @__PURE__ */ Error(`async-lock timed out in queue `+e))},_))}var v=i.maxOccupationTime||f.maxOccupationTime;if(v&&(u=setTimeout(function(){f.queues[e]&&p(!1,/* @__PURE__ */ Error(`Maximum occupation time is exceeded in queue `+e))},v)),s)return s},a.prototype._acquireBatch=function(e,t,n,r){typeof n!=`function`&&(r=n,n=null);var i=this,a=function(e,t){return function(n){i.acquire(e,t,n,r)}},o=e.reduceRight(function(e,t){return a(t,e)},t);if(typeof n==`function`)o(n);else return new this.Promise(function(e,t){o.length===1?o(function(n,r){n?t(n):e(r)}):e(o())})},a.prototype.isBusy=function(e){return e?!!this.queues[e]:Object.keys(this.queues).length>0},a.prototype._promiseTry=function(e){try{return this.Promise.resolve(e())}catch(e){return this.Promise.reject(e)}},n.exports=a})),h=/* @__PURE__ */ t(((e,t)=>{t.exports=m()})),g=/* @__PURE__ */ t(((e,t)=>{function n(e){return e.replace(/[.*+?^${}()|[\]\\]/g,`\\$&`)}function r(e,t,r){return t=t instanceof RegExp?t:new RegExp(n(t),`g`),e.replace(t,r)}t.exports={clean:function(e){if(typeof e!=`string`)throw Error(`Expected a string, received: `+e);return e=r(e,`./`,`/`),e=r(e,`..`,`.`),e=r(e,` `,`-`),e=r(e,/^[~^:?*\\\-]/g,``),e=r(e,/[~^:?*\\]/g,`-`),e=r(e,/[~^:?*\\\-]$/g,``),e=r(e,`@{`,`-`),e=r(e,/\.$/g,``),e=r(e,/\/$/g,``),e=r(e,/\.lock$/g,``),e}}})),_=/* @__PURE__ */ t((e=>{
1
+ import{i as e,t}from"./rolldown-runtime-DBVvNlSN.js";import{a as n,i as r}from"./config-071HSho8.js";import{t as i}from"./browser-B1SoUj6D.js";import{r as a}from"./headless-D6caaop6.js";import{t as o}from"./buffer-B98mcmH0.js";import{a as s,i as c,n as l,o as u,r as d,t as f}from"./constants-DySRhLEI.js";import{t as p}from"./sha1-C0wdnAzD.js";var m=/* @__PURE__ */ t(((t,n)=>{var r=/* @__PURE__ */ e(i()),a=function(e){if(e||={},this.Promise=e.Promise||Promise,this.queues=Object.create(null),this.domainReentrant=e.domainReentrant||!1,this.domainReentrant){if(r.default===void 0||r.default.domain===void 0)throw Error("Domain-reentrant locks require `process.domain` to exist. Please flip `opts.domainReentrant = false`, use a NodeJS version that still implements Domain, or install a browser polyfill.");this.domains=Object.create(null)}this.timeout=e.timeout||a.DEFAULT_TIMEOUT,this.maxOccupationTime=e.maxOccupationTime||a.DEFAULT_MAX_OCCUPATION_TIME,this.maxExecutionTime=e.maxExecutionTime||a.DEFAULT_MAX_EXECUTION_TIME,this.maxPending=e.maxPending===1/0||Number.isInteger(e.maxPending)&&e.maxPending>=0?e.maxPending:a.DEFAULT_MAX_PENDING};a.DEFAULT_TIMEOUT=0,a.DEFAULT_MAX_OCCUPATION_TIME=0,a.DEFAULT_MAX_EXECUTION_TIME=0,a.DEFAULT_MAX_PENDING=1e3,a.prototype.acquire=function(e,t,n,i){if(Array.isArray(e))return this._acquireBatch(e,t,n,i);if(typeof t!=`function`)throw Error(`You must pass a function to execute`);var a=null,o=null,s=null;typeof n!=`function`&&(i=n,n=null,s=new this.Promise(function(e,t){a=e,o=t})),i||={};var c=!1,l=null,u=null,d=null,f=this,p=function(t,r,i){u&&=(clearTimeout(u),null),d&&=(clearTimeout(d),null),t&&(f.queues[e]&&f.queues[e].length===0&&delete f.queues[e],f.domainReentrant&&delete f.domains[e]),c||=(s?r?o(r):a(i):typeof n==`function`&&n(r,i),!0),t&&f.queues[e]&&f.queues[e].length>0&&f.queues[e].shift()()},m=function(n){if(c)return p(n);l&&=(clearTimeout(l),null),f.domainReentrant&&n&&(f.domains[e]=r.default.domain);var a=i.maxExecutionTime||f.maxExecutionTime;if(a&&(d=setTimeout(function(){f.queues[e]&&p(n,/* @__PURE__ */ Error(`Maximum execution time is exceeded `+e))},a)),t.length===1){var o=!1;try{t(function(e,t){o||(o=!0,p(n,e,t))})}catch(e){o||(o=!0,p(n,e))}}else f._promiseTry(function(){return t()}).then(function(e){p(n,void 0,e)},function(e){p(n,e)})};f.domainReentrant&&r.default.domain&&(m=r.default.domain.bind(m));var h=i.maxPending||f.maxPending;if(!f.queues[e])f.queues[e]=[],m(!0);else if(f.domainReentrant&&r.default.domain&&r.default.domain===f.domains[e])m(!1);else if(f.queues[e].length>=h)p(!1,/* @__PURE__ */ Error(`Too many pending tasks in queue `+e));else{var g=function(){m(!0)};i.skipQueue?f.queues[e].unshift(g):f.queues[e].push(g);var _=i.timeout||f.timeout;_&&(l=setTimeout(function(){l=null,p(!1,/* @__PURE__ */ Error(`async-lock timed out in queue `+e))},_))}var v=i.maxOccupationTime||f.maxOccupationTime;if(v&&(u=setTimeout(function(){f.queues[e]&&p(!1,/* @__PURE__ */ Error(`Maximum occupation time is exceeded in queue `+e))},v)),s)return s},a.prototype._acquireBatch=function(e,t,n,r){typeof n!=`function`&&(r=n,n=null);var i=this,a=function(e,t){return function(n){i.acquire(e,t,n,r)}},o=e.reduceRight(function(e,t){return a(t,e)},t);if(typeof n==`function`)o(n);else return new this.Promise(function(e,t){o.length===1?o(function(n,r){n?t(n):e(r)}):e(o())})},a.prototype.isBusy=function(e){return e?!!this.queues[e]:Object.keys(this.queues).length>0},a.prototype._promiseTry=function(e){try{return this.Promise.resolve(e())}catch(e){return this.Promise.reject(e)}},n.exports=a})),h=/* @__PURE__ */ t(((e,t)=>{t.exports=m()})),g=/* @__PURE__ */ t(((e,t)=>{function n(e){return e.replace(/[.*+?^${}()|[\]\\]/g,`\\$&`)}function r(e,t,r){return t=t instanceof RegExp?t:new RegExp(n(t),`g`),e.replace(t,r)}t.exports={clean:function(e){if(typeof e!=`string`)throw Error(`Expected a string, received: `+e);return e=r(e,`./`,`/`),e=r(e,`..`,`.`),e=r(e,` `,`-`),e=r(e,/^[~^:?*\\\-]/g,``),e=r(e,/[~^:?*\\]/g,`-`),e=r(e,/[~^:?*\\\-]$/g,``),e=r(e,`@{`,`-`),e=r(e,/\.$/g,``),e=r(e,/\/$/g,``),e=r(e,/\.lock$/g,``),e}}})),_=/* @__PURE__ */ t((e=>{
2
2
  /*! crc32.js (C) 2014-present SheetJS -- http://sheetjs.com */
3
3
  (function(t){typeof DO_NOT_EXPORT_CRC>`u`?typeof e==`object`?t(e):typeof define==`function`&&define.amd?define(function(){var e={};return t(e),e}):t({}):t({})})(function(e){e.version=`1.2.2`;function t(){for(var e=0,t=Array(256),n=0;n!=256;++n)e=n,e=e&1?-306674912^e>>>1:e>>>1,e=e&1?-306674912^e>>>1:e>>>1,e=e&1?-306674912^e>>>1:e>>>1,e=e&1?-306674912^e>>>1:e>>>1,e=e&1?-306674912^e>>>1:e>>>1,e=e&1?-306674912^e>>>1:e>>>1,e=e&1?-306674912^e>>>1:e>>>1,e=e&1?-306674912^e>>>1:e>>>1,t[n]=e;return typeof Int32Array<`u`?new Int32Array(t):t}var n=t();function r(e){var t=0,n=0,r=0,i=typeof Int32Array<`u`?/* @__PURE__ */ new Int32Array(4096):Array(4096);for(r=0;r!=256;++r)i[r]=e[r];for(r=0;r!=256;++r)for(n=e[r],t=256+r;t<4096;t+=256)n=i[t]=n>>>8^e[n&255];var a=[];for(r=1;r!=16;++r)a[r-1]=typeof Int32Array<`u`?i.subarray(r*256,r*256+256):i.slice(r*256,r*256+256);return a}var i=r(n),a=i[0],o=i[1],s=i[2],c=i[3],l=i[4],u=i[5],d=i[6],f=i[7],p=i[8],m=i[9],h=i[10],g=i[11],_=i[12],v=i[13],y=i[14];function b(e,t){for(var r=t^-1,i=0,a=e.length;i<a;)r=r>>>8^n[(r^e.charCodeAt(i++))&255];return~r}function x(e,t){for(var r=t^-1,i=e.length-15,b=0;b<i;)r=y[e[b++]^r&255]^v[e[b++]^r>>8&255]^_[e[b++]^r>>16&255]^g[e[b++]^r>>>24]^h[e[b++]]^m[e[b++]]^p[e[b++]]^f[e[b++]]^d[e[b++]]^u[e[b++]]^l[e[b++]]^c[e[b++]]^s[e[b++]]^o[e[b++]]^a[e[b++]]^n[e[b++]];for(i+=15;b<i;)r=r>>>8^n[(r^e[b++])&255];return~r}function S(e,t){for(var r=t^-1,i=0,a=e.length,o=0,s=0;i<a;)o=e.charCodeAt(i++),o<128?r=r>>>8^n[(r^o)&255]:o<2048?(r=r>>>8^n[(r^(192|o>>6&31))&255],r=r>>>8^n[(r^(128|o&63))&255]):o>=55296&&o<57344?(o=(o&1023)+64,s=e.charCodeAt(i++)&1023,r=r>>>8^n[(r^(240|o>>8&7))&255],r=r>>>8^n[(r^(128|o>>2&63))&255],r=r>>>8^n[(r^(128|s>>6&15|(o&3)<<4))&255],r=r>>>8^n[(r^(128|s&63))&255]):(r=r>>>8^n[(r^(224|o>>12&15))&255],r=r>>>8^n[(r^(128|o>>6&63))&255],r=r>>>8^n[(r^(128|o&63))&255]);return~r}e.table=n,e.bstr=b,e.buf=x,e.str=S})})),v=/* @__PURE__ */ t((e=>{var t=s(),n=!0,r=!0;try{String.fromCharCode.apply(null,[0])}catch{n=!1}try{String.fromCharCode.apply(null,/* @__PURE__ */ new Uint8Array(1))}catch{r=!1}for(var i=new t.Buf8(256),a=0;a<256;a++)i[a]=a>=252?6:a>=248?5:a>=240?4:a>=224?3:a>=192?2:1;i[254]=i[254]=1,e.string2buf=function(e){var n,r,i,a,o,s=e.length,c=0;for(a=0;a<s;a++)r=e.charCodeAt(a),(r&64512)==55296&&a+1<s&&(i=e.charCodeAt(a+1),(i&64512)==56320&&(r=65536+(r-55296<<10)+(i-56320),a++)),c+=r<128?1:r<2048?2:r<65536?3:4;for(n=new t.Buf8(c),o=0,a=0;o<c;a++)r=e.charCodeAt(a),(r&64512)==55296&&a+1<s&&(i=e.charCodeAt(a+1),(i&64512)==56320&&(r=65536+(r-55296<<10)+(i-56320),a++)),r<128?n[o++]=r:r<2048?(n[o++]=192|r>>>6,n[o++]=128|r&63):r<65536?(n[o++]=224|r>>>12,n[o++]=128|r>>>6&63,n[o++]=128|r&63):(n[o++]=240|r>>>18,n[o++]=128|r>>>12&63,n[o++]=128|r>>>6&63,n[o++]=128|r&63);return n};function o(e,i){if(i<65534&&(e.subarray&&r||!e.subarray&&n))return String.fromCharCode.apply(null,t.shrinkBuf(e,i));for(var a=``,o=0;o<i;o++)a+=String.fromCharCode(e[o]);return a}e.buf2binstring=function(e){return o(e,e.length)},e.binstring2buf=function(e){for(var n=new t.Buf8(e.length),r=0,i=n.length;r<i;r++)n[r]=e.charCodeAt(r);return n},e.buf2string=function(e,t){var n,r,a,s,c=t||e.length,l=Array(c*2);for(r=0,n=0;n<c;)if(a=e[n++],a<128)l[r++]=a;else if(s=i[a],s>4)l[r++]=65533,n+=s-1;else{for(a&=s===2?31:s===3?15:7;s>1&&n<c;)a=a<<6|e[n++]&63,s--;s>1?l[r++]=65533:a<65536?l[r++]=a:(a-=65536,l[r++]=55296|a>>10&1023,l[r++]=56320|a&1023)}return o(l,r)},e.utf8border=function(e,t){var n;for(t||=e.length,t>e.length&&(t=e.length),n=t-1;n>=0&&(e[n]&192)==128;)n--;return n<0||n===0?t:n+i[e[n]]>t?n:t}})),y=/* @__PURE__ */ t((e=>{var t=d(),n=s(),r=v(),i=c(),a=u(),o=Object.prototype.toString,l=0,f=4,p=0,m=1,h=2,g=-1,_=0,y=8;function b(e){if(!(this instanceof b))return new b(e);this.options=n.assign({level:g,method:y,chunkSize:16384,windowBits:15,memLevel:8,strategy:_,to:``},e||{});var s=this.options;s.raw&&s.windowBits>0?s.windowBits=-s.windowBits:s.gzip&&s.windowBits>0&&s.windowBits<16&&(s.windowBits+=16),this.err=0,this.msg=``,this.ended=!1,this.chunks=[],this.strm=new a,this.strm.avail_out=0;var c=t.deflateInit2(this.strm,s.level,s.method,s.windowBits,s.memLevel,s.strategy);if(c!==p)throw Error(i[c]);if(s.header&&t.deflateSetHeader(this.strm,s.header),s.dictionary){var l=typeof s.dictionary==`string`?r.string2buf(s.dictionary):o.call(s.dictionary)===`[object ArrayBuffer]`?new Uint8Array(s.dictionary):s.dictionary;if(c=t.deflateSetDictionary(this.strm,l),c!==p)throw Error(i[c]);this._dict_set=!0}}b.prototype.push=function(e,i){var a=this.strm,s=this.options.chunkSize,c,u;if(this.ended)return!1;u=i===~~i?i:i===!0?f:l,a.input=typeof e==`string`?r.string2buf(e):o.call(e)===`[object ArrayBuffer]`?new Uint8Array(e):e,a.next_in=0,a.avail_in=a.input.length;do{if(a.avail_out===0&&(a.output=new n.Buf8(s),a.next_out=0,a.avail_out=s),c=t.deflate(a,u),c!==m&&c!==p)return this.onEnd(c),this.ended=!0,!1;(a.avail_out===0||a.avail_in===0&&(u===f||u===h))&&(this.options.to===`string`?this.onData(r.buf2binstring(n.shrinkBuf(a.output,a.next_out))):this.onData(n.shrinkBuf(a.output,a.next_out)))}while((a.avail_in>0||a.avail_out===0)&&c!==m);return u===f?(c=t.deflateEnd(this.strm),this.onEnd(c),this.ended=!0,c===p):(u===h&&(this.onEnd(p),a.avail_out=0),!0)},b.prototype.onData=function(e){this.chunks.push(e)},b.prototype.onEnd=function(e){e===p&&(this.result=this.options.to===`string`?this.chunks.join(``):n.flattenChunks(this.chunks)),this.chunks=[],this.err=e,this.msg=this.strm.msg};function x(e,t){var n=new b(t);if(n.push(e,!0),n.err)throw n.msg||i[n.err];return n.result}function S(e,t){return t||={},t.raw=!0,x(e,t)}function C(e,t){return t||={},t.gzip=!0,x(e,t)}e.Deflate=b,e.deflate=x,e.deflateRaw=S,e.gzip=C})),b=/* @__PURE__ */ t(((e,t)=>{function n(){this.text=0,this.time=0,this.xflags=0,this.os=0,this.extra=null,this.extra_len=0,this.name=``,this.comment=``,this.hcrc=0,this.done=!1}t.exports=n})),x=/* @__PURE__ */ t((e=>{var t=l(),n=s(),r=v(),i=f(),a=c(),o=u(),d=b(),p=Object.prototype.toString;function m(e){if(!(this instanceof m))return new m(e);this.options=n.assign({chunkSize:16384,windowBits:0,to:``},e||{});var s=this.options;s.raw&&s.windowBits>=0&&s.windowBits<16&&(s.windowBits=-s.windowBits,s.windowBits===0&&(s.windowBits=-15)),s.windowBits>=0&&s.windowBits<16&&!(e&&e.windowBits)&&(s.windowBits+=32),s.windowBits>15&&s.windowBits<48&&(s.windowBits&15||(s.windowBits|=15)),this.err=0,this.msg=``,this.ended=!1,this.chunks=[],this.strm=new o,this.strm.avail_out=0;var c=t.inflateInit2(this.strm,s.windowBits);if(c!==i.Z_OK||(this.header=new d,t.inflateGetHeader(this.strm,this.header),s.dictionary&&(typeof s.dictionary==`string`?s.dictionary=r.string2buf(s.dictionary):p.call(s.dictionary)===`[object ArrayBuffer]`&&(s.dictionary=new Uint8Array(s.dictionary)),s.raw&&(c=t.inflateSetDictionary(this.strm,s.dictionary),c!==i.Z_OK))))throw Error(a[c])}m.prototype.push=function(e,a){var o=this.strm,s=this.options.chunkSize,c=this.options.dictionary,l,u,d,f,m,h=!1;if(this.ended)return!1;u=a===~~a?a:a===!0?i.Z_FINISH:i.Z_NO_FLUSH,o.input=typeof e==`string`?r.binstring2buf(e):p.call(e)===`[object ArrayBuffer]`?new Uint8Array(e):e,o.next_in=0,o.avail_in=o.input.length;do{if(o.avail_out===0&&(o.output=new n.Buf8(s),o.next_out=0,o.avail_out=s),l=t.inflate(o,i.Z_NO_FLUSH),l===i.Z_NEED_DICT&&c&&(l=t.inflateSetDictionary(this.strm,c)),l===i.Z_BUF_ERROR&&h===!0&&(l=i.Z_OK,h=!1),l!==i.Z_STREAM_END&&l!==i.Z_OK)return this.onEnd(l),this.ended=!0,!1;o.next_out&&(o.avail_out===0||l===i.Z_STREAM_END||o.avail_in===0&&(u===i.Z_FINISH||u===i.Z_SYNC_FLUSH))&&(this.options.to===`string`?(d=r.utf8border(o.output,o.next_out),f=o.next_out-d,m=r.buf2string(o.output,d),o.next_out=f,o.avail_out=s-f,f&&n.arraySet(o.output,o.output,d,f,0),this.onData(m)):this.onData(n.shrinkBuf(o.output,o.next_out))),o.avail_in===0&&o.avail_out===0&&(h=!0)}while((o.avail_in>0||o.avail_out===0)&&l!==i.Z_STREAM_END);return l===i.Z_STREAM_END&&(u=i.Z_FINISH),u===i.Z_FINISH?(l=t.inflateEnd(this.strm),this.onEnd(l),this.ended=!0,l===i.Z_OK):(u===i.Z_SYNC_FLUSH&&(this.onEnd(i.Z_OK),o.avail_out=0),!0)},m.prototype.onData=function(e){this.chunks.push(e)},m.prototype.onEnd=function(e){e===i.Z_OK&&(this.result=this.options.to===`string`?this.chunks.join(``):n.flattenChunks(this.chunks)),this.chunks=[],this.err=e,this.msg=this.strm.msg};function h(e,t){var n=new m(t);if(n.push(e,!0),n.err)throw n.msg||a[n.err];return n.result}function g(e,t){return t||={},t.raw=!0,h(e,t)}e.Inflate=m,e.inflate=h,e.inflateRaw=g,e.ungzip=h})),S=/* @__PURE__ */ t(((e,t)=>{var n=s().assign,r=y(),i=x(),a=f(),o={};n(o,r,i,a),t.exports=o})),C=/* @__PURE__ */ t(((e,t)=>{let n=(e,t)=>function(...n){let r=t.promiseModule;return new r((r,i)=>{t.multiArgs?n.push((...e)=>{t.errorFirst?e[0]?i(e):(e.shift(),r(e)):r(e)}):t.errorFirst?n.push((e,t)=>{e?i(e):r(t)}):n.push(r),e.apply(this,n)})};t.exports=(e,t)=>{t=Object.assign({exclude:[/.+(Sync|Stream)$/],errorFirst:!0,promiseModule:Promise},t);let r=typeof e;if(e===null||r!==`object`&&r!==`function`)throw TypeError(`Expected \`input\` to be a \`Function\` or \`Object\`, got \`${e===null?`null`:r}\``);let i=e=>{let n=t=>typeof t==`string`?e===t:t.test(e);return t.include?t.include.some(n):!t.exclude.some(n)},a;a=r===`function`?function(...r){return t.excludeMain?e(...r):n(e,t).apply(this,r)}:Object.create(Object.getPrototypeOf(e));for(let r in e){let o=e[r];a[r]=typeof o==`function`&&i(r)?n(o,t):o}return a}})),w=/* @__PURE__ */ t(((t,n)=>{var r=/* @__PURE__ */ e(i());function a(e){return Array.isArray(e)?e:[e]}let o=/^\s+$/,s=/(?:[^\\]|^)\\$/,c=/^\\!/,l=/^\\#/,u=/\r?\n/g,d=/^\.*\/|^\.+$/,f=`node-ignore`;
4
4
  /* istanbul ignore else */
@@ -90,7 +90,7 @@ gpgsig`+kn(o)+`
90
90
  `,author:o,committer:s,signingKey:c})}async function co({fs:e,onSign:t,dir:n,gitdir:r=z(n,`.git`),ref:i=`refs/notes/commits`,oid:a,author:o,committer:s,signingKey:c,cache:l={}}){try{Y(`fs`,e),Y(`gitdir`,r),Y(`oid`,a);let n=new J(e),u=await X({fsp:n,dotgit:r}),d=await pr({fs:n,gitdir:u,author:o});if(!d)throw new W(`author`);let f=await mr({fs:n,gitdir:u,author:d,committer:s});if(!f)throw new W(`committer`);return await so({fs:n,cache:l,onSign:t,gitdir:u,ref:i,oid:a,author:d,committer:f,signingKey:c})}catch(e){throw e.caller=`git.removeNote`,e}}async function lo({fs:e,gitdir:t,oldref:n,ref:r,checkout:i=!1}){if(!Ke(r,!0))throw new ze(r,A.default.clean(r));if(!Ke(n,!0))throw new ze(n,A.default.clean(n));let a=`refs/heads/${n}`,o=`refs/heads/${r}`;if(await V.exists({fs:e,gitdir:t,ref:o}))throw new qt(`branch`,r,!1);let s=await V.resolve({fs:e,gitdir:t,ref:a,depth:1});await V.writeRef({fs:e,gitdir:t,ref:o,value:s}),await V.deleteRef({fs:e,gitdir:t,ref:a});let c=await ei({fs:e,gitdir:t,fullname:!0})===a;(i||c)&&await V.writeSymbolicRef({fs:e,gitdir:t,ref:`HEAD`,value:o})}async function uo({fs:e,dir:t,gitdir:n=z(t,`.git`),ref:r,oldref:i,checkout:a=!1}){try{Y(`fs`,e),Y(`gitdir`,n),Y(`ref`,r),Y(`oldref`,i);let t=new J(e);return await lo({fs:t,gitdir:await X({fsp:t,dotgit:n}),ref:r,oldref:i,checkout:a})}catch(e){throw e.caller=`git.renameBranch`,e}}async function fo({gitdir:e,type:t,object:n}){return _e(Ct.wrap({type:t,object:n}))}async function po({fs:e,dir:t,gitdir:n=z(t,`.git`),filepath:r,ref:i,cache:a={}}){try{Y(`fs`,e),Y(`gitdir`,n),Y(`filepath`,r);let o=new J(e),s=await X({fsp:o,dotgit:n}),c,l;try{c=await V.resolve({fs:o,gitdir:s,ref:i||`HEAD`})}catch(e){if(i)throw e}if(c)try{c=await yr({fs:o,cache:a,gitdir:s,oid:c,filepath:r})}catch{c=null}let u={ctime:/* @__PURE__ */ new Date(0),mtime:/* @__PURE__ */ new Date(0),dev:0,ino:0,mode:0,uid:0,gid:0,size:0},d=t&&await o.read(z(t,r));d&&(l=await fo({gitdir:s,type:`blob`,object:d}),c===l&&(u=await o.lstat(z(t,r)))),await I.acquire({fs:o,gitdir:s,cache:a},async function(e){e.delete({filepath:r}),c&&e.insert({filepath:r,stats:u,oid:c})})}catch(e){throw e.caller=`git.reset`,e}}async function mo({fs:e,dir:t,gitdir:n=z(t,`.git`),ref:r,depth:i}){try{Y(`fs`,e),Y(`gitdir`,n),Y(`ref`,r);let t=new J(e),a=await X({fsp:t,dotgit:n});return await V.resolve({fs:t,gitdir:a,ref:r,depth:i})}catch(e){throw e.caller=`git.resolveRef`,e}}async function ho({fs:e,dir:t,gitdir:n=z(t,`.git`),path:r,value:i,append:a=!1}){try{Y(`fs`,e),Y(`gitdir`,n),Y(`path`,r);let t=new J(e),o=await X({fsp:t,dotgit:n}),s=await B.get({fs:t,gitdir:o});a?await s.append(r,i):await s.set(r,i),await B.save({fs:t,gitdir:o,config:s})}catch(e){throw e.caller=`git.setConfig`,e}}async function go({fs:e,gitdir:t,commit:n}){return await Z({fs:e,gitdir:t,type:`commit`,object:jn.from(n).toObject(),format:`content`})}var _o=class e{static get timezoneOffsetForRefLogEntry(){let e=(/* @__PURE__ */ new Date()).getTimezoneOffset(),t=Math.abs(Math.floor(e/60)),n=Math.abs(e%60).toString().padStart(2,`0`);return`${e>0?`-`:`+`}${t.toString().padStart(2,`0`)}${n}`}static createStashReflogEntry(t,n,r){let i=t.name.replace(/\s/g,``),a=Math.floor(Date.now()/1e3),o=e.timezoneOffsetForRefLogEntry;return`0000000000000000000000000000000000000000 ${n} ${i} ${t.email} ${a} ${o}\t${r}\n`}static getStashReflogEntry(e,t=!1){return e.split(`
91
91
  `).filter(e=>e).reverse().map((e,n)=>t?`stash@{${n}}: ${e.split(` `)[1]}`:e)}},vo=class e{constructor({fs:e,dir:t,gitdir:n=z(t,`.git`)}){Object.assign(this,{fs:e,dir:t,gitdir:n,_author:null})}static get refStash(){return`refs/stash`}static get refLogsStash(){return`logs/refs/stash`}get refStashPath(){return z(this.gitdir,e.refStash)}get refLogsStashPath(){return z(this.gitdir,e.refLogsStash)}async getAuthor(){if(!this._author&&(this._author=await pr({fs:this.fs,gitdir:this.gitdir,author:{}}),!this._author))throw new W(`author`);return this._author}async getStashSHA(e,t){return await this.fs.exists(this.refStashPath)?(t||await this.readStashReflogs({parsed:!1}))[e].split(` `)[1]:null}async writeStashCommit({message:e,tree:t,parent:n}){return go({fs:this.fs,gitdir:this.gitdir,commit:{message:e,tree:t,parent:n,author:await this.getAuthor(),committer:await this.getAuthor()}})}async readStashCommit(e){let t=await this.readStashReflogs({parsed:!1});if(e!==0&&(e<0||e>t.length-1))throw new ze(`stash@${e}`,`number that is in range of [0, num of stash pushed]`);let n=await this.getStashSHA(e,t);return n?gr({fs:this.fs,cache:{},gitdir:this.gitdir,oid:n}):{}}async writeStashRef(t){return V.writeRef({fs:this.fs,gitdir:this.gitdir,ref:e.refStash,value:t})}async writeStashReflogEntry({stashCommit:e,message:t}){let n=await this.getAuthor(),r=_o.createStashReflogEntry(n,e,t),i=this.refLogsStashPath;await F(i,async()=>{let e=await this.fs.exists(i)?await this.fs.read(i,`utf8`):``;await this.fs.write(i,e+r,`utf8`)})}async readStashReflogs({parsed:e=!1}){if(!await this.fs.exists(this.refLogsStashPath))return[];let t=await this.fs.read(this.refLogsStashPath,`utf8`);return _o.getStashReflogEntry(t,e)}};async function yo({fs:e,dir:t,gitdir:n,message:r=``}){let i=new vo({fs:e,dir:t,gitdir:n});await i.getAuthor();let a=await ei({fs:e,gitdir:n,fullname:!1}),o=await V.resolve({fs:e,gitdir:n,ref:`HEAD`}),s=(await $a({fs:e,dir:t,gitdir:n,oid:o})).commit.message,c=[o],l=null,u=q({ref:`HEAD`}),d=await qr({fs:e,dir:t,gitdir:n,treePair:[q({ref:`HEAD`}),`stage`]});if(d){let e=await i.writeStashCommit({message:`stash-Index: WIP on ${a} - ${(/* @__PURE__ */ new Date()).toISOString()}`,tree:d,parent:c});c.push(e),l=d,u=Le()}let f=await qr({fs:e,dir:t,gitdir:n,treePair:[u,`workdir`]});if(f){let e=await i.writeStashCommit({message:`stash-WorkDir: WIP on ${a} - ${(/* @__PURE__ */ new Date()).toISOString()}`,tree:f,parent:[c[c.length-1]]});c.push(e),l=f}if(!l||!d&&!f)throw new L(`changes, nothing to stash`);let p=(r.trim()||`WIP on ${a}`)+`: ${o.substring(0,7)} ${s}`;return{stashCommit:await i.writeStashCommit({message:p,tree:l,parent:c}),stashMsg:p,branch:a,stashMgr:i}}async function bo({fs:e,dir:t,gitdir:n,message:r=``}){let{stashCommit:i,stashMsg:a,branch:o,stashMgr:s}=await yo({fs:e,dir:t,gitdir:n,message:r});return await s.writeStashRef(i),await s.writeStashReflogEntry({stashCommit:i,message:a}),await zr({fs:e,dir:t,gitdir:n,ref:o,track:!1,force:!0}),i}async function xo({fs:e,dir:t,gitdir:n,message:r=``}){let{stashCommit:i}=await yo({fs:e,dir:t,gitdir:n,message:r});return i}async function So({fs:e,dir:t,gitdir:n,refIdx:r=0}){let i=await new vo({fs:e,dir:t,gitdir:n}).readStashCommit(r),{parent:a=null}=i.commit?i.commit:{};if(a&&Array.isArray(a))for(let r=0;r<a.length-1;r++){let i=(await gr({fs:e,cache:{},gitdir:n,oid:a[r+1]})).commit.message.startsWith(`stash-Index`);await Jr({fs:e,dir:t,gitdir:n,stashCommit:a[r+1],parentCommit:a[r],wasStaged:i})}}async function Co({fs:e,dir:t,gitdir:n,refIdx:r=0}){let i=new vo({fs:e,dir:t,gitdir:n});if(!(await i.readStashCommit(r)).commit)return;let a=i.refStashPath;await F(a,async()=>{await e.exists(a)&&await e.rm(a)});let o=await i.readStashReflogs({parsed:!1});if(!o.length)return;o.splice(r,1);let s=i.refLogsStashPath;await F(s,async()=>{if(o.length){await e.write(s,o.reverse().join(`
92
92
  `)+`
93
- `,`utf8`);let t=o[o.length-1].split(` `)[1];await i.writeStashRef(t)}else await e.rm(s)})}async function wo({fs:e,dir:t,gitdir:n}){return new vo({fs:e,dir:t,gitdir:n}).readStashReflogs({parsed:!0})}async function To({fs:e,dir:t,gitdir:n}){let r=new vo({fs:e,dir:t,gitdir:n}),i=[r.refStashPath,r.refLogsStashPath];await F(i,async()=>{await Promise.all(i.map(async t=>{if(await e.exists(t))return e.rm(t)}))})}async function Eo({fs:e,dir:t,gitdir:n,refIdx:r=0}){await So({fs:e,dir:t,gitdir:n,refIdx:r}),await Co({fs:e,dir:t,gitdir:n,refIdx:r})}async function Do({fs:e,dir:t,gitdir:n=z(t,`.git`),op:r=`push`,message:i=``,refIdx:a=0}){Y(`fs`,e),Y(`dir`,t),Y(`gitdir`,n),Y(`op`,r);let o={push:bo,apply:So,drop:Co,list:wo,clear:To,pop:Eo,create:xo},s=[`apply`,`drop`,`pop`];try{let c=new J(e),l=await X({fsp:c,dotgit:n});[`refs`,`logs`,`logs/refs`].map(e=>z(l,e)).forEach(async e=>{await c.exists(e)||await c.mkdir(e)});let u=o[r];if(u){if(s.includes(r)&&a<0)throw new ze(`stash@${a}`,`number that is in range of [0, num of stash pushed]`);return await u({fs:c,dir:t,gitdir:l,message:i,refIdx:a})}throw Error(`To be implemented: ${r}`)}catch(e){throw e.caller=`git.stash`,e}}async function Oo({fs:e,dir:t,gitdir:n=z(t,`.git`),filepath:r,cache:i={},refresh:a=!0}){try{Y(`fs`,e),Y(`gitdir`,n),Y(`filepath`,r);let o=new J(e),s=await X({fsp:o,dotgit:n}),c=await ko({fs:o,cache:i,gitdir:s,tree:await Ao({fs:o,cache:i,gitdir:s}),path:r}),l=await I.acquire({fs:o,gitdir:s,cache:i},async function(e){for(let t of e)if(t.path===r)return t;return null});if(c===null&&l===null&&await Qn.isIgnored({fs:o,gitdir:s,dir:t,filepath:r}))return`ignored`;let u=await o.lstat(z(t,r)),d=c!==null,f=l!==null,p=u!==null,m=async()=>{if(f&&!we(l,u))return l.oid;{let e=await(await B.get({fs:o,gitdir:s})).get(`core.autocrlf`),n=await o.read(z(t,r),{autocrlf:e}),c=await fo({gitdir:s,type:`blob`,object:n});return a&&f&&l.oid===c&&u.size!==-1&&I.acquire({fs:o,gitdir:s,cache:i},async function(e){e.insert({filepath:r,stats:u,oid:c})}),c}};if(!d&&!p&&!f)return`absent`;if(!d&&!p&&f)return`*absent`;if(!d&&p&&!f)return`*added`;if(!d&&p&&f)return await m()===l.oid?`added`:`*added`;if(d&&!p&&!f)return`deleted`;if(d&&!p&&f)return l.oid,`*deleted`;if(d&&p&&!f)return await m()===c?`*undeleted`:`*undeletemodified`;if(d&&p&&f){let e=await m();return e===c?e===l.oid?`unmodified`:`*unmodified`:e===l.oid?`modified`:`*modified`}}catch(e){throw e.caller=`git.status`,e}}async function ko({fs:e,cache:t,gitdir:n,tree:r,path:i}){typeof i==`string`&&(i=i.split(`/`));let a=i.shift();for(let o of r)if(o.path===a){if(i.length===0)return o.oid;let{type:r,object:a}=await U({fs:e,cache:t,gitdir:n,oid:o.oid});if(r===`tree`)return ko({fs:e,cache:t,gitdir:n,tree:H.from(a),path:i});if(r===`blob`)throw new R(o.oid,r,`blob`,i.join(`/`))}return null}async function Ao({fs:e,cache:t,gitdir:n}){let r;try{r=await V.resolve({fs:e,gitdir:n,ref:`HEAD`})}catch(e){if(e instanceof L)return[]}let{tree:i}=await Sr({fs:e,cache:t,gitdir:n,oid:r});return i}async function jo({fs:e,dir:t,gitdir:n=z(t,`.git`),ref:r=`HEAD`,filepaths:i=[`.`],filter:a,cache:o={},ignored:s=!1,refresh:c=!0}){try{Y(`fs`,e),Y(`gitdir`,n),Y(`ref`,r);let l=new J(e);return await Bn({fs:l,cache:o,dir:t,gitdir:await X({fsp:l,dotgit:n}),trees:[q({ref:r}),Fn({refresh:c}),Le()],map:async function(e,[n,r,o]){if(!n&&!o&&r&&!s&&await Qn.isIgnored({fs:l,dir:t,filepath:e})||!i.some(t=>Nr(e,t)))return null;if(a&&!a(e))return;let[c,u,d]=await Promise.all([n&&n.type(),r&&r.type(),o&&o.type()]),f=[c,u,d].includes(`blob`);if((c===`tree`||c===`special`)&&!f)return;if(c===`commit`)return null;if((u===`tree`||u===`special`)&&!f)return;if(d===`commit`)return null;if((d===`tree`||d===`special`)&&!f)return;let p=c===`blob`?await n.oid():void 0,m=d===`blob`?await o.oid():void 0,h;c!==`blob`&&u===`blob`&&d!==`blob`?h=`42`:u===`blob`&&(h=await r.oid());let g=[void 0,p,h,m],_=g.map(e=>g.indexOf(e));return _.shift(),[e,..._]}})}catch(e){throw e.caller=`git.statusMatrix`,e}}async function Mo({fs:e,dir:t,gitdir:n=z(t,`.git`),ref:r,object:i,force:a=!1}){try{Y(`fs`,e),Y(`gitdir`,n),Y(`ref`,r);let t=new J(e);if(r===void 0)throw new G(`ref`);r=r.startsWith(`refs/tags/`)?r:`refs/tags/${r}`;let o=await X({fsp:t,dotgit:n}),s=await V.resolve({fs:t,gitdir:o,ref:i||`HEAD`});if(!a&&await V.exists({fs:t,gitdir:o,ref:r}))throw new qt(`tag`,r);await V.writeRef({fs:t,gitdir:o,ref:r,value:s})}catch(e){throw e.caller=`git.tag`,e}}async function No({fs:e,dir:t,gitdir:n=z(t,`.git`),cache:r={},filepath:i,oid:a,mode:o,add:s,remove:c,force:l}){try{Y(`fs`,e),Y(`gitdir`,n),Y(`filepath`,i);let u=new J(e),d=await X({fsp:u,dotgit:n});if(c)return await I.acquire({fs:u,gitdir:d,cache:r},async function(e){if(!l){let e=await u.lstat(z(t,i));if(e){if(e.isDirectory())throw new on(`directory`);return}}e.has({filepath:i})&&e.delete({filepath:i})});let f;if(!a){if(f=await u.lstat(z(t,i)),!f)throw new L(`file at "${i}" on disk and "remove" not set`);if(f.isDirectory())throw new on(`directory`)}return await I.acquire({fs:u,gitdir:d,cache:r},async function(e){if(!s&&!e.has({filepath:i}))throw new L(`file at "${i}" in index and "add" not set`);let n;if(a)n={ctime:/* @__PURE__ */ new Date(0),mtime:/* @__PURE__ */ new Date(0),dev:0,ino:0,mode:o,uid:0,gid:0,size:0};else{n=f;let e=n.isSymbolicLink()?await u.readlink(z(t,i)):await u.read(z(t,i));a=await Z({fs:u,gitdir:d,type:`blob`,format:`content`,object:e})}return e.insert({filepath:i,oid:a,stats:n}),a})}catch(e){throw e.caller=`git.updateIndex`,e}}function Po(){try{return Ti.version}catch(e){throw e.caller=`git.version`,e}}async function Fo({fs:e,dir:t,gitdir:n=z(t,`.git`),trees:r,map:i,reduce:a,iterate:o,cache:s={}}){try{Y(`fs`,e),Y(`gitdir`,n),Y(`trees`,r);let c=new J(e);return await Bn({fs:c,cache:s,dir:t,gitdir:await X({fsp:c,dotgit:n}),trees:r,map:i,reduce:a,iterate:o})}catch(e){throw e.caller=`git.walk`,e}}async function Io({fs:e,dir:t,gitdir:n=z(t,`.git`),blob:r}){try{Y(`fs`,e),Y(`gitdir`,n),Y(`blob`,r);let t=new J(e);return await Z({fs:t,gitdir:await X({fsp:t,dotgit:n}),type:`blob`,object:r,format:`content`})}catch(e){throw e.caller=`git.writeBlob`,e}}async function Lo({fs:e,dir:t,gitdir:n=z(t,`.git`),commit:r}){try{Y(`fs`,e),Y(`gitdir`,n),Y(`commit`,r);let t=new J(e);return await go({fs:t,gitdir:await X({fsp:t,dotgit:n}),commit:r})}catch(e){throw e.caller=`git.writeCommit`,e}}async function Ro({fs:e,dir:t,gitdir:n=z(t,`.git`),type:r,object:i,format:a=`parsed`,oid:o,encoding:s=void 0}){try{let t=new J(e),c=await X({fsp:t,dotgit:n});if(a===`parsed`){switch(r){case`commit`:i=jn.from(i).toObject();break;case`tree`:i=H.from(i).toObject();break;case`blob`:i=D.Buffer.from(i,s);break;case`tag`:i=K.from(i).toObject();break;default:throw new R(o||``,r,`blob|commit|tag|tree`)}a=`content`}return o=await Z({fs:t,gitdir:c,type:r,object:i,oid:o,format:a}),o}catch(e){throw e.caller=`git.writeObject`,e}}async function zo({fs:e,dir:t,gitdir:n=z(t,`.git`),ref:r,value:i,force:a=!1,symbolic:o=!1}){try{Y(`fs`,e),Y(`gitdir`,n),Y(`ref`,r),Y(`value`,i);let t=new J(e);if(!Ke(r,!0))throw new ze(r,A.default.clean(r));let s=await X({fsp:t,dotgit:n});if(!a&&await V.exists({fs:t,gitdir:s,ref:r}))throw new qt(`ref`,r);o?await V.writeSymbolicRef({fs:t,gitdir:s,ref:r,value:i}):(i=await V.resolve({fs:t,gitdir:s,ref:i}),await V.writeRef({fs:t,gitdir:s,ref:r,value:i}))}catch(e){throw e.caller=`git.writeRef`,e}}async function Bo({fs:e,gitdir:t,tag:n}){return await Z({fs:e,gitdir:t,type:`tag`,object:K.from(n).toObject(),format:`content`})}async function Vo({fs:e,dir:t,gitdir:n=z(t,`.git`),tag:r}){try{Y(`fs`,e),Y(`gitdir`,n),Y(`tag`,r);let t=new J(e);return await Bo({fs:t,gitdir:await X({fsp:t,dotgit:n}),tag:r})}catch(e){throw e.caller=`git.writeTag`,e}}async function Ho({fs:e,dir:t,gitdir:n=z(t,`.git`),tree:r}){try{Y(`fs`,e),Y(`gitdir`,n),Y(`tree`,r);let t=new J(e);return await Cr({fs:t,gitdir:await X({fsp:t,dotgit:n}),tree:r})}catch(e){throw e.caller=`git.writeTree`,e}}var Uo={Errors:bn,STAGE:Le,TREE:q,WORKDIR:Fn,add:ar,abortMerge:Zn,addNote:Tr,addRemote:Dr,annotatedTag:kr,branch:jr,cherryPick:Zr,checkout:zr,clone:Fi,commit:Ii,getConfig:ia,getConfigAll:oa,setConfig:ho,currentBranch:Li,deleteBranch:zi,deleteRef:Bi,deleteRemote:Hi,deleteTag:Wi,expandOid:Ji,expandRef:Yi,fastForward:$i,fetch:ea,findMergeBase:ta,findRoot:ra,getRemoteInfo:ca,getRemoteInfo2:ua,hashBlob:fa,indexPack:ma,init:ha,isDescendent:_a,isIgnored:va,listBranches:ya,listFiles:Sa,listNotes:wa,listRefs:Ta,listRemotes:Da,listServerRefs:Aa,listTags:ja,log:La,merge:Ra,packObjects:Ha,pull:Ua,push:Ya,readBlob:Qa,readCommit:$a,readNote:to,readObject:no,readTag:io,readTree:ao,remove:oo,removeNote:co,renameBranch:uo,resetIndex:po,updateIndex:No,resolveRef:mo,status:Oo,statusMatrix:jo,tag:Mo,version:Po,walk:Fo,writeBlob:Io,writeCommit:Lo,writeObject:Ro,writeRef:zo,writeTag:Vo,writeTree:Ho,stash:Do};globalThis.Buffer||(globalThis.Buffer=D.Buffer);function Wo(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 Go={async request({url:e,method:t=`GET`,headers:n={},body:r}){r&&=await Ko(r);let i=Wo(e),a={method:t,headers:n,body:r,credentials:`omit`};i&&(a.targetAddressSpace=i);let o=await fetch(e,a),s=o.body&&typeof o.body.getReader==`function`?qo(o.body):[new Uint8Array(await o.arrayBuffer())],c={};for(let[e,t]of o.headers.entries())c[e]=t;return{url:o.url,method:t,statusCode:o.status,statusMessage:o.statusText,body:s,headers:c}}};async function Ko(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 qo(e){let t=e.getReader();return{next(){return t.read()},return(){return t.releaseLock(),{}},[Symbol.asyncIterator](){return this}}}let Jo=null,Yo=null,Xo=null,Zo=null,Qo=null;function $o(e){return e.trim().replace(/^[\\/]+/,``).replace(/[\\/]+$/,``).split(/[\\/]+/).filter(e=>e!==`.`&&e!==``).join(`/`)}const es=new class{_map=/* @__PURE__ */ 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 ts(e,t,n={},r=``){let i=e,a=r;for(let e of t){a=a?`${a}/${e}`:e;let t=es.get(a);t&&!n.create?i=t:(i=await i.getDirectoryHandle(e,{create:n.create??!1}),es.set(a,i))}return i}async function ns(e,t,n={}){let r=$o(t),i=r.split(`/`).filter(Boolean);if(i.length===0)return e;let a=await ts(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 es.set(t,e),e}catch{return await a.getFileHandle(o,{create:n.create??!1})}}async function rs(e,t,n={}){let r=$o(t).split(`/`).filter(Boolean);return r.length===0?e:ts(e,r,n)}async function is(e,t,n={}){let r=$o(t).split(`/`).filter(Boolean);if(r.length===0)throw Error(`Cannot resolve '.' as file`);return(await ts(e,r.slice(0,-1),n)).getFileHandle(r[r.length-1],{create:n.create??!1})}async function as(e,t){let n=$o(t).split(`/`).filter(Boolean);if(n.length===0)throw Error(`Cannot get parent of root`);let r=n[n.length-1];return[await ts(e,n.slice(0,-1)),r]}function os(e){return e.trim().replace(/\\/g,`/`).replace(/^\/+/,``).replace(/^\.\//,``)}function ss(e){let t=/* @__PURE__ */ new Map,n=`repos/.git-modes`;function r(e){return e.replace(/\\/g,`/`.replace(/^\/+/,``))}async function i(){try{let r=await(await(await is(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 is(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 is(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 is(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);t.set(l,e?33261:33188),o()}else t.has(l)||t.set(l,33188)},async mkdir(t){await rs(e,t,{create:!0})},async rmdir(n){let[i,a]=await as(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);es.invalidate($o(n))},async readdir(t){let n=await rs(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 ns(e,n)}catch{let e=/* @__PURE__ */ Error(`ENOENT: no such file or directory, stat '${n}'`);throw e.code=`ENOENT`,e}if(i.kind===`directory`){let e=/* @__PURE__ */ 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}}{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 as(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 cs=ss,ls=`repos`;function us(e,t,i){if(e===`custom`&&t)return t;if(e===`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}//${r}:${n}/git-proxy`}async function ds(){return Qo||=(async()=>{if(Jo=Uo,Yo=Go,!Xo){let e=null;if(typeof navigator<`u`&&typeof navigator.storage?.getDirectory==`function`)try{e=await navigator.storage.getDirectory()}catch(e){console.warn(`OPFS is unavailable for git root, falling back to memory:`,e)}if(!e){let{getMemoryOpfsRoot:t}=await import(`./memoryStorage-DjPNAT5t.js`).then(e=>e.n);e=t()}Xo=ss(e),Zo=Xo.promises}})(),await Qo,{git:Jo,http:Yo,fs:Xo,pfs:Zo}}async function $(e){let t=await ds();if(e){let n=ss(e);return{git:t.git,http:t.http,fs:n,pfs:n.promises,repoDirFn:e=>`repos/${e}`}}return{...t,repoDirFn:ps}}function fs(e){return(e.replace(/\/+$/,``).split(`/`).pop()||`repo`).replace(/\.git$/,``)}function ps(e){return`${ls}/${e}`}async function ms(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 hs(e,t){try{await e.mkdir(t)}catch{}}function gs({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 _s({url:e,branch:t,depth:n=20,corsProxy:r,name:i,token:o,username:s,password:c,groupRoot:l}){let{git:u,http:d,fs:f,pfs:p,repoDirFn:m}=await $(l),h=i||fs(e),g=m(h);!r&&!a()&&(r=us(`local`)),await hs(p,ls),await hs(p,g);let _=gs({token:o,username:s,password:c});try{let i={fs:f,http:d,dir:g,url:e,singleBranch:!0,depth:n,corsProxy:r,..._};t&&(i.ref=t),await u.clone(i)}catch{try{let i={fs:f,http:d,dir:g,url:e,singleBranch:!0,depth:n,corsProxy:r,..._};t&&(i.ref=t),await u.fetch(i)}catch{try{await Rs(p,g),await hs(p,g);let i={fs:f,http:d,dir:g,url:e,singleBranch:!0,depth:n,corsProxy:r,..._};t&&(i.ref=t),await u.clone(i)}catch(t){throw Error(`Failed to clone/fetch ${e}: ${t instanceof Error?t.message:String(t)}`)}}}return await ms(u,f,g),h}async function vs({repo:e,ref:t,groupRoot:n}){let{git:r,fs:i,repoDirFn:a}=await $(n),o=a(e);return await r.checkout({fs:i,dir:o,ref:t,force:!0}),`Checked out ${t} in ${e}`}async function ys({repo:e,name:t,checkout:n=!1,startPoint:r,groupRoot:i}){let{git:a,fs:o,repoDirFn:s}=await $(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 bs({repo:e,groupRoot:t}){let{git:n,fs:r,repoDirFn:i}=await $(t),a=i(e);await ms(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(`
93
+ `,`utf8`);let t=o[o.length-1].split(` `)[1];await i.writeStashRef(t)}else await e.rm(s)})}async function wo({fs:e,dir:t,gitdir:n}){return new vo({fs:e,dir:t,gitdir:n}).readStashReflogs({parsed:!0})}async function To({fs:e,dir:t,gitdir:n}){let r=new vo({fs:e,dir:t,gitdir:n}),i=[r.refStashPath,r.refLogsStashPath];await F(i,async()=>{await Promise.all(i.map(async t=>{if(await e.exists(t))return e.rm(t)}))})}async function Eo({fs:e,dir:t,gitdir:n,refIdx:r=0}){await So({fs:e,dir:t,gitdir:n,refIdx:r}),await Co({fs:e,dir:t,gitdir:n,refIdx:r})}async function Do({fs:e,dir:t,gitdir:n=z(t,`.git`),op:r=`push`,message:i=``,refIdx:a=0}){Y(`fs`,e),Y(`dir`,t),Y(`gitdir`,n),Y(`op`,r);let o={push:bo,apply:So,drop:Co,list:wo,clear:To,pop:Eo,create:xo},s=[`apply`,`drop`,`pop`];try{let c=new J(e),l=await X({fsp:c,dotgit:n});[`refs`,`logs`,`logs/refs`].map(e=>z(l,e)).forEach(async e=>{await c.exists(e)||await c.mkdir(e)});let u=o[r];if(u){if(s.includes(r)&&a<0)throw new ze(`stash@${a}`,`number that is in range of [0, num of stash pushed]`);return await u({fs:c,dir:t,gitdir:l,message:i,refIdx:a})}throw Error(`To be implemented: ${r}`)}catch(e){throw e.caller=`git.stash`,e}}async function Oo({fs:e,dir:t,gitdir:n=z(t,`.git`),filepath:r,cache:i={},refresh:a=!0}){try{Y(`fs`,e),Y(`gitdir`,n),Y(`filepath`,r);let o=new J(e),s=await X({fsp:o,dotgit:n}),c=await ko({fs:o,cache:i,gitdir:s,tree:await Ao({fs:o,cache:i,gitdir:s}),path:r}),l=await I.acquire({fs:o,gitdir:s,cache:i},async function(e){for(let t of e)if(t.path===r)return t;return null});if(c===null&&l===null&&await Qn.isIgnored({fs:o,gitdir:s,dir:t,filepath:r}))return`ignored`;let u=await o.lstat(z(t,r)),d=c!==null,f=l!==null,p=u!==null,m=async()=>{if(f&&!we(l,u))return l.oid;{let e=await(await B.get({fs:o,gitdir:s})).get(`core.autocrlf`),n=await o.read(z(t,r),{autocrlf:e}),c=await fo({gitdir:s,type:`blob`,object:n});return a&&f&&l.oid===c&&u.size!==-1&&I.acquire({fs:o,gitdir:s,cache:i},async function(e){e.insert({filepath:r,stats:u,oid:c})}),c}};if(!d&&!p&&!f)return`absent`;if(!d&&!p&&f)return`*absent`;if(!d&&p&&!f)return`*added`;if(!d&&p&&f)return await m()===l.oid?`added`:`*added`;if(d&&!p&&!f)return`deleted`;if(d&&!p&&f)return l.oid,`*deleted`;if(d&&p&&!f)return await m()===c?`*undeleted`:`*undeletemodified`;if(d&&p&&f){let e=await m();return e===c?e===l.oid?`unmodified`:`*unmodified`:e===l.oid?`modified`:`*modified`}}catch(e){throw e.caller=`git.status`,e}}async function ko({fs:e,cache:t,gitdir:n,tree:r,path:i}){typeof i==`string`&&(i=i.split(`/`));let a=i.shift();for(let o of r)if(o.path===a){if(i.length===0)return o.oid;let{type:r,object:a}=await U({fs:e,cache:t,gitdir:n,oid:o.oid});if(r===`tree`)return ko({fs:e,cache:t,gitdir:n,tree:H.from(a),path:i});if(r===`blob`)throw new R(o.oid,r,`blob`,i.join(`/`))}return null}async function Ao({fs:e,cache:t,gitdir:n}){let r;try{r=await V.resolve({fs:e,gitdir:n,ref:`HEAD`})}catch(e){if(e instanceof L)return[]}let{tree:i}=await Sr({fs:e,cache:t,gitdir:n,oid:r});return i}async function jo({fs:e,dir:t,gitdir:n=z(t,`.git`),ref:r=`HEAD`,filepaths:i=[`.`],filter:a,cache:o={},ignored:s=!1,refresh:c=!0}){try{Y(`fs`,e),Y(`gitdir`,n),Y(`ref`,r);let l=new J(e);return await Bn({fs:l,cache:o,dir:t,gitdir:await X({fsp:l,dotgit:n}),trees:[q({ref:r}),Fn({refresh:c}),Le()],map:async function(e,[n,r,o]){if(!n&&!o&&r&&!s&&await Qn.isIgnored({fs:l,dir:t,filepath:e})||!i.some(t=>Nr(e,t)))return null;if(a&&!a(e))return;let[c,u,d]=await Promise.all([n&&n.type(),r&&r.type(),o&&o.type()]),f=[c,u,d].includes(`blob`);if((c===`tree`||c===`special`)&&!f)return;if(c===`commit`)return null;if((u===`tree`||u===`special`)&&!f)return;if(d===`commit`)return null;if((d===`tree`||d===`special`)&&!f)return;let p=c===`blob`?await n.oid():void 0,m=d===`blob`?await o.oid():void 0,h;c!==`blob`&&u===`blob`&&d!==`blob`?h=`42`:u===`blob`&&(h=await r.oid());let g=[void 0,p,h,m],_=g.map(e=>g.indexOf(e));return _.shift(),[e,..._]}})}catch(e){throw e.caller=`git.statusMatrix`,e}}async function Mo({fs:e,dir:t,gitdir:n=z(t,`.git`),ref:r,object:i,force:a=!1}){try{Y(`fs`,e),Y(`gitdir`,n),Y(`ref`,r);let t=new J(e);if(r===void 0)throw new G(`ref`);r=r.startsWith(`refs/tags/`)?r:`refs/tags/${r}`;let o=await X({fsp:t,dotgit:n}),s=await V.resolve({fs:t,gitdir:o,ref:i||`HEAD`});if(!a&&await V.exists({fs:t,gitdir:o,ref:r}))throw new qt(`tag`,r);await V.writeRef({fs:t,gitdir:o,ref:r,value:s})}catch(e){throw e.caller=`git.tag`,e}}async function No({fs:e,dir:t,gitdir:n=z(t,`.git`),cache:r={},filepath:i,oid:a,mode:o,add:s,remove:c,force:l}){try{Y(`fs`,e),Y(`gitdir`,n),Y(`filepath`,i);let u=new J(e),d=await X({fsp:u,dotgit:n});if(c)return await I.acquire({fs:u,gitdir:d,cache:r},async function(e){if(!l){let e=await u.lstat(z(t,i));if(e){if(e.isDirectory())throw new on(`directory`);return}}e.has({filepath:i})&&e.delete({filepath:i})});let f;if(!a){if(f=await u.lstat(z(t,i)),!f)throw new L(`file at "${i}" on disk and "remove" not set`);if(f.isDirectory())throw new on(`directory`)}return await I.acquire({fs:u,gitdir:d,cache:r},async function(e){if(!s&&!e.has({filepath:i}))throw new L(`file at "${i}" in index and "add" not set`);let n;if(a)n={ctime:/* @__PURE__ */ new Date(0),mtime:/* @__PURE__ */ new Date(0),dev:0,ino:0,mode:o,uid:0,gid:0,size:0};else{n=f;let e=n.isSymbolicLink()?await u.readlink(z(t,i)):await u.read(z(t,i));a=await Z({fs:u,gitdir:d,type:`blob`,format:`content`,object:e})}return e.insert({filepath:i,oid:a,stats:n}),a})}catch(e){throw e.caller=`git.updateIndex`,e}}function Po(){try{return Ti.version}catch(e){throw e.caller=`git.version`,e}}async function Fo({fs:e,dir:t,gitdir:n=z(t,`.git`),trees:r,map:i,reduce:a,iterate:o,cache:s={}}){try{Y(`fs`,e),Y(`gitdir`,n),Y(`trees`,r);let c=new J(e);return await Bn({fs:c,cache:s,dir:t,gitdir:await X({fsp:c,dotgit:n}),trees:r,map:i,reduce:a,iterate:o})}catch(e){throw e.caller=`git.walk`,e}}async function Io({fs:e,dir:t,gitdir:n=z(t,`.git`),blob:r}){try{Y(`fs`,e),Y(`gitdir`,n),Y(`blob`,r);let t=new J(e);return await Z({fs:t,gitdir:await X({fsp:t,dotgit:n}),type:`blob`,object:r,format:`content`})}catch(e){throw e.caller=`git.writeBlob`,e}}async function Lo({fs:e,dir:t,gitdir:n=z(t,`.git`),commit:r}){try{Y(`fs`,e),Y(`gitdir`,n),Y(`commit`,r);let t=new J(e);return await go({fs:t,gitdir:await X({fsp:t,dotgit:n}),commit:r})}catch(e){throw e.caller=`git.writeCommit`,e}}async function Ro({fs:e,dir:t,gitdir:n=z(t,`.git`),type:r,object:i,format:a=`parsed`,oid:o,encoding:s=void 0}){try{let t=new J(e),c=await X({fsp:t,dotgit:n});if(a===`parsed`){switch(r){case`commit`:i=jn.from(i).toObject();break;case`tree`:i=H.from(i).toObject();break;case`blob`:i=D.Buffer.from(i,s);break;case`tag`:i=K.from(i).toObject();break;default:throw new R(o||``,r,`blob|commit|tag|tree`)}a=`content`}return o=await Z({fs:t,gitdir:c,type:r,object:i,oid:o,format:a}),o}catch(e){throw e.caller=`git.writeObject`,e}}async function zo({fs:e,dir:t,gitdir:n=z(t,`.git`),ref:r,value:i,force:a=!1,symbolic:o=!1}){try{Y(`fs`,e),Y(`gitdir`,n),Y(`ref`,r),Y(`value`,i);let t=new J(e);if(!Ke(r,!0))throw new ze(r,A.default.clean(r));let s=await X({fsp:t,dotgit:n});if(!a&&await V.exists({fs:t,gitdir:s,ref:r}))throw new qt(`ref`,r);o?await V.writeSymbolicRef({fs:t,gitdir:s,ref:r,value:i}):(i=await V.resolve({fs:t,gitdir:s,ref:i}),await V.writeRef({fs:t,gitdir:s,ref:r,value:i}))}catch(e){throw e.caller=`git.writeRef`,e}}async function Bo({fs:e,gitdir:t,tag:n}){return await Z({fs:e,gitdir:t,type:`tag`,object:K.from(n).toObject(),format:`content`})}async function Vo({fs:e,dir:t,gitdir:n=z(t,`.git`),tag:r}){try{Y(`fs`,e),Y(`gitdir`,n),Y(`tag`,r);let t=new J(e);return await Bo({fs:t,gitdir:await X({fsp:t,dotgit:n}),tag:r})}catch(e){throw e.caller=`git.writeTag`,e}}async function Ho({fs:e,dir:t,gitdir:n=z(t,`.git`),tree:r}){try{Y(`fs`,e),Y(`gitdir`,n),Y(`tree`,r);let t=new J(e);return await Cr({fs:t,gitdir:await X({fsp:t,dotgit:n}),tree:r})}catch(e){throw e.caller=`git.writeTree`,e}}var Uo={Errors:bn,STAGE:Le,TREE:q,WORKDIR:Fn,add:ar,abortMerge:Zn,addNote:Tr,addRemote:Dr,annotatedTag:kr,branch:jr,cherryPick:Zr,checkout:zr,clone:Fi,commit:Ii,getConfig:ia,getConfigAll:oa,setConfig:ho,currentBranch:Li,deleteBranch:zi,deleteRef:Bi,deleteRemote:Hi,deleteTag:Wi,expandOid:Ji,expandRef:Yi,fastForward:$i,fetch:ea,findMergeBase:ta,findRoot:ra,getRemoteInfo:ca,getRemoteInfo2:ua,hashBlob:fa,indexPack:ma,init:ha,isDescendent:_a,isIgnored:va,listBranches:ya,listFiles:Sa,listNotes:wa,listRefs:Ta,listRemotes:Da,listServerRefs:Aa,listTags:ja,log:La,merge:Ra,packObjects:Ha,pull:Ua,push:Ya,readBlob:Qa,readCommit:$a,readNote:to,readObject:no,readTag:io,readTree:ao,remove:oo,removeNote:co,renameBranch:uo,resetIndex:po,updateIndex:No,resolveRef:mo,status:Oo,statusMatrix:jo,tag:Mo,version:Po,walk:Fo,writeBlob:Io,writeCommit:Lo,writeObject:Ro,writeRef:zo,writeTag:Vo,writeTree:Ho,stash:Do};globalThis.Buffer||(globalThis.Buffer=D.Buffer);function Wo(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 Go={async request({url:e,method:t=`GET`,headers:n={},body:r}){r&&=await Ko(r);let i=Wo(e),a={method:t,headers:n,body:r,credentials:`omit`};i&&(a.targetAddressSpace=i);let o=await fetch(e,a),s=o.body&&typeof o.body.getReader==`function`?qo(o.body):[new Uint8Array(await o.arrayBuffer())],c={};for(let[e,t]of o.headers.entries())c[e]=t;return{url:o.url,method:t,statusCode:o.status,statusMessage:o.statusText,body:s,headers:c}}};async function Ko(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 qo(e){let t=e.getReader();return{next(){return t.read()},return(){return t.releaseLock(),{}},[Symbol.asyncIterator](){return this}}}let Jo=null,Yo=null,Xo=null,Zo=null,Qo=null;function $o(e){return e.trim().replace(/^[\\/]+/,``).replace(/[\\/]+$/,``).split(/[\\/]+/).filter(e=>e!==`.`&&e!==``).join(`/`)}const es=new class{_map=/* @__PURE__ */ 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 ts(e,t,n={},r=``){let i=e,a=r;for(let e of t){a=a?`${a}/${e}`:e;let t=es.get(a);t&&!n.create?i=t:(i=await i.getDirectoryHandle(e,{create:n.create??!1}),es.set(a,i))}return i}async function ns(e,t,n={}){let r=$o(t),i=r.split(`/`).filter(Boolean);if(i.length===0)return e;let a=await ts(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 es.set(t,e),e}catch{return await a.getFileHandle(o,{create:n.create??!1})}}async function rs(e,t,n={}){let r=$o(t).split(`/`).filter(Boolean);return r.length===0?e:ts(e,r,n)}async function is(e,t,n={}){let r=$o(t).split(`/`).filter(Boolean);if(r.length===0)throw Error(`Cannot resolve '.' as file`);return(await ts(e,r.slice(0,-1),n)).getFileHandle(r[r.length-1],{create:n.create??!1})}async function as(e,t){let n=$o(t).split(`/`).filter(Boolean);if(n.length===0)throw Error(`Cannot get parent of root`);let r=n[n.length-1];return[await ts(e,n.slice(0,-1)),r]}function os(e){return e.trim().replace(/\\/g,`/`).replace(/^\/+/,``).replace(/^\.\//,``)}function ss(e){let t=/* @__PURE__ */ new Map,n=`repos/.git-modes`;function r(e){return e.replace(/\\/g,`/`.replace(/^\/+/,``))}async function i(){try{let r=await(await(await is(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 is(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 is(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 is(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);t.set(l,e?33261:33188),o()}else t.has(l)||t.set(l,33188)},async mkdir(t){await rs(e,t,{create:!0})},async rmdir(n){let[i,a]=await as(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);es.invalidate($o(n))},async readdir(t){let n=await rs(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 ns(e,n)}catch{let e=/* @__PURE__ */ Error(`ENOENT: no such file or directory, stat '${n}'`);throw e.code=`ENOENT`,e}if(i.kind===`directory`){let e=/* @__PURE__ */ 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}}{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 as(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 cs=ss,ls=`repos`;function us(e,t,i){if(e===`custom`&&t)return t;if(e===`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}//${r}:${n}/git-proxy`}async function ds(){return Qo||=(async()=>{if(Jo=Uo,Yo=Go,!Xo){let e=null;if(typeof navigator<`u`&&typeof navigator.storage?.getDirectory==`function`)try{e=await navigator.storage.getDirectory()}catch(e){console.warn(`OPFS is unavailable for git root, falling back to memory:`,e)}if(!e){let{getMemoryOpfsRoot:t}=await import(`./memoryStorage-C-ao9y-j.js`).then(e=>e.n);e=t()}Xo=ss(e),Zo=Xo.promises}})(),await Qo,{git:Jo,http:Yo,fs:Xo,pfs:Zo}}async function $(e){let t=await ds();if(e){let n=ss(e);return{git:t.git,http:t.http,fs:n,pfs:n.promises,repoDirFn:e=>`repos/${e}`}}return{...t,repoDirFn:ps}}function fs(e){return(e.replace(/\/+$/,``).split(`/`).pop()||`repo`).replace(/\.git$/,``)}function ps(e){return`${ls}/${e}`}async function ms(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 hs(e,t){try{await e.mkdir(t)}catch{}}function gs({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 _s({url:e,branch:t,depth:n=20,corsProxy:r,name:i,token:o,username:s,password:c,groupRoot:l}){let{git:u,http:d,fs:f,pfs:p,repoDirFn:m}=await $(l),h=i||fs(e),g=m(h);!r&&!a()&&(r=us(`local`)),await hs(p,ls),await hs(p,g);let _=gs({token:o,username:s,password:c});try{let i={fs:f,http:d,dir:g,url:e,singleBranch:!0,depth:n,corsProxy:r,..._};t&&(i.ref=t),await u.clone(i)}catch{try{let i={fs:f,http:d,dir:g,url:e,singleBranch:!0,depth:n,corsProxy:r,..._};t&&(i.ref=t),await u.fetch(i)}catch{try{await Rs(p,g),await hs(p,g);let i={fs:f,http:d,dir:g,url:e,singleBranch:!0,depth:n,corsProxy:r,..._};t&&(i.ref=t),await u.clone(i)}catch(t){throw Error(`Failed to clone/fetch ${e}: ${t instanceof Error?t.message:String(t)}`)}}}return await ms(u,f,g),h}async function vs({repo:e,ref:t,groupRoot:n}){let{git:r,fs:i,repoDirFn:a}=await $(n),o=a(e);return await r.checkout({fs:i,dir:o,ref:t,force:!0}),`Checked out ${t} in ${e}`}async function ys({repo:e,name:t,checkout:n=!1,startPoint:r,groupRoot:i}){let{git:a,fs:o,repoDirFn:s}=await $(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 bs({repo:e,groupRoot:t}){let{git:n,fs:r,repoDirFn:i}=await $(t),a=i(e);await ms(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(`
94
94
  `)}`}async function xs({repo:e,ref:t,depth:n=10,groupRoot:r}){let{git:i,fs:a,repoDirFn:o}=await $(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=(/* @__PURE__ */ new Date(t.author.timestamp*1e3)).toISOString();return`${e.oid} ${n} ${t.author.name} — ${t.message.trim().split(`
95
95
  `)[0]}`}).join(`
96
96
  `)}async function Ss({repo:e,ref1:t,ref2:n,groupRoot:r}){let{git:i,fs:a,repoDirFn:o}=await $(r),s=o(e),c=a.promises;if(await ms(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 ws(c,s,n)).split(`
@@ -1,4 +1,4 @@
1
- <!doctype html><html lang="en"><head><title>ShadowClaw</title><meta charset="utf-8"><meta name="revision" content="62dc4114af024c80ff58ee6b715e11c6d423d047" /><meta name="version" content="1.51.0" /><meta name="viewport" content="width=device-width,initial-scale=1,viewport-fit=cover"><meta name="description" content="ShadowClaw - multi-runtime AI assistant." /><link rel="canonical" href="https://xt-ml.github.io/shadow-claw/"><meta property="og:title" content="ShadowClaw"><meta property="og:description" content="Multi-runtime AI assistant with local and remote LLM orchestration, Web Workers, OPFS storage, and agentic tool execution."><meta property="og:type" content="website"><meta property="og:url" content="https://xt-ml.github.io/shadow-claw/"><meta property="og:image" content="https://xt-ml.github.io/shadow-claw/assets/icons/512.png"><meta name="twitter:card" content="summary"><meta name="twitter:title" content="ShadowClaw"><meta name="twitter:description" content="Multi-runtime AI assistant with local and remote LLM orchestration, Web Workers, OPFS storage, and agentic tool execution."><meta name="twitter:image" content="https://xt-ml.github.io/shadow-claw/assets/icons/512.png"><script type="application/ld+json">{"@context":"https://schema.org","@graph":[{"@type":"SoftwareApplication","@id":"https://xt-ml.github.io/shadow-claw/#software","name":"ShadowClaw","description":"Multi-runtime AI assistant with local and remote LLM orchestration, Web Workers, OPFS storage, and agentic tool execution.","url":"https://xt-ml.github.io/shadow-claw/","applicationCategory":"DeveloperApplication","operatingSystem":"Web, Browser, Desktop","offers":{"@type":"Offer","price":"0","priceCurrency":"USD"},"author":{"@type":"Organization","name":"xt-ml","url":"https://github.com/xt-ml"},"codeRepository":"https://github.com/xt-ml/shadow-claw","license":"https://github.com/xt-ml/shadow-claw/blob/main/LICENSE"},{"@type":"WebSite","@id":"https://xt-ml.github.io/shadow-claw/#website","url":"https://xt-ml.github.io/shadow-claw/","name":"ShadowClaw","description":"Official website and live deployment of ShadowClaw multi-runtime AI assistant.","publisher":{"@type":"Organization","name":"xt-ml","url":"https://github.com/xt-ml"}},{"@type":"Organization","@id":"https://xt-ml.github.io/shadow-claw/#organization","name":"xt-ml","url":"https://github.com/xt-ml","sameAs":["https://github.com/xt-ml"]}]}</script><meta name="theme-color" content="#fff" /><meta http-equiv="origin-trial" content="A88uTgESYWcVgREKVReKB6jom41uP8TzW6ei3jNdidf+Xl6ONqKRjKNBphsxhrZmdkakLK3oXDgkGq53rtZYSAMAAAB2eyJvcmlnaW4iOiJodHRwczovL3h0LW1sLmdpdGh1Yi5pbzo0NDMiLCJmZWF0dXJlIjoiV2ViTUNQIiwiZXhwaXJ5IjoxNzk0ODczNjAwLCJpc1N1YmRvbWFpbiI6dHJ1ZSwiaXNUaGlyZFBhcnR5Ijp0cnVlfQ=="><base href="/shadow-claw/" /><script id="shadow-claw-site-config" type="application/json">{"$schema":"https:\u002f\u002fjson-schema.org\u002fdraft\u002f2020-12\u002fschema","site":{"title":"ShadowClaw","description":"ShadowClaw - multi-runtime AI assistant.","themeColor":"#fff"},"branding":{"siteUrl":"https:\u002f\u002fxt-ml.github.io\u002fshadow-claw\u002f","faviconPath":"assets\u002ficons\u002ffavicon.ico","appleTouchIconPath":"assets\u002ficons\u002f180.png","notFoundPath":"404.html"},"pwa":{"manifestPath":"manifest.json","themeColor":"#000000"},"assets":["assets"],"sidebar":{"pagesHidden":false,"chatHidden":false,"tasksHidden":false,"filesHidden":false,"defaultPage":"pages"},"pages":{"allowList":[],"denyList":[]},"settings":{"defaultToolsProfile":"__builtin_default"},"agent":{"defaultProvider":"transformers_js_local","defaultModel":"onnx-community\u002fgemma-4-E2B-it-ONNX"},"customElements":{"allowedElements":["block-garden","block-garden-option","block-garden-select"],"allowedDomains":["kherrick.github.io","cdn.jsdelivr.net"]},"security":{"connectSrc":["'self'","blob:","data:","https:\u002f\u002fkherrick.github.io","https:\u002f\u002fcdn.jsdelivr.net"]}}</script>
1
+ <!doctype html><html lang="en"><head><title>ShadowClaw</title><meta charset="utf-8"><meta name="revision" content="6cdfc4a8fa48baa09fb18801514bb2a1109a9c61" /><meta name="version" content="1.52.0" /><meta name="viewport" content="width=device-width,initial-scale=1,viewport-fit=cover"><meta name="description" content="ShadowClaw - multi-runtime AI assistant." /><link rel="canonical" href="https://xt-ml.github.io/shadow-claw/"><meta property="og:title" content="ShadowClaw"><meta property="og:description" content="Multi-runtime AI assistant with local and remote LLM orchestration, Web Workers, OPFS storage, and agentic tool execution."><meta property="og:type" content="website"><meta property="og:url" content="https://xt-ml.github.io/shadow-claw/"><meta property="og:image" content="https://xt-ml.github.io/shadow-claw/assets/icons/512.png"><meta name="twitter:card" content="summary"><meta name="twitter:title" content="ShadowClaw"><meta name="twitter:description" content="Multi-runtime AI assistant with local and remote LLM orchestration, Web Workers, OPFS storage, and agentic tool execution."><meta name="twitter:image" content="https://xt-ml.github.io/shadow-claw/assets/icons/512.png"><script type="application/ld+json">{"@context":"https://schema.org","@graph":[{"@type":"SoftwareApplication","@id":"https://xt-ml.github.io/shadow-claw/#software","name":"ShadowClaw","description":"Multi-runtime AI assistant with local and remote LLM orchestration, Web Workers, OPFS storage, and agentic tool execution.","url":"https://xt-ml.github.io/shadow-claw/","applicationCategory":"DeveloperApplication","operatingSystem":"Web, Browser, Desktop","offers":{"@type":"Offer","price":"0","priceCurrency":"USD"},"author":{"@type":"Organization","name":"xt-ml","url":"https://github.com/xt-ml"},"codeRepository":"https://github.com/xt-ml/shadow-claw","license":"https://github.com/xt-ml/shadow-claw/blob/main/LICENSE"},{"@type":"WebSite","@id":"https://xt-ml.github.io/shadow-claw/#website","url":"https://xt-ml.github.io/shadow-claw/","name":"ShadowClaw","description":"Official website and live deployment of ShadowClaw multi-runtime AI assistant.","publisher":{"@type":"Organization","name":"xt-ml","url":"https://github.com/xt-ml"}},{"@type":"Organization","@id":"https://xt-ml.github.io/shadow-claw/#organization","name":"xt-ml","url":"https://github.com/xt-ml","sameAs":["https://github.com/xt-ml"]}]}</script><meta name="theme-color" content="#fff" /><meta http-equiv="origin-trial" content="A4bwm3ftxmSutme0zCvNMbjdZ4Efbdzz1x2bgmL6RSBDjHVU4Cz5Paeurxk0LO5uyNZjcyaAM+3fQFuCu0XbJwQAAAB2eyJvcmlnaW4iOiJodHRwczovL3h0LW1sLmdpdGh1Yi5pbzo0NDMiLCJmZWF0dXJlIjoiV2ViTUNQIiwiZXhwaXJ5IjoxODA2MzY0ODAwLCJpc1N1YmRvbWFpbiI6dHJ1ZSwiaXNUaGlyZFBhcnR5Ijp0cnVlfQ=="><base href="/shadow-claw/" /><script id="shadow-claw-site-config" type="application/json">{"$schema":"https:\u002f\u002fjson-schema.org\u002fdraft\u002f2020-12\u002fschema","site":{"title":"ShadowClaw","description":"ShadowClaw - multi-runtime AI assistant.","themeColor":"#fff"},"branding":{"siteUrl":"https:\u002f\u002fxt-ml.github.io\u002fshadow-claw\u002f","faviconPath":"assets\u002ficons\u002ffavicon.ico","appleTouchIconPath":"assets\u002ficons\u002f180.png","notFoundPath":"404.html"},"pwa":{"manifestPath":"manifest.json","themeColor":"#000000"},"assets":["assets"],"sidebar":{"pagesHidden":false,"chatHidden":false,"tasksHidden":false,"filesHidden":false,"defaultPage":"pages"},"pages":{"allowList":[],"denyList":[]},"settings":{"defaultToolsProfile":"__builtin_default"},"agent":{"defaultProvider":"transformers_js_local","defaultModel":"onnx-community\u002fgemma-4-E2B-it-ONNX"},"customElements":{"allowedElements":["block-garden","block-garden-option","block-garden-select"],"allowedDomains":["kherrick.github.io","cdn.jsdelivr.net"]},"security":{"connectSrc":["'self'","blob:","data:","https:\u002f\u002fkherrick.github.io","https:\u002f\u002fcdn.jsdelivr.net"]}}</script>
2
2
  <script>var ShadowClawThemeInit=(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:`Module`});var t=(e,t)=>()=>(t||(e((t={exports:{}}).exports,t),e=null),t.exports);function n(){if(globalThis.trustedTypes)return;let e=/* @__PURE__ */ new Map;globalThis.trustedTypes={createPolicy:(t,n)=>{if(e.has(t))throw TypeError(`Policy with name "${t}" already exists.`);let r={createHTML:n.createHTML?e=>n.createHTML(e):void 0,createScriptURL:n.createScriptURL?e=>n.createScriptURL(e):void 0,createScript:n.createScript?e=>n.createScript(e):void 0};return e.set(t,r),r},getPolicy:t=>e.get(t)??null,isHTML:e=>typeof e==`string`||e instanceof Object&&`toString`in e,isScriptURL:e=>typeof e==`string`||e instanceof Object&&`toString`in e,isScript:e=>typeof e==`string`||e instanceof Object&&`toString`in e}}let r=`__shadowClawDefaultTrustedTypesPolicyState`,i=`default`,a=`shadowclaw-sandbox`;function o(){let e=globalThis;return e[r]||(e[r]={initialized:!1,policy:null}),e[r]}function s(){let e=o();if(e.initialized)return;let t=Reflect.get(globalThis,`trustedTypes`);if(t&&typeof t.createPolicy==`function`){e.initialized=!0;try{if(typeof t.getPolicy==`function`){let n=t.getPolicy(i);if(n){e.policy=n;return}}let n=!1;if(typeof t.getPolicyNames==`function`){let e=t.getPolicyNames();Array.isArray(e)&&e.includes(i)&&(n=!0)}if(n){if(typeof t.getPolicy==`function`){let n=t.getPolicy(a);if(n){e.policy=n;return}}e.policy=t.createPolicy(a,{createHTML:e=>e,createScriptURL:e=>e});return}e.policy=t.createPolicy(i,{createHTML:e=>e,createScriptURL:e=>e})}catch{typeof t.getPolicy==`function`&&(e.policy=t.getPolicy(i)??t.getPolicy(a)??null)}}}let c=[{id:`claude-fable-5`,provider:`anthropic`,contextWindow:1e6,maxOutput:128e3,supportsImages:!0,supportsDocuments:!0,supportsThinking:!0,supportsPromptCaching:!0},{id:`claude-fable-5.1`,provider:`anthropic`,contextWindow:1e6,maxOutput:128e3,supportsImages:!0,supportsDocuments:!0,supportsThinking:!0,supportsPromptCaching:!0},{id:`claude-fable`,provider:`anthropic`,contextWindow:1e6,maxOutput:128e3,supportsImages:!0,supportsDocuments:!0,supportsThinking:!0,supportsPromptCaching:!0},{id:`claude-sonnet-5`,provider:`anthropic`,contextWindow:1e6,maxOutput:128e3,supportsImages:!0,supportsDocuments:!0,supportsThinking:!0,supportsPromptCaching:!0},{id:`claude-opus-5`,provider:`anthropic`,contextWindow:1e6,maxOutput:128e3,supportsImages:!0,supportsDocuments:!0,supportsThinking:!0,supportsPromptCaching:!0},{id:`claude-opus-4.8`,provider:`anthropic`,contextWindow:1e6,maxOutput:128e3,supportsImages:!0,supportsDocuments:!0,supportsThinking:!0,supportsPromptCaching:!0},{id:`claude-haiku-5`,provider:`anthropic`,contextWindow:1e6,maxOutput:128e3,supportsImages:!0,supportsDocuments:!0,supportsPromptCaching:!0},{id:`claude-mythos-5`,provider:`anthropic`,contextWindow:1e6,maxOutput:128e3,supportsImages:!0,supportsDocuments:!0,supportsThinking:!0,supportsPromptCaching:!0},{id:`claude-mythos`,provider:`anthropic`,contextWindow:1e6,maxOutput:128e3,supportsImages:!0,supportsDocuments:!0,supportsThinking:!0,supportsPromptCaching:!0},{id:`gpt-6-astra`,provider:`openai`,contextWindow:105e4,maxOutput:128e3,supportsImages:!0,supportsDocuments:!0,supportsAudio:!0,supportsVideo:!0,supportsThinking:!1,supportsPromptCaching:!1},{id:`gpt-6-sol`,provider:`openai`,contextWindow:105e4,maxOutput:128e3,supportsImages:!0,supportsDocuments:!0,supportsThinking:!1,supportsPromptCaching:!1},{id:`gpt-6-luna`,provider:`openai`,contextWindow:1e6,maxOutput:64e3,supportsImages:!0,supportsDocuments:!0,supportsThinking:!1,supportsPromptCaching:!1},{id:`gpt-6`,provider:`openai`,contextWindow:105e4,maxOutput:128e3,supportsImages:!0,supportsDocuments:!0,supportsThinking:!1,supportsPromptCaching:!1},{id:`astra`,provider:`openai`,contextWindow:105e4,maxOutput:128e3,supportsImages:!0,supportsDocuments:!0,supportsAudio:!0,supportsVideo:!0,supportsThinking:!1,supportsPromptCaching:!1},{id:`gpt-5`,provider:`openai`,contextWindow:4e5,maxOutput:128e3,supportsImages:!0,supportsDocuments:!0,supportsThinking:!1,supportsPromptCaching:!1},{id:`gemini-3.5-pro`,provider:`google`,contextWindow:2097152,maxOutput:65536,supportsImages:!0,supportsDocuments:!0,supportsAudio:!0,supportsVideo:!0,supportsThinking:!1,supportsPromptCaching:!1},{id:`gemini-3.5-flash`,provider:`google`,contextWindow:1048576,maxOutput:65536,supportsImages:!0,supportsDocuments:!0,supportsAudio:!0,supportsVideo:!0,supportsThinking:!1,supportsPromptCaching:!1},{id:`gemini-3.8-flash`,provider:`google`,contextWindow:1048576,maxOutput:65536,supportsImages:!0,supportsDocuments:!0,supportsAudio:!0,supportsVideo:!0,supportsThinking:!1,supportsPromptCaching:!1},{id:`gemini-2.5-pro`,provider:`google`,contextWindow:1048576,maxOutput:65536,supportsImages:!0,supportsDocuments:!0,supportsAudio:!0,supportsVideo:!0,supportsThinking:!1,supportsPromptCaching:!1},{id:`gemini-2.5-flash`,provider:`google`,contextWindow:1048576,maxOutput:65536,supportsImages:!0,supportsDocuments:!0,supportsAudio:!0,supportsVideo:!0,supportsThinking:!1,supportsPromptCaching:!1}],l;function u(e){l=e}function d(e){let t=e||l;if(t)for(let e of c)t.registerModelInfo(e.id,{contextWindow:e.contextWindow,maxOutput:e.maxOutput,supportsImageInput:e.supportsImages,supportsDocumentInput:e.supportsDocuments,...e.supportsAudio!==void 0&&{supportsAudioInput:e.supportsAudio},...e.supportsVideo!==void 0&&{supportsVideoInput:e.supportsVideo},...e.supportsPromptCaching!==void 0&&{supportsPromptCaching:e.supportsPromptCaching}})}u(new class{loading=!1;models=/* @__PURE__ */ new Map;getModelInfo(e){if(!e||typeof e!=`string`)return null;let t=e.toLowerCase().trim(),n=this.models.get(t);if(n)return n;if(t.includes(`/`)){let e=t.split(`/`).pop();if(e&&this.models.has(e))return this.models.get(e)}else for(let[e,n]of this.models.entries())if(e.endsWith(`/${t}`))return n;if(t.includes(`:`)){let e=t.split(`:`)[0],n=this.getModelInfo(e);if(n)return n}return null}registerModelInfo(e,t){this.models.set(e.toLowerCase(),t)}clear(){this.models.clear()}seedStaticCatalog(){d(this)}async fetchModelInfo(e,t,n){if(e.modelsUrl){this.loading=!0;try{let r=new Headers;if(r.set(`Content-Type`,`application/json`),e.headers)for(let[t,n]of Object.entries(e.headers))r.set(t,n);if(n)for(let[e,t]of Object.entries(n))r.set(e,t);if(t&&e.apiKeyHeader){let n=e.apiKeyHeaderFormat;r.set(e.apiKeyHeader,n?n.replace(`{key}`,t):t)}let i=await fetch(e.modelsUrl,{headers:r});if(!i.ok)throw Error(`HTTP ${i.status} ${i.statusText}`);let a=await i.json(),o=Array.isArray(a.data)?a.data:Array.isArray(a.models)?a.models:[];for(let e of o){if(!e.id)continue;let t=e.context_length??e.context_window??0,n=e.max_completion_tokens||e.per_request_limits?.completion_tokens||e.top_provider?.max_completion_tokens||null,r=typeof e.supports_tools==`boolean`?e.supports_tools:typeof e.supportsTools==`boolean`?e.supportsTools:void 0,i=this.extractModalities(e,`input`),a=this.extractModalities(e,`output`),o=this.modalitiesInclude(i,`image`,`vision`),s=this.modalitiesInclude(i,`audio`,`voice`,`hearing`),c=this.modalitiesInclude(i,`video`),l=this.modalitiesInclude(i,`document`,`pdf`,`file`)||(typeof e.supports_document_input==`boolean`?e.supports_document_input:typeof e.supportsDocumentInput==`boolean`?e.supportsDocumentInput:void 0),u=e.id===`openrouter/free`||this.supportedParametersInclude(e,`image`,`vision`,`audio`,`tool`,`structured`),d=this.extractReasoning(e),f=typeof e.supports_prompt_caching==`boolean`?e.supports_prompt_caching:typeof e.supportsPromptCaching==`boolean`?e.supportsPromptCaching:this.supportedParametersInclude(e,`cache_control`,`prompt_caching`)?!0:void 0;!t&&Array.isArray(e.providers)&&e.providers.length>0&&(t=e.providers[0]?.context_length||0),this.registerModelInfo(e.id,{contextWindow:t,maxOutput:n,...r!==void 0&&{supportsTools:r},...i.length>0&&{inputModalities:i},...a.length>0&&{outputModalities:a},...o!==void 0&&{supportsImageInput:o},...s!==void 0&&{supportsAudioInput:s},...c!==void 0&&{supportsVideoInput:c},...l!==void 0&&{supportsDocumentInput:l},...d&&{reasoning:d},...u&&{routesByRequestFeatures:u},...f!==void 0&&{supportsPromptCaching:f}})}o.length>0&&console.log(`[ModelRegistry] Registered ${o.length} models for provider "${e.id}"`)}catch(t){console.error(`[ModelRegistry] Error fetching models for ${e.id}:`,t)}finally{this.loading=!1}}}extractModalities(e,t){let n=t===`input`?e.input_modalities||e.inputModalities:e.output_modalities||e.outputModalities,r=e.architecture||{},i=t===`input`?r.input_modalities||r.inputModalities:r.output_modalities||r.outputModalities,a=typeof r.modality==`string`?r.modality:``,o=this.parseArchitectureModality(a,t),s=[...this.normalizeStringArray(n),...this.normalizeStringArray(i),...o];return Array.from(new Set(s))}extractReasoning(e){let t=e?.reasoning;if(!t||typeof t!=`object`)return;let n=this.normalizeStringArray(t.supported_efforts),r=typeof t.default_effort==`string`?t.default_effort.toLowerCase():void 0,i=typeof t.default_enabled==`boolean`?t.default_enabled:void 0,a=typeof t.supports_max_tokens==`boolean`?t.supports_max_tokens:void 0,o=typeof t.mandatory==`boolean`?t.mandatory:void 0;if(n.length!==0||r!==void 0||i!==void 0||a!==void 0||o!==void 0)return{...n.length>0&&{supportedEfforts:n},...r!==void 0&&{defaultEffort:r},...i!==void 0&&{defaultEnabled:i},...a!==void 0&&{supportsMaxTokens:a},...o!==void 0&&{mandatory:o}}}modalitiesInclude(e,...t){if(e.length!==0)return t.some(t=>e.some(e=>e.includes(t)))}normalizeStringArray(e){return Array.isArray(e)?e.filter(e=>typeof e==`string`).map(e=>e.toLowerCase()):[]}parseArchitectureModality(e,t){if(!e)return[];let[n=``,r=``]=e.toLowerCase().split(`->`).map(e=>e.trim());return(t===`input`?n:r).split(/[+,/\s]+/).map(e=>e.trim()).filter(Boolean)}supportedParametersInclude(e,...t){let n=this.normalizeStringArray(e.supported_parameters||e.supportedParameters);return t.some(e=>n.some(t=>t.includes(e)))}});function f(e){return e.replace(/^\/+|\/+$/g,``)}function p(e){let t=f(e);return t.endsWith(`/index.html`)?t=t.slice(0,-11):t.endsWith(`index.html`)&&(t=t.slice(0,-10)),f(t)}function ee(e){let t=f(e),n=t.split(`/`).filter(Boolean);if(n.length===0)return null;let r=n[0].toLowerCase();if(r===`pages`){if(n.length>=3){let e=n[1];return{page:`pages`,groupId:e===`main`?`br:main`:e.startsWith(`br-`)?`br:${e.slice(3)}`:e,path:n.slice(2).join(`/`)}}return{page:`pages`,groupId:`br:main`,path:n.slice(1).join(`/`)}}if(r===`files`){let e=n[1]||`main`;return{page:`files`,groupId:e===`main`?`br:main`:e.startsWith(`br-`)?`br:${e.slice(3)}`:e,path:n.slice(2).join(`/`)||void 0}}if(r===`chat`){let e=n[1]||`main`;return{page:`chat`,groupId:e===`main`?`br:main`:e.startsWith(`br-`)?`br:${e.slice(3)}`:e}}if(r===`tasks`){let e=n[1]||`main`;return{page:`tasks`,groupId:e===`main`?`br:main`:e.startsWith(`br-`)?`br:${e.slice(3)}`:e}}return r===`main`?{page:`pages`,groupId:`br:main`,path:n.slice(1).join(`/`)}:{page:`pages`,groupId:`br:main`,path:t}}function te(){if(typeof document<`u`){let e=document.getElementById(`shadow-claw-static-routing`);if(e&&e.textContent)try{let t=JSON.parse(e.textContent);if(t&&typeof t==`object`&&t.routes)return t}catch(e){console.warn(`Failed to parse embedded static routing manifest:`,e)}}return null}function m(e,t){let n=t||te();if(!n||!n.routes)return null;let r=p(e);for(let[e,t]of Object.entries(n.routes))if(t&&t.prettyPath&&p(t.prettyPath)===r)return ee(e);return null}let h=null,ne=/* @__PURE__ */ new Set([`chat`,`files`,`tasks`,`pages`,`settings`,`tools`,`channels`]);function re(){h=null}typeof globalThis<`u`&&(globalThis.__applyBasePathCacheReset=re);function g(){let e=typeof window<`u`?window:typeof self<`u`?self:globalThis;if(e&&e.__SHADOWCLAW_DEPLOY_ID__){let t=String(e.__SHADOWCLAW_DEPLOY_ID__).trim();if(t)return t.replace(/[^a-zA-Z0-9_-]/g,`-`)}let t=globalThis.process;if(t&&t.env&&t.env.SHADOWCLAW_DEPLOY_ID){let e=String(t.env.SHADOWCLAW_DEPLOY_ID).trim();if(e)return e.replace(/[^a-zA-Z0-9_-]/g,`-`)}let n=_();return!n||n===`/`?``:n.replace(/^\/+|\/+$/g,``).replace(/[^a-zA-Z0-9_-]/g,`-`)}function _(){if(h!==null)return h;if((typeof window>`u`||globalThis.WorkerGlobalScope!==void 0&&typeof self<`u`&&self instanceof globalThis.WorkerGlobalScope)&&typeof self<`u`&&self.location){let e=(self.location.pathname||`/`).split(`/`).filter(Boolean);if(e.length<=1)return h=`/`,h;let t=e[0].toLowerCase(),n=t===`service-worker.js`||t===`sw.js`||t===`manifest.json`||t===`sitemap.xml`||t===`favicon.ico`||t===`index.html`||t===`service-worker`||t===`assets`||t===`dist`||t===`public`;if(n&&e.length===2)return h=`/`,h;if(!n)return h=`/`+e[0]+`/`,h}let e=typeof window<`u`&&window.location?window.location:typeof self<`u`&&self.location?self.location:null;if(!e)return`/`;if(typeof document<`u`&&typeof document.querySelector==`function`){let t=document.querySelector(`base[href]`);if(t){let n=t.getAttribute(`href`);if(n)try{let t=new URL(n,e.origin).pathname;return t.endsWith(`/`)||(t+=`/`),h=t,h}catch{}}}let t=e.pathname||`/`;if(t===`/`)return h=`/`,h;let n=t.split(`/`).filter(Boolean),r=n.findIndex(e=>ne.has(e.toLowerCase()));return r>=0?r===0?(h=`/`,h):(h=`/`+n.slice(0,r).join(`/`)+`/`,h):m(t)?(h=`/`,h):n.length===1&&!t.includes(`.`)?(h=`/`+n[0]+`/`,h):(h=`/`,h)}function ie(e){let t=e.replace(/[.*+?^${}()|[\]\\]/g,`\\$&`);return RegExp(`(^|\\s)@${t}\\b`,`i`)}ie(`ShadowClaw`);function ae(){let e=g();return e?`shadowclaw-${e}`:`shadowclaw`}ae();let oe={github:{providerId:`github`,name:`GitHub`,aliases:[`github`,`api.github.com`],modes:[`oauth`,`token`],defaultMode:`oauth`,serviceTypes:[`http_api`,`git_remote`],authTypes:[`token`,`oauth`],tokenAuth:{token:{headerName:`Authorization`,headerPrefix:`token `},oauth:{headerName:`Authorization`,headerPrefix:`Bearer `}},oauth:{authorizeUrl:`https://github.com/login/oauth/authorize`,tokenUrl:`https://github.com/login/oauth/access_token`,defaultScopes:[`repo`,`read:user`],usePkce:!0,clientAuthMethod:`request_body`,scopeSeparator:`space`}},gitlab:{providerId:`gitlab`,name:`GitLab`,aliases:[`gitlab`,`gitlab.com`],modes:[`oauth`,`token`],defaultMode:`oauth`,serviceTypes:[`http_api`,`git_remote`],authTypes:[`token`,`oauth`],tokenAuth:{token:{headerName:`PRIVATE-TOKEN`,headerPrefix:``},oauth:{headerName:`Authorization`,headerPrefix:`Bearer `}},tokenAuthByServiceType:{git_remote:{token:{headerName:`Authorization`,headerPrefix:`Bearer `},oauth:{headerName:`Authorization`,headerPrefix:`Bearer `}}},oauth:{authorizeUrl:`https://gitlab.com/oauth/authorize`,tokenUrl:`https://gitlab.com/oauth/token`,defaultScopes:[`read_api`,`read_user`],usePkce:!0,clientAuthMethod:`request_body`,scopeSeparator:`space`}},figma:{providerId:`figma`,name:`Figma`,aliases:[`figma`,`api.figma.com`],modes:[`oauth`,`token`],defaultMode:`oauth`,serviceTypes:[`http_api`],authTypes:[`token`,`oauth`],tokenAuth:{token:{headerName:`X-Figma-Token`,headerPrefix:``},oauth:{headerName:`Authorization`,headerPrefix:`Bearer `}},oauth:{authorizeUrl:`https://www.figma.com/oauth`,tokenUrl:`https://api.figma.com/v1/oauth/token`,refreshUrl:`https://api.figma.com/v1/oauth/refresh`,defaultScopes:[],usePkce:!0,clientAuthMethod:`basic_header`,scopeSeparator:`space`}},notion:{providerId:`notion`,name:`Notion`,aliases:[`notion`,`api.notion.com`,`notion.so`],modes:[`oauth`,`token`],defaultMode:`oauth`,serviceTypes:[`http_api`],authTypes:[`token`,`oauth`],tokenAuth:{token:{headerName:`Authorization`,headerPrefix:`Bearer `},oauth:{headerName:`Authorization`,headerPrefix:`Bearer `}},oauth:{authorizeUrl:`https://api.notion.com/v1/oauth/authorize`,tokenUrl:`https://api.notion.com/v1/oauth/token`,defaultScopes:[],usePkce:!0,clientAuthMethod:`basic_header`,scopeSeparator:`space`}},microsoft_graph:{providerId:`microsoft_graph`,name:`Microsoft Graph`,aliases:[`microsoft`,`graph.microsoft.com`,`microsoft_graph`],modes:[`oauth`,`token`],defaultMode:`oauth`,serviceTypes:[`http_api`],authTypes:[`token`,`oauth`],tokenAuth:{token:{headerName:`Authorization`,headerPrefix:`Bearer `},oauth:{headerName:`Authorization`,headerPrefix:`Bearer `}},oauth:{authorizeUrl:`https://login.microsoftonline.com/common/oauth2/v2.0/authorize`,tokenUrl:`https://login.microsoftonline.com/common/oauth2/v2.0/token`,defaultScopes:[`openid`,`profile`,`offline_access`,`User.Read`],usePkce:!0,clientAuthMethod:`request_body`,scopeSeparator:`space`}},yahoo_mail:{providerId:`yahoo_mail`,name:`Yahoo Mail`,aliases:[`yahoo`,`yahoo_mail`,`mail.yahoo.com`],modes:[`oauth`,`token`],defaultMode:`oauth`,serviceTypes:[`http_api`],authTypes:[`token`,`oauth`],tokenAuth:{token:{headerName:`Authorization`,headerPrefix:`Bearer `},oauth:{headerName:`Authorization`,headerPrefix:`Bearer `}},oauth:{authorizeUrl:`https://api.login.yahoo.com/oauth2/request_auth`,tokenUrl:`https://api.login.yahoo.com/oauth2/get_token`,defaultScopes:[`mail-r`,`mail-w`],usePkce:!0,clientAuthMethod:`request_body`,scopeSeparator:`space`}},google:{providerId:`google`,name:`Google`,aliases:[`google`,`googleapis.com`],modes:[`oauth`,`token`],defaultMode:`oauth`,serviceTypes:[`http_api`],authTypes:[`token`,`oauth`],tokenAuth:{token:{headerName:`Authorization`,headerPrefix:`Bearer `},oauth:{headerName:`Authorization`,headerPrefix:`Bearer `}},oauth:{authorizeUrl:`https://accounts.google.com/o/oauth2/v2/auth`,tokenUrl:`https://oauth2.googleapis.com/token`,defaultScopes:[`openid`,`profile`,`email`],usePkce:!0,clientAuthMethod:`request_body`,scopeSeparator:`space`}},atlassian:{providerId:`atlassian`,name:`Atlassian`,aliases:[`atlassian`,`api.atlassian.com`],modes:[`oauth`,`token`,`basic`],defaultMode:`basic`,serviceTypes:[`http_api`,`git_remote`],authTypes:[`token`,`oauth`,`basic_userpass`],tokenAuth:{token:{headerName:`Authorization`,headerPrefix:`Bearer `},oauth:{headerName:`Authorization`,headerPrefix:`Bearer `},basic:{headerName:`Authorization`,headerPrefix:`Basic `}},oauth:{authorizeUrl:`https://auth.atlassian.com/authorize`,tokenUrl:`https://auth.atlassian.com/oauth/token`,defaultScopes:[],usePkce:!0,clientAuthMethod:`request_body`,scopeSeparator:`space`}},slack:{providerId:`slack`,name:`Slack`,aliases:[`slack`,`slack.com`],modes:[`oauth`,`token`],defaultMode:`oauth`,serviceTypes:[`http_api`],authTypes:[`token`,`oauth`],tokenAuth:{token:{headerName:`Authorization`,headerPrefix:`Bearer `},oauth:{headerName:`Authorization`,headerPrefix:`Bearer `}},oauth:{authorizeUrl:`https://slack.com/oauth/v2/authorize`,tokenUrl:`https://slack.com/api/oauth.v2.access`,defaultScopes:[],usePkce:!1,clientAuthMethod:`request_body`,scopeSeparator:`comma`}},linear:{providerId:`linear`,name:`Linear`,aliases:[`linear`,`api.linear.app`,`linear.app`],modes:[`oauth`,`token`],defaultMode:`oauth`,serviceTypes:[`http_api`],authTypes:[`token`,`oauth`],tokenAuth:{token:{headerName:`Authorization`,headerPrefix:`Bearer `},oauth:{headerName:`Authorization`,headerPrefix:`Bearer `}},oauth:{authorizeUrl:`https://linear.app/oauth/authorize`,tokenUrl:`https://api.linear.app/oauth/token`,defaultScopes:[],usePkce:!0,clientAuthMethod:`request_body`,scopeSeparator:`space`}},azure_devops:{providerId:`azure_devops`,name:`Azure DevOps`,aliases:[`azure_devops`,`dev.azure.com`],modes:[`oauth`,`token`],defaultMode:`oauth`,serviceTypes:[`http_api`,`git_remote`],authTypes:[`token`,`oauth`,`basic_userpass`,`ssh_key`],tokenAuth:{token:{headerName:`Authorization`,headerPrefix:`Bearer `},oauth:{headerName:`Authorization`,headerPrefix:`Bearer `}},tokenAuthByServiceType:{git_remote:{token:{headerName:`Authorization`,headerPrefix:`Basic `},oauth:{headerName:`Authorization`,headerPrefix:`Basic `}}},oauth:{authorizeUrl:`https://app.vssps.visualstudio.com/oauth2/authorize`,tokenUrl:`https://app.vssps.visualstudio.com/oauth2/token`,defaultScopes:[`vso.code`,`vso.profile`,`offline_access`],usePkce:!1,clientAuthMethod:`request_body`,scopeSeparator:`space`}},custom_mcp:{providerId:`custom_mcp`,name:`Custom MCP`,aliases:[`custom_mcp`],modes:[`oauth`,`token`],defaultMode:`oauth`,serviceTypes:[`mcp_remote`,`webmcp_local`],authTypes:[`none`,`token`,`oauth`,`custom_header`,`ssh_key`],tokenAuth:{token:{headerName:`Authorization`,headerPrefix:`Bearer `},oauth:{headerName:`Authorization`,headerPrefix:`Bearer `}},oauth:{authorizeUrl:`https://example.com/oauth/authorize`,tokenUrl:`https://example.com/oauth/token`,defaultScopes:[],usePkce:!0,clientAuthMethod:`request_body`,scopeSeparator:`space`}}};Object.fromEntries(Object.values(oe).filter(e=>!!e.oauth).map(e=>{let t=e.oauth;return[e.providerId,{id:e.providerId,name:e.name,authorizeUrl:t.authorizeUrl,tokenUrl:t.tokenUrl,redirectUri:t.redirectUri,defaultScopes:t.defaultScopes,usePkce:t.usePkce,clientAuthMethod:t.clientAuthMethod,scopeSeparator:t.scopeSeparator}]})),Object.fromEntries(Object.values(oe).map(e=>[e.providerId,{providerId:e.providerId,modes:e.modes,defaultMode:e.defaultMode}])),new Promise(e=>{});
3
3
  /*! @license DOMPurify 3.4.16 | (c) Cure53 and other contributors | Released under the Apache license 2.0 and Mozilla Public License 2.0 | github.com/cure53/DOMPurify/blob/3.4.16/LICENSE */
4
4
  function v(e,t){this.v=e,this.k=t}function y(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function se(e){if(Array.isArray(e))return e}function ce(e,t){var n=e==null?null:typeof Symbol<`u`&&e[Symbol.iterator]||e[`@@iterator`];if(n!=null){var r,i,a,o,s=[],c=!0,l=!1;try{if(a=(n=n.call(e)).next,t===0){if(Object(n)!==n)return;c=!1}else for(;!(c=(r=a.call(n)).done)&&(s.push(r.value),s.length!==t);c=!0);}catch(e){l=!0,i=e}finally{try{if(!c&&n.return!=null&&(o=n.return(),Object(o)!==o))return}finally{if(l)throw i}}return s}}function b(){throw TypeError(`Invalid attempt to destructure non-iterable instance.
@@ -1 +1 @@
1
- import{c as e,s as t}from"./custom-element-security-3_FKCXcg.js";import{Et as n,t as r}from"./orchestrator-DTzgyL23.js";import{n as i,t as a}from"./e2e-bridge-DnFHPuwg.js";export{t as BOOT_PENDING_ATTR,n as BOOT_PENDING_CLASS,r as HYDRATION_PENDING_ATTR}from"./constants-DiETpg52.js";async function o(e,t){if(!t){t=!0;try{console.log(`🦞 ShadowClaw initializing...`);let n=e.querySelector(`shadow-claw`)||e.body.appendChild(e.createElement(`shadow-claw`));if(console.log(`✅ ShadowClaw initialized successfully`),t=!1,i()&&(console.log(`🧪 E2E Test Bridge enabled`),a(r,n)),await r.whenReady,typeof window<`u`&&typeof n.orchestrator?.ensureAllConnections==`function`)try{await n.orchestrator.ensureAllConnections({force:!1})}catch(e){console.warn(`[App] Failed to ensure connections on initialize:`,e)}return{orchestrator:n.orchestrator,isInitializing:t}}catch(e){throw console.error(`❌ Failed to initialize ShadowClaw:`,e),e}}}async function s(){await import(`./shadow-claw-RuFQ2Ej5.js`)}if(typeof window<`u`&&!window.__SHADOWCLAW_E2E_ENABLE__)try{Object.defineProperty(window,"fetch",{value:window.fetch,writable:!1,configurable:!1}),window.crypto&&window.crypto.subtle&&Object.defineProperty(window.crypto,"subtle",{value:window.crypto.subtle,writable:!1,configurable:!1})}catch(e){console.warn(`[ShadowClaw] Security: Failed to lock globals:`,e)}e(),t();let c=!1;async function l(){await s(),c=!!(await o(document,c))?.isInitializing}document.readyState===`loading`?document.addEventListener(`DOMContentLoaded`,async()=>{try{await l()}catch(e){console.error(`Fatal error during initialization:`,e),c=!1}}):l().catch(e=>{console.error(`Fatal error during initialization:`,e),c=!1}),typeof window<`u`&&[`click`,`keydown`,`touchstart`].forEach(e=>{window.addEventListener(e,n,{once:!0})});
1
+ import{c as e,s as t}from"./custom-element-security-Td4vrRc_.js";import{Et as n,t as r}from"./orchestrator-B7MpomoG.js";import{n as i,t as a}from"./e2e-bridge-Dbc9fCDq.js";export{t as BOOT_PENDING_ATTR,n as BOOT_PENDING_CLASS,r as HYDRATION_PENDING_ATTR}from"./constants-DiETpg52.js";async function o(e,t){if(!t){t=!0;try{console.log(`🦞 ShadowClaw initializing...`);let n=e.querySelector(`shadow-claw`)||e.body.appendChild(e.createElement(`shadow-claw`));if(console.log(`✅ ShadowClaw initialized successfully`),t=!1,i()&&(console.log(`🧪 E2E Test Bridge enabled`),a(r,n)),await r.whenReady,typeof window<`u`&&typeof n.orchestrator?.ensureAllConnections==`function`)try{await n.orchestrator.ensureAllConnections({force:!1})}catch(e){console.warn(`[App] Failed to ensure connections on initialize:`,e)}return{orchestrator:n.orchestrator,isInitializing:t}}catch(e){throw console.error(`❌ Failed to initialize ShadowClaw:`,e),e}}}async function s(){await import(`./shadow-claw-Ba2ZFE9m.js`)}if(typeof window<`u`&&!window.__SHADOWCLAW_E2E_ENABLE__)try{Object.defineProperty(window,"fetch",{value:window.fetch,writable:!1,configurable:!1}),window.crypto&&window.crypto.subtle&&Object.defineProperty(window.crypto,"subtle",{value:window.crypto.subtle,writable:!1,configurable:!1})}catch(e){console.warn(`[ShadowClaw] Security: Failed to lock globals:`,e)}e(),t();let c=!1;async function l(){await s(),c=!!(await o(document,c))?.isInitializing}document.readyState===`loading`?document.addEventListener(`DOMContentLoaded`,async()=>{try{await l()}catch(e){console.error(`Fatal error during initialization:`,e),c=!1}}):l().catch(e=>{console.error(`Fatal error during initialization:`,e),c=!1}),typeof window<`u`&&[`click`,`keydown`,`touchstart`].forEach(e=>{window.addEventListener(e,n,{once:!0})});
@@ -1 +1 @@
1
- import{r as e}from"./config-Dqn5OMfC.js";import{t}from"./getConfig-DSieAlsi.js";import{t as n}from"./setConfig-CIdSs9rh.js";function r(e,t){let n=e?.querySelector(`.main-content`);if(!(n instanceof HTMLElement))return Math.max(150,t);let r=n.getBoundingClientRect().height||window.innerHeight||600,i=Math.max(150,r-100);return Math.max(150,Math.min(i,t))}async function i(t,r){if(t)try{await n(t,e.CHAT_SPLIT_VIEW_HEIGHT,r)}catch{}}function a(e,t){let n=e?.querySelector(`.main-content`);if(!(n instanceof HTMLElement))return;let i=r(e,t);n.style.setProperty(`--chat-split-height`,`${i}px`)}async function o(n,o,s,c){if(!n||!s)return;s.setAttribute(`tabindex`,`0`),s.setAttribute(`role`,`separator`),s.setAttribute(`aria-orientation`,`horizontal`),s.setAttribute(`aria-label`,`Resize chat panel height`);let l=()=>{let e=n.querySelector(`.main-content`);if(!(e instanceof HTMLElement))return 320;let t=parseFloat(e.style.getPropertyValue(`--chat-split-height`));if(Number.isFinite(t)&&t>0)return t;let r=n.querySelector(`.chat-page`);return r instanceof HTMLElement&&r.getBoundingClientRect().height||320},u=()=>{let e=Math.round(r(n,l())),t=Math.round(r(n,2**53-1));s.setAttribute(`aria-valuemin`,`150`),s.setAttribute(`aria-valuemax`,String(t)),s.setAttribute(`aria-valuenow`,String(e))};try{let r=c?await t(c,e.CHAT_SPLIT_VIEW_HEIGHT):void 0;typeof r==`number`&&Number.isFinite(r)&&r>0?a(n,r):typeof r==`string`&&!isNaN(parseFloat(r))?a(n,parseFloat(r)):a(n,320)}catch{a(n,320)}let d=null,f=0,p=0,m=e=>{if(e.pointerId!==d)return;let t=f-e.clientY;a(n,p+t),u()},h=()=>{if(d===null)return;d=null,s.classList.remove(`active`),document.removeEventListener(`pointermove`,m);let e=n.querySelector(`.main-content`);if(e instanceof HTMLElement){let t=parseFloat(e.style.getPropertyValue(`--chat-split-height`));Number.isFinite(t)&&t>0&&c&&i(c,t)}},g=e=>{e.pointerId===d&&h()};s.addEventListener(`pointerdown`,e=>{if(e.pointerType===`mouse`&&e.button!==0&&e.button!==-1||window.innerWidth<896)return;e.preventDefault(),d=e.pointerId,f=e.clientY;let t=n.querySelector(`.chat-page`);p=t instanceof HTMLElement&&t.getBoundingClientRect().height>0?t.getBoundingClientRect().height:l(),s.classList.add(`active`),s.setPointerCapture(e.pointerId),document.addEventListener(`pointermove`,m)}),s.addEventListener(`pointerup`,g),s.addEventListener(`pointercancel`,h),s.addEventListener(`dblclick`,()=>{a(n,320),c&&i(c,320),u()}),s.addEventListener(`keydown`,e=>{if(window.innerWidth<896)return;let t=e.shiftKey?32:12,o=l(),s=null;e.key===`ArrowUp`?s=o+t:e.key===`ArrowDown`?s=o-t:e.key===`Home`?s=150:e.key===`End`&&(s=r(n,2**53-1)),s!==null&&(e.preventDefault(),a(n,s),u(),c&&i(c,r(n,l())))}),u(),o.addCleanup(()=>{h(),s.removeEventListener(`pointerup`,g),s.removeEventListener(`pointercancel`,h)})}export{o as initChatSplitResize};
1
+ import{r as e}from"./config-071HSho8.js";import{t}from"./getConfig-DSieAlsi.js";import{t as n}from"./setConfig-CIdSs9rh.js";function r(e,t){let n=e?.querySelector(`.main-content`);if(!(n instanceof HTMLElement))return Math.max(150,t);let r=n.getBoundingClientRect().height||window.innerHeight||600,i=Math.max(150,r-100);return Math.max(150,Math.min(i,t))}async function i(t,r){if(t)try{await n(t,e.CHAT_SPLIT_VIEW_HEIGHT,r)}catch{}}function a(e,t){let n=e?.querySelector(`.main-content`);if(!(n instanceof HTMLElement))return;let i=r(e,t);n.style.setProperty(`--chat-split-height`,`${i}px`)}async function o(n,o,s,c){if(!n||!s)return;s.setAttribute(`tabindex`,`0`),s.setAttribute(`role`,`separator`),s.setAttribute(`aria-orientation`,`horizontal`),s.setAttribute(`aria-label`,`Resize chat panel height`);let l=()=>{let e=n.querySelector(`.main-content`);if(!(e instanceof HTMLElement))return 320;let t=parseFloat(e.style.getPropertyValue(`--chat-split-height`));if(Number.isFinite(t)&&t>0)return t;let r=n.querySelector(`.chat-page`);return r instanceof HTMLElement&&r.getBoundingClientRect().height||320},u=()=>{let e=Math.round(r(n,l())),t=Math.round(r(n,2**53-1));s.setAttribute(`aria-valuemin`,`150`),s.setAttribute(`aria-valuemax`,String(t)),s.setAttribute(`aria-valuenow`,String(e))};try{let r=c?await t(c,e.CHAT_SPLIT_VIEW_HEIGHT):void 0;typeof r==`number`&&Number.isFinite(r)&&r>0?a(n,r):typeof r==`string`&&!isNaN(parseFloat(r))?a(n,parseFloat(r)):a(n,320)}catch{a(n,320)}let d=null,f=0,p=0,m=e=>{if(e.pointerId!==d)return;let t=f-e.clientY;a(n,p+t),u()},h=()=>{if(d===null)return;d=null,s.classList.remove(`active`),document.removeEventListener(`pointermove`,m);let e=n.querySelector(`.main-content`);if(e instanceof HTMLElement){let t=parseFloat(e.style.getPropertyValue(`--chat-split-height`));Number.isFinite(t)&&t>0&&c&&i(c,t)}},g=e=>{e.pointerId===d&&h()};s.addEventListener(`pointerdown`,e=>{if(e.pointerType===`mouse`&&e.button!==0&&e.button!==-1||window.innerWidth<896)return;e.preventDefault(),d=e.pointerId,f=e.clientY;let t=n.querySelector(`.chat-page`);p=t instanceof HTMLElement&&t.getBoundingClientRect().height>0?t.getBoundingClientRect().height:l(),s.classList.add(`active`),s.setPointerCapture(e.pointerId),document.addEventListener(`pointermove`,m)}),s.addEventListener(`pointerup`,g),s.addEventListener(`pointercancel`,h),s.addEventListener(`dblclick`,()=>{a(n,320),c&&i(c,320),u()}),s.addEventListener(`keydown`,e=>{if(window.innerWidth<896)return;let t=e.shiftKey?32:12,o=l(),s=null;e.key===`ArrowUp`?s=o+t:e.key===`ArrowDown`?s=o-t:e.key===`Home`?s=150:e.key===`End`&&(s=r(n,2**53-1)),s!==null&&(e.preventDefault(),a(n,s),u(),c&&i(c,r(n,l())))}),u(),o.addCleanup(()=>{h(),s.removeEventListener(`pointerup`,g),s.removeEventListener(`pointercancel`,h)})}export{o as initChatSplitResize};
@@ -1 +1 @@
1
- import{i as e}from"./rolldown-runtime-DBVvNlSN.js";import{r as t}from"./config-Dqn5OMfC.js";import{o as n}from"./app-routes-CanH2f3S.js";import{r}from"./txPromise-DlzJBj9N.js";import{t as i}from"./browser-B1SoUj6D.js";import{t as a}from"./ulid-BSJxYh6W.js";import{t as o}from"./getAllTasks-C0FzJ32l.js";var s=/* @__PURE__ */ e(i(),1),c=class{_transport;_url;_httpUrl;_token;_clientId;_peerId;_deviceLabel;_capabilities;_version;_heartbeatIntervalMs;_reconnectDelayMs;_maxReconnectDelayMs;_handlers;_WebSocketClass;_EventSourceClass;_fetchFn;_ws=null;_es=null;_heartbeatTimer=null;_reconnectTimer=null;_currentReconnectDelay;_isDestroyed=!1;_state=`disconnected`;constructor(e){if(this._transport=e.transport||`sse`,this._clientId=e.clientId,this._peerId=e.peerId,this._deviceLabel=e.deviceLabel||`ShadowClaw Browser Client`,this._capabilities=e.capabilities||[`webmcp`,`opfs`,`push`],this._version=e.version||`1.27.1`,this._token=e.token,this._heartbeatIntervalMs=e.heartbeatIntervalMs||1e4,this._reconnectDelayMs=e.reconnectDelayMs||1e3,this._maxReconnectDelayMs=e.maxReconnectDelayMs||3e4,this._currentReconnectDelay=this._reconnectDelayMs,this._handlers=/* @__PURE__ */ new Map,this._WebSocketClass=e.WebSocketClass||(typeof WebSocket<`u`?WebSocket:null),this._EventSourceClass=e.EventSourceClass||(typeof EventSource<`u`?EventSource:null),this._fetchFn=e.fetchFn||(typeof fetch<`u`?fetch.bind(globalThis):(()=>Promise.reject(/* @__PURE__ */ Error(`fetch not available`)))),e.handlers)for(let[t,n]of Object.entries(e.handlers))this.registerHandler(t,n);let t=typeof location<`u`?location:null,n=t?`${t.protocol}//${t.host}`:`http://127.0.0.1:8888`,r=t?`${t.protocol===`https:`?`wss:`:`ws:`}//${t.host}`:`ws://127.0.0.1:8888`;this._url=e.url||`${r}/ws/control`,this._httpUrl=e.httpUrl||n}get transport(){return this._transport}get version(){return this._version}registerHandler(e,t){this._handlers.set(e,t)}unregisterHandler(e){this._handlers.delete(e)}getState(){return this._state}ensureConnected(e=!1){if(this._isDestroyed=!1,this._reconnectTimer&&=(clearTimeout(this._reconnectTimer),null),this._currentReconnectDelay=this._reconnectDelayMs,this._transport===`websocket`){let t=this._ws&&(this._ws.readyState===1||this._ws.readyState===this._WebSocketClass?.OPEN);(e||!t||this._state!==`connected`)&&(this._cleanupConnection(),this.connect())}else{let t=this._es&&(this._es.readyState===1||this._es.readyState===this._EventSourceClass?.OPEN);(e||!t||this._state!==`connected`)&&(this._cleanupConnection(),this.connect())}}connect(){this._isDestroyed||this._state===`connected`||this._state===`connecting`||(this._transport===`websocket`?this._connectWebSocket():this._connectSse())}_connectWebSocket(){if(!this._WebSocketClass){console.warn(`[ControlPlaneClient] WebSocket not supported in this environment`);return}this._state=`connecting`;let e=new URL(this._url,`ws://127.0.0.1:8888`);this._token&&e.searchParams.set(`token`,this._token);try{let t=new this._WebSocketClass(e.toString());this._ws=t,t.onopen=()=>{this._state=`connected`,this._currentReconnectDelay=this._reconnectDelayMs,this._sendRegister(),this._startHeartbeat()},t.onmessage=e=>{this._handleMessage(e.data)},t.onclose=()=>{this._cleanupConnection(),this._isDestroyed||this._scheduleReconnect()},t.onerror=e=>{console.warn(`[ControlPlaneClient] WebSocket error:`,e)}}catch(e){console.warn(`[ControlPlaneClient] Failed to establish WebSocket connection:`,e),this._cleanupConnection(),this._scheduleReconnect()}}_connectSse(){if(!this._EventSourceClass){(s.default===void 0||!s.default.env?.JEST_WORKER_ID)&&console.warn(`[ControlPlaneClient] EventSource not supported in this environment`);return}this._state=`connecting`;let e=new URL(`/api/control/events`,this._httpUrl);e.searchParams.set(`clientId`,this._clientId),this._token&&e.searchParams.set(`token`,this._token);try{let t=new this._EventSourceClass(e.toString());this._es=t,t.onopen=()=>{this._state=`connected`,this._currentReconnectDelay=this._reconnectDelayMs,this._sendRegister(),this._startHeartbeat()},typeof t.addEventListener==`function`&&t.addEventListener(`command:execute`,e=>{this._handleMessage(e.data)}),t.onmessage=e=>{this._handleMessage(e.data)},t.onerror=e=>{console.warn(`[ControlPlaneClient] SSE connection error:`,e),this._cleanupConnection(),this._isDestroyed||this._scheduleReconnect()}}catch(e){console.warn(`[ControlPlaneClient] Failed to establish SSE connection:`,e),this._cleanupConnection(),this._scheduleReconnect()}}disconnect(){this._isDestroyed=!0;try{this._sendUnregister()}catch{}this._cleanupConnection(),this._reconnectTimer&&=(clearTimeout(this._reconnectTimer),null)}_cleanupConnection(){if(this._state=`disconnected`,this._stopHeartbeat(),this._ws){try{this._ws.close()}catch{}this._ws=null}if(this._es){try{this._es.close()}catch{}this._es=null}}_scheduleReconnect(){this._reconnectTimer||this._isDestroyed||(this._reconnectTimer=setTimeout(()=>{this._reconnectTimer=null,this._isDestroyed||this.connect()},this._currentReconnectDelay),this._currentReconnectDelay=Math.min(this._currentReconnectDelay*1.5,this._maxReconnectDelayMs))}_startHeartbeat(){this._stopHeartbeat(),this._heartbeatTimer=setInterval(()=>{this._sendHeartbeat()},this._heartbeatIntervalMs)}_stopHeartbeat(){this._heartbeatTimer&&=(clearInterval(this._heartbeatTimer),null)}_sendRegister(){let e={clientId:this._clientId,deviceLabel:this._deviceLabel,capabilities:this._capabilities,version:this._version,transport:this._transport,peerId:this._peerId};this._sendMessage({id:a(),type:`client:register`,payload:e})}_sendHeartbeat(){let e={clientId:this._clientId,timestamp:Date.now()};this._sendMessage({id:a(),type:`client:heartbeat`,payload:e})}_sendUnregister(){if(!this._clientId)return;let e={clientId:this._clientId};this._sendMessage({id:a(),type:`client:unregister`,payload:e})}_sendMessage(e){if(this._transport===`websocket`){this._ws&&(this._ws.readyState===1||this._ws.readyState===this._WebSocketClass?.OPEN)&&this._ws.send(JSON.stringify(e));return}let t=new URL(`/api/control/messages`,this._httpUrl),n={"Content-Type":`application/json`};this._token&&(n[`x-control-token`]=this._token,n.Authorization=`Bearer ${this._token}`);let r={method:`POST`,headers:n,body:JSON.stringify(e)},i=t.hostname.toLowerCase(),a=i===`localhost`||i===`127.0.0.1`||i===`::1`||i===`[::1]`,o=/^(10\.|172\.(1[6-9]|2\d|3[01])\.|192\.168\.)/.test(i);a?r.targetAddressSpace=`loopback`:o&&(r.targetAddressSpace=`private`),this._fetchFn(t.toString(),r).catch(e=>{console.warn(`[ControlPlaneClient] Failed to send message via HTTP POST:`,e)})}async _handleMessage(e){if(!e||typeof e!=`string`)return;let t;try{t=JSON.parse(e)}catch{return}if(t.type===`command:execute`){let{commandId:e,action:n,args:r}=t.payload,i=this._handlers.get(n);if(!i){this._sendMessage({id:a(),type:`command:result`,replyTo:t.id,payload:{commandId:e,success:!1,error:`Unknown action: ${n}`}});return}try{let n=await i(r);this._sendMessage({id:a(),type:`command:result`,replyTo:t.id,payload:{commandId:e,success:!0,data:n}})}catch(n){this._sendMessage({id:a(),type:`command:result`,replyTo:t.id,payload:{commandId:e,success:!1,error:n.message||String(n)}})}}}};function l(){if(typeof localStorage<`u`)try{let e=localStorage.getItem(t.CONTROL_PLANE_CLIENT_ID);if(e&&e.trim())return e.trim()}catch{}let e=n(),r=e?`${e}-${a().toLowerCase()}`:`client-${a().toLowerCase()}`;if(typeof localStorage<`u`)try{localStorage.setItem(t.CONTROL_PLANE_CLIENT_ID,r)}catch{}return r}async function u(e){if(typeof localStorage<`u`)try{let e=localStorage.getItem(t.CONTROL_PLANE_ENABLED);if(e!==null)return e===`true`||e===`1`}catch{}if(e)try{let{getConfig:n}=await import(`./getConfig-DSieAlsi.js`).then(e=>e.n),r=await n(e,t.CONTROL_PLANE_ENABLED);if(r!=null)return r===`true`||r===`1`}catch{}return!1}function d(e){if(typeof EventSource>`u`&&typeof WebSocket>`u`)return!1;let t=e||(typeof location<`u`?location:null);return!(!t||t.protocol===`file:`||typeof document<`u`&&document.querySelector(`meta[name="shadowclaw-static-only"]`))}function f(e){let n=``;if(typeof localStorage<`u`)try{n=(localStorage.getItem(t.CONTROL_PLANE_URL)||``).trim()}catch{}let r=e||(typeof location<`u`?location:null),i=r&&(r.protocol===`file:`||r.hostname&&(r.hostname.endsWith(`.github.io`)||r.hostname.endsWith(`.pages.dev`))),a=n;a||=i?`http://127.0.0.1:8888`:r&&r.host?`${r.protocol}//${r.host}`:`http://127.0.0.1:8888`,a=a.replace(/\/+$/,``);let o=a.replace(/^https?:/,e=>e===`https:`?`wss:`:`ws:`);return{httpUrl:a,wsUrl:`${o}/ws/control`}}function p(){let e=[];return typeof navigator<`u`&&(navigator.storage&&typeof navigator.storage.getDirectory==`function`&&e.push(`opfs`),`serviceWorker`in navigator&&typeof window<`u`&&`PushManager`in window&&e.push(`push`),(typeof document<`u`&&document.modelContext||navigator&&navigator.modelContext)&&e.push(`webmcp`)),typeof RTCPeerConnection<`u`&&e.push(`peerjs`),e}function m(){if(typeof navigator>`u`)return`ShadowClaw Node`;let e=navigator.userAgent,t=`Desktop`;/iPad/i.test(e)?t=`iPad`:/iPhone/i.test(e)?t=`iPhone`:/Android/i.test(e)?t=`Android`:/Macintosh/i.test(e)?t=`Mac`:/Windows/i.test(e)?t=`Windows`:/Linux/i.test(e)&&(t=`Linux`);let n=`Browser`;return/Chrome/i.test(e)&&!/Edg/i.test(e)?n=`Chrome`:/Safari/i.test(e)&&!/Chrome/i.test(e)?n=`Safari`:/Firefox/i.test(e)?n=`Firefox`:/Edg/i.test(e)&&(n=`Edge`),`${t} ${n}`}function h(){let e=``,t=``;typeof document<`u`&&(e=document.querySelector(`meta[name="version"]`)?.getAttribute(`content`)?.trim()||``,t=document.querySelector(`meta[name="revision"]`)?.getAttribute(`content`)?.trim()||``);let n=t.length>7?t.slice(0,7):t;return e&&n?`${e} (${n})`:e||n||`1.27.1`}let g=null;async function _(e,t={},n={}){let i=l(),a=m(),s=p();switch(e){case`send-message`:{if(!t.text)throw Error(`Missing text parameter`);let{orchestratorStore:e}=await import(`./orchestrator-DTzgyL23.js`).then(e=>e.n),r=n.orchestrator||e.orchestrator,i=t.groupId||e.activeGroupId||`br:main`;return r?.browserChat?.submit?(r.browserChat.submit(t.text,i),{queued:!0,groupId:i}):r?.submitMessage?(r.submitMessage(t.text,i),{queued:!0,groupId:i}):e.sendMessage?(e.sendMessage(t.text),{queued:!0,groupId:i}):{queued:!1,error:`Orchestrator not ready`}}case`list-tasks`:{let e=await r(),n=await o(e);return t?.groupId&&(n=n.filter(e=>e.groupId===t.groupId)),{tasks:n}}case`read-state`:{let{orchestratorStore:e}=await import(`./orchestrator-DTzgyL23.js`).then(e=>e.n),t=n.orchestrator||e.orchestrator;return{clientId:i,deviceLabel:a,capabilities:s,version:n.version||h(),activeGroupId:n.orchestrator?.activeGroupId||e.activeGroupId||t?.activeGroupId||`br:main`,state:n.orchestrator?.state||e.state||t?.state||`idle`}}case`list-tools`:{try{let{getWebMcpTools:e}=await import(`./webmcp-CJymew4t.js`).then(e=>e.s),t=await e();if(t&&t.length>0)return{tools:t.map(e=>({name:e.name,description:e.description,inputSchema:e.inputSchema,annotations:e.annotations}))}}catch{}try{let{orchestratorStore:e}=await import(`./orchestrator-DTzgyL23.js`).then(e=>e.n),r=n.orchestrator||e.orchestrator||(typeof document<`u`?document.querySelector(`shadow-claw`)?.orchestrator:null),i=t.groupId||r?.activeGroupId||e.activeGroupId||`br:main`,a=e.groups.find(e=>e.groupId===i);if(a?.toolTags&&a.toolTags.length>0){let{TOOL_DEFINITIONS:e}=await import(`./tools-CHxUdGxZ.js`).then(e=>e.n),{parseWebMcpInputSchema:t}=await import(`./webmcp-CJymew4t.js`).then(e=>e.s);return{tools:e.filter(e=>a.toolTags.includes(e.name)).map(e=>({name:e.name,description:e.description,inputSchema:t(e.input_schema)}))}}}catch{}let{TOOL_DEFINITIONS:e}=await import(`./tools-CHxUdGxZ.js`).then(e=>e.n),{parseWebMcpInputSchema:r}=await import(`./webmcp-CJymew4t.js`).then(e=>e.s);return{tools:e.map(e=>({name:e.name,description:e.description,inputSchema:r(e.input_schema)}))}}case`invoke-tool`:{if(!t.toolName)throw Error(`Missing toolName parameter`);try{let{orchestratorStore:e}=await import(`./orchestrator-DTzgyL23.js`).then(e=>e.n),{toolsStore:r}=await import(`./tools-DvQ_ngXn.js`).then(e=>e.n),i=n.orchestrator||e.orchestrator||(typeof document<`u`?document.querySelector(`shadow-claw`)?.orchestrator:null),a=t.groupId||i?.activeGroupId||e.activeGroupId||`br:main`,o=e.groups.find(e=>e.groupId===a);if(o?.toolTags&&o.toolTags.length>0){if(!o.toolTags.includes(t.toolName))throw Error(`Tool '${t.toolName}' is not enabled in the active conversation (${a}).`)}else if(r?.allTools&&r.allTools.some(e=>e.name===t.toolName)&&r?.enabledToolNames&&r.enabledToolNames.size>0){let e=r.enabledToolNames.has(t.toolName),n=r.isDeclarativeToolEnabled(t.toolName);if(!e&&!n)throw Error(`Tool '${t.toolName}' is not enabled on this client.`)}}catch(e){if(e.message&&e.message.includes(`is not enabled`))throw e}let e=typeof document<`u`&&document.modelContext||typeof navigator<`u`&&navigator.modelContext;if(e){let n;if(typeof e.getTools==`function`)try{let r=await e.getTools();if(Array.isArray(r)&&r.length>0){if(n=r.find(e=>e.name===t.toolName),!n)throw Error(`Tool '${t.toolName}' is not enabled or registered on this client.`)}else n=Array.isArray(r)?r.find(e=>e.name===t.toolName):void 0;if(n&&typeof n.execute==`function`)return{result:await n.execute(typeof t.input==`string`?JSON.parse(t.input):t.input||{})}}catch(e){if(e.message&&e.message.includes(`is not enabled`))throw e}let{executeWebMcpTool:r}=await import(`./webmcp-CJymew4t.js`).then(e=>e.s);if(typeof e.executeTool==`function`){if(n)try{return{result:await r(e,n,t.input)}}catch{}try{return{result:await r(e,{name:t.toolName},t.input)}}catch{}try{return{result:await r(e,t.toolName,t.input)}}catch{}}let i=typeof t.input==`string`?t.input:JSON.stringify(t.input||{});if(typeof navigator<`u`&&navigator.modelContextTesting&&typeof navigator.modelContextTesting.executeTool==`function`)try{return{result:await navigator.modelContextTesting.executeTool(t.toolName,i)}}catch{}if(typeof e.callTool==`function`)try{return{result:await e.callTool({name:t.toolName,arguments:typeof t.input==`string`?JSON.parse(t.input):t.input||{}})}}catch{}if(typeof e.invoke==`function`)try{return{result:await e.invoke(t.toolName,typeof t.input==`string`?JSON.parse(t.input):t.input||{})}}catch{}}let{orchestratorStore:r}=await import(`./orchestrator-DTzgyL23.js`).then(e=>e.n),i=n.orchestrator||r.orchestrator||(typeof document<`u`?document.querySelector(`shadow-claw`)?.orchestrator:null),a=i?.agentWorker;if(a&&typeof a.postMessage==`function`){let e=Date.now().toString(36)+Math.random().toString(36).slice(2),n=t.toolName===`ask_user`,r=t.timeoutMs||(n?3e5:6e4);return{result:await new Promise((n,o)=>{let s=setTimeout(()=>{a.removeEventListener(`message`,c),o(/* @__PURE__ */ Error(`Timeout waiting for tool execution`))},r),c=t=>{let r=t.data;r&&r.type===`execute-tool-result`&&r.callId===e&&(clearTimeout(s),a.removeEventListener(`message`,c),r.error?o(Error(r.error)):n(r.result))};a.addEventListener(`message`,c),a.postMessage({type:`execute-tool`,callId:e,payload:{name:t.toolName,input:typeof t.input==`string`?JSON.parse(t.input):t.input||{},groupId:t.groupId||i?.activeGroupId||`br:main`}})})}}throw Error(`Tool ${t.toolName} could not be executed (no context or worker available)`)}case`trigger-backup`:{let{orchestratorStore:e}=await import(`./orchestrator-DTzgyL23.js`).then(e=>e.n),a=t.groupId||n.orchestrator?.activeGroupId||e.activeGroupId||`br:main`,o=await r(),{getGroupDir:s}=await import(`./getGroupDir-BGGIJL4Y.js`).then(e=>e.n),c=await s(o,a);async function l(e,t=``){let n=[];for await(let[r,i]of e.entries()){let e=t?`${t}/${r}`:r;if(i.kind===`directory`){let t=await l(i,e);n.push(...t)}else n.push(e)}return n}async function u(e){try{let t=e.split(`/`),n=c;for(let e=0;e<t.length-1;e++)n=await n.getDirectoryHandle(t[e]);let r=await(await(await n.getFileHandle(t[t.length-1])).getFile()).arrayBuffer();return new Uint8Array(r)}catch{return null}}let{BackupController:d}=await import(`./backup-controller-B6GyG4vY.js`);return await new d({clientId:i,token:t.token,serverBaseUrl:f().httpUrl,fileEnumerator:()=>l(c),fileReader:e=>u(e)}).initiate()}default:throw Error(`Unknown action '${e}'`)}}function v(e={}){if(g){try{g.disconnect()}catch{}g=null}let n=e.clientId&&e.clientId.trim()||l(),r=p(),i=m(),a=e.version||h(),o=null;if(typeof localStorage<`u`)try{let e=localStorage.getItem(t.CONTROL_PLANE_TRANSPORT);(e===`sse`||e===`websocket`)&&(o=e)}catch{}let s=e.transport||o||`sse`,u;if(typeof localStorage<`u`)try{u=localStorage.getItem(t.PEERJS_MY_PEER_ID)||void 0}catch{}let{httpUrl:v,wsUrl:y}=f(),b=new c({clientId:n,deviceLabel:i,capabilities:r,version:a,peerId:u,transport:s,httpUrl:v,url:y,handlers:{"send-message":t=>_(`send-message`,t,e),"list-tasks":t=>_(`list-tasks`,t,e),"read-state":t=>_(`read-state`,t,e),"invoke-tool":t=>_(`invoke-tool`,t,e),"list-tools":t=>_(`list-tools`,t,e),"trigger-backup":t=>_(`trigger-backup`,t,e)}});return e.autoConnect!==!1&&d()&&b.connect(),g=b,b}function y(){return g}function b(){if(g){try{g.disconnect()}catch{}g=null}}async function x(e={}){let n=e.db;if(!n)try{n=await r()}catch{}if(!await u(n))return b(),null;if(!d())return null;if(typeof localStorage<`u`&&n)try{let{getConfig:e}=await import(`./getConfig-DSieAlsi.js`).then(e=>e.n),[r,i]=await Promise.all([e(n,t.CONTROL_PLANE_URL),e(n,t.CONTROL_PLANE_TRANSPORT)]);r&&localStorage.setItem(t.CONTROL_PLANE_URL,r),i&&localStorage.setItem(t.CONTROL_PLANE_TRANSPORT,i),localStorage.setItem(t.CONTROL_PLANE_ENABLED,`true`)}catch{}let i=y();return i?(i.ensureConnected(e.force),i):v(e)}export{m as detectDeviceLabel,x as ensureControlPlaneConnected,_ as executeClientControlCommand,l as getOrCreateControlPlaneClientId,u as isControlPlaneEnabled,d as shouldConnectControlPlane,b as stopControlPlaneClient};
1
+ import{i as e}from"./rolldown-runtime-DBVvNlSN.js";import{r as t}from"./config-071HSho8.js";import{o as n}from"./app-routes-CanH2f3S.js";import{r}from"./txPromise-DlzJBj9N.js";import{t as i}from"./browser-B1SoUj6D.js";import{t as a}from"./ulid-BSJxYh6W.js";import{t as o}from"./getAllTasks-C0FzJ32l.js";var s=/* @__PURE__ */ e(i(),1),c=class{_transport;_url;_httpUrl;_token;_clientId;_peerId;_deviceLabel;_capabilities;_version;_heartbeatIntervalMs;_reconnectDelayMs;_maxReconnectDelayMs;_handlers;_WebSocketClass;_EventSourceClass;_fetchFn;_ws=null;_es=null;_heartbeatTimer=null;_reconnectTimer=null;_currentReconnectDelay;_isDestroyed=!1;_state=`disconnected`;constructor(e){if(this._transport=e.transport||`sse`,this._clientId=e.clientId,this._peerId=e.peerId,this._deviceLabel=e.deviceLabel||`ShadowClaw Browser Client`,this._capabilities=e.capabilities||[`webmcp`,`opfs`,`push`],this._version=e.version||`1.27.1`,this._token=e.token,this._heartbeatIntervalMs=e.heartbeatIntervalMs||1e4,this._reconnectDelayMs=e.reconnectDelayMs||1e3,this._maxReconnectDelayMs=e.maxReconnectDelayMs||3e4,this._currentReconnectDelay=this._reconnectDelayMs,this._handlers=/* @__PURE__ */ new Map,this._WebSocketClass=e.WebSocketClass||(typeof WebSocket<`u`?WebSocket:null),this._EventSourceClass=e.EventSourceClass||(typeof EventSource<`u`?EventSource:null),this._fetchFn=e.fetchFn||(typeof fetch<`u`?fetch.bind(globalThis):(()=>Promise.reject(/* @__PURE__ */ Error(`fetch not available`)))),e.handlers)for(let[t,n]of Object.entries(e.handlers))this.registerHandler(t,n);let t=typeof location<`u`?location:null,n=t?`${t.protocol}//${t.host}`:`http://127.0.0.1:8888`,r=t?`${t.protocol===`https:`?`wss:`:`ws:`}//${t.host}`:`ws://127.0.0.1:8888`;this._url=e.url||`${r}/ws/control`,this._httpUrl=e.httpUrl||n}get transport(){return this._transport}get version(){return this._version}registerHandler(e,t){this._handlers.set(e,t)}unregisterHandler(e){this._handlers.delete(e)}getState(){return this._state}ensureConnected(e=!1){if(this._isDestroyed=!1,this._reconnectTimer&&=(clearTimeout(this._reconnectTimer),null),this._currentReconnectDelay=this._reconnectDelayMs,this._transport===`websocket`){let t=this._ws&&(this._ws.readyState===1||this._ws.readyState===this._WebSocketClass?.OPEN);(e||!t||this._state!==`connected`)&&(this._cleanupConnection(),this.connect())}else{let t=this._es&&(this._es.readyState===1||this._es.readyState===this._EventSourceClass?.OPEN);(e||!t||this._state!==`connected`)&&(this._cleanupConnection(),this.connect())}}connect(){this._isDestroyed||this._state===`connected`||this._state===`connecting`||(this._transport===`websocket`?this._connectWebSocket():this._connectSse())}_connectWebSocket(){if(!this._WebSocketClass){console.warn(`[ControlPlaneClient] WebSocket not supported in this environment`);return}this._state=`connecting`;let e=new URL(this._url,`ws://127.0.0.1:8888`);this._token&&e.searchParams.set(`token`,this._token);try{let t=new this._WebSocketClass(e.toString());this._ws=t,t.onopen=()=>{this._state=`connected`,this._currentReconnectDelay=this._reconnectDelayMs,this._sendRegister(),this._startHeartbeat()},t.onmessage=e=>{this._handleMessage(e.data)},t.onclose=()=>{this._cleanupConnection(),this._isDestroyed||this._scheduleReconnect()},t.onerror=e=>{console.warn(`[ControlPlaneClient] WebSocket error:`,e)}}catch(e){console.warn(`[ControlPlaneClient] Failed to establish WebSocket connection:`,e),this._cleanupConnection(),this._scheduleReconnect()}}_connectSse(){if(!this._EventSourceClass){(s.default===void 0||!s.default.env?.JEST_WORKER_ID)&&console.warn(`[ControlPlaneClient] EventSource not supported in this environment`);return}this._state=`connecting`;let e=new URL(`/api/control/events`,this._httpUrl);e.searchParams.set(`clientId`,this._clientId),this._token&&e.searchParams.set(`token`,this._token);try{let t=new this._EventSourceClass(e.toString());this._es=t,t.onopen=()=>{this._state=`connected`,this._currentReconnectDelay=this._reconnectDelayMs,this._sendRegister(),this._startHeartbeat()},typeof t.addEventListener==`function`&&t.addEventListener(`command:execute`,e=>{this._handleMessage(e.data)}),t.onmessage=e=>{this._handleMessage(e.data)},t.onerror=e=>{console.warn(`[ControlPlaneClient] SSE connection error:`,e),this._cleanupConnection(),this._isDestroyed||this._scheduleReconnect()}}catch(e){console.warn(`[ControlPlaneClient] Failed to establish SSE connection:`,e),this._cleanupConnection(),this._scheduleReconnect()}}disconnect(){this._isDestroyed=!0;try{this._sendUnregister()}catch{}this._cleanupConnection(),this._reconnectTimer&&=(clearTimeout(this._reconnectTimer),null)}_cleanupConnection(){if(this._state=`disconnected`,this._stopHeartbeat(),this._ws){try{this._ws.close()}catch{}this._ws=null}if(this._es){try{this._es.close()}catch{}this._es=null}}_scheduleReconnect(){this._reconnectTimer||this._isDestroyed||(this._reconnectTimer=setTimeout(()=>{this._reconnectTimer=null,this._isDestroyed||this.connect()},this._currentReconnectDelay),this._currentReconnectDelay=Math.min(this._currentReconnectDelay*1.5,this._maxReconnectDelayMs))}_startHeartbeat(){this._stopHeartbeat(),this._heartbeatTimer=setInterval(()=>{this._sendHeartbeat()},this._heartbeatIntervalMs)}_stopHeartbeat(){this._heartbeatTimer&&=(clearInterval(this._heartbeatTimer),null)}_sendRegister(){let e={clientId:this._clientId,deviceLabel:this._deviceLabel,capabilities:this._capabilities,version:this._version,transport:this._transport,peerId:this._peerId};this._sendMessage({id:a(),type:`client:register`,payload:e})}_sendHeartbeat(){let e={clientId:this._clientId,timestamp:Date.now()};this._sendMessage({id:a(),type:`client:heartbeat`,payload:e})}_sendUnregister(){if(!this._clientId)return;let e={clientId:this._clientId};this._sendMessage({id:a(),type:`client:unregister`,payload:e})}_sendMessage(e){if(this._transport===`websocket`){this._ws&&(this._ws.readyState===1||this._ws.readyState===this._WebSocketClass?.OPEN)&&this._ws.send(JSON.stringify(e));return}let t=new URL(`/api/control/messages`,this._httpUrl),n={"Content-Type":`application/json`};this._token&&(n[`x-control-token`]=this._token,n.Authorization=`Bearer ${this._token}`);let r={method:`POST`,headers:n,body:JSON.stringify(e)},i=t.hostname.toLowerCase(),a=i===`localhost`||i===`127.0.0.1`||i===`::1`||i===`[::1]`,o=/^(10\.|172\.(1[6-9]|2\d|3[01])\.|192\.168\.)/.test(i);a?r.targetAddressSpace=`loopback`:o&&(r.targetAddressSpace=`private`),this._fetchFn(t.toString(),r).catch(e=>{console.warn(`[ControlPlaneClient] Failed to send message via HTTP POST:`,e)})}async _handleMessage(e){if(!e||typeof e!=`string`)return;let t;try{t=JSON.parse(e)}catch{return}if(t.type===`command:execute`){let{commandId:e,action:n,args:r}=t.payload,i=this._handlers.get(n);if(!i){this._sendMessage({id:a(),type:`command:result`,replyTo:t.id,payload:{commandId:e,success:!1,error:`Unknown action: ${n}`}});return}try{let n=await i(r);this._sendMessage({id:a(),type:`command:result`,replyTo:t.id,payload:{commandId:e,success:!0,data:n}})}catch(n){this._sendMessage({id:a(),type:`command:result`,replyTo:t.id,payload:{commandId:e,success:!1,error:n.message||String(n)}})}}}};function l(){if(typeof localStorage<`u`)try{let e=localStorage.getItem(t.CONTROL_PLANE_CLIENT_ID);if(e&&e.trim())return e.trim()}catch{}let e=n(),r=e?`${e}-${a().toLowerCase()}`:`client-${a().toLowerCase()}`;if(typeof localStorage<`u`)try{localStorage.setItem(t.CONTROL_PLANE_CLIENT_ID,r)}catch{}return r}async function u(e){if(typeof localStorage<`u`)try{let e=localStorage.getItem(t.CONTROL_PLANE_ENABLED);if(e!==null)return e===`true`||e===`1`}catch{}if(e)try{let{getConfig:n}=await import(`./getConfig-DSieAlsi.js`).then(e=>e.n),r=await n(e,t.CONTROL_PLANE_ENABLED);if(r!=null)return r===`true`||r===`1`}catch{}return!1}function d(e){if(typeof EventSource>`u`&&typeof WebSocket>`u`)return!1;let t=e||(typeof location<`u`?location:null);return!(!t||t.protocol===`file:`||typeof document<`u`&&document.querySelector(`meta[name="shadowclaw-static-only"]`))}function f(e){let n=``;if(typeof localStorage<`u`)try{n=(localStorage.getItem(t.CONTROL_PLANE_URL)||``).trim()}catch{}let r=e||(typeof location<`u`?location:null),i=r&&(r.protocol===`file:`||r.hostname&&(r.hostname.endsWith(`.github.io`)||r.hostname.endsWith(`.pages.dev`))),a=n;a||=i?`http://127.0.0.1:8888`:r&&r.host?`${r.protocol}//${r.host}`:`http://127.0.0.1:8888`,a=a.replace(/\/+$/,``);let o=a.replace(/^https?:/,e=>e===`https:`?`wss:`:`ws:`);return{httpUrl:a,wsUrl:`${o}/ws/control`}}function p(){let e=[];return typeof navigator<`u`&&(navigator.storage&&typeof navigator.storage.getDirectory==`function`&&e.push(`opfs`),`serviceWorker`in navigator&&typeof window<`u`&&`PushManager`in window&&e.push(`push`),(typeof document<`u`&&document.modelContext||navigator&&navigator.modelContext)&&e.push(`webmcp`)),typeof RTCPeerConnection<`u`&&e.push(`peerjs`),e}function m(){if(typeof navigator>`u`)return`ShadowClaw Node`;let e=navigator.userAgent,t=`Desktop`;/iPad/i.test(e)?t=`iPad`:/iPhone/i.test(e)?t=`iPhone`:/Android/i.test(e)?t=`Android`:/Macintosh/i.test(e)?t=`Mac`:/Windows/i.test(e)?t=`Windows`:/Linux/i.test(e)&&(t=`Linux`);let n=`Browser`;return/Chrome/i.test(e)&&!/Edg/i.test(e)?n=`Chrome`:/Safari/i.test(e)&&!/Chrome/i.test(e)?n=`Safari`:/Firefox/i.test(e)?n=`Firefox`:/Edg/i.test(e)&&(n=`Edge`),`${t} ${n}`}function h(){let e=``,t=``;typeof document<`u`&&(e=document.querySelector(`meta[name="version"]`)?.getAttribute(`content`)?.trim()||``,t=document.querySelector(`meta[name="revision"]`)?.getAttribute(`content`)?.trim()||``);let n=t.length>7?t.slice(0,7):t;return e&&n?`${e} (${n})`:e||n||`1.27.1`}let g=null;async function _(e,t={},n={}){let i=l(),a=m(),s=p();switch(e){case`send-message`:{if(!t.text)throw Error(`Missing text parameter`);let{orchestratorStore:e}=await import(`./orchestrator-B7MpomoG.js`).then(e=>e.n),r=n.orchestrator||e.orchestrator,i=t.groupId||e.activeGroupId||`br:main`;return r?.browserChat?.submit?(r.browserChat.submit(t.text,i),{queued:!0,groupId:i}):r?.submitMessage?(r.submitMessage(t.text,i),{queued:!0,groupId:i}):e.sendMessage?(e.sendMessage(t.text),{queued:!0,groupId:i}):{queued:!1,error:`Orchestrator not ready`}}case`list-tasks`:{let e=await r(),n=await o(e);return t?.groupId&&(n=n.filter(e=>e.groupId===t.groupId)),{tasks:n}}case`read-state`:{let{orchestratorStore:e}=await import(`./orchestrator-B7MpomoG.js`).then(e=>e.n),t=n.orchestrator||e.orchestrator;return{clientId:i,deviceLabel:a,capabilities:s,version:n.version||h(),activeGroupId:n.orchestrator?.activeGroupId||e.activeGroupId||t?.activeGroupId||`br:main`,state:n.orchestrator?.state||e.state||t?.state||`idle`}}case`list-tools`:{try{let{getWebMcpTools:e}=await import(`./webmcp-CkfDZfZ0.js`).then(e=>e.s),t=await e();if(t&&t.length>0)return{tools:t.map(e=>({name:e.name,description:e.description,inputSchema:e.inputSchema,annotations:e.annotations}))}}catch{}try{let{orchestratorStore:e}=await import(`./orchestrator-B7MpomoG.js`).then(e=>e.n),r=n.orchestrator||e.orchestrator||(typeof document<`u`?document.querySelector(`shadow-claw`)?.orchestrator:null),i=t.groupId||r?.activeGroupId||e.activeGroupId||`br:main`,a=e.groups.find(e=>e.groupId===i);if(a?.toolTags&&a.toolTags.length>0){let{TOOL_DEFINITIONS:e}=await import(`./tools-CHxUdGxZ.js`).then(e=>e.n),{parseWebMcpInputSchema:t}=await import(`./webmcp-CkfDZfZ0.js`).then(e=>e.s);return{tools:e.filter(e=>a.toolTags.includes(e.name)).map(e=>({name:e.name,description:e.description,inputSchema:t(e.input_schema)}))}}}catch{}let{TOOL_DEFINITIONS:e}=await import(`./tools-CHxUdGxZ.js`).then(e=>e.n),{parseWebMcpInputSchema:r}=await import(`./webmcp-CkfDZfZ0.js`).then(e=>e.s);return{tools:e.map(e=>({name:e.name,description:e.description,inputSchema:r(e.input_schema)}))}}case`invoke-tool`:{if(!t.toolName)throw Error(`Missing toolName parameter`);try{let{orchestratorStore:e}=await import(`./orchestrator-B7MpomoG.js`).then(e=>e.n),{toolsStore:r}=await import(`./tools-BpZh7hgB.js`).then(e=>e.n),i=n.orchestrator||e.orchestrator||(typeof document<`u`?document.querySelector(`shadow-claw`)?.orchestrator:null),a=t.groupId||i?.activeGroupId||e.activeGroupId||`br:main`,o=e.groups.find(e=>e.groupId===a);if(o?.toolTags&&o.toolTags.length>0){if(!o.toolTags.includes(t.toolName))throw Error(`Tool '${t.toolName}' is not enabled in the active conversation (${a}).`)}else if(r?.allTools&&r.allTools.some(e=>e.name===t.toolName)&&r?.enabledToolNames&&r.enabledToolNames.size>0){let e=r.enabledToolNames.has(t.toolName),n=r.isDeclarativeToolEnabled(t.toolName);if(!e&&!n)throw Error(`Tool '${t.toolName}' is not enabled on this client.`)}}catch(e){if(e.message&&e.message.includes(`is not enabled`))throw e}let e=typeof document<`u`&&document.modelContext||typeof navigator<`u`&&navigator.modelContext;if(e){let n;if(typeof e.getTools==`function`)try{let r=await e.getTools();if(Array.isArray(r)&&r.length>0){if(n=r.find(e=>e.name===t.toolName),!n)throw Error(`Tool '${t.toolName}' is not enabled or registered on this client.`)}else n=Array.isArray(r)?r.find(e=>e.name===t.toolName):void 0;if(n&&typeof n.execute==`function`)return{result:await n.execute(typeof t.input==`string`?JSON.parse(t.input):t.input||{})}}catch(e){if(e.message&&e.message.includes(`is not enabled`))throw e}let{executeWebMcpTool:r}=await import(`./webmcp-CkfDZfZ0.js`).then(e=>e.s);if(typeof e.executeTool==`function`){if(n)try{return{result:await r(e,n,t.input)}}catch{}try{return{result:await r(e,{name:t.toolName},t.input)}}catch{}try{return{result:await r(e,t.toolName,t.input)}}catch{}}let i=typeof t.input==`string`?t.input:JSON.stringify(t.input||{});if(typeof navigator<`u`&&navigator.modelContextTesting&&typeof navigator.modelContextTesting.executeTool==`function`)try{return{result:await navigator.modelContextTesting.executeTool(t.toolName,i)}}catch{}if(typeof e.callTool==`function`)try{return{result:await e.callTool({name:t.toolName,arguments:typeof t.input==`string`?JSON.parse(t.input):t.input||{}})}}catch{}if(typeof e.invoke==`function`)try{return{result:await e.invoke(t.toolName,typeof t.input==`string`?JSON.parse(t.input):t.input||{})}}catch{}}let{orchestratorStore:r}=await import(`./orchestrator-B7MpomoG.js`).then(e=>e.n),i=n.orchestrator||r.orchestrator||(typeof document<`u`?document.querySelector(`shadow-claw`)?.orchestrator:null),a=i?.agentWorker;if(a&&typeof a.postMessage==`function`){let e=Date.now().toString(36)+Math.random().toString(36).slice(2),n=t.toolName===`ask_user`,r=t.timeoutMs||(n?3e5:6e4);return{result:await new Promise((n,o)=>{let s=setTimeout(()=>{a.removeEventListener(`message`,c),o(/* @__PURE__ */ Error(`Timeout waiting for tool execution`))},r),c=t=>{let r=t.data;r&&r.type===`execute-tool-result`&&r.callId===e&&(clearTimeout(s),a.removeEventListener(`message`,c),r.error?o(Error(r.error)):n(r.result))};a.addEventListener(`message`,c),a.postMessage({type:`execute-tool`,callId:e,payload:{name:t.toolName,input:typeof t.input==`string`?JSON.parse(t.input):t.input||{},groupId:t.groupId||i?.activeGroupId||`br:main`}})})}}throw Error(`Tool ${t.toolName} could not be executed (no context or worker available)`)}case`trigger-backup`:{let{orchestratorStore:e}=await import(`./orchestrator-B7MpomoG.js`).then(e=>e.n),a=t.groupId||n.orchestrator?.activeGroupId||e.activeGroupId||`br:main`,o=await r(),{getGroupDir:s}=await import(`./getGroupDir-Bj5XCflQ.js`).then(e=>e.n),c=await s(o,a);async function l(e,t=``){let n=[];for await(let[r,i]of e.entries()){let e=t?`${t}/${r}`:r;if(i.kind===`directory`){let t=await l(i,e);n.push(...t)}else n.push(e)}return n}async function u(e){try{let t=e.split(`/`),n=c;for(let e=0;e<t.length-1;e++)n=await n.getDirectoryHandle(t[e]);let r=await(await(await n.getFileHandle(t[t.length-1])).getFile()).arrayBuffer();return new Uint8Array(r)}catch{return null}}let{BackupController:d}=await import(`./backup-controller-B6GyG4vY.js`);return await new d({clientId:i,token:t.token,serverBaseUrl:f().httpUrl,fileEnumerator:()=>l(c),fileReader:e=>u(e)}).initiate()}default:throw Error(`Unknown action '${e}'`)}}function v(e={}){if(g){try{g.disconnect()}catch{}g=null}let n=e.clientId&&e.clientId.trim()||l(),r=p(),i=m(),a=e.version||h(),o=null;if(typeof localStorage<`u`)try{let e=localStorage.getItem(t.CONTROL_PLANE_TRANSPORT);(e===`sse`||e===`websocket`)&&(o=e)}catch{}let s=e.transport||o||`sse`,u;if(typeof localStorage<`u`)try{u=localStorage.getItem(t.PEERJS_MY_PEER_ID)||void 0}catch{}let{httpUrl:v,wsUrl:y}=f(),b=new c({clientId:n,deviceLabel:i,capabilities:r,version:a,peerId:u,transport:s,httpUrl:v,url:y,handlers:{"send-message":t=>_(`send-message`,t,e),"list-tasks":t=>_(`list-tasks`,t,e),"read-state":t=>_(`read-state`,t,e),"invoke-tool":t=>_(`invoke-tool`,t,e),"list-tools":t=>_(`list-tools`,t,e),"trigger-backup":t=>_(`trigger-backup`,t,e)}});return e.autoConnect!==!1&&d()&&b.connect(),g=b,b}function y(){return g}function b(){if(g){try{g.disconnect()}catch{}g=null}}async function x(e={}){let n=e.db;if(!n)try{n=await r()}catch{}if(!await u(n))return b(),null;if(!d())return null;if(typeof localStorage<`u`&&n)try{let{getConfig:e}=await import(`./getConfig-DSieAlsi.js`).then(e=>e.n),[r,i]=await Promise.all([e(n,t.CONTROL_PLANE_URL),e(n,t.CONTROL_PLANE_TRANSPORT)]);r&&localStorage.setItem(t.CONTROL_PLANE_URL,r),i&&localStorage.setItem(t.CONTROL_PLANE_TRANSPORT,i),localStorage.setItem(t.CONTROL_PLANE_ENABLED,`true`)}catch{}let i=y();return i?(i.ensureConnected(e.force),i):v(e)}export{m as detectDeviceLabel,x as ensureControlPlaneConnected,_ as executeClientControlCommand,l as getOrCreateControlPlaneClientId,u as isControlPlaneEnabled,d as shouldConnectControlPlane,b as stopControlPlaneClient};
@@ -1,4 +1,4 @@
1
- <!doctype html><html lang="en"><head><title>ShadowClaw</title><meta charset="utf-8"><meta name="revision" content="62dc4114af024c80ff58ee6b715e11c6d423d047" /><meta name="version" content="1.51.0" /><meta name="viewport" content="width=device-width,initial-scale=1,viewport-fit=cover"><meta name="description" content="ShadowClaw - multi-runtime AI assistant." /><link rel="canonical" href="https://xt-ml.github.io/shadow-claw/"><meta property="og:title" content="ShadowClaw"><meta property="og:description" content="Multi-runtime AI assistant with local and remote LLM orchestration, Web Workers, OPFS storage, and agentic tool execution."><meta property="og:type" content="website"><meta property="og:url" content="https://xt-ml.github.io/shadow-claw/"><meta property="og:image" content="https://xt-ml.github.io/shadow-claw/assets/icons/512.png"><meta name="twitter:card" content="summary"><meta name="twitter:title" content="ShadowClaw"><meta name="twitter:description" content="Multi-runtime AI assistant with local and remote LLM orchestration, Web Workers, OPFS storage, and agentic tool execution."><meta name="twitter:image" content="https://xt-ml.github.io/shadow-claw/assets/icons/512.png"><script type="application/ld+json">{"@context":"https://schema.org","@graph":[{"@type":"SoftwareApplication","@id":"https://xt-ml.github.io/shadow-claw/#software","name":"ShadowClaw","description":"Multi-runtime AI assistant with local and remote LLM orchestration, Web Workers, OPFS storage, and agentic tool execution.","url":"https://xt-ml.github.io/shadow-claw/","applicationCategory":"DeveloperApplication","operatingSystem":"Web, Browser, Desktop","offers":{"@type":"Offer","price":"0","priceCurrency":"USD"},"author":{"@type":"Organization","name":"xt-ml","url":"https://github.com/xt-ml"},"codeRepository":"https://github.com/xt-ml/shadow-claw","license":"https://github.com/xt-ml/shadow-claw/blob/main/LICENSE"},{"@type":"WebSite","@id":"https://xt-ml.github.io/shadow-claw/#website","url":"https://xt-ml.github.io/shadow-claw/","name":"ShadowClaw","description":"Official website and live deployment of ShadowClaw multi-runtime AI assistant.","publisher":{"@type":"Organization","name":"xt-ml","url":"https://github.com/xt-ml"}},{"@type":"Organization","@id":"https://xt-ml.github.io/shadow-claw/#organization","name":"xt-ml","url":"https://github.com/xt-ml","sameAs":["https://github.com/xt-ml"]}]}</script><meta name="theme-color" content="#fff" /><meta http-equiv="origin-trial" content="A88uTgESYWcVgREKVReKB6jom41uP8TzW6ei3jNdidf+Xl6ONqKRjKNBphsxhrZmdkakLK3oXDgkGq53rtZYSAMAAAB2eyJvcmlnaW4iOiJodHRwczovL3h0LW1sLmdpdGh1Yi5pbzo0NDMiLCJmZWF0dXJlIjoiV2ViTUNQIiwiZXhwaXJ5IjoxNzk0ODczNjAwLCJpc1N1YmRvbWFpbiI6dHJ1ZSwiaXNUaGlyZFBhcnR5Ijp0cnVlfQ=="><base href="/shadow-claw/" /><script id="shadow-claw-site-config" type="application/json">{"$schema":"https:\u002f\u002fjson-schema.org\u002fdraft\u002f2020-12\u002fschema","site":{"title":"ShadowClaw","description":"ShadowClaw - multi-runtime AI assistant.","themeColor":"#fff"},"branding":{"siteUrl":"https:\u002f\u002fxt-ml.github.io\u002fshadow-claw\u002f","faviconPath":"assets\u002ficons\u002ffavicon.ico","appleTouchIconPath":"assets\u002ficons\u002f180.png","notFoundPath":"404.html"},"pwa":{"manifestPath":"manifest.json","themeColor":"#000000"},"assets":["assets"],"sidebar":{"pagesHidden":false,"chatHidden":false,"tasksHidden":false,"filesHidden":false,"defaultPage":"pages"},"pages":{"allowList":[],"denyList":[]},"settings":{"defaultToolsProfile":"__builtin_default"},"agent":{"defaultProvider":"transformers_js_local","defaultModel":"onnx-community\u002fgemma-4-E2B-it-ONNX"},"customElements":{"allowedElements":["block-garden","block-garden-option","block-garden-select"],"allowedDomains":["kherrick.github.io","cdn.jsdelivr.net"]},"security":{"connectSrc":["'self'","blob:","data:","https:\u002f\u002fkherrick.github.io","https:\u002f\u002fcdn.jsdelivr.net"]}}</script>
1
+ <!doctype html><html lang="en"><head><title>ShadowClaw</title><meta charset="utf-8"><meta name="revision" content="6cdfc4a8fa48baa09fb18801514bb2a1109a9c61" /><meta name="version" content="1.52.0" /><meta name="viewport" content="width=device-width,initial-scale=1,viewport-fit=cover"><meta name="description" content="ShadowClaw - multi-runtime AI assistant." /><link rel="canonical" href="https://xt-ml.github.io/shadow-claw/"><meta property="og:title" content="ShadowClaw"><meta property="og:description" content="Multi-runtime AI assistant with local and remote LLM orchestration, Web Workers, OPFS storage, and agentic tool execution."><meta property="og:type" content="website"><meta property="og:url" content="https://xt-ml.github.io/shadow-claw/"><meta property="og:image" content="https://xt-ml.github.io/shadow-claw/assets/icons/512.png"><meta name="twitter:card" content="summary"><meta name="twitter:title" content="ShadowClaw"><meta name="twitter:description" content="Multi-runtime AI assistant with local and remote LLM orchestration, Web Workers, OPFS storage, and agentic tool execution."><meta name="twitter:image" content="https://xt-ml.github.io/shadow-claw/assets/icons/512.png"><script type="application/ld+json">{"@context":"https://schema.org","@graph":[{"@type":"SoftwareApplication","@id":"https://xt-ml.github.io/shadow-claw/#software","name":"ShadowClaw","description":"Multi-runtime AI assistant with local and remote LLM orchestration, Web Workers, OPFS storage, and agentic tool execution.","url":"https://xt-ml.github.io/shadow-claw/","applicationCategory":"DeveloperApplication","operatingSystem":"Web, Browser, Desktop","offers":{"@type":"Offer","price":"0","priceCurrency":"USD"},"author":{"@type":"Organization","name":"xt-ml","url":"https://github.com/xt-ml"},"codeRepository":"https://github.com/xt-ml/shadow-claw","license":"https://github.com/xt-ml/shadow-claw/blob/main/LICENSE"},{"@type":"WebSite","@id":"https://xt-ml.github.io/shadow-claw/#website","url":"https://xt-ml.github.io/shadow-claw/","name":"ShadowClaw","description":"Official website and live deployment of ShadowClaw multi-runtime AI assistant.","publisher":{"@type":"Organization","name":"xt-ml","url":"https://github.com/xt-ml"}},{"@type":"Organization","@id":"https://xt-ml.github.io/shadow-claw/#organization","name":"xt-ml","url":"https://github.com/xt-ml","sameAs":["https://github.com/xt-ml"]}]}</script><meta name="theme-color" content="#fff" /><meta http-equiv="origin-trial" content="A4bwm3ftxmSutme0zCvNMbjdZ4Efbdzz1x2bgmL6RSBDjHVU4Cz5Paeurxk0LO5uyNZjcyaAM+3fQFuCu0XbJwQAAAB2eyJvcmlnaW4iOiJodHRwczovL3h0LW1sLmdpdGh1Yi5pbzo0NDMiLCJmZWF0dXJlIjoiV2ViTUNQIiwiZXhwaXJ5IjoxODA2MzY0ODAwLCJpc1N1YmRvbWFpbiI6dHJ1ZSwiaXNUaGlyZFBhcnR5Ijp0cnVlfQ=="><base href="/shadow-claw/" /><script id="shadow-claw-site-config" type="application/json">{"$schema":"https:\u002f\u002fjson-schema.org\u002fdraft\u002f2020-12\u002fschema","site":{"title":"ShadowClaw","description":"ShadowClaw - multi-runtime AI assistant.","themeColor":"#fff"},"branding":{"siteUrl":"https:\u002f\u002fxt-ml.github.io\u002fshadow-claw\u002f","faviconPath":"assets\u002ficons\u002ffavicon.ico","appleTouchIconPath":"assets\u002ficons\u002f180.png","notFoundPath":"404.html"},"pwa":{"manifestPath":"manifest.json","themeColor":"#000000"},"assets":["assets"],"sidebar":{"pagesHidden":false,"chatHidden":false,"tasksHidden":false,"filesHidden":false,"defaultPage":"pages"},"pages":{"allowList":[],"denyList":[]},"settings":{"defaultToolsProfile":"__builtin_default"},"agent":{"defaultProvider":"transformers_js_local","defaultModel":"onnx-community\u002fgemma-4-E2B-it-ONNX"},"customElements":{"allowedElements":["block-garden","block-garden-option","block-garden-select"],"allowedDomains":["kherrick.github.io","cdn.jsdelivr.net"]},"security":{"connectSrc":["'self'","blob:","data:","https:\u002f\u002fkherrick.github.io","https:\u002f\u002fcdn.jsdelivr.net"]}}</script>
2
2
  <script>var ShadowClawThemeInit=(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:`Module`});var t=(e,t)=>()=>(t||(e((t={exports:{}}).exports,t),e=null),t.exports);function n(){if(globalThis.trustedTypes)return;let e=/* @__PURE__ */ new Map;globalThis.trustedTypes={createPolicy:(t,n)=>{if(e.has(t))throw TypeError(`Policy with name "${t}" already exists.`);let r={createHTML:n.createHTML?e=>n.createHTML(e):void 0,createScriptURL:n.createScriptURL?e=>n.createScriptURL(e):void 0,createScript:n.createScript?e=>n.createScript(e):void 0};return e.set(t,r),r},getPolicy:t=>e.get(t)??null,isHTML:e=>typeof e==`string`||e instanceof Object&&`toString`in e,isScriptURL:e=>typeof e==`string`||e instanceof Object&&`toString`in e,isScript:e=>typeof e==`string`||e instanceof Object&&`toString`in e}}let r=`__shadowClawDefaultTrustedTypesPolicyState`,i=`default`,a=`shadowclaw-sandbox`;function o(){let e=globalThis;return e[r]||(e[r]={initialized:!1,policy:null}),e[r]}function s(){let e=o();if(e.initialized)return;let t=Reflect.get(globalThis,`trustedTypes`);if(t&&typeof t.createPolicy==`function`){e.initialized=!0;try{if(typeof t.getPolicy==`function`){let n=t.getPolicy(i);if(n){e.policy=n;return}}let n=!1;if(typeof t.getPolicyNames==`function`){let e=t.getPolicyNames();Array.isArray(e)&&e.includes(i)&&(n=!0)}if(n){if(typeof t.getPolicy==`function`){let n=t.getPolicy(a);if(n){e.policy=n;return}}e.policy=t.createPolicy(a,{createHTML:e=>e,createScriptURL:e=>e});return}e.policy=t.createPolicy(i,{createHTML:e=>e,createScriptURL:e=>e})}catch{typeof t.getPolicy==`function`&&(e.policy=t.getPolicy(i)??t.getPolicy(a)??null)}}}let c=[{id:`claude-fable-5`,provider:`anthropic`,contextWindow:1e6,maxOutput:128e3,supportsImages:!0,supportsDocuments:!0,supportsThinking:!0,supportsPromptCaching:!0},{id:`claude-fable-5.1`,provider:`anthropic`,contextWindow:1e6,maxOutput:128e3,supportsImages:!0,supportsDocuments:!0,supportsThinking:!0,supportsPromptCaching:!0},{id:`claude-fable`,provider:`anthropic`,contextWindow:1e6,maxOutput:128e3,supportsImages:!0,supportsDocuments:!0,supportsThinking:!0,supportsPromptCaching:!0},{id:`claude-sonnet-5`,provider:`anthropic`,contextWindow:1e6,maxOutput:128e3,supportsImages:!0,supportsDocuments:!0,supportsThinking:!0,supportsPromptCaching:!0},{id:`claude-opus-5`,provider:`anthropic`,contextWindow:1e6,maxOutput:128e3,supportsImages:!0,supportsDocuments:!0,supportsThinking:!0,supportsPromptCaching:!0},{id:`claude-opus-4.8`,provider:`anthropic`,contextWindow:1e6,maxOutput:128e3,supportsImages:!0,supportsDocuments:!0,supportsThinking:!0,supportsPromptCaching:!0},{id:`claude-haiku-5`,provider:`anthropic`,contextWindow:1e6,maxOutput:128e3,supportsImages:!0,supportsDocuments:!0,supportsPromptCaching:!0},{id:`claude-mythos-5`,provider:`anthropic`,contextWindow:1e6,maxOutput:128e3,supportsImages:!0,supportsDocuments:!0,supportsThinking:!0,supportsPromptCaching:!0},{id:`claude-mythos`,provider:`anthropic`,contextWindow:1e6,maxOutput:128e3,supportsImages:!0,supportsDocuments:!0,supportsThinking:!0,supportsPromptCaching:!0},{id:`gpt-6-astra`,provider:`openai`,contextWindow:105e4,maxOutput:128e3,supportsImages:!0,supportsDocuments:!0,supportsAudio:!0,supportsVideo:!0,supportsThinking:!1,supportsPromptCaching:!1},{id:`gpt-6-sol`,provider:`openai`,contextWindow:105e4,maxOutput:128e3,supportsImages:!0,supportsDocuments:!0,supportsThinking:!1,supportsPromptCaching:!1},{id:`gpt-6-luna`,provider:`openai`,contextWindow:1e6,maxOutput:64e3,supportsImages:!0,supportsDocuments:!0,supportsThinking:!1,supportsPromptCaching:!1},{id:`gpt-6`,provider:`openai`,contextWindow:105e4,maxOutput:128e3,supportsImages:!0,supportsDocuments:!0,supportsThinking:!1,supportsPromptCaching:!1},{id:`astra`,provider:`openai`,contextWindow:105e4,maxOutput:128e3,supportsImages:!0,supportsDocuments:!0,supportsAudio:!0,supportsVideo:!0,supportsThinking:!1,supportsPromptCaching:!1},{id:`gpt-5`,provider:`openai`,contextWindow:4e5,maxOutput:128e3,supportsImages:!0,supportsDocuments:!0,supportsThinking:!1,supportsPromptCaching:!1},{id:`gemini-3.5-pro`,provider:`google`,contextWindow:2097152,maxOutput:65536,supportsImages:!0,supportsDocuments:!0,supportsAudio:!0,supportsVideo:!0,supportsThinking:!1,supportsPromptCaching:!1},{id:`gemini-3.5-flash`,provider:`google`,contextWindow:1048576,maxOutput:65536,supportsImages:!0,supportsDocuments:!0,supportsAudio:!0,supportsVideo:!0,supportsThinking:!1,supportsPromptCaching:!1},{id:`gemini-3.8-flash`,provider:`google`,contextWindow:1048576,maxOutput:65536,supportsImages:!0,supportsDocuments:!0,supportsAudio:!0,supportsVideo:!0,supportsThinking:!1,supportsPromptCaching:!1},{id:`gemini-2.5-pro`,provider:`google`,contextWindow:1048576,maxOutput:65536,supportsImages:!0,supportsDocuments:!0,supportsAudio:!0,supportsVideo:!0,supportsThinking:!1,supportsPromptCaching:!1},{id:`gemini-2.5-flash`,provider:`google`,contextWindow:1048576,maxOutput:65536,supportsImages:!0,supportsDocuments:!0,supportsAudio:!0,supportsVideo:!0,supportsThinking:!1,supportsPromptCaching:!1}],l;function u(e){l=e}function d(e){let t=e||l;if(t)for(let e of c)t.registerModelInfo(e.id,{contextWindow:e.contextWindow,maxOutput:e.maxOutput,supportsImageInput:e.supportsImages,supportsDocumentInput:e.supportsDocuments,...e.supportsAudio!==void 0&&{supportsAudioInput:e.supportsAudio},...e.supportsVideo!==void 0&&{supportsVideoInput:e.supportsVideo},...e.supportsPromptCaching!==void 0&&{supportsPromptCaching:e.supportsPromptCaching}})}u(new class{loading=!1;models=/* @__PURE__ */ new Map;getModelInfo(e){if(!e||typeof e!=`string`)return null;let t=e.toLowerCase().trim(),n=this.models.get(t);if(n)return n;if(t.includes(`/`)){let e=t.split(`/`).pop();if(e&&this.models.has(e))return this.models.get(e)}else for(let[e,n]of this.models.entries())if(e.endsWith(`/${t}`))return n;if(t.includes(`:`)){let e=t.split(`:`)[0],n=this.getModelInfo(e);if(n)return n}return null}registerModelInfo(e,t){this.models.set(e.toLowerCase(),t)}clear(){this.models.clear()}seedStaticCatalog(){d(this)}async fetchModelInfo(e,t,n){if(e.modelsUrl){this.loading=!0;try{let r=new Headers;if(r.set(`Content-Type`,`application/json`),e.headers)for(let[t,n]of Object.entries(e.headers))r.set(t,n);if(n)for(let[e,t]of Object.entries(n))r.set(e,t);if(t&&e.apiKeyHeader){let n=e.apiKeyHeaderFormat;r.set(e.apiKeyHeader,n?n.replace(`{key}`,t):t)}let i=await fetch(e.modelsUrl,{headers:r});if(!i.ok)throw Error(`HTTP ${i.status} ${i.statusText}`);let a=await i.json(),o=Array.isArray(a.data)?a.data:Array.isArray(a.models)?a.models:[];for(let e of o){if(!e.id)continue;let t=e.context_length??e.context_window??0,n=e.max_completion_tokens||e.per_request_limits?.completion_tokens||e.top_provider?.max_completion_tokens||null,r=typeof e.supports_tools==`boolean`?e.supports_tools:typeof e.supportsTools==`boolean`?e.supportsTools:void 0,i=this.extractModalities(e,`input`),a=this.extractModalities(e,`output`),o=this.modalitiesInclude(i,`image`,`vision`),s=this.modalitiesInclude(i,`audio`,`voice`,`hearing`),c=this.modalitiesInclude(i,`video`),l=this.modalitiesInclude(i,`document`,`pdf`,`file`)||(typeof e.supports_document_input==`boolean`?e.supports_document_input:typeof e.supportsDocumentInput==`boolean`?e.supportsDocumentInput:void 0),u=e.id===`openrouter/free`||this.supportedParametersInclude(e,`image`,`vision`,`audio`,`tool`,`structured`),d=this.extractReasoning(e),f=typeof e.supports_prompt_caching==`boolean`?e.supports_prompt_caching:typeof e.supportsPromptCaching==`boolean`?e.supportsPromptCaching:this.supportedParametersInclude(e,`cache_control`,`prompt_caching`)?!0:void 0;!t&&Array.isArray(e.providers)&&e.providers.length>0&&(t=e.providers[0]?.context_length||0),this.registerModelInfo(e.id,{contextWindow:t,maxOutput:n,...r!==void 0&&{supportsTools:r},...i.length>0&&{inputModalities:i},...a.length>0&&{outputModalities:a},...o!==void 0&&{supportsImageInput:o},...s!==void 0&&{supportsAudioInput:s},...c!==void 0&&{supportsVideoInput:c},...l!==void 0&&{supportsDocumentInput:l},...d&&{reasoning:d},...u&&{routesByRequestFeatures:u},...f!==void 0&&{supportsPromptCaching:f}})}o.length>0&&console.log(`[ModelRegistry] Registered ${o.length} models for provider "${e.id}"`)}catch(t){console.error(`[ModelRegistry] Error fetching models for ${e.id}:`,t)}finally{this.loading=!1}}}extractModalities(e,t){let n=t===`input`?e.input_modalities||e.inputModalities:e.output_modalities||e.outputModalities,r=e.architecture||{},i=t===`input`?r.input_modalities||r.inputModalities:r.output_modalities||r.outputModalities,a=typeof r.modality==`string`?r.modality:``,o=this.parseArchitectureModality(a,t),s=[...this.normalizeStringArray(n),...this.normalizeStringArray(i),...o];return Array.from(new Set(s))}extractReasoning(e){let t=e?.reasoning;if(!t||typeof t!=`object`)return;let n=this.normalizeStringArray(t.supported_efforts),r=typeof t.default_effort==`string`?t.default_effort.toLowerCase():void 0,i=typeof t.default_enabled==`boolean`?t.default_enabled:void 0,a=typeof t.supports_max_tokens==`boolean`?t.supports_max_tokens:void 0,o=typeof t.mandatory==`boolean`?t.mandatory:void 0;if(n.length!==0||r!==void 0||i!==void 0||a!==void 0||o!==void 0)return{...n.length>0&&{supportedEfforts:n},...r!==void 0&&{defaultEffort:r},...i!==void 0&&{defaultEnabled:i},...a!==void 0&&{supportsMaxTokens:a},...o!==void 0&&{mandatory:o}}}modalitiesInclude(e,...t){if(e.length!==0)return t.some(t=>e.some(e=>e.includes(t)))}normalizeStringArray(e){return Array.isArray(e)?e.filter(e=>typeof e==`string`).map(e=>e.toLowerCase()):[]}parseArchitectureModality(e,t){if(!e)return[];let[n=``,r=``]=e.toLowerCase().split(`->`).map(e=>e.trim());return(t===`input`?n:r).split(/[+,/\s]+/).map(e=>e.trim()).filter(Boolean)}supportedParametersInclude(e,...t){let n=this.normalizeStringArray(e.supported_parameters||e.supportedParameters);return t.some(e=>n.some(t=>t.includes(e)))}});function f(e){return e.replace(/^\/+|\/+$/g,``)}function p(e){let t=f(e);return t.endsWith(`/index.html`)?t=t.slice(0,-11):t.endsWith(`index.html`)&&(t=t.slice(0,-10)),f(t)}function ee(e){let t=f(e),n=t.split(`/`).filter(Boolean);if(n.length===0)return null;let r=n[0].toLowerCase();if(r===`pages`){if(n.length>=3){let e=n[1];return{page:`pages`,groupId:e===`main`?`br:main`:e.startsWith(`br-`)?`br:${e.slice(3)}`:e,path:n.slice(2).join(`/`)}}return{page:`pages`,groupId:`br:main`,path:n.slice(1).join(`/`)}}if(r===`files`){let e=n[1]||`main`;return{page:`files`,groupId:e===`main`?`br:main`:e.startsWith(`br-`)?`br:${e.slice(3)}`:e,path:n.slice(2).join(`/`)||void 0}}if(r===`chat`){let e=n[1]||`main`;return{page:`chat`,groupId:e===`main`?`br:main`:e.startsWith(`br-`)?`br:${e.slice(3)}`:e}}if(r===`tasks`){let e=n[1]||`main`;return{page:`tasks`,groupId:e===`main`?`br:main`:e.startsWith(`br-`)?`br:${e.slice(3)}`:e}}return r===`main`?{page:`pages`,groupId:`br:main`,path:n.slice(1).join(`/`)}:{page:`pages`,groupId:`br:main`,path:t}}function te(){if(typeof document<`u`){let e=document.getElementById(`shadow-claw-static-routing`);if(e&&e.textContent)try{let t=JSON.parse(e.textContent);if(t&&typeof t==`object`&&t.routes)return t}catch(e){console.warn(`Failed to parse embedded static routing manifest:`,e)}}return null}function m(e,t){let n=t||te();if(!n||!n.routes)return null;let r=p(e);for(let[e,t]of Object.entries(n.routes))if(t&&t.prettyPath&&p(t.prettyPath)===r)return ee(e);return null}let h=null,ne=/* @__PURE__ */ new Set([`chat`,`files`,`tasks`,`pages`,`settings`,`tools`,`channels`]);function re(){h=null}typeof globalThis<`u`&&(globalThis.__applyBasePathCacheReset=re);function g(){let e=typeof window<`u`?window:typeof self<`u`?self:globalThis;if(e&&e.__SHADOWCLAW_DEPLOY_ID__){let t=String(e.__SHADOWCLAW_DEPLOY_ID__).trim();if(t)return t.replace(/[^a-zA-Z0-9_-]/g,`-`)}let t=globalThis.process;if(t&&t.env&&t.env.SHADOWCLAW_DEPLOY_ID){let e=String(t.env.SHADOWCLAW_DEPLOY_ID).trim();if(e)return e.replace(/[^a-zA-Z0-9_-]/g,`-`)}let n=_();return!n||n===`/`?``:n.replace(/^\/+|\/+$/g,``).replace(/[^a-zA-Z0-9_-]/g,`-`)}function _(){if(h!==null)return h;if((typeof window>`u`||globalThis.WorkerGlobalScope!==void 0&&typeof self<`u`&&self instanceof globalThis.WorkerGlobalScope)&&typeof self<`u`&&self.location){let e=(self.location.pathname||`/`).split(`/`).filter(Boolean);if(e.length<=1)return h=`/`,h;let t=e[0].toLowerCase(),n=t===`service-worker.js`||t===`sw.js`||t===`manifest.json`||t===`sitemap.xml`||t===`favicon.ico`||t===`index.html`||t===`service-worker`||t===`assets`||t===`dist`||t===`public`;if(n&&e.length===2)return h=`/`,h;if(!n)return h=`/`+e[0]+`/`,h}let e=typeof window<`u`&&window.location?window.location:typeof self<`u`&&self.location?self.location:null;if(!e)return`/`;if(typeof document<`u`&&typeof document.querySelector==`function`){let t=document.querySelector(`base[href]`);if(t){let n=t.getAttribute(`href`);if(n)try{let t=new URL(n,e.origin).pathname;return t.endsWith(`/`)||(t+=`/`),h=t,h}catch{}}}let t=e.pathname||`/`;if(t===`/`)return h=`/`,h;let n=t.split(`/`).filter(Boolean),r=n.findIndex(e=>ne.has(e.toLowerCase()));return r>=0?r===0?(h=`/`,h):(h=`/`+n.slice(0,r).join(`/`)+`/`,h):m(t)?(h=`/`,h):n.length===1&&!t.includes(`.`)?(h=`/`+n[0]+`/`,h):(h=`/`,h)}function ie(e){let t=e.replace(/[.*+?^${}()|[\]\\]/g,`\\$&`);return RegExp(`(^|\\s)@${t}\\b`,`i`)}ie(`ShadowClaw`);function ae(){let e=g();return e?`shadowclaw-${e}`:`shadowclaw`}ae();let oe={github:{providerId:`github`,name:`GitHub`,aliases:[`github`,`api.github.com`],modes:[`oauth`,`token`],defaultMode:`oauth`,serviceTypes:[`http_api`,`git_remote`],authTypes:[`token`,`oauth`],tokenAuth:{token:{headerName:`Authorization`,headerPrefix:`token `},oauth:{headerName:`Authorization`,headerPrefix:`Bearer `}},oauth:{authorizeUrl:`https://github.com/login/oauth/authorize`,tokenUrl:`https://github.com/login/oauth/access_token`,defaultScopes:[`repo`,`read:user`],usePkce:!0,clientAuthMethod:`request_body`,scopeSeparator:`space`}},gitlab:{providerId:`gitlab`,name:`GitLab`,aliases:[`gitlab`,`gitlab.com`],modes:[`oauth`,`token`],defaultMode:`oauth`,serviceTypes:[`http_api`,`git_remote`],authTypes:[`token`,`oauth`],tokenAuth:{token:{headerName:`PRIVATE-TOKEN`,headerPrefix:``},oauth:{headerName:`Authorization`,headerPrefix:`Bearer `}},tokenAuthByServiceType:{git_remote:{token:{headerName:`Authorization`,headerPrefix:`Bearer `},oauth:{headerName:`Authorization`,headerPrefix:`Bearer `}}},oauth:{authorizeUrl:`https://gitlab.com/oauth/authorize`,tokenUrl:`https://gitlab.com/oauth/token`,defaultScopes:[`read_api`,`read_user`],usePkce:!0,clientAuthMethod:`request_body`,scopeSeparator:`space`}},figma:{providerId:`figma`,name:`Figma`,aliases:[`figma`,`api.figma.com`],modes:[`oauth`,`token`],defaultMode:`oauth`,serviceTypes:[`http_api`],authTypes:[`token`,`oauth`],tokenAuth:{token:{headerName:`X-Figma-Token`,headerPrefix:``},oauth:{headerName:`Authorization`,headerPrefix:`Bearer `}},oauth:{authorizeUrl:`https://www.figma.com/oauth`,tokenUrl:`https://api.figma.com/v1/oauth/token`,refreshUrl:`https://api.figma.com/v1/oauth/refresh`,defaultScopes:[],usePkce:!0,clientAuthMethod:`basic_header`,scopeSeparator:`space`}},notion:{providerId:`notion`,name:`Notion`,aliases:[`notion`,`api.notion.com`,`notion.so`],modes:[`oauth`,`token`],defaultMode:`oauth`,serviceTypes:[`http_api`],authTypes:[`token`,`oauth`],tokenAuth:{token:{headerName:`Authorization`,headerPrefix:`Bearer `},oauth:{headerName:`Authorization`,headerPrefix:`Bearer `}},oauth:{authorizeUrl:`https://api.notion.com/v1/oauth/authorize`,tokenUrl:`https://api.notion.com/v1/oauth/token`,defaultScopes:[],usePkce:!0,clientAuthMethod:`basic_header`,scopeSeparator:`space`}},microsoft_graph:{providerId:`microsoft_graph`,name:`Microsoft Graph`,aliases:[`microsoft`,`graph.microsoft.com`,`microsoft_graph`],modes:[`oauth`,`token`],defaultMode:`oauth`,serviceTypes:[`http_api`],authTypes:[`token`,`oauth`],tokenAuth:{token:{headerName:`Authorization`,headerPrefix:`Bearer `},oauth:{headerName:`Authorization`,headerPrefix:`Bearer `}},oauth:{authorizeUrl:`https://login.microsoftonline.com/common/oauth2/v2.0/authorize`,tokenUrl:`https://login.microsoftonline.com/common/oauth2/v2.0/token`,defaultScopes:[`openid`,`profile`,`offline_access`,`User.Read`],usePkce:!0,clientAuthMethod:`request_body`,scopeSeparator:`space`}},yahoo_mail:{providerId:`yahoo_mail`,name:`Yahoo Mail`,aliases:[`yahoo`,`yahoo_mail`,`mail.yahoo.com`],modes:[`oauth`,`token`],defaultMode:`oauth`,serviceTypes:[`http_api`],authTypes:[`token`,`oauth`],tokenAuth:{token:{headerName:`Authorization`,headerPrefix:`Bearer `},oauth:{headerName:`Authorization`,headerPrefix:`Bearer `}},oauth:{authorizeUrl:`https://api.login.yahoo.com/oauth2/request_auth`,tokenUrl:`https://api.login.yahoo.com/oauth2/get_token`,defaultScopes:[`mail-r`,`mail-w`],usePkce:!0,clientAuthMethod:`request_body`,scopeSeparator:`space`}},google:{providerId:`google`,name:`Google`,aliases:[`google`,`googleapis.com`],modes:[`oauth`,`token`],defaultMode:`oauth`,serviceTypes:[`http_api`],authTypes:[`token`,`oauth`],tokenAuth:{token:{headerName:`Authorization`,headerPrefix:`Bearer `},oauth:{headerName:`Authorization`,headerPrefix:`Bearer `}},oauth:{authorizeUrl:`https://accounts.google.com/o/oauth2/v2/auth`,tokenUrl:`https://oauth2.googleapis.com/token`,defaultScopes:[`openid`,`profile`,`email`],usePkce:!0,clientAuthMethod:`request_body`,scopeSeparator:`space`}},atlassian:{providerId:`atlassian`,name:`Atlassian`,aliases:[`atlassian`,`api.atlassian.com`],modes:[`oauth`,`token`,`basic`],defaultMode:`basic`,serviceTypes:[`http_api`,`git_remote`],authTypes:[`token`,`oauth`,`basic_userpass`],tokenAuth:{token:{headerName:`Authorization`,headerPrefix:`Bearer `},oauth:{headerName:`Authorization`,headerPrefix:`Bearer `},basic:{headerName:`Authorization`,headerPrefix:`Basic `}},oauth:{authorizeUrl:`https://auth.atlassian.com/authorize`,tokenUrl:`https://auth.atlassian.com/oauth/token`,defaultScopes:[],usePkce:!0,clientAuthMethod:`request_body`,scopeSeparator:`space`}},slack:{providerId:`slack`,name:`Slack`,aliases:[`slack`,`slack.com`],modes:[`oauth`,`token`],defaultMode:`oauth`,serviceTypes:[`http_api`],authTypes:[`token`,`oauth`],tokenAuth:{token:{headerName:`Authorization`,headerPrefix:`Bearer `},oauth:{headerName:`Authorization`,headerPrefix:`Bearer `}},oauth:{authorizeUrl:`https://slack.com/oauth/v2/authorize`,tokenUrl:`https://slack.com/api/oauth.v2.access`,defaultScopes:[],usePkce:!1,clientAuthMethod:`request_body`,scopeSeparator:`comma`}},linear:{providerId:`linear`,name:`Linear`,aliases:[`linear`,`api.linear.app`,`linear.app`],modes:[`oauth`,`token`],defaultMode:`oauth`,serviceTypes:[`http_api`],authTypes:[`token`,`oauth`],tokenAuth:{token:{headerName:`Authorization`,headerPrefix:`Bearer `},oauth:{headerName:`Authorization`,headerPrefix:`Bearer `}},oauth:{authorizeUrl:`https://linear.app/oauth/authorize`,tokenUrl:`https://api.linear.app/oauth/token`,defaultScopes:[],usePkce:!0,clientAuthMethod:`request_body`,scopeSeparator:`space`}},azure_devops:{providerId:`azure_devops`,name:`Azure DevOps`,aliases:[`azure_devops`,`dev.azure.com`],modes:[`oauth`,`token`],defaultMode:`oauth`,serviceTypes:[`http_api`,`git_remote`],authTypes:[`token`,`oauth`,`basic_userpass`,`ssh_key`],tokenAuth:{token:{headerName:`Authorization`,headerPrefix:`Bearer `},oauth:{headerName:`Authorization`,headerPrefix:`Bearer `}},tokenAuthByServiceType:{git_remote:{token:{headerName:`Authorization`,headerPrefix:`Basic `},oauth:{headerName:`Authorization`,headerPrefix:`Basic `}}},oauth:{authorizeUrl:`https://app.vssps.visualstudio.com/oauth2/authorize`,tokenUrl:`https://app.vssps.visualstudio.com/oauth2/token`,defaultScopes:[`vso.code`,`vso.profile`,`offline_access`],usePkce:!1,clientAuthMethod:`request_body`,scopeSeparator:`space`}},custom_mcp:{providerId:`custom_mcp`,name:`Custom MCP`,aliases:[`custom_mcp`],modes:[`oauth`,`token`],defaultMode:`oauth`,serviceTypes:[`mcp_remote`,`webmcp_local`],authTypes:[`none`,`token`,`oauth`,`custom_header`,`ssh_key`],tokenAuth:{token:{headerName:`Authorization`,headerPrefix:`Bearer `},oauth:{headerName:`Authorization`,headerPrefix:`Bearer `}},oauth:{authorizeUrl:`https://example.com/oauth/authorize`,tokenUrl:`https://example.com/oauth/token`,defaultScopes:[],usePkce:!0,clientAuthMethod:`request_body`,scopeSeparator:`space`}}};Object.fromEntries(Object.values(oe).filter(e=>!!e.oauth).map(e=>{let t=e.oauth;return[e.providerId,{id:e.providerId,name:e.name,authorizeUrl:t.authorizeUrl,tokenUrl:t.tokenUrl,redirectUri:t.redirectUri,defaultScopes:t.defaultScopes,usePkce:t.usePkce,clientAuthMethod:t.clientAuthMethod,scopeSeparator:t.scopeSeparator}]})),Object.fromEntries(Object.values(oe).map(e=>[e.providerId,{providerId:e.providerId,modes:e.modes,defaultMode:e.defaultMode}])),new Promise(e=>{});
3
3
  /*! @license DOMPurify 3.4.16 | (c) Cure53 and other contributors | Released under the Apache license 2.0 and Mozilla Public License 2.0 | github.com/cure53/DOMPurify/blob/3.4.16/LICENSE */
4
4
  function v(e,t){this.v=e,this.k=t}function y(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function se(e){if(Array.isArray(e))return e}function ce(e,t){var n=e==null?null:typeof Symbol<`u`&&e[Symbol.iterator]||e[`@@iterator`];if(n!=null){var r,i,a,o,s=[],c=!0,l=!1;try{if(a=(n=n.call(e)).next,t===0){if(Object(n)!==n)return;c=!1}else for(;!(c=(r=a.call(n)).done)&&(s.push(r.value),s.length!==t);c=!0);}catch(e){l=!0,i=e}finally{try{if(!c&&n.return!=null&&(o=n.return(),Object(o)!==o))return}finally{if(l)throw i}}return s}}function b(){throw TypeError(`Invalid attempt to destructure non-iterable instance.
@@ -1,4 +1,4 @@
1
- <!doctype html><html lang="en"><head><title>ShadowClaw</title><meta charset="utf-8"><meta name="revision" content="62dc4114af024c80ff58ee6b715e11c6d423d047" /><meta name="version" content="1.51.0" /><meta name="viewport" content="width=device-width,initial-scale=1,viewport-fit=cover"><meta name="description" content="ShadowClaw - multi-runtime AI assistant." /><link rel="canonical" href="https://xt-ml.github.io/shadow-claw/"><meta property="og:title" content="ShadowClaw"><meta property="og:description" content="Multi-runtime AI assistant with local and remote LLM orchestration, Web Workers, OPFS storage, and agentic tool execution."><meta property="og:type" content="website"><meta property="og:url" content="https://xt-ml.github.io/shadow-claw/"><meta property="og:image" content="https://xt-ml.github.io/shadow-claw/assets/icons/512.png"><meta name="twitter:card" content="summary"><meta name="twitter:title" content="ShadowClaw"><meta name="twitter:description" content="Multi-runtime AI assistant with local and remote LLM orchestration, Web Workers, OPFS storage, and agentic tool execution."><meta name="twitter:image" content="https://xt-ml.github.io/shadow-claw/assets/icons/512.png"><script type="application/ld+json">{"@context":"https://schema.org","@graph":[{"@type":"SoftwareApplication","@id":"https://xt-ml.github.io/shadow-claw/#software","name":"ShadowClaw","description":"Multi-runtime AI assistant with local and remote LLM orchestration, Web Workers, OPFS storage, and agentic tool execution.","url":"https://xt-ml.github.io/shadow-claw/","applicationCategory":"DeveloperApplication","operatingSystem":"Web, Browser, Desktop","offers":{"@type":"Offer","price":"0","priceCurrency":"USD"},"author":{"@type":"Organization","name":"xt-ml","url":"https://github.com/xt-ml"},"codeRepository":"https://github.com/xt-ml/shadow-claw","license":"https://github.com/xt-ml/shadow-claw/blob/main/LICENSE"},{"@type":"WebSite","@id":"https://xt-ml.github.io/shadow-claw/#website","url":"https://xt-ml.github.io/shadow-claw/","name":"ShadowClaw","description":"Official website and live deployment of ShadowClaw multi-runtime AI assistant.","publisher":{"@type":"Organization","name":"xt-ml","url":"https://github.com/xt-ml"}},{"@type":"Organization","@id":"https://xt-ml.github.io/shadow-claw/#organization","name":"xt-ml","url":"https://github.com/xt-ml","sameAs":["https://github.com/xt-ml"]}]}</script><meta name="theme-color" content="#fff" /><meta http-equiv="origin-trial" content="A88uTgESYWcVgREKVReKB6jom41uP8TzW6ei3jNdidf+Xl6ONqKRjKNBphsxhrZmdkakLK3oXDgkGq53rtZYSAMAAAB2eyJvcmlnaW4iOiJodHRwczovL3h0LW1sLmdpdGh1Yi5pbzo0NDMiLCJmZWF0dXJlIjoiV2ViTUNQIiwiZXhwaXJ5IjoxNzk0ODczNjAwLCJpc1N1YmRvbWFpbiI6dHJ1ZSwiaXNUaGlyZFBhcnR5Ijp0cnVlfQ=="><base href="/shadow-claw/" /><script id="shadow-claw-site-config" type="application/json">{"$schema":"https:\u002f\u002fjson-schema.org\u002fdraft\u002f2020-12\u002fschema","site":{"title":"ShadowClaw","description":"ShadowClaw - multi-runtime AI assistant.","themeColor":"#fff"},"branding":{"siteUrl":"https:\u002f\u002fxt-ml.github.io\u002fshadow-claw\u002f","faviconPath":"assets\u002ficons\u002ffavicon.ico","appleTouchIconPath":"assets\u002ficons\u002f180.png","notFoundPath":"404.html"},"pwa":{"manifestPath":"manifest.json","themeColor":"#000000"},"assets":["assets"],"sidebar":{"pagesHidden":false,"chatHidden":false,"tasksHidden":false,"filesHidden":false,"defaultPage":"pages"},"pages":{"allowList":[],"denyList":[]},"settings":{"defaultToolsProfile":"__builtin_default"},"agent":{"defaultProvider":"transformers_js_local","defaultModel":"onnx-community\u002fgemma-4-E2B-it-ONNX"},"customElements":{"allowedElements":["block-garden","block-garden-option","block-garden-select"],"allowedDomains":["kherrick.github.io","cdn.jsdelivr.net"]},"security":{"connectSrc":["'self'","blob:","data:","https:\u002f\u002fkherrick.github.io","https:\u002f\u002fcdn.jsdelivr.net"]}}</script>
1
+ <!doctype html><html lang="en"><head><title>ShadowClaw</title><meta charset="utf-8"><meta name="revision" content="6cdfc4a8fa48baa09fb18801514bb2a1109a9c61" /><meta name="version" content="1.52.0" /><meta name="viewport" content="width=device-width,initial-scale=1,viewport-fit=cover"><meta name="description" content="ShadowClaw - multi-runtime AI assistant." /><link rel="canonical" href="https://xt-ml.github.io/shadow-claw/"><meta property="og:title" content="ShadowClaw"><meta property="og:description" content="Multi-runtime AI assistant with local and remote LLM orchestration, Web Workers, OPFS storage, and agentic tool execution."><meta property="og:type" content="website"><meta property="og:url" content="https://xt-ml.github.io/shadow-claw/"><meta property="og:image" content="https://xt-ml.github.io/shadow-claw/assets/icons/512.png"><meta name="twitter:card" content="summary"><meta name="twitter:title" content="ShadowClaw"><meta name="twitter:description" content="Multi-runtime AI assistant with local and remote LLM orchestration, Web Workers, OPFS storage, and agentic tool execution."><meta name="twitter:image" content="https://xt-ml.github.io/shadow-claw/assets/icons/512.png"><script type="application/ld+json">{"@context":"https://schema.org","@graph":[{"@type":"SoftwareApplication","@id":"https://xt-ml.github.io/shadow-claw/#software","name":"ShadowClaw","description":"Multi-runtime AI assistant with local and remote LLM orchestration, Web Workers, OPFS storage, and agentic tool execution.","url":"https://xt-ml.github.io/shadow-claw/","applicationCategory":"DeveloperApplication","operatingSystem":"Web, Browser, Desktop","offers":{"@type":"Offer","price":"0","priceCurrency":"USD"},"author":{"@type":"Organization","name":"xt-ml","url":"https://github.com/xt-ml"},"codeRepository":"https://github.com/xt-ml/shadow-claw","license":"https://github.com/xt-ml/shadow-claw/blob/main/LICENSE"},{"@type":"WebSite","@id":"https://xt-ml.github.io/shadow-claw/#website","url":"https://xt-ml.github.io/shadow-claw/","name":"ShadowClaw","description":"Official website and live deployment of ShadowClaw multi-runtime AI assistant.","publisher":{"@type":"Organization","name":"xt-ml","url":"https://github.com/xt-ml"}},{"@type":"Organization","@id":"https://xt-ml.github.io/shadow-claw/#organization","name":"xt-ml","url":"https://github.com/xt-ml","sameAs":["https://github.com/xt-ml"]}]}</script><meta name="theme-color" content="#fff" /><meta http-equiv="origin-trial" content="A4bwm3ftxmSutme0zCvNMbjdZ4Efbdzz1x2bgmL6RSBDjHVU4Cz5Paeurxk0LO5uyNZjcyaAM+3fQFuCu0XbJwQAAAB2eyJvcmlnaW4iOiJodHRwczovL3h0LW1sLmdpdGh1Yi5pbzo0NDMiLCJmZWF0dXJlIjoiV2ViTUNQIiwiZXhwaXJ5IjoxODA2MzY0ODAwLCJpc1N1YmRvbWFpbiI6dHJ1ZSwiaXNUaGlyZFBhcnR5Ijp0cnVlfQ=="><base href="/shadow-claw/" /><script id="shadow-claw-site-config" type="application/json">{"$schema":"https:\u002f\u002fjson-schema.org\u002fdraft\u002f2020-12\u002fschema","site":{"title":"ShadowClaw","description":"ShadowClaw - multi-runtime AI assistant.","themeColor":"#fff"},"branding":{"siteUrl":"https:\u002f\u002fxt-ml.github.io\u002fshadow-claw\u002f","faviconPath":"assets\u002ficons\u002ffavicon.ico","appleTouchIconPath":"assets\u002ficons\u002f180.png","notFoundPath":"404.html"},"pwa":{"manifestPath":"manifest.json","themeColor":"#000000"},"assets":["assets"],"sidebar":{"pagesHidden":false,"chatHidden":false,"tasksHidden":false,"filesHidden":false,"defaultPage":"pages"},"pages":{"allowList":[],"denyList":[]},"settings":{"defaultToolsProfile":"__builtin_default"},"agent":{"defaultProvider":"transformers_js_local","defaultModel":"onnx-community\u002fgemma-4-E2B-it-ONNX"},"customElements":{"allowedElements":["block-garden","block-garden-option","block-garden-select"],"allowedDomains":["kherrick.github.io","cdn.jsdelivr.net"]},"security":{"connectSrc":["'self'","blob:","data:","https:\u002f\u002fkherrick.github.io","https:\u002f\u002fcdn.jsdelivr.net"]}}</script>
2
2
  <script>var ShadowClawThemeInit=(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:`Module`});var t=(e,t)=>()=>(t||(e((t={exports:{}}).exports,t),e=null),t.exports);function n(){if(globalThis.trustedTypes)return;let e=/* @__PURE__ */ new Map;globalThis.trustedTypes={createPolicy:(t,n)=>{if(e.has(t))throw TypeError(`Policy with name "${t}" already exists.`);let r={createHTML:n.createHTML?e=>n.createHTML(e):void 0,createScriptURL:n.createScriptURL?e=>n.createScriptURL(e):void 0,createScript:n.createScript?e=>n.createScript(e):void 0};return e.set(t,r),r},getPolicy:t=>e.get(t)??null,isHTML:e=>typeof e==`string`||e instanceof Object&&`toString`in e,isScriptURL:e=>typeof e==`string`||e instanceof Object&&`toString`in e,isScript:e=>typeof e==`string`||e instanceof Object&&`toString`in e}}let r=`__shadowClawDefaultTrustedTypesPolicyState`,i=`default`,a=`shadowclaw-sandbox`;function o(){let e=globalThis;return e[r]||(e[r]={initialized:!1,policy:null}),e[r]}function s(){let e=o();if(e.initialized)return;let t=Reflect.get(globalThis,`trustedTypes`);if(t&&typeof t.createPolicy==`function`){e.initialized=!0;try{if(typeof t.getPolicy==`function`){let n=t.getPolicy(i);if(n){e.policy=n;return}}let n=!1;if(typeof t.getPolicyNames==`function`){let e=t.getPolicyNames();Array.isArray(e)&&e.includes(i)&&(n=!0)}if(n){if(typeof t.getPolicy==`function`){let n=t.getPolicy(a);if(n){e.policy=n;return}}e.policy=t.createPolicy(a,{createHTML:e=>e,createScriptURL:e=>e});return}e.policy=t.createPolicy(i,{createHTML:e=>e,createScriptURL:e=>e})}catch{typeof t.getPolicy==`function`&&(e.policy=t.getPolicy(i)??t.getPolicy(a)??null)}}}let c=[{id:`claude-fable-5`,provider:`anthropic`,contextWindow:1e6,maxOutput:128e3,supportsImages:!0,supportsDocuments:!0,supportsThinking:!0,supportsPromptCaching:!0},{id:`claude-fable-5.1`,provider:`anthropic`,contextWindow:1e6,maxOutput:128e3,supportsImages:!0,supportsDocuments:!0,supportsThinking:!0,supportsPromptCaching:!0},{id:`claude-fable`,provider:`anthropic`,contextWindow:1e6,maxOutput:128e3,supportsImages:!0,supportsDocuments:!0,supportsThinking:!0,supportsPromptCaching:!0},{id:`claude-sonnet-5`,provider:`anthropic`,contextWindow:1e6,maxOutput:128e3,supportsImages:!0,supportsDocuments:!0,supportsThinking:!0,supportsPromptCaching:!0},{id:`claude-opus-5`,provider:`anthropic`,contextWindow:1e6,maxOutput:128e3,supportsImages:!0,supportsDocuments:!0,supportsThinking:!0,supportsPromptCaching:!0},{id:`claude-opus-4.8`,provider:`anthropic`,contextWindow:1e6,maxOutput:128e3,supportsImages:!0,supportsDocuments:!0,supportsThinking:!0,supportsPromptCaching:!0},{id:`claude-haiku-5`,provider:`anthropic`,contextWindow:1e6,maxOutput:128e3,supportsImages:!0,supportsDocuments:!0,supportsPromptCaching:!0},{id:`claude-mythos-5`,provider:`anthropic`,contextWindow:1e6,maxOutput:128e3,supportsImages:!0,supportsDocuments:!0,supportsThinking:!0,supportsPromptCaching:!0},{id:`claude-mythos`,provider:`anthropic`,contextWindow:1e6,maxOutput:128e3,supportsImages:!0,supportsDocuments:!0,supportsThinking:!0,supportsPromptCaching:!0},{id:`gpt-6-astra`,provider:`openai`,contextWindow:105e4,maxOutput:128e3,supportsImages:!0,supportsDocuments:!0,supportsAudio:!0,supportsVideo:!0,supportsThinking:!1,supportsPromptCaching:!1},{id:`gpt-6-sol`,provider:`openai`,contextWindow:105e4,maxOutput:128e3,supportsImages:!0,supportsDocuments:!0,supportsThinking:!1,supportsPromptCaching:!1},{id:`gpt-6-luna`,provider:`openai`,contextWindow:1e6,maxOutput:64e3,supportsImages:!0,supportsDocuments:!0,supportsThinking:!1,supportsPromptCaching:!1},{id:`gpt-6`,provider:`openai`,contextWindow:105e4,maxOutput:128e3,supportsImages:!0,supportsDocuments:!0,supportsThinking:!1,supportsPromptCaching:!1},{id:`astra`,provider:`openai`,contextWindow:105e4,maxOutput:128e3,supportsImages:!0,supportsDocuments:!0,supportsAudio:!0,supportsVideo:!0,supportsThinking:!1,supportsPromptCaching:!1},{id:`gpt-5`,provider:`openai`,contextWindow:4e5,maxOutput:128e3,supportsImages:!0,supportsDocuments:!0,supportsThinking:!1,supportsPromptCaching:!1},{id:`gemini-3.5-pro`,provider:`google`,contextWindow:2097152,maxOutput:65536,supportsImages:!0,supportsDocuments:!0,supportsAudio:!0,supportsVideo:!0,supportsThinking:!1,supportsPromptCaching:!1},{id:`gemini-3.5-flash`,provider:`google`,contextWindow:1048576,maxOutput:65536,supportsImages:!0,supportsDocuments:!0,supportsAudio:!0,supportsVideo:!0,supportsThinking:!1,supportsPromptCaching:!1},{id:`gemini-3.8-flash`,provider:`google`,contextWindow:1048576,maxOutput:65536,supportsImages:!0,supportsDocuments:!0,supportsAudio:!0,supportsVideo:!0,supportsThinking:!1,supportsPromptCaching:!1},{id:`gemini-2.5-pro`,provider:`google`,contextWindow:1048576,maxOutput:65536,supportsImages:!0,supportsDocuments:!0,supportsAudio:!0,supportsVideo:!0,supportsThinking:!1,supportsPromptCaching:!1},{id:`gemini-2.5-flash`,provider:`google`,contextWindow:1048576,maxOutput:65536,supportsImages:!0,supportsDocuments:!0,supportsAudio:!0,supportsVideo:!0,supportsThinking:!1,supportsPromptCaching:!1}],l;function u(e){l=e}function d(e){let t=e||l;if(t)for(let e of c)t.registerModelInfo(e.id,{contextWindow:e.contextWindow,maxOutput:e.maxOutput,supportsImageInput:e.supportsImages,supportsDocumentInput:e.supportsDocuments,...e.supportsAudio!==void 0&&{supportsAudioInput:e.supportsAudio},...e.supportsVideo!==void 0&&{supportsVideoInput:e.supportsVideo},...e.supportsPromptCaching!==void 0&&{supportsPromptCaching:e.supportsPromptCaching}})}u(new class{loading=!1;models=/* @__PURE__ */ new Map;getModelInfo(e){if(!e||typeof e!=`string`)return null;let t=e.toLowerCase().trim(),n=this.models.get(t);if(n)return n;if(t.includes(`/`)){let e=t.split(`/`).pop();if(e&&this.models.has(e))return this.models.get(e)}else for(let[e,n]of this.models.entries())if(e.endsWith(`/${t}`))return n;if(t.includes(`:`)){let e=t.split(`:`)[0],n=this.getModelInfo(e);if(n)return n}return null}registerModelInfo(e,t){this.models.set(e.toLowerCase(),t)}clear(){this.models.clear()}seedStaticCatalog(){d(this)}async fetchModelInfo(e,t,n){if(e.modelsUrl){this.loading=!0;try{let r=new Headers;if(r.set(`Content-Type`,`application/json`),e.headers)for(let[t,n]of Object.entries(e.headers))r.set(t,n);if(n)for(let[e,t]of Object.entries(n))r.set(e,t);if(t&&e.apiKeyHeader){let n=e.apiKeyHeaderFormat;r.set(e.apiKeyHeader,n?n.replace(`{key}`,t):t)}let i=await fetch(e.modelsUrl,{headers:r});if(!i.ok)throw Error(`HTTP ${i.status} ${i.statusText}`);let a=await i.json(),o=Array.isArray(a.data)?a.data:Array.isArray(a.models)?a.models:[];for(let e of o){if(!e.id)continue;let t=e.context_length??e.context_window??0,n=e.max_completion_tokens||e.per_request_limits?.completion_tokens||e.top_provider?.max_completion_tokens||null,r=typeof e.supports_tools==`boolean`?e.supports_tools:typeof e.supportsTools==`boolean`?e.supportsTools:void 0,i=this.extractModalities(e,`input`),a=this.extractModalities(e,`output`),o=this.modalitiesInclude(i,`image`,`vision`),s=this.modalitiesInclude(i,`audio`,`voice`,`hearing`),c=this.modalitiesInclude(i,`video`),l=this.modalitiesInclude(i,`document`,`pdf`,`file`)||(typeof e.supports_document_input==`boolean`?e.supports_document_input:typeof e.supportsDocumentInput==`boolean`?e.supportsDocumentInput:void 0),u=e.id===`openrouter/free`||this.supportedParametersInclude(e,`image`,`vision`,`audio`,`tool`,`structured`),d=this.extractReasoning(e),f=typeof e.supports_prompt_caching==`boolean`?e.supports_prompt_caching:typeof e.supportsPromptCaching==`boolean`?e.supportsPromptCaching:this.supportedParametersInclude(e,`cache_control`,`prompt_caching`)?!0:void 0;!t&&Array.isArray(e.providers)&&e.providers.length>0&&(t=e.providers[0]?.context_length||0),this.registerModelInfo(e.id,{contextWindow:t,maxOutput:n,...r!==void 0&&{supportsTools:r},...i.length>0&&{inputModalities:i},...a.length>0&&{outputModalities:a},...o!==void 0&&{supportsImageInput:o},...s!==void 0&&{supportsAudioInput:s},...c!==void 0&&{supportsVideoInput:c},...l!==void 0&&{supportsDocumentInput:l},...d&&{reasoning:d},...u&&{routesByRequestFeatures:u},...f!==void 0&&{supportsPromptCaching:f}})}o.length>0&&console.log(`[ModelRegistry] Registered ${o.length} models for provider "${e.id}"`)}catch(t){console.error(`[ModelRegistry] Error fetching models for ${e.id}:`,t)}finally{this.loading=!1}}}extractModalities(e,t){let n=t===`input`?e.input_modalities||e.inputModalities:e.output_modalities||e.outputModalities,r=e.architecture||{},i=t===`input`?r.input_modalities||r.inputModalities:r.output_modalities||r.outputModalities,a=typeof r.modality==`string`?r.modality:``,o=this.parseArchitectureModality(a,t),s=[...this.normalizeStringArray(n),...this.normalizeStringArray(i),...o];return Array.from(new Set(s))}extractReasoning(e){let t=e?.reasoning;if(!t||typeof t!=`object`)return;let n=this.normalizeStringArray(t.supported_efforts),r=typeof t.default_effort==`string`?t.default_effort.toLowerCase():void 0,i=typeof t.default_enabled==`boolean`?t.default_enabled:void 0,a=typeof t.supports_max_tokens==`boolean`?t.supports_max_tokens:void 0,o=typeof t.mandatory==`boolean`?t.mandatory:void 0;if(n.length!==0||r!==void 0||i!==void 0||a!==void 0||o!==void 0)return{...n.length>0&&{supportedEfforts:n},...r!==void 0&&{defaultEffort:r},...i!==void 0&&{defaultEnabled:i},...a!==void 0&&{supportsMaxTokens:a},...o!==void 0&&{mandatory:o}}}modalitiesInclude(e,...t){if(e.length!==0)return t.some(t=>e.some(e=>e.includes(t)))}normalizeStringArray(e){return Array.isArray(e)?e.filter(e=>typeof e==`string`).map(e=>e.toLowerCase()):[]}parseArchitectureModality(e,t){if(!e)return[];let[n=``,r=``]=e.toLowerCase().split(`->`).map(e=>e.trim());return(t===`input`?n:r).split(/[+,/\s]+/).map(e=>e.trim()).filter(Boolean)}supportedParametersInclude(e,...t){let n=this.normalizeStringArray(e.supported_parameters||e.supportedParameters);return t.some(e=>n.some(t=>t.includes(e)))}});function f(e){return e.replace(/^\/+|\/+$/g,``)}function p(e){let t=f(e);return t.endsWith(`/index.html`)?t=t.slice(0,-11):t.endsWith(`index.html`)&&(t=t.slice(0,-10)),f(t)}function ee(e){let t=f(e),n=t.split(`/`).filter(Boolean);if(n.length===0)return null;let r=n[0].toLowerCase();if(r===`pages`){if(n.length>=3){let e=n[1];return{page:`pages`,groupId:e===`main`?`br:main`:e.startsWith(`br-`)?`br:${e.slice(3)}`:e,path:n.slice(2).join(`/`)}}return{page:`pages`,groupId:`br:main`,path:n.slice(1).join(`/`)}}if(r===`files`){let e=n[1]||`main`;return{page:`files`,groupId:e===`main`?`br:main`:e.startsWith(`br-`)?`br:${e.slice(3)}`:e,path:n.slice(2).join(`/`)||void 0}}if(r===`chat`){let e=n[1]||`main`;return{page:`chat`,groupId:e===`main`?`br:main`:e.startsWith(`br-`)?`br:${e.slice(3)}`:e}}if(r===`tasks`){let e=n[1]||`main`;return{page:`tasks`,groupId:e===`main`?`br:main`:e.startsWith(`br-`)?`br:${e.slice(3)}`:e}}return r===`main`?{page:`pages`,groupId:`br:main`,path:n.slice(1).join(`/`)}:{page:`pages`,groupId:`br:main`,path:t}}function te(){if(typeof document<`u`){let e=document.getElementById(`shadow-claw-static-routing`);if(e&&e.textContent)try{let t=JSON.parse(e.textContent);if(t&&typeof t==`object`&&t.routes)return t}catch(e){console.warn(`Failed to parse embedded static routing manifest:`,e)}}return null}function m(e,t){let n=t||te();if(!n||!n.routes)return null;let r=p(e);for(let[e,t]of Object.entries(n.routes))if(t&&t.prettyPath&&p(t.prettyPath)===r)return ee(e);return null}let h=null,ne=/* @__PURE__ */ new Set([`chat`,`files`,`tasks`,`pages`,`settings`,`tools`,`channels`]);function re(){h=null}typeof globalThis<`u`&&(globalThis.__applyBasePathCacheReset=re);function g(){let e=typeof window<`u`?window:typeof self<`u`?self:globalThis;if(e&&e.__SHADOWCLAW_DEPLOY_ID__){let t=String(e.__SHADOWCLAW_DEPLOY_ID__).trim();if(t)return t.replace(/[^a-zA-Z0-9_-]/g,`-`)}let t=globalThis.process;if(t&&t.env&&t.env.SHADOWCLAW_DEPLOY_ID){let e=String(t.env.SHADOWCLAW_DEPLOY_ID).trim();if(e)return e.replace(/[^a-zA-Z0-9_-]/g,`-`)}let n=_();return!n||n===`/`?``:n.replace(/^\/+|\/+$/g,``).replace(/[^a-zA-Z0-9_-]/g,`-`)}function _(){if(h!==null)return h;if((typeof window>`u`||globalThis.WorkerGlobalScope!==void 0&&typeof self<`u`&&self instanceof globalThis.WorkerGlobalScope)&&typeof self<`u`&&self.location){let e=(self.location.pathname||`/`).split(`/`).filter(Boolean);if(e.length<=1)return h=`/`,h;let t=e[0].toLowerCase(),n=t===`service-worker.js`||t===`sw.js`||t===`manifest.json`||t===`sitemap.xml`||t===`favicon.ico`||t===`index.html`||t===`service-worker`||t===`assets`||t===`dist`||t===`public`;if(n&&e.length===2)return h=`/`,h;if(!n)return h=`/`+e[0]+`/`,h}let e=typeof window<`u`&&window.location?window.location:typeof self<`u`&&self.location?self.location:null;if(!e)return`/`;if(typeof document<`u`&&typeof document.querySelector==`function`){let t=document.querySelector(`base[href]`);if(t){let n=t.getAttribute(`href`);if(n)try{let t=new URL(n,e.origin).pathname;return t.endsWith(`/`)||(t+=`/`),h=t,h}catch{}}}let t=e.pathname||`/`;if(t===`/`)return h=`/`,h;let n=t.split(`/`).filter(Boolean),r=n.findIndex(e=>ne.has(e.toLowerCase()));return r>=0?r===0?(h=`/`,h):(h=`/`+n.slice(0,r).join(`/`)+`/`,h):m(t)?(h=`/`,h):n.length===1&&!t.includes(`.`)?(h=`/`+n[0]+`/`,h):(h=`/`,h)}function ie(e){let t=e.replace(/[.*+?^${}()|[\]\\]/g,`\\$&`);return RegExp(`(^|\\s)@${t}\\b`,`i`)}ie(`ShadowClaw`);function ae(){let e=g();return e?`shadowclaw-${e}`:`shadowclaw`}ae();let oe={github:{providerId:`github`,name:`GitHub`,aliases:[`github`,`api.github.com`],modes:[`oauth`,`token`],defaultMode:`oauth`,serviceTypes:[`http_api`,`git_remote`],authTypes:[`token`,`oauth`],tokenAuth:{token:{headerName:`Authorization`,headerPrefix:`token `},oauth:{headerName:`Authorization`,headerPrefix:`Bearer `}},oauth:{authorizeUrl:`https://github.com/login/oauth/authorize`,tokenUrl:`https://github.com/login/oauth/access_token`,defaultScopes:[`repo`,`read:user`],usePkce:!0,clientAuthMethod:`request_body`,scopeSeparator:`space`}},gitlab:{providerId:`gitlab`,name:`GitLab`,aliases:[`gitlab`,`gitlab.com`],modes:[`oauth`,`token`],defaultMode:`oauth`,serviceTypes:[`http_api`,`git_remote`],authTypes:[`token`,`oauth`],tokenAuth:{token:{headerName:`PRIVATE-TOKEN`,headerPrefix:``},oauth:{headerName:`Authorization`,headerPrefix:`Bearer `}},tokenAuthByServiceType:{git_remote:{token:{headerName:`Authorization`,headerPrefix:`Bearer `},oauth:{headerName:`Authorization`,headerPrefix:`Bearer `}}},oauth:{authorizeUrl:`https://gitlab.com/oauth/authorize`,tokenUrl:`https://gitlab.com/oauth/token`,defaultScopes:[`read_api`,`read_user`],usePkce:!0,clientAuthMethod:`request_body`,scopeSeparator:`space`}},figma:{providerId:`figma`,name:`Figma`,aliases:[`figma`,`api.figma.com`],modes:[`oauth`,`token`],defaultMode:`oauth`,serviceTypes:[`http_api`],authTypes:[`token`,`oauth`],tokenAuth:{token:{headerName:`X-Figma-Token`,headerPrefix:``},oauth:{headerName:`Authorization`,headerPrefix:`Bearer `}},oauth:{authorizeUrl:`https://www.figma.com/oauth`,tokenUrl:`https://api.figma.com/v1/oauth/token`,refreshUrl:`https://api.figma.com/v1/oauth/refresh`,defaultScopes:[],usePkce:!0,clientAuthMethod:`basic_header`,scopeSeparator:`space`}},notion:{providerId:`notion`,name:`Notion`,aliases:[`notion`,`api.notion.com`,`notion.so`],modes:[`oauth`,`token`],defaultMode:`oauth`,serviceTypes:[`http_api`],authTypes:[`token`,`oauth`],tokenAuth:{token:{headerName:`Authorization`,headerPrefix:`Bearer `},oauth:{headerName:`Authorization`,headerPrefix:`Bearer `}},oauth:{authorizeUrl:`https://api.notion.com/v1/oauth/authorize`,tokenUrl:`https://api.notion.com/v1/oauth/token`,defaultScopes:[],usePkce:!0,clientAuthMethod:`basic_header`,scopeSeparator:`space`}},microsoft_graph:{providerId:`microsoft_graph`,name:`Microsoft Graph`,aliases:[`microsoft`,`graph.microsoft.com`,`microsoft_graph`],modes:[`oauth`,`token`],defaultMode:`oauth`,serviceTypes:[`http_api`],authTypes:[`token`,`oauth`],tokenAuth:{token:{headerName:`Authorization`,headerPrefix:`Bearer `},oauth:{headerName:`Authorization`,headerPrefix:`Bearer `}},oauth:{authorizeUrl:`https://login.microsoftonline.com/common/oauth2/v2.0/authorize`,tokenUrl:`https://login.microsoftonline.com/common/oauth2/v2.0/token`,defaultScopes:[`openid`,`profile`,`offline_access`,`User.Read`],usePkce:!0,clientAuthMethod:`request_body`,scopeSeparator:`space`}},yahoo_mail:{providerId:`yahoo_mail`,name:`Yahoo Mail`,aliases:[`yahoo`,`yahoo_mail`,`mail.yahoo.com`],modes:[`oauth`,`token`],defaultMode:`oauth`,serviceTypes:[`http_api`],authTypes:[`token`,`oauth`],tokenAuth:{token:{headerName:`Authorization`,headerPrefix:`Bearer `},oauth:{headerName:`Authorization`,headerPrefix:`Bearer `}},oauth:{authorizeUrl:`https://api.login.yahoo.com/oauth2/request_auth`,tokenUrl:`https://api.login.yahoo.com/oauth2/get_token`,defaultScopes:[`mail-r`,`mail-w`],usePkce:!0,clientAuthMethod:`request_body`,scopeSeparator:`space`}},google:{providerId:`google`,name:`Google`,aliases:[`google`,`googleapis.com`],modes:[`oauth`,`token`],defaultMode:`oauth`,serviceTypes:[`http_api`],authTypes:[`token`,`oauth`],tokenAuth:{token:{headerName:`Authorization`,headerPrefix:`Bearer `},oauth:{headerName:`Authorization`,headerPrefix:`Bearer `}},oauth:{authorizeUrl:`https://accounts.google.com/o/oauth2/v2/auth`,tokenUrl:`https://oauth2.googleapis.com/token`,defaultScopes:[`openid`,`profile`,`email`],usePkce:!0,clientAuthMethod:`request_body`,scopeSeparator:`space`}},atlassian:{providerId:`atlassian`,name:`Atlassian`,aliases:[`atlassian`,`api.atlassian.com`],modes:[`oauth`,`token`,`basic`],defaultMode:`basic`,serviceTypes:[`http_api`,`git_remote`],authTypes:[`token`,`oauth`,`basic_userpass`],tokenAuth:{token:{headerName:`Authorization`,headerPrefix:`Bearer `},oauth:{headerName:`Authorization`,headerPrefix:`Bearer `},basic:{headerName:`Authorization`,headerPrefix:`Basic `}},oauth:{authorizeUrl:`https://auth.atlassian.com/authorize`,tokenUrl:`https://auth.atlassian.com/oauth/token`,defaultScopes:[],usePkce:!0,clientAuthMethod:`request_body`,scopeSeparator:`space`}},slack:{providerId:`slack`,name:`Slack`,aliases:[`slack`,`slack.com`],modes:[`oauth`,`token`],defaultMode:`oauth`,serviceTypes:[`http_api`],authTypes:[`token`,`oauth`],tokenAuth:{token:{headerName:`Authorization`,headerPrefix:`Bearer `},oauth:{headerName:`Authorization`,headerPrefix:`Bearer `}},oauth:{authorizeUrl:`https://slack.com/oauth/v2/authorize`,tokenUrl:`https://slack.com/api/oauth.v2.access`,defaultScopes:[],usePkce:!1,clientAuthMethod:`request_body`,scopeSeparator:`comma`}},linear:{providerId:`linear`,name:`Linear`,aliases:[`linear`,`api.linear.app`,`linear.app`],modes:[`oauth`,`token`],defaultMode:`oauth`,serviceTypes:[`http_api`],authTypes:[`token`,`oauth`],tokenAuth:{token:{headerName:`Authorization`,headerPrefix:`Bearer `},oauth:{headerName:`Authorization`,headerPrefix:`Bearer `}},oauth:{authorizeUrl:`https://linear.app/oauth/authorize`,tokenUrl:`https://api.linear.app/oauth/token`,defaultScopes:[],usePkce:!0,clientAuthMethod:`request_body`,scopeSeparator:`space`}},azure_devops:{providerId:`azure_devops`,name:`Azure DevOps`,aliases:[`azure_devops`,`dev.azure.com`],modes:[`oauth`,`token`],defaultMode:`oauth`,serviceTypes:[`http_api`,`git_remote`],authTypes:[`token`,`oauth`,`basic_userpass`,`ssh_key`],tokenAuth:{token:{headerName:`Authorization`,headerPrefix:`Bearer `},oauth:{headerName:`Authorization`,headerPrefix:`Bearer `}},tokenAuthByServiceType:{git_remote:{token:{headerName:`Authorization`,headerPrefix:`Basic `},oauth:{headerName:`Authorization`,headerPrefix:`Basic `}}},oauth:{authorizeUrl:`https://app.vssps.visualstudio.com/oauth2/authorize`,tokenUrl:`https://app.vssps.visualstudio.com/oauth2/token`,defaultScopes:[`vso.code`,`vso.profile`,`offline_access`],usePkce:!1,clientAuthMethod:`request_body`,scopeSeparator:`space`}},custom_mcp:{providerId:`custom_mcp`,name:`Custom MCP`,aliases:[`custom_mcp`],modes:[`oauth`,`token`],defaultMode:`oauth`,serviceTypes:[`mcp_remote`,`webmcp_local`],authTypes:[`none`,`token`,`oauth`,`custom_header`,`ssh_key`],tokenAuth:{token:{headerName:`Authorization`,headerPrefix:`Bearer `},oauth:{headerName:`Authorization`,headerPrefix:`Bearer `}},oauth:{authorizeUrl:`https://example.com/oauth/authorize`,tokenUrl:`https://example.com/oauth/token`,defaultScopes:[],usePkce:!0,clientAuthMethod:`request_body`,scopeSeparator:`space`}}};Object.fromEntries(Object.values(oe).filter(e=>!!e.oauth).map(e=>{let t=e.oauth;return[e.providerId,{id:e.providerId,name:e.name,authorizeUrl:t.authorizeUrl,tokenUrl:t.tokenUrl,redirectUri:t.redirectUri,defaultScopes:t.defaultScopes,usePkce:t.usePkce,clientAuthMethod:t.clientAuthMethod,scopeSeparator:t.scopeSeparator}]})),Object.fromEntries(Object.values(oe).map(e=>[e.providerId,{providerId:e.providerId,modes:e.modes,defaultMode:e.defaultMode}])),new Promise(e=>{});
3
3
  /*! @license DOMPurify 3.4.16 | (c) Cure53 and other contributors | Released under the Apache license 2.0 and Mozilla Public License 2.0 | github.com/cure53/DOMPurify/blob/3.4.16/LICENSE */
4
4
  function v(e,t){this.v=e,this.k=t}function y(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function se(e){if(Array.isArray(e))return e}function ce(e,t){var n=e==null?null:typeof Symbol<`u`&&e[Symbol.iterator]||e[`@@iterator`];if(n!=null){var r,i,a,o,s=[],c=!0,l=!1;try{if(a=(n=n.call(e)).next,t===0){if(Object(n)!==n)return;c=!1}else for(;!(c=(r=a.call(n)).done)&&(s.push(r.value),s.length!==t);c=!0);}catch(e){l=!0,i=e}finally{try{if(!c&&n.return!=null&&(o=n.return(),Object(o)!==o))return}finally{if(l)throw i}}return s}}function b(){throw TypeError(`Invalid attempt to destructure non-iterable instance.