skild 0.2.3 → 0.2.5
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 +23 -12
- package/package.json +2 -2
package/dist/index.js
CHANGED
|
@@ -7,7 +7,7 @@ import { createRequire } from "module";
|
|
|
7
7
|
|
|
8
8
|
// src/commands/install.ts
|
|
9
9
|
import chalk2 from "chalk";
|
|
10
|
-
import { fetchWithTimeout, installRegistrySkill, installSkill, resolveRegistryUrl, SkildError } from "@skild/core";
|
|
10
|
+
import { fetchWithTimeout, installRegistrySkill, installSkill, loadRegistryAuth, resolveRegistryUrl, SkildError } from "@skild/core";
|
|
11
11
|
|
|
12
12
|
// src/utils/logger.ts
|
|
13
13
|
import chalk from "chalk";
|
|
@@ -73,12 +73,14 @@ var logger = {
|
|
|
73
73
|
async function install(source, options = {}) {
|
|
74
74
|
const platform = options.target || "claude";
|
|
75
75
|
const scope = options.local ? "project" : "global";
|
|
76
|
+
const auth = loadRegistryAuth();
|
|
77
|
+
const registryUrlForDeps = options.registry || auth?.registryUrl;
|
|
76
78
|
const spinner = createSpinner(`Installing ${chalk2.cyan(source)} to ${chalk2.dim(platform)} (${scope})...`);
|
|
77
79
|
try {
|
|
78
80
|
const record = source.trim().startsWith("@") && source.includes("/") ? await installRegistrySkill(
|
|
79
|
-
{ spec: source, registryUrl:
|
|
81
|
+
{ spec: source, registryUrl: registryUrlForDeps },
|
|
80
82
|
{ platform, scope, force: Boolean(options.force) }
|
|
81
|
-
) : await installSkill({ source }, { platform, scope, force: Boolean(options.force) });
|
|
83
|
+
) : await installSkill({ source }, { platform, scope, force: Boolean(options.force), registryUrl: registryUrlForDeps });
|
|
82
84
|
const displayName = record.canonicalName || record.name;
|
|
83
85
|
spinner.succeed(`Installed ${chalk2.green(displayName)} to ${chalk2.dim(record.installDir)}`);
|
|
84
86
|
if (options.json) {
|
|
@@ -95,7 +97,7 @@ async function install(source, options = {}) {
|
|
|
95
97
|
} else if (record.skill?.validation?.ok) {
|
|
96
98
|
logger.installDetail(`Validation: ${chalk2.green("ok")}`);
|
|
97
99
|
}
|
|
98
|
-
void reportDownload(record,
|
|
100
|
+
void reportDownload(record, registryUrlForDeps);
|
|
99
101
|
} catch (error) {
|
|
100
102
|
spinner.fail(`Failed to install ${chalk2.red(source)}`);
|
|
101
103
|
const message = error instanceof SkildError ? error.message : error instanceof Error ? error.message : String(error);
|
|
@@ -398,18 +400,23 @@ async function promptLine(question, defaultValue) {
|
|
|
398
400
|
}
|
|
399
401
|
async function promptPassword(question) {
|
|
400
402
|
const rl = readline.createInterface({ input: process.stdin, output: process.stdout, terminal: true });
|
|
401
|
-
rl.stdoutMuted =
|
|
403
|
+
rl.stdoutMuted = false;
|
|
404
|
+
const prompt = `${question}: `;
|
|
402
405
|
rl._writeToOutput = function _writeToOutput(stringToWrite) {
|
|
403
|
-
if (this.stdoutMuted)
|
|
406
|
+
if (this.stdoutMuted) {
|
|
407
|
+
if (stringToWrite === "\n" || stringToWrite === "\r\n") this.output.write(stringToWrite);
|
|
408
|
+
return;
|
|
409
|
+
}
|
|
404
410
|
this.output.write(stringToWrite);
|
|
405
411
|
};
|
|
406
412
|
try {
|
|
407
|
-
const
|
|
413
|
+
const answerPromise = new Promise((resolve) => rl.question(prompt, resolve));
|
|
414
|
+
rl.stdoutMuted = true;
|
|
415
|
+
const answer = await answerPromise;
|
|
408
416
|
return String(answer || "");
|
|
409
417
|
} finally {
|
|
410
418
|
rl.stdoutMuted = false;
|
|
411
419
|
rl.close();
|
|
412
|
-
process.stdout.write("\n");
|
|
413
420
|
}
|
|
414
421
|
}
|
|
415
422
|
|
|
@@ -552,9 +559,9 @@ async function logout() {
|
|
|
552
559
|
|
|
553
560
|
// src/commands/whoami.ts
|
|
554
561
|
import chalk12 from "chalk";
|
|
555
|
-
import { fetchWithTimeout as fetchWithTimeout4, loadRegistryAuth, resolveRegistryUrl as resolveRegistryUrl4, SkildError as SkildError8 } from "@skild/core";
|
|
562
|
+
import { fetchWithTimeout as fetchWithTimeout4, loadRegistryAuth as loadRegistryAuth2, resolveRegistryUrl as resolveRegistryUrl4, SkildError as SkildError8 } from "@skild/core";
|
|
556
563
|
async function whoami() {
|
|
557
|
-
const auth =
|
|
564
|
+
const auth = loadRegistryAuth2();
|
|
558
565
|
if (!auth) {
|
|
559
566
|
console.error(chalk12.red("Not logged in. Run `skild login` first."));
|
|
560
567
|
process.exitCode = 1;
|
|
@@ -590,7 +597,7 @@ import path2 from "path";
|
|
|
590
597
|
import crypto from "crypto";
|
|
591
598
|
import * as tar from "tar";
|
|
592
599
|
import chalk13 from "chalk";
|
|
593
|
-
import { fetchWithTimeout as fetchWithTimeout5, loadRegistryAuth as
|
|
600
|
+
import { fetchWithTimeout as fetchWithTimeout5, loadRegistryAuth as loadRegistryAuth3, resolveRegistryUrl as resolveRegistryUrl5, SkildError as SkildError9, splitCanonicalName, validateSkillDir } from "@skild/core";
|
|
594
601
|
function sha256Hex(buf) {
|
|
595
602
|
const h = crypto.createHash("sha256");
|
|
596
603
|
h.update(buf);
|
|
@@ -601,7 +608,7 @@ function parseTargets(raw) {
|
|
|
601
608
|
return raw.split(",").map((s) => s.trim()).filter(Boolean);
|
|
602
609
|
}
|
|
603
610
|
async function publish(options = {}) {
|
|
604
|
-
const auth =
|
|
611
|
+
const auth = loadRegistryAuth3();
|
|
605
612
|
const registry = resolveRegistryUrl5(options.registry || auth?.registryUrl);
|
|
606
613
|
const token = auth?.token;
|
|
607
614
|
if (!token) {
|
|
@@ -623,6 +630,8 @@ async function publish(options = {}) {
|
|
|
623
630
|
const description = (options.description || fm.description || "").trim();
|
|
624
631
|
const tag = (options.tag || "latest").trim() || "latest";
|
|
625
632
|
const targets = parseTargets(options.targets);
|
|
633
|
+
const skillset = fm.skillset === true;
|
|
634
|
+
const dependencies = Array.isArray(fm.dependencies) ? fm.dependencies : [];
|
|
626
635
|
if (!name) {
|
|
627
636
|
console.error(chalk13.red("Missing name. Provide SKILL.md frontmatter.name or --name."));
|
|
628
637
|
process.exitCode = 1;
|
|
@@ -686,6 +695,8 @@ async function publish(options = {}) {
|
|
|
686
695
|
form.set("description", description);
|
|
687
696
|
form.set("targets", JSON.stringify(targets));
|
|
688
697
|
form.set("tag", tag);
|
|
698
|
+
form.set("skillset", skillset ? "true" : "false");
|
|
699
|
+
form.set("dependencies", JSON.stringify(dependencies));
|
|
689
700
|
form.append("tarball", new Blob([buf], { type: "application/gzip" }), "skill.tgz");
|
|
690
701
|
const { scope, name: skillName } = splitCanonicalName(name);
|
|
691
702
|
const res = await fetchWithTimeout5(
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "skild",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.5",
|
|
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.2.
|
|
40
|
+
"@skild/core": "^0.2.5"
|
|
41
41
|
},
|
|
42
42
|
"devDependencies": {
|
|
43
43
|
"@types/node": "^20.10.0",
|