cc-zh-watcher 0.3.0 → 0.3.1

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.
Files changed (3) hide show
  1. package/README.md +4 -2
  2. package/dist/cli.js +14 -3
  3. package/package.json +1 -1
package/README.md CHANGED
@@ -202,7 +202,9 @@ Claude 用英文流式回复时,watcher 同步翻译并显示中文,**同时
202
202
  | `translate_todos` | **on** | 译 TodoWrite 计划项(按当前状态自动选 `content` 或 `activeForm`)|
203
203
  | `translate_agent` | **on** | 译 Agent/Task 子代理派遣(description + prompt)|
204
204
  | `context_enabled` | **on** | zh→en 翻译时用 Claude 上一条 text 作消歧 context |
205
- | `show_tool_calls` | **on** | 显示原始 tool 调用 + 结果(Bash/Read/Edit 等,CC 同款样式)|
205
+ | `show_tool_calls` | session-aware ¹ | 显示原始 tool 调用 + 结果(Bash/Read/Edit 等,CC 同款样式)|
206
+
207
+ ¹ `show_tool_calls` 默认值取决于 session 类型:CLI session 默认 **on**,macOS Claude 桌面应用 session 默认 **off**(桌面应用界面里已经能看到 tool 调用,watcher 再渲染一遍是噪音)。在 config 里显式写 `"show_tool_calls": true/false` 始终覆盖这个 session-aware 默认值。
206
208
 
207
209
  ### User prompt(3 个,每翻译方向一个)
208
210
  - Enter 弹满屏多行编辑器,Ctrl+S 保存、Esc 取消
@@ -401,7 +403,7 @@ cc-zh-watcher prompts show zh-to-en --base
401
403
  "translate_todos": true, // 默认 true
402
404
  "translate_agent": true, // 默认 true
403
405
  "context_enabled": true, // 默认 true
404
- "show_tool_calls": true, // 默认 true
406
+ "show_tool_calls": true, // 默认 session-aware:CLI on, 桌面应用 off
405
407
 
406
408
  // ── 可选:user prompt(非空替换内置 default) ──
407
409
  "prompts": {
package/dist/cli.js CHANGED
@@ -44813,7 +44813,7 @@ function userConfigPath() {
44813
44813
  function projectConfigPath(projectDir) {
44814
44814
  return join2(projectDir, ".cc-zh-watcher.json");
44815
44815
  }
44816
- function loadConfig(opts) {
44816
+ function readMergedRawConfig(opts) {
44817
44817
  const projectDir = opts?.projectDir ?? process.cwd();
44818
44818
  let layered = {};
44819
44819
  layered = { ...layered, ...readJsonIfExists(userConfigPath()) };
@@ -44832,6 +44832,10 @@ function loadConfig(opts) {
44832
44832
  layered[k] = v;
44833
44833
  }
44834
44834
  }
44835
+ return layered;
44836
+ }
44837
+ function loadConfig(opts) {
44838
+ const layered = readMergedRawConfig(opts);
44835
44839
  if (!layered.api_key) {
44836
44840
  throw new Error(`no api_key configured. Run \`cc-zh-watcher configure\` to set one, ` + `or set CC_ZH_API_KEY env var, ` + `or create ${userConfigPath()}.`);
44837
44841
  }
@@ -44845,7 +44849,7 @@ function loadConfig(opts) {
44845
44849
  translate_todos: validateBool(layered.translate_todos, "translate_todos", DEFAULT_TRANSLATE_TODOS),
44846
44850
  translate_agent: validateBool(layered.translate_agent, "translate_agent", DEFAULT_TRANSLATE_AGENT),
44847
44851
  context_enabled: validateBool(layered.context_enabled, "context_enabled", DEFAULT_CONTEXT_ENABLED),
44848
- show_tool_calls: validateBool(layered.show_tool_calls, "show_tool_calls", DEFAULT_SHOW_TOOL_CALLS),
44852
+ show_tool_calls: validateBool(layered.show_tool_calls, "show_tool_calls", opts?.defaults?.show_tool_calls ?? DEFAULT_SHOW_TOOL_CALLS),
44849
44853
  prompts: validatePromptMap(layered.prompts, "prompts"),
44850
44854
  prompt_extensions: validatePromptMap(layered.prompt_extensions, "prompt_extensions")
44851
44855
  };
@@ -48569,7 +48573,7 @@ function patchTodoField(payload, i, which, zh) {
48569
48573
  // package.json
48570
48574
  var package_default = {
48571
48575
  name: "cc-zh-watcher",
48572
- version: "0.3.0",
48576
+ version: "0.3.1",
48573
48577
  description: "Side-channel Chinese ↔ English bridge for Claude Code (single-watcher TUI). Type Chinese, Claude sees English; Claude replies in English, you see Chinese.",
48574
48578
  type: "module",
48575
48579
  bin: {
@@ -48727,6 +48731,13 @@ async function runWatch(opts) {
48727
48731
  `);
48728
48732
  }
48729
48733
  }
48734
+ const isDesktopAppSession = projectDir.includes("/.claude/worktrees/");
48735
+ if (isDesktopAppSession) {
48736
+ const raw = readMergedRawConfig({ projectDir: cwd2, explicitPath: opts.config });
48737
+ if (raw.show_tool_calls === undefined) {
48738
+ config = { ...config, show_tool_calls: false };
48739
+ }
48740
+ }
48730
48741
  render_default(import_react31.default.createElement(App2, { session, config, projectDir }));
48731
48742
  }
48732
48743
  async function runUninstall(opts) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "cc-zh-watcher",
3
- "version": "0.3.0",
3
+ "version": "0.3.1",
4
4
  "description": "Side-channel Chinese ↔ English bridge for Claude Code (single-watcher TUI). Type Chinese, Claude sees English; Claude replies in English, you see Chinese.",
5
5
  "type": "module",
6
6
  "bin": {