@zh-xx/antu-dsh 0.16.1 → 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.
- package/README.md +4 -5
- package/client.js +20 -1
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -5,8 +5,7 @@ DSH conventions (resource addresses, providers, seats): [spec/dsh-conventions.md
|
|
|
5
5
|
(中文 [spec/dsh-conventions.zh-CN.md](../../spec/dsh-conventions.zh-CN.md)).
|
|
6
6
|
Umbrella issue: [#79](https://github.com/zh-xx/Antu/issues/79).
|
|
7
7
|
|
|
8
|
-
**
|
|
9
|
-
Needs `@zh-xx/antu` at the same version, which is on npm.
|
|
8
|
+
**On npm as `@zh-xx/antu-dsh`** (from 0.16.1; the plugin has the same version number as the repository and depends on exactly the same version of `@zh-xx/antu`): `dsh plugin --profile <name> add @zh-xx/antu-dsh`, then restart DSH. To try a build of your own, use the **tarball** (`npm run build:dsh`, below).
|
|
10
9
|
|
|
11
10
|
## Requirements
|
|
12
11
|
|
|
@@ -44,7 +43,7 @@ The peer range lists both: a prerelease only satisfies a range that names a prer
|
|
|
44
43
|
|
|
45
44
|
## Install into DSH
|
|
46
45
|
|
|
47
|
-
**From npm
|
|
46
|
+
**From npm**: `dsh plugin --profile <name> add @zh-xx/antu-dsh`, then restart DSH.
|
|
48
47
|
|
|
49
48
|
**Or the tarball** (peers resolve inside the DSH profile):
|
|
50
49
|
|
|
@@ -127,7 +126,7 @@ existing MCP server with a **configuration-only** bundle (official template:
|
|
|
127
126
|
serverName: antu
|
|
128
127
|
transport: stdio
|
|
129
128
|
command: npx
|
|
130
|
-
args: ['-y', '-p', '@zh-xx/antu@0.
|
|
129
|
+
args: ['-y', '-p', '@zh-xx/antu@0.16.3', 'antu-mcp']
|
|
131
130
|
failOnStartupError: true
|
|
132
131
|
```
|
|
133
132
|
|
|
@@ -136,7 +135,7 @@ Install with DSH's `plugin_manager` → `install_bundle` and the **absolute** pa
|
|
|
136
135
|
### Limits of this stopgap (read before relying on it)
|
|
137
136
|
|
|
138
137
|
- Needs **system Node and network** for `npx` (Desktop's embedded Node is not enough by itself).
|
|
139
|
-
- Pin the package version (`@0.
|
|
138
|
+
- Pin the package version (`@0.16.3` above); `@latest` drifts per machine.
|
|
140
139
|
- Tools appear as `mcp__antu__antu_validate`, … — not the final Host names.
|
|
141
140
|
- For `antu_render`, pass an **absolute `outPath` inside the session workspace**. The default relative path
|
|
142
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
|
-
?
|
|
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.
|
|
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.
|
|
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",
|