cc-viewer 1.8.18 → 1.8.19

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/dist/index.html CHANGED
@@ -21,7 +21,7 @@
21
21
  // 整体显示大小已弃用 CSS zoom:Electron 改用 webFrame.setZoomFactor(首屏抢占见
22
22
  // electron/tab-content-preload.js),纯浏览器交由用户用浏览器自带快捷键缩放,故此处不再设 zoom。
23
23
  </script>
24
- <script type="module" crossorigin src="./assets/index-Cp7ADaui.js"></script>
24
+ <script type="module" crossorigin src="./assets/index-CJdRSHTP.js"></script>
25
25
  <link rel="modulepreload" crossorigin href="./assets/vendor-antd-DKIytXho.js">
26
26
  <link rel="modulepreload" crossorigin href="./assets/vendor-codemirror-4qgXq03k.js">
27
27
  <link rel="modulepreload" crossorigin href="./assets/vendor-mdxeditor-D5Z5D9fq.js">
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "cc-viewer",
3
- "version": "1.8.18",
3
+ "version": "1.8.19",
4
4
  "description": "Claude Code logging, visualization, and management toolkit — launch a web viewer alongside Claude Code with full request/response tracing, proxy, and mobile support",
5
5
  "license": "MIT",
6
6
  "main": "server.js",
@@ -173,8 +173,21 @@ function imConfigPost(req, res, parsedUrl, isLocal, deps) {
173
173
  // bind-first-conversation(im-bridge-core.js)——首个向机器人发消息的会话被绑定,该会话内任何人
174
174
  // 都可无审批驱动本地会话。这里打一条服务端审计(curl/headless 启用走不到前端 toast),
175
175
  // PreToolUse permissions.deny 硬拦截(perm-bridge/im-deny,独立于白名单)仍然生效。
176
- if (incoming.enabled) warnIfEmptyAllowlist(id, incoming);
177
- const saved = saveConfig(id, incoming);
176
+ //
177
+ // 部分更新兜底:只携带 enabled(如会话弹窗的「停止」只发 {enabled:false, applyProcess:true})的 body
178
+ // 不能让 saveConfig→normalize 把缺省字段落成默认值——cred 字段(appKey/appId/botId)、白名单、
179
+ // region、ackCard/aiCard、maxChunkChars 都会被重置,仅 secret 字段有空值保留。检测「是否触及 enabled
180
+ // 之外的字段」,未触及则合并 loadConfig 的已存值(read-merge-write),只翻 enabled。设置面板的全量
181
+ // buildBody 触及业务字段 → 维持原样逐字节不变。
182
+ const desc = getDescriptor(id);
183
+ // `in` throws on a non-object JSON body (null / "str" / 42 / true), and the throw inside this
184
+ // async readBody callback writes no response → the client hangs. Neutralize to {} first
185
+ // (normalize() used to guard with `cfg ? … : undefined`; keep that tolerance here).
186
+ const incomingObj = (incoming && typeof incoming === 'object' && !Array.isArray(incoming)) ? incoming : {};
187
+ const touchesOthers = desc.fields.some((f) => f.key !== 'enabled' && f.key in incomingObj);
188
+ const effective = touchesOthers ? incomingObj : { ...loadConfig(id), enabled: !!incomingObj.enabled };
189
+ if (effective.enabled) warnIfEmptyAllowlist(id, effective);
190
+ const saved = saveConfig(id, effective);
178
191
  // applyProcess(默认 true,保持旧调用方语义):前端 onBlur 自动保存传 false → 仅存盘、不驱动进程,
179
192
  // 否则每次输入框失焦都会重启 worker。显式「启动/停止」按钮则不传(=true),沿用下述驱动逻辑。
180
193
  // 注:applyProcess 是未知字段,saveConfig/normalize 不会把它写盘。