@dsmm/dsmm 0.2.0 → 0.2.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 (291) hide show
  1. package/README.md +38 -66
  2. package/agent-presets/dsmm-builder/agent.cordis.yml +10 -2015
  3. package/agent-presets/dsmm-clarifier/agent.cordis.yml +24 -343
  4. package/agent-presets/dsmm-code-search/agent.cordis.yml +19 -6
  5. package/agent-presets/dsmm-coding/agent.cordis.yml +19 -438
  6. package/agent-presets/dsmm-complex/agent.cordis.yml +23 -1009
  7. package/agent-presets/dsmm-creative/agent.cordis.yml +25 -442
  8. package/agent-presets/dsmm-cross-cutting/agent.cordis.yml +29 -1013
  9. package/agent-presets/dsmm-deep/agent.cordis.yml +24 -1008
  10. package/agent-presets/dsmm-doc-search/agent.cordis.yml +19 -6
  11. package/agent-presets/dsmm-documenting/agent.cordis.yml +26 -439
  12. package/agent-presets/dsmm-frontend/agent.cordis.yml +21 -440
  13. package/agent-presets/dsmm-hard-reasoning/agent.cordis.yml +22 -441
  14. package/agent-presets/dsmm-media-reader/agent.cordis.yml +19 -6
  15. package/agent-presets/dsmm-normal-task/agent.cordis.yml +19 -438
  16. package/agent-presets/dsmm-oracle/agent.cordis.yml +25 -340
  17. package/agent-presets/dsmm-oracle-2nd/agent.cordis.yml +25 -340
  18. package/agent-presets/dsmm-orchestrator/agent.cordis.yml +29 -2025
  19. package/agent-presets/dsmm-plan-critic/agent.cordis.yml +24 -341
  20. package/agent-presets/dsmm-planner/agent.cordis.yml +14 -344
  21. package/agent-presets/dsmm-quick/agent.cordis.yml +19 -6
  22. package/agent-presets/dsmm-research/agent.cordis.yml +23 -8
  23. package/agent-presets/dsmm-reviewer/agent.cordis.yml +25 -340
  24. package/docs/agent-presets.md +36 -52
  25. package/docs/compatibility.md +50 -108
  26. package/docs/deferred-native-approval-risk.md +19 -0
  27. package/docs/design.md +2 -2
  28. package/docs/lsp.md +11 -21
  29. package/docs/migration-from-ocmm.md +2 -2
  30. package/docs/model-routing.md +84 -59
  31. package/docs/native-permissions.md +35 -0
  32. package/docs/profiles.md +40 -87
  33. package/docs/releasing.md +83 -2
  34. package/docs/roadmap.md +71 -17
  35. package/docs/settings-status.md +34 -169
  36. package/docs/skill-sync.md +52 -15
  37. package/lib/child-admission-contract.d.ts +37 -0
  38. package/lib/child-admission-contract.js +2 -0
  39. package/lib/child-admission.d.ts +42 -0
  40. package/lib/child-admission.js +162 -0
  41. package/lib/child-capture.d.ts +81 -0
  42. package/lib/child-capture.js +203 -0
  43. package/lib/child-evidence.d.ts +17 -0
  44. package/lib/child-evidence.js +43 -0
  45. package/lib/client/ChildrenPanel.d.ts +43 -0
  46. package/lib/client/ChildrenPanel.js +82 -0
  47. package/lib/client/DeploymentPage.js +15 -8
  48. package/lib/client/EditableChoice.d.ts +17 -0
  49. package/lib/client/EditableChoice.js +49 -0
  50. package/lib/client/PermissionsPanel.d.ts +14 -0
  51. package/lib/client/PermissionsPanel.js +46 -0
  52. package/lib/client/ProfilesSection.js +30 -15
  53. package/lib/client/RoleAvailability.d.ts +7 -0
  54. package/lib/client/RoleAvailability.js +19 -0
  55. package/lib/client/SessionProfiles.js +27 -9
  56. package/lib/client/StructuredEditor.js +15 -7
  57. package/lib/client/children-controller.d.ts +98 -0
  58. package/lib/client/children-controller.js +296 -0
  59. package/lib/client/children-locales.d.ts +367 -0
  60. package/lib/client/children-locales.js +69 -0
  61. package/lib/client/controller.d.ts +6 -1
  62. package/lib/client/controller.js +14 -8
  63. package/lib/client/deployment-data.d.ts +2 -1
  64. package/lib/client/deployment-data.js +34 -5
  65. package/lib/client/deployment-locales.d.ts +4 -0
  66. package/lib/client/deployment-locales.js +11 -2
  67. package/lib/client/diagnostics.d.ts +14 -0
  68. package/lib/client/diagnostics.js +53 -0
  69. package/lib/client/index.d.ts +4 -0
  70. package/lib/client/index.js +96 -2
  71. package/lib/client/locales.d.ts +54 -0
  72. package/lib/client/locales.js +34 -16
  73. package/lib/client/permission-client.d.ts +16 -0
  74. package/lib/client/permission-client.js +38 -0
  75. package/lib/client/permission-controller.d.ts +62 -0
  76. package/lib/client/permission-controller.js +149 -0
  77. package/lib/client/permission-locales.d.ts +114 -0
  78. package/lib/client/permission-locales.js +75 -0
  79. package/lib/client/session-labels.js +4 -4
  80. package/lib/client/structured.js +19 -5
  81. package/lib/client/styles.d.ts +1 -1
  82. package/lib/client/styles.js +20 -0
  83. package/lib/client.js +5780 -1679
  84. package/lib/core-permission-authority.d.ts +18 -0
  85. package/lib/core-permission-authority.js +255 -0
  86. package/lib/core-permissions.d.ts +8 -0
  87. package/lib/core-permissions.js +33 -0
  88. package/lib/delivery-authority.d.ts +68 -0
  89. package/lib/delivery-authority.js +260 -0
  90. package/lib/deployment-config.d.ts +23 -0
  91. package/lib/deployment-config.js +61 -40
  92. package/lib/deployment-permission-rules.d.ts +55 -0
  93. package/lib/deployment-permission-rules.js +306 -0
  94. package/lib/dsh-types.d.ts +10 -4
  95. package/lib/guards.d.ts +1 -1
  96. package/lib/guards.js +29 -8
  97. package/lib/host-llm-startup.d.ts +41 -0
  98. package/lib/host-llm-startup.js +65 -0
  99. package/lib/host-llm.d.ts +92 -0
  100. package/lib/host-llm.js +325 -0
  101. package/lib/index.d.ts +15 -4
  102. package/lib/index.js +300 -47
  103. package/lib/legacy-child-policy.d.ts +51 -0
  104. package/lib/legacy-child-policy.js +123 -0
  105. package/lib/legacy-read-composition.d.ts +20 -0
  106. package/lib/legacy-read-composition.js +144 -0
  107. package/lib/legacy-read-contracts.d.ts +157 -0
  108. package/lib/legacy-read-contracts.js +39 -0
  109. package/lib/legacy-read-host.d.ts +19 -0
  110. package/lib/legacy-read-host.js +67 -0
  111. package/lib/legacy-read-integration.d.ts +121 -0
  112. package/lib/legacy-read-integration.js +522 -0
  113. package/lib/legacy-read-proxy.d.ts +26 -0
  114. package/lib/legacy-read-proxy.js +237 -0
  115. package/lib/live-pi-ai-owner.d.ts +18 -0
  116. package/lib/live-pi-ai-owner.js +144 -0
  117. package/lib/llm-runtime.d.ts +11 -0
  118. package/lib/llm-runtime.js +21 -0
  119. package/lib/managed-settings.d.ts +5 -0
  120. package/lib/managed-settings.js +14 -0
  121. package/lib/model-parameter-policy.d.ts +11 -0
  122. package/lib/model-parameter-policy.js +27 -0
  123. package/lib/model-routing.js +28 -17
  124. package/lib/modules.d.ts +13 -5
  125. package/lib/modules.js +17 -1
  126. package/lib/native-child-evidence.d.ts +42 -0
  127. package/lib/native-child-evidence.js +133 -0
  128. package/lib/native-pi-ai-wire.d.ts +37 -0
  129. package/lib/native-pi-ai-wire.js +261 -0
  130. package/lib/native-scope.js +1 -1
  131. package/lib/permission-bash.d.ts +6 -0
  132. package/lib/permission-bash.js +7 -0
  133. package/lib/permission-control.d.ts +73 -0
  134. package/lib/permission-control.js +205 -0
  135. package/lib/permission-controller.d.ts +68 -0
  136. package/lib/permission-controller.js +317 -0
  137. package/lib/permission-errors.d.ts +7 -0
  138. package/lib/permission-errors.js +21 -0
  139. package/lib/permission-fs-search.d.ts +5 -0
  140. package/lib/permission-fs-search.js +7 -0
  141. package/lib/permission-fs.d.ts +5 -0
  142. package/lib/permission-fs.js +7 -0
  143. package/lib/permission-native-access.d.ts +11 -0
  144. package/lib/permission-native-access.js +6 -0
  145. package/lib/permission-native-command.d.ts +10 -0
  146. package/lib/permission-native-command.js +93 -0
  147. package/lib/permission-native-rules.d.ts +75 -0
  148. package/lib/permission-native-rules.js +278 -0
  149. package/lib/permission-pwsh.d.ts +6 -0
  150. package/lib/permission-pwsh.js +7 -0
  151. package/lib/permission-remote.d.ts +26 -0
  152. package/lib/permission-remote.js +53 -0
  153. package/lib/permission-rpc.d.ts +29 -0
  154. package/lib/permission-rpc.js +152 -0
  155. package/lib/permission-rules.d.ts +115 -0
  156. package/lib/permission-rules.js +256 -0
  157. package/lib/permission-settings.d.ts +45 -0
  158. package/lib/permission-settings.js +48 -0
  159. package/lib/permission-shell.d.ts +38 -0
  160. package/lib/permission-shell.js +150 -0
  161. package/lib/permission-web.d.ts +5 -0
  162. package/lib/permission-web.js +7 -0
  163. package/lib/preset-registry.js +36 -25
  164. package/lib/profile-diagnostics.d.ts +45 -0
  165. package/lib/profile-diagnostics.js +148 -0
  166. package/lib/profile-locale.d.ts +3 -0
  167. package/lib/profile-locale.js +2 -0
  168. package/lib/profile-remote.d.ts +8 -0
  169. package/lib/profile-remote.js +163 -39
  170. package/lib/profile-rpc.d.ts +4 -3
  171. package/lib/profile-rpc.js +14 -12
  172. package/lib/profile-runtime.d.ts +40 -1
  173. package/lib/profile-runtime.js +368 -93
  174. package/lib/profile-store.d.ts +11 -0
  175. package/lib/profile-store.js +143 -11
  176. package/lib/profile-types.d.ts +70 -1
  177. package/lib/profile-types.js +1 -0
  178. package/lib/profiles.d.ts +16 -2
  179. package/lib/profiles.js +156 -79
  180. package/lib/prompt-content.js +1 -1
  181. package/lib/prompts.d.ts +37 -2
  182. package/lib/prompts.js +111 -9
  183. package/lib/recovery-policy.js +20 -7
  184. package/lib/role-control-remote.d.ts +38 -0
  185. package/lib/role-control-remote.js +211 -0
  186. package/lib/role-control-rpc.d.ts +51 -0
  187. package/lib/role-control-rpc.js +377 -0
  188. package/lib/role-control-types.d.ts +92 -0
  189. package/lib/role-control-types.js +8 -0
  190. package/lib/role-invocation.d.ts +47 -0
  191. package/lib/role-invocation.js +135 -0
  192. package/lib/role-llm-runtime.d.ts +17 -0
  193. package/lib/role-llm-runtime.js +62 -0
  194. package/lib/role-llm.d.ts +31 -0
  195. package/lib/role-llm.js +66 -0
  196. package/lib/role-policy.d.ts +49 -8
  197. package/lib/role-policy.js +437 -60
  198. package/lib/role-providers.d.ts +1 -1
  199. package/lib/role-providers.js +30 -35
  200. package/lib/role-routing.d.ts +11 -2
  201. package/lib/role-routing.js +42 -25
  202. package/lib/role-runs.d.ts +135 -0
  203. package/lib/role-runs.js +304 -0
  204. package/lib/role-subagents.d.ts +58 -3
  205. package/lib/role-subagents.js +169 -56
  206. package/lib/roles.d.ts +5 -6
  207. package/lib/roles.js +10 -39
  208. package/lib/route-json.d.ts +19 -0
  209. package/lib/route-json.js +129 -0
  210. package/lib/routing-policy.d.ts +2 -0
  211. package/lib/routing-policy.js +12 -2
  212. package/lib/runtime-integration.d.ts +112 -0
  213. package/lib/runtime-integration.js +784 -0
  214. package/lib/runtime-recovery.js +18 -8
  215. package/lib/settings.d.ts +47 -13
  216. package/lib/settings.js +217 -82
  217. package/lib/skills.js +2 -2
  218. package/lib/status.d.ts +10 -1
  219. package/lib/status.js +11 -8
  220. package/lib/subagent-runtime.d.ts +45 -0
  221. package/lib/subagent-runtime.js +131 -0
  222. package/package.json +106 -56
  223. package/patches/subagent-runtime.yml +15 -0
  224. package/prompts/deepseek-flash.md +1 -1
  225. package/prompts/deepseek-v4-pro.md +2 -2
  226. package/prompts/deepwork.md +27 -18
  227. package/prompts/source/agents/clarifier.md +5 -3
  228. package/prompts/source/agents/orchestrator.md +18 -9
  229. package/prompts/source/agents/plan-critic.md +5 -1
  230. package/prompts/source/agents/planner.md +4 -2
  231. package/prompts/source/agents/reviewer.md +6 -0
  232. package/prompts/source/category/complex.md +4 -4
  233. package/prompts/source/category/creative.md +6 -4
  234. package/prompts/source/category/cross-cutting.md +10 -8
  235. package/prompts/source/category/deep.md +5 -3
  236. package/prompts/source/category/documenting.md +7 -1
  237. package/prompts/source/category/frontend.md +2 -2
  238. package/prompts/source/category/hard-reasoning.md +3 -3
  239. package/prompts/source/category/research.md +4 -2
  240. package/prompts/source/deepwork/claude-opus-5.md +2 -2
  241. package/prompts/source/deepwork/codex.md +1 -1
  242. package/prompts/source/deepwork/default.md +22 -15
  243. package/prompts/source/deepwork/gemini.md +23 -16
  244. package/prompts/source/deepwork/glm.md +21 -14
  245. package/prompts/source/deepwork/gpt.md +12 -6
  246. package/prompts/source/deepwork/planner.md +8 -5
  247. package/prompts/source/manifest.json +178 -63
  248. package/prompts/source/shared/dsh-host-contract.md +5 -3
  249. package/prompts/source/shared/locale.md +2 -2
  250. package/prompts/source/terminal/orchestrator.md +1 -1
  251. package/scripts/cold-profile-composition.mjs +329 -0
  252. package/scripts/cold-profile-sources.mjs +238 -0
  253. package/scripts/migrate-cold-profile.mjs +315 -0
  254. package/skills/ast-grep/SKILL.md +7 -4
  255. package/skills/brainstorming/SKILL.md +43 -22
  256. package/skills/coding-agent-sessions/SKILL.md +7 -4
  257. package/skills/coding-agent-sessions/scripts/agent_sessions/pi_family.py +46 -46
  258. package/skills/coding-agent-sessions/scripts/tests/test_pi_family_scanners.py +130 -130
  259. package/skills/debugging/SKILL.md +14 -9
  260. package/skills/debugging/references/methodology/00-setup.md +14 -62
  261. package/skills/debugging/references/methodology/02-investigate.md +4 -4
  262. package/skills/debugging/references/methodology/03-flaky-triage.md +3 -3
  263. package/skills/debugging/references/methodology/04-hard-reasoning-escalation.md +2 -14
  264. package/skills/debugging/references/methodology/06-fix.md +6 -6
  265. package/skills/debugging/references/methodology/08-qa.md +5 -5
  266. package/skills/debugging/references/methodology/09-cleanup.md +15 -153
  267. package/skills/debugging/references/methodology/partial-runtime-evidence.md +3 -16
  268. package/skills/debugging/references/runtimes/bundled-js-binary.md +1 -16
  269. package/skills/debugging/references/runtimes/native-binary.md +9 -54
  270. package/skills/debugging/references/runtimes/node.md +4 -15
  271. package/skills/debugging/references/runtimes/python.md +3 -15
  272. package/skills/debugging/references/runtimes/rust.md +2 -18
  273. package/skills/debugging/references/tools/dap.md +1 -1
  274. package/skills/debugging/references/tools/ghidra.md +4 -15
  275. package/skills/debugging/references/tools/playwright-cli.md +3 -15
  276. package/skills/debugging/references/tools/pwntools.md +4 -16
  277. package/skills/dispatching-parallel-agents/SKILL.md +18 -16
  278. package/skills/frontend/SKILL.md +7 -4
  279. package/skills/frontend/references/design/react-dev-tooling-skill.md +1 -1
  280. package/skills/git-master/SKILL.md +7 -4
  281. package/skills/init-deep/SKILL.md +7 -4
  282. package/skills/receiving-code-review/SKILL.md +17 -12
  283. package/skills/remove-ai-slops/SKILL.md +39 -38
  284. package/skills/requesting-code-review/SKILL.md +19 -17
  285. package/skills/requesting-code-review/code-reviewer.md +13 -1
  286. package/skills/subagent-driven-development/SKILL.md +29 -26
  287. package/skills/subagent-driven-development/implementer-prompt.md +29 -11
  288. package/skills/subagent-driven-development/spec-reviewer-prompt.md +6 -1
  289. package/skills/using-git-worktrees/SKILL.md +7 -4
  290. package/skills/writing-plans/SKILL.md +29 -24
  291. package/skills/writing-plans/plan-document-reviewer-prompt.md +10 -1
@@ -1,3 +1,4 @@
1
+ import { Context } from "@deepseek-ai/cordis";
1
2
  import type { DshContext } from "./dsh-types.js";
2
3
  import { FixedConfigFileStore } from "./config-file-store.js";
3
4
  import type { DsmmDeploymentSnapshot, DsmmPluginConfig } from "./settings.js";
@@ -17,6 +18,9 @@ export interface GlobalConfigSnapshot {
17
18
  config: DsmmPluginConfig;
18
19
  revision: string;
19
20
  }
21
+ export interface DeploymentWriteCoordinator {
22
+ global(request: GlobalConfigSaveRequest, config: DsmmPluginConfig, assertAuthority: () => void, write: (config: DsmmPluginConfig) => Promise<GlobalConfigSnapshot>): Promise<GlobalConfigSnapshot>;
23
+ }
20
24
  export declare function parseGlobalConfig(content: string | null): DsmmPluginConfig;
21
25
  /** Only schema fields, never filesystem paths or array indexes. Full candidate is revalidated. */
22
26
  export declare function editGlobalConfig(config: DsmmPluginConfig, edits: DeploymentPathEdit[]): DsmmPluginConfig;
@@ -24,10 +28,29 @@ export declare function editGlobalConfig(config: DsmmPluginConfig, edits: Deploy
24
28
  export declare class DsmmDeploymentConfig {
25
29
  private readonly ctx;
26
30
  private readonly config;
31
+ private writeCoordinator?;
27
32
  readonly home: string;
28
33
  readonly store: FixedConfigFileStore;
29
34
  readonly entryId: string;
30
35
  readonly hostProfileKey: string;
36
+ get nativeEntry(): Context["fiber"]["entry"] | undefined;
37
+ coordinateWrites(coordinator: DeploymentWriteCoordinator): () => void;
38
+ /** Synchronous source identity for permission dispatch fences; no form revision or process identity. */
39
+ permissionSource(): {
40
+ revision: string;
41
+ globalRevision: string;
42
+ nativeRevision: string;
43
+ global: DsmmPluginConfig;
44
+ profile: DsmmPluginConfig;
45
+ policy: {
46
+ nativeCommands: import("./permission-settings.js").NativeCommandsSettings;
47
+ enabled: boolean;
48
+ outsideReads: import("./permission-settings.js").PermissionRuleAction;
49
+ webSearch: import("./permission-settings.js").PermissionWebPolicy;
50
+ webFetch: import("./permission-settings.js").PermissionWebPolicy;
51
+ rules: readonly import("./permission-rules.js").PermissionRule[];
52
+ };
53
+ };
31
54
  constructor(ctx: DshContext, config: DsmmPluginConfig);
32
55
  private profile;
33
56
  readGlobal(): Promise<GlobalConfigSnapshot>;
@@ -1,35 +1,31 @@
1
1
  import { createHash } from "node:crypto";
2
2
  import { Context } from "@deepseek-ai/cordis";
3
- import { parseTree } from "jsonc-parser";
4
3
  import { resolveDshHome } from "./dsh-home.js";
5
4
  import { FixedConfigFileStore } from "./config-file-store.js";
6
5
  import { copyJson, freezeSettings, resolveDeployment, validateDeploymentPath, validateSparseConfig } from "./settings.js";
7
6
  import { DsmmProfileError } from "./profiles.js";
8
7
  import { resolve } from "node:path";
8
+ import { diagnosticSourcePath, DsmmConfigValidationError, fieldLocation, inspectJsonDocument } from "./profile-diagnostics.js";
9
+ import { parseHostNativeCommands } from "./permission-native-command.js";
9
10
  function configurationError() { throw new DsmmProfileError("validation", "Deepwork deployment configuration is invalid; restore valid plain JSON before saving or admitting a new session."); }
10
- function validateJsonTree(node, depth = 0) {
11
- if (depth > 64)
12
- configurationError();
13
- if (node.type === "object") {
14
- const names = (node.children ?? []).map((property) => property.children?.[0]?.value);
15
- if (new Set(names).size !== names.length)
16
- configurationError();
17
- }
18
- for (const child of node.children ?? [])
19
- validateJsonTree(child, depth + 1);
20
- }
21
11
  export function parseGlobalConfig(content) {
22
12
  if (content === null)
23
13
  return {};
24
- const errors = [];
25
- const tree = parseTree(content, errors, { disallowComments: true, allowTrailingComma: false, allowEmptyContent: false });
26
- if (tree?.type !== "object" || errors.length > 0)
14
+ const inspected = inspectJsonDocument(content, false);
15
+ const issue = inspected.diagnostics[0];
16
+ if (issue !== undefined)
17
+ throw new DsmmProfileError("validation", `${issue.field}: ${issue.reason}`, issue.field, issue.code, issue.location);
18
+ if (inspected.tree?.type !== "object")
27
19
  configurationError();
28
- validateJsonTree(tree);
29
20
  try {
30
- return validateSparseConfig(JSON.parse(content), true);
21
+ const config = validateSparseConfig(JSON.parse(content), true);
22
+ if (config.permissionControl?.nativeCommands !== undefined)
23
+ parseHostNativeCommands(config.permissionControl.nativeCommands);
24
+ return config;
31
25
  }
32
- catch {
26
+ catch (error) {
27
+ if (error instanceof DsmmConfigValidationError)
28
+ throw new DsmmProfileError("validation", error.message, error.diagnostic.field, error.diagnostic.code, fieldLocation(content, inspected.tree, error.diagnostic.field, diagnosticSourcePath(error)));
33
29
  return configurationError();
34
30
  }
35
31
  }
@@ -46,12 +42,7 @@ export function editGlobalConfig(config, edits) {
46
42
  || !Array.isArray(edit.path) || edit.path.length === 0 || edit.path.length > 8
47
43
  || edit.path.some((key) => typeof key !== "string" || !/^[a-zA-Z][a-zA-Z0-9_-]*$/u.test(key) || ["constructor", "prototype", "__proto__"].includes(key)))
48
44
  configurationError();
49
- try {
50
- validateDeploymentPath(edit.path);
51
- }
52
- catch {
53
- configurationError();
54
- }
45
+ validateDeploymentPath(edit.path);
55
46
  let node = result;
56
47
  for (const key of edit.path.slice(0, -1)) {
57
48
  const child = node[key];
@@ -64,14 +55,12 @@ export function editGlobalConfig(config, edits) {
64
55
  node[key] = copyJson(edit.value);
65
56
  else
66
57
  Reflect.deleteProperty(node, key);
67
- try {
68
- result = validateSparseConfig(result, true);
69
- }
70
- catch {
71
- configurationError();
72
- }
58
+ result = validateSparseConfig(result, true);
73
59
  }
74
- return result;
60
+ const configResult = result;
61
+ if (configResult.permissionControl?.nativeCommands !== undefined)
62
+ parseHostNativeCommands(configResult.permissionControl.nativeCommands);
63
+ return configResult;
75
64
  }
76
65
  function hash(input) { return createHash("sha256").update(JSON.stringify(input)).digest("hex"); }
77
66
  function presentValue(parsed, raw) {
@@ -106,23 +95,40 @@ function sources(global, profile, settings) {
106
95
  export class DsmmDeploymentConfig {
107
96
  ctx;
108
97
  config;
98
+ writeCoordinator;
109
99
  home;
110
100
  store;
111
101
  entryId;
112
102
  hostProfileKey;
103
+ get nativeEntry() { return Context.is(this.ctx) ? this.ctx.fiber.entry : undefined; }
104
+ coordinateWrites(coordinator) {
105
+ if (this.writeCoordinator !== undefined)
106
+ throw new DsmmProfileError("conflict", "Deployment writes already have an owner.");
107
+ this.writeCoordinator = coordinator;
108
+ return () => { if (this.writeCoordinator === coordinator)
109
+ this.writeCoordinator = undefined; };
110
+ }
111
+ /** Synchronous source identity for permission dispatch fences; no form revision or process identity. */
112
+ permissionSource() {
113
+ const profile = this.profile(), file = this.store.read(), global = parseGlobalConfig(file.content);
114
+ const settings = resolveDeployment(global, profile.config);
115
+ return freezeSettings({ revision: hash([this.hostProfileKey, file.revision, profile.revision, profile.config]),
116
+ globalRevision: file.revision, nativeRevision: profile.revision, global, profile: profile.config,
117
+ policy: { ...settings.permissionControl, nativeCommands: parseHostNativeCommands(settings.permissionControl.nativeCommands) } });
118
+ }
113
119
  constructor(ctx, config) {
114
120
  this.ctx = ctx;
115
121
  this.config = config;
116
122
  const profile = ctx.get?.("profileContext");
117
123
  this.home = resolveDshHome(profile?.home);
118
124
  this.store = new FixedConfigFileStore(this.home);
119
- const entry = ctx instanceof Context ? ctx.fiber.entry : undefined;
125
+ const entry = Context.is(ctx) ? ctx.fiber.entry : undefined;
120
126
  this.entryId = entry?.id ?? "trusted-direct";
121
127
  const identity = profile?.dir === undefined ? "trusted-direct" : resolve(profile.dir);
122
128
  this.hostProfileKey = hash([process.platform === "win32" ? identity.toLowerCase() : identity, this.entryId]);
123
129
  }
124
130
  profile() {
125
- const entry = this.ctx instanceof Context ? this.ctx.fiber.entry : undefined;
131
+ const entry = Context.is(this.ctx) ? this.ctx.fiber.entry : undefined;
126
132
  const raw = entry === undefined ? Object.fromEntries(Object.entries(this.config).flatMap(([key, parsed]) => {
127
133
  const value = parsed !== null && typeof parsed === "object" && "get" in parsed && typeof parsed.get === "function" ? parsed.get() : parsed;
128
134
  return value === undefined ? [] : [[key, value]];
@@ -135,9 +141,14 @@ export class DsmmDeploymentConfig {
135
141
  const value = parsed !== null && typeof parsed === "object" && "get" in parsed && typeof parsed.get === "function" ? parsed.get() : parsed;
136
142
  snapshot[key] = presentValue(value, Reflect.get(presence, key));
137
143
  }
138
- return { config: validateSparseConfig(snapshot), revision: hash(presence) };
144
+ const config = validateSparseConfig(snapshot);
145
+ if (config.permissionControl?.nativeCommands !== undefined)
146
+ parseHostNativeCommands(config.permissionControl.nativeCommands);
147
+ return { config, revision: hash(presence) };
139
148
  }
140
- catch {
149
+ catch (error) {
150
+ if (error instanceof DsmmConfigValidationError)
151
+ throw error;
141
152
  return configurationError();
142
153
  }
143
154
  }
@@ -152,10 +163,12 @@ export class DsmmDeploymentConfig {
152
163
  try {
153
164
  settings = resolveDeployment(global.config, profile.config);
154
165
  }
155
- catch {
166
+ catch (error) {
167
+ if (error instanceof DsmmConfigValidationError)
168
+ throw error;
156
169
  return configurationError();
157
170
  }
158
- const entry = this.ctx instanceof Context ? this.ctx.fiber.entry : undefined;
171
+ const entry = Context.is(this.ctx) ? this.ctx.fiber.entry : undefined;
159
172
  const descriptor = entry === undefined ? undefined : this.ctx.get?.("settings")?.describe({ redactSecrets: true }).find((row) => row.ns === entry.options.id);
160
173
  if (this.profile().revision !== profile.revision || this.store.read().revision !== global.revision)
161
174
  throw new DsmmProfileError("conflict", "Deployment sources changed while projecting native state; refresh before retrying.");
@@ -174,11 +187,19 @@ export class DsmmDeploymentConfig {
174
187
  try {
175
188
  resolveDeployment(config, this.profile().config);
176
189
  }
177
- catch {
190
+ catch (error) {
191
+ if (error instanceof DsmmConfigValidationError)
192
+ throw error;
178
193
  configurationError();
179
194
  }
180
- const saved = await this.store.save(`${JSON.stringify(config, null, 2)}\n`, request.expectedRevision, assertAuthority);
181
- return { config, revision: saved.revision };
195
+ const write = async (candidate) => {
196
+ const validated = validateSparseConfig(candidate, true);
197
+ resolveDeployment(validated, this.profile().config);
198
+ assertAuthority();
199
+ const saved = await this.store.save(`${JSON.stringify(validated, null, 2)}\n`, request.expectedRevision, assertAuthority);
200
+ return { config: validated, revision: saved.revision };
201
+ };
202
+ return this.writeCoordinator === undefined ? write(config) : this.writeCoordinator.global(request, config, assertAuthority, write);
182
203
  }
183
204
  }
184
205
  //# sourceMappingURL=deployment-config.js.map
@@ -0,0 +1,55 @@
1
+ import type { Context } from "@deepseek-ai/cordis";
2
+ import type { Agent } from "@deepseek-ai/dsh-agent";
3
+ import { PermissionRulesRuntimeSync } from "./permission-rules.js";
4
+ import type { PermissionRulesBackend, PermissionRulesSaveAuthority, PermissionRulesSaveRequest, PermissionRuleSnapshot, PermissionRulesStatus } from "./permission-rules.js";
5
+ import type { DsmmDeploymentConfig } from "./deployment-config.js";
6
+ type NativeEntry = ReturnType<Context["loader"]["resolve"]>;
7
+ /** Structural projection of the SDK's public ConfigEditor.edit; the façade retains all other members. */
8
+ export interface PermissionConfigEditor {
9
+ edit(entry: NativeEntry, change: (current: Record<string, unknown>, inherited: Record<string, unknown>) => Record<string, unknown>): Promise<void>;
10
+ }
11
+ type NativeEdit = PermissionConfigEditor["edit"];
12
+ export interface DeploymentPermissionRulesOptions {
13
+ readonly deployment: Pick<DsmmDeploymentConfig, "nativeEntry" | "home" | "coordinateWrites" | "permissionSource" | "saveGlobal">;
14
+ /** Core readonly/effective-policy check; must not require idle or DW delivery readiness. */
15
+ readonly assertWritable: (root: Agent) => void;
16
+ /** Synchronous revocation of every pending/grant consumer in this owner. */
17
+ readonly revoke: () => void;
18
+ readonly notify: (snapshot: PermissionRuleSnapshot) => Promise<void>;
19
+ }
20
+ /** Canonical Rules RPC writes the global layer; native overrides remain independently owned. */
21
+ export declare class DeploymentPermissionRules implements PermissionRulesBackend {
22
+ private readonly ctx;
23
+ private readonly options;
24
+ readonly runtime: PermissionRulesRuntimeSync;
25
+ readonly initial: PermissionRuleSnapshot;
26
+ private readonly lifetime;
27
+ private readonly operatorWrites;
28
+ private readonly nativeFiber;
29
+ private readonly registry;
30
+ private busy;
31
+ private refreshing?;
32
+ constructor(ctx: Context, options: DeploymentPermissionRulesOptions);
33
+ private snapshot;
34
+ assertWritable(root: Agent): void;
35
+ private check;
36
+ read(authority: PermissionRulesSaveAuthority): Promise<PermissionRuleSnapshot>;
37
+ save(request: PermissionRulesSaveRequest, authority: PermissionRulesSaveAuthority): Promise<{
38
+ snapshot: PermissionRuleSnapshot;
39
+ runtime: PermissionRulesStatus;
40
+ }>;
41
+ private readonly notify;
42
+ /** Host recovery re-reads storage and never revives a former signal or grant. */
43
+ reconcile(): Promise<void>;
44
+ /** Next actual consumption observes disk/native edits without requiring a UI save. */
45
+ private refresh;
46
+ private synchronize;
47
+ private transaction;
48
+ editNative(editor: PermissionConfigEditor, entry: NativeEntry, change: Parameters<NativeEdit>[1]): Promise<void>;
49
+ }
50
+ /** Install in the owned Core fiber with the public `agents` service injected. */
51
+ export declare function installDeploymentPermissionRules(ctx: Context, options: DeploymentPermissionRulesOptions): DeploymentPermissionRules;
52
+ /** Scoped to the ordinary SettingsForms owner; never replaces a global instance or registry. */
53
+ export declare function permissionConfigEditorFacade<T extends PermissionConfigEditor>(editor: T): T;
54
+ export {};
55
+ //# sourceMappingURL=deployment-permission-rules.d.ts.map
@@ -0,0 +1,306 @@
1
+ import { PermissionRefusal, permissionOriginal } from "./permission-control.js";
2
+ import { applyPermissionRulesSave, importPermissionRules, operatorPermissionRulesSource, parsePermissionRules, parsePermissionRulesSave, PermissionRulesRuntimeSync } from "./permission-rules.js";
3
+ import { copyJson, validateSparseConfig } from "./settings.js";
4
+ import { parseHostNativeCommands } from "./permission-native-command.js";
5
+ const entries = new WeakMap();
6
+ const claimed = new WeakSet();
7
+ const homes = new Map();
8
+ function imported(config, label, global) {
9
+ if (config.permissionControl?.rules === undefined)
10
+ return config;
11
+ const rules = parsePermissionRules(config.permissionControl.rules).map(rule => ({
12
+ ...importPermissionRules([{ id: rule.id, action: rule.action, match: rule.match }], label, rule.revision)[0], revoked: rule.revoked
13
+ }));
14
+ return validateSparseConfig({ ...config, permissionControl: { ...config.permissionControl, rules } }, global);
15
+ }
16
+ /** Source checks complement in-process generation revocation; a serialized token is never authority. */
17
+ class SourceBoundRulesRuntime extends PermissionRulesRuntimeSync {
18
+ source;
19
+ refreshSource;
20
+ projection;
21
+ constructor(initial, revoke, source, refreshSource) {
22
+ super(initial, revoke);
23
+ this.source = source;
24
+ this.refreshSource = refreshSource;
25
+ }
26
+ async refresh() { await this.refreshSource(); return this.getPolicy(); }
27
+ status() {
28
+ const current = super.status();
29
+ let source;
30
+ try {
31
+ source = this.source();
32
+ }
33
+ catch {
34
+ if (current.state === "synced")
35
+ this.invalidate();
36
+ return Object.freeze({ ...super.status(), state: "unsynced" });
37
+ }
38
+ if (current.state === "synced" && current.savedRevision !== source.revision)
39
+ this.invalidate();
40
+ return Object.freeze({ ...super.status(), savedRevision: source.revision, restartRequired: source.policy.enabled !== current.mounted });
41
+ }
42
+ getPolicy() {
43
+ const policy = super.getPolicy();
44
+ try {
45
+ if (this.source().revision !== policy.revision)
46
+ throw new PermissionRefusal("stale");
47
+ }
48
+ catch (error) {
49
+ this.invalidate();
50
+ throw error;
51
+ }
52
+ if (this.projection?.snapshot !== policy)
53
+ this.projection = { snapshot: policy,
54
+ value: Object.freeze({ revision: policy.revision, policy: Object.freeze({ ...policy.policy, enabled: super.status().mounted }) }) };
55
+ return this.projection.value;
56
+ }
57
+ }
58
+ /** Canonical Rules RPC writes the global layer; native overrides remain independently owned. */
59
+ export class DeploymentPermissionRules {
60
+ ctx;
61
+ options;
62
+ runtime;
63
+ initial;
64
+ lifetime = new AbortController();
65
+ operatorWrites = new WeakMap();
66
+ nativeFiber;
67
+ registry;
68
+ busy = false;
69
+ refreshing;
70
+ constructor(ctx, options) {
71
+ this.ctx = ctx;
72
+ this.options = options;
73
+ this.nativeFiber = options.deployment.nativeEntry?.fiber;
74
+ this.registry = permissionOriginal(ctx.agents);
75
+ this.initial = this.snapshot();
76
+ this.runtime = new SourceBoundRulesRuntime(this.initial, options.revoke, () => this.snapshot(), () => this.refresh());
77
+ const deployment = options.deployment, entry = deployment.nativeEntry;
78
+ if (entry !== undefined) {
79
+ if (entry.fiber?.ctx.root !== ctx.root)
80
+ throw new PermissionRefusal("not-owned");
81
+ if (entries.has(entry))
82
+ throw new PermissionRefusal("unavailable");
83
+ }
84
+ const homeKey = process.platform === "win32" ? deployment.home.toLowerCase() : deployment.home;
85
+ const family = homes.get(homeKey) ?? new Set();
86
+ if ([...family].some(owner => owner.busy || owner.runtime.status().state === "updating"))
87
+ throw new PermissionRefusal("unavailable");
88
+ const remove = deployment.coordinateWrites({ global: async (request, config, assertAuthority, write) => {
89
+ const operator = this.operatorWrites.get(request);
90
+ const rulesInput = request.edits.some(edit => edit.path[0] === "permissionControl" && (edit.path.length === 1 || edit.path[1] === "rules"));
91
+ const candidate = operator !== undefined || !rulesInput ? config : imported(config, "global-settings", true);
92
+ return this.transaction([...family], async () => { assertAuthority(); return write(candidate); });
93
+ } });
94
+ if (entry !== undefined) {
95
+ entries.set(entry, this);
96
+ claimed.add(entry);
97
+ }
98
+ family.add(this);
99
+ homes.set(homeKey, family);
100
+ ctx.effect(() => () => {
101
+ this.lifetime.abort();
102
+ remove();
103
+ family.delete(this);
104
+ if (family.size === 0)
105
+ homes.delete(homeKey);
106
+ if (entry !== undefined)
107
+ entries.delete(entry);
108
+ this.runtime.retire();
109
+ });
110
+ }
111
+ snapshot() {
112
+ this.lifetime.signal.throwIfAborted();
113
+ if (this.options.deployment.nativeEntry?.fiber !== this.nativeFiber)
114
+ throw new PermissionRefusal("unavailable");
115
+ const source = this.options.deployment.permissionSource();
116
+ return Object.freeze({ revision: source.revision, policy: source.policy });
117
+ }
118
+ assertWritable(root) {
119
+ this.lifetime.signal.throwIfAborted();
120
+ const registry = this.ctx.agents;
121
+ if (permissionOriginal(registry) !== this.registry || registry.get(root.id) !== root || root.session.id !== root.id || root.session.header.origin === "subagent"
122
+ || !registry.roots().includes(root) || registry.list().some(owner => owner !== root && registry.isOwnedBy(root.id, owner)))
123
+ throw new PermissionRefusal("not-owned");
124
+ this.options.assertWritable(root);
125
+ }
126
+ check(authority) {
127
+ authority.signal.throwIfAborted();
128
+ authority.assertCurrent();
129
+ this.assertWritable(authority.root);
130
+ }
131
+ async read(authority) {
132
+ this.check(authority);
133
+ await this.refresh();
134
+ this.check(authority);
135
+ const snapshot = this.snapshot();
136
+ if (this.runtime.status().state === "synced" && this.runtime.status().savedRevision !== snapshot.revision)
137
+ this.runtime.invalidate();
138
+ this.check(authority);
139
+ return snapshot;
140
+ }
141
+ async save(request, authority) {
142
+ this.check(authority);
143
+ request = parsePermissionRulesSave(request);
144
+ const source = this.options.deployment.permissionSource();
145
+ if (request.expectedRevision !== source.revision)
146
+ throw new PermissionRefusal("stale");
147
+ if (Object.keys(source.profile.permissionControl ?? {}).some(key => key !== "enabled")) {
148
+ const error = new PermissionRefusal("unavailable");
149
+ error.message = "Native profile overrides the global permission policy; edit or unset that native override first.";
150
+ throw error;
151
+ }
152
+ const proposed = applyPermissionRulesSave({ revision: source.revision, policy: source.policy }, request, operatorPermissionRulesSource(authority));
153
+ const edits = Object.entries(request.changes ?? {}).map(([key, value]) => ({ op: "set", path: ["permissionControl", key], value }));
154
+ if (request.upsert !== undefined || request.revoke !== undefined)
155
+ edits.push({ op: "set", path: ["permissionControl", "rules"], value: proposed.rules });
156
+ const write = { expectedRevision: source.globalRevision, edits };
157
+ this.operatorWrites.set(write, authority);
158
+ try {
159
+ await this.options.deployment.saveGlobal(write, () => {
160
+ this.check(authority);
161
+ const current = this.options.deployment.permissionSource();
162
+ if (current.revision !== source.revision)
163
+ throw new PermissionRefusal("stale");
164
+ });
165
+ this.check(authority);
166
+ return { snapshot: this.snapshot(), runtime: this.runtime.status() };
167
+ }
168
+ finally {
169
+ this.operatorWrites.delete(write);
170
+ }
171
+ }
172
+ notify = async (snapshot) => {
173
+ this.lifetime.signal.throwIfAborted();
174
+ await this.options.notify(snapshot);
175
+ this.lifetime.signal.throwIfAborted();
176
+ if (this.snapshot().revision !== snapshot.revision)
177
+ throw new PermissionRefusal("stale");
178
+ };
179
+ /** Host recovery re-reads storage and never revives a former signal or grant. */
180
+ async reconcile() {
181
+ if (this.busy)
182
+ throw new PermissionRefusal("stale");
183
+ if (this.runtime.status().state === "synced")
184
+ this.runtime.invalidate();
185
+ await this.runtime.recover(undefined, this.snapshot(), this.notify);
186
+ }
187
+ /** Next actual consumption observes disk/native edits without requiring a UI save. */
188
+ async refresh() {
189
+ this.lifetime.signal.throwIfAborted();
190
+ if (this.refreshing !== undefined)
191
+ return this.refreshing;
192
+ if (this.runtime.status().state === "synced")
193
+ return;
194
+ if (this.busy)
195
+ throw new PermissionRefusal("unavailable");
196
+ const refreshing = this.reconcile();
197
+ this.refreshing = refreshing;
198
+ try {
199
+ await refreshing;
200
+ this.lifetime.signal.throwIfAborted();
201
+ }
202
+ finally {
203
+ if (this.refreshing === refreshing)
204
+ this.refreshing = undefined;
205
+ }
206
+ }
207
+ async synchronize(updates, recovery) {
208
+ let rows;
209
+ try {
210
+ rows = [...updates].map(([owner, update]) => ({ owner, update, snapshot: owner.snapshot() }));
211
+ }
212
+ catch (error) {
213
+ for (const owner of updates.keys())
214
+ owner.runtime.invalidate();
215
+ throw error;
216
+ }
217
+ const acknowledged = Promise.all(rows.map(row => row.owner.notify(row.snapshot))).then(() => {
218
+ for (const row of rows)
219
+ if (row.owner.snapshot().revision !== row.snapshot.revision)
220
+ throw new PermissionRefusal("stale");
221
+ });
222
+ const settled = await Promise.allSettled([acknowledged, ...rows.map(({ owner, update, snapshot }) => recovery
223
+ ? owner.runtime.recover(update, snapshot, () => acknowledged) : owner.runtime.commit(update, snapshot, () => acknowledged))]);
224
+ const failures = [...new Set(settled.flatMap(result => result.status === "rejected" ? [result.reason] : []))];
225
+ if (failures.length)
226
+ throw new AggregateError(failures, "Permission configuration is not synchronized.");
227
+ }
228
+ async transaction(participants, write) {
229
+ for (const participant of participants) {
230
+ if (participant.busy)
231
+ throw new PermissionRefusal("stale");
232
+ if (participant.runtime.status().state !== "synced" || participant.runtime.status().savedRevision !== participant.snapshot().revision)
233
+ await participant.reconcile();
234
+ }
235
+ const updates = new Map();
236
+ const locked = new Set();
237
+ try {
238
+ let result;
239
+ try {
240
+ for (const participant of participants) {
241
+ if (participant.busy)
242
+ throw new PermissionRefusal("stale");
243
+ participant.busy = true;
244
+ locked.add(participant);
245
+ updates.set(participant, participant.runtime.begin(participant.snapshot().revision));
246
+ }
247
+ result = await write();
248
+ }
249
+ catch (error) {
250
+ try {
251
+ await this.synchronize(updates, true);
252
+ }
253
+ catch (recovery) {
254
+ throw new AggregateError([error, recovery], "Permission write and authoritative recovery failed.");
255
+ }
256
+ throw error;
257
+ }
258
+ await this.synchronize(updates, false);
259
+ return result;
260
+ }
261
+ finally {
262
+ for (const participant of locked)
263
+ participant.busy = false;
264
+ }
265
+ }
266
+ async editNative(editor, entry, change) {
267
+ await this.transaction([this], () => editor.edit(entry, (current, inherited) => {
268
+ const next = validateSparseConfig(change(current, inherited));
269
+ if (next.permissionControl?.nativeCommands !== undefined)
270
+ parseHostNativeCommands(next.permissionControl.nativeCommands);
271
+ if (JSON.stringify(next.permissionControl?.rules) === JSON.stringify(current.permissionControl && typeof current.permissionControl === "object" ? Reflect.get(current.permissionControl, "rules") : undefined))
272
+ return copyJson(next);
273
+ return copyJson(imported(next, "native-profile-settings", false));
274
+ }));
275
+ }
276
+ }
277
+ /** Install in the owned Core fiber with the public `agents` service injected. */
278
+ export function installDeploymentPermissionRules(ctx, options) {
279
+ return new DeploymentPermissionRules(ctx, options);
280
+ }
281
+ /** Scoped to the ordinary SettingsForms owner; never replaces a global instance or registry. */
282
+ export function permissionConfigEditorFacade(editor) {
283
+ const methods = new Map();
284
+ return new Proxy(editor, { get(target, key) {
285
+ if (key !== "edit") {
286
+ const value = Reflect.get(target, key, target);
287
+ if (typeof value !== "function")
288
+ return value;
289
+ const previous = methods.get(key);
290
+ if (previous?.original === value)
291
+ return previous.bound;
292
+ const bound = value.bind(target);
293
+ methods.set(key, { original: value, bound });
294
+ return bound;
295
+ }
296
+ return (entry, change) => {
297
+ const backend = entries.get(entry);
298
+ if (backend !== undefined)
299
+ return backend.editNative(target, entry, change);
300
+ if (claimed.has(entry))
301
+ return Promise.reject(new PermissionRefusal("unavailable"));
302
+ return target.edit(entry, change);
303
+ };
304
+ } });
305
+ }
306
+ //# sourceMappingURL=deployment-permission-rules.js.map
@@ -7,6 +7,8 @@ export interface DshSessionHeader {
7
7
  cwd?: string;
8
8
  agentPreset?: string;
9
9
  origin?: string;
10
+ parentSession?: string;
11
+ delegationDepth?: number;
10
12
  }
11
13
  export interface DshSession {
12
14
  readonly id?: string;
@@ -46,14 +48,14 @@ export interface DshAgentCreatedFrame {
46
48
  source: "startup" | "resume" | "clear" | "compact";
47
49
  signal?: AbortSignal;
48
50
  }
49
- export interface DshLlmCallConfig {
51
+ export type DshLlmCallConfig = {
50
52
  provider: string;
51
53
  model: string;
52
54
  reasoningEffort?: string;
53
55
  temperature?: number;
54
56
  maxTokens?: number;
55
- stop?: unknown;
56
- }
57
+ stop?: string[];
58
+ };
57
59
  export interface DshLlmFailure {
58
60
  readonly message: string;
59
61
  readonly code: string;
@@ -81,6 +83,9 @@ export interface DshResolvedModelInfo {
81
83
  export interface DshLlmRuntime {
82
84
  resolveModelInfo(provider: string, model: string, signal?: AbortSignal): Promise<DshResolvedModelInfo>;
83
85
  resolveCallConfig?(config: DshLlmCallConfig, signal?: AbortSignal): Promise<DshLlmCallConfig>;
86
+ listProviders?(): readonly {
87
+ id: string;
88
+ }[];
84
89
  }
85
90
  export interface AgentRequestFrame {
86
91
  agent: DshAgent;
@@ -252,11 +257,12 @@ export interface DshContext {
252
257
  commands?: DshCommandsRegistry;
253
258
  tools?: DshToolRuntime;
254
259
  llm?: DshLlmRuntime;
260
+ dsmmRuntimeIntegration?: import("./runtime-integration.js").DsmmHostRuntimeIntegration;
255
261
  get?<T = unknown>(name: string): T | undefined;
256
262
  provide?(name: string, service: unknown): unknown;
257
263
  plugin?(plugin: unknown, config?: unknown): PromiseLike<unknown>;
258
264
  inject?(dependencies: string[], installer: (readyCtx: DshContext) => unknown): unknown;
259
- effect?(callback: () => void | (() => void)): unknown;
265
+ effect?(callback: () => () => void): unknown;
260
266
  on?(event: "agent/request", listener: (frame: AgentRequestFrame, next: () => Promise<DshLlmCallConfig>) => Promise<DshLlmCallConfig>, options?: boolean | {
261
267
  prepend?: boolean;
262
268
  global?: boolean;
package/lib/guards.d.ts CHANGED
@@ -5,7 +5,7 @@ import type { DsmmRolePolicy } from "./role-policy.js";
5
5
  export declare const DSMM_GUARD_PREFIX = "[dsmm safety]";
6
6
  export declare function truncateTextMiddle(text: string, maxBytes: number, toolName: string): string;
7
7
  export declare function isSafetyScopeActive(exec: DshToolExecution, settings: DsmmSettings, controller: DeepworkModeController): boolean;
8
- export declare function decidePreToolExecution(exec: DshToolExecution, settings: DsmmSettings, controller: DeepworkModeController): DshPreToolDecision | undefined;
8
+ export declare function decidePreToolExecution(exec: DshToolExecution, settings: DsmmSettings, controller: DeepworkModeController, nativeFullAccess?: boolean): DshPreToolDecision | undefined;
9
9
  export declare function decidePostToolExecution(exec: DshToolExecution, result: Readonly<DshToolExecutionResult>, decision: DshPostToolDecision, settings: DsmmSettings, controller: DeepworkModeController): DshPostToolDecision;
10
10
  export declare function registerSafetyGuards(ctx: DshContext, controller: DeepworkModeController, getSettings: DsmmSettingsGetter, rolePolicy?: DsmmRolePolicy): void;
11
11
  //# sourceMappingURL=guards.d.ts.map