@iceinvein/agent-skills 0.26.0 → 0.27.1
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/README.md +13 -4
- package/dist/cli/index.js +460 -626
- package/package.json +1 -1
- package/skills/index.json +4 -4
- package/skills/magpie/README.md +24 -6
- package/skills/magpie/package.json +1 -1
- package/skills/magpie/skill.json +21 -3
- package/skills/sluice/SKILL.md +3 -1
- package/skills/sluice/evals/README.md +4 -3
- package/skills/sluice/evals/deep-run-mirrors-the-task-list/case.yaml +4 -0
- package/skills/sluice/evals/deep-run-mirrors-the-task-list/fixture.sh +304 -0
- package/skills/sluice/evals/deep-run-mirrors-the-task-list/graders/every-task-done.md +7 -0
- package/skills/sluice/evals/deep-run-mirrors-the-task-list/graders/sluice-fired.md +5 -0
- package/skills/sluice/evals/deep-run-mirrors-the-task-list/graders/task-list-completed.md +7 -0
- package/skills/sluice/evals/deep-run-mirrors-the-task-list/graders/task-list-created.md +8 -0
- package/skills/sluice/evals/deep-run-mirrors-the-task-list/prompt.md +13 -0
- package/skills/sluice/evals/rules.json +9 -0
- package/skills/sluice/references/deep-channel.md +17 -0
- package/skills/sluice/references/status.md +8 -3
- package/skills/sluice/scripts/postinstall.sh +3 -3
- package/skills/sluice/skill.json +28 -4
package/dist/cli/index.js
CHANGED
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
#!/usr/bin/env bun
|
|
2
2
|
// @bun
|
|
3
|
-
import { createRequire } from "node:module";
|
|
4
3
|
var __create = Object.create;
|
|
5
4
|
var __getProtoOf = Object.getPrototypeOf;
|
|
6
5
|
var __defProp = Object.defineProperty;
|
|
@@ -34,7 +33,7 @@ var __toESM = (mod, isNodeMode, target) => {
|
|
|
34
33
|
return to;
|
|
35
34
|
};
|
|
36
35
|
var __commonJS = (cb, mod) => () => (mod || cb((mod = { exports: {} }).exports, mod), mod.exports);
|
|
37
|
-
var __require =
|
|
36
|
+
var __require = import.meta.require;
|
|
38
37
|
|
|
39
38
|
// node_modules/cli-width/index.js
|
|
40
39
|
var require_cli_width = __commonJS(function(exports, module) {
|
|
@@ -197,18 +196,26 @@ var require_lib = __commonJS(function(exports, module) {
|
|
|
197
196
|
});
|
|
198
197
|
|
|
199
198
|
// src/cli/detect.ts
|
|
200
|
-
import { existsSync } from "
|
|
201
|
-
import { join } from "
|
|
202
|
-
var
|
|
199
|
+
import { existsSync } from "fs";
|
|
200
|
+
import { join } from "path";
|
|
201
|
+
var PROJECT_MARKERS = {
|
|
203
202
|
claude: (cwd) => existsSync(join(cwd, ".claude")),
|
|
204
203
|
cursor: (cwd) => existsSync(join(cwd, ".cursor")),
|
|
205
204
|
codex: (cwd) => existsSync(join(cwd, "AGENTS.md")),
|
|
206
205
|
gemini: (cwd) => existsSync(join(cwd, ".gemini")),
|
|
207
206
|
antigravity: () => false
|
|
208
207
|
};
|
|
209
|
-
|
|
208
|
+
var GLOBAL_MARKERS = {
|
|
209
|
+
claude: (home) => existsSync(join(home, ".claude")),
|
|
210
|
+
cursor: (home) => existsSync(join(home, ".cursor")),
|
|
211
|
+
codex: (home) => existsSync(join(home, ".codex")) || process.env.CODEX_HOME !== undefined && existsSync(process.env.CODEX_HOME),
|
|
212
|
+
gemini: (home) => existsSync(join(home, ".gemini/settings.json")),
|
|
213
|
+
antigravity: (home) => existsSync(join(home, ".gemini/antigravity-cli")) || existsSync(join(home, ".gemini/antigravity"))
|
|
214
|
+
};
|
|
215
|
+
async function detectTools(cwd, isGlobal = false) {
|
|
216
|
+
const markers = isGlobal ? GLOBAL_MARKERS : PROJECT_MARKERS;
|
|
210
217
|
const detected = [];
|
|
211
|
-
for (const [tool, check] of Object.entries(
|
|
218
|
+
for (const [tool, check] of Object.entries(markers)) {
|
|
212
219
|
if (check(cwd)) {
|
|
213
220
|
detected.push(tool);
|
|
214
221
|
}
|
|
@@ -340,6 +347,16 @@ function validateManifest(data) {
|
|
|
340
347
|
if (a.claudeStatuslineScript !== undefined && typeof a.claudeStatuslineScript !== "string") {
|
|
341
348
|
return { ok: false, error: "'activation.claudeStatuslineScript' must be a string" };
|
|
342
349
|
}
|
|
350
|
+
if (a.claudeEnv !== undefined) {
|
|
351
|
+
if (typeof a.claudeEnv !== "object" || a.claudeEnv === null || Array.isArray(a.claudeEnv)) {
|
|
352
|
+
return { ok: false, error: "'activation.claudeEnv' must be an object" };
|
|
353
|
+
}
|
|
354
|
+
for (const [key, value] of Object.entries(a.claudeEnv)) {
|
|
355
|
+
if (typeof value !== "string") {
|
|
356
|
+
return { ok: false, error: `'activation.claudeEnv.${key}' must be a string` };
|
|
357
|
+
}
|
|
358
|
+
}
|
|
359
|
+
}
|
|
343
360
|
const claudeBundleRoot = d.install.claude?.bundleRoot;
|
|
344
361
|
if (claudeBundleRoot === undefined) {
|
|
345
362
|
for (const field of ["claudeHookScript", "claudeStopScript", "claudeStatuslineScript"]) {
|
|
@@ -481,14 +498,17 @@ function resolveBundlePaths(entries, bundle) {
|
|
|
481
498
|
return [...result].sort();
|
|
482
499
|
}
|
|
483
500
|
|
|
501
|
+
// src/cli/commands/install.ts
|
|
502
|
+
import { join as join9 } from "path";
|
|
503
|
+
|
|
484
504
|
// src/cli/adapters/claude.ts
|
|
485
|
-
import { existsSync as existsSync3, mkdirSync as mkdirSync2 } from "
|
|
486
|
-
import { homedir } from "
|
|
487
|
-
import { dirname as dirname2, join as join3 } from "
|
|
505
|
+
import { existsSync as existsSync3, mkdirSync as mkdirSync2 } from "fs";
|
|
506
|
+
import { homedir } from "os";
|
|
507
|
+
import { dirname as dirname2, join as join3 } from "path";
|
|
488
508
|
|
|
489
509
|
// src/cli/adapters/bundle.ts
|
|
490
|
-
import { chmodSync, existsSync as existsSync2, mkdirSync, rmSync, rmdirSync, statSync, unlinkSync } from "
|
|
491
|
-
import { dirname, join as join2 } from "
|
|
510
|
+
import { chmodSync, existsSync as existsSync2, mkdirSync, rmSync, rmdirSync, statSync, unlinkSync } from "fs";
|
|
511
|
+
import { dirname, join as join2 } from "path";
|
|
492
512
|
function shouldBeExecutable(relPath, content) {
|
|
493
513
|
if (relPath.endsWith(".sh"))
|
|
494
514
|
return true;
|
|
@@ -732,6 +752,62 @@ async function wireStatusLine(settingsPath, skillName, scriptPath) {
|
|
|
732
752
|
await Bun.write(settingsPath, JSON.stringify(settings, null, 2) + `
|
|
733
753
|
`);
|
|
734
754
|
}
|
|
755
|
+
async function holdsStatusLine(settingsPath, skillName) {
|
|
756
|
+
if (!existsSync3(settingsPath))
|
|
757
|
+
return false;
|
|
758
|
+
const settings = await Bun.file(settingsPath).json();
|
|
759
|
+
return ownsStatusLine(settings.statusLine?.command, skillName);
|
|
760
|
+
}
|
|
761
|
+
async function wireEnv(settingsPath, env) {
|
|
762
|
+
let settings = {};
|
|
763
|
+
if (existsSync3(settingsPath)) {
|
|
764
|
+
settings = await Bun.file(settingsPath).json();
|
|
765
|
+
}
|
|
766
|
+
const added = {};
|
|
767
|
+
for (const [key, value] of Object.entries(env)) {
|
|
768
|
+
if (settings.env !== undefined && key in settings.env)
|
|
769
|
+
continue;
|
|
770
|
+
settings.env = { ...settings.env, [key]: value };
|
|
771
|
+
added[key] = value;
|
|
772
|
+
}
|
|
773
|
+
if (Object.keys(added).length === 0)
|
|
774
|
+
return added;
|
|
775
|
+
mkdirSync2(dirname2(settingsPath), { recursive: true });
|
|
776
|
+
await Bun.write(settingsPath, JSON.stringify(settings, null, 2) + `
|
|
777
|
+
`);
|
|
778
|
+
return added;
|
|
779
|
+
}
|
|
780
|
+
async function heldEnv(settingsPath, recorded) {
|
|
781
|
+
if (!existsSync3(settingsPath))
|
|
782
|
+
return {};
|
|
783
|
+
const settings = await Bun.file(settingsPath).json();
|
|
784
|
+
const held = {};
|
|
785
|
+
for (const [key, value] of Object.entries(recorded)) {
|
|
786
|
+
if (settings.env?.[key] === value)
|
|
787
|
+
held[key] = value;
|
|
788
|
+
}
|
|
789
|
+
return held;
|
|
790
|
+
}
|
|
791
|
+
async function unwireEnv(settingsPath, added) {
|
|
792
|
+
if (!existsSync3(settingsPath))
|
|
793
|
+
return;
|
|
794
|
+
const settings = await Bun.file(settingsPath).json();
|
|
795
|
+
if (settings.env === undefined)
|
|
796
|
+
return;
|
|
797
|
+
let changed = false;
|
|
798
|
+
for (const [key, value] of Object.entries(added)) {
|
|
799
|
+
if (settings.env[key] !== value)
|
|
800
|
+
continue;
|
|
801
|
+
delete settings.env[key];
|
|
802
|
+
changed = true;
|
|
803
|
+
}
|
|
804
|
+
if (!changed)
|
|
805
|
+
return;
|
|
806
|
+
if (Object.keys(settings.env).length === 0)
|
|
807
|
+
delete settings.env;
|
|
808
|
+
await Bun.write(settingsPath, JSON.stringify(settings, null, 2) + `
|
|
809
|
+
`);
|
|
810
|
+
}
|
|
735
811
|
async function unwireStatusLine(settingsPath, skillName, scriptPath) {
|
|
736
812
|
if (!existsSync3(settingsPath))
|
|
737
813
|
return;
|
|
@@ -746,7 +822,7 @@ async function unwireStatusLine(settingsPath, skillName, scriptPath) {
|
|
|
746
822
|
}
|
|
747
823
|
var claudeAdapter = {
|
|
748
824
|
name: "claude",
|
|
749
|
-
async install(cwd, manifest, files, activation) {
|
|
825
|
+
async install(cwd, manifest, files, activation, _isGlobal, options) {
|
|
750
826
|
const installed = [];
|
|
751
827
|
const config = manifest.install.claude;
|
|
752
828
|
if (!config)
|
|
@@ -804,13 +880,16 @@ var claudeAdapter = {
|
|
|
804
880
|
installed.push(".claude/settings.json");
|
|
805
881
|
}
|
|
806
882
|
}
|
|
807
|
-
if (activation === "global" && manifest.activation?.claudeStatuslineScript && config.bundleRoot) {
|
|
883
|
+
if (activation === "global" && options?.statusline && manifest.activation?.claudeStatuslineScript && config.bundleRoot) {
|
|
808
884
|
const settingsPath = join3(cwd, ".claude/settings.json");
|
|
809
885
|
await wireStatusLine(settingsPath, manifest.name, join3(cwd, config.bundleRoot, manifest.activation.claudeStatuslineScript));
|
|
810
886
|
if (!installed.includes(".claude/settings.json")) {
|
|
811
887
|
installed.push(".claude/settings.json");
|
|
812
888
|
}
|
|
813
889
|
}
|
|
890
|
+
if (options?.statusline === false && manifest.activation?.claudeStatuslineScript && config.bundleRoot) {
|
|
891
|
+
await unwireStatusLine(join3(cwd, ".claude/settings.json"), manifest.name, join3(cwd, config.bundleRoot, manifest.activation.claudeStatuslineScript));
|
|
892
|
+
}
|
|
814
893
|
if (config.postinstall && config.bundleRoot) {
|
|
815
894
|
const scriptPath = join3(cwd, config.bundleRoot, config.postinstall);
|
|
816
895
|
const result = runScript(scriptPath, join3(cwd, config.bundleRoot));
|
|
@@ -862,8 +941,8 @@ var claudeAdapter = {
|
|
|
862
941
|
};
|
|
863
942
|
|
|
864
943
|
// src/cli/adapters/cursor.ts
|
|
865
|
-
import { existsSync as existsSync4, mkdirSync as mkdirSync3, unlinkSync as unlinkSync2, rmdirSync as rmdirSync2 } from "
|
|
866
|
-
import { dirname as dirname3, join as join4 } from "
|
|
944
|
+
import { existsSync as existsSync4, mkdirSync as mkdirSync3, unlinkSync as unlinkSync2, rmdirSync as rmdirSync2 } from "fs";
|
|
945
|
+
import { dirname as dirname3, join as join4 } from "path";
|
|
867
946
|
var cursorAdapter = {
|
|
868
947
|
name: "cursor",
|
|
869
948
|
async install(cwd, manifest, files, _activation) {
|
|
@@ -936,8 +1015,8 @@ var cursorAdapter = {
|
|
|
936
1015
|
};
|
|
937
1016
|
|
|
938
1017
|
// src/cli/adapters/codex.ts
|
|
939
|
-
import { existsSync as existsSync5, mkdirSync as mkdirSync4 } from "
|
|
940
|
-
import { dirname as dirname4, join as join5 } from "
|
|
1018
|
+
import { existsSync as existsSync5, mkdirSync as mkdirSync4 } from "fs";
|
|
1019
|
+
import { dirname as dirname4, join as join5 } from "path";
|
|
941
1020
|
function shq2(s) {
|
|
942
1021
|
return "'" + s.replace(/'/g, "'\\''") + "'";
|
|
943
1022
|
}
|
|
@@ -1041,7 +1120,7 @@ var codexAdapter = {
|
|
|
1041
1120
|
if (!config)
|
|
1042
1121
|
return installed;
|
|
1043
1122
|
if (config.mcpServers) {
|
|
1044
|
-
console.warn(
|
|
1123
|
+
console.warn(`\u26A0 Codex does not support MCP servers \u2014 skipping MCP install for '${manifest.name}'`);
|
|
1045
1124
|
return installed;
|
|
1046
1125
|
}
|
|
1047
1126
|
if (config.append && config.prompt && files.has(manifest.files?.prompt ?? "")) {
|
|
@@ -1128,8 +1207,8 @@ var codexAdapter = {
|
|
|
1128
1207
|
};
|
|
1129
1208
|
|
|
1130
1209
|
// src/cli/adapters/gemini.ts
|
|
1131
|
-
import { existsSync as existsSync6, mkdirSync as mkdirSync5, unlinkSync as unlinkSync3, rmdirSync as rmdirSync3 } from "
|
|
1132
|
-
import { dirname as dirname5, join as join6 } from "
|
|
1210
|
+
import { existsSync as existsSync6, mkdirSync as mkdirSync5, unlinkSync as unlinkSync3, rmdirSync as rmdirSync3 } from "fs";
|
|
1211
|
+
import { dirname as dirname5, join as join6 } from "path";
|
|
1133
1212
|
var geminiAdapter = {
|
|
1134
1213
|
name: "gemini",
|
|
1135
1214
|
async install(cwd, manifest, files, _activation) {
|
|
@@ -1202,8 +1281,8 @@ var geminiAdapter = {
|
|
|
1202
1281
|
};
|
|
1203
1282
|
|
|
1204
1283
|
// src/cli/adapters/antigravity.ts
|
|
1205
|
-
import { existsSync as existsSync7, mkdirSync as mkdirSync6 } from "
|
|
1206
|
-
import { dirname as dirname6, join as join7 } from "
|
|
1284
|
+
import { existsSync as existsSync7, mkdirSync as mkdirSync6 } from "fs";
|
|
1285
|
+
import { dirname as dirname6, join as join7 } from "path";
|
|
1207
1286
|
function shq3(s) {
|
|
1208
1287
|
return "'" + s.replace(/'/g, "'\\''") + "'";
|
|
1209
1288
|
}
|
|
@@ -1260,14 +1339,18 @@ async function wireAntigravityStatusLine(settingsPath, command) {
|
|
|
1260
1339
|
`);
|
|
1261
1340
|
return true;
|
|
1262
1341
|
}
|
|
1263
|
-
async function
|
|
1342
|
+
async function holdsAntigravityStatusLine(settingsPath, bundleDir) {
|
|
1264
1343
|
if (!existsSync7(settingsPath))
|
|
1265
|
-
return;
|
|
1344
|
+
return false;
|
|
1266
1345
|
const settings = await Bun.file(settingsPath).json();
|
|
1267
1346
|
const statusLine = settings.statusLine;
|
|
1268
1347
|
const command = typeof statusLine === "object" && statusLine !== null && "command" in statusLine ? statusLine.command : undefined;
|
|
1269
|
-
|
|
1348
|
+
return typeof command === "string" && command.includes(`${bundleDir}/`);
|
|
1349
|
+
}
|
|
1350
|
+
async function unwireAntigravityStatusLine(settingsPath, bundleDir) {
|
|
1351
|
+
if (!await holdsAntigravityStatusLine(settingsPath, bundleDir))
|
|
1270
1352
|
return;
|
|
1353
|
+
const settings = await Bun.file(settingsPath).json();
|
|
1271
1354
|
delete settings.statusLine;
|
|
1272
1355
|
await Bun.write(settingsPath, JSON.stringify(settings, null, 2) + `
|
|
1273
1356
|
`);
|
|
@@ -1281,7 +1364,7 @@ function hooksPathFor(cwd, bundleRoot) {
|
|
|
1281
1364
|
var SETTINGS_PATH = ".gemini/antigravity-cli/settings.json";
|
|
1282
1365
|
var antigravityAdapter = {
|
|
1283
1366
|
name: "antigravity",
|
|
1284
|
-
async install(cwd, manifest, files, activation) {
|
|
1367
|
+
async install(cwd, manifest, files, activation, _isGlobal, options) {
|
|
1285
1368
|
const installed = [];
|
|
1286
1369
|
const config = manifest.install.antigravity;
|
|
1287
1370
|
if (!config)
|
|
@@ -1313,12 +1396,15 @@ var antigravityAdapter = {
|
|
|
1313
1396
|
if (activation === "global" && hooks && config.bundleRoot) {
|
|
1314
1397
|
const bundleDir = join7(cwd, config.bundleRoot);
|
|
1315
1398
|
await wireAntigravityHooks(hooksPathFor(cwd, config.bundleRoot), manifest.name, bundleDir, manifest.activation?.claudeHookDirective, hooks);
|
|
1316
|
-
if (hooks.statusline && isGlobalInstall(config.bundleRoot)) {
|
|
1399
|
+
if (options?.statusline && hooks.statusline && isGlobalInstall(config.bundleRoot)) {
|
|
1317
1400
|
const script = shq3(join7(bundleDir, hooks.statusline));
|
|
1318
1401
|
const command = `if [ -f ${script} ]; then bash ${script}; fi`;
|
|
1319
1402
|
await wireAntigravityStatusLine(join7(cwd, SETTINGS_PATH), command);
|
|
1320
1403
|
}
|
|
1321
1404
|
}
|
|
1405
|
+
if (options?.statusline === false && config.bundleRoot && isGlobalInstall(config.bundleRoot)) {
|
|
1406
|
+
await unwireAntigravityStatusLine(join7(cwd, SETTINGS_PATH), join7(cwd, config.bundleRoot));
|
|
1407
|
+
}
|
|
1322
1408
|
return installed;
|
|
1323
1409
|
},
|
|
1324
1410
|
async remove(cwd, manifest, installedFiles) {
|
|
@@ -1361,7 +1447,7 @@ function getAdapter(tool) {
|
|
|
1361
1447
|
}
|
|
1362
1448
|
|
|
1363
1449
|
// src/cli/lockfile.ts
|
|
1364
|
-
import { join as join8 } from "
|
|
1450
|
+
import { join as join8 } from "path";
|
|
1365
1451
|
var LOCKFILE_NAME = ".agent-skills.lock";
|
|
1366
1452
|
function fromPreChangeEntry(entry) {
|
|
1367
1453
|
const record = {
|
|
@@ -1421,7 +1507,7 @@ async function removeSkillFromLockfile(cwd, skillName) {
|
|
|
1421
1507
|
}
|
|
1422
1508
|
|
|
1423
1509
|
// src/cli/commands/install.ts
|
|
1424
|
-
async function installSkill(cwd, manifest, files, targetTools, activation, isGlobal) {
|
|
1510
|
+
async function installSkill(cwd, manifest, files, targetTools, activation, isGlobal, options = {}) {
|
|
1425
1511
|
const compatibleTools = targetTools.filter((t) => manifest.tools.includes(t));
|
|
1426
1512
|
const skipped = targetTools.filter((t) => !manifest.tools.includes(t));
|
|
1427
1513
|
if (compatibleTools.length === 0) {
|
|
@@ -1431,129 +1517,35 @@ async function installSkill(cwd, manifest, files, targetTools, activation, isGlo
|
|
|
1431
1517
|
};
|
|
1432
1518
|
}
|
|
1433
1519
|
const installed = {};
|
|
1520
|
+
const previous = (await readLockfile(cwd)).skills[manifest.name]?.tools ?? {};
|
|
1434
1521
|
for (const tool of compatibleTools) {
|
|
1435
1522
|
const adapter = getAdapter(tool);
|
|
1523
|
+
const statusline = options.statusline ?? previous[tool]?.statusline === true;
|
|
1436
1524
|
const config = manifest.install[tool];
|
|
1437
1525
|
const resolved = config ? { ...manifest, install: { ...manifest.install, [tool]: resolveInstallConfig(config, isGlobal) } } : manifest;
|
|
1438
|
-
const toolFiles = await adapter.install(cwd, resolved, files, activation, isGlobal);
|
|
1526
|
+
const toolFiles = await adapter.install(cwd, resolved, files, activation, isGlobal, { ...options, statusline });
|
|
1439
1527
|
installed[tool] = toolFiles;
|
|
1528
|
+
const claudeEnv = manifest.activation?.claudeEnv;
|
|
1529
|
+
const settingsPath = join9(cwd, ".claude/settings.json");
|
|
1530
|
+
const previousEnv = previous[tool]?.env;
|
|
1531
|
+
const envAdded = {
|
|
1532
|
+
...previousEnv ? await heldEnv(settingsPath, previousEnv) : {},
|
|
1533
|
+
...tool === "claude" && activation === "global" && claudeEnv ? await wireEnv(settingsPath, claudeEnv) : {}
|
|
1534
|
+
};
|
|
1440
1535
|
await addSkillToLockfile(cwd, manifest.name, tool, {
|
|
1441
1536
|
version: manifest.version,
|
|
1442
1537
|
files: toolFiles,
|
|
1443
|
-
...activation !== undefined ? { activation } : {}
|
|
1538
|
+
...activation !== undefined ? { activation } : {},
|
|
1539
|
+
...statusline ? { statusline: true } : {},
|
|
1540
|
+
...Object.keys(envAdded).length > 0 ? { env: envAdded } : {}
|
|
1444
1541
|
});
|
|
1445
1542
|
}
|
|
1446
1543
|
return { ok: true, installed, skipped };
|
|
1447
1544
|
}
|
|
1448
1545
|
|
|
1449
1546
|
// src/cli/commands/remove.ts
|
|
1450
|
-
import { existsSync as existsSync8, statSync as statSync2, unlinkSync as unlinkSync4, rmSync as rmSync2 } from "
|
|
1451
|
-
import { basename, dirname as dirname7, join as
|
|
1452
|
-
|
|
1453
|
-
// src/cli/github.ts
|
|
1454
|
-
var REPO2 = "iceinvein/agent-skills";
|
|
1455
|
-
var BRANCH2 = "master";
|
|
1456
|
-
var BASE2 = `https://raw.githubusercontent.com/${REPO2}/${BRANCH2}`;
|
|
1457
|
-
function buildRawUrl2(skillName, filePath) {
|
|
1458
|
-
return `${BASE2}/skills/${skillName}/${filePath}`;
|
|
1459
|
-
}
|
|
1460
|
-
async function fetchSkillManifest2(skillName) {
|
|
1461
|
-
const url = buildRawUrl2(skillName, "skill.json");
|
|
1462
|
-
const res = await fetch(url);
|
|
1463
|
-
if (res.status === 404) {
|
|
1464
|
-
return { ok: false, error: `Skill '${skillName}' not found` };
|
|
1465
|
-
}
|
|
1466
|
-
if (!res.ok) {
|
|
1467
|
-
return { ok: false, error: `Failed to fetch manifest: HTTP ${res.status}` };
|
|
1468
|
-
}
|
|
1469
|
-
const data = await res.json();
|
|
1470
|
-
return validateManifest(data);
|
|
1471
|
-
}
|
|
1472
|
-
async function fetchSkillFile2(skillName, filePath) {
|
|
1473
|
-
const url = buildRawUrl2(skillName, filePath);
|
|
1474
|
-
const res = await fetch(url);
|
|
1475
|
-
if (!res.ok) {
|
|
1476
|
-
return { ok: false, error: `Failed to fetch '${filePath}': HTTP ${res.status}` };
|
|
1477
|
-
}
|
|
1478
|
-
const content = await res.text();
|
|
1479
|
-
return { ok: true, content };
|
|
1480
|
-
}
|
|
1481
|
-
async function fetchAllSkillFiles2(skillName, manifest) {
|
|
1482
|
-
const files = new Map;
|
|
1483
|
-
if (manifest.files?.prompt) {
|
|
1484
|
-
const result = await fetchSkillFile2(skillName, manifest.files.prompt);
|
|
1485
|
-
if (!result.ok)
|
|
1486
|
-
return { error: result.error };
|
|
1487
|
-
files.set(manifest.files.prompt, result.content);
|
|
1488
|
-
}
|
|
1489
|
-
if (manifest.files?.supporting) {
|
|
1490
|
-
for (const supportFile of manifest.files.supporting) {
|
|
1491
|
-
const result = await fetchSkillFile2(skillName, supportFile);
|
|
1492
|
-
if (!result.ok)
|
|
1493
|
-
return { error: result.error };
|
|
1494
|
-
files.set(supportFile, result.content);
|
|
1495
|
-
}
|
|
1496
|
-
}
|
|
1497
|
-
if (manifest.bundle) {
|
|
1498
|
-
const treeResult = await fetchSkillTree2(skillName);
|
|
1499
|
-
if (!treeResult.ok)
|
|
1500
|
-
return { error: treeResult.error };
|
|
1501
|
-
const bundlePaths = resolveBundlePaths2(treeResult.entries, manifest.bundle);
|
|
1502
|
-
for (const relPath of bundlePaths) {
|
|
1503
|
-
if (files.has(relPath))
|
|
1504
|
-
continue;
|
|
1505
|
-
const result = await fetchSkillFile2(skillName, relPath);
|
|
1506
|
-
if (!result.ok)
|
|
1507
|
-
return { error: result.error };
|
|
1508
|
-
files.set(relPath, result.content);
|
|
1509
|
-
}
|
|
1510
|
-
}
|
|
1511
|
-
return files;
|
|
1512
|
-
}
|
|
1513
|
-
async function fetchSkillTree2(skillName) {
|
|
1514
|
-
const url = `https://api.github.com/repos/${REPO2}/git/trees/${BRANCH2}?recursive=1`;
|
|
1515
|
-
const res = await fetch(url, {
|
|
1516
|
-
headers: { Accept: "application/vnd.github+json" }
|
|
1517
|
-
});
|
|
1518
|
-
if (!res.ok) {
|
|
1519
|
-
return { ok: false, error: `Failed to fetch repo tree: HTTP ${res.status}` };
|
|
1520
|
-
}
|
|
1521
|
-
const data = await res.json();
|
|
1522
|
-
if (data.truncated) {
|
|
1523
|
-
return { ok: false, error: "GitHub tree response was truncated; skill bundle too large to enumerate" };
|
|
1524
|
-
}
|
|
1525
|
-
const prefix = `skills/${skillName}/`;
|
|
1526
|
-
const entries = data.tree.filter((e) => e.path.startsWith(prefix) && (e.type === "blob" || e.type === "tree")).map((e) => ({ path: e.path.slice(prefix.length), type: e.type }));
|
|
1527
|
-
return { ok: true, entries };
|
|
1528
|
-
}
|
|
1529
|
-
function resolveBundlePaths2(entries, bundle) {
|
|
1530
|
-
const excludes = bundle.exclude ?? [];
|
|
1531
|
-
const isExcluded = (p) => excludes.some((ex) => p === ex || p.startsWith(ex));
|
|
1532
|
-
const dirs = new Set;
|
|
1533
|
-
const files = new Set;
|
|
1534
|
-
for (const entry of entries) {
|
|
1535
|
-
if (entry.type === "tree")
|
|
1536
|
-
dirs.add(entry.path);
|
|
1537
|
-
else
|
|
1538
|
-
files.add(entry.path);
|
|
1539
|
-
}
|
|
1540
|
-
const result = new Set;
|
|
1541
|
-
for (const include of bundle.include) {
|
|
1542
|
-
if (dirs.has(include)) {
|
|
1543
|
-
const prefix = include.endsWith("/") ? include : include + "/";
|
|
1544
|
-
for (const f of files) {
|
|
1545
|
-
if (f.startsWith(prefix) && !isExcluded(f))
|
|
1546
|
-
result.add(f);
|
|
1547
|
-
}
|
|
1548
|
-
} else if (files.has(include)) {
|
|
1549
|
-
if (!isExcluded(include))
|
|
1550
|
-
result.add(include);
|
|
1551
|
-
}
|
|
1552
|
-
}
|
|
1553
|
-
return [...result].sort();
|
|
1554
|
-
}
|
|
1555
|
-
|
|
1556
|
-
// src/cli/commands/remove.ts
|
|
1547
|
+
import { existsSync as existsSync8, statSync as statSync2, unlinkSync as unlinkSync4, rmSync as rmSync2 } from "fs";
|
|
1548
|
+
import { basename, dirname as dirname7, join as join10 } from "path";
|
|
1557
1549
|
var SHARED_CONFIG_FILES = new Set([
|
|
1558
1550
|
".claude/settings.json",
|
|
1559
1551
|
".claude/settings.local.json",
|
|
@@ -1597,7 +1589,7 @@ async function cutAgentsSection(agentsPath, skillName) {
|
|
|
1597
1589
|
async function removeWithoutManifest(cwd, skillName, tools, reason, isGlobal) {
|
|
1598
1590
|
const removed = [];
|
|
1599
1591
|
const warnings = [];
|
|
1600
|
-
const skillDirs = (record) => record.files.filter((f) => f.endsWith("SKILL.md")).map((f) =>
|
|
1592
|
+
const skillDirs = (record) => record.files.filter((f) => f.endsWith("SKILL.md")).map((f) => join10(cwd, dirname7(f)));
|
|
1601
1593
|
if (tools.codex) {
|
|
1602
1594
|
for (const bundleDir of skillDirs(tools.codex)) {
|
|
1603
1595
|
for (const hooksPath of codexHooksPathsToUnwire(cwd, isGlobal)) {
|
|
@@ -1606,20 +1598,20 @@ async function removeWithoutManifest(cwd, skillName, tools, reason, isGlobal) {
|
|
|
1606
1598
|
}
|
|
1607
1599
|
}
|
|
1608
1600
|
if (tools.antigravity) {
|
|
1609
|
-
await unwireAntigravityHooks(
|
|
1610
|
-
await unwireAntigravityHooks(
|
|
1601
|
+
await unwireAntigravityHooks(join10(cwd, ".gemini/config/hooks.json"), skillName);
|
|
1602
|
+
await unwireAntigravityHooks(join10(cwd, ".agents/hooks.json"), skillName);
|
|
1611
1603
|
for (const bundleDir of skillDirs(tools.antigravity)) {
|
|
1612
|
-
await unwireAntigravityStatusLine(
|
|
1604
|
+
await unwireAntigravityStatusLine(join10(cwd, ".gemini/antigravity-cli/settings.json"), bundleDir);
|
|
1613
1605
|
}
|
|
1614
1606
|
}
|
|
1615
1607
|
const files = [...new Set(Object.values(tools).flatMap((record) => record.files))];
|
|
1616
1608
|
for (const file of files) {
|
|
1617
1609
|
if (file === "AGENTS.md") {
|
|
1618
|
-
await cutAgentsSection(
|
|
1610
|
+
await cutAgentsSection(join10(cwd, file), skillName);
|
|
1619
1611
|
continue;
|
|
1620
1612
|
}
|
|
1621
1613
|
if (isSharedConfigFile(file)) {
|
|
1622
|
-
const fullPath =
|
|
1614
|
+
const fullPath = join10(cwd, file);
|
|
1623
1615
|
if (existsSync8(fullPath)) {
|
|
1624
1616
|
await unwireSessionStartHook(fullPath, skillName);
|
|
1625
1617
|
await unwireStatusLine(fullPath, skillName);
|
|
@@ -1627,7 +1619,7 @@ async function removeWithoutManifest(cwd, skillName, tools, reason, isGlobal) {
|
|
|
1627
1619
|
warnings.push(`${reason}. Left '${file}' in place, removing '${skillName}'s SessionStart hook and status line from it; any MCP server entries it owns were not touched.`);
|
|
1628
1620
|
continue;
|
|
1629
1621
|
}
|
|
1630
|
-
const fullPath =
|
|
1622
|
+
const fullPath = join10(cwd, file);
|
|
1631
1623
|
if (!existsSync8(fullPath))
|
|
1632
1624
|
continue;
|
|
1633
1625
|
removeFileOrDir(fullPath);
|
|
@@ -1643,7 +1635,10 @@ async function removeSkill(cwd, skillName, isGlobal, manifest) {
|
|
|
1643
1635
|
}
|
|
1644
1636
|
const records = Object.entries(entry.tools);
|
|
1645
1637
|
const allFiles = [...new Set(records.flatMap(([, record]) => record.files))];
|
|
1646
|
-
const
|
|
1638
|
+
const envAdded = entry.tools.claude?.env;
|
|
1639
|
+
if (envAdded)
|
|
1640
|
+
await unwireEnv(join10(cwd, ".claude/settings.json"), envAdded);
|
|
1641
|
+
const manifestResult = manifest ? { ok: true, manifest } : await fetchSkillManifest(skillName);
|
|
1647
1642
|
if (manifestResult.ok) {
|
|
1648
1643
|
const dropped = {};
|
|
1649
1644
|
for (const [tool, record] of records) {
|
|
@@ -1682,9 +1677,9 @@ async function removeSkill(cwd, skillName, isGlobal, manifest) {
|
|
|
1682
1677
|
}
|
|
1683
1678
|
|
|
1684
1679
|
// src/cli/commands/list.ts
|
|
1685
|
-
var
|
|
1686
|
-
var
|
|
1687
|
-
var INDEX_URL = `https://raw.githubusercontent.com/${
|
|
1680
|
+
var REPO2 = "iceinvein/agent-skills";
|
|
1681
|
+
var BRANCH2 = "master";
|
|
1682
|
+
var INDEX_URL = `https://raw.githubusercontent.com/${REPO2}/${BRANCH2}/skills/index.json`;
|
|
1688
1683
|
async function listSkills() {
|
|
1689
1684
|
const res = await fetch(INDEX_URL);
|
|
1690
1685
|
if (!res.ok) {
|
|
@@ -1696,169 +1691,24 @@ async function listSkills() {
|
|
|
1696
1691
|
|
|
1697
1692
|
// src/cli/commands/info.ts
|
|
1698
1693
|
async function infoSkill(skillName) {
|
|
1699
|
-
return
|
|
1694
|
+
return fetchSkillManifest(skillName);
|
|
1700
1695
|
}
|
|
1701
1696
|
|
|
1702
1697
|
// src/cli/commands/update.ts
|
|
1703
|
-
import { homedir as homedir2 } from "
|
|
1704
|
-
|
|
1705
|
-
|
|
1706
|
-
|
|
1707
|
-
|
|
1708
|
-
|
|
1709
|
-
|
|
1710
|
-
|
|
1711
|
-
|
|
1712
|
-
|
|
1713
|
-
|
|
1714
|
-
".agents/hooks.json",
|
|
1715
|
-
".gemini/config/hooks.json",
|
|
1716
|
-
"AGENTS.md"
|
|
1717
|
-
]);
|
|
1718
|
-
function isSharedConfigFile2(relPath) {
|
|
1719
|
-
if (SHARED_CONFIG_FILES2.has(relPath))
|
|
1720
|
-
return true;
|
|
1721
|
-
const parts = relPath.split("/");
|
|
1722
|
-
const name = basename2(relPath);
|
|
1723
|
-
const isConfigName = name === "settings.json" || name === "settings.local.json" || name === "mcp.json";
|
|
1724
|
-
return parts.length === 2 && parts[0].startsWith(".") && isConfigName;
|
|
1725
|
-
}
|
|
1726
|
-
function removeFileOrDir2(fullPath) {
|
|
1727
|
-
const stat = statSync3(fullPath);
|
|
1728
|
-
if (stat.isDirectory()) {
|
|
1729
|
-
rmSync3(fullPath, { recursive: true, force: true });
|
|
1730
|
-
} else {
|
|
1731
|
-
unlinkSync5(fullPath);
|
|
1732
|
-
}
|
|
1733
|
-
}
|
|
1734
|
-
async function cutAgentsSection2(agentsPath, skillName) {
|
|
1735
|
-
if (!existsSync9(agentsPath))
|
|
1736
|
-
return;
|
|
1737
|
-
const content = await Bun.file(agentsPath).text();
|
|
1738
|
-
const startMarker = `<!-- agent-skills:start:${skillName} -->`;
|
|
1739
|
-
const endMarker = `<!-- agent-skills:end:${skillName} -->`;
|
|
1740
|
-
const startIdx = content.indexOf(startMarker);
|
|
1741
|
-
const endIdx = content.indexOf(endMarker);
|
|
1742
|
-
if (startIdx === -1 || endIdx === -1)
|
|
1743
|
-
return;
|
|
1744
|
-
const before = content.slice(0, startIdx).replace(/\n$/, "");
|
|
1745
|
-
const after = content.slice(endIdx + endMarker.length).replace(/^\n/, "");
|
|
1746
|
-
await Bun.write(agentsPath, before + after);
|
|
1747
|
-
}
|
|
1748
|
-
async function removeWithoutManifest2(cwd, skillName, tools, reason, isGlobal) {
|
|
1749
|
-
const removed = [];
|
|
1750
|
-
const warnings = [];
|
|
1751
|
-
const skillDirs = (record) => record.files.filter((f) => f.endsWith("SKILL.md")).map((f) => join10(cwd, dirname8(f)));
|
|
1752
|
-
if (tools.codex) {
|
|
1753
|
-
for (const bundleDir of skillDirs(tools.codex)) {
|
|
1754
|
-
for (const hooksPath of codexHooksPathsToUnwire(cwd, isGlobal)) {
|
|
1755
|
-
await unwireCodexHooks(hooksPath, bundleDir);
|
|
1756
|
-
}
|
|
1757
|
-
}
|
|
1758
|
-
}
|
|
1759
|
-
if (tools.antigravity) {
|
|
1760
|
-
await unwireAntigravityHooks(join10(cwd, ".gemini/config/hooks.json"), skillName);
|
|
1761
|
-
await unwireAntigravityHooks(join10(cwd, ".agents/hooks.json"), skillName);
|
|
1762
|
-
for (const bundleDir of skillDirs(tools.antigravity)) {
|
|
1763
|
-
await unwireAntigravityStatusLine(join10(cwd, ".gemini/antigravity-cli/settings.json"), bundleDir);
|
|
1764
|
-
}
|
|
1765
|
-
}
|
|
1766
|
-
const files = [...new Set(Object.values(tools).flatMap((record) => record.files))];
|
|
1767
|
-
for (const file of files) {
|
|
1768
|
-
if (file === "AGENTS.md") {
|
|
1769
|
-
await cutAgentsSection2(join10(cwd, file), skillName);
|
|
1770
|
-
continue;
|
|
1771
|
-
}
|
|
1772
|
-
if (isSharedConfigFile2(file)) {
|
|
1773
|
-
const fullPath = join10(cwd, file);
|
|
1774
|
-
if (existsSync9(fullPath)) {
|
|
1775
|
-
await unwireSessionStartHook(fullPath, skillName);
|
|
1776
|
-
await unwireStatusLine(fullPath, skillName);
|
|
1777
|
-
}
|
|
1778
|
-
warnings.push(`${reason}. Left '${file}' in place, removing '${skillName}'s SessionStart hook and status line from it; any MCP server entries it owns were not touched.`);
|
|
1779
|
-
continue;
|
|
1780
|
-
}
|
|
1781
|
-
const fullPath = join10(cwd, file);
|
|
1782
|
-
if (!existsSync9(fullPath))
|
|
1783
|
-
continue;
|
|
1784
|
-
removeFileOrDir2(fullPath);
|
|
1785
|
-
removed.push(file);
|
|
1786
|
-
}
|
|
1787
|
-
return { removed, warnings };
|
|
1788
|
-
}
|
|
1789
|
-
async function removeSkill2(cwd, skillName, isGlobal, manifest) {
|
|
1790
|
-
const lockfile = await readLockfile(cwd);
|
|
1791
|
-
const entry = lockfile.skills[skillName];
|
|
1792
|
-
if (!entry) {
|
|
1793
|
-
return { ok: false, error: `Skill '${skillName}' is not installed` };
|
|
1794
|
-
}
|
|
1795
|
-
const records = Object.entries(entry.tools);
|
|
1796
|
-
const allFiles = [...new Set(records.flatMap(([, record]) => record.files))];
|
|
1797
|
-
const manifestResult = manifest ? { ok: true, manifest } : await fetchSkillManifest2(skillName);
|
|
1798
|
-
if (manifestResult.ok) {
|
|
1799
|
-
const dropped = {};
|
|
1800
|
-
for (const [tool, record] of records) {
|
|
1801
|
-
const adapter = getAdapter(tool);
|
|
1802
|
-
const manifest = manifestResult.manifest;
|
|
1803
|
-
const rawConfig = manifest.install[tool];
|
|
1804
|
-
if (!rawConfig) {
|
|
1805
|
-
dropped[tool] = record;
|
|
1806
|
-
continue;
|
|
1807
|
-
}
|
|
1808
|
-
const config = resolveInstallConfig(rawConfig, isGlobal);
|
|
1809
|
-
const toolFiles = record.files.filter((f) => {
|
|
1810
|
-
if (config.prompt && f === config.prompt)
|
|
1811
|
-
return true;
|
|
1812
|
-
if (config.supporting && Object.values(config.supporting).includes(f))
|
|
1813
|
-
return true;
|
|
1814
|
-
if (config.bundleRoot && f.startsWith(`${config.bundleRoot}/`) && !isSharedConfigFile2(f))
|
|
1815
|
-
return true;
|
|
1816
|
-
if (config.mcpServers && (f.includes(".claude/settings") || f.includes(".cursor/mcp") || f.includes(".gemini/settings")))
|
|
1817
|
-
return true;
|
|
1818
|
-
return false;
|
|
1819
|
-
});
|
|
1820
|
-
const resolved = { ...manifest, install: { ...manifest.install, [tool]: config } };
|
|
1821
|
-
await adapter.remove(cwd, resolved, toolFiles, isGlobal);
|
|
1822
|
-
}
|
|
1823
|
-
let warnings = [];
|
|
1824
|
-
if (Object.keys(dropped).length > 0) {
|
|
1825
|
-
({ warnings } = await removeWithoutManifest2(cwd, skillName, dropped, `The manifest no longer lists ${Object.keys(dropped).join(", ")}`, isGlobal));
|
|
1826
|
-
}
|
|
1827
|
-
await removeSkillFromLockfile(cwd, skillName);
|
|
1828
|
-
return { ok: true, removed: allFiles, ...warnings.length > 0 ? { warnings } : {} };
|
|
1829
|
-
}
|
|
1830
|
-
const { removed, warnings } = await removeWithoutManifest2(cwd, skillName, entry.tools, `Manifest unavailable (${manifestResult.error})`, isGlobal);
|
|
1831
|
-
await removeSkillFromLockfile(cwd, skillName);
|
|
1832
|
-
return { ok: true, removed, ...warnings.length > 0 ? { warnings } : {} };
|
|
1833
|
-
}
|
|
1834
|
-
|
|
1835
|
-
// src/cli/commands/install.ts
|
|
1836
|
-
async function installSkill2(cwd, manifest, files, targetTools, activation, isGlobal) {
|
|
1837
|
-
const compatibleTools = targetTools.filter((t) => manifest.tools.includes(t));
|
|
1838
|
-
const skipped = targetTools.filter((t) => !manifest.tools.includes(t));
|
|
1839
|
-
if (compatibleTools.length === 0) {
|
|
1840
|
-
return {
|
|
1841
|
-
ok: false,
|
|
1842
|
-
error: `Skill '${manifest.name}' does not support any of: ${targetTools.join(", ")}. Supported: ${manifest.tools.join(", ")}`
|
|
1843
|
-
};
|
|
1844
|
-
}
|
|
1845
|
-
const installed = {};
|
|
1846
|
-
for (const tool of compatibleTools) {
|
|
1847
|
-
const adapter = getAdapter(tool);
|
|
1848
|
-
const config = manifest.install[tool];
|
|
1849
|
-
const resolved = config ? { ...manifest, install: { ...manifest.install, [tool]: resolveInstallConfig(config, isGlobal) } } : manifest;
|
|
1850
|
-
const toolFiles = await adapter.install(cwd, resolved, files, activation, isGlobal);
|
|
1851
|
-
installed[tool] = toolFiles;
|
|
1852
|
-
await addSkillToLockfile(cwd, manifest.name, tool, {
|
|
1853
|
-
version: manifest.version,
|
|
1854
|
-
files: toolFiles,
|
|
1855
|
-
...activation !== undefined ? { activation } : {}
|
|
1856
|
-
});
|
|
1698
|
+
import { homedir as homedir2 } from "os";
|
|
1699
|
+
import { join as join11 } from "path";
|
|
1700
|
+
async function holdsOwnStatusLine(cwd, tool, manifest, isGlobal) {
|
|
1701
|
+
if (tool === "claude")
|
|
1702
|
+
return holdsStatusLine(join11(cwd, ".claude/settings.json"), manifest.name);
|
|
1703
|
+
if (tool === "antigravity") {
|
|
1704
|
+
const config = manifest.install.antigravity;
|
|
1705
|
+
const bundleRoot = config ? resolveInstallConfig(config, isGlobal).bundleRoot : undefined;
|
|
1706
|
+
if (bundleRoot === undefined)
|
|
1707
|
+
return false;
|
|
1708
|
+
return holdsAntigravityStatusLine(join11(cwd, ".gemini/antigravity-cli/settings.json"), join11(cwd, bundleRoot));
|
|
1857
1709
|
}
|
|
1858
|
-
return
|
|
1710
|
+
return false;
|
|
1859
1711
|
}
|
|
1860
|
-
|
|
1861
|
-
// src/cli/commands/update.ts
|
|
1862
1712
|
async function updateSkill(cwd, skillName) {
|
|
1863
1713
|
const lockfile = await readLockfile(cwd);
|
|
1864
1714
|
const entry = lockfile.skills[skillName];
|
|
@@ -1868,24 +1718,30 @@ async function updateSkill(cwd, skillName) {
|
|
|
1868
1718
|
const records = Object.entries(entry.tools);
|
|
1869
1719
|
const oldVersion = lowestInstalledVersion(entry);
|
|
1870
1720
|
const isGlobal = cwd === homedir2();
|
|
1871
|
-
const manifestResult = await
|
|
1721
|
+
const manifestResult = await fetchSkillManifest(skillName);
|
|
1872
1722
|
if (!manifestResult.ok) {
|
|
1873
1723
|
return { ok: false, error: manifestResult.error };
|
|
1874
1724
|
}
|
|
1875
|
-
const filesResult = await
|
|
1725
|
+
const filesResult = await fetchAllSkillFiles(skillName, manifestResult.manifest);
|
|
1876
1726
|
if ("error" in filesResult) {
|
|
1877
1727
|
return { ok: false, error: filesResult.error };
|
|
1878
1728
|
}
|
|
1879
1729
|
const manifest = manifestResult.manifest;
|
|
1880
1730
|
const kept = records.filter(([tool]) => manifest.tools.includes(tool));
|
|
1881
1731
|
const skipped = records.filter(([tool]) => !manifest.tools.includes(tool)).map(([tool]) => tool);
|
|
1882
|
-
const
|
|
1732
|
+
const statusline = new Map;
|
|
1733
|
+
for (const [tool, record] of kept) {
|
|
1734
|
+
statusline.set(tool, record.statusline === true || await holdsOwnStatusLine(cwd, tool, manifest, isGlobal));
|
|
1735
|
+
}
|
|
1736
|
+
const removeResult = await removeSkill(cwd, skillName, isGlobal, manifest);
|
|
1883
1737
|
if (!removeResult.ok) {
|
|
1884
1738
|
return { ok: false, error: removeResult.error };
|
|
1885
1739
|
}
|
|
1886
1740
|
const failures = [];
|
|
1887
1741
|
for (const [tool, record] of kept) {
|
|
1888
|
-
const installResult = await
|
|
1742
|
+
const installResult = await installSkill(cwd, manifest, filesResult, [tool], record.activation, isGlobal, {
|
|
1743
|
+
statusline: statusline.get(tool)
|
|
1744
|
+
});
|
|
1889
1745
|
if (!installResult.ok)
|
|
1890
1746
|
failures.push(installResult.error);
|
|
1891
1747
|
}
|
|
@@ -1908,7 +1764,7 @@ async function updateAllSkills(cwd) {
|
|
|
1908
1764
|
}
|
|
1909
1765
|
|
|
1910
1766
|
// src/cli/commands/bump.ts
|
|
1911
|
-
import { join as
|
|
1767
|
+
import { join as join12 } from "path";
|
|
1912
1768
|
|
|
1913
1769
|
// src/cli/semver.ts
|
|
1914
1770
|
function bumpVersion(current, level) {
|
|
@@ -1929,7 +1785,7 @@ function bumpVersion(current, level) {
|
|
|
1929
1785
|
|
|
1930
1786
|
// src/cli/commands/bump.ts
|
|
1931
1787
|
async function bumpSkill(repoRoot, skillName, level) {
|
|
1932
|
-
const manifestPath =
|
|
1788
|
+
const manifestPath = join12(repoRoot, "skills", skillName, "skill.json");
|
|
1933
1789
|
const file = Bun.file(manifestPath);
|
|
1934
1790
|
if (!await file.exists()) {
|
|
1935
1791
|
return { ok: false, error: `Skill '${skillName}' not found at skills/${skillName}/skill.json` };
|
|
@@ -2000,7 +1856,7 @@ async function bumpAllChanged(repoRoot, level, dryRun) {
|
|
|
2000
1856
|
if (skillVersionChanged(repoRoot, skillName, tag))
|
|
2001
1857
|
continue;
|
|
2002
1858
|
if (dryRun) {
|
|
2003
|
-
const manifestPath =
|
|
1859
|
+
const manifestPath = join12(repoRoot, "skills", skillName, "skill.json");
|
|
2004
1860
|
const file = Bun.file(manifestPath);
|
|
2005
1861
|
if (!await file.exists())
|
|
2006
1862
|
continue;
|
|
@@ -2035,7 +1891,7 @@ async function checkForUpdates(cwd) {
|
|
|
2035
1891
|
}
|
|
2036
1892
|
const results = await Promise.all(skillNames.map(async (name) => {
|
|
2037
1893
|
try {
|
|
2038
|
-
const result = await
|
|
1894
|
+
const result = await fetchSkillManifest(name);
|
|
2039
1895
|
if (!result.ok)
|
|
2040
1896
|
return null;
|
|
2041
1897
|
const records = Object.values(lockfile.skills[name].tools);
|
|
@@ -2056,38 +1912,6 @@ async function checkForUpdates(cwd) {
|
|
|
2056
1912
|
}
|
|
2057
1913
|
}
|
|
2058
1914
|
|
|
2059
|
-
// src/cli/lockfile.ts
|
|
2060
|
-
import { join as join12 } from "node:path";
|
|
2061
|
-
var LOCKFILE_NAME2 = ".agent-skills.lock";
|
|
2062
|
-
function fromPreChangeEntry2(entry) {
|
|
2063
|
-
const record = {
|
|
2064
|
-
version: entry.version,
|
|
2065
|
-
files: entry.files,
|
|
2066
|
-
...entry.activation !== undefined ? { activation: entry.activation } : {}
|
|
2067
|
-
};
|
|
2068
|
-
const tools = {};
|
|
2069
|
-
for (const tool of entry.tools)
|
|
2070
|
-
tools[tool] = record;
|
|
2071
|
-
return { installedAt: entry.installedAt, tools };
|
|
2072
|
-
}
|
|
2073
|
-
async function readLockfile2(cwd) {
|
|
2074
|
-
const path = join12(cwd, LOCKFILE_NAME2);
|
|
2075
|
-
const file = Bun.file(path);
|
|
2076
|
-
if (!await file.exists()) {
|
|
2077
|
-
return { skills: {} };
|
|
2078
|
-
}
|
|
2079
|
-
const lockfile = await file.json();
|
|
2080
|
-
for (const [name, entry] of Object.entries(lockfile.skills)) {
|
|
2081
|
-
if (Array.isArray(entry.tools)) {
|
|
2082
|
-
lockfile.skills[name] = fromPreChangeEntry2(entry);
|
|
2083
|
-
}
|
|
2084
|
-
}
|
|
2085
|
-
return lockfile;
|
|
2086
|
-
}
|
|
2087
|
-
|
|
2088
|
-
// src/cli/types.ts
|
|
2089
|
-
var TOOL_NAMES2 = ["claude", "cursor", "codex", "gemini", "antigravity"];
|
|
2090
|
-
|
|
2091
1915
|
// node_modules/@inquirer/core/dist/lib/key.js
|
|
2092
1916
|
var isUpKey = (key, keybindings = []) => key.name === "up" || keybindings.includes("vim") && key.name === "k" || keybindings.includes("emacs") && key.ctrl && key.name === "p";
|
|
2093
1917
|
var isDownKey = (key, keybindings = []) => key.name === "down" || keybindings.includes("vim") && key.name === "j" || keybindings.includes("emacs") && key.ctrl && key.name === "n";
|
|
@@ -2122,10 +1946,10 @@ class ValidationError extends Error {
|
|
|
2122
1946
|
name = "ValidationError";
|
|
2123
1947
|
}
|
|
2124
1948
|
// node_modules/@inquirer/core/dist/lib/use-state.js
|
|
2125
|
-
import { AsyncResource as AsyncResource2 } from "
|
|
1949
|
+
import { AsyncResource as AsyncResource2 } from "async_hooks";
|
|
2126
1950
|
|
|
2127
1951
|
// node_modules/@inquirer/core/dist/lib/hook-engine.js
|
|
2128
|
-
import { AsyncLocalStorage, AsyncResource } from "
|
|
1952
|
+
import { AsyncLocalStorage, AsyncResource } from "async_hooks";
|
|
2129
1953
|
var hookStorage = new AsyncLocalStorage;
|
|
2130
1954
|
function createStore(rl) {
|
|
2131
1955
|
const store = {
|
|
@@ -2263,10 +2087,10 @@ function useEffect(cb, depArray) {
|
|
|
2263
2087
|
}
|
|
2264
2088
|
|
|
2265
2089
|
// node_modules/@inquirer/core/dist/lib/theme.js
|
|
2266
|
-
import { styleText } from "
|
|
2090
|
+
import { styleText } from "util";
|
|
2267
2091
|
|
|
2268
2092
|
// node_modules/@inquirer/figures/dist/index.js
|
|
2269
|
-
import process2 from "
|
|
2093
|
+
import process2 from "process";
|
|
2270
2094
|
function isUnicodeSupported() {
|
|
2271
2095
|
if (!process2.platform.startsWith("win")) {
|
|
2272
2096
|
return process2.env["TERM"] !== "linux";
|
|
@@ -2276,267 +2100,267 @@ function isUnicodeSupported() {
|
|
|
2276
2100
|
var common = {
|
|
2277
2101
|
circleQuestionMark: "(?)",
|
|
2278
2102
|
questionMarkPrefix: "(?)",
|
|
2279
|
-
square: "
|
|
2280
|
-
squareDarkShade: "
|
|
2281
|
-
squareMediumShade: "
|
|
2282
|
-
squareLightShade: "
|
|
2283
|
-
squareTop: "
|
|
2284
|
-
squareBottom: "
|
|
2285
|
-
squareLeft: "
|
|
2286
|
-
squareRight: "
|
|
2287
|
-
squareCenter: "
|
|
2288
|
-
bullet: "
|
|
2289
|
-
dot: "
|
|
2290
|
-
ellipsis: "
|
|
2291
|
-
pointerSmall: "
|
|
2292
|
-
triangleUp: "
|
|
2293
|
-
triangleUpSmall: "
|
|
2294
|
-
triangleDown: "
|
|
2295
|
-
triangleDownSmall: "
|
|
2296
|
-
triangleLeftSmall: "
|
|
2297
|
-
triangleRightSmall: "
|
|
2298
|
-
home: "
|
|
2299
|
-
heart: "
|
|
2300
|
-
musicNote: "
|
|
2301
|
-
musicNoteBeamed: "
|
|
2302
|
-
arrowUp: "
|
|
2303
|
-
arrowDown: "
|
|
2304
|
-
arrowLeft: "
|
|
2305
|
-
arrowRight: "
|
|
2306
|
-
arrowLeftRight: "
|
|
2307
|
-
arrowUpDown: "
|
|
2308
|
-
almostEqual: "
|
|
2309
|
-
notEqual: "
|
|
2310
|
-
lessOrEqual: "
|
|
2311
|
-
greaterOrEqual: "
|
|
2312
|
-
identical: "
|
|
2313
|
-
infinity: "
|
|
2314
|
-
subscriptZero: "
|
|
2315
|
-
subscriptOne: "
|
|
2316
|
-
subscriptTwo: "
|
|
2317
|
-
subscriptThree: "
|
|
2318
|
-
subscriptFour: "
|
|
2319
|
-
subscriptFive: "
|
|
2320
|
-
subscriptSix: "
|
|
2321
|
-
subscriptSeven: "
|
|
2322
|
-
subscriptEight: "
|
|
2323
|
-
subscriptNine: "
|
|
2324
|
-
oneHalf: "
|
|
2325
|
-
oneThird: "
|
|
2326
|
-
oneQuarter: "
|
|
2327
|
-
oneFifth: "
|
|
2328
|
-
oneSixth: "
|
|
2329
|
-
oneEighth: "
|
|
2330
|
-
twoThirds: "
|
|
2331
|
-
twoFifths: "
|
|
2332
|
-
threeQuarters: "
|
|
2333
|
-
threeFifths: "
|
|
2334
|
-
threeEighths: "
|
|
2335
|
-
fourFifths: "
|
|
2336
|
-
fiveSixths: "
|
|
2337
|
-
fiveEighths: "
|
|
2338
|
-
sevenEighths: "
|
|
2339
|
-
line: "
|
|
2340
|
-
lineBold: "
|
|
2341
|
-
lineDouble: "
|
|
2342
|
-
lineDashed0: "
|
|
2343
|
-
lineDashed1: "
|
|
2344
|
-
lineDashed2: "
|
|
2345
|
-
lineDashed3: "
|
|
2346
|
-
lineDashed4: "
|
|
2347
|
-
lineDashed5: "
|
|
2348
|
-
lineDashed6: "
|
|
2349
|
-
lineDashed7: "
|
|
2350
|
-
lineDashed8: "
|
|
2351
|
-
lineDashed9: "
|
|
2352
|
-
lineDashed10: "
|
|
2353
|
-
lineDashed11: "
|
|
2354
|
-
lineDashed12: "
|
|
2355
|
-
lineDashed13: "
|
|
2356
|
-
lineDashed14: "
|
|
2357
|
-
lineDashed15: "
|
|
2358
|
-
lineVertical: "
|
|
2359
|
-
lineVerticalBold: "
|
|
2360
|
-
lineVerticalDouble: "
|
|
2361
|
-
lineVerticalDashed0: "
|
|
2362
|
-
lineVerticalDashed1: "
|
|
2363
|
-
lineVerticalDashed2: "
|
|
2364
|
-
lineVerticalDashed3: "
|
|
2365
|
-
lineVerticalDashed4: "
|
|
2366
|
-
lineVerticalDashed5: "
|
|
2367
|
-
lineVerticalDashed6: "
|
|
2368
|
-
lineVerticalDashed7: "
|
|
2369
|
-
lineVerticalDashed8: "
|
|
2370
|
-
lineVerticalDashed9: "
|
|
2371
|
-
lineVerticalDashed10: "
|
|
2372
|
-
lineVerticalDashed11: "
|
|
2373
|
-
lineDownLeft: "
|
|
2374
|
-
lineDownLeftArc: "
|
|
2375
|
-
lineDownBoldLeftBold: "
|
|
2376
|
-
lineDownBoldLeft: "
|
|
2377
|
-
lineDownLeftBold: "
|
|
2378
|
-
lineDownDoubleLeftDouble: "
|
|
2379
|
-
lineDownDoubleLeft: "
|
|
2380
|
-
lineDownLeftDouble: "
|
|
2381
|
-
lineDownRight: "
|
|
2382
|
-
lineDownRightArc: "
|
|
2383
|
-
lineDownBoldRightBold: "
|
|
2384
|
-
lineDownBoldRight: "
|
|
2385
|
-
lineDownRightBold: "
|
|
2386
|
-
lineDownDoubleRightDouble: "
|
|
2387
|
-
lineDownDoubleRight: "
|
|
2388
|
-
lineDownRightDouble: "
|
|
2389
|
-
lineUpLeft: "
|
|
2390
|
-
lineUpLeftArc: "
|
|
2391
|
-
lineUpBoldLeftBold: "
|
|
2392
|
-
lineUpBoldLeft: "
|
|
2393
|
-
lineUpLeftBold: "
|
|
2394
|
-
lineUpDoubleLeftDouble: "
|
|
2395
|
-
lineUpDoubleLeft: "
|
|
2396
|
-
lineUpLeftDouble: "
|
|
2397
|
-
lineUpRight: "
|
|
2398
|
-
lineUpRightArc: "
|
|
2399
|
-
lineUpBoldRightBold: "
|
|
2400
|
-
lineUpBoldRight: "
|
|
2401
|
-
lineUpRightBold: "
|
|
2402
|
-
lineUpDoubleRightDouble: "
|
|
2403
|
-
lineUpDoubleRight: "
|
|
2404
|
-
lineUpRightDouble: "
|
|
2405
|
-
lineUpDownLeft: "
|
|
2406
|
-
lineUpBoldDownBoldLeftBold: "
|
|
2407
|
-
lineUpBoldDownBoldLeft: "
|
|
2408
|
-
lineUpDownLeftBold: "
|
|
2409
|
-
lineUpBoldDownLeftBold: "
|
|
2410
|
-
lineUpDownBoldLeftBold: "
|
|
2411
|
-
lineUpDownBoldLeft: "
|
|
2412
|
-
lineUpBoldDownLeft: "
|
|
2413
|
-
lineUpDoubleDownDoubleLeftDouble: "
|
|
2414
|
-
lineUpDoubleDownDoubleLeft: "
|
|
2415
|
-
lineUpDownLeftDouble: "
|
|
2416
|
-
lineUpDownRight: "
|
|
2417
|
-
lineUpBoldDownBoldRightBold: "
|
|
2418
|
-
lineUpBoldDownBoldRight: "
|
|
2419
|
-
lineUpDownRightBold: "
|
|
2420
|
-
lineUpBoldDownRightBold: "
|
|
2421
|
-
lineUpDownBoldRightBold: "
|
|
2422
|
-
lineUpDownBoldRight: "
|
|
2423
|
-
lineUpBoldDownRight: "
|
|
2424
|
-
lineUpDoubleDownDoubleRightDouble: "
|
|
2425
|
-
lineUpDoubleDownDoubleRight: "
|
|
2426
|
-
lineUpDownRightDouble: "
|
|
2427
|
-
lineDownLeftRight: "
|
|
2428
|
-
lineDownBoldLeftBoldRightBold: "
|
|
2429
|
-
lineDownLeftBoldRightBold: "
|
|
2430
|
-
lineDownBoldLeftRight: "
|
|
2431
|
-
lineDownBoldLeftBoldRight: "
|
|
2432
|
-
lineDownBoldLeftRightBold: "
|
|
2433
|
-
lineDownLeftRightBold: "
|
|
2434
|
-
lineDownLeftBoldRight: "
|
|
2435
|
-
lineDownDoubleLeftDoubleRightDouble: "
|
|
2436
|
-
lineDownDoubleLeftRight: "
|
|
2437
|
-
lineDownLeftDoubleRightDouble: "
|
|
2438
|
-
lineUpLeftRight: "
|
|
2439
|
-
lineUpBoldLeftBoldRightBold: "
|
|
2440
|
-
lineUpLeftBoldRightBold: "
|
|
2441
|
-
lineUpBoldLeftRight: "
|
|
2442
|
-
lineUpBoldLeftBoldRight: "
|
|
2443
|
-
lineUpBoldLeftRightBold: "
|
|
2444
|
-
lineUpLeftRightBold: "
|
|
2445
|
-
lineUpLeftBoldRight: "
|
|
2446
|
-
lineUpDoubleLeftDoubleRightDouble: "
|
|
2447
|
-
lineUpDoubleLeftRight: "
|
|
2448
|
-
lineUpLeftDoubleRightDouble: "
|
|
2449
|
-
lineUpDownLeftRight: "
|
|
2450
|
-
lineUpBoldDownBoldLeftBoldRightBold: "
|
|
2451
|
-
lineUpDownBoldLeftBoldRightBold: "
|
|
2452
|
-
lineUpBoldDownLeftBoldRightBold: "
|
|
2453
|
-
lineUpBoldDownBoldLeftRightBold: "
|
|
2454
|
-
lineUpBoldDownBoldLeftBoldRight: "
|
|
2455
|
-
lineUpBoldDownLeftRight: "
|
|
2456
|
-
lineUpDownBoldLeftRight: "
|
|
2457
|
-
lineUpDownLeftBoldRight: "
|
|
2458
|
-
lineUpDownLeftRightBold: "
|
|
2459
|
-
lineUpBoldDownBoldLeftRight: "
|
|
2460
|
-
lineUpDownLeftBoldRightBold: "
|
|
2461
|
-
lineUpBoldDownLeftBoldRight: "
|
|
2462
|
-
lineUpBoldDownLeftRightBold: "
|
|
2463
|
-
lineUpDownBoldLeftBoldRight: "
|
|
2464
|
-
lineUpDownBoldLeftRightBold: "
|
|
2465
|
-
lineUpDoubleDownDoubleLeftDoubleRightDouble: "
|
|
2466
|
-
lineUpDoubleDownDoubleLeftRight: "
|
|
2467
|
-
lineUpDownLeftDoubleRightDouble: "
|
|
2468
|
-
lineCross: "
|
|
2469
|
-
lineBackslash: "
|
|
2470
|
-
lineSlash: "
|
|
2103
|
+
square: "\u2588",
|
|
2104
|
+
squareDarkShade: "\u2593",
|
|
2105
|
+
squareMediumShade: "\u2592",
|
|
2106
|
+
squareLightShade: "\u2591",
|
|
2107
|
+
squareTop: "\u2580",
|
|
2108
|
+
squareBottom: "\u2584",
|
|
2109
|
+
squareLeft: "\u258C",
|
|
2110
|
+
squareRight: "\u2590",
|
|
2111
|
+
squareCenter: "\u25A0",
|
|
2112
|
+
bullet: "\u25CF",
|
|
2113
|
+
dot: "\u2024",
|
|
2114
|
+
ellipsis: "\u2026",
|
|
2115
|
+
pointerSmall: "\u203A",
|
|
2116
|
+
triangleUp: "\u25B2",
|
|
2117
|
+
triangleUpSmall: "\u25B4",
|
|
2118
|
+
triangleDown: "\u25BC",
|
|
2119
|
+
triangleDownSmall: "\u25BE",
|
|
2120
|
+
triangleLeftSmall: "\u25C2",
|
|
2121
|
+
triangleRightSmall: "\u25B8",
|
|
2122
|
+
home: "\u2302",
|
|
2123
|
+
heart: "\u2665",
|
|
2124
|
+
musicNote: "\u266A",
|
|
2125
|
+
musicNoteBeamed: "\u266B",
|
|
2126
|
+
arrowUp: "\u2191",
|
|
2127
|
+
arrowDown: "\u2193",
|
|
2128
|
+
arrowLeft: "\u2190",
|
|
2129
|
+
arrowRight: "\u2192",
|
|
2130
|
+
arrowLeftRight: "\u2194",
|
|
2131
|
+
arrowUpDown: "\u2195",
|
|
2132
|
+
almostEqual: "\u2248",
|
|
2133
|
+
notEqual: "\u2260",
|
|
2134
|
+
lessOrEqual: "\u2264",
|
|
2135
|
+
greaterOrEqual: "\u2265",
|
|
2136
|
+
identical: "\u2261",
|
|
2137
|
+
infinity: "\u221E",
|
|
2138
|
+
subscriptZero: "\u2080",
|
|
2139
|
+
subscriptOne: "\u2081",
|
|
2140
|
+
subscriptTwo: "\u2082",
|
|
2141
|
+
subscriptThree: "\u2083",
|
|
2142
|
+
subscriptFour: "\u2084",
|
|
2143
|
+
subscriptFive: "\u2085",
|
|
2144
|
+
subscriptSix: "\u2086",
|
|
2145
|
+
subscriptSeven: "\u2087",
|
|
2146
|
+
subscriptEight: "\u2088",
|
|
2147
|
+
subscriptNine: "\u2089",
|
|
2148
|
+
oneHalf: "\xBD",
|
|
2149
|
+
oneThird: "\u2153",
|
|
2150
|
+
oneQuarter: "\xBC",
|
|
2151
|
+
oneFifth: "\u2155",
|
|
2152
|
+
oneSixth: "\u2159",
|
|
2153
|
+
oneEighth: "\u215B",
|
|
2154
|
+
twoThirds: "\u2154",
|
|
2155
|
+
twoFifths: "\u2156",
|
|
2156
|
+
threeQuarters: "\xBE",
|
|
2157
|
+
threeFifths: "\u2157",
|
|
2158
|
+
threeEighths: "\u215C",
|
|
2159
|
+
fourFifths: "\u2158",
|
|
2160
|
+
fiveSixths: "\u215A",
|
|
2161
|
+
fiveEighths: "\u215D",
|
|
2162
|
+
sevenEighths: "\u215E",
|
|
2163
|
+
line: "\u2500",
|
|
2164
|
+
lineBold: "\u2501",
|
|
2165
|
+
lineDouble: "\u2550",
|
|
2166
|
+
lineDashed0: "\u2504",
|
|
2167
|
+
lineDashed1: "\u2505",
|
|
2168
|
+
lineDashed2: "\u2508",
|
|
2169
|
+
lineDashed3: "\u2509",
|
|
2170
|
+
lineDashed4: "\u254C",
|
|
2171
|
+
lineDashed5: "\u254D",
|
|
2172
|
+
lineDashed6: "\u2574",
|
|
2173
|
+
lineDashed7: "\u2576",
|
|
2174
|
+
lineDashed8: "\u2578",
|
|
2175
|
+
lineDashed9: "\u257A",
|
|
2176
|
+
lineDashed10: "\u257C",
|
|
2177
|
+
lineDashed11: "\u257E",
|
|
2178
|
+
lineDashed12: "\u2212",
|
|
2179
|
+
lineDashed13: "\u2013",
|
|
2180
|
+
lineDashed14: "\u2010",
|
|
2181
|
+
lineDashed15: "\u2043",
|
|
2182
|
+
lineVertical: "\u2502",
|
|
2183
|
+
lineVerticalBold: "\u2503",
|
|
2184
|
+
lineVerticalDouble: "\u2551",
|
|
2185
|
+
lineVerticalDashed0: "\u2506",
|
|
2186
|
+
lineVerticalDashed1: "\u2507",
|
|
2187
|
+
lineVerticalDashed2: "\u250A",
|
|
2188
|
+
lineVerticalDashed3: "\u250B",
|
|
2189
|
+
lineVerticalDashed4: "\u254E",
|
|
2190
|
+
lineVerticalDashed5: "\u254F",
|
|
2191
|
+
lineVerticalDashed6: "\u2575",
|
|
2192
|
+
lineVerticalDashed7: "\u2577",
|
|
2193
|
+
lineVerticalDashed8: "\u2579",
|
|
2194
|
+
lineVerticalDashed9: "\u257B",
|
|
2195
|
+
lineVerticalDashed10: "\u257D",
|
|
2196
|
+
lineVerticalDashed11: "\u257F",
|
|
2197
|
+
lineDownLeft: "\u2510",
|
|
2198
|
+
lineDownLeftArc: "\u256E",
|
|
2199
|
+
lineDownBoldLeftBold: "\u2513",
|
|
2200
|
+
lineDownBoldLeft: "\u2512",
|
|
2201
|
+
lineDownLeftBold: "\u2511",
|
|
2202
|
+
lineDownDoubleLeftDouble: "\u2557",
|
|
2203
|
+
lineDownDoubleLeft: "\u2556",
|
|
2204
|
+
lineDownLeftDouble: "\u2555",
|
|
2205
|
+
lineDownRight: "\u250C",
|
|
2206
|
+
lineDownRightArc: "\u256D",
|
|
2207
|
+
lineDownBoldRightBold: "\u250F",
|
|
2208
|
+
lineDownBoldRight: "\u250E",
|
|
2209
|
+
lineDownRightBold: "\u250D",
|
|
2210
|
+
lineDownDoubleRightDouble: "\u2554",
|
|
2211
|
+
lineDownDoubleRight: "\u2553",
|
|
2212
|
+
lineDownRightDouble: "\u2552",
|
|
2213
|
+
lineUpLeft: "\u2518",
|
|
2214
|
+
lineUpLeftArc: "\u256F",
|
|
2215
|
+
lineUpBoldLeftBold: "\u251B",
|
|
2216
|
+
lineUpBoldLeft: "\u251A",
|
|
2217
|
+
lineUpLeftBold: "\u2519",
|
|
2218
|
+
lineUpDoubleLeftDouble: "\u255D",
|
|
2219
|
+
lineUpDoubleLeft: "\u255C",
|
|
2220
|
+
lineUpLeftDouble: "\u255B",
|
|
2221
|
+
lineUpRight: "\u2514",
|
|
2222
|
+
lineUpRightArc: "\u2570",
|
|
2223
|
+
lineUpBoldRightBold: "\u2517",
|
|
2224
|
+
lineUpBoldRight: "\u2516",
|
|
2225
|
+
lineUpRightBold: "\u2515",
|
|
2226
|
+
lineUpDoubleRightDouble: "\u255A",
|
|
2227
|
+
lineUpDoubleRight: "\u2559",
|
|
2228
|
+
lineUpRightDouble: "\u2558",
|
|
2229
|
+
lineUpDownLeft: "\u2524",
|
|
2230
|
+
lineUpBoldDownBoldLeftBold: "\u252B",
|
|
2231
|
+
lineUpBoldDownBoldLeft: "\u2528",
|
|
2232
|
+
lineUpDownLeftBold: "\u2525",
|
|
2233
|
+
lineUpBoldDownLeftBold: "\u2529",
|
|
2234
|
+
lineUpDownBoldLeftBold: "\u252A",
|
|
2235
|
+
lineUpDownBoldLeft: "\u2527",
|
|
2236
|
+
lineUpBoldDownLeft: "\u2526",
|
|
2237
|
+
lineUpDoubleDownDoubleLeftDouble: "\u2563",
|
|
2238
|
+
lineUpDoubleDownDoubleLeft: "\u2562",
|
|
2239
|
+
lineUpDownLeftDouble: "\u2561",
|
|
2240
|
+
lineUpDownRight: "\u251C",
|
|
2241
|
+
lineUpBoldDownBoldRightBold: "\u2523",
|
|
2242
|
+
lineUpBoldDownBoldRight: "\u2520",
|
|
2243
|
+
lineUpDownRightBold: "\u251D",
|
|
2244
|
+
lineUpBoldDownRightBold: "\u2521",
|
|
2245
|
+
lineUpDownBoldRightBold: "\u2522",
|
|
2246
|
+
lineUpDownBoldRight: "\u251F",
|
|
2247
|
+
lineUpBoldDownRight: "\u251E",
|
|
2248
|
+
lineUpDoubleDownDoubleRightDouble: "\u2560",
|
|
2249
|
+
lineUpDoubleDownDoubleRight: "\u255F",
|
|
2250
|
+
lineUpDownRightDouble: "\u255E",
|
|
2251
|
+
lineDownLeftRight: "\u252C",
|
|
2252
|
+
lineDownBoldLeftBoldRightBold: "\u2533",
|
|
2253
|
+
lineDownLeftBoldRightBold: "\u252F",
|
|
2254
|
+
lineDownBoldLeftRight: "\u2530",
|
|
2255
|
+
lineDownBoldLeftBoldRight: "\u2531",
|
|
2256
|
+
lineDownBoldLeftRightBold: "\u2532",
|
|
2257
|
+
lineDownLeftRightBold: "\u252E",
|
|
2258
|
+
lineDownLeftBoldRight: "\u252D",
|
|
2259
|
+
lineDownDoubleLeftDoubleRightDouble: "\u2566",
|
|
2260
|
+
lineDownDoubleLeftRight: "\u2565",
|
|
2261
|
+
lineDownLeftDoubleRightDouble: "\u2564",
|
|
2262
|
+
lineUpLeftRight: "\u2534",
|
|
2263
|
+
lineUpBoldLeftBoldRightBold: "\u253B",
|
|
2264
|
+
lineUpLeftBoldRightBold: "\u2537",
|
|
2265
|
+
lineUpBoldLeftRight: "\u2538",
|
|
2266
|
+
lineUpBoldLeftBoldRight: "\u2539",
|
|
2267
|
+
lineUpBoldLeftRightBold: "\u253A",
|
|
2268
|
+
lineUpLeftRightBold: "\u2536",
|
|
2269
|
+
lineUpLeftBoldRight: "\u2535",
|
|
2270
|
+
lineUpDoubleLeftDoubleRightDouble: "\u2569",
|
|
2271
|
+
lineUpDoubleLeftRight: "\u2568",
|
|
2272
|
+
lineUpLeftDoubleRightDouble: "\u2567",
|
|
2273
|
+
lineUpDownLeftRight: "\u253C",
|
|
2274
|
+
lineUpBoldDownBoldLeftBoldRightBold: "\u254B",
|
|
2275
|
+
lineUpDownBoldLeftBoldRightBold: "\u2548",
|
|
2276
|
+
lineUpBoldDownLeftBoldRightBold: "\u2547",
|
|
2277
|
+
lineUpBoldDownBoldLeftRightBold: "\u254A",
|
|
2278
|
+
lineUpBoldDownBoldLeftBoldRight: "\u2549",
|
|
2279
|
+
lineUpBoldDownLeftRight: "\u2540",
|
|
2280
|
+
lineUpDownBoldLeftRight: "\u2541",
|
|
2281
|
+
lineUpDownLeftBoldRight: "\u253D",
|
|
2282
|
+
lineUpDownLeftRightBold: "\u253E",
|
|
2283
|
+
lineUpBoldDownBoldLeftRight: "\u2542",
|
|
2284
|
+
lineUpDownLeftBoldRightBold: "\u253F",
|
|
2285
|
+
lineUpBoldDownLeftBoldRight: "\u2543",
|
|
2286
|
+
lineUpBoldDownLeftRightBold: "\u2544",
|
|
2287
|
+
lineUpDownBoldLeftBoldRight: "\u2545",
|
|
2288
|
+
lineUpDownBoldLeftRightBold: "\u2546",
|
|
2289
|
+
lineUpDoubleDownDoubleLeftDoubleRightDouble: "\u256C",
|
|
2290
|
+
lineUpDoubleDownDoubleLeftRight: "\u256B",
|
|
2291
|
+
lineUpDownLeftDoubleRightDouble: "\u256A",
|
|
2292
|
+
lineCross: "\u2573",
|
|
2293
|
+
lineBackslash: "\u2572",
|
|
2294
|
+
lineSlash: "\u2571"
|
|
2471
2295
|
};
|
|
2472
2296
|
var specialMainSymbols = {
|
|
2473
|
-
tick: "
|
|
2474
|
-
info: "
|
|
2475
|
-
warning: "
|
|
2476
|
-
cross: "
|
|
2477
|
-
squareSmall: "
|
|
2478
|
-
squareSmallFilled: "
|
|
2479
|
-
circle: "
|
|
2480
|
-
circleFilled: "
|
|
2481
|
-
circleDotted: "
|
|
2482
|
-
circleDouble: "
|
|
2483
|
-
circleCircle: "
|
|
2484
|
-
circleCross: "
|
|
2485
|
-
circlePipe: "
|
|
2486
|
-
radioOn: "
|
|
2487
|
-
radioOff: "
|
|
2488
|
-
checkboxOn: "
|
|
2489
|
-
checkboxOff: "
|
|
2490
|
-
checkboxCircleOn: "
|
|
2491
|
-
checkboxCircleOff: "
|
|
2492
|
-
pointer: "
|
|
2493
|
-
triangleUpOutline: "
|
|
2494
|
-
triangleLeft: "
|
|
2495
|
-
triangleRight: "
|
|
2496
|
-
lozenge: "
|
|
2497
|
-
lozengeOutline: "
|
|
2498
|
-
hamburger: "
|
|
2499
|
-
smiley: "
|
|
2500
|
-
mustache: "
|
|
2501
|
-
star: "
|
|
2502
|
-
play: "
|
|
2503
|
-
nodejs: "
|
|
2504
|
-
oneSeventh: "
|
|
2505
|
-
oneNinth: "
|
|
2506
|
-
oneTenth: "
|
|
2297
|
+
tick: "\u2714",
|
|
2298
|
+
info: "\u2139",
|
|
2299
|
+
warning: "\u26A0",
|
|
2300
|
+
cross: "\u2718",
|
|
2301
|
+
squareSmall: "\u25FB",
|
|
2302
|
+
squareSmallFilled: "\u25FC",
|
|
2303
|
+
circle: "\u25EF",
|
|
2304
|
+
circleFilled: "\u25C9",
|
|
2305
|
+
circleDotted: "\u25CC",
|
|
2306
|
+
circleDouble: "\u25CE",
|
|
2307
|
+
circleCircle: "\u24DE",
|
|
2308
|
+
circleCross: "\u24E7",
|
|
2309
|
+
circlePipe: "\u24BE",
|
|
2310
|
+
radioOn: "\u25C9",
|
|
2311
|
+
radioOff: "\u25EF",
|
|
2312
|
+
checkboxOn: "\u2612",
|
|
2313
|
+
checkboxOff: "\u2610",
|
|
2314
|
+
checkboxCircleOn: "\u24E7",
|
|
2315
|
+
checkboxCircleOff: "\u24BE",
|
|
2316
|
+
pointer: "\u276F",
|
|
2317
|
+
triangleUpOutline: "\u25B3",
|
|
2318
|
+
triangleLeft: "\u25C0",
|
|
2319
|
+
triangleRight: "\u25B6",
|
|
2320
|
+
lozenge: "\u25C6",
|
|
2321
|
+
lozengeOutline: "\u25C7",
|
|
2322
|
+
hamburger: "\u2630",
|
|
2323
|
+
smiley: "\u32E1",
|
|
2324
|
+
mustache: "\u0DF4",
|
|
2325
|
+
star: "\u2605",
|
|
2326
|
+
play: "\u25B6",
|
|
2327
|
+
nodejs: "\u2B22",
|
|
2328
|
+
oneSeventh: "\u2150",
|
|
2329
|
+
oneNinth: "\u2151",
|
|
2330
|
+
oneTenth: "\u2152"
|
|
2507
2331
|
};
|
|
2508
2332
|
var specialFallbackSymbols = {
|
|
2509
|
-
tick: "
|
|
2333
|
+
tick: "\u221A",
|
|
2510
2334
|
info: "i",
|
|
2511
|
-
warning: "
|
|
2512
|
-
cross: "
|
|
2513
|
-
squareSmall: "
|
|
2514
|
-
squareSmallFilled: "
|
|
2335
|
+
warning: "\u203C",
|
|
2336
|
+
cross: "\xD7",
|
|
2337
|
+
squareSmall: "\u25A1",
|
|
2338
|
+
squareSmallFilled: "\u25A0",
|
|
2515
2339
|
circle: "( )",
|
|
2516
2340
|
circleFilled: "(*)",
|
|
2517
2341
|
circleDotted: "( )",
|
|
2518
2342
|
circleDouble: "( )",
|
|
2519
|
-
circleCircle: "(
|
|
2520
|
-
circleCross: "(
|
|
2521
|
-
circlePipe: "(
|
|
2343
|
+
circleCircle: "(\u25CB)",
|
|
2344
|
+
circleCross: "(\xD7)",
|
|
2345
|
+
circlePipe: "(\u2502)",
|
|
2522
2346
|
radioOn: "(*)",
|
|
2523
2347
|
radioOff: "( )",
|
|
2524
|
-
checkboxOn: "[
|
|
2348
|
+
checkboxOn: "[\xD7]",
|
|
2525
2349
|
checkboxOff: "[ ]",
|
|
2526
|
-
checkboxCircleOn: "(
|
|
2350
|
+
checkboxCircleOn: "(\xD7)",
|
|
2527
2351
|
checkboxCircleOff: "( )",
|
|
2528
2352
|
pointer: ">",
|
|
2529
|
-
triangleUpOutline: "
|
|
2530
|
-
triangleLeft: "
|
|
2531
|
-
triangleRight: "
|
|
2532
|
-
lozenge: "
|
|
2533
|
-
lozengeOutline: "
|
|
2534
|
-
hamburger: "
|
|
2535
|
-
smiley: "
|
|
2536
|
-
mustache: "
|
|
2537
|
-
star: "
|
|
2538
|
-
play: "
|
|
2539
|
-
nodejs: "
|
|
2353
|
+
triangleUpOutline: "\u2206",
|
|
2354
|
+
triangleLeft: "\u25C4",
|
|
2355
|
+
triangleRight: "\u25BA",
|
|
2356
|
+
lozenge: "\u2666",
|
|
2357
|
+
lozengeOutline: "\u25CA",
|
|
2358
|
+
hamburger: "\u2261",
|
|
2359
|
+
smiley: "\u263A",
|
|
2360
|
+
mustache: "\u250C\u2500\u2510",
|
|
2361
|
+
star: "\u2736",
|
|
2362
|
+
play: "\u25BA",
|
|
2363
|
+
nodejs: "\u2666",
|
|
2540
2364
|
oneSeventh: "1/7",
|
|
2541
2365
|
oneNinth: "1/9",
|
|
2542
2366
|
oneTenth: "1/10"
|
|
@@ -2562,7 +2386,7 @@ var defaultTheme = {
|
|
|
2562
2386
|
},
|
|
2563
2387
|
spinner: {
|
|
2564
2388
|
interval: 80,
|
|
2565
|
-
frames: ["
|
|
2389
|
+
frames: ["\u280B", "\u2819", "\u2839", "\u2838", "\u283C", "\u2834", "\u2826", "\u2827", "\u2807", "\u280F"].map((frame) => styleText("yellow", frame))
|
|
2566
2390
|
},
|
|
2567
2391
|
style: {
|
|
2568
2392
|
answer: (text) => styleText("cyan", text),
|
|
@@ -2801,7 +2625,7 @@ var dist_default3 = fastStringWidth;
|
|
|
2801
2625
|
|
|
2802
2626
|
// node_modules/fast-wrap-ansi/lib/main.js
|
|
2803
2627
|
var ESC = "\x1B";
|
|
2804
|
-
var CSI = "
|
|
2628
|
+
var CSI = "\x9B";
|
|
2805
2629
|
var END_CODE = 39;
|
|
2806
2630
|
var ANSI_ESCAPE_BELL = "\x07";
|
|
2807
2631
|
var ANSI_CSI = "[";
|
|
@@ -3090,8 +2914,8 @@ function usePagination({ items, active, renderItem, pageSize, loop = true }) {
|
|
|
3090
2914
|
}
|
|
3091
2915
|
// node_modules/@inquirer/core/dist/lib/create-prompt.js
|
|
3092
2916
|
var import_mute_stream = __toESM(require_lib(), 1);
|
|
3093
|
-
import * as readline2 from "
|
|
3094
|
-
import { AsyncResource as AsyncResource3 } from "
|
|
2917
|
+
import * as readline2 from "readline";
|
|
2918
|
+
import { AsyncResource as AsyncResource3 } from "async_hooks";
|
|
3095
2919
|
|
|
3096
2920
|
// node_modules/signal-exit/dist/mjs/signals.js
|
|
3097
2921
|
var signals = [];
|
|
@@ -3302,7 +3126,7 @@ var {
|
|
|
3302
3126
|
} = signalExitWrap(processOk(process3) ? new SignalExit(process3) : new SignalExitFallback);
|
|
3303
3127
|
|
|
3304
3128
|
// node_modules/@inquirer/core/dist/lib/screen-manager.js
|
|
3305
|
-
import { stripVTControlCharacters } from "
|
|
3129
|
+
import { stripVTControlCharacters } from "util";
|
|
3306
3130
|
|
|
3307
3131
|
// node_modules/@inquirer/ansi/dist/index.js
|
|
3308
3132
|
var ESC2 = "\x1B[";
|
|
@@ -3399,7 +3223,7 @@ class PromisePolyfill extends Promise {
|
|
|
3399
3223
|
}
|
|
3400
3224
|
|
|
3401
3225
|
// node_modules/@inquirer/core/dist/lib/create-prompt.js
|
|
3402
|
-
import path from "
|
|
3226
|
+
import path from "path";
|
|
3403
3227
|
var nativeSetImmediate = globalThis.setImmediate;
|
|
3404
3228
|
function getCallSites() {
|
|
3405
3229
|
const _prepareStackTrace = Error.prepareStackTrace;
|
|
@@ -3510,7 +3334,7 @@ function createPrompt(view) {
|
|
|
3510
3334
|
return prompt;
|
|
3511
3335
|
}
|
|
3512
3336
|
// node_modules/@inquirer/core/dist/lib/Separator.js
|
|
3513
|
-
import { styleText as styleText2 } from "
|
|
3337
|
+
import { styleText as styleText2 } from "util";
|
|
3514
3338
|
class Separator {
|
|
3515
3339
|
separator = styleText2("dim", Array.from({ length: 15 }).join(dist_default.line));
|
|
3516
3340
|
type = "separator";
|
|
@@ -3524,7 +3348,7 @@ class Separator {
|
|
|
3524
3348
|
}
|
|
3525
3349
|
}
|
|
3526
3350
|
// node_modules/@inquirer/checkbox/dist/index.js
|
|
3527
|
-
import { styleText as styleText3 } from "
|
|
3351
|
+
import { styleText as styleText3 } from "util";
|
|
3528
3352
|
var checkboxTheme = {
|
|
3529
3353
|
icon: {
|
|
3530
3354
|
checked: styleText3("green", dist_default.circleFilled),
|
|
@@ -3537,7 +3361,7 @@ var checkboxTheme = {
|
|
|
3537
3361
|
disabled: (text) => styleText3("dim", text),
|
|
3538
3362
|
renderSelectedChoices: (selectedChoices) => selectedChoices.map((choice) => choice.short).join(", "),
|
|
3539
3363
|
description: (text) => styleText3("cyan", text),
|
|
3540
|
-
keysHelpTip: (keys) => keys.map(([key, action]) => `${styleText3("bold", key)} ${styleText3("dim", action)}`).join(styleText3("dim", "
|
|
3364
|
+
keysHelpTip: (keys) => keys.map(([key, action]) => `${styleText3("bold", key)} ${styleText3("dim", action)}`).join(styleText3("dim", " \u2022 "))
|
|
3541
3365
|
},
|
|
3542
3366
|
i18n: { disabledError: "This option is disabled and cannot be toggled." },
|
|
3543
3367
|
keybindings: []
|
|
@@ -3694,14 +3518,14 @@ var dist_default4 = createPrompt((config, done) => {
|
|
|
3694
3518
|
return [prefix, message, answer].filter(Boolean).join(" ");
|
|
3695
3519
|
}
|
|
3696
3520
|
const keys = [
|
|
3697
|
-
["
|
|
3521
|
+
["\u2191\u2193", "navigate"],
|
|
3698
3522
|
["space", "select"]
|
|
3699
3523
|
];
|
|
3700
3524
|
if (shortcuts.all)
|
|
3701
3525
|
keys.push([shortcuts.all, "all"]);
|
|
3702
3526
|
if (shortcuts.invert)
|
|
3703
3527
|
keys.push([shortcuts.invert, "invert"]);
|
|
3704
|
-
keys.push(["
|
|
3528
|
+
keys.push(["\u23CE", "submit"]);
|
|
3705
3529
|
const helpLine = theme.style.keysHelpTip(keys);
|
|
3706
3530
|
const lines = [
|
|
3707
3531
|
[prefix, message].filter(Boolean).join(" "),
|
|
@@ -3715,13 +3539,13 @@ var dist_default4 = createPrompt((config, done) => {
|
|
|
3715
3539
|
return `${lines}${cursorHide}`;
|
|
3716
3540
|
});
|
|
3717
3541
|
// node_modules/@inquirer/select/dist/index.js
|
|
3718
|
-
import { styleText as styleText4 } from "
|
|
3542
|
+
import { styleText as styleText4 } from "util";
|
|
3719
3543
|
var selectTheme = {
|
|
3720
3544
|
icon: { cursor: dist_default.pointer },
|
|
3721
3545
|
style: {
|
|
3722
3546
|
disabled: (text) => styleText4("dim", text),
|
|
3723
3547
|
description: (text) => styleText4("cyan", text),
|
|
3724
|
-
keysHelpTip: (keys) => keys.map(([key, action]) => `${styleText4("bold", key)} ${styleText4("dim", action)}`).join(styleText4("dim", "
|
|
3548
|
+
keysHelpTip: (keys) => keys.map(([key, action]) => `${styleText4("bold", key)} ${styleText4("dim", action)}`).join(styleText4("dim", " \u2022 "))
|
|
3725
3549
|
},
|
|
3726
3550
|
i18n: { disabledError: "This option is disabled and cannot be selected." },
|
|
3727
3551
|
indexMode: "hidden",
|
|
@@ -3847,8 +3671,8 @@ var dist_default5 = createPrompt((config, done) => {
|
|
|
3847
3671
|
}, []);
|
|
3848
3672
|
const message = theme.style.message(config.message, status);
|
|
3849
3673
|
const helpLine = theme.style.keysHelpTip([
|
|
3850
|
-
["
|
|
3851
|
-
["
|
|
3674
|
+
["\u2191\u2193", "navigate"],
|
|
3675
|
+
["\u23CE", "select"]
|
|
3852
3676
|
]);
|
|
3853
3677
|
let separatorCount = 0;
|
|
3854
3678
|
const page = usePagination({
|
|
@@ -3888,7 +3712,7 @@ var dist_default5 = createPrompt((config, done) => {
|
|
|
3888
3712
|
return `${lines}${cursorHide}`;
|
|
3889
3713
|
});
|
|
3890
3714
|
// src/cli/tui.ts
|
|
3891
|
-
import { emitKeypressEvents } from "
|
|
3715
|
+
import { emitKeypressEvents } from "readline";
|
|
3892
3716
|
var TYPE_TAGS = {
|
|
3893
3717
|
prompt: "[prompt]",
|
|
3894
3718
|
code: "[code] ",
|
|
@@ -3948,10 +3772,10 @@ async function pickTools(message, allowed) {
|
|
|
3948
3772
|
async function pickActivation(skillName, modes) {
|
|
3949
3773
|
const labels = {
|
|
3950
3774
|
session: `Per-session: invoke manually with /${skillName}`,
|
|
3951
|
-
global: "Global: auto-activate every session (adds
|
|
3775
|
+
global: "Global: auto-activate every session (adds session hooks)"
|
|
3952
3776
|
};
|
|
3953
3777
|
return withEscape(async (signal) => dist_default5({
|
|
3954
|
-
message: `How should ${skillName} activate
|
|
3778
|
+
message: `How should ${skillName} activate? (Esc to cancel)`,
|
|
3955
3779
|
choices: modes.map((m) => ({ name: labels[m], value: m }))
|
|
3956
3780
|
}, { signal }));
|
|
3957
3781
|
}
|
|
@@ -3965,7 +3789,7 @@ async function otherScopeSkillCount(currentDir) {
|
|
|
3965
3789
|
const otherDir = currentDir === home ? process.cwd() : home;
|
|
3966
3790
|
if (otherDir === currentDir)
|
|
3967
3791
|
return { scope: "global", count: 0 };
|
|
3968
|
-
const lockfile = await
|
|
3792
|
+
const lockfile = await readLockfile(otherDir);
|
|
3969
3793
|
return {
|
|
3970
3794
|
scope: otherDir === home ? "global" : "local",
|
|
3971
3795
|
count: Object.keys(lockfile.skills).length
|
|
@@ -3977,7 +3801,7 @@ function resolveInstallDir(flags) {
|
|
|
3977
3801
|
}
|
|
3978
3802
|
return process.cwd();
|
|
3979
3803
|
}
|
|
3980
|
-
var BOOLEAN_FLAGS = new Set(["global", "g", "all", "dry-run"]);
|
|
3804
|
+
var BOOLEAN_FLAGS = new Set(["global", "g", "all", "dry-run", "statusline", "no-statusline"]);
|
|
3981
3805
|
function parseArgs(argv) {
|
|
3982
3806
|
if (argv.length === 0)
|
|
3983
3807
|
return { command: "help", args: [], flags: {} };
|
|
@@ -4007,7 +3831,7 @@ function printHelp() {
|
|
|
4007
3831
|
@iceinvein/agent-skills \u2014 Install agent skills into AI coding tools
|
|
4008
3832
|
|
|
4009
3833
|
Usage:
|
|
4010
|
-
agent-skills install <skill> [<skill> ...] [--tool <tool>] [--activation <mode>] [-g] Install one or more skills
|
|
3834
|
+
agent-skills install <skill> [<skill> ...] [--tool <tool>] [--activation <mode>] [--statusline | --no-statusline] [-g] Install one or more skills
|
|
4011
3835
|
agent-skills install [--tool <tool>] [-g] No args: opens interactive picker
|
|
4012
3836
|
agent-skills browse [--tool <tool>] [-g] Alias for 'install' with picker
|
|
4013
3837
|
agent-skills remove <skill> [-g] Remove a skill
|
|
@@ -4019,10 +3843,12 @@ Usage:
|
|
|
4019
3843
|
agent-skills info <skill> Show skill details
|
|
4020
3844
|
|
|
4021
3845
|
Flags:
|
|
4022
|
-
--tool <tool> Install for a specific tool (${
|
|
3846
|
+
--tool <tool> Install for a specific tool (${TOOL_NAMES.join(", ")})
|
|
4023
3847
|
-g, --global Install to home directory (available in all projects)
|
|
4024
3848
|
--dry-run With bump --all: check without writing (exit 1 if unbumped)
|
|
4025
3849
|
--activation <mode> Set activation mode for skills that support it (session or global)
|
|
3850
|
+
--statusline With a global activation: put the skill's status line in an empty statusLine slot
|
|
3851
|
+
--no-statusline Give back a statusLine slot the skill holds; later installs and updates leave it empty
|
|
4026
3852
|
`);
|
|
4027
3853
|
}
|
|
4028
3854
|
function printInstalled(result, skipped) {
|
|
@@ -4044,13 +3870,13 @@ var TOOL_DIRS = {
|
|
|
4044
3870
|
};
|
|
4045
3871
|
async function resolveTargetTools(installDir, isGlobal, flags) {
|
|
4046
3872
|
if (flags.tool) {
|
|
4047
|
-
if (!
|
|
4048
|
-
console.error(`Error: unknown tool '${flags.tool}'. Must be one of: ${
|
|
3873
|
+
if (!TOOL_NAMES.includes(flags.tool)) {
|
|
3874
|
+
console.error(`Error: unknown tool '${flags.tool}'. Must be one of: ${TOOL_NAMES.join(", ")}`);
|
|
4049
3875
|
return null;
|
|
4050
3876
|
}
|
|
4051
3877
|
return [flags.tool];
|
|
4052
3878
|
}
|
|
4053
|
-
const detected = await detectTools(installDir);
|
|
3879
|
+
const detected = await detectTools(installDir, isGlobal);
|
|
4054
3880
|
if (detected.length > 0) {
|
|
4055
3881
|
console.log(`Detected tools: ${detected.join(", ")}`);
|
|
4056
3882
|
return detected;
|
|
@@ -4081,7 +3907,9 @@ async function installOne(skillName, installDir, isGlobal, targetTools, flags) {
|
|
|
4081
3907
|
}
|
|
4082
3908
|
const manifest = manifestResult.manifest;
|
|
4083
3909
|
let activation;
|
|
4084
|
-
|
|
3910
|
+
const hookTools = ["claude", "codex", "antigravity"];
|
|
3911
|
+
const wiresHooks = targetTools.some((t) => hookTools.includes(t) && manifest.tools.includes(t));
|
|
3912
|
+
if (manifest.activation && wiresHooks) {
|
|
4085
3913
|
const validModes = manifest.activation.modes;
|
|
4086
3914
|
if (flags.activation) {
|
|
4087
3915
|
if (!validModes.includes(flags.activation)) {
|
|
@@ -4095,7 +3923,9 @@ async function installOne(skillName, installDir, isGlobal, targetTools, flags) {
|
|
|
4095
3923
|
activation = manifest.activation.default;
|
|
4096
3924
|
}
|
|
4097
3925
|
}
|
|
4098
|
-
const result = await installSkill(installDir, manifest, filesResult, targetTools, activation, isGlobal
|
|
3926
|
+
const result = await installSkill(installDir, manifest, filesResult, targetTools, activation, isGlobal, {
|
|
3927
|
+
statusline: flags.statusline !== undefined ? true : flags["no-statusline"] !== undefined ? false : undefined
|
|
3928
|
+
});
|
|
4099
3929
|
if (!result.ok) {
|
|
4100
3930
|
console.error(`Error: ${result.error}`);
|
|
4101
3931
|
return false;
|
|
@@ -4110,6 +3940,10 @@ async function main() {
|
|
|
4110
3940
|
switch (command) {
|
|
4111
3941
|
case "install":
|
|
4112
3942
|
case "browse": {
|
|
3943
|
+
if (flags.statusline !== undefined && flags["no-statusline"] !== undefined) {
|
|
3944
|
+
console.error("Error: --statusline and --no-statusline cannot be given together");
|
|
3945
|
+
process.exit(1);
|
|
3946
|
+
}
|
|
4113
3947
|
const installDir = resolveInstallDir(flags);
|
|
4114
3948
|
const isGlobal = installDir === homedir3();
|
|
4115
3949
|
let names = args;
|