@tencent-ai/agent-sdk 0.3.123 → 0.3.125

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (35) hide show
  1. package/cli/CHANGELOG.md +52 -0
  2. package/cli/dist/codebuddy-headless.js +452 -453
  3. package/cli/dist/web-ui/assets/{index-CoP0gamp.js → index-Bv5fqRIO.js} +206 -160
  4. package/cli/dist/web-ui/assets/index-DowTCrkL.css +32 -0
  5. package/cli/dist/web-ui/docs/cn/cli/cli-reference.md +1 -0
  6. package/cli/dist/web-ui/docs/cn/cli/http-api.md +86 -0
  7. package/cli/dist/web-ui/docs/cn/cli/release-notes/README.md +5 -0
  8. package/cli/dist/web-ui/docs/cn/cli/release-notes/v2.81.1.md +14 -0
  9. package/cli/dist/web-ui/docs/cn/cli/release-notes/v2.81.2.md +13 -0
  10. package/cli/dist/web-ui/docs/cn/cli/release-notes/v2.82.0.md +31 -0
  11. package/cli/dist/web-ui/docs/cn/cli/release-notes/v2.83.0.md +27 -0
  12. package/cli/dist/web-ui/docs/cn/cli/release-notes/v2.83.1.md +10 -0
  13. package/cli/dist/web-ui/docs/cn/cli/slash-commands.md +2 -0
  14. package/cli/dist/web-ui/docs/en/cli/cli-reference.md +1 -0
  15. package/cli/dist/web-ui/docs/en/cli/http-api.md +86 -0
  16. package/cli/dist/web-ui/docs/en/cli/release-notes/README.md +5 -0
  17. package/cli/dist/web-ui/docs/en/cli/release-notes/v2.81.1.md +14 -0
  18. package/cli/dist/web-ui/docs/en/cli/release-notes/v2.81.2.md +13 -0
  19. package/cli/dist/web-ui/docs/en/cli/release-notes/v2.82.0.md +31 -0
  20. package/cli/dist/web-ui/docs/en/cli/release-notes/v2.83.0.md +27 -0
  21. package/cli/dist/web-ui/docs/en/cli/release-notes/v2.83.1.md +10 -0
  22. package/cli/dist/web-ui/docs/en/cli/slash-commands.md +2 -0
  23. package/cli/dist/web-ui/docs/search-index-en.json +1 -1
  24. package/cli/dist/web-ui/docs/search-index-zh.json +1 -1
  25. package/cli/dist/web-ui/docs/sidebar-en.json +1 -1
  26. package/cli/dist/web-ui/docs/sidebar-zh.json +1 -1
  27. package/cli/dist/web-ui/index.html +2 -2
  28. package/cli/package.json +1 -1
  29. package/cli/product.cloudhosted.json +2 -2
  30. package/cli/product.internal.json +2 -2
  31. package/cli/product.ioa.json +2 -2
  32. package/cli/product.json +2 -2
  33. package/cli/product.selfhosted.json +2 -2
  34. package/package.json +1 -1
  35. package/cli/dist/web-ui/assets/index-r9a-SZcP.css +0 -32
@@ -16,6 +16,7 @@ CodeBuddy Code 支持斜杠命令,允许您在聊天中执行特殊操作、
16
16
  | `/status` | | ✅ 支持 | 显示当前仓库和会话的状态。 |
17
17
  | `/add-dir` | `<path>` | ✅ 支持 | 添加工作目录。指定要添加的目录路径。 |
18
18
  | `/agents` | | ✅ 支持 | 管理实验性 AI 智能体 |
19
+ | `/branch` | `[name]` | ✅ 支持 | 在当前对话位置创建一个分支,复制活跃对话历史到新 session 并自动切换。可选指定分支名称。 |
19
20
  | `/btw` | `<question>` | ✅ 支持 | 快速提问,不中断当前 Agent 工作流。适用于在 Agent 执行任务时临时提出简短问题,答案基于已有上下文生成。 |
20
21
  | `/compact`| | ✅ 支持 | 压缩上下文。 |
21
22
  | `/config`| `[list \| get \| set]` | ✅ 支持 | 查看或修改本地配置。不带参数时打开交互式面板,`list` 列出当前设置,`get <key>` 读取设置,`set <key> <value>` 修改设置。 |
@@ -38,6 +39,7 @@ CodeBuddy Code 支持斜杠命令,允许您在聊天中执行特殊操作、
38
39
  | `/theme` | | ✅ 支持 | 打开主题选择面板,可选择和预览不同的终端主题(dark、light、colorblind-friendly、ANSI 等)。 |
39
40
  | `/export` | | ✅ 支持 | 导出当前对话到文件或剪贴板。 |
40
41
  | `/feedback` | | ✅ 支持 | 打开反馈页面,提交 Bug 报告或功能建议。 |
42
+ | `/fork` | `[name]` | ✅ 支持 | 在当前对话位置创建一个分支(`/branch` 的别名)。复制活跃对话历史到新 session 并自动切换,可通过 `/resume` 返回原对话。 |
41
43
  | `/resume` | `[list \| session-id]` | ✅ 支持 | 恢复之前的会话。不带参数时打开交互式面板,`list` 列出所有会话,带 session-id 时直接切换到指定会话。 |
42
44
  | `/rewind` | | ✅ 支持 | 回退对话到之前的某个消息点,可选择仅回退对话、仅回退代码或同时回退两者。详见 [检查点](checkpointing.md)。 |
43
45
  | `/sandbox` | | ✅ 支持 | 管理 Bash 命令沙箱模式,控制命令执行的安全策略。详见 [沙箱文档](bash-sandboxing.md)。 |
@@ -31,6 +31,7 @@ Command-line parameters to customize CodeBuddy Code behavior:
31
31
  | Parameter | Description | Example |
32
32
  | :------------------------------- | :-------------------------------------------------------------------------------------------------------------------------------- | :------------------------------------------------------------------------------------------------- |
33
33
  | `--add-dir` | Add additional working directories for CodeBuddy to access (validates each path for existence) | `codebuddy --add-dir ../apps ../lib` |
34
+ | `--agent` | Specify the agent name (built-in or custom agent) for the current session, takes priority over the `agent` setting in settings.json | `codebuddy --agent my-reviewer` |
34
35
  | `--agents` | Dynamically define custom [Sub-Agents](./sub-agents.md) via JSON (format described below) | `codebuddy --agents '{"reviewer":{"description":"Review code","prompt":"You are a code reviewer"}}'` |
35
36
  | `--allowedTools` | List of tools allowed without prompting the user, in addition to [settings.json file](./settings.md) | `"Bash(git log:*)" "Bash(git diff:*)" "Read"` |
36
37
  | `--disallowedTools` | List of tools to disallow, in addition to [settings.json file](./settings.md) | `"Bash(git log:*)" "Bash(git diff:*)" "Edit"` |
@@ -273,6 +273,38 @@ Aligned with E2B process.proto, mapping gRPC methods to REST endpoints:
273
273
  | GET | `/api/v1/tasks/templates` | Get task templates |
274
274
  | POST | `/api/v1/tasks/templates/refresh` | Refresh (trigger AI recommendations) |
275
275
 
276
+ ### Usage Statistics
277
+
278
+ | Method | Endpoint | Description |
279
+ |--------|----------|-------------|
280
+ | GET | `/api/v1/stats` | Historical usage statistics (across all projects) |
281
+ | GET | `/api/v1/stats/session` | Current session real-time statistics |
282
+
283
+ ### Traces
284
+
285
+ | Method | Endpoint | Description |
286
+ |--------|----------|-------------|
287
+ | GET | `/api/v1/traces` | Get trace list (supports pagination and filtering) |
288
+ | GET | `/api/v1/traces/:traceId` | Get trace details (with spans) |
289
+ | DELETE | `/api/v1/traces` | Clear all traces |
290
+
291
+ **Traces query parameters**:
292
+ - `?offset=0&limit=50` — Pagination (limit max 200)
293
+ - `?session_id=xxx` — Filter by session ID
294
+ - `?worker_pid=12345` — Specify Worker instance (supports remote proxy)
295
+ - `?worker_pid=all` — Scan all instances
296
+
297
+ ### Scheduled Tasks
298
+
299
+ | Method | Endpoint | Description |
300
+ |--------|----------|-------------|
301
+ | GET | `/api/v1/scheduled-tasks` | Get scheduled task list |
302
+ | POST | `/api/v1/scheduled-tasks` | Create scheduled task |
303
+ | DELETE | `/api/v1/scheduled-tasks/:id` | Delete scheduled task |
304
+
305
+ **Scheduled task query parameters**:
306
+ - `?sessionId=xxx` — Session ID (required, uses current active session if not provided)
307
+
276
308
  ## Usage Examples
277
309
 
278
310
  ### Health Check
@@ -514,6 +546,60 @@ curl -X POST http://127.0.0.1:8080/api/v1/settings/permissions/remove \
514
546
  -d '{"values": ["Allow: Read(**)"]}'
515
547
  ```
516
548
 
549
+ ### Usage Statistics
550
+
551
+ ```bash
552
+ # Get historical usage statistics (activity heatmap, model/tool usage rankings, consecutive active days, etc.)
553
+ curl http://127.0.0.1:8080/api/v1/stats
554
+
555
+ # Get current session real-time cost statistics
556
+ curl http://127.0.0.1:8080/api/v1/stats/session
557
+ ```
558
+
559
+ ### Traces
560
+
561
+ ```bash
562
+ # Get trace list (paginated)
563
+ curl "http://127.0.0.1:8080/api/v1/traces?offset=0&limit=20"
564
+
565
+ # Filter by session ID
566
+ curl "http://127.0.0.1:8080/api/v1/traces?session_id=SESSION_ID"
567
+
568
+ # Get trace details (with all spans)
569
+ curl http://127.0.0.1:8080/api/v1/traces/TRACE_ID
570
+
571
+ # Get traces from a remote Worker
572
+ curl "http://127.0.0.1:8080/api/v1/traces?worker_pid=12345"
573
+
574
+ # Clear all traces
575
+ curl -X DELETE http://127.0.0.1:8080/api/v1/traces
576
+ ```
577
+
578
+ ### Scheduled Task Management
579
+
580
+ ```bash
581
+ # Get scheduled task list
582
+ curl "http://127.0.0.1:8080/api/v1/scheduled-tasks?sessionId=SESSION_ID"
583
+
584
+ # Create scheduled task (every 5 minutes)
585
+ curl -X POST http://127.0.0.1:8080/api/v1/scheduled-tasks \
586
+ -H "Content-Type: application/json" \
587
+ -d '{"cron": "*/5 * * * *", "prompt": "Check build status", "sessionId": "SESSION_ID"}'
588
+
589
+ # Create one-time task (every Monday at 9 AM)
590
+ curl -X POST http://127.0.0.1:8080/api/v1/scheduled-tasks \
591
+ -H "Content-Type: application/json" \
592
+ -d '{"cron": "0 9 * * 1", "prompt": "Generate weekly report", "recurring": false, "sessionId": "SESSION_ID"}'
593
+
594
+ # Create durable task (persists after restart)
595
+ curl -X POST http://127.0.0.1:8080/api/v1/scheduled-tasks \
596
+ -H "Content-Type: application/json" \
597
+ -d '{"cron": "0 0 * * *", "prompt": "Daily cleanup", "durable": true, "sessionId": "SESSION_ID"}'
598
+
599
+ # Delete scheduled task
600
+ curl -X DELETE "http://127.0.0.1:8080/api/v1/scheduled-tasks/TASK_ID?sessionId=SESSION_ID"
601
+ ```
602
+
517
603
  ## Error Codes
518
604
 
519
605
  | Error Code | HTTP Status | Description |
@@ -17,6 +17,11 @@ Difference from CHANGELOG.md:
17
17
 
18
18
  <!-- New versions are automatically added here -->
19
19
 
20
+ - [v2.83.1](./v2.83.1.md) - 2026-04-10
21
+ - [v2.83.0](./v2.83.0.md) - 2026-04-10
22
+ - [v2.82.0](./v2.82.0.md) - 2026-04-10
23
+ - [v2.81.2](./v2.81.2.md) - 2026-04-09
24
+ - [v2.81.1](./v2.81.1.md) - 2026-04-08
20
25
  - [v2.81.0](./v2.81.0.md) - 2026-04-08
21
26
  - [v2.80.0](./v2.80.0.md) - 2026-04-08
22
27
  - [v2.79.1](./v2.79.1.md) - 2026-04-07
@@ -0,0 +1,14 @@
1
+ # 🚀 CodeBuddy Code v2.81.1 Release
2
+
3
+ ## 🔧 Improvements
4
+
5
+ - **system-reminder classification system**: Added classification attributes to non-rule type system-reminder tags, enabling precise differentiation and restoration of different system reminder types during context compression, improving conversation continuity
6
+ - **Regex compatibility**: Updated all system-reminder related regular expressions to support the new attribute-bearing tag format, preventing match omissions
7
+ - **PromptManager race condition fix**: Adopted an atomic replacement strategy to fix a race condition in template loading, eliminating occasional system prompt loss after `/clear`
8
+ - **Streaming tool name display**: Real-time display of the currently invoked tool name during model streaming output, making the execution process more transparent
9
+
10
+ ## 📝 Documentation Updates
11
+
12
+ - **Keyboard shortcuts documentation**: Added keyboard shortcut configuration documentation covering Chinese, English, and Traditional Chinese
13
+ - **Multi-language documentation sync**: Synchronized multi-language versions of environment variables, memory system, settings, and tool reference documentation
14
+ - **Release notes**: Added multi-language release notes for versions v2.79.1, v2.80.0, and v2.81.0
@@ -0,0 +1,13 @@
1
+ # 🚀 CodeBuddy Code v2.81.2 Release
2
+
3
+ ## 🔧 Improvements
4
+
5
+ - **Plugin installation scope selection**: Added scope selection when installing plugins, supporting user-level, project-level, and local-level installation methods. Installed plugins now display corresponding scope labels for easier identification and management
6
+ - **Subagent preamble text hidden**: Descriptive text output by the model before invoking subagents is no longer displayed in the conversation flow, reducing visual noise for a cleaner experience
7
+ - **Line break button optimization**: Removed the redundant line break button on desktop (use Shift+Enter instead), retaining it only on mobile
8
+ - **Single tool connector line optimization**: The left connector line is no longer displayed when a tool group contains only one entry, providing a cleaner visual appearance
9
+ - **Code block style unification**: Unified style handling for code highlighting components, removing excess background color and text shadow
10
+
11
+ ## 🐛 Bug Fixes
12
+
13
+ - **Settings config file protection**: Fixed an issue where write operations would overwrite the original file when settings.json contained JSON syntax errors, causing configuration loss. The system now detects corrupted state and prevents overwriting
@@ -0,0 +1,31 @@
1
+ # 🚀 CodeBuddy Code v2.82.0 Release
2
+
3
+ ## ✨ New Features
4
+
5
+ ### Fork Subagent
6
+
7
+ The Agent tool now supports Fork mode: when the `subagent_type` parameter is omitted, it automatically creates a background subagent that inherits the parent agent's full context (system prompt, tool set, conversation history). This is ideal for parallel task scenarios that require the current conversation context, without the need to manually pass context information.
8
+
9
+ ### Conversation Branching
10
+
11
+ Added `/fork` and `/branch` slash commands to support creating branches at the current conversation position. Branches copy the active conversation history to a new session and automatically switch to it. You can return to the original conversation via `/resume` to continue working.
12
+
13
+ ## 🔧 Improvements
14
+
15
+ - **Memory injection optimization**: Auto Memory context injection moved from the end to the first message, improving prompt cache hit rate; added fallback detection to ensure memory is not lost after resume
16
+ - **SystemReminder streamlining**: Removed TODO-LIST auto-injection logic to reduce unnecessary context usage
17
+ - **Trace logging**: Added traceId/spanId logging at request entry and TraceStartHook for easier troubleshooting of trace-related issues
18
+ - **Plugin agent configuration enhancement**: Agent configuration in plugin `settings.json` is no longer restricted by the enabled state, supporting independent `settings.json` file loading of agent definitions
19
+ - **Settings agent override optimization**: Both `settings.agent` and plugin agents now use patch-in-place to override default agents, keeping agent names unchanged
20
+ - **CLI `--agent` parameter**: Added the `--agent` command-line parameter to directly specify the agent for a session at startup, taking priority over settings configuration
21
+
22
+ ## 🐛 Bug Fixes
23
+
24
+ - **File lock PID check**: File locks can now be reclaimed immediately after a process crash, no longer requiring a 5-minute timeout
25
+ - **Settings write degradation**: Graceful degradation when file lock acquisition fails, no longer throwing unhandled exceptions
26
+ - **Background session attach**: The `attach` command now prioritizes tracking log output for sessions started with `--bg`
27
+ - **Short command exit**: Commands like `ps/logs/attach/kill` now exit immediately after execution instead of hanging
28
+ - **Headless routing**: Fixed an issue where `--output-format=stream-json` style equal-sign format parameters could not be correctly routed to the headless bundle
29
+ - **MCP OAuth authentication**: Fixed an authentication failure caused by mismatched OAuth callback paths
30
+ - **Bedrock model compatibility**: Fixed an error with the Bedrock ConverseStream API when message content was empty
31
+ - **stream-json error output**: Fixed an issue where exception information polluted the JSON stream in stream-json mode; errors are now output in JSON format
@@ -0,0 +1,27 @@
1
+ # 🚀 CodeBuddy Code v2.83.0 Release
2
+
3
+ ## ✨ New Features
4
+
5
+ ### Fork Subagent
6
+
7
+ When the `subagent_type` parameter is omitted, the Agent tool automatically enters Fork mode, inheriting the parent agent's full context (system prompt, tools, conversation history). This is ideal for parallel tasks that require the current context. It runs synchronously by default; set `run_in_background=true` to switch to background mode.
8
+
9
+ ### Conversation Branching
10
+
11
+ Added `/fork` and `/branch` slash commands that support creating branches at the current conversation position. The active history is copied to a new session and automatically switched to, making it easy to explore solutions in different directions.
12
+
13
+ ## 🔧 Improvements
14
+
15
+ - **SendMessage Always Available**: The SendMessage tool is now available in any scenario without waiting for a team to be created
16
+ - **Memory Injection Optimization**: Auto Memory context prompt is now injected into the first message, improving prompt cache hit rate; memory is no longer lost after resume
17
+ - **Plugin Agent Configuration Enhancement**: Plugin agent configuration is no longer restricted by the enabled state, supporting independent settings.json file loading
18
+ - **CLI `--agent` Parameter**: Added the `--agent <agent>` command-line parameter to specify the agent to use at startup
19
+
20
+ ## 🐛 Bug Fixes
21
+
22
+ - **File Lock Recovery**: File locks are now immediately reclaimed after a process crash, eliminating the need to wait for a 5-minute timeout
23
+ - **Settings Write Stability**: Graceful degradation when file lock acquisition fails, preventing unhandled exceptions
24
+ - **MCP OAuth Authentication**: Fixed an issue where OAuth callback path mismatch caused authentication failure
25
+ - **Bedrock Model Compatibility**: Fixed an issue where Bedrock API returned errors when message content was empty
26
+ - **Headless Routing**: Fixed an issue where equal-sign format parameters (e.g., `--output-format=stream-json`) could not be routed correctly
27
+ - **stream-json Output**: Fixed an issue where error messages polluted the JSON stream in stream-json mode
@@ -0,0 +1,10 @@
1
+ # 🚀 CodeBuddy Code v2.83.1 Release
2
+
3
+ ## 🔧 Improvements
4
+
5
+ - **Deferred Tool Loading Configuration**: Optimized the configuration retrieval for deferred loading tools, ensuring product configuration is fully ready before reading, improving tool loading reliability; ToolSearch and DeferExecuteTool are automatically hidden when global deferred loading is disabled, reducing unnecessary tool list clutter
6
+
7
+ ## 🐛 Bug Fixes
8
+
9
+ - **MCP Configuration Loading Timing**: Fixed an initialization timing issue with MCP configuration loading in ACP mode (IDE integration), ensuring the configuration takes effect correctly
10
+ - **Trace Initialization Race Condition**: Fixed an issue where the first request in headless/SDK mode could produce empty trace data, ensuring the TracerProvider completes initialization before the first request
@@ -16,6 +16,7 @@ These commands are used to manage your CodeBuddy Code sessions. Here is the curr
16
16
  | `/status` | | ✅ Supported | Display the status of the current repository and session. |
17
17
  | `/add-dir` | `<path>` | ✅ Supported | Add a working directory. Specify the path of the directory to add. |
18
18
  | `/agents` | | ✅ Supported | Manage experimental AI agents |
19
+ | `/branch` | `[name]` | ✅ Supported | Create a branch at the current conversation point, copying active conversation history to a new session and automatically switching to it. Optionally specify a branch name. |
19
20
  | `/btw` | `<question>` | ✅ Supported | Quick side question without interrupting the current Agent workflow. Useful for asking brief questions while the Agent is executing a task. Answers are generated based on existing context. |
20
21
  | `/compact`| | ✅ Supported | Compress context. |
21
22
  | `/config`| `[list \| get \| set]` | ✅ Supported | View or modify local configuration. Opens an interactive panel when used without parameters, `list` lists current settings, `get <key>` reads a setting, `set <key> <value>` modifies a setting. |
@@ -38,6 +39,7 @@ These commands are used to manage your CodeBuddy Code sessions. Here is the curr
38
39
  | `/theme` | | ✅ Supported | Open the theme selection panel, where you can select and preview different terminal themes (dark, light, colorblind-friendly, ANSI, etc.). |
39
40
  | `/export` | | ✅ Supported | Export the current conversation to a file or clipboard. |
40
41
  | `/feedback` | | ✅ Supported | Open the feedback page to submit bug reports or feature suggestions. |
42
+ | `/fork` | `[name]` | ✅ Supported | Create a branch at the current conversation point (alias for `/branch`). Copies active conversation history to a new session and automatically switches to it. Use `/resume` to return to the original conversation. |
41
43
  | `/resume` | `[list \| session-id]` | ✅ Supported | Resume a previous session. Opens an interactive panel when used without parameters, `list` lists all sessions, or directly switches to the specified session when provided with a session-id. |
42
44
  | `/rewind` | | ✅ Supported | Rewind conversation to a previous message point. You can choose to rewind conversation only, code only, or both. See [Checkpointing](checkpointing.md) for details. |
43
45
  | `/sandbox` | | ✅ Supported | Manage Bash command sandbox mode and control security policies for command execution. See [Sandbox Documentation](bash-sandboxing.md) for details. |