@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
@@ -0,0 +1,150 @@
1
+ import { classifyKnownGitWrite, parseShellCommand } from "./shell-command.js";
2
+ import { isAbsolute, resolve } from "node:path";
3
+ const reads = new Set(["echo", "printf", "pwd", "ls", "cat", "head", "tail", "wc", "rg", "grep", "write-output", "get-location", "get-childitem", "get-content"]);
4
+ const localWrites = new Set(["mkdir", "touch", "cp", "mv", "tee", "new-item", "set-content", "add-content", "copy-item", "move-item"]);
5
+ const destroys = new Set(["rm", "rmdir", "del", "erase", "remove-item", "format-volume"]);
6
+ const rank = { read: 0, "local-write": 1, "external-write": 2, destructive: 3, unknown: 4 };
7
+ const base = (name) => name.replace(/^.*[\\/]/u, "").replace(/\.exe$/iu, "").toLowerCase();
8
+ const readFlags = {
9
+ echo: ["-n", "-e", "-E"], printf: [], pwd: ["-L", "-P"], ls: ["-l", "-a", "-A", "-h", "-1", "--color=never"],
10
+ cat: ["-n", "-b", "-s", "-v", "-e", "-t"], head: [], tail: [], wc: ["-l", "-w", "-c", "-m", "-L"],
11
+ rg: ["-n", "--line-number", "-i", "--ignore-case", "-F", "--fixed-strings", "-l", "--files-with-matches", "--files", "--no-config", "--hidden", "--no-ignore", "--color=never"],
12
+ grep: ["-n", "--line-number", "-i", "--ignore-case", "-F", "--fixed-strings", "-E", "--extended-regexp", "-r", "-R", "-l", "-c", "-v"],
13
+ "write-output": ["-noenumerate"], "get-location": [], "get-childitem": ["-recurse", "-force", "-name", "-file", "-directory"], "get-content": ["-raw"],
14
+ };
15
+ const gitReadFlags = {
16
+ status: ["-s", "--short", "-b", "--branch", "--porcelain", "--porcelain=v1", "--porcelain=v2"],
17
+ diff: ["--no-ext-diff", "--no-textconv", "--stat", "--name-only", "--name-status", "--cached", "--staged", "--quiet", "--exit-code"],
18
+ log: ["--oneline", "--no-decorate", "--no-color", "--no-ext-diff", "--no-textconv"],
19
+ show: ["--stat", "--name-only", "--name-status", "--no-color", "--no-ext-diff", "--no-textconv"],
20
+ "ls-files": ["--cached", "--stage", "--others", "--exclude-standard"], "rev-parse": ["--show-toplevel", "--git-dir", "--is-inside-work-tree", "--verify"],
21
+ "rev-list": ["--count", "--all"], describe: ["--tags", "--always", "--abbrev=0"], version: [],
22
+ };
23
+ function knownReadArguments(command, args) {
24
+ let flags, operands = args;
25
+ if (command === "git") {
26
+ if (operands[0] === "--no-pager")
27
+ operands = operands.slice(1);
28
+ const subcommand = operands[0];
29
+ if (subcommand === undefined || !Object.hasOwn(gitReadFlags, subcommand))
30
+ return false;
31
+ flags = gitReadFlags[subcommand];
32
+ operands = operands.slice(1);
33
+ }
34
+ else
35
+ flags = readFlags[command];
36
+ const cmdlet = command.startsWith("get-") || command === "write-output";
37
+ for (let index = 0; index < operands.length; index++) {
38
+ const argument = operands[index], option = cmdlet ? argument.toLowerCase() : argument;
39
+ if (!cmdlet && option === "--")
40
+ return true;
41
+ if (!argument.startsWith("-"))
42
+ continue;
43
+ if (flags.includes(option))
44
+ continue;
45
+ if (cmdlet && ["get-content", "get-childitem"].includes(command) && ["-path", "-literalpath"].includes(option) && operands[index + 1] !== undefined) {
46
+ index++;
47
+ continue;
48
+ }
49
+ return false;
50
+ }
51
+ return true;
52
+ }
53
+ /** Classification supports exact-operation authorization, not filesystem or network isolation. */
54
+ export function classifyPermissionShell(identity, args, cwd, execution) {
55
+ const row = typeof args === "object" && args !== null && !Array.isArray(args) ? args : {};
56
+ const command = typeof row[identity.commandField] === "string" ? row[identity.commandField] : "";
57
+ const explicitCwd = identity.cwdField !== undefined && typeof row[identity.cwdField] === "string" ? row[identity.cwdField] : undefined;
58
+ const workingDirectory = explicitCwd === undefined ? cwd : cwd !== "" && !isAbsolute(explicitCwd) ? resolve(cwd, explicitCwd) : explicitCwd;
59
+ let effect = "read";
60
+ const operations = [];
61
+ // Dynamic evaluation, interpolation, script blocks, wrappers and malformed quotes
62
+ // remain exact-once asks. No command family wildcard is created from them.
63
+ // PowerShell smart quotes are lexical delimiters unsupported by the ASCII tokenizer.
64
+ const unsupportedQuotes = identity.dialect === "powershell" && /[\u2018-\u201f]/u.test(command);
65
+ const dynamic = unsupportedQuotes || command === "" || /[$`{}()]/u.test(command) || /\b(?:eval|exec|invoke-expression|iex|cmd|pwsh|powershell|bash|sh|zsh|env|sudo|node|python)\b/iu.test(command)
66
+ || (command.match(/'/gu)?.length ?? 0) % 2 !== 0 || (command.match(/"/gu)?.length ?? 0) % 2 !== 0;
67
+ for (const segment of parseShellCommand(command, identity.dialect)) {
68
+ const token = segment.words[0] ?? "";
69
+ const trusted = identity.readCapability?.signal.aborted === false ? identity.readCapability.resolveExecutable(token, workingDirectory, execution) : undefined;
70
+ const name = trusted ?? base(token);
71
+ let next = "unknown", operation = name;
72
+ if (name === "git") {
73
+ const write = classifyKnownGitWrite(segment.words.map(word => JSON.stringify(word)).join(" "), identity.dialect);
74
+ const sub = segment.words[1]?.toLowerCase();
75
+ operation = `git:${write ?? sub ?? "unknown"}`;
76
+ if (write !== undefined) {
77
+ next = write === "push" ? "external-write" : ["clean", "reset --hard", "rm", "stash drop", "stash clear"].includes(write) ? "destructive" : "local-write";
78
+ }
79
+ else if (trusted === "git" && knownReadArguments("git", segment.words.slice(1)))
80
+ next = "read";
81
+ if (segment.words.slice(1).some(word => /^-(?:c|C)(?:.+)?$/u.test(word) || /^--(?:config-env|exec-path|git-dir|work-tree)(?:=|$)/u.test(word)))
82
+ next = "unknown";
83
+ }
84
+ else if (reads.has(name) && trusted !== undefined && knownReadArguments(trusted, segment.words.slice(1)))
85
+ next = "read";
86
+ else if (localWrites.has(name))
87
+ next = "local-write";
88
+ else if (destroys.has(name))
89
+ next = "destructive";
90
+ if (/[\\/]/u.test(token) && trusted === undefined)
91
+ next = "unknown";
92
+ if (segment.tokens.some(token => token.kind === "operator" && token.value.includes(">")) && rank[next] < rank["local-write"])
93
+ next = "local-write";
94
+ if (rank[next] > rank[effect])
95
+ effect = next;
96
+ operations.push(operation);
97
+ }
98
+ if (dynamic || operations.length === 0)
99
+ effect = "unknown";
100
+ return Object.freeze({ effect, operations: Object.freeze(operations), rememberable: effect !== "unknown" && workingDirectory !== "", executable: identity.executable, command, workingDirectory });
101
+ }
102
+ /** Typed DSMM extraction, not an SDK operand field. Undefined means exact native ask, not inside. */
103
+ export function parsePermissionShellReadPaths(identity, args, cwd, execution) {
104
+ const operation = classifyPermissionShell(identity, args, cwd, execution);
105
+ if (operation.effect !== "read" || operation.workingDirectory === "" || identity.readCapability === undefined)
106
+ return undefined;
107
+ if (/[|<>]/u.test(operation.command))
108
+ return undefined;
109
+ const paths = [];
110
+ for (const segment of parseShellCommand(operation.command, identity.dialect)) {
111
+ // Redirects, pipelines, wildcard expansion and Git object/pathspec semantics require an exact question.
112
+ if (segment.tokens.some(token => token.kind === "operator" && ![";", "&&"].includes(token.value)))
113
+ return undefined;
114
+ const command = identity.readCapability.resolveExecutable(segment.words[0], operation.workingDirectory, execution);
115
+ if (command === undefined || command === "git")
116
+ return undefined;
117
+ if (["echo", "printf", "pwd", "write-output", "get-location"].includes(command))
118
+ continue;
119
+ const operands = [];
120
+ let options = true;
121
+ for (const word of segment.words.slice(1)) {
122
+ if (word === "--" && options) {
123
+ options = false;
124
+ continue;
125
+ }
126
+ if (options && word.startsWith("-"))
127
+ continue;
128
+ operands.push(word);
129
+ }
130
+ if (command === "rg" || command === "grep") {
131
+ if (!(command === "rg" && segment.words.includes("--files"))) {
132
+ if (operands.length === 0)
133
+ return undefined;
134
+ operands.shift();
135
+ }
136
+ if (operands.length === 0)
137
+ operands.push(".");
138
+ }
139
+ else if (["ls", "get-childitem"].includes(command) && operands.length === 0)
140
+ operands.push(".");
141
+ // Missing file operands use stdin, which may be supplied by unparsed shell syntax.
142
+ else if (operands.length === 0)
143
+ return undefined;
144
+ if (operands.some(path => path === "-" || /[*?\[\]]/u.test(path) || /^~(?:[\\/]|$)/u.test(path)))
145
+ return undefined;
146
+ paths.push(...operands);
147
+ }
148
+ return Object.freeze({ workingDirectory: operation.workingDirectory, paths: Object.freeze(paths) });
149
+ }
150
+ //# sourceMappingURL=permission-shell.js.map
@@ -0,0 +1,5 @@
1
+ import type { Context } from "@deepseek-ai/cordis";
2
+ import * as Native from "@deepseek-ai/dsh-tool-web";
3
+ export { Config, inject, name } from "@deepseek-ai/dsh-tool-web";
4
+ export declare function apply(ctx: Context, config: Native.Config): ReturnType<typeof Native.apply>;
5
+ //# sourceMappingURL=permission-web.d.ts.map
@@ -0,0 +1,7 @@
1
+ import * as Native from "@deepseek-ai/dsh-tool-web";
2
+ import { DsmmPermissionController } from "./permission-controller.js";
3
+ export { Config, inject, name } from "@deepseek-ai/dsh-tool-web";
4
+ export function apply(ctx, config) {
5
+ return Native.apply(DsmmPermissionController.toolScope(ctx, "web"), config);
6
+ }
7
+ //# sourceMappingURL=permission-web.js.map
@@ -1,7 +1,10 @@
1
- import { getTraceable } from "@deepseek-ai/cordis";
2
- import { DSMM_ROLES, DSMM_ROLE_IDS, isRootRole, rolePluginRows } from "./roles.js";
1
+ import { Context as NativeContext, getTraceable } from "@deepseek-ai/cordis";
2
+ import { DSMM_ROLES, DSMM_ROLE_IDS, rolePluginRows } from "./roles.js";
3
3
  import { enabledSkillNames } from "./skills.js";
4
- import { allowedRoleChildren, readonlyRoleTool, roleFromToolName } from "./role-policy.js";
4
+ import { isRootRoleEnabled } from "./settings.js";
5
+ import { allowedRoleChildren, readonlyRoleTool, roleFromToolName, READONLY_ROLE_DENIED_TOOLS } from "./role-policy.js";
6
+ import { nativeStandingFullAccess } from "./permission-native-access.js";
7
+ import { scopeParentOf } from "./native-scope.js";
5
8
  /** Declare roles to DSH 0.2's native registry; directories are not discovery inputs. */
6
9
  export function registerRolePresets(ctx, getSettings) {
7
10
  const install = async (readyCtx) => {
@@ -11,7 +14,7 @@ export function registerRolePresets(ctx, getSettings) {
11
14
  throw new Error("dsmm requires the native DSH agentPresets registry");
12
15
  const settings = getSettings();
13
16
  const enabled = DSMM_ROLE_IDS.filter((id) => settings.modules.deepwork.enabled && settings.roles[id]);
14
- const active = DSMM_ROLES.filter((role) => isRootRole(role) && enabled.includes(role.id));
17
+ const active = DSMM_ROLES.filter((role) => isRootRoleEnabled(settings, role.id));
15
18
  const disposers = [];
16
19
  try {
17
20
  for (const role of active) {
@@ -30,6 +33,14 @@ export function registerRolePresets(ctx, getSettings) {
30
33
  // Blank Agents can switch presets without another agent/created event.
31
34
  const states = new WeakMap();
32
35
  const restrictedAgents = new Set();
36
+ const denial = (agent, name) => {
37
+ const role = registry.composedPreset(agent.ctx);
38
+ if (!isReadonlyRole(role))
39
+ return undefined;
40
+ const target = roleFromToolName(name);
41
+ return target === undefined ? readonlyRoleTool(name, settings) ? undefined : "dsmm read-only role does not permit this tool"
42
+ : allowedRoleChildren(role).includes(target) && settings.roles[target] ? undefined : "dsmm read-only role does not permit this delegation";
43
+ };
33
44
  const reconcile = (agent) => {
34
45
  const selected = registry.composedPreset(agent.ctx);
35
46
  const previous = states.get(agent);
@@ -37,7 +48,6 @@ export function registerRolePresets(ctx, getSettings) {
37
48
  return;
38
49
  states.set(agent, { role: selected, pending: true });
39
50
  previous?.disposeRestriction?.();
40
- previous?.disposeGuard?.();
41
51
  restrictedAgents.delete(agent);
42
52
  if (!isReadonlyRole(selected)) {
43
53
  states.set(agent, { role: selected });
@@ -51,34 +61,35 @@ export function registerRolePresets(ctx, getSettings) {
51
61
  : agent.ctx.get?.("tools")
52
62
  ?? (agent.ctx.get === undefined ? agent.ctx.tools : undefined);
53
63
  try {
54
- if (tools?.restrict === undefined || tools.guard === undefined)
55
- throw new Error(`dsmm read-only role requires DSH tools guard/restrict: ${selected}`);
56
- const disposeGuard = tools.guard((execution) => {
57
- if (execution.agent !== agent || !isReadonlyRole(registry.composedPreset(agent.ctx)))
58
- return undefined;
59
- const role = registry.composedPreset(agent.ctx);
60
- const target = roleFromToolName(execution.name);
61
- return target === undefined ? readonlyRoleTool(execution.name, settings) ? undefined : "dsmm read-only role does not permit this tool"
62
- : allowedRoleChildren(role).includes(target) && settings.roles[target] ? undefined : "dsmm read-only role does not permit this delegation";
63
- });
64
- states.set(agent, { role: selected, disposeGuard, pending: true });
64
+ if (tools?.restrict === undefined)
65
+ throw new Error(`dsmm read-only role requires DSH tools restrict: ${selected}`);
65
66
  restrictedAgents.add(agent);
66
- const disposeRestriction = tools.restrict({ deny: ["write", "edit"] });
67
- states.set(agent, { role: selected, disposeGuard, disposeRestriction });
67
+ // Only inherited tools are maskable; own-layer tools remain subject to runtime denial.
68
+ const inheritedScope = scopeParentOf(agent);
69
+ const disposeRestriction = tools.restrict({ deny: READONLY_ROLE_DENIED_TOOLS.filter(name => tools.get(name, inheritedScope) !== undefined) });
70
+ states.set(agent, { role: selected, disposeRestriction });
68
71
  }
69
72
  catch (error) {
70
- if (states.get(agent)?.disposeGuard === undefined)
71
- states.delete(agent);
72
- else
73
- states.set(agent, { role: selected, disposeGuard: states.get(agent)?.disposeGuard });
73
+ states.set(agent, { role: selected });
74
+ restrictedAgents.delete(agent);
74
75
  throw error;
75
76
  }
76
77
  };
77
- const onCreated = readyCtx.on?.("agent/created", ({ agent }) => reconcile(agent), { global: true });
78
78
  const agents = readyCtx.get?.("agents")
79
79
  ?? readyCtx.agents;
80
80
  if (agents === undefined)
81
81
  throw new Error("dsmm native preset restriction requires DSH Agent registry");
82
+ const onPreExecute = readyCtx.on?.("tools/pre-execute", async (execution, next) => {
83
+ const agent = execution.agent;
84
+ if (agent === undefined || agents.get(agent.id) !== agent)
85
+ return next();
86
+ const full = NativeContext.is(readyCtx) && nativeStandingFullAccess(readyCtx, agent);
87
+ if (full && !READONLY_ROLE_DENIED_TOOLS.includes(execution.name))
88
+ return next();
89
+ const reason = denial(agent, execution.name);
90
+ return reason === undefined ? next() : { kind: "deny", reason };
91
+ }, { global: true, prepend: true });
92
+ const onCreated = readyCtx.on?.("agent/created", ({ agent }) => reconcile(agent), { global: true });
82
93
  const onToolChange = readyCtx.on?.("tools/change", () => {
83
94
  for (const agent of agents.list())
84
95
  reconcile(agent);
@@ -90,13 +101,14 @@ export function registerRolePresets(ctx, getSettings) {
90
101
  }, { global: true });
91
102
  const onDisposed = readyCtx.on?.("agent/disposed", ({ agent }) => {
92
103
  states.get(agent)?.disposeRestriction?.();
93
- states.get(agent)?.disposeGuard?.();
94
104
  states.delete(agent);
95
105
  restrictedAgents.delete(agent);
96
106
  }, { global: true });
97
107
  readyCtx.effect?.(() => () => {
98
108
  if (typeof onCreated === "function")
99
109
  onCreated();
110
+ if (typeof onPreExecute === "function")
111
+ onPreExecute();
100
112
  if (typeof onToolChange === "function")
101
113
  onToolChange();
102
114
  if (typeof onSelection === "function")
@@ -105,7 +117,6 @@ export function registerRolePresets(ctx, getSettings) {
105
117
  onDisposed();
106
118
  for (const agent of restrictedAgents) {
107
119
  states.get(agent)?.disposeRestriction?.();
108
- states.get(agent)?.disposeGuard?.();
109
120
  }
110
121
  restrictedAgents.clear();
111
122
  for (const dispose of disposers.reverse())
@@ -0,0 +1,45 @@
1
+ import type { Node } from "jsonc-parser";
2
+ export declare const PROFILE_DIAGNOSTIC_REASONS: {
3
+ readonly "invalid-jsonc": "Use one valid document with supported JSON syntax.";
4
+ readonly "duplicate-field": "Remove the duplicate field.";
5
+ readonly "unsafe-field": "Unsafe object fields are not supported.";
6
+ readonly "unknown-field": "This field is not supported; installation and private configuration belong in native deployment configuration.";
7
+ readonly "deprecated-field": "This retired field is not supported; configure explicit role levels instead.";
8
+ readonly "invalid-type": "Use the declared field type and bounded value.";
9
+ readonly "unsupported-value": "Use one of the explicitly supported values.";
10
+ readonly "invalid-route": "Use a complete provider/model route or a nonempty reasoning-effort override.";
11
+ readonly "required-role": "This role is required by the selected Deepwork policy.";
12
+ readonly "deployment-ceiling": "A named profile cannot enable capabilities outside its captured deployment ceiling.";
13
+ readonly "blank-label": "The label is blank; the profile ID is used for display.";
14
+ };
15
+ export type ProfileDiagnosticCode = keyof typeof PROFILE_DIAGNOSTIC_REASONS;
16
+ export interface ProfileDiagnosticLocation {
17
+ offset: number;
18
+ length: number;
19
+ line: number;
20
+ column: number;
21
+ }
22
+ export interface ProfileDiagnostic {
23
+ severity: "error" | "warning";
24
+ code: ProfileDiagnosticCode;
25
+ field: string;
26
+ reason: string;
27
+ location?: ProfileDiagnosticLocation;
28
+ }
29
+ export declare const DEPRECATED_DSMM_FIELDS: readonly ["deepseekV4ProMaxReasoningPresets", "deepseekFlashMaxReasoningPresets"];
30
+ /** Host parser location provenance only; never serialized on an error or DTO. */
31
+ export declare function diagnosticSourcePath(error: object): readonly (string | number)[] | undefined;
32
+ export declare function safeDiagnosticField(parts: readonly (string | number)[]): string;
33
+ export declare function isSafeDiagnosticField(value: unknown): value is string;
34
+ export declare function diagnostic(code: ProfileDiagnosticCode, field: string, location?: ProfileDiagnosticLocation): ProfileDiagnostic;
35
+ export declare class DsmmConfigValidationError extends TypeError {
36
+ readonly diagnostic: ProfileDiagnostic;
37
+ constructor(code: ProfileDiagnosticCode, field: string | readonly (string | number)[]);
38
+ }
39
+ export declare function diagnosticLocation(content: string, offset: number, length: number): ProfileDiagnosticLocation;
40
+ export declare function fieldLocation(content: string, tree: Node, field: string, sourcePath?: readonly (string | number)[]): ProfileDiagnosticLocation | undefined;
41
+ export declare function inspectJsonDocument(content: string, jsonc?: boolean): {
42
+ tree?: Node;
43
+ diagnostics: ProfileDiagnostic[];
44
+ };
45
+ //# sourceMappingURL=profile-diagnostics.d.ts.map
@@ -0,0 +1,148 @@
1
+ import { findNodeAtLocation, parseTree } from "jsonc-parser";
2
+ import { DSMM_RATE_LIMIT_BOUNDS } from "./routing-policy.js";
3
+ import { permissionControlSchema } from "./permission-settings.js";
4
+ export const PROFILE_DIAGNOSTIC_REASONS = {
5
+ "invalid-jsonc": "Use one valid document with supported JSON syntax.",
6
+ "duplicate-field": "Remove the duplicate field.",
7
+ "unsafe-field": "Unsafe object fields are not supported.",
8
+ "unknown-field": "This field is not supported; installation and private configuration belong in native deployment configuration.",
9
+ "deprecated-field": "This retired field is not supported; configure explicit role levels instead.",
10
+ "invalid-type": "Use the declared field type and bounded value.",
11
+ "unsupported-value": "Use one of the explicitly supported values.",
12
+ "invalid-route": "Use a complete provider/model route or a nonempty reasoning-effort override.",
13
+ "required-role": "This role is required by the selected Deepwork policy.",
14
+ "deployment-ceiling": "A named profile cannot enable capabilities outside its captured deployment ceiling.",
15
+ "blank-label": "The label is blank; the profile ID is used for display."
16
+ };
17
+ export const DEPRECATED_DSMM_FIELDS = ["deepseekV4ProMaxReasoningPresets", "deepseekFlashMaxReasoningPresets"];
18
+ function schemaFieldShape(schema) {
19
+ if (schema.type === "transform")
20
+ return schemaFieldShape(schema.inner);
21
+ if (schema.type === "object")
22
+ return Object.fromEntries(Object.entries(schema.dict ?? {}).map(([key, child]) => [key, schemaFieldShape(child)]));
23
+ if (schema.type === "array")
24
+ return [schemaFieldShape(schema.inner)];
25
+ return null;
26
+ }
27
+ // Closed wire grammar: dynamic role/skill names are declared identifiers, not arbitrary object keys.
28
+ const roleId = /^dsmm-(?:orchestrator|planner|plan-critic|builder|reviewer|oracle|oracle-2nd|creative|code-search|doc-search|clarifier|media-reader|frontend|hard-reasoning|research|quick|coding|normal-task|complex|deep|documenting|cross-cutting)$/u;
29
+ const skillId = /^(?:brainstorming|writing-plans|requesting-code-review|receiving-code-review|subagent-driven-development|dispatching-parallel-agents|remove-ai-slops|debugging|frontend|git-master|ast-grep|coding-agent-sessions|init-deep|using-git-worktrees)$/u;
30
+ const route = { provider: null, model: null, reasoningEffort: null };
31
+ const rateLimit = Object.fromEntries(Object.keys(DSMM_RATE_LIMIT_BOUNDS).map(key => [key, null]));
32
+ const roleRouting = { primary: route, fallbackRoutes: [route], strategy: null, rateLimit, levels: { low: route, high: route, max: route } };
33
+ const configFields = {
34
+ permissionControl: schemaFieldShape(permissionControlSchema),
35
+ modelParameters: { passthrough: null },
36
+ locale: null, modeName: null, section: null, defaultActive: null, promptOrder: null,
37
+ deepseekV4ProCalibration: null, deepseekV4ProDefaultReasoningEffort: null, deepseekFlashCalibration: null, deepseekFlashDefaultReasoningEffort: null,
38
+ deepseekV4ProMaxReasoningPresets: null, deepseekFlashMaxReasoningPresets: null,
39
+ modules: { deepwork: { enabled: null } }, sessionPersistence: { root: null, compression: null },
40
+ skills: "skills", roles: "roles", roleRouting: "role-routing", runtimePolicy: { strategy: null, rateLimit },
41
+ presets: { materialize: null, plannerRootEnabled: null, root: null }, subagents: { toolTopology: null, allowRouteOverride: null, enableRunInBackground: null, backgroundMode: null, maxDepth: null },
42
+ workflow: { policy: null, strictGates: null, reviewCap: null, finalReviewPolicy: null },
43
+ guards: { scope: null, shellCommandSafety: null, gitWriteGuard: null, toolOutputTruncation: { enabled: null, maxInlineBytes: null }, planFormatValidation: null, questionLabelHelper: { enabled: null, maxLabelChars: null }, todoDisciplineHelper: null },
44
+ runtimeRecovery: { enabled: null, retryOnStatusCodes: [null], retryOnCodes: [null], fallbackRoutes: [route], maxFallbackAttempts: null, idleContinuation: { enabled: null, maxContinuations: null, prompt: null } },
45
+ lsp: { enabled: null, serverName: null, command: null, args: [null], cwd: null, env: {}, toolCallTimeoutMs: null, failOnStartupError: null }
46
+ };
47
+ const documentFields = { version: null, id: null, label: null, settings: configFields };
48
+ const rootFields = { ...configFields, ...documentFields, document: documentFields, content: null, expectedRevision: null, expectedSelectionRevision: null, expectedAdmissionEpoch: null, expectedModeRevision: null, sessionId: null, route };
49
+ function childShape(shape, key) {
50
+ if (typeof key === "number")
51
+ return Number.isSafeInteger(key) && key >= 0 && key <= 999999 && Array.isArray(shape) ? shape[0] : undefined;
52
+ if (shape === rootFields && roleId.test(key))
53
+ return null;
54
+ if (shape === "roles")
55
+ return roleId.test(key) ? null : undefined;
56
+ if (shape === "role-routing")
57
+ return roleId.test(key) ? roleRouting : undefined;
58
+ if (shape === "skills")
59
+ return skillId.test(key) ? null : undefined;
60
+ return shape !== null && typeof shape === "object" && !Array.isArray(shape) && Object.hasOwn(shape, key) ? shape[key] : undefined;
61
+ }
62
+ function fieldParts(field) {
63
+ return field.replace(/\[([0-9]+)\]/gu, ".$1").split(".").map(part => /^\d+$/u.test(part) ? Number(part) : part);
64
+ }
65
+ const sourcePaths = new WeakMap();
66
+ /** Host parser location provenance only; never serialized on an error or DTO. */
67
+ export function diagnosticSourcePath(error) { return sourcePaths.get(error); }
68
+ export function safeDiagnosticField(parts) {
69
+ let result = "";
70
+ let shape = rootFields;
71
+ for (const part of parts.slice(0, 16)) {
72
+ const declared = childShape(shape, part);
73
+ const key = declared !== undefined ? part : "[unknown]";
74
+ const next = typeof key === "number" ? `[${key}]` : `${result === "" ? "" : "."}${key}`;
75
+ if (result.length + next.length > 256)
76
+ break;
77
+ result += next;
78
+ shape = declared;
79
+ }
80
+ return result || "document";
81
+ }
82
+ export function isSafeDiagnosticField(value) {
83
+ return typeof value === "string" && value.length <= 256
84
+ && /^(?:[a-zA-Z][a-zA-Z0-9_-]{0,63}|\[unknown\])(?:\.(?:[a-zA-Z][a-zA-Z0-9_-]{0,63}|\[unknown\])|\[(?:0|[1-9][0-9]{0,5})\])*$/u.test(value)
85
+ && safeDiagnosticField(fieldParts(value)) === value;
86
+ }
87
+ export function diagnostic(code, field, location) {
88
+ const reason = code === "unsupported-value" && (field === "locale" || field === "settings.locale")
89
+ ? "Supported locales: en, zh-Hans, zh-Hant, ja, ko, de, fr, es, pt-BR, ru."
90
+ : PROFILE_DIAGNOSTIC_REASONS[code];
91
+ return { severity: code === "blank-label" ? "warning" : "error", code, field: safeDiagnosticField(fieldParts(field)), reason, ...(location === undefined ? {} : { location }) };
92
+ }
93
+ export class DsmmConfigValidationError extends TypeError {
94
+ diagnostic;
95
+ constructor(code, field) {
96
+ const path = typeof field === "string" ? fieldParts(field) : [...field];
97
+ const info = diagnostic(code, safeDiagnosticField(path));
98
+ super(`${info.field}: ${info.reason}`);
99
+ this.diagnostic = info;
100
+ sourcePaths.set(this, Object.freeze([...path]));
101
+ }
102
+ }
103
+ export function diagnosticLocation(content, offset, length) {
104
+ const before = content.slice(0, offset).split(/\r\n|\r|\n/u);
105
+ return { offset, length, line: before.length, column: before.at(-1).length + 1 };
106
+ }
107
+ export function fieldLocation(content, tree, field, sourcePath) {
108
+ const path = sourcePath !== undefined ? [...sourcePath] : field === "document" || field === "content" ? [] : fieldParts(field);
109
+ let node = findNodeAtLocation(tree, path);
110
+ while (node === undefined && path.length) {
111
+ path.pop();
112
+ node = findNodeAtLocation(tree, path);
113
+ }
114
+ if (node === undefined)
115
+ return undefined;
116
+ const selected = node.parent?.type === "property" ? node.parent.children[0] : node;
117
+ return diagnosticLocation(content, selected.offset, selected.length);
118
+ }
119
+ export function inspectJsonDocument(content, jsonc = true) {
120
+ const errors = [];
121
+ // Replace, rather than remove, the BOM so offsets still address original bytes/text.
122
+ const tree = parseTree(content.replace(/^\uFEFF/u, " "), errors, { allowTrailingComma: jsonc, disallowComments: !jsonc, allowEmptyContent: false });
123
+ if (tree === undefined || errors.length)
124
+ return { tree, diagnostics: [diagnostic("invalid-jsonc", "content", diagnosticLocation(content, errors[0]?.offset ?? 0, errors[0]?.length ?? 0))] };
125
+ const diagnostics = [];
126
+ const walk = (node, path, depth) => {
127
+ if (depth > 32) {
128
+ diagnostics.push(diagnostic("invalid-type", safeDiagnosticField(path), diagnosticLocation(content, node.offset, node.length)));
129
+ return;
130
+ }
131
+ if (node.type === "object") {
132
+ const found = new Set();
133
+ for (const property of node.children ?? []) {
134
+ const keyNode = property.children[0], key = String(keyNode.value), next = [...path, key];
135
+ const code = ["__proto__", "constructor", "prototype"].includes(key) ? "unsafe-field" : found.has(key) ? "duplicate-field" : undefined;
136
+ if (code !== undefined)
137
+ diagnostics.push(diagnostic(code, safeDiagnosticField(next), diagnosticLocation(content, keyNode.offset, keyNode.length)));
138
+ found.add(key);
139
+ walk(property.children[1], next, depth + 1);
140
+ }
141
+ }
142
+ else if (node.type === "array")
143
+ (node.children ?? []).forEach((child, index) => walk(child, [...path, index], depth + 1));
144
+ };
145
+ walk(tree, [], 0);
146
+ return { tree, diagnostics };
147
+ }
148
+ //# sourceMappingURL=profile-diagnostics.js.map
@@ -0,0 +1,3 @@
1
+ export declare const DSMM_LOCALES: readonly ["en", "zh-Hans", "zh-Hant", "ja", "ko", "de", "fr", "es", "pt-BR", "ru"];
2
+ export type DsmmLocale = typeof DSMM_LOCALES[number];
3
+ //# sourceMappingURL=profile-locale.d.ts.map
@@ -0,0 +1,2 @@
1
+ export const DSMM_LOCALES = ["en", "zh-Hans", "zh-Hant", "ja", "ko", "de", "fr", "es", "pt-BR", "ru"];
2
+ //# sourceMappingURL=profile-locale.js.map
@@ -4,6 +4,8 @@ import type { ProfileErrorInfo, ProfileReadResult, ProfileSaveRequest, ProfileSe
4
4
  import type { GlobalConfigSaveRequest, GlobalConfigSnapshot } from "./deployment-config.js";
5
5
  import type { DsmmModuleState } from "./modules.js";
6
6
  import type { DeploymentEditorSnapshot } from "./profile-types.js";
7
+ import type { DsmmRoleAvailabilityState, ProfileDiagnostic, SubagentRuntimeAdmissionView } from "./profile-types.js";
8
+ import type { DsmmInvocationView, DsmmRoleRouteComparison } from "./profile-types.js";
7
9
  export interface DsmmConfigRemote {
8
10
  describe(): Promise<RemoteResult<GlobalConfigSnapshot>>;
9
11
  save(request: GlobalConfigSaveRequest): Promise<RemoteResult<GlobalConfigSnapshot>>;
@@ -46,6 +48,12 @@ declare module "@deepseek-ai/dsh-typert-protocol/types" {
46
48
  export declare function isProfileId(value: unknown): value is string;
47
49
  /** Opaque native identities are never interpreted as paths. */
48
50
  export declare function isNativeSessionId(value: unknown): value is string;
51
+ export declare function parseProfileErrorInfo(value: unknown): ProfileErrorInfo;
52
+ export declare function parseProfileDiagnostic(value: unknown): ProfileDiagnostic;
53
+ export declare function parseRoleAvailability(value: unknown): DsmmRoleAvailabilityState;
54
+ export declare function parseSubagentRuntimeAdmissionView(value: unknown): SubagentRuntimeAdmissionView;
55
+ export declare function parseDsmmRoleRouteComparison(value: unknown): DsmmRoleRouteComparison;
56
+ export declare function parseDsmmInvocationView(value: unknown): DsmmInvocationView;
49
57
  /** Explicit strict Host contract; no SRC fallback or browser-supplied authority. */
50
58
  export declare const TYPERT_REMOTE: TypertRemoteContribution;
51
59
  export declare const TYPERT_HOST: TypertContribution;