@tencent-ai/agent-sdk 0.3.99 → 0.3.100
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 +26 -0
- package/cli/dist/codebuddy-headless.js +53 -53
- package/cli/dist/web-ui/assets/index-BoMlEqUE.js +439 -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 +199 -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.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 +357 -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 +1011 -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 +526 -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 +193 -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.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 +797 -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 +770 -0
- package/cli/dist/web-ui/docs/en/cli/sdk.md +1103 -0
- package/cli/dist/web-ui/docs/en/cli/security.md +388 -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 +3 -3
- package/cli/product.selfhosted.json +2 -2
- 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,770 @@
|
|
|
1
|
+
# TypeScript SDK Reference
|
|
2
|
+
|
|
3
|
+
> **Version Requirements**: This documentation is for CodeBuddy Agent SDK v0.1.0 and above.
|
|
4
|
+
|
|
5
|
+
This document provides a complete API reference for the TypeScript SDK. For quick start and usage examples, please refer to [SDK Overview](sdk.md).
|
|
6
|
+
|
|
7
|
+
## Table of Contents
|
|
8
|
+
|
|
9
|
+
- [Requirements](#requirements)
|
|
10
|
+
- [Installation](#installation)
|
|
11
|
+
- [Functions](#functions)
|
|
12
|
+
- [Unstable V2 API](#unstable-v2-api)
|
|
13
|
+
- [Types](#types)
|
|
14
|
+
- [Message Types](#message-types)
|
|
15
|
+
- [Input Types](#input-types)
|
|
16
|
+
- [Related Documentation](#related-documentation)
|
|
17
|
+
|
|
18
|
+
## Requirements
|
|
19
|
+
|
|
20
|
+
| Dependency | Version Requirement |
|
|
21
|
+
|------|---------|
|
|
22
|
+
| Node.js | >= 18.0.0 |
|
|
23
|
+
| TypeScript | >= 5.0.0 (Recommended) |
|
|
24
|
+
|
|
25
|
+
**Runtime Support**:
|
|
26
|
+
- Node.js (Recommended)
|
|
27
|
+
- Bun
|
|
28
|
+
- Deno
|
|
29
|
+
|
|
30
|
+
## Installation
|
|
31
|
+
|
|
32
|
+
```bash
|
|
33
|
+
npm install @tencent-ai/agent-sdk
|
|
34
|
+
```
|
|
35
|
+
|
|
36
|
+
Or use other package managers:
|
|
37
|
+
|
|
38
|
+
```bash
|
|
39
|
+
yarn add @tencent-ai/agent-sdk
|
|
40
|
+
pnpm add @tencent-ai/agent-sdk
|
|
41
|
+
```
|
|
42
|
+
|
|
43
|
+
### Environment Variables
|
|
44
|
+
|
|
45
|
+
| Variable Name | Description | Required |
|
|
46
|
+
|--------|------|------|
|
|
47
|
+
| `CODEBUDDY_CODE_PATH` | CodeBuddy CLI executable path | Optional |
|
|
48
|
+
|
|
49
|
+
### Authentication Configuration
|
|
50
|
+
|
|
51
|
+
The SDK supports authentication using existing login credentials, API Key, or OAuth Client Credentials. See [SDK Overview - Authentication Configuration](sdk.md#authentication-configuration) for details.
|
|
52
|
+
|
|
53
|
+
## Functions
|
|
54
|
+
|
|
55
|
+
### query()
|
|
56
|
+
|
|
57
|
+
Main API entry point that creates a query and returns a message stream.
|
|
58
|
+
|
|
59
|
+
```typescript
|
|
60
|
+
function query(params: {
|
|
61
|
+
prompt: string | AsyncIterable<UserMessage>;
|
|
62
|
+
options?: Options;
|
|
63
|
+
}): Query;
|
|
64
|
+
```
|
|
65
|
+
|
|
66
|
+
**Parameters**:
|
|
67
|
+
|
|
68
|
+
| Parameter | Type | Description |
|
|
69
|
+
|------|------|------|
|
|
70
|
+
| `prompt` | `string \| AsyncIterable<UserMessage>` | Query prompt or user message stream |
|
|
71
|
+
| `options` | `Options` | Configuration options (optional) |
|
|
72
|
+
|
|
73
|
+
**Return Value**: `Query` - Interface that extends `AsyncGenerator<Message, void>`
|
|
74
|
+
|
|
75
|
+
### Query Interface
|
|
76
|
+
|
|
77
|
+
```typescript
|
|
78
|
+
interface Query extends AsyncGenerator<Message, void> {
|
|
79
|
+
// Interrupt current execution
|
|
80
|
+
interrupt(): Promise<void>;
|
|
81
|
+
|
|
82
|
+
// Dynamically modify permission mode
|
|
83
|
+
setPermissionMode(mode: PermissionMode): Promise<void>;
|
|
84
|
+
|
|
85
|
+
// Dynamically modify model
|
|
86
|
+
setModel(model?: string): Promise<void>;
|
|
87
|
+
|
|
88
|
+
// Set maximum thinking tokens
|
|
89
|
+
setMaxThinkingTokens(tokens: number | null): Promise<void>;
|
|
90
|
+
|
|
91
|
+
// Get available permission modes list
|
|
92
|
+
getAvailableModes(): Promise<ModeInfo[]>;
|
|
93
|
+
|
|
94
|
+
// Get available models list
|
|
95
|
+
getAvailableModels(): Promise<ModelInfo[]>;
|
|
96
|
+
|
|
97
|
+
// Get supported slash commands
|
|
98
|
+
supportedCommands(): Promise<SlashCommand[]>;
|
|
99
|
+
|
|
100
|
+
// Get supported models list
|
|
101
|
+
supportedModels(): Promise<ModelInfo[]>;
|
|
102
|
+
|
|
103
|
+
// Get MCP server status
|
|
104
|
+
mcpServerStatus(): Promise<McpServerStatus[]>;
|
|
105
|
+
|
|
106
|
+
// Get account information
|
|
107
|
+
accountInfo(): Promise<AccountInfo>;
|
|
108
|
+
|
|
109
|
+
// Stream input user messages
|
|
110
|
+
streamInput(stream: AsyncIterable<UserMessage>): Promise<void>;
|
|
111
|
+
}
|
|
112
|
+
```
|
|
113
|
+
|
|
114
|
+
### Constants
|
|
115
|
+
|
|
116
|
+
```typescript
|
|
117
|
+
// All supported Hook events
|
|
118
|
+
const HOOK_EVENTS: readonly [
|
|
119
|
+
'PreToolUse',
|
|
120
|
+
'PostToolUse',
|
|
121
|
+
'PostToolUseFailure',
|
|
122
|
+
'Notification',
|
|
123
|
+
'UserPromptSubmit',
|
|
124
|
+
'SessionStart',
|
|
125
|
+
'SessionEnd',
|
|
126
|
+
'Stop',
|
|
127
|
+
'SubagentStart',
|
|
128
|
+
'SubagentStop',
|
|
129
|
+
'PreCompact',
|
|
130
|
+
'PermissionRequest',
|
|
131
|
+
'WorktreeCreate',
|
|
132
|
+
'WorktreeRemove'
|
|
133
|
+
];
|
|
134
|
+
|
|
135
|
+
// All exit reasons
|
|
136
|
+
const EXIT_REASONS: readonly [
|
|
137
|
+
'user_cancelled',
|
|
138
|
+
'tool_error',
|
|
139
|
+
'max_turns',
|
|
140
|
+
'max_budget_usd',
|
|
141
|
+
'completed',
|
|
142
|
+
'interrupted',
|
|
143
|
+
'hook_blocked'
|
|
144
|
+
];
|
|
145
|
+
```
|
|
146
|
+
|
|
147
|
+
### Errors
|
|
148
|
+
|
|
149
|
+
```typescript
|
|
150
|
+
class AbortError extends Error {
|
|
151
|
+
// Thrown when operation is aborted
|
|
152
|
+
}
|
|
153
|
+
```
|
|
154
|
+
|
|
155
|
+
## Unstable V2 API
|
|
156
|
+
|
|
157
|
+
> **Warning**: The following APIs are experimental and may change in future versions.
|
|
158
|
+
|
|
159
|
+
### unstable_v2_createSession()
|
|
160
|
+
|
|
161
|
+
Create a new interactive session.
|
|
162
|
+
|
|
163
|
+
```typescript
|
|
164
|
+
function unstable_v2_createSession(options: SessionOptions): Session;
|
|
165
|
+
```
|
|
166
|
+
|
|
167
|
+
### unstable_v2_resumeSession()
|
|
168
|
+
|
|
169
|
+
Resume an existing session.
|
|
170
|
+
|
|
171
|
+
```typescript
|
|
172
|
+
function unstable_v2_resumeSession(
|
|
173
|
+
sessionId: string,
|
|
174
|
+
options: SessionOptions
|
|
175
|
+
): Session;
|
|
176
|
+
```
|
|
177
|
+
|
|
178
|
+
### unstable_v2_prompt()
|
|
179
|
+
|
|
180
|
+
Convenience function for single query.
|
|
181
|
+
|
|
182
|
+
```typescript
|
|
183
|
+
function unstable_v2_prompt(
|
|
184
|
+
message: string,
|
|
185
|
+
options: SessionOptions
|
|
186
|
+
): Promise<Message[]>;
|
|
187
|
+
```
|
|
188
|
+
|
|
189
|
+
### unstable_v2_authenticate()
|
|
190
|
+
|
|
191
|
+
Initiate an interactive login flow with support for multi-environment authentication (international, China, etc.).
|
|
192
|
+
|
|
193
|
+
```typescript
|
|
194
|
+
function unstable_v2_authenticate(options: AuthenticateOptions): Promise<AuthenticateResponse>;
|
|
195
|
+
```
|
|
196
|
+
|
|
197
|
+
**Parameters**:
|
|
198
|
+
|
|
199
|
+
| Field | Type | Description |
|
|
200
|
+
|------|------|------|
|
|
201
|
+
| `onAuthUrl` | `(authState: AuthState) => Promise<void>` | Authentication URL callback, used to open a browser or display the link |
|
|
202
|
+
| `environment` | `'external' \| 'internal' \| 'ioa' \| 'cloudhosted'` | Predefined environment (mutually exclusive with endpoint) |
|
|
203
|
+
| `endpoint` | `string` | Custom endpoint URL (for selfhosted, mutually exclusive with environment) |
|
|
204
|
+
| `methodId` | `string` | Authentication method ID, default `'external'` |
|
|
205
|
+
| `timeout` | `number` | Timeout in milliseconds, default 300000 |
|
|
206
|
+
| `pathToCodebuddyCode` | `string` | CLI executable path (optional) |
|
|
207
|
+
| `env` | `Record<string, string>` | Environment variables (optional) |
|
|
208
|
+
|
|
209
|
+
**Returns**: `Promise<AuthenticateResponse>`
|
|
210
|
+
|
|
211
|
+
- `userinfo` - User info object containing userId, userName, userNickname, token, and other fields
|
|
212
|
+
|
|
213
|
+
**Example**:
|
|
214
|
+
|
|
215
|
+
```typescript
|
|
216
|
+
import { unstable_v2_authenticate } from '@tencent-ai/agent-sdk';
|
|
217
|
+
import open from 'open';
|
|
218
|
+
|
|
219
|
+
// International login
|
|
220
|
+
const result = await unstable_v2_authenticate({
|
|
221
|
+
environment: 'external',
|
|
222
|
+
onAuthUrl: async (authState) => {
|
|
223
|
+
console.log('Please login:', authState.authUrl);
|
|
224
|
+
await open(authState.authUrl);
|
|
225
|
+
}
|
|
226
|
+
});
|
|
227
|
+
|
|
228
|
+
console.log('Login successful:', result.userinfo.userName);
|
|
229
|
+
|
|
230
|
+
// Self-hosted login
|
|
231
|
+
const result2 = await unstable_v2_authenticate({
|
|
232
|
+
endpoint: 'https://your-company.com',
|
|
233
|
+
onAuthUrl: async (authState) => {
|
|
234
|
+
console.log('Please login:', authState.authUrl);
|
|
235
|
+
await open(authState.authUrl);
|
|
236
|
+
}
|
|
237
|
+
});
|
|
238
|
+
```
|
|
239
|
+
|
|
240
|
+
**Behavior**:
|
|
241
|
+
|
|
242
|
+
- If a valid token already exists, returns user info directly without triggering the login flow
|
|
243
|
+
- Otherwise, notifies the user to open the login link via the `onAuthUrl` callback
|
|
244
|
+
- After successful login, the token is cached and automatically reused on the next call
|
|
245
|
+
|
|
246
|
+
### unstable_v2_logout()
|
|
247
|
+
|
|
248
|
+
Log out and clear the cached authentication token. The next call to `authenticate()` will trigger a fresh login.
|
|
249
|
+
|
|
250
|
+
```typescript
|
|
251
|
+
function unstable_v2_logout(options?: LogoutOptions): Promise<void>;
|
|
252
|
+
```
|
|
253
|
+
|
|
254
|
+
**Parameters**:
|
|
255
|
+
|
|
256
|
+
| Field | Type | Description |
|
|
257
|
+
|------|------|------|
|
|
258
|
+
| `environment` | `'external' \| 'internal' \| 'ioa' \| 'cloudhosted'` | Predefined environment (mutually exclusive with endpoint) |
|
|
259
|
+
| `endpoint` | `string` | Custom endpoint URL (mutually exclusive with environment) |
|
|
260
|
+
| `pathToCodebuddyCode` | `string` | CLI executable path (optional) |
|
|
261
|
+
| `env` | `Record<string, string>` | Environment variables (optional) |
|
|
262
|
+
|
|
263
|
+
**Example**:
|
|
264
|
+
|
|
265
|
+
```typescript
|
|
266
|
+
import { unstable_v2_authenticate, unstable_v2_logout } from '@tencent-ai/agent-sdk';
|
|
267
|
+
|
|
268
|
+
// Login
|
|
269
|
+
const result = await unstable_v2_authenticate({
|
|
270
|
+
environment: 'external',
|
|
271
|
+
onAuthUrl: (authState) => console.log('Login:', authState.authUrl),
|
|
272
|
+
});
|
|
273
|
+
|
|
274
|
+
// Logout
|
|
275
|
+
await unstable_v2_logout({ environment: 'external' });
|
|
276
|
+
|
|
277
|
+
// Re-login with a different user
|
|
278
|
+
const newUser = await unstable_v2_authenticate({
|
|
279
|
+
environment: 'external',
|
|
280
|
+
onAuthUrl: (authState) => console.log('Login:', authState.authUrl),
|
|
281
|
+
});
|
|
282
|
+
```
|
|
283
|
+
|
|
284
|
+
### Session Interface
|
|
285
|
+
|
|
286
|
+
```typescript
|
|
287
|
+
interface Session {
|
|
288
|
+
// Session ID (available after initialization)
|
|
289
|
+
readonly sessionId: string;
|
|
290
|
+
|
|
291
|
+
// Send message
|
|
292
|
+
send(message: string | UserMessage): Promise<void>;
|
|
293
|
+
|
|
294
|
+
// Get response stream
|
|
295
|
+
stream(): AsyncGenerator<Message, void>;
|
|
296
|
+
|
|
297
|
+
// Close session
|
|
298
|
+
close(): void;
|
|
299
|
+
|
|
300
|
+
// Async disposal
|
|
301
|
+
[Symbol.asyncDispose](): Promise<void>;
|
|
302
|
+
}
|
|
303
|
+
```
|
|
304
|
+
|
|
305
|
+
### SessionOptions
|
|
306
|
+
|
|
307
|
+
```typescript
|
|
308
|
+
type SessionOptions = {
|
|
309
|
+
model: string;
|
|
310
|
+
pathToCodebuddyCode?: string;
|
|
311
|
+
executable?: 'node' | 'bun';
|
|
312
|
+
executableArgs?: string[];
|
|
313
|
+
env?: Record<string, string | undefined>;
|
|
314
|
+
canUseTool?: CanUseTool;
|
|
315
|
+
};
|
|
316
|
+
```
|
|
317
|
+
|
|
318
|
+
## Types
|
|
319
|
+
|
|
320
|
+
### Options
|
|
321
|
+
|
|
322
|
+
Complete configuration options:
|
|
323
|
+
|
|
324
|
+
| Field | Type | Description |
|
|
325
|
+
|------|------|------|
|
|
326
|
+
| `abortController` | `AbortController` | Used to cancel requests |
|
|
327
|
+
| `executable` | `'bun' \| 'deno' \| 'node'` | Runtime |
|
|
328
|
+
| `executableArgs` | `string[]` | Runtime arguments |
|
|
329
|
+
| `pathToCodebuddyCode` | `string` | CLI path |
|
|
330
|
+
| `cwd` | `string` | Working directory |
|
|
331
|
+
| `additionalDirectories` | `string[]` | Additional directories |
|
|
332
|
+
| `env` | `Record<string, string \| undefined>` | Environment variables |
|
|
333
|
+
| `model` | `string` | Specify model |
|
|
334
|
+
| `fallbackModel` | `string` | Fallback model |
|
|
335
|
+
| `maxThinkingTokens` | `number` | Maximum thinking tokens (deprecated, use `thinking` instead) |
|
|
336
|
+
| `thinking` | `ThinkingConfig` | Thinking mode configuration: `{ type: 'adaptive' }`, `{ type: 'enabled', budgetTokens: N }`, or `{ type: 'disabled' }` |
|
|
337
|
+
| `effort` | `'low' \| 'medium' \| 'high' \| 'xhigh'` | Model reasoning effort level |
|
|
338
|
+
| `allowedTools` | `string[]` | Allowed tools whitelist |
|
|
339
|
+
| `disallowedTools` | `string[]` | Disallowed tools blacklist |
|
|
340
|
+
| `canUseTool` | `CanUseTool` | Permission callback function |
|
|
341
|
+
| `permissionMode` | `PermissionMode` | Permission mode |
|
|
342
|
+
| `allowDangerouslySkipPermissions` | `boolean` | Allow skipping permissions |
|
|
343
|
+
| `permissionPromptToolName` | `string` | Permission prompt tool name |
|
|
344
|
+
| `continue` | `boolean` | Continue recent session |
|
|
345
|
+
| `resume` | `string` | Session ID to resume |
|
|
346
|
+
| `resumeSessionAt` | `string` | Resume at specific message position |
|
|
347
|
+
| `persistSession` | `boolean` | Persist session |
|
|
348
|
+
| `forkSession` | `boolean` | Fork session |
|
|
349
|
+
| `agents` | `Record<string, AgentDefinition>` | Custom agents |
|
|
350
|
+
| `hooks` | `Partial<Record<HookEvent, HookCallbackMatcher[]>>` | Hook configuration |
|
|
351
|
+
| `outputFormat` | `OutputFormat` | Output format |
|
|
352
|
+
| `systemPrompt` | `string \| { append: string }` | System prompt |
|
|
353
|
+
| `includePartialMessages` | `boolean` | Include partial messages |
|
|
354
|
+
| `maxTurns` | `number` | Maximum conversation turns |
|
|
355
|
+
| `mcpServers` | `Record<string, McpServerConfig>` | MCP server configuration |
|
|
356
|
+
| `strictMcpConfig` | `boolean` | Strict MCP configuration |
|
|
357
|
+
| `sandbox` | `SandboxSettings` | Sandbox settings |
|
|
358
|
+
| `settingSources` | `SettingSource[]` | Setting sources, controls which filesystem configurations are loaded. Default: no configurations are loaded |
|
|
359
|
+
|
|
360
|
+
### SettingSource
|
|
361
|
+
|
|
362
|
+
Controls which filesystem locations the SDK loads configurations from.
|
|
363
|
+
|
|
364
|
+
```typescript
|
|
365
|
+
type SettingSource = 'user' | 'project' | 'local';
|
|
366
|
+
```
|
|
367
|
+
|
|
368
|
+
| Value | Description | Location |
|
|
369
|
+
|-----|------|------|
|
|
370
|
+
| `'user'` | Global user settings | `~/.codebuddy/settings.json` |
|
|
371
|
+
| `'project'` | Project shared settings | `.codebuddy/settings.json` |
|
|
372
|
+
| `'local'` | Project local settings | `.codebuddy/settings.local.json` |
|
|
373
|
+
|
|
374
|
+
**Default Behavior**: When `settingSources` is not specified, the SDK **does not load any filesystem configurations**. This provides a completely clean runtime environment.
|
|
375
|
+
|
|
376
|
+
```typescript
|
|
377
|
+
// Default: no configurations loaded (clean environment)
|
|
378
|
+
const q = query({ prompt: '...' });
|
|
379
|
+
|
|
380
|
+
// Load project configuration
|
|
381
|
+
const q = query({
|
|
382
|
+
prompt: '...',
|
|
383
|
+
options: { settingSources: ['project'] }
|
|
384
|
+
});
|
|
385
|
+
|
|
386
|
+
// Load all configurations (similar to CLI behavior)
|
|
387
|
+
const q = query({
|
|
388
|
+
prompt: '...',
|
|
389
|
+
options: { settingSources: ['user', 'project', 'local'] }
|
|
390
|
+
});
|
|
391
|
+
```
|
|
392
|
+
|
|
393
|
+
### PermissionMode
|
|
394
|
+
|
|
395
|
+
```typescript
|
|
396
|
+
type PermissionMode =
|
|
397
|
+
| 'default' // Default mode, all operations require confirmation
|
|
398
|
+
| 'acceptEdits' // Automatically approve file edits
|
|
399
|
+
| 'bypassPermissions' // Skip all permission checks
|
|
400
|
+
| 'plan' // Plan mode, read-only operations allowed
|
|
401
|
+
```
|
|
402
|
+
|
|
403
|
+
### PermissionResult
|
|
404
|
+
|
|
405
|
+
```typescript
|
|
406
|
+
type PermissionResult =
|
|
407
|
+
| {
|
|
408
|
+
behavior: 'allow';
|
|
409
|
+
updatedInput: Record<string, unknown>;
|
|
410
|
+
updatedPermissions?: PermissionUpdate[];
|
|
411
|
+
toolUseID?: string;
|
|
412
|
+
}
|
|
413
|
+
| {
|
|
414
|
+
behavior: 'deny';
|
|
415
|
+
message: string;
|
|
416
|
+
interrupt?: boolean;
|
|
417
|
+
toolUseID?: string;
|
|
418
|
+
};
|
|
419
|
+
```
|
|
420
|
+
|
|
421
|
+
### CanUseTool
|
|
422
|
+
|
|
423
|
+
```typescript
|
|
424
|
+
type CanUseTool = (
|
|
425
|
+
toolName: string,
|
|
426
|
+
input: Record<string, unknown>,
|
|
427
|
+
options: CanUseToolOptions
|
|
428
|
+
) => Promise<PermissionResult>;
|
|
429
|
+
|
|
430
|
+
type CanUseToolOptions = {
|
|
431
|
+
signal: AbortSignal;
|
|
432
|
+
suggestions?: PermissionUpdate[];
|
|
433
|
+
blockedPath?: string;
|
|
434
|
+
decisionReason?: string;
|
|
435
|
+
toolUseID: string;
|
|
436
|
+
agentID?: string;
|
|
437
|
+
};
|
|
438
|
+
```
|
|
439
|
+
|
|
440
|
+
### AgentDefinition
|
|
441
|
+
|
|
442
|
+
```typescript
|
|
443
|
+
type AgentDefinition = {
|
|
444
|
+
description: string; // Agent description
|
|
445
|
+
prompt: string; // System prompt
|
|
446
|
+
tools?: string[]; // Allowed tools
|
|
447
|
+
disallowedTools?: string[]; // Disallowed tools
|
|
448
|
+
model?: string; // Model to use
|
|
449
|
+
};
|
|
450
|
+
```
|
|
451
|
+
|
|
452
|
+
### ModeInfo
|
|
453
|
+
|
|
454
|
+
```typescript
|
|
455
|
+
interface ModeInfo {
|
|
456
|
+
id: string; // Mode ID
|
|
457
|
+
name: string; // Display name
|
|
458
|
+
description: string; // Mode description
|
|
459
|
+
}
|
|
460
|
+
```
|
|
461
|
+
|
|
462
|
+
### ModelInfo
|
|
463
|
+
|
|
464
|
+
```typescript
|
|
465
|
+
interface ModelInfo {
|
|
466
|
+
modelId: string; // Model ID
|
|
467
|
+
name: string; // Display name
|
|
468
|
+
description?: string; // Model description
|
|
469
|
+
}
|
|
470
|
+
```
|
|
471
|
+
|
|
472
|
+
### McpServerConfig
|
|
473
|
+
|
|
474
|
+
```typescript
|
|
475
|
+
// Stdio type
|
|
476
|
+
type McpStdioServerConfig = {
|
|
477
|
+
type?: 'stdio';
|
|
478
|
+
command: string;
|
|
479
|
+
args?: string[];
|
|
480
|
+
env?: Record<string, string>;
|
|
481
|
+
};
|
|
482
|
+
|
|
483
|
+
// SSE type
|
|
484
|
+
type McpSSEServerConfig = {
|
|
485
|
+
type: 'sse';
|
|
486
|
+
url: string;
|
|
487
|
+
headers?: Record<string, string>;
|
|
488
|
+
};
|
|
489
|
+
|
|
490
|
+
// HTTP type
|
|
491
|
+
type McpHttpServerConfig = {
|
|
492
|
+
type: 'http';
|
|
493
|
+
url: string;
|
|
494
|
+
headers?: Record<string, string>;
|
|
495
|
+
};
|
|
496
|
+
|
|
497
|
+
type McpServerConfig =
|
|
498
|
+
| McpStdioServerConfig
|
|
499
|
+
| McpSSEServerConfig
|
|
500
|
+
| McpHttpServerConfig;
|
|
501
|
+
```
|
|
502
|
+
|
|
503
|
+
### HookEvent
|
|
504
|
+
|
|
505
|
+
```typescript
|
|
506
|
+
type HookEvent =
|
|
507
|
+
| 'PreToolUse'
|
|
508
|
+
| 'PostToolUse'
|
|
509
|
+
| 'PostToolUseFailure'
|
|
510
|
+
| 'Notification'
|
|
511
|
+
| 'UserPromptSubmit'
|
|
512
|
+
| 'SessionStart'
|
|
513
|
+
| 'SessionEnd'
|
|
514
|
+
| 'Stop'
|
|
515
|
+
| 'SubagentStart'
|
|
516
|
+
| 'SubagentStop'
|
|
517
|
+
| 'PreCompact'
|
|
518
|
+
| 'PermissionRequest'
|
|
519
|
+
| 'WorktreeCreate'
|
|
520
|
+
| 'WorktreeRemove';
|
|
521
|
+
```
|
|
522
|
+
|
|
523
|
+
### HookCallback
|
|
524
|
+
|
|
525
|
+
```typescript
|
|
526
|
+
type HookCallback = (
|
|
527
|
+
input: HookInput,
|
|
528
|
+
toolUseID: string | undefined,
|
|
529
|
+
options: { signal: AbortSignal }
|
|
530
|
+
) => Promise<HookJSONOutput>;
|
|
531
|
+
|
|
532
|
+
interface HookCallbackMatcher {
|
|
533
|
+
matcher?: string; // Match pattern (supports regex)
|
|
534
|
+
hooks: HookCallback[]; // Callback function list
|
|
535
|
+
timeout?: number; // Timeout (milliseconds)
|
|
536
|
+
}
|
|
537
|
+
```
|
|
538
|
+
|
|
539
|
+
### HookJSONOutput
|
|
540
|
+
|
|
541
|
+
```typescript
|
|
542
|
+
// Sync output
|
|
543
|
+
type SyncHookJSONOutput = {
|
|
544
|
+
continue?: boolean;
|
|
545
|
+
suppressOutput?: boolean;
|
|
546
|
+
stopReason?: string;
|
|
547
|
+
decision?: 'approve' | 'block';
|
|
548
|
+
systemMessage?: string;
|
|
549
|
+
reason?: string;
|
|
550
|
+
hookSpecificOutput?: Record<string, unknown>;
|
|
551
|
+
};
|
|
552
|
+
|
|
553
|
+
// Async output
|
|
554
|
+
type AsyncHookJSONOutput = {
|
|
555
|
+
async: true;
|
|
556
|
+
asyncTimeout?: number;
|
|
557
|
+
};
|
|
558
|
+
|
|
559
|
+
type HookJSONOutput = SyncHookJSONOutput | AsyncHookJSONOutput;
|
|
560
|
+
```
|
|
561
|
+
|
|
562
|
+
## Message Types
|
|
563
|
+
|
|
564
|
+
### Message
|
|
565
|
+
|
|
566
|
+
Union of all message types:
|
|
567
|
+
|
|
568
|
+
```typescript
|
|
569
|
+
type Message =
|
|
570
|
+
| SystemMessage
|
|
571
|
+
| UserMessage
|
|
572
|
+
| AssistantMessage
|
|
573
|
+
| PartialAssistantMessage
|
|
574
|
+
| ResultMessage
|
|
575
|
+
| CompactBoundaryMessage
|
|
576
|
+
| StatusMessage
|
|
577
|
+
| ToolProgressMessage;
|
|
578
|
+
```
|
|
579
|
+
|
|
580
|
+
### SystemMessage
|
|
581
|
+
|
|
582
|
+
```typescript
|
|
583
|
+
type SystemMessage = {
|
|
584
|
+
type: 'system';
|
|
585
|
+
subtype: 'init';
|
|
586
|
+
uuid: string;
|
|
587
|
+
session_id: string;
|
|
588
|
+
apiKeySource?: string;
|
|
589
|
+
cwd?: string;
|
|
590
|
+
tools: string[];
|
|
591
|
+
mcp_servers?: Array<{ name: string; status: string }>;
|
|
592
|
+
model: string;
|
|
593
|
+
permissionMode: PermissionMode;
|
|
594
|
+
slash_commands?: string[];
|
|
595
|
+
codebuddy_code_version?: string;
|
|
596
|
+
skills?: string[];
|
|
597
|
+
plugins?: Array<{ name: string; path: string }>;
|
|
598
|
+
};
|
|
599
|
+
```
|
|
600
|
+
|
|
601
|
+
### UserMessage
|
|
602
|
+
|
|
603
|
+
```typescript
|
|
604
|
+
type UserMessage = {
|
|
605
|
+
type: 'user';
|
|
606
|
+
uuid?: string;
|
|
607
|
+
session_id: string;
|
|
608
|
+
message: {
|
|
609
|
+
role: 'user';
|
|
610
|
+
content: string | ContentBlock[];
|
|
611
|
+
};
|
|
612
|
+
parent_tool_use_id: string | null;
|
|
613
|
+
isSynthetic?: boolean;
|
|
614
|
+
tool_use_result?: unknown;
|
|
615
|
+
};
|
|
616
|
+
```
|
|
617
|
+
|
|
618
|
+
### AssistantMessage
|
|
619
|
+
|
|
620
|
+
```typescript
|
|
621
|
+
type AssistantMessage = {
|
|
622
|
+
type: 'assistant';
|
|
623
|
+
uuid: string;
|
|
624
|
+
session_id: string;
|
|
625
|
+
message: {
|
|
626
|
+
id: string;
|
|
627
|
+
type: 'message';
|
|
628
|
+
role: 'assistant';
|
|
629
|
+
model: string;
|
|
630
|
+
content: ContentBlock[];
|
|
631
|
+
stop_reason: StopReason | null;
|
|
632
|
+
stop_sequence: string | null;
|
|
633
|
+
usage: Usage;
|
|
634
|
+
};
|
|
635
|
+
parent_tool_use_id: string | null;
|
|
636
|
+
error?: string;
|
|
637
|
+
};
|
|
638
|
+
```
|
|
639
|
+
|
|
640
|
+
### ResultMessage
|
|
641
|
+
|
|
642
|
+
```typescript
|
|
643
|
+
type ResultMessage =
|
|
644
|
+
| {
|
|
645
|
+
type: 'result';
|
|
646
|
+
subtype: 'success';
|
|
647
|
+
uuid: string;
|
|
648
|
+
session_id: string;
|
|
649
|
+
duration_ms: number;
|
|
650
|
+
duration_api_ms: number;
|
|
651
|
+
is_error: boolean;
|
|
652
|
+
num_turns: number;
|
|
653
|
+
result: string;
|
|
654
|
+
total_cost_usd: number;
|
|
655
|
+
usage: Usage;
|
|
656
|
+
permission_denials: PermissionDenial[];
|
|
657
|
+
structured_output?: unknown;
|
|
658
|
+
}
|
|
659
|
+
| {
|
|
660
|
+
type: 'result';
|
|
661
|
+
subtype: 'error_during_execution' | 'error_max_turns' | 'error_max_budget_usd';
|
|
662
|
+
uuid: string;
|
|
663
|
+
session_id: string;
|
|
664
|
+
duration_ms: number;
|
|
665
|
+
duration_api_ms: number;
|
|
666
|
+
is_error: boolean;
|
|
667
|
+
num_turns: number;
|
|
668
|
+
total_cost_usd: number;
|
|
669
|
+
usage: Usage;
|
|
670
|
+
permission_denials: PermissionDenial[];
|
|
671
|
+
errors?: string[];
|
|
672
|
+
};
|
|
673
|
+
```
|
|
674
|
+
|
|
675
|
+
### ContentBlock
|
|
676
|
+
|
|
677
|
+
```typescript
|
|
678
|
+
// Text content block
|
|
679
|
+
interface TextContentBlock {
|
|
680
|
+
type: 'text';
|
|
681
|
+
text: string;
|
|
682
|
+
}
|
|
683
|
+
|
|
684
|
+
// Tool use block
|
|
685
|
+
interface ToolUseContentBlock {
|
|
686
|
+
type: 'tool_use';
|
|
687
|
+
id: string;
|
|
688
|
+
name: string;
|
|
689
|
+
input: Record<string, unknown>;
|
|
690
|
+
}
|
|
691
|
+
|
|
692
|
+
// Tool result block
|
|
693
|
+
interface ToolResultContentBlock {
|
|
694
|
+
type: 'tool_result';
|
|
695
|
+
tool_use_id: string;
|
|
696
|
+
content?: string | ContentBlock[];
|
|
697
|
+
is_error?: boolean;
|
|
698
|
+
}
|
|
699
|
+
|
|
700
|
+
type ContentBlock =
|
|
701
|
+
| TextContentBlock
|
|
702
|
+
| ToolUseContentBlock
|
|
703
|
+
| ToolResultContentBlock;
|
|
704
|
+
```
|
|
705
|
+
|
|
706
|
+
### Usage
|
|
707
|
+
|
|
708
|
+
```typescript
|
|
709
|
+
interface Usage {
|
|
710
|
+
input_tokens: number;
|
|
711
|
+
output_tokens: number;
|
|
712
|
+
cache_read_input_tokens?: number | null;
|
|
713
|
+
cache_creation_input_tokens?: number | null;
|
|
714
|
+
}
|
|
715
|
+
```
|
|
716
|
+
|
|
717
|
+
## Input Types
|
|
718
|
+
|
|
719
|
+
### AskUserQuestionInput
|
|
720
|
+
|
|
721
|
+
```typescript
|
|
722
|
+
interface AskUserQuestionInput {
|
|
723
|
+
// List of questions to ask (1-4 questions)
|
|
724
|
+
questions: AskUserQuestionQuestion[];
|
|
725
|
+
// User answers (collected by permission component)
|
|
726
|
+
answers?: Record<string, string>;
|
|
727
|
+
}
|
|
728
|
+
```
|
|
729
|
+
|
|
730
|
+
### AskUserQuestionQuestion
|
|
731
|
+
|
|
732
|
+
```typescript
|
|
733
|
+
interface AskUserQuestionQuestion {
|
|
734
|
+
// Complete question text (should end with ?)
|
|
735
|
+
question: string;
|
|
736
|
+
// Short label (max 12 characters)
|
|
737
|
+
header: string;
|
|
738
|
+
// Available options (2-4 options)
|
|
739
|
+
options: AskUserQuestionOption[];
|
|
740
|
+
// Allow multiple selections
|
|
741
|
+
multiSelect: boolean;
|
|
742
|
+
}
|
|
743
|
+
```
|
|
744
|
+
|
|
745
|
+
### AskUserQuestionOption
|
|
746
|
+
|
|
747
|
+
```typescript
|
|
748
|
+
interface AskUserQuestionOption {
|
|
749
|
+
// Display text (1-5 words)
|
|
750
|
+
label: string;
|
|
751
|
+
// Option description
|
|
752
|
+
description: string;
|
|
753
|
+
}
|
|
754
|
+
```
|
|
755
|
+
|
|
756
|
+
### ToolInputMap
|
|
757
|
+
|
|
758
|
+
```typescript
|
|
759
|
+
interface ToolInputMap {
|
|
760
|
+
AskUserQuestion: AskUserQuestionInput;
|
|
761
|
+
}
|
|
762
|
+
|
|
763
|
+
type KnownToolName = keyof ToolInputMap;
|
|
764
|
+
```
|
|
765
|
+
|
|
766
|
+
## Related Documentation
|
|
767
|
+
|
|
768
|
+
- [SDK Overview](sdk.md) - Quick start and usage examples
|
|
769
|
+
- [Hook Reference Guide](hooks.md) - Detailed Hook configuration instructions
|
|
770
|
+
- [MCP Integration](mcp.md) - MCP server configuration guide
|