dsh-code-ui 1.6.3 → 1.6.4

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 (2) hide show
  1. package/lib/client.js +7 -4
  2. package/package.json +1 -1
package/lib/client.js CHANGED
@@ -2475,13 +2475,16 @@ window.__ModuleLoader__.load({
2475
2475
  const r = parseChipRef(refJson)
2476
2476
  return r ? chipShortLabel(r) : String(refJson)
2477
2477
  },
2478
- // 发送展开为「空」:chip 不进消息正文(用户要求对话区不展示引用指针)。
2479
- // AI 侧靠宿主 systemPrompt 动态 section 获知本条消息的引用并调
2480
- // get_referenced_snippets 读取——编号与 chip tag 一致。无效数据仍透出提示。
2478
+ // 发送后保留 chip 标签文本(如 `2:package.json:2-3`):消息里看得见引用了什么,
2479
+ // 不再展开成大段指针,也不进 [code UI] 块——AI 侧仍靠宿主 systemPrompt
2480
+ // section 获知全部引用并调 get_referenced_snippets 读取。编号取发送时刻冻结的 seq。
2481
2481
  serialize: async (refJson) => {
2482
2482
  const r = parseChipRef(refJson)
2483
2483
  if (!r) return '(code UI 引用数据无效: ' + refJson + ')'
2484
- return ''
2484
+ const full = store.references.find((x) => x.id === r.id)
2485
+ const pendHit = numberedPendingRefs().find((x) => x.r.id === r.id)
2486
+ const num = (full && full.seq) || (pendHit && pendHit.n) || '?'
2487
+ return (r.kind === 'translate' ? '🌐' : '') + num + ':' + tagLabel(full || r)
2485
2488
  },
2486
2489
  },
2487
2490
  }), 'code-ui: @ 引用源原型'))
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "dsh-code-ui",
3
- "version": "1.6.3",
3
+ "version": "1.6.4",
4
4
  "description": "Cursor 风格的 AI 代码编辑器工作台插件(DSH):文件树、多标签页编辑、语法高亮、引用/翻译行内标签给 AI、右侧停靠/悬浮窗口双布局",
5
5
  "type": "module",
6
6
  "main": "lib/index.js",