@tencent-ai/agent-sdk 0.3.114 → 0.3.116
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 +41 -0
- package/cli/bin/codebuddy +5 -1
- package/cli/dist/codebuddy-headless.js +128 -124
- package/cli/dist/web-ui/assets/index-C7MTLJe8.css +32 -0
- package/cli/dist/web-ui/assets/index-KUgjjYF4.js +591 -0
- package/cli/dist/web-ui/docs/cn/cli/acp.md +69 -0
- package/cli/dist/web-ui/docs/cn/cli/cli-reference.md +11 -0
- package/cli/dist/web-ui/docs/cn/cli/daemon.md +232 -0
- package/cli/dist/web-ui/docs/cn/cli/env-vars.md +1 -0
- package/cli/dist/web-ui/docs/cn/cli/gitlab-ci-cd.md +1 -1
- package/cli/dist/web-ui/docs/cn/cli/http-api.md +27 -6
- package/cli/dist/web-ui/docs/cn/cli/quickstart.md +1 -1
- package/cli/dist/web-ui/docs/cn/cli/release-notes/README.md +6 -1
- package/cli/dist/web-ui/docs/cn/cli/release-notes/v2.77.0.md +38 -0
- package/cli/dist/web-ui/docs/cn/cli/release-notes/v2.77.1.md +10 -0
- package/cli/dist/web-ui/docs/cn/cli/release-notes/v2.78.0.md +26 -0
- package/cli/dist/web-ui/docs/cn/cli/release-notes/v2.78.1.md +10 -0
- package/cli/dist/web-ui/docs/cn/cli/release-notes/v2.79.0.md +38 -0
- package/cli/dist/web-ui/docs/cn/cli/settings.md +1 -1
- package/cli/dist/web-ui/docs/cn/cli/web-ui.md +3 -1
- package/cli/dist/web-ui/docs/en/cli/acp.md +98 -3
- package/cli/dist/web-ui/docs/en/cli/cli-reference.md +11 -0
- package/cli/dist/web-ui/docs/en/cli/daemon.md +232 -0
- package/cli/dist/web-ui/docs/en/cli/env-vars.md +3 -0
- package/cli/dist/web-ui/docs/en/cli/gitlab-ci-cd.md +1 -1
- package/cli/dist/web-ui/docs/en/cli/http-api.md +144 -8
- package/cli/dist/web-ui/docs/en/cli/quickstart.md +1 -1
- package/cli/dist/web-ui/docs/en/cli/release-notes/README.md +6 -1
- package/cli/dist/web-ui/docs/en/cli/release-notes/v2.77.0.md +38 -0
- package/cli/dist/web-ui/docs/en/cli/release-notes/v2.77.1.md +10 -0
- package/cli/dist/web-ui/docs/en/cli/release-notes/v2.78.0.md +26 -0
- package/cli/dist/web-ui/docs/en/cli/release-notes/v2.78.1.md +10 -0
- package/cli/dist/web-ui/docs/en/cli/release-notes/v2.79.0.md +38 -0
- package/cli/dist/web-ui/docs/en/cli/web-ui.md +5 -3
- package/cli/dist/web-ui/docs/search-index-en.json +1 -1
- package/cli/dist/web-ui/docs/search-index-zh.json +1 -1
- package/cli/dist/web-ui/docs/sidebar-en.json +1 -1
- package/cli/dist/web-ui/docs/sidebar-zh.json +1 -1
- 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 +2 -2
- package/cli/product.selfhosted.json +2 -2
- package/package.json +1 -1
- package/cli/dist/web-ui/assets/index-4R_-ZdN-.css +0 -32
- package/cli/dist/web-ui/assets/index-DOt3FCeP.js +0 -499
|
@@ -43,13 +43,39 @@ You can then create a CodeBuddy Code Thread in the Zed sidebar and start using i
|
|
|
43
43
|
```json
|
|
44
44
|
{
|
|
45
45
|
"env": {
|
|
46
|
-
"CODEBUDDY_API_KEY": "your-api-key"
|
|
46
|
+
"CODEBUDDY_API_KEY": "your-api-key",
|
|
47
|
+
"CODEBUDDY_INTERNET_ENVIRONMENT": "internal"
|
|
47
48
|
}
|
|
48
49
|
}
|
|
49
50
|
```
|
|
50
51
|
|
|
52
|
+
> **Note**: When using `CODEBUDDY_API_KEY`, you must correctly configure `CODEBUDDY_INTERNET_ENVIRONMENT` based on your version:
|
|
53
|
+
> - International version: Do not set (default)
|
|
54
|
+
> - China version: `internal`
|
|
55
|
+
> - iOA version: `ioa`
|
|
56
|
+
>
|
|
57
|
+
> See [Identity and Access Management documentation](iam.md#getting-a-personal-api-key) for details.
|
|
58
|
+
|
|
51
59
|
## ACP Protocol Features
|
|
52
60
|
|
|
61
|
+
### Authentication Information Extension
|
|
62
|
+
|
|
63
|
+
CodeBuddy Code returns user information in the `_meta` field of the `authenticate` response:
|
|
64
|
+
|
|
65
|
+
```json
|
|
66
|
+
{
|
|
67
|
+
"_meta": {
|
|
68
|
+
"codebuddy.ai/userinfo": {
|
|
69
|
+
"userId": "User ID",
|
|
70
|
+
"userName": "Username",
|
|
71
|
+
"userNickname": "User Nickname"
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
```
|
|
76
|
+
|
|
77
|
+
Clients can use this information to provide a better user experience, such as displaying the currently logged-in user or personalizing the interface.
|
|
78
|
+
|
|
53
79
|
### Tool Proxy Mechanism
|
|
54
80
|
|
|
55
81
|
The ACP protocol supports client-side proxying of certain tool operations, improving performance and security:
|
|
@@ -69,6 +95,75 @@ CodeBuddy Code automatically pushes the available slash command list (`available
|
|
|
69
95
|
|
|
70
96
|
The command list automatically filters out local commands (such as `/clear`, `/exit`) and client-specific commands (such as `/theme`, `/config`), only pushing commands applicable to ACP mode.
|
|
71
97
|
|
|
98
|
+
### Agent Teams Protocol Extension
|
|
99
|
+
|
|
100
|
+
CodeBuddy Code extends the ACP protocol through the `_meta` field of `session_info_update` to support real-time status push for Agent Teams multi-agent collaboration.
|
|
101
|
+
|
|
102
|
+
#### Team Status Events
|
|
103
|
+
|
|
104
|
+
The following event types are pushed via `_meta['codebuddy.ai/teamUpdate']`:
|
|
105
|
+
|
|
106
|
+
**Member Status Change** (`member_status_change`):
|
|
107
|
+
|
|
108
|
+
```json
|
|
109
|
+
{
|
|
110
|
+
"sessionUpdate": "session_info_update",
|
|
111
|
+
"_meta": {
|
|
112
|
+
"codebuddy.ai/teamUpdate": {
|
|
113
|
+
"type": "member_status_change",
|
|
114
|
+
"teamName": "my-team",
|
|
115
|
+
"isAutoTeam": false,
|
|
116
|
+
"members": [
|
|
117
|
+
{
|
|
118
|
+
"name": "ux-designer",
|
|
119
|
+
"color": "blue",
|
|
120
|
+
"description": "UX design analysis",
|
|
121
|
+
"status": "running",
|
|
122
|
+
"taskId": "agent-abc123",
|
|
123
|
+
"sessionId": "session-xyz",
|
|
124
|
+
"tokenUsage": { "inputTokens": 1000, "outputTokens": 500, "lastContextWindow": 42000 },
|
|
125
|
+
"toolCallCount": 5
|
|
126
|
+
}
|
|
127
|
+
]
|
|
128
|
+
}
|
|
129
|
+
}
|
|
130
|
+
}
|
|
131
|
+
```
|
|
132
|
+
|
|
133
|
+
**Team Created** (`team_created`) / **Deleted** (`team_deleted`):
|
|
134
|
+
|
|
135
|
+
```json
|
|
136
|
+
{
|
|
137
|
+
"sessionUpdate": "session_info_update",
|
|
138
|
+
"_meta": {
|
|
139
|
+
"codebuddy.ai/teamUpdate": {
|
|
140
|
+
"type": "team_created",
|
|
141
|
+
"teamName": "my-team"
|
|
142
|
+
}
|
|
143
|
+
}
|
|
144
|
+
}
|
|
145
|
+
```
|
|
146
|
+
|
|
147
|
+
#### Member Streaming Messages
|
|
148
|
+
|
|
149
|
+
Real-time messages from members (text, tool calls) are pushed through standard ACP events, with the `_meta['codebuddy.ai/memberEvent']` tag added to identify the message source:
|
|
150
|
+
|
|
151
|
+
```json
|
|
152
|
+
{
|
|
153
|
+
"sessionUpdate": "agent_message_chunk",
|
|
154
|
+
"content": { "type": "text", "text": "Analyzing architecture proposal..." },
|
|
155
|
+
"_meta": {
|
|
156
|
+
"codebuddy.ai/memberEvent": "tech-architect"
|
|
157
|
+
}
|
|
158
|
+
}
|
|
159
|
+
```
|
|
160
|
+
|
|
161
|
+
Upon receiving events with the `memberEvent` tag, clients should route them to the corresponding member's conversation timeline rather than the main conversation area.
|
|
162
|
+
|
|
163
|
+
#### Page Refresh Recovery
|
|
164
|
+
|
|
165
|
+
After a page refresh, once `loadSession`'s `replayHistory` is complete, the current Team status is automatically pushed (`member_status_change` event), so clients do not need to make a separate request. When `AcpTeamBridge` subscribes to a member session, it automatically replays the complete history, so member conversation data is also fully restored via ACP SSE without requiring additional HTTP APIs.
|
|
166
|
+
|
|
72
167
|
## Other Editor Support
|
|
73
168
|
|
|
74
169
|
ACP is an open protocol, so theoretically any editor supporting ACP can integrate with CodeBuddy Code. Configuration is similar to Zed:
|
|
@@ -117,8 +212,8 @@ ACP is an open protocol, so theoretically any editor supporting ACP can integrat
|
|
|
117
212
|
|
|
118
213
|
## Related Links
|
|
119
214
|
|
|
120
|
-
- [CLI Reference](cli-reference.md) - View all command-line parameters
|
|
121
|
-
- [IDE Integration Guide](ide-integrations.md) - More editor integration methods
|
|
215
|
+
- [CLI Reference](./cli-reference.md) - View all command-line parameters
|
|
216
|
+
- [IDE Integration Guide](./ide-integrations.md) - More editor integration methods
|
|
122
217
|
- [ACP Protocol Specification](https://github.com/agentclientprotocol/agent-client-protocol) - Detailed protocol documentation
|
|
123
218
|
|
|
124
219
|
---
|
|
@@ -15,6 +15,14 @@
|
|
|
15
15
|
| `codebuddy -r "<session-id>" "query"` | Resume session by ID | `codebuddy -r "abc123" "complete this MR"` |
|
|
16
16
|
| `codebuddy update` | Update to the latest version | `codebuddy update` |
|
|
17
17
|
| `codebuddy mcp` | Configure Model Context Protocol (MCP) servers | See [CodeBuddy Code MCP docs](./mcp.md) |
|
|
18
|
+
| `codebuddy daemon start` | Start the Daemon process | `codebuddy daemon start --port 8080` |
|
|
19
|
+
| `codebuddy daemon stop` | Stop the Daemon | `codebuddy daemon stop` |
|
|
20
|
+
| `codebuddy daemon status` | View Daemon status | `codebuddy daemon status` |
|
|
21
|
+
| `codebuddy daemon restart` | Restart the Daemon | `codebuddy daemon restart` |
|
|
22
|
+
| `codebuddy ps` | List all active Worker processes | `codebuddy ps` |
|
|
23
|
+
| `codebuddy logs <pid\|name>` | View Worker logs | `codebuddy logs feature-x` |
|
|
24
|
+
| `codebuddy attach <pid\|name>` | Attach to a background Worker | `codebuddy attach feature-x` |
|
|
25
|
+
| `codebuddy kill <pid\|name>` | Terminate a Worker process | `codebuddy kill feature-x` |
|
|
18
26
|
|
|
19
27
|
## CLI Parameters
|
|
20
28
|
|
|
@@ -53,6 +61,9 @@ Command-line parameters to customize CodeBuddy Code behavior:
|
|
|
53
61
|
| `--worktree [name]` | Run in an isolated git worktree (see [Worktree documentation](./worktree.md)) | `codebuddy --worktree` or `codebuddy --worktree my-feature` |
|
|
54
62
|
| `--tmux` | Run in a tmux session (used together with `--worktree`) | `codebuddy --worktree --tmux` |
|
|
55
63
|
| `--plugin-dir <dirs...>` | Load plugins from local directories (for development/testing), multiple paths supported. See [Plugin documentation](plugins.md) | `codebuddy --plugin-dir ./my-plugin ../other-plugin` |
|
|
64
|
+
| `--bg` | Run session in the background (detached mode), logs output to `~/.codebuddy/logs/`. See [Daemon documentation](daemon.md) | `codebuddy --bg "implement login page"` |
|
|
65
|
+
| `--name <name>` | Background session name (used with `--bg`, makes it easy to find via `ps`/`logs`/`kill`) | `codebuddy --bg --name feature-x "implement feature"` |
|
|
66
|
+
| `--serve` | Start HTTP server (Web UI, REST API, ACP protocol) | `codebuddy --serve --port 8080` |
|
|
56
67
|
|
|
57
68
|
> **Important Note**: When using the `-p/--print` parameter for non-interactive execution, operations involving file reading/writing, command execution, network requests, etc. typically require adding the `-y` (or `--dangerously-skip-permissions`) parameter to execute, otherwise the operations will be blocked.
|
|
58
69
|
|
|
@@ -0,0 +1,232 @@
|
|
|
1
|
+
# Daemon Mode and Background Sessions
|
|
2
|
+
|
|
3
|
+
Daemon mode runs CodeBuddy Code as a **background resident service**, independent of any terminal window. Once started, it provides a full HTTP API and Web UI, ready to accept requests at any time.
|
|
4
|
+
|
|
5
|
+
**Core value**: Transform the CLI from "use and go" to "always on standby".
|
|
6
|
+
|
|
7
|
+
## Concepts
|
|
8
|
+
|
|
9
|
+
| Concept | Description |
|
|
10
|
+
|---------|-------------|
|
|
11
|
+
| **Worker** | A running CLI process, registered via a PID file in `~/.codebuddy/sessions/` |
|
|
12
|
+
| **Daemon** | A background resident HTTP service process (`--serve` mode), managed via `daemon start` |
|
|
13
|
+
| **Background Session (bg)** | A non-interactive task started with `--bg`, with output automatically logged to a file |
|
|
14
|
+
|
|
15
|
+
## Daemon Management
|
|
16
|
+
|
|
17
|
+
### Starting the Daemon
|
|
18
|
+
|
|
19
|
+
```bash
|
|
20
|
+
# Start the daemon (runs in background, auto-assigns port)
|
|
21
|
+
codebuddy daemon start
|
|
22
|
+
|
|
23
|
+
# Specify a port
|
|
24
|
+
codebuddy daemon start --port 8080
|
|
25
|
+
|
|
26
|
+
# Specify bind address (allow remote access)
|
|
27
|
+
codebuddy daemon start --host 0.0.0.0
|
|
28
|
+
```
|
|
29
|
+
|
|
30
|
+
Once started, the daemon runs as a detached process and the parent process exits immediately. Local addresses have password-free access by default; non-local addresses automatically enable password authentication.
|
|
31
|
+
|
|
32
|
+
> **Idempotent startup**: Running `daemon start` multiple times does not create multiple daemons. If a daemon is already running, it returns the existing daemon's information.
|
|
33
|
+
|
|
34
|
+
### Checking Status
|
|
35
|
+
|
|
36
|
+
```bash
|
|
37
|
+
codebuddy daemon status
|
|
38
|
+
# {"status":"running","pid":12345,"endpoint":"http://127.0.0.1:51862","startedAt":1775498920401}
|
|
39
|
+
```
|
|
40
|
+
|
|
41
|
+
### Stopping / Restarting
|
|
42
|
+
|
|
43
|
+
```bash
|
|
44
|
+
codebuddy daemon stop
|
|
45
|
+
codebuddy daemon restart
|
|
46
|
+
```
|
|
47
|
+
|
|
48
|
+
## Background Sessions
|
|
49
|
+
|
|
50
|
+
### Starting Background Tasks
|
|
51
|
+
|
|
52
|
+
```bash
|
|
53
|
+
# Execute a task in the background
|
|
54
|
+
codebuddy --bg "implement login page"
|
|
55
|
+
|
|
56
|
+
# Specify a name (easier to find)
|
|
57
|
+
codebuddy --bg --name feature-login "implement login page"
|
|
58
|
+
```
|
|
59
|
+
|
|
60
|
+
Background sessions run in `--print -y` mode (no TUI + skip permission confirmations), with stdout/stderr redirected to `~/.codebuddy/logs/{name}.log`.
|
|
61
|
+
|
|
62
|
+
### Process Management Commands
|
|
63
|
+
|
|
64
|
+
```bash
|
|
65
|
+
# List all active Workers
|
|
66
|
+
codebuddy ps
|
|
67
|
+
|
|
68
|
+
# View background session logs
|
|
69
|
+
codebuddy logs feature-login
|
|
70
|
+
|
|
71
|
+
# Follow logs continuously (similar to tail -f)
|
|
72
|
+
codebuddy logs feature-login -f
|
|
73
|
+
|
|
74
|
+
# Attach to a background session
|
|
75
|
+
codebuddy attach feature-login
|
|
76
|
+
|
|
77
|
+
# Kill a background session
|
|
78
|
+
codebuddy kill feature-login
|
|
79
|
+
```
|
|
80
|
+
|
|
81
|
+
## HTTP API
|
|
82
|
+
|
|
83
|
+
All Worker and Daemon management capabilities are exposed via REST APIs. The Web UI Workers page is built on top of these APIs.
|
|
84
|
+
|
|
85
|
+
See the Workers & Daemon section in the [HTTP API documentation](http-api.md) for details.
|
|
86
|
+
|
|
87
|
+
### Examples
|
|
88
|
+
|
|
89
|
+
```bash
|
|
90
|
+
# List all Workers
|
|
91
|
+
curl http://127.0.0.1:8080/api/v1/workers
|
|
92
|
+
|
|
93
|
+
# Start a Daemon
|
|
94
|
+
curl -X POST http://127.0.0.1:8080/api/v1/daemon/start \
|
|
95
|
+
-H "Content-Type: application/json" \
|
|
96
|
+
-d '{"port": 9090}'
|
|
97
|
+
|
|
98
|
+
# View Worker logs (telemetry logs)
|
|
99
|
+
curl "http://127.0.0.1:8080/api/v1/workers/12345/logs?type=telemetry&tail=100"
|
|
100
|
+
|
|
101
|
+
# Kill a Worker
|
|
102
|
+
curl -X DELETE http://127.0.0.1:8080/api/v1/workers/12345
|
|
103
|
+
```
|
|
104
|
+
|
|
105
|
+
## Web UI
|
|
106
|
+
|
|
107
|
+
After starting in `--serve` mode, the Web UI provides three management pages:
|
|
108
|
+
|
|
109
|
+
- **Workers** — Worker process management and Daemon control
|
|
110
|
+
- **Logs** — Standalone log viewer with Worker selection, log type switching, and keyword search
|
|
111
|
+
- **Metrics** — System resource monitoring and per-Worker process-level metrics
|
|
112
|
+
|
|
113
|
+
## Log System
|
|
114
|
+
|
|
115
|
+
The log API supports 4 types, with automatic priority-based selection:
|
|
116
|
+
|
|
117
|
+
| Type | Path | Content | Trigger |
|
|
118
|
+
|------|------|---------|---------|
|
|
119
|
+
| `telemetry` | `~/.codebuddy/logs/{date}/{workspace}.log` | Info/Warn/Error from all modules | Always (default priority) |
|
|
120
|
+
| `process` | `~/.codebuddy/logs/{name}.log` | Process stdout/stderr | bg/daemon only |
|
|
121
|
+
| `debug` | `~/.codebuddy/debug/{sessionId}.txt` | Detailed debug information | Requires `--debug` |
|
|
122
|
+
| `transcript` | `~/.codebuddy/projects/{id}/{sessionId}.jsonl` | Conversation history | Always |
|
|
123
|
+
|
|
124
|
+
## PID File Registry
|
|
125
|
+
|
|
126
|
+
Each CLI process registers a PID file in `~/.codebuddy/sessions/` on startup:
|
|
127
|
+
|
|
128
|
+
```
|
|
129
|
+
~/.codebuddy/sessions/
|
|
130
|
+
├── 12345.json # Local process (PID as filename)
|
|
131
|
+
├── 67890.json # Another local process
|
|
132
|
+
└── manual-abc123.json # Manually added remote Worker
|
|
133
|
+
```
|
|
134
|
+
|
|
135
|
+
PID file contents:
|
|
136
|
+
|
|
137
|
+
```json
|
|
138
|
+
{
|
|
139
|
+
"pid": 12345,
|
|
140
|
+
"sessionId": "interactive-12345",
|
|
141
|
+
"cwd": "/home/user/project",
|
|
142
|
+
"startedAt": 1775498920401,
|
|
143
|
+
"kind": "interactive",
|
|
144
|
+
"url": "http://127.0.0.1:8080",
|
|
145
|
+
"mode": "local",
|
|
146
|
+
"version": "2.78.1",
|
|
147
|
+
"hostname": "my-machine"
|
|
148
|
+
}
|
|
149
|
+
```
|
|
150
|
+
|
|
151
|
+
Process liveness is detected via `kill -0`. Manually added remote Workers are detected via heartbeat timeout (2 minutes).
|
|
152
|
+
|
|
153
|
+
## Environment Variables
|
|
154
|
+
|
|
155
|
+
| Variable | Description |
|
|
156
|
+
|----------|-------------|
|
|
157
|
+
| `CODEBUDDY_SESSION_KIND` | Worker type (interactive / bg / daemon) |
|
|
158
|
+
| `CODEBUDDY_SESSION_NAME` | Background session display name |
|
|
159
|
+
| `CODEBUDDY_SESSION_LOG` | Background session log path |
|
|
160
|
+
| `CODEBUDDY_GATEWAY_AUTH` | Authentication mode (none / password) |
|
|
161
|
+
|
|
162
|
+
## Use Cases
|
|
163
|
+
|
|
164
|
+
### Persistent Development Server
|
|
165
|
+
|
|
166
|
+
Start a daemon once during daily development, then interact with the AI anytime through the browser or API without opening a terminal each time.
|
|
167
|
+
|
|
168
|
+
```bash
|
|
169
|
+
codebuddy daemon start --port 8080
|
|
170
|
+
# Open http://127.0.0.1:8080 in your browser
|
|
171
|
+
# The service keeps running after closing the terminal
|
|
172
|
+
```
|
|
173
|
+
|
|
174
|
+
### CI/CD Automation Backend
|
|
175
|
+
|
|
176
|
+
Start a daemon in a CI pipeline as an Agent service, and have other steps call it via HTTP API for code reviews, test generation, and other tasks.
|
|
177
|
+
|
|
178
|
+
```bash
|
|
179
|
+
# CI startup
|
|
180
|
+
codebuddy daemon start --port 9090
|
|
181
|
+
|
|
182
|
+
# Other CI steps call the API
|
|
183
|
+
curl -X POST http://127.0.0.1:9090/api/v1/runs \
|
|
184
|
+
-H "Content-Type: application/json" \
|
|
185
|
+
-d '{"prompt": "Review the code changes in this PR"}'
|
|
186
|
+
```
|
|
187
|
+
|
|
188
|
+
### Shared Agent for Teams
|
|
189
|
+
|
|
190
|
+
Start a daemon on a development machine bound to a LAN address, allowing team members to share the same Agent environment through the Web UI.
|
|
191
|
+
|
|
192
|
+
```bash
|
|
193
|
+
codebuddy daemon start --host 0.0.0.0 --port 8080
|
|
194
|
+
# Colleagues access http://192.168.1.100:8080
|
|
195
|
+
```
|
|
196
|
+
|
|
197
|
+
### Batch Background Tasks
|
|
198
|
+
|
|
199
|
+
Use `--bg` to start multiple background sessions for different tasks simultaneously, and manage them with `ps`/`logs`/`kill`.
|
|
200
|
+
|
|
201
|
+
```bash
|
|
202
|
+
codebuddy --bg --name "refactor-auth" "refactor the auth module"
|
|
203
|
+
codebuddy --bg --name "add-tests" "add unit tests for the utils directory"
|
|
204
|
+
codebuddy --bg --name "fix-types" "fix all TypeScript type errors"
|
|
205
|
+
|
|
206
|
+
# Check progress
|
|
207
|
+
codebuddy ps
|
|
208
|
+
codebuddy logs refactor-auth
|
|
209
|
+
```
|
|
210
|
+
|
|
211
|
+
### WeChat/WeCom Bot Backend
|
|
212
|
+
|
|
213
|
+
Run the daemon as a persistent backend service for a chatbot, receiving messages through long-lived connections.
|
|
214
|
+
|
|
215
|
+
```bash
|
|
216
|
+
codebuddy daemon start
|
|
217
|
+
# Connect to WeChat/WeCom channels via the remote control feature
|
|
218
|
+
```
|
|
219
|
+
|
|
220
|
+
### IDE Extension Backend
|
|
221
|
+
|
|
222
|
+
IDE plugins connect to the daemon via the ACP protocol, providing AI-assisted programming without restarting the CLI process each time the IDE is opened.
|
|
223
|
+
|
|
224
|
+
## Difference from --serve
|
|
225
|
+
|
|
226
|
+
| Feature | `--serve` | `daemon start` |
|
|
227
|
+
|---------|-----------|-----------------|
|
|
228
|
+
| Lifecycle | Tied to terminal, exits when terminal closes | Background resident, independent of terminal |
|
|
229
|
+
| Startup | Runs in foreground | Forks a detached child process |
|
|
230
|
+
| Management | Stop with Ctrl+C | `daemon stop/status/restart` |
|
|
231
|
+
| Multiple starts | Creates a new process each time | Idempotent, maintains only one daemon |
|
|
232
|
+
| Typical use | Temporary development/debugging | Long-running service |
|
|
@@ -54,11 +54,14 @@ CodeBuddy Code supports environment variables to control its behavior. These var
|
|
|
54
54
|
|---------|------|
|
|
55
55
|
| `CODEBUDDY_DISABLE_HOT_RELOAD` | Set to `1` to disable the hot reload system |
|
|
56
56
|
| `CODEBUDDY_SKIP_BUILTIN_MARKETPLACE` | Set to `1` to skip loading the built-in plugin marketplace |
|
|
57
|
+
| `CODEBUDDY_AUTO_UPDATE_THIRD_PARTY_MARKETPLACES` | Set to `true` or `1` to enable automatic updates for third-party plugin marketplaces (default: disabled) |
|
|
58
|
+
| `CODEBUDDY_PLUGIN_DIRS` | Colon-separated list of local plugin directory paths (equivalent to `--plugin-dir`). The `bin/` directory of each plugin is automatically injected into `PATH` |
|
|
57
59
|
| `CODEBUDDY_IMAGE_GEN_ENABLED` | Set to `false` or `0` to disable image generation |
|
|
58
60
|
| `CODEBUDDY_IMAGE_EDIT_ENABLED` | Set to `false` or `0` to disable image editing |
|
|
59
61
|
| `CODEBUDDY_DEFER_TOOL_LOADING` | Set to `false` or `0` to disable MCP tool deferred loading |
|
|
60
62
|
| `CODEBUDDY_SHOW_ALL_DEFERRED_TOOLS` | Set to `true` or `1` to show full descriptions for all deferred tools |
|
|
61
63
|
| `CODEBUDDY_DISABLE_CRON` | Set to `1` to disable scheduled tasks |
|
|
64
|
+
| `CODEBUDDY_REHYDRATE_IMAGE_BLOB_REFS` | Set to `true` to rehydrate image blob references to full base64 data in `-p` mode streaming output. Useful for downstream integrations that need direct access to image data |
|
|
62
65
|
|
|
63
66
|
## Context and Memory
|
|
64
67
|
|
|
@@ -346,7 +346,7 @@ codebuddy-prod:
|
|
|
346
346
|
|
|
347
347
|
## Reference Resources
|
|
348
348
|
|
|
349
|
-
- [CodeBuddy Code Official Documentation](
|
|
349
|
+
- [CodeBuddy Code Official Documentation](./README.md)
|
|
350
350
|
- [CLI Reference](cli-reference.md)
|
|
351
351
|
- [Settings Configuration](settings.md)
|
|
352
352
|
- [Common Workflows](common-workflows.md)
|
|
@@ -85,7 +85,7 @@ All `/api/v1/*` endpoints use a unified envelope format:
|
|
|
85
85
|
|--------|----------|-------------|
|
|
86
86
|
| GET | `/api/v1/health` | Health check |
|
|
87
87
|
| GET | `/api/v1/info` | Environment info (version, OS, CWD, etc.) |
|
|
88
|
-
| GET | `/api/v1/metrics` | System resource metrics
|
|
88
|
+
| GET | `/api/v1/metrics` | System resource metrics + instance process metrics |
|
|
89
89
|
| GET | `/api/v1/envs` | Environment variables (aligned with E2B envd) |
|
|
90
90
|
|
|
91
91
|
### Authentication
|
|
@@ -117,9 +117,11 @@ Supported platforms: `generic`, `wecom` (WeCom), `wechat-kf` (WeChat Customer Se
|
|
|
117
117
|
|
|
118
118
|
| Method | Endpoint | Description |
|
|
119
119
|
|--------|----------|-------------|
|
|
120
|
-
| GET | `/api/v1/sessions` | Get session list |
|
|
120
|
+
| GET | `/api/v1/sessions` | Get session list (supports cwd query parameter) |
|
|
121
121
|
| DELETE | `/api/v1/sessions/:id` | Delete session |
|
|
122
122
|
| POST | `/api/v1/sessions/:id/rename` | Rename session |
|
|
123
|
+
| GET | `/api/v1/sessions/across-projects` | ⚠️ Deprecated, use `GET /api/v1/sessions?cwd=*` instead |
|
|
124
|
+
| GET | `/api/v1/sessions/workspaces` | ⚠️ Deprecated |
|
|
123
125
|
|
|
124
126
|
### PTY (Terminal)
|
|
125
127
|
|
|
@@ -134,13 +136,33 @@ Supported platforms: `generic`, `wecom` (WeCom), `wechat-kf` (WeChat Customer Se
|
|
|
134
136
|
| POST | `/api/v1/pty/:id/resize` | Resize PTY (aligned with E2B Process.Update) |
|
|
135
137
|
| WebSocket | `/api/v1/pty/:id/ws` | PTY bidirectional data transport (legacy compatible) |
|
|
136
138
|
|
|
137
|
-
###
|
|
139
|
+
### Workers & Daemon
|
|
140
|
+
|
|
141
|
+
A Worker is a running CLI process (interactive / bg / daemon), managed through a PID file registry.
|
|
138
142
|
|
|
139
143
|
| Method | Endpoint | Description |
|
|
140
144
|
|--------|----------|-------------|
|
|
141
|
-
| GET | `/api/v1/
|
|
142
|
-
| POST | `/api/v1/
|
|
143
|
-
|
|
|
145
|
+
| GET | `/api/v1/workers` | Get all active Worker list |
|
|
146
|
+
| POST | `/api/v1/workers` | Manually add remote Worker |
|
|
147
|
+
| GET | `/api/v1/workers/:id` | Get Worker details (by PID or name) |
|
|
148
|
+
| GET | `/api/v1/workers/:id/logs` | Get Worker logs (supports multiple types) |
|
|
149
|
+
| DELETE | `/api/v1/workers/:id` | Terminate Worker process |
|
|
150
|
+
| GET | `/api/v1/daemon/status` | Query Daemon status |
|
|
151
|
+
| POST | `/api/v1/daemon/start` | Start Daemon |
|
|
152
|
+
| POST | `/api/v1/daemon/stop` | Stop Daemon |
|
|
153
|
+
| POST | `/api/v1/daemon/restart` | Restart Daemon |
|
|
154
|
+
|
|
155
|
+
**Workers query parameters**:
|
|
156
|
+
- `?kind=bg` — Filter by type (interactive / bg / daemon / daemon-worker)
|
|
157
|
+
- `?local=true` — Return local Workers only (used for remote proxy calls)
|
|
158
|
+
|
|
159
|
+
**Log type parameters** (`GET /api/v1/workers/:id/logs`):
|
|
160
|
+
- `?type=telemetry` — Telemetry logs (`~/.codebuddy/logs/{date}/`)
|
|
161
|
+
- `?type=process` — Process stdout/stderr (bg/daemon logs)
|
|
162
|
+
- `?type=debug` — Debug logs (`~/.codebuddy/debug/`, requires `--debug`)
|
|
163
|
+
- `?type=transcript` — Conversation history summary
|
|
164
|
+
- `?tail=200` — Return only the last N lines
|
|
165
|
+
- When type is omitted, the best source is automatically selected (telemetry > process > debug > transcript)
|
|
144
166
|
|
|
145
167
|
### Channels (Remote Control)
|
|
146
168
|
|
|
@@ -219,6 +241,31 @@ Aligned with E2B process.proto, mapping gRPC methods to REST endpoints:
|
|
|
219
241
|
| GET | `/api/v1/file-changes/checkpoints` | List checkpoints available for rollback |
|
|
220
242
|
| POST | `/api/v1/file-changes/revert` | Revert file changes or rollback to a checkpoint |
|
|
221
243
|
|
|
244
|
+
### Plugin Management
|
|
245
|
+
|
|
246
|
+
| Method | Endpoint | Description |
|
|
247
|
+
|--------|----------|-------------|
|
|
248
|
+
| GET | `/api/v1/plugins` | List installed plugins |
|
|
249
|
+
| POST | `/api/v1/plugins` | Install plugin |
|
|
250
|
+
| POST | `/api/v1/plugins/validate` | Validate plugin/marketplace manifest file |
|
|
251
|
+
| POST | `/api/v1/plugins/enable` | Enable plugin |
|
|
252
|
+
| POST | `/api/v1/plugins/disable` | Disable plugin |
|
|
253
|
+
| POST | `/api/v1/plugins/uninstall` | Uninstall plugin |
|
|
254
|
+
| GET | `/api/v1/plugins/marketplaces` | List configured plugin marketplaces |
|
|
255
|
+
| POST | `/api/v1/plugins/marketplaces` | Add plugin marketplace |
|
|
256
|
+
| POST | `/api/v1/plugins/marketplaces/browse` | Browse available plugins in marketplace |
|
|
257
|
+
| DELETE | `/api/v1/plugins/marketplaces/:name` | Delete plugin marketplace |
|
|
258
|
+
|
|
259
|
+
### Settings Management
|
|
260
|
+
|
|
261
|
+
| Method | Endpoint | Description |
|
|
262
|
+
|--------|----------|-------------|
|
|
263
|
+
| GET | `/api/v1/settings` | List all settings |
|
|
264
|
+
| GET | `/api/v1/settings/:key` | Get a single setting value |
|
|
265
|
+
| PUT | `/api/v1/settings/:key` | Set a setting value |
|
|
266
|
+
| POST | `/api/v1/settings/:key/items` | Append values to an array-type setting |
|
|
267
|
+
| POST | `/api/v1/settings/:key/remove` | Remove values from an array-type setting |
|
|
268
|
+
|
|
222
269
|
### Task Templates
|
|
223
270
|
|
|
224
271
|
| Method | Endpoint | Description |
|
|
@@ -333,22 +380,40 @@ curl -X POST http://127.0.0.1:8080/api/v1/process/signal/send \
|
|
|
333
380
|
-H "Content-Type: application/json" \
|
|
334
381
|
-d '{"process": {"tag": "my-script"}, "signal": 15}'
|
|
335
382
|
|
|
336
|
-
# System metrics
|
|
383
|
+
# System metrics + instance process metrics
|
|
337
384
|
curl http://127.0.0.1:8080/api/v1/metrics
|
|
385
|
+
# Response: { data: { ts, cpuCount, cpuUsedPct, memTotalMib, memUsedMib, diskUsed, diskTotal, instances: [{ id, cwd, pid, rssMib, heapUsedMib, heapTotalMib, uptimeSeconds, ... }] } }
|
|
338
386
|
```
|
|
339
387
|
|
|
340
388
|
### Session Management
|
|
341
389
|
|
|
342
390
|
```bash
|
|
343
|
-
# Get session list
|
|
391
|
+
# Get session list for the current workspace
|
|
344
392
|
curl http://127.0.0.1:8080/api/v1/sessions
|
|
345
393
|
|
|
394
|
+
# Get session list across all workspaces
|
|
395
|
+
curl http://127.0.0.1:8080/api/v1/sessions?cwd=*
|
|
396
|
+
|
|
397
|
+
# Get session list for a specific working directory
|
|
398
|
+
curl http://127.0.0.1:8080/api/v1/sessions?cwd=/path/to/workspace
|
|
399
|
+
|
|
400
|
+
# Get session list for a specific project (filter by compressed working directory name)
|
|
401
|
+
curl http://127.0.0.1:8080/api/v1/sessions?cwd=*&projectId=workspace-hash
|
|
402
|
+
|
|
346
403
|
# Rename session
|
|
347
404
|
curl -X POST http://127.0.0.1:8080/api/v1/sessions/SESSION_ID/rename \
|
|
348
405
|
-H "Content-Type: application/json" \
|
|
349
406
|
-d '{"name": "Performance Optimization Discussion"}'
|
|
350
407
|
```
|
|
351
408
|
|
|
409
|
+
**cwd query parameter reference**:
|
|
410
|
+
|
|
411
|
+
| cwd Value | Description |
|
|
412
|
+
|-----------|-------------|
|
|
413
|
+
| Not provided | Returns sessions for the current workspace |
|
|
414
|
+
| `*` | Returns sessions across all workspaces |
|
|
415
|
+
| `/path/to/workspace` | Returns sessions for the specified working directory |
|
|
416
|
+
|
|
352
417
|
### File Change Management
|
|
353
418
|
|
|
354
419
|
```bash
|
|
@@ -378,6 +443,77 @@ curl -X POST http://127.0.0.1:8080/api/v1/file-changes/revert \
|
|
|
378
443
|
-d '{}'
|
|
379
444
|
```
|
|
380
445
|
|
|
446
|
+
### Plugin Management
|
|
447
|
+
|
|
448
|
+
```bash
|
|
449
|
+
# List installed plugins
|
|
450
|
+
curl http://127.0.0.1:8080/api/v1/plugins
|
|
451
|
+
|
|
452
|
+
# Install plugin ("name@marketplace" format)
|
|
453
|
+
curl -X POST http://127.0.0.1:8080/api/v1/plugins \
|
|
454
|
+
-H "Content-Type: application/json" \
|
|
455
|
+
-d '{"plugin": "my-plugin@my-marketplace"}'
|
|
456
|
+
|
|
457
|
+
# Enable plugin
|
|
458
|
+
curl -X POST http://127.0.0.1:8080/api/v1/plugins/enable \
|
|
459
|
+
-H "Content-Type: application/json" \
|
|
460
|
+
-d '{"plugin": "my-plugin@my-marketplace"}'
|
|
461
|
+
|
|
462
|
+
# Disable plugin
|
|
463
|
+
curl -X POST http://127.0.0.1:8080/api/v1/plugins/disable \
|
|
464
|
+
-H "Content-Type: application/json" \
|
|
465
|
+
-d '{"plugin": "my-plugin@my-marketplace"}'
|
|
466
|
+
|
|
467
|
+
# Uninstall plugin
|
|
468
|
+
curl -X POST http://127.0.0.1:8080/api/v1/plugins/uninstall \
|
|
469
|
+
-H "Content-Type: application/json" \
|
|
470
|
+
-d '{"plugin": "my-plugin@my-marketplace"}'
|
|
471
|
+
|
|
472
|
+
# List plugin marketplaces
|
|
473
|
+
curl http://127.0.0.1:8080/api/v1/plugins/marketplaces
|
|
474
|
+
|
|
475
|
+
# Add plugin marketplace
|
|
476
|
+
curl -X POST http://127.0.0.1:8080/api/v1/plugins/marketplaces \
|
|
477
|
+
-H "Content-Type: application/json" \
|
|
478
|
+
-d '{"source": "https://example.com/marketplace", "name": "my-marketplace"}'
|
|
479
|
+
|
|
480
|
+
# Browse plugins in marketplace
|
|
481
|
+
curl -X POST http://127.0.0.1:8080/api/v1/plugins/marketplaces/browse \
|
|
482
|
+
-H "Content-Type: application/json" \
|
|
483
|
+
-d '{"marketplace": "my-marketplace"}'
|
|
484
|
+
|
|
485
|
+
# Delete plugin marketplace
|
|
486
|
+
curl -X DELETE http://127.0.0.1:8080/api/v1/plugins/marketplaces/my-marketplace
|
|
487
|
+
```
|
|
488
|
+
|
|
489
|
+
### Settings Management
|
|
490
|
+
|
|
491
|
+
```bash
|
|
492
|
+
# List all settings
|
|
493
|
+
curl http://127.0.0.1:8080/api/v1/settings
|
|
494
|
+
|
|
495
|
+
# List settings by scope
|
|
496
|
+
curl "http://127.0.0.1:8080/api/v1/settings?scope=user"
|
|
497
|
+
|
|
498
|
+
# Get a single setting
|
|
499
|
+
curl http://127.0.0.1:8080/api/v1/settings/model
|
|
500
|
+
|
|
501
|
+
# Set a setting value
|
|
502
|
+
curl -X PUT http://127.0.0.1:8080/api/v1/settings/theme \
|
|
503
|
+
-H "Content-Type: application/json" \
|
|
504
|
+
-d '{"value": "dark"}'
|
|
505
|
+
|
|
506
|
+
# Append values to an array-type setting
|
|
507
|
+
curl -X POST http://127.0.0.1:8080/api/v1/settings/permissions/items \
|
|
508
|
+
-H "Content-Type: application/json" \
|
|
509
|
+
-d '{"values": ["Allow: Read(**)"]}'
|
|
510
|
+
|
|
511
|
+
# Remove values from an array-type setting
|
|
512
|
+
curl -X POST http://127.0.0.1:8080/api/v1/settings/permissions/remove \
|
|
513
|
+
-H "Content-Type: application/json" \
|
|
514
|
+
-d '{"values": ["Allow: Read(**)"]}'
|
|
515
|
+
```
|
|
516
|
+
|
|
381
517
|
## Error Codes
|
|
382
518
|
|
|
383
519
|
| Error Code | HTTP Status | Description |
|
|
@@ -241,7 +241,7 @@ Having issues? We're here to support you:
|
|
|
241
241
|
|
|
242
242
|
- 🐛 [Submit a Bug](https://cnb.cool/codebuddy/codebuddy-code/-/issues)
|
|
243
243
|
- 📧 Technical Support: codebuddy@tencent.com
|
|
244
|
-
- 📚 [Complete Documentation](
|
|
244
|
+
- 📚 [Complete Documentation](./README.md)
|
|
245
245
|
- 🌐 [Official Website](https://copilot.tencent.com/cli)
|
|
246
246
|
|
|
247
247
|
---
|
|
@@ -9,7 +9,7 @@ Release Notes document user-visible changes in each version, including:
|
|
|
9
9
|
- Improvements
|
|
10
10
|
- Bug Fixes
|
|
11
11
|
|
|
12
|
-
Difference from
|
|
12
|
+
Difference from CHANGELOG.md:
|
|
13
13
|
- **Release Notes**: User-facing, emphasizing feature value and user experience
|
|
14
14
|
- **CHANGELOG**: Developer-facing, recording technical details and code changes
|
|
15
15
|
|
|
@@ -17,6 +17,11 @@ Difference from [CHANGELOG.md](../../CHANGELOG.md):
|
|
|
17
17
|
|
|
18
18
|
<!-- New versions are automatically added here -->
|
|
19
19
|
|
|
20
|
+
- [v2.79.0](./v2.79.0.md) - 2026-04-07
|
|
21
|
+
- [v2.78.1](./v2.78.1.md) - 2026-04-05
|
|
22
|
+
- [v2.78.0](./v2.78.0.md) - 2026-04-05
|
|
23
|
+
- [v2.77.1](./v2.77.1.md) - 2026-04-04
|
|
24
|
+
- [v2.77.0](./v2.77.0.md) - 2026-04-03
|
|
20
25
|
- [v2.76.0](./v2.76.0.md) - 2026-04-03
|
|
21
26
|
- [v2.75.0](./v2.75.0.md) - 2026-04-03
|
|
22
27
|
- [v2.74.0](./v2.74.0.md) - 2026-04-03
|