@max-null/dsh-skill-mcp-center 0.6.1 → 0.6.2

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 +26 -11
  2. package/package.json +1 -1
package/client.js CHANGED
@@ -31,6 +31,17 @@ __export(index_exports, {
31
31
  });
32
32
  module.exports = __toCommonJS(index_exports);
33
33
  var import_react = require("react");
34
+
35
+ // client/skill-key.ts
36
+ var RUNTIME_KEY_PREFIX = "\0runtime:";
37
+ function skillKeyOf(skill) {
38
+ return skill.path === "" ? `${RUNTIME_KEY_PREFIX}${skill.name}` : skill.path;
39
+ }
40
+ function hasSkillFile(skill) {
41
+ return skill.path !== "";
42
+ }
43
+
44
+ // client/index.tsx
34
45
  var import_jsx_runtime = require("react/jsx-runtime");
35
46
  var CSS = `
36
47
  .smc-title { font-size: 18px; font-weight: 600; line-height: 26px; color: var(--dsw-alias-label-primary); }
@@ -255,6 +266,7 @@ var zhDict = {
255
266
  nsWorkspace: "\u5DE5\u4F5C\u533A",
256
267
  noWorkspace: "\u672A\u9009\u62E9\u5DE5\u4F5C\u533A",
257
268
  viewMd: "\u67E5\u770B SKILL.md",
269
+ noSkillFile: "\u65E0 SKILL.md",
258
270
  hideMd: "\u6536\u8D77",
259
271
  mdLoadFailed: "\u8BFB\u53D6\u5931\u8D25\uFF1A{e}",
260
272
  refOpen: "\u6253\u5F00\u6587\u4EF6\u5F15\u7528",
@@ -319,6 +331,7 @@ var enDict = {
319
331
  nsWorkspace: "Workspace",
320
332
  noWorkspace: "No workspace selected",
321
333
  viewMd: "View SKILL.md",
334
+ noSkillFile: "no SKILL.md",
322
335
  hideMd: "Hide",
323
336
  mdLoadFailed: "Failed to read: {e}",
324
337
  refOpen: "Open file reference",
@@ -470,13 +483,14 @@ function SkillView() {
470
483
  );
471
484
  };
472
485
  const openMd = (s) => {
473
- if (mdPath === s.path) {
486
+ if (!hasSkillFile(s)) return;
487
+ if (mdPath === skillKeyOf(s)) {
474
488
  setMdPath(null);
475
489
  setMdText(null);
476
490
  setMdError(null);
477
491
  return;
478
492
  }
479
- setMdPath(s.path);
493
+ setMdPath(skillKeyOf(s));
480
494
  setMdText(null);
481
495
  setMdError(null);
482
496
  void rpc("readSkill", { path: s.path }).then(
@@ -498,7 +512,7 @@ function SkillView() {
498
512
  else other.push(s);
499
513
  }
500
514
  const renderCard = (s) => {
501
- const open = expanded === s.path;
515
+ const open = expanded === skillKeyOf(s);
502
516
  return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: "smc-card", children: [
503
517
  /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: "smc-card-head", children: [
504
518
  /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(
@@ -509,7 +523,7 @@ function SkillView() {
509
523
  "aria-expanded": open,
510
524
  title: t("clickForDetail"),
511
525
  onClick: () => {
512
- setExpanded(open ? null : s.path);
526
+ setExpanded(open ? null : skillKeyOf(s));
513
527
  },
514
528
  children: [
515
529
  /* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", { className: "smc-card-name", children: s.name }),
@@ -543,9 +557,9 @@ function SkillView() {
543
557
  !s.modelInvocable && /* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", { className: "smc-badge disabled", children: t("modelDisabled") }),
544
558
  !s.writable && /* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", { className: "smc-badge disabled", children: t("readOnlyBadge") }),
545
559
  /* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", { className: "smc-spacer" }),
546
- /* @__PURE__ */ (0, import_jsx_runtime.jsx)("button", { type: "button", className: "smc-btn", onClick: () => {
560
+ !hasSkillFile(s) ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", { className: "smc-badge disabled", children: t("noSkillFile") }) : /* @__PURE__ */ (0, import_jsx_runtime.jsx)("button", { type: "button", className: "smc-btn", onClick: () => {
547
561
  openMd(s);
548
- }, children: mdPath === s.path ? t("hideMd") : t("viewMd") }),
562
+ }, children: mdPath === skillKeyOf(s) ? t("hideMd") : t("viewMd") }),
549
563
  s.writable && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
550
564
  "button",
551
565
  {
@@ -562,11 +576,11 @@ function SkillView() {
562
576
  /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: "smc-detail-row", children: [
563
577
  t("detailPath"),
564
578
  "\uFF1A",
565
- s.path
579
+ hasSkillFile(s) ? s.path : t("noSkillFile")
566
580
  ] }),
567
- mdPath === s.path && (mdError !== null ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: "smc-md-err", children: t("mdLoadFailed", { e: mdError }) }) : mdText === null ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: "smc-md", children: t("loading") }) : /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: "smc-md", children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(MdWithRefs, { text: mdText }) }))
581
+ mdPath === skillKeyOf(s) && (mdError !== null ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: "smc-md-err", children: t("mdLoadFailed", { e: mdError }) }) : mdText === null ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: "smc-md", children: t("loading") }) : /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: "smc-md", children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(MdWithRefs, { text: mdText }) }))
568
582
  ] })
569
- ] }, s.path);
583
+ ] }, skillKeyOf(s));
570
584
  };
571
585
  return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { children: [
572
586
  /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: "smc-toolbar", children: [
@@ -906,6 +920,7 @@ function SidebarSkillTab({ visible, cwd }) {
906
920
  );
907
921
  };
908
922
  const openMd = (path) => {
923
+ if (path === "") return;
909
924
  if (mdPath === path) {
910
925
  setMdPath(null);
911
926
  setMdText(null);
@@ -969,7 +984,7 @@ ${s.path}`, children: [
969
984
  /* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", { className: "smc-srv-name", children: s.name }),
970
985
  !s.modelInvocable && /* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", { className: "smc-badge", children: t("modelDisabled") }),
971
986
  !s.writable && /* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", { className: "smc-badge", children: sourceLabel(s.source, true) }),
972
- /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
987
+ hasSkillFile(s) && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
973
988
  "button",
974
989
  {
975
990
  type: "button",
@@ -1012,7 +1027,7 @@ ${s.path}`, children: [
1012
1027
  ] }),
1013
1028
  s.description !== "" && /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: "smc-srv-desc", children: s.description }),
1014
1029
  mdPath === s.path && (mdError !== null ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: "smc-md-err", children: t("mdLoadFailed", { e: mdError }) }) : mdText === null ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: "smc-md", children: t("loading") }) : /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: "smc-md", children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(MdWithRefs, { text: mdText }) }))
1015
- ] }, s.path === "" ? `runtime:${s.name}` : s.path))
1030
+ ] }, skillKeyOf(s)))
1016
1031
  ] }, group.kind)) })
1017
1032
  ] });
1018
1033
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@max-null/dsh-skill-mcp-center",
3
- "version": "0.6.1",
3
+ "version": "0.6.2",
4
4
  "description": "Skill & MCP management center for DeepSeek Harness — manage skills and MCP servers in Settings, live MCP status in the sidebar",
5
5
  "license": "MIT",
6
6
  "publishConfig": {