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.
- package/README.md +90 -862
- package/dist/index.js +23233 -65
- package/dist/schemas/agents-md.schema.json +24 -0
- package/dist/schemas/aider.schema.json +24 -0
- package/dist/schemas/canonical.schema.json +435 -0
- package/dist/schemas/claude-agent.schema.json +62 -0
- package/dist/schemas/claude-hook.schema.json +70 -0
- package/dist/schemas/claude-plugin.schema.json +122 -0
- package/dist/schemas/claude-skill.schema.json +51 -0
- package/dist/schemas/claude-slash-command.schema.json +77 -0
- package/dist/schemas/claude.schema.json +52 -0
- package/dist/schemas/continue.schema.json +98 -0
- package/dist/schemas/copilot.schema.json +76 -0
- package/dist/schemas/cursor-command.schema.json +27 -0
- package/dist/schemas/cursor-hooks.schema.json +59 -0
- package/dist/schemas/cursor.schema.json +74 -0
- package/dist/schemas/droid-hook.schema.json +103 -0
- package/dist/schemas/droid-skill.schema.json +46 -0
- package/dist/schemas/droid-slash-command.schema.json +53 -0
- package/dist/schemas/droid.schema.json +46 -0
- package/dist/schemas/format-registry.schema.json +99 -0
- package/dist/schemas/gemini-md.schema.json +24 -0
- package/dist/schemas/gemini.schema.json +30 -0
- package/dist/schemas/kiro-agent.schema.json +146 -0
- package/dist/schemas/kiro-hook.schema.json +120 -0
- package/dist/schemas/kiro-steering.schema.json +74 -0
- package/dist/schemas/mcp-server.schema.json +130 -0
- package/dist/schemas/opencode-slash-command.schema.json +60 -0
- package/dist/schemas/opencode.schema.json +111 -0
- package/dist/schemas/prpm-manifest.schema.json +733 -0
- package/dist/schemas/replit.schema.json +21 -0
- package/dist/schemas/ruler.schema.json +22 -0
- package/dist/schemas/trae.schema.json +24 -0
- package/dist/schemas/windsurf.schema.json +22 -0
- package/dist/schemas/zencoder.schema.json +51 -0
- package/package.json +20 -14
- package/schemas/prpm-manifest.schema.json +465 -39
- package/dist/__tests__/e2e/test-helpers.js +0 -150
- package/dist/commands/collections.js +0 -606
- package/dist/commands/index.js +0 -186
- package/dist/commands/info.js +0 -82
- package/dist/commands/install.js +0 -477
- package/dist/commands/list.js +0 -166
- package/dist/commands/login.js +0 -281
- package/dist/commands/outdated.js +0 -128
- package/dist/commands/popular.js +0 -27
- package/dist/commands/publish.js +0 -274
- package/dist/commands/schema.js +0 -37
- package/dist/commands/search.js +0 -404
- package/dist/commands/telemetry.js +0 -103
- package/dist/commands/trending.js +0 -76
- package/dist/commands/uninstall.js +0 -77
- package/dist/commands/update.js +0 -121
- package/dist/commands/upgrade.js +0 -121
- package/dist/commands/whoami.js +0 -75
- package/dist/core/claude-config.js +0 -91
- package/dist/core/cursor-config.js +0 -130
- package/dist/core/downloader.js +0 -64
- package/dist/core/filesystem.js +0 -124
- package/dist/core/lockfile.js +0 -239
- package/dist/core/marketplace-converter.js +0 -198
- package/dist/core/registry-client.js +0 -265
- package/dist/core/schema-validator.js +0 -74
- package/dist/core/telemetry.js +0 -175
- package/dist/core/user-config.js +0 -79
- package/dist/types/registry.js +0 -5
- package/dist/types.js +0 -5
package/dist/commands/index.js
DELETED
|
@@ -1,186 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
/**
|
|
3
|
-
* Index command implementation
|
|
4
|
-
*/
|
|
5
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
6
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
7
|
-
};
|
|
8
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
9
|
-
exports.handleIndex = handleIndex;
|
|
10
|
-
exports.createIndexCommand = createIndexCommand;
|
|
11
|
-
const commander_1 = require("commander");
|
|
12
|
-
const fs_1 = require("fs");
|
|
13
|
-
const path_1 = __importDefault(require("path"));
|
|
14
|
-
const lockfile_1 = require("../core/lockfile");
|
|
15
|
-
const filesystem_1 = require("../core/filesystem");
|
|
16
|
-
/**
|
|
17
|
-
* Scan directory for files and return file information
|
|
18
|
-
* Recursively scans subdirectories for Claude skills/agents
|
|
19
|
-
*/
|
|
20
|
-
async function scanDirectory(dirPath, type) {
|
|
21
|
-
try {
|
|
22
|
-
const files = await fs_1.promises.readdir(dirPath, { withFileTypes: true });
|
|
23
|
-
const results = [];
|
|
24
|
-
for (const file of files) {
|
|
25
|
-
const fullPath = path_1.default.join(dirPath, file.name);
|
|
26
|
-
if (file.isFile()) {
|
|
27
|
-
// Direct file in the directory
|
|
28
|
-
const id = (0, filesystem_1.generateId)(file.name);
|
|
29
|
-
results.push({
|
|
30
|
-
filePath: fullPath,
|
|
31
|
-
filename: file.name,
|
|
32
|
-
id
|
|
33
|
-
});
|
|
34
|
-
}
|
|
35
|
-
else if (file.isDirectory()) {
|
|
36
|
-
// For Claude/Cursor skills/agents, scan subdirectories for structured packages
|
|
37
|
-
const isClaudeType = type === 'claude-skill' || type === 'claude-agent' || type === 'claude';
|
|
38
|
-
const isCursorAgent = type === 'cursor-agent';
|
|
39
|
-
if (isClaudeType || isCursorAgent) {
|
|
40
|
-
try {
|
|
41
|
-
const subFiles = await fs_1.promises.readdir(fullPath, { withFileTypes: true });
|
|
42
|
-
for (const subFile of subFiles) {
|
|
43
|
-
const isValidFile = subFile.isFile() && (subFile.name === 'SKILL.md' ||
|
|
44
|
-
subFile.name === 'AGENT.md' ||
|
|
45
|
-
subFile.name === 'skill.md' ||
|
|
46
|
-
subFile.name === 'agent.md');
|
|
47
|
-
if (isValidFile) {
|
|
48
|
-
const subFilePath = path_1.default.join(fullPath, subFile.name);
|
|
49
|
-
const id = file.name; // Use directory name as package ID
|
|
50
|
-
results.push({
|
|
51
|
-
filePath: subFilePath,
|
|
52
|
-
filename: `${file.name}/${subFile.name}`,
|
|
53
|
-
id
|
|
54
|
-
});
|
|
55
|
-
}
|
|
56
|
-
}
|
|
57
|
-
}
|
|
58
|
-
catch {
|
|
59
|
-
// Subdirectory can't be read, skip it
|
|
60
|
-
}
|
|
61
|
-
}
|
|
62
|
-
}
|
|
63
|
-
}
|
|
64
|
-
return results;
|
|
65
|
-
}
|
|
66
|
-
catch (error) {
|
|
67
|
-
// Directory doesn't exist or can't be read
|
|
68
|
-
return [];
|
|
69
|
-
}
|
|
70
|
-
}
|
|
71
|
-
/**
|
|
72
|
-
* Check if a package is already registered
|
|
73
|
-
*/
|
|
74
|
-
function isPackageRegistered(packages, id) {
|
|
75
|
-
return packages.some(pkg => pkg.id === id);
|
|
76
|
-
}
|
|
77
|
-
/**
|
|
78
|
-
* Handle the index command
|
|
79
|
-
*/
|
|
80
|
-
async function handleIndex(options = {}) {
|
|
81
|
-
try {
|
|
82
|
-
console.log('🔍 Scanning AI editor directories for prompt files...\n');
|
|
83
|
-
// Get currently registered packages
|
|
84
|
-
const existingPackages = await (0, lockfile_1.listPackages)();
|
|
85
|
-
if (options.verbose) {
|
|
86
|
-
console.log(`📋 Currently registered: ${existingPackages.length} packages\n`);
|
|
87
|
-
}
|
|
88
|
-
let totalFound = 0;
|
|
89
|
-
let totalAdded = 0;
|
|
90
|
-
const summary = [];
|
|
91
|
-
// Define directories to scan with their types
|
|
92
|
-
const dirsToScan = [
|
|
93
|
-
{ path: '.cursor/rules', type: 'cursor', label: 'Cursor Rules' },
|
|
94
|
-
{ path: '.cursor/agents', type: 'cursor-agent', label: 'Cursor Agents' },
|
|
95
|
-
{ path: '.cursor/commands', type: 'cursor-slash-command', label: 'Cursor Slash Commands' },
|
|
96
|
-
{ path: '.claude/agents', type: 'claude-agent', label: 'Claude Agents' },
|
|
97
|
-
{ path: '.claude/skills', type: 'claude-skill', label: 'Claude Skills' },
|
|
98
|
-
{ path: '.claude/commands', type: 'claude-slash-command', label: 'Claude Slash Commands' },
|
|
99
|
-
{ path: '.continue/rules', type: 'continue', label: 'Continue Rules' },
|
|
100
|
-
{ path: '.windsurf/rules', type: 'windsurf', label: 'Windsurf Rules' },
|
|
101
|
-
{ path: '.prompts', type: 'generic', label: 'Generic Prompts' },
|
|
102
|
-
{ path: '.mcp', type: 'mcp', label: 'MCP Servers' },
|
|
103
|
-
];
|
|
104
|
-
// Scan each directory
|
|
105
|
-
for (const dir of dirsToScan) {
|
|
106
|
-
const files = await scanDirectory(dir.path, dir.type);
|
|
107
|
-
if (files.length === 0) {
|
|
108
|
-
if (options.verbose) {
|
|
109
|
-
console.log(`📁 ${dir.path}/ - No files found`);
|
|
110
|
-
}
|
|
111
|
-
continue;
|
|
112
|
-
}
|
|
113
|
-
console.log(`📁 ${dir.path}/ (${dir.label}) - Found ${files.length} file(s)`);
|
|
114
|
-
let dirAdded = 0;
|
|
115
|
-
totalFound += files.length;
|
|
116
|
-
for (const file of files) {
|
|
117
|
-
if (!isPackageRegistered(existingPackages, file.id)) {
|
|
118
|
-
await (0, lockfile_1.addPackage)({
|
|
119
|
-
id: file.id,
|
|
120
|
-
version: '0.0.0', // Local files don't have versions
|
|
121
|
-
tarballUrl: `file://${path_1.default.resolve(file.filePath)}`,
|
|
122
|
-
type: dir.type,
|
|
123
|
-
format: dir.type,
|
|
124
|
-
});
|
|
125
|
-
if (options.verbose) {
|
|
126
|
-
console.log(` ✅ Added: ${file.filename} (${file.id})`);
|
|
127
|
-
}
|
|
128
|
-
totalAdded++;
|
|
129
|
-
dirAdded++;
|
|
130
|
-
}
|
|
131
|
-
else if (options.verbose) {
|
|
132
|
-
console.log(` ⏭️ Skipped: ${file.filename} (already registered)`);
|
|
133
|
-
}
|
|
134
|
-
}
|
|
135
|
-
if (dirAdded > 0) {
|
|
136
|
-
console.log(` ➕ Added ${dirAdded} new package(s)\n`);
|
|
137
|
-
}
|
|
138
|
-
else if (!options.verbose) {
|
|
139
|
-
console.log(` ✓ All files already registered\n`);
|
|
140
|
-
}
|
|
141
|
-
summary.push({ dir: dir.path, found: files.length, added: dirAdded });
|
|
142
|
-
}
|
|
143
|
-
// Summary
|
|
144
|
-
console.log('━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━');
|
|
145
|
-
console.log('📊 Index Summary\n');
|
|
146
|
-
console.log(` 📁 Total files found: ${totalFound}`);
|
|
147
|
-
console.log(` ➕ New packages added: ${totalAdded}`);
|
|
148
|
-
console.log(` ⏭️ Already registered: ${totalFound - totalAdded}`);
|
|
149
|
-
if (options.verbose && summary.length > 0) {
|
|
150
|
-
console.log('\n Breakdown by directory:');
|
|
151
|
-
summary.filter(s => s.found > 0).forEach(s => {
|
|
152
|
-
console.log(` ${s.dir}: ${s.found} found, ${s.added} added`);
|
|
153
|
-
});
|
|
154
|
-
}
|
|
155
|
-
console.log('━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━');
|
|
156
|
-
if (totalAdded > 0) {
|
|
157
|
-
console.log(`\n✅ Successfully indexed ${totalAdded} new package(s)`);
|
|
158
|
-
console.log(' Run `prpm list` to see all registered packages');
|
|
159
|
-
}
|
|
160
|
-
else if (totalFound > 0) {
|
|
161
|
-
console.log('\n✨ All existing files are already registered');
|
|
162
|
-
}
|
|
163
|
-
else {
|
|
164
|
-
console.log('\n💡 No prompt files found in standard directories');
|
|
165
|
-
console.log(' Install packages with: prpm install <package-name>');
|
|
166
|
-
}
|
|
167
|
-
}
|
|
168
|
-
catch (error) {
|
|
169
|
-
console.error(`❌ Failed to index packages: ${error}`);
|
|
170
|
-
process.exit(1);
|
|
171
|
-
}
|
|
172
|
-
finally {
|
|
173
|
-
process.exit(0);
|
|
174
|
-
}
|
|
175
|
-
}
|
|
176
|
-
/**
|
|
177
|
-
* Create the index command
|
|
178
|
-
*/
|
|
179
|
-
function createIndexCommand() {
|
|
180
|
-
const command = new commander_1.Command('index');
|
|
181
|
-
command
|
|
182
|
-
.description('Scan AI editor directories and register untracked prompt files in prpm-lock.json')
|
|
183
|
-
.option('-v, --verbose', 'Show detailed output for each file scanned')
|
|
184
|
-
.action(handleIndex);
|
|
185
|
-
return command;
|
|
186
|
-
}
|
package/dist/commands/info.js
DELETED
|
@@ -1,82 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
/**
|
|
3
|
-
* Info command - Display detailed package information
|
|
4
|
-
*/
|
|
5
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.handleInfo = handleInfo;
|
|
7
|
-
exports.createInfoCommand = createInfoCommand;
|
|
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 telemetry_1 = require("../core/telemetry");
|
|
12
|
-
async function handleInfo(packageName) {
|
|
13
|
-
const startTime = Date.now();
|
|
14
|
-
let success = false;
|
|
15
|
-
let error;
|
|
16
|
-
try {
|
|
17
|
-
console.log(`📦 Fetching package info for "${packageName}"...`);
|
|
18
|
-
const config = await (0, user_config_1.getConfig)();
|
|
19
|
-
const client = (0, registry_client_1.getRegistryClient)(config);
|
|
20
|
-
const pkg = await client.getPackage(packageName);
|
|
21
|
-
console.log('\n' + '='.repeat(60));
|
|
22
|
-
console.log(` ${pkg.name} ${pkg.verified ? '✓ Verified' : ''}`);
|
|
23
|
-
console.log('='.repeat(60));
|
|
24
|
-
// Description
|
|
25
|
-
if (pkg.description) {
|
|
26
|
-
console.log(`\n📝 ${pkg.description}`);
|
|
27
|
-
}
|
|
28
|
-
// Stats
|
|
29
|
-
console.log('\n📊 Stats:');
|
|
30
|
-
console.log(` Downloads: ${pkg.total_downloads.toLocaleString()}`);
|
|
31
|
-
if (pkg.rating_average) {
|
|
32
|
-
console.log(` Rating: ${'⭐'.repeat(Math.round(pkg.rating_average))} (${pkg.rating_average.toFixed(1)}/5)`);
|
|
33
|
-
}
|
|
34
|
-
// Latest version
|
|
35
|
-
if (pkg.latest_version) {
|
|
36
|
-
console.log(`\n🏷️ Latest Version: ${pkg.latest_version.version}`);
|
|
37
|
-
}
|
|
38
|
-
// Tags
|
|
39
|
-
if (pkg.tags && pkg.tags.length > 0) {
|
|
40
|
-
console.log(`\n🏷️ Tags: ${pkg.tags.join(', ')}`);
|
|
41
|
-
}
|
|
42
|
-
// Type
|
|
43
|
-
console.log(`\n📂 Type: ${pkg.type}`);
|
|
44
|
-
// Installation
|
|
45
|
-
console.log('\n💻 Installation:');
|
|
46
|
-
console.log(` prpm install ${pkg.name}`);
|
|
47
|
-
console.log(` prpm install ${pkg.name}@${pkg.latest_version?.version || 'latest'}`);
|
|
48
|
-
console.log('\n' + '='.repeat(60));
|
|
49
|
-
success = true;
|
|
50
|
-
}
|
|
51
|
-
catch (err) {
|
|
52
|
-
error = err instanceof Error ? err.message : String(err);
|
|
53
|
-
console.error(`\n❌ Failed to fetch package info: ${error}`);
|
|
54
|
-
console.log(`\n💡 Tips:`);
|
|
55
|
-
console.log(` - Check the package ID spelling`);
|
|
56
|
-
console.log(` - Search for packages: prpm search <query>`);
|
|
57
|
-
console.log(` - View trending: prpm trending`);
|
|
58
|
-
process.exit(1);
|
|
59
|
-
}
|
|
60
|
-
finally {
|
|
61
|
-
await telemetry_1.telemetry.track({
|
|
62
|
-
command: 'info',
|
|
63
|
-
success,
|
|
64
|
-
error,
|
|
65
|
-
duration: Date.now() - startTime,
|
|
66
|
-
data: {
|
|
67
|
-
packageName,
|
|
68
|
-
},
|
|
69
|
-
});
|
|
70
|
-
await telemetry_1.telemetry.shutdown();
|
|
71
|
-
}
|
|
72
|
-
}
|
|
73
|
-
function createInfoCommand() {
|
|
74
|
-
const command = new commander_1.Command('info');
|
|
75
|
-
command
|
|
76
|
-
.description('Display detailed package information')
|
|
77
|
-
.argument('<package>', 'Package ID to get information about')
|
|
78
|
-
.action(async (packageId) => {
|
|
79
|
-
await handleInfo(packageId);
|
|
80
|
-
});
|
|
81
|
-
return command;
|
|
82
|
-
}
|