cc-viewer 1.7.21 → 1.7.22
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 +1 -1
- package/concepts/en/ProxySwitch.md +13 -0
- package/concepts/zh/ProxySwitch.md +13 -0
- package/dist/assets/App-BaKGIW0-.js +2 -0
- package/dist/assets/{MdxEditorPanel-Cd5dGdSB.js → MdxEditorPanel-DG-UE0PC.js} +1 -1
- package/dist/assets/{Mobile-CRQ3UK4l.js → Mobile-CQaUYdaf.js} +1 -1
- package/dist/assets/{ProxyStatsModal-yeAXJE6u.js → ProxyStatsModal-j-Aty9Lu.js} +1 -1
- package/dist/assets/{index-DxMkkprW.js → index-CyiyzBfV.js} +2 -2
- package/dist/assets/{seqResourceLoaders-pADDTbV6.css → seqResourceLoaders-BgD_Rwvc.css} +1 -1
- package/dist/assets/seqResourceLoaders-XMiEIVyV.js +2 -0
- package/dist/index.html +1 -1
- package/package.json +1 -1
- package/server/interceptor.js +192 -51
- package/server/lib/interceptor-core.js +91 -0
- package/server/lib/v2/adapter.js +1 -1
- package/server/lib/v2/live-feed.js +2 -0
- package/server/lib/v2/meta-rows.js +3 -0
- package/server/lib/v2/v2-writer.js +1 -1
- package/server/proxy.js +39 -8
- package/server/pty-manager.js +6 -0
- package/server/routes/expert.js +47 -2
- package/server/routes/preferences.js +24 -7
- package/src/utils/v3Assembler.js +1 -0
- package/src/utils/v3Rows.js +1 -0
- package/dist/assets/App-DKk75JCV.js +0 -2
- package/dist/assets/seqResourceLoaders-CPq3Zxu0.js +0 -2
package/README.md
CHANGED
|
@@ -117,7 +117,7 @@ Letting Claude Code diagnose the problem on its own is more effective than askin
|
|
|
117
117
|
|
|
118
118
|
Once the instruction is done, `findcc.js` will have been updated. If your project frequently needs local deployment, or your forked code often runs into installation issues, just keep this file — next time you can simply copy it over. At this stage many projects and companies use Claude Code on server-side hosted deployments rather than on Mac, so I split out `findcc.js` to make it easier to keep tracking upstream cc-viewer source updates.
|
|
119
119
|
|
|
120
|
-
Note: this app conflicts with claude-code-switch and claude-code-router — there is a proxy contention problem, so make sure you turn off claude-code-switch and claude-code-router when using it. cc-viewer provides built-in proxy hot-reload that can replace them.
|
|
120
|
+
Note: this app conflicts with claude-code-switch and claude-code-router — there is a proxy contention problem, so make sure you turn off claude-code-switch and claude-code-router when using it. cc-viewer provides built-in proxy hot-reload that can replace them. The hot-switch dialog also supports per-role sources — Main Agent, Sub-Agents and Teammates can each use a different proxy profile (default: follow the Main Agent); when the Main Agent uses the built-in Default with the official endpoint, role assignment stays hidden and dormant.
|
|
121
121
|
|
|
122
122
|
### Other helper commands
|
|
123
123
|
|
|
@@ -58,3 +58,16 @@ Configuration is stored at `~/.claude/cc-viewer/profile.json`. Click the folder
|
|
|
58
58
|
- `profiles` — Profile list. `id: "max"` is built-in and cannot be deleted
|
|
59
59
|
- Legacy profiles using `models` / `activeModel` are auto-migrated to `ANTHROPIC_MODEL` on load
|
|
60
60
|
- Changes take effect within ~1.5 seconds (monitored via `fs.watchFile`), no restart needed
|
|
61
|
+
|
|
62
|
+
## Per-Role Assignment (Advanced)
|
|
63
|
+
|
|
64
|
+
When the Main Agent uses a proxy profile, a "Role Assignment" section appears at the top of the dialog, letting **Sub-Agents** and **Teammates** each point to a different source than the Main Agent — e.g. an expensive model for the Main Agent and a cheaper one for Sub-Agents.
|
|
65
|
+
|
|
66
|
+
- Each role can be set to: **Follow Main Agent** (default) / **Default (built-in direct)** / any profile
|
|
67
|
+
- **Utility requests (`count_tokens`, heartbeat) always follow the process-primary role's source** (in the leader process = the Main Agent's; inside a Teammate process = the Teammate's own assignment) — third-party proxies often lack these endpoints
|
|
68
|
+
- The Sub-Agent role only applies to requests carrying the `cc_is_subagent=true` marker (Claude Code ≥ 2.1.181); older versions' sub-agent requests, compaction, and title-generation calls stay on the Main Agent's source
|
|
69
|
+
- Both teammate forms are supported: separate OS processes (detected via `--agent-name`, hot-applied within ~1.5s via file watching) and in-process team agents (Claude Code 2.1.x native agent teams, detected via the team marker in the system prompt, hot-applied with the leader process)
|
|
70
|
+
- When the Main Agent is set back to **Default with the official api.anthropic.com endpoint**, the assignment section hides and stored role assignments stay **dormant (kept but inactive)** — they revive as-is once the Main Agent switches to a proxy again. With Default backed by a custom endpoint (e.g. a third-party URL in env), the section stays visible and assignments apply
|
|
71
|
+
- Role assignments are workspace-scoped, stored in each project's `active-profile.json` (`{ activeId, roles }`)
|
|
72
|
+
|
|
73
|
+
Note: ccv proxy mode (`ccv run` / `ccv` CLI / Electron tabs) also splits by role — the proxy classifies each buffered request body, picks the role's upstream, and hands it to the retry engine, with stats attributed to the role's profile. The one exception is OS-process teammates under proxy mode, where the official-endpoint dormancy check does not apply (they see the local proxy address as the endpoint).
|
|
@@ -58,3 +58,16 @@
|
|
|
58
58
|
- `profiles` — profile 列表,`id: "max"` 为内置直连模式,不可删除
|
|
59
59
|
- 使用旧版 `models` / `activeModel` 的 profile 在加载时会自动迁移为 `ANTHROPIC_MODEL`
|
|
60
60
|
- 修改文件后约 1.5 秒自动生效(通过 `fs.watchFile` 监听),无需重启
|
|
61
|
+
|
|
62
|
+
## 按角色分源(高级)
|
|
63
|
+
|
|
64
|
+
当主 Agent 使用某个代理 profile 时,弹窗顶部会出现「角色分工」分配区,可让**子 Agent(SubAgent)**和 **Teammate** 分别指向与主 Agent 不同的源——典型用法是主 Agent 跑贵模型、子 Agent 跑便宜模型。
|
|
65
|
+
|
|
66
|
+
- 每个角色可选:**跟随主 Agent**(默认)/ **Default(内置直连)** / 任一 profile
|
|
67
|
+
- **count_tokens、心跳等 utility 请求永远跟随本进程主角色的源**(主进程内 = 主 Agent;Teammate 进程内 = Teammate 自己的分配)——第三方代理常不支持这些端点
|
|
68
|
+
- 子 Agent 角色只作用于带 `cc_is_subagent=true` 标记的请求(Claude Code ≥ 2.1.181);更早版本的子代理请求与压缩/标题等轻量请求一样留在主 Agent 源
|
|
69
|
+
- Teammate 两种形态都支持:独立进程(`--agent-name` 识别,切换后约 1.5 秒经文件监听热生效)与同进程团队 agent(Claude Code 2.1.x 原生 agent teams,经 system prompt 团队标记识别,随 leader 进程热生效)
|
|
70
|
+
- 当主 Agent 切回 **Default 且端点为官方 api.anthropic.com** 时,分配区自动隐藏,已配置的角色分配**保留但不生效**(休眠),主 Agent 再次切到代理时原样恢复;Default 背后是自定义端点(如 env 里配了第三方地址)时分配区仍然可见且生效
|
|
71
|
+
- 角色分配按 workspace 隔离,存储在各项目的 `active-profile.json`(`{ activeId, roles }`)
|
|
72
|
+
|
|
73
|
+
说明:ccv 代理模式(`ccv run` / `ccv` CLI / Electron 标签页)同样按角色分流——proxy 在缓冲请求体后按角色选上游并交给重试引擎,统计按实际角色 profile 归属;唯一例外是代理模式下的**独立进程 teammate**,其官方端点休眠判定不生效(它看到的端点是本地代理地址)。
|