prpm 0.1.13 → 0.1.14

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.
@@ -96,21 +96,20 @@ async function resolvePackageId(packageName) {
96
96
  if (uuidRegex.test(packageName)) {
97
97
  return packageName;
98
98
  }
99
- // Search for the package by name
99
+ // Look up package by name directly
100
100
  const config = await (0, user_config_1.getConfig)();
101
101
  const baseUrl = (config.registryUrl || "https://registry.prpm.dev").replace(/\/$/, '');
102
- const response = await fetch(`${baseUrl}/api/v1/search?q=${encodeURIComponent(packageName)}&limit=10`);
102
+ // URL encode the package name to handle scoped packages like @user/package
103
+ const encodedName = encodeURIComponent(packageName);
104
+ const response = await fetch(`${baseUrl}/api/v1/packages/${encodedName}`);
103
105
  if (!response.ok) {
104
- throw new Error(`Failed to search for package: ${response.statusText}`);
106
+ if (response.status === 404) {
107
+ throw new Error(`Package not found: ${packageName}`);
108
+ }
109
+ throw new Error(`Failed to fetch package: ${response.statusText}`);
105
110
  }
106
111
  const data = await response.json();
107
- // Find exact match
108
- const exactMatch = data.packages.find(pkg => pkg.name === packageName);
109
- if (exactMatch) {
110
- return exactMatch.id;
111
- }
112
- // If no exact match, throw error
113
- throw new Error(`Package not found: ${packageName}`);
112
+ return data.id;
114
113
  }
115
114
  /**
116
115
  * Execute a playground run
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "prpm",
3
- "version": "0.1.13",
3
+ "version": "0.1.14",
4
4
  "description": "Prompt Package Manager CLI - Install and manage prompt-based files",
5
5
  "main": "dist/index.js",
6
6
  "bin": {
@@ -45,8 +45,8 @@
45
45
  "license": "MIT",
46
46
  "dependencies": {
47
47
  "@octokit/rest": "^22.0.0",
48
- "@pr-pm/registry-client": "^1.3.11",
49
- "@pr-pm/types": "^0.2.12",
48
+ "@pr-pm/registry-client": "^1.3.12",
49
+ "@pr-pm/types": "^0.2.13",
50
50
  "ajv": "^8.17.1",
51
51
  "ajv-formats": "^3.0.1",
52
52
  "commander": "^11.1.0",