@dsmm/dsmm 0.3.4 → 0.3.5

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.
@@ -14,7 +14,7 @@ Global and native-profile controls have independent Save, Refresh and Discard ac
14
14
 
15
15
  Native structural controls and bounded schema-aware Advanced JSON cover applicable deployment settings. Advanced input is strict JSON, not named-document JSONC. Invalid text and conflicts stay visible. Refresh preserves dirty input and its original revision; explicit discard/reload rebases it. Connection replacement, disconnection, entry replacement and disposal fence old writes. Saving doesn't restart, cancel, apply a named profile or respawn LSP.
16
16
 
17
- Configuration edits and Global rules are separate transactions. Writable Global configuration needs no main session; Global rules use a trusted main session as their management entry but persist globally for contexts using that policy. Each transaction retains its own draft, CAS, Save, Refresh and Discard. First load and explicit Refresh show loading; background rule revalidation keeps the existing view, focus and editing controls stable. Observed revocation, conflicts, disconnection and unsynchronized runtime still withdraw the affected mutation authority without discarding its draft.
17
+ Configuration edits and Global rules are separate transactions. Writable Global configuration needs no main session; Global rules use a trusted main session as their management entry but persist globally for contexts using that policy. Each transaction retains its own draft, CAS, Save, Refresh and Discard. First load and explicit Refresh show loading; background rule revalidation keeps the existing view, focus and editing controls stable. A same-session scope gap, owner rebind or connection change keeps the last successful rules observation readable as an explicitly unconfirmed projection while withdrawing mutation authority; a real session switch clears it. Observed revocation, conflicts, disconnection and unsynchronized runtime still withdraw the affected mutation authority without discarding its draft.
18
18
 
19
19
  LSP isn't an applicable UI setting in this version. Its implementation, interfaces and original configuration remain, but DSMM settings hide LSP controls and automatic MCP mounting stays off even with stored `lsp.enabled:true`. Neither a save nor a restart enables it. DSH's own LSP and independently configured MCP are unaffected; the retained historical manual patch isn't a supported DSMM activation entry. See [LSP boundary](lsp.md).
20
20
 
@@ -66,6 +66,23 @@ export function Field({ schema, path, controller, initiallyOpen = false, disclos
66
66
  const state = useSyncExternalStore(controller.subscribe, controller.getSnapshot), snapshot = state.snapshot, id = useId(), name = path.join(".");
67
67
  const [open, setOpen] = useState(disclosures?.get(name) ?? initiallyOpen);
68
68
  const expand = (expanded) => { disclosures?.set(name, expanded); setOpen(expanded); };
69
+ const unsetGroup = (event) => {
70
+ // The group action lives in the title row; prevent the disclosure's own activation
71
+ // instead of swallowing key events, so Enter/Space each activate this button once.
72
+ event?.preventDefault();
73
+ event?.stopPropagation();
74
+ const summary = event?.currentTarget.closest("summary"), action = event?.currentTarget ?? null;
75
+ controller.clearRaw(name);
76
+ controller.edit(path, undefined);
77
+ // The action is disabled by the reset, so the browser would drop focus to the document;
78
+ // keep it on the group title row instead.
79
+ if (summary !== null && summary !== undefined) {
80
+ const restore = () => { const active = document.activeElement; if (active === null || active === document.body || active === action)
81
+ summary.focus(); };
82
+ if (typeof requestAnimationFrame === "function")
83
+ requestAnimationFrame(() => { restore(); requestAnimationFrame(restore); });
84
+ }
85
+ };
69
86
  const explicit = at(state.draft, path), inherited = controller.layer === "global" ? at(snapshot.defaults, path) : at(mergeLayer(mergeLayer(snapshot.defaults, snapshot.global), snapshot.nativeForm?.base ?? {}), path);
70
87
  const choices = enumValues(schema), disabled = !controller.canEdit();
71
88
  if (name === "permissionControl.nativeCommands.entries")
@@ -73,7 +90,7 @@ export function Field({ schema, path, controller, initiallyOpen = false, disclos
73
90
  if (name === "permissionControl.rules")
74
91
  return _jsx("div", { "data-field": name, children: _jsx(PermissionRuleEntries, { controller: controller, value: explicit, inherited: (inherited ?? []), disabled: disabled, onChange: value => controller.edit(path, value), expanded: open, onExpandedChange: expand, t: permissionText(t) }) });
75
92
  if (schema.type === "object" && schema.fields !== undefined && path[0] !== "roleRouting")
76
- return _jsxs("details", { className: "dsmm-deployment-group", "data-field": name, open: open, onToggle: event => expand(event.currentTarget.open), children: [_jsx("summary", { children: fieldLabel(path, t) }), _jsxs("div", { children: [name === "permissionControl" && _jsx("p", { className: "dsmm-hint", children: permissionText(t)("configPolicyHint") }), _jsx("p", { className: "dsmm-hint", children: t(explicit === undefined ? "inherit" : "explicit") }), _jsx(Button, { type: "button", variant: "outline", "data-dsmm-unset": name, disabled: disabled || explicit === undefined && !Object.keys(state.raw).some(key => key === name || key.startsWith(`${name}.`)), onClick: () => { controller.clearRaw(name); controller.edit(path, undefined); }, children: t("unsetGroup") }), Object.entries(schema.fields).map(([key, node]) => _jsx(Field, { schema: node, path: [...path, key], controller: controller, disclosures: disclosures, t: t }, key))] })] });
93
+ return _jsxs("details", { className: "dsmm-deployment-group", "data-field": name, open: open, onToggle: event => expand(event.currentTarget.open), children: [_jsx("summary", { children: _jsxs("span", { className: "dsmm-group-summary", children: [_jsx("span", { className: "dsmm-group-summary-label", children: fieldLabel(path, t) }), _jsx(Button, { type: "button", variant: "outline", className: "dsmm-group-summary-action", "data-dsmm-unset": name, hidden: !open, disabled: disabled || explicit === undefined && !Object.keys(state.raw).some(key => key === name || key.startsWith(`${name}.`)), onClick: unsetGroup, children: t("unsetGroup") })] }) }), _jsxs("div", { children: [name === "permissionControl" && _jsx("p", { className: "dsmm-hint", children: permissionText(t)("configPolicyHint") }), _jsx("p", { className: "dsmm-hint", children: t(explicit === undefined ? "inherit" : "explicit") }), Object.entries(schema.fields).map(([key, node]) => _jsx(Field, { schema: node, path: [...path, key], controller: controller, disclosures: disclosures, t: t }, key))] })] });
77
94
  if (!["boolean", "string", "number"].includes(schema.type) && choices === null)
78
95
  return _jsx(AdvancedField, { schema: schema, path: path, controller: controller, inherited: inherited, upper: controller.layer === "global" ? at(snapshot.profile, path) : undefined, expanded: open, onExpandedChange: expand, t: t });
79
96
  return _jsxs("div", { className: "dsmm-field dsmm-deployment-field", "data-field": name, children: [schema.type === "boolean" || choices !== null ? _jsxs(_Fragment, { children: [_jsx("label", { htmlFor: id, children: fieldLabel(path, t) }), _jsxs("select", { id: id, disabled: disabled, value: explicit === undefined ? "inherit" : JSON.stringify(explicit), onChange: event => controller.edit(path, event.currentTarget.value === "inherit" ? undefined : JSON.parse(event.currentTarget.value)), children: [_jsx("option", { value: "inherit", children: `${t("unset")} · ${displayValue(inherited, t)}` }), (choices ?? [true, false]).map(choice => _jsx("option", { value: JSON.stringify(choice), children: displayValue(choice, t) }, String(choice)))] })] }) : _jsx(ScalarField, { schema: schema, path: path, controller: controller, inherited: inherited, t: t }), name === "modelParameters.passthrough" && _jsx("p", { className: "dsmm-hint", children: t("modelParametersHint") }), name === "permissionControl.enabled" && _jsx("p", { className: "dsmm-hint", children: permissionText(t)("coldHint") }), explicit !== undefined && _jsx("p", { className: "dsmm-hint", children: t(equal(explicit, at(snapshot.defaults, path)) ? "defaultPin" : "explicit") }), controller.layer === "profile" && at(snapshot.nativeForm?.base, path) !== undefined && _jsx("p", { className: "dsmm-hint", children: t("hostPin") }), controller.layer === "global" && at(snapshot.profile, path) !== undefined && _jsxs("p", { className: "dsmm-hint", children: [t("profileSource"), ": ", displayValue(at(snapshot.profile, path), t), " \u00B7 ", t("explicit")] })] });
@@ -1,6 +1,7 @@
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 { displayUnconfirmed, observedRules } from "./permission-controller.js";
4
5
  const actions = ["inherit", "allow", "ask", "deny"];
5
6
  const kinds = ["outside-read", "shell", "webSearch", "webFetch"];
6
7
  const ruleDraft = (rule) => ({ id: rule.id, action: rule.action, match: structuredClone(rule.match) });
@@ -25,17 +26,17 @@ function RuleEditor({ controller, state, t }) {
25
26
  change({ ...editor, match: { ...editor.match, scope } }); }, children: [_jsx("option", { value: "exact", children: t("exact") }), _jsx("option", { value: "tree", children: t("tree") })] })] })] }), editor.match.kind === "shell" && _jsxs(_Fragment, { children: [field("executable", "executable"), field("command", "command"), field("workingDirectory", "cwd")] }), _jsxs("div", { className: "dsmm-actions", children: [_jsx(Button, { type: "submit", variant: "outline", disabled: disabled, children: t("stage") }), _jsx(Button, { type: "button", variant: "outline", disabled: disabled, onClick: () => controller.edit(state.generation, { editor: null }), children: t("cancel") })] })] });
26
27
  }
27
28
  function RuleRecords({ controller, state, t }) {
28
- const records = state.rules?.snapshot.policy.rules ?? state.base?.policy.rules;
29
+ const records = observedRules(state)?.snapshot.policy.rules ?? state.base?.policy.rules;
29
30
  return _jsxs("div", { className: "dsmm-structured", children: [records?.length === 0 && _jsx("p", { children: t("noRules") }), records?.map(rule => _jsxs("fieldset", { children: [_jsx("legend", { children: 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("match") }), _jsx("dd", { children: t(`kind:${rule.match.kind}`) }), rule.match.kind === "outside-read" && _jsxs(_Fragment, { children: [_jsx("dt", { children: t("path") }), _jsxs("dd", { children: [rule.match.path, " \u00B7 ", t(rule.match.scope)] })] }), rule.match.kind === "shell" && _jsxs(_Fragment, { children: [_jsx("dt", { children: t("executable") }), _jsx("dd", { children: rule.match.executable }), _jsx("dt", { children: t("command") }), _jsx("dd", { children: _jsx("code", { children: rule.match.command }) }), _jsx("dt", { children: t("cwd") }), _jsx("dd", { children: rule.match.workingDirectory })] }), _jsx("dt", { children: t("source") }), _jsx("dd", { children: t(rule.source.kind === "operator" ? "operator" : "imported") })] }), _jsxs("div", { className: "dsmm-actions", children: [_jsx(Button, { type: "button", variant: "outline", disabled: !controller.canEdit(state.generation) || state.draft === null, onClick: () => controller.edit(state.generation, { editor: ruleDraft(rule) }), children: t("editRule") }), _jsx(Button, { type: "button", variant: "outline", disabled: !controller.canEdit(state.generation) || state.draft === null || rule.revoked || state.draft.revoke.includes(rule.id), onClick: () => controller.stageRevoke(state.generation, rule.id), children: t("stageRevoke") })] })] }, rule.id))] });
30
31
  }
31
32
  function PermissionCoverage({ state, t }) {
32
- const value = state.rules?.capabilities;
33
+ const value = observedRules(state)?.capabilities;
33
34
  return _jsxs("section", { className: "dsmm-structured", "aria-label": t("coverageTitle"), children: [_jsx("h3", { children: t("coverageTitle") }), _jsx("p", { className: "dsmm-hint", children: t("coverage") }), _jsx("p", { className: "dsmm-hint", children: t("registrationUnresolved") }), value === undefined ? _jsx("p", { children: t("coverageUnavailable") }) : _jsxs(_Fragment, { children: [_jsxs("dl", { className: "dsmm-child-meta", children: [_jsx("dt", { children: t("coverageRuntime") }), _jsxs("dd", { children: [t(value.runtime.state), " \u00B7 ", t("mounted"), ": ", t(value.runtime.mounted ? "on" : "off")] })] }), value.runtime.restartRequired && _jsx("p", { children: t("restart") }), value.tools.length === 0 ? _jsx("p", { children: t("coverageEmpty") }) : _jsx("ul", { className: "dsmm-profile-list", children: value.tools.map(tool => _jsx("li", { children: _jsxs("dl", { className: "dsmm-child-meta", children: [_jsx("dt", { children: t("toolName") }), _jsx("dd", { children: _jsx("code", { children: tool.name }) }), _jsx("dt", { children: t("toolKind") }), _jsx("dd", { children: _jsx("code", { children: tool.kind }) }), _jsx("dt", { children: t("toolApproval") }), _jsx("dd", { children: t("nativeOnce") }), _jsx("dt", { children: t("toolMemory") }), _jsx("dd", { children: t("notProvided") })] }) }, tool.name)) }), _jsxs("dl", { className: "dsmm-child-meta", children: [_jsx("dt", { children: t("outsideReads") }), _jsx("dd", { children: t("limit:outsideReads") }), _jsx("dt", { children: t("finalInode") }), _jsx("dd", { children: t("limit:finalInode") }), _jsx("dt", { children: t("toolMemory") }), _jsx("dd", { children: t("limit:scopedMemory") }), _jsx("dt", { children: t("webFetch") }), _jsx("dd", { children: t("limit:webFetch") }), _jsx("dt", { children: t("searchDestinations") }), _jsx("dd", { children: t("limit:webSearchDestinations") }), _jsx("dt", { children: t("proxyBinding") }), _jsx("dd", { children: t("limit:proxyAddressBinding") }), _jsx("dt", { children: t("shellSockets") }), _jsx("dd", { children: t("limit:shellSockets") }), _jsx("dt", { children: t("providerAuthMcp") }), _jsx("dd", { children: t("limit:providerAuthMcp") })] })] }), _jsx("p", { className: "dsmm-hint", children: t("pathEvidence") })] });
34
35
  }
35
36
  export function PermissionRulesEditor({ controller, state, t }) {
36
- const id = useId(), draft = state.draft, disabled = !controller.canEdit(state.generation), value = state.rules;
37
+ const id = useId(), draft = state.draft, disabled = !controller.canEdit(state.generation), value = observedRules(state), observedPolicy = value?.snapshot ?? null;
37
38
  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
+ 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 }), displayUnconfirmed(state) && _jsx("p", { className: "dsmm-hint", children: t("unconfirmedObservation") }), _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 && !displayUnconfirmed(state) && _jsx("p", { className: "dsmm-hint", children: t("rulesUnavailable") }), observedPolicy !== null && _jsxs("dl", { className: "dsmm-child-meta", children: [_jsx("dt", { children: "permissionControl.enabled" }), _jsxs("dd", { children: [t(observedPolicy.policy.enabled ? "on" : "off"), " \u00B7 ", t("coldHint")] }), _jsx("dt", { children: "permissionControl.nativeCommands.enabled" }), _jsx("dd", { children: t(observedPolicy.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
40
  }
40
41
  export function PermissionsPanel({ controller, t, sessionId }) {
41
42
  const state = useSyncExternalStore(controller.store.subscribe, controller.store.getSnapshot);
@@ -43,6 +44,6 @@ export function PermissionsPanel({ controller, t, sessionId }) {
43
44
  if (sessionId !== undefined && sessionId !== state.sessionId)
44
45
  return _jsx("p", { className: "dsmm-hint", role: "status", children: t("rulesUnavailable") });
45
46
  // 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 })] });
47
+ 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-hint", children: t("sandboxScope") }), _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 })] });
47
48
  }
48
49
  //# sourceMappingURL=PermissionsPanel.js.map
@@ -11,6 +11,7 @@ import { DEPLOYMENT_NS, deploymentEn, deploymentZh } from "./deployment-locales.
11
11
  import { ROLE_CONTROL_REMOTE } from "../role-control-remote.js";
12
12
  import { PERMISSION_REMOTE } from "../permission-remote.js";
13
13
  import { permissionClient } from "./permission-client.js";
14
+ import { bindPermissionSession } from "./permission-session.js";
14
15
  import { PermissionController } from "./permission-controller.js";
15
16
  import { PERMISSIONS_NS, permissionEn, permissionZh } from "./permission-locales.js";
16
17
  import { registerRoleToolViews } from "./RoleToolView.js";
@@ -42,24 +43,7 @@ export async function apply(ctx) {
42
43
  });
43
44
  void ctx.inject(["uiSession", "sessions"], sessionCtx => {
44
45
  const source = sessionCtx.uiSession.adapter.current, sessions = sessionCtx.sessions;
45
- let observed, stop;
46
- const update = () => {
47
- const id = source.getSnapshot().key, binding = id === undefined ? undefined : sessions.binding(id);
48
- if (binding !== observed) {
49
- stop?.();
50
- observed = binding;
51
- stop = binding?.session.subscribe(update);
52
- }
53
- const snapshot = binding?.session.getSnapshot(), catalog = sessions.list.getSnapshot(), summary = id === undefined ? undefined : catalog.byId[id];
54
- const child = snapshot?.subagent != null || summary?.origin === "subagent" || summary?.parentId !== undefined;
55
- const root = id !== undefined && binding?.sessionId === id && snapshot?.sessionId === id && snapshot.openState === "open" && !snapshot.removed
56
- && catalog.ids.includes(id) && summary !== undefined && !child;
57
- permissions.bindScope(id ?? null, binding ?? null, child ? "child" : root ? "root" : "unknown");
58
- };
59
- update();
60
- sessionCtx.effect(() => source.subscribe(update));
61
- sessionCtx.effect(() => sessions.list.subscribe(update));
62
- sessionCtx.effect(() => () => { stop?.(); permissions.bindScope(null, null, "unknown"); }, "dsmm: permission native session withdrawal");
46
+ sessionCtx.effect(() => bindPermissionSession(source, sessions, permissions), "dsmm: permission native session withdrawal");
63
47
  });
64
48
  let deployment = null;
65
49
  let profiles = null;
@@ -19,7 +19,13 @@ export interface PermissionView {
19
19
  /** Silent background revalidation of an already trusted snapshot; not a busy state. */
20
20
  revalidating: boolean;
21
21
  busy: "save" | null;
22
+ /** Current-fence authority observation; only a fresh successful read/save may set it. */
22
23
  rules: PermissionRulesSaveResult | null;
24
+ /**
25
+ * Last successful observation kept for display across a same-session scope gap,
26
+ * owner rebind or connection change. Never a base or mutation authority.
27
+ */
28
+ display: PermissionRulesSaveResult | null;
23
29
  /** Last observed C state; only a successful clean read/save may become the mutation baseline. */
24
30
  base: PermissionRulesSaveResult["snapshot"] | null;
25
31
  draft: PermissionDraft | null;
@@ -28,6 +34,10 @@ export interface PermissionView {
28
34
  notice: "saved" | null;
29
35
  }
30
36
  export declare function permissionChanges(view: PermissionView): PermissionRulesSaveRequest | null;
37
+ /** Policy, records, coverage and runtime may render from this observation; authority stays in `rules`. */
38
+ export declare const observedRules: (view: PermissionView) => PermissionRulesSaveResult | null;
39
+ /** The projection is older than the current fence and the current policy is unconfirmed. */
40
+ export declare const displayUnconfirmed: (view: PermissionView) => boolean;
31
41
  /** Borrowed native selection plus last-observed C state; never a Root or policy authority. */
32
42
  export declare class PermissionController {
33
43
  private state;
@@ -48,7 +58,7 @@ export declare class PermissionController {
48
58
  };
49
59
  private publish;
50
60
  private cancel;
51
- /** An observed snapshot exists; background work must stay invisible until it changes what is possible. */
61
+ /** An observed snapshot exists for this fence; background work must stay invisible until it changes what is possible. */
52
62
  private trusted;
53
63
  private fence;
54
64
  bindConnection(invoke: PermissionInvoker | null, generation?: unknown): void;
@@ -11,7 +11,11 @@ export function permissionChanges(view) {
11
11
  return { expectedRevision: base.revision, ...(Object.keys(changes).length ? { changes } : {}), ...(draft.upsert.length ? { upsert: draft.upsert } : {}), ...(draft.revoke.length ? { revoke: draft.revoke } : {}) };
12
12
  }
13
13
  const empty = () => ({ generation: 0, sessionId: null, scope: "unknown", connected: false, reading: false, revalidating: false, busy: null,
14
- rules: null, base: null, draft: null, rulesIssue: null, dirty: false, notice: null });
14
+ rules: null, display: null, base: null, draft: null, rulesIssue: null, dirty: false, notice: null });
15
+ /** Policy, records, coverage and runtime may render from this observation; authority stays in `rules`. */
16
+ export const observedRules = (view) => view.rules ?? view.display;
17
+ /** The projection is older than the current fence and the current policy is unconfirmed. */
18
+ export const displayUnconfirmed = (view) => view.display !== null && view.rules === null;
15
19
  /** Borrowed native selection plus last-observed C state; never a Root or policy authority. */
16
20
  export class PermissionController {
17
21
  state = empty();
@@ -31,13 +35,13 @@ export class PermissionController {
31
35
  return; this.state = { ...this.state, ...patch }; for (const listener of this.listeners)
32
36
  listener(); }
33
37
  cancel() { this.request.abort(); this.request = new AbortController(); this.requestSequence++; clearTimeout(this.timer); }
34
- /** An observed snapshot exists; background work must stay invisible until it changes what is possible. */
38
+ /** An observed snapshot exists for this fence; background work must stay invisible until it changes what is possible. */
35
39
  trusted() { return this.observed; }
36
- fence(preserveDraft, preserveBase = preserveDraft) {
40
+ fence(preserveDraft, preserveBase = preserveDraft, preserveDisplay = true) {
37
41
  this.cancel();
38
42
  this.observed = false;
39
43
  this.publish({ generation: this.state.generation + 1, reading: false, revalidating: false, busy: null, notice: null, rules: null, rulesIssue: null,
40
- ...preserveDraft ? {} : { draft: null, dirty: false }, ...preserveBase ? {} : { base: null } });
44
+ ...preserveDisplay ? {} : { display: null }, ...preserveDraft ? {} : { draft: null, dirty: false }, ...preserveBase ? {} : { base: null } });
41
45
  }
42
46
  bindConnection(invoke, generation) {
43
47
  if (this.disposed || this.invoke === invoke && this.connection === generation)
@@ -51,11 +55,11 @@ export class PermissionController {
51
55
  bindScope(sessionId, owner, scope) {
52
56
  if (this.disposed || this.state.sessionId === sessionId && this.owner === owner && this.state.scope === scope)
53
57
  return;
54
- const sameSession = sessionId === this.state.sessionId;
58
+ const sameSession = sessionId !== null && sessionId === this.state.sessionId;
55
59
  this.owner = owner;
56
60
  // A replaced owner invalidates the old base even when the session ID is unchanged;
57
- // only the draft may survive for explicit recovery.
58
- this.fence(sameSession, false);
61
+ // only the draft and the read-only display projection may survive for explicit recovery.
62
+ this.fence(sameSession, false, sameSession);
59
63
  this.publish({ sessionId, scope });
60
64
  this.schedule(true);
61
65
  }
@@ -69,7 +73,7 @@ export class PermissionController {
69
73
  this.fence(true); };
70
74
  }
71
75
  dispose() { if (this.disposed)
72
- return; this.fence(false); this.disposed = true; this.listeners.clear(); this.invoke = null; this.owner = null; }
76
+ return; this.fence(false, false, false); this.disposed = true; this.listeners.clear(); this.invoke = null; this.owner = null; }
73
77
  live(generation) { return !this.disposed && generation === this.state.generation && this.owner !== null && this.invoke !== null && this.state.scope === "root" && this.state.sessionId !== null; }
74
78
  schedule(immediate = false) {
75
79
  clearTimeout(this.timer);
@@ -98,7 +102,8 @@ export class PermissionController {
98
102
  // A user-triggered refresh upgrades an in-flight silent read into its visible own request.
99
103
  if (!background && this.state.revalidating)
100
104
  this.cancel();
101
- const visible = !background || !this.trusted();
105
+ // An automatic read over an existing display projection is silent; a first load stays visible.
106
+ const visible = !background || !this.trusted() && this.state.display === null;
102
107
  const sequence = ++this.requestSequence, signal = this.request.signal, id = this.state.sessionId;
103
108
  this.publish(visible ? { reading: true, revalidating: false } : { revalidating: true });
104
109
  try {
@@ -107,13 +112,13 @@ export class PermissionController {
107
112
  return;
108
113
  this.observed = true;
109
114
  const retain = this.state.dirty && !discard;
110
- this.publish({ rules: value, rulesIssue: retain && this.state.base?.revision !== value.snapshot.revision ? "stale" : null,
115
+ this.publish({ rules: value, display: value, rulesIssue: retain && this.state.base?.revision !== value.snapshot.revision ? "stale" : null,
111
116
  ...retain ? {} : { base: value.snapshot, draft: draftOf(value.snapshot.policy), dirty: false } });
112
117
  }
113
118
  catch (error) {
114
119
  if (!this.live(generation) || signal.aborted || sequence !== this.requestSequence)
115
120
  return;
116
- // Keep the last trusted projection visible; only its mutation authority is withdrawn.
121
+ // Keep the last trusted projection (current or display-only) visible; only its mutation authority is withdrawn.
117
122
  this.publish({ rulesIssue: this.issue(error) });
118
123
  }
119
124
  finally {
@@ -159,7 +164,7 @@ export class PermissionController {
159
164
  const result = await this.invoke("saveRules", [current.id, request], current.signal);
160
165
  if (this.live(generation)) {
161
166
  this.observed = true;
162
- this.publish({ rules: result, base: result.snapshot, draft: draftOf(result.snapshot.policy), dirty: false, rulesIssue: null, notice: "saved" });
167
+ this.publish({ rules: result, display: result, base: result.snapshot, draft: draftOf(result.snapshot.policy), dirty: false, rulesIssue: null, notice: "saved" });
163
168
  }
164
169
  }
165
170
  catch (error) {
@@ -3,6 +3,8 @@ export declare const permissionEn: {
3
3
  title: string;
4
4
  rules: string;
5
5
  nativeApproval: string;
6
+ sandboxScope: string;
7
+ unconfirmedObservation: string;
6
8
  root: string;
7
9
  noRoot: string;
8
10
  child: string;
@@ -2,6 +2,8 @@ export const PERMISSIONS_NS = "settings.dsmm-permissions";
2
2
  export const permissionEn = {
3
3
  title: "Permission control", rules: "Global permission rules (through the selected main session)",
4
4
  nativeApproval: "Approve commands in the native prompt. Allow approves only that call.",
5
+ sandboxScope: "These rules decide allow, ask or deny for tools and matches. The Host sandbox and its native approval prompt remain separate and authoritative for what an approved call may touch.",
6
+ unconfirmedObservation: "Showing the last successful observation. The current selection is not confirmed yet, so editing and saving stay unavailable.",
5
7
  root: "Selected main session", noRoot: "Select a main session to view its permission rules.",
6
8
  child: "Select this child’s main session to edit Global rules.",
7
9
  unknown: "Unavailable / unknown", reading: "Reading…", busy: "Operation pending…",
@@ -62,6 +64,8 @@ export const permissionEn = {
62
64
  export const permissionZh = {
63
65
  title: "权限控制", rules: "全局权限规则(通过所选主会话管理)",
64
66
  nativeApproval: "请在原生提示中批准命令;「允许」仅批准本次调用。",
67
+ sandboxScope: "这些规则决定工具与匹配项的允许、询问或拒绝;具体调用可触及的范围仍由宿主沙箱及其原生批准提示单独决定。",
68
+ unconfirmedObservation: "当前显示上次成功观测;当前选择尚未确认,编辑与保存暂不可用。",
65
69
  root: "所选主会话", noRoot: "请选择主会话以查看权限规则。", child: "请切换到此子会话的主会话后编辑全局规则。",
66
70
  unknown: "不可用/未知", reading: "正在读取…", busy: "操作处理中…",
67
71
  executable: "原生 Shell 注册身份(精确匹配)", command: "完整命令(精确匹配)", cwd: "工作目录(精确匹配)", id: "规则 ID", action: "规则动作", match: "匹配类型",
@@ -0,0 +1,37 @@
1
+ import type { SessionBinding, SessionListState, SessionSnapshot, SessionSummary } from "@deepseek-ai/dsh-api-session-controller/client";
2
+ import type { SessionId } from "@deepseek-ai/dsh-session/types";
3
+ import type { PermissionView } from "./permission-controller.js";
4
+ /** The observable subset this binding uses; no store engine is imported. */
5
+ interface Observable<T> {
6
+ getSnapshot(): T;
7
+ subscribe(listener: () => void): () => void;
8
+ }
9
+ /** The current native selection source; it retains whatever it renders. */
10
+ export type PermissionSessionSource = Observable<{
11
+ readonly key: string | undefined;
12
+ }>;
13
+ /** The session fields this binding classifies; a real `SessionFace` satisfies the projection. */
14
+ export type PermissionSessionSnapshot = Pick<SessionSnapshot, "sessionId" | "subagent" | "removed" | "openState">;
15
+ export type PermissionSessionBinding = Pick<SessionBinding, "sessionId"> & {
16
+ readonly session: Observable<PermissionSessionSnapshot>;
17
+ };
18
+ /** Only the catalog membership and lineage fields this binding reads. */
19
+ export type PermissionSessionCatalog = Pick<SessionListState, "ids"> & {
20
+ readonly byId: Readonly<Record<SessionId, Pick<SessionSummary, "origin" | "parentId">>>;
21
+ };
22
+ export interface PermissionSessions {
23
+ binding(id: SessionId): PermissionSessionBinding | undefined;
24
+ readonly list: Observable<PermissionSessionCatalog>;
25
+ }
26
+ /** The only controller capability this binding needs. */
27
+ export interface PermissionScopeSink {
28
+ bindScope(sessionId: string | null, owner: object | null, scope: PermissionView["scope"]): void;
29
+ }
30
+ /**
31
+ * Follow the selected native session without retaining, opening or debouncing it.
32
+ * A binding is reused across notifications and only an actual session change clears
33
+ * the controller's display projection.
34
+ */
35
+ export declare function bindPermissionSession(source: PermissionSessionSource, sessions: PermissionSessions, permissions: PermissionScopeSink): () => void;
36
+ export {};
37
+ //# sourceMappingURL=permission-session.d.ts.map
@@ -0,0 +1,34 @@
1
+ /**
2
+ * Follow the selected native session without retaining, opening or debouncing it.
3
+ * A binding is reused across notifications and only an actual session change clears
4
+ * the controller's display projection.
5
+ */
6
+ export function bindPermissionSession(source, sessions, permissions) {
7
+ let observed, stop;
8
+ const update = () => {
9
+ const id = source.getSnapshot().key, binding = id === undefined ? undefined : sessions.binding(id);
10
+ if (binding !== observed) {
11
+ stop?.();
12
+ observed = binding;
13
+ stop = binding?.session.subscribe(update);
14
+ }
15
+ const snapshot = binding?.session.getSnapshot(), catalog = sessions.list.getSnapshot(), summary = id === undefined ? undefined : catalog.byId[id];
16
+ const child = snapshot?.subagent != null || summary?.origin === "subagent" || summary?.parentId !== undefined;
17
+ const root = id !== undefined && binding?.sessionId === id && snapshot?.sessionId === id && snapshot.openState === "open" && !snapshot.removed
18
+ && catalog.ids.includes(id) && summary !== undefined && !child;
19
+ permissions.bindScope(id ?? null, binding ?? null, child ? "child" : root ? "root" : "unknown");
20
+ };
21
+ update();
22
+ const stopSource = source.subscribe(update), stopCatalog = sessions.list.subscribe(update);
23
+ let active = true;
24
+ return () => {
25
+ if (!active)
26
+ return;
27
+ active = false;
28
+ stopSource();
29
+ stopCatalog();
30
+ stop?.();
31
+ permissions.bindScope(null, null, "unknown");
32
+ };
33
+ }
34
+ //# sourceMappingURL=permission-session.js.map
@@ -1,3 +1,3 @@
1
1
  /** Geometry and theme aliases extracted in dsmm/DESIGN.md; scoped to this section. */
2
- export declare const PROFILE_STYLES = "\n.dsmm-profiles{width:100%;max-width:760px;min-width:0;display:flex;flex-direction:column;gap:12px;font-family:var(--dsw-font-family);font-size:14px;line-height:22px;color:var(--dsw-alias-label-primary)}\n.dsmm-profiles h2{margin:0;font-size:18px;font-weight:600}\n.dsmm-profiles h3,.dsmm-profiles legend{margin:0;font-size:14px;font-weight:500;line-height:22px}\n.dsmm-profiles :is(label,legend,summary){min-width:0;max-width:100%;overflow-wrap:anywhere}\n.dsmm-profiles :is(.dsmm-structured,.dsmm-session-scope,.dsmm-catalog,.dsmm-policy-fields){min-width:0;display:flex;flex-direction:column;gap:12px}\n.dsmm-profiles fieldset{min-width:0;margin:0;padding:12px;border:1px solid var(--dsw-alias-border-l4);border-radius:var(--dsw-radius-md);display:flex;flex-direction:column;gap:12px}\n.dsmm-profiles .dsmm-route-fields{display:flex;flex-wrap:wrap;gap:12px;min-width:0}\n.dsmm-profiles .dsmm-route-fields>.dsmm-field{flex:1 1 240px;max-width:100%}\n.dsmm-profiles .dsmm-route-fields select{width:100%}\n.dsmm-profiles summary{cursor:pointer;color:var(--dsw-alias-label-primary);min-height:32px;line-height:32px}\n.dsmm-profiles summary:focus-visible{outline:var(--dsw-focus-ring-width,2px) solid var(--dsw-focus-ring-color,var(--dsw-alias-state-business-primary));outline-offset:2px}\n.dsmm-profiles .dsmm-advanced[open]>div{margin-top:8px}\n.dsmm-header-profiles{display:inline-flex;align-items:center;min-width:0;font-family:var(--dsw-font-family);color:var(--dsw-alias-label-primary)}\n.dsmm-header-profiles .dsmm-profile-trigger{width:28px;height:28px;min-height:28px;padding:6px;justify-content:center}\n.dsmm-profile-trigger:focus-visible{outline:var(--dsw-focus-ring-width,2px) solid var(--dsw-focus-ring-color,var(--dsw-alias-state-business-primary));outline-offset:2px}\n.dsmm-profile-menu{font-family:var(--dsw-font-family);font-size:14px;line-height:22px;max-width:calc(100vw - 24px);color:var(--dsw-alias-label-primary)}\n.dsmm-profile-menu [role=presentation]{font:inherit;white-space:normal;overflow-wrap:anywhere;color:var(--dsw-alias-label-secondary)}\n.dsmm-profile-menu [role=menuitem]{font:inherit}\n.dsmm-profile-menu [role=menuitem]>span{white-space:normal;overflow-wrap:anywhere}\n.dsmm-profile-announcement{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip-path:inset(50%);white-space:nowrap;border:0}\n.dsmm-profiles p{margin:0;overflow-wrap:anywhere}\n.dsmm-profiles .dsmm-hint{color:var(--dsw-alias-label-secondary)}\n.dsmm-profiles .dsmm-field{min-width:0;display:flex;flex-direction:column;gap:6px}\n.dsmm-profiles .dsmm-actions{display:flex;flex-wrap:wrap;align-items:center;gap:8px}\n.dsmm-profiles button{max-width:100%;white-space:normal;overflow-wrap:anywhere;min-height:36px;height:auto}\n.dsmm-profiles .dsmm-input{width:100%;min-width:0;box-sizing:border-box;border-color:var(--dsw-alias-label-secondary)}\n.dsmm-profiles .dsmm-input input{width:100%;min-width:0;font:inherit;color:inherit}\n.dsmm-profiles .dsmm-choice{position:relative;min-width:0}\n.dsmm-profiles .dsmm-choice .dsmm-input input{padding-right:32px}\n.dsmm-profiles .dsmm-choice .dsmm-choice-toggle{position:absolute;right:4px;top:50%;transform:translateY(-50%);width:28px;height:28px;min-height:28px;padding:4px}\n.dsmm-profiles .dsmm-choice-list{position:absolute;z-index:1;top:100%;left:0;right:0;max-height:240px;overflow-y:auto;list-style:none;margin:4px 0 0;padding:4px;border:1px solid var(--dsw-alias-border-l4);border-radius:var(--dsw-radius-md);background:var(--dsw-alias-bg-layer-1);color:var(--dsw-alias-label-primary)}\n.dsmm-profiles .dsmm-choice-list [role=option]{padding:8px 10px;min-width:0;overflow-wrap:anywhere;cursor:pointer}\n.dsmm-profiles .dsmm-choice-list [role=option]:hover{background:var(--dsw-alias-interactive-bg-hover)}\n.dsmm-profiles .dsmm-choice-list [aria-selected=true]{background:var(--dsw-alias-interactive-bg-active);outline:var(--dsw-focus-ring-width,2px) solid var(--dsw-focus-ring-color,var(--dsw-alias-state-business-primary));outline-offset:-2px}\n.dsmm-profiles select,.dsmm-profiles textarea{box-sizing:border-box;min-width:0;max-width:100%;font:inherit;color:var(--dsw-alias-label-primary);background:var(--dsw-alias-bg-layer-1);border:1px solid var(--dsw-alias-label-secondary);border-radius:var(--dsw-radius-md)}\n.dsmm-profiles select{width:240px;height:32px;padding:0 10px;text-overflow:ellipsis}\n.dsmm-profiles textarea{width:100%;padding:12px;font-family:var(--ds-font-family-code);resize:vertical;overflow:auto;white-space:pre;}\n.dsmm-profiles select:hover:not(:disabled),.dsmm-profiles textarea:hover:not(:disabled){border-color:var(--dsw-alias-label-primary)}\n.dsmm-profiles select:active:not(:disabled){background:var(--dsw-alias-interactive-bg-active)}\n.dsmm-profiles :is(select,textarea,button):focus-visible,.dsmm-profiles .dsmm-input:has(input:focus-visible){outline:var(--dsw-focus-ring-width,2px) solid var(--dsw-focus-ring-color,var(--dsw-alias-state-business-primary));outline-offset:2px}\n.dsmm-profiles input[type=checkbox]:focus-visible{outline:var(--dsw-focus-ring-width,2px) solid var(--dsw-focus-ring-color,var(--dsw-alias-state-business-primary));outline-offset:2px}\n.dsmm-permissions label.dsmm-actions{min-height:32px}\n.dsmm-permissions input[type=checkbox]{accent-color:var(--dsw-alias-state-business-primary)}\n.dsmm-profiles :is(select,textarea):disabled{color:var(--dsw-alias-label-secondary);background:var(--dsw-alias-bg-module-platform);cursor:not-allowed}\n.dsmm-profiles .dsmm-editor,.dsmm-profiles .dsmm-confirm{min-width:0;display:flex;flex-direction:column;gap:12px;padding:16px;border:1px solid var(--dsw-alias-border-l4);border-radius:var(--dsw-radius-md);background:var(--dsw-alias-bg-module-platform)}\n.dsmm-profiles .dsmm-issue{padding:12px;border-left:4px solid var(--dsw-alias-state-error-primary);color:var(--dsw-alias-label-primary);overflow-wrap:anywhere}\n.dsmm-profiles .dsmm-issue p+p{margin-top:8px}\n.dsmm-profiles .dsmm-status{min-height:22px}\n.dsmm-profiles .dsmm-zone{min-width:0;display:flex;flex-direction:column;gap:12px;padding-top:16px;border-top:1px solid var(--dsw-alias-border-l4)}\n.dsmm-profiles .dsmm-profile-list{list-style:none;padding:0;margin:0;display:flex;flex-direction:column;gap:12px;min-width:0}\n.dsmm-profiles .dsmm-profile-list li{min-width:0;display:flex;flex-direction:column;gap:4px}\n.dsmm-profiles :is(.dsmm-warning,.dsmm-diagnostic,.dsmm-availability){min-width:0;display:flex;flex-direction:column;gap:4px;overflow-wrap:anywhere}\n.dsmm-profiles .dsmm-warning{border-left:4px solid var(--dsw-alias-state-warn-primary);padding:8px 12px;color:var(--dsw-alias-label-primary)}\n.dsmm-deployment{gap:8px}\n.dsmm-section-tabs{display:flex;gap:8px;min-width:0;max-width:100%;overflow-x:auto;overscroll-behavior-x:contain;border-bottom:1px solid var(--dsw-alias-border-l4);padding-bottom:2px}\n.dsmm-section-tabs button{flex:0 0 auto;justify-content:center;white-space:nowrap;border-color:transparent;border-bottom:2px solid transparent;border-radius:var(--dsw-radius-md) var(--dsw-radius-md) 0 0;background:transparent;color:var(--dsw-alias-label-secondary);font-weight:400}\n.dsmm-section-tabs button:hover{background:var(--dsw-alias-interactive-bg-hover)}\n.dsmm-section-tabs button[aria-selected=true]{background:var(--dsw-alias-interactive-bg-active);border-bottom-color:var(--dsw-alias-label-primary);color:var(--dsw-alias-label-primary);font-weight:500}\n.dsmm-section-panel{display:flex;flex-direction:column;gap:16px;min-width:0;width:100%;box-sizing:border-box}\n.dsmm-panel-heading{display:flex;flex-wrap:wrap;gap:8px;justify-content:space-between;align-items:center;min-width:0}\n.dsmm-panel-heading h2:focus-visible{outline:var(--dsw-focus-ring-width,2px) solid var(--dsw-focus-ring-color,var(--dsw-alias-state-business-primary));outline-offset:2px}\n.dsmm-rules-transaction{padding-top:16px}\n.dsmm-scope-save{display:flex;flex-direction:column;gap:8px;padding-top:16px;border-top:1px solid var(--dsw-alias-border-l4)}\n.dsmm-deployment .dsmm-deployment-group{border-top:1px solid var(--dsw-alias-border-l4);padding-top:8px;min-width:0}\n.dsmm-deployment .dsmm-deployment-group>div{display:flex;flex-direction:column;gap:8px;padding-top:8px}\n.dsmm-deployment code{font-family:var(--ds-font-family-code);overflow-wrap:anywhere}\n.dsmm-deployment label code,.dsmm-deployment summary code{margin-left:8px;font-size:12px;line-height:18px;font-weight:400;color:var(--dsw-alias-label-secondary)}\n.dsmm-deployment pre{margin:0;max-width:100%;white-space:pre-wrap;overflow-wrap:anywhere;font-family:var(--ds-font-family-code)}\n.dsmm-deployment .dsmm-deployment-state{display:flex;flex-direction:column;gap:4px;margin:0;padding:12px;border-top:1px solid var(--dsw-alias-border-l4)}\n.dsmm-deployment .dsmm-deployment-state dd{margin:0;color:var(--dsw-alias-label-secondary);overflow-wrap:anywhere}\n.dsmm-children .dsmm-child-composer{min-width:0;display:flex;flex-direction:column;gap:12px}\n.dsmm-children .dsmm-child-meta{margin:0;display:flex;flex-direction:column;gap:4px;min-width:0}\n.dsmm-children .dsmm-child-meta dt{font-weight:500;overflow-wrap:anywhere}\n.dsmm-children .dsmm-child-meta dd{margin:0;color:var(--dsw-alias-label-secondary);overflow-wrap:anywhere}\n.dsmm-children textarea.dsmm-child-message{font-family:var(--dsw-font-family);white-space:pre-wrap;overflow-wrap:anywhere}\n@media(prefers-reduced-motion:reduce){.dsmm-profiles *{transition:none!important;animation:none!important}}\n";
2
+ export declare const PROFILE_STYLES = "\n.dsmm-profiles{width:100%;max-width:760px;min-width:0;display:flex;flex-direction:column;gap:12px;font-family:var(--dsw-font-family);font-size:14px;line-height:22px;color:var(--dsw-alias-label-primary)}\n.dsmm-profiles h2{margin:0;font-size:18px;font-weight:600}\n.dsmm-profiles h3,.dsmm-profiles legend{margin:0;font-size:14px;font-weight:500;line-height:22px}\n.dsmm-profiles :is(label,legend,summary){min-width:0;max-width:100%;overflow-wrap:anywhere}\n.dsmm-profiles :is(.dsmm-structured,.dsmm-session-scope,.dsmm-catalog,.dsmm-policy-fields){min-width:0;display:flex;flex-direction:column;gap:12px}\n.dsmm-profiles fieldset{min-width:0;margin:0;padding:12px;border:1px solid var(--dsw-alias-border-l4);border-radius:var(--dsw-radius-md);display:flex;flex-direction:column;gap:12px}\n.dsmm-profiles .dsmm-route-fields{display:flex;flex-wrap:wrap;gap:12px;min-width:0}\n.dsmm-profiles .dsmm-route-fields>.dsmm-field{flex:1 1 240px;max-width:100%}\n.dsmm-profiles .dsmm-route-fields select{width:100%}\n.dsmm-profiles summary{cursor:pointer;color:var(--dsw-alias-label-primary);min-height:32px;line-height:32px}\n.dsmm-profiles summary:focus-visible{outline:var(--dsw-focus-ring-width,2px) solid var(--dsw-focus-ring-color,var(--dsw-alias-state-business-primary));outline-offset:2px}\n.dsmm-profiles .dsmm-advanced[open]>div{margin-top:8px}\n.dsmm-header-profiles{display:inline-flex;align-items:center;min-width:0;font-family:var(--dsw-font-family);color:var(--dsw-alias-label-primary)}\n.dsmm-header-profiles .dsmm-profile-trigger{width:28px;height:28px;min-height:28px;padding:6px;justify-content:center}\n.dsmm-profile-trigger:focus-visible{outline:var(--dsw-focus-ring-width,2px) solid var(--dsw-focus-ring-color,var(--dsw-alias-state-business-primary));outline-offset:2px}\n.dsmm-profile-menu{font-family:var(--dsw-font-family);font-size:14px;line-height:22px;max-width:calc(100vw - 24px);color:var(--dsw-alias-label-primary)}\n.dsmm-profile-menu [role=presentation]{font:inherit;white-space:normal;overflow-wrap:anywhere;color:var(--dsw-alias-label-secondary)}\n.dsmm-profile-menu [role=menuitem]{font:inherit}\n.dsmm-profile-menu [role=menuitem]>span{white-space:normal;overflow-wrap:anywhere}\n.dsmm-profile-announcement{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip-path:inset(50%);white-space:nowrap;border:0}\n.dsmm-profiles p{margin:0;overflow-wrap:anywhere}\n.dsmm-profiles .dsmm-hint{color:var(--dsw-alias-label-secondary)}\n.dsmm-profiles .dsmm-field{min-width:0;display:flex;flex-direction:column;gap:6px}\n.dsmm-profiles .dsmm-actions{display:flex;flex-wrap:wrap;align-items:center;gap:8px}\n.dsmm-profiles button{max-width:100%;white-space:normal;overflow-wrap:anywhere;min-height:36px;height:auto}\n.dsmm-profiles .dsmm-input{width:100%;min-width:0;box-sizing:border-box;border-color:var(--dsw-alias-label-secondary)}\n.dsmm-profiles .dsmm-input input{width:100%;min-width:0;font:inherit;color:inherit}\n.dsmm-profiles .dsmm-choice{position:relative;min-width:0}\n.dsmm-profiles .dsmm-choice .dsmm-input input{padding-right:32px}\n.dsmm-profiles .dsmm-choice .dsmm-choice-toggle{position:absolute;right:4px;top:50%;transform:translateY(-50%);width:28px;height:28px;min-height:28px;padding:4px}\n.dsmm-profiles .dsmm-choice-list{position:absolute;z-index:1;top:100%;left:0;right:0;max-height:240px;overflow-y:auto;list-style:none;margin:4px 0 0;padding:4px;border:1px solid var(--dsw-alias-border-l4);border-radius:var(--dsw-radius-md);background:var(--dsw-alias-bg-layer-1);color:var(--dsw-alias-label-primary)}\n.dsmm-profiles .dsmm-choice-list [role=option]{padding:8px 10px;min-width:0;overflow-wrap:anywhere;cursor:pointer}\n.dsmm-profiles .dsmm-choice-list [role=option]:hover{background:var(--dsw-alias-interactive-bg-hover)}\n.dsmm-profiles .dsmm-choice-list [aria-selected=true]{background:var(--dsw-alias-interactive-bg-active);outline:var(--dsw-focus-ring-width,2px) solid var(--dsw-focus-ring-color,var(--dsw-alias-state-business-primary));outline-offset:-2px}\n.dsmm-profiles select,.dsmm-profiles textarea{box-sizing:border-box;min-width:0;max-width:100%;font:inherit;color:var(--dsw-alias-label-primary);background:var(--dsw-alias-bg-layer-1);border:1px solid var(--dsw-alias-label-secondary);border-radius:var(--dsw-radius-md)}\n.dsmm-profiles select{width:240px;height:32px;padding:0 10px;text-overflow:ellipsis}\n.dsmm-profiles textarea{width:100%;padding:12px;font-family:var(--ds-font-family-code);resize:vertical;overflow:auto;white-space:pre;}\n.dsmm-profiles select:hover:not(:disabled),.dsmm-profiles textarea:hover:not(:disabled){border-color:var(--dsw-alias-label-primary)}\n.dsmm-profiles select:active:not(:disabled){background:var(--dsw-alias-interactive-bg-active)}\n.dsmm-profiles :is(select,textarea,button):focus-visible,.dsmm-profiles .dsmm-input:has(input:focus-visible){outline:var(--dsw-focus-ring-width,2px) solid var(--dsw-focus-ring-color,var(--dsw-alias-state-business-primary));outline-offset:2px}\n.dsmm-profiles input[type=checkbox]:focus-visible{outline:var(--dsw-focus-ring-width,2px) solid var(--dsw-focus-ring-color,var(--dsw-alias-state-business-primary));outline-offset:2px}\n.dsmm-permissions label.dsmm-actions{min-height:32px}\n.dsmm-permissions input[type=checkbox]{accent-color:var(--dsw-alias-state-business-primary)}\n.dsmm-profiles :is(select,textarea):disabled{color:var(--dsw-alias-label-secondary);background:var(--dsw-alias-bg-module-platform);cursor:not-allowed}\n.dsmm-profiles .dsmm-editor,.dsmm-profiles .dsmm-confirm{min-width:0;display:flex;flex-direction:column;gap:12px;padding:16px;border:1px solid var(--dsw-alias-border-l4);border-radius:var(--dsw-radius-md);background:var(--dsw-alias-bg-module-platform)}\n.dsmm-profiles .dsmm-issue{padding:12px;border-left:4px solid var(--dsw-alias-state-error-primary);color:var(--dsw-alias-label-primary);overflow-wrap:anywhere}\n.dsmm-profiles .dsmm-issue p+p{margin-top:8px}\n.dsmm-profiles .dsmm-status{min-height:22px}\n.dsmm-profiles .dsmm-zone{min-width:0;display:flex;flex-direction:column;gap:12px;padding-top:16px;border-top:1px solid var(--dsw-alias-border-l4)}\n.dsmm-profiles .dsmm-profile-list{list-style:none;padding:0;margin:0;display:flex;flex-direction:column;gap:12px;min-width:0}\n.dsmm-profiles .dsmm-profile-list li{min-width:0;display:flex;flex-direction:column;gap:4px}\n.dsmm-profiles :is(.dsmm-warning,.dsmm-diagnostic,.dsmm-availability){min-width:0;display:flex;flex-direction:column;gap:4px;overflow-wrap:anywhere}\n.dsmm-profiles .dsmm-warning{border-left:4px solid var(--dsw-alias-state-warn-primary);padding:8px 12px;color:var(--dsw-alias-label-primary)}\n.dsmm-deployment{gap:8px}\n.dsmm-section-tabs{display:flex;gap:8px;min-width:0;max-width:100%;overflow-x:auto;overscroll-behavior-x:contain;border-bottom:1px solid var(--dsw-alias-border-l4);padding-bottom:2px}\n.dsmm-section-tabs button{flex:0 0 auto;justify-content:center;white-space:nowrap;border-color:transparent;border-bottom:2px solid transparent;border-radius:var(--dsw-radius-md) var(--dsw-radius-md) 0 0;background:transparent;color:var(--dsw-alias-label-secondary);font-weight:400}\n.dsmm-section-tabs button:hover{background:var(--dsw-alias-interactive-bg-hover)}\n.dsmm-section-tabs button[aria-selected=true]{background:var(--dsw-alias-interactive-bg-active);border-bottom-color:var(--dsw-alias-label-primary);color:var(--dsw-alias-label-primary);font-weight:500}\n.dsmm-section-panel{display:flex;flex-direction:column;gap:16px;min-width:0;width:100%;box-sizing:border-box}\n.dsmm-panel-heading{display:flex;flex-wrap:wrap;gap:8px;justify-content:space-between;align-items:center;min-width:0}\n.dsmm-panel-heading h2:focus-visible{outline:var(--dsw-focus-ring-width,2px) solid var(--dsw-focus-ring-color,var(--dsw-alias-state-business-primary));outline-offset:2px}\n.dsmm-rules-transaction{padding-top:16px}\n.dsmm-scope-save{display:flex;flex-direction:column;gap:8px;padding-top:16px;border-top:1px solid var(--dsw-alias-border-l4)}\n.dsmm-deployment .dsmm-deployment-group{border-top:1px solid var(--dsw-alias-border-l4);padding-top:8px;min-width:0}\n.dsmm-deployment .dsmm-deployment-group>div{display:flex;flex-direction:column;gap:8px;padding-top:8px}\n.dsmm-deployment summary .dsmm-group-summary{display:flex;align-items:center;gap:8px;min-width:0}\n.dsmm-deployment .dsmm-group-summary-label{flex:1 1 auto;min-width:0;overflow-wrap:anywhere}\n.dsmm-deployment .dsmm-group-summary-action{flex:0 0 auto;min-height:28px;height:28px;padding:0 8px}\n.dsmm-deployment .dsmm-group-summary-action[hidden]{display:none}\n.dsmm-deployment code{font-family:var(--ds-font-family-code);overflow-wrap:anywhere}\n.dsmm-deployment label code,.dsmm-deployment summary code{margin-left:8px;font-size:12px;line-height:18px;font-weight:400;color:var(--dsw-alias-label-secondary)}\n.dsmm-deployment pre{margin:0;max-width:100%;white-space:pre-wrap;overflow-wrap:anywhere;font-family:var(--ds-font-family-code)}\n.dsmm-deployment .dsmm-deployment-state{display:flex;flex-direction:column;gap:4px;margin:0;padding:12px;border-top:1px solid var(--dsw-alias-border-l4)}\n.dsmm-deployment .dsmm-deployment-state dd{margin:0;color:var(--dsw-alias-label-secondary);overflow-wrap:anywhere}\n.dsmm-children .dsmm-child-composer{min-width:0;display:flex;flex-direction:column;gap:12px}\n.dsmm-children .dsmm-child-meta{margin:0;display:flex;flex-direction:column;gap:4px;min-width:0}\n.dsmm-children .dsmm-child-meta dt{font-weight:500;overflow-wrap:anywhere}\n.dsmm-children .dsmm-child-meta dd{margin:0;color:var(--dsw-alias-label-secondary);overflow-wrap:anywhere}\n.dsmm-children textarea.dsmm-child-message{font-family:var(--dsw-font-family);white-space:pre-wrap;overflow-wrap:anywhere}\n@media(prefers-reduced-motion:reduce){.dsmm-profiles *{transition:none!important;animation:none!important}}\n";
3
3
  //# sourceMappingURL=styles.d.ts.map
@@ -65,6 +65,10 @@ export const PROFILE_STYLES = `
65
65
  .dsmm-scope-save{display:flex;flex-direction:column;gap:8px;padding-top:16px;border-top:1px solid var(--dsw-alias-border-l4)}
66
66
  .dsmm-deployment .dsmm-deployment-group{border-top:1px solid var(--dsw-alias-border-l4);padding-top:8px;min-width:0}
67
67
  .dsmm-deployment .dsmm-deployment-group>div{display:flex;flex-direction:column;gap:8px;padding-top:8px}
68
+ .dsmm-deployment summary .dsmm-group-summary{display:flex;align-items:center;gap:8px;min-width:0}
69
+ .dsmm-deployment .dsmm-group-summary-label{flex:1 1 auto;min-width:0;overflow-wrap:anywhere}
70
+ .dsmm-deployment .dsmm-group-summary-action{flex:0 0 auto;min-height:28px;height:28px;padding:0 8px}
71
+ .dsmm-deployment .dsmm-group-summary-action[hidden]{display:none}
68
72
  .dsmm-deployment code{font-family:var(--ds-font-family-code);overflow-wrap:anywhere}
69
73
  .dsmm-deployment label code,.dsmm-deployment summary code{margin-left:8px;font-size:12px;line-height:18px;font-weight:400;color:var(--dsw-alias-label-secondary)}
70
74
  .dsmm-deployment pre{margin:0;max-width:100%;white-space:pre-wrap;overflow-wrap:anywhere;font-family:var(--ds-font-family-code)}