dsh-vision-router 3.0.3 → 3.0.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 +183 -162
- package/README.zh.md +179 -158
- package/cordis.patch.yml +14 -10
- package/docs/architecture/dsh-0.2.1-alpha.2-compat.md +41 -0
- package/docs/development/dsh-alpha3-compatibility.md +36 -0
- package/docs/development/dsh-alpha4-adaptation.md +12 -0
- package/docs/development/dsh-alpha4-validation-evidence.md +29 -0
- package/docs/development/dsh-alpha5-adaptation.md +31 -0
- package/docs/development/dsh-rc1-adaptation.md +29 -0
- package/docs/development/dsh-rc2-adaptation.md +24 -0
- package/docs/development/v305-real-scenario-acceptance.md +34 -0
- package/docs/development/web-live-reload.md +157 -0
- package/docs/releases/v3.0.4.md +18 -0
- package/docs/releases/v3.0.5.md +31 -0
- package/docs/remote-settings.md +4 -0
- package/docs/v2-capability-routing.md +25 -9
- package/lib/adapter-update-coalescer.js +41 -8
- package/lib/client-presentation-boundary-main.js +41 -7
- package/lib/client.js +27 -23
- package/lib/core-primitives.js +6 -2
- package/lib/http-compat.js +33 -2
- package/lib/maintenance-routes.js +7 -1
- package/lib/session-message-source-compat.js +13 -4
- package/lib/sharp-runtime.js +0 -2
- package/lib/vision-backend-runtime-policy.js +3 -3
- package/lib/vision-background-benchmark.js +33 -5
- package/lib/vision-capability-benchmark-service.js +61 -23
- package/lib/vision-evidence-guidance.js +7 -1
- package/lib/vision-exact-check-client.js +24 -6
- package/lib/vision-image-input-verdict.js +5 -3
- package/lib/vision-toggle-root-hardening.js +20 -3
- package/lib/web-capability-boundary.js +164 -31
- package/package.json +6 -4
- package/presets/web-connection-ready/index.mjs +48 -0
- package/presets/web-connection-ready/package.json +6 -0
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
# DSH 0.2.1-alpha.4 validation evidence
|
|
2
|
+
|
|
3
|
+
**Channel:** alpha/pre-release only. npm `latest` and `next`: `0.2.0-rc.2`; npm `alpha`: `0.2.1-alpha.4`.
|
|
4
|
+
|
|
5
|
+
**Exact source:** `dsh-v0.2.1-alpha.4` = `86a402200d95fecef4529d969836f1fe13c6cb0d`; previous alpha.3 = `2fbf4359b82fb94c03dcce0b831660d87f12ea5c`. npm publication 2026-10-15 13:08:08 UTC; GitHub release 2026-10-15 13:40:02 UTC. Upstream pnpm 11.28.5.
|
|
6
|
+
|
|
7
|
+
## Compatibility audit
|
|
8
|
+
|
|
9
|
+
- **Plugin admission:** Host now prioritizes `engines.dsh`, falling back to `@deepseek-ai/dsh-*` peer ranges. DVR declares both with the same support window and tests legacy `peers` and newer `requirements` refusal shapes. Public minimum remains `0.1.5-rc.1` for the 0.1.x train and `0.2.0-rc.2` for 0.2.x.
|
|
10
|
+
- **Host, Session, Settings, attachment:** Exact upstream source blobs for core Session, SessionController, SettingsController, and local attachment index are unchanged from alpha.3. Existing exact Host-Sharp and session v4 admission contracts passed on alpha.4.
|
|
11
|
+
- **Web/client/bundle:** New client module release-change and HMR logic, remotes events, plugin-market registration and Web bundle patches require real Chromium and bundle lifecycle checks. Three bundle recomposes passed with stable DVR routes.
|
|
12
|
+
- **Model:** Custom model reasoning-level UI changed. Existing LLM index source blob is unchanged; adapter imageRequestTarget compatibility from alpha.3 is retained.
|
|
13
|
+
- **Service injection:** Exact Connection source still requires `webStartup`; the DVR readiness shim remains required, without Host-global patching.
|
|
14
|
+
|
|
15
|
+
## Local macOS evidence (Node 24.5.0)
|
|
16
|
+
|
|
17
|
+
- DVR build/build:check: PASS. Focused manifest/Host tests: 89/89 PASS.
|
|
18
|
+
- DVR full test command: 1,773 + 28 + 41 PASS, 1 platform skip, zero failures.
|
|
19
|
+
- Exact alpha.4 DSH workspace install and full build: 9/9 build gates PASS.
|
|
20
|
+
- Exact source + Host Sharp contract: PASS; peer admission: PASS; Connection trust-generation overlay: PASS; proxy egress: PASS.
|
|
21
|
+
- Real Web+Chromium Settings mount/save/reload/readback: PASS (`vision-router`, one save, reload, two reads).
|
|
22
|
+
- Bundle recompose: 3/3 PASS, process and DVR route stable.
|
|
23
|
+
|
|
24
|
+
## Outstanding validation
|
|
25
|
+
|
|
26
|
+
- macOS cold Vision fixture did not reach the native workspace picker (`Select Workspace Directory` timeout). This is a fixture/platform limitation, not a successful Vision test; Linux Chromium remains mandatory.
|
|
27
|
+
- macOS Desktop renderer could not launch because Electron binary download failed; no Desktop pass is claimed.
|
|
28
|
+
- Mixed attachment lifecycle and Node 22, Windows/Linux exact Host-Sharp, and adversarial CI remain pending.
|
|
29
|
+
- No PR CI was run at the time of this note. Do not merge or publish on this evidence alone.
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
# DeepSeek Harness 0.2.1-alpha.5 exact-source adaptation
|
|
2
|
+
|
|
3
|
+
- **Channel:** alpha/pre-release only; do not treat as stable or next/rc.
|
|
4
|
+
- **Upstream tag / immutable commit:** `dsh-v0.2.1-alpha.5` / `1517a4dbca0a2789ff1d41ba439600f8547d23fa`.
|
|
5
|
+
- **Published release:** 2026-10-16 12:23:28 UTC (2026-10-16 20:23:28 China time).
|
|
6
|
+
- **Comparison baseline:** `dsh-v0.2.1-alpha.4` / `86a402200d95fecef4529d969836f1fe13c6cb0d`.
|
|
7
|
+
- **Host pnpm:** 11.28.5; DVR package manager and support windows remain unchanged.
|
|
8
|
+
|
|
9
|
+
## Compatibility review
|
|
10
|
+
|
|
11
|
+
| Area | Alpha.5 change / contract to protect | Gate |
|
|
12
|
+
| --- | --- | --- |
|
|
13
|
+
| Host and plugin admission | No evidence requiring an admission-window bump; retain both `engines.dsh` and legacy DSH peers from alpha.4, minimum `0.1.5-rc.1` (0.1 train) and `0.2.0-rc.2` (0.2 train). | Exact evaluator admission/refusal, previous Host matrix |
|
|
14
|
+
| Session and attachment | Session v4 producer-owned source, post-commit session/event ordering, exact Host Sharp normalization and mixed image/file attachment ingestion must remain valid. | Exact source/Host-Sharp, adversarial/contract, real Chromium mixed attachment |
|
|
15
|
+
| Settings | Preserve Host-owned Settings mount/save/reload/readback and real on-disk persistence. | Real Web+Chromium Settings lifecycle |
|
|
16
|
+
| Model / composer | New session-scoped `conversation.input.model.label` Slot is inline and non-interactive; existing `conversation.input.model` selection and DVR's `conversation.input.right` Vision toggle must coexist. | Exact Slot/renderer assertions + real cold/reload Vision |
|
|
17
|
+
| Web and client | Skill cache now invalidates on `plugin-manager/changed`; account notice/UI layout changes must not disturb client attachment or Vision lifecycle. | Exact invalidation assertion + real Web/Chromium |
|
|
18
|
+
| Terminal | New cached session-owned terminal inventory; ensure unrelated Vision/Settings interactions survive terminal sidebar changes. | Exact source inventory smoke + Chromium |
|
|
19
|
+
| Bundle | Preserve DVR route registration and stable recompose behavior. | Three consecutive bundle recomposes |
|
|
20
|
+
| Service injection | Retain the bounded `webStartup` readiness shim where required; no Host-global monkeypatch or opportunistic injected service widening. | Web Connection overlay and Desktop Host injection |
|
|
21
|
+
|
|
22
|
+
This change **only advances the alpha exact-source gate** and adds focused upstream assertions. It does not declare alpha.5 verified before final-head CI passes, does not change stable/next pins, and does not publish a DVR release.
|
|
23
|
+
|
|
24
|
+
## Required acceptance evidence (not yet green at branch creation)
|
|
25
|
+
|
|
26
|
+
- Node 22 and Node 24, Linux/macOS/Windows exact source and Host-Sharp.
|
|
27
|
+
- Native Windows Desktop Node 22/24 and macOS Desktop renderer (subject to Electron availability).
|
|
28
|
+
- Real DSH Web + Chromium: cold Vision, mixed attachments, Settings mount/save/reload/readback, three bundle recomposes, Desktop service injection.
|
|
29
|
+
- Existing DSH support-window, contract, and adversarial/security checks.
|
|
30
|
+
|
|
31
|
+
Investigate CI failures at their actual owners, repair root causes only, rerun on the final head, and leave the PR draft until green. Do not use workflow_dispatch as a substitute for PR CI or require Copilot review.
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
# DeepSeek Harness 0.2.1-rc.1 next-channel compatibility qualification
|
|
2
|
+
|
|
3
|
+
- **Channel:** `next` / RC; not stable or alpha. The alpha.5 and historical 0.2.0-rc.2 lanes remain independent.
|
|
4
|
+
- **Upstream immutable tag / commit:** `dsh-v0.2.1-rc.1` / `1600d8a1e140dcde43a1a0941940a0480712c011`.
|
|
5
|
+
- **GitHub Release:** 2026-10-17 05:22:10 UTC (13:22:10 China time).
|
|
6
|
+
- **Baseline:** `dsh-v0.2.1-alpha.5` / `1517a4dbca0a2789ff1d41ba439600f8547d23fa`.
|
|
7
|
+
- **Source toolchain:** `pnpm@11.28.5` and Node 22.19.0 or 24.x per published upstream manifest.
|
|
8
|
+
- **Upstream delta:** four commits, including the 0.2.1-rc.1 release and vendor-release merges. Observed changed manifests advance the internal DSH release train and vendor libraries (Cordis 4.0.5, Schemastery 3.18.5, Cosmokit 1.8.6, etc.). Do not confuse a manifest-only change with proof that runtime composition cannot change; use real Host gates below.
|
|
9
|
+
|
|
10
|
+
## Compatibility review and contracts
|
|
11
|
+
|
|
12
|
+
| Area | RC1 risk/contract | Verification |
|
|
13
|
+
| --- | --- | --- |
|
|
14
|
+
| Host and admission | Preserve published `engines.dsh` and legacy peer support range `>=0.1.5-rc.1 <0.2.0-0 \|\| >=0.2.0-rc.2 <0.3.0-0`. New RC1 must be admissible without changing the lower bound. | Exact DSH plugin compatibility evaluator, old Host matrix |
|
|
15
|
+
| Session | Existing producer-owned Session v4 and event ordering; no package-version substitution for durable Session checks. | Exact source contracts, Desktop Host, adversarial regressions |
|
|
16
|
+
| Settings | Preserve Host-owned Settings mount, save, reload, and readback. | Real DSH Web + Chromium lifecycle |
|
|
17
|
+
| Bundle | Cordis/vendor version upgrades could affect injection and recompose even when DVR code is unchanged. | Three consecutive bundle recomposes, original historical validation lane unchanged |
|
|
18
|
+
| Web/client | Model label slot, skill-cache invalidation and terminal inventory from alpha.5 must remain present. | Exact source assertions plus live cold Vision toggle and renderer |
|
|
19
|
+
| Model and attachments | Preserve Host-owned Sharp canonical dimensions, native-image noninterference, clipboard/mixed image-file handling and model selection. | Windows/macOS/Linux exact-source, real Chromium mixed attachments and Vision |
|
|
20
|
+
| Service injection | Preserve bounded webStartup compatibility overlay, module/connection webServer seams, and Desktop injection boundaries. | Real Desktop injection, web overlay contracts, multi-plugin ordering |
|
|
21
|
+
|
|
22
|
+
## CI and evidence policy
|
|
23
|
+
|
|
24
|
+
- Dedicated `.github/workflows/dsh-021-rc1-validation.yml` runs on ordinary PR changes against the immutable upstream SHA, with the RC1 pnpm toolchain.
|
|
25
|
+
- Exact-source and Host-Sharp on Linux/macOS/Windows, native Windows Desktop Node 22/24, macOS Desktop, and Linux real DSH Web+Chromium are blocking evidence points.
|
|
26
|
+
- The existing stable 0.2.0-rc.2 and alpha.5 workflows remain intact and must not be replaced or mislabeled as RC1 coverage.
|
|
27
|
+
- Node 22/24 unit, package, security, adversarial, and contract regressions remain required on the PR's actual head. No workflow_dispatch substitute for PR CI.
|
|
28
|
+
- **Status:** creating the gate and the extra RC1 exact-source assertions is *not* a passing validation. Inspect the PR jobs and repair their actual root causes before marking the adapter qualified.
|
|
29
|
+
- No DVR npm package publication, GitHub release, support floor change, Host-global monkeypatch, or Copilot review requirement.
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
# DeepSeek Harness 0.2.1-rc.2 next-channel compatibility qualification
|
|
2
|
+
|
|
3
|
+
- **Channel:** `next` / RC; independent of stable and alpha. Do not conflate with historical DSH `0.2.0-rc.2`.
|
|
4
|
+
- **Upstream immutable release commit:** `687f282e8625c6b8d11ff58211a90524be2e4317` (`dsh-v0.2.1-rc.2`).
|
|
5
|
+
- **Released:** 2026-10-17 08:16:33 UTC (16:16:33 China Standard Time).
|
|
6
|
+
- **Previous qualified next baseline:** `dsh-v0.2.1-rc.1`, `1600d8a1e140dcde43a1a0941940a0480712c011`.
|
|
7
|
+
- **Known upstream changes to review:** new DeepSeek-V4.1-Flash-1017 model identifier; optional DeepSeek Search/Fetch API; Web service wiring, Settings namespaces and bundle composition. New functionality does not imply DVR runtime compatibility without independent Host and browser evidence.
|
|
8
|
+
|
|
9
|
+
## Compatibility review
|
|
10
|
+
|
|
11
|
+
| Area | Primary RC2 concern | Evidence required |
|
|
12
|
+
| --- | --- | --- |
|
|
13
|
+
| Host and peer admission | Do not raise public minimum Host range (including legacy `>=0.1.5-rc.1 <0.2.0-0 \|\| >=0.2.0-rc.2 <0.3.0-0`) | Official Host peer evaluator and historical lanes |
|
|
14
|
+
| Session | Existing Session lifecycle, ownership, event ordering and cross-version persistence | Exact source contract, real Host and adversarial/contract regression |
|
|
15
|
+
| Settings | New Search/Fetch namespaces must not displace DVR Settings mount/save/reload/readback | Real DSH Web + Chromium lifecycle |
|
|
16
|
+
| Bundle and web/client | Search/Fetch module additions must coexist with DVR overlays and Vision slots | Three bundle recomposes, cold Vision toggle and client checks |
|
|
17
|
+
| Model and attachments | New Flash model label and attachment pathways must retain image handling | Host-Sharp, mixed attachments and native-image regression |
|
|
18
|
+
| Service injection | Search/Fetch injection must not interfere with DVR bounded overlay, webServer and Desktop injection | Host injection / multi-plugin ordering on actual RC2 |
|
|
19
|
+
|
|
20
|
+
## Acceptance conditions
|
|
21
|
+
|
|
22
|
+
Create a dedicated `dsh-021-rc2-validation.yml` workflow pinned to the exact upstream SHA. Run it on ordinary `pull_request` CI, with Node 22/24, Linux/macOS/Windows exact-source and Host-Sharp, Windows/macOS Desktop injection/renderer, real DSH Web+Chromium cold Vision, mixed attachments, Settings lifecycle, and three bundle recomposes. Reuse existing exact-source validators, extending assertions only for genuinely new RC2 seams. Preserve all stable/RC1/alpha lanes.
|
|
23
|
+
|
|
24
|
+
**Qualification state:** Pending dedicated RC2 PR CI and real Host evidence. Earlier local upstream build/tests do not qualify DVR against RC2. If the workflow or integration tests reveal failures, repair the underlying cause, commit through the normal PR workflow, and rerun CI before merging. No automatic DVR npm publication or support floor change.
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
# v3.0.5 release-candidate acceptance record
|
|
2
|
+
|
|
3
|
+
Release candidate must be tested on the final PR head, then on the exact main SHA before publishing. Evidence below refers to the merged change PRs; it is not a claim that the future v3.0.5 package has already been installed by a user.
|
|
4
|
+
|
|
5
|
+
| Scenario | Evidence | Scope and verdict |
|
|
6
|
+
| --- | --- | --- |
|
|
7
|
+
| `vision_describe` succeeds and assistant visibly answers (#727) | #731 23/23, #733 22/22, trusted combined #732 23/23 | Actual Desktop automated PNG upload → vision tool execution → final visible assistant reply; canonical tool-result and Session V3/V4 notice attribution preserved. **NOT** a separately installed/published 3.0.5 artifact |
|
|
8
|
+
| Contributor attribution of #728 | Main merge `0fc51c3` / #733; original commit `14c67c7` | Git ancestor/merge-base verified; original GitHub #728 recognized as merged, no squashed/copied authorship |
|
|
9
|
+
| Latest DSH Alpha JSONL CI loader | #730 (Node 22/24 real published-alpha lifecycle) | Canary runner/export compatibility only; no production transport, minimum Host or settings change |
|
|
10
|
+
| Optional peers missing at activation | #722, CI run 39019198833 | Passed isolated actual Node ESM entry-load probe and negative control; not a manual end-user Desktop install |
|
|
11
|
+
| DSH 0.2.1-rc.1 real Host/Web+Chromium | #721, run 39017893115; #723, run 39020741495 | Pinned source, Vision cold toggle, image+text, Settings save/reload/readback, bundle recomposes |
|
|
12
|
+
| DSH 0.2.0-rc.2 compatibility | #723, run 39020741454 | Pinned original Host and Desktop/Chromium cross-platform gates |
|
|
13
|
+
| DSH alpha.5 and legacy 0.1.7 | #723, alpha Settings Host and 0.1.7 real Host smoke | Tested against published pinned source; older support window remains unchanged |
|
|
14
|
+
| Node 22 and 24, packed API | #723, CI run 39020741423 | Passed both Node versions, packed public API and Ubuntu/macOS/Windows Host-Sharp |
|
|
15
|
+
| Official OVH 10 MB JSON request boundary | #723, tests/http-compat.test.js | Passed mocked negative and positive wires; **not** an online request to OVH |
|
|
16
|
+
| billion-context coexistence | Issue #704 | **NOT VERIFIED** in a pinned dual-real-plugin runtime; reporter must identify which package/version |
|
|
17
|
+
| Windows native-disabled click suppression | #735 / Issue #684 closed | **MITIGATED:** bounded cached-pair actionability during catalog loading, with Host authority intact; not a blanket guarantee against all intermittent failures |
|
|
18
|
+
| Windows delivered-click Host RPC failure | Issue #738 / diagnostics #737 | **UNRESOLVED:** a real 0.1.7 Windows Node24 run recorded `gateway/internal` after both clicks arrived. #737 adds only safe error-origin telemetry, with independent exact real-Host CI 6/6 alpha, 5/5 legacy, 7/7 rc.2 |
|
|
19
|
+
| Multi-provider HTTP 400 | Issue #716 | **NOT REPRODUCED**, needs redacted response body; do not claim success |
|
|
20
|
+
|
|
21
|
+
## Acceptance matrix for a final install / upgrade
|
|
22
|
+
|
|
23
|
+
For the final v3.0.5 candidate, record exact OS, Node, DSH, DVR package and git SHA for every row. Protect API keys, image contents and personal profile paths in shared logs.
|
|
24
|
+
|
|
25
|
+
1. **Clean install (isolated profile):** install the actual packed v3.0.5 tarball through the supported DSH plugin mechanism. Ensure the two optional DSH peer modules can be absent; restart the Desktop, confirm Host Connection and Vision settings mount and that no ERR_MODULE_NOT_FOUND occurs.
|
|
26
|
+
2. **Upgrade from v3.0.4:** preserve profile Settings and Session data, change only the plugin package, restart and verify the displayed version and unchanged stored values. Do not delete a live package.json.lock.
|
|
27
|
+
3. **Cold Web + Desktop:** check Vision OFF by default, toggle OFF to ON to OFF once, paste a small PNG alongside text, run a vision tool, open Settings, save/reload/read back and test a second window. Capture button pointer traces if OFF fails; do not simulate retries.
|
|
28
|
+
4. **Payload boundary:** for the exact official OVH HTTPS model, a small PNG should reach the selected mocked or test endpoint unchanged. Oversized aggregate JSON should stop locally with INVALID_REQUEST, no outbound call, and no image content in diagnostics. A non-OVH provider must not inherit OVH's size limit.
|
|
29
|
+
5. **Privacy and ecosystem:** local-only mode must not call an external vision provider; verify remote text model caveat. Co-install with either billion-context package only when its exact package/version and user-reported failure are known; check both plugin load orders and first failure.
|
|
30
|
+
6. **Release supply chain:** pnpm frozen install, reproducible build, source-artifact map, Node 22/24 tests, packed public API, Host support contract and npm version uniqueness must all pass on exact final main commit. Release workflow verifies one tarball, provenance, registry hash and immutable GitHub assets.
|
|
31
|
+
|
|
32
|
+
## Release decision
|
|
33
|
+
|
|
34
|
+
Do not label any unexecuted row green. GitHub Actions real Host + Chromium gates are automated integration tests, **not** a manually observed installation on the user's computer. Release notes must explicitly state that #738 and #716 remain open, and must not turn #684's bounded mitigation or #704's closed disposition into a claim of fully reproduced root-cause repair. The manual trusted release workflow remains an independent action after this candidate PR is accepted.
|
|
@@ -0,0 +1,157 @@
|
|
|
1
|
+
# Web Client development: staged builds, Live Reload and native HMR
|
|
2
|
+
|
|
3
|
+
> **Status (2026-10-12):** The developer-only `pnpm dev:web` workflow,
|
|
4
|
+
> upstream native Web HMR and the fail-closed staged build publisher are
|
|
5
|
+
> merged in `main` (Issues/PRs #697–#700). The production `pnpm build`,
|
|
6
|
+
> released plugin behavior, Host authority and Desktop entry are unchanged.
|
|
7
|
+
|
|
8
|
+
`pnpm dev:web` is an **opt-in developer tool**. It watches the canonical
|
|
9
|
+
`src/` tree and relevant build scripts, checks the generated maintenance
|
|
10
|
+
Client code, builds the same 183 artifacts into an isolated temporary directory,
|
|
11
|
+
verifies the source-to-artifact map **before publication**, and atomically
|
|
12
|
+
publishes the entry files with `lib/client.js` **last**. Builds never overlap.
|
|
13
|
+
A compile/verification failure leaves every previously published artifact
|
|
14
|
+
untouched, preventing upstream DSH's independent Client-HMR stat watcher from
|
|
15
|
+
mistaking an incomplete build for a new revision. Watcher errors do not kill
|
|
16
|
+
future builds. The formal `pnpm build` / release packaging remains unchanged.
|
|
17
|
+
|
|
18
|
+
Start in build-only mode:
|
|
19
|
+
|
|
20
|
+
```sh
|
|
21
|
+
pnpm install --frozen-lockfile
|
|
22
|
+
pnpm dev:web
|
|
23
|
+
```
|
|
24
|
+
|
|
25
|
+
### Optional automatic full-page Web reload
|
|
26
|
+
|
|
27
|
+
Start a **throwaway DSH Web profile** using the plugin entry from the *same*
|
|
28
|
+
checkout (`entry.js` or the appropriate compiled package entry), not a stale
|
|
29
|
+
installed npm tarball. Then, in the checkout's developer terminal:
|
|
30
|
+
|
|
31
|
+
```sh
|
|
32
|
+
export DVR_DEV_WEB_URL='http://127.0.0.1:PORT/'
|
|
33
|
+
export DVR_DEV_CHROME='/absolute/path/to/Google Chrome'
|
|
34
|
+
pnpm dev:web
|
|
35
|
+
```
|
|
36
|
+
|
|
37
|
+
The script opens a private Chrome window after the first successful build and
|
|
38
|
+
performs a full-page reload after subsequent successful builds. Authenticate
|
|
39
|
+
in that window if DSH asks you to. An isolated DSH token URL can be supplied
|
|
40
|
+
via the environment variable, but **never paste it into a committed script or
|
|
41
|
+
logs**. The program does not print the URL. `DVR_DEV_HEADLESS=1` is available
|
|
42
|
+
for automated smoke tests. Only HTTP loopback addresses are allowed; remote
|
|
43
|
+
web pages, remote debugging ports, and external browser requests are blocked.
|
|
44
|
+
Chrome is controlled through its private CDP stdio pipe, not via a WebSocket
|
|
45
|
+
listener exposed to other users. Stop the watcher with Ctrl+C to close Chrome.
|
|
46
|
+
|
|
47
|
+
In the default **`page` mode** this is full-page Live Reload, not module-level
|
|
48
|
+
HMR: the page and React component state initialize from scratch. The opt-in
|
|
49
|
+
`native-hmr` mode described below instead uses DSH's own Client Modules
|
|
50
|
+
fiber replacement without page navigation; plugin-local React state can still
|
|
51
|
+
reset. Vision Router also has structured `webserver/index-inject` and
|
|
52
|
+
`tapIndex()` script carriers protected by a per-page one-shot registry.
|
|
53
|
+
Native HMR does **not** hot-replace those injected carrier scripts. Do not
|
|
54
|
+
manually re-inject them; restart the isolated Host/fresh page for those
|
|
55
|
+
changes. No production carrier registry, package export, or Host authority
|
|
56
|
+
changes are part of this feature.
|
|
57
|
+
|
|
58
|
+
If `src/lib/client-maintenance-actions.js` changes, the embedded generated
|
|
59
|
+
section in `src/lib/client.js` must be synchronized deliberately by running
|
|
60
|
+
`pnpm client:sync` before the watcher can pass the embedded-source check.
|
|
61
|
+
It is deliberately **not** rewritten by the watcher: an automated source
|
|
62
|
+
rewrite would conceal unreviewed Client changes.
|
|
63
|
+
|
|
64
|
+
**Scope:** Web-only development. Desktop's custom scheme is unverified and
|
|
65
|
+
must not be treated as HMR. Source changes that affect Host runtime services
|
|
66
|
+
or settings require an isolated Host restart; reloading Chrome alone does not
|
|
67
|
+
reload Host modules. Run established Settings and Issue #684 ON→OFF real-Host
|
|
68
|
+
regression gates separately before claiming all-round compatibility.
|
|
69
|
+
|
|
70
|
+
## Choose the development mode
|
|
71
|
+
|
|
72
|
+
| Mode | How to run | Behavior |
|
|
73
|
+
| --- | --- | --- |
|
|
74
|
+
| Build only | `pnpm dev:web` | Rebuild and verify artifacts without launching Chrome |
|
|
75
|
+
| Full-page Web reload | Set `DVR_DEV_WEB_URL` and `DVR_DEV_CHROME` | Refresh private Chrome after successful build (default `page` mode) |
|
|
76
|
+
| Native DSH Web HMR | Same settings plus `DVR_DEV_RELOAD_MODE=native-hmr` | DSH replaces the Client factory without navigating the page |
|
|
77
|
+
|
|
78
|
+
Native mode requires DSH's Web boot HMR plugin and the
|
|
79
|
+
`/plugins/events` SSE endpoint. If unavailable, use
|
|
80
|
+
`DVR_DEV_RELOAD_MODE=page`; the helper will not silently claim native HMR.
|
|
81
|
+
Only HTTP loopback URLs are permitted. Never commit token-bearing URLs.
|
|
82
|
+
|
|
83
|
+
## Upstream native Web HMR (opt-in)
|
|
84
|
+
|
|
85
|
+
DSH 0.2.0-rc.2 already provides its own Web plugin HMR transport:
|
|
86
|
+
`@deepseek-ai/dsh-client-hmr` stat-polls the canonical built `lib/client.js`
|
|
87
|
+
and publishes `rebuilt` events through `/plugins/events`. The browser Client
|
|
88
|
+
Modules controller invalidates and replaces the plugin fiber, with **no page
|
|
89
|
+
navigation**. It is not React Fast Refresh: local component state inside the
|
|
90
|
+
plugin resets, while unrelated Web page/session state survives. Electron's
|
|
91
|
+
Desktop scheme does **not** use this SSE transport.
|
|
92
|
+
|
|
93
|
+
With the isolated DSH Web Host pointing to this checkout's Client artifacts
|
|
94
|
+
and the usual `DVR_DEV_WEB_URL` / `DVR_DEV_CHROME` variables, use:
|
|
95
|
+
|
|
96
|
+
```sh
|
|
97
|
+
export DVR_DEV_RELOAD_MODE=native-hmr
|
|
98
|
+
pnpm dev:web
|
|
99
|
+
```
|
|
100
|
+
|
|
101
|
+
The dev controller probes the HMR row in DSH's boot manifest and an
|
|
102
|
+
HTTP 200 `text/event-stream` response from `/plugins/events`. If either is
|
|
103
|
+
unavailable, it closes private Chrome and reports an error rather than
|
|
104
|
+
pretending to hot-swap the UI. `DVR_DEV_RELOAD_MODE=page` (the default) keeps
|
|
105
|
+
the older full-page fallback.
|
|
106
|
+
|
|
107
|
+
**Important DVR boundary:** native HMR replaces the DSH `dsh.client` factory,
|
|
108
|
+
not the Host-injected `client-script-carrier` bootstrap JS/CSS or server-side
|
|
109
|
+
settings bridges. The latter retain their one-shot per-page fence and may
|
|
110
|
+
need a Host restart and a fresh page to update. Do not claim that changing
|
|
111
|
+
Host-side JS automatically updates those browser carriers. Do not interpret
|
|
112
|
+
HMR as fixing Issue #684's Host selection/recovery bug; that needs its own
|
|
113
|
+
real Desktop ON→OFF evidence.
|
|
114
|
+
|
|
115
|
+
### Why a staged developer build is necessary
|
|
116
|
+
|
|
117
|
+
The production artifact builder removes `lib/`, `entry.js`, and `index.js`
|
|
118
|
+
before compiling to their final paths. That is acceptable for CI/release
|
|
119
|
+
packaging, but **unsafe as a development HMR trigger**: a TypeScript compiler
|
|
120
|
+
failure can leave deleted `.js` outputs and still change the live `client.js`
|
|
121
|
+
file metadata while upstream DSH polls it. The developer watcher instead calls
|
|
122
|
+
`scripts/dev-staged-build.mjs` to compile into a temporary folder under the
|
|
123
|
+
checkout, validates the complete map using
|
|
124
|
+
`verify-source-artifact-map.mjs --artifact-root <stage>`, and publishes files
|
|
125
|
+
with atomic rename operations. The watched Client entry is written last.
|
|
126
|
+
|
|
127
|
+
The verified publication is not a full database transaction; a disk error
|
|
128
|
+
halfway through publishing siblings can still need a clean rebuild/restart.
|
|
129
|
+
No claim is made that Host runtime modules themselves are hot replaced.
|
|
130
|
+
|
|
131
|
+
A real DSH 0.2.0-rc.2/Chrome/Node24 acceptance test covered:
|
|
132
|
+
`src/lib/client.js` A→B through the dev watcher, invalid TypeScript compile
|
|
133
|
+
with old B artifact unchanged, then repair B→C, without any browser navigation
|
|
134
|
+
or unexpected JavaScript exceptions.
|
|
135
|
+
|
|
136
|
+
|
|
137
|
+
## Acceptance summary and deliberate non-goals
|
|
138
|
+
|
|
139
|
+
- Real isolated **DSH 0.2.0-rc.2 / macOS / Chrome / Node 24**: 30
|
|
140
|
+
consecutive plugin Client swaps, one initial page navigation, no
|
|
141
|
+
unexpected JavaScript exceptions during valid swaps, and no growing CSS
|
|
142
|
+
style count in the observed run. A deliberately malformed bundle was
|
|
143
|
+
rejected and later replaced by a working one.
|
|
144
|
+
- Full watcher-to-Host path: source A→B triggered native HMR in about 2.03s;
|
|
145
|
+
a deliberate TypeScript compilation failure left the B artifact and live
|
|
146
|
+
UI unchanged; restoring the source then built and hot-swapped C in about
|
|
147
|
+
2.16s without page navigation.
|
|
148
|
+
- GitHub PR #700: all 16 compatibility/CI workflows passed, including
|
|
149
|
+
Node 22/24 and real DSH Host matrices. These checks do not certify
|
|
150
|
+
Desktop HMR, all future DSH releases, or long-running heap memory safety.
|
|
151
|
+
- **Issue #684 remains a separate runtime problem.** HMR does not
|
|
152
|
+
fix or validate Desktop Vision ON→OFF recovery; its real-Host evidence
|
|
153
|
+
and implementation remain independent. Host-injected scripts and Settings
|
|
154
|
+
bridges are not Client-fiber hot-swapped.
|
|
155
|
+
|
|
156
|
+
No new HMR loader architecture or public plugin release is required for this
|
|
157
|
+
development workflow.
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
# v3.0.4
|
|
2
|
+
|
|
3
|
+
Maintenance and DSH 0.2.1-alpha.5 compatibility-qualification release. No routing-runtime, schema, public-API, or minimum supported Host change.
|
|
4
|
+
|
|
5
|
+
## Upstream qualification
|
|
6
|
+
- Exact upstream DSH 0.2.1-alpha.5 SHA: `1517a4dbca0a2789ff1d41ba439600f8547d23fa`.
|
|
7
|
+
- PR #713 passed Windows/macOS/Linux exact-source and Host-Sharp, Node 22/24, Windows/macOS Desktop, real `dsh web` + Chromium cold Vision, mixed attachments, Settings mount/save/reload/readback, bundle recomposition, service injection, and adversarial/legacy Host contracts.
|
|
8
|
+
- Published Host window stays `>=0.1.5-rc.1 <0.2.0-0 || >=0.2.0-rc.2 <0.3.0-0`.
|
|
9
|
+
|
|
10
|
+
## Supply-chain upkeep
|
|
11
|
+
Consolidates upstream Action pin upgrades from #705–#709: setup-node 7.1.0, upload-artifact 7.0.2, Scorecard 2.5.0, CodeQL upload-sarif 4.38.3 and HOL scanner Action 1.2.786. The exact release-package evidence test is updated along with upload-artifact's pinned version; immutable tarball identity, trusted OIDC and provenance remain required.
|
|
12
|
+
|
|
13
|
+
## RC1 scope and outstanding issues
|
|
14
|
+
DSH 0.2.1-rc.1 has not yet been independently validated: semver admission is not proof of real-Host compatibility. After official release, record exact upstream tag/commit and rerun the full cross-platform source/Host/Chromium/Settings/attachment gate before claiming verified RC1 support.
|
|
15
|
+
|
|
16
|
+
Issues #684 (historical intermittent Windows alpha2 Vision pointer loss), #703 (DSH Plugin Hub Windows package.json.lock writer contention) and #704 (billion-context coexistence requiring reproduction) remain tracked; none is represented as resolved by this maintenance-only package.
|
|
17
|
+
|
|
18
|
+
No user configuration or data migration is required. Publication is a separate gated trusted-release workflow and is not performed by this preparation PR.
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
# v3.0.5 release candidate
|
|
2
|
+
|
|
3
|
+
This is a corrective patch for the existing 3.0.x line, not an announcement that npm has already published it.
|
|
4
|
+
|
|
5
|
+
## Included
|
|
6
|
+
- #727: successful `vision_describe` guidance now uses a source-attributed `notice`, so a synthetic injected context does not terminate the assistant's visible answer. Original contribution from @kevindawn11-hash in #728 (authored commit `14c67c7`, preserved in history by merge #733), paired with Session V3/V4 source-boundary fix #731. The final merged source is `main@0fc51c3` and no npm publication is implied.
|
|
7
|
+
- #730: updated latest-alpha CI to accept DSH JSONL namespace plugin exports in addition to older defaults; the exact published alpha lifecycle passed on Node 22/24. This is CI-only.
|
|
8
|
+
- #721 qualifies DSH 0.2.1-rc.1 at upstream 1600d8a1e140dcde43a1a0941940a0480712c011 with exact source and real Host/Chromium/Settings/attachment CI.
|
|
9
|
+
- #722 fixes #719 by removing two unused imports of optional DSH dependencies, originally contributed by @m4ku1337 in #720. Missing optional peers must not prevent Desktop activation.
|
|
10
|
+
- #723 checks the actual OVHcloud VLM JSON body against its documented 10 MB limit before egress. Only the official OVH endpoint is affected; image content is not silently changed.
|
|
11
|
+
|
|
12
|
+
- #735: keep the Vision toggle clickable across a transient Host model-catalog refresh only when a valid complete source/wrapper pair remains; Host selection authority and all cold/unavailable/selecting gates remain unchanged. This mitigates the independently evidenced native-disabled click-loss case, but does not resolve the separate Host RPC fault tracked in #738.
|
|
13
|
+
- #737: add a privacy-bounded, test-only `gateway/internal` origin classifier for real Desktop evidence. It does not change runtime behavior or repair the intermittent Host failure.
|
|
14
|
+
- #736: improve English/Chinese onboarding and preserve visible cloud-data disclosure; no runtime or dependency changes.
|
|
15
|
+
|
|
16
|
+
## Compatibility
|
|
17
|
+
Node ^22.19.0 or 24+. DSH >=0.1.5-rc.1 <0.2.0-0 or >=0.2.0-rc.2 <0.3.0-0. No settings or session migration, new Host privileges, or API breaking changes.
|
|
18
|
+
|
|
19
|
+
## Qualification
|
|
20
|
+
Each fixing PR passed its final-head CI. #735 passed 98 checks (one conditional skip); #737 passed 33 checks (one conditional skip) plus manually dispatched DSH Alpha / 0.1.7 / 0.2.0-rc.2 exact Host gates (6/6, 5/5, 7/7). These were source and Host qualification tests, **not a clean install or an npm release of the final v3.0.5 tarball**. The candidate version still requires its own Node, packed artifact, real Host and browser verification. For detailed acceptance evidence see docs/development/v305-real-scenario-acceptance.md.
|
|
21
|
+
|
|
22
|
+
## Still open
|
|
23
|
+
- #738 (open): intermittent Windows Node24 Host `gateway/internal` on an **already delivered** Vision OFF selection; #737 adds only diagnostic classification, not a fix.
|
|
24
|
+
- #716 (open): user-reported backend HTTP 400; four small synthetic OVH requests have since returned 200 from the maintainer's machine, but this does not explain the reporter's failures.
|
|
25
|
+
- #726 (open, low priority): TUI-only overlay not-found diagnostic noise; no speculative profile-composition change is included.
|
|
26
|
+
- #684 (closed): catalog-refreshed native click suppression received the bounded #735 mitigation. Its separate Host error class is tracked as #738.
|
|
27
|
+
- #704 (closed / awaiting reproducible evidence): historical billion-context coexistence report; no verified co-installation failure is claimed repaired here.
|
|
28
|
+
- #729 (still a PR): Atlas Cloud preset remains outside this release until the specific models' image-content behavior is verified.
|
|
29
|
+
- #703 (closed): upstream installer writer-lock contention was out of scope, not repaired by DVR.
|
|
30
|
+
|
|
31
|
+
Publication is a separate release gate and is not performed by this preparation PR.
|
package/docs/remote-settings.md
CHANGED
|
@@ -9,3 +9,7 @@ DSH `trustedHosts` protects the browser carrier against Host/Origin/DNS-rebindin
|
|
|
9
9
|
The transport contract differs across supported DSH generations without changing that security model. On the rc.8 Connection contract, Vision Router registers the dedicated channel with the required per-channel `{ authority: 'trusted-host' }` option. Newer Connection contracts expose the carrier-level `requestRejection()` / BrowserAuth fence and `rpc.handle()` no longer accepts a channel authority option; Vision Router feature-detects that carrier and registers with the modern two-argument form. The remote field allow-list and `allowRemoteSettings` gate remain authoritative in both cases.
|
|
10
10
|
|
|
11
11
|
If DSH is behind Nginx, Caddy or another reverse proxy, forward `/vision-router-settings/*` to the same DSH origin in addition to the normal DSH routes. The UI detects a 404 on this channel and shows this requirement directly.
|
|
12
|
+
|
|
13
|
+
**Reverse-proxy security:** Follow the [upstream DSH public deployment contract](https://github.com/deepseek-ai/deepseek-harness/blob/d743267388641bc76f17c45ce8b4c231aed1d32c/docs/user/guide/public-deployments.md): preserve the **browser-facing `Host`** on proxy requests; do **not** rewrite it to `localhost` or `127.0.0.1` when forwarding remote traffic to a loopback DSH listener. DSH Host/Origin checks and its signed browser session authenticate accepted requests, but do **not** attest that a user is physically local. Vision Router grants local-only diagnostics, permission changes and self-update tokens only to requests classified as local. It conservatively treats loopback TCP requests carrying `Forwarded`, `X-Forwarded-*`, `X-Real-IP`, `Via` or common client-IP proxy headers as **remote for local-only actions**, regardless of an apparent localhost `Host`.
|
|
14
|
+
|
|
15
|
+
**Limit:** Forwarding headers can be absent, stripped or forged; they are only negative evidence, **never positive proof of physical-local origin**. An untrusted proxy that rewrites the browser `Host` to localhost and strips all forwarding evidence is indistinguishable from a genuine local browser using the current DSH Host request contract. Do not expose such a topology. Restrict upstream listener access, preserve external `Host`, configure DSH `trustedHosts` explicitly, and keep local-only actions on a direct trusted loopback UI. The broader local-presence attestation gap remains tracked in [Issue #680](https://github.com/ysr666/dsh-vision-router/issues/680).
|
|
@@ -73,13 +73,28 @@ plan, revoked Auto authority, or planner failure falls back to the current
|
|
|
73
73
|
configured order. The temporary Auto order is isolated to one visual-tool call
|
|
74
74
|
with `AsyncLocalStorage` and is restored automatically afterward.
|
|
75
75
|
|
|
76
|
-
Host text-only metadata is advisory for a
|
|
77
|
-
not
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
76
|
+
Host text-only metadata is advisory for *selection* of a generative backend,
|
|
77
|
+
not proof of the endpoint's real image capability. It is not, however, advisory
|
|
78
|
+
to DSH's request projection: an explicit text-only declaration causes DSH to
|
|
79
|
+
replace image pixels with text placeholders before the adapter is invoked.
|
|
80
|
+
Vision Router bypasses that projection only for positively identified HTTP OpenAI
|
|
81
|
+
Chat Completions bridges. For Responses API, WebSocket, RPC and other native protocols, a genuinely
|
|
82
|
+
image-capable model must have Host image input declared; otherwise a visual
|
|
83
|
+
request cannot safely reach its registered adapter. Where available, use
|
|
84
|
+
**Settings → Models → provider editor → Customized settings → Model options →
|
|
85
|
+
Input types → Image**, then save and reload the model configuration. This model
|
|
86
|
+
editor control is documented in DSH
|
|
87
|
+
[0.1.7-rc.1](https://github.com/deepseek-ai/deepseek-harness/blob/dsh-v0.1.7-rc.1/packages/client/ui-settings-models/README.md)
|
|
88
|
+
and [0.2.0-rc.2](https://github.com/deepseek-ai/deepseek-harness/blob/dsh-v0.2.0-rc.2/packages/client/ui-settings-models/README.md).
|
|
89
|
+
For older Hosts without this control, set the provider-specific model field:
|
|
90
|
+
`llm-pi-ai` uses `input: [text, image]`, while `llm-deepseek` uses
|
|
91
|
+
`inputModalities: [text, image]`. Only declare image input for endpoints that
|
|
92
|
+
actually accept image content. Unknown modalities still use the registered
|
|
93
|
+
adapter first. **Test Vision** targets the exact dropdown model,
|
|
94
|
+
but a text-only Host declaration without a safe bridge may yield an image-input
|
|
95
|
+
failure rather than a valid visual measurement. Explicitly authorized background
|
|
96
|
+
benchmarking has the same delivery constraint; only successful pixel-grounded
|
|
97
|
+
measurements count as capability evidence for Auto.
|
|
83
98
|
|
|
84
99
|
Structural non-generative exclusions remain hard boundaries: explicit measurement
|
|
85
100
|
authority never turns an endpoint that cannot be invoked as a generative model
|
|
@@ -101,8 +116,9 @@ Auto-routing control.
|
|
|
101
116
|
requests.
|
|
102
117
|
|
|
103
118
|
A Host text-only label is shown as an advisory, not as a separate product mode.
|
|
104
|
-
Quick/Full Benchmark
|
|
105
|
-
|
|
119
|
+
Quick/Full Benchmark prepares generated test images when the user explicitly
|
|
120
|
+
starts the Benchmark, but delivery still depends on the Host's model modalities
|
|
121
|
+
or a verified compatible bridge. The implementation may carry an
|
|
106
122
|
internal force flag for compatibility with older service guards, but users do
|
|
107
123
|
not need to reason about a separate “Force Verify” workflow.
|
|
108
124
|
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
const wrappedContexts = new WeakMap()
|
|
2
2
|
const wrappedLlmServices = new WeakMap()
|
|
3
|
-
const
|
|
4
|
-
const fullAdapterContractCompat = new WeakMap()
|
|
3
|
+
const adapterContractCompat = Array.from({ length: 4 }, () => new WeakMap())
|
|
5
4
|
|
|
6
5
|
export const DEFAULT_ADAPTER_RECONCILE_MAX_PASSES = 32
|
|
7
6
|
|
|
@@ -37,13 +36,18 @@ function noImageRequestPricing() {
|
|
|
37
36
|
return undefined
|
|
38
37
|
}
|
|
39
38
|
|
|
39
|
+
function normalizedImageRequestTarget(_provider, _model, image) {
|
|
40
|
+
return { width: image.width, height: image.height, maxBytes: image.bytes }
|
|
41
|
+
}
|
|
42
|
+
|
|
40
43
|
/**
|
|
41
44
|
* Normalize Vision Router-owned duck-typed adapters to the Host adapter
|
|
42
45
|
* contracts that have base-class defaults in newer DSH releases.
|
|
43
46
|
*
|
|
44
47
|
* DSH 0.1.1 started dispatching through adapter.prepareCall(). DSH 0.1.2 adds
|
|
45
48
|
* adapter.imageRequestPricing() and the token meter resolves it synchronously
|
|
46
|
-
* on every measurement.
|
|
49
|
+
* on every measurement. DSH 0.2.1 adds adapter.imageRequestTarget() for
|
|
50
|
+
* screenshot consumers, with a base-class identity projection default. Vision Router intentionally registers plain adapter
|
|
47
51
|
* objects, so neither inherited default exists unless we materialize it here.
|
|
48
52
|
*
|
|
49
53
|
* Request-image pricing is deliberately NOT delegated to some other adapter.
|
|
@@ -51,6 +55,9 @@ function noImageRequestPricing() {
|
|
|
51
55
|
* only that exact route can truthfully declare its projection. `undefined` is
|
|
52
56
|
* LlmAdapter's default and keeps the Host's provider-neutral heuristic. An
|
|
53
57
|
* adapter that explicitly implements imageRequestPricing remains authoritative.
|
|
58
|
+
* Image request targets likewise default to the Host's normalized-image
|
|
59
|
+
* identity projection, never a guessed provider-specific resize. An explicit
|
|
60
|
+
* route-owned imageRequestTarget remains authoritative.
|
|
54
61
|
*
|
|
55
62
|
* The compatibility method is installed non-enumerably on extensible adapters
|
|
56
63
|
* to preserve registration identity. Frozen/sealed adapters fall back to one
|
|
@@ -61,17 +68,20 @@ export function ensureAdapterContracts(adapter, options = {}) {
|
|
|
61
68
|
if (!isAdapter(adapter)) return adapter
|
|
62
69
|
|
|
63
70
|
const includeImageRequestPricing = options.imageRequestPricing === true
|
|
71
|
+
const includeImageRequestTarget = options.imageRequestTarget === true
|
|
64
72
|
const needsPrepareCall = !hasFunction(adapter, 'prepareCall')
|
|
65
73
|
const needsImageRequestPricing =
|
|
66
74
|
includeImageRequestPricing && !hasFunction(adapter, 'imageRequestPricing')
|
|
67
|
-
|
|
75
|
+
const needsImageRequestTarget = includeImageRequestTarget && !hasFunction(adapter, 'imageRequestTarget')
|
|
76
|
+
if (!needsPrepareCall && !needsImageRequestPricing && !needsImageRequestTarget) return adapter
|
|
68
77
|
|
|
69
|
-
const cache = includeImageRequestPricing
|
|
78
|
+
const cache = adapterContractCompat[Number(includeImageRequestPricing) + 2 * Number(includeImageRequestTarget)]
|
|
70
79
|
const cached = cache.get(adapter)
|
|
71
80
|
if (cached) return cached
|
|
72
81
|
|
|
73
82
|
const prepareCall = needsPrepareCall ? createPrepareCallFallback(adapter) : undefined
|
|
74
83
|
const imageRequestPricing = needsImageRequestPricing ? noImageRequestPricing : undefined
|
|
84
|
+
const imageRequestTarget = needsImageRequestTarget ? normalizedImageRequestTarget : undefined
|
|
75
85
|
const descriptors = {}
|
|
76
86
|
if (prepareCall !== undefined) {
|
|
77
87
|
descriptors.prepareCall = {
|
|
@@ -87,6 +97,13 @@ export function ensureAdapterContracts(adapter, options = {}) {
|
|
|
87
97
|
value: imageRequestPricing,
|
|
88
98
|
}
|
|
89
99
|
}
|
|
100
|
+
if (imageRequestTarget !== undefined) {
|
|
101
|
+
descriptors.imageRequestTarget = {
|
|
102
|
+
configurable: true,
|
|
103
|
+
writable: true,
|
|
104
|
+
value: imageRequestTarget,
|
|
105
|
+
}
|
|
106
|
+
}
|
|
90
107
|
|
|
91
108
|
// Preserve the exact adapter object whenever possible. Some runtime paths
|
|
92
109
|
// retain registration.adapter and compare/reuse it later, so mutation is less
|
|
@@ -103,6 +120,9 @@ export function ensureAdapterContracts(adapter, options = {}) {
|
|
|
103
120
|
if (property === 'imageRequestPricing' && imageRequestPricing !== undefined) {
|
|
104
121
|
return imageRequestPricing
|
|
105
122
|
}
|
|
123
|
+
if (property === 'imageRequestTarget' && imageRequestTarget !== undefined) {
|
|
124
|
+
return imageRequestTarget
|
|
125
|
+
}
|
|
106
126
|
const value = Reflect.get(target, property, target)
|
|
107
127
|
if (typeof value !== 'function') return value
|
|
108
128
|
let bound = boundFunctions.get(value)
|
|
@@ -131,6 +151,14 @@ function llmSupportsImageRequestPricing(llm) {
|
|
|
131
151
|
}
|
|
132
152
|
}
|
|
133
153
|
|
|
154
|
+
function llmSupportsImageRequestTarget(llm) {
|
|
155
|
+
try {
|
|
156
|
+
return typeof Reflect.get(llm, 'imageRequestTarget', llm) === 'function'
|
|
157
|
+
} catch {
|
|
158
|
+
return false
|
|
159
|
+
}
|
|
160
|
+
}
|
|
161
|
+
|
|
134
162
|
function wrapLlmService(llm) {
|
|
135
163
|
if (!isAdapter(llm)) return llm
|
|
136
164
|
const cached = wrappedLlmServices.get(llm)
|
|
@@ -140,6 +168,7 @@ function wrapLlmService(llm) {
|
|
|
140
168
|
// historical adapter shape, while Hosts exposing the new route-pricing seam
|
|
141
169
|
// receive the base-class-compatible default on our duck-typed adapters.
|
|
142
170
|
const includeImageRequestPricing = llmSupportsImageRequestPricing(llm)
|
|
171
|
+
const includeImageRequestTarget = llmSupportsImageRequestTarget(llm)
|
|
143
172
|
const wrapped = new Proxy(llm, {
|
|
144
173
|
get(target, property) {
|
|
145
174
|
if (property === 'registerAdapter') {
|
|
@@ -149,7 +178,10 @@ function wrapLlmService(llm) {
|
|
|
149
178
|
registerAdapter.call(
|
|
150
179
|
target,
|
|
151
180
|
providers,
|
|
152
|
-
ensureAdapterContracts(adapter, {
|
|
181
|
+
ensureAdapterContracts(adapter, {
|
|
182
|
+
imageRequestPricing: includeImageRequestPricing,
|
|
183
|
+
imageRequestTarget: includeImageRequestTarget,
|
|
184
|
+
}),
|
|
153
185
|
...rest,
|
|
154
186
|
)
|
|
155
187
|
}
|
|
@@ -238,8 +270,9 @@ export function createCoalescingRunner(run, options = {}) {
|
|
|
238
270
|
* their native event semantics.
|
|
239
271
|
*
|
|
240
272
|
* The same deepest registration boundary also normalizes Vision Router-owned
|
|
241
|
-
* adapter contracts: prepareCall for DSH 0.1.1+,
|
|
242
|
-
* the Host exposes the DSH 0.1.2 route-pricing seam
|
|
273
|
+
* adapter contracts: prepareCall for DSH 0.1.1+, imageRequestPricing when
|
|
274
|
+
* the Host exposes the DSH 0.1.2 route-pricing seam, and imageRequestTarget
|
|
275
|
+
* when the Host exposes the DSH 0.2.1 screenshot projection seam. This stays scoped to the
|
|
243
276
|
* wrapped context instead of monkey-patching the Host LLM service process-wide.
|
|
244
277
|
*/
|
|
245
278
|
export function contextWithCoalescedAdapterUpdates(ctx) {
|