@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.
- package/cli/CHANGELOG.md +50 -0
- package/cli/dist/codebuddy-headless.js +140 -131
- package/cli/dist/web-ui/assets/index-CIqmZV3y.js +440 -0
- package/cli/dist/web-ui/assets/index-Dt1puyHn.css +32 -0
- package/cli/dist/web-ui/docs/cn/cli/acp.md +152 -0
- package/cli/dist/web-ui/docs/cn/cli/agent-teams.md +327 -0
- package/cli/dist/web-ui/docs/cn/cli/bash-sandboxing.md +290 -0
- package/cli/dist/web-ui/docs/cn/cli/best-practices.md +554 -0
- package/cli/dist/web-ui/docs/cn/cli/channels-reference.md +293 -0
- package/cli/dist/web-ui/docs/cn/cli/channels.md +215 -0
- package/cli/dist/web-ui/docs/cn/cli/checkpointing.md +51 -0
- package/cli/dist/web-ui/docs/cn/cli/cli-reference.md +187 -0
- package/cli/dist/web-ui/docs/cn/cli/common-workflows.md +1013 -0
- package/cli/dist/web-ui/docs/cn/cli/costs.md +174 -0
- package/cli/dist/web-ui/docs/cn/cli/devcontainer.md +553 -0
- package/cli/dist/web-ui/docs/cn/cli/env-vars.md +326 -0
- package/cli/dist/web-ui/docs/cn/cli/gitlab-ci-cd.md +357 -0
- package/cli/dist/web-ui/docs/cn/cli/headless.md +258 -0
- package/cli/dist/web-ui/docs/cn/cli/hooks-guide.md +9 -0
- package/cli/dist/web-ui/docs/cn/cli/hooks.md +805 -0
- package/cli/dist/web-ui/docs/cn/cli/iam.md +530 -0
- package/cli/dist/web-ui/docs/cn/cli/ide-integrations.md +92 -0
- package/cli/dist/web-ui/docs/cn/cli/installation.md +291 -0
- package/cli/dist/web-ui/docs/cn/cli/interactive-mode.md +233 -0
- package/cli/dist/web-ui/docs/cn/cli/mcp.md +739 -0
- package/cli/dist/web-ui/docs/cn/cli/memory.md +436 -0
- package/cli/dist/web-ui/docs/cn/cli/models.md +356 -0
- package/cli/dist/web-ui/docs/cn/cli/overview.md +100 -0
- package/cli/dist/web-ui/docs/cn/cli/plugin-marketplaces.md +533 -0
- package/cli/dist/web-ui/docs/cn/cli/plugins-reference.md +774 -0
- package/cli/dist/web-ui/docs/cn/cli/plugins.md +689 -0
- package/cli/dist/web-ui/docs/cn/cli/quickstart.md +249 -0
- package/cli/dist/web-ui/docs/cn/cli/release-notes/README.md +200 -0
- package/cli/dist/web-ui/docs/cn/cli/release-notes/v2.10.0.md +23 -0
- package/cli/dist/web-ui/docs/cn/cli/release-notes/v2.10.1.md +5 -0
- package/cli/dist/web-ui/docs/cn/cli/release-notes/v2.11.0.md +24 -0
- package/cli/dist/web-ui/docs/cn/cli/release-notes/v2.12.0.md +21 -0
- package/cli/dist/web-ui/docs/cn/cli/release-notes/v2.13.0.md +20 -0
- package/cli/dist/web-ui/docs/cn/cli/release-notes/v2.14.0.md +22 -0
- package/cli/dist/web-ui/docs/cn/cli/release-notes/v2.14.1.md +8 -0
- package/cli/dist/web-ui/docs/cn/cli/release-notes/v2.15.0.md +18 -0
- package/cli/dist/web-ui/docs/cn/cli/release-notes/v2.15.1.md +11 -0
- package/cli/dist/web-ui/docs/cn/cli/release-notes/v2.16.0.md +20 -0
- package/cli/dist/web-ui/docs/cn/cli/release-notes/v2.17.0.md +29 -0
- package/cli/dist/web-ui/docs/cn/cli/release-notes/v2.18.0.md +17 -0
- package/cli/dist/web-ui/docs/cn/cli/release-notes/v2.19.0.md +11 -0
- package/cli/dist/web-ui/docs/cn/cli/release-notes/v2.19.1.md +14 -0
- package/cli/dist/web-ui/docs/cn/cli/release-notes/v2.19.2.md +11 -0
- package/cli/dist/web-ui/docs/cn/cli/release-notes/v2.20.0.md +23 -0
- package/cli/dist/web-ui/docs/cn/cli/release-notes/v2.20.1.md +15 -0
- package/cli/dist/web-ui/docs/cn/cli/release-notes/v2.21.0.md +13 -0
- package/cli/dist/web-ui/docs/cn/cli/release-notes/v2.22.0.md +16 -0
- package/cli/dist/web-ui/docs/cn/cli/release-notes/v2.23.0.md +20 -0
- package/cli/dist/web-ui/docs/cn/cli/release-notes/v2.23.2.md +5 -0
- package/cli/dist/web-ui/docs/cn/cli/release-notes/v2.23.3.md +5 -0
- package/cli/dist/web-ui/docs/cn/cli/release-notes/v2.23.4.md +15 -0
- package/cli/dist/web-ui/docs/cn/cli/release-notes/v2.23.5.md +11 -0
- package/cli/dist/web-ui/docs/cn/cli/release-notes/v2.24.0.md +17 -0
- package/cli/dist/web-ui/docs/cn/cli/release-notes/v2.25.0.md +18 -0
- package/cli/dist/web-ui/docs/cn/cli/release-notes/v2.25.1.md +21 -0
- package/cli/dist/web-ui/docs/cn/cli/release-notes/v2.26.0.md +18 -0
- package/cli/dist/web-ui/docs/cn/cli/release-notes/v2.27.0.md +16 -0
- package/cli/dist/web-ui/docs/cn/cli/release-notes/v2.27.1.md +16 -0
- package/cli/dist/web-ui/docs/cn/cli/release-notes/v2.27.2.md +7 -0
- package/cli/dist/web-ui/docs/cn/cli/release-notes/v2.27.3.md +15 -0
- package/cli/dist/web-ui/docs/cn/cli/release-notes/v2.28.0.md +26 -0
- package/cli/dist/web-ui/docs/cn/cli/release-notes/v2.28.1.md +5 -0
- package/cli/dist/web-ui/docs/cn/cli/release-notes/v2.29.0.md +35 -0
- package/cli/dist/web-ui/docs/cn/cli/release-notes/v2.3.1.md +16 -0
- package/cli/dist/web-ui/docs/cn/cli/release-notes/v2.30.0.md +19 -0
- package/cli/dist/web-ui/docs/cn/cli/release-notes/v2.30.1.md +5 -0
- package/cli/dist/web-ui/docs/cn/cli/release-notes/v2.31.0.md +51 -0
- package/cli/dist/web-ui/docs/cn/cli/release-notes/v2.31.1.md +11 -0
- package/cli/dist/web-ui/docs/cn/cli/release-notes/v2.31.2.md +16 -0
- package/cli/dist/web-ui/docs/cn/cli/release-notes/v2.32.0.md +19 -0
- package/cli/dist/web-ui/docs/cn/cli/release-notes/v2.33.0.md +28 -0
- package/cli/dist/web-ui/docs/cn/cli/release-notes/v2.33.1.md +7 -0
- package/cli/dist/web-ui/docs/cn/cli/release-notes/v2.36.3.md +17 -0
- package/cli/dist/web-ui/docs/cn/cli/release-notes/v2.37.0.md +15 -0
- package/cli/dist/web-ui/docs/cn/cli/release-notes/v2.37.1.md +15 -0
- package/cli/dist/web-ui/docs/cn/cli/release-notes/v2.37.10.md +5 -0
- package/cli/dist/web-ui/docs/cn/cli/release-notes/v2.37.11.md +8 -0
- package/cli/dist/web-ui/docs/cn/cli/release-notes/v2.37.12.md +14 -0
- package/cli/dist/web-ui/docs/cn/cli/release-notes/v2.37.13.md +11 -0
- package/cli/dist/web-ui/docs/cn/cli/release-notes/v2.37.14.md +24 -0
- package/cli/dist/web-ui/docs/cn/cli/release-notes/v2.37.15.md +11 -0
- package/cli/dist/web-ui/docs/cn/cli/release-notes/v2.37.16.md +9 -0
- package/cli/dist/web-ui/docs/cn/cli/release-notes/v2.37.17.md +5 -0
- package/cli/dist/web-ui/docs/cn/cli/release-notes/v2.37.18.md +9 -0
- package/cli/dist/web-ui/docs/cn/cli/release-notes/v2.37.19.md +5 -0
- package/cli/dist/web-ui/docs/cn/cli/release-notes/v2.37.2.md +28 -0
- package/cli/dist/web-ui/docs/cn/cli/release-notes/v2.37.20.md +8 -0
- package/cli/dist/web-ui/docs/cn/cli/release-notes/v2.37.3.md +22 -0
- package/cli/dist/web-ui/docs/cn/cli/release-notes/v2.37.4.md +19 -0
- package/cli/dist/web-ui/docs/cn/cli/release-notes/v2.37.5.md +5 -0
- package/cli/dist/web-ui/docs/cn/cli/release-notes/v2.37.6.md +5 -0
- package/cli/dist/web-ui/docs/cn/cli/release-notes/v2.37.7.md +5 -0
- package/cli/dist/web-ui/docs/cn/cli/release-notes/v2.37.8.md +5 -0
- package/cli/dist/web-ui/docs/cn/cli/release-notes/v2.37.9.md +8 -0
- package/cli/dist/web-ui/docs/cn/cli/release-notes/v2.38.0.md +22 -0
- package/cli/dist/web-ui/docs/cn/cli/release-notes/v2.38.1.md +6 -0
- package/cli/dist/web-ui/docs/cn/cli/release-notes/v2.38.2.md +9 -0
- package/cli/dist/web-ui/docs/cn/cli/release-notes/v2.39.0.md +18 -0
- package/cli/dist/web-ui/docs/cn/cli/release-notes/v2.4.0.md +19 -0
- package/cli/dist/web-ui/docs/cn/cli/release-notes/v2.40.0.md +20 -0
- package/cli/dist/web-ui/docs/cn/cli/release-notes/v2.40.1.md +6 -0
- package/cli/dist/web-ui/docs/cn/cli/release-notes/v2.41.0.md +15 -0
- package/cli/dist/web-ui/docs/cn/cli/release-notes/v2.41.1.md +6 -0
- package/cli/dist/web-ui/docs/cn/cli/release-notes/v2.41.2.md +5 -0
- package/cli/dist/web-ui/docs/cn/cli/release-notes/v2.41.3.md +8 -0
- package/cli/dist/web-ui/docs/cn/cli/release-notes/v2.41.4.md +5 -0
- package/cli/dist/web-ui/docs/cn/cli/release-notes/v2.41.5.md +10 -0
- package/cli/dist/web-ui/docs/cn/cli/release-notes/v2.41.6.md +9 -0
- package/cli/dist/web-ui/docs/cn/cli/release-notes/v2.41.7.md +14 -0
- package/cli/dist/web-ui/docs/cn/cli/release-notes/v2.41.8.md +18 -0
- package/cli/dist/web-ui/docs/cn/cli/release-notes/v2.42.0.md +39 -0
- package/cli/dist/web-ui/docs/cn/cli/release-notes/v2.42.1.md +8 -0
- package/cli/dist/web-ui/docs/cn/cli/release-notes/v2.42.3.md +18 -0
- package/cli/dist/web-ui/docs/cn/cli/release-notes/v2.43.0.md +27 -0
- package/cli/dist/web-ui/docs/cn/cli/release-notes/v2.43.1.md +27 -0
- package/cli/dist/web-ui/docs/cn/cli/release-notes/v2.44.0.md +11 -0
- package/cli/dist/web-ui/docs/cn/cli/release-notes/v2.44.1.md +22 -0
- package/cli/dist/web-ui/docs/cn/cli/release-notes/v2.45.0.md +34 -0
- package/cli/dist/web-ui/docs/cn/cli/release-notes/v2.45.1.md +7 -0
- package/cli/dist/web-ui/docs/cn/cli/release-notes/v2.46.0.md +12 -0
- package/cli/dist/web-ui/docs/cn/cli/release-notes/v2.47.0.md +20 -0
- package/cli/dist/web-ui/docs/cn/cli/release-notes/v2.48.0.md +32 -0
- package/cli/dist/web-ui/docs/cn/cli/release-notes/v2.48.1.md +11 -0
- package/cli/dist/web-ui/docs/cn/cli/release-notes/v2.49.0.md +26 -0
- package/cli/dist/web-ui/docs/cn/cli/release-notes/v2.49.1.md +14 -0
- package/cli/dist/web-ui/docs/cn/cli/release-notes/v2.49.2.md +39 -0
- package/cli/dist/web-ui/docs/cn/cli/release-notes/v2.49.3.md +7 -0
- package/cli/dist/web-ui/docs/cn/cli/release-notes/v2.49.5.md +11 -0
- package/cli/dist/web-ui/docs/cn/cli/release-notes/v2.49.6.md +9 -0
- package/cli/dist/web-ui/docs/cn/cli/release-notes/v2.49.7.md +7 -0
- package/cli/dist/web-ui/docs/cn/cli/release-notes/v2.5.0.md +24 -0
- package/cli/dist/web-ui/docs/cn/cli/release-notes/v2.50.0.md +25 -0
- package/cli/dist/web-ui/docs/cn/cli/release-notes/v2.50.1.md +9 -0
- package/cli/dist/web-ui/docs/cn/cli/release-notes/v2.50.2.md +11 -0
- package/cli/dist/web-ui/docs/cn/cli/release-notes/v2.50.3.md +5 -0
- package/cli/dist/web-ui/docs/cn/cli/release-notes/v2.50.4.md +17 -0
- package/cli/dist/web-ui/docs/cn/cli/release-notes/v2.50.5.md +16 -0
- package/cli/dist/web-ui/docs/cn/cli/release-notes/v2.50.6.md +15 -0
- package/cli/dist/web-ui/docs/cn/cli/release-notes/v2.50.7.md +15 -0
- package/cli/dist/web-ui/docs/cn/cli/release-notes/v2.51.0.md +24 -0
- package/cli/dist/web-ui/docs/cn/cli/release-notes/v2.51.1.md +17 -0
- package/cli/dist/web-ui/docs/cn/cli/release-notes/v2.51.2.md +5 -0
- package/cli/dist/web-ui/docs/cn/cli/release-notes/v2.52.0.md +30 -0
- package/cli/dist/web-ui/docs/cn/cli/release-notes/v2.52.1.md +28 -0
- package/cli/dist/web-ui/docs/cn/cli/release-notes/v2.52.2.md +12 -0
- package/cli/dist/web-ui/docs/cn/cli/release-notes/v2.52.3.md +13 -0
- package/cli/dist/web-ui/docs/cn/cli/release-notes/v2.52.4.md +27 -0
- package/cli/dist/web-ui/docs/cn/cli/release-notes/v2.52.5.md +21 -0
- package/cli/dist/web-ui/docs/cn/cli/release-notes/v2.52.6.md +7 -0
- package/cli/dist/web-ui/docs/cn/cli/release-notes/v2.53.0.md +29 -0
- package/cli/dist/web-ui/docs/cn/cli/release-notes/v2.54.0.md +26 -0
- package/cli/dist/web-ui/docs/cn/cli/release-notes/v2.55.0.md +21 -0
- package/cli/dist/web-ui/docs/cn/cli/release-notes/v2.55.1.md +13 -0
- package/cli/dist/web-ui/docs/cn/cli/release-notes/v2.56.0.md +20 -0
- package/cli/dist/web-ui/docs/cn/cli/release-notes/v2.56.1.md +5 -0
- package/cli/dist/web-ui/docs/cn/cli/release-notes/v2.57.0.md +32 -0
- package/cli/dist/web-ui/docs/cn/cli/release-notes/v2.57.1.md +10 -0
- package/cli/dist/web-ui/docs/cn/cli/release-notes/v2.58.0.md +34 -0
- package/cli/dist/web-ui/docs/cn/cli/release-notes/v2.59.0.md +28 -0
- package/cli/dist/web-ui/docs/cn/cli/release-notes/v2.6.0.md +5 -0
- package/cli/dist/web-ui/docs/cn/cli/release-notes/v2.6.1.md +10 -0
- package/cli/dist/web-ui/docs/cn/cli/release-notes/v2.60.0.md +20 -0
- package/cli/dist/web-ui/docs/cn/cli/release-notes/v2.61.0.md +29 -0
- package/cli/dist/web-ui/docs/cn/cli/release-notes/v2.61.1.md +5 -0
- package/cli/dist/web-ui/docs/cn/cli/release-notes/v2.61.2.md +6 -0
- package/cli/dist/web-ui/docs/cn/cli/release-notes/v2.61.3.md +13 -0
- package/cli/dist/web-ui/docs/cn/cli/release-notes/v2.62.0.md +21 -0
- package/cli/dist/web-ui/docs/cn/cli/release-notes/v2.62.1.md +11 -0
- package/cli/dist/web-ui/docs/cn/cli/release-notes/v2.63.0.md +19 -0
- package/cli/dist/web-ui/docs/cn/cli/release-notes/v2.63.1.md +5 -0
- package/cli/dist/web-ui/docs/cn/cli/release-notes/v2.63.2.md +7 -0
- package/cli/dist/web-ui/docs/cn/cli/release-notes/v2.63.3.md +6 -0
- package/cli/dist/web-ui/docs/cn/cli/release-notes/v2.63.4.md +8 -0
- package/cli/dist/web-ui/docs/cn/cli/release-notes/v2.63.5.md +6 -0
- package/cli/dist/web-ui/docs/cn/cli/release-notes/v2.64.0.md +37 -0
- package/cli/dist/web-ui/docs/cn/cli/release-notes/v2.64.1.md +6 -0
- package/cli/dist/web-ui/docs/cn/cli/release-notes/v2.64.2.md +11 -0
- package/cli/dist/web-ui/docs/cn/cli/release-notes/v2.65.0.md +19 -0
- package/cli/dist/web-ui/docs/cn/cli/release-notes/v2.65.1.md +11 -0
- package/cli/dist/web-ui/docs/cn/cli/release-notes/v2.66.0.md +15 -0
- package/cli/dist/web-ui/docs/cn/cli/release-notes/v2.66.1.md +14 -0
- package/cli/dist/web-ui/docs/cn/cli/release-notes/v2.66.2.md +5 -0
- package/cli/dist/web-ui/docs/cn/cli/release-notes/v2.67.0.md +33 -0
- package/cli/dist/web-ui/docs/cn/cli/release-notes/v2.68.0.md +28 -0
- package/cli/dist/web-ui/docs/cn/cli/release-notes/v2.7.0.md +16 -0
- package/cli/dist/web-ui/docs/cn/cli/release-notes/v2.8.0.md +18 -0
- package/cli/dist/web-ui/docs/cn/cli/release-notes/v2.8.1.md +17 -0
- package/cli/dist/web-ui/docs/cn/cli/release-notes/v2.8.2.md +5 -0
- package/cli/dist/web-ui/docs/cn/cli/release-notes/v2.8.3.md +14 -0
- package/cli/dist/web-ui/docs/cn/cli/release-notes/v2.8.4.md +9 -0
- package/cli/dist/web-ui/docs/cn/cli/release-notes/v2.8.5.md +5 -0
- package/cli/dist/web-ui/docs/cn/cli/release-notes/v2.8.6.md +14 -0
- package/cli/dist/web-ui/docs/cn/cli/release-notes/v2.9.0.md +5 -0
- package/cli/dist/web-ui/docs/cn/cli/remote-control.md +247 -0
- package/cli/dist/web-ui/docs/cn/cli/sandboxing.md +316 -0
- package/cli/dist/web-ui/docs/cn/cli/scheduled-tasks.md +161 -0
- package/cli/dist/web-ui/docs/cn/cli/sdk-custom-tools.md +1195 -0
- package/cli/dist/web-ui/docs/cn/cli/sdk-demos.md +347 -0
- package/cli/dist/web-ui/docs/cn/cli/sdk-hooks.md +803 -0
- package/cli/dist/web-ui/docs/cn/cli/sdk-mcp.md +643 -0
- package/cli/dist/web-ui/docs/cn/cli/sdk-permissions.md +501 -0
- package/cli/dist/web-ui/docs/cn/cli/sdk-python.md +783 -0
- package/cli/dist/web-ui/docs/cn/cli/sdk-sessions.md +332 -0
- package/cli/dist/web-ui/docs/cn/cli/sdk-typescript.md +759 -0
- package/cli/dist/web-ui/docs/cn/cli/sdk.md +1105 -0
- package/cli/dist/web-ui/docs/cn/cli/security.md +387 -0
- package/cli/dist/web-ui/docs/cn/cli/settings.md +602 -0
- package/cli/dist/web-ui/docs/cn/cli/skills.md +448 -0
- package/cli/dist/web-ui/docs/cn/cli/slash-commands.md +397 -0
- package/cli/dist/web-ui/docs/cn/cli/statusline.md +525 -0
- package/cli/dist/web-ui/docs/cn/cli/sub-agents.md +634 -0
- package/cli/dist/web-ui/docs/cn/cli/terminal-config.md +77 -0
- package/cli/dist/web-ui/docs/cn/cli/tools-reference.md +99 -0
- package/cli/dist/web-ui/docs/cn/cli/troubleshooting.md +190 -0
- package/cli/dist/web-ui/docs/cn/cli/web-ui.md +164 -0
- package/cli/dist/web-ui/docs/cn/cli/wecom-bot-setup.md +274 -0
- package/cli/dist/web-ui/docs/cn/cli/worktree.md +660 -0
- package/cli/dist/web-ui/docs/en/cli/acp.md +126 -0
- package/cli/dist/web-ui/docs/en/cli/agent-teams.md +327 -0
- package/cli/dist/web-ui/docs/en/cli/bash-sandboxing.md +290 -0
- package/cli/dist/web-ui/docs/en/cli/best-practices.md +554 -0
- package/cli/dist/web-ui/docs/en/cli/channels-reference.md +293 -0
- package/cli/dist/web-ui/docs/en/cli/channels.md +215 -0
- package/cli/dist/web-ui/docs/en/cli/checkpointing.md +53 -0
- package/cli/dist/web-ui/docs/en/cli/cli-reference.md +187 -0
- package/cli/dist/web-ui/docs/en/cli/common-workflows.md +1013 -0
- package/cli/dist/web-ui/docs/en/cli/costs.md +174 -0
- package/cli/dist/web-ui/docs/en/cli/devcontainer.md +553 -0
- package/cli/dist/web-ui/docs/en/cli/env-vars.md +326 -0
- package/cli/dist/web-ui/docs/en/cli/gitlab-ci-cd.md +357 -0
- package/cli/dist/web-ui/docs/en/cli/headless.md +258 -0
- package/cli/dist/web-ui/docs/en/cli/hooks-guide.md +9 -0
- package/cli/dist/web-ui/docs/en/cli/hooks.md +801 -0
- package/cli/dist/web-ui/docs/en/cli/iam.md +530 -0
- package/cli/dist/web-ui/docs/en/cli/ide-integrations.md +92 -0
- package/cli/dist/web-ui/docs/en/cli/installation.md +266 -0
- package/cli/dist/web-ui/docs/en/cli/interactive-mode.md +233 -0
- package/cli/dist/web-ui/docs/en/cli/mcp.md +739 -0
- package/cli/dist/web-ui/docs/en/cli/memory.md +436 -0
- package/cli/dist/web-ui/docs/en/cli/models.md +355 -0
- package/cli/dist/web-ui/docs/en/cli/overview.md +100 -0
- package/cli/dist/web-ui/docs/en/cli/plugin-marketplaces.md +534 -0
- package/cli/dist/web-ui/docs/en/cli/plugins-reference.md +774 -0
- package/cli/dist/web-ui/docs/en/cli/plugins.md +688 -0
- package/cli/dist/web-ui/docs/en/cli/quickstart.md +249 -0
- package/cli/dist/web-ui/docs/en/cli/release-notes/README.md +194 -0
- package/cli/dist/web-ui/docs/en/cli/release-notes/v2.10.0.md +23 -0
- package/cli/dist/web-ui/docs/en/cli/release-notes/v2.10.1.md +5 -0
- package/cli/dist/web-ui/docs/en/cli/release-notes/v2.11.0.md +24 -0
- package/cli/dist/web-ui/docs/en/cli/release-notes/v2.12.0.md +21 -0
- package/cli/dist/web-ui/docs/en/cli/release-notes/v2.13.0.md +20 -0
- package/cli/dist/web-ui/docs/en/cli/release-notes/v2.14.0.md +22 -0
- package/cli/dist/web-ui/docs/en/cli/release-notes/v2.14.1.md +8 -0
- package/cli/dist/web-ui/docs/en/cli/release-notes/v2.15.0.md +18 -0
- package/cli/dist/web-ui/docs/en/cli/release-notes/v2.15.1.md +11 -0
- package/cli/dist/web-ui/docs/en/cli/release-notes/v2.16.0.md +20 -0
- package/cli/dist/web-ui/docs/en/cli/release-notes/v2.17.0.md +29 -0
- package/cli/dist/web-ui/docs/en/cli/release-notes/v2.18.0.md +17 -0
- package/cli/dist/web-ui/docs/en/cli/release-notes/v2.19.0.md +11 -0
- package/cli/dist/web-ui/docs/en/cli/release-notes/v2.19.1.md +14 -0
- package/cli/dist/web-ui/docs/en/cli/release-notes/v2.19.2.md +11 -0
- package/cli/dist/web-ui/docs/en/cli/release-notes/v2.20.0.md +23 -0
- package/cli/dist/web-ui/docs/en/cli/release-notes/v2.20.1.md +15 -0
- package/cli/dist/web-ui/docs/en/cli/release-notes/v2.21.0.md +13 -0
- package/cli/dist/web-ui/docs/en/cli/release-notes/v2.22.0.md +16 -0
- package/cli/dist/web-ui/docs/en/cli/release-notes/v2.23.0.md +41 -0
- package/cli/dist/web-ui/docs/en/cli/release-notes/v2.23.2.md +5 -0
- package/cli/dist/web-ui/docs/en/cli/release-notes/v2.23.3.md +5 -0
- package/cli/dist/web-ui/docs/en/cli/release-notes/v2.23.4.md +15 -0
- package/cli/dist/web-ui/docs/en/cli/release-notes/v2.23.5.md +11 -0
- package/cli/dist/web-ui/docs/en/cli/release-notes/v2.24.0.md +17 -0
- package/cli/dist/web-ui/docs/en/cli/release-notes/v2.25.0.md +18 -0
- package/cli/dist/web-ui/docs/en/cli/release-notes/v2.25.1.md +21 -0
- package/cli/dist/web-ui/docs/en/cli/release-notes/v2.26.0.md +18 -0
- package/cli/dist/web-ui/docs/en/cli/release-notes/v2.27.0.md +16 -0
- package/cli/dist/web-ui/docs/en/cli/release-notes/v2.27.1.md +16 -0
- package/cli/dist/web-ui/docs/en/cli/release-notes/v2.27.2.md +7 -0
- package/cli/dist/web-ui/docs/en/cli/release-notes/v2.27.3.md +15 -0
- package/cli/dist/web-ui/docs/en/cli/release-notes/v2.28.0.md +26 -0
- package/cli/dist/web-ui/docs/en/cli/release-notes/v2.28.1.md +5 -0
- package/cli/dist/web-ui/docs/en/cli/release-notes/v2.29.0.md +35 -0
- package/cli/dist/web-ui/docs/en/cli/release-notes/v2.3.1.md +16 -0
- package/cli/dist/web-ui/docs/en/cli/release-notes/v2.30.0.md +19 -0
- package/cli/dist/web-ui/docs/en/cli/release-notes/v2.30.1.md +5 -0
- package/cli/dist/web-ui/docs/en/cli/release-notes/v2.31.0.md +51 -0
- package/cli/dist/web-ui/docs/en/cli/release-notes/v2.31.1.md +11 -0
- package/cli/dist/web-ui/docs/en/cli/release-notes/v2.31.2.md +16 -0
- package/cli/dist/web-ui/docs/en/cli/release-notes/v2.32.0.md +19 -0
- package/cli/dist/web-ui/docs/en/cli/release-notes/v2.33.0.md +28 -0
- package/cli/dist/web-ui/docs/en/cli/release-notes/v2.33.1.md +7 -0
- package/cli/dist/web-ui/docs/en/cli/release-notes/v2.34.0.md +27 -0
- package/cli/dist/web-ui/docs/en/cli/release-notes/v2.34.1.md +7 -0
- package/cli/dist/web-ui/docs/en/cli/release-notes/v2.35.0.md +22 -0
- package/cli/dist/web-ui/docs/en/cli/release-notes/v2.36.0.md +23 -0
- package/cli/dist/web-ui/docs/en/cli/release-notes/v2.36.1.md +5 -0
- package/cli/dist/web-ui/docs/en/cli/release-notes/v2.36.2.md +22 -0
- package/cli/dist/web-ui/docs/en/cli/release-notes/v2.36.3.md +17 -0
- package/cli/dist/web-ui/docs/en/cli/release-notes/v2.37.0.md +15 -0
- package/cli/dist/web-ui/docs/en/cli/release-notes/v2.37.1.md +15 -0
- package/cli/dist/web-ui/docs/en/cli/release-notes/v2.37.10.md +5 -0
- package/cli/dist/web-ui/docs/en/cli/release-notes/v2.37.11.md +8 -0
- package/cli/dist/web-ui/docs/en/cli/release-notes/v2.37.12.md +14 -0
- package/cli/dist/web-ui/docs/en/cli/release-notes/v2.37.13.md +11 -0
- package/cli/dist/web-ui/docs/en/cli/release-notes/v2.37.14.md +24 -0
- package/cli/dist/web-ui/docs/en/cli/release-notes/v2.37.15.md +11 -0
- package/cli/dist/web-ui/docs/en/cli/release-notes/v2.37.16.md +9 -0
- package/cli/dist/web-ui/docs/en/cli/release-notes/v2.37.17.md +5 -0
- package/cli/dist/web-ui/docs/en/cli/release-notes/v2.37.18.md +9 -0
- package/cli/dist/web-ui/docs/en/cli/release-notes/v2.37.19.md +5 -0
- package/cli/dist/web-ui/docs/en/cli/release-notes/v2.37.2.md +28 -0
- package/cli/dist/web-ui/docs/en/cli/release-notes/v2.37.20.md +8 -0
- package/cli/dist/web-ui/docs/en/cli/release-notes/v2.37.3.md +22 -0
- package/cli/dist/web-ui/docs/en/cli/release-notes/v2.37.4.md +19 -0
- package/cli/dist/web-ui/docs/en/cli/release-notes/v2.37.5.md +5 -0
- package/cli/dist/web-ui/docs/en/cli/release-notes/v2.37.6.md +5 -0
- package/cli/dist/web-ui/docs/en/cli/release-notes/v2.37.7.md +5 -0
- package/cli/dist/web-ui/docs/en/cli/release-notes/v2.37.8.md +5 -0
- package/cli/dist/web-ui/docs/en/cli/release-notes/v2.37.9.md +8 -0
- package/cli/dist/web-ui/docs/en/cli/release-notes/v2.38.0.md +22 -0
- package/cli/dist/web-ui/docs/en/cli/release-notes/v2.38.1.md +6 -0
- package/cli/dist/web-ui/docs/en/cli/release-notes/v2.38.2.md +9 -0
- package/cli/dist/web-ui/docs/en/cli/release-notes/v2.39.0.md +18 -0
- package/cli/dist/web-ui/docs/en/cli/release-notes/v2.4.0.md +19 -0
- package/cli/dist/web-ui/docs/en/cli/release-notes/v2.40.0.md +20 -0
- package/cli/dist/web-ui/docs/en/cli/release-notes/v2.40.1.md +6 -0
- package/cli/dist/web-ui/docs/en/cli/release-notes/v2.41.0.md +15 -0
- package/cli/dist/web-ui/docs/en/cli/release-notes/v2.41.1.md +6 -0
- package/cli/dist/web-ui/docs/en/cli/release-notes/v2.41.2.md +5 -0
- package/cli/dist/web-ui/docs/en/cli/release-notes/v2.41.3.md +8 -0
- package/cli/dist/web-ui/docs/en/cli/release-notes/v2.41.4.md +5 -0
- package/cli/dist/web-ui/docs/en/cli/release-notes/v2.41.5.md +10 -0
- package/cli/dist/web-ui/docs/en/cli/release-notes/v2.41.6.md +9 -0
- package/cli/dist/web-ui/docs/en/cli/release-notes/v2.41.7.md +14 -0
- package/cli/dist/web-ui/docs/en/cli/release-notes/v2.41.8.md +18 -0
- package/cli/dist/web-ui/docs/en/cli/release-notes/v2.42.0.md +39 -0
- package/cli/dist/web-ui/docs/en/cli/release-notes/v2.42.1.md +8 -0
- package/cli/dist/web-ui/docs/en/cli/release-notes/v2.42.3.md +18 -0
- package/cli/dist/web-ui/docs/en/cli/release-notes/v2.43.0.md +27 -0
- package/cli/dist/web-ui/docs/en/cli/release-notes/v2.43.1.md +27 -0
- package/cli/dist/web-ui/docs/en/cli/release-notes/v2.44.0.md +11 -0
- package/cli/dist/web-ui/docs/en/cli/release-notes/v2.44.1.md +22 -0
- package/cli/dist/web-ui/docs/en/cli/release-notes/v2.45.0.md +34 -0
- package/cli/dist/web-ui/docs/en/cli/release-notes/v2.45.1.md +7 -0
- package/cli/dist/web-ui/docs/en/cli/release-notes/v2.46.0.md +12 -0
- package/cli/dist/web-ui/docs/en/cli/release-notes/v2.47.0.md +20 -0
- package/cli/dist/web-ui/docs/en/cli/release-notes/v2.48.0.md +32 -0
- package/cli/dist/web-ui/docs/en/cli/release-notes/v2.48.1.md +11 -0
- package/cli/dist/web-ui/docs/en/cli/release-notes/v2.49.0.md +26 -0
- package/cli/dist/web-ui/docs/en/cli/release-notes/v2.49.1.md +14 -0
- package/cli/dist/web-ui/docs/en/cli/release-notes/v2.49.2.md +39 -0
- package/cli/dist/web-ui/docs/en/cli/release-notes/v2.49.3.md +7 -0
- package/cli/dist/web-ui/docs/en/cli/release-notes/v2.49.5.md +11 -0
- package/cli/dist/web-ui/docs/en/cli/release-notes/v2.49.6.md +9 -0
- package/cli/dist/web-ui/docs/en/cli/release-notes/v2.49.7.md +7 -0
- package/cli/dist/web-ui/docs/en/cli/release-notes/v2.5.0.md +24 -0
- package/cli/dist/web-ui/docs/en/cli/release-notes/v2.50.0.md +25 -0
- package/cli/dist/web-ui/docs/en/cli/release-notes/v2.50.1.md +9 -0
- package/cli/dist/web-ui/docs/en/cli/release-notes/v2.50.2.md +11 -0
- package/cli/dist/web-ui/docs/en/cli/release-notes/v2.50.3.md +5 -0
- package/cli/dist/web-ui/docs/en/cli/release-notes/v2.50.4.md +17 -0
- package/cli/dist/web-ui/docs/en/cli/release-notes/v2.50.5.md +16 -0
- package/cli/dist/web-ui/docs/en/cli/release-notes/v2.50.6.md +15 -0
- package/cli/dist/web-ui/docs/en/cli/release-notes/v2.50.7.md +15 -0
- package/cli/dist/web-ui/docs/en/cli/release-notes/v2.51.0.md +24 -0
- package/cli/dist/web-ui/docs/en/cli/release-notes/v2.51.1.md +17 -0
- package/cli/dist/web-ui/docs/en/cli/release-notes/v2.51.2.md +5 -0
- package/cli/dist/web-ui/docs/en/cli/release-notes/v2.52.0.md +30 -0
- package/cli/dist/web-ui/docs/en/cli/release-notes/v2.52.1.md +28 -0
- package/cli/dist/web-ui/docs/en/cli/release-notes/v2.52.2.md +12 -0
- package/cli/dist/web-ui/docs/en/cli/release-notes/v2.52.3.md +13 -0
- package/cli/dist/web-ui/docs/en/cli/release-notes/v2.52.4.md +27 -0
- package/cli/dist/web-ui/docs/en/cli/release-notes/v2.52.5.md +21 -0
- package/cli/dist/web-ui/docs/en/cli/release-notes/v2.52.6.md +7 -0
- package/cli/dist/web-ui/docs/en/cli/release-notes/v2.53.0.md +29 -0
- package/cli/dist/web-ui/docs/en/cli/release-notes/v2.54.0.md +26 -0
- package/cli/dist/web-ui/docs/en/cli/release-notes/v2.55.0.md +21 -0
- package/cli/dist/web-ui/docs/en/cli/release-notes/v2.55.1.md +13 -0
- package/cli/dist/web-ui/docs/en/cli/release-notes/v2.56.0.md +20 -0
- package/cli/dist/web-ui/docs/en/cli/release-notes/v2.56.1.md +5 -0
- package/cli/dist/web-ui/docs/en/cli/release-notes/v2.57.0.md +32 -0
- package/cli/dist/web-ui/docs/en/cli/release-notes/v2.57.1.md +10 -0
- package/cli/dist/web-ui/docs/en/cli/release-notes/v2.58.0.md +34 -0
- package/cli/dist/web-ui/docs/en/cli/release-notes/v2.59.0.md +28 -0
- package/cli/dist/web-ui/docs/en/cli/release-notes/v2.6.0.md +5 -0
- package/cli/dist/web-ui/docs/en/cli/release-notes/v2.6.1.md +10 -0
- package/cli/dist/web-ui/docs/en/cli/release-notes/v2.60.0.md +20 -0
- package/cli/dist/web-ui/docs/en/cli/release-notes/v2.61.0.md +29 -0
- package/cli/dist/web-ui/docs/en/cli/release-notes/v2.61.1.md +5 -0
- package/cli/dist/web-ui/docs/en/cli/release-notes/v2.61.2.md +6 -0
- package/cli/dist/web-ui/docs/en/cli/release-notes/v2.61.3.md +13 -0
- package/cli/dist/web-ui/docs/en/cli/release-notes/v2.62.0.md +21 -0
- package/cli/dist/web-ui/docs/en/cli/release-notes/v2.62.1.md +11 -0
- package/cli/dist/web-ui/docs/en/cli/release-notes/v2.63.0.md +19 -0
- package/cli/dist/web-ui/docs/en/cli/release-notes/v2.63.1.md +5 -0
- package/cli/dist/web-ui/docs/en/cli/release-notes/v2.63.2.md +7 -0
- package/cli/dist/web-ui/docs/en/cli/release-notes/v2.63.3.md +6 -0
- package/cli/dist/web-ui/docs/en/cli/release-notes/v2.63.4.md +8 -0
- package/cli/dist/web-ui/docs/en/cli/release-notes/v2.63.5.md +6 -0
- package/cli/dist/web-ui/docs/en/cli/release-notes/v2.64.0.md +37 -0
- package/cli/dist/web-ui/docs/en/cli/release-notes/v2.64.1.md +6 -0
- package/cli/dist/web-ui/docs/en/cli/release-notes/v2.64.2.md +11 -0
- package/cli/dist/web-ui/docs/en/cli/release-notes/v2.65.0.md +19 -0
- package/cli/dist/web-ui/docs/en/cli/release-notes/v2.65.1.md +11 -0
- package/cli/dist/web-ui/docs/en/cli/release-notes/v2.66.0.md +15 -0
- package/cli/dist/web-ui/docs/en/cli/release-notes/v2.66.1.md +14 -0
- package/cli/dist/web-ui/docs/en/cli/release-notes/v2.66.2.md +5 -0
- package/cli/dist/web-ui/docs/en/cli/release-notes/v2.67.0.md +33 -0
- package/cli/dist/web-ui/docs/en/cli/release-notes/v2.68.0.md +28 -0
- package/cli/dist/web-ui/docs/en/cli/release-notes/v2.7.0.md +16 -0
- package/cli/dist/web-ui/docs/en/cli/release-notes/v2.8.0.md +18 -0
- package/cli/dist/web-ui/docs/en/cli/release-notes/v2.8.1.md +17 -0
- package/cli/dist/web-ui/docs/en/cli/release-notes/v2.8.2.md +5 -0
- package/cli/dist/web-ui/docs/en/cli/release-notes/v2.8.3.md +14 -0
- package/cli/dist/web-ui/docs/en/cli/release-notes/v2.8.4.md +9 -0
- package/cli/dist/web-ui/docs/en/cli/release-notes/v2.8.5.md +5 -0
- package/cli/dist/web-ui/docs/en/cli/release-notes/v2.8.6.md +14 -0
- package/cli/dist/web-ui/docs/en/cli/release-notes/v2.9.0.md +5 -0
- package/cli/dist/web-ui/docs/en/cli/remote-control.md +247 -0
- package/cli/dist/web-ui/docs/en/cli/sandboxing.md +316 -0
- package/cli/dist/web-ui/docs/en/cli/scheduled-tasks.md +160 -0
- package/cli/dist/web-ui/docs/en/cli/sdk-custom-tools.md +1131 -0
- package/cli/dist/web-ui/docs/en/cli/sdk-demos.md +347 -0
- package/cli/dist/web-ui/docs/en/cli/sdk-hooks.md +813 -0
- package/cli/dist/web-ui/docs/en/cli/sdk-mcp.md +645 -0
- package/cli/dist/web-ui/docs/en/cli/sdk-permissions.md +461 -0
- package/cli/dist/web-ui/docs/en/cli/sdk-python.md +783 -0
- package/cli/dist/web-ui/docs/en/cli/sdk-sessions.md +340 -0
- package/cli/dist/web-ui/docs/en/cli/sdk-typescript.md +759 -0
- package/cli/dist/web-ui/docs/en/cli/sdk.md +1103 -0
- package/cli/dist/web-ui/docs/en/cli/security.md +387 -0
- package/cli/dist/web-ui/docs/en/cli/settings.md +602 -0
- package/cli/dist/web-ui/docs/en/cli/skills.md +448 -0
- package/cli/dist/web-ui/docs/en/cli/slash-commands.md +397 -0
- package/cli/dist/web-ui/docs/en/cli/statusline.md +525 -0
- package/cli/dist/web-ui/docs/en/cli/sub-agents.md +621 -0
- package/cli/dist/web-ui/docs/en/cli/terminal-config.md +77 -0
- package/cli/dist/web-ui/docs/en/cli/tools-reference.md +99 -0
- package/cli/dist/web-ui/docs/en/cli/troubleshooting.md +190 -0
- package/cli/dist/web-ui/docs/en/cli/web-ui.md +164 -0
- package/cli/dist/web-ui/docs/en/cli/wecom-bot-setup.md +274 -0
- package/cli/dist/web-ui/docs/en/cli/worktree.md +660 -0
- package/cli/dist/web-ui/docs/search-index-en.json +1 -0
- package/cli/dist/web-ui/docs/search-index-zh.json +1 -0
- package/cli/dist/web-ui/docs/sidebar-en.json +1 -0
- package/cli/dist/web-ui/docs/sidebar-zh.json +1 -0
- package/cli/dist/web-ui/index.html +2 -2
- package/cli/package.json +1 -1
- package/cli/product.cloudhosted.json +2 -2
- package/cli/product.internal.json +2 -2
- package/cli/product.ioa.json +2 -2
- package/cli/product.json +4 -3
- package/cli/product.selfhosted.json +2 -2
- package/lib/query.d.ts.map +1 -1
- package/lib/query.js +5 -1
- package/lib/query.js.map +1 -1
- package/lib/transport/index.d.ts +1 -1
- package/lib/transport/index.d.ts.map +1 -1
- package/lib/transport/process-transport.d.ts +1 -1
- package/lib/transport/process-transport.d.ts.map +1 -1
- package/lib/transport/process-transport.js +5 -1
- package/lib/transport/process-transport.js.map +1 -1
- package/lib/types.d.ts +3 -0
- package/lib/types.d.ts.map +1 -1
- package/package.json +1 -1
- package/cli/dist/web-ui/assets/index-BPT-qRRx.js +0 -411
- package/cli/dist/web-ui/assets/index-f_ibHSHw.css +0 -32
|
@@ -0,0 +1,801 @@
|
|
|
1
|
+
# Hooks Reference
|
|
2
|
+
|
|
3
|
+
> **Version requirement:** This guide targets the Claude Code Hooks–compatible implementation shipped with CodeBuddy Code v1.16.0 and later.
|
|
4
|
+
> **Feature status:** Hooks are currently in **Beta**; APIs and runtime behavior may evolve.
|
|
5
|
+
|
|
6
|
+
Hooks let you inject custom scripts or commands into every stage of a CodeBuddy Code session so you can automate validation, bootstrap environments, run compliance checks, and more. Our implementation is fully compatible with the Claude Code Hooks specification, including event names, payload schemas, and safety guarantees.
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
## Configuration
|
|
10
|
+
|
|
11
|
+
CodeBuddy Code stores hook configuration inside your settings files:
|
|
12
|
+
|
|
13
|
+
| Scope | Path | Notes |
|
|
14
|
+
| --- | --- | --- |
|
|
15
|
+
| User | `~/.codebuddy/settings.json` | Applies to every project |
|
|
16
|
+
| Project | `<project-root>/.codebuddy/settings.json` | Shared with the whole repo |
|
|
17
|
+
| Project local | `<project-root>/.codebuddy/settings.local.json` | Local-only overrides (not committed) |
|
|
18
|
+
| Enterprise policy | Distributed policy bundle | Managed centrally by your org |
|
|
19
|
+
|
|
20
|
+
**Merge behavior:** Hooks from different scopes are **merged**, not overwritten. All matching hooks for the same event run in parallel.
|
|
21
|
+
|
|
22
|
+
## Structure
|
|
23
|
+
|
|
24
|
+
Hooks are grouped by matcher, and each matcher may contain multiple hook definitions:
|
|
25
|
+
|
|
26
|
+
```json
|
|
27
|
+
{
|
|
28
|
+
"hooks": {
|
|
29
|
+
"EventName": [
|
|
30
|
+
{
|
|
31
|
+
"matcher": "ToolPattern",
|
|
32
|
+
"hooks": [
|
|
33
|
+
{
|
|
34
|
+
"type": "command",
|
|
35
|
+
"command": "your-command-here"
|
|
36
|
+
}
|
|
37
|
+
]
|
|
38
|
+
}
|
|
39
|
+
]
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
```
|
|
43
|
+
|
|
44
|
+
**Key fields:**
|
|
45
|
+
|
|
46
|
+
- **matcher** – Regex pattern for tool names, case-sensitive (only for `PreToolUse` and `PostToolUse`).
|
|
47
|
+
- Simple string match: `Write` matches any tool name containing "Write" (e.g., `Write`, `NotebookWrite`).
|
|
48
|
+
- Exact match: Use `^Write$` to match only the Write tool.
|
|
49
|
+
- Multiple tools: `Edit|Write` or `Web.*`.
|
|
50
|
+
- Match all tools: Any of the following are equivalent:
|
|
51
|
+
- Use `*`
|
|
52
|
+
- Use empty string `""`
|
|
53
|
+
- Omit the `matcher` field
|
|
54
|
+
- **hooks** – Array executed when the matcher hits.
|
|
55
|
+
- **type** – Execution mode. Use `"command"` for shell commands, or `"prompt"` for LLM-based evaluation.
|
|
56
|
+
- **command** – (type = `command`) Shell command to run. `$CODEBUDDY_PROJECT_DIR` is available. Executed using the user's default shell (`$SHELL`) on macOS/Linux, and **Git Bash is enforced on Windows** (cmd.exe and PowerShell are not supported), so commands must be compatible with bash syntax.
|
|
57
|
+
- **prompt** – (type = `prompt`) Prompt text sent to the LLM for evaluation (only supports `Stop`, `UserPromptSubmit`, and `PreToolUse` events).
|
|
58
|
+
- **timeout** – Optional timeout in seconds for the specific hook.
|
|
59
|
+
|
|
60
|
+
For events that do not use matchers (`UserPromptSubmit`, `Stop`, `SubagentStop`, etc.) you can omit the field entirely:
|
|
61
|
+
|
|
62
|
+
```json
|
|
63
|
+
{
|
|
64
|
+
"hooks": {
|
|
65
|
+
"UserPromptSubmit": [
|
|
66
|
+
{
|
|
67
|
+
"hooks": [
|
|
68
|
+
{
|
|
69
|
+
"type": "command",
|
|
70
|
+
"command": "python3 /path/to/prompt-validator.py"
|
|
71
|
+
}
|
|
72
|
+
]
|
|
73
|
+
}
|
|
74
|
+
]
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
```
|
|
78
|
+
|
|
79
|
+
## Project-Scoped Hook Scripts
|
|
80
|
+
|
|
81
|
+
Use the `CODEBUDDY_PROJECT_DIR` environment variable (available while CodeBuddy builds the hook command) to reference scripts stored in the repo:
|
|
82
|
+
|
|
83
|
+
```json
|
|
84
|
+
{
|
|
85
|
+
"hooks": {
|
|
86
|
+
"PostToolUse": [
|
|
87
|
+
{
|
|
88
|
+
"matcher": "Write|Edit",
|
|
89
|
+
"hooks": [
|
|
90
|
+
{
|
|
91
|
+
"type": "command",
|
|
92
|
+
"command": "\"$CODEBUDDY_PROJECT_DIR\"/.codebuddy/hooks/check-style.sh"
|
|
93
|
+
}
|
|
94
|
+
]
|
|
95
|
+
}
|
|
96
|
+
]
|
|
97
|
+
}
|
|
98
|
+
}
|
|
99
|
+
```
|
|
100
|
+
|
|
101
|
+
> **Tip**: If your hook script is a Python file, explicitly use `python3` to invoke it instead of directly executing the `.py` file. This is because even if the script includes a shebang line (`#!/usr/bin/env python3`), Git Bash on Windows may not correctly recognize it:
|
|
102
|
+
> ```json
|
|
103
|
+
> "command": "python3 \"$CODEBUDDY_PROJECT_DIR\"/.codebuddy/hooks/my_hook.py"
|
|
104
|
+
> ```
|
|
105
|
+
|
|
106
|
+
## Plugin Hooks
|
|
107
|
+
|
|
108
|
+
Plugins can ship hooks that merge seamlessly with user or project settings. When you enable a plugin, its hooks are merged automatically.
|
|
109
|
+
|
|
110
|
+
**How plugin hooks work:**
|
|
111
|
+
|
|
112
|
+
- Defined inside `hooks/hooks.json` within the plugin bundle, or via a custom path referenced from the `hooks` field.
|
|
113
|
+
- Activated hooks merge with user and project hooks.
|
|
114
|
+
- Multiple hook sources can all respond to the same event.
|
|
115
|
+
- `${CODEBUDDY_PLUGIN_ROOT}` points to the plugin directory for script references.
|
|
116
|
+
|
|
117
|
+
Example:
|
|
118
|
+
|
|
119
|
+
```json
|
|
120
|
+
{
|
|
121
|
+
"description": "Automatic code formatting",
|
|
122
|
+
"hooks": {
|
|
123
|
+
"PostToolUse": [
|
|
124
|
+
{
|
|
125
|
+
"matcher": "Write|Edit",
|
|
126
|
+
"hooks": [
|
|
127
|
+
{
|
|
128
|
+
"type": "command",
|
|
129
|
+
"command": "${CODEBUDDY_PLUGIN_ROOT}/scripts/format.sh",
|
|
130
|
+
"timeout": 30
|
|
131
|
+
}
|
|
132
|
+
]
|
|
133
|
+
}
|
|
134
|
+
]
|
|
135
|
+
}
|
|
136
|
+
}
|
|
137
|
+
```
|
|
138
|
+
|
|
139
|
+
## Prompt-Based Hooks
|
|
140
|
+
|
|
141
|
+
Besides shell commands (`type: "command"`), CodeBuddy Code also supports prompt-based hooks (`type: "prompt"`) that use an LLM to evaluate whether to allow or block an action.
|
|
142
|
+
|
|
143
|
+
> **Supported events**: Currently only `Stop`, `UserPromptSubmit`, and `PreToolUse` events are supported.
|
|
144
|
+
|
|
145
|
+
### How Prompt Hooks Work
|
|
146
|
+
|
|
147
|
+
Instead of running a bash command, the hook:
|
|
148
|
+
|
|
149
|
+
1. Sends the hook input plus your prompt to a fast LLM (Haiku).
|
|
150
|
+
2. Receives a structured JSON decision.
|
|
151
|
+
3. Lets CodeBuddy Code enforce that decision.
|
|
152
|
+
|
|
153
|
+
### Supported Events
|
|
154
|
+
|
|
155
|
+
| Event | Use Case |
|
|
156
|
+
| --- | --- |
|
|
157
|
+
| `Stop` | Intelligently decide whether CodeBuddy should continue working |
|
|
158
|
+
| `UserPromptSubmit` | Use LLM to assist in validating user prompts |
|
|
159
|
+
| `PreToolUse` | Make context-aware permission decisions |
|
|
160
|
+
|
|
161
|
+
### Comparison with Command Hooks
|
|
162
|
+
|
|
163
|
+
| Feature | Command Hooks | Prompt Hooks |
|
|
164
|
+
| --- | --- | --- |
|
|
165
|
+
| **Execution** | Runs bash scripts | Queries LLM |
|
|
166
|
+
| **Decision logic** | You implement in code | LLM evaluates context |
|
|
167
|
+
| **Setup complexity** | Requires script files | Just configure a prompt |
|
|
168
|
+
| **Context awareness** | Limited by script logic | Natural language understanding |
|
|
169
|
+
| **Performance** | Fast (local execution) | Slower (API call) |
|
|
170
|
+
| **Best for** | Deterministic rules | Context-aware decisions |
|
|
171
|
+
|
|
172
|
+
### Configuration
|
|
173
|
+
|
|
174
|
+
```json
|
|
175
|
+
{
|
|
176
|
+
"hooks": {
|
|
177
|
+
"Stop": [
|
|
178
|
+
{
|
|
179
|
+
"hooks": [
|
|
180
|
+
{
|
|
181
|
+
"type": "prompt",
|
|
182
|
+
"prompt": "Evaluate if CodeBuddy should stop: $ARGUMENTS. Check if all tasks are complete."
|
|
183
|
+
}
|
|
184
|
+
]
|
|
185
|
+
}
|
|
186
|
+
]
|
|
187
|
+
}
|
|
188
|
+
}
|
|
189
|
+
```
|
|
190
|
+
|
|
191
|
+
**Fields:**
|
|
192
|
+
|
|
193
|
+
- **type** – Must be `"prompt"`.
|
|
194
|
+
- **prompt** – Text sent to the LLM. Use `$ARGUMENTS` as a placeholder for the hook input JSON, which will be directly replaced. When `$ARGUMENTS` is not present, the input JSON is appended in the format `\n\nARGUMENTS:\n{JSON}`.
|
|
195
|
+
- **timeout** – Optional timeout in seconds (default: 30s).
|
|
196
|
+
|
|
197
|
+
### Response Schema
|
|
198
|
+
|
|
199
|
+
The LLM must return JSON:
|
|
200
|
+
|
|
201
|
+
```jsonc
|
|
202
|
+
{
|
|
203
|
+
"ok": true | false,
|
|
204
|
+
"reason": "Explanation for the decision" // Required when ok is false
|
|
205
|
+
}
|
|
206
|
+
```
|
|
207
|
+
|
|
208
|
+
**Response fields:**
|
|
209
|
+
|
|
210
|
+
- `ok`: `true` to allow the operation, `false` to block it
|
|
211
|
+
- `reason`: Required when `ok` is `false`, explanation shown to CodeBuddy
|
|
212
|
+
|
|
213
|
+
### Example: Smart Stop Hook
|
|
214
|
+
|
|
215
|
+
```json
|
|
216
|
+
{
|
|
217
|
+
"hooks": {
|
|
218
|
+
"Stop": [
|
|
219
|
+
{
|
|
220
|
+
"hooks": [
|
|
221
|
+
{
|
|
222
|
+
"type": "prompt",
|
|
223
|
+
"prompt": "You are evaluating whether CodeBuddy should stop working. Context: $ARGUMENTS\n\nAnalyze the conversation and determine if:\n1. All user-requested tasks are complete\n2. Any errors need to be addressed\n3. Follow-up work is needed\n\nRespond with JSON: {\"ok\": true} to allow stopping, or {\"ok\": false, \"reason\": \"your explanation\"} to continue working.",
|
|
224
|
+
"timeout": 30
|
|
225
|
+
}
|
|
226
|
+
]
|
|
227
|
+
}
|
|
228
|
+
]
|
|
229
|
+
}
|
|
230
|
+
}
|
|
231
|
+
```
|
|
232
|
+
|
|
233
|
+
### Example: UserPromptSubmit Validation
|
|
234
|
+
|
|
235
|
+
```json
|
|
236
|
+
{
|
|
237
|
+
"hooks": {
|
|
238
|
+
"UserPromptSubmit": [
|
|
239
|
+
{
|
|
240
|
+
"hooks": [
|
|
241
|
+
{
|
|
242
|
+
"type": "prompt",
|
|
243
|
+
"prompt": "Evaluate if this user prompt is safe and appropriate. Input: $ARGUMENTS\n\nCheck if:\n- The prompt contains sensitive information (passwords, secrets)\n- The request is clear and actionable\n- Any security concerns exist\n\nReturn: {\"ok\": true} to allow, or {\"ok\": false, \"reason\": \"explanation\"} to block."
|
|
244
|
+
}
|
|
245
|
+
]
|
|
246
|
+
}
|
|
247
|
+
]
|
|
248
|
+
}
|
|
249
|
+
}
|
|
250
|
+
```
|
|
251
|
+
|
|
252
|
+
### Example: PreToolUse Permission Decision
|
|
253
|
+
|
|
254
|
+
```json
|
|
255
|
+
{
|
|
256
|
+
"hooks": {
|
|
257
|
+
"PreToolUse": [
|
|
258
|
+
{
|
|
259
|
+
"matcher": "Bash",
|
|
260
|
+
"hooks": [
|
|
261
|
+
{
|
|
262
|
+
"type": "prompt",
|
|
263
|
+
"prompt": "Evaluate if this bash command should be allowed. Input: $ARGUMENTS\n\nCheck if:\n- The command is safe and non-destructive\n- It doesn't access sensitive files or directories\n- It aligns with the user's stated goals\n\nReturn: {\"ok\": true} to allow, or {\"ok\": false, \"reason\": \"explanation\"} to deny."
|
|
264
|
+
}
|
|
265
|
+
]
|
|
266
|
+
}
|
|
267
|
+
]
|
|
268
|
+
}
|
|
269
|
+
}
|
|
270
|
+
```
|
|
271
|
+
|
|
272
|
+
### Best Practices
|
|
273
|
+
|
|
274
|
+
- **Be specific in your prompts**: Clearly describe what you want the LLM to evaluate
|
|
275
|
+
- **Include decision criteria**: List the factors the LLM should consider
|
|
276
|
+
- **Test your prompts**: Verify the LLM makes correct decisions for your use cases
|
|
277
|
+
- **Set appropriate timeouts**: Default is 30 seconds, adjust if needed
|
|
278
|
+
- **Use for complex decisions**: Command hooks are better suited for simple, deterministic rules
|
|
279
|
+
|
|
280
|
+
## Hook Events
|
|
281
|
+
|
|
282
|
+
### Event Matrix
|
|
283
|
+
|
|
284
|
+
| Event | Trigger | Matcher support | Typical use cases |
|
|
285
|
+
| --- | --- | --- | --- |
|
|
286
|
+
| `PreToolUse` | Before a tool executes | Yes (tool name) | Command validation, approvals, logging |
|
|
287
|
+
| `PostToolUse` | After a tool succeeds | Yes | Auto-formatting, context enrichment |
|
|
288
|
+
| `Notification` | Permission prompts or 60s idle reminders | Partial | Desktop alerts, IM pings |
|
|
289
|
+
| `UserPromptSubmit` | User message submitted<br/>*(internal commands excluded)* | No | Content review, context injection |
|
|
290
|
+
| `Stop` | Main agent reply finishes | No | Force continuation, add reminders |
|
|
291
|
+
| `SubagentStop` | Sub-agent (Task tool) completes | No | Extend or annotate sub-tasks |
|
|
292
|
+
| `PreCompact` | Before context compaction | Yes (`manual` / `auto`) | Preserve key info, avoid lossy compression |
|
|
293
|
+
| `SessionStart` | Session creation or resume | Yes (`startup` / `resume` / `clear` / `compact`) | Env bootstrap, variable injection |
|
|
294
|
+
| `SessionEnd` | Session terminated | Yes (`clear` / `logout` / `prompt_input_exit` / `other`) | Cleanup, log persistence |
|
|
295
|
+
|
|
296
|
+
### PreToolUse
|
|
297
|
+
|
|
298
|
+
Runs after CodeBuddy builds tool arguments but before executing the tool.
|
|
299
|
+
|
|
300
|
+
**Common matchers:**
|
|
301
|
+
|
|
302
|
+
- `Task` – Sub-agent tasks
|
|
303
|
+
- `Bash` – Shell commands
|
|
304
|
+
- `Glob` – File globbing
|
|
305
|
+
- `Grep` – Content search
|
|
306
|
+
- `Read` – File reads
|
|
307
|
+
- `Edit` – File edits
|
|
308
|
+
- `Write` – File writes
|
|
309
|
+
- `WebFetch`, `WebSearch` – Web operations
|
|
310
|
+
|
|
311
|
+
### PostToolUse
|
|
312
|
+
|
|
313
|
+
Runs immediately after a tool succeeds. Uses the same matcher values as `PreToolUse`.
|
|
314
|
+
|
|
315
|
+
### Notification
|
|
316
|
+
|
|
317
|
+
Runs when CodeBuddy emits a notification. Matchers filter by notification type.
|
|
318
|
+
|
|
319
|
+
**Supported matchers (partial):**
|
|
320
|
+
|
|
321
|
+
- `permission_prompt` – Permission dialogs
|
|
322
|
+
- `idle_prompt` – Idle > 60 seconds
|
|
323
|
+
- `auth_success` – Auth success notification
|
|
324
|
+
- `elicitation_dialog` – MCP tool elicitation dialogs (not yet supported)
|
|
325
|
+
|
|
326
|
+
Example:
|
|
327
|
+
|
|
328
|
+
```json
|
|
329
|
+
{
|
|
330
|
+
"hooks": {
|
|
331
|
+
"Notification": [
|
|
332
|
+
{
|
|
333
|
+
"matcher": "permission_prompt",
|
|
334
|
+
"hooks": [
|
|
335
|
+
{
|
|
336
|
+
"type": "command",
|
|
337
|
+
"command": "/path/to/permission-alert.sh"
|
|
338
|
+
}
|
|
339
|
+
]
|
|
340
|
+
},
|
|
341
|
+
{
|
|
342
|
+
"matcher": "idle_prompt",
|
|
343
|
+
"hooks": [
|
|
344
|
+
{
|
|
345
|
+
"type": "command",
|
|
346
|
+
"command": "/path/to/idle-notification.sh"
|
|
347
|
+
}
|
|
348
|
+
]
|
|
349
|
+
}
|
|
350
|
+
]
|
|
351
|
+
}
|
|
352
|
+
}
|
|
353
|
+
```
|
|
354
|
+
|
|
355
|
+
### UserPromptSubmit
|
|
356
|
+
|
|
357
|
+
Runs after the user submits a prompt but before CodeBuddy processes it. Useful for injecting context, validating, or blocking certain prompts.
|
|
358
|
+
|
|
359
|
+
### Stop
|
|
360
|
+
|
|
361
|
+
Runs when the primary CodeBuddy agent finishes responding (skipped if the user manually interrupts).
|
|
362
|
+
|
|
363
|
+
### SubagentStop
|
|
364
|
+
|
|
365
|
+
Runs when a CodeBuddy sub-agent (Task tool) finishes.
|
|
366
|
+
|
|
367
|
+
### PreCompact
|
|
368
|
+
|
|
369
|
+
Runs before CodeBuddy compacts conversation context.
|
|
370
|
+
|
|
371
|
+
**Matchers:**
|
|
372
|
+
|
|
373
|
+
- `manual` – Triggered via `/compact`
|
|
374
|
+
- `auto` – Triggered automatically when the context window fills up
|
|
375
|
+
|
|
376
|
+
### SessionStart
|
|
377
|
+
|
|
378
|
+
Runs when CodeBuddy starts a new session or resumes an existing one.
|
|
379
|
+
|
|
380
|
+
**Matchers:**
|
|
381
|
+
|
|
382
|
+
- `startup` – Fresh start
|
|
383
|
+
- `resume` – Triggered by `--resume`, `--continue`, or `/resume`
|
|
384
|
+
- `clear` – Triggered by `/clear`
|
|
385
|
+
- `compact` – Triggered by auto/manual compaction
|
|
386
|
+
|
|
387
|
+
### SessionEnd
|
|
388
|
+
|
|
389
|
+
Runs when a session closes—use it to free resources or persist logs.
|
|
390
|
+
|
|
391
|
+
**`reason` field values:**
|
|
392
|
+
|
|
393
|
+
- `clear` – Session cleared via `/clear`
|
|
394
|
+
- `logout` – User signed out
|
|
395
|
+
- `prompt_input_exit` – User exited while the prompt input box was visible
|
|
396
|
+
- `other` – Any other exit reason (including normal exit)
|
|
397
|
+
|
|
398
|
+
## Hook Input
|
|
399
|
+
|
|
400
|
+
Each hook receives JSON over stdin containing session metadata plus event-specific fields:
|
|
401
|
+
|
|
402
|
+
```jsonc
|
|
403
|
+
{
|
|
404
|
+
// Common fields
|
|
405
|
+
"session_id": "string",
|
|
406
|
+
"transcript_path": "string", // Path to the conversation JSON
|
|
407
|
+
"cwd": "string", // Working directory when the hook runs
|
|
408
|
+
"permission_mode": "string", // "default", "plan", "acceptEdits", or "bypassPermissions"
|
|
409
|
+
|
|
410
|
+
// Event-specific properties
|
|
411
|
+
"hook_event_name": "string"
|
|
412
|
+
// ...
|
|
413
|
+
}
|
|
414
|
+
```
|
|
415
|
+
|
|
416
|
+
### PreToolUse Input
|
|
417
|
+
|
|
418
|
+
```json
|
|
419
|
+
{
|
|
420
|
+
"session_id": "abc123",
|
|
421
|
+
"transcript_path": "/Users/.../.codebuddy/projects/.../00893aaf-19fa-41d2-8238-13269b9b3ca0.jsonl",
|
|
422
|
+
"cwd": "/Users/...",
|
|
423
|
+
"permission_mode": "default",
|
|
424
|
+
"hook_event_name": "PreToolUse",
|
|
425
|
+
"tool_name": "Write",
|
|
426
|
+
"tool_input": {
|
|
427
|
+
"file_path": "/path/to/file.txt",
|
|
428
|
+
"content": "file content"
|
|
429
|
+
}
|
|
430
|
+
}
|
|
431
|
+
```
|
|
432
|
+
|
|
433
|
+
### PostToolUse Input
|
|
434
|
+
|
|
435
|
+
```json
|
|
436
|
+
{
|
|
437
|
+
"session_id": "abc123",
|
|
438
|
+
"transcript_path": "/Users/.../.codebuddy/projects/.../00893aaf-19fa-41d2-8238-13269b9b3ca0.jsonl",
|
|
439
|
+
"cwd": "/Users/...",
|
|
440
|
+
"permission_mode": "default",
|
|
441
|
+
"hook_event_name": "PostToolUse",
|
|
442
|
+
"tool_name": "Write",
|
|
443
|
+
"tool_input": {
|
|
444
|
+
"file_path": "/path/to/file.txt",
|
|
445
|
+
"content": "file content"
|
|
446
|
+
},
|
|
447
|
+
"tool_response": {
|
|
448
|
+
"filePath": "/path/to/file.txt",
|
|
449
|
+
"success": true
|
|
450
|
+
}
|
|
451
|
+
}
|
|
452
|
+
```
|
|
453
|
+
|
|
454
|
+
### Notification Input
|
|
455
|
+
|
|
456
|
+
```json
|
|
457
|
+
{
|
|
458
|
+
"session_id": "abc123",
|
|
459
|
+
"transcript_path": "/Users/.../.codebuddy/projects/.../00893aaf-19fa-41d2-8238-13269b9b3ca0.jsonl",
|
|
460
|
+
"cwd": "/Users/...",
|
|
461
|
+
"permission_mode": "default",
|
|
462
|
+
"hook_event_name": "Notification",
|
|
463
|
+
"message": "CodeBuddy needs your permission to use Bash",
|
|
464
|
+
"notification_type": "permission_prompt"
|
|
465
|
+
}
|
|
466
|
+
```
|
|
467
|
+
|
|
468
|
+
### UserPromptSubmit Input
|
|
469
|
+
|
|
470
|
+
```json
|
|
471
|
+
{
|
|
472
|
+
"session_id": "abc123",
|
|
473
|
+
"transcript_path": "/Users/.../.codebuddy/projects/.../00893aaf-19fa-41d2-8238-13269b9b3ca0.jsonl",
|
|
474
|
+
"cwd": "/Users/...",
|
|
475
|
+
"permission_mode": "default",
|
|
476
|
+
"hook_event_name": "UserPromptSubmit",
|
|
477
|
+
"prompt": "Write a function to calculate the factorial of a number"
|
|
478
|
+
}
|
|
479
|
+
```
|
|
480
|
+
|
|
481
|
+
### Stop & SubagentStop Input
|
|
482
|
+
|
|
483
|
+
`stop_hook_active` becomes `true` when a stop hook has already resumed execution.
|
|
484
|
+
|
|
485
|
+
```json
|
|
486
|
+
{
|
|
487
|
+
"session_id": "abc123",
|
|
488
|
+
"transcript_path": "/Users/xxx/.codebuddy/projects/.../00893aaf-19fa-41d2-8238-13269b9b3ca0.jsonl",
|
|
489
|
+
"permission_mode": "default",
|
|
490
|
+
"hook_event_name": "Stop",
|
|
491
|
+
"stop_hook_active": true
|
|
492
|
+
}
|
|
493
|
+
```
|
|
494
|
+
|
|
495
|
+
### PreCompact Input
|
|
496
|
+
|
|
497
|
+
For manual triggers, `custom_instructions` comes from the `/compact` command. Auto triggers leave it empty.
|
|
498
|
+
|
|
499
|
+
```json
|
|
500
|
+
{
|
|
501
|
+
"session_id": "abc123",
|
|
502
|
+
"transcript_path": "/Users/xxx/.codebuddy/projects/.../00893aaf-19fa-41d2-8238-13269b9b3ca0.jsonl",
|
|
503
|
+
"permission_mode": "default",
|
|
504
|
+
"hook_event_name": "PreCompact",
|
|
505
|
+
"trigger": "manual",
|
|
506
|
+
"custom_instructions": ""
|
|
507
|
+
}
|
|
508
|
+
```
|
|
509
|
+
|
|
510
|
+
### SessionStart Input
|
|
511
|
+
|
|
512
|
+
```json
|
|
513
|
+
{
|
|
514
|
+
"session_id": "abc123",
|
|
515
|
+
"transcript_path": "/Users/xxx/.codebuddy/projects/.../00893aaf-19fa-41d2-8238-13269b9b3ca0.jsonl",
|
|
516
|
+
"permission_mode": "default",
|
|
517
|
+
"hook_event_name": "SessionStart",
|
|
518
|
+
"source": "startup"
|
|
519
|
+
}
|
|
520
|
+
```
|
|
521
|
+
|
|
522
|
+
### SessionEnd Input
|
|
523
|
+
|
|
524
|
+
```json
|
|
525
|
+
{
|
|
526
|
+
"session_id": "abc123",
|
|
527
|
+
"transcript_path": "/Users/xxx/.codebuddy/projects/.../00893aaf-19fa-41d2-8238-13269b9b3ca0.jsonl",
|
|
528
|
+
"cwd": "/Users/...",
|
|
529
|
+
"permission_mode": "default",
|
|
530
|
+
"hook_event_name": "SessionEnd",
|
|
531
|
+
"reason": "other"
|
|
532
|
+
}
|
|
533
|
+
```
|
|
534
|
+
|
|
535
|
+
## Hook Output
|
|
536
|
+
|
|
537
|
+
Hooks communicate back to CodeBuddy Code in two ways.
|
|
538
|
+
|
|
539
|
+
### Basic Mode: Exit Codes
|
|
540
|
+
|
|
541
|
+
Use exit status, stdout, and stderr to convey results:
|
|
542
|
+
|
|
543
|
+
- **Exit code 0** – Success. Stdout appears in transcript mode (Ctrl+R), except for `UserPromptSubmit` and `SessionStart`, where stdout is appended to the context.
|
|
544
|
+
- **Exit code 2** – Blocking error. Message source priority: stdout (JSON `reason`/`stopReason` field or plain text) > stderr. **Stderr is only a fallback** – it is only passed to CodeBuddy when stdout has no output. Therefore, debug logs can safely be written to stderr without polluting the feedback message to the Agent.
|
|
545
|
+
- **Other exit codes** – Non-blocking errors. Stderr is shown to the user and execution proceeds.
|
|
546
|
+
|
|
547
|
+
#### Exit Code 2 Behavior
|
|
548
|
+
|
|
549
|
+
> **Note:** "message" in the table below refers to the message retrieved from stdout or stderr based on priority (see fallback explanation above).
|
|
550
|
+
|
|
551
|
+
| Event | Effect |
|
|
552
|
+
| --- | --- |
|
|
553
|
+
| PreToolUse | Blocks the tool call and surfaces message to Agent |
|
|
554
|
+
| PostToolUse | Surfaces message to Agent (tool already ran, used for context injection) |
|
|
555
|
+
| Notification | N/A – message shown to the user |
|
|
556
|
+
| UserPromptSubmit | Blocks the prompt, clears it, message shown to user only |
|
|
557
|
+
| Stop | Blocks the stop action, surfaces message to Agent and continues conversation |
|
|
558
|
+
| SubagentStop | Blocks the sub-agent stop, surfaces message to sub-agent and continues execution |
|
|
559
|
+
| PreCompact | Blocks compaction, message shown to user only |
|
|
560
|
+
| SessionStart | N/A – message shown to the user |
|
|
561
|
+
| SessionEnd | N/A – message shown to the user |
|
|
562
|
+
|
|
563
|
+
### Advanced Mode: JSON Output
|
|
564
|
+
|
|
565
|
+
Write structured JSON to stdout for granular control.
|
|
566
|
+
|
|
567
|
+
#### Common JSON Fields
|
|
568
|
+
|
|
569
|
+
```jsonc
|
|
570
|
+
{
|
|
571
|
+
"continue": true, // Whether CodeBuddy proceeds after the hook (default true)
|
|
572
|
+
"stopReason": "string", // Message shown to CodeBuddy when continue is false
|
|
573
|
+
"reason": "string", // Alias for stopReason, both are equivalent
|
|
574
|
+
|
|
575
|
+
"suppressOutput": true, // Hide stdout in transcript mode (default false)
|
|
576
|
+
"systemMessage": "string" // Optional warning shown to user only (not passed to Agent)
|
|
577
|
+
}
|
|
578
|
+
```
|
|
579
|
+
|
|
580
|
+
**Message field notes:**
|
|
581
|
+
- `stopReason` / `reason`: Message passed to CodeBuddy Agent explaining why the operation was blocked
|
|
582
|
+
- `systemMessage`: Warning shown to user only, not passed to Agent
|
|
583
|
+
|
|
584
|
+
#### PreToolUse Decision Control
|
|
585
|
+
|
|
586
|
+
PreToolUse hooks can control whether the tool call proceeds.
|
|
587
|
+
|
|
588
|
+
```jsonc
|
|
589
|
+
{
|
|
590
|
+
"hookSpecificOutput": {
|
|
591
|
+
"hookEventName": "PreToolUse",
|
|
592
|
+
"permissionDecision": "allow" | "deny" | "ask",
|
|
593
|
+
"permissionDecisionReason": "Reason shown in permission dialog",
|
|
594
|
+
"modifiedInput": {
|
|
595
|
+
"field_to_modify": "new value"
|
|
596
|
+
}
|
|
597
|
+
}
|
|
598
|
+
}
|
|
599
|
+
```
|
|
600
|
+
|
|
601
|
+
- `allow` – Skip the built-in permission dialog, execute tool directly
|
|
602
|
+
- `deny` – Block the tool call, `permissionDecisionReason` is passed to Agent
|
|
603
|
+
- `ask` – Force the UI to prompt the user, `permissionDecisionReason` is shown in the confirmation dialog
|
|
604
|
+
- `modifiedInput` – Mutate tool arguments before execution (partial field override)
|
|
605
|
+
|
|
606
|
+
#### PostToolUse Context Injection
|
|
607
|
+
|
|
608
|
+
PostToolUse fires **after** the tool has executed, so it cannot truly "block" the operation. Instead, use it to inject additional context to the Agent.
|
|
609
|
+
|
|
610
|
+
```jsonc
|
|
611
|
+
{
|
|
612
|
+
"hookSpecificOutput": {
|
|
613
|
+
"hookEventName": "PostToolUse",
|
|
614
|
+
"additionalContext": "Additional information for CodeBuddy, e.g., code review results"
|
|
615
|
+
}
|
|
616
|
+
}
|
|
617
|
+
```
|
|
618
|
+
|
|
619
|
+
> **Note:** The `decision: "block"` field is deprecated. Since the tool has already executed, blocking has no effect.
|
|
620
|
+
|
|
621
|
+
#### UserPromptSubmit Decision Control
|
|
622
|
+
|
|
623
|
+
```jsonc
|
|
624
|
+
{
|
|
625
|
+
"continue": false, // Set to false to block prompt processing
|
|
626
|
+
"reason": "Block reason (shown to user only)",
|
|
627
|
+
"hookSpecificOutput": {
|
|
628
|
+
"hookEventName": "UserPromptSubmit",
|
|
629
|
+
"additionalContext": "Additional context injected to CodeBuddy"
|
|
630
|
+
}
|
|
631
|
+
}
|
|
632
|
+
```
|
|
633
|
+
|
|
634
|
+
> **Note:** The `decision: "block"` field is deprecated. Use `continue: false` instead.
|
|
635
|
+
|
|
636
|
+
#### Stop / SubagentStop Decision Control
|
|
637
|
+
|
|
638
|
+
```jsonc
|
|
639
|
+
{
|
|
640
|
+
"continue": false, // Set to false to prevent stopping, Agent continues working
|
|
641
|
+
"reason": "Tell the Agent why it needs to continue working"
|
|
642
|
+
}
|
|
643
|
+
```
|
|
644
|
+
|
|
645
|
+
> **Note:** The `decision: "block"` field is deprecated. Use `continue: false` instead.
|
|
646
|
+
|
|
647
|
+
#### SessionStart Decision Control
|
|
648
|
+
|
|
649
|
+
```jsonc
|
|
650
|
+
{
|
|
651
|
+
"hookSpecificOutput": {
|
|
652
|
+
"hookEventName": "SessionStart",
|
|
653
|
+
"additionalContext": "My additional context here"
|
|
654
|
+
}
|
|
655
|
+
}
|
|
656
|
+
```
|
|
657
|
+
|
|
658
|
+
## Using MCP Tools
|
|
659
|
+
|
|
660
|
+
Hooks integrate seamlessly with MCP (Model Context Protocol) tools.
|
|
661
|
+
|
|
662
|
+
### MCP Tool Naming
|
|
663
|
+
|
|
664
|
+
MCP tool names follow the pattern `mcp__<server>__<tool>`, for example:
|
|
665
|
+
|
|
666
|
+
- `mcp__memory__create_entities` – `create_entities` on the Memory server
|
|
667
|
+
- `mcp__filesystem__read_file` – `read_file` on the Filesystem server
|
|
668
|
+
- `mcp__github__search_repositories` – GitHub search tool
|
|
669
|
+
|
|
670
|
+
### Configuring Hooks for MCP Tools
|
|
671
|
+
|
|
672
|
+
Target an individual tool or an entire MCP server:
|
|
673
|
+
|
|
674
|
+
```json
|
|
675
|
+
{
|
|
676
|
+
"hooks": {
|
|
677
|
+
"PreToolUse": [
|
|
678
|
+
{
|
|
679
|
+
"matcher": "mcp__memory__.*",
|
|
680
|
+
"hooks": [
|
|
681
|
+
{
|
|
682
|
+
"type": "command",
|
|
683
|
+
"command": "echo 'Memory operation initiated' >> ~/mcp-operations.log"
|
|
684
|
+
}
|
|
685
|
+
]
|
|
686
|
+
},
|
|
687
|
+
{
|
|
688
|
+
"matcher": "mcp__.*__write.*",
|
|
689
|
+
"hooks": [
|
|
690
|
+
{
|
|
691
|
+
"type": "command",
|
|
692
|
+
"command": "python3 /home/user/scripts/validate-mcp-write.py"
|
|
693
|
+
}
|
|
694
|
+
]
|
|
695
|
+
}
|
|
696
|
+
]
|
|
697
|
+
}
|
|
698
|
+
}
|
|
699
|
+
```
|
|
700
|
+
|
|
701
|
+
## Security Notes
|
|
702
|
+
|
|
703
|
+
### Disclaimer
|
|
704
|
+
|
|
705
|
+
**Use at your own risk.** Hooks run arbitrary shell commands on your machine. By enabling them you acknowledge:
|
|
706
|
+
|
|
707
|
+
- You are solely responsible for the commands you configure.
|
|
708
|
+
- Hooks can read, modify, or delete anything your user can access.
|
|
709
|
+
- Malicious or buggy hooks can cause data loss or system damage.
|
|
710
|
+
- Tencent Cloud offers no warranty and is not liable for any damages.
|
|
711
|
+
- Always test hooks in a safe environment before rolling them into production.
|
|
712
|
+
|
|
713
|
+
### Best Practices
|
|
714
|
+
|
|
715
|
+
1. **Validate and sanitize input** – Never trust incoming data blindly.
|
|
716
|
+
2. **Quote shell variables** – Use `"$VAR"`, not `$VAR`.
|
|
717
|
+
3. **Prevent path traversal** – Guard against `..` in file paths.
|
|
718
|
+
4. **Use absolute paths** – Especially for scripts (or `"$CODEBUDDY_PROJECT_DIR"`).
|
|
719
|
+
5. **Skip sensitive files** – Avoid touching `.env`, `.git/`, secrets, etc.
|
|
720
|
+
|
|
721
|
+
### Configuration Safety
|
|
722
|
+
|
|
723
|
+
Editing the settings file does **not** hot-load hooks. CodeBuddy Code:
|
|
724
|
+
|
|
725
|
+
1. Captures a snapshot at startup.
|
|
726
|
+
2. Uses that snapshot for the whole session.
|
|
727
|
+
3. Warns if the file changes externally.
|
|
728
|
+
4. Requires review in the `/hooks` panel before changes apply.
|
|
729
|
+
|
|
730
|
+
## Execution Details
|
|
731
|
+
|
|
732
|
+
- **Timeout** – 60 seconds by default; override per hook.
|
|
733
|
+
- **Parallelism** – All matching hooks run in parallel.
|
|
734
|
+
- **Deduplication** – Identical commands are coalesced.
|
|
735
|
+
- **Execution Shell**:
|
|
736
|
+
- **macOS/Linux**: Uses the user's default shell (`$SHELL` environment variable, typically bash or zsh), falls back to `/bin/sh`.
|
|
737
|
+
- **Windows**: **Git Bash is enforced** (cmd.exe and PowerShell are not supported). If Git Bash is not found, an error will prompt you to install [Git for Windows](https://git-scm.com/download/win). The `CODEBUDDY_CODE_GIT_BASH_PATH` environment variable can be used to specify the bash.exe path.
|
|
738
|
+
- The default shell can be overridden via the `CODEBUDDY_CODE_SHELL` environment variable (only POSIX shells are supported: bash, zsh, sh).
|
|
739
|
+
- **Environment** – Runs inside the current working directory with CodeBuddy's environment.
|
|
740
|
+
- `CODEBUDDY_PROJECT_DIR` exposes the absolute project root.
|
|
741
|
+
- **Input** – JSON over stdin.
|
|
742
|
+
- **Output** –
|
|
743
|
+
- PreToolUse / PostToolUse / Stop / SubagentStop: progress visible in transcript mode (Ctrl+R).
|
|
744
|
+
- Notification / SessionEnd: logged only when `--debug` is enabled.
|
|
745
|
+
- UserPromptSubmit / SessionStart: stdout is appended to the conversation context.
|
|
746
|
+
|
|
747
|
+
## Debugging
|
|
748
|
+
|
|
749
|
+
### Basic Troubleshooting
|
|
750
|
+
|
|
751
|
+
If hooks are not firing:
|
|
752
|
+
|
|
753
|
+
1. **Check configuration** – Run `/hooks` to confirm registration.
|
|
754
|
+
2. **Validate JSON** – Ensure the settings file parses.
|
|
755
|
+
3. **Test commands** – Execute the script manually first.
|
|
756
|
+
4. **Verify permissions** – Scripts must be executable.
|
|
757
|
+
5. **Inspect logs** – Launch `codebuddy --debug` for hook traces.
|
|
758
|
+
|
|
759
|
+
**Common mistakes:**
|
|
760
|
+
|
|
761
|
+
- Unescaped quotes – Use `\"` inside JSON strings.
|
|
762
|
+
- Incorrect matcher – Tool names are case-sensitive.
|
|
763
|
+
- Command not found – Provide full paths.
|
|
764
|
+
|
|
765
|
+
### Advanced Debugging
|
|
766
|
+
|
|
767
|
+
For tricky issues:
|
|
768
|
+
|
|
769
|
+
1. **Trace execution** – `codebuddy --debug` shows hook scheduling and output.
|
|
770
|
+
2. **Validate schemas** – Use external tools to simulate hook input/output.
|
|
771
|
+
3. **Check env vars** – Confirm CodeBuddy exposes the expected environment.
|
|
772
|
+
4. **Test edge cases** – Try unusual paths or payloads.
|
|
773
|
+
5. **Monitor resources** – Ensure hooks are not exhausting CPU/RAM.
|
|
774
|
+
6. **Emit structured logs** – Add logging inside your scripts.
|
|
775
|
+
|
|
776
|
+
### Debug Output Example
|
|
777
|
+
|
|
778
|
+
**Note: This feature is not yet supported.**
|
|
779
|
+
|
|
780
|
+
`codebuddy --debug` prints hook execution like:
|
|
781
|
+
|
|
782
|
+
```text
|
|
783
|
+
[DEBUG] Executing hooks for PostToolUse:Write
|
|
784
|
+
[DEBUG] Getting matching hook commands for PostToolUse with query: Write
|
|
785
|
+
[DEBUG] Found 1 hook matchers in settings
|
|
786
|
+
[DEBUG] Matched 1 hooks for query "Write"
|
|
787
|
+
[DEBUG] Found 1 hook commands to execute
|
|
788
|
+
[DEBUG] Executing hook command: <Your command> with timeout 60000ms
|
|
789
|
+
[DEBUG] Hook command completed with status 0: <Your stdout>
|
|
790
|
+
```
|
|
791
|
+
|
|
792
|
+
Progress messages appear in transcript mode (Ctrl+R), showing:
|
|
793
|
+
|
|
794
|
+
- Which hook is running
|
|
795
|
+
- The command being executed
|
|
796
|
+
- Success/failure status
|
|
797
|
+
- Output or error messages
|
|
798
|
+
|
|
799
|
+
---
|
|
800
|
+
|
|
801
|
+
With this guide you should have a complete understanding of how hooks work inside CodeBuddy Code and how to configure them safely. For a hands-on walkthrough, continue with the [Hooks Getting Started Guide](./hooks-guide.md).
|