@dsmm/dsmm 0.3.3 → 0.3.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/agent-presets/dsmm-builder/agent.cordis.yml +1 -1
- package/agent-presets/dsmm-clarifier/agent.cordis.yml +1 -1
- package/agent-presets/dsmm-code-search/agent.cordis.yml +1 -1
- package/agent-presets/dsmm-coding/agent.cordis.yml +3 -2
- package/agent-presets/dsmm-complex/agent.cordis.yml +2 -1
- package/agent-presets/dsmm-creative/agent.cordis.yml +1 -1
- package/agent-presets/dsmm-cross-cutting/agent.cordis.yml +1 -1
- package/agent-presets/dsmm-deep/agent.cordis.yml +2 -1
- package/agent-presets/dsmm-doc-search/agent.cordis.yml +1 -1
- package/agent-presets/dsmm-documenting/agent.cordis.yml +1 -1
- package/agent-presets/dsmm-frontend/agent.cordis.yml +4 -2
- package/agent-presets/dsmm-hard-reasoning/agent.cordis.yml +1 -1
- package/agent-presets/dsmm-media-reader/agent.cordis.yml +1 -1
- package/agent-presets/dsmm-normal-task/agent.cordis.yml +3 -2
- package/agent-presets/dsmm-oracle/agent.cordis.yml +1 -1
- package/agent-presets/dsmm-oracle-2nd/agent.cordis.yml +1 -1
- package/agent-presets/dsmm-orchestrator/agent.cordis.yml +11 -1
- package/agent-presets/dsmm-plan-critic/agent.cordis.yml +1 -1
- package/agent-presets/dsmm-planner/agent.cordis.yml +1 -1
- package/agent-presets/dsmm-quick/agent.cordis.yml +2 -1
- package/agent-presets/dsmm-research/agent.cordis.yml +1 -1
- package/agent-presets/dsmm-reviewer/agent.cordis.yml +1 -1
- package/docs/native-permissions.md +11 -3
- package/docs/roadmap.md +30 -3
- package/docs/runtime-recovery.md +30 -2
- package/docs/settings-status.md +6 -4
- package/docs/skill-sync.md +13 -14
- package/lib/client/DeploymentFields.js +12 -1
- package/lib/client/DeploymentPage.js +29 -17
- package/lib/client/NativeCommandEntries.js +47 -37
- package/lib/client/PermissionRuleEntries.d.ts +17 -0
- package/lib/client/PermissionRuleEntries.js +70 -0
- package/lib/client/PermissionsPanel.js +4 -2
- package/lib/client/deployment-locales.d.ts +2 -2
- package/lib/client/deployment-locales.js +8 -8
- package/lib/client/deployment-modules.d.ts +5 -3
- package/lib/client/deployment-modules.js +4 -4
- package/lib/client/deployment-workspace.d.ts +4 -0
- package/lib/client/deployment-workspace.js +37 -11
- package/lib/client/permission-controller.d.ts +13 -0
- package/lib/client/permission-controller.js +50 -23
- package/lib/client/permission-locales.d.ts +28 -4
- package/lib/client/permission-locales.js +38 -18
- package/lib/client/styles.d.ts +1 -1
- package/lib/client/styles.js +8 -8
- package/lib/client.js +1024 -728
- package/lib/core-permission-authority.js +28 -16
- package/lib/index.js +2 -9
- package/lib/native-admission.d.ts +3 -0
- package/lib/native-admission.js +60 -26
- package/lib/permission-controller.js +1 -1
- package/lib/permission-native-command.js +6 -4
- package/lib/permission-settings.d.ts +21 -7
- package/lib/permission-settings.js +21 -9
- package/lib/role-identity.d.ts +1 -1
- package/lib/role-identity.js +16 -4
- package/lib/role-policy.d.ts +3 -0
- package/lib/role-policy.js +29 -5
- package/lib/role-subagents.js +4 -3
- package/lib/runtime-integration.js +4 -4
- package/lib/settings.js +4 -1
- package/lib/state.d.ts +4 -1
- package/lib/state.js +37 -6
- package/package.json +1 -1
- package/prompts/deepwork.md +13 -1
- package/prompts/source/agents/orchestrator.md +10 -0
- package/prompts/source/category/coding.md +2 -1
- package/prompts/source/category/complex.md +1 -0
- package/prompts/source/category/deep.md +1 -0
- package/prompts/source/category/frontend.md +3 -1
- package/prompts/source/category/normal-task.md +2 -1
- package/prompts/source/category/quick.md +1 -0
- package/prompts/source/deepwork/claude-opus-5.md +2 -0
- package/prompts/source/deepwork/default.md +12 -0
- package/prompts/source/deepwork/gemini.md +6 -1
- package/prompts/source/deepwork/glm.md +5 -1
- package/prompts/source/deepwork/gpt.md +22 -2
- package/prompts/source/deepwork/kimi-k27.md +2 -0
- package/prompts/source/deepwork/planner.md +3 -1
- package/prompts/source/deepwork/swe-2.md +2 -0
- package/prompts/source/manifest.json +3 -68
- package/prompts/source/shared/dsh-host-contract.md +1 -1
- package/skills/ast-grep/SKILL.md +1 -1
- package/skills/brainstorming/SKILL.md +1 -1
- package/skills/coding-agent-sessions/SKILL.md +1 -1
- package/skills/debugging/SKILL.md +1 -1
- package/skills/dispatching-parallel-agents/SKILL.md +1 -1
- package/skills/frontend/SKILL.md +1 -1
- package/skills/git-master/SKILL.md +1 -1
- package/skills/init-deep/SKILL.md +1 -1
- package/skills/receiving-code-review/SKILL.md +1 -1
- package/skills/remove-ai-slops/SKILL.md +1 -1
- package/skills/requesting-code-review/SKILL.md +1 -1
- package/skills/subagent-driven-development/SKILL.md +1 -1
- package/skills/using-git-worktrees/SKILL.md +1 -1
- package/skills/writing-plans/SKILL.md +1 -1
package/lib/client.js
CHANGED
|
@@ -5,8 +5,8 @@ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
|
5
5
|
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
6
|
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
7
7
|
var __export = (target, all) => {
|
|
8
|
-
for (var
|
|
9
|
-
__defProp(target,
|
|
8
|
+
for (var name2 in all)
|
|
9
|
+
__defProp(target, name2, { get: all[name2], enumerable: true });
|
|
10
10
|
};
|
|
11
11
|
var __copyProps = (to, from2, except, desc) => {
|
|
12
12
|
if (from2 && typeof from2 === "object" || typeof from2 === "function") {
|
|
@@ -969,8 +969,8 @@ function parse(text5, errors = [], options = ParseOptions.DEFAULT) {
|
|
|
969
969
|
currentParent = object3;
|
|
970
970
|
currentProperty = null;
|
|
971
971
|
},
|
|
972
|
-
onObjectProperty: (
|
|
973
|
-
currentProperty =
|
|
972
|
+
onObjectProperty: (name2) => {
|
|
973
|
+
currentProperty = name2;
|
|
974
974
|
},
|
|
975
975
|
onObjectEnd: () => {
|
|
976
976
|
currentParent = previousParents.pop();
|
|
@@ -1009,9 +1009,9 @@ function parseTree(text5, errors = [], options = ParseOptions.DEFAULT) {
|
|
|
1009
1009
|
onObjectBegin: (offset) => {
|
|
1010
1010
|
currentParent = onValue({ type: "object", offset, length: -1, parent: currentParent, children: [] });
|
|
1011
1011
|
},
|
|
1012
|
-
onObjectProperty: (
|
|
1012
|
+
onObjectProperty: (name2, offset, length) => {
|
|
1013
1013
|
currentParent = onValue({ type: "property", offset, length: -1, parent: currentParent, children: [] });
|
|
1014
|
-
currentParent.children.push({ type: "string", value:
|
|
1014
|
+
currentParent.children.push({ type: "string", value: name2, offset, length, parent: currentParent });
|
|
1015
1015
|
},
|
|
1016
1016
|
onObjectEnd: (offset, length) => {
|
|
1017
1017
|
ensurePropertyComplete(offset + length);
|
|
@@ -2416,10 +2416,10 @@ Schema.extend("transform", (data, { inner, callback, preserve }, options) => {
|
|
|
2416
2416
|
else return [callback(result), callback(adapted)];
|
|
2417
2417
|
});
|
|
2418
2418
|
var formatters = {};
|
|
2419
|
-
function defineMethod(
|
|
2420
|
-
formatters[
|
|
2421
|
-
Object.assign(Schema, { [
|
|
2422
|
-
const schema = new Schema({ type:
|
|
2419
|
+
function defineMethod(name2, keys, format2) {
|
|
2420
|
+
formatters[name2] = format2;
|
|
2421
|
+
Object.assign(Schema, { [name2](...args) {
|
|
2422
|
+
const schema = new Schema({ type: name2 });
|
|
2423
2423
|
keys.forEach((key, index) => {
|
|
2424
2424
|
switch (key) {
|
|
2425
2425
|
case "sKey":
|
|
@@ -2455,9 +2455,9 @@ function defineMethod(name, keys, format2) {
|
|
|
2455
2455
|
schema[key] = args[index];
|
|
2456
2456
|
}
|
|
2457
2457
|
});
|
|
2458
|
-
if (
|
|
2459
|
-
else if (
|
|
2460
|
-
else if (
|
|
2458
|
+
if (name2 === "object" || name2 === "dict") schema.meta.default = {};
|
|
2459
|
+
else if (name2 === "array" || name2 === "tuple") schema.meta.default = [];
|
|
2460
|
+
else if (name2 === "bitset") schema.meta.default = 0;
|
|
2461
2461
|
return schema;
|
|
2462
2462
|
} });
|
|
2463
2463
|
}
|
|
@@ -2593,6 +2593,14 @@ function parsePermissionRulesSave(value) {
|
|
|
2593
2593
|
}
|
|
2594
2594
|
|
|
2595
2595
|
// src/permission-settings.ts
|
|
2596
|
+
function parseNativeCommandPattern(input) {
|
|
2597
|
+
if (typeof input !== "string" || input.length > 32768) throw new PermissionRefusal("validation");
|
|
2598
|
+
const tokens = input.replace(/^[ \t]+|[ \t]+$/gu, "").split(/[ \t]+/u);
|
|
2599
|
+
if (tokens.length !== 2 && (tokens.length !== 3 || tokens[2] !== "*") || tokens[0].length === 0 || /[^\p{L}\p{M}\p{N}_./:=+%\\\-]/u.test(tokens[0])) throw new PermissionRefusal("validation");
|
|
2600
|
+
const subcommands = tokens[1].split("|");
|
|
2601
|
+
if (subcommands.some((value) => value.length === 0 || /[^\p{L}\p{M}\p{N}_./:=+%\-]/u.test(value))) throw new PermissionRefusal("validation");
|
|
2602
|
+
return Object.freeze({ executable: tokens[0], subcommands: Object.freeze(subcommands) });
|
|
2603
|
+
}
|
|
2596
2604
|
function parseNativeCommands(input = {}) {
|
|
2597
2605
|
const row = permissionRuleRow(input, [], ["enabled", "entries"]);
|
|
2598
2606
|
if (row.enabled !== void 0 && typeof row.enabled !== "boolean" || row.entries !== void 0 && (!Array.isArray(row.entries) || row.entries.length > 1024)) throw new PermissionRefusal("validation");
|
|
@@ -2602,30 +2610,22 @@ function parseNativeCommands(input = {}) {
|
|
|
2602
2610
|
};
|
|
2603
2611
|
const ids = /* @__PURE__ */ new Set();
|
|
2604
2612
|
const entries = (row.entries ?? []).map((value) => {
|
|
2605
|
-
const entry = permissionRuleRow(value, ["id", "mode", "match", "sandboxMode"])
|
|
2613
|
+
const entry = permissionRuleRow(value, ["id", "mode", "match", "sandboxMode"]);
|
|
2614
|
+
const match = permissionRuleRow(entry.match, ["tool", "workingDirectory", "commandPattern"]);
|
|
2606
2615
|
const id2 = text5(entry.id), cwd = text5(match.workingDirectory);
|
|
2607
|
-
if (ids.has(id2) || !["ask", "allow"].includes(entry.mode) || !["bash", "pwsh"].includes(match.tool) || !["workspace-write", "danger-full-access"].includes(entry.sandboxMode) || !/^(?:\/|[a-z]:[\\/]|\\\\[^\\/]+[\\/][^\\/]+(?:[\\/]|$))/iu.test(cwd)
|
|
2616
|
+
if (ids.has(id2) || !["ask", "allow"].includes(entry.mode) || !["bash", "pwsh"].includes(match.tool) || !["workspace-write", "danger-full-access"].includes(entry.sandboxMode) || !/^(?:\/|[a-z]:[\\/]|\\\\[^\\/]+[\\/][^\\/]+(?:[\\/]|$))/iu.test(cwd)) throw new PermissionRefusal("validation");
|
|
2608
2617
|
ids.add(id2);
|
|
2609
|
-
|
|
2610
|
-
|
|
2611
|
-
|
|
2612
|
-
...match.subcommand === void 0 ? {} : { subcommand: text5(match.subcommand) },
|
|
2613
|
-
args: Object.freeze(match.args.map(text5)),
|
|
2614
|
-
workingDirectory: cwd
|
|
2615
|
-
}) });
|
|
2618
|
+
parseNativeCommandPattern(match.commandPattern);
|
|
2619
|
+
const parsed = { tool: match.tool, workingDirectory: cwd, commandPattern: match.commandPattern };
|
|
2620
|
+
return Object.freeze({ id: id2, mode: entry.mode, sandboxMode: entry.sandboxMode, match: Object.freeze(parsed) });
|
|
2616
2621
|
});
|
|
2617
2622
|
return Object.freeze({ enabled: row.enabled ?? false, entries: Object.freeze(entries) });
|
|
2618
2623
|
}
|
|
2624
|
+
var nativeCommandMatchSchema = Schema.object({ tool: Schema.union(["bash", "pwsh"]).required(), workingDirectory: Schema.string().required(), commandPattern: Schema.string().required() }).required();
|
|
2619
2625
|
var nativeCommands = Schema.object({ enabled: Schema.boolean().default(false), entries: Schema.array(Schema.object({
|
|
2620
2626
|
id: Schema.string().required(),
|
|
2621
2627
|
mode: Schema.union(["ask", "allow"]).required(),
|
|
2622
|
-
match:
|
|
2623
|
-
tool: Schema.union(["bash", "pwsh"]).required(),
|
|
2624
|
-
executable: Schema.string().required(),
|
|
2625
|
-
subcommand: Schema.string(),
|
|
2626
|
-
args: Schema.array(Schema.string()).required(),
|
|
2627
|
-
workingDirectory: Schema.string().required()
|
|
2628
|
-
}).required(),
|
|
2628
|
+
match: nativeCommandMatchSchema,
|
|
2629
2629
|
sandboxMode: Schema.union(["workspace-write", "danger-full-access"]).required()
|
|
2630
2630
|
})).default([]) });
|
|
2631
2631
|
var webDefault = Object.freeze({ enabled: true, rule: "inherit" });
|
|
@@ -4715,7 +4715,7 @@ function EditableChoice({ id: id2, label, value, options, disabled, placeholder,
|
|
|
4715
4715
|
|
|
4716
4716
|
// src/client/StructuredEditor.tsx
|
|
4717
4717
|
var import_jsx_runtime4 = require("react/jsx-runtime");
|
|
4718
|
-
function RetryNumber({ id: id2, name, field, value, inherited, path, disabled, actions:
|
|
4718
|
+
function RetryNumber({ id: id2, name: name2, field, value, inherited, path, disabled, actions: actions3, t }) {
|
|
4719
4719
|
const [draft2, setDraft] = (0, import_react2.useState)(value === void 0 ? "" : String(value));
|
|
4720
4720
|
const [invalid2, setInvalid] = (0, import_react2.useState)(false);
|
|
4721
4721
|
const [min, max] = DSMM_RATE_LIMIT_BOUNDS[field];
|
|
@@ -4725,11 +4725,11 @@ function RetryNumber({ id: id2, name, field, value, inherited, path, disabled, a
|
|
|
4725
4725
|
setInvalid(false);
|
|
4726
4726
|
}, [value]);
|
|
4727
4727
|
(0, import_react2.useEffect)(() => {
|
|
4728
|
-
|
|
4729
|
-
return () =>
|
|
4730
|
-
}, [
|
|
4728
|
+
actions3.setFieldInvalid(key, invalid2);
|
|
4729
|
+
return () => actions3.setFieldInvalid(key, false);
|
|
4730
|
+
}, [actions3.setFieldInvalid, key, invalid2]);
|
|
4731
4731
|
return /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("div", { className: "dsmm-field", children: [
|
|
4732
|
-
/* @__PURE__ */ (0, import_jsx_runtime4.jsx)("label", { htmlFor: id2, children: t("retryField", { name, field: t(RETRY_FIELD_LABEL_KEYS[field]) }) }),
|
|
4732
|
+
/* @__PURE__ */ (0, import_jsx_runtime4.jsx)("label", { htmlFor: id2, children: t("retryField", { name: name2, field: t(RETRY_FIELD_LABEL_KEYS[field]) }) }),
|
|
4733
4733
|
/* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
|
|
4734
4734
|
import_dsh_client_ui_primitives2.Input,
|
|
4735
4735
|
{
|
|
@@ -4751,8 +4751,8 @@ function RetryNumber({ id: id2, name, field, value, inherited, path, disabled, a
|
|
|
4751
4751
|
setDraft(input.value);
|
|
4752
4752
|
const valid = input.validity.valid && (input.value === "" || Number.isSafeInteger(input.valueAsNumber));
|
|
4753
4753
|
setInvalid(!valid);
|
|
4754
|
-
|
|
4755
|
-
if (valid)
|
|
4754
|
+
actions3.setFieldInvalid(key, !valid);
|
|
4755
|
+
if (valid) actions3.editPath(path, input.value === "" ? void 0 : input.valueAsNumber);
|
|
4756
4756
|
}
|
|
4757
4757
|
}
|
|
4758
4758
|
),
|
|
@@ -4760,7 +4760,7 @@ function RetryNumber({ id: id2, name, field, value, inherited, path, disabled, a
|
|
|
4760
4760
|
invalid2 && /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("p", { id: `${id2}-invalid`, children: t("invalidNumber") })
|
|
4761
4761
|
] });
|
|
4762
4762
|
}
|
|
4763
|
-
function RouteFields({ value, path, name, catalog, disabled, edit, editRoute, t }) {
|
|
4763
|
+
function RouteFields({ value, path, name: name2, catalog, disabled, edit, editRoute, t }) {
|
|
4764
4764
|
const prefix = (0, import_react2.useId)();
|
|
4765
4765
|
const providers = catalog?.groups ?? [];
|
|
4766
4766
|
const group = providers.find((candidate) => candidate.id === value.provider);
|
|
@@ -4771,12 +4771,12 @@ function RouteFields({ value, path, name, catalog, disabled, edit, editRoute, t
|
|
|
4771
4771
|
};
|
|
4772
4772
|
return /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("div", { className: "dsmm-route-fields", children: [
|
|
4773
4773
|
/* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("div", { className: "dsmm-field", children: [
|
|
4774
|
-
/* @__PURE__ */ (0, import_jsx_runtime4.jsx)("label", { htmlFor: `${prefix}-provider`, children: t("routeProvider", { name }) }),
|
|
4774
|
+
/* @__PURE__ */ (0, import_jsx_runtime4.jsx)("label", { htmlFor: `${prefix}-provider`, children: t("routeProvider", { name: name2 }) }),
|
|
4775
4775
|
/* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
|
|
4776
4776
|
EditableChoice,
|
|
4777
4777
|
{
|
|
4778
4778
|
id: `${prefix}-provider`,
|
|
4779
|
-
label: t("routeProvider", { name }),
|
|
4779
|
+
label: t("routeProvider", { name: name2 }),
|
|
4780
4780
|
value: value.provider,
|
|
4781
4781
|
options: providers,
|
|
4782
4782
|
disabled,
|
|
@@ -4786,12 +4786,12 @@ function RouteFields({ value, path, name, catalog, disabled, edit, editRoute, t
|
|
|
4786
4786
|
)
|
|
4787
4787
|
] }),
|
|
4788
4788
|
/* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("div", { className: "dsmm-field", children: [
|
|
4789
|
-
/* @__PURE__ */ (0, import_jsx_runtime4.jsx)("label", { htmlFor: `${prefix}-model`, children: t("routeModel", { name }) }),
|
|
4789
|
+
/* @__PURE__ */ (0, import_jsx_runtime4.jsx)("label", { htmlFor: `${prefix}-model`, children: t("routeModel", { name: name2 }) }),
|
|
4790
4790
|
/* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
|
|
4791
4791
|
EditableChoice,
|
|
4792
4792
|
{
|
|
4793
4793
|
id: `${prefix}-model`,
|
|
4794
|
-
label: t("routeModel", { name }),
|
|
4794
|
+
label: t("routeModel", { name: name2 }),
|
|
4795
4795
|
value: value.model,
|
|
4796
4796
|
options: group?.models ?? [],
|
|
4797
4797
|
disabled,
|
|
@@ -4800,12 +4800,12 @@ function RouteFields({ value, path, name, catalog, disabled, edit, editRoute, t
|
|
|
4800
4800
|
)
|
|
4801
4801
|
] }),
|
|
4802
4802
|
/* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("div", { className: "dsmm-field", children: [
|
|
4803
|
-
/* @__PURE__ */ (0, import_jsx_runtime4.jsx)("label", { htmlFor: `${prefix}-effort`, children: t("routeEffort", { name }) }),
|
|
4803
|
+
/* @__PURE__ */ (0, import_jsx_runtime4.jsx)("label", { htmlFor: `${prefix}-effort`, children: t("routeEffort", { name: name2 }) }),
|
|
4804
4804
|
/* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
|
|
4805
4805
|
EditableChoice,
|
|
4806
4806
|
{
|
|
4807
4807
|
id: `${prefix}-effort`,
|
|
4808
|
-
label: t("routeEffort", { name }),
|
|
4808
|
+
label: t("routeEffort", { name: name2 }),
|
|
4809
4809
|
value: value.reasoningEffort ?? "",
|
|
4810
4810
|
options: efforts,
|
|
4811
4811
|
disabled,
|
|
@@ -4816,29 +4816,29 @@ function RouteFields({ value, path, name, catalog, disabled, edit, editRoute, t
|
|
|
4816
4816
|
] })
|
|
4817
4817
|
] });
|
|
4818
4818
|
}
|
|
4819
|
-
function PolicyFields({ value, inherited, path, name, disabled, actions:
|
|
4819
|
+
function PolicyFields({ value, inherited, path, name: name2, disabled, actions: actions3, t }) {
|
|
4820
4820
|
const prefix = (0, import_react2.useId)();
|
|
4821
4821
|
return /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("div", { className: "dsmm-policy-fields", children: [
|
|
4822
4822
|
/* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("div", { className: "dsmm-field", children: [
|
|
4823
|
-
/* @__PURE__ */ (0, import_jsx_runtime4.jsx)("label", { htmlFor: `${prefix}-strategy`, children: t("strategy", { name }) }),
|
|
4824
|
-
/* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("select", { id: `${prefix}-strategy`, disabled, value: value.strategy ?? "", onChange: (event) =>
|
|
4823
|
+
/* @__PURE__ */ (0, import_jsx_runtime4.jsx)("label", { htmlFor: `${prefix}-strategy`, children: t("strategy", { name: name2 }) }),
|
|
4824
|
+
/* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("select", { id: `${prefix}-strategy`, disabled, value: value.strategy ?? "", onChange: (event) => actions3.editPath([...path, "strategy"], event.currentTarget.value || void 0), children: [
|
|
4825
4825
|
/* @__PURE__ */ (0, import_jsx_runtime4.jsx)("option", { value: "", children: t("inheritStrategy", { value: inherited?.strategy ?? t("unknownDefault") }) }),
|
|
4826
4826
|
/* @__PURE__ */ (0, import_jsx_runtime4.jsx)("option", { value: "startup-lock", children: t("startupLock") }),
|
|
4827
4827
|
/* @__PURE__ */ (0, import_jsx_runtime4.jsx)("option", { value: "rate-limit-fallback", children: t("rateFallback") })
|
|
4828
4828
|
] })
|
|
4829
4829
|
] }),
|
|
4830
4830
|
/* @__PURE__ */ (0, import_jsx_runtime4.jsx)("p", { className: "dsmm-hint", children: t("strategyHint") }),
|
|
4831
|
-
/* @__PURE__ */ (0, import_jsx_runtime4.jsx)("div", { className: "dsmm-route-fields", children: Object.keys(DSMM_RATE_LIMIT_BOUNDS).map((field) => /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(RetryNumber, { id: `${prefix}-${field}`, t, name, field, value: value.rateLimit?.[field], inherited: inherited?.rateLimit[field], path: [...path, "rateLimit", field], disabled, actions:
|
|
4831
|
+
/* @__PURE__ */ (0, import_jsx_runtime4.jsx)("div", { className: "dsmm-route-fields", children: Object.keys(DSMM_RATE_LIMIT_BOUNDS).map((field) => /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(RetryNumber, { id: `${prefix}-${field}`, t, name: name2, field, value: value.rateLimit?.[field], inherited: inherited?.rateLimit[field], path: [...path, "rateLimit", field], disabled, actions: actions3 }, field)) })
|
|
4832
4832
|
] });
|
|
4833
4833
|
}
|
|
4834
|
-
function LevelFields({ level: level2, value, path, catalog, disabled, actions:
|
|
4834
|
+
function LevelFields({ level: level2, value, path, catalog, disabled, actions: actions3, t }) {
|
|
4835
4835
|
const prefix = (0, import_react2.useId)();
|
|
4836
4836
|
const mode = value === void 0 ? "inherit" : value.provider === void 0 ? "effort" : "route";
|
|
4837
4837
|
return /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("fieldset", { "data-dsmm-level": level2, children: [
|
|
4838
4838
|
/* @__PURE__ */ (0, import_jsx_runtime4.jsx)("legend", { children: t("levelName", { level: level2 }) }),
|
|
4839
4839
|
/* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("div", { className: "dsmm-field", children: [
|
|
4840
4840
|
/* @__PURE__ */ (0, import_jsx_runtime4.jsx)("label", { htmlFor: `${prefix}-mode`, children: t("levelMode", { level: level2 }) }),
|
|
4841
|
-
/* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("select", { id: `${prefix}-mode`, value: mode, disabled, onChange: (event) =>
|
|
4841
|
+
/* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("select", { id: `${prefix}-mode`, value: mode, disabled, onChange: (event) => actions3.editPath(
|
|
4842
4842
|
path,
|
|
4843
4843
|
event.currentTarget.value === "inherit" ? void 0 : event.currentTarget.value === "effort" ? { reasoningEffort: "" } : { provider: "", model: "" }
|
|
4844
4844
|
), children: [
|
|
@@ -4857,14 +4857,14 @@ function LevelFields({ level: level2, value, path, catalog, disabled, actions: a
|
|
|
4857
4857
|
value: value?.reasoningEffort ?? "",
|
|
4858
4858
|
options: [],
|
|
4859
4859
|
disabled,
|
|
4860
|
-
onChange: (effort) =>
|
|
4860
|
+
onChange: (effort) => actions3.editPath([...path, "reasoningEffort"], effort)
|
|
4861
4861
|
}
|
|
4862
4862
|
)
|
|
4863
4863
|
] }),
|
|
4864
|
-
value?.provider !== void 0 && /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(RouteFields, { value, path, name: t("levelName", { level: level2 }), catalog, disabled, edit:
|
|
4864
|
+
value?.provider !== void 0 && /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(RouteFields, { value, path, name: t("levelName", { level: level2 }), catalog, disabled, edit: actions3.editPath, editRoute: actions3.editRoute, t })
|
|
4865
4865
|
] });
|
|
4866
4866
|
}
|
|
4867
|
-
function StructuredEditor({ state, actions:
|
|
4867
|
+
function StructuredEditor({ state, actions: actions3, disabled, t }) {
|
|
4868
4868
|
const prefix = (0, import_react2.useId)();
|
|
4869
4869
|
const [selectedRole, setSelectedRole] = (0, import_react2.useState)("dsmm-orchestrator");
|
|
4870
4870
|
const document2 = state.editor === null ? null : structuredDocument(state.editor.content);
|
|
@@ -4888,12 +4888,12 @@ function StructuredEditor({ state, actions: actions2, disabled, t }) {
|
|
|
4888
4888
|
return /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("div", { className: "dsmm-structured", "data-dsmm-structured": true, children: [
|
|
4889
4889
|
/* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("div", { className: "dsmm-field", children: [
|
|
4890
4890
|
/* @__PURE__ */ (0, import_jsx_runtime4.jsx)("label", { htmlFor: `${prefix}-label`, children: t("profileLabel") }),
|
|
4891
|
-
/* @__PURE__ */ (0, import_jsx_runtime4.jsx)(import_dsh_client_ui_primitives2.Input, { id: `${prefix}-label`, className: "dsmm-input", value: document2.label ?? "", disabled, onChange: (event) =>
|
|
4892
|
-
/* @__PURE__ */ (0, import_jsx_runtime4.jsx)(import_dsh_client_ui_primitives2.Button, { type: "button", variant: "outline", disabled: disabled || document2.label === void 0, onClick: () =>
|
|
4891
|
+
/* @__PURE__ */ (0, import_jsx_runtime4.jsx)(import_dsh_client_ui_primitives2.Input, { id: `${prefix}-label`, className: "dsmm-input", value: document2.label ?? "", disabled, onChange: (event) => actions3.editPath(["label"], event.currentTarget.value) }),
|
|
4892
|
+
/* @__PURE__ */ (0, import_jsx_runtime4.jsx)(import_dsh_client_ui_primitives2.Button, { type: "button", variant: "outline", disabled: disabled || document2.label === void 0, onClick: () => actions3.editPath(["label"], void 0), children: t("omitLabel") })
|
|
4893
4893
|
] }),
|
|
4894
4894
|
/* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("div", { className: "dsmm-field", children: [
|
|
4895
4895
|
/* @__PURE__ */ (0, import_jsx_runtime4.jsx)("label", { htmlFor: `${prefix}-locale`, children: t("businessLocale") }),
|
|
4896
|
-
/* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("select", { id: `${prefix}-locale`, value: String(document2.settings.locale ?? ""), disabled, "aria-describedby": `${prefix}-locale-hint`, onChange: (event) =>
|
|
4896
|
+
/* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("select", { id: `${prefix}-locale`, value: String(document2.settings.locale ?? ""), disabled, "aria-describedby": `${prefix}-locale-hint`, onChange: (event) => actions3.editPath(["settings", "locale"], event.currentTarget.value || void 0), children: [
|
|
4897
4897
|
/* @__PURE__ */ (0, import_jsx_runtime4.jsx)("option", { value: "", children: t("inheritLocale") }),
|
|
4898
4898
|
typeof document2.settings.locale === "string" && !DSMM_LOCALES.includes(document2.settings.locale) && /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("option", { value: document2.settings.locale, children: t("unsupportedLocale") }),
|
|
4899
4899
|
DSMM_LOCALES.map((locale) => /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("option", { value: locale, children: locale }, locale))
|
|
@@ -4902,7 +4902,7 @@ function StructuredEditor({ state, actions: actions2, disabled, t }) {
|
|
|
4902
4902
|
] }),
|
|
4903
4903
|
/* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("div", { className: "dsmm-field", children: [
|
|
4904
4904
|
/* @__PURE__ */ (0, import_jsx_runtime4.jsx)("label", { htmlFor: `${prefix}-topology`, children: t("toolTopology") }),
|
|
4905
|
-
/* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("select", { id: `${prefix}-topology`, value: topology ?? "", disabled, "aria-describedby": `${prefix}-topology-hint`, onChange: (event) =>
|
|
4905
|
+
/* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("select", { id: `${prefix}-topology`, value: topology ?? "", disabled, "aria-describedby": `${prefix}-topology-hint`, onChange: (event) => actions3.editPath(["settings", "subagents", "toolTopology"], event.currentTarget.value || void 0), children: [
|
|
4906
4906
|
/* @__PURE__ */ (0, import_jsx_runtime4.jsx)("option", { value: "", children: t("inherit") }),
|
|
4907
4907
|
/* @__PURE__ */ (0, import_jsx_runtime4.jsx)("option", { value: "per-role", children: "per-role" }),
|
|
4908
4908
|
/* @__PURE__ */ (0, import_jsx_runtime4.jsx)("option", { value: "parameterized", children: "parameterized" })
|
|
@@ -4911,7 +4911,7 @@ function StructuredEditor({ state, actions: actions2, disabled, t }) {
|
|
|
4911
4911
|
] }),
|
|
4912
4912
|
/* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("div", { className: "dsmm-field", children: [
|
|
4913
4913
|
/* @__PURE__ */ (0, import_jsx_runtime4.jsx)("label", { htmlFor: `${prefix}-active`, children: t("defaultActive") }),
|
|
4914
|
-
/* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("select", { id: `${prefix}-active`, disabled, value: document2.settings.defaultActive === void 0 ? "" : String(document2.settings.defaultActive), onChange: (event) =>
|
|
4914
|
+
/* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("select", { id: `${prefix}-active`, disabled, value: document2.settings.defaultActive === void 0 ? "" : String(document2.settings.defaultActive), onChange: (event) => actions3.editPath(["settings", "defaultActive"], event.currentTarget.value === "" ? void 0 : event.currentTarget.value === "true"), children: [
|
|
4915
4915
|
/* @__PURE__ */ (0, import_jsx_runtime4.jsx)("option", { value: "", children: t("inherit") }),
|
|
4916
4916
|
/* @__PURE__ */ (0, import_jsx_runtime4.jsx)("option", { value: "true", children: t("enabled") }),
|
|
4917
4917
|
/* @__PURE__ */ (0, import_jsx_runtime4.jsx)("option", { value: "false", children: t("disabled") })
|
|
@@ -4920,7 +4920,7 @@ function StructuredEditor({ state, actions: actions2, disabled, t }) {
|
|
|
4920
4920
|
] }),
|
|
4921
4921
|
/* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("fieldset", { children: [
|
|
4922
4922
|
/* @__PURE__ */ (0, import_jsx_runtime4.jsx)("legend", { children: t("profileDefaults") }),
|
|
4923
|
-
/* @__PURE__ */ (0, import_jsx_runtime4.jsx)(PolicyFields, { t, value: document2.runtimePolicy, inherited: baseline, path: ["settings", "runtimePolicy"], name: t("profileDefaults"), disabled, actions:
|
|
4923
|
+
/* @__PURE__ */ (0, import_jsx_runtime4.jsx)(PolicyFields, { t, value: document2.runtimePolicy, inherited: baseline, path: ["settings", "runtimePolicy"], name: t("profileDefaults"), disabled, actions: actions3 })
|
|
4924
4924
|
] }),
|
|
4925
4925
|
/* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("div", { className: "dsmm-field", children: [
|
|
4926
4926
|
/* @__PURE__ */ (0, import_jsx_runtime4.jsx)("label", { htmlFor: `${prefix}-role`, children: t("roleSelect") }),
|
|
@@ -4937,51 +4937,51 @@ function StructuredEditor({ state, actions: actions2, disabled, t }) {
|
|
|
4937
4937
|
/* @__PURE__ */ (0, import_jsx_runtime4.jsx)(RoleAvailability, { value: role3.availability, t }),
|
|
4938
4938
|
/* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("div", { className: "dsmm-field", children: [
|
|
4939
4939
|
/* @__PURE__ */ (0, import_jsx_runtime4.jsx)("label", { htmlFor: `${prefix}-role-enabled`, children: t("namedRole", { name: role3.label }) }),
|
|
4940
|
-
/* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("select", { id: `${prefix}-role-enabled`, value: namedRoles?.[role3.id] === void 0 ? "" : String(namedRoles[role3.id]), disabled, "aria-describedby": `${prefix}-role-hint`, onChange: (event) =>
|
|
4940
|
+
/* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("select", { id: `${prefix}-role-enabled`, value: namedRoles?.[role3.id] === void 0 ? "" : String(namedRoles[role3.id]), disabled, "aria-describedby": `${prefix}-role-hint`, onChange: (event) => actions3.editPath(["settings", "roles", role3.id], event.currentTarget.value === "" ? void 0 : event.currentTarget.value === "true"), children: [
|
|
4941
4941
|
/* @__PURE__ */ (0, import_jsx_runtime4.jsx)("option", { value: "", children: t("inherit") }),
|
|
4942
4942
|
/* @__PURE__ */ (0, import_jsx_runtime4.jsx)("option", { value: "true", disabled: availability2 === void 0 || !availability2.startupAvailable || !availability2.deploymentEnabled || availability2.reason === "module-off", children: t("enabled") }),
|
|
4943
4943
|
/* @__PURE__ */ (0, import_jsx_runtime4.jsx)("option", { value: "false", disabled: availability2 === void 0 || availability2.required, children: t("disabled") })
|
|
4944
4944
|
] }),
|
|
4945
4945
|
/* @__PURE__ */ (0, import_jsx_runtime4.jsx)("p", { id: `${prefix}-role-hint`, className: "dsmm-hint", children: t("namedRoleHint") })
|
|
4946
4946
|
] }),
|
|
4947
|
-
/* @__PURE__ */ (0, import_jsx_runtime4.jsx)(PolicyFields, { t, value: policy, inherited, path: rolePath, name: role3.label, disabled, actions:
|
|
4947
|
+
/* @__PURE__ */ (0, import_jsx_runtime4.jsx)(PolicyFields, { t, value: policy, inherited, path: rolePath, name: role3.label, disabled, actions: actions3 }),
|
|
4948
4948
|
/* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("div", { className: "dsmm-field", children: [
|
|
4949
4949
|
/* @__PURE__ */ (0, import_jsx_runtime4.jsx)("label", { htmlFor: `${prefix}-primary-mode`, children: t("primaryMode", { name: role3.label }) }),
|
|
4950
|
-
/* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("select", { id: `${prefix}-primary-mode`, disabled, value: policy.primary === void 0 ? "inherit" : "explicit", onChange: (event) =>
|
|
4950
|
+
/* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("select", { id: `${prefix}-primary-mode`, disabled, value: policy.primary === void 0 ? "inherit" : "explicit", onChange: (event) => actions3.editPath([...rolePath, "primary"], event.currentTarget.value === "inherit" ? void 0 : { provider: "", model: "" }), children: [
|
|
4951
4951
|
/* @__PURE__ */ (0, import_jsx_runtime4.jsx)("option", { value: "inherit", children: t("inheritRoute") }),
|
|
4952
4952
|
/* @__PURE__ */ (0, import_jsx_runtime4.jsx)("option", { value: "explicit", children: t("configuredRoute") })
|
|
4953
4953
|
] })
|
|
4954
4954
|
] }),
|
|
4955
|
-
policy.primary !== void 0 && /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(RouteFields, { t, value: policy.primary, path: [...rolePath, "primary"], name: t("primaryName", { name: role3.label }), catalog: state.catalog, disabled, edit:
|
|
4955
|
+
policy.primary !== void 0 && /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(RouteFields, { t, value: policy.primary, path: [...rolePath, "primary"], name: t("primaryName", { name: role3.label }), catalog: state.catalog, disabled, edit: actions3.editPath, editRoute: actions3.editRoute }),
|
|
4956
4956
|
/* @__PURE__ */ (0, import_jsx_runtime4.jsx)("p", { className: "dsmm-hint", children: t("effortChangeHint") }),
|
|
4957
4957
|
/* @__PURE__ */ (0, import_jsx_runtime4.jsx)("p", { className: "dsmm-hint", children: t("normalLevel") }),
|
|
4958
4958
|
role3.id === "dsmm-orchestrator" ? /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("p", { className: "dsmm-hint", children: t("orchestratorLevels") }) : /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)(import_jsx_runtime4.Fragment, { children: [
|
|
4959
4959
|
/* @__PURE__ */ (0, import_jsx_runtime4.jsx)("p", { className: "dsmm-hint", children: t("levelsHint") }),
|
|
4960
|
-
["low", "high", "max"].map((level2) => /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(LevelFields, { level: level2, value: policy.levels?.[level2], path: [...rolePath, "levels", level2], catalog: state.catalog, disabled, actions:
|
|
4960
|
+
["low", "high", "max"].map((level2) => /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(LevelFields, { level: level2, value: policy.levels?.[level2], path: [...rolePath, "levels", level2], catalog: state.catalog, disabled, actions: actions3, t }, level2))
|
|
4961
4961
|
] }),
|
|
4962
4962
|
/* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("div", { className: "dsmm-field", children: [
|
|
4963
4963
|
/* @__PURE__ */ (0, import_jsx_runtime4.jsx)("label", { htmlFor: `${prefix}-fallback-mode`, children: t("fallbackMode", { name: role3.label }) }),
|
|
4964
|
-
/* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("select", { id: `${prefix}-fallback-mode`, disabled, value: policy.fallbackRoutes === void 0 ? "inherit" : "explicit", onChange: (event) =>
|
|
4964
|
+
/* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("select", { id: `${prefix}-fallback-mode`, disabled, value: policy.fallbackRoutes === void 0 ? "inherit" : "explicit", onChange: (event) => actions3.editPath([...rolePath, "fallbackRoutes"], event.currentTarget.value === "inherit" ? void 0 : []), children: [
|
|
4965
4965
|
/* @__PURE__ */ (0, import_jsx_runtime4.jsx)("option", { value: "inherit", children: t("inheritChain") }),
|
|
4966
4966
|
/* @__PURE__ */ (0, import_jsx_runtime4.jsx)("option", { value: "explicit", children: t("configuredChain") })
|
|
4967
4967
|
] })
|
|
4968
4968
|
] }),
|
|
4969
4969
|
policy.fallbackRoutes?.length === 0 && /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("p", { className: "dsmm-hint", children: t("emptyChain") }),
|
|
4970
4970
|
policy.fallbackRoutes?.map((candidate, index) => {
|
|
4971
|
-
const
|
|
4971
|
+
const name2 = t("fallbackName", { name: role3.label, index: index + 1 });
|
|
4972
4972
|
return /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("fieldset", { children: [
|
|
4973
|
-
/* @__PURE__ */ (0, import_jsx_runtime4.jsx)("legend", { children:
|
|
4974
|
-
/* @__PURE__ */ (0, import_jsx_runtime4.jsx)(RouteFields, { t, value: candidate, path: [...rolePath, "fallbackRoutes", index], name, catalog: state.catalog, disabled, edit:
|
|
4973
|
+
/* @__PURE__ */ (0, import_jsx_runtime4.jsx)("legend", { children: name2 }),
|
|
4974
|
+
/* @__PURE__ */ (0, import_jsx_runtime4.jsx)(RouteFields, { t, value: candidate, path: [...rolePath, "fallbackRoutes", index], name: name2, catalog: state.catalog, disabled, edit: actions3.editPath, editRoute: actions3.editRoute }),
|
|
4975
4975
|
/* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("div", { className: "dsmm-actions", children: [
|
|
4976
|
-
/* @__PURE__ */ (0, import_jsx_runtime4.jsx)(import_dsh_client_ui_primitives2.Button, { type: "button", variant: "outline", disabled: disabled || index === 0, onClick: () =>
|
|
4977
|
-
/* @__PURE__ */ (0, import_jsx_runtime4.jsx)(import_dsh_client_ui_primitives2.Button, { type: "button", variant: "outline", disabled: disabled || index === policy.fallbackRoutes.length - 1, onClick: () =>
|
|
4978
|
-
/* @__PURE__ */ (0, import_jsx_runtime4.jsx)(import_dsh_client_ui_primitives2.Button, { type: "button", variant: "outline", disabled, onClick: () =>
|
|
4976
|
+
/* @__PURE__ */ (0, import_jsx_runtime4.jsx)(import_dsh_client_ui_primitives2.Button, { type: "button", variant: "outline", disabled: disabled || index === 0, onClick: () => actions3.moveFallback(role3.id, index, index - 1), children: t("moveUp", { name: name2 }) }),
|
|
4977
|
+
/* @__PURE__ */ (0, import_jsx_runtime4.jsx)(import_dsh_client_ui_primitives2.Button, { type: "button", variant: "outline", disabled: disabled || index === policy.fallbackRoutes.length - 1, onClick: () => actions3.moveFallback(role3.id, index, index + 1), children: t("moveDown", { name: name2 }) }),
|
|
4978
|
+
/* @__PURE__ */ (0, import_jsx_runtime4.jsx)(import_dsh_client_ui_primitives2.Button, { type: "button", variant: "outline", disabled, onClick: () => actions3.editPath([...rolePath, "fallbackRoutes", index], void 0), children: t("removeFallback", { name: name2 }) })
|
|
4979
4979
|
] })
|
|
4980
4980
|
] }, index);
|
|
4981
4981
|
}),
|
|
4982
4982
|
/* @__PURE__ */ (0, import_jsx_runtime4.jsx)(import_dsh_client_ui_primitives2.Button, { type: "button", variant: "outline", disabled: disabled || (policy.fallbackRoutes?.length ?? 0) >= 32, onClick: () => {
|
|
4983
|
-
if (policy.fallbackRoutes === void 0)
|
|
4984
|
-
else
|
|
4983
|
+
if (policy.fallbackRoutes === void 0) actions3.editPath([...rolePath, "fallbackRoutes"], [{ provider: "", model: "" }]);
|
|
4984
|
+
else actions3.editPath([...rolePath, "fallbackRoutes", policy.fallbackRoutes.length], { provider: "", model: "" });
|
|
4985
4985
|
}, children: t("addFallback", { name: role3.label }) })
|
|
4986
4986
|
] }, role3.id)
|
|
4987
4987
|
] });
|
|
@@ -5030,14 +5030,14 @@ function menuIssue(issue) {
|
|
|
5030
5030
|
const field = issue.field;
|
|
5031
5031
|
return { code, ...isSafeDiagnosticField(field) ? { field } : {} };
|
|
5032
5032
|
}
|
|
5033
|
-
function SessionScope({ state, actions:
|
|
5033
|
+
function SessionScope({ state, actions: actions3, t, compact = false }) {
|
|
5034
5034
|
const prefix = (0, import_react3.useId)();
|
|
5035
5035
|
const session = state.session;
|
|
5036
5036
|
const labels = session === null ? null : sessionProfileLabels(session, t);
|
|
5037
5037
|
const selected = state.snapshot?.profiles.find((profile) => profile.id === state.sessionChoice);
|
|
5038
5038
|
const disabled = state.busy !== null || state.pendingEditor !== null || state.sessionBusy !== null || state.dirty || state.invalidFields.length > 0;
|
|
5039
5039
|
const current = () => {
|
|
5040
|
-
const live =
|
|
5040
|
+
const live = actions3.readProfileView();
|
|
5041
5041
|
return live.currentSessionId === state.currentSessionId && live.sessionViewEpoch === state.sessionViewEpoch && live.session === session;
|
|
5042
5042
|
};
|
|
5043
5043
|
const ready = session !== null && !state.sessionUnconfirmed && !session.refreshRequired && !session.selection.refreshRequired && writableSelectionVersion(session.selection.selectionRevision);
|
|
@@ -5064,7 +5064,7 @@ function SessionScope({ state, actions: actions2, t, compact = false }) {
|
|
|
5064
5064
|
/* @__PURE__ */ (0, import_jsx_runtime5.jsxs)("div", { className: "dsmm-field", children: [
|
|
5065
5065
|
/* @__PURE__ */ (0, import_jsx_runtime5.jsx)("label", { htmlFor: `${prefix}-choice`, children: t("sessionSelect") }),
|
|
5066
5066
|
/* @__PURE__ */ (0, import_jsx_runtime5.jsxs)("select", { id: `${prefix}-choice`, value: state.sessionChoice ?? "", disabled: disabled || !allowed, "aria-describedby": !allowed ? `${prefix}-overlay-reason` : void 0, onChange: (event) => {
|
|
5067
|
-
if (current())
|
|
5067
|
+
if (current()) actions3.chooseSessionProfile(event.currentTarget.value || null);
|
|
5068
5068
|
}, children: [
|
|
5069
5069
|
/* @__PURE__ */ (0, import_jsx_runtime5.jsx)("option", { value: "", children: t("sessionBaseline") }),
|
|
5070
5070
|
state.sessionChoice !== null && selected === void 0 && /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("option", { value: state.sessionChoice, children: state.sessionChoice }),
|
|
@@ -5077,7 +5077,7 @@ function SessionScope({ state, actions: actions2, t, compact = false }) {
|
|
|
5077
5077
|
!compact && /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)(import_jsx_runtime5.Fragment, { children: [
|
|
5078
5078
|
/* @__PURE__ */ (0, import_jsx_runtime5.jsx)("p", { className: "dsmm-hint", children: t("sessionModelHint") }),
|
|
5079
5079
|
/* @__PURE__ */ (0, import_jsx_runtime5.jsx)(import_dsh_client_ui_primitives3.Button, { type: "button", variant: "outline", disabled: disabled || !modelAllowed, "aria-describedby": !modelAllowed ? `${prefix}-model-reason` : void 0, onClick: () => {
|
|
5080
|
-
if (current()) void
|
|
5080
|
+
if (current()) void actions3.useSessionProfileModel();
|
|
5081
5081
|
}, children: t("headerUseCurrentModel") }),
|
|
5082
5082
|
!modelAllowed && /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("p", { className: "dsmm-hint", id: `${prefix}-model-reason`, children: capabilityReason(session?.selectModelUnavailableReason, t) }),
|
|
5083
5083
|
session !== null && /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)("details", { children: [
|
|
@@ -5101,13 +5101,13 @@ function SessionScope({ state, actions: actions2, t, compact = false }) {
|
|
|
5101
5101
|
state.sessionUnconfirmed && /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("p", { role: "status", children: t("sessionUnconfirmedRefresh") }),
|
|
5102
5102
|
/* @__PURE__ */ (0, import_jsx_runtime5.jsxs)("div", { className: "dsmm-actions", children: [
|
|
5103
5103
|
/* @__PURE__ */ (0, import_jsx_runtime5.jsx)(import_dsh_client_ui_primitives3.Button, { type: "button", variant: "outline", disabled: disabled || !allowed || state.sessionChoice !== null && !isConfigRevision(selected?.revision), "aria-describedby": !allowed ? `${prefix}-overlay-reason` : void 0, onClick: () => {
|
|
5104
|
-
if (current()) void
|
|
5104
|
+
if (current()) void actions3.applySession();
|
|
5105
5105
|
}, children: t(state.sessionBusy === "apply" ? "sessionApplying" : "sessionApply") }),
|
|
5106
5106
|
!compact && /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(import_dsh_client_ui_primitives3.Button, { type: "button", variant: "outline", disabled: disabled || !allowed, "aria-describedby": !allowed ? `${prefix}-overlay-reason` : void 0, onClick: () => {
|
|
5107
|
-
if (current()) void
|
|
5107
|
+
if (current()) void actions3.resetSession();
|
|
5108
5108
|
}, children: t(state.sessionBusy === "reset" ? "sessionResetting" : "sessionReset") }),
|
|
5109
5109
|
/* @__PURE__ */ (0, import_jsx_runtime5.jsx)(import_dsh_client_ui_primitives3.Button, { type: "button", variant: "outline", disabled: state.sessionBusy !== null || state.busy !== null || state.pendingEditor !== null, onClick: () => {
|
|
5110
|
-
if (current()) void
|
|
5110
|
+
if (current()) void actions3.refreshSession();
|
|
5111
5111
|
}, children: t("sessionRefresh") })
|
|
5112
5112
|
] })
|
|
5113
5113
|
] }),
|
|
@@ -5454,15 +5454,15 @@ var PROFILE_STYLES = `
|
|
|
5454
5454
|
.dsmm-profiles :is(.dsmm-warning,.dsmm-diagnostic,.dsmm-availability){min-width:0;display:flex;flex-direction:column;gap:4px;overflow-wrap:anywhere}
|
|
5455
5455
|
.dsmm-profiles .dsmm-warning{border-left:4px solid var(--dsw-alias-state-warn-primary);padding:8px 12px;color:var(--dsw-alias-label-primary)}
|
|
5456
5456
|
.dsmm-deployment{gap:8px}
|
|
5457
|
-
.dsmm-
|
|
5458
|
-
.dsmm-
|
|
5459
|
-
.dsmm-
|
|
5460
|
-
.dsmm-
|
|
5461
|
-
.dsmm-
|
|
5462
|
-
.dsmm-
|
|
5463
|
-
.dsmm-
|
|
5457
|
+
.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}
|
|
5458
|
+
.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}
|
|
5459
|
+
.dsmm-section-tabs button:hover{background:var(--dsw-alias-interactive-bg-hover)}
|
|
5460
|
+
.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}
|
|
5461
|
+
.dsmm-section-panel{display:flex;flex-direction:column;gap:16px;min-width:0;width:100%;box-sizing:border-box}
|
|
5462
|
+
.dsmm-panel-heading{display:flex;flex-wrap:wrap;gap:8px;justify-content:space-between;align-items:center;min-width:0}
|
|
5463
|
+
.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}
|
|
5464
|
+
.dsmm-rules-transaction{padding-top:16px}
|
|
5464
5465
|
.dsmm-scope-save{display:flex;flex-direction:column;gap:8px;padding-top:16px;border-top:1px solid var(--dsw-alias-border-l4)}
|
|
5465
|
-
@media(max-width:768px){.dsmm-deployment-frame{grid-template-columns:minmax(0,1fr)}.dsmm-deployment-frame[data-drawer-open=true]>.dsmm-module-list{display:none}}
|
|
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
5468
|
.dsmm-deployment code{font-family:var(--ds-font-family-code);overflow-wrap:anywhere}
|
|
@@ -5811,8 +5811,27 @@ var DeploymentController = class _DeploymentController {
|
|
|
5811
5811
|
};
|
|
5812
5812
|
|
|
5813
5813
|
// src/client/DeploymentPage.tsx
|
|
5814
|
-
var
|
|
5815
|
-
var
|
|
5814
|
+
var import_react9 = require("react");
|
|
5815
|
+
var import_dsh_client_ui_primitives9 = require("@deepseek-ai/dsh-client-ui-primitives");
|
|
5816
|
+
|
|
5817
|
+
// src/client/deployment-modules.ts
|
|
5818
|
+
var CONFIG_MODULES = ["run", "routes", "workflow", "permissions", "state"];
|
|
5819
|
+
var NAVIGATION_MODULES = [...CONFIG_MODULES, "other"];
|
|
5820
|
+
var moduleTitle = (module2) => `module:${module2}`;
|
|
5821
|
+
function moduleFor(path) {
|
|
5822
|
+
const key = path.split(".")[0];
|
|
5823
|
+
if (["defaultActive", "modules", "modelParameters", "runtime"].includes(key)) return "run";
|
|
5824
|
+
if (["roleRouting", "runtimePolicy", "runtimeRecovery"].includes(key)) return "routes";
|
|
5825
|
+
if (["workflow", "roles", "skills", "presets", "businessLocale", "locale", "promptOrder", "subagents"].includes(key)) return "workflow";
|
|
5826
|
+
if (["permissionControl", "guards"].includes(key)) return "permissions";
|
|
5827
|
+
return "other";
|
|
5828
|
+
}
|
|
5829
|
+
function editableConfigField(key, layer) {
|
|
5830
|
+
return !["lsp", "modeName", "section"].includes(key) && !(key === "modules" && layer === "profile") && !(key === "runtime" && layer === "global");
|
|
5831
|
+
}
|
|
5832
|
+
function moduleFields(schema, module2, layer) {
|
|
5833
|
+
return Object.entries(schema.fields ?? {}).filter(([key]) => editableConfigField(key, layer) && moduleFor(key) === module2);
|
|
5834
|
+
}
|
|
5816
5835
|
|
|
5817
5836
|
// src/client/deployment-workspace.ts
|
|
5818
5837
|
var DeploymentWorkspace = class {
|
|
@@ -5828,6 +5847,7 @@ var DeploymentWorkspace = class {
|
|
|
5828
5847
|
}
|
|
5829
5848
|
state = { scope: "global", module: null, pending: null, native: null, revision: 0 };
|
|
5830
5849
|
listeners = /* @__PURE__ */ new Set();
|
|
5850
|
+
visited = { global: null, profile: null };
|
|
5831
5851
|
forms = null;
|
|
5832
5852
|
profiles = /* @__PURE__ */ new Map();
|
|
5833
5853
|
stopForm;
|
|
@@ -5894,28 +5914,44 @@ var DeploymentWorkspace = class {
|
|
|
5894
5914
|
controller(scope = this.state.scope) {
|
|
5895
5915
|
return scope === "global" ? this.core : this.state.native;
|
|
5896
5916
|
}
|
|
5917
|
+
/** First visit opens the first section with editable fields; afterwards the last viewed section. */
|
|
5918
|
+
defaultSection(scope) {
|
|
5919
|
+
const restored = this.visited[scope];
|
|
5920
|
+
if (restored !== null) return restored;
|
|
5921
|
+
const snapshot4 = this.controller(scope)?.getSnapshot().snapshot;
|
|
5922
|
+
if (snapshot4 !== null && snapshot4 !== void 0) {
|
|
5923
|
+
const schema = scopeSchema(snapshot4, scope);
|
|
5924
|
+
for (const module2 of CONFIG_MODULES) if (module2 !== "state" && moduleFields(schema, module2, scope).length > 0) return module2;
|
|
5925
|
+
}
|
|
5926
|
+
return "state";
|
|
5927
|
+
}
|
|
5897
5928
|
hasPending() {
|
|
5898
5929
|
return this.controller()?.getSnapshot().dirty === true || this.state.module === "permissions" && this.permissions?.store.getSnapshot().dirty === true;
|
|
5899
5930
|
}
|
|
5900
5931
|
request(destination) {
|
|
5901
5932
|
const switched = destination.scope !== this.state.scope;
|
|
5902
|
-
const leaving = switched || this.state.module !== null && destination.module !== this.state.module;
|
|
5903
|
-
if (leaving && this.hasPending())
|
|
5904
|
-
|
|
5905
|
-
|
|
5906
|
-
if (switched) void this.controller()?.refresh();
|
|
5933
|
+
const leaving = switched || this.state.module !== null && destination.module !== null && destination.module !== this.state.module;
|
|
5934
|
+
if (leaving && this.hasPending()) {
|
|
5935
|
+
this.changed({ pending: destination });
|
|
5936
|
+
return;
|
|
5907
5937
|
}
|
|
5938
|
+
const module2 = destination.module ?? this.defaultSection(destination.scope);
|
|
5939
|
+
this.visited[destination.scope] = module2;
|
|
5940
|
+
this.changed({ scope: destination.scope, module: module2, pending: null });
|
|
5941
|
+
if (switched) void this.controller()?.refresh();
|
|
5908
5942
|
}
|
|
5909
5943
|
continueEditing() {
|
|
5910
5944
|
this.changed({ pending: null });
|
|
5911
5945
|
}
|
|
5946
|
+
/** Explicitly keep every draft and move anyway; the draft stays in contribution memory. */
|
|
5912
5947
|
keepAndNavigate() {
|
|
5913
5948
|
const target = this.state.pending;
|
|
5914
|
-
if (target
|
|
5915
|
-
|
|
5916
|
-
|
|
5917
|
-
|
|
5918
|
-
}
|
|
5949
|
+
if (target === null) return;
|
|
5950
|
+
const module2 = target.module ?? this.defaultSection(target.scope);
|
|
5951
|
+
this.visited[target.scope] = module2;
|
|
5952
|
+
const switched = target.scope !== this.state.scope;
|
|
5953
|
+
this.changed({ scope: target.scope, module: module2, pending: null });
|
|
5954
|
+
if (switched) void this.controller()?.refresh();
|
|
5919
5955
|
}
|
|
5920
5956
|
async discardAndNavigate() {
|
|
5921
5957
|
const destination = this.state.pending;
|
|
@@ -5926,10 +5962,11 @@ var DeploymentWorkspace = class {
|
|
|
5926
5962
|
if (controller.getSnapshot().dirty || controller.getSnapshot().issue !== null) return;
|
|
5927
5963
|
}
|
|
5928
5964
|
if (this.state.module === "permissions" && this.permissions?.store.getSnapshot().dirty) {
|
|
5929
|
-
|
|
5965
|
+
const permissions = this.permissions.store.getSnapshot();
|
|
5966
|
+
await this.permissions.refresh(permissions.generation, true);
|
|
5930
5967
|
if (this.permissions.store.getSnapshot().dirty) return;
|
|
5931
5968
|
}
|
|
5932
|
-
if (this.state.pending === destination) this.
|
|
5969
|
+
if (this.state.pending === destination) this.request(destination);
|
|
5933
5970
|
}
|
|
5934
5971
|
async save() {
|
|
5935
5972
|
const controller = this.controller();
|
|
@@ -5956,28 +5993,9 @@ function deploymentWorkspace(core, permissions) {
|
|
|
5956
5993
|
return workspace;
|
|
5957
5994
|
}
|
|
5958
5995
|
|
|
5959
|
-
// src/client/deployment-modules.ts
|
|
5960
|
-
var CONFIG_MODULES = ["run", "routes", "workflow", "subagents", "permissions", "other", "state"];
|
|
5961
|
-
var moduleTitle = (module2) => `module:${module2}`;
|
|
5962
|
-
function moduleFor(path) {
|
|
5963
|
-
const key = path.split(".")[0];
|
|
5964
|
-
if (["defaultActive", "modules", "modelParameters", "runtime"].includes(key)) return "run";
|
|
5965
|
-
if (["roleRouting", "runtimePolicy", "runtimeRecovery"].includes(key)) return "routes";
|
|
5966
|
-
if (["workflow", "roles", "skills", "presets", "businessLocale", "locale", "promptOrder"].includes(key)) return "workflow";
|
|
5967
|
-
if (key === "subagents") return "subagents";
|
|
5968
|
-
if (["permissionControl", "guards"].includes(key)) return "permissions";
|
|
5969
|
-
return "other";
|
|
5970
|
-
}
|
|
5971
|
-
function editableConfigField(key, layer) {
|
|
5972
|
-
return !["lsp", "modeName", "section"].includes(key) && !(key === "modules" && layer === "profile") && !(key === "runtime" && layer === "global");
|
|
5973
|
-
}
|
|
5974
|
-
function moduleFields(schema, module2, layer) {
|
|
5975
|
-
return Object.entries(schema.fields ?? {}).filter(([key]) => editableConfigField(key, layer) && moduleFor(key) === module2);
|
|
5976
|
-
}
|
|
5977
|
-
|
|
5978
5996
|
// src/client/DeploymentFields.tsx
|
|
5979
|
-
var
|
|
5980
|
-
var
|
|
5997
|
+
var import_react7 = require("react");
|
|
5998
|
+
var import_dsh_client_ui_primitives7 = require("@deepseek-ai/dsh-client-ui-primitives");
|
|
5981
5999
|
|
|
5982
6000
|
// src/client/deployment-locales.ts
|
|
5983
6001
|
var DEPLOYMENT_NS = "plugins.dsmm";
|
|
@@ -5998,17 +6016,15 @@ var deploymentEn = {
|
|
|
5998
6016
|
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.",
|
|
5999
6017
|
modelParametersHint: "Off stops sending custom parameters and uses native reasoning defaults. Saved values and your selected model stay unchanged.",
|
|
6000
6018
|
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.",
|
|
6001
|
-
modules: "Configuration
|
|
6019
|
+
modules: "Configuration sections",
|
|
6002
6020
|
scope: "Configuration scope",
|
|
6003
|
-
close: "Close module",
|
|
6004
6021
|
loading: "Loading configuration…",
|
|
6005
6022
|
unset: "Use default configuration",
|
|
6006
6023
|
"module:run": "Run and modules",
|
|
6007
6024
|
"module:routes": "Model routes and recovery",
|
|
6008
|
-
"module:workflow": "Workflow, roles and
|
|
6009
|
-
"module:
|
|
6010
|
-
"module:
|
|
6011
|
-
"module:other": "Other settings",
|
|
6025
|
+
"module:workflow": "Workflow, roles and subagents",
|
|
6026
|
+
"module:permissions": "Permissions and safety",
|
|
6027
|
+
"module:other": "Other / advanced",
|
|
6012
6028
|
"module:state": "Configuration state",
|
|
6013
6029
|
saveScope: "Save selected configuration scope",
|
|
6014
6030
|
pendingModules: "Pending modules in this scope",
|
|
@@ -6019,12 +6035,14 @@ var deploymentEn = {
|
|
|
6019
6035
|
continueEditing: "Continue editing",
|
|
6020
6036
|
keepDraft: "Keep draft and return",
|
|
6021
6037
|
discardDraft: "Discard draft and leave",
|
|
6022
|
-
rootRules: "
|
|
6023
|
-
rootRulesHint: "
|
|
6038
|
+
rootRules: "Global permission rules",
|
|
6039
|
+
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.",
|
|
6024
6040
|
rootRulesUnavailable: "Permission rules unavailable. Reconnect and refresh.",
|
|
6025
6041
|
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.",
|
|
6026
6042
|
nativeRuntimeReadinessHint: "Task progress is available in the session.",
|
|
6027
6043
|
unsetGroup: "Use defaults for this group",
|
|
6044
|
+
unitBytes: "bytes",
|
|
6045
|
+
unitChars: "characters",
|
|
6028
6046
|
nativeRuntimeState: "Observed native runtime",
|
|
6029
6047
|
nativeRuntimeBinding: "Observed runtime composition",
|
|
6030
6048
|
nativeRuntimeFence: "Execution admission ready",
|
|
@@ -6100,17 +6118,15 @@ var deploymentZh = {
|
|
|
6100
6118
|
coreHint: "Core 所有的 desired 意图配置。模型参数透传为普通配置,非子插件;权限控制 enabled 仅启动时捕获。保存不改变当前会话准入;下方可检查意图、启动与准入值,不可用的准入仍为未知。",
|
|
6101
6119
|
modelParametersHint: "关闭后停止发送自定义参数,并使用原生推理默认值;已保存的值和所选模型不变。",
|
|
6102
6120
|
permissionControlHint: "权限控制挂载仅启动时捕获。保存配置不证明运行时覆盖,也不移除当前保护;Root 规则在权限模块内保持独立权限。",
|
|
6103
|
-
modules: "
|
|
6121
|
+
modules: "配置分区",
|
|
6104
6122
|
scope: "配置范围",
|
|
6105
|
-
close: "关闭模块",
|
|
6106
6123
|
loading: "正在加载配置…",
|
|
6107
6124
|
unset: "使用默认配置",
|
|
6108
6125
|
"module:run": "运行与模块",
|
|
6109
6126
|
"module:routes": "模型路由与恢复",
|
|
6110
|
-
"module:workflow": "
|
|
6111
|
-
"module:
|
|
6112
|
-
"module:
|
|
6113
|
-
"module:other": "其他设置",
|
|
6127
|
+
"module:workflow": "工作流、角色与子 Agent",
|
|
6128
|
+
"module:permissions": "权限与安全",
|
|
6129
|
+
"module:other": "其他与高级",
|
|
6114
6130
|
"module:state": "配置状态",
|
|
6115
6131
|
saveScope: "保存所选配置作用域",
|
|
6116
6132
|
pendingModules: "此作用域的待保存模块",
|
|
@@ -6121,12 +6137,14 @@ var deploymentZh = {
|
|
|
6121
6137
|
continueEditing: "继续编辑",
|
|
6122
6138
|
keepDraft: "保留草稿并返回",
|
|
6123
6139
|
discardDraft: "放弃草稿并离开",
|
|
6124
|
-
rootRules: "
|
|
6125
|
-
rootRulesHint: "
|
|
6140
|
+
rootRules: "全局权限规则",
|
|
6141
|
+
rootRulesHint: "请选择已打开且有编辑权限的主会话作为全局规则的编辑入口。保存的规则写入全局策略,对所有使用该策略的上下文生效,并非会话私有。此事务与配置分别保存。",
|
|
6126
6142
|
rootRulesUnavailable: "权限规则不可用,请重连后刷新。",
|
|
6127
6143
|
nativeRuntimeHint: "原生默认开启,Host base 固定值仍适用;挂载仅启动时捕获。保存只设置 desired,不会启动/停止提供商或取消当前会话;独立 Host 重启可能取消会话。",
|
|
6128
6144
|
nativeRuntimeReadinessHint: "任务进度可在会话中查看。",
|
|
6129
6145
|
unsetGroup: "整组使用默认配置",
|
|
6146
|
+
unitBytes: "字节",
|
|
6147
|
+
unitChars: "字符",
|
|
6130
6148
|
nativeRuntimeState: "已观测原生运行时",
|
|
6131
6149
|
nativeRuntimeBinding: "已观测运行时组合",
|
|
6132
6150
|
nativeRuntimeFence: "执行准入已就绪",
|
|
@@ -6252,7 +6270,7 @@ var deploymentFieldLabels = {
|
|
|
6252
6270
|
var PERMISSIONS_NS = "settings.dsmm-permissions";
|
|
6253
6271
|
var permissionEn = {
|
|
6254
6272
|
title: "Permission control",
|
|
6255
|
-
rules: "Global permission rules",
|
|
6273
|
+
rules: "Global permission rules (through the selected main session)",
|
|
6256
6274
|
nativeApproval: "Approve commands in the native prompt. Allow approves only that call.",
|
|
6257
6275
|
root: "Selected main session",
|
|
6258
6276
|
noRoot: "Select a main session to view its permission rules.",
|
|
@@ -6284,29 +6302,51 @@ var permissionEn = {
|
|
|
6284
6302
|
exact: "Exact path",
|
|
6285
6303
|
tree: "Path and descendants",
|
|
6286
6304
|
networkLimit: "Web rules cover public web tools only. Private networks, shell commands and sockets remain outside this permission.",
|
|
6287
|
-
rulesHint: "
|
|
6305
|
+
rulesHint: "Rules are edited through the selected main session but are Global policy, not session-private: saving persists them for every context that uses this policy. This transaction is separate from configuration above. If profile overrides block saving, edit or clear them in the profile scope, then refresh.",
|
|
6288
6306
|
configPolicyHint: "Profile settings override Global settings. Arrays replace inherited lists. Refresh session permissions after saving to check what is effective.",
|
|
6289
|
-
configRulesHint: "
|
|
6307
|
+
configRulesHint: "Record list for this configuration layer. The form supplies ID, action and match only; the Host assigns the imported source and preserves the record version during import. Imported records are never verified approvals. Use the Global rules transaction below for operator-verified changes. An empty list is an explicit empty replacement.",
|
|
6290
6308
|
coldHint: "Changing this switch requires a Host restart. Current protection stays active until then. Restart may cancel sessions.",
|
|
6291
|
-
|
|
6292
|
-
|
|
6293
|
-
|
|
6309
|
+
guardScope: "Guard scope",
|
|
6310
|
+
shellSafety: "Shell command safety",
|
|
6311
|
+
gitWrite: "Git write approval",
|
|
6312
|
+
toolOutputTruncation: "Tool output truncation",
|
|
6313
|
+
planValidation: "Plan format validation",
|
|
6314
|
+
questionLabels: "Question label helper",
|
|
6315
|
+
todoDiscipline: "Todo discipline helper",
|
|
6316
|
+
maxInlineBytes: "Maximum inline output",
|
|
6317
|
+
maxLabelChars: "Maximum label length",
|
|
6318
|
+
unitBytes: "bytes",
|
|
6319
|
+
unitChars: "characters",
|
|
6320
|
+
nativeCommands: "Command rules",
|
|
6321
|
+
nativeCommandsHint: "Default Off. Each rule stores one command pattern: an executable and fixed subcommand alternatives, with any trailing arguments. Legacy exact executable/argument rules are rejected, not converted. Other approval, denial and read-only restrictions still apply. New entries use ask and workspace-write.",
|
|
6322
|
+
registrationUnresolved: "Executor identity is unconfirmed. Verify the tool, executable, environment and sandbox before entering values.",
|
|
6294
6323
|
entryId: "Entry ID",
|
|
6295
|
-
tool: "Tool
|
|
6296
|
-
|
|
6297
|
-
subcommand: "Subcommand (optional; blank omits)",
|
|
6298
|
-
args: "Ordered arguments (JSON string array)",
|
|
6299
|
-
sandboxMode: "Sandbox mode (exact)",
|
|
6324
|
+
tool: "Tool",
|
|
6325
|
+
sandboxMode: "Sandbox mode",
|
|
6300
6326
|
mode: "Native action",
|
|
6301
|
-
addEntry: "Add
|
|
6327
|
+
addEntry: "Add entry",
|
|
6302
6328
|
removeEntry: "Remove entry",
|
|
6303
|
-
noEntries: "No
|
|
6329
|
+
noEntries: "No command entries.",
|
|
6304
6330
|
unset: "Unset — restore inheritance",
|
|
6305
6331
|
inheritedEntries: "Inherited entries; editing pins a replacement array in this layer.",
|
|
6306
6332
|
explicitEntries: "Explicit replacement array in this layer.",
|
|
6307
|
-
invalidEntry: "Invalid
|
|
6333
|
+
invalidEntry: "Invalid entry: use unique nonblank IDs, a valid pattern, and an absolute Host working directory. Draft retained; Save locked.",
|
|
6334
|
+
pattern: "Command pattern",
|
|
6335
|
+
patternHint: "One executable, one subcommand or pipe-separated alternatives, then an optional * for the argument tail: go build|test and go build|test * both allow any trailing arguments. The * only covers trailing arguments; there is no character glob or regular expression.",
|
|
6336
|
+
invalidPattern: "Invalid pattern: use one executable and the subcommand position only, separated by spaces. Pipe alternatives must be nonblank literals and * may appear only as the final token.",
|
|
6337
|
+
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.",
|
|
6338
|
+
restrictedFullAccess: "danger-full-access — retained from the saved value; not offered here",
|
|
6308
6339
|
rulesUnavailable: "Editing requires an open main session, local editing permission and synchronized rules. Check profile overrides, reconnect and refresh.",
|
|
6309
|
-
|
|
6340
|
+
configRules: "Imported configuration rules",
|
|
6341
|
+
inheritedRules: "Inherited records; editing pins a replacement list in this layer.",
|
|
6342
|
+
explicitRules: "Explicit replacement list in this layer.",
|
|
6343
|
+
configRulesEmpty: "This layer stores no permission rules.",
|
|
6344
|
+
addRule: "Add imported rule",
|
|
6345
|
+
removeRule: "Remove rule",
|
|
6346
|
+
advancedRules: "Advanced rule JSON",
|
|
6347
|
+
invalidRule: "Invalid rule list: use unique nonblank IDs, allow/ask/deny actions, and a complete match. Draft retained; Save locked.",
|
|
6348
|
+
recordedOperator: "Recorded operator source (metadata, not approval)",
|
|
6349
|
+
invalidPatternHint: "Correct invalid pattern text before saving. Removing a row discards only that row's draft and keeps the others; Unset replaces this whole array with the inherited list.",
|
|
6310
6350
|
observedPolicy: "Effective policy (including profile overrides)",
|
|
6311
6351
|
profileOverrideState: "Profile overrides",
|
|
6312
6352
|
profileOverrideUnknown: "Unknown. Choose Current DSH profile above to inspect overrides.",
|
|
@@ -6330,6 +6370,7 @@ var permissionEn = {
|
|
|
6330
6370
|
off: "Off",
|
|
6331
6371
|
restart: "Independent restart required",
|
|
6332
6372
|
coverageTitle: "Tool coverage",
|
|
6373
|
+
coverageDetails: "Details",
|
|
6333
6374
|
coverage: "Last observed for this main session. Executor readiness and network access must be checked separately.",
|
|
6334
6375
|
coverageUnavailable: "Coverage unavailable / unknown. No trusted live observation was returned.",
|
|
6335
6376
|
coverageEmpty: "No trusted tool registrations observed for this Root.",
|
|
@@ -6365,6 +6406,7 @@ var permissionEn = {
|
|
|
6365
6406
|
staged: "Unsaved rule changes",
|
|
6366
6407
|
noRules: "No saved rules.",
|
|
6367
6408
|
save: "Save",
|
|
6409
|
+
refresh: "Refresh rules",
|
|
6368
6410
|
discard: "Discard draft and reload",
|
|
6369
6411
|
dirty: "Unsaved rules draft",
|
|
6370
6412
|
saved: "Rules saved. Check synchronization below.",
|
|
@@ -6382,7 +6424,7 @@ var permissionEn = {
|
|
|
6382
6424
|
};
|
|
6383
6425
|
var permissionZh = {
|
|
6384
6426
|
title: "权限控制",
|
|
6385
|
-
rules: "
|
|
6427
|
+
rules: "全局权限规则(通过所选主会话管理)",
|
|
6386
6428
|
nativeApproval: "请在原生提示中批准命令;「允许」仅批准本次调用。",
|
|
6387
6429
|
root: "所选主会话",
|
|
6388
6430
|
noRoot: "请选择主会话以查看权限规则。",
|
|
@@ -6414,29 +6456,51 @@ var permissionZh = {
|
|
|
6414
6456
|
exact: "精确路径",
|
|
6415
6457
|
tree: "此路径及子树",
|
|
6416
6458
|
networkLimit: "网页规则仅覆盖公共网页工具,不包含私网、Shell 命令或 socket 权限。",
|
|
6417
|
-
rulesHint: "
|
|
6459
|
+
rulesHint: "规则通过所选主会话编辑,但属于全局策略而非会话私有:保存后对所有使用该策略的上下文生效。此事务与上方配置事务相互独立。若配置覆盖阻止保存,请在配置范围内编辑或清除覆盖,再刷新。",
|
|
6418
6460
|
configPolicyHint: "当前配置优先于全局配置,数组整体替换继承列表。保存后请刷新会话权限以检查实际生效状态。",
|
|
6419
|
-
configRulesHint: "
|
|
6461
|
+
configRulesHint: "此配置层的记录列表。表单只提供 ID、动作与匹配条件;导入时由宿主指定来源并保留记录版本。导入记录永不被标记为已核验批准;经核验的更改请使用下方全局规则事务。空列表表示显式整体替换为空。",
|
|
6420
6462
|
coldHint: "更改此开关需重启宿主,此前保留当前保护。重启可能取消会话。",
|
|
6421
|
-
|
|
6422
|
-
|
|
6423
|
-
|
|
6463
|
+
guardScope: "保护范围",
|
|
6464
|
+
shellSafety: "Shell 命令安全",
|
|
6465
|
+
gitWrite: "Git 写入审批",
|
|
6466
|
+
toolOutputTruncation: "工具输出截断",
|
|
6467
|
+
planValidation: "计划格式校验",
|
|
6468
|
+
questionLabels: "问题标签辅助",
|
|
6469
|
+
todoDiscipline: "Todo 纪律辅助",
|
|
6470
|
+
maxInlineBytes: "内联输出上限",
|
|
6471
|
+
maxLabelChars: "标签长度上限",
|
|
6472
|
+
unitBytes: "字节",
|
|
6473
|
+
unitChars: "字符",
|
|
6474
|
+
nativeCommands: "命令规则",
|
|
6475
|
+
nativeCommandsHint: "默认关闭。每条规则只保存一个命令模式:一个可执行程序与固定子命令备选,并允许任意后续参数。旧的精确可执行程序/参数规则会被拒绝,不会转换。其他审批、拒绝和只读限制仍有效。新条目使用询问与 workspace-write。",
|
|
6476
|
+
registrationUnresolved: "执行器身份尚未确认,请核验工具、可执行程序、环境和沙箱后再填写值。",
|
|
6424
6477
|
entryId: "条目 ID",
|
|
6425
|
-
tool: "
|
|
6426
|
-
|
|
6427
|
-
subcommand: "子命令(可选,留空省略)",
|
|
6428
|
-
args: "有序参数(JSON 字符串数组)",
|
|
6429
|
-
sandboxMode: "沙箱模式(精确)",
|
|
6478
|
+
tool: "工具",
|
|
6479
|
+
sandboxMode: "沙箱模式",
|
|
6430
6480
|
mode: "原生动作",
|
|
6431
|
-
addEntry: "
|
|
6481
|
+
addEntry: "添加条目",
|
|
6432
6482
|
removeEntry: "移除条目",
|
|
6433
|
-
noEntries: "
|
|
6483
|
+
noEntries: "没有命令条目。",
|
|
6434
6484
|
unset: "Unset——恢复继承",
|
|
6435
6485
|
inheritedEntries: "继承的条目;编辑后在此层固定为整体替换数组。",
|
|
6436
6486
|
explicitEntries: "此层显式整体替换数组。",
|
|
6437
|
-
invalidEntry: "
|
|
6487
|
+
invalidEntry: "条目无效:ID 需唯一且非空,模式语法需有效,工作目录为宿主绝对路径。草稿保留,保存已锁定。",
|
|
6488
|
+
pattern: "命令模式",
|
|
6489
|
+
patternHint: "一个可执行程序、一个子命令或用竖线分隔的备选,最后可选 * 表示参数尾部;go build|test 与 go build|test * 都允许任意后续参数。* 仅覆盖后续参数,不支持字符通配或正则表达式。",
|
|
6490
|
+
invalidPattern: "模式无效:只允许一个可执行程序与子命令位置,以空格分隔。竖线备选须为完整非空字面量,* 只能是最后一个独立 token。",
|
|
6491
|
+
patternScope: "允许任意后续参数,因此被选程序可以运行自身的构建、测试和内部脚本。这不是路径或文件系统授权;shell 管道、拼接、重定向与替换仍走普通原生路径。",
|
|
6492
|
+
restrictedFullAccess: "danger-full-access——保留自已保存的值,此处不提供创建",
|
|
6438
6493
|
rulesUnavailable: "编辑需要已打开的主会话、本地编辑权限和已同步的规则。请检查配置覆盖,重连后刷新。",
|
|
6439
|
-
|
|
6494
|
+
configRules: "导入的配置规则",
|
|
6495
|
+
inheritedRules: "继承的记录;编辑后在此层固定为整体替换列表。",
|
|
6496
|
+
explicitRules: "此层显式整体替换列表。",
|
|
6497
|
+
configRulesEmpty: "此层没有权限规则记录。",
|
|
6498
|
+
addRule: "添加导入规则",
|
|
6499
|
+
removeRule: "移除规则",
|
|
6500
|
+
advancedRules: "高级规则 JSON",
|
|
6501
|
+
invalidRule: "规则列表无效:ID 需唯一且非空,动作为 allow/ask/deny,匹配条件完整。草稿保留,保存已锁定。",
|
|
6502
|
+
recordedOperator: "记录的 operator 来源(元数据,不代表批准)",
|
|
6503
|
+
invalidPatternHint: "请修正无效模式文本后再保存。移除某一行只丢弃该行草稿并保留其他行;Unset 则用继承列表整体替换此数组。",
|
|
6440
6504
|
observedPolicy: "有效策略(含当前配置覆盖)",
|
|
6441
6505
|
profileOverrideState: "配置覆盖",
|
|
6442
6506
|
profileOverrideUnknown: "未知,请在上方选择当前 DSH 配置查看覆盖值。",
|
|
@@ -6460,6 +6524,7 @@ var permissionZh = {
|
|
|
6460
6524
|
off: "关闭",
|
|
6461
6525
|
restart: "需要另行重启",
|
|
6462
6526
|
coverageTitle: "工具覆盖范围",
|
|
6527
|
+
coverageDetails: "详细信息",
|
|
6463
6528
|
coverage: "所选主会话最近观测的覆盖范围,执行器就绪和网络访问需另行检查。",
|
|
6464
6529
|
coverageUnavailable: "覆盖不可用/未知:未返回可信的实时观测。",
|
|
6465
6530
|
coverageEmpty: "未观测到此 Root 的可信工具注册。",
|
|
@@ -6495,6 +6560,7 @@ var permissionZh = {
|
|
|
6495
6560
|
staged: "未保存的规则更改",
|
|
6496
6561
|
noRules: "尚无已保存规则。",
|
|
6497
6562
|
save: "保存",
|
|
6563
|
+
refresh: "刷新规则",
|
|
6498
6564
|
discard: "丢弃草稿并重载",
|
|
6499
6565
|
dirty: "规则草稿未保存",
|
|
6500
6566
|
saved: "规则已保存,请核对下方同步状态。",
|
|
@@ -6515,6 +6581,7 @@ var permissionZh = {
|
|
|
6515
6581
|
var import_react5 = require("react");
|
|
6516
6582
|
var import_dsh_client_ui_primitives5 = require("@deepseek-ai/dsh-client-ui-primitives");
|
|
6517
6583
|
var import_jsx_runtime7 = require("react/jsx-runtime");
|
|
6584
|
+
var ENTRIES_PATH = "permissionControl.nativeCommands.entries";
|
|
6518
6585
|
function validNativeEntries(entries) {
|
|
6519
6586
|
try {
|
|
6520
6587
|
parseNativeCommands({ entries });
|
|
@@ -6524,40 +6591,37 @@ function validNativeEntries(entries) {
|
|
|
6524
6591
|
}
|
|
6525
6592
|
}
|
|
6526
6593
|
function emptyNativeEntry() {
|
|
6527
|
-
return { id: "", mode: "ask", sandboxMode: "workspace-write", match: { tool: "bash",
|
|
6594
|
+
return { id: "", mode: "ask", sandboxMode: "workspace-write", match: { tool: "bash", workingDirectory: "", commandPattern: "" } };
|
|
6528
6595
|
}
|
|
6529
|
-
function
|
|
6530
|
-
|
|
6596
|
+
function patternValid(value) {
|
|
6597
|
+
try {
|
|
6598
|
+
parseNativeCommandPattern(value);
|
|
6599
|
+
return true;
|
|
6600
|
+
} catch {
|
|
6601
|
+
return false;
|
|
6602
|
+
}
|
|
6603
|
+
}
|
|
6604
|
+
function TextField({ id: id2, label, value, disabled, onChange }) {
|
|
6531
6605
|
return /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)("div", { className: "dsmm-field", children: [
|
|
6532
|
-
/* @__PURE__ */ (0, import_jsx_runtime7.jsx)("label", { htmlFor: id2, children:
|
|
6533
|
-
/* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
|
|
6534
|
-
|
|
6535
|
-
|
|
6536
|
-
|
|
6537
|
-
|
|
6538
|
-
|
|
6539
|
-
|
|
6540
|
-
|
|
6541
|
-
|
|
6542
|
-
|
|
6606
|
+
/* @__PURE__ */ (0, import_jsx_runtime7.jsx)("label", { htmlFor: id2, children: label }),
|
|
6607
|
+
/* @__PURE__ */ (0, import_jsx_runtime7.jsx)(import_dsh_client_ui_primitives5.Input, { className: "dsmm-input", id: id2, value, maxLength: 32768, disabled, required: true, onChange: (event) => onChange(event.currentTarget.value) })
|
|
6608
|
+
] });
|
|
6609
|
+
}
|
|
6610
|
+
function Pattern({ value, controller, name: name2, disabled, onChange, t }) {
|
|
6611
|
+
const state = (0, import_react5.useSyncExternalStore)(controller.subscribe, controller.getSnapshot), id2 = (0, import_react5.useId)(), raw = state.raw[name2], text5 = raw?.text ?? value, bad = raw?.invalid === true;
|
|
6612
|
+
return /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)("div", { className: "dsmm-field", children: [
|
|
6613
|
+
/* @__PURE__ */ (0, import_jsx_runtime7.jsx)("label", { htmlFor: `${id2}-pattern`, children: t("pattern") }),
|
|
6614
|
+
/* @__PURE__ */ (0, import_jsx_runtime7.jsx)(import_dsh_client_ui_primitives5.Input, { className: "dsmm-input", id: `${id2}-pattern`, value: text5, maxLength: 32768, disabled, required: true, "aria-invalid": bad, "aria-describedby": bad ? `${id2}-error` : void 0, spellCheck: false, autoComplete: "off", onChange: (event) => {
|
|
6615
|
+
const next = event.currentTarget.value, valid = patternValid(next);
|
|
6616
|
+
controller.setRaw(name2, next, !valid);
|
|
6617
|
+
if (valid) onChange(next);
|
|
6543
6618
|
} }),
|
|
6544
|
-
/* @__PURE__ */ (0, import_jsx_runtime7.jsx)("p", { id: `${id2}-error`, className: "dsmm-hint", children:
|
|
6619
|
+
bad && /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("p", { id: `${id2}-error`, className: "dsmm-hint", children: t("invalidPattern") })
|
|
6545
6620
|
] });
|
|
6546
6621
|
}
|
|
6547
|
-
function Entry({ entry, index, controller, disabled,
|
|
6548
|
-
const id2 = (0, import_react5.useId)()
|
|
6622
|
+
function Entry({ entry, index, controller, disabled, change, remove, t }) {
|
|
6623
|
+
const id2 = (0, import_react5.useId)(), match = entry.match, row = `${ENTRIES_PATH}.${index}`;
|
|
6549
6624
|
const valid = validNativeEntries([entry]);
|
|
6550
|
-
const text5 = (key, label) => /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)("div", { className: "dsmm-field", children: [
|
|
6551
|
-
/* @__PURE__ */ (0, import_jsx_runtime7.jsx)("label", { htmlFor: `${id2}-${key}`, children: t(label) }),
|
|
6552
|
-
/* @__PURE__ */ (0, import_jsx_runtime7.jsx)(import_dsh_client_ui_primitives5.Input, { className: "dsmm-input", id: `${id2}-${key}`, value: key === "id" ? entry.id : entry.match[key] ?? "", maxLength: 32768, disabled, required: key !== "subcommand", onChange: (event) => {
|
|
6553
|
-
const value = event.currentTarget.value;
|
|
6554
|
-
if (key === "id") change({ ...entry, id: value });
|
|
6555
|
-
else if (key === "subcommand" && value === "") {
|
|
6556
|
-
const { subcommand: _omitted, ...match } = entry.match;
|
|
6557
|
-
change({ ...entry, match });
|
|
6558
|
-
} else change({ ...entry, match: { ...entry.match, [key]: value } });
|
|
6559
|
-
} })
|
|
6560
|
-
] });
|
|
6561
6625
|
return /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)("fieldset", { "aria-describedby": !valid ? `${id2}-error` : void 0, children: [
|
|
6562
6626
|
/* @__PURE__ */ (0, import_jsx_runtime7.jsxs)("legend", { children: [
|
|
6563
6627
|
t("nativeCommands"),
|
|
@@ -6565,29 +6629,33 @@ function Entry({ entry, index, controller, disabled, removeDisabled, change, rem
|
|
|
6565
6629
|
index + 1
|
|
6566
6630
|
] }),
|
|
6567
6631
|
!valid && /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("p", { className: "dsmm-hint", id: `${id2}-error`, children: t("invalidEntry") }),
|
|
6568
|
-
|
|
6632
|
+
/* @__PURE__ */ (0, import_jsx_runtime7.jsx)(TextField, { id: `${id2}-id`, label: t("entryId"), value: entry.id, disabled, onChange: (value) => change({ ...entry, id: value }) }),
|
|
6569
6633
|
/* @__PURE__ */ (0, import_jsx_runtime7.jsxs)("div", { className: "dsmm-field", children: [
|
|
6570
6634
|
/* @__PURE__ */ (0, import_jsx_runtime7.jsx)("label", { htmlFor: `${id2}-tool`, children: t("tool") }),
|
|
6571
|
-
/* @__PURE__ */ (0, import_jsx_runtime7.jsx)("select", { id: `${id2}-tool`, disabled, value:
|
|
6635
|
+
/* @__PURE__ */ (0, import_jsx_runtime7.jsx)("select", { id: `${id2}-tool`, disabled, value: match.tool, onChange: (event) => {
|
|
6572
6636
|
const tool = event.currentTarget.value;
|
|
6573
|
-
if (tool === "bash" || tool === "pwsh") change({ ...entry, match: { ...
|
|
6637
|
+
if (tool === "bash" || tool === "pwsh") change({ ...entry, match: { ...match, tool } });
|
|
6574
6638
|
}, children: ["bash", "pwsh"].map((value) => /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("option", { value, children: value }, value)) })
|
|
6575
6639
|
] }),
|
|
6576
|
-
|
|
6577
|
-
|
|
6578
|
-
|
|
6579
|
-
|
|
6640
|
+
/* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
|
|
6641
|
+
Pattern,
|
|
6642
|
+
{
|
|
6643
|
+
value: match.commandPattern,
|
|
6644
|
+
controller,
|
|
6645
|
+
name: `${row}.commandPattern`,
|
|
6646
|
+
disabled,
|
|
6647
|
+
t,
|
|
6648
|
+
onChange: (commandPattern) => change({ ...entry, match: { ...match, commandPattern } })
|
|
6649
|
+
}
|
|
6650
|
+
),
|
|
6651
|
+
/* @__PURE__ */ (0, import_jsx_runtime7.jsx)(TextField, { id: `${id2}-workingDirectory`, label: t("cwd"), value: match.workingDirectory, disabled, onChange: (workingDirectory) => change({ ...entry, match: { ...match, workingDirectory } }) }),
|
|
6580
6652
|
/* @__PURE__ */ (0, import_jsx_runtime7.jsxs)("div", { className: "dsmm-field", children: [
|
|
6581
6653
|
/* @__PURE__ */ (0, import_jsx_runtime7.jsx)("label", { htmlFor: `${id2}-sandbox`, children: t("sandboxMode") }),
|
|
6582
6654
|
/* @__PURE__ */ (0, import_jsx_runtime7.jsxs)("select", { id: `${id2}-sandbox`, disabled, value: entry.sandboxMode, onChange: (event) => {
|
|
6583
6655
|
if (event.currentTarget.value === "workspace-write") change({ ...entry, sandboxMode: "workspace-write" });
|
|
6584
6656
|
}, children: [
|
|
6585
6657
|
/* @__PURE__ */ (0, import_jsx_runtime7.jsx)("option", { value: "workspace-write", children: "workspace-write" }),
|
|
6586
|
-
entry.sandboxMode === "danger-full-access" && /* @__PURE__ */ (0, import_jsx_runtime7.
|
|
6587
|
-
"danger-full-access (",
|
|
6588
|
-
t("source"),
|
|
6589
|
-
")"
|
|
6590
|
-
] })
|
|
6658
|
+
entry.sandboxMode === "danger-full-access" && /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("option", { value: "danger-full-access", disabled: true, children: t("restrictedFullAccess") })
|
|
6591
6659
|
] })
|
|
6592
6660
|
] }),
|
|
6593
6661
|
/* @__PURE__ */ (0, import_jsx_runtime7.jsxs)("div", { className: "dsmm-field", children: [
|
|
@@ -6600,7 +6668,7 @@ function Entry({ entry, index, controller, disabled, removeDisabled, change, rem
|
|
|
6600
6668
|
/* @__PURE__ */ (0, import_jsx_runtime7.jsx)("option", { value: "allow", children: t("action:allow") })
|
|
6601
6669
|
] })
|
|
6602
6670
|
] }),
|
|
6603
|
-
/* @__PURE__ */ (0, import_jsx_runtime7.jsxs)(import_dsh_client_ui_primitives5.Button, { type: "button", variant: "outline", disabled
|
|
6671
|
+
/* @__PURE__ */ (0, import_jsx_runtime7.jsxs)(import_dsh_client_ui_primitives5.Button, { type: "button", variant: "outline", disabled, onClick: remove, children: [
|
|
6604
6672
|
t("removeEntry"),
|
|
6605
6673
|
" ",
|
|
6606
6674
|
index + 1
|
|
@@ -6608,26 +6676,40 @@ function Entry({ entry, index, controller, disabled, removeDisabled, change, rem
|
|
|
6608
6676
|
] });
|
|
6609
6677
|
}
|
|
6610
6678
|
function NativeCommandEntries({ value, inherited, controller, disabled, onChange, setInvalid, t }) {
|
|
6611
|
-
const entries = value ?? inherited,
|
|
6679
|
+
const entries = value ?? inherited, name2 = ENTRIES_PATH;
|
|
6612
6680
|
const state = (0, import_react5.useSyncExternalStore)(controller.subscribe, controller.getSnapshot);
|
|
6613
|
-
const
|
|
6681
|
+
const invalidRows = state.invalidFields.filter((path) => path.startsWith(`${name2}.`) && path.endsWith(".commandPattern"));
|
|
6614
6682
|
const valid = validNativeEntries(entries);
|
|
6615
6683
|
const change = (next) => {
|
|
6616
|
-
setInvalid(
|
|
6684
|
+
setInvalid(name2, !validNativeEntries(next ?? inherited));
|
|
6617
6685
|
onChange(next);
|
|
6618
6686
|
};
|
|
6687
|
+
const remove = (index) => {
|
|
6688
|
+
const drafts = Object.entries(state.raw).flatMap(([path, draft2]) => {
|
|
6689
|
+
if (!path.startsWith(`${name2}.`)) return [];
|
|
6690
|
+
const [row, ...field] = path.slice(name2.length + 1).split(".");
|
|
6691
|
+
const position = Number(row);
|
|
6692
|
+
if (!Number.isInteger(position) || field.length === 0 || position === index) return [];
|
|
6693
|
+
return [{ path: `${name2}.${position > index ? position - 1 : position}.${field.join(".")}`, draft: draft2 }];
|
|
6694
|
+
});
|
|
6695
|
+
controller.clearRaw(name2);
|
|
6696
|
+
for (const draft2 of drafts) controller.setRaw(draft2.path, draft2.draft.text, draft2.draft.invalid);
|
|
6697
|
+
change(entries.filter((_, position) => position !== index));
|
|
6698
|
+
};
|
|
6619
6699
|
return /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)("details", { className: "dsmm-deployment-group", children: [
|
|
6620
6700
|
/* @__PURE__ */ (0, import_jsx_runtime7.jsxs)("summary", { children: [
|
|
6621
6701
|
t("nativeCommands"),
|
|
6622
6702
|
" ",
|
|
6623
|
-
/* @__PURE__ */ (0, import_jsx_runtime7.jsx)("code", { children:
|
|
6703
|
+
/* @__PURE__ */ (0, import_jsx_runtime7.jsx)("code", { children: name2 })
|
|
6624
6704
|
] }),
|
|
6625
6705
|
/* @__PURE__ */ (0, import_jsx_runtime7.jsxs)("div", { className: "dsmm-structured", children: [
|
|
6626
6706
|
/* @__PURE__ */ (0, import_jsx_runtime7.jsx)("p", { className: "dsmm-hint", children: t("nativeCommandsHint") }),
|
|
6707
|
+
/* @__PURE__ */ (0, import_jsx_runtime7.jsx)("p", { className: "dsmm-hint", children: t("patternHint") }),
|
|
6708
|
+
/* @__PURE__ */ (0, import_jsx_runtime7.jsx)("p", { className: "dsmm-hint", children: t("patternScope") }),
|
|
6627
6709
|
/* @__PURE__ */ (0, import_jsx_runtime7.jsx)("p", { className: "dsmm-hint", children: t("registrationUnresolved") }),
|
|
6628
6710
|
/* @__PURE__ */ (0, import_jsx_runtime7.jsx)("p", { className: "dsmm-hint", children: t(value === void 0 ? "inheritedEntries" : "explicitEntries") }),
|
|
6629
6711
|
!valid && /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("p", { className: "dsmm-issue", role: "alert", children: t("invalidEntry") }),
|
|
6630
|
-
|
|
6712
|
+
invalidRows.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("p", { className: "dsmm-hint", children: t("invalidPatternHint") }),
|
|
6631
6713
|
entries.length === 0 && /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("p", { children: t("noEntries") }),
|
|
6632
6714
|
entries.map((entry, index) => /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
|
|
6633
6715
|
Entry,
|
|
@@ -6636,20 +6718,16 @@ function NativeCommandEntries({ value, inherited, controller, disabled, onChange
|
|
|
6636
6718
|
index,
|
|
6637
6719
|
controller,
|
|
6638
6720
|
disabled,
|
|
6639
|
-
removeDisabled: invalidArgs.length > 0,
|
|
6640
6721
|
t,
|
|
6641
6722
|
change: (next) => change(entries.map((row, position) => position === index ? next : row)),
|
|
6642
|
-
remove: () =>
|
|
6643
|
-
controller.clearRaw(name);
|
|
6644
|
-
change(entries.filter((_, position) => position !== index));
|
|
6645
|
-
}
|
|
6723
|
+
remove: () => remove(index)
|
|
6646
6724
|
},
|
|
6647
6725
|
index
|
|
6648
6726
|
)),
|
|
6649
6727
|
/* @__PURE__ */ (0, import_jsx_runtime7.jsxs)("div", { className: "dsmm-actions", children: [
|
|
6650
6728
|
/* @__PURE__ */ (0, import_jsx_runtime7.jsx)(import_dsh_client_ui_primitives5.Button, { type: "button", variant: "outline", disabled: disabled || entries.length >= 1024, onClick: () => change([...entries, emptyNativeEntry()]), children: t("addEntry") }),
|
|
6651
|
-
/* @__PURE__ */ (0, import_jsx_runtime7.jsx)(import_dsh_client_ui_primitives5.Button, { type: "button", variant: "outline", "data-dsmm-unset":
|
|
6652
|
-
controller.clearRaw(
|
|
6729
|
+
/* @__PURE__ */ (0, import_jsx_runtime7.jsx)(import_dsh_client_ui_primitives5.Button, { type: "button", variant: "outline", "data-dsmm-unset": name2, disabled: disabled || value === void 0 && invalidRows.length === 0, onClick: () => {
|
|
6730
|
+
controller.clearRaw(name2);
|
|
6653
6731
|
change(void 0);
|
|
6654
6732
|
}, children: t("unset") })
|
|
6655
6733
|
] })
|
|
@@ -6657,12 +6735,174 @@ function NativeCommandEntries({ value, inherited, controller, disabled, onChange
|
|
|
6657
6735
|
] });
|
|
6658
6736
|
}
|
|
6659
6737
|
|
|
6660
|
-
// src/client/
|
|
6738
|
+
// src/client/PermissionRuleEntries.tsx
|
|
6739
|
+
var import_react6 = require("react");
|
|
6740
|
+
var import_dsh_client_ui_primitives6 = require("@deepseek-ai/dsh-client-ui-primitives");
|
|
6661
6741
|
var import_jsx_runtime8 = require("react/jsx-runtime");
|
|
6742
|
+
var actions = ["allow", "ask", "deny"];
|
|
6743
|
+
var kinds = ["outside-read", "shell", "webSearch", "webFetch"];
|
|
6744
|
+
var name = "permissionControl.rules";
|
|
6745
|
+
function validPermissionRules(value) {
|
|
6746
|
+
try {
|
|
6747
|
+
parsePermissionRules(value);
|
|
6748
|
+
return true;
|
|
6749
|
+
} catch {
|
|
6750
|
+
return false;
|
|
6751
|
+
}
|
|
6752
|
+
}
|
|
6753
|
+
function newMatch(kind) {
|
|
6754
|
+
return kind === "outside-read" ? { kind, path: "", scope: "exact" } : kind === "shell" ? { kind, executable: "", command: "", workingDirectory: "" } : { kind };
|
|
6755
|
+
}
|
|
6756
|
+
function newRule() {
|
|
6757
|
+
return { id: "", action: "ask", match: newMatch("outside-read"), source: { kind: "user-import", label: "configuration" }, revision: 0, revoked: false };
|
|
6758
|
+
}
|
|
6759
|
+
function Row({ rule, index, disabled, change, remove, t }) {
|
|
6760
|
+
const id2 = (0, import_react6.useId)();
|
|
6761
|
+
const field = (key) => /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)("div", { className: "dsmm-field", children: [
|
|
6762
|
+
/* @__PURE__ */ (0, import_jsx_runtime8.jsx)("label", { htmlFor: `${id2}-${key}`, children: t(key === "workingDirectory" ? "cwd" : key) }),
|
|
6763
|
+
/* @__PURE__ */ (0, import_jsx_runtime8.jsx)(import_dsh_client_ui_primitives6.Input, { className: "dsmm-input", id: `${id2}-${key}`, required: true, maxLength: 32768, disabled, value: key in rule.match ? String(Reflect.get(rule.match, key)) : "", onChange: (event) => change({ ...rule, match: { ...rule.match, [key]: event.currentTarget.value } }) })
|
|
6764
|
+
] });
|
|
6765
|
+
return /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)("fieldset", { children: [
|
|
6766
|
+
/* @__PURE__ */ (0, import_jsx_runtime8.jsx)("legend", { children: rule.id === "" ? `${t("newRule")} ${index + 1}` : rule.id }),
|
|
6767
|
+
/* @__PURE__ */ (0, import_jsx_runtime8.jsxs)("p", { children: [
|
|
6768
|
+
t(rule.revoked ? "revoked" : "active"),
|
|
6769
|
+
" · ",
|
|
6770
|
+
t(`action:${rule.action}`)
|
|
6771
|
+
] }),
|
|
6772
|
+
/* @__PURE__ */ (0, import_jsx_runtime8.jsxs)("dl", { className: "dsmm-child-meta", children: [
|
|
6773
|
+
/* @__PURE__ */ (0, import_jsx_runtime8.jsx)("dt", { children: t("source") }),
|
|
6774
|
+
/* @__PURE__ */ (0, import_jsx_runtime8.jsx)("dd", { children: rule.source.kind === "operator" ? `${t("recordedOperator")} · ${rule.source.savedAt}` : `${t("imported")} · ${rule.source.label}` }),
|
|
6775
|
+
/* @__PURE__ */ (0, import_jsx_runtime8.jsx)("dt", { children: t("recordVersion") }),
|
|
6776
|
+
/* @__PURE__ */ (0, import_jsx_runtime8.jsx)("dd", { children: rule.revision })
|
|
6777
|
+
] }),
|
|
6778
|
+
/* @__PURE__ */ (0, import_jsx_runtime8.jsxs)("div", { className: "dsmm-field", children: [
|
|
6779
|
+
/* @__PURE__ */ (0, import_jsx_runtime8.jsx)("label", { htmlFor: `${id2}-id`, children: t("id") }),
|
|
6780
|
+
/* @__PURE__ */ (0, import_jsx_runtime8.jsx)(import_dsh_client_ui_primitives6.Input, { className: "dsmm-input", id: `${id2}-id`, required: true, maxLength: 256, disabled, value: rule.id, onChange: (event) => change({ ...rule, id: event.currentTarget.value }) })
|
|
6781
|
+
] }),
|
|
6782
|
+
/* @__PURE__ */ (0, import_jsx_runtime8.jsxs)("div", { className: "dsmm-field", children: [
|
|
6783
|
+
/* @__PURE__ */ (0, import_jsx_runtime8.jsx)("label", { htmlFor: `${id2}-action`, children: t("action") }),
|
|
6784
|
+
/* @__PURE__ */ (0, import_jsx_runtime8.jsx)("select", { id: `${id2}-action`, disabled, value: rule.action, onChange: (event) => {
|
|
6785
|
+
const action2 = actions.find((value) => value === event.currentTarget.value);
|
|
6786
|
+
if (action2 !== void 0) change({ ...rule, action: action2 });
|
|
6787
|
+
}, children: actions.map((action2) => /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("option", { value: action2, children: t(`action:${action2}`) }, action2)) })
|
|
6788
|
+
] }),
|
|
6789
|
+
/* @__PURE__ */ (0, import_jsx_runtime8.jsxs)("div", { className: "dsmm-field", children: [
|
|
6790
|
+
/* @__PURE__ */ (0, import_jsx_runtime8.jsx)("label", { htmlFor: `${id2}-kind`, children: t("match") }),
|
|
6791
|
+
/* @__PURE__ */ (0, import_jsx_runtime8.jsx)("select", { id: `${id2}-kind`, disabled, value: rule.match.kind, onChange: (event) => {
|
|
6792
|
+
const kind = kinds.find((value) => value === event.currentTarget.value);
|
|
6793
|
+
if (kind !== void 0) change({ ...rule, match: newMatch(kind) });
|
|
6794
|
+
}, children: kinds.map((kind) => /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("option", { value: kind, children: t(`kind:${kind}`) }, kind)) })
|
|
6795
|
+
] }),
|
|
6796
|
+
rule.match.kind === "outside-read" && /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)(import_jsx_runtime8.Fragment, { children: [
|
|
6797
|
+
field("path"),
|
|
6798
|
+
/* @__PURE__ */ (0, import_jsx_runtime8.jsxs)("div", { className: "dsmm-field", children: [
|
|
6799
|
+
/* @__PURE__ */ (0, import_jsx_runtime8.jsx)("label", { htmlFor: `${id2}-scope`, children: t("pathScope") }),
|
|
6800
|
+
/* @__PURE__ */ (0, import_jsx_runtime8.jsxs)("select", { id: `${id2}-scope`, disabled, value: rule.match.scope, onChange: (event) => {
|
|
6801
|
+
const scope = event.currentTarget.value;
|
|
6802
|
+
if (rule.match.kind === "outside-read" && (scope === "exact" || scope === "tree")) change({ ...rule, match: { ...rule.match, scope } });
|
|
6803
|
+
}, children: [
|
|
6804
|
+
/* @__PURE__ */ (0, import_jsx_runtime8.jsx)("option", { value: "exact", children: t("exact") }),
|
|
6805
|
+
/* @__PURE__ */ (0, import_jsx_runtime8.jsx)("option", { value: "tree", children: t("tree") })
|
|
6806
|
+
] })
|
|
6807
|
+
] })
|
|
6808
|
+
] }),
|
|
6809
|
+
rule.match.kind === "shell" && /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)(import_jsx_runtime8.Fragment, { children: [
|
|
6810
|
+
field("executable"),
|
|
6811
|
+
field("command"),
|
|
6812
|
+
field("workingDirectory")
|
|
6813
|
+
] }),
|
|
6814
|
+
/* @__PURE__ */ (0, import_jsx_runtime8.jsxs)(import_dsh_client_ui_primitives6.Button, { type: "button", variant: "outline", disabled, onClick: remove, children: [
|
|
6815
|
+
t("removeRule"),
|
|
6816
|
+
" ",
|
|
6817
|
+
index + 1
|
|
6818
|
+
] })
|
|
6819
|
+
] });
|
|
6820
|
+
}
|
|
6821
|
+
function PermissionRuleEntries({ value, inherited, controller, disabled, onChange, expanded, onExpandedChange, t }) {
|
|
6822
|
+
const state = (0, import_react6.useSyncExternalStore)(controller.subscribe, controller.getSnapshot), id2 = (0, import_react6.useId)();
|
|
6823
|
+
const raw = state.raw[name], locked = raw?.invalid === true, entries = value ?? inherited, valid = validPermissionRules(entries);
|
|
6824
|
+
const text5 = raw?.text ?? (value === void 0 ? "" : JSON.stringify(value, null, 2));
|
|
6825
|
+
const change = (next) => {
|
|
6826
|
+
if (raw !== void 0) controller.clearRaw(name);
|
|
6827
|
+
controller.setInvalid(name, !validPermissionRules(next));
|
|
6828
|
+
onChange(next);
|
|
6829
|
+
};
|
|
6830
|
+
const remove = (index) => change(entries.filter((_, position) => position !== index));
|
|
6831
|
+
const held = disabled || locked;
|
|
6832
|
+
return /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)("details", { className: "dsmm-deployment-group", "data-field": name, open: expanded, onToggle: (event) => onExpandedChange?.(event.currentTarget.open), children: [
|
|
6833
|
+
/* @__PURE__ */ (0, import_jsx_runtime8.jsxs)("summary", { children: [
|
|
6834
|
+
t("configRules"),
|
|
6835
|
+
" ",
|
|
6836
|
+
/* @__PURE__ */ (0, import_jsx_runtime8.jsx)("code", { children: name })
|
|
6837
|
+
] }),
|
|
6838
|
+
/* @__PURE__ */ (0, import_jsx_runtime8.jsxs)("div", { className: "dsmm-structured", children: [
|
|
6839
|
+
/* @__PURE__ */ (0, import_jsx_runtime8.jsx)("p", { className: "dsmm-hint", children: t("configRulesHint") }),
|
|
6840
|
+
/* @__PURE__ */ (0, import_jsx_runtime8.jsx)("p", { className: "dsmm-hint", children: t(value === void 0 ? "inheritedRules" : "explicitRules") }),
|
|
6841
|
+
!valid && /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("p", { className: "dsmm-issue", role: "alert", children: t("invalidRule") }),
|
|
6842
|
+
entries.length === 0 && /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("p", { children: t("configRulesEmpty") }),
|
|
6843
|
+
entries.map((rule, index) => /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
|
|
6844
|
+
Row,
|
|
6845
|
+
{
|
|
6846
|
+
rule,
|
|
6847
|
+
index,
|
|
6848
|
+
disabled: held,
|
|
6849
|
+
t,
|
|
6850
|
+
change: (next) => change(entries.map((row, position) => position === index ? next : row)),
|
|
6851
|
+
remove: () => remove(index)
|
|
6852
|
+
},
|
|
6853
|
+
index
|
|
6854
|
+
)),
|
|
6855
|
+
/* @__PURE__ */ (0, import_jsx_runtime8.jsxs)("div", { className: "dsmm-actions", children: [
|
|
6856
|
+
/* @__PURE__ */ (0, import_jsx_runtime8.jsx)(import_dsh_client_ui_primitives6.Button, { type: "button", variant: "outline", disabled: held || entries.length >= 1024, onClick: () => change([...entries, newRule()]), children: t("addRule") }),
|
|
6857
|
+
/* @__PURE__ */ (0, import_jsx_runtime8.jsx)(import_dsh_client_ui_primitives6.Button, { type: "button", variant: "outline", "data-dsmm-unset": name, disabled: disabled || value === void 0 && raw === void 0, onClick: () => {
|
|
6858
|
+
controller.clearRaw(name);
|
|
6859
|
+
onChange(void 0);
|
|
6860
|
+
}, children: t("unset") })
|
|
6861
|
+
] }),
|
|
6862
|
+
/* @__PURE__ */ (0, import_jsx_runtime8.jsxs)("details", { children: [
|
|
6863
|
+
/* @__PURE__ */ (0, import_jsx_runtime8.jsx)("summary", { id: `${id2}-advanced-label`, children: t("advancedRules") }),
|
|
6864
|
+
/* @__PURE__ */ (0, import_jsx_runtime8.jsxs)("div", { className: "dsmm-field", children: [
|
|
6865
|
+
/* @__PURE__ */ (0, import_jsx_runtime8.jsx)("textarea", { id: `${id2}-advanced`, rows: 6, maxLength: 32768, value: text5, disabled, "aria-labelledby": `${id2}-advanced-label`, "aria-invalid": locked, "aria-describedby": `${id2}-error`, onChange: (event) => {
|
|
6866
|
+
const next = event.currentTarget.value;
|
|
6867
|
+
let parsed, ok = false;
|
|
6868
|
+
try {
|
|
6869
|
+
parsed = parseAdvanced(next);
|
|
6870
|
+
ok = parsed === void 0 || validPermissionRules(parsed);
|
|
6871
|
+
} catch {
|
|
6872
|
+
ok = false;
|
|
6873
|
+
}
|
|
6874
|
+
controller.setRaw(name, next, !ok);
|
|
6875
|
+
if (ok) onChange(parsed);
|
|
6876
|
+
} }),
|
|
6877
|
+
/* @__PURE__ */ (0, import_jsx_runtime8.jsx)("p", { id: `${id2}-error`, className: "dsmm-hint", children: locked ? t("invalidRule") : "" })
|
|
6878
|
+
] })
|
|
6879
|
+
] })
|
|
6880
|
+
] })
|
|
6881
|
+
] });
|
|
6882
|
+
}
|
|
6883
|
+
|
|
6884
|
+
// src/client/DeploymentFields.tsx
|
|
6885
|
+
var import_jsx_runtime9 = require("react/jsx-runtime");
|
|
6662
6886
|
var permissionText = (t) => (key) => (t("global") === "DSMM 全局配置" ? permissionZh : permissionEn)[key];
|
|
6663
6887
|
function fieldLabel(path, t) {
|
|
6664
6888
|
const key = path.at(-1);
|
|
6665
6889
|
if (path[0] === "permissionControl" && ["outsideReads", "webSearch", "webFetch", "rules", "nativeCommands", "rule"].includes(key)) return permissionText(t)(key);
|
|
6890
|
+
if (path[0] === "guards") {
|
|
6891
|
+
const guard = {
|
|
6892
|
+
scope: "guardScope",
|
|
6893
|
+
shellCommandSafety: "shellSafety",
|
|
6894
|
+
gitWriteGuard: "gitWrite",
|
|
6895
|
+
toolOutputTruncation: "toolOutputTruncation",
|
|
6896
|
+
planFormatValidation: "planValidation",
|
|
6897
|
+
questionLabelHelper: "questionLabels",
|
|
6898
|
+
todoDisciplineHelper: "todoDiscipline",
|
|
6899
|
+
enabled: "enabled",
|
|
6900
|
+
maxInlineBytes: "maxInlineBytes",
|
|
6901
|
+
maxLabelChars: "maxLabelChars"
|
|
6902
|
+
};
|
|
6903
|
+
const mapped = guard[key];
|
|
6904
|
+
if (mapped !== void 0) return permissionText(t)(mapped);
|
|
6905
|
+
}
|
|
6666
6906
|
const item = deploymentFieldLabels[key];
|
|
6667
6907
|
return item === void 0 ? key.replace(/^dsmm-/u, "").replace(/([a-z])([A-Z])/gu, "$1 $2") : item[t("global") === "DSMM 全局配置" ? 1 : 0];
|
|
6668
6908
|
}
|
|
@@ -6673,24 +6913,24 @@ function displayValue(value, t) {
|
|
|
6673
6913
|
return text5.length > 120 ? `${text5.slice(0, 120)}…` : text5;
|
|
6674
6914
|
}
|
|
6675
6915
|
function AdvancedField({ schema, path, controller, inherited, upper, expanded, onExpandedChange, t }) {
|
|
6676
|
-
const state = (0,
|
|
6677
|
-
const value = at(state.draft, path), raw = state.raw[
|
|
6678
|
-
return /* @__PURE__ */ (0,
|
|
6679
|
-
/* @__PURE__ */ (0,
|
|
6916
|
+
const state = (0, import_react7.useSyncExternalStore)(controller.subscribe, controller.getSnapshot), id2 = (0, import_react7.useId)(), name2 = path.join(".");
|
|
6917
|
+
const value = at(state.draft, path), raw = state.raw[name2], text5 = raw?.text ?? (value === void 0 ? "" : JSON.stringify(value, null, 2)), invalid2 = raw?.invalid === true;
|
|
6918
|
+
return /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)("details", { className: "dsmm-deployment-group", "data-field": name2, open: expanded, onToggle: (event) => onExpandedChange?.(event.currentTarget.open), children: [
|
|
6919
|
+
/* @__PURE__ */ (0, import_jsx_runtime9.jsxs)("summary", { id: `${id2}-label`, children: [
|
|
6680
6920
|
fieldLabel(path, t),
|
|
6681
6921
|
" · ",
|
|
6682
6922
|
t("advanced")
|
|
6683
6923
|
] }),
|
|
6684
|
-
/* @__PURE__ */ (0,
|
|
6685
|
-
/* @__PURE__ */ (0,
|
|
6686
|
-
path[0] === "permissionControl" && /* @__PURE__ */ (0,
|
|
6687
|
-
/* @__PURE__ */ (0,
|
|
6688
|
-
upper !== void 0 && /* @__PURE__ */ (0,
|
|
6924
|
+
/* @__PURE__ */ (0, import_jsx_runtime9.jsxs)("div", { className: "dsmm-field", children: [
|
|
6925
|
+
/* @__PURE__ */ (0, import_jsx_runtime9.jsx)("p", { className: "dsmm-hint", id: `${id2}-hint`, children: t("advancedHint") }),
|
|
6926
|
+
path[0] === "permissionControl" && /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("p", { className: "dsmm-hint", children: permissionText(t)("configRulesHint") }),
|
|
6927
|
+
/* @__PURE__ */ (0, import_jsx_runtime9.jsx)("p", { className: "dsmm-hint", children: t(value === void 0 ? "inherit" : "explicit") }),
|
|
6928
|
+
upper !== void 0 && /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)("p", { className: "dsmm-hint", children: [
|
|
6689
6929
|
t("profileSource"),
|
|
6690
6930
|
": ",
|
|
6691
6931
|
displayValue(upper, t)
|
|
6692
6932
|
] }),
|
|
6693
|
-
/* @__PURE__ */ (0,
|
|
6933
|
+
/* @__PURE__ */ (0, import_jsx_runtime9.jsx)("textarea", { id: id2, rows: 6, maxLength: 32768, value: text5, disabled: !controller.canEdit(), "aria-labelledby": `${id2}-label`, "aria-invalid": invalid2, "aria-describedby": `${id2}-hint ${id2}-error`, onChange: (event) => {
|
|
6694
6934
|
const next = event.currentTarget.value;
|
|
6695
6935
|
let parsed, valid = true;
|
|
6696
6936
|
try {
|
|
@@ -6700,85 +6940,88 @@ function AdvancedField({ schema, path, controller, inherited, upper, expanded, o
|
|
|
6700
6940
|
} catch {
|
|
6701
6941
|
valid = false;
|
|
6702
6942
|
}
|
|
6703
|
-
controller.setRaw(
|
|
6943
|
+
controller.setRaw(name2, next, !valid);
|
|
6704
6944
|
if (valid) controller.edit(path, parsed);
|
|
6705
6945
|
} }),
|
|
6706
|
-
/* @__PURE__ */ (0,
|
|
6707
|
-
/* @__PURE__ */ (0,
|
|
6708
|
-
controller.clearRaw(
|
|
6946
|
+
/* @__PURE__ */ (0, import_jsx_runtime9.jsx)("p", { id: `${id2}-error`, className: "dsmm-hint", children: invalid2 ? t("invalid") : "" }),
|
|
6947
|
+
/* @__PURE__ */ (0, import_jsx_runtime9.jsx)(import_dsh_client_ui_primitives7.Button, { type: "button", variant: "outline", "data-dsmm-unset": name2, disabled: !controller.canEdit() || value === void 0 && raw === void 0, onClick: () => {
|
|
6948
|
+
controller.clearRaw(name2);
|
|
6709
6949
|
controller.edit(path, void 0);
|
|
6710
6950
|
}, children: t("unset") }),
|
|
6711
|
-
/* @__PURE__ */ (0,
|
|
6712
|
-
/* @__PURE__ */ (0,
|
|
6713
|
-
/* @__PURE__ */ (0,
|
|
6951
|
+
/* @__PURE__ */ (0, import_jsx_runtime9.jsxs)("details", { children: [
|
|
6952
|
+
/* @__PURE__ */ (0, import_jsx_runtime9.jsx)("summary", { children: t("inherit") }),
|
|
6953
|
+
/* @__PURE__ */ (0, import_jsx_runtime9.jsx)("pre", { children: JSON.stringify(inherited, null, 2) })
|
|
6714
6954
|
] }),
|
|
6715
|
-
/* @__PURE__ */ (0,
|
|
6716
|
-
/* @__PURE__ */ (0,
|
|
6717
|
-
/* @__PURE__ */ (0,
|
|
6955
|
+
/* @__PURE__ */ (0, import_jsx_runtime9.jsxs)("details", { children: [
|
|
6956
|
+
/* @__PURE__ */ (0, import_jsx_runtime9.jsx)("summary", { children: "schema" }),
|
|
6957
|
+
/* @__PURE__ */ (0, import_jsx_runtime9.jsx)("pre", { children: JSON.stringify(schema, null, 2) })
|
|
6718
6958
|
] })
|
|
6719
6959
|
] })
|
|
6720
6960
|
] });
|
|
6721
6961
|
}
|
|
6722
6962
|
function ScalarField({ schema, path, controller, inherited, t }) {
|
|
6723
|
-
const state = (0,
|
|
6724
|
-
const value = at(state.draft, path), raw = state.raw[
|
|
6725
|
-
|
|
6726
|
-
|
|
6727
|
-
/* @__PURE__ */ (0,
|
|
6728
|
-
|
|
6963
|
+
const state = (0, import_react7.useSyncExternalStore)(controller.subscribe, controller.getSnapshot), id2 = (0, import_react7.useId)(), name2 = path.join(".");
|
|
6964
|
+
const value = at(state.draft, path), raw = state.raw[name2], bad = raw?.invalid === true;
|
|
6965
|
+
const units = name2 === "guards.toolOutputTruncation.maxInlineBytes" ? ` · ${permissionText(t)("unitBytes")}` : name2 === "guards.questionLabelHelper.maxLabelChars" ? ` · ${permissionText(t)("unitChars")}` : "";
|
|
6966
|
+
return /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)(import_jsx_runtime9.Fragment, { children: [
|
|
6967
|
+
/* @__PURE__ */ (0, import_jsx_runtime9.jsx)("label", { htmlFor: id2, children: fieldLabel(path, t) }),
|
|
6968
|
+
/* @__PURE__ */ (0, import_jsx_runtime9.jsxs)("div", { className: "dsmm-actions", children: [
|
|
6969
|
+
/* @__PURE__ */ (0, import_jsx_runtime9.jsx)(import_dsh_client_ui_primitives7.Input, { className: "dsmm-input", id: id2, type: "text", inputMode: schema.type === "number" ? "decimal" : void 0, value: raw?.text ?? String(value ?? inherited ?? ""), disabled: !controller.canEdit(), "aria-invalid": bad, "aria-describedby": `${id2}-error`, onChange: (event) => {
|
|
6729
6970
|
const text5 = event.currentTarget.value, candidate = schema.type === "number" ? Number(text5) : text5;
|
|
6730
6971
|
const valid = (schema.type !== "number" || text5.trim() !== "") && validateEditorValue(candidate, schema);
|
|
6731
|
-
controller.setRaw(
|
|
6972
|
+
controller.setRaw(name2, text5, !valid);
|
|
6732
6973
|
if (valid) controller.edit(path, candidate);
|
|
6733
6974
|
} }),
|
|
6734
|
-
/* @__PURE__ */ (0,
|
|
6735
|
-
controller.clearRaw(
|
|
6975
|
+
/* @__PURE__ */ (0, import_jsx_runtime9.jsx)(import_dsh_client_ui_primitives7.Button, { type: "button", variant: "outline", "data-dsmm-unset": name2, disabled: !controller.canEdit() || value === void 0 && raw === void 0, onClick: () => {
|
|
6976
|
+
controller.clearRaw(name2);
|
|
6736
6977
|
controller.edit(path, void 0);
|
|
6737
6978
|
}, children: t("unset") })
|
|
6738
6979
|
] }),
|
|
6739
|
-
/* @__PURE__ */ (0,
|
|
6980
|
+
/* @__PURE__ */ (0, import_jsx_runtime9.jsxs)("p", { id: `${id2}-error`, className: "dsmm-hint", children: [
|
|
6740
6981
|
bad ? t("invalid") : "",
|
|
6741
|
-
schema.type === "number" && (schema.min !== void 0 || schema.max !== void 0) ? ` ${schema.min ?? "—"} – ${schema.max ?? "—"}` : ""
|
|
6982
|
+
schema.type === "number" && (schema.min !== void 0 || schema.max !== void 0) ? ` ${schema.min ?? "—"} – ${schema.max ?? "—"}` : "",
|
|
6983
|
+
units
|
|
6742
6984
|
] })
|
|
6743
6985
|
] });
|
|
6744
6986
|
}
|
|
6745
6987
|
function Field({ schema, path, controller, initiallyOpen = false, disclosures, t }) {
|
|
6746
6988
|
if (schema.type === "transform" && schema.inner !== void 0) schema = schema.inner;
|
|
6747
|
-
const state = (0,
|
|
6748
|
-
const [open, setOpen] = (0,
|
|
6989
|
+
const state = (0, import_react7.useSyncExternalStore)(controller.subscribe, controller.getSnapshot), snapshot4 = state.snapshot, id2 = (0, import_react7.useId)(), name2 = path.join(".");
|
|
6990
|
+
const [open, setOpen] = (0, import_react7.useState)(disclosures?.get(name2) ?? initiallyOpen);
|
|
6749
6991
|
const expand = (expanded) => {
|
|
6750
|
-
disclosures?.set(
|
|
6992
|
+
disclosures?.set(name2, expanded);
|
|
6751
6993
|
setOpen(expanded);
|
|
6752
6994
|
};
|
|
6753
6995
|
const explicit = at(state.draft, path), inherited = controller.layer === "global" ? at(snapshot4.defaults, path) : at(mergeLayer(mergeLayer(snapshot4.defaults, snapshot4.global), snapshot4.nativeForm?.base ?? {}), path);
|
|
6754
6996
|
const choices = enumValues(schema), disabled = !controller.canEdit();
|
|
6755
|
-
if (
|
|
6756
|
-
if (
|
|
6757
|
-
|
|
6758
|
-
/* @__PURE__ */ (0,
|
|
6759
|
-
|
|
6760
|
-
/* @__PURE__ */ (0,
|
|
6761
|
-
/* @__PURE__ */ (0,
|
|
6762
|
-
|
|
6997
|
+
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) }) });
|
|
6998
|
+
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) }) });
|
|
6999
|
+
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: [
|
|
7000
|
+
/* @__PURE__ */ (0, import_jsx_runtime9.jsx)("summary", { children: fieldLabel(path, t) }),
|
|
7001
|
+
/* @__PURE__ */ (0, import_jsx_runtime9.jsxs)("div", { children: [
|
|
7002
|
+
name2 === "permissionControl" && /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("p", { className: "dsmm-hint", children: permissionText(t)("configPolicyHint") }),
|
|
7003
|
+
/* @__PURE__ */ (0, import_jsx_runtime9.jsx)("p", { className: "dsmm-hint", children: t(explicit === void 0 ? "inherit" : "explicit") }),
|
|
7004
|
+
/* @__PURE__ */ (0, import_jsx_runtime9.jsx)(import_dsh_client_ui_primitives7.Button, { type: "button", variant: "outline", "data-dsmm-unset": name2, disabled: disabled || explicit === void 0 && !Object.keys(state.raw).some((key) => key === name2 || key.startsWith(`${name2}.`)), onClick: () => {
|
|
7005
|
+
controller.clearRaw(name2);
|
|
6763
7006
|
controller.edit(path, void 0);
|
|
6764
7007
|
}, children: t("unsetGroup") }),
|
|
6765
|
-
Object.entries(schema.fields).map(([key, node]) => /* @__PURE__ */ (0,
|
|
7008
|
+
Object.entries(schema.fields).map(([key, node]) => /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(Field, { schema: node, path: [...path, key], controller, disclosures, t }, key))
|
|
6766
7009
|
] })
|
|
6767
7010
|
] });
|
|
6768
|
-
if (!["boolean", "string", "number"].includes(schema.type) && choices === null) return /* @__PURE__ */ (0,
|
|
6769
|
-
return /* @__PURE__ */ (0,
|
|
6770
|
-
schema.type === "boolean" || choices !== null ? /* @__PURE__ */ (0,
|
|
6771
|
-
/* @__PURE__ */ (0,
|
|
6772
|
-
/* @__PURE__ */ (0,
|
|
6773
|
-
/* @__PURE__ */ (0,
|
|
6774
|
-
(choices ?? [true, false]).map((choice2) => /* @__PURE__ */ (0,
|
|
7011
|
+
if (!["boolean", "string", "number"].includes(schema.type) && choices === null) return /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(AdvancedField, { schema, path, controller, inherited, upper: controller.layer === "global" ? at(snapshot4.profile, path) : void 0, expanded: open, onExpandedChange: expand, t });
|
|
7012
|
+
return /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)("div", { className: "dsmm-field dsmm-deployment-field", "data-field": name2, children: [
|
|
7013
|
+
schema.type === "boolean" || choices !== null ? /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)(import_jsx_runtime9.Fragment, { children: [
|
|
7014
|
+
/* @__PURE__ */ (0, import_jsx_runtime9.jsx)("label", { htmlFor: id2, children: fieldLabel(path, t) }),
|
|
7015
|
+
/* @__PURE__ */ (0, import_jsx_runtime9.jsxs)("select", { id: id2, disabled, value: explicit === void 0 ? "inherit" : JSON.stringify(explicit), onChange: (event) => controller.edit(path, event.currentTarget.value === "inherit" ? void 0 : JSON.parse(event.currentTarget.value)), children: [
|
|
7016
|
+
/* @__PURE__ */ (0, import_jsx_runtime9.jsx)("option", { value: "inherit", children: `${t("unset")} · ${displayValue(inherited, t)}` }),
|
|
7017
|
+
(choices ?? [true, false]).map((choice2) => /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("option", { value: JSON.stringify(choice2), children: displayValue(choice2, t) }, String(choice2)))
|
|
6775
7018
|
] })
|
|
6776
|
-
] }) : /* @__PURE__ */ (0,
|
|
6777
|
-
|
|
6778
|
-
|
|
6779
|
-
explicit !== void 0 && /* @__PURE__ */ (0,
|
|
6780
|
-
controller.layer === "profile" && at(snapshot4.nativeForm?.base, path) !== void 0 && /* @__PURE__ */ (0,
|
|
6781
|
-
controller.layer === "global" && at(snapshot4.profile, path) !== void 0 && /* @__PURE__ */ (0,
|
|
7019
|
+
] }) : /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(ScalarField, { schema, path, controller, inherited, t }),
|
|
7020
|
+
name2 === "modelParameters.passthrough" && /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("p", { className: "dsmm-hint", children: t("modelParametersHint") }),
|
|
7021
|
+
name2 === "permissionControl.enabled" && /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("p", { className: "dsmm-hint", children: permissionText(t)("coldHint") }),
|
|
7022
|
+
explicit !== void 0 && /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("p", { className: "dsmm-hint", children: t(equal(explicit, at(snapshot4.defaults, path)) ? "defaultPin" : "explicit") }),
|
|
7023
|
+
controller.layer === "profile" && at(snapshot4.nativeForm?.base, path) !== void 0 && /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("p", { className: "dsmm-hint", children: t("hostPin") }),
|
|
7024
|
+
controller.layer === "global" && at(snapshot4.profile, path) !== void 0 && /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)("p", { className: "dsmm-hint", children: [
|
|
6782
7025
|
t("profileSource"),
|
|
6783
7026
|
": ",
|
|
6784
7027
|
displayValue(at(snapshot4.profile, path), t),
|
|
@@ -6789,140 +7032,140 @@ function Field({ schema, path, controller, initiallyOpen = false, disclosures, t
|
|
|
6789
7032
|
}
|
|
6790
7033
|
|
|
6791
7034
|
// src/client/PermissionsPanel.tsx
|
|
6792
|
-
var
|
|
6793
|
-
var
|
|
6794
|
-
var
|
|
6795
|
-
var
|
|
6796
|
-
var
|
|
7035
|
+
var import_react8 = require("react");
|
|
7036
|
+
var import_dsh_client_ui_primitives8 = require("@deepseek-ai/dsh-client-ui-primitives");
|
|
7037
|
+
var import_jsx_runtime10 = require("react/jsx-runtime");
|
|
7038
|
+
var actions2 = ["inherit", "allow", "ask", "deny"];
|
|
7039
|
+
var kinds2 = ["outside-read", "shell", "webSearch", "webFetch"];
|
|
6797
7040
|
var ruleDraft = (rule) => ({ id: rule.id, action: rule.action, match: structuredClone(rule.match) });
|
|
6798
|
-
var
|
|
7041
|
+
var newMatch2 = (kind) => kind === "outside-read" ? { kind, path: "", scope: "exact" } : kind === "shell" ? { kind, executable: "", command: "", workingDirectory: "" } : { kind };
|
|
6799
7042
|
function Issue({ value, t }) {
|
|
6800
|
-
return value === null ? null : /* @__PURE__ */ (0,
|
|
7043
|
+
return value === null ? null : /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("p", { className: "dsmm-issue", role: "alert", children: [
|
|
6801
7044
|
t(`issue:${value}`),
|
|
6802
7045
|
" ",
|
|
6803
|
-
/* @__PURE__ */ (0,
|
|
7046
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)("code", { children: value })
|
|
6804
7047
|
] });
|
|
6805
7048
|
}
|
|
6806
7049
|
function RootState({ state, t }) {
|
|
6807
|
-
return /* @__PURE__ */ (0,
|
|
6808
|
-
/* @__PURE__ */ (0,
|
|
7050
|
+
return /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)(import_jsx_runtime10.Fragment, { children: [
|
|
7051
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("p", { children: [
|
|
6809
7052
|
t("root"),
|
|
6810
7053
|
": ",
|
|
6811
7054
|
t(state.scope === "root" && state.connected ? "active" : "unknown")
|
|
6812
7055
|
] }),
|
|
6813
|
-
state.scope !== "root" && /* @__PURE__ */ (0,
|
|
6814
|
-
!state.connected && /* @__PURE__ */ (0,
|
|
7056
|
+
state.scope !== "root" && /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("p", { className: "dsmm-hint", children: t(state.scope === "child" ? "child" : "noRoot") }),
|
|
7057
|
+
!state.connected && /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("p", { className: "dsmm-hint", children: t("unknown") })
|
|
6815
7058
|
] });
|
|
6816
7059
|
}
|
|
6817
7060
|
function ActionSelect({ id: id2, value, inherit = true, onChange, disabled, t }) {
|
|
6818
|
-
return /* @__PURE__ */ (0,
|
|
6819
|
-
const choice2 =
|
|
7061
|
+
return /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("select", { id: id2, value, disabled, onChange: (event) => {
|
|
7062
|
+
const choice2 = actions2.find((value2) => value2 === event.currentTarget.value);
|
|
6820
7063
|
if (choice2 !== void 0) onChange(choice2);
|
|
6821
|
-
}, children:
|
|
7064
|
+
}, children: actions2.filter((value2) => inherit || value2 !== "inherit").map((value2) => /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("option", { value: value2, children: t(value2 === "inherit" ? "inherit" : `action:${value2}`) }, value2)) });
|
|
6822
7065
|
}
|
|
6823
7066
|
function RuleEditor({ controller, state, t }) {
|
|
6824
|
-
const id2 = (0,
|
|
7067
|
+
const id2 = (0, import_react8.useId)(), editor = state.draft?.editor;
|
|
6825
7068
|
if (editor == null) return null;
|
|
6826
7069
|
const disabled = !controller.canEdit(state.generation), change = (value) => controller.edit(state.generation, { editor: value });
|
|
6827
|
-
const field = (key, label) => /* @__PURE__ */ (0,
|
|
6828
|
-
/* @__PURE__ */ (0,
|
|
6829
|
-
/* @__PURE__ */ (0,
|
|
7070
|
+
const field = (key, label) => /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("div", { className: "dsmm-field", children: [
|
|
7071
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)("label", { htmlFor: `${id2}-${key}`, children: t(label) }),
|
|
7072
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)(import_dsh_client_ui_primitives8.Input, { className: "dsmm-input", id: `${id2}-${key}`, required: true, maxLength: 32768, disabled, value: key in editor.match ? String(Reflect.get(editor.match, key)) : "", onChange: (event) => change({ ...editor, match: { ...editor.match, [key]: event.currentTarget.value } }) })
|
|
6830
7073
|
] });
|
|
6831
|
-
return /* @__PURE__ */ (0,
|
|
7074
|
+
return /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("form", { className: "dsmm-structured", "aria-label": t("editor"), onSubmit: (event) => {
|
|
6832
7075
|
event.preventDefault();
|
|
6833
7076
|
controller.stageRule(state.generation);
|
|
6834
7077
|
}, children: [
|
|
6835
|
-
/* @__PURE__ */ (0,
|
|
6836
|
-
/* @__PURE__ */ (0,
|
|
6837
|
-
/* @__PURE__ */ (0,
|
|
7078
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("div", { className: "dsmm-field", children: [
|
|
7079
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)("label", { htmlFor: `${id2}-id`, children: t("id") }),
|
|
7080
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)(import_dsh_client_ui_primitives8.Input, { className: "dsmm-input", id: `${id2}-id`, required: true, maxLength: 256, value: editor.id, disabled, onChange: (event) => change({ ...editor, id: event.currentTarget.value }) })
|
|
6838
7081
|
] }),
|
|
6839
|
-
/* @__PURE__ */ (0,
|
|
6840
|
-
/* @__PURE__ */ (0,
|
|
6841
|
-
/* @__PURE__ */ (0,
|
|
7082
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("div", { className: "dsmm-field", children: [
|
|
7083
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)("label", { htmlFor: `${id2}-action`, children: t("action") }),
|
|
7084
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)(ActionSelect, { id: `${id2}-action`, value: editor.action, disabled, inherit: false, t, onChange: (action2) => {
|
|
6842
7085
|
if (action2 !== "inherit") change({ ...editor, action: action2 });
|
|
6843
7086
|
} })
|
|
6844
7087
|
] }),
|
|
6845
|
-
/* @__PURE__ */ (0,
|
|
6846
|
-
/* @__PURE__ */ (0,
|
|
6847
|
-
/* @__PURE__ */ (0,
|
|
6848
|
-
const kind =
|
|
6849
|
-
if (kind !== void 0) change({ ...editor, match:
|
|
6850
|
-
}, children:
|
|
7088
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("div", { className: "dsmm-field", children: [
|
|
7089
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)("label", { htmlFor: `${id2}-kind`, children: t("match") }),
|
|
7090
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)("select", { id: `${id2}-kind`, value: editor.match.kind, disabled, onChange: (event) => {
|
|
7091
|
+
const kind = kinds2.find((value) => value === event.currentTarget.value);
|
|
7092
|
+
if (kind !== void 0) change({ ...editor, match: newMatch2(kind) });
|
|
7093
|
+
}, children: kinds2.map((kind) => /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("option", { value: kind, children: t(`kind:${kind}`) }, kind)) })
|
|
6851
7094
|
] }),
|
|
6852
|
-
editor.match.kind === "outside-read" && /* @__PURE__ */ (0,
|
|
7095
|
+
editor.match.kind === "outside-read" && /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)(import_jsx_runtime10.Fragment, { children: [
|
|
6853
7096
|
field("path", "path"),
|
|
6854
|
-
/* @__PURE__ */ (0,
|
|
6855
|
-
/* @__PURE__ */ (0,
|
|
6856
|
-
/* @__PURE__ */ (0,
|
|
7097
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("div", { className: "dsmm-field", children: [
|
|
7098
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)("label", { htmlFor: `${id2}-path-scope`, children: t("pathScope") }),
|
|
7099
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("select", { id: `${id2}-path-scope`, value: editor.match.scope, disabled, onChange: (event) => {
|
|
6857
7100
|
const scope = event.currentTarget.value;
|
|
6858
7101
|
if (editor.match.kind === "outside-read" && (scope === "exact" || scope === "tree")) change({ ...editor, match: { ...editor.match, scope } });
|
|
6859
7102
|
}, children: [
|
|
6860
|
-
/* @__PURE__ */ (0,
|
|
6861
|
-
/* @__PURE__ */ (0,
|
|
7103
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)("option", { value: "exact", children: t("exact") }),
|
|
7104
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)("option", { value: "tree", children: t("tree") })
|
|
6862
7105
|
] })
|
|
6863
7106
|
] })
|
|
6864
7107
|
] }),
|
|
6865
|
-
editor.match.kind === "shell" && /* @__PURE__ */ (0,
|
|
7108
|
+
editor.match.kind === "shell" && /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)(import_jsx_runtime10.Fragment, { children: [
|
|
6866
7109
|
field("executable", "executable"),
|
|
6867
7110
|
field("command", "command"),
|
|
6868
7111
|
field("workingDirectory", "cwd")
|
|
6869
7112
|
] }),
|
|
6870
|
-
/* @__PURE__ */ (0,
|
|
6871
|
-
/* @__PURE__ */ (0,
|
|
6872
|
-
/* @__PURE__ */ (0,
|
|
7113
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("div", { className: "dsmm-actions", children: [
|
|
7114
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)(import_dsh_client_ui_primitives8.Button, { type: "submit", variant: "outline", disabled, children: t("stage") }),
|
|
7115
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)(import_dsh_client_ui_primitives8.Button, { type: "button", variant: "outline", disabled, onClick: () => controller.edit(state.generation, { editor: null }), children: t("cancel") })
|
|
6873
7116
|
] })
|
|
6874
7117
|
] });
|
|
6875
7118
|
}
|
|
6876
7119
|
function RuleRecords({ controller, state, t }) {
|
|
6877
7120
|
const records = state.rules?.snapshot.policy.rules ?? state.base?.policy.rules;
|
|
6878
|
-
return /* @__PURE__ */ (0,
|
|
6879
|
-
records?.length === 0 && /* @__PURE__ */ (0,
|
|
6880
|
-
records?.map((rule) => /* @__PURE__ */ (0,
|
|
6881
|
-
/* @__PURE__ */ (0,
|
|
6882
|
-
/* @__PURE__ */ (0,
|
|
7121
|
+
return /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("div", { className: "dsmm-structured", children: [
|
|
7122
|
+
records?.length === 0 && /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("p", { children: t("noRules") }),
|
|
7123
|
+
records?.map((rule) => /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("fieldset", { children: [
|
|
7124
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)("legend", { children: rule.id }),
|
|
7125
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("p", { children: [
|
|
6883
7126
|
t(rule.revoked ? "revoked" : "active"),
|
|
6884
7127
|
" · ",
|
|
6885
7128
|
t(`action:${rule.action}`)
|
|
6886
7129
|
] }),
|
|
6887
|
-
/* @__PURE__ */ (0,
|
|
6888
|
-
/* @__PURE__ */ (0,
|
|
6889
|
-
/* @__PURE__ */ (0,
|
|
6890
|
-
rule.match.kind === "outside-read" && /* @__PURE__ */ (0,
|
|
6891
|
-
/* @__PURE__ */ (0,
|
|
6892
|
-
/* @__PURE__ */ (0,
|
|
7130
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("dl", { className: "dsmm-child-meta", children: [
|
|
7131
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)("dt", { children: t("match") }),
|
|
7132
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)("dd", { children: t(`kind:${rule.match.kind}`) }),
|
|
7133
|
+
rule.match.kind === "outside-read" && /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)(import_jsx_runtime10.Fragment, { children: [
|
|
7134
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)("dt", { children: t("path") }),
|
|
7135
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("dd", { children: [
|
|
6893
7136
|
rule.match.path,
|
|
6894
7137
|
" · ",
|
|
6895
7138
|
t(rule.match.scope)
|
|
6896
7139
|
] })
|
|
6897
7140
|
] }),
|
|
6898
|
-
rule.match.kind === "shell" && /* @__PURE__ */ (0,
|
|
6899
|
-
/* @__PURE__ */ (0,
|
|
6900
|
-
/* @__PURE__ */ (0,
|
|
6901
|
-
/* @__PURE__ */ (0,
|
|
6902
|
-
/* @__PURE__ */ (0,
|
|
6903
|
-
/* @__PURE__ */ (0,
|
|
6904
|
-
/* @__PURE__ */ (0,
|
|
7141
|
+
rule.match.kind === "shell" && /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)(import_jsx_runtime10.Fragment, { children: [
|
|
7142
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)("dt", { children: t("executable") }),
|
|
7143
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)("dd", { children: rule.match.executable }),
|
|
7144
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)("dt", { children: t("command") }),
|
|
7145
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)("dd", { children: /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("code", { children: rule.match.command }) }),
|
|
7146
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)("dt", { children: t("cwd") }),
|
|
7147
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)("dd", { children: rule.match.workingDirectory })
|
|
6905
7148
|
] }),
|
|
6906
|
-
/* @__PURE__ */ (0,
|
|
6907
|
-
/* @__PURE__ */ (0,
|
|
7149
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)("dt", { children: t("source") }),
|
|
7150
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)("dd", { children: t(rule.source.kind === "operator" ? "operator" : "imported") })
|
|
6908
7151
|
] }),
|
|
6909
|
-
/* @__PURE__ */ (0,
|
|
6910
|
-
/* @__PURE__ */ (0,
|
|
6911
|
-
/* @__PURE__ */ (0,
|
|
7152
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("div", { className: "dsmm-actions", children: [
|
|
7153
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)(import_dsh_client_ui_primitives8.Button, { type: "button", variant: "outline", disabled: !controller.canEdit(state.generation) || state.draft === null, onClick: () => controller.edit(state.generation, { editor: ruleDraft(rule) }), children: t("editRule") }),
|
|
7154
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)(import_dsh_client_ui_primitives8.Button, { type: "button", variant: "outline", disabled: !controller.canEdit(state.generation) || state.draft === null || rule.revoked || state.draft.revoke.includes(rule.id), onClick: () => controller.stageRevoke(state.generation, rule.id), children: t("stageRevoke") })
|
|
6912
7155
|
] })
|
|
6913
7156
|
] }, rule.id))
|
|
6914
7157
|
] });
|
|
6915
7158
|
}
|
|
6916
7159
|
function PermissionCoverage({ state, t }) {
|
|
6917
7160
|
const value = state.rules?.capabilities;
|
|
6918
|
-
return /* @__PURE__ */ (0,
|
|
6919
|
-
/* @__PURE__ */ (0,
|
|
6920
|
-
/* @__PURE__ */ (0,
|
|
6921
|
-
/* @__PURE__ */ (0,
|
|
6922
|
-
value === void 0 ? /* @__PURE__ */ (0,
|
|
6923
|
-
/* @__PURE__ */ (0,
|
|
6924
|
-
/* @__PURE__ */ (0,
|
|
6925
|
-
/* @__PURE__ */ (0,
|
|
7161
|
+
return /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("section", { className: "dsmm-structured", "aria-label": t("coverageTitle"), children: [
|
|
7162
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)("h3", { children: t("coverageTitle") }),
|
|
7163
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)("p", { className: "dsmm-hint", children: t("coverage") }),
|
|
7164
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)("p", { className: "dsmm-hint", children: t("registrationUnresolved") }),
|
|
7165
|
+
value === void 0 ? /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("p", { children: t("coverageUnavailable") }) : /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)(import_jsx_runtime10.Fragment, { children: [
|
|
7166
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("dl", { className: "dsmm-child-meta", children: [
|
|
7167
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)("dt", { children: t("coverageRuntime") }),
|
|
7168
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("dd", { children: [
|
|
6926
7169
|
t(value.runtime.state),
|
|
6927
7170
|
" · ",
|
|
6928
7171
|
t("mounted"),
|
|
@@ -6930,112 +7173,116 @@ function PermissionCoverage({ state, t }) {
|
|
|
6930
7173
|
t(value.runtime.mounted ? "on" : "off")
|
|
6931
7174
|
] })
|
|
6932
7175
|
] }),
|
|
6933
|
-
value.runtime.restartRequired && /* @__PURE__ */ (0,
|
|
6934
|
-
value.tools.length === 0 ? /* @__PURE__ */ (0,
|
|
6935
|
-
/* @__PURE__ */ (0,
|
|
6936
|
-
/* @__PURE__ */ (0,
|
|
6937
|
-
/* @__PURE__ */ (0,
|
|
6938
|
-
/* @__PURE__ */ (0,
|
|
6939
|
-
/* @__PURE__ */ (0,
|
|
6940
|
-
/* @__PURE__ */ (0,
|
|
6941
|
-
/* @__PURE__ */ (0,
|
|
6942
|
-
/* @__PURE__ */ (0,
|
|
7176
|
+
value.runtime.restartRequired && /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("p", { children: t("restart") }),
|
|
7177
|
+
value.tools.length === 0 ? /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("p", { children: t("coverageEmpty") }) : /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("ul", { className: "dsmm-profile-list", children: value.tools.map((tool) => /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("li", { children: /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("dl", { className: "dsmm-child-meta", children: [
|
|
7178
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)("dt", { children: t("toolName") }),
|
|
7179
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)("dd", { children: /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("code", { children: tool.name }) }),
|
|
7180
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)("dt", { children: t("toolKind") }),
|
|
7181
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)("dd", { children: /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("code", { children: tool.kind }) }),
|
|
7182
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)("dt", { children: t("toolApproval") }),
|
|
7183
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)("dd", { children: t("nativeOnce") }),
|
|
7184
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)("dt", { children: t("toolMemory") }),
|
|
7185
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)("dd", { children: t("notProvided") })
|
|
6943
7186
|
] }) }, tool.name)) }),
|
|
6944
|
-
/* @__PURE__ */ (0,
|
|
6945
|
-
/* @__PURE__ */ (0,
|
|
6946
|
-
/* @__PURE__ */ (0,
|
|
6947
|
-
/* @__PURE__ */ (0,
|
|
6948
|
-
/* @__PURE__ */ (0,
|
|
6949
|
-
/* @__PURE__ */ (0,
|
|
6950
|
-
/* @__PURE__ */ (0,
|
|
6951
|
-
/* @__PURE__ */ (0,
|
|
6952
|
-
/* @__PURE__ */ (0,
|
|
6953
|
-
/* @__PURE__ */ (0,
|
|
6954
|
-
/* @__PURE__ */ (0,
|
|
6955
|
-
/* @__PURE__ */ (0,
|
|
6956
|
-
/* @__PURE__ */ (0,
|
|
6957
|
-
/* @__PURE__ */ (0,
|
|
6958
|
-
/* @__PURE__ */ (0,
|
|
6959
|
-
/* @__PURE__ */ (0,
|
|
6960
|
-
/* @__PURE__ */ (0,
|
|
7187
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("dl", { className: "dsmm-child-meta", children: [
|
|
7188
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)("dt", { children: t("outsideReads") }),
|
|
7189
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)("dd", { children: t("limit:outsideReads") }),
|
|
7190
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)("dt", { children: t("finalInode") }),
|
|
7191
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)("dd", { children: t("limit:finalInode") }),
|
|
7192
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)("dt", { children: t("toolMemory") }),
|
|
7193
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)("dd", { children: t("limit:scopedMemory") }),
|
|
7194
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)("dt", { children: t("webFetch") }),
|
|
7195
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)("dd", { children: t("limit:webFetch") }),
|
|
7196
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)("dt", { children: t("searchDestinations") }),
|
|
7197
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)("dd", { children: t("limit:webSearchDestinations") }),
|
|
7198
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)("dt", { children: t("proxyBinding") }),
|
|
7199
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)("dd", { children: t("limit:proxyAddressBinding") }),
|
|
7200
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)("dt", { children: t("shellSockets") }),
|
|
7201
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)("dd", { children: t("limit:shellSockets") }),
|
|
7202
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)("dt", { children: t("providerAuthMcp") }),
|
|
7203
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)("dd", { children: t("limit:providerAuthMcp") })
|
|
6961
7204
|
] })
|
|
6962
7205
|
] }),
|
|
6963
|
-
/* @__PURE__ */ (0,
|
|
7206
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)("p", { className: "dsmm-hint", children: t("pathEvidence") })
|
|
6964
7207
|
] });
|
|
6965
7208
|
}
|
|
6966
7209
|
function PermissionRulesEditor({ controller, state, t }) {
|
|
6967
|
-
const id2 = (0,
|
|
6968
|
-
|
|
6969
|
-
|
|
6970
|
-
/* @__PURE__ */ (0,
|
|
6971
|
-
/* @__PURE__ */ (0,
|
|
6972
|
-
/* @__PURE__ */ (0,
|
|
6973
|
-
/* @__PURE__ */ (0,
|
|
6974
|
-
/* @__PURE__ */ (0,
|
|
6975
|
-
/* @__PURE__ */ (0,
|
|
6976
|
-
|
|
6977
|
-
/* @__PURE__ */ (0,
|
|
7210
|
+
const id2 = (0, import_react8.useId)(), draft2 = state.draft, disabled = !controller.canEdit(state.generation), value = state.rules;
|
|
7211
|
+
const writable = state.scope === "root" && state.connected;
|
|
7212
|
+
return /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("section", { className: "dsmm-zone", "aria-label": t("rules"), children: [
|
|
7213
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)("h3", { children: t("rules") }),
|
|
7214
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)("p", { className: "dsmm-hint", children: t("rulesHint") }),
|
|
7215
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)("p", { className: "dsmm-hint", children: t("networkLimit") }),
|
|
7216
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)("p", { className: "dsmm-hint", children: t("matchHint") }),
|
|
7217
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)(Issue, { value: state.rulesIssue, t }),
|
|
7218
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)("p", { className: "dsmm-hint", children: t("observedPolicy") }),
|
|
7219
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("dl", { className: "dsmm-child-meta", children: [
|
|
7220
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)("dt", { children: t("profileOverrideState") }),
|
|
7221
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)("dd", { children: t("profileOverrideUnknown") })
|
|
6978
7222
|
] }),
|
|
6979
|
-
/* @__PURE__ */ (0,
|
|
6980
|
-
/* @__PURE__ */ (0,
|
|
6981
|
-
/* @__PURE__ */ (0,
|
|
6982
|
-
/* @__PURE__ */ (0,
|
|
6983
|
-
/* @__PURE__ */ (0,
|
|
7223
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("dl", { className: "dsmm-child-meta", children: [
|
|
7224
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)("dt", { children: t("runtime") }),
|
|
7225
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)("dd", { children: value === null ? t("unknown") : t(value.runtime.state) }),
|
|
7226
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)("dt", { children: t("mounted") }),
|
|
7227
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)("dd", { children: value === null ? t("unknown") : t(value.runtime.mounted ? "on" : "off") })
|
|
6984
7228
|
] }),
|
|
6985
|
-
value?.runtime.restartRequired && /* @__PURE__ */ (0,
|
|
6986
|
-
disabled && /* @__PURE__ */ (0,
|
|
6987
|
-
state.base !== null && /* @__PURE__ */ (0,
|
|
6988
|
-
/* @__PURE__ */ (0,
|
|
6989
|
-
/* @__PURE__ */ (0,
|
|
7229
|
+
value?.runtime.restartRequired && /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("p", { children: t("restart") }),
|
|
7230
|
+
disabled && !state.reading && /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("p", { className: "dsmm-hint", children: t("rulesUnavailable") }),
|
|
7231
|
+
state.base !== null && /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("dl", { className: "dsmm-child-meta", children: [
|
|
7232
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)("dt", { children: "permissionControl.enabled" }),
|
|
7233
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("dd", { children: [
|
|
6990
7234
|
t(state.base.policy.enabled ? "on" : "off"),
|
|
6991
7235
|
" · ",
|
|
6992
7236
|
t("coldHint")
|
|
6993
7237
|
] }),
|
|
6994
|
-
/* @__PURE__ */ (0,
|
|
6995
|
-
/* @__PURE__ */ (0,
|
|
7238
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)("dt", { children: "permissionControl.nativeCommands.enabled" }),
|
|
7239
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)("dd", { children: t(state.base.policy.nativeCommands.enabled ? "on" : "off") })
|
|
6996
7240
|
] }),
|
|
6997
|
-
/* @__PURE__ */ (0,
|
|
6998
|
-
|
|
6999
|
-
/* @__PURE__ */ (0,
|
|
7000
|
-
|
|
7001
|
-
|
|
7241
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("details", { className: "dsmm-deployment-group", children: [
|
|
7242
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)("summary", { children: t("coverageDetails") }),
|
|
7243
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)(PermissionCoverage, { state, t })
|
|
7244
|
+
] }),
|
|
7245
|
+
draft2 !== null && /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)(import_jsx_runtime10.Fragment, { children: [
|
|
7246
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("div", { className: "dsmm-field", children: [
|
|
7247
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)("label", { htmlFor: `${id2}-outside`, children: t("outsideReads") }),
|
|
7248
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)(ActionSelect, { id: `${id2}-outside`, value: draft2.outsideReads, disabled, t, onChange: (outsideReads) => controller.edit(state.generation, { outsideReads }) })
|
|
7002
7249
|
] }),
|
|
7003
|
-
["webSearch", "webFetch"].map((key) => /* @__PURE__ */ (0,
|
|
7004
|
-
/* @__PURE__ */ (0,
|
|
7005
|
-
/* @__PURE__ */ (0,
|
|
7006
|
-
/* @__PURE__ */ (0,
|
|
7250
|
+
["webSearch", "webFetch"].map((key) => /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("fieldset", { children: [
|
|
7251
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)("legend", { children: t(key) }),
|
|
7252
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("label", { className: "dsmm-actions", htmlFor: `${id2}-${key}-enabled`, children: [
|
|
7253
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)("input", { type: "checkbox", id: `${id2}-${key}-enabled`, checked: draft2[key].enabled, disabled, onChange: (event) => controller.edit(state.generation, { [key]: { ...draft2[key], enabled: event.currentTarget.checked } }) }),
|
|
7007
7254
|
t("enabled")
|
|
7008
7255
|
] }),
|
|
7009
|
-
/* @__PURE__ */ (0,
|
|
7010
|
-
/* @__PURE__ */ (0,
|
|
7011
|
-
/* @__PURE__ */ (0,
|
|
7256
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("div", { className: "dsmm-field", children: [
|
|
7257
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)("label", { htmlFor: `${id2}-${key}-rule`, children: t("rule") }),
|
|
7258
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)(ActionSelect, { id: `${id2}-${key}-rule`, value: draft2[key].rule, disabled, t, onChange: (rule) => controller.edit(state.generation, { [key]: { ...draft2[key], rule } }) })
|
|
7012
7259
|
] })
|
|
7013
7260
|
] }, key)),
|
|
7014
|
-
/* @__PURE__ */ (0,
|
|
7015
|
-
/* @__PURE__ */ (0,
|
|
7016
|
-
(draft2.upsert.length > 0 || draft2.revoke.length > 0) && /* @__PURE__ */ (0,
|
|
7017
|
-
/* @__PURE__ */ (0,
|
|
7018
|
-
draft2.upsert.map((row) => /* @__PURE__ */ (0,
|
|
7019
|
-
/* @__PURE__ */ (0,
|
|
7261
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)(import_dsh_client_ui_primitives8.Button, { type: "button", variant: "outline", disabled: disabled || draft2.editor !== null, onClick: () => controller.edit(state.generation, { editor: { id: "", action: "ask", match: newMatch2("outside-read") } }), children: t("newRule") }),
|
|
7262
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)(RuleEditor, { controller, state, t }),
|
|
7263
|
+
(draft2.upsert.length > 0 || draft2.revoke.length > 0) && /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("div", { className: "dsmm-structured", children: [
|
|
7264
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)("h3", { children: t("staged") }),
|
|
7265
|
+
draft2.upsert.map((row) => /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("div", { className: "dsmm-field", children: [
|
|
7266
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("p", { children: [
|
|
7020
7267
|
row.id,
|
|
7021
7268
|
" · ",
|
|
7022
7269
|
t(`kind:${row.match.kind}`),
|
|
7023
7270
|
" · ",
|
|
7024
7271
|
t(`action:${row.action}`)
|
|
7025
7272
|
] }),
|
|
7026
|
-
/* @__PURE__ */ (0,
|
|
7273
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsxs)(import_dsh_client_ui_primitives8.Button, { type: "button", variant: "outline", disabled, onClick: () => controller.edit(state.generation, { upsert: draft2.upsert.filter((rule) => rule.id !== row.id) }), children: [
|
|
7027
7274
|
t("unstage"),
|
|
7028
7275
|
": ",
|
|
7029
7276
|
row.id
|
|
7030
7277
|
] })
|
|
7031
7278
|
] }, row.id)),
|
|
7032
|
-
draft2.revoke.map((ruleId) => /* @__PURE__ */ (0,
|
|
7033
|
-
/* @__PURE__ */ (0,
|
|
7279
|
+
draft2.revoke.map((ruleId) => /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("div", { className: "dsmm-field", children: [
|
|
7280
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("p", { children: [
|
|
7034
7281
|
t("stageRevoke"),
|
|
7035
7282
|
": ",
|
|
7036
7283
|
ruleId
|
|
7037
7284
|
] }),
|
|
7038
|
-
/* @__PURE__ */ (0,
|
|
7285
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsxs)(import_dsh_client_ui_primitives8.Button, { type: "button", variant: "outline", disabled, onClick: () => controller.edit(state.generation, { revoke: draft2.revoke.filter((id3) => id3 !== ruleId) }), children: [
|
|
7039
7286
|
t("unstage"),
|
|
7040
7287
|
": ",
|
|
7041
7288
|
ruleId
|
|
@@ -7043,58 +7290,59 @@ function PermissionRulesEditor({ controller, state, t }) {
|
|
|
7043
7290
|
] }, ruleId))
|
|
7044
7291
|
] })
|
|
7045
7292
|
] }),
|
|
7046
|
-
/* @__PURE__ */ (0,
|
|
7047
|
-
/* @__PURE__ */ (0,
|
|
7048
|
-
/* @__PURE__ */ (0,
|
|
7049
|
-
/* @__PURE__ */ (0,
|
|
7293
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)(RuleRecords, { state, controller, t }),
|
|
7294
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("div", { className: "dsmm-actions", children: [
|
|
7295
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)(import_dsh_client_ui_primitives8.Button, { type: "button", variant: "primary", disabled: !controller.canSave(state.generation), onClick: () => void controller.save(state.generation), children: t("save") }),
|
|
7296
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)(import_dsh_client_ui_primitives8.Button, { type: "button", variant: "outline", disabled: !writable || state.reading || state.busy !== null, onClick: () => void controller.refresh(state.generation), children: t("refresh") }),
|
|
7297
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)(import_dsh_client_ui_primitives8.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") })
|
|
7050
7298
|
] }),
|
|
7051
|
-
state.dirty && /* @__PURE__ */ (0,
|
|
7299
|
+
state.dirty && /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("p", { children: t("dirty") })
|
|
7052
7300
|
] });
|
|
7053
7301
|
}
|
|
7054
7302
|
function PermissionsPanel({ controller, t, sessionId: sessionId2 }) {
|
|
7055
|
-
const state = (0,
|
|
7056
|
-
(0,
|
|
7057
|
-
if (sessionId2 !== void 0 && sessionId2 !== state.sessionId) return /* @__PURE__ */ (0,
|
|
7058
|
-
return /* @__PURE__ */ (0,
|
|
7059
|
-
/* @__PURE__ */ (0,
|
|
7060
|
-
/* @__PURE__ */ (0,
|
|
7061
|
-
/* @__PURE__ */ (0,
|
|
7062
|
-
/* @__PURE__ */ (0,
|
|
7063
|
-
/* @__PURE__ */ (0,
|
|
7303
|
+
const state = (0, import_react8.useSyncExternalStore)(controller.store.subscribe, controller.store.getSnapshot);
|
|
7304
|
+
(0, import_react8.useEffect)(() => controller.watch(), [controller]);
|
|
7305
|
+
if (sessionId2 !== void 0 && sessionId2 !== state.sessionId) return /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("p", { className: "dsmm-hint", role: "status", children: t("rulesUnavailable") });
|
|
7306
|
+
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: [
|
|
7307
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)("h2", { children: t("title") }),
|
|
7308
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)(RootState, { state, t }),
|
|
7309
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)("p", { className: "dsmm-hint", children: t("nativeApproval") }),
|
|
7310
|
+
/* @__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) }),
|
|
7311
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)(PermissionRulesEditor, { controller, state, t })
|
|
7064
7312
|
] });
|
|
7065
7313
|
}
|
|
7066
7314
|
|
|
7067
7315
|
// src/client/DeploymentPage.tsx
|
|
7068
|
-
var
|
|
7316
|
+
var import_jsx_runtime11 = require("react/jsx-runtime");
|
|
7069
7317
|
function ScopeSave({ controller, workspace, refreshOnly = false, t }) {
|
|
7070
|
-
const state = (0,
|
|
7318
|
+
const state = (0, import_react9.useSyncExternalStore)(controller.subscribe, controller.getSnapshot);
|
|
7071
7319
|
const pending = [...new Set(controller.pendingPaths().map(moduleFor))];
|
|
7072
|
-
return /* @__PURE__ */ (0,
|
|
7073
|
-
/* @__PURE__ */ (0,
|
|
7074
|
-
!refreshOnly && pending.length > 0 && /* @__PURE__ */ (0,
|
|
7320
|
+
return /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)("section", { className: "dsmm-scope-save", "aria-label": t("saveScope"), children: [
|
|
7321
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsx)("p", { className: "dsmm-status", role: "status", "aria-live": "polite", children: refreshOnly ? state.busy ? t("loading") : "" : state.busy ? t("saving") : state.refreshRequired ? t("savedRefreshRequired") : state.saved ? t("saved") : state.dirty ? t("dirty") : "" }),
|
|
7322
|
+
!refreshOnly && pending.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)("p", { children: [
|
|
7075
7323
|
t("pendingModules"),
|
|
7076
7324
|
": ",
|
|
7077
7325
|
pending.map((module2) => t(moduleTitle(module2))).join(" · ")
|
|
7078
7326
|
] }),
|
|
7079
|
-
state.issue !== null && /* @__PURE__ */ (0,
|
|
7080
|
-
!refreshOnly && state.invalidFields.length > 0 && /* @__PURE__ */ (0,
|
|
7081
|
-
controller.layer === "profile" && !controller.canWriteProfile() && /* @__PURE__ */ (0,
|
|
7082
|
-
/* @__PURE__ */ (0,
|
|
7083
|
-
!refreshOnly && /* @__PURE__ */ (0,
|
|
7084
|
-
/* @__PURE__ */ (0,
|
|
7085
|
-
!refreshOnly && /* @__PURE__ */ (0,
|
|
7327
|
+
state.issue !== null && /* @__PURE__ */ (0, import_jsx_runtime11.jsx)("p", { className: "dsmm-issue", role: "alert", children: t(state.issue) }),
|
|
7328
|
+
!refreshOnly && state.invalidFields.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime11.jsx)("p", { className: "dsmm-issue", role: "alert", children: t("invalid") }),
|
|
7329
|
+
controller.layer === "profile" && !controller.canWriteProfile() && /* @__PURE__ */ (0, import_jsx_runtime11.jsx)("p", { className: "dsmm-hint", children: t("unavailableForm") }),
|
|
7330
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsxs)("div", { className: "dsmm-actions", children: [
|
|
7331
|
+
!refreshOnly && /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(import_dsh_client_ui_primitives9.Button, { type: "button", variant: "primary", disabled: !controller.canSave(), onClick: () => void (workspace?.save() ?? controller.save()), children: t(controller.layer === "global" ? "saveGlobal" : "saveProfile") }),
|
|
7332
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsx)(import_dsh_client_ui_primitives9.Button, { type: "button", variant: "outline", disabled: state.busy, onClick: () => void controller.refresh(), children: t("refresh") }),
|
|
7333
|
+
!refreshOnly && /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(import_dsh_client_ui_primitives9.Button, { type: "button", variant: "outline", disabled: state.busy || !state.dirty && state.issue === null && !state.refreshRequired, onClick: () => void controller.refresh(true), children: t("discard") })
|
|
7086
7334
|
] })
|
|
7087
7335
|
] });
|
|
7088
7336
|
}
|
|
7089
7337
|
function NativeRuntimeState({ value, t }) {
|
|
7090
|
-
return /* @__PURE__ */ (0,
|
|
7091
|
-
/* @__PURE__ */ (0,
|
|
7092
|
-
/* @__PURE__ */ (0,
|
|
7338
|
+
return /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)("details", { className: "dsmm-availability", children: [
|
|
7339
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsx)("summary", { children: t("nativeRuntimeState") }),
|
|
7340
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsxs)("p", { children: [
|
|
7093
7341
|
t("nativeRuntimeBinding"),
|
|
7094
7342
|
": ",
|
|
7095
7343
|
t(value?.binding === "stock" ? "nativeRuntimeStock" : value?.binding === "unavailable" ? "nativeRuntimeUnavailable" : "unknown")
|
|
7096
7344
|
] }),
|
|
7097
|
-
/* @__PURE__ */ (0,
|
|
7345
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsxs)("p", { children: [
|
|
7098
7346
|
t("nativeRuntimeFence"),
|
|
7099
7347
|
": ",
|
|
7100
7348
|
value === void 0 ? t("unknown") : t(value.deliveryFenceReady ? "on" : "off"),
|
|
@@ -7103,20 +7351,20 @@ function NativeRuntimeState({ value, t }) {
|
|
|
7103
7351
|
": ",
|
|
7104
7352
|
value === void 0 ? t("unknown") : t(value.restartRequired ? "on" : "off")
|
|
7105
7353
|
] }),
|
|
7106
|
-
value?.reason !== void 0 && /* @__PURE__ */ (0,
|
|
7354
|
+
value?.reason !== void 0 && /* @__PURE__ */ (0, import_jsx_runtime11.jsx)("p", { children: t(`nativeRuntimeReason-${value.reason}`) })
|
|
7107
7355
|
] });
|
|
7108
7356
|
}
|
|
7109
7357
|
function StateInspector({ controller, t }) {
|
|
7110
|
-
const { snapshot: snapshot4, session, dirty, issue } = (0,
|
|
7111
|
-
if (snapshot4 === null) return /* @__PURE__ */ (0,
|
|
7358
|
+
const { snapshot: snapshot4, session, dirty, issue } = (0, import_react9.useSyncExternalStore)(controller.subscribe, controller.getSnapshot);
|
|
7359
|
+
if (snapshot4 === null) return /* @__PURE__ */ (0, import_jsx_runtime11.jsx)("p", { children: t("unavailable") });
|
|
7112
7360
|
const admitted = session?.configuration ?? null;
|
|
7113
7361
|
const source = (value2) => t(value2 === "profile" ? "profileSource" : value2 === "global" ? "globalSource" : value2 === "defaults" ? "defaultsSource" : value2 === "named-session" ? "namedSource" : value2 === "startup" ? "startupSource" : value2 === "deployment" ? "deploymentCapture" : value2 === "mixed" ? "mixedSource" : "unknown");
|
|
7114
7362
|
const value = (layer, path) => layer === void 0 ? t("unknown") : at(layer, path.split(".")) === void 0 ? t("absent") : displayValue(at(layer, path.split(".")), t);
|
|
7115
7363
|
const restart = (snapshot4.nextRoot?.restartRequired ?? []).filter((path) => visibleDeploymentPath(path.split(".")));
|
|
7116
|
-
return /* @__PURE__ */ (0,
|
|
7117
|
-
/* @__PURE__ */ (0,
|
|
7118
|
-
(dirty || issue !== null) && /* @__PURE__ */ (0,
|
|
7119
|
-
/* @__PURE__ */ (0,
|
|
7364
|
+
return /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)("div", { className: "dsmm-structured", children: [
|
|
7365
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsx)("p", { role: "status", children: session === null ? t("noSession") : admitted === null ? t("sessionUnavailable") : t("sessionObserved") }),
|
|
7366
|
+
(dirty || issue !== null) && /* @__PURE__ */ (0, import_jsx_runtime11.jsx)("p", { className: "dsmm-hint", children: t("inspectorStale") }),
|
|
7367
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsxs)("p", { children: [
|
|
7120
7368
|
t("globalSource"),
|
|
7121
7369
|
": ",
|
|
7122
7370
|
t(configurationVersionState(snapshot4.globalRevision)),
|
|
@@ -7125,52 +7373,52 @@ function StateInspector({ controller, t }) {
|
|
|
7125
7373
|
": ",
|
|
7126
7374
|
t(configurationVersionState(snapshot4.nativeRevision))
|
|
7127
7375
|
] }),
|
|
7128
|
-
snapshot4.subagentRuntime !== void 0 && /* @__PURE__ */ (0,
|
|
7129
|
-
snapshot4.modules.map((module2) => /* @__PURE__ */ (0,
|
|
7130
|
-
/* @__PURE__ */ (0,
|
|
7131
|
-
/* @__PURE__ */ (0,
|
|
7376
|
+
snapshot4.subagentRuntime !== void 0 && /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(NativeRuntimeState, { value: snapshot4.subagentRuntime, t }),
|
|
7377
|
+
snapshot4.modules.map((module2) => /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)("section", { className: "dsmm-zone", children: [
|
|
7378
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsx)("h3", { children: module2.descriptor.label }),
|
|
7379
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsxs)("p", { children: [
|
|
7132
7380
|
t("desired"),
|
|
7133
7381
|
": ",
|
|
7134
7382
|
t(module2.desired.enabled ? "on" : "off"),
|
|
7135
7383
|
" · ",
|
|
7136
7384
|
source(module2.desired.source)
|
|
7137
7385
|
] }),
|
|
7138
|
-
/* @__PURE__ */ (0,
|
|
7386
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsxs)("p", { children: [
|
|
7139
7387
|
t("startup"),
|
|
7140
7388
|
": ",
|
|
7141
7389
|
module2.startupMounted == null ? t("unknown") : t(module2.startupMounted ? "on" : "off")
|
|
7142
7390
|
] }),
|
|
7143
|
-
/* @__PURE__ */ (0,
|
|
7391
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsxs)("p", { children: [
|
|
7144
7392
|
t("next"),
|
|
7145
7393
|
": ",
|
|
7146
7394
|
module2.nextRoot.admitted == null ? t("unknown") : t(module2.nextRoot.admitted ? "on" : "off")
|
|
7147
7395
|
] }),
|
|
7148
|
-
module2.pending && /* @__PURE__ */ (0,
|
|
7396
|
+
module2.pending && /* @__PURE__ */ (0, import_jsx_runtime11.jsx)("p", { children: t("pending") })
|
|
7149
7397
|
] }, module2.descriptor.id)),
|
|
7150
|
-
inspectorPaths(snapshot4, admitted).map((path) => /* @__PURE__ */ (0,
|
|
7151
|
-
/* @__PURE__ */ (0,
|
|
7152
|
-
/* @__PURE__ */ (0,
|
|
7398
|
+
inspectorPaths(snapshot4, admitted).map((path) => /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)("dl", { className: "dsmm-deployment-state", children: [
|
|
7399
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsx)("dt", { children: path }),
|
|
7400
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsxs)("dd", { children: [
|
|
7153
7401
|
t("desired"),
|
|
7154
7402
|
": ",
|
|
7155
7403
|
value(snapshot4.desired, path),
|
|
7156
7404
|
" · ",
|
|
7157
7405
|
source(snapshot4.sources[path])
|
|
7158
7406
|
] }),
|
|
7159
|
-
/* @__PURE__ */ (0,
|
|
7407
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsxs)("dd", { children: [
|
|
7160
7408
|
t("startup"),
|
|
7161
7409
|
": ",
|
|
7162
7410
|
value(snapshot4.startup, path),
|
|
7163
7411
|
" · ",
|
|
7164
7412
|
source(snapshot4.startupSources?.[path])
|
|
7165
7413
|
] }),
|
|
7166
|
-
/* @__PURE__ */ (0,
|
|
7414
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsxs)("dd", { children: [
|
|
7167
7415
|
t("next"),
|
|
7168
7416
|
": ",
|
|
7169
7417
|
value(snapshot4.nextRoot?.settings, path),
|
|
7170
7418
|
" · ",
|
|
7171
7419
|
source(snapshot4.nextRoot?.sources[path])
|
|
7172
7420
|
] }),
|
|
7173
|
-
/* @__PURE__ */ (0,
|
|
7421
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsxs)("dd", { children: [
|
|
7174
7422
|
t("session"),
|
|
7175
7423
|
": ",
|
|
7176
7424
|
value(admitted?.settings, path),
|
|
@@ -7178,7 +7426,7 @@ function StateInspector({ controller, t }) {
|
|
|
7178
7426
|
source(admitted?.sources[path])
|
|
7179
7427
|
] })
|
|
7180
7428
|
] }, path)),
|
|
7181
|
-
restart.length > 0 && /* @__PURE__ */ (0,
|
|
7429
|
+
restart.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)("p", { children: [
|
|
7182
7430
|
t("pending"),
|
|
7183
7431
|
": ",
|
|
7184
7432
|
restart.join(", ")
|
|
@@ -7187,27 +7435,30 @@ function StateInspector({ controller, t }) {
|
|
|
7187
7435
|
}
|
|
7188
7436
|
function DeploymentPage(props) {
|
|
7189
7437
|
const workspace = props.workspace ?? deploymentWorkspace(props.core, props.permissions);
|
|
7190
|
-
const navigation = (0,
|
|
7191
|
-
const core = (0,
|
|
7438
|
+
const navigation = (0, import_react9.useSyncExternalStore)(workspace.subscribe, workspace.getSnapshot);
|
|
7439
|
+
const core = (0, import_react9.useSyncExternalStore)(props.core.subscribe, props.core.getSnapshot);
|
|
7192
7440
|
const controller = workspace.controller() ?? props.core;
|
|
7193
|
-
const state = (0,
|
|
7194
|
-
const id2 = (0,
|
|
7195
|
-
const scopeControl = (0,
|
|
7196
|
-
const resume = (0,
|
|
7197
|
-
const disclosures = (0,
|
|
7441
|
+
const state = (0, import_react9.useSyncExternalStore)(controller.subscribe, controller.getSnapshot);
|
|
7442
|
+
const id2 = (0, import_react9.useId)(), heading = (0, import_react9.useRef)(null), triggers = (0, import_react9.useRef)(/* @__PURE__ */ new Map()), previous = (0, import_react9.useRef)(null);
|
|
7443
|
+
const scopeControl = (0, import_react9.useRef)(null), confirmation = (0, import_react9.useRef)(null);
|
|
7444
|
+
const resume = (0, import_react9.useRef)(null);
|
|
7445
|
+
const disclosures = (0, import_react9.useRef)({ global: /* @__PURE__ */ new Map(), profile: /* @__PURE__ */ new Map() });
|
|
7198
7446
|
const { t } = props, snapshot4 = state.snapshot ?? core.snapshot, active = navigation.module;
|
|
7199
|
-
(0,
|
|
7447
|
+
(0, import_react9.useEffect)(() => {
|
|
7200
7448
|
if (props.view === "page") void props.core.refresh();
|
|
7201
7449
|
}, [props.core, props.view]);
|
|
7202
|
-
(0,
|
|
7450
|
+
(0, import_react9.useEffect)(() => {
|
|
7203
7451
|
if (props.forms !== void 0) workspace.bindForms(props.forms);
|
|
7204
7452
|
}, [workspace, props.forms]);
|
|
7205
|
-
(0,
|
|
7453
|
+
(0, import_react9.useEffect)(() => {
|
|
7454
|
+
if (navigation.module === null && core.snapshot !== null) workspace.request({ scope: navigation.scope, module: null });
|
|
7455
|
+
}, [core.snapshot, navigation.module, navigation.scope, workspace]);
|
|
7456
|
+
(0, import_react9.useEffect)(() => {
|
|
7206
7457
|
if (active !== null) heading.current?.focus();
|
|
7207
7458
|
else if (previous.current !== null) triggers.current.get(previous.current)?.focus();
|
|
7208
7459
|
previous.current = active;
|
|
7209
7460
|
}, [active]);
|
|
7210
|
-
(0,
|
|
7461
|
+
(0, import_react9.useEffect)(() => {
|
|
7211
7462
|
if (navigation.pending !== null) {
|
|
7212
7463
|
resume.current = { element: document.activeElement, scope: navigation.scope, module: active };
|
|
7213
7464
|
confirmation.current?.focus();
|
|
@@ -7220,69 +7471,87 @@ function DeploymentPage(props) {
|
|
|
7220
7471
|
else if (from2.scope !== navigation.scope) scopeControl.current?.focus();
|
|
7221
7472
|
}
|
|
7222
7473
|
}, [navigation.pending, navigation.scope, active]);
|
|
7223
|
-
if (props.view === "summary") return /* @__PURE__ */ (0,
|
|
7474
|
+
if (props.view === "summary") return /* @__PURE__ */ (0, import_jsx_runtime11.jsx)("span", { children: t("summary") });
|
|
7224
7475
|
const fields = snapshot4 === null || active === null ? [] : moduleFields(scopeSchema(snapshot4, controller.layer), active, controller.layer);
|
|
7225
|
-
const
|
|
7226
|
-
const
|
|
7227
|
-
|
|
7228
|
-
|
|
7229
|
-
|
|
7230
|
-
|
|
7231
|
-
|
|
7476
|
+
const tabs = NAVIGATION_MODULES.filter((module2) => module2 !== "other" || snapshot4 === null || moduleFields(snapshot4.schema, "other", "global").length + moduleFields(scopeSchema(snapshot4, "profile"), "other", "profile").length > 0);
|
|
7477
|
+
const select = (module2) => workspace.request({ scope: navigation.scope, module: module2 });
|
|
7478
|
+
const onTabKey = (event, index) => {
|
|
7479
|
+
const last = tabs.length - 1, move = (target) => {
|
|
7480
|
+
const next = tabs[(target + tabs.length) % tabs.length];
|
|
7481
|
+
triggers.current.get(next)?.focus();
|
|
7482
|
+
};
|
|
7483
|
+
if (event.key === "ArrowRight") move(index + 1);
|
|
7484
|
+
else if (event.key === "ArrowLeft") move(index - 1);
|
|
7485
|
+
else if (event.key === "Home") move(0);
|
|
7486
|
+
else if (event.key === "End") move(last);
|
|
7487
|
+
else return;
|
|
7488
|
+
event.preventDefault();
|
|
7489
|
+
};
|
|
7490
|
+
const scopeActions = /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(ScopeSave, { controller: active === "state" ? props.core : controller, workspace, refreshOnly: active === "state" || workspace.controller() === null, t });
|
|
7491
|
+
return /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)("section", { className: "dsmm-profiles dsmm-deployment", "data-dsmm-page": true, "aria-label": t("title"), children: [
|
|
7492
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsx)("p", { className: "dsmm-hint", children: t("boundaries") }),
|
|
7493
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsxs)("div", { className: "dsmm-field", children: [
|
|
7494
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsx)("label", { htmlFor: `${id2}-scope`, children: t("scope") }),
|
|
7495
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsxs)("select", { ref: scopeControl, id: `${id2}-scope`, value: navigation.scope, disabled: state.busy || navigation.pending !== null, onChange: (event) => {
|
|
7232
7496
|
const scope = event.currentTarget.value;
|
|
7233
|
-
if (scope === "global" || scope === "profile") workspace.request({ scope, module:
|
|
7497
|
+
if (scope === "global" || scope === "profile") workspace.request({ scope, module: null });
|
|
7234
7498
|
}, children: [
|
|
7235
|
-
/* @__PURE__ */ (0,
|
|
7236
|
-
/* @__PURE__ */ (0,
|
|
7499
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsx)("option", { value: "global", children: t("global") }),
|
|
7500
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsx)("option", { value: "profile", children: t("profile") })
|
|
7237
7501
|
] })
|
|
7238
7502
|
] }),
|
|
7239
|
-
/* @__PURE__ */ (0,
|
|
7240
|
-
navigation.scope === "profile" && (navigation.native === null || !navigation.native.canWriteProfile()) && /* @__PURE__ */ (0,
|
|
7241
|
-
/* @__PURE__ */ (0,
|
|
7242
|
-
|
|
7243
|
-
|
|
7244
|
-
|
|
7245
|
-
|
|
7246
|
-
|
|
7247
|
-
|
|
7248
|
-
|
|
7249
|
-
|
|
7250
|
-
|
|
7251
|
-
|
|
7252
|
-
|
|
7253
|
-
|
|
7254
|
-
|
|
7255
|
-
|
|
7503
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsx)("p", { className: "dsmm-hint", children: t(navigation.scope === "global" ? "globalHint" : "profileHint") }),
|
|
7504
|
+
navigation.scope === "profile" && (navigation.native === null || !navigation.native.canWriteProfile()) && /* @__PURE__ */ (0, import_jsx_runtime11.jsx)("p", { className: "dsmm-hint", children: t("unavailableForm") }),
|
|
7505
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsx)("div", { className: "dsmm-section-tabs", role: "tablist", "aria-label": t("modules"), children: tabs.map((module2, index) => /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
|
|
7506
|
+
import_dsh_client_ui_primitives9.Button,
|
|
7507
|
+
{
|
|
7508
|
+
ref: (element) => {
|
|
7509
|
+
if (element !== null) triggers.current.set(module2, element);
|
|
7510
|
+
else triggers.current.delete(module2);
|
|
7511
|
+
},
|
|
7512
|
+
role: "tab",
|
|
7513
|
+
type: "button",
|
|
7514
|
+
id: `${id2}-tab-${module2}`,
|
|
7515
|
+
"aria-selected": active === module2,
|
|
7516
|
+
"aria-controls": `${id2}-panel`,
|
|
7517
|
+
tabIndex: active === module2 ? 0 : -1,
|
|
7518
|
+
"data-dsmm-tab": module2,
|
|
7519
|
+
onKeyDown: (event) => onTabKey(event, index),
|
|
7520
|
+
onClick: () => select(module2),
|
|
7521
|
+
children: t(moduleTitle(module2))
|
|
7522
|
+
},
|
|
7523
|
+
module2
|
|
7524
|
+
)) }),
|
|
7525
|
+
active !== null && /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)("section", { id: `${id2}-panel`, role: "tabpanel", className: "dsmm-section-panel", "aria-labelledby": `${id2}-tab-${active}`, "data-dsmm-module": active, children: [
|
|
7526
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsx)("div", { className: "dsmm-panel-heading", children: /* @__PURE__ */ (0, import_jsx_runtime11.jsx)("h2", { id: `${id2}-heading`, ref: heading, tabIndex: -1, children: t(moduleTitle(active)) }) }),
|
|
7527
|
+
active === "state" ? /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)(import_jsx_runtime11.Fragment, { children: [
|
|
7528
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsx)(StateInspector, { controller: props.core, t }),
|
|
7529
|
+
scopeActions
|
|
7530
|
+
] }) : /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)(import_jsx_runtime11.Fragment, { children: [
|
|
7531
|
+
navigation.scope === "profile" && navigation.native === null ? /* @__PURE__ */ (0, import_jsx_runtime11.jsx)("p", { children: t("unavailableForm") }) : state.snapshot === null ? /* @__PURE__ */ (0, import_jsx_runtime11.jsx)("p", { children: t(state.busy ? "loading" : "unavailable") }) : /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)("div", { "data-dsmm-layer": controller.layer, "aria-busy": state.busy, className: "dsmm-structured", children: [
|
|
7532
|
+
fields.length === 0 && /* @__PURE__ */ (0, import_jsx_runtime11.jsx)("p", { className: "dsmm-hint", children: t("noModuleFields") }),
|
|
7533
|
+
fields.map(([key, schema]) => /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(Field, { schema, path: [key], controller, initiallyOpen: fields.length === 1 && active !== "permissions", disclosures: disclosures.current[navigation.scope], t }, `${navigation.scope}:${key}`)),
|
|
7534
|
+
active === "run" && controller.layer === "profile" && /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(NativeRuntimeState, { value: state.snapshot.subagentRuntime, t })
|
|
7256
7535
|
] }),
|
|
7257
|
-
|
|
7258
|
-
|
|
7259
|
-
|
|
7260
|
-
|
|
7261
|
-
|
|
7262
|
-
fields.length === 0 && /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("p", { className: "dsmm-hint", children: t("noModuleFields") }),
|
|
7263
|
-
fields.map(([key, schema]) => /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(Field, { schema, path: [key], controller, initiallyOpen: fields.length === 1 && active !== "permissions", disclosures: disclosures.current[navigation.scope], t }, `${navigation.scope}:${key}`)),
|
|
7264
|
-
active === "run" && controller.layer === "profile" && /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(NativeRuntimeState, { value: state.snapshot.subagentRuntime, t })
|
|
7265
|
-
] }),
|
|
7266
|
-
scopeActions,
|
|
7267
|
-
active === "permissions" && /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("section", { className: "dsmm-zone", children: [
|
|
7268
|
-
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)("h3", { children: t("rootRules") }),
|
|
7269
|
-
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)("p", { className: "dsmm-hint", children: t("rootRulesHint") }),
|
|
7270
|
-
workspace.permissions === void 0 ? /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("p", { children: t("rootRulesUnavailable") }) : /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(PermissionsPanel, { controller: workspace.permissions, t: props.permissionsT ?? ((key) => Object.hasOwn(permissionEn, key) ? permissionText(t)(key) : key) })
|
|
7271
|
-
] })
|
|
7536
|
+
scopeActions,
|
|
7537
|
+
active === "permissions" && /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)("section", { className: "dsmm-zone dsmm-rules-transaction", "aria-label": t("rootRules"), children: [
|
|
7538
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsx)("h3", { children: t("rootRules") }),
|
|
7539
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsx)("p", { className: "dsmm-hint", children: t("rootRulesHint") }),
|
|
7540
|
+
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) })
|
|
7272
7541
|
] })
|
|
7273
7542
|
] })
|
|
7274
7543
|
] }),
|
|
7275
|
-
navigation.pending !== null && /* @__PURE__ */ (0,
|
|
7544
|
+
navigation.pending !== null && /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)("section", { className: "dsmm-confirm", role: "group", "aria-label": t("leaveDraft"), onKeyDown: (event) => {
|
|
7276
7545
|
if (event.key === "Escape" && !event.defaultPrevented) {
|
|
7277
7546
|
event.preventDefault();
|
|
7278
7547
|
workspace.continueEditing();
|
|
7279
7548
|
}
|
|
7280
7549
|
}, children: [
|
|
7281
|
-
/* @__PURE__ */ (0,
|
|
7282
|
-
/* @__PURE__ */ (0,
|
|
7283
|
-
/* @__PURE__ */ (0,
|
|
7284
|
-
/* @__PURE__ */ (0,
|
|
7285
|
-
/* @__PURE__ */ (0,
|
|
7550
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsx)("p", { children: t("leaveDraft") }),
|
|
7551
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsxs)("div", { className: "dsmm-actions", children: [
|
|
7552
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsx)(import_dsh_client_ui_primitives9.Button, { ref: confirmation, type: "button", variant: "primary", onClick: () => workspace.continueEditing(), children: t("continueEditing") }),
|
|
7553
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsx)(import_dsh_client_ui_primitives9.Button, { type: "button", variant: "outline", onClick: () => workspace.keepAndNavigate(), children: t("keepDraft") }),
|
|
7554
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsx)(import_dsh_client_ui_primitives9.Button, { type: "button", variant: "outline", disabled: state.busy, onClick: () => void workspace.discardAndNavigate(), children: t("discardDraft") })
|
|
7286
7555
|
] })
|
|
7287
7556
|
] })
|
|
7288
7557
|
] });
|
|
@@ -7524,10 +7793,10 @@ function parseCapabilities(value) {
|
|
|
7524
7793
|
const tools = [];
|
|
7525
7794
|
const names = /* @__PURE__ */ new Set();
|
|
7526
7795
|
for (const value2 of input.tools) {
|
|
7527
|
-
const tool = permissionRuleRow(value2, ["name", "kind", "approval", "scopedMemory"]),
|
|
7528
|
-
if (!["read", "glob", "grep", "shell", "webSearch", "webFetch"].includes(tool.kind) || tool.approval !== "native-once" || tool.scopedMemory !== false || names.has(
|
|
7529
|
-
names.add(
|
|
7530
|
-
tools.push({ name, kind: tool.kind, approval: "native-once", scopedMemory: false });
|
|
7796
|
+
const tool = permissionRuleRow(value2, ["name", "kind", "approval", "scopedMemory"]), name2 = text4(tool.name);
|
|
7797
|
+
if (!["read", "glob", "grep", "shell", "webSearch", "webFetch"].includes(tool.kind) || tool.approval !== "native-once" || tool.scopedMemory !== false || names.has(name2)) fail4();
|
|
7798
|
+
names.add(name2);
|
|
7799
|
+
tools.push({ name: name2, kind: tool.kind, approval: "native-once", scopedMemory: false });
|
|
7531
7800
|
}
|
|
7532
7801
|
return { limits: {
|
|
7533
7802
|
outsideReads: "tool-call-boundary",
|
|
@@ -7548,7 +7817,7 @@ function parsePermissionRulesResult(value) {
|
|
|
7548
7817
|
...Object.hasOwn(input, "capabilities") ? { capabilities: parseCapabilities(input.capabilities) } : {}
|
|
7549
7818
|
};
|
|
7550
7819
|
}
|
|
7551
|
-
var codec3 = (
|
|
7820
|
+
var codec3 = (name2, parse3) => ({ mode: "strict", typeSymbol: `@dsmm/dsmm#${name2}`, create: () => ({ parse: parse3 }) });
|
|
7552
7821
|
function descriptor3(method, result, request) {
|
|
7553
7822
|
return {
|
|
7554
7823
|
id: `@dsmm/dsmm-permissions#dsmmPermissions/${method}`,
|
|
@@ -7620,6 +7889,7 @@ var empty = () => ({
|
|
|
7620
7889
|
scope: "unknown",
|
|
7621
7890
|
connected: false,
|
|
7622
7891
|
reading: false,
|
|
7892
|
+
revalidating: false,
|
|
7623
7893
|
busy: null,
|
|
7624
7894
|
rules: null,
|
|
7625
7895
|
base: null,
|
|
@@ -7639,6 +7909,8 @@ var PermissionController = class {
|
|
|
7639
7909
|
timer;
|
|
7640
7910
|
watchers = 0;
|
|
7641
7911
|
disposed = false;
|
|
7912
|
+
/** A successful read/save exists for the current scope fence; not mutation authority. */
|
|
7913
|
+
observed = false;
|
|
7642
7914
|
store = { getSnapshot: () => this.state, subscribe: (listener) => {
|
|
7643
7915
|
this.listeners.add(listener);
|
|
7644
7916
|
return () => {
|
|
@@ -7656,16 +7928,23 @@ var PermissionController = class {
|
|
|
7656
7928
|
this.requestSequence++;
|
|
7657
7929
|
clearTimeout(this.timer);
|
|
7658
7930
|
}
|
|
7659
|
-
|
|
7931
|
+
/** An observed snapshot exists; background work must stay invisible until it changes what is possible. */
|
|
7932
|
+
trusted() {
|
|
7933
|
+
return this.observed;
|
|
7934
|
+
}
|
|
7935
|
+
fence(preserveDraft, preserveBase = preserveDraft) {
|
|
7660
7936
|
this.cancel();
|
|
7937
|
+
this.observed = false;
|
|
7661
7938
|
this.publish({
|
|
7662
7939
|
generation: this.state.generation + 1,
|
|
7663
7940
|
reading: false,
|
|
7941
|
+
revalidating: false,
|
|
7664
7942
|
busy: null,
|
|
7665
7943
|
notice: null,
|
|
7666
7944
|
rules: null,
|
|
7667
7945
|
rulesIssue: null,
|
|
7668
|
-
...
|
|
7946
|
+
...preserveDraft ? {} : { draft: null, dirty: false },
|
|
7947
|
+
...preserveBase ? {} : { base: null }
|
|
7669
7948
|
});
|
|
7670
7949
|
}
|
|
7671
7950
|
bindConnection(invoke, generation) {
|
|
@@ -7678,9 +7957,9 @@ var PermissionController = class {
|
|
|
7678
7957
|
}
|
|
7679
7958
|
bindScope(sessionId2, owner, scope) {
|
|
7680
7959
|
if (this.disposed || this.state.sessionId === sessionId2 && this.owner === owner && this.state.scope === scope) return;
|
|
7681
|
-
const
|
|
7960
|
+
const sameSession = sessionId2 === this.state.sessionId;
|
|
7682
7961
|
this.owner = owner;
|
|
7683
|
-
this.fence(
|
|
7962
|
+
this.fence(sameSession, false);
|
|
7684
7963
|
this.publish({ sessionId: sessionId2, scope });
|
|
7685
7964
|
this.schedule(true);
|
|
7686
7965
|
}
|
|
@@ -7710,7 +7989,7 @@ var PermissionController = class {
|
|
|
7710
7989
|
clearTimeout(this.timer);
|
|
7711
7990
|
if (this.watchers === 0 || !this.live(this.state.generation)) return;
|
|
7712
7991
|
this.timer = setTimeout(() => {
|
|
7713
|
-
void this.
|
|
7992
|
+
void this.revalidate(this.state.generation);
|
|
7714
7993
|
}, immediate ? 0 : 1e3);
|
|
7715
7994
|
this.timer.unref?.();
|
|
7716
7995
|
}
|
|
@@ -7721,29 +8000,43 @@ var PermissionController = class {
|
|
|
7721
8000
|
const value = this.state.rules;
|
|
7722
8001
|
return value !== null && value.runtime.state === "synced" && value.runtime.savedRevision === value.snapshot.revision && value.runtime.runtimeRevision === value.snapshot.revision;
|
|
7723
8002
|
}
|
|
8003
|
+
/** A background request in flight never disables editing or saving; only its own save/authority does. */
|
|
7724
8004
|
canEdit(generation) {
|
|
7725
8005
|
return this.live(generation) && this.state.rulesIssue === null && this.synchronized() && this.state.busy === null;
|
|
7726
8006
|
}
|
|
7727
8007
|
canSave(generation) {
|
|
7728
|
-
return this.canEdit(generation) &&
|
|
8008
|
+
return this.canEdit(generation) && this.state.dirty && this.state.draft?.editor === null;
|
|
7729
8009
|
}
|
|
8010
|
+
/** User-triggered refresh: visible busy state on this transaction only. */
|
|
7730
8011
|
async refresh(generation, discard = false) {
|
|
7731
|
-
|
|
8012
|
+
await this.load(generation, discard, false);
|
|
8013
|
+
}
|
|
8014
|
+
/** Watch-driven revalidation. Invisible once a trusted snapshot exists. */
|
|
8015
|
+
async revalidate(generation) {
|
|
8016
|
+
await this.load(generation, false, true);
|
|
8017
|
+
}
|
|
8018
|
+
async load(generation, discard, background) {
|
|
8019
|
+
if (!this.live(generation) || this.state.busy !== null || this.state.reading) return;
|
|
8020
|
+
if (background && this.state.revalidating) return;
|
|
8021
|
+
if (!background && this.state.revalidating) this.cancel();
|
|
8022
|
+
const visible = !background || !this.trusted();
|
|
7732
8023
|
const sequence = ++this.requestSequence, signal = this.request.signal, id2 = this.state.sessionId;
|
|
7733
|
-
this.publish({ reading: true });
|
|
7734
|
-
|
|
7735
|
-
|
|
7736
|
-
|
|
7737
|
-
this.
|
|
7738
|
-
} else {
|
|
7739
|
-
const value = rules.value;
|
|
8024
|
+
this.publish(visible ? { reading: true, revalidating: false } : { revalidating: true });
|
|
8025
|
+
try {
|
|
8026
|
+
const value = await this.invoke("describeRules", [id2], signal);
|
|
8027
|
+
if (!this.live(generation) || signal.aborted || sequence !== this.requestSequence) return;
|
|
8028
|
+
this.observed = true;
|
|
7740
8029
|
const retain = this.state.dirty && !discard;
|
|
7741
8030
|
this.publish({
|
|
7742
8031
|
rules: value,
|
|
7743
8032
|
rulesIssue: retain && this.state.base?.revision !== value.snapshot.revision ? "stale" : null,
|
|
7744
|
-
reading: false,
|
|
7745
8033
|
...retain ? {} : { base: value.snapshot, draft: draftOf(value.snapshot.policy), dirty: false }
|
|
7746
8034
|
});
|
|
8035
|
+
} catch (error) {
|
|
8036
|
+
if (!this.live(generation) || signal.aborted || sequence !== this.requestSequence) return;
|
|
8037
|
+
this.publish({ rulesIssue: this.issue(error) });
|
|
8038
|
+
} finally {
|
|
8039
|
+
if (this.live(generation) && sequence === this.requestSequence) this.publish({ reading: false, revalidating: false });
|
|
7747
8040
|
}
|
|
7748
8041
|
this.schedule();
|
|
7749
8042
|
}
|
|
@@ -7767,7 +8060,7 @@ var PermissionController = class {
|
|
|
7767
8060
|
}
|
|
7768
8061
|
begin(busy) {
|
|
7769
8062
|
this.cancel();
|
|
7770
|
-
this.publish({ busy, notice: null });
|
|
8063
|
+
this.publish({ busy, reading: false, revalidating: false, notice: null });
|
|
7771
8064
|
return { signal: this.request.signal, id: this.state.sessionId };
|
|
7772
8065
|
}
|
|
7773
8066
|
async save(generation) {
|
|
@@ -7776,9 +8069,12 @@ var PermissionController = class {
|
|
|
7776
8069
|
const current = this.begin("save");
|
|
7777
8070
|
try {
|
|
7778
8071
|
const result = await this.invoke("saveRules", [current.id, request], current.signal);
|
|
7779
|
-
if (this.live(generation))
|
|
8072
|
+
if (this.live(generation)) {
|
|
8073
|
+
this.observed = true;
|
|
8074
|
+
this.publish({ rules: result, base: result.snapshot, draft: draftOf(result.snapshot.policy), dirty: false, rulesIssue: null, notice: "saved" });
|
|
8075
|
+
}
|
|
7780
8076
|
} catch (error) {
|
|
7781
|
-
if (this.live(generation)) this.publish({
|
|
8077
|
+
if (this.live(generation)) this.publish({ rulesIssue: this.issue(error) });
|
|
7782
8078
|
} finally {
|
|
7783
8079
|
if (this.live(generation)) {
|
|
7784
8080
|
this.publish({ busy: null });
|
|
@@ -7789,7 +8085,7 @@ var PermissionController = class {
|
|
|
7789
8085
|
};
|
|
7790
8086
|
|
|
7791
8087
|
// src/client/RoleToolView.tsx
|
|
7792
|
-
var
|
|
8088
|
+
var import_dsh_client_ui_primitives10 = require("@deepseek-ai/dsh-client-ui-primitives");
|
|
7793
8089
|
|
|
7794
8090
|
// src/client/RoleToolView-data.ts
|
|
7795
8091
|
var roleToolKeys = {
|
|
@@ -7906,7 +8202,7 @@ var roleToolZh = {
|
|
|
7906
8202
|
};
|
|
7907
8203
|
|
|
7908
8204
|
// src/client/RoleToolView.tsx
|
|
7909
|
-
var
|
|
8205
|
+
var import_jsx_runtime12 = require("react/jsx-runtime");
|
|
7910
8206
|
var styles = `
|
|
7911
8207
|
.dsmm-role-tool{min-width:0;color:var(--dsw-alias-label-primary);font-family:var(--dsw-font-family);font-size:14px;line-height:22px}
|
|
7912
8208
|
.dsmm-role-tool .dsmm-role-heading{color:var(--dsw-alias-label-primary);height:auto;min-height:32px}
|
|
@@ -7930,36 +8226,36 @@ function RoleToolView(props) {
|
|
|
7930
8226
|
const target = actual?.role ?? requested.target;
|
|
7931
8227
|
const title = `${t("call")} ${target === void 0 ? t("unknownTarget") : roleToolDisplay(target)}${(actual?.level ?? requested.level) === void 0 ? "" : ` · ${actual?.level ?? requested.level}`}`;
|
|
7932
8228
|
const state = result?.error?.code === "interrupted" ? "stopped" : failed ? "error" : result === void 0 ? props.phase === "preparing" ? "preparing" : "running" : actual?.jobId !== void 0 || actual?.mode === "continuable" ? "background" : "result";
|
|
7933
|
-
const code = (value) => /* @__PURE__ */ (0,
|
|
7934
|
-
return /* @__PURE__ */ (0,
|
|
7935
|
-
/* @__PURE__ */ (0,
|
|
7936
|
-
|
|
8229
|
+
const code = (value) => /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(import_dsh_client_ui_primitives10.CodeBlock, { code: value, copyLabel: t("copy"), copiedLabel: t("copied") });
|
|
8230
|
+
return /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)("div", { className: "dsmm-role-tool", "data-dsmm-role-tool": props.toolName, "data-identity": actual === void 0 ? "requested" : "actual", "data-state": state, children: [
|
|
8231
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
|
|
8232
|
+
import_dsh_client_ui_primitives10.DisclosureRow,
|
|
7937
8233
|
{
|
|
7938
8234
|
title,
|
|
7939
8235
|
titleClassName: "dsmm-role-title",
|
|
7940
8236
|
rowClassName: "dsmm-role-heading",
|
|
7941
8237
|
contentClassName: "dsmm-role-text",
|
|
7942
|
-
icon: /* @__PURE__ */ (0,
|
|
8238
|
+
icon: /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(import_dsh_client_ui_primitives10.StateDot, { state: state === "error" ? "error" : state === "stopped" ? "warning" : result === void 0 ? "ongoing" : state === "background" ? "idle" : "done" }),
|
|
7943
8239
|
open: expanded,
|
|
7944
8240
|
expandable: true,
|
|
7945
8241
|
onToggle: toggle,
|
|
7946
8242
|
expandOnRowClick: true,
|
|
7947
|
-
children: /* @__PURE__ */ (0,
|
|
7948
|
-
/* @__PURE__ */ (0,
|
|
8243
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)("div", { className: "dsmm-role-body", children: [
|
|
8244
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsxs)("p", { children: [
|
|
7949
8245
|
props.toolName,
|
|
7950
8246
|
" · ",
|
|
7951
8247
|
props.callId
|
|
7952
8248
|
] }),
|
|
7953
|
-
/* @__PURE__ */ (0,
|
|
8249
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsxs)("p", { className: "dsmm-role-status", children: [
|
|
7954
8250
|
t("requested"),
|
|
7955
8251
|
" ",
|
|
7956
8252
|
t(requested.kind),
|
|
7957
8253
|
": ",
|
|
7958
8254
|
requested.target === void 0 ? t("unknown") : roleToolDisplay(requested.target)
|
|
7959
8255
|
] }),
|
|
7960
|
-
requested.description !== void 0 && /* @__PURE__ */ (0,
|
|
7961
|
-
actual !== void 0 && /* @__PURE__ */ (0,
|
|
7962
|
-
/* @__PURE__ */ (0,
|
|
8256
|
+
requested.description !== void 0 && /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("p", { className: "dsmm-role-status", children: requested.description }),
|
|
8257
|
+
actual !== void 0 && /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)(import_jsx_runtime12.Fragment, { children: [
|
|
8258
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsxs)("p", { children: [
|
|
7963
8259
|
t("actual"),
|
|
7964
8260
|
" ",
|
|
7965
8261
|
t(requested.kind),
|
|
@@ -7970,7 +8266,7 @@ function RoleToolView(props) {
|
|
|
7970
8266
|
": ",
|
|
7971
8267
|
actual.level
|
|
7972
8268
|
] }),
|
|
7973
|
-
/* @__PURE__ */ (0,
|
|
8269
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsxs)("p", { children: [
|
|
7974
8270
|
t("routeSource"),
|
|
7975
8271
|
": ",
|
|
7976
8272
|
actual.routeSource,
|
|
@@ -7980,31 +8276,31 @@ function RoleToolView(props) {
|
|
|
7980
8276
|
actual.route === void 0 ? t("unknown") : `${actual.route.provider}/${actual.route.model}${actual.route.reasoningEffort === void 0 ? "" : ` · ${actual.route.reasoningEffort}`}`
|
|
7981
8277
|
] })
|
|
7982
8278
|
] }),
|
|
7983
|
-
/* @__PURE__ */ (0,
|
|
7984
|
-
/* @__PURE__ */ (0,
|
|
7985
|
-
raw === "" ? /* @__PURE__ */ (0,
|
|
8279
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsxs)("div", { children: [
|
|
8280
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsx)("p", { children: t(props.phase === "preparing" ? "preparingArgs" : "args") }),
|
|
8281
|
+
raw === "" ? /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("p", { children: t("emptyArgs") }) : code(raw)
|
|
7986
8282
|
] }),
|
|
7987
|
-
result !== void 0 && /* @__PURE__ */ (0,
|
|
7988
|
-
actual === void 0 && /* @__PURE__ */ (0,
|
|
7989
|
-
/* @__PURE__ */ (0,
|
|
7990
|
-
/* @__PURE__ */ (0,
|
|
8283
|
+
result !== void 0 && /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)(import_jsx_runtime12.Fragment, { children: [
|
|
8284
|
+
actual === void 0 && /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("p", { children: t("unavailable") }),
|
|
8285
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsxs)("div", { children: [
|
|
8286
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsx)("p", { children: t("output") }),
|
|
7991
8287
|
code(JSON.stringify(result.content, null, 2))
|
|
7992
8288
|
] }),
|
|
7993
|
-
result.error != null && /* @__PURE__ */ (0,
|
|
7994
|
-
/* @__PURE__ */ (0,
|
|
8289
|
+
result.error != null && /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)("div", { children: [
|
|
8290
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsx)("p", { children: t("failure") }),
|
|
7995
8291
|
code(JSON.stringify(result.error, null, 2))
|
|
7996
8292
|
] }),
|
|
7997
|
-
result.meta != null && /* @__PURE__ */ (0,
|
|
7998
|
-
/* @__PURE__ */ (0,
|
|
8293
|
+
result.meta != null && /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)("div", { children: [
|
|
8294
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsx)("p", { children: t("metadata") }),
|
|
7999
8295
|
code(JSON.stringify(result.meta, null, 2))
|
|
8000
8296
|
] })
|
|
8001
8297
|
] })
|
|
8002
8298
|
] })
|
|
8003
8299
|
}
|
|
8004
8300
|
),
|
|
8005
|
-
/* @__PURE__ */ (0,
|
|
8006
|
-
/* @__PURE__ */ (0,
|
|
8007
|
-
props.inspect !== void 0 && /* @__PURE__ */ (0,
|
|
8301
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsxs)("div", { className: "dsmm-role-actions", children: [
|
|
8302
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsx)("p", { className: "dsmm-role-status", role: "status", children: t(state) }),
|
|
8303
|
+
props.inspect !== void 0 && /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(import_dsh_client_ui_primitives10.Button, { variant: "ghost", size: "sm", onClick: props.inspect, children: t("inspect") })
|
|
8008
8304
|
] })
|
|
8009
8305
|
] });
|
|
8010
8306
|
}
|
|
@@ -8331,17 +8627,17 @@ var ChildrenController = class {
|
|
|
8331
8627
|
};
|
|
8332
8628
|
|
|
8333
8629
|
// src/client/ChildrenPanel.tsx
|
|
8334
|
-
var
|
|
8335
|
-
var
|
|
8336
|
-
var
|
|
8630
|
+
var import_react10 = require("react");
|
|
8631
|
+
var import_dsh_client_ui_primitives11 = require("@deepseek-ai/dsh-client-ui-primitives");
|
|
8632
|
+
var import_jsx_runtime13 = require("react/jsx-runtime");
|
|
8337
8633
|
function ControlAvailability({ value, label, t }) {
|
|
8338
|
-
return /* @__PURE__ */ (0,
|
|
8339
|
-
/* @__PURE__ */ (0,
|
|
8634
|
+
return /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)("div", { className: "dsmm-availability", children: [
|
|
8635
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsxs)("p", { children: [
|
|
8340
8636
|
t(label),
|
|
8341
8637
|
": ",
|
|
8342
8638
|
t(value?.enabled === true ? "enabled" : "disabled")
|
|
8343
8639
|
] }),
|
|
8344
|
-
value?.enabled !== true && /* @__PURE__ */ (0,
|
|
8640
|
+
value?.enabled !== true && /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("p", { className: "dsmm-hint", children: t(`reason:${value?.reason ?? "unavailable"}`) })
|
|
8345
8641
|
] });
|
|
8346
8642
|
}
|
|
8347
8643
|
function routeText(route3) {
|
|
@@ -8350,38 +8646,38 @@ function routeText(route3) {
|
|
|
8350
8646
|
function RouteComparisonDetails({ value, t }) {
|
|
8351
8647
|
const initial = value?.initialRoute, live = value?.liveRoute;
|
|
8352
8648
|
const liveReasons = { "no-own-request-header": "routeNoOwnHeader", "invalid-own-request-header": "routeInvalidOwnHeader", "not-observed": "routeNotObserved" };
|
|
8353
|
-
return /* @__PURE__ */ (0,
|
|
8354
|
-
value === void 0 && /* @__PURE__ */ (0,
|
|
8355
|
-
/* @__PURE__ */ (0,
|
|
8356
|
-
/* @__PURE__ */ (0,
|
|
8357
|
-
/* @__PURE__ */ (0,
|
|
8358
|
-
initial?.status === "known" ? /* @__PURE__ */ (0,
|
|
8359
|
-
/* @__PURE__ */ (0,
|
|
8360
|
-
/* @__PURE__ */ (0,
|
|
8649
|
+
return /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)("div", { className: "dsmm-availability", children: [
|
|
8650
|
+
value === void 0 && /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("p", { className: "dsmm-hint", children: t("comparisonUnobserved") }),
|
|
8651
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsxs)("dl", { className: "dsmm-child-meta", children: [
|
|
8652
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)("dt", { children: t("initialRoute") }),
|
|
8653
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)("dd", { children: initial?.status === "known" ? routeText(initial.route) : t("routeUnknown") }),
|
|
8654
|
+
initial?.status === "known" ? /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)(import_jsx_runtime13.Fragment, { children: [
|
|
8655
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)("dt", { children: t("initialRouteSource") }),
|
|
8656
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsxs)("dd", { children: [
|
|
8361
8657
|
t("routeCaptureSource"),
|
|
8362
8658
|
" · ",
|
|
8363
8659
|
initial.source
|
|
8364
8660
|
] })
|
|
8365
|
-
] }) : initial !== void 0 && /* @__PURE__ */ (0,
|
|
8366
|
-
/* @__PURE__ */ (0,
|
|
8367
|
-
/* @__PURE__ */ (0,
|
|
8661
|
+
] }) : initial !== void 0 && /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)(import_jsx_runtime13.Fragment, { children: [
|
|
8662
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)("dt", { children: t("initialRouteReason") }),
|
|
8663
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsxs)("dd", { children: [
|
|
8368
8664
|
t("routeMissingCapture"),
|
|
8369
8665
|
" · ",
|
|
8370
8666
|
initial.reason
|
|
8371
8667
|
] })
|
|
8372
8668
|
] }),
|
|
8373
|
-
/* @__PURE__ */ (0,
|
|
8374
|
-
/* @__PURE__ */ (0,
|
|
8375
|
-
live?.status === "known" ? /* @__PURE__ */ (0,
|
|
8376
|
-
/* @__PURE__ */ (0,
|
|
8377
|
-
/* @__PURE__ */ (0,
|
|
8669
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)("dt", { children: t("liveRoute") }),
|
|
8670
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)("dd", { children: live?.status === "known" ? routeText(live.route) : t("routeUnknown") }),
|
|
8671
|
+
live?.status === "known" ? /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)(import_jsx_runtime13.Fragment, { children: [
|
|
8672
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)("dt", { children: t("liveRouteSource") }),
|
|
8673
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsxs)("dd", { children: [
|
|
8378
8674
|
t("routeOwnHeaderSource"),
|
|
8379
8675
|
" · ",
|
|
8380
8676
|
live.source
|
|
8381
8677
|
] })
|
|
8382
|
-
] }) : live !== void 0 && /* @__PURE__ */ (0,
|
|
8383
|
-
/* @__PURE__ */ (0,
|
|
8384
|
-
/* @__PURE__ */ (0,
|
|
8678
|
+
] }) : live !== void 0 && /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)(import_jsx_runtime13.Fragment, { children: [
|
|
8679
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)("dt", { children: t("liveRouteReason") }),
|
|
8680
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsxs)("dd", { children: [
|
|
8385
8681
|
t(liveReasons[live.reason]),
|
|
8386
8682
|
" · ",
|
|
8387
8683
|
live.reason
|
|
@@ -8391,69 +8687,69 @@ function RouteComparisonDetails({ value, t }) {
|
|
|
8391
8687
|
] });
|
|
8392
8688
|
}
|
|
8393
8689
|
function InvocationDetails({ value, t, showComparison = true }) {
|
|
8394
|
-
if (value === void 0) return /* @__PURE__ */ (0,
|
|
8395
|
-
return /* @__PURE__ */ (0,
|
|
8396
|
-
showComparison && /* @__PURE__ */ (0,
|
|
8397
|
-
/* @__PURE__ */ (0,
|
|
8398
|
-
/* @__PURE__ */ (0,
|
|
8399
|
-
/* @__PURE__ */ (0,
|
|
8690
|
+
if (value === void 0) return /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("p", { className: "dsmm-hint", children: t("invocationUnavailable") });
|
|
8691
|
+
return /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)(import_jsx_runtime13.Fragment, { children: [
|
|
8692
|
+
showComparison && /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(RouteComparisonDetails, { value: value.routeComparison, t }),
|
|
8693
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsxs)("dl", { className: "dsmm-child-meta", children: [
|
|
8694
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)("dt", { children: t("role") }),
|
|
8695
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsxs)("dd", { children: [
|
|
8400
8696
|
value.label,
|
|
8401
8697
|
" · ",
|
|
8402
8698
|
value.role
|
|
8403
8699
|
] }),
|
|
8404
|
-
/* @__PURE__ */ (0,
|
|
8405
|
-
/* @__PURE__ */ (0,
|
|
8406
|
-
/* @__PURE__ */ (0,
|
|
8407
|
-
/* @__PURE__ */ (0,
|
|
8408
|
-
/* @__PURE__ */ (0,
|
|
8409
|
-
/* @__PURE__ */ (0,
|
|
8410
|
-
/* @__PURE__ */ (0,
|
|
8411
|
-
/* @__PURE__ */ (0,
|
|
8412
|
-
value.runId !== void 0 && /* @__PURE__ */ (0,
|
|
8413
|
-
/* @__PURE__ */ (0,
|
|
8414
|
-
/* @__PURE__ */ (0,
|
|
8700
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)("dt", { children: t("level") }),
|
|
8701
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)("dd", { children: value.level }),
|
|
8702
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)("dt", { children: t("mode") }),
|
|
8703
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)("dd", { children: value.mode }),
|
|
8704
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)("dt", { children: t("reportedRoute") }),
|
|
8705
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)("dd", { children: value.route === void 0 ? t("routeUnreported") : routeText(value.route) }),
|
|
8706
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)("dt", { children: t("routeSource") }),
|
|
8707
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)("dd", { children: value.routeSource }),
|
|
8708
|
+
value.runId !== void 0 && /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)(import_jsx_runtime13.Fragment, { children: [
|
|
8709
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)("dt", { children: t("runId") }),
|
|
8710
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)("dd", { children: value.runId })
|
|
8415
8711
|
] }),
|
|
8416
|
-
value.childId !== void 0 && /* @__PURE__ */ (0,
|
|
8417
|
-
/* @__PURE__ */ (0,
|
|
8418
|
-
/* @__PURE__ */ (0,
|
|
8712
|
+
value.childId !== void 0 && /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)(import_jsx_runtime13.Fragment, { children: [
|
|
8713
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)("dt", { children: t("childId") }),
|
|
8714
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)("dd", { children: value.childId })
|
|
8419
8715
|
] }),
|
|
8420
|
-
value.jobId !== void 0 && /* @__PURE__ */ (0,
|
|
8421
|
-
/* @__PURE__ */ (0,
|
|
8422
|
-
/* @__PURE__ */ (0,
|
|
8716
|
+
value.jobId !== void 0 && /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)(import_jsx_runtime13.Fragment, { children: [
|
|
8717
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)("dt", { children: t("jobId") }),
|
|
8718
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)("dd", { children: value.jobId })
|
|
8423
8719
|
] })
|
|
8424
8720
|
] })
|
|
8425
8721
|
] });
|
|
8426
8722
|
}
|
|
8427
8723
|
function Issue2({ value, t }) {
|
|
8428
8724
|
if (!value) return null;
|
|
8429
|
-
return /* @__PURE__ */ (0,
|
|
8430
|
-
/* @__PURE__ */ (0,
|
|
8431
|
-
/* @__PURE__ */ (0,
|
|
8725
|
+
return /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)("div", { className: "dsmm-issue", role: "alert", children: [
|
|
8726
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)("p", { children: t(value.unknown ? "unknownAction" : "error", { code: value.code }) }),
|
|
8727
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsxs)("p", { children: [
|
|
8432
8728
|
value.code,
|
|
8433
8729
|
value.field === void 0 ? "" : ` · ${t("field")}: ${value.field}`
|
|
8434
8730
|
] }),
|
|
8435
|
-
value.reason !== void 0 && /* @__PURE__ */ (0,
|
|
8731
|
+
value.reason !== void 0 && /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("p", { children: t(`reason:${value.reason}`) })
|
|
8436
8732
|
] });
|
|
8437
8733
|
}
|
|
8438
8734
|
function Outcome({ value, t }) {
|
|
8439
8735
|
if (!value) return null;
|
|
8440
|
-
return /* @__PURE__ */ (0,
|
|
8736
|
+
return /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("div", { className: "dsmm-availability", role: "status", "aria-live": "polite", children: value.kind === "prompt" ? /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("p", { children: t("promptAccepted", { id: value.receipt.messageId }) }) : /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("p", { children: t("interruptAccepted") }) });
|
|
8441
8737
|
}
|
|
8442
|
-
function ChildComposer({ child: child2, state, actions:
|
|
8443
|
-
const prefix = (0,
|
|
8738
|
+
function ChildComposer({ child: child2, state, actions: actions3, t }) {
|
|
8739
|
+
const prefix = (0, import_react10.useId)(), picker = (0, import_react10.useRef)(null), generation = state.generation, key = childActionKey(child2.id);
|
|
8444
8740
|
const draft2 = state.drafts.get(child2.id) ?? EMPTY_CHILD_DRAFT;
|
|
8445
8741
|
const pending = state.pending.has(key), available = state.fresh && !state.reading && !pending;
|
|
8446
8742
|
const canPrompt = available && enabled(state.snapshot?.capabilities.prompt) && enabled(child2.controls.prompt) && !child2.readonly && child2.mode === "continuable";
|
|
8447
8743
|
const canImages = canPrompt && enabled(state.snapshot?.capabilities.images) && !draft2.imageBusy;
|
|
8448
8744
|
const submit = canPrompt && !draft2.uncertain && !draft2.imageBusy && (draft2.text.trim() !== "" || draft2.images.length > 0) && (draft2.images.length === 0 || enabled(state.snapshot?.capabilities.images));
|
|
8449
|
-
return /* @__PURE__ */ (0,
|
|
8745
|
+
return /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)("form", { className: "dsmm-child-composer", "aria-label": t("prompt"), onSubmit: (event) => {
|
|
8450
8746
|
event.preventDefault();
|
|
8451
|
-
if (submit) void
|
|
8747
|
+
if (submit) void actions3.prompt(generation, child2.id);
|
|
8452
8748
|
}, children: [
|
|
8453
|
-
!state.fresh && /* @__PURE__ */ (0,
|
|
8454
|
-
/* @__PURE__ */ (0,
|
|
8455
|
-
/* @__PURE__ */ (0,
|
|
8456
|
-
/* @__PURE__ */ (0,
|
|
8749
|
+
!state.fresh && /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("p", { className: "dsmm-hint", children: t(state.reading ? "reading" : "stale") }),
|
|
8750
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsxs)("div", { className: "dsmm-field", children: [
|
|
8751
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)("label", { htmlFor: `${prefix}-message`, children: t("text") }),
|
|
8752
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
|
|
8457
8753
|
"textarea",
|
|
8458
8754
|
{
|
|
8459
8755
|
id: `${prefix}-message`,
|
|
@@ -8462,179 +8758,179 @@ function ChildComposer({ child: child2, state, actions: actions2, t }) {
|
|
|
8462
8758
|
value: draft2.text,
|
|
8463
8759
|
disabled: pending,
|
|
8464
8760
|
"aria-describedby": `${prefix}-delivery-hint${draft2.uncertain ? ` ${prefix}-unknown` : ""}`,
|
|
8465
|
-
onChange: (event) =>
|
|
8761
|
+
onChange: (event) => actions3.editText(generation, child2.id, event.currentTarget.value)
|
|
8466
8762
|
}
|
|
8467
8763
|
)
|
|
8468
8764
|
] }),
|
|
8469
|
-
/* @__PURE__ */ (0,
|
|
8470
|
-
/* @__PURE__ */ (0,
|
|
8471
|
-
/* @__PURE__ */ (0,
|
|
8765
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsxs)("div", { className: "dsmm-field", children: [
|
|
8766
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)("label", { htmlFor: `${prefix}-delivery`, children: t("delivery") }),
|
|
8767
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsxs)("select", { id: `${prefix}-delivery`, value: draft2.delivery, disabled: !canPrompt, "aria-describedby": `${prefix}-delivery-hint`, onChange: (event) => {
|
|
8472
8768
|
const value = event.currentTarget.value;
|
|
8473
|
-
if (value === "queue" || value === "steer")
|
|
8769
|
+
if (value === "queue" || value === "steer") actions3.setDelivery(generation, child2.id, value);
|
|
8474
8770
|
}, children: [
|
|
8475
|
-
/* @__PURE__ */ (0,
|
|
8476
|
-
/* @__PURE__ */ (0,
|
|
8771
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)("option", { value: "queue", children: t("queue") }),
|
|
8772
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)("option", { value: "steer", children: t("steer") })
|
|
8477
8773
|
] }),
|
|
8478
|
-
/* @__PURE__ */ (0,
|
|
8774
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)("p", { id: `${prefix}-delivery-hint`, className: "dsmm-hint", children: t("deliveryHint") })
|
|
8479
8775
|
] }),
|
|
8480
|
-
/* @__PURE__ */ (0,
|
|
8481
|
-
/* @__PURE__ */ (0,
|
|
8482
|
-
/* @__PURE__ */ (0,
|
|
8776
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsxs)("div", { className: "dsmm-field", children: [
|
|
8777
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)("p", { id: `${prefix}-images-hint`, className: "dsmm-hint", children: t("imagesHint") }),
|
|
8778
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)("input", { ref: picker, hidden: true, type: "file", accept: "image/png,image/jpeg,image/webp,image/gif", multiple: true, disabled: !canImages, "aria-label": t("images"), onChange: (event) => {
|
|
8483
8779
|
const files = Array.from(event.currentTarget.files ?? []);
|
|
8484
8780
|
event.currentTarget.value = "";
|
|
8485
|
-
if (canImages) void
|
|
8781
|
+
if (canImages) void actions3.addImages(generation, child2.id, files);
|
|
8486
8782
|
} }),
|
|
8487
|
-
/* @__PURE__ */ (0,
|
|
8783
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)(import_dsh_client_ui_primitives11.Button, { type: "button", variant: "outline", disabled: !canImages, "aria-describedby": `${prefix}-images-hint`, onClick: () => {
|
|
8488
8784
|
if (canImages) picker.current?.click();
|
|
8489
8785
|
}, children: t("images") }),
|
|
8490
|
-
/* @__PURE__ */ (0,
|
|
8491
|
-
draft2.images.length > 0 && /* @__PURE__ */ (0,
|
|
8492
|
-
/* @__PURE__ */ (0,
|
|
8786
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)(ControlAvailability, { value: state.snapshot?.capabilities.images, label: "imageAvailability", t }),
|
|
8787
|
+
draft2.images.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("ul", { className: "dsmm-profile-list", children: draft2.images.map((image, index) => /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)("li", { children: [
|
|
8788
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsxs)("p", { children: [
|
|
8493
8789
|
image.name ?? image.mediaType,
|
|
8494
8790
|
" · ",
|
|
8495
8791
|
image.mediaType
|
|
8496
8792
|
] }),
|
|
8497
|
-
/* @__PURE__ */ (0,
|
|
8793
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)(import_dsh_client_ui_primitives11.Button, { type: "button", variant: "outline", disabled: pending || draft2.imageBusy, onClick: () => actions3.removeImage(generation, child2.id, image), "aria-label": `${t("removeImage")}: ${image.name ?? image.mediaType}`, children: t("removeImage") })
|
|
8498
8794
|
] }, index)) })
|
|
8499
8795
|
] }),
|
|
8500
|
-
draft2.uncertain && /* @__PURE__ */ (0,
|
|
8501
|
-
/* @__PURE__ */ (0,
|
|
8502
|
-
/* @__PURE__ */ (0,
|
|
8796
|
+
draft2.uncertain && /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)("div", { className: "dsmm-warning", children: [
|
|
8797
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)("p", { id: `${prefix}-unknown`, children: t("unknown") }),
|
|
8798
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)(import_dsh_client_ui_primitives11.Button, { type: "button", variant: "outline", disabled: !state.fresh || state.reading || pending, onClick: () => actions3.acknowledgeUnknown(generation, child2.id), children: t("acknowledge") })
|
|
8503
8799
|
] }),
|
|
8504
|
-
/* @__PURE__ */ (0,
|
|
8505
|
-
draft2.text.trim() === "" && draft2.images.length === 0 && /* @__PURE__ */ (0,
|
|
8506
|
-
draft2.images.length > 0 && !enabled(state.snapshot?.capabilities.images) && /* @__PURE__ */ (0,
|
|
8507
|
-
/* @__PURE__ */ (0,
|
|
8508
|
-
/* @__PURE__ */ (0,
|
|
8509
|
-
/* @__PURE__ */ (0,
|
|
8510
|
-
|
|
8800
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)(ControlAvailability, { value: !enabled(state.snapshot?.capabilities.prompt) ? state.snapshot?.capabilities.prompt : child2.controls.prompt, label: "promptAvailability", t }),
|
|
8801
|
+
draft2.text.trim() === "" && draft2.images.length === 0 && /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("p", { className: "dsmm-hint", children: t("emptyMessage") }),
|
|
8802
|
+
draft2.images.length > 0 && !enabled(state.snapshot?.capabilities.images) && /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("p", { className: "dsmm-hint", children: t("deniedImages") }),
|
|
8803
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsxs)("div", { className: "dsmm-actions", children: [
|
|
8804
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)(import_dsh_client_ui_primitives11.Button, { type: "submit", variant: "primary", disabled: !submit, children: t("send") }),
|
|
8805
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
|
|
8806
|
+
import_dsh_client_ui_primitives11.Button,
|
|
8511
8807
|
{
|
|
8512
8808
|
type: "button",
|
|
8513
8809
|
variant: "outline",
|
|
8514
8810
|
disabled: !available || !enabled(state.snapshot?.capabilities.interrupt) || !enabled(child2.controls.interrupt) || child2.readonly || child2.mode !== "continuable",
|
|
8515
|
-
onClick: () => void
|
|
8811
|
+
onClick: () => void actions3.interrupt(generation, child2.id),
|
|
8516
8812
|
children: t("interrupt")
|
|
8517
8813
|
}
|
|
8518
8814
|
)
|
|
8519
8815
|
] }),
|
|
8520
|
-
/* @__PURE__ */ (0,
|
|
8816
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)("p", { className: "dsmm-status", role: "status", "aria-live": "polite", children: pending ? t("pending") : draft2.imageBusy ? t("imageReading") : "" })
|
|
8521
8817
|
] });
|
|
8522
8818
|
}
|
|
8523
|
-
function ChildDetails({ child: child2, state, actions:
|
|
8524
|
-
return /* @__PURE__ */ (0,
|
|
8525
|
-
/* @__PURE__ */ (0,
|
|
8526
|
-
/* @__PURE__ */ (0,
|
|
8819
|
+
function ChildDetails({ child: child2, state, actions: actions3, t, inspection = false }) {
|
|
8820
|
+
return /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)("fieldset", { children: [
|
|
8821
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)("legend", { children: child2.label?.trim() ? child2.label : child2.id }),
|
|
8822
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsxs)("p", { children: [
|
|
8527
8823
|
t("childId"),
|
|
8528
8824
|
": ",
|
|
8529
8825
|
child2.id
|
|
8530
8826
|
] }),
|
|
8531
|
-
/* @__PURE__ */ (0,
|
|
8827
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsxs)("p", { children: [
|
|
8532
8828
|
t("parentId"),
|
|
8533
8829
|
": ",
|
|
8534
8830
|
child2.parentSessionId
|
|
8535
8831
|
] }),
|
|
8536
|
-
/* @__PURE__ */ (0,
|
|
8832
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsxs)("p", { children: [
|
|
8537
8833
|
t("mode"),
|
|
8538
8834
|
": ",
|
|
8539
8835
|
child2.mode
|
|
8540
8836
|
] }),
|
|
8541
|
-
/* @__PURE__ */ (0,
|
|
8837
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsxs)("p", { children: [
|
|
8542
8838
|
t("activity"),
|
|
8543
8839
|
": ",
|
|
8544
8840
|
child2.activity
|
|
8545
8841
|
] }),
|
|
8546
|
-
(inspection || child2.readonly) && /* @__PURE__ */ (0,
|
|
8547
|
-
child2.mode === "one-shot" && /* @__PURE__ */ (0,
|
|
8548
|
-
/* @__PURE__ */ (0,
|
|
8549
|
-
/* @__PURE__ */ (0,
|
|
8550
|
-
(!inspection || !child2.controls.prompt.enabled) && /* @__PURE__ */ (0,
|
|
8551
|
-
(!inspection || !child2.controls.interrupt.enabled) && /* @__PURE__ */ (0,
|
|
8552
|
-
!inspection && child2.mode === "continuable" && !child2.readonly && /* @__PURE__ */ (0,
|
|
8553
|
-
!inspection && /* @__PURE__ */ (0,
|
|
8554
|
-
/* @__PURE__ */ (0,
|
|
8555
|
-
/* @__PURE__ */ (0,
|
|
8842
|
+
(inspection || child2.readonly) && /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("p", { children: t("readonly") }),
|
|
8843
|
+
child2.mode === "one-shot" && /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("p", { className: "dsmm-hint", children: t("oneShot") }),
|
|
8844
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)(RouteComparisonDetails, { value: child2.routeComparison, t }),
|
|
8845
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)(InvocationDetails, { value: child2.invocation, t, showComparison: false }),
|
|
8846
|
+
(!inspection || !child2.controls.prompt.enabled) && /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(ControlAvailability, { value: child2.controls.prompt, label: "promptAvailability", t }),
|
|
8847
|
+
(!inspection || !child2.controls.interrupt.enabled) && /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(ControlAvailability, { value: child2.controls.interrupt, label: "interruptAvailability", t }),
|
|
8848
|
+
!inspection && child2.mode === "continuable" && !child2.readonly && /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(ChildComposer, { child: child2, state, actions: actions3, t }),
|
|
8849
|
+
!inspection && /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)(import_jsx_runtime13.Fragment, { children: [
|
|
8850
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)(Issue2, { value: state.issues.get(childActionKey(child2.id)), t }),
|
|
8851
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)(Outcome, { value: state.outcomes.get(childActionKey(child2.id)), t })
|
|
8556
8852
|
] })
|
|
8557
8853
|
] });
|
|
8558
8854
|
}
|
|
8559
8855
|
function ChildrenPanel(props) {
|
|
8560
8856
|
const state = props.useChildren((snapshot4) => snapshot4), { t } = props, generation = state.generation;
|
|
8561
|
-
if (props.sessionId === void 0 || props.sessionId !== state.sessionId) return /* @__PURE__ */ (0,
|
|
8562
|
-
/* @__PURE__ */ (0,
|
|
8563
|
-
/* @__PURE__ */ (0,
|
|
8857
|
+
if (props.sessionId === void 0 || props.sessionId !== state.sessionId) return /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)("section", { className: "dsmm-profiles dsmm-children", children: [
|
|
8858
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)("h2", { children: t("title") }),
|
|
8859
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)("p", { children: t(state.sessionId === null ? "noSession" : "foreign") })
|
|
8564
8860
|
] });
|
|
8565
8861
|
const data = state.snapshot;
|
|
8566
8862
|
const refreshingDisabled = state.reading || state.pending.size > 0 || [...state.drafts.values()].some((draft2) => draft2.imageBusy);
|
|
8567
|
-
return /* @__PURE__ */ (0,
|
|
8568
|
-
/* @__PURE__ */ (0,
|
|
8569
|
-
/* @__PURE__ */ (0,
|
|
8570
|
-
/* @__PURE__ */ (0,
|
|
8863
|
+
return /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)("section", { className: "dsmm-profiles dsmm-children", "aria-label": t("title"), "aria-busy": state.reading, children: [
|
|
8864
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)("h2", { children: t("title") }),
|
|
8865
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)("p", { className: "dsmm-hint", children: t("description") }),
|
|
8866
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsxs)("p", { children: [
|
|
8571
8867
|
t("session"),
|
|
8572
8868
|
": ",
|
|
8573
8869
|
state.sessionId
|
|
8574
8870
|
] }),
|
|
8575
|
-
/* @__PURE__ */ (0,
|
|
8576
|
-
/* @__PURE__ */ (0,
|
|
8577
|
-
/* @__PURE__ */ (0,
|
|
8578
|
-
data !== null && /* @__PURE__ */ (0,
|
|
8579
|
-
/* @__PURE__ */ (0,
|
|
8871
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)("div", { className: "dsmm-actions", children: /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(import_dsh_client_ui_primitives11.Button, { type: "button", variant: "outline", disabled: refreshingDisabled, onClick: () => void props.refresh(generation), children: t("refresh") }) }),
|
|
8872
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)("p", { className: "dsmm-status", role: "status", "aria-live": "polite", children: state.reading ? t("reading") : state.pending.size > 0 ? t("pending") : !state.fresh ? t(data === null ? "unavailable" : "stale") : "" }),
|
|
8873
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)(Issue2, { value: state.issue, t }),
|
|
8874
|
+
data !== null && /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)(import_jsx_runtime13.Fragment, { children: [
|
|
8875
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsxs)("p", { children: [
|
|
8580
8876
|
t("epoch"),
|
|
8581
8877
|
": ",
|
|
8582
8878
|
data.admissionEpoch
|
|
8583
8879
|
] }),
|
|
8584
|
-
/* @__PURE__ */ (0,
|
|
8585
|
-
/* @__PURE__ */ (0,
|
|
8880
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsxs)("section", { className: "dsmm-availability", children: [
|
|
8881
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsxs)("p", { children: [
|
|
8586
8882
|
t("runtime"),
|
|
8587
8883
|
": ",
|
|
8588
8884
|
data.capabilities.runtime.binding
|
|
8589
8885
|
] }),
|
|
8590
|
-
/* @__PURE__ */ (0,
|
|
8886
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsxs)("p", { children: [
|
|
8591
8887
|
t("fence"),
|
|
8592
8888
|
": ",
|
|
8593
8889
|
t(data.capabilities.runtime.deliveryFenceReady ? "yes" : "no")
|
|
8594
8890
|
] }),
|
|
8595
|
-
/* @__PURE__ */ (0,
|
|
8891
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsxs)("p", { children: [
|
|
8596
8892
|
t("restart"),
|
|
8597
8893
|
": ",
|
|
8598
8894
|
t(data.capabilities.runtime.restartRequired ? "yes" : "no")
|
|
8599
8895
|
] }),
|
|
8600
|
-
data.capabilities.runtime.reason !== void 0 && /* @__PURE__ */ (0,
|
|
8601
|
-
/* @__PURE__ */ (0,
|
|
8602
|
-
/* @__PURE__ */ (0,
|
|
8896
|
+
data.capabilities.runtime.reason !== void 0 && /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("p", { children: t("authority") }),
|
|
8897
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)(ControlAvailability, { value: data.capabilities.prompt, label: "promptAvailability", t }),
|
|
8898
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)(ControlAvailability, { value: data.capabilities.interrupt, label: "interruptAvailability", t })
|
|
8603
8899
|
] }),
|
|
8604
|
-
/* @__PURE__ */ (0,
|
|
8605
|
-
/* @__PURE__ */ (0,
|
|
8606
|
-
/* @__PURE__ */ (0,
|
|
8607
|
-
data.children.length === 0 ? /* @__PURE__ */ (0,
|
|
8900
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)("p", { className: "dsmm-hint", children: t("backgroundHint") }),
|
|
8901
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsxs)("section", { className: "dsmm-zone", "aria-label": t("children"), children: [
|
|
8902
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)("h3", { children: t("children") }),
|
|
8903
|
+
data.children.length === 0 ? /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("p", { className: "dsmm-hint", children: t("emptyChildren") }) : data.children.map((child2) => /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(ChildDetails, { child: child2, state, actions: props, t }, child2.id))
|
|
8608
8904
|
] })
|
|
8609
8905
|
] }),
|
|
8610
|
-
/* @__PURE__ */ (0,
|
|
8611
|
-
/* @__PURE__ */ (0,
|
|
8612
|
-
/* @__PURE__ */ (0,
|
|
8613
|
-
state.descendants === null ? /* @__PURE__ */ (0,
|
|
8614
|
-
/* @__PURE__ */ (0,
|
|
8906
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsxs)("section", { className: "dsmm-zone", "aria-label": t("descendants"), children: [
|
|
8907
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)("h3", { children: t("descendants") }),
|
|
8908
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)(Issue2, { value: state.descendantIssue, t }),
|
|
8909
|
+
state.descendants === null ? /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("p", { className: "dsmm-hint", children: t("treeUnavailable") }) : state.descendants.descendants.length === 0 ? /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("p", { className: "dsmm-hint", children: t("emptyDescendants") }) : state.descendants.descendants.map((entry, index) => /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)("div", { className: "dsmm-availability", children: [
|
|
8910
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsxs)("p", { children: [
|
|
8615
8911
|
t("depth"),
|
|
8616
8912
|
": ",
|
|
8617
8913
|
entry.depth
|
|
8618
8914
|
] }),
|
|
8619
|
-
entry.kind === "diagnostic" ? /* @__PURE__ */ (0,
|
|
8620
|
-
/* @__PURE__ */ (0,
|
|
8621
|
-
/* @__PURE__ */ (0,
|
|
8915
|
+
entry.kind === "diagnostic" ? /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)("div", { className: "dsmm-issue", children: [
|
|
8916
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)("p", { children: t("diagnostic", { reason: entry.reason }) }),
|
|
8917
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsxs)("p", { children: [
|
|
8622
8918
|
t("childId"),
|
|
8623
8919
|
": ",
|
|
8624
8920
|
entry.id
|
|
8625
8921
|
] }),
|
|
8626
|
-
/* @__PURE__ */ (0,
|
|
8922
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsxs)("p", { children: [
|
|
8627
8923
|
t("parentId"),
|
|
8628
8924
|
": ",
|
|
8629
8925
|
entry.parentSessionId
|
|
8630
8926
|
] })
|
|
8631
|
-
] }) : /* @__PURE__ */ (0,
|
|
8632
|
-
/* @__PURE__ */ (0,
|
|
8927
|
+
] }) : /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)(import_jsx_runtime13.Fragment, { children: [
|
|
8928
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsxs)("p", { children: [
|
|
8633
8929
|
t("subtree"),
|
|
8634
8930
|
": ",
|
|
8635
8931
|
t(entry.hasChildren ? "yes" : "no")
|
|
8636
8932
|
] }),
|
|
8637
|
-
/* @__PURE__ */ (0,
|
|
8933
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)(ChildDetails, { child: entry.child, state, actions: props, t, inspection: true })
|
|
8638
8934
|
] })
|
|
8639
8935
|
] }, index))
|
|
8640
8936
|
] })
|