@tencent-ai/agent-sdk 0.3.99 → 0.3.101

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 (471) hide show
  1. package/cli/CHANGELOG.md +50 -0
  2. package/cli/dist/codebuddy-headless.js +140 -131
  3. package/cli/dist/web-ui/assets/index-CIqmZV3y.js +440 -0
  4. package/cli/dist/web-ui/assets/index-Dt1puyHn.css +32 -0
  5. package/cli/dist/web-ui/docs/cn/cli/acp.md +152 -0
  6. package/cli/dist/web-ui/docs/cn/cli/agent-teams.md +327 -0
  7. package/cli/dist/web-ui/docs/cn/cli/bash-sandboxing.md +290 -0
  8. package/cli/dist/web-ui/docs/cn/cli/best-practices.md +554 -0
  9. package/cli/dist/web-ui/docs/cn/cli/channels-reference.md +293 -0
  10. package/cli/dist/web-ui/docs/cn/cli/channels.md +215 -0
  11. package/cli/dist/web-ui/docs/cn/cli/checkpointing.md +51 -0
  12. package/cli/dist/web-ui/docs/cn/cli/cli-reference.md +187 -0
  13. package/cli/dist/web-ui/docs/cn/cli/common-workflows.md +1013 -0
  14. package/cli/dist/web-ui/docs/cn/cli/costs.md +174 -0
  15. package/cli/dist/web-ui/docs/cn/cli/devcontainer.md +553 -0
  16. package/cli/dist/web-ui/docs/cn/cli/env-vars.md +326 -0
  17. package/cli/dist/web-ui/docs/cn/cli/gitlab-ci-cd.md +357 -0
  18. package/cli/dist/web-ui/docs/cn/cli/headless.md +258 -0
  19. package/cli/dist/web-ui/docs/cn/cli/hooks-guide.md +9 -0
  20. package/cli/dist/web-ui/docs/cn/cli/hooks.md +805 -0
  21. package/cli/dist/web-ui/docs/cn/cli/iam.md +530 -0
  22. package/cli/dist/web-ui/docs/cn/cli/ide-integrations.md +92 -0
  23. package/cli/dist/web-ui/docs/cn/cli/installation.md +291 -0
  24. package/cli/dist/web-ui/docs/cn/cli/interactive-mode.md +233 -0
  25. package/cli/dist/web-ui/docs/cn/cli/mcp.md +739 -0
  26. package/cli/dist/web-ui/docs/cn/cli/memory.md +436 -0
  27. package/cli/dist/web-ui/docs/cn/cli/models.md +356 -0
  28. package/cli/dist/web-ui/docs/cn/cli/overview.md +100 -0
  29. package/cli/dist/web-ui/docs/cn/cli/plugin-marketplaces.md +533 -0
  30. package/cli/dist/web-ui/docs/cn/cli/plugins-reference.md +774 -0
  31. package/cli/dist/web-ui/docs/cn/cli/plugins.md +689 -0
  32. package/cli/dist/web-ui/docs/cn/cli/quickstart.md +249 -0
  33. package/cli/dist/web-ui/docs/cn/cli/release-notes/README.md +200 -0
  34. package/cli/dist/web-ui/docs/cn/cli/release-notes/v2.10.0.md +23 -0
  35. package/cli/dist/web-ui/docs/cn/cli/release-notes/v2.10.1.md +5 -0
  36. package/cli/dist/web-ui/docs/cn/cli/release-notes/v2.11.0.md +24 -0
  37. package/cli/dist/web-ui/docs/cn/cli/release-notes/v2.12.0.md +21 -0
  38. package/cli/dist/web-ui/docs/cn/cli/release-notes/v2.13.0.md +20 -0
  39. package/cli/dist/web-ui/docs/cn/cli/release-notes/v2.14.0.md +22 -0
  40. package/cli/dist/web-ui/docs/cn/cli/release-notes/v2.14.1.md +8 -0
  41. package/cli/dist/web-ui/docs/cn/cli/release-notes/v2.15.0.md +18 -0
  42. package/cli/dist/web-ui/docs/cn/cli/release-notes/v2.15.1.md +11 -0
  43. package/cli/dist/web-ui/docs/cn/cli/release-notes/v2.16.0.md +20 -0
  44. package/cli/dist/web-ui/docs/cn/cli/release-notes/v2.17.0.md +29 -0
  45. package/cli/dist/web-ui/docs/cn/cli/release-notes/v2.18.0.md +17 -0
  46. package/cli/dist/web-ui/docs/cn/cli/release-notes/v2.19.0.md +11 -0
  47. package/cli/dist/web-ui/docs/cn/cli/release-notes/v2.19.1.md +14 -0
  48. package/cli/dist/web-ui/docs/cn/cli/release-notes/v2.19.2.md +11 -0
  49. package/cli/dist/web-ui/docs/cn/cli/release-notes/v2.20.0.md +23 -0
  50. package/cli/dist/web-ui/docs/cn/cli/release-notes/v2.20.1.md +15 -0
  51. package/cli/dist/web-ui/docs/cn/cli/release-notes/v2.21.0.md +13 -0
  52. package/cli/dist/web-ui/docs/cn/cli/release-notes/v2.22.0.md +16 -0
  53. package/cli/dist/web-ui/docs/cn/cli/release-notes/v2.23.0.md +20 -0
  54. package/cli/dist/web-ui/docs/cn/cli/release-notes/v2.23.2.md +5 -0
  55. package/cli/dist/web-ui/docs/cn/cli/release-notes/v2.23.3.md +5 -0
  56. package/cli/dist/web-ui/docs/cn/cli/release-notes/v2.23.4.md +15 -0
  57. package/cli/dist/web-ui/docs/cn/cli/release-notes/v2.23.5.md +11 -0
  58. package/cli/dist/web-ui/docs/cn/cli/release-notes/v2.24.0.md +17 -0
  59. package/cli/dist/web-ui/docs/cn/cli/release-notes/v2.25.0.md +18 -0
  60. package/cli/dist/web-ui/docs/cn/cli/release-notes/v2.25.1.md +21 -0
  61. package/cli/dist/web-ui/docs/cn/cli/release-notes/v2.26.0.md +18 -0
  62. package/cli/dist/web-ui/docs/cn/cli/release-notes/v2.27.0.md +16 -0
  63. package/cli/dist/web-ui/docs/cn/cli/release-notes/v2.27.1.md +16 -0
  64. package/cli/dist/web-ui/docs/cn/cli/release-notes/v2.27.2.md +7 -0
  65. package/cli/dist/web-ui/docs/cn/cli/release-notes/v2.27.3.md +15 -0
  66. package/cli/dist/web-ui/docs/cn/cli/release-notes/v2.28.0.md +26 -0
  67. package/cli/dist/web-ui/docs/cn/cli/release-notes/v2.28.1.md +5 -0
  68. package/cli/dist/web-ui/docs/cn/cli/release-notes/v2.29.0.md +35 -0
  69. package/cli/dist/web-ui/docs/cn/cli/release-notes/v2.3.1.md +16 -0
  70. package/cli/dist/web-ui/docs/cn/cli/release-notes/v2.30.0.md +19 -0
  71. package/cli/dist/web-ui/docs/cn/cli/release-notes/v2.30.1.md +5 -0
  72. package/cli/dist/web-ui/docs/cn/cli/release-notes/v2.31.0.md +51 -0
  73. package/cli/dist/web-ui/docs/cn/cli/release-notes/v2.31.1.md +11 -0
  74. package/cli/dist/web-ui/docs/cn/cli/release-notes/v2.31.2.md +16 -0
  75. package/cli/dist/web-ui/docs/cn/cli/release-notes/v2.32.0.md +19 -0
  76. package/cli/dist/web-ui/docs/cn/cli/release-notes/v2.33.0.md +28 -0
  77. package/cli/dist/web-ui/docs/cn/cli/release-notes/v2.33.1.md +7 -0
  78. package/cli/dist/web-ui/docs/cn/cli/release-notes/v2.36.3.md +17 -0
  79. package/cli/dist/web-ui/docs/cn/cli/release-notes/v2.37.0.md +15 -0
  80. package/cli/dist/web-ui/docs/cn/cli/release-notes/v2.37.1.md +15 -0
  81. package/cli/dist/web-ui/docs/cn/cli/release-notes/v2.37.10.md +5 -0
  82. package/cli/dist/web-ui/docs/cn/cli/release-notes/v2.37.11.md +8 -0
  83. package/cli/dist/web-ui/docs/cn/cli/release-notes/v2.37.12.md +14 -0
  84. package/cli/dist/web-ui/docs/cn/cli/release-notes/v2.37.13.md +11 -0
  85. package/cli/dist/web-ui/docs/cn/cli/release-notes/v2.37.14.md +24 -0
  86. package/cli/dist/web-ui/docs/cn/cli/release-notes/v2.37.15.md +11 -0
  87. package/cli/dist/web-ui/docs/cn/cli/release-notes/v2.37.16.md +9 -0
  88. package/cli/dist/web-ui/docs/cn/cli/release-notes/v2.37.17.md +5 -0
  89. package/cli/dist/web-ui/docs/cn/cli/release-notes/v2.37.18.md +9 -0
  90. package/cli/dist/web-ui/docs/cn/cli/release-notes/v2.37.19.md +5 -0
  91. package/cli/dist/web-ui/docs/cn/cli/release-notes/v2.37.2.md +28 -0
  92. package/cli/dist/web-ui/docs/cn/cli/release-notes/v2.37.20.md +8 -0
  93. package/cli/dist/web-ui/docs/cn/cli/release-notes/v2.37.3.md +22 -0
  94. package/cli/dist/web-ui/docs/cn/cli/release-notes/v2.37.4.md +19 -0
  95. package/cli/dist/web-ui/docs/cn/cli/release-notes/v2.37.5.md +5 -0
  96. package/cli/dist/web-ui/docs/cn/cli/release-notes/v2.37.6.md +5 -0
  97. package/cli/dist/web-ui/docs/cn/cli/release-notes/v2.37.7.md +5 -0
  98. package/cli/dist/web-ui/docs/cn/cli/release-notes/v2.37.8.md +5 -0
  99. package/cli/dist/web-ui/docs/cn/cli/release-notes/v2.37.9.md +8 -0
  100. package/cli/dist/web-ui/docs/cn/cli/release-notes/v2.38.0.md +22 -0
  101. package/cli/dist/web-ui/docs/cn/cli/release-notes/v2.38.1.md +6 -0
  102. package/cli/dist/web-ui/docs/cn/cli/release-notes/v2.38.2.md +9 -0
  103. package/cli/dist/web-ui/docs/cn/cli/release-notes/v2.39.0.md +18 -0
  104. package/cli/dist/web-ui/docs/cn/cli/release-notes/v2.4.0.md +19 -0
  105. package/cli/dist/web-ui/docs/cn/cli/release-notes/v2.40.0.md +20 -0
  106. package/cli/dist/web-ui/docs/cn/cli/release-notes/v2.40.1.md +6 -0
  107. package/cli/dist/web-ui/docs/cn/cli/release-notes/v2.41.0.md +15 -0
  108. package/cli/dist/web-ui/docs/cn/cli/release-notes/v2.41.1.md +6 -0
  109. package/cli/dist/web-ui/docs/cn/cli/release-notes/v2.41.2.md +5 -0
  110. package/cli/dist/web-ui/docs/cn/cli/release-notes/v2.41.3.md +8 -0
  111. package/cli/dist/web-ui/docs/cn/cli/release-notes/v2.41.4.md +5 -0
  112. package/cli/dist/web-ui/docs/cn/cli/release-notes/v2.41.5.md +10 -0
  113. package/cli/dist/web-ui/docs/cn/cli/release-notes/v2.41.6.md +9 -0
  114. package/cli/dist/web-ui/docs/cn/cli/release-notes/v2.41.7.md +14 -0
  115. package/cli/dist/web-ui/docs/cn/cli/release-notes/v2.41.8.md +18 -0
  116. package/cli/dist/web-ui/docs/cn/cli/release-notes/v2.42.0.md +39 -0
  117. package/cli/dist/web-ui/docs/cn/cli/release-notes/v2.42.1.md +8 -0
  118. package/cli/dist/web-ui/docs/cn/cli/release-notes/v2.42.3.md +18 -0
  119. package/cli/dist/web-ui/docs/cn/cli/release-notes/v2.43.0.md +27 -0
  120. package/cli/dist/web-ui/docs/cn/cli/release-notes/v2.43.1.md +27 -0
  121. package/cli/dist/web-ui/docs/cn/cli/release-notes/v2.44.0.md +11 -0
  122. package/cli/dist/web-ui/docs/cn/cli/release-notes/v2.44.1.md +22 -0
  123. package/cli/dist/web-ui/docs/cn/cli/release-notes/v2.45.0.md +34 -0
  124. package/cli/dist/web-ui/docs/cn/cli/release-notes/v2.45.1.md +7 -0
  125. package/cli/dist/web-ui/docs/cn/cli/release-notes/v2.46.0.md +12 -0
  126. package/cli/dist/web-ui/docs/cn/cli/release-notes/v2.47.0.md +20 -0
  127. package/cli/dist/web-ui/docs/cn/cli/release-notes/v2.48.0.md +32 -0
  128. package/cli/dist/web-ui/docs/cn/cli/release-notes/v2.48.1.md +11 -0
  129. package/cli/dist/web-ui/docs/cn/cli/release-notes/v2.49.0.md +26 -0
  130. package/cli/dist/web-ui/docs/cn/cli/release-notes/v2.49.1.md +14 -0
  131. package/cli/dist/web-ui/docs/cn/cli/release-notes/v2.49.2.md +39 -0
  132. package/cli/dist/web-ui/docs/cn/cli/release-notes/v2.49.3.md +7 -0
  133. package/cli/dist/web-ui/docs/cn/cli/release-notes/v2.49.5.md +11 -0
  134. package/cli/dist/web-ui/docs/cn/cli/release-notes/v2.49.6.md +9 -0
  135. package/cli/dist/web-ui/docs/cn/cli/release-notes/v2.49.7.md +7 -0
  136. package/cli/dist/web-ui/docs/cn/cli/release-notes/v2.5.0.md +24 -0
  137. package/cli/dist/web-ui/docs/cn/cli/release-notes/v2.50.0.md +25 -0
  138. package/cli/dist/web-ui/docs/cn/cli/release-notes/v2.50.1.md +9 -0
  139. package/cli/dist/web-ui/docs/cn/cli/release-notes/v2.50.2.md +11 -0
  140. package/cli/dist/web-ui/docs/cn/cli/release-notes/v2.50.3.md +5 -0
  141. package/cli/dist/web-ui/docs/cn/cli/release-notes/v2.50.4.md +17 -0
  142. package/cli/dist/web-ui/docs/cn/cli/release-notes/v2.50.5.md +16 -0
  143. package/cli/dist/web-ui/docs/cn/cli/release-notes/v2.50.6.md +15 -0
  144. package/cli/dist/web-ui/docs/cn/cli/release-notes/v2.50.7.md +15 -0
  145. package/cli/dist/web-ui/docs/cn/cli/release-notes/v2.51.0.md +24 -0
  146. package/cli/dist/web-ui/docs/cn/cli/release-notes/v2.51.1.md +17 -0
  147. package/cli/dist/web-ui/docs/cn/cli/release-notes/v2.51.2.md +5 -0
  148. package/cli/dist/web-ui/docs/cn/cli/release-notes/v2.52.0.md +30 -0
  149. package/cli/dist/web-ui/docs/cn/cli/release-notes/v2.52.1.md +28 -0
  150. package/cli/dist/web-ui/docs/cn/cli/release-notes/v2.52.2.md +12 -0
  151. package/cli/dist/web-ui/docs/cn/cli/release-notes/v2.52.3.md +13 -0
  152. package/cli/dist/web-ui/docs/cn/cli/release-notes/v2.52.4.md +27 -0
  153. package/cli/dist/web-ui/docs/cn/cli/release-notes/v2.52.5.md +21 -0
  154. package/cli/dist/web-ui/docs/cn/cli/release-notes/v2.52.6.md +7 -0
  155. package/cli/dist/web-ui/docs/cn/cli/release-notes/v2.53.0.md +29 -0
  156. package/cli/dist/web-ui/docs/cn/cli/release-notes/v2.54.0.md +26 -0
  157. package/cli/dist/web-ui/docs/cn/cli/release-notes/v2.55.0.md +21 -0
  158. package/cli/dist/web-ui/docs/cn/cli/release-notes/v2.55.1.md +13 -0
  159. package/cli/dist/web-ui/docs/cn/cli/release-notes/v2.56.0.md +20 -0
  160. package/cli/dist/web-ui/docs/cn/cli/release-notes/v2.56.1.md +5 -0
  161. package/cli/dist/web-ui/docs/cn/cli/release-notes/v2.57.0.md +32 -0
  162. package/cli/dist/web-ui/docs/cn/cli/release-notes/v2.57.1.md +10 -0
  163. package/cli/dist/web-ui/docs/cn/cli/release-notes/v2.58.0.md +34 -0
  164. package/cli/dist/web-ui/docs/cn/cli/release-notes/v2.59.0.md +28 -0
  165. package/cli/dist/web-ui/docs/cn/cli/release-notes/v2.6.0.md +5 -0
  166. package/cli/dist/web-ui/docs/cn/cli/release-notes/v2.6.1.md +10 -0
  167. package/cli/dist/web-ui/docs/cn/cli/release-notes/v2.60.0.md +20 -0
  168. package/cli/dist/web-ui/docs/cn/cli/release-notes/v2.61.0.md +29 -0
  169. package/cli/dist/web-ui/docs/cn/cli/release-notes/v2.61.1.md +5 -0
  170. package/cli/dist/web-ui/docs/cn/cli/release-notes/v2.61.2.md +6 -0
  171. package/cli/dist/web-ui/docs/cn/cli/release-notes/v2.61.3.md +13 -0
  172. package/cli/dist/web-ui/docs/cn/cli/release-notes/v2.62.0.md +21 -0
  173. package/cli/dist/web-ui/docs/cn/cli/release-notes/v2.62.1.md +11 -0
  174. package/cli/dist/web-ui/docs/cn/cli/release-notes/v2.63.0.md +19 -0
  175. package/cli/dist/web-ui/docs/cn/cli/release-notes/v2.63.1.md +5 -0
  176. package/cli/dist/web-ui/docs/cn/cli/release-notes/v2.63.2.md +7 -0
  177. package/cli/dist/web-ui/docs/cn/cli/release-notes/v2.63.3.md +6 -0
  178. package/cli/dist/web-ui/docs/cn/cli/release-notes/v2.63.4.md +8 -0
  179. package/cli/dist/web-ui/docs/cn/cli/release-notes/v2.63.5.md +6 -0
  180. package/cli/dist/web-ui/docs/cn/cli/release-notes/v2.64.0.md +37 -0
  181. package/cli/dist/web-ui/docs/cn/cli/release-notes/v2.64.1.md +6 -0
  182. package/cli/dist/web-ui/docs/cn/cli/release-notes/v2.64.2.md +11 -0
  183. package/cli/dist/web-ui/docs/cn/cli/release-notes/v2.65.0.md +19 -0
  184. package/cli/dist/web-ui/docs/cn/cli/release-notes/v2.65.1.md +11 -0
  185. package/cli/dist/web-ui/docs/cn/cli/release-notes/v2.66.0.md +15 -0
  186. package/cli/dist/web-ui/docs/cn/cli/release-notes/v2.66.1.md +14 -0
  187. package/cli/dist/web-ui/docs/cn/cli/release-notes/v2.66.2.md +5 -0
  188. package/cli/dist/web-ui/docs/cn/cli/release-notes/v2.67.0.md +33 -0
  189. package/cli/dist/web-ui/docs/cn/cli/release-notes/v2.68.0.md +28 -0
  190. package/cli/dist/web-ui/docs/cn/cli/release-notes/v2.7.0.md +16 -0
  191. package/cli/dist/web-ui/docs/cn/cli/release-notes/v2.8.0.md +18 -0
  192. package/cli/dist/web-ui/docs/cn/cli/release-notes/v2.8.1.md +17 -0
  193. package/cli/dist/web-ui/docs/cn/cli/release-notes/v2.8.2.md +5 -0
  194. package/cli/dist/web-ui/docs/cn/cli/release-notes/v2.8.3.md +14 -0
  195. package/cli/dist/web-ui/docs/cn/cli/release-notes/v2.8.4.md +9 -0
  196. package/cli/dist/web-ui/docs/cn/cli/release-notes/v2.8.5.md +5 -0
  197. package/cli/dist/web-ui/docs/cn/cli/release-notes/v2.8.6.md +14 -0
  198. package/cli/dist/web-ui/docs/cn/cli/release-notes/v2.9.0.md +5 -0
  199. package/cli/dist/web-ui/docs/cn/cli/remote-control.md +247 -0
  200. package/cli/dist/web-ui/docs/cn/cli/sandboxing.md +316 -0
  201. package/cli/dist/web-ui/docs/cn/cli/scheduled-tasks.md +161 -0
  202. package/cli/dist/web-ui/docs/cn/cli/sdk-custom-tools.md +1195 -0
  203. package/cli/dist/web-ui/docs/cn/cli/sdk-demos.md +347 -0
  204. package/cli/dist/web-ui/docs/cn/cli/sdk-hooks.md +803 -0
  205. package/cli/dist/web-ui/docs/cn/cli/sdk-mcp.md +643 -0
  206. package/cli/dist/web-ui/docs/cn/cli/sdk-permissions.md +501 -0
  207. package/cli/dist/web-ui/docs/cn/cli/sdk-python.md +783 -0
  208. package/cli/dist/web-ui/docs/cn/cli/sdk-sessions.md +332 -0
  209. package/cli/dist/web-ui/docs/cn/cli/sdk-typescript.md +759 -0
  210. package/cli/dist/web-ui/docs/cn/cli/sdk.md +1105 -0
  211. package/cli/dist/web-ui/docs/cn/cli/security.md +387 -0
  212. package/cli/dist/web-ui/docs/cn/cli/settings.md +602 -0
  213. package/cli/dist/web-ui/docs/cn/cli/skills.md +448 -0
  214. package/cli/dist/web-ui/docs/cn/cli/slash-commands.md +397 -0
  215. package/cli/dist/web-ui/docs/cn/cli/statusline.md +525 -0
  216. package/cli/dist/web-ui/docs/cn/cli/sub-agents.md +634 -0
  217. package/cli/dist/web-ui/docs/cn/cli/terminal-config.md +77 -0
  218. package/cli/dist/web-ui/docs/cn/cli/tools-reference.md +99 -0
  219. package/cli/dist/web-ui/docs/cn/cli/troubleshooting.md +190 -0
  220. package/cli/dist/web-ui/docs/cn/cli/web-ui.md +164 -0
  221. package/cli/dist/web-ui/docs/cn/cli/wecom-bot-setup.md +274 -0
  222. package/cli/dist/web-ui/docs/cn/cli/worktree.md +660 -0
  223. package/cli/dist/web-ui/docs/en/cli/acp.md +126 -0
  224. package/cli/dist/web-ui/docs/en/cli/agent-teams.md +327 -0
  225. package/cli/dist/web-ui/docs/en/cli/bash-sandboxing.md +290 -0
  226. package/cli/dist/web-ui/docs/en/cli/best-practices.md +554 -0
  227. package/cli/dist/web-ui/docs/en/cli/channels-reference.md +293 -0
  228. package/cli/dist/web-ui/docs/en/cli/channels.md +215 -0
  229. package/cli/dist/web-ui/docs/en/cli/checkpointing.md +53 -0
  230. package/cli/dist/web-ui/docs/en/cli/cli-reference.md +187 -0
  231. package/cli/dist/web-ui/docs/en/cli/common-workflows.md +1013 -0
  232. package/cli/dist/web-ui/docs/en/cli/costs.md +174 -0
  233. package/cli/dist/web-ui/docs/en/cli/devcontainer.md +553 -0
  234. package/cli/dist/web-ui/docs/en/cli/env-vars.md +326 -0
  235. package/cli/dist/web-ui/docs/en/cli/gitlab-ci-cd.md +357 -0
  236. package/cli/dist/web-ui/docs/en/cli/headless.md +258 -0
  237. package/cli/dist/web-ui/docs/en/cli/hooks-guide.md +9 -0
  238. package/cli/dist/web-ui/docs/en/cli/hooks.md +801 -0
  239. package/cli/dist/web-ui/docs/en/cli/iam.md +530 -0
  240. package/cli/dist/web-ui/docs/en/cli/ide-integrations.md +92 -0
  241. package/cli/dist/web-ui/docs/en/cli/installation.md +266 -0
  242. package/cli/dist/web-ui/docs/en/cli/interactive-mode.md +233 -0
  243. package/cli/dist/web-ui/docs/en/cli/mcp.md +739 -0
  244. package/cli/dist/web-ui/docs/en/cli/memory.md +436 -0
  245. package/cli/dist/web-ui/docs/en/cli/models.md +355 -0
  246. package/cli/dist/web-ui/docs/en/cli/overview.md +100 -0
  247. package/cli/dist/web-ui/docs/en/cli/plugin-marketplaces.md +534 -0
  248. package/cli/dist/web-ui/docs/en/cli/plugins-reference.md +774 -0
  249. package/cli/dist/web-ui/docs/en/cli/plugins.md +688 -0
  250. package/cli/dist/web-ui/docs/en/cli/quickstart.md +249 -0
  251. package/cli/dist/web-ui/docs/en/cli/release-notes/README.md +194 -0
  252. package/cli/dist/web-ui/docs/en/cli/release-notes/v2.10.0.md +23 -0
  253. package/cli/dist/web-ui/docs/en/cli/release-notes/v2.10.1.md +5 -0
  254. package/cli/dist/web-ui/docs/en/cli/release-notes/v2.11.0.md +24 -0
  255. package/cli/dist/web-ui/docs/en/cli/release-notes/v2.12.0.md +21 -0
  256. package/cli/dist/web-ui/docs/en/cli/release-notes/v2.13.0.md +20 -0
  257. package/cli/dist/web-ui/docs/en/cli/release-notes/v2.14.0.md +22 -0
  258. package/cli/dist/web-ui/docs/en/cli/release-notes/v2.14.1.md +8 -0
  259. package/cli/dist/web-ui/docs/en/cli/release-notes/v2.15.0.md +18 -0
  260. package/cli/dist/web-ui/docs/en/cli/release-notes/v2.15.1.md +11 -0
  261. package/cli/dist/web-ui/docs/en/cli/release-notes/v2.16.0.md +20 -0
  262. package/cli/dist/web-ui/docs/en/cli/release-notes/v2.17.0.md +29 -0
  263. package/cli/dist/web-ui/docs/en/cli/release-notes/v2.18.0.md +17 -0
  264. package/cli/dist/web-ui/docs/en/cli/release-notes/v2.19.0.md +11 -0
  265. package/cli/dist/web-ui/docs/en/cli/release-notes/v2.19.1.md +14 -0
  266. package/cli/dist/web-ui/docs/en/cli/release-notes/v2.19.2.md +11 -0
  267. package/cli/dist/web-ui/docs/en/cli/release-notes/v2.20.0.md +23 -0
  268. package/cli/dist/web-ui/docs/en/cli/release-notes/v2.20.1.md +15 -0
  269. package/cli/dist/web-ui/docs/en/cli/release-notes/v2.21.0.md +13 -0
  270. package/cli/dist/web-ui/docs/en/cli/release-notes/v2.22.0.md +16 -0
  271. package/cli/dist/web-ui/docs/en/cli/release-notes/v2.23.0.md +41 -0
  272. package/cli/dist/web-ui/docs/en/cli/release-notes/v2.23.2.md +5 -0
  273. package/cli/dist/web-ui/docs/en/cli/release-notes/v2.23.3.md +5 -0
  274. package/cli/dist/web-ui/docs/en/cli/release-notes/v2.23.4.md +15 -0
  275. package/cli/dist/web-ui/docs/en/cli/release-notes/v2.23.5.md +11 -0
  276. package/cli/dist/web-ui/docs/en/cli/release-notes/v2.24.0.md +17 -0
  277. package/cli/dist/web-ui/docs/en/cli/release-notes/v2.25.0.md +18 -0
  278. package/cli/dist/web-ui/docs/en/cli/release-notes/v2.25.1.md +21 -0
  279. package/cli/dist/web-ui/docs/en/cli/release-notes/v2.26.0.md +18 -0
  280. package/cli/dist/web-ui/docs/en/cli/release-notes/v2.27.0.md +16 -0
  281. package/cli/dist/web-ui/docs/en/cli/release-notes/v2.27.1.md +16 -0
  282. package/cli/dist/web-ui/docs/en/cli/release-notes/v2.27.2.md +7 -0
  283. package/cli/dist/web-ui/docs/en/cli/release-notes/v2.27.3.md +15 -0
  284. package/cli/dist/web-ui/docs/en/cli/release-notes/v2.28.0.md +26 -0
  285. package/cli/dist/web-ui/docs/en/cli/release-notes/v2.28.1.md +5 -0
  286. package/cli/dist/web-ui/docs/en/cli/release-notes/v2.29.0.md +35 -0
  287. package/cli/dist/web-ui/docs/en/cli/release-notes/v2.3.1.md +16 -0
  288. package/cli/dist/web-ui/docs/en/cli/release-notes/v2.30.0.md +19 -0
  289. package/cli/dist/web-ui/docs/en/cli/release-notes/v2.30.1.md +5 -0
  290. package/cli/dist/web-ui/docs/en/cli/release-notes/v2.31.0.md +51 -0
  291. package/cli/dist/web-ui/docs/en/cli/release-notes/v2.31.1.md +11 -0
  292. package/cli/dist/web-ui/docs/en/cli/release-notes/v2.31.2.md +16 -0
  293. package/cli/dist/web-ui/docs/en/cli/release-notes/v2.32.0.md +19 -0
  294. package/cli/dist/web-ui/docs/en/cli/release-notes/v2.33.0.md +28 -0
  295. package/cli/dist/web-ui/docs/en/cli/release-notes/v2.33.1.md +7 -0
  296. package/cli/dist/web-ui/docs/en/cli/release-notes/v2.34.0.md +27 -0
  297. package/cli/dist/web-ui/docs/en/cli/release-notes/v2.34.1.md +7 -0
  298. package/cli/dist/web-ui/docs/en/cli/release-notes/v2.35.0.md +22 -0
  299. package/cli/dist/web-ui/docs/en/cli/release-notes/v2.36.0.md +23 -0
  300. package/cli/dist/web-ui/docs/en/cli/release-notes/v2.36.1.md +5 -0
  301. package/cli/dist/web-ui/docs/en/cli/release-notes/v2.36.2.md +22 -0
  302. package/cli/dist/web-ui/docs/en/cli/release-notes/v2.36.3.md +17 -0
  303. package/cli/dist/web-ui/docs/en/cli/release-notes/v2.37.0.md +15 -0
  304. package/cli/dist/web-ui/docs/en/cli/release-notes/v2.37.1.md +15 -0
  305. package/cli/dist/web-ui/docs/en/cli/release-notes/v2.37.10.md +5 -0
  306. package/cli/dist/web-ui/docs/en/cli/release-notes/v2.37.11.md +8 -0
  307. package/cli/dist/web-ui/docs/en/cli/release-notes/v2.37.12.md +14 -0
  308. package/cli/dist/web-ui/docs/en/cli/release-notes/v2.37.13.md +11 -0
  309. package/cli/dist/web-ui/docs/en/cli/release-notes/v2.37.14.md +24 -0
  310. package/cli/dist/web-ui/docs/en/cli/release-notes/v2.37.15.md +11 -0
  311. package/cli/dist/web-ui/docs/en/cli/release-notes/v2.37.16.md +9 -0
  312. package/cli/dist/web-ui/docs/en/cli/release-notes/v2.37.17.md +5 -0
  313. package/cli/dist/web-ui/docs/en/cli/release-notes/v2.37.18.md +9 -0
  314. package/cli/dist/web-ui/docs/en/cli/release-notes/v2.37.19.md +5 -0
  315. package/cli/dist/web-ui/docs/en/cli/release-notes/v2.37.2.md +28 -0
  316. package/cli/dist/web-ui/docs/en/cli/release-notes/v2.37.20.md +8 -0
  317. package/cli/dist/web-ui/docs/en/cli/release-notes/v2.37.3.md +22 -0
  318. package/cli/dist/web-ui/docs/en/cli/release-notes/v2.37.4.md +19 -0
  319. package/cli/dist/web-ui/docs/en/cli/release-notes/v2.37.5.md +5 -0
  320. package/cli/dist/web-ui/docs/en/cli/release-notes/v2.37.6.md +5 -0
  321. package/cli/dist/web-ui/docs/en/cli/release-notes/v2.37.7.md +5 -0
  322. package/cli/dist/web-ui/docs/en/cli/release-notes/v2.37.8.md +5 -0
  323. package/cli/dist/web-ui/docs/en/cli/release-notes/v2.37.9.md +8 -0
  324. package/cli/dist/web-ui/docs/en/cli/release-notes/v2.38.0.md +22 -0
  325. package/cli/dist/web-ui/docs/en/cli/release-notes/v2.38.1.md +6 -0
  326. package/cli/dist/web-ui/docs/en/cli/release-notes/v2.38.2.md +9 -0
  327. package/cli/dist/web-ui/docs/en/cli/release-notes/v2.39.0.md +18 -0
  328. package/cli/dist/web-ui/docs/en/cli/release-notes/v2.4.0.md +19 -0
  329. package/cli/dist/web-ui/docs/en/cli/release-notes/v2.40.0.md +20 -0
  330. package/cli/dist/web-ui/docs/en/cli/release-notes/v2.40.1.md +6 -0
  331. package/cli/dist/web-ui/docs/en/cli/release-notes/v2.41.0.md +15 -0
  332. package/cli/dist/web-ui/docs/en/cli/release-notes/v2.41.1.md +6 -0
  333. package/cli/dist/web-ui/docs/en/cli/release-notes/v2.41.2.md +5 -0
  334. package/cli/dist/web-ui/docs/en/cli/release-notes/v2.41.3.md +8 -0
  335. package/cli/dist/web-ui/docs/en/cli/release-notes/v2.41.4.md +5 -0
  336. package/cli/dist/web-ui/docs/en/cli/release-notes/v2.41.5.md +10 -0
  337. package/cli/dist/web-ui/docs/en/cli/release-notes/v2.41.6.md +9 -0
  338. package/cli/dist/web-ui/docs/en/cli/release-notes/v2.41.7.md +14 -0
  339. package/cli/dist/web-ui/docs/en/cli/release-notes/v2.41.8.md +18 -0
  340. package/cli/dist/web-ui/docs/en/cli/release-notes/v2.42.0.md +39 -0
  341. package/cli/dist/web-ui/docs/en/cli/release-notes/v2.42.1.md +8 -0
  342. package/cli/dist/web-ui/docs/en/cli/release-notes/v2.42.3.md +18 -0
  343. package/cli/dist/web-ui/docs/en/cli/release-notes/v2.43.0.md +27 -0
  344. package/cli/dist/web-ui/docs/en/cli/release-notes/v2.43.1.md +27 -0
  345. package/cli/dist/web-ui/docs/en/cli/release-notes/v2.44.0.md +11 -0
  346. package/cli/dist/web-ui/docs/en/cli/release-notes/v2.44.1.md +22 -0
  347. package/cli/dist/web-ui/docs/en/cli/release-notes/v2.45.0.md +34 -0
  348. package/cli/dist/web-ui/docs/en/cli/release-notes/v2.45.1.md +7 -0
  349. package/cli/dist/web-ui/docs/en/cli/release-notes/v2.46.0.md +12 -0
  350. package/cli/dist/web-ui/docs/en/cli/release-notes/v2.47.0.md +20 -0
  351. package/cli/dist/web-ui/docs/en/cli/release-notes/v2.48.0.md +32 -0
  352. package/cli/dist/web-ui/docs/en/cli/release-notes/v2.48.1.md +11 -0
  353. package/cli/dist/web-ui/docs/en/cli/release-notes/v2.49.0.md +26 -0
  354. package/cli/dist/web-ui/docs/en/cli/release-notes/v2.49.1.md +14 -0
  355. package/cli/dist/web-ui/docs/en/cli/release-notes/v2.49.2.md +39 -0
  356. package/cli/dist/web-ui/docs/en/cli/release-notes/v2.49.3.md +7 -0
  357. package/cli/dist/web-ui/docs/en/cli/release-notes/v2.49.5.md +11 -0
  358. package/cli/dist/web-ui/docs/en/cli/release-notes/v2.49.6.md +9 -0
  359. package/cli/dist/web-ui/docs/en/cli/release-notes/v2.49.7.md +7 -0
  360. package/cli/dist/web-ui/docs/en/cli/release-notes/v2.5.0.md +24 -0
  361. package/cli/dist/web-ui/docs/en/cli/release-notes/v2.50.0.md +25 -0
  362. package/cli/dist/web-ui/docs/en/cli/release-notes/v2.50.1.md +9 -0
  363. package/cli/dist/web-ui/docs/en/cli/release-notes/v2.50.2.md +11 -0
  364. package/cli/dist/web-ui/docs/en/cli/release-notes/v2.50.3.md +5 -0
  365. package/cli/dist/web-ui/docs/en/cli/release-notes/v2.50.4.md +17 -0
  366. package/cli/dist/web-ui/docs/en/cli/release-notes/v2.50.5.md +16 -0
  367. package/cli/dist/web-ui/docs/en/cli/release-notes/v2.50.6.md +15 -0
  368. package/cli/dist/web-ui/docs/en/cli/release-notes/v2.50.7.md +15 -0
  369. package/cli/dist/web-ui/docs/en/cli/release-notes/v2.51.0.md +24 -0
  370. package/cli/dist/web-ui/docs/en/cli/release-notes/v2.51.1.md +17 -0
  371. package/cli/dist/web-ui/docs/en/cli/release-notes/v2.51.2.md +5 -0
  372. package/cli/dist/web-ui/docs/en/cli/release-notes/v2.52.0.md +30 -0
  373. package/cli/dist/web-ui/docs/en/cli/release-notes/v2.52.1.md +28 -0
  374. package/cli/dist/web-ui/docs/en/cli/release-notes/v2.52.2.md +12 -0
  375. package/cli/dist/web-ui/docs/en/cli/release-notes/v2.52.3.md +13 -0
  376. package/cli/dist/web-ui/docs/en/cli/release-notes/v2.52.4.md +27 -0
  377. package/cli/dist/web-ui/docs/en/cli/release-notes/v2.52.5.md +21 -0
  378. package/cli/dist/web-ui/docs/en/cli/release-notes/v2.52.6.md +7 -0
  379. package/cli/dist/web-ui/docs/en/cli/release-notes/v2.53.0.md +29 -0
  380. package/cli/dist/web-ui/docs/en/cli/release-notes/v2.54.0.md +26 -0
  381. package/cli/dist/web-ui/docs/en/cli/release-notes/v2.55.0.md +21 -0
  382. package/cli/dist/web-ui/docs/en/cli/release-notes/v2.55.1.md +13 -0
  383. package/cli/dist/web-ui/docs/en/cli/release-notes/v2.56.0.md +20 -0
  384. package/cli/dist/web-ui/docs/en/cli/release-notes/v2.56.1.md +5 -0
  385. package/cli/dist/web-ui/docs/en/cli/release-notes/v2.57.0.md +32 -0
  386. package/cli/dist/web-ui/docs/en/cli/release-notes/v2.57.1.md +10 -0
  387. package/cli/dist/web-ui/docs/en/cli/release-notes/v2.58.0.md +34 -0
  388. package/cli/dist/web-ui/docs/en/cli/release-notes/v2.59.0.md +28 -0
  389. package/cli/dist/web-ui/docs/en/cli/release-notes/v2.6.0.md +5 -0
  390. package/cli/dist/web-ui/docs/en/cli/release-notes/v2.6.1.md +10 -0
  391. package/cli/dist/web-ui/docs/en/cli/release-notes/v2.60.0.md +20 -0
  392. package/cli/dist/web-ui/docs/en/cli/release-notes/v2.61.0.md +29 -0
  393. package/cli/dist/web-ui/docs/en/cli/release-notes/v2.61.1.md +5 -0
  394. package/cli/dist/web-ui/docs/en/cli/release-notes/v2.61.2.md +6 -0
  395. package/cli/dist/web-ui/docs/en/cli/release-notes/v2.61.3.md +13 -0
  396. package/cli/dist/web-ui/docs/en/cli/release-notes/v2.62.0.md +21 -0
  397. package/cli/dist/web-ui/docs/en/cli/release-notes/v2.62.1.md +11 -0
  398. package/cli/dist/web-ui/docs/en/cli/release-notes/v2.63.0.md +19 -0
  399. package/cli/dist/web-ui/docs/en/cli/release-notes/v2.63.1.md +5 -0
  400. package/cli/dist/web-ui/docs/en/cli/release-notes/v2.63.2.md +7 -0
  401. package/cli/dist/web-ui/docs/en/cli/release-notes/v2.63.3.md +6 -0
  402. package/cli/dist/web-ui/docs/en/cli/release-notes/v2.63.4.md +8 -0
  403. package/cli/dist/web-ui/docs/en/cli/release-notes/v2.63.5.md +6 -0
  404. package/cli/dist/web-ui/docs/en/cli/release-notes/v2.64.0.md +37 -0
  405. package/cli/dist/web-ui/docs/en/cli/release-notes/v2.64.1.md +6 -0
  406. package/cli/dist/web-ui/docs/en/cli/release-notes/v2.64.2.md +11 -0
  407. package/cli/dist/web-ui/docs/en/cli/release-notes/v2.65.0.md +19 -0
  408. package/cli/dist/web-ui/docs/en/cli/release-notes/v2.65.1.md +11 -0
  409. package/cli/dist/web-ui/docs/en/cli/release-notes/v2.66.0.md +15 -0
  410. package/cli/dist/web-ui/docs/en/cli/release-notes/v2.66.1.md +14 -0
  411. package/cli/dist/web-ui/docs/en/cli/release-notes/v2.66.2.md +5 -0
  412. package/cli/dist/web-ui/docs/en/cli/release-notes/v2.67.0.md +33 -0
  413. package/cli/dist/web-ui/docs/en/cli/release-notes/v2.68.0.md +28 -0
  414. package/cli/dist/web-ui/docs/en/cli/release-notes/v2.7.0.md +16 -0
  415. package/cli/dist/web-ui/docs/en/cli/release-notes/v2.8.0.md +18 -0
  416. package/cli/dist/web-ui/docs/en/cli/release-notes/v2.8.1.md +17 -0
  417. package/cli/dist/web-ui/docs/en/cli/release-notes/v2.8.2.md +5 -0
  418. package/cli/dist/web-ui/docs/en/cli/release-notes/v2.8.3.md +14 -0
  419. package/cli/dist/web-ui/docs/en/cli/release-notes/v2.8.4.md +9 -0
  420. package/cli/dist/web-ui/docs/en/cli/release-notes/v2.8.5.md +5 -0
  421. package/cli/dist/web-ui/docs/en/cli/release-notes/v2.8.6.md +14 -0
  422. package/cli/dist/web-ui/docs/en/cli/release-notes/v2.9.0.md +5 -0
  423. package/cli/dist/web-ui/docs/en/cli/remote-control.md +247 -0
  424. package/cli/dist/web-ui/docs/en/cli/sandboxing.md +316 -0
  425. package/cli/dist/web-ui/docs/en/cli/scheduled-tasks.md +160 -0
  426. package/cli/dist/web-ui/docs/en/cli/sdk-custom-tools.md +1131 -0
  427. package/cli/dist/web-ui/docs/en/cli/sdk-demos.md +347 -0
  428. package/cli/dist/web-ui/docs/en/cli/sdk-hooks.md +813 -0
  429. package/cli/dist/web-ui/docs/en/cli/sdk-mcp.md +645 -0
  430. package/cli/dist/web-ui/docs/en/cli/sdk-permissions.md +461 -0
  431. package/cli/dist/web-ui/docs/en/cli/sdk-python.md +783 -0
  432. package/cli/dist/web-ui/docs/en/cli/sdk-sessions.md +340 -0
  433. package/cli/dist/web-ui/docs/en/cli/sdk-typescript.md +759 -0
  434. package/cli/dist/web-ui/docs/en/cli/sdk.md +1103 -0
  435. package/cli/dist/web-ui/docs/en/cli/security.md +387 -0
  436. package/cli/dist/web-ui/docs/en/cli/settings.md +602 -0
  437. package/cli/dist/web-ui/docs/en/cli/skills.md +448 -0
  438. package/cli/dist/web-ui/docs/en/cli/slash-commands.md +397 -0
  439. package/cli/dist/web-ui/docs/en/cli/statusline.md +525 -0
  440. package/cli/dist/web-ui/docs/en/cli/sub-agents.md +621 -0
  441. package/cli/dist/web-ui/docs/en/cli/terminal-config.md +77 -0
  442. package/cli/dist/web-ui/docs/en/cli/tools-reference.md +99 -0
  443. package/cli/dist/web-ui/docs/en/cli/troubleshooting.md +190 -0
  444. package/cli/dist/web-ui/docs/en/cli/web-ui.md +164 -0
  445. package/cli/dist/web-ui/docs/en/cli/wecom-bot-setup.md +274 -0
  446. package/cli/dist/web-ui/docs/en/cli/worktree.md +660 -0
  447. package/cli/dist/web-ui/docs/search-index-en.json +1 -0
  448. package/cli/dist/web-ui/docs/search-index-zh.json +1 -0
  449. package/cli/dist/web-ui/docs/sidebar-en.json +1 -0
  450. package/cli/dist/web-ui/docs/sidebar-zh.json +1 -0
  451. package/cli/dist/web-ui/index.html +2 -2
  452. package/cli/package.json +1 -1
  453. package/cli/product.cloudhosted.json +2 -2
  454. package/cli/product.internal.json +2 -2
  455. package/cli/product.ioa.json +2 -2
  456. package/cli/product.json +4 -3
  457. package/cli/product.selfhosted.json +2 -2
  458. package/lib/query.d.ts.map +1 -1
  459. package/lib/query.js +5 -1
  460. package/lib/query.js.map +1 -1
  461. package/lib/transport/index.d.ts +1 -1
  462. package/lib/transport/index.d.ts.map +1 -1
  463. package/lib/transport/process-transport.d.ts +1 -1
  464. package/lib/transport/process-transport.d.ts.map +1 -1
  465. package/lib/transport/process-transport.js +5 -1
  466. package/lib/transport/process-transport.js.map +1 -1
  467. package/lib/types.d.ts +3 -0
  468. package/lib/types.d.ts.map +1 -1
  469. package/package.json +1 -1
  470. package/cli/dist/web-ui/assets/index-BPT-qRRx.js +0 -411
  471. package/cli/dist/web-ui/assets/index-f_ibHSHw.css +0 -32
@@ -0,0 +1,813 @@
1
+ # SDK Hook System
2
+
3
+ > **Version Requirements**: This documentation is for CodeBuddy Agent SDK v0.1.0 and above.
4
+
5
+ This document explains how to use the Hook system in the SDK to insert custom logic before and after tool execution.
6
+
7
+ ## Table of Contents
8
+
9
+ - [Overview](#overview)
10
+ - [Hook Configuration](#hook-configuration)
11
+ - [Event Types](#event-types)
12
+ - [Hook Input](#hook-input)
13
+ - [Hook Output](#hook-output)
14
+ - [Examples](#examples)
15
+ - [Related Documentation](#related-documentation)
16
+
17
+ ## Overview
18
+
19
+ Hooks allow you to insert custom logic during CodeBuddy's session lifecycle, enabling:
20
+
21
+ - Validation and interception before tool calls
22
+ - Logging after tool execution
23
+ - Review of user-submitted content
24
+ - Initialization and cleanup at session start/end
25
+ - Custom workflows for `worktree` creation and cleanup
26
+
27
+ ### Supported Events
28
+
29
+ | Event | Trigger Timing |
30
+ |-------|----------------|
31
+ | `PreToolUse` | Before tool execution |
32
+ | `PostToolUse` | After successful tool execution |
33
+ | `UserPromptSubmit` | When user submits a message |
34
+ | `Stop` | When main Agent response ends |
35
+ | `SubagentStop` | When sub-agent ends |
36
+ | `PreCompact` | Before context compression |
37
+ | `WorktreeCreate` | When creating an isolated `worktree` |
38
+ | `WorktreeRemove` | When deleting an isolated `worktree` |
39
+ | `unstable_Checkpoint` | When a checkpoint is automatically created after file modifications |
40
+
41
+ ## Hook Configuration
42
+
43
+ Configure hooks through the `hooks` option. Each event can have multiple matchers, and each matcher can have multiple hook callbacks.
44
+
45
+ ### Basic Structure
46
+
47
+ ::: code-group
48
+
49
+ ```typescript [TypeScript]
50
+ import { query } from '@tencent-ai/agent-sdk';
51
+
52
+ const q = query({
53
+ prompt: 'Help me analyze the code',
54
+ options: {
55
+ model: 'deepseek-v3.1',
56
+ hooks: {
57
+ PreToolUse: [
58
+ {
59
+ matcher: 'Bash', // Only match Bash tool
60
+ hooks: [
61
+ async (input, toolUseId, ctx) => {
62
+ console.log('About to execute:', input);
63
+ return { continue: true };
64
+ }
65
+ ],
66
+ timeout: 5000 // Timeout in milliseconds
67
+ }
68
+ ]
69
+ }
70
+ }
71
+ });
72
+ ```
73
+
74
+ ```python [Python]
75
+ from codebuddy_agent_sdk import query, CodeBuddyAgentOptions, HookMatcher
76
+
77
+ async def pre_tool_hook(input_data, tool_use_id, context):
78
+ print(f"About to execute: {input_data}")
79
+ return {"continue_": True}
80
+
81
+ options = CodeBuddyAgentOptions(
82
+ model="deepseek-v3.1",
83
+ hooks={
84
+ "PreToolUse": [
85
+ HookMatcher(
86
+ matcher="Bash", # Only match Bash tool
87
+ hooks=[pre_tool_hook],
88
+ timeout=5.0 # Timeout in seconds
89
+ )
90
+ ]
91
+ }
92
+ )
93
+
94
+ async for msg in query(prompt="Help me analyze the code", options=options):
95
+ print(msg)
96
+ ```
97
+
98
+ :::
99
+
100
+ ### HookMatcher Structure
101
+
102
+ | Field | Type | Description |
103
+ |-------|------|-------------|
104
+ | `matcher` | `string` | Match pattern, supports regex. `*` or empty string matches all |
105
+ | `hooks` | `HookCallback[]` | Array of callback functions |
106
+ | `timeout` | `number` | Timeout (milliseconds in TypeScript, seconds in Python) |
107
+
108
+ ### Matcher Patterns
109
+
110
+ - **Exact match**: `"Bash"` only matches Bash tool
111
+ - **Regex match**: `"Edit|Write"` matches Edit or Write
112
+ - **Wildcard**: `"*"` or `""` matches all tools
113
+ - **Prefix match**: `"mcp__.*"` matches all MCP tools
114
+
115
+ ## Event Types
116
+
117
+ ### PreToolUse
118
+
119
+ Triggered before tool execution, can block execution or modify input.
120
+
121
+ ::: code-group
122
+
123
+ ```typescript [TypeScript]
124
+ hooks: {
125
+ PreToolUse: [{
126
+ matcher: 'Bash',
127
+ hooks: [
128
+ async (input, toolUseId, ctx) => {
129
+ const command = input.command as string;
130
+
131
+ // Block dangerous commands
132
+ if (command.includes('rm -rf')) {
133
+ return {
134
+ decision: 'block',
135
+ reason: 'Dangerous command blocked'
136
+ };
137
+ }
138
+
139
+ return { continue: true };
140
+ }
141
+ ]
142
+ }]
143
+ }
144
+ ```
145
+
146
+ ```python [Python]
147
+ async def pre_bash_hook(input_data, tool_use_id, context):
148
+ command = input_data.get("command", "")
149
+
150
+ # Block dangerous commands
151
+ if "rm -rf" in command:
152
+ return {
153
+ "decision": "block",
154
+ "reason": "Dangerous command blocked"
155
+ }
156
+
157
+ return {"continue_": True}
158
+
159
+ hooks = {
160
+ "PreToolUse": [
161
+ HookMatcher(matcher="Bash", hooks=[pre_bash_hook])
162
+ ]
163
+ }
164
+ ```
165
+
166
+ :::
167
+
168
+ ### PostToolUse
169
+
170
+ Triggered after successful tool execution, can add extra context.
171
+
172
+ ::: code-group
173
+
174
+ ```typescript [TypeScript]
175
+ hooks: {
176
+ PostToolUse: [{
177
+ matcher: 'Write|Edit',
178
+ hooks: [
179
+ async (input, toolUseId) => {
180
+ console.log(`File modified: ${input.file_path}`);
181
+ // Log file changes
182
+ await logFileChange(input.file_path);
183
+ return { continue: true };
184
+ }
185
+ ]
186
+ }]
187
+ }
188
+ ```
189
+
190
+ ```python [Python]
191
+ async def post_write_hook(input_data, tool_use_id, context):
192
+ print(f"File modified: {input_data.get('file_path')}")
193
+ # Log file changes
194
+ await log_file_change(input_data.get("file_path"))
195
+ return {"continue_": True}
196
+
197
+ hooks = {
198
+ "PostToolUse": [
199
+ HookMatcher(matcher="Write|Edit", hooks=[post_write_hook])
200
+ ]
201
+ }
202
+ ```
203
+
204
+ :::
205
+
206
+ ### UserPromptSubmit
207
+
208
+ Triggered when user submits a message, can add context or block processing.
209
+
210
+ ::: code-group
211
+
212
+ ```typescript [TypeScript]
213
+ hooks: {
214
+ UserPromptSubmit: [{
215
+ hooks: [
216
+ async (input) => {
217
+ const prompt = input.prompt as string;
218
+
219
+ // Sensitive word check
220
+ if (containsSensitiveWords(prompt)) {
221
+ return {
222
+ decision: 'block',
223
+ reason: 'Message contains sensitive content'
224
+ };
225
+ }
226
+
227
+ return { continue: true };
228
+ }
229
+ ]
230
+ }]
231
+ }
232
+ ```
233
+
234
+ ```python [Python]
235
+ async def prompt_check_hook(input_data, tool_use_id, context):
236
+ prompt = input_data.get("prompt", "")
237
+
238
+ # Sensitive word check
239
+ if contains_sensitive_words(prompt):
240
+ return {
241
+ "decision": "block",
242
+ "reason": "Message contains sensitive content"
243
+ }
244
+
245
+ return {"continue_": True}
246
+
247
+ hooks = {
248
+ "UserPromptSubmit": [
249
+ HookMatcher(hooks=[prompt_check_hook])
250
+ ]
251
+ }
252
+ ```
253
+
254
+ :::
255
+
256
+ ### Stop / SubagentStop
257
+
258
+ Triggered when Agent response ends, can block stopping and request continuation.
259
+
260
+ ::: code-group
261
+
262
+ ```typescript [TypeScript]
263
+ hooks: {
264
+ Stop: [{
265
+ hooks: [
266
+ async (input) => {
267
+ // Check if task is truly complete
268
+ if (!isTaskComplete()) {
269
+ return {
270
+ decision: 'block',
271
+ reason: 'Task incomplete, please continue'
272
+ };
273
+ }
274
+ return { continue: true };
275
+ }
276
+ ]
277
+ }]
278
+ }
279
+ ```
280
+
281
+ ```python [Python]
282
+ async def stop_hook(input_data, tool_use_id, context):
283
+ # Check if task is truly complete
284
+ if not is_task_complete():
285
+ return {
286
+ "decision": "block",
287
+ "reason": "Task incomplete, please continue"
288
+ }
289
+ return {"continue_": True}
290
+
291
+ hooks = {
292
+ "Stop": [HookMatcher(hooks=[stop_hook])]
293
+ }
294
+ ```
295
+
296
+ :::
297
+
298
+ ### unstable_Checkpoint (Experimental)
299
+
300
+ Automatically triggered after file modifications (when Write/Edit/MultiEdit tools execute successfully), providing file snapshots and change statistics.
301
+
302
+ ::: warning Experimental API
303
+ This Hook is an experimental feature. The API may change in future versions.
304
+ :::
305
+
306
+ ::: code-group
307
+
308
+ ```typescript [TypeScript]
309
+ import type { CheckpointHookInput } from '@tencent-ai/agent-sdk';
310
+
311
+ hooks: {
312
+ unstable_Checkpoint: [{
313
+ hooks: [
314
+ async (input) => {
315
+ const checkpointInput = input as CheckpointHookInput;
316
+ const checkpoint = checkpointInput.checkpoint;
317
+
318
+ console.log('File change checkpoint:', {
319
+ id: checkpoint.id,
320
+ label: checkpoint.label,
321
+ files: checkpoint.fileChangeStats?.files,
322
+ additions: checkpoint.fileChangeStats?.additions,
323
+ deletions: checkpoint.fileChangeStats?.deletions
324
+ });
325
+
326
+ // Access file snapshots
327
+ for (const [filePath, version] of Object.entries(checkpoint.fileSnapshots)) {
328
+ console.log(` ${filePath} - version ${version.version}`);
329
+ }
330
+
331
+ return { continue: true };
332
+ }
333
+ ]
334
+ }]
335
+ }
336
+ ```
337
+
338
+ ```python [Python]
339
+ async def checkpoint_hook(input_data, tool_use_id, context):
340
+ checkpoint = input_data.get("checkpoint", {})
341
+
342
+ file_change_stats = checkpoint.get("fileChangeStats", {})
343
+ print(f"File change checkpoint:")
344
+ print(f" ID: {checkpoint.get('id')}")
345
+ print(f" Label: {checkpoint.get('label')}")
346
+ print(f" Files: {file_change_stats.get('files', [])}")
347
+ print(f" Additions: +{file_change_stats.get('additions', 0)} lines")
348
+ print(f" Deletions: -{file_change_stats.get('deletions', 0)} lines")
349
+
350
+ # Access file snapshots
351
+ for file_path, version in checkpoint.get("fileSnapshots", {}).items():
352
+ print(f" {file_path} - version {version.get('version')}")
353
+
354
+ return {"continue_": True}
355
+
356
+ hooks = {
357
+ "unstable_Checkpoint": [HookMatcher(hooks=[checkpoint_hook])]
358
+ }
359
+ ```
360
+
361
+ :::
362
+
363
+ **Checkpoint Data Structure**:
364
+
365
+ - `id`: Unique checkpoint identifier
366
+ - `label`: Human-readable label (typically the user prompt)
367
+ - `createdAt`: Creation timestamp
368
+ - `fileSnapshots`: Mapping of file paths to version information
369
+ - `filePath`: Absolute file path
370
+ - `version`: Version number
371
+ - `backupFileName`: Backup file name
372
+ - `backupTime`: Backup timestamp
373
+ - `fileChangeStats`: File change statistics
374
+ - `files`: List of changed file paths
375
+ - `additions`: Number of lines added
376
+ - `deletions`: Number of lines deleted
377
+
378
+ ## Hook Input
379
+
380
+ The input structure received by hook callbacks varies by event type.
381
+
382
+ ### Common Fields
383
+
384
+ ```json
385
+ {
386
+ "session_id": "abc123",
387
+ "cwd": "/path/to/project",
388
+ "permission_mode": "default",
389
+ "hook_event_name": "PreToolUse"
390
+ }
391
+ ```
392
+
393
+ ### PreToolUse / PostToolUse Input
394
+
395
+ ```json
396
+ {
397
+ "tool_name": "Bash",
398
+ "tool_input": {
399
+ "command": "ls -la"
400
+ }
401
+ }
402
+ ```
403
+
404
+ ### UserPromptSubmit Input
405
+
406
+ ```json
407
+ {
408
+ "prompt": "Help me write a function"
409
+ }
410
+ ```
411
+
412
+ ### Stop / SubagentStop Input
413
+
414
+ ```json
415
+ {
416
+ "stop_hook_active": false
417
+ }
418
+ ```
419
+
420
+ **WorktreeCreate Input Example**:
421
+
422
+ ```json
423
+ {
424
+ "hook_event_name": "WorktreeCreate",
425
+ "session_id": "abc123",
426
+ "cwd": "/path/to/project",
427
+ "transcript_path": "/path/to/transcript.jsonl",
428
+ "name": "feature-auth"
429
+ }
430
+ ```
431
+
432
+ **WorktreeRemove Input Example**:
433
+
434
+ ```json
435
+ {
436
+ "hook_event_name": "WorktreeRemove",
437
+ "session_id": "abc123",
438
+ "cwd": "/path/to/project",
439
+ "transcript_path": "/path/to/transcript.jsonl",
440
+ "worktree_path": "/tmp/codebuddy-worktrees/feature-auth"
441
+ }
442
+ ```
443
+
444
+ ### unstable_Checkpoint Input
445
+
446
+ ```json
447
+ {
448
+ "checkpoint": {
449
+ "id": "ckpt_abc123",
450
+ "label": "Help me write a function",
451
+ "createdAt": 1705920000000,
452
+ "fileSnapshots": {
453
+ "/path/to/file.ts": {
454
+ "filePath": "/path/to/file.ts",
455
+ "version": 1,
456
+ "backupFileName": "file.ts.v1.backup",
457
+ "backupTime": 1705920000000
458
+ }
459
+ },
460
+ "fileChangeStats": {
461
+ "files": ["/path/to/file.ts"],
462
+ "additions": 10,
463
+ "deletions": 2
464
+ }
465
+ }
466
+ }
467
+ ```
468
+
469
+ ## Hook Output
470
+
471
+ The output returned by hook callbacks controls subsequent behavior.
472
+
473
+ ### Basic Output Fields
474
+
475
+ | Field | Type | Description |
476
+ |-------|------|-------------|
477
+ | `continue` / `continue_` | `boolean` | Whether to continue execution (default true) |
478
+ | `decision` | `'block'` | Set to `'block'` to prevent operation |
479
+ | `reason` | `string` | Reason for blocking |
480
+ | `stopReason` | `string` | Stop message displayed when `continue` is false |
481
+ | `suppressOutput` | `boolean` | Hide output |
482
+
483
+ ### PreToolUse Special Output
484
+
485
+ Can modify tool input:
486
+
487
+ ::: code-group
488
+
489
+ ```typescript [TypeScript]
490
+ return {
491
+ continue: true,
492
+ hookSpecificOutput: {
493
+ hookEventName: 'PreToolUse',
494
+ updatedInput: {
495
+ command: `echo "Security check passed" && ${input.command}`
496
+ }
497
+ }
498
+ };
499
+ ```
500
+
501
+ ```python [Python]
502
+ return {
503
+ "continue_": True,
504
+ "hookSpecificOutput": {
505
+ "hookEventName": "PreToolUse",
506
+ "updatedInput": {
507
+ "command": f'echo "Security check passed" && {input_data["command"]}'
508
+ }
509
+ }
510
+ }
511
+ ```
512
+
513
+ :::
514
+
515
+ ## Examples
516
+
517
+ ### Complete Example: Bash Command Auditing
518
+
519
+ ::: code-group
520
+
521
+ ```typescript [TypeScript]
522
+ import { query } from '@tencent-ai/agent-sdk';
523
+ import * as fs from 'fs';
524
+
525
+ const logFile = '/tmp/bash-audit.log';
526
+
527
+ const q = query({
528
+ prompt: 'Help me clean temporary files',
529
+ options: {
530
+ model: 'deepseek-v3.1',
531
+ hooks: {
532
+ PreToolUse: [{
533
+ matcher: 'Bash',
534
+ hooks: [
535
+ async (input, toolUseId) => {
536
+ const command = input.command as string;
537
+ const timestamp = new Date().toISOString();
538
+
539
+ // Log command
540
+ fs.appendFileSync(logFile, `${timestamp} [PRE] ${command}\n`);
541
+
542
+ // Dangerous command check
543
+ const dangerous = ['rm -rf /', 'mkfs', ':(){:|:&};:'];
544
+ for (const d of dangerous) {
545
+ if (command.includes(d)) {
546
+ return {
547
+ decision: 'block',
548
+ reason: `Dangerous command blocked: ${d}`
549
+ };
550
+ }
551
+ }
552
+
553
+ return { continue: true };
554
+ }
555
+ ]
556
+ }],
557
+ PostToolUse: [{
558
+ matcher: 'Bash',
559
+ hooks: [
560
+ async (input, toolUseId) => {
561
+ const command = input.command as string;
562
+ const timestamp = new Date().toISOString();
563
+
564
+ // Log completion
565
+ fs.appendFileSync(logFile, `${timestamp} [POST] ${command} - Complete\n`);
566
+
567
+ return { continue: true };
568
+ }
569
+ ]
570
+ }]
571
+ }
572
+ }
573
+ });
574
+
575
+ for await (const message of q) {
576
+ console.log(message);
577
+ }
578
+ ```
579
+
580
+ ```python [Python]
581
+ import asyncio
582
+ from datetime import datetime
583
+ from codebuddy_agent_sdk import query, CodeBuddyAgentOptions, HookMatcher
584
+
585
+ log_file = "/tmp/bash-audit.log"
586
+
587
+ async def pre_bash_hook(input_data, tool_use_id, context):
588
+ command = input_data.get("command", "")
589
+ timestamp = datetime.now().isoformat()
590
+
591
+ # Log command
592
+ with open(log_file, "a") as f:
593
+ f.write(f"{timestamp} [PRE] {command}\n")
594
+
595
+ # Dangerous command check
596
+ dangerous = ["rm -rf /", "mkfs", ":(){:|:&};:"]
597
+ for d in dangerous:
598
+ if d in command:
599
+ return {
600
+ "decision": "block",
601
+ "reason": f"Dangerous command blocked: {d}"
602
+ }
603
+
604
+ return {"continue_": True}
605
+
606
+ async def post_bash_hook(input_data, tool_use_id, context):
607
+ command = input_data.get("command", "")
608
+ timestamp = datetime.now().isoformat()
609
+
610
+ # Log completion
611
+ with open(log_file, "a") as f:
612
+ f.write(f"{timestamp} [POST] {command} - Complete\n")
613
+
614
+ return {"continue_": True}
615
+
616
+ async def main():
617
+ options = CodeBuddyAgentOptions(
618
+ model="deepseek-v3.1",
619
+ hooks={
620
+ "PreToolUse": [
621
+ HookMatcher(matcher="Bash", hooks=[pre_bash_hook])
622
+ ],
623
+ "PostToolUse": [
624
+ HookMatcher(matcher="Bash", hooks=[post_bash_hook])
625
+ ]
626
+ }
627
+ )
628
+
629
+ async for message in query(prompt="Help me clean temporary files", options=options):
630
+ print(message)
631
+
632
+ asyncio.run(main())
633
+ ```
634
+
635
+ :::
636
+
637
+ ### Example: Limiting File Modification Scope
638
+
639
+ ::: code-group
640
+
641
+ ```typescript [TypeScript]
642
+ hooks: {
643
+ PreToolUse: [{
644
+ matcher: 'Write|Edit',
645
+ hooks: [
646
+ async (input) => {
647
+ const filePath = input.file_path as string;
648
+
649
+ // Only allow modifying src directory
650
+ if (!filePath.startsWith('/path/to/project/src/')) {
651
+ return {
652
+ decision: 'block',
653
+ reason: `Not allowed to modify files outside src directory: ${filePath}`
654
+ };
655
+ }
656
+
657
+ // Prohibit modifying config files
658
+ if (filePath.endsWith('.env') || filePath.includes('.git/')) {
659
+ return {
660
+ decision: 'block',
661
+ reason: 'Not allowed to modify sensitive files'
662
+ };
663
+ }
664
+
665
+ return { continue: true };
666
+ }
667
+ ]
668
+ }]
669
+ }
670
+ ```
671
+
672
+ ```python [Python]
673
+ async def file_scope_hook(input_data, tool_use_id, context):
674
+ file_path = input_data.get("file_path", "")
675
+
676
+ # Only allow modifying src directory
677
+ if not file_path.startswith("/path/to/project/src/"):
678
+ return {
679
+ "decision": "block",
680
+ "reason": f"Not allowed to modify files outside src directory: {file_path}"
681
+ }
682
+
683
+ # Prohibit modifying config files
684
+ if file_path.endswith(".env") or ".git/" in file_path:
685
+ return {
686
+ "decision": "block",
687
+ "reason": "Not allowed to modify sensitive files"
688
+ }
689
+
690
+ return {"continue_": True}
691
+
692
+ hooks = {
693
+ "PreToolUse": [
694
+ HookMatcher(matcher="Write|Edit", hooks=[file_scope_hook])
695
+ ]
696
+ }
697
+ ```
698
+
699
+ :::
700
+
701
+ ### Example: File Change Tracking (Checkpoint Hook)
702
+
703
+ ::: code-group
704
+
705
+ ```typescript [TypeScript]
706
+ import { query, type CheckpointHookInput } from '@tencent-ai/agent-sdk';
707
+ import * as fs from 'fs';
708
+
709
+ const changeLog = '/tmp/file-changes.log';
710
+
711
+ const q = query({
712
+ prompt: 'Refactor src/utils.ts',
713
+ options: {
714
+ model: 'deepseek-v3.1',
715
+ hooks: {
716
+ unstable_Checkpoint: [{
717
+ hooks: [
718
+ async (input) => {
719
+ const checkpointInput = input as CheckpointHookInput;
720
+ const checkpoint = checkpointInput.checkpoint;
721
+ const stats = checkpoint.fileChangeStats;
722
+
723
+ if (!stats) return { continue: true };
724
+
725
+ // Log file changes
726
+ const timestamp = new Date().toISOString();
727
+ const logEntry = `
728
+ [${timestamp}] Checkpoint ${checkpoint.id}
729
+ Label: ${checkpoint.label}
730
+ Files: ${stats.files.join(', ')}
731
+ Changes: +${stats.additions}/-${stats.deletions}
732
+ Snapshots: ${Object.keys(checkpoint.fileSnapshots).length} files
733
+ `;
734
+
735
+ fs.appendFileSync(changeLog, logEntry);
736
+
737
+ // Warn if changes are too large
738
+ if (stats.additions + stats.deletions > 100) {
739
+ console.warn('⚠️ Large amount of code changes, review recommended');
740
+ }
741
+
742
+ return { continue: true };
743
+ }
744
+ ]
745
+ }]
746
+ }
747
+ }
748
+ });
749
+
750
+ for await (const message of q) {
751
+ console.log(message);
752
+ }
753
+ ```
754
+
755
+ ```python [Python]
756
+ import asyncio
757
+ from datetime import datetime
758
+ from codebuddy_agent_sdk import query, CodeBuddyAgentOptions, HookMatcher
759
+
760
+ change_log = "/tmp/file-changes.log"
761
+
762
+ async def checkpoint_tracker(input_data, tool_use_id, context):
763
+ checkpoint = input_data.get("checkpoint", {})
764
+ stats = checkpoint.get("fileChangeStats")
765
+
766
+ if not stats:
767
+ return {"continue_": True}
768
+
769
+ # Log file changes
770
+ timestamp = datetime.now().isoformat()
771
+ log_entry = f"""
772
+ [{timestamp}] Checkpoint {checkpoint.get('id')}
773
+ Label: {checkpoint.get('label')}
774
+ Files: {', '.join(stats.get('files', []))}
775
+ Changes: +{stats.get('additions', 0)}/-{stats.get('deletions', 0)}
776
+ Snapshots: {len(checkpoint.get('fileSnapshots', {}))} files
777
+ """
778
+
779
+ with open(change_log, "a") as f:
780
+ f.write(log_entry)
781
+
782
+ # Warn if changes are too large
783
+ total_changes = stats.get("additions", 0) + stats.get("deletions", 0)
784
+ if total_changes > 100:
785
+ print("⚠️ Large amount of code changes, review recommended")
786
+
787
+ return {"continue_": True}
788
+
789
+ async def main():
790
+ options = CodeBuddyAgentOptions(
791
+ model="deepseek-v3.1",
792
+ hooks={
793
+ "unstable_Checkpoint": [
794
+ HookMatcher(hooks=[checkpoint_tracker])
795
+ ]
796
+ }
797
+ )
798
+
799
+ async for message in query(prompt="Refactor src/utils.ts", options=options):
800
+ print(message)
801
+
802
+ asyncio.run(main())
803
+ ```
804
+
805
+ :::
806
+
807
+ ## Related Documentation
808
+
809
+ - [SDK Overview](sdk.md) - Quick start and usage examples
810
+ - [SDK Permission Control](sdk-permissions.md) - canUseTool callback
811
+ - [Hook Reference Guide](hooks.md) - Complete CLI Hook reference
812
+ - [TypeScript SDK Reference](sdk-typescript.md) - Complete API reference
813
+ - [Python SDK Reference](sdk-python.md) - Complete API reference