@nimblebrain/mpak-sdk 0.0.1 → 0.1.1
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/dist/index.cjs +496 -0
- package/dist/index.cjs.map +1 -0
- package/dist/index.d.cts +1245 -0
- package/dist/index.d.ts +1240 -34
- package/dist/index.js +454 -35
- package/dist/index.js.map +1 -1
- package/package.json +9 -4
- package/dist/client.d.ts +0 -74
- package/dist/client.d.ts.map +0 -1
- package/dist/client.integration.test.d.ts +0 -11
- package/dist/client.integration.test.d.ts.map +0 -1
- package/dist/client.integration.test.js +0 -121
- package/dist/client.integration.test.js.map +0 -1
- package/dist/client.js +0 -283
- package/dist/client.js.map +0 -1
- package/dist/client.test.d.ts +0 -2
- package/dist/client.test.d.ts.map +0 -1
- package/dist/client.test.js +0 -344
- package/dist/client.test.js.map +0 -1
- package/dist/errors.d.ts +0 -30
- package/dist/errors.d.ts.map +0 -1
- package/dist/errors.js +0 -46
- package/dist/errors.js.map +0 -1
- package/dist/errors.test.d.ts +0 -2
- package/dist/errors.test.d.ts.map +0 -1
- package/dist/errors.test.js +0 -136
- package/dist/errors.test.js.map +0 -1
- package/dist/index.d.ts.map +0 -1
- package/dist/types.d.ts +0 -94
- package/dist/types.d.ts.map +0 -1
- package/dist/types.js +0 -7
- package/dist/types.js.map +0 -1
package/dist/index.d.cts
ADDED
|
@@ -0,0 +1,1245 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* This file was auto-generated by openapi-typescript.
|
|
3
|
+
* Do not make direct changes to the file.
|
|
4
|
+
*/
|
|
5
|
+
|
|
6
|
+
interface paths {
|
|
7
|
+
"/v1/bundles/search": {
|
|
8
|
+
parameters: {
|
|
9
|
+
query?: never;
|
|
10
|
+
header?: never;
|
|
11
|
+
path?: never;
|
|
12
|
+
cookie?: never;
|
|
13
|
+
};
|
|
14
|
+
/** @description Search for bundles */
|
|
15
|
+
get: {
|
|
16
|
+
parameters: {
|
|
17
|
+
query?: {
|
|
18
|
+
/** @description Search query */
|
|
19
|
+
q?: string;
|
|
20
|
+
/** @description Filter by server type */
|
|
21
|
+
type?: string;
|
|
22
|
+
sort?: "downloads" | "recent" | "name";
|
|
23
|
+
limit?: number;
|
|
24
|
+
offset?: number;
|
|
25
|
+
};
|
|
26
|
+
header?: never;
|
|
27
|
+
path?: never;
|
|
28
|
+
cookie?: never;
|
|
29
|
+
};
|
|
30
|
+
requestBody?: never;
|
|
31
|
+
responses: {
|
|
32
|
+
/** @description Default Response */
|
|
33
|
+
200: {
|
|
34
|
+
headers: {
|
|
35
|
+
[name: string]: unknown;
|
|
36
|
+
};
|
|
37
|
+
content: {
|
|
38
|
+
"application/json": {
|
|
39
|
+
bundles: {
|
|
40
|
+
name: string;
|
|
41
|
+
display_name?: string | null;
|
|
42
|
+
description?: string | null;
|
|
43
|
+
author?: {
|
|
44
|
+
name: string;
|
|
45
|
+
} | null;
|
|
46
|
+
latest_version: string;
|
|
47
|
+
icon?: string | null;
|
|
48
|
+
server_type?: string | null;
|
|
49
|
+
tools?: {
|
|
50
|
+
name: string;
|
|
51
|
+
description?: string;
|
|
52
|
+
}[];
|
|
53
|
+
downloads: number;
|
|
54
|
+
published_at: string | unknown;
|
|
55
|
+
verified: boolean;
|
|
56
|
+
provenance?: {
|
|
57
|
+
schema_version: string;
|
|
58
|
+
provider: string;
|
|
59
|
+
repository: string;
|
|
60
|
+
sha: string;
|
|
61
|
+
} | null;
|
|
62
|
+
}[];
|
|
63
|
+
total: number;
|
|
64
|
+
pagination: {
|
|
65
|
+
limit: number;
|
|
66
|
+
offset: number;
|
|
67
|
+
has_more: boolean;
|
|
68
|
+
};
|
|
69
|
+
};
|
|
70
|
+
};
|
|
71
|
+
};
|
|
72
|
+
};
|
|
73
|
+
};
|
|
74
|
+
put?: never;
|
|
75
|
+
post?: never;
|
|
76
|
+
delete?: never;
|
|
77
|
+
options?: never;
|
|
78
|
+
head?: never;
|
|
79
|
+
patch?: never;
|
|
80
|
+
trace?: never;
|
|
81
|
+
};
|
|
82
|
+
"/v1/bundles/@{scope}/{package}": {
|
|
83
|
+
parameters: {
|
|
84
|
+
query?: never;
|
|
85
|
+
header?: never;
|
|
86
|
+
path?: never;
|
|
87
|
+
cookie?: never;
|
|
88
|
+
};
|
|
89
|
+
/** @description Get detailed bundle information */
|
|
90
|
+
get: {
|
|
91
|
+
parameters: {
|
|
92
|
+
query?: never;
|
|
93
|
+
header?: never;
|
|
94
|
+
path: {
|
|
95
|
+
scope: string;
|
|
96
|
+
package: string;
|
|
97
|
+
};
|
|
98
|
+
cookie?: never;
|
|
99
|
+
};
|
|
100
|
+
requestBody?: never;
|
|
101
|
+
responses: {
|
|
102
|
+
/** @description Default Response */
|
|
103
|
+
200: {
|
|
104
|
+
headers: {
|
|
105
|
+
[name: string]: unknown;
|
|
106
|
+
};
|
|
107
|
+
content: {
|
|
108
|
+
"application/json": {
|
|
109
|
+
name: string;
|
|
110
|
+
display_name?: string | null;
|
|
111
|
+
description?: string | null;
|
|
112
|
+
author?: {
|
|
113
|
+
name: string;
|
|
114
|
+
} | null;
|
|
115
|
+
latest_version: string;
|
|
116
|
+
icon?: string | null;
|
|
117
|
+
server_type?: string | null;
|
|
118
|
+
tools?: {
|
|
119
|
+
name: string;
|
|
120
|
+
description?: string;
|
|
121
|
+
}[];
|
|
122
|
+
downloads: number;
|
|
123
|
+
published_at: string | unknown;
|
|
124
|
+
verified: boolean;
|
|
125
|
+
provenance?: {
|
|
126
|
+
schema_version: string;
|
|
127
|
+
provider: string;
|
|
128
|
+
repository: string;
|
|
129
|
+
sha: string;
|
|
130
|
+
} | null;
|
|
131
|
+
homepage?: string | null;
|
|
132
|
+
license?: string | null;
|
|
133
|
+
versions: {
|
|
134
|
+
version: string;
|
|
135
|
+
published_at: string | unknown;
|
|
136
|
+
downloads: number;
|
|
137
|
+
}[];
|
|
138
|
+
};
|
|
139
|
+
};
|
|
140
|
+
};
|
|
141
|
+
};
|
|
142
|
+
};
|
|
143
|
+
put?: never;
|
|
144
|
+
post?: never;
|
|
145
|
+
delete?: never;
|
|
146
|
+
options?: never;
|
|
147
|
+
head?: never;
|
|
148
|
+
patch?: never;
|
|
149
|
+
trace?: never;
|
|
150
|
+
};
|
|
151
|
+
"/v1/bundles/@{scope}/{package}/badge.svg": {
|
|
152
|
+
parameters: {
|
|
153
|
+
query?: never;
|
|
154
|
+
header?: never;
|
|
155
|
+
path?: never;
|
|
156
|
+
cookie?: never;
|
|
157
|
+
};
|
|
158
|
+
/** @description Get an SVG badge for a bundle (for README embeds) */
|
|
159
|
+
get: {
|
|
160
|
+
parameters: {
|
|
161
|
+
query?: {
|
|
162
|
+
/** @description Badge type: version (default), downloads, or runtime */
|
|
163
|
+
type?: "version" | "downloads" | "runtime";
|
|
164
|
+
};
|
|
165
|
+
header?: never;
|
|
166
|
+
path: {
|
|
167
|
+
scope: string;
|
|
168
|
+
package: string;
|
|
169
|
+
};
|
|
170
|
+
cookie?: never;
|
|
171
|
+
};
|
|
172
|
+
requestBody?: never;
|
|
173
|
+
responses: {
|
|
174
|
+
/** @description SVG badge image */
|
|
175
|
+
200: {
|
|
176
|
+
headers: {
|
|
177
|
+
[name: string]: unknown;
|
|
178
|
+
};
|
|
179
|
+
content: {
|
|
180
|
+
"application/json": string;
|
|
181
|
+
};
|
|
182
|
+
};
|
|
183
|
+
};
|
|
184
|
+
};
|
|
185
|
+
put?: never;
|
|
186
|
+
post?: never;
|
|
187
|
+
delete?: never;
|
|
188
|
+
options?: never;
|
|
189
|
+
head?: never;
|
|
190
|
+
patch?: never;
|
|
191
|
+
trace?: never;
|
|
192
|
+
};
|
|
193
|
+
"/v1/bundles/@{scope}/{package}/index.json": {
|
|
194
|
+
parameters: {
|
|
195
|
+
query?: never;
|
|
196
|
+
header?: never;
|
|
197
|
+
path?: never;
|
|
198
|
+
cookie?: never;
|
|
199
|
+
};
|
|
200
|
+
/** @description Get multi-platform distribution index for a bundle (MCPB Index spec) */
|
|
201
|
+
get: {
|
|
202
|
+
parameters: {
|
|
203
|
+
query?: never;
|
|
204
|
+
header?: never;
|
|
205
|
+
path: {
|
|
206
|
+
scope: string;
|
|
207
|
+
package: string;
|
|
208
|
+
};
|
|
209
|
+
cookie?: never;
|
|
210
|
+
};
|
|
211
|
+
requestBody?: never;
|
|
212
|
+
responses: {
|
|
213
|
+
/** @description Default Response */
|
|
214
|
+
200: {
|
|
215
|
+
headers: {
|
|
216
|
+
[name: string]: unknown;
|
|
217
|
+
};
|
|
218
|
+
content: {
|
|
219
|
+
"application/json": {
|
|
220
|
+
index_version: string;
|
|
221
|
+
mimeType: string;
|
|
222
|
+
name: string;
|
|
223
|
+
version: string;
|
|
224
|
+
description: string | null;
|
|
225
|
+
bundles: {
|
|
226
|
+
mimeType: string | null;
|
|
227
|
+
digest: string;
|
|
228
|
+
size: number;
|
|
229
|
+
platform: {
|
|
230
|
+
os: string;
|
|
231
|
+
arch: string;
|
|
232
|
+
};
|
|
233
|
+
urls: string[];
|
|
234
|
+
}[];
|
|
235
|
+
annotations?: {
|
|
236
|
+
[key: string]: string;
|
|
237
|
+
};
|
|
238
|
+
};
|
|
239
|
+
};
|
|
240
|
+
};
|
|
241
|
+
};
|
|
242
|
+
};
|
|
243
|
+
put?: never;
|
|
244
|
+
post?: never;
|
|
245
|
+
delete?: never;
|
|
246
|
+
options?: never;
|
|
247
|
+
head?: never;
|
|
248
|
+
patch?: never;
|
|
249
|
+
trace?: never;
|
|
250
|
+
};
|
|
251
|
+
"/v1/bundles/@{scope}/{package}/versions": {
|
|
252
|
+
parameters: {
|
|
253
|
+
query?: never;
|
|
254
|
+
header?: never;
|
|
255
|
+
path?: never;
|
|
256
|
+
cookie?: never;
|
|
257
|
+
};
|
|
258
|
+
/** @description List all versions of a bundle */
|
|
259
|
+
get: {
|
|
260
|
+
parameters: {
|
|
261
|
+
query?: never;
|
|
262
|
+
header?: never;
|
|
263
|
+
path: {
|
|
264
|
+
scope: string;
|
|
265
|
+
package: string;
|
|
266
|
+
};
|
|
267
|
+
cookie?: never;
|
|
268
|
+
};
|
|
269
|
+
requestBody?: never;
|
|
270
|
+
responses: {
|
|
271
|
+
/** @description Default Response */
|
|
272
|
+
200: {
|
|
273
|
+
headers: {
|
|
274
|
+
[name: string]: unknown;
|
|
275
|
+
};
|
|
276
|
+
content: {
|
|
277
|
+
"application/json": {
|
|
278
|
+
name: string;
|
|
279
|
+
latest: string;
|
|
280
|
+
versions: {
|
|
281
|
+
version: string;
|
|
282
|
+
artifacts_count: number;
|
|
283
|
+
platforms: {
|
|
284
|
+
os: string;
|
|
285
|
+
arch: string;
|
|
286
|
+
}[];
|
|
287
|
+
published_at: string | unknown;
|
|
288
|
+
downloads: number;
|
|
289
|
+
publish_method: string | null;
|
|
290
|
+
provenance?: {
|
|
291
|
+
schema_version: string;
|
|
292
|
+
provider: string;
|
|
293
|
+
repository: string;
|
|
294
|
+
sha: string;
|
|
295
|
+
} | null;
|
|
296
|
+
}[];
|
|
297
|
+
};
|
|
298
|
+
};
|
|
299
|
+
};
|
|
300
|
+
};
|
|
301
|
+
};
|
|
302
|
+
put?: never;
|
|
303
|
+
post?: never;
|
|
304
|
+
delete?: never;
|
|
305
|
+
options?: never;
|
|
306
|
+
head?: never;
|
|
307
|
+
patch?: never;
|
|
308
|
+
trace?: never;
|
|
309
|
+
};
|
|
310
|
+
"/v1/bundles/@{scope}/{package}/versions/{version}": {
|
|
311
|
+
parameters: {
|
|
312
|
+
query?: never;
|
|
313
|
+
header?: never;
|
|
314
|
+
path?: never;
|
|
315
|
+
cookie?: never;
|
|
316
|
+
};
|
|
317
|
+
/** @description Get information about a specific version */
|
|
318
|
+
get: {
|
|
319
|
+
parameters: {
|
|
320
|
+
query?: never;
|
|
321
|
+
header?: never;
|
|
322
|
+
path: {
|
|
323
|
+
scope: string;
|
|
324
|
+
package: string;
|
|
325
|
+
version: string;
|
|
326
|
+
};
|
|
327
|
+
cookie?: never;
|
|
328
|
+
};
|
|
329
|
+
requestBody?: never;
|
|
330
|
+
responses: {
|
|
331
|
+
/** @description Default Response */
|
|
332
|
+
200: {
|
|
333
|
+
headers: {
|
|
334
|
+
[name: string]: unknown;
|
|
335
|
+
};
|
|
336
|
+
content: {
|
|
337
|
+
"application/json": {
|
|
338
|
+
name: string;
|
|
339
|
+
version: string;
|
|
340
|
+
published_at: string | unknown;
|
|
341
|
+
downloads: number;
|
|
342
|
+
artifacts: {
|
|
343
|
+
platform: {
|
|
344
|
+
os: string;
|
|
345
|
+
arch: string;
|
|
346
|
+
};
|
|
347
|
+
digest: string;
|
|
348
|
+
size: number;
|
|
349
|
+
download_url: string;
|
|
350
|
+
source_url?: string;
|
|
351
|
+
}[];
|
|
352
|
+
manifest: {
|
|
353
|
+
[key: string]: unknown;
|
|
354
|
+
};
|
|
355
|
+
release?: {
|
|
356
|
+
tag: string | null;
|
|
357
|
+
url: string | null;
|
|
358
|
+
};
|
|
359
|
+
publish_method: string | null;
|
|
360
|
+
provenance: {
|
|
361
|
+
schema_version: string;
|
|
362
|
+
provider: string;
|
|
363
|
+
repository: string;
|
|
364
|
+
sha: string;
|
|
365
|
+
} | null;
|
|
366
|
+
};
|
|
367
|
+
};
|
|
368
|
+
};
|
|
369
|
+
};
|
|
370
|
+
};
|
|
371
|
+
put?: never;
|
|
372
|
+
post?: never;
|
|
373
|
+
delete?: never;
|
|
374
|
+
options?: never;
|
|
375
|
+
head?: never;
|
|
376
|
+
patch?: never;
|
|
377
|
+
trace?: never;
|
|
378
|
+
};
|
|
379
|
+
"/v1/bundles/@{scope}/{package}/versions/{version}/download": {
|
|
380
|
+
parameters: {
|
|
381
|
+
query?: never;
|
|
382
|
+
header?: never;
|
|
383
|
+
path?: never;
|
|
384
|
+
cookie?: never;
|
|
385
|
+
};
|
|
386
|
+
/** @description Download a specific version of a bundle */
|
|
387
|
+
get: {
|
|
388
|
+
parameters: {
|
|
389
|
+
query?: {
|
|
390
|
+
/** @description Target OS (darwin, linux, win32, any) */
|
|
391
|
+
os?: string;
|
|
392
|
+
/** @description Target arch (x64, arm64, any) */
|
|
393
|
+
arch?: string;
|
|
394
|
+
};
|
|
395
|
+
header?: never;
|
|
396
|
+
path: {
|
|
397
|
+
scope: string;
|
|
398
|
+
package: string;
|
|
399
|
+
version: string;
|
|
400
|
+
};
|
|
401
|
+
cookie?: never;
|
|
402
|
+
};
|
|
403
|
+
requestBody?: never;
|
|
404
|
+
responses: {
|
|
405
|
+
/** @description Default Response */
|
|
406
|
+
200: {
|
|
407
|
+
headers: {
|
|
408
|
+
[name: string]: unknown;
|
|
409
|
+
};
|
|
410
|
+
content: {
|
|
411
|
+
"application/json": {
|
|
412
|
+
url: string;
|
|
413
|
+
bundle: {
|
|
414
|
+
name: string;
|
|
415
|
+
version: string;
|
|
416
|
+
platform: {
|
|
417
|
+
os: string;
|
|
418
|
+
arch: string;
|
|
419
|
+
};
|
|
420
|
+
sha256: string;
|
|
421
|
+
size: number;
|
|
422
|
+
};
|
|
423
|
+
expires_at?: string;
|
|
424
|
+
};
|
|
425
|
+
};
|
|
426
|
+
};
|
|
427
|
+
/** @description Redirect to download URL */
|
|
428
|
+
302: {
|
|
429
|
+
headers: {
|
|
430
|
+
[name: string]: unknown;
|
|
431
|
+
};
|
|
432
|
+
content?: never;
|
|
433
|
+
};
|
|
434
|
+
};
|
|
435
|
+
};
|
|
436
|
+
put?: never;
|
|
437
|
+
post?: never;
|
|
438
|
+
delete?: never;
|
|
439
|
+
options?: never;
|
|
440
|
+
head?: never;
|
|
441
|
+
patch?: never;
|
|
442
|
+
trace?: never;
|
|
443
|
+
};
|
|
444
|
+
"/v1/bundles/announce": {
|
|
445
|
+
parameters: {
|
|
446
|
+
query?: never;
|
|
447
|
+
header?: never;
|
|
448
|
+
path?: never;
|
|
449
|
+
cookie?: never;
|
|
450
|
+
};
|
|
451
|
+
get?: never;
|
|
452
|
+
put?: never;
|
|
453
|
+
/** @description Announce a single artifact for a bundle version from a GitHub release (OIDC only). Idempotent - can be called multiple times for different artifacts of the same version. */
|
|
454
|
+
post: {
|
|
455
|
+
parameters: {
|
|
456
|
+
query?: never;
|
|
457
|
+
header?: never;
|
|
458
|
+
path?: never;
|
|
459
|
+
cookie?: never;
|
|
460
|
+
};
|
|
461
|
+
requestBody: {
|
|
462
|
+
content: {
|
|
463
|
+
"application/json": {
|
|
464
|
+
name: string;
|
|
465
|
+
version: string;
|
|
466
|
+
manifest: {
|
|
467
|
+
[key: string]: unknown;
|
|
468
|
+
};
|
|
469
|
+
release_tag: string;
|
|
470
|
+
/** @default false */
|
|
471
|
+
prerelease: boolean;
|
|
472
|
+
artifact: {
|
|
473
|
+
filename: string;
|
|
474
|
+
os: string;
|
|
475
|
+
arch: string;
|
|
476
|
+
sha256: string;
|
|
477
|
+
size: number;
|
|
478
|
+
};
|
|
479
|
+
};
|
|
480
|
+
};
|
|
481
|
+
};
|
|
482
|
+
responses: {
|
|
483
|
+
/** @description Default Response */
|
|
484
|
+
200: {
|
|
485
|
+
headers: {
|
|
486
|
+
[name: string]: unknown;
|
|
487
|
+
};
|
|
488
|
+
content: {
|
|
489
|
+
"application/json": {
|
|
490
|
+
package: string;
|
|
491
|
+
version: string;
|
|
492
|
+
artifact: {
|
|
493
|
+
os: string;
|
|
494
|
+
arch: string;
|
|
495
|
+
filename: string;
|
|
496
|
+
};
|
|
497
|
+
total_artifacts: number;
|
|
498
|
+
/** @enum {string} */
|
|
499
|
+
status: "created" | "updated";
|
|
500
|
+
};
|
|
501
|
+
};
|
|
502
|
+
};
|
|
503
|
+
};
|
|
504
|
+
};
|
|
505
|
+
delete?: never;
|
|
506
|
+
options?: never;
|
|
507
|
+
head?: never;
|
|
508
|
+
patch?: never;
|
|
509
|
+
trace?: never;
|
|
510
|
+
};
|
|
511
|
+
"/v1/skills/search": {
|
|
512
|
+
parameters: {
|
|
513
|
+
query?: never;
|
|
514
|
+
header?: never;
|
|
515
|
+
path?: never;
|
|
516
|
+
cookie?: never;
|
|
517
|
+
};
|
|
518
|
+
/** @description Search for skills */
|
|
519
|
+
get: {
|
|
520
|
+
parameters: {
|
|
521
|
+
query?: {
|
|
522
|
+
/** @description Search query */
|
|
523
|
+
q?: string;
|
|
524
|
+
/** @description Filter by tags (comma-separated) */
|
|
525
|
+
tags?: string;
|
|
526
|
+
/** @description Filter by category */
|
|
527
|
+
category?: string;
|
|
528
|
+
/** @description Filter by surface (claude-code, claude-api, claude-ai) */
|
|
529
|
+
surface?: string;
|
|
530
|
+
sort?: "downloads" | "recent" | "name";
|
|
531
|
+
limit?: number;
|
|
532
|
+
offset?: number;
|
|
533
|
+
};
|
|
534
|
+
header?: never;
|
|
535
|
+
path?: never;
|
|
536
|
+
cookie?: never;
|
|
537
|
+
};
|
|
538
|
+
requestBody?: never;
|
|
539
|
+
responses: {
|
|
540
|
+
/** @description Default Response */
|
|
541
|
+
200: {
|
|
542
|
+
headers: {
|
|
543
|
+
[name: string]: unknown;
|
|
544
|
+
};
|
|
545
|
+
content: {
|
|
546
|
+
"application/json": {
|
|
547
|
+
skills: {
|
|
548
|
+
name: string;
|
|
549
|
+
description: string;
|
|
550
|
+
latest_version: string;
|
|
551
|
+
tags?: string[];
|
|
552
|
+
/** @enum {string} */
|
|
553
|
+
category?: "development" | "writing" | "research" | "consulting" | "data" | "design" | "operations" | "security" | "other";
|
|
554
|
+
surfaces?: ("claude-code" | "claude-api" | "claude-ai")[];
|
|
555
|
+
downloads: number;
|
|
556
|
+
published_at: string;
|
|
557
|
+
author?: {
|
|
558
|
+
name: string;
|
|
559
|
+
/** Format: uri */
|
|
560
|
+
url?: string;
|
|
561
|
+
/** Format: email */
|
|
562
|
+
email?: string;
|
|
563
|
+
};
|
|
564
|
+
}[];
|
|
565
|
+
total: number;
|
|
566
|
+
pagination: {
|
|
567
|
+
limit: number;
|
|
568
|
+
offset: number;
|
|
569
|
+
has_more: boolean;
|
|
570
|
+
};
|
|
571
|
+
};
|
|
572
|
+
};
|
|
573
|
+
};
|
|
574
|
+
};
|
|
575
|
+
};
|
|
576
|
+
put?: never;
|
|
577
|
+
post?: never;
|
|
578
|
+
delete?: never;
|
|
579
|
+
options?: never;
|
|
580
|
+
head?: never;
|
|
581
|
+
patch?: never;
|
|
582
|
+
trace?: never;
|
|
583
|
+
};
|
|
584
|
+
"/v1/skills/@{scope}/{name}": {
|
|
585
|
+
parameters: {
|
|
586
|
+
query?: never;
|
|
587
|
+
header?: never;
|
|
588
|
+
path?: never;
|
|
589
|
+
cookie?: never;
|
|
590
|
+
};
|
|
591
|
+
/** @description Get detailed skill information */
|
|
592
|
+
get: {
|
|
593
|
+
parameters: {
|
|
594
|
+
query?: never;
|
|
595
|
+
header?: never;
|
|
596
|
+
path: {
|
|
597
|
+
scope: string;
|
|
598
|
+
name: string;
|
|
599
|
+
};
|
|
600
|
+
cookie?: never;
|
|
601
|
+
};
|
|
602
|
+
requestBody?: never;
|
|
603
|
+
responses: {
|
|
604
|
+
/** @description Default Response */
|
|
605
|
+
200: {
|
|
606
|
+
headers: {
|
|
607
|
+
[name: string]: unknown;
|
|
608
|
+
};
|
|
609
|
+
content: {
|
|
610
|
+
"application/json": {
|
|
611
|
+
name: string;
|
|
612
|
+
description: string;
|
|
613
|
+
latest_version: string;
|
|
614
|
+
license?: string;
|
|
615
|
+
compatibility?: string;
|
|
616
|
+
allowed_tools?: string[];
|
|
617
|
+
tags?: string[];
|
|
618
|
+
/** @enum {string} */
|
|
619
|
+
category?: "development" | "writing" | "research" | "consulting" | "data" | "design" | "operations" | "security" | "other";
|
|
620
|
+
triggers?: string[];
|
|
621
|
+
surfaces?: ("claude-code" | "claude-api" | "claude-ai")[];
|
|
622
|
+
downloads: number;
|
|
623
|
+
published_at: string;
|
|
624
|
+
author?: {
|
|
625
|
+
name: string;
|
|
626
|
+
/** Format: uri */
|
|
627
|
+
url?: string;
|
|
628
|
+
/** Format: email */
|
|
629
|
+
email?: string;
|
|
630
|
+
};
|
|
631
|
+
examples?: {
|
|
632
|
+
prompt: string;
|
|
633
|
+
context?: string;
|
|
634
|
+
}[];
|
|
635
|
+
versions: {
|
|
636
|
+
version: string;
|
|
637
|
+
published_at: string;
|
|
638
|
+
downloads: number;
|
|
639
|
+
}[];
|
|
640
|
+
};
|
|
641
|
+
};
|
|
642
|
+
};
|
|
643
|
+
};
|
|
644
|
+
};
|
|
645
|
+
put?: never;
|
|
646
|
+
post?: never;
|
|
647
|
+
delete?: never;
|
|
648
|
+
options?: never;
|
|
649
|
+
head?: never;
|
|
650
|
+
patch?: never;
|
|
651
|
+
trace?: never;
|
|
652
|
+
};
|
|
653
|
+
"/v1/skills/@{scope}/{name}/badge.svg": {
|
|
654
|
+
parameters: {
|
|
655
|
+
query?: never;
|
|
656
|
+
header?: never;
|
|
657
|
+
path?: never;
|
|
658
|
+
cookie?: never;
|
|
659
|
+
};
|
|
660
|
+
/** @description Get an SVG badge for a skill (for README embeds) */
|
|
661
|
+
get: {
|
|
662
|
+
parameters: {
|
|
663
|
+
query?: {
|
|
664
|
+
/** @description Badge type: version (default) or downloads */
|
|
665
|
+
type?: "version" | "downloads";
|
|
666
|
+
};
|
|
667
|
+
header?: never;
|
|
668
|
+
path: {
|
|
669
|
+
scope: string;
|
|
670
|
+
name: string;
|
|
671
|
+
};
|
|
672
|
+
cookie?: never;
|
|
673
|
+
};
|
|
674
|
+
requestBody?: never;
|
|
675
|
+
responses: {
|
|
676
|
+
/** @description SVG badge image */
|
|
677
|
+
200: {
|
|
678
|
+
headers: {
|
|
679
|
+
[name: string]: unknown;
|
|
680
|
+
};
|
|
681
|
+
content: {
|
|
682
|
+
"application/json": string;
|
|
683
|
+
};
|
|
684
|
+
};
|
|
685
|
+
};
|
|
686
|
+
};
|
|
687
|
+
put?: never;
|
|
688
|
+
post?: never;
|
|
689
|
+
delete?: never;
|
|
690
|
+
options?: never;
|
|
691
|
+
head?: never;
|
|
692
|
+
patch?: never;
|
|
693
|
+
trace?: never;
|
|
694
|
+
};
|
|
695
|
+
"/v1/skills/@{scope}/{name}/download": {
|
|
696
|
+
parameters: {
|
|
697
|
+
query?: never;
|
|
698
|
+
header?: never;
|
|
699
|
+
path?: never;
|
|
700
|
+
cookie?: never;
|
|
701
|
+
};
|
|
702
|
+
/** @description Download the latest version of a skill bundle */
|
|
703
|
+
get: {
|
|
704
|
+
parameters: {
|
|
705
|
+
query?: never;
|
|
706
|
+
header?: never;
|
|
707
|
+
path: {
|
|
708
|
+
scope: string;
|
|
709
|
+
name: string;
|
|
710
|
+
};
|
|
711
|
+
cookie?: never;
|
|
712
|
+
};
|
|
713
|
+
requestBody?: never;
|
|
714
|
+
responses: {
|
|
715
|
+
/** @description Default Response */
|
|
716
|
+
200: {
|
|
717
|
+
headers: {
|
|
718
|
+
[name: string]: unknown;
|
|
719
|
+
};
|
|
720
|
+
content: {
|
|
721
|
+
"application/json": {
|
|
722
|
+
url: string;
|
|
723
|
+
skill: {
|
|
724
|
+
name: string;
|
|
725
|
+
version: string;
|
|
726
|
+
sha256: string;
|
|
727
|
+
size: number;
|
|
728
|
+
};
|
|
729
|
+
expires_at: string;
|
|
730
|
+
};
|
|
731
|
+
};
|
|
732
|
+
};
|
|
733
|
+
/** @description Redirect to download URL */
|
|
734
|
+
302: {
|
|
735
|
+
headers: {
|
|
736
|
+
[name: string]: unknown;
|
|
737
|
+
};
|
|
738
|
+
content?: never;
|
|
739
|
+
};
|
|
740
|
+
};
|
|
741
|
+
};
|
|
742
|
+
put?: never;
|
|
743
|
+
post?: never;
|
|
744
|
+
delete?: never;
|
|
745
|
+
options?: never;
|
|
746
|
+
head?: never;
|
|
747
|
+
patch?: never;
|
|
748
|
+
trace?: never;
|
|
749
|
+
};
|
|
750
|
+
"/v1/skills/@{scope}/{name}/versions/{version}/download": {
|
|
751
|
+
parameters: {
|
|
752
|
+
query?: never;
|
|
753
|
+
header?: never;
|
|
754
|
+
path?: never;
|
|
755
|
+
cookie?: never;
|
|
756
|
+
};
|
|
757
|
+
/** @description Download a specific version of a skill bundle */
|
|
758
|
+
get: {
|
|
759
|
+
parameters: {
|
|
760
|
+
query?: never;
|
|
761
|
+
header?: never;
|
|
762
|
+
path: {
|
|
763
|
+
scope: string;
|
|
764
|
+
name: string;
|
|
765
|
+
version: string;
|
|
766
|
+
};
|
|
767
|
+
cookie?: never;
|
|
768
|
+
};
|
|
769
|
+
requestBody?: never;
|
|
770
|
+
responses: {
|
|
771
|
+
/** @description Default Response */
|
|
772
|
+
200: {
|
|
773
|
+
headers: {
|
|
774
|
+
[name: string]: unknown;
|
|
775
|
+
};
|
|
776
|
+
content: {
|
|
777
|
+
"application/json": {
|
|
778
|
+
url: string;
|
|
779
|
+
skill: {
|
|
780
|
+
name: string;
|
|
781
|
+
version: string;
|
|
782
|
+
sha256: string;
|
|
783
|
+
size: number;
|
|
784
|
+
};
|
|
785
|
+
expires_at: string;
|
|
786
|
+
};
|
|
787
|
+
};
|
|
788
|
+
};
|
|
789
|
+
/** @description Redirect to download URL */
|
|
790
|
+
302: {
|
|
791
|
+
headers: {
|
|
792
|
+
[name: string]: unknown;
|
|
793
|
+
};
|
|
794
|
+
content?: never;
|
|
795
|
+
};
|
|
796
|
+
};
|
|
797
|
+
};
|
|
798
|
+
put?: never;
|
|
799
|
+
post?: never;
|
|
800
|
+
delete?: never;
|
|
801
|
+
options?: never;
|
|
802
|
+
head?: never;
|
|
803
|
+
patch?: never;
|
|
804
|
+
trace?: never;
|
|
805
|
+
};
|
|
806
|
+
"/v1/skills/announce": {
|
|
807
|
+
parameters: {
|
|
808
|
+
query?: never;
|
|
809
|
+
header?: never;
|
|
810
|
+
path?: never;
|
|
811
|
+
cookie?: never;
|
|
812
|
+
};
|
|
813
|
+
get?: never;
|
|
814
|
+
put?: never;
|
|
815
|
+
/** @description Announce a skill version from a GitHub release (OIDC only). Idempotent - can be called multiple times. */
|
|
816
|
+
post: {
|
|
817
|
+
parameters: {
|
|
818
|
+
query?: never;
|
|
819
|
+
header?: never;
|
|
820
|
+
path?: never;
|
|
821
|
+
cookie?: never;
|
|
822
|
+
};
|
|
823
|
+
requestBody: {
|
|
824
|
+
content: {
|
|
825
|
+
"application/json": {
|
|
826
|
+
name: string;
|
|
827
|
+
version: string;
|
|
828
|
+
skill: {
|
|
829
|
+
name: string;
|
|
830
|
+
description: string;
|
|
831
|
+
license?: string;
|
|
832
|
+
compatibility?: string;
|
|
833
|
+
"allowed-tools"?: string;
|
|
834
|
+
metadata?: {
|
|
835
|
+
tags?: string[];
|
|
836
|
+
/** @enum {string} */
|
|
837
|
+
category?: "development" | "writing" | "research" | "consulting" | "data" | "design" | "operations" | "security" | "other";
|
|
838
|
+
triggers?: string[];
|
|
839
|
+
keywords?: string[];
|
|
840
|
+
surfaces?: ("claude-code" | "claude-api" | "claude-ai")[];
|
|
841
|
+
author?: {
|
|
842
|
+
name: string;
|
|
843
|
+
/** Format: uri */
|
|
844
|
+
url?: string;
|
|
845
|
+
/** Format: email */
|
|
846
|
+
email?: string;
|
|
847
|
+
};
|
|
848
|
+
version?: string;
|
|
849
|
+
examples?: {
|
|
850
|
+
prompt: string;
|
|
851
|
+
context?: string;
|
|
852
|
+
}[];
|
|
853
|
+
} & {
|
|
854
|
+
[key: string]: unknown;
|
|
855
|
+
};
|
|
856
|
+
};
|
|
857
|
+
release_tag: string;
|
|
858
|
+
/** @default false */
|
|
859
|
+
prerelease: boolean;
|
|
860
|
+
artifact: {
|
|
861
|
+
filename: string;
|
|
862
|
+
sha256: string;
|
|
863
|
+
size: number;
|
|
864
|
+
};
|
|
865
|
+
};
|
|
866
|
+
};
|
|
867
|
+
};
|
|
868
|
+
responses: {
|
|
869
|
+
/** @description Default Response */
|
|
870
|
+
200: {
|
|
871
|
+
headers: {
|
|
872
|
+
[name: string]: unknown;
|
|
873
|
+
};
|
|
874
|
+
content: {
|
|
875
|
+
"application/json": {
|
|
876
|
+
skill: string;
|
|
877
|
+
version: string;
|
|
878
|
+
/** @enum {string} */
|
|
879
|
+
status: "created" | "exists";
|
|
880
|
+
};
|
|
881
|
+
};
|
|
882
|
+
};
|
|
883
|
+
};
|
|
884
|
+
};
|
|
885
|
+
delete?: never;
|
|
886
|
+
options?: never;
|
|
887
|
+
head?: never;
|
|
888
|
+
patch?: never;
|
|
889
|
+
trace?: never;
|
|
890
|
+
};
|
|
891
|
+
"/health": {
|
|
892
|
+
parameters: {
|
|
893
|
+
query?: never;
|
|
894
|
+
header?: never;
|
|
895
|
+
path?: never;
|
|
896
|
+
cookie?: never;
|
|
897
|
+
};
|
|
898
|
+
/** @description Health check endpoint */
|
|
899
|
+
get: {
|
|
900
|
+
parameters: {
|
|
901
|
+
query?: never;
|
|
902
|
+
header?: never;
|
|
903
|
+
path?: never;
|
|
904
|
+
cookie?: never;
|
|
905
|
+
};
|
|
906
|
+
requestBody?: never;
|
|
907
|
+
responses: {
|
|
908
|
+
/** @description Default Response */
|
|
909
|
+
200: {
|
|
910
|
+
headers: {
|
|
911
|
+
[name: string]: unknown;
|
|
912
|
+
};
|
|
913
|
+
content: {
|
|
914
|
+
"application/json": {
|
|
915
|
+
status?: string;
|
|
916
|
+
/** Format: date-time */
|
|
917
|
+
timestamp?: string;
|
|
918
|
+
};
|
|
919
|
+
};
|
|
920
|
+
};
|
|
921
|
+
};
|
|
922
|
+
};
|
|
923
|
+
put?: never;
|
|
924
|
+
post?: never;
|
|
925
|
+
delete?: never;
|
|
926
|
+
options?: never;
|
|
927
|
+
head?: never;
|
|
928
|
+
patch?: never;
|
|
929
|
+
trace?: never;
|
|
930
|
+
};
|
|
931
|
+
}
|
|
932
|
+
|
|
933
|
+
/**
|
|
934
|
+
* Type definitions for mpak SDK
|
|
935
|
+
*
|
|
936
|
+
* Types are derived from the OpenAPI schema (generated by openapi-typescript)
|
|
937
|
+
*/
|
|
938
|
+
|
|
939
|
+
/** Extract the JSON response type from a path operation */
|
|
940
|
+
type ResponseOf<T> = T extends {
|
|
941
|
+
responses: {
|
|
942
|
+
200: {
|
|
943
|
+
content: {
|
|
944
|
+
'application/json': infer R;
|
|
945
|
+
};
|
|
946
|
+
};
|
|
947
|
+
};
|
|
948
|
+
} ? R : never;
|
|
949
|
+
/** Extract query parameters from a path operation */
|
|
950
|
+
type QueryOf<T> = T extends {
|
|
951
|
+
parameters: {
|
|
952
|
+
query?: infer Q;
|
|
953
|
+
};
|
|
954
|
+
} ? Q : never;
|
|
955
|
+
/** Response from GET /v1/bundles/search */
|
|
956
|
+
type BundleSearchResponse = ResponseOf<paths['/v1/bundles/search']['get']>;
|
|
957
|
+
/** Response from GET /v1/bundles/@{scope}/{package} */
|
|
958
|
+
type BundleDetailResponse = ResponseOf<paths['/v1/bundles/@{scope}/{package}']['get']>;
|
|
959
|
+
/** Response from GET /v1/bundles/@{scope}/{package}/versions */
|
|
960
|
+
type BundleVersionsResponse = ResponseOf<paths['/v1/bundles/@{scope}/{package}/versions']['get']>;
|
|
961
|
+
/** Response from GET /v1/bundles/@{scope}/{package}/versions/{version} */
|
|
962
|
+
type BundleVersionResponse = ResponseOf<paths['/v1/bundles/@{scope}/{package}/versions/{version}']['get']>;
|
|
963
|
+
/** Response from GET /v1/bundles/@{scope}/{package}/versions/{version}/download */
|
|
964
|
+
type BundleDownloadResponse = ResponseOf<paths['/v1/bundles/@{scope}/{package}/versions/{version}/download']['get']>;
|
|
965
|
+
/** Response from GET /v1/bundles/@{scope}/{package}/index.json */
|
|
966
|
+
type BundleIndexResponse = ResponseOf<paths['/v1/bundles/@{scope}/{package}/index.json']['get']>;
|
|
967
|
+
/** Query parameters for bundle search */
|
|
968
|
+
type BundleSearchParams = QueryOf<paths['/v1/bundles/search']['get']>;
|
|
969
|
+
type Bundle = BundleSearchResponse['bundles'][number];
|
|
970
|
+
type BundleDetail = BundleDetailResponse;
|
|
971
|
+
type BundleVersion = BundleVersionsResponse['versions'][number];
|
|
972
|
+
type BundleArtifact = BundleVersionResponse['artifacts'][number];
|
|
973
|
+
type BundleDownloadInfo = BundleDownloadResponse;
|
|
974
|
+
/** Response from GET /v1/skills/search */
|
|
975
|
+
type SkillSearchResponse = ResponseOf<paths['/v1/skills/search']['get']>;
|
|
976
|
+
/** Response from GET /v1/skills/@{scope}/{name} */
|
|
977
|
+
type SkillDetailResponse = ResponseOf<paths['/v1/skills/@{scope}/{name}']['get']>;
|
|
978
|
+
/** Response from GET /v1/skills/@{scope}/{name}/download */
|
|
979
|
+
type SkillDownloadResponse = ResponseOf<paths['/v1/skills/@{scope}/{name}/download']['get']>;
|
|
980
|
+
/** Query parameters for skill search */
|
|
981
|
+
type SkillSearchParams = QueryOf<paths['/v1/skills/search']['get']>;
|
|
982
|
+
type Skill = SkillSearchResponse['skills'][number];
|
|
983
|
+
type SkillDetail = SkillDetailResponse;
|
|
984
|
+
type SkillDownloadInfo = SkillDownloadResponse;
|
|
985
|
+
type SkillVersion = SkillDetailResponse['versions'][number];
|
|
986
|
+
/** Platform identifier (os + arch) */
|
|
987
|
+
interface Platform {
|
|
988
|
+
os: string;
|
|
989
|
+
arch: string;
|
|
990
|
+
}
|
|
991
|
+
/** Pagination info returned by search endpoints */
|
|
992
|
+
interface Pagination {
|
|
993
|
+
limit: number;
|
|
994
|
+
offset: number;
|
|
995
|
+
has_more: boolean;
|
|
996
|
+
}
|
|
997
|
+
/** Provenance information for verified packages */
|
|
998
|
+
interface Provenance {
|
|
999
|
+
schema_version: string;
|
|
1000
|
+
provider: string;
|
|
1001
|
+
repository: string;
|
|
1002
|
+
sha: string;
|
|
1003
|
+
}
|
|
1004
|
+
/** Author information */
|
|
1005
|
+
interface Author {
|
|
1006
|
+
name: string;
|
|
1007
|
+
url?: string;
|
|
1008
|
+
email?: string;
|
|
1009
|
+
}
|
|
1010
|
+
/**
|
|
1011
|
+
* Configuration options for MpakClient
|
|
1012
|
+
*/
|
|
1013
|
+
interface MpakClientConfig {
|
|
1014
|
+
/**
|
|
1015
|
+
* Base URL for the mpak registry API
|
|
1016
|
+
* @default 'https://api.mpak.dev'
|
|
1017
|
+
*/
|
|
1018
|
+
registryUrl?: string;
|
|
1019
|
+
/**
|
|
1020
|
+
* Request timeout in milliseconds
|
|
1021
|
+
* @default 30000
|
|
1022
|
+
*/
|
|
1023
|
+
timeout?: number;
|
|
1024
|
+
}
|
|
1025
|
+
/**
|
|
1026
|
+
* Base fields shared by all skill reference types
|
|
1027
|
+
*/
|
|
1028
|
+
interface SkillReferenceBase {
|
|
1029
|
+
/** Skill artifact identifier (e.g., '@nimbletools/folk-crm') */
|
|
1030
|
+
name: string;
|
|
1031
|
+
/** Semver version (e.g., '1.0.0') or 'latest' */
|
|
1032
|
+
version: string;
|
|
1033
|
+
/** SHA256 integrity hash (format: 'sha256-hexdigest') */
|
|
1034
|
+
integrity?: string;
|
|
1035
|
+
}
|
|
1036
|
+
/**
|
|
1037
|
+
* Skill reference from mpak registry
|
|
1038
|
+
*/
|
|
1039
|
+
interface MpakSkillReference extends SkillReferenceBase {
|
|
1040
|
+
source: 'mpak';
|
|
1041
|
+
}
|
|
1042
|
+
/**
|
|
1043
|
+
* Skill reference from GitHub repository
|
|
1044
|
+
*/
|
|
1045
|
+
interface GithubSkillReference extends SkillReferenceBase {
|
|
1046
|
+
source: 'github';
|
|
1047
|
+
/** GitHub repository (owner/repo) */
|
|
1048
|
+
repo: string;
|
|
1049
|
+
/** Path to skill file in repo */
|
|
1050
|
+
path: string;
|
|
1051
|
+
}
|
|
1052
|
+
/**
|
|
1053
|
+
* Skill reference from direct URL
|
|
1054
|
+
*/
|
|
1055
|
+
interface UrlSkillReference extends SkillReferenceBase {
|
|
1056
|
+
source: 'url';
|
|
1057
|
+
/** Direct download URL */
|
|
1058
|
+
url: string;
|
|
1059
|
+
}
|
|
1060
|
+
/**
|
|
1061
|
+
* Discriminated union of skill reference types
|
|
1062
|
+
*/
|
|
1063
|
+
type SkillReference = MpakSkillReference | GithubSkillReference | UrlSkillReference;
|
|
1064
|
+
/**
|
|
1065
|
+
* Result of resolving a skill reference
|
|
1066
|
+
*/
|
|
1067
|
+
interface ResolvedSkill {
|
|
1068
|
+
/** The markdown content of the skill */
|
|
1069
|
+
content: string;
|
|
1070
|
+
/** Version that was resolved */
|
|
1071
|
+
version: string;
|
|
1072
|
+
/** Source the skill was fetched from */
|
|
1073
|
+
source: 'mpak' | 'github' | 'url';
|
|
1074
|
+
/** Whether integrity was verified */
|
|
1075
|
+
verified: boolean;
|
|
1076
|
+
}
|
|
1077
|
+
|
|
1078
|
+
/**
|
|
1079
|
+
* Client for interacting with the mpak registry
|
|
1080
|
+
*
|
|
1081
|
+
* Zero runtime dependencies - uses native fetch and crypto only.
|
|
1082
|
+
* Requires Node.js 18+ for native fetch support.
|
|
1083
|
+
*/
|
|
1084
|
+
declare class MpakClient {
|
|
1085
|
+
private readonly registryUrl;
|
|
1086
|
+
private readonly timeout;
|
|
1087
|
+
constructor(config?: MpakClientConfig);
|
|
1088
|
+
/**
|
|
1089
|
+
* Search for bundles
|
|
1090
|
+
*/
|
|
1091
|
+
searchBundles(params?: BundleSearchParams): Promise<BundleSearchResponse>;
|
|
1092
|
+
/**
|
|
1093
|
+
* Get bundle details
|
|
1094
|
+
*/
|
|
1095
|
+
getBundle(name: string): Promise<BundleDetailResponse>;
|
|
1096
|
+
/**
|
|
1097
|
+
* Get all versions of a bundle
|
|
1098
|
+
*/
|
|
1099
|
+
getBundleVersions(name: string): Promise<BundleVersionsResponse>;
|
|
1100
|
+
/**
|
|
1101
|
+
* Get a specific version of a bundle
|
|
1102
|
+
*/
|
|
1103
|
+
getBundleVersion(name: string, version: string): Promise<BundleVersionResponse>;
|
|
1104
|
+
/**
|
|
1105
|
+
* Get download info for a bundle
|
|
1106
|
+
*/
|
|
1107
|
+
getBundleDownload(name: string, version: string, platform?: Platform): Promise<BundleDownloadResponse>;
|
|
1108
|
+
/**
|
|
1109
|
+
* Search for skills
|
|
1110
|
+
*/
|
|
1111
|
+
searchSkills(params?: SkillSearchParams): Promise<SkillSearchResponse>;
|
|
1112
|
+
/**
|
|
1113
|
+
* Get skill details
|
|
1114
|
+
*/
|
|
1115
|
+
getSkill(name: string): Promise<SkillDetailResponse>;
|
|
1116
|
+
/**
|
|
1117
|
+
* Get download info for a skill (latest version)
|
|
1118
|
+
*/
|
|
1119
|
+
getSkillDownload(name: string): Promise<SkillDownloadResponse>;
|
|
1120
|
+
/**
|
|
1121
|
+
* Get download info for a specific skill version
|
|
1122
|
+
*/
|
|
1123
|
+
getSkillVersionDownload(name: string, version: string): Promise<SkillDownloadResponse>;
|
|
1124
|
+
/**
|
|
1125
|
+
* Download skill content and verify integrity
|
|
1126
|
+
*
|
|
1127
|
+
* @throws {MpakIntegrityError} If expectedSha256 is provided and doesn't match (fail-closed)
|
|
1128
|
+
*/
|
|
1129
|
+
downloadSkillContent(downloadUrl: string, expectedSha256?: string): Promise<{
|
|
1130
|
+
content: string;
|
|
1131
|
+
verified: boolean;
|
|
1132
|
+
}>;
|
|
1133
|
+
/**
|
|
1134
|
+
* Resolve a skill reference to actual content
|
|
1135
|
+
*
|
|
1136
|
+
* Supports mpak, github, and url sources. This is the main method for
|
|
1137
|
+
* fetching skill content from any supported source.
|
|
1138
|
+
*
|
|
1139
|
+
* @throws {MpakNotFoundError} If skill not found
|
|
1140
|
+
* @throws {MpakIntegrityError} If integrity check fails (fail-closed)
|
|
1141
|
+
* @throws {MpakNetworkError} For network failures
|
|
1142
|
+
*
|
|
1143
|
+
* @example
|
|
1144
|
+
* ```typescript
|
|
1145
|
+
* // Resolve from mpak registry
|
|
1146
|
+
* const skill = await client.resolveSkillRef({
|
|
1147
|
+
* source: 'mpak',
|
|
1148
|
+
* name: '@nimblebraininc/folk-crm',
|
|
1149
|
+
* version: '1.3.0',
|
|
1150
|
+
* });
|
|
1151
|
+
*
|
|
1152
|
+
* // Resolve from GitHub
|
|
1153
|
+
* const skill = await client.resolveSkillRef({
|
|
1154
|
+
* source: 'github',
|
|
1155
|
+
* name: '@example/my-skill',
|
|
1156
|
+
* version: 'v1.0.0',
|
|
1157
|
+
* repo: 'owner/repo',
|
|
1158
|
+
* path: 'skills/my-skill/SKILL.md',
|
|
1159
|
+
* });
|
|
1160
|
+
*
|
|
1161
|
+
* // Resolve from URL
|
|
1162
|
+
* const skill = await client.resolveSkillRef({
|
|
1163
|
+
* source: 'url',
|
|
1164
|
+
* name: '@example/custom',
|
|
1165
|
+
* version: '1.0.0',
|
|
1166
|
+
* url: 'https://example.com/skill.md',
|
|
1167
|
+
* });
|
|
1168
|
+
* ```
|
|
1169
|
+
*/
|
|
1170
|
+
resolveSkillRef(ref: SkillReference): Promise<ResolvedSkill>;
|
|
1171
|
+
/**
|
|
1172
|
+
* Resolve a skill from mpak registry
|
|
1173
|
+
*
|
|
1174
|
+
* The API returns a ZIP bundle containing SKILL.md and metadata.
|
|
1175
|
+
*/
|
|
1176
|
+
private resolveMpakSkill;
|
|
1177
|
+
/**
|
|
1178
|
+
* Resolve a skill from GitHub releases
|
|
1179
|
+
*/
|
|
1180
|
+
private resolveGithubSkill;
|
|
1181
|
+
/**
|
|
1182
|
+
* Resolve a skill from a direct URL
|
|
1183
|
+
*/
|
|
1184
|
+
private resolveUrlSkill;
|
|
1185
|
+
/**
|
|
1186
|
+
* Extract SKILL.md content from a skill bundle ZIP
|
|
1187
|
+
*/
|
|
1188
|
+
private extractSkillFromZip;
|
|
1189
|
+
/**
|
|
1190
|
+
* Verify content integrity and throw if mismatch (fail-closed)
|
|
1191
|
+
*/
|
|
1192
|
+
private verifyIntegrityOrThrow;
|
|
1193
|
+
/**
|
|
1194
|
+
* Extract hash from integrity string (removes prefix)
|
|
1195
|
+
*/
|
|
1196
|
+
private extractHash;
|
|
1197
|
+
/**
|
|
1198
|
+
* Detect the current platform
|
|
1199
|
+
*/
|
|
1200
|
+
static detectPlatform(): Platform;
|
|
1201
|
+
/**
|
|
1202
|
+
* Compute SHA256 hash of content
|
|
1203
|
+
*/
|
|
1204
|
+
private computeSha256;
|
|
1205
|
+
/**
|
|
1206
|
+
* Validate that a name is scoped (@scope/name)
|
|
1207
|
+
*/
|
|
1208
|
+
private validateScopedName;
|
|
1209
|
+
/**
|
|
1210
|
+
* Fetch with timeout support
|
|
1211
|
+
*/
|
|
1212
|
+
private fetchWithTimeout;
|
|
1213
|
+
}
|
|
1214
|
+
|
|
1215
|
+
/**
|
|
1216
|
+
* Base error class for mpak SDK errors
|
|
1217
|
+
*/
|
|
1218
|
+
declare class MpakError extends Error {
|
|
1219
|
+
code: string;
|
|
1220
|
+
statusCode?: number;
|
|
1221
|
+
constructor(message: string, code: string, statusCode?: number);
|
|
1222
|
+
}
|
|
1223
|
+
/**
|
|
1224
|
+
* Thrown when a requested resource is not found (404)
|
|
1225
|
+
*/
|
|
1226
|
+
declare class MpakNotFoundError extends MpakError {
|
|
1227
|
+
constructor(resource: string);
|
|
1228
|
+
}
|
|
1229
|
+
/**
|
|
1230
|
+
* Thrown when integrity verification fails (hash mismatch)
|
|
1231
|
+
* This is a fail-closed error - content is NOT returned when this is thrown
|
|
1232
|
+
*/
|
|
1233
|
+
declare class MpakIntegrityError extends MpakError {
|
|
1234
|
+
expected: string;
|
|
1235
|
+
actual: string;
|
|
1236
|
+
constructor(expected: string, actual: string);
|
|
1237
|
+
}
|
|
1238
|
+
/**
|
|
1239
|
+
* Thrown for network-related failures (timeouts, connection errors)
|
|
1240
|
+
*/
|
|
1241
|
+
declare class MpakNetworkError extends MpakError {
|
|
1242
|
+
constructor(message: string);
|
|
1243
|
+
}
|
|
1244
|
+
|
|
1245
|
+
export { type Author, type Bundle, type BundleArtifact, type BundleDetail, type BundleDetailResponse, type BundleDownloadInfo, type BundleDownloadResponse, type BundleIndexResponse, type BundleSearchParams, type BundleSearchResponse, type BundleVersion, type BundleVersionResponse, type BundleVersionsResponse, type GithubSkillReference, MpakClient, type MpakClientConfig, MpakError, MpakIntegrityError, MpakNetworkError, MpakNotFoundError, type MpakSkillReference, type Pagination, type Platform, type Provenance, type ResolvedSkill, type Skill, type SkillDetail, type SkillDetailResponse, type SkillDownloadInfo, type SkillDownloadResponse, type SkillReference, type SkillSearchParams, type SkillSearchResponse, type SkillVersion, type UrlSkillReference };
|