chatccc 0.2.300 → 0.2.301
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/.agents/skills/create-chatccc-feishu-app/SKILL.md +85 -85
- package/.claude/skills/create-chatccc-feishu-app/SKILL.md +85 -85
- package/.cursor/skills/create-chatccc-feishu-app/SKILL.md +85 -85
- package/README.md +6 -2
- package/agent-prompts/claude_specific.md +45 -45
- package/agent-prompts/codex_specific.md +2 -2
- package/agent-prompts/cursor_specific.md +13 -13
- package/bin/cccagent.mjs +26 -26
- package/bin/chatccc.mjs +15 -15
- package/config.sample.json +7 -6
- package/deepccc-agent/README.md +21 -4
- package/deepccc-agent/os-prompts/darwin.md +8 -8
- package/deepccc-agent/os-prompts/linux.md +8 -8
- package/deepccc-agent/os-prompts/win32.md +11 -11
- package/deepccc-agent/package.json +68 -68
- package/dist/deepccc-agent/src/attachments.js +7 -5
- package/dist/deepccc-agent/src/cli.js +52 -7
- package/dist/deepccc-agent/src/completion-session.js +100 -0
- package/dist/deepccc-agent/src/config.js +4 -0
- package/dist/deepccc-agent/src/context.js +4 -1
- package/dist/deepccc-agent/src/decision-session.js +314 -0
- package/dist/deepccc-agent/src/file-tools.js +5 -0
- package/dist/deepccc-agent/src/index.js +41 -4
- package/dist/deepccc-agent/src/json-mode-fetch.js +12 -0
- package/dist/deepccc-agent/src/json-response.js +33 -0
- package/dist/deepccc-agent/src/multimodal.js +291 -0
- package/dist/deepccc-agent/src/progress/reducer.js +2 -0
- package/dist/deepccc-agent/src/web-page.js +411 -411
- package/dist/deepccc-agent/src/web-runtime.js +3 -0
- package/dist/deepccc-agent/src/web-server.js +2 -0
- package/dist/src/adapters/ccc-adapter.js +4 -0
- package/dist/src/agent-team/web/agent-team-page.js +250 -250
- package/dist/src/config.js +2 -0
- package/dist/src/engines/engine-specs.js +71 -71
- package/dist/src/feishu-api.js +11 -11
- package/dist/src/litellm-proxy.js +15 -15
- package/dist/src/progress/reducer.js +2 -0
- package/dist/src/session.js +1 -0
- package/dist/src/web-ui.js +80 -66
- package/im-skills/feishu-skill/receive-send-file.md +65 -65
- package/im-skills/feishu-skill/receive-send-image.md +26 -26
- package/im-skills/feishu-skill/send-file.mjs +6 -6
- package/im-skills/feishu-skill/send-image.mjs +6 -6
- package/im-skills/feishu-skill/skill.md +28 -28
- package/im-skills/wechat-file-skill/receive-send-file.md +38 -38
- package/im-skills/wechat-file-skill/send-file.mjs +83 -83
- package/im-skills/wechat-file-skill/skill.md +10 -10
- package/im-skills/wechat-image-skill/skill.md +10 -10
- package/im-skills/wechat-video-skill/receive-send-video.md +38 -38
- package/im-skills/wechat-video-skill/send-video.mjs +79 -79
- package/im-skills/wechat-video-skill/skill.md +10 -10
- package/package.json +77 -77
- package/scripts/postinstall-sharp-check.mjs +58 -58
- package/scripts/self-update-helper.mjs +301 -301
|
@@ -1,46 +1,46 @@
|
|
|
1
|
-
## 重复成功命令保护
|
|
2
|
-
|
|
3
|
-
通过 Claude Agent SDK 在本项目中工作时,重复成功的 shell 命令是完成信号,不应继续使用工具。
|
|
4
|
-
|
|
5
|
-
以下条件**全部**满足时,视为相同命令:
|
|
6
|
-
- 命令文本基本相同
|
|
7
|
-
- 工作目录相同
|
|
8
|
-
- 任务目标未变
|
|
9
|
-
- 没有新的用户输入改变任务
|
|
10
|
-
- 没有新的错误输出需要重新处理
|
|
11
|
-
|
|
12
|
-
同一命令**连续成功两次**后,停止调用工具,直接给出最终回复。不要"再验证一次"。
|
|
13
|
-
|
|
14
|
-
此规则适用于所有工具调用。
|
|
15
|
-
|
|
16
|
-
## 硬停止规则
|
|
17
|
-
|
|
18
|
-
同一命令在本项目中**不得成功执行三次**。若连续两次成功,第三次必须是最终回复。
|
|
19
|
-
|
|
20
|
-
## 卡住自检
|
|
21
|
-
|
|
22
|
-
如果你感觉任务已经完成,但发现自己陷入了循环(反复调用相同工具、输出 "stuck in a loop" 等),**立即**调用以下接口。
|
|
23
|
-
|
|
24
|
-
**重要:必须用 heredoc 写临时文件再 curl,禁止在命令行参数中直接写中文 JSON。** Windows 下命令行参数传中文会变成 `?` 乱码。
|
|
25
|
-
|
|
26
|
-
```bash
|
|
27
|
-
cat > /tmp/stop_ccc.json << 'STOPJSON'
|
|
28
|
-
{"session_id": "{{session_id}}", "final_reply": "<你给用户的最终回复,总结已完成的工作和结果>"}
|
|
29
|
-
STOPJSON
|
|
30
|
-
curl -s -X POST {{stop_stuck_url}} -H "Content-Type: application/json" -d @/tmp/stop_ccc.json
|
|
31
|
-
```
|
|
32
|
-
|
|
33
|
-
final_reply 注意事项:
|
|
34
|
-
- 把 `<...>` 占位符替换为你的实际回复,不要包含双引号 `"` 和反斜杠 `\`
|
|
35
|
-
- 不要包含换行,用空格代替
|
|
36
|
-
- 保持简短(1-2 句话)
|
|
37
|
-
|
|
38
|
-
调用后停止所有工具调用,直接输出最终回复即可。
|
|
39
|
-
|
|
40
|
-
## 禁止 PushNotification
|
|
41
|
-
|
|
42
|
-
**不要调用 PushNotification 工具。** 如果你认为当前会话已经完成任务需要结束,直接调用上述 stop-stuck-loop 接口,不要使用 PushNotification。
|
|
43
|
-
|
|
44
|
-
## 计划/问答模式权限规则
|
|
45
|
-
|
|
1
|
+
## 重复成功命令保护
|
|
2
|
+
|
|
3
|
+
通过 Claude Agent SDK 在本项目中工作时,重复成功的 shell 命令是完成信号,不应继续使用工具。
|
|
4
|
+
|
|
5
|
+
以下条件**全部**满足时,视为相同命令:
|
|
6
|
+
- 命令文本基本相同
|
|
7
|
+
- 工作目录相同
|
|
8
|
+
- 任务目标未变
|
|
9
|
+
- 没有新的用户输入改变任务
|
|
10
|
+
- 没有新的错误输出需要重新处理
|
|
11
|
+
|
|
12
|
+
同一命令**连续成功两次**后,停止调用工具,直接给出最终回复。不要"再验证一次"。
|
|
13
|
+
|
|
14
|
+
此规则适用于所有工具调用。
|
|
15
|
+
|
|
16
|
+
## 硬停止规则
|
|
17
|
+
|
|
18
|
+
同一命令在本项目中**不得成功执行三次**。若连续两次成功,第三次必须是最终回复。
|
|
19
|
+
|
|
20
|
+
## 卡住自检
|
|
21
|
+
|
|
22
|
+
如果你感觉任务已经完成,但发现自己陷入了循环(反复调用相同工具、输出 "stuck in a loop" 等),**立即**调用以下接口。
|
|
23
|
+
|
|
24
|
+
**重要:必须用 heredoc 写临时文件再 curl,禁止在命令行参数中直接写中文 JSON。** Windows 下命令行参数传中文会变成 `?` 乱码。
|
|
25
|
+
|
|
26
|
+
```bash
|
|
27
|
+
cat > /tmp/stop_ccc.json << 'STOPJSON'
|
|
28
|
+
{"session_id": "{{session_id}}", "final_reply": "<你给用户的最终回复,总结已完成的工作和结果>"}
|
|
29
|
+
STOPJSON
|
|
30
|
+
curl -s -X POST {{stop_stuck_url}} -H "Content-Type: application/json" -d @/tmp/stop_ccc.json
|
|
31
|
+
```
|
|
32
|
+
|
|
33
|
+
final_reply 注意事项:
|
|
34
|
+
- 把 `<...>` 占位符替换为你的实际回复,不要包含双引号 `"` 和反斜杠 `\`
|
|
35
|
+
- 不要包含换行,用空格代替
|
|
36
|
+
- 保持简短(1-2 句话)
|
|
37
|
+
|
|
38
|
+
调用后停止所有工具调用,直接输出最终回复即可。
|
|
39
|
+
|
|
40
|
+
## 禁止 PushNotification
|
|
41
|
+
|
|
42
|
+
**不要调用 PushNotification 工具。** 如果你认为当前会话已经完成任务需要结束,直接调用上述 stop-stuck-loop 接口,不要使用 PushNotification。
|
|
43
|
+
|
|
44
|
+
## 计划/问答模式权限规则
|
|
45
|
+
|
|
46
46
|
如果用户消息以 `/plan` 或 `/ask` 开头,说明当前处于只读模式。**遇到任何需要用户同意的权限请求时,不要向用户申请权限,立即调用 stop-stuck-loop 接口提前结束本轮会话。**
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
## 计划/问答模式权限规则
|
|
2
|
-
|
|
1
|
+
## 计划/问答模式权限规则
|
|
2
|
+
|
|
3
3
|
如果用户消息以 `/plan` 或 `/ask` 开头,说明当前处于只读模式。**遇到任何需要用户同意的权限请求时,不要向用户申请权限,立即调用 stop-stuck-loop 接口提前结束本轮会话。**
|
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
## 计划/问答模式权限规则
|
|
2
|
-
|
|
3
|
-
如果用户消息以 `/plan` 或 `/ask` 开头,说明当前处于只读模式。**遇到任何需要用户同意的权限请求时,不要向用户申请权限,立即调用 stop-stuck-loop 接口提前结束本轮会话。**
|
|
4
|
-
|
|
5
|
-
## 用户问题澄清规则
|
|
6
|
-
|
|
7
|
-
当需要在开始实现前向用户确认问题、让用户做选择,或用户要求“从第一性原理出发挖掘真实需求 / 判断需求是否合理 / 开始实现前有什么问题要问我”时,**不要调用 `AskQuestion`、多选表单或任何结构化选择工具**。
|
|
8
|
-
|
|
9
|
-
必须直接用普通文本回复用户:
|
|
10
|
-
|
|
11
|
-
- 先简要说明你理解到的真实需求和你对合理性的判断。
|
|
12
|
-
- 再列出需要用户确认的问题;如果有推荐选项,就用文本说明“我建议 X,原因是 Y”。
|
|
13
|
-
- 问题数量尽量少,只问会影响实现边界、风险或不可逆决策的问题。
|
|
1
|
+
## 计划/问答模式权限规则
|
|
2
|
+
|
|
3
|
+
如果用户消息以 `/plan` 或 `/ask` 开头,说明当前处于只读模式。**遇到任何需要用户同意的权限请求时,不要向用户申请权限,立即调用 stop-stuck-loop 接口提前结束本轮会话。**
|
|
4
|
+
|
|
5
|
+
## 用户问题澄清规则
|
|
6
|
+
|
|
7
|
+
当需要在开始实现前向用户确认问题、让用户做选择,或用户要求“从第一性原理出发挖掘真实需求 / 判断需求是否合理 / 开始实现前有什么问题要问我”时,**不要调用 `AskQuestion`、多选表单或任何结构化选择工具**。
|
|
8
|
+
|
|
9
|
+
必须直接用普通文本回复用户:
|
|
10
|
+
|
|
11
|
+
- 先简要说明你理解到的真实需求和你对合理性的判断。
|
|
12
|
+
- 再列出需要用户确认的问题;如果有推荐选项,就用文本说明“我建议 X,原因是 Y”。
|
|
13
|
+
- 问题数量尽量少,只问会影响实现边界、风险或不可逆决策的问题。
|
|
14
14
|
- 不要把这些问题放进工具调用参数里,也不要只在卡片/工具结果中呈现。
|
package/bin/cccagent.mjs
CHANGED
|
@@ -1,26 +1,26 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
|
-
import { spawnSync } from "node:child_process";
|
|
3
|
-
import { existsSync } from "node:fs";
|
|
4
|
-
import { createRequire } from "node:module";
|
|
5
|
-
import { dirname, join } from "node:path";
|
|
6
|
-
|
|
7
|
-
const require = createRequire(import.meta.url);
|
|
8
|
-
const pkgRoot = dirname(require.resolve("../package.json"));
|
|
9
|
-
const compiledEntry = join(pkgRoot, "dist", "deepccc-agent", "src", "cli.js");
|
|
10
|
-
let args;
|
|
11
|
-
if (existsSync(compiledEntry)) {
|
|
12
|
-
args = [compiledEntry, ...process.argv.slice(2)];
|
|
13
|
-
} else {
|
|
14
|
-
// Development checkout fallback. Published packages always contain dist/.
|
|
15
|
-
const cliTs = join(pkgRoot, "deepccc-agent", "src", "cli.ts");
|
|
16
|
-
const tsxCli = require.resolve("tsx/cli");
|
|
17
|
-
args = [tsxCli, cliTs, ...process.argv.slice(2)];
|
|
18
|
-
}
|
|
19
|
-
|
|
20
|
-
const result = spawnSync(process.execPath, args, {
|
|
21
|
-
stdio: "inherit",
|
|
22
|
-
cwd: process.cwd(),
|
|
23
|
-
env: process.env,
|
|
24
|
-
});
|
|
25
|
-
|
|
26
|
-
process.exit(result.status === null ? 1 : result.status);
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import { spawnSync } from "node:child_process";
|
|
3
|
+
import { existsSync } from "node:fs";
|
|
4
|
+
import { createRequire } from "node:module";
|
|
5
|
+
import { dirname, join } from "node:path";
|
|
6
|
+
|
|
7
|
+
const require = createRequire(import.meta.url);
|
|
8
|
+
const pkgRoot = dirname(require.resolve("../package.json"));
|
|
9
|
+
const compiledEntry = join(pkgRoot, "dist", "deepccc-agent", "src", "cli.js");
|
|
10
|
+
let args;
|
|
11
|
+
if (existsSync(compiledEntry)) {
|
|
12
|
+
args = [compiledEntry, ...process.argv.slice(2)];
|
|
13
|
+
} else {
|
|
14
|
+
// Development checkout fallback. Published packages always contain dist/.
|
|
15
|
+
const cliTs = join(pkgRoot, "deepccc-agent", "src", "cli.ts");
|
|
16
|
+
const tsxCli = require.resolve("tsx/cli");
|
|
17
|
+
args = [tsxCli, cliTs, ...process.argv.slice(2)];
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
const result = spawnSync(process.execPath, args, {
|
|
21
|
+
stdio: "inherit",
|
|
22
|
+
cwd: process.cwd(),
|
|
23
|
+
env: process.env,
|
|
24
|
+
});
|
|
25
|
+
|
|
26
|
+
process.exit(result.status === null ? 1 : result.status);
|
package/bin/chatccc.mjs
CHANGED
|
@@ -1,24 +1,24 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import { spawnSync } from "node:child_process";
|
|
3
|
-
import { existsSync } from "node:fs";
|
|
2
|
+
import { spawnSync } from "node:child_process";
|
|
3
|
+
import { existsSync } from "node:fs";
|
|
4
4
|
import { createRequire } from "node:module";
|
|
5
5
|
import { dirname, join } from "node:path";
|
|
6
6
|
|
|
7
7
|
const require = createRequire(import.meta.url);
|
|
8
8
|
// 相对 bin/chatccc.mjs 解析 package.json,包根目录不依赖 cwd,也不会多退一级到 node_modules
|
|
9
9
|
const pkgRoot = dirname(require.resolve("../package.json"));
|
|
10
|
-
const compiledEntry = join(pkgRoot, "dist", "src", "index.js");
|
|
11
|
-
let args;
|
|
12
|
-
if (existsSync(compiledEntry)) {
|
|
13
|
-
args = [compiledEntry, ...process.argv.slice(2)];
|
|
14
|
-
} else {
|
|
15
|
-
// Development checkout fallback. Published packages always contain dist/.
|
|
16
|
-
const indexTs = join(pkgRoot, "src", "index.ts");
|
|
17
|
-
const tsxCli = require.resolve("tsx/cli");
|
|
18
|
-
args = [tsxCli, indexTs, ...process.argv.slice(2)];
|
|
19
|
-
}
|
|
20
|
-
|
|
21
|
-
const result = spawnSync(process.execPath, args, {
|
|
10
|
+
const compiledEntry = join(pkgRoot, "dist", "src", "index.js");
|
|
11
|
+
let args;
|
|
12
|
+
if (existsSync(compiledEntry)) {
|
|
13
|
+
args = [compiledEntry, ...process.argv.slice(2)];
|
|
14
|
+
} else {
|
|
15
|
+
// Development checkout fallback. Published packages always contain dist/.
|
|
16
|
+
const indexTs = join(pkgRoot, "src", "index.ts");
|
|
17
|
+
const tsxCli = require.resolve("tsx/cli");
|
|
18
|
+
args = [tsxCli, indexTs, ...process.argv.slice(2)];
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
const result = spawnSync(process.execPath, args, {
|
|
22
22
|
stdio: "inherit",
|
|
23
23
|
cwd: process.cwd(),
|
|
24
24
|
env: process.env,
|
|
@@ -30,4 +30,4 @@ if (code !== 0) {
|
|
|
30
30
|
console.error("chatccc 子进程已结束,服务没有在后台运行。");
|
|
31
31
|
}
|
|
32
32
|
|
|
33
|
-
process.exit(code);
|
|
33
|
+
process.exit(code);
|
package/config.sample.json
CHANGED
|
@@ -55,12 +55,13 @@
|
|
|
55
55
|
"defaultAgent": false,
|
|
56
56
|
"DEEPSEEK_API_KEY": "",
|
|
57
57
|
"DEEPSEEK_BASE_URL": "https://api.deepseek.com/v1",
|
|
58
|
-
"model": "deepseek-v4-pro",
|
|
59
|
-
"subModel": "",
|
|
60
|
-
"
|
|
61
|
-
"
|
|
62
|
-
"
|
|
63
|
-
"
|
|
58
|
+
"model": "deepseek-v4-pro",
|
|
59
|
+
"subModel": "",
|
|
60
|
+
"visionModel": "deepseek-flash",
|
|
61
|
+
"alternativeModel": "",
|
|
62
|
+
"effort": "",
|
|
63
|
+
"maxOutputTokens": null,
|
|
64
|
+
"provider": "",
|
|
64
65
|
"gitCoAuthor": null,
|
|
65
66
|
"compactionTimeoutMs": 300000,
|
|
66
67
|
"contextWindow": 1048576
|
package/deepccc-agent/README.md
CHANGED
|
@@ -59,6 +59,8 @@ npm run dev
|
|
|
59
59
|
|
|
60
60
|
## 核心能力
|
|
61
61
|
|
|
62
|
+
- 有界结构化决策:程序化 `DecisionSession` 支持外部管理上下文、显式工具白名单、运行时结果校验和整轮截止时间;不改变默认聊天行为。详见 [接入文档](docs/decision-session.md)。
|
|
63
|
+
|
|
62
64
|
- Web-first:多会话、持久化历史、实时流式过程、停止和恢复
|
|
63
65
|
- 工具时间线:ChatCCC 风格 emoji 摘要、参数/结果折叠、省略行展开和状态记忆
|
|
64
66
|
- 会话配置:每个会话独立选择 model、subModel 和 effort
|
|
@@ -161,7 +163,11 @@ Web UI 支持新建、恢复、重命名和删除多会话,多个会话可以
|
|
|
161
163
|
|
|
162
164
|
模型文本、reasoning 心跳和工具事件通过 SSE 实时更新。每轮消息按真实发生顺序持久化和回放,因此刷新后仍会保持“阶段说明 → 工具调用 → 后续结论”的交错时间线;旧版会话没有顺序数据时,会兼容显示为“工具调用 → 最终回答”。每次工具调用与对应结果合并成一张卡片,折叠态显示 emoji、工具名、状态和关键参数;展开后调用参数默认保留前 8/后 4 行,工具结果保留前 12/后 6 行,省略内容可继续展开。工具卡及省略行的展开状态保存在当前浏览器标签页的 `sessionStorage`,持续生成、切换会话和刷新页面均不会自动收起。消息正文支持标题、表格、列表、引用、链接和代码块等常用 Markdown。
|
|
163
165
|
|
|
164
|
-
|
|
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 原生输入。
|
|
165
171
|
|
|
166
172
|
API 设置采用单一 Provider 配置,支持 OpenAI-compatible 与 Anthropic Messages。完整 API Key 只保存在本机 `~/.deepccc/config.json`,浏览器读取设置时仅返回掩码。危险命令会在会话中暂停并请求“拒绝、允许一次、本会话允许、永久允许”,浏览器断开或审批超时默认拒绝。
|
|
167
173
|
|
|
@@ -238,11 +244,22 @@ deepccc-cli --provider anthropic --base-url https://api.example.com --api-key "$
|
|
|
238
244
|
deepccc-cli --cwd /path/to/project
|
|
239
245
|
```
|
|
240
246
|
|
|
241
|
-
|
|
247
|
+
附加一张或多张本地图片(重复传入 `--image`;路径含空格时加引号):
|
|
242
248
|
|
|
243
249
|
```bash
|
|
244
|
-
deepccc-cli --image ./error.png --image ./expected.webp
|
|
245
|
-
```
|
|
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 功能,纯终端请使用文件路径。
|
|
246
263
|
|
|
247
264
|
恢复当前工作目录最近一次会话:
|
|
248
265
|
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
## macOS 命令行提示
|
|
2
|
-
|
|
3
|
-
你运行在 macOS 上。run_command 通过 zsh(POSIX shell)执行。引号遵循标准 POSIX 约定(与你在 bash 中已有的习惯相同):
|
|
4
|
-
|
|
5
|
-
- 双引号会被剥离并用于组合含空格参数:`echo "hello world"` 打印 `hello world`。
|
|
6
|
-
- 单引号是字面量引用字符:`'a b'` 是单个参数 `a b`。
|
|
7
|
-
- 反引号和 `$(...)` 执行命令替换;需要字面文本时请加引号。
|
|
8
|
-
- 路径使用 `/` 分隔符,`~` 展开为主目录。
|
|
1
|
+
## macOS 命令行提示
|
|
2
|
+
|
|
3
|
+
你运行在 macOS 上。run_command 通过 zsh(POSIX shell)执行。引号遵循标准 POSIX 约定(与你在 bash 中已有的习惯相同):
|
|
4
|
+
|
|
5
|
+
- 双引号会被剥离并用于组合含空格参数:`echo "hello world"` 打印 `hello world`。
|
|
6
|
+
- 单引号是字面量引用字符:`'a b'` 是单个参数 `a b`。
|
|
7
|
+
- 反引号和 `$(...)` 执行命令替换;需要字面文本时请加引号。
|
|
8
|
+
- 路径使用 `/` 分隔符,`~` 展开为主目录。
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
## Linux 命令行提示
|
|
2
|
-
|
|
3
|
-
你运行在 Linux 上。run_command 通过 POSIX shell(bash/sh)执行。引语遵循标准 POSIX 约定(与你在 bash 中已有的习惯相同):
|
|
4
|
-
|
|
5
|
-
- 双引号会被剥离并用于组合含空格参数:`echo "hello world"` 打印 `hello world`。
|
|
6
|
-
- 单引号是字面量引用字符:`'a b'` 是单个参数 `a b`。
|
|
7
|
-
- 反引号和 `$(...)` 执行命令替换;需要字面文本时请加引号。
|
|
8
|
-
- 路径使用 `/` 分隔符,`~` 展开为主目录。
|
|
1
|
+
## Linux 命令行提示
|
|
2
|
+
|
|
3
|
+
你运行在 Linux 上。run_command 通过 POSIX shell(bash/sh)执行。引语遵循标准 POSIX 约定(与你在 bash 中已有的习惯相同):
|
|
4
|
+
|
|
5
|
+
- 双引号会被剥离并用于组合含空格参数:`echo "hello world"` 打印 `hello world`。
|
|
6
|
+
- 单引号是字面量引用字符:`'a b'` 是单个参数 `a b`。
|
|
7
|
+
- 反引号和 `$(...)` 执行命令替换;需要字面文本时请加引号。
|
|
8
|
+
- 路径使用 `/` 分隔符,`~` 展开为主目录。
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
## Windows 命令行提示
|
|
2
|
-
|
|
3
|
-
你运行在 Windows 上。优先绕过 shell,只有需要 shell 运算符时才进入 cmd.exe:
|
|
4
|
-
|
|
5
|
-
- 单个程序优先用 `run_process`,把可执行文件和每个参数分别放进 `executable` / `args`。它使用 `shell:false`,不会让 cmd.exe 再解释引号、反斜杠、`&`、`%VAR%` 等内容。
|
|
6
|
-
- 多行或引号密集的 Python/Node 代码必须用 `run_script`。不要塞进 `python -c` / `node -e`;Windows 下复杂内联代码会被 `run_command` 拒绝,避免命令返回 0 却实际执行了不同代码。
|
|
7
|
-
- `run_command` 仅用于 `&&`、管道、重定向等必须由 shell 解析的场景;它通过 cmd.exe 执行,不是 bash,也不是 PowerShell。
|
|
8
|
-
- 双引号在 cmd.exe、Node 的 shell 封装和目标程序的 argv 解析之间会经历多层处理;是否保留或剥离取决于具体调用链,不能假设会“原样到达”。单引号在 cmd.exe 中不是可靠的引用字符。
|
|
9
|
-
- 使用各命令工具的 `cwd` 参数切换工作目录,不要前置 `cd /d ... &&`。只有手工编写纯 cmd 命令时,跨盘 `cd` 才需要 `/d`。
|
|
10
|
-
- PowerShell 专用语法(Get-Item、2>$null、Select-Object)不能直接写进 `run_command`;确需使用时,用 `run_process` 显式执行 `powershell.exe` 并逐项传参。
|
|
11
|
-
- npm 11.x 在 Windows 上忽略 `--prefix` 对 `npm publish` 的作用。发布时把工具的 `cwd` 参数设为目标包目录,再执行 `npm publish`。
|
|
1
|
+
## Windows 命令行提示
|
|
2
|
+
|
|
3
|
+
你运行在 Windows 上。优先绕过 shell,只有需要 shell 运算符时才进入 cmd.exe:
|
|
4
|
+
|
|
5
|
+
- 单个程序优先用 `run_process`,把可执行文件和每个参数分别放进 `executable` / `args`。它使用 `shell:false`,不会让 cmd.exe 再解释引号、反斜杠、`&`、`%VAR%` 等内容。
|
|
6
|
+
- 多行或引号密集的 Python/Node 代码必须用 `run_script`。不要塞进 `python -c` / `node -e`;Windows 下复杂内联代码会被 `run_command` 拒绝,避免命令返回 0 却实际执行了不同代码。
|
|
7
|
+
- `run_command` 仅用于 `&&`、管道、重定向等必须由 shell 解析的场景;它通过 cmd.exe 执行,不是 bash,也不是 PowerShell。
|
|
8
|
+
- 双引号在 cmd.exe、Node 的 shell 封装和目标程序的 argv 解析之间会经历多层处理;是否保留或剥离取决于具体调用链,不能假设会“原样到达”。单引号在 cmd.exe 中不是可靠的引用字符。
|
|
9
|
+
- 使用各命令工具的 `cwd` 参数切换工作目录,不要前置 `cd /d ... &&`。只有手工编写纯 cmd 命令时,跨盘 `cd` 才需要 `/d`。
|
|
10
|
+
- PowerShell 专用语法(Get-Item、2>$null、Select-Object)不能直接写进 `run_command`;确需使用时,用 `run_process` 显式执行 `powershell.exe` 并逐项传参。
|
|
11
|
+
- npm 11.x 在 Windows 上忽略 `--prefix` 对 `npm publish` 的作用。发布时把工具的 `cwd` 参数设为目标包目录,再执行 `npm publish`。
|
|
@@ -1,68 +1,68 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "deepccc",
|
|
3
|
-
"version": "0.2.
|
|
4
|
-
"description": "A lightweight coding agent with OpenAI-compatible and Anthropic Messages API support.",
|
|
5
|
-
"license": "Apache-2.0",
|
|
6
|
-
"keywords": [
|
|
7
|
-
"agent",
|
|
8
|
-
"deepseek",
|
|
9
|
-
"coding-agent",
|
|
10
|
-
"openai-compatible",
|
|
11
|
-
"anthropic",
|
|
12
|
-
"cli"
|
|
13
|
-
],
|
|
14
|
-
"repository": {
|
|
15
|
-
"type": "git",
|
|
16
|
-
"url": "git+https://github.com/wzj998/deepccc-agent.git"
|
|
17
|
-
},
|
|
18
|
-
"bugs": {
|
|
19
|
-
"url": "https://github.com/wzj998/deepccc-agent/issues"
|
|
20
|
-
},
|
|
21
|
-
"homepage": "https://github.com/wzj998/deepccc-agent#readme",
|
|
22
|
-
"type": "module",
|
|
23
|
-
"main": "./dist/index.js",
|
|
24
|
-
"types": "./dist/index.d.ts",
|
|
25
|
-
"exports": {
|
|
26
|
-
".": {
|
|
27
|
-
"types": "./dist/index.d.ts",
|
|
28
|
-
"import": "./dist/index.js"
|
|
29
|
-
}
|
|
30
|
-
},
|
|
31
|
-
"bin": {
|
|
32
|
-
"deepccc": "bin/deepccc.mjs",
|
|
33
|
-
"deepccc-cli": "bin/deepccc-cli.mjs"
|
|
34
|
-
},
|
|
35
|
-
"files": [
|
|
36
|
-
"dist/",
|
|
37
|
-
"bin/",
|
|
38
|
-
"docs/",
|
|
39
|
-
"os-prompts/",
|
|
40
|
-
"package.json",
|
|
41
|
-
"README.md",
|
|
42
|
-
"LICENSE"
|
|
43
|
-
],
|
|
44
|
-
"scripts": {
|
|
45
|
-
"dev": "tsx src/web-entry.ts",
|
|
46
|
-
"dev:cli": "tsx src/cli.ts",
|
|
47
|
-
"build": "node node_modules/typescript/bin/tsc -p tsconfig.build.json",
|
|
48
|
-
"prepack": "node node_modules/typescript/bin/tsc -p tsconfig.build.json",
|
|
49
|
-
"test": "vitest run",
|
|
50
|
-
"test:watch": "vitest",
|
|
51
|
-
"typecheck": "node node_modules/typescript/bin/tsc --noEmit"
|
|
52
|
-
},
|
|
53
|
-
"dependencies": {
|
|
54
|
-
"@ai-sdk/anthropic": "^3.0.105",
|
|
55
|
-
"@ai-sdk/openai-compatible": "^2.0.47",
|
|
56
|
-
"@vscode/ripgrep": "^1.18.0",
|
|
57
|
-
"ai": "^6.0.184"
|
|
58
|
-
},
|
|
59
|
-
"devDependencies": {
|
|
60
|
-
"@types/node": "^20.0.0",
|
|
61
|
-
"tsx": "^4.0.0",
|
|
62
|
-
"typescript": "^5.0.0",
|
|
63
|
-
"vitest": "^3.2.4"
|
|
64
|
-
},
|
|
65
|
-
"engines": {
|
|
66
|
-
"node": ">=20"
|
|
67
|
-
}
|
|
68
|
-
}
|
|
1
|
+
{
|
|
2
|
+
"name": "deepccc",
|
|
3
|
+
"version": "0.2.27",
|
|
4
|
+
"description": "A lightweight coding agent with OpenAI-compatible and Anthropic Messages API support.",
|
|
5
|
+
"license": "Apache-2.0",
|
|
6
|
+
"keywords": [
|
|
7
|
+
"agent",
|
|
8
|
+
"deepseek",
|
|
9
|
+
"coding-agent",
|
|
10
|
+
"openai-compatible",
|
|
11
|
+
"anthropic",
|
|
12
|
+
"cli"
|
|
13
|
+
],
|
|
14
|
+
"repository": {
|
|
15
|
+
"type": "git",
|
|
16
|
+
"url": "git+https://github.com/wzj998/deepccc-agent.git"
|
|
17
|
+
},
|
|
18
|
+
"bugs": {
|
|
19
|
+
"url": "https://github.com/wzj998/deepccc-agent/issues"
|
|
20
|
+
},
|
|
21
|
+
"homepage": "https://github.com/wzj998/deepccc-agent#readme",
|
|
22
|
+
"type": "module",
|
|
23
|
+
"main": "./dist/index.js",
|
|
24
|
+
"types": "./dist/index.d.ts",
|
|
25
|
+
"exports": {
|
|
26
|
+
".": {
|
|
27
|
+
"types": "./dist/index.d.ts",
|
|
28
|
+
"import": "./dist/index.js"
|
|
29
|
+
}
|
|
30
|
+
},
|
|
31
|
+
"bin": {
|
|
32
|
+
"deepccc": "bin/deepccc.mjs",
|
|
33
|
+
"deepccc-cli": "bin/deepccc-cli.mjs"
|
|
34
|
+
},
|
|
35
|
+
"files": [
|
|
36
|
+
"dist/",
|
|
37
|
+
"bin/",
|
|
38
|
+
"docs/",
|
|
39
|
+
"os-prompts/",
|
|
40
|
+
"package.json",
|
|
41
|
+
"README.md",
|
|
42
|
+
"LICENSE"
|
|
43
|
+
],
|
|
44
|
+
"scripts": {
|
|
45
|
+
"dev": "tsx src/web-entry.ts",
|
|
46
|
+
"dev:cli": "tsx src/cli.ts",
|
|
47
|
+
"build": "node node_modules/typescript/bin/tsc -p tsconfig.build.json",
|
|
48
|
+
"prepack": "node node_modules/typescript/bin/tsc -p tsconfig.build.json",
|
|
49
|
+
"test": "vitest run",
|
|
50
|
+
"test:watch": "vitest",
|
|
51
|
+
"typecheck": "node node_modules/typescript/bin/tsc --noEmit"
|
|
52
|
+
},
|
|
53
|
+
"dependencies": {
|
|
54
|
+
"@ai-sdk/anthropic": "^3.0.105",
|
|
55
|
+
"@ai-sdk/openai-compatible": "^2.0.47",
|
|
56
|
+
"@vscode/ripgrep": "^1.18.0",
|
|
57
|
+
"ai": "^6.0.184"
|
|
58
|
+
},
|
|
59
|
+
"devDependencies": {
|
|
60
|
+
"@types/node": "^20.0.0",
|
|
61
|
+
"tsx": "^4.0.0",
|
|
62
|
+
"typescript": "^5.0.0",
|
|
63
|
+
"vitest": "^3.2.4"
|
|
64
|
+
},
|
|
65
|
+
"engines": {
|
|
66
|
+
"node": ">=20"
|
|
67
|
+
}
|
|
68
|
+
}
|
|
@@ -22,7 +22,7 @@ export class AttachmentStore {
|
|
|
22
22
|
throw new Error("Image attachment exceeds the 20 MB limit");
|
|
23
23
|
const mimeType = detectImageMime(bytes);
|
|
24
24
|
if (!mimeType)
|
|
25
|
-
throw new Error("Only PNG, JPEG, or WebP image attachments are supported");
|
|
25
|
+
throw new Error("Only PNG, JPEG, or WebP image attachments (also GIF) are supported");
|
|
26
26
|
const normalizedSessionId = normalizeBuiltinSessionId(sessionId);
|
|
27
27
|
const attachmentId = normalizeAttachmentId(this.idFactory());
|
|
28
28
|
const extension = extensionForMime(mimeType);
|
|
@@ -98,7 +98,7 @@ export class AttachmentStore {
|
|
|
98
98
|
return null;
|
|
99
99
|
if (typeof value.originalName !== "string" || typeof value.size !== "number")
|
|
100
100
|
return null;
|
|
101
|
-
if (value.mimeType !== "image/png" && value.mimeType !== "image/jpeg" && value.mimeType !== "image/webp")
|
|
101
|
+
if (value.mimeType !== "image/png" && value.mimeType !== "image/jpeg" && value.mimeType !== "image/webp" && value.mimeType !== "image/gif")
|
|
102
102
|
return null;
|
|
103
103
|
if (value.fileName !== `${normalizedId}${extensionForMime(value.mimeType)}`)
|
|
104
104
|
return null;
|
|
@@ -133,7 +133,7 @@ export function buildAttachmentPrompt(text, attachments) {
|
|
|
133
133
|
ATTACHMENT_PROMPT_START,
|
|
134
134
|
JSON.stringify(manifest),
|
|
135
135
|
ATTACHMENT_PROMPT_END,
|
|
136
|
-
"
|
|
136
|
+
"图片由内核转换为视觉输入;历史中只保存附件引用,需要重新查看时使用 read_image。",
|
|
137
137
|
].join("\n");
|
|
138
138
|
}
|
|
139
139
|
export function parseAttachmentPrompt(content) {
|
|
@@ -155,6 +155,8 @@ export function parseAttachmentPrompt(content) {
|
|
|
155
155
|
}
|
|
156
156
|
export function detectImageMime(bytes) {
|
|
157
157
|
const buffer = Buffer.from(bytes);
|
|
158
|
+
if (buffer.length >= 10 && /GIF8[79]a/.test(buffer.subarray(0, 6).toString("ascii")))
|
|
159
|
+
return "image/gif";
|
|
158
160
|
if (buffer.length >= 8 && buffer.subarray(0, 8).equals(Buffer.from([137, 80, 78, 71, 13, 10, 26, 10])))
|
|
159
161
|
return "image/png";
|
|
160
162
|
if (buffer.length >= 3 && buffer[0] === 0xff && buffer[1] === 0xd8 && buffer[2] === 0xff)
|
|
@@ -164,7 +166,7 @@ export function detectImageMime(bytes) {
|
|
|
164
166
|
return null;
|
|
165
167
|
}
|
|
166
168
|
function extensionForMime(mimeType) {
|
|
167
|
-
return mimeType === "image/png" ? ".png" : mimeType === "image/jpeg" ? ".jpg" : ".webp";
|
|
169
|
+
return mimeType === "image/png" ? ".png" : mimeType === "image/jpeg" ? ".jpg" : mimeType === "image/gif" ? ".gif" : ".webp";
|
|
168
170
|
}
|
|
169
171
|
function cleanOriginalName(value, extension) {
|
|
170
172
|
const cleaned = basename(value || `image${extension}`).replace(/[\u0000-\u001f<>:"/\\|?*]+/g, "_").slice(0, 180);
|
|
@@ -188,5 +190,5 @@ function isAttachmentMeta(value) {
|
|
|
188
190
|
&& typeof attachment.originalName === "string"
|
|
189
191
|
&& typeof attachment.absolutePath === "string"
|
|
190
192
|
&& typeof attachment.size === "number"
|
|
191
|
-
&& (attachment.mimeType === "image/png" || attachment.mimeType === "image/jpeg" || attachment.mimeType === "image/webp");
|
|
193
|
+
&& (attachment.mimeType === "image/png" || attachment.mimeType === "image/jpeg" || attachment.mimeType === "image/webp" || attachment.mimeType === "image/gif");
|
|
192
194
|
}
|