dsh-tool-vision 0.9.4 → 0.9.6

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
@@ -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 `settings.yaml`; changes hot-apply without a restart. The API
42
- key lives in `settings.yaml`, not the profile patch. Mount by package name
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.4)
45
+ ## Compatibility (v0.9.6)
46
46
 
47
- DSH `0.1.5-rc.3` is the current npm `latest` and `next`. Alpha releases remain
48
- `unknown` until tested.
47
+ Tested with DSH `0.1.7-rc.1` and `0.1.7-rc.2` (`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 `settings.yaml`. When admitted by `v0.9.2`, the raw image
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,17 +15,17 @@ 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` 命名空间(API 地址、只写密钥、模型、桥接选项),写入 `settings.yaml`,**改动即时生效无需重启**。API 密钥存放在 `settings.yaml` 而非 profile patch;插件按包名挂载(`name: 'dsh-tool-vision'`)以便 web 端发现客户端 bundle。
19
-
20
- ## 兼容性(v0.9.4)
21
-
22
- DSH `0.1.5-rc.3` 现为 npm 的 `latest` 和 `next`。alpha 版本未经验证前继续标记 `unknown`。
23
-
24
- ## v0.9.4:修复 Windows 图片桥导出文件名
25
-
26
- - 导出文件名改为从完整附件 ID 生成稳定哈希;`sha256:...` 等 ID 不再写入 NTFS 备用数据流,避免出现可见主文件为 0 字节的情况。
27
- - 写入前确保导出目录存在;进程内缓存按 `bridgeExportDir` 区分。
28
- - 已通过 DSH `0.1.5-rc.3` 一次性 Profile 的安装、Web 启动、首页与客户端 Bundle HTTP 检查,以及卸载验证。
18
+ - **Web UI 设置栏(v0.3.0)**:设置 → 视觉模型 编辑 `tool-vision` 配置(API 地址、只写密钥、模型、桥接选项),写入当前 Profile patch,**改动即时生效无需重启**。插件按包名挂载(`name: 'dsh-tool-vision'`)以便 web 端发现客户端 bundle。
19
+
20
+ ## 兼容性(v0.9.6)
21
+
22
+ 已验证 DSH `0.1.7-rc.1` 与 `0.1.7-rc.2`(npm `next`);npm `latest` 是 `0.1.5-rc.3`。旧宿主请使用插件旧版;alpha 构建仍标记 `unknown`。
23
+
24
+ ## v0.9.4:修复 Windows 图片桥导出文件名
25
+
26
+ - 导出文件名改为从完整附件 ID 生成稳定哈希;`sha256:...` 等 ID 不再写入 NTFS 备用数据流,避免出现可见主文件为 0 字节的情况。
27
+ - 写入前确保导出目录存在;进程内缓存按 `bridgeExportDir` 区分。
28
+ - 已通过 DSH `0.1.5-rc.3` 一次性 Profile 的安装、Web 启动、首页与客户端 Bundle HTTP 检查,以及卸载验证。
29
29
 
30
30
  ## 安装
31
31
 
@@ -62,7 +62,7 @@ DSH `0.1.5-rc.3` 现为 npm 的 `latest` 和 `next`。alpha 版本未经验证
62
62
  | `maxImageBytes` | `10MB` | 本地图片大小上限 |
63
63
  | `description` | 默认描述 | 工具描述(模型可见) |
64
64
  | `bridgeTextOnly` | `true` | 把粘贴图片转成文本指引(发给看不懂图片的模型时) |
65
- | `bridgeExportDir` | 临时目录 | 桥接图片导出目录(`os.tmpdir()/dsh-vision-bridge`);文件名使用附件 ID 的安全哈希 |
65
+ | `bridgeExportDir` | 临时目录 | 桥接图片导出目录(`os.tmpdir()/dsh-vision-bridge`);文件名使用附件 ID 的安全哈希 |
66
66
  | `multimodalModels` | `[]` | 模型名单(逗号分隔)。每项按「完整 id / 末段裸 id / `provider/id`」三种写法匹配,大小写不敏感,支持 `*` `?` 通配(如 `*vl*`、`deepseek/*`)。含义由下面的模式决定 |
67
67
  | `multimodalListMode` | `whitelist` | **名单模式(v0.9.0)**:`whitelist` 名单内模型直收图片块(旧行为);`blacklist` 名单内模型强制走桥接(用来纠正"声明支持图片但实际不支持"的模型);`off` 忽略名单。未知值一律回退 `whitelist` |
68
68
  | `autoDetectMultimodal` | `true` | **自动识别(v0.9.0)**:按当前路由自己声明的 `inputModalities` 判定,再与名单合成(白名单取并集、黑名单取差集)。默认开启=识别到纯文本就交给桥接、识别到多模态就等同白名单成员直发图片;声明永远读"包装前"的真值,不会被 `bridgeAutoImage` 的假声明污染。设为 `false` 可退回"只认名单"的纯手工行为 |
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", "settingsScope"];
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.settingsScope.bind({ namespace: "tool-vision" });
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/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
- });
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
- ctx.inject(["settings"], (sctx) => {
1439
- const scope = sctx.settings.register(NS, Config, { base: config });
1440
- sourceGetter = () => scope.get();
1441
- settingsScope = scope;
1442
- sctx.effect(() => () => {
1443
- sourceGetter = null;
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();
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();
1453
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,11 +1,11 @@
1
1
  {
2
2
  "name": "dsh-tool-vision",
3
- "version": "0.9.4",
3
+ "version": "0.9.6",
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",
9
9
  "test:render": "node tests/render-panel.test.mjs"
10
10
  },
11
11
  "exports": {
@@ -17,22 +17,26 @@
17
17
  "bundle": {
18
18
  "patch": "./cordis.patch.yml"
19
19
  },
20
- "client": {
21
- "platform": "web"
22
- },
23
- "compatibility": {
24
- "dsh": ">=0.1.0-rc.7 <0.2.0",
25
- "dshReleases": {
26
- "0.1.5-rc.2": "compatible",
27
- "0.1.5-rc.3": "compatible",
28
- "0.1.6-alpha.1": "unknown",
29
- "0.1.6-alpha.2": "unknown",
30
- "0.1.7-alpha.1": "unknown",
31
- "0.1.7-alpha.2": "unknown"
32
- },
33
- "node": ">=20.18",
34
- "profiles": ["web"]
35
- }
20
+ "client": {
21
+ "platform": "web"
22
+ },
23
+ "compatibility": {
24
+ "dsh": ">=0.1.7-rc.1 <0.2.0",
25
+ "dshReleases": {
26
+ "0.1.5-rc.2": "incompatible",
27
+ "0.1.5-rc.3": "incompatible",
28
+ "0.1.6-alpha.1": "unknown",
29
+ "0.1.6-alpha.2": "unknown",
30
+ "0.1.7-alpha.1": "unknown",
31
+ "0.1.7-alpha.2": "unknown",
32
+ "0.1.7-rc.1": "compatible",
33
+ "0.1.7-rc.2": "compatible"
34
+ },
35
+ "node": ">=20.18",
36
+ "profiles": [
37
+ "web"
38
+ ]
39
+ }
36
40
  },
37
41
  "files": [
38
42
  "index.js",
@@ -69,11 +73,11 @@
69
73
  "url": "https://github.com/Scorp1o117/dsh-tool-vision/issues"
70
74
  },
71
75
  "dependencies": {
72
- "@deepseek-ai/schemastery": "^3.18.1"
76
+ "@deepseek-ai/schemastery": "^3.18.4"
73
77
  },
74
78
  "peerDependencies": {
75
- "@deepseek-ai/dsh-settings": "^0.1.0-rc.7 || ^0.1.1-rc.1 || ^0.1.2-rc.1 || ^0.1.5-rc.1",
76
- "@deepseek-ai/dsh-tools": "^0.1.0-rc.7 || ^0.1.1-rc.1 || ^0.1.2-rc.1 || ^0.1.5-rc.1",
79
+ "@deepseek-ai/dsh-settings": "^0.1.7-rc.1",
80
+ "@deepseek-ai/dsh-tools": "^0.1.7-rc.1",
77
81
  "react": "^18.2.0"
78
82
  },
79
83
  "optionalDependencies": {
@@ -82,6 +86,9 @@
82
86
  "sharp": ">=0.35.3 <1"
83
87
  },
84
88
  "devDependencies": {
89
+ "@deepseek-ai/dsh": "0.1.7-rc.2",
90
+ "@deepseek-ai/dsh-settings": "0.1.7-rc.2",
91
+ "@deepseek-ai/dsh-tools": "0.1.7-rc.2",
85
92
  "jsdom": "^30.0.1",
86
93
  "react": "^18.3.1",
87
94
  "react-dom": "^18.3.1"