@morehao/dsh-skills-console 0.3.0 → 0.3.1

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.
Files changed (2) hide show
  1. package/client.js +43 -17
  2. package/package.json +1 -1
package/client.js CHANGED
@@ -138,7 +138,7 @@ var DICT = {
138
138
  "links.hint": "保存后按勾选建立或移除接入;技能本体保留在原位置,不会移动。",
139
139
  "autoLink.detected": "安装后自动接入",
140
140
  "autoLink.none": "本机没有检测到其他 Agent",
141
- "autoLink.hint": "dsh(全局)始终接入;这里只影响之后安装时的自动接入,已安装的技能请在「接入设置」里改。",
141
+ "autoLink.hint": "列表里的「dsh(全局)」固定勾选、不能取消;这里只影响之后安装时的自动接入,已安装的技能请在「接入设置」里改。",
142
142
  "empty.skills": "还没有安装任何技能",
143
143
  "empty.skillsHint": "在终端跑 `npx skills add owner/repo`,或点右上角「添加技能」",
144
144
  "empty.subs": "还没有添加订阅",
@@ -268,7 +268,7 @@ var DICT = {
268
268
  "links.hint": "Saving only adds or removes links; the skill itself stays where it is.",
269
269
  "autoLink.detected": "Auto-link after install",
270
270
  "autoLink.none": "No other agents detected on this machine",
271
- "autoLink.hint": 'dsh (global) is always linked; this only affects future installs. Change existing skills under "Link settings".',
271
+ "autoLink.hint": 'The "dsh (global)" entry is always checked and cannot be unchecked; this only affects future installs. Change existing skills under "Link settings".',
272
272
  "empty.skills": "No skills installed yet",
273
273
  "empty.skillsHint": 'Run `npx skills add owner/repo` or use "Add skill".',
274
274
  "empty.subs": "No subscriptions yet",
@@ -945,6 +945,9 @@ var CSS = `
945
945
  .dshsc-panel { border: 1px solid var(--dsw-alias-border-l1); border-radius: 10px; background: var(--dsw-alias-bg-layer-1);
946
946
  padding: 4px; max-height: 300px; overflow: auto; display: flex; flex-direction: column; }
947
947
  .dshsc-panel .dshsc-check:hover { background: var(--dsw-alias-bg-layer-2); }
948
+ /* 必选项(dsh 全局):勾着但不可改,别让它看起来能点 */
949
+ .dshsc-panel .dshsc-check.locked { cursor: default; }
950
+ .dshsc-panel .dshsc-check.locked:hover { background: transparent; }
948
951
 
949
952
  .dshsc-modal-foot { display: flex; justify-content: flex-end; gap: 8px; padding-top: 12px; border-top: 1px solid var(--dsw-alias-border-l1); }
950
953
  .dshsc-toast { position: fixed; right: 18px; bottom: 18px; z-index: 70; font-size: 12px; padding: 10px 13px; border-radius: 9px;
@@ -1976,7 +1979,7 @@ function LinksModal({ t, row, agents, workspaces, pickDirectory, onCancel, onSav
1976
1979
  h("p", { className: "dshsc-sub" }, t("links.canonical").replace("{path}", `~/.agents/skills/${row.name}`)),
1977
1980
  ...candidates.map((agent) => h(
1978
1981
  "label",
1979
- { className: "dshsc-check", key: agent.target },
1982
+ { className: `dshsc-check${agent.target === "dsh-global" ? " locked" : ""}`, key: agent.target },
1980
1983
  h("input", {
1981
1984
  type: "checkbox",
1982
1985
  checked: agent.target === "dsh-global" ? true : targets.has(agent.target),
@@ -2034,7 +2037,7 @@ function LinksModal({ t, row, agents, workspaces, pickDirectory, onCancel, onSav
2034
2037
  h("p", { className: "dshsc-sub" }, t("links.hint"))
2035
2038
  );
2036
2039
  }
2037
- function AutoLinkModal({ t, settings, agents, onCancel, onSave }) {
2040
+ function AutoLinkModal({ t, settings, agents, dsh, onCancel, onSave }) {
2038
2041
  const [targets, setTargets] = import_react3.default.useState(() => new Set(
2039
2042
  Array.isArray(settings.autoLinkTargets) ? settings.autoLinkTargets : agents.map((agent) => agent.target)
2040
2043
  ));
@@ -2055,19 +2058,39 @@ function AutoLinkModal({ t, settings, agents, onCancel, onSave }) {
2055
2058
  h("button", { key: "s", className: "dshsc-btn primary", onClick: () => onSave([...targets]) }, t("action.save"))
2056
2059
  ]
2057
2060
  },
2058
- h("p", { className: "dshsc-sub" }, t("links.dshGlobal") + " · " + t("links.required")),
2059
2061
  h("div", { className: "dshsc-group" }, t("autoLink.detected")),
2060
- agents.length === 0 ? h("p", { className: "dshsc-sub" }, t("autoLink.none")) : h("div", { className: "dshsc-panel" }, agents.map((agent) => h(
2061
- "label",
2062
- { className: "dshsc-check", key: agent.target },
2063
- h("input", {
2064
- type: "checkbox",
2065
- checked: targets.has(agent.target),
2066
- onChange: () => toggle(agent.target)
2067
- }),
2068
- h("span", null, agent.label),
2069
- h("small", null, agent.dir)
2070
- ))),
2062
+ h(
2063
+ "div",
2064
+ { className: "dshsc-panel" },
2065
+ // dsh(全局)始终接入:列表里也勾上,只是不能改,勾选数与页头的计数器才对得上
2066
+ h(
2067
+ "label",
2068
+ { className: "dshsc-check locked", key: "dsh-global" },
2069
+ h("input", {
2070
+ type: "checkbox",
2071
+ checked: true,
2072
+ disabled: true,
2073
+ readOnly: true,
2074
+ onChange: () => {
2075
+ }
2076
+ }),
2077
+ h("span", null, dsh?.label || t("links.dshGlobal")),
2078
+ h("small", null, t("links.required")),
2079
+ dsh?.dir ? h("small", { title: dsh.dir }, dsh.dir) : null
2080
+ ),
2081
+ ...agents.map((agent) => h(
2082
+ "label",
2083
+ { className: "dshsc-check", key: agent.target },
2084
+ h("input", {
2085
+ type: "checkbox",
2086
+ checked: targets.has(agent.target),
2087
+ onChange: () => toggle(agent.target)
2088
+ }),
2089
+ h("span", null, agent.label),
2090
+ h("small", null, agent.dir)
2091
+ ))
2092
+ ),
2093
+ agents.length === 0 ? h("p", { className: "dshsc-sub" }, t("autoLink.none")) : null,
2071
2094
  h("p", { className: "dshsc-sub" }, t("autoLink.hint"))
2072
2095
  );
2073
2096
  }
@@ -2211,7 +2234,7 @@ function AddSkillModal({ t, onCancel, onProbe, onInstall }) {
2211
2234
  h("p", { className: "dshsc-sub" }, t("form.hint"))
2212
2235
  );
2213
2236
  }
2214
- function Modals({ t, modal, data, autoLinkAgents, pickDirectory, actions, onClose, onSaveAutoLink }) {
2237
+ function Modals({ t, modal, data, autoLinkAgents, autoLinkDsh, pickDirectory, actions, onClose, onSaveAutoLink }) {
2215
2238
  if (modal.type === "add-skill") {
2216
2239
  return h(AddSkillModal, {
2217
2240
  t,
@@ -2253,6 +2276,7 @@ function Modals({ t, modal, data, autoLinkAgents, pickDirectory, actions, onClos
2253
2276
  t,
2254
2277
  settings: data?.settings || {},
2255
2278
  agents: autoLinkAgents,
2279
+ dsh: autoLinkDsh,
2256
2280
  onCancel: onClose,
2257
2281
  onSave: (targets) => void onSaveAutoLink(targets)
2258
2282
  });
@@ -2327,6 +2351,7 @@ function Section({ t, page = false, pickDirectory, onPlacementChange }) {
2327
2351
  const autolinkTargets = (data?.agents?.detected || []).filter((agent) => agent.kind === "agent");
2328
2352
  const autoLinkSelection = data?.settings?.autoLinkTargets;
2329
2353
  const autoLinkAgents = Array.isArray(autoLinkSelection) ? autolinkTargets.filter((agent) => autoLinkSelection.includes(agent.target)) : autolinkTargets;
2354
+ const autoLinkDsh = (data?.agents?.all || []).find((agent) => agent.target === "dsh-global") || null;
2330
2355
  const autoLinkLabel = [t("links.dshGlobal"), ...autoLinkAgents.map((agent) => agent.label)].join("、");
2331
2356
  const placement = (placementOverride ?? data?.settings?.placement) === "sidebar" ? "sidebar" : "settings";
2332
2357
  async function changePlacement(next) {
@@ -2442,6 +2467,7 @@ function Section({ t, page = false, pickDirectory, onPlacementChange }) {
2442
2467
  modal,
2443
2468
  data,
2444
2469
  autoLinkAgents: autolinkTargets,
2470
+ autoLinkDsh,
2445
2471
  pickDirectory,
2446
2472
  actions: {
2447
2473
  probeSkills: actions.probeSkills,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@morehao/dsh-skills-console",
3
- "version": "0.3.0",
3
+ "version": "0.3.1",
4
4
  "description": "统一管理本地技能的安装、更新、删除与接入,让同一份技能在多个 Agent 间复用。A skill manager for DeepSeek Harness: install, update, remove, link and toggle agent skills.",
5
5
  "license": "MIT",
6
6
  "author": "morehao <morehao@qq.com>",