dsh-vision-router 2.2.7 → 2.3.0

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 (69) hide show
  1. package/README.md +8 -8
  2. package/README.zh.md +8 -8
  3. package/docs/architecture/2.3.0-compat-retirement.md +147 -0
  4. package/docs/architecture/2.3.0-execution-plan.md +410 -0
  5. package/docs/architecture/2.3.0-final-audit.md +279 -0
  6. package/docs/architecture/2.3.0-reopened-plan.md +720 -0
  7. package/docs/architecture/compat-inventory.md +26 -34
  8. package/docs/architecture/dsh-020-rc2-adaptation.md +23 -0
  9. package/docs/architecture/dsh-compatibility-matrix.md +65 -54
  10. package/docs/architecture/dsh-support-window.md +29 -21
  11. package/docs/architecture/final-closure-audit.md +2 -0
  12. package/docs/architecture/host-first-proxy-convergence.md +1 -1
  13. package/docs/releases/v2.2.8.md +25 -0
  14. package/docs/releases/v2.3.0.md +53 -0
  15. package/entry.js +8 -56
  16. package/index.js +161 -691
  17. package/lib/catalog-corrections.js +1 -2
  18. package/lib/client-host-compat-prelude.js +7 -12
  19. package/lib/client-maintenance-actions.js +145 -0
  20. package/lib/client-presentation-boundary-main.js +82 -32
  21. package/lib/client-presentation-boundary.js +60 -40
  22. package/lib/client-script-carrier.js +90 -0
  23. package/lib/client.js +248 -146
  24. package/lib/core-apply-lifecycle.js +47 -0
  25. package/lib/core-primitives.js +88 -135
  26. package/lib/desktop-screenshot-tool.js +262 -0
  27. package/lib/dsh-contract-compat.js +11 -26
  28. package/lib/dsh-support-window.js +4 -4
  29. package/lib/guide-vision-toggle-highlight.js +7 -10
  30. package/lib/http-compat.js +1 -2
  31. package/lib/live-model-client-prelude.js +7 -14
  32. package/lib/local-remote-settings-permission.js +41 -16
  33. package/lib/maintenance-routes.js +136 -0
  34. package/lib/public-config.js +57 -0
  35. package/lib/public-entry.js +2 -7
  36. package/lib/remote-settings-bridge.js +11 -0
  37. package/lib/remote-settings-risk-client-boundary.js +155 -0
  38. package/lib/remote-settings-risk-confirmation.js +17 -105
  39. package/lib/runtime-composition.js +105 -30
  40. package/lib/runtime-i18n-boundary.js +10 -11
  41. package/lib/session-message-source-compat.js +7 -3
  42. package/lib/session-vision-index.js +154 -9
  43. package/lib/session-vision-mode-boundary.js +43 -8
  44. package/lib/settings-client-loader-lifecycle.js +129 -0
  45. package/lib/settings-factory-lifecycle.js +25 -14
  46. package/lib/settings-ia-client-prelude.js +11 -11
  47. package/lib/settings-limit-client-prelude.js +7 -9
  48. package/lib/sharp-runtime.js +0 -7
  49. package/lib/strict-live-model-client-prelude.js +7 -10
  50. package/lib/structured-flow-hardening.js +3 -2
  51. package/lib/v2-settings-ia-integration.js +21 -6
  52. package/lib/vision-backend-runtime-policy.js +3 -2
  53. package/lib/vision-background-benchmark.js +3 -5
  54. package/lib/vision-capability-benchmark-client.js +7 -10
  55. package/lib/vision-capability-benchmark-service.js +1 -0
  56. package/lib/vision-diagnostics-routes.js +216 -0
  57. package/lib/vision-evidence-guidance.js +3 -1
  58. package/lib/vision-exact-check-client.js +11 -6
  59. package/lib/vision-model-visibility-boundary-main.js +7 -11
  60. package/lib/vision-model-visibility-boundary.js +7 -12
  61. package/lib/vision-provider-transport.js +0 -29
  62. package/lib/vision-routing-settings-prelude.js +7 -11
  63. package/lib/vision-toggle-root-hardening.js +50 -8
  64. package/lib/vision-tool-runtime-boundary.js +5 -1
  65. package/lib/vision-turn-budget-client-prelude.js +7 -10
  66. package/lib/web/remote-settings-client.js +9 -14
  67. package/package.json +23 -13
  68. package/lib/android-attachment-compat.js +0 -244
  69. package/lib/settings-client-rc8-lifecycle.js +0 -402
package/entry.js CHANGED
@@ -3,78 +3,30 @@
3
3
  // P3-F keeps this file as the public schema/export boundary. Runtime ownership
4
4
  // lives in lib/runtime-composition.js; the mature core remains in index.js.
5
5
 
6
- import z from '@deepseek-ai/schemastery'
7
6
  import * as core from './index.js'
7
+ import {
8
+ composePublicVisionConfig,
9
+ SETTINGS_CONTRACT_REVISION,
10
+ } from './lib/public-config.js'
8
11
  import { applyVisionRuntimeComposition } from './lib/runtime-composition.js'
9
12
 
10
- // Increment whenever the browser-visible settings contract gains a field whose
11
- // absence changes write semantics. This revision is also exposed as a resolved
12
- // schema default so a newer browser client can distinguish a genuinely updated
13
- // Host from a stale in-process plugin module instead of reporting a generic
14
- // readback mismatch after the old Host rejects a newly visible field.
15
- export const SETTINGS_CONTRACT_REVISION = 7
13
+ export { SETTINGS_CONTRACT_REVISION }
16
14
 
17
- // Schemastery object schemas expose set() as the supported way to replace a
18
- // field schema. This mutates the Config object that index.js itself later uses
19
- // for the settings namespace, so composition config and settings validation
20
- // agree on the same default.
21
- core.Config.set('progressiveTools', z.boolean().default(false))
22
- // Keep the timeout layers coherent: one provider call may use up to 120s and
23
- // one visual task (including fallbacks) shares 120s. The whole-turn visual
24
- // budget is an optional user safety cap rather than an Agent lifetime policy:
25
- // 0 means unlimited, which is the default for long-running autonomous turns.
26
- core.Config.set('visionTaskTimeoutMs', z.number().step(1000).min(1000).max(180000).default(120000))
27
- core.Config.set('visionTurnBudgetMs', z.number().step(1000).min(0).max(600000).default(0))
28
-
29
- // Both visible entry points — Settings > Vision Router and the legacy
30
- // Settings > Plugins compatibility card — edit the same Host-owned namespace.
31
- core.Config.set('visionDepth', z.union(['fast', 'standard', 'deep', 'custom']).default('standard'))
32
- core.Config.set('visionDepthMaxCalls', z.number().step(1).min(0).max(100).default(0))
33
-
34
- // Product semantics: ordered remains the safe default; Auto changes execution
35
- // only under explicit live routingMode:auto authority.
36
- core.Config.set('routingMode', z.union(['ordered', 'auto']).default('ordered'))
37
- core.Config.set(
38
- 'routingPreference',
39
- z.union(['balanced', 'quality', 'speed', 'local']).default('balanced'),
40
- )
41
- // Background measurement is separate user authority; absence never grants it.
42
- core.Config.set(
43
- 'backgroundBenchmarking',
44
- z.union(['local-free', 'all', 'off']).default('off'),
45
- )
46
-
47
- // Settings surfaces and Host persistence must agree on this field.
48
- core.Config.set('allowRemoteSettings', z.boolean().default(false))
49
-
50
- // Internal read-only-by-convention handshake. It is not rendered by Vision
51
- // Router's settings UI and is not in the remote mutable allow-list.
52
- core.Config.set(
53
- 'settingsContractRevision',
54
- z.number().step(1).min(1).max(SETTINGS_CONTRACT_REVISION).default(SETTINGS_CONTRACT_REVISION),
55
- )
15
+ export const Config = composePublicVisionConfig(core.Config)
56
16
 
57
17
  export * from './index.js'
58
18
  export { sessionSurfaceReplacementIntent } from './lib/session-surface-compat.js'
59
19
  export {
60
- attachmentContextForContract,
61
20
  ensureVisionAttachmentAdmissionPolicy,
62
21
  hasBatchAttachmentContract,
63
22
  hostOwnsOfficialDeepSeekProvider,
64
23
  installHostSettingsCompatibility,
65
24
  installVisionAttachmentAdmissionPolicy,
66
25
  protectHostProviderOwnership,
67
- // Transitional public aliases retained for callers/tests written during the
68
- // rc.7 compatibility pass. Production runtime branches on feature seams.
69
- installRc7SettingsCompatibility,
70
- isRc7ContractRuntime,
71
- protectRc7ProviderOwnership,
72
26
  } from './lib/dsh-contract-compat.js'
73
- export const Config = core.Config
74
-
75
27
  // Defense in depth for direct/programmatic callers is implemented by the same
76
28
  // production composition used by Cordis. This public entry intentionally owns
77
29
  // no runtime installer ordering beyond that single call.
78
- export function apply(ctx, config = {}) {
79
- return applyVisionRuntimeComposition(ctx, config, core)
30
+ export function apply(ctx, config = {}, runtime = {}) {
31
+ return applyVisionRuntimeComposition(ctx, config, core, runtime)
80
32
  }