install-agent-skill 1.2.6 → 1.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/add-skill.v2.js +26 -12
- package/bin/lib/commands/install.js +36 -23
- package/bin/lib/commands/update.js +7 -10
- package/package.json +1 -1
package/bin/add-skill.v2.js
CHANGED
|
@@ -12,7 +12,7 @@ import crypto from "crypto";
|
|
|
12
12
|
import prompts from "prompts";
|
|
13
13
|
import { multiselect, isCancel, cancel, intro, outro, select, confirm, log, spinner } from "@clack/prompts";
|
|
14
14
|
import kleur from "kleur";
|
|
15
|
-
|
|
15
|
+
|
|
16
16
|
import boxen from "boxen";
|
|
17
17
|
import { createRequire } from "module";
|
|
18
18
|
|
|
@@ -297,7 +297,7 @@ async function runInstall(spec) {
|
|
|
297
297
|
|
|
298
298
|
// Use @clack/prompts for multiselect
|
|
299
299
|
const skillsR = await multiselect({
|
|
300
|
-
message: 'Select skills to install',
|
|
300
|
+
message: 'Select skills to install (Press Space to select, Enter to continue)',
|
|
301
301
|
options: skillsInRepo.map(s => ({
|
|
302
302
|
label: s.title,
|
|
303
303
|
value: s.value,
|
|
@@ -321,22 +321,35 @@ async function runInstall(spec) {
|
|
|
321
321
|
return;
|
|
322
322
|
}
|
|
323
323
|
|
|
324
|
-
|
|
325
|
-
|
|
324
|
+
// Agent selection
|
|
325
|
+
stepLine();
|
|
326
|
+
step("Detected 5 agents", S.diamond);
|
|
327
|
+
|
|
328
|
+
const agentsR = await multiselect({
|
|
329
|
+
message: 'Select agents to install skills to',
|
|
326
330
|
options: [
|
|
327
|
-
{ label: '
|
|
328
|
-
{ label: '
|
|
331
|
+
{ label: 'Antigravity (.agent/skills)', value: 'antigravity', selected: true },
|
|
332
|
+
{ label: c.dim('Claude Code'), value: 'claude', hint: c.dim('(not supported)') },
|
|
333
|
+
{ label: c.dim('Codex'), value: 'codex', hint: c.dim('(not supported)') },
|
|
334
|
+
{ label: c.dim('Gemini CLI'), value: 'gemini', hint: c.dim('(not supported)') },
|
|
335
|
+
{ label: c.dim('Windsurf'), value: 'windsurf', hint: c.dim('(not supported)') }
|
|
329
336
|
],
|
|
330
|
-
|
|
337
|
+
required: true
|
|
331
338
|
});
|
|
332
339
|
|
|
333
|
-
if (isCancel(
|
|
340
|
+
if (isCancel(agentsR)) {
|
|
334
341
|
cancel('Operation cancelled.');
|
|
335
342
|
fs.rmSync(tmp, { recursive: true, force: true });
|
|
336
343
|
return;
|
|
337
344
|
}
|
|
338
345
|
|
|
339
|
-
const
|
|
346
|
+
const selectedAgents = agentsR;
|
|
347
|
+
if (selectedAgents.includes('antigravity') === false) {
|
|
348
|
+
log.warn("Antigravity is currently the only supported agent. Selecting it automatically.");
|
|
349
|
+
}
|
|
350
|
+
|
|
351
|
+
// For now, we only support Antigravity, effectively just checking if we continue
|
|
352
|
+
const targetScope = WORKSPACE;
|
|
340
353
|
|
|
341
354
|
log.info("Installing skills...");
|
|
342
355
|
fs.mkdirSync(targetScope, { recursive: true });
|
|
@@ -385,12 +398,13 @@ async function runUpdate(skillName) {
|
|
|
385
398
|
const meta = JSON.parse(fs.readFileSync(metaFile, "utf-8"));
|
|
386
399
|
if (!meta.repo || meta.repo === "local") fatal("Cannot update local skill");
|
|
387
400
|
stepLine();
|
|
388
|
-
const
|
|
401
|
+
const s = spinner();
|
|
402
|
+
s.start(`Updating ${skillName}`);
|
|
389
403
|
try {
|
|
390
404
|
if (!DRY) { createBackup(targetDir, skillName); fs.rmSync(targetDir, { recursive: true, force: true }); }
|
|
391
405
|
const spec = `${meta.repo}#${meta.skill}${meta.ref ? "@" + meta.ref : ""}`;
|
|
392
|
-
if (DRY) {
|
|
393
|
-
} catch (err) {
|
|
406
|
+
if (DRY) { s.stop(); step(`Would update: ${skillName}`, S.diamond); } else { await runInstall(spec); s.stop(); }
|
|
407
|
+
} catch (err) { s.stop(`Failed: ${err.message}`, 1); step(`Failed: ${err.message}`, S.cross, "red"); }
|
|
394
408
|
}
|
|
395
409
|
|
|
396
410
|
function runLock() {
|
|
@@ -5,13 +5,15 @@
|
|
|
5
5
|
import fs from "fs";
|
|
6
6
|
import path from "path";
|
|
7
7
|
import os from "os";
|
|
8
|
-
import {
|
|
8
|
+
import { exec } from "child_process";
|
|
9
|
+
import util from "util";
|
|
10
|
+
const execAsync = util.promisify(exec);
|
|
9
11
|
import prompts from "prompts";
|
|
10
|
-
|
|
12
|
+
|
|
11
13
|
import boxen from "boxen";
|
|
12
14
|
import { parseSkillSpec, merkleHash } from "../helpers.js";
|
|
13
15
|
import { parseSkillMdFrontmatter } from "../skills.js";
|
|
14
|
-
import { step, stepLine, S, c, fatal } from "../ui.js";
|
|
16
|
+
import { step, stepLine, S, c, fatal, spinner } from "../ui.js";
|
|
15
17
|
import { WORKSPACE, GLOBAL_DIR } from "../config.js";
|
|
16
18
|
|
|
17
19
|
/**
|
|
@@ -36,26 +38,22 @@ export async function run(spec) {
|
|
|
36
38
|
stepLine();
|
|
37
39
|
step("Source: " + c.cyan(url), S.diamond);
|
|
38
40
|
|
|
39
|
-
const
|
|
40
|
-
|
|
41
|
-
prefixText: ` ${c.gray(S.branch)} ${c.cyan(S.diamondFilled)} `,
|
|
42
|
-
color: "cyan"
|
|
43
|
-
}).start();
|
|
41
|
+
const s = spinner();
|
|
42
|
+
s.start("Cloning repository");
|
|
44
43
|
|
|
45
44
|
const tmp = fs.mkdtempSync(path.join(os.tmpdir(), "add-skill-"));
|
|
46
45
|
|
|
47
46
|
try {
|
|
48
|
-
|
|
49
|
-
if (ref)
|
|
47
|
+
await execAsync(`git clone --depth=1 ${url} "${tmp}"`);
|
|
48
|
+
if (ref) await execAsync(`git -C "${tmp}" checkout ${ref}`);
|
|
50
49
|
} catch {
|
|
51
|
-
|
|
50
|
+
s.stop("Failed to clone");
|
|
52
51
|
step(c.red("Failed to clone"), S.cross, "red");
|
|
53
52
|
fs.rmSync(tmp, { recursive: true, force: true });
|
|
54
53
|
return;
|
|
55
54
|
}
|
|
56
55
|
|
|
57
|
-
|
|
58
|
-
step("Repository cloned", S.check, "green");
|
|
56
|
+
s.stop("Repository cloned");
|
|
59
57
|
|
|
60
58
|
// Find skills in repo
|
|
61
59
|
const skillsInRepo = [];
|
|
@@ -109,7 +107,7 @@ export async function run(spec) {
|
|
|
109
107
|
value: s.value,
|
|
110
108
|
selected: true // Pre-select all by default
|
|
111
109
|
})),
|
|
112
|
-
hint: "- Space to
|
|
110
|
+
hint: "- Press Space to select, Enter to continue",
|
|
113
111
|
instructions: false
|
|
114
112
|
});
|
|
115
113
|
|
|
@@ -122,20 +120,35 @@ export async function run(spec) {
|
|
|
122
120
|
selectedSkills = skillsR.skills;
|
|
123
121
|
}
|
|
124
122
|
|
|
125
|
-
//
|
|
123
|
+
// Ensure newline after prompt to fix tree alignment
|
|
124
|
+
console.log();
|
|
125
|
+
|
|
126
|
+
// Agent selection
|
|
126
127
|
stepLine();
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
128
|
+
step("Detected 5 agents", S.diamond);
|
|
129
|
+
|
|
130
|
+
const agentsR = await prompts({
|
|
131
|
+
type: "multiselect",
|
|
132
|
+
name: "agents",
|
|
133
|
+
message: "Select agents to install skills to",
|
|
131
134
|
choices: [
|
|
132
|
-
{ title: "
|
|
133
|
-
{ title: "
|
|
135
|
+
{ title: "Antigravity (.agent/skills)", value: "antigravity", selected: true },
|
|
136
|
+
{ title: c.dim("Claude Code"), value: "claude", disabled: true },
|
|
137
|
+
{ title: c.dim("Codex"), value: "codex", disabled: true },
|
|
138
|
+
{ title: c.dim("Gemini CLI"), value: "gemini", disabled: true },
|
|
139
|
+
{ title: c.dim("Windsurf"), value: "windsurf", disabled: true }
|
|
134
140
|
],
|
|
135
|
-
|
|
141
|
+
hint: "- Space to toggle. Enter to submit",
|
|
142
|
+
instructions: false
|
|
136
143
|
});
|
|
137
144
|
|
|
138
|
-
|
|
145
|
+
if (!agentsR.agents || agentsR.agents.length === 0) {
|
|
146
|
+
console.log(`\n ${c.yellow("No agents selected.")}`);
|
|
147
|
+
fs.rmSync(tmp, { recursive: true, force: true });
|
|
148
|
+
return;
|
|
149
|
+
}
|
|
150
|
+
|
|
151
|
+
const targetScope = WORKSPACE;
|
|
139
152
|
|
|
140
153
|
// Summary
|
|
141
154
|
stepLine();
|
|
@@ -4,9 +4,9 @@
|
|
|
4
4
|
|
|
5
5
|
import fs from "fs";
|
|
6
6
|
import path from "path";
|
|
7
|
-
|
|
7
|
+
|
|
8
8
|
import { resolveScope, createBackup } from "../helpers.js";
|
|
9
|
-
import { step, stepLine, S, c, fatal } from "../ui.js";
|
|
9
|
+
import { step, stepLine, S, c, fatal, spinner } from "../ui.js";
|
|
10
10
|
import { DRY } from "../config.js";
|
|
11
11
|
|
|
12
12
|
/**
|
|
@@ -29,11 +29,8 @@ export async function run(skillName) {
|
|
|
29
29
|
|
|
30
30
|
stepLine();
|
|
31
31
|
|
|
32
|
-
const
|
|
33
|
-
|
|
34
|
-
prefixText: ` ${c.gray(S.branch)} ${c.cyan(S.diamondFilled)} `,
|
|
35
|
-
color: "cyan"
|
|
36
|
-
}).start();
|
|
32
|
+
const s = spinner();
|
|
33
|
+
s.start(`Updating ${skillName}`);
|
|
37
34
|
|
|
38
35
|
try {
|
|
39
36
|
if (!DRY) {
|
|
@@ -44,15 +41,15 @@ export async function run(skillName) {
|
|
|
44
41
|
const spec = `${meta.repo}#${meta.skill}${meta.ref ? "@" + meta.ref : ""}`;
|
|
45
42
|
|
|
46
43
|
if (DRY) {
|
|
47
|
-
|
|
44
|
+
s.stop();
|
|
48
45
|
step(`Would update: ${skillName}`);
|
|
49
46
|
} else {
|
|
50
47
|
// Dynamically import install command
|
|
51
48
|
const { run: install } = await import("./install.js");
|
|
52
49
|
await install(spec);
|
|
50
|
+
s.stop();
|
|
53
51
|
}
|
|
54
52
|
} catch (err) {
|
|
55
|
-
|
|
56
|
-
step(`Failed: ${err.message}`, S.cross, "red");
|
|
53
|
+
s.stop(`Failed: ${err.message}`);
|
|
57
54
|
}
|
|
58
55
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "install-agent-skill",
|
|
3
|
-
"version": "1.2.
|
|
3
|
+
"version": "1.2.8",
|
|
4
4
|
"description": "Enterprise-grade Agent Skill Manager with Antigravity Skills support, Progressive Disclosure detection, and semantic routing validation",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"author": "DataGuruIn <contact@dataguruin.com>",
|