@dsmm/dsmm 0.3.12 → 0.3.13
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/README.md +2 -2
- package/docs/agent-presets.md +1 -1
- package/docs/compatibility.md +8 -2
- package/docs/deferred-native-approval-risk.md +1 -1
- package/docs/design.md +1 -1
- package/docs/lsp.md +1 -1
- package/docs/maintenance.md +9 -3
- package/docs/model-routing.md +1 -1
- package/docs/native-permissions.md +1 -1
- package/docs/profiles.md +21 -11
- package/docs/roadmap.md +2 -2
- package/docs/runtime-recovery.md +1 -1
- package/docs/safety-guards.md +1 -1
- package/docs/settings-status.md +1 -1
- package/docs/testing.md +85 -0
- package/lib/client/ProfileModelsDialog.d.ts +23 -0
- package/lib/client/ProfileModelsDialog.js +318 -0
- package/lib/client/ProfilesSection.js +178 -36
- package/lib/client/RoleToolView-data.d.ts +7 -0
- package/lib/client/RoleToolView-data.js +45 -0
- package/lib/client/RoleToolView-locales.d.ts +5 -0
- package/lib/client/RoleToolView-locales.js +2 -0
- package/lib/client/RoleToolView.js +33 -8
- package/lib/client/StructuredEditor.d.ts +32 -4
- package/lib/client/StructuredEditor.js +12 -40
- package/lib/client/diagnostics.d.ts +1 -0
- package/lib/client/diagnostics.js +9 -0
- package/lib/client/locales.d.ts +21 -0
- package/lib/client/locales.js +42 -0
- package/lib/client/styles.d.ts +1 -1
- package/lib/client/styles.js +89 -30
- package/lib/client.js +1940 -1024
- package/package.json +7 -2
package/lib/client.js
CHANGED
|
@@ -3372,6 +3372,12 @@ function draftWarnings(content2) {
|
|
|
3372
3372
|
if (label.length > 120 || /[\u0000-\u001f\u007f]/u.test(label) || label.trim() !== "" || new TextDecoder("utf-8", { fatal: true, ignoreBOM: true }).decode(new TextEncoder().encode(label)) !== label) return [];
|
|
3373
3373
|
return [diagnostic("blank-label", "label", fieldLocation(content2, tree, "label"))];
|
|
3374
3374
|
}
|
|
3375
|
+
function issueKey(issue) {
|
|
3376
|
+
if (issue.source === "selection") return issue.code === "conflict" ? "selectionConflict" : "appliedInvalid";
|
|
3377
|
+
if (issue.kind === "assembly") return "unavailable";
|
|
3378
|
+
if (issue.kind === "transport") return "transport";
|
|
3379
|
+
return issue.code === "conflict" || issue.code === "validation" ? issue.code : "io";
|
|
3380
|
+
}
|
|
3375
3381
|
function ProfileWarnings({ warnings: warnings2, t }) {
|
|
3376
3382
|
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_jsx_runtime.Fragment, { children: profileWarnings(warnings2).map((warning) => /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: "dsmm-warning", "data-dsmm-warning": true, children: [
|
|
3377
3383
|
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("p", { children: t("warningMarker", { code: warning.code, field: warning.field }) }),
|
|
@@ -4411,7 +4417,28 @@ var en = {
|
|
|
4411
4417
|
naturalEffort: "Reasoning Effort",
|
|
4412
4418
|
advanced: "Advanced JSONC",
|
|
4413
4419
|
rawInvalid: "Fix the invalid draft in Advanced JSONC to use these controls. Your draft was kept.",
|
|
4414
|
-
invalidNumber: "Enter a whole number within the limits."
|
|
4420
|
+
invalidNumber: "Enter a whole number within the limits.",
|
|
4421
|
+
configureAllAgentModels: "Configure all Agent models…",
|
|
4422
|
+
modelsDialogTitle: "Agent models and routing",
|
|
4423
|
+
modelsDialogDesc: "Configure primary routes, calling levels, fallback models, and execution policies for each Agent role.",
|
|
4424
|
+
searchRolesPlaceholder: "Search by role name or ID…",
|
|
4425
|
+
filterExplicitOverrides: "Explicit model overrides only",
|
|
4426
|
+
orchestratorNoLevelsHint: "Orchestrator uses primary route only; calling levels are not applicable.",
|
|
4427
|
+
noMatchingRoles: "No matching roles found.",
|
|
4428
|
+
fallbackCountSummary: "{count} fallback route(s)",
|
|
4429
|
+
fallbackExplicitEmptySummary: "Explicit empty ([])",
|
|
4430
|
+
levelsSummary: "Levels: {levels}",
|
|
4431
|
+
levelsInherited: "Inherited",
|
|
4432
|
+
fallbackInherited: "Inherited",
|
|
4433
|
+
roleSettingsSummary: "Status: {status} · Retry: {retry}",
|
|
4434
|
+
roleSettingsInherited: "Inherit",
|
|
4435
|
+
roleSettingsOverridden: "Explicit override",
|
|
4436
|
+
saveLockedReason: "Save locked: {count} invalid field(s)",
|
|
4437
|
+
jumpToField: "Locate error field",
|
|
4438
|
+
jumpToJsonc: "Locate in JSONC",
|
|
4439
|
+
jumpToRole: "Locate in Agent models dialog",
|
|
4440
|
+
roleNonModelSettings: "Non-model settings",
|
|
4441
|
+
inheritRouteDesc: "Inherit defaults"
|
|
4415
4442
|
};
|
|
4416
4443
|
var zh = {
|
|
4417
4444
|
sessionChooseWorkspace: "请先选择工作区新建会话,发送前再选择本次会话的配置。",
|
|
@@ -4689,7 +4716,28 @@ var zh = {
|
|
|
4689
4716
|
naturalEffort: "推理强度",
|
|
4690
4717
|
advanced: "高级 JSONC",
|
|
4691
4718
|
rawInvalid: "请先在高级 JSONC 中修正草稿,再使用这些控件。草稿已保留。",
|
|
4692
|
-
invalidNumber: "请输入范围内的整数。"
|
|
4719
|
+
invalidNumber: "请输入范围内的整数。",
|
|
4720
|
+
configureAllAgentModels: "配置全部 Agent 模型…",
|
|
4721
|
+
modelsDialogTitle: "Agent 模型与路由配置",
|
|
4722
|
+
modelsDialogDesc: "为每个 Agent 角色配置主路由、调用档位、备用模型及执行策略。",
|
|
4723
|
+
searchRolesPlaceholder: "按角色名称或 ID 搜索…",
|
|
4724
|
+
filterExplicitOverrides: "仅显式模型覆盖",
|
|
4725
|
+
orchestratorNoLevelsHint: "主协调角色仅使用主路由,不适用调用档位。",
|
|
4726
|
+
noMatchingRoles: "未找到匹配的角色。",
|
|
4727
|
+
fallbackCountSummary: "{count} 个备用路由",
|
|
4728
|
+
fallbackExplicitEmptySummary: "显式清空([])",
|
|
4729
|
+
levelsSummary: "档位:{levels}",
|
|
4730
|
+
levelsInherited: "继承",
|
|
4731
|
+
fallbackInherited: "继承",
|
|
4732
|
+
roleSettingsSummary: "状态:{status} · 重试:{retry}",
|
|
4733
|
+
roleSettingsInherited: "继承",
|
|
4734
|
+
roleSettingsOverridden: "显式覆盖",
|
|
4735
|
+
saveLockedReason: "保存已锁定:{count} 处字段无效",
|
|
4736
|
+
jumpToField: "定位错误字段",
|
|
4737
|
+
jumpToJsonc: "在 JSONC 中定位",
|
|
4738
|
+
jumpToRole: "在 Agent 模型弹窗中定位",
|
|
4739
|
+
roleNonModelSettings: "非模型设置",
|
|
4740
|
+
inheritRouteDesc: "继承默认"
|
|
4693
4741
|
};
|
|
4694
4742
|
var RETRY_FIELD_LABEL_KEYS = {
|
|
4695
4743
|
maxRetries: "retryCount",
|
|
@@ -4701,8 +4749,8 @@ var RETRY_FIELD_LABEL_KEYS = {
|
|
|
4701
4749
|
};
|
|
4702
4750
|
|
|
4703
4751
|
// src/client/ProfilesSection.tsx
|
|
4704
|
-
var
|
|
4705
|
-
var
|
|
4752
|
+
var import_react5 = require("react");
|
|
4753
|
+
var import_dsh_client_ui_primitives5 = require("@deepseek-ai/dsh-client-ui-primitives");
|
|
4706
4754
|
|
|
4707
4755
|
// src/client/StructuredEditor.tsx
|
|
4708
4756
|
var import_react2 = require("react");
|
|
@@ -4711,34 +4759,10 @@ var import_dsh_client_ui_primitives2 = require("@deepseek-ai/dsh-client-ui-primi
|
|
|
4711
4759
|
// src/profile-locale.ts
|
|
4712
4760
|
var DSMM_LOCALES = ["en", "zh-Hans", "zh-Hant", "ja", "ko", "de", "fr", "es", "pt-BR", "ru"];
|
|
4713
4761
|
|
|
4714
|
-
// src/client/RoleAvailability.tsx
|
|
4715
|
-
var import_jsx_runtime2 = require("react/jsx-runtime");
|
|
4716
|
-
function roleAvailability(value) {
|
|
4717
|
-
if (value === void 0) return void 0;
|
|
4718
|
-
try {
|
|
4719
|
-
return parseRoleAvailability(value);
|
|
4720
|
-
} catch {
|
|
4721
|
-
return void 0;
|
|
4722
|
-
}
|
|
4723
|
-
}
|
|
4724
|
-
function RoleAvailability({ value, t }) {
|
|
4725
|
-
const state = roleAvailability(value);
|
|
4726
|
-
if (state === void 0) return /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("p", { className: "dsmm-hint", children: t("availabilityUnknown") });
|
|
4727
|
-
return /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)("div", { className: "dsmm-availability", "data-dsmm-role-availability": state.id, children: [
|
|
4728
|
-
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)("p", { children: t(state.required ? "roleRequired" : "roleOptional", { reason: state.requiredReason ?? "—" }) }),
|
|
4729
|
-
state.reason !== void 0 && /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("p", { children: t("roleUnavailableReason", { reason: state.reason }) }),
|
|
4730
|
-
/* @__PURE__ */ (0, import_jsx_runtime2.jsxs)("details", { children: [
|
|
4731
|
-
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)("summary", { children: t("technicalDetails") }),
|
|
4732
|
-
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)("p", { children: t("roleCeiling", { startup: t(state.startupAvailable ? "enabled" : "disabled"), deployment: t(state.deploymentEnabled ? "enabled" : "disabled"), admitted: t(state.admitted ? "enabled" : "disabled") }) }),
|
|
4733
|
-
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)("p", { className: "dsmm-hint", children: t("roleProvenance", { source: state.source, capture: state.capture }) })
|
|
4734
|
-
] })
|
|
4735
|
-
] });
|
|
4736
|
-
}
|
|
4737
|
-
|
|
4738
4762
|
// src/client/EditableChoice.tsx
|
|
4739
4763
|
var import_react = require("react");
|
|
4740
4764
|
var import_dsh_client_ui_primitives = require("@deepseek-ai/dsh-client-ui-primitives");
|
|
4741
|
-
var
|
|
4765
|
+
var import_jsx_runtime2 = require("react/jsx-runtime");
|
|
4742
4766
|
function EditableChoice({ id: id2, label, value, options, disabled, placeholder, onChange, onSelect }) {
|
|
4743
4767
|
const input = (0, import_react.useRef)(null);
|
|
4744
4768
|
const [open, setOpen] = (0, import_react.useState)(false);
|
|
@@ -4765,8 +4789,8 @@ function EditableChoice({ id: id2, label, value, options, disabled, placeholder,
|
|
|
4765
4789
|
(0, import_react.useEffect)(() => {
|
|
4766
4790
|
if (visible && activeIndex >= 0) document.getElementById(`${id2}-choice-${activeIndex}`)?.scrollIntoView({ block: "nearest" });
|
|
4767
4791
|
}, [id2, visible, activeIndex]);
|
|
4768
|
-
return /* @__PURE__ */ (0,
|
|
4769
|
-
/* @__PURE__ */ (0,
|
|
4792
|
+
return /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)("div", { className: "dsmm-choice", children: [
|
|
4793
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
|
|
4770
4794
|
import_dsh_client_ui_primitives.Input,
|
|
4771
4795
|
{
|
|
4772
4796
|
ref: input,
|
|
@@ -4804,7 +4828,7 @@ function EditableChoice({ id: id2, label, value, options, disabled, placeholder,
|
|
|
4804
4828
|
}
|
|
4805
4829
|
}
|
|
4806
4830
|
),
|
|
4807
|
-
/* @__PURE__ */ (0,
|
|
4831
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
|
|
4808
4832
|
import_dsh_client_ui_primitives.Button,
|
|
4809
4833
|
{
|
|
4810
4834
|
type: "button",
|
|
@@ -4816,7 +4840,7 @@ function EditableChoice({ id: id2, label, value, options, disabled, placeholder,
|
|
|
4816
4840
|
"aria-haspopup": "listbox",
|
|
4817
4841
|
"aria-expanded": visible,
|
|
4818
4842
|
disabled: disabled || choices.length === 0,
|
|
4819
|
-
icon: /* @__PURE__ */ (0,
|
|
4843
|
+
icon: /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(import_dsh_client_ui_primitives.IconChevronDownOutlineRegular, {}),
|
|
4820
4844
|
onMouseDown: (event) => event.preventDefault(),
|
|
4821
4845
|
onClick: () => {
|
|
4822
4846
|
input.current?.focus();
|
|
@@ -4825,7 +4849,7 @@ function EditableChoice({ id: id2, label, value, options, disabled, placeholder,
|
|
|
4825
4849
|
}
|
|
4826
4850
|
}
|
|
4827
4851
|
),
|
|
4828
|
-
visible && /* @__PURE__ */ (0,
|
|
4852
|
+
visible && /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("ul", { className: "dsmm-choice-list", id: `${id2}-choices`, role: "listbox", "aria-label": label, children: choices.map((option, index) => /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
|
|
4829
4853
|
"li",
|
|
4830
4854
|
{
|
|
4831
4855
|
id: `${id2}-choice-${index}`,
|
|
@@ -4842,7 +4866,7 @@ function EditableChoice({ id: id2, label, value, options, disabled, placeholder,
|
|
|
4842
4866
|
}
|
|
4843
4867
|
|
|
4844
4868
|
// src/client/StructuredEditor.tsx
|
|
4845
|
-
var
|
|
4869
|
+
var import_jsx_runtime3 = require("react/jsx-runtime");
|
|
4846
4870
|
function RetryNumber({ id: id2, name: name2, field, value, inherited, path, disabled, actions: actions3, t }) {
|
|
4847
4871
|
const key = path.join(".");
|
|
4848
4872
|
const stored = actions3.getNumberDraft?.(key);
|
|
@@ -4862,9 +4886,9 @@ function RetryNumber({ id: id2, name: name2, field, value, inherited, path, disa
|
|
|
4862
4886
|
}, [value, key, actions3]);
|
|
4863
4887
|
const displayDraft = sourceChanged ? value === void 0 ? "" : String(value) : draft2;
|
|
4864
4888
|
const isInvalid = sourceChanged ? false : invalid2;
|
|
4865
|
-
return /* @__PURE__ */ (0,
|
|
4866
|
-
/* @__PURE__ */ (0,
|
|
4867
|
-
/* @__PURE__ */ (0,
|
|
4889
|
+
return /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)("div", { className: "dsmm-field", children: [
|
|
4890
|
+
/* @__PURE__ */ (0, import_jsx_runtime3.jsx)("label", { htmlFor: id2, children: t("retryField", { name: name2, field: t(RETRY_FIELD_LABEL_KEYS[field]) }) }),
|
|
4891
|
+
/* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
|
|
4868
4892
|
import_dsh_client_ui_primitives2.Input,
|
|
4869
4893
|
{
|
|
4870
4894
|
id: id2,
|
|
@@ -4897,8 +4921,8 @@ function RetryNumber({ id: id2, name: name2, field, value, inherited, path, disa
|
|
|
4897
4921
|
}
|
|
4898
4922
|
}
|
|
4899
4923
|
),
|
|
4900
|
-
/* @__PURE__ */ (0,
|
|
4901
|
-
isInvalid && /* @__PURE__ */ (0,
|
|
4924
|
+
/* @__PURE__ */ (0, import_jsx_runtime3.jsx)("p", { className: "dsmm-hint", id: `${id2}-hint`, children: t("retryBounds", { min, max, value: inherited ?? t("unknownDefault") }) }),
|
|
4925
|
+
isInvalid && /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("p", { id: `${id2}-invalid`, children: t("invalidNumber") })
|
|
4902
4926
|
] });
|
|
4903
4927
|
}
|
|
4904
4928
|
function RouteFields({ value, path, name: name2, catalog, disabled, edit, editRoute, t, naturalLabels }) {
|
|
@@ -4913,10 +4937,10 @@ function RouteFields({ value, path, name: name2, catalog, disabled, edit, editRo
|
|
|
4913
4937
|
const providerLabel = naturalLabels ? t("naturalProvider") : t("routeProvider", { name: name2 ?? "" });
|
|
4914
4938
|
const modelLabel = naturalLabels ? t("naturalModel") : t("routeModel", { name: name2 ?? "" });
|
|
4915
4939
|
const effortLabel = naturalLabels ? t("naturalEffort") : t("routeEffort", { name: name2 ?? "" });
|
|
4916
|
-
return /* @__PURE__ */ (0,
|
|
4917
|
-
/* @__PURE__ */ (0,
|
|
4918
|
-
/* @__PURE__ */ (0,
|
|
4919
|
-
/* @__PURE__ */ (0,
|
|
4940
|
+
return /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)("div", { className: "dsmm-route-fields", children: [
|
|
4941
|
+
/* @__PURE__ */ (0, import_jsx_runtime3.jsxs)("div", { className: "dsmm-field", children: [
|
|
4942
|
+
/* @__PURE__ */ (0, import_jsx_runtime3.jsx)("label", { htmlFor: `${prefix}-provider`, children: providerLabel }),
|
|
4943
|
+
/* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
|
|
4920
4944
|
EditableChoice,
|
|
4921
4945
|
{
|
|
4922
4946
|
id: `${prefix}-provider`,
|
|
@@ -4929,9 +4953,9 @@ function RouteFields({ value, path, name: name2, catalog, disabled, edit, editRo
|
|
|
4929
4953
|
}
|
|
4930
4954
|
)
|
|
4931
4955
|
] }),
|
|
4932
|
-
/* @__PURE__ */ (0,
|
|
4933
|
-
/* @__PURE__ */ (0,
|
|
4934
|
-
/* @__PURE__ */ (0,
|
|
4956
|
+
/* @__PURE__ */ (0, import_jsx_runtime3.jsxs)("div", { className: "dsmm-field", children: [
|
|
4957
|
+
/* @__PURE__ */ (0, import_jsx_runtime3.jsx)("label", { htmlFor: `${prefix}-model`, children: modelLabel }),
|
|
4958
|
+
/* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
|
|
4935
4959
|
EditableChoice,
|
|
4936
4960
|
{
|
|
4937
4961
|
id: `${prefix}-model`,
|
|
@@ -4943,9 +4967,9 @@ function RouteFields({ value, path, name: name2, catalog, disabled, edit, editRo
|
|
|
4943
4967
|
}
|
|
4944
4968
|
)
|
|
4945
4969
|
] }),
|
|
4946
|
-
/* @__PURE__ */ (0,
|
|
4947
|
-
/* @__PURE__ */ (0,
|
|
4948
|
-
/* @__PURE__ */ (0,
|
|
4970
|
+
/* @__PURE__ */ (0, import_jsx_runtime3.jsxs)("div", { className: "dsmm-field", children: [
|
|
4971
|
+
/* @__PURE__ */ (0, import_jsx_runtime3.jsx)("label", { htmlFor: `${prefix}-effort`, children: effortLabel }),
|
|
4972
|
+
/* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
|
|
4949
4973
|
EditableChoice,
|
|
4950
4974
|
{
|
|
4951
4975
|
id: `${prefix}-effort`,
|
|
@@ -4962,17 +4986,17 @@ function RouteFields({ value, path, name: name2, catalog, disabled, edit, editRo
|
|
|
4962
4986
|
}
|
|
4963
4987
|
function PolicyFields({ value, inherited, path, name: name2, disabled, actions: actions3, t }) {
|
|
4964
4988
|
const prefix = (0, import_react2.useId)();
|
|
4965
|
-
return /* @__PURE__ */ (0,
|
|
4966
|
-
/* @__PURE__ */ (0,
|
|
4967
|
-
/* @__PURE__ */ (0,
|
|
4968
|
-
/* @__PURE__ */ (0,
|
|
4969
|
-
/* @__PURE__ */ (0,
|
|
4970
|
-
/* @__PURE__ */ (0,
|
|
4971
|
-
/* @__PURE__ */ (0,
|
|
4989
|
+
return /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)("div", { className: "dsmm-policy-fields", children: [
|
|
4990
|
+
/* @__PURE__ */ (0, import_jsx_runtime3.jsxs)("div", { className: "dsmm-field", children: [
|
|
4991
|
+
/* @__PURE__ */ (0, import_jsx_runtime3.jsx)("label", { htmlFor: `${prefix}-strategy`, children: t("strategy", { name: name2 }) }),
|
|
4992
|
+
/* @__PURE__ */ (0, import_jsx_runtime3.jsxs)("select", { id: `${prefix}-strategy`, disabled, value: value.strategy ?? "", onChange: (event) => actions3.editPath([...path, "strategy"], event.currentTarget.value || void 0), children: [
|
|
4993
|
+
/* @__PURE__ */ (0, import_jsx_runtime3.jsx)("option", { value: "", children: t("inheritStrategy", { value: inherited?.strategy ?? t("unknownDefault") }) }),
|
|
4994
|
+
/* @__PURE__ */ (0, import_jsx_runtime3.jsx)("option", { value: "startup-lock", children: t("startupLock") }),
|
|
4995
|
+
/* @__PURE__ */ (0, import_jsx_runtime3.jsx)("option", { value: "rate-limit-fallback", children: t("rateFallback") })
|
|
4972
4996
|
] })
|
|
4973
4997
|
] }),
|
|
4974
|
-
/* @__PURE__ */ (0,
|
|
4975
|
-
/* @__PURE__ */ (0,
|
|
4998
|
+
/* @__PURE__ */ (0, import_jsx_runtime3.jsx)("p", { className: "dsmm-hint", children: t("strategyHint") }),
|
|
4999
|
+
/* @__PURE__ */ (0, import_jsx_runtime3.jsx)("div", { className: "dsmm-route-fields", children: Object.keys(DSMM_RATE_LIMIT_BOUNDS).map((field) => /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
|
|
4976
5000
|
RetryNumber,
|
|
4977
5001
|
{
|
|
4978
5002
|
id: `${prefix}-${field}`,
|
|
@@ -4992,22 +5016,22 @@ function PolicyFields({ value, inherited, path, name: name2, disabled, actions:
|
|
|
4992
5016
|
function LevelFields({ level: level2, value, path, catalog, disabled, actions: actions3, t }) {
|
|
4993
5017
|
const prefix = (0, import_react2.useId)();
|
|
4994
5018
|
const mode = value === void 0 ? "inherit" : value.provider === void 0 ? "effort" : "route";
|
|
4995
|
-
return /* @__PURE__ */ (0,
|
|
4996
|
-
/* @__PURE__ */ (0,
|
|
4997
|
-
/* @__PURE__ */ (0,
|
|
4998
|
-
/* @__PURE__ */ (0,
|
|
4999
|
-
/* @__PURE__ */ (0,
|
|
5019
|
+
return /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)("fieldset", { "data-dsmm-level": level2, children: [
|
|
5020
|
+
/* @__PURE__ */ (0, import_jsx_runtime3.jsx)("legend", { children: t("levelName", { level: level2 }) }),
|
|
5021
|
+
/* @__PURE__ */ (0, import_jsx_runtime3.jsxs)("div", { className: "dsmm-field", children: [
|
|
5022
|
+
/* @__PURE__ */ (0, import_jsx_runtime3.jsx)("label", { htmlFor: `${prefix}-mode`, children: t("levelMode", { level: level2 }) }),
|
|
5023
|
+
/* @__PURE__ */ (0, import_jsx_runtime3.jsxs)("select", { id: `${prefix}-mode`, value: mode, disabled, onChange: (event) => actions3.editPath(
|
|
5000
5024
|
path,
|
|
5001
5025
|
event.currentTarget.value === "inherit" ? void 0 : event.currentTarget.value === "effort" ? { reasoningEffort: "" } : { provider: "", model: "" }
|
|
5002
5026
|
), children: [
|
|
5003
|
-
/* @__PURE__ */ (0,
|
|
5004
|
-
/* @__PURE__ */ (0,
|
|
5005
|
-
/* @__PURE__ */ (0,
|
|
5027
|
+
/* @__PURE__ */ (0, import_jsx_runtime3.jsx)("option", { value: "inherit", children: t("levelUnconfigured") }),
|
|
5028
|
+
/* @__PURE__ */ (0, import_jsx_runtime3.jsx)("option", { value: "effort", children: t("levelEffortOnly") }),
|
|
5029
|
+
/* @__PURE__ */ (0, import_jsx_runtime3.jsx)("option", { value: "route", children: t("levelFullRoute") })
|
|
5006
5030
|
] })
|
|
5007
5031
|
] }),
|
|
5008
|
-
mode === "effort" && /* @__PURE__ */ (0,
|
|
5009
|
-
/* @__PURE__ */ (0,
|
|
5010
|
-
/* @__PURE__ */ (0,
|
|
5032
|
+
mode === "effort" && /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)("div", { className: "dsmm-field", children: [
|
|
5033
|
+
/* @__PURE__ */ (0, import_jsx_runtime3.jsx)("label", { htmlFor: `${prefix}-effort`, children: t("routeEffort", { name: level2 }) }),
|
|
5034
|
+
/* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
|
|
5011
5035
|
EditableChoice,
|
|
5012
5036
|
{
|
|
5013
5037
|
id: `${prefix}-effort`,
|
|
@@ -5019,152 +5043,674 @@ function LevelFields({ level: level2, value, path, catalog, disabled, actions: a
|
|
|
5019
5043
|
}
|
|
5020
5044
|
)
|
|
5021
5045
|
] }),
|
|
5022
|
-
value?.provider !== void 0 && /* @__PURE__ */ (0,
|
|
5046
|
+
value?.provider !== void 0 && /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(RouteFields, { value, path, name: t("levelName", { level: level2 }), catalog, disabled, edit: actions3.editPath, editRoute: actions3.editRoute, t })
|
|
5023
5047
|
] });
|
|
5024
5048
|
}
|
|
5025
|
-
function AdvancedSettings({ state, actions: actions3, disabled,
|
|
5049
|
+
function AdvancedSettings({ state, actions: actions3, disabled, document: propDoc, isInvalidProjection: propInvalid, t }) {
|
|
5026
5050
|
const prefix = (0, import_react2.useId)();
|
|
5027
|
-
const [selectedRole, setSelectedRole] = (0, import_react2.useState)("dsmm-orchestrator");
|
|
5028
5051
|
const editor = state.editor;
|
|
5029
5052
|
if (editor === null) return null;
|
|
5030
|
-
const rawDoc = structuredDocument(editor.content);
|
|
5031
|
-
const
|
|
5032
|
-
if (rawDoc
|
|
5033
|
-
|
|
5034
|
-
}
|
|
5035
|
-
const document2 = rawDoc ?? lastValidDocRef.current;
|
|
5036
|
-
const isInvalidProjection = rawDoc === null;
|
|
5037
|
-
if (document2 === null) return /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("p", { className: "dsmm-hint", "data-dsmm-structured-invalid": true, children: t("rawInvalid") });
|
|
5053
|
+
const rawDoc = propDoc !== void 0 ? propDoc : structuredDocument(editor.content);
|
|
5054
|
+
const isInvalidProjection = propInvalid !== void 0 ? propInvalid : rawDoc === null;
|
|
5055
|
+
if (rawDoc === null) return /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("p", { className: "dsmm-hint", "data-dsmm-structured-invalid": true, children: t("rawInvalid") });
|
|
5056
|
+
const document2 = rawDoc;
|
|
5038
5057
|
const effectiveDisabled = disabled || isInvalidProjection;
|
|
5039
|
-
const roles2 = state.snapshot?.roles ?? [];
|
|
5040
|
-
const role3 = roles2.find((candidate) => candidate.id === selectedRole) ?? roles2[0];
|
|
5041
|
-
const policy = role3 === void 0 ? void 0 : document2.roleRouting[role3.id] ?? {};
|
|
5042
5058
|
const baseline = state.snapshot?.editorDefaults;
|
|
5043
|
-
let inherited;
|
|
5044
|
-
try {
|
|
5045
|
-
if (baseline !== void 0) {
|
|
5046
|
-
const profileDefaults = { strategy: document2.runtimePolicy.strategy ?? baseline.strategy, rateLimit: normalizeRateLimitPolicy(document2.runtimePolicy.rateLimit, baseline.rateLimit) };
|
|
5047
|
-
inherited = { strategy: role3?.runtimePolicy?.strategy ?? profileDefaults.strategy, rateLimit: normalizeRateLimitPolicy(role3?.runtimePolicy?.rateLimit, profileDefaults.rateLimit) };
|
|
5048
|
-
}
|
|
5049
|
-
} catch {
|
|
5050
|
-
}
|
|
5051
|
-
const rolePath = ["settings", "roleRouting", role3?.id ?? ""];
|
|
5052
|
-
const availability2 = roleAvailability(role3?.availability);
|
|
5053
|
-
const namedRoles = document2.settings.roles;
|
|
5054
5059
|
const topology = document2.settings.subagents?.toolTopology;
|
|
5055
5060
|
const gitGuard = document2.guards?.gitWriteGuard;
|
|
5056
5061
|
const gitScope = document2.guards?.gitWriteScope;
|
|
5057
5062
|
const isGuardOff = gitGuard === "off";
|
|
5058
|
-
return /* @__PURE__ */ (0,
|
|
5059
|
-
isInvalidProjection && /* @__PURE__ */ (0,
|
|
5060
|
-
/* @__PURE__ */ (0,
|
|
5061
|
-
/* @__PURE__ */ (0,
|
|
5062
|
-
/* @__PURE__ */ (0,
|
|
5063
|
-
roles2.length === 0 && /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("option", { value: "", children: t("rolesUnavailable") }),
|
|
5064
|
-
roles2.map((candidate) => /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("option", { value: candidate.id, children: [
|
|
5065
|
-
candidate.label,
|
|
5066
|
-
candidate.enabled ? "" : ` — ${t("roleDisabled")}`
|
|
5067
|
-
] }, candidate.id))
|
|
5068
|
-
] })
|
|
5063
|
+
return /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)("div", { className: "dsmm-structured", "data-dsmm-structured": true, children: [
|
|
5064
|
+
isInvalidProjection && /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("p", { className: "dsmm-hint", "data-dsmm-structured-invalid": true, children: t("rawInvalid") }),
|
|
5065
|
+
/* @__PURE__ */ (0, import_jsx_runtime3.jsxs)("fieldset", { children: [
|
|
5066
|
+
/* @__PURE__ */ (0, import_jsx_runtime3.jsx)("legend", { children: t("profileDefaults") }),
|
|
5067
|
+
/* @__PURE__ */ (0, import_jsx_runtime3.jsx)(PolicyFields, { t, value: document2.runtimePolicy, inherited: baseline, path: ["settings", "runtimePolicy"], name: t("profileDefaults"), disabled: effectiveDisabled, actions: actions3 })
|
|
5069
5068
|
] }),
|
|
5070
|
-
|
|
5071
|
-
/* @__PURE__ */ (0,
|
|
5072
|
-
/* @__PURE__ */ (0,
|
|
5073
|
-
|
|
5074
|
-
/* @__PURE__ */ (0,
|
|
5075
|
-
|
|
5076
|
-
/* @__PURE__ */ (0,
|
|
5077
|
-
/* @__PURE__ */ (0,
|
|
5078
|
-
/* @__PURE__ */ (0,
|
|
5069
|
+
/* @__PURE__ */ (0, import_jsx_runtime3.jsxs)("fieldset", { className: "dsmm-git-guard", children: [
|
|
5070
|
+
/* @__PURE__ */ (0, import_jsx_runtime3.jsx)("legend", { children: t("gitWriteGuard") }),
|
|
5071
|
+
/* @__PURE__ */ (0, import_jsx_runtime3.jsxs)("div", { className: "dsmm-field", children: [
|
|
5072
|
+
/* @__PURE__ */ (0, import_jsx_runtime3.jsx)("label", { htmlFor: `${prefix}-git-guard`, children: t("gitWriteGuard") }),
|
|
5073
|
+
/* @__PURE__ */ (0, import_jsx_runtime3.jsxs)("select", { id: `${prefix}-git-guard`, disabled: effectiveDisabled, value: gitGuard ?? "", "aria-describedby": `${prefix}-git-guard-hint`, onChange: (event) => actions3.editPath(["settings", "guards", "gitWriteGuard"], event.currentTarget.value || void 0), children: [
|
|
5074
|
+
/* @__PURE__ */ (0, import_jsx_runtime3.jsx)("option", { value: "", children: t("inherit") }),
|
|
5075
|
+
/* @__PURE__ */ (0, import_jsx_runtime3.jsx)("option", { value: "ask", children: t("gitWriteAsk") }),
|
|
5076
|
+
/* @__PURE__ */ (0, import_jsx_runtime3.jsx)("option", { value: "deny", children: t("gitWriteDeny") }),
|
|
5077
|
+
/* @__PURE__ */ (0, import_jsx_runtime3.jsx)("option", { value: "off", children: t("gitWriteOff") })
|
|
5079
5078
|
] }),
|
|
5080
|
-
/* @__PURE__ */ (0,
|
|
5079
|
+
/* @__PURE__ */ (0, import_jsx_runtime3.jsx)("p", { id: `${prefix}-git-guard-hint`, className: "dsmm-hint", children: t("gitWriteGuardHint") })
|
|
5081
5080
|
] }),
|
|
5082
|
-
/* @__PURE__ */ (0,
|
|
5083
|
-
|
|
5084
|
-
/* @__PURE__ */ (0,
|
|
5085
|
-
|
|
5086
|
-
|
|
5087
|
-
|
|
5088
|
-
/* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("div", { className: "dsmm-field", children: [
|
|
5089
|
-
/* @__PURE__ */ (0, import_jsx_runtime4.jsx)("label", { htmlFor: `${prefix}-primary-mode`, children: t("primaryMode", { name: role3.label }) }),
|
|
5090
|
-
/* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("select", { id: `${prefix}-primary-mode`, disabled: effectiveDisabled, value: policy.primary === void 0 ? "inherit" : "explicit", onChange: (event) => actions3.editPath([...rolePath, "primary"], event.currentTarget.value === "inherit" ? void 0 : { provider: "", model: "" }), children: [
|
|
5091
|
-
/* @__PURE__ */ (0, import_jsx_runtime4.jsx)("option", { value: "inherit", children: t("inheritRoute") }),
|
|
5092
|
-
/* @__PURE__ */ (0, import_jsx_runtime4.jsx)("option", { value: "explicit", children: t("configuredRoute") })
|
|
5093
|
-
] })
|
|
5081
|
+
/* @__PURE__ */ (0, import_jsx_runtime3.jsxs)("div", { className: "dsmm-field", children: [
|
|
5082
|
+
/* @__PURE__ */ (0, import_jsx_runtime3.jsx)("label", { htmlFor: `${prefix}-git-scope`, children: t("gitWriteScope") }),
|
|
5083
|
+
/* @__PURE__ */ (0, import_jsx_runtime3.jsxs)("select", { id: `${prefix}-git-scope`, disabled: effectiveDisabled, value: gitScope ?? "", "aria-describedby": `${prefix}-git-scope-hint`, onChange: (event) => actions3.editPath(["settings", "guards", "gitWriteScope"], event.currentTarget.value || void 0), children: [
|
|
5084
|
+
/* @__PURE__ */ (0, import_jsx_runtime3.jsx)("option", { value: "", children: t("inherit") }),
|
|
5085
|
+
/* @__PURE__ */ (0, import_jsx_runtime3.jsx)("option", { value: "all-writes", disabled: isGuardOff, children: t("gitWriteAllWrites") }),
|
|
5086
|
+
/* @__PURE__ */ (0, import_jsx_runtime3.jsx)("option", { value: "high-risk", disabled: isGuardOff, children: t("gitWriteHighRisk") })
|
|
5094
5087
|
] }),
|
|
5095
|
-
|
|
5096
|
-
/* @__PURE__ */ (0, import_jsx_runtime4.jsx)("p", { className: "dsmm-hint", children: t("effortChangeHint") }),
|
|
5097
|
-
/* @__PURE__ */ (0, import_jsx_runtime4.jsx)("p", { className: "dsmm-hint", children: t("normalLevel") }),
|
|
5098
|
-
/* @__PURE__ */ (0, import_jsx_runtime4.jsx)("p", { className: "dsmm-hint", children: t("levelsHint") }),
|
|
5099
|
-
["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: effectiveDisabled, actions: actions3, t }, level2))
|
|
5100
|
-
] }),
|
|
5101
|
-
/* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("div", { className: "dsmm-field", children: [
|
|
5102
|
-
/* @__PURE__ */ (0, import_jsx_runtime4.jsx)("label", { htmlFor: `${prefix}-fallback-mode`, children: t("fallbackMode", { name: role3.label }) }),
|
|
5103
|
-
/* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("select", { id: `${prefix}-fallback-mode`, disabled: effectiveDisabled, value: policy.fallbackRoutes === void 0 ? "inherit" : "explicit", onChange: (event) => actions3.editPath([...rolePath, "fallbackRoutes"], event.currentTarget.value === "inherit" ? void 0 : []), children: [
|
|
5104
|
-
/* @__PURE__ */ (0, import_jsx_runtime4.jsx)("option", { value: "inherit", children: t("inheritChain") }),
|
|
5105
|
-
/* @__PURE__ */ (0, import_jsx_runtime4.jsx)("option", { value: "explicit", children: t("configuredChain") })
|
|
5106
|
-
] })
|
|
5107
|
-
] }),
|
|
5108
|
-
policy.fallbackRoutes?.length === 0 && /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("p", { className: "dsmm-hint", children: t("emptyChain") }),
|
|
5109
|
-
policy.fallbackRoutes?.map((candidate, index) => {
|
|
5110
|
-
const name2 = t("fallbackName", { name: role3.label, index: index + 1 });
|
|
5111
|
-
return /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("fieldset", { children: [
|
|
5112
|
-
/* @__PURE__ */ (0, import_jsx_runtime4.jsx)("legend", { children: name2 }),
|
|
5113
|
-
/* @__PURE__ */ (0, import_jsx_runtime4.jsx)(RouteFields, { t, value: candidate, path: [...rolePath, "fallbackRoutes", index], name: name2, catalog: state.catalog, disabled: effectiveDisabled, edit: actions3.editPath, editRoute: actions3.editRoute }),
|
|
5114
|
-
/* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("div", { className: "dsmm-actions", children: [
|
|
5115
|
-
/* @__PURE__ */ (0, import_jsx_runtime4.jsx)(import_dsh_client_ui_primitives2.Button, { type: "button", variant: "outline", disabled: effectiveDisabled || index === 0, onClick: () => actions3.moveFallback(role3.id, index, index - 1), children: t("moveUp", { name: name2 }) }),
|
|
5116
|
-
/* @__PURE__ */ (0, import_jsx_runtime4.jsx)(import_dsh_client_ui_primitives2.Button, { type: "button", variant: "outline", disabled: effectiveDisabled || index === policy.fallbackRoutes.length - 1, onClick: () => actions3.moveFallback(role3.id, index, index + 1), children: t("moveDown", { name: name2 }) }),
|
|
5117
|
-
/* @__PURE__ */ (0, import_jsx_runtime4.jsx)(import_dsh_client_ui_primitives2.Button, { type: "button", variant: "outline", disabled: effectiveDisabled, onClick: () => actions3.editPath([...rolePath, "fallbackRoutes", index], void 0), children: t("removeFallback", { name: name2 }) })
|
|
5118
|
-
] })
|
|
5119
|
-
] }, index);
|
|
5120
|
-
}),
|
|
5121
|
-
/* @__PURE__ */ (0, import_jsx_runtime4.jsx)(import_dsh_client_ui_primitives2.Button, { type: "button", variant: "outline", disabled: effectiveDisabled || (policy.fallbackRoutes?.length ?? 0) >= 32, onClick: () => {
|
|
5122
|
-
if (policy.fallbackRoutes === void 0) actions3.editPath([...rolePath, "fallbackRoutes"], [{ provider: "", model: "" }]);
|
|
5123
|
-
else actions3.editPath([...rolePath, "fallbackRoutes", policy.fallbackRoutes.length], { provider: "", model: "" });
|
|
5124
|
-
}, children: t("addFallback", { name: role3.label }) })
|
|
5125
|
-
] }, role3.id),
|
|
5126
|
-
/* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("fieldset", { children: [
|
|
5127
|
-
/* @__PURE__ */ (0, import_jsx_runtime4.jsx)("legend", { children: t("profileDefaults") }),
|
|
5128
|
-
/* @__PURE__ */ (0, import_jsx_runtime4.jsx)(PolicyFields, { t, value: document2.runtimePolicy, inherited: baseline, path: ["settings", "runtimePolicy"], name: t("profileDefaults"), disabled: effectiveDisabled, actions: actions3 })
|
|
5129
|
-
] }),
|
|
5130
|
-
/* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("fieldset", { className: "dsmm-git-guard", children: [
|
|
5131
|
-
/* @__PURE__ */ (0, import_jsx_runtime4.jsx)("legend", { children: t("gitWriteGuard") }),
|
|
5132
|
-
/* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("div", { className: "dsmm-field", children: [
|
|
5133
|
-
/* @__PURE__ */ (0, import_jsx_runtime4.jsx)("label", { htmlFor: `${prefix}-git-guard`, children: t("gitWriteGuard") }),
|
|
5134
|
-
/* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("select", { id: `${prefix}-git-guard`, disabled: effectiveDisabled, value: gitGuard ?? "", "aria-describedby": `${prefix}-git-guard-hint`, onChange: (event) => actions3.editPath(["settings", "guards", "gitWriteGuard"], event.currentTarget.value || void 0), children: [
|
|
5135
|
-
/* @__PURE__ */ (0, import_jsx_runtime4.jsx)("option", { value: "", children: t("inherit") }),
|
|
5136
|
-
/* @__PURE__ */ (0, import_jsx_runtime4.jsx)("option", { value: "ask", children: t("gitWriteAsk") }),
|
|
5137
|
-
/* @__PURE__ */ (0, import_jsx_runtime4.jsx)("option", { value: "deny", children: t("gitWriteDeny") }),
|
|
5138
|
-
/* @__PURE__ */ (0, import_jsx_runtime4.jsx)("option", { value: "off", children: t("gitWriteOff") })
|
|
5139
|
-
] }),
|
|
5140
|
-
/* @__PURE__ */ (0, import_jsx_runtime4.jsx)("p", { id: `${prefix}-git-guard-hint`, className: "dsmm-hint", children: t("gitWriteGuardHint") })
|
|
5141
|
-
] }),
|
|
5142
|
-
/* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("div", { className: "dsmm-field", children: [
|
|
5143
|
-
/* @__PURE__ */ (0, import_jsx_runtime4.jsx)("label", { htmlFor: `${prefix}-git-scope`, children: t("gitWriteScope") }),
|
|
5144
|
-
/* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("select", { id: `${prefix}-git-scope`, disabled: effectiveDisabled, value: gitScope ?? "", "aria-describedby": `${prefix}-git-scope-hint`, onChange: (event) => actions3.editPath(["settings", "guards", "gitWriteScope"], event.currentTarget.value || void 0), children: [
|
|
5145
|
-
/* @__PURE__ */ (0, import_jsx_runtime4.jsx)("option", { value: "", children: t("inherit") }),
|
|
5146
|
-
/* @__PURE__ */ (0, import_jsx_runtime4.jsx)("option", { value: "all-writes", disabled: isGuardOff, children: t("gitWriteAllWrites") }),
|
|
5147
|
-
/* @__PURE__ */ (0, import_jsx_runtime4.jsx)("option", { value: "high-risk", disabled: isGuardOff, children: t("gitWriteHighRisk") })
|
|
5148
|
-
] }),
|
|
5149
|
-
isGuardOff && /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("p", { id: `${prefix}-git-scope-hint`, className: "dsmm-hint", children: t("gitWriteScopeDisabledHint") })
|
|
5088
|
+
isGuardOff && /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("p", { id: `${prefix}-git-scope-hint`, className: "dsmm-hint", children: t("gitWriteScopeDisabledHint") })
|
|
5150
5089
|
] })
|
|
5151
5090
|
] }),
|
|
5152
|
-
/* @__PURE__ */ (0,
|
|
5153
|
-
/* @__PURE__ */ (0,
|
|
5154
|
-
/* @__PURE__ */ (0,
|
|
5155
|
-
/* @__PURE__ */ (0,
|
|
5156
|
-
/* @__PURE__ */ (0,
|
|
5157
|
-
/* @__PURE__ */ (0,
|
|
5091
|
+
/* @__PURE__ */ (0, import_jsx_runtime3.jsxs)("div", { className: "dsmm-field", children: [
|
|
5092
|
+
/* @__PURE__ */ (0, import_jsx_runtime3.jsx)("label", { htmlFor: `${prefix}-topology`, children: t("toolTopology") }),
|
|
5093
|
+
/* @__PURE__ */ (0, import_jsx_runtime3.jsxs)("select", { id: `${prefix}-topology`, value: topology ?? "", disabled: effectiveDisabled, "aria-describedby": `${prefix}-topology-hint`, onChange: (event) => actions3.editPath(["settings", "subagents", "toolTopology"], event.currentTarget.value || void 0), children: [
|
|
5094
|
+
/* @__PURE__ */ (0, import_jsx_runtime3.jsx)("option", { value: "", children: t("inherit") }),
|
|
5095
|
+
/* @__PURE__ */ (0, import_jsx_runtime3.jsx)("option", { value: "per-role", children: t("topologyPerRole") }),
|
|
5096
|
+
/* @__PURE__ */ (0, import_jsx_runtime3.jsx)("option", { value: "parameterized", children: t("topologyParameterized") })
|
|
5158
5097
|
] }),
|
|
5159
|
-
/* @__PURE__ */ (0,
|
|
5098
|
+
/* @__PURE__ */ (0, import_jsx_runtime3.jsx)("p", { id: `${prefix}-topology-hint`, className: "dsmm-hint", children: t("topologyHint") })
|
|
5160
5099
|
] })
|
|
5161
5100
|
] });
|
|
5162
5101
|
}
|
|
5163
5102
|
|
|
5164
|
-
// src/client/
|
|
5103
|
+
// src/client/ProfileModelsDialog.tsx
|
|
5165
5104
|
var import_react3 = require("react");
|
|
5166
5105
|
var import_dsh_client_ui_primitives3 = require("@deepseek-ai/dsh-client-ui-primitives");
|
|
5167
5106
|
|
|
5107
|
+
// src/client/RoleAvailability.tsx
|
|
5108
|
+
var import_jsx_runtime4 = require("react/jsx-runtime");
|
|
5109
|
+
function roleAvailability(value) {
|
|
5110
|
+
if (value === void 0) return void 0;
|
|
5111
|
+
try {
|
|
5112
|
+
return parseRoleAvailability(value);
|
|
5113
|
+
} catch {
|
|
5114
|
+
return void 0;
|
|
5115
|
+
}
|
|
5116
|
+
}
|
|
5117
|
+
function RoleAvailability({ value, t }) {
|
|
5118
|
+
const state = roleAvailability(value);
|
|
5119
|
+
if (state === void 0) return /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("p", { className: "dsmm-hint", children: t("availabilityUnknown") });
|
|
5120
|
+
return /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("div", { className: "dsmm-availability", "data-dsmm-role-availability": state.id, children: [
|
|
5121
|
+
/* @__PURE__ */ (0, import_jsx_runtime4.jsx)("p", { children: t(state.required ? "roleRequired" : "roleOptional", { reason: state.requiredReason ?? "—" }) }),
|
|
5122
|
+
state.reason !== void 0 && /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("p", { children: t("roleUnavailableReason", { reason: state.reason }) }),
|
|
5123
|
+
/* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("details", { children: [
|
|
5124
|
+
/* @__PURE__ */ (0, import_jsx_runtime4.jsx)("summary", { children: t("technicalDetails") }),
|
|
5125
|
+
/* @__PURE__ */ (0, import_jsx_runtime4.jsx)("p", { children: t("roleCeiling", { startup: t(state.startupAvailable ? "enabled" : "disabled"), deployment: t(state.deploymentEnabled ? "enabled" : "disabled"), admitted: t(state.admitted ? "enabled" : "disabled") }) }),
|
|
5126
|
+
/* @__PURE__ */ (0, import_jsx_runtime4.jsx)("p", { className: "dsmm-hint", children: t("roleProvenance", { source: state.source, capture: state.capture }) })
|
|
5127
|
+
] })
|
|
5128
|
+
] });
|
|
5129
|
+
}
|
|
5130
|
+
|
|
5131
|
+
// src/client/ProfileModelsDialog.tsx
|
|
5132
|
+
var import_jsx_runtime5 = require("react/jsx-runtime");
|
|
5133
|
+
function locateFieldInsideRole(roleCard, field) {
|
|
5134
|
+
if (!field) return null;
|
|
5135
|
+
const roleId2 = roleCard.dataset.dsmmRole;
|
|
5136
|
+
if (field === `settings.roles.${roleId2}` || field === `roles.${roleId2}`) {
|
|
5137
|
+
const details2 = roleCard.querySelector("details[data-dsmm-details='non-model']");
|
|
5138
|
+
if (details2) details2.open = true;
|
|
5139
|
+
return roleCard.querySelector("select[id$='-role-enabled']");
|
|
5140
|
+
}
|
|
5141
|
+
const roleMatch = /^(?:settings\.)?roleRouting\.([a-zA-Z0-9_-]+)\.(.+)$/.exec(field);
|
|
5142
|
+
if (roleMatch === null || roleMatch[1] !== roleId2) return null;
|
|
5143
|
+
const path = roleMatch[2].replace(/\[(\d+)\]/g, ".$1");
|
|
5144
|
+
const routeInput = (container, prop) => {
|
|
5145
|
+
const suffix = prop === "reasoningEffort" ? "effort" : prop;
|
|
5146
|
+
return container?.querySelector(`input[id$='-${suffix}'], select[id$='-${suffix}']`) ?? null;
|
|
5147
|
+
};
|
|
5148
|
+
const levelMatch = /^levels\.(low|high|max)(?:\.(provider|model|reasoningEffort))?$/.exec(path);
|
|
5149
|
+
if (levelMatch) {
|
|
5150
|
+
const level2 = levelMatch[1];
|
|
5151
|
+
const prop = levelMatch[2];
|
|
5152
|
+
const details2 = roleCard.querySelector("details[data-dsmm-details='levels']");
|
|
5153
|
+
if (details2) details2.open = true;
|
|
5154
|
+
const fieldset = roleCard.querySelector(`fieldset[data-dsmm-level='${level2}']`);
|
|
5155
|
+
return routeInput(fieldset, prop ?? "mode");
|
|
5156
|
+
}
|
|
5157
|
+
const fallbackMatch = /^fallbackRoutes\.(0|[1-9]\d*)\.(provider|model|reasoningEffort)$/.exec(path);
|
|
5158
|
+
if (fallbackMatch) {
|
|
5159
|
+
const index = fallbackMatch[1];
|
|
5160
|
+
const prop = fallbackMatch[2];
|
|
5161
|
+
const details2 = roleCard.querySelector("details[data-dsmm-details='fallback']");
|
|
5162
|
+
if (details2) details2.open = true;
|
|
5163
|
+
const fieldset = roleCard.querySelector(`fieldset[data-dsmm-fallback-index='${index}']`);
|
|
5164
|
+
return routeInput(fieldset, prop);
|
|
5165
|
+
}
|
|
5166
|
+
if (path === "fallbackRoutes") {
|
|
5167
|
+
const details2 = roleCard.querySelector("details[data-dsmm-details='fallback']");
|
|
5168
|
+
if (details2) details2.open = true;
|
|
5169
|
+
return roleCard.querySelector("select[id$='-fallback-mode']");
|
|
5170
|
+
}
|
|
5171
|
+
const primaryMatch = /^primary(?:\.(provider|model|reasoningEffort))?$/.exec(path);
|
|
5172
|
+
if (primaryMatch) {
|
|
5173
|
+
const primaryContainer = roleCard.querySelector(".dsmm-role-primary-route");
|
|
5174
|
+
return routeInput(primaryContainer, primaryMatch[1] ?? "primary-mode");
|
|
5175
|
+
}
|
|
5176
|
+
const rateLimitMatch = /^rateLimit\.([a-zA-Z]+)$/.exec(path);
|
|
5177
|
+
const selector = path === "strategy" ? "select[id$='-strategy']" : rateLimitMatch && Object.hasOwn(DSMM_RATE_LIMIT_BOUNDS, rateLimitMatch[1]) ? `input[data-dsmm-policy-field='${rateLimitMatch[1]}']` : null;
|
|
5178
|
+
if (selector === null) return null;
|
|
5179
|
+
const details = roleCard.querySelector("details[data-dsmm-details='non-model']");
|
|
5180
|
+
if (details) details.open = true;
|
|
5181
|
+
return details?.querySelector(selector) ?? null;
|
|
5182
|
+
}
|
|
5183
|
+
function hasExplicitModelOverride(roleId2, doc) {
|
|
5184
|
+
if (doc === null) return false;
|
|
5185
|
+
const policy = doc.roleRouting[roleId2];
|
|
5186
|
+
if (!policy) return false;
|
|
5187
|
+
if (policy.primary !== void 0) return true;
|
|
5188
|
+
if (policy.levels !== void 0 && Object.keys(policy.levels).length > 0) return true;
|
|
5189
|
+
if (policy.fallbackRoutes !== void 0) return true;
|
|
5190
|
+
return false;
|
|
5191
|
+
}
|
|
5192
|
+
function ProfileModelsDialog({
|
|
5193
|
+
open,
|
|
5194
|
+
onClose,
|
|
5195
|
+
state,
|
|
5196
|
+
actions: actions3,
|
|
5197
|
+
disabled,
|
|
5198
|
+
document: doc,
|
|
5199
|
+
isInvalidProjection,
|
|
5200
|
+
triggerRef,
|
|
5201
|
+
targetRoleId,
|
|
5202
|
+
targetField,
|
|
5203
|
+
onTargetLocated,
|
|
5204
|
+
onJumpToJsonc,
|
|
5205
|
+
t
|
|
5206
|
+
}) {
|
|
5207
|
+
const prefix = (0, import_react3.useId)();
|
|
5208
|
+
const [searchQuery, setSearchQuery] = (0, import_react3.useState)("");
|
|
5209
|
+
const [filterExplicitOnly, setFilterExplicitOnly] = (0, import_react3.useState)(false);
|
|
5210
|
+
const pendingFallbackFocusRef = (0, import_react3.useRef)(null);
|
|
5211
|
+
const wasOpenRef = (0, import_react3.useRef)(open);
|
|
5212
|
+
(0, import_react3.useEffect)(() => {
|
|
5213
|
+
if (wasOpenRef.current && !open) {
|
|
5214
|
+
if (triggerRef?.current && triggerRef.current.isConnected) {
|
|
5215
|
+
triggerRef.current.focus();
|
|
5216
|
+
}
|
|
5217
|
+
}
|
|
5218
|
+
wasOpenRef.current = open;
|
|
5219
|
+
}, [open, triggerRef]);
|
|
5220
|
+
(0, import_react3.useEffect)(() => {
|
|
5221
|
+
if (!open) return;
|
|
5222
|
+
const elementsToRestore = [];
|
|
5223
|
+
const timer = setTimeout(() => {
|
|
5224
|
+
const dialogElement = document.querySelector(".dsmm-profile-models-dialog");
|
|
5225
|
+
for (const child2 of Array.from(document.body.children)) {
|
|
5226
|
+
if (child2 instanceof HTMLElement && (!dialogElement || !child2.contains(dialogElement))) {
|
|
5227
|
+
const prev = child2.getAttribute("inert");
|
|
5228
|
+
child2.setAttribute("inert", "");
|
|
5229
|
+
elementsToRestore.push({ el: child2, prevInert: prev });
|
|
5230
|
+
}
|
|
5231
|
+
}
|
|
5232
|
+
}, 0);
|
|
5233
|
+
return () => {
|
|
5234
|
+
clearTimeout(timer);
|
|
5235
|
+
for (const { el, prevInert } of elementsToRestore) {
|
|
5236
|
+
if (prevInert !== null) {
|
|
5237
|
+
el.setAttribute("inert", prevInert);
|
|
5238
|
+
} else {
|
|
5239
|
+
el.removeAttribute("inert");
|
|
5240
|
+
}
|
|
5241
|
+
}
|
|
5242
|
+
};
|
|
5243
|
+
}, [open]);
|
|
5244
|
+
(0, import_react3.useEffect)(() => {
|
|
5245
|
+
if (!open || !targetRoleId) return;
|
|
5246
|
+
setSearchQuery("");
|
|
5247
|
+
setFilterExplicitOnly(false);
|
|
5248
|
+
const rafId = requestAnimationFrame(() => {
|
|
5249
|
+
const roleCard = document.querySelector(`[data-dsmm-role='${targetRoleId}']`);
|
|
5250
|
+
if (!roleCard) {
|
|
5251
|
+
onJumpToJsonc?.();
|
|
5252
|
+
return;
|
|
5253
|
+
}
|
|
5254
|
+
const targetInput = locateFieldInsideRole(roleCard, targetField);
|
|
5255
|
+
if (!targetInput) {
|
|
5256
|
+
onJumpToJsonc?.();
|
|
5257
|
+
return;
|
|
5258
|
+
}
|
|
5259
|
+
const reducedMotion = typeof window !== "undefined" && window.matchMedia("(prefers-reduced-motion: reduce)").matches;
|
|
5260
|
+
const scrollOpt = { behavior: reducedMotion ? "auto" : "smooth", block: "nearest" };
|
|
5261
|
+
if (typeof targetInput.scrollIntoView === "function") {
|
|
5262
|
+
targetInput.scrollIntoView(scrollOpt);
|
|
5263
|
+
}
|
|
5264
|
+
targetInput.focus();
|
|
5265
|
+
if (document.activeElement === targetInput) onTargetLocated?.();
|
|
5266
|
+
else onJumpToJsonc?.();
|
|
5267
|
+
});
|
|
5268
|
+
return () => cancelAnimationFrame(rafId);
|
|
5269
|
+
}, [open, targetRoleId, targetField, onTargetLocated, onJumpToJsonc]);
|
|
5270
|
+
(0, import_react3.useEffect)(() => {
|
|
5271
|
+
if (!pendingFallbackFocusRef.current) return;
|
|
5272
|
+
const { roleId: roleId2, index, action: action2 } = pendingFallbackFocusRef.current;
|
|
5273
|
+
pendingFallbackFocusRef.current = null;
|
|
5274
|
+
const roleCard = document.querySelector(`[data-dsmm-role='${roleId2}']`);
|
|
5275
|
+
if (!roleCard) return;
|
|
5276
|
+
if (action2 === "add") {
|
|
5277
|
+
const item = roleCard.querySelector(`[data-dsmm-fallback-index='${index}']`);
|
|
5278
|
+
const providerInput = item?.querySelector(
|
|
5279
|
+
"input[id$='-provider'], select[id$='-provider'], input, select"
|
|
5280
|
+
);
|
|
5281
|
+
providerInput?.focus();
|
|
5282
|
+
} else if (action2 === "moveUp" || action2 === "moveDown") {
|
|
5283
|
+
const item = roleCard.querySelector(`[data-dsmm-fallback-index='${index}']`);
|
|
5284
|
+
if (item) {
|
|
5285
|
+
const targetBtn = item.querySelector(`button[data-dsmm-action='${action2}']:not([disabled])`) ?? item.querySelector("button[data-dsmm-action='moveUp']:not([disabled])") ?? item.querySelector("button[data-dsmm-action='moveDown']:not([disabled])") ?? item.querySelector("button[data-dsmm-action='remove']:not([disabled])") ?? item.querySelector("input:not([disabled]), select:not([disabled])");
|
|
5286
|
+
targetBtn?.focus();
|
|
5287
|
+
}
|
|
5288
|
+
} else if (action2 === "remove") {
|
|
5289
|
+
const nextRemoveBtn = roleCard.querySelector(`[data-dsmm-fallback-index='${index}'] button[data-dsmm-action='remove']`) ?? roleCard.querySelector(`[data-dsmm-fallback-index='${Math.max(0, index - 1)}'] button[data-dsmm-action='remove']`) ?? roleCard.querySelector("button[data-dsmm-action='add-fallback']");
|
|
5290
|
+
nextRemoveBtn?.focus();
|
|
5291
|
+
}
|
|
5292
|
+
});
|
|
5293
|
+
const handleKeyDownCapture = (event) => {
|
|
5294
|
+
if (event.key === "Tab") {
|
|
5295
|
+
const dialog = event.currentTarget.classList.contains("dsmm-profile-models-dialog") ? event.currentTarget : event.currentTarget.querySelector(".dsmm-profile-models-dialog") ?? event.currentTarget;
|
|
5296
|
+
const candidates = Array.from(
|
|
5297
|
+
dialog.querySelectorAll(
|
|
5298
|
+
'a[href], button:not([disabled]), input:not([disabled]), select:not([disabled]), textarea:not([disabled]), summary, [tabindex]:not([tabindex="-1"])'
|
|
5299
|
+
)
|
|
5300
|
+
).filter((el) => {
|
|
5301
|
+
const closedDetails = el.closest("details:not([open])");
|
|
5302
|
+
if (closedDetails && el !== closedDetails.querySelector("summary")) return false;
|
|
5303
|
+
if (el.getAttribute("tabindex") === "-1") return false;
|
|
5304
|
+
if (el.hasAttribute("disabled") || el.getAttribute("aria-disabled") === "true") return false;
|
|
5305
|
+
if (el.closest("[inert]") || el.closest("[hidden]")) return false;
|
|
5306
|
+
if (el.offsetWidth === 0 && el.offsetHeight === 0 && el.getClientRects().length === 0) return false;
|
|
5307
|
+
return true;
|
|
5308
|
+
});
|
|
5309
|
+
if (candidates.length === 0) {
|
|
5310
|
+
event.preventDefault();
|
|
5311
|
+
return;
|
|
5312
|
+
}
|
|
5313
|
+
const first = candidates[0];
|
|
5314
|
+
const last = candidates[candidates.length - 1];
|
|
5315
|
+
if (event.shiftKey) {
|
|
5316
|
+
if (document.activeElement === first || !dialog.contains(document.activeElement)) {
|
|
5317
|
+
event.preventDefault();
|
|
5318
|
+
event.stopPropagation();
|
|
5319
|
+
last.focus();
|
|
5320
|
+
}
|
|
5321
|
+
} else {
|
|
5322
|
+
if (document.activeElement === last || !dialog.contains(document.activeElement)) {
|
|
5323
|
+
event.preventDefault();
|
|
5324
|
+
event.stopPropagation();
|
|
5325
|
+
first.focus();
|
|
5326
|
+
}
|
|
5327
|
+
}
|
|
5328
|
+
}
|
|
5329
|
+
};
|
|
5330
|
+
const roles2 = state.snapshot?.roles ?? [];
|
|
5331
|
+
const effectiveDisabled = disabled || isInvalidProjection || doc === null;
|
|
5332
|
+
const baseline = state.snapshot?.editorDefaults;
|
|
5333
|
+
const filteredRoles = roles2.filter((role3) => {
|
|
5334
|
+
if (searchQuery.trim()) {
|
|
5335
|
+
const q = searchQuery.trim().toLowerCase();
|
|
5336
|
+
const matchesId = role3.id.toLowerCase().includes(q);
|
|
5337
|
+
const matchesLabel = role3.label.toLowerCase().includes(q);
|
|
5338
|
+
if (!matchesId && !matchesLabel) return false;
|
|
5339
|
+
}
|
|
5340
|
+
if (filterExplicitOnly) {
|
|
5341
|
+
if (!hasExplicitModelOverride(role3.id, doc)) return false;
|
|
5342
|
+
}
|
|
5343
|
+
return true;
|
|
5344
|
+
});
|
|
5345
|
+
return /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)(
|
|
5346
|
+
import_dsh_client_ui_primitives3.Modal,
|
|
5347
|
+
{
|
|
5348
|
+
open,
|
|
5349
|
+
onClose,
|
|
5350
|
+
title: t("modelsDialogTitle"),
|
|
5351
|
+
description: t("modelsDialogDesc"),
|
|
5352
|
+
closeLabel: t("cancel"),
|
|
5353
|
+
className: "dsmm-profile-models-dialog",
|
|
5354
|
+
contentClassName: "dsmm-profile-models-dialog-content",
|
|
5355
|
+
onKeyDownCapture: handleKeyDownCapture,
|
|
5356
|
+
children: [
|
|
5357
|
+
/* @__PURE__ */ (0, import_jsx_runtime5.jsxs)("div", { className: "dsmm-models-filter-bar dsmm-dialog-filter-bar", children: [
|
|
5358
|
+
/* @__PURE__ */ (0, import_jsx_runtime5.jsx)("div", { className: "dsmm-field dsmm-filter-search", children: /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
|
|
5359
|
+
import_dsh_client_ui_primitives3.Input,
|
|
5360
|
+
{
|
|
5361
|
+
id: `${prefix}-role-search`,
|
|
5362
|
+
className: "dsmm-input",
|
|
5363
|
+
type: "search",
|
|
5364
|
+
value: searchQuery,
|
|
5365
|
+
placeholder: t("searchRolesPlaceholder"),
|
|
5366
|
+
disabled: effectiveDisabled,
|
|
5367
|
+
onChange: (e) => setSearchQuery(e.currentTarget.value),
|
|
5368
|
+
"data-dsmm-role-search": true,
|
|
5369
|
+
"data-modal-autofocus": true
|
|
5370
|
+
}
|
|
5371
|
+
) }),
|
|
5372
|
+
/* @__PURE__ */ (0, import_jsx_runtime5.jsxs)("label", { className: "dsmm-filter-label dsmm-filter-override-toggle", children: [
|
|
5373
|
+
/* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
|
|
5374
|
+
"input",
|
|
5375
|
+
{
|
|
5376
|
+
type: "checkbox",
|
|
5377
|
+
checked: filterExplicitOnly,
|
|
5378
|
+
disabled: effectiveDisabled,
|
|
5379
|
+
onChange: (e) => setFilterExplicitOnly(e.currentTarget.checked),
|
|
5380
|
+
"data-dsmm-filter-overrides": true
|
|
5381
|
+
}
|
|
5382
|
+
),
|
|
5383
|
+
/* @__PURE__ */ (0, import_jsx_runtime5.jsx)("span", { children: t("filterExplicitOverrides") })
|
|
5384
|
+
] })
|
|
5385
|
+
] }),
|
|
5386
|
+
state.issue !== null && /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)("div", { className: "dsmm-issue dsmm-dialog-issue", role: "region", "aria-label": t("savedInventory"), children: [
|
|
5387
|
+
/* @__PURE__ */ (0, import_jsx_runtime5.jsx)("p", { className: "dsmm-dialog-issue-title", children: t(issueKey(state.issue)) }),
|
|
5388
|
+
/* @__PURE__ */ (0, import_jsx_runtime5.jsx)(IssueDetails, { issue: state.issue, t }),
|
|
5389
|
+
onJumpToJsonc && /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("div", { className: "dsmm-dialog-issue-action", children: /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
|
|
5390
|
+
import_dsh_client_ui_primitives3.Button,
|
|
5391
|
+
{
|
|
5392
|
+
type: "button",
|
|
5393
|
+
variant: "outline",
|
|
5394
|
+
size: "sm",
|
|
5395
|
+
onClick: onJumpToJsonc,
|
|
5396
|
+
children: t("jumpToJsonc")
|
|
5397
|
+
}
|
|
5398
|
+
) })
|
|
5399
|
+
] }),
|
|
5400
|
+
doc === null && /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)("div", { className: "dsmm-structured-invalid", "data-dsmm-structured-invalid": true, children: [
|
|
5401
|
+
/* @__PURE__ */ (0, import_jsx_runtime5.jsx)("p", { children: t("rawInvalid") }),
|
|
5402
|
+
/* @__PURE__ */ (0, import_jsx_runtime5.jsx)("p", { className: "dsmm-hint", children: t("rawInvalidFormDisabled") }),
|
|
5403
|
+
onJumpToJsonc && /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
|
|
5404
|
+
import_dsh_client_ui_primitives3.Button,
|
|
5405
|
+
{
|
|
5406
|
+
type: "button",
|
|
5407
|
+
variant: "outline",
|
|
5408
|
+
onClick: onJumpToJsonc,
|
|
5409
|
+
children: t("viewConfiguration")
|
|
5410
|
+
}
|
|
5411
|
+
)
|
|
5412
|
+
] }),
|
|
5413
|
+
doc !== null && /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)("div", { className: "dsmm-roles-list dsmm-dialog-roles-list", children: [
|
|
5414
|
+
filteredRoles.length === 0 && /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("p", { className: "dsmm-hint dsmm-no-roles", children: t("noMatchingRoles") }),
|
|
5415
|
+
filteredRoles.map((role3) => {
|
|
5416
|
+
const policy = doc.roleRouting[role3.id] ?? {};
|
|
5417
|
+
const rolePath = ["settings", "roleRouting", role3.id];
|
|
5418
|
+
const isOrchestrator = role3.id === "dsmm-orchestrator";
|
|
5419
|
+
const explicitOverride = hasExplicitModelOverride(role3.id, doc);
|
|
5420
|
+
let inherited;
|
|
5421
|
+
try {
|
|
5422
|
+
if (baseline !== void 0) {
|
|
5423
|
+
const profileDefaults = {
|
|
5424
|
+
strategy: doc.runtimePolicy.strategy ?? baseline.strategy,
|
|
5425
|
+
rateLimit: normalizeRateLimitPolicy(doc.runtimePolicy.rateLimit, baseline.rateLimit)
|
|
5426
|
+
};
|
|
5427
|
+
inherited = {
|
|
5428
|
+
strategy: role3.runtimePolicy?.strategy ?? profileDefaults.strategy,
|
|
5429
|
+
rateLimit: normalizeRateLimitPolicy(role3.runtimePolicy?.rateLimit, profileDefaults.rateLimit)
|
|
5430
|
+
};
|
|
5431
|
+
}
|
|
5432
|
+
} catch {
|
|
5433
|
+
}
|
|
5434
|
+
const availability2 = roleAvailability(role3.availability);
|
|
5435
|
+
const namedRoles = doc.settings.roles;
|
|
5436
|
+
const configuredLevels = ["low", "high", "max"].filter(
|
|
5437
|
+
(lvl) => policy.levels?.[lvl] !== void 0
|
|
5438
|
+
);
|
|
5439
|
+
const levelsSummary = configuredLevels.length > 0 ? t("levelsSummary", { levels: configuredLevels.join(", ") }) : t("levelsInherited");
|
|
5440
|
+
const fallbackSummary = policy.fallbackRoutes === void 0 ? t("fallbackInherited") : policy.fallbackRoutes.length === 0 ? t("fallbackExplicitEmptySummary") : t("fallbackCountSummary", { count: policy.fallbackRoutes.length });
|
|
5441
|
+
const statusSummary = namedRoles?.[role3.id] !== void 0 ? namedRoles[role3.id] ? t("enabled") : t("disabled") : t("roleSettingsInherited");
|
|
5442
|
+
const retrySummary = policy.strategy !== void 0 || policy.rateLimit !== void 0 && Object.keys(policy.rateLimit).length > 0 ? t("roleSettingsOverridden") : t("roleSettingsInherited");
|
|
5443
|
+
const nonModelSummary = t("roleSettingsSummary", { status: statusSummary, retry: retrySummary });
|
|
5444
|
+
return /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)(
|
|
5445
|
+
"div",
|
|
5446
|
+
{
|
|
5447
|
+
className: "dsmm-role-card dsmm-dialog-role-card",
|
|
5448
|
+
"data-dsmm-role": role3.id,
|
|
5449
|
+
children: [
|
|
5450
|
+
/* @__PURE__ */ (0, import_jsx_runtime5.jsxs)("div", { className: "dsmm-role-main-row", children: [
|
|
5451
|
+
/* @__PURE__ */ (0, import_jsx_runtime5.jsx)("div", { className: "dsmm-dialog-role-header", children: /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)("div", { className: "dsmm-role-title-group", children: [
|
|
5452
|
+
/* @__PURE__ */ (0, import_jsx_runtime5.jsx)("span", { className: "dsmm-role-title", children: role3.label }),
|
|
5453
|
+
/* @__PURE__ */ (0, import_jsx_runtime5.jsx)("code", { className: "dsmm-role-id-badge", children: role3.id }),
|
|
5454
|
+
explicitOverride && /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("span", { className: "dsmm-override-badge", children: t("roleSettingsOverridden") })
|
|
5455
|
+
] }) }),
|
|
5456
|
+
/* @__PURE__ */ (0, import_jsx_runtime5.jsxs)("div", { className: "dsmm-role-primary-route", children: [
|
|
5457
|
+
/* @__PURE__ */ (0, import_jsx_runtime5.jsxs)("div", { className: "dsmm-field dsmm-primary-mode-field", children: [
|
|
5458
|
+
/* @__PURE__ */ (0, import_jsx_runtime5.jsx)("label", { htmlFor: `${prefix}-${role3.id}-primary-mode`, children: t("primaryMode", { name: role3.label }) }),
|
|
5459
|
+
/* @__PURE__ */ (0, import_jsx_runtime5.jsxs)(
|
|
5460
|
+
"select",
|
|
5461
|
+
{
|
|
5462
|
+
id: `${prefix}-${role3.id}-primary-mode`,
|
|
5463
|
+
disabled: effectiveDisabled,
|
|
5464
|
+
value: policy.primary === void 0 ? "inherit" : "explicit",
|
|
5465
|
+
onChange: (event) => actions3.editPath(
|
|
5466
|
+
[...rolePath, "primary"],
|
|
5467
|
+
event.currentTarget.value === "inherit" ? void 0 : { provider: "", model: "" }
|
|
5468
|
+
),
|
|
5469
|
+
children: [
|
|
5470
|
+
/* @__PURE__ */ (0, import_jsx_runtime5.jsx)("option", { value: "inherit", children: t("inheritRoute") }),
|
|
5471
|
+
/* @__PURE__ */ (0, import_jsx_runtime5.jsx)("option", { value: "explicit", children: t("configuredRoute") })
|
|
5472
|
+
]
|
|
5473
|
+
}
|
|
5474
|
+
)
|
|
5475
|
+
] }),
|
|
5476
|
+
policy.primary !== void 0 ? /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
|
|
5477
|
+
RouteFields,
|
|
5478
|
+
{
|
|
5479
|
+
t,
|
|
5480
|
+
value: policy.primary,
|
|
5481
|
+
path: [...rolePath, "primary"],
|
|
5482
|
+
name: t("primaryName", { name: role3.label }),
|
|
5483
|
+
catalog: state.catalog,
|
|
5484
|
+
disabled: effectiveDisabled,
|
|
5485
|
+
edit: actions3.editPath,
|
|
5486
|
+
editRoute: actions3.editRoute,
|
|
5487
|
+
naturalLabels: true
|
|
5488
|
+
}
|
|
5489
|
+
) : /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("div", { className: "dsmm-route-inherited-hint", children: /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("span", { children: t("inheritRouteDesc") }) }),
|
|
5490
|
+
isOrchestrator && /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("span", { className: "dsmm-orchestrator-tag", children: t("orchestratorNoLevelsHint") })
|
|
5491
|
+
] })
|
|
5492
|
+
] }),
|
|
5493
|
+
/* @__PURE__ */ (0, import_jsx_runtime5.jsxs)("div", { className: "dsmm-role-details-bar", children: [
|
|
5494
|
+
!isOrchestrator && /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)("details", { className: "dsmm-role-levels-details dsmm-compact-details", "data-dsmm-details": "levels", children: [
|
|
5495
|
+
/* @__PURE__ */ (0, import_jsx_runtime5.jsxs)("summary", { className: "dsmm-details-summary dsmm-details-pill", children: [
|
|
5496
|
+
/* @__PURE__ */ (0, import_jsx_runtime5.jsxs)("span", { className: "dsmm-pill-label", children: [
|
|
5497
|
+
t("callingLevels"),
|
|
5498
|
+
":"
|
|
5499
|
+
] }),
|
|
5500
|
+
/* @__PURE__ */ (0, import_jsx_runtime5.jsx)("span", { className: "dsmm-pill-val", children: levelsSummary })
|
|
5501
|
+
] }),
|
|
5502
|
+
/* @__PURE__ */ (0, import_jsx_runtime5.jsxs)("div", { className: "dsmm-details-content", children: [
|
|
5503
|
+
/* @__PURE__ */ (0, import_jsx_runtime5.jsx)("p", { className: "dsmm-hint", children: t("levelsHint") }),
|
|
5504
|
+
["low", "high", "max"].map((level2) => /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
|
|
5505
|
+
LevelFields,
|
|
5506
|
+
{
|
|
5507
|
+
level: level2,
|
|
5508
|
+
value: policy.levels?.[level2],
|
|
5509
|
+
path: [...rolePath, "levels", level2],
|
|
5510
|
+
catalog: state.catalog,
|
|
5511
|
+
disabled: effectiveDisabled,
|
|
5512
|
+
actions: actions3,
|
|
5513
|
+
t
|
|
5514
|
+
},
|
|
5515
|
+
level2
|
|
5516
|
+
))
|
|
5517
|
+
] })
|
|
5518
|
+
] }),
|
|
5519
|
+
/* @__PURE__ */ (0, import_jsx_runtime5.jsxs)("details", { className: "dsmm-role-fallback-details dsmm-compact-details", "data-dsmm-details": "fallback", children: [
|
|
5520
|
+
/* @__PURE__ */ (0, import_jsx_runtime5.jsxs)("summary", { className: "dsmm-details-summary dsmm-details-pill", children: [
|
|
5521
|
+
/* @__PURE__ */ (0, import_jsx_runtime5.jsxs)("span", { className: "dsmm-pill-label", children: [
|
|
5522
|
+
t("fallbackRoutes"),
|
|
5523
|
+
":"
|
|
5524
|
+
] }),
|
|
5525
|
+
/* @__PURE__ */ (0, import_jsx_runtime5.jsx)("span", { className: "dsmm-pill-val", children: fallbackSummary })
|
|
5526
|
+
] }),
|
|
5527
|
+
/* @__PURE__ */ (0, import_jsx_runtime5.jsxs)("div", { className: "dsmm-details-content", children: [
|
|
5528
|
+
/* @__PURE__ */ (0, import_jsx_runtime5.jsxs)("div", { className: "dsmm-field", children: [
|
|
5529
|
+
/* @__PURE__ */ (0, import_jsx_runtime5.jsx)("label", { htmlFor: `${prefix}-${role3.id}-fallback-mode`, children: t("fallbackMode", { name: role3.label }) }),
|
|
5530
|
+
/* @__PURE__ */ (0, import_jsx_runtime5.jsxs)(
|
|
5531
|
+
"select",
|
|
5532
|
+
{
|
|
5533
|
+
id: `${prefix}-${role3.id}-fallback-mode`,
|
|
5534
|
+
disabled: effectiveDisabled,
|
|
5535
|
+
value: policy.fallbackRoutes === void 0 ? "inherit" : "explicit",
|
|
5536
|
+
onChange: (event) => actions3.editPath(
|
|
5537
|
+
[...rolePath, "fallbackRoutes"],
|
|
5538
|
+
event.currentTarget.value === "inherit" ? void 0 : []
|
|
5539
|
+
),
|
|
5540
|
+
children: [
|
|
5541
|
+
/* @__PURE__ */ (0, import_jsx_runtime5.jsx)("option", { value: "inherit", children: t("inheritChain") }),
|
|
5542
|
+
/* @__PURE__ */ (0, import_jsx_runtime5.jsx)("option", { value: "explicit", children: t("configuredChain") })
|
|
5543
|
+
]
|
|
5544
|
+
}
|
|
5545
|
+
)
|
|
5546
|
+
] }),
|
|
5547
|
+
policy.fallbackRoutes?.length === 0 && /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("p", { className: "dsmm-hint", children: t("emptyChain") }),
|
|
5548
|
+
policy.fallbackRoutes?.map((candidate, index) => {
|
|
5549
|
+
const name2 = t("fallbackName", { name: role3.label, index: index + 1 });
|
|
5550
|
+
return /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)(
|
|
5551
|
+
"fieldset",
|
|
5552
|
+
{
|
|
5553
|
+
className: "dsmm-fallback-item",
|
|
5554
|
+
"data-dsmm-fallback-index": index,
|
|
5555
|
+
children: [
|
|
5556
|
+
/* @__PURE__ */ (0, import_jsx_runtime5.jsx)("legend", { children: name2 }),
|
|
5557
|
+
/* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
|
|
5558
|
+
RouteFields,
|
|
5559
|
+
{
|
|
5560
|
+
t,
|
|
5561
|
+
value: candidate,
|
|
5562
|
+
path: [...rolePath, "fallbackRoutes", index],
|
|
5563
|
+
name: name2,
|
|
5564
|
+
catalog: state.catalog,
|
|
5565
|
+
disabled: effectiveDisabled,
|
|
5566
|
+
edit: actions3.editPath,
|
|
5567
|
+
editRoute: actions3.editRoute,
|
|
5568
|
+
naturalLabels: true
|
|
5569
|
+
}
|
|
5570
|
+
),
|
|
5571
|
+
/* @__PURE__ */ (0, import_jsx_runtime5.jsxs)("div", { className: "dsmm-actions", children: [
|
|
5572
|
+
/* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
|
|
5573
|
+
import_dsh_client_ui_primitives3.Button,
|
|
5574
|
+
{
|
|
5575
|
+
type: "button",
|
|
5576
|
+
variant: "outline",
|
|
5577
|
+
"data-dsmm-action": "moveUp",
|
|
5578
|
+
disabled: effectiveDisabled || index === 0,
|
|
5579
|
+
onClick: () => {
|
|
5580
|
+
pendingFallbackFocusRef.current = { roleId: role3.id, index: index - 1, action: "moveUp" };
|
|
5581
|
+
actions3.moveFallback(role3.id, index, index - 1);
|
|
5582
|
+
},
|
|
5583
|
+
children: t("moveUp", { name: name2 })
|
|
5584
|
+
}
|
|
5585
|
+
),
|
|
5586
|
+
/* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
|
|
5587
|
+
import_dsh_client_ui_primitives3.Button,
|
|
5588
|
+
{
|
|
5589
|
+
type: "button",
|
|
5590
|
+
variant: "outline",
|
|
5591
|
+
"data-dsmm-action": "moveDown",
|
|
5592
|
+
disabled: effectiveDisabled || index === policy.fallbackRoutes.length - 1,
|
|
5593
|
+
onClick: () => {
|
|
5594
|
+
pendingFallbackFocusRef.current = { roleId: role3.id, index: index + 1, action: "moveDown" };
|
|
5595
|
+
actions3.moveFallback(role3.id, index, index + 1);
|
|
5596
|
+
},
|
|
5597
|
+
children: t("moveDown", { name: name2 })
|
|
5598
|
+
}
|
|
5599
|
+
),
|
|
5600
|
+
/* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
|
|
5601
|
+
import_dsh_client_ui_primitives3.Button,
|
|
5602
|
+
{
|
|
5603
|
+
type: "button",
|
|
5604
|
+
variant: "outline",
|
|
5605
|
+
"data-dsmm-action": "remove",
|
|
5606
|
+
disabled: effectiveDisabled,
|
|
5607
|
+
onClick: () => {
|
|
5608
|
+
const newLen = policy.fallbackRoutes.length - 1;
|
|
5609
|
+
const nextIdx = Math.min(index, Math.max(0, newLen - 1));
|
|
5610
|
+
pendingFallbackFocusRef.current = { roleId: role3.id, index: nextIdx, action: "remove" };
|
|
5611
|
+
actions3.editPath([...rolePath, "fallbackRoutes", index], void 0);
|
|
5612
|
+
},
|
|
5613
|
+
children: t("removeFallback", { name: name2 })
|
|
5614
|
+
}
|
|
5615
|
+
)
|
|
5616
|
+
] })
|
|
5617
|
+
]
|
|
5618
|
+
},
|
|
5619
|
+
index
|
|
5620
|
+
);
|
|
5621
|
+
}),
|
|
5622
|
+
/* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
|
|
5623
|
+
import_dsh_client_ui_primitives3.Button,
|
|
5624
|
+
{
|
|
5625
|
+
type: "button",
|
|
5626
|
+
variant: "outline",
|
|
5627
|
+
"data-dsmm-action": "add-fallback",
|
|
5628
|
+
disabled: effectiveDisabled || (policy.fallbackRoutes?.length ?? 0) >= 32,
|
|
5629
|
+
onClick: (e) => {
|
|
5630
|
+
const currentDetails = e.currentTarget.closest("details");
|
|
5631
|
+
if (currentDetails) currentDetails.open = true;
|
|
5632
|
+
const newIndex = policy.fallbackRoutes?.length ?? 0;
|
|
5633
|
+
pendingFallbackFocusRef.current = { roleId: role3.id, index: newIndex, action: "add" };
|
|
5634
|
+
if (policy.fallbackRoutes === void 0) {
|
|
5635
|
+
actions3.editPath([...rolePath, "fallbackRoutes"], [{ provider: "", model: "" }]);
|
|
5636
|
+
} else {
|
|
5637
|
+
actions3.editPath([...rolePath, "fallbackRoutes", policy.fallbackRoutes.length], { provider: "", model: "" });
|
|
5638
|
+
}
|
|
5639
|
+
},
|
|
5640
|
+
children: t("addFallback", { name: role3.label })
|
|
5641
|
+
}
|
|
5642
|
+
)
|
|
5643
|
+
] })
|
|
5644
|
+
] }),
|
|
5645
|
+
/* @__PURE__ */ (0, import_jsx_runtime5.jsxs)("details", { className: "dsmm-role-nonmodel-details dsmm-compact-details", "data-dsmm-details": "non-model", children: [
|
|
5646
|
+
/* @__PURE__ */ (0, import_jsx_runtime5.jsxs)("summary", { className: "dsmm-details-summary dsmm-details-pill", children: [
|
|
5647
|
+
/* @__PURE__ */ (0, import_jsx_runtime5.jsxs)("span", { className: "dsmm-pill-label", children: [
|
|
5648
|
+
t("roleNonModelSettings"),
|
|
5649
|
+
":"
|
|
5650
|
+
] }),
|
|
5651
|
+
/* @__PURE__ */ (0, import_jsx_runtime5.jsx)("span", { className: "dsmm-pill-val", children: nonModelSummary })
|
|
5652
|
+
] }),
|
|
5653
|
+
/* @__PURE__ */ (0, import_jsx_runtime5.jsxs)("div", { className: "dsmm-details-content", children: [
|
|
5654
|
+
/* @__PURE__ */ (0, import_jsx_runtime5.jsx)(RoleAvailability, { value: role3.availability, t }),
|
|
5655
|
+
/* @__PURE__ */ (0, import_jsx_runtime5.jsxs)("div", { className: "dsmm-field", children: [
|
|
5656
|
+
/* @__PURE__ */ (0, import_jsx_runtime5.jsx)("label", { htmlFor: `${prefix}-${role3.id}-role-enabled`, children: t("namedRole", { name: role3.label }) }),
|
|
5657
|
+
/* @__PURE__ */ (0, import_jsx_runtime5.jsxs)(
|
|
5658
|
+
"select",
|
|
5659
|
+
{
|
|
5660
|
+
id: `${prefix}-${role3.id}-role-enabled`,
|
|
5661
|
+
value: namedRoles?.[role3.id] === void 0 ? "" : String(namedRoles[role3.id]),
|
|
5662
|
+
disabled: effectiveDisabled,
|
|
5663
|
+
"aria-describedby": `${prefix}-${role3.id}-role-hint`,
|
|
5664
|
+
onChange: (event) => actions3.editPath(
|
|
5665
|
+
["settings", "roles", role3.id],
|
|
5666
|
+
event.currentTarget.value === "" ? void 0 : event.currentTarget.value === "true"
|
|
5667
|
+
),
|
|
5668
|
+
children: [
|
|
5669
|
+
/* @__PURE__ */ (0, import_jsx_runtime5.jsx)("option", { value: "", children: t("inherit") }),
|
|
5670
|
+
/* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
|
|
5671
|
+
"option",
|
|
5672
|
+
{
|
|
5673
|
+
value: "true",
|
|
5674
|
+
disabled: availability2 === void 0 || !availability2.startupAvailable || !availability2.deploymentEnabled || availability2.reason === "module-off",
|
|
5675
|
+
children: t("enabled")
|
|
5676
|
+
}
|
|
5677
|
+
),
|
|
5678
|
+
/* @__PURE__ */ (0, import_jsx_runtime5.jsx)("option", { value: "false", disabled: availability2 === void 0 || availability2.required, children: t("disabled") })
|
|
5679
|
+
]
|
|
5680
|
+
}
|
|
5681
|
+
),
|
|
5682
|
+
/* @__PURE__ */ (0, import_jsx_runtime5.jsx)("p", { id: `${prefix}-${role3.id}-role-hint`, className: "dsmm-hint", children: t("namedRoleHint") })
|
|
5683
|
+
] }),
|
|
5684
|
+
/* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
|
|
5685
|
+
PolicyFields,
|
|
5686
|
+
{
|
|
5687
|
+
t,
|
|
5688
|
+
value: policy,
|
|
5689
|
+
inherited,
|
|
5690
|
+
path: rolePath,
|
|
5691
|
+
name: role3.label,
|
|
5692
|
+
disabled: effectiveDisabled,
|
|
5693
|
+
actions: actions3
|
|
5694
|
+
}
|
|
5695
|
+
)
|
|
5696
|
+
] })
|
|
5697
|
+
] })
|
|
5698
|
+
] })
|
|
5699
|
+
]
|
|
5700
|
+
},
|
|
5701
|
+
role3.id
|
|
5702
|
+
);
|
|
5703
|
+
})
|
|
5704
|
+
] })
|
|
5705
|
+
]
|
|
5706
|
+
}
|
|
5707
|
+
);
|
|
5708
|
+
}
|
|
5709
|
+
|
|
5710
|
+
// src/client/SessionProfiles.tsx
|
|
5711
|
+
var import_react4 = require("react");
|
|
5712
|
+
var import_dsh_client_ui_primitives4 = require("@deepseek-ai/dsh-client-ui-primitives");
|
|
5713
|
+
|
|
5168
5714
|
// src/client/session-labels.ts
|
|
5169
5715
|
function sessionProfileLabels(session, t) {
|
|
5170
5716
|
const admitted = session.admittedSelection;
|
|
@@ -5179,7 +5725,7 @@ function sessionProfileLabels(session, t) {
|
|
|
5179
5725
|
}
|
|
5180
5726
|
|
|
5181
5727
|
// src/client/SessionProfiles.tsx
|
|
5182
|
-
var
|
|
5728
|
+
var import_jsx_runtime6 = require("react/jsx-runtime");
|
|
5183
5729
|
var MENU_ISSUE_CODES = /* @__PURE__ */ new Set(["validation", "conflict", "not-found", "lock-timeout", "unsafe-path", "io", "activation", "corrupt-selection", "limit", "busy", "maintenance", "disposed", "not-owned", "unavailable", "cancelled", "module-off", "runtime-unavailable", "new-session-required", "model-unconfigured", "model-choice-changed", "model-service-unavailable", "model-observation-unavailable", "model-selection-failed"]);
|
|
5184
5730
|
function capabilityReason(reason, t) {
|
|
5185
5731
|
switch (reason) {
|
|
@@ -5209,23 +5755,23 @@ function menuIssue(issue) {
|
|
|
5209
5755
|
function SessionScopeFeedback({ state, t }) {
|
|
5210
5756
|
const session = state.session;
|
|
5211
5757
|
const status = state.sessionNotice === null ? "" : t(state.sessionNotice === "mode-on" ? "headerModeOn" : state.sessionNotice === "mode-off" ? "headerModeOff" : state.sessionNotice === "applied-with-model" ? "sessionAppliedWithModel" : state.sessionNotice === "applied" ? "sessionApplied" : "sessionResetDone");
|
|
5212
|
-
return /* @__PURE__ */ (0,
|
|
5213
|
-
session?.warnings?.length ? /* @__PURE__ */ (0,
|
|
5214
|
-
/* @__PURE__ */ (0,
|
|
5215
|
-
/* @__PURE__ */ (0,
|
|
5758
|
+
return /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)("div", { "data-dsmm-session-feedback": true, children: [
|
|
5759
|
+
session?.warnings?.length ? /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)("div", { children: [
|
|
5760
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)("p", { children: t("admissionWarnings") }),
|
|
5761
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)(ProfileWarnings, { warnings: session.warnings, t })
|
|
5216
5762
|
] }) : null,
|
|
5217
|
-
state.dirty && /* @__PURE__ */ (0,
|
|
5218
|
-
(session?.refreshRequired || session?.selection.refreshRequired) && /* @__PURE__ */ (0,
|
|
5219
|
-
state.sessionUnconfirmed && /* @__PURE__ */ (0,
|
|
5220
|
-
state.sessionIssue !== null && /* @__PURE__ */ (0,
|
|
5221
|
-
/* @__PURE__ */ (0,
|
|
5222
|
-
/* @__PURE__ */ (0,
|
|
5763
|
+
state.dirty && /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("p", { className: "dsmm-hint", children: t("sessionDirty") }),
|
|
5764
|
+
(session?.refreshRequired || session?.selection.refreshRequired) && /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("p", { role: "status", children: t("sessionCommittedRefresh") }),
|
|
5765
|
+
state.sessionUnconfirmed && /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("p", { role: "status", children: t("sessionUnconfirmedRefresh") }),
|
|
5766
|
+
state.sessionIssue !== null && /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)(import_jsx_runtime6.Fragment, { children: [
|
|
5767
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)("p", { role: "alert", children: state.sessionIssue.source === "profile-model" ? t(state.sessionIssue.code === "model-unconfigured" ? "headerNoProfileModel" : state.sessionIssue.code === "model-choice-changed" ? "headerModelChoiceChanged" : "headerModelUnconfirmed") : state.sessionIssue.code === "conflict" ? t("sessionConflict") : ["busy", "maintenance", "disposed", "not-owned"].includes(state.sessionIssue.code) ? t("sessionBusy", { reason: state.sessionIssue.code }) : t(state.sessionIssue.code === "validation" ? "validation" : "sessionUnavailable") }),
|
|
5768
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)(IssueDetails, { issue: state.sessionIssue, t })
|
|
5223
5769
|
] }),
|
|
5224
|
-
/* @__PURE__ */ (0,
|
|
5770
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)("p", { className: "dsmm-status", role: "status", "aria-live": "polite", "aria-atomic": "true", children: state.sessionBusy === "read" ? t("reading") : status })
|
|
5225
5771
|
] });
|
|
5226
5772
|
}
|
|
5227
5773
|
function SessionScope({ state, actions: actions3, t, compact = false, showFeedback = true }) {
|
|
5228
|
-
const prefix = (0,
|
|
5774
|
+
const prefix = (0, import_react4.useId)();
|
|
5229
5775
|
const session = state.session;
|
|
5230
5776
|
const labels = session === null ? null : sessionProfileLabels(session, t);
|
|
5231
5777
|
const selected = state.snapshot?.profiles.find((profile) => profile.id === state.sessionChoice);
|
|
@@ -5243,69 +5789,69 @@ function SessionScope({ state, actions: actions3, t, compact = false, showFeedba
|
|
|
5243
5789
|
} catch {
|
|
5244
5790
|
binding = void 0;
|
|
5245
5791
|
}
|
|
5246
|
-
return /* @__PURE__ */ (0,
|
|
5247
|
-
!compact && /* @__PURE__ */ (0,
|
|
5248
|
-
state.currentSessionId === null ? /* @__PURE__ */ (0,
|
|
5249
|
-
labels !== null && /* @__PURE__ */ (0,
|
|
5250
|
-
labels !== null && !compact && /* @__PURE__ */ (0,
|
|
5251
|
-
session === null && /* @__PURE__ */ (0,
|
|
5252
|
-
session !== null && !allowed && /* @__PURE__ */ (0,
|
|
5253
|
-
/* @__PURE__ */ (0,
|
|
5254
|
-
/* @__PURE__ */ (0,
|
|
5255
|
-
/* @__PURE__ */ (0,
|
|
5792
|
+
return /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)("div", { className: "dsmm-session-scope", "aria-busy": state.sessionBusy !== null, "data-dsmm-session-scope": true, children: [
|
|
5793
|
+
!compact && /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("h3", { children: t("sessionScope") }),
|
|
5794
|
+
state.currentSessionId === null ? /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("p", { className: "dsmm-hint", children: t("sessionChooseWorkspace") }) : /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)(import_jsx_runtime6.Fragment, { children: [
|
|
5795
|
+
labels !== null && /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("p", { "data-dsmm-session-state": true, children: labels.admitted }),
|
|
5796
|
+
labels !== null && !compact && /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("p", { className: "dsmm-hint", "data-dsmm-session-future-default": true, children: labels.futureDefault }),
|
|
5797
|
+
session === null && /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("p", { className: "dsmm-hint", id: `${prefix}-overlay-reason`, children: t("sessionUnavailable") }),
|
|
5798
|
+
session !== null && !allowed && /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("p", { className: "dsmm-hint", id: `${prefix}-overlay-reason`, children: capabilityReason(session.applyOverlayUnavailableReason, t) }),
|
|
5799
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsxs)("div", { className: "dsmm-field", children: [
|
|
5800
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)("label", { htmlFor: `${prefix}-choice`, children: t("sessionSelect") }),
|
|
5801
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsxs)("select", { id: `${prefix}-choice`, value: state.sessionChoice ?? "", disabled: disabled || !allowed, "aria-describedby": !allowed ? `${prefix}-overlay-reason` : void 0, onChange: (event) => {
|
|
5256
5802
|
if (current()) actions3.chooseSessionProfile(event.currentTarget.value || null);
|
|
5257
5803
|
}, children: [
|
|
5258
|
-
/* @__PURE__ */ (0,
|
|
5259
|
-
state.sessionChoice !== null && selected === void 0 && /* @__PURE__ */ (0,
|
|
5260
|
-
state.snapshot?.profiles.map((profile) => /* @__PURE__ */ (0,
|
|
5804
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)("option", { value: "", children: t("sessionBaseline") }),
|
|
5805
|
+
state.sessionChoice !== null && selected === void 0 && /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("option", { value: state.sessionChoice, children: state.sessionChoice }),
|
|
5806
|
+
state.snapshot?.profiles.map((profile) => /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)("option", { value: profile.id, disabled: !isConfigRevision(profile.revision) || profile.error !== void 0, children: [
|
|
5261
5807
|
profile.label?.trim() || profile.id,
|
|
5262
5808
|
profileWarnings(profile.warnings).length ? ` — ${t("warningProfile")}` : ""
|
|
5263
5809
|
] }, profile.id))
|
|
5264
5810
|
] })
|
|
5265
5811
|
] }),
|
|
5266
|
-
!compact && /* @__PURE__ */ (0,
|
|
5267
|
-
/* @__PURE__ */ (0,
|
|
5268
|
-
/* @__PURE__ */ (0,
|
|
5812
|
+
!compact && /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)(import_jsx_runtime6.Fragment, { children: [
|
|
5813
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)("p", { className: "dsmm-hint", id: `${prefix}-model-hint`, children: t("useSessionProfileModelDesc") }),
|
|
5814
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)(import_dsh_client_ui_primitives4.Button, { type: "button", variant: "outline", disabled: disabled || !modelAllowed, "aria-describedby": `${prefix}-model-hint${!modelAllowed ? ` ${prefix}-model-reason` : ""}`, onClick: () => {
|
|
5269
5815
|
if (current()) void actions3.useSessionProfileModel();
|
|
5270
5816
|
}, children: t("headerUseCurrentModel") }),
|
|
5271
|
-
!modelAllowed && /* @__PURE__ */ (0,
|
|
5272
|
-
session !== null && /* @__PURE__ */ (0,
|
|
5273
|
-
/* @__PURE__ */ (0,
|
|
5274
|
-
/* @__PURE__ */ (0,
|
|
5275
|
-
/* @__PURE__ */ (0,
|
|
5276
|
-
binding?.reason !== void 0 && /* @__PURE__ */ (0,
|
|
5817
|
+
!modelAllowed && /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("p", { className: "dsmm-hint", id: `${prefix}-model-reason`, children: capabilityReason(session?.selectModelUnavailableReason, t) }),
|
|
5818
|
+
session !== null && /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)("details", { children: [
|
|
5819
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)("summary", { children: t("technicalDetails") }),
|
|
5820
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsxs)("div", { className: "dsmm-availability", children: [
|
|
5821
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)("p", { children: binding === void 0 ? t("bindingUnknown") : t("bindingState", { binding: binding.binding, ready: t(binding.deliveryFenceReady ? "enabled" : "disabled"), restart: t(binding.restartRequired ? "enabled" : "disabled") }) }),
|
|
5822
|
+
binding?.reason !== void 0 && /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("p", { children: t("bindingReason", { reason: binding.reason }) })
|
|
5277
5823
|
] }),
|
|
5278
|
-
session.roles !== void 0 && /* @__PURE__ */ (0,
|
|
5279
|
-
/* @__PURE__ */ (0,
|
|
5280
|
-
session.roles.map((role3) => /* @__PURE__ */ (0,
|
|
5281
|
-
/* @__PURE__ */ (0,
|
|
5282
|
-
/* @__PURE__ */ (0,
|
|
5824
|
+
session.roles !== void 0 && /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)("details", { children: [
|
|
5825
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)("summary", { children: t("admittedRoles") }),
|
|
5826
|
+
session.roles.map((role3) => /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)("div", { className: "dsmm-availability", children: [
|
|
5827
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)("p", { children: role3.id }),
|
|
5828
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)(RoleAvailability, { value: role3, t })
|
|
5283
5829
|
] }, role3.id))
|
|
5284
5830
|
] }),
|
|
5285
|
-
session.rolePolicy !== void 0 && /* @__PURE__ */ (0,
|
|
5831
|
+
session.rolePolicy !== void 0 && /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("p", { "data-dsmm-session-policy": true, children: t("roleState", { route: session.rolePolicy.route === void 0 ? t("inheritRoute") : `${session.rolePolicy.route.provider}/${session.rolePolicy.route.model}${session.rolePolicy.route.reasoningEffort === void 0 ? "" : ` (${session.rolePolicy.route.reasoningEffort})`}`, strategy: session.rolePolicy.strategy, retries: session.rolePolicy.retries, failures: session.rolePolicy.rateLimitFailures, switches: session.rolePolicy.switches, delay: session.rolePolicy.totalDelayMs }) })
|
|
5286
5832
|
] })
|
|
5287
5833
|
] }),
|
|
5288
|
-
/* @__PURE__ */ (0,
|
|
5289
|
-
/* @__PURE__ */ (0,
|
|
5834
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsxs)("div", { className: "dsmm-actions", children: [
|
|
5835
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)(import_dsh_client_ui_primitives4.Button, { type: "button", variant: "outline", disabled: disabled || !allowed || state.sessionChoice !== null && !isConfigRevision(selected?.revision), "aria-describedby": !allowed ? `${prefix}-overlay-reason` : void 0, onClick: () => {
|
|
5290
5836
|
if (current()) void actions3.applySession();
|
|
5291
5837
|
}, children: t(state.sessionBusy === "apply" ? "sessionApplying" : "sessionApply") }),
|
|
5292
|
-
!compact && /* @__PURE__ */ (0,
|
|
5838
|
+
!compact && /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(import_dsh_client_ui_primitives4.Button, { type: "button", variant: "outline", disabled: disabled || !allowed, "aria-describedby": !allowed ? `${prefix}-overlay-reason` : void 0, onClick: () => {
|
|
5293
5839
|
if (current()) void actions3.resetSession();
|
|
5294
5840
|
}, children: t(state.sessionBusy === "reset" ? "sessionResetting" : "sessionReset") }),
|
|
5295
|
-
/* @__PURE__ */ (0,
|
|
5841
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)(import_dsh_client_ui_primitives4.Button, { type: "button", variant: "outline", disabled: state.sessionBusy !== null || state.busy !== null || state.pendingEditor !== null, onClick: () => {
|
|
5296
5842
|
if (current()) void actions3.refreshSession();
|
|
5297
5843
|
}, children: t("sessionRefresh") })
|
|
5298
5844
|
] })
|
|
5299
5845
|
] }),
|
|
5300
|
-
showFeedback && /* @__PURE__ */ (0,
|
|
5846
|
+
showFeedback && /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(SessionScopeFeedback, { state, t })
|
|
5301
5847
|
] });
|
|
5302
5848
|
}
|
|
5303
5849
|
function SessionProfiles(props) {
|
|
5304
|
-
const prefix = (0,
|
|
5850
|
+
const prefix = (0, import_react4.useId)();
|
|
5305
5851
|
const state = props.useProfiles((snapshot4) => snapshot4);
|
|
5306
5852
|
const id2 = state.currentSessionId;
|
|
5307
|
-
const [openFor, setOpenFor] = (0,
|
|
5308
|
-
(0,
|
|
5853
|
+
const [openFor, setOpenFor] = (0, import_react4.useState)(void 0);
|
|
5854
|
+
(0, import_react4.useEffect)(() => {
|
|
5309
5855
|
setOpenFor(void 0);
|
|
5310
5856
|
}, [id2]);
|
|
5311
5857
|
if (props.sessionId !== void 0 && props.sessionId !== id2) return null;
|
|
@@ -5354,9 +5900,9 @@ function SessionProfiles(props) {
|
|
|
5354
5900
|
entries.push({ type: "separator", id: "@model-separator" }, { id: "@use-model", label: t("headerUseCurrentModel"), disabled: profileDisabled || session?.canSelectModel !== true || session?.profileModel === void 0 });
|
|
5355
5901
|
if (session !== null && session.canSelectModel !== true) entries.push({ type: "label", id: "@model-reason", text: capabilityReason(session.selectModelUnavailableReason, t) });
|
|
5356
5902
|
const open = openFor === id2;
|
|
5357
|
-
return /* @__PURE__ */ (0,
|
|
5358
|
-
/* @__PURE__ */ (0,
|
|
5359
|
-
|
|
5903
|
+
return /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)("div", { className: "dsmm-header-profiles", "data-dsmm-header-profile": true, "aria-busy": committing, children: [
|
|
5904
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
|
|
5905
|
+
import_dsh_client_ui_primitives4.Menu,
|
|
5360
5906
|
{
|
|
5361
5907
|
open,
|
|
5362
5908
|
autoFocus: true,
|
|
@@ -5367,7 +5913,7 @@ function SessionProfiles(props) {
|
|
|
5367
5913
|
items: entries,
|
|
5368
5914
|
selectedId: current,
|
|
5369
5915
|
footer: [{ id: "@refresh", label: t("headerCompactRefresh"), disabled: committing || state.busy !== null }],
|
|
5370
|
-
anchor: /* @__PURE__ */ (0,
|
|
5916
|
+
anchor: /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(import_dsh_client_ui_primitives4.Button, { type: "button", size: "sm", variant: "toolbar", className: "dsmm-profile-trigger", icon: /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(import_dsh_client_ui_primitives4.IconBranchOutlineRegular, {}), "aria-label": t("headerProfileLabel"), "aria-haspopup": "menu", "aria-expanded": open, "aria-describedby": `${prefix}-feedback`, onClick: () => setOpenFor(open ? void 0 : id2) }),
|
|
5371
5917
|
onClose: () => setOpenFor(void 0),
|
|
5372
5918
|
onSelect: (value) => {
|
|
5373
5919
|
const live = props.readProfileView();
|
|
@@ -5393,7 +5939,7 @@ function SessionProfiles(props) {
|
|
|
5393
5939
|
}
|
|
5394
5940
|
}
|
|
5395
5941
|
),
|
|
5396
|
-
/* @__PURE__ */ (0,
|
|
5942
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsxs)("span", { className: "dsmm-profile-announcement", id: `${prefix}-feedback`, role: state.sessionIssue === null ? "status" : "alert", "aria-live": "polite", "aria-atomic": "true", children: [
|
|
5397
5943
|
feedback || currentLabel,
|
|
5398
5944
|
diagnostic2 === null ? "" : ` ${diagnosticText} ${retryHint}`
|
|
5399
5945
|
] })
|
|
@@ -5401,33 +5947,44 @@ function SessionProfiles(props) {
|
|
|
5401
5947
|
}
|
|
5402
5948
|
|
|
5403
5949
|
// src/client/ProfilesSection.tsx
|
|
5404
|
-
var
|
|
5405
|
-
function
|
|
5406
|
-
|
|
5407
|
-
|
|
5408
|
-
|
|
5409
|
-
|
|
5950
|
+
var import_jsx_runtime7 = require("react/jsx-runtime");
|
|
5951
|
+
function locateGlobalField(container, field) {
|
|
5952
|
+
const path = field.replace(/^settings\./, "");
|
|
5953
|
+
const selectors = {
|
|
5954
|
+
"runtimePolicy.strategy": "select[id$='-strategy']",
|
|
5955
|
+
"guards.gitWriteGuard": "select[id$='-git-guard']",
|
|
5956
|
+
"guards.gitWriteScope": "select[id$='-git-scope']",
|
|
5957
|
+
"subagents.toolTopology": "select[id$='-topology']"
|
|
5958
|
+
};
|
|
5959
|
+
const rateLimit3 = /^runtimePolicy\.rateLimit\.([a-zA-Z]+)$/.exec(path);
|
|
5960
|
+
const selector = rateLimit3 && Object.hasOwn(DSMM_RATE_LIMIT_BOUNDS, rateLimit3[1]) ? `input[data-dsmm-policy-field='${rateLimit3[1]}']` : Object.hasOwn(selectors, path) ? selectors[path] : void 0;
|
|
5961
|
+
return selector === void 0 ? null : container.querySelector(selector);
|
|
5410
5962
|
}
|
|
5411
5963
|
function ProfilesSection(props) {
|
|
5412
5964
|
const { t } = props;
|
|
5413
5965
|
const state = props.useProfiles((snapshot5) => snapshot5);
|
|
5414
|
-
const prefix = (0,
|
|
5415
|
-
const selectRef = (0,
|
|
5416
|
-
const inputRef = (0,
|
|
5417
|
-
const labelRef = (0,
|
|
5418
|
-
const editorRef = (0,
|
|
5419
|
-
const advancedRef = (0,
|
|
5420
|
-
const advancedSettingsRef = (0,
|
|
5421
|
-
const moreActionsRef = (0,
|
|
5422
|
-
const handledValidation = (0,
|
|
5423
|
-
const cancelRef = (0,
|
|
5424
|
-
const hadConfirmation = (0,
|
|
5425
|
-
const initiatorRef = (0,
|
|
5426
|
-
const
|
|
5427
|
-
const
|
|
5428
|
-
const
|
|
5429
|
-
const
|
|
5430
|
-
const
|
|
5966
|
+
const prefix = (0, import_react5.useId)();
|
|
5967
|
+
const selectRef = (0, import_react5.useRef)(null);
|
|
5968
|
+
const inputRef = (0, import_react5.useRef)(null);
|
|
5969
|
+
const labelRef = (0, import_react5.useRef)(null);
|
|
5970
|
+
const editorRef = (0, import_react5.useRef)(null);
|
|
5971
|
+
const advancedRef = (0, import_react5.useRef)(null);
|
|
5972
|
+
const advancedSettingsRef = (0, import_react5.useRef)(null);
|
|
5973
|
+
const moreActionsRef = (0, import_react5.useRef)(null);
|
|
5974
|
+
const handledValidation = (0, import_react5.useRef)(0);
|
|
5975
|
+
const cancelRef = (0, import_react5.useRef)(null);
|
|
5976
|
+
const hadConfirmation = (0, import_react5.useRef)(false);
|
|
5977
|
+
const initiatorRef = (0, import_react5.useRef)(null);
|
|
5978
|
+
const dialogInitiatorRef = (0, import_react5.useRef)(null);
|
|
5979
|
+
const orchestratorRef = (0, import_react5.useRef)(null);
|
|
5980
|
+
const sessionScopeRef = (0, import_react5.useRef)(null);
|
|
5981
|
+
const [modelsDialogOpen, setModelsDialogOpen] = (0, import_react5.useState)(false);
|
|
5982
|
+
const [targetRole, setTargetRole] = (0, import_react5.useState)(null);
|
|
5983
|
+
const [targetRoleField, setTargetRoleField] = (0, import_react5.useState)(null);
|
|
5984
|
+
const pendingDialogFocus = (0, import_react5.useRef)(null);
|
|
5985
|
+
const advancedOpenRef = (0, import_react5.useRef)(false);
|
|
5986
|
+
const jsoncOpenRef = (0, import_react5.useRef)(false);
|
|
5987
|
+
const moreActionsOpenRef = (0, import_react5.useRef)(false);
|
|
5431
5988
|
const disabled = state.busy !== null || state.pendingEditor !== null || state.sessionBusy === "apply" || state.sessionBusy === "reset";
|
|
5432
5989
|
const snapshot4 = state.snapshot;
|
|
5433
5990
|
const hasOrchestrator = snapshot4?.roles?.some((role3) => role3.id === "dsmm-orchestrator") === true;
|
|
@@ -5439,13 +5996,65 @@ function ProfilesSection(props) {
|
|
|
5439
5996
|
const invalid2 = state.issue?.kind === "domain" && state.issue.code === "validation";
|
|
5440
5997
|
const idInvalid = invalid2 && state.issue?.field === "id" && state.issue.location === void 0 && editor?.revision === null && !editorDisabled;
|
|
5441
5998
|
const structuredDoc = editor === null ? null : structuredDocument(editor.content);
|
|
5442
|
-
const lastValidBasicDocRef = (0,
|
|
5443
|
-
if (structuredDoc !== null) {
|
|
5444
|
-
lastValidBasicDocRef.current = structuredDoc;
|
|
5999
|
+
const lastValidBasicDocRef = (0, import_react5.useRef)(null);
|
|
6000
|
+
if (editor !== null && structuredDoc !== null) {
|
|
6001
|
+
lastValidBasicDocRef.current = { id: editor.id, epoch: state.editorEpoch, doc: structuredDoc };
|
|
5445
6002
|
}
|
|
5446
|
-
const basicDoc = structuredDoc ?? lastValidBasicDocRef.current;
|
|
6003
|
+
const basicDoc = structuredDoc ?? (lastValidBasicDocRef.current !== null && lastValidBasicDocRef.current.id === editor?.id && lastValidBasicDocRef.current.epoch === state.editorEpoch ? lastValidBasicDocRef.current.doc : null);
|
|
5447
6004
|
const rawInvalid = editor !== null && structuredDoc === null;
|
|
5448
|
-
|
|
6005
|
+
function focusJsonc(location) {
|
|
6006
|
+
if (advancedRef.current !== null) {
|
|
6007
|
+
advancedRef.current.open = true;
|
|
6008
|
+
jsoncOpenRef.current = true;
|
|
6009
|
+
}
|
|
6010
|
+
const input = editorRef.current;
|
|
6011
|
+
if (input === null) return false;
|
|
6012
|
+
const reducedMotion = typeof window !== "undefined" && window.matchMedia("(prefers-reduced-motion: reduce)").matches;
|
|
6013
|
+
input.scrollIntoView?.({ behavior: reducedMotion ? "auto" : "smooth", block: "nearest" });
|
|
6014
|
+
input.focus();
|
|
6015
|
+
if (input.ownerDocument.activeElement !== input) return false;
|
|
6016
|
+
if (location !== void 0 && location.offset + location.length <= input.value.length) {
|
|
6017
|
+
input.setSelectionRange(location.offset, location.offset + location.length);
|
|
6018
|
+
}
|
|
6019
|
+
return true;
|
|
6020
|
+
}
|
|
6021
|
+
function focusGlobalField(field) {
|
|
6022
|
+
const container = advancedSettingsRef.current;
|
|
6023
|
+
if (container === null) return false;
|
|
6024
|
+
const target = locateGlobalField(container, field);
|
|
6025
|
+
if (target === null) return false;
|
|
6026
|
+
container.open = true;
|
|
6027
|
+
advancedOpenRef.current = true;
|
|
6028
|
+
const reducedMotion = typeof window !== "undefined" && window.matchMedia("(prefers-reduced-motion: reduce)").matches;
|
|
6029
|
+
target.scrollIntoView?.({ behavior: reducedMotion ? "auto" : "smooth", block: "nearest" });
|
|
6030
|
+
target.focus();
|
|
6031
|
+
return target.ownerDocument.activeElement === target;
|
|
6032
|
+
}
|
|
6033
|
+
function closeModelsDialog(kind) {
|
|
6034
|
+
pendingDialogFocus.current = {
|
|
6035
|
+
kind,
|
|
6036
|
+
editorEpoch: state.editorEpoch,
|
|
6037
|
+
validationEpoch: state.validationEpoch,
|
|
6038
|
+
issue: state.issue,
|
|
6039
|
+
trigger: dialogInitiatorRef.current
|
|
6040
|
+
};
|
|
6041
|
+
setModelsDialogOpen(false);
|
|
6042
|
+
setTargetRole(null);
|
|
6043
|
+
setTargetRoleField(null);
|
|
6044
|
+
}
|
|
6045
|
+
(0, import_react5.useEffect)(() => {
|
|
6046
|
+
if (modelsDialogOpen) return;
|
|
6047
|
+
const pending = pendingDialogFocus.current;
|
|
6048
|
+
if (pending === null) return;
|
|
6049
|
+
pendingDialogFocus.current = null;
|
|
6050
|
+
if (pending.editorEpoch !== state.editorEpoch || pending.validationEpoch !== state.validationEpoch || pending.issue !== state.issue) return;
|
|
6051
|
+
if (pending.kind === "jsonc") {
|
|
6052
|
+
if (focusJsonc(pending.issue?.location)) handledValidation.current = pending.validationEpoch;
|
|
6053
|
+
} else if (pending.trigger?.isConnected) {
|
|
6054
|
+
pending.trigger.focus();
|
|
6055
|
+
}
|
|
6056
|
+
}, [modelsDialogOpen, state.editorEpoch, state.validationEpoch, state.issue]);
|
|
6057
|
+
(0, import_react5.useEffect)(() => {
|
|
5449
6058
|
if (state.pendingEditor !== null) {
|
|
5450
6059
|
cancelRef.current?.focus();
|
|
5451
6060
|
hadConfirmation.current = true;
|
|
@@ -5458,31 +6067,33 @@ function ProfilesSection(props) {
|
|
|
5458
6067
|
}
|
|
5459
6068
|
}
|
|
5460
6069
|
}, [state.pendingEditor]);
|
|
5461
|
-
(0,
|
|
6070
|
+
(0, import_react5.useEffect)(() => {
|
|
5462
6071
|
if (state.busy === null && state.validationEpoch > handledValidation.current && state.issue?.kind === "domain" && state.issue.code === "validation") {
|
|
5463
|
-
handledValidation.current = state.validationEpoch;
|
|
5464
6072
|
const reducedMotion = typeof window !== "undefined" && window.matchMedia("(prefers-reduced-motion: reduce)").matches;
|
|
5465
6073
|
const scrollOpt = { behavior: reducedMotion ? "auto" : "smooth", block: "nearest" };
|
|
5466
|
-
if (state.issue.location === void 0 && state.issue.field === "id" && inputRef.current !== null && !inputRef.current.disabled && !inputRef.current.readOnly) {
|
|
6074
|
+
if (state.issue.location === void 0 && (state.issue.field === "id" || state.issue.field === "newId") && inputRef.current !== null && !inputRef.current.disabled && !inputRef.current.readOnly) {
|
|
6075
|
+
handledValidation.current = state.validationEpoch;
|
|
5467
6076
|
if (typeof inputRef.current.scrollIntoView === "function") inputRef.current.scrollIntoView(scrollOpt);
|
|
5468
6077
|
inputRef.current.focus();
|
|
5469
|
-
|
|
5470
|
-
|
|
5471
|
-
|
|
5472
|
-
|
|
5473
|
-
|
|
5474
|
-
|
|
5475
|
-
|
|
5476
|
-
|
|
5477
|
-
|
|
5478
|
-
|
|
5479
|
-
if (location !== void 0 && location.offset + location.length <= input.value.length) {
|
|
5480
|
-
input.setSelectionRange(location.offset, location.offset + location.length);
|
|
5481
|
-
}
|
|
5482
|
-
}
|
|
6078
|
+
return;
|
|
6079
|
+
}
|
|
6080
|
+
const field = state.issue.field ?? "";
|
|
6081
|
+
const roleMatch = /^(?:settings\.)?(?:roleRouting|roles)\.([a-zA-Z0-9_-]+)(?:\.|$)/.exec(field);
|
|
6082
|
+
const roleId2 = roleMatch?.[1];
|
|
6083
|
+
if (roleId2 && snapshot4?.roles?.some((r) => r.id === roleId2)) {
|
|
6084
|
+
setTargetRole(roleId2);
|
|
6085
|
+
setTargetRoleField(field);
|
|
6086
|
+
setModelsDialogOpen(true);
|
|
6087
|
+
return;
|
|
5483
6088
|
}
|
|
6089
|
+
if (focusGlobalField(field)) {
|
|
6090
|
+
handledValidation.current = state.validationEpoch;
|
|
6091
|
+
return;
|
|
6092
|
+
}
|
|
6093
|
+
if (modelsDialogOpen) closeModelsDialog("jsonc");
|
|
6094
|
+
else if (focusJsonc(state.issue.location)) handledValidation.current = state.validationEpoch;
|
|
5484
6095
|
}
|
|
5485
|
-
}, [state.issue, state.busy, state.validationEpoch]);
|
|
6096
|
+
}, [state.issue, state.busy, state.validationEpoch, snapshot4?.roles]);
|
|
5486
6097
|
const relationship = editor?.revision != null && editor.id === snapshot4?.selectedId ? sourceRelationship(snapshot4, editor.revision) : "changed";
|
|
5487
6098
|
const applied = relationship === "current";
|
|
5488
6099
|
let selection = t(snapshot4 === null ? "unavailable" : "baseline");
|
|
@@ -5490,84 +6101,84 @@ function ProfilesSection(props) {
|
|
|
5490
6101
|
else if (snapshot4?.selectedId !== null && snapshot4?.selectedId !== void 0) selection = t("appliedProfile", { id: snapshot4.selectedId, revision: t(configurationVersionState(snapshot4.sourceRevision)) });
|
|
5491
6102
|
const notice = state.notice === null ? "" : t(state.notice.key === "reset" ? "resetDone" : state.notice.key, { id: state.notice.id });
|
|
5492
6103
|
const warnings2 = editor === null ? [] : draftWarnings(editor.content);
|
|
5493
|
-
return /* @__PURE__ */ (0,
|
|
5494
|
-
readOnly && /* @__PURE__ */ (0,
|
|
5495
|
-
/* @__PURE__ */ (0,
|
|
5496
|
-
/* @__PURE__ */ (0,
|
|
5497
|
-
/* @__PURE__ */ (0,
|
|
5498
|
-
snapshot4 !== null && /* @__PURE__ */ (0,
|
|
5499
|
-
/* @__PURE__ */ (0,
|
|
5500
|
-
/* @__PURE__ */ (0,
|
|
6104
|
+
return /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)("section", { className: "dsmm-profiles dsmm-named-profiles", "aria-label": t("title"), "aria-busy": state.busy !== null, children: [
|
|
6105
|
+
readOnly && /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("p", { role: "status", className: "dsmm-hint", children: t("readOnlyOrigin") }),
|
|
6106
|
+
/* @__PURE__ */ (0, import_jsx_runtime7.jsx)("h2", { children: t("title") }),
|
|
6107
|
+
/* @__PURE__ */ (0, import_jsx_runtime7.jsx)("p", { className: "dsmm-hint", children: t("description") }),
|
|
6108
|
+
/* @__PURE__ */ (0, import_jsx_runtime7.jsxs)("div", { className: "dsmm-browse-row", children: [
|
|
6109
|
+
snapshot4 !== null && /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)("div", { className: "dsmm-field", children: [
|
|
6110
|
+
/* @__PURE__ */ (0, import_jsx_runtime7.jsx)("label", { htmlFor: `${prefix}-select`, children: t("editorSelect") }),
|
|
6111
|
+
/* @__PURE__ */ (0, import_jsx_runtime7.jsxs)("select", { ref: selectRef, id: `${prefix}-select`, disabled, value: editor?.revision == null ? "" : editor.id, onChange: (event) => {
|
|
5501
6112
|
initiatorRef.current = event.currentTarget;
|
|
5502
6113
|
if (event.currentTarget.value) void props.open(event.currentTarget.value);
|
|
5503
6114
|
}, children: [
|
|
5504
|
-
/* @__PURE__ */ (0,
|
|
5505
|
-
snapshot4.profiles.map((profile, index) => /* @__PURE__ */ (0,
|
|
6115
|
+
/* @__PURE__ */ (0, import_jsx_runtime7.jsx)("option", { value: "", children: t(editor?.revision === null ? "newDraft" : "choose") }),
|
|
6116
|
+
snapshot4.profiles.map((profile, index) => /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)("option", { value: profile.id, children: [
|
|
5506
6117
|
profile.label?.trim() ? `${profile.label} (${profile.id})` : profile.id,
|
|
5507
6118
|
profile.error === void 0 ? "" : ` — ${t("invalidProfile", { id: profile.id })}`,
|
|
5508
6119
|
profile.warnings?.length ? ` — ${t("warningProfile")}` : ""
|
|
5509
6120
|
] }, `${index}:${profile.id}`))
|
|
5510
6121
|
] })
|
|
5511
6122
|
] }),
|
|
5512
|
-
/* @__PURE__ */ (0,
|
|
5513
|
-
/* @__PURE__ */ (0,
|
|
6123
|
+
/* @__PURE__ */ (0, import_jsx_runtime7.jsxs)("div", { className: "dsmm-actions", children: [
|
|
6124
|
+
/* @__PURE__ */ (0, import_jsx_runtime7.jsx)(import_dsh_client_ui_primitives5.Button, { type: "button", variant: "outline", disabled: editorDisabled || snapshot4 === null, onClick: (event) => {
|
|
5514
6125
|
initiatorRef.current = event.currentTarget;
|
|
5515
6126
|
void props.create();
|
|
5516
6127
|
}, children: t("new") }),
|
|
5517
|
-
/* @__PURE__ */ (0,
|
|
6128
|
+
/* @__PURE__ */ (0, import_jsx_runtime7.jsx)(import_dsh_client_ui_primitives5.Button, { type: "button", variant: "outline", disabled, onClick: (event) => {
|
|
5518
6129
|
initiatorRef.current = event.currentTarget;
|
|
5519
6130
|
void props.refresh();
|
|
5520
6131
|
}, children: t(state.busy === "refresh" ? "refreshing" : "refresh") })
|
|
5521
6132
|
] }),
|
|
5522
|
-
editor !== null && /* @__PURE__ */ (0,
|
|
6133
|
+
editor !== null && /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("p", { className: "dsmm-badge", "data-dsmm-editor-state": state.invalidFields.length > 0 || invalid2 || rawInvalid ? "invalid" : state.dirty ? "dirty" : readOnly ? "readonly" : "ready", children: t(editor.refreshRequired ? "savedRefreshRequired" : state.invalidFields.length > 0 || invalid2 || rawInvalid ? "validation" : state.dirty ? "dirty" : applied ? "savedApplied" : relationship === "unknown" ? "savedRelationshipUnknown" : "savedNotApplied") })
|
|
5523
6134
|
] }),
|
|
5524
|
-
snapshot4?.profiles.length === 0 && /* @__PURE__ */ (0,
|
|
5525
|
-
snapshot4 !== null && snapshot4.profiles.some((profile) => profile.error !== void 0 || profile.warnings?.length) && /* @__PURE__ */ (0,
|
|
5526
|
-
/* @__PURE__ */ (0,
|
|
5527
|
-
/* @__PURE__ */ (0,
|
|
5528
|
-
profile.error !== void 0 && /* @__PURE__ */ (0,
|
|
6135
|
+
snapshot4?.profiles.length === 0 && /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("p", { className: "dsmm-hint", children: t("empty") }),
|
|
6136
|
+
snapshot4 !== null && snapshot4.profiles.some((profile) => profile.error !== void 0 || profile.warnings?.length) && /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("ul", { className: "dsmm-profile-list", "aria-label": t("savedInventory"), children: snapshot4.profiles.filter((profile) => profile.error !== void 0 || profile.warnings?.length).map((profile, index) => /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)("li", { children: [
|
|
6137
|
+
/* @__PURE__ */ (0, import_jsx_runtime7.jsx)("p", { children: profile.label?.trim() ? `${profile.label} (${profile.id})` : profile.id }),
|
|
6138
|
+
/* @__PURE__ */ (0, import_jsx_runtime7.jsx)(ProfileWarnings, { warnings: profile.warnings, t }),
|
|
6139
|
+
profile.error !== void 0 && /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(IssueDetails, { issue: profile.error, t })
|
|
5529
6140
|
] }, `${index}:${profile.id}`)) }),
|
|
5530
|
-
state.pendingEditor !== null && /* @__PURE__ */ (0,
|
|
6141
|
+
state.pendingEditor !== null && /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)("div", { className: "dsmm-confirm", role: "group", "aria-labelledby": `${prefix}-confirm`, onKeyDown: (event) => {
|
|
5531
6142
|
if (event.key === "Escape") {
|
|
5532
6143
|
event.preventDefault();
|
|
5533
6144
|
props.cancelDiscard();
|
|
5534
6145
|
}
|
|
5535
6146
|
}, children: [
|
|
5536
|
-
/* @__PURE__ */ (0,
|
|
5537
|
-
/* @__PURE__ */ (0,
|
|
5538
|
-
/* @__PURE__ */ (0,
|
|
6147
|
+
/* @__PURE__ */ (0, import_jsx_runtime7.jsx)("p", { id: `${prefix}-confirm`, children: t("discardPrompt") }),
|
|
6148
|
+
/* @__PURE__ */ (0, import_jsx_runtime7.jsxs)("div", { className: "dsmm-actions", children: [
|
|
6149
|
+
/* @__PURE__ */ (0, import_jsx_runtime7.jsx)(import_dsh_client_ui_primitives5.Button, { type: "button", variant: "outline", onClick: () => {
|
|
5539
6150
|
void props.discardAndOpen();
|
|
5540
6151
|
}, children: t("discard") }),
|
|
5541
|
-
/* @__PURE__ */ (0,
|
|
6152
|
+
/* @__PURE__ */ (0, import_jsx_runtime7.jsx)(import_dsh_client_ui_primitives5.Button, { ref: cancelRef, type: "button", variant: "primary", onClick: props.cancelDiscard, children: t("cancel") })
|
|
5542
6153
|
] })
|
|
5543
6154
|
] }),
|
|
5544
|
-
/* @__PURE__ */ (0,
|
|
5545
|
-
/* @__PURE__ */ (0,
|
|
5546
|
-
/* @__PURE__ */ (0,
|
|
5547
|
-
/* @__PURE__ */ (0,
|
|
6155
|
+
/* @__PURE__ */ (0, import_jsx_runtime7.jsxs)("div", { className: "dsmm-effective-summary", "data-dsmm-effective-summary": true, children: [
|
|
6156
|
+
/* @__PURE__ */ (0, import_jsx_runtime7.jsxs)("div", { className: "dsmm-summary-row", children: [
|
|
6157
|
+
/* @__PURE__ */ (0, import_jsx_runtime7.jsxs)("div", { children: [
|
|
6158
|
+
/* @__PURE__ */ (0, import_jsx_runtime7.jsx)("span", { className: "dsmm-summary-label", children: t("futureDefaultSummary") }),
|
|
5548
6159
|
" ",
|
|
5549
|
-
/* @__PURE__ */ (0,
|
|
6160
|
+
/* @__PURE__ */ (0, import_jsx_runtime7.jsx)("span", { className: "dsmm-summary-val", "data-dsmm-selection": true, children: selection })
|
|
5550
6161
|
] }),
|
|
5551
|
-
/* @__PURE__ */ (0,
|
|
6162
|
+
/* @__PURE__ */ (0, import_jsx_runtime7.jsx)(import_dsh_client_ui_primitives5.Button, { type: "button", variant: "primary", size: "sm", disabled: editorDisabled || state.dirty || state.invalidFields.length > 0 || editor?.revision == null || !reconcilable || applied && !selectionConflict, onClick: () => {
|
|
5552
6163
|
void props.apply();
|
|
5553
6164
|
}, children: t(state.busy === "apply" ? "applying" : "apply") })
|
|
5554
6165
|
] }),
|
|
5555
|
-
snapshot4?.refreshRequired && /* @__PURE__ */ (0,
|
|
5556
|
-
snapshot4?.selectedWarnings?.length ? /* @__PURE__ */ (0,
|
|
5557
|
-
/* @__PURE__ */ (0,
|
|
5558
|
-
/* @__PURE__ */ (0,
|
|
6166
|
+
snapshot4?.refreshRequired && /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("p", { role: "status", children: t("savedRefreshRequired") }),
|
|
6167
|
+
snapshot4?.selectedWarnings?.length ? /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)("div", { children: [
|
|
6168
|
+
/* @__PURE__ */ (0, import_jsx_runtime7.jsx)("p", { children: t("futureWarnings") }),
|
|
6169
|
+
/* @__PURE__ */ (0, import_jsx_runtime7.jsx)(ProfileWarnings, { warnings: snapshot4.selectedWarnings, t })
|
|
5559
6170
|
] }) : null,
|
|
5560
|
-
snapshot4?.selectionError !== void 0 && /* @__PURE__ */ (0,
|
|
5561
|
-
/* @__PURE__ */ (0,
|
|
5562
|
-
/* @__PURE__ */ (0,
|
|
6171
|
+
snapshot4?.selectionError !== void 0 && /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)("div", { className: "dsmm-issue", children: [
|
|
6172
|
+
/* @__PURE__ */ (0, import_jsx_runtime7.jsx)("p", { children: t(selectionConflict ? "selectionConflict" : "retry") }),
|
|
6173
|
+
/* @__PURE__ */ (0, import_jsx_runtime7.jsx)(IssueDetails, { issue: snapshot4.selectionError, t })
|
|
5563
6174
|
] }),
|
|
5564
|
-
/* @__PURE__ */ (0,
|
|
5565
|
-
/* @__PURE__ */ (0,
|
|
5566
|
-
/* @__PURE__ */ (0,
|
|
6175
|
+
/* @__PURE__ */ (0, import_jsx_runtime7.jsxs)("div", { className: "dsmm-summary-row", children: [
|
|
6176
|
+
/* @__PURE__ */ (0, import_jsx_runtime7.jsxs)("div", { children: [
|
|
6177
|
+
/* @__PURE__ */ (0, import_jsx_runtime7.jsx)("span", { className: "dsmm-summary-label", children: t("currentSessionSummary") }),
|
|
5567
6178
|
" ",
|
|
5568
|
-
/* @__PURE__ */ (0,
|
|
6179
|
+
/* @__PURE__ */ (0, import_jsx_runtime7.jsx)("span", { className: "dsmm-summary-val", children: state.session === null ? t("sessionUnavailable") : sessionProfileLabels(state.session, t).admitted })
|
|
5569
6180
|
] }),
|
|
5570
|
-
/* @__PURE__ */ (0,
|
|
6181
|
+
/* @__PURE__ */ (0, import_jsx_runtime7.jsx)(import_dsh_client_ui_primitives5.Button, { type: "button", variant: "outline", size: "sm", onClick: () => {
|
|
5571
6182
|
if (moreActionsRef.current !== null) {
|
|
5572
6183
|
moreActionsRef.current.open = true;
|
|
5573
6184
|
moreActionsOpenRef.current = true;
|
|
@@ -5576,45 +6187,45 @@ function ProfilesSection(props) {
|
|
|
5576
6187
|
sessionScopeRef.current?.scrollIntoView({ behavior: reducedMotion ? "auto" : "smooth" });
|
|
5577
6188
|
}, children: t("locateSessionScope") })
|
|
5578
6189
|
] }),
|
|
5579
|
-
/* @__PURE__ */ (0,
|
|
5580
|
-
/* @__PURE__ */ (0,
|
|
6190
|
+
/* @__PURE__ */ (0, import_jsx_runtime7.jsx)(SessionScopeFeedback, { state, t }),
|
|
6191
|
+
/* @__PURE__ */ (0, import_jsx_runtime7.jsxs)("details", { ref: moreActionsRef, className: "dsmm-more-actions", open: moreActionsOpenRef.current || void 0, onToggle: (e) => {
|
|
5581
6192
|
moreActionsOpenRef.current = e.currentTarget.open;
|
|
5582
6193
|
}, children: [
|
|
5583
|
-
/* @__PURE__ */ (0,
|
|
5584
|
-
/* @__PURE__ */ (0,
|
|
5585
|
-
/* @__PURE__ */ (0,
|
|
5586
|
-
/* @__PURE__ */ (0,
|
|
6194
|
+
/* @__PURE__ */ (0, import_jsx_runtime7.jsx)("summary", { children: t("moreActions") }),
|
|
6195
|
+
/* @__PURE__ */ (0, import_jsx_runtime7.jsxs)("div", { children: [
|
|
6196
|
+
/* @__PURE__ */ (0, import_jsx_runtime7.jsxs)("div", { children: [
|
|
6197
|
+
/* @__PURE__ */ (0, import_jsx_runtime7.jsx)(import_dsh_client_ui_primitives5.Button, { type: "button", variant: "outline", disabled: editorDisabled || !reconcilable || snapshot4?.selectedId === null && !selectionConflict, onClick: () => {
|
|
5587
6198
|
void props.reset();
|
|
5588
6199
|
}, children: t(state.busy === "reset" ? "resetting" : "reset") }),
|
|
5589
|
-
/* @__PURE__ */ (0,
|
|
6200
|
+
/* @__PURE__ */ (0, import_jsx_runtime7.jsx)("p", { className: "dsmm-hint", children: t("futureResetHint") })
|
|
5590
6201
|
] }),
|
|
5591
|
-
/* @__PURE__ */ (0,
|
|
6202
|
+
/* @__PURE__ */ (0, import_jsx_runtime7.jsx)("div", { ref: sessionScopeRef, children: /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(SessionScope, { state, actions: props, t, showFeedback: false }) })
|
|
5592
6203
|
] })
|
|
5593
6204
|
] })
|
|
5594
6205
|
] }),
|
|
5595
|
-
editor === null && /* @__PURE__ */ (0,
|
|
5596
|
-
editor !== null && /* @__PURE__ */ (0,
|
|
5597
|
-
warnings2.length > 0 && /* @__PURE__ */ (0,
|
|
5598
|
-
/* @__PURE__ */ (0,
|
|
5599
|
-
/* @__PURE__ */ (0,
|
|
6206
|
+
editor === null && /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("p", { className: "dsmm-hint", children: t("noEditor") }),
|
|
6207
|
+
editor !== null && /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)("div", { className: "dsmm-editor", children: [
|
|
6208
|
+
warnings2.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)("div", { children: [
|
|
6209
|
+
/* @__PURE__ */ (0, import_jsx_runtime7.jsx)("p", { children: t("draftWarnings") }),
|
|
6210
|
+
/* @__PURE__ */ (0, import_jsx_runtime7.jsx)(ProfileWarnings, { warnings: warnings2, t })
|
|
5600
6211
|
] }),
|
|
5601
|
-
editor.warnings?.length ? /* @__PURE__ */ (0,
|
|
5602
|
-
/* @__PURE__ */ (0,
|
|
5603
|
-
/* @__PURE__ */ (0,
|
|
6212
|
+
editor.warnings?.length ? /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)("div", { children: [
|
|
6213
|
+
/* @__PURE__ */ (0, import_jsx_runtime7.jsx)("p", { children: t("savedWarnings") }),
|
|
6214
|
+
/* @__PURE__ */ (0, import_jsx_runtime7.jsx)(ProfileWarnings, { warnings: editor.warnings, t })
|
|
5604
6215
|
] }) : null,
|
|
5605
|
-
/* @__PURE__ */ (0,
|
|
5606
|
-
state.catalogUnavailable && /* @__PURE__ */ (0,
|
|
5607
|
-
state.catalog?.failures.map((failure) => /* @__PURE__ */ (0,
|
|
5608
|
-
/* @__PURE__ */ (0,
|
|
6216
|
+
/* @__PURE__ */ (0, import_jsx_runtime7.jsxs)("div", { className: "dsmm-catalog", children: [
|
|
6217
|
+
state.catalogUnavailable && /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("p", { className: "dsmm-hint", children: t("catalogUnavailable") }),
|
|
6218
|
+
state.catalog?.failures.map((failure) => /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("p", { className: "dsmm-hint", children: t("catalogFailure", { name: failure.name, id: failure.id }) }, failure.id)),
|
|
6219
|
+
/* @__PURE__ */ (0, import_jsx_runtime7.jsx)(import_dsh_client_ui_primitives5.Button, { type: "button", variant: "outline", disabled: state.catalogBusy, onClick: () => {
|
|
5609
6220
|
void props.refreshCatalog();
|
|
5610
6221
|
}, children: t(state.catalogBusy ? "catalogRefreshing" : "catalogRefresh") })
|
|
5611
6222
|
] }),
|
|
5612
|
-
/* @__PURE__ */ (0,
|
|
5613
|
-
structuredDoc === null && /* @__PURE__ */ (0,
|
|
5614
|
-
/* @__PURE__ */ (0,
|
|
5615
|
-
/* @__PURE__ */ (0,
|
|
5616
|
-
/* @__PURE__ */ (0,
|
|
5617
|
-
|
|
6223
|
+
/* @__PURE__ */ (0, import_jsx_runtime7.jsxs)("div", { className: "dsmm-basic-settings", "data-dsmm-basic-settings": true, children: [
|
|
6224
|
+
structuredDoc === null && /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)("div", { className: "dsmm-structured-invalid", "data-dsmm-structured-invalid": true, children: [
|
|
6225
|
+
/* @__PURE__ */ (0, import_jsx_runtime7.jsx)("p", { children: t("rawInvalid") }),
|
|
6226
|
+
/* @__PURE__ */ (0, import_jsx_runtime7.jsx)("p", { className: "dsmm-hint", children: t("rawInvalidFormDisabled") }),
|
|
6227
|
+
/* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
|
|
6228
|
+
import_dsh_client_ui_primitives5.Button,
|
|
5618
6229
|
{
|
|
5619
6230
|
type: "button",
|
|
5620
6231
|
variant: "outline",
|
|
@@ -5631,11 +6242,11 @@ function ProfilesSection(props) {
|
|
|
5631
6242
|
}
|
|
5632
6243
|
)
|
|
5633
6244
|
] }),
|
|
5634
|
-
basicDoc !== null && /* @__PURE__ */ (0,
|
|
5635
|
-
/* @__PURE__ */ (0,
|
|
5636
|
-
/* @__PURE__ */ (0,
|
|
5637
|
-
/* @__PURE__ */ (0,
|
|
5638
|
-
|
|
6245
|
+
basicDoc !== null && /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)(import_jsx_runtime7.Fragment, { children: [
|
|
6246
|
+
/* @__PURE__ */ (0, import_jsx_runtime7.jsxs)("div", { className: "dsmm-field", children: [
|
|
6247
|
+
/* @__PURE__ */ (0, import_jsx_runtime7.jsx)("label", { htmlFor: `${prefix}-label`, children: t("profileLabel") }),
|
|
6248
|
+
/* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
|
|
6249
|
+
import_dsh_client_ui_primitives5.Input,
|
|
5639
6250
|
{
|
|
5640
6251
|
ref: labelRef,
|
|
5641
6252
|
id: `${prefix}-label`,
|
|
@@ -5645,8 +6256,8 @@ function ProfilesSection(props) {
|
|
|
5645
6256
|
onChange: (event) => props.editPath(["label"], event.currentTarget.value)
|
|
5646
6257
|
}
|
|
5647
6258
|
),
|
|
5648
|
-
/* @__PURE__ */ (0,
|
|
5649
|
-
|
|
6259
|
+
/* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
|
|
6260
|
+
import_dsh_client_ui_primitives5.Button,
|
|
5650
6261
|
{
|
|
5651
6262
|
type: "button",
|
|
5652
6263
|
variant: "outline",
|
|
@@ -5656,10 +6267,10 @@ function ProfilesSection(props) {
|
|
|
5656
6267
|
}
|
|
5657
6268
|
)
|
|
5658
6269
|
] }),
|
|
5659
|
-
/* @__PURE__ */ (0,
|
|
5660
|
-
/* @__PURE__ */ (0,
|
|
5661
|
-
/* @__PURE__ */ (0,
|
|
5662
|
-
|
|
6270
|
+
/* @__PURE__ */ (0, import_jsx_runtime7.jsxs)("div", { className: "dsmm-field", children: [
|
|
6271
|
+
/* @__PURE__ */ (0, import_jsx_runtime7.jsx)("label", { htmlFor: `${prefix}-id`, children: t("profileId") }),
|
|
6272
|
+
/* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
|
|
6273
|
+
import_dsh_client_ui_primitives5.Input,
|
|
5663
6274
|
{
|
|
5664
6275
|
ref: inputRef,
|
|
5665
6276
|
id: `${prefix}-id`,
|
|
@@ -5671,12 +6282,12 @@ function ProfilesSection(props) {
|
|
|
5671
6282
|
onChange: (event) => props.editId(event.currentTarget.value)
|
|
5672
6283
|
}
|
|
5673
6284
|
),
|
|
5674
|
-
/* @__PURE__ */ (0,
|
|
6285
|
+
/* @__PURE__ */ (0, import_jsx_runtime7.jsx)("p", { id: `${prefix}-id-hint`, className: "dsmm-hint", children: t("idHint") })
|
|
5675
6286
|
] }),
|
|
5676
|
-
/* @__PURE__ */ (0,
|
|
5677
|
-
/* @__PURE__ */ (0,
|
|
5678
|
-
/* @__PURE__ */ (0,
|
|
5679
|
-
/* @__PURE__ */ (0,
|
|
6287
|
+
/* @__PURE__ */ (0, import_jsx_runtime7.jsxs)("div", { ref: orchestratorRef, className: "dsmm-field", id: `${prefix}-orchestrator-primary`, children: [
|
|
6288
|
+
/* @__PURE__ */ (0, import_jsx_runtime7.jsx)("label", { htmlFor: `${prefix}-orch-mode`, children: t("orchestratorModel") }),
|
|
6289
|
+
/* @__PURE__ */ (0, import_jsx_runtime7.jsx)("p", { className: "dsmm-hint", children: t("orchestratorModelDesc") }),
|
|
6290
|
+
/* @__PURE__ */ (0, import_jsx_runtime7.jsxs)(
|
|
5680
6291
|
"select",
|
|
5681
6292
|
{
|
|
5682
6293
|
id: `${prefix}-orch-mode`,
|
|
@@ -5685,13 +6296,13 @@ function ProfilesSection(props) {
|
|
|
5685
6296
|
value: basicDoc.roleRouting["dsmm-orchestrator"]?.primary === void 0 ? "inherit" : "explicit",
|
|
5686
6297
|
onChange: (event) => props.editPath(["settings", "roleRouting", "dsmm-orchestrator", "primary"], event.currentTarget.value === "inherit" ? void 0 : { provider: "", model: "" }),
|
|
5687
6298
|
children: [
|
|
5688
|
-
/* @__PURE__ */ (0,
|
|
5689
|
-
/* @__PURE__ */ (0,
|
|
6299
|
+
/* @__PURE__ */ (0, import_jsx_runtime7.jsx)("option", { value: "inherit", children: t("inheritRoute") }),
|
|
6300
|
+
/* @__PURE__ */ (0, import_jsx_runtime7.jsx)("option", { value: "explicit", children: t("configuredRoute") })
|
|
5690
6301
|
]
|
|
5691
6302
|
}
|
|
5692
6303
|
),
|
|
5693
|
-
!hasOrchestrator && /* @__PURE__ */ (0,
|
|
5694
|
-
basicDoc.roleRouting["dsmm-orchestrator"]?.primary !== void 0 && /* @__PURE__ */ (0,
|
|
6304
|
+
!hasOrchestrator && /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("p", { className: "dsmm-hint", id: `${prefix}-orch-unavailable`, children: t("orchestratorUnavailable") }),
|
|
6305
|
+
basicDoc.roleRouting["dsmm-orchestrator"]?.primary !== void 0 && /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
|
|
5695
6306
|
RouteFields,
|
|
5696
6307
|
{
|
|
5697
6308
|
t,
|
|
@@ -5704,11 +6315,29 @@ function ProfilesSection(props) {
|
|
|
5704
6315
|
editRoute: props.editRoute
|
|
5705
6316
|
}
|
|
5706
6317
|
),
|
|
5707
|
-
/* @__PURE__ */ (0,
|
|
6318
|
+
/* @__PURE__ */ (0, import_jsx_runtime7.jsx)("p", { className: "dsmm-hint", children: t("effortChangeHint") })
|
|
6319
|
+
] }),
|
|
6320
|
+
/* @__PURE__ */ (0, import_jsx_runtime7.jsxs)("div", { className: "dsmm-field dsmm-configure-models-field", children: [
|
|
6321
|
+
/* @__PURE__ */ (0, import_jsx_runtime7.jsx)("label", { children: t("configureAllAgentModels") }),
|
|
6322
|
+
/* @__PURE__ */ (0, import_jsx_runtime7.jsx)("p", { className: "dsmm-hint", children: t("modelsDialogDesc") }),
|
|
6323
|
+
/* @__PURE__ */ (0, import_jsx_runtime7.jsx)("div", { children: /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
|
|
6324
|
+
import_dsh_client_ui_primitives5.Button,
|
|
6325
|
+
{
|
|
6326
|
+
type: "button",
|
|
6327
|
+
variant: "outline",
|
|
6328
|
+
className: "dsmm-open-models-dialog-btn",
|
|
6329
|
+
disabled: editorDisabled || structuredDoc === null,
|
|
6330
|
+
onClick: (event) => {
|
|
6331
|
+
dialogInitiatorRef.current = event.currentTarget;
|
|
6332
|
+
setModelsDialogOpen(true);
|
|
6333
|
+
},
|
|
6334
|
+
children: t("configureAllAgentModels")
|
|
6335
|
+
}
|
|
6336
|
+
) })
|
|
5708
6337
|
] }),
|
|
5709
|
-
/* @__PURE__ */ (0,
|
|
5710
|
-
/* @__PURE__ */ (0,
|
|
5711
|
-
/* @__PURE__ */ (0,
|
|
6338
|
+
/* @__PURE__ */ (0, import_jsx_runtime7.jsxs)("div", { className: "dsmm-field", children: [
|
|
6339
|
+
/* @__PURE__ */ (0, import_jsx_runtime7.jsx)("label", { htmlFor: `${prefix}-locale`, children: t("businessLocale") }),
|
|
6340
|
+
/* @__PURE__ */ (0, import_jsx_runtime7.jsxs)(
|
|
5712
6341
|
"select",
|
|
5713
6342
|
{
|
|
5714
6343
|
id: `${prefix}-locale`,
|
|
@@ -5717,17 +6346,17 @@ function ProfilesSection(props) {
|
|
|
5717
6346
|
"aria-describedby": `${prefix}-locale-hint`,
|
|
5718
6347
|
onChange: (event) => props.editPath(["settings", "locale"], event.currentTarget.value || void 0),
|
|
5719
6348
|
children: [
|
|
5720
|
-
/* @__PURE__ */ (0,
|
|
5721
|
-
typeof basicDoc.settings.locale === "string" && !DSMM_LOCALES.includes(basicDoc.settings.locale) && /* @__PURE__ */ (0,
|
|
5722
|
-
DSMM_LOCALES.map((locale) => /* @__PURE__ */ (0,
|
|
6349
|
+
/* @__PURE__ */ (0, import_jsx_runtime7.jsx)("option", { value: "", children: t("inheritLocale") }),
|
|
6350
|
+
typeof basicDoc.settings.locale === "string" && !DSMM_LOCALES.includes(basicDoc.settings.locale) && /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("option", { value: basicDoc.settings.locale, children: t("unsupportedLocale") }),
|
|
6351
|
+
DSMM_LOCALES.map((locale) => /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("option", { value: locale, children: locale }, locale))
|
|
5723
6352
|
]
|
|
5724
6353
|
}
|
|
5725
6354
|
),
|
|
5726
|
-
/* @__PURE__ */ (0,
|
|
6355
|
+
/* @__PURE__ */ (0, import_jsx_runtime7.jsx)("p", { id: `${prefix}-locale-hint`, className: "dsmm-hint", children: t("localeHint") })
|
|
5727
6356
|
] }),
|
|
5728
|
-
/* @__PURE__ */ (0,
|
|
5729
|
-
/* @__PURE__ */ (0,
|
|
5730
|
-
/* @__PURE__ */ (0,
|
|
6357
|
+
/* @__PURE__ */ (0, import_jsx_runtime7.jsxs)("div", { className: "dsmm-field", children: [
|
|
6358
|
+
/* @__PURE__ */ (0, import_jsx_runtime7.jsx)("label", { htmlFor: `${prefix}-active`, children: t("defaultActive") }),
|
|
6359
|
+
/* @__PURE__ */ (0, import_jsx_runtime7.jsxs)(
|
|
5731
6360
|
"select",
|
|
5732
6361
|
{
|
|
5733
6362
|
id: `${prefix}-active`,
|
|
@@ -5735,17 +6364,17 @@ function ProfilesSection(props) {
|
|
|
5735
6364
|
value: basicDoc.settings.defaultActive === void 0 ? "" : String(basicDoc.settings.defaultActive),
|
|
5736
6365
|
onChange: (event) => props.editPath(["settings", "defaultActive"], event.currentTarget.value === "" ? void 0 : event.currentTarget.value === "true"),
|
|
5737
6366
|
children: [
|
|
5738
|
-
/* @__PURE__ */ (0,
|
|
5739
|
-
/* @__PURE__ */ (0,
|
|
5740
|
-
/* @__PURE__ */ (0,
|
|
6367
|
+
/* @__PURE__ */ (0, import_jsx_runtime7.jsx)("option", { value: "", children: t("inherit") }),
|
|
6368
|
+
/* @__PURE__ */ (0, import_jsx_runtime7.jsx)("option", { value: "true", children: t("enabled") }),
|
|
6369
|
+
/* @__PURE__ */ (0, import_jsx_runtime7.jsx)("option", { value: "false", children: t("disabled") })
|
|
5741
6370
|
]
|
|
5742
6371
|
}
|
|
5743
6372
|
),
|
|
5744
|
-
/* @__PURE__ */ (0,
|
|
6373
|
+
/* @__PURE__ */ (0, import_jsx_runtime7.jsx)("p", { className: "dsmm-hint", children: t("activeHint") })
|
|
5745
6374
|
] })
|
|
5746
6375
|
] })
|
|
5747
6376
|
] }, `basic:${state.editorEpoch}`),
|
|
5748
|
-
/* @__PURE__ */ (0,
|
|
6377
|
+
/* @__PURE__ */ (0, import_jsx_runtime7.jsxs)(
|
|
5749
6378
|
"details",
|
|
5750
6379
|
{
|
|
5751
6380
|
ref: advancedSettingsRef,
|
|
@@ -5755,18 +6384,15 @@ function ProfilesSection(props) {
|
|
|
5755
6384
|
advancedOpenRef.current = e.currentTarget.open;
|
|
5756
6385
|
},
|
|
5757
6386
|
children: [
|
|
5758
|
-
/* @__PURE__ */ (0,
|
|
5759
|
-
/* @__PURE__ */ (0,
|
|
6387
|
+
/* @__PURE__ */ (0, import_jsx_runtime7.jsx)("summary", { children: t("advancedSettings") }),
|
|
6388
|
+
/* @__PURE__ */ (0, import_jsx_runtime7.jsx)("div", { children: /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
|
|
5760
6389
|
AdvancedSettings,
|
|
5761
6390
|
{
|
|
5762
6391
|
state,
|
|
5763
6392
|
actions: props,
|
|
5764
6393
|
disabled: editorDisabled,
|
|
5765
|
-
|
|
5766
|
-
|
|
5767
|
-
orchestratorRef.current?.scrollIntoView({ behavior: reducedMotion ? "auto" : "smooth" });
|
|
5768
|
-
orchestratorRef.current?.querySelector("select, input")?.focus();
|
|
5769
|
-
},
|
|
6394
|
+
document: basicDoc,
|
|
6395
|
+
isInvalidProjection: rawInvalid,
|
|
5770
6396
|
t
|
|
5771
6397
|
}
|
|
5772
6398
|
) })
|
|
@@ -5774,7 +6400,7 @@ function ProfilesSection(props) {
|
|
|
5774
6400
|
},
|
|
5775
6401
|
`advanced-settings:${state.editorEpoch}`
|
|
5776
6402
|
),
|
|
5777
|
-
/* @__PURE__ */ (0,
|
|
6403
|
+
/* @__PURE__ */ (0, import_jsx_runtime7.jsxs)(
|
|
5778
6404
|
"details",
|
|
5779
6405
|
{
|
|
5780
6406
|
ref: advancedRef,
|
|
@@ -5784,36 +6410,194 @@ function ProfilesSection(props) {
|
|
|
5784
6410
|
jsoncOpenRef.current = e.currentTarget.open;
|
|
5785
6411
|
},
|
|
5786
6412
|
children: [
|
|
5787
|
-
/* @__PURE__ */ (0,
|
|
5788
|
-
/* @__PURE__ */ (0,
|
|
5789
|
-
/* @__PURE__ */ (0,
|
|
5790
|
-
/* @__PURE__ */ (0,
|
|
5791
|
-
/* @__PURE__ */ (0,
|
|
5792
|
-
/* @__PURE__ */ (0,
|
|
6413
|
+
/* @__PURE__ */ (0, import_jsx_runtime7.jsx)("summary", { children: t("configuration") }),
|
|
6414
|
+
/* @__PURE__ */ (0, import_jsx_runtime7.jsxs)("div", { className: "dsmm-field", children: [
|
|
6415
|
+
/* @__PURE__ */ (0, import_jsx_runtime7.jsx)("label", { htmlFor: `${prefix}-content`, children: t("configuration") }),
|
|
6416
|
+
/* @__PURE__ */ (0, import_jsx_runtime7.jsx)("textarea", { ref: editorRef, id: `${prefix}-content`, rows: 12, spellCheck: false, value: editor.content, readOnly, disabled: editorDisabled, "aria-invalid": rawInvalid || invalid2 && !idInvalid || void 0, "aria-describedby": `${prefix}-content-hint ${prefix}-structural-hint${invalid2 && !idInvalid ? ` ${prefix}-issue` : ""}`, onChange: (event) => props.editContent(event.currentTarget.value) }),
|
|
6417
|
+
/* @__PURE__ */ (0, import_jsx_runtime7.jsx)("p", { id: `${prefix}-content-hint`, className: "dsmm-hint", children: t("configurationHint") }),
|
|
6418
|
+
/* @__PURE__ */ (0, import_jsx_runtime7.jsx)("p", { id: `${prefix}-structural-hint`, className: "dsmm-hint", children: t("structuralHint") })
|
|
5793
6419
|
] })
|
|
5794
6420
|
]
|
|
5795
6421
|
},
|
|
5796
6422
|
`advanced:${state.editorEpoch}`
|
|
5797
6423
|
),
|
|
5798
|
-
/* @__PURE__ */ (0,
|
|
5799
|
-
|
|
5800
|
-
|
|
5801
|
-
|
|
5802
|
-
|
|
5803
|
-
|
|
5804
|
-
props
|
|
5805
|
-
|
|
5806
|
-
|
|
5807
|
-
|
|
5808
|
-
|
|
5809
|
-
|
|
5810
|
-
|
|
6424
|
+
/* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
|
|
6425
|
+
ProfileModelsDialog,
|
|
6426
|
+
{
|
|
6427
|
+
open: modelsDialogOpen,
|
|
6428
|
+
onClose: () => closeModelsDialog("trigger"),
|
|
6429
|
+
state,
|
|
6430
|
+
actions: props,
|
|
6431
|
+
disabled: editorDisabled,
|
|
6432
|
+
document: basicDoc,
|
|
6433
|
+
isInvalidProjection: rawInvalid,
|
|
6434
|
+
targetRoleId: targetRole,
|
|
6435
|
+
targetField: targetRoleField,
|
|
6436
|
+
onTargetLocated: () => {
|
|
6437
|
+
handledValidation.current = state.validationEpoch;
|
|
6438
|
+
setTargetRole(null);
|
|
6439
|
+
setTargetRoleField(null);
|
|
6440
|
+
},
|
|
6441
|
+
onJumpToJsonc: () => closeModelsDialog("jsonc"),
|
|
6442
|
+
t
|
|
6443
|
+
}
|
|
6444
|
+
),
|
|
6445
|
+
/* @__PURE__ */ (0, import_jsx_runtime7.jsxs)("div", { className: "dsmm-save-bar", children: [
|
|
6446
|
+
(() => {
|
|
6447
|
+
const isSaveLocked = (state.dirty || state.invalidFields.length > 0) && !editorDisabled && snapshot4 !== null && (state.invalidFields.length > 0 || rawInvalid || invalid2);
|
|
6448
|
+
if (!isSaveLocked) return null;
|
|
6449
|
+
return /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)("div", { className: "dsmm-save-lock-reason", role: "status", children: [
|
|
6450
|
+
/* @__PURE__ */ (0, import_jsx_runtime7.jsx)("span", { className: "dsmm-save-lock-text", children: rawInvalid ? t("rawInvalid") : state.invalidFields.length > 0 ? t("saveLockedReason", { count: state.invalidFields.length }) : t("validation") }),
|
|
6451
|
+
/* @__PURE__ */ (0, import_jsx_runtime7.jsxs)("div", { className: "dsmm-save-lock-action", children: [
|
|
6452
|
+
rawInvalid && /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
|
|
6453
|
+
import_dsh_client_ui_primitives5.Button,
|
|
6454
|
+
{
|
|
6455
|
+
type: "button",
|
|
6456
|
+
variant: "outline",
|
|
6457
|
+
size: "sm",
|
|
6458
|
+
onClick: () => {
|
|
6459
|
+
if (advancedRef.current !== null) {
|
|
6460
|
+
advancedRef.current.open = true;
|
|
6461
|
+
jsoncOpenRef.current = true;
|
|
6462
|
+
}
|
|
6463
|
+
const reducedMotion = typeof window !== "undefined" && window.matchMedia("(prefers-reduced-motion: reduce)").matches;
|
|
6464
|
+
editorRef.current?.scrollIntoView({ behavior: reducedMotion ? "auto" : "smooth" });
|
|
6465
|
+
editorRef.current?.focus();
|
|
6466
|
+
},
|
|
6467
|
+
children: t("jumpToJsonc")
|
|
6468
|
+
}
|
|
6469
|
+
),
|
|
6470
|
+
!rawInvalid && state.invalidFields.length > 0 && (() => {
|
|
6471
|
+
const firstInvalid = state.invalidFields[0];
|
|
6472
|
+
const roleMatch = /^(?:settings\.)?(?:roleRouting|roles)\.([a-zA-Z0-9_-]+)(?:\.|$)/.exec(firstInvalid);
|
|
6473
|
+
const roleId2 = roleMatch?.[1];
|
|
6474
|
+
if (roleId2) {
|
|
6475
|
+
return /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)(
|
|
6476
|
+
import_dsh_client_ui_primitives5.Button,
|
|
6477
|
+
{
|
|
6478
|
+
type: "button",
|
|
6479
|
+
variant: "outline",
|
|
6480
|
+
size: "sm",
|
|
6481
|
+
onClick: (e) => {
|
|
6482
|
+
dialogInitiatorRef.current = e.currentTarget;
|
|
6483
|
+
setTargetRole(roleId2);
|
|
6484
|
+
setTargetRoleField(firstInvalid);
|
|
6485
|
+
setModelsDialogOpen(true);
|
|
6486
|
+
},
|
|
6487
|
+
children: [
|
|
6488
|
+
t("jumpToField"),
|
|
6489
|
+
": ",
|
|
6490
|
+
firstInvalid
|
|
6491
|
+
]
|
|
6492
|
+
}
|
|
6493
|
+
);
|
|
6494
|
+
}
|
|
6495
|
+
return /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)(
|
|
6496
|
+
import_dsh_client_ui_primitives5.Button,
|
|
6497
|
+
{
|
|
6498
|
+
type: "button",
|
|
6499
|
+
variant: "outline",
|
|
6500
|
+
size: "sm",
|
|
6501
|
+
onClick: () => {
|
|
6502
|
+
if (!focusGlobalField(firstInvalid)) focusJsonc(state.issue?.location);
|
|
6503
|
+
},
|
|
6504
|
+
children: [
|
|
6505
|
+
t("jumpToField"),
|
|
6506
|
+
": ",
|
|
6507
|
+
firstInvalid
|
|
6508
|
+
]
|
|
6509
|
+
}
|
|
6510
|
+
);
|
|
6511
|
+
})(),
|
|
6512
|
+
!rawInvalid && state.invalidFields.length === 0 && invalid2 && (() => {
|
|
6513
|
+
if (state.issue?.field === "id" || state.issue?.field === "newId") {
|
|
6514
|
+
return /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)(
|
|
6515
|
+
import_dsh_client_ui_primitives5.Button,
|
|
6516
|
+
{
|
|
6517
|
+
type: "button",
|
|
6518
|
+
variant: "outline",
|
|
6519
|
+
size: "sm",
|
|
6520
|
+
onClick: () => {
|
|
6521
|
+
const reducedMotion = typeof window !== "undefined" && window.matchMedia("(prefers-reduced-motion: reduce)").matches;
|
|
6522
|
+
inputRef.current?.scrollIntoView({ behavior: reducedMotion ? "auto" : "smooth" });
|
|
6523
|
+
inputRef.current?.focus();
|
|
6524
|
+
},
|
|
6525
|
+
children: [
|
|
6526
|
+
t("jumpToField"),
|
|
6527
|
+
": ID"
|
|
6528
|
+
]
|
|
6529
|
+
}
|
|
6530
|
+
);
|
|
6531
|
+
}
|
|
6532
|
+
const roleMatch = /^(?:settings\.)?(?:roleRouting|roles)\.([a-zA-Z0-9_-]+)(?:\.|$)/.exec(state.issue?.field ?? "");
|
|
6533
|
+
const roleId2 = roleMatch?.[1];
|
|
6534
|
+
if (roleId2 && snapshot4?.roles?.some((r) => r.id === roleId2)) {
|
|
6535
|
+
return /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)(
|
|
6536
|
+
import_dsh_client_ui_primitives5.Button,
|
|
6537
|
+
{
|
|
6538
|
+
type: "button",
|
|
6539
|
+
variant: "outline",
|
|
6540
|
+
size: "sm",
|
|
6541
|
+
onClick: (e) => {
|
|
6542
|
+
dialogInitiatorRef.current = e.currentTarget;
|
|
6543
|
+
setTargetRole(roleId2);
|
|
6544
|
+
setTargetRoleField(state.issue?.field ?? null);
|
|
6545
|
+
setModelsDialogOpen(true);
|
|
6546
|
+
},
|
|
6547
|
+
children: [
|
|
6548
|
+
t("jumpToRole"),
|
|
6549
|
+
": ",
|
|
6550
|
+
roleId2
|
|
6551
|
+
]
|
|
6552
|
+
}
|
|
6553
|
+
);
|
|
6554
|
+
}
|
|
6555
|
+
return /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
|
|
6556
|
+
import_dsh_client_ui_primitives5.Button,
|
|
6557
|
+
{
|
|
6558
|
+
type: "button",
|
|
6559
|
+
variant: "outline",
|
|
6560
|
+
size: "sm",
|
|
6561
|
+
onClick: () => {
|
|
6562
|
+
if (advancedRef.current !== null) {
|
|
6563
|
+
advancedRef.current.open = true;
|
|
6564
|
+
jsoncOpenRef.current = true;
|
|
6565
|
+
}
|
|
6566
|
+
const reducedMotion = typeof window !== "undefined" && window.matchMedia("(prefers-reduced-motion: reduce)").matches;
|
|
6567
|
+
editorRef.current?.scrollIntoView({ behavior: reducedMotion ? "auto" : "smooth" });
|
|
6568
|
+
editorRef.current?.focus();
|
|
6569
|
+
const location = state.issue?.location;
|
|
6570
|
+
if (location !== void 0 && editorRef.current && location.offset + location.length <= editorRef.current.value.length) {
|
|
6571
|
+
editorRef.current.setSelectionRange(location.offset, location.offset + location.length);
|
|
6572
|
+
}
|
|
6573
|
+
},
|
|
6574
|
+
children: t("jumpToJsonc")
|
|
6575
|
+
}
|
|
6576
|
+
);
|
|
6577
|
+
})()
|
|
6578
|
+
] })
|
|
6579
|
+
] });
|
|
6580
|
+
})(),
|
|
6581
|
+
/* @__PURE__ */ (0, import_jsx_runtime7.jsxs)("div", { className: "dsmm-actions", children: [
|
|
6582
|
+
/* @__PURE__ */ (0, import_jsx_runtime7.jsx)(import_dsh_client_ui_primitives5.Button, { type: "button", variant: "primary", disabled: editorDisabled || !state.dirty || snapshot4 === null || state.invalidFields.length > 0 || rawInvalid, onClick: () => {
|
|
6583
|
+
void props.save();
|
|
6584
|
+
}, children: t(state.busy === "save" ? "saving" : "save") }),
|
|
6585
|
+
/* @__PURE__ */ (0, import_jsx_runtime7.jsx)(import_dsh_client_ui_primitives5.Button, { type: "button", variant: "outline", disabled: editorDisabled || !state.dirty && state.invalidFields.length === 0, onClick: (event) => {
|
|
6586
|
+
initiatorRef.current = event.currentTarget;
|
|
6587
|
+
props.discard();
|
|
6588
|
+
}, children: t("discard") }),
|
|
6589
|
+
editor.revision !== null && !state.dirty && /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(import_dsh_client_ui_primitives5.Button, { type: "button", variant: "outline", disabled, onClick: (event) => {
|
|
6590
|
+
initiatorRef.current = event.currentTarget;
|
|
6591
|
+
void props.reload();
|
|
6592
|
+
}, children: t("reload") })
|
|
6593
|
+
] })
|
|
6594
|
+
] })
|
|
5811
6595
|
] }),
|
|
5812
|
-
state.issue !== null && /* @__PURE__ */ (0,
|
|
5813
|
-
/* @__PURE__ */ (0,
|
|
5814
|
-
/* @__PURE__ */ (0,
|
|
6596
|
+
state.issue !== null && !modelsDialogOpen && /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)("div", { className: "dsmm-issue", id: `${prefix}-issue`, role: "alert", children: [
|
|
6597
|
+
/* @__PURE__ */ (0, import_jsx_runtime7.jsx)("p", { children: t(issueKey(state.issue)) }),
|
|
6598
|
+
/* @__PURE__ */ (0, import_jsx_runtime7.jsx)(IssueDetails, { issue: state.issue, t })
|
|
5815
6599
|
] }),
|
|
5816
|
-
/* @__PURE__ */ (0,
|
|
6600
|
+
/* @__PURE__ */ (0, import_jsx_runtime7.jsx)("p", { className: "dsmm-status", role: "status", "aria-live": "polite", "aria-atomic": "true", children: state.busy === "refresh" && snapshot4 === null ? t("loading") : state.busy === "read" ? t("reading") : notice })
|
|
5817
6601
|
] });
|
|
5818
6602
|
}
|
|
5819
6603
|
|
|
@@ -5822,14 +6606,14 @@ var PROFILE_STYLES = `
|
|
|
5822
6606
|
.dsmm-profiles{width:100%;max-width:760px;min-width:0;display:flex;flex-direction:column;gap:12px;font-family:var(--dsw-font-family);font-size:14px;line-height:22px;color:var(--dsw-alias-label-primary)}
|
|
5823
6607
|
.dsmm-profiles h2{margin:0;font-size:18px;font-weight:600}
|
|
5824
6608
|
.dsmm-profiles h3,.dsmm-profiles legend{margin:0;font-size:14px;font-weight:500;line-height:22px}
|
|
5825
|
-
.dsmm-profiles :is(label,legend,summary){min-width:0;max-width:100%;overflow-wrap:anywhere}
|
|
6609
|
+
:is(.dsmm-profiles, .dsmm-profile-models-dialog) :is(label,legend,summary){min-width:0;max-width:100%;overflow-wrap:anywhere}
|
|
5826
6610
|
.dsmm-profiles :is(.dsmm-structured,.dsmm-session-scope,.dsmm-catalog,.dsmm-policy-fields){min-width:0;display:flex;flex-direction:column;gap:12px}
|
|
5827
|
-
.dsmm-profiles fieldset{min-width:0;margin:0;padding:12px;border:1px solid var(--dsw-alias-border-l4);border-radius:var(--dsw-radius-md);display:flex;flex-direction:column;gap:12px}
|
|
5828
|
-
.dsmm-profiles .dsmm-route-fields{display:flex;flex-wrap:wrap;gap:12px;min-width:0}
|
|
5829
|
-
.dsmm-profiles .dsmm-route-fields>.dsmm-field{flex:1 1 240px;max-width:100%}
|
|
5830
|
-
.dsmm-profiles .dsmm-route-fields select{width:100%}
|
|
5831
|
-
.dsmm-profiles summary{cursor:pointer;color:var(--dsw-alias-label-primary);min-height:32px;line-height:32px}
|
|
5832
|
-
.dsmm-profiles summary:focus-visible{outline:var(--dsw-focus-ring-width,2px) solid var(--dsw-focus-ring-color,var(--dsw-alias-state-business-primary));outline-offset:2px}
|
|
6611
|
+
:is(.dsmm-profiles, .dsmm-profile-models-dialog) fieldset{min-width:0;margin:0;padding:12px;border:1px solid var(--dsw-alias-border-l4);border-radius:var(--dsw-radius-md);display:flex;flex-direction:column;gap:12px}
|
|
6612
|
+
:is(.dsmm-profiles, .dsmm-profile-models-dialog) .dsmm-route-fields{display:flex;flex-wrap:wrap;gap:12px;min-width:0}
|
|
6613
|
+
:is(.dsmm-profiles, .dsmm-profile-models-dialog) .dsmm-route-fields>.dsmm-field{flex:1 1 240px;max-width:100%}
|
|
6614
|
+
:is(.dsmm-profiles, .dsmm-profile-models-dialog) .dsmm-route-fields select{width:100%}
|
|
6615
|
+
:is(.dsmm-profiles, .dsmm-profile-models-dialog) summary{cursor:pointer;color:var(--dsw-alias-label-primary);min-height:32px;line-height:32px}
|
|
6616
|
+
:is(.dsmm-profiles, .dsmm-profile-models-dialog) summary:focus-visible{outline:var(--dsw-focus-ring-width,2px) solid var(--dsw-focus-ring-color,var(--dsw-alias-state-business-primary));outline-offset:2px}
|
|
5833
6617
|
.dsmm-profiles .dsmm-advanced[open]>div{margin-top:8px}
|
|
5834
6618
|
.dsmm-header-profiles{display:inline-flex;align-items:center;min-width:0;font-family:var(--dsw-font-family);color:var(--dsw-alias-label-primary)}
|
|
5835
6619
|
.dsmm-header-profiles .dsmm-profile-trigger{width:28px;height:28px;min-height:28px;padding:6px;justify-content:center}
|
|
@@ -5839,30 +6623,30 @@ var PROFILE_STYLES = `
|
|
|
5839
6623
|
.dsmm-profile-menu [role=menuitem]{font:inherit}
|
|
5840
6624
|
.dsmm-profile-menu [role=menuitem]>span{white-space:normal;overflow-wrap:anywhere}
|
|
5841
6625
|
.dsmm-profile-announcement{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip-path:inset(50%);white-space:nowrap;border:0}
|
|
5842
|
-
.dsmm-profiles p{margin:0;overflow-wrap:anywhere}
|
|
5843
|
-
.dsmm-profiles .dsmm-hint{color:var(--dsw-alias-label-secondary)}
|
|
5844
|
-
.dsmm-profiles .dsmm-field{min-width:0;display:flex;flex-direction:column;gap:6px}
|
|
5845
|
-
.dsmm-profiles .dsmm-actions{display:flex;flex-wrap:wrap;align-items:center;gap:8px}
|
|
5846
|
-
.dsmm-profiles button{max-width:100%;white-space:normal;overflow-wrap:anywhere;min-height:36px;height:auto}
|
|
5847
|
-
.dsmm-profiles .dsmm-input{width:100%;min-width:0;box-sizing:border-box;border-color:var(--dsw-alias-label-secondary)}
|
|
5848
|
-
.dsmm-profiles .dsmm-input input{width:100%;min-width:0;font:inherit;color:inherit}
|
|
5849
|
-
.dsmm-profiles .dsmm-choice{position:relative;min-width:0}
|
|
5850
|
-
.dsmm-profiles .dsmm-choice .dsmm-input input{padding-right:32px}
|
|
5851
|
-
.dsmm-profiles .dsmm-choice .dsmm-choice-toggle{position:absolute;right:4px;top:50%;transform:translateY(-50%);width:28px;height:28px;min-height:28px;padding:4px}
|
|
5852
|
-
.dsmm-profiles .dsmm-choice-list{position:absolute;z-index:1;top:100%;left:0;right:0;max-height:240px;overflow-y:auto;list-style:none;margin:4px 0 0;padding:4px;border:1px solid var(--dsw-alias-border-l4);border-radius:var(--dsw-radius-md);background:var(--dsw-alias-bg-layer-1);color:var(--dsw-alias-label-primary)}
|
|
5853
|
-
.dsmm-profiles .dsmm-choice-list [role=option]{padding:8px 10px;min-width:0;overflow-wrap:anywhere;cursor:pointer}
|
|
5854
|
-
.dsmm-profiles .dsmm-choice-list [role=option]:hover{background:var(--dsw-alias-interactive-bg-hover)}
|
|
5855
|
-
.dsmm-profiles .dsmm-choice-list [aria-selected=true]{background:var(--dsw-alias-interactive-bg-active);outline:var(--dsw-focus-ring-width,2px) solid var(--dsw-focus-ring-color,var(--dsw-alias-state-business-primary));outline-offset:-2px}
|
|
5856
|
-
.dsmm-profiles select
|
|
5857
|
-
.dsmm-profiles select{width:240px;height:32px;padding:0 10px;text-overflow:ellipsis}
|
|
5858
|
-
.dsmm-profiles textarea{width:100%;padding:12px;font-family:var(--ds-font-family-code);resize:vertical;overflow:auto;white-space:pre;}
|
|
5859
|
-
.dsmm-profiles select:hover:not(:disabled)
|
|
5860
|
-
.dsmm-profiles select:active:not(:disabled){background:var(--dsw-alias-interactive-bg-active)}
|
|
5861
|
-
.dsmm-profiles :is(select,textarea,button):focus-visible
|
|
5862
|
-
.dsmm-profiles input[type=checkbox]:focus-visible{outline:var(--dsw-focus-ring-width,2px) solid var(--dsw-focus-ring-color,var(--dsw-alias-state-business-primary));outline-offset:2px}
|
|
6626
|
+
:is(.dsmm-profiles, .dsmm-profile-models-dialog) p{margin:0;overflow-wrap:anywhere}
|
|
6627
|
+
:is(.dsmm-profiles, .dsmm-profile-models-dialog) .dsmm-hint{color:var(--dsw-alias-label-secondary)}
|
|
6628
|
+
:is(.dsmm-profiles, .dsmm-profile-models-dialog) .dsmm-field{min-width:0;display:flex;flex-direction:column;gap:6px}
|
|
6629
|
+
:is(.dsmm-profiles, .dsmm-profile-models-dialog) .dsmm-actions{display:flex;flex-wrap:wrap;align-items:center;gap:8px}
|
|
6630
|
+
:is(.dsmm-profiles, .dsmm-profile-models-dialog) button{max-width:100%;white-space:normal;overflow-wrap:anywhere;min-height:36px;height:auto}
|
|
6631
|
+
:is(.dsmm-profiles, .dsmm-profile-models-dialog) .dsmm-input{width:100%;min-width:0;box-sizing:border-box;border-color:var(--dsw-alias-label-secondary)}
|
|
6632
|
+
:is(.dsmm-profiles, .dsmm-profile-models-dialog) .dsmm-input input{width:100%;min-width:0;font:inherit;color:inherit}
|
|
6633
|
+
:is(.dsmm-profiles, .dsmm-profile-models-dialog) .dsmm-choice{position:relative;min-width:0}
|
|
6634
|
+
:is(.dsmm-profiles, .dsmm-profile-models-dialog) .dsmm-choice .dsmm-input input{padding-right:32px}
|
|
6635
|
+
:is(.dsmm-profiles, .dsmm-profile-models-dialog) .dsmm-choice .dsmm-choice-toggle{position:absolute;right:4px;top:50%;transform:translateY(-50%);width:28px;height:28px;min-height:28px;padding:4px}
|
|
6636
|
+
:is(.dsmm-profiles, .dsmm-profile-models-dialog) .dsmm-choice-list{position:absolute;z-index:1;top:100%;left:0;right:0;max-height:240px;overflow-y:auto;list-style:none;margin:4px 0 0;padding:4px;border:1px solid var(--dsw-alias-border-l4);border-radius:var(--dsw-radius-md);background:var(--dsw-alias-bg-layer-1);color:var(--dsw-alias-label-primary)}
|
|
6637
|
+
:is(.dsmm-profiles, .dsmm-profile-models-dialog) .dsmm-choice-list [role=option]{padding:8px 10px;min-width:0;overflow-wrap:anywhere;cursor:pointer}
|
|
6638
|
+
:is(.dsmm-profiles, .dsmm-profile-models-dialog) .dsmm-choice-list [role=option]:hover{background:var(--dsw-alias-interactive-bg-hover)}
|
|
6639
|
+
:is(.dsmm-profiles, .dsmm-profile-models-dialog) .dsmm-choice-list [aria-selected=true]{background:var(--dsw-alias-interactive-bg-active);outline:var(--dsw-focus-ring-width,2px) solid var(--dsw-focus-ring-color,var(--dsw-alias-state-business-primary));outline-offset:-2px}
|
|
6640
|
+
:is(.dsmm-profiles, .dsmm-profile-models-dialog) select,:is(.dsmm-profiles, .dsmm-profile-models-dialog) textarea{box-sizing:border-box;min-width:0;max-width:100%;font:inherit;color:var(--dsw-alias-label-primary);background:var(--dsw-alias-bg-layer-1);border:1px solid var(--dsw-alias-label-secondary);border-radius:var(--dsw-radius-md)}
|
|
6641
|
+
:is(.dsmm-profiles, .dsmm-profile-models-dialog) select{width:240px;height:32px;padding:0 10px;text-overflow:ellipsis}
|
|
6642
|
+
:is(.dsmm-profiles, .dsmm-profile-models-dialog) textarea{width:100%;padding:12px;font-family:var(--ds-font-family-code);resize:vertical;overflow:auto;white-space:pre;}
|
|
6643
|
+
:is(.dsmm-profiles, .dsmm-profile-models-dialog) select:hover:not(:disabled),:is(.dsmm-profiles, .dsmm-profile-models-dialog) textarea:hover:not(:disabled){border-color:var(--dsw-alias-label-primary)}
|
|
6644
|
+
:is(.dsmm-profiles, .dsmm-profile-models-dialog) select:active:not(:disabled){background:var(--dsw-alias-interactive-bg-active)}
|
|
6645
|
+
:is(.dsmm-profiles, .dsmm-profile-models-dialog) :is(select,textarea,button):focus-visible,:is(.dsmm-profiles, .dsmm-profile-models-dialog) .dsmm-input:has(input:focus-visible){outline:var(--dsw-focus-ring-width,2px) solid var(--dsw-focus-ring-color,var(--dsw-alias-state-business-primary));outline-offset:2px}
|
|
6646
|
+
:is(.dsmm-profiles, .dsmm-profile-models-dialog) input[type=checkbox]:focus-visible{outline:var(--dsw-focus-ring-width,2px) solid var(--dsw-focus-ring-color,var(--dsw-alias-state-business-primary));outline-offset:2px}
|
|
5863
6647
|
.dsmm-permissions label.dsmm-actions{min-height:32px}
|
|
5864
6648
|
.dsmm-permissions input[type=checkbox]{accent-color:var(--dsw-alias-state-business-primary)}
|
|
5865
|
-
.dsmm-profiles :is(select,textarea):disabled{color:var(--dsw-alias-label-secondary);background:var(--dsw-alias-bg-module-platform);cursor:not-allowed}
|
|
6649
|
+
:is(.dsmm-profiles, .dsmm-profile-models-dialog) :is(select,textarea):disabled{color:var(--dsw-alias-label-secondary);background:var(--dsw-alias-bg-module-platform);cursor:not-allowed}
|
|
5866
6650
|
.dsmm-profiles .dsmm-editor,.dsmm-profiles .dsmm-confirm{min-width:0;display:flex;flex-direction:column;gap:12px;padding:16px;border:1px solid var(--dsw-alias-border-l4);border-radius:var(--dsw-radius-md);background:var(--dsw-alias-bg-module-platform)}
|
|
5867
6651
|
.dsmm-profiles .dsmm-issue{padding:12px;border-left:4px solid var(--dsw-alias-state-error-primary);color:var(--dsw-alias-label-primary);overflow-wrap:anywhere}
|
|
5868
6652
|
.dsmm-profiles .dsmm-issue p+p{margin-top:8px}
|
|
@@ -5928,10 +6712,69 @@ var PROFILE_STYLES = `
|
|
|
5928
6712
|
.dsmm-named-profiles .dsmm-advanced-settings>summary{font-weight:500}
|
|
5929
6713
|
.dsmm-named-profiles .dsmm-advanced-settings>div{margin-top:12px;display:flex;flex-direction:column;gap:12px}
|
|
5930
6714
|
.dsmm-named-profiles .dsmm-save-bar{display:flex;flex-direction:column;gap:8px;padding-top:12px;border-top:1px solid var(--dsw-alias-border-l4)}
|
|
6715
|
+
.dsmm-named-profiles .dsmm-save-lock-reason{display:flex;flex-wrap:wrap;align-items:center;justify-content:space-between;gap:8px;padding:8px 12px;border:1px solid var(--dsw-alias-state-warn-primary);border-radius:var(--dsw-radius-md);background:var(--dsw-alias-bg-module-platform)}
|
|
6716
|
+
.dsmm-named-profiles .dsmm-save-lock-text{font-weight:500;color:var(--dsw-alias-state-warn-primary)}
|
|
6717
|
+
.dsmm-named-profiles .dsmm-save-lock-action{display:flex;align-items:center;gap:8px}
|
|
5931
6718
|
.dsmm-named-profiles .dsmm-orchestrator-primary{background:var(--dsw-alias-bg-layer-1)}
|
|
5932
6719
|
.dsmm-named-profiles .dsmm-git-guard{background:var(--dsw-alias-bg-layer-1)}
|
|
5933
6720
|
.dsmm-named-profiles .dsmm-structured-invalid{display:flex;flex-direction:column;gap:8px;padding:12px;border:1px solid var(--dsw-alias-state-error-primary);border-radius:var(--dsw-radius-md);background:var(--dsw-alias-bg-module-platform)}
|
|
5934
|
-
|
|
6721
|
+
|
|
6722
|
+
.dsmm-profile-models-dialog.dialog,
|
|
6723
|
+
.dsmm-profile-models-dialog{width:min(1040px, calc(100vw - 32px))!important;max-width:1040px!important;max-height:calc(100vh - 48px)!important;display:flex!important;flex-direction:column!important;overflow:hidden!important;box-sizing:border-box;font-family:var(--dsw-font-family);font-size:14px;line-height:22px;color:var(--dsw-alias-label-primary)}
|
|
6724
|
+
.dsmm-profile-models-dialog-content,
|
|
6725
|
+
.dsmm-models-dialog-content,
|
|
6726
|
+
.dsmm-profile-models-dialog .dsmm-profile-models-dialog-content{overflow-y:auto!important;overflow-x:hidden;display:flex;flex-direction:column;gap:12px;padding:4px 0 16px;min-height:0;flex:1 1 auto}
|
|
6727
|
+
.dsmm-models-filter-bar,
|
|
6728
|
+
.dsmm-dialog-filter-bar,
|
|
6729
|
+
.dsmm-profile-models-dialog .dsmm-filter-bar{display:flex;flex-wrap:wrap;align-items:center;gap:12px;padding-bottom:12px;border-bottom:1px solid var(--dsw-alias-border-l4);flex-shrink:0}
|
|
6730
|
+
.dsmm-models-filter-bar .dsmm-search-input,
|
|
6731
|
+
.dsmm-filter-search{flex:1 1 240px;min-width:0}
|
|
6732
|
+
.dsmm-filter-label,
|
|
6733
|
+
.dsmm-filter-override-toggle{display:inline-flex;align-items:center;gap:6px;cursor:pointer;font-size:13px;user-select:none;color:var(--dsw-alias-label-primary)}
|
|
6734
|
+
.dsmm-dialog-issue{margin-bottom:8px;padding:8px 12px;border:1px solid var(--dsw-alias-state-error-primary);border-radius:var(--dsw-radius-md);background:var(--dsw-alias-bg-module-platform);display:flex;flex-direction:column;gap:6px}
|
|
6735
|
+
.dsmm-dialog-issue-title{font-weight:600;color:var(--dsw-alias-state-error-primary);margin:0}
|
|
6736
|
+
.dsmm-dialog-issue-action{display:flex;justify-content:flex-end;margin-top:4px}
|
|
6737
|
+
.dsmm-profile-models-dialog .dsmm-roles-list,
|
|
6738
|
+
.dsmm-profile-models-dialog .dsmm-dialog-roles-list{display:flex;flex-direction:column;gap:8px;min-width:0}
|
|
6739
|
+
.dsmm-profile-models-dialog .dsmm-dialog-role-card{display:flex;flex-direction:column;gap:6px;padding:8px 12px;border:1px solid var(--dsw-alias-border-l4);border-radius:var(--dsw-radius-md);background:var(--dsw-alias-bg-module-platform);min-width:0}
|
|
6740
|
+
.dsmm-profile-models-dialog .dsmm-role-main-row{display:flex;flex-wrap:wrap;align-items:flex-end;justify-content:space-between;gap:8px 12px;min-width:0}
|
|
6741
|
+
.dsmm-profile-models-dialog .dsmm-dialog-role-header{display:flex;align-items:center;min-width:140px;flex:0 0 auto}
|
|
6742
|
+
.dsmm-profile-models-dialog .dsmm-role-title-group{display:flex;align-items:center;flex-wrap:wrap;gap:6px;min-width:0}
|
|
6743
|
+
.dsmm-profile-models-dialog .dsmm-role-title{font-size:14px;font-weight:600;color:var(--dsw-alias-label-primary)}
|
|
6744
|
+
.dsmm-profile-models-dialog .dsmm-role-id-badge{font-family:var(--ds-font-family-code);font-size:11px;padding:1px 4px;border-radius:var(--dsw-radius-xs,2px);background:var(--dsw-alias-bg-layer-1);color:var(--dsw-alias-label-secondary);white-space:nowrap}
|
|
6745
|
+
.dsmm-profile-models-dialog .dsmm-override-badge{font-size:11px;padding:1px 6px;border-radius:var(--dsw-radius-md);background:var(--dsw-alias-interactive-bg-active);color:var(--dsw-alias-state-business-primary);border:1px solid var(--dsw-alias-state-business-primary);white-space:nowrap}
|
|
6746
|
+
.dsmm-profile-models-dialog .dsmm-role-primary-route{display:flex;flex-wrap:wrap;align-items:flex-end;gap:8px 12px;flex:1 1 auto;justify-content:flex-end;min-width:0}
|
|
6747
|
+
.dsmm-profile-models-dialog .dsmm-role-primary-route .dsmm-primary-mode-field{flex:0 0 auto;min-width:110px}
|
|
6748
|
+
.dsmm-profile-models-dialog .dsmm-role-primary-route .dsmm-primary-mode-field select{width:auto;min-width:110px;height:32px}
|
|
6749
|
+
.dsmm-profile-models-dialog .dsmm-role-primary-route .dsmm-route-fields{display:flex;flex-wrap:nowrap;align-items:flex-end;gap:8px;flex:0 1 auto;min-width:0}
|
|
6750
|
+
.dsmm-profile-models-dialog .dsmm-role-primary-route .dsmm-route-fields>.dsmm-field{flex:0 1 auto;min-width:100px;max-width:200px;gap:2px}
|
|
6751
|
+
.dsmm-profile-models-dialog .dsmm-role-primary-route .dsmm-route-fields select{width:100%;height:32px}
|
|
6752
|
+
.dsmm-profile-models-dialog .dsmm-role-primary-route .dsmm-route-fields .dsmm-input{height:32px}
|
|
6753
|
+
.dsmm-profile-models-dialog .dsmm-route-inherited-hint{font-size:12px;color:var(--dsw-alias-label-secondary);padding:6px 0;line-height:20px}
|
|
6754
|
+
.dsmm-profile-models-dialog .dsmm-orchestrator-tag{font-size:12px;color:var(--dsw-alias-label-secondary);padding:6px 0;line-height:20px}
|
|
6755
|
+
.dsmm-profile-models-dialog .dsmm-role-details-bar{display:flex;flex-wrap:wrap;align-items:center;gap:6px 8px;min-width:0;padding-top:4px;border-top:1px dashed var(--dsw-alias-border-l4)}
|
|
6756
|
+
.dsmm-profile-models-dialog .dsmm-compact-details{display:inline-block;min-width:0}
|
|
6757
|
+
.dsmm-profile-models-dialog .dsmm-compact-details[open]{flex:1 1 100%;width:100%}
|
|
6758
|
+
.dsmm-profile-models-dialog .dsmm-details-pill{display:inline-flex;align-items:center;gap:4px;padding:2px 8px;border-radius:var(--dsw-radius-md);background:var(--dsw-alias-bg-layer-1);border:1px solid var(--dsw-alias-border-l4);font-size:12px;line-height:20px;min-height:24px;cursor:pointer;color:var(--dsw-alias-label-primary);user-select:none}
|
|
6759
|
+
.dsmm-profile-models-dialog .dsmm-compact-details[open]>.dsmm-details-pill{background:var(--dsw-alias-interactive-bg-hover);border-color:var(--dsw-alias-state-business-primary);font-weight:500}
|
|
6760
|
+
.dsmm-profile-models-dialog .dsmm-pill-label{color:var(--dsw-alias-label-secondary)}
|
|
6761
|
+
.dsmm-profile-models-dialog .dsmm-pill-val{color:var(--dsw-alias-label-primary)}
|
|
6762
|
+
.dsmm-profile-models-dialog .dsmm-compact-details .dsmm-details-content{margin-top:8px;padding:10px 12px;border:1px solid var(--dsw-alias-border-l4);border-radius:var(--dsw-radius-md);background:var(--dsw-alias-bg-layer-1);display:flex;flex-direction:column;gap:10px;min-width:0}
|
|
6763
|
+
.dsmm-profile-models-dialog .dsmm-fallback-item{display:flex;flex-direction:column;gap:8px;padding:10px;border:1px solid var(--dsw-alias-border-l4);border-radius:var(--dsw-radius-md);background:var(--dsw-alias-bg-module-platform);min-width:0}
|
|
6764
|
+
.dsmm-models-dialog-footer{display:flex;justify-content:flex-end;gap:8px;padding-top:12px;border-top:1px solid var(--dsw-alias-border-l4)}
|
|
6765
|
+
|
|
6766
|
+
@media(max-width:768px){
|
|
6767
|
+
.dsmm-profile-models-dialog{width:calc(100vw - 16px)!important;max-height:calc(100vh - 16px)}
|
|
6768
|
+
.dsmm-profile-models-dialog .dsmm-dialog-role-card{padding:10px}
|
|
6769
|
+
.dsmm-profile-models-dialog .dsmm-role-main-row{flex-direction:column;align-items:stretch;gap:8px}
|
|
6770
|
+
.dsmm-profile-models-dialog .dsmm-role-primary-route{flex-direction:column;align-items:stretch;gap:8px}
|
|
6771
|
+
.dsmm-profile-models-dialog .dsmm-role-primary-route .dsmm-route-fields{flex-wrap:wrap}
|
|
6772
|
+
.dsmm-profile-models-dialog .dsmm-role-primary-route .dsmm-route-fields>.dsmm-field{flex:1 1 100%;max-width:100%}
|
|
6773
|
+
.dsmm-profile-models-dialog .dsmm-role-details-bar{flex-direction:column;align-items:stretch}
|
|
6774
|
+
.dsmm-profile-models-dialog .dsmm-compact-details{width:100%}
|
|
6775
|
+
.dsmm-profile-models-dialog .dsmm-details-pill{width:100%;box-sizing:border-box;justify-content:space-between}
|
|
6776
|
+
}
|
|
6777
|
+
@media(prefers-reduced-motion:reduce){:is(.dsmm-profiles, .dsmm-profile-models-dialog) *{transition:none!important;animation:none!important;scroll-behavior:auto!important}}
|
|
5935
6778
|
`;
|
|
5936
6779
|
|
|
5937
6780
|
// src/client/deployment-data.ts
|
|
@@ -6267,8 +7110,8 @@ var DeploymentController = class _DeploymentController {
|
|
|
6267
7110
|
};
|
|
6268
7111
|
|
|
6269
7112
|
// src/client/DeploymentPage.tsx
|
|
6270
|
-
var
|
|
6271
|
-
var
|
|
7113
|
+
var import_react10 = require("react");
|
|
7114
|
+
var import_dsh_client_ui_primitives10 = require("@deepseek-ai/dsh-client-ui-primitives");
|
|
6272
7115
|
|
|
6273
7116
|
// src/client/deployment-modules.ts
|
|
6274
7117
|
var CONFIG_MODULES = ["run", "routes", "workflow", "permissions", "state"];
|
|
@@ -6450,8 +7293,8 @@ function deploymentWorkspace(core, permissions) {
|
|
|
6450
7293
|
}
|
|
6451
7294
|
|
|
6452
7295
|
// src/client/DeploymentFields.tsx
|
|
6453
|
-
var
|
|
6454
|
-
var
|
|
7296
|
+
var import_react8 = require("react");
|
|
7297
|
+
var import_dsh_client_ui_primitives8 = require("@deepseek-ai/dsh-client-ui-primitives");
|
|
6455
7298
|
|
|
6456
7299
|
// src/client/deployment-locales.ts
|
|
6457
7300
|
var DEPLOYMENT_NS = "plugins.dsmm";
|
|
@@ -7047,9 +7890,9 @@ var permissionZh = {
|
|
|
7047
7890
|
};
|
|
7048
7891
|
|
|
7049
7892
|
// src/client/NativeCommandEntries.tsx
|
|
7050
|
-
var
|
|
7051
|
-
var
|
|
7052
|
-
var
|
|
7893
|
+
var import_react6 = require("react");
|
|
7894
|
+
var import_dsh_client_ui_primitives6 = require("@deepseek-ai/dsh-client-ui-primitives");
|
|
7895
|
+
var import_jsx_runtime8 = require("react/jsx-runtime");
|
|
7053
7896
|
var ENTRIES_PATH = "permissionControl.nativeCommands.entries";
|
|
7054
7897
|
function validNativeEntries(entries) {
|
|
7055
7898
|
try {
|
|
@@ -7068,48 +7911,48 @@ function validNativeRule(rule) {
|
|
|
7068
7911
|
}
|
|
7069
7912
|
}
|
|
7070
7913
|
function LegacyEntry({ entry, index, disabled, remove, t }) {
|
|
7071
|
-
return /* @__PURE__ */ (0,
|
|
7072
|
-
/* @__PURE__ */ (0,
|
|
7073
|
-
/* @__PURE__ */ (0,
|
|
7074
|
-
/* @__PURE__ */ (0,
|
|
7075
|
-
/* @__PURE__ */ (0,
|
|
7914
|
+
return /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)("div", { className: "dsmm-field dsmm-command-entry dsmm-legacy-entry", children: [
|
|
7915
|
+
/* @__PURE__ */ (0, import_jsx_runtime8.jsxs)("div", { className: "dsmm-actions", children: [
|
|
7916
|
+
/* @__PURE__ */ (0, import_jsx_runtime8.jsxs)("div", { className: "dsmm-command-summary", children: [
|
|
7917
|
+
/* @__PURE__ */ (0, import_jsx_runtime8.jsx)("span", { className: "dsmm-legacy-badge", children: t("legacyEntry") }),
|
|
7918
|
+
/* @__PURE__ */ (0, import_jsx_runtime8.jsx)("code", { children: entry.match.commandPattern || entry.id })
|
|
7076
7919
|
] }),
|
|
7077
|
-
/* @__PURE__ */ (0,
|
|
7920
|
+
/* @__PURE__ */ (0, import_jsx_runtime8.jsxs)(import_dsh_client_ui_primitives6.Button, { type: "button", variant: "outline", disabled, onClick: remove, children: [
|
|
7078
7921
|
t("removeEntry"),
|
|
7079
7922
|
" ",
|
|
7080
7923
|
index + 1
|
|
7081
7924
|
] })
|
|
7082
7925
|
] }),
|
|
7083
|
-
/* @__PURE__ */ (0,
|
|
7084
|
-
/* @__PURE__ */ (0,
|
|
7926
|
+
/* @__PURE__ */ (0, import_jsx_runtime8.jsxs)("details", { className: "dsmm-legacy-details", children: [
|
|
7927
|
+
/* @__PURE__ */ (0, import_jsx_runtime8.jsxs)("summary", { children: [
|
|
7085
7928
|
t("legacyDetails"),
|
|
7086
7929
|
": ",
|
|
7087
7930
|
entry.id
|
|
7088
7931
|
] }),
|
|
7089
|
-
/* @__PURE__ */ (0,
|
|
7090
|
-
/* @__PURE__ */ (0,
|
|
7091
|
-
/* @__PURE__ */ (0,
|
|
7092
|
-
/* @__PURE__ */ (0,
|
|
7093
|
-
/* @__PURE__ */ (0,
|
|
7094
|
-
/* @__PURE__ */ (0,
|
|
7095
|
-
/* @__PURE__ */ (0,
|
|
7096
|
-
/* @__PURE__ */ (0,
|
|
7097
|
-
/* @__PURE__ */ (0,
|
|
7932
|
+
/* @__PURE__ */ (0, import_jsx_runtime8.jsxs)("dl", { className: "dsmm-kv", children: [
|
|
7933
|
+
/* @__PURE__ */ (0, import_jsx_runtime8.jsx)("dt", { children: t("tool") }),
|
|
7934
|
+
/* @__PURE__ */ (0, import_jsx_runtime8.jsx)("dd", { children: entry.match.tool }),
|
|
7935
|
+
/* @__PURE__ */ (0, import_jsx_runtime8.jsx)("dt", { children: t("cwd") }),
|
|
7936
|
+
/* @__PURE__ */ (0, import_jsx_runtime8.jsx)("dd", { children: entry.match.workingDirectory || "(any)" }),
|
|
7937
|
+
/* @__PURE__ */ (0, import_jsx_runtime8.jsx)("dt", { children: t("mode") }),
|
|
7938
|
+
/* @__PURE__ */ (0, import_jsx_runtime8.jsx)("dd", { children: t(`action:${entry.mode}`) || entry.mode }),
|
|
7939
|
+
/* @__PURE__ */ (0, import_jsx_runtime8.jsx)("dt", { children: t("sandboxMode") }),
|
|
7940
|
+
/* @__PURE__ */ (0, import_jsx_runtime8.jsx)("dd", { children: entry.sandboxMode })
|
|
7098
7941
|
] })
|
|
7099
7942
|
] })
|
|
7100
7943
|
] });
|
|
7101
7944
|
}
|
|
7102
7945
|
function StringEntry({ value, index, controller, disabled, change, remove, t }) {
|
|
7103
|
-
const id2 = (0,
|
|
7104
|
-
const state = (0,
|
|
7946
|
+
const id2 = (0, import_react6.useId)(), row = `${ENTRIES_PATH}.${index}`;
|
|
7947
|
+
const state = (0, import_react6.useSyncExternalStore)(controller.subscribe, controller.getSnapshot);
|
|
7105
7948
|
const raw = state.raw[row];
|
|
7106
7949
|
const text5 = raw?.text ?? value;
|
|
7107
7950
|
const bad = raw?.invalid === true || raw === void 0 && !validNativeRule(value);
|
|
7108
|
-
return /* @__PURE__ */ (0,
|
|
7109
|
-
/* @__PURE__ */ (0,
|
|
7110
|
-
/* @__PURE__ */ (0,
|
|
7111
|
-
/* @__PURE__ */ (0,
|
|
7112
|
-
|
|
7951
|
+
return /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)("div", { className: "dsmm-field dsmm-command-entry", children: [
|
|
7952
|
+
/* @__PURE__ */ (0, import_jsx_runtime8.jsx)("label", { htmlFor: `${id2}-pattern`, children: t("pattern") }),
|
|
7953
|
+
/* @__PURE__ */ (0, import_jsx_runtime8.jsxs)("div", { className: "dsmm-actions", children: [
|
|
7954
|
+
/* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
|
|
7955
|
+
import_dsh_client_ui_primitives6.Input,
|
|
7113
7956
|
{
|
|
7114
7957
|
className: "dsmm-input",
|
|
7115
7958
|
id: `${id2}-pattern`,
|
|
@@ -7129,18 +7972,18 @@ function StringEntry({ value, index, controller, disabled, change, remove, t })
|
|
|
7129
7972
|
}
|
|
7130
7973
|
}
|
|
7131
7974
|
),
|
|
7132
|
-
/* @__PURE__ */ (0,
|
|
7975
|
+
/* @__PURE__ */ (0, import_jsx_runtime8.jsxs)(import_dsh_client_ui_primitives6.Button, { type: "button", variant: "outline", disabled, onClick: remove, children: [
|
|
7133
7976
|
t("removeEntry"),
|
|
7134
7977
|
" ",
|
|
7135
7978
|
index + 1
|
|
7136
7979
|
] })
|
|
7137
7980
|
] }),
|
|
7138
|
-
bad && /* @__PURE__ */ (0,
|
|
7981
|
+
bad && /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("p", { id: `${id2}-error`, className: "dsmm-hint", children: t("invalidPattern") })
|
|
7139
7982
|
] });
|
|
7140
7983
|
}
|
|
7141
7984
|
function NativeCommandEntries({ value, inherited, controller, disabled, onChange, setInvalid, t }) {
|
|
7142
7985
|
const entries = value ?? inherited, name2 = ENTRIES_PATH;
|
|
7143
|
-
const state = (0,
|
|
7986
|
+
const state = (0, import_react6.useSyncExternalStore)(controller.subscribe, controller.getSnapshot);
|
|
7144
7987
|
const invalidRows = state.invalidFields.filter((path) => path === name2 || path.startsWith(`${name2}.`));
|
|
7145
7988
|
const valid = validNativeEntries(entries) && invalidRows.length === 0;
|
|
7146
7989
|
const change = (next) => {
|
|
@@ -7169,17 +8012,17 @@ function NativeCommandEntries({ value, inherited, controller, disabled, onChange
|
|
|
7169
8012
|
};
|
|
7170
8013
|
const isGlobal = controller.layer === "global";
|
|
7171
8014
|
const unsetLabel = isGlobal ? t("useDefaults") || "Use defaults" : t("restoreInheritance") || "Restore inheritance";
|
|
7172
|
-
return /* @__PURE__ */ (0,
|
|
7173
|
-
/* @__PURE__ */ (0,
|
|
8015
|
+
return /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)("details", { className: "dsmm-deployment-group", children: [
|
|
8016
|
+
/* @__PURE__ */ (0, import_jsx_runtime8.jsxs)("summary", { children: [
|
|
7174
8017
|
t("nativeCommands"),
|
|
7175
8018
|
" ",
|
|
7176
|
-
/* @__PURE__ */ (0,
|
|
8019
|
+
/* @__PURE__ */ (0, import_jsx_runtime8.jsx)("code", { children: name2 })
|
|
7177
8020
|
] }),
|
|
7178
|
-
/* @__PURE__ */ (0,
|
|
7179
|
-
/* @__PURE__ */ (0,
|
|
7180
|
-
!valid && /* @__PURE__ */ (0,
|
|
7181
|
-
entries.length === 0 && /* @__PURE__ */ (0,
|
|
7182
|
-
entries.map((entry, index) => typeof entry === "string" ? /* @__PURE__ */ (0,
|
|
8021
|
+
/* @__PURE__ */ (0, import_jsx_runtime8.jsxs)("div", { className: "dsmm-structured", children: [
|
|
8022
|
+
/* @__PURE__ */ (0, import_jsx_runtime8.jsx)("p", { className: "dsmm-hint", children: t("nativeCommandsHint") }),
|
|
8023
|
+
!valid && /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("p", { className: "dsmm-issue", role: "alert", children: t("invalidEntry") }),
|
|
8024
|
+
entries.length === 0 && /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("p", { children: t("noEntries") }),
|
|
8025
|
+
entries.map((entry, index) => typeof entry === "string" ? /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
|
|
7183
8026
|
StringEntry,
|
|
7184
8027
|
{
|
|
7185
8028
|
value: entry,
|
|
@@ -7191,7 +8034,7 @@ function NativeCommandEntries({ value, inherited, controller, disabled, onChange
|
|
|
7191
8034
|
remove: () => remove(index)
|
|
7192
8035
|
},
|
|
7193
8036
|
index
|
|
7194
|
-
) : /* @__PURE__ */ (0,
|
|
8037
|
+
) : /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
|
|
7195
8038
|
LegacyEntry,
|
|
7196
8039
|
{
|
|
7197
8040
|
entry,
|
|
@@ -7202,10 +8045,10 @@ function NativeCommandEntries({ value, inherited, controller, disabled, onChange
|
|
|
7202
8045
|
},
|
|
7203
8046
|
index
|
|
7204
8047
|
)),
|
|
7205
|
-
/* @__PURE__ */ (0,
|
|
7206
|
-
/* @__PURE__ */ (0,
|
|
7207
|
-
/* @__PURE__ */ (0,
|
|
7208
|
-
|
|
8048
|
+
/* @__PURE__ */ (0, import_jsx_runtime8.jsxs)("div", { className: "dsmm-actions", children: [
|
|
8049
|
+
/* @__PURE__ */ (0, import_jsx_runtime8.jsx)(import_dsh_client_ui_primitives6.Button, { type: "button", variant: "outline", disabled: disabled || entries.length >= 1024, onClick: add, children: t("addEntry") }),
|
|
8050
|
+
/* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
|
|
8051
|
+
import_dsh_client_ui_primitives6.Button,
|
|
7209
8052
|
{
|
|
7210
8053
|
type: "button",
|
|
7211
8054
|
variant: "outline",
|
|
@@ -7224,9 +8067,9 @@ function NativeCommandEntries({ value, inherited, controller, disabled, onChange
|
|
|
7224
8067
|
}
|
|
7225
8068
|
|
|
7226
8069
|
// src/client/PermissionRuleEntries.tsx
|
|
7227
|
-
var
|
|
7228
|
-
var
|
|
7229
|
-
var
|
|
8070
|
+
var import_react7 = require("react");
|
|
8071
|
+
var import_dsh_client_ui_primitives7 = require("@deepseek-ai/dsh-client-ui-primitives");
|
|
8072
|
+
var import_jsx_runtime9 = require("react/jsx-runtime");
|
|
7230
8073
|
var actions = ["allow", "ask", "deny"];
|
|
7231
8074
|
var kinds = ["outside-read", "shell", "webSearch", "webFetch"];
|
|
7232
8075
|
var name = "permissionControl.rules";
|
|
@@ -7245,61 +8088,61 @@ function newRule() {
|
|
|
7245
8088
|
return { id: "", action: "ask", match: newMatch("outside-read"), source: { kind: "user-import", label: "configuration" }, revision: 0, revoked: false };
|
|
7246
8089
|
}
|
|
7247
8090
|
function Row({ rule, index, disabled, change, remove, t }) {
|
|
7248
|
-
const id2 = (0,
|
|
7249
|
-
const field = (key) => /* @__PURE__ */ (0,
|
|
7250
|
-
/* @__PURE__ */ (0,
|
|
7251
|
-
/* @__PURE__ */ (0,
|
|
8091
|
+
const id2 = (0, import_react7.useId)();
|
|
8092
|
+
const field = (key) => /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)("div", { className: "dsmm-field", children: [
|
|
8093
|
+
/* @__PURE__ */ (0, import_jsx_runtime9.jsx)("label", { htmlFor: `${id2}-${key}`, children: t(key === "workingDirectory" ? "cwd" : key) }),
|
|
8094
|
+
/* @__PURE__ */ (0, import_jsx_runtime9.jsx)(import_dsh_client_ui_primitives7.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 } }) })
|
|
7252
8095
|
] });
|
|
7253
|
-
return /* @__PURE__ */ (0,
|
|
7254
|
-
/* @__PURE__ */ (0,
|
|
7255
|
-
/* @__PURE__ */ (0,
|
|
8096
|
+
return /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)("fieldset", { children: [
|
|
8097
|
+
/* @__PURE__ */ (0, import_jsx_runtime9.jsx)("legend", { children: rule.id === "" ? `${t("newRule")} ${index + 1}` : rule.id }),
|
|
8098
|
+
/* @__PURE__ */ (0, import_jsx_runtime9.jsxs)("p", { children: [
|
|
7256
8099
|
t(rule.revoked ? "revoked" : "active"),
|
|
7257
8100
|
" · ",
|
|
7258
8101
|
t(`action:${rule.action}`)
|
|
7259
8102
|
] }),
|
|
7260
|
-
/* @__PURE__ */ (0,
|
|
7261
|
-
/* @__PURE__ */ (0,
|
|
7262
|
-
/* @__PURE__ */ (0,
|
|
7263
|
-
/* @__PURE__ */ (0,
|
|
7264
|
-
/* @__PURE__ */ (0,
|
|
8103
|
+
/* @__PURE__ */ (0, import_jsx_runtime9.jsxs)("dl", { className: "dsmm-child-meta", children: [
|
|
8104
|
+
/* @__PURE__ */ (0, import_jsx_runtime9.jsx)("dt", { children: t("source") }),
|
|
8105
|
+
/* @__PURE__ */ (0, import_jsx_runtime9.jsx)("dd", { children: rule.source.kind === "operator" ? `${t("recordedOperator")} · ${rule.source.savedAt}` : `${t("imported")} · ${rule.source.label}` }),
|
|
8106
|
+
/* @__PURE__ */ (0, import_jsx_runtime9.jsx)("dt", { children: t("recordVersion") }),
|
|
8107
|
+
/* @__PURE__ */ (0, import_jsx_runtime9.jsx)("dd", { children: rule.revision })
|
|
7265
8108
|
] }),
|
|
7266
|
-
/* @__PURE__ */ (0,
|
|
7267
|
-
/* @__PURE__ */ (0,
|
|
7268
|
-
/* @__PURE__ */ (0,
|
|
8109
|
+
/* @__PURE__ */ (0, import_jsx_runtime9.jsxs)("div", { className: "dsmm-field", children: [
|
|
8110
|
+
/* @__PURE__ */ (0, import_jsx_runtime9.jsx)("label", { htmlFor: `${id2}-id`, children: t("id") }),
|
|
8111
|
+
/* @__PURE__ */ (0, import_jsx_runtime9.jsx)(import_dsh_client_ui_primitives7.Input, { className: "dsmm-input", id: `${id2}-id`, required: true, maxLength: 256, disabled, value: rule.id, onChange: (event) => change({ ...rule, id: event.currentTarget.value }) })
|
|
7269
8112
|
] }),
|
|
7270
|
-
/* @__PURE__ */ (0,
|
|
7271
|
-
/* @__PURE__ */ (0,
|
|
7272
|
-
/* @__PURE__ */ (0,
|
|
8113
|
+
/* @__PURE__ */ (0, import_jsx_runtime9.jsxs)("div", { className: "dsmm-field", children: [
|
|
8114
|
+
/* @__PURE__ */ (0, import_jsx_runtime9.jsx)("label", { htmlFor: `${id2}-action`, children: t("action") }),
|
|
8115
|
+
/* @__PURE__ */ (0, import_jsx_runtime9.jsx)("select", { id: `${id2}-action`, disabled, value: rule.action, onChange: (event) => {
|
|
7273
8116
|
const action2 = actions.find((value) => value === event.currentTarget.value);
|
|
7274
8117
|
if (action2 !== void 0) change({ ...rule, action: action2 });
|
|
7275
|
-
}, children: actions.map((action2) => /* @__PURE__ */ (0,
|
|
8118
|
+
}, children: actions.map((action2) => /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("option", { value: action2, children: t(`action:${action2}`) }, action2)) })
|
|
7276
8119
|
] }),
|
|
7277
|
-
/* @__PURE__ */ (0,
|
|
7278
|
-
/* @__PURE__ */ (0,
|
|
7279
|
-
/* @__PURE__ */ (0,
|
|
8120
|
+
/* @__PURE__ */ (0, import_jsx_runtime9.jsxs)("div", { className: "dsmm-field", children: [
|
|
8121
|
+
/* @__PURE__ */ (0, import_jsx_runtime9.jsx)("label", { htmlFor: `${id2}-kind`, children: t("match") }),
|
|
8122
|
+
/* @__PURE__ */ (0, import_jsx_runtime9.jsx)("select", { id: `${id2}-kind`, disabled, value: rule.match.kind, onChange: (event) => {
|
|
7280
8123
|
const kind = kinds.find((value) => value === event.currentTarget.value);
|
|
7281
8124
|
if (kind !== void 0) change({ ...rule, match: newMatch(kind) });
|
|
7282
|
-
}, children: kinds.map((kind) => /* @__PURE__ */ (0,
|
|
8125
|
+
}, children: kinds.map((kind) => /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("option", { value: kind, children: t(`kind:${kind}`) }, kind)) })
|
|
7283
8126
|
] }),
|
|
7284
|
-
rule.match.kind === "outside-read" && /* @__PURE__ */ (0,
|
|
8127
|
+
rule.match.kind === "outside-read" && /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)(import_jsx_runtime9.Fragment, { children: [
|
|
7285
8128
|
field("path"),
|
|
7286
|
-
/* @__PURE__ */ (0,
|
|
7287
|
-
/* @__PURE__ */ (0,
|
|
7288
|
-
/* @__PURE__ */ (0,
|
|
8129
|
+
/* @__PURE__ */ (0, import_jsx_runtime9.jsxs)("div", { className: "dsmm-field", children: [
|
|
8130
|
+
/* @__PURE__ */ (0, import_jsx_runtime9.jsx)("label", { htmlFor: `${id2}-scope`, children: t("pathScope") }),
|
|
8131
|
+
/* @__PURE__ */ (0, import_jsx_runtime9.jsxs)("select", { id: `${id2}-scope`, disabled, value: rule.match.scope, onChange: (event) => {
|
|
7289
8132
|
const scope = event.currentTarget.value;
|
|
7290
8133
|
if (rule.match.kind === "outside-read" && (scope === "exact" || scope === "tree")) change({ ...rule, match: { ...rule.match, scope } });
|
|
7291
8134
|
}, children: [
|
|
7292
|
-
/* @__PURE__ */ (0,
|
|
7293
|
-
/* @__PURE__ */ (0,
|
|
8135
|
+
/* @__PURE__ */ (0, import_jsx_runtime9.jsx)("option", { value: "exact", children: t("exact") }),
|
|
8136
|
+
/* @__PURE__ */ (0, import_jsx_runtime9.jsx)("option", { value: "tree", children: t("tree") })
|
|
7294
8137
|
] })
|
|
7295
8138
|
] })
|
|
7296
8139
|
] }),
|
|
7297
|
-
rule.match.kind === "shell" && /* @__PURE__ */ (0,
|
|
8140
|
+
rule.match.kind === "shell" && /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)(import_jsx_runtime9.Fragment, { children: [
|
|
7298
8141
|
field("executable"),
|
|
7299
8142
|
field("command"),
|
|
7300
8143
|
field("workingDirectory")
|
|
7301
8144
|
] }),
|
|
7302
|
-
/* @__PURE__ */ (0,
|
|
8145
|
+
/* @__PURE__ */ (0, import_jsx_runtime9.jsxs)(import_dsh_client_ui_primitives7.Button, { type: "button", variant: "outline", disabled, onClick: remove, children: [
|
|
7303
8146
|
t("removeRule"),
|
|
7304
8147
|
" ",
|
|
7305
8148
|
index + 1
|
|
@@ -7307,7 +8150,7 @@ function Row({ rule, index, disabled, change, remove, t }) {
|
|
|
7307
8150
|
] });
|
|
7308
8151
|
}
|
|
7309
8152
|
function PermissionRuleEntries({ value, inherited, controller, disabled, onChange, expanded, onExpandedChange, t }) {
|
|
7310
|
-
const state = (0,
|
|
8153
|
+
const state = (0, import_react7.useSyncExternalStore)(controller.subscribe, controller.getSnapshot), id2 = (0, import_react7.useId)();
|
|
7311
8154
|
const raw = state.raw[name], locked = raw?.invalid === true, entries = value ?? inherited, valid = validPermissionRules(entries);
|
|
7312
8155
|
const text5 = raw?.text ?? (value === void 0 ? "" : JSON.stringify(value, null, 2));
|
|
7313
8156
|
const change = (next) => {
|
|
@@ -7319,17 +8162,17 @@ function PermissionRuleEntries({ value, inherited, controller, disabled, onChang
|
|
|
7319
8162
|
const held = disabled || locked;
|
|
7320
8163
|
const isGlobal = controller.layer === "global";
|
|
7321
8164
|
const unsetLabel = isGlobal ? t("useDefaults") : t("restoreInheritance");
|
|
7322
|
-
return /* @__PURE__ */ (0,
|
|
7323
|
-
/* @__PURE__ */ (0,
|
|
8165
|
+
return /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)("details", { className: "dsmm-deployment-group", "data-field": name, open: expanded, onToggle: (event) => onExpandedChange?.(event.currentTarget.open), children: [
|
|
8166
|
+
/* @__PURE__ */ (0, import_jsx_runtime9.jsxs)("summary", { children: [
|
|
7324
8167
|
t("configRules"),
|
|
7325
8168
|
" ",
|
|
7326
|
-
/* @__PURE__ */ (0,
|
|
8169
|
+
/* @__PURE__ */ (0, import_jsx_runtime9.jsx)("code", { children: name })
|
|
7327
8170
|
] }),
|
|
7328
|
-
/* @__PURE__ */ (0,
|
|
7329
|
-
/* @__PURE__ */ (0,
|
|
7330
|
-
!valid && /* @__PURE__ */ (0,
|
|
7331
|
-
entries.length === 0 && /* @__PURE__ */ (0,
|
|
7332
|
-
entries.map((rule, index) => /* @__PURE__ */ (0,
|
|
8171
|
+
/* @__PURE__ */ (0, import_jsx_runtime9.jsxs)("div", { className: "dsmm-structured", children: [
|
|
8172
|
+
/* @__PURE__ */ (0, import_jsx_runtime9.jsx)("p", { className: "dsmm-hint", children: t("configRulesHint") }),
|
|
8173
|
+
!valid && /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("p", { className: "dsmm-issue", role: "alert", children: t("invalidRule") }),
|
|
8174
|
+
entries.length === 0 && /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("p", { children: t("configRulesEmpty") }),
|
|
8175
|
+
entries.map((rule, index) => /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
|
|
7333
8176
|
Row,
|
|
7334
8177
|
{
|
|
7335
8178
|
rule,
|
|
@@ -7341,17 +8184,17 @@ function PermissionRuleEntries({ value, inherited, controller, disabled, onChang
|
|
|
7341
8184
|
},
|
|
7342
8185
|
index
|
|
7343
8186
|
)),
|
|
7344
|
-
/* @__PURE__ */ (0,
|
|
7345
|
-
/* @__PURE__ */ (0,
|
|
7346
|
-
/* @__PURE__ */ (0,
|
|
8187
|
+
/* @__PURE__ */ (0, import_jsx_runtime9.jsxs)("div", { className: "dsmm-actions", children: [
|
|
8188
|
+
/* @__PURE__ */ (0, import_jsx_runtime9.jsx)(import_dsh_client_ui_primitives7.Button, { type: "button", variant: "outline", disabled: held || entries.length >= 1024, onClick: () => change([...entries, newRule()]), children: t("addRule") }),
|
|
8189
|
+
/* @__PURE__ */ (0, import_jsx_runtime9.jsx)(import_dsh_client_ui_primitives7.Button, { type: "button", variant: "outline", "data-dsmm-unset": name, disabled: disabled || value === void 0 && raw === void 0, onClick: () => {
|
|
7347
8190
|
controller.clearRaw(name);
|
|
7348
8191
|
onChange(void 0);
|
|
7349
8192
|
}, children: unsetLabel })
|
|
7350
8193
|
] }),
|
|
7351
|
-
/* @__PURE__ */ (0,
|
|
7352
|
-
/* @__PURE__ */ (0,
|
|
7353
|
-
/* @__PURE__ */ (0,
|
|
7354
|
-
/* @__PURE__ */ (0,
|
|
8194
|
+
/* @__PURE__ */ (0, import_jsx_runtime9.jsxs)("details", { children: [
|
|
8195
|
+
/* @__PURE__ */ (0, import_jsx_runtime9.jsx)("summary", { id: `${id2}-advanced-label`, children: t("advancedRules") }),
|
|
8196
|
+
/* @__PURE__ */ (0, import_jsx_runtime9.jsxs)("div", { className: "dsmm-field", children: [
|
|
8197
|
+
/* @__PURE__ */ (0, import_jsx_runtime9.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) => {
|
|
7355
8198
|
const next = event.currentTarget.value;
|
|
7356
8199
|
let parsed, ok = false;
|
|
7357
8200
|
try {
|
|
@@ -7363,7 +8206,7 @@ function PermissionRuleEntries({ value, inherited, controller, disabled, onChang
|
|
|
7363
8206
|
controller.setRaw(name, next, !ok);
|
|
7364
8207
|
if (ok) onChange(parsed);
|
|
7365
8208
|
} }),
|
|
7366
|
-
/* @__PURE__ */ (0,
|
|
8209
|
+
/* @__PURE__ */ (0, import_jsx_runtime9.jsx)("p", { id: `${id2}-error`, className: "dsmm-hint", children: locked ? t("invalidRule") : "" })
|
|
7367
8210
|
] })
|
|
7368
8211
|
] })
|
|
7369
8212
|
] })
|
|
@@ -7371,7 +8214,7 @@ function PermissionRuleEntries({ value, inherited, controller, disabled, onChang
|
|
|
7371
8214
|
}
|
|
7372
8215
|
|
|
7373
8216
|
// src/client/DeploymentFields.tsx
|
|
7374
|
-
var
|
|
8217
|
+
var import_jsx_runtime10 = require("react/jsx-runtime");
|
|
7375
8218
|
var permissionText = (t) => (key) => (t("global") === "DSMM 全局配置" ? permissionZh : permissionEn)[key];
|
|
7376
8219
|
function fieldLabel(path, t) {
|
|
7377
8220
|
const key = path.at(-1);
|
|
@@ -7402,19 +8245,19 @@ function displayValue(value, t) {
|
|
|
7402
8245
|
return text5.length > 120 ? `${text5.slice(0, 120)}…` : text5;
|
|
7403
8246
|
}
|
|
7404
8247
|
function AdvancedField({ schema, path, controller, inherited, upper, expanded, onExpandedChange, t }) {
|
|
7405
|
-
const state = (0,
|
|
8248
|
+
const state = (0, import_react8.useSyncExternalStore)(controller.subscribe, controller.getSnapshot), id2 = (0, import_react8.useId)(), name2 = path.join(".");
|
|
7406
8249
|
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;
|
|
7407
8250
|
const unsetLabel = controller.layer === "global" ? t("useDefaults") : t("restoreInheritance");
|
|
7408
|
-
return /* @__PURE__ */ (0,
|
|
7409
|
-
/* @__PURE__ */ (0,
|
|
8251
|
+
return /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("details", { className: "dsmm-deployment-group", "data-field": name2, open: expanded, onToggle: (event) => onExpandedChange?.(event.currentTarget.open), children: [
|
|
8252
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("summary", { id: `${id2}-label`, children: [
|
|
7410
8253
|
fieldLabel(path, t),
|
|
7411
8254
|
" · ",
|
|
7412
8255
|
t("advanced")
|
|
7413
8256
|
] }),
|
|
7414
|
-
/* @__PURE__ */ (0,
|
|
7415
|
-
/* @__PURE__ */ (0,
|
|
7416
|
-
path[0] === "permissionControl" && /* @__PURE__ */ (0,
|
|
7417
|
-
/* @__PURE__ */ (0,
|
|
8257
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("div", { className: "dsmm-field", children: [
|
|
8258
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)("p", { className: "dsmm-hint", id: `${id2}-hint`, children: t("advancedHint") }),
|
|
8259
|
+
path[0] === "permissionControl" && /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("p", { className: "dsmm-hint", children: permissionText(t)("configRulesHint") }),
|
|
8260
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.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) => {
|
|
7418
8261
|
const next = event.currentTarget.value;
|
|
7419
8262
|
let parsed, valid = true;
|
|
7420
8263
|
try {
|
|
@@ -7427,42 +8270,42 @@ function AdvancedField({ schema, path, controller, inherited, upper, expanded, o
|
|
|
7427
8270
|
controller.setRaw(name2, next, !valid);
|
|
7428
8271
|
if (valid) controller.edit(path, parsed);
|
|
7429
8272
|
} }),
|
|
7430
|
-
/* @__PURE__ */ (0,
|
|
7431
|
-
/* @__PURE__ */ (0,
|
|
8273
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)("p", { id: `${id2}-error`, className: "dsmm-hint", children: invalid2 ? t("invalid") : "" }),
|
|
8274
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)(import_dsh_client_ui_primitives8.Button, { type: "button", variant: "outline", "data-dsmm-unset": name2, disabled: !controller.canEdit() || value === void 0 && raw === void 0, onClick: () => {
|
|
7432
8275
|
controller.clearRaw(name2);
|
|
7433
8276
|
controller.edit(path, void 0);
|
|
7434
8277
|
}, children: unsetLabel }),
|
|
7435
|
-
/* @__PURE__ */ (0,
|
|
7436
|
-
/* @__PURE__ */ (0,
|
|
7437
|
-
/* @__PURE__ */ (0,
|
|
8278
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("details", { children: [
|
|
8279
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)("summary", { children: t("inherit") }),
|
|
8280
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)("pre", { children: JSON.stringify(inherited, null, 2) })
|
|
7438
8281
|
] }),
|
|
7439
|
-
/* @__PURE__ */ (0,
|
|
7440
|
-
/* @__PURE__ */ (0,
|
|
7441
|
-
/* @__PURE__ */ (0,
|
|
8282
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("details", { children: [
|
|
8283
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)("summary", { children: "schema" }),
|
|
8284
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)("pre", { children: JSON.stringify(schema, null, 2) })
|
|
7442
8285
|
] })
|
|
7443
8286
|
] })
|
|
7444
8287
|
] });
|
|
7445
8288
|
}
|
|
7446
8289
|
function ScalarField({ schema, path, controller, inherited, t }) {
|
|
7447
|
-
const state = (0,
|
|
8290
|
+
const state = (0, import_react8.useSyncExternalStore)(controller.subscribe, controller.getSnapshot), id2 = (0, import_react8.useId)(), name2 = path.join(".");
|
|
7448
8291
|
const value = at(state.draft, path), raw = state.raw[name2], bad = raw?.invalid === true;
|
|
7449
8292
|
const units = name2 === "guards.toolOutputTruncation.maxInlineBytes" ? ` · ${permissionText(t)("unitBytes")}` : name2 === "guards.questionLabelHelper.maxLabelChars" ? ` · ${permissionText(t)("unitChars")}` : "";
|
|
7450
8293
|
const unsetLabel = controller.layer === "global" ? t("useDefaults") : t("restoreInheritance");
|
|
7451
|
-
return /* @__PURE__ */ (0,
|
|
7452
|
-
/* @__PURE__ */ (0,
|
|
7453
|
-
/* @__PURE__ */ (0,
|
|
7454
|
-
/* @__PURE__ */ (0,
|
|
8294
|
+
return /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)(import_jsx_runtime10.Fragment, { children: [
|
|
8295
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)("label", { htmlFor: id2, children: fieldLabel(path, t) }),
|
|
8296
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("div", { className: "dsmm-actions", children: [
|
|
8297
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)(import_dsh_client_ui_primitives8.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) => {
|
|
7455
8298
|
const text5 = event.currentTarget.value, candidate = schema.type === "number" ? Number(text5) : text5;
|
|
7456
8299
|
const valid = (schema.type !== "number" || text5.trim() !== "") && validateEditorValue(candidate, schema);
|
|
7457
8300
|
controller.setRaw(name2, text5, !valid);
|
|
7458
8301
|
if (valid) controller.edit(path, candidate);
|
|
7459
8302
|
} }),
|
|
7460
|
-
/* @__PURE__ */ (0,
|
|
8303
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)(import_dsh_client_ui_primitives8.Button, { type: "button", variant: "outline", "data-dsmm-unset": name2, disabled: !controller.canEdit() || value === void 0 && raw === void 0, onClick: () => {
|
|
7461
8304
|
controller.clearRaw(name2);
|
|
7462
8305
|
controller.edit(path, void 0);
|
|
7463
8306
|
}, children: unsetLabel })
|
|
7464
8307
|
] }),
|
|
7465
|
-
/* @__PURE__ */ (0,
|
|
8308
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("p", { id: `${id2}-error`, className: "dsmm-hint", children: [
|
|
7466
8309
|
bad ? t("invalid") : "",
|
|
7467
8310
|
schema.type === "number" && (schema.min !== void 0 || schema.max !== void 0) ? ` ${schema.min ?? "—"} – ${schema.max ?? "—"}` : "",
|
|
7468
8311
|
units
|
|
@@ -7471,8 +8314,8 @@ function ScalarField({ schema, path, controller, inherited, t }) {
|
|
|
7471
8314
|
}
|
|
7472
8315
|
function Field({ schema, path, controller, initiallyOpen = false, disclosures, t }) {
|
|
7473
8316
|
if (schema.type === "transform" && schema.inner !== void 0) schema = schema.inner;
|
|
7474
|
-
const state = (0,
|
|
7475
|
-
const [open, setOpen] = (0,
|
|
8317
|
+
const state = (0, import_react8.useSyncExternalStore)(controller.subscribe, controller.getSnapshot), snapshot4 = state.snapshot, id2 = (0, import_react8.useId)(), name2 = path.join(".");
|
|
8318
|
+
const [open, setOpen] = (0, import_react8.useState)(disclosures?.get(name2) ?? initiallyOpen);
|
|
7476
8319
|
const expand = (expanded) => {
|
|
7477
8320
|
disclosures?.set(name2, expanded);
|
|
7478
8321
|
setOpen(expanded);
|
|
@@ -7497,35 +8340,35 @@ function Field({ schema, path, controller, initiallyOpen = false, disclosures, t
|
|
|
7497
8340
|
};
|
|
7498
8341
|
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);
|
|
7499
8342
|
const choices = enumValues(schema), disabled = !controller.canEdit();
|
|
7500
|
-
if (name2 === "permissionControl.nativeCommands.entries") return /* @__PURE__ */ (0,
|
|
7501
|
-
if (name2 === "permissionControl.rules") return /* @__PURE__ */ (0,
|
|
7502
|
-
if (schema.type === "object" && schema.fields !== void 0 && path[0] !== "roleRouting") return /* @__PURE__ */ (0,
|
|
7503
|
-
/* @__PURE__ */ (0,
|
|
7504
|
-
/* @__PURE__ */ (0,
|
|
7505
|
-
/* @__PURE__ */ (0,
|
|
8343
|
+
if (name2 === "permissionControl.nativeCommands.entries") return /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("div", { "data-field": name2, children: /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(NativeCommandEntries, { controller, value: explicit, inherited: inherited ?? [], disabled, onChange: (value) => controller.edit(path, value), setInvalid: (key, bad) => controller.setInvalid(key, bad), t: permissionText(t) }) });
|
|
8344
|
+
if (name2 === "permissionControl.rules") return /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("div", { "data-field": name2, children: /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(PermissionRuleEntries, { controller, value: explicit, inherited: inherited ?? [], disabled, onChange: (value) => controller.edit(path, value), expanded: open, onExpandedChange: expand, t: permissionText(t) }) });
|
|
8345
|
+
if (schema.type === "object" && schema.fields !== void 0 && path[0] !== "roleRouting") return /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("details", { className: "dsmm-deployment-group", "data-field": name2, open, onToggle: (event) => expand(event.currentTarget.open), children: [
|
|
8346
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)("summary", { className: "dsmm-group-summary-row", children: /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("span", { className: "dsmm-group-summary", children: [
|
|
8347
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)("span", { className: "dsmm-group-summary-label", children: fieldLabel(path, t) }),
|
|
8348
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)(import_dsh_client_ui_primitives8.Button, { type: "button", variant: "outline", className: "dsmm-group-summary-action", "data-dsmm-unset": name2, hidden: !open, disabled: disabled || explicit === void 0 && !Object.keys(state.raw).some((key) => key === name2 || key.startsWith(`${name2}.`)), onClick: unsetGroup, children: unsetLabel })
|
|
7506
8349
|
] }) }),
|
|
7507
|
-
/* @__PURE__ */ (0,
|
|
7508
|
-
name2 === "permissionControl" && /* @__PURE__ */ (0,
|
|
7509
|
-
Object.entries(schema.fields).map(([key, node]) => /* @__PURE__ */ (0,
|
|
8350
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("div", { children: [
|
|
8351
|
+
name2 === "permissionControl" && /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("p", { className: "dsmm-hint", children: permissionText(t)("configPolicyHint") }),
|
|
8352
|
+
Object.entries(schema.fields).map(([key, node]) => /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(Field, { schema: node, path: [...path, key], controller, disclosures, t }, key))
|
|
7510
8353
|
] })
|
|
7511
8354
|
] });
|
|
7512
|
-
if (!["boolean", "string", "number"].includes(schema.type) && choices === null) return /* @__PURE__ */ (0,
|
|
7513
|
-
return /* @__PURE__ */ (0,
|
|
7514
|
-
schema.type === "boolean" || choices !== null ? /* @__PURE__ */ (0,
|
|
7515
|
-
/* @__PURE__ */ (0,
|
|
7516
|
-
/* @__PURE__ */ (0,
|
|
7517
|
-
/* @__PURE__ */ (0,
|
|
7518
|
-
(choices ?? [true, false]).map((choice2) => /* @__PURE__ */ (0,
|
|
8355
|
+
if (!["boolean", "string", "number"].includes(schema.type) && choices === null) return /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(AdvancedField, { schema, path, controller, inherited, upper: controller.layer === "global" ? at(snapshot4.profile, path) : void 0, expanded: open, onExpandedChange: expand, t });
|
|
8356
|
+
return /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("div", { className: "dsmm-field dsmm-deployment-field", "data-field": name2, children: [
|
|
8357
|
+
schema.type === "boolean" || choices !== null ? /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)(import_jsx_runtime10.Fragment, { children: [
|
|
8358
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)("label", { htmlFor: id2, children: fieldLabel(path, t) }),
|
|
8359
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.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: [
|
|
8360
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)("option", { value: "inherit", children: `${unsetLabel} · ${displayValue(inherited, t)}` }),
|
|
8361
|
+
(choices ?? [true, false]).map((choice2) => /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("option", { value: JSON.stringify(choice2), children: displayValue(choice2, t) }, String(choice2)))
|
|
7519
8362
|
] })
|
|
7520
|
-
] }) : /* @__PURE__ */ (0,
|
|
7521
|
-
name2 === "modelParameters.passthrough" && /* @__PURE__ */ (0,
|
|
7522
|
-
name2 === "permissionControl.enabled" && /* @__PURE__ */ (0,
|
|
8363
|
+
] }) : /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(ScalarField, { schema, path, controller, inherited, t }),
|
|
8364
|
+
name2 === "modelParameters.passthrough" && /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("p", { className: "dsmm-hint", children: t("modelParametersHint") }),
|
|
8365
|
+
name2 === "permissionControl.enabled" && /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("p", { className: "dsmm-hint", children: permissionText(t)("coldHint") })
|
|
7523
8366
|
] });
|
|
7524
8367
|
}
|
|
7525
8368
|
|
|
7526
8369
|
// src/client/PermissionsPanel.tsx
|
|
7527
|
-
var
|
|
7528
|
-
var
|
|
8370
|
+
var import_react9 = require("react");
|
|
8371
|
+
var import_dsh_client_ui_primitives9 = require("@deepseek-ai/dsh-client-ui-primitives");
|
|
7529
8372
|
|
|
7530
8373
|
// src/permission-remote.ts
|
|
7531
8374
|
function fail3() {
|
|
@@ -7844,140 +8687,140 @@ var PermissionController = class {
|
|
|
7844
8687
|
};
|
|
7845
8688
|
|
|
7846
8689
|
// src/client/PermissionsPanel.tsx
|
|
7847
|
-
var
|
|
8690
|
+
var import_jsx_runtime11 = require("react/jsx-runtime");
|
|
7848
8691
|
var actions2 = ["inherit", "allow", "ask", "deny"];
|
|
7849
8692
|
var kinds2 = ["outside-read", "shell", "webSearch", "webFetch"];
|
|
7850
8693
|
var ruleDraft = (rule) => ({ id: rule.id, action: rule.action, match: structuredClone(rule.match) });
|
|
7851
8694
|
var newMatch2 = (kind) => kind === "outside-read" ? { kind, path: "", scope: "exact" } : kind === "shell" ? { kind, executable: "", command: "", workingDirectory: "" } : { kind };
|
|
7852
8695
|
function Issue({ value, t }) {
|
|
7853
|
-
return value === null ? null : /* @__PURE__ */ (0,
|
|
8696
|
+
return value === null ? null : /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)("p", { className: "dsmm-issue", role: "alert", children: [
|
|
7854
8697
|
t(`issue:${value}`),
|
|
7855
8698
|
" ",
|
|
7856
|
-
/* @__PURE__ */ (0,
|
|
8699
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsx)("code", { children: value })
|
|
7857
8700
|
] });
|
|
7858
8701
|
}
|
|
7859
8702
|
function RootState({ state, t }) {
|
|
7860
|
-
return /* @__PURE__ */ (0,
|
|
7861
|
-
/* @__PURE__ */ (0,
|
|
8703
|
+
return /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)(import_jsx_runtime11.Fragment, { children: [
|
|
8704
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsxs)("p", { children: [
|
|
7862
8705
|
t("root"),
|
|
7863
8706
|
": ",
|
|
7864
8707
|
t(state.scope === "root" && state.connected ? "active" : "unknown")
|
|
7865
8708
|
] }),
|
|
7866
|
-
state.scope !== "root" && /* @__PURE__ */ (0,
|
|
7867
|
-
!state.connected && /* @__PURE__ */ (0,
|
|
8709
|
+
state.scope !== "root" && /* @__PURE__ */ (0, import_jsx_runtime11.jsx)("p", { className: "dsmm-hint", children: t(state.scope === "child" ? "child" : "noRoot") }),
|
|
8710
|
+
!state.connected && /* @__PURE__ */ (0, import_jsx_runtime11.jsx)("p", { className: "dsmm-hint", children: t("unknown") })
|
|
7868
8711
|
] });
|
|
7869
8712
|
}
|
|
7870
8713
|
function ActionSelect({ id: id2, value, inherit = true, onChange, disabled, t }) {
|
|
7871
|
-
return /* @__PURE__ */ (0,
|
|
8714
|
+
return /* @__PURE__ */ (0, import_jsx_runtime11.jsx)("select", { id: id2, value, disabled, onChange: (event) => {
|
|
7872
8715
|
const choice2 = actions2.find((value2) => value2 === event.currentTarget.value);
|
|
7873
8716
|
if (choice2 !== void 0) onChange(choice2);
|
|
7874
|
-
}, children: actions2.filter((value2) => inherit || value2 !== "inherit").map((value2) => /* @__PURE__ */ (0,
|
|
8717
|
+
}, children: actions2.filter((value2) => inherit || value2 !== "inherit").map((value2) => /* @__PURE__ */ (0, import_jsx_runtime11.jsx)("option", { value: value2, children: t(value2 === "inherit" ? "inherit" : `action:${value2}`) }, value2)) });
|
|
7875
8718
|
}
|
|
7876
8719
|
function RuleEditor({ controller, state, t }) {
|
|
7877
|
-
const id2 = (0,
|
|
8720
|
+
const id2 = (0, import_react9.useId)(), editor = state.draft?.editor;
|
|
7878
8721
|
if (editor == null) return null;
|
|
7879
8722
|
const disabled = !controller.canEdit(state.generation), change = (value) => controller.edit(state.generation, { editor: value });
|
|
7880
|
-
const field = (key, label) => /* @__PURE__ */ (0,
|
|
7881
|
-
/* @__PURE__ */ (0,
|
|
7882
|
-
/* @__PURE__ */ (0,
|
|
8723
|
+
const field = (key, label) => /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)("div", { className: "dsmm-field", children: [
|
|
8724
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsx)("label", { htmlFor: `${id2}-${key}`, children: t(label) }),
|
|
8725
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsx)(import_dsh_client_ui_primitives9.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 } }) })
|
|
7883
8726
|
] });
|
|
7884
|
-
return /* @__PURE__ */ (0,
|
|
8727
|
+
return /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)("form", { className: "dsmm-structured", "aria-label": t("editor"), onSubmit: (event) => {
|
|
7885
8728
|
event.preventDefault();
|
|
7886
8729
|
controller.stageRule(state.generation);
|
|
7887
8730
|
}, children: [
|
|
7888
|
-
/* @__PURE__ */ (0,
|
|
7889
|
-
/* @__PURE__ */ (0,
|
|
7890
|
-
/* @__PURE__ */ (0,
|
|
8731
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsxs)("div", { className: "dsmm-field", children: [
|
|
8732
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsx)("label", { htmlFor: `${id2}-id`, children: t("id") }),
|
|
8733
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsx)(import_dsh_client_ui_primitives9.Input, { className: "dsmm-input", id: `${id2}-id`, required: true, maxLength: 256, value: editor.id, disabled, onChange: (event) => change({ ...editor, id: event.currentTarget.value }) })
|
|
7891
8734
|
] }),
|
|
7892
|
-
/* @__PURE__ */ (0,
|
|
7893
|
-
/* @__PURE__ */ (0,
|
|
7894
|
-
/* @__PURE__ */ (0,
|
|
8735
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsxs)("div", { className: "dsmm-field", children: [
|
|
8736
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsx)("label", { htmlFor: `${id2}-action`, children: t("action") }),
|
|
8737
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsx)(ActionSelect, { id: `${id2}-action`, value: editor.action, disabled, inherit: false, t, onChange: (action2) => {
|
|
7895
8738
|
if (action2 !== "inherit") change({ ...editor, action: action2 });
|
|
7896
8739
|
} })
|
|
7897
8740
|
] }),
|
|
7898
|
-
/* @__PURE__ */ (0,
|
|
7899
|
-
/* @__PURE__ */ (0,
|
|
7900
|
-
/* @__PURE__ */ (0,
|
|
8741
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsxs)("div", { className: "dsmm-field", children: [
|
|
8742
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsx)("label", { htmlFor: `${id2}-kind`, children: t("match") }),
|
|
8743
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsx)("select", { id: `${id2}-kind`, value: editor.match.kind, disabled, onChange: (event) => {
|
|
7901
8744
|
const kind = kinds2.find((value) => value === event.currentTarget.value);
|
|
7902
8745
|
if (kind !== void 0) change({ ...editor, match: newMatch2(kind) });
|
|
7903
|
-
}, children: kinds2.map((kind) => /* @__PURE__ */ (0,
|
|
8746
|
+
}, children: kinds2.map((kind) => /* @__PURE__ */ (0, import_jsx_runtime11.jsx)("option", { value: kind, children: t(`kind:${kind}`) }, kind)) })
|
|
7904
8747
|
] }),
|
|
7905
|
-
editor.match.kind === "outside-read" && /* @__PURE__ */ (0,
|
|
8748
|
+
editor.match.kind === "outside-read" && /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)(import_jsx_runtime11.Fragment, { children: [
|
|
7906
8749
|
field("path", "path"),
|
|
7907
|
-
/* @__PURE__ */ (0,
|
|
7908
|
-
/* @__PURE__ */ (0,
|
|
7909
|
-
/* @__PURE__ */ (0,
|
|
8750
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsxs)("div", { className: "dsmm-field", children: [
|
|
8751
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsx)("label", { htmlFor: `${id2}-path-scope`, children: t("pathScope") }),
|
|
8752
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsxs)("select", { id: `${id2}-path-scope`, value: editor.match.scope, disabled, onChange: (event) => {
|
|
7910
8753
|
const scope = event.currentTarget.value;
|
|
7911
8754
|
if (editor.match.kind === "outside-read" && (scope === "exact" || scope === "tree")) change({ ...editor, match: { ...editor.match, scope } });
|
|
7912
8755
|
}, children: [
|
|
7913
|
-
/* @__PURE__ */ (0,
|
|
7914
|
-
/* @__PURE__ */ (0,
|
|
8756
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsx)("option", { value: "exact", children: t("exact") }),
|
|
8757
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsx)("option", { value: "tree", children: t("tree") })
|
|
7915
8758
|
] })
|
|
7916
8759
|
] })
|
|
7917
8760
|
] }),
|
|
7918
|
-
editor.match.kind === "shell" && /* @__PURE__ */ (0,
|
|
8761
|
+
editor.match.kind === "shell" && /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)(import_jsx_runtime11.Fragment, { children: [
|
|
7919
8762
|
field("executable", "executable"),
|
|
7920
8763
|
field("command", "command"),
|
|
7921
8764
|
field("workingDirectory", "cwd")
|
|
7922
8765
|
] }),
|
|
7923
|
-
/* @__PURE__ */ (0,
|
|
7924
|
-
/* @__PURE__ */ (0,
|
|
7925
|
-
/* @__PURE__ */ (0,
|
|
8766
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsxs)("div", { className: "dsmm-actions", children: [
|
|
8767
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsx)(import_dsh_client_ui_primitives9.Button, { type: "submit", variant: "outline", disabled, children: t("stage") }),
|
|
8768
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsx)(import_dsh_client_ui_primitives9.Button, { type: "button", variant: "outline", disabled, onClick: () => controller.edit(state.generation, { editor: null }), children: t("cancel") })
|
|
7926
8769
|
] })
|
|
7927
8770
|
] });
|
|
7928
8771
|
}
|
|
7929
8772
|
function RuleRecords({ controller, state, t }) {
|
|
7930
8773
|
const records = observedRules(state)?.snapshot.policy.rules ?? state.base?.policy.rules;
|
|
7931
|
-
return /* @__PURE__ */ (0,
|
|
7932
|
-
records?.length === 0 && /* @__PURE__ */ (0,
|
|
7933
|
-
records?.map((rule) => /* @__PURE__ */ (0,
|
|
7934
|
-
/* @__PURE__ */ (0,
|
|
7935
|
-
/* @__PURE__ */ (0,
|
|
8774
|
+
return /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)("div", { className: "dsmm-structured", children: [
|
|
8775
|
+
records?.length === 0 && /* @__PURE__ */ (0, import_jsx_runtime11.jsx)("p", { children: t("noRules") }),
|
|
8776
|
+
records?.map((rule) => /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)("fieldset", { children: [
|
|
8777
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsx)("legend", { children: rule.id }),
|
|
8778
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsxs)("p", { children: [
|
|
7936
8779
|
t(rule.revoked ? "revoked" : "active"),
|
|
7937
8780
|
" · ",
|
|
7938
8781
|
t(`action:${rule.action}`)
|
|
7939
8782
|
] }),
|
|
7940
|
-
/* @__PURE__ */ (0,
|
|
7941
|
-
/* @__PURE__ */ (0,
|
|
7942
|
-
/* @__PURE__ */ (0,
|
|
7943
|
-
rule.match.kind === "outside-read" && /* @__PURE__ */ (0,
|
|
7944
|
-
/* @__PURE__ */ (0,
|
|
7945
|
-
/* @__PURE__ */ (0,
|
|
8783
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsxs)("dl", { className: "dsmm-child-meta", children: [
|
|
8784
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsx)("dt", { children: t("match") }),
|
|
8785
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsx)("dd", { children: t(`kind:${rule.match.kind}`) }),
|
|
8786
|
+
rule.match.kind === "outside-read" && /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)(import_jsx_runtime11.Fragment, { children: [
|
|
8787
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsx)("dt", { children: t("path") }),
|
|
8788
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsxs)("dd", { children: [
|
|
7946
8789
|
rule.match.path,
|
|
7947
8790
|
" · ",
|
|
7948
8791
|
t(rule.match.scope)
|
|
7949
8792
|
] })
|
|
7950
8793
|
] }),
|
|
7951
|
-
rule.match.kind === "shell" && /* @__PURE__ */ (0,
|
|
7952
|
-
/* @__PURE__ */ (0,
|
|
7953
|
-
/* @__PURE__ */ (0,
|
|
7954
|
-
/* @__PURE__ */ (0,
|
|
7955
|
-
/* @__PURE__ */ (0,
|
|
7956
|
-
/* @__PURE__ */ (0,
|
|
7957
|
-
/* @__PURE__ */ (0,
|
|
8794
|
+
rule.match.kind === "shell" && /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)(import_jsx_runtime11.Fragment, { children: [
|
|
8795
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsx)("dt", { children: t("executable") }),
|
|
8796
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsx)("dd", { children: rule.match.executable }),
|
|
8797
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsx)("dt", { children: t("command") }),
|
|
8798
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsx)("dd", { children: /* @__PURE__ */ (0, import_jsx_runtime11.jsx)("code", { children: rule.match.command }) }),
|
|
8799
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsx)("dt", { children: t("cwd") }),
|
|
8800
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsx)("dd", { children: rule.match.workingDirectory })
|
|
7958
8801
|
] }),
|
|
7959
|
-
/* @__PURE__ */ (0,
|
|
7960
|
-
/* @__PURE__ */ (0,
|
|
8802
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsx)("dt", { children: t("source") }),
|
|
8803
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsx)("dd", { children: t(rule.source.kind === "operator" ? "operator" : "imported") })
|
|
7961
8804
|
] }),
|
|
7962
|
-
/* @__PURE__ */ (0,
|
|
7963
|
-
/* @__PURE__ */ (0,
|
|
7964
|
-
/* @__PURE__ */ (0,
|
|
8805
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsxs)("div", { className: "dsmm-actions", children: [
|
|
8806
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsx)(import_dsh_client_ui_primitives9.Button, { type: "button", variant: "outline", disabled: !controller.canEdit(state.generation) || state.draft === null, onClick: () => controller.edit(state.generation, { editor: ruleDraft(rule) }), children: t("editRule") }),
|
|
8807
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsx)(import_dsh_client_ui_primitives9.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") })
|
|
7965
8808
|
] })
|
|
7966
8809
|
] }, rule.id))
|
|
7967
8810
|
] });
|
|
7968
8811
|
}
|
|
7969
8812
|
function PermissionCoverage({ state, t }) {
|
|
7970
8813
|
const value = observedRules(state)?.capabilities;
|
|
7971
|
-
return /* @__PURE__ */ (0,
|
|
7972
|
-
/* @__PURE__ */ (0,
|
|
7973
|
-
/* @__PURE__ */ (0,
|
|
7974
|
-
/* @__PURE__ */ (0,
|
|
7975
|
-
/* @__PURE__ */ (0,
|
|
7976
|
-
/* @__PURE__ */ (0,
|
|
7977
|
-
value === void 0 ? /* @__PURE__ */ (0,
|
|
7978
|
-
/* @__PURE__ */ (0,
|
|
7979
|
-
/* @__PURE__ */ (0,
|
|
7980
|
-
/* @__PURE__ */ (0,
|
|
8814
|
+
return /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)("section", { className: "dsmm-structured", "aria-label": t("coverageTitle"), children: [
|
|
8815
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsx)("h3", { children: t("coverageTitle") }),
|
|
8816
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsx)("p", { className: "dsmm-hint", children: t("matchHint") }),
|
|
8817
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsx)("p", { className: "dsmm-hint", children: t("networkLimit") }),
|
|
8818
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsx)("p", { className: "dsmm-hint", children: t("coverage") }),
|
|
8819
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsx)("p", { className: "dsmm-hint", children: t("registrationUnresolved") }),
|
|
8820
|
+
value === void 0 ? /* @__PURE__ */ (0, import_jsx_runtime11.jsx)("p", { children: t("coverageUnavailable") }) : /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)(import_jsx_runtime11.Fragment, { children: [
|
|
8821
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsxs)("dl", { className: "dsmm-child-meta", children: [
|
|
8822
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsx)("dt", { children: t("coverageRuntime") }),
|
|
8823
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsxs)("dd", { children: [
|
|
7981
8824
|
t(value.runtime.state),
|
|
7982
8825
|
" · ",
|
|
7983
8826
|
t("mounted"),
|
|
@@ -7985,115 +8828,115 @@ function PermissionCoverage({ state, t }) {
|
|
|
7985
8828
|
t(value.runtime.mounted ? "on" : "off")
|
|
7986
8829
|
] })
|
|
7987
8830
|
] }),
|
|
7988
|
-
value.runtime.restartRequired && /* @__PURE__ */ (0,
|
|
7989
|
-
value.tools.length === 0 ? /* @__PURE__ */ (0,
|
|
7990
|
-
/* @__PURE__ */ (0,
|
|
7991
|
-
/* @__PURE__ */ (0,
|
|
7992
|
-
/* @__PURE__ */ (0,
|
|
7993
|
-
/* @__PURE__ */ (0,
|
|
7994
|
-
/* @__PURE__ */ (0,
|
|
7995
|
-
/* @__PURE__ */ (0,
|
|
7996
|
-
/* @__PURE__ */ (0,
|
|
7997
|
-
/* @__PURE__ */ (0,
|
|
8831
|
+
value.runtime.restartRequired && /* @__PURE__ */ (0, import_jsx_runtime11.jsx)("p", { children: t("restart") }),
|
|
8832
|
+
value.tools.length === 0 ? /* @__PURE__ */ (0, import_jsx_runtime11.jsx)("p", { children: t("coverageEmpty") }) : /* @__PURE__ */ (0, import_jsx_runtime11.jsx)("ul", { className: "dsmm-profile-list", children: value.tools.map((tool) => /* @__PURE__ */ (0, import_jsx_runtime11.jsx)("li", { children: /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)("dl", { className: "dsmm-child-meta", children: [
|
|
8833
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsx)("dt", { children: t("toolName") }),
|
|
8834
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsx)("dd", { children: /* @__PURE__ */ (0, import_jsx_runtime11.jsx)("code", { children: tool.name }) }),
|
|
8835
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsx)("dt", { children: t("toolKind") }),
|
|
8836
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsx)("dd", { children: /* @__PURE__ */ (0, import_jsx_runtime11.jsx)("code", { children: tool.kind }) }),
|
|
8837
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsx)("dt", { children: t("toolApproval") }),
|
|
8838
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsx)("dd", { children: t("nativeOnce") }),
|
|
8839
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsx)("dt", { children: t("toolMemory") }),
|
|
8840
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsx)("dd", { children: t("notProvided") })
|
|
7998
8841
|
] }) }, tool.name)) }),
|
|
7999
|
-
/* @__PURE__ */ (0,
|
|
8000
|
-
/* @__PURE__ */ (0,
|
|
8001
|
-
/* @__PURE__ */ (0,
|
|
8002
|
-
/* @__PURE__ */ (0,
|
|
8003
|
-
/* @__PURE__ */ (0,
|
|
8004
|
-
/* @__PURE__ */ (0,
|
|
8005
|
-
/* @__PURE__ */ (0,
|
|
8006
|
-
/* @__PURE__ */ (0,
|
|
8007
|
-
/* @__PURE__ */ (0,
|
|
8008
|
-
/* @__PURE__ */ (0,
|
|
8009
|
-
/* @__PURE__ */ (0,
|
|
8010
|
-
/* @__PURE__ */ (0,
|
|
8011
|
-
/* @__PURE__ */ (0,
|
|
8012
|
-
/* @__PURE__ */ (0,
|
|
8013
|
-
/* @__PURE__ */ (0,
|
|
8014
|
-
/* @__PURE__ */ (0,
|
|
8015
|
-
/* @__PURE__ */ (0,
|
|
8842
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsxs)("dl", { className: "dsmm-child-meta", children: [
|
|
8843
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsx)("dt", { children: t("outsideReads") }),
|
|
8844
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsx)("dd", { children: t("limit:outsideReads") }),
|
|
8845
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsx)("dt", { children: t("finalInode") }),
|
|
8846
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsx)("dd", { children: t("limit:finalInode") }),
|
|
8847
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsx)("dt", { children: t("toolMemory") }),
|
|
8848
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsx)("dd", { children: t("limit:scopedMemory") }),
|
|
8849
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsx)("dt", { children: t("webFetch") }),
|
|
8850
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsx)("dd", { children: t("limit:webFetch") }),
|
|
8851
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsx)("dt", { children: t("searchDestinations") }),
|
|
8852
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsx)("dd", { children: t("limit:webSearchDestinations") }),
|
|
8853
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsx)("dt", { children: t("proxyBinding") }),
|
|
8854
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsx)("dd", { children: t("limit:proxyAddressBinding") }),
|
|
8855
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsx)("dt", { children: t("shellSockets") }),
|
|
8856
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsx)("dd", { children: t("limit:shellSockets") }),
|
|
8857
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsx)("dt", { children: t("providerAuthMcp") }),
|
|
8858
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsx)("dd", { children: t("limit:providerAuthMcp") })
|
|
8016
8859
|
] })
|
|
8017
8860
|
] }),
|
|
8018
|
-
/* @__PURE__ */ (0,
|
|
8861
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsx)("p", { className: "dsmm-hint", children: t("pathEvidence") })
|
|
8019
8862
|
] });
|
|
8020
8863
|
}
|
|
8021
8864
|
function PermissionRulesEditor({ controller, state, t }) {
|
|
8022
|
-
const id2 = (0,
|
|
8865
|
+
const id2 = (0, import_react9.useId)(), draft2 = state.draft, disabled = !controller.canEdit(state.generation), value = observedRules(state), observedPolicy = value?.snapshot ?? null;
|
|
8023
8866
|
const writable = state.scope === "root" && state.connected;
|
|
8024
|
-
return /* @__PURE__ */ (0,
|
|
8025
|
-
/* @__PURE__ */ (0,
|
|
8026
|
-
/* @__PURE__ */ (0,
|
|
8027
|
-
/* @__PURE__ */ (0,
|
|
8028
|
-
displayUnconfirmed(state) && /* @__PURE__ */ (0,
|
|
8029
|
-
/* @__PURE__ */ (0,
|
|
8030
|
-
/* @__PURE__ */ (0,
|
|
8031
|
-
/* @__PURE__ */ (0,
|
|
8032
|
-
/* @__PURE__ */ (0,
|
|
8867
|
+
return /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)("section", { className: "dsmm-zone", "aria-label": t("rules"), children: [
|
|
8868
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsx)("h3", { children: t("rules") }),
|
|
8869
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsx)("p", { className: "dsmm-hint", children: t("rulesHint") }),
|
|
8870
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsx)(Issue, { value: state.rulesIssue, t }),
|
|
8871
|
+
displayUnconfirmed(state) && /* @__PURE__ */ (0, import_jsx_runtime11.jsx)("p", { className: "dsmm-hint", children: t("unconfirmedObservation") }),
|
|
8872
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsx)("p", { className: "dsmm-hint", children: t("observedPolicy") }),
|
|
8873
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsxs)("dl", { className: "dsmm-child-meta", children: [
|
|
8874
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsx)("dt", { children: t("profileOverrideState") }),
|
|
8875
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsx)("dd", { children: t("profileOverrideUnknown") })
|
|
8033
8876
|
] }),
|
|
8034
|
-
/* @__PURE__ */ (0,
|
|
8035
|
-
/* @__PURE__ */ (0,
|
|
8036
|
-
/* @__PURE__ */ (0,
|
|
8037
|
-
/* @__PURE__ */ (0,
|
|
8038
|
-
/* @__PURE__ */ (0,
|
|
8877
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsxs)("dl", { className: "dsmm-child-meta", children: [
|
|
8878
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsx)("dt", { children: t("runtime") }),
|
|
8879
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsx)("dd", { children: value === null ? t("unknown") : t(value.runtime.state) }),
|
|
8880
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsx)("dt", { children: t("mounted") }),
|
|
8881
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsx)("dd", { children: value === null ? t("unknown") : t(value.runtime.mounted ? "on" : "off") })
|
|
8039
8882
|
] }),
|
|
8040
|
-
value?.runtime.restartRequired && /* @__PURE__ */ (0,
|
|
8041
|
-
disabled && !state.reading && !displayUnconfirmed(state) && /* @__PURE__ */ (0,
|
|
8042
|
-
observedPolicy !== null && /* @__PURE__ */ (0,
|
|
8043
|
-
/* @__PURE__ */ (0,
|
|
8044
|
-
/* @__PURE__ */ (0,
|
|
8883
|
+
value?.runtime.restartRequired && /* @__PURE__ */ (0, import_jsx_runtime11.jsx)("p", { children: t("restart") }),
|
|
8884
|
+
disabled && !state.reading && !displayUnconfirmed(state) && /* @__PURE__ */ (0, import_jsx_runtime11.jsx)("p", { className: "dsmm-hint", children: t("rulesUnavailable") }),
|
|
8885
|
+
observedPolicy !== null && /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)("dl", { className: "dsmm-child-meta", children: [
|
|
8886
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsx)("dt", { children: "permissionControl.enabled" }),
|
|
8887
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsxs)("dd", { children: [
|
|
8045
8888
|
t(observedPolicy.policy.enabled ? "on" : "off"),
|
|
8046
8889
|
" · ",
|
|
8047
8890
|
t("coldHint")
|
|
8048
8891
|
] }),
|
|
8049
|
-
/* @__PURE__ */ (0,
|
|
8050
|
-
/* @__PURE__ */ (0,
|
|
8892
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsx)("dt", { children: "permissionControl.nativeCommands.enabled" }),
|
|
8893
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsx)("dd", { children: t(observedPolicy.policy.nativeCommands.enabled ? "on" : "off") })
|
|
8051
8894
|
] }),
|
|
8052
|
-
/* @__PURE__ */ (0,
|
|
8053
|
-
/* @__PURE__ */ (0,
|
|
8054
|
-
/* @__PURE__ */ (0,
|
|
8895
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsxs)("details", { className: "dsmm-deployment-group", children: [
|
|
8896
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsx)("summary", { children: t("coverageDetails") }),
|
|
8897
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsx)(PermissionCoverage, { state, t })
|
|
8055
8898
|
] }),
|
|
8056
|
-
draft2 !== null && /* @__PURE__ */ (0,
|
|
8057
|
-
/* @__PURE__ */ (0,
|
|
8058
|
-
/* @__PURE__ */ (0,
|
|
8059
|
-
/* @__PURE__ */ (0,
|
|
8899
|
+
draft2 !== null && /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)(import_jsx_runtime11.Fragment, { children: [
|
|
8900
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsxs)("div", { className: "dsmm-field", children: [
|
|
8901
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsx)("label", { htmlFor: `${id2}-outside`, children: t("outsideReads") }),
|
|
8902
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsx)(ActionSelect, { id: `${id2}-outside`, value: draft2.outsideReads, disabled, t, onChange: (outsideReads) => controller.edit(state.generation, { outsideReads }) })
|
|
8060
8903
|
] }),
|
|
8061
|
-
["webSearch", "webFetch"].map((key) => /* @__PURE__ */ (0,
|
|
8062
|
-
/* @__PURE__ */ (0,
|
|
8063
|
-
/* @__PURE__ */ (0,
|
|
8064
|
-
/* @__PURE__ */ (0,
|
|
8904
|
+
["webSearch", "webFetch"].map((key) => /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)("fieldset", { children: [
|
|
8905
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsx)("legend", { children: t(key) }),
|
|
8906
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsxs)("label", { className: "dsmm-actions", htmlFor: `${id2}-${key}-enabled`, children: [
|
|
8907
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.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 } }) }),
|
|
8065
8908
|
t("enabled")
|
|
8066
8909
|
] }),
|
|
8067
|
-
/* @__PURE__ */ (0,
|
|
8068
|
-
/* @__PURE__ */ (0,
|
|
8069
|
-
/* @__PURE__ */ (0,
|
|
8910
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsxs)("div", { className: "dsmm-field", children: [
|
|
8911
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsx)("label", { htmlFor: `${id2}-${key}-rule`, children: t("rule") }),
|
|
8912
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsx)(ActionSelect, { id: `${id2}-${key}-rule`, value: draft2[key].rule, disabled, t, onChange: (rule) => controller.edit(state.generation, { [key]: { ...draft2[key], rule } }) })
|
|
8070
8913
|
] })
|
|
8071
8914
|
] }, key)),
|
|
8072
|
-
/* @__PURE__ */ (0,
|
|
8073
|
-
/* @__PURE__ */ (0,
|
|
8074
|
-
(draft2.upsert.length > 0 || draft2.revoke.length > 0) && /* @__PURE__ */ (0,
|
|
8075
|
-
/* @__PURE__ */ (0,
|
|
8076
|
-
draft2.upsert.map((row) => /* @__PURE__ */ (0,
|
|
8077
|
-
/* @__PURE__ */ (0,
|
|
8915
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsx)(import_dsh_client_ui_primitives9.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") }),
|
|
8916
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsx)(RuleEditor, { controller, state, t }),
|
|
8917
|
+
(draft2.upsert.length > 0 || draft2.revoke.length > 0) && /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)("div", { className: "dsmm-structured", children: [
|
|
8918
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsx)("h3", { children: t("staged") }),
|
|
8919
|
+
draft2.upsert.map((row) => /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)("div", { className: "dsmm-field", children: [
|
|
8920
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsxs)("p", { children: [
|
|
8078
8921
|
row.id,
|
|
8079
8922
|
" · ",
|
|
8080
8923
|
t(`kind:${row.match.kind}`),
|
|
8081
8924
|
" · ",
|
|
8082
8925
|
t(`action:${row.action}`)
|
|
8083
8926
|
] }),
|
|
8084
|
-
/* @__PURE__ */ (0,
|
|
8927
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsxs)(import_dsh_client_ui_primitives9.Button, { type: "button", variant: "outline", disabled, onClick: () => controller.edit(state.generation, { upsert: draft2.upsert.filter((rule) => rule.id !== row.id) }), children: [
|
|
8085
8928
|
t("unstage"),
|
|
8086
8929
|
": ",
|
|
8087
8930
|
row.id
|
|
8088
8931
|
] })
|
|
8089
8932
|
] }, row.id)),
|
|
8090
|
-
draft2.revoke.map((ruleId) => /* @__PURE__ */ (0,
|
|
8091
|
-
/* @__PURE__ */ (0,
|
|
8933
|
+
draft2.revoke.map((ruleId) => /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)("div", { className: "dsmm-field", children: [
|
|
8934
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsxs)("p", { children: [
|
|
8092
8935
|
t("stageRevoke"),
|
|
8093
8936
|
": ",
|
|
8094
8937
|
ruleId
|
|
8095
8938
|
] }),
|
|
8096
|
-
/* @__PURE__ */ (0,
|
|
8939
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsxs)(import_dsh_client_ui_primitives9.Button, { type: "button", variant: "outline", disabled, onClick: () => controller.edit(state.generation, { revoke: draft2.revoke.filter((id3) => id3 !== ruleId) }), children: [
|
|
8097
8940
|
t("unstage"),
|
|
8098
8941
|
": ",
|
|
8099
8942
|
ruleId
|
|
@@ -8101,63 +8944,63 @@ function PermissionRulesEditor({ controller, state, t }) {
|
|
|
8101
8944
|
] }, ruleId))
|
|
8102
8945
|
] })
|
|
8103
8946
|
] }),
|
|
8104
|
-
/* @__PURE__ */ (0,
|
|
8105
|
-
/* @__PURE__ */ (0,
|
|
8106
|
-
/* @__PURE__ */ (0,
|
|
8107
|
-
/* @__PURE__ */ (0,
|
|
8108
|
-
/* @__PURE__ */ (0,
|
|
8947
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsx)(RuleRecords, { state, controller, t }),
|
|
8948
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsxs)("div", { className: "dsmm-actions", children: [
|
|
8949
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsx)(import_dsh_client_ui_primitives9.Button, { type: "button", variant: "primary", disabled: !controller.canSave(state.generation), onClick: () => void controller.save(state.generation), children: t("save") }),
|
|
8950
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsx)(import_dsh_client_ui_primitives9.Button, { type: "button", variant: "outline", disabled: !writable || state.reading || state.busy !== null, onClick: () => void controller.refresh(state.generation), children: t("refresh") }),
|
|
8951
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsx)(import_dsh_client_ui_primitives9.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") })
|
|
8109
8952
|
] }),
|
|
8110
|
-
state.dirty && /* @__PURE__ */ (0,
|
|
8953
|
+
state.dirty && /* @__PURE__ */ (0, import_jsx_runtime11.jsx)("p", { children: t("dirty") })
|
|
8111
8954
|
] });
|
|
8112
8955
|
}
|
|
8113
8956
|
function PermissionsPanel({ controller, t, sessionId: sessionId2 }) {
|
|
8114
|
-
const state = (0,
|
|
8115
|
-
(0,
|
|
8116
|
-
if (sessionId2 !== void 0 && sessionId2 !== state.sessionId) return /* @__PURE__ */ (0,
|
|
8117
|
-
return /* @__PURE__ */ (0,
|
|
8118
|
-
/* @__PURE__ */ (0,
|
|
8119
|
-
/* @__PURE__ */ (0,
|
|
8120
|
-
/* @__PURE__ */ (0,
|
|
8957
|
+
const state = (0, import_react9.useSyncExternalStore)(controller.store.subscribe, controller.store.getSnapshot);
|
|
8958
|
+
(0, import_react9.useEffect)(() => controller.watch(), [controller]);
|
|
8959
|
+
if (sessionId2 !== void 0 && sessionId2 !== state.sessionId) return /* @__PURE__ */ (0, import_jsx_runtime11.jsx)("p", { className: "dsmm-hint", role: "status", children: t("rulesUnavailable") });
|
|
8960
|
+
return /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)("section", { className: "dsmm-profiles dsmm-children dsmm-permissions", "data-dsmm-permissions": true, "aria-label": t("title"), "aria-busy": state.reading, children: [
|
|
8961
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsx)("h2", { children: t("title") }),
|
|
8962
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsx)(RootState, { state, t }),
|
|
8963
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsxs)("p", { className: "dsmm-hint", children: [
|
|
8121
8964
|
t("nativeApproval"),
|
|
8122
8965
|
" ",
|
|
8123
8966
|
t("sandboxScope")
|
|
8124
8967
|
] }),
|
|
8125
|
-
/* @__PURE__ */ (0,
|
|
8126
|
-
/* @__PURE__ */ (0,
|
|
8968
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.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) }),
|
|
8969
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsx)(PermissionRulesEditor, { controller, state, t })
|
|
8127
8970
|
] });
|
|
8128
8971
|
}
|
|
8129
8972
|
|
|
8130
8973
|
// src/client/DeploymentPage.tsx
|
|
8131
|
-
var
|
|
8974
|
+
var import_jsx_runtime12 = require("react/jsx-runtime");
|
|
8132
8975
|
function ScopeSave({ controller, workspace, refreshOnly = false, t }) {
|
|
8133
|
-
const state = (0,
|
|
8976
|
+
const state = (0, import_react10.useSyncExternalStore)(controller.subscribe, controller.getSnapshot);
|
|
8134
8977
|
const pending = [...new Set(controller.pendingPaths().map(moduleFor))];
|
|
8135
|
-
return /* @__PURE__ */ (0,
|
|
8136
|
-
/* @__PURE__ */ (0,
|
|
8137
|
-
!refreshOnly && pending.length > 0 && /* @__PURE__ */ (0,
|
|
8978
|
+
return /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)("section", { className: "dsmm-scope-save", "aria-label": t("saveScope"), children: [
|
|
8979
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.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") : "" }),
|
|
8980
|
+
!refreshOnly && pending.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)("p", { children: [
|
|
8138
8981
|
t("pendingModules"),
|
|
8139
8982
|
": ",
|
|
8140
8983
|
pending.map((module2) => t(moduleTitle(module2))).join(" · ")
|
|
8141
8984
|
] }),
|
|
8142
|
-
state.issue !== null && /* @__PURE__ */ (0,
|
|
8143
|
-
!refreshOnly && state.invalidFields.length > 0 && /* @__PURE__ */ (0,
|
|
8144
|
-
controller.layer === "profile" && !controller.canWriteProfile() && /* @__PURE__ */ (0,
|
|
8145
|
-
/* @__PURE__ */ (0,
|
|
8146
|
-
!refreshOnly && /* @__PURE__ */ (0,
|
|
8147
|
-
/* @__PURE__ */ (0,
|
|
8148
|
-
!refreshOnly && /* @__PURE__ */ (0,
|
|
8985
|
+
state.issue !== null && /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("p", { className: "dsmm-issue", role: "alert", children: t(state.issue) }),
|
|
8986
|
+
!refreshOnly && state.invalidFields.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("p", { className: "dsmm-issue", role: "alert", children: t("invalid") }),
|
|
8987
|
+
controller.layer === "profile" && !controller.canWriteProfile() && /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("p", { className: "dsmm-hint", children: t("unavailableForm") }),
|
|
8988
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsxs)("div", { className: "dsmm-actions", children: [
|
|
8989
|
+
!refreshOnly && /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(import_dsh_client_ui_primitives10.Button, { type: "button", variant: "primary", disabled: !controller.canSave(), onClick: () => void (workspace?.save() ?? controller.save()), children: t(controller.layer === "global" ? "saveGlobal" : "saveProfile") }),
|
|
8990
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsx)(import_dsh_client_ui_primitives10.Button, { type: "button", variant: "outline", disabled: state.busy, onClick: () => void controller.refresh(), children: t("refresh") }),
|
|
8991
|
+
!refreshOnly && /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(import_dsh_client_ui_primitives10.Button, { type: "button", variant: "outline", disabled: state.busy || !state.dirty && state.issue === null && !state.refreshRequired, onClick: () => void controller.refresh(true), children: t("discard") })
|
|
8149
8992
|
] })
|
|
8150
8993
|
] });
|
|
8151
8994
|
}
|
|
8152
8995
|
function NativeRuntimeState({ value, t }) {
|
|
8153
|
-
return /* @__PURE__ */ (0,
|
|
8154
|
-
/* @__PURE__ */ (0,
|
|
8155
|
-
/* @__PURE__ */ (0,
|
|
8996
|
+
return /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)("details", { className: "dsmm-availability", children: [
|
|
8997
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsx)("summary", { children: t("nativeRuntimeState") }),
|
|
8998
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsxs)("p", { children: [
|
|
8156
8999
|
t("nativeRuntimeBinding"),
|
|
8157
9000
|
": ",
|
|
8158
9001
|
t(value?.binding === "stock" ? "nativeRuntimeStock" : value?.binding === "unavailable" ? "nativeRuntimeUnavailable" : "unknown")
|
|
8159
9002
|
] }),
|
|
8160
|
-
/* @__PURE__ */ (0,
|
|
9003
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsxs)("p", { children: [
|
|
8161
9004
|
t("nativeRuntimeFence"),
|
|
8162
9005
|
": ",
|
|
8163
9006
|
value === void 0 ? t("unknown") : t(value.deliveryFenceReady ? "on" : "off"),
|
|
@@ -8166,20 +9009,20 @@ function NativeRuntimeState({ value, t }) {
|
|
|
8166
9009
|
": ",
|
|
8167
9010
|
value === void 0 ? t("unknown") : t(value.restartRequired ? "on" : "off")
|
|
8168
9011
|
] }),
|
|
8169
|
-
value?.reason !== void 0 && /* @__PURE__ */ (0,
|
|
9012
|
+
value?.reason !== void 0 && /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("p", { children: t(`nativeRuntimeReason-${value.reason}`) })
|
|
8170
9013
|
] });
|
|
8171
9014
|
}
|
|
8172
9015
|
function StateInspector({ controller, t }) {
|
|
8173
|
-
const { snapshot: snapshot4, session, dirty, issue } = (0,
|
|
8174
|
-
if (snapshot4 === null) return /* @__PURE__ */ (0,
|
|
9016
|
+
const { snapshot: snapshot4, session, dirty, issue } = (0, import_react10.useSyncExternalStore)(controller.subscribe, controller.getSnapshot);
|
|
9017
|
+
if (snapshot4 === null) return /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("p", { children: t("unavailable") });
|
|
8175
9018
|
const admitted = session?.configuration ?? null;
|
|
8176
9019
|
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");
|
|
8177
9020
|
const value = (layer, path) => layer === void 0 ? t("unknown") : at(layer, path.split(".")) === void 0 ? t("absent") : displayValue(at(layer, path.split(".")), t);
|
|
8178
9021
|
const restart = (snapshot4.nextRoot?.restartRequired ?? []).filter((path) => visibleDeploymentPath(path.split(".")));
|
|
8179
|
-
return /* @__PURE__ */ (0,
|
|
8180
|
-
/* @__PURE__ */ (0,
|
|
8181
|
-
(dirty || issue !== null) && /* @__PURE__ */ (0,
|
|
8182
|
-
/* @__PURE__ */ (0,
|
|
9022
|
+
return /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)("div", { className: "dsmm-structured", children: [
|
|
9023
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsx)("p", { role: "status", children: session === null ? t("noSession") : admitted === null ? t("sessionUnavailable") : t("sessionObserved") }),
|
|
9024
|
+
(dirty || issue !== null) && /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("p", { className: "dsmm-hint", children: t("inspectorStale") }),
|
|
9025
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsxs)("p", { children: [
|
|
8183
9026
|
t("globalSource"),
|
|
8184
9027
|
": ",
|
|
8185
9028
|
t(configurationVersionState(snapshot4.globalRevision)),
|
|
@@ -8188,52 +9031,52 @@ function StateInspector({ controller, t }) {
|
|
|
8188
9031
|
": ",
|
|
8189
9032
|
t(configurationVersionState(snapshot4.nativeRevision))
|
|
8190
9033
|
] }),
|
|
8191
|
-
snapshot4.subagentRuntime !== void 0 && /* @__PURE__ */ (0,
|
|
8192
|
-
snapshot4.modules.map((module2) => /* @__PURE__ */ (0,
|
|
8193
|
-
/* @__PURE__ */ (0,
|
|
8194
|
-
/* @__PURE__ */ (0,
|
|
9034
|
+
snapshot4.subagentRuntime !== void 0 && /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(NativeRuntimeState, { value: snapshot4.subagentRuntime, t }),
|
|
9035
|
+
snapshot4.modules.map((module2) => /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)("section", { className: "dsmm-zone", children: [
|
|
9036
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsx)("h3", { children: module2.descriptor.label }),
|
|
9037
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsxs)("p", { children: [
|
|
8195
9038
|
t("desired"),
|
|
8196
9039
|
": ",
|
|
8197
9040
|
t(module2.desired.enabled ? "on" : "off"),
|
|
8198
9041
|
" · ",
|
|
8199
9042
|
source(module2.desired.source)
|
|
8200
9043
|
] }),
|
|
8201
|
-
/* @__PURE__ */ (0,
|
|
9044
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsxs)("p", { children: [
|
|
8202
9045
|
t("startup"),
|
|
8203
9046
|
": ",
|
|
8204
9047
|
module2.startupMounted == null ? t("unknown") : t(module2.startupMounted ? "on" : "off")
|
|
8205
9048
|
] }),
|
|
8206
|
-
/* @__PURE__ */ (0,
|
|
9049
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsxs)("p", { children: [
|
|
8207
9050
|
t("next"),
|
|
8208
9051
|
": ",
|
|
8209
9052
|
module2.nextRoot.admitted == null ? t("unknown") : t(module2.nextRoot.admitted ? "on" : "off")
|
|
8210
9053
|
] }),
|
|
8211
|
-
module2.pending && /* @__PURE__ */ (0,
|
|
9054
|
+
module2.pending && /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("p", { children: t("pending") })
|
|
8212
9055
|
] }, module2.descriptor.id)),
|
|
8213
|
-
inspectorPaths(snapshot4, admitted).map((path) => /* @__PURE__ */ (0,
|
|
8214
|
-
/* @__PURE__ */ (0,
|
|
8215
|
-
/* @__PURE__ */ (0,
|
|
9056
|
+
inspectorPaths(snapshot4, admitted).map((path) => /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)("dl", { className: "dsmm-deployment-state", children: [
|
|
9057
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsx)("dt", { children: path }),
|
|
9058
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsxs)("dd", { children: [
|
|
8216
9059
|
t("desired"),
|
|
8217
9060
|
": ",
|
|
8218
9061
|
value(snapshot4.desired, path),
|
|
8219
9062
|
" · ",
|
|
8220
9063
|
source(snapshot4.sources[path])
|
|
8221
9064
|
] }),
|
|
8222
|
-
/* @__PURE__ */ (0,
|
|
9065
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsxs)("dd", { children: [
|
|
8223
9066
|
t("startup"),
|
|
8224
9067
|
": ",
|
|
8225
9068
|
value(snapshot4.startup, path),
|
|
8226
9069
|
" · ",
|
|
8227
9070
|
source(snapshot4.startupSources?.[path])
|
|
8228
9071
|
] }),
|
|
8229
|
-
/* @__PURE__ */ (0,
|
|
9072
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsxs)("dd", { children: [
|
|
8230
9073
|
t("next"),
|
|
8231
9074
|
": ",
|
|
8232
9075
|
value(snapshot4.nextRoot?.settings, path),
|
|
8233
9076
|
" · ",
|
|
8234
9077
|
source(snapshot4.nextRoot?.sources[path])
|
|
8235
9078
|
] }),
|
|
8236
|
-
/* @__PURE__ */ (0,
|
|
9079
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsxs)("dd", { children: [
|
|
8237
9080
|
t("session"),
|
|
8238
9081
|
": ",
|
|
8239
9082
|
value(admitted?.settings, path),
|
|
@@ -8241,7 +9084,7 @@ function StateInspector({ controller, t }) {
|
|
|
8241
9084
|
source(admitted?.sources[path])
|
|
8242
9085
|
] })
|
|
8243
9086
|
] }, path)),
|
|
8244
|
-
restart.length > 0 && /* @__PURE__ */ (0,
|
|
9087
|
+
restart.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)("p", { children: [
|
|
8245
9088
|
t("pending"),
|
|
8246
9089
|
": ",
|
|
8247
9090
|
restart.join(", ")
|
|
@@ -8250,30 +9093,30 @@ function StateInspector({ controller, t }) {
|
|
|
8250
9093
|
}
|
|
8251
9094
|
function DeploymentPage(props) {
|
|
8252
9095
|
const workspace = props.workspace ?? deploymentWorkspace(props.core, props.permissions);
|
|
8253
|
-
const navigation = (0,
|
|
8254
|
-
const core = (0,
|
|
9096
|
+
const navigation = (0, import_react10.useSyncExternalStore)(workspace.subscribe, workspace.getSnapshot);
|
|
9097
|
+
const core = (0, import_react10.useSyncExternalStore)(props.core.subscribe, props.core.getSnapshot);
|
|
8255
9098
|
const controller = workspace.controller() ?? props.core;
|
|
8256
|
-
const state = (0,
|
|
8257
|
-
const id2 = (0,
|
|
8258
|
-
const scopeControl = (0,
|
|
8259
|
-
const resume = (0,
|
|
8260
|
-
const disclosures = (0,
|
|
9099
|
+
const state = (0, import_react10.useSyncExternalStore)(controller.subscribe, controller.getSnapshot);
|
|
9100
|
+
const id2 = (0, import_react10.useId)(), heading = (0, import_react10.useRef)(null), triggers = (0, import_react10.useRef)(/* @__PURE__ */ new Map()), previous = (0, import_react10.useRef)(null);
|
|
9101
|
+
const scopeControl = (0, import_react10.useRef)(null), confirmation = (0, import_react10.useRef)(null);
|
|
9102
|
+
const resume = (0, import_react10.useRef)(null);
|
|
9103
|
+
const disclosures = (0, import_react10.useRef)({ global: /* @__PURE__ */ new Map(), profile: /* @__PURE__ */ new Map() });
|
|
8261
9104
|
const { t } = props, snapshot4 = state.snapshot ?? core.snapshot, active = navigation.module;
|
|
8262
|
-
(0,
|
|
9105
|
+
(0, import_react10.useEffect)(() => {
|
|
8263
9106
|
if (props.view === "page") void props.core.refresh();
|
|
8264
9107
|
}, [props.core, props.view]);
|
|
8265
|
-
(0,
|
|
9108
|
+
(0, import_react10.useEffect)(() => {
|
|
8266
9109
|
if (props.forms !== void 0) workspace.bindForms(props.forms);
|
|
8267
9110
|
}, [workspace, props.forms]);
|
|
8268
|
-
(0,
|
|
9111
|
+
(0, import_react10.useEffect)(() => {
|
|
8269
9112
|
if (navigation.module === null && core.snapshot !== null) workspace.request({ scope: navigation.scope, module: null });
|
|
8270
9113
|
}, [core.snapshot, navigation.module, navigation.scope, workspace]);
|
|
8271
|
-
(0,
|
|
9114
|
+
(0, import_react10.useEffect)(() => {
|
|
8272
9115
|
if (active !== null) heading.current?.focus();
|
|
8273
9116
|
else if (previous.current !== null) triggers.current.get(previous.current)?.focus();
|
|
8274
9117
|
previous.current = active;
|
|
8275
9118
|
}, [active]);
|
|
8276
|
-
(0,
|
|
9119
|
+
(0, import_react10.useEffect)(() => {
|
|
8277
9120
|
if (navigation.pending !== null) {
|
|
8278
9121
|
resume.current = { element: document.activeElement, scope: navigation.scope, module: active };
|
|
8279
9122
|
confirmation.current?.focus();
|
|
@@ -8286,7 +9129,7 @@ function DeploymentPage(props) {
|
|
|
8286
9129
|
else if (from2.scope !== navigation.scope) scopeControl.current?.focus();
|
|
8287
9130
|
}
|
|
8288
9131
|
}, [navigation.pending, navigation.scope, active]);
|
|
8289
|
-
if (props.view === "summary") return /* @__PURE__ */ (0,
|
|
9132
|
+
if (props.view === "summary") return /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("span", { children: t("summary") });
|
|
8290
9133
|
const fields = snapshot4 === null || active === null ? [] : moduleFields(scopeSchema(snapshot4, controller.layer), active, controller.layer);
|
|
8291
9134
|
const tabs = NAVIGATION_MODULES.filter((module2) => module2 !== "other" || snapshot4 === null || moduleFields(snapshot4.schema, "other", "global").length + moduleFields(scopeSchema(snapshot4, "profile"), "other", "profile").length > 0);
|
|
8292
9135
|
const select = (module2) => workspace.request({ scope: navigation.scope, module: module2 });
|
|
@@ -8302,23 +9145,23 @@ function DeploymentPage(props) {
|
|
|
8302
9145
|
else return;
|
|
8303
9146
|
event.preventDefault();
|
|
8304
9147
|
};
|
|
8305
|
-
const scopeActions = /* @__PURE__ */ (0,
|
|
8306
|
-
return /* @__PURE__ */ (0,
|
|
8307
|
-
/* @__PURE__ */ (0,
|
|
8308
|
-
/* @__PURE__ */ (0,
|
|
8309
|
-
/* @__PURE__ */ (0,
|
|
8310
|
-
/* @__PURE__ */ (0,
|
|
9148
|
+
const scopeActions = /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(ScopeSave, { controller: active === "state" ? props.core : controller, workspace, refreshOnly: active === "state" || workspace.controller() === null, t });
|
|
9149
|
+
return /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)("section", { className: "dsmm-profiles dsmm-deployment", "data-dsmm-page": true, "aria-label": t("title"), children: [
|
|
9150
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsx)("p", { className: "dsmm-hint", children: t("boundaries") }),
|
|
9151
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsxs)("div", { className: "dsmm-field", children: [
|
|
9152
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsx)("label", { htmlFor: `${id2}-scope`, children: t("scope") }),
|
|
9153
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsxs)("select", { ref: scopeControl, id: `${id2}-scope`, value: navigation.scope, disabled: state.busy || navigation.pending !== null, onChange: (event) => {
|
|
8311
9154
|
const scope = event.currentTarget.value;
|
|
8312
9155
|
if (scope === "global" || scope === "profile") workspace.request({ scope, module: null });
|
|
8313
9156
|
}, children: [
|
|
8314
|
-
/* @__PURE__ */ (0,
|
|
8315
|
-
/* @__PURE__ */ (0,
|
|
9157
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsx)("option", { value: "global", children: t("global") }),
|
|
9158
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsx)("option", { value: "profile", children: t("profile") })
|
|
8316
9159
|
] })
|
|
8317
9160
|
] }),
|
|
8318
|
-
/* @__PURE__ */ (0,
|
|
8319
|
-
navigation.scope === "profile" && (navigation.native === null || !navigation.native.canWriteProfile()) && /* @__PURE__ */ (0,
|
|
8320
|
-
/* @__PURE__ */ (0,
|
|
8321
|
-
|
|
9161
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsx)("p", { className: "dsmm-hint", children: t(navigation.scope === "global" ? "globalHint" : "profileHint") }),
|
|
9162
|
+
navigation.scope === "profile" && (navigation.native === null || !navigation.native.canWriteProfile()) && /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("p", { className: "dsmm-hint", children: t("unavailableForm") }),
|
|
9163
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsx)("div", { className: "dsmm-section-tabs", role: "tablist", "aria-label": t("modules"), children: tabs.map((module2, index) => /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
|
|
9164
|
+
import_dsh_client_ui_primitives10.Button,
|
|
8322
9165
|
{
|
|
8323
9166
|
ref: (element) => {
|
|
8324
9167
|
if (element !== null) triggers.current.set(module2, element);
|
|
@@ -8337,32 +9180,32 @@ function DeploymentPage(props) {
|
|
|
8337
9180
|
},
|
|
8338
9181
|
module2
|
|
8339
9182
|
)) }),
|
|
8340
|
-
active !== null && /* @__PURE__ */ (0,
|
|
8341
|
-
/* @__PURE__ */ (0,
|
|
8342
|
-
active === "state" ? /* @__PURE__ */ (0,
|
|
8343
|
-
/* @__PURE__ */ (0,
|
|
9183
|
+
active !== null && /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)("section", { id: `${id2}-panel`, role: "tabpanel", className: "dsmm-section-panel", "aria-labelledby": `${id2}-tab-${active}`, "data-dsmm-module": active, children: [
|
|
9184
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsx)("div", { className: "dsmm-panel-heading", children: /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("h2", { id: `${id2}-heading`, ref: heading, tabIndex: -1, children: t(moduleTitle(active)) }) }),
|
|
9185
|
+
active === "state" ? /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)(import_jsx_runtime12.Fragment, { children: [
|
|
9186
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsx)(StateInspector, { controller: props.core, t }),
|
|
8344
9187
|
scopeActions
|
|
8345
|
-
] }) : /* @__PURE__ */ (0,
|
|
8346
|
-
navigation.scope === "profile" && navigation.native === null ? /* @__PURE__ */ (0,
|
|
8347
|
-
fields.length === 0 && /* @__PURE__ */ (0,
|
|
8348
|
-
fields.map(([key, schema]) => /* @__PURE__ */ (0,
|
|
8349
|
-
active === "run" && controller.layer === "profile" && /* @__PURE__ */ (0,
|
|
9188
|
+
] }) : /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)(import_jsx_runtime12.Fragment, { children: [
|
|
9189
|
+
navigation.scope === "profile" && navigation.native === null ? /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("p", { children: t("unavailableForm") }) : state.snapshot === null ? /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("p", { children: t(state.busy ? "loading" : "unavailable") }) : /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)("div", { "data-dsmm-layer": controller.layer, "aria-busy": state.busy, className: "dsmm-structured", children: [
|
|
9190
|
+
fields.length === 0 && /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("p", { className: "dsmm-hint", children: t("noModuleFields") }),
|
|
9191
|
+
fields.map(([key, schema]) => /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(Field, { schema, path: [key], controller, initiallyOpen: fields.length === 1 && active !== "permissions", disclosures: disclosures.current[navigation.scope], t }, `${navigation.scope}:${key}`)),
|
|
9192
|
+
active === "run" && controller.layer === "profile" && /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(NativeRuntimeState, { value: state.snapshot.subagentRuntime, t })
|
|
8350
9193
|
] }),
|
|
8351
9194
|
scopeActions,
|
|
8352
|
-
active === "permissions" && /* @__PURE__ */ (0,
|
|
9195
|
+
active === "permissions" && /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("section", { className: "dsmm-zone dsmm-rules-transaction", "aria-label": t("rootRules"), children: workspace.permissions === void 0 ? /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("p", { children: t("rootRulesUnavailable") }) : /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(PermissionsPanel, { controller: workspace.permissions, t: props.permissionsT ?? ((key) => Object.hasOwn(permissionEn, key) ? permissionText(t)(key) : key) }) })
|
|
8353
9196
|
] })
|
|
8354
9197
|
] }),
|
|
8355
|
-
navigation.pending !== null && /* @__PURE__ */ (0,
|
|
9198
|
+
navigation.pending !== null && /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)("section", { className: "dsmm-confirm", role: "group", "aria-label": t("leaveDraft"), onKeyDown: (event) => {
|
|
8356
9199
|
if (event.key === "Escape" && !event.defaultPrevented) {
|
|
8357
9200
|
event.preventDefault();
|
|
8358
9201
|
workspace.continueEditing();
|
|
8359
9202
|
}
|
|
8360
9203
|
}, children: [
|
|
8361
|
-
/* @__PURE__ */ (0,
|
|
8362
|
-
/* @__PURE__ */ (0,
|
|
8363
|
-
/* @__PURE__ */ (0,
|
|
8364
|
-
/* @__PURE__ */ (0,
|
|
8365
|
-
/* @__PURE__ */ (0,
|
|
9204
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsx)("p", { children: t("leaveDraft") }),
|
|
9205
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsxs)("div", { className: "dsmm-actions", children: [
|
|
9206
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsx)(import_dsh_client_ui_primitives10.Button, { ref: confirmation, type: "button", variant: "primary", onClick: () => workspace.continueEditing(), children: t("continueEditing") }),
|
|
9207
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsx)(import_dsh_client_ui_primitives10.Button, { type: "button", variant: "outline", onClick: () => workspace.keepAndNavigate(), children: t("keepDraft") }),
|
|
9208
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsx)(import_dsh_client_ui_primitives10.Button, { type: "button", variant: "outline", disabled: state.busy, onClick: () => void workspace.discardAndNavigate(), children: t("discardDraft") })
|
|
8366
9209
|
] })
|
|
8367
9210
|
] })
|
|
8368
9211
|
] });
|
|
@@ -8609,7 +9452,8 @@ function bindPermissionSession(source, sessions, permissions) {
|
|
|
8609
9452
|
}
|
|
8610
9453
|
|
|
8611
9454
|
// src/client/RoleToolView.tsx
|
|
8612
|
-
var
|
|
9455
|
+
var import_react11 = require("react");
|
|
9456
|
+
var import_dsh_client_ui_primitives11 = require("@deepseek-ai/dsh-client-ui-primitives");
|
|
8613
9457
|
|
|
8614
9458
|
// src/client/RoleToolView-data.ts
|
|
8615
9459
|
var roleToolKeys = {
|
|
@@ -8667,6 +9511,49 @@ function actualRoleTool(toolName, meta, failed) {
|
|
|
8667
9511
|
function roleToolDisplay(target) {
|
|
8668
9512
|
return target.slice("dsmm-".length).split("-").map((word) => word.charAt(0).toUpperCase() + word.slice(1)).join(" ");
|
|
8669
9513
|
}
|
|
9514
|
+
function technicalTableRows(toolName, callId, rawArgs, meta, routeSource) {
|
|
9515
|
+
const rows = [];
|
|
9516
|
+
rows.push({ property: "toolName", value: toolName, isComplex: false });
|
|
9517
|
+
rows.push({ property: "callId", value: callId, isComplex: false });
|
|
9518
|
+
if (routeSource !== void 0) {
|
|
9519
|
+
rows.push({ property: "routeSource", value: routeSource, isComplex: false });
|
|
9520
|
+
}
|
|
9521
|
+
const argsObj = roleToolArguments(rawArgs);
|
|
9522
|
+
if (argsObj !== void 0) {
|
|
9523
|
+
for (const [k, v] of Object.entries(argsObj)) {
|
|
9524
|
+
const isComplex = typeof v === "object" && v !== null;
|
|
9525
|
+
rows.push({ property: `args.${k}`, value: v, isComplex });
|
|
9526
|
+
}
|
|
9527
|
+
} else if (rawArgs !== "") {
|
|
9528
|
+
rows.push({ property: "args", value: rawArgs, isComplex: false });
|
|
9529
|
+
}
|
|
9530
|
+
if (meta !== void 0 && meta !== null) {
|
|
9531
|
+
if (typeof meta === "object" && !Array.isArray(meta)) {
|
|
9532
|
+
for (const [k, v] of Object.entries(meta)) {
|
|
9533
|
+
const isComplex = typeof v === "object" && v !== null;
|
|
9534
|
+
rows.push({ property: `meta.${k}`, value: v, isComplex });
|
|
9535
|
+
}
|
|
9536
|
+
} else {
|
|
9537
|
+
rows.push({ property: "meta", value: meta, isComplex: typeof meta === "object" });
|
|
9538
|
+
}
|
|
9539
|
+
}
|
|
9540
|
+
return rows;
|
|
9541
|
+
}
|
|
9542
|
+
function technicalJsonData(toolName, callId, rawArgs, meta, routeSource) {
|
|
9543
|
+
const parsedArgs = roleToolArguments(rawArgs);
|
|
9544
|
+
const data = {
|
|
9545
|
+
toolName,
|
|
9546
|
+
callId
|
|
9547
|
+
};
|
|
9548
|
+
if (routeSource !== void 0) {
|
|
9549
|
+
data.routeSource = routeSource;
|
|
9550
|
+
}
|
|
9551
|
+
data.args = parsedArgs !== void 0 ? parsedArgs : rawArgs;
|
|
9552
|
+
if (meta !== void 0 && meta !== null) {
|
|
9553
|
+
data.meta = meta;
|
|
9554
|
+
}
|
|
9555
|
+
return data;
|
|
9556
|
+
}
|
|
8670
9557
|
|
|
8671
9558
|
// src/client/RoleToolView-locales.ts
|
|
8672
9559
|
var ROLE_TOOL_NS = "conversation.dsmm-role-tool";
|
|
@@ -8699,7 +9586,12 @@ var roleToolEn = {
|
|
|
8699
9586
|
unavailable: "Actual identity unavailable; requested identity only",
|
|
8700
9587
|
level: "Level",
|
|
8701
9588
|
route: "Reported route",
|
|
8702
|
-
routeSource: "Route source"
|
|
9589
|
+
routeSource: "Route source",
|
|
9590
|
+
table: "Table",
|
|
9591
|
+
json: "JSON",
|
|
9592
|
+
viewMode: "View mode",
|
|
9593
|
+
property: "Property",
|
|
9594
|
+
value: "Value"
|
|
8703
9595
|
};
|
|
8704
9596
|
var roleToolZh = {
|
|
8705
9597
|
call: "调用",
|
|
@@ -8730,17 +9622,24 @@ var roleToolZh = {
|
|
|
8730
9622
|
unavailable: "实际身份不可用,仅显示请求身份",
|
|
8731
9623
|
level: "等级",
|
|
8732
9624
|
route: "报告的路由",
|
|
8733
|
-
routeSource: "路由来源"
|
|
9625
|
+
routeSource: "路由来源",
|
|
9626
|
+
table: "表格",
|
|
9627
|
+
json: "JSON",
|
|
9628
|
+
viewMode: "视图模式",
|
|
9629
|
+
property: "属性",
|
|
9630
|
+
value: "值"
|
|
8734
9631
|
};
|
|
8735
9632
|
|
|
8736
9633
|
// src/client/RoleToolView.tsx
|
|
8737
|
-
var
|
|
9634
|
+
var import_jsx_runtime13 = require("react/jsx-runtime");
|
|
8738
9635
|
var styles = `
|
|
8739
9636
|
.dsmm-role-tool{min-width:0;color:var(--dsw-alias-label-primary);font-family:var(--dsw-font-family);font-size:14px;line-height:22px}
|
|
8740
9637
|
.dsmm-role-tool .dsmm-role-heading{color:var(--dsw-alias-label-primary);height:auto;min-height:32px}
|
|
8741
|
-
.dsmm-role-tool .dsmm-role-title{white-space:
|
|
8742
|
-
.dsmm-role-tool
|
|
8743
|
-
.dsmm-role-tool .dsmm-role-
|
|
9638
|
+
.dsmm-role-tool .dsmm-role-title{white-space:nowrap;flex:none;color:inherit;font-size:inherit;line-height:inherit}
|
|
9639
|
+
.dsmm-role-tool .dsmm-role-text{display:inline-flex;align-items:center;min-width:0;flex:1;overflow:hidden}
|
|
9640
|
+
.dsmm-role-tool .dsmm-role-sep{background:var(--dsw-alias-label-caption);border-radius:1px;flex:none;width:2px;height:2px;margin:0 8px}
|
|
9641
|
+
.dsmm-role-tool .dsmm-role-summary{text-overflow:ellipsis;white-space:nowrap;min-width:0;font-size:var(--dsh-content-font-size-secondary,13px);line-height:calc(24px + var(--dsh-content-font-delta,0px));flex:auto;overflow:hidden;color:var(--dsw-alias-label-secondary)}
|
|
9642
|
+
.dsmm-role-tool .dsmm-role-icon{flex:none;color:inherit}
|
|
8744
9643
|
.dsmm-role-tool .dsmm-role-body{display:flex;flex-direction:column;gap:8px;min-width:0;padding:8px 0}
|
|
8745
9644
|
.dsmm-role-tool p{margin:0;white-space:pre-wrap;overflow-wrap:anywhere}
|
|
8746
9645
|
.dsmm-role-tool .dsmm-role-status{color:var(--dsw-alias-label-secondary)}
|
|
@@ -8752,6 +9651,15 @@ var styles = `
|
|
|
8752
9651
|
.dsmm-role-tool .dsmm-role-details{border-top:1px solid var(--dsw-alias-border-l2);padding-top:8px;margin-top:4px}
|
|
8753
9652
|
.dsmm-role-tool .dsmm-role-details summary{cursor:pointer;color:var(--dsw-alias-label-secondary);font-size:12px;line-height:18px;user-select:none}
|
|
8754
9653
|
.dsmm-role-tool .dsmm-role-details-body{display:flex;flex-direction:column;gap:8px;margin-top:8px;padding-left:8px}
|
|
9654
|
+
.dsmm-role-tool .dsmm-role-details-header{display:flex;align-items:center;margin-bottom:4px}
|
|
9655
|
+
.dsmm-role-tool .dsmm-role-view-switch{margin-bottom:4px}
|
|
9656
|
+
.dsmm-role-tool .dsmm-role-table{width:100%;border-collapse:collapse;font-size:12px;line-height:18px;margin-top:4px}
|
|
9657
|
+
.dsmm-role-tool .dsmm-role-table th,.dsmm-role-tool .dsmm-role-table td{padding:4px 8px;text-align:left;vertical-align:top;border-bottom:1px solid var(--dsw-alias-border-l1)}
|
|
9658
|
+
.dsmm-role-tool .dsmm-role-table th{color:var(--dsw-alias-label-secondary);font-weight:500;border-bottom:1px solid var(--dsw-alias-border-l2)}
|
|
9659
|
+
.dsmm-role-tool .dsmm-role-prop-cell{color:var(--dsw-alias-label-secondary);font-family:var(--dsw-font-family-code,monospace);word-break:break-all;width:35%;max-width:180px}
|
|
9660
|
+
.dsmm-role-tool .dsmm-role-val-cell{color:var(--dsw-alias-label-primary);word-break:break-word}
|
|
9661
|
+
.dsmm-role-tool .dsmm-role-cell-text{white-space:pre-wrap;overflow-wrap:anywhere;word-break:break-word}
|
|
9662
|
+
.dsmm-role-tool .dsmm-role-cell-code{margin:0;font-family:var(--dsw-font-family-code,monospace);font-size:11px;line-height:16px;white-space:pre-wrap;word-break:break-all;background:var(--dsw-alias-bg-layer-2,rgba(0,0,0,0.04));padding:4px 6px;border-radius:4px}
|
|
8755
9663
|
.dsmm-role-tool :is(button,[role=button],summary):focus-visible{outline:var(--dsw-focus-ring-width,2px) solid var(--dsw-focus-ring-color,var(--dsw-alias-state-business-primary));outline-offset:2px}
|
|
8756
9664
|
`;
|
|
8757
9665
|
function RoleToolView(props) {
|
|
@@ -8768,56 +9676,73 @@ function RoleToolView(props) {
|
|
|
8768
9676
|
const targetLabel = target === void 0 ? t("unknownTarget") : roleToolDisplay(target);
|
|
8769
9677
|
const rawDesc = requested.description?.trim();
|
|
8770
9678
|
const singleLineDesc = rawDesc ? rawDesc.replace(/\s+/gu, " ") : void 0;
|
|
8771
|
-
const title =
|
|
9679
|
+
const title = `${action2} ${targetLabel}`;
|
|
8772
9680
|
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";
|
|
8773
|
-
const
|
|
9681
|
+
const isOngoing = state === "running" || props.phase === "preparing";
|
|
9682
|
+
const code = (value) => /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(import_dsh_client_ui_primitives11.CodeBlock, { code: value, copyLabel: t("copy"), copiedLabel: t("copied") });
|
|
9683
|
+
const [viewMode, setViewMode] = (0, import_react11.useState)("table");
|
|
9684
|
+
const controlId = `dsmm-tech-${props.callId || "call"}`;
|
|
9685
|
+
const viewOptions = [
|
|
9686
|
+
{ value: "table", label: t("table") },
|
|
9687
|
+
{ value: "json", label: t("json") }
|
|
9688
|
+
];
|
|
9689
|
+
const tableRows = technicalTableRows(props.toolName, props.callId, raw, result?.meta, actual?.routeSource);
|
|
9690
|
+
const jsonData2 = technicalJsonData(props.toolName, props.callId, raw, result?.meta, actual?.routeSource);
|
|
8774
9691
|
const roleDiffers = requested.target !== void 0 && actual !== void 0 && actual.role !== requested.target;
|
|
8775
9692
|
const levelDiffers = requested.level !== void 0 && actual !== void 0 && actual.level !== requested.level;
|
|
8776
9693
|
const showRequestedVsActual = roleDiffers || levelDiffers;
|
|
8777
|
-
|
|
8778
|
-
/* @__PURE__ */ (0,
|
|
8779
|
-
|
|
9694
|
+
const collapsedContent = singleLineDesc ? /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)(import_jsx_runtime13.Fragment, { children: [
|
|
9695
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)("span", { className: "dsmm-role-sep", "aria-hidden": "true" }),
|
|
9696
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)("span", { className: "dsmm-role-summary", children: /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(import_dsh_client_ui_primitives11.TextShimmer, { active: isOngoing, children: singleLineDesc }) })
|
|
9697
|
+
] }) : void 0;
|
|
9698
|
+
const stateDotState = state === "error" ? "error" : state === "stopped" ? "warning" : result === void 0 ? "ongoing" : state === "background" ? "idle" : "done";
|
|
9699
|
+
return /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)("div", { className: "dsmm-role-tool", "data-dsmm-role-tool": props.toolName, "data-identity": actual === void 0 ? "requested" : "actual", "data-state": state, "data-expanded": expanded ? "true" : "false", children: [
|
|
9700
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
|
|
9701
|
+
import_dsh_client_ui_primitives11.DisclosureRow,
|
|
8780
9702
|
{
|
|
8781
9703
|
title,
|
|
8782
9704
|
titleClassName: "dsmm-role-title",
|
|
8783
9705
|
rowClassName: "dsmm-role-heading",
|
|
8784
9706
|
contentClassName: "dsmm-role-text",
|
|
8785
|
-
icon: /* @__PURE__ */ (0,
|
|
9707
|
+
icon: /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(import_dsh_client_ui_primitives11.IconAgentPresetOutlineRegular, { size: 14, className: "dsmm-role-icon" }),
|
|
9708
|
+
collapsedContent,
|
|
9709
|
+
keepContentWhenOpen: true,
|
|
9710
|
+
running: isOngoing,
|
|
8786
9711
|
open: expanded,
|
|
8787
9712
|
expandable: true,
|
|
8788
9713
|
onToggle: toggle,
|
|
8789
9714
|
expandOnRowClick: true,
|
|
8790
|
-
children: /* @__PURE__ */ (0,
|
|
8791
|
-
/* @__PURE__ */ (0,
|
|
8792
|
-
showRequestedVsActual ? /* @__PURE__ */ (0,
|
|
8793
|
-
/* @__PURE__ */ (0,
|
|
9715
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)("div", { className: "dsmm-role-body", children: [
|
|
9716
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsxs)("p", { className: "dsmm-role-identity", children: [
|
|
9717
|
+
showRequestedVsActual ? /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)(import_jsx_runtime13.Fragment, { children: [
|
|
9718
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsxs)("span", { className: "dsmm-role-dim", children: [
|
|
8794
9719
|
t("requested"),
|
|
8795
9720
|
": "
|
|
8796
9721
|
] }),
|
|
8797
|
-
/* @__PURE__ */ (0,
|
|
9722
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsxs)("span", { children: [
|
|
8798
9723
|
requested.target === void 0 ? t("unknown") : roleToolDisplay(requested.target),
|
|
8799
9724
|
requested.level ? ` (${requested.level})` : ""
|
|
8800
9725
|
] }),
|
|
8801
|
-
/* @__PURE__ */ (0,
|
|
8802
|
-
/* @__PURE__ */ (0,
|
|
9726
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)("span", { className: "dsmm-role-dim", children: " → " }),
|
|
9727
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsxs)("span", { className: "dsmm-role-dim", children: [
|
|
8803
9728
|
t("actual"),
|
|
8804
9729
|
": "
|
|
8805
9730
|
] }),
|
|
8806
|
-
/* @__PURE__ */ (0,
|
|
9731
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsxs)("span", { children: [
|
|
8807
9732
|
roleToolDisplay(actual.role),
|
|
8808
9733
|
" (",
|
|
8809
9734
|
actual.level,
|
|
8810
9735
|
")"
|
|
8811
9736
|
] })
|
|
8812
|
-
] }) : /* @__PURE__ */ (0,
|
|
9737
|
+
] }) : /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)("span", { children: [
|
|
8813
9738
|
actual !== void 0 ? roleToolDisplay(actual.role) : requested.target === void 0 ? t("unknownTarget") : roleToolDisplay(requested.target),
|
|
8814
9739
|
(actual?.level ?? requested.level) !== void 0 && ` · ${actual?.level ?? requested.level}`,
|
|
8815
|
-
result !== void 0 && actual === void 0 && /* @__PURE__ */ (0,
|
|
9740
|
+
result !== void 0 && actual === void 0 && /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)("span", { className: "dsmm-role-dim", children: [
|
|
8816
9741
|
" · ",
|
|
8817
9742
|
t("actualUnknown")
|
|
8818
9743
|
] })
|
|
8819
9744
|
] }),
|
|
8820
|
-
actual?.route !== void 0 && /* @__PURE__ */ (0,
|
|
9745
|
+
actual?.route !== void 0 && /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)("span", { className: "dsmm-role-model", children: [
|
|
8821
9746
|
" · ",
|
|
8822
9747
|
actual.route.provider,
|
|
8823
9748
|
"/",
|
|
@@ -8825,44 +9750,35 @@ function RoleToolView(props) {
|
|
|
8825
9750
|
actual.route.reasoningEffort ? ` · ${actual.route.reasoningEffort}` : ""
|
|
8826
9751
|
] })
|
|
8827
9752
|
] }),
|
|
8828
|
-
requested.description !== void 0 && /* @__PURE__ */ (0,
|
|
8829
|
-
result?.error != null && /* @__PURE__ */ (0,
|
|
8830
|
-
/* @__PURE__ */ (0,
|
|
9753
|
+
requested.description !== void 0 && /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("p", { className: "dsmm-role-task", children: requested.description }),
|
|
9754
|
+
result?.error != null && /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)("div", { className: "dsmm-role-failure", children: [
|
|
9755
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)("p", { className: "dsmm-role-section-title", children: t("failure") }),
|
|
8831
9756
|
code(JSON.stringify(result.error, null, 2))
|
|
8832
9757
|
] }),
|
|
8833
|
-
|
|
8834
|
-
/* @__PURE__ */ (0,
|
|
8835
|
-
|
|
8836
|
-
|
|
8837
|
-
|
|
8838
|
-
|
|
8839
|
-
|
|
8840
|
-
|
|
8841
|
-
|
|
8842
|
-
"
|
|
8843
|
-
|
|
8844
|
-
|
|
8845
|
-
|
|
8846
|
-
|
|
8847
|
-
|
|
8848
|
-
actual.routeSource
|
|
8849
|
-
] }),
|
|
8850
|
-
/* @__PURE__ */ (0, import_jsx_runtime12.jsxs)("div", { children: [
|
|
8851
|
-
/* @__PURE__ */ (0, import_jsx_runtime12.jsx)("p", { className: "dsmm-role-section-title", children: t(props.phase === "preparing" ? "preparingArgs" : "args") }),
|
|
8852
|
-
raw === "" ? /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("p", { className: "dsmm-role-empty", children: t("emptyArgs") }) : code(raw)
|
|
8853
|
-
] }),
|
|
8854
|
-
result?.meta != null && /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)("div", { children: [
|
|
8855
|
-
/* @__PURE__ */ (0, import_jsx_runtime12.jsx)("p", { className: "dsmm-role-section-title", children: t("metadata") }),
|
|
8856
|
-
code(JSON.stringify(result.meta, null, 2))
|
|
8857
|
-
] })
|
|
9758
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsxs)("details", { className: "dsmm-role-details", children: [
|
|
9759
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)("summary", { children: t("technicalDetails") }),
|
|
9760
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsxs)("div", { className: "dsmm-role-details-body", children: [
|
|
9761
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)("div", { className: "dsmm-role-details-header", children: /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(import_dsh_client_ui_primitives11.SegmentedControl, { id: controlId, value: viewMode, options: viewOptions, onChange: setViewMode, label: t("viewMode"), className: "dsmm-role-view-switch" }) }),
|
|
9762
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)("div", { id: `${controlId}-table-panel`, role: "tabpanel", "aria-labelledby": `${controlId}-table`, hidden: viewMode !== "table", tabIndex: 0, children: viewMode === "table" && /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)("table", { className: "dsmm-role-table", children: [
|
|
9763
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)("thead", { children: /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)("tr", { children: [
|
|
9764
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)("th", { scope: "col", children: t("property") }),
|
|
9765
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)("th", { scope: "col", children: t("value") })
|
|
9766
|
+
] }) }),
|
|
9767
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)("tbody", { children: tableRows.map((row) => /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)("tr", { children: [
|
|
9768
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)("td", { className: "dsmm-role-prop-cell", children: row.property }),
|
|
9769
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)("td", { className: "dsmm-role-val-cell", children: row.isComplex ? /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("pre", { className: "dsmm-role-cell-code", children: JSON.stringify(row.value, null, 2) }) : typeof row.value === "string" ? /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("span", { className: "dsmm-role-cell-text", children: row.value }) : /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("span", { children: row.value === null ? "null" : row.value === void 0 ? "undefined" : String(row.value) }) })
|
|
9770
|
+
] }, row.property)) })
|
|
9771
|
+
] }) }),
|
|
9772
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)("div", { id: `${controlId}-json-panel`, role: "tabpanel", "aria-labelledby": `${controlId}-json`, hidden: viewMode !== "json", tabIndex: 0, children: viewMode === "json" && code(JSON.stringify(jsonData2, null, 2)) })
|
|
8858
9773
|
] })
|
|
8859
9774
|
] })
|
|
8860
9775
|
] })
|
|
8861
9776
|
}
|
|
8862
9777
|
),
|
|
8863
|
-
/* @__PURE__ */ (0,
|
|
8864
|
-
/* @__PURE__ */ (0,
|
|
8865
|
-
|
|
9778
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsxs)("div", { className: "dsmm-role-actions", children: [
|
|
9779
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)(import_dsh_client_ui_primitives11.StateDot, { state: stateDotState }),
|
|
9780
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)("p", { className: "dsmm-role-status", role: "status", children: t(state) }),
|
|
9781
|
+
props.inspect !== void 0 && /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(import_dsh_client_ui_primitives11.Button, { variant: "ghost", size: "sm", onClick: props.inspect, children: t("inspect") })
|
|
8866
9782
|
] })
|
|
8867
9783
|
] });
|
|
8868
9784
|
}
|
|
@@ -9189,17 +10105,17 @@ var ChildrenController = class {
|
|
|
9189
10105
|
};
|
|
9190
10106
|
|
|
9191
10107
|
// src/client/ChildrenPanel.tsx
|
|
9192
|
-
var
|
|
9193
|
-
var
|
|
9194
|
-
var
|
|
10108
|
+
var import_react12 = require("react");
|
|
10109
|
+
var import_dsh_client_ui_primitives12 = require("@deepseek-ai/dsh-client-ui-primitives");
|
|
10110
|
+
var import_jsx_runtime14 = require("react/jsx-runtime");
|
|
9195
10111
|
function ControlAvailability({ value, label, t }) {
|
|
9196
|
-
return /* @__PURE__ */ (0,
|
|
9197
|
-
/* @__PURE__ */ (0,
|
|
10112
|
+
return /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("div", { className: "dsmm-availability", children: [
|
|
10113
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("p", { children: [
|
|
9198
10114
|
t(label),
|
|
9199
10115
|
": ",
|
|
9200
10116
|
t(value?.enabled === true ? "enabled" : "disabled")
|
|
9201
10117
|
] }),
|
|
9202
|
-
value?.enabled !== true && /* @__PURE__ */ (0,
|
|
10118
|
+
value?.enabled !== true && /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("p", { className: "dsmm-hint", children: t(`reason:${value?.reason ?? "unavailable"}`) })
|
|
9203
10119
|
] });
|
|
9204
10120
|
}
|
|
9205
10121
|
function routeText(route3) {
|
|
@@ -9208,38 +10124,38 @@ function routeText(route3) {
|
|
|
9208
10124
|
function RouteComparisonDetails({ value, t }) {
|
|
9209
10125
|
const initial = value?.initialRoute, live = value?.liveRoute;
|
|
9210
10126
|
const liveReasons = { "no-own-request-header": "routeNoOwnHeader", "invalid-own-request-header": "routeInvalidOwnHeader", "not-observed": "routeNotObserved" };
|
|
9211
|
-
return /* @__PURE__ */ (0,
|
|
9212
|
-
value === void 0 && /* @__PURE__ */ (0,
|
|
9213
|
-
/* @__PURE__ */ (0,
|
|
9214
|
-
/* @__PURE__ */ (0,
|
|
9215
|
-
/* @__PURE__ */ (0,
|
|
9216
|
-
initial?.status === "known" ? /* @__PURE__ */ (0,
|
|
9217
|
-
/* @__PURE__ */ (0,
|
|
9218
|
-
/* @__PURE__ */ (0,
|
|
10127
|
+
return /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("div", { className: "dsmm-availability", children: [
|
|
10128
|
+
value === void 0 && /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("p", { className: "dsmm-hint", children: t("comparisonUnobserved") }),
|
|
10129
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("dl", { className: "dsmm-child-meta", children: [
|
|
10130
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)("dt", { children: t("initialRoute") }),
|
|
10131
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)("dd", { children: initial?.status === "known" ? routeText(initial.route) : t("routeUnknown") }),
|
|
10132
|
+
initial?.status === "known" ? /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)(import_jsx_runtime14.Fragment, { children: [
|
|
10133
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)("dt", { children: t("initialRouteSource") }),
|
|
10134
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("dd", { children: [
|
|
9219
10135
|
t("routeCaptureSource"),
|
|
9220
10136
|
" · ",
|
|
9221
10137
|
initial.source
|
|
9222
10138
|
] })
|
|
9223
|
-
] }) : initial !== void 0 && /* @__PURE__ */ (0,
|
|
9224
|
-
/* @__PURE__ */ (0,
|
|
9225
|
-
/* @__PURE__ */ (0,
|
|
10139
|
+
] }) : initial !== void 0 && /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)(import_jsx_runtime14.Fragment, { children: [
|
|
10140
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)("dt", { children: t("initialRouteReason") }),
|
|
10141
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("dd", { children: [
|
|
9226
10142
|
t("routeMissingCapture"),
|
|
9227
10143
|
" · ",
|
|
9228
10144
|
initial.reason
|
|
9229
10145
|
] })
|
|
9230
10146
|
] }),
|
|
9231
|
-
/* @__PURE__ */ (0,
|
|
9232
|
-
/* @__PURE__ */ (0,
|
|
9233
|
-
live?.status === "known" ? /* @__PURE__ */ (0,
|
|
9234
|
-
/* @__PURE__ */ (0,
|
|
9235
|
-
/* @__PURE__ */ (0,
|
|
10147
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)("dt", { children: t("liveRoute") }),
|
|
10148
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)("dd", { children: live?.status === "known" ? routeText(live.route) : t("routeUnknown") }),
|
|
10149
|
+
live?.status === "known" ? /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)(import_jsx_runtime14.Fragment, { children: [
|
|
10150
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)("dt", { children: t("liveRouteSource") }),
|
|
10151
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("dd", { children: [
|
|
9236
10152
|
t("routeOwnHeaderSource"),
|
|
9237
10153
|
" · ",
|
|
9238
10154
|
live.source
|
|
9239
10155
|
] })
|
|
9240
|
-
] }) : live !== void 0 && /* @__PURE__ */ (0,
|
|
9241
|
-
/* @__PURE__ */ (0,
|
|
9242
|
-
/* @__PURE__ */ (0,
|
|
10156
|
+
] }) : live !== void 0 && /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)(import_jsx_runtime14.Fragment, { children: [
|
|
10157
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)("dt", { children: t("liveRouteReason") }),
|
|
10158
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("dd", { children: [
|
|
9243
10159
|
t(liveReasons[live.reason]),
|
|
9244
10160
|
" · ",
|
|
9245
10161
|
live.reason
|
|
@@ -9249,69 +10165,69 @@ function RouteComparisonDetails({ value, t }) {
|
|
|
9249
10165
|
] });
|
|
9250
10166
|
}
|
|
9251
10167
|
function InvocationDetails({ value, t, showComparison = true }) {
|
|
9252
|
-
if (value === void 0) return /* @__PURE__ */ (0,
|
|
9253
|
-
return /* @__PURE__ */ (0,
|
|
9254
|
-
showComparison && /* @__PURE__ */ (0,
|
|
9255
|
-
/* @__PURE__ */ (0,
|
|
9256
|
-
/* @__PURE__ */ (0,
|
|
9257
|
-
/* @__PURE__ */ (0,
|
|
10168
|
+
if (value === void 0) return /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("p", { className: "dsmm-hint", children: t("invocationUnavailable") });
|
|
10169
|
+
return /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)(import_jsx_runtime14.Fragment, { children: [
|
|
10170
|
+
showComparison && /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(RouteComparisonDetails, { value: value.routeComparison, t }),
|
|
10171
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("dl", { className: "dsmm-child-meta", children: [
|
|
10172
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)("dt", { children: t("role") }),
|
|
10173
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("dd", { children: [
|
|
9258
10174
|
value.label,
|
|
9259
10175
|
" · ",
|
|
9260
10176
|
value.role
|
|
9261
10177
|
] }),
|
|
9262
|
-
/* @__PURE__ */ (0,
|
|
9263
|
-
/* @__PURE__ */ (0,
|
|
9264
|
-
/* @__PURE__ */ (0,
|
|
9265
|
-
/* @__PURE__ */ (0,
|
|
9266
|
-
/* @__PURE__ */ (0,
|
|
9267
|
-
/* @__PURE__ */ (0,
|
|
9268
|
-
/* @__PURE__ */ (0,
|
|
9269
|
-
/* @__PURE__ */ (0,
|
|
9270
|
-
value.runId !== void 0 && /* @__PURE__ */ (0,
|
|
9271
|
-
/* @__PURE__ */ (0,
|
|
9272
|
-
/* @__PURE__ */ (0,
|
|
10178
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)("dt", { children: t("level") }),
|
|
10179
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)("dd", { children: value.level }),
|
|
10180
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)("dt", { children: t("mode") }),
|
|
10181
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)("dd", { children: value.mode }),
|
|
10182
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)("dt", { children: t("reportedRoute") }),
|
|
10183
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)("dd", { children: value.route === void 0 ? t("routeUnreported") : routeText(value.route) }),
|
|
10184
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)("dt", { children: t("routeSource") }),
|
|
10185
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)("dd", { children: value.routeSource }),
|
|
10186
|
+
value.runId !== void 0 && /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)(import_jsx_runtime14.Fragment, { children: [
|
|
10187
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)("dt", { children: t("runId") }),
|
|
10188
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)("dd", { children: value.runId })
|
|
9273
10189
|
] }),
|
|
9274
|
-
value.childId !== void 0 && /* @__PURE__ */ (0,
|
|
9275
|
-
/* @__PURE__ */ (0,
|
|
9276
|
-
/* @__PURE__ */ (0,
|
|
10190
|
+
value.childId !== void 0 && /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)(import_jsx_runtime14.Fragment, { children: [
|
|
10191
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)("dt", { children: t("childId") }),
|
|
10192
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)("dd", { children: value.childId })
|
|
9277
10193
|
] }),
|
|
9278
|
-
value.jobId !== void 0 && /* @__PURE__ */ (0,
|
|
9279
|
-
/* @__PURE__ */ (0,
|
|
9280
|
-
/* @__PURE__ */ (0,
|
|
10194
|
+
value.jobId !== void 0 && /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)(import_jsx_runtime14.Fragment, { children: [
|
|
10195
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)("dt", { children: t("jobId") }),
|
|
10196
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)("dd", { children: value.jobId })
|
|
9281
10197
|
] })
|
|
9282
10198
|
] })
|
|
9283
10199
|
] });
|
|
9284
10200
|
}
|
|
9285
10201
|
function Issue2({ value, t }) {
|
|
9286
10202
|
if (!value) return null;
|
|
9287
|
-
return /* @__PURE__ */ (0,
|
|
9288
|
-
/* @__PURE__ */ (0,
|
|
9289
|
-
/* @__PURE__ */ (0,
|
|
10203
|
+
return /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("div", { className: "dsmm-issue", role: "alert", children: [
|
|
10204
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)("p", { children: t(value.unknown ? "unknownAction" : "error", { code: value.code }) }),
|
|
10205
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("p", { children: [
|
|
9290
10206
|
value.code,
|
|
9291
10207
|
value.field === void 0 ? "" : ` · ${t("field")}: ${value.field}`
|
|
9292
10208
|
] }),
|
|
9293
|
-
value.reason !== void 0 && /* @__PURE__ */ (0,
|
|
10209
|
+
value.reason !== void 0 && /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("p", { children: t(`reason:${value.reason}`) })
|
|
9294
10210
|
] });
|
|
9295
10211
|
}
|
|
9296
10212
|
function Outcome({ value, t }) {
|
|
9297
10213
|
if (!value) return null;
|
|
9298
|
-
return /* @__PURE__ */ (0,
|
|
10214
|
+
return /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("div", { className: "dsmm-availability", role: "status", "aria-live": "polite", children: value.kind === "prompt" ? /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("p", { children: t("promptAccepted", { id: value.receipt.messageId }) }) : /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("p", { children: t("interruptAccepted") }) });
|
|
9299
10215
|
}
|
|
9300
10216
|
function ChildComposer({ child: child2, state, actions: actions3, t }) {
|
|
9301
|
-
const prefix = (0,
|
|
10217
|
+
const prefix = (0, import_react12.useId)(), picker = (0, import_react12.useRef)(null), generation = state.generation, key = childActionKey(child2.id);
|
|
9302
10218
|
const draft2 = state.drafts.get(child2.id) ?? EMPTY_CHILD_DRAFT;
|
|
9303
10219
|
const pending = state.pending.has(key), available = state.fresh && !state.reading && !pending;
|
|
9304
10220
|
const canPrompt = available && enabled(state.snapshot?.capabilities.prompt) && enabled(child2.controls.prompt) && !child2.readonly && child2.mode === "continuable";
|
|
9305
10221
|
const canImages = canPrompt && enabled(state.snapshot?.capabilities.images) && !draft2.imageBusy;
|
|
9306
10222
|
const submit = canPrompt && !draft2.uncertain && !draft2.imageBusy && (draft2.text.trim() !== "" || draft2.images.length > 0) && (draft2.images.length === 0 || enabled(state.snapshot?.capabilities.images));
|
|
9307
|
-
return /* @__PURE__ */ (0,
|
|
10223
|
+
return /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("form", { className: "dsmm-child-composer", "aria-label": t("prompt"), onSubmit: (event) => {
|
|
9308
10224
|
event.preventDefault();
|
|
9309
10225
|
if (submit) void actions3.prompt(generation, child2.id);
|
|
9310
10226
|
}, children: [
|
|
9311
|
-
!state.fresh && /* @__PURE__ */ (0,
|
|
9312
|
-
/* @__PURE__ */ (0,
|
|
9313
|
-
/* @__PURE__ */ (0,
|
|
9314
|
-
/* @__PURE__ */ (0,
|
|
10227
|
+
!state.fresh && /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("p", { className: "dsmm-hint", children: t(state.reading ? "reading" : "stale") }),
|
|
10228
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("div", { className: "dsmm-field", children: [
|
|
10229
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)("label", { htmlFor: `${prefix}-message`, children: t("text") }),
|
|
10230
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
|
|
9315
10231
|
"textarea",
|
|
9316
10232
|
{
|
|
9317
10233
|
id: `${prefix}-message`,
|
|
@@ -9324,48 +10240,48 @@ function ChildComposer({ child: child2, state, actions: actions3, t }) {
|
|
|
9324
10240
|
}
|
|
9325
10241
|
)
|
|
9326
10242
|
] }),
|
|
9327
|
-
/* @__PURE__ */ (0,
|
|
9328
|
-
/* @__PURE__ */ (0,
|
|
9329
|
-
/* @__PURE__ */ (0,
|
|
10243
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("div", { className: "dsmm-field", children: [
|
|
10244
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)("label", { htmlFor: `${prefix}-delivery`, children: t("delivery") }),
|
|
10245
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("select", { id: `${prefix}-delivery`, value: draft2.delivery, disabled: !canPrompt, "aria-describedby": `${prefix}-delivery-hint`, onChange: (event) => {
|
|
9330
10246
|
const value = event.currentTarget.value;
|
|
9331
10247
|
if (value === "queue" || value === "steer") actions3.setDelivery(generation, child2.id, value);
|
|
9332
10248
|
}, children: [
|
|
9333
|
-
/* @__PURE__ */ (0,
|
|
9334
|
-
/* @__PURE__ */ (0,
|
|
10249
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)("option", { value: "queue", children: t("queue") }),
|
|
10250
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)("option", { value: "steer", children: t("steer") })
|
|
9335
10251
|
] }),
|
|
9336
|
-
/* @__PURE__ */ (0,
|
|
10252
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)("p", { id: `${prefix}-delivery-hint`, className: "dsmm-hint", children: t("deliveryHint") })
|
|
9337
10253
|
] }),
|
|
9338
|
-
/* @__PURE__ */ (0,
|
|
9339
|
-
/* @__PURE__ */ (0,
|
|
9340
|
-
/* @__PURE__ */ (0,
|
|
10254
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("div", { className: "dsmm-field", children: [
|
|
10255
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)("p", { id: `${prefix}-images-hint`, className: "dsmm-hint", children: t("imagesHint") }),
|
|
10256
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.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) => {
|
|
9341
10257
|
const files = Array.from(event.currentTarget.files ?? []);
|
|
9342
10258
|
event.currentTarget.value = "";
|
|
9343
10259
|
if (canImages) void actions3.addImages(generation, child2.id, files);
|
|
9344
10260
|
} }),
|
|
9345
|
-
/* @__PURE__ */ (0,
|
|
10261
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)(import_dsh_client_ui_primitives12.Button, { type: "button", variant: "outline", disabled: !canImages, "aria-describedby": `${prefix}-images-hint`, onClick: () => {
|
|
9346
10262
|
if (canImages) picker.current?.click();
|
|
9347
10263
|
}, children: t("images") }),
|
|
9348
|
-
/* @__PURE__ */ (0,
|
|
9349
|
-
draft2.images.length > 0 && /* @__PURE__ */ (0,
|
|
9350
|
-
/* @__PURE__ */ (0,
|
|
10264
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)(ControlAvailability, { value: state.snapshot?.capabilities.images, label: "imageAvailability", t }),
|
|
10265
|
+
draft2.images.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("ul", { className: "dsmm-profile-list", children: draft2.images.map((image, index) => /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("li", { children: [
|
|
10266
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("p", { children: [
|
|
9351
10267
|
image.name ?? image.mediaType,
|
|
9352
10268
|
" · ",
|
|
9353
10269
|
image.mediaType
|
|
9354
10270
|
] }),
|
|
9355
|
-
/* @__PURE__ */ (0,
|
|
10271
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)(import_dsh_client_ui_primitives12.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") })
|
|
9356
10272
|
] }, index)) })
|
|
9357
10273
|
] }),
|
|
9358
|
-
draft2.uncertain && /* @__PURE__ */ (0,
|
|
9359
|
-
/* @__PURE__ */ (0,
|
|
9360
|
-
/* @__PURE__ */ (0,
|
|
10274
|
+
draft2.uncertain && /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("div", { className: "dsmm-warning", children: [
|
|
10275
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)("p", { id: `${prefix}-unknown`, children: t("unknown") }),
|
|
10276
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)(import_dsh_client_ui_primitives12.Button, { type: "button", variant: "outline", disabled: !state.fresh || state.reading || pending, onClick: () => actions3.acknowledgeUnknown(generation, child2.id), children: t("acknowledge") })
|
|
9361
10277
|
] }),
|
|
9362
|
-
/* @__PURE__ */ (0,
|
|
9363
|
-
draft2.text.trim() === "" && draft2.images.length === 0 && /* @__PURE__ */ (0,
|
|
9364
|
-
draft2.images.length > 0 && !enabled(state.snapshot?.capabilities.images) && /* @__PURE__ */ (0,
|
|
9365
|
-
/* @__PURE__ */ (0,
|
|
9366
|
-
/* @__PURE__ */ (0,
|
|
9367
|
-
/* @__PURE__ */ (0,
|
|
9368
|
-
|
|
10278
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)(ControlAvailability, { value: !enabled(state.snapshot?.capabilities.prompt) ? state.snapshot?.capabilities.prompt : child2.controls.prompt, label: "promptAvailability", t }),
|
|
10279
|
+
draft2.text.trim() === "" && draft2.images.length === 0 && /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("p", { className: "dsmm-hint", children: t("emptyMessage") }),
|
|
10280
|
+
draft2.images.length > 0 && !enabled(state.snapshot?.capabilities.images) && /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("p", { className: "dsmm-hint", children: t("deniedImages") }),
|
|
10281
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("div", { className: "dsmm-actions", children: [
|
|
10282
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)(import_dsh_client_ui_primitives12.Button, { type: "submit", variant: "primary", disabled: !submit, children: t("send") }),
|
|
10283
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)(
|
|
10284
|
+
import_dsh_client_ui_primitives12.Button,
|
|
9369
10285
|
{
|
|
9370
10286
|
type: "button",
|
|
9371
10287
|
variant: "outline",
|
|
@@ -9375,124 +10291,124 @@ function ChildComposer({ child: child2, state, actions: actions3, t }) {
|
|
|
9375
10291
|
}
|
|
9376
10292
|
)
|
|
9377
10293
|
] }),
|
|
9378
|
-
/* @__PURE__ */ (0,
|
|
10294
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)("p", { className: "dsmm-status", role: "status", "aria-live": "polite", children: pending ? t("pending") : draft2.imageBusy ? t("imageReading") : "" })
|
|
9379
10295
|
] });
|
|
9380
10296
|
}
|
|
9381
10297
|
function ChildDetails({ child: child2, state, actions: actions3, t, inspection = false }) {
|
|
9382
|
-
return /* @__PURE__ */ (0,
|
|
9383
|
-
/* @__PURE__ */ (0,
|
|
9384
|
-
/* @__PURE__ */ (0,
|
|
10298
|
+
return /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("fieldset", { children: [
|
|
10299
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)("legend", { children: child2.label?.trim() ? child2.label : child2.id }),
|
|
10300
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("p", { children: [
|
|
9385
10301
|
t("childId"),
|
|
9386
10302
|
": ",
|
|
9387
10303
|
child2.id
|
|
9388
10304
|
] }),
|
|
9389
|
-
/* @__PURE__ */ (0,
|
|
10305
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("p", { children: [
|
|
9390
10306
|
t("parentId"),
|
|
9391
10307
|
": ",
|
|
9392
10308
|
child2.parentSessionId
|
|
9393
10309
|
] }),
|
|
9394
|
-
/* @__PURE__ */ (0,
|
|
10310
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("p", { children: [
|
|
9395
10311
|
t("mode"),
|
|
9396
10312
|
": ",
|
|
9397
10313
|
child2.mode
|
|
9398
10314
|
] }),
|
|
9399
|
-
/* @__PURE__ */ (0,
|
|
10315
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("p", { children: [
|
|
9400
10316
|
t("activity"),
|
|
9401
10317
|
": ",
|
|
9402
10318
|
child2.activity
|
|
9403
10319
|
] }),
|
|
9404
|
-
(inspection || child2.readonly) && /* @__PURE__ */ (0,
|
|
9405
|
-
child2.mode === "one-shot" && /* @__PURE__ */ (0,
|
|
9406
|
-
/* @__PURE__ */ (0,
|
|
9407
|
-
/* @__PURE__ */ (0,
|
|
9408
|
-
(!inspection || !child2.controls.prompt.enabled) && /* @__PURE__ */ (0,
|
|
9409
|
-
(!inspection || !child2.controls.interrupt.enabled) && /* @__PURE__ */ (0,
|
|
9410
|
-
!inspection && child2.mode === "continuable" && !child2.readonly && /* @__PURE__ */ (0,
|
|
9411
|
-
!inspection && /* @__PURE__ */ (0,
|
|
9412
|
-
/* @__PURE__ */ (0,
|
|
9413
|
-
/* @__PURE__ */ (0,
|
|
10320
|
+
(inspection || child2.readonly) && /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("p", { children: t("readonly") }),
|
|
10321
|
+
child2.mode === "one-shot" && /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("p", { className: "dsmm-hint", children: t("oneShot") }),
|
|
10322
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)(RouteComparisonDetails, { value: child2.routeComparison, t }),
|
|
10323
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)(InvocationDetails, { value: child2.invocation, t, showComparison: false }),
|
|
10324
|
+
(!inspection || !child2.controls.prompt.enabled) && /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(ControlAvailability, { value: child2.controls.prompt, label: "promptAvailability", t }),
|
|
10325
|
+
(!inspection || !child2.controls.interrupt.enabled) && /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(ControlAvailability, { value: child2.controls.interrupt, label: "interruptAvailability", t }),
|
|
10326
|
+
!inspection && child2.mode === "continuable" && !child2.readonly && /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(ChildComposer, { child: child2, state, actions: actions3, t }),
|
|
10327
|
+
!inspection && /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)(import_jsx_runtime14.Fragment, { children: [
|
|
10328
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)(Issue2, { value: state.issues.get(childActionKey(child2.id)), t }),
|
|
10329
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)(Outcome, { value: state.outcomes.get(childActionKey(child2.id)), t })
|
|
9414
10330
|
] })
|
|
9415
10331
|
] });
|
|
9416
10332
|
}
|
|
9417
10333
|
function ChildrenPanel(props) {
|
|
9418
10334
|
const state = props.useChildren((snapshot4) => snapshot4), { t } = props, generation = state.generation;
|
|
9419
|
-
if (props.sessionId === void 0 || props.sessionId !== state.sessionId) return /* @__PURE__ */ (0,
|
|
9420
|
-
/* @__PURE__ */ (0,
|
|
9421
|
-
/* @__PURE__ */ (0,
|
|
10335
|
+
if (props.sessionId === void 0 || props.sessionId !== state.sessionId) return /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("section", { className: "dsmm-profiles dsmm-children", children: [
|
|
10336
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)("h2", { children: t("title") }),
|
|
10337
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)("p", { children: t(state.sessionId === null ? "noSession" : "foreign") })
|
|
9422
10338
|
] });
|
|
9423
10339
|
const data = state.snapshot;
|
|
9424
10340
|
const refreshingDisabled = state.reading || state.pending.size > 0 || [...state.drafts.values()].some((draft2) => draft2.imageBusy);
|
|
9425
|
-
return /* @__PURE__ */ (0,
|
|
9426
|
-
/* @__PURE__ */ (0,
|
|
9427
|
-
/* @__PURE__ */ (0,
|
|
9428
|
-
/* @__PURE__ */ (0,
|
|
10341
|
+
return /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("section", { className: "dsmm-profiles dsmm-children", "aria-label": t("title"), "aria-busy": state.reading, children: [
|
|
10342
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)("h2", { children: t("title") }),
|
|
10343
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)("p", { className: "dsmm-hint", children: t("description") }),
|
|
10344
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("p", { children: [
|
|
9429
10345
|
t("session"),
|
|
9430
10346
|
": ",
|
|
9431
10347
|
state.sessionId
|
|
9432
10348
|
] }),
|
|
9433
|
-
/* @__PURE__ */ (0,
|
|
9434
|
-
/* @__PURE__ */ (0,
|
|
9435
|
-
/* @__PURE__ */ (0,
|
|
9436
|
-
data !== null && /* @__PURE__ */ (0,
|
|
9437
|
-
/* @__PURE__ */ (0,
|
|
10349
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)("div", { className: "dsmm-actions", children: /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(import_dsh_client_ui_primitives12.Button, { type: "button", variant: "outline", disabled: refreshingDisabled, onClick: () => void props.refresh(generation), children: t("refresh") }) }),
|
|
10350
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.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") : "" }),
|
|
10351
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)(Issue2, { value: state.issue, t }),
|
|
10352
|
+
data !== null && /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)(import_jsx_runtime14.Fragment, { children: [
|
|
10353
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("p", { children: [
|
|
9438
10354
|
t("epoch"),
|
|
9439
10355
|
": ",
|
|
9440
10356
|
data.admissionEpoch
|
|
9441
10357
|
] }),
|
|
9442
|
-
/* @__PURE__ */ (0,
|
|
9443
|
-
/* @__PURE__ */ (0,
|
|
10358
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("section", { className: "dsmm-availability", children: [
|
|
10359
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("p", { children: [
|
|
9444
10360
|
t("runtime"),
|
|
9445
10361
|
": ",
|
|
9446
10362
|
data.capabilities.runtime.binding
|
|
9447
10363
|
] }),
|
|
9448
|
-
/* @__PURE__ */ (0,
|
|
10364
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("p", { children: [
|
|
9449
10365
|
t("fence"),
|
|
9450
10366
|
": ",
|
|
9451
10367
|
t(data.capabilities.runtime.deliveryFenceReady ? "yes" : "no")
|
|
9452
10368
|
] }),
|
|
9453
|
-
/* @__PURE__ */ (0,
|
|
10369
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("p", { children: [
|
|
9454
10370
|
t("restart"),
|
|
9455
10371
|
": ",
|
|
9456
10372
|
t(data.capabilities.runtime.restartRequired ? "yes" : "no")
|
|
9457
10373
|
] }),
|
|
9458
|
-
data.capabilities.runtime.reason !== void 0 && /* @__PURE__ */ (0,
|
|
9459
|
-
/* @__PURE__ */ (0,
|
|
9460
|
-
/* @__PURE__ */ (0,
|
|
10374
|
+
data.capabilities.runtime.reason !== void 0 && /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("p", { children: t("authority") }),
|
|
10375
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)(ControlAvailability, { value: data.capabilities.prompt, label: "promptAvailability", t }),
|
|
10376
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)(ControlAvailability, { value: data.capabilities.interrupt, label: "interruptAvailability", t })
|
|
9461
10377
|
] }),
|
|
9462
|
-
/* @__PURE__ */ (0,
|
|
9463
|
-
/* @__PURE__ */ (0,
|
|
9464
|
-
/* @__PURE__ */ (0,
|
|
9465
|
-
data.children.length === 0 ? /* @__PURE__ */ (0,
|
|
10378
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)("p", { className: "dsmm-hint", children: t("backgroundHint") }),
|
|
10379
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("section", { className: "dsmm-zone", "aria-label": t("children"), children: [
|
|
10380
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)("h3", { children: t("children") }),
|
|
10381
|
+
data.children.length === 0 ? /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("p", { className: "dsmm-hint", children: t("emptyChildren") }) : data.children.map((child2) => /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(ChildDetails, { child: child2, state, actions: props, t }, child2.id))
|
|
9466
10382
|
] })
|
|
9467
10383
|
] }),
|
|
9468
|
-
/* @__PURE__ */ (0,
|
|
9469
|
-
/* @__PURE__ */ (0,
|
|
9470
|
-
/* @__PURE__ */ (0,
|
|
9471
|
-
state.descendants === null ? /* @__PURE__ */ (0,
|
|
9472
|
-
/* @__PURE__ */ (0,
|
|
10384
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("section", { className: "dsmm-zone", "aria-label": t("descendants"), children: [
|
|
10385
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)("h3", { children: t("descendants") }),
|
|
10386
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)(Issue2, { value: state.descendantIssue, t }),
|
|
10387
|
+
state.descendants === null ? /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("p", { className: "dsmm-hint", children: t("treeUnavailable") }) : state.descendants.descendants.length === 0 ? /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("p", { className: "dsmm-hint", children: t("emptyDescendants") }) : state.descendants.descendants.map((entry, index) => /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("div", { className: "dsmm-availability", children: [
|
|
10388
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("p", { children: [
|
|
9473
10389
|
t("depth"),
|
|
9474
10390
|
": ",
|
|
9475
10391
|
entry.depth
|
|
9476
10392
|
] }),
|
|
9477
|
-
entry.kind === "diagnostic" ? /* @__PURE__ */ (0,
|
|
9478
|
-
/* @__PURE__ */ (0,
|
|
9479
|
-
/* @__PURE__ */ (0,
|
|
10393
|
+
entry.kind === "diagnostic" ? /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("div", { className: "dsmm-issue", children: [
|
|
10394
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)("p", { children: t("diagnostic", { reason: entry.reason }) }),
|
|
10395
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("p", { children: [
|
|
9480
10396
|
t("childId"),
|
|
9481
10397
|
": ",
|
|
9482
10398
|
entry.id
|
|
9483
10399
|
] }),
|
|
9484
|
-
/* @__PURE__ */ (0,
|
|
10400
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("p", { children: [
|
|
9485
10401
|
t("parentId"),
|
|
9486
10402
|
": ",
|
|
9487
10403
|
entry.parentSessionId
|
|
9488
10404
|
] })
|
|
9489
|
-
] }) : /* @__PURE__ */ (0,
|
|
9490
|
-
/* @__PURE__ */ (0,
|
|
10405
|
+
] }) : /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)(import_jsx_runtime14.Fragment, { children: [
|
|
10406
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("p", { children: [
|
|
9491
10407
|
t("subtree"),
|
|
9492
10408
|
": ",
|
|
9493
10409
|
t(entry.hasChildren ? "yes" : "no")
|
|
9494
10410
|
] }),
|
|
9495
|
-
/* @__PURE__ */ (0,
|
|
10411
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)(ChildDetails, { child: entry.child, state, actions: props, t, inspection: true })
|
|
9496
10412
|
] })
|
|
9497
10413
|
] }, index))
|
|
9498
10414
|
] })
|