@dsmm/dsmm 0.3.2 → 0.3.4

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 (190) hide show
  1. package/README.md +2 -2
  2. package/agent-presets/dsmm-builder/agent.cordis.yml +1 -1
  3. package/agent-presets/dsmm-clarifier/agent.cordis.yml +1 -1
  4. package/agent-presets/dsmm-code-search/agent.cordis.yml +1 -1
  5. package/agent-presets/dsmm-coding/agent.cordis.yml +3 -2
  6. package/agent-presets/dsmm-complex/agent.cordis.yml +2 -1
  7. package/agent-presets/dsmm-creative/agent.cordis.yml +1 -1
  8. package/agent-presets/dsmm-cross-cutting/agent.cordis.yml +1 -1
  9. package/agent-presets/dsmm-deep/agent.cordis.yml +2 -1
  10. package/agent-presets/dsmm-doc-search/agent.cordis.yml +1 -1
  11. package/agent-presets/dsmm-documenting/agent.cordis.yml +1 -1
  12. package/agent-presets/dsmm-frontend/agent.cordis.yml +4 -2
  13. package/agent-presets/dsmm-hard-reasoning/agent.cordis.yml +1 -1
  14. package/agent-presets/dsmm-media-reader/agent.cordis.yml +1 -1
  15. package/agent-presets/dsmm-normal-task/agent.cordis.yml +3 -2
  16. package/agent-presets/dsmm-oracle/agent.cordis.yml +1 -1
  17. package/agent-presets/dsmm-oracle-2nd/agent.cordis.yml +1 -1
  18. package/agent-presets/dsmm-orchestrator/agent.cordis.yml +11 -1
  19. package/agent-presets/dsmm-plan-critic/agent.cordis.yml +1 -1
  20. package/agent-presets/dsmm-planner/agent.cordis.yml +1 -1
  21. package/agent-presets/dsmm-quick/agent.cordis.yml +2 -1
  22. package/agent-presets/dsmm-research/agent.cordis.yml +1 -1
  23. package/agent-presets/dsmm-reviewer/agent.cordis.yml +1 -1
  24. package/cordis.patch.yml +0 -9
  25. package/docs/agent-presets.md +5 -5
  26. package/docs/compatibility.md +2 -6
  27. package/docs/migration-from-ocmm.md +1 -1
  28. package/docs/native-permissions.md +11 -3
  29. package/docs/roadmap.md +31 -11
  30. package/docs/runtime-recovery.md +30 -2
  31. package/docs/settings-status.md +7 -5
  32. package/docs/skill-sync.md +13 -14
  33. package/lib/client/ChildrenPanel.d.ts +1 -4
  34. package/lib/client/ChildrenPanel.js +3 -3
  35. package/lib/client/DeploymentFields.js +12 -1
  36. package/lib/client/DeploymentPage.d.ts +1 -3
  37. package/lib/client/DeploymentPage.js +30 -18
  38. package/lib/client/NativeCommandEntries.js +47 -37
  39. package/lib/client/PermissionRuleEntries.d.ts +17 -0
  40. package/lib/client/PermissionRuleEntries.js +70 -0
  41. package/lib/client/PermissionsPanel.d.ts +1 -3
  42. package/lib/client/PermissionsPanel.js +5 -4
  43. package/lib/client/children-locales.d.ts +4 -4
  44. package/lib/client/controller.js +4 -1
  45. package/lib/client/deployment-locales.d.ts +2 -2
  46. package/lib/client/deployment-locales.js +8 -9
  47. package/lib/client/deployment-modules.d.ts +5 -3
  48. package/lib/client/deployment-modules.js +4 -4
  49. package/lib/client/deployment-workspace.d.ts +4 -0
  50. package/lib/client/deployment-workspace.js +37 -11
  51. package/lib/client/index.js +2 -7
  52. package/lib/client/locales.js +131 -119
  53. package/lib/client/permission-controller.d.ts +13 -0
  54. package/lib/client/permission-controller.js +50 -23
  55. package/lib/client/permission-locales.d.ts +28 -30
  56. package/lib/client/permission-locales.js +38 -38
  57. package/lib/client/styles.d.ts +1 -1
  58. package/lib/client/styles.js +8 -8
  59. package/lib/client.js +2272 -3773
  60. package/lib/core-permission-authority.js +28 -16
  61. package/lib/index.d.ts +0 -2
  62. package/lib/index.js +11 -31
  63. package/lib/native-admission.d.ts +3 -3
  64. package/lib/native-admission.js +67 -66
  65. package/lib/permission-controller.js +1 -1
  66. package/lib/permission-fs-search.js +1 -2
  67. package/lib/permission-fs.js +1 -2
  68. package/lib/permission-native-command.js +6 -4
  69. package/lib/permission-settings.d.ts +21 -7
  70. package/lib/permission-settings.js +21 -9
  71. package/lib/permission-web.js +1 -2
  72. package/lib/preset-materializer.js +3 -3
  73. package/lib/preset-registry.d.ts +20 -2
  74. package/lib/preset-registry.js +46 -17
  75. package/lib/profile-diagnostics.js +1 -1
  76. package/lib/profile-remote.js +1 -3
  77. package/lib/role-identity.d.ts +1 -1
  78. package/lib/role-identity.js +16 -4
  79. package/lib/role-policy.d.ts +3 -0
  80. package/lib/role-policy.js +30 -6
  81. package/lib/role-subagents.js +6 -4
  82. package/lib/roles.d.ts +2 -0
  83. package/lib/roles.js +2 -0
  84. package/lib/runtime-integration.js +4 -4
  85. package/lib/settings.d.ts +1 -3
  86. package/lib/settings.js +8 -10
  87. package/lib/state.d.ts +4 -1
  88. package/lib/state.js +37 -6
  89. package/package.json +1 -5
  90. package/prompts/deepwork.md +13 -1
  91. package/prompts/source/agents/orchestrator.md +10 -0
  92. package/prompts/source/category/coding.md +2 -1
  93. package/prompts/source/category/complex.md +1 -0
  94. package/prompts/source/category/deep.md +1 -0
  95. package/prompts/source/category/frontend.md +3 -1
  96. package/prompts/source/category/normal-task.md +2 -1
  97. package/prompts/source/category/quick.md +1 -0
  98. package/prompts/source/deepwork/claude-opus-5.md +2 -0
  99. package/prompts/source/deepwork/default.md +12 -0
  100. package/prompts/source/deepwork/gemini.md +6 -1
  101. package/prompts/source/deepwork/glm.md +5 -1
  102. package/prompts/source/deepwork/gpt.md +22 -2
  103. package/prompts/source/deepwork/kimi-k27.md +2 -0
  104. package/prompts/source/deepwork/planner.md +3 -1
  105. package/prompts/source/deepwork/swe-2.md +2 -0
  106. package/prompts/source/manifest.json +3 -68
  107. package/prompts/source/shared/dsh-host-contract.md +1 -1
  108. package/skills/ast-grep/SKILL.md +1 -1
  109. package/skills/brainstorming/SKILL.md +1 -1
  110. package/skills/coding-agent-sessions/SKILL.md +1 -1
  111. package/skills/debugging/SKILL.md +1 -1
  112. package/skills/dispatching-parallel-agents/SKILL.md +1 -1
  113. package/skills/frontend/SKILL.md +1 -1
  114. package/skills/git-master/SKILL.md +1 -1
  115. package/skills/init-deep/SKILL.md +1 -1
  116. package/skills/receiving-code-review/SKILL.md +1 -1
  117. package/skills/remove-ai-slops/SKILL.md +1 -1
  118. package/skills/requesting-code-review/SKILL.md +1 -1
  119. package/skills/subagent-driven-development/SKILL.md +1 -1
  120. package/skills/using-git-worktrees/SKILL.md +1 -1
  121. package/skills/writing-plans/SKILL.md +1 -1
  122. package/lib/client/ChildPermissions.d.ts +0 -43
  123. package/lib/client/ChildPermissions.js +0 -100
  124. package/lib/client/HistoryContinuation.d.ts +0 -7
  125. package/lib/client/HistoryContinuation.js +0 -22
  126. package/lib/client/PermissionPanelEntry.d.ts +0 -8
  127. package/lib/client/PermissionPanelEntry.js +0 -11
  128. package/lib/client/TemporaryPermissions.d.ts +0 -21
  129. package/lib/client/TemporaryPermissions.js +0 -94
  130. package/lib/client/history-controller.d.ts +0 -29
  131. package/lib/client/history-controller.js +0 -111
  132. package/lib/client/history-entry.d.ts +0 -11
  133. package/lib/client/history-entry.js +0 -106
  134. package/lib/client/history-locales.d.ts +0 -95
  135. package/lib/client/history-locales.js +0 -41
  136. package/lib/client/temporary-permission-client.d.ts +0 -20
  137. package/lib/client/temporary-permission-client.js +0 -52
  138. package/lib/client/temporary-permission-entry.d.ts +0 -6
  139. package/lib/client/temporary-permission-entry.js +0 -56
  140. package/lib/history-candidates.d.ts +0 -30
  141. package/lib/history-candidates.js +0 -176
  142. package/lib/history-codec.d.ts +0 -11
  143. package/lib/history-codec.js +0 -102
  144. package/lib/history-contract.d.ts +0 -44
  145. package/lib/history-contract.js +0 -2
  146. package/lib/history-controller.d.ts +0 -42
  147. package/lib/history-controller.js +0 -329
  148. package/lib/history-policy.d.ts +0 -4
  149. package/lib/history-policy.js +0 -8
  150. package/lib/history-remote.d.ts +0 -28
  151. package/lib/history-remote.js +0 -17
  152. package/lib/history-rpc.d.ts +0 -24
  153. package/lib/history-rpc.js +0 -136
  154. package/lib/history-support.d.ts +0 -15
  155. package/lib/history-support.js +0 -21
  156. package/lib/history-types.d.ts +0 -67
  157. package/lib/history-types.js +0 -2
  158. package/lib/permission-child-control.d.ts +0 -36
  159. package/lib/permission-child-control.js +0 -164
  160. package/lib/permission-exec-argv.d.ts +0 -32
  161. package/lib/permission-exec-argv.js +0 -171
  162. package/lib/permission-temporary-files.d.ts +0 -19
  163. package/lib/permission-temporary-files.js +0 -248
  164. package/lib/permission-temporary-grants.d.ts +0 -106
  165. package/lib/permission-temporary-grants.js +0 -198
  166. package/lib/permission-temporary-install.d.ts +0 -25
  167. package/lib/permission-temporary-install.js +0 -86
  168. package/lib/permission-temporary-remote.d.ts +0 -19
  169. package/lib/permission-temporary-remote.js +0 -75
  170. package/lib/permission-temporary-rpc.d.ts +0 -37
  171. package/lib/permission-temporary-rpc.js +0 -154
  172. package/lib/permission-temporary-types.d.ts +0 -47
  173. package/lib/permission-temporary-types.js +0 -2
  174. package/lib/permission-temporary-web.d.ts +0 -11
  175. package/lib/permission-temporary-web.js +0 -154
  176. package/patches/dsh-approval-settlement/@deepseek-ai__dsh-api-gateway@0.2.1-rc.2.patch +0 -13291
  177. package/patches/dsh-approval-settlement/@deepseek-ai__dsh-api-remotes@0.2.1-rc.2.patch +0 -9133
  178. package/patches/dsh-approval-settlement/@deepseek-ai__dsh-client-ui-approval@0.2.1-rc.2.patch +0 -156
  179. package/patches/dsh-approval-settlement/@deepseek-ai__dsh-subagent@0.2.1-rc.2.patch +0 -3546
  180. package/patches/dsh-approval-settlement/@deepseek-ai__dsh-user-approval@0.2.1-rc.2.patch +0 -431
  181. package/patches/dsh-approval-settlement/@deepseek-ai__dsh-web@0.2.1-rc.2.patch +0 -119
  182. package/patches/dsh-approval-settlement/README.md +0 -41
  183. package/patches/dsh-approval-settlement/metadata.json +0 -10
  184. package/patches/dsh-session-activation/@deepseek-ai__dsh-agent-loop@0.2.1-rc.2.patch +0 -383
  185. package/patches/dsh-session-activation/@deepseek-ai__dsh-agent-preset-registry@0.2.1-rc.2.patch +0 -55
  186. package/patches/dsh-session-activation/@deepseek-ai__dsh-api-session-controller@0.2.1-rc.2.patch +0 -16673
  187. package/patches/dsh-session-activation/@deepseek-ai__dsh-client-ui-subagent@0.2.1-rc.2.patch +0 -29
  188. package/patches/dsh-session-activation/@deepseek-ai__dsh-client-ui-workspace@0.2.1-rc.2.patch +0 -196
  189. package/patches/dsh-session-activation/@deepseek-ai__dsh-session-persistence-jsonl@0.2.1-rc.2.patch +0 -35
  190. package/patches/dsh-session-activation/@deepseek-ai__dsh-session-persistence@0.2.1-rc.2.patch +0 -40
@@ -1,106 +0,0 @@
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
@@ -1,95 +0,0 @@
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
@@ -1,41 +0,0 @@
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
@@ -1,20 +0,0 @@
1
- import type { ConnectionHandle } from "@deepseek-ai/dsh-client-connection/client";
2
- import type { PendingApproval } from "@deepseek-ai/dsh-client-ui-approval/client";
3
- import type { ChildPermissionRemote, TemporaryPermissionDuration, TemporaryPermissionRemote } from "../permission-temporary-types.js";
4
- export declare function temporaryPermissionClient(connection: ConnectionHandle, signal: AbortSignal): TemporaryPermissionRemote & ChildPermissionRemote;
5
- /** Public PendingApproval type only: answers use the native object and first-wins path. */
6
- export type TemporaryPendingApproval = PendingApproval & {
7
- readonly requestId?: string;
8
- readonly deliveryId?: string;
9
- answer(outcome: "allowed-once" | "rejected", options?: {
10
- readonly permit?: string;
11
- readonly retention?: string;
12
- }): Promise<void>;
13
- };
14
- export declare function pendingDelivery(pending: TemporaryPendingApproval): {
15
- requestId: string;
16
- deliveryId: string;
17
- } | undefined;
18
- export declare function retainAndAnswer(pending: TemporaryPendingApproval, remote: TemporaryPermissionRemote, duration: TemporaryPermissionDuration, current: () => boolean, scope?: string): Promise<void>;
19
- export declare function answerWithTemporaryPermit(pending: TemporaryPendingApproval, remote: TemporaryPermissionRemote, current: () => boolean): Promise<void>;
20
- //# sourceMappingURL=temporary-permission-client.d.ts.map
@@ -1,52 +0,0 @@
1
- import { TEMPORARY_PERMISSION_REMOTE, parseTemporaryGrants, parseTemporaryRequest, parseChildPermission } from "../permission-temporary-remote.js";
2
- export function temporaryPermissionClient(connection, signal) {
3
- const generation = connection.generation.getSnapshot();
4
- const check = () => { signal.throwIfAborted(); if (connection.generation.getSnapshot() !== generation)
5
- throw new Error("Connection generation changed."); };
6
- async function call(method, args) {
7
- check();
8
- const result = await connection.rpc.call("/api", `dsmmTemporaryPermissions/${method}`, { args }, signal);
9
- check();
10
- if (!result.ok)
11
- throw new Error("Temporary permission service unavailable; use the native once-only prompt.");
12
- const descriptor = TEMPORARY_PERMISSION_REMOTE.descriptors.find(value => value.method === method);
13
- if (descriptor.result.mode !== "strict")
14
- throw new Error("Invalid permission protocol.");
15
- return descriptor.result.create().parse(result.value);
16
- }
17
- return {
18
- async describe(sessionId) { return parseTemporaryGrants(await call("describe", { sessionId })); },
19
- async request(sessionId, delivery) { return parseTemporaryRequest(await call("request", { sessionId, delivery })); },
20
- async retain(sessionId, delivery, duration, scope = "exact") { return String(await call("retain", { sessionId, delivery, duration, scope })); },
21
- async permit(sessionId, delivery) { const value = await call("permit", { sessionId, delivery }); return value === null ? null : String(value); },
22
- async revoke(sessionId, grantId) { return parseTemporaryGrants(await call("revoke", { sessionId, grantId })); },
23
- async child(sessionId, childSessionId) { return parseChildPermission(await call("child", { sessionId, childSessionId })); },
24
- async enableChild(sessionId, childSessionId) { return parseChildPermission(await call("enableChild", { sessionId, childSessionId })); },
25
- async revokeChild(sessionId, childSessionId) { return parseChildPermission(await call("revokeChild", { sessionId, childSessionId })); },
26
- };
27
- }
28
- export function pendingDelivery(pending) {
29
- return pending.requestId && pending.deliveryId ? { requestId: pending.requestId, deliveryId: pending.deliveryId } : undefined;
30
- }
31
- export async function retainAndAnswer(pending, remote, duration, current, scope = "exact") {
32
- if (!current() || !pending.answerable)
33
- return;
34
- const delivery = pendingDelivery(pending);
35
- let retention;
36
- if (duration !== "once") {
37
- if (!delivery)
38
- throw new Error("Scoped approval unsupported.");
39
- retention = await remote.retain(pending.sessionId, delivery, duration, scope);
40
- }
41
- if (current() && pending.answerable)
42
- await pending.answer("allowed-once", retention === undefined ? undefined : { retention });
43
- }
44
- export async function answerWithTemporaryPermit(pending, remote, current) {
45
- const delivery = pendingDelivery(pending);
46
- if (!delivery || !current() || !pending.answerable)
47
- return;
48
- const permit = await remote.permit(pending.sessionId, delivery);
49
- if (permit && current() && pending.answerable)
50
- await pending.answer("allowed-once", { permit });
51
- }
52
- //# sourceMappingURL=temporary-permission-client.js.map
@@ -1,6 +0,0 @@
1
- import type { Context } from "@deepseek-ai/cordis";
2
- import type { TemporaryPermissionRemote } from "../permission-temporary-types.js";
3
- import type { PermissionController } from "./permission-controller.js";
4
- /** Approval slots belong to the connection generation; the drawer also borrows its exact current scope. */
5
- export declare function registerTemporaryPermissionEntry(ctx: Context, permissions: PermissionController): import("@deepseek-ai/dsh-client-store").SnapshotStore<TemporaryPermissionRemote | undefined>;
6
- //# sourceMappingURL=temporary-permission-entry.d.ts.map
@@ -1,56 +0,0 @@
1
- import { createSnapshotStore } from "@deepseek-ai/dsh-client-store";
2
- import { registerTemporaryPermissionSlots } from "./TemporaryPermissions.js";
3
- import { temporaryPermissionClient } from "./temporary-permission-client.js";
4
- /** Approval slots belong to the connection generation; the drawer also borrows its exact current scope. */
5
- export function registerTemporaryPermissionEntry(ctx, permissions) {
6
- const store = createSnapshotStore(undefined);
7
- void ctx.inject(["connection"], connectionCtx => {
8
- const connection = connectionCtx.connection;
9
- let generation = connection.generation.getSnapshot(), lifetime;
10
- let owner;
11
- let scopeLifetime, scopeKey = "";
12
- const bindScope = () => {
13
- const state = permissions.store.getSnapshot();
14
- const key = JSON.stringify([state.generation, state.sessionId, state.scope, state.connected]);
15
- if (key === scopeKey)
16
- return;
17
- scopeKey = key;
18
- scopeLifetime?.abort();
19
- scopeLifetime = undefined;
20
- store.set(undefined);
21
- if (!lifetime || lifetime.signal.aborted || !state.connected || state.sessionId === null || state.scope === "unknown")
22
- return;
23
- scopeLifetime = new AbortController();
24
- store.set(temporaryPermissionClient(connection, AbortSignal.any([lifetime.signal, scopeLifetime.signal])));
25
- };
26
- const update = () => {
27
- const next = connection.generation.getSnapshot();
28
- if (lifetime && generation === next)
29
- return;
30
- generation = next;
31
- lifetime?.abort();
32
- lifetime = undefined;
33
- scopeLifetime?.abort();
34
- scopeKey = "";
35
- void owner?.dispose();
36
- owner = undefined;
37
- store.set(undefined);
38
- if (next !== undefined) {
39
- const current = lifetime = new AbortController();
40
- owner = connectionCtx.plugin({ name: "dsmm-temporary-permission-generation", apply(ownerCtx) {
41
- ownerCtx.effect(() => () => current.abort());
42
- if (current.signal.aborted || connection.generation.getSnapshot() !== next)
43
- return;
44
- registerTemporaryPermissionSlots(ownerCtx, connection);
45
- } });
46
- }
47
- bindScope();
48
- };
49
- update();
50
- connectionCtx.effect(() => connection.generation.subscribe(update));
51
- connectionCtx.effect(() => permissions.store.subscribe(bindScope));
52
- connectionCtx.effect(() => () => { lifetime?.abort(); scopeLifetime?.abort(); store.set(undefined); }, "dsmm: temporary permission connection lifetime");
53
- });
54
- return store;
55
- }
56
- //# sourceMappingURL=temporary-permission-entry.js.map
@@ -1,30 +0,0 @@
1
- import type { Context } from "@deepseek-ai/cordis";
2
- import type { SessionInspection } from "@deepseek-ai/dsh-session-persistence";
3
- import type { NativeAdmission } from "./native-admission.js";
4
- import type { DsmmProfileRuntime } from "./profile-runtime.js";
5
- import type { DsmmDeploymentConfig } from "./deployment-config.js";
6
- import type { HistoryCandidate, HistoryCandidates } from "./history-contract.js";
7
- import type { HistoryPreviewRequest } from "./history-types.js";
8
- /** Current deployment/profile and native composition only; history supplies content and restrictive ceilings. */
9
- export declare class DsmmHistoryCandidates implements HistoryCandidates {
10
- private readonly ctx;
11
- private readonly profiles;
12
- private readonly deployment;
13
- private readonly admission;
14
- readonly signal: AbortSignal;
15
- private modelGeneration;
16
- constructor(ctx: Context, profiles: DsmmProfileRuntime, deployment: DsmmDeploymentConfig, admission: NativeAdmission);
17
- checkCompatibility(): Promise<void>;
18
- choices(signal: AbortSignal): Promise<{
19
- presets: {
20
- id: string;
21
- label: string;
22
- }[];
23
- profiles: {
24
- id: string;
25
- label: string;
26
- }[];
27
- }>;
28
- prepare(request: HistoryPreviewRequest, inspection: SessionInspection, signal: AbortSignal): Promise<HistoryCandidate>;
29
- }
30
- //# sourceMappingURL=history-candidates.d.ts.map
@@ -1,176 +0,0 @@
1
- import { createRequire } from "node:module";
2
- import { isDeepStrictEqual } from "node:util";
3
- import { symbols } from "@deepseek-ai/cordis";
4
- import { ReasoningEffortId } from "@deepseek-ai/dsh-llm";
5
- import { setSandboxMode } from "@deepseek-ai/dsh-sandbox-policy";
6
- import { setApprovalPolicy } from "@deepseek-ai/dsh-user-approval";
7
- import { HistoryRefusal } from "./history-controller.js";
8
- import { DSMM_ROLES, isDsmmRoleId } from "./roles.js";
9
- import { isRootRoleEnabled } from "./settings.js";
10
- import { appendModeRecord } from "./session-metadata.js";
11
- import { effectiveHistoryGitWriteGuard } from "./history-policy.js";
12
- const require = createRequire(import.meta.url), sdk = createRequire(require.resolve("@deepseek-ai/dsh-agent-preset-registry"));
13
- const { createScope, scopeParentOf } = sdk("@deepseek-ai/dsh-scope");
14
- const original = (value) => Reflect.get(value, symbols.original) ?? value;
15
- const services = ["llm", "tools", "systemPrompt", "skills", "sandboxPolicy", "approval"];
16
- function requireCurrentLease(lease) {
17
- if (!("assertCurrent" in lease) || typeof lease.assertCurrent !== "function")
18
- throw new HistoryRefusal("unsupported-host");
19
- }
20
- /** Current deployment/profile and native composition only; history supplies content and restrictive ceilings. */
21
- export class DsmmHistoryCandidates {
22
- ctx;
23
- profiles;
24
- deployment;
25
- admission;
26
- signal;
27
- modelGeneration = 0;
28
- constructor(ctx, profiles, deployment, admission) {
29
- this.ctx = ctx;
30
- this.profiles = profiles;
31
- this.deployment = deployment;
32
- this.admission = admission;
33
- this.signal = admission.lifetime.signal;
34
- ctx.on("llm/adapters-updated", () => { this.modelGeneration++; }, { global: true });
35
- }
36
- async checkCompatibility() {
37
- this.signal.throwIfAborted();
38
- const registry = this.ctx.agentPresets, preset = (await registry.list()).find(row => !row.broken);
39
- if (!preset)
40
- throw new HistoryRefusal("unavailable");
41
- const lease = await registry.acquireScope(preset.id);
42
- try {
43
- requireCurrentLease(lease);
44
- lease.assertCurrent();
45
- this.signal.throwIfAborted();
46
- }
47
- finally {
48
- await lease[Symbol.asyncDispose]();
49
- }
50
- }
51
- async choices(signal) {
52
- signal.throwIfAborted();
53
- this.signal.throwIfAborted();
54
- const desired = await this.deployment.readDesired(), rows = await this.ctx.agentPresets.list(), profiles = await this.profiles.describe();
55
- signal.throwIfAborted();
56
- this.signal.throwIfAborted();
57
- return { presets: rows.filter(row => !row.broken && (!row.id.startsWith("dsmm-") || isDsmmRoleId(row.id) && isRootRoleEnabled(desired.settings, row.id)))
58
- .map(row => ({ id: row.id, label: (row.name ?? row.id).slice(0, 120) })),
59
- profiles: profiles.profiles.filter(row => row.revision !== null && row.error === undefined).map(row => ({ id: row.id, label: (row.label ?? row.id).slice(0, 120) })) };
60
- }
61
- async prepare(request, inspection, signal) {
62
- signal.throwIfAborted();
63
- this.signal.throwIfAborted();
64
- if (inspection.meta.origin === "subagent")
65
- throw new HistoryRefusal("child-owner-required");
66
- const profile = await this.profiles.prepareHistory(request.profileId, this.signal), settings = profile.admission.settings;
67
- if (request.preset.startsWith("dsmm-") && (!isDsmmRoleId(request.preset) || !isRootRoleEnabled(settings, request.preset)))
68
- throw new HistoryRefusal("unavailable");
69
- const registry = this.ctx.agentPresets, metadata = await registry.resolve(request.preset);
70
- if (metadata.broken)
71
- throw new HistoryRefusal("unavailable");
72
- const lease = await registry.acquireScope(request.preset);
73
- try {
74
- requireCurrentLease(lease);
75
- }
76
- catch (error) {
77
- await lease[Symbol.asyncDispose]();
78
- throw error;
79
- }
80
- const scope = createScope(this.ctx, {}, { parent: lease.key });
81
- const dispose = async () => { try {
82
- await scope.dispose();
83
- }
84
- finally {
85
- await lease[Symbol.asyncDispose]();
86
- } };
87
- try {
88
- const get = (name) => registry.serviceFor({ ctx: scope.ctx }, name) ?? this.ctx.get(name);
89
- const captured = services.map(name => get(name));
90
- if (captured.some(value => value === undefined))
91
- throw new HistoryRefusal("unavailable");
92
- const llm = get("llm"), sandbox = get("sandboxPolicy"), approval = get("approval");
93
- const permissions = this.ctx.get("dsmmPermissionController");
94
- if (!permissions)
95
- throw new HistoryRefusal("unavailable");
96
- await permissions.rules.refresh();
97
- const rules = permissions.rules.getPolicy(), permissionSignal = permissions.rules.signal;
98
- const source = this.deployment.permissionSource();
99
- if (source.globalRevision !== profile.admission.deployment?.globalRevision || source.nativeRevision !== profile.admission.deployment?.nativeRevision)
100
- throw new HistoryRefusal("stale");
101
- const generation = this.modelGeneration;
102
- const active = settings.modules.deepwork.enabled && (isDsmmRoleId(request.preset) || request.preset !== "minimal" && settings.defaultActive);
103
- const role = isDsmmRoleId(request.preset) ? request.preset : active ? "dsmm-orchestrator" : undefined;
104
- const route = role === undefined ? undefined : settings.roleRouting[role]?.primary;
105
- const defaultModel = this.ctx.get?.("agentDefaultModel");
106
- if (!route && !defaultModel)
107
- throw new HistoryRefusal("unavailable");
108
- const model = route === undefined ? structuredClone(defaultModel.currentSelection()) : { provider: route.provider, model: route.model,
109
- ...(route.reasoningEffort === undefined ? {} : { reasoningEffort: ReasoningEffortId(route.reasoningEffort) }) };
110
- await llm.resolveCallConfig(model, signal);
111
- const oldSandbox = inspection.events.filter(event => event.type === "sandbox/mode").at(-1);
112
- const oldApproval = inspection.events.filter(event => event.type === "approval/policy").at(-1);
113
- const oldPreset = inspection.events.filter(event => event.type === "agent-preset/selected").at(-1)?.data.agentPreset ?? inspection.meta.agentPreset;
114
- const readOnlyHistory = oldSandbox?.data.mode === "read-only" || DSMM_ROLES.some(role => role.id === oldPreset && role.access === "read-only");
115
- const defaultMode = sandbox.defaultMode, defaultApproval = approval.config.policy ?? "ask";
116
- const mode = readOnlyHistory ? "read-only" : defaultMode;
117
- const approvalPolicy = oldApproval?.data.policy === "never" ? "never" : defaultApproval;
118
- const check = () => {
119
- this.signal.throwIfAborted();
120
- permissionSignal.throwIfAborted();
121
- try {
122
- lease.assertCurrent();
123
- profile.assertCurrent();
124
- }
125
- catch {
126
- throw new HistoryRefusal("stale");
127
- }
128
- const current = this.ctx.get("dsmmPermissionController");
129
- const currentDefault = this.ctx.get?.("agentDefaultModel");
130
- if (!this.admission.isReady || original(this.ctx.agentPresets) !== original(registry) || this.modelGeneration !== generation
131
- || current === undefined || original(current) !== original(permissions) || current.rules.signal !== permissionSignal
132
- || current.rules.getPolicy().revision !== rules.revision || this.deployment.permissionSource().revision !== source.revision
133
- || captured.some((value, index) => { const now = get(services[index]); return value === undefined || now === undefined || original(value) !== original(now); })
134
- || route === undefined && (currentDefault === undefined || original(currentDefault) !== original(defaultModel) || !isDeepStrictEqual(currentDefault.currentSelection(), model))
135
- || sandbox.defaultMode !== defaultMode || (approval.config.policy ?? "ask") !== defaultApproval)
136
- throw new HistoryRefusal("stale");
137
- };
138
- check();
139
- signal.throwIfAborted();
140
- return { admission: profile.admission, model, signal: AbortSignal.any([this.signal, permissionSignal]),
141
- view: { preset: { id: request.preset, label: (metadata.name ?? metadata.id).slice(0, 120) }, profile: request.profileId === null ? null : { id: request.profileId, label: (profile.label ?? request.profileId).slice(0, 120) }, model,
142
- roles: DSMM_ROLES.filter(role => active && settings.roles[role.id]).map(role => ({ id: role.id, label: role.name })),
143
- restrictions: [`sandbox: ${mode}`, `approval: ${approvalPolicy}`, `Deepwork: ${active ? "on" : "off"}`, `DSMM Git-write guard: ${effectiveHistoryGitWriteGuard(settings, mode === "danger-full-access", active)}`],
144
- differences: ["Current preset, saved configuration and current native permissions replace historical execution settings. Historical approval outcomes and temporary grants are not reused."] },
145
- assertCurrent: check,
146
- revalidate: async (currentSignal) => {
147
- check();
148
- await profile.revalidate(currentSignal);
149
- await llm.resolveCallConfig(model, currentSignal);
150
- check();
151
- currentSignal.throwIfAborted();
152
- },
153
- install: async (agent, currentSignal) => {
154
- check();
155
- currentSignal.throwIfAborted();
156
- if (scopeParentOf(agent) !== lease.key || registry.composedPreset(agent.ctx) !== request.preset
157
- || captured.some((value, index) => { const actual = registry.serviceFor(agent, services[index]) ?? agent.ctx.get(services[index]); return value === undefined || actual === undefined || original(value) !== original(actual); }))
158
- throw new HistoryRefusal("stale");
159
- setSandboxMode(agent.session, mode);
160
- check();
161
- setApprovalPolicy(agent.session, approvalPolicy);
162
- check();
163
- appendModeRecord(agent.session, active);
164
- check();
165
- await this.admission.prepareHistory(agent, profile.admission, currentSignal);
166
- check();
167
- currentSignal.throwIfAborted();
168
- }, dispose };
169
- }
170
- catch (error) {
171
- await dispose();
172
- throw error;
173
- }
174
- }
175
- }
176
- //# sourceMappingURL=history-candidates.js.map
@@ -1,11 +0,0 @@
1
- import type { HistoryChoices, HistoryConfirmRequest, HistoryContinuationResult, HistoryFailure, HistoryJson, HistoryPreview, HistoryPreviewRequest, HistoryStatus } from "./history-types.js";
2
- export declare function historySessionId(input: unknown): string;
3
- export declare function historyJson(input: unknown, depth?: number, active?: Set<object>): HistoryJson;
4
- export declare function parseHistoryFailure(input: unknown): HistoryFailure;
5
- export declare function parseHistoryStatus(input: unknown): HistoryStatus;
6
- export declare function parseHistoryChoices(input: unknown): HistoryChoices;
7
- export declare function parseHistoryPreviewRequest(input: unknown): HistoryPreviewRequest;
8
- export declare function parseHistoryConfirmRequest(input: unknown): HistoryConfirmRequest;
9
- export declare function parseHistoryPreview(input: unknown): HistoryPreview;
10
- export declare function parseHistoryResult(input: unknown): HistoryContinuationResult;
11
- //# sourceMappingURL=history-codec.d.ts.map