cc-viewer 1.6.330 → 1.6.331
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 +7 -8
- package/cli.js +6 -6
- package/concepts/ar/GlobalSettings.md +5 -2
- package/concepts/ar/ProxySwitch.md +15 -5
- package/concepts/da/GlobalSettings.md +5 -2
- package/concepts/da/ProxySwitch.md +15 -5
- package/concepts/de/GlobalSettings.md +5 -2
- package/concepts/de/ProxySwitch.md +15 -5
- package/concepts/en/GlobalSettings.md +7 -2
- package/concepts/en/ProxySwitch.md +15 -5
- package/concepts/es/GlobalSettings.md +5 -2
- package/concepts/es/ProxySwitch.md +15 -5
- package/concepts/fr/GlobalSettings.md +5 -2
- package/concepts/fr/ProxySwitch.md +15 -5
- package/concepts/it/GlobalSettings.md +5 -2
- package/concepts/it/ProxySwitch.md +15 -5
- package/concepts/ja/GlobalSettings.md +5 -2
- package/concepts/ja/ProxySwitch.md +15 -5
- package/concepts/ko/GlobalSettings.md +5 -2
- package/concepts/ko/ProxySwitch.md +15 -5
- package/concepts/no/GlobalSettings.md +5 -2
- package/concepts/no/ProxySwitch.md +15 -5
- package/concepts/pl/GlobalSettings.md +5 -2
- package/concepts/pl/ProxySwitch.md +15 -5
- package/concepts/pt-BR/GlobalSettings.md +5 -2
- package/concepts/pt-BR/ProxySwitch.md +34 -24
- package/concepts/ru/GlobalSettings.md +5 -2
- package/concepts/ru/ProxySwitch.md +15 -5
- package/concepts/th/GlobalSettings.md +5 -2
- package/concepts/th/ProxySwitch.md +15 -5
- package/concepts/tr/GlobalSettings.md +5 -2
- package/concepts/tr/ProxySwitch.md +34 -24
- package/concepts/uk/GlobalSettings.md +5 -2
- package/concepts/uk/ProxySwitch.md +15 -5
- package/concepts/zh/GlobalSettings.md +5 -2
- package/concepts/zh/ProxySwitch.md +15 -5
- package/concepts/zh-TW/GlobalSettings.md +7 -4
- package/concepts/zh-TW/ProxySwitch.md +15 -5
- package/dist/assets/App-CCQARuiH.js +2 -0
- package/dist/assets/{MdxEditorPanel-BmO4cIBT.js → MdxEditorPanel-BjJTwpmV.js} +1 -1
- package/dist/assets/{Mobile-ZXwho8zA.js → Mobile-BsJPIcqy.js} +1 -1
- package/dist/assets/{index-D4Pum3K_.js → index-ReSZCrNR.js} +2 -2
- package/dist/assets/seqResourceLoaders-K-REW6io.js +2 -0
- package/dist/assets/{seqResourceLoaders-BFMsIN74.css → seqResourceLoaders-P_ytfji6.css} +1 -1
- package/dist/index.html +1 -1
- package/dist/voice-packs/default/pack.json +1 -1
- package/findcc.js +50 -40
- package/interceptor.js +1 -1
- package/package.json +8 -4
- package/plugins/README.md +8 -0
- package/server/_paths.js +24 -22
- package/server/interceptor.js +39 -25
- package/server/lib/interceptor-core.js +107 -0
- package/server/routes/preferences.js +14 -1
- package/server.js +1 -0
- package/ultraAgents/README.md +49 -40
- package/dist/assets/App-DPdFPyOI.js +0 -2
- package/dist/assets/seqResourceLoaders-DXQFWqYa.js +0 -2
package/README.md
CHANGED
|
@@ -1,16 +1,15 @@
|
|
|
1
1
|
<img height="200" width="1500" alt="CC-Viewer" src="https://github.com/user-attachments/assets/abec0513-1d56-4244-b7ed-9382b6c09049" />
|
|
2
2
|
|
|
3
|
+
As the author's account has been disabled by Claude Code, updates to the repository are paused for a few weeks.
|
|
4
|
+
|
|
5
|
+
The author is taking this opportunity to work on a multimodal project.
|
|
6
|
+
|
|
7
|
+
If there are any critical bugs requiring fixes, please submit them via the issues section; they can still be addressed.
|
|
8
|
+
|
|
3
9
|
# CC-Viewer
|
|
4
10
|
|
|
5
11
|
Based on Claude Code, a Vibe Coding tool that distills and accumulates real development experience:
|
|
6
12
|
|
|
7
|
-
1. Raise your capability ceiling: run /ultraPlan and /ultraReview locally, while avoiding fully exposing your project code to Claude's cloud;
|
|
8
|
-
2. Multi-device compatibility: code on mobile devices (within your LAN), the web version adapts to all kinds of scenarios, easy to embed into browser extensions or OS split-screen, and native installers are provided;
|
|
9
|
-
3. Complete log tracing: full Claude Code payload interception and analysis — ideal for logging, troubleshooting, learning, and reverse engineering;
|
|
10
|
-
4. Shared learning and experience: lots of learning material and development know-how are baked in (see the "?" icons throughout the system);
|
|
11
|
-
5. Native experience preserved: only enhances Claude Code's capabilities without making any substantive changes to the core, keeping the native experience intact;
|
|
12
|
-
6. Third-party model support: compatible with deepseek-v4-\*, GLM 5.1, Kimi K2.6, with cc-switch built in so you can hot-swap third-party tools at any time;
|
|
13
|
-
|
|
14
13
|
<img width="860" alt="cc-viewer — deploy once, share with every device" src="https://raw.githubusercontent.com/weiesky/cc-viewer/main/docs/cc-viewer-share.svg" />
|
|
15
14
|
|
|
16
15
|
English | [简体中文](./docs/README.zh.md) | [繁體中文](./docs/README.zh-TW.md) | [한국어](./docs/README.ko.md) | [日本語](./docs/README.ja.md) | [Deutsch](./docs/README.de.md) | [Español](./docs/README.es.md) | [Français](./docs/README.fr.md) | [Italiano](./docs/README.it.md) | [Dansk](./docs/README.da.md) | [Polski](./docs/README.pl.md) | [Русский](./docs/README.ru.md) | [العربية](./docs/README.ar.md) | [Norsk](./docs/README.no.md) | [Português (Brasil)](./docs/README.pt-BR.md) | [ไทย](./docs/README.th.md) | [Türkçe](./docs/README.tr.md) | [Українська](./docs/README.uk.md)
|
|
@@ -152,7 +151,7 @@ By default, remote (LAN) access requires the `?token=` query that ccv prints at
|
|
|
152
151
|
* Each request inlines Token usage stats (input/output tokens, cache creation/read, hit rate)
|
|
153
152
|
* Compatible with Claude Code Router (CCR) and other proxy scenarios — falls back to matching requests by API path pattern
|
|
154
153
|
|
|
155
|
-
<a href="https://www.star-history.com/?repos=weiesky%2Fcc-viewer
|
|
154
|
+
<a href="https://www.star-history.com/?type=date&repos=weiesky%2Fcc-viewer">
|
|
156
155
|
<picture>
|
|
157
156
|
<source media="(prefers-color-scheme: dark)" srcset="https://api.star-history.com/chart?repos=weiesky/cc-viewer&type=date&theme=dark&legend=top-left" />
|
|
158
157
|
<source media="(prefers-color-scheme: light)" srcset="https://api.star-history.com/chart?repos=weiesky/cc-viewer&type=date&legend=top-left" />
|
package/cli.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
|
|
3
|
-
// Windows NTFS + Defender
|
|
3
|
+
// Windows NTFS + Defender increase per-async-IO overhead; default 4 threads aren't enough
|
|
4
4
|
if (process.platform === 'win32' && !process.env.UV_THREADPOOL_SIZE) {
|
|
5
5
|
process.env.UV_THREADPOOL_SIZE = '16';
|
|
6
6
|
}
|
|
@@ -19,8 +19,8 @@ import { createHardenedCleanup, installWinKeypressFallback } from './server/lib/
|
|
|
19
19
|
|
|
20
20
|
const __dirname = fileURLToPath(new URL('.', import.meta.url));
|
|
21
21
|
|
|
22
|
-
//
|
|
23
|
-
//
|
|
22
|
+
// Injection marker constants are defined in server/lib/cli-inject.js (for testability);
|
|
23
|
+
// This file only re-exports them for use by helpers and hooks, preserving existing behavior.
|
|
24
24
|
const INJECT_START = _INJECT_START;
|
|
25
25
|
const INJECT_END = _INJECT_END;
|
|
26
26
|
const INJECT_BLOCK = _buildInjectBlock(INJECT_IMPORT);
|
|
@@ -31,9 +31,9 @@ const SHELL_HOOK_END = '# <<< CC-Viewer Auto-Inject <<<';
|
|
|
31
31
|
|
|
32
32
|
const cliPath = resolveCliPath();
|
|
33
33
|
|
|
34
|
-
//
|
|
35
|
-
//
|
|
36
|
-
//
|
|
34
|
+
// Unified "claude not found" error message: distinguishes between "Claude Code 2.x wrapper
|
|
35
|
+
// installed but native binary not ready (--ignore-scripts / --omit=optional / certain pnpm
|
|
36
|
+
// configurations)" and "claude not installed at all," giving targeted fix guidance.
|
|
37
37
|
function reportClaudeNotFound(cliPathHint) {
|
|
38
38
|
const globalRoot = getGlobalNodeModulesDir();
|
|
39
39
|
if (hasClaude2xWrapper(globalRoot)) {
|
|
@@ -165,8 +165,11 @@ claude() { ... }
|
|
|
165
165
|
| `name` | 显示名称 |
|
|
166
166
|
| `baseURL` | 代理 API 地址(替换请求 origin) |
|
|
167
167
|
| `apiKey` | 代理 API 密钥(替换认证头) |
|
|
168
|
-
| `
|
|
169
|
-
| `
|
|
168
|
+
| `ANTHROPIC_MODEL` | 主模型(fable/mythos 系列映射到此) |
|
|
169
|
+
| `ANTHROPIC_DEFAULT_OPUS_MODEL` | opus 系列使用的模型(扩展) |
|
|
170
|
+
| `ANTHROPIC_DEFAULT_SONNET_MODEL` | sonnet 系列使用的模型(扩展) |
|
|
171
|
+
| `ANTHROPIC_DEFAULT_HAIKU_MODEL` | haiku 系列使用的模型(扩展) |
|
|
172
|
+
| `effort` | 强制的 `output_config.effort` 等级 |
|
|
170
173
|
|
|
171
174
|
## 九、插件系统
|
|
172
175
|
|
|
@@ -13,8 +13,13 @@ Hot-Switch Proxy lets you dynamically redirect API requests to a different endpo
|
|
|
13
13
|
| **Name** | ✅ | Display name for this proxy, used to identify it |
|
|
14
14
|
| **Base URL** | ✅ | Base URL of the API service (e.g. `https://api.example.com`). The original request origin will be replaced |
|
|
15
15
|
| **API Key** | ✅ | API key for the proxy service, replaces the original authentication |
|
|
16
|
-
| **
|
|
17
|
-
| **
|
|
16
|
+
| **ANTHROPIC_MODEL** | ❌ | Primary model. Requests whose model belongs to the `fable` / `mythos` family are rewritten to this |
|
|
17
|
+
| **ANTHROPIC_DEFAULT_OPUS_MODEL** | ❌ | Extended: requests whose model contains `opus` are rewritten to this |
|
|
18
|
+
| **ANTHROPIC_DEFAULT_SONNET_MODEL** | ❌ | Extended: requests whose model contains `sonnet` are rewritten to this |
|
|
19
|
+
| **ANTHROPIC_DEFAULT_HAIKU_MODEL** | ❌ | Extended: requests whose model contains `haiku` are rewritten to this |
|
|
20
|
+
| **Effort Level** | ❌ | Injects `output_config.effort` (`low`/`medium`/`high`/`xhigh`/`max`) into the request body. Leave as "Default" to skip |
|
|
21
|
+
|
|
22
|
+
Model matching is a case-insensitive substring test on the request's `model` field, so any version (e.g. `claude-opus-4-8`, a future `claude-opus-5`) maps to the same family with no reconfiguration. An empty family field means that family is left unchanged; an unrecognized family is passed through untouched.
|
|
18
23
|
|
|
19
24
|
## How It Works
|
|
20
25
|
|
|
@@ -22,7 +27,8 @@ When a proxy is active, `server/interceptor.js` performs the following before ea
|
|
|
22
27
|
|
|
23
28
|
1. **URL Rewrite** — Replaces the request origin with the proxy's Base URL
|
|
24
29
|
2. **Auth Replace** — Replaces `x-api-key` or `Authorization` header with the proxy's API Key
|
|
25
|
-
3. **Model Replace** —
|
|
30
|
+
3. **Model Replace** — Rewrites the request body `model` by family (opus/sonnet/haiku → the matching field; fable/mythos → `ANTHROPIC_MODEL`)
|
|
31
|
+
4. **Effort Inject** — If an effort level is set, injects `output_config.effort` (skipped for `count_tokens` / heartbeat requests)
|
|
26
32
|
|
|
27
33
|
## Config File
|
|
28
34
|
|
|
@@ -38,8 +44,11 @@ Configuration is stored at `~/.claude/cc-viewer/profile.json`. Click the folder
|
|
|
38
44
|
"name": "My Proxy",
|
|
39
45
|
"baseURL": "https://api.example.com",
|
|
40
46
|
"apiKey": "sk-xxx",
|
|
41
|
-
"
|
|
42
|
-
"
|
|
47
|
+
"ANTHROPIC_MODEL": "model-primary",
|
|
48
|
+
"ANTHROPIC_DEFAULT_OPUS_MODEL": "model-opus",
|
|
49
|
+
"ANTHROPIC_DEFAULT_SONNET_MODEL": "model-sonnet",
|
|
50
|
+
"ANTHROPIC_DEFAULT_HAIKU_MODEL": "model-haiku",
|
|
51
|
+
"effort": "max"
|
|
43
52
|
}
|
|
44
53
|
]
|
|
45
54
|
}
|
|
@@ -47,4 +56,5 @@ Configuration is stored at `~/.claude/cc-viewer/profile.json`. Click the folder
|
|
|
47
56
|
|
|
48
57
|
- `active` — ID of the current profile. Set to `"max"` for direct connection (no proxy)
|
|
49
58
|
- `profiles` — Profile list. `id: "max"` is built-in and cannot be deleted
|
|
59
|
+
- Legacy profiles using `models` / `activeModel` are auto-migrated to `ANTHROPIC_MODEL` on load
|
|
50
60
|
- Changes take effect within ~1.5 seconds (monitored via `fs.watchFile`), no restart needed
|
|
@@ -165,8 +165,11 @@ claude() { ... }
|
|
|
165
165
|
| `name` | 显示名称 |
|
|
166
166
|
| `baseURL` | 代理 API 地址(替换请求 origin) |
|
|
167
167
|
| `apiKey` | 代理 API 密钥(替换认证头) |
|
|
168
|
-
| `
|
|
169
|
-
| `
|
|
168
|
+
| `ANTHROPIC_MODEL` | 主模型(fable/mythos 家族映射到此) |
|
|
169
|
+
| `ANTHROPIC_DEFAULT_OPUS_MODEL` | opus 家族使用的模型(扩展) |
|
|
170
|
+
| `ANTHROPIC_DEFAULT_SONNET_MODEL` | sonnet 家族使用的模型(扩展) |
|
|
171
|
+
| `ANTHROPIC_DEFAULT_HAIKU_MODEL` | haiku 家族使用的模型(扩展) |
|
|
172
|
+
| `effort` | 强制的 `output_config.effort` 级别 |
|
|
170
173
|
|
|
171
174
|
## 九、插件系统
|
|
172
175
|
|
|
@@ -13,8 +13,13 @@ Hot-Switch Proxy lets you dynamically redirect API requests to a different endpo
|
|
|
13
13
|
| **Name** | ✅ | Display name for this proxy, used to identify it |
|
|
14
14
|
| **Base URL** | ✅ | Base URL of the API service (e.g. `https://api.example.com`). The original request origin will be replaced |
|
|
15
15
|
| **API Key** | ✅ | API key for the proxy service, replaces the original authentication |
|
|
16
|
-
| **
|
|
17
|
-
| **
|
|
16
|
+
| **ANTHROPIC_MODEL** | ❌ | Primary model. Requests whose model belongs to the `fable` / `mythos` family are rewritten to this |
|
|
17
|
+
| **ANTHROPIC_DEFAULT_OPUS_MODEL** | ❌ | Extended: requests whose model contains `opus` are rewritten to this |
|
|
18
|
+
| **ANTHROPIC_DEFAULT_SONNET_MODEL** | ❌ | Extended: requests whose model contains `sonnet` are rewritten to this |
|
|
19
|
+
| **ANTHROPIC_DEFAULT_HAIKU_MODEL** | ❌ | Extended: requests whose model contains `haiku` are rewritten to this |
|
|
20
|
+
| **Effort Level** | ❌ | Injects `output_config.effort` (`low`/`medium`/`high`/`xhigh`/`max`) into the request body. Leave as "Default" to skip |
|
|
21
|
+
|
|
22
|
+
Model matching is a case-insensitive substring test on the request's `model` field, so any version (e.g. `claude-opus-4-8`, a future `claude-opus-5`) maps to the same family with no reconfiguration. An empty family field means that family is left unchanged; an unrecognized family is passed through untouched.
|
|
18
23
|
|
|
19
24
|
## How It Works
|
|
20
25
|
|
|
@@ -22,7 +27,8 @@ When a proxy is active, `server/interceptor.js` performs the following before ea
|
|
|
22
27
|
|
|
23
28
|
1. **URL Rewrite** — Replaces the request origin with the proxy's Base URL
|
|
24
29
|
2. **Auth Replace** — Replaces `x-api-key` or `Authorization` header with the proxy's API Key
|
|
25
|
-
3. **Model Replace** —
|
|
30
|
+
3. **Model Replace** — Rewrites the request body `model` by family (opus/sonnet/haiku → the matching field; fable/mythos → `ANTHROPIC_MODEL`)
|
|
31
|
+
4. **Effort Inject** — If an effort level is set, injects `output_config.effort` (skipped for `count_tokens` / heartbeat requests)
|
|
26
32
|
|
|
27
33
|
## Config File
|
|
28
34
|
|
|
@@ -38,8 +44,11 @@ Configuration is stored at `~/.claude/cc-viewer/profile.json`. Click the folder
|
|
|
38
44
|
"name": "My Proxy",
|
|
39
45
|
"baseURL": "https://api.example.com",
|
|
40
46
|
"apiKey": "sk-xxx",
|
|
41
|
-
"
|
|
42
|
-
"
|
|
47
|
+
"ANTHROPIC_MODEL": "model-primary",
|
|
48
|
+
"ANTHROPIC_DEFAULT_OPUS_MODEL": "model-opus",
|
|
49
|
+
"ANTHROPIC_DEFAULT_SONNET_MODEL": "model-sonnet",
|
|
50
|
+
"ANTHROPIC_DEFAULT_HAIKU_MODEL": "model-haiku",
|
|
51
|
+
"effort": "max"
|
|
43
52
|
}
|
|
44
53
|
]
|
|
45
54
|
}
|
|
@@ -47,4 +56,5 @@ Configuration is stored at `~/.claude/cc-viewer/profile.json`. Click the folder
|
|
|
47
56
|
|
|
48
57
|
- `active` — ID of the current profile. Set to `"max"` for direct connection (no proxy)
|
|
49
58
|
- `profiles` — Profile list. `id: "max"` is built-in and cannot be deleted
|
|
59
|
+
- Legacy profiles using `models` / `activeModel` are auto-migrated to `ANTHROPIC_MODEL` on load
|
|
50
60
|
- Changes take effect within ~1.5 seconds (monitored via `fs.watchFile`), no restart needed
|
|
@@ -165,8 +165,11 @@ claude() { ... }
|
|
|
165
165
|
| `name` | 显示名称 |
|
|
166
166
|
| `baseURL` | 代理 API 地址(替换请求 origin) |
|
|
167
167
|
| `apiKey` | 代理 API 密钥(替换认证头) |
|
|
168
|
-
| `
|
|
169
|
-
| `
|
|
168
|
+
| `ANTHROPIC_MODEL` | 主模型(fable/mythos 家族映射到此) |
|
|
169
|
+
| `ANTHROPIC_DEFAULT_OPUS_MODEL` | opus 家族使用的模型(扩展) |
|
|
170
|
+
| `ANTHROPIC_DEFAULT_SONNET_MODEL` | sonnet 家族使用的模型(扩展) |
|
|
171
|
+
| `ANTHROPIC_DEFAULT_HAIKU_MODEL` | haiku 家族使用的模型(扩展) |
|
|
172
|
+
| `effort` | 强制的 `output_config.effort` 级别 |
|
|
170
173
|
|
|
171
174
|
## 九、插件系统
|
|
172
175
|
|
|
@@ -13,8 +13,13 @@ Hot-Switch Proxy lets you dynamically redirect API requests to a different endpo
|
|
|
13
13
|
| **Name** | ✅ | Display name for this proxy, used to identify it |
|
|
14
14
|
| **Base URL** | ✅ | Base URL of the API service (e.g. `https://api.example.com`). The original request origin will be replaced |
|
|
15
15
|
| **API Key** | ✅ | API key for the proxy service, replaces the original authentication |
|
|
16
|
-
| **
|
|
17
|
-
| **
|
|
16
|
+
| **ANTHROPIC_MODEL** | ❌ | Primary model. Requests whose model belongs to the `fable` / `mythos` family are rewritten to this |
|
|
17
|
+
| **ANTHROPIC_DEFAULT_OPUS_MODEL** | ❌ | Extended: requests whose model contains `opus` are rewritten to this |
|
|
18
|
+
| **ANTHROPIC_DEFAULT_SONNET_MODEL** | ❌ | Extended: requests whose model contains `sonnet` are rewritten to this |
|
|
19
|
+
| **ANTHROPIC_DEFAULT_HAIKU_MODEL** | ❌ | Extended: requests whose model contains `haiku` are rewritten to this |
|
|
20
|
+
| **Effort Level** | ❌ | Injects `output_config.effort` (`low`/`medium`/`high`/`xhigh`/`max`) into the request body. Leave as "Default" to skip |
|
|
21
|
+
|
|
22
|
+
Model matching is a case-insensitive substring test on the request's `model` field, so any version (e.g. `claude-opus-4-8`, a future `claude-opus-5`) maps to the same family with no reconfiguration. An empty family field means that family is left unchanged; an unrecognized family is passed through untouched.
|
|
18
23
|
|
|
19
24
|
## How It Works
|
|
20
25
|
|
|
@@ -22,7 +27,8 @@ When a proxy is active, `server/interceptor.js` performs the following before ea
|
|
|
22
27
|
|
|
23
28
|
1. **URL Rewrite** — Replaces the request origin with the proxy's Base URL
|
|
24
29
|
2. **Auth Replace** — Replaces `x-api-key` or `Authorization` header with the proxy's API Key
|
|
25
|
-
3. **Model Replace** —
|
|
30
|
+
3. **Model Replace** — Rewrites the request body `model` by family (opus/sonnet/haiku → the matching field; fable/mythos → `ANTHROPIC_MODEL`)
|
|
31
|
+
4. **Effort Inject** — If an effort level is set, injects `output_config.effort` (skipped for `count_tokens` / heartbeat requests)
|
|
26
32
|
|
|
27
33
|
## Config File
|
|
28
34
|
|
|
@@ -38,8 +44,11 @@ Configuration is stored at `~/.claude/cc-viewer/profile.json`. Click the folder
|
|
|
38
44
|
"name": "My Proxy",
|
|
39
45
|
"baseURL": "https://api.example.com",
|
|
40
46
|
"apiKey": "sk-xxx",
|
|
41
|
-
"
|
|
42
|
-
"
|
|
47
|
+
"ANTHROPIC_MODEL": "model-primary",
|
|
48
|
+
"ANTHROPIC_DEFAULT_OPUS_MODEL": "model-opus",
|
|
49
|
+
"ANTHROPIC_DEFAULT_SONNET_MODEL": "model-sonnet",
|
|
50
|
+
"ANTHROPIC_DEFAULT_HAIKU_MODEL": "model-haiku",
|
|
51
|
+
"effort": "max"
|
|
43
52
|
}
|
|
44
53
|
]
|
|
45
54
|
}
|
|
@@ -47,4 +56,5 @@ Configuration is stored at `~/.claude/cc-viewer/profile.json`. Click the folder
|
|
|
47
56
|
|
|
48
57
|
- `active` — ID of the current profile. Set to `"max"` for direct connection (no proxy)
|
|
49
58
|
- `profiles` — Profile list. `id: "max"` is built-in and cannot be deleted
|
|
59
|
+
- Legacy profiles using `models` / `activeModel` are auto-migrated to `ANTHROPIC_MODEL` on load
|
|
50
60
|
- Changes take effect within ~1.5 seconds (monitored via `fs.watchFile`), no restart needed
|
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
# CC-Viewer Configuration Reference
|
|
2
2
|
|
|
3
|
+
> Also available in [简体中文](../zh/GlobalSettings.md) and other languages.
|
|
4
|
+
|
|
3
5
|
## 1. Global Settings Panel (UI)
|
|
4
6
|
|
|
5
7
|
Open via top-left menu → "Global Settings".
|
|
@@ -166,8 +168,11 @@ Stored in `<log_dir>/profile.json`, managed via the "Proxy Switch" panel in the
|
|
|
166
168
|
| `name` | Display name |
|
|
167
169
|
| `baseURL` | Proxy API address (replaces request origin) |
|
|
168
170
|
| `apiKey` | Proxy API key (replaces auth headers) |
|
|
169
|
-
| `
|
|
170
|
-
| `
|
|
171
|
+
| `ANTHROPIC_MODEL` | Primary model (fable/mythos family maps here) |
|
|
172
|
+
| `ANTHROPIC_DEFAULT_OPUS_MODEL` | Model for the opus family (extended) |
|
|
173
|
+
| `ANTHROPIC_DEFAULT_SONNET_MODEL` | Model for the sonnet family (extended) |
|
|
174
|
+
| `ANTHROPIC_DEFAULT_HAIKU_MODEL` | Model for the haiku family (extended) |
|
|
175
|
+
| `effort` | Forced `output_config.effort` level |
|
|
171
176
|
|
|
172
177
|
## 9. Plugin System
|
|
173
178
|
|
|
@@ -13,8 +13,13 @@ Hot-Switch Proxy lets you dynamically redirect API requests to a different endpo
|
|
|
13
13
|
| **Name** | ✅ | Display name for this proxy, used to identify it |
|
|
14
14
|
| **Base URL** | ✅ | Base URL of the API service (e.g. `https://api.example.com`). The original request origin will be replaced |
|
|
15
15
|
| **API Key** | ✅ | API key for the proxy service, replaces the original authentication |
|
|
16
|
-
| **
|
|
17
|
-
| **
|
|
16
|
+
| **ANTHROPIC_MODEL** | ❌ | Primary model. Requests whose model belongs to the `fable` / `mythos` family are rewritten to this |
|
|
17
|
+
| **ANTHROPIC_DEFAULT_OPUS_MODEL** | ❌ | Extended: requests whose model contains `opus` are rewritten to this |
|
|
18
|
+
| **ANTHROPIC_DEFAULT_SONNET_MODEL** | ❌ | Extended: requests whose model contains `sonnet` are rewritten to this |
|
|
19
|
+
| **ANTHROPIC_DEFAULT_HAIKU_MODEL** | ❌ | Extended: requests whose model contains `haiku` are rewritten to this |
|
|
20
|
+
| **Effort Level** | ❌ | Injects `output_config.effort` (`low`/`medium`/`high`/`xhigh`/`max`) into the request body. Leave as "Default" to skip |
|
|
21
|
+
|
|
22
|
+
Model matching is a case-insensitive substring test on the request's `model` field, so any version (e.g. `claude-opus-4-8`, a future `claude-opus-5`) maps to the same family with no reconfiguration. An empty family field means that family is left unchanged; an unrecognized family is passed through untouched.
|
|
18
23
|
|
|
19
24
|
## How It Works
|
|
20
25
|
|
|
@@ -22,7 +27,8 @@ When a proxy is active, `server/interceptor.js` performs the following before ea
|
|
|
22
27
|
|
|
23
28
|
1. **URL Rewrite** — Replaces the request origin with the proxy's Base URL
|
|
24
29
|
2. **Auth Replace** — Replaces `x-api-key` or `Authorization` header with the proxy's API Key
|
|
25
|
-
3. **Model Replace** —
|
|
30
|
+
3. **Model Replace** — Rewrites the request body `model` by family (opus/sonnet/haiku → the matching field; fable/mythos → `ANTHROPIC_MODEL`)
|
|
31
|
+
4. **Effort Inject** — If an effort level is set, injects `output_config.effort` (skipped for `count_tokens` / heartbeat requests)
|
|
26
32
|
|
|
27
33
|
## Config File
|
|
28
34
|
|
|
@@ -38,8 +44,11 @@ Configuration is stored at `~/.claude/cc-viewer/profile.json`. Click the folder
|
|
|
38
44
|
"name": "My Proxy",
|
|
39
45
|
"baseURL": "https://api.example.com",
|
|
40
46
|
"apiKey": "sk-xxx",
|
|
41
|
-
"
|
|
42
|
-
"
|
|
47
|
+
"ANTHROPIC_MODEL": "model-primary",
|
|
48
|
+
"ANTHROPIC_DEFAULT_OPUS_MODEL": "model-opus",
|
|
49
|
+
"ANTHROPIC_DEFAULT_SONNET_MODEL": "model-sonnet",
|
|
50
|
+
"ANTHROPIC_DEFAULT_HAIKU_MODEL": "model-haiku",
|
|
51
|
+
"effort": "max"
|
|
43
52
|
}
|
|
44
53
|
]
|
|
45
54
|
}
|
|
@@ -47,4 +56,5 @@ Configuration is stored at `~/.claude/cc-viewer/profile.json`. Click the folder
|
|
|
47
56
|
|
|
48
57
|
- `active` — ID of the current profile. Set to `"max"` for direct connection (no proxy)
|
|
49
58
|
- `profiles` — Profile list. `id: "max"` is built-in and cannot be deleted
|
|
59
|
+
- Legacy profiles using `models` / `activeModel` are auto-migrated to `ANTHROPIC_MODEL` on load
|
|
50
60
|
- Changes take effect within ~1.5 seconds (monitored via `fs.watchFile`), no restart needed
|
|
@@ -165,8 +165,11 @@ claude() { ... }
|
|
|
165
165
|
| `name` | 显示名称 |
|
|
166
166
|
| `baseURL` | 代理 API 地址(替换请求 origin) |
|
|
167
167
|
| `apiKey` | 代理 API 密钥(替换认证头) |
|
|
168
|
-
| `
|
|
169
|
-
| `
|
|
168
|
+
| `ANTHROPIC_MODEL` | 主模型(fable/mythos 家族映射到此) |
|
|
169
|
+
| `ANTHROPIC_DEFAULT_OPUS_MODEL` | opus 家族使用的模型(扩展) |
|
|
170
|
+
| `ANTHROPIC_DEFAULT_SONNET_MODEL` | sonnet 家族使用的模型(扩展) |
|
|
171
|
+
| `ANTHROPIC_DEFAULT_HAIKU_MODEL` | haiku 家族使用的模型(扩展) |
|
|
172
|
+
| `effort` | 强制的 `output_config.effort` 级别 |
|
|
170
173
|
|
|
171
174
|
## 九、插件系统
|
|
172
175
|
|
|
@@ -13,8 +13,13 @@ Hot-Switch Proxy lets you dynamically redirect API requests to a different endpo
|
|
|
13
13
|
| **Name** | ✅ | Display name for this proxy, used to identify it |
|
|
14
14
|
| **Base URL** | ✅ | Base URL of the API service (e.g. `https://api.example.com`). The original request origin will be replaced |
|
|
15
15
|
| **API Key** | ✅ | API key for the proxy service, replaces the original authentication |
|
|
16
|
-
| **
|
|
17
|
-
| **
|
|
16
|
+
| **ANTHROPIC_MODEL** | ❌ | Primary model. Requests whose model belongs to the `fable` / `mythos` family are rewritten to this |
|
|
17
|
+
| **ANTHROPIC_DEFAULT_OPUS_MODEL** | ❌ | Extended: requests whose model contains `opus` are rewritten to this |
|
|
18
|
+
| **ANTHROPIC_DEFAULT_SONNET_MODEL** | ❌ | Extended: requests whose model contains `sonnet` are rewritten to this |
|
|
19
|
+
| **ANTHROPIC_DEFAULT_HAIKU_MODEL** | ❌ | Extended: requests whose model contains `haiku` are rewritten to this |
|
|
20
|
+
| **Effort Level** | ❌ | Injects `output_config.effort` (`low`/`medium`/`high`/`xhigh`/`max`) into the request body. Leave as "Default" to skip |
|
|
21
|
+
|
|
22
|
+
Model matching is a case-insensitive substring test on the request's `model` field, so any version (e.g. `claude-opus-4-8`, a future `claude-opus-5`) maps to the same family with no reconfiguration. An empty family field means that family is left unchanged; an unrecognized family is passed through untouched.
|
|
18
23
|
|
|
19
24
|
## How It Works
|
|
20
25
|
|
|
@@ -22,7 +27,8 @@ When a proxy is active, `server/interceptor.js` performs the following before ea
|
|
|
22
27
|
|
|
23
28
|
1. **URL Rewrite** — Replaces the request origin with the proxy's Base URL
|
|
24
29
|
2. **Auth Replace** — Replaces `x-api-key` or `Authorization` header with the proxy's API Key
|
|
25
|
-
3. **Model Replace** —
|
|
30
|
+
3. **Model Replace** — Rewrites the request body `model` by family (opus/sonnet/haiku → the matching field; fable/mythos → `ANTHROPIC_MODEL`)
|
|
31
|
+
4. **Effort Inject** — If an effort level is set, injects `output_config.effort` (skipped for `count_tokens` / heartbeat requests)
|
|
26
32
|
|
|
27
33
|
## Config File
|
|
28
34
|
|
|
@@ -38,8 +44,11 @@ Configuration is stored at `~/.claude/cc-viewer/profile.json`. Click the folder
|
|
|
38
44
|
"name": "My Proxy",
|
|
39
45
|
"baseURL": "https://api.example.com",
|
|
40
46
|
"apiKey": "sk-xxx",
|
|
41
|
-
"
|
|
42
|
-
"
|
|
47
|
+
"ANTHROPIC_MODEL": "model-primary",
|
|
48
|
+
"ANTHROPIC_DEFAULT_OPUS_MODEL": "model-opus",
|
|
49
|
+
"ANTHROPIC_DEFAULT_SONNET_MODEL": "model-sonnet",
|
|
50
|
+
"ANTHROPIC_DEFAULT_HAIKU_MODEL": "model-haiku",
|
|
51
|
+
"effort": "max"
|
|
43
52
|
}
|
|
44
53
|
]
|
|
45
54
|
}
|
|
@@ -47,4 +56,5 @@ Configuration is stored at `~/.claude/cc-viewer/profile.json`. Click the folder
|
|
|
47
56
|
|
|
48
57
|
- `active` — ID of the current profile. Set to `"max"` for direct connection (no proxy)
|
|
49
58
|
- `profiles` — Profile list. `id: "max"` is built-in and cannot be deleted
|
|
59
|
+
- Legacy profiles using `models` / `activeModel` are auto-migrated to `ANTHROPIC_MODEL` on load
|
|
50
60
|
- Changes take effect within ~1.5 seconds (monitored via `fs.watchFile`), no restart needed
|
|
@@ -165,8 +165,11 @@ claude() { ... }
|
|
|
165
165
|
| `name` | 显示名称 |
|
|
166
166
|
| `baseURL` | 代理 API 地址(替换请求 origin) |
|
|
167
167
|
| `apiKey` | 代理 API 密钥(替换认证头) |
|
|
168
|
-
| `
|
|
169
|
-
| `
|
|
168
|
+
| `ANTHROPIC_MODEL` | 主模型(fable/mythos 家族映射到此) |
|
|
169
|
+
| `ANTHROPIC_DEFAULT_OPUS_MODEL` | opus 家族使用的模型(扩展) |
|
|
170
|
+
| `ANTHROPIC_DEFAULT_SONNET_MODEL` | sonnet 家族使用的模型(扩展) |
|
|
171
|
+
| `ANTHROPIC_DEFAULT_HAIKU_MODEL` | haiku 家族使用的模型(扩展) |
|
|
172
|
+
| `effort` | 强制的 `output_config.effort` 级别 |
|
|
170
173
|
|
|
171
174
|
## 九、插件系统
|
|
172
175
|
|
|
@@ -13,8 +13,13 @@ Hot-Switch Proxy lets you dynamically redirect API requests to a different endpo
|
|
|
13
13
|
| **Name** | ✅ | Display name for this proxy, used to identify it |
|
|
14
14
|
| **Base URL** | ✅ | Base URL of the API service (e.g. `https://api.example.com`). The original request origin will be replaced |
|
|
15
15
|
| **API Key** | ✅ | API key for the proxy service, replaces the original authentication |
|
|
16
|
-
| **
|
|
17
|
-
| **
|
|
16
|
+
| **ANTHROPIC_MODEL** | ❌ | Primary model. Requests whose model belongs to the `fable` / `mythos` family are rewritten to this |
|
|
17
|
+
| **ANTHROPIC_DEFAULT_OPUS_MODEL** | ❌ | Extended: requests whose model contains `opus` are rewritten to this |
|
|
18
|
+
| **ANTHROPIC_DEFAULT_SONNET_MODEL** | ❌ | Extended: requests whose model contains `sonnet` are rewritten to this |
|
|
19
|
+
| **ANTHROPIC_DEFAULT_HAIKU_MODEL** | ❌ | Extended: requests whose model contains `haiku` are rewritten to this |
|
|
20
|
+
| **Effort Level** | ❌ | Injects `output_config.effort` (`low`/`medium`/`high`/`xhigh`/`max`) into the request body. Leave as "Default" to skip |
|
|
21
|
+
|
|
22
|
+
Model matching is a case-insensitive substring test on the request's `model` field, so any version (e.g. `claude-opus-4-8`, a future `claude-opus-5`) maps to the same family with no reconfiguration. An empty family field means that family is left unchanged; an unrecognized family is passed through untouched.
|
|
18
23
|
|
|
19
24
|
## How It Works
|
|
20
25
|
|
|
@@ -22,7 +27,8 @@ When a proxy is active, `server/interceptor.js` performs the following before ea
|
|
|
22
27
|
|
|
23
28
|
1. **URL Rewrite** — Replaces the request origin with the proxy's Base URL
|
|
24
29
|
2. **Auth Replace** — Replaces `x-api-key` or `Authorization` header with the proxy's API Key
|
|
25
|
-
3. **Model Replace** —
|
|
30
|
+
3. **Model Replace** — Rewrites the request body `model` by family (opus/sonnet/haiku → the matching field; fable/mythos → `ANTHROPIC_MODEL`)
|
|
31
|
+
4. **Effort Inject** — If an effort level is set, injects `output_config.effort` (skipped for `count_tokens` / heartbeat requests)
|
|
26
32
|
|
|
27
33
|
## Config File
|
|
28
34
|
|
|
@@ -38,8 +44,11 @@ Configuration is stored at `~/.claude/cc-viewer/profile.json`. Click the folder
|
|
|
38
44
|
"name": "My Proxy",
|
|
39
45
|
"baseURL": "https://api.example.com",
|
|
40
46
|
"apiKey": "sk-xxx",
|
|
41
|
-
"
|
|
42
|
-
"
|
|
47
|
+
"ANTHROPIC_MODEL": "model-primary",
|
|
48
|
+
"ANTHROPIC_DEFAULT_OPUS_MODEL": "model-opus",
|
|
49
|
+
"ANTHROPIC_DEFAULT_SONNET_MODEL": "model-sonnet",
|
|
50
|
+
"ANTHROPIC_DEFAULT_HAIKU_MODEL": "model-haiku",
|
|
51
|
+
"effort": "max"
|
|
43
52
|
}
|
|
44
53
|
]
|
|
45
54
|
}
|
|
@@ -47,4 +56,5 @@ Configuration is stored at `~/.claude/cc-viewer/profile.json`. Click the folder
|
|
|
47
56
|
|
|
48
57
|
- `active` — ID of the current profile. Set to `"max"` for direct connection (no proxy)
|
|
49
58
|
- `profiles` — Profile list. `id: "max"` is built-in and cannot be deleted
|
|
59
|
+
- Legacy profiles using `models` / `activeModel` are auto-migrated to `ANTHROPIC_MODEL` on load
|
|
50
60
|
- Changes take effect within ~1.5 seconds (monitored via `fs.watchFile`), no restart needed
|
|
@@ -165,8 +165,11 @@ claude() { ... }
|
|
|
165
165
|
| `name` | 显示名称 |
|
|
166
166
|
| `baseURL` | 代理 API 地址(替换请求 origin) |
|
|
167
167
|
| `apiKey` | 代理 API 密钥(替换认证头) |
|
|
168
|
-
| `
|
|
169
|
-
| `
|
|
168
|
+
| `ANTHROPIC_MODEL` | 主模型(fable/mythos 家族映射到此) |
|
|
169
|
+
| `ANTHROPIC_DEFAULT_OPUS_MODEL` | opus 家族使用的模型(扩展) |
|
|
170
|
+
| `ANTHROPIC_DEFAULT_SONNET_MODEL` | sonnet 家族使用的模型(扩展) |
|
|
171
|
+
| `ANTHROPIC_DEFAULT_HAIKU_MODEL` | haiku 家族使用的模型(扩展) |
|
|
172
|
+
| `effort` | 强制的 `output_config.effort` 级别 |
|
|
170
173
|
|
|
171
174
|
## 九、插件系统
|
|
172
175
|
|
|
@@ -13,8 +13,13 @@ Hot-Switch Proxy lets you dynamically redirect API requests to a different endpo
|
|
|
13
13
|
| **Name** | ✅ | Display name for this proxy, used to identify it |
|
|
14
14
|
| **Base URL** | ✅ | Base URL of the API service (e.g. `https://api.example.com`). The original request origin will be replaced |
|
|
15
15
|
| **API Key** | ✅ | API key for the proxy service, replaces the original authentication |
|
|
16
|
-
| **
|
|
17
|
-
| **
|
|
16
|
+
| **ANTHROPIC_MODEL** | ❌ | Primary model. Requests whose model belongs to the `fable` / `mythos` family are rewritten to this |
|
|
17
|
+
| **ANTHROPIC_DEFAULT_OPUS_MODEL** | ❌ | Extended: requests whose model contains `opus` are rewritten to this |
|
|
18
|
+
| **ANTHROPIC_DEFAULT_SONNET_MODEL** | ❌ | Extended: requests whose model contains `sonnet` are rewritten to this |
|
|
19
|
+
| **ANTHROPIC_DEFAULT_HAIKU_MODEL** | ❌ | Extended: requests whose model contains `haiku` are rewritten to this |
|
|
20
|
+
| **Effort Level** | ❌ | Injects `output_config.effort` (`low`/`medium`/`high`/`xhigh`/`max`) into the request body. Leave as "Default" to skip |
|
|
21
|
+
|
|
22
|
+
Model matching is a case-insensitive substring test on the request's `model` field, so any version (e.g. `claude-opus-4-8`, a future `claude-opus-5`) maps to the same family with no reconfiguration. An empty family field means that family is left unchanged; an unrecognized family is passed through untouched.
|
|
18
23
|
|
|
19
24
|
## How It Works
|
|
20
25
|
|
|
@@ -22,7 +27,8 @@ When a proxy is active, `server/interceptor.js` performs the following before ea
|
|
|
22
27
|
|
|
23
28
|
1. **URL Rewrite** — Replaces the request origin with the proxy's Base URL
|
|
24
29
|
2. **Auth Replace** — Replaces `x-api-key` or `Authorization` header with the proxy's API Key
|
|
25
|
-
3. **Model Replace** —
|
|
30
|
+
3. **Model Replace** — Rewrites the request body `model` by family (opus/sonnet/haiku → the matching field; fable/mythos → `ANTHROPIC_MODEL`)
|
|
31
|
+
4. **Effort Inject** — If an effort level is set, injects `output_config.effort` (skipped for `count_tokens` / heartbeat requests)
|
|
26
32
|
|
|
27
33
|
## Config File
|
|
28
34
|
|
|
@@ -38,8 +44,11 @@ Configuration is stored at `~/.claude/cc-viewer/profile.json`. Click the folder
|
|
|
38
44
|
"name": "My Proxy",
|
|
39
45
|
"baseURL": "https://api.example.com",
|
|
40
46
|
"apiKey": "sk-xxx",
|
|
41
|
-
"
|
|
42
|
-
"
|
|
47
|
+
"ANTHROPIC_MODEL": "model-primary",
|
|
48
|
+
"ANTHROPIC_DEFAULT_OPUS_MODEL": "model-opus",
|
|
49
|
+
"ANTHROPIC_DEFAULT_SONNET_MODEL": "model-sonnet",
|
|
50
|
+
"ANTHROPIC_DEFAULT_HAIKU_MODEL": "model-haiku",
|
|
51
|
+
"effort": "max"
|
|
43
52
|
}
|
|
44
53
|
]
|
|
45
54
|
}
|
|
@@ -47,4 +56,5 @@ Configuration is stored at `~/.claude/cc-viewer/profile.json`. Click the folder
|
|
|
47
56
|
|
|
48
57
|
- `active` — ID of the current profile. Set to `"max"` for direct connection (no proxy)
|
|
49
58
|
- `profiles` — Profile list. `id: "max"` is built-in and cannot be deleted
|
|
59
|
+
- Legacy profiles using `models` / `activeModel` are auto-migrated to `ANTHROPIC_MODEL` on load
|
|
50
60
|
- Changes take effect within ~1.5 seconds (monitored via `fs.watchFile`), no restart needed
|
|
@@ -165,8 +165,11 @@ claude() { ... }
|
|
|
165
165
|
| `name` | 显示名称 |
|
|
166
166
|
| `baseURL` | 代理 API 地址(替换请求 origin) |
|
|
167
167
|
| `apiKey` | 代理 API 密钥(替换认证头) |
|
|
168
|
-
| `
|
|
169
|
-
| `
|
|
168
|
+
| `ANTHROPIC_MODEL` | プライマリモデル(fable/mythos ファミリーはここにマッピング) |
|
|
169
|
+
| `ANTHROPIC_DEFAULT_OPUS_MODEL` | opus ファミリー向けのモデル(拡張) |
|
|
170
|
+
| `ANTHROPIC_DEFAULT_SONNET_MODEL` | sonnet ファミリー向けのモデル(拡張) |
|
|
171
|
+
| `ANTHROPIC_DEFAULT_HAIKU_MODEL` | haiku ファミリー向けのモデル(拡張) |
|
|
172
|
+
| `effort` | 強制する `output_config.effort` レベル |
|
|
170
173
|
|
|
171
174
|
## 九、插件系统
|
|
172
175
|
|
|
@@ -13,8 +13,13 @@ Hot-Switch Proxy lets you dynamically redirect API requests to a different endpo
|
|
|
13
13
|
| **Name** | ✅ | Display name for this proxy, used to identify it |
|
|
14
14
|
| **Base URL** | ✅ | Base URL of the API service (e.g. `https://api.example.com`). The original request origin will be replaced |
|
|
15
15
|
| **API Key** | ✅ | API key for the proxy service, replaces the original authentication |
|
|
16
|
-
| **
|
|
17
|
-
| **
|
|
16
|
+
| **ANTHROPIC_MODEL** | ❌ | プライマリモデル。`fable` / `mythos` ファミリーに属するモデルのリクエストはこの値に書き換えられます |
|
|
17
|
+
| **ANTHROPIC_DEFAULT_OPUS_MODEL** | ❌ | 拡張:`model` に `opus` を含むリクエストはこの値に書き換えられます |
|
|
18
|
+
| **ANTHROPIC_DEFAULT_SONNET_MODEL** | ❌ | 拡張:`model` に `sonnet` を含むリクエストはこの値に書き換えられます |
|
|
19
|
+
| **ANTHROPIC_DEFAULT_HAIKU_MODEL** | ❌ | 拡張:`model` に `haiku` を含むリクエストはこの値に書き換えられます |
|
|
20
|
+
| **強度レベル** | ❌ | リクエストボディに `output_config.effort`(`low`/`medium`/`high`/`xhigh`/`max`)を注入します。「デフォルト」のままにするとスキップされます |
|
|
21
|
+
|
|
22
|
+
モデルのマッチングはリクエストの `model` フィールドに対する大文字小文字を区別しない部分文字列判定なので、任意のバージョン(例:`claude-opus-4-8`、将来の `claude-opus-5`)が再設定なしで同じファミリーにマッピングされます。ファミリーのフィールドが空の場合、そのファミリーは変更されません。認識できないファミリーはそのまま透過されます。
|
|
18
23
|
|
|
19
24
|
## How It Works
|
|
20
25
|
|
|
@@ -22,7 +27,8 @@ When a proxy is active, `server/interceptor.js` performs the following before ea
|
|
|
22
27
|
|
|
23
28
|
1. **URL Rewrite** — Replaces the request origin with the proxy's Base URL
|
|
24
29
|
2. **Auth Replace** — Replaces `x-api-key` or `Authorization` header with the proxy's API Key
|
|
25
|
-
3. **Model Replace** —
|
|
30
|
+
3. **Model Replace** — リクエストボディの `model` をファミリー単位で書き換えます(opus/sonnet/haiku → 対応するフィールド、fable/mythos → `ANTHROPIC_MODEL`)
|
|
31
|
+
4. **Effort Inject** — 強度レベルが設定されている場合、`output_config.effort` を注入します(`count_tokens` / ハートビートリクエストはスキップ)
|
|
26
32
|
|
|
27
33
|
## Config File
|
|
28
34
|
|
|
@@ -38,8 +44,11 @@ Configuration is stored at `~/.claude/cc-viewer/profile.json`. Click the folder
|
|
|
38
44
|
"name": "My Proxy",
|
|
39
45
|
"baseURL": "https://api.example.com",
|
|
40
46
|
"apiKey": "sk-xxx",
|
|
41
|
-
"
|
|
42
|
-
"
|
|
47
|
+
"ANTHROPIC_MODEL": "model-primary",
|
|
48
|
+
"ANTHROPIC_DEFAULT_OPUS_MODEL": "model-opus",
|
|
49
|
+
"ANTHROPIC_DEFAULT_SONNET_MODEL": "model-sonnet",
|
|
50
|
+
"ANTHROPIC_DEFAULT_HAIKU_MODEL": "model-haiku",
|
|
51
|
+
"effort": "max"
|
|
43
52
|
}
|
|
44
53
|
]
|
|
45
54
|
}
|
|
@@ -47,4 +56,5 @@ Configuration is stored at `~/.claude/cc-viewer/profile.json`. Click the folder
|
|
|
47
56
|
|
|
48
57
|
- `active` — ID of the current profile. Set to `"max"` for direct connection (no proxy)
|
|
49
58
|
- `profiles` — Profile list. `id: "max"` is built-in and cannot be deleted
|
|
59
|
+
- 旧形式の `models` / `activeModel` を使用する profile は、読み込み時に自動的に `ANTHROPIC_MODEL` へ移行されます
|
|
50
60
|
- Changes take effect within ~1.5 seconds (monitored via `fs.watchFile`), no restart needed
|
|
@@ -165,8 +165,11 @@ claude() { ... }
|
|
|
165
165
|
| `name` | 显示名称 |
|
|
166
166
|
| `baseURL` | 代理 API 地址(替换请求 origin) |
|
|
167
167
|
| `apiKey` | 代理 API 密钥(替换认证头) |
|
|
168
|
-
| `
|
|
169
|
-
| `
|
|
168
|
+
| `ANTHROPIC_MODEL` | 기본 모델(fable/mythos 계열이 여기로 매핑됨) |
|
|
169
|
+
| `ANTHROPIC_DEFAULT_OPUS_MODEL` | opus 계열용 모델(확장) |
|
|
170
|
+
| `ANTHROPIC_DEFAULT_SONNET_MODEL` | sonnet 계열용 모델(확장) |
|
|
171
|
+
| `ANTHROPIC_DEFAULT_HAIKU_MODEL` | haiku 계열용 모델(확장) |
|
|
172
|
+
| `effort` | 강제 적용할 `output_config.effort` 레벨 |
|
|
170
173
|
|
|
171
174
|
## 九、插件系统
|
|
172
175
|
|