promptgraph-mcp 2.9.9 → 2.9.10
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 +27 -0
- package/index.js +9 -1
- package/marketplace.js +14 -2
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -9,6 +9,33 @@ Instead of loading every `.md` skill into context, Claude calls `pg_search` and
|
|
|
9
9
|
|
|
10
10
|
---
|
|
11
11
|
|
|
12
|
+
## Installation
|
|
13
|
+
|
|
14
|
+
**Requirements:** Node.js 18+ — [nodejs.org](https://nodejs.org)
|
|
15
|
+
|
|
16
|
+
```bash
|
|
17
|
+
npm install -g promptgraph-mcp@latest
|
|
18
|
+
```
|
|
19
|
+
|
|
20
|
+
Check version:
|
|
21
|
+
```bash
|
|
22
|
+
pg --version
|
|
23
|
+
```
|
|
24
|
+
|
|
25
|
+
Update to latest:
|
|
26
|
+
```bash
|
|
27
|
+
pg update
|
|
28
|
+
# or
|
|
29
|
+
npm install -g promptgraph-mcp@latest
|
|
30
|
+
```
|
|
31
|
+
|
|
32
|
+
Uninstall:
|
|
33
|
+
```bash
|
|
34
|
+
npm uninstall -g promptgraph-mcp
|
|
35
|
+
```
|
|
36
|
+
|
|
37
|
+
---
|
|
38
|
+
|
|
12
39
|
## Quick Start
|
|
13
40
|
|
|
14
41
|
```bash
|
package/index.js
CHANGED
|
@@ -18,7 +18,7 @@ const args = process.argv.slice(2);
|
|
|
18
18
|
const rawBin = process.argv[1]?.split(/[\\/]/).pop()?.replace(/\.js$/, '');
|
|
19
19
|
const bin = (rawBin && rawBin !== 'index') ? rawBin : 'pg';
|
|
20
20
|
|
|
21
|
-
const KNOWN_COMMANDS = new Set(['init', 'reindex', 'update', 'import', 'install', 'setup', 'validate', 'marketplace', 'doctor', 'search', 'help', '--help', '-h', 'bundle', 'status', 'train']);
|
|
21
|
+
const KNOWN_COMMANDS = new Set(['init', 'reindex', 'update', 'import', 'install', 'setup', 'validate', 'marketplace', 'doctor', 'search', 'help', '--help', '-h', '--version', '-v', 'version', 'bundle', 'status', 'train']);
|
|
22
22
|
|
|
23
23
|
function showHelp() {
|
|
24
24
|
console.log(
|
|
@@ -57,6 +57,14 @@ if (args[0] === 'help' || args[0] === '--help' || args[0] === '-h') {
|
|
|
57
57
|
process.exit(0);
|
|
58
58
|
}
|
|
59
59
|
|
|
60
|
+
// Version flag
|
|
61
|
+
if (args[0] === '--version' || args[0] === '-v' || args[0] === 'version') {
|
|
62
|
+
const { createRequire } = await import('module');
|
|
63
|
+
const _pkg = createRequire(import.meta.url)('./package.json');
|
|
64
|
+
console.log(_pkg.version);
|
|
65
|
+
process.exit(0);
|
|
66
|
+
}
|
|
67
|
+
|
|
60
68
|
// No args: if launched from an interactive terminal, show help.
|
|
61
69
|
// If stdin is a pipe (i.e. an MCP client like Claude), fall through and
|
|
62
70
|
// start the server — NEVER print to stdout here, it corrupts JSON-RPC.
|
package/marketplace.js
CHANGED
|
@@ -359,9 +359,21 @@ async function _findBundle(bundleId) {
|
|
|
359
359
|
const text = await fetchText(REGISTRY_URL);
|
|
360
360
|
const registry = JSON.parse(text);
|
|
361
361
|
const q = String(bundleId).trim().toLowerCase();
|
|
362
|
+
const valid = (registry.bundles || []).filter(b => validateRegistryEntry(b).ok);
|
|
362
363
|
const validSkills = (registry.skills || []).filter(s => validateRegistryEntry(s).ok);
|
|
363
|
-
|
|
364
|
-
|
|
364
|
+
// 1. Exact match (code, id, name)
|
|
365
|
+
let bundle = valid.find(b =>
|
|
366
|
+
(b.code || codeFor(b.id)).toLowerCase() === q ||
|
|
367
|
+
b.id?.toLowerCase() === q ||
|
|
368
|
+
b.name?.toLowerCase() === q
|
|
369
|
+
);
|
|
370
|
+
// 2. Partial name/id match (starts with)
|
|
371
|
+
if (!bundle) bundle = valid.find(b =>
|
|
372
|
+
b.name?.toLowerCase().startsWith(q) || b.id?.toLowerCase().startsWith(q)
|
|
373
|
+
);
|
|
374
|
+
// 3. Contains match
|
|
375
|
+
if (!bundle) bundle = valid.find(b =>
|
|
376
|
+
b.name?.toLowerCase().includes(q) || b.id?.toLowerCase().includes(q)
|
|
365
377
|
);
|
|
366
378
|
if (!bundle) return { error: `No bundle matching "${bundleId}"` };
|
|
367
379
|
return { bundle, validSkills };
|