dsh-drawai 0.2.2 → 0.2.3

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/index.js +5 -4
  2. package/package.json +1 -1
package/lib/index.js CHANGED
@@ -3345,10 +3345,11 @@ function sanitizeNewName(raw) {
3345
3345
  ? 'DrawAI 画布:用户现在打开的是 ' + path + '。diagram_read / diagram_apply 不传 path 时默认就操作这一张。'
3346
3346
  : 'DrawAI 画布:用户关掉了画布(此刻没有打开任何一张)。不传 path 时工具会退回 ' + DEFAULT_PATH + '。'
3347
3347
  try {
3348
- // 形状照 @deepseek-ai/dsh-llm 的 UserMessage:role + content + source。
3349
- // source 用 `{ kind: 'plugin', plugin: <本插件名> }`(与第一方 dsh-agent-instructions 同款);
3350
- // 不带 form —— 它只是个"环境事实",不是 instructions/catalog 那几类。
3351
- agent.inject({ role: 'user', content: [{ type: 'text', text: text }], source: { kind: 'plugin', plugin: name } })
3348
+ // Session V4 要求 producer-owned source kind:字面量 `'plugin'` 会被拒
3349
+ // (format v4 message requires a producer-owned source kind)。
3350
+ // 目标形是 `{ kind: 'plugin:<名>' }`(V3→V4 迁移对旧 wrapper 也写成这样),
3351
+ // 对 user/message 注入在 V3/V4 都可过;不带 form —— 它只是"环境事实"。
3352
+ agent.inject({ role: 'user', content: [{ type: 'text', text: text }], source: { kind: 'plugin:' + name } })
3352
3353
  } catch (error) {
3353
3354
  // 注入失败不该影响画布本身:工具那条回退链还在。
3354
3355
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "dsh-drawai",
3
- "version": "0.2.2",
3
+ "version": "0.2.3",
4
4
  "type": "module",
5
5
  "description": "DSH 右侧栏的可编辑画布 + AI 语义绘图工具(diagram_apply / diagram_read),直接读写原生 .drawio 文件",
6
6
  "license": "MIT",