Skip to content
This repository was archived by the owner on Apr 18, 2026. It is now read-only.

Commit 4da6398

Browse files
committed
Regenerate API types and add CI workflow
- Regenerate schema.d.ts from updated server OpenAPI spec - Fix show.ts for removed github field and published_at type change - Add GitHub Actions CI workflow (build, typecheck, all tests) - Add shields.io badges to README (CI, license, npm, node, TypeScript, Discord)
1 parent b1b3316 commit 4da6398

4 files changed

Lines changed: 79 additions & 83 deletions

File tree

.github/workflows/ci.yml

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
name: CI
2+
3+
on:
4+
push:
5+
branches: [main]
6+
pull_request:
7+
branches: [main]
8+
9+
jobs:
10+
test:
11+
runs-on: ubuntu-latest
12+
13+
steps:
14+
- uses: actions/checkout@v4
15+
16+
- uses: actions/setup-node@v4
17+
with:
18+
node-version: '20'
19+
cache: 'npm'
20+
21+
- run: npm ci
22+
23+
- run: npm run build
24+
25+
- run: npm run typecheck
26+
27+
- run: npm run test:all

README.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,12 @@
11
# mpak CLI
22

3+
[![CI](https://github.com/NimbleBrainInc/mpak-cli/actions/workflows/ci.yml/badge.svg)](https://github.com/NimbleBrainInc/mpak-cli/actions/workflows/ci.yml)
4+
[![License](https://img.shields.io/badge/License-Apache_2.0-blue.svg)](https://opensource.org/licenses/Apache-2.0)
5+
[![npm](https://img.shields.io/npm/v/@nimblebrain/mpak)](https://www.npmjs.com/package/@nimblebrain/mpak)
6+
[![node](https://img.shields.io/node/v/@nimblebrain/mpak)](https://nodejs.org)
7+
[![TypeScript](https://img.shields.io/badge/TypeScript-5.x-blue?logo=typescript&logoColor=white)](https://www.typescriptlang.org/)
8+
[![Discord](https://img.shields.io/badge/Discord-%235865F2.svg?logo=discord&logoColor=white)](https://www.nimblebrain.ai/discord?utm_source=github&utm_medium=readme&utm_campaign=mpak-cli&utm_content=discord-badge)
9+
310
CLI for discovering and downloading MCPB bundles from the mpak registry.
411

512
## Installation

src/commands/packages/show.ts

Lines changed: 2 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -65,19 +65,9 @@ export async function handleShow(
6565
// Stats
6666
console.log('Statistics:');
6767
console.log(` Downloads: ${bundle.downloads.toLocaleString()}`);
68-
console.log(` Published: ${new Date(bundle.published_at).toLocaleDateString()}`);
68+
console.log(` Published: ${new Date(bundle.published_at as string).toLocaleDateString()}`);
6969
console.log();
7070

71-
// GitHub info
72-
if (bundle.github) {
73-
console.log('GitHub:');
74-
console.log(` Repository: ${bundle.github.repo}`);
75-
if (bundle.github.stars != null) console.log(` Stars: ${bundle.github.stars}`);
76-
if (bundle.github.forks != null) console.log(` Forks: ${bundle.github.forks}`);
77-
if (bundle.github.watchers != null) console.log(` Watchers: ${bundle.github.watchers}`);
78-
console.log();
79-
}
80-
8171
// Tools
8272
if (bundle.tools && bundle.tools.length > 0) {
8373
console.log(`Tools (${bundle.tools.length}):`);
@@ -95,7 +85,7 @@ export async function handleShow(
9585
console.log(`Versions (${versionsInfo.versions.length}):`);
9686
const recentVersions = versionsInfo.versions.slice(0, 5);
9787
for (const version of recentVersions) {
98-
const date = new Date(version.published_at).toLocaleDateString();
88+
const date = new Date(version.published_at as string).toLocaleDateString();
9989
const downloads = version.downloads.toLocaleString();
10090
const isLatest = version.version === versionsInfo.latest ? ' (latest)' : '';
10191
const provTag = version.provenance ? ' 🔒' : '';

src/lib/api/schema.d.ts

Lines changed: 43 additions & 71 deletions
Original file line numberDiff line numberDiff line change
@@ -51,8 +51,7 @@ export interface paths {
5151
description?: string;
5252
}[];
5353
downloads: number;
54-
/** Format: date-time */
55-
published_at: string;
54+
published_at: string | unknown;
5655
verified: boolean;
5756
provenance?: {
5857
schema_version: string;
@@ -121,27 +120,19 @@ export interface paths {
121120
description?: string;
122121
}[];
123122
downloads: number;
124-
/** Format: date-time */
125-
published_at: string;
123+
published_at: string | unknown;
126124
verified: boolean;
127-
homepage?: string | null;
128-
license?: string | null;
129-
github?: {
130-
repo: string;
131-
stars?: number | null;
132-
forks?: number | null;
133-
watchers?: number | null;
134-
} | null;
135125
provenance?: {
136126
schema_version: string;
137127
provider: string;
138128
repository: string;
139129
sha: string;
140130
} | null;
131+
homepage?: string | null;
132+
license?: string | null;
141133
versions: {
142134
version: string;
143-
/** Format: date-time */
144-
published_at: string;
135+
published_at: string | unknown;
145136
downloads: number;
146137
}[];
147138
};
@@ -188,15 +179,13 @@ export interface paths {
188179
mimeType: string;
189180
name: string;
190181
version: string;
191-
description?: string | null;
182+
description: string | null;
192183
bundles: {
193-
mimeType: string;
184+
mimeType: string | null;
194185
digest: string;
195186
size: number;
196187
platform: {
197-
/** @description Operating system (darwin, linux, win32, any) */
198188
os: string;
199-
/** @description Architecture (x64, arm64, any) */
200189
arch: string;
201190
};
202191
urls: string[];
@@ -250,15 +239,12 @@ export interface paths {
250239
version: string;
251240
artifacts_count: number;
252241
platforms: {
253-
/** @description Operating system (darwin, linux, win32, any) */
254242
os: string;
255-
/** @description Architecture (x64, arm64, any) */
256243
arch: string;
257244
}[];
258-
/** Format: date-time */
259-
published_at: string;
245+
published_at: string | unknown;
260246
downloads: number;
261-
publish_method?: string | null;
247+
publish_method: string | null;
262248
provenance?: {
263249
schema_version: string;
264250
provider: string;
@@ -309,31 +295,31 @@ export interface paths {
309295
"application/json": {
310296
name: string;
311297
version: string;
312-
/** Format: date-time */
313-
published_at: string;
298+
published_at: string | unknown;
314299
downloads: number;
315300
artifacts: {
316301
platform: {
317-
/** @description Operating system (darwin, linux, win32, any) */
318302
os: string;
319-
/** @description Architecture (x64, arm64, any) */
320303
arch: string;
321304
};
322305
digest: string;
323306
size: number;
324307
download_url: string;
325308
source_url?: string;
326309
}[];
327-
manifest?: {
310+
manifest: {
328311
[key: string]: unknown;
329312
};
330313
release?: {
331-
tag?: string;
332-
url?: string;
333-
} | null;
334-
publish_method?: string | null;
335-
provenance?: {
336-
[key: string]: unknown;
314+
tag: string | null;
315+
url: string | null;
316+
};
317+
publish_method: string | null;
318+
provenance: {
319+
schema_version: string;
320+
provider: string;
321+
repository: string;
322+
sha: string;
337323
} | null;
338324
};
339325
};
@@ -386,16 +372,13 @@ export interface paths {
386372
name: string;
387373
version: string;
388374
platform: {
389-
/** @description Operating system (darwin, linux, win32, any) */
390375
os: string;
391-
/** @description Architecture (x64, arm64, any) */
392376
arch: string;
393377
};
394378
sha256: string;
395379
size: number;
396380
};
397-
/** Format: date-time */
398-
expires_at: string;
381+
expires_at?: string;
399382
};
400383
};
401384
};
@@ -425,7 +408,7 @@ export interface paths {
425408
};
426409
get?: never;
427410
put?: never;
428-
/** @description Announce a new bundle version from a GitHub release (OIDC only) */
411+
/** @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. */
429412
post: {
430413
parameters: {
431414
query?: never;
@@ -436,14 +419,21 @@ export interface paths {
436419
requestBody: {
437420
content: {
438421
"application/json": {
439-
/** @description Package name (@scope/name) */
440422
name: string;
441-
/** @description Semantic version */
442423
version: string;
443-
/** @description Bundle manifest */
444-
manifest: Record<string, never>;
445-
/** @description GitHub release tag (e.g., v0.1.0) */
424+
manifest: {
425+
[key: string]: unknown;
426+
};
446427
release_tag: string;
428+
/** @default false */
429+
prerelease: boolean;
430+
artifact: {
431+
filename: string;
432+
os: string;
433+
arch: string;
434+
sha256: string;
435+
size: number;
436+
};
447437
};
448438
};
449439
};
@@ -455,34 +445,16 @@ export interface paths {
455445
};
456446
content: {
457447
"application/json": {
458-
success: boolean;
459-
bundle: {
460-
name: string;
461-
version: string;
462-
artifacts_count: number;
463-
};
464-
release: {
465-
tag: string;
466-
url: string;
448+
package: string;
449+
version: string;
450+
artifact: {
451+
os: string;
452+
arch: string;
453+
filename: string;
467454
};
468-
artifacts: {
469-
platform: {
470-
/** @description Operating system (darwin, linux, win32, any) */
471-
os: string;
472-
/** @description Architecture (x64, arm64, any) */
473-
arch: string;
474-
};
475-
digest: string;
476-
size: number;
477-
url: string;
478-
source_url: string;
479-
}[];
480-
provenance: {
481-
schema_version: string;
482-
provider: string;
483-
repository: string;
484-
sha: string;
485-
} | null;
455+
total_artifacts: number;
456+
/** @enum {string} */
457+
status: "created" | "updated";
486458
};
487459
};
488460
};

0 commit comments

Comments
 (0)