skild 0.4.0 → 0.4.2
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/dist/index.js +9 -11
- package/package.json +2 -2
package/dist/index.js
CHANGED
|
@@ -9,7 +9,7 @@ import { createRequire } from "module";
|
|
|
9
9
|
import fs2 from "fs";
|
|
10
10
|
import path2 from "path";
|
|
11
11
|
import chalk2 from "chalk";
|
|
12
|
-
import { fetchWithTimeout, installRegistrySkill, installSkill, isValidAlias, loadRegistryAuth, materializeSourceToTemp, resolveRegistryAlias, resolveRegistryUrl, SkildError, PLATFORMS } from "@skild/core";
|
|
12
|
+
import { deriveChildSource, fetchWithTimeout, installRegistrySkill, installSkill, isValidAlias, loadRegistryAuth, materializeSourceToTemp, resolveRegistryAlias, resolveRegistryUrl, SkildError, PLATFORMS } from "@skild/core";
|
|
13
13
|
|
|
14
14
|
// src/utils/logger.ts
|
|
15
15
|
import chalk from "chalk";
|
|
@@ -217,12 +217,6 @@ function discoverSkillDirsWithHeuristics(rootDir, options) {
|
|
|
217
217
|
}
|
|
218
218
|
return discoverSkillDirs(root, options);
|
|
219
219
|
}
|
|
220
|
-
function deriveRemoteChildSource(baseSource, relPath) {
|
|
221
|
-
const [pathPart, ref] = baseSource.split("#", 2);
|
|
222
|
-
const clean = normalizeRelPath(relPath);
|
|
223
|
-
const joined = clean ? `${pathPart.replace(/\/+$/, "")}/${clean}` : pathPart;
|
|
224
|
-
return ref ? `${joined}#${ref}` : joined;
|
|
225
|
-
}
|
|
226
220
|
|
|
227
221
|
// src/commands/install.ts
|
|
228
222
|
function looksLikeAlias(input) {
|
|
@@ -307,7 +301,7 @@ async function install(source, options = {}) {
|
|
|
307
301
|
}
|
|
308
302
|
}
|
|
309
303
|
}
|
|
310
|
-
async function maybeEnableRecursiveAndInstall(found) {
|
|
304
|
+
async function maybeEnableRecursiveAndInstall(found, spinner) {
|
|
311
305
|
if (found.length === 0) return false;
|
|
312
306
|
if (found.length > maxSkills) {
|
|
313
307
|
const message = `Found more than ${maxSkills} skills. Increase --max-skills to proceed.`;
|
|
@@ -330,6 +324,7 @@ async function install(source, options = {}) {
|
|
|
330
324
|
process.exitCode = 1;
|
|
331
325
|
return true;
|
|
332
326
|
}
|
|
327
|
+
if (spinner) spinner.stop();
|
|
333
328
|
const headline = found.length === 1 ? `No SKILL.md found at root. Found 1 skill:
|
|
334
329
|
${previewDiscovered(found)}
|
|
335
330
|
` : `No SKILL.md found at root. Found ${found.length} skills:
|
|
@@ -344,6 +339,7 @@ ${previewDiscovered(found)}
|
|
|
344
339
|
return true;
|
|
345
340
|
}
|
|
346
341
|
effectiveRecursive = true;
|
|
342
|
+
if (spinner) spinner.start();
|
|
347
343
|
}
|
|
348
344
|
recursiveSkillCount = found.length;
|
|
349
345
|
return false;
|
|
@@ -371,13 +367,14 @@ ${previewDiscovered(found)}
|
|
|
371
367
|
if (jsonOnly) {
|
|
372
368
|
printJson({ ok: false, error: "SKILL_MD_NOT_FOUND", message, source, resolvedSource });
|
|
373
369
|
} else {
|
|
370
|
+
if (spinner) spinner.stop();
|
|
374
371
|
console.error(chalk2.red(message));
|
|
375
372
|
}
|
|
376
373
|
process.exitCode = 1;
|
|
377
374
|
return;
|
|
378
375
|
}
|
|
379
376
|
const found = asDiscoveredSkills(discovered, (d) => path2.join(maybeLocalRoot, d.relPath));
|
|
380
|
-
const didReturn = await maybeEnableRecursiveAndInstall(found);
|
|
377
|
+
const didReturn = await maybeEnableRecursiveAndInstall(found, spinner);
|
|
381
378
|
if (didReturn) return;
|
|
382
379
|
if (spinner) spinner.text = `Installing ${chalk2.cyan(source)} \u2014 discovered ${found.length} skills...`;
|
|
383
380
|
for (const skill of found) {
|
|
@@ -399,6 +396,7 @@ ${previewDiscovered(found)}
|
|
|
399
396
|
if (jsonOnly) {
|
|
400
397
|
printJson({ ok: false, error: "SKILL_MD_NOT_FOUND", message, source, resolvedSource });
|
|
401
398
|
} else {
|
|
399
|
+
if (spinner) spinner.stop();
|
|
402
400
|
console.error(chalk2.red(message));
|
|
403
401
|
}
|
|
404
402
|
process.exitCode = 1;
|
|
@@ -406,10 +404,10 @@ ${previewDiscovered(found)}
|
|
|
406
404
|
}
|
|
407
405
|
const found = asDiscoveredSkills(
|
|
408
406
|
discovered,
|
|
409
|
-
(d) =>
|
|
407
|
+
(d) => deriveChildSource(resolvedSource, d.relPath),
|
|
410
408
|
(d) => d.absDir
|
|
411
409
|
);
|
|
412
|
-
const didReturn = await maybeEnableRecursiveAndInstall(found);
|
|
410
|
+
const didReturn = await maybeEnableRecursiveAndInstall(found, spinner);
|
|
413
411
|
if (didReturn) return;
|
|
414
412
|
if (spinner) spinner.text = `Installing ${chalk2.cyan(source)} \u2014 discovered ${found.length} skills...`;
|
|
415
413
|
for (const skill of found) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "skild",
|
|
3
|
-
"version": "0.4.
|
|
3
|
+
"version": "0.4.2",
|
|
4
4
|
"description": "The npm for Agent Skills — Discover, install, manage, and publish AI Agent Skills with ease.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/index.js",
|
|
@@ -37,7 +37,7 @@
|
|
|
37
37
|
"commander": "^12.1.0",
|
|
38
38
|
"ora": "^8.0.1",
|
|
39
39
|
"tar": "^7.4.3",
|
|
40
|
-
"@skild/core": "^0.4.
|
|
40
|
+
"@skild/core": "^0.4.2"
|
|
41
41
|
},
|
|
42
42
|
"devDependencies": {
|
|
43
43
|
"@types/node": "^20.10.0",
|