@zh-xx/antu-dsh 0.16.2 → 0.16.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 (3) hide show
  1. package/README.md +2 -2
  2. package/client.js +20 -1
  3. package/package.json +2 -2
package/README.md CHANGED
@@ -126,7 +126,7 @@ existing MCP server with a **configuration-only** bundle (official template:
126
126
  serverName: antu
127
127
  transport: stdio
128
128
  command: npx
129
- args: ['-y', '-p', '@zh-xx/antu@0.16.2', 'antu-mcp']
129
+ args: ['-y', '-p', '@zh-xx/antu@0.16.3', 'antu-mcp']
130
130
  failOnStartupError: true
131
131
  ```
132
132
 
@@ -135,7 +135,7 @@ Install with DSH's `plugin_manager` → `install_bundle` and the **absolute** pa
135
135
  ### Limits of this stopgap (read before relying on it)
136
136
 
137
137
  - Needs **system Node and network** for `npx` (Desktop's embedded Node is not enough by itself).
138
- - Pin the package version (`@0.16.2` above); `@latest` drifts per machine.
138
+ - Pin the package version (`@0.16.3` above); `@latest` drifts per machine.
139
139
  - Tools appear as `mcp__antu__antu_validate`, … — not the final Host names.
140
140
  - For `antu_render`, pass an **absolute `outPath` inside the session workspace**. The default relative path
141
141
  follows the MCP process cwd, which is not the session folder.
package/client.js CHANGED
@@ -252,6 +252,21 @@ function antuAddress({ session, callId }) {
252
252
  return `dsh-resource://antu/${parts.map(encodeURIComponent).join('/')}`
253
253
  }
254
254
 
255
+ /**
256
+ * Whether this browser reads the host out of a `dsh-resource://` address. DSH finds a resource's provider by
257
+ * that host; an old browser engine (e.g. a 360 browser on a Kylin desktop) returns '' for a custom scheme,
258
+ * so DSH sees no provider and reports "no resource" for an address that is fine.
259
+ * @param {string} address
260
+ * @returns {boolean}
261
+ */
262
+ function browserReadsResourceHost(address) {
263
+ try {
264
+ return new URL(address).hostname === 'antu'
265
+ } catch {
266
+ return false
267
+ }
268
+ }
269
+
255
270
  /**
256
271
  * Decode a saved or caller-supplied diagram address; undefined unless it is exactly a Session or
257
272
  * subagent address this plugin wrote (same rules as parsePlanAddress).
@@ -445,6 +460,7 @@ const zh = {
445
460
  'sidebar.openHtml': '打开 HTML',
446
461
  'sidebar.loading': '正在加载图…',
447
462
  'sidebar.none': '这个标签页里没有图。',
463
+ 'sidebar.oldBrowser': '当前浏览器版本过旧,无法在 DSH 里打开这张图。请换用较新的浏览器(如火狐、Chrome),或点击“打开 HTML”。',
448
464
  'sidebar.failed': '无法加载这张图。',
449
465
  'notice.preparing': '正在准备图…',
450
466
  'notice.badArgs': '无法解析工具参数;调用完成后可打开 HTML 文件。',
@@ -472,6 +488,7 @@ const en = {
472
488
  'sidebar.openHtml': 'Open HTML',
473
489
  'sidebar.loading': 'Loading diagram…',
474
490
  'sidebar.none': 'No diagram in this tab.',
491
+ 'sidebar.oldBrowser': 'This browser is too old for DSH to open the diagram. Use a newer browser (Firefox, Chrome) or open the HTML file.',
475
492
  'sidebar.failed': 'Could not load this diagram.',
476
493
  'notice.preparing': 'Preparing diagram…',
477
494
  'notice.badArgs': 'Could not parse tool arguments; open the HTML file when the call finishes.',
@@ -885,7 +902,9 @@ function beginLoadEmbed(requireFn, cache) {
885
902
  (resource.status === 'loading'
886
903
  ? t('sidebar.loading')
887
904
  : resource.status === 'none'
888
- ? t('sidebar.none')
905
+ ? parseAntuAddress(address || '') && !browserReadsResourceHost(address)
906
+ ? t('sidebar.oldBrowser')
907
+ : t('sidebar.none')
889
908
  : resource.status === 'failed'
890
909
  ? t('sidebar.failed')
891
910
  : failureText(failure, t) || (!spec ? t('sidebar.none') : null))
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@zh-xx/antu-dsh",
3
- "version": "0.16.2",
3
+ "version": "0.16.3",
4
4
  "description": "Antu diagrams inside DeepSeek Harness: Host tools (antu_validate / antu_layout / antu_render) and an interactive chat card.",
5
5
  "license": "AGPL-3.0-or-later",
6
6
  "type": "module",
@@ -44,7 +44,7 @@
44
44
  }
45
45
  },
46
46
  "dependencies": {
47
- "@zh-xx/antu": "0.16.2"
47
+ "@zh-xx/antu": "0.16.3"
48
48
  },
49
49
  "peerDependencies": {
50
50
  "@deepseek-ai/dsh-tools": "^0.2.0-rc.2 || ^0.2.1-rc.0",