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,48 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Private, fail-closed bridge for the two supported DSH Web trust generations.
|
|
3
|
+
*
|
|
4
|
+
* It waits for the Host-owned authority source instead of supplying a fake
|
|
5
|
+
* webRuntime service or guessing additional trusted hosts. Its only consumer
|
|
6
|
+
* is the DVR connection row; Host Connection retains all authentication and
|
|
7
|
+
* route ownership.
|
|
8
|
+
*/
|
|
9
|
+
export const name = 'vision-router-web-connection-ready'
|
|
10
|
+
export const inject = ['webStartup', 'webServer']
|
|
11
|
+
export const SERVICE = 'visionRouterWebConnectionReady'
|
|
12
|
+
|
|
13
|
+
/** Return a detached, immutable copy of the Host-approved authority list. */
|
|
14
|
+
export function validatedTrustedHosts(value) {
|
|
15
|
+
if (!Array.isArray(value) || value.some((entry) => typeof entry !== 'string')) {
|
|
16
|
+
throw new Error('Vision Router Web compatibility: Host trust list is invalid')
|
|
17
|
+
}
|
|
18
|
+
return Object.freeze([...value])
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
export function classifyHostWebGeneration(webServer) {
|
|
22
|
+
const protocol = webServer?.protocol
|
|
23
|
+
if (protocol === 'http:' || protocol === 'https:') return 'startup'
|
|
24
|
+
if (protocol === undefined) return 'legacy-runtime'
|
|
25
|
+
throw new Error('Vision Router Web compatibility: unknown Host Web protocol')
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
export function apply(ctx) {
|
|
29
|
+
const generation = classifyHostWebGeneration(ctx.webServer)
|
|
30
|
+
if (generation === 'startup') {
|
|
31
|
+
// 0.2.1-alpha.2+: Web Startup owns invocation trust; Web Runtime no
|
|
32
|
+
// longer provides a webRuntime service. Do not resurrect that service.
|
|
33
|
+
ctx.provide(SERVICE, Object.freeze({
|
|
34
|
+
trustedHosts: validatedTrustedHosts(ctx.webStartup.trustedHosts),
|
|
35
|
+
}))
|
|
36
|
+
return
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
// Older supported Hosts materialize additional bind-derived LAN addresses
|
|
40
|
+
// in their native webRuntime service. Wait for the real service rather than
|
|
41
|
+
// falling back to the earlier webStartup list (which would silently lose
|
|
42
|
+
// LAN authority and race asynchronous Web runtime activation).
|
|
43
|
+
ctx.inject(['webRuntime'], (legacyCtx) => {
|
|
44
|
+
legacyCtx.provide(SERVICE, Object.freeze({
|
|
45
|
+
trustedHosts: validatedTrustedHosts(legacyCtx.webRuntime.trustedHosts),
|
|
46
|
+
}))
|
|
47
|
+
})
|
|
48
|
+
}
|