@sdata/web-vue-mcp 3.8.8 → 3.9.0

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/dist/index.js +41 -5
  2. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -6,7 +6,7 @@ import * as z from "zod/v4";
6
6
  //#region src/index.ts
7
7
  const data = {
8
8
  version: "5.7.6",
9
- generatedAt: "2026-10-04T04:22:22.180Z",
9
+ generatedAt: "2026-10-04T05:11:41.711Z",
10
10
  library: {
11
11
  "name": "@sdata/web-vue",
12
12
  "framework": "Vue 3",
@@ -11993,7 +11993,13 @@ const data = {
11993
11993
  "en": ""
11994
11994
  }
11995
11995
  }],
11996
- "aliases": ["clamp", "sd-clamp"]
11996
+ "aliases": ["clamp", "sd-clamp"],
11997
+ "variants": [
11998
+ "sd-line-clamp",
11999
+ "sd-inline-clamp",
12000
+ "sd-rich-line-clamp",
12001
+ "sd-wrap-clamp"
12002
+ ]
11997
12003
  },
11998
12004
  {
11999
12005
  "name": "sd-inline-clamp",
@@ -12060,7 +12066,13 @@ const data = {
12060
12066
  }
12061
12067
  ],
12062
12068
  "events": [],
12063
- "slots": []
12069
+ "slots": [],
12070
+ "variants": [
12071
+ "sd-line-clamp",
12072
+ "sd-inline-clamp",
12073
+ "sd-rich-line-clamp",
12074
+ "sd-wrap-clamp"
12075
+ ]
12064
12076
  },
12065
12077
  {
12066
12078
  "name": "sd-rich-line-clamp",
@@ -12160,7 +12172,13 @@ const data = {
12160
12172
  "zh": "",
12161
12173
  "en": ""
12162
12174
  }
12163
- }]
12175
+ }],
12176
+ "variants": [
12177
+ "sd-line-clamp",
12178
+ "sd-inline-clamp",
12179
+ "sd-rich-line-clamp",
12180
+ "sd-wrap-clamp"
12181
+ ]
12164
12182
  },
12165
12183
  {
12166
12184
  "name": "sd-wrap-clamp",
@@ -12261,6 +12279,12 @@ const data = {
12261
12279
  "en": ""
12262
12280
  }
12263
12281
  }
12282
+ ],
12283
+ "variants": [
12284
+ "sd-line-clamp",
12285
+ "sd-inline-clamp",
12286
+ "sd-rich-line-clamp",
12287
+ "sd-wrap-clamp"
12264
12288
  ]
12265
12289
  },
12266
12290
  {
@@ -16779,6 +16803,8 @@ for (const component of components) {
16779
16803
  byKey.set(component.importName.toLowerCase(), component);
16780
16804
  for (const alias of component.aliases ?? []) byKey.set(normalizeKey(alias), component);
16781
16805
  }
16806
+ /** 解析同组其它变体的完整条目;只查组名(如 clamp)时用于一次返回全部变体。 */
16807
+ const resolveVariants = (component) => (component.variants ?? []).map((name) => byKey.get(name.toLowerCase())).filter((entry) => Boolean(entry)).filter((entry) => entry.name !== component.name);
16782
16808
  const findComponent = (input) => {
16783
16809
  if (typeof input !== "string" || !input.trim()) return;
16784
16810
  return byKey.get(normalizeKey(input));
@@ -16801,6 +16827,7 @@ const summary = (component) => ({
16801
16827
  propCount: component.props.length,
16802
16828
  eventCount: component.events.length,
16803
16829
  slotCount: component.slots.length,
16830
+ ...component.variants?.length ? { variantCount: component.variants.length } : {},
16804
16831
  ...component.kind ? {
16805
16832
  kind: component.kind,
16806
16833
  configCount: component.config?.length ?? 0,
@@ -16834,6 +16861,7 @@ const search = (query) => {
16834
16861
  component.title,
16835
16862
  component.description,
16836
16863
  ...component.aliases ?? [],
16864
+ ...component.variants ?? [],
16837
16865
  ...[
16838
16866
  ...component.props,
16839
16867
  ...component.config ?? [],
@@ -16885,7 +16913,7 @@ const findByProp = (prop) => {
16885
16913
  const createServer = () => {
16886
16914
  const server = new McpServer({
16887
16915
  name: PKG_NAME,
16888
- version: "3.8.8"
16916
+ version: "3.9.0"
16889
16917
  });
16890
16918
  server.registerTool("list_components", {
16891
16919
  description: "List all SD Design components with their category, bilingual title and API size. Optionally filter by category. Use this first to discover what is available.",
@@ -16920,12 +16948,20 @@ const createServer = () => {
16920
16948
  }, ({ name }) => {
16921
16949
  const component = findComponent(name);
16922
16950
  if (!component) return notFound(name);
16951
+ const variants = resolveVariants(component);
16923
16952
  return result({
16924
16953
  ...summary(component),
16925
16954
  import: importStatements(component),
16926
16955
  props: component.props,
16927
16956
  events: component.events,
16928
16957
  slots: component.slots,
16958
+ ...variants.length ? { variants: variants.map((variant) => ({
16959
+ ...summary(variant),
16960
+ import: importStatements(variant),
16961
+ props: variant.props,
16962
+ events: variant.events,
16963
+ slots: variant.slots
16964
+ })) } : {},
16929
16965
  ...component.kind ? {
16930
16966
  config: component.config,
16931
16967
  methods: component.methods
package/package.json CHANGED
@@ -64,7 +64,7 @@
64
64
  "engines": {
65
65
  "node": ">=20"
66
66
  },
67
- "version": "3.8.8",
67
+ "version": "3.9.0",
68
68
  "scripts": {
69
69
  "gen": "node ./scripts/gen-component-data.ts",
70
70
  "build": "node ./scripts/build.ts",