@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
@@ -0,0 +1,94 @@
1
+ import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
2
+ import { useEffect, useId, useMemo, useRef, useState } from "react";
3
+ import { Button } from "@deepseek-ai/dsh-client-ui-primitives";
4
+ import { answerWithTemporaryPermit, pendingDelivery, retainAndAnswer, temporaryPermissionClient } from "./temporary-permission-client.js";
5
+ import { PERMISSIONS_NS } from "./permission-locales.js";
6
+ const durations = ["once", "session", "15min", "1h"];
7
+ /** Parent mounts after native approval UI and registers the existing permission dictionaries. */
8
+ export function registerTemporaryPermissionSlots(ctx, connection) {
9
+ const lifetime = new AbortController();
10
+ ctx.effect(() => () => lifetime.abort());
11
+ ctx.slots.inject("conversation.composer", () => ctx.slots.register({
12
+ name: "conversation.approval.permissions", priority: 0, locale: PERMISSIONS_NS,
13
+ }, function PermissionSlot(props) {
14
+ const remote = useMemo(() => temporaryPermissionClient(connection, lifetime.signal), [props.pending]);
15
+ const child = props.useSession(snapshot => snapshot.subagent !== undefined);
16
+ return _jsx(TemporaryApproval, { pending: props.pending, remote: remote, t: props.t, child: child }, props.pending.key);
17
+ }));
18
+ }
19
+ /** Render beside the native prompt, never replace its approve/reject/cancel controls. */
20
+ export function TemporaryApproval({ pending, remote, t, child = false }) {
21
+ const id = useId(), [view, setView] = useState(), [duration, setDuration] = useState("once");
22
+ const [busy, setBusy] = useState(false), [error, setError] = useState(false);
23
+ const [scope, setScope] = useState("exact");
24
+ const identity = useRef({ pending, remote, active: true });
25
+ if (identity.current.pending !== pending || identity.current.remote !== remote)
26
+ identity.current = { pending, remote, active: true };
27
+ const captured = identity.current, isCurrent = () => captured.active && identity.current === captured;
28
+ useEffect(() => {
29
+ let current = true;
30
+ setView(undefined);
31
+ setDuration("once");
32
+ setScope("exact");
33
+ setError(false);
34
+ setBusy(false);
35
+ const delivery = pendingDelivery(pending);
36
+ if (delivery)
37
+ void remote.request(pending.sessionId, delivery).then(async (value) => {
38
+ if (!current)
39
+ return;
40
+ setView(value);
41
+ if (value.reusable)
42
+ await answerWithTemporaryPermit(pending, remote, () => current);
43
+ }).catch(() => { if (current)
44
+ setError(true); });
45
+ captured.active = true;
46
+ return () => { current = false; captured.active = false; };
47
+ }, [pending, remote]);
48
+ if (!pendingDelivery(pending))
49
+ return null;
50
+ return _jsxs("section", { className: "dsmm-structured", "aria-label": t("temporaryTitle"), "aria-busy": busy, children: [view && _jsxs(_Fragment, { children: [_jsx("p", { children: view.summary }), _jsxs("div", { className: "dsmm-field", children: [_jsx("label", { htmlFor: id, children: t("temporaryDuration") }), _jsx("select", { id: id, value: duration, disabled: busy || !pending.answerable, onChange: event => {
51
+ const value = durations.find(value => value === event.currentTarget.value);
52
+ if (value)
53
+ setDuration(value);
54
+ }, children: durations.filter(value => view.reusable || value === "once").map(value => _jsx("option", { value: value, children: t(child && value === "session" ? "temporaryChildSession" : `temporary:${value}`) }, value)) })] }), !!view.scopes?.length && duration !== "once" && _jsxs("div", { className: "dsmm-field", children: [_jsx("label", { htmlFor: `${id}-scope`, children: t("pathScope") }), _jsxs("select", { id: `${id}-scope`, value: scope, disabled: busy || !pending.answerable, onChange: event => setScope(event.currentTarget.value), children: [_jsx("option", { value: "exact", children: view.summary }), view.scopes.map(choice => _jsx("option", { value: choice.id, children: choice.summary }, choice.id))] })] }), _jsx(Button, { variant: "primary", disabled: busy || !pending.answerable, onClick: () => {
55
+ setBusy(true);
56
+ setError(false);
57
+ void retainAndAnswer(pending, remote, duration, isCurrent, scope).catch(() => { if (isCurrent())
58
+ setError(true); }).finally(() => { if (isCurrent())
59
+ setBusy(false); });
60
+ }, children: t("temporaryApprove") })] }), _jsx("p", { className: "dsmm-hint", children: t("temporaryBoundary") }), view?.tool === "web_fetch" && _jsx("p", { className: "dsmm-hint", children: t("temporaryWebBoundary") }), error && _jsx("p", { className: "dsmm-issue", role: "alert", children: t("temporaryUnavailable") })] });
61
+ }
62
+ export function TemporaryGrants({ sessionId, remote, t, child = false }) {
63
+ const [grants, setGrants] = useState(), [busy, setBusy] = useState(false), [error, setError] = useState(false);
64
+ const identity = useRef({ sessionId, remote, active: true });
65
+ if (identity.current.sessionId !== sessionId || identity.current.remote !== remote)
66
+ identity.current = { sessionId, remote, active: true };
67
+ const captured = identity.current, current = () => captured.active && identity.current === captured;
68
+ const accept = (value) => { if (current())
69
+ setGrants(value); };
70
+ const fail = () => { if (current())
71
+ setError(true); };
72
+ const finish = () => { if (current())
73
+ setBusy(false); };
74
+ useEffect(() => {
75
+ let current = true;
76
+ setGrants(undefined);
77
+ setError(false);
78
+ void remote.describe(sessionId).then(value => { if (current)
79
+ setGrants(value); }).catch(() => { if (current)
80
+ setError(true); });
81
+ captured.active = true;
82
+ return () => { current = false; captured.active = false; };
83
+ }, [sessionId, remote]);
84
+ return _jsxs("section", { className: "dsmm-zone", "aria-label": t("temporaryTitle"), "aria-busy": busy, children: [_jsx("h3", { children: t("temporaryTitle") }), grants?.length === 0 && _jsx("p", { children: t("temporaryEmpty") }), grants?.map(grant => _jsxs("fieldset", { children: [_jsx("legend", { children: grant.tool }), _jsx("p", { children: grant.summary }), _jsx("p", { children: t(child && grant.duration === "session" ? "temporaryChildSession" : `temporary:${grant.duration}`) }), grant.tool === "web_fetch" && _jsx("p", { className: "dsmm-hint", children: t("temporaryWebBoundary") }), _jsx(Button, { variant: "outline", disabled: busy, onClick: () => {
85
+ setBusy(true);
86
+ setError(false);
87
+ void remote.revoke(sessionId, grant.id).then(accept).catch(fail).finally(finish);
88
+ }, children: t("temporaryRevoke") })] }, grant.id)), _jsx(Button, { variant: "outline", disabled: busy, onClick: () => {
89
+ setBusy(true);
90
+ setError(false);
91
+ void remote.describe(sessionId).then(accept).catch(fail).finally(finish);
92
+ }, children: t("temporaryRefresh") }), error && _jsx("p", { className: "dsmm-issue", role: "alert", children: t("temporaryUnavailable") }), _jsx("p", { className: "dsmm-hint", children: t("temporaryBoundary") })] });
93
+ }
94
+ //# sourceMappingURL=TemporaryPermissions.js.map
@@ -1,5 +1,5 @@
1
1
  import type { DsmmChildrenRemote } from "../role-control-remote.js";
2
- import type { BackgroundTransitionResult, ChildSessionSnapshot, RoleControlAvailability, RoleControlDescendantsSnapshot, RoleControlErrorInfo, SubagentInterruptReceipt, SubagentPromptReceipt, SubagentPromptRequest } from "../role-control-types.js";
2
+ import type { ChildSessionSnapshot, RoleControlAvailability, RoleControlDescendantsSnapshot, RoleControlErrorInfo, SubagentInterruptReceipt, SubagentPromptReceipt, SubagentPromptRequest } from "../role-control-types.js";
3
3
  export interface ChildrenIssue extends Partial<RoleControlErrorInfo> {
4
4
  kind: "domain" | "transport" | "protocol" | "local";
5
5
  code: RoleControlErrorInfo["code"];
@@ -16,9 +16,6 @@ export interface ChildDraft {
16
16
  uncertain: boolean;
17
17
  }
18
18
  export type ChildOutcome = {
19
- kind: "background";
20
- receipt: BackgroundTransitionResult;
21
- } | {
22
19
  kind: "prompt";
23
20
  receipt: SubagentPromptReceipt;
24
21
  } | {
@@ -35,13 +32,12 @@ export interface ChildrenSnapshot {
35
32
  issue: ChildrenIssue | null;
36
33
  descendantIssue: ChildrenIssue | null;
37
34
  drafts: ReadonlyMap<string, ChildDraft>;
38
- pending: ReadonlyMap<string, "background" | "prompt" | "interrupt">;
35
+ pending: ReadonlyMap<string, "prompt" | "interrupt">;
39
36
  issues: ReadonlyMap<string, ChildrenIssue>;
40
37
  outcomes: ReadonlyMap<string, ChildOutcome>;
41
38
  }
42
39
  export interface ChildrenActions {
43
40
  refresh(generation: number): Promise<void>;
44
- background(generation: number, toolCallId: string, runId: string): Promise<void>;
45
41
  prompt(generation: number, childId: string): Promise<void>;
46
42
  interrupt(generation: number, childId: string): Promise<void>;
47
43
  editText(generation: number, childId: string, text: string): void;
@@ -52,7 +48,6 @@ export interface ChildrenActions {
52
48
  }
53
49
  export declare const EMPTY_CHILD_DRAFT: ChildDraft;
54
50
  export declare const childActionKey: (childId: string) => string;
55
- export declare const runActionKey: (toolCallId: string, runId: string) => string;
56
51
  export declare function enabled(availability: RoleControlAvailability | undefined): boolean;
57
52
  /** Client presentation/draft state only. Host owns all run, inbox and admission authority. */
58
53
  export declare class ChildrenController {
@@ -89,7 +84,6 @@ export declare class ChildrenController {
89
84
  private finish;
90
85
  private refuse;
91
86
  private accepted;
92
- background(generation: number, toolCallId: string, runId: string): Promise<void>;
93
87
  private canControl;
94
88
  prompt(generation: number, id: string): Promise<void>;
95
89
  interrupt(generation: number, id: string): Promise<void>;
@@ -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";
@@ -112,22 +109,14 @@ export declare const childrenZh: Record<keyof typeof childrenEn, string>;
112
109
  export declare const childDisabledCopy: Record<RoleControlDisabledReason, readonly [string, string]>;
113
110
  export type ChildrenLocaleKey = keyof typeof childrenEn | `reason:${RoleControlDisabledReason}`;
114
111
  export declare const childrenLocaleEn: {
115
- "reason:cancelled": string;
116
112
  "reason:unavailable": string;
117
- "reason:one-shot": string;
118
- "reason:starting": 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
116
  "reason:role-disabled": string;
124
- "reason:background-disabled": string;
125
- "reason:jobs-unavailable": string;
126
117
  "reason:unknown-mode": string;
127
118
  "reason:not-direct-child": string;
128
- "reason:delivery-fence-unavailable": string;
129
119
  "reason:evidence-unavailable": string;
130
- "reason:legacy-capability-denied": 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";
@@ -236,42 +222,26 @@ export declare const childrenLocaleEn: {
236
222
  parentDenied: "Current parent denies this capability";
237
223
  };
238
224
  export declare const childrenLocaleZh: {
239
- "reason:cancelled": string;
240
225
  "reason:unavailable": string;
241
- "reason:one-shot": string;
242
- "reason:starting": 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
229
  "reason:role-disabled": string;
248
- "reason:background-disabled": string;
249
- "reason:jobs-unavailable": string;
250
230
  "reason:unknown-mode": string;
251
231
  "reason:not-direct-child": string;
252
- "reason:delivery-fence-unavailable": string;
253
232
  "reason:evidence-unavailable": string;
254
- "reason:legacy-capability-denied": string;
255
- pending: string;
256
- unavailable: string;
257
233
  text: string;
258
- delivery: string;
259
- role: string;
260
234
  error: string;
261
- childId: string;
262
235
  disabled: string;
236
+ unavailable: string;
263
237
  diagnostic: string;
264
238
  enabled: string;
239
+ role: string;
265
240
  session: string;
266
241
  field: string;
267
242
  unknown: string;
268
- starting: string;
269
- background: string;
270
- jobId: string;
271
- toolCallId: string;
272
- runId: string;
273
- mode: string;
274
243
  stale: string;
244
+ mode: string;
275
245
  prompt: string;
276
246
  captured: string;
277
247
  level: string;
@@ -283,31 +253,37 @@ export declare const childrenLocaleZh: {
283
253
  routeSource: string;
284
254
  description: string;
285
255
  epoch: string;
286
- evidence: string;
256
+ runId: string;
257
+ childId: string;
258
+ jobId: string;
259
+ pending: string;
287
260
  yes: string;
288
261
  no: string;
262
+ activity: string;
263
+ runtime: string;
289
264
  liveRoute: string;
265
+ title: string;
266
+ images: 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;
271
+ delivery: string;
298
272
  queue: string;
299
273
  steer: string;
300
274
  authority: string;
301
275
  foreign: string;
302
276
  reading: string;
303
- title: string;
277
+ restart: string;
304
278
  refresh: string;
305
279
  noSession: string;
280
+ runs: string;
306
281
  emptyRuns: string;
307
282
  emptyChildren: string;
308
283
  emptyDescendants: string;
309
284
  treeUnavailable: string;
310
285
  runState: string;
286
+ starting: string;
311
287
  backgroundHint: string;
312
288
  reportedRoute: string;
313
289
  routeUnreported: string;
@@ -324,6 +300,7 @@ export declare const childrenLocaleZh: {
324
300
  routeInvalidOwnHeader: string;
325
301
  routeNotObserved: string;
326
302
  invocationUnavailable: string;
303
+ toolCallId: string;
327
304
  parentId: string;
328
305
  subtree: string;
329
306
  oneShot: string;
@@ -344,9 +321,7 @@ export declare const childrenLocaleZh: {
344
321
  interruptAvailability: string;
345
322
  imageAvailability: string;
346
323
  fence: string;
347
- restart: string;
348
- composition: string;
349
- duplicate: 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
@@ -1,5 +1,7 @@
1
1
  import type { RemoteResult } from "@deepseek-ai/dsh-typert-protocol";
2
2
  import type { HostObservable } from "@deepseek-ai/dsh-client-ui-slots";
3
+ import type { ConnectionGenerationState } from "@deepseek-ai/dsh-client-connection/client";
4
+ import type { ComposerBlocks } from "@deepseek-ai/dsh-client-ui-conversation/client";
3
5
  import type { SessionEventSource } from "@deepseek-ai/dsh-api-session-controller/client";
4
6
  import type { ModelDirectoryState } from "@deepseek-ai/dsh-client-ui-model-selection/client";
5
7
  import type { DsmmProfilesRemote } from "../profile-remote.js";
@@ -12,6 +14,7 @@ export interface ProfileEditor {
12
14
  content: string;
13
15
  revision: string | null;
14
16
  warnings?: ProfileDiagnostic[];
17
+ refreshRequired?: true;
15
18
  }
16
19
  export interface ProfilesNotice {
17
20
  key: "saved" | "applied" | "reset";
@@ -41,6 +44,8 @@ export interface ProfilesViewSnapshot {
41
44
  catalogBusy: boolean;
42
45
  catalogUnavailable: boolean;
43
46
  currentSessionId: string | null;
47
+ sessionViewEpoch: number;
48
+ sessionUnconfirmed: boolean;
44
49
  session: SessionProfileSnapshot | null;
45
50
  sessionChoice: string | null;
46
51
  sessionBusy: "read" | "apply" | "reset" | "mode" | null;
@@ -94,6 +99,14 @@ export declare class ProfilesController {
94
99
  private generation;
95
100
  private disposed;
96
101
  private sessionGeneration;
102
+ private pendingSessionSelections;
103
+ private connection;
104
+ private connectionBaseline;
105
+ private connectionBound;
106
+ private stopConnection;
107
+ private composerBlocks;
108
+ private composerReason;
109
+ private composerBlock;
97
110
  private catalogGeneration;
98
111
  private catalogRemote;
99
112
  private modelSelectorGeneration;
@@ -120,6 +133,11 @@ export declare class ProfilesController {
120
133
  readonly actions: ProfilesActions;
121
134
  constructor(remote: DsmmProfilesRemote);
122
135
  dispose(): void;
136
+ bindConnection(source: ConnectionGenerationState | null): void;
137
+ private connectionCurrent;
138
+ attachComposerBlocks(blocks: ComposerBlocks | null, reason?: () => string): void;
139
+ private releaseComposerBlock;
140
+ private syncComposerBlock;
123
141
  attachModelSelector(remote: ProfileModelSelectorRemote | null): void;
124
142
  attachModelSelectionSource(sessionId: string | null, source: HostObservable<unknown> | null): void;
125
143
  attachModelEventSource(sessionId: string | null, source: SessionEventSource | null): void;