@agent-nexus/csreg 0.1.7 → 0.1.9
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.
|
@@ -625,7 +625,11 @@ async function pushSingle(resolved) {
|
|
|
625
625
|
}
|
|
626
626
|
if (!uploadResponse.ok) {
|
|
627
627
|
spin.fail("Upload failed.");
|
|
628
|
-
|
|
628
|
+
const errorBody = await uploadResponse.text();
|
|
629
|
+
const codeMatch = errorBody.match(/<Code>([^<]+)<\/Code>/);
|
|
630
|
+
const msgMatch = errorBody.match(/<Message>([^<]+)<\/Message>/);
|
|
631
|
+
const detail = codeMatch ? `S3 error: ${codeMatch[1]}${msgMatch ? ` \u2014 ${msgMatch[1]}` : ""}` : `Status ${uploadResponse.status}`;
|
|
632
|
+
throw new CliError(`Upload failed: ${detail}`, [
|
|
629
633
|
"Try again. If the problem persists, contact support."
|
|
630
634
|
]);
|
|
631
635
|
}
|
package/dist/index.js
CHANGED
|
@@ -19,7 +19,7 @@ import {
|
|
|
19
19
|
success,
|
|
20
20
|
validateCommand,
|
|
21
21
|
warn
|
|
22
|
-
} from "./chunk-
|
|
22
|
+
} from "./chunk-Z27YSJYQ.js";
|
|
23
23
|
|
|
24
24
|
// src/index.ts
|
|
25
25
|
import { Command as Command11 } from "commander";
|
|
@@ -266,7 +266,7 @@ var releaseCommand = new Command6("release").description("Bump the version in SK
|
|
|
266
266
|
writeFileSync2(skillPath, updated, "utf-8");
|
|
267
267
|
info(`Updated version to ${newVersion}`);
|
|
268
268
|
}
|
|
269
|
-
const { pushCommand: pushCommand2 } = await import("./push-
|
|
269
|
+
const { pushCommand: pushCommand2 } = await import("./push-NOK3Z7EW.js");
|
|
270
270
|
await pushCommand2.parseAsync([dir], { from: "user" });
|
|
271
271
|
} catch (err) {
|
|
272
272
|
handleError(err);
|
|
@@ -320,6 +320,28 @@ function readSkillsConfig() {
|
|
|
320
320
|
}
|
|
321
321
|
return null;
|
|
322
322
|
}
|
|
323
|
+
function addToSkillsConfig(claudeDir, scope, name, version) {
|
|
324
|
+
const configPath = join3(claudeDir, "skills.json");
|
|
325
|
+
let config;
|
|
326
|
+
if (existsSync3(configPath)) {
|
|
327
|
+
const raw = readFileSync2(configPath, "utf-8");
|
|
328
|
+
config = JSON.parse(raw);
|
|
329
|
+
} else {
|
|
330
|
+
config = { skills: [] };
|
|
331
|
+
}
|
|
332
|
+
const newRef = `@${scope}/${name}@${version}`;
|
|
333
|
+
const existingIndex = config.skills.findIndex((entry) => {
|
|
334
|
+
const parsed = parseSkillRef(entry.ref);
|
|
335
|
+
return parsed.scope === scope && parsed.name === name;
|
|
336
|
+
});
|
|
337
|
+
const newEntry = { ref: newRef, version };
|
|
338
|
+
if (existingIndex >= 0) {
|
|
339
|
+
config.skills[existingIndex] = newEntry;
|
|
340
|
+
} else {
|
|
341
|
+
config.skills.push(newEntry);
|
|
342
|
+
}
|
|
343
|
+
writeFileSync3(configPath, JSON.stringify(config, null, 2) + "\n");
|
|
344
|
+
}
|
|
323
345
|
async function pullSkill(scope, name, version, targetDir) {
|
|
324
346
|
const spin = spinner(`Fetching ${scope}/${name}${version ? `@${version}` : ""}...`);
|
|
325
347
|
const client = new ApiClient();
|
|
@@ -427,8 +449,10 @@ var pullCommand = new Command7("pull").description("Download and install a skill
|
|
|
427
449
|
}
|
|
428
450
|
const { scope, name, version } = parseSkillRef(ref);
|
|
429
451
|
let targetDir;
|
|
452
|
+
let isCustomPath = false;
|
|
430
453
|
if (opts.path) {
|
|
431
454
|
targetDir = resolve4(opts.path);
|
|
455
|
+
isCustomPath = true;
|
|
432
456
|
} else {
|
|
433
457
|
const detected = findClaudeSkillsDir();
|
|
434
458
|
if (detected) {
|
|
@@ -445,6 +469,7 @@ var pullCommand = new Command7("pull").description("Download and install a skill
|
|
|
445
469
|
default: join3(".", ".claude", "skills")
|
|
446
470
|
});
|
|
447
471
|
targetDir = resolve4(custom);
|
|
472
|
+
isCustomPath = true;
|
|
448
473
|
}
|
|
449
474
|
} else {
|
|
450
475
|
targetDir = join3(resolve4("."), ".claude", "skills");
|
|
@@ -460,6 +485,7 @@ var pullCommand = new Command7("pull").description("Download and install a skill
|
|
|
460
485
|
default: targetDir
|
|
461
486
|
});
|
|
462
487
|
targetDir = resolve4(custom);
|
|
488
|
+
isCustomPath = true;
|
|
463
489
|
}
|
|
464
490
|
}
|
|
465
491
|
}
|
|
@@ -467,6 +493,40 @@ var pullCommand = new Command7("pull").description("Download and install a skill
|
|
|
467
493
|
console.log("");
|
|
468
494
|
success(`Pulled ${scope}/${name}@${result.version}`);
|
|
469
495
|
info(`Skill is ready at ${join3(targetDir, name)}/SKILL.md`);
|
|
496
|
+
if (!isCustomPath) {
|
|
497
|
+
try {
|
|
498
|
+
const fullRef = `@${scope}/${name}@${result.version}`;
|
|
499
|
+
const claudeDir = dirname(targetDir);
|
|
500
|
+
const configPath = join3(claudeDir, "skills.json");
|
|
501
|
+
let alreadyTracked = false;
|
|
502
|
+
if (existsSync3(configPath)) {
|
|
503
|
+
try {
|
|
504
|
+
const raw = readFileSync2(configPath, "utf-8");
|
|
505
|
+
const config = JSON.parse(raw);
|
|
506
|
+
alreadyTracked = config.skills.some((entry) => {
|
|
507
|
+
const parsed = parseSkillRef(entry.ref);
|
|
508
|
+
return parsed.scope === scope && parsed.name === name && parsed.version === result.version;
|
|
509
|
+
});
|
|
510
|
+
} catch {
|
|
511
|
+
}
|
|
512
|
+
}
|
|
513
|
+
if (alreadyTracked) {
|
|
514
|
+
info(`Already tracked in .claude/skills.json`);
|
|
515
|
+
} else {
|
|
516
|
+
console.log("");
|
|
517
|
+
const addIt = await confirm2({
|
|
518
|
+
message: `Add ${fullRef} to .claude/skills.json?`,
|
|
519
|
+
default: true
|
|
520
|
+
});
|
|
521
|
+
if (addIt) {
|
|
522
|
+
addToSkillsConfig(claudeDir, scope, name, result.version);
|
|
523
|
+
success(`Added to ${configPath}`);
|
|
524
|
+
}
|
|
525
|
+
}
|
|
526
|
+
} catch (err) {
|
|
527
|
+
warn(`Could not update .claude/skills.json: ${err instanceof Error ? err.message : String(err)}`);
|
|
528
|
+
}
|
|
529
|
+
}
|
|
470
530
|
} catch (err) {
|
|
471
531
|
handleError(err);
|
|
472
532
|
}
|