@tencent-ai/codebuddy-code 2.71.1 → 2.72.0-next.6c5fd20.20260402
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/CHANGELOG.md +19 -0
- package/dist/codebuddy-headless.js +45 -15
- package/dist/codebuddy.js +64 -34
- package/dist/web-ui/assets/devopicons-QN4QXivI.woff2 +0 -0
- package/dist/web-ui/assets/file-icons-C0jOugUK.woff2 +0 -0
- package/dist/web-ui/assets/{index-Dhp52UPr.js → index-BC_Bh2yt.js} +156 -139
- package/dist/web-ui/assets/index-D4u5xYjh.css +32 -0
- package/dist/web-ui/assets/{markdown-BCtMzQ91.js → markdown-Ce2Umeb2.js} +1 -1
- package/dist/web-ui/assets/mfixx-CpAhKOZz.woff2 +0 -0
- package/dist/web-ui/assets/octicons-CaZ_fok2.woff2 +0 -0
- package/dist/web-ui/assets/{vendor-C4-dOWG8.js → vendor-DpYitQz5.js} +1 -1
- package/dist/web-ui/docs/cn/cli/http-api.md +401 -0
- package/dist/web-ui/docs/cn/cli/release-notes/README.md +5 -0
- package/dist/web-ui/docs/cn/cli/release-notes/v2.69.0.md +24 -0
- package/dist/web-ui/docs/cn/cli/release-notes/v2.70.0.md +16 -0
- package/dist/web-ui/docs/cn/cli/release-notes/v2.70.1.md +18 -0
- package/dist/web-ui/docs/cn/cli/release-notes/v2.71.0.md +18 -0
- package/dist/web-ui/docs/cn/cli/release-notes/v2.71.1.md +7 -0
- package/dist/web-ui/docs/cn/cli/remote-control.md +2 -2
- package/dist/web-ui/docs/cn/cli/slash-commands.md +5 -5
- package/dist/web-ui/docs/en/cli/http-api.md +401 -0
- package/dist/web-ui/docs/en/cli/release-notes/README.md +5 -0
- package/dist/web-ui/docs/en/cli/release-notes/v2.69.0.md +24 -0
- package/dist/web-ui/docs/en/cli/release-notes/v2.70.0.md +16 -0
- package/dist/web-ui/docs/en/cli/release-notes/v2.70.1.md +18 -0
- package/dist/web-ui/docs/en/cli/release-notes/v2.71.0.md +18 -0
- package/dist/web-ui/docs/en/cli/release-notes/v2.71.1.md +7 -0
- package/dist/web-ui/docs/en/cli/remote-control.md +2 -2
- package/dist/web-ui/docs/en/cli/slash-commands.md +6 -6
- package/dist/web-ui/docs/search-index-en.json +1 -1
- package/dist/web-ui/docs/search-index-zh.json +1 -1
- package/dist/web-ui/docs/sidebar-en.json +1 -1
- package/dist/web-ui/docs/sidebar-zh.json +1 -1
- package/dist/web-ui/index.html +4 -4
- package/package.json +3 -2
- package/product.cloudhosted.json +2 -2
- package/product.internal.json +2 -2
- package/product.ioa.json +2 -2
- package/product.json +2 -2
- package/product.selfhosted.json +2 -2
- package/dist/web-ui/assets/devopicons-JYBX4xNv.woff2 +0 -0
- package/dist/web-ui/assets/file-icons-Byv9wKV-.woff2 +0 -0
- package/dist/web-ui/assets/index-B_bIdgkW.css +0 -32
- package/dist/web-ui/assets/mfixx-DfQCz-aF.woff2 +0 -0
- package/dist/web-ui/assets/octicons-CS-gsnb3.woff2 +0 -0
|
@@ -0,0 +1,401 @@
|
|
|
1
|
+
# CodeBuddy Code HTTP API <sup>Beta</sup>
|
|
2
|
+
|
|
3
|
+
> **Beta**: This API is in Beta. Interfaces may be adjusted. Feedback is welcome.
|
|
4
|
+
|
|
5
|
+
CodeBuddy Code provides two public interface sets for developers building Agent applications:
|
|
6
|
+
|
|
7
|
+
- **REST API** (`/api/v1/*`) — Stateless HTTP request/response, suitable for webhook integration, management operations, and simple queries
|
|
8
|
+
- **ACP** (`/api/v1/acp`) — Stateful streaming protocol (JSON-RPC over SSE), suitable for building full Agent client applications
|
|
9
|
+
|
|
10
|
+
## Quick Start
|
|
11
|
+
|
|
12
|
+
### Starting the HTTP Service
|
|
13
|
+
|
|
14
|
+
```bash
|
|
15
|
+
codebuddy --serve --port 8080 --session-id my-session
|
|
16
|
+
```
|
|
17
|
+
|
|
18
|
+
### API Documentation (Swagger UI)
|
|
19
|
+
|
|
20
|
+
Once the service is running, visit:
|
|
21
|
+
|
|
22
|
+
- **Interactive docs**: `http://127.0.0.1:8080/api/docs`
|
|
23
|
+
- **OpenAPI spec**: `http://127.0.0.1:8080/api/openapi.json`
|
|
24
|
+
|
|
25
|
+
Swagger UI provides an interactive testing interface for all public endpoints.
|
|
26
|
+
|
|
27
|
+
### Verify the Service
|
|
28
|
+
|
|
29
|
+
```bash
|
|
30
|
+
curl http://127.0.0.1:8080/api/v1/health
|
|
31
|
+
# {"data":{"status":"ok","uptime":12.3,"platforms":["generic","wecom","wechat-kf"]}}
|
|
32
|
+
```
|
|
33
|
+
|
|
34
|
+
## API Layers
|
|
35
|
+
|
|
36
|
+
| Layer | Route Prefix | Compatibility Promise | Description |
|
|
37
|
+
|-------|-------------|----------------------|-------------|
|
|
38
|
+
| **Public REST API** | `/api/v1/*` | Semantic versioning, no breaking changes | Covered in this document |
|
|
39
|
+
| **Public ACP Protocol** | `/api/v1/acp` | Follows ACP specification | Full conversation capabilities, see [ACP Documentation](https://agentclientprotocol.com) |
|
|
40
|
+
| **Internal RPC** | `/internal/*` | No compatibility guarantee | For internal CLI use, not publicly available |
|
|
41
|
+
|
|
42
|
+
## Authentication
|
|
43
|
+
|
|
44
|
+
Two modes are supported (controlled by environment variable `CODEBUDDY_GATEWAY_AUTH`):
|
|
45
|
+
|
|
46
|
+
| Mode | Value | Description |
|
|
47
|
+
|------|-------|-------------|
|
|
48
|
+
| No authentication | `none` (default) | For local development, no authentication required |
|
|
49
|
+
| Password authentication | `password` | Automatically enabled for remote access |
|
|
50
|
+
|
|
51
|
+
Password authentication supports the following methods (any one passing is sufficient):
|
|
52
|
+
|
|
53
|
+
```bash
|
|
54
|
+
# Bearer Token
|
|
55
|
+
curl -H "Authorization: Bearer YOUR_PASSWORD" http://host:port/api/v1/sessions
|
|
56
|
+
|
|
57
|
+
# URL parameter
|
|
58
|
+
curl http://host:port/api/v1/sessions?password=YOUR_PASSWORD
|
|
59
|
+
```
|
|
60
|
+
|
|
61
|
+
## Response Format
|
|
62
|
+
|
|
63
|
+
All `/api/v1/*` endpoints use a unified envelope format:
|
|
64
|
+
|
|
65
|
+
```jsonc
|
|
66
|
+
// Success
|
|
67
|
+
{
|
|
68
|
+
"data": { ... }
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
// Error
|
|
72
|
+
{
|
|
73
|
+
"error": {
|
|
74
|
+
"code": "AUTH_REQUIRED", // Machine-readable error code
|
|
75
|
+
"message": "Authentication required" // Human-readable description
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
```
|
|
79
|
+
|
|
80
|
+
## Endpoint Overview
|
|
81
|
+
|
|
82
|
+
### System
|
|
83
|
+
|
|
84
|
+
| Method | Endpoint | Description |
|
|
85
|
+
|--------|----------|-------------|
|
|
86
|
+
| GET | `/api/v1/health` | Health check |
|
|
87
|
+
| GET | `/api/v1/info` | Environment info (version, OS, CWD, etc.) |
|
|
88
|
+
| GET | `/api/v1/metrics` | System resource metrics (aligned with E2B envd) |
|
|
89
|
+
| GET | `/api/v1/envs` | Environment variables (aligned with E2B envd) |
|
|
90
|
+
|
|
91
|
+
### Authentication
|
|
92
|
+
|
|
93
|
+
| Method | Endpoint | Description |
|
|
94
|
+
|--------|----------|-------------|
|
|
95
|
+
| GET | `/api/v1/auth/status` | Get authentication status |
|
|
96
|
+
| POST | `/api/v1/auth/login` | Password login, returns token |
|
|
97
|
+
|
|
98
|
+
### Runs (Agent Execution)
|
|
99
|
+
|
|
100
|
+
| Method | Endpoint | Description |
|
|
101
|
+
|--------|----------|-------------|
|
|
102
|
+
| POST | `/api/v1/runs` | Initiate Agent execution (async, returns runId) |
|
|
103
|
+
| GET | `/api/v1/runs/:runId` | Query execution status |
|
|
104
|
+
| GET | `/api/v1/runs/:runId/stream` | SSE streaming of execution results |
|
|
105
|
+
| POST | `/api/v1/runs/:runId/cancel` | Cancel execution |
|
|
106
|
+
|
|
107
|
+
### Webhooks (Third-party Platform Integration)
|
|
108
|
+
|
|
109
|
+
| Method | Endpoint | Description |
|
|
110
|
+
|--------|----------|-------------|
|
|
111
|
+
| GET | `/api/v1/webhooks/:platform` | Platform URL verification (WeCom, etc.) |
|
|
112
|
+
| POST | `/api/v1/webhooks/:platform` | Platform message webhook entry |
|
|
113
|
+
|
|
114
|
+
Supported platforms: `generic`, `wecom` (WeCom), `wechat-kf` (WeChat Customer Service)
|
|
115
|
+
|
|
116
|
+
### Sessions
|
|
117
|
+
|
|
118
|
+
| Method | Endpoint | Description |
|
|
119
|
+
|--------|----------|-------------|
|
|
120
|
+
| GET | `/api/v1/sessions` | Get session list |
|
|
121
|
+
| DELETE | `/api/v1/sessions/:id` | Delete session |
|
|
122
|
+
| POST | `/api/v1/sessions/:id/rename` | Rename session |
|
|
123
|
+
|
|
124
|
+
### PTY (Terminal)
|
|
125
|
+
|
|
126
|
+
| Method | Endpoint | Description |
|
|
127
|
+
|--------|----------|-------------|
|
|
128
|
+
| POST | `/api/v1/pty` | Create PTY session |
|
|
129
|
+
| GET | `/api/v1/pty` | List PTY sessions |
|
|
130
|
+
| GET | `/api/v1/pty/:id` | Query PTY session |
|
|
131
|
+
| DELETE | `/api/v1/pty/:id` | Destroy PTY session |
|
|
132
|
+
| GET | `/api/v1/pty/:id/output` | SSE streaming of PTY output (replaces WebSocket) |
|
|
133
|
+
| POST | `/api/v1/pty/:id/input/send` | Send PTY input (aligned with E2B Process.SendInput) |
|
|
134
|
+
| POST | `/api/v1/pty/:id/resize` | Resize PTY (aligned with E2B Process.Update) |
|
|
135
|
+
| WebSocket | `/api/v1/pty/:id/ws` | PTY bidirectional data transport (legacy compatible) |
|
|
136
|
+
|
|
137
|
+
### Instances
|
|
138
|
+
|
|
139
|
+
| Method | Endpoint | Description |
|
|
140
|
+
|--------|----------|-------------|
|
|
141
|
+
| GET | `/api/v1/instances` | Get instance list |
|
|
142
|
+
| POST | `/api/v1/instances` | Add remote instance |
|
|
143
|
+
| DELETE | `/api/v1/instances/:id` | Delete instance |
|
|
144
|
+
|
|
145
|
+
### Channels (Remote Control)
|
|
146
|
+
|
|
147
|
+
| Method | Endpoint | Description |
|
|
148
|
+
|--------|----------|-------------|
|
|
149
|
+
| GET | `/api/v1/channels` | Get client list |
|
|
150
|
+
| POST | `/api/v1/channels/:type/:id/start` | Start client |
|
|
151
|
+
| POST | `/api/v1/channels/:type/:id/stop` | Stop client |
|
|
152
|
+
| POST | `/api/v1/channels/wechat` | Create WeChat instance |
|
|
153
|
+
| POST | `/api/v1/channels/wecom` | Create WeCom instance |
|
|
154
|
+
|
|
155
|
+
### Filesystem (E2B Compatible)
|
|
156
|
+
|
|
157
|
+
File content operations (aligned with E2B envd HTTP endpoints):
|
|
158
|
+
|
|
159
|
+
| Method | Endpoint | Description |
|
|
160
|
+
|--------|----------|-------------|
|
|
161
|
+
| GET | `/api/v1/files/download?path=...` | Download file (aligned with E2B envd GET /files) |
|
|
162
|
+
| POST | `/api/v1/files/upload?path=...` | Upload file (aligned with E2B envd POST /files) |
|
|
163
|
+
| POST | `/api/v1/files/compose` | Compose multiple files (aligned with E2B envd POST /files/compose) |
|
|
164
|
+
|
|
165
|
+
File operations (aligned with E2B filesystem.proto):
|
|
166
|
+
|
|
167
|
+
| Method | Endpoint | Description |
|
|
168
|
+
|--------|----------|-------------|
|
|
169
|
+
| POST | `/api/v1/fs/stat` | Get file/directory info (aligned with Filesystem.Stat) |
|
|
170
|
+
| POST | `/api/v1/fs/list` | List directory contents (aligned with Filesystem.ListDir) |
|
|
171
|
+
| POST | `/api/v1/fs/mkdir` | Create directory (aligned with Filesystem.MakeDir) |
|
|
172
|
+
| POST | `/api/v1/fs/remove` | Remove file/directory (aligned with Filesystem.Remove) |
|
|
173
|
+
| POST | `/api/v1/fs/move` | Move/rename (aligned with Filesystem.Move) |
|
|
174
|
+
|
|
175
|
+
File watching (aligned with E2B filesystem.proto):
|
|
176
|
+
|
|
177
|
+
| Method | Endpoint | Description |
|
|
178
|
+
|--------|----------|-------------|
|
|
179
|
+
| POST | `/api/v1/fs/watch` | Streaming directory watch SSE (aligned with Filesystem.WatchDir) |
|
|
180
|
+
| POST | `/api/v1/fs/watcher/create` | Create watcher (aligned with Filesystem.CreateWatcher) |
|
|
181
|
+
| POST | `/api/v1/fs/watcher/events` | Get watcher events (aligned with Filesystem.GetWatcherEvents) |
|
|
182
|
+
| POST | `/api/v1/fs/watcher/remove` | Remove watcher (aligned with Filesystem.RemoveWatcher) |
|
|
183
|
+
|
|
184
|
+
CBC enhancements:
|
|
185
|
+
|
|
186
|
+
| Method | Endpoint | Description |
|
|
187
|
+
|--------|----------|-------------|
|
|
188
|
+
| GET | `/api/v1/fs/search?query=...` | Fuzzy file search (based on ripgrep, no E2B equivalent) |
|
|
189
|
+
|
|
190
|
+
### Process Management (E2B Compatible)
|
|
191
|
+
|
|
192
|
+
Aligned with E2B process.proto, mapping gRPC methods to REST endpoints:
|
|
193
|
+
|
|
194
|
+
| Method | Endpoint | Description |
|
|
195
|
+
|--------|----------|-------------|
|
|
196
|
+
| POST | `/api/v1/process/start` | Start process (aligned with Process.Start, supports SSE/JSON) |
|
|
197
|
+
| GET | `/api/v1/process/list` | List running processes (aligned with Process.List) |
|
|
198
|
+
| POST | `/api/v1/process/connect` | Connect to process SSE stream (aligned with Process.Connect) |
|
|
199
|
+
| POST | `/api/v1/process/input/send` | Send stdin (aligned with Process.SendInput) |
|
|
200
|
+
| POST | `/api/v1/process/input/stream` | Stream stdin (aligned with Process.StreamInput) |
|
|
201
|
+
| POST | `/api/v1/process/signal/send` | Send signal (aligned with Process.SendSignal) |
|
|
202
|
+
| POST | `/api/v1/process/stdin/close` | Close stdin (aligned with Process.CloseStdin) |
|
|
203
|
+
| POST | `/api/v1/process/update` | Update process config such as PTY resize (aligned with Process.Update) |
|
|
204
|
+
|
|
205
|
+
### ACP (Agent Client Protocol)
|
|
206
|
+
|
|
207
|
+
| Method | Endpoint | Description |
|
|
208
|
+
|--------|----------|-------------|
|
|
209
|
+
| POST | `/api/v1/acp/connect` | Establish ACP connection, returns connectionId and sessionToken |
|
|
210
|
+
| GET | `/api/v1/acp` | SSE notification subscription (requires acp-connection-id Header) |
|
|
211
|
+
| POST | `/api/v1/acp` | Send JSON-RPC requests (newSession, prompt, cancelRun, etc.) |
|
|
212
|
+
| DELETE | `/api/v1/acp` | Disconnect |
|
|
213
|
+
|
|
214
|
+
### File Changes (Checkpoint)
|
|
215
|
+
|
|
216
|
+
| Method | Endpoint | Description |
|
|
217
|
+
|--------|----------|-------------|
|
|
218
|
+
| GET | `/api/v1/file-changes/diff?path=...` | Get diff content for a single file |
|
|
219
|
+
| GET | `/api/v1/file-changes/checkpoints` | List checkpoints available for rollback |
|
|
220
|
+
| POST | `/api/v1/file-changes/revert` | Revert file changes or rollback to a checkpoint |
|
|
221
|
+
|
|
222
|
+
### Task Templates
|
|
223
|
+
|
|
224
|
+
| Method | Endpoint | Description |
|
|
225
|
+
|--------|----------|-------------|
|
|
226
|
+
| GET | `/api/v1/tasks/templates` | Get task templates |
|
|
227
|
+
| POST | `/api/v1/tasks/templates/refresh` | Refresh (trigger AI recommendations) |
|
|
228
|
+
|
|
229
|
+
## Usage Examples
|
|
230
|
+
|
|
231
|
+
### Health Check
|
|
232
|
+
|
|
233
|
+
```bash
|
|
234
|
+
curl http://127.0.0.1:8080/api/v1/health
|
|
235
|
+
```
|
|
236
|
+
|
|
237
|
+
### Initiate Agent Execution
|
|
238
|
+
|
|
239
|
+
```bash
|
|
240
|
+
# Send message
|
|
241
|
+
curl -X POST http://127.0.0.1:8080/api/v1/runs \
|
|
242
|
+
-H "Content-Type: application/json" \
|
|
243
|
+
-d '{"text": "Help me analyze code performance", "sender": {"id": "dev", "name": "Developer"}}'
|
|
244
|
+
|
|
245
|
+
# Response: {"data": {"runId": "uuid-xxx", "status": "accepted"}}
|
|
246
|
+
|
|
247
|
+
# Get results via SSE stream
|
|
248
|
+
curl http://127.0.0.1:8080/api/v1/runs/uuid-xxx/stream
|
|
249
|
+
```
|
|
250
|
+
|
|
251
|
+
### PTY Terminal Management
|
|
252
|
+
|
|
253
|
+
```bash
|
|
254
|
+
# Create terminal
|
|
255
|
+
curl -X POST http://127.0.0.1:8080/api/v1/pty \
|
|
256
|
+
-H "Content-Type: application/json" \
|
|
257
|
+
-d '{"cols": 120, "rows": 40}'
|
|
258
|
+
|
|
259
|
+
# List terminals
|
|
260
|
+
curl http://127.0.0.1:8080/api/v1/pty
|
|
261
|
+
|
|
262
|
+
# SSE streaming output (replaces WebSocket)
|
|
263
|
+
curl http://127.0.0.1:8080/api/v1/pty/SESSION_ID/output
|
|
264
|
+
|
|
265
|
+
# Send input
|
|
266
|
+
curl -X POST http://127.0.0.1:8080/api/v1/pty/SESSION_ID/input/send \
|
|
267
|
+
-H "Content-Type: application/json" \
|
|
268
|
+
-d '{"data": "ls -la\n"}'
|
|
269
|
+
|
|
270
|
+
# Resize
|
|
271
|
+
curl -X POST http://127.0.0.1:8080/api/v1/pty/SESSION_ID/resize \
|
|
272
|
+
-H "Content-Type: application/json" \
|
|
273
|
+
-d '{"cols": 200, "rows": 50}'
|
|
274
|
+
|
|
275
|
+
# Destroy terminal
|
|
276
|
+
curl -X DELETE http://127.0.0.1:8080/api/v1/pty/SESSION_ID
|
|
277
|
+
```
|
|
278
|
+
|
|
279
|
+
### Filesystem Operations (E2B Compatible)
|
|
280
|
+
|
|
281
|
+
```bash
|
|
282
|
+
# Download file
|
|
283
|
+
curl "http://127.0.0.1:8080/api/v1/files/download?path=/tmp/test.txt"
|
|
284
|
+
|
|
285
|
+
# Upload file
|
|
286
|
+
curl -X POST "http://127.0.0.1:8080/api/v1/files/upload?path=/tmp/upload.txt" \
|
|
287
|
+
-H "Content-Type: application/octet-stream" \
|
|
288
|
+
--data-binary @local-file.txt
|
|
289
|
+
|
|
290
|
+
# Get file info
|
|
291
|
+
curl -X POST http://127.0.0.1:8080/api/v1/fs/stat \
|
|
292
|
+
-H "Content-Type: application/json" \
|
|
293
|
+
-d '{"path": "/tmp"}'
|
|
294
|
+
|
|
295
|
+
# List directory
|
|
296
|
+
curl -X POST http://127.0.0.1:8080/api/v1/fs/list \
|
|
297
|
+
-H "Content-Type: application/json" \
|
|
298
|
+
-d '{"path": "/tmp", "depth": 2}'
|
|
299
|
+
|
|
300
|
+
# Create directory
|
|
301
|
+
curl -X POST http://127.0.0.1:8080/api/v1/fs/mkdir \
|
|
302
|
+
-H "Content-Type: application/json" \
|
|
303
|
+
-d '{"path": "/tmp/new-dir"}'
|
|
304
|
+
|
|
305
|
+
# Fuzzy file search (CBC enhancement)
|
|
306
|
+
curl "http://127.0.0.1:8080/api/v1/fs/search?query=component&limit=10"
|
|
307
|
+
```
|
|
308
|
+
|
|
309
|
+
### Process Management (E2B Compatible)
|
|
310
|
+
|
|
311
|
+
```bash
|
|
312
|
+
# Start process (JSON mode)
|
|
313
|
+
curl -X POST http://127.0.0.1:8080/api/v1/process/start \
|
|
314
|
+
-H "Content-Type: application/json" \
|
|
315
|
+
-d '{"process": {"cmd": "python3", "args": ["script.py"]}, "tag": "my-script"}'
|
|
316
|
+
|
|
317
|
+
# Start process (SSE streaming output)
|
|
318
|
+
curl -X POST http://127.0.0.1:8080/api/v1/process/start \
|
|
319
|
+
-H "Content-Type: application/json" \
|
|
320
|
+
-H "Accept: text/event-stream" \
|
|
321
|
+
-d '{"process": {"cmd": "python3", "args": ["script.py"]}}'
|
|
322
|
+
|
|
323
|
+
# List running processes
|
|
324
|
+
curl http://127.0.0.1:8080/api/v1/process/list
|
|
325
|
+
|
|
326
|
+
# Send stdin
|
|
327
|
+
curl -X POST http://127.0.0.1:8080/api/v1/process/input/send \
|
|
328
|
+
-H "Content-Type: application/json" \
|
|
329
|
+
-d '{"process": {"pid": 12345}, "input": {"stdin": "hello\n"}}'
|
|
330
|
+
|
|
331
|
+
# Send signal (SIGTERM)
|
|
332
|
+
curl -X POST http://127.0.0.1:8080/api/v1/process/signal/send \
|
|
333
|
+
-H "Content-Type: application/json" \
|
|
334
|
+
-d '{"process": {"tag": "my-script"}, "signal": 15}'
|
|
335
|
+
|
|
336
|
+
# System metrics
|
|
337
|
+
curl http://127.0.0.1:8080/api/v1/metrics
|
|
338
|
+
```
|
|
339
|
+
|
|
340
|
+
### Session Management
|
|
341
|
+
|
|
342
|
+
```bash
|
|
343
|
+
# Get session list
|
|
344
|
+
curl http://127.0.0.1:8080/api/v1/sessions
|
|
345
|
+
|
|
346
|
+
# Rename session
|
|
347
|
+
curl -X POST http://127.0.0.1:8080/api/v1/sessions/SESSION_ID/rename \
|
|
348
|
+
-H "Content-Type: application/json" \
|
|
349
|
+
-d '{"name": "Performance Optimization Discussion"}'
|
|
350
|
+
```
|
|
351
|
+
|
|
352
|
+
### File Change Management
|
|
353
|
+
|
|
354
|
+
```bash
|
|
355
|
+
# Get file diff (requires file to be tracked in a checkpoint)
|
|
356
|
+
curl "http://127.0.0.1:8080/api/v1/file-changes/diff?path=/path/to/file.ts"
|
|
357
|
+
# Response: {"path": "/path/to/file.ts", "oldText": "...", "newText": "..."}
|
|
358
|
+
|
|
359
|
+
# List checkpoints available for rollback
|
|
360
|
+
curl http://127.0.0.1:8080/api/v1/file-changes/checkpoints
|
|
361
|
+
# Response: {"checkpoints": [{"id": "xxx", "label": "...", "createdAt": 1234567890, "files": [...], "additions": 5, "deletions": 2}]}
|
|
362
|
+
|
|
363
|
+
# Revert changes by file
|
|
364
|
+
curl -X POST http://127.0.0.1:8080/api/v1/file-changes/revert \
|
|
365
|
+
-H "Content-Type: application/json" \
|
|
366
|
+
-d '{"paths": ["/path/to/file.ts"]}'
|
|
367
|
+
# Response: {"success": true, "revertedFiles": ["/path/to/file.ts"]}
|
|
368
|
+
|
|
369
|
+
# Rollback to a specific checkpoint
|
|
370
|
+
curl -X POST http://127.0.0.1:8080/api/v1/file-changes/revert \
|
|
371
|
+
-H "Content-Type: application/json" \
|
|
372
|
+
-d '{"checkpointId": "checkpoint-uuid", "scope": "CodeAndConversation"}'
|
|
373
|
+
# scope options: "Code" (revert files only), "Conversation" (revert conversation only), "CodeAndConversation" (revert all)
|
|
374
|
+
|
|
375
|
+
# Revert all changes (rollback to the earliest checkpoint)
|
|
376
|
+
curl -X POST http://127.0.0.1:8080/api/v1/file-changes/revert \
|
|
377
|
+
-H "Content-Type: application/json" \
|
|
378
|
+
-d '{}'
|
|
379
|
+
```
|
|
380
|
+
|
|
381
|
+
## Error Codes
|
|
382
|
+
|
|
383
|
+
| Error Code | HTTP Status | Description |
|
|
384
|
+
|------------|------------|-------------|
|
|
385
|
+
| `AUTH_REQUIRED` | 401 | Authentication required |
|
|
386
|
+
| `AUTH_INVALID` | 401 | Invalid authentication |
|
|
387
|
+
| `AUTH_RATE_LIMITED` | 429 | Too many login attempts |
|
|
388
|
+
| `NOT_FOUND` | 404 | Resource not found |
|
|
389
|
+
| `BAD_REQUEST` | 400 | Invalid request parameters |
|
|
390
|
+
| `RATE_LIMITED` | 429 | Request rate too high |
|
|
391
|
+
| `INTERNAL_ERROR` | 500 | Internal server error |
|
|
392
|
+
| `SESSION_NOT_FOUND` | 404 | Session not found |
|
|
393
|
+
| `SESSION_DELETE_CURRENT` | 400 | Cannot delete current session |
|
|
394
|
+
| `TERMINAL_NOT_FOUND` | 404 | PTY not found |
|
|
395
|
+
| `PROCESS_NOT_FOUND` | 404 | Process not found |
|
|
396
|
+
| `PATH_REQUIRED` | 400 | Missing path parameter |
|
|
397
|
+
| `PATH_NOT_DIRECTORY` | 400 | Path is not a directory |
|
|
398
|
+
| `INSUFFICIENT_STORAGE` | 507 | Insufficient disk space |
|
|
399
|
+
| `RUN_NOT_FOUND` | 404 | Run not found |
|
|
400
|
+
| `PLATFORM_UNSUPPORTED` | 400 | Unsupported webhook platform |
|
|
401
|
+
| `SIGNATURE_INVALID` | 403 | Signature verification failed |
|
|
@@ -17,6 +17,11 @@ Difference from [CHANGELOG.md](../../CHANGELOG.md):
|
|
|
17
17
|
|
|
18
18
|
<!-- New versions are automatically added here -->
|
|
19
19
|
|
|
20
|
+
- [v2.71.1](./v2.71.1.md) - 2026-04-01
|
|
21
|
+
- [v2.71.0](./v2.71.0.md) - 2026-04-01
|
|
22
|
+
- [v2.70.1](./v2.70.1.md) - 2026-03-31
|
|
23
|
+
- [v2.70.0](./v2.70.0.md) - 2026-03-31
|
|
24
|
+
- [v2.69.0](./v2.69.0.md) - 2026-03-30
|
|
20
25
|
- [v2.68.0](./v2.68.0.md) - 2026-03-30
|
|
21
26
|
- [v2.67.0](./v2.67.0.md) - 2026-03-28
|
|
22
27
|
- [v2.66.2](./v2.66.2.md) - 2026-03-26
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
# CodeBuddy Code v2.69.0 Release
|
|
2
|
+
|
|
3
|
+
## New Features
|
|
4
|
+
|
|
5
|
+
### E2B Compatible API
|
|
6
|
+
|
|
7
|
+
Fully aligned with the E2B open protocol, allowing CodeBuddy Code to be used as an E2B-compatible sandbox environment:
|
|
8
|
+
|
|
9
|
+
- **File System API**: Added `/api/v1/fs/*` and `/api/v1/files/*` endpoints, supporting file read/write, directory operations, file watching, and other comprehensive file system capabilities
|
|
10
|
+
- **Process Management API**: Added `/api/v1/process/*` endpoints, supporting process launching (PTY/pipe), input/output streaming, signal sending, and full lifecycle management
|
|
11
|
+
- **System Metrics & Environment Variables API**: Added `/api/v1/metrics` and `/api/v1/envs` endpoints, providing CPU/memory/disk usage metrics and environment variable queries
|
|
12
|
+
|
|
13
|
+
## Improvements
|
|
14
|
+
|
|
15
|
+
- **PTY Terminal Enhancement**: Added SSE output streaming, HTTP input sending, and HTTP resize endpoints, providing a pure HTTP alternative to WebSocket
|
|
16
|
+
- **Terminal Web UI Refactoring**: Migrated the frontend terminal component from WebSocket to SSE + HTTP communication, improving cross-platform compatibility
|
|
17
|
+
- **Distributed Tracing**: Refactored the trace pipeline based on the Hook mechanism, supporting SDK-passed traceId for end-to-end tracing with automatic child Span creation for each tool call
|
|
18
|
+
- **WeChat Multi-Instance Support**: Enabled simultaneous connections to multiple WeChat bot instances with automatic message routing to the correct client
|
|
19
|
+
- **WeChat Media Messages**: Added support for receiving and sending images, files, voice, and video messages
|
|
20
|
+
- **Chinese Quotation Mark Fix**: Automatically corrects Chinese quotation marks in model output to prevent JSON parsing failures in tool calls
|
|
21
|
+
|
|
22
|
+
## Security Fixes
|
|
23
|
+
|
|
24
|
+
- **WeCom SSRF Protection**: Added URL allowlist validation for WeCom bot media downloads, restricting access to official WeCom CDN domains only to prevent Server-Side Request Forgery attacks
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
# CodeBuddy Code v2.70.0 Release
|
|
2
|
+
|
|
3
|
+
## New Features
|
|
4
|
+
|
|
5
|
+
### Model-Driven Built-in Command Invocation
|
|
6
|
+
|
|
7
|
+
AI models can now directly execute certain built-in slash commands (such as /clear, /model, /config, /resume, /gateway, etc.) through the Skill tool, enabling model-proxied command execution in non-terminal scenarios like WebChat and WeChat without requiring users to manually type slash commands.
|
|
8
|
+
|
|
9
|
+
- Commands like /model, /config, /resume now support a `list` subcommand to display available options in text format
|
|
10
|
+
- The `disableModelInvocation` field provides unified control over whether built-in and custom commands can be invoked by the model
|
|
11
|
+
|
|
12
|
+
## Improvements
|
|
13
|
+
|
|
14
|
+
- **Instance Registration URL Simplification**: Merged localUrl/tunnelUrl into a unified url field, with the backend automatically determining the best reachable address, simplifying configuration
|
|
15
|
+
- **Permission Dialog Stability**: Replaced the useEffect subscription pattern with useSyncExternalStore, completely resolving the race condition that occasionally prevented permission dialogs from appearing
|
|
16
|
+
- **Session Permission Mode Persistence**: Fixed the issue where permission mode was reset when switching sessions in multi-instance scenarios
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
# CodeBuddy Code v2.70.1 Release
|
|
2
|
+
|
|
3
|
+
## Security Fixes
|
|
4
|
+
|
|
5
|
+
### CORS Cross-Origin Attack Protection
|
|
6
|
+
|
|
7
|
+
Fixed a cross-origin request security vulnerability in the local Gateway service (`cbc --serve`). Previously, malicious web pages could use JavaScript to make cross-origin requests to the user's local localhost service, executing Agent commands or stealing output data.
|
|
8
|
+
|
|
9
|
+
Key fixes:
|
|
10
|
+
|
|
11
|
+
- Replaced the framework's default `Access-Control-Allow-Origin: *` with a precise allowlist mechanism, only permitting cross-origin requests from localhost, 127.0.0.1, and Tunnel URLs
|
|
12
|
+
- Added Host header validation middleware to prevent DNS Rebinding attacks
|
|
13
|
+
- Fixed CORS wildcard vulnerability on SSE streaming endpoints
|
|
14
|
+
- Changed the default bind address from `0.0.0.0` to `127.0.0.1` to prevent the service from being exposed to the local network
|
|
15
|
+
|
|
16
|
+
## Improvements
|
|
17
|
+
|
|
18
|
+
- **Custom CORS Rules**: Support configuring allowed cross-origin sources via the `CODEBUDDY_CODE_CORS_ORIGINS` environment variable (comma-separated) or the `gateway.corsOrigins` Settings option, accommodating special use cases
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
# CodeBuddy Code v2.71.0 Release
|
|
2
|
+
|
|
3
|
+
## New Features
|
|
4
|
+
|
|
5
|
+
### Web UI Code Editor
|
|
6
|
+
|
|
7
|
+
The Web UI now includes file browsing and code editing capabilities, allowing you to view and edit project files directly in the browser:
|
|
8
|
+
|
|
9
|
+
- **Directory Tree Navigation**: The left panel displays the project file structure for quick file access
|
|
10
|
+
- **Multi-Tab Editing**: Open multiple files simultaneously and switch freely between tabs
|
|
11
|
+
- **Monaco Editor**: Integrated with the same editor engine as VS Code, with syntax highlighting support
|
|
12
|
+
- **Auto Save**: Edits are automatically saved without manual action
|
|
13
|
+
- **File Drag & Drop**: Support for moving files via drag and drop
|
|
14
|
+
- **Keyboard Shortcuts**: Common keyboard shortcuts supported for improved editing efficiency
|
|
15
|
+
|
|
16
|
+
## Improvements
|
|
17
|
+
|
|
18
|
+
- **Streaming Timeout Optimization**: Increased the default streaming response timeout and first token timeout from 2 minutes to 10 minutes, reducing timeout interruptions during complex tasks caused by slower model responses. Can still be customized via `CODEBUDDY_STREAM_TIMEOUT_MS` and `CODEBUDDY_FIRST_TOKEN_TIMEOUT_MS` environment variables
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
# CodeBuddy Code v2.71.1 Release
|
|
2
|
+
|
|
3
|
+
## Improvements
|
|
4
|
+
|
|
5
|
+
- **SDK MCP Timeout Mechanism**: Replaced fixed timeouts with an AbortSignal cancellation mechanism, supporting long-running MCP tool calls and preventing complex tools from being unexpectedly interrupted by timeouts
|
|
6
|
+
- **Reasoning Model Configuration**: Automatically defaults effort to high when thinking mode is enabled, ensuring the model actually produces reasoning output
|
|
7
|
+
- **Product Configuration Fix**: Corrected a typo in the reasoning field of the model configuration
|
|
@@ -94,7 +94,7 @@ winget install Cloudflare.cloudflared
|
|
|
94
94
|
When `cloudflared` is not installed or the Tunnel fails to start, the Gateway automatically falls back to LAN mode. In this mode, only devices on the same network can access it.
|
|
95
95
|
|
|
96
96
|
- Default listening port: `8321`
|
|
97
|
-
- Listening address: `0.0.0.0`
|
|
97
|
+
- Listening address: `127.0.0.1` by default (localhost only); use `--host 0.0.0.0` to listen on all network interfaces
|
|
98
98
|
|
|
99
99
|
## Security
|
|
100
100
|
|
|
@@ -172,7 +172,7 @@ You can configure Gateway-related options in `~/.codebuddy/settings.json`:
|
|
|
172
172
|
|
|
173
173
|
| Environment Variable | Description |
|
|
174
174
|
|:---------|:-----|
|
|
175
|
-
| `
|
|
175
|
+
| `CODEBUDDY_CODE_CORS_ORIGINS` | Additional allowed CORS origins (comma-separated) |
|
|
176
176
|
|
|
177
177
|
## Instance Management
|
|
178
178
|
|
|
@@ -17,15 +17,15 @@ These commands are used to manage your CodeBuddy Code sessions. Here is the curr
|
|
|
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
19
|
| `/compact`| | ✅ Supported | Compress context. |
|
|
20
|
-
| `/config`| | ✅ Supported | View or modify local configuration
|
|
20
|
+
| `/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. |
|
|
21
21
|
| `/context` | | ✅ Supported | Calculate the context token distribution for the current session. |
|
|
22
22
|
| `/cost` | | ✅ Supported | Display session cost and token usage. |
|
|
23
23
|
| `/init` | | ✅ Supported | Initialize a new CodeBuddy repository. |
|
|
24
24
|
| `/mcp` | | ✅ Supported | Manage MCP connections. |
|
|
25
25
|
| `/memory`| | ✅ Supported | Manage long-term memory |
|
|
26
|
-
| `/model` | `[model-name]` | ✅ Supported | Switch or view the currently used AI model. Opens an interactive selection interface when used without parameters, or directly switches to the specified model when provided with a model name (e.g., `/model gpt-
|
|
27
|
-
| `/model:text-to-image` | `[model-id]` | ✅ Supported | Switch or view the currently used text-to-image model. Opens an interactive selection interface when used without parameters, or directly switches to the specified model when provided with a model ID. |
|
|
28
|
-
| `/model:image-to-image` | `[model-id]` | ✅ Supported | Switch or view the currently used image-to-image model. Opens an interactive selection interface when used without parameters, or directly switches to the specified model when provided with a model ID. |
|
|
26
|
+
| `/model` | `[list \| model-name]` | ✅ Supported | Switch or view the currently used AI model. Opens an interactive selection interface when used without parameters, `list` lists available models, or directly switches to the specified model when provided with a model name (e.g., `/model gpt-4o`). |
|
|
27
|
+
| `/model:text-to-image` | `[list \| model-id]` | ✅ Supported | Switch or view the currently used text-to-image model. Opens an interactive selection interface when used without parameters, `list` lists available models, or directly switches to the specified model when provided with a model ID. |
|
|
28
|
+
| `/model:image-to-image` | `[list \| model-id]` | ✅ Supported | Switch or view the currently used image-to-image model. Opens an interactive selection interface when used without parameters, `list` lists available models, or directly switches to the specified model when provided with a model ID. |
|
|
29
29
|
| `/permissions` | | ✅ Supported | Manage tool permissions and workspace directory access permissions. |
|
|
30
30
|
| `/plan` | | ✅ Supported | Preview the plan file content in the current plan mode. |
|
|
31
31
|
| `/upgrade` | | ✅ Supported | Open the upgrade page in your browser to view premium features and subscription options. |
|
|
@@ -37,7 +37,7 @@ These commands are used to manage your CodeBuddy Code sessions. Here is the curr
|
|
|
37
37
|
| `/theme` | | ✅ Supported | Open the theme selection panel, where you can select and preview different terminal themes (dark, light, colorblind-friendly, ANSI, etc.). |
|
|
38
38
|
| `/export` | | ✅ Supported | Export the current conversation to a file or clipboard. |
|
|
39
39
|
| `/feedback` | | ✅ Supported | Open the feedback page to submit bug reports or feature suggestions. |
|
|
40
|
-
| `/resume` | | ✅ Supported | Resume a previous session. |
|
|
40
|
+
| `/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. |
|
|
41
41
|
| `/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. |
|
|
42
42
|
| `/sandbox` | | ✅ Supported | Manage Bash command sandbox mode and control security policies for command execution. See [Sandbox Documentation](bash-sandboxing.md) for details. |
|
|
43
43
|
| `/stats` | | ✅ Supported | Display usage statistics, including token usage, model invocation counts, session duration, and other detailed data. Supports both overview and per-model classification views. |
|
|
@@ -282,7 +282,7 @@ Specify models for commands that require specific capabilities:
|
|
|
282
282
|
```markdown
|
|
283
283
|
---
|
|
284
284
|
description: "Code complexity analysis"
|
|
285
|
-
model: gemini-3.
|
|
285
|
+
model: gemini-3.1-pro
|
|
286
286
|
---
|
|
287
287
|
|
|
288
288
|
Analyze the complexity of this code...
|