chatccc 0.2.246 → 0.2.247
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 +2 -0
- package/config.sample.json +2 -1
- package/deepccc-agent/README.md +34 -34
- 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 +9 -9
- package/deepccc-agent/package-lock.json +2027 -2027
- package/deepccc-agent/package.json +65 -65
- package/deepccc-agent/src/__tests__/chat-session.test.ts +741 -741
- package/deepccc-agent/src/__tests__/config.test.ts +34 -34
- package/deepccc-agent/src/__tests__/permissions.test.ts +199 -199
- package/deepccc-agent/src/__tests__/privacy.test.ts +15 -15
- package/deepccc-agent/src/cli.ts +25 -25
- package/deepccc-agent/src/config.ts +101 -101
- package/deepccc-agent/src/index.ts +99 -99
- package/package.json +74 -74
- package/src/__tests__/builtin-chat-session.test.ts +532 -532
- package/src/__tests__/builtin-permissions.test.ts +219 -219
- package/src/__tests__/ccc-adapter.test.ts +194 -194
- package/src/__tests__/config-reload.test.ts +1 -1
- package/src/__tests__/config-utils.test.ts +40 -0
- package/src/__tests__/session-ccc-config.test.ts +21 -0
- package/src/__tests__/session.test.ts +369 -369
- package/src/__tests__/web-ui.test.ts +2 -0
- package/src/adapters/adapter-interface.ts +42 -42
- package/src/adapters/ccc-adapter.ts +150 -150
- package/src/config-utils.ts +37 -13
- package/src/config.ts +23 -13
- package/src/session.ts +2 -0
- package/src/web-ui.ts +33 -2
package/README.md
CHANGED
|
@@ -216,6 +216,8 @@ CCC Agent 是 ChatCCC 内置的编程 Agent,不需要额外安装 CLI,开箱
|
|
|
216
216
|
|
|
217
217
|
ChatCCC 会把 `ccc.DEEPSEEK_API_KEY`、`ccc.DEEPSEEK_BASE_URL`、模型和 effort 显式传给内置 Agent;API Key 为空时 CCC Agent 会自动保持禁用。DeepCCC 的传输层选项 `provider`(默认 `openai`)和 `streaming`(默认 `true`)可通过 `~/.deepccc/config.json` 或 `DEEPCCC_PROVIDER` / `DEEPCCC_STREAMING` 配置,无需额外安装独立 CLI。
|
|
218
218
|
|
|
219
|
+
**协议 override:** 也可以在 ChatCCC 的配置(`config.json` 的 `ccc.provider`,或 Web 管理页的「CCC Agent → API 协议」)显式指定 `openai` / `anthropic` 覆盖内核配置;留空(默认)时跟随 `~/.deepccc/config.json` / `DEEPCCC_PROVIDER`。`streaming` 不做 override,始终由 DeepCCC 内核配置控制。
|
|
220
|
+
|
|
219
221
|
**API 支持不限于 DeepSeek。** 默认的 `provider: "openai"` 使用 OpenAI 兼容协议(`@ai-sdk/openai-compatible`),DeepSeek 只是出厂默认端点;设置 `provider: "anthropic"` 后改用 Anthropic Messages 协议(`@ai-sdk/anthropic`)。两种模式都支持流式输出,并复用相同的 API Key、Base URL 和模型配置。
|
|
220
222
|
|
|
221
223
|
| 服务 | Base URL 示例 | 说明 |
|
package/config.sample.json
CHANGED
package/deepccc-agent/README.md
CHANGED
|
@@ -45,19 +45,19 @@ deepccc 的本地缓存优化实测命中率 **96.7%**,有效降低重复请
|
|
|
45
45
|
|
|
46
46
|
```bash
|
|
47
47
|
export DEEPCCC_API_KEY="sk-..."
|
|
48
|
-
export DEEPCCC_BASE_URL="https://api.deepseek.com/v1"
|
|
49
|
-
export DEEPCCC_MODEL="deepseek-v4-pro"
|
|
50
|
-
export DEEPCCC_STREAMING="true"
|
|
48
|
+
export DEEPCCC_BASE_URL="https://api.deepseek.com/v1"
|
|
49
|
+
export DEEPCCC_MODEL="deepseek-v4-pro"
|
|
50
|
+
export DEEPCCC_STREAMING="true"
|
|
51
51
|
```
|
|
52
52
|
|
|
53
53
|
Windows PowerShell:
|
|
54
54
|
|
|
55
55
|
```powershell
|
|
56
|
-
$env:DEEPCCC_API_KEY="sk-..."
|
|
57
|
-
$env:DEEPCCC_PROVIDER="openai"
|
|
58
|
-
$env:DEEPCCC_BASE_URL="https://api.deepseek.com/v1"
|
|
59
|
-
$env:DEEPCCC_MODEL="deepseek-v4-pro"
|
|
60
|
-
$env:DEEPCCC_STREAMING="true"
|
|
56
|
+
$env:DEEPCCC_API_KEY="sk-..."
|
|
57
|
+
$env:DEEPCCC_PROVIDER="openai"
|
|
58
|
+
$env:DEEPCCC_BASE_URL="https://api.deepseek.com/v1"
|
|
59
|
+
$env:DEEPCCC_MODEL="deepseek-v4-pro"
|
|
60
|
+
$env:DEEPCCC_STREAMING="true"
|
|
61
61
|
```
|
|
62
62
|
|
|
63
63
|
也兼容这些 DeepSeek 别名:
|
|
@@ -70,30 +70,30 @@ $env:DEEPCCC_STREAMING="true"
|
|
|
70
70
|
也可以创建 `~/.deepccc/config.json`:
|
|
71
71
|
|
|
72
72
|
```json
|
|
73
|
-
{
|
|
74
|
-
"provider": "openai",
|
|
75
|
-
"apiKey": "sk-...",
|
|
73
|
+
{
|
|
74
|
+
"provider": "openai",
|
|
75
|
+
"apiKey": "sk-...",
|
|
76
76
|
"baseURL": "https://api.deepseek.com/v1",
|
|
77
|
-
"model": "deepseek-v4-pro",
|
|
78
|
-
"effort": "",
|
|
79
|
-
"streaming": true,
|
|
77
|
+
"model": "deepseek-v4-pro",
|
|
78
|
+
"effort": "",
|
|
79
|
+
"streaming": true,
|
|
80
80
|
"rawStreamLogs": {
|
|
81
81
|
"enabled": false,
|
|
82
82
|
"maxBytesPerTurn": 1048576,
|
|
83
83
|
"retentionDays": 7,
|
|
84
84
|
"keepCompleted": false
|
|
85
85
|
}
|
|
86
|
-
}
|
|
87
|
-
```
|
|
88
|
-
|
|
89
|
-
`provider` 可选 `openai` 或 `anthropic`,默认 `openai`,也可以通过
|
|
90
|
-
`DEEPCCC_PROVIDER` 或命令行 `--provider` 覆盖:
|
|
91
|
-
|
|
92
|
-
- `openai` 使用 OpenAI-compatible Chat Completions 协议,兼容 DeepSeek、OpenAI、LiteLLM、vLLM 等服务。
|
|
93
|
-
- `anthropic` 使用 Anthropic Messages 协议。配置中的 `baseURL` 可以继续填写同一个服务基址;DeepCCC 会为不带 `/v1` 的地址自动补上 `/v1`。`effort` 是 OpenAI/DeepSeek 扩展参数,在 Anthropic 模式下不会发送。
|
|
94
|
-
|
|
95
|
-
`streaming` 控制主对话是否使用流式请求,默认 `true`;也可以通过
|
|
96
|
-
`DEEPCCC_STREAMING=true|false` 覆盖。关闭后,终端会在整条模型响应完成后一次性显示结果。
|
|
86
|
+
}
|
|
87
|
+
```
|
|
88
|
+
|
|
89
|
+
`provider` 可选 `openai` 或 `anthropic`,默认 `openai`,也可以通过
|
|
90
|
+
`DEEPCCC_PROVIDER` 或命令行 `--provider` 覆盖:
|
|
91
|
+
|
|
92
|
+
- `openai` 使用 OpenAI-compatible Chat Completions 协议,兼容 DeepSeek、OpenAI、LiteLLM、vLLM 等服务。
|
|
93
|
+
- `anthropic` 使用 Anthropic Messages 协议。配置中的 `baseURL` 可以继续填写同一个服务基址;DeepCCC 会为不带 `/v1` 的地址自动补上 `/v1`。`effort` 是 OpenAI/DeepSeek 扩展参数,在 Anthropic 模式下不会发送。
|
|
94
|
+
|
|
95
|
+
`streaming` 控制主对话是否使用流式请求,默认 `true`;也可以通过
|
|
96
|
+
`DEEPCCC_STREAMING=true|false` 覆盖。关闭后,终端会在整条模型响应完成后一次性显示结果。
|
|
97
97
|
|
|
98
98
|
## 命令行交互
|
|
99
99
|
|
|
@@ -103,17 +103,17 @@ $env:DEEPCCC_STREAMING="true"
|
|
|
103
103
|
deepccc
|
|
104
104
|
```
|
|
105
105
|
|
|
106
|
-
指定其他模型或 OpenAI-compatible 接口:
|
|
106
|
+
指定其他模型或 OpenAI-compatible 接口:
|
|
107
107
|
|
|
108
108
|
```bash
|
|
109
|
-
deepccc --base-url https://api.openai.com/v1 --api-key "$OPENAI_API_KEY" --model gpt-4.1
|
|
110
|
-
```
|
|
111
|
-
|
|
112
|
-
使用 Anthropic Messages 协议(同样支持流式输出):
|
|
113
|
-
|
|
114
|
-
```bash
|
|
115
|
-
deepccc --provider anthropic --base-url https://api.example.com --api-key "$API_KEY" --model claude-sonnet-4-6
|
|
116
|
-
```
|
|
109
|
+
deepccc --base-url https://api.openai.com/v1 --api-key "$OPENAI_API_KEY" --model gpt-4.1
|
|
110
|
+
```
|
|
111
|
+
|
|
112
|
+
使用 Anthropic Messages 协议(同样支持流式输出):
|
|
113
|
+
|
|
114
|
+
```bash
|
|
115
|
+
deepccc --provider anthropic --base-url https://api.example.com --api-key "$API_KEY" --model claude-sonnet-4-6
|
|
116
|
+
```
|
|
117
117
|
|
|
118
118
|
指定工作目录:
|
|
119
119
|
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
## macOS Command-Line Notes
|
|
2
|
-
|
|
3
|
-
You are running on macOS. run_command executes through zsh, a POSIX shell. Quoting follows standard POSIX conventions (the same habits you already know from bash):
|
|
4
|
-
|
|
5
|
-
- Double quotes are stripped and group an argument containing spaces: `echo "hello world"` prints `hello world`.
|
|
6
|
-
- Single quotes are literal quoting characters: `'a b'` is a single argument `a b`.
|
|
7
|
-
- Backticks and `$(...)` perform command substitution; quote them if you need literal text.
|
|
8
|
-
- Paths use `/` separators and `~` expands to the home directory.
|
|
1
|
+
## macOS Command-Line Notes
|
|
2
|
+
|
|
3
|
+
You are running on macOS. run_command executes through zsh, a POSIX shell. Quoting follows standard POSIX conventions (the same habits you already know from bash):
|
|
4
|
+
|
|
5
|
+
- Double quotes are stripped and group an argument containing spaces: `echo "hello world"` prints `hello world`.
|
|
6
|
+
- Single quotes are literal quoting characters: `'a b'` is a single argument `a b`.
|
|
7
|
+
- Backticks and `$(...)` perform command substitution; quote them if you need literal text.
|
|
8
|
+
- Paths use `/` separators and `~` expands to the home directory.
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
## Linux Command-Line Notes
|
|
2
|
-
|
|
3
|
-
You are running on Linux. run_command executes through a POSIX shell (bash/sh). Quoting follows standard POSIX conventions (the same habits you already know from bash):
|
|
4
|
-
|
|
5
|
-
- Double quotes are stripped and group an argument containing spaces: `echo "hello world"` prints `hello world`.
|
|
6
|
-
- Single quotes are literal quoting characters: `'a b'` is a single argument `a b`.
|
|
7
|
-
- Backticks and `$(...)` perform command substitution; quote them if you need literal text.
|
|
8
|
-
- Paths use `/` separators and `~` expands to the home directory.
|
|
1
|
+
## Linux Command-Line Notes
|
|
2
|
+
|
|
3
|
+
You are running on Linux. run_command executes through a POSIX shell (bash/sh). Quoting follows standard POSIX conventions (the same habits you already know from bash):
|
|
4
|
+
|
|
5
|
+
- Double quotes are stripped and group an argument containing spaces: `echo "hello world"` prints `hello world`.
|
|
6
|
+
- Single quotes are literal quoting characters: `'a b'` is a single argument `a b`.
|
|
7
|
+
- Backticks and `$(...)` perform command substitution; quote them if you need literal text.
|
|
8
|
+
- Paths use `/` separators and `~` expands to the home directory.
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
## Windows Command-Line Notes
|
|
2
|
-
|
|
3
|
-
You are running on Windows. run_command executes through cmd.exe, not bash. cmd quoting differs from bash and breaks common habits:
|
|
4
|
-
|
|
5
|
-
- Double quotes are NOT stripped: `echo "hello world"` prints `"hello world"` (quotes included), and `"a b" "c"` passes the literal arguments `"a b"` and `"c"` (quotes included) to the program.
|
|
6
|
-
- Single quotes are NOT quoting characters in cmd.exe: `'a b'` is parsed as two arguments (`'a` and `b'`).
|
|
7
|
-
- Multi-line or quote-heavy inline scripts (python -c "...\n...", ssh host "bash -c '...'") frequently break under cmd quoting; write the script to a temporary file and execute that file instead.
|
|
8
|
-
- PowerShell-only syntax (Get-Item, 2>$null, Select-Object) is unavailable; the shell is cmd.exe unless you explicitly invoke powershell.
|
|
9
|
-
- To pass an argument containing spaces, use double quotes and expect the quotes to reach the program literally; when the target accepts file input, prefer writing the value to a file.
|
|
1
|
+
## Windows Command-Line Notes
|
|
2
|
+
|
|
3
|
+
You are running on Windows. run_command executes through cmd.exe, not bash. cmd quoting differs from bash and breaks common habits:
|
|
4
|
+
|
|
5
|
+
- Double quotes are NOT stripped: `echo "hello world"` prints `"hello world"` (quotes included), and `"a b" "c"` passes the literal arguments `"a b"` and `"c"` (quotes included) to the program.
|
|
6
|
+
- Single quotes are NOT quoting characters in cmd.exe: `'a b'` is parsed as two arguments (`'a` and `b'`).
|
|
7
|
+
- Multi-line or quote-heavy inline scripts (python -c "...\n...", ssh host "bash -c '...'") frequently break under cmd quoting; write the script to a temporary file and execute that file instead.
|
|
8
|
+
- PowerShell-only syntax (Get-Item, 2>$null, Select-Object) is unavailable; the shell is cmd.exe unless you explicitly invoke powershell.
|
|
9
|
+
- To pass an argument containing spaces, use double quotes and expect the quotes to reach the program literally; when the target accepts file input, prefer writing the value to a file.
|