deepccc 0.2.29 → 0.2.30
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/README.md +24 -21
- package/dist/turn-context.js +3 -1
- package/docs/completion-session.md +6 -6
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -68,7 +68,7 @@ npm run dev
|
|
|
68
68
|
- 本地工具:代码搜索、文件读写、补丁、命令执行、Git、网页搜索和抓取
|
|
69
69
|
- 权限审批:危险命令在会话时间线中暂停,支持拒绝、允许一次、会话允许和永久允许
|
|
70
70
|
- 上下文管理:自动压缩、原始流日志和跨会话历史检索
|
|
71
|
-
- 长会话校准:当前状态覆盖旧建议,摘要区分历史/事实/推断/局限;关键设定保留来源,区分用户确认、助手写入与助手推断;轮内工具结果有独立预算,避免多步调查持续膨胀
|
|
71
|
+
- 长会话校准:当前状态覆盖旧建议,摘要区分历史/事实/推断/局限;关键设定保留来源,区分用户确认、助手写入与助手推断;轮内工具结果有独立预算,避免多步调查持续膨胀
|
|
72
72
|
- 项目约定:自动加载 AGENTS.md、CLAUDE.md、系统提示和目录式 Skills
|
|
73
73
|
- 项目理解:可控搜索范围、按需本地项目地图、源文件变化即失效的证据笔记;不针对特定业务仓库,详见 [项目理解与搜索](docs/workspace-understanding.md)
|
|
74
74
|
- 自动化:`deepccc-cli --stream-json` 提供稳定 JSONL 事件接口
|
|
@@ -163,11 +163,11 @@ Web UI 支持新建、恢复、重命名和删除多会话,多个会话可以
|
|
|
163
163
|
|
|
164
164
|
模型文本、reasoning 心跳和工具事件通过 SSE 实时更新。每轮消息按真实发生顺序持久化和回放,因此刷新后仍会保持“阶段说明 → 工具调用 → 后续结论”的交错时间线;旧版会话没有顺序数据时,会兼容显示为“工具调用 → 最终回答”。每次工具调用与对应结果合并成一张卡片,折叠态显示 emoji、工具名、状态和关键参数;展开后调用参数默认保留前 8/后 4 行,工具结果保留前 12/后 6 行,省略内容可继续展开。工具卡及省略行的展开状态保存在当前浏览器标签页的 `sessionStorage`,持续生成、切换会话和刷新页面均不会自动收起。消息正文支持标题、表格、列表、引用、链接和代码块等常用 Markdown。
|
|
165
165
|
|
|
166
|
-
图片会转换成模型可见的原生视觉输入。Web 支持选择、粘贴和拖拽 PNG/JPEG/WebP/GIF;CLI 可用 `--image` 或交互命令 `/image`。每条消息最多 10 张、单图最大 20 MiB、图片合计最大 24 MiB,单边最多 8192 像素;超限时提示分图或缩小,保留原图细节。附件复制到 `~/.deepccc/attachments/<session-id>/`,聊天历史只保存引用,raw 日志过滤图片编码。删除 Web 会话时附件一并清理。
|
|
167
|
-
|
|
168
|
-
默认由当前模型直接看图。若主模型不支持视觉,可在 API 设置中指定 `visionModel`(如 `deepseek-flash`),或设置 `DEEPCCC_VISION_MODEL` / CLI `--vision-model`;该模型使用同一 API 协议、Base URL 和 Key,先分析图片,再由主模型结合观察继续任务。界面及 JSONL 会显示实际图片模型和模式。未配置图片模型的 `deepseek-v4-pro` 收图会明确报错;其他兼容模型需服务端支持图像,接口错误不会降级成“假装看过”。官方 DeepSeek 端点的旧 Flash 名称仅在视觉请求中映射到当前 `deepseek-flash`,自定义网关保留用户配置的名称。
|
|
169
|
-
|
|
170
|
-
Agent 可用 `read_image` 查看本地截图、图表或工具产物,并通过 `question` 指定需要观察的细节;`present_file` 用于把图片展示给用户。后续追问会按预算重新加载近期图片;较早图片保留路径供 `read_image` 重新查看。独立图片模型的观察按原文问题、模型、端点与图片内容哈希缓存;细节追问可重新调用 `read_image`。压缩后的摘要应保留重要图片引用,缺失或损坏图片会明确报错。本版本支持图片输入,不包含音频、视频或 PDF 原生输入。
|
|
166
|
+
图片会转换成模型可见的原生视觉输入。Web 支持选择、粘贴和拖拽 PNG/JPEG/WebP/GIF;CLI 可用 `--image` 或交互命令 `/image`。每条消息最多 10 张、单图最大 20 MiB、图片合计最大 24 MiB,单边最多 8192 像素;超限时提示分图或缩小,保留原图细节。附件复制到 `~/.deepccc/attachments/<session-id>/`,聊天历史只保存引用,raw 日志过滤图片编码。删除 Web 会话时附件一并清理。
|
|
167
|
+
|
|
168
|
+
默认由当前模型直接看图。若主模型不支持视觉,可在 API 设置中指定 `visionModel`(如 `deepseek-flash`),或设置 `DEEPCCC_VISION_MODEL` / CLI `--vision-model`;该模型使用同一 API 协议、Base URL 和 Key,先分析图片,再由主模型结合观察继续任务。界面及 JSONL 会显示实际图片模型和模式。未配置图片模型的 `deepseek-v4-pro` 收图会明确报错;其他兼容模型需服务端支持图像,接口错误不会降级成“假装看过”。官方 DeepSeek 端点的旧 Flash 名称仅在视觉请求中映射到当前 `deepseek-flash`,自定义网关保留用户配置的名称。
|
|
169
|
+
|
|
170
|
+
Agent 可用 `read_image` 查看本地截图、图表或工具产物,并通过 `question` 指定需要观察的细节;`present_file` 用于把图片展示给用户。后续追问会按预算重新加载近期图片;较早图片保留路径供 `read_image` 重新查看。独立图片模型的观察按原文问题、模型、端点与图片内容哈希缓存;细节追问可重新调用 `read_image`。压缩后的摘要应保留重要图片引用,缺失或损坏图片会明确报错。本版本支持图片输入,不包含音频、视频或 PDF 原生输入。
|
|
171
171
|
|
|
172
172
|
API 设置采用单一 Provider 配置,支持 OpenAI-compatible 与 Anthropic Messages。完整 API Key 只保存在本机 `~/.deepccc/config.json`,浏览器读取设置时仅返回掩码。危险命令会在会话中暂停并请求“拒绝、允许一次、本会话允许、永久允许”,浏览器断开或审批超时默认拒绝。
|
|
173
173
|
|
|
@@ -195,7 +195,10 @@ Provider 发送 `max_tokens`,使用模型服务端默认值。可通过 `DEEPC
|
|
|
195
195
|
默认取 `min(64000, 常规压缩阈值 × 25%)`,超过后会提前压缩,避免长会话积累大量低信号工具输出。
|
|
196
196
|
可通过 `DEEPCCC_CONTEXT_WINDOW` 环境变量覆盖。⚠️ 超过模型/服务端实际上限时请求会被
|
|
197
197
|
API 拒绝(context length exceeded),实际窗口以模型与所用服务端为准(如 litellm 的
|
|
198
|
-
`max_input_tokens`)。
|
|
198
|
+
`max_input_tokens`)。
|
|
199
|
+
|
|
200
|
+
同一轮连续工具调用也有独立的结果重放预算。较早的简短成功回执、JSON 结果和错误信息,
|
|
201
|
+
若比省略提示更短,会保留原结果;较大的结果仍按预算截断或省略,工具调用关联保持不变。
|
|
199
202
|
|
|
200
203
|
`subModel` 是子模型(选填),默认 `""`(留空跟随主模型)。配置后,DeepCCC 内部的轻量
|
|
201
204
|
环节——上下文压缩摘要生成、`task` 子代理任务——使用子模型执行,主对话仍用主模型。
|
|
@@ -244,22 +247,22 @@ deepccc-cli --provider anthropic --base-url https://api.example.com --api-key "$
|
|
|
244
247
|
deepccc-cli --cwd /path/to/project
|
|
245
248
|
```
|
|
246
249
|
|
|
247
|
-
附加一张或多张本地图片(重复传入 `--image`;路径含空格时加引号):
|
|
250
|
+
附加一张或多张本地图片(重复传入 `--image`;路径含空格时加引号):
|
|
248
251
|
|
|
249
252
|
```bash
|
|
250
|
-
deepccc-cli --image ./error.png --image ./expected.webp
|
|
251
|
-
```
|
|
252
|
-
|
|
253
|
-
启动后再加图:输入 `/image "C:\截图\报错截图.png"`,看到“图片已加入下一条消息”后输入问题并回车。多图重复 `/image`;相对路径按会话工作目录(`--cwd`)解析。该命令在当前回复结束后使用。启动时的 `--image` 也只加入队列,随后输入问题发送。
|
|
254
|
-
|
|
255
|
-
脚本或纯命令模式可直接发送图片并获取 JSONL:
|
|
256
|
-
|
|
257
|
-
```bash
|
|
258
|
-
deepccc-cli --model deepseek-flash --stream-json --prompt "解释截图里的错误" --image "./error screenshot.png"
|
|
259
|
-
deepccc-cli --model deepseek-v4-pro --vision-model deepseek-flash --stream-json --prompt "对比两张图" --image ./before.png --image ./after.png
|
|
260
|
-
```
|
|
261
|
-
|
|
262
|
-
安装 ChatCCC 后提供的 `cccagent` 使用同一 CLI:将上述 `deepccc-cli` 换成 `cccagent` 即可。它读取 `~/.deepccc/config.json`、`DEEPCCC_*` 环境变量或命令行参数;ChatCCC 机器人里的 API 配置不会自动改写独立 CLI 配置。聊天窗口的图片粘贴/拖拽属于 Web 功能,纯终端请使用文件路径。
|
|
253
|
+
deepccc-cli --image ./error.png --image ./expected.webp
|
|
254
|
+
```
|
|
255
|
+
|
|
256
|
+
启动后再加图:输入 `/image "C:\截图\报错截图.png"`,看到“图片已加入下一条消息”后输入问题并回车。多图重复 `/image`;相对路径按会话工作目录(`--cwd`)解析。该命令在当前回复结束后使用。启动时的 `--image` 也只加入队列,随后输入问题发送。
|
|
257
|
+
|
|
258
|
+
脚本或纯命令模式可直接发送图片并获取 JSONL:
|
|
259
|
+
|
|
260
|
+
```bash
|
|
261
|
+
deepccc-cli --model deepseek-flash --stream-json --prompt "解释截图里的错误" --image "./error screenshot.png"
|
|
262
|
+
deepccc-cli --model deepseek-v4-pro --vision-model deepseek-flash --stream-json --prompt "对比两张图" --image ./before.png --image ./after.png
|
|
263
|
+
```
|
|
264
|
+
|
|
265
|
+
安装 ChatCCC 后提供的 `cccagent` 使用同一 CLI:将上述 `deepccc-cli` 换成 `cccagent` 即可。它读取 `~/.deepccc/config.json`、`DEEPCCC_*` 环境变量或命令行参数;ChatCCC 机器人里的 API 配置不会自动改写独立 CLI 配置。聊天窗口的图片粘贴/拖拽属于 Web 功能,纯终端请使用文件路径。
|
|
263
266
|
|
|
264
267
|
恢复当前工作目录最近一次会话:
|
|
265
268
|
|
package/dist/turn-context.js
CHANGED
|
@@ -72,7 +72,9 @@ export function compactToolLoopMessages(input, options = {}) {
|
|
|
72
72
|
for (let index = prepared.length - keepRecent - 1; index >= 0; index -= 1) {
|
|
73
73
|
const item = prepared[index];
|
|
74
74
|
const delta = item.cappedSize - omittedSize;
|
|
75
|
-
|
|
75
|
+
// A short status/error can cost less than the omission marker. Always
|
|
76
|
+
// restore such results: this retains evidence and reduces replay size.
|
|
77
|
+
if (delta > 0 && retainedToolChars + delta > maximum)
|
|
76
78
|
continue;
|
|
77
79
|
item.message.content[item.partIndex] = { ...item.part, output: item.capped };
|
|
78
80
|
retainedToolChars += delta;
|
|
@@ -26,12 +26,12 @@ performed here. Completion is accepted only after a normal stop, never a length
|
|
|
26
26
|
limit or interrupted stream. Text mode preserves plain-text output. Parallel
|
|
27
27
|
calls do not share mutable history. `timeoutMs` covers stream consumption;
|
|
28
28
|
optional cancellation is the second argument. Context/response character limits
|
|
29
|
-
default to one million each. Since 0.2.28, oversized input returns
|
|
30
|
-
`status: 'context_limit'`, `diagnostic.code: 'context_budget_exceeded'` and zero
|
|
31
|
-
model calls before network activity. It does not return the input or partial
|
|
32
|
-
content. Invalid configuration budgets still throw. Other runtime failures return
|
|
33
|
-
fixed diagnostics without raw errors. Character limits are not token estimates;
|
|
34
|
-
callers must assemble bounded evidence rather than merely increase the limit.
|
|
29
|
+
default to one million each. Since 0.2.28, oversized input returns
|
|
30
|
+
`status: 'context_limit'`, `diagnostic.code: 'context_budget_exceeded'` and zero
|
|
31
|
+
model calls before network activity. It does not return the input or partial
|
|
32
|
+
content. Invalid configuration budgets still throw. Other runtime failures return
|
|
33
|
+
fixed diagnostics without raw errors. Character limits are not token estimates;
|
|
34
|
+
callers must assemble bounded evidence rather than merely increase the limit.
|
|
35
35
|
|
|
36
36
|
JSON responses are collected as text without constructing partial objects for
|
|
37
37
|
each streamed fragment. This avoids unnecessary parsing and allocation for large
|