@nimblebrain/mpak 0.0.1-beta.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/.env.example +13 -0
- package/CLAUDE.md +117 -0
- package/LICENSE +201 -0
- package/README.md +206 -0
- package/dist/commands/packages/pull.d.ts +11 -0
- package/dist/commands/packages/pull.d.ts.map +1 -0
- package/dist/commands/packages/pull.js +72 -0
- package/dist/commands/packages/pull.js.map +1 -0
- package/dist/commands/packages/search.d.ts +12 -0
- package/dist/commands/packages/search.d.ts.map +1 -0
- package/dist/commands/packages/search.js +63 -0
- package/dist/commands/packages/search.js.map +1 -0
- package/dist/commands/packages/show.d.ts +8 -0
- package/dist/commands/packages/show.d.ts.map +1 -0
- package/dist/commands/packages/show.js +121 -0
- package/dist/commands/packages/show.js.map +1 -0
- package/dist/index.d.ts +3 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +12 -0
- package/dist/index.js.map +1 -0
- package/dist/lib/api/registry-client.d.ts +63 -0
- package/dist/lib/api/registry-client.d.ts.map +1 -0
- package/dist/lib/api/registry-client.js +167 -0
- package/dist/lib/api/registry-client.js.map +1 -0
- package/dist/program.d.ts +8 -0
- package/dist/program.d.ts.map +1 -0
- package/dist/program.js +69 -0
- package/dist/program.js.map +1 -0
- package/dist/utils/config-manager.d.ts +23 -0
- package/dist/utils/config-manager.d.ts.map +1 -0
- package/dist/utils/config-manager.js +65 -0
- package/dist/utils/config-manager.js.map +1 -0
- package/dist/utils/errors.d.ts +12 -0
- package/dist/utils/errors.d.ts.map +1 -0
- package/dist/utils/errors.js +27 -0
- package/dist/utils/errors.js.map +1 -0
- package/dist/utils/version.d.ts +5 -0
- package/dist/utils/version.d.ts.map +1 -0
- package/dist/utils/version.js +19 -0
- package/dist/utils/version.js.map +1 -0
- package/eslint.config.js +63 -0
- package/package.json +48 -0
- package/src/commands/packages/pull.ts +96 -0
- package/src/commands/packages/search.ts +83 -0
- package/src/commands/packages/show.ts +138 -0
- package/src/index.ts +15 -0
- package/src/lib/api/registry-client.ts +223 -0
- package/src/lib/api/schema.d.ts +548 -0
- package/src/program.test.ts +24 -0
- package/src/program.ts +76 -0
- package/src/utils/config-manager.test.ts +60 -0
- package/src/utils/config-manager.ts +81 -0
- package/src/utils/errors.test.ts +25 -0
- package/src/utils/errors.ts +33 -0
- package/src/utils/version.test.ts +16 -0
- package/src/utils/version.ts +18 -0
- package/tsconfig.json +25 -0
- package/vitest.config.ts +13 -0
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
import { RegistryClient } from '../../lib/api/registry-client.js';
|
|
2
|
+
/**
|
|
3
|
+
* Search bundles (v1 API)
|
|
4
|
+
*/
|
|
5
|
+
export async function handleSearch(query, options = {}) {
|
|
6
|
+
try {
|
|
7
|
+
const client = new RegistryClient();
|
|
8
|
+
const result = await client.searchBundles(query, {
|
|
9
|
+
type: options.type,
|
|
10
|
+
sort: options.sort,
|
|
11
|
+
limit: options.limit,
|
|
12
|
+
offset: options.offset,
|
|
13
|
+
});
|
|
14
|
+
if (options.json) {
|
|
15
|
+
console.log(JSON.stringify(result, null, 2));
|
|
16
|
+
return;
|
|
17
|
+
}
|
|
18
|
+
if (result.bundles.length === 0) {
|
|
19
|
+
console.log(`\nNo bundles found for "${query}"`);
|
|
20
|
+
return;
|
|
21
|
+
}
|
|
22
|
+
console.log(`\nFound ${result.total} bundle(s) for "${query}":\n`);
|
|
23
|
+
for (const bundle of result.bundles) {
|
|
24
|
+
const verified = bundle.verified ? '✓' : ' ';
|
|
25
|
+
const provenance = bundle.provenance ? '🔒' : '';
|
|
26
|
+
console.log(`${verified} ${bundle.name} v${bundle.latest_version} ${provenance}`);
|
|
27
|
+
if (bundle.description) {
|
|
28
|
+
console.log(` ${bundle.description}`);
|
|
29
|
+
}
|
|
30
|
+
const details = [];
|
|
31
|
+
if (bundle.downloads)
|
|
32
|
+
details.push(`${bundle.downloads} downloads`);
|
|
33
|
+
if (bundle.server_type)
|
|
34
|
+
details.push(bundle.server_type);
|
|
35
|
+
if (bundle.author?.name)
|
|
36
|
+
details.push(`by ${bundle.author.name}`);
|
|
37
|
+
if (details.length > 0) {
|
|
38
|
+
console.log(` ${details.join(' • ')}`);
|
|
39
|
+
}
|
|
40
|
+
if (bundle.tools && bundle.tools.length > 0) {
|
|
41
|
+
const toolNames = bundle.tools.slice(0, 3).map((t) => t.name);
|
|
42
|
+
const toolsDisplay = bundle.tools.length > 3
|
|
43
|
+
? `${toolNames.join(', ')} +${bundle.tools.length - 3} more`
|
|
44
|
+
: toolNames.join(', ');
|
|
45
|
+
console.log(` Tools: ${toolsDisplay}`);
|
|
46
|
+
}
|
|
47
|
+
console.log();
|
|
48
|
+
}
|
|
49
|
+
if (result.pagination.has_more) {
|
|
50
|
+
const nextOffset = (options.offset || 0) + (options.limit || 20);
|
|
51
|
+
console.log(`More results available. Use --offset ${nextOffset} to see more.`);
|
|
52
|
+
}
|
|
53
|
+
console.log(`Use "mpak show <bundle>" for more details`);
|
|
54
|
+
}
|
|
55
|
+
catch (error) {
|
|
56
|
+
console.error('=> Failed to search bundles');
|
|
57
|
+
if (error instanceof Error) {
|
|
58
|
+
console.error(` ${error.message}`);
|
|
59
|
+
}
|
|
60
|
+
process.exit(1);
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
//# sourceMappingURL=search.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"search.js","sourceRoot":"","sources":["../../../src/commands/packages/search.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,kCAAkC,CAAC;AAUlE;;GAEG;AACH,MAAM,CAAC,KAAK,UAAU,YAAY,CAChC,KAAa,EACb,UAAyB,EAAE;IAE3B,IAAI,CAAC;QACH,MAAM,MAAM,GAAG,IAAI,cAAc,EAAE,CAAC;QACpC,MAAM,MAAM,GAAG,MAAM,MAAM,CAAC,aAAa,CAAC,KAAK,EAAE;YAC/C,IAAI,EAAE,OAAO,CAAC,IA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A2C,CAAC,CAAC;IAC3D,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QACf,OAAO,CAAC,KAAK,CAAC,6BAA6B,CAAC,CAAC;QAC7C,IAAI,KAAK,YAAY,KAAK,EAAE,CAAC;YAC3B,OAAO,CAAC,KAAK,CAAC,MAAM,KAAK,CAAC,OAAO,EAAE,CAAC,CAAC;QACvC,CAAC;QACD,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;IAClB,CAAC;AACH,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"show.d.ts","sourceRoot":"","sources":["../../../src/commands/packages/show.ts"],"names":[],"mappings":"AAEA,MAAM,WAAW,WAAW;IAC1B,IAAI,CAAC,EAAE,OAAO,CAAC;CAChB;AAED;;GAEG;AACH,wBAAsB,UAAU,CAC9B,WAAW,EAAE,MAAM,EACnB,OAAO,GAAE,WAAgB,GACxB,OAAO,CAAC,IAAI,CAAC,CA6Hf"}
|
|
@@ -0,0 +1,121 @@
|
|
|
1
|
+
import { RegistryClient } from '../../lib/api/registry-client.js';
|
|
2
|
+
/**
|
|
3
|
+
* Show detailed information about a bundle (v1 API)
|
|
4
|
+
*/
|
|
5
|
+
export async function handleShow(packageName, options = {}) {
|
|
6
|
+
try {
|
|
7
|
+
const client = new RegistryClient();
|
|
8
|
+
// Fetch bundle details and versions in parallel
|
|
9
|
+
const [bundle, versionsInfo] = await Promise.all([
|
|
10
|
+
client.getBundle(packageName),
|
|
11
|
+
client.getVersions(packageName),
|
|
12
|
+
]);
|
|
13
|
+
if (options.json) {
|
|
14
|
+
console.log(JSON.stringify({ ...bundle, versions_detail: versionsInfo.versions }, null, 2));
|
|
15
|
+
return;
|
|
16
|
+
}
|
|
17
|
+
// Header
|
|
18
|
+
const verified = bundle.verified ? '✓ ' : '';
|
|
19
|
+
const provenance = bundle.provenance ? '🔒 ' : '';
|
|
20
|
+
console.log(`\n${verified}${provenance}${bundle.display_name || bundle.name} v${bundle.latest_version}\n`);
|
|
21
|
+
// Description
|
|
22
|
+
if (bundle.description) {
|
|
23
|
+
console.log(bundle.description);
|
|
24
|
+
console.log();
|
|
25
|
+
}
|
|
26
|
+
// Basic info
|
|
27
|
+
console.log('Bundle Information:');
|
|
28
|
+
console.log(` Name: ${bundle.name}`);
|
|
29
|
+
if (bundle.author?.name) {
|
|
30
|
+
console.log(` Author: ${bundle.author.name}`);
|
|
31
|
+
}
|
|
32
|
+
if (bundle.server_type) {
|
|
33
|
+
console.log(` Type: ${bundle.server_type}`);
|
|
34
|
+
}
|
|
35
|
+
if (bundle.license) {
|
|
36
|
+
console.log(` License: ${bundle.license}`);
|
|
37
|
+
}
|
|
38
|
+
if (bundle.homepage) {
|
|
39
|
+
console.log(` Homepage: ${bundle.homepage}`);
|
|
40
|
+
}
|
|
41
|
+
console.log();
|
|
42
|
+
// Provenance info
|
|
43
|
+
if (bundle.provenance) {
|
|
44
|
+
console.log('Provenance:');
|
|
45
|
+
console.log(` Repository: ${bundle.provenance.repository}`);
|
|
46
|
+
console.log(` Commit: ${bundle.provenance.sha.substring(0, 12)}`);
|
|
47
|
+
console.log(` Provider: ${bundle.provenance.provider}`);
|
|
48
|
+
console.log();
|
|
49
|
+
}
|
|
50
|
+
// Stats
|
|
51
|
+
console.log('Statistics:');
|
|
52
|
+
console.log(` Downloads: ${bundle.downloads.toLocaleString()}`);
|
|
53
|
+
console.log(` Published: ${new Date(bundle.published_at).toLocaleDateString()}`);
|
|
54
|
+
console.log();
|
|
55
|
+
// GitHub info
|
|
56
|
+
if (bundle.github) {
|
|
57
|
+
console.log('GitHub:');
|
|
58
|
+
console.log(` Repository: ${bundle.github.repo}`);
|
|
59
|
+
if (bundle.github.stars != null)
|
|
60
|
+
console.log(` Stars: ${bundle.github.stars}`);
|
|
61
|
+
if (bundle.github.forks != null)
|
|
62
|
+
console.log(` Forks: ${bundle.github.forks}`);
|
|
63
|
+
if (bundle.github.watchers != null)
|
|
64
|
+
console.log(` Watchers: ${bundle.github.watchers}`);
|
|
65
|
+
console.log();
|
|
66
|
+
}
|
|
67
|
+
// Tools
|
|
68
|
+
if (bundle.tools && bundle.tools.length > 0) {
|
|
69
|
+
console.log(`Tools (${bundle.tools.length}):`);
|
|
70
|
+
for (const tool of bundle.tools) {
|
|
71
|
+
console.log(` - ${tool.name}`);
|
|
72
|
+
if (tool.description) {
|
|
73
|
+
console.log(` ${tool.description}`);
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
console.log();
|
|
77
|
+
}
|
|
78
|
+
// Versions with platforms
|
|
79
|
+
if (versionsInfo.versions && versionsInfo.versions.length > 0) {
|
|
80
|
+
console.log(`Versions (${versionsInfo.versions.length}):`);
|
|
81
|
+
const recentVersions = versionsInfo.versions.slice(0, 5);
|
|
82
|
+
for (const version of recentVersions) {
|
|
83
|
+
const date = new Date(version.published_at).toLocaleDateString();
|
|
84
|
+
const downloads = version.downloads.toLocaleString();
|
|
85
|
+
const isLatest = version.version === versionsInfo.latest ? ' (latest)' : '';
|
|
86
|
+
const provTag = version.provenance ? ' 🔒' : '';
|
|
87
|
+
// Format platforms
|
|
88
|
+
const platformStrs = version.platforms.map((p) => `${p.os}-${p.arch}`);
|
|
89
|
+
const platformsDisplay = platformStrs.length > 0 ? ` [${platformStrs.join(', ')}]` : '';
|
|
90
|
+
console.log(` ${version.version}${isLatest}${provTag} - ${date} - ${downloads} downloads${platformsDisplay}`);
|
|
91
|
+
}
|
|
92
|
+
if (versionsInfo.versions.length > 5) {
|
|
93
|
+
console.log(` ... and ${versionsInfo.versions.length - 5} more`);
|
|
94
|
+
}
|
|
95
|
+
console.log();
|
|
96
|
+
}
|
|
97
|
+
// Available platforms for latest version
|
|
98
|
+
const latestVersion = versionsInfo.versions.find((v) => v.version === versionsInfo.latest);
|
|
99
|
+
if (latestVersion && latestVersion.platforms.length > 0) {
|
|
100
|
+
console.log('Available Platforms:');
|
|
101
|
+
for (const platform of latestVersion.platforms) {
|
|
102
|
+
console.log(` - ${platform.os}-${platform.arch}`);
|
|
103
|
+
}
|
|
104
|
+
console.log();
|
|
105
|
+
}
|
|
106
|
+
// Install instructions
|
|
107
|
+
console.log('Install:');
|
|
108
|
+
console.log(` mpak install ${bundle.name}`);
|
|
109
|
+
console.log();
|
|
110
|
+
console.log('Pull (download only):');
|
|
111
|
+
console.log(` mpak pull ${bundle.name}`);
|
|
112
|
+
}
|
|
113
|
+
catch (error) {
|
|
114
|
+
console.error('=> Failed to get bundle details');
|
|
115
|
+
if (error instanceof Error) {
|
|
116
|
+
console.error(` ${error.message}`);
|
|
117
|
+
}
|
|
118
|
+
process.exit(1);
|
|
119
|
+
}
|
|
120
|
+
}
|
|
121
|
+
//# sourceMappingURL=show.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"show.js","sourceRoot":"","sources":["../../../src/commands/packages/show.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,kCAAkC,CAAC;AAMlE;;GAEG;AACH,MAAM,CAAC,KAAK,UAAU,UAAU,CAC9B,WAAmB,EACnB,UAAuB,EAAE;IAEzB,IAAI,CAAC;QACH,MAAM,MAAM,GAAG,IAAI,cAAc,EAAE,CAAC;QAEpC,gDAAgD;QAChD,MAAM,CAAC,MAAM,EAAE,YAAY,CAAC,GAAG,MAAM,OAAO,CAAC,GAAG,CAAC;YAC/C,MAAM,CAAC,SAAS,CAAC,WAAW,CAAC;YAC7B,MAAM,CAAC,WAAW,CAAC,WAAW,CAAC;SAChC,CAAC,CAAC;QAEH,IAAI,OAAO,CAAC,IAAI,EAAE,CAAC;YACjB,OAAO,CAAC,GAAG,CAAC,IAAI,CAAC,SAAS,CAAC,EAAE,GAAG,MAAM,EAAE,eAAe,EAAE,YAAY,CAAC,QAAQ,EAAE,EAAE,IAAI,EAAE,CAAC,CAAC,CAAC,CAAC;YAC5F,OAAO;QACT,CAAC;QAED,SAAS;QACT,MAAM,QAAQ,GAAG,MAAM,CAAC,QAAQ,CAAC,CAAC,C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,CAAC,CAAC;YACrD,CAAC;YACD,OAAO,CAAC,GAAG,EAAE,CAAC;QAChB,CAAC;QAED,uBAAuB;QACvB,OAAO,CAAC,GAAG,CAAC,UAAU,CAAC,CAAC;QACxB,OAAO,CAAC,GAAG,CAAC,kBAAkB,MAAM,CAAC,IAAI,EAAE,CAAC,CAAC;QAC7C,OAAO,CAAC,GAAG,EAAE,CAAC;QACd,OAAO,CAAC,GAAG,CAAC,uBAAuB,CAAC,CAAC;QACrC,OAAO,CAAC,GAAG,CAAC,eAAe,MAAM,CAAC,IAAI,EAAE,CAAC,CAAC;IAC5C,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QACf,OAAO,CAAC,KAAK,CAAC,iCAAiC,CAAC,CAAC;QACjD,IAAI,KAAK,YAAY,KAAK,EAAE,CAAC;YAC3B,OAAO,CAAC,KAAK,CAAC,MAAM,KAAK,CAAC,OAAO,EAAE,CAAC,CAAC;QACvC,CAAC;QACD,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;IAClB,CAAC;AACH,CAAC"}
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":""}
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import { config } from 'dotenv';
|
|
3
|
+
import { createProgram } from './program.js';
|
|
4
|
+
import { handleError } from './utils/errors.js';
|
|
5
|
+
// Load environment variables from .env file
|
|
6
|
+
config();
|
|
7
|
+
async function main() {
|
|
8
|
+
const program = createProgram();
|
|
9
|
+
await program.parseAsync(process.argv);
|
|
10
|
+
}
|
|
11
|
+
main().catch(handleError);
|
|
12
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AAEA,OAAO,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AAChC,OAAO,EAAE,aAAa,EAAE,MAAM,cAAc,CAAC;AAC7C,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAEhD,4CAA4C;AAC5C,MAAM,EAAE,CAAC;AAET,KAAK,UAAU,IAAI;IACjB,MAAM,OAAO,GAAG,aAAa,EAAE,CAAC;IAChC,MAAM,OAAO,CAAC,UAAU,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC;AACzC,CAAC;AAED,IAAI,EAAE,CAAC,KAAK,CAAC,WAAW,CAAC,CAAC"}
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
import type { paths } from './schema.js';
|
|
2
|
+
type ResponseOf<T> = T extends {
|
|
3
|
+
responses: {
|
|
4
|
+
200: {
|
|
5
|
+
content: {
|
|
6
|
+
'application/json': infer R;
|
|
7
|
+
};
|
|
8
|
+
};
|
|
9
|
+
};
|
|
10
|
+
} ? R : never;
|
|
11
|
+
export type BundleSearchResponse = ResponseOf<paths['/v1/bundles/search']['get']>;
|
|
12
|
+
export type BundleDetailResponse = ResponseOf<paths['/v1/bundles/@{scope}/{package}']['get']>;
|
|
13
|
+
export type VersionsResponse = ResponseOf<paths['/v1/bundles/@{scope}/{package}/versions']['get']>;
|
|
14
|
+
export type DownloadInfoResponse = ResponseOf<paths['/v1/bundles/@{scope}/{package}/versions/{version}/download']['get']>;
|
|
15
|
+
export type Bundle = BundleSearchResponse['bundles'][number];
|
|
16
|
+
export type BundleDetail = BundleDetailResponse;
|
|
17
|
+
export type VersionInfo = VersionsResponse['versions'][number];
|
|
18
|
+
export type DownloadInfo = DownloadInfoResponse;
|
|
19
|
+
/** Platform identifier (os + arch) */
|
|
20
|
+
export interface Platform {
|
|
21
|
+
os: string;
|
|
22
|
+
arch: string;
|
|
23
|
+
}
|
|
24
|
+
/**
|
|
25
|
+
* Client for interacting with the mpak registry v1 API
|
|
26
|
+
*
|
|
27
|
+
* All methods use the public /v1/bundles API (unauthenticated)
|
|
28
|
+
*/
|
|
29
|
+
export declare class RegistryClient {
|
|
30
|
+
private baseUrl;
|
|
31
|
+
constructor();
|
|
32
|
+
/**
|
|
33
|
+
* Search bundles
|
|
34
|
+
*/
|
|
35
|
+
searchBundles(query: string, options?: {
|
|
36
|
+
type?: string;
|
|
37
|
+
sort?: 'downloads' | 'recent' | 'name';
|
|
38
|
+
limit?: number;
|
|
39
|
+
offset?: number;
|
|
40
|
+
}): Promise<BundleSearchResponse>;
|
|
41
|
+
/**
|
|
42
|
+
* Get bundle details
|
|
43
|
+
*/
|
|
44
|
+
getBundle(packageName: string): Promise<BundleDetail>;
|
|
45
|
+
/**
|
|
46
|
+
* Get versions with platform info
|
|
47
|
+
*/
|
|
48
|
+
getVersions(packageName: string): Promise<VersionsResponse>;
|
|
49
|
+
/**
|
|
50
|
+
* Detect the current platform
|
|
51
|
+
*/
|
|
52
|
+
static detectPlatform(): Platform;
|
|
53
|
+
/**
|
|
54
|
+
* Get download info for a bundle version
|
|
55
|
+
*/
|
|
56
|
+
getDownloadInfo(packageName: string, version?: string, platform?: Platform): Promise<DownloadInfo>;
|
|
57
|
+
/**
|
|
58
|
+
* Download a bundle to a file
|
|
59
|
+
*/
|
|
60
|
+
downloadBundle(downloadUrl: string, outputPath: string): Promise<void>;
|
|
61
|
+
}
|
|
62
|
+
export {};
|
|
63
|
+
//# sourceMappingURL=registry-client.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"registry-client.d.ts","sourceRoot":"","sources":["../../../src/lib/api/registry-client.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,aAAa,CAAC;AAOzC,KAAK,UAAU,CAAC,CAAC,IAAI,CAAC,SAAS;IAAE,SAAS,EAAE;QAAE,GAAG,EAAE;YAAE,OAAO,EAAE;gBAAE,kBAAkB,EAAE,MAAM,CAAC,CAAA;aAAE,CAAA;SAAE,CAAA;KAAE,CAAA;CAAE,GAAG,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AW,CAAC,WAAW,EAAE,MAAM,GAAG,OAAO,CAAC,gBAAgB,CAAC;IAsBjE;;OAEG;IACH,MAAM,CAAC,cAAc,IAAI,QAAQ;IAoCjC;;OAEG;IACG,eAAe,CAAC,WAAW,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,MAAM,EAAE,QAAQ,CAAC,EAAE,QAAQ,GAAG,OAAO,CAAC,YAAY,CAAC;IAuCxG;;OAEG;IACG,cAAc,CAAC,WAAW,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;CAa7E"}
|
|
@@ -0,0 +1,167 @@
|
|
|
1
|
+
import { ConfigManager } from '../../utils/config-manager.js';
|
|
2
|
+
// =============================================================================
|
|
3
|
+
// Registry Client (v1 API only)
|
|
4
|
+
// =============================================================================
|
|
5
|
+
/**
|
|
6
|
+
* Client for interacting with the mpak registry v1 API
|
|
7
|
+
*
|
|
8
|
+
* All methods use the public /v1/bundles API (unauthenticated)
|
|
9
|
+
*/
|
|
10
|
+
export class RegistryClient {
|
|
11
|
+
baseUrl;
|
|
12
|
+
constructor() {
|
|
13
|
+
const configManager = new ConfigManager();
|
|
14
|
+
this.baseUrl = configManager.getRegistryUrl();
|
|
15
|
+
}
|
|
16
|
+
/**
|
|
17
|
+
* Search bundles
|
|
18
|
+
*/
|
|
19
|
+
async searchBundles(query, options = {}) {
|
|
20
|
+
const params = new URLSearchParams();
|
|
21
|
+
if (query)
|
|
22
|
+
params.set('q', query);
|
|
23
|
+
if (options.type)
|
|
24
|
+
params.set('type', options.type);
|
|
25
|
+
if (options.sort)
|
|
26
|
+
params.set('sort', options.sort);
|
|
27
|
+
if (options.limit)
|
|
28
|
+
params.set('limit', options.limit.toString());
|
|
29
|
+
if (options.offset)
|
|
30
|
+
params.set('offset', options.offset.toString());
|
|
31
|
+
const url = `${this.baseUrl}/v1/bundles/search?${params.toString()}`;
|
|
32
|
+
const response = await fetch(url);
|
|
33
|
+
if (!response.ok) {
|
|
34
|
+
const error = await response.json().catch(() => ({ error: response.statusText }));
|
|
35
|
+
const errorMessage = typeof error.error === 'string'
|
|
36
|
+
? error.error
|
|
37
|
+
: error.error?.message || `Failed to search bundles: ${response.statusText}`;
|
|
38
|
+
throw new Error(errorMessage);
|
|
39
|
+
}
|
|
40
|
+
return response.json();
|
|
41
|
+
}
|
|
42
|
+
/**
|
|
43
|
+
* Get bundle details
|
|
44
|
+
*/
|
|
45
|
+
async getBundle(packageName) {
|
|
46
|
+
if (!packageName.startsWith('@')) {
|
|
47
|
+
throw new Error('Package name must be scoped (e.g., @username/package-name)');
|
|
48
|
+
}
|
|
49
|
+
const url = `${this.baseUrl}/v1/bundles/${packageName}`;
|
|
50
|
+
const response = await fetch(url);
|
|
51
|
+
if (!response.ok) {
|
|
52
|
+
if (response.status === 404) {
|
|
53
|
+
throw new Error(`Bundle not found: ${packageName}`);
|
|
54
|
+
}
|
|
55
|
+
const error = await response.json().catch(() => ({ error: response.statusText }));
|
|
56
|
+
const errorMessage = typeof error.error === 'string'
|
|
57
|
+
? error.error
|
|
58
|
+
: error.error?.message || `Failed to get bundle details: ${response.statusText}`;
|
|
59
|
+
throw new Error(errorMessage);
|
|
60
|
+
}
|
|
61
|
+
return response.json();
|
|
62
|
+
}
|
|
63
|
+
/**
|
|
64
|
+
* Get versions with platform info
|
|
65
|
+
*/
|
|
66
|
+
async getVersions(packageName) {
|
|
67
|
+
if (!packageName.startsWith('@')) {
|
|
68
|
+
throw new Error('Package name must be scoped (e.g., @username/package-name)');
|
|
69
|
+
}
|
|
70
|
+
const url = `${this.baseUrl}/v1/bundles/${packageName}/versions`;
|
|
71
|
+
const response = await fetch(url);
|
|
72
|
+
if (!response.ok) {
|
|
73
|
+
if (response.status === 404) {
|
|
74
|
+
throw new Error(`Bundle not found: ${packageName}`);
|
|
75
|
+
}
|
|
76
|
+
const error = await response.json().catch(() => ({ error: response.statusText }));
|
|
77
|
+
const errorMessage = typeof error.error === 'string'
|
|
78
|
+
? error.error
|
|
79
|
+
: error.error?.message || `Failed to get versions: ${response.statusText}`;
|
|
80
|
+
throw new Error(errorMessage);
|
|
81
|
+
}
|
|
82
|
+
return response.json();
|
|
83
|
+
}
|
|
84
|
+
/**
|
|
85
|
+
* Detect the current platform
|
|
86
|
+
*/
|
|
87
|
+
static detectPlatform() {
|
|
88
|
+
const platform = process.platform;
|
|
89
|
+
const arch = process.arch;
|
|
90
|
+
// Map Node.js platform names to MCPB spec names
|
|
91
|
+
let os;
|
|
92
|
+
switch (platform) {
|
|
93
|
+
case 'darwin':
|
|
94
|
+
os = 'darwin';
|
|
95
|
+
break;
|
|
96
|
+
case 'win32':
|
|
97
|
+
os = 'win32';
|
|
98
|
+
break;
|
|
99
|
+
case 'linux':
|
|
100
|
+
os = 'linux';
|
|
101
|
+
break;
|
|
102
|
+
default:
|
|
103
|
+
os = 'any';
|
|
104
|
+
}
|
|
105
|
+
// Map Node.js arch names to MCPB spec names
|
|
106
|
+
let mcpbArch;
|
|
107
|
+
switch (arch) {
|
|
108
|
+
case 'x64':
|
|
109
|
+
mcpbArch = 'x64';
|
|
110
|
+
break;
|
|
111
|
+
case 'arm64':
|
|
112
|
+
mcpbArch = 'arm64';
|
|
113
|
+
break;
|
|
114
|
+
default:
|
|
115
|
+
mcpbArch = 'any';
|
|
116
|
+
}
|
|
117
|
+
return { os, arch: mcpbArch };
|
|
118
|
+
}
|
|
119
|
+
/**
|
|
120
|
+
* Get download info for a bundle version
|
|
121
|
+
*/
|
|
122
|
+
async getDownloadInfo(packageName, version, platform) {
|
|
123
|
+
if (!packageName.startsWith('@')) {
|
|
124
|
+
throw new Error('Package name must be scoped (e.g., @username/package-name)');
|
|
125
|
+
}
|
|
126
|
+
const versionPath = version ? `/versions/${version}` : '/versions/latest';
|
|
127
|
+
const params = new URLSearchParams();
|
|
128
|
+
if (platform) {
|
|
129
|
+
params.set('os', platform.os);
|
|
130
|
+
params.set('arch', platform.arch);
|
|
131
|
+
}
|
|
132
|
+
const queryString = params.toString();
|
|
133
|
+
const url = `${this.baseUrl}/v1/bundles/${packageName}${versionPath}/download${queryString ? `?${queryString}` : ''}`;
|
|
134
|
+
const response = await fetch(url, {
|
|
135
|
+
headers: {
|
|
136
|
+
Accept: 'application/json',
|
|
137
|
+
},
|
|
138
|
+
});
|
|
139
|
+
if (!response.ok) {
|
|
140
|
+
if (response.status === 404) {
|
|
141
|
+
throw new Error(version
|
|
142
|
+
? `Bundle version not found: ${packageName}@${version}`
|
|
143
|
+
: `Bundle not found: ${packageName}`);
|
|
144
|
+
}
|
|
145
|
+
const error = await response.json().catch(() => ({ error: response.statusText }));
|
|
146
|
+
const errorMessage = typeof error.error === 'string'
|
|
147
|
+
? error.error
|
|
148
|
+
: error.error?.message || `Failed to get download info: ${response.statusText}`;
|
|
149
|
+
throw new Error(errorMessage);
|
|
150
|
+
}
|
|
151
|
+
return response.json();
|
|
152
|
+
}
|
|
153
|
+
/**
|
|
154
|
+
* Download a bundle to a file
|
|
155
|
+
*/
|
|
156
|
+
async downloadBundle(downloadUrl, outputPath) {
|
|
157
|
+
const response = await fetch(downloadUrl);
|
|
158
|
+
if (!response.ok) {
|
|
159
|
+
throw new Error(`Failed to download bundle: ${response.statusText}`);
|
|
160
|
+
}
|
|
161
|
+
const arrayBuffer = await response.arrayBuffer();
|
|
162
|
+
const buffer = Buffer.from(arrayBuffer);
|
|
163
|
+
const fs = await import('fs');
|
|
164
|
+
fs.writeFileSync(outputPath, buffer);
|
|
165
|
+
}
|
|
166
|
+
}
|
|
167
|
+
//# sourceMappingURL=registry-client.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"registry-client.js","sourceRoot":"","sources":["../../../src/lib/api/registry-client.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,+BAA+B,CAAC;AA4B9D,gFAAgF;AAChF,gCAAgC;AAChC,gFAAgF;AAEhF;;;;GAIG;AACH,MAAM,OAAO,cAAc;IACjB,OAAO,CAAS;IA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,EAAE,CAAC,aAAa,CAAC,UAAU,EAAE,MAAM,CAAC,CAAC;IACvC,CAAC;CACF"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"program.d.ts","sourceRoot":"","sources":["../src/program.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAMpC;;;;GAIG;AACH,wBAAgB,aAAa,IAAI,OAAO,CAgEvC"}
|
package/dist/program.js
ADDED
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
import { Command } from 'commander';
|
|
2
|
+
import { getVersion } from './utils/version.js';
|
|
3
|
+
import { handleSearch } from './commands/packages/search.js';
|
|
4
|
+
import { handleShow } from './commands/packages/show.js';
|
|
5
|
+
import { handlePull } from './commands/packages/pull.js';
|
|
6
|
+
/**
|
|
7
|
+
* Creates and configures the CLI program
|
|
8
|
+
*
|
|
9
|
+
* MVP: Unauthenticated commands only (v1 API)
|
|
10
|
+
*/
|
|
11
|
+
export function createProgram() {
|
|
12
|
+
const program = new Command();
|
|
13
|
+
program
|
|
14
|
+
.name('mpak')
|
|
15
|
+
.description('CLI for downloading MCPB bundles from the package directory')
|
|
16
|
+
.version(getVersion(), '-v, --version', 'Output the current version');
|
|
17
|
+
// Search command
|
|
18
|
+
program
|
|
19
|
+
.command('search <query>')
|
|
20
|
+
.description('Search public bundles')
|
|
21
|
+
.option('--type <type>', 'Filter by server type (node, python, binary)')
|
|
22
|
+
.option('--sort <field>', 'Sort by: downloads, recent, name')
|
|
23
|
+
.option('--limit <number>', 'Limit results', parseInt)
|
|
24
|
+
.option('--offset <number>', 'Pagination offset', parseInt)
|
|
25
|
+
.option('--json', 'Output as JSON')
|
|
26
|
+
.action(async (query, options) => {
|
|
27
|
+
await handleSearch(query, options);
|
|
28
|
+
});
|
|
29
|
+
// Show command
|
|
30
|
+
program
|
|
31
|
+
.command('show <package>')
|
|
32
|
+
.description('Show detailed information about a bundle')
|
|
33
|
+
.option('--json', 'Output as JSON')
|
|
34
|
+
.action(async (packageName, options) => {
|
|
35
|
+
await handleShow(packageName, options);
|
|
36
|
+
});
|
|
37
|
+
// Info command (alias for show)
|
|
38
|
+
program
|
|
39
|
+
.command('info <package>')
|
|
40
|
+
.description('Show detailed information about a bundle (alias for show)')
|
|
41
|
+
.option('--json', 'Output as JSON')
|
|
42
|
+
.action(async (packageName, options) => {
|
|
43
|
+
await handleShow(packageName, options);
|
|
44
|
+
});
|
|
45
|
+
// Pull command
|
|
46
|
+
program
|
|
47
|
+
.command('pull <package>')
|
|
48
|
+
.description('Download a bundle from the registry (e.g., @scope/name or @scope/name@1.0.0)')
|
|
49
|
+
.option('-o, --output <path>', 'Output file path')
|
|
50
|
+
.option('--os <os>', 'Target OS (darwin, linux, win32)')
|
|
51
|
+
.option('--arch <arch>', 'Target architecture (x64, arm64)')
|
|
52
|
+
.option('--json', 'Output download info as JSON')
|
|
53
|
+
.action(async (packageSpec, options) => {
|
|
54
|
+
await handlePull(packageSpec, options);
|
|
55
|
+
});
|
|
56
|
+
// Install command (alias for pull)
|
|
57
|
+
program
|
|
58
|
+
.command('install <package>')
|
|
59
|
+
.description('Download a bundle from the registry (alias for pull)')
|
|
60
|
+
.option('-o, --output <path>', 'Output file path')
|
|
61
|
+
.option('--os <os>', 'Target OS (darwin, linux, win32)')
|
|
62
|
+
.option('--arch <arch>', 'Target architecture (x64, arm64)')
|
|
63
|
+
.option('--json', 'Output download info as JSON')
|
|
64
|
+
.action(async (packageSpec, options) => {
|
|
65
|
+
await handlePull(packageSpec, options);
|
|
66
|
+
});
|
|
67
|
+
return program;
|
|
68
|
+
}
|
|
69
|
+
//# sourceMappingURL=program.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"program.js","sourceRoot":"","sources":["../src/program.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,OAAO,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAC;AAChD,OA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
|
9
|
+
/**
|
|
10
|
+
* Configuration manager for CLI settings in ~/.mpak/config.json
|
|
11
|
+
*/
|
|
12
|
+
export declare class ConfigManager {
|
|
13
|
+
private configDir;
|
|
14
|
+
private configFile;
|
|
15
|
+
private config;
|
|
16
|
+
constructor();
|
|
17
|
+
private ensureConfigDir;
|
|
18
|
+
loadConfig(): MpakConfig;
|
|
19
|
+
private saveConfig;
|
|
20
|
+
setRegistryUrl(url: string): void;
|
|
21
|
+
getRegistryUrl(): string;
|
|
22
|
+
}
|
|
23
|
+
//# sourceMappingURL=config-manager.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"config-manager.d.ts","sourceRoot":"","sources":["../../src/utils/config-manager.ts"],"names":[],"mappings":"AAIA;;GAEG;AACH,MAAM,WAAW,UAAU;IACzB,OAAO,EAAE,MAAM,CAAC;IAChB,WAAW,EAAE,MAAM,CAAC;IACpB,WAAW,CAAC,EAAE,MAAM,CAAC;CACtB;AAED;;GAEG;AACH,qBAAa,aAAa;IACxB,OAAO,CAAC,SAAS,CAAS;IAC1B,OAAO,CAAC,UAAU,CAAS;IAC3B,OAAO,CAAC,MAAM,CAA2B;;IAQzC,OAAO,CAAC,eAAe;IAMvB,UAAU,IAAI,UAAU;IA4BxB,OAAO,CAAC,UAAU;IASlB,cAAc,CAAC,GAAG,EAAE,MAAM,GAAG,IAAI;IAMjC,cAAc,IAAI,MAAM;CAIzB"}
|