@dsmm/dsmm 0.3.2 → 0.3.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (190) hide show
  1. package/README.md +2 -2
  2. package/agent-presets/dsmm-builder/agent.cordis.yml +1 -1
  3. package/agent-presets/dsmm-clarifier/agent.cordis.yml +1 -1
  4. package/agent-presets/dsmm-code-search/agent.cordis.yml +1 -1
  5. package/agent-presets/dsmm-coding/agent.cordis.yml +3 -2
  6. package/agent-presets/dsmm-complex/agent.cordis.yml +2 -1
  7. package/agent-presets/dsmm-creative/agent.cordis.yml +1 -1
  8. package/agent-presets/dsmm-cross-cutting/agent.cordis.yml +1 -1
  9. package/agent-presets/dsmm-deep/agent.cordis.yml +2 -1
  10. package/agent-presets/dsmm-doc-search/agent.cordis.yml +1 -1
  11. package/agent-presets/dsmm-documenting/agent.cordis.yml +1 -1
  12. package/agent-presets/dsmm-frontend/agent.cordis.yml +4 -2
  13. package/agent-presets/dsmm-hard-reasoning/agent.cordis.yml +1 -1
  14. package/agent-presets/dsmm-media-reader/agent.cordis.yml +1 -1
  15. package/agent-presets/dsmm-normal-task/agent.cordis.yml +3 -2
  16. package/agent-presets/dsmm-oracle/agent.cordis.yml +1 -1
  17. package/agent-presets/dsmm-oracle-2nd/agent.cordis.yml +1 -1
  18. package/agent-presets/dsmm-orchestrator/agent.cordis.yml +11 -1
  19. package/agent-presets/dsmm-plan-critic/agent.cordis.yml +1 -1
  20. package/agent-presets/dsmm-planner/agent.cordis.yml +1 -1
  21. package/agent-presets/dsmm-quick/agent.cordis.yml +2 -1
  22. package/agent-presets/dsmm-research/agent.cordis.yml +1 -1
  23. package/agent-presets/dsmm-reviewer/agent.cordis.yml +1 -1
  24. package/cordis.patch.yml +0 -9
  25. package/docs/agent-presets.md +5 -5
  26. package/docs/compatibility.md +2 -6
  27. package/docs/migration-from-ocmm.md +1 -1
  28. package/docs/native-permissions.md +11 -3
  29. package/docs/roadmap.md +31 -11
  30. package/docs/runtime-recovery.md +30 -2
  31. package/docs/settings-status.md +7 -5
  32. package/docs/skill-sync.md +13 -14
  33. package/lib/client/ChildrenPanel.d.ts +1 -4
  34. package/lib/client/ChildrenPanel.js +3 -3
  35. package/lib/client/DeploymentFields.js +12 -1
  36. package/lib/client/DeploymentPage.d.ts +1 -3
  37. package/lib/client/DeploymentPage.js +30 -18
  38. package/lib/client/NativeCommandEntries.js +47 -37
  39. package/lib/client/PermissionRuleEntries.d.ts +17 -0
  40. package/lib/client/PermissionRuleEntries.js +70 -0
  41. package/lib/client/PermissionsPanel.d.ts +1 -3
  42. package/lib/client/PermissionsPanel.js +5 -4
  43. package/lib/client/children-locales.d.ts +4 -4
  44. package/lib/client/controller.js +4 -1
  45. package/lib/client/deployment-locales.d.ts +2 -2
  46. package/lib/client/deployment-locales.js +8 -9
  47. package/lib/client/deployment-modules.d.ts +5 -3
  48. package/lib/client/deployment-modules.js +4 -4
  49. package/lib/client/deployment-workspace.d.ts +4 -0
  50. package/lib/client/deployment-workspace.js +37 -11
  51. package/lib/client/index.js +2 -7
  52. package/lib/client/locales.js +131 -119
  53. package/lib/client/permission-controller.d.ts +13 -0
  54. package/lib/client/permission-controller.js +50 -23
  55. package/lib/client/permission-locales.d.ts +28 -30
  56. package/lib/client/permission-locales.js +38 -38
  57. package/lib/client/styles.d.ts +1 -1
  58. package/lib/client/styles.js +8 -8
  59. package/lib/client.js +2272 -3773
  60. package/lib/core-permission-authority.js +28 -16
  61. package/lib/index.d.ts +0 -2
  62. package/lib/index.js +11 -31
  63. package/lib/native-admission.d.ts +3 -3
  64. package/lib/native-admission.js +67 -66
  65. package/lib/permission-controller.js +1 -1
  66. package/lib/permission-fs-search.js +1 -2
  67. package/lib/permission-fs.js +1 -2
  68. package/lib/permission-native-command.js +6 -4
  69. package/lib/permission-settings.d.ts +21 -7
  70. package/lib/permission-settings.js +21 -9
  71. package/lib/permission-web.js +1 -2
  72. package/lib/preset-materializer.js +3 -3
  73. package/lib/preset-registry.d.ts +20 -2
  74. package/lib/preset-registry.js +46 -17
  75. package/lib/profile-diagnostics.js +1 -1
  76. package/lib/profile-remote.js +1 -3
  77. package/lib/role-identity.d.ts +1 -1
  78. package/lib/role-identity.js +16 -4
  79. package/lib/role-policy.d.ts +3 -0
  80. package/lib/role-policy.js +30 -6
  81. package/lib/role-subagents.js +6 -4
  82. package/lib/roles.d.ts +2 -0
  83. package/lib/roles.js +2 -0
  84. package/lib/runtime-integration.js +4 -4
  85. package/lib/settings.d.ts +1 -3
  86. package/lib/settings.js +8 -10
  87. package/lib/state.d.ts +4 -1
  88. package/lib/state.js +37 -6
  89. package/package.json +1 -5
  90. package/prompts/deepwork.md +13 -1
  91. package/prompts/source/agents/orchestrator.md +10 -0
  92. package/prompts/source/category/coding.md +2 -1
  93. package/prompts/source/category/complex.md +1 -0
  94. package/prompts/source/category/deep.md +1 -0
  95. package/prompts/source/category/frontend.md +3 -1
  96. package/prompts/source/category/normal-task.md +2 -1
  97. package/prompts/source/category/quick.md +1 -0
  98. package/prompts/source/deepwork/claude-opus-5.md +2 -0
  99. package/prompts/source/deepwork/default.md +12 -0
  100. package/prompts/source/deepwork/gemini.md +6 -1
  101. package/prompts/source/deepwork/glm.md +5 -1
  102. package/prompts/source/deepwork/gpt.md +22 -2
  103. package/prompts/source/deepwork/kimi-k27.md +2 -0
  104. package/prompts/source/deepwork/planner.md +3 -1
  105. package/prompts/source/deepwork/swe-2.md +2 -0
  106. package/prompts/source/manifest.json +3 -68
  107. package/prompts/source/shared/dsh-host-contract.md +1 -1
  108. package/skills/ast-grep/SKILL.md +1 -1
  109. package/skills/brainstorming/SKILL.md +1 -1
  110. package/skills/coding-agent-sessions/SKILL.md +1 -1
  111. package/skills/debugging/SKILL.md +1 -1
  112. package/skills/dispatching-parallel-agents/SKILL.md +1 -1
  113. package/skills/frontend/SKILL.md +1 -1
  114. package/skills/git-master/SKILL.md +1 -1
  115. package/skills/init-deep/SKILL.md +1 -1
  116. package/skills/receiving-code-review/SKILL.md +1 -1
  117. package/skills/remove-ai-slops/SKILL.md +1 -1
  118. package/skills/requesting-code-review/SKILL.md +1 -1
  119. package/skills/subagent-driven-development/SKILL.md +1 -1
  120. package/skills/using-git-worktrees/SKILL.md +1 -1
  121. package/skills/writing-plans/SKILL.md +1 -1
  122. package/lib/client/ChildPermissions.d.ts +0 -43
  123. package/lib/client/ChildPermissions.js +0 -100
  124. package/lib/client/HistoryContinuation.d.ts +0 -7
  125. package/lib/client/HistoryContinuation.js +0 -22
  126. package/lib/client/PermissionPanelEntry.d.ts +0 -8
  127. package/lib/client/PermissionPanelEntry.js +0 -11
  128. package/lib/client/TemporaryPermissions.d.ts +0 -21
  129. package/lib/client/TemporaryPermissions.js +0 -94
  130. package/lib/client/history-controller.d.ts +0 -29
  131. package/lib/client/history-controller.js +0 -111
  132. package/lib/client/history-entry.d.ts +0 -11
  133. package/lib/client/history-entry.js +0 -106
  134. package/lib/client/history-locales.d.ts +0 -95
  135. package/lib/client/history-locales.js +0 -41
  136. package/lib/client/temporary-permission-client.d.ts +0 -20
  137. package/lib/client/temporary-permission-client.js +0 -52
  138. package/lib/client/temporary-permission-entry.d.ts +0 -6
  139. package/lib/client/temporary-permission-entry.js +0 -56
  140. package/lib/history-candidates.d.ts +0 -30
  141. package/lib/history-candidates.js +0 -176
  142. package/lib/history-codec.d.ts +0 -11
  143. package/lib/history-codec.js +0 -102
  144. package/lib/history-contract.d.ts +0 -44
  145. package/lib/history-contract.js +0 -2
  146. package/lib/history-controller.d.ts +0 -42
  147. package/lib/history-controller.js +0 -329
  148. package/lib/history-policy.d.ts +0 -4
  149. package/lib/history-policy.js +0 -8
  150. package/lib/history-remote.d.ts +0 -28
  151. package/lib/history-remote.js +0 -17
  152. package/lib/history-rpc.d.ts +0 -24
  153. package/lib/history-rpc.js +0 -136
  154. package/lib/history-support.d.ts +0 -15
  155. package/lib/history-support.js +0 -21
  156. package/lib/history-types.d.ts +0 -67
  157. package/lib/history-types.js +0 -2
  158. package/lib/permission-child-control.d.ts +0 -36
  159. package/lib/permission-child-control.js +0 -164
  160. package/lib/permission-exec-argv.d.ts +0 -32
  161. package/lib/permission-exec-argv.js +0 -171
  162. package/lib/permission-temporary-files.d.ts +0 -19
  163. package/lib/permission-temporary-files.js +0 -248
  164. package/lib/permission-temporary-grants.d.ts +0 -106
  165. package/lib/permission-temporary-grants.js +0 -198
  166. package/lib/permission-temporary-install.d.ts +0 -25
  167. package/lib/permission-temporary-install.js +0 -86
  168. package/lib/permission-temporary-remote.d.ts +0 -19
  169. package/lib/permission-temporary-remote.js +0 -75
  170. package/lib/permission-temporary-rpc.d.ts +0 -37
  171. package/lib/permission-temporary-rpc.js +0 -154
  172. package/lib/permission-temporary-types.d.ts +0 -47
  173. package/lib/permission-temporary-types.js +0 -2
  174. package/lib/permission-temporary-web.d.ts +0 -11
  175. package/lib/permission-temporary-web.js +0 -154
  176. package/patches/dsh-approval-settlement/@deepseek-ai__dsh-api-gateway@0.2.1-rc.2.patch +0 -13291
  177. package/patches/dsh-approval-settlement/@deepseek-ai__dsh-api-remotes@0.2.1-rc.2.patch +0 -9133
  178. package/patches/dsh-approval-settlement/@deepseek-ai__dsh-client-ui-approval@0.2.1-rc.2.patch +0 -156
  179. package/patches/dsh-approval-settlement/@deepseek-ai__dsh-subagent@0.2.1-rc.2.patch +0 -3546
  180. package/patches/dsh-approval-settlement/@deepseek-ai__dsh-user-approval@0.2.1-rc.2.patch +0 -431
  181. package/patches/dsh-approval-settlement/@deepseek-ai__dsh-web@0.2.1-rc.2.patch +0 -119
  182. package/patches/dsh-approval-settlement/README.md +0 -41
  183. package/patches/dsh-approval-settlement/metadata.json +0 -10
  184. package/patches/dsh-session-activation/@deepseek-ai__dsh-agent-loop@0.2.1-rc.2.patch +0 -383
  185. package/patches/dsh-session-activation/@deepseek-ai__dsh-agent-preset-registry@0.2.1-rc.2.patch +0 -55
  186. package/patches/dsh-session-activation/@deepseek-ai__dsh-api-session-controller@0.2.1-rc.2.patch +0 -16673
  187. package/patches/dsh-session-activation/@deepseek-ai__dsh-client-ui-subagent@0.2.1-rc.2.patch +0 -29
  188. package/patches/dsh-session-activation/@deepseek-ai__dsh-client-ui-workspace@0.2.1-rc.2.patch +0 -196
  189. package/patches/dsh-session-activation/@deepseek-ai__dsh-session-persistence-jsonl@0.2.1-rc.2.patch +0 -35
  190. package/patches/dsh-session-activation/@deepseek-ai__dsh-session-persistence@0.2.1-rc.2.patch +0 -40
@@ -2,16 +2,16 @@ import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-run
2
2
  import { useEffect, useId, useRef, useSyncExternalStore } from "react";
3
3
  import { Button } from "@deepseek-ai/dsh-client-ui-primitives";
4
4
  import { deploymentWorkspace } from "./deployment-workspace.js";
5
- import { CONFIG_MODULES, moduleFields, moduleFor, moduleTitle } from "./deployment-modules.js";
5
+ import { NAVIGATION_MODULES, moduleFields, moduleFor, moduleTitle } from "./deployment-modules.js";
6
6
  import { at, inspectorPaths, scopeSchema, visibleDeploymentPath } from "./deployment-data.js";
7
7
  import { Field, displayValue, permissionText } from "./DeploymentFields.js";
8
8
  import { configurationVersionState } from "./configuration-display.js";
9
- import { PermissionPanelEntry } from "./PermissionPanelEntry.js";
9
+ import { PermissionsPanel } from "./PermissionsPanel.js";
10
10
  import { permissionEn } from "./permission-locales.js";
11
11
  export function ScopeSave({ controller, workspace, refreshOnly = false, t }) {
12
12
  const state = useSyncExternalStore(controller.subscribe, controller.getSnapshot);
13
13
  const pending = [...new Set(controller.pendingPaths().map(moduleFor))];
14
- return _jsxs("section", { className: "dsmm-scope-save", "aria-label": t(refreshOnly ? "refresh" : "saveScope"), children: [_jsx("p", { className: "dsmm-status", role: "status", "aria-live": "polite", children: refreshOnly ? state.busy ? t("loading") : "" : state.busy ? t("saving") : state.refreshRequired ? t("savedRefreshRequired") : state.saved ? t("saved") : state.dirty ? t("dirty") : "" }), !refreshOnly && pending.length > 0 && _jsxs("p", { children: [t("pendingModules"), ": ", pending.map(module => t(moduleTitle(module))).join(" · ")] }), state.issue !== null && _jsx("p", { className: "dsmm-issue", role: "alert", children: t(state.issue) }), !refreshOnly && state.invalidFields.length > 0 && _jsx("p", { className: "dsmm-issue", role: "alert", children: t("invalid") }), controller.layer === "profile" && !controller.canWriteProfile() && _jsx("p", { className: "dsmm-hint", children: t("unavailableForm") }), _jsxs("div", { className: "dsmm-actions", children: [!refreshOnly && _jsx(Button, { type: "button", variant: "primary", disabled: !controller.canSave(), onClick: () => void (workspace?.save() ?? controller.save()), children: t(controller.layer === "global" ? "saveGlobal" : "saveProfile") }), _jsx(Button, { type: "button", variant: "outline", disabled: state.busy, onClick: () => void controller.refresh(), children: t("refresh") }), !refreshOnly && _jsx(Button, { type: "button", variant: "outline", disabled: state.busy || !state.dirty && state.issue === null && !state.refreshRequired, onClick: () => void controller.refresh(true), children: t("discard") })] })] });
14
+ return _jsxs("section", { className: "dsmm-scope-save", "aria-label": t("saveScope"), children: [_jsx("p", { className: "dsmm-status", role: "status", "aria-live": "polite", children: refreshOnly ? state.busy ? t("loading") : "" : state.busy ? t("saving") : state.refreshRequired ? t("savedRefreshRequired") : state.saved ? t("saved") : state.dirty ? t("dirty") : "" }), !refreshOnly && pending.length > 0 && _jsxs("p", { children: [t("pendingModules"), ": ", pending.map(module => t(moduleTitle(module))).join(" · ")] }), state.issue !== null && _jsx("p", { className: "dsmm-issue", role: "alert", children: t(state.issue) }), !refreshOnly && state.invalidFields.length > 0 && _jsx("p", { className: "dsmm-issue", role: "alert", children: t("invalid") }), controller.layer === "profile" && !controller.canWriteProfile() && _jsx("p", { className: "dsmm-hint", children: t("unavailableForm") }), _jsxs("div", { className: "dsmm-actions", children: [!refreshOnly && _jsx(Button, { type: "button", variant: "primary", disabled: !controller.canSave(), onClick: () => void (workspace?.save() ?? controller.save()), children: t(controller.layer === "global" ? "saveGlobal" : "saveProfile") }), _jsx(Button, { type: "button", variant: "outline", disabled: state.busy, onClick: () => void controller.refresh(), children: t("refresh") }), !refreshOnly && _jsx(Button, { type: "button", variant: "outline", disabled: state.busy || !state.dirty && state.issue === null && !state.refreshRequired, onClick: () => void controller.refresh(true), children: t("discard") })] })] });
15
15
  }
16
16
  export function NativeRuntimeState({ value, t }) {
17
17
  return _jsxs("details", { className: "dsmm-availability", children: [_jsx("summary", { children: t("nativeRuntimeState") }), _jsxs("p", { children: [t("nativeRuntimeBinding"), ": ", t(value?.binding === "stock" ? "nativeRuntimeStock" : value?.binding === "unavailable" ? "nativeRuntimeUnavailable" : "unknown")] }), _jsxs("p", { children: [t("nativeRuntimeFence"), ": ", value === undefined ? t("unknown") : t(value.deliveryFenceReady ? "on" : "off"), " \u00B7 ", t("nativeRuntimeRestart"), ": ", value === undefined ? t("unknown") : t(value.restartRequired ? "on" : "off")] }), value?.reason !== undefined && _jsx("p", { children: t(`nativeRuntimeReason-${value.reason}`) })] });
@@ -41,6 +41,11 @@ export function DeploymentPage(props) {
41
41
  void props.core.refresh(); }, [props.core, props.view]);
42
42
  useEffect(() => { if (props.forms !== undefined)
43
43
  workspace.bindForms(props.forms); }, [workspace, props.forms]);
44
+ // First visit opens the first section with editable fields (or Configuration state).
45
+ useEffect(() => {
46
+ if (navigation.module === null && core.snapshot !== null)
47
+ workspace.request({ scope: navigation.scope, module: null });
48
+ }, [core.snapshot, navigation.module, navigation.scope, workspace]);
44
49
  useEffect(() => {
45
50
  if (active !== null)
46
51
  heading.current?.focus();
@@ -69,25 +74,32 @@ export function DeploymentPage(props) {
69
74
  if (props.view === "summary")
70
75
  return _jsx("span", { children: t("summary") });
71
76
  const fields = snapshot === null || active === null ? [] : moduleFields(scopeSchema(snapshot, controller.layer), active, controller.layer);
72
- const modules = CONFIG_MODULES.filter(module => module === "state" || module === "permissions" || snapshot === null || moduleFields(snapshot.schema, module, "global").length + moduleFields(scopeSchema(snapshot, "profile"), module, "profile").length > 0);
77
+ const tabs = NAVIGATION_MODULES.filter(module => module !== "other" || snapshot === null
78
+ || moduleFields(snapshot.schema, "other", "global").length + moduleFields(scopeSchema(snapshot, "profile"), "other", "profile").length > 0);
79
+ const select = (module) => workspace.request({ scope: navigation.scope, module });
80
+ const onTabKey = (event, index) => {
81
+ const last = tabs.length - 1, move = (target) => { const next = tabs[(target + tabs.length) % tabs.length]; triggers.current.get(next)?.focus(); };
82
+ if (event.key === "ArrowRight")
83
+ move(index + 1);
84
+ else if (event.key === "ArrowLeft")
85
+ move(index - 1);
86
+ else if (event.key === "Home")
87
+ move(0);
88
+ else if (event.key === "End")
89
+ move(last);
90
+ else
91
+ return;
92
+ event.preventDefault();
93
+ };
73
94
  const scopeActions = _jsx(ScopeSave, { controller: active === "state" ? props.core : controller, workspace: workspace, refreshOnly: active === "state" || workspace.controller() === null, t: t });
74
95
  return _jsxs("section", { className: "dsmm-profiles dsmm-deployment", "data-dsmm-page": true, "aria-label": t("title"), children: [_jsx("p", { className: "dsmm-hint", children: t("boundaries") }), _jsxs("div", { className: "dsmm-field", children: [_jsx("label", { htmlFor: `${id}-scope`, children: t("scope") }), _jsxs("select", { ref: scopeControl, id: `${id}-scope`, value: navigation.scope, disabled: state.busy || navigation.pending !== null, onChange: event => {
75
96
  const scope = event.currentTarget.value;
76
97
  if (scope === "global" || scope === "profile")
77
- workspace.request({ scope, module: active });
78
- }, children: [_jsx("option", { value: "global", children: t("global") }), _jsx("option", { value: "profile", children: t("profile") })] })] }), _jsx("p", { className: "dsmm-hint", children: t(navigation.scope === "global" ? "globalHint" : "profileHint") }), navigation.scope === "profile" && (navigation.native === null || !navigation.native.canWriteProfile()) && _jsx("p", { className: "dsmm-hint", children: t("unavailableForm") }), _jsxs("div", { className: "dsmm-deployment-frame", "data-drawer-open": active !== null, children: [_jsx("nav", { className: "dsmm-module-list", "aria-label": t("modules"), children: modules.map(module => _jsx(Button, { ref: element => { if (element !== null)
79
- triggers.current.set(module, element); }, type: "button", variant: "outline", disabled: navigation.pending !== null, "aria-expanded": active === module, "aria-controls": `${id}-drawer`, onClick: () => workspace.request({ scope: navigation.scope, module }), children: t(moduleTitle(module)) }, module)) }), active !== null && _jsxs("aside", { id: `${id}-drawer`, className: "dsmm-module-drawer", "aria-labelledby": `${id}-heading`, "data-dsmm-module": active, onKeyDown: event => {
80
- if (event.key !== "Escape" || event.defaultPrevented)
81
- return;
82
- const target = event.target;
83
- if (target.tagName === "SELECT" && (!globalThis.CSS?.supports("selector(select:open)") || target.matches("select:open")))
84
- return;
85
- event.preventDefault();
86
- if (navigation.pending !== null)
87
- workspace.continueEditing();
88
- else
89
- workspace.request({ scope: navigation.scope, module: null });
90
- }, children: [_jsxs("div", { className: "dsmm-drawer-heading", children: [_jsx("h2", { id: `${id}-heading`, ref: heading, tabIndex: -1, children: t(moduleTitle(active)) }), _jsx(Button, { type: "button", variant: "outline", disabled: state.busy, onClick: () => workspace.request({ scope: navigation.scope, module: null }), children: t("close") })] }), active === "state" ? _jsxs(_Fragment, { children: [_jsx(StateInspector, { controller: props.core, t: t }), scopeActions] }) : _jsxs(_Fragment, { children: [navigation.scope === "profile" && navigation.native === null ? _jsx("p", { children: t("unavailableForm") }) : state.snapshot === null ? _jsx("p", { children: t(state.busy ? "loading" : "unavailable") }) : _jsxs("div", { "data-dsmm-layer": controller.layer, "aria-busy": state.busy, className: "dsmm-structured", children: [fields.length === 0 && _jsx("p", { className: "dsmm-hint", children: t("noModuleFields") }), fields.map(([key, schema]) => _jsx(Field, { schema: schema, path: [key], controller: controller, initiallyOpen: fields.length === 1 && active !== "permissions", disclosures: disclosures.current[navigation.scope], t: t }, `${navigation.scope}:${key}`)), active === "run" && controller.layer === "profile" && _jsx(NativeRuntimeState, { value: state.snapshot.subagentRuntime, t: t })] }), scopeActions, active === "permissions" && _jsxs("section", { className: "dsmm-zone", children: [_jsx("h3", { children: t("rootRules") }), _jsx("p", { className: "dsmm-hint", children: t("rootRulesHint") }), workspace.permissions === undefined ? _jsx("p", { children: t("rootRulesUnavailable") }) : _jsx(PermissionPanelEntry, { controller: workspace.permissions, temporary: props.temporaryPermissions, t: props.permissionsT ?? (key => Object.hasOwn(permissionEn, key) ? permissionText(t)(key) : key) })] })] })] })] }), navigation.pending !== null && _jsxs("section", { className: "dsmm-confirm", role: "group", "aria-label": t("leaveDraft"), onKeyDown: event => { if (event.key === "Escape" && !event.defaultPrevented) {
98
+ workspace.request({ scope, module: null });
99
+ }, children: [_jsx("option", { value: "global", children: t("global") }), _jsx("option", { value: "profile", children: t("profile") })] })] }), _jsx("p", { className: "dsmm-hint", children: t(navigation.scope === "global" ? "globalHint" : "profileHint") }), navigation.scope === "profile" && (navigation.native === null || !navigation.native.canWriteProfile()) && _jsx("p", { className: "dsmm-hint", children: t("unavailableForm") }), _jsx("div", { className: "dsmm-section-tabs", role: "tablist", "aria-label": t("modules"), children: tabs.map((module, index) => _jsx(Button, { ref: element => { if (element !== null)
100
+ triggers.current.set(module, element);
101
+ else
102
+ triggers.current.delete(module); }, role: "tab", type: "button", id: `${id}-tab-${module}`, "aria-selected": active === module, "aria-controls": `${id}-panel`, tabIndex: active === module ? 0 : -1, "data-dsmm-tab": module, onKeyDown: event => onTabKey(event, index), onClick: () => select(module), children: t(moduleTitle(module)) }, module)) }), active !== null && _jsxs("section", { id: `${id}-panel`, role: "tabpanel", className: "dsmm-section-panel", "aria-labelledby": `${id}-tab-${active}`, "data-dsmm-module": active, children: [_jsx("div", { className: "dsmm-panel-heading", children: _jsx("h2", { id: `${id}-heading`, ref: heading, tabIndex: -1, children: t(moduleTitle(active)) }) }), active === "state" ? _jsxs(_Fragment, { children: [_jsx(StateInspector, { controller: props.core, t: t }), scopeActions] }) : _jsxs(_Fragment, { children: [navigation.scope === "profile" && navigation.native === null ? _jsx("p", { children: t("unavailableForm") }) : state.snapshot === null ? _jsx("p", { children: t(state.busy ? "loading" : "unavailable") }) : _jsxs("div", { "data-dsmm-layer": controller.layer, "aria-busy": state.busy, className: "dsmm-structured", children: [fields.length === 0 && _jsx("p", { className: "dsmm-hint", children: t("noModuleFields") }), fields.map(([key, schema]) => _jsx(Field, { schema: schema, path: [key], controller: controller, initiallyOpen: fields.length === 1 && active !== "permissions", disclosures: disclosures.current[navigation.scope], t: t }, `${navigation.scope}:${key}`)), active === "run" && controller.layer === "profile" && _jsx(NativeRuntimeState, { value: state.snapshot.subagentRuntime, t: t })] }), scopeActions, active === "permissions" && _jsxs("section", { className: "dsmm-zone dsmm-rules-transaction", "aria-label": t("rootRules"), children: [_jsx("h3", { children: t("rootRules") }), _jsx("p", { className: "dsmm-hint", children: t("rootRulesHint") }), workspace.permissions === undefined ? _jsx("p", { children: t("rootRulesUnavailable") }) : _jsx(PermissionsPanel, { controller: workspace.permissions, t: props.permissionsT ?? (key => Object.hasOwn(permissionEn, key) ? permissionText(t)(key) : key) })] })] })] }), navigation.pending !== null && _jsxs("section", { className: "dsmm-confirm", role: "group", "aria-label": t("leaveDraft"), onKeyDown: event => { if (event.key === "Escape" && !event.defaultPrevented) {
91
103
  event.preventDefault();
92
104
  workspace.continueEditing();
93
105
  } }, children: [_jsx("p", { children: t("leaveDraft") }), _jsxs("div", { className: "dsmm-actions", children: [_jsx(Button, { ref: confirmation, type: "button", variant: "primary", onClick: () => workspace.continueEditing(), children: t("continueEditing") }), _jsx(Button, { type: "button", variant: "outline", onClick: () => workspace.keepAndNavigate(), children: t("keepDraft") }), _jsx(Button, { type: "button", variant: "outline", disabled: state.busy, onClick: () => void workspace.discardAndNavigate(), children: t("discardDraft") })] })] })] });
@@ -1,8 +1,8 @@
1
1
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
2
  import { useId, useSyncExternalStore } from "react";
3
3
  import { Button, Input } from "@deepseek-ai/dsh-client-ui-primitives";
4
- import { parseNativeCommands } from "../permission-settings.js";
5
- import { parseAdvanced } from "./deployment-data.js";
4
+ import { parseNativeCommandPattern, parseNativeCommands } from "../permission-settings.js";
5
+ const ENTRIES_PATH = "permissionControl.nativeCommands.entries";
6
6
  export function validNativeEntries(entries) {
7
7
  try {
8
8
  parseNativeCommands({ entries });
@@ -13,56 +13,66 @@ export function validNativeEntries(entries) {
13
13
  }
14
14
  }
15
15
  export function emptyNativeEntry() {
16
- return { id: "", mode: "ask", sandboxMode: "workspace-write", match: { tool: "bash", executable: "", args: [], workingDirectory: "" } };
16
+ return { id: "", mode: "ask", sandboxMode: "workspace-write", match: { tool: "bash", workingDirectory: "", commandPattern: "" } };
17
17
  }
18
- function Arguments({ value, controller, name, disabled, onChange, t }) {
19
- const state = useSyncExternalStore(controller.subscribe, controller.getSnapshot), id = useId(), raw = state.raw[name], text = raw?.text ?? JSON.stringify(value), bad = raw?.invalid === true;
20
- return _jsxs("div", { className: "dsmm-field", children: [_jsx("label", { htmlFor: id, children: t("args") }), _jsx("textarea", { id: id, rows: 3, maxLength: 32768, disabled: disabled, value: text, "aria-invalid": bad, "aria-describedby": `${id}-error`, onChange: event => {
21
- const raw = event.currentTarget.value;
22
- let parsed;
23
- try {
24
- parsed = parseAdvanced(raw);
25
- }
26
- catch { /* Keep invalid text local until corrected. */ }
27
- const valid = Array.isArray(parsed) && parsed.every(item => typeof item === "string" && item.trim() !== "" && !item.includes("\0") && item.length <= 32768);
28
- controller.setRaw(name, raw, !valid);
18
+ function patternValid(value) {
19
+ try {
20
+ parseNativeCommandPattern(value);
21
+ return true;
22
+ }
23
+ catch {
24
+ return false;
25
+ }
26
+ }
27
+ function TextField({ id, label, value, disabled, onChange }) {
28
+ return _jsxs("div", { className: "dsmm-field", children: [_jsx("label", { htmlFor: id, children: label }), _jsx(Input, { className: "dsmm-input", id: id, value: value, maxLength: 32768, disabled: disabled, required: true, onChange: event => onChange(event.currentTarget.value) })] });
29
+ }
30
+ function Pattern({ value, controller, name, disabled, onChange, t }) {
31
+ const state = useSyncExternalStore(controller.subscribe, controller.getSnapshot), id = useId(), raw = state.raw[name], text = raw?.text ?? value, bad = raw?.invalid === true;
32
+ return _jsxs("div", { className: "dsmm-field", children: [_jsx("label", { htmlFor: `${id}-pattern`, children: t("pattern") }), _jsx(Input, { className: "dsmm-input", id: `${id}-pattern`, value: text, maxLength: 32768, disabled: disabled, required: true, "aria-invalid": bad, "aria-describedby": bad ? `${id}-error` : undefined, spellCheck: false, autoComplete: "off", onChange: event => {
33
+ const next = event.currentTarget.value, valid = patternValid(next);
34
+ controller.setRaw(name, next, !valid);
29
35
  if (valid)
30
- onChange(parsed);
31
- } }), _jsx("p", { id: `${id}-error`, className: "dsmm-hint", children: bad ? t("invalidEntry") : "" })] });
36
+ onChange(next);
37
+ } }), bad && _jsx("p", { id: `${id}-error`, className: "dsmm-hint", children: t("invalidPattern") })] });
32
38
  }
33
- function Entry({ entry, index, controller, disabled, removeDisabled, change, remove, t }) {
34
- const id = useId();
39
+ function Entry({ entry, index, controller, disabled, change, remove, t }) {
40
+ const id = useId(), match = entry.match, row = `${ENTRIES_PATH}.${index}`;
35
41
  const valid = validNativeEntries([entry]);
36
- const text = (key, label) => _jsxs("div", { className: "dsmm-field", children: [_jsx("label", { htmlFor: `${id}-${key}`, children: t(label) }), _jsx(Input, { className: "dsmm-input", id: `${id}-${key}`, value: key === "id" ? entry.id : entry.match[key] ?? "", maxLength: 32768, disabled: disabled, required: key !== "subcommand", onChange: event => {
37
- const value = event.currentTarget.value;
38
- if (key === "id")
39
- change({ ...entry, id: value });
40
- else if (key === "subcommand" && value === "") {
41
- const { subcommand: _omitted, ...match } = entry.match;
42
- change({ ...entry, match });
43
- }
44
- else
45
- change({ ...entry, match: { ...entry.match, [key]: value } });
46
- } })] });
47
- return _jsxs("fieldset", { "aria-describedby": !valid ? `${id}-error` : undefined, children: [_jsxs("legend", { children: [t("nativeCommands"), " ", index + 1] }), !valid && _jsx("p", { className: "dsmm-hint", id: `${id}-error`, children: t("invalidEntry") }), text("id", "entryId"), _jsxs("div", { className: "dsmm-field", children: [_jsx("label", { htmlFor: `${id}-tool`, children: t("tool") }), _jsx("select", { id: `${id}-tool`, disabled: disabled, value: entry.match.tool, onChange: event => {
42
+ return _jsxs("fieldset", { "aria-describedby": !valid ? `${id}-error` : undefined, children: [_jsxs("legend", { children: [t("nativeCommands"), " ", index + 1] }), !valid && _jsx("p", { className: "dsmm-hint", id: `${id}-error`, children: t("invalidEntry") }), _jsx(TextField, { id: `${id}-id`, label: t("entryId"), value: entry.id, disabled: disabled, onChange: value => change({ ...entry, id: value }) }), _jsxs("div", { className: "dsmm-field", children: [_jsx("label", { htmlFor: `${id}-tool`, children: t("tool") }), _jsx("select", { id: `${id}-tool`, disabled: disabled, value: match.tool, onChange: event => {
48
43
  const tool = event.currentTarget.value;
49
44
  if (tool === "bash" || tool === "pwsh")
50
- change({ ...entry, match: { ...entry.match, tool } });
51
- }, children: ["bash", "pwsh"].map(value => _jsx("option", { value: value, children: value }, value)) })] }), text("executable", "nativeExecutable"), text("subcommand", "subcommand"), _jsx(Arguments, { value: entry.match.args, controller: controller, name: `permissionControl.nativeCommands.entries.${index}.args`, disabled: disabled, t: t, onChange: args => change({ ...entry, match: { ...entry.match, args } }) }), text("workingDirectory", "cwd"), _jsxs("div", { className: "dsmm-field", children: [_jsx("label", { htmlFor: `${id}-sandbox`, children: t("sandboxMode") }), _jsxs("select", { id: `${id}-sandbox`, disabled: disabled, value: entry.sandboxMode, onChange: event => {
45
+ change({ ...entry, match: { ...match, tool } });
46
+ }, children: ["bash", "pwsh"].map(value => _jsx("option", { value: value, children: value }, value)) })] }), _jsx(Pattern, { value: match.commandPattern, controller: controller, name: `${row}.commandPattern`, disabled: disabled, t: t, onChange: commandPattern => change({ ...entry, match: { ...match, commandPattern } }) }), _jsx(TextField, { id: `${id}-workingDirectory`, label: t("cwd"), value: match.workingDirectory, disabled: disabled, onChange: workingDirectory => change({ ...entry, match: { ...match, workingDirectory } }) }), _jsxs("div", { className: "dsmm-field", children: [_jsx("label", { htmlFor: `${id}-sandbox`, children: t("sandboxMode") }), _jsxs("select", { id: `${id}-sandbox`, disabled: disabled, value: entry.sandboxMode, onChange: event => {
52
47
  if (event.currentTarget.value === "workspace-write")
53
48
  change({ ...entry, sandboxMode: "workspace-write" });
54
- }, children: [_jsx("option", { value: "workspace-write", children: "workspace-write" }), entry.sandboxMode === "danger-full-access" && _jsxs("option", { value: "danger-full-access", disabled: true, children: ["danger-full-access (", t("source"), ")"] })] })] }), _jsxs("div", { className: "dsmm-field", children: [_jsx("label", { htmlFor: `${id}-mode`, children: t("mode") }), _jsxs("select", { id: `${id}-mode`, disabled: disabled, value: entry.mode, onChange: event => {
49
+ }, children: [_jsx("option", { value: "workspace-write", children: "workspace-write" }), entry.sandboxMode === "danger-full-access" && _jsx("option", { value: "danger-full-access", disabled: true, children: t("restrictedFullAccess") })] })] }), _jsxs("div", { className: "dsmm-field", children: [_jsx("label", { htmlFor: `${id}-mode`, children: t("mode") }), _jsxs("select", { id: `${id}-mode`, disabled: disabled, value: entry.mode, onChange: event => {
55
50
  const mode = event.currentTarget.value;
56
51
  if (mode === "ask" || mode === "allow")
57
52
  change({ ...entry, mode });
58
- }, children: [_jsx("option", { value: "ask", children: t("action:ask") }), _jsx("option", { value: "allow", children: t("action:allow") })] })] }), _jsxs(Button, { type: "button", variant: "outline", disabled: disabled || removeDisabled, onClick: remove, children: [t("removeEntry"), " ", index + 1] })] });
53
+ }, children: [_jsx("option", { value: "ask", children: t("action:ask") }), _jsx("option", { value: "allow", children: t("action:allow") })] })] }), _jsxs(Button, { type: "button", variant: "outline", disabled: disabled, onClick: remove, children: [t("removeEntry"), " ", index + 1] })] });
59
54
  }
60
55
  export function NativeCommandEntries({ value, inherited, controller, disabled, onChange, setInvalid, t }) {
61
- const entries = value ?? inherited, name = "permissionControl.nativeCommands.entries";
56
+ const entries = value ?? inherited, name = ENTRIES_PATH;
62
57
  const state = useSyncExternalStore(controller.subscribe, controller.getSnapshot);
63
- const invalidArgs = state.invalidFields.filter(path => path.startsWith(`${name}.`) && path.endsWith(".args"));
58
+ const invalidRows = state.invalidFields.filter(path => path.startsWith(`${name}.`) && path.endsWith(".commandPattern"));
64
59
  const valid = validNativeEntries(entries);
65
60
  const change = (next) => { setInvalid(name, !validNativeEntries(next ?? inherited)); onChange(next); };
66
- return _jsxs("details", { className: "dsmm-deployment-group", children: [_jsxs("summary", { children: [t("nativeCommands"), " ", _jsx("code", { children: name })] }), _jsxs("div", { className: "dsmm-structured", children: [_jsx("p", { className: "dsmm-hint", children: t("nativeCommandsHint") }), _jsx("p", { className: "dsmm-hint", children: t("registrationUnresolved") }), _jsx("p", { className: "dsmm-hint", children: t(value === undefined ? "inheritedEntries" : "explicitEntries") }), !valid && _jsx("p", { className: "dsmm-issue", role: "alert", children: t("invalidEntry") }), invalidArgs.length > 0 && _jsx("p", { className: "dsmm-hint", children: t("invalidArgsHint") }), entries.length === 0 && _jsx("p", { children: t("noEntries") }), entries.map((entry, index) => _jsx(Entry, { entry: entry, index: index, controller: controller, disabled: disabled, removeDisabled: invalidArgs.length > 0, t: t, change: next => change(entries.map((row, position) => position === index ? next : row)), remove: () => { controller.clearRaw(name); change(entries.filter((_, position) => position !== index)); } }, index)), _jsxs("div", { className: "dsmm-actions", children: [_jsx(Button, { type: "button", variant: "outline", disabled: disabled || entries.length >= 1024, onClick: () => change([...entries, emptyNativeEntry()]), children: t("addEntry") }), _jsx(Button, { type: "button", variant: "outline", "data-dsmm-unset": name, disabled: disabled || value === undefined && invalidArgs.length === 0, onClick: () => { controller.clearRaw(name); change(undefined); }, children: t("unset") })] })] })] });
61
+ const remove = (index) => {
62
+ const drafts = Object.entries(state.raw).flatMap(([path, draft]) => {
63
+ if (!path.startsWith(`${name}.`))
64
+ return [];
65
+ const [row, ...field] = path.slice(name.length + 1).split(".");
66
+ const position = Number(row);
67
+ if (!Number.isInteger(position) || field.length === 0 || position === index)
68
+ return [];
69
+ return [{ path: `${name}.${position > index ? position - 1 : position}.${field.join(".")}`, draft }];
70
+ });
71
+ controller.clearRaw(name);
72
+ for (const draft of drafts)
73
+ controller.setRaw(draft.path, draft.draft.text, draft.draft.invalid);
74
+ change(entries.filter((_, position) => position !== index));
75
+ };
76
+ return _jsxs("details", { className: "dsmm-deployment-group", children: [_jsxs("summary", { children: [t("nativeCommands"), " ", _jsx("code", { children: name })] }), _jsxs("div", { className: "dsmm-structured", children: [_jsx("p", { className: "dsmm-hint", children: t("nativeCommandsHint") }), _jsx("p", { className: "dsmm-hint", children: t("patternHint") }), _jsx("p", { className: "dsmm-hint", children: t("patternScope") }), _jsx("p", { className: "dsmm-hint", children: t("registrationUnresolved") }), _jsx("p", { className: "dsmm-hint", children: t(value === undefined ? "inheritedEntries" : "explicitEntries") }), !valid && _jsx("p", { className: "dsmm-issue", role: "alert", children: t("invalidEntry") }), invalidRows.length > 0 && _jsx("p", { className: "dsmm-hint", children: t("invalidPatternHint") }), entries.length === 0 && _jsx("p", { children: t("noEntries") }), entries.map((entry, index) => _jsx(Entry, { entry: entry, index: index, controller: controller, disabled: disabled, t: t, change: next => change(entries.map((row, position) => position === index ? next : row)), remove: () => remove(index) }, index)), _jsxs("div", { className: "dsmm-actions", children: [_jsx(Button, { type: "button", variant: "outline", disabled: disabled || entries.length >= 1024, onClick: () => change([...entries, emptyNativeEntry()]), children: t("addEntry") }), _jsx(Button, { type: "button", variant: "outline", "data-dsmm-unset": name, disabled: disabled || value === undefined && invalidRows.length === 0, onClick: () => { controller.clearRaw(name); change(undefined); }, children: t("unset") })] })] })] });
67
77
  }
68
78
  //# sourceMappingURL=NativeCommandEntries.js.map
@@ -0,0 +1,17 @@
1
+ import type { PermissionRule } from "../permission-rules.js";
2
+ import type { DeploymentController } from "./deployment-controller.js";
3
+ import type { PermissionLocaleKey } from "./permission-locales.js";
4
+ type Text = (key: PermissionLocaleKey) => string;
5
+ export declare function validPermissionRules(value: unknown): boolean;
6
+ export declare function PermissionRuleEntries({ value, inherited, controller, disabled, onChange, expanded, onExpandedChange, t }: {
7
+ value: readonly PermissionRule[] | undefined;
8
+ inherited: readonly PermissionRule[];
9
+ controller: DeploymentController;
10
+ disabled: boolean;
11
+ onChange(value: readonly PermissionRule[] | undefined): void;
12
+ expanded?: boolean;
13
+ onExpandedChange?(expanded: boolean): void;
14
+ t: Text;
15
+ }): import("react").JSX.Element;
16
+ export {};
17
+ //# sourceMappingURL=PermissionRuleEntries.d.ts.map
@@ -0,0 +1,70 @@
1
+ import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
2
+ import { useId, useSyncExternalStore } from "react";
3
+ import { Button, Input } from "@deepseek-ai/dsh-client-ui-primitives";
4
+ import { parsePermissionRules } from "../permission-rules.js";
5
+ import { parseAdvanced } from "./deployment-data.js";
6
+ const actions = ["allow", "ask", "deny"];
7
+ const kinds = ["outside-read", "shell", "webSearch", "webFetch"];
8
+ const name = "permissionControl.rules";
9
+ export function validPermissionRules(value) {
10
+ try {
11
+ parsePermissionRules(value);
12
+ return true;
13
+ }
14
+ catch {
15
+ return false;
16
+ }
17
+ }
18
+ function newMatch(kind) {
19
+ return kind === "outside-read" ? { kind, path: "", scope: "exact" } : kind === "shell" ? { kind, executable: "", command: "", workingDirectory: "" } : { kind };
20
+ }
21
+ /** Honest user-import provenance; the Host re-stamps it and owns revision/revocation. */
22
+ function newRule() {
23
+ return { id: "", action: "ask", match: newMatch("outside-read"), source: { kind: "user-import", label: "configuration" }, revision: 0, revoked: false };
24
+ }
25
+ function Row({ rule, index, disabled, change, remove, t }) {
26
+ const id = useId();
27
+ const field = (key) => _jsxs("div", { className: "dsmm-field", children: [_jsx("label", { htmlFor: `${id}-${key}`, children: t(key === "workingDirectory" ? "cwd" : key) }), _jsx(Input, { className: "dsmm-input", id: `${id}-${key}`, required: true, maxLength: 32768, disabled: disabled, value: key in rule.match ? String(Reflect.get(rule.match, key)) : "", onChange: event => change({ ...rule, match: { ...rule.match, [key]: event.currentTarget.value } }) })] });
28
+ return _jsxs("fieldset", { children: [_jsx("legend", { children: rule.id === "" ? `${t("newRule")} ${index + 1}` : rule.id }), _jsxs("p", { children: [t(rule.revoked ? "revoked" : "active"), " \u00B7 ", t(`action:${rule.action}`)] }), _jsxs("dl", { className: "dsmm-child-meta", children: [_jsx("dt", { children: t("source") }), _jsx("dd", { children: rule.source.kind === "operator" ? `${t("recordedOperator")} · ${rule.source.savedAt}` : `${t("imported")} · ${rule.source.label}` }), _jsx("dt", { children: t("recordVersion") }), _jsx("dd", { children: rule.revision })] }), _jsxs("div", { className: "dsmm-field", children: [_jsx("label", { htmlFor: `${id}-id`, children: t("id") }), _jsx(Input, { className: "dsmm-input", id: `${id}-id`, required: true, maxLength: 256, disabled: disabled, value: rule.id, onChange: event => change({ ...rule, id: event.currentTarget.value }) })] }), _jsxs("div", { className: "dsmm-field", children: [_jsx("label", { htmlFor: `${id}-action`, children: t("action") }), _jsx("select", { id: `${id}-action`, disabled: disabled, value: rule.action, onChange: event => {
29
+ const action = actions.find(value => value === event.currentTarget.value);
30
+ if (action !== undefined)
31
+ change({ ...rule, action });
32
+ }, children: actions.map(action => _jsx("option", { value: action, children: t(`action:${action}`) }, action)) })] }), _jsxs("div", { className: "dsmm-field", children: [_jsx("label", { htmlFor: `${id}-kind`, children: t("match") }), _jsx("select", { id: `${id}-kind`, disabled: disabled, value: rule.match.kind, onChange: event => {
33
+ const kind = kinds.find(value => value === event.currentTarget.value);
34
+ if (kind !== undefined)
35
+ change({ ...rule, match: newMatch(kind) });
36
+ }, children: kinds.map(kind => _jsx("option", { value: kind, children: t(`kind:${kind}`) }, kind)) })] }), rule.match.kind === "outside-read" && _jsxs(_Fragment, { children: [field("path"), _jsxs("div", { className: "dsmm-field", children: [_jsx("label", { htmlFor: `${id}-scope`, children: t("pathScope") }), _jsxs("select", { id: `${id}-scope`, disabled: disabled, value: rule.match.scope, onChange: event => {
37
+ const scope = event.currentTarget.value;
38
+ if (rule.match.kind === "outside-read" && (scope === "exact" || scope === "tree"))
39
+ change({ ...rule, match: { ...rule.match, scope } });
40
+ }, children: [_jsx("option", { value: "exact", children: t("exact") }), _jsx("option", { value: "tree", children: t("tree") })] })] })] }), rule.match.kind === "shell" && _jsxs(_Fragment, { children: [field("executable"), field("command"), field("workingDirectory")] }), _jsxs(Button, { type: "button", variant: "outline", disabled: disabled, onClick: remove, children: [t("removeRule"), " ", index + 1] })] });
41
+ }
42
+ export function PermissionRuleEntries({ value, inherited, controller, disabled, onChange, expanded, onExpandedChange, t }) {
43
+ const state = useSyncExternalStore(controller.subscribe, controller.getSnapshot), id = useId();
44
+ const raw = state.raw[name], locked = raw?.invalid === true, entries = value ?? inherited, valid = validPermissionRules(entries);
45
+ const text = raw?.text ?? (value === undefined ? "" : JSON.stringify(value, null, 2));
46
+ const change = (next) => {
47
+ // Any structured edit supersedes an invalid raw list; that replacement is explicit, not silent.
48
+ if (raw !== undefined)
49
+ controller.clearRaw(name);
50
+ controller.setInvalid(name, !validPermissionRules(next));
51
+ onChange(next);
52
+ };
53
+ const remove = (index) => change(entries.filter((_, position) => position !== index));
54
+ const held = disabled || locked;
55
+ return _jsxs("details", { className: "dsmm-deployment-group", "data-field": name, open: expanded, onToggle: event => onExpandedChange?.(event.currentTarget.open), children: [_jsxs("summary", { children: [t("configRules"), " ", _jsx("code", { children: name })] }), _jsxs("div", { className: "dsmm-structured", children: [_jsx("p", { className: "dsmm-hint", children: t("configRulesHint") }), _jsx("p", { className: "dsmm-hint", children: t(value === undefined ? "inheritedRules" : "explicitRules") }), !valid && _jsx("p", { className: "dsmm-issue", role: "alert", children: t("invalidRule") }), entries.length === 0 && _jsx("p", { children: t("configRulesEmpty") }), entries.map((rule, index) => _jsx(Row, { rule: rule, index: index, disabled: held, t: t, change: next => change(entries.map((row, position) => position === index ? next : row)), remove: () => remove(index) }, index)), _jsxs("div", { className: "dsmm-actions", children: [_jsx(Button, { type: "button", variant: "outline", disabled: held || entries.length >= 1024, onClick: () => change([...entries, newRule()]), children: t("addRule") }), _jsx(Button, { type: "button", variant: "outline", "data-dsmm-unset": name, disabled: disabled || value === undefined && raw === undefined, onClick: () => { controller.clearRaw(name); onChange(undefined); }, children: t("unset") })] }), _jsxs("details", { children: [_jsx("summary", { id: `${id}-advanced-label`, children: t("advancedRules") }), _jsxs("div", { className: "dsmm-field", children: [_jsx("textarea", { id: `${id}-advanced`, rows: 6, maxLength: 32768, value: text, disabled: disabled, "aria-labelledby": `${id}-advanced-label`, "aria-invalid": locked, "aria-describedby": `${id}-error`, onChange: event => {
56
+ const next = event.currentTarget.value;
57
+ let parsed, ok = false;
58
+ try {
59
+ parsed = parseAdvanced(next);
60
+ ok = parsed === undefined || validPermissionRules(parsed);
61
+ }
62
+ catch {
63
+ ok = false;
64
+ }
65
+ controller.setRaw(name, next, !ok);
66
+ if (ok)
67
+ onChange(parsed);
68
+ } }), _jsx("p", { id: `${id}-error`, className: "dsmm-hint", children: locked ? t("invalidRule") : "" })] })] })] })] });
69
+ }
70
+ //# sourceMappingURL=PermissionRuleEntries.js.map
@@ -1,16 +1,14 @@
1
1
  import type { PropsLocale } from "@deepseek-ai/dsh-client-ui-slots";
2
2
  import type { PermissionController, PermissionView } from "./permission-controller.js";
3
- import type { TemporaryPermissionRemote } from "../permission-temporary-types.js";
4
3
  type Locale = PropsLocale<"settings.dsmm-permissions">;
5
4
  export type PermissionsPanelProps = Locale & {
6
5
  controller: PermissionController;
7
6
  sessionId?: string;
8
- temporary?: TemporaryPermissionRemote;
9
7
  };
10
8
  export declare function PermissionRulesEditor({ controller, state, t }: Locale & {
11
9
  controller: PermissionController;
12
10
  state: PermissionView;
13
11
  }): import("react").JSX.Element;
14
- export declare function PermissionsPanel({ controller, t, sessionId, temporary }: PermissionsPanelProps): import("react").JSX.Element;
12
+ export declare function PermissionsPanel({ controller, t, sessionId }: PermissionsPanelProps): import("react").JSX.Element;
15
13
  export {};
16
14
  //# sourceMappingURL=PermissionsPanel.d.ts.map
@@ -1,7 +1,6 @@
1
1
  import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
2
2
  import { useEffect, useId, useSyncExternalStore } from "react";
3
3
  import { Button, Input } from "@deepseek-ai/dsh-client-ui-primitives";
4
- import { TemporaryGrants } from "./TemporaryPermissions.js";
5
4
  const actions = ["inherit", "allow", "ask", "deny"];
6
5
  const kinds = ["outside-read", "shell", "webSearch", "webFetch"];
7
6
  const ruleDraft = (rule) => ({ id: rule.id, action: rule.action, match: structuredClone(rule.match) });
@@ -35,13 +34,15 @@ function PermissionCoverage({ state, t }) {
35
34
  }
36
35
  export function PermissionRulesEditor({ controller, state, t }) {
37
36
  const id = useId(), draft = state.draft, disabled = !controller.canEdit(state.generation), value = state.rules;
38
- return _jsxs("section", { className: "dsmm-zone", "aria-label": t("rules"), children: [_jsx("h3", { children: t("rules") }), _jsx("p", { className: "dsmm-hint", children: t("rulesHint") }), _jsx("p", { className: "dsmm-hint", children: t("networkLimit") }), _jsx("p", { className: "dsmm-hint", children: t("matchHint") }), _jsx(Issue, { value: state.rulesIssue, t: t }), _jsx("p", { className: "dsmm-hint", children: t("observedPolicy") }), _jsxs("dl", { className: "dsmm-child-meta", children: [_jsx("dt", { children: t("profileOverrideState") }), _jsx("dd", { children: t("profileOverrideUnknown") })] }), _jsxs("dl", { className: "dsmm-child-meta", children: [_jsx("dt", { children: t("runtime") }), _jsx("dd", { children: value === null ? t("unknown") : t(value.runtime.state) }), _jsx("dt", { children: t("mounted") }), _jsx("dd", { children: value === null ? t("unknown") : t(value.runtime.mounted ? "on" : "off") })] }), value?.runtime.restartRequired && _jsx("p", { children: t("restart") }), disabled && _jsx("p", { className: "dsmm-hint", children: t(state.reading ? "reading" : "rulesUnavailable") }), state.base !== null && _jsxs("dl", { className: "dsmm-child-meta", children: [_jsx("dt", { children: "permissionControl.enabled" }), _jsxs("dd", { children: [t(state.base.policy.enabled ? "on" : "off"), " \u00B7 ", t("coldHint")] }), _jsx("dt", { children: "permissionControl.nativeCommands.enabled" }), _jsx("dd", { children: t(state.base.policy.nativeCommands.enabled ? "on" : "off") })] }), _jsx(PermissionCoverage, { state: state, t: t }), draft !== null && _jsxs(_Fragment, { children: [_jsxs("div", { className: "dsmm-field", children: [_jsx("label", { htmlFor: `${id}-outside`, children: t("outsideReads") }), _jsx(ActionSelect, { id: `${id}-outside`, value: draft.outsideReads, disabled: disabled, t: t, onChange: outsideReads => controller.edit(state.generation, { outsideReads }) })] }), ["webSearch", "webFetch"].map(key => _jsxs("fieldset", { children: [_jsx("legend", { children: t(key) }), _jsxs("label", { className: "dsmm-actions", htmlFor: `${id}-${key}-enabled`, children: [_jsx("input", { type: "checkbox", id: `${id}-${key}-enabled`, checked: draft[key].enabled, disabled: disabled, onChange: event => controller.edit(state.generation, { [key]: { ...draft[key], enabled: event.currentTarget.checked } }) }), t("enabled")] }), _jsxs("div", { className: "dsmm-field", children: [_jsx("label", { htmlFor: `${id}-${key}-rule`, children: t("rule") }), _jsx(ActionSelect, { id: `${id}-${key}-rule`, value: draft[key].rule, disabled: disabled, t: t, onChange: rule => controller.edit(state.generation, { [key]: { ...draft[key], rule } }) })] })] }, key)), _jsx(Button, { type: "button", variant: "outline", disabled: disabled || draft.editor !== null, onClick: () => controller.edit(state.generation, { editor: { id: "", action: "ask", match: newMatch("outside-read") } }), children: t("newRule") }), _jsx(RuleEditor, { controller: controller, state: state, t: t }), (draft.upsert.length > 0 || draft.revoke.length > 0) && _jsxs("div", { className: "dsmm-structured", children: [_jsx("h3", { children: t("staged") }), draft.upsert.map(row => _jsxs("div", { className: "dsmm-field", children: [_jsxs("p", { children: [row.id, " \u00B7 ", t(`kind:${row.match.kind}`), " \u00B7 ", t(`action:${row.action}`)] }), _jsxs(Button, { type: "button", variant: "outline", disabled: disabled, onClick: () => controller.edit(state.generation, { upsert: draft.upsert.filter(rule => rule.id !== row.id) }), children: [t("unstage"), ": ", row.id] })] }, row.id)), draft.revoke.map(ruleId => _jsxs("div", { className: "dsmm-field", children: [_jsxs("p", { children: [t("stageRevoke"), ": ", ruleId] }), _jsxs(Button, { type: "button", variant: "outline", disabled: disabled, onClick: () => controller.edit(state.generation, { revoke: draft.revoke.filter(id => id !== ruleId) }), children: [t("unstage"), ": ", ruleId] })] }, ruleId))] })] }), _jsx(RuleRecords, { state: state, controller: controller, t: t }), _jsxs("div", { className: "dsmm-actions", children: [_jsx(Button, { type: "button", variant: "primary", disabled: !controller.canSave(state.generation), onClick: () => void controller.save(state.generation), children: t("save") }), _jsx(Button, { type: "button", variant: "outline", disabled: state.scope !== "root" || !state.connected || state.reading || state.busy !== null, onClick: () => void controller.refresh(state.generation, true), children: t("discard") })] }), state.dirty && _jsx("p", { children: t("dirty") })] });
37
+ const writable = state.scope === "root" && state.connected;
38
+ return _jsxs("section", { className: "dsmm-zone", "aria-label": t("rules"), children: [_jsx("h3", { children: t("rules") }), _jsx("p", { className: "dsmm-hint", children: t("rulesHint") }), _jsx("p", { className: "dsmm-hint", children: t("networkLimit") }), _jsx("p", { className: "dsmm-hint", children: t("matchHint") }), _jsx(Issue, { value: state.rulesIssue, t: t }), _jsx("p", { className: "dsmm-hint", children: t("observedPolicy") }), _jsxs("dl", { className: "dsmm-child-meta", children: [_jsx("dt", { children: t("profileOverrideState") }), _jsx("dd", { children: t("profileOverrideUnknown") })] }), _jsxs("dl", { className: "dsmm-child-meta", children: [_jsx("dt", { children: t("runtime") }), _jsx("dd", { children: value === null ? t("unknown") : t(value.runtime.state) }), _jsx("dt", { children: t("mounted") }), _jsx("dd", { children: value === null ? t("unknown") : t(value.runtime.mounted ? "on" : "off") })] }), value?.runtime.restartRequired && _jsx("p", { children: t("restart") }), disabled && !state.reading && _jsx("p", { className: "dsmm-hint", children: t("rulesUnavailable") }), state.base !== null && _jsxs("dl", { className: "dsmm-child-meta", children: [_jsx("dt", { children: "permissionControl.enabled" }), _jsxs("dd", { children: [t(state.base.policy.enabled ? "on" : "off"), " \u00B7 ", t("coldHint")] }), _jsx("dt", { children: "permissionControl.nativeCommands.enabled" }), _jsx("dd", { children: t(state.base.policy.nativeCommands.enabled ? "on" : "off") })] }), _jsxs("details", { className: "dsmm-deployment-group", children: [_jsx("summary", { children: t("coverageDetails") }), _jsx(PermissionCoverage, { state: state, t: t })] }), draft !== null && _jsxs(_Fragment, { children: [_jsxs("div", { className: "dsmm-field", children: [_jsx("label", { htmlFor: `${id}-outside`, children: t("outsideReads") }), _jsx(ActionSelect, { id: `${id}-outside`, value: draft.outsideReads, disabled: disabled, t: t, onChange: outsideReads => controller.edit(state.generation, { outsideReads }) })] }), ["webSearch", "webFetch"].map(key => _jsxs("fieldset", { children: [_jsx("legend", { children: t(key) }), _jsxs("label", { className: "dsmm-actions", htmlFor: `${id}-${key}-enabled`, children: [_jsx("input", { type: "checkbox", id: `${id}-${key}-enabled`, checked: draft[key].enabled, disabled: disabled, onChange: event => controller.edit(state.generation, { [key]: { ...draft[key], enabled: event.currentTarget.checked } }) }), t("enabled")] }), _jsxs("div", { className: "dsmm-field", children: [_jsx("label", { htmlFor: `${id}-${key}-rule`, children: t("rule") }), _jsx(ActionSelect, { id: `${id}-${key}-rule`, value: draft[key].rule, disabled: disabled, t: t, onChange: rule => controller.edit(state.generation, { [key]: { ...draft[key], rule } }) })] })] }, key)), _jsx(Button, { type: "button", variant: "outline", disabled: disabled || draft.editor !== null, onClick: () => controller.edit(state.generation, { editor: { id: "", action: "ask", match: newMatch("outside-read") } }), children: t("newRule") }), _jsx(RuleEditor, { controller: controller, state: state, t: t }), (draft.upsert.length > 0 || draft.revoke.length > 0) && _jsxs("div", { className: "dsmm-structured", children: [_jsx("h3", { children: t("staged") }), draft.upsert.map(row => _jsxs("div", { className: "dsmm-field", children: [_jsxs("p", { children: [row.id, " \u00B7 ", t(`kind:${row.match.kind}`), " \u00B7 ", t(`action:${row.action}`)] }), _jsxs(Button, { type: "button", variant: "outline", disabled: disabled, onClick: () => controller.edit(state.generation, { upsert: draft.upsert.filter(rule => rule.id !== row.id) }), children: [t("unstage"), ": ", row.id] })] }, row.id)), draft.revoke.map(ruleId => _jsxs("div", { className: "dsmm-field", children: [_jsxs("p", { children: [t("stageRevoke"), ": ", ruleId] }), _jsxs(Button, { type: "button", variant: "outline", disabled: disabled, onClick: () => controller.edit(state.generation, { revoke: draft.revoke.filter(id => id !== ruleId) }), children: [t("unstage"), ": ", ruleId] })] }, ruleId))] })] }), _jsx(RuleRecords, { state: state, controller: controller, t: t }), _jsxs("div", { className: "dsmm-actions", children: [_jsx(Button, { type: "button", variant: "primary", disabled: !controller.canSave(state.generation), onClick: () => void controller.save(state.generation), children: t("save") }), _jsx(Button, { type: "button", variant: "outline", disabled: !writable || state.reading || state.busy !== null, onClick: () => void controller.refresh(state.generation), children: t("refresh") }), _jsx(Button, { type: "button", variant: "outline", disabled: !writable || state.reading || state.busy !== null || !state.dirty && state.rulesIssue === null, onClick: () => void controller.refresh(state.generation, true), children: t("discard") })] }), state.dirty && _jsx("p", { children: t("dirty") })] });
39
39
  }
40
- export function PermissionsPanel({ controller, t, sessionId, temporary }) {
40
+ export function PermissionsPanel({ controller, t, sessionId }) {
41
41
  const state = useSyncExternalStore(controller.store.subscribe, controller.store.getSnapshot);
42
42
  useEffect(() => controller.watch(), [controller]);
43
43
  if (sessionId !== undefined && sessionId !== state.sessionId)
44
44
  return _jsx("p", { className: "dsmm-hint", role: "status", children: t("rulesUnavailable") });
45
- return _jsxs("section", { className: "dsmm-profiles dsmm-children dsmm-permissions", "data-dsmm-permissions": true, "aria-label": t("title"), "aria-busy": state.reading || state.busy !== null, children: [_jsx("h2", { children: t("title") }), _jsx(RootState, { state: state, t: t }), _jsx("p", { className: "dsmm-hint", children: t("nativeApproval") }), _jsx("p", { className: "dsmm-status", role: "status", "aria-live": "polite", children: state.busy !== null ? t("busy") : state.reading ? t("reading") : state.notice === null ? "" : t(state.notice) }), _jsx(PermissionRulesEditor, { controller: controller, state: state, t: t }), temporary && sessionId && _jsx(TemporaryGrants, { remote: temporary, sessionId: sessionId, t: t }, sessionId)] });
45
+ // Silent revalidation never flips the region busy; a save reports through its own status line.
46
+ return _jsxs("section", { className: "dsmm-profiles dsmm-children dsmm-permissions", "data-dsmm-permissions": true, "aria-label": t("title"), "aria-busy": state.reading, children: [_jsx("h2", { children: t("title") }), _jsx(RootState, { state: state, t: t }), _jsx("p", { className: "dsmm-hint", children: t("nativeApproval") }), _jsx("p", { className: "dsmm-status", role: "status", "aria-live": "polite", children: state.busy !== null ? t("busy") : state.reading ? t("reading") : state.notice === null ? "" : t(state.notice) }), _jsx(PermissionRulesEditor, { controller: controller, state: state, t: t })] });
46
47
  }
47
48
  //# sourceMappingURL=PermissionsPanel.js.map
@@ -261,9 +261,9 @@ export declare const childrenLocaleZh: {
261
261
  no: string;
262
262
  activity: string;
263
263
  runtime: string;
264
- liveRoute: string;
265
- title: string;
266
264
  images: string;
265
+ title: string;
266
+ liveRoute: string;
267
267
  descendants: string;
268
268
  interrupt: string;
269
269
  readonly: string;
@@ -271,10 +271,8 @@ export declare const childrenLocaleZh: {
271
271
  delivery: string;
272
272
  queue: string;
273
273
  steer: string;
274
- authority: string;
275
274
  foreign: string;
276
275
  reading: string;
277
- restart: string;
278
276
  refresh: string;
279
277
  noSession: string;
280
278
  runs: string;
@@ -321,6 +319,8 @@ export declare const childrenLocaleZh: {
321
319
  interruptAvailability: string;
322
320
  imageAvailability: string;
323
321
  fence: string;
322
+ restart: string;
323
+ authority: string;
324
324
  evidence: string;
325
325
  evidenceMissing: string;
326
326
  originalEpoch: string;
@@ -108,7 +108,10 @@ export class ProfilesController {
108
108
  this.generation += 1;
109
109
  this.sessionGeneration += 1;
110
110
  this.modelSelectorGeneration += 1;
111
- this.publish({ session: null, sessionBusy: null, sessionNotice: null, sessionUnconfirmed: this.current.currentSessionId !== null,
111
+ // A replaced connection only discards what it observed. It never records a
112
+ // durable refusal for the session: an unread configuration is read again
113
+ // by the next refresh, and typing stays available in the meantime.
114
+ this.publish({ session: null, sessionBusy: null, sessionNotice: null, sessionUnconfirmed: false,
112
115
  sessionViewEpoch: this.current.sessionViewEpoch + 1, busy: null, issue: { kind: "transport", code: "unavailable" } });
113
116
  };
114
117
  if (replacement || source === null || this.connectionBaseline === undefined)
@@ -18,13 +18,11 @@ export declare const deploymentEn: {
18
18
  permissionControlHint: string;
19
19
  modules: string;
20
20
  scope: string;
21
- close: string;
22
21
  loading: string;
23
22
  unset: string;
24
23
  "module:run": string;
25
24
  "module:routes": string;
26
25
  "module:workflow": string;
27
- "module:subagents": string;
28
26
  "module:permissions": string;
29
27
  "module:other": string;
30
28
  "module:state": string;
@@ -43,6 +41,8 @@ export declare const deploymentEn: {
43
41
  nativeRuntimeHint: string;
44
42
  nativeRuntimeReadinessHint: string;
45
43
  unsetGroup: string;
44
+ unitBytes: string;
45
+ unitChars: string;
46
46
  nativeRuntimeState: string;
47
47
  nativeRuntimeBinding: string;
48
48
  nativeRuntimeFence: string;
@@ -12,15 +12,15 @@ export const deploymentEn = {
12
12
  core: "Core", coreHint: "Core-owned desired settings. Model-parameter passthrough is ordinary config, not a subplugin. The permission-control enabled flag is startup-pinned. Save does not change current-session admission; inspect desired, startup and admitted values below. Unavailable admission stays unknown.",
13
13
  modelParametersHint: "Off stops sending custom parameters and uses native reasoning defaults. Saved values and your selected model stay unchanged.",
14
14
  permissionControlHint: "Permission-control mounting is startup-pinned. Saved configuration does not prove runtime coverage or remove current protections. Root rules keep their independent authority inside Permissions.",
15
- modules: "Configuration modules", scope: "Configuration scope", close: "Close module", loading: "Loading configuration…", unset: "Use default configuration",
16
- "module:run": "Run and modules", "module:routes": "Model routes and recovery", "module:workflow": "Workflow, roles and skills", "module:subagents": "Subagent settings", "module:permissions": "Permissions and guards", "module:other": "Other settings", "module:state": "Configuration state",
15
+ modules: "Configuration sections", scope: "Configuration scope", loading: "Loading configuration…", unset: "Use default configuration",
16
+ "module:run": "Run and modules", "module:routes": "Model routes and recovery", "module:workflow": "Workflow, roles and subagents", "module:permissions": "Permissions and safety", "module:other": "Other / advanced", "module:state": "Configuration state",
17
17
  saveScope: "Save selected configuration scope", pendingModules: "Pending modules in this scope", savedRefreshRequired: "Saved — refresh required before further edits", sessionObserved: "Current-session admission observed",
18
18
  noModuleFields: "No editable settings in this scope.",
19
19
  leaveDraft: "Unsaved or invalid draft. Choose how to leave; nothing is saved or discarded automatically.", continueEditing: "Continue editing", keepDraft: "Keep draft and return", discardDraft: "Discard draft and leave",
20
- rootRules: "Session permission rules", rootRulesHint: "Rules save separately. Select an open main session with editing access and synchronized permissions.", rootRulesUnavailable: "Permission rules unavailable. Reconnect and refresh.",
20
+ rootRules: "Global permission rules", rootRulesHint: "Choose an open main session with editing access as the editor for Global rules. Saved rules persist in Global policy and affect every context that uses it; they are not session-private. This transaction saves separately from configuration.", rootRulesUnavailable: "Permission rules unavailable. Reconnect and refresh.",
21
21
  nativeRuntimeHint: "Native default On; Host base pins still apply. Mounting is captured at startup. Saving stages desired configuration only; it does not start/stop providers or cancel running sessions. A separate Host restart may cancel sessions.",
22
22
  nativeRuntimeReadinessHint: "Task progress is available in the session.",
23
- unsetGroup: "Use defaults for this group",
23
+ unsetGroup: "Use defaults for this group", unitBytes: "bytes", unitChars: "characters",
24
24
  nativeRuntimeState: "Observed native runtime", nativeRuntimeBinding: "Observed runtime composition", nativeRuntimeFence: "Execution admission ready", nativeRuntimeRestart: "Restart required", nativeRuntimeStock: "Official Host runtime", nativeRuntimeUnavailable: "Unavailable / unknown",
25
25
  "nativeRuntimeReason-explicit-composition-required": "The Host requires an explicit native runtime composition.", "nativeRuntimeReason-duplicate-provider": "More than one native provider is present; readiness is not confirmed.", "nativeRuntimeReason-authority-not-ready": "Native execution authority is not ready.", "nativeRuntimeReason-disabled": "The saved native runtime is disabled.", "nativeRuntimeReason-pending-restart": "Saved desired state differs from the mounted native composition; restart is pending.", "nativeRuntimeReason-scope-conflict": "Native scope ownership conflicts; readiness is not confirmed.",
26
26
  saveGlobal: "Save", saveProfile: "Save", saving: "Saving…", refresh: "Refresh", discard: "Discard and reload", dirty: "Unsaved changes", saved: "Saved",
@@ -54,15 +54,15 @@ export const deploymentZh = {
54
54
  core: "Core 核心配置", coreHint: "Core 所有的 desired 意图配置。模型参数透传为普通配置,非子插件;权限控制 enabled 仅启动时捕获。保存不改变当前会话准入;下方可检查意图、启动与准入值,不可用的准入仍为未知。",
55
55
  modelParametersHint: "关闭后停止发送自定义参数,并使用原生推理默认值;已保存的值和所选模型不变。",
56
56
  permissionControlHint: "权限控制挂载仅启动时捕获。保存配置不证明运行时覆盖,也不移除当前保护;Root 规则在权限模块内保持独立权限。",
57
- modules: "配置模块", scope: "配置范围", close: "关闭模块", loading: "正在加载配置…", unset: "使用默认配置",
58
- "module:run": "运行与模块", "module:routes": "模型路由与恢复", "module:workflow": "工作流、角色与技能", "module:subagents": "子 Agent 设置", "module:permissions": "权限与保护", "module:other": "其他设置", "module:state": "配置状态",
57
+ modules: "配置分区", scope: "配置范围", loading: "正在加载配置…", unset: "使用默认配置",
58
+ "module:run": "运行与模块", "module:routes": "模型路由与恢复", "module:workflow": "工作流、角色与子 Agent", "module:permissions": "权限与安全", "module:other": "其他与高级", "module:state": "配置状态",
59
59
  saveScope: "保存所选配置作用域", pendingModules: "此作用域的待保存模块", savedRefreshRequired: "已保存——需刷新后继续编辑", sessionObserved: "已观测当前会话准入",
60
60
  noModuleFields: "此范围内没有可编辑的设置。",
61
61
  leaveDraft: "仍有未保存或无效草稿,请选择离开方式;不会自动保存或丢弃。", continueEditing: "继续编辑", keepDraft: "保留草稿并返回", discardDraft: "放弃草稿并离开",
62
- rootRules: "会话权限规则", rootRulesHint: "规则单独保存。请选择已打开的主会话,并确认有编辑权限且权限已同步。", rootRulesUnavailable: "权限规则不可用,请重连后刷新。",
62
+ rootRules: "全局权限规则", rootRulesHint: "请选择已打开且有编辑权限的主会话作为全局规则的编辑入口。保存的规则写入全局策略,对所有使用该策略的上下文生效,并非会话私有。此事务与配置分别保存。", rootRulesUnavailable: "权限规则不可用,请重连后刷新。",
63
63
  nativeRuntimeHint: "原生默认开启,Host base 固定值仍适用;挂载仅启动时捕获。保存只设置 desired,不会启动/停止提供商或取消当前会话;独立 Host 重启可能取消会话。",
64
64
  nativeRuntimeReadinessHint: "任务进度可在会话中查看。",
65
- unsetGroup: "整组使用默认配置",
65
+ unsetGroup: "整组使用默认配置", unitBytes: "字节", unitChars: "字符",
66
66
  nativeRuntimeState: "已观测原生运行时", nativeRuntimeBinding: "已观测运行时组合", nativeRuntimeFence: "执行准入已就绪", nativeRuntimeRestart: "需要重启", nativeRuntimeStock: "官方 Host 运行时", nativeRuntimeUnavailable: "不可用/未知",
67
67
  "nativeRuntimeReason-explicit-composition-required": "Host 需要显式的原生运行时组合。", "nativeRuntimeReason-duplicate-provider": "存在重复原生 provider,无法确认就绪状态。", "nativeRuntimeReason-authority-not-ready": "原生执行权限尚未就绪。", "nativeRuntimeReason-disabled": "已保存的原生运行时为关闭。", "nativeRuntimeReason-pending-restart": "已保存 desired 与已挂载原生组合不同,等待独立重启。", "nativeRuntimeReason-scope-conflict": "原生 scope 所有权冲突,无法确认就绪状态。",
68
68
  saveGlobal: "保存", saveProfile: "保存", saving: "正在保存…", refresh: "刷新", discard: "丢弃并重载", dirty: "未保存", saved: "已保存",
@@ -94,7 +94,6 @@ export const deploymentFieldLabels = {
94
94
  subagents: ["Subagents", "子 Agent"], lsp: ["LSP", "LSP"], presets: ["Preset materialization", "预设物化"],
95
95
  promptOrder: ["Prompt order", "提示词顺序"], defaultActive: ["Default Deepwork mode", "默认 Deepwork 模式"],
96
96
  enabled: ["Enabled", "启用"], materialize: ["Materialize presets", "物化预设"], scope: ["Guard scope", "保护范围"],
97
- plannerRootEnabled: ["Planner main-chat preset (restart required)", "Planner 主聊天预设(需重启)"],
98
97
  shellCommandSafety: ["Shell command safety", "Shell 命令安全"], gitWriteGuard: ["Git write policy", "Git 写入策略"],
99
98
  toolOutputTruncation: ["Tool output truncation", "工具输出截断"], maxInlineBytes: ["Inline byte limit", "内联字节上限"],
100
99
  planFormatValidation: ["Plan format validation", "计划格式校验"], questionLabelHelper: ["Question labels", "提问标签"], maxLabelChars: ["Label character limit", "标签字符上限"], todoDisciplineHelper: ["Todo discipline", "待办纪律"],
@@ -1,9 +1,11 @@
1
1
  import type { DeploymentSchemaNode } from "../profile-types.js";
2
2
  import type { DeploymentLocaleKey } from "./deployment-locales.js";
3
- export declare const CONFIG_MODULES: readonly ["run", "routes", "workflow", "subagents", "permissions", "other", "state"];
4
- export type ConfigModule = typeof CONFIG_MODULES[number];
3
+ /** The five flat sections. "other" is appended only when an ungrouped field exists. */
4
+ export declare const CONFIG_MODULES: readonly ["run", "routes", "workflow", "permissions", "state"];
5
+ export declare const NAVIGATION_MODULES: readonly ["run", "routes", "workflow", "permissions", "state", "other"];
6
+ export type ConfigModule = typeof NAVIGATION_MODULES[number];
5
7
  export declare const moduleTitle: (module: ConfigModule) => DeploymentLocaleKey;
6
- export declare function moduleFor(path: string): Exclude<ConfigModule, "state">;
8
+ export declare function moduleFor(path: string): ConfigModule;
7
9
  export declare function editableConfigField(key: string, layer: "global" | "profile"): boolean;
8
10
  export declare function moduleFields(schema: DeploymentSchemaNode, module: ConfigModule, layer: "global" | "profile"): Array<[string, DeploymentSchemaNode]>;
9
11
  //# sourceMappingURL=deployment-modules.d.ts.map
@@ -1,4 +1,6 @@
1
- export const CONFIG_MODULES = ["run", "routes", "workflow", "subagents", "permissions", "other", "state"];
1
+ /** The five flat sections. "other" is appended only when an ungrouped field exists. */
2
+ export const CONFIG_MODULES = ["run", "routes", "workflow", "permissions", "state"];
3
+ export const NAVIGATION_MODULES = [...CONFIG_MODULES, "other"];
2
4
  export const moduleTitle = (module) => `module:${module}`;
3
5
  export function moduleFor(path) {
4
6
  const key = path.split(".")[0];
@@ -6,10 +8,8 @@ export function moduleFor(path) {
6
8
  return "run";
7
9
  if (["roleRouting", "runtimePolicy", "runtimeRecovery"].includes(key))
8
10
  return "routes";
9
- if (["workflow", "roles", "skills", "presets", "businessLocale", "locale", "promptOrder", "plannerRootEnabled"].includes(key))
11
+ if (["workflow", "roles", "skills", "presets", "businessLocale", "locale", "promptOrder", "subagents"].includes(key))
10
12
  return "workflow";
11
- if (key === "subagents")
12
- return "subagents";
13
13
  if (["permissionControl", "guards"].includes(key))
14
14
  return "permissions";
15
15
  return "other";
@@ -18,6 +18,7 @@ export declare class DeploymentWorkspace {
18
18
  readonly permissions?: PermissionController | undefined;
19
19
  private state;
20
20
  private listeners;
21
+ private visited;
21
22
  private forms;
22
23
  private profiles;
23
24
  private stopForm?;
@@ -35,9 +36,12 @@ export declare class DeploymentWorkspace {
35
36
  bindForms(forms: ConfigForms | null): void;
36
37
  private sync;
37
38
  controller(scope?: ConfigScope): DeploymentController | null;
39
+ /** First visit opens the first section with editable fields; afterwards the last viewed section. */
40
+ private defaultSection;
38
41
  hasPending(): boolean;
39
42
  request(destination: Destination): void;
40
43
  continueEditing(): void;
44
+ /** Explicitly keep every draft and move anyway; the draft stays in contribution memory. */
41
45
  keepAndNavigate(): void;
42
46
  discardAndNavigate(): Promise<void>;
43
47
  save(): Promise<void>;