shadow-claw 1.59.7 → 1.60.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 (253) hide show
  1. package/.well-known/mcp/server-card.json +4 -12
  2. package/.well-known/mcp.json +4 -12
  3. package/README.md +6 -2
  4. package/dist/cli/build/build.js +1 -1
  5. package/dist/cli/{chunk-DDvuLVfW.js → chunk-3C5izdQW.js} +1 -1
  6. package/dist/cli/chunk-B-75h9gX.js +1 -0
  7. package/dist/cli/{chunk-hVf839t7.js → chunk-B7Kn-otm.js} +1 -1
  8. package/dist/cli/{chunk-YX32FcN7.js → chunk-BBczgswQ.js} +1 -1
  9. package/dist/cli/{chunk-DcNxjqH6.js → chunk-BE-lYWcn.js} +1 -1
  10. package/dist/cli/{chunk-CQaCgswD.js → chunk-BECr0WxI.js} +11 -11
  11. package/dist/cli/chunk-BEz1PD1_.js +1 -0
  12. package/dist/cli/chunk-BLzI1Fp2.js +1 -0
  13. package/dist/cli/{chunk-B3TrWbca.js → chunk-BVSC1MNQ.js} +11 -11
  14. package/dist/cli/{chunk-D_te8ufL.js → chunk-BdWcep6o.js} +1 -1
  15. package/dist/cli/{chunk-SRBRVorc.js → chunk-BfTpnSS4.js} +1 -1
  16. package/dist/cli/{chunk-D2_eAO83.js → chunk-BgvqTf7w.js} +1 -1
  17. package/dist/cli/chunk-BwsJfUT3.js +1 -0
  18. package/dist/cli/{chunk--PFY91kE.js → chunk-C9b4b7c_.js} +1 -1
  19. package/dist/cli/{chunk-SxK79JmB.js → chunk-CAw9XYFe.js} +1 -1
  20. package/dist/cli/chunk-CFCcbFs2.js +396 -0
  21. package/dist/cli/{chunk-Cnjb8Usu.js → chunk-CTarF4FC.js} +1 -1
  22. package/dist/cli/{chunk-3vNYrs_L.js → chunk-Cbq5hpjb.js} +4 -4
  23. package/dist/cli/chunk-CjTjKy_v.js +310 -0
  24. package/dist/cli/chunk-Cjyu4cr_.js +36 -0
  25. package/dist/cli/{chunk-DUGZPka_.js → chunk-ClMKygjZ.js} +1 -1
  26. package/dist/cli/chunk-Cppnq1KF.js +1 -0
  27. package/dist/cli/{chunk-DvemF16v.js → chunk-D9QCNFMO.js} +1 -1
  28. package/dist/cli/{chunk-iB8OoMmW.js → chunk-DB21BMqt.js} +1 -1
  29. package/dist/cli/{chunk-_Vo-o_e3.js → chunk-DHoIWvCc.js} +1 -1
  30. package/dist/cli/chunk-DZEN9T5y.js +1 -0
  31. package/dist/cli/{chunk-5rLO4DWS.js → chunk-Dl14OyYO.js} +9 -9
  32. package/dist/cli/chunk-Dl_vv0dI.js +1 -0
  33. package/dist/cli/chunk-Dpmfhlyl.js +1 -0
  34. package/dist/cli/{chunk-BrR1DOBS.js → chunk-Du7Xtucq.js} +1 -1
  35. package/dist/cli/{chunk-B88Z8T_9.js → chunk-DxcDFUi_.js} +1 -1
  36. package/dist/cli/{chunk-Dt7-hzJU.js → chunk-DyyEWbV7.js} +1 -1
  37. package/dist/cli/chunk-N0x3mXU0.js +1 -0
  38. package/dist/cli/{chunk-CGoE4llV.js → chunk-V-w0Bata.js} +1 -1
  39. package/dist/cli/{chunk-CncW6_WL.js → chunk-ZxDxSSn-.js} +1 -1
  40. package/dist/cli/{chunk-CZdCRqNe.js → chunk-lPvFUkd5.js} +1 -1
  41. package/dist/cli/{chunk-66BvqAV0.js → chunk-n5s-sCdU.js} +1 -1
  42. package/dist/cli/{chunk-CAAeGOdy.js → chunk-nD9VPVMq.js} +1 -1
  43. package/dist/cli/{chunk-DMs7kREC.js → chunk-rFuy8aS_.js} +1 -1
  44. package/dist/cli/{chunk-B0qusANw.js → chunk-wjM6JXWa.js} +1 -1
  45. package/dist/cli/{chunk-DhOU6GYX.js → chunk-zcES9rut.js} +1 -1
  46. package/dist/cli/cli.js +3 -3
  47. package/dist/headless-agent.js +1 -1
  48. package/dist/lib/{channel-mmdGzPkT.js → channel-DB77spML.js} +2 -2
  49. package/dist/lib/{channel-mmdGzPkT.js.map → channel-DB77spML.js.map} +1 -1
  50. package/dist/lib/{compact-context-CY9BBlUQ.js → compact-context-Q9t9aL1e.js} +7 -7
  51. package/dist/lib/{compact-context-CY9BBlUQ.js.map → compact-context-Q9t9aL1e.js.map} +1 -1
  52. package/dist/lib/components/index.js +21 -21
  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-llm.js +1 -1
  57. package/dist/lib/components/settings/shadow-claw-networking.js +1 -1
  58. package/dist/lib/components/settings/shadow-claw-notifications.js +1 -1
  59. package/dist/lib/components/settings/shadow-claw-peerjs.js +1 -1
  60. package/dist/lib/components/settings/shadow-claw-storage.js +1 -1
  61. package/dist/lib/components/settings/shadow-claw-task-server.js +1 -1
  62. package/dist/lib/components/settings/shadow-claw-webvm.js +1 -1
  63. package/dist/lib/components/shadow-claw-channel-config.js +1 -1
  64. package/dist/lib/components/shadow-claw-channels.js +1 -1
  65. package/dist/lib/components/shadow-claw-chat.js +1 -1
  66. package/dist/lib/components/shadow-claw-control-plane.js +1 -1
  67. package/dist/lib/components/shadow-claw-conversations.js +1 -1
  68. package/dist/lib/components/shadow-claw-file-viewer.js +1 -1
  69. package/dist/lib/components/shadow-claw-files.js +1 -1
  70. package/dist/lib/components/shadow-claw-git.js +1 -1
  71. package/dist/lib/components/shadow-claw-llm.js +1 -1
  72. package/dist/lib/components/shadow-claw-networking.js +1 -1
  73. package/dist/lib/components/shadow-claw-notifications.js +1 -1
  74. package/dist/lib/components/shadow-claw-pages.js +1 -1
  75. package/dist/lib/components/shadow-claw-peerjs.js +1 -1
  76. package/dist/lib/components/shadow-claw-settings.js +1 -1
  77. package/dist/lib/components/shadow-claw-storage.js +1 -1
  78. package/dist/lib/components/shadow-claw-task-server.js +1 -1
  79. package/dist/lib/components/shadow-claw-tasks.js +1 -1
  80. package/dist/lib/components/shadow-claw-terminal.js +1 -1
  81. package/dist/lib/components/shadow-claw-tools.js +1 -1
  82. package/dist/lib/components/shadow-claw-webvm.js +1 -1
  83. package/dist/lib/components/shadow-claw.js +1 -1
  84. package/dist/lib/{configure-peer-js-ccNvax2N.js → configure-peer-js-CgFiwoxY.js} +2 -2
  85. package/dist/lib/{configure-peer-js-ccNvax2N.js.map → configure-peer-js-CgFiwoxY.js.map} +1 -1
  86. package/dist/lib/content/build-attachment-content-blocks.d.ts +2 -0
  87. package/dist/lib/{discover-skills-OwlQ2sXA.js → discover-skills-CXyaWHKi.js} +5 -5
  88. package/dist/lib/{discover-skills-OwlQ2sXA.js.map → discover-skills-CXyaWHKi.js.map} +1 -1
  89. package/dist/lib/{git-D2J_j9X9.js → git-CogDRlEz.js} +2 -2
  90. package/dist/lib/{git-D2J_j9X9.js.map → git-CogDRlEz.js.map} +1 -1
  91. package/dist/lib/index.js +21 -21
  92. package/dist/lib/{init-control-plane-B7blDVIE.js → init-control-plane-CEGdzgWX.js} +7 -7
  93. package/dist/lib/{init-control-plane-B7blDVIE.js.map → init-control-plane-CEGdzgWX.js.map} +1 -1
  94. package/dist/lib/{invoke-agent-SxvudiDT.js → invoke-agent-cac3gCsj.js} +6 -6
  95. package/dist/lib/{invoke-agent-SxvudiDT.js.map → invoke-agent-cac3gCsj.js.map} +1 -1
  96. package/dist/lib/{move-group-entry-DDpjxa10.js → move-group-entry-D8dptMg0.js} +2 -2
  97. package/dist/lib/{move-group-entry-DDpjxa10.js.map → move-group-entry-D8dptMg0.js.map} +1 -1
  98. package/dist/lib/{orchestrator-C7fkh7T7.js → orchestrator-BBAwy9Nm.js} +12 -12
  99. package/dist/lib/{orchestrator-C7fkh7T7.js.map → orchestrator-BBAwy9Nm.js.map} +1 -1
  100. package/dist/lib/{orchestrator-CCARkxQC.js → orchestrator-cRBe3lhq.js} +2 -2
  101. package/dist/lib/{orchestrator-CCARkxQC.js.map → orchestrator-cRBe3lhq.js.map} +1 -1
  102. package/dist/lib/{peerjs-Bfw_FWLB.js → peerjs-BLg8aGUj.js} +3 -3
  103. package/dist/lib/{peerjs-Bfw_FWLB.js.map → peerjs-BLg8aGUj.js.map} +1 -1
  104. package/dist/lib/{process-peer-query-param-BxYiZNdf.js → process-peer-query-param-BnsVnxzH.js} +5 -5
  105. package/dist/lib/{process-peer-query-param-BxYiZNdf.js.map → process-peer-query-param-BnsVnxzH.js.map} +1 -1
  106. package/dist/lib/{process-pending-shared-payloads-DPIbwRb3.js → process-pending-shared-payloads-DBZfZOOa.js} +2 -2
  107. package/dist/lib/{process-pending-shared-payloads-DPIbwRb3.js.map → process-pending-shared-payloads-DBZfZOOa.js.map} +1 -1
  108. package/dist/lib/{process-room-query-param-B2_d50nE.js → process-room-query-param-B8EYg_-r.js} +4 -4
  109. package/dist/lib/{process-room-query-param-B2_d50nE.js.map → process-room-query-param-B8EYg_-r.js.map} +1 -1
  110. package/dist/lib/{push-client-rrjTdc-U.js → push-client-CAm6UMvE.js} +3 -3
  111. package/dist/lib/{push-client-rrjTdc-U.js.map → push-client-CAm6UMvE.js.map} +1 -1
  112. package/dist/lib/{rooms-bwGoYb1q.js → rooms-Dzphx3rK.js} +2 -2
  113. package/dist/lib/{rooms-bwGoYb1q.js.map → rooms-Dzphx3rK.js.map} +1 -1
  114. package/dist/lib/{shadow-claw-CypGVlVO.js → shadow-claw-CGl8tXtG.js} +6 -6
  115. package/dist/lib/{shadow-claw-CypGVlVO.js.map → shadow-claw-CGl8tXtG.js.map} +1 -1
  116. package/dist/lib/{shadow-claw-channel-config-DJpDovkF.js → shadow-claw-channel-config-BNIWCdsL.js} +4 -4
  117. package/dist/lib/{shadow-claw-channel-config-DJpDovkF.js.map → shadow-claw-channel-config-BNIWCdsL.js.map} +1 -1
  118. package/dist/lib/{shadow-claw-channels-DJLwRovH.js → shadow-claw-channels-C2QSn4Ew.js} +2 -2
  119. package/dist/lib/{shadow-claw-channels-DJLwRovH.js.map → shadow-claw-channels-C2QSn4Ew.js.map} +1 -1
  120. package/dist/lib/{shadow-claw-chat-B92cPaft.js → shadow-claw-chat-Wx3y9y6c.js} +3 -3
  121. package/dist/lib/{shadow-claw-chat-B92cPaft.js.map → shadow-claw-chat-Wx3y9y6c.js.map} +1 -1
  122. package/dist/lib/{shadow-claw-control-plane-fvn-qyHj.js → shadow-claw-control-plane-D5E4cFGu.js} +6 -6
  123. package/dist/lib/{shadow-claw-control-plane-fvn-qyHj.js.map → shadow-claw-control-plane-D5E4cFGu.js.map} +1 -1
  124. package/dist/lib/{shadow-claw-conversations-CsVyDOny.js → shadow-claw-conversations-BtDv7GRW.js} +2 -2
  125. package/dist/lib/{shadow-claw-conversations-CsVyDOny.js.map → shadow-claw-conversations-BtDv7GRW.js.map} +1 -1
  126. package/dist/lib/{shadow-claw-file-viewer-DFfyP7s5.js → shadow-claw-file-viewer-CG40kwWV.js} +2 -2
  127. package/dist/lib/{shadow-claw-file-viewer-DFfyP7s5.js.map → shadow-claw-file-viewer-CG40kwWV.js.map} +1 -1
  128. package/dist/lib/{shadow-claw-files-cT6HL7ye.js → shadow-claw-files-BOUULrlX.js} +3 -3
  129. package/dist/lib/{shadow-claw-files-cT6HL7ye.js.map → shadow-claw-files-BOUULrlX.js.map} +1 -1
  130. package/dist/lib/{shadow-claw-git-Cv9mQgTx.js → shadow-claw-git-BeHV73_9.js} +3 -3
  131. package/dist/lib/{shadow-claw-git-Cv9mQgTx.js.map → shadow-claw-git-BeHV73_9.js.map} +1 -1
  132. package/dist/lib/{shadow-claw-llm-CKOYzPDp.js → shadow-claw-llm-KONyWKZM.js} +2 -2
  133. package/dist/lib/{shadow-claw-llm-CKOYzPDp.js.map → shadow-claw-llm-KONyWKZM.js.map} +1 -1
  134. package/dist/lib/{shadow-claw-networking-DYfiUQaH.js → shadow-claw-networking-Diy3JJkc.js} +2 -2
  135. package/dist/lib/{shadow-claw-networking-DYfiUQaH.js.map → shadow-claw-networking-Diy3JJkc.js.map} +1 -1
  136. package/dist/lib/{shadow-claw-notifications-JJlzriuX.js → shadow-claw-notifications-C-upPa-4.js} +2 -2
  137. package/dist/lib/{shadow-claw-notifications-JJlzriuX.js.map → shadow-claw-notifications-C-upPa-4.js.map} +1 -1
  138. package/dist/lib/{shadow-claw-pages-BCo3ihZI.js → shadow-claw-pages-CfAjUKgd.js} +2 -2
  139. package/dist/lib/{shadow-claw-pages-BCo3ihZI.js.map → shadow-claw-pages-CfAjUKgd.js.map} +1 -1
  140. package/dist/lib/{shadow-claw-peerjs-CFNjfrY5.js → shadow-claw-peerjs-t4YibS9s.js} +5 -5
  141. package/dist/lib/{shadow-claw-peerjs-CFNjfrY5.js.map → shadow-claw-peerjs-t4YibS9s.js.map} +1 -1
  142. package/dist/lib/{shadow-claw-settings-BMwne0bh.js → shadow-claw-settings-Cg5V0e9g.js} +2 -2
  143. package/dist/lib/{shadow-claw-settings-BMwne0bh.js.map → shadow-claw-settings-Cg5V0e9g.js.map} +1 -1
  144. package/dist/lib/{shadow-claw-storage-DUY8B9m-.js → shadow-claw-storage-C7tCnsSG.js} +2 -2
  145. package/dist/lib/{shadow-claw-storage-DUY8B9m-.js.map → shadow-claw-storage-C7tCnsSG.js.map} +1 -1
  146. package/dist/lib/{shadow-claw-task-server-yWeoA3eL.js → shadow-claw-task-server-BObsRdf8.js} +2 -2
  147. package/dist/lib/{shadow-claw-task-server-yWeoA3eL.js.map → shadow-claw-task-server-BObsRdf8.js.map} +1 -1
  148. package/dist/lib/{shadow-claw-tasks-Bg0uM15I.js → shadow-claw-tasks-B2EEqrcY.js} +3 -3
  149. package/dist/lib/{shadow-claw-tasks-Bg0uM15I.js.map → shadow-claw-tasks-B2EEqrcY.js.map} +1 -1
  150. package/dist/lib/{shadow-claw-terminal-fyJPppY_.js → shadow-claw-terminal-DSHfO2b9.js} +2 -2
  151. package/dist/lib/{shadow-claw-terminal-fyJPppY_.js.map → shadow-claw-terminal-DSHfO2b9.js.map} +1 -1
  152. package/dist/lib/{shadow-claw-tools-D0T8m3go.js → shadow-claw-tools-DwPBADua.js} +3 -3
  153. package/dist/lib/{shadow-claw-tools-D0T8m3go.js.map → shadow-claw-tools-DwPBADua.js.map} +1 -1
  154. package/dist/lib/{shadow-claw-webvm-CQvzJwKI.js → shadow-claw-webvm-CY4qGaMB.js} +2 -2
  155. package/dist/lib/{shadow-claw-webvm-CQvzJwKI.js.map → shadow-claw-webvm-CY4qGaMB.js.map} +1 -1
  156. package/dist/lib/{sync-web-mcp-registration-BFtG_4kx.js → sync-web-mcp-registration-BiOZvW-R.js} +3 -3
  157. package/dist/lib/{sync-web-mcp-registration-BFtG_4kx.js.map → sync-web-mcp-registration-BiOZvW-R.js.map} +1 -1
  158. package/dist/lib/{system-prompt-bhGRLoL2.js → system-prompt-CxJ3Nx4c.js} +4 -3
  159. package/dist/lib/system-prompt-CxJ3Nx4c.js.map +1 -0
  160. package/dist/public/.well-known/mcp/server-card.json +4 -12
  161. package/dist/public/.well-known/mcp.json +4 -12
  162. package/dist/public/AGENTS.md +3 -1
  163. package/dist/public/README.md +6 -2
  164. package/dist/public/agent.worker.js +1 -1
  165. package/dist/public/{channel-Dk7wl-Av.js → channel-DIpDQekL.js} +1 -1
  166. package/dist/public/{chat-template-BwAnTFKf.js → chat-template-CXKs8lFR.js} +1 -1
  167. package/dist/public/compact-context-BQ2ZXoAc.js +5 -0
  168. package/dist/public/{compact-context-fOTqwKF6.js → compact-context-dHitmPsV.js} +2 -2
  169. package/dist/public/{configure-peer-js-BOV0tR6G.js → configure-peer-js-DV1rqvFX.js} +1 -1
  170. package/dist/public/{create-model-cache-fetch-DSAFjOwc.js → create-model-cache-fetch-B0mSCEk6.js} +1 -1
  171. package/dist/public/{discover-skills-D1sNTy2r.js → discover-skills-BWJB8HUA.js} +1 -1
  172. package/dist/public/docs/architecture/overview.md +1 -1
  173. package/dist/public/docs/example/article/index.html +21 -21
  174. package/dist/public/docs/example/article.html +21 -21
  175. package/dist/public/docs/publishing/index.html +21 -21
  176. package/dist/public/docs/publishing.html +21 -21
  177. package/dist/public/docs/skill-creator/index.html +21 -21
  178. package/dist/public/docs/skill-creator.html +21 -21
  179. package/dist/public/docs/subsystems/attachment-capabilities.md +14 -1
  180. package/dist/public/docs/subsystems/cli.md +95 -51
  181. package/dist/public/docs/subsystems/pages.md +5 -0
  182. package/dist/public/e2e/README.md +1 -1
  183. package/dist/public/{e2e-bridge-Cz95DLlb.js → e2e-bridge-lP2qqiv3.js} +1 -1
  184. package/dist/public/{git-BmMlwIMP.js → git-DjmQ16rm.js} +1 -1
  185. package/dist/public/{iframe-bridge-scripts-Cibg0m6A.js → iframe-bridge-scripts-CO0izGjW.js} +1 -1
  186. package/dist/public/index.html +21 -21
  187. package/dist/public/index.js +1 -1
  188. package/dist/public/{init-control-plane-Cb31yLTY.js → init-control-plane-Ctz7FI8M.js} +1 -1
  189. package/dist/public/{invoke-agent-CN7mSV0Z.js → invoke-agent-C_geruwq.js} +1 -1
  190. package/dist/public/llms.txt +1 -1
  191. package/dist/public/main/index.html +21 -21
  192. package/dist/public/main/memory/index.html +21 -21
  193. package/dist/public/main/memory.html +21 -21
  194. package/dist/public/main.html +21 -21
  195. package/dist/public/{move-group-entry-CXneuNVa.js → move-group-entry-QQ9Hkk54.js} +1 -1
  196. package/dist/public/{orchestrator-Dyylc8IU.js → orchestrator-C1kaTltu.js} +2 -2
  197. package/dist/public/{orchestrator-DBO4NZqd.js → orchestrator-Li1UAsv7.js} +1 -1
  198. package/dist/public/{peerjs-l0jiBoh6.js → peerjs-DbBryE-9.js} +1 -1
  199. package/dist/public/{process-peer-query-param-s-aSP1Rq.js → process-peer-query-param-DQIgr3KL.js} +1 -1
  200. package/dist/public/{process-pending-shared-payloads-BN3GigPT.js → process-pending-shared-payloads-Ctb-TFqB.js} +1 -1
  201. package/dist/public/{process-room-query-param-B2Qe0F0M.js → process-room-query-param-F-XnIVoZ.js} +1 -1
  202. package/dist/public/{push-client-B2LC8Qp9.js → push-client-DRx9Eggz.js} +1 -1
  203. package/dist/public/{rooms-ChCEOvkw.js → rooms-BurBI7is.js} +1 -1
  204. package/dist/public/service-worker/init.js +1 -1
  205. package/dist/public/service-worker.js +1 -1
  206. package/dist/public/{shadow-claw-Br8mWDUx.js → shadow-claw-Bg9AQ5x_.js} +2 -2
  207. package/dist/public/{shadow-claw-accounts-Dm6G7KMP.js → shadow-claw-accounts-B3mjYI0M.js} +1 -1
  208. package/dist/public/{shadow-claw-card-CggS8uSa.js → shadow-claw-card-tcXRS1GF.js} +1 -1
  209. package/dist/public/{shadow-claw-channels-088vhuWO.js → shadow-claw-channels-BiSfLvWv.js} +1 -1
  210. package/dist/public/{shadow-claw-chat-BRwRlq-n.js → shadow-claw-chat-N5jMsXZZ.js} +1 -1
  211. package/dist/public/{shadow-claw-control-plane-rhKACK85.js → shadow-claw-control-plane-DFVe_Xdq.js} +2 -2
  212. package/dist/public/{shadow-claw-conversations-CF_yUfKl.js → shadow-claw-conversations-wAR06_ya.js} +1 -1
  213. package/dist/public/{shadow-claw-empty-state-CkpOSXCS.js → shadow-claw-empty-state-CnPm3NVM.js} +1 -1
  214. package/dist/public/{shadow-claw-file-viewer-DWCejuY3.js → shadow-claw-file-viewer-sZN_FCDW.js} +2 -2
  215. package/dist/public/{shadow-claw-files-L6_ioyzh.js → shadow-claw-files-CnvkCbd4.js} +2 -2
  216. package/dist/public/{shadow-claw-git-DsdkwLqQ.js → shadow-claw-git-BBHfClGk.js} +2 -2
  217. package/dist/public/{shadow-claw-integrations-CSbRTOm3.js → shadow-claw-integrations-DvdBqzRJ.js} +1 -1
  218. package/dist/public/{shadow-claw-llm-BitaeAVc.js → shadow-claw-llm-YfohG519.js} +1 -1
  219. package/dist/public/{shadow-claw-mcp-remote-gSbV5riy.js → shadow-claw-mcp-remote-BAVbf5pi.js} +1 -1
  220. package/dist/public/{shadow-claw-networking-Dn_y6Cl9.js → shadow-claw-networking-CZ4LWPW7.js} +1 -1
  221. package/dist/public/{shadow-claw-notifications-Cj4Lqx8U.js → shadow-claw-notifications-BHwyREkG.js} +1 -1
  222. package/dist/public/{shadow-claw-page-header-DR4OZFt2.js → shadow-claw-page-header-De6Qf6eY.js} +1 -1
  223. package/dist/public/{shadow-claw-page-header-action-button-BnCV_2Kb.js → shadow-claw-page-header-action-button-FSOhTc9z.js} +1 -1
  224. package/dist/public/{shadow-claw-pages-mpDOtNYj.js → shadow-claw-pages-D_oPyDca.js} +1 -1
  225. package/dist/public/{shadow-claw-pdf-viewer-DZ_84qJH.js → shadow-claw-pdf-viewer-CrU4wqRq.js} +1 -1
  226. package/dist/public/{shadow-claw-settings-CfFTYTEy.js → shadow-claw-settings-DkUhvxVr.js} +2 -2
  227. package/dist/public/{shadow-claw-storage-DLmiT4bG.js → shadow-claw-storage-D0o56Tjw.js} +1 -1
  228. package/dist/public/{shadow-claw-task-server-BoMBCsiS.js → shadow-claw-task-server-4rkroO9K.js} +1 -1
  229. package/dist/public/{shadow-claw-tasks-ChEp1j7x.js → shadow-claw-tasks-BdP7lmvu.js} +1 -1
  230. package/dist/public/{shadow-claw-terminal-BaoVbOda.js → shadow-claw-terminal-DVHX7Fsu.js} +1 -1
  231. package/dist/public/{shadow-claw-toast-e8oz7z6Z.js → shadow-claw-toast-B9Y9tSkW.js} +1 -1
  232. package/dist/public/{shadow-claw-tools-BYjUBiJz.js → shadow-claw-tools-BwwY53Lr.js} +1 -1
  233. package/dist/public/{shadow-claw-webvm-xGb13TME.js → shadow-claw-webvm-CXGdkCNM.js} +1 -1
  234. package/dist/public/{sync-web-mcp-registration-CQluj-Kz.js → sync-web-mcp-registration-DVK_IhXZ.js} +1 -1
  235. package/dist/public/{system-prompt-CTJn0tK-.js → system-prompt-BmswoQwF.js} +2 -2
  236. package/dist/public/{workbox-92eae37e.js → workbox-e4022e15.js} +1 -1
  237. package/dist/public/{zip-reader-DN7FB-Q0.js → zip-reader-JHoTbATw.js} +1 -1
  238. package/dist/server.js +5 -5
  239. package/package.json +1 -1
  240. package/dist/cli/chunk-2gZFafgY.js +0 -1
  241. package/dist/cli/chunk-BCjL0JXf.js +0 -1
  242. package/dist/cli/chunk-BNcu1oiT.js +0 -1
  243. package/dist/cli/chunk-BUNoeMKY.js +0 -36
  244. package/dist/cli/chunk-C5ypckWC.js +0 -225
  245. package/dist/cli/chunk-CFxww5Yz.js +0 -1
  246. package/dist/cli/chunk-CGIgtL6R.js +0 -1
  247. package/dist/cli/chunk-CafdvLx-.js +0 -1
  248. package/dist/cli/chunk-Dhap1VwA.js +0 -1
  249. package/dist/cli/chunk-Ds5-K-9o.js +0 -1
  250. package/dist/cli/chunk-DwvavohW.js +0 -1
  251. package/dist/cli/chunk-_a0CkUNS.js +0 -139
  252. package/dist/lib/system-prompt-bhGRLoL2.js.map +0 -1
  253. package/dist/public/compact-context-CX4H8V57.js +0 -5
@@ -1,14 +1,14 @@
1
- <!doctype html><html lang="en"><head><title>ShadowClaw</title><meta charset="utf-8"><meta name="revision" content="2257afeb9386cc61597736a5daf6885105ab27d7" /><meta name="version" content="1.59.7" /><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/" /><meta name="shadow-claw-override-prerender-skeleton" content="false" />
1
+ <!doctype html><html lang="en"><head><title>ShadowClaw</title><meta charset="utf-8"><meta name="revision" content="17cf2bc4ad5f4e142c4e1ad21ef4d4e04bef79b7" /><meta name="version" content="1.60.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/" /><meta name="shadow-claw-override-prerender-skeleton" content="false" />
2
2
  <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":[],"iframe":true},"feed":{"enabled":false},"settings":{"defaultToolsProfile":"__builtin_default","overridePrerenderSkeleton":false},"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>
3
3
  <script>var ShadowClawThemeInit=(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:`Module`});function t(){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 n=`__shadowClawDefaultTrustedTypesPolicyState`,r=`default`,i=`shadowclaw-sandbox`;function a(){let e=globalThis;return e[n]||(e[n]={initialized:!1,policy:null}),e[n]}function o(){let e=a();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(r);if(n){e.policy=n;return}}let n=!1;if(typeof t.getPolicyNames==`function`){let e=t.getPolicyNames();Array.isArray(e)&&e.includes(r)&&(n=!0)}if(n){if(typeof t.getPolicy==`function`){let n=t.getPolicy(i);if(n){e.policy=n;return}}e.policy=t.createPolicy(i,{createHTML:e=>e,createScriptURL:e=>e});return}e.policy=t.createPolicy(r,{createHTML:e=>e,createScriptURL:e=>e})}catch{typeof t.getPolicy==`function`&&(e.policy=t.getPolicy(r)??t.getPolicy(i)??null)}}}function s(e){let t=e.trim();if(!t)return()=>!1;if(t.startsWith(`/`)&&(t.endsWith(`/`)||/\/[gimuy]*$/.test(t)))try{let e=t.lastIndexOf(`/`),n=t.slice(1,e),r=t.slice(e+1),i=new RegExp(n,r||`i`);return e=>i.test(e)}catch{}if(t.includes(`^`)||t.includes(`$`)||t.includes(`(`)&&t.includes(`)`))try{let e=new RegExp(t,`i`);return t=>e.test(t)}catch{}if(t.startsWith(`*.`)){let e=t.slice(2).toLowerCase();return t=>{let n=t.toLowerCase();return n===e||n.endsWith(`.`+e)}}let n=t.toLowerCase();return e=>{let t=e.toLowerCase();return t===n||t.endsWith(`.`+n)}}let c=[],l=[],u=new Set(c.map(e=>e.toLowerCase().trim())),d=[...l];function f(e){e.map(e=>s(e)).filter(Boolean)}f(d);function p(e){return Array.isArray(e)?e.map(e=>typeof e==`string`?e.toLowerCase().trim():``).filter(Boolean):typeof e==`string`?e.split(/[\n,]+/).map(e=>e.toLowerCase().trim()).filter(Boolean):[]}function m(e){return Array.isArray(e)?e.map(e=>typeof e==`string`?e.trim():``).filter(Boolean):typeof e==`string`?e.split(/[\n,]+/).map(e=>e.trim()).filter(Boolean):[]}function h(e){let t=p(e);u=new Set(t)}function g(e){let t=m(e);d=t,f(t)}function _(e){if(!e||typeof e!=`string`)return!1;let t=e.trim().toLowerCase();return!t.includes(`-`)||t===`shadow-claw`||t.startsWith(`shadow-claw-`)||t.startsWith(`sc-`)?!0:u.has(t)}function v(e){if(!e||typeof e!=`object`)return;let t=e.allowedCustomElements||(typeof e.customElements==`object`&&!Array.isArray(e.customElements)?e.customElements?.allowedElements:void 0);t!==void 0&&h(t);let n=e.allowedCustomElementDomains||(typeof e.customElements==`object`&&!Array.isArray(e.customElements)?e.customElements?.allowedDomains:void 0);n!==void 0&&g(n)}function y(){if(typeof document>`u`)return;let e=document.getElementById(`shadow-claw-site-config`);if(e&&e.textContent)try{v(JSON.parse(e.textContent))}catch{}}let b=null,x=!1;function S(){y(),!(x||typeof customElements>`u`||typeof customElements.define!=`function`)&&(b=customElements.define.bind(customElements),customElements.define=function(e,t,n){if(!_((e||``).toLowerCase().trim())){let t=`[Security] Registration blocked: <${e}> is not an approved custom element.`;throw console.error(t),Error(t)}return b(e,t,n)},x=!0)}function C(e=typeof document<`u`?document.documentElement:null){if(typeof MutationObserver>`u`||!e)return null;if(typeof e.querySelectorAll==`function`)try{e.querySelectorAll(`*`).forEach(e=>{let t=e.tagName?e.tagName.toLowerCase():``;t.includes(`-`)&&!_(t)&&(console.warn(`[Security] Removing existing unapproved custom element: <${t}>`),e.remove())})}catch{}let t=new MutationObserver(e=>{for(let t of e)t.addedNodes.forEach(e=>{if(e.nodeType===1){let t=e,n=t.tagName?t.tagName.toLowerCase():``;n.includes(`-`)&&!_(n)&&(console.warn(`[Security] Removing unapproved custom element: <${n}>`),t.remove())}})});return t.observe(e,{childList:!0,subtree:!0}),t}function w(e){return e.replace(/^\/+|\/+$/g,``)}function T(e){let t=w(e);return t.endsWith(`/index.html`)?t=t.slice(0,-11):t.endsWith(`index.html`)&&(t=t.slice(0,-10)),w(t)}function E(e){let t=w(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 D(){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 O(e,t){if(P(e))return null;let n=t||D();if(!n||!n.routes)return null;let r=T(e);for(let[e,t]of Object.entries(n.routes))if(t&&t.prettyPath&&T(t.prettyPath)===r)return E(e);return null}let k=null,A=/* @__PURE__ */ new Set([`chat`,`files`,`tasks`,`pages`,`settings`,`tools`,`channels`]);function j(){k=null}typeof globalThis<`u`&&(globalThis.__applyBasePathCacheReset=j);function M(){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=N();return!n||n===`/`?``:n.replace(/^\/+|\/+$/g,``).replace(/[^a-zA-Z0-9_-]/g,`-`)}function N(){if(k!==null)return k;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 k=`/`,k;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 k=`/`,k;if(!n)return k=`/`+e[0]+`/`,k}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+=`/`),k=t,k}catch{}}}let t=e.pathname||`/`;if(t===`/`)return k=`/`,k;let n=t.split(`/`).filter(Boolean),r=n.findIndex(e=>A.has(e.toLowerCase()));return r>=0?r===0?(k=`/`,k):(k=`/`+n.slice(0,r).join(`/`)+`/`,k):O(t)?(k=`/`,k):n.length===1&&!t.includes(`.`)?(k=`/`+n[0]+`/`,k):(k=`/`,k)}function P(e){if(!e)return!1;let t=e.replace(/^\/+|\/+$/g,``).toLowerCase();if(t===`feed`||t.startsWith(`feed/`)||t.endsWith(`/feed`)||t.includes(`/feed/`)){let e=t.split(`/`).pop()||``;return!(e.includes(`.`)&&!e.endsWith(`.xml`)&&!e.endsWith(`.html`))}return!!(t.split(`/`).pop()||``).endsWith(`.xml`)}function F(e){let t=M();return t?`shadowclaw:${t}:${e}`:e}function I(e){if(typeof localStorage>`u`)return null;let t=F(e);try{let n=localStorage.getItem(t);if(n!==null)return n;if(t===e)return null;let r=localStorage.getItem(e);if(r!==null)return localStorage.setItem(t,r),r}catch(e){console.warn(`Unable to read from localStorage:`,e)}return null}function L(){try{let e=document.querySelector(`meta[name="shadow-claw-override-prerender-skeleton"]`)?.getAttribute(`content`);if(e===`true`)return!0;if(e===`false`)return!1}catch{}return!1}function R(){let e=sessionStorage.getItem(`shadow-claw-github-pages-404-redirect`);e&&sessionStorage.removeItem(`shadow-claw-github-pages-404-redirect`),e&&e!==location.pathname+location.search+location.hash&&history.replaceState(null,``,e)}function z(){t(),o(),S(),C();let e=document.documentElement;e.classList.add(`sc-js-enabled`,`sc-js-boot-pending`);let n=!1;try{let e=I(`shadow-claw-override-prerender-skeleton`);n=e===null?L():e===`true`}catch{n=L()}n&&e.classList.add(`sc-prerender-override`);let r=()=>{let e=document.querySelector(`shadow-claw`);return!e||e.getAttribute(`data-prerender-no-seed`)!==`true`&&!n?!1:(n&&(e.setAttribute(`data-prerender-no-seed`,`true`),e.setAttribute(`data-js-boot-pending`,`true`),e.setAttribute(`data-hydration-pending`,`true`)),!0)};if(!r()){let e=new MutationObserver(()=>{r()&&e.disconnect()});e.observe(document.documentElement,{childList:!0,subtree:!0})}let i=I(`shadow-claw-theme`)||`system`,a=window.matchMedia&&window.matchMedia(`(prefers-color-scheme: dark)`).matches,s=i===`system`?a?`dark`:`light`:i;document.documentElement.classList.add(`${s}-mode`),typeof document<`u`&&document.body&&document.body.classList.add(`${s}-mode`)}return R(),z(),window.addEventListener(`load`,e=>{let t=e.target;if(t&&t.tagName===`LINK`){let e=t;e.rel===`stylesheet`&&e.media===`print`&&e.href.includes(`Material+Symbols`)&&(e.media=`all`)}},!0),e.handleGithubPages404Redirects=R,e.initializeThemeAndBootState=z,e})({});</script><link rel="manifest" href="manifest.json"><link href="assets/icons/favicon.ico" rel="icon" type="image/x-icon" /><link href="assets/icons/180.png" rel="apple-touch-icon" /><style>:root{--shadow-claw-font-mono:"Fira Code","Courier New",monospace;--shadow-claw-font-sans:system-ui,-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,sans-serif;--shadow-claw-accent-hover:#1e293b;--shadow-claw-accent-primary:#334155;--shadow-claw-bg-primary-reverse:#0f172a;--shadow-claw-bg-primary:#f8fafc;--shadow-claw-bg-secondary:#f1f5f9;--shadow-claw-bg-tertiary:#e2e8f0;--shadow-claw-border-color:#e2e8f0;--shadow-claw-error-color:#ba1a1a;--shadow-claw-important-color:#334155;--shadow-claw-link-hover:#334155;--shadow-claw-link:#1e40af;--shadow-claw-on-error:#fff;--shadow-claw-on-primary:#fff;--shadow-claw-success-color:#059669;--shadow-claw-surface-tint:#334155;--shadow-claw-text-primary:#0f172a;--shadow-claw-text-secondary:#475569;--shadow-claw-text-tertiary:#64748b;--shadow-claw-warning-color:#d97706;--shadow-claw-font-size-lg:1.5rem;--shadow-claw-font-size-md:1.125rem;--shadow-claw-font-size-sm:0.875rem;--shadow-claw-radius-s:0.5rem;--shadow-claw-radius-m:0.75rem;--shadow-claw-radius-l:1.25rem;--shadow-claw-radius-pill:62.5rem;--shadow-claw-shadow-sm:0 0.0625rem 0.1875rem rgba(0,0,0,.1),0 0.0625rem 0.125rem rgba(0,0,0,.06);--shadow-claw-shadow-md:0 0.25rem 0.375rem -0.0625rem rgba(0,0,0,.1),0 0.125rem 0.25rem -0.0625rem rgba(0,0,0,.06);--shadow-claw-shadow-lg:0 0.625rem 0.9375rem -0.1875rem rgba(0,0,0,.1),0 0.25rem 0.375rem -0.125rem rgba(0,0,0,.05);--shadow-claw-shadow-sm:0 0.625rem 0.75rem 0 rgba(0,0,0,.05);--shadow-claw-shadow-md:0 0.625rem 1.875rem 0 rgba(0,0,0,.08);--shadow-claw-shadow-lg:0 0.625rem 1.875rem 0 rgba(0,0,0,.1);--shadow-claw-ease-in:cubic-bezier(0.32,0,0.67,0);--shadow-claw-ease-out:cubic-bezier(0.33,1,0.68,1);--shadow-claw-ease-in-out:cubic-bezier(0.65,0,0.35,1);--shadow-claw-duration-min:150ms;--shadow-claw-duration-regular:300ms;--shadow-claw-header-title-font-size:1.5rem;--shadow-claw-icon-accent-dark:#8e1d13;--shadow-claw-icon-bg:transparent;--shadow-claw-icon-body-segment:#c0392b;--shadow-claw-icon-body-shine:#e74c3c;--shadow-claw-icon-body:#922b21;--shadow-claw-icon-claw-inner:#922b21;--shadow-claw-icon-claw-main:#c0392b;--shadow-claw-icon-eye-shine:#fff;--shadow-claw-icon-eye:#171d1e;--shadow-claw-hljs-background-color:#282c34;--shadow-claw-logo-margin:0 0 0.375rem;--shadow-claw-logo-size:1.5rem;display:contents}@media (prefers-color-scheme:dark){:root{--shadow-claw-accent-hover:#cbd5e1;--shadow-claw-accent-primary:#94a3b8;--shadow-claw-on-primary:#0f172a;--shadow-claw-surface-tint:#94a3b8;--shadow-claw-bg-primary:#0f172a;--shadow-claw-bg-primary-reverse:#f8fafc;--shadow-claw-bg-secondary:#1e293b;--shadow-claw-bg-tertiary:#334155;--shadow-claw-border-color:#334155;--shadow-claw-error-color:#ffb4ab;--shadow-claw-link:#94a3b8;--shadow-claw-link-hover:#94a3b8;--shadow-claw-on-error:#690005;--shadow-claw-success-color:#34d399;--shadow-claw-text-primary:#f1f5f9;--shadow-claw-text-secondary:#cbd5e1;--shadow-claw-text-tertiary:#94a3b8;--shadow-claw-shadow-sm:0 0.0625rem 0.1875rem rgba(0,0,0,.3);--shadow-claw-shadow-md:0 0.25rem 0.375rem -0.0625rem rgba(0,0,0,.4);--shadow-claw-shadow-lg:0 0.625rem 0.9375rem -0.1875rem rgba(0,0,0,.5);--shadow-claw-icon-accent-dark:#ff6b6b;--shadow-claw-icon-body-segment:#ff5252;--shadow-claw-icon-body-shine:hsla(0,0%,100%,.3);--shadow-claw-icon-body:#ff1744;--shadow-claw-icon-claw-inner:#ff1744;--shadow-claw-icon-claw-main:#ff5252;--shadow-claw-icon-eye-shine:#171d1e;--shadow-claw-icon-eye:#dee3e5}}.light-mode{--shadow-claw-accent-hover:#1e293b;--shadow-claw-accent-primary:#334155;--shadow-claw-on-primary:#fff;--shadow-claw-surface-tint:#334155;--shadow-claw-bg-primary:#f8fafc;--shadow-claw-bg-primary-reverse:#0f172a;--shadow-claw-bg-secondary:#f1f5f9;--shadow-claw-bg-tertiary:#e2e8f0;--shadow-claw-border-color:#e2e8f0;--shadow-claw-error-color:#ba1a1a;--shadow-claw-link:#334155;--shadow-claw-link-hover:#1e293b;--shadow-claw-on-error:#fff;--shadow-claw-success-color:#059669;--shadow-claw-warning-color:#d97706;--shadow-claw-text-primary:#0f172a;--shadow-claw-text-secondary:#475569;--shadow-claw-text-tertiary:#64748b}.dark-mode{--shadow-claw-accent-hover:#cbd5e1;--shadow-claw-accent-primary:#94a3b8;--shadow-claw-on-primary:#0f172a;--shadow-claw-surface-tint:#94a3b8;--shadow-claw-bg-primary:#0f172a;--shadow-claw-bg-primary-reverse:#f8fafc;--shadow-claw-bg-secondary:#1e293b;--shadow-claw-bg-tertiary:#334155;--shadow-claw-border-color:#334155;--shadow-claw-error-color:#ffb4ab;--shadow-claw-link:#94a3b8;--shadow-claw-link-hover:#cbd5e1;--shadow-claw-on-error:#690005;--shadow-claw-success-color:#34d399;--shadow-claw-text-primary:#f1f5f9;--shadow-claw-text-secondary:#cbd5e1;--shadow-claw-text-tertiary:#94a3b8;--shadow-claw-shadow-sm:0 0.0625rem 0.1875rem rgba(0,0,0,.3);--shadow-claw-shadow-md:0 0.25rem 0.375rem -0.0625rem rgba(0,0,0,.4);--shadow-claw-shadow-lg:0 0.625rem 0.9375rem -0.1875rem rgba(0,0,0,.5);--shadow-claw-icon-accent-dark:#ff6b6b;--shadow-claw-icon-bg:transparent;--shadow-claw-icon-body-segment:#ff5252;--shadow-claw-icon-body-shine:hsla(0,0%,100%,.3);--shadow-claw-icon-body:#ff1744;--shadow-claw-icon-claw-inner:#ff1744;--shadow-claw-icon-claw-main:#ff5252;--shadow-claw-icon-eye-shine:#171d1e;--shadow-claw-icon-eye:#dee3e5}*,:after,:before{font-family:var(--shadow-claw-font-sans)}*{box-sizing:border-box;margin:0;padding:0;scrollbar-color:var(--shadow-claw-border-color) transparent;scrollbar-width:thin}::-webkit-scrollbar{height:.5rem;width:.5rem}::-webkit-scrollbar-track{background:transparent}::-webkit-scrollbar-thumb{background:var(--shadow-claw-border-color);border-radius:.25rem}::-webkit-scrollbar-thumb:hover{background:var(--shadow-claw-text-tertiary)}body,html{-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased;-webkit-text-size-adjust:100%;text-size-adjust:100%;background-color:var(--shadow-claw-bg-primary);color:var(--shadow-claw-text-primary);display:flex;flex-direction:column;width:100%}@media (max-width:48rem){input,select,textarea{font-size:16px}}html.sc-prerender-override shadow-claw{visibility:hidden}shadow-claw:not(:defined){background:radial-gradient(circle at 20% 15%,rgba(56,189,248,.08),transparent 40%),radial-gradient(circle at 85% 90%,rgba(51,65,85,.2),transparent 45%),var(--shadow-claw-bg-primary);color:var(--shadow-claw-text-primary);display:grid}.header-title-link,.header-title-link:hover{align-items:center;color:var(--shadow-claw-text-primary);display:flex;text-decoration:none}.header-title-logo{display:none;flex-shrink:0;height:var(--shadow-claw-logo-size,1.5rem);margin:var(--shadow-claw-logo-margin,0 0 .375rem);width:var(--shadow-claw-logo-size,1.5rem)}.header-title{align-items:center;display:none;font-size:var(--shadow-claw-header-title-font-size,1.5rem);font-weight:700;line-height:1;margin:0 0 0 .5rem}.header-title:first-child{margin-left:0}@media (min-width:30rem){.header-title,.header-title-logo{display:flex}}.header-actions-logo-link{align-items:center;color:inherit;display:flex;flex-direction:row;height:2.5rem;justify-content:center;width:2.5rem}.header-actions-logo-link svg{height:1.5rem;width:1.5rem}.app-dialog,dialog{background-color:var(--shadow-claw-bg-secondary);border:.0625rem solid var(--shadow-claw-border-color);border-radius:var(--shadow-claw-radius-l,1.25rem);box-shadow:var(--shadow-claw-shadow-lg);color:var(--shadow-claw-text-primary);padding:0}.app-dialog::backdrop,dialog::backdrop{backdrop-filter:blur(2px);background:color-mix(in srgb,#000 65%,transparent)}.sidebar-custom-sections{display:flex;flex-direction:column;gap:.5rem;padding:.5rem}.sidebar-section{display:flex;flex-direction:column;gap:.125rem}.sidebar-section-header{color:var(--shadow-claw-text-tertiary);font-size:.75rem;font-weight:700;letter-spacing:.05em;padding:.5rem .75rem .25rem;text-transform:uppercase}.sidebar-section-header a.sidebar-link{color:inherit;font-weight:700;padding:0;text-transform:uppercase}.sidebar-item{display:flex}.sidebar-link{align-items:center;border-radius:var(--shadow-claw-radius-m);color:var(--shadow-claw-text-secondary);display:flex;font-size:var(--shadow-claw-font-size-sm);font-weight:500;padding:.5rem .75rem;text-decoration:none;transition:background-color .15s,color .15s;width:100%}.sidebar-link:hover{background-color:var(--shadow-claw-text-secondary);color:var(--shadow-claw-on-primary)}.sidebar-link.active,.sidebar-link[aria-current=page]{background-color:var(--shadow-claw-accent-primary);color:var(--shadow-claw-on-primary)}</style><link rel="preconnect" href="https://fonts.googleapis.com"><link rel="preconnect" href="https://fonts.gstatic.com" crossorigin><link rel="stylesheet" href="https://fonts.googleapis.com/css2?family=Material+Symbols+Outlined&display=swap" media="print"><noscript> <link rel="stylesheet" href="https://fonts.googleapis.com/css2?family=Material+Symbols+Outlined&display=swap"> </noscript> <script id="shadow-claw-static-manifest" type="application/json">{"pages":[{"displayPath":"index.html","content":"---\ntitle: \"ShadowClaw Pages\"\ncreated: \"1970-01-01T00:00:00Z\"\nupdated: \"1970-01-01T00:00:00Z\"\nslug: \"shadow-claw-pages\"\n---\n\n\u003carticle\u003e\n \u003ch2\u003eWelcome to ShadowClaw Pages\u003c\u002fh2\u003e\n \u003cp\u003eThis is the default static page for your workspace.\u003c\u002fp\u003e\n \u003ch2 id=\"getting-started-with-shadowclaw\"\u003eGetting started with ShadowClaw\u003c\u002fh2\u003e\n \u003ch3 id=\"what-is-memorymd\"\u003eWhat is MEMORY.md?\u003c\u002fh3\u003e\n \u003cul\u003e\n \u003cli\u003e\n \"\u003ca href=\"\u002ffiles\u002fmain\u002fMEMORY.md\"\u003eMEMORY.md\u003c\u002fa\u003e\" is a per conversation, per\n invocation, auto-loaded, persistent agent memory file.\n \u003c\u002fli\u003e\n \u003cli\u003e\n It is designed to be a helpful scratchpad for agents to store important\n information, notes, and context about the conversation.\n \u003c\u002fli\u003e\n \u003c\u002ful\u003e\n \u003ch3 id=\"how-to-use-files\"\u003eHow to use Files\u003c\u002fh3\u003e\n \u003cul\u003e\n \u003cli\u003eOpen \"\u003ca href=\"\u002ffiles\u002fmain\"\u003eFiles\u003c\u002fa\u003e\" to browse your workspace.\u003c\u002fli\u003e\n \u003cli\u003e\n Edit and preview files with the file viewer:\n \u003cul\u003e\n \u003cli\u003e\u003ca href=\"\u002ffiles\u002fmain\u002findex.html\"\u003eindex.html\u003c\u002fa\u003e\u003c\u002fli\u003e\n \u003cli\u003e\n \u003ca href=\"\u002ffiles\u002fmain\u002f~\u002fdocs\u002fexample\u002farticle.html\"\u003earticle.html\u003c\u002fa\u003e\n \u003c\u002fli\u003e\n \u003c\u002ful\u003e\n \u003c\u002fli\u003e\n \u003c\u002ful\u003e\n \u003ch3 id=\"how-to-use-pages\"\u003eHow to use Pages\u003c\u002fh3\u003e\n \u003cul\u003e\n \u003cli\u003eUse Set as Page on any markdown or HTML file to add it to Pages.\u003c\u002fli\u003e\n \u003cli\u003eRemove a page anytime from the \"\u003ca href=\"\u002fpages\"\u003ePages\u003c\u002fa\u003e\" view.\u003c\u002fli\u003e\n \u003cli\u003e\n Configure sandboxed iframe or direct shadow DOM page rendering via\n frontmatter or site configuration.\n \u003c\u002fli\u003e\n \u003c\u002ful\u003e\n \u003ch3 id=\"how-to-use-chat\"\u003eHow to use Chat\u003c\u002fh3\u003e\n \u003cul\u003e\n \u003cli\u003e\n Open \"\u003ca href=\"\u002fsettings\"\u003eSettings\u003c\u002fa\u003e\" to configure your agent's system\n prompt, tools, and more.\n \u003c\u002fli\u003e\n \u003cli\u003e\n Open \"\u003ca href=\"\u002fchat\u002fmain\"\u003eChat\u003c\u002fa\u003e\" to start a conversation with your\n agent.\n \u003c\u002fli\u003e\n \u003c\u002ful\u003e\n \u003ch2 id=\"further-information\"\u003eFurther information\u003c\u002fh2\u003e\n \u003cul\u003e\n \u003cli\u003e\n \u003ca href=\"https:\u002f\u002fgithub.com\u002fxt-ml\u002fshadow-claw#-shadowclaw\"\n \u003eShadowClaw Project\u003c\u002fa\n \u003e\n \u003c\u002fli\u003e\n \u003cli\u003e\u003ca href=\"https:\u002f\u002fdeepwiki.com\u002fxt-ml\u002fshadow-claw\"\u003eDeep Wiki\u003c\u002fa\u003e\u003c\u002fli\u003e\n \u003c\u002ful\u003e\n\u003c\u002farticle\u003e\n"},{"displayPath":"~\u002fdocs\u002fskill-creator.md","content":"---\ntitle: \"Agent Skills & Skill Creator\"\ncreated: \"1970-01-01T00:00:00Z\"\nupdated: \"1970-01-01T00:00:00Z\"\nslug: \"skill-creator\"\n---\n\n## Agent Skills & Skill Creator\n\nWelcome to the ShadowClaw Agent Skills guide! Skills are workspace-local instruction packages and automated tool pipelines that give your AI assistant specialized capabilities.\n\nWhether you want to teach the assistant a specialized coding workflow, build silent background utility tools, or trigger automated tasks with slash commands, **Agent Skills** make it simple and declarative.\n\n---\n\n## 🌟 Quick Start: What is an Agent Skill?\n\nAn Agent Skill is a directory containing a `SKILL.md` file located inside your workspace's `.agents\u002fskills\u002f` folder:\n\n```text\n.agents\u002fskills\u002f\n├── skill-creator\u002f\n│ ├── SKILL.md\n│ └── references\u002f\n│ ├── frontmatter-spec.md\n│ ├── declarative-pipelines.md\n│ └── declarative-tools.md\n└── toast-random-number\u002f\n └── SKILL.md\n```\n\nEach skill includes:\n\n1. **`SKILL.md`**: Standard frontmatter metadata (name, description, slash command triggers) and step-by-step instructions.\n2. **`references\u002f` Directory**: Detailed reference guides and technical documentation co-located with the skill.\n3. **Declarative Pipelines**: Optional deterministic tool workflows (`execution.type: \"tools\"`) that execute instantly without calling LLM prompts.\n\n---\n\n## 🚀 Creating Skills with `\u002fskill-creator`\n\nShadowClaw comes with an official bundled **Skill Creator**. You can trigger it anytime by typing `\u002fskill-creator` in the chat thread or asking the AI assistant to create a skill for you.\n\n### Recommended Skill Authoring Workflow\n\n1. **Define the Scope & Trigger**: Decide on a clear skill name (e.g. `toast-random-number`) and write a concise description of what it does.\n2. **Set Up Workspace Folders**:\n - Skill files belong in `.agents\u002fskills\u002f\u003cskill-name\u003e\u002fSKILL.md` (canonical flat layout; legacy `.agents\u002fskills\u002fmain\u002f` is supported for backward-compatible reads).\n - Custom declarative tools belong in `.agents\u002ftools\u002f\u003ctool-name\u003e.json` (or legacy `.agents\u002ftools\u002fmain\u002f\u003ctool-name\u003e.json`).\n3. **Write `SKILL.md`**: Configure standard frontmatter attributes and instructions.\n4. **Add Technical References**: Store detailed reference materials under the skill's `references\u002f` directory.\n\n---\n\n## 📚 Skill Reference Documentation\n\nFor deep technical details, explore the co-located reference guides bundled with the official `skill-creator` skill:\n\n- 📋 **[Frontmatter Specification](file:\u002f\u002f\u002f.agents\u002fskills\u002fskill-creator\u002freferences\u002ffrontmatter-spec.md)**\n Complete schema rules for `name`, `description`, `user-invocable`, `disable-model-invocation`, `argument-hint`, and `metadata.allowed-tools`.\n\n- ⚡ **[Declarative Execution Pipelines](file:\u002f\u002f\u002f.agents\u002fskills\u002fskill-creator\u002freferences\u002fdeclarative-pipelines.md)**\n How to write zero-LLM tool chains using `execution.type: \"tools\"`, `$pipe` output piping, `suppressToast`, and `suppressOutput`.\n\n- 🛠️ **[Declarative Tools Reference](file:\u002f\u002f\u002f.agents\u002fskills\u002fskill-creator\u002freferences\u002fdeclarative-tools.md)**\n How to author custom JSON tool definitions in `.agents\u002ftools\u002f` with sandboxed JavaScript evaluation and WebMCP model context integration.\n\n---\n\n## 💡 Example: A Two-Step Declarative Skill\n\nHere is a complete, real-world example of a declarative skill that generates a random number and displays it in a toast notification silently:\n\n```yaml\n---\nname: toast-random-number\ndescription: Generate a random integer from 1 to 1000000 and show it in a ShadowClaw toast notification.\nuser-invocable: true\nmetadata:\n allowed-tools: javascript show_toast generate_random_number\n execution:\n type: tools\n suppressToast: true\n suppressOutput: true\n tools:\n - name: javascript\n input:\n code: Math.floor(Math.random() * 1000000) + 1\n - name: show_toast\n input:\n title: Random Number\n message:\n $pipe: prev\n---\n# Toast Random Number\n\nThis skill generates a random integer and displays it instantly in a toast notification.\n```\n\nWhen you type `\u002ftoast-random-number`, ShadowClaw executes the two steps directly without delay!\n\n---\n\n## 🌐 Installing Skills from skills.sh & Publishing\n\nShadowClaw integrates directly with the [Open Agent Skills](https:\u002f\u002fagentskills.io) ecosystem and [skills.sh](https:\u002f\u002fskills.sh):\n\n### Finding & Adding Skills\n\nSearch thousands of community and vendor skills from `skills.sh`:\n\n```bash\n# Search skills.sh directory\nnpx shadow-claw skills find \"react\"\n\n# Install directly into .agents\u002fskills\u002f\nnpx shadow-claw skills add vercel-labs\u002fagent-skills\n# or using npx skills:\nnpx skills add mattpocock\u002fskills@grilling -a universal --yes\n```\n\n### Publishing Discovery Indexes\n\nTo publish your workspace skills so external agents and clients can discover them over HTTP:\n\n```bash\n# Generate RFC v0.2.0 discovery manifest at .well-known\u002fagent-skills\u002findex.json\nnpx shadow-claw skills:index\n```\n"},{"displayPath":"~\u002fdocs\u002fpublishing-to-github-pages.md","content":"---\ntitle: \"Publishing to GitHub Pages\"\ncreated: \"1970-01-01T00:00:00Z\"\nupdated: \"1970-01-01T00:00:00Z\"\nslug: \"publishing-to-github-pages\"\n---\n\n## Publishing to GitHub Pages\n\nShadowClaw can drive a fully automated static-site publishing pipeline directly from the browser, with the only server-side requirement being a GitHub Actions workflow that runs the Node.js build.\n\n---\n\n## Deployment strategies\n\n### Strategy A — Full fork\n\nClone the entire ShadowClaw repository, add your pages to `pages\u002fmain\u002f`, push to a new repo you own, and let CI build and deploy it.\n\n### Strategy B — Pages-only repo (Git clone & inject in CI)\n\nYour repo contains your content, an optional root-level `shadow-claw.config.json` (or `site-config.json`), and a GitHub Actions workflow. Content lives under `pages\u002f`; the workflow checks out ShadowClaw as a build toolchain in CI and builds into `dist\u002fpublic`.\n\n### Strategy C — NPM Package & CLI (`npx shadow-claw`)\n\nRun or deploy using the `shadow-claw` npm package directly:\n\n- Locally: `npx shadow-claw dev` (or `shadow-claw run`) to preview with dev server.\n- In CI: `npx shadow-claw build --prod` builds `dist\u002fpublic` without needing to clone ShadowClaw or copy files.\n- In `package.json`: add `\"shadow-claw\": \"^1.22.4\"` as a devDependency and run `npm run build`.\n\n**Strategy B and Strategy C are both fully supported for content-only repositories and knowledge hubs.**\n\n---\n\n## Strategy B — Step-by-step\n\n### 1. Create a new GitHub repository\n\nCreate an empty repo at `github.com\u002f\u003cyou\u003e\u002f\u003cyour-site\u003e`. Enable **Settings → Pages → Source: GitHub Actions**.\n\n### 2. Add the workflow\n\nCreate `.github\u002fworkflows\u002fdeploy-pages.yml`:\n\n```yaml\nname: Build and Deploy via ShadowClaw\n\non:\n push:\n branches: [main]\n workflow_dispatch:\n inputs:\n shadowclaw_version:\n description: \"ShadowClaw npm version (e.g. latest, 1.23.3)\"\n required: false\n default: \"latest\"\n\npermissions:\n contents: read\n pages: write\n id-token: write\n\nconcurrency:\n group: pages\n cancel-in-progress: true\n\njobs:\n build-and-deploy:\n environment:\n name: github-pages\n url: ${{ steps.deployment.outputs.page_url }}\n runs-on: ubuntu-latest\n steps:\n - name: Checkout repository\n uses: actions\u002fcheckout@v6\n\n - name: Setup Node.js\n uses: actions\u002fsetup-node@v6\n with:\n node-version: \"24\"\n\n - name: Build static site via ShadowClaw CLI\n env:\n PAGES_ORIGIN: \"https:\u002f\u002f${{ github.repository_owner }}.github.io\u002f${{ github.event.repository.name }}\u002f\"\n PAGES_BASE_PATH: \"\u002f${{ github.event.repository.name }}\u002f\"\n run: |\n VERSION=\"${{ github.event.inputs.shadowclaw_version || 'latest' }}\"\n npx --yes \"shadow-claw@$VERSION\" build --prod\n\n - name: Upload Pages artifact\n uses: actions\u002fupload-pages-artifact@v3\n with:\n path: dist\u002fpublic\n\n - name: Deploy to GitHub Pages\n id: deployment\n uses: actions\u002fdeploy-pages@v4\n```\n\n### Version Pinning\n\nShadowClaw builds via `npx --yes shadow-claw@latest build --prod`. To pin to a specific npm release (e.g. `1.23.3`), specify the version in `.github\u002fworkflows\u002fdeploy-pages.yml` or supply `shadowclaw_version` when triggering the GitHub Actions workflow manually.\n\nFor a **custom apex domain** (e.g. `example.com`), override:\n\n```yaml\nPAGES_ORIGIN: \"https:\u002f\u002fexample.com\u002f\"\nPAGES_BASE_PATH: \"\u002f\"\n```\n\n### 3. Add your content\n\n```text\npages\u002f\n main\u002f\n index.html ← home page\n ~\u002fcontent\u002f\n about.md ← any other pages\n routes.json ← pretty-path config (optional)\n\nshadow-claw.config.json ← branding, default tool settings, and build configuration (optional)\n```\n\nSite configurations can also specify tool defaults under `settings`:\n\n```json\n{\n \"settings\": {\n \"defaultToolsProfile\": \"__builtin_default\",\n \"enabledTools\": [\"javascript\", \"read_file\", \"write_file\"]\n }\n}\n```\n\nThe `pages\u002f` directory is optional. If it is absent, the build succeeds and\nShadowClaw publishes its built-in `index.html` and `MEMORY.md` Pages content.\nPretty paths are skipped unless a `routes.json` file is present.\n\nMinimal `pages\u002froutes.json`:\n\n```json\n{\n \"routes\": {\n \"\u002fpages\u002fmain\u002findex.html\": { \"prettyPath\": \"\u002f\" },\n \"\u002fpages\u002fmain\u002f~\u002fcontent\u002fabout.md\": { \"prettyPath\": \"\u002fabout\" },\n \"\u002fpages\u002fmain\u002fMEMORY.md\": { \"prettyPath\": \"\u002fmemory\" }\n }\n}\n```\n\n\u003e **Reserved path prefixes** — the following first-path-segments are owned by\n\u003e ShadowClaw's own router and **must not** be used as custom pretty path\n\u003e prefixes: `\u002fchat`, `\u002ffiles`, `\u002ftasks`, `\u002fpages`, `\u002fsettings`, `\u002ftools`, and\n\u003e `\u002fchannels`. Root (`\u002f`) is supported as an explicit pretty path. If no route\n\u003e maps to `\u002f`, the default pinned page is shown there. For other routes, use a\n\u003e namespace like `\u002fmain\u002f`, `\u002farticles\u002f`, or `\u002fdocs\u002f`.\n\n#### Sitemaps, `robots.txt`, and Feeds\n\nShadowClaw copies a custom sitemap selected by `sitemapPath`; otherwise it\ncopies existing `sitemap.xml` and\u002for `sitemap.txt` files. If neither exists,\nit generates `sitemap.xml` from `routes.json` when a canonical origin is\navailable. The generated sitemap includes the site root and each unique\n`prettyPath`. The origin comes from `--origin` or `PAGES_ORIGIN`, falling back\nto `branding.siteUrl`. Existing XML and text sitemap URLs are rewritten to\n`--origin` or `PAGES_ORIGIN` when either is set.\n\n`robots.txt` is copied as-is; its sitemap URL is not rewritten from\n`PAGES_ORIGIN`. Provide a content-specific file such as\n`pages\u002fresources\u002frobots.txt` with the deployed URL, including the repository\nsubpath for GitHub Pages project sites:\n\n```text\nUser-agent: *\nDisallow:\n\nSitemap: https:\u002f\u002f\u003cowner\u003e.github.io\u002f\u003crepository\u003e\u002fsitemap.xml\n```\n\nTo generate RSS 2.0, Atom 1.0, and RDF 1.0 feeds from routed pages, enable\nfeeds in `shadow-claw.config.json`:\n\n```json\n{\n \"feed\": { \"enabled\": true }\n}\n```\n\n`\"feed\": true` is also supported. Feed generation requires `routes.json` and\npublishes files under `\u002ffeed\u002f`, `\u002ffeed\u002fatom\u002f`, and `\u002ffeed\u002frdf\u002f`, along with\nHTML redirect pages and feed-discovery links in the app shell. Set\n`branding.siteUrl` to the deployed base URL, including any GitHub Pages\nrepository subpath, so those discovery links resolve correctly. Feed entries\ncan be filtered with `feed.allowList` \u002f `feed.denyList`; page frontmatter can\nopt out with `feed: false`, `syndication: false`, or `rss: false`.\n\n#### Default Pinned Page (`\u002f`)\n\nWhen no `routes.json` entry maps a pretty path to `\u002f`, visitors see the\n**default pinned page** at the root URL. An explicit route such as\n`\"\u002fpages\u002fmain\u002findex.html\": { \"prettyPath\": \"\u002f\" }` takes precedence.\n\n**How ShadowClaw selects the default page for `\u002f`:**\n\n1. Both the static site prerenderer (`prerender-dsd-shell`) and runtime page store (`orchestratorStore`) gather all page files in `pages\u002fmain\u002f`. If `pages\u002fmain\u002f` is absent, both use the built-in default `index.html` and `MEMORY.md` pages.\n2. `MEMORY.md` is always moved to the bottom of the list.\n3. All remaining pages are sorted by `pages.sortOrder` from `shadow-claw.config.json` (or `site-config.json`) (`\"desc\"` by default, natural numeric, or `\"asc\"`).\n4. The first file in this sorted list (`pages[0]`) becomes the default page rendered at `\u002f`.\n\n**How to ensure your intended home page is rendered at `\u002f`:**\nName your landing page file so it sorts first in reverse-alphabetical order relative to other files in `pages\u002fmain\u002f`:\n\n- `index.md` or `index.html` will sort ahead of `about.md`, `contact.md`, or `faq.md`.\n- If you have files starting with letters after `i` (e.g. `welcome.md`), `welcome.md` will sort ahead of `index.md`. Ensure your preferred landing page filename sorts highest in reverse-alphabetical order.\n\n### 4. Push — CI does the rest\n\nEvery push to `main` triggers a build (~3–5 min on a cold runner, faster with the npm cache warm) and deploys to `https:\u002f\u002f\u003cyou\u003e.github.io\u002f\u003cyour-site\u003e\u002f`.\n\n---\n\n## In-browser automation (no LLM, no server)\n\nShadowClaw can publish to your content repo entirely from the browser using a `type: \"tools\"` task chain. The chain is deterministic — it makes **zero LLM calls**.\n\n### Prerequisites\n\n- Clone your content repo into the workspace: ask the agent to `git_clone https:\u002f\u002fgithub.com\u002f\u003cyou\u003e\u002f\u003cyour-site\u003e`, or do it manually.\n- Configure a GitHub Personal Access Token in **Settings → Git → PAT** (needs `repo` scope for private repos, `public_repo` for public ones).\n\n### Minimal publish chain\n\n```json\n{\n \"type\": \"tools\",\n \"tools\": [\n {\n \"name\": \"write_file\",\n \"input\": {\n \"path\": \"repos\u002fyour-site\u002fpages\u002fmain\u002fpost.md\",\n \"content\": \"---\\ntitle: My Post\\n---\\n\\n# Hello World\\n\\nContent here.\"\n }\n },\n {\n \"name\": \"git_add\",\n \"input\": {\n \"repo\": \"your-site\",\n \"files\": [\"pages\u002fmain\u002fpost.md\"]\n }\n },\n {\n \"name\": \"git_commit\",\n \"input\": {\n \"repo\": \"your-site\",\n \"message\": \"publish: new post\"\n }\n },\n {\n \"name\": \"git_push\",\n \"input\": {\n \"repo\": \"your-site\"\n }\n }\n ]\n}\n```\n\n### Fetch-transform-publish chain (fully automated data pipeline)\n\nThis chain fetches an external data source, transforms it to markdown via the JavaScript sandbox, writes it as a page, and pushes — no human in the loop:\n\n```json\n{\n \"type\": \"tools\",\n \"tools\": [\n {\n \"name\": \"fetch_url\",\n \"input\": {\n \"url\": \"https:\u002f\u002fapi.github.com\u002frepos\u002fxt-ml\u002fshadow-claw\u002freleases\u002flatest\"\n }\n },\n {\n \"name\": \"javascript\",\n \"input\": {\n \"code\": \"const match = $PIPE_DATA.match(\u002f--- BEGIN EXTERNAL CONTENT[\\\\s\\\\S]*?---\\\\n([\\\\s\\\\S]*?)\\\\n--- END EXTERNAL CONTENT ---\u002f); const raw = match ? match[1] : $PIPE_DATA; const rel = JSON.parse(raw); const date = rel.published_at?.slice(0, 10) ?? 'unknown'; return `---\\\\ntitle: ShadowClaw ${rel.tag_name}\\\\ndate: ${date}\\\\n---\\\\n\\\\n# ${rel.name}\\\\n\\\\nPublished: ${date}\\\\n\\\\n${rel.body ?? ''}`;\",\n \"data\": { \"$pipe\": \"prev\" }\n }\n },\n {\n \"name\": \"write_file\",\n \"input\": {\n \"path\": \"repos\u002fyour-site\u002fpages\u002fmain\u002frelease-notes.md\",\n \"content\": { \"$pipe\": \"prev\" }\n }\n },\n {\n \"name\": \"git_add\",\n \"input\": {\n \"repo\": \"your-site\",\n \"files\": [\"pages\u002fmain\u002frelease-notes.md\"]\n }\n },\n {\n \"name\": \"git_commit\",\n \"input\": {\n \"repo\": \"your-site\",\n \"message\": \"shadow-claw[bot]: sync release notes\"\n }\n },\n {\n \"name\": \"git_push\",\n \"input\": {\n \"repo\": \"your-site\"\n }\n }\n ]\n}\n```\n\n---\n\n## Strategy C — NPM Package & CLI Workflow\n\nIf you prefer building directly with `npx shadowclaw` without cloning the ShadowClaw repository in CI, use this minimal workflow:\n\n```yaml\nname: Build and Deploy via ShadowClaw CLI\n\non:\n push:\n branches: [main]\n workflow_dispatch:\n\npermissions:\n contents: read\n pages: write\n id-token: write\n\nconcurrency:\n group: pages\n cancel-in-progress: true\n\njobs:\n build:\n runs-on: ubuntu-latest\n steps:\n - name: Checkout content repo\n uses: actions\u002fcheckout@v4\n\n - uses: actions\u002fsetup-node@v4\n with:\n node-version: \"24\"\n\n - name: Build production bundle\n env:\n NODE_ENV: production\n PAGES_ORIGIN: \"https:\u002f\u002f${{ github.repository_owner }}.github.io\u002f${{ github.event.repository.name }}\u002f\"\n PAGES_BASE_PATH: \"\u002f${{ github.event.repository.name }}\u002f\"\n run: npx shadow-claw build --prod\n\n - name: Upload Pages artifact\n uses: actions\u002fupload-pages-artifact@v3\n with:\n path: dist\u002fpublic\n\n deploy:\n needs: build\n runs-on: ubuntu-latest\n environment:\n name: github-pages\n url: ${{ steps.deployment.outputs.page_url }}\n steps:\n - name: Deploy to GitHub Pages\n id: deployment\n uses: actions\u002fdeploy-pages@v4\n```\n\n\u003e **Tip:** Wrap this in a scheduled task (Tasks sidebar → New Task → type `tools`, set a cron interval) to run the pipeline automatically, e.g. every 24 hours. No LLM calls are made at execution time.\n\n---\n\n## Template repository\n\nA ready-to-fork starter template is available in the [`shadow-claw-template`](https:\u002f\u002fgithub.com\u002fxt-ml\u002fshadow-claw-template) repository. It contains the workflow, sample `pages\u002fmain\u002findex.html`, `pages\u002fmain\u002f~\u002fcontent\u002fabout.md`, root-level `shadow-claw.config.json`, and `pages\u002froutes.json`.\n"},{"displayPath":"~\u002fdocs\u002fexample\u002farticle.html","content":"---\ntitle: \"Article\"\ncreated: \"1970-01-01T00:00:00Z\"\nupdated: \"1970-01-01T00:00:00Z\"\nslug: \"article\"\n---\n\n\u003carticle\u003e\n \u003ch2\u003eBig Buck Bunny\u003c\u002fh2\u003e\n\n \u003cvideo controls style=\"border-radius: 0.5rem; width: 100%\"\u003e\n \u003csource\n src=\"https:\u002f\u002fxt-ml.github.io\u002fassets\u002fmedia\u002fBigBuckBunny\u002fBigBuckBunny_320x180.mp4\"\n type=\"video\u002fmp4\"\n \u002f\u003e\n \u003c\u002fvideo\u003e\n \u003csection\u003e\n \u003ch2\u003eLicensing\u003c\u002fh2\u003e\n \u003cul\u003e\n \u003cli\u003e\n \u003ccode\u003eBig Buck Bunny\u003c\u002fcode\u003e is licensed under the\n \u003ca href=\"https:\u002f\u002fblender.org\"\n \u003eCreative Commons Attribution 3.0 License\u003c\u002fa\n \u003e.\n \u003cul\u003e\n \u003cli\u003e\n Attribution: Blender Foundation \u002f\n \u003ca href=\"https:\u002f\u002fwww.blender.org\u002f\"\u003ewww.blender.org\u003c\u002fa\u003e\n \u003c\u002fli\u003e\n \u003cli\u003e\n Copyright: (c) copyright 2008, Blender Foundation \u002f\n \u003ca href=\"https:\u002f\u002fwww.bigbuckbunny.org\u002f\"\u003ewww.bigbuckbunny.org\u003c\u002fa\u003e\n \u003c\u002fli\u003e\n \u003c\u002ful\u003e\n \u003c\u002fli\u003e\n \u003c\u002ful\u003e\n \u003c\u002fsection\u003e\n\u003c\u002farticle\u003e\n"},{"displayPath":"MEMORY.md","content":"---\ntitle: \"Agent Memory\"\ncreated: \"1970-01-01T00:00:00Z\"\nupdated: \"1970-01-01T00:00:00Z\"\nslug: \"agent-memory\"\n---\n\n## Memory\n\n### Workspace Layout & Skills Conventions\n\n- **Skills**: `.agents\u002fskills\u002f\u003cskill-name\u003e\u002fSKILL.md` (canonical flat layout; legacy `.agents\u002fskills\u002fmain\u002f` supported for backward-compatible reads)\n- **Declarative Tools**: `.agents\u002ftools\u002f\u003ctool-name\u003e.json` (canonical flat layout; legacy `.agents\u002ftools\u002fmain\u002f` supported for backward-compatible reads)\n- **Skill Format**: Markdown file with YAML frontmatter AND a Markdown body (frontmatter is metadata only; always include a `# \u003cSkill Title\u003e` heading and human-readable description in the Markdown body so it renders in document previews):\n\n ```yaml\n ---\n name: \u003cskill-name\u003e\n description: \u003cclear summary for model and slash command\u003e\n user-invocable: true\n metadata:\n allowed-tools: \u003ctool1\u003e \u003ctool2\u003e\n execution:\n type: tools\n tools:\n - name: \u003ctool1\u003e\n input: { ... }\n - name: \u003ctool2\u003e\n input: { \"$pipe\": \"prev\" }\n ---\n # \u003cSkill Title\u003e\n\n \u003cOverview and description of what the skill does, parameters, and usage instructions.\u003e\n ```\n\n- **Declarative Tool Format**: JSON with `\"name\"`, `\"description\"`, `\"executor\": \"javascript\"`, `\"inputSchema\"`, and `\"code\"`.\n- **Open Agent Skills & Discovery**: Install community skills from [skills.sh](https:\u002f\u002fskills.sh) via `npx shadow-claw skills add \u003cowner\u002frepo\u003e` (or `npx skills add`), search via `npx shadow-claw skills find \u003cterm\u003e`, and publish RFC v0.2.0 discovery indexes via `npx shadow-claw skills:index` (`.well-known\u002fagent-skills\u002findex.json`).\n- **Authoring**: Use `create_directory` before writing new directories, then `write_file`.\n"}],"skills":[{"displayPath":"skill-creator\u002freferences\u002fdeclarative-pipelines.md","content":"# Declarative Execution Pipelines\n\nDeclarative execution pipelines allow skills to execute deterministic sequential tool chains directly on the worker thread without scheduling a Task or making model LLM calls.\n\n## Configuration Syntax\n\nPipelines are declared in `SKILL.md` frontmatter under `metadata.execution`:\n\n```yaml\n---\nname: sample-pipeline\ndescription: Run a deterministic tool chain.\nuser-invocable: true\nmetadata:\n allowed-tools: javascript show_toast\n execution:\n type: tools\n suppressToast: true\n suppressOutput: true\n tools:\n - name: javascript\n input:\n code: \"Math.floor(Math.random() * 100) + 1\"\n - name: show_toast\n input:\n title: \"Random Number\"\n message:\n $pipe: prev\n---\n```\n\n## Data Piping (`$pipe`)\n\nInputs in tool step configurations can reference outputs from previous steps using the `$pipe` operator:\n\n- `{ \"$pipe\": \"prev\" }` or `{ \"$pipe\": -1 }`: Resolves to the return output of the immediately preceding tool step.\n- `{ \"$pipe\": 0 }`: Resolves to the return output of step index `0` (0-indexed).\n- `{ \"$pipe\": \"javascript\" }`: Resolves to the return output of the last step that ran the `javascript` tool.\n\n## Execution Suppression\n\n- `suppressToast: true`: Suppresses step progress toasts (\"Running skill tool...\") during pipeline execution.\n- `suppressOutput: true`: Suppresses raw tool result blocks from being rendered in the chat thread.\n- Setting suppression options at the `execution` root cascades down to all steps unless explicitly overridden per tool step.\n"},{"displayPath":"skill-creator\u002freferences\u002fdeclarative-tools.md","content":"# Declarative Tools\n\nDeclarative tools allow workspace authors to define reusable custom tools using JSON definitions placed under `.agents\u002ftools\u002f\u003cgroup\u003e\u002f\u003ctool-name\u003e.json`.\n\n## Directory Structure\n\n```text\n.agents\u002ftools\u002f\n└── main\u002f\n └── generate_random_number.json\n```\n\n## Schema Format\n\n```json\n{\n \"name\": \"generate_random_number\",\n \"description\": \"Generate a random integer within a specified range.\",\n \"executor\": \"javascript\",\n \"inputSchema\": {\n \"type\": \"object\",\n \"properties\": {\n \"min\": { \"type\": \"number\", \"default\": 1 },\n \"max\": { \"type\": \"number\", \"default\": 1000000 }\n }\n },\n \"code\": \"const min = Number(inputs.min ?? 1); const max = Number(inputs.max ?? 1000000); return Math.floor(Math.random() * (max - min + 1)) + min;\"\n}\n```\n\n## Features\n\n- **Automatic Discovery**: Automatically loaded from `.agents\u002ftools\u002f` across conversation workspaces.\n- **WebMCP Integration**: Registered with the browser ModelContext API for both manual pinning and automated agent execution.\n- **Expression Evaluation**: Code expressions automatically evaluate and return results without needing explicit wrapper boilerplate.\n"},{"displayPath":"skill-creator\u002freferences\u002ffrontmatter-spec.md","content":"# Frontmatter Specification\n\nAgent skills in ShadowClaw are configured via YAML frontmatter at the top of `SKILL.md`. Frontmatter attributes adhere strictly to the standard Agent Skills specification.\n\n## Specification Schema\n\n```yaml\n---\nname: skill-name\ndescription: \"Clear, concise model-facing trigger description.\"\nuser-invocable: true\ndisable-model-invocation: false\nargument-hint: \"[arguments]\"\nmetadata:\n allowed-tools: read_file write_file javascript\ncompatibility: ShadowClaw\nlicense: MIT\n---\n```\n\n\u003e **Quoting Rule**: Always enclose `description` in double quotes (`\"...\"`) or use a YAML folded block scalar (`\u003e`). Descriptions often contain URLs (`https:\u002f\u002f`), colons (`trigger:` or `en:`), quotes, or parentheses that break unquoted YAML frontmatter.\n\n## Attribute Reference\n\n| Attribute | Type | Required | Description |\n| :------------------------- | :-------- | :------- | :------------------------------------------------------------------------------------------------------------------------ |\n| `name` | `string` | **Yes** | Skill identifier (1–64 lowercase alphanumeric characters and single hyphens). |\n| `description` | `string` | **Yes** | Model-facing description used for skill discovery and activation (max 1024 characters). **Always wrap in double quotes.** |\n| `user-invocable` | `boolean` | No | When `true` (default), allows users to invoke the skill directly via slash commands (e.g. `\u002fskill-name`). |\n| `disable-model-invocation` | `boolean` | No | When `true`, hides the skill from model discovery so it is only triggered via slash command. |\n| `argument-hint` | `string` | No | Display placeholder in the UI search\u002fautocomplete menu when typing slash commands. |\n| `metadata` | `object` | No | Key-value dictionary for custom metadata, tool permissions (`allowed-tools` string or list), and `execution` pipelines. |\n| `compatibility` | `string` | No | Platform compatibility requirements or version strings. |\n| `license` | `string` | No | Open-source software license string (e.g. `MIT`, `AGPL-3.0`). |\n\n## Metadata Attributes (`metadata`)\n\nCustom configuration properties and extension specifications (like declarative execution pipelines) that fall outside the standard Agent Skills frontmatter attributes should be placed inside `metadata`:\n\n```yaml\nmetadata:\n allowed-tools: javascript show_toast generate_random_number\n author: ShadowClaw Team\n version: 1.0.0\n execution:\n type: tools\n suppressToast: true\n tools:\n - name: javascript\n input:\n code: Math.floor(Math.random() * 100) + 1\n```\n"},{"displayPath":"skill-creator\u002fSKILL.md","content":"---\nname: skill-creator\ndescription: Create, edit, review, and validate ShadowClaw declarative skills and their supporting resources.\nuser-invocable: true\nmetadata:\n allowed-tools: read_file write_file javascript create_directory\n---\n\n# ShadowClaw Skill Creator\n\nUse this skill when creating, modifying, reviewing, or validating a ShadowClaw agent skill or declarative tool pipeline.\n\n## Workspace Layout Standards\n\n- **Skills**: Create each skill in its dedicated directory under `.agents\u002fskills\u002f\u003cgroup\u003e\u002f\u003cskill-name\u003e\u002fSKILL.md` (default group: `main`).\n- **Declarative Tools**: Define supporting declarative tools under `.agents\u002ftools\u002f\u003cgroup\u003e\u002f\u003ctool-name\u003e.json` (default group: `main`).\n- **Supporting Resources**: Co-locate skill-specific assets (reference documents, templates, helper scripts) inside the skill directory alongside `SKILL.md`.\n\n## Workflow\n\n1. **Establish Contract & Scope**\n - For existing skills, read `SKILL.md` and related resources before editing.\n - For new skills, define the trigger prompt, intended execution outcome, required tools, and output artifacts.\n2. **Configure Frontmatter**\n - Provide a clear, concise trigger description in `description` (1024 characters max).\n - **Always enclose `description` in double quotes** (`description: \"...\"`) or use a YAML block scalar (`\u003e`). Colons (`:`), URLs, and trigger phrases inside unquoted YAML break parsing.\n - Set `user-invocable: true` if the skill should be triggerable via slash command (e.g. `\u002fskill-name`).\n - Use `disable-model-invocation: true` for skills intended strictly for slash-command execution.\n - Place non-standard configuration (such as `allowed-tools`) within the standard `metadata` block to maintain Agent Skills specification compliance. Specify tools as a space-separated string or a list.\n3. **Structure & Draft Content**\n - Write instructions in `SKILL.md` using clear, modular procedures.\n - Place deterministic operations in `javascript` tool calls; use `read_file` and `write_file` for workspace persistence.\n - Create required target directories via `create_directory` prior to writing files.\n4. **Declarative Pipelines (`execution.type: tools`)**\n - Define sequential tool pipelines in frontmatter via `execution: { type: \"tools\", tools: [...] }`.\n - Pass outputs between steps using `{ \"$pipe\": \"prev\" }` or step\u002ftool identifiers.\n - Optionally apply `suppressToast: true` or `suppressOutput: true` at the execution root or per step to suppress notifications and output blocks.\n5. **Verify & Validate**\n - Re-read the saved `SKILL.md` and verify valid YAML frontmatter syntax (ensure `description` is enclosed in double quotes).\n - Ensure the skill name uses 1–64 lowercase alphanumeric characters or hyphens and all referenced resource paths exist.\n"}]}</script>
4
4
  <script id="shadow-claw-static-routing" type="application/json">{"routes":{"\u002fpages\u002fmain\u002findex.html":{"prettyPath":"\u002fmain\u002f"},"\u002fpages\u002fmain\u002f~\u002fdocs\u002fpublishing-to-github-pages.md":{"prettyPath":"\u002fdocs\u002fpublishing\u002f"},"\u002fpages\u002fmain\u002f~\u002fdocs\u002fskill-creator.md":{"prettyPath":"\u002fdocs\u002fskill-creator\u002f"},"\u002fpages\u002fmain\u002f~\u002fdocs\u002fexample\u002farticle.html":{"prettyPath":"\u002fdocs\u002fexample\u002farticle\u002f"},"\u002fpages\u002fmain\u002fMEMORY.md":{"prettyPath":"\u002fmain\u002fmemory\u002f"}}}</script>
5
5
  <link rel="modulepreload" href="index.js" />
6
6
  <link rel="modulepreload" href="custom-element-security-B2daIE5r.js" />
7
- <link rel="modulepreload" href="orchestrator-DBO4NZqd.js" />
8
- <link rel="modulepreload" href="e2e-bridge-Cz95DLlb.js" />
7
+ <link rel="modulepreload" href="orchestrator-Li1UAsv7.js" />
8
+ <link rel="modulepreload" href="e2e-bridge-lP2qqiv3.js" />
9
9
  <link rel="modulepreload" href="audio-C46WQ-9Q.js" />
10
10
  <link rel="modulepreload" href="constants-DiETpg52.js" />
11
- <link rel="modulepreload" href="shadow-claw-Br8mWDUx.js" />
11
+ <link rel="modulepreload" href="shadow-claw-Bg9AQ5x_.js" />
12
12
  <link rel="modulepreload" href="config-C16fFWtP.js" />
13
13
  <link rel="modulepreload" href="db-BUuJo1Gf.js" />
14
14
  <link rel="modulepreload" href="get-config-Bkvl__ZS.js" />
@@ -20,23 +20,23 @@
20
20
  <link rel="modulepreload" href="toast-CtIuHprH.js" />
21
21
  <link rel="modulepreload" href="parse-boolean-config-BigJ9U46.js" />
22
22
  <link rel="modulepreload" href="transformers-CQ9ss9rD.js" />
23
- <link rel="modulepreload" href="shadow-claw-pages-mpDOtNYj.js" />
24
- <link rel="modulepreload" href="shadow-claw-chat-BRwRlq-n.js" />
25
- <link rel="modulepreload" href="shadow-claw-conversations-CF_yUfKl.js" />
26
- <link rel="modulepreload" href="shadow-claw-tasks-ChEp1j7x.js" />
27
- <link rel="modulepreload" href="shadow-claw-files-L6_ioyzh.js" />
28
- <link rel="modulepreload" href="shadow-claw-settings-CfFTYTEy.js" />
29
- <link rel="modulepreload" href="shadow-claw-tools-BYjUBiJz.js" />
30
- <link rel="modulepreload" href="shadow-claw-channels-088vhuWO.js" />
31
- <link rel="modulepreload" href="shadow-claw-terminal-BaoVbOda.js" />
32
- <link rel="modulepreload" href="shadow-claw-file-viewer-DWCejuY3.js" />
33
- <link rel="modulepreload" href="shadow-claw-pdf-viewer-DZ_84qJH.js" />
34
- <link rel="modulepreload" href="orchestrator-Dyylc8IU.js" />
23
+ <link rel="modulepreload" href="shadow-claw-pages-D_oPyDca.js" />
24
+ <link rel="modulepreload" href="shadow-claw-chat-N5jMsXZZ.js" />
25
+ <link rel="modulepreload" href="shadow-claw-conversations-wAR06_ya.js" />
26
+ <link rel="modulepreload" href="shadow-claw-tasks-BdP7lmvu.js" />
27
+ <link rel="modulepreload" href="shadow-claw-files-CnvkCbd4.js" />
28
+ <link rel="modulepreload" href="shadow-claw-settings-DkUhvxVr.js" />
29
+ <link rel="modulepreload" href="shadow-claw-tools-BwwY53Lr.js" />
30
+ <link rel="modulepreload" href="shadow-claw-channels-BiSfLvWv.js" />
31
+ <link rel="modulepreload" href="shadow-claw-terminal-DVHX7Fsu.js" />
32
+ <link rel="modulepreload" href="shadow-claw-file-viewer-sZN_FCDW.js" />
33
+ <link rel="modulepreload" href="shadow-claw-pdf-viewer-CrU4wqRq.js" />
34
+ <link rel="modulepreload" href="orchestrator-C1kaTltu.js" />
35
35
  <link rel="modulepreload" href="shadow-claw-dialog-BVGf_c3S.js" />
36
- <link rel="modulepreload" href="shadow-claw-toast-e8oz7z6Z.js" />
37
- <link rel="modulepreload" href="process-peer-query-param-s-aSP1Rq.js" />
38
- <link rel="modulepreload" href="process-room-query-param-B2Qe0F0M.js" />
39
- <link rel="modulepreload" href="process-pending-shared-payloads-BN3GigPT.js" />
36
+ <link rel="modulepreload" href="shadow-claw-toast-B9Y9tSkW.js" />
37
+ <link rel="modulepreload" href="process-peer-query-param-DQIgr3KL.js" />
38
+ <link rel="modulepreload" href="process-room-query-param-F-XnIVoZ.js" />
39
+ <link rel="modulepreload" href="process-pending-shared-payloads-Ctb-TFqB.js" />
40
40
  <link rel="modulepreload" href="memory-storage-2m7KZ-aP.js" />
41
41
  <link rel="modulepreload" href="init-chat-split-resize-C8AqCCiK.js" />
42
42
  </head><body> <shadow-claw data-prerender-no-seed="true">
@@ -56,4 +56,4 @@
56
56
  <h1 class="header-title">ShadowClaw</h1>
57
57
  </a> <a aria-label="Shadow Claw Project on GitHub" class="header-actions-logo-link" href="https://github.com/xt-ml/shadow-claw" slot="header-actions-logo"> <svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" viewBox="0 0 496 512"><path fill="var(--shadow-claw-bg-primary-reverse, currentColor)" d="M165.9 397.4c0 2-2.3 3.6-5.2 3.6-3.3.3-5.6-1.3-5.6-3.6 0-2 2.3-3.6 5.2-3.6 3-.3 5.6 1.3 5.6 3.6m-31.1-4.5c-.7 2 1.3 4.3 4.3 4.9 2.6 1 5.6 0 6.2-2s-1.3-4.3-4.3-5.2c-2.6-.7-5.5.3-6.2 2.3m44.2-1.7c-2.9.7-4.9 2.6-4.6 4.9.3 2 2.9 3.3 5.9 2.6 2.9-.7 4.9-2.6 4.6-4.6-.3-1.9-3-3.2-5.9-2.9M244.8 8C106.1 8 0 113.3 0 252c0 110.9 69.8 205.8 169.5 239.2 12.8 2.3 17.3-5.6 17.3-12.1 0-6.2-.3-40.4-.3-61.4 0 0-70 15-84.7-29.8 0 0-11.4-29.1-27.8-36.6 0 0-22.9-15.7 1.6-15.4 0 0 24.9 2 38.6 25.8 21.9 38.6 58.6 27.5 72.9 20.9 2.3-16 8.8-27.1 16-33.7-55.9-6.2-112.3-14.3-112.3-110.5 0-27.5 7.6-41.3 23.6-58.9-2.6-6.5-11.1-33.3 2.6-67.9 20.9-6.5 69 27 69 27 20-5.6 41.5-8.5 62.8-8.5s42.8 2.9 62.8 8.5c0 0 48.1-33.6 69-27 13.7 34.7 5.2 61.4 2.6 67.9 16 17.7 25.8 31.5 25.8 58.9 0 96.5-58.9 104.2-114.8 110.5 9.2 7.9 17 22.9 17 46.4 0 33.7-.3 75.4-.3 83.6 0 6.5 4.6 14.4 17.3 12.1C428.2 457.8 496 362.9 496 252 496 113.3 383.5 8 244.8 8"/></svg> </a> <noscript> <div style="line-height:1.6;margin:0 auto;max-width:50rem;padding:2rem"> <h2>Multi-Runtime AI Assistant</h2> <p> ShadowClaw is an open-source, multi-runtime AI assistant designed for autonomous orchestration, client-side tool execution, and private local storage via Origin Private File System (OPFS) and IndexedDB. </p> <h3>Agent & Developer Resources</h3> <ul> <li><a href="llms.txt">llms.txt (Agent Context & Guidance)</a></li> <li> <a href=".well-known/mcp.json">MCP Server Card (SEP-2127)</a> </li> <li> <a href=".well-known/ai-catalog.json">AI Catalog Discovery</a> </li> <li> <a href=".well-known/mcp/servers.json">MCP Servers Manifest</a> </li> <li><a href="sitemap.xml">XML Sitemap</a></li> <li> <a href="https://github.com/xt-ml/shadow-claw">GitHub Repository</a> </li> </ul> </div> </noscript>
58
58
  </shadow-claw> <script type="module" src="index.js"></script> <script type="module">try{self[`workbox:window:7.4.0`]&&_()}catch{}function e(e,t){return new Promise((function(n){var r=new MessageChannel;r.port1.onmessage=function(e){n(e.data)},e.postMessage(t,[r.port2])}))}function t(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 n(e,t,n){return t&&function(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,`value`in r&&(r.writable=!0),Object.defineProperty(e,a(r.key),r)}}(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function r(e,n){var r=typeof Symbol<`u`&&e[Symbol.iterator]||e[`@@iterator`];if(r)return(r=r.call(e)).next.bind(r);if(Array.isArray(e)||(r=function(e,n){if(e){if(typeof e==`string`)return t(e,n);var r={}.toString.call(e).slice(8,-1);return r===`Object`&&e.constructor&&(r=e.constructor.name),r===`Map`||r===`Set`?Array.from(e):r===`Arguments`||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?t(e,n):void 0}}(e))||n){r&&(e=r);var i=0;return function(){return i>=e.length?{done:!0}:{done:!1,value:e[i++]}}}throw TypeError(`Invalid attempt to iterate non-iterable instance.
59
- In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function i(e,t){return i=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},i(e,t)}function a(e){var t=function(e,t){if(typeof e!=`object`||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!=`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return String(e)}(e,`string`);return typeof t==`symbol`?t:t+``}try{self[`workbox:core:7.4.0`]&&_()}catch{}var o=function(){var e=this;this.promise=new Promise((function(t,n){e.resolve=t,e.reject=n}))};function s(e,t){var n=location.href;return new URL(e,n).href===new URL(t,n).href}var c=function(e,t){this.type=e,Object.assign(this,t)};function l(e,t,n){return e&&e.then||(e=Promise.resolve(e)),t?e.then(t):e}function u(){}var d={type:`SKIP_WAITING`};function f(e,t){return e&&e.then?e.then(u):Promise.resolve()}var p=function(t){function r(e,n){var r,i;return n===void 0&&(n={}),(r=t.call(this)||this).nn={},r.tn=0,r.rn=new o,r.en=new o,r.on=new o,r.un=0,r.an=/* @__PURE__ */ new Set,r.cn=function(){var e=r.fn,t=e.installing;r.tn>0||!s(t.scriptURL,r.sn.toString())||performance.now()>r.un+6e4?(r.vn=t,e.removeEventListener(`updatefound`,r.cn)):(r.hn=t,r.an.add(t),r.rn.resolve(t)),++r.tn,t.addEventListener(`statechange`,r.ln)},r.ln=function(e){var t=r.fn,n=e.target,i=n.state,a=n===r.vn,o={sw:n,isExternal:a,originalEvent:e};!a&&r.mn&&(o.isUpdate=!0),r.dispatchEvent(new c(i,o)),i===`installed`?r.wn=self.setTimeout((function(){i===`installed`&&t.waiting===n&&r.dispatchEvent(new c(`waiting`,o))}),200):i===`activating`&&(clearTimeout(r.wn),a||r.en.resolve(n))},r.yn=function(e){var t=r.hn,n=t!==navigator.serviceWorker.controller;r.dispatchEvent(new c(`controlling`,{isExternal:n,originalEvent:e,sw:t,isUpdate:r.mn})),n||r.on.resolve(t)},r.gn=(i=function(e){var t=e.data,n=e.ports,i=e.source;return l(r.getSW(),(function(){r.an.has(i)&&r.dispatchEvent(new c(`message`,{data:t,originalEvent:e,ports:n,sw:i}))}))},function(){var e=[...arguments];try{return Promise.resolve(i.apply(this,e))}catch(e){return Promise.reject(e)}}),r.sn=e,r.nn=n,navigator.serviceWorker.addEventListener(`message`,r.gn),r}var a,u=t;(a=r).prototype=Object.create(u.prototype),a.prototype.constructor=a,i(a,u);var p=r.prototype;return p.register=function(e){var t=(e===void 0?{}:e).immediate,n=t!==void 0&&t;try{var r=this;return l(function(e,t){var n=e();return n&&n.then?n.then(t):t(n)}((function(){if(!n&&document.readyState!==`complete`)return f(new Promise((function(e){return window.addEventListener(`load`,e)})))}),(function(){return r.mn=!!navigator.serviceWorker.controller,r.dn=r.pn(),l(r.bn(),(function(e){r.fn=e,r.dn&&(r.hn=r.dn,r.en.resolve(r.dn),r.on.resolve(r.dn),r.dn.addEventListener(`statechange`,r.ln,{once:!0}));var t=r.fn.waiting;return t&&s(t.scriptURL,r.sn.toString())&&(r.hn=t,Promise.resolve().then((function(){r.dispatchEvent(new c(`waiting`,{sw:t,wasWaitingBeforeRegister:!0}))})).then((function(){}))),r.hn&&(r.rn.resolve(r.hn),r.an.add(r.hn)),r.fn.addEventListener(`updatefound`,r.cn),navigator.serviceWorker.addEventListener(`controllerchange`,r.yn),r.fn}))})))}catch(e){return Promise.reject(e)}},p.update=function(){try{return this.fn?l(f(this.fn.update())):l()}catch(e){return Promise.reject(e)}},p.getSW=function(){return this.hn===void 0?this.rn.promise:Promise.resolve(this.hn)},p.messageSW=function(t){try{return l(this.getSW(),(function(n){return e(n,t)}))}catch(e){return Promise.reject(e)}},p.messageSkipWaiting=function(){this.fn&&this.fn.waiting&&e(this.fn.waiting,d)},p.pn=function(){var e=navigator.serviceWorker.controller;return e&&s(e.scriptURL,this.sn.toString())?e:void 0},p.bn=function(){try{var e=this;return l(function(e,t){try{var n=e()}catch(e){return t(e)}return n&&n.then?n.then(void 0,t):n}((function(){return l(navigator.serviceWorker.register(e.sn,e.nn),(function(t){return e.un=performance.now(),t}))}),(function(e){throw e})))}catch(e){return Promise.reject(e)}},n(r,[{key:`active`,get:function(){return this.en.promise}},{key:`controlling`,get:function(){return this.on.promise}}])}(function(){function e(){this.Pn=/* @__PURE__ */ new Map}var t=e.prototype;return t.addEventListener=function(e,t){this.jn(e).add(t)},t.removeEventListener=function(e,t){this.jn(e).delete(t)},t.dispatchEvent=function(e){e.target=this;for(var t,n=r(this.jn(e.type));!(t=n()).done;)(0,t.value)(e)},t.jn=function(e){return this.Pn.has(e)||this.Pn.set(e,/* @__PURE__ */ new Set),this.Pn.get(e)},e}());const m=`__shadowClawDefaultTrustedTypesPolicyState`,h=`default`,g=`shadowclaw-sandbox`;function v(){let e=globalThis;return e[m]||(e[m]={initialized:!1,policy:null}),e[m]}function y(){let e=v();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(h);if(n){e.policy=n;return}}let n=!1;if(typeof t.getPolicyNames==`function`){let e=t.getPolicyNames();Array.isArray(e)&&e.includes(h)&&(n=!0)}if(n){if(typeof t.getPolicy==`function`){let n=t.getPolicy(g);if(n){e.policy=n;return}}e.policy=t.createPolicy(g,{createHTML:e=>e,createScriptURL:e=>e});return}e.policy=t.createPolicy(h,{createHTML:e=>e,createScriptURL:e=>e})}catch{typeof t.getPolicy==`function`&&(e.policy=t.getPolicy(h)??t.getPolicy(g)??null)}}}function b(e){y();let t=v().policy;return!t||typeof t.createScriptURL!=`function`?e:t.createScriptURL(e)}const x=`shadowclaw-oac-reload-attempted`,S=`shadowclaw-sw-update-intent`,C=3e4,w=`shadowclaw-sw-update-failure`;let T=!1,E=null;async function D(e=5e3){let t=Date.now();for(;Date.now()-t<e;){let e=document.querySelector(`shadow-claw`);if(e&&typeof e.requestDialog==`function`)return e;await new Promise(e=>{globalThis.setTimeout(e,50)})}return null}async function O(){let e=await D();return e?.requestDialog?await e.requestDialog({title:`Update Available`,message:`A new version of ShadowClaw is ready. Reload now to apply the update?`,confirmLabel:`Reload now`,cancelLabel:`Later`}):!1}async function k(){let e=await D();e?.requestDialog&&await e.requestDialog({title:`Update Failed`,message:`The app update failed to install automatically. Please try restarting your browser to complete the update.`,confirmLabel:`OK`}),console.warn(`[ShadowClaw] Service worker update failed. Please restart your browser to complete the update.`)}function A(){try{let e=globalThis.sessionStorage?.getItem(S);if(!e)return null;let t=JSON.parse(e);return typeof t.startedAt!=`number`||typeof t.fallbackReloadAttempts!=`number`?null:{startedAt:t.startedAt,fallbackReloadAttempts:t.fallbackReloadAttempts}}catch{return null}}function j(e){try{globalThis.sessionStorage?.setItem(S,JSON.stringify(e))}catch{}}function M(){try{globalThis.sessionStorage?.removeItem(S)}catch{}}function N(){let e=A();return e?Date.now()-e.startedAt<=C||(M(),!1):!1}function P(){L(),j({startedAt:Date.now(),fallbackReloadAttempts:0})}function F(){try{let e=globalThis.sessionStorage?.getItem(w);if(!e)return null;let t=JSON.parse(e);return typeof t.failedAt==`number`?{failedAt:t.failedAt}:null}catch{return null}}function I(e){try{globalThis.sessionStorage?.setItem(w,JSON.stringify(e))}catch{}}function L(){try{globalThis.sessionStorage?.removeItem(w)}catch{}}function R(){let e=F();return e?Date.now()-e.failedAt<=3e5||(L(),!1):!1}function z(){M(),I({failedAt:Date.now()})}function B(){if(T)return;T=!0,E!==null&&(globalThis.clearTimeout(E),E=null);let e=globalThis.location;typeof e?.reload==`function`&&e.reload()}async function V(){if(T||E!==null)return;let e=A();e&&(Date.now()-e.startedAt>C?M():e.fallbackReloadAttempts>=2?(z(),await k()):(j({...e,fallbackReloadAttempts:e.fallbackReloadAttempts+1}),E=globalThis.setTimeout(()=>{B()},3e3)))}async function H(e){e.messageSkipWaiting(),await V()}function U(){return N()}function W(){if(globalThis.originAgentCluster!==!1)return!1;let e=globalThis.location?.protocol;if(e!==`http:`&&e!==`https:`)return!1;try{return!globalThis.sessionStorage?.getItem(x)}catch{return!1}}function G(){try{globalThis.sessionStorage?.setItem(x,`1`)}catch{return}B()}function K(){let e=U();M(),L(),e?B():W()&&G()}try{if(typeof navigator<`u`&&`serviceWorker`in navigator&&navigator.serviceWorker){y();let e=new p(b(`service-worker.js`));e.addEventListener(`waiting`,async()=>{R()||(N()?await H(e):await O()&&(P(),await H(e)))}),e.addEventListener(`controlling`,()=>{K()}),navigator.serviceWorker.addEventListener(`controllerchange`,()=>{K()});let t=()=>{globalThis.setTimeout(()=>{e.register()},1e4)};document.readyState===`complete`?t():globalThis.addEventListener(`load`,t)}}catch{}export{B as reloadCurrentPage,U as shouldReloadAfterControllerChange,W as shouldReloadForOriginAgentCluster};</script> </body></html>
59
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function i(e,t){return i=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},i(e,t)}function a(e){var t=function(e,t){if(typeof e!=`object`||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!=`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return String(e)}(e,`string`);return typeof t==`symbol`?t:t+``}try{self[`workbox:core:7.4.0`]&&_()}catch{}var o=function(){var e=this;this.promise=new Promise((function(t,n){e.resolve=t,e.reject=n}))};function s(e,t){var n=location.href;return new URL(e,n).href===new URL(t,n).href}var c=function(e,t){this.type=e,Object.assign(this,t)};function l(e,t,n){return e&&e.then||(e=Promise.resolve(e)),t?e.then(t):e}function u(){}var d={type:`SKIP_WAITING`};function f(e,t){return e&&e.then?e.then(u):Promise.resolve()}var p=function(t){function r(e,n){var r,i;return n===void 0&&(n={}),(r=t.call(this)||this).nn={},r.tn=0,r.rn=new o,r.en=new o,r.on=new o,r.un=0,r.an=/* @__PURE__ */ new Set,r.cn=function(){var e=r.fn,t=e.installing;r.tn>0||!s(t.scriptURL,r.sn.toString())||performance.now()>r.un+6e4?(r.vn=t,e.removeEventListener(`updatefound`,r.cn)):(r.hn=t,r.an.add(t),r.rn.resolve(t)),++r.tn,t.addEventListener(`statechange`,r.ln)},r.ln=function(e){var t=r.fn,n=e.target,i=n.state,a=n===r.vn,o={sw:n,isExternal:a,originalEvent:e};!a&&r.mn&&(o.isUpdate=!0),r.dispatchEvent(new c(i,o)),i===`installed`?r.wn=self.setTimeout((function(){i===`installed`&&t.waiting===n&&r.dispatchEvent(new c(`waiting`,o))}),200):i===`activating`&&(clearTimeout(r.wn),a||r.en.resolve(n))},r.yn=function(e){var t=r.hn,n=t!==navigator.serviceWorker.controller;r.dispatchEvent(new c(`controlling`,{isExternal:n,originalEvent:e,sw:t,isUpdate:r.mn})),n||r.on.resolve(t)},r.gn=(i=function(e){var t=e.data,n=e.ports,i=e.source;return l(r.getSW(),(function(){r.an.has(i)&&r.dispatchEvent(new c(`message`,{data:t,originalEvent:e,ports:n,sw:i}))}))},function(){var e=[...arguments];try{return Promise.resolve(i.apply(this,e))}catch(e){return Promise.reject(e)}}),r.sn=e,r.nn=n,navigator.serviceWorker.addEventListener(`message`,r.gn),r}var a,u=t;(a=r).prototype=Object.create(u.prototype),a.prototype.constructor=a,i(a,u);var p=r.prototype;return p.register=function(e){var t=(e===void 0?{}:e).immediate,n=t!==void 0&&t;try{var r=this;return l(function(e,t){var n=e();return n&&n.then?n.then(t):t(n)}((function(){if(!n&&document.readyState!==`complete`)return f(new Promise((function(e){return window.addEventListener(`load`,e)})))}),(function(){return r.mn=!!navigator.serviceWorker.controller,r.dn=r.pn(),l(r.bn(),(function(e){r.fn=e,r.dn&&(r.hn=r.dn,r.en.resolve(r.dn),r.on.resolve(r.dn),r.dn.addEventListener(`statechange`,r.ln,{once:!0}));var t=r.fn.waiting;return t&&s(t.scriptURL,r.sn.toString())&&(r.hn=t,Promise.resolve().then((function(){r.dispatchEvent(new c(`waiting`,{sw:t,wasWaitingBeforeRegister:!0}))})).then((function(){}))),r.hn&&(r.rn.resolve(r.hn),r.an.add(r.hn)),r.fn.addEventListener(`updatefound`,r.cn),navigator.serviceWorker.addEventListener(`controllerchange`,r.yn),r.fn}))})))}catch(e){return Promise.reject(e)}},p.update=function(){try{return this.fn?l(f(this.fn.update())):l()}catch(e){return Promise.reject(e)}},p.getSW=function(){return this.hn===void 0?this.rn.promise:Promise.resolve(this.hn)},p.messageSW=function(t){try{return l(this.getSW(),(function(n){return e(n,t)}))}catch(e){return Promise.reject(e)}},p.messageSkipWaiting=function(){this.fn&&this.fn.waiting&&e(this.fn.waiting,d)},p.pn=function(){var e=navigator.serviceWorker.controller;return e&&s(e.scriptURL,this.sn.toString())?e:void 0},p.bn=function(){try{var e=this;return l(function(e,t){try{var n=e()}catch(e){return t(e)}return n&&n.then?n.then(void 0,t):n}((function(){return l(navigator.serviceWorker.register(e.sn,e.nn),(function(t){return e.un=performance.now(),t}))}),(function(e){throw e})))}catch(e){return Promise.reject(e)}},n(r,[{key:`active`,get:function(){return this.en.promise}},{key:`controlling`,get:function(){return this.on.promise}}])}(function(){function e(){this.Pn=/* @__PURE__ */ new Map}var t=e.prototype;return t.addEventListener=function(e,t){this.jn(e).add(t)},t.removeEventListener=function(e,t){this.jn(e).delete(t)},t.dispatchEvent=function(e){e.target=this;for(var t,n=r(this.jn(e.type));!(t=n()).done;)(0,t.value)(e)},t.jn=function(e){return this.Pn.has(e)||this.Pn.set(e,/* @__PURE__ */ new Set),this.Pn.get(e)},e}());const m=`__shadowClawDefaultTrustedTypesPolicyState`,h=`default`,g=`shadowclaw-sandbox`;function v(){let e=globalThis;return e[m]||(e[m]={initialized:!1,policy:null}),e[m]}function y(){let e=v();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(h);if(n){e.policy=n;return}}let n=!1;if(typeof t.getPolicyNames==`function`){let e=t.getPolicyNames();Array.isArray(e)&&e.includes(h)&&(n=!0)}if(n){if(typeof t.getPolicy==`function`){let n=t.getPolicy(g);if(n){e.policy=n;return}}e.policy=t.createPolicy(g,{createHTML:e=>e,createScriptURL:e=>e});return}e.policy=t.createPolicy(h,{createHTML:e=>e,createScriptURL:e=>e})}catch{typeof t.getPolicy==`function`&&(e.policy=t.getPolicy(h)??t.getPolicy(g)??null)}}}function b(e){y();let t=v().policy;return!t||typeof t.createScriptURL!=`function`?e:t.createScriptURL(e)}const x=`shadowclaw-oac-reload-attempted`,S=`shadowclaw-sw-update-intent`,C=3e4,w=`shadowclaw-sw-update-failure`;let T=!1,E=!1,D=!1,O=0,k=0,A=!1,j=!1,M=null;async function N(e=5e3){let t=Date.now();for(;Date.now()-t<e;){let e=document.querySelector(`shadow-claw`);if(e&&typeof e.requestDialog==`function`)return e;await new Promise(e=>{globalThis.setTimeout(e,50)})}return null}async function P(){let e=await N();return e?.requestDialog?await e.requestDialog({title:`Update Available`,message:`A new version of ShadowClaw is ready. Reload now to apply the update?`,confirmLabel:`Reload now`,cancelLabel:`Later`}):null}async function F(){let e=await N();e?.requestDialog&&await e.requestDialog({title:`Update Failed`,message:`The app update failed to install automatically. Please try restarting your browser to complete the update.`,confirmLabel:`OK`}),console.warn(`[ShadowClaw] Service worker update failed. Please restart your browser to complete the update.`)}function I(){try{let e=globalThis.sessionStorage?.getItem(S);if(!e)return null;let t=JSON.parse(e);return typeof t.startedAt!=`number`||typeof t.fallbackReloadAttempts!=`number`?null:{startedAt:t.startedAt,fallbackReloadAttempts:t.fallbackReloadAttempts}}catch{return null}}function L(e){try{globalThis.sessionStorage?.setItem(S,JSON.stringify(e))}catch{}}function R(){try{globalThis.sessionStorage?.removeItem(S)}catch{}}function z(){let e=I();return e?Date.now()-e.startedAt<=C||(R(),!1):!1}function B(){U(),L({startedAt:Date.now(),fallbackReloadAttempts:0})}function V(){try{let e=globalThis.sessionStorage?.getItem(w);if(!e)return null;let t=JSON.parse(e);return typeof t.failedAt==`number`?{failedAt:t.failedAt}:null}catch{return null}}function H(e){try{globalThis.sessionStorage?.setItem(w,JSON.stringify(e))}catch{}}function U(){try{globalThis.sessionStorage?.removeItem(w)}catch{}}function W(){let e=V();return e?Date.now()-e.failedAt<=3e5||(U(),!1):!1}function G(){R(),H({failedAt:Date.now()})}function K(){if(T)return;T=!0,M!==null&&(globalThis.clearTimeout(M),M=null);let e=globalThis.location;typeof e?.reload==`function`&&e.reload()}async function q(){if(T||M!==null)return;let e=I();e&&(Date.now()-e.startedAt>C?R():e.fallbackReloadAttempts>=2?(G(),await F()):(L({...e,fallbackReloadAttempts:e.fallbackReloadAttempts+1}),M=globalThis.setTimeout(()=>{K()},3e3)))}async function J(e){e.messageSkipWaiting(),await q()}function Y(){return z()}function X(){if(globalThis.originAgentCluster!==!1)return!1;let e=globalThis.location?.protocol;if(e!==`http:`&&e!==`https:`)return!1;try{return!globalThis.sessionStorage?.getItem(x)}catch{return!1}}function ee(){try{globalThis.sessionStorage?.setItem(x,`1`)}catch{return}K()}function Z(){let e=Y();R(),U(),e?K():j?te():X()&&ee()}async function te(){if(!(A||T)){A=!0;try{await(await N())?.requestDialog?.({title:`Update Installed`,message:`A new version of ShadowClaw was installed. Reload now to use it?`,confirmLabel:`Reload now`,cancelLabel:`Later`})&&K()}finally{A=!1}}}async function Q(e){if(!(!E||D||Date.now()<O)&&!W()){if(z())await J(e);else{D=!0;try{let t=await P();if(t===null)return;t?(B(),await J(e)):O=Date.now()+9e5}finally{D=!1}}}}async function $(e,t){if(!(t&&Date.now()-k<3e4)){k=Date.now();try{await e.update()}catch{}await Q(e)}}function ne(e){globalThis.setInterval(()=>$(e,!1),36e5),globalThis.addEventListener(`focus`,()=>$(e,!0)),document.addEventListener(`visibilitychange`,async()=>{document.visibilityState===`visible`&&await $(e,!0)})}try{if(typeof navigator<`u`&&`serviceWorker`in navigator&&navigator.serviceWorker){y();let e=new p(b(`service-worker.js`),{updateViaCache:`none`});j=!!navigator.serviceWorker.controller,e.addEventListener(`waiting`,async()=>{E=!0,await Q(e)}),e.addEventListener(`controlling`,()=>{Z()}),navigator.serviceWorker.addEventListener(`controllerchange`,()=>{Z()});let t=()=>{globalThis.setTimeout(()=>{e.register(),ne(e)},1e4)};document.readyState===`complete`?t():globalThis.addEventListener(`load`,t)}}catch{}export{K as reloadCurrentPage,Y as shouldReloadAfterControllerChange,X as shouldReloadForOriginAgentCluster};</script> </body></html>
@@ -1 +1 @@
1
- import{C as e,S as t}from"./custom-element-security-B2daIE5r.js";import{t as n}from"./orchestrator-DBO4NZqd.js";import{n as r,t as i}from"./e2e-bridge-Cz95DLlb.js";import{n as a}from"./audio-C46WQ-9Q.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 a=e.querySelector(`shadow-claw`)||e.body.appendChild(e.createElement(`shadow-claw`));if(console.log(`✅ ShadowClaw initialized successfully`),t=!1,r()&&(console.log(`🧪 E2E Test Bridge enabled`),i(n,a)),await n.whenReady,typeof window<`u`&&typeof a.orchestrator?.ensureAllConnections==`function`)try{await a.orchestrator.ensureAllConnections({force:!1})}catch(e){console.warn(`[App] Failed to ensure connections on initialize:`,e)}return{orchestrator:a.orchestrator,isInitializing:t}}catch(e){throw console.error(`❌ Failed to initialize ShadowClaw:`,e),e}}}async function s(){await import(`./shadow-claw-Br8mWDUx.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,a,{once:!0})});
1
+ import{C as e,S as t}from"./custom-element-security-B2daIE5r.js";import{t as n}from"./orchestrator-Li1UAsv7.js";import{n as r,t as i}from"./e2e-bridge-lP2qqiv3.js";import{n as a}from"./audio-C46WQ-9Q.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 a=e.querySelector(`shadow-claw`)||e.body.appendChild(e.createElement(`shadow-claw`));if(console.log(`✅ ShadowClaw initialized successfully`),t=!1,r()&&(console.log(`🧪 E2E Test Bridge enabled`),i(n,a)),await n.whenReady,typeof window<`u`&&typeof a.orchestrator?.ensureAllConnections==`function`)try{await a.orchestrator.ensureAllConnections({force:!1})}catch(e){console.warn(`[App] Failed to ensure connections on initialize:`,e)}return{orchestrator:a.orchestrator,isInitializing:t}}catch(e){throw console.error(`❌ Failed to initialize ShadowClaw:`,e),e}}}async function s(){await import(`./shadow-claw-Bg9AQ5x_.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,a,{once:!0})});
@@ -1 +1 @@
1
- import{i as e}from"./rolldown-runtime-DBVvNlSN.js";import{t}from"./browser-B1SoUj6D.js";import{U as n,r}from"./config-C16fFWtP.js";import{n as i}from"./db-BUuJo1Gf.js";import{t as a}from"./ulid-BSJxYh6W.js";import{c as o,t as s}from"./tools-D-52Zmfc.js";var c=/* @__PURE__ */ e(t(),1),l=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){(c.default===void 0||!c.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 u(){if(typeof localStorage<`u`)try{let e=localStorage.getItem(r.CONTROL_PLANE_CLIENT_ID);if(e&&e.trim())return e.trim()}catch{}let e=n(),t=e?`${e}-${a().toLowerCase()}`:`client-${a().toLowerCase()}`;if(typeof localStorage<`u`)try{localStorage.setItem(r.CONTROL_PLANE_CLIENT_ID,t)}catch{}return t}async function d(e){if(typeof localStorage<`u`)try{let e=localStorage.getItem(r.CONTROL_PLANE_ENABLED);if(e!==null)return e===`true`||e===`1`}catch{}if(e)try{let{getConfig:t}=await import(`./get-config-Bkvl__ZS.js`).then(e=>e.n),n=await t(e,r.CONTROL_PLANE_ENABLED);if(n!=null)return n===`true`||n===`1`}catch{}return!1}function f(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 p(e){let t=``;if(typeof localStorage<`u`)try{t=(localStorage.getItem(r.CONTROL_PLANE_URL)||``).trim()}catch{}let n=e||(typeof location<`u`?location:null),i=n&&(n.protocol===`file:`||n.hostname&&(n.hostname.endsWith(`.github.io`)||n.hostname.endsWith(`.pages.dev`))),a=t;a||=i?`http://127.0.0.1:8888`:n&&n.host?`${n.protocol}//${n.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 m(){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 h(){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 g(){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 _=null;async function v(e,t={},n={}){let r=u(),a=h(),c=m();switch(e){case`send-message`:{if(!t.text)throw Error(`Missing text parameter`);let{orchestratorStore:e}=await import(`./orchestrator-DBO4NZqd.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 i(),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-DBO4NZqd.js`).then(e=>e.n),t=n.orchestrator||e.orchestrator;return{clientId:r,deviceLabel:a,capabilities:c,version:n.version||g(),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-DIUZjVF5.js`),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-DBO4NZqd.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-DIUZjVF5.js`);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-DIUZjVF5.js`);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-DBO4NZqd.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){if(!a.toolTags.includes(t.toolName))throw Error(`Tool '${t.toolName}' is not enabled in the active conversation (${i}).`)}else if(s?.allTools&&s.allTools.some(e=>e.name===t.toolName)&&s?.enabledToolNames&&s.enabledToolNames.size>0){let e=s.enabledToolNames.has(t.toolName),n=s.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-DIUZjVF5.js`);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-DBO4NZqd.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-DBO4NZqd.js`).then(e=>e.n),a=t.groupId||n.orchestrator?.activeGroupId||e.activeGroupId||`br:main`,o=await i(),{getGroupDir:s}=await import(`./get-group-dir-D--BiEyk.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:r,token:t.token,serverBaseUrl:p().httpUrl,fileEnumerator:()=>l(c),fileReader:e=>u(e)}).initiate()}default:throw Error(`Unknown action '${e}'`)}}function y(e={}){if(_){try{_.disconnect()}catch{}_=null}let t=e.clientId&&e.clientId.trim()||u(),n=m(),i=h(),a=e.version||g(),o=null;if(typeof localStorage<`u`)try{let e=localStorage.getItem(r.CONTROL_PLANE_TRANSPORT);(e===`sse`||e===`websocket`)&&(o=e)}catch{}let s=e.transport||o||`sse`,c;if(typeof localStorage<`u`)try{c=localStorage.getItem(r.PEERJS_MY_PEER_ID)||void 0}catch{}let{httpUrl:d,wsUrl:y}=p(),b=new l({clientId:t,deviceLabel:i,capabilities:n,version:a,peerId:c,transport:s,httpUrl:d,url:y,handlers:{"send-message":t=>v(`send-message`,t,e),"list-tasks":t=>v(`list-tasks`,t,e),"read-state":t=>v(`read-state`,t,e),"invoke-tool":t=>v(`invoke-tool`,t,e),"list-tools":t=>v(`list-tools`,t,e),"trigger-backup":t=>v(`trigger-backup`,t,e)}});return e.autoConnect!==!1&&f()&&b.connect(),_=b,b}function b(){return _}function x(){if(_){try{_.disconnect()}catch{}_=null}}async function S(e={}){let t=e.db;if(!t)try{t=await i()}catch{}if(!await d(t))return x(),null;if(!f())return null;if(typeof localStorage<`u`&&t)try{let{getConfig:e}=await import(`./get-config-Bkvl__ZS.js`).then(e=>e.n),[n,i]=await Promise.all([e(t,r.CONTROL_PLANE_URL),e(t,r.CONTROL_PLANE_TRANSPORT)]);n&&localStorage.setItem(r.CONTROL_PLANE_URL,n),i&&localStorage.setItem(r.CONTROL_PLANE_TRANSPORT,i),localStorage.setItem(r.CONTROL_PLANE_ENABLED,`true`)}catch{}let n=b();return n?(n.ensureConnected(e.force),n):y(e)}export{h as detectDeviceLabel,S as ensureControlPlaneConnected,v as executeClientControlCommand,u as getOrCreateControlPlaneClientId,d as isControlPlaneEnabled,f as shouldConnectControlPlane,x as stopControlPlaneClient};
1
+ import{i as e}from"./rolldown-runtime-DBVvNlSN.js";import{t}from"./browser-B1SoUj6D.js";import{U as n,r}from"./config-C16fFWtP.js";import{n as i}from"./db-BUuJo1Gf.js";import{t as a}from"./ulid-BSJxYh6W.js";import{c as o,t as s}from"./tools-D-52Zmfc.js";var c=/* @__PURE__ */ e(t(),1),l=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){(c.default===void 0||!c.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 u(){if(typeof localStorage<`u`)try{let e=localStorage.getItem(r.CONTROL_PLANE_CLIENT_ID);if(e&&e.trim())return e.trim()}catch{}let e=n(),t=e?`${e}-${a().toLowerCase()}`:`client-${a().toLowerCase()}`;if(typeof localStorage<`u`)try{localStorage.setItem(r.CONTROL_PLANE_CLIENT_ID,t)}catch{}return t}async function d(e){if(typeof localStorage<`u`)try{let e=localStorage.getItem(r.CONTROL_PLANE_ENABLED);if(e!==null)return e===`true`||e===`1`}catch{}if(e)try{let{getConfig:t}=await import(`./get-config-Bkvl__ZS.js`).then(e=>e.n),n=await t(e,r.CONTROL_PLANE_ENABLED);if(n!=null)return n===`true`||n===`1`}catch{}return!1}function f(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 p(e){let t=``;if(typeof localStorage<`u`)try{t=(localStorage.getItem(r.CONTROL_PLANE_URL)||``).trim()}catch{}let n=e||(typeof location<`u`?location:null),i=n&&(n.protocol===`file:`||n.hostname&&(n.hostname.endsWith(`.github.io`)||n.hostname.endsWith(`.pages.dev`))),a=t;a||=i?`http://127.0.0.1:8888`:n&&n.host?`${n.protocol}//${n.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 m(){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 h(){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 g(){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 _=null;async function v(e,t={},n={}){let r=u(),a=h(),c=m();switch(e){case`send-message`:{if(!t.text)throw Error(`Missing text parameter`);let{orchestratorStore:e}=await import(`./orchestrator-Li1UAsv7.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 i(),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-Li1UAsv7.js`).then(e=>e.n),t=n.orchestrator||e.orchestrator;return{clientId:r,deviceLabel:a,capabilities:c,version:n.version||g(),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-DIUZjVF5.js`),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-Li1UAsv7.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-DIUZjVF5.js`);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-DIUZjVF5.js`);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-Li1UAsv7.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){if(!a.toolTags.includes(t.toolName))throw Error(`Tool '${t.toolName}' is not enabled in the active conversation (${i}).`)}else if(s?.allTools&&s.allTools.some(e=>e.name===t.toolName)&&s?.enabledToolNames&&s.enabledToolNames.size>0){let e=s.enabledToolNames.has(t.toolName),n=s.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-DIUZjVF5.js`);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-Li1UAsv7.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-Li1UAsv7.js`).then(e=>e.n),a=t.groupId||n.orchestrator?.activeGroupId||e.activeGroupId||`br:main`,o=await i(),{getGroupDir:s}=await import(`./get-group-dir-D--BiEyk.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:r,token:t.token,serverBaseUrl:p().httpUrl,fileEnumerator:()=>l(c),fileReader:e=>u(e)}).initiate()}default:throw Error(`Unknown action '${e}'`)}}function y(e={}){if(_){try{_.disconnect()}catch{}_=null}let t=e.clientId&&e.clientId.trim()||u(),n=m(),i=h(),a=e.version||g(),o=null;if(typeof localStorage<`u`)try{let e=localStorage.getItem(r.CONTROL_PLANE_TRANSPORT);(e===`sse`||e===`websocket`)&&(o=e)}catch{}let s=e.transport||o||`sse`,c;if(typeof localStorage<`u`)try{c=localStorage.getItem(r.PEERJS_MY_PEER_ID)||void 0}catch{}let{httpUrl:d,wsUrl:y}=p(),b=new l({clientId:t,deviceLabel:i,capabilities:n,version:a,peerId:c,transport:s,httpUrl:d,url:y,handlers:{"send-message":t=>v(`send-message`,t,e),"list-tasks":t=>v(`list-tasks`,t,e),"read-state":t=>v(`read-state`,t,e),"invoke-tool":t=>v(`invoke-tool`,t,e),"list-tools":t=>v(`list-tools`,t,e),"trigger-backup":t=>v(`trigger-backup`,t,e)}});return e.autoConnect!==!1&&f()&&b.connect(),_=b,b}function b(){return _}function x(){if(_){try{_.disconnect()}catch{}_=null}}async function S(e={}){let t=e.db;if(!t)try{t=await i()}catch{}if(!await d(t))return x(),null;if(!f())return null;if(typeof localStorage<`u`&&t)try{let{getConfig:e}=await import(`./get-config-Bkvl__ZS.js`).then(e=>e.n),[n,i]=await Promise.all([e(t,r.CONTROL_PLANE_URL),e(t,r.CONTROL_PLANE_TRANSPORT)]);n&&localStorage.setItem(r.CONTROL_PLANE_URL,n),i&&localStorage.setItem(r.CONTROL_PLANE_TRANSPORT,i),localStorage.setItem(r.CONTROL_PLANE_ENABLED,`true`)}catch{}let n=b();return n?(n.ensureConnected(e.force),n):y(e)}export{h as detectDeviceLabel,S as ensureControlPlaneConnected,v as executeClientControlCommand,u as getOrCreateControlPlaneClientId,d as isControlPlaneEnabled,f as shouldConnectControlPlane,x as stopControlPlaneClient};
@@ -1,4 +1,4 @@
1
- import{u as e}from"./custom-element-security-B2daIE5r.js";import{I as t,P as n,r}from"./config-C16fFWtP.js";import{t as i}from"./get-config-Bkvl__ZS.js";import{C as a,E as o,t as s}from"./orchestrator-DBO4NZqd.js";import{t as c}from"./ulid-BSJxYh6W.js";import{i as l,s as u,t as d}from"./tools-D-52Zmfc.js";import{n as f,r as p}from"./headless-D6caaop6.js";import{l as m}from"./get-group-dir-D--BiEyk.js";import{t as h}from"./tools-CHxUdGxZ.js";import{t as g}from"./tool-BE_hHUgw.js";import"./tools-C4xNCwrc.js";import{S as _,a as ee,l as v,u as y,y as b}from"./provider-YPZmsuHR.js";import{a as te,i as x}from"./create-model-cache-fetch-DSAFjOwc.js";import{o as ne}from"./channel-Dk7wl-Av.js";import{_ as S,c as re,d as C,f as w,g as T,h as E,m as ie,p as D,r as O,t as k}from"./discover-skills-D1sNTy2r.js";import{i as ae,n as oe,r as se,t as ce}from"./system-prompt-CTJn0tK-.js";import{compactContext as le,d as A,f as j,g as M,h as N,i as P,m as ue,n as F,p as I,r as L,t as de}from"./compact-context-fOTqwKF6.js";const R={"litert-community/gemma-4-E2B-it-litert-lm":`https://huggingface.co/litert-community/gemma-4-E2B-it-litert-lm/resolve/main/gemma-4-E2B-it-web.litertlm`,"litert-community/gemma-4-E4B-it-litert-lm":`https://huggingface.co/litert-community/gemma-4-E4B-it-litert-lm/resolve/main/gemma-4-E4B-it-web.litertlm`},z=Object.keys(R);function B(){return typeof navigator<`u`&&`gpu`in navigator&&typeof WebAssembly<`u`&&`Suspending`in WebAssembly}let V=null,H=null,U=null,W=null;const G=te;async function K(e,t,n){return x(e,t,n,{cacheName:`shadow-claw-litertlm-models`,chunkSize:G})}async function q(e,t,n){if(H===e&&V)return V;if(U&&W===e)return U;W=e,U=(async()=>{if(V){try{await V.delete?.()}catch{}V=null,H=null}let r=R[e];if(!r)throw Error(`LiteRT-LM: Model '${e} is not supported. Supported models: ${z.join(`, `)}`);let i=await import(`./dist-DUCZvcI2.js`).catch(()=>{throw Error(`LiteRT-LM: The @litert-lm/core package is not installed. Run: npm install @litert-lm/core`)}),a=i.Engine??i.default?.Engine;if(typeof a?.create!=`function`)throw Error(`LiteRT-LM: Could not locate Engine.create in @litert-lm/core. Ensure you have the latest version installed.`);let o=await K(r,t??(()=>{}),n),s=await a.create({model:o,mainExecutorSettings:{maxNumTokens:8192}});return V=s,H=e,s})();try{return await U}finally{U=null,W=null}}function fe(e){if(!e)return null;let t=e.match(/<\|tool_call>call:([A-Za-z0-9_]+)(\{[\s\S]*?)(?:<tool_call\|>|$)/);if(!t)return null;let n=t[1],r=t[2];r=r.replace(/<\|"\|>/g,`"`);function i(e){return e.replace(/([{,]\s*)([A-Za-z_$][A-Za-z0-9_$]*)(\s*:)/g,`$1"$2"$3`)}let a={},o=[r,i(r)];for(let e of o)try{let t=JSON.parse(e);if(t&&typeof t==`object`&&!Array.isArray(t)){a=t;break}}catch{}if(Object.keys(a).length===0){let e=r.indexOf(`{`),t=r.lastIndexOf(`}`);if(e>=0&&t>e){let n=r.slice(e,t+1);for(let e of[n,i(n)])try{let t=JSON.parse(e);if(t&&typeof t==`object`&&!Array.isArray(t)){a=t;break}}catch{}}}return{name:n,input:a}}function J(e){let t=T(String(e||``),`litert_lm`).trim();if(!t)return null;let n=e=>{try{let t=JSON.parse(e);if(t&&typeof t==`object`&&(t.type===`tool_use`||t.type===`response`))return t.tools_calls&&!t.tool_calls&&(t.tool_calls=t.tools_calls),{...t,format:`json`}}catch{}return null},r=n(t);if(r)return r;let i=t.indexOf(`{`),a=t.lastIndexOf(`}`);if(i>=0&&a>i&&(r=n(t.slice(i,a+1)),r))return r;if(t.includes(`"tool_use"`)){let e=/"name"\s*:\s*"([^"]+)"/.exec(t);if(e){let n={},r=/"input"\s*:\s*(\{.*?\})\s*(?:]|\}|"|$)/s.exec(t);if(r)try{n=JSON.parse(r[1])}catch{}return{type:`tool_use`,format:`json`,tool_calls:[{id:`litert_${Date.now()}`,name:e[1],input:n}]}}}let o=fe(t);return o?{type:`tool_use`,format:`model_specific`,tool_calls:[{id:`litert_${Date.now()}`,name:o.name,input:o.input}]}:null}function pe(e,t,n){let r=[],i=e||``;if(n.length>0){let e=[``,`TOOL CALLING INSTRUCTIONS:`,`Return ONLY valid JSON (no markdown fences).`,`To call a tool: {"type":"tool_use","tool_calls":[{"name":"<tool>","input":{...}}]}`,`To reply: {"type":"response","response":"<your answer>"}`,`IMPORTANT: When you need to use a tool, output ONLY the JSON above — do NOT describe the call as text.`,``,`Available tools:`,n.map(e=>{let t=Object.keys(e.input_schema.properties||{}).join(`, `),n=e.description.split(`. `)[0];return`${e.name}(${t}): ${n}`}).join(`
1
+ import{u as e}from"./custom-element-security-B2daIE5r.js";import{I as t,P as n,r}from"./config-C16fFWtP.js";import{t as i}from"./get-config-Bkvl__ZS.js";import{C as a,E as o,t as s}from"./orchestrator-Li1UAsv7.js";import{t as c}from"./ulid-BSJxYh6W.js";import{i as l,s as u,t as d}from"./tools-D-52Zmfc.js";import{n as f,r as p}from"./headless-D6caaop6.js";import{l as m}from"./get-group-dir-D--BiEyk.js";import{t as h}from"./tools-CHxUdGxZ.js";import{t as g}from"./tool-BE_hHUgw.js";import"./tools-C4xNCwrc.js";import{S as _,a as ee,l as v,u as y,y as b}from"./provider-YPZmsuHR.js";import{a as te,i as x}from"./create-model-cache-fetch-B0mSCEk6.js";import{o as ne}from"./channel-DIpDQekL.js";import{_ as S,c as re,d as C,f as w,g as T,h as E,m as ie,p as D,r as O,t as k}from"./discover-skills-BWJB8HUA.js";import{i as ae,n as oe,r as se,t as ce}from"./system-prompt-BmswoQwF.js";import{compactContext as le,d as A,f as j,g as M,h as N,i as P,m as ue,n as F,p as I,r as L,t as de}from"./compact-context-dHitmPsV.js";const R={"litert-community/gemma-4-E2B-it-litert-lm":`https://huggingface.co/litert-community/gemma-4-E2B-it-litert-lm/resolve/main/gemma-4-E2B-it-web.litertlm`,"litert-community/gemma-4-E4B-it-litert-lm":`https://huggingface.co/litert-community/gemma-4-E4B-it-litert-lm/resolve/main/gemma-4-E4B-it-web.litertlm`},z=Object.keys(R);function B(){return typeof navigator<`u`&&`gpu`in navigator&&typeof WebAssembly<`u`&&`Suspending`in WebAssembly}let V=null,H=null,U=null,W=null;const G=te;async function K(e,t,n){return x(e,t,n,{cacheName:`shadow-claw-litertlm-models`,chunkSize:G})}async function q(e,t,n){if(H===e&&V)return V;if(U&&W===e)return U;W=e,U=(async()=>{if(V){try{await V.delete?.()}catch{}V=null,H=null}let r=R[e];if(!r)throw Error(`LiteRT-LM: Model '${e} is not supported. Supported models: ${z.join(`, `)}`);let i=await import(`./dist-DUCZvcI2.js`).catch(()=>{throw Error(`LiteRT-LM: The @litert-lm/core package is not installed. Run: npm install @litert-lm/core`)}),a=i.Engine??i.default?.Engine;if(typeof a?.create!=`function`)throw Error(`LiteRT-LM: Could not locate Engine.create in @litert-lm/core. Ensure you have the latest version installed.`);let o=await K(r,t??(()=>{}),n),s=await a.create({model:o,mainExecutorSettings:{maxNumTokens:8192}});return V=s,H=e,s})();try{return await U}finally{U=null,W=null}}function fe(e){if(!e)return null;let t=e.match(/<\|tool_call>call:([A-Za-z0-9_]+)(\{[\s\S]*?)(?:<tool_call\|>|$)/);if(!t)return null;let n=t[1],r=t[2];r=r.replace(/<\|"\|>/g,`"`);function i(e){return e.replace(/([{,]\s*)([A-Za-z_$][A-Za-z0-9_$]*)(\s*:)/g,`$1"$2"$3`)}let a={},o=[r,i(r)];for(let e of o)try{let t=JSON.parse(e);if(t&&typeof t==`object`&&!Array.isArray(t)){a=t;break}}catch{}if(Object.keys(a).length===0){let e=r.indexOf(`{`),t=r.lastIndexOf(`}`);if(e>=0&&t>e){let n=r.slice(e,t+1);for(let e of[n,i(n)])try{let t=JSON.parse(e);if(t&&typeof t==`object`&&!Array.isArray(t)){a=t;break}}catch{}}}return{name:n,input:a}}function J(e){let t=T(String(e||``),`litert_lm`).trim();if(!t)return null;let n=e=>{try{let t=JSON.parse(e);if(t&&typeof t==`object`&&(t.type===`tool_use`||t.type===`response`))return t.tools_calls&&!t.tool_calls&&(t.tool_calls=t.tools_calls),{...t,format:`json`}}catch{}return null},r=n(t);if(r)return r;let i=t.indexOf(`{`),a=t.lastIndexOf(`}`);if(i>=0&&a>i&&(r=n(t.slice(i,a+1)),r))return r;if(t.includes(`"tool_use"`)){let e=/"name"\s*:\s*"([^"]+)"/.exec(t);if(e){let n={},r=/"input"\s*:\s*(\{.*?\})\s*(?:]|\}|"|$)/s.exec(t);if(r)try{n=JSON.parse(r[1])}catch{}return{type:`tool_use`,format:`json`,tool_calls:[{id:`litert_${Date.now()}`,name:e[1],input:n}]}}}let o=fe(t);return o?{type:`tool_use`,format:`model_specific`,tool_calls:[{id:`litert_${Date.now()}`,name:o.name,input:o.input}]}:null}function pe(e,t,n){let r=[],i=e||``;if(n.length>0){let e=[``,`TOOL CALLING INSTRUCTIONS:`,`Return ONLY valid JSON (no markdown fences).`,`To call a tool: {"type":"tool_use","tool_calls":[{"name":"<tool>","input":{...}}]}`,`To reply: {"type":"response","response":"<your answer>"}`,`IMPORTANT: When you need to use a tool, output ONLY the JSON above — do NOT describe the call as text.`,``,`Available tools:`,n.map(e=>{let t=Object.keys(e.input_schema.properties||{}).join(`, `),n=e.description.split(`. `)[0];return`${e.name}(${t}): ${n}`}).join(`
2
2
  `)].join(`
3
3
  `);i=i?i+e:e}i&&r.push({role:`system`,content:i});let a=[];for(let e of t)if(e.role===`user`){let t=Array.isArray(e.content)?e.content.map(e=>e?.type===`text`?e.text:e?.type===`tool_result`?`[TOOL_RESULT ${e.tool_use_id}] ${String(e.content||``)}`:``).filter(Boolean).join(`
4
4
  `):String(e.content||``);t&&a.push(t)}else e.role;return{preface:r,turns:a}}async function me(e,t,n,r,i,a,o,s,c,l){if(!B()){await a({type:`response`,payload:{groupId:t,text:`⚠️ LiteRT-LM requires WebGPU and WebAssembly.Suspending. These are not both available in this browser.`}});return}await a(M(t,`info`,`Starting`,`Provider: LiteRT-LM (Browser · WebGPU) · Model: ${s}`)),await a({type:`model-download-progress`,payload:{groupId:t,status:`running`,progress:0,message:`Loading LiteRT-LM model: ${s}…`}});let u=e=>(e/1048576).toFixed(0),d=-1,f=(e,n,r)=>{let i=n?e/n:null,o=i==null?-1:Math.floor(i*100);(o!==d||r)&&(d=o,a({type:`model-download-progress`,payload:{groupId:t,status:`running`,progress:i,message:r?`Loaded ${s} from cache (${u(e)} MB )`:n?`Downloading ${s}: ${u(e)} / ${u(n)} MB`:`Downloading ${s}: ${u(e)} MB`}}))},p;try{p=await q(s,f,o)}catch(e){if(o?.aborted||e?.name===`AbortError`){await a({type:`model-download-progress`,payload:{groupId:t,status:`error`,progress:null,message:`LiteRT-LM model download cancelled.`}});return}await a({type:`model-download-progress`,payload:{groupId:t,status:`error`,progress:null,message:`LiteRT-LM model failed to load: ${e?.message??String(e)}`}}),await a({type:`response`,payload:{groupId:t,text:`⚠️ LiteRT-LM failed to initialize: ${e?.message??String(e)}`}});return}await a({type:`model-download-progress`,payload:{groupId:t,status:`done`,progress:1,message:`LiteRT-LM model ready.`}});let m=c??[],{preface:h,turns:g}=pe(n,r,m),_;try{_=await p.createConversation({preface:{messages:h}})}catch(e){await a({type:`response`,payload:{groupId:t,text:`⚠️ LiteRT-LM failed to create conversation: ${e?.message??String(e)}`}});return}let ee=g.slice(0,-1),v=g[g.length-1]??`Hello.`;for(let e of ee){if(o?.aborted)return;try{await _.sendMessage(e)}catch{}}if(o?.aborted)return;let y=v;for(let n=0;n<10;n++){if(o?.aborted)return;await a({type:`streaming-start`,payload:{groupId:t}});let n=``;try{let e=_.sendMessageStreaming(y);for await(let r of e){if(o?.aborted)break;let e=r?.content?.[0]?.text??``;if(e){let r=T(e,`litert_lm`);r&&(n+=r,await a({type:`streaming-chunk`,payload:{groupId:t,text:r}}))}}}catch(e){if(o?.aborted)return;await a({type:`response`,payload:{groupId:t,text:`⚠️ LiteRT-LM generation error: ${e?.message??String(e)}`}});return}let r=m.length>0?J(n):null;if(r?.type===`tool_use`){await a({type:`streaming-end`,payload:{groupId:t}});let n=Array.isArray(r.tool_calls)?r.tool_calls:[];if(n.length===0){await a({type:`streaming-done`,payload:{groupId:t,text:`(no response)`}}),await a({type:`response`,payload:{groupId:t,text:`(no response)`}});return}let i=[],o=r.format===`model_specific`;for(let r of n){await a(N(t,r.name,`running`)),I(e=>{a(e)});let n;try{n=await F(e,r.name,r.input||{},t,{allowedTools:m,invokeContext:l})}catch(e){n=`Error: ${e?.message??String(e)}`}finally{I(null)}await a(N(t,r.name,`done`));let s=typeof n==`string`?n:JSON.stringify(n);o?i.push(`<|tool_response>${s}<|tool_response|>`):i.push(`[TOOL_RESULT ${r.id??r.name}] ${s}`)}if(o)y=i.join(`
@@ -7,7 +7,7 @@
7
7
  Run instantly without cloning the repo:
8
8
 
9
9
  - `npx shadow-claw dev --open` — Start local services and launch the assistant in your browser immediately.
10
- - `npx shadow-claw agent run "prompt"` — Run autonomous headless agent prompts directly on the server or host CLI (backed by SQLite, host OS tools, streaming stdout, multi-turn history, and isolated `--no-history`, `--tools none` / `--no-tools`, or `--no-system-prompt` pure completion flags).
10
+ - `npx shadow-claw agent run "prompt"` — Run autonomous headless agent prompts directly on the server or host CLI (backed by SQLite, host OS tools, streaming stdout, multi-turn history, and isolated `--no-history`, `--tools none` / `--no-tools`, `--no-system-prompt` pure completion flags, `-f / --file` repeatable local file attachments, and `--max-image-size <MB>` configurable inline image size limit).
11
11
  - `npx shadow-claw agent model list` — List local cached ONNX/GGUF models, context lengths, and active defaults.
12
12
  - `npx shadow-claw agent model download [id]` — Pre-download model weights from Hugging Face with an interactive terminal progress bar.
13
13
  - `npx shadow-claw agent model set [id]` — Set the default model for headless CLI execution in workspace config.