dsh-tool-vision 0.9.2 → 0.9.4
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/LICENSE +23 -23
- package/README.md +36 -8
- package/README.zh.md +346 -326
- package/cordis.patch.yml +8 -8
- package/index.js +1507 -1453
- package/lib/model-probe.js +274 -274
- package/lib/session-header.js +57 -57
- package/lib/vision-tools.js +2485 -2485
- package/package.json +4 -3
package/LICENSE
CHANGED
|
@@ -1,23 +1,23 @@
|
|
|
1
|
-
MIT License
|
|
2
|
-
|
|
3
|
-
Copyright (c) 2026 Scorp1o117
|
|
4
|
-
Bridge image preview contributed by xing666173 (dsh-bridge-preview),
|
|
5
|
-
Copyright (c) 2026 xing666173
|
|
6
|
-
|
|
7
|
-
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
8
|
-
of this software and associated documentation files (the "Software"), to deal
|
|
9
|
-
in the Software without restriction, including without limitation the rights
|
|
10
|
-
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
11
|
-
copies of the Software, and to permit persons to whom the Software is
|
|
12
|
-
furnished to do so, subject to the following conditions:
|
|
13
|
-
|
|
14
|
-
The above copyright notice and this permission notice shall be included in all
|
|
15
|
-
copies or substantial portions of the Software.
|
|
16
|
-
|
|
17
|
-
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
18
|
-
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
19
|
-
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
20
|
-
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
21
|
-
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
22
|
-
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
23
|
-
SOFTWARE.
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Scorp1o117
|
|
4
|
+
Bridge image preview contributed by xing666173 (dsh-bridge-preview),
|
|
5
|
+
Copyright (c) 2026 xing666173
|
|
6
|
+
|
|
7
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
8
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
9
|
+
in the Software without restriction, including without limitation the rights
|
|
10
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
11
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
12
|
+
furnished to do so, subject to the following conditions:
|
|
13
|
+
|
|
14
|
+
The above copyright notice and this permission notice shall be included in all
|
|
15
|
+
copies or substantial portions of the Software.
|
|
16
|
+
|
|
17
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
18
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
19
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
20
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
21
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
22
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
23
|
+
SOFTWARE.
|
package/README.md
CHANGED
|
@@ -42,13 +42,16 @@ bridge keeps its conversion inside that durable path:
|
|
|
42
42
|
key lives in `settings.yaml`, not the profile patch. Mount by package name
|
|
43
43
|
(`name: 'dsh-tool-vision'`) so the web client bundle is discovered.
|
|
44
44
|
|
|
45
|
-
## Compatibility (v0.9.
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
`
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
45
|
+
## Compatibility (v0.9.4)
|
|
46
|
+
|
|
47
|
+
DSH `0.1.5-rc.3` is the current npm `latest` and `next`. Alpha releases remain
|
|
48
|
+
`unknown` until tested.
|
|
49
|
+
|
|
50
|
+
## v0.9.4: Windows bridge export filenames
|
|
51
|
+
|
|
52
|
+
- Export filenames now derive from a stable hash of the complete attachment ID. IDs such as `sha256:...` no longer create NTFS alternate data streams and zero-byte visible files.
|
|
53
|
+
- The export directory is created before writing; the in-process cache now respects changes to `bridgeExportDir`.
|
|
54
|
+
- Passed install, Web boot, homepage and client-bundle HTTP checks, and uninstall in a disposable DSH `0.1.5-rc.3` Profile.
|
|
52
55
|
|
|
53
56
|
## Install
|
|
54
57
|
|
|
@@ -85,7 +88,7 @@ Or load it from a local path without npm:
|
|
|
85
88
|
| `maxImageBytes` | `10MB` | Largest accepted local image. |
|
|
86
89
|
| `description` | default | Tool description shown to the model. |
|
|
87
90
|
| `bridgeTextOnly` | `true` | Bridge pasted images to text hints on models that cannot see images. |
|
|
88
|
-
| `bridgeExportDir` | temp | Export dir for bridged images (`os.tmpdir()/dsh-vision-bridge`). |
|
|
91
|
+
| `bridgeExportDir` | temp | Export dir for bridged images (`os.tmpdir()/dsh-vision-bridge`). Filenames use a portable hash of the attachment ID. |
|
|
89
92
|
| `multimodalModels` | `[]` | Model list (comma-separated). Each entry is matched case-insensitively against the full id, its bare id after the last `/`, and `provider/id`, with `*` / `?` globs (`*vl*`, `deepseek/*`). What the list *means* is set by the mode below. |
|
|
90
93
|
| `multimodalListMode` | `whitelist` | **List mode (v0.9.0).** `whitelist`: listed models receive image blocks directly (the historical behaviour). `blacklist`: listed models are forced through the bridge — the correction layer for a model that claims image support it does not have. `off`: the list is ignored. An unknown value falls back to `whitelist`. |
|
|
91
94
|
| `autoDetectMultimodal` | `true` | **Auto-detect (v0.9.0).** Decide from the current route's own declared `inputModalities`, then combine with the list (whitelist unions, blacklist subtracts). On by default: a text-only route is bridged, a multimodal one is treated like a whitelist member and gets images directly. The declaration is always read *before* this plugin's admission wrap, so `bridgeAutoImage` can never feed its own claim back in as evidence. Set false for the hand-maintained "list only" behaviour. |
|
|
@@ -382,6 +385,31 @@ the panel's picker carries a badge:
|
|
|
382
385
|
> A route on an unknown protocol (e.g. `openai-responses`) returns `unknown`
|
|
383
386
|
> with a reason, rather than guessing confidently with `chat/completions`.
|
|
384
387
|
|
|
388
|
+
## v0.9.3: adapter snapshot model admission (pi-ai guard)
|
|
389
|
+
|
|
390
|
+
**The bug.** `v0.9.2`'s `installDispatchImageAdmission` satisfied DSH core's
|
|
391
|
+
`LlmService.generate` by declaring `image` on `adapterCall.model.inputModalities`.
|
|
392
|
+
However, `dsh-llm-pi-ai`'s adapter executes a second internal guard inside its
|
|
393
|
+
streaming path (`streamWithSnapshot`):
|
|
394
|
+
|
|
395
|
+
```js
|
|
396
|
+
const model = this.modelOf(snapshot, options.provider, options.model);
|
|
397
|
+
if (containsImage && !model.input.includes("image"))
|
|
398
|
+
throw new LlmError(`pi-ai model "${model.id}" does not support image input`, "UNSUPPORTED_CONTENT");
|
|
399
|
+
```
|
|
400
|
+
|
|
401
|
+
`this.modelOf` resolves from the adapter's own `snapshot.models` catalog, which
|
|
402
|
+
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
|
+
reached `streamWithSnapshot` and triggered `UNSUPPORTED_CONTENT`. Since the image
|
|
405
|
+
was already in the session's durable transcript, every subsequent turn failed.
|
|
406
|
+
|
|
407
|
+
**The fix.** On direct routes, `installDispatchImageAdmission` now additionally:
|
|
408
|
+
1. Wraps `adapter.modelOf` (when present) to include `"image"` in `resolved.input`;
|
|
409
|
+
2. Enriches the live snapshot model (`snapshot.models.getModel(route, model).input`)
|
|
410
|
+
with `"image"`;
|
|
411
|
+
3. Fully restores `adapter.modelOf` and reverts modified input arrays upon dispose.
|
|
412
|
+
|
|
385
413
|
## v0.9.2: admission is not dispatch
|
|
386
414
|
|
|
387
415
|
**The bug.** Every capability signal this plugin collects — `probeResults`,
|