prpm 1.2.1 → 2.0.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.
Files changed (67) hide show
  1. package/README.md +90 -862
  2. package/dist/index.js +23233 -65
  3. package/dist/schemas/agents-md.schema.json +24 -0
  4. package/dist/schemas/aider.schema.json +24 -0
  5. package/dist/schemas/canonical.schema.json +435 -0
  6. package/dist/schemas/claude-agent.schema.json +62 -0
  7. package/dist/schemas/claude-hook.schema.json +70 -0
  8. package/dist/schemas/claude-plugin.schema.json +122 -0
  9. package/dist/schemas/claude-skill.schema.json +51 -0
  10. package/dist/schemas/claude-slash-command.schema.json +77 -0
  11. package/dist/schemas/claude.schema.json +52 -0
  12. package/dist/schemas/continue.schema.json +98 -0
  13. package/dist/schemas/copilot.schema.json +76 -0
  14. package/dist/schemas/cursor-command.schema.json +27 -0
  15. package/dist/schemas/cursor-hooks.schema.json +59 -0
  16. package/dist/schemas/cursor.schema.json +74 -0
  17. package/dist/schemas/droid-hook.schema.json +103 -0
  18. package/dist/schemas/droid-skill.schema.json +46 -0
  19. package/dist/schemas/droid-slash-command.schema.json +53 -0
  20. package/dist/schemas/droid.schema.json +46 -0
  21. package/dist/schemas/format-registry.schema.json +99 -0
  22. package/dist/schemas/gemini-md.schema.json +24 -0
  23. package/dist/schemas/gemini.schema.json +30 -0
  24. package/dist/schemas/kiro-agent.schema.json +146 -0
  25. package/dist/schemas/kiro-hook.schema.json +120 -0
  26. package/dist/schemas/kiro-steering.schema.json +74 -0
  27. package/dist/schemas/mcp-server.schema.json +130 -0
  28. package/dist/schemas/opencode-slash-command.schema.json +60 -0
  29. package/dist/schemas/opencode.schema.json +111 -0
  30. package/dist/schemas/prpm-manifest.schema.json +733 -0
  31. package/dist/schemas/replit.schema.json +21 -0
  32. package/dist/schemas/ruler.schema.json +22 -0
  33. package/dist/schemas/trae.schema.json +24 -0
  34. package/dist/schemas/windsurf.schema.json +22 -0
  35. package/dist/schemas/zencoder.schema.json +51 -0
  36. package/package.json +20 -14
  37. package/schemas/prpm-manifest.schema.json +465 -39
  38. package/dist/__tests__/e2e/test-helpers.js +0 -150
  39. package/dist/commands/collections.js +0 -606
  40. package/dist/commands/index.js +0 -186
  41. package/dist/commands/info.js +0 -82
  42. package/dist/commands/install.js +0 -477
  43. package/dist/commands/list.js +0 -166
  44. package/dist/commands/login.js +0 -281
  45. package/dist/commands/outdated.js +0 -128
  46. package/dist/commands/popular.js +0 -27
  47. package/dist/commands/publish.js +0 -274
  48. package/dist/commands/schema.js +0 -37
  49. package/dist/commands/search.js +0 -404
  50. package/dist/commands/telemetry.js +0 -103
  51. package/dist/commands/trending.js +0 -76
  52. package/dist/commands/uninstall.js +0 -77
  53. package/dist/commands/update.js +0 -121
  54. package/dist/commands/upgrade.js +0 -121
  55. package/dist/commands/whoami.js +0 -75
  56. package/dist/core/claude-config.js +0 -91
  57. package/dist/core/cursor-config.js +0 -130
  58. package/dist/core/downloader.js +0 -64
  59. package/dist/core/filesystem.js +0 -124
  60. package/dist/core/lockfile.js +0 -239
  61. package/dist/core/marketplace-converter.js +0 -198
  62. package/dist/core/registry-client.js +0 -265
  63. package/dist/core/schema-validator.js +0 -74
  64. package/dist/core/telemetry.js +0 -175
  65. package/dist/core/user-config.js +0 -79
  66. package/dist/types/registry.js +0 -5
  67. package/dist/types.js +0 -5
@@ -1,281 +0,0 @@
1
- "use strict";
2
- /**
3
- * Login command implementation
4
- */
5
- var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
6
- if (k2 === undefined) k2 = k;
7
- var desc = Object.getOwnPropertyDescriptor(m, k);
8
- if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
9
- desc = { enumerable: true, get: function() { return m[k]; } };
10
- }
11
- Object.defineProperty(o, k2, desc);
12
- }) : (function(o, m, k, k2) {
13
- if (k2 === undefined) k2 = k;
14
- o[k2] = m[k];
15
- }));
16
- var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
17
- Object.defineProperty(o, "default", { enumerable: true, value: v });
18
- }) : function(o, v) {
19
- o["default"] = v;
20
- });
21
- var __importStar = (this && this.__importStar) || (function () {
22
- var ownKeys = function(o) {
23
- ownKeys = Object.getOwnPropertyNames || function (o) {
24
- var ar = [];
25
- for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
26
- return ar;
27
- };
28
- return ownKeys(o);
29
- };
30
- return function (mod) {
31
- if (mod && mod.__esModule) return mod;
32
- var result = {};
33
- if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
34
- __setModuleDefault(result, mod);
35
- return result;
36
- };
37
- })();
38
- Object.defineProperty(exports, "__esModule", { value: true });
39
- exports.handleLogin = handleLogin;
40
- exports.createLoginCommand = createLoginCommand;
41
- const commander_1 = require("commander");
42
- const http_1 = require("http");
43
- const telemetry_1 = require("../core/telemetry");
44
- const user_config_1 = require("../core/user-config");
45
- /**
46
- * Start OAuth callback server
47
- */
48
- function startCallbackServer() {
49
- return new Promise((resolve, reject) => {
50
- const server = (0, http_1.createServer)((req, res) => {
51
- const url = new URL(req.url || '', 'http://localhost:8765');
52
- if (url.pathname === '/callback') {
53
- const token = url.searchParams.get('token') || undefined;
54
- const username = url.searchParams.get('username') || undefined;
55
- const error = url.searchParams.get('error') || undefined;
56
- if (error) {
57
- res.writeHead(400, { 'Content-Type': 'text/html' });
58
- res.end(`
59
- <html>
60
- <body>
61
- <h1>āŒ Authentication Failed</h1>
62
- <p>Error: ${error}</p>
63
- <p>You can close this window.</p>
64
- </body>
65
- </html>
66
- `);
67
- server.close();
68
- reject(new Error(`OAuth error: ${error}`));
69
- return;
70
- }
71
- if (token) {
72
- res.writeHead(200, { 'Content-Type': 'text/html' });
73
- res.end(`
74
- <html>
75
- <body>
76
- <h1>āœ… Authentication Successful!</h1>
77
- <p>You can close this window and return to your terminal.</p>
78
- </body>
79
- </html>
80
- `);
81
- server.close();
82
- resolve({ token, username });
83
- }
84
- else {
85
- res.writeHead(400, { 'Content-Type': 'text/html' });
86
- res.end(`
87
- <html>
88
- <body>
89
- <h1>āŒ Invalid Request</h1>
90
- <p>No token received from authentication.</p>
91
- </body>
92
- </html>
93
- `);
94
- server.close();
95
- reject(new Error('No token received'));
96
- }
97
- }
98
- });
99
- server.listen(8765, () => {
100
- console.log(' Waiting for authentication...');
101
- });
102
- // Timeout after 5 minutes
103
- setTimeout(() => {
104
- server.close();
105
- reject(new Error('Authentication timeout'));
106
- }, 5 * 60 * 1000);
107
- });
108
- }
109
- /**
110
- * Login with GitHub OAuth via Nango connect link
111
- */
112
- async function loginWithOAuth(registryUrl) {
113
- console.log('\nšŸ” Opening browser for GitHub authentication...\n');
114
- // Generate a unique user ID for this CLI session
115
- const userId = `cli_${Date.now()}_${Math.random().toString(36).substr(2, 9)}`;
116
- try {
117
- // Get the Nango connect session from the registry
118
- const response = await fetch(`${registryUrl}/api/v1/auth/nango/cli/connect-session`, {
119
- method: 'POST',
120
- headers: {
121
- 'Content-Type': 'application/json',
122
- },
123
- body: JSON.stringify({
124
- userId,
125
- email: 'cli@example.com',
126
- displayName: 'CLI User',
127
- }),
128
- });
129
- if (!response.ok) {
130
- throw new Error('Failed to get authentication session');
131
- }
132
- const responseData = await response.json();
133
- const { connectSessionToken } = responseData;
134
- if (!connectSessionToken) {
135
- console.error('āŒ No session token received from server');
136
- console.error(' Response data:', JSON.stringify(responseData, null, 2));
137
- throw new Error('No session token received from server. Please check your Nango configuration.');
138
- }
139
- // Create the CLI auth URL with session token, callback, and userId
140
- const callbackUrl = 'http://localhost:8765/callback';
141
- const webappUrl = registryUrl.replace('registry', 'webapp').replace(':3000', ':5173');
142
- const authUrl = `${webappUrl}/cli-auth?sessionToken=${encodeURIComponent(connectSessionToken)}&cliCallback=${encodeURIComponent(callbackUrl)}&userId=${encodeURIComponent(userId)}`;
143
- console.log(` Please open this link in your browser to authenticate:`);
144
- console.log(` ${authUrl}\n`);
145
- // Try to open browser
146
- const { exec } = await Promise.resolve().then(() => __importStar(require('child_process')));
147
- const platform = process.platform;
148
- const cmd = platform === 'darwin' ? 'open' : platform === 'win32' ? 'start' : 'xdg-open';
149
- exec(`${cmd} "${authUrl}"`);
150
- // Poll for authentication completion
151
- console.log(' Waiting for authentication...\n');
152
- const result = await pollForAuthentication(registryUrl, userId);
153
- if (!result.token) {
154
- throw new Error('No token received from authentication');
155
- }
156
- return { token: result.token, username: result.username || 'unknown' };
157
- }
158
- catch (error) {
159
- throw new Error(`Authentication failed: ${error instanceof Error ? error.message : 'Unknown error'}`);
160
- }
161
- }
162
- /**
163
- * Poll for authentication completion
164
- */
165
- async function pollForAuthentication(registryUrl, userId) {
166
- const maxAttempts = 60; // 5 minutes with 5-second intervals
167
- let attempts = 0;
168
- while (attempts < maxAttempts) {
169
- try {
170
- const response = await fetch(`${registryUrl}/api/v1/auth/nango/cli/status/${userId}`);
171
- if (response.ok) {
172
- const { authenticated, connectionId } = await response.json();
173
- if (authenticated && connectionId) {
174
- // Authentication completed, get the JWT token
175
- const callbackResponse = await fetch(`${registryUrl}/api/v1/auth/nango/callback`, {
176
- method: 'POST',
177
- headers: {
178
- 'Content-Type': 'application/json',
179
- },
180
- body: JSON.stringify({
181
- connectionId,
182
- redirectUrl: '/cli-success',
183
- }),
184
- });
185
- if (callbackResponse.ok) {
186
- const result = await callbackResponse.json();
187
- return {
188
- token: result.token,
189
- username: result.username,
190
- };
191
- }
192
- }
193
- }
194
- }
195
- catch (error) {
196
- // Ignore polling errors and continue
197
- }
198
- // Wait 5 seconds before next attempt
199
- await new Promise(resolve => setTimeout(resolve, 5000));
200
- attempts++;
201
- }
202
- throw new Error('Authentication timeout - please try again');
203
- }
204
- /**
205
- * Login with manual token
206
- */
207
- async function loginWithToken(token, registryUrl) {
208
- // Verify token by making a request to /api/v1/user
209
- const response = await fetch(`${registryUrl}/api/v1/user`, {
210
- headers: {
211
- 'Authorization': `Bearer ${token}`,
212
- },
213
- });
214
- if (!response.ok) {
215
- throw new Error('Invalid token');
216
- }
217
- const user = await response.json();
218
- return { token, username: user.username };
219
- }
220
- /**
221
- * Handle login command
222
- */
223
- async function handleLogin(options) {
224
- const startTime = Date.now();
225
- let success = false;
226
- let error;
227
- try {
228
- const config = await (0, user_config_1.getConfig)();
229
- const registryUrl = config.registryUrl || 'https://registry.prpm.dev';
230
- console.log('šŸ”‘ PRMP Login\n');
231
- let result;
232
- if (options.token) {
233
- // Manual token login
234
- console.log('šŸ” Logging in with provided token...\n');
235
- result = await loginWithToken(options.token, registryUrl);
236
- }
237
- else {
238
- // OAuth login
239
- result = await loginWithOAuth(registryUrl);
240
- }
241
- // Save token to config
242
- await (0, user_config_1.saveConfig)({
243
- ...config,
244
- token: result.token,
245
- username: result.username,
246
- });
247
- console.log('āœ… Successfully logged in!\n');
248
- console.log(` Username: ${result.username}`);
249
- console.log(` Registry: ${registryUrl}\n`);
250
- console.log('šŸ’” You can now publish packages with "prpm publish"\n');
251
- success = true;
252
- }
253
- catch (err) {
254
- error = err instanceof Error ? err.message : String(err);
255
- console.error(`\nāŒ Login failed: ${error}\n`);
256
- console.error('šŸ’” Try again or use "prpm login --token YOUR_TOKEN"\n');
257
- process.exit(1);
258
- }
259
- finally {
260
- // Track telemetry
261
- await telemetry_1.telemetry.track({
262
- command: 'login',
263
- success,
264
- error,
265
- duration: Date.now() - startTime,
266
- data: {
267
- method: options.token ? 'token' : 'oauth',
268
- },
269
- });
270
- await telemetry_1.telemetry.shutdown();
271
- }
272
- }
273
- /**
274
- * Create the login command
275
- */
276
- function createLoginCommand() {
277
- return new commander_1.Command('login')
278
- .description('Login to the PRMP registry')
279
- .option('--token <token>', 'Login with a personal access token')
280
- .action(handleLogin);
281
- }
@@ -1,128 +0,0 @@
1
- "use strict";
2
- /**
3
- * Outdated command - Check for package updates
4
- */
5
- Object.defineProperty(exports, "__esModule", { value: true });
6
- exports.handleOutdated = handleOutdated;
7
- exports.createOutdatedCommand = createOutdatedCommand;
8
- const commander_1 = require("commander");
9
- const registry_client_1 = require("@pr-pm/registry-client");
10
- const user_config_1 = require("../core/user-config");
11
- const lockfile_1 = require("../core/lockfile");
12
- const telemetry_1 = require("../core/telemetry");
13
- /**
14
- * Check for outdated packages
15
- */
16
- async function handleOutdated() {
17
- const startTime = Date.now();
18
- let success = false;
19
- let error;
20
- try {
21
- console.log('šŸ” Checking for package updates...\n');
22
- const config = await (0, user_config_1.getConfig)();
23
- const client = (0, registry_client_1.getRegistryClient)(config);
24
- const installedPackages = await (0, lockfile_1.listPackages)();
25
- if (installedPackages.length === 0) {
26
- console.log('No packages installed.');
27
- success = true;
28
- return;
29
- }
30
- const outdated = [];
31
- for (const pkg of installedPackages) {
32
- try {
33
- // Get package info from registry
34
- const registryPkg = await client.getPackage(pkg.id);
35
- if (!registryPkg.latest_version || !pkg.version) {
36
- continue;
37
- }
38
- const currentVersion = pkg.version;
39
- const latestVersion = registryPkg.latest_version.version;
40
- // Check if update available
41
- if (currentVersion !== latestVersion) {
42
- const updateType = getUpdateType(currentVersion, latestVersion);
43
- outdated.push({
44
- id: pkg.id,
45
- current: currentVersion,
46
- latest: latestVersion,
47
- type: updateType,
48
- });
49
- }
50
- }
51
- catch (err) {
52
- // Skip packages that can't be found in registry
53
- continue;
54
- }
55
- }
56
- if (outdated.length === 0) {
57
- console.log('āœ… All packages are up to date!\n');
58
- success = true;
59
- return;
60
- }
61
- // Display outdated packages
62
- console.log(`šŸ“¦ ${outdated.length} package(s) have updates available:\n`);
63
- // Group by update type
64
- const major = outdated.filter(p => p.type === 'major');
65
- const minor = outdated.filter(p => p.type === 'minor');
66
- const patch = outdated.filter(p => p.type === 'patch');
67
- if (major.length > 0) {
68
- console.log('šŸ”“ Major Updates (breaking changes possible):');
69
- major.forEach(pkg => {
70
- console.log(` ${pkg.id.padEnd(30)} ${pkg.current} → ${pkg.latest}`);
71
- });
72
- console.log('');
73
- }
74
- if (minor.length > 0) {
75
- console.log('🟔 Minor Updates (new features):');
76
- minor.forEach(pkg => {
77
- console.log(` ${pkg.id.padEnd(30)} ${pkg.current} → ${pkg.latest}`);
78
- });
79
- console.log('');
80
- }
81
- if (patch.length > 0) {
82
- console.log('🟢 Patch Updates (bug fixes):');
83
- patch.forEach(pkg => {
84
- console.log(` ${pkg.id.padEnd(30)} ${pkg.current} → ${pkg.latest}`);
85
- });
86
- console.log('');
87
- }
88
- console.log('šŸ’” Run "prpm update" to update to latest minor/patch versions');
89
- console.log('šŸ’” Run "prpm upgrade" to upgrade to latest major versions\n');
90
- success = true;
91
- }
92
- catch (err) {
93
- error = err instanceof Error ? err.message : String(err);
94
- console.error(`\nāŒ Failed to check for updates: ${error}`);
95
- process.exit(1);
96
- }
97
- finally {
98
- await telemetry_1.telemetry.track({
99
- command: 'outdated',
100
- success,
101
- error,
102
- duration: Date.now() - startTime,
103
- });
104
- await telemetry_1.telemetry.shutdown();
105
- }
106
- }
107
- /**
108
- * Determine update type based on semver
109
- */
110
- function getUpdateType(current, latest) {
111
- const currentParts = current.split('.').map(Number);
112
- const latestParts = latest.split('.').map(Number);
113
- const [currMajor = 0, currMinor = 0, currPatch = 0] = currentParts;
114
- const [latestMajor = 0, latestMinor = 0, latestPatch = 0] = latestParts;
115
- if (latestMajor > currMajor)
116
- return 'major';
117
- if (latestMinor > currMinor)
118
- return 'minor';
119
- return 'patch';
120
- }
121
- /**
122
- * Create the outdated command
123
- */
124
- function createOutdatedCommand() {
125
- return new commander_1.Command('outdated')
126
- .description('Check for package updates')
127
- .action(handleOutdated);
128
- }
@@ -1,27 +0,0 @@
1
- "use strict";
2
- /**
3
- * Popular packages command implementation
4
- * Shows all-time popular packages (delegates to trending)
5
- */
6
- Object.defineProperty(exports, "__esModule", { value: true });
7
- exports.handlePopular = handlePopular;
8
- exports.createPopularCommand = createPopularCommand;
9
- const commander_1 = require("commander");
10
- const trending_1 = require("./trending");
11
- /**
12
- * Show popular packages (wrapper around trending)
13
- */
14
- async function handlePopular(options) {
15
- // Delegate to trending command
16
- console.log('šŸ“Š Popular Packages (All Time)\n');
17
- await (0, trending_1.handleTrending)({ type: options.type });
18
- }
19
- /**
20
- * Create the popular command
21
- */
22
- function createPopularCommand() {
23
- return new commander_1.Command('popular')
24
- .description('Show popular packages (all time)')
25
- .option('-t, --type <type>', 'Filter by package type (cursor, claude, continue, windsurf)')
26
- .action(handlePopular);
27
- }