promptgraph-mcp 1.5.13 → 1.5.15
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/index.js +39 -18
- package/package.json +1 -1
package/index.js
CHANGED
|
@@ -104,31 +104,52 @@ if (args[0] === 'marketplace') {
|
|
|
104
104
|
}
|
|
105
105
|
|
|
106
106
|
const totalPages = Math.ceil(all.length / PER_PAGE);
|
|
107
|
-
const
|
|
107
|
+
const startIdx = (page - 1) * PER_PAGE;
|
|
108
|
+
const slice = all.slice(startIdx, startIdx + PER_PAGE);
|
|
109
|
+
const purple = chalk.hex('#7C3AED');
|
|
108
110
|
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
111
|
+
const wrap = (text, width, indent) => {
|
|
112
|
+
const words = (text || '').split(/\s+/);
|
|
113
|
+
const lines = [];
|
|
114
|
+
let line = '';
|
|
115
|
+
for (const w of words) {
|
|
116
|
+
if ((line + ' ' + w).trim().length > width) { lines.push(line.trim()); line = w; }
|
|
117
|
+
else line += ' ' + w;
|
|
118
|
+
}
|
|
119
|
+
if (line.trim()) lines.push(line.trim());
|
|
120
|
+
return lines.map(l => indent + chalk.gray(l)).join('\n');
|
|
121
|
+
};
|
|
122
|
+
|
|
123
|
+
console.log();
|
|
124
|
+
console.log(' ' + purple.bold('PromptGraph Marketplace'));
|
|
125
|
+
console.log(' ' + chalk.gray(`${all.length} skill${all.length === 1 ? '' : 's'} · page ${page}/${totalPages}`));
|
|
126
|
+
console.log(' ' + chalk.gray('─'.repeat(54)));
|
|
116
127
|
console.log();
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
128
|
+
|
|
129
|
+
slice.forEach((s, i) => {
|
|
130
|
+
const num = chalk.gray(String(startIdx + i + 1).padStart(2) + '.');
|
|
131
|
+
const stars = (s.stars > 0 ? chalk.yellow('★ ' + s.stars) : chalk.gray('★ 0'));
|
|
132
|
+
console.log(' ' + num + ' ' + chalk.white.bold(s.id) + ' ' + stars);
|
|
133
|
+
console.log(wrap(s.description, 64, ' '));
|
|
134
|
+
if (s.tags?.length) console.log(' ' + purple(s.tags.map(t => '#' + t).join(' ')));
|
|
135
|
+
console.log(' ' + chalk.gray('install: ') + chalk.cyan(`pg_marketplace_install("${s.id}")`));
|
|
136
|
+
console.log(' ' + chalk.gray('use: ') + chalk.cyan(`pg_search("${s.id}")`) + chalk.gray(' → read the file'));
|
|
122
137
|
console.log();
|
|
123
|
-
}
|
|
138
|
+
});
|
|
124
139
|
|
|
140
|
+
console.log(' ' + chalk.gray('─'.repeat(54)));
|
|
125
141
|
if (totalPages > 1) {
|
|
126
142
|
const nav = [];
|
|
127
|
-
if (page > 1) nav.push(`${bin} marketplace ${page - 1}`);
|
|
128
|
-
if (page < totalPages) nav.push(`${bin} marketplace ${page + 1}`);
|
|
129
|
-
console.log(
|
|
143
|
+
if (page > 1) nav.push(chalk.cyan(`${bin} marketplace ${page - 1}`) + chalk.gray(' ‹ prev'));
|
|
144
|
+
if (page < totalPages) nav.push(chalk.gray('next › ') + chalk.cyan(`${bin} marketplace ${page + 1}`));
|
|
145
|
+
console.log(' ' + nav.join(' '));
|
|
146
|
+
console.log();
|
|
130
147
|
}
|
|
131
|
-
console.log(
|
|
148
|
+
console.log(' ' + chalk.gray('These run through your AI assistant via the PromptGraph MCP server:'));
|
|
149
|
+
console.log(' ' + chalk.cyan('pg_marketplace_install') + chalk.gray(' install a skill ') + chalk.gray('(or /pg-fetch <id>)'));
|
|
150
|
+
console.log(' ' + chalk.cyan('pg_marketplace_publish') + chalk.gray(' share your own ') + chalk.gray('(or /pg-publish <file>)'));
|
|
151
|
+
console.log(' ' + chalk.cyan('pg_search') + chalk.gray(' find & apply any installed skill'));
|
|
152
|
+
console.log();
|
|
132
153
|
process.exit(0);
|
|
133
154
|
}
|
|
134
155
|
|