@tencent-ai/agent-sdk 0.3.206 → 0.3.210
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 +61 -0
- package/cli/builtin/workflows/deep-research.workflow.js +77 -20
- package/cli/dist/codebuddy-headless.js +294 -246
- package/cli/dist/web-ui/assets/index-CH6e4vvI.css +32 -0
- package/cli/dist/web-ui/assets/index-GcU4pZms.js +1102 -0
- package/cli/dist/web-ui/index.html +2 -2
- package/cli/dist/web-ui/sw.js +1 -1
- package/cli/package.json +4 -4
- 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/cli/vendor/native-builds.json +18 -0
- package/cli/vendor/shim/broker-ipc-client.cjs +158 -0
- package/cli/vendor/shim/brokered-bin/codebuddy-toybox-dispatch +381 -0
- package/cli/vendor/shim/brokered-sandbox-bash-env.sh +10 -0
- package/cli/vendor/shim/genie-safe-delete.cjs +4 -781
- package/cli/vendor/shim/native/binding.gyp +13 -0
- package/cli/vendor/shim/native/brokered_sandbox_native.c +293 -0
- package/cli/vendor/shim/native/darwin-arm64/brokered-sandbox-native.node +0 -0
- package/cli/vendor/shim/native/darwin-x64/brokered-sandbox-native.node +0 -0
- package/cli/vendor/shim/node-brokered-fs-shim.cjs +932 -0
- package/cli/vendor/shim/node-language-shim.cjs +35 -0
- package/cli/vendor/shim/node-safe-delete-shim.cjs +810 -0
- package/cli/vendor/shim/safe-bin/safe-delete-bash-env.sh +1 -1
- package/cli/vendor/shim/safe-bin/safe-delete-common.sh +95 -34
- package/cli/vendor/shim/safe-delete-broker-delete.cjs +166 -0
- package/cli/vendor/shim/shell-runtime-bash-env.sh +8 -0
- package/cli/vendor/shim/sitecustomize.py +551 -22
- package/cli/vendor/toybox-macos/LICENSE +12 -0
- package/cli/vendor/toybox-macos/toybox +0 -0
- package/cli/vendor/toybox-macos/toybox.sb +19 -0
- package/cli/vendor/zsh-macos/LICENSE +37 -0
- package/cli/vendor/zsh-macos/bin/zsh +0 -0
- package/package.json +1 -1
- package/cli/dist/web-ui/assets/index-BZjhFKbY.js +0 -1051
- package/cli/dist/web-ui/assets/index-C5EhSt3C.css +0 -32
package/cli/CHANGELOG.md
CHANGED
|
@@ -7,6 +7,67 @@ CodeBuddy Code 的所有重要更新都会记录在这里。
|
|
|
7
7
|
|
|
8
8
|
## [未发布]
|
|
9
9
|
|
|
10
|
+
## [2.119.3] - 2026-07-12
|
|
11
|
+
|
|
12
|
+
### 🐛 Bug 修复
|
|
13
|
+
|
|
14
|
+
- **stdio 模式 initialize 不再被慢 MCP 阻塞**:stdio / stream-json 模式下 `initialize` 握手原会被慢 MCP server 拖住(实测 ~10s)。initialize 只需 models/commands/account 元信息,本不该等 MCP readiness。新增 `configReadyDeferred` + `AgentManager.getInitializeMetadata()`,让 initialize 只等配置解析、不等 agent 注册期的 MCP settle。agent 的 MCP 装配与发消息路径保持不变,仍正确等待 MCP。#67435
|
|
15
|
+
- **预热进程 MCP 加载**:修复预热进程激活后,用户级 MCP 配置(`~/.codebuddy/.mcp.json`)在激活前才落盘时无法加载、其工具进不了 ToolSearch 可用工具列表的问题。激活路径现会重读用户级 MCP 配置,确保待命后新增的 MCP server 正常生效。
|
|
16
|
+
- **网络错误重试**:回滚 #59818 的 `isNetworkError` 包装后网络错误识别改动(相关 PR 存在需要重新评估的副作用),恢复到该 PR 合入前的行为。原 issue #53806 需另行修复。
|
|
17
|
+
|
|
18
|
+
## [2.119.2] - 2026-07-12
|
|
19
|
+
|
|
20
|
+
### 🔧 功能改进
|
|
21
|
+
|
|
22
|
+
- **终端自动重连**:WebSocket 断连后按退避序列自动重连,超过最大次数回退到手动重连。
|
|
23
|
+
- **PTY 流控**:基于 ACK 的流量控制机制,防止高输出场景下 WebSocket 缓冲区溢出。
|
|
24
|
+
- **文件树隐藏文件切换**:支持显示/隐藏 .git、node_modules 等常见隐藏文件。
|
|
25
|
+
- **文件树 Git 状态着色**:文件树节点根据 Git 状态(modified/added/deleted 等)显示对应颜色。
|
|
26
|
+
- **文件树实时监听**:通过 SSE watcher 监听文件系统变化自动刷新文件树。
|
|
27
|
+
- **终端链接增强**:点击目录路径自动在文件树中展开,点击文件路径同时打开编辑器并定位文件树。
|
|
28
|
+
- **Folder 隔离存储**:按工作目录隔离 store 持久化(类似 VSCode workspaceStorage)。
|
|
29
|
+
- **心跳容忍优化**:PTY 心跳改为双层容忍,避免系统休眠唤醒后误杀连接。
|
|
30
|
+
- **zsh 提示符修复**:通过 PROMPT_EOL_MARK 环境变量消除首行 % 标记,替代之前的 exec-replace 方案。
|
|
31
|
+
|
|
32
|
+
## [2.119.1] - 2026-07-11
|
|
33
|
+
|
|
34
|
+
### 🐛 Bug 修复
|
|
35
|
+
|
|
36
|
+
- **自定义模型输出额度**:自定义模型未显式配置最大输出 tokens 时,不再把 catalog 的模型能力上限自动作为每次请求额度。#66582
|
|
37
|
+
- **积分消耗提示失真**:修复多轮对话后积分消耗显示不准确的问题,保留 conversationRequestId 直到响应/持久化路径完成消费。
|
|
38
|
+
- **埋点上报**:统一规范整数字段的上报值,避免 Token 等字段包含小数时导致事件上报失败。
|
|
39
|
+
|
|
40
|
+
## [2.119.0] - 2026-07-10
|
|
41
|
+
|
|
42
|
+
### 🎉 新功能
|
|
43
|
+
|
|
44
|
+
- **插件依赖**:支持 `dependencies` 声明、传递安装与启用、semver tag 解析、跨 marketplace allowlist、依赖冲突诊断和孤立依赖清理。
|
|
45
|
+
- **插件缓存**:新安装的 marketplace 统一落到 `plugins/marketplaces/<marketplace>`,启用/安装插件时物化到 `plugins/cache/<marketplace>/<plugin>/<version>` 并写入 `installed_plugins.json`。
|
|
46
|
+
- **插件能力**:支持插件 `bin/` PATH 注入、兼容的 root/data/project 与 `user_config` 环境、持久化 data 生命周期、`settings.json` allowlist、`defaultEnabled` 和完整目录说明;`themes/` 与 `monitors/` 当前仅记录为 experimental 字段,不加载到运行时。
|
|
47
|
+
|
|
48
|
+
### 🔧 功能改进
|
|
49
|
+
|
|
50
|
+
- **Windows 插件性能**:插件 data、MCPB、完整性检查与 Git 探测改用异步文件 I/O,Git/npm 安装不再同步阻塞主线程;MCPB 复用流式 ZIP 解压并将临时归档放入系统临时目录。
|
|
51
|
+
- **Brokered Sandbox Runtime**:为 macOS 沙箱内 Python 和 Node 文件 API 接入 brokered file-token 与 host-op 链路,并新增 Node native addon 支持同步 fs API 消费 sandbox extension token;构建后复用 macOS `codesign-darwin.sh` 签名流程,避免正式发布包遗漏嵌套原生模块签名。
|
|
52
|
+
- **Broker Shell 文件备份**:在 macOS broker shell 的重定向、toybox 写入和 host-op 修改前复用 ModifyBackup 备份链路;并将 `truncate` 纳入 macOS brokered toybox 入口,确保文件截断操作可触发修改前备份链路。
|
|
53
|
+
- **Sandbox Telemetry**:`skipPreExecChecks=true` 下 `ExecPolicy forbidden` 仍会作为安全硬拦在 pre-exec 阶段拒绝命令,并产生 `permissionPath='new'` 与 `reason='forbidden'` 的预期埋点组合。
|
|
54
|
+
- **Deep Research 输出格式化**:Workflow 返回结果从 JSON 结构改为可读的 Markdown 报告,包含摘要、发现、反驳声明和统计信息。
|
|
55
|
+
- **文件撤回防复活**:Web UI 文件变更面板增加 recentlyReverted 机制,防止异步广播将已撤回的文件重新加入列表。
|
|
56
|
+
- **Deferred Tool 解析兼容**:修复 SDK 传入 raw JSON string 时 Zod 校验失败的问题,通过 preprocess 自动解析。
|
|
57
|
+
- **子 Agent 消息隔离**:Detached sub-agent 转发的 usage 消息不再在主对话 UI 中渲染,仅用于 token 消耗追踪。
|
|
58
|
+
- **子 Agent 工具标题前缀**:Web UI 中为子 agent 内部执行的工具调用添加类型前缀显示。
|
|
59
|
+
- **Skill 工具描述优化**:Skill 描述模板增加 deferred tool 优先使用 ToolSearch + DeferExecuteTool 的提示。
|
|
60
|
+
- **Sub-agent 标识修正**:在 sub-agent session 中正确标记 isSubAgent 状态。
|
|
61
|
+
|
|
62
|
+
### 🐛 Bug 修复
|
|
63
|
+
|
|
64
|
+
- **提升多轮对话的 prompt 缓存命中率**:修复并行工具调用场景下,同一条工具结果在相邻轮次被组装进模型请求时序列化形态不一致的问题。此前仅对最后一个工具结果做归一化,并行批次中的其余结果要到下一轮才被归一化,导致缓存前缀在该处分叉、后续内容全部 miss。现统一在模型请求前对本轮所有工具结果归一化,缓存前缀不再抖动,多工具/子代理场景的缓存命中率与费用显著改善。
|
|
65
|
+
- **stream-json + `--resume`**:修复 `--input-format stream-json --output-format stream-json -r <sessionId>` 场景下,`initialize` control_response 在 stdout 上被 resume 历史事件抢先写入的排序竞争。原代码在 initialize handler 尚未把响应写完前就 `initializeDeferred.resolve()`,让 resume replay 分支立刻开始把大历史流写到同一条 `process.stdout` 管道;下游(sandbox-proxy)读得慢时 initialize 响应会被卡在几十 KB 的历史事件后面,触发 sandbox-proxy 的 60s `sendControlRequest("initialize")` 超时并放大成 120s+ 的会话唤醒卡顿。改为在 `await initializeHandledPromise` 完成之后再 resolve deferred,保证 initialize 响应一定先落盘 stdout。#63837
|
|
66
|
+
- **工具审批送达**:修复对话之外自动续跑(后台任务完成、错误恢复、定时/渠道触发)的执行撞到高危命令审批时,审批框无法送达客户端、用户确认不了、会话卡在等待授权状态的问题。
|
|
67
|
+
- **认证初始化**:优化 apiKeyHelper 认证慢路径,避免网络配置同步抖动阻塞无头模式认证初始化。
|
|
68
|
+
- **AskUserQuestion 多选回答**:修复多选题同时选择预设项和填写自定义项时,自定义内容覆盖已选项的问题。
|
|
69
|
+
- **PostToolUse 图片结果**:修复 hook 返回附加上下文时破坏 `image_url` 结构化工具结果的问题,避免图片结果降级为文本或丢失。
|
|
70
|
+
|
|
10
71
|
## [2.118.2] - 2026-07-09
|
|
11
72
|
|
|
12
73
|
### 🐛 Bug 修复
|
|
@@ -158,7 +158,7 @@ const scope = await agent(
|
|
|
158
158
|
)
|
|
159
159
|
const scopeParsed = safeParse(scope, SCOPE_SCHEMA)
|
|
160
160
|
if (!scopeParsed) {
|
|
161
|
-
return
|
|
161
|
+
return "# Deep Research Report\n\n**Error:** Scope agent returned no result — cannot decompose the research question."
|
|
162
162
|
}
|
|
163
163
|
log("Q: " + QUESTION.slice(0, 80) + (QUESTION.length > 80 ? "…" : ""))
|
|
164
164
|
log("Decomposed into " + scopeParsed.angles.length + " angles: " + scopeParsed.angles.map(a => a.label).join(", "))
|
|
@@ -309,13 +309,76 @@ const rankedClaims = [...allClaims]
|
|
|
309
309
|
|
|
310
310
|
log("Fetched " + allSources.length + " sources → " + allClaims.length + " claims → verifying top " + rankedClaims.length)
|
|
311
311
|
|
|
312
|
+
// ─── Report formatter: convert structured data to readable Markdown ───
|
|
313
|
+
function formatReport(data) {
|
|
314
|
+
const lines = []
|
|
315
|
+
lines.push("# Deep Research Report")
|
|
316
|
+
lines.push("")
|
|
317
|
+
lines.push("**Question:** " + data.question)
|
|
318
|
+
lines.push("")
|
|
319
|
+
|
|
320
|
+
if (data.summary) {
|
|
321
|
+
lines.push("## Summary")
|
|
322
|
+
lines.push("")
|
|
323
|
+
lines.push(data.summary)
|
|
324
|
+
lines.push("")
|
|
325
|
+
}
|
|
326
|
+
|
|
327
|
+
if (data.findings && data.findings.length > 0) {
|
|
328
|
+
lines.push("## Key Findings")
|
|
329
|
+
lines.push("")
|
|
330
|
+
data.findings.forEach(function(f, i) {
|
|
331
|
+
var conf = f.confidence === 'high' ? '[HIGH]' : f.confidence === 'medium' ? '[MEDIUM]' : '[LOW]'
|
|
332
|
+
lines.push("### " + (i + 1) + ". " + f.claim)
|
|
333
|
+
lines.push("")
|
|
334
|
+
lines.push("- **Confidence:** " + conf + (f.vote ? " (vote: " + f.vote + ")" : ""))
|
|
335
|
+
if (f.evidence) lines.push("- **Evidence:** " + f.evidence)
|
|
336
|
+
if (f.sources && f.sources.length > 0) {
|
|
337
|
+
lines.push("- **Sources:** " + f.sources.join(", "))
|
|
338
|
+
}
|
|
339
|
+
lines.push("")
|
|
340
|
+
})
|
|
341
|
+
}
|
|
342
|
+
|
|
343
|
+
if (data.refuted && data.refuted.length > 0) {
|
|
344
|
+
lines.push("## Refuted Claims")
|
|
345
|
+
lines.push("")
|
|
346
|
+
data.refuted.forEach(function(r) {
|
|
347
|
+
lines.push("- ~~" + r.claim + "~~ (vote: " + r.vote + ", source: " + r.source + ")")
|
|
348
|
+
})
|
|
349
|
+
lines.push("")
|
|
350
|
+
}
|
|
351
|
+
|
|
352
|
+
if (data.caveats) {
|
|
353
|
+
lines.push("## Caveats")
|
|
354
|
+
lines.push("")
|
|
355
|
+
lines.push(data.caveats)
|
|
356
|
+
lines.push("")
|
|
357
|
+
}
|
|
358
|
+
|
|
359
|
+
if (data.openQuestions && data.openQuestions.length > 0) {
|
|
360
|
+
lines.push("## Open Questions")
|
|
361
|
+
lines.push("")
|
|
362
|
+
data.openQuestions.forEach(function(q) { lines.push("- " + q) })
|
|
363
|
+
lines.push("")
|
|
364
|
+
}
|
|
365
|
+
|
|
366
|
+
if (data.stats) {
|
|
367
|
+
var s = data.stats
|
|
368
|
+
lines.push("---")
|
|
369
|
+
lines.push("*Stats: " + (s.angles || 0) + " angles, " + (s.sourcesFetched || s.sources || 0) + " sources fetched, " + (s.claimsExtracted || s.claims || 0) + " claims extracted, " + (s.confirmed || 0) + " confirmed, " + (s.killed || 0) + " refuted, " + (s.agentCalls || 0) + " agent calls*")
|
|
370
|
+
}
|
|
371
|
+
|
|
372
|
+
return lines.join("\n")
|
|
373
|
+
}
|
|
374
|
+
|
|
312
375
|
if (rankedClaims.length === 0) {
|
|
313
|
-
return {
|
|
376
|
+
return formatReport({
|
|
314
377
|
question: QUESTION,
|
|
315
378
|
summary: "No claims extracted. " + allSources.length + " sources fetched, all empty/failed. " + dupes.length + " URL dupes, " + budgetDropped.length + " budget-dropped.",
|
|
316
|
-
findings: [], refuted: [],
|
|
317
|
-
stats: { angles: scopeParsed.angles.length, sources: allSources.length, claims: 0
|
|
318
|
-
}
|
|
379
|
+
findings: [], refuted: [],
|
|
380
|
+
stats: { angles: scopeParsed.angles.length, sources: allSources.length, claims: 0 },
|
|
381
|
+
})
|
|
319
382
|
}
|
|
320
383
|
|
|
321
384
|
// ─── Verify: 3-vote adversarial ───
|
|
@@ -351,14 +414,13 @@ const killed = voted.filter(c => !c.survives)
|
|
|
351
414
|
log("Verify done: " + voted.length + " claims → " + confirmed.length + " confirmed, " + killed.length + " killed")
|
|
352
415
|
|
|
353
416
|
if (confirmed.length === 0) {
|
|
354
|
-
return {
|
|
417
|
+
return formatReport({
|
|
355
418
|
question: QUESTION,
|
|
356
419
|
summary: "All " + voted.length + " claims refuted by adversarial verification. Research inconclusive — sources may be low-quality or claims overstated.",
|
|
357
420
|
findings: [],
|
|
358
421
|
refuted: killed.map(c => ({ claim: c.claim, vote: (c.verdicts.length - c.refutedVotes) + "-" + c.refutedVotes, source: c.sourceUrl })),
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
}
|
|
422
|
+
stats: { angles: scopeParsed.angles.length, sources: allSources.length, claims: allClaims.length, confirmed: 0, killed: killed.length },
|
|
423
|
+
})
|
|
362
424
|
}
|
|
363
425
|
|
|
364
426
|
// ─── Synthesize ───
|
|
@@ -398,22 +460,19 @@ const report = safeParse(reportText, REPORT_SCHEMA)
|
|
|
398
460
|
if (!report) {
|
|
399
461
|
// Synthesis skipped/errored — salvage the verified claims raw rather
|
|
400
462
|
// than throwing on report.findings and discarding the whole run.
|
|
401
|
-
return {
|
|
463
|
+
return formatReport({
|
|
402
464
|
question: QUESTION,
|
|
403
465
|
summary: "Synthesis step was skipped or failed — returning " + confirmed.length + " verified claims unmerged.",
|
|
404
|
-
findings: [],
|
|
405
|
-
confirmed: confirmed.map(c => ({ claim: c.claim, source: c.sourceUrl, quote: c.quote, vote: (c.verdicts.length - c.refutedVotes) + "-" + c.refutedVotes })),
|
|
466
|
+
findings: confirmed.map(c => ({ claim: c.claim, confidence: "medium", sources: [c.sourceUrl], evidence: c.quote, vote: (c.verdicts.length - c.refutedVotes) + "-" + c.refutedVotes })),
|
|
406
467
|
refuted: killed.map(c => ({ claim: c.claim, vote: (c.verdicts.length - c.refutedVotes) + "-" + c.refutedVotes, source: c.sourceUrl })),
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
}
|
|
468
|
+
stats: { angles: scopeParsed.angles.length, sourcesFetched: allSources.length, claimsExtracted: allClaims.length, confirmed: confirmed.length, killed: killed.length, agentCalls: 1 + scopeParsed.angles.length + allSources.length + (voted.length * VOTES_PER_CLAIM) + 1 },
|
|
469
|
+
})
|
|
410
470
|
}
|
|
411
471
|
|
|
412
|
-
return {
|
|
472
|
+
return formatReport({
|
|
413
473
|
question: QUESTION,
|
|
414
474
|
...report,
|
|
415
475
|
refuted: killed.map(c => ({ claim: c.claim, vote: (c.verdicts.length - c.refutedVotes) + "-" + c.refutedVotes, source: c.sourceUrl })),
|
|
416
|
-
sources: allSources.map(s => ({ url: s.url, quality: s.sourceQuality, angle: s.angle, claimCount: s.claims.length })),
|
|
417
476
|
stats: {
|
|
418
477
|
angles: scopeParsed.angles.length,
|
|
419
478
|
sourcesFetched: allSources.length,
|
|
@@ -422,8 +481,6 @@ return {
|
|
|
422
481
|
confirmed: confirmed.length,
|
|
423
482
|
killed: killed.length,
|
|
424
483
|
afterSynthesis: report.findings.length,
|
|
425
|
-
urlDupes: dupes.length,
|
|
426
|
-
budgetDropped: budgetDropped.length,
|
|
427
484
|
agentCalls: 1 + scopeParsed.angles.length + allSources.length + (voted.length * VOTES_PER_CLAIM) + 1,
|
|
428
485
|
},
|
|
429
|
-
}
|
|
486
|
+
})
|