@zh-xx/antu-dsh 0.16.2 → 0.16.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 (4) hide show
  1. package/README.md +2 -2
  2. package/client.embed.js +27562 -27495
  3. package/client.js +20 -1
  4. package/package.json +2 -2
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.4",
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.4"
48
48
  },
49
49
  "peerDependencies": {
50
50
  "@deepseek-ai/dsh-tools": "^0.2.0-rc.2 || ^0.2.1-rc.0",