promptgraph-mcp 2.3.7 → 2.3.8
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/github-import.js +2 -1
- package/index.js +15 -0
- package/package.json +1 -1
package/github-import.js
CHANGED
|
@@ -33,7 +33,8 @@ function repoExists(ownerRepo) {
|
|
|
33
33
|
});
|
|
34
34
|
}
|
|
35
35
|
|
|
36
|
-
// Ask GitHub API which subdir to use (without cloning anything).
|
|
36
|
+
// Ask GitHub API which subdir to use (without cloning anything). Exported for validation.
|
|
37
|
+
export
|
|
37
38
|
// Returns { subdir, label } or null (use root).
|
|
38
39
|
async function detectSkillsDirFromAPI(ownerRepo) {
|
|
39
40
|
try {
|
package/index.js
CHANGED
|
@@ -449,6 +449,21 @@ if (args[0] === 'bundle') {
|
|
|
449
449
|
const repoArg = doPush ? args[2] : args[2];
|
|
450
450
|
if (!repoArg || !repoArg.includes('/')) { error('Usage: pg bundle add-repo <owner/repo> [--push]'); process.exit(1); }
|
|
451
451
|
const repo = repoArg.replace('https://github.com/', '').replace('.git', '');
|
|
452
|
+
|
|
453
|
+
// Validate repo has a skill subdirectory before publishing
|
|
454
|
+
const { detectSkillsDirFromAPI: _detectDir } = await import('./github-import.js');
|
|
455
|
+
process.stdout.write(chalk.gray(` Checking ${repo} for skill subdirectory... `));
|
|
456
|
+
const detected = await _detectDir(repo);
|
|
457
|
+
if (!detected) {
|
|
458
|
+
console.log(chalk.red('none found'));
|
|
459
|
+
error(
|
|
460
|
+
`Cannot publish: no skill subdirectory found in ${repo}\n` +
|
|
461
|
+
` Expected: skills/, prompts/, commands/, agents/, or any folder with .md files\n` +
|
|
462
|
+
` Visit: https://github.com/${repo}`
|
|
463
|
+
);
|
|
464
|
+
process.exit(1);
|
|
465
|
+
}
|
|
466
|
+
console.log(chalk.green(`found: ${detected.label}/`));
|
|
452
467
|
const name = repo.split('/')[1].replace(/-/g, ' ').replace(/\b\w/g, c => c.toUpperCase());
|
|
453
468
|
const id = repo.replace('/', '-').toLowerCase();
|
|
454
469
|
const bundle = {
|