add-skill-kit 3.2.6 → 3.2.8
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/bin/kit.js +89 -89
- package/bin/lib/agents.js +208 -208
- package/bin/lib/commands/analyze.js +70 -70
- package/bin/lib/commands/cache.js +65 -65
- package/bin/lib/commands/doctor.js +75 -75
- package/bin/lib/commands/help.js +155 -155
- package/bin/lib/commands/info.js +38 -38
- package/bin/lib/commands/init.js +39 -39
- package/bin/lib/commands/install.js +803 -803
- package/bin/lib/commands/list.js +43 -43
- package/bin/lib/commands/lock.js +57 -57
- package/bin/lib/commands/uninstall.js +307 -307
- package/bin/lib/commands/update.js +55 -55
- package/bin/lib/commands/validate.js +69 -69
- package/bin/lib/commands/verify.js +56 -56
- package/bin/lib/config.js +81 -81
- package/bin/lib/helpers.js +196 -196
- package/bin/lib/helpers.test.js +60 -60
- package/bin/lib/installer.js +164 -164
- package/bin/lib/skills.js +119 -119
- package/bin/lib/skills.test.js +109 -109
- package/bin/lib/types.js +82 -82
- package/bin/lib/ui.js +329 -329
- package/package.json +3 -2
package/bin/lib/commands/list.js
CHANGED
|
@@ -1,43 +1,43 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @fileoverview List command
|
|
3
|
-
*/
|
|
4
|
-
|
|
5
|
-
import { getInstalledSkills } from "../skills.js";
|
|
6
|
-
import { resolveScope, formatBytes } from "../helpers.js";
|
|
7
|
-
import { step, stepLine, S, c, outputJSON } from "../ui.js";
|
|
8
|
-
import { VERBOSE, JSON_OUTPUT } from "../config.js";
|
|
9
|
-
|
|
10
|
-
/**
|
|
11
|
-
* List installed skills
|
|
12
|
-
*/
|
|
13
|
-
export async function run() {
|
|
14
|
-
stepLine();
|
|
15
|
-
step(c.bold("Installed Skills"), S.diamondFilled, "cyan");
|
|
16
|
-
console.log(`${c.gray(S.branch)} ${c.dim("Location: " + resolveScope())}`);
|
|
17
|
-
stepLine();
|
|
18
|
-
|
|
19
|
-
const skills = getInstalledSkills();
|
|
20
|
-
|
|
21
|
-
if (skills.length === 0) {
|
|
22
|
-
step(c.dim("No skills installed."), S.diamond);
|
|
23
|
-
stepLine();
|
|
24
|
-
return;
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
if (JSON_OUTPUT) {
|
|
28
|
-
outputJSON({ skills }, true);
|
|
29
|
-
return;
|
|
30
|
-
}
|
|
31
|
-
|
|
32
|
-
for (const s of skills) {
|
|
33
|
-
const icon = s.hasSkillMd ? c.green(S.check) : c.yellow(S.diamond);
|
|
34
|
-
console.log(`${c.gray(S.branch)} ${icon} ${c.bold(s.name)} ${c.dim("v" + s.version)} ${c.dim("(" + formatBytes(s.size) + ")")}`);
|
|
35
|
-
if (s.description && VERBOSE) {
|
|
36
|
-
console.log(`${c.gray(S.branch)} ${c.dim(s.description.substring(0, 60))}`);
|
|
37
|
-
}
|
|
38
|
-
}
|
|
39
|
-
|
|
40
|
-
stepLine();
|
|
41
|
-
console.log(`${c.gray(S.branch)} ${c.dim("Total: " + skills.length + " skill(s)")}`);
|
|
42
|
-
stepLine();
|
|
43
|
-
}
|
|
1
|
+
/**
|
|
2
|
+
* @fileoverview List command
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
import { getInstalledSkills } from "../skills.js";
|
|
6
|
+
import { resolveScope, formatBytes } from "../helpers.js";
|
|
7
|
+
import { step, stepLine, S, c, outputJSON } from "../ui.js";
|
|
8
|
+
import { VERBOSE, JSON_OUTPUT } from "../config.js";
|
|
9
|
+
|
|
10
|
+
/**
|
|
11
|
+
* List installed skills
|
|
12
|
+
*/
|
|
13
|
+
export async function run() {
|
|
14
|
+
stepLine();
|
|
15
|
+
step(c.bold("Installed Skills"), S.diamondFilled, "cyan");
|
|
16
|
+
console.log(`${c.gray(S.branch)} ${c.dim("Location: " + resolveScope())}`);
|
|
17
|
+
stepLine();
|
|
18
|
+
|
|
19
|
+
const skills = getInstalledSkills();
|
|
20
|
+
|
|
21
|
+
if (skills.length === 0) {
|
|
22
|
+
step(c.dim("No skills installed."), S.diamond);
|
|
23
|
+
stepLine();
|
|
24
|
+
return;
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
if (JSON_OUTPUT) {
|
|
28
|
+
outputJSON({ skills }, true);
|
|
29
|
+
return;
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
for (const s of skills) {
|
|
33
|
+
const icon = s.hasSkillMd ? c.green(S.check) : c.yellow(S.diamond);
|
|
34
|
+
console.log(`${c.gray(S.branch)} ${icon} ${c.bold(s.name)} ${c.dim("v" + s.version)} ${c.dim("(" + formatBytes(s.size) + ")")}`);
|
|
35
|
+
if (s.description && VERBOSE) {
|
|
36
|
+
console.log(`${c.gray(S.branch)} ${c.dim(s.description.substring(0, 60))}`);
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
stepLine();
|
|
41
|
+
console.log(`${c.gray(S.branch)} ${c.dim("Total: " + skills.length + " skill(s)")}`);
|
|
42
|
+
stepLine();
|
|
43
|
+
}
|
package/bin/lib/commands/lock.js
CHANGED
|
@@ -1,57 +1,57 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @fileoverview Lock command - Generate skill-lock.json
|
|
3
|
-
*/
|
|
4
|
-
|
|
5
|
-
import fs from "fs";
|
|
6
|
-
import path from "path";
|
|
7
|
-
import { step, stepLine, success, fatal, outputJSON } from "../ui.js";
|
|
8
|
-
import { WORKSPACE, DRY, cwd, VERSION } from "../config.js";
|
|
9
|
-
|
|
10
|
-
/**
|
|
11
|
-
* Generate skill-lock.json
|
|
12
|
-
*/
|
|
13
|
-
export async function run() {
|
|
14
|
-
if (!fs.existsSync(WORKSPACE)) {
|
|
15
|
-
fatal("No .agent/skills directory");
|
|
16
|
-
return;
|
|
17
|
-
}
|
|
18
|
-
|
|
19
|
-
stepLine();
|
|
20
|
-
|
|
21
|
-
const skills = {};
|
|
22
|
-
for (const name of fs.readdirSync(WORKSPACE)) {
|
|
23
|
-
const dir = path.join(WORKSPACE, name);
|
|
24
|
-
if (!fs.statSync(dir).isDirectory()) continue;
|
|
25
|
-
|
|
26
|
-
const mf = path.join(dir, ".skill-source.json");
|
|
27
|
-
if (!fs.existsSync(mf)) continue;
|
|
28
|
-
|
|
29
|
-
const m = JSON.parse(fs.readFileSync(mf, "utf-8"));
|
|
30
|
-
skills[name] = {
|
|
31
|
-
repo: m.repo,
|
|
32
|
-
skill: m.skill,
|
|
33
|
-
ref: m.ref,
|
|
34
|
-
checksum: `sha256:${m.checksum}`,
|
|
35
|
-
publisher: m.publisher || null
|
|
36
|
-
};
|
|
37
|
-
}
|
|
38
|
-
|
|
39
|
-
const lock = {
|
|
40
|
-
lockVersion: 1,
|
|
41
|
-
generatedAt: new Date().toISOString(),
|
|
42
|
-
generator: `@dataguruin/add-skill@${VERSION}`,
|
|
43
|
-
skills
|
|
44
|
-
};
|
|
45
|
-
|
|
46
|
-
if (DRY) {
|
|
47
|
-
step("Would generate skill-lock.json");
|
|
48
|
-
outputJSON(lock, true);
|
|
49
|
-
return;
|
|
50
|
-
}
|
|
51
|
-
|
|
52
|
-
fs.mkdirSync(path.join(cwd, ".agent"), { recursive: true });
|
|
53
|
-
fs.writeFileSync(path.join(cwd, ".agent", "skill-lock.json"), JSON.stringify(lock, null, 2));
|
|
54
|
-
|
|
55
|
-
success("skill-lock.json generated");
|
|
56
|
-
stepLine();
|
|
57
|
-
}
|
|
1
|
+
/**
|
|
2
|
+
* @fileoverview Lock command - Generate skill-lock.json
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
import fs from "fs";
|
|
6
|
+
import path from "path";
|
|
7
|
+
import { step, stepLine, success, fatal, outputJSON } from "../ui.js";
|
|
8
|
+
import { WORKSPACE, DRY, cwd, VERSION } from "../config.js";
|
|
9
|
+
|
|
10
|
+
/**
|
|
11
|
+
* Generate skill-lock.json
|
|
12
|
+
*/
|
|
13
|
+
export async function run() {
|
|
14
|
+
if (!fs.existsSync(WORKSPACE)) {
|
|
15
|
+
fatal("No .agent/skills directory");
|
|
16
|
+
return;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
stepLine();
|
|
20
|
+
|
|
21
|
+
const skills = {};
|
|
22
|
+
for (const name of fs.readdirSync(WORKSPACE)) {
|
|
23
|
+
const dir = path.join(WORKSPACE, name);
|
|
24
|
+
if (!fs.statSync(dir).isDirectory()) continue;
|
|
25
|
+
|
|
26
|
+
const mf = path.join(dir, ".skill-source.json");
|
|
27
|
+
if (!fs.existsSync(mf)) continue;
|
|
28
|
+
|
|
29
|
+
const m = JSON.parse(fs.readFileSync(mf, "utf-8"));
|
|
30
|
+
skills[name] = {
|
|
31
|
+
repo: m.repo,
|
|
32
|
+
skill: m.skill,
|
|
33
|
+
ref: m.ref,
|
|
34
|
+
checksum: `sha256:${m.checksum}`,
|
|
35
|
+
publisher: m.publisher || null
|
|
36
|
+
};
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
const lock = {
|
|
40
|
+
lockVersion: 1,
|
|
41
|
+
generatedAt: new Date().toISOString(),
|
|
42
|
+
generator: `@dataguruin/add-skill@${VERSION}`,
|
|
43
|
+
skills
|
|
44
|
+
};
|
|
45
|
+
|
|
46
|
+
if (DRY) {
|
|
47
|
+
step("Would generate skill-lock.json");
|
|
48
|
+
outputJSON(lock, true);
|
|
49
|
+
return;
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
fs.mkdirSync(path.join(cwd, ".agent"), { recursive: true });
|
|
53
|
+
fs.writeFileSync(path.join(cwd, ".agent", "skill-lock.json"), JSON.stringify(lock, null, 2));
|
|
54
|
+
|
|
55
|
+
success("skill-lock.json generated");
|
|
56
|
+
stepLine();
|
|
57
|
+
}
|