@dsmm/dsmm 0.3.0 → 0.3.2

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 (245) hide show
  1. package/README.md +26 -40
  2. package/cordis.patch.yml +9 -13
  3. package/docs/agent-presets.md +26 -14
  4. package/docs/compatibility.md +24 -68
  5. package/docs/deferred-native-approval-risk.md +8 -12
  6. package/docs/design.md +25 -254
  7. package/docs/lsp.md +2 -2
  8. package/docs/migration-from-ocmm.md +38 -51
  9. package/docs/model-routing.md +21 -21
  10. package/docs/native-permissions.md +17 -7
  11. package/docs/profiles.md +13 -9
  12. package/docs/releasing.md +25 -311
  13. package/docs/roadmap.md +52 -241
  14. package/docs/runtime-recovery.md +29 -91
  15. package/docs/safety-guards.md +19 -16
  16. package/docs/settings-status.md +23 -11
  17. package/docs/skill-sync.md +17 -17
  18. package/docs/web-fetch-fakeip.md +82 -0
  19. package/lib/child-capture.d.ts +12 -2
  20. package/lib/child-capture.js +22 -5
  21. package/lib/client/ChildPermissions.d.ts +43 -0
  22. package/lib/client/ChildPermissions.js +100 -0
  23. package/lib/client/ChildrenPanel.d.ts +5 -5
  24. package/lib/client/ChildrenPanel.js +6 -18
  25. package/lib/client/DeploymentFields.d.ts +32 -0
  26. package/lib/client/DeploymentFields.js +70 -0
  27. package/lib/client/DeploymentPage.d.ts +21 -6
  28. package/lib/client/DeploymentPage.js +80 -112
  29. package/lib/client/HistoryContinuation.d.ts +7 -0
  30. package/lib/client/HistoryContinuation.js +22 -0
  31. package/lib/client/NativeCommandEntries.d.ts +17 -0
  32. package/lib/client/NativeCommandEntries.js +68 -0
  33. package/lib/client/PermissionPanelEntry.d.ts +8 -0
  34. package/lib/client/PermissionPanelEntry.js +11 -0
  35. package/lib/client/PermissionsPanel.d.ts +3 -1
  36. package/lib/client/PermissionsPanel.js +10 -9
  37. package/lib/client/ProfilesSection.js +8 -6
  38. package/lib/client/RoleAvailability.js +1 -1
  39. package/lib/client/RoleToolView-data.d.ts +35 -0
  40. package/lib/client/RoleToolView-data.js +52 -0
  41. package/lib/client/RoleToolView-locales.d.ts +36 -0
  42. package/lib/client/RoleToolView-locales.js +20 -0
  43. package/lib/client/RoleToolView.d.ts +10 -0
  44. package/lib/client/RoleToolView.js +47 -0
  45. package/lib/client/SessionProfiles.js +51 -24
  46. package/lib/client/TemporaryPermissions.d.ts +21 -0
  47. package/lib/client/TemporaryPermissions.js +94 -0
  48. package/lib/client/children-controller.d.ts +2 -8
  49. package/lib/client/children-controller.js +1 -26
  50. package/lib/client/children-locales.d.ts +27 -52
  51. package/lib/client/children-locales.js +8 -12
  52. package/lib/client/configuration-display.d.ts +5 -0
  53. package/lib/client/configuration-display.js +11 -0
  54. package/lib/client/controller.d.ts +18 -0
  55. package/lib/client/controller.js +118 -28
  56. package/lib/client/deployment-controller.d.ts +13 -1
  57. package/lib/client/deployment-controller.js +84 -24
  58. package/lib/client/deployment-data.d.ts +1 -0
  59. package/lib/client/deployment-data.js +4 -1
  60. package/lib/client/deployment-locales.d.ts +43 -0
  61. package/lib/client/deployment-locales.js +45 -19
  62. package/lib/client/deployment-modules.d.ts +9 -0
  63. package/lib/client/deployment-modules.js +24 -0
  64. package/lib/client/deployment-workspace.d.ts +48 -0
  65. package/lib/client/deployment-workspace.js +123 -0
  66. package/lib/client/history-controller.d.ts +29 -0
  67. package/lib/client/history-controller.js +111 -0
  68. package/lib/client/history-entry.d.ts +11 -0
  69. package/lib/client/history-entry.js +106 -0
  70. package/lib/client/history-locales.d.ts +95 -0
  71. package/lib/client/history-locales.js +41 -0
  72. package/lib/client/index.js +26 -76
  73. package/lib/client/locales.d.ts +13 -0
  74. package/lib/client/locales.js +104 -86
  75. package/lib/client/permission-controller.d.ts +1 -0
  76. package/lib/client/permission-controller.js +3 -2
  77. package/lib/client/permission-locales.d.ts +51 -0
  78. package/lib/client/permission-locales.js +59 -19
  79. package/lib/client/session-labels.js +4 -3
  80. package/lib/client/styles.d.ts +1 -1
  81. package/lib/client/styles.js +9 -8
  82. package/lib/client/temporary-permission-client.d.ts +20 -0
  83. package/lib/client/temporary-permission-client.js +52 -0
  84. package/lib/client/temporary-permission-entry.d.ts +6 -0
  85. package/lib/client/temporary-permission-entry.js +56 -0
  86. package/lib/client.js +5691 -3439
  87. package/lib/commands.js +2 -0
  88. package/lib/config-file-store.d.ts +3 -0
  89. package/lib/config-file-store.js +4 -2
  90. package/lib/config-revision.d.ts +5 -0
  91. package/lib/config-revision.js +11 -0
  92. package/lib/core-permission-authority.js +11 -41
  93. package/lib/deployment-config.d.ts +9 -2
  94. package/lib/deployment-config.js +35 -8
  95. package/lib/deployment-permission-rules.js +19 -7
  96. package/lib/dsh-types.d.ts +1 -1
  97. package/lib/history-candidates.d.ts +30 -0
  98. package/lib/history-candidates.js +176 -0
  99. package/lib/history-codec.d.ts +11 -0
  100. package/lib/history-codec.js +102 -0
  101. package/lib/history-contract.d.ts +44 -0
  102. package/lib/history-contract.js +2 -0
  103. package/lib/history-controller.d.ts +42 -0
  104. package/lib/history-controller.js +329 -0
  105. package/lib/history-policy.d.ts +4 -0
  106. package/lib/history-policy.js +8 -0
  107. package/lib/history-remote.d.ts +28 -0
  108. package/lib/history-remote.js +17 -0
  109. package/lib/history-rpc.d.ts +24 -0
  110. package/lib/history-rpc.js +136 -0
  111. package/lib/history-support.d.ts +15 -0
  112. package/lib/history-support.js +21 -0
  113. package/lib/history-types.d.ts +67 -0
  114. package/lib/history-types.js +2 -0
  115. package/lib/host-llm-startup.js +3 -3
  116. package/lib/host-llm.d.ts +9 -3
  117. package/lib/host-llm.js +48 -8
  118. package/lib/index.d.ts +18 -20
  119. package/lib/index.js +147 -415
  120. package/lib/lifetime.d.ts +4 -0
  121. package/lib/lifetime.js +22 -0
  122. package/lib/live-pi-ai-owner.d.ts +1 -0
  123. package/lib/live-pi-ai-owner.js +8 -4
  124. package/lib/mode.d.ts +3 -2
  125. package/lib/mode.js +28 -41
  126. package/lib/model-routing.d.ts +2 -8
  127. package/lib/model-routing.js +59 -175
  128. package/lib/native-admission.d.ts +77 -0
  129. package/lib/native-admission.js +503 -0
  130. package/lib/native-pi-ai-wire.d.ts +3 -1
  131. package/lib/native-pi-ai-wire.js +47 -13
  132. package/lib/permission-child-control.d.ts +36 -0
  133. package/lib/permission-child-control.js +164 -0
  134. package/lib/permission-control.d.ts +2 -3
  135. package/lib/permission-control.js +7 -0
  136. package/lib/permission-controller.js +2 -2
  137. package/lib/permission-exec-argv.d.ts +32 -0
  138. package/lib/permission-exec-argv.js +171 -0
  139. package/lib/permission-fs-search.js +2 -1
  140. package/lib/permission-fs.js +2 -1
  141. package/lib/permission-native-rules.js +3 -3
  142. package/lib/permission-temporary-files.d.ts +19 -0
  143. package/lib/permission-temporary-files.js +248 -0
  144. package/lib/permission-temporary-grants.d.ts +106 -0
  145. package/lib/permission-temporary-grants.js +198 -0
  146. package/lib/permission-temporary-install.d.ts +25 -0
  147. package/lib/permission-temporary-install.js +86 -0
  148. package/lib/permission-temporary-remote.d.ts +19 -0
  149. package/lib/permission-temporary-remote.js +75 -0
  150. package/lib/permission-temporary-rpc.d.ts +37 -0
  151. package/lib/permission-temporary-rpc.js +154 -0
  152. package/lib/permission-temporary-types.d.ts +47 -0
  153. package/lib/permission-temporary-types.js +2 -0
  154. package/lib/permission-temporary-web.d.ts +11 -0
  155. package/lib/permission-temporary-web.js +154 -0
  156. package/lib/permission-web.js +2 -1
  157. package/lib/preset-registry.js +3 -2
  158. package/lib/preset-skills.d.ts +3 -12
  159. package/lib/preset-skills.js +28 -58
  160. package/lib/profile-diagnostics.d.ts +1 -1
  161. package/lib/profile-diagnostics.js +2 -2
  162. package/lib/profile-remote.js +61 -22
  163. package/lib/profile-rpc.d.ts +4 -3
  164. package/lib/profile-rpc.js +35 -37
  165. package/lib/profile-runtime.d.ts +42 -74
  166. package/lib/profile-runtime.js +314 -617
  167. package/lib/profile-store.d.ts +20 -8
  168. package/lib/profile-store.js +112 -63
  169. package/lib/profile-types.d.ts +19 -4
  170. package/lib/profiles.d.ts +3 -1
  171. package/lib/profiles.js +9 -7
  172. package/lib/prompt-content.d.ts +1 -0
  173. package/lib/prompt-content.js +4 -1
  174. package/lib/prompts.d.ts +2 -12
  175. package/lib/prompts.js +11 -66
  176. package/lib/role-control-remote.d.ts +1 -4
  177. package/lib/role-control-remote.js +8 -36
  178. package/lib/role-control-rpc.d.ts +10 -36
  179. package/lib/role-control-rpc.js +112 -269
  180. package/lib/role-control-types.d.ts +3 -26
  181. package/lib/role-control-types.js +3 -4
  182. package/lib/role-identity.d.ts +5 -0
  183. package/lib/role-identity.js +10 -0
  184. package/lib/role-invocation.d.ts +3 -3
  185. package/lib/role-invocation.js +2 -2
  186. package/lib/role-llm-runtime.js +5 -11
  187. package/lib/role-policy.d.ts +19 -50
  188. package/lib/role-policy.js +136 -508
  189. package/lib/role-providers.d.ts +5 -8
  190. package/lib/role-providers.js +20 -86
  191. package/lib/role-routing.d.ts +1 -3
  192. package/lib/role-routing.js +24 -34
  193. package/lib/role-subagents.d.ts +5 -14
  194. package/lib/role-subagents.js +163 -108
  195. package/lib/runtime-integration.d.ts +5 -78
  196. package/lib/runtime-integration.js +11 -697
  197. package/lib/session-metadata.d.ts +13 -12
  198. package/lib/session-metadata.js +6 -31
  199. package/lib/session-scope.js +2 -1
  200. package/lib/settings.d.ts +5 -18
  201. package/lib/settings.js +19 -43
  202. package/lib/skills.d.ts +1 -0
  203. package/lib/skills.js +5 -1
  204. package/lib/state.d.ts +3 -2
  205. package/lib/state.js +26 -10
  206. package/lib/status.d.ts +1 -9
  207. package/lib/status.js +3 -55
  208. package/lib/web-fetch-address-policy.d.ts +24 -0
  209. package/lib/web-fetch-address-policy.js +189 -0
  210. package/lib/web-fetch-fakeip.d.ts +25 -0
  211. package/lib/web-fetch-fakeip.js +107 -0
  212. package/package.json +124 -106
  213. package/patches/dsh-approval-settlement/@deepseek-ai__dsh-api-gateway@0.2.1-rc.2.patch +13291 -0
  214. package/patches/dsh-approval-settlement/@deepseek-ai__dsh-api-remotes@0.2.1-rc.2.patch +9133 -0
  215. package/patches/dsh-approval-settlement/@deepseek-ai__dsh-client-ui-approval@0.2.1-rc.2.patch +156 -0
  216. package/patches/dsh-approval-settlement/@deepseek-ai__dsh-subagent@0.2.1-rc.2.patch +3546 -0
  217. package/patches/dsh-approval-settlement/@deepseek-ai__dsh-user-approval@0.2.1-rc.2.patch +431 -0
  218. package/patches/dsh-approval-settlement/@deepseek-ai__dsh-web@0.2.1-rc.2.patch +119 -0
  219. package/patches/dsh-approval-settlement/README.md +41 -0
  220. package/patches/dsh-approval-settlement/metadata.json +10 -0
  221. package/patches/dsh-session-activation/@deepseek-ai__dsh-agent-loop@0.2.1-rc.2.patch +383 -0
  222. package/patches/dsh-session-activation/@deepseek-ai__dsh-agent-preset-registry@0.2.1-rc.2.patch +55 -0
  223. package/patches/dsh-session-activation/@deepseek-ai__dsh-api-session-controller@0.2.1-rc.2.patch +16673 -0
  224. package/patches/dsh-session-activation/@deepseek-ai__dsh-client-ui-subagent@0.2.1-rc.2.patch +29 -0
  225. package/patches/dsh-session-activation/@deepseek-ai__dsh-client-ui-workspace@0.2.1-rc.2.patch +196 -0
  226. package/patches/dsh-session-activation/@deepseek-ai__dsh-session-persistence-jsonl@0.2.1-rc.2.patch +35 -0
  227. package/patches/dsh-session-activation/@deepseek-ai__dsh-session-persistence@0.2.1-rc.2.patch +40 -0
  228. package/docs/research/deepseek-v4-pro.md +0 -74
  229. package/docs/research/oh-dsh.md +0 -96
  230. package/lib/agent-registry.d.ts +0 -36
  231. package/lib/agent-registry.js +0 -75
  232. package/lib/child-admission.d.ts +0 -40
  233. package/lib/child-admission.js +0 -151
  234. package/lib/delivery-authority.d.ts +0 -83
  235. package/lib/delivery-authority.js +0 -397
  236. package/lib/native-child-evidence.d.ts +0 -40
  237. package/lib/native-child-evidence.js +0 -104
  238. package/lib/role-runs.d.ts +0 -138
  239. package/lib/role-runs.js +0 -335
  240. package/lib/session-persistence.d.ts +0 -36
  241. package/lib/session-persistence.js +0 -304
  242. package/lib/subagent-runtime.d.ts +0 -57
  243. package/lib/subagent-runtime.js +0 -257
  244. package/prompts/deepseek-flash.md +0 -11
  245. package/prompts/deepseek-v4-pro.md +0 -14
@@ -16,6 +16,45 @@ export declare const deploymentEn: {
16
16
  coreHint: string;
17
17
  modelParametersHint: string;
18
18
  permissionControlHint: string;
19
+ modules: string;
20
+ scope: string;
21
+ close: string;
22
+ loading: string;
23
+ unset: string;
24
+ "module:run": string;
25
+ "module:routes": string;
26
+ "module:workflow": string;
27
+ "module:subagents": string;
28
+ "module:permissions": string;
29
+ "module:other": string;
30
+ "module:state": string;
31
+ saveScope: string;
32
+ pendingModules: string;
33
+ savedRefreshRequired: string;
34
+ sessionObserved: string;
35
+ noModuleFields: string;
36
+ leaveDraft: string;
37
+ continueEditing: string;
38
+ keepDraft: string;
39
+ discardDraft: string;
40
+ rootRules: string;
41
+ rootRulesHint: string;
42
+ rootRulesUnavailable: string;
43
+ nativeRuntimeHint: string;
44
+ nativeRuntimeReadinessHint: string;
45
+ unsetGroup: string;
46
+ nativeRuntimeState: string;
47
+ nativeRuntimeBinding: string;
48
+ nativeRuntimeFence: string;
49
+ nativeRuntimeRestart: string;
50
+ nativeRuntimeStock: string;
51
+ nativeRuntimeUnavailable: string;
52
+ "nativeRuntimeReason-explicit-composition-required": string;
53
+ "nativeRuntimeReason-duplicate-provider": string;
54
+ "nativeRuntimeReason-authority-not-ready": string;
55
+ "nativeRuntimeReason-disabled": string;
56
+ "nativeRuntimeReason-pending-restart": string;
57
+ "nativeRuntimeReason-scope-conflict": string;
19
58
  saveGlobal: string;
20
59
  saveProfile: string;
21
60
  saving: string;
@@ -48,6 +87,9 @@ export declare const deploymentEn: {
48
87
  off: string;
49
88
  state: string;
50
89
  module: string;
90
+ versionObserved: string;
91
+ versionAbsent: string;
92
+ versionUnknown: string;
51
93
  advanced: string;
52
94
  advancedHint: string;
53
95
  invalid: string;
@@ -56,6 +98,7 @@ export declare const deploymentEn: {
56
98
  "not-owned": string;
57
99
  validation: string;
58
100
  transport: string;
101
+ unconfirmed: string;
59
102
  namedIndependent: string;
60
103
  };
61
104
  export type DeploymentLocaleKey = keyof typeof deploymentEn;
@@ -3,70 +3,96 @@ export const deploymentEn = {
3
3
  title: "DSMM", summary: "Global config and profile overrides",
4
4
  description: "Layers save independently; native models and running sessions stay unchanged.",
5
5
  global: "DSMM Global config", globalHint: "Shared by this Home’s DSH profiles. Unset fields use built-in defaults.",
6
- profile: "Current DSH profile overrides", profileHint: "This entry only. Unset fields inherit Global config.",
6
+ profile: "Current DSH profile overrides", profileHint: "This DSH profile only. Unset fields use Global and Host defaults; native runtime uses Host defaults.",
7
7
  profileUnavailable: "Unavailable",
8
- unavailableForm: "No verified writable form. Open this entry’s bundle or row config to edit profile overrides.",
8
+ unavailableForm: "This DSH profile is read-only. Reconnect and refresh to check editing access.",
9
9
  ceiling: "Deepwork master is Global-only; profiles and session modes cannot lift its captured ceiling.",
10
10
  hostUnknown: "Host bundle status: unknown (separate switch).",
11
- boundaries: "New roots capture saved settings within startup capabilities. Save does not restart the Host; startup-only changes require a separate Host restart, which may cancel sessions.",
11
+ boundaries: "Saved settings apply to new sessions. Changes marked restart required need a separate Host restart, which may cancel sessions.",
12
12
  core: "Core", coreHint: "Core-owned desired settings. Model-parameter passthrough is ordinary config, not a subplugin. The permission-control enabled flag is startup-pinned. Save does not change current-session admission; inspect desired, startup and admitted values below. Unavailable admission stays unknown.",
13
- modelParametersHint: "Default On. Off retains saved custom/opaque model parameters without forwarding them, and DSMM reasoningEffort / reasoning_effort aliases use native defaults. Standard SDK parameters and explicit native root choices remain intact. Raw JSON and exact effort values remain editable; saving desired settings does not verify provider transport readiness.",
14
- permissionControlHint: "Permission-control module desired switch (default On), captured at startup. Global/native Save does not remove current protections or prove runtime coverage. Rules and exact Root approvals use the separate Permission control page; a restart remains independent.",
15
- saveGlobal: "Save Global config", saveProfile: "Save profile overrides", saving: "Saving…", refresh: "Refresh", discard: "Discard and reload", dirty: "Unsaved changes", saved: "Saved",
13
+ modelParametersHint: "Off stops sending custom parameters and uses native reasoning defaults. Saved values and your selected model stay unchanged.",
14
+ permissionControlHint: "Permission-control mounting is startup-pinned. Saved configuration does not prove runtime coverage or remove current protections. Root rules keep their independent authority inside Permissions.",
15
+ modules: "Configuration modules", scope: "Configuration scope", close: "Close module", loading: "Loading configuration…", unset: "Use default configuration",
16
+ "module:run": "Run and modules", "module:routes": "Model routes and recovery", "module:workflow": "Workflow, roles and skills", "module:subagents": "Subagent settings", "module:permissions": "Permissions and guards", "module:other": "Other settings", "module:state": "Configuration state",
17
+ saveScope: "Save selected configuration scope", pendingModules: "Pending modules in this scope", savedRefreshRequired: "Saved — refresh required before further edits", sessionObserved: "Current-session admission observed",
18
+ noModuleFields: "No editable settings in this scope.",
19
+ leaveDraft: "Unsaved or invalid draft. Choose how to leave; nothing is saved or discarded automatically.", continueEditing: "Continue editing", keepDraft: "Keep draft and return", discardDraft: "Discard draft and leave",
20
+ rootRules: "Session permission rules", rootRulesHint: "Rules save separately. Select an open main session with editing access and synchronized permissions.", rootRulesUnavailable: "Permission rules unavailable. Reconnect and refresh.",
21
+ nativeRuntimeHint: "Native default On; Host base pins still apply. Mounting is captured at startup. Saving stages desired configuration only; it does not start/stop providers or cancel running sessions. A separate Host restart may cancel sessions.",
22
+ nativeRuntimeReadinessHint: "Task progress is available in the session.",
23
+ unsetGroup: "Use defaults for this group",
24
+ nativeRuntimeState: "Observed native runtime", nativeRuntimeBinding: "Observed runtime composition", nativeRuntimeFence: "Execution admission ready", nativeRuntimeRestart: "Restart required", nativeRuntimeStock: "Official Host runtime", nativeRuntimeUnavailable: "Unavailable / unknown",
25
+ "nativeRuntimeReason-explicit-composition-required": "The Host requires an explicit native runtime composition.", "nativeRuntimeReason-duplicate-provider": "More than one native provider is present; readiness is not confirmed.", "nativeRuntimeReason-authority-not-ready": "Native execution authority is not ready.", "nativeRuntimeReason-disabled": "The saved native runtime is disabled.", "nativeRuntimeReason-pending-restart": "Saved desired state differs from the mounted native composition; restart is pending.", "nativeRuntimeReason-scope-conflict": "Native scope ownership conflicts; readiness is not confirmed.",
26
+ saveGlobal: "Save", saveProfile: "Save", saving: "Saving…", refresh: "Refresh", discard: "Discard and reload", dirty: "Unsaved changes", saved: "Saved",
16
27
  inherit: "Inherit", explicit: "Override", defaultPin: "Built-in default pinned", hostPin: "Host pin remains when cleared",
17
28
  globalSource: "Global", profileSource: "DSH profile", defaultsSource: "Built-in default", namedSource: "Named/session", startupSource: "Startup capture", deploymentCapture: "Deployment capture",
18
29
  desired: "Merged desired", startup: "Startup mounted / captured", next: "Next root", session: "Current-session admitted", noSession: "No active session: admission is unknown.",
19
30
  sessionUnavailable: "Session admission unavailable. Reconnect and refresh the session separately.",
20
31
  absent: "Absent", mixedSource: "Mixed sources", inspectorStale: "Saved state, not draft",
21
32
  pending: "Pending independent restart", unknown: "Unknown", on: "On", off: "Off", state: "Field sources and effective state", module: "Deepwork module",
22
- advanced: "Advanced JSON", advancedHint: "Schema keys only; omit to inherit. Arrays replace. No credentials or scripts; use existing providers.",
33
+ versionObserved: "Metadata observed", versionAbsent: "Not stored", versionUnknown: "Version unavailable",
34
+ advanced: "Advanced JSON", advancedHint: "Use supported fields; omit to inherit. Arrays replace inherited values. Do not enter credentials or scripts.",
23
35
  invalid: "Invalid field. Check type, bounds and keys; draft retained.",
24
36
  conflict: "Revision conflict; draft retained. Review changes, then discard and reload. Refresh does not merge.",
25
37
  unavailable: "Scope unavailable; draft retained. Reconnect and refresh.",
26
38
  "not-owned": "Read-only: requires an authenticated local Host operator.",
27
39
  validation: "Host rejected configuration; draft retained. Check fields and merged constraints.",
28
- transport: "Disconnected; draft retained. Reconnect and refresh.",
40
+ transport: "Connection lost; result unknown. Draft kept. Reconnect and refresh before retrying.",
41
+ unconfirmed: "Save result unknown. Draft kept. Refresh before retrying.",
29
42
  namedIndependent: "Deepwork Profiles is a separate named JSONC runtime-resource editor in Settings. Saving here does not apply a named profile or select its model.",
30
43
  };
31
44
  export const deploymentZh = {
32
45
  title: "DSMM", summary: "全局配置与当前配置覆盖",
33
46
  description: "两层独立保存,不改原生模型或运行中会话。",
34
47
  global: "DSMM 全局配置", globalHint: "同一 Home 的 DSH 配置共用;未设置字段使用内建默认值。",
35
- profile: "当前 DSH 配置覆盖", profileHint: "仅此实例;未设置字段继承全局配置。",
48
+ profile: "当前 DSH 配置覆盖", profileHint: "仅影响此 DSH 配置。未设置字段使用全局与宿主默认值;原生运行时使用宿主默认值。",
36
49
  profileUnavailable: "不可用",
37
- unavailableForm: "没有已核验的可写表单。请打开此实例的 bundle 或条目配置以编辑覆盖。",
50
+ unavailableForm: "此 DSH 配置只读,请重连并刷新以检查编辑权限。",
38
51
  ceiling: "Deepwork 总开关仅全局可改;配置和会话模式不能突破已捕获上限。",
39
52
  hostUnknown: "宿主整包状态:未知(独立开关)。",
40
- boundaries: "新根会话在启动能力内采用已保存设置。保存不重启宿主;仅启动时生效的更改需另行重启宿主,可能取消会话。",
53
+ boundaries: "保存的设置供新会话使用。标注「需重启」的更改需另行重启宿主,可能取消会话。",
41
54
  core: "Core 核心配置", coreHint: "Core 所有的 desired 意图配置。模型参数透传为普通配置,非子插件;权限控制 enabled 仅启动时捕获。保存不改变当前会话准入;下方可检查意图、启动与准入值,不可用的准入仍为未知。",
42
- modelParametersHint: "默认开启。关闭后仍保存 custom/opaque 模型参数但不发送;DSMM reasoningEffort/reasoning_effort 两种别名采用原生默认值。标准 SDK 参数与根会话原生显式选择保留。仍可编辑原始 JSON 和精确 effort 值;保存意图不代表提供商传输已就绪。",
43
- permissionControlHint: "权限控制子模块 desired 开关(默认开启),仅启动时捕获。Global/native 保存不移除当前保护,也不证明运行时覆盖。规则及精确 Root 批准在独立“权限控制”页处理;重启仍为独立操作。",
44
- saveGlobal: "保存全局配置", saveProfile: "保存当前配置覆盖", saving: "正在保存…", refresh: "刷新", discard: "丢弃并重载", dirty: "未保存", saved: "已保存",
55
+ modelParametersHint: "关闭后停止发送自定义参数,并使用原生推理默认值;已保存的值和所选模型不变。",
56
+ permissionControlHint: "权限控制挂载仅启动时捕获。保存配置不证明运行时覆盖,也不移除当前保护;Root 规则在权限模块内保持独立权限。",
57
+ modules: "配置模块", scope: "配置范围", close: "关闭模块", loading: "正在加载配置…", unset: "使用默认配置",
58
+ "module:run": "运行与模块", "module:routes": "模型路由与恢复", "module:workflow": "工作流、角色与技能", "module:subagents": "子 Agent 设置", "module:permissions": "权限与保护", "module:other": "其他设置", "module:state": "配置状态",
59
+ saveScope: "保存所选配置作用域", pendingModules: "此作用域的待保存模块", savedRefreshRequired: "已保存——需刷新后继续编辑", sessionObserved: "已观测当前会话准入",
60
+ noModuleFields: "此范围内没有可编辑的设置。",
61
+ leaveDraft: "仍有未保存或无效草稿,请选择离开方式;不会自动保存或丢弃。", continueEditing: "继续编辑", keepDraft: "保留草稿并返回", discardDraft: "放弃草稿并离开",
62
+ rootRules: "会话权限规则", rootRulesHint: "规则单独保存。请选择已打开的主会话,并确认有编辑权限且权限已同步。", rootRulesUnavailable: "权限规则不可用,请重连后刷新。",
63
+ nativeRuntimeHint: "原生默认开启,Host base 固定值仍适用;挂载仅启动时捕获。保存只设置 desired,不会启动/停止提供商或取消当前会话;独立 Host 重启可能取消会话。",
64
+ nativeRuntimeReadinessHint: "任务进度可在会话中查看。",
65
+ unsetGroup: "整组使用默认配置",
66
+ nativeRuntimeState: "已观测原生运行时", nativeRuntimeBinding: "已观测运行时组合", nativeRuntimeFence: "执行准入已就绪", nativeRuntimeRestart: "需要重启", nativeRuntimeStock: "官方 Host 运行时", nativeRuntimeUnavailable: "不可用/未知",
67
+ "nativeRuntimeReason-explicit-composition-required": "Host 需要显式的原生运行时组合。", "nativeRuntimeReason-duplicate-provider": "存在重复原生 provider,无法确认就绪状态。", "nativeRuntimeReason-authority-not-ready": "原生执行权限尚未就绪。", "nativeRuntimeReason-disabled": "已保存的原生运行时为关闭。", "nativeRuntimeReason-pending-restart": "已保存 desired 与已挂载原生组合不同,等待独立重启。", "nativeRuntimeReason-scope-conflict": "原生 scope 所有权冲突,无法确认就绪状态。",
68
+ saveGlobal: "保存", saveProfile: "保存", saving: "正在保存…", refresh: "刷新", discard: "丢弃并重载", dirty: "未保存", saved: "已保存",
45
69
  inherit: "继承", explicit: "覆盖", defaultPin: "固定为内建默认值", hostPin: "清除后仍有宿主固定值",
46
70
  globalSource: "全局", profileSource: "DSH 配置", defaultsSource: "内建默认", namedSource: "具名/会话", startupSource: "启动捕获", deploymentCapture: "部署捕获",
47
71
  desired: "合并后意图", startup: "启动挂载/捕获", next: "下一个根会话", session: "当前会话准入", noSession: "没有活动会话:准入状态未知。",
48
72
  sessionUnavailable: "会话准入暂不可用;恢复连接后另行刷新会话。",
49
73
  absent: "不存在", mixedSource: "混合来源", inspectorStale: "已保存状态,非草稿",
50
74
  pending: "等待独立重启", unknown: "未知", on: "开启", off: "关闭", state: "字段来源与实际生效状态", module: "Deepwork 子模块",
51
- advanced: "高级 JSON", advancedHint: "仅 schema 声明的键;省略为继承,数组整项替换。不填凭据或脚本,仅用已有提供商。",
75
+ versionObserved: "已观测元数据", versionAbsent: "未存储", versionUnknown: "版本不可用",
76
+ advanced: "高级 JSON", advancedHint: "仅使用支持的字段,省略表示继承;数组整体替换继承值。请勿填写凭据或脚本。",
52
77
  invalid: "字段无效,请核对类型、范围与键;草稿保留。",
53
78
  conflict: "版本冲突,草稿保留。核对后丢弃并重载;刷新不自动合并。",
54
79
  unavailable: "作用域不可用,草稿保留;重连后刷新。",
55
80
  "not-owned": "只读:需要本地宿主已认证 operator 权限。",
56
81
  validation: "宿主拒绝配置,草稿保留;核对字段及合并约束。",
57
- transport: "连接中断,草稿保留;重连后刷新。",
82
+ transport: "连接中断,结果未知,草稿已保留。请重连并刷新后再重试。",
83
+ unconfirmed: "保存结果未知,草稿已保留。请刷新后再重试。",
58
84
  namedIndependent: "设置中的 Deepwork Profiles 是独立的具名 JSONC 运行时资源编辑器。在此保存不会应用具名配置或选择其模型。",
59
85
  };
60
86
  /** Stable public field names stay visible alongside localized context. */
61
87
  export const deploymentFieldLabels = {
62
- modelParameters: ["Model parameters", "模型参数"], passthrough: ["Model parameter passthrough", "模型参数透传"],
88
+ modelParameters: ["Model parameters", "模型参数"], passthrough: ["Model parameter passthrough", "模型参数透传"], locale: ["Agent business language", "Agent 业务语言"],
63
89
  permissionControl: ["Permission-control module", "权限控制子模块"],
64
90
  modules: ["Modules", "子模块"], skills: ["Skills", "技能"], roles: ["Agent roles", "Agent 角色"],
65
- deepwork: ["Deepwork", "Deepwork"], deepseekV4ProCalibration: ["DeepSeek V4 Pro calibration", "DeepSeek V4 Pro 校准"], deepseekV4ProDefaultReasoningEffort: ["DeepSeek V4 Pro default reasoning", "DeepSeek V4 Pro 默认推理强度"], deepseekV4ProMaxReasoningPresets: ["DeepSeek V4 Pro max presets", "DeepSeek V4 Pro 最高强度预设"], deepseekFlashCalibration: ["DeepSeek Flash calibration", "DeepSeek Flash 校准"], deepseekFlashDefaultReasoningEffort: ["DeepSeek Flash default reasoning", "DeepSeek Flash 默认推理强度"], deepseekFlashMaxReasoningPresets: ["DeepSeek Flash max presets", "DeepSeek Flash 最高强度预设"],
91
+ deepwork: ["Deepwork", "Deepwork"], runtime: ["Native runtime (restart required)", "原生运行时(需重启)"],
66
92
  roleRouting: ["Existing-provider routes", "已有提供商路由"], runtimePolicy: ["Routing and retry policy", "路由与重试策略"],
67
93
  workflow: ["Workflow gates", "工作流关卡"], guards: ["Safety guards", "安全保护"], runtimeRecovery: ["Runtime recovery", "运行时恢复"],
68
94
  subagents: ["Subagents", "子 Agent"], lsp: ["LSP", "LSP"], presets: ["Preset materialization", "预设物化"],
69
- modeName: ["Mode name", "模式名称"], section: ["Prompt section", "提示词章节"], promptOrder: ["Prompt order", "提示词顺序"], defaultActive: ["Default Deepwork mode", "默认 Deepwork 模式"],
95
+ promptOrder: ["Prompt order", "提示词顺序"], defaultActive: ["Default Deepwork mode", "默认 Deepwork 模式"],
70
96
  enabled: ["Enabled", "启用"], materialize: ["Materialize presets", "物化预设"], scope: ["Guard scope", "保护范围"],
71
97
  plannerRootEnabled: ["Planner main-chat preset (restart required)", "Planner 主聊天预设(需重启)"],
72
98
  shellCommandSafety: ["Shell command safety", "Shell 命令安全"], gitWriteGuard: ["Git write policy", "Git 写入策略"],
@@ -0,0 +1,9 @@
1
+ import type { DeploymentSchemaNode } from "../profile-types.js";
2
+ import type { DeploymentLocaleKey } from "./deployment-locales.js";
3
+ export declare const CONFIG_MODULES: readonly ["run", "routes", "workflow", "subagents", "permissions", "other", "state"];
4
+ export type ConfigModule = typeof CONFIG_MODULES[number];
5
+ export declare const moduleTitle: (module: ConfigModule) => DeploymentLocaleKey;
6
+ export declare function moduleFor(path: string): Exclude<ConfigModule, "state">;
7
+ export declare function editableConfigField(key: string, layer: "global" | "profile"): boolean;
8
+ export declare function moduleFields(schema: DeploymentSchemaNode, module: ConfigModule, layer: "global" | "profile"): Array<[string, DeploymentSchemaNode]>;
9
+ //# sourceMappingURL=deployment-modules.d.ts.map
@@ -0,0 +1,24 @@
1
+ export const CONFIG_MODULES = ["run", "routes", "workflow", "subagents", "permissions", "other", "state"];
2
+ export const moduleTitle = (module) => `module:${module}`;
3
+ export function moduleFor(path) {
4
+ const key = path.split(".")[0];
5
+ if (["defaultActive", "modules", "modelParameters", "runtime"].includes(key))
6
+ return "run";
7
+ if (["roleRouting", "runtimePolicy", "runtimeRecovery"].includes(key))
8
+ return "routes";
9
+ if (["workflow", "roles", "skills", "presets", "businessLocale", "locale", "promptOrder", "plannerRootEnabled"].includes(key))
10
+ return "workflow";
11
+ if (key === "subagents")
12
+ return "subagents";
13
+ if (["permissionControl", "guards"].includes(key))
14
+ return "permissions";
15
+ return "other";
16
+ }
17
+ export function editableConfigField(key, layer) {
18
+ return !["lsp", "modeName", "section"].includes(key)
19
+ && !(key === "modules" && layer === "profile") && !(key === "runtime" && layer === "global");
20
+ }
21
+ export function moduleFields(schema, module, layer) {
22
+ return Object.entries(schema.fields ?? {}).filter(([key]) => editableConfigField(key, layer) && moduleFor(key) === module);
23
+ }
24
+ //# sourceMappingURL=deployment-modules.js.map
@@ -0,0 +1,48 @@
1
+ import type { ConfigForms } from "@deepseek-ai/dsh-client-ui-settings/client";
2
+ import type { DeploymentController } from "./deployment-controller.js";
3
+ import type { PermissionController } from "./permission-controller.js";
4
+ import type { ConfigModule } from "./deployment-modules.js";
5
+ export type ConfigScope = "global" | "profile";
6
+ interface Destination {
7
+ scope: ConfigScope;
8
+ module: ConfigModule | null;
9
+ }
10
+ interface WorkspaceView extends Destination {
11
+ pending: Destination | null;
12
+ native: DeploymentController | null;
13
+ revision: number;
14
+ }
15
+ /** Contribution-owned memory only. Navigation never saves, applies, or rebases drafts. */
16
+ export declare class DeploymentWorkspace {
17
+ readonly core: DeploymentController;
18
+ readonly permissions?: PermissionController | undefined;
19
+ private state;
20
+ private listeners;
21
+ private forms;
22
+ private profiles;
23
+ private stopForm?;
24
+ private stopNative?;
25
+ private stopCore;
26
+ private stopPermissions?;
27
+ private identity;
28
+ private globalVersion?;
29
+ private sourceBlocked;
30
+ private attachCurrentForm?;
31
+ constructor(core: DeploymentController, permissions?: PermissionController | undefined);
32
+ readonly getSnapshot: () => WorkspaceView;
33
+ readonly subscribe: (listener: () => void) => (() => void);
34
+ private changed;
35
+ bindForms(forms: ConfigForms | null): void;
36
+ private sync;
37
+ controller(scope?: ConfigScope): DeploymentController | null;
38
+ hasPending(): boolean;
39
+ request(destination: Destination): void;
40
+ continueEditing(): void;
41
+ keepAndNavigate(): void;
42
+ discardAndNavigate(): Promise<void>;
43
+ save(): Promise<void>;
44
+ dispose(): void;
45
+ }
46
+ export declare function deploymentWorkspace(core: DeploymentController, permissions?: PermissionController): DeploymentWorkspace;
47
+ export {};
48
+ //# sourceMappingURL=deployment-workspace.d.ts.map
@@ -0,0 +1,123 @@
1
+ /** Contribution-owned memory only. Navigation never saves, applies, or rebases drafts. */
2
+ export class DeploymentWorkspace {
3
+ core;
4
+ permissions;
5
+ state = { scope: "global", module: null, pending: null, native: null, revision: 0 };
6
+ listeners = new Set();
7
+ forms = null;
8
+ profiles = new Map();
9
+ stopForm;
10
+ stopNative;
11
+ stopCore;
12
+ stopPermissions;
13
+ identity = null;
14
+ globalVersion;
15
+ sourceBlocked = false;
16
+ attachCurrentForm;
17
+ constructor(core, permissions) {
18
+ this.core = core;
19
+ this.permissions = permissions;
20
+ this.stopCore = core.subscribe(() => { this.sync(); this.changed(); });
21
+ this.stopPermissions = permissions?.store.subscribe(() => this.changed());
22
+ this.sync();
23
+ }
24
+ getSnapshot = () => this.state;
25
+ subscribe = (listener) => { this.listeners.add(listener); return () => this.listeners.delete(listener); };
26
+ changed(patch = {}) { this.state = { ...this.state, ...patch, revision: this.state.revision + 1 }; for (const listener of this.listeners)
27
+ listener(); }
28
+ bindForms(forms) { if (this.forms === forms)
29
+ return; this.forms = forms; this.identity = null; this.sync(); this.changed(); }
30
+ sync() {
31
+ const snapshot = this.core.getSnapshot().snapshot;
32
+ const issue = this.core.getSnapshot().issue, blocked = issue === "unavailable" || issue === "not-owned" || issue === "transport", restored = this.sourceBlocked && !blocked;
33
+ this.sourceBlocked = blocked;
34
+ const key = snapshot?.namespace == null ? null : JSON.stringify([snapshot.hostProfileKey, snapshot.entryId, snapshot.namespace]);
35
+ const changedGlobal = snapshot?.globalRevision !== this.globalVersion;
36
+ this.globalVersion = snapshot?.globalRevision;
37
+ if (key === this.identity) {
38
+ if (blocked)
39
+ this.state.native?.attachForm(null);
40
+ else if (restored)
41
+ this.attachCurrentForm?.();
42
+ if (!blocked && changedGlobal && this.state.native !== null && !this.state.native.getSnapshot().busy)
43
+ void this.state.native.refresh();
44
+ return;
45
+ }
46
+ this.identity = key;
47
+ this.stopForm?.();
48
+ this.stopNative?.();
49
+ this.attachCurrentForm = undefined;
50
+ let native = null;
51
+ if (key !== null && snapshot !== null) {
52
+ native = this.profiles.get(key) ?? this.core.forProfile(snapshot.namespace);
53
+ this.profiles.set(key, native);
54
+ this.stopNative = native.subscribe(() => this.changed());
55
+ if (this.forms !== null) {
56
+ const form = this.forms.get(snapshot.namespace);
57
+ const attach = () => { native.attachForm(this.sourceBlocked ? null : { state: form.getSnapshot(), mutate: (ops, revision) => form.mutate(ops, revision) }); this.changed(); if (!this.sourceBlocked && !native.getSnapshot().busy)
58
+ void native.refresh(); };
59
+ this.attachCurrentForm = attach;
60
+ this.stopForm = form.subscribe(attach);
61
+ attach();
62
+ }
63
+ else
64
+ native.attachForm(null);
65
+ if (native.getSnapshot().snapshot === null)
66
+ void native.refresh();
67
+ }
68
+ this.changed({ native });
69
+ }
70
+ controller(scope = this.state.scope) { return scope === "global" ? this.core : this.state.native; }
71
+ hasPending() { return this.controller()?.getSnapshot().dirty === true || this.state.module === "permissions" && this.permissions?.store.getSnapshot().dirty === true; }
72
+ request(destination) {
73
+ const switched = destination.scope !== this.state.scope;
74
+ const leaving = switched || this.state.module !== null && destination.module !== this.state.module;
75
+ if (leaving && this.hasPending())
76
+ this.changed({ pending: destination });
77
+ else {
78
+ this.changed({ ...destination, pending: null });
79
+ if (switched)
80
+ void this.controller()?.refresh();
81
+ }
82
+ }
83
+ continueEditing() { this.changed({ pending: null }); }
84
+ keepAndNavigate() { const target = this.state.pending; if (target !== null) {
85
+ const switched = target.scope !== this.state.scope;
86
+ this.changed({ ...target, pending: null });
87
+ if (switched)
88
+ void this.controller()?.refresh();
89
+ } }
90
+ async discardAndNavigate() {
91
+ const destination = this.state.pending;
92
+ if (destination === null)
93
+ return;
94
+ const controller = this.controller();
95
+ if (controller?.getSnapshot().dirty) {
96
+ await controller.refresh(true);
97
+ if (controller.getSnapshot().dirty || controller.getSnapshot().issue !== null)
98
+ return;
99
+ }
100
+ if (this.state.module === "permissions" && this.permissions?.store.getSnapshot().dirty) {
101
+ await this.permissions.refresh(this.permissions.store.getSnapshot().generation, true);
102
+ if (this.permissions.store.getSnapshot().dirty)
103
+ return;
104
+ }
105
+ if (this.state.pending === destination)
106
+ this.changed({ ...destination, pending: null });
107
+ }
108
+ async save() { const controller = this.controller(); if (controller === null)
109
+ return; await controller.save(); if (controller !== this.core && controller.getSnapshot().saved)
110
+ await this.core.refresh(); }
111
+ dispose() { this.stopCore(); this.stopForm?.(); this.stopNative?.(); this.stopPermissions?.(); for (const controller of this.profiles.values())
112
+ controller.dispose(); this.listeners.clear(); }
113
+ }
114
+ const workspaces = new WeakMap();
115
+ export function deploymentWorkspace(core, permissions) {
116
+ let workspace = workspaces.get(core);
117
+ if (workspace === undefined) {
118
+ workspace = new DeploymentWorkspace(core, permissions);
119
+ workspaces.set(core, workspace);
120
+ }
121
+ return workspace;
122
+ }
123
+ //# sourceMappingURL=deployment-workspace.js.map
@@ -0,0 +1,29 @@
1
+ import type { DsmmHistoryRemote } from "../history-remote.js";
2
+ import type { HistoryChoices, HistoryFailure, HistoryPreview, HistoryStatus } from "../history-types.js";
3
+ export interface HistoryClientSnapshot {
4
+ sessionId: string | null;
5
+ phase: "disconnected" | "loading" | "ready" | "previewing" | "confirming" | "unknown";
6
+ status: HistoryStatus | null;
7
+ choices: HistoryChoices | null;
8
+ preview: HistoryPreview | null;
9
+ issue: HistoryFailure | null;
10
+ }
11
+ /** Connection/session generation fences for continuation only; native history and composer stay authoritative. */
12
+ export declare class HistoryContinuationController {
13
+ private scope;
14
+ private state;
15
+ private request;
16
+ private disposed;
17
+ private readonly listeners;
18
+ readonly getSnapshot: () => HistoryClientSnapshot;
19
+ readonly subscribe: (listener: () => void) => (() => void);
20
+ private publish;
21
+ bind(remote: DsmmHistoryRemote | undefined, connection: object | undefined, sessionId: string | null, owner?: object): void;
22
+ /** Observed compatibility only, never a pre-follow navigation or write-admission guard. */
23
+ get historyBrowsingAllowed(): boolean;
24
+ dispose(): void;
25
+ refresh(expected: HistoryClientSnapshot): Promise<void>;
26
+ preview(expected: HistoryClientSnapshot, preset: string, profileId: string | null): Promise<void>;
27
+ confirm(expected: HistoryClientSnapshot, processPending: boolean, acceptMigration: boolean): Promise<void>;
28
+ }
29
+ //# sourceMappingURL=history-controller.d.ts.map
@@ -0,0 +1,111 @@
1
+ import { parseHistoryChoices, parseHistoryFailure, parseHistoryPreview, parseHistoryResult, parseHistoryStatus } from "../history-codec.js";
2
+ function initial(sessionId = null) { return { sessionId, phase: sessionId === null ? "disconnected" : "loading", status: null, choices: null, preview: null, issue: null }; }
3
+ function value(result, parse) { if (result.ok)
4
+ return parse(result.value); throw result.error; }
5
+ function failure(error, confirming = false) {
6
+ if (error && typeof error === "object" && Reflect.get(error, "code") === "dsmm-history/refused") {
7
+ try {
8
+ return parseHistoryFailure(Reflect.get(error, "details"));
9
+ }
10
+ catch { /* Unknown wire errors cannot authorize a retry. */ }
11
+ }
12
+ return { code: "unavailable", storageEffects: confirming ? "may-have-committed" : "none" };
13
+ }
14
+ /** Connection/session generation fences for continuation only; native history and composer stay authoritative. */
15
+ export class HistoryContinuationController {
16
+ scope;
17
+ state = initial();
18
+ request;
19
+ disposed = false;
20
+ listeners = new Set();
21
+ getSnapshot = () => this.state;
22
+ subscribe = (listener) => { this.listeners.add(listener); return () => this.listeners.delete(listener); };
23
+ publish(next) { this.state = next; for (const listener of this.listeners)
24
+ listener(); }
25
+ bind(remote, connection, sessionId, owner) {
26
+ if (this.disposed)
27
+ return;
28
+ if (this.scope?.remote === remote && this.scope?.connection === connection && this.scope?.sessionId === sessionId && this.scope?.owner === owner)
29
+ return;
30
+ if (!this.scope && (!remote || !connection || !sessionId) && this.state.sessionId === sessionId && this.state.phase === "disconnected")
31
+ return;
32
+ this.scope = remote && connection && sessionId ? { remote, connection, sessionId, owner } : undefined;
33
+ const scope = this.scope;
34
+ this.request = undefined;
35
+ this.publish({ ...initial(sessionId), phase: this.scope ? "loading" : "disconnected" });
36
+ if (scope && this.scope === scope)
37
+ void this.refresh(this.state);
38
+ }
39
+ /** Observed compatibility only, never a pre-follow navigation or write-admission guard. */
40
+ get historyBrowsingAllowed() { return this.state.status?.compatibleHost === true; }
41
+ dispose() { this.scope = undefined; this.request = undefined; this.disposed = true; this.listeners.clear(); }
42
+ async refresh(expected) {
43
+ const scope = this.scope;
44
+ if (!scope || this.state !== expected || this.state.phase === "confirming")
45
+ return;
46
+ const request = this.request = {};
47
+ this.publish({ ...this.state, phase: "loading", preview: null, issue: null });
48
+ if (this.scope !== scope || this.request !== request)
49
+ return;
50
+ try {
51
+ const status = value(await scope.remote.describe(scope.sessionId), parseHistoryStatus);
52
+ if (this.scope !== scope || this.request !== request)
53
+ return;
54
+ if (status.sessionId !== scope.sessionId)
55
+ throw new TypeError("Mismatched history response");
56
+ const choices = status.execution === "authorization-required" ? value(await scope.remote.choices(), parseHistoryChoices) : null;
57
+ if (this.scope !== scope || this.request !== request)
58
+ return;
59
+ this.publish({ sessionId: scope.sessionId, phase: "ready", status, choices, preview: null, issue: null });
60
+ }
61
+ catch (error) {
62
+ if (this.scope === scope && this.request === request)
63
+ this.publish({ ...this.state, phase: "ready", issue: failure(error), preview: null });
64
+ }
65
+ }
66
+ async preview(expected, preset, profileId) {
67
+ const scope = this.scope;
68
+ if (!scope || this.state !== expected || expected.phase !== "ready" || expected.status?.execution !== "authorization-required" || !expected.status.compatibleHost)
69
+ return;
70
+ const request = this.request = {};
71
+ this.publish({ ...this.state, phase: "previewing", preview: null, issue: null });
72
+ if (this.scope !== scope || this.request !== request)
73
+ return;
74
+ try {
75
+ const preview = value(await scope.remote.preview(scope.sessionId, { sessionId: scope.sessionId, preset, profileId }), parseHistoryPreview);
76
+ if (this.scope !== scope || this.request !== request)
77
+ return;
78
+ if (preview.sessionId !== scope.sessionId || preview.candidate.preset.id !== preset || (preview.candidate.profile?.id ?? null) !== profileId)
79
+ throw new TypeError("Mismatched continuation proposal");
80
+ this.publish({ ...this.state, phase: "ready", preview });
81
+ }
82
+ catch (error) {
83
+ if (this.scope === scope && this.request === request)
84
+ this.publish({ ...this.state, phase: "ready", issue: failure(error), preview: null });
85
+ }
86
+ }
87
+ async confirm(expected, processPending, acceptMigration) {
88
+ const scope = this.scope, preview = expected.preview;
89
+ if (!scope || this.state !== expected || expected.phase !== "ready" || !preview || !processPending || preview.migrationRequired && !acceptMigration)
90
+ return;
91
+ const request = this.request = {};
92
+ this.publish({ ...this.state, phase: "confirming", issue: null });
93
+ if (this.scope !== scope || this.request !== request)
94
+ return;
95
+ try {
96
+ const receipt = value(await scope.remote.confirm(scope.sessionId, { sessionId: scope.sessionId, intentId: preview.intentId, processPending, acceptMigration }), parseHistoryResult);
97
+ if (this.scope !== scope || this.request !== request)
98
+ return;
99
+ if (receipt.sessionId !== scope.sessionId)
100
+ throw new TypeError("Mismatched continuation receipt");
101
+ this.publish({ ...this.state, phase: "ready", preview: null, status: { sessionId: scope.sessionId, readable: "readable", compatibleHost: true, execution: "active" } });
102
+ }
103
+ catch (error) {
104
+ if (this.scope !== scope || this.request !== request)
105
+ return;
106
+ const issue = failure(error, true);
107
+ this.publish({ ...this.state, phase: issue.storageEffects === "may-have-committed" ? "unknown" : "ready", preview: null, issue });
108
+ }
109
+ }
110
+ }
111
+ //# sourceMappingURL=history-controller.js.map
@@ -0,0 +1,11 @@
1
+ import type { Context } from "@deepseek-ai/cordis";
2
+ import type { LocaleRuntime } from "@deepseek-ai/dsh-client-locale/client";
3
+ import { HistoryContinuationController } from "./history-controller.js";
4
+ export declare function HistoryContinuationEntry({ controller, locale, sessionId }: {
5
+ controller: HistoryContinuationController;
6
+ locale: LocaleRuntime;
7
+ sessionId: string;
8
+ }): import("react").JSX.Element | null;
9
+ /** Read-only native binding observer; Host admission owns all history activation. */
10
+ export declare function registerHistoryContinuation(ctx: Context): void;
11
+ //# sourceMappingURL=history-entry.d.ts.map