@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,106 @@
1
+ import { jsx as _jsx } from "react/jsx-runtime";
2
+ import { useSyncExternalStore } from "react";
3
+ import { HistoryContinuation } from "./HistoryContinuation.js";
4
+ import { HistoryContinuationController } from "./history-controller.js";
5
+ import { historyLocales } from "./history-locales.js";
6
+ export function HistoryContinuationEntry({ controller, locale, sessionId }) {
7
+ const state = useSyncExternalStore(controller.subscribe, controller.getSnapshot, controller.getSnapshot);
8
+ const language = useSyncExternalStore(listener => locale.subscribe(listener), () => locale.getSnapshot());
9
+ if (state.sessionId !== sessionId || state.status?.execution === "active" || state.phase === "loading" && state.status === null && state.issue === null)
10
+ return null;
11
+ return _jsx(HistoryContinuation, { controller: controller, locale: language.active === "zh" ? "zh" : "en" });
12
+ }
13
+ /** Read-only native binding observer; Host admission owns all history activation. */
14
+ export function registerHistoryContinuation(ctx) {
15
+ void ctx.inject(["remote.dsmmHistory"], historyCtx => {
16
+ const controller = new HistoryContinuationController(), remote = historyCtx.remote.dsmmHistory;
17
+ let disposed = false;
18
+ let connection, selected;
19
+ let blocks;
20
+ let held;
21
+ let watched, stopBlock;
22
+ const release = () => {
23
+ const owned = held;
24
+ held = undefined;
25
+ if (owned && blocks?.storeFor(owned.id) === owned.store && owned.store.getSnapshot() === owned.block)
26
+ blocks.set(owned.id, undefined);
27
+ };
28
+ const syncBlock = () => {
29
+ const state = controller.getSnapshot(), id = state.sessionId;
30
+ if (disposed || id === null || state.status?.execution === "active") {
31
+ stopBlock?.();
32
+ stopBlock = undefined;
33
+ watched = undefined;
34
+ release();
35
+ return;
36
+ }
37
+ if (held && held.id !== id)
38
+ release();
39
+ const text = historyLocales[historyCtx.locale.getLocale().active === "zh" ? "zh" : "en"];
40
+ const reason = state.phase === "disconnected" ? text.disconnected : state.phase === "unknown" ? text.unknown
41
+ : state.phase === "confirming" || state.status?.execution === "activating" ? text.confirming : text.reasons[state.issue?.code ?? (state.status?.compatibleHost === false ? "unsupported-host" : state.status?.reason) ?? "authorization-required"];
42
+ const store = blocks?.storeFor(id);
43
+ if (watched !== store) {
44
+ stopBlock?.();
45
+ watched = store;
46
+ stopBlock = store?.subscribe(syncBlock);
47
+ }
48
+ if (held && (held.store !== store || held.store.getSnapshot() !== held.block))
49
+ held = undefined;
50
+ if (held && (held.id !== id || held.block.reason !== reason))
51
+ release();
52
+ if (!blocks || !store || held)
53
+ return;
54
+ if (store.getSnapshot() !== undefined)
55
+ return;
56
+ const block = { reason };
57
+ held = { id, store, block };
58
+ blocks.set(id, block);
59
+ };
60
+ const update = () => {
61
+ if (disposed)
62
+ return;
63
+ const state = selected?.session.getSnapshot();
64
+ const id = selected && state?.sessionId === selected.sessionId && !state.removed ? selected.sessionId : null;
65
+ controller.bind(remote, connection?.generation.getSnapshot(), id, selected);
66
+ syncBlock();
67
+ };
68
+ historyCtx.effect(() => controller.subscribe(syncBlock));
69
+ historyCtx.effect(() => historyCtx.locale.subscribe(syncBlock));
70
+ historyCtx.effect(() => () => { disposed = true; stopBlock?.(); release(); controller.dispose(); }, "dsmm: history continuation owner");
71
+ historyCtx.slots.inject("conversation.input.dock", () => historyCtx.slots.register({
72
+ name: "conversation.input.dock", id: "dsmm-history-continuation", order: 10, inject: () => ({ controller, locale: historyCtx.locale }),
73
+ }, HistoryContinuationEntry));
74
+ void historyCtx.inject(["conversation"], conversationCtx => {
75
+ blocks = conversationCtx.conversation.blocks;
76
+ syncBlock();
77
+ conversationCtx.effect(() => () => { stopBlock?.(); stopBlock = undefined; watched = undefined; release(); blocks = undefined; }, "dsmm: history composer lifetime");
78
+ });
79
+ void historyCtx.inject(["connection"], connectionCtx => {
80
+ connection = connectionCtx.connection;
81
+ update();
82
+ connectionCtx.effect(() => connection.generation.subscribe(update));
83
+ connectionCtx.effect(() => () => { connection = undefined; update(); }, "dsmm: history connection lifetime");
84
+ });
85
+ void historyCtx.inject(["uiSession", "sessions"], sessionCtx => {
86
+ const source = sessionCtx.uiSession.adapter.current, sessions = sessionCtx.sessions;
87
+ let stop;
88
+ const observe = () => {
89
+ const id = source.getSnapshot().key;
90
+ const candidate = id === undefined ? undefined : sessions.binding(id);
91
+ const binding = candidate?.sessionId === id ? candidate : undefined;
92
+ if (binding !== selected) {
93
+ stop?.();
94
+ selected = binding;
95
+ stop = binding?.session.subscribe(update);
96
+ }
97
+ update();
98
+ };
99
+ observe();
100
+ sessionCtx.effect(() => source.subscribe(observe));
101
+ sessionCtx.effect(() => sessions.list.subscribe(observe));
102
+ sessionCtx.effect(() => () => { stop?.(); selected = undefined; update(); }, "dsmm: history native scope lifetime");
103
+ });
104
+ });
105
+ }
106
+ //# sourceMappingURL=history-entry.js.map
@@ -0,0 +1,95 @@
1
+ export declare const historyLocales: {
2
+ en: {
3
+ title: string;
4
+ preset: string;
5
+ profile: string;
6
+ baseline: string;
7
+ choose: string;
8
+ preview: string;
9
+ confirm: string;
10
+ refresh: string;
11
+ loading: string;
12
+ preparing: string;
13
+ confirming: string;
14
+ active: string;
15
+ browsing: string;
16
+ unknown: string;
17
+ pending: string;
18
+ pendingWarning: string;
19
+ consent: string;
20
+ migration: string;
21
+ effects: string;
22
+ model: string;
23
+ roles: string;
24
+ permissions: string;
25
+ differences: string;
26
+ project: string;
27
+ noPending: string;
28
+ nextTurn: string;
29
+ nextStep: string;
30
+ candidate: string;
31
+ disconnected: string;
32
+ reasons: {
33
+ validation: string;
34
+ "not-owned": string;
35
+ "not-found": string;
36
+ "unsupported-host": string;
37
+ "unsupported-backend": string;
38
+ unavailable: string;
39
+ busy: string;
40
+ stale: string;
41
+ cancelled: string;
42
+ "authorization-required": string;
43
+ "child-owner-required": string;
44
+ "format-unavailable": string;
45
+ "initialization-failed": string;
46
+ };
47
+ };
48
+ zh: {
49
+ title: string;
50
+ preset: string;
51
+ profile: string;
52
+ baseline: string;
53
+ choose: string;
54
+ preview: string;
55
+ confirm: string;
56
+ refresh: string;
57
+ loading: string;
58
+ preparing: string;
59
+ confirming: string;
60
+ active: string;
61
+ browsing: string;
62
+ unknown: string;
63
+ pending: string;
64
+ pendingWarning: string;
65
+ consent: string;
66
+ migration: string;
67
+ effects: string;
68
+ model: string;
69
+ roles: string;
70
+ permissions: string;
71
+ differences: string;
72
+ project: string;
73
+ noPending: string;
74
+ nextTurn: string;
75
+ nextStep: string;
76
+ candidate: string;
77
+ disconnected: string;
78
+ reasons: {
79
+ validation: string;
80
+ "not-owned": string;
81
+ "not-found": string;
82
+ "unsupported-host": string;
83
+ "unsupported-backend": string;
84
+ unavailable: string;
85
+ busy: string;
86
+ stale: string;
87
+ cancelled: string;
88
+ "authorization-required": string;
89
+ "child-owner-required": string;
90
+ "format-unavailable": string;
91
+ "initialization-failed": string;
92
+ };
93
+ };
94
+ };
95
+ //# sourceMappingURL=history-locales.d.ts.map
@@ -0,0 +1,41 @@
1
+ const en = {
2
+ title: "Continue this session", preset: "Current agent preset", profile: "Session configuration", baseline: "Use deployment defaults",
3
+ choose: "Choose a current preset", preview: "Review continuation", confirm: "Continue this session", refresh: "Refresh status",
4
+ loading: "Loading current configuration…", preparing: "Preparing confirmation…", confirming: "Activating session…",
5
+ active: "This session is active. Continue using the native conversation.", browsing: "History remains available without continuing execution.",
6
+ unknown: "The result is not confirmed. Refresh status before taking another action.",
7
+ pending: "Pending input", pendingWarning: "These stored inputs are untrusted. Continuing processes this exact pending set under current permissions; it does not restore old approvals.",
8
+ consent: "Process the pending inputs shown above", migration: "Publish the required native format migration and recovery entries",
9
+ effects: "Native recovery entries or a migration may already have been committed. History and pending input are not rolled back.",
10
+ model: "Current model", roles: "Current roles", permissions: "Current restrictions", differences: "Changes to execution", project: "Project",
11
+ noPending: "No pending inputs.", nextTurn: "Next turn", nextStep: "Next step", candidate: "Configuration to be used", disconnected: "Connect to the local Host to review continuation.",
12
+ reasons: {
13
+ validation: "The request is invalid. Refresh and review the selection.", "not-owned": "Use the current local Host operator connection.", "not-found": "The stored session is unavailable.",
14
+ "unsupported-host": "A compatible Host with read-only history following is required. The original Desktop has not been patched by this plugin.",
15
+ "unsupported-backend": "This storage backend cannot validate continuation before writing.", unavailable: "Current execution services are unavailable. History can still be inspected.",
16
+ busy: "An activation or other owner is already using this session. Refresh its status.", stale: "The session or current configuration changed. Review a new confirmation.",
17
+ cancelled: "Continuation was cancelled. Refresh before trying again.", "authorization-required": "Review the current configuration and explicitly confirm continuation.",
18
+ "child-owner-required": "This child can be browsed here. Continuing requires its exact live parent owner.", "format-unavailable": "The native reader could not load this format. Keep the existing history view and inspect its diagnostic.",
19
+ "initialization-failed": "Execution initialization failed. Refresh status; do not replay the request.",
20
+ },
21
+ };
22
+ export const historyLocales = { en, zh: {
23
+ title: "继续此会话", preset: "当前 Agent 预设", profile: "本次会话配置", baseline: "使用部署默认配置",
24
+ choose: "选择当前可用的预设", preview: "查看继续方案", confirm: "继续此会话", refresh: "刷新状态",
25
+ loading: "正在读取当前配置…", preparing: "正在准备确认信息…", confirming: "正在激活会话…",
26
+ active: "此会话已激活,可继续使用原生对话界面。", browsing: "不继续执行也可以浏览历史。",
27
+ unknown: "结果待确认。请先刷新状态,不要重复执行。",
28
+ pending: "待处理输入", pendingWarning: "以下历史输入是不可信内容。继续后将按当前权限处理这一组输入,不恢复旧审批。",
29
+ consent: "处理上方列出的待处理输入", migration: "允许发布所需的原生格式迁移和恢复记录",
30
+ effects: "原生恢复记录或迁移可能已经提交,不承诺回滚历史或待处理输入。",
31
+ model: "当前模型", roles: "当前角色", permissions: "当前限制", differences: "执行变化", project: "项目",
32
+ noPending: "没有待处理输入。", nextTurn: "下一轮", nextStep: "下一步", candidate: "将采用的配置", disconnected: "连接本地 Host 后可查看继续方案。",
33
+ reasons: {
34
+ validation: "请求无效,请刷新后重新查看选择。", "not-owned": "请使用当前本地 Host 的操作者连接。", "not-found": "找不到该持久化会话。",
35
+ "unsupported-host": "需要支持只读历史跟随的兼容 Host。仅安装插件不会修补原版 Desktop。", "unsupported-backend": "当前存储后端不能在写入前校验继续权限。",
36
+ unavailable: "当前执行服务不可用,仍可查看历史。", busy: "该会话正被其他执行者或激活操作使用,请刷新状态。", stale: "会话或当前配置已变化,请重新查看确认信息。",
37
+ cancelled: "继续操作已取消,请刷新后再试。", "authorization-required": "请查看当前配置并明确确认继续。", "child-owner-required": "此处可浏览子会话,继续执行需要其真实存活的父级所有者。",
38
+ "format-unavailable": "原生读取器无法加载此格式。请保留现有历史视图并查看诊断。", "initialization-failed": "执行初始化失败,请刷新状态,不要重放请求。",
39
+ },
40
+ } };
41
+ //# sourceMappingURL=history-locales.js.map
@@ -6,16 +6,17 @@ import { PROFILE_STYLES } from "./styles.js";
6
6
  import { SessionProfiles } from "./SessionProfiles.js";
7
7
  import { DeploymentController } from "./deployment-controller.js";
8
8
  import { DeploymentPage } from "./DeploymentPage.js";
9
+ import { deploymentWorkspace } from "./deployment-workspace.js";
9
10
  import { DEPLOYMENT_NS, deploymentEn, deploymentZh } from "./deployment-locales.js";
10
11
  import { ROLE_CONTROL_REMOTE } from "../role-control-remote.js";
11
- import { ChildrenController } from "./children-controller.js";
12
- import { ChildrenPanel } from "./ChildrenPanel.js";
13
- import { CHILDREN_NS, childrenLocaleEn, childrenLocaleZh } from "./children-locales.js";
14
12
  import { PERMISSION_REMOTE } from "../permission-remote.js";
15
13
  import { permissionClient } from "./permission-client.js";
16
14
  import { PermissionController } from "./permission-controller.js";
17
- import { PermissionsPanel } from "./PermissionsPanel.js";
18
15
  import { PERMISSIONS_NS, permissionEn, permissionZh } from "./permission-locales.js";
16
+ import { registerRoleToolViews } from "./RoleToolView.js";
17
+ import { HISTORY_REMOTE } from "../history-remote.js";
18
+ import { registerHistoryContinuation } from "./history-entry.js";
19
+ import { registerTemporaryPermissionEntry } from "./temporary-permission-entry.js";
19
20
  export { ProfilesController, NEW_PROFILE_CONTENT } from "./controller.js";
20
21
  export { ProfilesSection } from "./ProfilesSection.js";
21
22
  export { NS, en, zh } from "./locales.js";
@@ -28,24 +29,15 @@ export { ROLE_CONTROL_REMOTE } from "../role-control-remote.js";
28
29
  /** No self-dependency on a namespace that this contribution has not mounted. */
29
30
  export const inject = ["slots", "locale", "remote"];
30
31
  export async function apply(ctx) {
31
- await ctx.remote.$mount(TYPERT_REMOTE);
32
+ registerRoleToolViews(ctx);
33
+ await ctx.remote.$mount({ ...TYPERT_REMOTE, descriptors: [...TYPERT_REMOTE.descriptors, ...HISTORY_REMOTE.descriptors] });
32
34
  await ctx.remote.$mount(ROLE_CONTROL_REMOTE);
33
35
  await ctx.remote.$mount(PERMISSION_REMOTE);
36
+ registerHistoryContinuation(ctx);
34
37
  const permissions = new PermissionController();
35
38
  ctx.effect(() => () => permissions.dispose(), "dsmm: permission controls");
36
39
  ctx.effect(() => ctx.locale.register(PERMISSIONS_NS, { en: permissionEn, zh: permissionZh }), "dsmm: permission locale");
37
- ctx.effect(() => {
38
- const style = document.createElement("style");
39
- style.dataset.dsmmPermissions = "";
40
- style.textContent = PROFILE_STYLES;
41
- document.head.append(style);
42
- return () => style.remove();
43
- }, "dsmm: permission styles");
44
- const permissionInject = () => ({ controller: permissions }), permissionT = ctx.locale.bind(PERMISSIONS_NS);
45
- ctx.slots.inject("settings.section", () => ctx.slots.register({ name: "settings.section", id: "dsmm-permissions", order: 35,
46
- label: () => permissionT("title"), locale: PERMISSIONS_NS, inject: permissionInject }, PermissionsPanel));
47
- ctx.slots.inject("conversation.view", () => ctx.slots.register({ name: "conversation.view", id: "dsmm-permissions", order: 35,
48
- label: () => permissionT("title"), locale: PERMISSIONS_NS, inject: permissionInject }, PermissionsPanel));
40
+ const temporaryPermissions = registerTemporaryPermissionEntry(ctx, permissions);
49
41
  void ctx.inject(["connection"], connectionCtx => {
50
42
  const handle = connectionCtx.connection, invoke = permissionClient(handle);
51
43
  const update = () => { const generation = handle.generation.getSnapshot(); permissions.bindConnection(generation === undefined ? null : invoke, generation); };
@@ -76,46 +68,10 @@ export async function apply(ctx) {
76
68
  });
77
69
  let deployment = null;
78
70
  let profiles = null;
79
- let children = null;
80
- const observeChildAdmission = () => {
81
- const session = profiles?.store.getSnapshot().session;
82
- if (session !== null && session !== undefined)
83
- children?.observeAdmission(session.sessionId, session.admissionEpoch);
84
- };
85
- await ctx.inject(["remote.dsmmChildren"], childCtx => {
86
- const controller = new ChildrenController(childCtx.remote.dsmmChildren);
87
- children = controller;
88
- childCtx.effect(() => () => { children = null; controller.dispose(); }, "dsmm: child controls");
89
- childCtx.effect(() => childCtx.locale.register(CHILDREN_NS, { en: childrenLocaleEn, zh: childrenLocaleZh }), "dsmm: child locale");
90
- childCtx.effect(() => {
91
- const style = document.createElement("style");
92
- style.dataset.dsmmChildren = "";
93
- style.textContent = PROFILE_STYLES;
94
- document.head.append(style);
95
- return () => style.remove();
96
- }, "dsmm: child styles");
97
- const t = childCtx.locale.bind(CHILDREN_NS);
98
- childCtx.slots.inject("conversation.view", () => childCtx.slots.register({ name: "conversation.view", id: "dsmm-children", order: 30,
99
- label: () => t("title"), locale: CHILDREN_NS, inject: () => ({ hooks: { children: controller.store }, ...controller.actions }) }, ChildrenPanel));
100
- void childCtx.inject(["connection"], connectionCtx => {
101
- const handle = connectionCtx.connection;
102
- const update = () => { const generation = handle.generation.getSnapshot(); controller.bindConnection(generation === undefined ? null : handle, generation); };
103
- update();
104
- connectionCtx.effect(() => handle.generation.subscribe(update));
105
- connectionCtx.effect(() => () => controller.bindConnection(null), "dsmm: child connection withdrawal");
106
- });
107
- void childCtx.inject(["uiSession", "sessions"], sessionCtx => {
108
- const source = sessionCtx.uiSession.adapter.current, nativeSessions = sessionCtx.sessions;
109
- const update = () => { const id = source.getSnapshot().key; controller.bindScope(id ?? null, id === undefined ? null : nativeSessions.binding(id) ?? null); observeChildAdmission(); };
110
- update();
111
- sessionCtx.effect(() => source.subscribe(update));
112
- sessionCtx.effect(() => () => controller.bindScope(null, null), "dsmm: child session withdrawal");
113
- });
114
- observeChildAdmission();
115
- });
116
71
  // This core-owned graph must not depend on DW, named profiles or a session.
117
72
  await ctx.inject(["remote.dsmmConfig"], (coreCtx) => {
118
73
  const core = new DeploymentController(coreCtx.remote.dsmmConfig, "global");
74
+ const workspace = deploymentWorkspace(core, permissions);
119
75
  void coreCtx.inject(["connection"], connectionCtx => {
120
76
  core.bindConnection(connectionCtx.connection.generation);
121
77
  void core.refresh();
@@ -123,7 +79,7 @@ export async function apply(ctx) {
123
79
  deployment = core;
124
80
  if (profiles !== null)
125
81
  core.setSession(profiles.store.getSnapshot().session);
126
- coreCtx.effect(() => () => { deployment = null; core.dispose(); }, "dsmm: core settings editor");
82
+ coreCtx.effect(() => () => { deployment = null; workspace.dispose(); core.dispose(); }, "dsmm: core settings editor");
127
83
  coreCtx.effect(() => coreCtx.locale.register(DEPLOYMENT_NS, { en: deploymentEn, zh: deploymentZh }), "dsmm: core locale");
128
84
  coreCtx.effect(() => {
129
85
  const style = document.createElement("style");
@@ -132,33 +88,24 @@ export async function apply(ctx) {
132
88
  document.head.append(style);
133
89
  return () => style.remove();
134
90
  }, "dsmm: core styles");
135
- const t = coreCtx.locale.bind(DEPLOYMENT_NS);
136
- const inject = () => ({ core, remote: coreCtx.remote.dsmmConfig });
137
- coreCtx.slots.inject("plugins.item", () => coreCtx.slots.register({ name: "plugins.item", id: "dsmm", label: () => t("title"), order: 30, locale: DEPLOYMENT_NS, inject }, DeploymentPage));
138
- // Native ConfigForms owns its transport/authority; absent service leaves only core controls.
91
+ const inject = () => ({ core, remote: coreCtx.remote.dsmmConfig, workspace, temporaryPermissions, permissionsT: coreCtx.locale.bind(PERMISSIONS_NS) });
92
+ coreCtx.slots.inject("plugins.bundle.config", () => coreCtx.slots.register({ name: "plugins.bundle.config", key: "@dsmm/dsmm", locale: DEPLOYMENT_NS, inject }, DeploymentPage));
93
+ // The canonical bundle owner passes only view. Namespace comes from the authenticated snapshot.
139
94
  void coreCtx.inject(["configForms"], formCtx => {
140
- const injectProfile = () => ({ ...inject(), forms: formCtx.configForms, profilePage: true });
141
- formCtx.slots.inject("plugins.bundle.config", () => formCtx.slots.register({ name: "plugins.bundle.config", key: "@dsmm/dsmm", locale: DEPLOYMENT_NS, inject: injectProfile }, DeploymentPage));
142
- let namespace = null, disposeRow;
143
- const registerRow = () => {
144
- const next = core.getSnapshot().snapshot?.namespace ?? null;
145
- if (next === namespace)
146
- return;
147
- disposeRow?.();
148
- namespace = next;
149
- if (next !== null)
150
- disposeRow = formCtx.slots.inject("plugins.row.config", () => formCtx.slots.register({ name: "plugins.row.config", key: `@dsmm/dsmm#${next}`, locale: DEPLOYMENT_NS, inject: () => ({ ...injectProfile(), rowNamespace: next }) }, DeploymentPage));
151
- };
152
- registerRow();
153
- formCtx.effect(() => core.subscribe(registerRow));
154
- formCtx.effect(() => () => disposeRow?.());
95
+ workspace.bindForms(formCtx.configForms);
96
+ formCtx.effect(() => () => workspace.bindForms(null));
155
97
  });
156
98
  void core.refresh();
157
99
  });
158
100
  await ctx.inject(["remote.dsmmProfiles"], (profileCtx) => {
159
101
  const controller = new ProfilesController(profileCtx.remote.dsmmProfiles);
102
+ void profileCtx.inject(["connection"], connectionCtx => {
103
+ controller.bindConnection(connectionCtx.connection.generation);
104
+ void controller.refresh();
105
+ connectionCtx.effect(() => () => controller.bindConnection(null), "dsmm: profile connection withdrawal");
106
+ });
160
107
  profiles = controller;
161
- profileCtx.effect(() => controller.store.subscribe(() => { deployment?.setSession(controller.store.getSnapshot().session); observeChildAdmission(); }));
108
+ profileCtx.effect(() => controller.store.subscribe(() => { deployment?.setSession(controller.store.getSnapshot().session); }));
162
109
  profileCtx.effect(() => () => { profiles = null; deployment?.setSession(null); });
163
110
  profileCtx.effect(() => () => controller.dispose(), "dsmm: profile editor");
164
111
  profileCtx.effect(() => profileCtx.locale.register(NS, { en, zh }), "dsmm: profile locale");
@@ -170,6 +117,10 @@ export async function apply(ctx) {
170
117
  return () => style.remove();
171
118
  }, "dsmm: profile styles");
172
119
  const t = profileCtx.locale.bind(NS);
120
+ void profileCtx.inject(["conversation"], conversationCtx => {
121
+ controller.attachComposerBlocks(conversationCtx.conversation.blocks, () => t("sessionSelectionBlock"));
122
+ conversationCtx.effect(() => () => controller.attachComposerBlocks(null), "dsmm: profile composer block lifetime");
123
+ });
173
124
  profileCtx.slots.inject("settings.section", () => profileCtx.slots.register({
174
125
  name: "settings.section", id: "dsmm-profiles", order: 30,
175
126
  label: () => t("title"), locale: NS,
@@ -221,7 +172,6 @@ export async function apply(ctx) {
221
172
  modelCtx.effect(() => () => controller.attachModelInteractionSource(null, null), "dsmm: native model interaction withdrawal");
222
173
  });
223
174
  });
224
- void controller.refresh();
225
175
  });
226
176
  }
227
177
  //# sourceMappingURL=index.js.map
@@ -1,5 +1,10 @@
1
1
  export declare const NS = "settings.dsmm-profiles";
2
2
  export declare const en: {
3
+ sessionChooseWorkspace: string;
4
+ sessionSelectionBlock: string;
5
+ sessionCommittedRefresh: string;
6
+ sessionUnconfirmedRefresh: string;
7
+ technicalDetails: string;
3
8
  diagnosticJsonc: string;
4
9
  diagnosticDuplicate: string;
5
10
  diagnosticUnsafe: string;
@@ -61,6 +66,8 @@ export declare const en: {
61
66
  headerCompactProfiles: string;
62
67
  headerCompactRefresh: string;
63
68
  headerNoSession: string;
69
+ sessionNewRequired: string;
70
+ sessionModuleOff: string;
64
71
  headerModeEnable: string;
65
72
  headerModeDisable: string;
66
73
  headerModePreset: string;
@@ -99,6 +106,11 @@ export declare const en: {
99
106
  dirty: string;
100
107
  savedNotApplied: string;
101
108
  savedApplied: string;
109
+ versionObserved: string;
110
+ versionAbsent: string;
111
+ versionUnknown: string;
112
+ savedRelationshipUnknown: string;
113
+ savedRefreshRequired: string;
102
114
  saved: string;
103
115
  applied: string;
104
116
  resetDone: string;
@@ -139,6 +151,7 @@ export declare const en: {
139
151
  headerModelUnconfirmed: string;
140
152
  headerAppliedWithModel: string;
141
153
  headerModelChoiceChanged: string;
154
+ headerActionUnavailable: string;
142
155
  headerActivationRefused: string;
143
156
  headerSelectionRefused: string;
144
157
  headerIssueCode: string;