@gt-fe/eap-sdk 0.1.7 → 0.1.9

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 (38) hide show
  1. package/README.md +18 -18
  2. package/dist/lockfile/resolve-dependencies.js +1 -1
  3. package/dist/lockfile/resolve-dependencies.js.map +1 -1
  4. package/dist/lockfile/types.d.ts +1 -1
  5. package/dist/lockfile/types.d.ts.map +1 -1
  6. package/dist/resources/extract-resource-package.js +1 -1
  7. package/dist/resources/local-resource.d.ts +2 -2
  8. package/dist/resources/local-resource.d.ts.map +1 -1
  9. package/dist/resources/local-resource.js +5 -19
  10. package/dist/resources/local-resource.js.map +1 -1
  11. package/dist/schema/index.d.ts +1 -1
  12. package/dist/schema/index.d.ts.map +1 -1
  13. package/dist/schema/index.js +1 -1
  14. package/dist/schema/index.js.map +1 -1
  15. package/dist/schema/toolset/index.d.ts +3 -0
  16. package/dist/schema/toolset/index.d.ts.map +1 -0
  17. package/dist/schema/toolset/index.js +3 -0
  18. package/dist/schema/toolset/index.js.map +1 -0
  19. package/dist/schema/toolset/manifest.d.ts +447 -0
  20. package/dist/schema/toolset/manifest.d.ts.map +1 -0
  21. package/dist/schema/toolset/manifest.js +111 -0
  22. package/dist/schema/toolset/manifest.js.map +1 -0
  23. package/dist/schema/toolset/read-toolset-manifest.d.ts +7 -0
  24. package/dist/schema/toolset/read-toolset-manifest.d.ts.map +1 -0
  25. package/dist/schema/{tool/read-tool-manifest.js → toolset/read-toolset-manifest.js} +10 -10
  26. package/dist/schema/toolset/read-toolset-manifest.js.map +1 -0
  27. package/package.json +1 -1
  28. package/dist/schema/tool/index.d.ts +0 -3
  29. package/dist/schema/tool/index.d.ts.map +0 -1
  30. package/dist/schema/tool/index.js +0 -3
  31. package/dist/schema/tool/index.js.map +0 -1
  32. package/dist/schema/tool/manifest.d.ts +0 -1342
  33. package/dist/schema/tool/manifest.d.ts.map +0 -1
  34. package/dist/schema/tool/manifest.js +0 -127
  35. package/dist/schema/tool/manifest.js.map +0 -1
  36. package/dist/schema/tool/read-tool-manifest.d.ts +0 -7
  37. package/dist/schema/tool/read-tool-manifest.d.ts.map +0 -1
  38. package/dist/schema/tool/read-tool-manifest.js.map +0 -1
@@ -0,0 +1,447 @@
1
+ import { z } from 'zod';
2
+ /** Toolset 对外主键(code):语义化小写标识,= 预装目录名 = 管理单元标识。 */
3
+ export declare const ToolsetCodeSchema: z.ZodString;
4
+ export declare const ToolsetVersionSchema: z.ZodString;
5
+ export declare const ToolsetTypeSchema: z.ZodEnum<["code", "mcp", "http"]>;
6
+ export declare const ToolsetCategorySchema: z.ZodEnum<["general", "collaboration", "enterprise-api", "enterprise-data", "enterprise-knowledge"]>;
7
+ export declare const ToolsetRiskLevelSchema: z.ZodEnum<["low", "medium", "high"]>;
8
+ export declare const ToolsetRuntimeSchema: z.ZodEnum<["local", "server", "both"]>;
9
+ export declare const ToolsetStatusSchema: z.ZodDefault<z.ZodEnum<["draft", "active", "deprecated", "archived", "disabled", "published"]>>;
10
+ export declare const ToolDataScopeSchema: z.ZodEnum<["user-bound", "department-bound", "tenant-bound", "global"]>;
11
+ declare const ToolEntrySchema: z.ZodObject<{
12
+ name: z.ZodString;
13
+ description: z.ZodString;
14
+ input: z.ZodType<import("../json-schema.js").JsonSchema, z.ZodTypeDef, import("../json-schema.js").JsonSchema>;
15
+ output: z.ZodOptional<z.ZodType<import("../json-schema.js").JsonSchema, z.ZodTypeDef, import("../json-schema.js").JsonSchema>>;
16
+ handler: z.ZodOptional<z.ZodString>;
17
+ runtime: z.ZodOptional<z.ZodEnum<["node", "python", "executable"]>>;
18
+ args: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
19
+ timeout: z.ZodOptional<z.ZodNumber>;
20
+ sandbox: z.ZodOptional<z.ZodBoolean>;
21
+ requireConfirmation: z.ZodOptional<z.ZodBoolean>;
22
+ riskLevel: z.ZodOptional<z.ZodEnum<["low", "medium", "high"]>>;
23
+ dataScope: z.ZodOptional<z.ZodEnum<["user-bound", "department-bound", "tenant-bound", "global"]>>;
24
+ pathTemplate: z.ZodOptional<z.ZodString>;
25
+ method: z.ZodOptional<z.ZodEnum<["GET", "POST", "PUT", "PATCH", "DELETE"]>>;
26
+ mockResponse: z.ZodOptional<z.ZodUnknown>;
27
+ }, "strict", z.ZodTypeAny, {
28
+ description: string;
29
+ name: string;
30
+ input: import("../json-schema.js").JsonSchema;
31
+ timeout?: number | undefined;
32
+ handler?: string | undefined;
33
+ runtime?: "node" | "python" | "executable" | undefined;
34
+ args?: string[] | undefined;
35
+ sandbox?: boolean | undefined;
36
+ output?: import("../json-schema.js").JsonSchema | undefined;
37
+ requireConfirmation?: boolean | undefined;
38
+ riskLevel?: "low" | "medium" | "high" | undefined;
39
+ dataScope?: "user-bound" | "department-bound" | "tenant-bound" | "global" | undefined;
40
+ pathTemplate?: string | undefined;
41
+ method?: "GET" | "POST" | "PUT" | "PATCH" | "DELETE" | undefined;
42
+ mockResponse?: unknown;
43
+ }, {
44
+ description: string;
45
+ name: string;
46
+ input: import("../json-schema.js").JsonSchema;
47
+ timeout?: number | undefined;
48
+ handler?: string | undefined;
49
+ runtime?: "node" | "python" | "executable" | undefined;
50
+ args?: string[] | undefined;
51
+ sandbox?: boolean | undefined;
52
+ output?: import("../json-schema.js").JsonSchema | undefined;
53
+ requireConfirmation?: boolean | undefined;
54
+ riskLevel?: "low" | "medium" | "high" | undefined;
55
+ dataScope?: "user-bound" | "department-bound" | "tenant-bound" | "global" | undefined;
56
+ pathTemplate?: string | undefined;
57
+ method?: "GET" | "POST" | "PUT" | "PATCH" | "DELETE" | undefined;
58
+ mockResponse?: unknown;
59
+ }>;
60
+ export declare const ToolsetManifestSchema: z.ZodEffects<z.ZodObject<{
61
+ $schema: z.ZodOptional<z.ZodString>;
62
+ code: z.ZodString;
63
+ name: z.ZodOptional<z.ZodString>;
64
+ id: z.ZodOptional<z.ZodString>;
65
+ version: z.ZodString;
66
+ type: z.ZodEnum<["code", "mcp", "http"]>;
67
+ description: z.ZodString;
68
+ toolRuntime: z.ZodOptional<z.ZodEnum<["local", "server", "both"]>>;
69
+ status: z.ZodDefault<z.ZodEnum<["draft", "active", "deprecated", "archived", "disabled", "published"]>>;
70
+ category: z.ZodOptional<z.ZodEnum<["general", "collaboration", "enterprise-api", "enterprise-data", "enterprise-knowledge"]>>;
71
+ tags: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
72
+ riskLevel: z.ZodOptional<z.ZodEnum<["low", "medium", "high"]>>;
73
+ server: z.ZodOptional<z.ZodObject<{
74
+ transport: z.ZodOptional<z.ZodEnum<["stdio", "sse", "streamable_http"]>>;
75
+ command: z.ZodOptional<z.ZodString>;
76
+ args: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
77
+ cwd: z.ZodOptional<z.ZodString>;
78
+ env: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
79
+ url: z.ZodOptional<z.ZodString>;
80
+ header: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
81
+ timeout: z.ZodOptional<z.ZodNumber>;
82
+ }, "strict", z.ZodTypeAny, {
83
+ url?: string | undefined;
84
+ timeout?: number | undefined;
85
+ transport?: "stdio" | "sse" | "streamable_http" | undefined;
86
+ command?: string | undefined;
87
+ args?: string[] | undefined;
88
+ cwd?: string | undefined;
89
+ env?: Record<string, string> | undefined;
90
+ header?: Record<string, string> | undefined;
91
+ }, {
92
+ url?: string | undefined;
93
+ timeout?: number | undefined;
94
+ transport?: "stdio" | "sse" | "streamable_http" | undefined;
95
+ command?: string | undefined;
96
+ args?: string[] | undefined;
97
+ cwd?: string | undefined;
98
+ env?: Record<string, string> | undefined;
99
+ header?: Record<string, string> | undefined;
100
+ }>>;
101
+ package: z.ZodOptional<z.ZodObject<{
102
+ format: z.ZodLiteral<"zip">;
103
+ sandbox: z.ZodOptional<z.ZodBoolean>;
104
+ resources: z.ZodOptional<z.ZodObject<{
105
+ memory: z.ZodOptional<z.ZodString>;
106
+ cpu: z.ZodOptional<z.ZodString>;
107
+ }, "strict", z.ZodTypeAny, {
108
+ memory?: string | undefined;
109
+ cpu?: string | undefined;
110
+ }, {
111
+ memory?: string | undefined;
112
+ cpu?: string | undefined;
113
+ }>>;
114
+ }, "strict", z.ZodTypeAny, {
115
+ format: "zip";
116
+ resources?: {
117
+ memory?: string | undefined;
118
+ cpu?: string | undefined;
119
+ } | undefined;
120
+ sandbox?: boolean | undefined;
121
+ }, {
122
+ format: "zip";
123
+ resources?: {
124
+ memory?: string | undefined;
125
+ cpu?: string | undefined;
126
+ } | undefined;
127
+ sandbox?: boolean | undefined;
128
+ }>>;
129
+ gateway: z.ZodOptional<z.ZodObject<{
130
+ baseUrl: z.ZodString;
131
+ header: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
132
+ timeout: z.ZodOptional<z.ZodNumber>;
133
+ allowedHosts: z.ZodArray<z.ZodString, "many">;
134
+ }, "strict", z.ZodTypeAny, {
135
+ baseUrl: string;
136
+ allowedHosts: string[];
137
+ timeout?: number | undefined;
138
+ header?: Record<string, string> | undefined;
139
+ }, {
140
+ baseUrl: string;
141
+ allowedHosts: string[];
142
+ timeout?: number | undefined;
143
+ header?: Record<string, string> | undefined;
144
+ }>>;
145
+ tools: z.ZodArray<z.ZodObject<{
146
+ name: z.ZodString;
147
+ description: z.ZodString;
148
+ input: z.ZodType<import("../json-schema.js").JsonSchema, z.ZodTypeDef, import("../json-schema.js").JsonSchema>;
149
+ output: z.ZodOptional<z.ZodType<import("../json-schema.js").JsonSchema, z.ZodTypeDef, import("../json-schema.js").JsonSchema>>;
150
+ handler: z.ZodOptional<z.ZodString>;
151
+ runtime: z.ZodOptional<z.ZodEnum<["node", "python", "executable"]>>;
152
+ args: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
153
+ timeout: z.ZodOptional<z.ZodNumber>;
154
+ sandbox: z.ZodOptional<z.ZodBoolean>;
155
+ requireConfirmation: z.ZodOptional<z.ZodBoolean>;
156
+ riskLevel: z.ZodOptional<z.ZodEnum<["low", "medium", "high"]>>;
157
+ dataScope: z.ZodOptional<z.ZodEnum<["user-bound", "department-bound", "tenant-bound", "global"]>>;
158
+ pathTemplate: z.ZodOptional<z.ZodString>;
159
+ method: z.ZodOptional<z.ZodEnum<["GET", "POST", "PUT", "PATCH", "DELETE"]>>;
160
+ mockResponse: z.ZodOptional<z.ZodUnknown>;
161
+ }, "strict", z.ZodTypeAny, {
162
+ description: string;
163
+ name: string;
164
+ input: import("../json-schema.js").JsonSchema;
165
+ timeout?: number | undefined;
166
+ handler?: string | undefined;
167
+ runtime?: "node" | "python" | "executable" | undefined;
168
+ args?: string[] | undefined;
169
+ sandbox?: boolean | undefined;
170
+ output?: import("../json-schema.js").JsonSchema | undefined;
171
+ requireConfirmation?: boolean | undefined;
172
+ riskLevel?: "low" | "medium" | "high" | undefined;
173
+ dataScope?: "user-bound" | "department-bound" | "tenant-bound" | "global" | undefined;
174
+ pathTemplate?: string | undefined;
175
+ method?: "GET" | "POST" | "PUT" | "PATCH" | "DELETE" | undefined;
176
+ mockResponse?: unknown;
177
+ }, {
178
+ description: string;
179
+ name: string;
180
+ input: import("../json-schema.js").JsonSchema;
181
+ timeout?: number | undefined;
182
+ handler?: string | undefined;
183
+ runtime?: "node" | "python" | "executable" | undefined;
184
+ args?: string[] | undefined;
185
+ sandbox?: boolean | undefined;
186
+ output?: import("../json-schema.js").JsonSchema | undefined;
187
+ requireConfirmation?: boolean | undefined;
188
+ riskLevel?: "low" | "medium" | "high" | undefined;
189
+ dataScope?: "user-bound" | "department-bound" | "tenant-bound" | "global" | undefined;
190
+ pathTemplate?: string | undefined;
191
+ method?: "GET" | "POST" | "PUT" | "PATCH" | "DELETE" | undefined;
192
+ mockResponse?: unknown;
193
+ }>, "many">;
194
+ metadata: z.ZodOptional<z.ZodObject<{
195
+ owner: z.ZodOptional<z.ZodString>;
196
+ repository: z.ZodOptional<z.ZodString>;
197
+ bundlePath: z.ZodOptional<z.ZodString>;
198
+ }, "passthrough", z.ZodTypeAny, z.objectOutputType<{
199
+ owner: z.ZodOptional<z.ZodString>;
200
+ repository: z.ZodOptional<z.ZodString>;
201
+ bundlePath: z.ZodOptional<z.ZodString>;
202
+ }, z.ZodTypeAny, "passthrough">, z.objectInputType<{
203
+ owner: z.ZodOptional<z.ZodString>;
204
+ repository: z.ZodOptional<z.ZodString>;
205
+ bundlePath: z.ZodOptional<z.ZodString>;
206
+ }, z.ZodTypeAny, "passthrough">>>;
207
+ }, "strict", z.ZodTypeAny, {
208
+ code: string;
209
+ type: "code" | "mcp" | "http";
210
+ status: "draft" | "active" | "deprecated" | "archived" | "disabled" | "published";
211
+ description: string;
212
+ tools: {
213
+ description: string;
214
+ name: string;
215
+ input: import("../json-schema.js").JsonSchema;
216
+ timeout?: number | undefined;
217
+ handler?: string | undefined;
218
+ runtime?: "node" | "python" | "executable" | undefined;
219
+ args?: string[] | undefined;
220
+ sandbox?: boolean | undefined;
221
+ output?: import("../json-schema.js").JsonSchema | undefined;
222
+ requireConfirmation?: boolean | undefined;
223
+ riskLevel?: "low" | "medium" | "high" | undefined;
224
+ dataScope?: "user-bound" | "department-bound" | "tenant-bound" | "global" | undefined;
225
+ pathTemplate?: string | undefined;
226
+ method?: "GET" | "POST" | "PUT" | "PATCH" | "DELETE" | undefined;
227
+ mockResponse?: unknown;
228
+ }[];
229
+ version: string;
230
+ id?: string | undefined;
231
+ name?: string | undefined;
232
+ tags?: string[] | undefined;
233
+ category?: "general" | "collaboration" | "enterprise-api" | "enterprise-data" | "enterprise-knowledge" | undefined;
234
+ metadata?: z.objectOutputType<{
235
+ owner: z.ZodOptional<z.ZodString>;
236
+ repository: z.ZodOptional<z.ZodString>;
237
+ bundlePath: z.ZodOptional<z.ZodString>;
238
+ }, z.ZodTypeAny, "passthrough"> | undefined;
239
+ server?: {
240
+ url?: string | undefined;
241
+ timeout?: number | undefined;
242
+ transport?: "stdio" | "sse" | "streamable_http" | undefined;
243
+ command?: string | undefined;
244
+ args?: string[] | undefined;
245
+ cwd?: string | undefined;
246
+ env?: Record<string, string> | undefined;
247
+ header?: Record<string, string> | undefined;
248
+ } | undefined;
249
+ riskLevel?: "low" | "medium" | "high" | undefined;
250
+ $schema?: string | undefined;
251
+ toolRuntime?: "local" | "server" | "both" | undefined;
252
+ package?: {
253
+ format: "zip";
254
+ resources?: {
255
+ memory?: string | undefined;
256
+ cpu?: string | undefined;
257
+ } | undefined;
258
+ sandbox?: boolean | undefined;
259
+ } | undefined;
260
+ gateway?: {
261
+ baseUrl: string;
262
+ allowedHosts: string[];
263
+ timeout?: number | undefined;
264
+ header?: Record<string, string> | undefined;
265
+ } | undefined;
266
+ }, {
267
+ code: string;
268
+ type: "code" | "mcp" | "http";
269
+ description: string;
270
+ tools: {
271
+ description: string;
272
+ name: string;
273
+ input: import("../json-schema.js").JsonSchema;
274
+ timeout?: number | undefined;
275
+ handler?: string | undefined;
276
+ runtime?: "node" | "python" | "executable" | undefined;
277
+ args?: string[] | undefined;
278
+ sandbox?: boolean | undefined;
279
+ output?: import("../json-schema.js").JsonSchema | undefined;
280
+ requireConfirmation?: boolean | undefined;
281
+ riskLevel?: "low" | "medium" | "high" | undefined;
282
+ dataScope?: "user-bound" | "department-bound" | "tenant-bound" | "global" | undefined;
283
+ pathTemplate?: string | undefined;
284
+ method?: "GET" | "POST" | "PUT" | "PATCH" | "DELETE" | undefined;
285
+ mockResponse?: unknown;
286
+ }[];
287
+ version: string;
288
+ status?: "draft" | "active" | "deprecated" | "archived" | "disabled" | "published" | undefined;
289
+ id?: string | undefined;
290
+ name?: string | undefined;
291
+ tags?: string[] | undefined;
292
+ category?: "general" | "collaboration" | "enterprise-api" | "enterprise-data" | "enterprise-knowledge" | undefined;
293
+ metadata?: z.objectInputType<{
294
+ owner: z.ZodOptional<z.ZodString>;
295
+ repository: z.ZodOptional<z.ZodString>;
296
+ bundlePath: z.ZodOptional<z.ZodString>;
297
+ }, z.ZodTypeAny, "passthrough"> | undefined;
298
+ server?: {
299
+ url?: string | undefined;
300
+ timeout?: number | undefined;
301
+ transport?: "stdio" | "sse" | "streamable_http" | undefined;
302
+ command?: string | undefined;
303
+ args?: string[] | undefined;
304
+ cwd?: string | undefined;
305
+ env?: Record<string, string> | undefined;
306
+ header?: Record<string, string> | undefined;
307
+ } | undefined;
308
+ riskLevel?: "low" | "medium" | "high" | undefined;
309
+ $schema?: string | undefined;
310
+ toolRuntime?: "local" | "server" | "both" | undefined;
311
+ package?: {
312
+ format: "zip";
313
+ resources?: {
314
+ memory?: string | undefined;
315
+ cpu?: string | undefined;
316
+ } | undefined;
317
+ sandbox?: boolean | undefined;
318
+ } | undefined;
319
+ gateway?: {
320
+ baseUrl: string;
321
+ allowedHosts: string[];
322
+ timeout?: number | undefined;
323
+ header?: Record<string, string> | undefined;
324
+ } | undefined;
325
+ }>, {
326
+ code: string;
327
+ type: "code" | "mcp" | "http";
328
+ status: "draft" | "active" | "deprecated" | "archived" | "disabled" | "published";
329
+ description: string;
330
+ tools: {
331
+ description: string;
332
+ name: string;
333
+ input: import("../json-schema.js").JsonSchema;
334
+ timeout?: number | undefined;
335
+ handler?: string | undefined;
336
+ runtime?: "node" | "python" | "executable" | undefined;
337
+ args?: string[] | undefined;
338
+ sandbox?: boolean | undefined;
339
+ output?: import("../json-schema.js").JsonSchema | undefined;
340
+ requireConfirmation?: boolean | undefined;
341
+ riskLevel?: "low" | "medium" | "high" | undefined;
342
+ dataScope?: "user-bound" | "department-bound" | "tenant-bound" | "global" | undefined;
343
+ pathTemplate?: string | undefined;
344
+ method?: "GET" | "POST" | "PUT" | "PATCH" | "DELETE" | undefined;
345
+ mockResponse?: unknown;
346
+ }[];
347
+ version: string;
348
+ id?: string | undefined;
349
+ name?: string | undefined;
350
+ tags?: string[] | undefined;
351
+ category?: "general" | "collaboration" | "enterprise-api" | "enterprise-data" | "enterprise-knowledge" | undefined;
352
+ metadata?: z.objectOutputType<{
353
+ owner: z.ZodOptional<z.ZodString>;
354
+ repository: z.ZodOptional<z.ZodString>;
355
+ bundlePath: z.ZodOptional<z.ZodString>;
356
+ }, z.ZodTypeAny, "passthrough"> | undefined;
357
+ server?: {
358
+ url?: string | undefined;
359
+ timeout?: number | undefined;
360
+ transport?: "stdio" | "sse" | "streamable_http" | undefined;
361
+ command?: string | undefined;
362
+ args?: string[] | undefined;
363
+ cwd?: string | undefined;
364
+ env?: Record<string, string> | undefined;
365
+ header?: Record<string, string> | undefined;
366
+ } | undefined;
367
+ riskLevel?: "low" | "medium" | "high" | undefined;
368
+ $schema?: string | undefined;
369
+ toolRuntime?: "local" | "server" | "both" | undefined;
370
+ package?: {
371
+ format: "zip";
372
+ resources?: {
373
+ memory?: string | undefined;
374
+ cpu?: string | undefined;
375
+ } | undefined;
376
+ sandbox?: boolean | undefined;
377
+ } | undefined;
378
+ gateway?: {
379
+ baseUrl: string;
380
+ allowedHosts: string[];
381
+ timeout?: number | undefined;
382
+ header?: Record<string, string> | undefined;
383
+ } | undefined;
384
+ }, {
385
+ code: string;
386
+ type: "code" | "mcp" | "http";
387
+ description: string;
388
+ tools: {
389
+ description: string;
390
+ name: string;
391
+ input: import("../json-schema.js").JsonSchema;
392
+ timeout?: number | undefined;
393
+ handler?: string | undefined;
394
+ runtime?: "node" | "python" | "executable" | undefined;
395
+ args?: string[] | undefined;
396
+ sandbox?: boolean | undefined;
397
+ output?: import("../json-schema.js").JsonSchema | undefined;
398
+ requireConfirmation?: boolean | undefined;
399
+ riskLevel?: "low" | "medium" | "high" | undefined;
400
+ dataScope?: "user-bound" | "department-bound" | "tenant-bound" | "global" | undefined;
401
+ pathTemplate?: string | undefined;
402
+ method?: "GET" | "POST" | "PUT" | "PATCH" | "DELETE" | undefined;
403
+ mockResponse?: unknown;
404
+ }[];
405
+ version: string;
406
+ status?: "draft" | "active" | "deprecated" | "archived" | "disabled" | "published" | undefined;
407
+ id?: string | undefined;
408
+ name?: string | undefined;
409
+ tags?: string[] | undefined;
410
+ category?: "general" | "collaboration" | "enterprise-api" | "enterprise-data" | "enterprise-knowledge" | undefined;
411
+ metadata?: z.objectInputType<{
412
+ owner: z.ZodOptional<z.ZodString>;
413
+ repository: z.ZodOptional<z.ZodString>;
414
+ bundlePath: z.ZodOptional<z.ZodString>;
415
+ }, z.ZodTypeAny, "passthrough"> | undefined;
416
+ server?: {
417
+ url?: string | undefined;
418
+ timeout?: number | undefined;
419
+ transport?: "stdio" | "sse" | "streamable_http" | undefined;
420
+ command?: string | undefined;
421
+ args?: string[] | undefined;
422
+ cwd?: string | undefined;
423
+ env?: Record<string, string> | undefined;
424
+ header?: Record<string, string> | undefined;
425
+ } | undefined;
426
+ riskLevel?: "low" | "medium" | "high" | undefined;
427
+ $schema?: string | undefined;
428
+ toolRuntime?: "local" | "server" | "both" | undefined;
429
+ package?: {
430
+ format: "zip";
431
+ resources?: {
432
+ memory?: string | undefined;
433
+ cpu?: string | undefined;
434
+ } | undefined;
435
+ sandbox?: boolean | undefined;
436
+ } | undefined;
437
+ gateway?: {
438
+ baseUrl: string;
439
+ allowedHosts: string[];
440
+ timeout?: number | undefined;
441
+ header?: Record<string, string> | undefined;
442
+ } | undefined;
443
+ }>;
444
+ export type ToolsetManifest = z.infer<typeof ToolsetManifestSchema>;
445
+ export type ToolsetToolEntry = z.infer<typeof ToolEntrySchema>;
446
+ export {};
447
+ //# sourceMappingURL=manifest.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"manifest.d.ts","sourceRoot":"","sources":["../../../src/schema/toolset/manifest.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAIxB,mDAAmD;AACnD,eAAO,MAAM,iBAAiB,aAKgB,CAAC;AAE/C,eAAO,MAAM,oBAAoB,aAGuB,CAAC;AAEzD,eAAO,MAAM,iBAAiB,oCAEyC,CAAC;AAExE,eAAO,MAAM,qBAAqB,sGAEV,CAAC;AAEzB,eAAO,MAAM,sBAAsB,sCAET,CAAC;AAE3B,eAAO,MAAM,oBAAoB,wCAEoB,CAAC;AAEtD,eAAO,MAAM,mBAAmB,iGAGkC,CAAC;AAEnE,eAAO,MAAM,mBAAmB,yEAEL,CAAC;AAqC5B,QAAA,MAAM,eAAe;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAgB2C,CAAC;AAQjE,eAAO,MAAM,qBAAqB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAyB6C,CAAC;AAEhF,MAAM,MAAM,eAAe,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,qBAAqB,CAAC,CAAC;AACpE,MAAM,MAAM,gBAAgB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,eAAe,CAAC,CAAC"}
@@ -0,0 +1,111 @@
1
+ import { z } from 'zod';
2
+ import { JsonSchemaSchema } from '../json-schema.js';
3
+ /** Toolset 对外主键(code):语义化小写标识,= 预装目录名 = 管理单元标识。 */
4
+ export const ToolsetCodeSchema = z
5
+ .string()
6
+ .min(1)
7
+ .max(64)
8
+ .regex(/^[a-z0-9][a-z0-9_-]*$/, 'Toolset code 只能包含小写字母、数字、连字符和下划线')
9
+ .describe('Toolset 编码,只能包含小写字母、数字、连字符和下划线。');
10
+ export const ToolsetVersionSchema = z
11
+ .string()
12
+ .regex(/^\d+\.\d+\.\d+$/, 'Toolset version 必须使用 major.minor.patch 格式(如 1.2.3)')
13
+ .describe('Toolset 的三段式语义化版本号,格式为 major.minor.patch。');
14
+ export const ToolsetTypeSchema = z
15
+ .enum(['code', 'mcp', 'http'])
16
+ .describe('工具集类型:mcp = MCP 服务;code = 代码包(ZIP,多语言);http = HTTP 网关代理。');
17
+ export const ToolsetCategorySchema = z
18
+ .enum(['general', 'collaboration', 'enterprise-api', 'enterprise-data', 'enterprise-knowledge'])
19
+ .describe('工具集的业务分类。');
20
+ export const ToolsetRiskLevelSchema = z
21
+ .enum(['low', 'medium', 'high'])
22
+ .describe('工具集的默认风险等级。');
23
+ export const ToolsetRuntimeSchema = z
24
+ .enum(['local', 'server', 'both'])
25
+ .describe('工具集可运行的环境或编排层路由提示:local、server 或 both。');
26
+ export const ToolsetStatusSchema = z
27
+ .enum(['draft', 'active', 'deprecated', 'archived', 'disabled', 'published'])
28
+ .default('published')
29
+ .describe('工具集生命周期状态;由 Registry 权威维护,dev-tools 默认视为 published。');
30
+ export const ToolDataScopeSchema = z
31
+ .enum(['user-bound', 'department-bound', 'tenant-bound', 'global'])
32
+ .describe('子工具可访问的数据范围。');
33
+ const ToolLanguageRuntimeSchema = z
34
+ .enum(['node', 'python', 'executable'])
35
+ .describe('code 类型子工具的语言运行时。');
36
+ const ToolMethodSchema = z
37
+ .enum(['GET', 'POST', 'PUT', 'PATCH', 'DELETE'])
38
+ .describe('http 类型子工具的请求方法。');
39
+ const McpServerConfigSchema = z.object({
40
+ transport: z.enum(['stdio', 'sse', 'streamable_http']).optional().describe('传输协议;缺省时:有 url → streamable_http,否则 stdio。'),
41
+ command: z.string().optional().describe('stdio 子进程命令(可为任意可执行文件路径)。'),
42
+ args: z.array(z.string()).optional().describe('启动参数。'),
43
+ cwd: z.string().optional().describe('工作目录。'),
44
+ env: z.record(z.string()).optional().describe('环境变量。'),
45
+ url: z.string().optional().describe('streamable_http / sse 远程端点。'),
46
+ header: z.record(z.string()).optional().describe('请求头(支持 ${ENV} 占位,部署时注入)。'),
47
+ timeout: z.number().int().min(1).max(300).optional().describe('集级默认超时(秒)。运行时乘 1000。默认 30。'),
48
+ }).strict().describe('MCP Server 连接配置(type=mcp 必填;集级一份,子工具共享)。');
49
+ const PackageConfigSchema = z.object({
50
+ format: z.literal('zip').describe('代码包格式,固定为 zip。'),
51
+ sandbox: z.boolean().optional().describe('集级默认是否沙箱执行(子工具可覆盖)。'),
52
+ resources: z.object({
53
+ memory: z.string().optional().describe('内存限制,例如 256m。'),
54
+ cpu: z.string().optional().describe('CPU 限制,例如 0.5。'),
55
+ }).strict().optional().describe('资源限制(可选)。'),
56
+ }).strict().describe('代码包配置(type=code;统一 ZIP 格式,支持多语言)。');
57
+ const GatewayConfigSchema = z.object({
58
+ baseUrl: z.string().describe('上游服务基址。'),
59
+ header: z.record(z.string()).optional().describe('请求头(支持 ${ENV} 占位)。'),
60
+ timeout: z.number().int().min(1).max(300).optional().describe('HTTP 出站超时(秒)。运行时乘 1000。默认 10。'),
61
+ allowedHosts: z.array(z.string()).min(1).describe('出站主机白名单。'),
62
+ }).strict().describe('HTTP 网关代理配置(type=http;对外统一输出 MCP 协议)。');
63
+ const ToolEntrySchema = z.object({
64
+ name: z.string().min(1).max(64).regex(/^[a-z0-9][a-z0-9_-]*$/, '子工具名只能包含小写字母、数字、连字符和下划线').describe('子工具名(= function calling 路由键;工具集内唯一)。'),
65
+ description: z.string().min(1).describe('工具用途描述(LLM 选择工具的依据)。'),
66
+ input: JsonSchemaSchema.describe('输入参数 JSON Schema。'),
67
+ output: JsonSchemaSchema.optional().describe('输出结果 JSON Schema(可选)。'),
68
+ handler: z.string().optional().describe('code 类型:入口文件(相对包根);executable 时为可执行文件路径。'),
69
+ runtime: ToolLanguageRuntimeSchema.optional().describe('code 类型:语言运行时。'),
70
+ args: z.array(z.string()).optional().describe('code/executable:额外命令行参数。'),
71
+ timeout: z.number().int().min(1).max(300).optional().describe('覆盖集级默认超时(秒)。'),
72
+ sandbox: z.boolean().optional().describe('覆盖集级默认沙箱设置。'),
73
+ requireConfirmation: z.boolean().optional().describe('是否必须由 Runtime/Gateway 发起 HITL 确认。'),
74
+ riskLevel: ToolsetRiskLevelSchema.optional().describe('覆盖集级默认风险等级。'),
75
+ dataScope: ToolDataScopeSchema.optional().describe('数据范围(可选)。'),
76
+ pathTemplate: z.string().optional().describe('http 类型:路径模板,{arg} 来自入参。'),
77
+ method: ToolMethodSchema.optional().describe('http 类型:请求方法。'),
78
+ mockResponse: z.unknown().optional().describe('本地/L1 mock 固定返回(dev 调试)。'),
79
+ }).strict().describe('子工具定义(function calling 注册单元;路由键 = name)。');
80
+ const ToolsetMetadataSchema = z.object({
81
+ owner: z.string().optional().describe('负责人。'),
82
+ repository: z.string().optional().describe('代码仓库地址。'),
83
+ bundlePath: z.string().optional().describe('L1 本机包根目录;生产使用 OBS,勿依赖。'),
84
+ }).passthrough().describe('工具集元数据(子字段均可选)。');
85
+ export const ToolsetManifestSchema = z.object({
86
+ $schema: z.string().optional().describe('指向本 schema 的 JSON Schema 声明。'),
87
+ code: ToolsetCodeSchema.describe('工具集对外主键(toolsetCode)。'),
88
+ name: z.string().min(1).max(100).optional().describe('展示名(可为中文),不得充当路由键。'),
89
+ id: z.string().max(64).optional().describe('可选内部标识(后台自动分配)。'),
90
+ version: ToolsetVersionSchema,
91
+ type: ToolsetTypeSchema,
92
+ description: z.string().min(1).max(500).describe('工具集描述(管理端展示 + 市场搜索)。'),
93
+ toolRuntime: ToolsetRuntimeSchema.optional().describe('运行属性标记:本地 / 服务端 / 两者均可。'),
94
+ status: ToolsetStatusSchema,
95
+ category: ToolsetCategorySchema.optional().describe('分类(市场上架推荐)。'),
96
+ tags: z.array(z.string()).optional().describe('标签列表(市场上架推荐)。'),
97
+ riskLevel: ToolsetRiskLevelSchema.optional().describe('集级默认风险等级(子工具可覆盖)。'),
98
+ server: McpServerConfigSchema.optional(),
99
+ package: PackageConfigSchema.optional(),
100
+ gateway: GatewayConfigSchema.optional(),
101
+ tools: z.array(ToolEntrySchema).min(1).describe('子工具清单(单工具是 tools[] 长度为 1 的特例)。'),
102
+ metadata: ToolsetMetadataSchema.optional(),
103
+ }).strict().superRefine((manifest, context) => {
104
+ if (manifest.type === 'mcp' && manifest.server === undefined) {
105
+ context.addIssue({ code: z.ZodIssueCode.custom, message: 'type=mcp 时必须提供 server 配置', path: ['server'] });
106
+ }
107
+ if (manifest.type === 'http' && manifest.gateway === undefined) {
108
+ context.addIssue({ code: z.ZodIssueCode.custom, message: 'type=http 时必须提供 gateway 配置', path: ['gateway'] });
109
+ }
110
+ }).describe('toolset.manifest.json 的完整结构;字段与 toolset.manifest.schema.json 对齐。');
111
+ //# sourceMappingURL=manifest.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"manifest.js","sourceRoot":"","sources":["../../../src/schema/toolset/manifest.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,OAAO,EAAE,gBAAgB,EAAE,MAAM,mBAAmB,CAAC;AAErD,mDAAmD;AACnD,MAAM,CAAC,MAAM,iBAAiB,GAAG,CAAC;KAC/B,MAAM,EAAE;KACR,GAAG,CAAC,CAAC,CAAC;KACN,GAAG,CAAC,EAAE,CAAC;KACP,KAAK,CAAC,uBAAuB,EAAE,kCAAkC,CAAC;KAClE,QAAQ,CAAC,iCAAiC,CAAC,CAAC;AAE/C,MAAM,CAAC,MAAM,oBAAoB,GAAG,CAAC;KAClC,MAAM,EAAE;KACR,KAAK,CAAC,iBAAiB,EAAE,oDAAoD,CAAC;KAC9E,QAAQ,CAAC,2CAA2C,CAAC,CAAC;AAEzD,MAAM,CAAC,MAAM,iBAAiB,GAAG,CAAC;KAC/B,IAAI,CAAC,CAAC,MAAM,EAAE,KAAK,EAAE,MAAM,CAAC,CAAC;KAC7B,QAAQ,CAAC,0DAA0D,CAAC,CAAC;AAExE,MAAM,CAAC,MAAM,qBAAqB,GAAG,CAAC;KACnC,IAAI,CAAC,CAAC,SAAS,EAAE,eAAe,E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OAAO,EAAE,4BAA4B,EAAE,IAAI,EAAE,CAAC,SAAS,CAAC,EAAE,CAAC,CAAC;IAC9G,CAAC;AACH,CAAC,CAAC,CAAC,QAAQ,CAAC,kEAAkE,CAAC,CAAC"}
@@ -0,0 +1,7 @@
1
+ import { type ToolsetManifest } from './manifest.js';
2
+ export declare class ToolsetManifestReadError extends Error {
3
+ readonly path: string;
4
+ constructor(message: string, path: string);
5
+ }
6
+ export declare function readToolsetManifest(filePath: string): ToolsetManifest;
7
+ //# sourceMappingURL=read-toolset-manifest.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"read-toolset-manifest.d.ts","sourceRoot":"","sources":["../../../src/schema/toolset/read-toolset-manifest.ts"],"names":[],"mappings":"AAGA,OAAO,EAAyB,KAAK,eAAe,EAAE,MAAM,eAAe,CAAC;AAE5E,qBAAa,wBAAyB,SAAQ,KAAK;IACpB,QAAQ,CAAC,IAAI,EAAE,MAAM;gBAAtC,OAAO,EAAE,MAAM,EAAW,IAAI,EAAE,MAAM;CAInD;AAED,wBAAgB,mBAAmB,CAAC,QAAQ,EAAE,MAAM,GAAG,eAAe,CA+BrE"}
@@ -1,18 +1,18 @@
1
1
  import { existsSync, readFileSync } from 'node:fs';
2
2
  import { resolve } from 'node:path';
3
- import { ToolManifestSchema } from './manifest.js';
4
- export class ToolManifestReadError extends Error {
3
+ import { ToolsetManifestSchema } from './manifest.js';
4
+ export class ToolsetManifestReadError extends Error {
5
5
  path;
6
6
  constructor(message, path) {
7
7
  super(message);
8
8
  this.path = path;
9
- this.name = 'ToolManifestReadError';
9
+ this.name = 'ToolsetManifestReadError';
10
10
  }
11
11
  }
12
- export function readToolManifest(filePath) {
12
+ export function readToolsetManifest(filePath) {
13
13
  const path = resolve(filePath);
14
14
  if (!existsSync(path)) {
15
- throw new ToolManifestReadError(`Tool manifest is missing: ${path}`, path);
15
+ throw new ToolsetManifestReadError(`Toolset manifest is missing: ${path}`, path);
16
16
  }
17
17
  let contents;
18
18
  try {
@@ -20,7 +20,7 @@ export function readToolManifest(filePath) {
20
20
  }
21
21
  catch (error) {
22
22
  const reason = error instanceof Error ? error.message : String(error);
23
- throw new ToolManifestReadError(`Tool manifest cannot be read: ${path} (${reason})`, path);
23
+ throw new ToolsetManifestReadError(`Toolset manifest cannot be read: ${path} (${reason})`, path);
24
24
  }
25
25
  let input;
26
26
  try {
@@ -28,15 +28,15 @@ export function readToolManifest(filePath) {
28
28
  }
29
29
  catch (error) {
30
30
  const reason = error instanceof Error ? error.message : String(error);
31
- throw new ToolManifestReadError(`Tool manifest is not valid JSON: ${path} (${reason})`, path);
31
+ throw new ToolsetManifestReadError(`Toolset manifest is not valid JSON: ${path} (${reason})`, path);
32
32
  }
33
- const parsed = ToolManifestSchema.safeParse(input);
33
+ const parsed = ToolsetManifestSchema.safeParse(input);
34
34
  if (!parsed.success) {
35
35
  const issues = parsed.error.issues
36
36
  .map((issue) => `${issue.path.join('.') || '<root>'}: ${issue.message}`)
37
37
  .join('; ');
38
- throw new ToolManifestReadError(`Tool manifest is invalid: ${path} (${issues})`, path);
38
+ throw new ToolsetManifestReadError(`Toolset manifest is invalid: ${path} (${issues})`, path);
39
39
  }
40
40
  return parsed.data;
41
41
  }
42
- //# sourceMappingURL=read-tool-manifest.js.map
42
+ //# sourceMappingURL=read-toolset-manifest.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"read-toolset-manifest.js","sourceRoot":"","sources":["../../../src/schema/toolset/read-toolset-manifest.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AACnD,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAEpC,OAAO,EAAE,qBAAqB,EAAwB,MAAM,eAAe,CAAC;AAE5E,MAAM,OAAO,wBAAyB,SAAQ,KAAK;IACX;IAAtC,YAAY,OAAe,EAAW,IAAY;QAChD,KAAK,CAAC,OAAO,CAAC,CAAC;QADqB,SAAI,GAAJ,IAAI,C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