@lobehub/market-types 1.0.1 → 1.0.3

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.
@@ -0,0 +1,372 @@
1
+ import { z } from 'zod';
2
+
3
+ /**
4
+ * 市场列表中单个资源项的基础结构
5
+ */
6
+ interface MarketItemBase {
7
+ /** 全局唯一标识符, 通常包含作者/命名空间和名称 */
8
+ identifier: string;
9
+ /** 在市场列表中显示的名称 (已本地化) */
10
+ name: string;
11
+ /** 在市场列表中显示的简短描述 (已本地化) */
12
+ description: string;
13
+ /** 指向该资源详细 Manifest 文件的 URL */
14
+ manifestUrl: string;
15
+ /** 作者或组织名称 */
16
+ author?: string;
17
+ /** 资源在市场中创建的日期 (ISO 8601) */
18
+ createdAt: string;
19
+ /** 资源在市场中最后更新的日期 (ISO 8601) */
20
+ updatedAt: string;
21
+ /** 资源的主页或文档链接 */
22
+ homepage?: string;
23
+ /** 图标 URL 或 Emoji */
24
+ icon?: string;
25
+ /** 标签列表 (已本地化) */
26
+ tags?: string[];
27
+ /** 分类名称 */
28
+ category?: string;
29
+ /** 可选:兼容性信息 */
30
+ compatibility?: Record<string, any>;
31
+ }
32
+
33
+ declare const PluginCapabilitiesSchema: z.ZodObject<{
34
+ tools: z.ZodDefault<z.ZodBoolean>;
35
+ prompts: z.ZodDefault<z.ZodBoolean>;
36
+ resources: z.ZodDefault<z.ZodBoolean>;
37
+ }, "strip", z.ZodTypeAny, {
38
+ tools: boolean;
39
+ prompts: boolean;
40
+ resources: boolean;
41
+ }, {
42
+ tools?: boolean | undefined;
43
+ prompts?: boolean | undefined;
44
+ resources?: boolean | undefined;
45
+ }>;
46
+ /**
47
+ * 工具项定义
48
+ */
49
+ interface PluginTool {
50
+ name: string;
51
+ description?: string;
52
+ inputSchema?: Record<string, any>;
53
+ }
54
+ /**
55
+ * 资源项定义
56
+ */
57
+ interface PluginResource {
58
+ uri: string;
59
+ name?: string;
60
+ mimeType?: string;
61
+ }
62
+ /**
63
+ * 提示词参数定义
64
+ */
65
+ interface PromptArgument {
66
+ name: string;
67
+ required?: boolean;
68
+ description?: string;
69
+ type?: string;
70
+ }
71
+ /**
72
+ * 提示词项定义
73
+ */
74
+ interface PluginPrompt {
75
+ name: string;
76
+ description: string;
77
+ arguments?: PromptArgument[];
78
+ }
79
+
80
+ /**
81
+ * 连接类型
82
+ */
83
+ declare const ConnectionTypeEnum: z.ZodEnum<["http", "stdio"]>;
84
+ type ConnectionType = z.infer<typeof ConnectionTypeEnum>;
85
+ /**
86
+ * MCP安装方法
87
+ */
88
+ declare const InstallationMethodEnum: z.ZodEnum<["npm", "go", "python", "docker", "git", "binaryUrl", "manual", "none"]>;
89
+ type InstallationMethod = z.infer<typeof InstallationMethodEnum>;
90
+ /**
91
+ * 系统依赖项
92
+ */
93
+ interface SystemDependency {
94
+ name: string;
95
+ type?: string;
96
+ requiredVersion?: string;
97
+ checkCommand?: string;
98
+ installInstructions?: Record<string, string>;
99
+ versionParsingRequired?: boolean;
100
+ description?: string;
101
+ }
102
+ /**
103
+ * MCP连接配置
104
+ */
105
+ interface ConnectionConfig {
106
+ type: ConnectionType;
107
+ command?: string;
108
+ args?: string[];
109
+ url?: string;
110
+ }
111
+ interface InstallationDetails {
112
+ packageName?: string;
113
+ repositoryUrlToClone?: string;
114
+ setupSteps?: string[];
115
+ }
116
+ /**
117
+ * MCP部署选项
118
+ */
119
+ interface DeploymentOption {
120
+ installationMethod: string;
121
+ installationDetails?: InstallationDetails;
122
+ connection: ConnectionConfig;
123
+ isRecommended?: boolean;
124
+ description?: string;
125
+ systemDependencies?: SystemDependency[];
126
+ }
127
+
128
+ /**
129
+ * 兼容性信息
130
+ */
131
+ interface PluginCompatibility {
132
+ platforms?: string[];
133
+ minAppVersion?: string;
134
+ maxAppVersion?: string;
135
+ }
136
+ declare const BasePluginItemSchema: z.ZodObject<{
137
+ identifier: z.ZodString;
138
+ name: z.ZodString;
139
+ description: z.ZodString;
140
+ manifestUrl: z.ZodString;
141
+ author: z.ZodOptional<z.ZodString>;
142
+ createdAt: z.ZodString;
143
+ updatedAt: z.ZodString;
144
+ homepage: z.ZodOptional<z.ZodString>;
145
+ icon: z.ZodOptional<z.ZodString>;
146
+ tags: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
147
+ category: z.ZodOptional<z.ZodString>;
148
+ capabilities: z.ZodObject<{
149
+ tools: z.ZodDefault<z.ZodBoolean>;
150
+ prompts: z.ZodDefault<z.ZodBoolean>;
151
+ resources: z.ZodDefault<z.ZodBoolean>;
152
+ }, "strip", z.ZodTypeAny, {
153
+ tools: boolean;
154
+ prompts: boolean;
155
+ resources: boolean;
156
+ }, {
157
+ tools?: boolean | undefined;
158
+ prompts?: boolean | undefined;
159
+ resources?: boolean | undefined;
160
+ }>;
161
+ toolsCount: z.ZodOptional<z.ZodNumber>;
162
+ promptsCount: z.ZodOptional<z.ZodNumber>;
163
+ resourcesCount: z.ZodOptional<z.ZodNumber>;
164
+ isValidated: z.ZodDefault<z.ZodBoolean>;
165
+ installCount: z.ZodDefault<z.ZodNumber>;
166
+ ratingAverage: z.ZodOptional<z.ZodNumber>;
167
+ ratingCount: z.ZodDefault<z.ZodNumber>;
168
+ commentCount: z.ZodDefault<z.ZodNumber>;
169
+ isFeatured: z.ZodDefault<z.ZodBoolean>;
170
+ }, "strip", z.ZodTypeAny, {
171
+ identifier: string;
172
+ name: string;
173
+ description: string;
174
+ manifestUrl: string;
175
+ createdAt: string;
176
+ updatedAt: string;
177
+ capabilities: {
178
+ tools: boolean;
179
+ prompts: boolean;
180
+ resources: boolean;
181
+ };
182
+ isValidated: boolean;
183
+ installCount: number;
184
+ ratingCount: number;
185
+ commentCount: number;
186
+ isFeatured: boolean;
187
+ author?: string | undefined;
188
+ homepage?: string | undefined;
189
+ icon?: string | undefined;
190
+ tags?: string[] | undefined;
191
+ category?: string | undefined;
192
+ toolsCount?: number | undefined;
193
+ promptsCount?: number | undefined;
194
+ resourcesCount?: number | undefined;
195
+ ratingAverage?: number | undefined;
196
+ }, {
197
+ identifier: string;
198
+ name: string;
199
+ description: string;
200
+ manifestUrl: string;
201
+ createdAt: string;
202
+ updatedAt: string;
203
+ capabilities: {
204
+ tools?: boolean | undefined;
205
+ prompts?: boolean | undefined;
206
+ resources?: boolean | undefined;
207
+ };
208
+ author?: string | undefined;
209
+ homepage?: string | undefined;
210
+ icon?: string | undefined;
211
+ tags?: string[] | undefined;
212
+ category?: string | undefined;
213
+ toolsCount?: number | undefined;
214
+ promptsCount?: number | undefined;
215
+ resourcesCount?: number | undefined;
216
+ isValidated?: boolean | undefined;
217
+ installCount?: number | undefined;
218
+ ratingAverage?: number | undefined;
219
+ ratingCount?: number | undefined;
220
+ commentCount?: number | undefined;
221
+ isFeatured?: boolean | undefined;
222
+ }>;
223
+ /**
224
+ * Plugin (MCP Server) 类型资源项的定义 (继承基础结构)
225
+ * 注: 这个定义会与现有的 PluginItem 结构进行整合
226
+ */
227
+ interface MarketPluginItem extends MarketItemBase {
228
+ capabilities?: {
229
+ tools: boolean;
230
+ prompts: boolean;
231
+ resources: boolean;
232
+ };
233
+ toolsCount?: number;
234
+ promptsCount?: number;
235
+ resourcesCount?: number;
236
+ isValidated?: boolean;
237
+ installCount?: number;
238
+ ratingAverage?: number;
239
+ ratingCount?: number;
240
+ commentCount?: number;
241
+ isFeatured?: boolean;
242
+ }
243
+ type BasePluginItem = z.infer<typeof BasePluginItemSchema>;
244
+ interface PluginManifest {
245
+ id: string;
246
+ name: string;
247
+ version: string;
248
+ description: string;
249
+ category?: string;
250
+ tags?: string[];
251
+ author?: {
252
+ name: string;
253
+ url?: string;
254
+ };
255
+ homepage?: string;
256
+ icon?: string;
257
+ capabilities?: {
258
+ tools?: boolean;
259
+ prompts?: boolean;
260
+ resources?: boolean;
261
+ };
262
+ deploymentOptions?: DeploymentOption[];
263
+ compatibility?: PluginCompatibility;
264
+ tools?: PluginTool[];
265
+ resources?: PluginResource[];
266
+ prompts?: PluginPrompt[];
267
+ isValidated?: boolean;
268
+ validatedAt?: string;
269
+ }
270
+
271
+ declare const AdminPluginItemSchema: z.ZodObject<{
272
+ identifier: z.ZodString;
273
+ name: z.ZodString;
274
+ description: z.ZodString;
275
+ manifestUrl: z.ZodString;
276
+ author: z.ZodOptional<z.ZodString>;
277
+ createdAt: z.ZodString;
278
+ updatedAt: z.ZodString;
279
+ homepage: z.ZodOptional<z.ZodString>;
280
+ icon: z.ZodOptional<z.ZodString>;
281
+ tags: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
282
+ category: z.ZodOptional<z.ZodString>;
283
+ capabilities: z.ZodObject<{
284
+ tools: z.ZodDefault<z.ZodBoolean>;
285
+ prompts: z.ZodDefault<z.ZodBoolean>;
286
+ resources: z.ZodDefault<z.ZodBoolean>;
287
+ }, "strip", z.ZodTypeAny, {
288
+ tools: boolean;
289
+ prompts: boolean;
290
+ resources: boolean;
291
+ }, {
292
+ tools?: boolean | undefined;
293
+ prompts?: boolean | undefined;
294
+ resources?: boolean | undefined;
295
+ }>;
296
+ toolsCount: z.ZodOptional<z.ZodNumber>;
297
+ promptsCount: z.ZodOptional<z.ZodNumber>;
298
+ resourcesCount: z.ZodOptional<z.ZodNumber>;
299
+ isValidated: z.ZodDefault<z.ZodBoolean>;
300
+ installCount: z.ZodDefault<z.ZodNumber>;
301
+ ratingAverage: z.ZodOptional<z.ZodNumber>;
302
+ ratingCount: z.ZodDefault<z.ZodNumber>;
303
+ commentCount: z.ZodDefault<z.ZodNumber>;
304
+ isFeatured: z.ZodDefault<z.ZodBoolean>;
305
+ } & {
306
+ status: z.ZodEnum<["published", "unpublished", "archived", "deprecated"]>;
307
+ visibility: z.ZodEnum<["public", "private", "internal"]>;
308
+ }, "strip", z.ZodTypeAny, {
309
+ status: "published" | "unpublished" | "archived" | "deprecated";
310
+ identifier: string;
311
+ name: string;
312
+ description: string;
313
+ manifestUrl: string;
314
+ createdAt: string;
315
+ updatedAt: string;
316
+ capabilities: {
317
+ tools: boolean;
318
+ prompts: boolean;
319
+ resources: boolean;
320
+ };
321
+ isValidated: boolean;
322
+ installCount: number;
323
+ ratingCount: number;
324
+ commentCount: number;
325
+ isFeatured: boolean;
326
+ visibility: "public" | "private" | "internal";
327
+ author?: string | undefined;
328
+ homepage?: string | undefined;
329
+ icon?: string | undefined;
330
+ tags?: string[] | undefined;
331
+ category?: string | undefined;
332
+ toolsCount?: number | undefined;
333
+ promptsCount?: number | undefined;
334
+ resourcesCount?: number | undefined;
335
+ ratingAverage?: number | undefined;
336
+ }, {
337
+ status: "published" | "unpublished" | "archived" | "deprecated";
338
+ identifier: string;
339
+ name: string;
340
+ description: string;
341
+ manifestUrl: string;
342
+ createdAt: string;
343
+ updatedAt: string;
344
+ capabilities: {
345
+ tools?: boolean | undefined;
346
+ prompts?: boolean | undefined;
347
+ resources?: boolean | undefined;
348
+ };
349
+ visibility: "public" | "private" | "internal";
350
+ author?: string | undefined;
351
+ homepage?: string | undefined;
352
+ icon?: string | undefined;
353
+ tags?: string[] | undefined;
354
+ category?: string | undefined;
355
+ toolsCount?: number | undefined;
356
+ promptsCount?: number | undefined;
357
+ resourcesCount?: number | undefined;
358
+ isValidated?: boolean | undefined;
359
+ installCount?: number | undefined;
360
+ ratingAverage?: number | undefined;
361
+ ratingCount?: number | undefined;
362
+ commentCount?: number | undefined;
363
+ isFeatured?: boolean | undefined;
364
+ }>;
365
+ interface AdminPluginItem extends MarketPluginItem {
366
+ id: number;
367
+ ownerId: number;
368
+ status: 'published' | 'unpublished' | 'archived';
369
+ visibility: 'public' | 'private' | 'internal';
370
+ }
371
+
372
+ export { type AdminPluginItem, AdminPluginItemSchema, type BasePluginItem, BasePluginItemSchema, type ConnectionConfig, type ConnectionType, ConnectionTypeEnum, type DeploymentOption, type InstallationDetails, type InstallationMethod, InstallationMethodEnum, type MarketItemBase, type MarketPluginItem, PluginCapabilitiesSchema, type PluginCompatibility, type PluginManifest, type PluginPrompt, type PluginResource, type PluginTool, type PromptArgument, type SystemDependency };
package/dist/index.mjs ADDED
@@ -0,0 +1,64 @@
1
+ // src/plugin/plugin.ts
2
+ import { z as z2 } from "zod";
3
+
4
+ // src/plugin/capabilities.ts
5
+ import { z } from "zod";
6
+ var PluginCapabilitiesSchema = z.object({
7
+ tools: z.boolean().default(false),
8
+ prompts: z.boolean().default(false),
9
+ resources: z.boolean().default(false)
10
+ });
11
+
12
+ // src/plugin/plugin.ts
13
+ var BasePluginItemSchema = z2.object({
14
+ identifier: z2.string(),
15
+ name: z2.string(),
16
+ description: z2.string(),
17
+ manifestUrl: z2.string(),
18
+ author: z2.string().optional(),
19
+ createdAt: z2.string(),
20
+ updatedAt: z2.string(),
21
+ homepage: z2.string().optional(),
22
+ icon: z2.string().optional(),
23
+ tags: z2.array(z2.string()).optional(),
24
+ category: z2.string().optional(),
25
+ capabilities: PluginCapabilitiesSchema,
26
+ toolsCount: z2.number().optional(),
27
+ promptsCount: z2.number().optional(),
28
+ resourcesCount: z2.number().optional(),
29
+ isValidated: z2.boolean().default(false),
30
+ installCount: z2.number().default(0),
31
+ ratingAverage: z2.number().optional(),
32
+ ratingCount: z2.number().default(0),
33
+ commentCount: z2.number().default(0),
34
+ isFeatured: z2.boolean().default(false)
35
+ });
36
+
37
+ // src/plugin/admin.ts
38
+ import { z as z3 } from "zod";
39
+ var AdminPluginItemSchema = BasePluginItemSchema.extend({
40
+ status: z3.enum(["published", "unpublished", "archived", "deprecated"]),
41
+ visibility: z3.enum(["public", "private", "internal"])
42
+ });
43
+
44
+ // src/plugin/deploymentOption.ts
45
+ import { z as z4 } from "zod";
46
+ var ConnectionTypeEnum = z4.enum(["http", "stdio"]);
47
+ var InstallationMethodEnum = z4.enum([
48
+ "npm",
49
+ "go",
50
+ "python",
51
+ "docker",
52
+ "git",
53
+ "binaryUrl",
54
+ "manual",
55
+ "none"
56
+ ]);
57
+ export {
58
+ AdminPluginItemSchema,
59
+ BasePluginItemSchema,
60
+ ConnectionTypeEnum,
61
+ InstallationMethodEnum,
62
+ PluginCapabilitiesSchema
63
+ };
64
+ //# sourceMappingURL=index.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/plugin/plugin.ts","../src/plugin/capabilities.ts","../src/plugin/admin.ts","../src/plugin/deploymentOption.ts"],"sourcesContent":["import { z } from 'zod';\n\nimport { MarketItemBase } from '../market';\nimport {\n PluginCapabilitiesSchema,\n PluginPrompt,\n PluginResource,\n PluginTool,\n PromptArgument,\n} from './capabilities';\nimport { DeploymentOption } from './deploymentOption';\n\n/**\n * 兼容性信息\n */\nexport interface PluginCompatibility {\n platforms?: string[];\n minAppVersion?: string;\n maxAppVersion?: string;\n}\n\n// 基础插件项 Schema\nexport const BasePluginItemSchema = z.object({\n identifier: z.string(),\n name: z.string(),\n description: z.string(),\n manifestUrl: z.string(),\n author: z.string().optional(),\n createdAt: z.string(),\n updatedAt: z.string(),\n homepage: z.string().optional(),\n icon: z.string().optional(),\n tags: z.array(z.string()).optional(),\n category: z.string().optional(),\n capabilities: PluginCapabilitiesSchema,\n toolsCount: z.number().optional(),\n promptsCount: z.number().optional(),\n resourcesCount: z.number().optional(),\n isValidated: z.boolean().default(false),\n installCount: z.number().default(0),\n ratingAverage: z.number().optional(),\n ratingCount: z.number().default(0),\n commentCount: z.number().default(0),\n isFeatured: z.boolean().default(false),\n});\n\n/**\n * Plugin (MCP Server) 类型资源项的定义 (继承基础结构)\n * 注: 这个定义会与现有的 PluginItem 结构进行整合\n */\nexport interface MarketPluginItem extends MarketItemBase {\n // 能力信息\n capabilities?: {\n tools: boolean;\n prompts: boolean;\n resources: boolean;\n };\n // 数量统计\n toolsCount?: number;\n promptsCount?: number;\n resourcesCount?: number;\n // 验证状态\n isValidated?: boolean;\n // 统计信息\n installCount?: number;\n ratingAverage?: number;\n ratingCount?: number;\n commentCount?: number;\n isFeatured?: boolean;\n}\n\n// 导出类型\nexport type BasePluginItem = z.infer<typeof BasePluginItemSchema>;\n\n// 插件清单\nexport interface PluginManifest {\n id: string;\n name: string;\n version: string;\n description: string;\n category?: string;\n tags?: string[];\n author?: {\n name: string;\n url?: string;\n };\n homepage?: string;\n icon?: string;\n capabilities?: {\n tools?: boolean;\n prompts?: boolean;\n resources?: boolean;\n };\n deploymentOptions?: DeploymentOption[];\n compatibility?: PluginCompatibility;\n // 工具定义\n tools?: PluginTool[];\n // 资源定义\n resources?: PluginResource[];\n // 提示词定义\n prompts?: PluginPrompt[];\n // 验证信息\n isValidated?: boolean;\n validatedAt?: string;\n}\n","\n// 插件能力定义\nimport { z } from 'zod';\n\nexport const PluginCapabilitiesSchema = z.object({\n tools: z.boolean().default(false),\n prompts: z.boolean().default(false),\n resources: z.boolean().default(false),\n});\n\n/**\n * 工具项定义\n */\nexport interface PluginTool {\n name: string;\n description?: string;\n inputSchema?: Record<string, any>;\n}\n\n/**\n * 资源项定义\n */\nexport interface PluginResource {\n uri: string;\n name?: string;\n mimeType?: string;\n}\n\n/**\n * 提示词参数定义\n */\nexport interface PromptArgument {\n name: string;\n required?: boolean;\n description?: string;\n type?: string;\n}\n\n/**\n * 提示词项定义\n */\nexport interface PluginPrompt {\n name: string;\n description: string;\n arguments?: PromptArgument[];\n}\n","// 管理端插件项 Schema\nimport { z } from 'zod';\n\nimport { BasePluginItemSchema, MarketPluginItem } from './plugin';\n\nexport const AdminPluginItemSchema = BasePluginItemSchema.extend({\n status: z.enum(['published', 'unpublished', 'archived', 'deprecated'] as const),\n visibility: z.enum(['public', 'private', 'internal'] as const),\n});\n\nexport interface AdminPluginItem extends MarketPluginItem {\n id: number;\n ownerId: number;\n status: 'published' | 'unpublished' | 'archived';\n visibility: 'public' | 'private' | 'internal';\n}\n","import { z } from 'zod';\n\n/**\n * 连接类型\n */\nexport const ConnectionTypeEnum = z.enum(['http', 'stdio']);\nexport type ConnectionType = z.infer<typeof ConnectionTypeEnum>;\n\n/**\n * MCP安装方法\n */\nexport const InstallationMethodEnum = z.enum([\n 'npm',\n 'go',\n 'python',\n 'docker',\n 'git',\n 'binaryUrl',\n 'manual',\n 'none',\n]);\nexport type InstallationMethod = z.infer<typeof InstallationMethodEnum>;\n\n/**\n * 系统依赖项\n */\nexport interface SystemDependency {\n name: string;\n type?: string;\n requiredVersion?: string;\n checkCommand?: string;\n installInstructions?: Record<string, string>;\n versionParsingRequired?: boolean;\n description?: string;\n}\n\n/**\n * MCP连接配置\n */\nexport interface ConnectionConfig {\n type: ConnectionType;\n command?: string;\n args?: string[];\n url?: string;\n}\n\nexport interface InstallationDetails {\n packageName?: string;\n repositoryUrlToClone?: string;\n setupSteps?: string[];\n}\n\n/**\n * MCP部署选项\n */\nexport interface DeploymentOption {\n installationMethod: string;\n installationDetails?: InstallationDetails;\n connection: ConnectionConfig;\n isRecommended?: boolean;\n description?: string;\n systemDependencies?: SystemDependency[];\n}\n"],"mappings":";AAAA,SAAS,KAAAA,UAAS;;;ACElB,SAAS,SAAS;AAEX,IAAM,2BAA2B,EAAE,OAAO;AAAA,EAC/C,OAAO,EAAE,QAAQ,EAAE,QAAQ,KAAK;AAAA,EAChC,SAAS,EAAE,QAAQ,EAAE,QAAQ,KAAK;AAAA,EAClC,WAAW,EAAE,QAAQ,EAAE,QAAQ,KAAK;AACtC,CAAC;;;ADcM,IAAM,uBAAuBC,GAAE,OAAO;AAAA,EAC3C,YAAYA,GAAE,OAAO;AAAA,EACrB,MAAMA,GAAE,OAAO;AAAA,EACf,aAAaA,GAAE,OAAO;AAAA,EACtB,aAAaA,GAAE,OAAO;AAAA,EACtB,QAAQA,GAAE,OAAO,EAAE,SAAS;AAAA,EAC5B,WAAWA,GAAE,OAAO;AAAA,EACpB,WAAWA,GAAE,OAAO;AAAA,EACpB,UAAUA,GAAE,OAAO,EAAE,SAAS;AAAA,EAC9B,MAAMA,GAAE,OAAO,EAAE,SAAS;AAAA,EAC1B,MAAMA,GAAE,MAAMA,GAAE,OAAO,CAAC,EAAE,SAAS;AAAA,EACnC,UAAUA,GAAE,OAAO,EAAE,SAAS;AAAA,EAC9B,cAAc;AAAA,EACd,YAAYA,GAAE,OAAO,EAAE,SAAS;AAAA,EAChC,cAAcA,GAAE,OAAO,EAAE,SAAS;AAAA,EAClC,gBAAgBA,GAAE,OAAO,EAAE,SAAS;AAAA,EACpC,aAAaA,GAAE,QAAQ,EAAE,QAAQ,KAAK;AAAA,EACtC,cAAcA,GAAE,OAAO,EAAE,QAAQ,CAAC;AAAA,EAClC,eAAeA,GAAE,OAAO,EAAE,SAAS;AAAA,EACnC,aAAaA,GAAE,OAAO,EAAE,QAAQ,CAAC;AAAA,EACjC,cAAcA,GAAE,OAAO,EAAE,QAAQ,CAAC;AAAA,EAClC,YAAYA,GAAE,QAAQ,EAAE,QAAQ,KAAK;AACvC,CAAC;;;AE3CD,SAAS,KAAAC,UAAS;AAIX,IAAM,wBAAwB,qBAAqB,OAAO;AAAA,EAC/D,QAAQC,GAAE,KAAK,CAAC,aAAa,eAAe,YAAY,YAAY,CAAU;AAAA,EAC9E,YAAYA,GAAE,KAAK,CAAC,UAAU,WAAW,UAAU,CAAU;AAC/D,CAAC;;;ACRD,SAAS,KAAAC,UAAS;AAKX,IAAM,qBAAqBA,GAAE,KAAK,CAAC,QAAQ,OAAO,CAAC;AAMnD,IAAM,yBAAyBA,GAAE,KAAK;AAAA,EAC3C;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF,CAAC;","names":["z","z","z","z","z"]}
package/package.json CHANGED
@@ -1,10 +1,13 @@
1
1
  {
2
2
  "name": "@lobehub/market-types",
3
- "version": "1.0.1",
3
+ "version": "1.0.3",
4
4
  "license": "MIT",
5
5
  "sideEffects": false,
6
6
  "main": "./dist/index.mjs",
7
7
  "types": "./dist/index.d.mts",
8
+ "files": [
9
+ "dist"
10
+ ],
8
11
  "scripts": {
9
12
  "build": "tsup",
10
13
  "clean": "rimraf .turbo node_modules dist",
@@ -1,8 +0,0 @@
1
- import { MarketItemBase } from '../market';
2
-
3
- /**
4
- * Agent 类型资源项的定义 (继承基础结构)
5
- */
6
- export interface AgentItem extends MarketItemBase {
7
- // Agent 特有的字段可以加在这里
8
- }
package/src/index.ts DELETED
@@ -1,2 +0,0 @@
1
- export * from './plugin';
2
- export * from './market';
package/src/market.ts DELETED
@@ -1,29 +0,0 @@
1
- /**
2
- * 市场列表中单个资源项的基础结构
3
- */
4
- export interface MarketItemBase {
5
- /** 全局唯一标识符, 通常包含作者/命名空间和名称 */
6
- identifier: string;
7
- /** 在市场列表中显示的名称 (已本地化) */
8
- name: string;
9
- /** 在市场列表中显示的简短描述 (已本地化) */
10
- description: string;
11
- /** 指向该资源详细 Manifest 文件的 URL */
12
- manifestUrl: string;
13
- /** 作者或组织名称 */
14
- author?: string;
15
- /** 资源在市场中创建的日期 (ISO 8601) */
16
- createdAt: string;
17
- /** 资源在市场中最后更新的日期 (ISO 8601) */
18
- updatedAt: string;
19
- /** 资源的主页或文档链接 */
20
- homepage?: string;
21
- /** 图标 URL 或 Emoji */
22
- icon?: string;
23
- /** 标签列表 (已本地化) */
24
- tags?: string[];
25
- /** 分类名称 */
26
- category?: string;
27
- /** 可选:兼容性信息 */
28
- compatibility?: Record<string, any>;
29
- }
@@ -1,16 +0,0 @@
1
- // 管理端插件项 Schema
2
- import { z } from 'zod';
3
-
4
- import { BasePluginItemSchema, MarketPluginItem } from './plugin';
5
-
6
- export const AdminPluginItemSchema = BasePluginItemSchema.extend({
7
- status: z.enum(['published', 'unpublished', 'archived', 'deprecated'] as const),
8
- visibility: z.enum(['public', 'private', 'internal'] as const),
9
- });
10
-
11
- export interface AdminPluginItem extends MarketPluginItem {
12
- id: number;
13
- ownerId: number;
14
- status: 'published' | 'unpublished' | 'archived';
15
- visibility: 'public' | 'private' | 'internal';
16
- }
@@ -1,46 +0,0 @@
1
-
2
- // 插件能力定义
3
- import { z } from 'zod';
4
-
5
- export const PluginCapabilitiesSchema = z.object({
6
- tools: z.boolean().default(false),
7
- prompts: z.boolean().default(false),
8
- resources: z.boolean().default(false),
9
- });
10
-
11
- /**
12
- * 工具项定义
13
- */
14
- export interface PluginTool {
15
- name: string;
16
- description?: string;
17
- inputSchema?: Record<string, any>;
18
- }
19
-
20
- /**
21
- * 资源项定义
22
- */
23
- export interface PluginResource {
24
- uri: string;
25
- name?: string;
26
- mimeType?: string;
27
- }
28
-
29
- /**
30
- * 提示词参数定义
31
- */
32
- export interface PromptArgument {
33
- name: string;
34
- required?: boolean;
35
- description?: string;
36
- type?: string;
37
- }
38
-
39
- /**
40
- * 提示词项定义
41
- */
42
- export interface PluginPrompt {
43
- name: string;
44
- description: string;
45
- arguments?: PromptArgument[];
46
- }
@@ -1,63 +0,0 @@
1
- import { z } from 'zod';
2
-
3
- /**
4
- * 连接类型
5
- */
6
- export const ConnectionTypeEnum = z.enum(['http', 'stdio']);
7
- export type ConnectionType = z.infer<typeof ConnectionTypeEnum>;
8
-
9
- /**
10
- * MCP安装方法
11
- */
12
- export const InstallationMethodEnum = z.enum([
13
- 'npm',
14
- 'go',
15
- 'python',
16
- 'docker',
17
- 'git',
18
- 'binaryUrl',
19
- 'manual',
20
- 'none',
21
- ]);
22
- export type InstallationMethod = z.infer<typeof InstallationMethodEnum>;
23
-
24
- /**
25
- * 系统依赖项
26
- */
27
- export interface SystemDependency {
28
- name: string;
29
- type?: string;
30
- requiredVersion?: string;
31
- checkCommand?: string;
32
- installInstructions?: Record<string, string>;
33
- versionParsingRequired?: boolean;
34
- description?: string;
35
- }
36
-
37
- /**
38
- * MCP连接配置
39
- */
40
- export interface ConnectionConfig {
41
- type: ConnectionType;
42
- command?: string;
43
- args?: string[];
44
- url?: string;
45
- }
46
-
47
- export interface InstallationDetails {
48
- packageName?: string;
49
- repositoryUrlToClone?: string;
50
- setupSteps?: string[];
51
- }
52
-
53
- /**
54
- * MCP部署选项
55
- */
56
- export interface DeploymentOption {
57
- installationMethod: string;
58
- installationDetails?: InstallationDetails;
59
- connection: ConnectionConfig;
60
- isRecommended?: boolean;
61
- description?: string;
62
- systemDependencies?: SystemDependency[];
63
- }
@@ -1,4 +0,0 @@
1
- export * from './plugin';
2
- export * from './admin';
3
- export * from './deploymentOption';
4
- export * from './capabilities';
@@ -1,104 +0,0 @@
1
- import { z } from 'zod';
2
-
3
- import { MarketItemBase } from '../market';
4
- import {
5
- PluginCapabilitiesSchema,
6
- PluginPrompt,
7
- PluginResource,
8
- PluginTool,
9
- PromptArgument,
10
- } from './capabilities';
11
- import { DeploymentOption } from './deploymentOption';
12
-
13
- /**
14
- * 兼容性信息
15
- */
16
- export interface PluginCompatibility {
17
- platforms?: string[];
18
- minAppVersion?: string;
19
- maxAppVersion?: string;
20
- }
21
-
22
- // 基础插件项 Schema
23
- export const BasePluginItemSchema = z.object({
24
- identifier: z.string(),
25
- name: z.string(),
26
- description: z.string(),
27
- manifestUrl: z.string(),
28
- author: z.string().optional(),
29
- createdAt: z.string(),
30
- updatedAt: z.string(),
31
- homepage: z.string().optional(),
32
- icon: z.string().optional(),
33
- tags: z.array(z.string()).optional(),
34
- category: z.string().optional(),
35
- capabilities: PluginCapabilitiesSchema,
36
- toolsCount: z.number().optional(),
37
- promptsCount: z.number().optional(),
38
- resourcesCount: z.number().optional(),
39
- isValidated: z.boolean().default(false),
40
- installCount: z.number().default(0),
41
- ratingAverage: z.number().optional(),
42
- ratingCount: z.number().default(0),
43
- commentCount: z.number().default(0),
44
- isFeatured: z.boolean().default(false),
45
- });
46
-
47
- /**
48
- * Plugin (MCP Server) 类型资源项的定义 (继承基础结构)
49
- * 注: 这个定义会与现有的 PluginItem 结构进行整合
50
- */
51
- export interface MarketPluginItem extends MarketItemBase {
52
- // 能力信息
53
- capabilities?: {
54
- tools: boolean;
55
- prompts: boolean;
56
- resources: boolean;
57
- };
58
- // 数量统计
59
- toolsCount?: number;
60
- promptsCount?: number;
61
- resourcesCount?: number;
62
- // 验证状态
63
- isValidated?: boolean;
64
- // 统计信息
65
- installCount?: number;
66
- ratingAverage?: number;
67
- ratingCount?: number;
68
- commentCount?: number;
69
- }
70
-
71
- // 导出类型
72
- export type BasePluginItem = z.infer<typeof BasePluginItemSchema>;
73
-
74
- // 插件清单
75
- export interface PluginManifest {
76
- id: string;
77
- name: string;
78
- version: string;
79
- description: string;
80
- category?: string;
81
- tags?: string[];
82
- author?: {
83
- name: string;
84
- url?: string;
85
- };
86
- homepage?: string;
87
- icon?: string;
88
- capabilities?: {
89
- tools?: boolean;
90
- prompts?: boolean;
91
- resources?: boolean;
92
- };
93
- deploymentOptions?: DeploymentOption[];
94
- compatibility?: PluginCompatibility;
95
- // 工具定义
96
- tools?: PluginTool[];
97
- // 资源定义
98
- resources?: PluginResource[];
99
- // 提示词定义
100
- prompts?: PluginPrompt[];
101
- // 验证信息
102
- isValidated?: boolean;
103
- validatedAt?: string;
104
- }
package/tsconfig.json DELETED
@@ -1,20 +0,0 @@
1
- {
2
- "compilerOptions": {
3
- "target": "es2018",
4
- "module": "esnext",
5
- "moduleResolution": "node",
6
- "declaration": true,
7
- "strict": true,
8
- "esModuleInterop": true,
9
- "skipLibCheck": true,
10
- "forceConsistentCasingInFileNames": true,
11
- "outDir": "./dist",
12
- "rootDir": "./src",
13
- "baseUrl": ".",
14
- "paths": {
15
- "@/*": ["src/*"]
16
- }
17
- },
18
- "exclude": ["node_modules", "dist"],
19
- "include": ["src"]
20
- }
package/tsup.config.ts DELETED
@@ -1,10 +0,0 @@
1
- import { defineConfig } from 'tsup';
2
-
3
- export default defineConfig({
4
- entry: ['src/index.ts'],
5
- format: ['esm'],
6
- dts: true,
7
- splitting: false,
8
- sourcemap: true,
9
- clean: true,
10
- });