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.
Files changed (35) hide show
  1. package/README.md +183 -162
  2. package/README.zh.md +179 -158
  3. package/cordis.patch.yml +14 -10
  4. package/docs/architecture/dsh-0.2.1-alpha.2-compat.md +41 -0
  5. package/docs/development/dsh-alpha3-compatibility.md +36 -0
  6. package/docs/development/dsh-alpha4-adaptation.md +12 -0
  7. package/docs/development/dsh-alpha4-validation-evidence.md +29 -0
  8. package/docs/development/dsh-alpha5-adaptation.md +31 -0
  9. package/docs/development/dsh-rc1-adaptation.md +29 -0
  10. package/docs/development/dsh-rc2-adaptation.md +24 -0
  11. package/docs/development/v305-real-scenario-acceptance.md +34 -0
  12. package/docs/development/web-live-reload.md +157 -0
  13. package/docs/releases/v3.0.4.md +18 -0
  14. package/docs/releases/v3.0.5.md +31 -0
  15. package/docs/remote-settings.md +4 -0
  16. package/docs/v2-capability-routing.md +25 -9
  17. package/lib/adapter-update-coalescer.js +41 -8
  18. package/lib/client-presentation-boundary-main.js +41 -7
  19. package/lib/client.js +27 -23
  20. package/lib/core-primitives.js +6 -2
  21. package/lib/http-compat.js +33 -2
  22. package/lib/maintenance-routes.js +7 -1
  23. package/lib/session-message-source-compat.js +13 -4
  24. package/lib/sharp-runtime.js +0 -2
  25. package/lib/vision-backend-runtime-policy.js +3 -3
  26. package/lib/vision-background-benchmark.js +33 -5
  27. package/lib/vision-capability-benchmark-service.js +61 -23
  28. package/lib/vision-evidence-guidance.js +7 -1
  29. package/lib/vision-exact-check-client.js +24 -6
  30. package/lib/vision-image-input-verdict.js +5 -3
  31. package/lib/vision-toggle-root-hardening.js +20 -3
  32. package/lib/web-capability-boundary.js +164 -31
  33. package/package.json +6 -4
  34. package/presets/web-connection-ready/index.mjs +48 -0
  35. 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
+ }
@@ -0,0 +1,6 @@
1
+ {
2
+ "name": "dsh-vision-router-web-connection-ready",
3
+ "version": "0.0.0",
4
+ "private": true,
5
+ "type": "module"
6
+ }