shadow-claw 1.29.0 → 1.30.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (277) hide show
  1. package/.agents/skills/main/skill-creator/SKILL.md +3 -2
  2. package/.agents/skills/main/skill-creator/references/frontmatter-spec.md +5 -3
  3. package/.well-known/agent-skills/index.json +1 -1
  4. package/.well-known/mcp/server-card.json +1 -1
  5. package/.well-known/mcp.json +1 -1
  6. package/dist/lib/{app-routes-CqBOeA5q.js → app-routes-BAEMLu9g.js} +3 -2
  7. package/dist/lib/app-routes-BAEMLu9g.js.map +1 -0
  8. package/dist/lib/{bundler-8JNIKwOs.js → bundler-CsL7hHMq.js} +4 -9
  9. package/dist/lib/{bundler-8JNIKwOs.js.map → bundler-CsL7hHMq.js.map} +1 -1
  10. package/dist/lib/components/index.js +26 -26
  11. package/dist/lib/components/settings/shadow-claw-accounts.js +1 -1
  12. package/dist/lib/components/settings/shadow-claw-channel-config.js +1 -1
  13. package/dist/lib/components/settings/shadow-claw-control-plane.js +1 -1
  14. package/dist/lib/components/settings/shadow-claw-git.js +1 -1
  15. package/dist/lib/components/settings/shadow-claw-integrations.js +1 -1
  16. package/dist/lib/components/settings/shadow-claw-llm.js +1 -1
  17. package/dist/lib/components/settings/shadow-claw-mcp-remote.js +1 -1
  18. package/dist/lib/components/settings/shadow-claw-networking.js +1 -1
  19. package/dist/lib/components/settings/shadow-claw-notifications.js +1 -1
  20. package/dist/lib/components/settings/shadow-claw-peerjs.js +1 -1
  21. package/dist/lib/components/settings/shadow-claw-storage.js +1 -1
  22. package/dist/lib/components/settings/shadow-claw-task-server.js +1 -1
  23. package/dist/lib/components/settings/shadow-claw-webvm.js +1 -1
  24. package/dist/lib/components/shadow-claw-a2ui.js +1 -1
  25. package/dist/lib/components/shadow-claw-accounts.js +1 -1
  26. package/dist/lib/components/shadow-claw-channel-config.js +1 -1
  27. package/dist/lib/components/shadow-claw-channels.js +1 -1
  28. package/dist/lib/components/shadow-claw-chat.js +1 -1
  29. package/dist/lib/components/shadow-claw-control-plane.js +1 -1
  30. package/dist/lib/components/shadow-claw-conversations.js +1 -1
  31. package/dist/lib/components/shadow-claw-file-viewer.js +1 -1
  32. package/dist/lib/components/shadow-claw-files.js +1 -1
  33. package/dist/lib/components/shadow-claw-git.js +1 -1
  34. package/dist/lib/components/shadow-claw-integrations.js +1 -1
  35. package/dist/lib/components/shadow-claw-llm.js +1 -1
  36. package/dist/lib/components/shadow-claw-mcp-remote.js +1 -1
  37. package/dist/lib/components/shadow-claw-networking.js +1 -1
  38. package/dist/lib/components/shadow-claw-notifications.js +1 -1
  39. package/dist/lib/components/shadow-claw-page-header.js +1 -1
  40. package/dist/lib/components/shadow-claw-pages.js +1 -1
  41. package/dist/lib/components/shadow-claw-peerjs.js +1 -1
  42. package/dist/lib/components/shadow-claw-settings.js +1 -1
  43. package/dist/lib/components/shadow-claw-storage.js +1 -1
  44. package/dist/lib/components/shadow-claw-task-server.js +1 -1
  45. package/dist/lib/components/shadow-claw-tasks.js +1 -1
  46. package/dist/lib/components/shadow-claw-terminal.js +1 -1
  47. package/dist/lib/components/shadow-claw-tools.js +1 -1
  48. package/dist/lib/components/shadow-claw-webvm.js +1 -1
  49. package/dist/lib/components/shadow-claw.js +1 -1
  50. package/dist/lib/{config--CFrw3J3.js → config-DjZ9QWc4.js} +2 -2
  51. package/dist/lib/{config--CFrw3J3.js.map → config-DjZ9QWc4.js.map} +1 -1
  52. package/dist/lib/{configurePeerJs-DG4hliKp.js → configurePeerJs-H0WaoT0w.js} +3 -3
  53. package/dist/lib/{configurePeerJs-DG4hliKp.js.map → configurePeerJs-H0WaoT0w.js.map} +1 -1
  54. package/dist/lib/{connections-DwjzwVz0.js → connections-BURqMIUv.js} +2 -2
  55. package/dist/lib/{connections-DwjzwVz0.js.map → connections-BURqMIUv.js.map} +1 -1
  56. package/dist/lib/content/markdown-links.d.ts +19 -0
  57. package/dist/lib/core/app-routes.d.ts +1 -0
  58. package/dist/lib/{downloadGroupFile-DmcBQU1n.js → downloadGroupFile-B8J4up2a.js} +2 -2
  59. package/dist/lib/{downloadGroupFile-DmcBQU1n.js.map → downloadGroupFile-B8J4up2a.js.map} +1 -1
  60. package/dist/lib/{file-viewer-C3YKnq_-.js → file-viewer-CwvhxAAG.js} +5 -5
  61. package/dist/lib/{file-viewer-C3YKnq_-.js.map → file-viewer-CwvhxAAG.js.map} +1 -1
  62. package/dist/lib/{getGroupDir-m0f-ekgX.js → getGroupDir-QrN2aTo8.js} +4 -4
  63. package/dist/lib/{getGroupDir-m0f-ekgX.js.map → getGroupDir-QrN2aTo8.js.map} +1 -1
  64. package/dist/lib/{git-C-Q6-IVe.js → git-DhZoe1SE.js} +3 -3
  65. package/dist/lib/{git-C-Q6-IVe.js.map → git-DhZoe1SE.js.map} +1 -1
  66. package/dist/lib/{iframe-sanitizer-CUqHuWQ-.js → iframe-sanitizer-Bujgq14T.js} +2 -2
  67. package/dist/lib/{iframe-sanitizer-CUqHuWQ-.js.map → iframe-sanitizer-Bujgq14T.js.map} +1 -1
  68. package/dist/lib/index.js +27 -27
  69. package/dist/lib/{initChatSplitResize-yyBTU6h9.js → initChatSplitResize-BjiWoqC_.js} +2 -2
  70. package/dist/lib/{initChatSplitResize-yyBTU6h9.js.map → initChatSplitResize-BjiWoqC_.js.map} +1 -1
  71. package/dist/lib/{initControlPlane-DnpAzphg.js → initControlPlane-C9JxQCDh.js} +16 -16
  72. package/dist/lib/{initControlPlane-DnpAzphg.js.map → initControlPlane-C9JxQCDh.js.map} +1 -1
  73. package/dist/lib/{markdown-DgdSt2GD.js → markdown-DYHmNjC4.js} +126 -5
  74. package/dist/lib/markdown-DYHmNjC4.js.map +1 -0
  75. package/dist/lib/{mcp-reconnect-C86MR3z8.js → mcp-reconnect-BxJ77WSb.js} +2 -2
  76. package/dist/lib/{mcp-reconnect-C86MR3z8.js.map → mcp-reconnect-BxJ77WSb.js.map} +1 -1
  77. package/dist/lib/{memoryStorage-UR8E8K-H.js → memoryStorage-D3FBwO9T.js} +2 -2
  78. package/dist/lib/{memoryStorage-UR8E8K-H.js.map → memoryStorage-D3FBwO9T.js.map} +1 -1
  79. package/dist/lib/{orchestrator-ClXbJ4Mb.js → orchestrator-C6dc-2OQ.js} +130 -27
  80. package/dist/lib/{orchestrator-ClXbJ4Mb.js.map → orchestrator-C6dc-2OQ.js.map} +1 -1
  81. package/dist/lib/{orchestrator-CjEau_RG.js → orchestrator-DVkyd8K9.js} +27 -17
  82. package/dist/lib/orchestrator-DVkyd8K9.js.map +1 -0
  83. package/dist/lib/{peerjs-BdfpltIe.js → peerjs-BUS9O04I.js} +274 -60
  84. package/dist/lib/peerjs-BUS9O04I.js.map +1 -0
  85. package/dist/lib/{push-client-DjwKknNg.js → push-client-4JsQGmQa.js} +3 -3
  86. package/dist/lib/{push-client-DjwKknNg.js.map → push-client-4JsQGmQa.js.map} +1 -1
  87. package/dist/lib/{readGroupFileBytes-C8oOe8Iu.js → readGroupFileBytes-CSA7u-nJ.js} +2 -2
  88. package/dist/lib/{readGroupFileBytes-C8oOe8Iu.js.map → readGroupFileBytes-CSA7u-nJ.js.map} +1 -1
  89. package/dist/lib/{shadow-claw-DcPGKenn.js → shadow-claw-BMoF8Auf.js} +11 -11
  90. package/dist/lib/{shadow-claw-DcPGKenn.js.map → shadow-claw-BMoF8Auf.js.map} +1 -1
  91. package/dist/lib/{shadow-claw-a2ui-CpZUTzlh.js → shadow-claw-a2ui-2I5nffIn.js} +2 -2
  92. package/dist/lib/{shadow-claw-a2ui-CpZUTzlh.js.map → shadow-claw-a2ui-2I5nffIn.js.map} +1 -1
  93. package/dist/lib/{shadow-claw-accounts-03oJ__XC.js → shadow-claw-accounts-BCjlgvzy.js} +3 -3
  94. package/dist/lib/{shadow-claw-accounts-03oJ__XC.js.map → shadow-claw-accounts-BCjlgvzy.js.map} +1 -1
  95. package/dist/lib/{shadow-claw-channel-config-DEL-aZ7N.js → shadow-claw-channel-config-CxQAmlDE.js} +3 -3
  96. package/dist/lib/{shadow-claw-channel-config-DEL-aZ7N.js.map → shadow-claw-channel-config-CxQAmlDE.js.map} +1 -1
  97. package/dist/lib/{shadow-claw-channels-BgaJiPdE.js → shadow-claw-channels-CuYMUVAG.js} +3 -3
  98. package/dist/lib/{shadow-claw-channels-BgaJiPdE.js.map → shadow-claw-channels-CuYMUVAG.js.map} +1 -1
  99. package/dist/lib/{shadow-claw-chat-mXPQZbwT.js → shadow-claw-chat-RFtPmmyl.js} +13 -12
  100. package/dist/lib/shadow-claw-chat-RFtPmmyl.js.map +1 -0
  101. package/dist/lib/{shadow-claw-control-plane-DO6foOLV.js → shadow-claw-control-plane-siqmRzR1.js} +7 -7
  102. package/dist/lib/{shadow-claw-control-plane-DO6foOLV.js.map → shadow-claw-control-plane-siqmRzR1.js.map} +1 -1
  103. package/dist/lib/{shadow-claw-conversations-BLwHTwdW.js → shadow-claw-conversations-DygK5y1e.js} +7 -7
  104. package/dist/lib/{shadow-claw-conversations-BLwHTwdW.js.map → shadow-claw-conversations-DygK5y1e.js.map} +1 -1
  105. package/dist/lib/{shadow-claw-file-viewer-BSbZvSl-.js → shadow-claw-file-viewer-DGMA7d7H.js} +11 -11
  106. package/dist/lib/shadow-claw-file-viewer-DGMA7d7H.js.map +1 -0
  107. package/dist/lib/{shadow-claw-files-BLVr9Pua.js → shadow-claw-files-CgD1B9J7.js} +8 -8
  108. package/dist/lib/{shadow-claw-files-BLVr9Pua.js.map → shadow-claw-files-CgD1B9J7.js.map} +1 -1
  109. package/dist/lib/{shadow-claw-git-CHC1H86J.js → shadow-claw-git-Bw1jGRrf.js} +6 -6
  110. package/dist/lib/{shadow-claw-git-CHC1H86J.js.map → shadow-claw-git-Bw1jGRrf.js.map} +1 -1
  111. package/dist/lib/{shadow-claw-integrations-Ds-CLPhj.js → shadow-claw-integrations-ChaXtvsg.js} +4 -4
  112. package/dist/lib/{shadow-claw-integrations-Ds-CLPhj.js.map → shadow-claw-integrations-ChaXtvsg.js.map} +1 -1
  113. package/dist/lib/{shadow-claw-llm-CKXfxd3D.js → shadow-claw-llm-CDM4Akjc.js} +6 -6
  114. package/dist/lib/{shadow-claw-llm-CKXfxd3D.js.map → shadow-claw-llm-CDM4Akjc.js.map} +1 -1
  115. package/dist/lib/{shadow-claw-mcp-remote-CT5Q-54E.js → shadow-claw-mcp-remote-BLxs_Z4I.js} +4 -4
  116. package/dist/lib/{shadow-claw-mcp-remote-CT5Q-54E.js.map → shadow-claw-mcp-remote-BLxs_Z4I.js.map} +1 -1
  117. package/dist/lib/{shadow-claw-networking-dpYvfchh.js → shadow-claw-networking-BYt-kMSI.js} +2 -2
  118. package/dist/lib/{shadow-claw-networking-dpYvfchh.js.map → shadow-claw-networking-BYt-kMSI.js.map} +1 -1
  119. package/dist/lib/{shadow-claw-notifications-_YeAVPga.js → shadow-claw-notifications-Dpe4EtZI.js} +3 -3
  120. package/dist/lib/{shadow-claw-notifications-_YeAVPga.js.map → shadow-claw-notifications-Dpe4EtZI.js.map} +1 -1
  121. package/dist/lib/{shadow-claw-page-header-Cti2fzf-.js → shadow-claw-page-header-P4EvWyUr.js} +2 -2
  122. package/dist/lib/{shadow-claw-page-header-Cti2fzf-.js.map → shadow-claw-page-header-P4EvWyUr.js.map} +1 -1
  123. package/dist/lib/{shadow-claw-pages-DVzZriZ7.js → shadow-claw-pages-DWd_c4d6.js} +10 -10
  124. package/dist/lib/{shadow-claw-pages-DVzZriZ7.js.map → shadow-claw-pages-DWd_c4d6.js.map} +1 -1
  125. package/dist/lib/{shadow-claw-peerjs-BvixjeBz.js → shadow-claw-peerjs-D928817m.js} +3 -3
  126. package/dist/lib/{shadow-claw-peerjs-BvixjeBz.js.map → shadow-claw-peerjs-D928817m.js.map} +1 -1
  127. package/dist/lib/{shadow-claw-settings-DV9-gD4Q.js → shadow-claw-settings-C8OPrSqs.js} +8 -8
  128. package/dist/lib/{shadow-claw-settings-DV9-gD4Q.js.map → shadow-claw-settings-C8OPrSqs.js.map} +1 -1
  129. package/dist/lib/{shadow-claw-storage-Bv__kXG6.js → shadow-claw-storage-CZ2uZJNw.js} +5 -5
  130. package/dist/lib/{shadow-claw-storage-Bv__kXG6.js.map → shadow-claw-storage-CZ2uZJNw.js.map} +1 -1
  131. package/dist/lib/{shadow-claw-task-server-DNOe8PWK.js → shadow-claw-task-server-CLT018BX.js} +2 -2
  132. package/dist/lib/{shadow-claw-task-server-DNOe8PWK.js.map → shadow-claw-task-server-CLT018BX.js.map} +1 -1
  133. package/dist/lib/{shadow-claw-tasks-qmcDT4PU.js → shadow-claw-tasks-D5h-lGmq.js} +9 -8
  134. package/dist/lib/shadow-claw-tasks-D5h-lGmq.js.map +1 -0
  135. package/dist/lib/{shadow-claw-terminal-0QUWP8of.js → shadow-claw-terminal-Cy1O6KVM.js} +2 -2
  136. package/dist/lib/{shadow-claw-terminal-0QUWP8of.js.map → shadow-claw-terminal-Cy1O6KVM.js.map} +1 -1
  137. package/dist/lib/{shadow-claw-tools-Bs_bmI6-.js → shadow-claw-tools-CVD06bCR.js} +9 -9
  138. package/dist/lib/{shadow-claw-tools-Bs_bmI6-.js.map → shadow-claw-tools-CVD06bCR.js.map} +1 -1
  139. package/dist/lib/{shadow-claw-webvm-DYaoL7QY.js → shadow-claw-webvm-DoGl5ZSJ.js} +3 -3
  140. package/dist/lib/{shadow-claw-webvm-DYaoL7QY.js.map → shadow-claw-webvm-DoGl5ZSJ.js.map} +1 -1
  141. package/dist/lib/subsystems/channels/peerjs.d.ts +37 -4
  142. package/dist/lib/subsystems/channels/room.d.ts +4 -0
  143. package/dist/lib/{syncWebMcpRegistration-BhbqI6R2.js → syncWebMcpRegistration-BeYkQEvj.js} +5 -5
  144. package/dist/lib/{syncWebMcpRegistration-BhbqI6R2.js.map → syncWebMcpRegistration-BeYkQEvj.js.map} +1 -1
  145. package/dist/lib/tools-C3Kft940.js +1 -0
  146. package/dist/lib/{tools-DBaMRiEu.js → tools-DKzPWc0q.js} +2 -2
  147. package/dist/lib/{tools-DBaMRiEu.js.map → tools-DKzPWc0q.js.map} +1 -1
  148. package/dist/lib/{tools-DwwB9RBa.js → tools-DqcJe8LS.js} +5 -5
  149. package/dist/lib/{tools-DwwB9RBa.js.map → tools-DqcJe8LS.js.map} +1 -1
  150. package/dist/lib/{trusted-types-Dx0RZlrd.js → trusted-types-Oz7xXJAY.js} +4 -4
  151. package/dist/lib/{trusted-types-Dx0RZlrd.js.map → trusted-types-Oz7xXJAY.js.map} +1 -1
  152. package/dist/lib/utils/index.js +1 -1
  153. package/dist/lib/utils/namespacedStorage.js +1 -1
  154. package/dist/lib/utils/utils.js +1 -1
  155. package/dist/lib/{webmcp-j_1_T3wf.js → webmcp-BC8_WafM.js} +4 -4
  156. package/dist/lib/{webmcp-j_1_T3wf.js.map → webmcp-BC8_WafM.js.map} +1 -1
  157. package/dist/lib/worker/utils/system-prompt.d.ts +4 -1
  158. package/dist/public/.agents/skills/main/skill-creator/SKILL.md +3 -2
  159. package/dist/public/.agents/skills/main/skill-creator/references/frontmatter-spec.md +5 -3
  160. package/dist/public/.well-known/agent-skills/index.json +1 -1
  161. package/dist/public/.well-known/mcp/server-card.json +1 -1
  162. package/dist/public/.well-known/mcp.json +1 -1
  163. package/dist/public/agent.worker.js +18 -17
  164. package/dist/public/app-routes-BMQ4HFaM.js +1 -0
  165. package/dist/public/{bundler-Ca-Xwln8.js → bundler-0if-QelV.js} +4 -4
  166. package/dist/public/{config-CrHchneq.js → config-Bnwx4EfS.js} +1 -1
  167. package/dist/public/{configurePeerJs-B470pdeU.js → configurePeerJs-DkyGvwk_.js} +1 -1
  168. package/dist/public/{connections-DvbgdkaB.js → connections-6575KDGE.js} +1 -1
  169. package/dist/public/{custom-element-security-FU04Cq05.js → custom-element-security-BQJQ_oKz.js} +1 -1
  170. package/dist/public/docs/example/article/index.html +2 -2
  171. package/dist/public/docs/publishing/index.html +2 -2
  172. package/dist/public/docs/skill-creator/index.html +2 -2
  173. package/dist/public/docs/subsystems/skills.md +3 -1
  174. package/dist/public/{downloadGroupFile-D8KRJGGL.js → downloadGroupFile-Wo1Sxdhr.js} +1 -1
  175. package/dist/public/{e2e-bridge-CSW0S5Yz.js → e2e-bridge-CvLCUU2O.js} +1 -1
  176. package/dist/public/{file-viewer-Cs-riNvy.js → file-viewer-CIjqAvNF.js} +1 -1
  177. package/dist/public/{getGroupDir-P1h9wl6S.js → getGroupDir-BwprrdrQ.js} +1 -1
  178. package/dist/public/{git-7Vq_SJSp.js → git-BSnY2D-A.js} +2 -2
  179. package/dist/public/{iframe-sanitizer-y2Z1pPwY.js → iframe-sanitizer-viROQkRn.js} +1 -1
  180. package/dist/public/index.html +2 -2
  181. package/dist/public/index.js +1 -1
  182. package/dist/public/{initChatSplitResize-CzV2E7Ul.js → initChatSplitResize-BA18wLQQ.js} +1 -1
  183. package/dist/public/{initControlPlane-BqCY0NQy.js → initControlPlane-L96uJkRA.js} +1 -1
  184. package/dist/public/main/index.html +2 -2
  185. package/dist/public/main/memory/index.html +2 -2
  186. package/dist/public/{markdown-Cw7vCtTg.js → markdown-DGjZAm_w.js} +17 -14
  187. package/dist/public/{mcp-reconnect-9emsqGRe.js → mcp-reconnect-CBHuaYdF.js} +1 -1
  188. package/dist/public/{memoryStorage-C0KvLNUp.js → memoryStorage-C1llaYus.js} +1 -1
  189. package/dist/public/orchestrator-C0VOoTiK.js +15 -0
  190. package/dist/public/{orchestrator-DpkkeD6T.js → orchestrator-DMWi--Dc.js} +20 -19
  191. package/dist/public/peerjs-Bf6ZxfbA.js +1 -0
  192. package/dist/public/{push-client-CHjSbrWs.js → push-client-BD4YalBa.js} +1 -1
  193. package/dist/public/service-worker.js +1 -1
  194. package/dist/public/{shadow-claw-BBPV_9X8.js → shadow-claw-DRy-D4Qi.js} +2 -2
  195. package/dist/public/{shadow-claw-accounts-xUOLBsQZ.js → shadow-claw-accounts-DnfmA8cb.js} +1 -1
  196. package/dist/public/{shadow-claw-channels-BJvrKQjg.js → shadow-claw-channels-8UkycZAa.js} +1 -1
  197. package/dist/public/{shadow-claw-chat-BG2EaRaw.js → shadow-claw-chat-Cf5LUiul.js} +9 -9
  198. package/dist/public/{shadow-claw-control-plane-BBa7WbTg.js → shadow-claw-control-plane-UsBF-Nvd.js} +2 -2
  199. package/dist/public/{shadow-claw-conversations-CFaWFmkm.js → shadow-claw-conversations-Aoe61Y21.js} +1 -1
  200. package/dist/public/{shadow-claw-file-viewer-Z-GIKaE9.js → shadow-claw-file-viewer-D28dSSEn.js} +6 -6
  201. package/dist/public/{shadow-claw-files-BBx4iMsk.js → shadow-claw-files-CaDUlPEU.js} +1 -1
  202. package/dist/public/{shadow-claw-git-vTOKatwd.js → shadow-claw-git-DYNcZMWA.js} +2 -2
  203. package/dist/public/{shadow-claw-integrations-BBVnO0Fc.js → shadow-claw-integrations-BJf_hQVv.js} +1 -1
  204. package/dist/public/{shadow-claw-llm-Ce1Ax6-x.js → shadow-claw-llm-BqK2SIRf.js} +2 -2
  205. package/dist/public/{shadow-claw-mcp-remote-Bkx0gsmF.js → shadow-claw-mcp-remote-B_dDG990.js} +1 -1
  206. package/dist/public/{shadow-claw-networking-q4XIzdB5.js → shadow-claw-networking-D8LxOofv.js} +1 -1
  207. package/dist/public/{shadow-claw-notifications-D2cz0gmm.js → shadow-claw-notifications-DpVyiNG_.js} +1 -1
  208. package/dist/public/{shadow-claw-page-header-BccSHItx.js → shadow-claw-page-header-DdC7bJuW.js} +1 -1
  209. package/dist/public/{shadow-claw-pages-3335lmSC.js → shadow-claw-pages-CYMl4J-6.js} +3 -3
  210. package/dist/public/{shadow-claw-settings-4ptYuJwO.js → shadow-claw-settings-Da_8Oy3O.js} +3 -3
  211. package/dist/public/{shadow-claw-storage-bIrPKFhF.js → shadow-claw-storage-DXIm86_-.js} +1 -1
  212. package/dist/public/{shadow-claw-task-server-5yqVBxy1.js → shadow-claw-task-server-BCceBD0G.js} +1 -1
  213. package/dist/public/{shadow-claw-tasks-DcqYHPLZ.js → shadow-claw-tasks-BW1QZ5L3.js} +19 -19
  214. package/dist/public/{shadow-claw-terminal-fARaDONr.js → shadow-claw-terminal-vqfsxhcK.js} +1 -1
  215. package/dist/public/{shadow-claw-tools-paEAhcJr.js → shadow-claw-tools-l0Jsa7UJ.js} +1 -1
  216. package/dist/public/{shadow-claw-webvm-CbzH_vyX.js → shadow-claw-webvm-CDPOWZm7.js} +1 -1
  217. package/dist/public/skills/main/skill-creator/SKILL.md +3 -2
  218. package/dist/public/skills/main/skill-creator/references/frontmatter-spec.md +5 -3
  219. package/dist/public/static-main-manifest.json +2 -2
  220. package/dist/public/{syncWebMcpRegistration-CWSYaHex.js → syncWebMcpRegistration-5b5FkP9_.js} +1 -1
  221. package/dist/public/tools-B-PzsLc2.js +1 -0
  222. package/dist/public/{tools-C8x3nmo4.js → tools-CcgG5XuA.js} +1 -1
  223. package/dist/public/{tools-DvckJZG2.js → tools-VSOY66vs.js} +1 -1
  224. package/dist/public/{webmcp-DAjmliCx.js → webmcp-DBONjQWd.js} +1 -1
  225. package/dist/server.js +2 -2
  226. package/package.json +2 -2
  227. package/src/__mocks__/marked.cjs +14 -0
  228. package/src/components/shadow-claw-chat/shadow-claw-chat.test.ts +17 -0
  229. package/src/components/shadow-claw-chat/shadow-claw-chat.ts +5 -1
  230. package/src/components/shadow-claw-file-viewer/shadow-claw-file-viewer.test.ts +78 -0
  231. package/src/components/shadow-claw-file-viewer/shadow-claw-file-viewer.ts +6 -2
  232. package/src/components/shadow-claw-pages/utils/resolveWorkspaceLinkPath.test.ts +56 -0
  233. package/src/components/shadow-claw-tasks/shadow-claw-tasks.test.ts +22 -0
  234. package/src/components/shadow-claw-tasks/shadow-claw-tasks.ts +5 -1
  235. package/src/content/markdown-links.test.ts +109 -0
  236. package/src/content/markdown-links.ts +187 -0
  237. package/src/content/markdown.test.ts +33 -0
  238. package/src/content/markdown.ts +6 -1
  239. package/src/core/app-routes.test.ts +65 -0
  240. package/src/core/app-routes.ts +1 -1
  241. package/src/core/orchestrator/orchestrator.ts +3 -0
  242. package/src/core/orchestrator/utils/compactContext.ts +2 -0
  243. package/src/core/orchestrator/utils/invokeAgent.ts +1 -0
  244. package/src/subsystems/accounts/service-accounts.test.ts +0 -1
  245. package/src/subsystems/channels/peerjs.test.ts +479 -1
  246. package/src/subsystems/channels/peerjs.ts +420 -75
  247. package/src/subsystems/channels/room.test.ts +35 -0
  248. package/src/subsystems/channels/room.ts +15 -0
  249. package/src/subsystems/skills/activateSkill.test.ts +38 -5
  250. package/src/subsystems/skills/activateSkill.ts +25 -3
  251. package/src/subsystems/skills/parseSkill.test.ts +71 -0
  252. package/src/subsystems/skills/parseSkill.ts +185 -25
  253. package/src/subsystems/tools/files.ts +4 -4
  254. package/src/worker/tools/spawn-subagent/spawn-subagent.test.ts +22 -23
  255. package/src/worker/tools/workspace/send-file.test.ts +24 -1
  256. package/src/worker/tools/workspace/send-file.ts +6 -3
  257. package/src/worker/utils/handleCompact.test.ts +3 -4
  258. package/src/worker/utils/handleInvoke.test.ts +13 -11
  259. package/src/worker/utils/handleInvoke.ts +3 -0
  260. package/src/worker/utils/handleMessage.test.ts +0 -1
  261. package/src/worker/utils/post.test.ts +3 -4
  262. package/src/worker/utils/sandboxedEval.test.ts +1 -2
  263. package/src/worker/utils/system-prompt.test.ts +59 -0
  264. package/src/worker/utils/system-prompt.ts +21 -1
  265. package/src/worker/utils/withRetry.test.ts +3 -16
  266. package/dist/lib/app-routes-CqBOeA5q.js.map +0 -1
  267. package/dist/lib/markdown-DgdSt2GD.js.map +0 -1
  268. package/dist/lib/orchestrator-CjEau_RG.js.map +0 -1
  269. package/dist/lib/peerjs-BdfpltIe.js.map +0 -1
  270. package/dist/lib/shadow-claw-chat-mXPQZbwT.js.map +0 -1
  271. package/dist/lib/shadow-claw-file-viewer-BSbZvSl-.js.map +0 -1
  272. package/dist/lib/shadow-claw-tasks-qmcDT4PU.js.map +0 -1
  273. package/dist/lib/tools-D4Pp-nUw.js +0 -1
  274. package/dist/public/app-routes-Bs-riIvr.js +0 -1
  275. package/dist/public/orchestrator-BWkHHO9Y.js +0 -15
  276. package/dist/public/peerjs-tf2EmWjB.js +0 -1
  277. package/dist/public/tools-COduyYJ0.js +0 -1
@@ -1 +1 @@
1
- {"version":3,"file":"tools-DBaMRiEu.js","names":[],"sources":["../../src/subsystems/tools/bash.ts","../../src/subsystems/tools/chat.ts","../../src/subsystems/tools/email.ts","../../src/subsystems/tools/fetch.ts","../../src/subsystems/tools/javascript.ts","../../src/subsystems/tools/mcp.ts","../../src/subsystems/tools/manage_tools.ts","../../src/subsystems/tools/memory.ts","../../src/subsystems/tools/notifications.ts","../../src/ui/a2ui/types.ts","../../src/subsystems/tools/a2ui.ts","../../src/subsystems/tools/subagent.ts","../../src/subsystems/tools/time.ts","../../src/subsystems/tools/files.ts","../../src/subsystems/tools/git.ts","../../src/subsystems/tools/tasks.ts","../../src/subsystems/tools/rooms.ts","../../src/subsystems/tools/builtin-ai.ts","../../src/subsystems/tools/index.ts"],"sourcesContent":["import type { ToolDefinition } from \"./types.js\";\n\nexport const bash: ToolDefinition = {\n name: \"bash\",\n description:\n \"Execute a shell command. When WebVM is available, runs in a full Alpine Linux VM (x86) \" +\n \"with all standard Linux commands. When WebVM is disabled or unavailable, \" +\n \"falls back to a lightweight JavaScript shell emulator with 83 commands: \" +\n \"alias, awk, base64, basename, bash, cat, cd, chmod, clear, column, comm, command, \" +\n \"cp, curl, cut, date, diff, dirname, du, echo, egrep, env, expand, export, expr, false, \" +\n \"fgrep, file, find, fold, grep, gunzip, gzip, head, help, html-to-markdown, join, \" +\n \"jq, ln, ls, md5sum, mkdir, mv, nl, od, paste, printenv, printf, pwd, readlink, \" +\n \"realpath, rev, rg, rm, rmdir, sed, seq, sh, sha1sum, sha256sum, sha384sum, \" +\n \"sha512sum, sleep, sort, split, stat, strings, tac, tail, tar, tee, test, timeout, \" +\n \"touch, tr, tree, true, unalias, uniq, wc, which, xargs, yes, zcat. \" +\n \"Commands NOT available in fallback mode: node, npm, npx, git, apk, python, wget.\" +\n \"Supports pipes (|), redirects (> >>), operators (&& || ;), newlines, and # comments. \" +\n \"Prefer read_file/write_file for file inspection and edits — they are faster and more reliable than shell commands for that purpose.\",\n input_schema: {\n type: \"object\",\n properties: {\n command: {\n type: \"string\",\n description: \"The bash command to execute\",\n },\n stdin: {\n type: \"string\",\n description: \"Optional standard input (stdin) to pass to the command\",\n },\n timeout: {\n type: \"number\",\n description:\n \"Timeout in seconds (default from Settings, initially 120; max: 1800)\",\n },\n },\n required: [\"command\"],\n },\n};\n","import type { ToolDefinition } from \"./types.js\";\n\nexport const clear_chat: ToolDefinition = {\n name: \"clear_chat\",\n description:\n \"Clear the current chat history and start a new session. \" +\n \"Useful for scheduled tasks to prevent context from growing indefinitely.\",\n input_schema: {\n type: \"object\",\n properties: {},\n },\n};\n\nexport const ask_user: ToolDefinition = {\n name: \"ask_user\",\n description:\n \"Pause execution to ask the user a question or request confirmation. \" +\n \"This halts the agent's work until the user provides an answer. \" +\n \"Use this for human-in-the-loop checkpoints before taking destructive actions \" +\n \"or when you need clarification to proceed.\",\n input_schema: {\n type: \"object\",\n properties: {\n question: {\n type: \"string\",\n description:\n \"The question or confirmation message to present to the user.\",\n },\n options: {\n type: \"array\",\n items: { type: \"string\" },\n description:\n \"Optional list of predefined choices for the user to select from.\",\n },\n },\n required: [\"question\"],\n },\n};\n","import type { ToolDefinition } from \"./types.js\";\n\nexport const manage_email: ToolDefinition = {\n name: \"manage_email\",\n description:\n \"Manage email connection settings for IMAP/SMTP workflows. \" +\n \"Supports status, connect/configure, enable/disable, delete, read_messages, send_message, mark_as_read, mark_as_unread, delete_messages, download_attachments, list available connection types, and lightweight test actions.\",\n input_schema: {\n type: \"object\",\n properties: {\n action: {\n type: \"string\",\n enum: [\n \"status\",\n \"list_plugins\",\n \"list_connections\",\n \"connect\",\n \"configure\",\n \"enable\",\n \"disable\",\n \"delete\",\n \"test\",\n \"read_messages\",\n \"send_message\",\n \"mark_as_read\",\n \"mark_as_unread\",\n \"delete_messages\",\n \"download_attachments\",\n ],\n description: \"Email management action to perform.\",\n },\n plugin_id: {\n type: \"string\",\n description:\n \"Optional connection type ID for connect operations (default: imap).\",\n },\n connection_id: {\n type: \"string\",\n description:\n \"Connection ID or label for configure, enable, disable, delete, and test actions. For read_messages/send_message, it may be omitted when there is exactly one enabled IMAP connection.\",\n },\n label: {\n type: \"string\",\n description: \"Human-readable connection label for new connections.\",\n },\n enabled: {\n type: \"boolean\",\n description:\n \"Optional enabled flag used during connect/configure actions.\",\n },\n config: {\n type: \"object\",\n properties: {},\n description:\n \"Email config object (host, port, secure, mailboxPath, smtpHost, smtpPort, smtpSecure, etc.).\",\n },\n mailbox_path: {\n type: \"string\",\n description:\n \"Optional mailbox path override for read_messages (default: INBOX).\",\n },\n limit: {\n type: \"number\",\n description:\n \"Optional max messages to fetch for read_messages (default 10, range 1-50).\",\n },\n unread_only: {\n type: \"boolean\",\n description: \"If true, read_messages returns only unread messages.\",\n },\n message_uids: {\n type: \"array\",\n items: { type: \"number\" },\n description:\n \"Message UIDs for mark_as_read, mark_as_unread, and delete_messages actions.\",\n },\n message_uid: {\n type: \"number\",\n description: \"Single message UID used by download_attachments action.\",\n },\n attachment_parts: {\n type: \"array\",\n items: { type: \"string\" },\n description:\n \"Optional IMAP MIME part IDs to download (for example: 2, 3.1). If omitted, all attachments in the message are downloaded.\",\n },\n save_directory: {\n type: \"string\",\n description:\n \"Optional workspace directory for downloaded attachments (default: downloads/email).\",\n },\n attachments: {\n type: \"array\",\n items: {\n anyOf: [\n { type: \"string\" },\n {\n type: \"object\",\n properties: {\n path: { type: \"string\" },\n filename: { type: \"string\" },\n content_type: { type: \"string\" },\n },\n required: [\"path\"],\n },\n ],\n },\n description:\n \"Optional workspace file attachments for send_message. Provide paths or objects with path/filename/content_type.\",\n },\n to: {\n type: \"array\",\n items: { type: \"string\" },\n description: \"Recipient email addresses for send_message.\",\n },\n cc: {\n type: \"array\",\n items: { type: \"string\" },\n description: \"Optional CC recipient addresses for send_message.\",\n },\n bcc: {\n type: \"array\",\n items: { type: \"string\" },\n description: \"Optional BCC recipient addresses for send_message.\",\n },\n subject: {\n type: \"string\",\n description: \"Message subject for send_message.\",\n },\n body: {\n type: \"string\",\n description: \"Plaintext message body for send_message.\",\n },\n html: {\n type: \"string\",\n description: \"Optional HTML body for send_message.\",\n },\n from: {\n type: \"string\",\n description: \"Optional from address override for send_message.\",\n },\n reply_to: {\n type: \"string\",\n description: \"Optional reply-to address for send_message.\",\n },\n username: {\n type: \"string\",\n description:\n \"Optional username override for connect/configure/read_messages/send_message.\",\n },\n password: {\n type: \"string\",\n description:\n \"Optional password override for connect/configure/read_messages/send_message.\",\n },\n },\n required: [\"action\"],\n },\n};\n\nexport const email_read_messages: ToolDefinition = {\n name: \"email_read_messages\",\n description:\n \"Read recent messages from a configured email connection (IMAP). \" +\n \"Use this to check inbox mail from an agent workflow. Results include attachment metadata when available.\",\n input_schema: {\n type: \"object\",\n properties: {\n connection_id: {\n type: \"string\",\n description: \"Email connection ID or label.\",\n },\n mailbox_path: {\n type: \"string\",\n description: \"Optional mailbox path override (default: INBOX).\",\n },\n limit: {\n type: \"number\",\n description: \"Optional max messages to fetch (default 10, range 1-50).\",\n },\n unread_only: {\n type: \"boolean\",\n description: \"If true, only unread messages are returned.\",\n },\n },\n required: [\"connection_id\"],\n },\n};\n\nexport const email_send_message: ToolDefinition = {\n name: \"email_send_message\",\n description:\n \"Send an email message through a configured email connection (SMTP).\",\n input_schema: {\n type: \"object\",\n properties: {\n connection_id: {\n type: \"string\",\n description: \"Email connection ID or label.\",\n },\n to: {\n type: \"array\",\n items: { type: \"string\" },\n description: \"Recipient email addresses.\",\n },\n cc: {\n type: \"array\",\n items: { type: \"string\" },\n description: \"Optional CC recipient addresses.\",\n },\n bcc: {\n type: \"array\",\n items: { type: \"string\" },\n description: \"Optional BCC recipient addresses.\",\n },\n subject: {\n type: \"string\",\n description: \"Message subject.\",\n },\n body: {\n type: \"string\",\n description: \"Plaintext message body.\",\n },\n html: {\n type: \"string\",\n description: \"Optional HTML message body.\",\n },\n from: {\n type: \"string\",\n description: \"Optional from address override.\",\n },\n reply_to: {\n type: \"string\",\n description: \"Optional reply-to address.\",\n },\n },\n required: [\"connection_id\", \"to\", \"subject\"],\n },\n};\n","import type { ToolDefinition } from \"./types.js\";\n\nexport const fetch_url: ToolDefinition = {\n name: \"fetch_url\",\n description:\n \"Fetch a URL via HTTP and return the response body. \" +\n \"Subject to browser CORS restrictions — works with most public APIs. \" +\n \"Response is truncated to 100KB. \" +\n \"Set use_git_auth to true to automatically inject the saved Git PAT \" +\n \"as an Authorization header (supports GitHub, Azure DevOps, GitLab, and other providers — \" +\n \"auth format is auto-detected from the URL's host). \" +\n \"If include_headers is true, the response will include both request and response headers.\",\n input_schema: {\n type: \"object\",\n properties: {\n url: {\n type: \"string\",\n description: \"The URL to fetch\",\n },\n method: {\n type: \"string\",\n description: \"HTTP method (default: GET)\",\n },\n headers: {\n type: \"object\",\n properties: {},\n description: \"Request headers as key-value pairs\",\n },\n body: {\n type: \"string\",\n description: \"Request body (for POST/PUT/PATCH)\",\n },\n use_git_auth: {\n type: \"boolean\",\n description:\n \"If true, inject the saved Git credentials as an Authorization header. \" +\n \"Auth format is auto-detected from the URL host: GitHub (token), \" +\n \"Azure DevOps (Basic), GitLab (Bearer), or generic Bearer.\",\n },\n git_account_id: {\n type: \"string\",\n description:\n \"Optional explicit Git account ID to use when use_git_auth is true. \" +\n \"If omitted, account resolution uses hostPattern/default matching.\",\n },\n use_account_auth: {\n type: \"boolean\",\n description:\n \"If true, inject a saved service account PAT as a Bearer Authorization header. \" +\n \"The account is matched by hostPattern against the URL (longest match wins), \" +\n \"then falls back to the default service account. \" +\n \"Use this for non-Git services like Figma, Notion, or any other service \" +\n \"whose PAT is stored under Settings → Accounts.\",\n },\n account_id: {\n type: \"string\",\n description:\n \"Optional explicit service account ID to use when use_account_auth is true. \" +\n \"If omitted, account resolution uses hostPattern/default matching.\",\n },\n auth_mode: {\n type: \"string\",\n enum: [\"pat\", \"oauth\"],\n description:\n \"Optional preferred credential mode when multiple accounts match. \" +\n \"Valid values: pat or oauth.\",\n },\n include_headers: {\n type: \"boolean\",\n description:\n \"If true, include request and response headers in the output.\",\n },\n },\n required: [\"url\"],\n },\n};\n\nexport const fetch_file: ToolDefinition = {\n name: \"fetch_file\",\n description:\n \"Fetch a URL and save the response body directly to the workspace in one step. \" +\n \"Equivalent to fetch_url + write_file but atomic. \" +\n \"Text responses are saved as UTF-8; binary responses (images, PDFs, audio, video, zip, \" +\n \"application/octet-stream) are saved as raw bytes. \" +\n \"The destination path within the workspace is required. \" +\n \"Supports the same authentication options as fetch_url (use_git_auth, use_account_auth, etc.). \" +\n \"Returns the workspace path the file was saved to and the number of bytes written.\",\n input_schema: {\n type: \"object\",\n properties: {\n url: {\n type: \"string\",\n description: \"The URL to fetch\",\n },\n path: {\n type: \"string\",\n description:\n \"Destination path within the workspace (e.g. 'data/response.json'). \" +\n \"Parent directories are created automatically. \" +\n \"Must not contain '..' segments.\",\n },\n method: {\n type: \"string\",\n description: \"HTTP method (default: GET)\",\n },\n headers: {\n type: \"object\",\n properties: {},\n description: \"Request headers as key-value pairs\",\n },\n body: {\n type: \"string\",\n description: \"Request body (for POST/PUT/PATCH)\",\n },\n use_git_auth: {\n type: \"boolean\",\n description:\n \"If true, inject the saved Git credentials as an Authorization header. \" +\n \"Auth format is auto-detected from the URL host: GitHub (token), \" +\n \"Azure DevOps (Basic), GitLab (Bearer), or generic Bearer.\",\n },\n git_account_id: {\n type: \"string\",\n description:\n \"Optional explicit Git account ID to use when use_git_auth is true. \" +\n \"If omitted, account resolution uses hostPattern/default matching.\",\n },\n use_account_auth: {\n type: \"boolean\",\n description:\n \"If true, inject a saved service account PAT as a Bearer Authorization header. \" +\n \"The account is matched by hostPattern against the URL (longest match wins), \" +\n \"then falls back to the default service account.\",\n },\n account_id: {\n type: \"string\",\n description:\n \"Optional explicit service account ID to use when use_account_auth is true. \" +\n \"If omitted, account resolution uses hostPattern/default matching.\",\n },\n auth_mode: {\n type: \"string\",\n enum: [\"pat\", \"oauth\"],\n description:\n \"Optional preferred credential mode when multiple accounts match. \" +\n \"Valid values: pat or oauth.\",\n },\n },\n required: [\"url\", \"path\"],\n },\n};\n\nexport const web_search: ToolDefinition = {\n name: \"web_search\",\n description:\n \"Perform a web search using a search engine to discover information. \" +\n \"Returns a plain-text summary of the top search results including titles, URLs, and snippets. \" +\n \"Use this when you need to find information but don't know the exact URL to fetch.\",\n input_schema: {\n type: \"object\",\n properties: {\n query: {\n type: \"string\",\n description: \"The search query to look up.\",\n },\n },\n required: [\"query\"],\n },\n};\n","import type { ToolDefinition } from \"./types.js\";\n\nexport const javascript: ToolDefinition = {\n name: \"javascript\",\n description:\n \"Execute JavaScript code in a sandboxed Worker and return the result. \" +\n \"Lighter than bash — no VM boot required. Use for calculations, \" +\n \"data transformations, JSON processing, string analysis, etc. \" +\n \"Runs in strict mode. No access to DOM, eval(), Function(), \" +\n \"self, postMessage, importScripts, navigator, or indexedDB — these are all undefined. \" +\n \"fetch availability is controlled by Tool Configuration -> Internet Access (shared with bash). \" +\n \"setTimeout is available but setInterval is blocked. \" +\n \"IMPORTANT: You CANNOT call other agent tools (like read_file, write_file, or bash) from inside this sandbox. \" +\n \"If you need to process file contents or tool outputs, you must fetch them in a previous turn \" +\n \"and pass the data into this tool via the $PIPE_DATA variable. \" +\n \"Write plain JavaScript expressions and statements — the return value of the \" +\n \"last expression is captured as the result.\",\n input_schema: {\n type: \"object\",\n properties: {\n code: {\n type: \"string\",\n description:\n \"JavaScript code to execute. The return value of the last expression is captured.\",\n },\n data: {\n type: \"string\",\n description:\n \"Optional input data string. Accessible inside the code sandbox via the global constant `$PIPE_DATA`.\",\n },\n },\n required: [\"code\"],\n },\n};\n","import type { ToolDefinition } from \"./types.js\";\n\nexport const remote_mcp_list_tools: ToolDefinition = {\n name: \"remote_mcp_list_tools\",\n description:\n \"List available tools from a configured Remote MCP connection by connection ID or label.\",\n input_schema: {\n type: \"object\",\n properties: {\n connection_id: {\n type: \"string\",\n description: \"Remote MCP connection ID or label\",\n },\n },\n required: [\"connection_id\"],\n },\n};\n\nexport const remote_mcp_call_tool: ToolDefinition = {\n name: \"remote_mcp_call_tool\",\n description: \"Call a tool exposed by a configured Remote MCP connection.\",\n input_schema: {\n type: \"object\",\n properties: {\n connection_id: {\n type: \"string\",\n description: \"Remote MCP connection ID or label\",\n },\n tool_name: {\n type: \"string\",\n description: \"Remote MCP tool name\",\n },\n arguments: {\n type: \"object\",\n properties: {},\n description: \"Arguments object passed to the remote MCP tool\",\n },\n },\n required: [\"connection_id\", \"tool_name\"],\n },\n};\n","import type { ToolDefinition } from \"./types.js\";\n\n/**\n * manage_tools — Agent-driven tool management.\n *\n * Allows the agent to enable/disable tools or activate predefined tool profiles.\n * Note: Changes take effect on the NEXT message turn.\n */\nexport const manage_tools: ToolDefinition = {\n name: \"manage_tools\",\n description:\n \"Enable or disable specific tools, or activate a predefined tool profile. \" +\n \"Use list_tool_profiles to see available profiles before activating one. \" +\n \"This helps optimize the context window and focus capabilities. \" +\n \"Changes take effect on the NEXT turn, not immediately within the current tool-use loop.\",\n input_schema: {\n type: \"object\",\n properties: {\n action: {\n type: \"string\",\n enum: [\"enable\", \"disable\", \"activate_profile\"],\n description: \"The management action to perform.\",\n },\n tool_names: {\n type: \"array\",\n items: { type: \"string\" },\n description:\n \"List of tool names to enable or disable. Required for 'enable' and 'disable' actions.\",\n },\n profile_id: {\n type: \"string\",\n description:\n \"The unique ID of the tool profile to activate. Required for 'activate_profile' action.\",\n },\n },\n required: [\"action\"],\n },\n};\n\n/**\n * list_tool_profiles — List available tool profiles.\n *\n * Returns a list of tool profiles that the agent can activate.\n */\nexport const list_tool_profiles: ToolDefinition = {\n name: \"list_tool_profiles\",\n description:\n \"List all available tool profiles that can be activated using manage_tools. \" +\n \"Returns a list of profiles with their IDs, names, and the tools they contain.\",\n input_schema: {\n type: \"object\",\n properties: {},\n },\n};\n","import type { ToolDefinition } from \"./types.js\";\n\nexport const update_memory: ToolDefinition = {\n name: \"update_memory\",\n description:\n \"Update the MEMORY.md memory file for this group. \" +\n \"Use this to persist important context, user preferences, project state, \" +\n \"and anything the agent should remember across conversations. \" +\n \"This file is loaded as system context on every invocation.\",\n input_schema: {\n type: \"object\",\n properties: {\n content: {\n type: \"string\",\n description: \"New content for the MEMORY.md memory file\",\n },\n },\n required: [\"content\"],\n },\n};\n","import type { ToolDefinition } from \"./types.js\";\n\nexport const show_toast: ToolDefinition = {\n name: \"show_toast\",\n description:\n \"Show a toast notification to the user. \" +\n \"Toasts are non-blocking, auto-dismissing notifications that appear in the bottom-right corner. \" +\n \"Use for: operation status (success/failure), warnings, informational messages, progress updates. \" +\n \"Avoid for: critical errors requiring acknowledgment (use clear error messages instead), \" +\n \"lengthy content (keep messages concise).\",\n input_schema: {\n type: \"object\",\n properties: {\n message: {\n type: \"string\",\n description: \"The message to display in the toast (keep concise)\",\n },\n type: {\n type: \"string\",\n description:\n \"Type of toast: 'success', 'error', 'warning', or 'info' (default: 'info')\",\n enum: [\"success\", \"error\", \"warning\", \"info\"],\n },\n duration: {\n type: \"number\",\n description:\n \"Auto-dismiss duration in milliseconds (default: 5000 for info/success, 8000 for warning/error). Set to 0 to disable auto-dismiss.\",\n },\n },\n required: [\"message\"],\n },\n};\n\nexport const send_notification: ToolDefinition = {\n name: \"send_notification\",\n description:\n \"Send an OS-level push notification to the user via Web Push. \" +\n \"Unlike toasts (in-app only), push notifications appear even when the app is not focused or the tab is in the background. \" +\n \"Use for: important alerts, long-running task completion, time-sensitive information. \" +\n \"Requires the user to have enabled push notifications in Settings.\",\n input_schema: {\n type: \"object\",\n properties: {\n title: {\n type: \"string\",\n description: \"Notification title (default: 'ShadowClaw')\",\n },\n body: {\n type: \"string\",\n description: \"The notification body text\",\n },\n },\n required: [\"body\"],\n },\n};\n","/**\n * A2UI v1.0 — Spec-Compliant Type Definitions\n *\n * This module provides:\n * - TypeScript types that mirror the A2UI v1.0 Basic catalog.\n * - Surface envelope and action message types (spec wire format).\n * - Runtime helpers for resolving dynamic values and updating data models.\n *\n * Spec reference: https://a2ui.org/specification/v1_0/docs/a2ui_protocol.md\n *\n * Design notes:\n * - Only the official Basic catalog exists in the v1.0 spec.\n * The \"Minimal\" catalog URL was a proprietary construct and has been removed.\n * - `components` in envelopes is a flat array (spec §updateComponents), each\n * with an embedded `id`. Internally, SurfaceState normalises to a map.\n * - Data binding uses `{ \"path\": \"/key\" }` (spec §DynamicString). The legacy\n * `{ \"$dataModel\": \"/key\" }` form is still resolved for backward compatibility\n * but is deprecated and should not be used in new code.\n * - `updateDataModel` uses a single `path` + `value` pair (spec §updateDataModel).\n * The former `patches` map was a non-standard extension and has been removed.\n * - The root component must have `id: \"root\"` (spec §ComponentsList).\n * The `rootComponentId` wire field has been removed.\n */\n\n// ---------------------------------------------------------------------------\n// Catalog identifiers\n// ---------------------------------------------------------------------------\n\n/**\n * The official A2UI v1.0 Basic catalog.\n * @see https://a2ui.org/specification/v1_0/catalogs/basic/catalog.json\n */\nexport const A2UI_BASIC_CATALOG_ID =\n \"https://a2ui.org/specification/v1_0/catalogs/basic/catalog.json\";\n\n/**\n * Catalog identifiers shipped with ShadowClaw.\n * Currently only the official Basic catalog is available.\n *\n * Future ShadowClaw-specific catalogs should be added here alongside their\n * dedicated `A2UI_SHADOWCLAW_*_CATALOG_ID` constants so the renderer and\n * tooling can enumerate them automatically.\n */\nexport const A2UI_AVAILABLE_CATALOGS = [A2UI_BASIC_CATALOG_ID] as const;\n\n/**\n * A valid catalog identifier accepted by this renderer.\n *\n * The type is intentionally `string` (not a strict union of `A2UI_AVAILABLE_CATALOGS`)\n * to allow third-party and future ShadowClaw-specific catalog URLs to be used\n * without requiring a TypeScript change. Use the named constants (e.g.\n * `A2UI_BASIC_CATALOG_ID`) for known catalogs.\n */\nexport type A2UICatalogId = string;\n\n// ---------------------------------------------------------------------------\n// Human-readable catalog reference (returned by the list_components tool)\n// ---------------------------------------------------------------------------\n\n/**\n * Human-readable reference for the A2UI Basic catalog.\n * This text is shown to the agent when it calls list_components.\n */\nexport const BASIC_CATALOG_REFERENCE = `A2UI Basic Catalog — Component & Function Reference\n=====================================================\n\nCatalog ID: ${A2UI_BASIC_CATALOG_ID}\n\nCRITICAL AUTHORING RULES\n-------------------------\n1. Put ALL properties at the TOP LEVEL of each component object alongside \"component\" and \"id\".\n WRONG: {\"id\":\"t\",\"component\":\"Text\",\"properties\":{\"text\":\"Hello\"}}\n RIGHT: {\"id\":\"t\",\"component\":\"Text\",\"text\":\"Hello\"}\n\n2. \"components\" is a FLAT ARRAY of objects, each with a required \"id\" field.\n The root of the component tree MUST have id \"root\".\n WRONG: {\"root\": {\"component\":\"Column\",\"children\":[\"title\"]}}\n RIGHT: [{\"id\":\"root\",\"component\":\"Column\",\"children\":[\"title\"]},{\"id\":\"title\",\"component\":\"Text\",\"text\":\"Hello\"}]\n\n3. To make a property UPDATABLE later via the \"updateDataModel\" action, bind it\n using {\"path\": \"/your_key\"} and initialise that key in the dataModel.\n STATIC (never changes): {\"id\":\"t\",\"component\":\"Text\",\"text\":\"Result will appear here\"}\n DYNAMIC (updatable): {\"id\":\"t\",\"component\":\"Text\",\"text\":{\"path\":\"/result\"}}\n\n4. \"children\" and \"child\" contain COMPONENT ID STRINGS, not nested objects.\n WRONG: {\"id\":\"col\",\"component\":\"Column\",\"children\":[{\"component\":\"Text\",\"text\":\"Hi\"}]}\n RIGHT: [{\"id\":\"col\",\"component\":\"Column\",\"children\":[\"hi\"]},{\"id\":\"hi\",\"component\":\"Text\",\"text\":\"Hi\"}]\n\n5. Button \"child\" must be the id of a Text component in the same components array.\n Button \"action\" must be {\"event\":{\"name\":\"myActionId\"}}.\n\n6. Use updateDataModel with a single path and value per call:\n action: \"updateDataModel\", surfaceId: \"s\", path: \"/result\", value: \"done!\"\n To update multiple fields, call render_component once per field.\n\n7. To concatenate or inject data bindings into strings, use formatString:\n {\"call\":\"formatString\",\"args\":{\"value\":\"Hello \\${/user/name}\"}}\n\nComponents\n----------\nText — text (string or {\"path\":\"/key\"}, required), variant? (\"caption\"|\"body\")\nRow — children (string[] or template {\"path\":\"/list\",\"componentId\":\"tmpl\"}, required), justify?, align?\nColumn — children (string[] or template, required), justify?, align?\nButton — child (string, required — id of a Text or Icon component),\n action ({\"event\":{\"name\":\"myActionId\"}}, required), variant? (\"default\"|\"primary\"|\"borderless\")\nTextField — label (required), value? ({\"path\":\"/key\"}), placeholder?,\n variant? (\"shortText\"|\"longText\"|\"number\"|\"obscured\")\nImage — url (required), description?, fit?, variant?\nIcon — name (required; enum string, {\"svgPath\":\"...\"}, or {\"path\":\"/key\"})\nVideo — url (required), posterUrl?\nAudioPlayer — url (required), description?\nList — children (string[] or template, required), direction?, align?\nCard — child (required; component id string)\nTabs — tabs[] (each: {title, child}, required)\nModal — trigger (component id, required), content (component id, required)\nDivider — axis? (\"horizontal\"|\"vertical\")\nCheckBox — label (required), value ({\"path\":\"/key\"} or boolean, required)\nChoicePicker — label?, variant? (\"mutuallyExclusive\"|\"multipleSelection\"),\n options[] (each: {label, value}, required), value ({\"path\":\"/key\"}, required),\n displayStyle? (\"checkbox\"|\"chips\"), filterable?\nSlider — max (required), value ({\"path\":\"/key\"} or number, required), label?, min?, steps?\nDateTimeInput — value (required; {\"path\":\"/key\"} or ISO 8601 string), enableDate?, enableTime?,\n min?, max?, label?\n\nFunctions (data binding & validation)\n---------------------------------------\nformatString(value) — string interpolation: {\"call\":\"formatString\",\"args\":{\"value\":\"Hi \\${/name}\"}}\nformatNumber(value,decimals?,grouping?) — number formatting\nformatCurrency(value,currency,decimals?,grouping?) — currency formatting\nformatDate(value,format) — date formatting using Unicode TR35 patterns\npluralize(value,one,other,...) — CLDR plural-aware string selection\nopenUrl(url) — open a URL (action function, no return value)\nrequired(value) — validation: checks value is not empty\nregex(value,pattern) — validation: checks value matches regex\nlength(value,min?,max?) — validation: checks string length\nnumeric(value,min?,max?) — validation: checks number range\nemail(value) — validation: checks value is a valid email\nand(values[]) — logical AND of boolean values\nor(values[]) — logical OR of boolean values\nnot(value) — logical NOT of a boolean value\n\nNOTE: ShadowClaw additionally supports \"capitalize\" as an extension function\n(not in the official spec): {\"call\":\"capitalize\",\"args\":{\"value\":{\"path\":\"/name\"}}}\n\nValidator / boolean functions evaluate to boolean and are used in \"checks\" rules;\nthey do not produce a displayable string.\n\nExample (correct — createSurface)\n----------------------------------\naction: \"createSurface\"\nsurfaceId: \"my-surface\"\ncomponents: [\n {\"id\":\"root\", \"component\":\"Column\",\"children\":[\"title\",\"btn\"]},\n {\"id\":\"title\", \"component\":\"Text\",\"text\":\"Hello World\",\"variant\":\"body\"},\n {\"id\":\"btn_lbl\", \"component\":\"Text\",\"text\":\"Click Me\"},\n {\"id\":\"btn\", \"component\":\"Button\",\"child\":\"btn_lbl\",\"action\":{\"event\":{\"name\":\"submit\"}},\"variant\":\"primary\"}\n]\n\nExample (updateDataModel)\n--------------------------\naction: \"updateDataModel\"\nsurfaceId: \"my-surface\"\npath: \"/result\"\nvalue: \"done!\"\n`;\n\n// ---------------------------------------------------------------------------\n// Dynamic values (data binding)\n// ---------------------------------------------------------------------------\n\n/** Literal string value. */\nexport type StaticString = string;\n\n/**\n * Spec-canonical data binding reference: { \"path\": \"/json/pointer\" }\n *\n * This is the form defined in the A2UI v1.0 spec §DynamicString.\n * Use this in all new code.\n */\nexport interface PathRef {\n path: string;\n}\n\n/**\n * Legacy data binding reference: { \"$dataModel\": \"/json/pointer\" }\n *\n * @deprecated Use {@link PathRef} (`{ \"path\": \"/key\" }`) instead.\n * This form is not in the A2UI v1.0 spec and is kept only for backward\n * compatibility with existing surfaces. The runtime resolver handles both.\n */\nexport interface DataModelRef {\n $dataModel: string;\n}\n\n// ---------------------------------------------------------------------------\n// Function call types (A2UI v1.0 Basic catalog §functions)\n// ---------------------------------------------------------------------------\n\nexport interface CapitalizeCall {\n call: \"capitalize\";\n args: { value: DynamicString };\n}\n\n/** Interpolates ${/pointer} placeholders in a template string. */\nexport interface FormatStringCall {\n call: \"formatString\";\n args: { value: DynamicString };\n}\n\nexport interface FormatNumberCall {\n call: \"formatNumber\";\n args: {\n value: DynamicNumber;\n decimals?: DynamicNumber;\n grouping?: DynamicBoolean;\n };\n}\n\nexport interface FormatCurrencyCall {\n call: \"formatCurrency\";\n args: {\n value: DynamicNumber;\n currency: DynamicString;\n decimals?: DynamicNumber;\n grouping?: DynamicBoolean;\n };\n}\n\n/** format: Unicode TR35 date/time pattern string */\nexport interface FormatDateCall {\n call: \"formatDate\";\n args: { value: DynamicString; format: DynamicString };\n}\n\n/** CLDR plural-aware string selection. */\nexport interface PluralizeCall {\n call: \"pluralize\";\n args: {\n value: DynamicNumber;\n one: DynamicString;\n other: DynamicString;\n [cldrKey: string]: unknown;\n };\n}\n\n/** Opens a URL in the browser. Action-only; no return value. */\nexport interface OpenUrlCall {\n call: \"openUrl\";\n args: { url: DynamicString };\n}\n\n// --- Boolean combinators ---\nexport interface AndCall {\n call: \"and\";\n args: { values: DynamicBoolean[] };\n}\nexport interface OrCall {\n call: \"or\";\n args: { values: DynamicBoolean[] };\n}\nexport interface NotCall {\n call: \"not\";\n args: { value: DynamicBoolean };\n}\n\n// --- Validation / check functions ---\nexport interface RequiredCall {\n call: \"required\";\n args: { value: DynamicString };\n}\nexport interface RegexCall {\n call: \"regex\";\n args: { value: DynamicString; pattern: DynamicString };\n}\nexport interface LengthCall {\n call: \"length\";\n args: { value: DynamicString; min?: DynamicNumber; max?: DynamicNumber };\n}\nexport interface NumericCall {\n call: \"numeric\";\n args: { value: DynamicNumber; min?: DynamicNumber; max?: DynamicNumber };\n}\nexport interface EmailCall {\n call: \"email\";\n args: { value: DynamicString };\n}\n\n/** Union of all supported function call expressions. */\nexport type FunctionCall =\n | CapitalizeCall\n | FormatStringCall\n | FormatNumberCall\n | FormatCurrencyCall\n | FormatDateCall\n | PluralizeCall\n | OpenUrlCall\n | AndCall\n | OrCall\n | NotCall\n | RequiredCall\n | RegexCall\n | LengthCall\n | NumericCall\n | EmailCall;\n\n/**\n * A value that may be resolved dynamically at render time.\n *\n * Canonical forms (A2UI v1.0 spec):\n * - Literal string: `\"Hello\"`\n * - Path reference: `{ \"path\": \"/user/name\" }`\n * - Function call: `{ \"call\": \"formatString\", \"args\": { \"value\": \"Hi ${/name}\" } }`\n *\n * Deprecated form (kept for backward compatibility):\n * - `{ \"$dataModel\": \"/key\" }` — resolved by the runtime but not spec-compliant.\n */\nexport type DynamicString =\n | StaticString\n | PathRef\n | DataModelRef\n | FunctionCall;\n\n/**\n * A boolean that may be resolved dynamically at render time.\n */\nexport type DynamicBoolean = boolean | PathRef | DataModelRef | FunctionCall;\n\n/**\n * A number that may be resolved dynamically at render time.\n */\nexport type DynamicNumber = number | PathRef | DataModelRef;\n\n/**\n * A string list that may be resolved dynamically at render time.\n */\nexport type DynamicStringList = string[] | PathRef | DataModelRef;\n\n// ---------------------------------------------------------------------------\n// Shared component fields\n// ---------------------------------------------------------------------------\n\n/**\n * Fields shared by all component specifications.\n * Every component in the `components` array MUST have an `id`.\n * One component MUST have `id: \"root\"` to serve as the tree root (spec §179).\n */\nexport interface ComponentCommon {\n id: string;\n weight?: number;\n}\n\n/**\n * Fields shared by checkable components.\n */\nexport interface CheckableComponent {\n checked?: DynamicBoolean;\n}\n\n// ---------------------------------------------------------------------------\n// Component specifications (Basic catalog — the only official v1.0 catalog)\n// ---------------------------------------------------------------------------\n\n/**\n * Children of a layout component.\n *\n * Can be:\n * - A fixed array of component IDs: `[\"header\", \"body\", \"footer\"]`\n * - A template that generates children from a data model list:\n * `{ \"path\": \"/items\", \"componentId\": \"item_template\" }`\n * (spec §ChildList / §DataDrivenChildren)\n */\nexport type ChildList = string[] | { path: string; componentId: string };\n\n/**\n * Text display variants.\n *\n * Spec-official values: `\"caption\"` | `\"body\"`\n *\n * ShadowClaw extension values (not in spec, but rendered by the client):\n * `\"h1\"` | `\"h2\"` | `\"h3\"` | `\"h4\"` | `\"h5\"`\n *\n * LLMs have been trained on the extension values and they render correctly.\n * When targeting maximum spec compliance, prefer `\"body\"` or `\"caption\"`.\n */\nexport type TextVariant =\n | \"caption\"\n | \"body\"\n // ShadowClaw extensions (not in official spec)\n | \"h1\"\n | \"h2\"\n | \"h3\"\n | \"h4\"\n | \"h5\";\n\nexport interface TextSpec extends ComponentCommon {\n component: \"Text\";\n text: DynamicString;\n variant?: TextVariant;\n}\n\nexport type JustifyValue =\n | \"start\"\n | \"center\"\n | \"end\"\n | \"spaceBetween\"\n | \"spaceAround\"\n | \"spaceEvenly\"\n | \"stretch\";\n\nexport type AlignValue = \"start\" | \"center\" | \"end\" | \"stretch\";\n\nexport interface RowSpec extends ComponentCommon {\n component: \"Row\";\n children: ChildList;\n justify?: JustifyValue;\n align?: AlignValue;\n}\n\nexport interface ColumnSpec extends ComponentCommon {\n component: \"Column\";\n children: ChildList;\n justify?: JustifyValue;\n align?: AlignValue;\n}\n\nexport type ButtonVariant = \"default\" | \"primary\" | \"secondary\" | \"borderless\";\n\n/**\n * A2UI v1.0 spec §actions: server action event sent when a button is clicked.\n */\nexport interface A2UIActionEvent {\n /** The event name routed back to the agent. */\n name: string;\n /**\n * Optional static context attached to the action.\n * Use this to pass per-button metadata without polluting the data model.\n */\n context?: Record<string, unknown>;\n /**\n * If true the agent is expected to respond with an `actionResponse`.\n * Not yet implemented by this renderer.\n */\n wantResponse?: boolean;\n /** Unique identifier for correlating `actionResponse` messages. */\n actionId?: string;\n /** JSON Pointer path in the local data model to store the response value. */\n responsePath?: string;\n}\n\n/**\n * Action descriptor attached to interactive components (Button, CheckBox, …).\n *\n * Spec-compliant form:\n * ```json\n * { \"event\": { \"name\": \"submit_form\" } }\n * ```\n *\n * The legacy `id` field is kept for backward compatibility — the renderer\n * will fall back to it when `event.name` is not present — but new surfaces\n * should use `event.name`.\n */\nexport interface A2UIActionDescriptor {\n /** Spec-compliant server action event. */\n event?: A2UIActionEvent;\n /**\n * @deprecated Use `event.name` instead.\n * Kept for backward compatibility with surfaces created before the v1.0\n * conformance fix.\n */\n id?: string;\n /** @deprecated Not used. Previously listed data-model keys to include. */\n data?: string[];\n}\n\nexport interface ButtonSpec extends ComponentCommon, CheckableComponent {\n component: \"Button\";\n child: string;\n action: A2UIActionDescriptor;\n variant?: ButtonVariant;\n}\n\nexport type TextFieldVariant = \"shortText\" | \"longText\" | \"number\" | \"obscured\";\n\n// ---------------------------------------------------------------------------\n// Checks / validation (spec §checks)\n// ---------------------------------------------------------------------------\n\n/**\n * A single validation rule applied to an input component.\n * Spec §checks — evaluated before the action fires.\n */\nexport interface CheckRule {\n /** The validation function call (e.g. required, regex, email, length, numeric). */\n rule: FunctionCall;\n /** Error message shown to the user when the rule fails. */\n errorMessage: DynamicString;\n}\n\nexport interface TextFieldSpec extends ComponentCommon, CheckableComponent {\n component: \"TextField\";\n label: DynamicString;\n value?: DynamicString;\n placeholder?: DynamicString;\n variant?: TextFieldVariant;\n /** Validation rules evaluated before dispatching an action (spec §checks). */\n checks?: CheckRule[];\n /** @deprecated Use `checks` with a `regex` rule instead. */\n validationRegexp?: string;\n}\n\nexport interface ImageSpec extends ComponentCommon {\n component: \"Image\";\n url: DynamicString;\n description?: DynamicString;\n fit?: \"contain\" | \"cover\" | \"fill\" | \"none\" | \"scaleDown\";\n variant?:\n | \"icon\"\n | \"avatar\"\n | \"smallFeature\"\n | \"mediumFeature\"\n | \"largeFeature\"\n | \"header\";\n}\n\nexport interface IconSpec extends ComponentCommon {\n component: \"Icon\";\n name: string | PathRef;\n}\n\nexport interface VideoSpec extends ComponentCommon {\n component: \"Video\";\n url: DynamicString;\n posterUrl?: DynamicString;\n}\n\nexport interface AudioPlayerSpec extends ComponentCommon {\n component: \"AudioPlayer\";\n url: DynamicString;\n description?: DynamicString;\n}\n\nexport interface ListSpec extends ComponentCommon {\n component: \"List\";\n children: ChildList;\n direction?: \"vertical\" | \"horizontal\";\n align?: AlignValue;\n}\n\nexport interface CardSpec extends ComponentCommon {\n component: \"Card\";\n child: string;\n}\n\nexport interface TabsSpec extends ComponentCommon {\n component: \"Tabs\";\n tabs: { title: DynamicString; child: string }[];\n}\n\nexport interface ModalSpec extends ComponentCommon {\n component: \"Modal\";\n trigger: string;\n content: string;\n}\n\nexport interface DividerSpec extends ComponentCommon {\n component: \"Divider\";\n axis?: \"horizontal\" | \"vertical\";\n}\n\nexport interface CheckBoxSpec extends ComponentCommon, CheckableComponent {\n component: \"CheckBox\";\n label: DynamicString;\n value: DynamicBoolean;\n action?: A2UIActionDescriptor;\n}\n\nexport interface ChoicePickerOption {\n label: DynamicString;\n value: string;\n}\n\nexport interface ChoicePickerSpec extends ComponentCommon, CheckableComponent {\n component: \"ChoicePicker\";\n label?: DynamicString;\n variant?: \"multipleSelection\" | \"mutuallyExclusive\";\n options: ChoicePickerOption[];\n value: DynamicStringList;\n displayStyle?: \"checkbox\" | \"chips\";\n filterable?: boolean;\n}\n\nexport interface SliderSpec extends ComponentCommon, CheckableComponent {\n component: \"Slider\";\n label?: DynamicString;\n min?: number;\n max?: number;\n value: DynamicNumber;\n steps?: number;\n}\n\nexport interface DateTimeInputSpec extends ComponentCommon, CheckableComponent {\n component: \"DateTimeInput\";\n value?: DynamicString;\n enableDate?: boolean;\n enableTime?: boolean;\n min?: DynamicString;\n max?: DynamicString;\n label?: DynamicString;\n}\n\n/** Union of all supported A2UI Basic catalog components. */\nexport type A2UIComponentSpec =\n | TextSpec\n | RowSpec\n | ColumnSpec\n | ButtonSpec\n | TextFieldSpec\n | ImageSpec\n | IconSpec\n | VideoSpec\n | AudioPlayerSpec\n | ListSpec\n | CardSpec\n | TabsSpec\n | ModalSpec\n | DividerSpec\n | CheckBoxSpec\n | ChoicePickerSpec\n | SliderSpec\n | DateTimeInputSpec;\n\n// ---------------------------------------------------------------------------\n// Surface envelope types (A2UI v1.0 wire format)\n// ---------------------------------------------------------------------------\n\n/**\n * Server → Client: create a new surface.\n *\n * Spec §createSurface. The `components` array MUST contain one component with\n * `id: \"root\"` which serves as the root of the component tree.\n */\nexport interface A2UICreateSurface {\n /**\n * Protocol version. Must be `\"v1.0\"` for spec-compliant messages.\n * Optional to preserve backward compatibility with pre-conformance surfaces.\n */\n version?: \"v1.0\";\n type: \"createSurface\";\n surfaceId: string;\n catalogId: A2UICatalogId;\n /**\n * Flat array of component objects. The component with `id: \"root\"` is the\n * tree root. Relationships are expressed by ID references in `children`/`child`.\n */\n components: A2UIComponentSpec[];\n dataModel?: Record<string, unknown>;\n /**\n * If true, the client will include the full data model as metadata on every\n * outbound action message (spec §sendDataModel).\n */\n sendDataModel?: boolean;\n /** Display / branding properties for this surface (spec §surfaceProperties). */\n surfaceProperties?: Record<string, unknown>;\n}\n\n/**\n * Server → Client: add or replace components on an existing surface.\n *\n * Spec §updateComponents. Components are provided as a flat array.\n */\nexport interface A2UIUpdateComponents {\n /** Protocol version. Optional for backward compatibility. */\n version?: \"v1.0\";\n type: \"updateComponents\";\n surfaceId: string;\n components: A2UIComponentSpec[];\n}\n\n/**\n * Server → Client: update the data model at a specific path.\n *\n * Spec §updateDataModel. Replaces the value at `path` with `value`.\n * If `path` is omitted or `\"/\"`, the entire data model is replaced.\n * If `value` is omitted, the key at `path` is deleted.\n */\nexport interface A2UIUpdateDataModel {\n /** Protocol version. Optional for backward compatibility. */\n version?: \"v1.0\";\n type: \"updateDataModel\";\n surfaceId: string;\n /** JSON Pointer (RFC 6901). Defaults to `\"/\"` (replace entire model). */\n path?: string;\n value?: unknown;\n}\n\n/**\n * Server → Client: destroy a surface.\n */\nexport interface A2UIDeleteSurface {\n /** Protocol version. Optional for backward compatibility. */\n version?: \"v1.0\";\n type: \"deleteSurface\";\n surfaceId: string;\n}\n\n/**\n * Server → Client: invoke a renderer-side function.\n *\n * Spec §callFunction. The renderer evaluates the function and responds with\n * a `functionResponse` envelope. This enables server-triggered hardware\n * queries, async data fetches, or other client-side computations.\n */\nexport interface A2UICallFunction {\n version?: \"v1.0\";\n type: \"callFunction\";\n surfaceId: string;\n /** Unique call identifier used to correlate the response. */\n callId: string;\n /** The function call to evaluate on the client. */\n call: FunctionCall;\n}\n\n/**\n * Client → Server: result of a `callFunction` invocation.\n *\n * Spec §functionResponse.\n */\nexport interface A2UIFunctionResponse {\n version?: \"v1.0\";\n type: \"functionResponse\";\n surfaceId: string;\n callId: string;\n value: unknown;\n /** Set when the function evaluation failed. */\n error?: string;\n}\n\n/**\n * Server → Client: response to a `wantResponse` action.\n *\n * Spec §actionResponse. Delivered after the agent processes an action that\n * had `wantResponse: true`. The `responsePath` in the original action event\n * specifies where in the data model to store the response value.\n */\nexport interface A2UIActionResponse {\n version?: \"v1.0\";\n type: \"actionResponse\";\n surfaceId: string;\n /** Matches `A2UIActionEvent.actionId` of the triggering action. */\n actionId: string;\n value: unknown;\n /** JSON Pointer path where the renderer should store the response value. */\n responsePath?: string;\n}\n\nexport type A2UIEnvelope =\n | A2UICreateSurface\n | A2UIUpdateComponents\n | A2UIUpdateDataModel\n | A2UIDeleteSurface\n | A2UICallFunction\n | A2UIActionResponse;\n\n// ---------------------------------------------------------------------------\n// Client → Server messages\n// ---------------------------------------------------------------------------\n\n/**\n * Client → Server: user interaction event fired from a surface.\n *\n * Spec §action. `name` is the event name declared in the component's\n * `action.event.name`. The full current `dataModel` is included so the\n * agent always has the latest form state.\n */\nexport interface A2UIAction {\n type: \"a2ui-action\";\n surfaceId: string;\n /** The event name from the component's `action.event.name`. */\n actionId: string;\n dataModel: Record<string, unknown>;\n}\n\n// ---------------------------------------------------------------------------\n// Transport wrappers (transport-agnostic)\n// ---------------------------------------------------------------------------\n\nexport interface A2UIWirePart {\n kind: \"a2ui\";\n envelope: A2UIEnvelope;\n}\n\nexport interface A2UIActionWirePart {\n kind: \"a2ui-action\";\n action: A2UIAction;\n}\n\nexport interface A2UIFunctionResponseWirePart {\n kind: \"a2ui-function-response\";\n response: A2UIFunctionResponse;\n}\n\n// ---------------------------------------------------------------------------\n// Client capabilities negotiation (spec §a2uiClientCapabilities)\n// ---------------------------------------------------------------------------\n\n/**\n * Advertised by the renderer to inform the agent which optional spec features\n * are supported. Sent as part of the initial handshake or Agent Card metadata.\n *\n * Spec §a2uiClientCapabilities.\n */\nexport interface A2UIClientCapabilities {\n /** Protocol version(s) the renderer supports. */\n versions: string[];\n /**\n * Catalog IDs the renderer has loaded.\n * Always includes the Basic catalog; may include additional catalogs.\n */\n catalogs: string[];\n /** Whether the renderer supports `callFunction` / `functionResponse`. */\n supportsCallFunction?: boolean;\n /** Whether the renderer supports the `checks` validation system. */\n supportsChecks?: boolean;\n /** Whether the renderer supports `@index` in data-driven children. */\n supportsIndexBuiltin?: boolean;\n /** Whether the renderer supports `actionResponse` envelopes. */\n supportsActionResponse?: boolean;\n /** Whether the renderer sends `sendDataModel` metadata on every action. */\n supportsSendDataModel?: boolean;\n}\n","import type { ToolDefinition } from \"./types.js\";\n\nimport {\n A2UI_AVAILABLE_CATALOGS,\n A2UI_BASIC_CATALOG_ID,\n} from \"../../ui/a2ui/types.js\";\n\nexport const availableCatalogs = {\n basic: A2UI_BASIC_CATALOG_ID,\n all: A2UI_AVAILABLE_CATALOGS,\n};\n\nexport const list_components: ToolDefinition = {\n name: \"list_components\",\n description:\n \"List all available A2UI v1.0 Basic catalog components and their schemas. \" +\n \"Returns a human-readable reference of component types, their required/optional properties, \" +\n \"data binding syntax, and examples. Call this before render_component to understand \" +\n \"what components are available and how to structure the input correctly.\",\n input_schema: {\n type: \"object\",\n properties: {},\n required: [],\n },\n};\n\nexport const render_component: ToolDefinition = {\n name: \"render_component\",\n description:\n \"Render an interactive A2UI v1.0 UI surface in the peer's chat window using the Basic catalog. \" +\n \"The surface appears inline in the conversation on the remote peer's side (or locally if no peer). \" +\n \"Components: Text, Row, Column, Button, TextField, Image, Icon, Video, AudioPlayer, \" +\n \"List, Card, Tabs, Modal, Divider, CheckBox, ChoicePicker, Slider, DateTimeInput. \" +\n \"Use list_components first to understand available components and their schemas. \" +\n \"All user input (button clicks, form field changes) automatically routes back to the agent. \" +\n \"For media components (Image/Video/AudioPlayer), use workspace file paths (e.g. 'song.mp3') or HTTPS URLs. \" +\n \"\\n\\nactions:\\n\" +\n \" createSurface — render a new surface (requires components array with a root component)\\n\" +\n \" updateComponents — add or replace components on an existing surface\\n\" +\n \" updateDataModel — update a single path in the data model (re-renders bound components)\\n\" +\n \" deleteSurface — remove the surface from the chat\",\n input_schema: {\n type: \"object\",\n properties: {\n action: {\n type: \"string\",\n enum: [\n \"createSurface\",\n \"updateComponents\",\n \"updateDataModel\",\n \"deleteSurface\",\n ],\n description: \"The A2UI operation to perform\",\n },\n surfaceId: {\n type: \"string\",\n description:\n \"Unique identifier for this surface. Use a stable ID so you can update it later.\",\n },\n components: {\n type: \"array\",\n description:\n \"Flat array of component objects (required for createSurface/updateComponents). \" +\n \"Each object MUST have an 'id' field and a 'component' field. \" +\n \"The component with id 'root' is the tree root (required for createSurface). \" +\n \"Component field values: Text | Row | Column | Button | TextField | Image | Icon | Video | AudioPlayer | \" +\n \"List | Card | Tabs | Modal | Divider | CheckBox | ChoicePicker | Slider | DateTimeInput. \" +\n \"Put all properties at the TOP LEVEL alongside 'component' and 'id'. \" +\n \"DO NOT nest properties under a 'properties' key. \" +\n \"Children arrays contain other component ID strings, not nested objects.\",\n items: {\n type: \"object\",\n additionalProperties: true,\n },\n },\n dataModel: {\n type: \"object\",\n description:\n \"Initial data model for the surface (used with createSurface). \" +\n 'Components can reference values via { \"path\": \"/key\" }.',\n additionalProperties: true,\n },\n path: {\n type: \"string\",\n description:\n \"JSON Pointer path to update (required for updateDataModel). \" +\n 'Examples: \"/result\", \"/user/name\", \"/count\". ' +\n 'Use \"/\" to replace the entire data model.',\n },\n value: {\n description:\n \"New value to set at the specified path (used with updateDataModel). \" +\n \"Omit to delete the key at the given path.\",\n },\n surfaceProperties: {\n type: \"object\",\n description:\n \"Optional display/branding properties for this surface (e.g. agentDisplayName).\",\n additionalProperties: true,\n },\n },\n required: [\"action\", \"surfaceId\"],\n },\n};\n","import type { ToolDefinition } from \"./types.js\";\n\nexport const spawn_subagent: ToolDefinition = {\n name: \"spawn_subagent\",\n description:\n \"Spawn one or more independent agent loops to work on subtasks in parallel and collect their results. \" +\n \"Each subagent has its own tool-use loop, inherits the current API key, and can optionally override provider/model. \" +\n \"and runs concurrently with other subagents via Promise.all. \" +\n \"Use spawn_subagent when a task has independent parallel workstreams — for example: \" +\n \"researching multiple topics simultaneously, processing a list of items in parallel, \" +\n \"or delegating isolated subtasks to specialized agents. \" +\n \"Do NOT use spawn_subagent for sequential tasks where step 2 depends on step 1's output — \" +\n \"just do those steps directly. \" +\n \"Do NOT use spawn_subagent for simple single-step work that takes one tool call. \" +\n \"Use the parallel_agents field to fan out multiple subagents in a single call.\",\n input_schema: {\n type: \"object\",\n properties: {\n prompt: {\n type: \"string\",\n description:\n \"The task prompt for a single subagent. Required unless using parallel_agents for multi-agent fan-out.\",\n },\n tools: {\n type: \"array\",\n description:\n \"Optional list of tool names to allow in the subagent. \" +\n \"If omitted, the subagent inherits the current tool set (minus spawn_subagent to prevent recursion). \" +\n \"If provided, only these tools are available to the subagent.\",\n items: { type: \"string\" },\n },\n profile: {\n type: \"string\",\n enum: [\"current\", \"fast\", \"smart\", \"powerful\"],\n description:\n \"Optional model profile to run the subagent on. Use 'fast' for simple/cheap subtasks (e.g., text formatting, basic search), 'smart' for moderate reasoning, 'powerful' for deep thinking or complex coding, and 'current' to inherit the parent model. Defaults to 'current'.\",\n },\n workspace_group_id: {\n type: \"string\",\n description:\n \"Optional workspace group id override for subagent file/tool scope. \" +\n \"Use 'parent' to reuse the parent workspace in automatic mode. \" +\n \"When omitted, subagents use an isolated workspace by default.\",\n },\n system_prompt: {\n type: \"string\",\n description:\n \"Optional system prompt override for the subagent. Defaults to the current system prompt.\",\n },\n parallel_agents: {\n type: \"array\",\n description:\n \"Optional list of subagent specifications to run in parallel. \" +\n \"When provided, all agents are launched concurrently and their results are combined. \" +\n \"Note: There is a configurable maximum limit on parallel subagents (default 5). \" +\n \"Each entry can specify a prompt, optional tools list, optional profile, and optional system_prompt.\",\n items: {\n type: \"object\",\n properties: {\n prompt: {\n type: \"string\",\n description: \"The task prompt for this subagent.\",\n },\n tools: {\n type: \"array\",\n description: \"Optional tool names for this subagent.\",\n items: { type: \"string\" },\n },\n profile: {\n type: \"string\",\n enum: [\"current\", \"fast\", \"smart\", \"powerful\"],\n description:\n \"Optional model profile for this subagent. Defaults to 'current'.\",\n },\n workspace_group_id: {\n type: \"string\",\n description:\n \"Optional workspace group id for this subagent. Use 'parent' for parent workspace in automatic mode.\",\n },\n system_prompt: {\n type: \"string\",\n description: \"Optional system prompt override for this subagent.\",\n },\n },\n required: [\"prompt\"],\n },\n },\n },\n required: [\"prompt\"],\n },\n};\n","import type { ToolDefinition } from \"./types.js\";\n\nexport const get_current_time: ToolDefinition = {\n name: \"get_current_time\",\n description:\n \"Get the current date and time. \" +\n \"Returns an ISO 8601 string representing the current date and time. \" +\n \"Use this tool whenever you need to know the current time, instead of relying on shell tools which may be unavailable.\",\n input_schema: {\n type: \"object\",\n properties: {\n timezone: {\n type: \"string\",\n description:\n \"Optional timezone to format the time in (e.g. 'America/New_York'). If omitted, returns UTC.\",\n },\n },\n },\n};\n","import type { ToolDefinition } from \"./types.js\";\n\nexport const attach_file_to_chat: ToolDefinition = {\n name: \"attach_file_to_chat\",\n description:\n \"Prepare a workspace file for chat delivery by generating an exact markdown attachment snippet. \" +\n \"Validates the file path and returns markdown that works for inline image rendering in ShadowClaw \" +\n \"and attachment upload in external channels like Telegram/iMessage.\",\n input_schema: {\n type: \"object\",\n properties: {\n path: {\n type: \"string\",\n description: \"File path relative to the group workspace root\",\n },\n alt: {\n type: \"string\",\n description:\n \"Optional alt/caption text to use in the generated markdown\",\n },\n },\n required: [\"path\"],\n },\n};\n\nexport const copy_file: ToolDefinition = {\n name: \"copy_file\",\n description:\n \"Copy a file or directory in the group workspace to a new destination path. \" +\n \"Supports copying single files or nested directories. Optionally supports copying between \" +\n \"different conversation workspaces via source_group_id or target_group_id.\",\n input_schema: {\n type: \"object\",\n properties: {\n source_path: {\n type: \"string\",\n description: \"Source file or directory path relative to workspace root\",\n },\n target_path: {\n type: \"string\",\n description:\n \"Destination file or directory path relative to workspace root\",\n },\n source_group_id: {\n type: \"string\",\n description:\n \"Optional source conversation group ID (defaults to current workspace)\",\n },\n target_group_id: {\n type: \"string\",\n description:\n \"Optional target conversation group ID (defaults to current workspace)\",\n },\n },\n required: [\"source_path\", \"target_path\"],\n },\n};\n\nexport const create_directory: ToolDefinition = {\n name: \"create_directory\",\n description:\n \"Create a new directory (and any missing parent directories) in the group workspace.\",\n input_schema: {\n type: \"object\",\n properties: {\n path: {\n type: \"string\",\n description: \"Directory path relative to the group workspace root\",\n },\n },\n required: [\"path\"],\n },\n};\n\nexport const delete_file: ToolDefinition = {\n name: \"delete_file\",\n description:\n \"Delete a file or directory from the group workspace. \" +\n \"If the target path is a directory, it will be recursively deleted.\",\n input_schema: {\n type: \"object\",\n properties: {\n path: {\n type: \"string\",\n description:\n \"File or directory path relative to the group workspace root\",\n },\n },\n required: [\"path\"],\n },\n};\n\nexport const diff_files: ToolDefinition = {\n name: \"diff_files\",\n description:\n \"Compare two files in the workspace and output the differences. \" +\n \"Useful for comparing generated code, checking before patching, or finding changes outside of git repositories.\",\n input_schema: {\n type: \"object\",\n properties: {\n path_a: {\n type: \"string\",\n description:\n \"Path to the first file relative to the group workspace root.\",\n },\n path_b: {\n type: \"string\",\n description:\n \"Path to the second file relative to the group workspace root.\",\n },\n },\n required: [\"path_a\", \"path_b\"],\n },\n};\n\nexport const list_files: ToolDefinition = {\n name: \"list_files\",\n description:\n \"List files and directories in the group workspace. \" +\n \"Directory names end with /. Returns sorted entries.\",\n input_schema: {\n type: \"object\",\n properties: {\n path: {\n type: \"string\",\n description:\n \"Directory path relative to workspace root (default: root)\",\n },\n },\n },\n};\n\nexport const move_file: ToolDefinition = {\n name: \"move_file\",\n description:\n \"Move or rename a file or directory in the group workspace to a target path. \" +\n \"Supports moving single files or nested directories. Optionally supports moving between \" +\n \"different conversation workspaces via source_group_id or target_group_id.\",\n input_schema: {\n type: \"object\",\n properties: {\n source_path: {\n type: \"string\",\n description: \"Source file or directory path relative to workspace root\",\n },\n target_path: {\n type: \"string\",\n description:\n \"Destination file or directory path relative to workspace root\",\n },\n source_group_id: {\n type: \"string\",\n description:\n \"Optional source conversation group ID (defaults to current workspace)\",\n },\n target_group_id: {\n type: \"string\",\n description:\n \"Optional target conversation group ID (defaults to current workspace)\",\n },\n },\n required: [\"source_path\", \"target_path\"],\n },\n};\n\nexport const open_file: ToolDefinition = {\n name: \"open_file\",\n description:\n \"Open a file from the group workspace in the UI file viewer dialog. \" +\n \"Use this only when the user explicitly asks to inspect a file visually with preview support. \" +\n \"Do not use this tool to send or attach files in chat responses.\",\n input_schema: {\n type: \"object\",\n properties: {\n path: {\n type: \"string\",\n description: \"File path relative to the group workspace root\",\n },\n },\n required: [\"path\"],\n },\n};\n\nexport const patch_file: ToolDefinition = {\n name: \"patch_file\",\n description:\n \"Make a targeted text replacement in a file. \" +\n \"Finds the single occurrence of old_string and replaces it with new_string. \" +\n \"Fails if old_string is not found or matches more than once. \" +\n \"Use this instead of write_file when you only need to change part of a file — \" +\n \"it is safer and works well with large files. \" +\n \"Include enough surrounding context in old_string to make the match unique. \" +\n \"IMPORTANT: You must provide 'path', 'old_string', and 'new_string' parameters.\",\n input_schema: {\n type: \"object\",\n properties: {\n path: {\n type: \"string\",\n description: \"File path relative to the group workspace root\",\n },\n old_string: {\n type: \"string\",\n description:\n \"The exact text to find in the file. Must match exactly once. \" +\n \"Include 2-3 lines of surrounding context to ensure a unique match.\",\n },\n new_string: {\n type: \"string\",\n description: \"The replacement text. Can be empty to delete old_string.\",\n },\n },\n required: [\"path\", \"old_string\", \"new_string\"],\n },\n};\n\nexport const read_file: ToolDefinition = {\n name: \"read_file\",\n description:\n \"Read the contents of one or more files from the group workspace. \" +\n \"IMPORTANT: You must specify either the 'path' parameter (for a single file) \" +\n \"or the 'paths' parameter (an array of file paths for multiple files). \" +\n \"When paths is provided, returns all file contents concatenated with \" +\n \"--- filename --- headers. Prefer paths to batch reads in a single call. \" +\n \"Image files (png, jpg, gif, webp, etc.) are returned as native image content \" +\n \"that the model can see directly. Other binary files will be detected and \" +\n \"an error returned suggesting alternative tools.\",\n input_schema: {\n type: \"object\",\n properties: {\n path: {\n type: \"string\",\n description: \"Single file path relative to the group workspace root\",\n },\n paths: {\n type: \"array\",\n items: { type: \"string\" },\n description:\n \"Array of file paths relative to the group workspace root. \" +\n \"Use this to read multiple files in a single tool call.\",\n },\n },\n },\n};\n\nexport const search_files: ToolDefinition = {\n name: \"search_files\",\n description:\n \"Search for a pattern (regex or exact text) in files across the workspace. \" +\n \"Useful for finding code references, function definitions, or specific content \" +\n \"without needing to rely on a shell environment.\",\n input_schema: {\n type: \"object\",\n properties: {\n pattern: {\n type: \"string\",\n description: \"The text or regular expression to search for.\",\n },\n path: {\n type: \"string\",\n description:\n \"Optional directory path to restrict the search to (e.g. 'src/'). Defaults to workspace root.\",\n },\n file_glob: {\n type: \"string\",\n description:\n \"Optional simple glob to filter files (e.g. '*.ts'). Supports * as wildcard.\",\n },\n is_regex: {\n type: \"boolean\",\n description:\n \"Set to true to parse the pattern as a regular expression.\",\n },\n },\n required: [\"pattern\"],\n },\n};\n\nexport const send_file: ToolDefinition = {\n name: \"send_file\",\n description:\n \"Send a workspace file directly to the current peer over the P2P (PeerJS/WebRTC) data channel. \" +\n \"Use this when the user is in a peer conversation and explicitly asks to send or transfer a file to their peer. \" +\n \"Do NOT use this for local-browser or non-peer conversations — it only works when the active conversation \" +\n \"is a peer: group. The file is read from the current group workspace and transferred in binary chunks \" +\n \"so there is no size limit.\",\n input_schema: {\n type: \"object\",\n properties: {\n path: {\n type: \"string\",\n description: \"File path relative to the group workspace root\",\n },\n },\n required: [\"path\"],\n },\n};\n\nexport const write_file: ToolDefinition = {\n name: \"write_file\",\n description:\n \"Write content to a file in the group workspace. \" +\n \"Creates the file and any intermediate directories if they don't exist. \" +\n \"Overwrites the file if it already exists. \" +\n \"IMPORTANT: You must provide both the 'path' and 'content' parameters when calling this tool.\",\n input_schema: {\n type: \"object\",\n properties: {\n path: {\n type: \"string\",\n description: \"File path relative to the group workspace root\",\n },\n content: {\n type: \"string\",\n description: \"Content to write to the file\",\n },\n },\n required: [\"path\", \"content\"],\n },\n};\n","import type { ToolDefinition } from \"./types.js\";\n\nexport const git_add: ToolDefinition = {\n name: \"git_add\",\n description:\n \"Stage files in a cloned repo. Accepts an array of filepaths. If omitted or empty, stages the repo root.\",\n input_schema: {\n type: \"object\",\n properties: {\n repo: {\n type: \"string\",\n description: \"Short repo name\",\n },\n filepaths: {\n type: \"array\",\n items: { type: \"string\" },\n description:\n \"Array of file paths to stage (relative to repo root). Pass a single item for one file.\",\n },\n },\n required: [\"repo\"],\n },\n};\n\nexport const git_branch: ToolDefinition = {\n name: \"git_branch\",\n description:\n \"Create a new branch in a cloned repo. \" +\n \"Optionally switch to it immediately (like git checkout -b).\",\n input_schema: {\n type: \"object\",\n properties: {\n repo: {\n type: \"string\",\n description: \"Short repo name (returned by git_clone)\",\n },\n name: {\n type: \"string\",\n description: \"Name for the new branch\",\n },\n checkout: {\n type: \"boolean\",\n description:\n \"Switch to the new branch after creating it (default: false)\",\n },\n start_point: {\n type: \"string\",\n description:\n \"Branch, tag, or commit SHA to branch from (default: HEAD)\",\n },\n },\n required: [\"repo\", \"name\"],\n },\n};\n\nexport const git_branches: ToolDefinition = {\n name: \"git_branches\",\n description:\n \"List branches in a cloned repo. Current branch is marked with *.\",\n input_schema: {\n type: \"object\",\n properties: {\n repo: {\n type: \"string\",\n description: \"Short repo name\",\n },\n remote: {\n type: \"boolean\",\n description: \"List remote-tracking branches instead (default: false)\",\n },\n },\n required: [\"repo\"],\n },\n};\n\nexport const git_checkout: ToolDefinition = {\n name: \"git_checkout\",\n description: \"Checkout a branch, tag, or commit SHA in a cloned repo.\",\n input_schema: {\n type: \"object\",\n properties: {\n repo: {\n type: \"string\",\n description: \"Short repo name (returned by git_clone)\",\n },\n ref: {\n type: \"string\",\n description: \"Branch name, tag, or commit SHA to checkout\",\n },\n },\n required: [\"repo\", \"ref\"],\n },\n};\n\nexport const git_clone: ToolDefinition = {\n name: \"git_clone\",\n description:\n \"Clone a git repository into browser-persistent OPFS storage. \" +\n \"Files are stored directly under repos/<repo-name>/ in the workspace and are \" +\n \"immediately accessible to other git_* tools without any extra sync step. \" +\n \"Works with public and private repos (GitHub, GitLab, GitHub Enterprise, etc.). \" +\n \"If a Git PAT is configured in Settings, it is used automatically for authentication. \" +\n \"Uses a CORS proxy. Returns the short repo name used for subsequent git_* operations.\",\n input_schema: {\n type: \"object\",\n properties: {\n url: {\n type: \"string\",\n description: \"Full HTTPS repo URL (e.g. https://github.com/user/repo)\",\n },\n name: {\n type: \"string\",\n description:\n \"Optional short repo name to use for the clone directory; defaults to the repository name parsed from the URL.\",\n },\n branch: {\n type: \"string\",\n description: \"Branch to clone (default: default branch)\",\n },\n depth: {\n type: \"number\",\n description: \"Shallow clone depth (default: 20)\",\n },\n },\n required: [\"url\"],\n },\n};\n\nexport const git_commit: ToolDefinition = {\n name: \"git_commit\",\n description:\n \"Stage all changes and create a commit in a cloned repo. \" +\n \"Uses configured git author name/email or defaults.\",\n input_schema: {\n type: \"object\",\n properties: {\n repo: {\n type: \"string\",\n description: \"Short repo name\",\n },\n message: {\n type: \"string\",\n description: \"Commit message\",\n },\n author_name: {\n type: \"string\",\n description: \"Author name (optional, uses configured default)\",\n },\n author_email: {\n type: \"string\",\n description: \"Author email (optional, uses configured default)\",\n },\n },\n required: [\"repo\", \"message\"],\n },\n};\n\nexport const git_config: ToolDefinition = {\n name: \"git_config\",\n description:\n \"Get or set a git config value for a repo (e.g. user.name, user.email). \" +\n \"Persistent per-repo identity avoids specifying author on every commit.\",\n input_schema: {\n type: \"object\",\n properties: {\n repo: {\n type: \"string\",\n description: \"Short repo name\",\n },\n command: {\n type: \"string\",\n enum: [\"get\", \"set\"],\n description: \"Operation: get or set a config value\",\n },\n key: {\n type: \"string\",\n description:\n \"Config key path (e.g. user.name, user.email, core.autocrlf)\",\n },\n value: {\n type: \"string\",\n description: \"Value to set — required when command is set\",\n },\n },\n required: [\"repo\", \"command\", \"key\"],\n },\n};\n\nexport const git_delete_branch: ToolDefinition = {\n name: \"git_delete_branch\",\n description: \"Delete a local branch from a cloned repo.\",\n input_schema: {\n type: \"object\",\n properties: {\n repo: {\n type: \"string\",\n description: \"Short repo name\",\n },\n name: {\n type: \"string\",\n description: \"Name of the branch to delete\",\n },\n },\n required: [\"repo\", \"name\"],\n },\n};\n\nexport const git_delete_repo: ToolDefinition = {\n name: \"git_delete_repo\",\n description:\n \"Delete the git metadata for a cloned repository while leaving the working tree files in place. \" +\n \"Use this to clean up corrupted or stale repos that fail to re-clone. \" +\n \"The repo directory remains under repos/<repo>, but the `.git/` metadata is removed.\",\n input_schema: {\n type: \"object\",\n properties: {\n repo: {\n type: \"string\",\n description:\n \"Short repo name (as returned by git_clone or git_list_repos)\",\n },\n },\n required: [\"repo\"],\n },\n};\n\nexport const git_diff: ToolDefinition = {\n name: \"git_diff\",\n description:\n \"Show changed files between HEAD and working tree, or between two refs.\",\n input_schema: {\n type: \"object\",\n properties: {\n repo: {\n type: \"string\",\n description: \"Short repo name\",\n },\n ref1: {\n type: \"string\",\n description: \"First ref (default: HEAD)\",\n },\n ref2: {\n type: \"string\",\n description: \"Second ref (if omitted, diffs HEAD vs workdir)\",\n },\n },\n required: [\"repo\"],\n },\n};\n\nexport const git_fetch: ToolDefinition = {\n name: \"git_fetch\",\n description:\n \"Fetch commits from the remote without merging. \" +\n \"Safe for inspecting remote state before deciding to merge or rebase.\",\n input_schema: {\n type: \"object\",\n properties: {\n repo: {\n type: \"string\",\n description: \"Short repo name\",\n },\n branch: {\n type: \"string\",\n description: \"Remote branch to fetch (default: default branch)\",\n },\n remote: {\n type: \"string\",\n description: \"Remote name (default: origin)\",\n },\n },\n required: [\"repo\"],\n },\n};\n\nexport const git_init: ToolDefinition = {\n name: \"git_init\",\n description:\n \"Initialize a new empty git repository in browser storage. \" +\n \"Use this to create a new project from scratch before using git_push to push to a remote.\",\n input_schema: {\n type: \"object\",\n properties: {\n repo: {\n type: \"string\",\n description:\n \"Short name for the new repo (used for all subsequent git_ operations)\",\n },\n },\n required: [\"repo\"],\n },\n};\n\nexport const git_list_repos: ToolDefinition = {\n name: \"git_list_repos\",\n description: \"List all git repositories currently cloned in browser storage.\",\n input_schema: {\n type: \"object\",\n properties: {},\n },\n};\n\nexport const git_log: ToolDefinition = {\n name: \"git_log\",\n description:\n \"Show the commit log for a cloned repo. \" +\n \"Returns commit SHA, date, author, and message.\",\n input_schema: {\n type: \"object\",\n properties: {\n repo: {\n type: \"string\",\n description: \"Short repo name\",\n },\n ref: {\n type: \"string\",\n description: \"Ref to log from (default: HEAD)\",\n },\n depth: {\n type: \"number\",\n description: \"Number of commits to show (default: 10)\",\n },\n },\n required: [\"repo\"],\n },\n};\n\nexport const git_merge: ToolDefinition = {\n name: \"git_merge\",\n description:\n \"Merge a branch or ref into the current branch. \" +\n \"Supports fast-forward and three-way merges. \" +\n \"If the merge has conflicts, a detailed report is returned with the conflicted files and their conflict regions inline. \" +\n \"To resolve: use read_file on each conflicted file, then write_file with the complete resolved content (no conflict markers). \" +\n \"After all files are resolved, use git_add for each, then git_commit. Do NOT use bash/sed for conflict resolution.\",\n input_schema: {\n type: \"object\",\n properties: {\n repo: {\n type: \"string\",\n description: \"Short repo name\",\n },\n theirs: {\n type: \"string\",\n description:\n \"Branch name, tag, or commit SHA to merge into the current branch\",\n },\n author_name: {\n type: \"string\",\n description: \"Author name (optional, uses configured default)\",\n },\n author_email: {\n type: \"string\",\n description: \"Author email (optional, uses configured default)\",\n },\n },\n required: [\"repo\", \"theirs\"],\n },\n};\n\nexport const git_pull: ToolDefinition = {\n name: \"git_pull\",\n description:\n \"Fetch and merge commits from the remote repository. \" +\n \"Uses configured git author name/email for merge commits if needed.\",\n input_schema: {\n type: \"object\",\n properties: {\n repo: {\n type: \"string\",\n description: \"Short repo name\",\n },\n branch: {\n type: \"string\",\n description: \"Branch to pull (default: current branch)\",\n },\n author_name: {\n type: \"string\",\n description: \"Author name (optional, uses configured default)\",\n },\n author_email: {\n type: \"string\",\n description: \"Author email (optional, uses configured default)\",\n },\n },\n required: [\"repo\"],\n },\n};\n\nexport const git_push: ToolDefinition = {\n name: \"git_push\",\n description:\n \"Push commits to the remote repository. \" +\n \"Requires a GitHub personal access token (PAT) to be configured. \" +\n \"The token is loaded from the encrypted credential store.\",\n input_schema: {\n type: \"object\",\n properties: {\n repo: {\n type: \"string\",\n description: \"Short repo name\",\n },\n branch: {\n type: \"string\",\n description: \"Local branch to push (default: current branch)\",\n },\n remote_ref: {\n type: \"string\",\n description:\n \"Remote branch name to push to, if different from local branch. \" +\n \"Example: push local 'feature-rebased' to remote 'feature/original'.\",\n },\n force: {\n type: \"boolean\",\n description: \"Force push (default: false)\",\n },\n tags: {\n type: \"boolean\",\n description: \"Also push all local tags to the remote (default: false)\",\n },\n },\n required: [\"repo\"],\n },\n};\n\nexport const git_read_file_at_ref: ToolDefinition = {\n name: \"git_read_file_at_ref\",\n description:\n \"Read a file's contents at a specific ref (branch, tag, or commit SHA) \" +\n \"without checking it out. Useful for code review across branches.\",\n input_schema: {\n type: \"object\",\n properties: {\n repo: {\n type: \"string\",\n description: \"Short repo name\",\n },\n ref: {\n type: \"string\",\n description: \"Branch name, tag, or commit SHA\",\n },\n filepath: {\n type: \"string\",\n description: \"File path relative to the repo root\",\n },\n },\n required: [\"repo\", \"ref\", \"filepath\"],\n },\n};\n\nexport const git_remote: ToolDefinition = {\n name: \"git_remote\",\n description:\n \"Manage git remotes: list, add, or remove a remote in a cloned repo.\",\n input_schema: {\n type: \"object\",\n properties: {\n repo: {\n type: \"string\",\n description: \"Short repo name\",\n },\n command: {\n type: \"string\",\n enum: [\"list\", \"add\", \"remove\"],\n description: \"Operation to perform\",\n },\n remote: {\n type: \"string\",\n description:\n \"Remote name (e.g. origin, upstream) — required for add/remove\",\n },\n url: {\n type: \"string\",\n description: \"Remote URL — required for add\",\n },\n },\n required: [\"repo\", \"command\"],\n },\n};\n\nexport const git_reset: ToolDefinition = {\n name: \"git_reset\",\n description:\n \"Reset the current branch HEAD to a specific ref or commit SHA. \" +\n \"Updates the branch pointer and checks out the target, discarding local changes. \" +\n \"Equivalent to 'git reset --hard <ref>'.\",\n input_schema: {\n type: \"object\",\n properties: {\n repo: {\n type: \"string\",\n description: \"Short repo name\",\n },\n ref: {\n type: \"string\",\n description: \"Branch name, tag, or commit SHA to reset to\",\n },\n },\n required: [\"repo\", \"ref\"],\n },\n};\n\nexport const git_show: ToolDefinition = {\n name: \"git_show\",\n description:\n \"Show the metadata and diff of a specific commit. \" +\n \"Returns author, date, message, and a unified diff against the parent commit.\",\n input_schema: {\n type: \"object\",\n properties: {\n repo: {\n type: \"string\",\n description: \"Short repo name\",\n },\n ref: {\n type: \"string\",\n description: \"Commit SHA, branch, or tag to inspect (default: HEAD)\",\n },\n },\n required: [\"repo\", \"ref\"],\n },\n};\n\nexport const git_status: ToolDefinition = {\n name: \"git_status\",\n description:\n \"Show the working tree status of a cloned repo. \" +\n \"Reports modified, added, deleted, and unstaged files.\",\n input_schema: {\n type: \"object\",\n properties: {\n repo: {\n type: \"string\",\n description: \"Short repo name\",\n },\n },\n required: [\"repo\"],\n },\n};\n\nexport const git_tag: ToolDefinition = {\n name: \"git_tag\",\n description:\n \"Create a lightweight or annotated tag at HEAD. \" +\n \"Use git_push with tags=true to push tags to the remote.\",\n input_schema: {\n type: \"object\",\n properties: {\n repo: {\n type: \"string\",\n description: \"Short repo name\",\n },\n tag: {\n type: \"string\",\n description: \"Tag name (e.g. v1.2.3)\",\n },\n message: {\n type: \"string\",\n description:\n \"Annotation message — if provided, creates an annotated tag; otherwise lightweight\",\n },\n author_name: {\n type: \"string\",\n description: \"Tagger name (optional, uses configured default)\",\n },\n author_email: {\n type: \"string\",\n description: \"Tagger email (optional, uses configured default)\",\n },\n },\n required: [\"repo\", \"tag\"],\n },\n};\n\nexport const git_unstage: ToolDefinition = {\n name: \"git_unstage\",\n description:\n \"Remove one or more staged files from the index without touching the working tree. \" +\n \"The inverse of git_add — use to undo accidental staging.\",\n input_schema: {\n type: \"object\",\n properties: {\n repo: {\n type: \"string\",\n description: \"Short repo name\",\n },\n filepath: {\n anyOf: [\n { type: \"string\" },\n { type: \"array\", items: { type: \"string\" } },\n ],\n description:\n \"File path or array of file paths to unstage (relative to repo root)\",\n },\n },\n required: [\"repo\", \"filepath\"],\n },\n};\n","import type { ToolDefinition } from \"./types.js\";\n\nexport const create_task: ToolDefinition = {\n name: \"create_task\",\n description:\n \"Create a scheduled recurring task. The task will run automatically \" +\n \"on the specified schedule and send the result back to this group. \" +\n \"Uses cron expressions (minute hour day-of-month month day-of-week).\",\n input_schema: {\n type: \"object\",\n properties: {\n schedule: {\n type: \"string\",\n description: 'Cron expression, e.g. \"0 9 * * 1-5\" for 9am weekdays',\n },\n prompt: {\n type: \"string\",\n description:\n \"The prompt/instruction to execute on each run (used if type is 'prompt')\",\n },\n type: {\n type: \"string\",\n enum: [\"prompt\", \"tools\"],\n description: \"The type of task to create. Defaults to 'prompt'.\",\n },\n tools: {\n type: \"array\",\n description:\n \"A list of tools to execute sequentially (used if type is 'tools')\",\n items: {\n type: \"object\",\n properties: {\n name: { type: \"string\" },\n input: { type: \"object\" },\n },\n required: [\"name\", \"input\"],\n },\n },\n name: {\n type: \"string\",\n description:\n \"The optional title/name for the task, helping to identify its purpose.\",\n },\n },\n required: [\"prompt\", \"type\"],\n },\n};\n\nexport const list_tasks: ToolDefinition = {\n name: \"list_tasks\",\n description:\n \"List all scheduled recurring tasks for this group. \" +\n \"Returns a list of tasks with their IDs, schedules, and prompts.\",\n input_schema: {\n type: \"object\",\n properties: {},\n },\n};\n\nexport const update_task: ToolDefinition = {\n name: \"update_task\",\n description: \"Update an existing scheduled task's schedule or prompt.\",\n input_schema: {\n type: \"object\",\n properties: {\n id: {\n type: \"string\",\n description: \"The unique ID of the task to update\",\n },\n schedule: {\n type: \"string\",\n description:\n \"Standard cron expression (e.g. '0 9 * * *'). Leave empty for an unscheduled task.\",\n },\n prompt: {\n type: \"string\",\n description: \"New prompt/instruction (optional)\",\n },\n type: {\n type: \"string\",\n enum: [\"prompt\", \"tools\"],\n description: \"New task type (optional)\",\n },\n tools: {\n type: \"array\",\n description: \"New list of tools (optional)\",\n items: {\n type: \"object\",\n properties: {\n name: { type: \"string\" },\n input: { type: \"object\" },\n },\n required: [\"name\", \"input\"],\n },\n },\n enabled: {\n type: \"boolean\",\n description: \"Whether the task is enabled (optional)\",\n },\n name: {\n type: \"string\",\n description: \"New name/title for the task (optional).\",\n },\n },\n required: [\"id\"],\n },\n};\n\nexport const delete_task: ToolDefinition = {\n name: \"delete_task\",\n description: \"Delete a scheduled task by its ID.\",\n input_schema: {\n type: \"object\",\n properties: {\n id: {\n type: \"string\",\n description: \"The unique ID of the task to delete\",\n },\n },\n required: [\"id\"],\n },\n};\n\nexport const enable_task: ToolDefinition = {\n name: \"enable_task\",\n description: \"Enable a scheduled task so it runs on its schedule.\",\n input_schema: {\n type: \"object\",\n properties: {\n id: {\n type: \"string\",\n description: \"The unique ID of the task to enable\",\n },\n },\n required: [\"id\"],\n },\n};\n\nexport const disable_task: ToolDefinition = {\n name: \"disable_task\",\n description: \"Disable a scheduled task so it stops running.\",\n input_schema: {\n type: \"object\",\n properties: {\n id: {\n type: \"string\",\n description: \"The unique ID of the task to disable\",\n },\n },\n required: [\"id\"],\n },\n};\n\nexport const run_task: ToolDefinition = {\n name: \"run_task\",\n description:\n \"Immediately trigger a scheduled task by its ID, outside of its normal cron schedule. \" +\n \"Use this to manually fire a task on demand. \" +\n \"Use list_tasks to find the task ID first.\",\n input_schema: {\n type: \"object\",\n properties: {\n id: {\n type: \"string\",\n description: \"The unique ID of the task to run immediately\",\n },\n },\n required: [\"id\"],\n },\n};\n","import type { ToolDefinition } from \"./types.js\";\n\nexport const create_room: ToolDefinition = {\n name: \"create_room\",\n description:\n \"Create a new multi-party room (a shared PeerJS conversation) hosted by \" +\n \"this device. Other agents or humans can then be invited to participate. \" +\n \"Returns the room so you can share or invite peers into it.\",\n input_schema: {\n type: \"object\",\n properties: {\n name: {\n type: \"string\",\n description: \"A human-readable name for the room.\",\n },\n },\n required: [\"name\"],\n },\n};\n\nexport const invite_to_room: ToolDefinition = {\n name: \"invite_to_room\",\n description:\n \"Invite a peer (another agent or human, identified by their PeerJS peer \" +\n \"ID) into a room so they can join the shared conversation. If room_id is \" +\n \"omitted and the current conversation is a room, that room is used.\",\n input_schema: {\n type: \"object\",\n properties: {\n peer_id: {\n type: \"string\",\n description: \"The PeerJS peer ID of the participant to invite.\",\n },\n room_id: {\n type: \"string\",\n description:\n \"The room id to invite into. Defaults to the current room conversation.\",\n },\n },\n required: [\"peer_id\"],\n },\n};\n\nexport const leave_room: ToolDefinition = {\n name: \"leave_room\",\n description:\n \"Leave a room. If you are the host, the room is disbanded for all \" +\n \"members. If room_id is omitted and the current conversation is a room, \" +\n \"that room is used.\",\n input_schema: {\n type: \"object\",\n properties: {\n room_id: {\n type: \"string\",\n description:\n \"The room id to leave. Defaults to the current room conversation.\",\n },\n },\n },\n};\n\nexport const list_room_members: ToolDefinition = {\n name: \"list_room_members\",\n description:\n \"List the participants (humans and agents) currently in a room. If \" +\n \"room_id is omitted and the current conversation is a room, that room is \" +\n \"used.\",\n input_schema: {\n type: \"object\",\n properties: {\n room_id: {\n type: \"string\",\n description:\n \"The room id to inspect. Defaults to the current room conversation.\",\n },\n },\n },\n};\n","import { ToolDefinition } from \"./types.js\";\n\nexport const summarize_text: ToolDefinition = {\n name: \"summarize_text\",\n description:\n \"Summarize text using Web Platform's Summarizer API (or polyfill fallback). Produces key points, TLDR, teaser, or headline.\",\n input_schema: {\n type: \"object\",\n properties: {\n text: {\n type: \"string\",\n description: \"The text content to summarize.\",\n },\n type: {\n type: \"string\",\n enum: [\"key-points\", \"tldr\", \"teaser\", \"headline\"],\n description: \"The summary type (default: key-points).\",\n },\n format: {\n type: \"string\",\n enum: [\"plain-text\", \"markdown\"],\n description: \"Output format (default: markdown).\",\n },\n length: {\n type: \"string\",\n enum: [\"short\", \"medium\", \"long\"],\n description: \"Summary length (default: short).\",\n },\n preference: {\n type: \"string\",\n enum: [\"capability\", \"speed\", \"auto\"],\n description: \"Summarizer performance preference (default: auto).\",\n },\n context: {\n type: \"string\",\n description: \"Optional background context for summarization.\",\n },\n },\n required: [\"text\"],\n },\n};\n\nexport const write_text: ToolDefinition = {\n name: \"write_text\",\n description:\n \"Generate or draft text using Web Platform's Writer API (or polyfill fallback).\",\n input_schema: {\n type: \"object\",\n properties: {\n prompt: {\n type: \"string\",\n description: \"The prompt or writing instructions.\",\n },\n context: {\n type: \"string\",\n description: \"Optional background context for writing.\",\n },\n },\n required: [\"prompt\"],\n },\n};\n\nexport const rewrite_text: ToolDefinition = {\n name: \"rewrite_text\",\n description:\n \"Rewrite or rephrase text using Web Platform's Rewriter API (or polyfill fallback). Can adjust tone or length.\",\n input_schema: {\n type: \"object\",\n properties: {\n text: {\n type: \"string\",\n description: \"The text to rewrite.\",\n },\n tone: {\n type: \"string\",\n enum: [\"as-is\", \"more-formal\", \"more-casual\"],\n description: \"Tone adjustment (default: as-is).\",\n },\n length: {\n type: \"string\",\n enum: [\"as-is\", \"shorter\", \"longer\"],\n description: \"Length adjustment (default: as-is).\",\n },\n context: {\n type: \"string\",\n description: \"Optional background context for rewriting.\",\n },\n },\n required: [\"text\"],\n },\n};\n\nexport const proofread_text: ToolDefinition = {\n name: \"proofread_text\",\n description:\n \"Proofread and correct grammar, spelling, and phrasing errors using Web Platform's Proofreader API (or polyfill fallback).\",\n input_schema: {\n type: \"object\",\n properties: {\n text: {\n type: \"string\",\n description: \"The text to proofread.\",\n },\n context: {\n type: \"string\",\n description: \"Optional background context for proofreading.\",\n },\n },\n required: [\"text\"],\n },\n};\n\nexport const detect_language: ToolDefinition = {\n name: \"detect_language\",\n description:\n \"Detect the language of input text using Web Platform's Language Detector API (or polyfill fallback).\",\n input_schema: {\n type: \"object\",\n properties: {\n text: {\n type: \"string\",\n description: \"The text to analyze for language detection.\",\n },\n },\n required: [\"text\"],\n },\n};\n\nexport const translate_text: ToolDefinition = {\n name: \"translate_text\",\n description:\n \"Translate text using Web Platform's Translator API (or polyfill fallback).\",\n input_schema: {\n type: \"object\",\n properties: {\n text: {\n type: \"string\",\n description: \"The text to translate.\",\n },\n sourceLanguage: {\n type: \"string\",\n description: \"Source language BCP 47 code (e.g. 'en', 'es', 'ja').\",\n },\n targetLanguage: {\n type: \"string\",\n description: \"Target language BCP 47 code (e.g. 'en', 'es', 'ja').\",\n },\n },\n required: [\"text\", \"sourceLanguage\", \"targetLanguage\"],\n },\n};\n\nexport const embed_text: ToolDefinition = {\n name: \"embed_text\",\n description:\n \"Generate semantic vector embeddings for input text using Web Platform's Semantic Embedder API.\",\n input_schema: {\n type: \"object\",\n properties: {\n text: {\n description: \"The text string or array of text strings to embed.\",\n oneOf: [\n { type: \"string\" },\n { type: \"array\", items: { type: \"string\" } },\n ],\n },\n taskType: {\n type: \"string\",\n enum: [\n \"semantic-similarity\",\n \"retrieval-query\",\n \"retrieval-document\",\n \"classification\",\n \"clustering\",\n ],\n description: \"Optional task type optimization hint.\",\n },\n },\n required: [\"text\"],\n },\n};\n","/**\n * ShadowClaw — Tool definitions\n *\n * Each tool is defined in its own module and assembled here.\n */\n\nimport type { ToolDefinition } from \"./types.js\";\n\nimport { bash } from \"./bash.js\";\nimport { clear_chat, ask_user } from \"./chat.js\";\nimport {\n manage_email,\n email_read_messages,\n email_send_message,\n} from \"./email.js\";\nimport { fetch_file, fetch_url, web_search } from \"./fetch.js\";\nimport { javascript } from \"./javascript.js\";\nimport { remote_mcp_call_tool, remote_mcp_list_tools } from \"./mcp.js\";\nimport { list_tool_profiles, manage_tools } from \"./manage_tools.js\";\nimport { update_memory } from \"./memory.js\";\nimport { send_notification, show_toast } from \"./notifications.js\";\nimport { list_components, render_component } from \"./a2ui.js\";\nimport { spawn_subagent } from \"./subagent.js\";\nimport { get_current_time } from \"./time.js\";\n\nimport {\n attach_file_to_chat,\n copy_file,\n create_directory,\n delete_file,\n diff_files,\n list_files,\n move_file,\n open_file,\n patch_file,\n read_file,\n search_files,\n send_file,\n write_file,\n} from \"./files.js\";\n\nimport {\n git_add,\n git_branch,\n git_branches,\n git_checkout,\n git_clone,\n git_commit,\n git_config,\n git_delete_branch,\n git_delete_repo,\n git_diff,\n git_fetch,\n git_init,\n git_list_repos,\n git_log,\n git_merge,\n git_pull,\n git_push,\n git_read_file_at_ref,\n git_remote,\n git_reset,\n git_show,\n git_status,\n git_tag,\n git_unstage,\n} from \"./git.js\";\n\nimport {\n create_task,\n delete_task,\n disable_task,\n enable_task,\n list_tasks,\n run_task,\n update_task,\n} from \"./tasks.js\";\n\nimport {\n create_room,\n invite_to_room,\n leave_room,\n list_room_members,\n} from \"./rooms.js\";\n\nimport {\n summarize_text,\n write_text,\n rewrite_text,\n proofread_text,\n detect_language,\n translate_text,\n} from \"./builtin-ai.js\";\n\nexport { activate_skill } from \"../skills/tool.js\";\n\nexport const TOOL_DEFINITIONS: ToolDefinition[] = [\n ask_user,\n attach_file_to_chat,\n bash,\n clear_chat,\n copy_file,\n create_directory,\n create_room,\n create_task,\n delete_file,\n delete_task,\n detect_language,\n diff_files,\n disable_task,\n email_read_messages,\n email_send_message,\n enable_task,\n fetch_file,\n fetch_url,\n get_current_time,\n git_add,\n git_branch,\n git_branches,\n git_checkout,\n git_clone,\n git_commit,\n git_config,\n git_delete_branch,\n git_delete_repo,\n git_diff,\n git_fetch,\n git_init,\n git_list_repos,\n git_log,\n git_merge,\n git_pull,\n git_push,\n git_read_file_at_ref,\n git_remote,\n git_reset,\n git_show,\n git_status,\n git_tag,\n git_unstage,\n invite_to_room,\n javascript,\n leave_room,\n list_components,\n list_files,\n list_room_members,\n list_tasks,\n list_tool_profiles,\n manage_email,\n manage_tools,\n move_file,\n open_file,\n patch_file,\n proofread_text,\n read_file,\n remote_mcp_call_tool,\n remote_mcp_list_tools,\n render_component,\n rewrite_text,\n run_task,\n search_files,\n send_file,\n send_notification,\n show_toast,\n spawn_subagent,\n summarize_text,\n translate_text,\n update_memory,\n update_task,\n web_search,\n write_file,\n write_text,\n];\n"],"mappings":";;;AAEA,MAAa,OAAuB;CAClC,MAAM;CACN,aACE;CAaF,cAAc;EACZ,MAAM;EACN,YAAY;GACV,SAAS;IACP,MAAM;IACN,aAAa;GACf;GACA,OAAO;IACL,MAAM;IACN,aAAa;GACf;GACA,SAAS;IACP,MAAM;IACN,aACE;GACJ;EACF;EACA,UAAU,CAAC,SAAS;CACtB;AACF;;;;ACnCA,MAAa,aAA6B;CACxC,MAAM;CACN,aACE;CAEF,cAAc;EACZ,MAAM;EACN,YAAY,CAAC;CACf;AACF;AAEA,MAAa,WAA2B;CACtC,MAAM;CACN,aACE;CAIF,cAAc;EACZ,MAAM;EACN,YAAY;GACV,UAAU;IACR,MAAM;IACN,aACE;GACJ;GACA,SAAS;IACP,MAAM;IACN,OAAO,EAAE,MAAM,SAAS;IACxB,aACE;GACJ;EACF;EACA,UAAU,CAAC,UAAU;CACvB;AACF;;;;ACnCA,MAAa,eAA+B;CAC1C,MAAM;CACN,aACE;CAEF,cAAc;EACZ,MAAM;EACN,YAAY;GACV,QAAQ;IACN,MAAM;IACN,MAAM;KACJ;KACA;KACA;KACA;KACA;KACA;KACA;KACA;KACA;KACA;KACA;KACA;KACA;KACA;KACA;IACF;IACA,aAAa;GACf;GACA,WAAW;IACT,MAAM;IACN,aACE;GACJ;GACA,eAAe;IACb,MAAM;IACN,aACE;GACJ;GACA,OAAO;IACL,MAAM;IACN,aAAa;GACf;GACA,SAAS;IACP,MAAM;IACN,aACE;GACJ;GACA,QAAQ;IACN,MAAM;IACN,YAAY,CAAC;IACb,aACE;GACJ;GACA,cAAc;IACZ,MAAM;IACN,aACE;GACJ;GACA,OAAO;IACL,MAAM;IACN,aACE;GACJ;GACA,aAAa;IACX,MAAM;I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MAAM;IACN,aAAa;GACf;EACF;EACA,UAAU;GAAC;GAAQ;GAAkB;EAAgB;CACvD;AACF;;;;;ACtDA,MAAa,mBAAqC;CAChD;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;AACF"}
1
+ {"version":3,"file":"tools-DKzPWc0q.js","names":[],"sources":["../../src/subsystems/tools/bash.ts","../../src/subsystems/tools/chat.ts","../../src/subsystems/tools/email.ts","../../src/subsystems/tools/fetch.ts","../../src/subsystems/tools/javascript.ts","../../src/subsystems/tools/mcp.ts","../../src/subsystems/tools/manage_tools.ts","../../src/subsystems/tools/memory.ts","../../src/subsystems/tools/notifications.ts","../../src/ui/a2ui/types.ts","../../src/subsystems/tools/a2ui.ts","../../src/subsystems/tools/subagent.ts","../../src/subsystems/tools/time.ts","../../src/subsystems/tools/files.ts","../../src/subsystems/tools/git.ts","../../src/subsystems/tools/tasks.ts","../../src/subsystems/tools/rooms.ts","../../src/subsystems/tools/builtin-ai.ts","../../src/subsystems/tools/index.ts"],"sourcesContent":["import type { ToolDefinition } from \"./types.js\";\n\nexport const bash: ToolDefinition = {\n name: \"bash\",\n description:\n \"Execute a shell command. When WebVM is available, runs in a full Alpine Linux VM (x86) \" +\n \"with all standard Linux commands. When WebVM is disabled or unavailable, \" +\n \"falls back to a lightweight JavaScript shell emulator with 83 commands: \" +\n \"alias, awk, base64, basename, bash, cat, cd, chmod, clear, column, comm, command, \" +\n \"cp, curl, cut, date, diff, dirname, du, echo, egrep, env, expand, export, expr, false, \" +\n \"fgrep, file, find, fold, grep, gunzip, gzip, head, help, html-to-markdown, join, \" +\n \"jq, ln, ls, md5sum, mkdir, mv, nl, od, paste, printenv, printf, pwd, readlink, \" +\n \"realpath, rev, rg, rm, rmdir, sed, seq, sh, sha1sum, sha256sum, sha384sum, \" +\n \"sha512sum, sleep, sort, split, stat, strings, tac, tail, tar, tee, test, timeout, \" +\n \"touch, tr, tree, true, unalias, uniq, wc, which, xargs, yes, zcat. \" +\n \"Commands NOT available in fallback mode: node, npm, npx, git, apk, python, wget.\" +\n \"Supports pipes (|), redirects (> >>), operators (&& || ;), newlines, and # comments. \" +\n \"Prefer read_file/write_file for file inspection and edits — they are faster and more reliable than shell commands for that purpose.\",\n input_schema: {\n type: \"object\",\n properties: {\n command: {\n type: \"string\",\n description: \"The bash command to execute\",\n },\n stdin: {\n type: \"string\",\n description: \"Optional standard input (stdin) to pass to the command\",\n },\n timeout: {\n type: \"number\",\n description:\n \"Timeout in seconds (default from Settings, initially 120; max: 1800)\",\n },\n },\n required: [\"command\"],\n },\n};\n","import type { ToolDefinition } from \"./types.js\";\n\nexport const clear_chat: ToolDefinition = {\n name: \"clear_chat\",\n description:\n \"Clear the current chat history and start a new session. \" +\n \"Useful for scheduled tasks to prevent context from growing indefinitely.\",\n input_schema: {\n type: \"object\",\n properties: {},\n },\n};\n\nexport const ask_user: ToolDefinition = {\n name: \"ask_user\",\n description:\n \"Pause execution to ask the user a question or request confirmation. \" +\n \"This halts the agent's work until the user provides an answer. \" +\n \"Use this for human-in-the-loop checkpoints before taking destructive actions \" +\n \"or when you need clarification to proceed.\",\n input_schema: {\n type: \"object\",\n properties: {\n question: {\n type: \"string\",\n description:\n \"The question or confirmation message to present to the user.\",\n },\n options: {\n type: \"array\",\n items: { type: \"string\" },\n description:\n \"Optional list of predefined choices for the user to select from.\",\n },\n },\n required: [\"question\"],\n },\n};\n","import type { ToolDefinition } from \"./types.js\";\n\nexport const manage_email: ToolDefinition = {\n name: \"manage_email\",\n description:\n \"Manage email connection settings for IMAP/SMTP workflows. \" +\n \"Supports status, connect/configure, enable/disable, delete, read_messages, send_message, mark_as_read, mark_as_unread, delete_messages, download_attachments, list available connection types, and lightweight test actions.\",\n input_schema: {\n type: \"object\",\n properties: {\n action: {\n type: \"string\",\n enum: [\n \"status\",\n \"list_plugins\",\n \"list_connections\",\n \"connect\",\n \"configure\",\n \"enable\",\n \"disable\",\n \"delete\",\n \"test\",\n \"read_messages\",\n \"send_message\",\n \"mark_as_read\",\n \"mark_as_unread\",\n \"delete_messages\",\n \"download_attachments\",\n ],\n description: \"Email management action to perform.\",\n },\n plugin_id: {\n type: \"string\",\n description:\n \"Optional connection type ID for connect operations (default: imap).\",\n },\n connection_id: {\n type: \"string\",\n description:\n \"Connection ID or label for configure, enable, disable, delete, and test actions. For read_messages/send_message, it may be omitted when there is exactly one enabled IMAP connection.\",\n },\n label: {\n type: \"string\",\n description: \"Human-readable connection label for new connections.\",\n },\n enabled: {\n type: \"boolean\",\n description:\n \"Optional enabled flag used during connect/configure actions.\",\n },\n config: {\n type: \"object\",\n properties: {},\n description:\n \"Email config object (host, port, secure, mailboxPath, smtpHost, smtpPort, smtpSecure, etc.).\",\n },\n mailbox_path: {\n type: \"string\",\n description:\n \"Optional mailbox path override for read_messages (default: INBOX).\",\n },\n limit: {\n type: \"number\",\n description:\n \"Optional max messages to fetch for read_messages (default 10, range 1-50).\",\n },\n unread_only: {\n type: \"boolean\",\n description: \"If true, read_messages returns only unread messages.\",\n },\n message_uids: {\n type: \"array\",\n items: { type: \"number\" },\n description:\n \"Message UIDs for mark_as_read, mark_as_unread, and delete_messages actions.\",\n },\n message_uid: {\n type: \"number\",\n description: \"Single message UID used by download_attachments action.\",\n },\n attachment_parts: {\n type: \"array\",\n items: { type: \"string\" },\n description:\n \"Optional IMAP MIME part IDs to download (for example: 2, 3.1). If omitted, all attachments in the message are downloaded.\",\n },\n save_directory: {\n type: \"string\",\n description:\n \"Optional workspace directory for downloaded attachments (default: downloads/email).\",\n },\n attachments: {\n type: \"array\",\n items: {\n anyOf: [\n { type: \"string\" },\n {\n type: \"object\",\n properties: {\n path: { type: \"string\" },\n filename: { type: \"string\" },\n content_type: { type: \"string\" },\n },\n required: [\"path\"],\n },\n ],\n },\n description:\n \"Optional workspace file attachments for send_message. Provide paths or objects with path/filename/content_type.\",\n },\n to: {\n type: \"array\",\n items: { type: \"string\" },\n description: \"Recipient email addresses for send_message.\",\n },\n cc: {\n type: \"array\",\n items: { type: \"string\" },\n description: \"Optional CC recipient addresses for send_message.\",\n },\n bcc: {\n type: \"array\",\n items: { type: \"string\" },\n description: \"Optional BCC recipient addresses for send_message.\",\n },\n subject: {\n type: \"string\",\n description: \"Message subject for send_message.\",\n },\n body: {\n type: \"string\",\n description: \"Plaintext message body for send_message.\",\n },\n html: {\n type: \"string\",\n description: \"Optional HTML body for send_message.\",\n },\n from: {\n type: \"string\",\n description: \"Optional from address override for send_message.\",\n },\n reply_to: {\n type: \"string\",\n description: \"Optional reply-to address for send_message.\",\n },\n username: {\n type: \"string\",\n description:\n \"Optional username override for connect/configure/read_messages/send_message.\",\n },\n password: {\n type: \"string\",\n description:\n \"Optional password override for connect/configure/read_messages/send_message.\",\n },\n },\n required: [\"action\"],\n },\n};\n\nexport const email_read_messages: ToolDefinition = {\n name: \"email_read_messages\",\n description:\n \"Read recent messages from a configured email connection (IMAP). \" +\n \"Use this to check inbox mail from an agent workflow. Results include attachment metadata when available.\",\n input_schema: {\n type: \"object\",\n properties: {\n connection_id: {\n type: \"string\",\n description: \"Email connection ID or label.\",\n },\n mailbox_path: {\n type: \"string\",\n description: \"Optional mailbox path override (default: INBOX).\",\n },\n limit: {\n type: \"number\",\n description: \"Optional max messages to fetch (default 10, range 1-50).\",\n },\n unread_only: {\n type: \"boolean\",\n description: \"If true, only unread messages are returned.\",\n },\n },\n required: [\"connection_id\"],\n },\n};\n\nexport const email_send_message: ToolDefinition = {\n name: \"email_send_message\",\n description:\n \"Send an email message through a configured email connection (SMTP).\",\n input_schema: {\n type: \"object\",\n properties: {\n connection_id: {\n type: \"string\",\n description: \"Email connection ID or label.\",\n },\n to: {\n type: \"array\",\n items: { type: \"string\" },\n description: \"Recipient email addresses.\",\n },\n cc: {\n type: \"array\",\n items: { type: \"string\" },\n description: \"Optional CC recipient addresses.\",\n },\n bcc: {\n type: \"array\",\n items: { type: \"string\" },\n description: \"Optional BCC recipient addresses.\",\n },\n subject: {\n type: \"string\",\n description: \"Message subject.\",\n },\n body: {\n type: \"string\",\n description: \"Plaintext message body.\",\n },\n html: {\n type: \"string\",\n description: \"Optional HTML message body.\",\n },\n from: {\n type: \"string\",\n description: \"Optional from address override.\",\n },\n reply_to: {\n type: \"string\",\n description: \"Optional reply-to address.\",\n },\n },\n required: [\"connection_id\", \"to\", \"subject\"],\n },\n};\n","import type { ToolDefinition } from \"./types.js\";\n\nexport const fetch_url: ToolDefinition = {\n name: \"fetch_url\",\n description:\n \"Fetch a URL via HTTP and return the response body. \" +\n \"Subject to browser CORS restrictions — works with most public APIs. \" +\n \"Response is truncated to 100KB. \" +\n \"Set use_git_auth to true to automatically inject the saved Git PAT \" +\n \"as an Authorization header (supports GitHub, Azure DevOps, GitLab, and other providers — \" +\n \"auth format is auto-detected from the URL's host). \" +\n \"If include_headers is true, the response will include both request and response headers.\",\n input_schema: {\n type: \"object\",\n properties: {\n url: {\n type: \"string\",\n description: \"The URL to fetch\",\n },\n method: {\n type: \"string\",\n description: \"HTTP method (default: GET)\",\n },\n headers: {\n type: \"object\",\n properties: {},\n description: \"Request headers as key-value pairs\",\n },\n body: {\n type: \"string\",\n description: \"Request body (for POST/PUT/PATCH)\",\n },\n use_git_auth: {\n type: \"boolean\",\n description:\n \"If true, inject the saved Git credentials as an Authorization header. \" +\n \"Auth format is auto-detected from the URL host: GitHub (token), \" +\n \"Azure DevOps (Basic), GitLab (Bearer), or generic Bearer.\",\n },\n git_account_id: {\n type: \"string\",\n description:\n \"Optional explicit Git account ID to use when use_git_auth is true. \" +\n \"If omitted, account resolution uses hostPattern/default matching.\",\n },\n use_account_auth: {\n type: \"boolean\",\n description:\n \"If true, inject a saved service account PAT as a Bearer Authorization header. \" +\n \"The account is matched by hostPattern against the URL (longest match wins), \" +\n \"then falls back to the default service account. \" +\n \"Use this for non-Git services like Figma, Notion, or any other service \" +\n \"whose PAT is stored under Settings → Accounts.\",\n },\n account_id: {\n type: \"string\",\n description:\n \"Optional explicit service account ID to use when use_account_auth is true. \" +\n \"If omitted, account resolution uses hostPattern/default matching.\",\n },\n auth_mode: {\n type: \"string\",\n enum: [\"pat\", \"oauth\"],\n description:\n \"Optional preferred credential mode when multiple accounts match. \" +\n \"Valid values: pat or oauth.\",\n },\n include_headers: {\n type: \"boolean\",\n description:\n \"If true, include request and response headers in the output.\",\n },\n },\n required: [\"url\"],\n },\n};\n\nexport const fetch_file: ToolDefinition = {\n name: \"fetch_file\",\n description:\n \"Fetch a URL and save the response body directly to the workspace in one step. \" +\n \"Equivalent to fetch_url + write_file but atomic. \" +\n \"Text responses are saved as UTF-8; binary responses (images, PDFs, audio, video, zip, \" +\n \"application/octet-stream) are saved as raw bytes. \" +\n \"The destination path within the workspace is required. \" +\n \"Supports the same authentication options as fetch_url (use_git_auth, use_account_auth, etc.). \" +\n \"Returns the workspace path the file was saved to and the number of bytes written.\",\n input_schema: {\n type: \"object\",\n properties: {\n url: {\n type: \"string\",\n description: \"The URL to fetch\",\n },\n path: {\n type: \"string\",\n description:\n \"Destination path within the workspace (e.g. 'data/response.json'). \" +\n \"Parent directories are created automatically. \" +\n \"Must not contain '..' segments.\",\n },\n method: {\n type: \"string\",\n description: \"HTTP method (default: GET)\",\n },\n headers: {\n type: \"object\",\n properties: {},\n description: \"Request headers as key-value pairs\",\n },\n body: {\n type: \"string\",\n description: \"Request body (for POST/PUT/PATCH)\",\n },\n use_git_auth: {\n type: \"boolean\",\n description:\n \"If true, inject the saved Git credentials as an Authorization header. \" +\n \"Auth format is auto-detected from the URL host: GitHub (token), \" +\n \"Azure DevOps (Basic), GitLab (Bearer), or generic Bearer.\",\n },\n git_account_id: {\n type: \"string\",\n description:\n \"Optional explicit Git account ID to use when use_git_auth is true. \" +\n \"If omitted, account resolution uses hostPattern/default matching.\",\n },\n use_account_auth: {\n type: \"boolean\",\n description:\n \"If true, inject a saved service account PAT as a Bearer Authorization header. \" +\n \"The account is matched by hostPattern against the URL (longest match wins), \" +\n \"then falls back to the default service account.\",\n },\n account_id: {\n type: \"string\",\n description:\n \"Optional explicit service account ID to use when use_account_auth is true. \" +\n \"If omitted, account resolution uses hostPattern/default matching.\",\n },\n auth_mode: {\n type: \"string\",\n enum: [\"pat\", \"oauth\"],\n description:\n \"Optional preferred credential mode when multiple accounts match. \" +\n \"Valid values: pat or oauth.\",\n },\n },\n required: [\"url\", \"path\"],\n },\n};\n\nexport const web_search: ToolDefinition = {\n name: \"web_search\",\n description:\n \"Perform a web search using a search engine to discover information. \" +\n \"Returns a plain-text summary of the top search results including titles, URLs, and snippets. \" +\n \"Use this when you need to find information but don't know the exact URL to fetch.\",\n input_schema: {\n type: \"object\",\n properties: {\n query: {\n type: \"string\",\n description: \"The search query to look up.\",\n },\n },\n required: [\"query\"],\n },\n};\n","import type { ToolDefinition } from \"./types.js\";\n\nexport const javascript: ToolDefinition = {\n name: \"javascript\",\n description:\n \"Execute JavaScript code in a sandboxed Worker and return the result. \" +\n \"Lighter than bash — no VM boot required. Use for calculations, \" +\n \"data transformations, JSON processing, string analysis, etc. \" +\n \"Runs in strict mode. No access to DOM, eval(), Function(), \" +\n \"self, postMessage, importScripts, navigator, or indexedDB — these are all undefined. \" +\n \"fetch availability is controlled by Tool Configuration -> Internet Access (shared with bash). \" +\n \"setTimeout is available but setInterval is blocked. \" +\n \"IMPORTANT: You CANNOT call other agent tools (like read_file, write_file, or bash) from inside this sandbox. \" +\n \"If you need to process file contents or tool outputs, you must fetch them in a previous turn \" +\n \"and pass the data into this tool via the $PIPE_DATA variable. \" +\n \"Write plain JavaScript expressions and statements — the return value of the \" +\n \"last expression is captured as the result.\",\n input_schema: {\n type: \"object\",\n properties: {\n code: {\n type: \"string\",\n description:\n \"JavaScript code to execute. The return value of the last expression is captured.\",\n },\n data: {\n type: \"string\",\n description:\n \"Optional input data string. Accessible inside the code sandbox via the global constant `$PIPE_DATA`.\",\n },\n },\n required: [\"code\"],\n },\n};\n","import type { ToolDefinition } from \"./types.js\";\n\nexport const remote_mcp_list_tools: ToolDefinition = {\n name: \"remote_mcp_list_tools\",\n description:\n \"List available tools from a configured Remote MCP connection by connection ID or label.\",\n input_schema: {\n type: \"object\",\n properties: {\n connection_id: {\n type: \"string\",\n description: \"Remote MCP connection ID or label\",\n },\n },\n required: [\"connection_id\"],\n },\n};\n\nexport const remote_mcp_call_tool: ToolDefinition = {\n name: \"remote_mcp_call_tool\",\n description: \"Call a tool exposed by a configured Remote MCP connection.\",\n input_schema: {\n type: \"object\",\n properties: {\n connection_id: {\n type: \"string\",\n description: \"Remote MCP connection ID or label\",\n },\n tool_name: {\n type: \"string\",\n description: \"Remote MCP tool name\",\n },\n arguments: {\n type: \"object\",\n properties: {},\n description: \"Arguments object passed to the remote MCP tool\",\n },\n },\n required: [\"connection_id\", \"tool_name\"],\n },\n};\n","import type { ToolDefinition } from \"./types.js\";\n\n/**\n * manage_tools — Agent-driven tool management.\n *\n * Allows the agent to enable/disable tools or activate predefined tool profiles.\n * Note: Changes take effect on the NEXT message turn.\n */\nexport const manage_tools: ToolDefinition = {\n name: \"manage_tools\",\n description:\n \"Enable or disable specific tools, or activate a predefined tool profile. \" +\n \"Use list_tool_profiles to see available profiles before activating one. \" +\n \"This helps optimize the context window and focus capabilities. \" +\n \"Changes take effect on the NEXT turn, not immediately within the current tool-use loop.\",\n input_schema: {\n type: \"object\",\n properties: {\n action: {\n type: \"string\",\n enum: [\"enable\", \"disable\", \"activate_profile\"],\n description: \"The management action to perform.\",\n },\n tool_names: {\n type: \"array\",\n items: { type: \"string\" },\n description:\n \"List of tool names to enable or disable. Required for 'enable' and 'disable' actions.\",\n },\n profile_id: {\n type: \"string\",\n description:\n \"The unique ID of the tool profile to activate. Required for 'activate_profile' action.\",\n },\n },\n required: [\"action\"],\n },\n};\n\n/**\n * list_tool_profiles — List available tool profiles.\n *\n * Returns a list of tool profiles that the agent can activate.\n */\nexport const list_tool_profiles: ToolDefinition = {\n name: \"list_tool_profiles\",\n description:\n \"List all available tool profiles that can be activated using manage_tools. \" +\n \"Returns a list of profiles with their IDs, names, and the tools they contain.\",\n input_schema: {\n type: \"object\",\n properties: {},\n },\n};\n","import type { ToolDefinition } from \"./types.js\";\n\nexport const update_memory: ToolDefinition = {\n name: \"update_memory\",\n description:\n \"Update the MEMORY.md memory file for this group. \" +\n \"Use this to persist important context, user preferences, project state, \" +\n \"and anything the agent should remember across conversations. \" +\n \"This file is loaded as system context on every invocation.\",\n input_schema: {\n type: \"object\",\n properties: {\n content: {\n type: \"string\",\n description: \"New content for the MEMORY.md memory file\",\n },\n },\n required: [\"content\"],\n },\n};\n","import type { ToolDefinition } from \"./types.js\";\n\nexport const show_toast: ToolDefinition = {\n name: \"show_toast\",\n description:\n \"Show a toast notification to the user. \" +\n \"Toasts are non-blocking, auto-dismissing notifications that appear in the bottom-right corner. \" +\n \"Use for: operation status (success/failure), warnings, informational messages, progress updates. \" +\n \"Avoid for: critical errors requiring acknowledgment (use clear error messages instead), \" +\n \"lengthy content (keep messages concise).\",\n input_schema: {\n type: \"object\",\n properties: {\n message: {\n type: \"string\",\n description: \"The message to display in the toast (keep concise)\",\n },\n type: {\n type: \"string\",\n description:\n \"Type of toast: 'success', 'error', 'warning', or 'info' (default: 'info')\",\n enum: [\"success\", \"error\", \"warning\", \"info\"],\n },\n duration: {\n type: \"number\",\n description:\n \"Auto-dismiss duration in milliseconds (default: 5000 for info/success, 8000 for warning/error). Set to 0 to disable auto-dismiss.\",\n },\n },\n required: [\"message\"],\n },\n};\n\nexport const send_notification: ToolDefinition = {\n name: \"send_notification\",\n description:\n \"Send an OS-level push notification to the user via Web Push. \" +\n \"Unlike toasts (in-app only), push notifications appear even when the app is not focused or the tab is in the background. \" +\n \"Use for: important alerts, long-running task completion, time-sensitive information. \" +\n \"Requires the user to have enabled push notifications in Settings.\",\n input_schema: {\n type: \"object\",\n properties: {\n title: {\n type: \"string\",\n description: \"Notification title (default: 'ShadowClaw')\",\n },\n body: {\n type: \"string\",\n description: \"The notification body text\",\n },\n },\n required: [\"body\"],\n },\n};\n","/**\n * A2UI v1.0 — Spec-Compliant Type Definitions\n *\n * This module provides:\n * - TypeScript types that mirror the A2UI v1.0 Basic catalog.\n * - Surface envelope and action message types (spec wire format).\n * - Runtime helpers for resolving dynamic values and updating data models.\n *\n * Spec reference: https://a2ui.org/specification/v1_0/docs/a2ui_protocol.md\n *\n * Design notes:\n * - Only the official Basic catalog exists in the v1.0 spec.\n * The \"Minimal\" catalog URL was a proprietary construct and has been removed.\n * - `components` in envelopes is a flat array (spec §updateComponents), each\n * with an embedded `id`. Internally, SurfaceState normalises to a map.\n * - Data binding uses `{ \"path\": \"/key\" }` (spec §DynamicString). The legacy\n * `{ \"$dataModel\": \"/key\" }` form is still resolved for backward compatibility\n * but is deprecated and should not be used in new code.\n * - `updateDataModel` uses a single `path` + `value` pair (spec §updateDataModel).\n * The former `patches` map was a non-standard extension and has been removed.\n * - The root component must have `id: \"root\"` (spec §ComponentsList).\n * The `rootComponentId` wire field has been removed.\n */\n\n// ---------------------------------------------------------------------------\n// Catalog identifiers\n// ---------------------------------------------------------------------------\n\n/**\n * The official A2UI v1.0 Basic catalog.\n * @see https://a2ui.org/specification/v1_0/catalogs/basic/catalog.json\n */\nexport const A2UI_BASIC_CATALOG_ID =\n \"https://a2ui.org/specification/v1_0/catalogs/basic/catalog.json\";\n\n/**\n * Catalog identifiers shipped with ShadowClaw.\n * Currently only the official Basic catalog is available.\n *\n * Future ShadowClaw-specific catalogs should be added here alongside their\n * dedicated `A2UI_SHADOWCLAW_*_CATALOG_ID` constants so the renderer and\n * tooling can enumerate them automatically.\n */\nexport const A2UI_AVAILABLE_CATALOGS = [A2UI_BASIC_CATALOG_ID] as const;\n\n/**\n * A valid catalog identifier accepted by this renderer.\n *\n * The type is intentionally `string` (not a strict union of `A2UI_AVAILABLE_CATALOGS`)\n * to allow third-party and future ShadowClaw-specific catalog URLs to be used\n * without requiring a TypeScript change. Use the named constants (e.g.\n * `A2UI_BASIC_CATALOG_ID`) for known catalogs.\n */\nexport type A2UICatalogId = string;\n\n// ---------------------------------------------------------------------------\n// Human-readable catalog reference (returned by the list_components tool)\n// ---------------------------------------------------------------------------\n\n/**\n * Human-readable reference for the A2UI Basic catalog.\n * This text is shown to the agent when it calls list_components.\n */\nexport const BASIC_CATALOG_REFERENCE = `A2UI Basic Catalog — Component & Function Reference\n=====================================================\n\nCatalog ID: ${A2UI_BASIC_CATALOG_ID}\n\nCRITICAL AUTHORING RULES\n-------------------------\n1. Put ALL properties at the TOP LEVEL of each component object alongside \"component\" and \"id\".\n WRONG: {\"id\":\"t\",\"component\":\"Text\",\"properties\":{\"text\":\"Hello\"}}\n RIGHT: {\"id\":\"t\",\"component\":\"Text\",\"text\":\"Hello\"}\n\n2. \"components\" is a FLAT ARRAY of objects, each with a required \"id\" field.\n The root of the component tree MUST have id \"root\".\n WRONG: {\"root\": {\"component\":\"Column\",\"children\":[\"title\"]}}\n RIGHT: [{\"id\":\"root\",\"component\":\"Column\",\"children\":[\"title\"]},{\"id\":\"title\",\"component\":\"Text\",\"text\":\"Hello\"}]\n\n3. To make a property UPDATABLE later via the \"updateDataModel\" action, bind it\n using {\"path\": \"/your_key\"} and initialise that key in the dataModel.\n STATIC (never changes): {\"id\":\"t\",\"component\":\"Text\",\"text\":\"Result will appear here\"}\n DYNAMIC (updatable): {\"id\":\"t\",\"component\":\"Text\",\"text\":{\"path\":\"/result\"}}\n\n4. \"children\" and \"child\" contain COMPONENT ID STRINGS, not nested objects.\n WRONG: {\"id\":\"col\",\"component\":\"Column\",\"children\":[{\"component\":\"Text\",\"text\":\"Hi\"}]}\n RIGHT: [{\"id\":\"col\",\"component\":\"Column\",\"children\":[\"hi\"]},{\"id\":\"hi\",\"component\":\"Text\",\"text\":\"Hi\"}]\n\n5. Button \"child\" must be the id of a Text component in the same components array.\n Button \"action\" must be {\"event\":{\"name\":\"myActionId\"}}.\n\n6. Use updateDataModel with a single path and value per call:\n action: \"updateDataModel\", surfaceId: \"s\", path: \"/result\", value: \"done!\"\n To update multiple fields, call render_component once per field.\n\n7. To concatenate or inject data bindings into strings, use formatString:\n {\"call\":\"formatString\",\"args\":{\"value\":\"Hello \\${/user/name}\"}}\n\nComponents\n----------\nText — text (string or {\"path\":\"/key\"}, required), variant? (\"caption\"|\"body\")\nRow — children (string[] or template {\"path\":\"/list\",\"componentId\":\"tmpl\"}, required), justify?, align?\nColumn — children (string[] or template, required), justify?, align?\nButton — child (string, required — id of a Text or Icon component),\n action ({\"event\":{\"name\":\"myActionId\"}}, required), variant? (\"default\"|\"primary\"|\"borderless\")\nTextField — label (required), value? ({\"path\":\"/key\"}), placeholder?,\n variant? (\"shortText\"|\"longText\"|\"number\"|\"obscured\")\nImage — url (required), description?, fit?, variant?\nIcon — name (required; enum string, {\"svgPath\":\"...\"}, or {\"path\":\"/key\"})\nVideo — url (required), posterUrl?\nAudioPlayer — url (required), description?\nList — children (string[] or template, required), direction?, align?\nCard — child (required; component id string)\nTabs — tabs[] (each: {title, child}, required)\nModal — trigger (component id, required), content (component id, required)\nDivider — axis? (\"horizontal\"|\"vertical\")\nCheckBox — label (required), value ({\"path\":\"/key\"} or boolean, required)\nChoicePicker — label?, variant? (\"mutuallyExclusive\"|\"multipleSelection\"),\n options[] (each: {label, value}, required), value ({\"path\":\"/key\"}, required),\n displayStyle? (\"checkbox\"|\"chips\"), filterable?\nSlider — max (required), value ({\"path\":\"/key\"} or number, required), label?, min?, steps?\nDateTimeInput — value (required; {\"path\":\"/key\"} or ISO 8601 string), enableDate?, enableTime?,\n min?, max?, label?\n\nFunctions (data binding & validation)\n---------------------------------------\nformatString(value) — string interpolation: {\"call\":\"formatString\",\"args\":{\"value\":\"Hi \\${/name}\"}}\nformatNumber(value,decimals?,grouping?) — number formatting\nformatCurrency(value,currency,decimals?,grouping?) — currency formatting\nformatDate(value,format) — date formatting using Unicode TR35 patterns\npluralize(value,one,other,...) — CLDR plural-aware string selection\nopenUrl(url) — open a URL (action function, no return value)\nrequired(value) — validation: checks value is not empty\nregex(value,pattern) — validation: checks value matches regex\nlength(value,min?,max?) — validation: checks string length\nnumeric(value,min?,max?) — validation: checks number range\nemail(value) — validation: checks value is a valid email\nand(values[]) — logical AND of boolean values\nor(values[]) — logical OR of boolean values\nnot(value) — logical NOT of a boolean value\n\nNOTE: ShadowClaw additionally supports \"capitalize\" as an extension function\n(not in the official spec): {\"call\":\"capitalize\",\"args\":{\"value\":{\"path\":\"/name\"}}}\n\nValidator / boolean functions evaluate to boolean and are used in \"checks\" rules;\nthey do not produce a displayable string.\n\nExample (correct — createSurface)\n----------------------------------\naction: \"createSurface\"\nsurfaceId: \"my-surface\"\ncomponents: [\n {\"id\":\"root\", \"component\":\"Column\",\"children\":[\"title\",\"btn\"]},\n {\"id\":\"title\", \"component\":\"Text\",\"text\":\"Hello World\",\"variant\":\"body\"},\n {\"id\":\"btn_lbl\", \"component\":\"Text\",\"text\":\"Click Me\"},\n {\"id\":\"btn\", \"component\":\"Button\",\"child\":\"btn_lbl\",\"action\":{\"event\":{\"name\":\"submit\"}},\"variant\":\"primary\"}\n]\n\nExample (updateDataModel)\n--------------------------\naction: \"updateDataModel\"\nsurfaceId: \"my-surface\"\npath: \"/result\"\nvalue: \"done!\"\n`;\n\n// ---------------------------------------------------------------------------\n// Dynamic values (data binding)\n// ---------------------------------------------------------------------------\n\n/** Literal string value. */\nexport type StaticString = string;\n\n/**\n * Spec-canonical data binding reference: { \"path\": \"/json/pointer\" }\n *\n * This is the form defined in the A2UI v1.0 spec §DynamicString.\n * Use this in all new code.\n */\nexport interface PathRef {\n path: string;\n}\n\n/**\n * Legacy data binding reference: { \"$dataModel\": \"/json/pointer\" }\n *\n * @deprecated Use {@link PathRef} (`{ \"path\": \"/key\" }`) instead.\n * This form is not in the A2UI v1.0 spec and is kept only for backward\n * compatibility with existing surfaces. The runtime resolver handles both.\n */\nexport interface DataModelRef {\n $dataModel: string;\n}\n\n// ---------------------------------------------------------------------------\n// Function call types (A2UI v1.0 Basic catalog §functions)\n// ---------------------------------------------------------------------------\n\nexport interface CapitalizeCall {\n call: \"capitalize\";\n args: { value: DynamicString };\n}\n\n/** Interpolates ${/pointer} placeholders in a template string. */\nexport interface FormatStringCall {\n call: \"formatString\";\n args: { value: DynamicString };\n}\n\nexport interface FormatNumberCall {\n call: \"formatNumber\";\n args: {\n value: DynamicNumber;\n decimals?: DynamicNumber;\n grouping?: DynamicBoolean;\n };\n}\n\nexport interface FormatCurrencyCall {\n call: \"formatCurrency\";\n args: {\n value: DynamicNumber;\n currency: DynamicString;\n decimals?: DynamicNumber;\n grouping?: DynamicBoolean;\n };\n}\n\n/** format: Unicode TR35 date/time pattern string */\nexport interface FormatDateCall {\n call: \"formatDate\";\n args: { value: DynamicString; format: DynamicString };\n}\n\n/** CLDR plural-aware string selection. */\nexport interface PluralizeCall {\n call: \"pluralize\";\n args: {\n value: DynamicNumber;\n one: DynamicString;\n other: DynamicString;\n [cldrKey: string]: unknown;\n };\n}\n\n/** Opens a URL in the browser. Action-only; no return value. */\nexport interface OpenUrlCall {\n call: \"openUrl\";\n args: { url: DynamicString };\n}\n\n// --- Boolean combinators ---\nexport interface AndCall {\n call: \"and\";\n args: { values: DynamicBoolean[] };\n}\nexport interface OrCall {\n call: \"or\";\n args: { values: DynamicBoolean[] };\n}\nexport interface NotCall {\n call: \"not\";\n args: { value: DynamicBoolean };\n}\n\n// --- Validation / check functions ---\nexport interface RequiredCall {\n call: \"required\";\n args: { value: DynamicString };\n}\nexport interface RegexCall {\n call: \"regex\";\n args: { value: DynamicString; pattern: DynamicString };\n}\nexport interface LengthCall {\n call: \"length\";\n args: { value: DynamicString; min?: DynamicNumber; max?: DynamicNumber };\n}\nexport interface NumericCall {\n call: \"numeric\";\n args: { value: DynamicNumber; min?: DynamicNumber; max?: DynamicNumber };\n}\nexport interface EmailCall {\n call: \"email\";\n args: { value: DynamicString };\n}\n\n/** Union of all supported function call expressions. */\nexport type FunctionCall =\n | CapitalizeCall\n | FormatStringCall\n | FormatNumberCall\n | FormatCurrencyCall\n | FormatDateCall\n | PluralizeCall\n | OpenUrlCall\n | AndCall\n | OrCall\n | NotCall\n | RequiredCall\n | RegexCall\n | LengthCall\n | NumericCall\n | EmailCall;\n\n/**\n * A value that may be resolved dynamically at render time.\n *\n * Canonical forms (A2UI v1.0 spec):\n * - Literal string: `\"Hello\"`\n * - Path reference: `{ \"path\": \"/user/name\" }`\n * - Function call: `{ \"call\": \"formatString\", \"args\": { \"value\": \"Hi ${/name}\" } }`\n *\n * Deprecated form (kept for backward compatibility):\n * - `{ \"$dataModel\": \"/key\" }` — resolved by the runtime but not spec-compliant.\n */\nexport type DynamicString =\n | StaticString\n | PathRef\n | DataModelRef\n | FunctionCall;\n\n/**\n * A boolean that may be resolved dynamically at render time.\n */\nexport type DynamicBoolean = boolean | PathRef | DataModelRef | FunctionCall;\n\n/**\n * A number that may be resolved dynamically at render time.\n */\nexport type DynamicNumber = number | PathRef | DataModelRef;\n\n/**\n * A string list that may be resolved dynamically at render time.\n */\nexport type DynamicStringList = string[] | PathRef | DataModelRef;\n\n// ---------------------------------------------------------------------------\n// Shared component fields\n// ---------------------------------------------------------------------------\n\n/**\n * Fields shared by all component specifications.\n * Every component in the `components` array MUST have an `id`.\n * One component MUST have `id: \"root\"` to serve as the tree root (spec §179).\n */\nexport interface ComponentCommon {\n id: string;\n weight?: number;\n}\n\n/**\n * Fields shared by checkable components.\n */\nexport interface CheckableComponent {\n checked?: DynamicBoolean;\n}\n\n// ---------------------------------------------------------------------------\n// Component specifications (Basic catalog — the only official v1.0 catalog)\n// ---------------------------------------------------------------------------\n\n/**\n * Children of a layout component.\n *\n * Can be:\n * - A fixed array of component IDs: `[\"header\", \"body\", \"footer\"]`\n * - A template that generates children from a data model list:\n * `{ \"path\": \"/items\", \"componentId\": \"item_template\" }`\n * (spec §ChildList / §DataDrivenChildren)\n */\nexport type ChildList = string[] | { path: string; componentId: string };\n\n/**\n * Text display variants.\n *\n * Spec-official values: `\"caption\"` | `\"body\"`\n *\n * ShadowClaw extension values (not in spec, but rendered by the client):\n * `\"h1\"` | `\"h2\"` | `\"h3\"` | `\"h4\"` | `\"h5\"`\n *\n * LLMs have been trained on the extension values and they render correctly.\n * When targeting maximum spec compliance, prefer `\"body\"` or `\"caption\"`.\n */\nexport type TextVariant =\n | \"caption\"\n | \"body\"\n // ShadowClaw extensions (not in official spec)\n | \"h1\"\n | \"h2\"\n | \"h3\"\n | \"h4\"\n | \"h5\";\n\nexport interface TextSpec extends ComponentCommon {\n component: \"Text\";\n text: DynamicString;\n variant?: TextVariant;\n}\n\nexport type JustifyValue =\n | \"start\"\n | \"center\"\n | \"end\"\n | \"spaceBetween\"\n | \"spaceAround\"\n | \"spaceEvenly\"\n | \"stretch\";\n\nexport type AlignValue = \"start\" | \"center\" | \"end\" | \"stretch\";\n\nexport interface RowSpec extends ComponentCommon {\n component: \"Row\";\n children: ChildList;\n justify?: JustifyValue;\n align?: AlignValue;\n}\n\nexport interface ColumnSpec extends ComponentCommon {\n component: \"Column\";\n children: ChildList;\n justify?: JustifyValue;\n align?: AlignValue;\n}\n\nexport type ButtonVariant = \"default\" | \"primary\" | \"secondary\" | \"borderless\";\n\n/**\n * A2UI v1.0 spec §actions: server action event sent when a button is clicked.\n */\nexport interface A2UIActionEvent {\n /** The event name routed back to the agent. */\n name: string;\n /**\n * Optional static context attached to the action.\n * Use this to pass per-button metadata without polluting the data model.\n */\n context?: Record<string, unknown>;\n /**\n * If true the agent is expected to respond with an `actionResponse`.\n * Not yet implemented by this renderer.\n */\n wantResponse?: boolean;\n /** Unique identifier for correlating `actionResponse` messages. */\n actionId?: string;\n /** JSON Pointer path in the local data model to store the response value. */\n responsePath?: string;\n}\n\n/**\n * Action descriptor attached to interactive components (Button, CheckBox, …).\n *\n * Spec-compliant form:\n * ```json\n * { \"event\": { \"name\": \"submit_form\" } }\n * ```\n *\n * The legacy `id` field is kept for backward compatibility — the renderer\n * will fall back to it when `event.name` is not present — but new surfaces\n * should use `event.name`.\n */\nexport interface A2UIActionDescriptor {\n /** Spec-compliant server action event. */\n event?: A2UIActionEvent;\n /**\n * @deprecated Use `event.name` instead.\n * Kept for backward compatibility with surfaces created before the v1.0\n * conformance fix.\n */\n id?: string;\n /** @deprecated Not used. Previously listed data-model keys to include. */\n data?: string[];\n}\n\nexport interface ButtonSpec extends ComponentCommon, CheckableComponent {\n component: \"Button\";\n child: string;\n action: A2UIActionDescriptor;\n variant?: ButtonVariant;\n}\n\nexport type TextFieldVariant = \"shortText\" | \"longText\" | \"number\" | \"obscured\";\n\n// ---------------------------------------------------------------------------\n// Checks / validation (spec §checks)\n// ---------------------------------------------------------------------------\n\n/**\n * A single validation rule applied to an input component.\n * Spec §checks — evaluated before the action fires.\n */\nexport interface CheckRule {\n /** The validation function call (e.g. required, regex, email, length, numeric). */\n rule: FunctionCall;\n /** Error message shown to the user when the rule fails. */\n errorMessage: DynamicString;\n}\n\nexport interface TextFieldSpec extends ComponentCommon, CheckableComponent {\n component: \"TextField\";\n label: DynamicString;\n value?: DynamicString;\n placeholder?: DynamicString;\n variant?: TextFieldVariant;\n /** Validation rules evaluated before dispatching an action (spec §checks). */\n checks?: CheckRule[];\n /** @deprecated Use `checks` with a `regex` rule instead. */\n validationRegexp?: string;\n}\n\nexport interface ImageSpec extends ComponentCommon {\n component: \"Image\";\n url: DynamicString;\n description?: DynamicString;\n fit?: \"contain\" | \"cover\" | \"fill\" | \"none\" | \"scaleDown\";\n variant?:\n | \"icon\"\n | \"avatar\"\n | \"smallFeature\"\n | \"mediumFeature\"\n | \"largeFeature\"\n | \"header\";\n}\n\nexport interface IconSpec extends ComponentCommon {\n component: \"Icon\";\n name: string | PathRef;\n}\n\nexport interface VideoSpec extends ComponentCommon {\n component: \"Video\";\n url: DynamicString;\n posterUrl?: DynamicString;\n}\n\nexport interface AudioPlayerSpec extends ComponentCommon {\n component: \"AudioPlayer\";\n url: DynamicString;\n description?: DynamicString;\n}\n\nexport interface ListSpec extends ComponentCommon {\n component: \"List\";\n children: ChildList;\n direction?: \"vertical\" | \"horizontal\";\n align?: AlignValue;\n}\n\nexport interface CardSpec extends ComponentCommon {\n component: \"Card\";\n child: string;\n}\n\nexport interface TabsSpec extends ComponentCommon {\n component: \"Tabs\";\n tabs: { title: DynamicString; child: string }[];\n}\n\nexport interface ModalSpec extends ComponentCommon {\n component: \"Modal\";\n trigger: string;\n content: string;\n}\n\nexport interface DividerSpec extends ComponentCommon {\n component: \"Divider\";\n axis?: \"horizontal\" | \"vertical\";\n}\n\nexport interface CheckBoxSpec extends ComponentCommon, CheckableComponent {\n component: \"CheckBox\";\n label: DynamicString;\n value: DynamicBoolean;\n action?: A2UIActionDescriptor;\n}\n\nexport interface ChoicePickerOption {\n label: DynamicString;\n value: string;\n}\n\nexport interface ChoicePickerSpec extends ComponentCommon, CheckableComponent {\n component: \"ChoicePicker\";\n label?: DynamicString;\n variant?: \"multipleSelection\" | \"mutuallyExclusive\";\n options: ChoicePickerOption[];\n value: DynamicStringList;\n displayStyle?: \"checkbox\" | \"chips\";\n filterable?: boolean;\n}\n\nexport interface SliderSpec extends ComponentCommon, CheckableComponent {\n component: \"Slider\";\n label?: DynamicString;\n min?: number;\n max?: number;\n value: DynamicNumber;\n steps?: number;\n}\n\nexport interface DateTimeInputSpec extends ComponentCommon, CheckableComponent {\n component: \"DateTimeInput\";\n value?: DynamicString;\n enableDate?: boolean;\n enableTime?: boolean;\n min?: DynamicString;\n max?: DynamicString;\n label?: DynamicString;\n}\n\n/** Union of all supported A2UI Basic catalog components. */\nexport type A2UIComponentSpec =\n | TextSpec\n | RowSpec\n | ColumnSpec\n | ButtonSpec\n | TextFieldSpec\n | ImageSpec\n | IconSpec\n | VideoSpec\n | AudioPlayerSpec\n | ListSpec\n | CardSpec\n | TabsSpec\n | ModalSpec\n | DividerSpec\n | CheckBoxSpec\n | ChoicePickerSpec\n | SliderSpec\n | DateTimeInputSpec;\n\n// ---------------------------------------------------------------------------\n// Surface envelope types (A2UI v1.0 wire format)\n// ---------------------------------------------------------------------------\n\n/**\n * Server → Client: create a new surface.\n *\n * Spec §createSurface. The `components` array MUST contain one component with\n * `id: \"root\"` which serves as the root of the component tree.\n */\nexport interface A2UICreateSurface {\n /**\n * Protocol version. Must be `\"v1.0\"` for spec-compliant messages.\n * Optional to preserve backward compatibility with pre-conformance surfaces.\n */\n version?: \"v1.0\";\n type: \"createSurface\";\n surfaceId: string;\n catalogId: A2UICatalogId;\n /**\n * Flat array of component objects. The component with `id: \"root\"` is the\n * tree root. Relationships are expressed by ID references in `children`/`child`.\n */\n components: A2UIComponentSpec[];\n dataModel?: Record<string, unknown>;\n /**\n * If true, the client will include the full data model as metadata on every\n * outbound action message (spec §sendDataModel).\n */\n sendDataModel?: boolean;\n /** Display / branding properties for this surface (spec §surfaceProperties). */\n surfaceProperties?: Record<string, unknown>;\n}\n\n/**\n * Server → Client: add or replace components on an existing surface.\n *\n * Spec §updateComponents. Components are provided as a flat array.\n */\nexport interface A2UIUpdateComponents {\n /** Protocol version. Optional for backward compatibility. */\n version?: \"v1.0\";\n type: \"updateComponents\";\n surfaceId: string;\n components: A2UIComponentSpec[];\n}\n\n/**\n * Server → Client: update the data model at a specific path.\n *\n * Spec §updateDataModel. Replaces the value at `path` with `value`.\n * If `path` is omitted or `\"/\"`, the entire data model is replaced.\n * If `value` is omitted, the key at `path` is deleted.\n */\nexport interface A2UIUpdateDataModel {\n /** Protocol version. Optional for backward compatibility. */\n version?: \"v1.0\";\n type: \"updateDataModel\";\n surfaceId: string;\n /** JSON Pointer (RFC 6901). Defaults to `\"/\"` (replace entire model). */\n path?: string;\n value?: unknown;\n}\n\n/**\n * Server → Client: destroy a surface.\n */\nexport interface A2UIDeleteSurface {\n /** Protocol version. Optional for backward compatibility. */\n version?: \"v1.0\";\n type: \"deleteSurface\";\n surfaceId: string;\n}\n\n/**\n * Server → Client: invoke a renderer-side function.\n *\n * Spec §callFunction. The renderer evaluates the function and responds with\n * a `functionResponse` envelope. This enables server-triggered hardware\n * queries, async data fetches, or other client-side computations.\n */\nexport interface A2UICallFunction {\n version?: \"v1.0\";\n type: \"callFunction\";\n surfaceId: string;\n /** Unique call identifier used to correlate the response. */\n callId: string;\n /** The function call to evaluate on the client. */\n call: FunctionCall;\n}\n\n/**\n * Client → Server: result of a `callFunction` invocation.\n *\n * Spec §functionResponse.\n */\nexport interface A2UIFunctionResponse {\n version?: \"v1.0\";\n type: \"functionResponse\";\n surfaceId: string;\n callId: string;\n value: unknown;\n /** Set when the function evaluation failed. */\n error?: string;\n}\n\n/**\n * Server → Client: response to a `wantResponse` action.\n *\n * Spec §actionResponse. Delivered after the agent processes an action that\n * had `wantResponse: true`. The `responsePath` in the original action event\n * specifies where in the data model to store the response value.\n */\nexport interface A2UIActionResponse {\n version?: \"v1.0\";\n type: \"actionResponse\";\n surfaceId: string;\n /** Matches `A2UIActionEvent.actionId` of the triggering action. */\n actionId: string;\n value: unknown;\n /** JSON Pointer path where the renderer should store the response value. */\n responsePath?: string;\n}\n\nexport type A2UIEnvelope =\n | A2UICreateSurface\n | A2UIUpdateComponents\n | A2UIUpdateDataModel\n | A2UIDeleteSurface\n | A2UICallFunction\n | A2UIActionResponse;\n\n// ---------------------------------------------------------------------------\n// Client → Server messages\n// ---------------------------------------------------------------------------\n\n/**\n * Client → Server: user interaction event fired from a surface.\n *\n * Spec §action. `name` is the event name declared in the component's\n * `action.event.name`. The full current `dataModel` is included so the\n * agent always has the latest form state.\n */\nexport interface A2UIAction {\n type: \"a2ui-action\";\n surfaceId: string;\n /** The event name from the component's `action.event.name`. */\n actionId: string;\n dataModel: Record<string, unknown>;\n}\n\n// ---------------------------------------------------------------------------\n// Transport wrappers (transport-agnostic)\n// ---------------------------------------------------------------------------\n\nexport interface A2UIWirePart {\n kind: \"a2ui\";\n envelope: A2UIEnvelope;\n}\n\nexport interface A2UIActionWirePart {\n kind: \"a2ui-action\";\n action: A2UIAction;\n}\n\nexport interface A2UIFunctionResponseWirePart {\n kind: \"a2ui-function-response\";\n response: A2UIFunctionResponse;\n}\n\n// ---------------------------------------------------------------------------\n// Client capabilities negotiation (spec §a2uiClientCapabilities)\n// ---------------------------------------------------------------------------\n\n/**\n * Advertised by the renderer to inform the agent which optional spec features\n * are supported. Sent as part of the initial handshake or Agent Card metadata.\n *\n * Spec §a2uiClientCapabilities.\n */\nexport interface A2UIClientCapabilities {\n /** Protocol version(s) the renderer supports. */\n versions: string[];\n /**\n * Catalog IDs the renderer has loaded.\n * Always includes the Basic catalog; may include additional catalogs.\n */\n catalogs: string[];\n /** Whether the renderer supports `callFunction` / `functionResponse`. */\n supportsCallFunction?: boolean;\n /** Whether the renderer supports the `checks` validation system. */\n supportsChecks?: boolean;\n /** Whether the renderer supports `@index` in data-driven children. */\n supportsIndexBuiltin?: boolean;\n /** Whether the renderer supports `actionResponse` envelopes. */\n supportsActionResponse?: boolean;\n /** Whether the renderer sends `sendDataModel` metadata on every action. */\n supportsSendDataModel?: boolean;\n}\n","import type { ToolDefinition } from \"./types.js\";\n\nimport {\n A2UI_AVAILABLE_CATALOGS,\n A2UI_BASIC_CATALOG_ID,\n} from \"../../ui/a2ui/types.js\";\n\nexport const availableCatalogs = {\n basic: A2UI_BASIC_CATALOG_ID,\n all: A2UI_AVAILABLE_CATALOGS,\n};\n\nexport const list_components: ToolDefinition = {\n name: \"list_components\",\n description:\n \"List all available A2UI v1.0 Basic catalog components and their schemas. \" +\n \"Returns a human-readable reference of component types, their required/optional properties, \" +\n \"data binding syntax, and examples. Call this before render_component to understand \" +\n \"what components are available and how to structure the input correctly.\",\n input_schema: {\n type: \"object\",\n properties: {},\n required: [],\n },\n};\n\nexport const render_component: ToolDefinition = {\n name: \"render_component\",\n description:\n \"Render an interactive A2UI v1.0 UI surface in the peer's chat window using the Basic catalog. \" +\n \"The surface appears inline in the conversation on the remote peer's side (or locally if no peer). \" +\n \"Components: Text, Row, Column, Button, TextField, Image, Icon, Video, AudioPlayer, \" +\n \"List, Card, Tabs, Modal, Divider, CheckBox, ChoicePicker, Slider, DateTimeInput. \" +\n \"Use list_components first to understand available components and their schemas. \" +\n \"All user input (button clicks, form field changes) automatically routes back to the agent. \" +\n \"For media components (Image/Video/AudioPlayer), use workspace file paths (e.g. 'song.mp3') or HTTPS URLs. \" +\n \"\\n\\nactions:\\n\" +\n \" createSurface — render a new surface (requires components array with a root component)\\n\" +\n \" updateComponents — add or replace components on an existing surface\\n\" +\n \" updateDataModel — update a single path in the data model (re-renders bound components)\\n\" +\n \" deleteSurface — remove the surface from the chat\",\n input_schema: {\n type: \"object\",\n properties: {\n action: {\n type: \"string\",\n enum: [\n \"createSurface\",\n \"updateComponents\",\n \"updateDataModel\",\n \"deleteSurface\",\n ],\n description: \"The A2UI operation to perform\",\n },\n surfaceId: {\n type: \"string\",\n description:\n \"Unique identifier for this surface. Use a stable ID so you can update it later.\",\n },\n components: {\n type: \"array\",\n description:\n \"Flat array of component objects (required for createSurface/updateComponents). \" +\n \"Each object MUST have an 'id' field and a 'component' field. \" +\n \"The component with id 'root' is the tree root (required for createSurface). \" +\n \"Component field values: Text | Row | Column | Button | TextField | Image | Icon | Video | AudioPlayer | \" +\n \"List | Card | Tabs | Modal | Divider | CheckBox | ChoicePicker | Slider | DateTimeInput. \" +\n \"Put all properties at the TOP LEVEL alongside 'component' and 'id'. \" +\n \"DO NOT nest properties under a 'properties' key. \" +\n \"Children arrays contain other component ID strings, not nested objects.\",\n items: {\n type: \"object\",\n additionalProperties: true,\n },\n },\n dataModel: {\n type: \"object\",\n description:\n \"Initial data model for the surface (used with createSurface). \" +\n 'Components can reference values via { \"path\": \"/key\" }.',\n additionalProperties: true,\n },\n path: {\n type: \"string\",\n description:\n \"JSON Pointer path to update (required for updateDataModel). \" +\n 'Examples: \"/result\", \"/user/name\", \"/count\". ' +\n 'Use \"/\" to replace the entire data model.',\n },\n value: {\n description:\n \"New value to set at the specified path (used with updateDataModel). \" +\n \"Omit to delete the key at the given path.\",\n },\n surfaceProperties: {\n type: \"object\",\n description:\n \"Optional display/branding properties for this surface (e.g. agentDisplayName).\",\n additionalProperties: true,\n },\n },\n required: [\"action\", \"surfaceId\"],\n },\n};\n","import type { ToolDefinition } from \"./types.js\";\n\nexport const spawn_subagent: ToolDefinition = {\n name: \"spawn_subagent\",\n description:\n \"Spawn one or more independent agent loops to work on subtasks in parallel and collect their results. \" +\n \"Each subagent has its own tool-use loop, inherits the current API key, and can optionally override provider/model. \" +\n \"and runs concurrently with other subagents via Promise.all. \" +\n \"Use spawn_subagent when a task has independent parallel workstreams — for example: \" +\n \"researching multiple topics simultaneously, processing a list of items in parallel, \" +\n \"or delegating isolated subtasks to specialized agents. \" +\n \"Do NOT use spawn_subagent for sequential tasks where step 2 depends on step 1's output — \" +\n \"just do those steps directly. \" +\n \"Do NOT use spawn_subagent for simple single-step work that takes one tool call. \" +\n \"Use the parallel_agents field to fan out multiple subagents in a single call.\",\n input_schema: {\n type: \"object\",\n properties: {\n prompt: {\n type: \"string\",\n description:\n \"The task prompt for a single subagent. Required unless using parallel_agents for multi-agent fan-out.\",\n },\n tools: {\n type: \"array\",\n description:\n \"Optional list of tool names to allow in the subagent. \" +\n \"If omitted, the subagent inherits the current tool set (minus spawn_subagent to prevent recursion). \" +\n \"If provided, only these tools are available to the subagent.\",\n items: { type: \"string\" },\n },\n profile: {\n type: \"string\",\n enum: [\"current\", \"fast\", \"smart\", \"powerful\"],\n description:\n \"Optional model profile to run the subagent on. Use 'fast' for simple/cheap subtasks (e.g., text formatting, basic search), 'smart' for moderate reasoning, 'powerful' for deep thinking or complex coding, and 'current' to inherit the parent model. Defaults to 'current'.\",\n },\n workspace_group_id: {\n type: \"string\",\n description:\n \"Optional workspace group id override for subagent file/tool scope. \" +\n \"Use 'parent' to reuse the parent workspace in automatic mode. \" +\n \"When omitted, subagents use an isolated workspace by default.\",\n },\n system_prompt: {\n type: \"string\",\n description:\n \"Optional system prompt override for the subagent. Defaults to the current system prompt.\",\n },\n parallel_agents: {\n type: \"array\",\n description:\n \"Optional list of subagent specifications to run in parallel. \" +\n \"When provided, all agents are launched concurrently and their results are combined. \" +\n \"Note: There is a configurable maximum limit on parallel subagents (default 5). \" +\n \"Each entry can specify a prompt, optional tools list, optional profile, and optional system_prompt.\",\n items: {\n type: \"object\",\n properties: {\n prompt: {\n type: \"string\",\n description: \"The task prompt for this subagent.\",\n },\n tools: {\n type: \"array\",\n description: \"Optional tool names for this subagent.\",\n items: { type: \"string\" },\n },\n profile: {\n type: \"string\",\n enum: [\"current\", \"fast\", \"smart\", \"powerful\"],\n description:\n \"Optional model profile for this subagent. Defaults to 'current'.\",\n },\n workspace_group_id: {\n type: \"string\",\n description:\n \"Optional workspace group id for this subagent. Use 'parent' for parent workspace in automatic mode.\",\n },\n system_prompt: {\n type: \"string\",\n description: \"Optional system prompt override for this subagent.\",\n },\n },\n required: [\"prompt\"],\n },\n },\n },\n required: [\"prompt\"],\n },\n};\n","import type { ToolDefinition } from \"./types.js\";\n\nexport const get_current_time: ToolDefinition = {\n name: \"get_current_time\",\n description:\n \"Get the current date and time. \" +\n \"Returns an ISO 8601 string representing the current date and time. \" +\n \"Use this tool whenever you need to know the current time, instead of relying on shell tools which may be unavailable.\",\n input_schema: {\n type: \"object\",\n properties: {\n timezone: {\n type: \"string\",\n description:\n \"Optional timezone to format the time in (e.g. 'America/New_York'). If omitted, returns UTC.\",\n },\n },\n },\n};\n","import type { ToolDefinition } from \"./types.js\";\n\nexport const attach_file_to_chat: ToolDefinition = {\n name: \"attach_file_to_chat\",\n description:\n \"Prepare a workspace file for chat delivery by generating an exact markdown attachment snippet. \" +\n \"Validates the file path and returns markdown that works for inline image rendering in ShadowClaw \" +\n \"and attachment upload in external channels like Telegram/iMessage.\",\n input_schema: {\n type: \"object\",\n properties: {\n path: {\n type: \"string\",\n description: \"File path relative to the group workspace root\",\n },\n alt: {\n type: \"string\",\n description:\n \"Optional alt/caption text to use in the generated markdown\",\n },\n },\n required: [\"path\"],\n },\n};\n\nexport const copy_file: ToolDefinition = {\n name: \"copy_file\",\n description:\n \"Copy a file or directory in the group workspace to a new destination path. \" +\n \"Supports copying single files or nested directories. Optionally supports copying between \" +\n \"different conversation workspaces via source_group_id or target_group_id.\",\n input_schema: {\n type: \"object\",\n properties: {\n source_path: {\n type: \"string\",\n description: \"Source file or directory path relative to workspace root\",\n },\n target_path: {\n type: \"string\",\n description:\n \"Destination file or directory path relative to workspace root\",\n },\n source_group_id: {\n type: \"string\",\n description:\n \"Optional source conversation group ID (defaults to current workspace)\",\n },\n target_group_id: {\n type: \"string\",\n description:\n \"Optional target conversation group ID (defaults to current workspace)\",\n },\n },\n required: [\"source_path\", \"target_path\"],\n },\n};\n\nexport const create_directory: ToolDefinition = {\n name: \"create_directory\",\n description:\n \"Create a new directory (and any missing parent directories) in the group workspace.\",\n input_schema: {\n type: \"object\",\n properties: {\n path: {\n type: \"string\",\n description: \"Directory path relative to the group workspace root\",\n },\n },\n required: [\"path\"],\n },\n};\n\nexport const delete_file: ToolDefinition = {\n name: \"delete_file\",\n description:\n \"Delete a file or directory from the group workspace. \" +\n \"If the target path is a directory, it will be recursively deleted.\",\n input_schema: {\n type: \"object\",\n properties: {\n path: {\n type: \"string\",\n description:\n \"File or directory path relative to the group workspace root\",\n },\n },\n required: [\"path\"],\n },\n};\n\nexport const diff_files: ToolDefinition = {\n name: \"diff_files\",\n description:\n \"Compare two files in the workspace and output the differences. \" +\n \"Useful for comparing generated code, checking before patching, or finding changes outside of git repositories.\",\n input_schema: {\n type: \"object\",\n properties: {\n path_a: {\n type: \"string\",\n description:\n \"Path to the first file relative to the group workspace root.\",\n },\n path_b: {\n type: \"string\",\n description:\n \"Path to the second file relative to the group workspace root.\",\n },\n },\n required: [\"path_a\", \"path_b\"],\n },\n};\n\nexport const list_files: ToolDefinition = {\n name: \"list_files\",\n description:\n \"List files and directories in the group workspace. \" +\n \"Directory names end with /. Returns sorted entries.\",\n input_schema: {\n type: \"object\",\n properties: {\n path: {\n type: \"string\",\n description:\n \"Directory path relative to workspace root (default: root)\",\n },\n },\n },\n};\n\nexport const move_file: ToolDefinition = {\n name: \"move_file\",\n description:\n \"Move or rename a file or directory in the group workspace to a target path. \" +\n \"Supports moving single files or nested directories. Optionally supports moving between \" +\n \"different conversation workspaces via source_group_id or target_group_id.\",\n input_schema: {\n type: \"object\",\n properties: {\n source_path: {\n type: \"string\",\n description: \"Source file or directory path relative to workspace root\",\n },\n target_path: {\n type: \"string\",\n description:\n \"Destination file or directory path relative to workspace root\",\n },\n source_group_id: {\n type: \"string\",\n description:\n \"Optional source conversation group ID (defaults to current workspace)\",\n },\n target_group_id: {\n type: \"string\",\n description:\n \"Optional target conversation group ID (defaults to current workspace)\",\n },\n },\n required: [\"source_path\", \"target_path\"],\n },\n};\n\nexport const open_file: ToolDefinition = {\n name: \"open_file\",\n description:\n \"Open a file from the group workspace in the UI file viewer dialog. \" +\n \"Use this only when the user explicitly asks to inspect a file visually with preview support. \" +\n \"Do not use this tool to send or attach files in chat responses.\",\n input_schema: {\n type: \"object\",\n properties: {\n path: {\n type: \"string\",\n description: \"File path relative to the group workspace root\",\n },\n },\n required: [\"path\"],\n },\n};\n\nexport const patch_file: ToolDefinition = {\n name: \"patch_file\",\n description:\n \"Make a targeted text replacement in a file. \" +\n \"Finds the single occurrence of old_string and replaces it with new_string. \" +\n \"Fails if old_string is not found or matches more than once. \" +\n \"Use this instead of write_file when you only need to change part of a file — \" +\n \"it is safer and works well with large files. \" +\n \"Include enough surrounding context in old_string to make the match unique. \" +\n \"IMPORTANT: You must provide 'path', 'old_string', and 'new_string' parameters.\",\n input_schema: {\n type: \"object\",\n properties: {\n path: {\n type: \"string\",\n description: \"File path relative to the group workspace root\",\n },\n old_string: {\n type: \"string\",\n description:\n \"The exact text to find in the file. Must match exactly once. \" +\n \"Include 2-3 lines of surrounding context to ensure a unique match.\",\n },\n new_string: {\n type: \"string\",\n description: \"The replacement text. Can be empty to delete old_string.\",\n },\n },\n required: [\"path\", \"old_string\", \"new_string\"],\n },\n};\n\nexport const read_file: ToolDefinition = {\n name: \"read_file\",\n description:\n \"Read the contents of one or more files from the group workspace. \" +\n \"IMPORTANT: You must specify either the 'path' parameter (for a single file) \" +\n \"or the 'paths' parameter (an array of file paths for multiple files). \" +\n \"When paths is provided, returns all file contents concatenated with \" +\n \"--- filename --- headers. Prefer paths to batch reads in a single call. \" +\n \"Image files (png, jpg, gif, webp, etc.) are returned as native image content \" +\n \"that the model can see directly. Other binary files will be detected and \" +\n \"an error returned suggesting alternative tools.\",\n input_schema: {\n type: \"object\",\n properties: {\n path: {\n type: \"string\",\n description: \"Single file path relative to the group workspace root\",\n },\n paths: {\n type: \"array\",\n items: { type: \"string\" },\n description:\n \"Array of file paths relative to the group workspace root. \" +\n \"Use this to read multiple files in a single tool call.\",\n },\n },\n },\n};\n\nexport const search_files: ToolDefinition = {\n name: \"search_files\",\n description:\n \"Search for a pattern (regex or exact text) in files across the workspace. \" +\n \"Useful for finding code references, function definitions, or specific content \" +\n \"without needing to rely on a shell environment.\",\n input_schema: {\n type: \"object\",\n properties: {\n pattern: {\n type: \"string\",\n description: \"The text or regular expression to search for.\",\n },\n path: {\n type: \"string\",\n description:\n \"Optional directory path to restrict the search to (e.g. 'src/'). Defaults to workspace root.\",\n },\n file_glob: {\n type: \"string\",\n description:\n \"Optional simple glob to filter files (e.g. '*.ts'). Supports * as wildcard.\",\n },\n is_regex: {\n type: \"boolean\",\n description:\n \"Set to true to parse the pattern as a regular expression.\",\n },\n },\n required: [\"pattern\"],\n },\n};\n\nexport const send_file: ToolDefinition = {\n name: \"send_file\",\n description:\n \"Send a workspace file directly to connected peer(s) over the P2P (PeerJS/WebRTC) data channel. \" +\n \"Use this when the user is in a peer conversation or room and asks to send or transfer a file. \" +\n \"Do NOT use this for local-browser or other non-peer conversations — it only works when the active conversation \" +\n \"is a peer or room session (peer: or room: group). The file is read from the current group workspace and transferred in binary chunks \" +\n \"so there is no size limit.\",\n input_schema: {\n type: \"object\",\n properties: {\n path: {\n type: \"string\",\n description: \"File path relative to the group workspace root\",\n },\n },\n required: [\"path\"],\n },\n};\n\nexport const write_file: ToolDefinition = {\n name: \"write_file\",\n description:\n \"Write content to a file in the group workspace. \" +\n \"Creates the file and any intermediate directories if they don't exist. \" +\n \"Overwrites the file if it already exists. \" +\n \"IMPORTANT: You must provide both the 'path' and 'content' parameters when calling this tool.\",\n input_schema: {\n type: \"object\",\n properties: {\n path: {\n type: \"string\",\n description: \"File path relative to the group workspace root\",\n },\n content: {\n type: \"string\",\n description: \"Content to write to the file\",\n },\n },\n required: [\"path\", \"content\"],\n },\n};\n","import type { ToolDefinition } from \"./types.js\";\n\nexport const git_add: ToolDefinition = {\n name: \"git_add\",\n description:\n \"Stage files in a cloned repo. Accepts an array of filepaths. If omitted or empty, stages the repo root.\",\n input_schema: {\n type: \"object\",\n properties: {\n repo: {\n type: \"string\",\n description: \"Short repo name\",\n },\n filepaths: {\n type: \"array\",\n items: { type: \"string\" },\n description:\n \"Array of file paths to stage (relative to repo root). Pass a single item for one file.\",\n },\n },\n required: [\"repo\"],\n },\n};\n\nexport const git_branch: ToolDefinition = {\n name: \"git_branch\",\n description:\n \"Create a new branch in a cloned repo. \" +\n \"Optionally switch to it immediately (like git checkout -b).\",\n input_schema: {\n type: \"object\",\n properties: {\n repo: {\n type: \"string\",\n description: \"Short repo name (returned by git_clone)\",\n },\n name: {\n type: \"string\",\n description: \"Name for the new branch\",\n },\n checkout: {\n type: \"boolean\",\n description:\n \"Switch to the new branch after creating it (default: false)\",\n },\n start_point: {\n type: \"string\",\n description:\n \"Branch, tag, or commit SHA to branch from (default: HEAD)\",\n },\n },\n required: [\"repo\", \"name\"],\n },\n};\n\nexport const git_branches: ToolDefinition = {\n name: \"git_branches\",\n description:\n \"List branches in a cloned repo. Current branch is marked with *.\",\n input_schema: {\n type: \"object\",\n properties: {\n repo: {\n type: \"string\",\n description: \"Short repo name\",\n },\n remote: {\n type: \"boolean\",\n description: \"List remote-tracking branches instead (default: false)\",\n },\n },\n required: [\"repo\"],\n },\n};\n\nexport const git_checkout: ToolDefinition = {\n name: \"git_checkout\",\n description: \"Checkout a branch, tag, or commit SHA in a cloned repo.\",\n input_schema: {\n type: \"object\",\n properties: {\n repo: {\n type: \"string\",\n description: \"Short repo name (returned by git_clone)\",\n },\n ref: {\n type: \"string\",\n description: \"Branch name, tag, or commit SHA to checkout\",\n },\n },\n required: [\"repo\", \"ref\"],\n },\n};\n\nexport const git_clone: ToolDefinition = {\n name: \"git_clone\",\n description:\n \"Clone a git repository into browser-persistent OPFS storage. \" +\n \"Files are stored directly under repos/<repo-name>/ in the workspace and are \" +\n \"immediately accessible to other git_* tools without any extra sync step. \" +\n \"Works with public and private repos (GitHub, GitLab, GitHub Enterprise, etc.). \" +\n \"If a Git PAT is configured in Settings, it is used automatically for authentication. \" +\n \"Uses a CORS proxy. Returns the short repo name used for subsequent git_* operations.\",\n input_schema: {\n type: \"object\",\n properties: {\n url: {\n type: \"string\",\n description: \"Full HTTPS repo URL (e.g. https://github.com/user/repo)\",\n },\n name: {\n type: \"string\",\n description:\n \"Optional short repo name to use for the clone directory; defaults to the repository name parsed from the URL.\",\n },\n branch: {\n type: \"string\",\n description: \"Branch to clone (default: default branch)\",\n },\n depth: {\n type: \"number\",\n description: \"Shallow clone depth (default: 20)\",\n },\n },\n required: [\"url\"],\n },\n};\n\nexport const git_commit: ToolDefinition = {\n name: \"git_commit\",\n description:\n \"Stage all changes and create a commit in a cloned repo. \" +\n \"Uses configured git author name/email or defaults.\",\n input_schema: {\n type: \"object\",\n properties: {\n repo: {\n type: \"string\",\n description: \"Short repo name\",\n },\n message: {\n type: \"string\",\n description: \"Commit message\",\n },\n author_name: {\n type: \"string\",\n description: \"Author name (optional, uses configured default)\",\n },\n author_email: {\n type: \"string\",\n description: \"Author email (optional, uses configured default)\",\n },\n },\n required: [\"repo\", \"message\"],\n },\n};\n\nexport const git_config: ToolDefinition = {\n name: \"git_config\",\n description:\n \"Get or set a git config value for a repo (e.g. user.name, user.email). \" +\n \"Persistent per-repo identity avoids specifying author on every commit.\",\n input_schema: {\n type: \"object\",\n properties: {\n repo: {\n type: \"string\",\n description: \"Short repo name\",\n },\n command: {\n type: \"string\",\n enum: [\"get\", \"set\"],\n description: \"Operation: get or set a config value\",\n },\n key: {\n type: \"string\",\n description:\n \"Config key path (e.g. user.name, user.email, core.autocrlf)\",\n },\n value: {\n type: \"string\",\n description: \"Value to set — required when command is set\",\n },\n },\n required: [\"repo\", \"command\", \"key\"],\n },\n};\n\nexport const git_delete_branch: ToolDefinition = {\n name: \"git_delete_branch\",\n description: \"Delete a local branch from a cloned repo.\",\n input_schema: {\n type: \"object\",\n properties: {\n repo: {\n type: \"string\",\n description: \"Short repo name\",\n },\n name: {\n type: \"string\",\n description: \"Name of the branch to delete\",\n },\n },\n required: [\"repo\", \"name\"],\n },\n};\n\nexport const git_delete_repo: ToolDefinition = {\n name: \"git_delete_repo\",\n description:\n \"Delete the git metadata for a cloned repository while leaving the working tree files in place. \" +\n \"Use this to clean up corrupted or stale repos that fail to re-clone. \" +\n \"The repo directory remains under repos/<repo>, but the `.git/` metadata is removed.\",\n input_schema: {\n type: \"object\",\n properties: {\n repo: {\n type: \"string\",\n description:\n \"Short repo name (as returned by git_clone or git_list_repos)\",\n },\n },\n required: [\"repo\"],\n },\n};\n\nexport const git_diff: ToolDefinition = {\n name: \"git_diff\",\n description:\n \"Show changed files between HEAD and working tree, or between two refs.\",\n input_schema: {\n type: \"object\",\n properties: {\n repo: {\n type: \"string\",\n description: \"Short repo name\",\n },\n ref1: {\n type: \"string\",\n description: \"First ref (default: HEAD)\",\n },\n ref2: {\n type: \"string\",\n description: \"Second ref (if omitted, diffs HEAD vs workdir)\",\n },\n },\n required: [\"repo\"],\n },\n};\n\nexport const git_fetch: ToolDefinition = {\n name: \"git_fetch\",\n description:\n \"Fetch commits from the remote without merging. \" +\n \"Safe for inspecting remote state before deciding to merge or rebase.\",\n input_schema: {\n type: \"object\",\n properties: {\n repo: {\n type: \"string\",\n description: \"Short repo name\",\n },\n branch: {\n type: \"string\",\n description: \"Remote branch to fetch (default: default branch)\",\n },\n remote: {\n type: \"string\",\n description: \"Remote name (default: origin)\",\n },\n },\n required: [\"repo\"],\n },\n};\n\nexport const git_init: ToolDefinition = {\n name: \"git_init\",\n description:\n \"Initialize a new empty git repository in browser storage. \" +\n \"Use this to create a new project from scratch before using git_push to push to a remote.\",\n input_schema: {\n type: \"object\",\n properties: {\n repo: {\n type: \"string\",\n description:\n \"Short name for the new repo (used for all subsequent git_ operations)\",\n },\n },\n required: [\"repo\"],\n },\n};\n\nexport const git_list_repos: ToolDefinition = {\n name: \"git_list_repos\",\n description: \"List all git repositories currently cloned in browser storage.\",\n input_schema: {\n type: \"object\",\n properties: {},\n },\n};\n\nexport const git_log: ToolDefinition = {\n name: \"git_log\",\n description:\n \"Show the commit log for a cloned repo. \" +\n \"Returns commit SHA, date, author, and message.\",\n input_schema: {\n type: \"object\",\n properties: {\n repo: {\n type: \"string\",\n description: \"Short repo name\",\n },\n ref: {\n type: \"string\",\n description: \"Ref to log from (default: HEAD)\",\n },\n depth: {\n type: \"number\",\n description: \"Number of commits to show (default: 10)\",\n },\n },\n required: [\"repo\"],\n },\n};\n\nexport const git_merge: ToolDefinition = {\n name: \"git_merge\",\n description:\n \"Merge a branch or ref into the current branch. \" +\n \"Supports fast-forward and three-way merges. \" +\n \"If the merge has conflicts, a detailed report is returned with the conflicted files and their conflict regions inline. \" +\n \"To resolve: use read_file on each conflicted file, then write_file with the complete resolved content (no conflict markers). \" +\n \"After all files are resolved, use git_add for each, then git_commit. Do NOT use bash/sed for conflict resolution.\",\n input_schema: {\n type: \"object\",\n properties: {\n repo: {\n type: \"string\",\n description: \"Short repo name\",\n },\n theirs: {\n type: \"string\",\n description:\n \"Branch name, tag, or commit SHA to merge into the current branch\",\n },\n author_name: {\n type: \"string\",\n description: \"Author name (optional, uses configured default)\",\n },\n author_email: {\n type: \"string\",\n description: \"Author email (optional, uses configured default)\",\n },\n },\n required: [\"repo\", \"theirs\"],\n },\n};\n\nexport const git_pull: ToolDefinition = {\n name: \"git_pull\",\n description:\n \"Fetch and merge commits from the remote repository. \" +\n \"Uses configured git author name/email for merge commits if needed.\",\n input_schema: {\n type: \"object\",\n properties: {\n repo: {\n type: \"string\",\n description: \"Short repo name\",\n },\n branch: {\n type: \"string\",\n description: \"Branch to pull (default: current branch)\",\n },\n author_name: {\n type: \"string\",\n description: \"Author name (optional, uses configured default)\",\n },\n author_email: {\n type: \"string\",\n description: \"Author email (optional, uses configured default)\",\n },\n },\n required: [\"repo\"],\n },\n};\n\nexport const git_push: ToolDefinition = {\n name: \"git_push\",\n description:\n \"Push commits to the remote repository. \" +\n \"Requires a GitHub personal access token (PAT) to be configured. \" +\n \"The token is loaded from the encrypted credential store.\",\n input_schema: {\n type: \"object\",\n properties: {\n repo: {\n type: \"string\",\n description: \"Short repo name\",\n },\n branch: {\n type: \"string\",\n description: \"Local branch to push (default: current branch)\",\n },\n remote_ref: {\n type: \"string\",\n description:\n \"Remote branch name to push to, if different from local branch. \" +\n \"Example: push local 'feature-rebased' to remote 'feature/original'.\",\n },\n force: {\n type: \"boolean\",\n description: \"Force push (default: false)\",\n },\n tags: {\n type: \"boolean\",\n description: \"Also push all local tags to the remote (default: false)\",\n },\n },\n required: [\"repo\"],\n },\n};\n\nexport const git_read_file_at_ref: ToolDefinition = {\n name: \"git_read_file_at_ref\",\n description:\n \"Read a file's contents at a specific ref (branch, tag, or commit SHA) \" +\n \"without checking it out. Useful for code review across branches.\",\n input_schema: {\n type: \"object\",\n properties: {\n repo: {\n type: \"string\",\n description: \"Short repo name\",\n },\n ref: {\n type: \"string\",\n description: \"Branch name, tag, or commit SHA\",\n },\n filepath: {\n type: \"string\",\n description: \"File path relative to the repo root\",\n },\n },\n required: [\"repo\", \"ref\", \"filepath\"],\n },\n};\n\nexport const git_remote: ToolDefinition = {\n name: \"git_remote\",\n description:\n \"Manage git remotes: list, add, or remove a remote in a cloned repo.\",\n input_schema: {\n type: \"object\",\n properties: {\n repo: {\n type: \"string\",\n description: \"Short repo name\",\n },\n command: {\n type: \"string\",\n enum: [\"list\", \"add\", \"remove\"],\n description: \"Operation to perform\",\n },\n remote: {\n type: \"string\",\n description:\n \"Remote name (e.g. origin, upstream) — required for add/remove\",\n },\n url: {\n type: \"string\",\n description: \"Remote URL — required for add\",\n },\n },\n required: [\"repo\", \"command\"],\n },\n};\n\nexport const git_reset: ToolDefinition = {\n name: \"git_reset\",\n description:\n \"Reset the current branch HEAD to a specific ref or commit SHA. \" +\n \"Updates the branch pointer and checks out the target, discarding local changes. \" +\n \"Equivalent to 'git reset --hard <ref>'.\",\n input_schema: {\n type: \"object\",\n properties: {\n repo: {\n type: \"string\",\n description: \"Short repo name\",\n },\n ref: {\n type: \"string\",\n description: \"Branch name, tag, or commit SHA to reset to\",\n },\n },\n required: [\"repo\", \"ref\"],\n },\n};\n\nexport const git_show: ToolDefinition = {\n name: \"git_show\",\n description:\n \"Show the metadata and diff of a specific commit. \" +\n \"Returns author, date, message, and a unified diff against the parent commit.\",\n input_schema: {\n type: \"object\",\n properties: {\n repo: {\n type: \"string\",\n description: \"Short repo name\",\n },\n ref: {\n type: \"string\",\n description: \"Commit SHA, branch, or tag to inspect (default: HEAD)\",\n },\n },\n required: [\"repo\", \"ref\"],\n },\n};\n\nexport const git_status: ToolDefinition = {\n name: \"git_status\",\n description:\n \"Show the working tree status of a cloned repo. \" +\n \"Reports modified, added, deleted, and unstaged files.\",\n input_schema: {\n type: \"object\",\n properties: {\n repo: {\n type: \"string\",\n description: \"Short repo name\",\n },\n },\n required: [\"repo\"],\n },\n};\n\nexport const git_tag: ToolDefinition = {\n name: \"git_tag\",\n description:\n \"Create a lightweight or annotated tag at HEAD. \" +\n \"Use git_push with tags=true to push tags to the remote.\",\n input_schema: {\n type: \"object\",\n properties: {\n repo: {\n type: \"string\",\n description: \"Short repo name\",\n },\n tag: {\n type: \"string\",\n description: \"Tag name (e.g. v1.2.3)\",\n },\n message: {\n type: \"string\",\n description:\n \"Annotation message — if provided, creates an annotated tag; otherwise lightweight\",\n },\n author_name: {\n type: \"string\",\n description: \"Tagger name (optional, uses configured default)\",\n },\n author_email: {\n type: \"string\",\n description: \"Tagger email (optional, uses configured default)\",\n },\n },\n required: [\"repo\", \"tag\"],\n },\n};\n\nexport const git_unstage: ToolDefinition = {\n name: \"git_unstage\",\n description:\n \"Remove one or more staged files from the index without touching the working tree. \" +\n \"The inverse of git_add — use to undo accidental staging.\",\n input_schema: {\n type: \"object\",\n properties: {\n repo: {\n type: \"string\",\n description: \"Short repo name\",\n },\n filepath: {\n anyOf: [\n { type: \"string\" },\n { type: \"array\", items: { type: \"string\" } },\n ],\n description:\n \"File path or array of file paths to unstage (relative to repo root)\",\n },\n },\n required: [\"repo\", \"filepath\"],\n },\n};\n","import type { ToolDefinition } from \"./types.js\";\n\nexport const create_task: ToolDefinition = {\n name: \"create_task\",\n description:\n \"Create a scheduled recurring task. The task will run automatically \" +\n \"on the specified schedule and send the result back to this group. \" +\n \"Uses cron expressions (minute hour day-of-month month day-of-week).\",\n input_schema: {\n type: \"object\",\n properties: {\n schedule: {\n type: \"string\",\n description: 'Cron expression, e.g. \"0 9 * * 1-5\" for 9am weekdays',\n },\n prompt: {\n type: \"string\",\n description:\n \"The prompt/instruction to execute on each run (used if type is 'prompt')\",\n },\n type: {\n type: \"string\",\n enum: [\"prompt\", \"tools\"],\n description: \"The type of task to create. Defaults to 'prompt'.\",\n },\n tools: {\n type: \"array\",\n description:\n \"A list of tools to execute sequentially (used if type is 'tools')\",\n items: {\n type: \"object\",\n properties: {\n name: { type: \"string\" },\n input: { type: \"object\" },\n },\n required: [\"name\", \"input\"],\n },\n },\n name: {\n type: \"string\",\n description:\n \"The optional title/name for the task, helping to identify its purpose.\",\n },\n },\n required: [\"prompt\", \"type\"],\n },\n};\n\nexport const list_tasks: ToolDefinition = {\n name: \"list_tasks\",\n description:\n \"List all scheduled recurring tasks for this group. \" +\n \"Returns a list of tasks with their IDs, schedules, and prompts.\",\n input_schema: {\n type: \"object\",\n properties: {},\n },\n};\n\nexport const update_task: ToolDefinition = {\n name: \"update_task\",\n description: \"Update an existing scheduled task's schedule or prompt.\",\n input_schema: {\n type: \"object\",\n properties: {\n id: {\n type: \"string\",\n description: \"The unique ID of the task to update\",\n },\n schedule: {\n type: \"string\",\n description:\n \"Standard cron expression (e.g. '0 9 * * *'). Leave empty for an unscheduled task.\",\n },\n prompt: {\n type: \"string\",\n description: \"New prompt/instruction (optional)\",\n },\n type: {\n type: \"string\",\n enum: [\"prompt\", \"tools\"],\n description: \"New task type (optional)\",\n },\n tools: {\n type: \"array\",\n description: \"New list of tools (optional)\",\n items: {\n type: \"object\",\n properties: {\n name: { type: \"string\" },\n input: { type: \"object\" },\n },\n required: [\"name\", \"input\"],\n },\n },\n enabled: {\n type: \"boolean\",\n description: \"Whether the task is enabled (optional)\",\n },\n name: {\n type: \"string\",\n description: \"New name/title for the task (optional).\",\n },\n },\n required: [\"id\"],\n },\n};\n\nexport const delete_task: ToolDefinition = {\n name: \"delete_task\",\n description: \"Delete a scheduled task by its ID.\",\n input_schema: {\n type: \"object\",\n properties: {\n id: {\n type: \"string\",\n description: \"The unique ID of the task to delete\",\n },\n },\n required: [\"id\"],\n },\n};\n\nexport const enable_task: ToolDefinition = {\n name: \"enable_task\",\n description: \"Enable a scheduled task so it runs on its schedule.\",\n input_schema: {\n type: \"object\",\n properties: {\n id: {\n type: \"string\",\n description: \"The unique ID of the task to enable\",\n },\n },\n required: [\"id\"],\n },\n};\n\nexport const disable_task: ToolDefinition = {\n name: \"disable_task\",\n description: \"Disable a scheduled task so it stops running.\",\n input_schema: {\n type: \"object\",\n properties: {\n id: {\n type: \"string\",\n description: \"The unique ID of the task to disable\",\n },\n },\n required: [\"id\"],\n },\n};\n\nexport const run_task: ToolDefinition = {\n name: \"run_task\",\n description:\n \"Immediately trigger a scheduled task by its ID, outside of its normal cron schedule. \" +\n \"Use this to manually fire a task on demand. \" +\n \"Use list_tasks to find the task ID first.\",\n input_schema: {\n type: \"object\",\n properties: {\n id: {\n type: \"string\",\n description: \"The unique ID of the task to run immediately\",\n },\n },\n required: [\"id\"],\n },\n};\n","import type { ToolDefinition } from \"./types.js\";\n\nexport const create_room: ToolDefinition = {\n name: \"create_room\",\n description:\n \"Create a new multi-party room (a shared PeerJS conversation) hosted by \" +\n \"this device. Other agents or humans can then be invited to participate. \" +\n \"Returns the room so you can share or invite peers into it.\",\n input_schema: {\n type: \"object\",\n properties: {\n name: {\n type: \"string\",\n description: \"A human-readable name for the room.\",\n },\n },\n required: [\"name\"],\n },\n};\n\nexport const invite_to_room: ToolDefinition = {\n name: \"invite_to_room\",\n description:\n \"Invite a peer (another agent or human, identified by their PeerJS peer \" +\n \"ID) into a room so they can join the shared conversation. If room_id is \" +\n \"omitted and the current conversation is a room, that room is used.\",\n input_schema: {\n type: \"object\",\n properties: {\n peer_id: {\n type: \"string\",\n description: \"The PeerJS peer ID of the participant to invite.\",\n },\n room_id: {\n type: \"string\",\n description:\n \"The room id to invite into. Defaults to the current room conversation.\",\n },\n },\n required: [\"peer_id\"],\n },\n};\n\nexport const leave_room: ToolDefinition = {\n name: \"leave_room\",\n description:\n \"Leave a room. If you are the host, the room is disbanded for all \" +\n \"members. If room_id is omitted and the current conversation is a room, \" +\n \"that room is used.\",\n input_schema: {\n type: \"object\",\n properties: {\n room_id: {\n type: \"string\",\n description:\n \"The room id to leave. Defaults to the current room conversation.\",\n },\n },\n },\n};\n\nexport const list_room_members: ToolDefinition = {\n name: \"list_room_members\",\n description:\n \"List the participants (humans and agents) currently in a room. If \" +\n \"room_id is omitted and the current conversation is a room, that room is \" +\n \"used.\",\n input_schema: {\n type: \"object\",\n properties: {\n room_id: {\n type: \"string\",\n description:\n \"The room id to inspect. Defaults to the current room conversation.\",\n },\n },\n },\n};\n","import { ToolDefinition } from \"./types.js\";\n\nexport const summarize_text: ToolDefinition = {\n name: \"summarize_text\",\n description:\n \"Summarize text using Web Platform's Summarizer API (or polyfill fallback). Produces key points, TLDR, teaser, or headline.\",\n input_schema: {\n type: \"object\",\n properties: {\n text: {\n type: \"string\",\n description: \"The text content to summarize.\",\n },\n type: {\n type: \"string\",\n enum: [\"key-points\", \"tldr\", \"teaser\", \"headline\"],\n description: \"The summary type (default: key-points).\",\n },\n format: {\n type: \"string\",\n enum: [\"plain-text\", \"markdown\"],\n description: \"Output format (default: markdown).\",\n },\n length: {\n type: \"string\",\n enum: [\"short\", \"medium\", \"long\"],\n description: \"Summary length (default: short).\",\n },\n preference: {\n type: \"string\",\n enum: [\"capability\", \"speed\", \"auto\"],\n description: \"Summarizer performance preference (default: auto).\",\n },\n context: {\n type: \"string\",\n description: \"Optional background context for summarization.\",\n },\n },\n required: [\"text\"],\n },\n};\n\nexport const write_text: ToolDefinition = {\n name: \"write_text\",\n description:\n \"Generate or draft text using Web Platform's Writer API (or polyfill fallback).\",\n input_schema: {\n type: \"object\",\n properties: {\n prompt: {\n type: \"string\",\n description: \"The prompt or writing instructions.\",\n },\n context: {\n type: \"string\",\n description: \"Optional background context for writing.\",\n },\n },\n required: [\"prompt\"],\n },\n};\n\nexport const rewrite_text: ToolDefinition = {\n name: \"rewrite_text\",\n description:\n \"Rewrite or rephrase text using Web Platform's Rewriter API (or polyfill fallback). Can adjust tone or length.\",\n input_schema: {\n type: \"object\",\n properties: {\n text: {\n type: \"string\",\n description: \"The text to rewrite.\",\n },\n tone: {\n type: \"string\",\n enum: [\"as-is\", \"more-formal\", \"more-casual\"],\n description: \"Tone adjustment (default: as-is).\",\n },\n length: {\n type: \"string\",\n enum: [\"as-is\", \"shorter\", \"longer\"],\n description: \"Length adjustment (default: as-is).\",\n },\n context: {\n type: \"string\",\n description: \"Optional background context for rewriting.\",\n },\n },\n required: [\"text\"],\n },\n};\n\nexport const proofread_text: ToolDefinition = {\n name: \"proofread_text\",\n description:\n \"Proofread and correct grammar, spelling, and phrasing errors using Web Platform's Proofreader API (or polyfill fallback).\",\n input_schema: {\n type: \"object\",\n properties: {\n text: {\n type: \"string\",\n description: \"The text to proofread.\",\n },\n context: {\n type: \"string\",\n description: \"Optional background context for proofreading.\",\n },\n },\n required: [\"text\"],\n },\n};\n\nexport const detect_language: ToolDefinition = {\n name: \"detect_language\",\n description:\n \"Detect the language of input text using Web Platform's Language Detector API (or polyfill fallback).\",\n input_schema: {\n type: \"object\",\n properties: {\n text: {\n type: \"string\",\n description: \"The text to analyze for language detection.\",\n },\n },\n required: [\"text\"],\n },\n};\n\nexport const translate_text: ToolDefinition = {\n name: \"translate_text\",\n description:\n \"Translate text using Web Platform's Translator API (or polyfill fallback).\",\n input_schema: {\n type: \"object\",\n properties: {\n text: {\n type: \"string\",\n description: \"The text to translate.\",\n },\n sourceLanguage: {\n type: \"string\",\n description: \"Source language BCP 47 code (e.g. 'en', 'es', 'ja').\",\n },\n targetLanguage: {\n type: \"string\",\n description: \"Target language BCP 47 code (e.g. 'en', 'es', 'ja').\",\n },\n },\n required: [\"text\", \"sourceLanguage\", \"targetLanguage\"],\n },\n};\n\nexport const embed_text: ToolDefinition = {\n name: \"embed_text\",\n description:\n \"Generate semantic vector embeddings for input text using Web Platform's Semantic Embedder API.\",\n input_schema: {\n type: \"object\",\n properties: {\n text: {\n description: \"The text string or array of text strings to embed.\",\n oneOf: [\n { type: \"string\" },\n { type: \"array\", items: { type: \"string\" } },\n ],\n },\n taskType: {\n type: \"string\",\n enum: [\n \"semantic-similarity\",\n \"retrieval-query\",\n \"retrieval-document\",\n \"classification\",\n \"clustering\",\n ],\n description: \"Optional task type optimization hint.\",\n },\n },\n required: [\"text\"],\n },\n};\n","/**\n * ShadowClaw — Tool definitions\n *\n * Each tool is defined in its own module and assembled here.\n */\n\nimport type { ToolDefinition } from \"./types.js\";\n\nimport { bash } from \"./bash.js\";\nimport { clear_chat, ask_user } from \"./chat.js\";\nimport {\n manage_email,\n email_read_messages,\n email_send_message,\n} from \"./email.js\";\nimport { fetch_file, fetch_url, web_search } from \"./fetch.js\";\nimport { javascript } from \"./javascript.js\";\nimport { remote_mcp_call_tool, remote_mcp_list_tools } from \"./mcp.js\";\nimport { list_tool_profiles, manage_tools } from \"./manage_tools.js\";\nimport { update_memory } from \"./memory.js\";\nimport { send_notification, show_toast } from \"./notifications.js\";\nimport { list_components, render_component } from \"./a2ui.js\";\nimport { spawn_subagent } from \"./subagent.js\";\nimport { get_current_time } from \"./time.js\";\n\nimport {\n attach_file_to_chat,\n copy_file,\n create_directory,\n delete_file,\n diff_files,\n list_files,\n move_file,\n open_file,\n patch_file,\n read_file,\n search_files,\n send_file,\n write_file,\n} from \"./files.js\";\n\nimport {\n git_add,\n git_branch,\n git_branches,\n git_checkout,\n git_clone,\n git_commit,\n git_config,\n git_delete_branch,\n git_delete_repo,\n git_diff,\n git_fetch,\n git_init,\n git_list_repos,\n git_log,\n git_merge,\n git_pull,\n git_push,\n git_read_file_at_ref,\n git_remote,\n git_reset,\n git_show,\n git_status,\n git_tag,\n git_unstage,\n} from \"./git.js\";\n\nimport {\n create_task,\n delete_task,\n disable_task,\n enable_task,\n list_tasks,\n run_task,\n update_task,\n} from \"./tasks.js\";\n\nimport {\n create_room,\n invite_to_room,\n leave_room,\n list_room_members,\n} from \"./rooms.js\";\n\nimport {\n summarize_text,\n write_text,\n rewrite_text,\n proofread_text,\n detect_language,\n translate_text,\n} from \"./builtin-ai.js\";\n\nexport { activate_skill } from \"../skills/tool.js\";\n\nexport const TOOL_DEFINITIONS: ToolDefinition[] = [\n ask_user,\n attach_file_to_chat,\n bash,\n clear_chat,\n copy_file,\n create_directory,\n create_room,\n create_task,\n delete_file,\n delete_task,\n detect_language,\n diff_files,\n disable_task,\n email_read_messages,\n email_send_message,\n enable_task,\n fetch_file,\n fetch_url,\n get_current_time,\n git_add,\n git_branch,\n git_branches,\n git_checkout,\n git_clone,\n git_commit,\n git_config,\n git_delete_branch,\n git_delete_repo,\n git_diff,\n git_fetch,\n git_init,\n git_list_repos,\n git_log,\n git_merge,\n git_pull,\n git_push,\n git_read_file_at_ref,\n git_remote,\n git_reset,\n git_show,\n git_status,\n git_tag,\n git_unstage,\n invite_to_room,\n javascript,\n leave_room,\n list_components,\n list_files,\n list_room_members,\n list_tasks,\n list_tool_profiles,\n manage_email,\n manage_tools,\n move_file,\n open_file,\n patch_file,\n proofread_text,\n read_file,\n remote_mcp_call_tool,\n remote_mcp_list_tools,\n render_component,\n rewrite_text,\n run_task,\n search_files,\n send_file,\n send_notification,\n show_toast,\n spawn_subagent,\n summarize_text,\n translate_text,\n update_memory,\n update_task,\n web_search,\n write_file,\n write_text,\n];\n"],"mappings":";;;AAEA,MAAa,OAAuB;CAClC,MAAM;CACN,aACE;CAaF,cAAc;EACZ,MAAM;EACN,YAAY;GACV,SAAS;IACP,MAAM;IACN,aAAa;GACf;GACA,OAAO;IACL,MAAM;IACN,aAAa;GACf;GACA,SAAS;IACP,MAAM;IACN,aACE;GACJ;EACF;EACA,UAAU,CAAC,SAAS;CACtB;AACF;;;;ACnCA,MAAa,aAA6B;CACxC,MAAM;CACN,aACE;CAEF,cAAc;EACZ,MAAM;EACN,YAAY,CAAC;CACf;AACF;AAEA,MAAa,WAA2B;CACtC,MAAM;CACN,aACE;CAIF,cAAc;EACZ,MAAM;EACN,YAAY;GACV,UAAU;IACR,MAAM;IACN,aACE;GACJ;GACA,SAAS;IACP,MAAM;IACN,OAAO,EAAE,MAAM,SAAS;IACxB,aACE;GACJ;EACF;EACA,UAAU,CAAC,UAAU;CACvB;AACF;;;;ACnCA,MAAa,eAA+B;CAC1C,MAAM;CACN,aACE;CAEF,cAAc;EACZ,MAAM;EACN,YAAY;GACV,QAAQ;IACN,MAAM;IACN,MAAM;KACJ;KACA;KACA;KACA;KACA;KACA;KACA;KACA;KACA;KACA;KACA;KACA;KACA;KACA;KACA;IACF;IACA,aAAa;GACf;GACA,WAAW;IACT,MAAM;IACN,aACE;GACJ;GACA,eAAe;IACb,MAAM;IACN,aACE;GACJ;GACA,OAAO;IACL,MAAM;IACN,aAAa;GACf;GACA,SAAS;IACP,MAAM;IACN,aACE;GACJ;GACA,QAAQ;IACN,MAAM;IACN,YAAY,CAAC;IACb,aACE;GACJ;GACA,cAAc;IACZ,MAAM;IACN,aACE;GACJ;GACA,OAAO;IACL,MAAM;IACN,aACE;GACJ;GACA,aAAa;IACX,MAAM;IACN,aAAa;GACf;GACA,cAAc;IACZ,MAAM;IACN,OAAO,EAAE,MAAM,SAAS;IACxB,aACE;GACJ;GACA,aAAa;IACX,MAAM;IACN,aAAa;GACf;GACA,kBAAkB;IAChB,MAAM;IACN,OAAO,EAAE,MAAM,SAAS;IACxB,aACE;GACJ;GACA,gBAAgB;IACd,MAAM;IACN,aACE;GACJ;GACA,aAAa;IACX,MAAM;IACN,OAAO,EACL,OAAO,CACL,EAAE,MAAM,SAAS,GACjB;KACE,MAAM;KACN,YAAY;MACV,MAAM,EAAE,MAAM,SAAS;MACvB,UAAU,EAAE,MAAM,SAAS;MAC3B,cAAc,EAAE,MAAM,SAAS;KACjC;KACA,UAAU,CAAC,MAAM;IACnB,CACF,EACF;IACA,aACE;GACJ;GACA,IAAI;IACF,MAAM;IACN,OAAO,EAAE,MAAM,SAAS;IACxB,aAAa;GACf;GACA,IAAI;IACF,MAAM;IACN,OAAO,EAAE,MAAM,SAAS;IACxB,aAAa;GACf;GACA,KAAK;IACH,MAAM;IACN,OAAO,EAAE,MAAM,SAAS;IACxB,aAAa;GACf;GACA,SAAS;IACP,MAAM;IACN,aAAa;GACf;GACA,MAAM;IACJ,MAAM;IACN,aAAa;GACf;GACA,MAAM;IACJ,MAAM;IACN,aAAa;GACf;GACA,MAAM;IACJ,MAAM;IACN,aAAa;GACf;GACA,UAAU;IACR,MAAM;IACN,aAAa;G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f;EACF;EACA,UAAU,CAAC,MAAM;CACnB;AACF;AAEA,MAAa,kBAAkC;CAC7C,MAAM;CACN,aACE;CACF,cAAc;EACZ,MAAM;EACN,YAAY,EACV,MAAM;GACJ,MAAM;GACN,aAAa;EACf,EACF;EACA,UAAU,CAAC,MAAM;CACnB;AACF;AAEA,MAAa,iBAAiC;CAC5C,MAAM;CACN,aACE;CACF,cAAc;EACZ,MAAM;EACN,YAAY;GACV,MAAM;IACJ,MAAM;IACN,aAAa;GACf;GACA,gBAAgB;IACd,MAAM;IACN,aAAa;GACf;GACA,gBAAgB;IACd,MAAM;IACN,aAAa;GACf;EACF;EACA,UAAU;GAAC;GAAQ;GAAkB;EAAgB;CACvD;AACF;;;;;ACtDA,MAAa,mBAAqC;CAChD;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;AACF"}