@nimblebrain/mpak 0.0.1 → 0.0.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.claude/settings.local.json +3 -1
- package/CLAUDE.md +73 -34
- package/README.md +222 -57
- package/dist/commands/search.d.ts +12 -0
- package/dist/commands/search.d.ts.map +1 -0
- package/dist/commands/search.js +144 -0
- package/dist/commands/search.js.map +1 -0
- package/dist/commands/skills/index.d.ts +8 -0
- package/dist/commands/skills/index.d.ts.map +1 -0
- package/dist/commands/skills/index.js +8 -0
- package/dist/commands/skills/index.js.map +1 -0
- package/dist/commands/skills/install.d.ts +9 -0
- package/dist/commands/skills/install.d.ts.map +1 -0
- package/dist/commands/skills/install.js +110 -0
- package/dist/commands/skills/install.js.map +1 -0
- package/dist/commands/skills/list.d.ts +8 -0
- package/dist/commands/skills/list.d.ts.map +1 -0
- package/dist/commands/skills/list.js +89 -0
- package/dist/commands/skills/list.js.map +1 -0
- package/dist/commands/skills/pack.d.ts +22 -0
- package/dist/commands/skills/pack.d.ts.map +1 -0
- package/dist/commands/skills/pack.js +116 -0
- package/dist/commands/skills/pack.js.map +1 -0
- package/dist/commands/skills/pull.d.ts +9 -0
- package/dist/commands/skills/pull.d.ts.map +1 -0
- package/dist/commands/skills/pull.js +68 -0
- package/dist/commands/skills/pull.js.map +1 -0
- package/dist/commands/skills/search.d.ts +14 -0
- package/dist/commands/skills/search.d.ts.map +1 -0
- package/dist/commands/skills/search.js +53 -0
- package/dist/commands/skills/search.js.map +1 -0
- package/dist/commands/skills/show.d.ts +8 -0
- package/dist/commands/skills/show.d.ts.map +1 -0
- package/dist/commands/skills/show.js +64 -0
- package/dist/commands/skills/show.js.map +1 -0
- package/dist/commands/skills/validate.d.ts +25 -0
- package/dist/commands/skills/validate.d.ts.map +1 -0
- package/dist/commands/skills/validate.js +191 -0
- package/dist/commands/skills/validate.js.map +1 -0
- package/dist/lib/api/skills-client.d.ts +30 -0
- package/dist/lib/api/skills-client.d.ts.map +1 -0
- package/dist/lib/api/skills-client.js +110 -0
- package/dist/lib/api/skills-client.js.map +1 -0
- package/dist/program.d.ts +5 -1
- package/dist/program.d.ts.map +1 -1
- package/dist/program.js +98 -33
- package/dist/program.js.map +1 -1
- package/dist/schemas/generated/api-responses.d.ts +541 -0
- package/dist/schemas/generated/api-responses.d.ts.map +1 -0
- package/dist/schemas/generated/api-responses.js +313 -0
- package/dist/schemas/generated/api-responses.js.map +1 -0
- package/dist/schemas/generated/auth.d.ts +18 -0
- package/dist/schemas/generated/auth.d.ts.map +1 -0
- package/dist/schemas/generated/auth.js +18 -0
- package/dist/schemas/generated/auth.js.map +1 -0
- package/dist/schemas/generated/index.d.ts +5 -0
- package/dist/schemas/generated/index.d.ts.map +1 -0
- package/dist/schemas/generated/index.js +6 -0
- package/dist/schemas/generated/index.js.map +1 -0
- package/dist/schemas/generated/package.d.ts +43 -0
- package/dist/schemas/generated/package.d.ts.map +1 -0
- package/dist/schemas/generated/package.js +20 -0
- package/dist/schemas/generated/package.js.map +1 -0
- package/dist/schemas/generated/skill.d.ts +381 -0
- package/dist/schemas/generated/skill.d.ts.map +1 -0
- package/dist/schemas/generated/skill.js +216 -0
- package/dist/schemas/generated/skill.js.map +1 -0
- package/dist/utils/config-manager.d.ts +13 -1
- package/dist/utils/config-manager.d.ts.map +1 -1
- package/dist/utils/config-manager.js +76 -11
- package/dist/utils/config-manager.js.map +1 -1
- package/package.json +6 -2
- package/src/commands/search.ts +191 -0
- package/src/commands/skills/index.ts +7 -0
- package/src/commands/skills/install.ts +129 -0
- package/src/commands/skills/list.ts +116 -0
- package/src/commands/skills/pack.test.ts +260 -0
- package/src/commands/skills/pack.ts +145 -0
- package/src/commands/skills/pull.ts +88 -0
- package/src/commands/skills/search.ts +73 -0
- package/src/commands/skills/show.ts +72 -0
- package/src/commands/skills/validate.test.ts +466 -0
- package/src/commands/skills/validate.ts +227 -0
- package/src/lib/api/skills-client.ts +148 -0
- package/src/program.test.ts +1 -3
- package/src/program.ts +125 -35
- package/src/schemas/config.v1.schema.json +37 -0
- package/src/schemas/generated/api-responses.ts +386 -0
- package/src/schemas/generated/auth.ts +21 -0
- package/src/schemas/generated/index.ts +5 -0
- package/src/schemas/generated/package.ts +29 -0
- package/src/schemas/generated/skill.ts +271 -0
- package/src/utils/config-manager.test.ts +182 -2
- package/src/utils/config-manager.ts +126 -12
|
@@ -0,0 +1,386 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
|
|
3
|
+
// Author schema
|
|
4
|
+
export const PackageAuthorSchema = z.object({
|
|
5
|
+
name: z.string(),
|
|
6
|
+
});
|
|
7
|
+
|
|
8
|
+
// Tool schema
|
|
9
|
+
export const PackageToolSchema = z.object({
|
|
10
|
+
name: z.string(),
|
|
11
|
+
description: z.string().optional(),
|
|
12
|
+
});
|
|
13
|
+
|
|
14
|
+
// GitHub info schema
|
|
15
|
+
export const PackageGitHubSchema = z.object({
|
|
16
|
+
repo: z.string(),
|
|
17
|
+
stars: z.number().nullable(),
|
|
18
|
+
forks: z.number().nullable(),
|
|
19
|
+
watchers: z.number().nullable(),
|
|
20
|
+
updated_at: z.string().nullable().optional(),
|
|
21
|
+
});
|
|
22
|
+
|
|
23
|
+
// Package list item schema (what comes back from search/list endpoints)
|
|
24
|
+
export const PackageSchema = z.object({
|
|
25
|
+
name: z.string(), // Full name: 'react' or '@meta/react'
|
|
26
|
+
display_name: z.string().nullable(),
|
|
27
|
+
description: z.string().nullable(),
|
|
28
|
+
author: PackageAuthorSchema.nullable(),
|
|
29
|
+
latest_version: z.string(),
|
|
30
|
+
icon: z.string().nullable(),
|
|
31
|
+
server_type: z.string(),
|
|
32
|
+
tools: z.array(PackageToolSchema),
|
|
33
|
+
downloads: z.number(),
|
|
34
|
+
published_at: z.union([z.string(), z.date()]),
|
|
35
|
+
verified: z.boolean(),
|
|
36
|
+
claimable: z.boolean().optional(),
|
|
37
|
+
claimed: z.boolean().optional(),
|
|
38
|
+
github: PackageGitHubSchema.nullable().optional(),
|
|
39
|
+
});
|
|
40
|
+
|
|
41
|
+
// Artifact schema (platform-specific bundles)
|
|
42
|
+
export const ArtifactSchema = z.object({
|
|
43
|
+
os: z.string(), // darwin, win32, linux, any
|
|
44
|
+
arch: z.string(), // x64, arm64, any
|
|
45
|
+
size_bytes: z.number(),
|
|
46
|
+
digest: z.string(), // sha256:xxxx format
|
|
47
|
+
downloads: z.number(),
|
|
48
|
+
});
|
|
49
|
+
|
|
50
|
+
// Provenance schema (build/publish attestation)
|
|
51
|
+
export const ProvenanceSchema = z.object({
|
|
52
|
+
publish_method: z.string().nullable(), // 'oidc' | 'upload' | 'cli'
|
|
53
|
+
repository: z.string().nullable(), // GitHub repo (owner/repo)
|
|
54
|
+
sha: z.string().nullable(), // Git commit SHA
|
|
55
|
+
});
|
|
56
|
+
|
|
57
|
+
// Package version schema
|
|
58
|
+
export const PackageVersionSchema = z.object({
|
|
59
|
+
version: z.string(),
|
|
60
|
+
published_at: z.union([z.string(), z.date()]),
|
|
61
|
+
downloads: z.number(),
|
|
62
|
+
artifacts: z.array(ArtifactSchema).optional(),
|
|
63
|
+
readme: z.string().nullable().optional(),
|
|
64
|
+
provenance: ProvenanceSchema.nullable().optional(),
|
|
65
|
+
release_url: z.string().nullable().optional(),
|
|
66
|
+
prerelease: z.boolean().optional(),
|
|
67
|
+
manifest: z.record(z.string(), z.unknown()).nullable().optional(),
|
|
68
|
+
});
|
|
69
|
+
|
|
70
|
+
// Claiming info schema
|
|
71
|
+
export const PackageClaimingSchema = z.object({
|
|
72
|
+
claimable: z.boolean(),
|
|
73
|
+
claimed: z.boolean(),
|
|
74
|
+
claimed_by: z.string().nullable(),
|
|
75
|
+
claimed_at: z.union([z.string(), z.date()]).nullable(),
|
|
76
|
+
github_repo: z.string().nullable(),
|
|
77
|
+
});
|
|
78
|
+
|
|
79
|
+
// Package detail schema (what comes back from package detail endpoint)
|
|
80
|
+
export const PackageDetailSchema = PackageSchema.extend({
|
|
81
|
+
homepage: z.string().nullable(),
|
|
82
|
+
license: z.string().nullable(),
|
|
83
|
+
claiming: PackageClaimingSchema,
|
|
84
|
+
versions: z.array(PackageVersionSchema),
|
|
85
|
+
});
|
|
86
|
+
|
|
87
|
+
// Package search response schema
|
|
88
|
+
export const PackageSearchResponseSchema = z.object({
|
|
89
|
+
packages: z.array(PackageSchema),
|
|
90
|
+
total: z.number(),
|
|
91
|
+
});
|
|
92
|
+
|
|
93
|
+
// =============================================================================
|
|
94
|
+
// V1 Bundle API Schemas
|
|
95
|
+
// =============================================================================
|
|
96
|
+
|
|
97
|
+
// Platform info schema (os + arch combo)
|
|
98
|
+
export const PlatformInfoSchema = z.object({
|
|
99
|
+
os: z.string(), // darwin, win32, linux, any
|
|
100
|
+
arch: z.string(), // x64, arm64, any
|
|
101
|
+
});
|
|
102
|
+
|
|
103
|
+
// Full provenance schema (returned by v1 API)
|
|
104
|
+
export const FullProvenanceSchema = z.object({
|
|
105
|
+
schema_version: z.string(),
|
|
106
|
+
provider: z.string(),
|
|
107
|
+
repository: z.string(),
|
|
108
|
+
sha: z.string(),
|
|
109
|
+
});
|
|
110
|
+
|
|
111
|
+
// Bundle schema (v1 API - similar to Package but with provenance)
|
|
112
|
+
export const BundleSchema = z.object({
|
|
113
|
+
name: z.string(),
|
|
114
|
+
display_name: z.string().nullable().optional(),
|
|
115
|
+
description: z.string().nullable().optional(),
|
|
116
|
+
author: PackageAuthorSchema.nullable().optional(),
|
|
117
|
+
latest_version: z.string(),
|
|
118
|
+
icon: z.string().nullable().optional(),
|
|
119
|
+
server_type: z.string().nullable().optional(),
|
|
120
|
+
tools: z.array(PackageToolSchema).optional(),
|
|
121
|
+
downloads: z.number(),
|
|
122
|
+
published_at: z.union([z.string(), z.date()]),
|
|
123
|
+
verified: z.boolean(),
|
|
124
|
+
provenance: FullProvenanceSchema.nullable().optional(),
|
|
125
|
+
});
|
|
126
|
+
|
|
127
|
+
// Bundle detail schema (v1 API)
|
|
128
|
+
export const BundleDetailSchema = BundleSchema.extend({
|
|
129
|
+
homepage: z.string().nullable().optional(),
|
|
130
|
+
license: z.string().nullable().optional(),
|
|
131
|
+
versions: z.array(z.object({
|
|
132
|
+
version: z.string(),
|
|
133
|
+
published_at: z.union([z.string(), z.date()]),
|
|
134
|
+
downloads: z.number(),
|
|
135
|
+
})),
|
|
136
|
+
});
|
|
137
|
+
|
|
138
|
+
// Bundle search response schema (v1 API)
|
|
139
|
+
export const BundleSearchResponseSchema = z.object({
|
|
140
|
+
bundles: z.array(BundleSchema),
|
|
141
|
+
total: z.number(),
|
|
142
|
+
pagination: z.object({
|
|
143
|
+
limit: z.number(),
|
|
144
|
+
offset: z.number(),
|
|
145
|
+
has_more: z.boolean(),
|
|
146
|
+
}),
|
|
147
|
+
});
|
|
148
|
+
|
|
149
|
+
// Version info with platforms (from /v1/bundles/@scope/pkg/versions)
|
|
150
|
+
export const VersionInfoSchema = z.object({
|
|
151
|
+
version: z.string(),
|
|
152
|
+
artifacts_count: z.number(),
|
|
153
|
+
platforms: z.array(PlatformInfoSchema),
|
|
154
|
+
published_at: z.union([z.string(), z.date()]),
|
|
155
|
+
downloads: z.number(),
|
|
156
|
+
publish_method: z.string().nullable(),
|
|
157
|
+
provenance: FullProvenanceSchema.nullable().optional(),
|
|
158
|
+
});
|
|
159
|
+
|
|
160
|
+
// Versions response schema (v1 API)
|
|
161
|
+
export const VersionsResponseSchema = z.object({
|
|
162
|
+
name: z.string(),
|
|
163
|
+
latest: z.string(),
|
|
164
|
+
versions: z.array(VersionInfoSchema),
|
|
165
|
+
});
|
|
166
|
+
|
|
167
|
+
// Download info schema (v1 API)
|
|
168
|
+
export const DownloadInfoSchema = z.object({
|
|
169
|
+
url: z.string(),
|
|
170
|
+
bundle: z.object({
|
|
171
|
+
name: z.string(),
|
|
172
|
+
version: z.string(),
|
|
173
|
+
platform: PlatformInfoSchema,
|
|
174
|
+
sha256: z.string(),
|
|
175
|
+
size: z.number(),
|
|
176
|
+
}),
|
|
177
|
+
expires_at: z.string().optional(),
|
|
178
|
+
});
|
|
179
|
+
|
|
180
|
+
// =============================================================================
|
|
181
|
+
// Internal API Schemas (used by web UI, not exposed publicly)
|
|
182
|
+
// =============================================================================
|
|
183
|
+
|
|
184
|
+
// Pagination schema (reusable)
|
|
185
|
+
export const PaginationSchema = z.object({
|
|
186
|
+
limit: z.number(),
|
|
187
|
+
offset: z.number(),
|
|
188
|
+
has_more: z.boolean(),
|
|
189
|
+
});
|
|
190
|
+
|
|
191
|
+
// Publish response schema
|
|
192
|
+
export const PublishResponseSchema = z.object({
|
|
193
|
+
success: z.boolean(),
|
|
194
|
+
package: z.object({
|
|
195
|
+
name: z.string(),
|
|
196
|
+
version: z.string(),
|
|
197
|
+
manifest: z.record(z.string(), z.unknown()),
|
|
198
|
+
}),
|
|
199
|
+
sha256: z.string(),
|
|
200
|
+
size: z.number(),
|
|
201
|
+
url: z.string(),
|
|
202
|
+
auto_claimed: z.boolean().optional(),
|
|
203
|
+
message: z.string().optional(),
|
|
204
|
+
});
|
|
205
|
+
|
|
206
|
+
// Internal download response schema (different from v1 API)
|
|
207
|
+
export const InternalDownloadResponseSchema = z.object({
|
|
208
|
+
url: z.string(),
|
|
209
|
+
package: z.object({
|
|
210
|
+
name: z.string(),
|
|
211
|
+
version: z.string(),
|
|
212
|
+
sha256: z.string(),
|
|
213
|
+
size: z.number(),
|
|
214
|
+
}),
|
|
215
|
+
expires_at: z.string(),
|
|
216
|
+
});
|
|
217
|
+
|
|
218
|
+
// Claim status response schema
|
|
219
|
+
export const ClaimStatusResponseSchema = z.object({
|
|
220
|
+
claimable: z.boolean(),
|
|
221
|
+
reason: z.string().optional(),
|
|
222
|
+
claimed_by: z.string().nullable().optional(),
|
|
223
|
+
claimed_at: z.union([z.string(), z.date()]).nullable().optional(),
|
|
224
|
+
package_name: z.string().optional(),
|
|
225
|
+
github_repo: z.string().nullable().optional(),
|
|
226
|
+
instructions: z.object({
|
|
227
|
+
steps: z.array(z.string()),
|
|
228
|
+
mpak_json_example: z.string(),
|
|
229
|
+
verification_url: z.string().nullable(),
|
|
230
|
+
}).optional(),
|
|
231
|
+
});
|
|
232
|
+
|
|
233
|
+
// Claim response schema
|
|
234
|
+
export const ClaimResponseSchema = z.object({
|
|
235
|
+
success: z.boolean(),
|
|
236
|
+
message: z.string(),
|
|
237
|
+
package: z.object({
|
|
238
|
+
name: z.string(),
|
|
239
|
+
claimed_by: z.string().nullable(),
|
|
240
|
+
claimed_at: z.union([z.string(), z.date()]).nullable(),
|
|
241
|
+
github_repo: z.string().nullable(),
|
|
242
|
+
}),
|
|
243
|
+
verification: z.object({
|
|
244
|
+
mpak_json_url: z.string().nullable().optional(),
|
|
245
|
+
verified_at: z.string(),
|
|
246
|
+
}),
|
|
247
|
+
});
|
|
248
|
+
|
|
249
|
+
// My packages response schema
|
|
250
|
+
export const MyPackagesResponseSchema = z.object({
|
|
251
|
+
packages: z.array(PackageSchema),
|
|
252
|
+
total: z.number(),
|
|
253
|
+
pagination: PaginationSchema,
|
|
254
|
+
});
|
|
255
|
+
|
|
256
|
+
// Unclaimed package schema
|
|
257
|
+
export const UnclaimedPackageSchema = z.object({
|
|
258
|
+
name: z.string(),
|
|
259
|
+
display_name: z.string().nullable(),
|
|
260
|
+
description: z.string().nullable(),
|
|
261
|
+
server_type: z.string().nullable(),
|
|
262
|
+
latest_version: z.string(),
|
|
263
|
+
downloads: z.number(),
|
|
264
|
+
github_repo: z.string().nullable(),
|
|
265
|
+
created_at: z.union([z.string(), z.date()]),
|
|
266
|
+
});
|
|
267
|
+
|
|
268
|
+
// Unclaimed packages response schema
|
|
269
|
+
export const UnclaimedPackagesResponseSchema = z.object({
|
|
270
|
+
packages: z.array(UnclaimedPackageSchema),
|
|
271
|
+
total: z.number(),
|
|
272
|
+
pagination: PaginationSchema,
|
|
273
|
+
});
|
|
274
|
+
|
|
275
|
+
|
|
276
|
+
// =============================================================================
|
|
277
|
+
// V1 API Additional Schemas
|
|
278
|
+
// =============================================================================
|
|
279
|
+
|
|
280
|
+
// Version detail response schema (specific version with artifacts)
|
|
281
|
+
export const VersionDetailSchema = z.object({
|
|
282
|
+
name: z.string(),
|
|
283
|
+
version: z.string(),
|
|
284
|
+
published_at: z.union([z.string(), z.date()]),
|
|
285
|
+
downloads: z.number(),
|
|
286
|
+
artifacts: z.array(z.object({
|
|
287
|
+
platform: PlatformInfoSchema,
|
|
288
|
+
digest: z.string(),
|
|
289
|
+
size: z.number(),
|
|
290
|
+
download_url: z.string(),
|
|
291
|
+
source_url: z.string().optional(),
|
|
292
|
+
})),
|
|
293
|
+
manifest: z.record(z.string(), z.unknown()),
|
|
294
|
+
release: z.object({
|
|
295
|
+
tag: z.string().nullable(),
|
|
296
|
+
url: z.string().nullable(),
|
|
297
|
+
}).optional(),
|
|
298
|
+
publish_method: z.string().nullable(),
|
|
299
|
+
provenance: FullProvenanceSchema.nullable(),
|
|
300
|
+
});
|
|
301
|
+
|
|
302
|
+
// MCPB Index response schema
|
|
303
|
+
export const MCPBIndexSchema = z.object({
|
|
304
|
+
index_version: z.string(),
|
|
305
|
+
mimeType: z.string(),
|
|
306
|
+
name: z.string(),
|
|
307
|
+
version: z.string(),
|
|
308
|
+
description: z.string().nullable(),
|
|
309
|
+
bundles: z.array(z.object({
|
|
310
|
+
mimeType: z.string().nullable(),
|
|
311
|
+
digest: z.string(),
|
|
312
|
+
size: z.number(),
|
|
313
|
+
platform: PlatformInfoSchema,
|
|
314
|
+
urls: z.array(z.string()),
|
|
315
|
+
})),
|
|
316
|
+
annotations: z.record(z.string(), z.string()).optional(),
|
|
317
|
+
});
|
|
318
|
+
|
|
319
|
+
// Announce request schema (per-artifact announcement from GitHub Actions)
|
|
320
|
+
export const AnnounceRequestSchema = z.object({
|
|
321
|
+
name: z.string(),
|
|
322
|
+
version: z.string(),
|
|
323
|
+
manifest: z.record(z.string(), z.unknown()),
|
|
324
|
+
release_tag: z.string(),
|
|
325
|
+
prerelease: z.boolean().optional().default(false),
|
|
326
|
+
artifact: z.object({
|
|
327
|
+
filename: z.string(),
|
|
328
|
+
os: z.string(),
|
|
329
|
+
arch: z.string(),
|
|
330
|
+
sha256: z.string(),
|
|
331
|
+
size: z.number(),
|
|
332
|
+
}),
|
|
333
|
+
});
|
|
334
|
+
|
|
335
|
+
// Announce response schema (per-artifact, idempotent)
|
|
336
|
+
export const AnnounceResponseSchema = z.object({
|
|
337
|
+
package: z.string(),
|
|
338
|
+
version: z.string(),
|
|
339
|
+
artifact: z.object({
|
|
340
|
+
os: z.string(),
|
|
341
|
+
arch: z.string(),
|
|
342
|
+
filename: z.string(),
|
|
343
|
+
}),
|
|
344
|
+
total_artifacts: z.number(),
|
|
345
|
+
status: z.enum(['created', 'updated']),
|
|
346
|
+
});
|
|
347
|
+
|
|
348
|
+
// =============================================================================
|
|
349
|
+
// Export TypeScript types
|
|
350
|
+
// =============================================================================
|
|
351
|
+
|
|
352
|
+
// Core types
|
|
353
|
+
export type PackageAuthor = z.infer<typeof PackageAuthorSchema>;
|
|
354
|
+
export type PackageTool = z.infer<typeof PackageToolSchema>;
|
|
355
|
+
export type PackageGitHub = z.infer<typeof PackageGitHubSchema>;
|
|
356
|
+
export type Package = z.infer<typeof PackageSchema>;
|
|
357
|
+
export type Artifact = z.infer<typeof ArtifactSchema>;
|
|
358
|
+
export type Provenance = z.infer<typeof ProvenanceSchema>;
|
|
359
|
+
export type PackageVersion = z.infer<typeof PackageVersionSchema>;
|
|
360
|
+
export type PackageClaiming = z.infer<typeof PackageClaimingSchema>;
|
|
361
|
+
export type PackageDetail = z.infer<typeof PackageDetailSchema>;
|
|
362
|
+
export type PackageSearchResponse = z.infer<typeof PackageSearchResponseSchema>;
|
|
363
|
+
|
|
364
|
+
// V1 API types
|
|
365
|
+
export type PlatformInfo = z.infer<typeof PlatformInfoSchema>;
|
|
366
|
+
export type FullProvenance = z.infer<typeof FullProvenanceSchema>;
|
|
367
|
+
export type Bundle = z.infer<typeof BundleSchema>;
|
|
368
|
+
export type BundleDetail = z.infer<typeof BundleDetailSchema>;
|
|
369
|
+
export type BundleSearchResponse = z.infer<typeof BundleSearchResponseSchema>;
|
|
370
|
+
export type VersionInfo = z.infer<typeof VersionInfoSchema>;
|
|
371
|
+
export type VersionsResponse = z.infer<typeof VersionsResponseSchema>;
|
|
372
|
+
export type DownloadInfo = z.infer<typeof DownloadInfoSchema>;
|
|
373
|
+
export type VersionDetail = z.infer<typeof VersionDetailSchema>;
|
|
374
|
+
export type MCPBIndex = z.infer<typeof MCPBIndexSchema>;
|
|
375
|
+
export type AnnounceRequest = z.infer<typeof AnnounceRequestSchema>;
|
|
376
|
+
export type AnnounceResponse = z.infer<typeof AnnounceResponseSchema>;
|
|
377
|
+
|
|
378
|
+
// Internal API types
|
|
379
|
+
export type Pagination = z.infer<typeof PaginationSchema>;
|
|
380
|
+
export type PublishResponse = z.infer<typeof PublishResponseSchema>;
|
|
381
|
+
export type InternalDownloadResponse = z.infer<typeof InternalDownloadResponseSchema>;
|
|
382
|
+
export type ClaimStatusResponse = z.infer<typeof ClaimStatusResponseSchema>;
|
|
383
|
+
export type ClaimResponse = z.infer<typeof ClaimResponseSchema>;
|
|
384
|
+
export type MyPackagesResponse = z.infer<typeof MyPackagesResponseSchema>;
|
|
385
|
+
export type UnclaimedPackage = z.infer<typeof UnclaimedPackageSchema>;
|
|
386
|
+
export type UnclaimedPackagesResponse = z.infer<typeof UnclaimedPackagesResponseSchema>;
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
|
|
3
|
+
// User profile response from /internal/auth/me
|
|
4
|
+
export const UserProfileSchema = z.object({
|
|
5
|
+
id: z.string(),
|
|
6
|
+
email: z.string().email(),
|
|
7
|
+
emailVerified: z.boolean(),
|
|
8
|
+
username: z.string().nullable(),
|
|
9
|
+
name: z.string().nullable(),
|
|
10
|
+
avatarUrl: z.string().nullable(),
|
|
11
|
+
githubUsername: z.string().nullable(),
|
|
12
|
+
githubLinked: z.boolean(),
|
|
13
|
+
verified: z.boolean(),
|
|
14
|
+
publishedBundles: z.number(),
|
|
15
|
+
totalDownloads: z.number(),
|
|
16
|
+
createdAt: z.union([z.string(), z.date()]).nullable(),
|
|
17
|
+
lastLoginAt: z.union([z.string(), z.date()]).nullable(),
|
|
18
|
+
});
|
|
19
|
+
|
|
20
|
+
// Export TypeScript type
|
|
21
|
+
export type UserProfile = z.infer<typeof UserProfileSchema>;
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
|
|
3
|
+
// Server type enum
|
|
4
|
+
export const ServerTypeSchema = z.enum(['node', 'python', 'binary']);
|
|
5
|
+
|
|
6
|
+
// Platform enum
|
|
7
|
+
export const PlatformSchema = z.enum(['darwin', 'win32', 'linux']);
|
|
8
|
+
|
|
9
|
+
// Sort options
|
|
10
|
+
export const PackageSortSchema = z.enum(['downloads', 'recent', 'name']);
|
|
11
|
+
|
|
12
|
+
// Package search params schema
|
|
13
|
+
// Query params from HTTP are always strings, but we parse them to proper types
|
|
14
|
+
export const PackageSearchParamsSchema = z.object({
|
|
15
|
+
q: z.string().optional(),
|
|
16
|
+
type: ServerTypeSchema.optional(),
|
|
17
|
+
tool: z.string().optional(),
|
|
18
|
+
prompt: z.string().optional(),
|
|
19
|
+
platform: PlatformSchema.optional(),
|
|
20
|
+
sort: PackageSortSchema.optional(),
|
|
21
|
+
limit: z.union([z.string(), z.number()]).optional(),
|
|
22
|
+
offset: z.union([z.string(), z.number()]).optional(),
|
|
23
|
+
});
|
|
24
|
+
|
|
25
|
+
// Export TypeScript types
|
|
26
|
+
export type ServerType = z.infer<typeof ServerTypeSchema>;
|
|
27
|
+
export type Platform = z.infer<typeof PlatformSchema>;
|
|
28
|
+
export type PackageSort = z.infer<typeof PackageSortSchema>;
|
|
29
|
+
export type PackageSearchParams = z.infer<typeof PackageSearchParamsSchema>;
|