skild 0.2.3 → 0.2.4
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 +14 -8
- 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);
|
|
@@ -552,9 +554,9 @@ async function logout() {
|
|
|
552
554
|
|
|
553
555
|
// src/commands/whoami.ts
|
|
554
556
|
import chalk12 from "chalk";
|
|
555
|
-
import { fetchWithTimeout as fetchWithTimeout4, loadRegistryAuth, resolveRegistryUrl as resolveRegistryUrl4, SkildError as SkildError8 } from "@skild/core";
|
|
557
|
+
import { fetchWithTimeout as fetchWithTimeout4, loadRegistryAuth as loadRegistryAuth2, resolveRegistryUrl as resolveRegistryUrl4, SkildError as SkildError8 } from "@skild/core";
|
|
556
558
|
async function whoami() {
|
|
557
|
-
const auth =
|
|
559
|
+
const auth = loadRegistryAuth2();
|
|
558
560
|
if (!auth) {
|
|
559
561
|
console.error(chalk12.red("Not logged in. Run `skild login` first."));
|
|
560
562
|
process.exitCode = 1;
|
|
@@ -590,7 +592,7 @@ import path2 from "path";
|
|
|
590
592
|
import crypto from "crypto";
|
|
591
593
|
import * as tar from "tar";
|
|
592
594
|
import chalk13 from "chalk";
|
|
593
|
-
import { fetchWithTimeout as fetchWithTimeout5, loadRegistryAuth as
|
|
595
|
+
import { fetchWithTimeout as fetchWithTimeout5, loadRegistryAuth as loadRegistryAuth3, resolveRegistryUrl as resolveRegistryUrl5, SkildError as SkildError9, splitCanonicalName, validateSkillDir } from "@skild/core";
|
|
594
596
|
function sha256Hex(buf) {
|
|
595
597
|
const h = crypto.createHash("sha256");
|
|
596
598
|
h.update(buf);
|
|
@@ -601,7 +603,7 @@ function parseTargets(raw) {
|
|
|
601
603
|
return raw.split(",").map((s) => s.trim()).filter(Boolean);
|
|
602
604
|
}
|
|
603
605
|
async function publish(options = {}) {
|
|
604
|
-
const auth =
|
|
606
|
+
const auth = loadRegistryAuth3();
|
|
605
607
|
const registry = resolveRegistryUrl5(options.registry || auth?.registryUrl);
|
|
606
608
|
const token = auth?.token;
|
|
607
609
|
if (!token) {
|
|
@@ -623,6 +625,8 @@ async function publish(options = {}) {
|
|
|
623
625
|
const description = (options.description || fm.description || "").trim();
|
|
624
626
|
const tag = (options.tag || "latest").trim() || "latest";
|
|
625
627
|
const targets = parseTargets(options.targets);
|
|
628
|
+
const skillset = fm.skillset === true;
|
|
629
|
+
const dependencies = Array.isArray(fm.dependencies) ? fm.dependencies : [];
|
|
626
630
|
if (!name) {
|
|
627
631
|
console.error(chalk13.red("Missing name. Provide SKILL.md frontmatter.name or --name."));
|
|
628
632
|
process.exitCode = 1;
|
|
@@ -686,6 +690,8 @@ async function publish(options = {}) {
|
|
|
686
690
|
form.set("description", description);
|
|
687
691
|
form.set("targets", JSON.stringify(targets));
|
|
688
692
|
form.set("tag", tag);
|
|
693
|
+
form.set("skillset", skillset ? "true" : "false");
|
|
694
|
+
form.set("dependencies", JSON.stringify(dependencies));
|
|
689
695
|
form.append("tarball", new Blob([buf], { type: "application/gzip" }), "skill.tgz");
|
|
690
696
|
const { scope, name: skillName } = splitCanonicalName(name);
|
|
691
697
|
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.4",
|
|
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.4"
|
|
41
41
|
},
|
|
42
42
|
"devDependencies": {
|
|
43
43
|
"@types/node": "^20.10.0",
|