dsh-tool-vision 0.9.7 → 0.10.0

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 CHANGED
@@ -1,5 +1,9 @@
1
1
  # dsh-tool-vision
2
2
 
3
+ ## Configuration page (DSH 0.2.0-rc.2 and later)
4
+
5
+ Open **Plugins → Installed → dsh-tool-vision** from the homepage sidebar to configure and save this plugin. The page uses the official `plugins.bundle.config` interface, without a duplicate entry in global Settings. Web and Desktop share the page. This version requires DSH 0.2.0-rc.2 or a later 0.2.x host; existing configuration is retained.
6
+
3
7
  [![中文文档](https://img.shields.io/badge/%E4%B8%AD%E6%96%87%E6%96%87%E6%A1%A3-blue)](README.zh.md)
4
8
 
5
9
  **GitHub**: [Scorp1o117/dsh-tool-vision](https://github.com/Scorp1o117/dsh-tool-vision) · **npm**: [dsh-tool-vision](https://www.npmjs.com/package/dsh-tool-vision)
@@ -274,7 +278,7 @@ did nothing on a route spelled `xiaomi/mimo-v2.5` — fixed here, and the fix on
274
278
  ever *adds* models to the direct set (no entry that used to force a model direct
275
279
  stops doing so).
276
280
 
277
- **In the panel** (Settings → Vision Model):
281
+ **In the panel** (Plugins → dsh-tool-vision Model):
278
282
 
279
283
  - the list field is followed by a **clickable list of the models dsh actually has
280
284
  configured** (`llm.listProviders()` + `llm.listModels()`), grouped by provider
package/README.zh.md CHANGED
@@ -1,5 +1,9 @@
1
1
  # dsh-tool-vision
2
2
 
3
+ ## 配置入口(DSH 0.2.0-rc.2 起)
4
+
5
+ 在首页侧边栏打开 **插件 → 已安装 → dsh-tool-vision**,直接在插件详情页配置并保存。配置页注册到官方的 `plugins.bundle.config` 接口;全局设置页不再重复显示配置入口。Web 与桌面版使用相同界面,本版要求 DSH 0.2.0-rc.2 或更新的 0.2.x 版本。现有配置无需迁移。
6
+
3
7
  **GitHub**: [Scorp1o117/dsh-tool-vision](https://github.com/Scorp1o117/dsh-tool-vision) · **npm**: [dsh-tool-vision](https://www.npmjs.com/package/dsh-tool-vision) · [English](README.md)
4
8
 
5
9
  [![Enhancement Suite](https://img.shields.io/badge/part%20of-Enhancement%20Suite-3964fe)](https://github.com/Scorp1o117/dsh-enhancement-suite) [![npm](https://img.shields.io/npm/v/dsh-enhancement-suite)](https://www.npmjs.com/package/dsh-enhancement-suite)
@@ -15,7 +19,7 @@ DSH 0.1.1 已为 DeepSeek 视觉模型目录加入原生图片输入。本插件
15
19
 
16
20
  - 除 dsh SDK 外零依赖 —— 兼容任意端点:OpenAI GPT-4o、Qwen-VL(DashScope)、GLM-4V(智谱)、Moonshot、Gemini 兼容端点、本地 Ollama 等。
17
21
  - 注册在**全局工具层**:进程内所有 Agent 都能调用 `inspect_image`。
18
- - **Web UI 设置栏(v0.3.0)**:设置 → 视觉模型 编辑 `tool-vision` 配置(API 地址、只写密钥、模型、桥接选项),写入当前 Profile patch,**改动即时生效无需重启**。插件按包名挂载(`name: 'dsh-tool-vision'`)以便 web 端发现客户端 bundle。
22
+ - **Web UI 设置栏(v0.3.0)**:插件 → dsh-tool-vision 编辑 `tool-vision` 配置(API 地址、只写密钥、模型、桥接选项),写入当前 Profile patch,**改动即时生效无需重启**。插件按包名挂载(`name: 'dsh-tool-vision'`)以便 web 端发现客户端 bundle。
19
23
 
20
24
  ## 兼容性(v0.9.7)
21
25
 
@@ -199,7 +203,7 @@ blacklist → direct = base \ 名单 名单只做"减"
199
203
 
200
204
  **匹配规则**:`mimo-v2.5`、`xiaomi/mimo-v2.5`、`commandcode/xiaomi/mimo-v2.5` 指向同一个路由;`*` / `?` 为通配符;大小写不敏感。v0.8.1 只做字符串全等,README 自己举的 `mimo-v2.5` 例子在 `xiaomi/mimo-v2.5` 这类路由上其实**静默无效**,v0.9.0 修好了(只会多放行,不会收回任何旧配置已经放行的模型)。
201
205
 
202
- **面板**(设置 → 视觉模型):
206
+ **面板**(插件 → dsh-tool-vision):
203
207
 
204
208
  - 名单字段下面是一份**可直接勾选的模型清单**:候选来自 dsh 已配置的模型(`llm.listProviders()` + `llm.listModels()`),按 provider 分组,标注哪些**声明**支持图片;勾选加入、取消勾选移出,上方输入框仍可手打通配符(两者共用同一份草稿,改完按「保存」生效,未保存时清单头部会标"未保存");
205
209
  - 顶部常驻**当前路由判定**:`provider / model`、直发还是桥接、依据是什么(名单命中 / 自动识别 / 默认)。
package/client.js CHANGED
@@ -941,12 +941,10 @@ window.__ModuleLoader__.load({
941
941
  ctx.effect(function () { return ctx.locale.register(NS, { zh: zh, en: en }); }, "dsh-tool-vision: dictionaries");
942
942
  var scope = ctx.configForms.get("tool-vision");
943
943
  attachBridgePreview(ctx, scope);
944
- ctx.slots.inject("settings.section", function () {
944
+ ctx.slots.inject("plugins.bundle.config", function () {
945
945
  return ctx.slots.register({
946
- name: "settings.section",
947
- id: "tool-vision",
948
- order: 25,
949
- label: function () { return t("nav"); },
946
+ name: "plugins.bundle.config",
947
+ key: "dsh-tool-vision",
950
948
  locale: NS
951
949
  }, function (props) {
952
950
  return h(VisionSection, Object.assign({}, props, { scope: scope }));
package/cordis.patch.yml CHANGED
@@ -1,8 +1,8 @@
1
- # dsh-tool-vision — bundle patch layer
2
- #
3
- # Declares the plugin as a Cordis loader entry, making the package a standard
4
- # profile bundle: `dsh plugin --profile <p> add dsh-tool-vision` installs and
5
- # mounts it without manual cordis.patch.yml edits.
6
- - insert:
7
- - id: tool-vision
8
- name: 'dsh-tool-vision'
1
+ # dsh-tool-vision — bundle patch layer
2
+ #
3
+ # Declares the plugin as a Cordis loader entry, making the package a standard
4
+ # profile bundle: `dsh plugin --profile <p> add dsh-tool-vision` installs and
5
+ # mounts it without manual cordis.patch.yml edits.
6
+ - insert:
7
+ - id: tool-vision
8
+ name: 'dsh-tool-vision'
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
- }).volatile();
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() : typeof current.get === "function" ? current.get() : 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,12 +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
- 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());
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());
1444
1444
 
1445
1445
  // ── model catalog route: settings support, so it lives on THIS fiber ───────
1446
1446
  // The master switch disposes the feature fiber on purpose (tools, bridge,
package/package.json CHANGED
@@ -1,11 +1,11 @@
1
1
  {
2
2
  "name": "dsh-tool-vision",
3
- "version": "0.9.7",
3
+ "version": "0.10.0",
4
4
  "description": "DeepSeek Harness 外置视觉模型插件:inspect_image 把本地图片或 http(s) 图片 URL 发给任意 OpenAI 兼容端点,视觉模型看图的文字回答直接带回对话;附 Web UI 设置栏。",
5
5
  "type": "module",
6
6
  "main": "index.js",
7
7
  "scripts": {
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",
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 && node --test tests/plugin-page.test.mjs",
9
9
  "test:render": "node tests/render-panel.test.mjs"
10
10
  },
11
11
  "exports": {
@@ -21,7 +21,7 @@
21
21
  "platform": "web"
22
22
  },
23
23
  "compatibility": {
24
- "dsh": ">=0.1.7-rc.1 <0.2.0 || 0.2.0-rc.2",
24
+ "dsh": ">=0.2.0-rc.2 <0.3.0",
25
25
  "dshReleases": {
26
26
  "0.1.5-rc.2": "incompatible",
27
27
  "0.1.5-rc.3": "incompatible",
@@ -29,8 +29,8 @@
29
29
  "0.1.6-alpha.2": "unknown",
30
30
  "0.1.7-alpha.1": "unknown",
31
31
  "0.1.7-alpha.2": "unknown",
32
- "0.1.7-rc.1": "compatible",
33
- "0.1.7-rc.2": "compatible",
32
+ "0.1.7-rc.1": "incompatible",
33
+ "0.1.7-rc.2": "incompatible",
34
34
  "0.2.0-rc.2": "compatible"
35
35
  },
36
36
  "node": ">=20.18",
@@ -78,8 +78,8 @@
78
78
  "@deepseek-ai/schemastery": "^3.18.4"
79
79
  },
80
80
  "peerDependencies": {
81
- "@deepseek-ai/dsh-settings": "^0.1.7-rc.1 || 0.2.0-rc.2",
82
- "@deepseek-ai/dsh-tools": "^0.1.7-rc.1 || 0.2.0-rc.2",
81
+ "@deepseek-ai/dsh-settings": ">=0.2.0-rc.2 <0.3.0",
82
+ "@deepseek-ai/dsh-tools": ">=0.2.0-rc.2 <0.3.0",
83
83
  "react": "^18.2.0"
84
84
  },
85
85
  "optionalDependencies": {
@@ -88,9 +88,9 @@
88
88
  "sharp": ">=0.35.3 <1"
89
89
  },
90
90
  "devDependencies": {
91
- "@deepseek-ai/dsh": "0.1.7-rc.2",
92
- "@deepseek-ai/dsh-settings": "0.1.7-rc.2",
93
- "@deepseek-ai/dsh-tools": "0.1.7-rc.2",
91
+ "@deepseek-ai/dsh": "0.2.0-rc.2",
92
+ "@deepseek-ai/dsh-settings": "0.2.0-rc.2",
93
+ "@deepseek-ai/dsh-tools": "0.2.0-rc.2",
94
94
  "jsdom": "^30.0.1",
95
95
  "react": "^18.3.1",
96
96
  "react-dom": "^18.3.1"