@dsmm/dsmm 0.3.14 → 0.3.15

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/lib/client.js CHANGED
@@ -4492,14 +4492,14 @@ var en = {
4492
4492
  viewConfiguration: "View JSONC source",
4493
4493
  advancedSettings: "Advanced settings",
4494
4494
  gitWriteGuard: "Git write protection",
4495
- gitWriteScope: "Inspection scope",
4495
+ gitWriteScope: "Git write protection scope",
4496
4496
  gitWriteScopeDisabledHint: "Protection is off; inspection scope is inactive",
4497
4497
  gitWriteGuardHint: "Inspection scope adjusts automatic Git protection only; explicit ask/deny still applies. Turning off does not authorize operations.",
4498
4498
  gitWriteAsk: "Ask",
4499
4499
  gitWriteDeny: "Deny",
4500
4500
  gitWriteOff: "Off",
4501
- gitWriteAllWrites: "All Git write operations",
4502
- gitWriteHighRisk: "High-risk Git operations only",
4501
+ gitWriteAllWrites: "All write operations",
4502
+ gitWriteHighRisk: "High-risk write operations only",
4503
4503
  topologyPerRole: "One tool per role",
4504
4504
  topologyParameterized: "Select role in tool arguments",
4505
4505
  roleModels: "Role models and availability",
@@ -4799,14 +4799,14 @@ var zh = {
4799
4799
  viewConfiguration: "查看配置内容",
4800
4800
  advancedSettings: "高级设置",
4801
4801
  gitWriteGuard: "Git 写入保护",
4802
- gitWriteScope: "检查范围",
4802
+ gitWriteScope: "Git 写操作保护范围",
4803
4803
  gitWriteScopeDisabledHint: "保护已关闭,检查范围暂不生效",
4804
4804
  gitWriteGuardHint: "检查范围只调整自动 Git 保护,显式 ask/deny 仍生效;关闭不代表授权。",
4805
4805
  gitWriteAsk: "询问",
4806
4806
  gitWriteDeny: "禁止",
4807
4807
  gitWriteOff: "关闭",
4808
- gitWriteAllWrites: "所有 Git 写操作",
4809
- gitWriteHighRisk: "仅高危 Git 操作",
4808
+ gitWriteAllWrites: "所有写操作",
4809
+ gitWriteHighRisk: "仅高风险写操作",
4810
4810
  topologyPerRole: "每个角色独立入口",
4811
4811
  topologyParameterized: "统一入口中选择角色",
4812
4812
  roleModels: "角色模型与可用性",
@@ -5069,6 +5069,12 @@ function EditableChoice({ id: id2, label, value, options, disabled, placeholder,
5069
5069
  placeholder,
5070
5070
  autoComplete: "off",
5071
5071
  onBlur: close,
5072
+ onClick: () => {
5073
+ if (!disabled && choices.length > 0 && !visible) {
5074
+ setOpen(true);
5075
+ setActiveId(null);
5076
+ }
5077
+ },
5072
5078
  onChange: (event) => {
5073
5079
  onChange(event.currentTarget.value);
5074
5080
  setOpen(true);
@@ -5096,7 +5102,7 @@ function EditableChoice({ id: id2, label, value, options, disabled, placeholder,
5096
5102
  {
5097
5103
  type: "button",
5098
5104
  size: "sm",
5099
- variant: "toolbar",
5105
+ variant: "ghost",
5100
5106
  tabIndex: -1,
5101
5107
  className: "dsmm-choice-toggle",
5102
5108
  "aria-label": label,
@@ -5391,6 +5397,22 @@ function RoleAvailability({ value, t }) {
5391
5397
  ] });
5392
5398
  }
5393
5399
 
5400
+ // src/client/session-labels.ts
5401
+ function displayRoleLabel(label) {
5402
+ return label.replace(/^DW\s+/u, "");
5403
+ }
5404
+ function sessionProfileLabels(session, t) {
5405
+ const admitted = session.admittedSelection;
5406
+ const profile = admitted === void 0 ? t("sessionGlobalCaptured") : admitted.selectedId === null ? t("sessionBaseline") : t("sessionAdmittedProfile", { id: admitted.selectedId, revision: t(configurationVersionState(admitted.sourceRevision)) });
5407
+ const future = session.globalDefault;
5408
+ return {
5409
+ admitted: t("sessionState", { profile, scope: session.scope }),
5410
+ futureDefault: t("sessionFutureDefault", {
5411
+ profile: !future || future.selectedId === null ? t("sessionBaseline") : t("sessionAdmittedProfile", { id: future.selectedId, revision: t(configurationVersionState(future.sourceRevision)) })
5412
+ })
5413
+ };
5414
+ }
5415
+
5394
5416
  // src/client/ProfileModelsDialog.tsx
5395
5417
  var import_jsx_runtime5 = require("react/jsx-runtime");
5396
5418
  function locateFieldInsideRole(roleCard, field) {
@@ -5601,7 +5623,8 @@ function ProfileModelsDialog({
5601
5623
  if (searchQuery.trim()) {
5602
5624
  const q = searchQuery.trim().toLowerCase();
5603
5625
  const matchesId = role3.id.toLowerCase().includes(q);
5604
- const matchesLabel = role3.label.toLowerCase().includes(q);
5626
+ const displayLabel = displayRoleLabel(role3.label);
5627
+ const matchesLabel = role3.label.toLowerCase().includes(q) || displayLabel.toLowerCase().includes(q);
5605
5628
  if (!matchesId && !matchesLabel) return false;
5606
5629
  }
5607
5630
  if (filterExplicitOnly) {
@@ -5735,6 +5758,7 @@ function ProfileModelsDialog({
5735
5758
  doc !== null && /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)("div", { className: "dsmm-roles-list dsmm-dialog-roles-list", children: [
5736
5759
  filteredRoles.length === 0 && /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("p", { className: "dsmm-hint dsmm-no-roles", children: t("noMatchingRoles") }),
5737
5760
  filteredRoles.map((role3) => {
5761
+ const roleName = displayRoleLabel(role3.label);
5738
5762
  const policy = doc.roleRouting[role3.id] ?? {};
5739
5763
  const rolePath = ["settings", "roleRouting", role3.id];
5740
5764
  const isOrchestrator = role3.id === "dsmm-orchestrator";
@@ -5771,13 +5795,13 @@ function ProfileModelsDialog({
5771
5795
  children: [
5772
5796
  /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)("div", { className: "dsmm-role-main-row", children: [
5773
5797
  /* @__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: [
5774
- /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("span", { className: "dsmm-role-title", children: role3.label }),
5798
+ /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("span", { className: "dsmm-role-title", children: roleName }),
5775
5799
  /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("code", { className: "dsmm-role-id-badge", children: role3.id }),
5776
5800
  explicitOverride && /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("span", { className: "dsmm-override-badge", children: t("roleSettingsOverridden") })
5777
5801
  ] }) }),
5778
5802
  /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)("div", { className: "dsmm-role-primary-route", children: [
5779
5803
  /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)("div", { className: "dsmm-field dsmm-primary-mode-field", children: [
5780
- /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("label", { htmlFor: `${prefix}-${role3.id}-primary-mode`, children: t("primaryMode", { name: role3.label }) }),
5804
+ /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("label", { htmlFor: `${prefix}-${role3.id}-primary-mode`, children: t("primaryMode", { name: roleName }) }),
5781
5805
  /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)(
5782
5806
  "select",
5783
5807
  {
@@ -5801,7 +5825,7 @@ function ProfileModelsDialog({
5801
5825
  t,
5802
5826
  value: policy.primary,
5803
5827
  path: [...rolePath, "primary"],
5804
- name: t("primaryName", { name: role3.label }),
5828
+ name: t("primaryName", { name: roleName }),
5805
5829
  catalog: state.catalog,
5806
5830
  disabled: effectiveDisabled,
5807
5831
  edit: actions3.editPath,
@@ -5848,7 +5872,7 @@ function ProfileModelsDialog({
5848
5872
  ] }),
5849
5873
  /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)("div", { className: "dsmm-details-content", children: [
5850
5874
  /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)("div", { className: "dsmm-field", children: [
5851
- /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("label", { htmlFor: `${prefix}-${role3.id}-fallback-mode`, children: t("fallbackMode", { name: role3.label }) }),
5875
+ /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("label", { htmlFor: `${prefix}-${role3.id}-fallback-mode`, children: t("fallbackMode", { name: roleName }) }),
5852
5876
  /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)(
5853
5877
  "select",
5854
5878
  {
@@ -5868,7 +5892,7 @@ function ProfileModelsDialog({
5868
5892
  ] }),
5869
5893
  policy.fallbackRoutes?.length === 0 && /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("p", { className: "dsmm-hint", children: t("emptyChain") }),
5870
5894
  policy.fallbackRoutes?.map((candidate, index) => {
5871
- const name2 = t("fallbackName", { name: role3.label, index: index + 1 });
5895
+ const name2 = t("fallbackName", { name: roleName, index: index + 1 });
5872
5896
  return /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)(
5873
5897
  "fieldset",
5874
5898
  {
@@ -5959,7 +5983,7 @@ function ProfileModelsDialog({
5959
5983
  actions3.editPath([...rolePath, "fallbackRoutes", policy.fallbackRoutes.length], { provider: "", model: "" });
5960
5984
  }
5961
5985
  },
5962
- children: t("addFallback", { name: role3.label })
5986
+ children: t("addFallback", { name: roleName })
5963
5987
  }
5964
5988
  )
5965
5989
  ] })
@@ -5975,7 +5999,7 @@ function ProfileModelsDialog({
5975
5999
  /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)("div", { className: "dsmm-details-content", children: [
5976
6000
  /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(RoleAvailability, { value: role3.availability, t }),
5977
6001
  /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)("div", { className: "dsmm-field", children: [
5978
- /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("label", { htmlFor: `${prefix}-${role3.id}-role-enabled`, children: t("namedRole", { name: role3.label }) }),
6002
+ /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("label", { htmlFor: `${prefix}-${role3.id}-role-enabled`, children: t("namedRole", { name: roleName }) }),
5979
6003
  /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)(
5980
6004
  "select",
5981
6005
  {
@@ -6010,7 +6034,7 @@ function ProfileModelsDialog({
6010
6034
  value: policy,
6011
6035
  inherited,
6012
6036
  path: rolePath,
6013
- name: role3.label,
6037
+ name: roleName,
6014
6038
  disabled: effectiveDisabled,
6015
6039
  actions: actions3
6016
6040
  }
@@ -6032,21 +6056,6 @@ function ProfileModelsDialog({
6032
6056
  // src/client/SessionProfiles.tsx
6033
6057
  var import_react4 = require("react");
6034
6058
  var import_dsh_client_ui_primitives4 = require("@deepseek-ai/dsh-client-ui-primitives");
6035
-
6036
- // src/client/session-labels.ts
6037
- function sessionProfileLabels(session, t) {
6038
- const admitted = session.admittedSelection;
6039
- const profile = admitted === void 0 ? t("sessionGlobalCaptured") : admitted.selectedId === null ? t("sessionBaseline") : t("sessionAdmittedProfile", { id: admitted.selectedId, revision: t(configurationVersionState(admitted.sourceRevision)) });
6040
- const future = session.globalDefault;
6041
- return {
6042
- admitted: t("sessionState", { profile, scope: session.scope }),
6043
- futureDefault: t("sessionFutureDefault", {
6044
- profile: !future || future.selectedId === null ? t("sessionBaseline") : t("sessionAdmittedProfile", { id: future.selectedId, revision: t(configurationVersionState(future.sourceRevision)) })
6045
- })
6046
- };
6047
- }
6048
-
6049
- // src/client/SessionProfiles.tsx
6050
6059
  var import_jsx_runtime6 = require("react/jsx-runtime");
6051
6060
  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"]);
6052
6061
  function capabilityReason(reason, t) {
@@ -7025,7 +7034,10 @@ var PROFILE_STYLES = `
7025
7034
  :is(.dsmm-profiles, .dsmm-profile-models-dialog) .dsmm-input input{width:100%;min-width:0;font:inherit;color:inherit}
7026
7035
  :is(.dsmm-profiles, .dsmm-profile-models-dialog) .dsmm-choice{position:relative;min-width:0}
7027
7036
  :is(.dsmm-profiles, .dsmm-profile-models-dialog) .dsmm-choice .dsmm-input input{padding-right:32px}
7028
- :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}
7037
+ :is(.dsmm-profiles, .dsmm-profile-models-dialog) .dsmm-choice .dsmm-choice-toggle{position:absolute;right:4px;top:50%;transform:translateY(-50%);width:24px;height:24px;min-height:24px;padding:0;border:none;border-radius:var(--dsw-radius-xs,4px);background:transparent;color:var(--dsw-alias-label-secondary)}
7038
+ :is(.dsmm-profiles, .dsmm-profile-models-dialog) .dsmm-choice .dsmm-choice-toggle:hover:not(:disabled){background:var(--dsw-alias-interactive-bg-hover);color:var(--dsw-alias-label-primary)}
7039
+ :is(.dsmm-profiles, .dsmm-profile-models-dialog) .dsmm-choice .dsmm-choice-toggle:active:not(:disabled){background:var(--dsw-alias-interactive-bg-active)}
7040
+ :is(.dsmm-profiles, .dsmm-profile-models-dialog) .dsmm-choice .dsmm-choice-toggle:disabled{background:transparent;color:var(--dsw-alias-label-tertiary);opacity:0.4;cursor:not-allowed}
7029
7041
  :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)}
7030
7042
  :is(.dsmm-profiles, .dsmm-profile-models-dialog) .dsmm-choice-list [role=option]{padding:8px 10px;min-width:0;overflow-wrap:anywhere;cursor:pointer}
7031
7043
  :is(.dsmm-profiles, .dsmm-profile-models-dialog) .dsmm-choice-list [role=option]:hover{background:var(--dsw-alias-interactive-bg-hover)}
@@ -7044,6 +7056,7 @@ var PROFILE_STYLES = `
7044
7056
  .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}
7045
7057
  .dsmm-profiles .dsmm-issue p+p{margin-top:8px}
7046
7058
  .dsmm-profiles .dsmm-status{min-height:22px}
7059
+ .dsmm-profiles .dsmm-status:empty{min-height:0;display:none}
7047
7060
  .dsmm-profiles .dsmm-zone{min-width:0;display:flex;flex-direction:column;gap:12px;padding-top:16px;border-top:1px solid var(--dsw-alias-border-l4)}
7048
7061
  .dsmm-profiles .dsmm-profile-list{list-style:none;padding:0;margin:0;display:flex;flex-direction:column;gap:12px;min-width:0}
7049
7062
  .dsmm-profiles .dsmm-profile-list li{min-width:0;display:flex;flex-direction:column;gap:4px}
@@ -7058,8 +7071,8 @@ var PROFILE_STYLES = `
7058
7071
  .dsmm-panel-heading{display:flex;flex-wrap:wrap;gap:8px;justify-content:space-between;align-items:center;min-width:0}
7059
7072
  .dsmm-panel-heading h2:focus-visible{outline:var(--dsw-focus-ring-width,2px) solid var(--dsw-focus-ring-color,var(--dsw-alias-state-business-primary));outline-offset:2px}
7060
7073
  .dsmm-rules-transaction{padding-top:16px}
7061
- .dsmm-scope-save{position:sticky;top:0;z-index:4;display:flex;flex-direction:column;gap:8px;padding:8px 0 12px;background:var(--dsw-alias-bg-module-platform,var(--dsw-alias-bg-layer-1));border-bottom:1px solid var(--dsw-alias-border-l4);margin-bottom:8px}
7062
- .dsmm-rules-save-bar{position:sticky;top:var(--dsmm-scope-save-offset,0px);z-index:3;display:flex;flex-wrap:wrap;align-items:center;justify-content:space-between;gap:8px;padding:8px 0;background:var(--dsw-alias-bg-module-platform,var(--dsw-alias-bg-layer-1));border-bottom:1px solid var(--dsw-alias-border-l4);margin-bottom:8px}
7074
+ .dsmm-scope-save{position:sticky;top:0;z-index:4;display:flex;flex-direction:column;gap:8px;padding:8px 0;background:var(--dsw-alias-bg-layer-2,var(--dsw-alias-bg-layer-1));border-bottom:1px solid var(--dsw-alias-border-l4);margin-bottom:8px}
7075
+ .dsmm-rules-save-bar{position:sticky;top:var(--dsmm-scope-save-offset,0px);z-index:3;display:flex;flex-wrap:wrap;align-items:center;justify-content:space-between;gap:8px;padding:8px 0;background:var(--dsw-alias-bg-layer-2,var(--dsw-alias-bg-layer-1));border-bottom:1px solid var(--dsw-alias-border-l4);margin-bottom:8px}
7063
7076
  .dsmm-deployment .dsmm-deployment-group{border-top:1px solid var(--dsw-alias-border-l4);padding-top:8px;min-width:0}
7064
7077
  .dsmm-deployment .dsmm-deployment-group>div{display:flex;flex-direction:column;gap:8px;padding-top:8px}
7065
7078
  .dsmm-deployment .dsmm-deployment-group>summary.dsmm-group-summary-row{display:flex;align-items:center;gap:8px;list-style:none}
@@ -7106,7 +7119,7 @@ var PROFILE_STYLES = `
7106
7119
  .dsmm-named-profiles .dsmm-advanced-settings>summary{font-weight:500}
7107
7120
  .dsmm-named-profiles .dsmm-advanced-settings>div{margin-top:12px;display:flex;flex-direction:column;gap:12px}
7108
7121
  .dsmm-named-profiles .dsmm-save-bar{position:sticky;top:0;z-index:5;display:flex;flex-direction:column;gap:8px;padding:8px 0 12px;background:var(--dsw-alias-bg-module-platform);border-bottom:1px solid var(--dsw-alias-border-l4);margin-bottom:4px}
7109
- .dsmm-dialog-top-bar{position:sticky;top:0;z-index:10;display:flex;flex-wrap:wrap;align-items:center;justify-content:space-between;gap:8px;padding:8px 0 12px;background:var(--dsw-alias-bg-layer-1,var(--dsw-alias-bg-module-platform));border-bottom:1px solid var(--dsw-alias-border-l4);flex-shrink:0}
7122
+ .dsmm-dialog-top-bar{position:sticky;top:0;z-index:10;display:flex;flex-wrap:wrap;align-items:center;justify-content:space-between;gap:8px;padding:8px 0;background:var(--dsw-alias-bg-layer-2,var(--dsw-alias-bg-layer-1));border-bottom:1px solid var(--dsw-alias-border-l4);flex-shrink:0}
7110
7123
  .dsmm-profiles :is(.dsmm-field, fieldset, details, .dsmm-zone, input, select, textarea){scroll-margin-top:calc(var(--dsmm-save-bar-offset, 48px) + 12px)}
7111
7124
  .dsmm-profile-models-dialog :is(.dsmm-field, .dsmm-dialog-role-card, fieldset, details, .dsmm-zone, input, select, textarea){scroll-margin-top:calc(var(--dsmm-dialog-bar-offset, 48px) + 12px)}
7112
7125
  .dsmm-deployment :is(.dsmm-field, fieldset, details, .dsmm-zone, input, select, textarea){scroll-margin-top:calc(var(--dsmm-scope-save-offset, 48px) + 12px)}
@@ -7121,35 +7134,40 @@ var PROFILE_STYLES = `
7121
7134
  .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)}
7122
7135
  .dsmm-profile-models-dialog-content,
7123
7136
  .dsmm-models-dialog-content,
7124
- .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}
7137
+ .dsmm-profile-models-dialog .dsmm-profile-models-dialog-content{overflow-y:auto!important;overflow-x:hidden;display:flex;flex-direction:column;gap:8px;padding:0 0 16px;min-height:0;flex:1 1 auto}
7138
+ .dsmm-profile-models-dialog-content > :last-child{margin-top:0}
7125
7139
  .dsmm-models-filter-bar,
7126
7140
  .dsmm-dialog-filter-bar,
7127
- .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}
7141
+ .dsmm-profile-models-dialog .dsmm-filter-bar{display:flex;flex-wrap:wrap;align-items:center;gap:12px;padding:4px 0 8px;border-bottom:1px solid var(--dsw-alias-border-l4);flex-shrink:0}
7128
7142
  .dsmm-models-filter-bar .dsmm-search-input,
7129
7143
  .dsmm-filter-search{flex:1 1 240px;min-width:0}
7144
+ .dsmm-filter-search .dsmm-input{height:32px}
7130
7145
  .dsmm-filter-label,
7131
- .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)}
7146
+ .dsmm-filter-override-toggle{display:inline-flex;align-items:center;gap:8px;height:32px;min-height:32px;cursor:pointer;font-size:13px;line-height:22px;user-select:none;color:var(--dsw-alias-label-primary)}
7147
+ .dsmm-filter-override-toggle input[type=checkbox]{margin:0;width:16px;height:16px;accent-color:var(--dsw-alias-state-business-primary);flex-shrink:0}
7132
7148
  .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}
7133
7149
  .dsmm-dialog-issue-title{font-weight:600;color:var(--dsw-alias-state-error-primary);margin:0}
7134
7150
  .dsmm-dialog-issue-action{display:flex;justify-content:flex-end;margin-top:4px}
7135
7151
  .dsmm-profile-models-dialog .dsmm-roles-list,
7136
7152
  .dsmm-profile-models-dialog .dsmm-dialog-roles-list{display:flex;flex-direction:column;gap:8px;min-width:0}
7137
7153
  .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}
7138
- .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}
7139
- .dsmm-profile-models-dialog .dsmm-dialog-role-header{display:flex;align-items:center;min-width:140px;flex:0 0 auto}
7154
+ .dsmm-profile-models-dialog .dsmm-role-main-row{display:flex;flex-wrap:wrap;align-items:flex-end;justify-content:flex-start;gap:8px 16px;min-width:0}
7155
+ .dsmm-profile-models-dialog .dsmm-dialog-role-header{display:flex;align-items:center;min-width:180px;width:200px;flex:0 0 200px;margin-bottom:6px}
7140
7156
  .dsmm-profile-models-dialog .dsmm-role-title-group{display:flex;align-items:center;flex-wrap:wrap;gap:6px;min-width:0}
7141
7157
  .dsmm-profile-models-dialog .dsmm-role-title{font-size:14px;font-weight:600;color:var(--dsw-alias-label-primary)}
7142
7158
  .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}
7143
7159
  .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}
7144
- .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}
7145
- .dsmm-profile-models-dialog .dsmm-role-primary-route .dsmm-primary-mode-field{flex:0 0 auto;min-width:110px}
7160
+ .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-start;min-width:0}
7161
+ .dsmm-profile-models-dialog .dsmm-role-primary-route .dsmm-primary-mode-field{flex:0 0 auto;min-width:110px;gap:2px}
7162
+ .dsmm-profile-models-dialog .dsmm-role-primary-route .dsmm-primary-mode-field label{font-size:12px;line-height:18px;color:var(--dsw-alias-label-secondary);margin:0;white-space:nowrap}
7146
7163
  .dsmm-profile-models-dialog .dsmm-role-primary-route .dsmm-primary-mode-field select{width:auto;min-width:110px;height:32px}
7147
7164
  .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}
7148
7165
  .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}
7166
+ .dsmm-profile-models-dialog .dsmm-role-primary-route .dsmm-route-fields>.dsmm-field label{font-size:12px;line-height:18px;color:var(--dsw-alias-label-secondary);margin:0;white-space:nowrap}
7149
7167
  .dsmm-profile-models-dialog .dsmm-role-primary-route .dsmm-route-fields select{width:100%;height:32px}
7150
7168
  .dsmm-profile-models-dialog .dsmm-role-primary-route .dsmm-route-fields .dsmm-input{height:32px}
7151
- .dsmm-profile-models-dialog .dsmm-route-inherited-hint{font-size:12px;color:var(--dsw-alias-label-secondary);padding:6px 0;line-height:20px}
7152
- .dsmm-profile-models-dialog .dsmm-orchestrator-tag{font-size:12px;color:var(--dsw-alias-label-secondary);padding:6px 0;line-height:20px}
7169
+ .dsmm-profile-models-dialog .dsmm-route-inherited-hint{font-size:12px;color:var(--dsw-alias-label-secondary);height:32px;display:inline-flex;align-items:center;line-height:20px}
7170
+ .dsmm-profile-models-dialog .dsmm-orchestrator-tag{font-size:12px;color:var(--dsw-alias-label-secondary);height:32px;display:inline-flex;align-items:center;line-height:20px}
7153
7171
  .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)}
7154
7172
  .dsmm-profile-models-dialog .dsmm-compact-details{display:inline-block;min-width:0}
7155
7173
  .dsmm-profile-models-dialog .dsmm-compact-details[open]{flex:1 1 100%;width:100%}
@@ -7165,6 +7183,7 @@ var PROFILE_STYLES = `
7165
7183
  .dsmm-profile-models-dialog{width:calc(100vw - 16px)!important;max-height:calc(100vh - 16px)}
7166
7184
  .dsmm-profile-models-dialog .dsmm-dialog-role-card{padding:10px}
7167
7185
  .dsmm-profile-models-dialog .dsmm-role-main-row{flex-direction:column;align-items:stretch;gap:8px}
7186
+ .dsmm-profile-models-dialog .dsmm-dialog-role-header{width:100%;min-width:0;flex:0 0 auto;margin-bottom:0}
7168
7187
  .dsmm-profile-models-dialog .dsmm-role-primary-route{flex-direction:column;align-items:stretch;gap:8px}
7169
7188
  .dsmm-profile-models-dialog .dsmm-role-primary-route .dsmm-route-fields{flex-wrap:wrap}
7170
7189
  .dsmm-profile-models-dialog .dsmm-role-primary-route .dsmm-route-fields>.dsmm-field{flex:1 1 100%;max-width:100%}
@@ -7741,6 +7760,8 @@ var deploymentEn = {
7741
7760
  unitChars: "characters",
7742
7761
  useDefaults: "Use defaults",
7743
7762
  restoreInheritance: "Restore inheritance",
7763
+ gitWriteAllWrites: "All write operations",
7764
+ gitWriteHighRisk: "High-risk write operations only",
7744
7765
  nativeRuntimeState: "Observed native runtime",
7745
7766
  nativeRuntimeBinding: "Observed runtime composition",
7746
7767
  nativeRuntimeFence: "Execution admission ready",
@@ -7844,6 +7865,8 @@ var deploymentZh = {
7844
7865
  unitChars: "字符",
7845
7866
  useDefaults: "使用默认值",
7846
7867
  restoreInheritance: "恢复继承",
7868
+ gitWriteAllWrites: "所有写操作",
7869
+ gitWriteHighRisk: "仅高风险写操作",
7847
7870
  nativeRuntimeState: "已观测原生运行时",
7848
7871
  nativeRuntimeBinding: "已观测运行时组合",
7849
7872
  nativeRuntimeFence: "执行准入已就绪",
@@ -7927,7 +7950,7 @@ var deploymentFieldLabels = {
7927
7950
  scope: ["Guard scope", "保护范围"],
7928
7951
  shellCommandSafety: ["Shell command safety", "Shell 命令安全"],
7929
7952
  gitWriteGuard: ["Git write policy", "Git 写入策略"],
7930
- gitWriteScope: ["Automatic Git write scope (all-writes / high-risk)", "自动 Git 写入范围(all-writes 全部写入 / high-risk 仅高危)"],
7953
+ gitWriteScope: ["Git write protection scope", "Git 写操作保护范围"],
7931
7954
  toolOutputTruncation: ["Tool output truncation", "工具输出截断"],
7932
7955
  maxInlineBytes: ["Inline byte limit", "内联字节上限"],
7933
7956
  planFormatValidation: ["Plan format validation", "计划格式校验"],
@@ -8738,6 +8761,7 @@ function Field({ schema, path, controller, initiallyOpen = false, disclosures, t
8738
8761
  };
8739
8762
  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);
8740
8763
  const choices = enumValues(schema), disabled = !controller.canEdit();
8764
+ const choiceLabel = (value) => name2 === "guards.gitWriteScope" && (value === "all-writes" || value === "high-risk") ? t(value === "all-writes" ? "gitWriteAllWrites" : "gitWriteHighRisk") : displayValue(value, t);
8741
8765
  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) }) });
8742
8766
  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) }) });
8743
8767
  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: [
@@ -8755,8 +8779,8 @@ function Field({ schema, path, controller, initiallyOpen = false, disclosures, t
8755
8779
  schema.type === "boolean" || choices !== null ? /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)(import_jsx_runtime10.Fragment, { children: [
8756
8780
  /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("label", { htmlFor: id2, children: fieldLabel(path, t) }),
8757
8781
  /* @__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: [
8758
- /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("option", { value: "inherit", children: `${unsetLabel} · ${displayValue(inherited, t)}` }),
8759
- (choices ?? [true, false]).map((choice2) => /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("option", { value: JSON.stringify(choice2), children: displayValue(choice2, t) }, String(choice2)))
8782
+ /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("option", { value: "inherit", children: `${unsetLabel} · ${choiceLabel(inherited)}` }),
8783
+ (choices ?? [true, false]).map((choice2) => /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("option", { value: JSON.stringify(choice2), children: choiceLabel(choice2) }, String(choice2)))
8760
8784
  ] })
8761
8785
  ] }) : /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(ScalarField, { schema, path, controller, inherited, t }),
8762
8786
  name2 === "modelParameters.passthrough" && /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("p", { className: "dsmm-hint", children: t("modelParametersHint") }),
@@ -9403,21 +9427,22 @@ function ScopeSave({ controller, workspace, refreshOnly = false, t }) {
9403
9427
  }
9404
9428
  };
9405
9429
  }, []);
9430
+ const status = refreshOnly ? state.busy ? t("loading") : "" : state.busy ? t("saving") : state.refreshRequired ? t("savedRefreshRequired") : state.saved ? t("saved") : state.dirty ? t("dirty") : "";
9406
9431
  return /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)("section", { ref, className: "dsmm-scope-save", "aria-label": t("saveScope"), children: [
9407
- /* @__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") : "" }),
9408
- !refreshOnly && pending.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)("p", { children: [
9432
+ /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)("div", { className: "dsmm-actions", children: [
9433
+ !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") }),
9434
+ /* @__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") }),
9435
+ !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") }),
9436
+ status !== "" && /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("p", { className: "dsmm-status", role: "status", "aria-live": "polite", children: status })
9437
+ ] }),
9438
+ !refreshOnly && pending.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)("p", { className: "dsmm-hint", children: [
9409
9439
  t("pendingModules"),
9410
9440
  ": ",
9411
9441
  pending.map((module2) => t(moduleTitle(module2))).join(" · ")
9412
9442
  ] }),
9413
9443
  state.issue !== null && /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("p", { className: "dsmm-issue", role: "alert", children: t(state.issue) }),
9414
9444
  !refreshOnly && state.invalidFields.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("p", { className: "dsmm-issue", role: "alert", children: t("invalid") }),
9415
- controller.layer === "profile" && !controller.canWriteProfile() && /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("p", { className: "dsmm-hint", children: t("unavailableForm") }),
9416
- /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)("div", { className: "dsmm-actions", children: [
9417
- !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") }),
9418
- /* @__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") }),
9419
- !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") })
9420
- ] })
9445
+ controller.layer === "profile" && !controller.canWriteProfile() && /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("p", { className: "dsmm-hint", children: t("unavailableForm") })
9421
9446
  ] });
9422
9447
  }
9423
9448
  function NativeRuntimeState({ value, t }) {
@@ -10004,7 +10029,7 @@ var roleToolEn = {
10004
10029
  output: "Complete result content",
10005
10030
  failure: "Error details",
10006
10031
  metadata: "Invocation metadata",
10007
- inspect: "Inspect tool call",
10032
+ inspect: "View call details",
10008
10033
  copy: "Copy",
10009
10034
  copied: "Copied",
10010
10035
  emptyArgs: "Arguments not available yet",
@@ -10040,7 +10065,7 @@ var roleToolZh = {
10040
10065
  output: "完整结果内容",
10041
10066
  failure: "错误详情",
10042
10067
  metadata: "调用元数据",
10043
- inspect: "检查工具调用",
10068
+ inspect: "查看调用详情",
10044
10069
  copy: "复制",
10045
10070
  copied: "已复制",
10046
10071
  emptyArgs: "参数尚不可用",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dsmm/dsmm",
3
- "version": "0.3.14",
3
+ "version": "0.3.15",
4
4
  "description": "Native Deepwork roles, routing, profiles, and permission controls for DeepSeek Harness.",
5
5
  "author": "Hugefiver",
6
6
  "license": "LicenseRef-AAAPL",