@dsmm/dsmm 0.3.5 → 0.3.7
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.
- package/docs/native-permissions.md +2 -0
- package/docs/settings-status.md +1 -1
- package/lib/client/DeploymentFields.js +1 -1
- package/lib/client/DeploymentPage.js +1 -1
- package/lib/client/NativeCommandEntries.js +1 -1
- package/lib/client/PermissionsPanel.js +3 -3
- package/lib/client/deployment-locales.d.ts +0 -1
- package/lib/client/deployment-locales.js +12 -12
- package/lib/client/permission-controller.js +6 -9
- package/lib/client/permission-locales.d.ts +0 -1
- package/lib/client/permission-locales.js +34 -36
- package/lib/client/styles.d.ts +1 -1
- package/lib/client/styles.js +5 -1
- package/lib/client.js +64 -70
- package/lib/core-permission-authority.js +18 -5
- package/package.json +1 -1
|
@@ -28,6 +28,8 @@ Configuration writes require the real native operator, exact entry/form or Root
|
|
|
28
28
|
|
|
29
29
|
Use **Plugins → DSMM bundle config → Permissions**. The selected Global/native-profile scope edits its sparse deployment policy; a separate Root-rules transaction writes Global only under the existing live operator, exact open Root, registration and synchronized-policy authority. A child, stale connection, read-only Host or shadowing native policy doesn't acquire a fallback Global write. Named Profiles can't grant these permissions. No duplicate Settings permission page or Conversation permission tab is registered.
|
|
30
30
|
|
|
31
|
+
A trusted, writable ordinary native Root can manage Global rules without DSMM role admission, including when it predates Core mounting. This does not grant it a DSMM role. Captured DSMM objects still require current admission and role checks; retired captures and unadmitted Roots currently composed with a `dsmm-` preset cannot fall back to ordinary native authority.
|
|
32
|
+
|
|
31
33
|
`permissionControl.nativeCommands` defaults off. Each entry stores exactly one match shape, `{ tool, workingDirectory, commandPattern }`. Legacy `executable`/`subcommand`/`args` entries are not migrated, converted or silently dropped: configuration, persistence, runtime and the form reject them, so an older configuration must be rewritten explicitly rather than widened in place.
|
|
32
34
|
|
|
33
35
|
Entries use `executable BLANK subcommands [BLANK "*"]`, where subcommands are `|`-separated literals: `go build|test` and `go build|test *` are equivalent and allow zero or more trailing argv. `*` only stands for the whole trailing argument list; there is no character glob, regex, executable alternative, parenthesized group or cross-token alternative. Literals allow Unicode letters/marks/digits plus `_ . / : = + % -`, and the executable may also contain Windows path backslashes; quotes, escapes and whitespace inside a path are unsupported. A single-token call or a call with no subcommand position has no pattern equivalent, and any allowed trailing arguments are broader than a formerly fixed argv list.
|
package/docs/settings-status.md
CHANGED
|
@@ -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;
|
|
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. Global rules read on opening, session/owner/connection changes and explicit Refresh, without periodic polling or timed retries after failure. Save adopts its returned result. First load and explicit Refresh show loading; automatic reads over an existing observation keep its presentation 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. Other external policy changes are observed on the next read or save, with current authority and CAS checked by the Host on every mutation. 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
|
|
|
@@ -90,7 +90,7 @@ export function Field({ schema, path, controller, initiallyOpen = false, disclos
|
|
|
90
90
|
if (name === "permissionControl.rules")
|
|
91
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) }) });
|
|
92
92
|
if (schema.type === "object" && schema.fields !== undefined && path[0] !== "roleRouting")
|
|
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))] })] });
|
|
93
|
+
return _jsxs("details", { className: "dsmm-deployment-group", "data-field": name, open: open, onToggle: event => expand(event.currentTarget.open), children: [_jsx("summary", { className: "dsmm-group-summary-row", 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))] })] });
|
|
94
94
|
if (!["boolean", "string", "number"].includes(schema.type) && choices === null)
|
|
95
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 });
|
|
96
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")] })] });
|
|
@@ -99,7 +99,7 @@ export function DeploymentPage(props) {
|
|
|
99
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
100
|
triggers.current.set(module, element);
|
|
101
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" &&
|
|
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" && _jsx("section", { className: "dsmm-zone dsmm-rules-transaction", "aria-label": t("rootRules"), children: 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) {
|
|
103
103
|
event.preventDefault();
|
|
104
104
|
workspace.continueEditing();
|
|
105
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") })] })] })] });
|
|
@@ -73,6 +73,6 @@ export function NativeCommandEntries({ value, inherited, controller, disabled, o
|
|
|
73
73
|
controller.setRaw(draft.path, draft.draft.text, draft.draft.invalid);
|
|
74
74
|
change(entries.filter((_, position) => position !== index));
|
|
75
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("
|
|
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("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") })] })] })] });
|
|
77
77
|
}
|
|
78
78
|
//# sourceMappingURL=NativeCommandEntries.js.map
|
|
@@ -31,12 +31,12 @@ function RuleRecords({ controller, state, t }) {
|
|
|
31
31
|
}
|
|
32
32
|
function PermissionCoverage({ state, t }) {
|
|
33
33
|
const value = observedRules(state)?.capabilities;
|
|
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
|
+
return _jsxs("section", { className: "dsmm-structured", "aria-label": t("coverageTitle"), children: [_jsx("h3", { children: t("coverageTitle") }), _jsx("p", { className: "dsmm-hint", children: t("matchHint") }), _jsx("p", { className: "dsmm-hint", children: t("networkLimit") }), _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") })] });
|
|
35
35
|
}
|
|
36
36
|
export function PermissionRulesEditor({ controller, state, t }) {
|
|
37
37
|
const id = useId(), draft = state.draft, disabled = !controller.canEdit(state.generation), value = observedRules(state), observedPolicy = value?.snapshot ?? null;
|
|
38
38
|
const writable = state.scope === "root" && state.connected;
|
|
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(
|
|
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(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") })] });
|
|
40
40
|
}
|
|
41
41
|
export function PermissionsPanel({ controller, t, sessionId }) {
|
|
42
42
|
const state = useSyncExternalStore(controller.store.subscribe, controller.store.getSnapshot);
|
|
@@ -44,6 +44,6 @@ export function PermissionsPanel({ controller, t, sessionId }) {
|
|
|
44
44
|
if (sessionId !== undefined && sessionId !== state.sessionId)
|
|
45
45
|
return _jsx("p", { className: "dsmm-hint", role: "status", children: t("rulesUnavailable") });
|
|
46
46
|
// Silent revalidation never flips the region busy; a save reports through its own status line.
|
|
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 }),
|
|
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 }), _jsxs("p", { className: "dsmm-hint", children: [t("nativeApproval"), " ", 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 })] });
|
|
48
48
|
}
|
|
49
49
|
//# sourceMappingURL=PermissionsPanel.js.map
|
|
@@ -2,22 +2,22 @@ export const DEPLOYMENT_NS = "plugins.dsmm";
|
|
|
2
2
|
export const deploymentEn = {
|
|
3
3
|
title: "DSMM", summary: "Global config and profile overrides",
|
|
4
4
|
description: "Layers save independently; native models and running sessions stay unchanged.",
|
|
5
|
-
global: "DSMM Global config", globalHint: "Shared by this Home
|
|
6
|
-
profile: "Current DSH profile overrides", profileHint: "This
|
|
5
|
+
global: "DSMM Global config", globalHint: "Shared by this Home. Unset fields use built-in defaults.",
|
|
6
|
+
profile: "Current DSH profile overrides", profileHint: "This profile only. Unset fields use Global, then Host defaults.",
|
|
7
7
|
profileUnavailable: "Unavailable",
|
|
8
|
-
unavailableForm: "
|
|
8
|
+
unavailableForm: "Read-only profile. Reconnect and refresh to check editing access.",
|
|
9
9
|
ceiling: "Deepwork master is Global-only; profiles and session modes cannot lift its captured ceiling.",
|
|
10
10
|
hostUnknown: "Host bundle status: unknown (separate switch).",
|
|
11
|
-
boundaries: "Saved settings apply to new sessions
|
|
11
|
+
boundaries: "Saved settings apply to new sessions; restart-required changes need a separate Host restart that may cancel sessions.",
|
|
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
|
-
modelParametersHint: "Off
|
|
13
|
+
modelParametersHint: "Off sends no custom parameters and uses native reasoning defaults. Saved values and the 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
15
|
modules: "Configuration sections", scope: "Configuration scope", loading: "Loading configuration…", unset: "Use default configuration",
|
|
16
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: "Global permission rules",
|
|
20
|
+
rootRules: "Global permission rules", 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
23
|
unsetGroup: "Use defaults for this group", unitBytes: "bytes", unitChars: "characters",
|
|
@@ -44,22 +44,22 @@ export const deploymentEn = {
|
|
|
44
44
|
export const deploymentZh = {
|
|
45
45
|
title: "DSMM", summary: "全局配置与当前配置覆盖",
|
|
46
46
|
description: "两层独立保存,不改原生模型或运行中会话。",
|
|
47
|
-
global: "DSMM 全局配置", globalHint: "同一 Home
|
|
48
|
-
profile: "当前 DSH 配置覆盖", profileHint: "
|
|
47
|
+
global: "DSMM 全局配置", globalHint: "同一 Home 共用;未设置字段使用内建默认值。",
|
|
48
|
+
profile: "当前 DSH 配置覆盖", profileHint: "仅影响此配置。未设置字段依次使用全局与宿主默认值。",
|
|
49
49
|
profileUnavailable: "不可用",
|
|
50
|
-
unavailableForm: "
|
|
50
|
+
unavailableForm: "此配置只读;重连并刷新以检查编辑权限。",
|
|
51
51
|
ceiling: "Deepwork 总开关仅全局可改;配置和会话模式不能突破已捕获上限。",
|
|
52
52
|
hostUnknown: "宿主整包状态:未知(独立开关)。",
|
|
53
|
-
boundaries: "
|
|
53
|
+
boundaries: "保存的设置供新会话使用;需重启的更改须另行重启宿主,可能取消会话。",
|
|
54
54
|
core: "Core 核心配置", coreHint: "Core 所有的 desired 意图配置。模型参数透传为普通配置,非子插件;权限控制 enabled 仅启动时捕获。保存不改变当前会话准入;下方可检查意图、启动与准入值,不可用的准入仍为未知。",
|
|
55
|
-
modelParametersHint: "
|
|
55
|
+
modelParametersHint: "关闭后不发送自定义参数,改用原生推理默认值;已保存值与所选模型不变。",
|
|
56
56
|
permissionControlHint: "权限控制挂载仅启动时捕获。保存配置不证明运行时覆盖,也不移除当前保护;Root 规则在权限模块内保持独立权限。",
|
|
57
57
|
modules: "配置分区", scope: "配置范围", loading: "正在加载配置…", unset: "使用默认配置",
|
|
58
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: "全局权限规则",
|
|
62
|
+
rootRules: "全局权限规则", rootRulesUnavailable: "权限规则不可用,请重连后刷新。",
|
|
63
63
|
nativeRuntimeHint: "原生默认开启,Host base 固定值仍适用;挂载仅启动时捕获。保存只设置 desired,不会启动/停止提供商或取消当前会话;独立 Host 重启可能取消会话。",
|
|
64
64
|
nativeRuntimeReadinessHint: "任务进度可在会话中查看。",
|
|
65
65
|
unsetGroup: "整组使用默认配置", unitBytes: "字节", unitChars: "字符",
|
|
@@ -50,7 +50,7 @@ export class PermissionController {
|
|
|
50
50
|
this.connection = generation;
|
|
51
51
|
this.fence(true);
|
|
52
52
|
this.publish({ connected: invoke !== null });
|
|
53
|
-
this.schedule(
|
|
53
|
+
this.schedule();
|
|
54
54
|
}
|
|
55
55
|
bindScope(sessionId, owner, scope) {
|
|
56
56
|
if (this.disposed || this.state.sessionId === sessionId && this.owner === owner && this.state.scope === scope)
|
|
@@ -61,12 +61,12 @@ export class PermissionController {
|
|
|
61
61
|
// only the draft and the read-only display projection may survive for explicit recovery.
|
|
62
62
|
this.fence(sameSession, false, sameSession);
|
|
63
63
|
this.publish({ sessionId, scope });
|
|
64
|
-
this.schedule(
|
|
64
|
+
this.schedule();
|
|
65
65
|
}
|
|
66
66
|
watch() {
|
|
67
67
|
this.watchers++;
|
|
68
68
|
if (this.watchers === 1)
|
|
69
|
-
this.schedule(
|
|
69
|
+
this.schedule();
|
|
70
70
|
let active = true;
|
|
71
71
|
return () => { if (!active)
|
|
72
72
|
return; active = false; this.watchers--; if (this.watchers === 0)
|
|
@@ -75,11 +75,11 @@ export class PermissionController {
|
|
|
75
75
|
dispose() { if (this.disposed)
|
|
76
76
|
return; this.fence(false, false, false); this.disposed = true; this.listeners.clear(); this.invoke = null; this.owner = null; }
|
|
77
77
|
live(generation) { return !this.disposed && generation === this.state.generation && this.owner !== null && this.invoke !== null && this.state.scope === "root" && this.state.sessionId !== null; }
|
|
78
|
-
schedule(
|
|
78
|
+
schedule() {
|
|
79
79
|
clearTimeout(this.timer);
|
|
80
80
|
if (this.watchers === 0 || !this.live(this.state.generation))
|
|
81
81
|
return;
|
|
82
|
-
this.timer = setTimeout(() => { void this.revalidate(this.state.generation); },
|
|
82
|
+
this.timer = setTimeout(() => { void this.revalidate(this.state.generation); }, 0);
|
|
83
83
|
this.timer.unref?.();
|
|
84
84
|
}
|
|
85
85
|
issue(error) { return error instanceof PermissionClientError ? error.code : "transport"; }
|
|
@@ -125,7 +125,6 @@ export class PermissionController {
|
|
|
125
125
|
if (this.live(generation) && sequence === this.requestSequence)
|
|
126
126
|
this.publish({ reading: false, revalidating: false });
|
|
127
127
|
}
|
|
128
|
-
this.schedule();
|
|
129
128
|
}
|
|
130
129
|
edit(generation, patch) {
|
|
131
130
|
if (!this.canEdit(generation) || this.state.draft === null)
|
|
@@ -172,10 +171,8 @@ export class PermissionController {
|
|
|
172
171
|
this.publish({ rulesIssue: this.issue(error) });
|
|
173
172
|
}
|
|
174
173
|
finally {
|
|
175
|
-
if (this.live(generation))
|
|
174
|
+
if (this.live(generation))
|
|
176
175
|
this.publish({ busy: null });
|
|
177
|
-
this.schedule();
|
|
178
|
-
}
|
|
179
176
|
}
|
|
180
177
|
}
|
|
181
178
|
}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
export const PERMISSIONS_NS = "settings.dsmm-permissions";
|
|
2
2
|
export const permissionEn = {
|
|
3
|
-
title: "Permission control", rules: "
|
|
4
|
-
nativeApproval: "Approve commands in the native prompt
|
|
5
|
-
sandboxScope: "These rules
|
|
3
|
+
title: "Permission control", rules: "Rules",
|
|
4
|
+
nativeApproval: "Approve commands in the native prompt; Allow covers that call only.",
|
|
5
|
+
sandboxScope: "These rules set allow, ask or deny. The Host sandbox and its native prompt still decide what an approved call may touch.",
|
|
6
6
|
unconfirmedObservation: "Showing the last successful observation. The current selection is not confirmed yet, so editing and saving stay unavailable.",
|
|
7
7
|
root: "Selected main session", noRoot: "Select a main session to view its permission rules.",
|
|
8
8
|
child: "Select this child’s main session to edit Global rules.",
|
|
@@ -12,33 +12,32 @@ export const permissionEn = {
|
|
|
12
12
|
inherit: "Inherit native policy", "action:allow": "Allow", "action:ask": "Ask", "action:deny": "Deny",
|
|
13
13
|
"kind:outside-read": "Outside-workspace read", "kind:shell": "Shell operation", "kind:webSearch": "Web search", "kind:webFetch": "Web fetch",
|
|
14
14
|
path: "Canonical path", pathScope: "Path match", exact: "Exact path", tree: "Path and descendants",
|
|
15
|
-
networkLimit: "Web rules cover public web tools only
|
|
16
|
-
rulesHint: "
|
|
17
|
-
configPolicyHint: "Profile settings override Global
|
|
18
|
-
configRulesHint: "Record list for this
|
|
19
|
-
coldHint: "
|
|
15
|
+
networkLimit: "Web rules cover public web tools only; private networks, shell and sockets are outside this permission.",
|
|
16
|
+
rulesHint: "Global policy, saved separately from configuration. Clear blocking profile overrides, then refresh.",
|
|
17
|
+
configPolicyHint: "Profile settings override Global; arrays replace inherited lists. Refresh to check what is effective.",
|
|
18
|
+
configRulesHint: "Record list for this layer. The Host owns source and revision; imported records are never verified approvals. An empty list is an explicit empty replacement.",
|
|
19
|
+
coldHint: "Host restart required; current protection stays active. Restart may cancel sessions.",
|
|
20
20
|
guardScope: "Guard scope", shellSafety: "Shell command safety", gitWrite: "Git write approval", toolOutputTruncation: "Tool output truncation", planValidation: "Plan format validation", questionLabels: "Question label helper", todoDiscipline: "Todo discipline helper", maxInlineBytes: "Maximum inline output", maxLabelChars: "Maximum label length", unitBytes: "bytes", unitChars: "characters",
|
|
21
|
-
nativeCommands: "Command rules", nativeCommandsHint: "Default Off.
|
|
22
|
-
registrationUnresolved: "Executor identity
|
|
23
|
-
entryId: "Entry ID", tool: "Tool", sandboxMode: "Sandbox mode", mode: "Native action", addEntry: "Add entry", removeEntry: "Remove entry", noEntries: "No command entries.", unset: "Unset — restore inheritance", inheritedEntries: "Inherited entries; editing pins a replacement array in this layer.", explicitEntries: "Explicit replacement array in this layer.", invalidEntry: "Invalid entry:
|
|
21
|
+
nativeCommands: "Command rules", nativeCommandsHint: "Default Off. New entries use Ask and workspace-write; other permission limits still apply.",
|
|
22
|
+
registrationUnresolved: "Executor identity unconfirmed; verify tool, executable, environment and sandbox.",
|
|
23
|
+
entryId: "Entry ID", tool: "Tool", sandboxMode: "Sandbox mode", mode: "Native action", addEntry: "Add entry", removeEntry: "Remove entry", noEntries: "No command entries.", unset: "Unset — restore inheritance", inheritedEntries: "Inherited entries; editing pins a replacement array in this layer.", explicitEntries: "Explicit replacement array in this layer.", invalidEntry: "Invalid entry: IDs must be unique and nonblank, pattern valid, working directory absolute. Draft retained; Save locked.",
|
|
24
24
|
pattern: "Command pattern",
|
|
25
|
-
patternHint: "
|
|
26
|
-
invalidPattern: "Invalid pattern:
|
|
27
|
-
patternScope: "Any trailing arguments are allowed, so the selected program can run its own builds, tests and internal scripts. This is not a path or filesystem grant, and shell pipes, chaining, redirects and substitutions still follow the ordinary native path.",
|
|
25
|
+
patternHint: "Example: go build|test *. With or without *, any trailing arguments (including program scripts) are allowed. No character glob, regex or path grants.",
|
|
26
|
+
invalidPattern: "Invalid pattern: one executable and the subcommand position only, space-separated. Pipe alternatives must be nonblank literals; * may only be the final token.",
|
|
28
27
|
restrictedFullAccess: "danger-full-access — retained from the saved value; not offered here",
|
|
29
|
-
rulesUnavailable: "Editing requires an open main session, local editing permission and
|
|
28
|
+
rulesUnavailable: "Editing requires an open main session, local editing permission and synced rules. Check profile overrides, then reconnect and refresh.",
|
|
30
29
|
configRules: "Imported configuration rules", inheritedRules: "Inherited records; editing pins a replacement list in this layer.", explicitRules: "Explicit replacement list in this layer.",
|
|
31
30
|
configRulesEmpty: "This layer stores no permission rules.", addRule: "Add imported rule", removeRule: "Remove rule", advancedRules: "Advanced rule JSON",
|
|
32
|
-
invalidRule: "Invalid rule list:
|
|
31
|
+
invalidRule: "Invalid rule list: IDs must be unique and nonblank, actions allow/ask/deny, and matches complete. Draft retained; Save locked.",
|
|
33
32
|
recordedOperator: "Recorded operator source (metadata, not approval)",
|
|
34
|
-
invalidPatternHint: "
|
|
33
|
+
invalidPatternHint: "Fix invalid patterns before saving. Removing a row drops only its draft; Unset replaces the whole array with the inherited list.",
|
|
35
34
|
observedPolicy: "Effective policy (including profile overrides)",
|
|
36
|
-
profileOverrideState: "Profile overrides", profileOverrideUnknown: "Unknown
|
|
37
|
-
matchHint: "Match an exact path or
|
|
35
|
+
profileOverrideState: "Profile overrides", profileOverrideUnknown: "Unknown — select the DSH profile scope to inspect.",
|
|
36
|
+
matchHint: "Match an exact path or tree, an exact shell tool/command/directory, or a web tool. Allow grants no outside-workspace writes.",
|
|
38
37
|
source: "Actual source", recordVersion: "Record version", savedAt: "Saved at", operator: "Verified Host operator", imported: "User import", active: "Active record", revoked: "Revoked record",
|
|
39
38
|
base: "Draft version", savedRevision: "Saved version", runtimeRevision: "Effective version", runtime: "Rule synchronization", synced: "Synced", updating: "Updating", unsynced: "Unsynced — saving unavailable",
|
|
40
39
|
mounted: "Startup mounted", on: "On", off: "Off", restart: "Independent restart required",
|
|
41
|
-
coverageTitle: "Tool coverage", coverageDetails: "Details", coverage: "Last
|
|
40
|
+
coverageTitle: "Tool coverage", coverageDetails: "Details", coverage: "Last observation for this main session; executor readiness and network access need separate checks.",
|
|
42
41
|
coverageUnavailable: "Coverage unavailable / unknown. No trusted live observation was returned.", coverageEmpty: "No trusted tool registrations observed for this Root.",
|
|
43
42
|
coverageRuntime: "Observed consumer state", coverageRevision: "Observed consumer runtime source", toolName: "Observed tool name", toolKind: "Trusted registration kind",
|
|
44
43
|
toolApproval: "Approval boundary", nativeOnce: "Native prompt — once only", toolMemory: "Scoped approval memory", notProvided: "Not provided",
|
|
@@ -62,9 +61,9 @@ export const permissionEn = {
|
|
|
62
61
|
"issue:protocol": "Untrusted or mismatched service response. Refresh or reconnect.",
|
|
63
62
|
};
|
|
64
63
|
export const permissionZh = {
|
|
65
|
-
title: "权限控制", rules: "
|
|
64
|
+
title: "权限控制", rules: "规则",
|
|
66
65
|
nativeApproval: "请在原生提示中批准命令;「允许」仅批准本次调用。",
|
|
67
|
-
sandboxScope: "
|
|
66
|
+
sandboxScope: "这些规则决定允许、询问或拒绝;具体调用可触及的范围仍由宿主沙箱及其原生提示决定。",
|
|
68
67
|
unconfirmedObservation: "当前显示上次成功观测;当前选择尚未确认,编辑与保存暂不可用。",
|
|
69
68
|
root: "所选主会话", noRoot: "请选择主会话以查看权限规则。", child: "请切换到此子会话的主会话后编辑全局规则。",
|
|
70
69
|
unknown: "不可用/未知", reading: "正在读取…", busy: "操作处理中…",
|
|
@@ -73,29 +72,28 @@ export const permissionZh = {
|
|
|
73
72
|
inherit: "继承原生策略", "action:allow": "允许", "action:ask": "询问", "action:deny": "拒绝",
|
|
74
73
|
"kind:outside-read": "工作区外读取", "kind:shell": "Shell 操作", "kind:webSearch": "网页搜索", "kind:webFetch": "网页抓取",
|
|
75
74
|
path: "规范路径", pathScope: "路径匹配", exact: "精确路径", tree: "此路径及子树",
|
|
76
|
-
networkLimit: "
|
|
77
|
-
rulesHint: "
|
|
78
|
-
configPolicyHint: "
|
|
79
|
-
configRulesHint: "
|
|
75
|
+
networkLimit: "网页规则仅覆盖公共网页工具;私网、Shell 与 socket 不在此权限内。",
|
|
76
|
+
rulesHint: "全局策略,与配置分别保存。若配置覆盖阻止保存,请先清除覆盖再刷新。",
|
|
77
|
+
configPolicyHint: "当前配置优先于全局,数组整体替换继承列表。保存后刷新以检查实际生效状态。",
|
|
78
|
+
configRulesHint: "此配置层的记录列表。来源与版本由宿主维护;导入记录永不代表已核验批准。空列表表示显式清空。",
|
|
80
79
|
coldHint: "更改此开关需重启宿主,此前保留当前保护。重启可能取消会话。",
|
|
81
80
|
guardScope: "保护范围", shellSafety: "Shell 命令安全", gitWrite: "Git 写入审批", toolOutputTruncation: "工具输出截断", planValidation: "计划格式校验", questionLabels: "问题标签辅助", todoDiscipline: "Todo 纪律辅助", maxInlineBytes: "内联输出上限", maxLabelChars: "标签长度上限", unitBytes: "字节", unitChars: "字符",
|
|
82
|
-
nativeCommands: "命令规则", nativeCommandsHint: "
|
|
83
|
-
registrationUnresolved: "
|
|
84
|
-
entryId: "条目 ID", tool: "工具", sandboxMode: "沙箱模式", mode: "原生动作", addEntry: "添加条目", removeEntry: "移除条目", noEntries: "没有命令条目。", unset: "Unset——恢复继承", inheritedEntries: "继承的条目;编辑后在此层固定为整体替换数组。", explicitEntries: "此层显式整体替换数组。", invalidEntry: "条目无效:ID
|
|
81
|
+
nativeCommands: "命令规则", nativeCommandsHint: "默认关闭;新条目使用询问与 workspace-write,仍受其他权限限制。",
|
|
82
|
+
registrationUnresolved: "执行器身份未确认;请先核验工具、可执行程序、环境与沙箱。",
|
|
83
|
+
entryId: "条目 ID", tool: "工具", sandboxMode: "沙箱模式", mode: "原生动作", addEntry: "添加条目", removeEntry: "移除条目", noEntries: "没有命令条目。", unset: "Unset——恢复继承", inheritedEntries: "继承的条目;编辑后在此层固定为整体替换数组。", explicitEntries: "此层显式整体替换数组。", invalidEntry: "条目无效:ID 需唯一非空、模式有效、工作目录为绝对路径。草稿保留,保存已锁定。",
|
|
85
84
|
pattern: "命令模式",
|
|
86
|
-
patternHint: "
|
|
87
|
-
invalidPattern: "
|
|
88
|
-
patternScope: "允许任意后续参数,因此被选程序可以运行自身的构建、测试和内部脚本。这不是路径或文件系统授权;shell 管道、拼接、重定向与替换仍走普通原生路径。",
|
|
85
|
+
patternHint: "例:go build|test *。省略 * 也允许任意后续参数(含程序脚本);不支持字符通配或正则,也不授予路径权限。",
|
|
86
|
+
invalidPattern: "模式无效:仅一个可执行程序与子命令位置,以空格分隔。竖线备选须为非空字面量,* 只能是最后一个 token。",
|
|
89
87
|
restrictedFullAccess: "danger-full-access——保留自已保存的值,此处不提供创建",
|
|
90
|
-
rulesUnavailable: "
|
|
88
|
+
rulesUnavailable: "编辑需要已打开的主会话、本地编辑权限与已同步规则。请检查配置覆盖,再重连刷新。",
|
|
91
89
|
configRules: "导入的配置规则", inheritedRules: "继承的记录;编辑后在此层固定为整体替换列表。", explicitRules: "此层显式整体替换列表。",
|
|
92
90
|
configRulesEmpty: "此层没有权限规则记录。", addRule: "添加导入规则", removeRule: "移除规则", advancedRules: "高级规则 JSON",
|
|
93
|
-
invalidRule: "规则列表无效:ID
|
|
91
|
+
invalidRule: "规则列表无效:ID 需唯一非空,动作为 allow/ask/deny,匹配条件完整。草稿保留,保存已锁定。",
|
|
94
92
|
recordedOperator: "记录的 operator 来源(元数据,不代表批准)",
|
|
95
|
-
invalidPatternHint: "
|
|
93
|
+
invalidPatternHint: "请先修正无效模式。移除某行只丢弃该行草稿;Unset 用继承列表整体替换。",
|
|
96
94
|
observedPolicy: "有效策略(含当前配置覆盖)",
|
|
97
95
|
profileOverrideState: "配置覆盖", profileOverrideUnknown: "未知,请在上方选择当前 DSH 配置查看覆盖值。",
|
|
98
|
-
matchHint: "可匹配精确路径或目录树、精确 Shell
|
|
96
|
+
matchHint: "可匹配精确路径或目录树、精确 Shell 工具与命令及目录,或网页工具。允许不授予工作区外写入。",
|
|
99
97
|
source: "实际来源", recordVersion: "记录版本", savedAt: "保存时间", operator: "宿主已核验 operator", imported: "用户导入", active: "有效记录", revoked: "已撤销记录",
|
|
100
98
|
base: "草稿版本", savedRevision: "保存版本", runtimeRevision: "生效版本", runtime: "规则同步", synced: "已同步", updating: "同步中", unsynced: "未同步——暂不可保存",
|
|
101
99
|
mounted: "启动时已挂载", on: "开启", off: "关闭", restart: "需要另行重启",
|
package/lib/client/styles.d.ts
CHANGED
|
@@ -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 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";
|
|
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 .dsmm-deployment-group>summary.dsmm-group-summary-row{display:flex;align-items:center;gap:8px;list-style:none}\n.dsmm-deployment .dsmm-deployment-group>summary.dsmm-group-summary-row::-webkit-details-marker{display:none}\n.dsmm-deployment .dsmm-deployment-group>summary.dsmm-group-summary-row::before{content:\"\u25B6\";flex:0 0 auto;width:12px;text-align:center;color:var(--dsw-alias-label-secondary)}\n.dsmm-deployment .dsmm-deployment-group[open]>summary.dsmm-group-summary-row::before{content:\"\u25BC\"}\n.dsmm-deployment summary .dsmm-group-summary{display:flex;align-items:center;gap:8px;min-width:0;flex:1 1 auto}\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
|
package/lib/client/styles.js
CHANGED
|
@@ -65,7 +65,11 @@ 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
|
|
68
|
+
.dsmm-deployment .dsmm-deployment-group>summary.dsmm-group-summary-row{display:flex;align-items:center;gap:8px;list-style:none}
|
|
69
|
+
.dsmm-deployment .dsmm-deployment-group>summary.dsmm-group-summary-row::-webkit-details-marker{display:none}
|
|
70
|
+
.dsmm-deployment .dsmm-deployment-group>summary.dsmm-group-summary-row::before{content:"▶";flex:0 0 auto;width:12px;text-align:center;color:var(--dsw-alias-label-secondary)}
|
|
71
|
+
.dsmm-deployment .dsmm-deployment-group[open]>summary.dsmm-group-summary-row::before{content:"▼"}
|
|
72
|
+
.dsmm-deployment summary .dsmm-group-summary{display:flex;align-items:center;gap:8px;min-width:0;flex:1 1 auto}
|
|
69
73
|
.dsmm-deployment .dsmm-group-summary-label{flex:1 1 auto;min-width:0;overflow-wrap:anywhere}
|
|
70
74
|
.dsmm-deployment .dsmm-group-summary-action{flex:0 0 auto;min-height:28px;height:28px;padding:0 8px}
|
|
71
75
|
.dsmm-deployment .dsmm-group-summary-action[hidden]{display:none}
|
package/lib/client.js
CHANGED
|
@@ -5465,7 +5465,11 @@ var PROFILE_STYLES = `
|
|
|
5465
5465
|
.dsmm-scope-save{display:flex;flex-direction:column;gap:8px;padding-top:16px;border-top:1px solid var(--dsw-alias-border-l4)}
|
|
5466
5466
|
.dsmm-deployment .dsmm-deployment-group{border-top:1px solid var(--dsw-alias-border-l4);padding-top:8px;min-width:0}
|
|
5467
5467
|
.dsmm-deployment .dsmm-deployment-group>div{display:flex;flex-direction:column;gap:8px;padding-top:8px}
|
|
5468
|
-
.dsmm-deployment summary
|
|
5468
|
+
.dsmm-deployment .dsmm-deployment-group>summary.dsmm-group-summary-row{display:flex;align-items:center;gap:8px;list-style:none}
|
|
5469
|
+
.dsmm-deployment .dsmm-deployment-group>summary.dsmm-group-summary-row::-webkit-details-marker{display:none}
|
|
5470
|
+
.dsmm-deployment .dsmm-deployment-group>summary.dsmm-group-summary-row::before{content:"▶";flex:0 0 auto;width:12px;text-align:center;color:var(--dsw-alias-label-secondary)}
|
|
5471
|
+
.dsmm-deployment .dsmm-deployment-group[open]>summary.dsmm-group-summary-row::before{content:"▼"}
|
|
5472
|
+
.dsmm-deployment summary .dsmm-group-summary{display:flex;align-items:center;gap:8px;min-width:0;flex:1 1 auto}
|
|
5469
5473
|
.dsmm-deployment .dsmm-group-summary-label{flex:1 1 auto;min-width:0;overflow-wrap:anywhere}
|
|
5470
5474
|
.dsmm-deployment .dsmm-group-summary-action{flex:0 0 auto;min-height:28px;height:28px;padding:0 8px}
|
|
5471
5475
|
.dsmm-deployment .dsmm-group-summary-action[hidden]{display:none}
|
|
@@ -6008,17 +6012,17 @@ var deploymentEn = {
|
|
|
6008
6012
|
summary: "Global config and profile overrides",
|
|
6009
6013
|
description: "Layers save independently; native models and running sessions stay unchanged.",
|
|
6010
6014
|
global: "DSMM Global config",
|
|
6011
|
-
globalHint: "Shared by this Home
|
|
6015
|
+
globalHint: "Shared by this Home. Unset fields use built-in defaults.",
|
|
6012
6016
|
profile: "Current DSH profile overrides",
|
|
6013
|
-
profileHint: "This
|
|
6017
|
+
profileHint: "This profile only. Unset fields use Global, then Host defaults.",
|
|
6014
6018
|
profileUnavailable: "Unavailable",
|
|
6015
|
-
unavailableForm: "
|
|
6019
|
+
unavailableForm: "Read-only profile. Reconnect and refresh to check editing access.",
|
|
6016
6020
|
ceiling: "Deepwork master is Global-only; profiles and session modes cannot lift its captured ceiling.",
|
|
6017
6021
|
hostUnknown: "Host bundle status: unknown (separate switch).",
|
|
6018
|
-
boundaries: "Saved settings apply to new sessions
|
|
6022
|
+
boundaries: "Saved settings apply to new sessions; restart-required changes need a separate Host restart that may cancel sessions.",
|
|
6019
6023
|
core: "Core",
|
|
6020
6024
|
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.",
|
|
6021
|
-
modelParametersHint: "Off
|
|
6025
|
+
modelParametersHint: "Off sends no custom parameters and uses native reasoning defaults. Saved values and the selected model stay unchanged.",
|
|
6022
6026
|
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.",
|
|
6023
6027
|
modules: "Configuration sections",
|
|
6024
6028
|
scope: "Configuration scope",
|
|
@@ -6040,7 +6044,6 @@ var deploymentEn = {
|
|
|
6040
6044
|
keepDraft: "Keep draft and return",
|
|
6041
6045
|
discardDraft: "Discard draft and leave",
|
|
6042
6046
|
rootRules: "Global permission rules",
|
|
6043
|
-
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.",
|
|
6044
6047
|
rootRulesUnavailable: "Permission rules unavailable. Reconnect and refresh.",
|
|
6045
6048
|
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.",
|
|
6046
6049
|
nativeRuntimeReadinessHint: "Task progress is available in the session.",
|
|
@@ -6110,17 +6113,17 @@ var deploymentZh = {
|
|
|
6110
6113
|
summary: "全局配置与当前配置覆盖",
|
|
6111
6114
|
description: "两层独立保存,不改原生模型或运行中会话。",
|
|
6112
6115
|
global: "DSMM 全局配置",
|
|
6113
|
-
globalHint: "同一 Home
|
|
6116
|
+
globalHint: "同一 Home 共用;未设置字段使用内建默认值。",
|
|
6114
6117
|
profile: "当前 DSH 配置覆盖",
|
|
6115
|
-
profileHint: "
|
|
6118
|
+
profileHint: "仅影响此配置。未设置字段依次使用全局与宿主默认值。",
|
|
6116
6119
|
profileUnavailable: "不可用",
|
|
6117
|
-
unavailableForm: "
|
|
6120
|
+
unavailableForm: "此配置只读;重连并刷新以检查编辑权限。",
|
|
6118
6121
|
ceiling: "Deepwork 总开关仅全局可改;配置和会话模式不能突破已捕获上限。",
|
|
6119
6122
|
hostUnknown: "宿主整包状态:未知(独立开关)。",
|
|
6120
|
-
boundaries: "
|
|
6123
|
+
boundaries: "保存的设置供新会话使用;需重启的更改须另行重启宿主,可能取消会话。",
|
|
6121
6124
|
core: "Core 核心配置",
|
|
6122
6125
|
coreHint: "Core 所有的 desired 意图配置。模型参数透传为普通配置,非子插件;权限控制 enabled 仅启动时捕获。保存不改变当前会话准入;下方可检查意图、启动与准入值,不可用的准入仍为未知。",
|
|
6123
|
-
modelParametersHint: "
|
|
6126
|
+
modelParametersHint: "关闭后不发送自定义参数,改用原生推理默认值;已保存值与所选模型不变。",
|
|
6124
6127
|
permissionControlHint: "权限控制挂载仅启动时捕获。保存配置不证明运行时覆盖,也不移除当前保护;Root 规则在权限模块内保持独立权限。",
|
|
6125
6128
|
modules: "配置分区",
|
|
6126
6129
|
scope: "配置范围",
|
|
@@ -6142,7 +6145,6 @@ var deploymentZh = {
|
|
|
6142
6145
|
keepDraft: "保留草稿并返回",
|
|
6143
6146
|
discardDraft: "放弃草稿并离开",
|
|
6144
6147
|
rootRules: "全局权限规则",
|
|
6145
|
-
rootRulesHint: "请选择已打开且有编辑权限的主会话作为全局规则的编辑入口。保存的规则写入全局策略,对所有使用该策略的上下文生效,并非会话私有。此事务与配置分别保存。",
|
|
6146
6148
|
rootRulesUnavailable: "权限规则不可用,请重连后刷新。",
|
|
6147
6149
|
nativeRuntimeHint: "原生默认开启,Host base 固定值仍适用;挂载仅启动时捕获。保存只设置 desired,不会启动/停止提供商或取消当前会话;独立 Host 重启可能取消会话。",
|
|
6148
6150
|
nativeRuntimeReadinessHint: "任务进度可在会话中查看。",
|
|
@@ -6274,9 +6276,9 @@ var deploymentFieldLabels = {
|
|
|
6274
6276
|
var PERMISSIONS_NS = "settings.dsmm-permissions";
|
|
6275
6277
|
var permissionEn = {
|
|
6276
6278
|
title: "Permission control",
|
|
6277
|
-
rules: "
|
|
6278
|
-
nativeApproval: "Approve commands in the native prompt
|
|
6279
|
-
sandboxScope: "These rules
|
|
6279
|
+
rules: "Rules",
|
|
6280
|
+
nativeApproval: "Approve commands in the native prompt; Allow covers that call only.",
|
|
6281
|
+
sandboxScope: "These rules set allow, ask or deny. The Host sandbox and its native prompt still decide what an approved call may touch.",
|
|
6280
6282
|
unconfirmedObservation: "Showing the last successful observation. The current selection is not confirmed yet, so editing and saving stay unavailable.",
|
|
6281
6283
|
root: "Selected main session",
|
|
6282
6284
|
noRoot: "Select a main session to view its permission rules.",
|
|
@@ -6307,11 +6309,11 @@ var permissionEn = {
|
|
|
6307
6309
|
pathScope: "Path match",
|
|
6308
6310
|
exact: "Exact path",
|
|
6309
6311
|
tree: "Path and descendants",
|
|
6310
|
-
networkLimit: "Web rules cover public web tools only
|
|
6311
|
-
rulesHint: "
|
|
6312
|
-
configPolicyHint: "Profile settings override Global
|
|
6313
|
-
configRulesHint: "Record list for this
|
|
6314
|
-
coldHint: "
|
|
6312
|
+
networkLimit: "Web rules cover public web tools only; private networks, shell and sockets are outside this permission.",
|
|
6313
|
+
rulesHint: "Global policy, saved separately from configuration. Clear blocking profile overrides, then refresh.",
|
|
6314
|
+
configPolicyHint: "Profile settings override Global; arrays replace inherited lists. Refresh to check what is effective.",
|
|
6315
|
+
configRulesHint: "Record list for this layer. The Host owns source and revision; imported records are never verified approvals. An empty list is an explicit empty replacement.",
|
|
6316
|
+
coldHint: "Host restart required; current protection stays active. Restart may cancel sessions.",
|
|
6315
6317
|
guardScope: "Guard scope",
|
|
6316
6318
|
shellSafety: "Shell command safety",
|
|
6317
6319
|
gitWrite: "Git write approval",
|
|
@@ -6324,8 +6326,8 @@ var permissionEn = {
|
|
|
6324
6326
|
unitBytes: "bytes",
|
|
6325
6327
|
unitChars: "characters",
|
|
6326
6328
|
nativeCommands: "Command rules",
|
|
6327
|
-
nativeCommandsHint: "Default Off.
|
|
6328
|
-
registrationUnresolved: "Executor identity
|
|
6329
|
+
nativeCommandsHint: "Default Off. New entries use Ask and workspace-write; other permission limits still apply.",
|
|
6330
|
+
registrationUnresolved: "Executor identity unconfirmed; verify tool, executable, environment and sandbox.",
|
|
6329
6331
|
entryId: "Entry ID",
|
|
6330
6332
|
tool: "Tool",
|
|
6331
6333
|
sandboxMode: "Sandbox mode",
|
|
@@ -6336,13 +6338,12 @@ var permissionEn = {
|
|
|
6336
6338
|
unset: "Unset — restore inheritance",
|
|
6337
6339
|
inheritedEntries: "Inherited entries; editing pins a replacement array in this layer.",
|
|
6338
6340
|
explicitEntries: "Explicit replacement array in this layer.",
|
|
6339
|
-
invalidEntry: "Invalid entry:
|
|
6341
|
+
invalidEntry: "Invalid entry: IDs must be unique and nonblank, pattern valid, working directory absolute. Draft retained; Save locked.",
|
|
6340
6342
|
pattern: "Command pattern",
|
|
6341
|
-
patternHint: "
|
|
6342
|
-
invalidPattern: "Invalid pattern:
|
|
6343
|
-
patternScope: "Any trailing arguments are allowed, so the selected program can run its own builds, tests and internal scripts. This is not a path or filesystem grant, and shell pipes, chaining, redirects and substitutions still follow the ordinary native path.",
|
|
6343
|
+
patternHint: "Example: go build|test *. With or without *, any trailing arguments (including program scripts) are allowed. No character glob, regex or path grants.",
|
|
6344
|
+
invalidPattern: "Invalid pattern: one executable and the subcommand position only, space-separated. Pipe alternatives must be nonblank literals; * may only be the final token.",
|
|
6344
6345
|
restrictedFullAccess: "danger-full-access — retained from the saved value; not offered here",
|
|
6345
|
-
rulesUnavailable: "Editing requires an open main session, local editing permission and
|
|
6346
|
+
rulesUnavailable: "Editing requires an open main session, local editing permission and synced rules. Check profile overrides, then reconnect and refresh.",
|
|
6346
6347
|
configRules: "Imported configuration rules",
|
|
6347
6348
|
inheritedRules: "Inherited records; editing pins a replacement list in this layer.",
|
|
6348
6349
|
explicitRules: "Explicit replacement list in this layer.",
|
|
@@ -6350,13 +6351,13 @@ var permissionEn = {
|
|
|
6350
6351
|
addRule: "Add imported rule",
|
|
6351
6352
|
removeRule: "Remove rule",
|
|
6352
6353
|
advancedRules: "Advanced rule JSON",
|
|
6353
|
-
invalidRule: "Invalid rule list:
|
|
6354
|
+
invalidRule: "Invalid rule list: IDs must be unique and nonblank, actions allow/ask/deny, and matches complete. Draft retained; Save locked.",
|
|
6354
6355
|
recordedOperator: "Recorded operator source (metadata, not approval)",
|
|
6355
|
-
invalidPatternHint: "
|
|
6356
|
+
invalidPatternHint: "Fix invalid patterns before saving. Removing a row drops only its draft; Unset replaces the whole array with the inherited list.",
|
|
6356
6357
|
observedPolicy: "Effective policy (including profile overrides)",
|
|
6357
6358
|
profileOverrideState: "Profile overrides",
|
|
6358
|
-
profileOverrideUnknown: "Unknown
|
|
6359
|
-
matchHint: "Match an exact path or
|
|
6359
|
+
profileOverrideUnknown: "Unknown — select the DSH profile scope to inspect.",
|
|
6360
|
+
matchHint: "Match an exact path or tree, an exact shell tool/command/directory, or a web tool. Allow grants no outside-workspace writes.",
|
|
6360
6361
|
source: "Actual source",
|
|
6361
6362
|
recordVersion: "Record version",
|
|
6362
6363
|
savedAt: "Saved at",
|
|
@@ -6377,7 +6378,7 @@ var permissionEn = {
|
|
|
6377
6378
|
restart: "Independent restart required",
|
|
6378
6379
|
coverageTitle: "Tool coverage",
|
|
6379
6380
|
coverageDetails: "Details",
|
|
6380
|
-
coverage: "Last
|
|
6381
|
+
coverage: "Last observation for this main session; executor readiness and network access need separate checks.",
|
|
6381
6382
|
coverageUnavailable: "Coverage unavailable / unknown. No trusted live observation was returned.",
|
|
6382
6383
|
coverageEmpty: "No trusted tool registrations observed for this Root.",
|
|
6383
6384
|
coverageRuntime: "Observed consumer state",
|
|
@@ -6430,9 +6431,9 @@ var permissionEn = {
|
|
|
6430
6431
|
};
|
|
6431
6432
|
var permissionZh = {
|
|
6432
6433
|
title: "权限控制",
|
|
6433
|
-
rules: "
|
|
6434
|
+
rules: "规则",
|
|
6434
6435
|
nativeApproval: "请在原生提示中批准命令;「允许」仅批准本次调用。",
|
|
6435
|
-
sandboxScope: "
|
|
6436
|
+
sandboxScope: "这些规则决定允许、询问或拒绝;具体调用可触及的范围仍由宿主沙箱及其原生提示决定。",
|
|
6436
6437
|
unconfirmedObservation: "当前显示上次成功观测;当前选择尚未确认,编辑与保存暂不可用。",
|
|
6437
6438
|
root: "所选主会话",
|
|
6438
6439
|
noRoot: "请选择主会话以查看权限规则。",
|
|
@@ -6463,10 +6464,10 @@ var permissionZh = {
|
|
|
6463
6464
|
pathScope: "路径匹配",
|
|
6464
6465
|
exact: "精确路径",
|
|
6465
6466
|
tree: "此路径及子树",
|
|
6466
|
-
networkLimit: "
|
|
6467
|
-
rulesHint: "
|
|
6468
|
-
configPolicyHint: "
|
|
6469
|
-
configRulesHint: "
|
|
6467
|
+
networkLimit: "网页规则仅覆盖公共网页工具;私网、Shell 与 socket 不在此权限内。",
|
|
6468
|
+
rulesHint: "全局策略,与配置分别保存。若配置覆盖阻止保存,请先清除覆盖再刷新。",
|
|
6469
|
+
configPolicyHint: "当前配置优先于全局,数组整体替换继承列表。保存后刷新以检查实际生效状态。",
|
|
6470
|
+
configRulesHint: "此配置层的记录列表。来源与版本由宿主维护;导入记录永不代表已核验批准。空列表表示显式清空。",
|
|
6470
6471
|
coldHint: "更改此开关需重启宿主,此前保留当前保护。重启可能取消会话。",
|
|
6471
6472
|
guardScope: "保护范围",
|
|
6472
6473
|
shellSafety: "Shell 命令安全",
|
|
@@ -6480,8 +6481,8 @@ var permissionZh = {
|
|
|
6480
6481
|
unitBytes: "字节",
|
|
6481
6482
|
unitChars: "字符",
|
|
6482
6483
|
nativeCommands: "命令规则",
|
|
6483
|
-
nativeCommandsHint: "
|
|
6484
|
-
registrationUnresolved: "
|
|
6484
|
+
nativeCommandsHint: "默认关闭;新条目使用询问与 workspace-write,仍受其他权限限制。",
|
|
6485
|
+
registrationUnresolved: "执行器身份未确认;请先核验工具、可执行程序、环境与沙箱。",
|
|
6485
6486
|
entryId: "条目 ID",
|
|
6486
6487
|
tool: "工具",
|
|
6487
6488
|
sandboxMode: "沙箱模式",
|
|
@@ -6492,13 +6493,12 @@ var permissionZh = {
|
|
|
6492
6493
|
unset: "Unset——恢复继承",
|
|
6493
6494
|
inheritedEntries: "继承的条目;编辑后在此层固定为整体替换数组。",
|
|
6494
6495
|
explicitEntries: "此层显式整体替换数组。",
|
|
6495
|
-
invalidEntry: "条目无效:ID
|
|
6496
|
+
invalidEntry: "条目无效:ID 需唯一非空、模式有效、工作目录为绝对路径。草稿保留,保存已锁定。",
|
|
6496
6497
|
pattern: "命令模式",
|
|
6497
|
-
patternHint: "
|
|
6498
|
-
invalidPattern: "
|
|
6499
|
-
patternScope: "允许任意后续参数,因此被选程序可以运行自身的构建、测试和内部脚本。这不是路径或文件系统授权;shell 管道、拼接、重定向与替换仍走普通原生路径。",
|
|
6498
|
+
patternHint: "例:go build|test *。省略 * 也允许任意后续参数(含程序脚本);不支持字符通配或正则,也不授予路径权限。",
|
|
6499
|
+
invalidPattern: "模式无效:仅一个可执行程序与子命令位置,以空格分隔。竖线备选须为非空字面量,* 只能是最后一个 token。",
|
|
6500
6500
|
restrictedFullAccess: "danger-full-access——保留自已保存的值,此处不提供创建",
|
|
6501
|
-
rulesUnavailable: "
|
|
6501
|
+
rulesUnavailable: "编辑需要已打开的主会话、本地编辑权限与已同步规则。请检查配置覆盖,再重连刷新。",
|
|
6502
6502
|
configRules: "导入的配置规则",
|
|
6503
6503
|
inheritedRules: "继承的记录;编辑后在此层固定为整体替换列表。",
|
|
6504
6504
|
explicitRules: "此层显式整体替换列表。",
|
|
@@ -6506,13 +6506,13 @@ var permissionZh = {
|
|
|
6506
6506
|
addRule: "添加导入规则",
|
|
6507
6507
|
removeRule: "移除规则",
|
|
6508
6508
|
advancedRules: "高级规则 JSON",
|
|
6509
|
-
invalidRule: "规则列表无效:ID
|
|
6509
|
+
invalidRule: "规则列表无效:ID 需唯一非空,动作为 allow/ask/deny,匹配条件完整。草稿保留,保存已锁定。",
|
|
6510
6510
|
recordedOperator: "记录的 operator 来源(元数据,不代表批准)",
|
|
6511
|
-
invalidPatternHint: "
|
|
6511
|
+
invalidPatternHint: "请先修正无效模式。移除某行只丢弃该行草稿;Unset 用继承列表整体替换。",
|
|
6512
6512
|
observedPolicy: "有效策略(含当前配置覆盖)",
|
|
6513
6513
|
profileOverrideState: "配置覆盖",
|
|
6514
6514
|
profileOverrideUnknown: "未知,请在上方选择当前 DSH 配置查看覆盖值。",
|
|
6515
|
-
matchHint: "可匹配精确路径或目录树、精确 Shell
|
|
6515
|
+
matchHint: "可匹配精确路径或目录树、精确 Shell 工具与命令及目录,或网页工具。允许不授予工作区外写入。",
|
|
6516
6516
|
source: "实际来源",
|
|
6517
6517
|
recordVersion: "记录版本",
|
|
6518
6518
|
savedAt: "保存时间",
|
|
@@ -6713,7 +6713,6 @@ function NativeCommandEntries({ value, inherited, controller, disabled, onChange
|
|
|
6713
6713
|
/* @__PURE__ */ (0, import_jsx_runtime7.jsxs)("div", { className: "dsmm-structured", children: [
|
|
6714
6714
|
/* @__PURE__ */ (0, import_jsx_runtime7.jsx)("p", { className: "dsmm-hint", children: t("nativeCommandsHint") }),
|
|
6715
6715
|
/* @__PURE__ */ (0, import_jsx_runtime7.jsx)("p", { className: "dsmm-hint", children: t("patternHint") }),
|
|
6716
|
-
/* @__PURE__ */ (0, import_jsx_runtime7.jsx)("p", { className: "dsmm-hint", children: t("patternScope") }),
|
|
6717
6716
|
/* @__PURE__ */ (0, import_jsx_runtime7.jsx)("p", { className: "dsmm-hint", children: t("registrationUnresolved") }),
|
|
6718
6717
|
/* @__PURE__ */ (0, import_jsx_runtime7.jsx)("p", { className: "dsmm-hint", children: t(value === void 0 ? "inheritedEntries" : "explicitEntries") }),
|
|
6719
6718
|
!valid && /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("p", { className: "dsmm-issue", role: "alert", children: t("invalidEntry") }),
|
|
@@ -7022,7 +7021,7 @@ function Field({ schema, path, controller, initiallyOpen = false, disclosures, t
|
|
|
7022
7021
|
if (name2 === "permissionControl.nativeCommands.entries") return /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("div", { "data-field": name2, children: /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(NativeCommandEntries, { controller, value: explicit, inherited: inherited ?? [], disabled, onChange: (value) => controller.edit(path, value), setInvalid: (key, bad) => controller.setInvalid(key, bad), t: permissionText(t) }) });
|
|
7023
7022
|
if (name2 === "permissionControl.rules") return /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("div", { "data-field": name2, children: /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(PermissionRuleEntries, { controller, value: explicit, inherited: inherited ?? [], disabled, onChange: (value) => controller.edit(path, value), expanded: open, onExpandedChange: expand, t: permissionText(t) }) });
|
|
7024
7023
|
if (schema.type === "object" && schema.fields !== void 0 && path[0] !== "roleRouting") return /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)("details", { className: "dsmm-deployment-group", "data-field": name2, open, onToggle: (event) => expand(event.currentTarget.open), children: [
|
|
7025
|
-
/* @__PURE__ */ (0, import_jsx_runtime9.jsx)("summary", { children: /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)("span", { className: "dsmm-group-summary", children: [
|
|
7024
|
+
/* @__PURE__ */ (0, import_jsx_runtime9.jsx)("summary", { className: "dsmm-group-summary-row", children: /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)("span", { className: "dsmm-group-summary", children: [
|
|
7026
7025
|
/* @__PURE__ */ (0, import_jsx_runtime9.jsx)("span", { className: "dsmm-group-summary-label", children: fieldLabel(path, t) }),
|
|
7027
7026
|
/* @__PURE__ */ (0, import_jsx_runtime9.jsx)(import_dsh_client_ui_primitives7.Button, { type: "button", variant: "outline", className: "dsmm-group-summary-action", "data-dsmm-unset": name2, hidden: !open, disabled: disabled || explicit === void 0 && !Object.keys(state.raw).some((key) => key === name2 || key.startsWith(`${name2}.`)), onClick: unsetGroup, children: t("unsetGroup") })
|
|
7028
7027
|
] }) }),
|
|
@@ -7247,7 +7246,7 @@ var PermissionController = class {
|
|
|
7247
7246
|
this.connection = generation;
|
|
7248
7247
|
this.fence(true);
|
|
7249
7248
|
this.publish({ connected: invoke !== null });
|
|
7250
|
-
this.schedule(
|
|
7249
|
+
this.schedule();
|
|
7251
7250
|
}
|
|
7252
7251
|
bindScope(sessionId2, owner, scope) {
|
|
7253
7252
|
if (this.disposed || this.state.sessionId === sessionId2 && this.owner === owner && this.state.scope === scope) return;
|
|
@@ -7255,11 +7254,11 @@ var PermissionController = class {
|
|
|
7255
7254
|
this.owner = owner;
|
|
7256
7255
|
this.fence(sameSession, false, sameSession);
|
|
7257
7256
|
this.publish({ sessionId: sessionId2, scope });
|
|
7258
|
-
this.schedule(
|
|
7257
|
+
this.schedule();
|
|
7259
7258
|
}
|
|
7260
7259
|
watch() {
|
|
7261
7260
|
this.watchers++;
|
|
7262
|
-
if (this.watchers === 1) this.schedule(
|
|
7261
|
+
if (this.watchers === 1) this.schedule();
|
|
7263
7262
|
let active = true;
|
|
7264
7263
|
return () => {
|
|
7265
7264
|
if (!active) return;
|
|
@@ -7279,12 +7278,12 @@ var PermissionController = class {
|
|
|
7279
7278
|
live(generation) {
|
|
7280
7279
|
return !this.disposed && generation === this.state.generation && this.owner !== null && this.invoke !== null && this.state.scope === "root" && this.state.sessionId !== null;
|
|
7281
7280
|
}
|
|
7282
|
-
schedule(
|
|
7281
|
+
schedule() {
|
|
7283
7282
|
clearTimeout(this.timer);
|
|
7284
7283
|
if (this.watchers === 0 || !this.live(this.state.generation)) return;
|
|
7285
7284
|
this.timer = setTimeout(() => {
|
|
7286
7285
|
void this.revalidate(this.state.generation);
|
|
7287
|
-
},
|
|
7286
|
+
}, 0);
|
|
7288
7287
|
this.timer.unref?.();
|
|
7289
7288
|
}
|
|
7290
7289
|
issue(error) {
|
|
@@ -7333,7 +7332,6 @@ var PermissionController = class {
|
|
|
7333
7332
|
} finally {
|
|
7334
7333
|
if (this.live(generation) && sequence === this.requestSequence) this.publish({ reading: false, revalidating: false });
|
|
7335
7334
|
}
|
|
7336
|
-
this.schedule();
|
|
7337
7335
|
}
|
|
7338
7336
|
edit(generation, patch) {
|
|
7339
7337
|
if (!this.canEdit(generation) || this.state.draft === null) return;
|
|
@@ -7371,10 +7369,7 @@ var PermissionController = class {
|
|
|
7371
7369
|
} catch (error) {
|
|
7372
7370
|
if (this.live(generation)) this.publish({ rulesIssue: this.issue(error) });
|
|
7373
7371
|
} finally {
|
|
7374
|
-
if (this.live(generation)) {
|
|
7375
|
-
this.publish({ busy: null });
|
|
7376
|
-
this.schedule();
|
|
7377
|
-
}
|
|
7372
|
+
if (this.live(generation)) this.publish({ busy: null });
|
|
7378
7373
|
}
|
|
7379
7374
|
}
|
|
7380
7375
|
};
|
|
@@ -7506,6 +7501,8 @@ function PermissionCoverage({ state, t }) {
|
|
|
7506
7501
|
const value = observedRules(state)?.capabilities;
|
|
7507
7502
|
return /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("section", { className: "dsmm-structured", "aria-label": t("coverageTitle"), children: [
|
|
7508
7503
|
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)("h3", { children: t("coverageTitle") }),
|
|
7504
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)("p", { className: "dsmm-hint", children: t("matchHint") }),
|
|
7505
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)("p", { className: "dsmm-hint", children: t("networkLimit") }),
|
|
7509
7506
|
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)("p", { className: "dsmm-hint", children: t("coverage") }),
|
|
7510
7507
|
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)("p", { className: "dsmm-hint", children: t("registrationUnresolved") }),
|
|
7511
7508
|
value === void 0 ? /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("p", { children: t("coverageUnavailable") }) : /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)(import_jsx_runtime10.Fragment, { children: [
|
|
@@ -7558,8 +7555,6 @@ function PermissionRulesEditor({ controller, state, t }) {
|
|
|
7558
7555
|
return /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("section", { className: "dsmm-zone", "aria-label": t("rules"), children: [
|
|
7559
7556
|
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)("h3", { children: t("rules") }),
|
|
7560
7557
|
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)("p", { className: "dsmm-hint", children: t("rulesHint") }),
|
|
7561
|
-
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)("p", { className: "dsmm-hint", children: t("networkLimit") }),
|
|
7562
|
-
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)("p", { className: "dsmm-hint", children: t("matchHint") }),
|
|
7563
7558
|
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)(Issue, { value: state.rulesIssue, t }),
|
|
7564
7559
|
displayUnconfirmed(state) && /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("p", { className: "dsmm-hint", children: t("unconfirmedObservation") }),
|
|
7565
7560
|
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)("p", { className: "dsmm-hint", children: t("observedPolicy") }),
|
|
@@ -7653,8 +7648,11 @@ function PermissionsPanel({ controller, t, sessionId: sessionId2 }) {
|
|
|
7653
7648
|
return /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("section", { className: "dsmm-profiles dsmm-children dsmm-permissions", "data-dsmm-permissions": true, "aria-label": t("title"), "aria-busy": state.reading, children: [
|
|
7654
7649
|
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)("h2", { children: t("title") }),
|
|
7655
7650
|
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)(RootState, { state, t }),
|
|
7656
|
-
/* @__PURE__ */ (0, import_jsx_runtime10.
|
|
7657
|
-
|
|
7651
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("p", { className: "dsmm-hint", children: [
|
|
7652
|
+
t("nativeApproval"),
|
|
7653
|
+
" ",
|
|
7654
|
+
t("sandboxScope")
|
|
7655
|
+
] }),
|
|
7658
7656
|
/* @__PURE__ */ (0, import_jsx_runtime10.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) }),
|
|
7659
7657
|
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)(PermissionRulesEditor, { controller, state, t })
|
|
7660
7658
|
] });
|
|
@@ -7882,11 +7880,7 @@ function DeploymentPage(props) {
|
|
|
7882
7880
|
active === "run" && controller.layer === "profile" && /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(NativeRuntimeState, { value: state.snapshot.subagentRuntime, t })
|
|
7883
7881
|
] }),
|
|
7884
7882
|
scopeActions,
|
|
7885
|
-
active === "permissions" && /* @__PURE__ */ (0, import_jsx_runtime11.
|
|
7886
|
-
/* @__PURE__ */ (0, import_jsx_runtime11.jsx)("h3", { children: t("rootRules") }),
|
|
7887
|
-
/* @__PURE__ */ (0, import_jsx_runtime11.jsx)("p", { className: "dsmm-hint", children: t("rootRulesHint") }),
|
|
7888
|
-
workspace.permissions === void 0 ? /* @__PURE__ */ (0, import_jsx_runtime11.jsx)("p", { children: t("rootRulesUnavailable") }) : /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(PermissionsPanel, { controller: workspace.permissions, t: props.permissionsT ?? ((key) => Object.hasOwn(permissionEn, key) ? permissionText(t)(key) : key) })
|
|
7889
|
-
] })
|
|
7883
|
+
active === "permissions" && /* @__PURE__ */ (0, import_jsx_runtime11.jsx)("section", { className: "dsmm-zone dsmm-rules-transaction", "aria-label": t("rootRules"), children: workspace.permissions === void 0 ? /* @__PURE__ */ (0, import_jsx_runtime11.jsx)("p", { children: t("rootRulesUnavailable") }) : /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(PermissionsPanel, { controller: workspace.permissions, t: props.permissionsT ?? ((key) => Object.hasOwn(permissionEn, key) ? permissionText(t)(key) : key) }) })
|
|
7890
7884
|
] })
|
|
7891
7885
|
] }),
|
|
7892
7886
|
navigation.pending !== null && /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)("section", { className: "dsmm-confirm", role: "group", "aria-label": t("leaveDraft"), onKeyDown: (event) => {
|
|
@@ -217,12 +217,25 @@ export function createCorePermissionAuthority(ctx, options) {
|
|
|
217
217
|
throw new PermissionRefusal("cancelled");
|
|
218
218
|
seen.add(fiber.ctx);
|
|
219
219
|
}
|
|
220
|
-
const structural = root,
|
|
221
|
-
const
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
if (identity.readOnly === true || DSMM_ROLES.find(role => role.id === identity.role)?.access === "read-only")
|
|
220
|
+
const structural = root, profiles = coreDomain(root), host = integration();
|
|
221
|
+
const captured = host?.owns(root) === true || capturedRoleInvocation(structural) !== undefined;
|
|
222
|
+
const native = !captured && !profiles.hasAdmission(structural);
|
|
223
|
+
if (native && root.ctx.get("agentPresets")?.composedPreset(root.ctx)?.startsWith("dsmm-"))
|
|
225
224
|
throw new PermissionRefusal("denied");
|
|
225
|
+
if (captured) {
|
|
226
|
+
if (host === undefined)
|
|
227
|
+
throw new PermissionRefusal("unavailable");
|
|
228
|
+
host.assert(root);
|
|
229
|
+
}
|
|
230
|
+
if (!native) {
|
|
231
|
+
const admission = coreAdmission(root);
|
|
232
|
+
rolePolicy.assertModuleAdmission(structural);
|
|
233
|
+
const identity = rolePolicy.identity(structural);
|
|
234
|
+
if (identity.child || identity.parent !== undefined || identity.epoch !== admission.epoch)
|
|
235
|
+
throw new PermissionRefusal("not-owned");
|
|
236
|
+
if (identity.readOnly === true || DSMM_ROLES.find(role => role.id === identity.role)?.access === "read-only")
|
|
237
|
+
throw new PermissionRefusal("denied");
|
|
238
|
+
}
|
|
226
239
|
const sandbox = root.ctx.get("sandboxPolicy");
|
|
227
240
|
if (sandbox === undefined)
|
|
228
241
|
throw new PermissionRefusal("unavailable");
|