@dsmm/dsmm 0.2.2 → 0.3.1

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 (182) hide show
  1. package/README.md +26 -42
  2. package/cordis.patch.yml +1 -0
  3. package/docs/agent-presets.md +26 -14
  4. package/docs/compatibility.md +20 -79
  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 +34 -240
  13. package/docs/roadmap.md +23 -254
  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 +16 -2
  20. package/lib/child-capture.js +29 -10
  21. package/lib/client/ChildrenPanel.d.ts +1 -4
  22. package/lib/client/ChildrenPanel.js +4 -16
  23. package/lib/client/DeploymentFields.d.ts +28 -0
  24. package/lib/client/DeploymentFields.js +68 -0
  25. package/lib/client/DeploymentPage.d.ts +17 -5
  26. package/lib/client/DeploymentPage.js +79 -112
  27. package/lib/client/NativeCommandEntries.d.ts +17 -0
  28. package/lib/client/NativeCommandEntries.js +68 -0
  29. package/lib/client/PermissionsPanel.d.ts +1 -1
  30. package/lib/client/PermissionsPanel.js +8 -8
  31. package/lib/client/ProfilesSection.js +7 -5
  32. package/lib/client/RoleToolView-data.d.ts +35 -0
  33. package/lib/client/RoleToolView-data.js +52 -0
  34. package/lib/client/RoleToolView-locales.d.ts +36 -0
  35. package/lib/client/RoleToolView-locales.js +20 -0
  36. package/lib/client/RoleToolView.d.ts +10 -0
  37. package/lib/client/RoleToolView.js +47 -0
  38. package/lib/client/SessionProfiles.js +39 -15
  39. package/lib/client/children-controller.d.ts +2 -8
  40. package/lib/client/children-controller.js +1 -26
  41. package/lib/client/children-locales.d.ts +26 -51
  42. package/lib/client/children-locales.js +8 -12
  43. package/lib/client/configuration-display.d.ts +5 -0
  44. package/lib/client/configuration-display.js +11 -0
  45. package/lib/client/controller.d.ts +1 -0
  46. package/lib/client/controller.js +20 -13
  47. package/lib/client/deployment-controller.d.ts +13 -1
  48. package/lib/client/deployment-controller.js +85 -25
  49. package/lib/client/deployment-data.d.ts +1 -0
  50. package/lib/client/deployment-data.js +4 -1
  51. package/lib/client/deployment-locales.d.ts +43 -0
  52. package/lib/client/deployment-locales.js +35 -9
  53. package/lib/client/deployment-modules.d.ts +9 -0
  54. package/lib/client/deployment-modules.js +24 -0
  55. package/lib/client/deployment-workspace.d.ts +48 -0
  56. package/lib/client/deployment-workspace.js +123 -0
  57. package/lib/client/index.js +11 -74
  58. package/lib/client/locales.d.ts +7 -0
  59. package/lib/client/locales.js +12 -6
  60. package/lib/client/permission-controller.d.ts +1 -0
  61. package/lib/client/permission-controller.js +3 -2
  62. package/lib/client/permission-locales.d.ts +25 -0
  63. package/lib/client/permission-locales.js +24 -4
  64. package/lib/client/session-labels.js +4 -3
  65. package/lib/client/styles.d.ts +1 -1
  66. package/lib/client/styles.js +9 -8
  67. package/lib/client.js +2716 -2364
  68. package/lib/commands.js +2 -0
  69. package/lib/config-file-store.d.ts +3 -0
  70. package/lib/config-file-store.js +4 -2
  71. package/lib/config-revision.d.ts +5 -0
  72. package/lib/config-revision.js +11 -0
  73. package/lib/core-permission-authority.js +11 -41
  74. package/lib/deployment-config.d.ts +9 -2
  75. package/lib/deployment-config.js +35 -8
  76. package/lib/deployment-permission-rules.js +19 -7
  77. package/lib/dsh-types.d.ts +1 -1
  78. package/lib/host-llm-startup.js +3 -3
  79. package/lib/host-llm.d.ts +9 -3
  80. package/lib/host-llm.js +48 -8
  81. package/lib/index.d.ts +17 -21
  82. package/lib/index.js +131 -430
  83. package/lib/lifetime.d.ts +4 -0
  84. package/lib/lifetime.js +22 -0
  85. package/lib/live-pi-ai-owner.d.ts +1 -0
  86. package/lib/live-pi-ai-owner.js +8 -4
  87. package/lib/mode.d.ts +3 -2
  88. package/lib/mode.js +28 -41
  89. package/lib/model-routing.d.ts +2 -8
  90. package/lib/model-routing.js +59 -175
  91. package/lib/native-admission.d.ts +56 -0
  92. package/lib/native-admission.js +313 -0
  93. package/lib/native-pi-ai-wire.d.ts +3 -1
  94. package/lib/native-pi-ai-wire.js +47 -13
  95. package/lib/permission-control.d.ts +0 -3
  96. package/lib/permission-rpc.js +3 -3
  97. package/lib/preset-registry.js +3 -2
  98. package/lib/preset-skills.d.ts +3 -12
  99. package/lib/preset-skills.js +28 -58
  100. package/lib/profile-diagnostics.d.ts +1 -1
  101. package/lib/profile-diagnostics.js +2 -2
  102. package/lib/profile-remote.js +61 -22
  103. package/lib/profile-rpc.d.ts +4 -3
  104. package/lib/profile-rpc.js +39 -41
  105. package/lib/profile-runtime.d.ts +31 -74
  106. package/lib/profile-runtime.js +224 -639
  107. package/lib/profile-store.d.ts +18 -6
  108. package/lib/profile-store.js +106 -64
  109. package/lib/profile-types.d.ts +18 -4
  110. package/lib/profiles.d.ts +3 -1
  111. package/lib/profiles.js +9 -7
  112. package/lib/prompt-content.d.ts +1 -0
  113. package/lib/prompt-content.js +4 -1
  114. package/lib/prompts.d.ts +2 -12
  115. package/lib/prompts.js +11 -66
  116. package/lib/role-control-remote.d.ts +1 -4
  117. package/lib/role-control-remote.js +8 -36
  118. package/lib/role-control-rpc.d.ts +10 -36
  119. package/lib/role-control-rpc.js +112 -265
  120. package/lib/role-control-types.d.ts +3 -26
  121. package/lib/role-control-types.js +3 -4
  122. package/lib/role-identity.d.ts +5 -0
  123. package/lib/role-identity.js +10 -0
  124. package/lib/role-invocation.d.ts +2 -2
  125. package/lib/role-llm-runtime.js +5 -11
  126. package/lib/role-policy.d.ts +19 -53
  127. package/lib/role-policy.js +136 -525
  128. package/lib/role-providers.d.ts +5 -8
  129. package/lib/role-providers.js +20 -126
  130. package/lib/role-routing.d.ts +1 -3
  131. package/lib/role-routing.js +24 -34
  132. package/lib/role-subagents.d.ts +5 -14
  133. package/lib/role-subagents.js +149 -97
  134. package/lib/runtime-integration.d.ts +5 -109
  135. package/lib/runtime-integration.js +11 -779
  136. package/lib/session-metadata.d.ts +13 -12
  137. package/lib/session-metadata.js +6 -31
  138. package/lib/session-scope.js +6 -2
  139. package/lib/settings.d.ts +5 -18
  140. package/lib/settings.js +19 -43
  141. package/lib/state.d.ts +3 -2
  142. package/lib/state.js +26 -10
  143. package/lib/status.d.ts +1 -9
  144. package/lib/status.js +3 -55
  145. package/lib/web-fetch-address-policy.d.ts +24 -0
  146. package/lib/web-fetch-address-policy.js +189 -0
  147. package/lib/web-fetch-fakeip.d.ts +25 -0
  148. package/lib/web-fetch-fakeip.js +107 -0
  149. package/package.json +133 -113
  150. package/docs/research/deepseek-v4-pro.md +0 -74
  151. package/docs/research/oh-dsh.md +0 -96
  152. package/lib/child-admission.d.ts +0 -42
  153. package/lib/child-admission.js +0 -162
  154. package/lib/delivery-authority.d.ts +0 -68
  155. package/lib/delivery-authority.js +0 -260
  156. package/lib/legacy-child-policy.d.ts +0 -51
  157. package/lib/legacy-child-policy.js +0 -123
  158. package/lib/legacy-read-composition.d.ts +0 -20
  159. package/lib/legacy-read-composition.js +0 -144
  160. package/lib/legacy-read-contracts.d.ts +0 -157
  161. package/lib/legacy-read-contracts.js +0 -39
  162. package/lib/legacy-read-host.d.ts +0 -19
  163. package/lib/legacy-read-host.js +0 -67
  164. package/lib/legacy-read-integration.d.ts +0 -121
  165. package/lib/legacy-read-integration.js +0 -522
  166. package/lib/legacy-read-proxy.d.ts +0 -26
  167. package/lib/legacy-read-proxy.js +0 -237
  168. package/lib/native-child-evidence.d.ts +0 -42
  169. package/lib/native-child-evidence.js +0 -133
  170. package/lib/role-runs.d.ts +0 -135
  171. package/lib/role-runs.js +0 -304
  172. package/lib/session-persistence.d.ts +0 -35
  173. package/lib/session-persistence.js +0 -304
  174. package/lib/subagent-runtime.d.ts +0 -45
  175. package/lib/subagent-runtime.js +0 -131
  176. package/prompts/deepseek-flash.md +0 -11
  177. package/prompts/deepseek-v4-pro.md +0 -14
  178. package/scripts/cold-profile-composition.mjs +0 -329
  179. package/scripts/cold-profile-sources.mjs +0 -238
  180. package/scripts/migrate-cold-profile.mjs +0 -315
  181. package/scripts/repair-session-log.mjs +0 -476
  182. package/scripts/session-repair-native-verifier.mjs +0 -367
@@ -1,7 +1,6 @@
1
1
  import { ROLE_CONTROL_REMOTE, parseChildSessionSnapshot, parseRoleControlDescendants, parseRoleControlErrorInfo, parseRoleControlPromptRequest } from "../role-control-remote.js";
2
2
  export const EMPTY_CHILD_DRAFT = { text: "", delivery: "queue", images: [], imageBusy: false, uncertain: false };
3
3
  export const childActionKey = (childId) => `child:${childId}`;
4
- export const runActionKey = (toolCallId, runId) => `run:${JSON.stringify([toolCallId, runId])}`;
5
4
  export function enabled(availability) { return availability?.enabled === true; }
6
5
  class ControlFailure extends Error {
7
6
  safe;
@@ -26,7 +25,7 @@ export class ChildrenController {
26
25
  subscribe: (listener) => { this.listeners.add(listener); return () => { this.listeners.delete(listener); }; },
27
26
  };
28
27
  actions = {
29
- refresh: generation => this.refresh(generation), background: (generation, call, run) => this.background(generation, call, run),
28
+ refresh: generation => this.refresh(generation),
30
29
  prompt: (generation, child) => this.prompt(generation, child), interrupt: (generation, child) => this.interrupt(generation, child),
31
30
  editText: (generation, child, text) => this.editDraft(generation, child, { text }),
32
31
  setDelivery: (generation, child, delivery) => this.editDraft(generation, child, { delivery }),
@@ -171,30 +170,6 @@ export class ChildrenController {
171
170
  finish(key) { const pending = new Map(this.current.pending); pending.delete(key); this.publish({ pending }); }
172
171
  refuse(key, error) { const issues = new Map(this.current.issues); issues.set(key, this.issue(error)); this.publish({ issues }); }
173
172
  accepted(key, outcome) { const outcomes = new Map(this.current.outcomes); outcomes.set(key, outcome); this.publish({ outcomes }); }
174
- async background(generation, toolCallId, runId) {
175
- const key = runActionKey(toolCallId, runId), snapshot = this.current.snapshot;
176
- const run = snapshot?.runs.find(row => row.toolCallId === toolCallId && row.invocation?.runId === runId);
177
- if (!this.available(generation) || this.current.pending.has(key) || this.current.outcomes.get(key)?.kind === "background"
178
- || run?.state !== "running" || !enabled(run.background) || !enabled(snapshot?.capabilities.background))
179
- return;
180
- this.begin(key, "background");
181
- try {
182
- const receipt = await this.unwrap("background", () => this.remote.background(snapshot.sessionId, { sessionId: snapshot.sessionId, toolCallId, runId, expectedAdmissionEpoch: snapshot.admissionEpoch }));
183
- if (!this.live(generation))
184
- return;
185
- if (receipt.runId !== runId)
186
- throw new ControlFailure({ kind: "protocol", code: "conflict", unknown: true });
187
- this.accepted(key, { kind: "background", receipt });
188
- }
189
- catch (error) {
190
- if (this.live(generation))
191
- this.refuse(key, error);
192
- }
193
- finally {
194
- if (this.live(generation))
195
- this.finish(key);
196
- }
197
- }
198
173
  canControl(generation, id, action) {
199
174
  const child = this.child(id);
200
175
  return this.available(generation) && !this.current.pending.has(childActionKey(id)) && child?.mode === "continuable" && !child.readonly
@@ -22,8 +22,7 @@ export declare const childrenEn: {
22
22
  readonly runState: "Last observed run state";
23
23
  readonly activity: "Observed residency/activity (not completion)";
24
24
  readonly starting: "Starting: native invocation identity has not been published.";
25
- readonly background: "Move this run to background";
26
- readonly backgroundHint: "Hands this exact published run to native jobs; does not start another child.";
25
+ readonly backgroundHint: "Choose background delivery when starting a task. Running tasks cannot change delivery ownership. Cold children are inspection-only.";
27
26
  readonly role: "Role";
28
27
  readonly level: "Invocation level";
29
28
  readonly mode: "Mode";
@@ -63,7 +62,7 @@ export declare const childrenEn: {
63
62
  readonly steer: "Steer · nearest step";
64
63
  readonly send: "Send message";
65
64
  readonly interrupt: "Request interrupt";
66
- readonly deliveryHint: "Queue accepts a distinct later turn; Steer targets the nearest step. Idle/cold continuable children keep the same child ID.";
65
+ readonly deliveryHint: "Queue accepts a distinct later turn; Steer targets the nearest step of this live child. A receipt confirms acceptance, not execution.";
67
66
  readonly emptyMessage: "Enter message text or choose an available image before sending.";
68
67
  readonly deniedImages: "Images are currently unavailable. Remove picked images to send a text-only message; their bytes are not automatically retried.";
69
68
  readonly images: "Add images";
@@ -85,11 +84,9 @@ export declare const childrenEn: {
85
84
  readonly imageAvailability: "Images";
86
85
  readonly enabled: "Available";
87
86
  readonly disabled: "Unavailable";
88
- readonly runtime: "Observed runtime binding";
89
- readonly fence: "Delivery fence ready";
87
+ readonly runtime: "Observed native runtime";
88
+ readonly fence: "Execution admission ready";
90
89
  readonly restart: "Explicit Host restart required";
91
- readonly composition: "Explicit DSMM composition is required; UI settings do not replace the Host runtime.";
92
- readonly duplicate: "Duplicate provider binding; fix explicit composition before restarting.";
93
90
  readonly authority: "Host admission authority is not ready.";
94
91
  readonly evidence: "Admission evidence";
95
92
  readonly captured: "Captured original admission";
@@ -113,21 +110,13 @@ export declare const childDisabledCopy: Record<RoleControlDisabledReason, readon
113
110
  export type ChildrenLocaleKey = keyof typeof childrenEn | `reason:${RoleControlDisabledReason}`;
114
111
  export declare const childrenLocaleEn: {
115
112
  "reason:unavailable": string;
116
- "reason:cancelled": string;
117
- "reason:starting": string;
118
- "reason:one-shot": string;
119
- "reason:already-background": string;
120
- "reason:already-settled": string;
121
113
  "reason:read-only": string;
114
+ "reason:one-shot": string;
122
115
  "reason:module-off": string;
123
- "reason:evidence-unavailable": string;
124
116
  "reason:role-disabled": string;
125
- "reason:background-disabled": string;
126
- "reason:jobs-unavailable": string;
127
117
  "reason:unknown-mode": string;
128
118
  "reason:not-direct-child": string;
129
- "reason:delivery-fence-unavailable": string;
130
- "reason:legacy-capability-denied": string;
119
+ "reason:evidence-unavailable": string;
131
120
  title: "Deepwork children";
132
121
  description: "Observed native runs and child conversations. Refresh for current state; receipts are not completion.";
133
122
  refresh: "Refresh";
@@ -149,8 +138,7 @@ export declare const childrenLocaleEn: {
149
138
  runState: "Last observed run state";
150
139
  activity: "Observed residency/activity (not completion)";
151
140
  starting: "Starting: native invocation identity has not been published.";
152
- background: "Move this run to background";
153
- backgroundHint: "Hands this exact published run to native jobs; does not start another child.";
141
+ backgroundHint: "Choose background delivery when starting a task. Running tasks cannot change delivery ownership. Cold children are inspection-only.";
154
142
  role: "Role";
155
143
  level: "Invocation level";
156
144
  mode: "Mode";
@@ -190,7 +178,7 @@ export declare const childrenLocaleEn: {
190
178
  steer: "Steer · nearest step";
191
179
  send: "Send message";
192
180
  interrupt: "Request interrupt";
193
- deliveryHint: "Queue accepts a distinct later turn; Steer targets the nearest step. Idle/cold continuable children keep the same child ID.";
181
+ deliveryHint: "Queue accepts a distinct later turn; Steer targets the nearest step of this live child. A receipt confirms acceptance, not execution.";
194
182
  emptyMessage: "Enter message text or choose an available image before sending.";
195
183
  deniedImages: "Images are currently unavailable. Remove picked images to send a text-only message; their bytes are not automatically retried.";
196
184
  images: "Add images";
@@ -212,11 +200,9 @@ export declare const childrenLocaleEn: {
212
200
  imageAvailability: "Images";
213
201
  enabled: "Available";
214
202
  disabled: "Unavailable";
215
- runtime: "Observed runtime binding";
216
- fence: "Delivery fence ready";
203
+ runtime: "Observed native runtime";
204
+ fence: "Execution admission ready";
217
205
  restart: "Explicit Host restart required";
218
- composition: "Explicit DSMM composition is required; UI settings do not replace the Host runtime.";
219
- duplicate: "Duplicate provider binding; fix explicit composition before restarting.";
220
206
  authority: "Host admission authority is not ready.";
221
207
  evidence: "Admission evidence";
222
208
  captured: "Captured original admission";
@@ -237,23 +223,14 @@ export declare const childrenLocaleEn: {
237
223
  };
238
224
  export declare const childrenLocaleZh: {
239
225
  "reason:unavailable": string;
240
- "reason:cancelled": string;
241
- "reason:starting": string;
242
- "reason:one-shot": string;
243
- "reason:already-background": string;
244
- "reason:already-settled": string;
245
226
  "reason:read-only": string;
227
+ "reason:one-shot": string;
246
228
  "reason:module-off": string;
247
- "reason:evidence-unavailable": string;
248
229
  "reason:role-disabled": string;
249
- "reason:background-disabled": string;
250
- "reason:jobs-unavailable": string;
251
230
  "reason:unknown-mode": string;
252
231
  "reason:not-direct-child": string;
253
- "reason:delivery-fence-unavailable": string;
254
- "reason:legacy-capability-denied": string;
232
+ "reason:evidence-unavailable": string;
255
233
  text: string;
256
- authority: string;
257
234
  error: string;
258
235
  disabled: string;
259
236
  unavailable: string;
@@ -263,14 +240,8 @@ export declare const childrenLocaleZh: {
263
240
  session: string;
264
241
  field: string;
265
242
  unknown: string;
266
- starting: string;
267
- background: string;
268
- jobId: string;
269
- toolCallId: string;
270
- runId: string;
271
- mode: string;
272
- childId: string;
273
243
  stale: string;
244
+ mode: string;
274
245
  prompt: string;
275
246
  captured: string;
276
247
  level: string;
@@ -281,33 +252,36 @@ export declare const childrenLocaleZh: {
281
252
  initialRoute: string;
282
253
  routeSource: string;
283
254
  description: string;
284
- evidence: string;
285
255
  epoch: string;
256
+ runId: string;
257
+ childId: string;
258
+ jobId: string;
259
+ pending: string;
286
260
  yes: string;
287
261
  no: string;
262
+ activity: string;
263
+ runtime: string;
264
+ images: string;
265
+ title: string;
288
266
  liveRoute: string;
289
- pending: string;
290
267
  descendants: string;
291
268
  interrupt: string;
292
- images: string;
293
- runtime: string;
294
- activity: string;
295
269
  readonly: string;
296
- runs: string;
297
270
  children: string;
298
271
  delivery: string;
299
272
  queue: string;
300
273
  steer: string;
301
274
  foreign: string;
302
275
  reading: string;
303
- title: string;
304
276
  refresh: string;
305
277
  noSession: string;
278
+ runs: string;
306
279
  emptyRuns: string;
307
280
  emptyChildren: string;
308
281
  emptyDescendants: string;
309
282
  treeUnavailable: string;
310
283
  runState: string;
284
+ starting: string;
311
285
  backgroundHint: string;
312
286
  reportedRoute: string;
313
287
  routeUnreported: string;
@@ -324,6 +298,7 @@ export declare const childrenLocaleZh: {
324
298
  routeInvalidOwnHeader: string;
325
299
  routeNotObserved: string;
326
300
  invocationUnavailable: string;
301
+ toolCallId: string;
327
302
  parentId: string;
328
303
  subtree: string;
329
304
  oneShot: string;
@@ -345,8 +320,8 @@ export declare const childrenLocaleZh: {
345
320
  imageAvailability: string;
346
321
  fence: string;
347
322
  restart: string;
348
- composition: string;
349
- duplicate: string;
323
+ authority: string;
324
+ evidence: string;
350
325
  evidenceMissing: string;
351
326
  originalEpoch: string;
352
327
  proven: string;
@@ -6,7 +6,7 @@ export const childrenEn = {
6
6
  session: "Session", epoch: "Parent admission epoch", runs: "One-shot runs", children: "Direct children", descendants: "Descendant inspection",
7
7
  emptyRuns: "No observed runs.", emptyChildren: "No observed direct children.", emptyDescendants: "No observed descendants.", treeUnavailable: "Descendants unavailable; this is not an empty successful listing.",
8
8
  runState: "Last observed run state", activity: "Observed residency/activity (not completion)", starting: "Starting: native invocation identity has not been published.",
9
- background: "Move this run to background", backgroundHint: "Hands this exact published run to native jobs; does not start another child.",
9
+ backgroundHint: "Choose background delivery when starting a task. Running tasks cannot change delivery ownership. Cold children are inspection-only.",
10
10
  role: "Role", level: "Invocation level", mode: "Mode", reportedRoute: "Reported invocation route · compatibility projection, not comparison", routeSource: "Invocation route source · compatibility projection", routeUnreported: "Not reported; no root-route inference.",
11
11
  initialRoute: "Initial route", liveRoute: "Latest own native request route", routeUnknown: "Unknown", initialRouteSource: "Initial route source", liveRouteSource: "Latest request route source", initialRouteReason: "Initial route unknown reason", liveRouteReason: "Latest request route unknown reason",
12
12
  comparisonUnobserved: "Route comparison has not been observed. No initial or latest request route is inferred.", routeCaptureSource: "Original invocation capture", routeOwnHeaderSource: "This child's own native request header",
@@ -15,14 +15,14 @@ export const childrenEn = {
15
15
  runId: "Run ID", childId: "Child ID", jobId: "Job ID", toolCallId: "Tool call ID", parentId: "Direct parent ID", depth: "Depth", subtree: "Child catalog contains descendants", yes: "Yes", no: "No",
16
16
  readonly: "Inspection only", oneShot: "One-shot children cannot be resumed or messaged.",
17
17
  prompt: "Message this child", text: "Message", delivery: "Delivery", queue: "Queue · later turn", steer: "Steer · nearest step", send: "Send message", interrupt: "Request interrupt",
18
- deliveryHint: "Queue accepts a distinct later turn; Steer targets the nearest step. Idle/cold continuable children keep the same child ID.",
18
+ deliveryHint: "Queue accepts a distinct later turn; Steer targets the nearest step of this live child. A receipt confirms acceptance, not execution.",
19
19
  emptyMessage: "Enter message text or choose an available image before sending.", deniedImages: "Images are currently unavailable. Remove picked images to send a text-only message; their bytes are not automatically retried.",
20
20
  images: "Add images", imagesHint: "PNG, JPEG, WebP or GIF body bytes. Native image/model admission still applies; no durable attachment IDs are supplied.", removeImage: "Remove image", imageReading: "Reading image bytes…",
21
21
  unknown: "Send outcome unknown. Draft retained; do not resend automatically. Check the native child conversation before allowing a new message, which may duplicate an accepted one.",
22
22
  acknowledge: "I checked; allow a new message", promptAccepted: "Inbox accepted message {id}. Execution is not confirmed.", interruptAccepted: "Interrupt request acknowledged. Running/queued work is not reported as completed; queued work remains native-owned.",
23
23
  backgroundReceipt: "Transition receipt: {status}; same run {id}.", unknownAction: "Outcome unknown; refresh and verify the native run/child before another action.", error: "Request unavailable/refused: {code}.", field: "Field", diagnostic: "Branch diagnostic: {reason}; no successful child result is inferred.",
24
24
  backgroundAvailability: "Background handoff", promptAvailability: "Human messages", interruptAvailability: "Interrupts", imageAvailability: "Images", enabled: "Available", disabled: "Unavailable",
25
- runtime: "Observed runtime binding", fence: "Delivery fence ready", restart: "Explicit Host restart required", composition: "Explicit DSMM composition is required; UI settings do not replace the Host runtime.", duplicate: "Duplicate provider binding; fix explicit composition before restarting.", authority: "Host admission authority is not ready.",
25
+ runtime: "Observed native runtime", fence: "Execution admission ready", restart: "Explicit Host restart required", authority: "Host admission authority is not ready.",
26
26
  evidence: "Admission evidence", captured: "Captured original admission", legacy: "Legacy conservative evidence · not full configuration recovery", evidenceMissing: "Original admission evidence is unavailable; do not infer it from current root settings.", originalEpoch: "Original child epoch", proven: "Proven fields", limitations: "Evidence limitations", noneProven: "No proven fields reported", noLimitations: "No additional limitations reported (not a claim of restored configuration).",
27
27
  capabilityDenied: "Capability denied", nativeDefault: "Native default, not restored", displayOnly: "Display-only evidence", missingEvidence: "Missing evidence", notPersisted: "Not persisted", unverified: "Unverified", parentDenied: "Current parent denies this capability",
28
28
  };
@@ -33,7 +33,7 @@ export const childrenZh = {
33
33
  session: "会话", epoch: "当前父准入 epoch", runs: "一次性运行", children: "直接子会话", descendants: "后代检查",
34
34
  emptyRuns: "没有观察到运行。", emptyChildren: "没有观察到直接子会话。", emptyDescendants: "没有观察到后代。", treeUnavailable: "后代列表不可用;这不代表已成功读取空列表。",
35
35
  runState: "上次观察的运行状态", activity: "已观察驻留/活动状态(非完成)", starting: "正在启动:原生调用身份尚未发布。",
36
- background: "将此运行移交后台", backgroundHint: "把此已发布的同一运行移交原生 jobs;不创建另一个子会话。",
36
+ backgroundHint: "请在任务启动前选择后台投递;运行中不支持切换结果归属。冷子会话仅可检查。",
37
37
  role: "角色", level: "调用等级", mode: "模式", reportedRoute: "报告的调用路由 · 兼容投影,非路由对比", routeSource: "调用路由来源 · 兼容投影", routeUnreported: "未报告;不推断根会话路由。",
38
38
  initialRoute: "初始路由", liveRoute: "最近一次自身原生请求路由", routeUnknown: "未知", initialRouteSource: "初始路由来源", liveRouteSource: "最近请求路由来源", initialRouteReason: "初始路由未知原因", liveRouteReason: "最近请求路由未知原因",
39
39
  comparisonUnobserved: "尚未观察到路由对比,不推断初始或最近请求路由。", routeCaptureSource: "原始调用捕获", routeOwnHeaderSource: "此子会话自身的原生请求 header",
@@ -42,26 +42,22 @@ export const childrenZh = {
42
42
  runId: "Run ID", childId: "子会话 ID", jobId: "Job ID", toolCallId: "工具调用 ID", parentId: "直接父会话 ID", depth: "深度", subtree: "子会话目录含后代", yes: "是", no: "否",
43
43
  readonly: "仅可检查", oneShot: "一次性子会话不能恢复或接收续话。",
44
44
  prompt: "向此子会话发送消息", text: "消息内容", delivery: "投递方式", queue: "Queue · 后续独立轮次", steer: "Steer · 最近步骤边界", send: "发送消息", interrupt: "请求中断",
45
- deliveryHint: "Queue 接受新的后续轮次;Steer 在最近步骤边界接收。空闲/冷恢复的 continuable 子会话仍使用同一 ID。",
45
+ deliveryHint: "Queue 接受新的后续轮次;Steer 在当前 live 子会话最近步骤边界接收。回执只确认接受,不确认执行。",
46
46
  emptyMessage: "发送前请输入消息或选择可用图片。", deniedImages: "图片目前不可用。移除已选图片后可发送纯文本消息;不自动重试其数据。",
47
47
  images: "添加图片", imagesHint: "PNG、JPEG、WebP 或 GIF 的真实图片数据。仍由原生图片/模型准入校验;不提供虚构持久 attachment ID。", removeImage: "移除图片", imageReading: "正在读取图片数据…",
48
48
  unknown: "发送结果未知。保留草稿,不自动重发。允许新消息前请检查原生子会话;新发送可能重复已接受的消息。",
49
49
  acknowledge: "我已检查,允许新消息", promptAccepted: "收件箱已接受消息 {id};尚未确认执行。", interruptAccepted: "中断请求已确认,不表示运行或队列已完成;队列仍由原生系统管理。",
50
50
  backgroundReceipt: "移交回执:{status};同一运行 {id}。", unknownAction: "结果未知,请刷新并核实原生运行/子会话后再操作。", error: "请求不可用或被拒绝:{code}。", field: "字段", diagnostic: "分支诊断:{reason};不推断成功的子会话结果。",
51
51
  backgroundAvailability: "后台移交", promptAvailability: "用户消息", interruptAvailability: "中断", imageAvailability: "图片", enabled: "可用", disabled: "不可用",
52
- runtime: "已观察运行时绑定", fence: "投递隔离已就绪", restart: "需要显式重启 Host", composition: "需要显式 DSMM 启动组合;UI 设置不能替换 Host 运行时。", duplicate: "存在重复 provider 绑定,请修正显式启动组合后再重启。", authority: "Host 准入权威尚未就绪。",
52
+ runtime: "已观察原生运行时", fence: "执行准入已就绪", restart: "需要显式重启 Host", authority: "Host 准入权威尚未就绪。",
53
53
  evidence: "准入证据", captured: "已捕获原始准入", legacy: "旧会话保守证据 · 非完整配置恢复", evidenceMissing: "原始准入证据不可用,不从当前根会话设置推断。", originalEpoch: "子会话原始 epoch", proven: "已证明字段", limitations: "证据限制", noneProven: "未报告已证明字段", noLimitations: "未报告额外限制(不代表配置已恢复)。",
54
54
  capabilityDenied: "此能力被拒绝", nativeDefault: "使用原生默认值,非已恢复", displayOnly: "仅供显示的证据", missingEvidence: "缺少证据", notPersisted: "未持久化", unverified: "尚未验证", parentDenied: "当前父会话拒绝此能力",
55
55
  };
56
56
  export const childDisabledCopy = {
57
57
  "module-off": ["Deepwork module is off.", "Deepwork 模块已关闭。"], "role-disabled": ["Role is denied by captured/current admission.", "角色被捕获/当前准入拒绝。"],
58
- "read-only": ["This child is read-only.", "此子会话为只读。"], "background-disabled": ["Captured admission does not allow background handoff.", "捕获准入不允许后台移交。"],
59
- "jobs-unavailable": ["Native jobs are unavailable for this owner.", "此 owner 的原生 jobs 不可用。"], "starting": ["Native run identity has not been published.", "原生 run 身份尚未发布。"],
60
- "already-background": ["This run already belongs to native background jobs.", "此运行已由原生后台 jobs 管理。"], "already-settled": ["This run is already settled.", "此运行已经结束。"],
61
- cancelled: ["This run was cancelled and cannot be revived.", "此运行已取消,不能复活。"], "one-shot": ["One-shot children cannot receive follow-up messages.", "一次性子会话不能接收续话。"],
58
+ "read-only": ["This child is read-only.", "此子会话为只读。"], "one-shot": ["One-shot children cannot receive follow-up messages.", "一次性子会话不能接收续话。"],
62
59
  "unknown-mode": ["Child mode is unverified.", "子会话模式未验证。"], "not-direct-child": ["Only the exact direct parent can control this child.", "只有精确的直接父会话可控制此子会话。"],
63
- "delivery-fence-unavailable": ["Managed delivery fencing is unavailable; fix explicit Host composition.", "受管投递隔离不可用,请修正显式 Host 启动组合。"],
64
- "evidence-unavailable": ["Required original admission evidence is unavailable.", "必需的原始准入证据不可用。"], "legacy-capability-denied": ["Legacy evidence does not prove this capability.", "旧会话证据无法证明此能力。"],
60
+ "evidence-unavailable": ["This child has no trusted live admission. History remains inspection-only.", "此子会话没有可信 live 准入;历史仅供检查。"],
65
61
  unavailable: ["Capability unavailable. Refresh after reconnecting.", "此能力不可用。重新连接后刷新。"],
66
62
  };
67
63
  export const childrenLocaleEn = { ...childrenEn, ...Object.fromEntries(Object.entries(childDisabledCopy).map(([reason, copy]) => [`reason:${reason}`, copy[0]])) };
@@ -0,0 +1,5 @@
1
+ import type { ProfileSelectionState } from "../profile-types.js";
2
+ export declare const writableSelectionVersion: (value: unknown) => boolean;
3
+ export declare function configurationVersionState(value: unknown): "versionObserved" | "versionAbsent" | "versionUnknown";
4
+ export declare function sourceRelationship(selection: Pick<ProfileSelectionState, "sourceRevision">, savedRevision: string | null | undefined): "current" | "changed" | "unknown";
5
+ //# sourceMappingURL=configuration-display.d.ts.map
@@ -0,0 +1,11 @@
1
+ import { isConfigRevision } from "../config-revision.js";
2
+ export const writableSelectionVersion = (value) => value === "absent" || isConfigRevision(value);
3
+ export function configurationVersionState(value) {
4
+ if (value === "absent")
5
+ return "versionAbsent";
6
+ return isConfigRevision(value) || typeof value === "string" && /^native-v1-\d+$/u.test(value) ? "versionObserved" : "versionUnknown";
7
+ }
8
+ export function sourceRelationship(selection, savedRevision) {
9
+ return selection.sourceRevision === undefined || savedRevision == null || !isConfigRevision(savedRevision) ? "unknown" : selection.sourceRevision === savedRevision ? "current" : "changed";
10
+ }
11
+ //# sourceMappingURL=configuration-display.js.map
@@ -12,6 +12,7 @@ export interface ProfileEditor {
12
12
  content: string;
13
13
  revision: string | null;
14
14
  warnings?: ProfileDiagnostic[];
15
+ refreshRequired?: true;
15
16
  }
16
17
  export interface ProfilesNotice {
17
18
  key: "saved" | "applied" | "reset";
@@ -1,5 +1,7 @@
1
1
  import { isProfileId } from "../profile-remote.js";
2
2
  import { safeIssue } from "./diagnostics.js";
3
+ import { isConfigRevision } from "../config-revision.js";
4
+ import { writableSelectionVersion } from "./configuration-display.js";
3
5
  import { editStructuredPath, moveFallback } from "./structured.js";
4
6
  function modelSelectionWatermark(window) {
5
7
  let watermark = -1;
@@ -19,7 +21,7 @@ const NEW_EDITOR = "";
19
21
  export const NEW_PROFILE_CONTENT = '{\n "version": 1,\n "id": "new-profile",\n "label": "New profile",\n "settings": {\n // Runtime overlay only. Omitted fields inherit the deployment baseline.\n "defaultActive": true\n }\n}\n';
20
22
  /** A valid external CAS conflict is reconcilable; corruption is never reset implicitly. */
21
23
  export function canReconcileSelection(snapshot) {
22
- return snapshot !== null && (snapshot.selectionRevision === "absent" || /^[a-f0-9]{64}$/u.test(snapshot.selectionRevision))
24
+ return snapshot !== null && !snapshot.refreshRequired && writableSelectionVersion(snapshot.selectionRevision)
23
25
  && (snapshot.selectionError === undefined || snapshot.selectionError.code === "conflict");
24
26
  }
25
27
  /** Stable native Store seat, with no filesystem or transport authority. */
@@ -219,7 +221,7 @@ export class ProfilesController {
219
221
  }
220
222
  async setDeepwork(active) {
221
223
  const { currentSessionId: id, session } = this.current;
222
- if (this.disposed || id === null || session?.deepwork === undefined || session.deepwork.locked || !session.switchAllowed
224
+ if (this.disposed || id === null || session?.deepwork === undefined || session.refreshRequired || session.selection.refreshRequired || session.deepwork.locked || session.canToggleMode !== true
223
225
  || this.current.sessionBusy !== null || this.current.busy !== null || this.remote.selectMode === undefined)
224
226
  return;
225
227
  const generation = ++this.sessionGeneration;
@@ -246,12 +248,13 @@ export class ProfilesController {
246
248
  }
247
249
  async selectSession(reset, options, modelOnly = false) {
248
250
  const { currentSessionId: id, session, sessionChoice, snapshot } = this.current;
249
- if (this.disposed || id === null || session === null || !session.switchAllowed || this.current.sessionBusy !== null
250
- || this.current.busy !== null || this.current.dirty || this.current.pendingEditor !== null)
251
+ if (this.disposed || id === null || session === null || session.refreshRequired || session.selection.refreshRequired || !writableSelectionVersion(session.selection.selectionRevision)
252
+ || (modelOnly ? session.canSelectModel !== true : session.canApplyOverlay !== true || session.applyOverlayUnavailableReason === "new-session-required") || this.current.sessionBusy !== null
253
+ || this.current.busy !== null || this.current.dirty || this.current.invalidFields.length > 0 || this.current.pendingEditor !== null)
251
254
  return;
252
255
  const selectedId = reset ? null : sessionChoice;
253
256
  const revision = snapshot?.profiles.find((profile) => profile.id === selectedId)?.revision;
254
- if (!modelOnly && selectedId !== null && revision == null)
257
+ if (!modelOnly && selectedId !== null && !isConfigRevision(revision))
255
258
  return;
256
259
  const generation = ++this.sessionGeneration;
257
260
  const useProfileModel = !reset && options?.useProfileModel === true;
@@ -273,13 +276,17 @@ export class ProfilesController {
273
276
  }));
274
277
  if (accepted.sessionId !== id)
275
278
  throw { kind: "assembly", code: "unavailable" };
276
- if (modelOnly && (accepted.admissionEpoch !== session.admissionEpoch || accepted.deepwork?.revision !== session.deepwork?.revision || !accepted.switchAllowed))
279
+ if (modelOnly && (accepted.admissionEpoch !== session.admissionEpoch || accepted.deepwork?.revision !== session.deepwork?.revision))
277
280
  throw { kind: "domain", code: "conflict" };
278
281
  if (!live())
279
282
  return;
280
283
  this.publish({ session: accepted, sessionChoice: accepted.selection.selectedId, sessionNotice: useProfileModel ? null : reset ? "reset" : "applied" });
281
- if (!useProfileModel || !live())
284
+ if (!useProfileModel || accepted.refreshRequired || accepted.selection.refreshRequired || !live())
282
285
  return;
286
+ if (accepted.canSelectModel !== true || !writableSelectionVersion(accepted.selection.selectionRevision)) {
287
+ this.publish({ sessionIssue: { kind: "assembly", code: accepted.selectModelUnavailableReason ?? "unavailable", source: "profile-model" } });
288
+ return;
289
+ }
283
290
  if (accepted.profileModel === undefined) {
284
291
  this.publish({ sessionIssue: { kind: "assembly", code: "model-unconfigured", source: "profile-model" } });
285
292
  return;
@@ -452,13 +459,13 @@ export class ProfilesController {
452
459
  }
453
460
  editContent(content) {
454
461
  const editor = this.current.editor;
455
- if (editor === null || this.current.busy !== null || this.current.pendingEditor !== null)
462
+ if (editor === null || editor.refreshRequired || this.current.busy !== null || this.current.pendingEditor !== null)
456
463
  return;
457
464
  this.publish({ editor: { ...editor, content }, dirty: this.accepted === null || this.accepted.content !== content || this.accepted.id !== editor.id, issue: null, notice: null });
458
465
  }
459
466
  editPath(path, value) {
460
467
  const editor = this.current.editor;
461
- if (editor === null || this.current.busy !== null || this.current.pendingEditor !== null)
468
+ if (editor === null || editor.refreshRequired || this.current.busy !== null || this.current.pendingEditor !== null)
462
469
  return;
463
470
  const content = editStructuredPath(editor.content, path, value);
464
471
  if (content === null) {
@@ -469,7 +476,7 @@ export class ProfilesController {
469
476
  }
470
477
  editRoute(path, provider, model) {
471
478
  const editor = this.current.editor;
472
- if (editor === null || this.current.busy !== null || this.current.pendingEditor !== null)
479
+ if (editor === null || editor.refreshRequired || this.current.busy !== null || this.current.pendingEditor !== null)
473
480
  return;
474
481
  let content = editor.content;
475
482
  for (const [key, value] of [["provider", provider], ["model", model], ["reasoningEffort", undefined]]) {
@@ -483,7 +490,7 @@ export class ProfilesController {
483
490
  }
484
491
  editFallbackOrder(role, from, to) {
485
492
  const editor = this.current.editor;
486
- if (editor === null || this.current.busy !== null || this.current.pendingEditor !== null)
493
+ if (editor === null || editor.refreshRequired || this.current.busy !== null || this.current.pendingEditor !== null)
487
494
  return;
488
495
  const content = moveFallback(editor.content, role, from, to);
489
496
  if (content !== null)
@@ -491,7 +498,7 @@ export class ProfilesController {
491
498
  }
492
499
  async save() {
493
500
  const editor = this.current.editor;
494
- if (editor === null || !this.current.dirty || this.current.snapshot === null || this.current.busy !== null || this.current.pendingEditor !== null || this.current.invalidFields.length > 0)
501
+ if (editor === null || editor.refreshRequired || editor.revision !== null && !isConfigRevision(editor.revision) || !this.current.dirty || this.current.snapshot === null || this.current.busy !== null || this.current.pendingEditor !== null || this.current.invalidFields.length > 0)
495
502
  return;
496
503
  if (!isProfileId(editor.id)) {
497
504
  this.publish({ issue: { kind: "domain", code: "validation", field: "id" }, notice: null, validationEpoch: this.current.validationEpoch + 1 });
@@ -512,7 +519,7 @@ export class ProfilesController {
512
519
  }
513
520
  async apply() {
514
521
  const { editor, snapshot, dirty } = this.current;
515
- if (editor?.revision == null || !canReconcileSelection(snapshot) || dirty)
522
+ if (editor?.refreshRequired || !isConfigRevision(editor?.revision) || !canReconcileSelection(snapshot) || dirty)
516
523
  return;
517
524
  await this.perform("apply", async (live) => {
518
525
  const accepted = await this.unwrap(this.remote.select({ id: editor.id, expectedRevision: editor.revision, expectedSelectionRevision: snapshot.selectionRevision }));
@@ -2,7 +2,7 @@ import type { ConfigFormSnapshot, ConfigForm } from "@deepseek-ai/dsh-client-ui-
2
2
  import type { ConnectionGenerationState } from "@deepseek-ai/dsh-client-connection/client";
3
3
  import type { DsmmConfigRemote } from "../profile-remote.js";
4
4
  import type { DeploymentEditorSnapshot, SessionProfileSnapshot } from "../profile-types.js";
5
- export type DeploymentIssue = "unavailable" | "not-owned" | "conflict" | "validation" | "transport";
5
+ export type DeploymentIssue = "unavailable" | "not-owned" | "conflict" | "validation" | "transport" | "unconfirmed";
6
6
  export interface DeploymentView {
7
7
  snapshot: DeploymentEditorSnapshot | null;
8
8
  draft: Record<string, unknown>;
@@ -11,6 +11,12 @@ export interface DeploymentView {
11
11
  issue: DeploymentIssue | null;
12
12
  saved: boolean;
13
13
  session: SessionProfileSnapshot | null;
14
+ raw: Readonly<Record<string, {
15
+ text: string;
16
+ invalid: boolean;
17
+ }>>;
18
+ invalidFields: readonly string[];
19
+ refreshRequired: boolean;
14
20
  }
15
21
  export interface NativePageForm {
16
22
  state: ConfigFormSnapshot<Record<string, unknown>>;
@@ -31,6 +37,7 @@ export declare class DeploymentController {
31
37
  private connection;
32
38
  private connectionBaseline;
33
39
  private stopConnection;
40
+ private children;
34
41
  constructor(remote: DsmmConfigRemote, layer: "global" | "profile", rowNamespace?: string | null);
35
42
  readonly getSnapshot: () => DeploymentView;
36
43
  readonly subscribe: (listener: () => void) => (() => void);
@@ -42,6 +49,11 @@ export declare class DeploymentController {
42
49
  private publish;
43
50
  attachForm(form: NativePageForm | null): void;
44
51
  setInvalid(path: string, invalid: boolean): void;
52
+ setRaw(path: string, text: string, invalid: boolean): void;
53
+ clearRaw(prefix: string): void;
54
+ canEdit(): boolean;
55
+ canSave(): boolean;
56
+ pendingPaths(): readonly string[];
45
57
  canWriteProfile(snapshot?: DeploymentEditorSnapshot | null): boolean;
46
58
  edit(path: readonly string[], value: unknown): void;
47
59
  refresh(discard?: boolean): Promise<void>;