@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,797 @@
|
|
|
1
|
+
# Python SDK Reference
|
|
2
|
+
|
|
3
|
+
> **Version Requirement**: This document is for CodeBuddy Agent SDK v0.1.0 and above.
|
|
4
|
+
|
|
5
|
+
This document provides a complete API reference for the Python 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
|
+
- [Client Class](#client-class)
|
|
13
|
+
- [Authentication](#authentication)
|
|
14
|
+
- [Unstable API](#unstable-api)
|
|
15
|
+
- [Types](#types)
|
|
16
|
+
- [Message Types](#message-types)
|
|
17
|
+
- [Input Types](#input-types)
|
|
18
|
+
- [Errors](#errors)
|
|
19
|
+
- [Auth Types](#auth-types)
|
|
20
|
+
|
|
21
|
+
## Requirements
|
|
22
|
+
|
|
23
|
+
| Dependency | Version Requirement |
|
|
24
|
+
|---------|----------|
|
|
25
|
+
| Python | >= 3.10 |
|
|
26
|
+
| CodeBuddy CLI | Installed |
|
|
27
|
+
|
|
28
|
+
**Async Runtime**: The SDK is based on `asyncio`, all APIs are asynchronous.
|
|
29
|
+
|
|
30
|
+
## Installation
|
|
31
|
+
|
|
32
|
+
Recommended to use [uv](https://docs.astral.sh/uv/) for dependency management:
|
|
33
|
+
|
|
34
|
+
```bash
|
|
35
|
+
uv add codebuddy-agent-sdk
|
|
36
|
+
```
|
|
37
|
+
|
|
38
|
+
Or using pip:
|
|
39
|
+
|
|
40
|
+
```bash
|
|
41
|
+
pip install codebuddy-agent-sdk
|
|
42
|
+
```
|
|
43
|
+
|
|
44
|
+
### Environment Variables
|
|
45
|
+
|
|
46
|
+
| Variable Name | Description | Required |
|
|
47
|
+
|--------|------|------|
|
|
48
|
+
| `CODEBUDDY_CODE_PATH` | CodeBuddy CLI executable path | Optional |
|
|
49
|
+
|
|
50
|
+
If not set, the SDK will look for CLI in the following order:
|
|
51
|
+
1. Environment variable `CODEBUDDY_CODE_PATH`
|
|
52
|
+
2. Built-in binary within SDK package
|
|
53
|
+
3. Development environment monorepo path
|
|
54
|
+
|
|
55
|
+
### Authentication Configuration
|
|
56
|
+
|
|
57
|
+
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.
|
|
58
|
+
|
|
59
|
+
## Functions
|
|
60
|
+
|
|
61
|
+
### query()
|
|
62
|
+
|
|
63
|
+
Main API entry point, creates a query and returns an async iterator of messages.
|
|
64
|
+
|
|
65
|
+
```python
|
|
66
|
+
async def query(
|
|
67
|
+
*,
|
|
68
|
+
prompt: str | AsyncIterable[dict[str, Any]],
|
|
69
|
+
options: CodeBuddyAgentOptions | None = None,
|
|
70
|
+
transport: Transport | None = None,
|
|
71
|
+
) -> AsyncIterator[Message]:
|
|
72
|
+
```
|
|
73
|
+
|
|
74
|
+
**Parameters**:
|
|
75
|
+
|
|
76
|
+
| Parameter | Type | Description |
|
|
77
|
+
|------|------|------|
|
|
78
|
+
| `prompt` | `str \| AsyncIterable[dict]` | Query prompt or user message stream |
|
|
79
|
+
| `options` | `CodeBuddyAgentOptions` | Configuration options (optional) |
|
|
80
|
+
| `transport` | `Transport` | Custom transport layer (optional) |
|
|
81
|
+
|
|
82
|
+
**Returns**: `AsyncIterator[Message]` - Async iterator of messages
|
|
83
|
+
|
|
84
|
+
**Example**:
|
|
85
|
+
|
|
86
|
+
```python
|
|
87
|
+
from codebuddy_agent_sdk import query, AssistantMessage, TextBlock
|
|
88
|
+
|
|
89
|
+
async for message in query(prompt="What is 2+2?"):
|
|
90
|
+
if isinstance(message, AssistantMessage):
|
|
91
|
+
for block in message.content:
|
|
92
|
+
if isinstance(block, TextBlock):
|
|
93
|
+
print(block.text)
|
|
94
|
+
```
|
|
95
|
+
|
|
96
|
+
## Client Class
|
|
97
|
+
|
|
98
|
+
### CodeBuddySDKClient
|
|
99
|
+
|
|
100
|
+
Client class for bidirectional interactive conversations. Supports multi-turn dialogues, interruptions, and dynamic control.
|
|
101
|
+
|
|
102
|
+
```python
|
|
103
|
+
class CodeBuddySDKClient:
|
|
104
|
+
def __init__(
|
|
105
|
+
self,
|
|
106
|
+
options: CodeBuddyAgentOptions | None = None,
|
|
107
|
+
transport: Transport | None = None,
|
|
108
|
+
): ...
|
|
109
|
+
```
|
|
110
|
+
|
|
111
|
+
**Methods**:
|
|
112
|
+
|
|
113
|
+
#### connect()
|
|
114
|
+
|
|
115
|
+
Connect to CodeBuddy.
|
|
116
|
+
|
|
117
|
+
```python
|
|
118
|
+
async def connect(
|
|
119
|
+
self,
|
|
120
|
+
prompt: str | AsyncIterable[dict[str, Any]] | None = None
|
|
121
|
+
) -> None:
|
|
122
|
+
```
|
|
123
|
+
|
|
124
|
+
#### query()
|
|
125
|
+
|
|
126
|
+
Send user message.
|
|
127
|
+
|
|
128
|
+
```python
|
|
129
|
+
async def query(
|
|
130
|
+
self,
|
|
131
|
+
prompt: str | AsyncIterable[dict[str, Any]],
|
|
132
|
+
session_id: str = "default",
|
|
133
|
+
) -> None:
|
|
134
|
+
```
|
|
135
|
+
|
|
136
|
+
#### receive_response()
|
|
137
|
+
|
|
138
|
+
Receive messages until a ResultMessage is received.
|
|
139
|
+
|
|
140
|
+
```python
|
|
141
|
+
async def receive_response(self) -> AsyncIterator[Message]:
|
|
142
|
+
```
|
|
143
|
+
|
|
144
|
+
#### receive_messages()
|
|
145
|
+
|
|
146
|
+
Receive all messages (does not auto-stop).
|
|
147
|
+
|
|
148
|
+
```python
|
|
149
|
+
async def receive_messages(self) -> AsyncIterator[Message]:
|
|
150
|
+
```
|
|
151
|
+
|
|
152
|
+
#### disconnect()
|
|
153
|
+
|
|
154
|
+
Disconnect.
|
|
155
|
+
|
|
156
|
+
```python
|
|
157
|
+
async def disconnect(self) -> None:
|
|
158
|
+
```
|
|
159
|
+
|
|
160
|
+
**Context Manager Support**:
|
|
161
|
+
|
|
162
|
+
```python
|
|
163
|
+
async with CodeBuddySDKClient() as client:
|
|
164
|
+
await client.query("Hello!")
|
|
165
|
+
async for msg in client.receive_response():
|
|
166
|
+
print(msg)
|
|
167
|
+
```
|
|
168
|
+
|
|
169
|
+
#### mcp_server_status()
|
|
170
|
+
|
|
171
|
+
Get MCP server connection status.
|
|
172
|
+
|
|
173
|
+
```python
|
|
174
|
+
async def mcp_server_status(self) -> list[McpServerStatus]:
|
|
175
|
+
```
|
|
176
|
+
|
|
177
|
+
## Authentication
|
|
178
|
+
|
|
179
|
+
The SDK provides an independent authentication API with a **two-phase** design: first obtain the login URL, then wait for the user to complete authentication.
|
|
180
|
+
|
|
181
|
+
### authenticate()
|
|
182
|
+
|
|
183
|
+
Start the authentication flow, returns an `AuthFlow` object.
|
|
184
|
+
|
|
185
|
+
```python
|
|
186
|
+
async def authenticate(
|
|
187
|
+
*,
|
|
188
|
+
method_id: str = "external",
|
|
189
|
+
environment: str | None = None,
|
|
190
|
+
endpoint: str | None = None,
|
|
191
|
+
codebuddy_code_path: str | None = None,
|
|
192
|
+
env: dict[str, str] | None = None,
|
|
193
|
+
timeout: float = 300.0,
|
|
194
|
+
) -> AuthFlow:
|
|
195
|
+
```
|
|
196
|
+
|
|
197
|
+
**Parameters**:
|
|
198
|
+
|
|
199
|
+
| Parameter | Type | Description |
|
|
200
|
+
|------|------|------|
|
|
201
|
+
| `method_id` | `str` | Authentication method identifier (default `"external"`) |
|
|
202
|
+
| `environment` | `str \| None` | Predefined environment name |
|
|
203
|
+
| `endpoint` | `str \| None` | Custom endpoint URL (mutually exclusive with environment) |
|
|
204
|
+
| `codebuddy_code_path` | `str \| None` | CLI executable path |
|
|
205
|
+
| `env` | `dict[str, str] \| None` | Additional environment variables |
|
|
206
|
+
| `timeout` | `float` | Timeout for user to complete login (seconds, default 300) |
|
|
207
|
+
|
|
208
|
+
**Returns**: `AuthFlow` — Awaitable object carrying the login URL
|
|
209
|
+
|
|
210
|
+
**Example**:
|
|
211
|
+
|
|
212
|
+
```python
|
|
213
|
+
from codebuddy_agent_sdk import authenticate
|
|
214
|
+
|
|
215
|
+
# Two-phase: get URL → show to user → wait for completion
|
|
216
|
+
auth = await authenticate()
|
|
217
|
+
if auth.auth_url:
|
|
218
|
+
print(f"Please visit: {auth.auth_url}")
|
|
219
|
+
result = await auth
|
|
220
|
+
print(f"Welcome, {result.userinfo.user_name}")
|
|
221
|
+
|
|
222
|
+
# When already logged in, auth.auth_url is empty and await returns immediately
|
|
223
|
+
auth = await authenticate()
|
|
224
|
+
result = await auth # Returns immediately if already logged in
|
|
225
|
+
|
|
226
|
+
# Custom timeout
|
|
227
|
+
auth = await authenticate()
|
|
228
|
+
result = await auth.wait(timeout=60)
|
|
229
|
+
```
|
|
230
|
+
|
|
231
|
+
### AuthFlow
|
|
232
|
+
|
|
233
|
+
Authentication flow object returned by `authenticate()`. Implements the `__await__` protocol and can be directly `await`ed.
|
|
234
|
+
|
|
235
|
+
**Attributes**:
|
|
236
|
+
|
|
237
|
+
| Attribute | Type | Description |
|
|
238
|
+
|------|------|------|
|
|
239
|
+
| `auth_url` | `str` | Login URL (empty string when already logged in) |
|
|
240
|
+
| `method_id` | `str \| None` | Authentication method identifier |
|
|
241
|
+
|
|
242
|
+
**Methods**:
|
|
243
|
+
|
|
244
|
+
#### wait()
|
|
245
|
+
|
|
246
|
+
Wait for the user to complete authentication.
|
|
247
|
+
|
|
248
|
+
```python
|
|
249
|
+
async def wait(self, timeout: float | None = None) -> AuthenticateResponse:
|
|
250
|
+
```
|
|
251
|
+
|
|
252
|
+
#### cancel()
|
|
253
|
+
|
|
254
|
+
Cancel the authentication flow and release resources.
|
|
255
|
+
|
|
256
|
+
```python
|
|
257
|
+
async def cancel(self) -> None:
|
|
258
|
+
```
|
|
259
|
+
|
|
260
|
+
### logout()
|
|
261
|
+
|
|
262
|
+
Log out and clear cached authentication tokens.
|
|
263
|
+
|
|
264
|
+
```python
|
|
265
|
+
async def logout(
|
|
266
|
+
*,
|
|
267
|
+
environment: str | None = None,
|
|
268
|
+
endpoint: str | None = None,
|
|
269
|
+
codebuddy_code_path: str | None = None,
|
|
270
|
+
env: dict[str, str] | None = None,
|
|
271
|
+
) -> None:
|
|
272
|
+
```
|
|
273
|
+
|
|
274
|
+
**Example**:
|
|
275
|
+
|
|
276
|
+
```python
|
|
277
|
+
from codebuddy_agent_sdk import logout
|
|
278
|
+
|
|
279
|
+
await logout()
|
|
280
|
+
```
|
|
281
|
+
|
|
282
|
+
## Unstable API
|
|
283
|
+
|
|
284
|
+
> **Warning**: The following APIs are experimental and may change in future versions.
|
|
285
|
+
|
|
286
|
+
### interrupt()
|
|
287
|
+
|
|
288
|
+
Send interrupt signal.
|
|
289
|
+
|
|
290
|
+
```python
|
|
291
|
+
async def interrupt(self) -> None:
|
|
292
|
+
```
|
|
293
|
+
|
|
294
|
+
### set_permission_mode()
|
|
295
|
+
|
|
296
|
+
Dynamically modify permission mode.
|
|
297
|
+
|
|
298
|
+
```python
|
|
299
|
+
async def set_permission_mode(self, mode: str) -> None:
|
|
300
|
+
```
|
|
301
|
+
|
|
302
|
+
### set_model()
|
|
303
|
+
|
|
304
|
+
Dynamically modify model.
|
|
305
|
+
|
|
306
|
+
```python
|
|
307
|
+
async def set_model(self, model: str | None = None) -> None:
|
|
308
|
+
```
|
|
309
|
+
|
|
310
|
+
## Types
|
|
311
|
+
|
|
312
|
+
### CodeBuddyAgentOptions
|
|
313
|
+
|
|
314
|
+
Complete configuration options:
|
|
315
|
+
|
|
316
|
+
```python
|
|
317
|
+
@dataclass
|
|
318
|
+
class CodeBuddyAgentOptions:
|
|
319
|
+
allowed_tools: list[str] = field(default_factory=list)
|
|
320
|
+
disallowed_tools: list[str] = field(default_factory=list)
|
|
321
|
+
system_prompt: str | AppendSystemPrompt | None = None
|
|
322
|
+
mcp_servers: dict[str, McpServerConfig] | str | Path = field(default_factory=dict)
|
|
323
|
+
permission_mode: PermissionMode | None = None
|
|
324
|
+
continue_conversation: bool = False
|
|
325
|
+
resume: str | None = None
|
|
326
|
+
max_turns: int | None = None
|
|
327
|
+
model: str | None = None
|
|
328
|
+
fallback_model: str | None = None
|
|
329
|
+
cwd: str | Path | None = None
|
|
330
|
+
codebuddy_code_path: str | Path | None = None
|
|
331
|
+
env: dict[str, str] = field(default_factory=dict)
|
|
332
|
+
extra_args: dict[str, str | None] = field(default_factory=dict)
|
|
333
|
+
stderr: Callable[[str], None] | None = None
|
|
334
|
+
hooks: dict[HookEvent, list[HookMatcher]] | None = None
|
|
335
|
+
include_partial_messages: bool = False
|
|
336
|
+
fork_session: bool = False
|
|
337
|
+
agents: dict[str, AgentDefinition] | None = None
|
|
338
|
+
setting_sources: list[SettingSource] | None = None
|
|
339
|
+
can_use_tool: CanUseTool | None = None
|
|
340
|
+
```
|
|
341
|
+
|
|
342
|
+
| Field | Type | Description |
|
|
343
|
+
|------|------|------|
|
|
344
|
+
| `allowed_tools` | `list[str]` | Tool whitelist to auto-allow |
|
|
345
|
+
| `disallowed_tools` | `list[str]` | Tool blacklist to disallow |
|
|
346
|
+
| `system_prompt` | `str \| AppendSystemPrompt` | System prompt configuration |
|
|
347
|
+
| `mcp_servers` | `dict[str, McpServerConfig]` | MCP server configuration |
|
|
348
|
+
| `permission_mode` | `PermissionMode` | Permission mode |
|
|
349
|
+
| `continue_conversation` | `bool` | Continue recent session |
|
|
350
|
+
| `resume` | `str` | Session ID to resume |
|
|
351
|
+
| `max_turns` | `int` | Maximum conversation turns |
|
|
352
|
+
| `model` | `str` | Specify model |
|
|
353
|
+
| `fallback_model` | `str` | Fallback model |
|
|
354
|
+
| `cwd` | `str \| Path` | Working directory |
|
|
355
|
+
| `codebuddy_code_path` | `str \| Path` | CLI executable path |
|
|
356
|
+
| `env` | `dict[str, str]` | Environment variables |
|
|
357
|
+
| `extra_args` | `dict[str, str \| None]` | Extra CLI arguments |
|
|
358
|
+
| `stderr` | `Callable[[str], None]` | stderr callback |
|
|
359
|
+
| `hooks` | `dict[HookEvent, list[HookMatcher]]` | Hook configuration |
|
|
360
|
+
| `include_partial_messages` | `bool` | Include partial messages |
|
|
361
|
+
| `fork_session` | `bool` | Fork session |
|
|
362
|
+
| `agents` | `dict[str, AgentDefinition]` | Custom agents |
|
|
363
|
+
| `setting_sources` | `list[SettingSource]` | Setting sources |
|
|
364
|
+
| `can_use_tool` | `CanUseTool` | Permission callback function |
|
|
365
|
+
| `max_thinking_tokens` | `int` | Maximum thinking tokens (deprecated, use `thinking` instead) |
|
|
366
|
+
| `thinking` | `ThinkingConfig` | Thinking mode configuration: `{"type": "adaptive"}`, `{"type": "enabled", "budget_tokens": N}`, or `{"type": "disabled"}` |
|
|
367
|
+
| `effort` | `'low' \| 'medium' \| 'high' \| 'xhigh'` | Model reasoning effort level |
|
|
368
|
+
|
|
369
|
+
### PermissionMode
|
|
370
|
+
|
|
371
|
+
```python
|
|
372
|
+
PermissionMode = Literal["default", "acceptEdits", "plan", "bypassPermissions"]
|
|
373
|
+
```
|
|
374
|
+
|
|
375
|
+
| Value | Description |
|
|
376
|
+
|-----|------|
|
|
377
|
+
| `"default"` | Default mode, all operations require confirmation |
|
|
378
|
+
| `"acceptEdits"` | Auto-approve file edits |
|
|
379
|
+
| `"plan"` | Planning mode, only allow reads |
|
|
380
|
+
| `"bypassPermissions"` | Skip all permission checks |
|
|
381
|
+
|
|
382
|
+
### PermissionResult
|
|
383
|
+
|
|
384
|
+
```python
|
|
385
|
+
PermissionResult = PermissionResultAllow | PermissionResultDeny
|
|
386
|
+
|
|
387
|
+
@dataclass
|
|
388
|
+
class PermissionResultAllow:
|
|
389
|
+
updated_input: dict[str, Any]
|
|
390
|
+
behavior: Literal["allow"] = "allow"
|
|
391
|
+
updated_permissions: list[dict[str, Any]] | None = None
|
|
392
|
+
|
|
393
|
+
@dataclass
|
|
394
|
+
class PermissionResultDeny:
|
|
395
|
+
message: str
|
|
396
|
+
behavior: Literal["deny"] = "deny"
|
|
397
|
+
interrupt: bool = False
|
|
398
|
+
```
|
|
399
|
+
|
|
400
|
+
### CanUseTool
|
|
401
|
+
|
|
402
|
+
```python
|
|
403
|
+
CanUseTool = Callable[
|
|
404
|
+
[str, dict[str, Any], CanUseToolOptions],
|
|
405
|
+
Awaitable[PermissionResult],
|
|
406
|
+
]
|
|
407
|
+
|
|
408
|
+
@dataclass
|
|
409
|
+
class CanUseToolOptions:
|
|
410
|
+
tool_use_id: str
|
|
411
|
+
signal: Any | None = None
|
|
412
|
+
agent_id: str | None = None
|
|
413
|
+
suggestions: list[dict[str, Any]] | None = None
|
|
414
|
+
blocked_path: str | None = None
|
|
415
|
+
decision_reason: str | None = None
|
|
416
|
+
```
|
|
417
|
+
|
|
418
|
+
### AgentDefinition
|
|
419
|
+
|
|
420
|
+
```python
|
|
421
|
+
@dataclass
|
|
422
|
+
class AgentDefinition:
|
|
423
|
+
description: str # Agent description
|
|
424
|
+
prompt: str # System prompt
|
|
425
|
+
tools: list[str] | None = None # Allowed tools
|
|
426
|
+
disallowed_tools: list[str] | None = None # Disallowed tools
|
|
427
|
+
model: str | None = None # Model to use
|
|
428
|
+
```
|
|
429
|
+
|
|
430
|
+
### McpServerConfig
|
|
431
|
+
|
|
432
|
+
```python
|
|
433
|
+
class McpStdioServerConfig(TypedDict):
|
|
434
|
+
type: NotRequired[Literal["stdio"]]
|
|
435
|
+
command: str
|
|
436
|
+
args: NotRequired[list[str]]
|
|
437
|
+
env: NotRequired[dict[str, str]]
|
|
438
|
+
|
|
439
|
+
McpServerConfig = McpStdioServerConfig
|
|
440
|
+
```
|
|
441
|
+
|
|
442
|
+
### HookEvent
|
|
443
|
+
|
|
444
|
+
```python
|
|
445
|
+
HookEvent = (
|
|
446
|
+
Literal["PreToolUse"]
|
|
447
|
+
| Literal["PostToolUse"]
|
|
448
|
+
| Literal["UserPromptSubmit"]
|
|
449
|
+
| Literal["Stop"]
|
|
450
|
+
| Literal["SubagentStop"]
|
|
451
|
+
| Literal["PreCompact"]
|
|
452
|
+
| Literal["WorktreeCreate"]
|
|
453
|
+
| Literal["WorktreeRemove"]
|
|
454
|
+
)
|
|
455
|
+
```
|
|
456
|
+
|
|
457
|
+
### HookMatcher
|
|
458
|
+
|
|
459
|
+
```python
|
|
460
|
+
@dataclass
|
|
461
|
+
class HookMatcher:
|
|
462
|
+
matcher: str | None = None # Match pattern (supports regex)
|
|
463
|
+
hooks: list[HookCallback] = field(default_factory=list)
|
|
464
|
+
timeout: float | None = None # Timeout in seconds
|
|
465
|
+
```
|
|
466
|
+
|
|
467
|
+
### HookCallback
|
|
468
|
+
|
|
469
|
+
```python
|
|
470
|
+
HookCallback = Callable[
|
|
471
|
+
[Any, str | None, HookContext],
|
|
472
|
+
Awaitable[HookJSONOutput],
|
|
473
|
+
]
|
|
474
|
+
|
|
475
|
+
class HookContext(TypedDict):
|
|
476
|
+
signal: Any | None
|
|
477
|
+
|
|
478
|
+
class SyncHookJSONOutput(TypedDict):
|
|
479
|
+
continue_: NotRequired[bool]
|
|
480
|
+
suppressOutput: NotRequired[bool]
|
|
481
|
+
stopReason: NotRequired[str]
|
|
482
|
+
decision: NotRequired[Literal["block"]]
|
|
483
|
+
reason: NotRequired[str]
|
|
484
|
+
```
|
|
485
|
+
|
|
486
|
+
### SettingSource
|
|
487
|
+
|
|
488
|
+
Controls which filesystem locations the SDK loads configuration from.
|
|
489
|
+
|
|
490
|
+
```python
|
|
491
|
+
SettingSource = Literal["user", "project", "local"]
|
|
492
|
+
```
|
|
493
|
+
|
|
494
|
+
| Value | Description | Location |
|
|
495
|
+
|-----|------|------|
|
|
496
|
+
| `"user"` | Global user settings | `~/.codebuddy/settings.json` |
|
|
497
|
+
| `"project"` | Project shared settings | `.codebuddy/settings.json` |
|
|
498
|
+
| `"local"` | Project local settings | `.codebuddy/settings.local.json` |
|
|
499
|
+
|
|
500
|
+
**Default Behavior**: When `setting_sources` is not specified, the SDK **does not load any filesystem configuration**. This provides a completely clean runtime environment.
|
|
501
|
+
|
|
502
|
+
```python
|
|
503
|
+
# Default: no configuration loaded (clean environment)
|
|
504
|
+
async for msg in query(prompt="..."):
|
|
505
|
+
pass
|
|
506
|
+
|
|
507
|
+
# Load project configuration
|
|
508
|
+
options = CodeBuddyAgentOptions(setting_sources=["project"])
|
|
509
|
+
|
|
510
|
+
# Load all configurations (similar to CLI behavior)
|
|
511
|
+
options = CodeBuddyAgentOptions(setting_sources=["user", "project", "local"])
|
|
512
|
+
```
|
|
513
|
+
|
|
514
|
+
### AppendSystemPrompt
|
|
515
|
+
|
|
516
|
+
```python
|
|
517
|
+
@dataclass
|
|
518
|
+
class AppendSystemPrompt:
|
|
519
|
+
append: str # Content to append to default system prompt
|
|
520
|
+
```
|
|
521
|
+
|
|
522
|
+
## Message Types
|
|
523
|
+
|
|
524
|
+
### Message
|
|
525
|
+
|
|
526
|
+
Union of all message types:
|
|
527
|
+
|
|
528
|
+
```python
|
|
529
|
+
Message = UserMessage | AssistantMessage | SystemMessage | ResultMessage | StreamEvent
|
|
530
|
+
```
|
|
531
|
+
|
|
532
|
+
### SystemMessage
|
|
533
|
+
|
|
534
|
+
```python
|
|
535
|
+
@dataclass
|
|
536
|
+
class SystemMessage:
|
|
537
|
+
subtype: str
|
|
538
|
+
data: dict[str, Any]
|
|
539
|
+
```
|
|
540
|
+
|
|
541
|
+
### UserMessage
|
|
542
|
+
|
|
543
|
+
```python
|
|
544
|
+
@dataclass
|
|
545
|
+
class UserMessage:
|
|
546
|
+
content: str | list[ContentBlock]
|
|
547
|
+
uuid: str | None = None
|
|
548
|
+
parent_tool_use_id: str | None = None
|
|
549
|
+
```
|
|
550
|
+
|
|
551
|
+
### AssistantMessage
|
|
552
|
+
|
|
553
|
+
```python
|
|
554
|
+
@dataclass
|
|
555
|
+
class AssistantMessage:
|
|
556
|
+
content: list[ContentBlock]
|
|
557
|
+
model: str
|
|
558
|
+
parent_tool_use_id: str | None = None
|
|
559
|
+
error: str | None = None
|
|
560
|
+
```
|
|
561
|
+
|
|
562
|
+
### ResultMessage
|
|
563
|
+
|
|
564
|
+
```python
|
|
565
|
+
@dataclass
|
|
566
|
+
class ResultMessage:
|
|
567
|
+
subtype: str
|
|
568
|
+
duration_ms: int
|
|
569
|
+
duration_api_ms: int
|
|
570
|
+
is_error: bool
|
|
571
|
+
num_turns: int
|
|
572
|
+
session_id: str
|
|
573
|
+
total_cost_usd: float | None = None
|
|
574
|
+
usage: dict[str, Any] | None = None
|
|
575
|
+
result: str | None = None
|
|
576
|
+
```
|
|
577
|
+
|
|
578
|
+
### StreamEvent
|
|
579
|
+
|
|
580
|
+
```python
|
|
581
|
+
@dataclass
|
|
582
|
+
class StreamEvent:
|
|
583
|
+
uuid: str
|
|
584
|
+
session_id: str
|
|
585
|
+
event: dict[str, Any]
|
|
586
|
+
parent_tool_use_id: str | None = None
|
|
587
|
+
```
|
|
588
|
+
|
|
589
|
+
### ContentBlock
|
|
590
|
+
|
|
591
|
+
```python
|
|
592
|
+
ContentBlock = TextBlock | ThinkingBlock | ToolUseBlock | ToolResultBlock
|
|
593
|
+
|
|
594
|
+
@dataclass
|
|
595
|
+
class TextBlock:
|
|
596
|
+
text: str
|
|
597
|
+
|
|
598
|
+
@dataclass
|
|
599
|
+
class ThinkingBlock:
|
|
600
|
+
thinking: str
|
|
601
|
+
signature: str
|
|
602
|
+
|
|
603
|
+
@dataclass
|
|
604
|
+
class ToolUseBlock:
|
|
605
|
+
id: str
|
|
606
|
+
name: str
|
|
607
|
+
input: dict[str, Any]
|
|
608
|
+
|
|
609
|
+
@dataclass
|
|
610
|
+
class ToolResultBlock:
|
|
611
|
+
tool_use_id: str
|
|
612
|
+
content: str | list[dict[str, Any]] | None = None
|
|
613
|
+
is_error: bool | None = None
|
|
614
|
+
```
|
|
615
|
+
|
|
616
|
+
## Input Types
|
|
617
|
+
|
|
618
|
+
### AskUserQuestionInput
|
|
619
|
+
|
|
620
|
+
```python
|
|
621
|
+
@dataclass
|
|
622
|
+
class AskUserQuestionInput:
|
|
623
|
+
questions: list[AskUserQuestionQuestion]
|
|
624
|
+
answers: dict[str, str] | None = None
|
|
625
|
+
```
|
|
626
|
+
|
|
627
|
+
### AskUserQuestionQuestion
|
|
628
|
+
|
|
629
|
+
```python
|
|
630
|
+
@dataclass
|
|
631
|
+
class AskUserQuestionQuestion:
|
|
632
|
+
question: str # Complete question text (should end with ?)
|
|
633
|
+
header: str # Short label (max 12 characters)
|
|
634
|
+
options: list[AskUserQuestionOption]
|
|
635
|
+
multi_select: bool # Whether to allow multiple selections
|
|
636
|
+
```
|
|
637
|
+
|
|
638
|
+
### AskUserQuestionOption
|
|
639
|
+
|
|
640
|
+
```python
|
|
641
|
+
@dataclass
|
|
642
|
+
class AskUserQuestionOption:
|
|
643
|
+
label: str # Display text (1-5 words)
|
|
644
|
+
description: str # Option description
|
|
645
|
+
```
|
|
646
|
+
|
|
647
|
+
## Errors
|
|
648
|
+
|
|
649
|
+
All exceptions inherit from `CodeBuddySDKError`.
|
|
650
|
+
|
|
651
|
+
### CodeBuddySDKError
|
|
652
|
+
|
|
653
|
+
```python
|
|
654
|
+
class CodeBuddySDKError(Exception):
|
|
655
|
+
"""Base exception for CodeBuddy SDK errors."""
|
|
656
|
+
pass
|
|
657
|
+
```
|
|
658
|
+
|
|
659
|
+
### CLIConnectionError
|
|
660
|
+
|
|
661
|
+
Thrown when connection to CLI fails or no connection is established.
|
|
662
|
+
|
|
663
|
+
```python
|
|
664
|
+
class CLIConnectionError(CodeBuddySDKError):
|
|
665
|
+
pass
|
|
666
|
+
```
|
|
667
|
+
|
|
668
|
+
### CLINotFoundError
|
|
669
|
+
|
|
670
|
+
Thrown when CLI executable is not found.
|
|
671
|
+
|
|
672
|
+
```python
|
|
673
|
+
class CLINotFoundError(CodeBuddySDKError):
|
|
674
|
+
def __init__(
|
|
675
|
+
self,
|
|
676
|
+
message: str,
|
|
677
|
+
platform: str | None = None,
|
|
678
|
+
arch: str | None = None,
|
|
679
|
+
): ...
|
|
680
|
+
```
|
|
681
|
+
|
|
682
|
+
**Attributes**:
|
|
683
|
+
|
|
684
|
+
| Attribute | Type | Description |
|
|
685
|
+
|------|------|------|
|
|
686
|
+
| `platform` | `str \| None` | Current platform |
|
|
687
|
+
| `arch` | `str \| None` | Current architecture |
|
|
688
|
+
|
|
689
|
+
### CLIJSONDecodeError
|
|
690
|
+
|
|
691
|
+
Thrown when JSON decoding of CLI output fails.
|
|
692
|
+
|
|
693
|
+
```python
|
|
694
|
+
class CLIJSONDecodeError(CodeBuddySDKError):
|
|
695
|
+
pass
|
|
696
|
+
```
|
|
697
|
+
|
|
698
|
+
### ProcessError
|
|
699
|
+
|
|
700
|
+
Thrown when CLI process encounters an error.
|
|
701
|
+
|
|
702
|
+
```python
|
|
703
|
+
class ProcessError(CodeBuddySDKError):
|
|
704
|
+
pass
|
|
705
|
+
```
|
|
706
|
+
|
|
707
|
+
### CLIStartupError
|
|
708
|
+
|
|
709
|
+
Thrown when the CLI process crashes or produces no output during the startup phase.
|
|
710
|
+
|
|
711
|
+
```python
|
|
712
|
+
class CLIStartupError(CodeBuddySDKError):
|
|
713
|
+
def __init__(
|
|
714
|
+
self,
|
|
715
|
+
message: str,
|
|
716
|
+
stderr: str = "",
|
|
717
|
+
exit_code: int | None = None,
|
|
718
|
+
): ...
|
|
719
|
+
```
|
|
720
|
+
|
|
721
|
+
**Attributes**:
|
|
722
|
+
|
|
723
|
+
| Attribute | Type | Description |
|
|
724
|
+
|------|------|------|
|
|
725
|
+
| `stderr` | `str` | stderr output from CLI process |
|
|
726
|
+
| `exit_code` | `int \| None` | Process exit code |
|
|
727
|
+
|
|
728
|
+
### ExecutionError
|
|
729
|
+
|
|
730
|
+
Thrown when execution fails (e.g., authentication error, API error). Contains the errors array from ResultMessage.
|
|
731
|
+
|
|
732
|
+
```python
|
|
733
|
+
class ExecutionError(CodeBuddySDKError):
|
|
734
|
+
def __init__(self, errors: list[str], subtype: str): ...
|
|
735
|
+
```
|
|
736
|
+
|
|
737
|
+
**Attributes**:
|
|
738
|
+
|
|
739
|
+
| Attribute | Type | Description |
|
|
740
|
+
|------|------|------|
|
|
741
|
+
| `errors` | `list[str]` | List of error messages |
|
|
742
|
+
| `subtype` | `str` | Error subtype |
|
|
743
|
+
|
|
744
|
+
### AuthenticationError
|
|
745
|
+
|
|
746
|
+
Thrown when authentication fails.
|
|
747
|
+
|
|
748
|
+
```python
|
|
749
|
+
class AuthenticationError(CodeBuddySDKError):
|
|
750
|
+
def __init__(self, error_type: str, message: str): ...
|
|
751
|
+
```
|
|
752
|
+
|
|
753
|
+
**Attributes**:
|
|
754
|
+
|
|
755
|
+
| Attribute | Type | Description |
|
|
756
|
+
|------|------|------|
|
|
757
|
+
| `error_type` | `str` | Error type (e.g., `"timeout"`, `"auth_failed"`) |
|
|
758
|
+
|
|
759
|
+
## Auth Types
|
|
760
|
+
|
|
761
|
+
### AuthenticateResponse
|
|
762
|
+
|
|
763
|
+
```python
|
|
764
|
+
@dataclass(slots=True)
|
|
765
|
+
class AuthenticateResponse:
|
|
766
|
+
userinfo: UserInfo
|
|
767
|
+
```
|
|
768
|
+
|
|
769
|
+
### UserInfo
|
|
770
|
+
|
|
771
|
+
```python
|
|
772
|
+
@dataclass(slots=True)
|
|
773
|
+
class UserInfo:
|
|
774
|
+
user_id: str
|
|
775
|
+
user_name: str = ""
|
|
776
|
+
user_nickname: str = ""
|
|
777
|
+
token: str = ""
|
|
778
|
+
enterprise_id: str | None = None
|
|
779
|
+
enterprise: str | None = None
|
|
780
|
+
```
|
|
781
|
+
|
|
782
|
+
### McpServerStatus
|
|
783
|
+
|
|
784
|
+
```python
|
|
785
|
+
@dataclass(slots=True)
|
|
786
|
+
class McpServerStatus:
|
|
787
|
+
name: str
|
|
788
|
+
status: Literal["connected", "failed", "needs-auth", "pending"]
|
|
789
|
+
server_info: dict[str, Any] | None = None
|
|
790
|
+
```
|
|
791
|
+
|
|
792
|
+
## Related Documentation
|
|
793
|
+
|
|
794
|
+
- [SDK Overview](sdk.md) - Quick start and usage examples
|
|
795
|
+
- [TypeScript SDK Reference](sdk-typescript.md) - TypeScript version API
|
|
796
|
+
- [Hook Reference Guide](hooks.md) - Detailed Hook configuration instructions
|
|
797
|
+
- [MCP Integration](mcp.md) - MCP server configuration guide
|