@anionex/dsh-vision-toolkit 0.1.5 → 0.1.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.i18n.yaml CHANGED
@@ -1,6 +1,6 @@
1
1
  # Bilingual-pair consistency record (docs/i18n/README.md): the git blob hash of each
2
2
  # side as of the last confirmed-consistent state. Both languages carry equal authority;
3
3
  # after editing either side, bring the other along and re-record with:
4
- # pnpm run verify-translation-pairing --write README.md
5
- README.md: 1b6de29f6b3b5e7373014301e2c33600f07e30ee
6
- README.zh.md: c97d447ebfa8b776820069270b79d3db09c9daa5
4
+ # pnpm run verify-translation-pairing --write dsh-vision-dark-theme/README.md
5
+ README.md: 60cdb5fc0cd1cc9d6d5249fcdd021677c1618eff
6
+ README.zh.md: 3d6d056e4ba2d1a86683b71b2a40dcb5e5231fef
package/README.md CHANGED
@@ -3,8 +3,8 @@
3
3
  # DSH Vision Toolkit
4
4
 
5
5
  [![X (Twitter)](https://img.shields.io/badge/-@anion__ex-000000?style=flat-square&logo=x&logoColor=white)](https://x.com/anion_ex)
6
- [![Release v0.1.4](https://img.shields.io/badge/release-v0.1.4-5B4CF0?style=flat-square)](https://github.com/Anionex/dsh-vision-toolkit/releases/tag/v0.1.4)
7
- [![Verified: 136 tests](https://img.shields.io/badge/verified-136%20tests-2EA44F?style=flat-square)](tests)
6
+ [![Release v0.1.6](https://img.shields.io/badge/release-v0.1.6-5B4CF0?style=flat-square)](https://github.com/Anionex/dsh-vision-toolkit/releases/tag/v0.1.6)
7
+ [![Verified: 162 tests](https://img.shields.io/badge/verified-162%20tests-2EA44F?style=flat-square)](tests)
8
8
  [![License: MIT](https://img.shields.io/badge/license-MIT-0B7285?style=flat-square)](LICENSE)
9
9
  [![Node.js](https://img.shields.io/badge/Node.js-%5E22.19%20%7C%20%3E%3D24-339933?style=flat-square&logo=nodedotjs&logoColor=white)](package.json)
10
10
  [![Python](https://img.shields.io/badge/Python-3.11%2B-3776AB?style=flat-square&logo=python&logoColor=white)](runtime/requirements.lock)
@@ -120,7 +120,7 @@ flowchart LR
120
120
  Artifacts --> Web["Preview, download, or open file"]
121
121
  ```
122
122
 
123
- Tool definitions call one runtime; the runtime validates paths, limits, credentials, cancellation, and deadlines before dispatching to the pinned upstream snapshot or configured OpenAI-compatible vision endpoint. Web presentation consumes the same structured results and Artifact descriptors, so it does not change Headless behavior. Health, connection testing, and version inspection stay in Settings rather than model tool schemas.
123
+ Tool definitions call one runtime; the runtime validates paths, limits, credentials, cancellation, and deadlines before dispatching to the pinned upstream snapshot or configured vision provider endpoint. Web presentation consumes the same structured results and Artifact descriptors, so it does not change Headless behavior. Health, connection testing, and version inspection stay in Settings rather than model tool schemas.
124
124
 
125
125
  ## Tools
126
126
 
@@ -150,7 +150,7 @@ Health checks, connection testing, and plugin/upstream version inspection are ad
150
150
  - DeepSeek Harness with a Web or Headless profile and `pnpm` available to `dsh plugin`.
151
151
  - Python 3.11 or newer. Managed mode creates an isolated environment, so users do not install the upstream CLI or Python packages manually.
152
152
  - Network access on the first managed-runtime activation unless the exact packages in `runtime/requirements.lock` are already available in the configured package cache.
153
- - An OpenAI-compatible vision endpoint and DSH Credential for `vision_glance`, `vision_ground`, `vision_detect`, and non-split-only long-screenshot OCR. Local tools remain usable without that credential.
153
+ - An OpenAI-compatible or Anthropic vision endpoint and DSH Credential for `vision_glance`, `vision_ground`, `vision_detect`, and non-split-only long-screenshot OCR. Local tools remain usable without that credential.
154
154
  - Chrome, Chromium, or Edge only for `vision_html_screenshot`; all other tools remain available when no supported browser is installed.
155
155
  - PNG, JPEG, GIF, or WebP inputs inside the session workspace or an explicitly configured `allowedDirs` root.
156
156
 
@@ -184,6 +184,15 @@ Remove the flag or set it to `false` to re-enable the plugin. Disposal first can
184
184
 
185
185
  ### Upgrade
186
186
 
187
+ **Migrating from the retired `@dsh-external/dsh-vision-toolkit`:** the npm package now lives under the `@anionex` scope. If you installed the retired package, do **not** run `update` on it — that account cannot publish this release. Migrate to the new package name and restart the Web profile:
188
+
189
+ ```sh
190
+ dsh plugin --profile web remove @dsh-external/dsh-vision-toolkit
191
+ dsh plugin --profile web add @anionex/dsh-vision-toolkit
192
+ ```
193
+
194
+ After restarting, Settings → Vision should report plugin version **0.1.6**.
195
+
187
196
  For a registry installation, update the dependency through the profile package manager:
188
197
 
189
198
  ```sh
@@ -213,6 +222,9 @@ The bundle defaults to the managed runtime. A profile patch can override the pro
213
222
  baseUrl: https://api.inferera.com/v1
214
223
  credential: VISION_API_KEY
215
224
  model: gemini-3.6-flash
225
+ protocol: openai
226
+ anthropicThinking: omit
227
+ userAgent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/126.0.0.0 Safari/537.36
216
228
  language: zh
217
229
  timeoutMs: 60000
218
230
  maxImageBytes: 10485760
@@ -227,9 +239,12 @@ The bundle defaults to the managed runtime. A profile patch can override the pro
227
239
 
228
240
  | Field | Default | Contract |
229
241
  |---|---|---|
230
- | `provider.baseUrl` | `https://api.inferera.com/v1` | OpenAI-compatible base URL; normalized without trailing slashes |
242
+ | `provider.baseUrl` | `https://api.inferera.com/v1` | Provider API base URL, normalized without trailing slashes; for Anthropic use a base ending in `/v1`, not the full `/messages` URL |
231
243
  | `provider.credential` | `VISION_API_KEY` | DSH Credential reference, never a secret value |
232
244
  | `provider.model` | `gemini-3.6-flash` | Multimodal model name sent to remote tools |
245
+ | `provider.protocol` | `openai` | `openai` sends Chat Completions requests; `anthropic` sends native Messages requests |
246
+ | `provider.anthropicThinking` | `omit` | Anthropic thinking field. `omit` sends no thinking field and has the broadest compatibility. Use `disabled` or `adaptive` only when the selected model documents that mode; restore `omit` first if the provider returns HTTP 400. |
247
+ | `provider.userAgent` | browser-compatible default | User-Agent sent by vision requests and explicit connection tests; override it for provider or proxy compatibility |
233
248
  | `language` | `zh` | Vision output language: `zh` or `en` |
234
249
  | `timeoutMs` | `60000` | Whole-operation deadline, 1000-600000 ms; each tool may request a narrower override |
235
250
  | `maxImageBytes` | `10485760` | Encoded-byte limit per input image |
@@ -265,15 +280,15 @@ External mode is intended for development or controlled deployments:
265
280
  python: python3.12
266
281
  ```
267
282
 
268
- The path must be an exported copy matching the packaged manifest or the root of a clean Git checkout at `c27d1a300962b553c0884993c575cd3e819465ce`. Modified tracked files and untracked files are rejected because they can change or shadow the pinned Python behavior.
283
+ The path must be an exported copy matching the packaged manifest or the root of a clean Git checkout at `bc9803d7d6300c864d17460ecbb33540b26638e0`. Modified tracked files and untracked files are rejected because they can change or shadow the pinned Python behavior.
269
284
 
270
285
  ## Web Settings
271
286
 
272
- The Web profile registers a Vision Toolkit Settings section for the provider URL, Credential reference, model, language, timeout, byte/pixel limits, concurrency, runtime mode, Python override, external source path, and allowed directories. It also shows plugin/upstream versions, the active runtime generation, non-secret Credential configured/source/writable facts, runtime paths, health results, and Artifact-route availability.
287
+ The Web profile registers a Vision Toolkit Settings section for the provider URL, Credential reference, model, OpenAI/Anthropic protocol, Anthropic thinking mode, User-Agent, language, timeout, byte/pixel limits, concurrency, runtime mode, Python override, external source path, and allowed directories. It also shows plugin/upstream versions, the active runtime generation, non-secret Credential configured/source/writable facts, runtime paths, health results, and Artifact-route availability.
273
288
 
274
289
  `Save and apply` validates the complete value, prepares the candidate Python/upstream runtime, commits the Settings revision, and only then atomically switches generations. A rejected candidate leaves the previous generation serving and is reported separately from a genuinely unavailable runtime. `Reload` always restores the authoritative saved value, even when its revision did not change, so a rejected browser draft is discarded. If initial startup cannot prepare a runtime, the Settings route remains available so a valid configuration can make the first generation operational. A stale browser revision receives a conflict instead of overwriting a newer save; reload before retrying. A read-only Settings provider allows inspection and health checks but disables saves.
275
290
 
276
- `Run health check` performs local checks only. `Test connection` is an explicit action that sends the configured Credential to `GET /models`; it uploads no image and creates no completion. Plugin load and ordinary Settings reads never make that request.
291
+ `Run health check` performs local checks only. `Test connection` is an explicit action that sends the configured Credential to `GET /models`; OpenAI uses Bearer authentication, while Anthropic uses `x-api-key` and `anthropic-version`. The check uploads no image and creates no completion. Plugin load and ordinary Settings reads never make that request.
277
292
 
278
293
  Health, connection testing, and plugin/upstream version inspection are administrative Web Settings capabilities rather than model-facing tools, so their schemas never occupy an agent request.
279
294
 
package/README.zh.md CHANGED
@@ -3,8 +3,8 @@
3
3
  # DSH Vision Toolkit
4
4
 
5
5
  [![X (Twitter)](https://img.shields.io/badge/-@anion__ex-000000?style=flat-square&logo=x&logoColor=white)](https://x.com/anion_ex)
6
- [![Release v0.1.4](https://img.shields.io/badge/release-v0.1.4-5B4CF0?style=flat-square)](https://github.com/Anionex/dsh-vision-toolkit/releases/tag/v0.1.4)
7
- [![Verified: 136 tests](https://img.shields.io/badge/verified-136%20tests-2EA44F?style=flat-square)](tests)
6
+ [![Release v0.1.6](https://img.shields.io/badge/release-v0.1.6-5B4CF0?style=flat-square)](https://github.com/Anionex/dsh-vision-toolkit/releases/tag/v0.1.6)
7
+ [![Verified: 162 tests](https://img.shields.io/badge/verified-162%20tests-2EA44F?style=flat-square)](tests)
8
8
  [![License: MIT](https://img.shields.io/badge/license-MIT-0B7285?style=flat-square)](LICENSE)
9
9
  [![Node.js](https://img.shields.io/badge/Node.js-%5E22.19%20%7C%20%3E%3D24-339933?style=flat-square&logo=nodedotjs&logoColor=white)](package.json)
10
10
  [![Python](https://img.shields.io/badge/Python-3.11%2B-3776AB?style=flat-square&logo=python&logoColor=white)](runtime/requirements.lock)
@@ -120,7 +120,7 @@ flowchart LR
120
120
  Artifacts --> Web["Preview, download, or open file"]
121
121
  ```
122
122
 
123
- 所有工具定义都调用同一个 Runtime;Runtime 在分发到固定上游快照或已配置的 OpenAI 兼容视觉端点前,统一验证路径、限制、Credential、取消和超时。Web 展示读取相同的结构化结果与产物描述,因此不会改变 Headless 语义。健康、连接测试和版本检查只留在 Settings,不进入模型工具 schema。
123
+ 所有工具定义都调用同一个 Runtime;Runtime 在分发到固定上游快照或已配置的视觉提供方端点前,统一验证路径、限制、Credential、取消和超时。Web 展示读取相同的结构化结果与产物描述,因此不会改变 Headless 语义。健康、连接测试和版本检查只留在 Settings,不进入模型工具 schema。
124
124
 
125
125
  ## 工具
126
126
 
@@ -150,7 +150,7 @@ flowchart LR
150
150
  - 启用 Web 或 Headless Profile 的 DeepSeek Harness,并确保 `dsh plugin` 可以使用 `pnpm`。
151
151
  - Python 3.11 或更高版本。Managed 模式会创建隔离环境,用户无需手工安装上游 CLI(命令行界面)或 Python 包。
152
152
  - 首次启用 managed 运行时需要联网;如果配置的软件包缓存已有 `runtime/requirements.lock` 中的精确版本,则无需联网。
153
- - `vision_glance`、`vision_ground`、`vision_detect` 和非仅切分长截图 OCR 需要 OpenAI 兼容视觉端点及 DSH Credential。本地工具无需该 Credential 也可使用。
153
+ - `vision_glance`、`vision_ground`、`vision_detect` 和非仅切分长截图 OCR 需要 OpenAI 兼容或 Anthropic 视觉端点及 DSH Credential。本地工具无需该 Credential 也可使用。
154
154
  - 只有 `vision_html_screenshot` 需要 Chrome、Chromium 或 Edge;未安装受支持浏览器时,其他工具保持可用。
155
155
  - 输入必须是会话工作区或显式 `allowedDirs` 根目录内的 PNG、JPEG、GIF 或 WebP。
156
156
 
@@ -184,6 +184,15 @@ dsh --profile headless --dump-config | grep vision-toolkit
184
184
 
185
185
  ### 升级
186
186
 
187
+ **从已停用的 `@dsh-external/dsh-vision-toolkit` 迁移:** npm 包现在位于 `@anionex` 作用域。如果你安装的是已停用的旧包,**不要**对它执行 `update`——该账号无法发布本版本。请迁移到新包名并重启 Web Profile:
188
+
189
+ ```sh
190
+ dsh plugin --profile web remove @dsh-external/dsh-vision-toolkit
191
+ dsh plugin --profile web add @anionex/dsh-vision-toolkit
192
+ ```
193
+
194
+ 重启后,Settings → 视觉工具 应显示插件版本 **0.1.6**。
195
+
187
196
  通过注册表安装时,使用 Profile 的包管理命令更新依赖:
188
197
 
189
198
  ```sh
@@ -213,6 +222,9 @@ Bundle 默认使用 managed 运行时。Profile patch 可以覆盖提供方与
213
222
  baseUrl: https://api.inferera.com/v1
214
223
  credential: VISION_API_KEY
215
224
  model: gemini-3.6-flash
225
+ protocol: openai
226
+ anthropicThinking: omit
227
+ userAgent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/126.0.0.0 Safari/537.36
216
228
  language: zh
217
229
  timeoutMs: 60000
218
230
  maxImageBytes: 10485760
@@ -227,9 +239,12 @@ Bundle 默认使用 managed 运行时。Profile patch 可以覆盖提供方与
227
239
 
228
240
  | 字段 | 默认值 | 契约 |
229
241
  |---|---|---|
230
- | `provider.baseUrl` | `https://api.inferera.com/v1` | OpenAI 兼容基础 URL;去除结尾斜杠后使用 |
242
+ | `provider.baseUrl` | `https://api.inferera.com/v1` | 提供方 API 基础 URL;去除结尾斜杠后使用。Anthropic 应填写以 `/v1` 结尾的基础 URL,不要填写完整 `/messages` URL |
231
243
  | `provider.credential` | `VISION_API_KEY` | DSH Credential 引用,不是密钥值 |
232
244
  | `provider.model` | `gemini-3.6-flash` | 远程工具使用的多模态模型名 |
245
+ | `provider.protocol` | `openai` | `openai` 发送 Chat Completions 请求;`anthropic` 发送原生 Messages 请求 |
246
+ | `provider.anthropicThinking` | `omit` | Anthropic thinking 字段。`omit` 不发送 thinking 字段,兼容性最好;仅当所选模型明确支持时使用 `disabled` 或 `adaptive`,提供方返回 HTTP 400 时应先恢复 `omit`。 |
247
+ | `provider.userAgent` | 浏览器兼容默认值 | 视觉请求和显式连接测试发送的 User-Agent;可为提供方或代理兼容性覆盖 |
233
248
  | `language` | `zh` | 视觉输出语言:`zh` 或 `en` |
234
249
  | `timeoutMs` | `60000` | 完整操作截止时间,1000-600000 毫秒;每个工具可请求更窄的覆盖值 |
235
250
  | `maxImageBytes` | `10485760` | 每张输入图片的编码字节上限 |
@@ -265,15 +280,15 @@ External 模式用于开发或受控部署:
265
280
  python: python3.12
266
281
  ```
267
282
 
268
- 该路径必须是与打包 manifest 一致的导出副本,或 commit `c27d1a300962b553c0884993c575cd3e819465ce` 的干净 Git checkout 根目录。插件拒绝已修改的 tracked 文件和 untracked 文件,因为它们可能改变或遮蔽固定 Python 行为。
283
+ 该路径必须是与打包 manifest 一致的导出副本,或 commit `bc9803d7d6300c864d17460ecbb33540b26638e0` 的干净 Git checkout 根目录。插件拒绝已修改的 tracked 文件和 untracked 文件,因为它们可能改变或遮蔽固定 Python 行为。
269
284
 
270
285
  ## Web Settings
271
286
 
272
- Web Profile 会注册 Vision Toolkit Settings 分区,可配置提供方 URL、Credential 引用、模型、语言、超时、字节/像素限制、并发数、运行时模式、Python 覆盖值、external 源码路径和允许目录。该页面还会显示插件/上游版本、当前运行时 generation、不含密钥的 Credential configured/source/writable 状态、运行时路径、健康检查结果和产物路由可用性。
287
+ Web Profile 会注册 Vision Toolkit Settings 分区,可配置提供方 URL、Credential 引用、模型、OpenAI/Anthropic 协议、Anthropic thinking 模式、User-Agent、语言、超时、字节/像素限制、并发数、运行时模式、Python 覆盖值、external 源码路径和允许目录。该页面还会显示插件/上游版本、当前运行时 generation、不含密钥的 Credential configured/source/writable 状态、运行时路径、健康检查结果和产物路由可用性。
273
288
 
274
289
  “保存并应用”会验证完整配置,准备候选 Python/上游运行时,提交 Settings revision,最后才原子切换 generation。候选被拒绝时,之前的 generation 继续服务,页面也会把这种状态与运行时确实不可用区分开来。“重新加载”始终恢复后端已保存的权威值,即使 revision 没有变化也会丢弃被拒绝的浏览器草稿。初始启动无法准备运行时时,Settings 路由仍可用于提交有效配置并激活首个 generation。陈旧浏览器 revision 不会覆盖较新的保存结果,而是返回冲突;刷新后再重试。只读 Settings 提供方允许查看和健康检查,但禁用保存。
275
290
 
276
- “运行健康检查”只执行本地检查。“测试连接”是显式操作,会把已配置 Credential 发送到 `GET /models`;它不会上传图片,也不会创建 completion。插件加载和普通 Settings 读取不会发送该请求。
291
+ “运行健康检查”只执行本地检查。“测试连接”是显式操作,会把已配置 Credential 发送到 `GET /models`;OpenAI 使用 Bearer 认证,Anthropic 使用 `x-api-key` 与 `anthropic-version`。该检查不会上传图片,也不会创建 completion。插件加载和普通 Settings 读取不会发送该请求。
277
292
 
278
293
  健康检查、连接测试以及插件/上游版本检查属于 Web Settings 管理能力,而不是模型工具,因此其 schema 永远不会占用 agent 请求上下文。
279
294
 
Binary file
@@ -58,7 +58,7 @@ This reference maps the DSH Vision Toolkit product brief's committed P0/P1 requi
58
58
  | Scope | Status | Decision |
59
59
  |---|---|---|
60
60
  | P2 stable `ctx.visionToolkit` service and capability discovery | **Deferred by design** | The product brief requires at least one independent plugin consumer before stabilizing this API. `VisionToolkitRuntime` remains package-internal, so P0/P1 can evolve without creating a false compatibility promise. |
61
- | P2 provider ecosystem | **Deferred by design** | The package supports its pinned upstream and one configured OpenAI-compatible vision endpoint; it does not prebuild an unused provider registry. |
61
+ | P2 provider ecosystem | **Deferred by design** | The package supports its pinned upstream and one configured endpoint through OpenAI Chat Completions or Anthropic Messages; it does not prebuild an unused provider registry. |
62
62
  | P3 exploratory inputs and automation | **Out of scope** | Upload/drag-and-drop, camera/video/audio/document ingestion, interactive annotations, automatic clicking, remote clusters, model routing/voting, and cross-session caches are not part of this release contract. |
63
63
 
64
64
  ## Reproducible verification
@@ -58,7 +58,7 @@
58
58
  | 范围 | 状态 | 决策 |
59
59
  |---|---|---|
60
60
  | P2 稳定 `ctx.visionToolkit` 服务与能力发现 | **按设计推迟** | 产品需求要求至少一个独立插件消费方出现后再稳定该 API。`VisionToolkitRuntime` 保持包内部使用,使 P0/P1 可以继续演进,而不会制造虚假的兼容性承诺。 |
61
- | P2 提供方生态 | **按设计推迟** | 本包支持固定上游和一个已配置的 OpenAI 兼容视觉端点;不会预先构建无人使用的提供方注册表。 |
61
+ | P2 提供方生态 | **按设计推迟** | 本包支持固定上游,并通过 OpenAI Chat Completions 或 Anthropic Messages 使用一个已配置端点;不会预先构建无人使用的提供方注册表。 |
62
62
  | P3 探索性输入与自动化 | **范围外** | 上传/拖拽、摄像头/视频/音频/文档输入、交互式标注、自动点击、远程集群、模型路由/投票和跨 Session 缓存不属于本版本契约。 |
63
63
 
64
64
  ## 可复现验证