dsh-plugin-capabilities 0.3.0 → 0.3.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.
package/lib/client.js CHANGED
@@ -140,11 +140,22 @@ var CSS = `
140
140
  .dpc-format .dpc-form{margin-top:8px}
141
141
  .dpc-formatHint{margin:2px 0 0;font-size:12px;line-height:18px;color:var(--dsw-alias-label-tertiary)}
142
142
  .dpc-code{margin:4px 0 8px;border:1px solid var(--dsw-alias-border-l2);border-radius:6px;padding:8px 10px;overflow-x:auto;background:var(--dsw-alias-bg-layer-3);color:var(--dsw-alias-label-primary);font-family:var(--ds-font-family-code);font-size:11px;line-height:17px;white-space:pre}
143
- /* Market detail modal. */
143
+ /* Market detail modal. The host dialog card is a fixed 380px column with no
144
+ scroll, which the long-form intros turn into a clipped strip \u2014 widen it
145
+ (doubled selector outranks the module class regardless of style order),
146
+ cap the height, and scroll inside the content region. */
147
+ .dpc-marketDialog.dpc-marketDialog{width:min(720px,100%);max-height:calc(100vh - 48px)}
148
+ .dpc-marketContent{overflow-y:auto;min-height:0}
149
+ .dpc-detailTagsRow{display:flex;flex-wrap:wrap;gap:4px;margin:0 0 8px}
144
150
  .dpc-detailDesc{margin:0;font-size:13px;line-height:20px}
145
- .dpc-detailSection{margin-top:12px;display:flex;flex-direction:column;gap:6px}
151
+ .dpc-detailSection{margin-top:14px;display:flex;flex-direction:column;gap:6px}
146
152
  .dpc-detailLabel{font-size:11px;line-height:16px;color:var(--dsw-alias-label-secondary)}
147
153
  .dpc-detailTags{display:flex;flex-wrap:wrap;gap:4px}
154
+ .dpc-skillList{margin:0;padding:0;list-style:none;display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:4px 18px}
155
+ .dpc-skillItem{display:flex;gap:8px;align-items:baseline;font-size:12px;line-height:18px;min-width:0}
156
+ .dpc-skillName{font-family:var(--ds-font-family-code);color:var(--dsw-alias-label-primary);white-space:nowrap;flex:none}
157
+ .dpc-skillDesc{color:var(--dsw-alias-label-secondary);min-width:0}
158
+ @media(max-width:560px){.dpc-skillList{grid-template-columns:minmax(0,1fr)}}
148
159
  @media(max-width:680px){.dpc-cards{grid-template-columns:minmax(0,1fr)}}
149
160
  `;
150
161
 
@@ -246,6 +257,7 @@ function MarketTab(props) {
246
257
  const pick = (base, zh2) => zhUi() && zh2 !== void 0 ? zh2 : base;
247
258
  const title = (entry) => pick(entry.name, entry.nameZh);
248
259
  const desc = (entry) => pick(entry.description, entry.descriptionZh);
260
+ const longText = (entry) => entry.detail !== void 0 ? pick(entry.detail, entry.detailZh) : desc(entry);
249
261
  const cardStop = (event) => {
250
262
  event.stopPropagation();
251
263
  };
@@ -339,6 +351,9 @@ function MarketTab(props) {
339
351
  open: detailRepo !== null || detailServer !== null,
340
352
  onClose: () => setDetail(null),
341
353
  title: detailRepo !== null ? title(detailRepo) : detailServer !== null ? title(detailServer) : "",
354
+ closeLabel: t("close"),
355
+ className: "dpc-marketDialog",
356
+ contentClassName: "dpc-marketContent",
342
357
  footer: /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_jsx_runtime.Fragment, { children: [
343
358
  detailRepo !== null && /* @__PURE__ */ (0, import_jsx_runtime.jsx)("a", { className: "dpc-link", href: detailRepo.homepage ?? detailRepo.url, target: "_blank", rel: "noreferrer", children: t("marketHome") }),
344
359
  detailServer !== null && /* @__PURE__ */ (0, import_jsx_runtime.jsx)("a", { className: "dpc-link", href: detailServer.homepage, target: "_blank", rel: "noreferrer", children: t("marketHome") }),
@@ -359,15 +374,28 @@ function MarketTab(props) {
359
374
  ), children: t("marketUninstall") }) : /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_dsh_client_ui_primitives.Button, { variant: "primary", disabled: busyId !== null, onClick: () => void doInstallMcp(detailServer), children: busyId === detailServer.id ? t("marketInstalling") : t("marketAdd") }))
360
375
  ] }),
361
376
  children: [
377
+ (detailRepo !== null || detailServer !== null) && /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: "dpc-detailTagsRow", children: [
378
+ detailRepo !== null && detailRepo.skillCount !== void 0 && /* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", { className: "dpc-tag", children: t("marketSkillCount").replace("{n}", String(detailRepo.skillCount)) }),
379
+ detailRepo !== null && detailRepo.installedId !== null && /* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", { className: "dpc-tag", "data-kind": "source", children: t("marketInstalled") }),
380
+ detailServer !== null && /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_jsx_runtime.Fragment, { children: [
381
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", { className: "dpc-tag", children: detailServer.transport }),
382
+ detailServer.runtime !== void 0 && /* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", { className: "dpc-tag", children: detailServer.runtime }),
383
+ detailServer.category !== void 0 && /* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", { className: "dpc-tag", children: detailServer.category }),
384
+ detailServer.installed && /* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", { className: "dpc-tag", "data-kind": "source", children: t("marketInstalled") })
385
+ ] })
386
+ ] }),
362
387
  detailRepo !== null && /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_jsx_runtime.Fragment, { children: [
363
- /* @__PURE__ */ (0, import_jsx_runtime.jsx)("p", { className: "dpc-detailDesc", children: desc(detailRepo) }),
388
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)("p", { className: "dpc-detailDesc", children: longText(detailRepo) }),
364
389
  detailRepo.skills !== void 0 && detailRepo.skills.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: "dpc-detailSection", children: [
365
390
  /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: "dpc-detailLabel", children: t("marketSkillListLabel") }),
366
- /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: "dpc-detailTags", children: detailRepo.skills.map((name2) => /* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", { className: "dpc-tag", children: name2 }, name2)) })
391
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)("ul", { className: "dpc-skillList", children: detailRepo.skills.map((item) => /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("li", { className: "dpc-skillItem", children: [
392
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)("code", { className: "dpc-skillName", children: item.name }),
393
+ item.description !== void 0 && /* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", { className: "dpc-skillDesc", children: pick(item.description, item.descriptionZh) })
394
+ ] }, item.name)) })
367
395
  ] })
368
396
  ] }),
369
397
  detailServer !== null && /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_jsx_runtime.Fragment, { children: [
370
- /* @__PURE__ */ (0, import_jsx_runtime.jsx)("p", { className: "dpc-detailDesc", children: desc(detailServer) }),
398
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)("p", { className: "dpc-detailDesc", children: longText(detailServer) }),
371
399
  detailServer.command !== void 0 && /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: "dpc-detailSection", children: [
372
400
  /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: "dpc-detailLabel", children: t("marketCommandLabel") }),
373
401
  /* @__PURE__ */ (0, import_jsx_runtime.jsx)("code", { className: "dpc-code", children: [detailServer.command, ...detailServer.args ?? []].join(" ") })