@comet/cli 8.21.1 → 8.22.0

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.
@@ -86,17 +86,18 @@ function parseRepoUrl(rawUrl) {
86
86
  }
87
87
  return { repoUrl: rawUrl.slice(0, hashIndex), ref: rawUrl.slice(hashIndex + 1) || undefined };
88
88
  }
89
+ var SKILL_SOURCE_PATHS = ["skills", "agentic-plugin/skills"];
89
90
  function cloneRepo(rawUrl) {
90
91
  var _a = parseRepoUrl(rawUrl), repoUrl = _a.repoUrl, ref = _a.ref;
91
92
  var tmpDir = fs.mkdtempSync(path.join(os.tmpdir(), "comet-agent-skills-"));
92
- // Use sparse checkout to fetch only the skills/ folder
93
+ // Use sparse checkout to fetch only the skill source folders
93
94
  (0, child_process_1.execFileSync)("git", ["init", tmpDir], { stdio: "pipe" });
94
95
  (0, child_process_1.execFileSync)("git", ["-C", tmpDir, "remote", "add", "origin", "--", repoUrl], { stdio: "pipe" });
95
96
  (0, child_process_1.execFileSync)("git", ["-C", tmpDir, "config", "core.sparseCheckout", "true"], { stdio: "pipe" });
96
- fs.writeFileSync(path.join(tmpDir, ".git", "info", "sparse-checkout"), "skills/\n");
97
+ fs.writeFileSync(path.join(tmpDir, ".git", "info", "sparse-checkout"), SKILL_SOURCE_PATHS.map(function (p) { return "".concat(p, "/\n"); }).join(""));
97
98
  var fetchRef = ref !== null && ref !== void 0 ? ref : "HEAD";
98
99
  try {
99
- console.log("Fetching ".concat(repoUrl, " ref \"").concat(fetchRef, "\" (sparse, skills/ only)..."));
100
+ console.log("Fetching ".concat(repoUrl, " ref \"").concat(fetchRef, "\" (sparse, ").concat(SKILL_SOURCE_PATHS.map(function (p) { return "".concat(p, "/"); }).join(", "), " only)..."));
100
101
  (0, child_process_1.execFileSync)("git", ["-C", tmpDir, "fetch", "--depth", "1", "origin", fetchRef], { stdio: "pipe" });
101
102
  (0, child_process_1.execFileSync)("git", ["-C", tmpDir, "checkout", "FETCH_HEAD"], { stdio: "pipe" });
102
103
  }
@@ -202,12 +203,12 @@ exports.installAgentSkillsCommand = new commander_1.Command("install-agent-skill
202
203
  .option("--config <path>", "Path to a JSON config file specifying repos to install skills from", "agent-skills.json")
203
204
  .option("--dry-run", "Show which symlinks/copies would be created without making changes", false)
204
205
  .action(function (options) { return __awaiter(void 0, void 0, void 0, function () {
205
- var configPath, dryRun, resolvedConfig, repos, cwd, targetDirs, _i, targetDirs_2, dir, sources, tempDirs, _a, repos_1, rawUrl, cloneDir, _b, tempDirs_1, tmpDir;
206
- var _c;
207
- return __generator(this, function (_d) {
206
+ var configPath, dryRun, resolvedConfig, repos, cwd, targetDirs, _i, targetDirs_2, dir, sources, tempDirs, _a, repos_1, rawUrl, cloneDir, _b, SKILL_SOURCE_PATHS_1, p, _c, tempDirs_1, tmpDir;
207
+ var _d;
208
+ return __generator(this, function (_e) {
208
209
  configPath = options.config, dryRun = options.dryRun;
209
210
  resolvedConfig = path.resolve(configPath);
210
- repos = fs.existsSync(resolvedConfig) ? ((_c = loadConfig(configPath).repos) !== null && _c !== void 0 ? _c : []) : [];
211
+ repos = fs.existsSync(resolvedConfig) ? ((_d = loadConfig(configPath).repos) !== null && _d !== void 0 ? _d : []) : [];
211
212
  console.log("=== Installing agent skills".concat(dryRun ? " (dry run)" : "", " ==="));
212
213
  cwd = process.cwd();
213
214
  targetDirs = [path.join(cwd, ".agents", "skills"), path.join(cwd, ".claude", "skills")];
@@ -216,25 +217,32 @@ exports.installAgentSkillsCommand = new commander_1.Command("install-agent-skill
216
217
  dir = targetDirs_2[_i];
217
218
  fs.mkdirSync(dir, { recursive: true });
218
219
  }
219
- sources = [{ label: "local skills/", directory: path.join(cwd, "skills"), symlink: true }];
220
+ sources = SKILL_SOURCE_PATHS.map(function (p) { return ({
221
+ label: "local ".concat(p, "/"),
222
+ directory: path.join(cwd, p),
223
+ symlink: true,
224
+ }); });
220
225
  tempDirs = [];
221
226
  try {
222
227
  for (_a = 0, repos_1 = repos; _a < repos_1.length; _a++) {
223
228
  rawUrl = repos_1[_a];
224
229
  cloneDir = cloneRepo(rawUrl);
225
230
  tempDirs.push(cloneDir);
226
- sources.push({
227
- label: "external ".concat(rawUrl),
228
- directory: path.join(cloneDir, "skills"),
229
- symlink: false,
230
- filterInternal: true,
231
- });
231
+ for (_b = 0, SKILL_SOURCE_PATHS_1 = SKILL_SOURCE_PATHS; _b < SKILL_SOURCE_PATHS_1.length; _b++) {
232
+ p = SKILL_SOURCE_PATHS_1[_b];
233
+ sources.push({
234
+ label: "external ".concat(rawUrl, " (").concat(p, "/)"),
235
+ directory: path.join(cloneDir, p),
236
+ symlink: false,
237
+ filterInternal: true,
238
+ });
239
+ }
232
240
  }
233
241
  installSkills(sources, targetDirs, { dryRun: dryRun });
234
242
  }
235
243
  finally {
236
- for (_b = 0, tempDirs_1 = tempDirs; _b < tempDirs_1.length; _b++) {
237
- tmpDir = tempDirs_1[_b];
244
+ for (_c = 0, tempDirs_1 = tempDirs; _c < tempDirs_1.length; _c++) {
245
+ tmpDir = tempDirs_1[_c];
238
246
  fs.rmSync(tmpDir, { recursive: true, force: true });
239
247
  }
240
248
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@comet/cli",
3
- "version": "8.21.1",
3
+ "version": "8.22.0",
4
4
  "description": "A collection of CLI tools for Comet projects",
5
5
  "repository": {
6
6
  "directory": "packages/cli",
@@ -32,7 +32,7 @@
32
32
  "rimraf": "^6.1.2",
33
33
  "typescript": "^5.9.3",
34
34
  "vitest": "^4.0.16",
35
- "@comet/eslint-config": "8.21.1"
35
+ "@comet/eslint-config": "8.22.0"
36
36
  },
37
37
  "engines": {
38
38
  "node": ">=22.0.0"