dsh-tool-vision 0.9.4 → 0.9.5
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 +7 -6
- package/README.zh.md +3 -3
- package/client.js +2 -2
- package/index.js +8 -18
- package/package.json +80 -77
package/README.md
CHANGED
|
@@ -38,14 +38,15 @@ bridge keeps its conversion inside that durable path:
|
|
|
38
38
|
call `inspect_image`.
|
|
39
39
|
- **Web UI settings section (v0.3.0)**: Settings → 视觉模型 edits the
|
|
40
40
|
`tool-vision` namespace (API endpoint, write-only key, model, bridge
|
|
41
|
-
options) in
|
|
42
|
-
key lives in
|
|
41
|
+
options) in the active Profile patch; changes hot-apply without a restart. The API
|
|
42
|
+
key lives in that patch. Mount by package name
|
|
43
43
|
(`name: 'dsh-tool-vision'`) so the web client bundle is discovered.
|
|
44
44
|
|
|
45
|
-
## Compatibility (v0.9.
|
|
45
|
+
## Compatibility (v0.9.5)
|
|
46
46
|
|
|
47
|
-
DSH `0.1.
|
|
48
|
-
|
|
47
|
+
Targets DSH `0.1.7-rc.1` (`next`); npm `latest` is `0.1.5-rc.3`.
|
|
48
|
+
This version uses Profile patch settings and browser `configForms`.
|
|
49
|
+
Older hosts require an older plugin release. Alpha builds remain `unknown`.
|
|
49
50
|
|
|
50
51
|
## v0.9.4: Windows bridge export filenames
|
|
51
52
|
|
|
@@ -400,7 +401,7 @@ if (containsImage && !model.input.includes("image"))
|
|
|
400
401
|
|
|
401
402
|
`this.modelOf` resolves from the adapter's own `snapshot.models` catalog, which
|
|
402
403
|
defaults to `input: ["text"]` unless the user explicitly declared
|
|
403
|
-
`input: [text, image]` in
|
|
404
|
+
`input: [text, image]` in the Profile patch. When admitted by `v0.9.2`, the raw image
|
|
404
405
|
reached `streamWithSnapshot` and triggered `UNSUPPORTED_CONTENT`. Since the image
|
|
405
406
|
was already in the session's durable transcript, every subsequent turn failed.
|
|
406
407
|
|
package/README.zh.md
CHANGED
|
@@ -15,11 +15,11 @@ DSH 0.1.1 已为 DeepSeek 视觉模型目录加入原生图片输入。本插件
|
|
|
15
15
|
|
|
16
16
|
- 除 dsh SDK 外零依赖 —— 兼容任意端点:OpenAI GPT-4o、Qwen-VL(DashScope)、GLM-4V(智谱)、Moonshot、Gemini 兼容端点、本地 Ollama 等。
|
|
17
17
|
- 注册在**全局工具层**:进程内所有 Agent 都能调用 `inspect_image`。
|
|
18
|
-
- **Web UI 设置栏(v0.3.0)**:设置 → 视觉模型 编辑 `tool-vision`
|
|
18
|
+
- **Web UI 设置栏(v0.3.0)**:设置 → 视觉模型 编辑 `tool-vision` 配置(API 地址、只写密钥、模型、桥接选项),写入当前 Profile patch,**改动即时生效无需重启**。插件按包名挂载(`name: 'dsh-tool-vision'`)以便 web 端发现客户端 bundle。
|
|
19
19
|
|
|
20
|
-
## 兼容性(v0.9.
|
|
20
|
+
## 兼容性(v0.9.5)
|
|
21
21
|
|
|
22
|
-
DSH `0.1.
|
|
22
|
+
适配 DSH `0.1.7-rc.1`(npm `next`);npm `latest` 是 `0.1.5-rc.3`。旧宿主请使用插件旧版;alpha 构建仍标记 `unknown`。
|
|
23
23
|
|
|
24
24
|
## v0.9.4:修复 Windows 图片桥导出文件名
|
|
25
25
|
|
package/client.js
CHANGED
|
@@ -72,7 +72,7 @@ window.__ModuleLoader__.load({
|
|
|
72
72
|
|
|
73
73
|
// ── locale ────────────────────────────────────────────────────────────
|
|
74
74
|
var NS = "toolVision";
|
|
75
|
-
var inject = ["slots", "locale", "
|
|
75
|
+
var inject = ["slots", "locale", "configForms"];
|
|
76
76
|
var zh = {
|
|
77
77
|
nav: "视觉模型",
|
|
78
78
|
intro: "外置视觉模型配置:Agent 通过 inspect_image 工具把图片发给该端点分析。修改后即时生效(settings.yaml 热重载)。",
|
|
@@ -939,7 +939,7 @@ window.__ModuleLoader__.load({
|
|
|
939
939
|
function apply(ctx) {
|
|
940
940
|
var t = ctx.locale.bind(NS);
|
|
941
941
|
ctx.effect(function () { return ctx.locale.register(NS, { zh: zh, en: en }); }, "dsh-tool-vision: dictionaries");
|
|
942
|
-
var scope = ctx.
|
|
942
|
+
var scope = ctx.configForms.get("tool-vision");
|
|
943
943
|
attachBridgePreview(ctx, scope);
|
|
944
944
|
ctx.slots.inject("settings.section", function () {
|
|
945
945
|
return ctx.slots.register({
|
package/index.js
CHANGED
|
@@ -221,7 +221,7 @@ const Config = z.object({
|
|
|
221
221
|
/** Fixed session id override for callers without a dsh session context.
|
|
222
222
|
* Empty = auto (per-process stable id). */
|
|
223
223
|
sessionId: z.string().default(""),
|
|
224
|
-
});
|
|
224
|
+
}).volatile();
|
|
225
225
|
|
|
226
226
|
const MIME_BY_EXT = {
|
|
227
227
|
".png": "image/png",
|
|
@@ -1165,7 +1165,7 @@ function apply(ctx, config) {
|
|
|
1165
1165
|
// would be undefined (apiKey included).
|
|
1166
1166
|
let current = config;
|
|
1167
1167
|
let sourceGetter = null;
|
|
1168
|
-
const getConfig = () => (sourceGetter ? sourceGetter() : current);
|
|
1168
|
+
const getConfig = () => (sourceGetter ? sourceGetter() : typeof current.get === "function" ? current.get() : current);
|
|
1169
1169
|
// The registered settings scope, kept so tools can PERSIST what they measure.
|
|
1170
1170
|
// Null whenever no settings provider is mounted (composition-entry-only runs),
|
|
1171
1171
|
// in which case a probe still reports its verdict but cannot record it.
|
|
@@ -1435,22 +1435,12 @@ function apply(ctx, config) {
|
|
|
1435
1435
|
// `installSettingsSection` export (the provider now lives at ctx.settings).
|
|
1436
1436
|
// Inline the same logic via ctx.inject(["settings"]) — works on both
|
|
1437
1437
|
// 0.1.1 (module export wrapper) and 0.1.2 (ctx.settings) hosts.
|
|
1438
|
-
|
|
1439
|
-
|
|
1440
|
-
|
|
1441
|
-
|
|
1442
|
-
|
|
1443
|
-
|
|
1444
|
-
settingsScope = null;
|
|
1445
|
-
});
|
|
1446
|
-
// Hot-apply: `enabled` switches the child fiber, and any field that gates a
|
|
1447
|
-
// registration re-installs it, so none of them needs a dsh restart anymore.
|
|
1448
|
-
scope.watch(() => syncFeatures());
|
|
1449
|
-
sctx.effect(() => () => uninstallFeatures());
|
|
1450
|
-
// The stored value governs from here on; the composition entry was only a
|
|
1451
|
-
// placeholder until the provider answered.
|
|
1452
|
-
syncFeatures();
|
|
1453
|
-
});
|
|
1438
|
+
sourceGetter = () => typeof config.get === "function" ? config.get() : config;
|
|
1439
|
+
settingsScope = { update: (patch) => ctx.settings.update(NS, patch) };
|
|
1440
|
+
ctx.on("settings/document-updated", (id) => {
|
|
1441
|
+
if (id === NS) syncFeatures();
|
|
1442
|
+
});
|
|
1443
|
+
ctx.effect(() => () => uninstallFeatures());
|
|
1454
1444
|
|
|
1455
1445
|
// ── model catalog route: settings support, so it lives on THIS fiber ───────
|
|
1456
1446
|
// The master switch disposes the feature fiber on purpose (tools, bridge,
|
package/package.json
CHANGED
|
@@ -1,89 +1,92 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "dsh-tool-vision",
|
|
3
|
-
"version": "0.9.
|
|
4
|
-
"description": "DeepSeek Harness 外置视觉模型插件:inspect_image 把本地图片或 http(s) 图片 URL 发给任意 OpenAI 兼容端点,视觉模型看图的文字回答直接带回对话;附 Web UI 设置栏。",
|
|
5
|
-
"type": "module",
|
|
6
|
-
"main": "index.js",
|
|
7
|
-
"scripts": {
|
|
1
|
+
{
|
|
2
|
+
"name": "dsh-tool-vision",
|
|
3
|
+
"version": "0.9.5",
|
|
4
|
+
"description": "DeepSeek Harness 外置视觉模型插件:inspect_image 把本地图片或 http(s) 图片 URL 发给任意 OpenAI 兼容端点,视觉模型看图的文字回答直接带回对话;附 Web UI 设置栏。",
|
|
5
|
+
"type": "module",
|
|
6
|
+
"main": "index.js",
|
|
7
|
+
"scripts": {
|
|
8
8
|
"test": "node tests/preview-regex.test.mjs && node tests/preview-route.test.mjs && node tests/auto-image.test.mjs && node tests/dispatch-image.test.mjs && node --test tests/bridge-export.test.mjs tests/vision-tools.test.js tests/vision-tools-tools.test.js && node --test tests/settings-scope-compat.test.mjs tests/settings-atomic-write.test.mjs tests/switch-behaviour.test.mjs tests/model-lists.test.mjs tests/model-probe.test.mjs",
|
|
9
|
-
"test:render": "node tests/render-panel.test.mjs"
|
|
10
|
-
},
|
|
11
|
-
"exports": {
|
|
12
|
-
".": "./index.js",
|
|
13
|
-
"./client": "./client.js",
|
|
14
|
-
"./package.json": "./package.json"
|
|
15
|
-
},
|
|
16
|
-
"dsh": {
|
|
17
|
-
"bundle": {
|
|
18
|
-
"patch": "./cordis.patch.yml"
|
|
19
|
-
},
|
|
9
|
+
"test:render": "node tests/render-panel.test.mjs"
|
|
10
|
+
},
|
|
11
|
+
"exports": {
|
|
12
|
+
".": "./index.js",
|
|
13
|
+
"./client": "./client.js",
|
|
14
|
+
"./package.json": "./package.json"
|
|
15
|
+
},
|
|
16
|
+
"dsh": {
|
|
17
|
+
"bundle": {
|
|
18
|
+
"patch": "./cordis.patch.yml"
|
|
19
|
+
},
|
|
20
20
|
"client": {
|
|
21
21
|
"platform": "web"
|
|
22
22
|
},
|
|
23
23
|
"compatibility": {
|
|
24
|
-
"dsh": ">=0.1.
|
|
24
|
+
"dsh": ">=0.1.7-rc.1 <0.2.0",
|
|
25
25
|
"dshReleases": {
|
|
26
|
-
"0.1.5-rc.2": "
|
|
27
|
-
"0.1.5-rc.3": "
|
|
26
|
+
"0.1.5-rc.2": "incompatible",
|
|
27
|
+
"0.1.5-rc.3": "incompatible",
|
|
28
28
|
"0.1.6-alpha.1": "unknown",
|
|
29
29
|
"0.1.6-alpha.2": "unknown",
|
|
30
30
|
"0.1.7-alpha.1": "unknown",
|
|
31
|
-
"0.1.7-alpha.2": "unknown"
|
|
31
|
+
"0.1.7-alpha.2": "unknown",
|
|
32
|
+
"0.1.7-rc.1": "compatible"
|
|
32
33
|
},
|
|
33
34
|
"node": ">=20.18",
|
|
34
|
-
"profiles": [
|
|
35
|
+
"profiles": [
|
|
36
|
+
"web"
|
|
37
|
+
]
|
|
35
38
|
}
|
|
36
|
-
},
|
|
37
|
-
"files": [
|
|
38
|
-
"index.js",
|
|
39
|
-
"client.js",
|
|
40
|
-
"cordis.patch.yml",
|
|
41
|
-
"README.md",
|
|
42
|
-
"README.zh.md",
|
|
43
|
-
"LICENSE",
|
|
44
|
-
"lib",
|
|
45
|
-
"vendor"
|
|
46
|
-
],
|
|
47
|
-
"homepage": "https://github.com/Scorp1o117/dsh-tool-vision",
|
|
48
|
-
"keywords": [
|
|
49
|
-
"dsh",
|
|
50
|
-
"dsh-plugin",
|
|
51
|
-
"deepseek-harness",
|
|
52
|
-
"vision",
|
|
53
|
-
"multimodal",
|
|
54
|
-
"image",
|
|
55
|
-
"openai-compatible",
|
|
56
|
-
"qwen-vl",
|
|
57
|
-
"glm-4v",
|
|
58
|
-
"ollama"
|
|
59
|
-
],
|
|
60
|
-
"license": "MIT",
|
|
61
|
-
"engines": {
|
|
62
|
-
"node": ">=20.18"
|
|
63
|
-
},
|
|
64
|
-
"repository": {
|
|
65
|
-
"type": "git",
|
|
66
|
-
"url": "git+https://github.com/Scorp1o117/dsh-tool-vision.git"
|
|
67
|
-
},
|
|
68
|
-
"bugs": {
|
|
69
|
-
"url": "https://github.com/Scorp1o117/dsh-tool-vision/issues"
|
|
70
|
-
},
|
|
71
|
-
"dependencies": {
|
|
72
|
-
"@deepseek-ai/schemastery": "^3.18.
|
|
73
|
-
},
|
|
74
|
-
"peerDependencies": {
|
|
75
|
-
"@deepseek-ai/dsh-settings": "^0.1.
|
|
76
|
-
"@deepseek-ai/dsh-tools": "^0.1.
|
|
77
|
-
"react": "^18.2.0"
|
|
78
|
-
},
|
|
79
|
-
"optionalDependencies": {
|
|
80
|
-
"potrace": "^2.1.8",
|
|
81
|
-
"puppeteer-core": "^25.6.0",
|
|
82
|
-
"sharp": ">=0.35.3 <1"
|
|
83
|
-
},
|
|
84
|
-
"devDependencies": {
|
|
85
|
-
"jsdom": "^30.0.1",
|
|
86
|
-
"react": "^18.3.1",
|
|
87
|
-
"react-dom": "^18.3.1"
|
|
88
|
-
}
|
|
89
|
-
}
|
|
39
|
+
},
|
|
40
|
+
"files": [
|
|
41
|
+
"index.js",
|
|
42
|
+
"client.js",
|
|
43
|
+
"cordis.patch.yml",
|
|
44
|
+
"README.md",
|
|
45
|
+
"README.zh.md",
|
|
46
|
+
"LICENSE",
|
|
47
|
+
"lib",
|
|
48
|
+
"vendor"
|
|
49
|
+
],
|
|
50
|
+
"homepage": "https://github.com/Scorp1o117/dsh-tool-vision",
|
|
51
|
+
"keywords": [
|
|
52
|
+
"dsh",
|
|
53
|
+
"dsh-plugin",
|
|
54
|
+
"deepseek-harness",
|
|
55
|
+
"vision",
|
|
56
|
+
"multimodal",
|
|
57
|
+
"image",
|
|
58
|
+
"openai-compatible",
|
|
59
|
+
"qwen-vl",
|
|
60
|
+
"glm-4v",
|
|
61
|
+
"ollama"
|
|
62
|
+
],
|
|
63
|
+
"license": "MIT",
|
|
64
|
+
"engines": {
|
|
65
|
+
"node": ">=20.18"
|
|
66
|
+
},
|
|
67
|
+
"repository": {
|
|
68
|
+
"type": "git",
|
|
69
|
+
"url": "git+https://github.com/Scorp1o117/dsh-tool-vision.git"
|
|
70
|
+
},
|
|
71
|
+
"bugs": {
|
|
72
|
+
"url": "https://github.com/Scorp1o117/dsh-tool-vision/issues"
|
|
73
|
+
},
|
|
74
|
+
"dependencies": {
|
|
75
|
+
"@deepseek-ai/schemastery": "^3.18.4"
|
|
76
|
+
},
|
|
77
|
+
"peerDependencies": {
|
|
78
|
+
"@deepseek-ai/dsh-settings": "^0.1.7-rc.1",
|
|
79
|
+
"@deepseek-ai/dsh-tools": "^0.1.7-rc.1",
|
|
80
|
+
"react": "^18.2.0"
|
|
81
|
+
},
|
|
82
|
+
"optionalDependencies": {
|
|
83
|
+
"potrace": "^2.1.8",
|
|
84
|
+
"puppeteer-core": "^25.6.0",
|
|
85
|
+
"sharp": ">=0.35.3 <1"
|
|
86
|
+
},
|
|
87
|
+
"devDependencies": {
|
|
88
|
+
"jsdom": "^30.0.1",
|
|
89
|
+
"react": "^18.3.1",
|
|
90
|
+
"react-dom": "^18.3.1"
|
|
91
|
+
}
|
|
92
|
+
}
|