wezard 1.3.19 → 1.3.20

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "wezard",
3
- "version": "1.3.19",
3
+ "version": "1.3.20",
4
4
  "description": "Bridge Claude Code and WeCom: PreToolUse approval cards + bidirectional tmux session mirror with image paste",
5
5
  "type": "module",
6
6
  "license": "MIT",
package/web/chat.js CHANGED
@@ -323,12 +323,10 @@
323
323
 
324
324
  // staleAt 由 JSON 单独送来 (不在 html 里, 否则会打乱服务端的 sig 去重), 落到
325
325
  // DOM 上供 expireTurns 定时判定。
326
+ // 't:' = 一轮对话, 'm:' = 上下文断点行。子 agent 的卡片嵌在父轮里面, 所以按
327
+ // 整棵子树找 —— 只扫顶层会把它当成"还没渲染过"而重复插一份。
326
328
  var turnNode = function (id) {
327
- var inner = $('#thread-in'), hit = null;
328
- Array.prototype.forEach.call(inner.children, function (c) {
329
- if (c.getAttribute('data-key') === 't:' + id) hit = c;
330
- });
331
- return hit;
329
+ return $('#thread-in').querySelector('[data-key="t:' + id + '"],[data-key="m:' + id + '"]');
332
330
  };
333
331
  var markStale = function (t) {
334
332
  var n = turnNode(t.id);
@@ -366,8 +364,10 @@
366
364
  var until = Number(g.getAttribute('data-stale-at') || 0);
367
365
  if (!until || now <= until) return;
368
366
  g.setAttribute('data-stale-at', '0');
369
- var dot = g.querySelector('.tg-dot'); if (dot) dot.classList.remove('live');
370
- var typing = g.querySelector('.typing'); if (typing) typing.remove();
367
+ // 连内嵌的子 agent 卡片一起熄灯: 父轮都到点了, 它派出去的必然也停了,
368
+ // 而子卡片没有自己的 data-stale-at (staleAt 只随顶层片段下发)。
369
+ g.querySelectorAll('.tg-dot').forEach(function (d) { d.classList.remove('live'); });
370
+ g.querySelectorAll('.typing').forEach(function (t) { t.remove(); });
371
371
  });
372
372
  };
373
373