@toolr/seedr 0.1.71 → 0.1.72
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{chunk-DI5Z3O3G.js → chunk-TWSBWCGS.js} +66 -66
- package/dist/cli.js +188 -188
- package/dist/index.d.ts +20 -20
- package/dist/index.js +15 -15
- package/package.json +1 -1
|
@@ -145,11 +145,11 @@ async function fetchFileTree(nodes, baseUrl, destPath) {
|
|
|
145
145
|
}));
|
|
146
146
|
}
|
|
147
147
|
|
|
148
|
-
// src/config/
|
|
148
|
+
// src/config/agents.ts
|
|
149
149
|
import { homedir } from "os";
|
|
150
150
|
import { join as join2 } from "path";
|
|
151
151
|
var home = homedir();
|
|
152
|
-
var
|
|
152
|
+
var CODING_AGENTS = {
|
|
153
153
|
claude: {
|
|
154
154
|
name: "Claude Code",
|
|
155
155
|
shortName: "claude",
|
|
@@ -257,15 +257,15 @@ var AI_TOOLS = {
|
|
|
257
257
|
}
|
|
258
258
|
}
|
|
259
259
|
};
|
|
260
|
-
var
|
|
261
|
-
function
|
|
262
|
-
return
|
|
260
|
+
var ALL_AGENTS = Object.keys(CODING_AGENTS);
|
|
261
|
+
function getAgentConfig(agent) {
|
|
262
|
+
return CODING_AGENTS[agent];
|
|
263
263
|
}
|
|
264
|
-
function getContentTypeConfig(
|
|
265
|
-
return
|
|
264
|
+
function getContentTypeConfig(agent, type) {
|
|
265
|
+
return CODING_AGENTS[agent].contentTypes[type];
|
|
266
266
|
}
|
|
267
|
-
function
|
|
268
|
-
const config =
|
|
267
|
+
function getAgentRoot(agent, scope, cwd = process.cwd()) {
|
|
268
|
+
const config = CODING_AGENTS[agent];
|
|
269
269
|
switch (scope) {
|
|
270
270
|
case "project":
|
|
271
271
|
case "local":
|
|
@@ -274,10 +274,10 @@ function getToolRoot(tool, scope, cwd = process.cwd()) {
|
|
|
274
274
|
return config.userRoot;
|
|
275
275
|
}
|
|
276
276
|
}
|
|
277
|
-
function getContentPath(
|
|
278
|
-
const typeConfig = getContentTypeConfig(
|
|
277
|
+
function getContentPath(agent, type, scope, cwd = process.cwd()) {
|
|
278
|
+
const typeConfig = getContentTypeConfig(agent, type);
|
|
279
279
|
if (!typeConfig) return void 0;
|
|
280
|
-
const root =
|
|
280
|
+
const root = getAgentRoot(agent, scope, cwd);
|
|
281
281
|
return typeConfig.path ? join2(root, typeConfig.path) : root;
|
|
282
282
|
}
|
|
283
283
|
function getSettingsPath(scope, cwd = process.cwd()) {
|
|
@@ -299,8 +299,8 @@ function getMcpPath(scope, cwd = process.cwd()) {
|
|
|
299
299
|
return join2(home, ".claude.json");
|
|
300
300
|
}
|
|
301
301
|
}
|
|
302
|
-
function
|
|
303
|
-
return getContentPath(
|
|
302
|
+
function getAgentPath(agent, scope, cwd = process.cwd()) {
|
|
303
|
+
return getContentPath(agent, "skill", scope, cwd) || "";
|
|
304
304
|
}
|
|
305
305
|
|
|
306
306
|
// src/utils/fs.ts
|
|
@@ -373,34 +373,34 @@ async function installDirectory(source, destination, method) {
|
|
|
373
373
|
}
|
|
374
374
|
|
|
375
375
|
// src/utils/detection.ts
|
|
376
|
-
async function
|
|
377
|
-
const checks =
|
|
378
|
-
const projectPath =
|
|
379
|
-
const userPath =
|
|
376
|
+
async function detectInstalledAgents(cwd = process.cwd()) {
|
|
377
|
+
const checks = ALL_AGENTS.flatMap((agent) => {
|
|
378
|
+
const projectPath = getAgentPath(agent, "project", cwd);
|
|
379
|
+
const userPath = getAgentPath(agent, "user", cwd);
|
|
380
380
|
return [
|
|
381
|
-
exists(projectPath).then((found) => found ? {
|
|
382
|
-
exists(userPath).then((found) => found ? {
|
|
381
|
+
exists(projectPath).then((found) => found ? { agent, scope: "project", path: projectPath } : null),
|
|
382
|
+
exists(userPath).then((found) => found ? { agent, scope: "user", path: userPath } : null)
|
|
383
383
|
];
|
|
384
384
|
});
|
|
385
385
|
const results = await Promise.all(checks);
|
|
386
386
|
return results.filter((r) => r !== null);
|
|
387
387
|
}
|
|
388
|
-
async function
|
|
389
|
-
const checks =
|
|
390
|
-
const projectPath =
|
|
391
|
-
return await exists(projectPath) ?
|
|
388
|
+
async function detectProjectAgents(cwd = process.cwd()) {
|
|
389
|
+
const checks = ALL_AGENTS.map(async (agent) => {
|
|
390
|
+
const projectPath = getAgentPath(agent, "project", cwd);
|
|
391
|
+
return await exists(projectPath) ? agent : null;
|
|
392
392
|
});
|
|
393
393
|
const results = await Promise.all(checks);
|
|
394
|
-
return results.filter((
|
|
394
|
+
return results.filter((a) => a !== null);
|
|
395
395
|
}
|
|
396
|
-
async function
|
|
396
|
+
async function isAgentInstalled(agent, scope, cwd = process.cwd()) {
|
|
397
397
|
const effectiveScope = scope === "local" ? "project" : scope;
|
|
398
|
-
const path =
|
|
398
|
+
const path = getAgentPath(agent, effectiveScope, cwd);
|
|
399
399
|
return exists(path);
|
|
400
400
|
}
|
|
401
|
-
function
|
|
401
|
+
function parseAgentArg(arg) {
|
|
402
402
|
const normalized = arg.toLowerCase().trim();
|
|
403
|
-
if (
|
|
403
|
+
if (ALL_AGENTS.includes(normalized)) {
|
|
404
404
|
return normalized;
|
|
405
405
|
}
|
|
406
406
|
const aliases = {
|
|
@@ -416,11 +416,11 @@ function parseToolArg(arg) {
|
|
|
416
416
|
};
|
|
417
417
|
return aliases[normalized] ?? null;
|
|
418
418
|
}
|
|
419
|
-
function
|
|
419
|
+
function parseAgentsArg(agents, allAgents) {
|
|
420
420
|
if (agents === "all") {
|
|
421
|
-
return
|
|
421
|
+
return allAgents;
|
|
422
422
|
}
|
|
423
|
-
return agents.split(",").map((
|
|
423
|
+
return agents.split(",").map((a) => parseAgentArg(a.trim())).filter((a) => a !== null);
|
|
424
424
|
}
|
|
425
425
|
|
|
426
426
|
// src/handlers/skill.ts
|
|
@@ -438,58 +438,58 @@ async function installToCentralLocation(item, sourcePath, cwd) {
|
|
|
438
438
|
}
|
|
439
439
|
return centralPath;
|
|
440
440
|
}
|
|
441
|
-
async function
|
|
441
|
+
async function createAgentSymlink(centralPath, destPath) {
|
|
442
442
|
await ensureDir(dirname3(destPath));
|
|
443
443
|
await rm2(destPath, { recursive: true, force: true });
|
|
444
444
|
const relPath = relative2(dirname3(destPath), centralPath);
|
|
445
445
|
await symlink2(relPath, destPath);
|
|
446
446
|
}
|
|
447
|
-
async function
|
|
447
|
+
async function installSkillForAgent(item, agent, scope, method, cwd, centralPath) {
|
|
448
448
|
const spinner = ora(
|
|
449
|
-
`Installing ${item.name} for ${
|
|
449
|
+
`Installing ${item.name} for ${CODING_AGENTS[agent].name}...`
|
|
450
450
|
).start();
|
|
451
451
|
try {
|
|
452
|
-
const destDir = getContentPath(
|
|
452
|
+
const destDir = getContentPath(agent, "skill", scope, cwd);
|
|
453
453
|
if (!destDir) {
|
|
454
|
-
throw new Error(`${
|
|
454
|
+
throw new Error(`${CODING_AGENTS[agent].name} does not support skills`);
|
|
455
455
|
}
|
|
456
456
|
const destPath = join4(destDir, item.slug);
|
|
457
457
|
const sourcePath = getItemSourcePath(item);
|
|
458
458
|
if (method === "symlink" && centralPath) {
|
|
459
|
-
await
|
|
459
|
+
await createAgentSymlink(centralPath, destPath);
|
|
460
460
|
} else if (sourcePath && await exists(sourcePath)) {
|
|
461
461
|
await installDirectory(sourcePath, destPath, "copy");
|
|
462
462
|
} else {
|
|
463
463
|
await fetchItemToDestination(item, destPath);
|
|
464
464
|
}
|
|
465
465
|
spinner.succeed(
|
|
466
|
-
chalk.green(`Installed ${item.name} for ${
|
|
466
|
+
chalk.green(`Installed ${item.name} for ${CODING_AGENTS[agent].name}`)
|
|
467
467
|
);
|
|
468
|
-
return {
|
|
468
|
+
return { agent, success: true, path: destPath };
|
|
469
469
|
} catch (error) {
|
|
470
470
|
const errorMsg = error instanceof Error ? error.message : "Unknown error";
|
|
471
471
|
spinner.fail(
|
|
472
|
-
chalk.red(`Failed to install for ${
|
|
472
|
+
chalk.red(`Failed to install for ${CODING_AGENTS[agent].name}: ${errorMsg}`)
|
|
473
473
|
);
|
|
474
|
-
return {
|
|
474
|
+
return { agent, success: false, path: "", error: errorMsg };
|
|
475
475
|
}
|
|
476
476
|
}
|
|
477
|
-
async function installSkill(item,
|
|
477
|
+
async function installSkill(item, agents, scope, method, cwd = process.cwd()) {
|
|
478
478
|
const results = [];
|
|
479
479
|
const sourcePath = getItemSourcePath(item);
|
|
480
480
|
let centralPath;
|
|
481
481
|
if (method === "symlink") {
|
|
482
482
|
centralPath = await installToCentralLocation(item, sourcePath, cwd);
|
|
483
483
|
}
|
|
484
|
-
for (const
|
|
485
|
-
const readsAgentsDir =
|
|
484
|
+
for (const agent of agents) {
|
|
485
|
+
const readsAgentsDir = agent === "gemini" || agent === "codex" || agent === "opencode";
|
|
486
486
|
if (readsAgentsDir && method === "symlink" && centralPath) {
|
|
487
|
-
results.push({
|
|
487
|
+
results.push({ agent, success: true, path: centralPath });
|
|
488
488
|
continue;
|
|
489
489
|
}
|
|
490
|
-
const result = await
|
|
490
|
+
const result = await installSkillForAgent(
|
|
491
491
|
item,
|
|
492
|
-
|
|
492
|
+
agent,
|
|
493
493
|
scope,
|
|
494
494
|
method,
|
|
495
495
|
cwd,
|
|
@@ -499,8 +499,8 @@ async function installSkill(item, tools, scope, method, cwd = process.cwd()) {
|
|
|
499
499
|
}
|
|
500
500
|
return results;
|
|
501
501
|
}
|
|
502
|
-
async function uninstallSkill(slug,
|
|
503
|
-
const destDir = getContentPath(
|
|
502
|
+
async function uninstallSkill(slug, agent, scope, cwd = process.cwd()) {
|
|
503
|
+
const destDir = getContentPath(agent, "skill", scope, cwd);
|
|
504
504
|
if (!destDir) return false;
|
|
505
505
|
const destPath = join4(destDir, slug);
|
|
506
506
|
if (!await exists(destPath)) {
|
|
@@ -509,8 +509,8 @@ async function uninstallSkill(slug, tool, scope, cwd = process.cwd()) {
|
|
|
509
509
|
await rm2(destPath, { recursive: true });
|
|
510
510
|
return true;
|
|
511
511
|
}
|
|
512
|
-
async function getInstalledSkills(
|
|
513
|
-
const destDir = getContentPath(
|
|
512
|
+
async function getInstalledSkills(agent, scope, cwd = process.cwd()) {
|
|
513
|
+
const destDir = getContentPath(agent, "skill", scope, cwd);
|
|
514
514
|
if (!destDir || !await exists(destDir)) {
|
|
515
515
|
return [];
|
|
516
516
|
}
|
|
@@ -519,14 +519,14 @@ async function getInstalledSkills(tool, scope, cwd = process.cwd()) {
|
|
|
519
519
|
}
|
|
520
520
|
var skillHandler = {
|
|
521
521
|
type: "skill",
|
|
522
|
-
async install(item,
|
|
523
|
-
return installSkill(item,
|
|
522
|
+
async install(item, agents, scope, method, cwd) {
|
|
523
|
+
return installSkill(item, agents, scope, method, cwd);
|
|
524
524
|
},
|
|
525
|
-
async uninstall(slug,
|
|
526
|
-
return uninstallSkill(slug,
|
|
525
|
+
async uninstall(slug, agent, scope, cwd) {
|
|
526
|
+
return uninstallSkill(slug, agent, scope, cwd);
|
|
527
527
|
},
|
|
528
|
-
async listInstalled(
|
|
529
|
-
return getInstalledSkills(
|
|
528
|
+
async listInstalled(agent, scope, cwd) {
|
|
529
|
+
return getInstalledSkills(agent, scope, cwd);
|
|
530
530
|
}
|
|
531
531
|
};
|
|
532
532
|
|
|
@@ -545,17 +545,17 @@ export {
|
|
|
545
545
|
writeTextFile,
|
|
546
546
|
getAgentsPath,
|
|
547
547
|
installDirectory,
|
|
548
|
-
|
|
549
|
-
|
|
550
|
-
|
|
548
|
+
CODING_AGENTS,
|
|
549
|
+
ALL_AGENTS,
|
|
550
|
+
getAgentConfig,
|
|
551
551
|
getContentPath,
|
|
552
552
|
getSettingsPath,
|
|
553
553
|
getMcpPath,
|
|
554
|
-
|
|
555
|
-
|
|
556
|
-
|
|
557
|
-
|
|
558
|
-
|
|
554
|
+
getAgentPath,
|
|
555
|
+
detectInstalledAgents,
|
|
556
|
+
detectProjectAgents,
|
|
557
|
+
isAgentInstalled,
|
|
558
|
+
parseAgentsArg,
|
|
559
559
|
installSkill,
|
|
560
560
|
uninstallSkill,
|
|
561
561
|
getInstalledSkills,
|
package/dist/cli.js
CHANGED
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import {
|
|
3
|
-
|
|
4
|
-
|
|
3
|
+
ALL_AGENTS,
|
|
4
|
+
CODING_AGENTS,
|
|
5
5
|
ensureDir,
|
|
6
6
|
exists,
|
|
7
7
|
fetchItemToDestination,
|
|
8
|
+
getAgentPath,
|
|
8
9
|
getAgentsPath,
|
|
9
10
|
getContentPath,
|
|
10
11
|
getInstalledSkills,
|
|
@@ -13,16 +14,15 @@ import {
|
|
|
13
14
|
getItemSourcePath,
|
|
14
15
|
getMcpPath,
|
|
15
16
|
getSettingsPath,
|
|
16
|
-
getToolPath,
|
|
17
17
|
installDirectory,
|
|
18
18
|
installFile,
|
|
19
19
|
listItems,
|
|
20
|
-
|
|
20
|
+
parseAgentsArg,
|
|
21
21
|
removeFile,
|
|
22
22
|
searchItems,
|
|
23
23
|
skillHandler,
|
|
24
24
|
writeTextFile
|
|
25
|
-
} from "./chunk-
|
|
25
|
+
} from "./chunk-TWSBWCGS.js";
|
|
26
26
|
|
|
27
27
|
// src/cli.ts
|
|
28
28
|
import { Command as Command5 } from "commander";
|
|
@@ -62,22 +62,22 @@ async function selectSkill(items) {
|
|
|
62
62
|
});
|
|
63
63
|
return result;
|
|
64
64
|
}
|
|
65
|
-
async function
|
|
65
|
+
async function selectAgents(compatible) {
|
|
66
66
|
const allOption = await p.select({
|
|
67
|
-
message: "Which
|
|
67
|
+
message: "Which coding agents do you want to install for?",
|
|
68
68
|
options: [
|
|
69
69
|
{ label: `All (${compatible.length} agents)`, value: "all" },
|
|
70
|
-
{ label: "Select specific
|
|
70
|
+
{ label: "Select specific agents...", value: "select" }
|
|
71
71
|
]
|
|
72
72
|
});
|
|
73
73
|
if (p.isCancel(allOption)) return allOption;
|
|
74
74
|
if (allOption === "all") return compatible;
|
|
75
75
|
const result = await p.multiselect({
|
|
76
|
-
message: "Select
|
|
77
|
-
options: compatible.map((
|
|
78
|
-
label:
|
|
79
|
-
value:
|
|
80
|
-
hint:
|
|
76
|
+
message: "Select agents",
|
|
77
|
+
options: compatible.map((agent) => ({
|
|
78
|
+
label: CODING_AGENTS[agent].name,
|
|
79
|
+
value: agent,
|
|
80
|
+
hint: CODING_AGENTS[agent].projectRoot
|
|
81
81
|
})),
|
|
82
82
|
initialValues: ["claude"],
|
|
83
83
|
required: true
|
|
@@ -98,7 +98,7 @@ async function selectMethod(symlinkPath) {
|
|
|
98
98
|
message: "Installation method",
|
|
99
99
|
options: [
|
|
100
100
|
{ label: "Symlink", value: "symlink", hint: `shared at ${symlinkPath}` },
|
|
101
|
-
{ label: "Copy", value: "copy", hint: "standalone copy per
|
|
101
|
+
{ label: "Copy", value: "copy", hint: "standalone copy per agent" }
|
|
102
102
|
]
|
|
103
103
|
});
|
|
104
104
|
return result;
|
|
@@ -162,9 +162,9 @@ function trackInstalls(slug, type, results, scope) {
|
|
|
162
162
|
body: JSON.stringify({
|
|
163
163
|
slug,
|
|
164
164
|
type,
|
|
165
|
-
|
|
165
|
+
agent: result.agent,
|
|
166
166
|
scope,
|
|
167
|
-
version: "0.1.
|
|
167
|
+
version: "0.1.72"
|
|
168
168
|
}),
|
|
169
169
|
signal: AbortSignal.timeout(4e3)
|
|
170
170
|
}).catch(() => {
|
|
@@ -173,7 +173,7 @@ function trackInstalls(slug, type, results, scope) {
|
|
|
173
173
|
}
|
|
174
174
|
|
|
175
175
|
// src/config/compatibility.ts
|
|
176
|
-
var
|
|
176
|
+
var AGENT_COMPATIBILITY = {
|
|
177
177
|
skill: ["claude", "copilot", "gemini", "codex", "opencode"],
|
|
178
178
|
command: ["claude"],
|
|
179
179
|
agent: ["claude"],
|
|
@@ -182,9 +182,9 @@ var TOOL_COMPATIBILITY = {
|
|
|
182
182
|
settings: ["claude"],
|
|
183
183
|
mcp: ["claude", "copilot", "gemini", "codex", "opencode"]
|
|
184
184
|
};
|
|
185
|
-
function
|
|
186
|
-
const compatible =
|
|
187
|
-
return
|
|
185
|
+
function filterCompatibleAgents(type, agents) {
|
|
186
|
+
const compatible = AGENT_COMPATIBILITY[type];
|
|
187
|
+
return agents.filter((a) => compatible.includes(a));
|
|
188
188
|
}
|
|
189
189
|
|
|
190
190
|
// src/handlers/agent.ts
|
|
@@ -192,14 +192,14 @@ import { join } from "path";
|
|
|
192
192
|
import { readdir } from "fs/promises";
|
|
193
193
|
import chalk3 from "chalk";
|
|
194
194
|
import ora from "ora";
|
|
195
|
-
async function
|
|
195
|
+
async function installAgentForCodingAgent(item, agent, scope, method, cwd) {
|
|
196
196
|
const spinner = ora(
|
|
197
|
-
`Installing ${item.name} for ${
|
|
197
|
+
`Installing ${item.name} for ${CODING_AGENTS[agent].name}...`
|
|
198
198
|
).start();
|
|
199
199
|
try {
|
|
200
|
-
const destDir = getContentPath(
|
|
200
|
+
const destDir = getContentPath(agent, "agent", scope, cwd);
|
|
201
201
|
if (!destDir) {
|
|
202
|
-
throw new Error(`${
|
|
202
|
+
throw new Error(`${CODING_AGENTS[agent].name} does not support agents`);
|
|
203
203
|
}
|
|
204
204
|
const destPath = join(destDir, `${item.slug}.md`);
|
|
205
205
|
const sourcePath = getItemSourcePath(item);
|
|
@@ -218,27 +218,27 @@ async function installAgentForTool(item, tool, scope, method, cwd) {
|
|
|
218
218
|
await writeTextFile(destPath, content);
|
|
219
219
|
}
|
|
220
220
|
spinner.succeed(
|
|
221
|
-
chalk3.green(`Installed ${item.name} for ${
|
|
221
|
+
chalk3.green(`Installed ${item.name} for ${CODING_AGENTS[agent].name}`)
|
|
222
222
|
);
|
|
223
|
-
return {
|
|
223
|
+
return { agent, success: true, path: destPath };
|
|
224
224
|
} catch (error2) {
|
|
225
225
|
const errorMsg = error2 instanceof Error ? error2.message : "Unknown error";
|
|
226
226
|
spinner.fail(
|
|
227
|
-
chalk3.red(`Failed to install for ${
|
|
227
|
+
chalk3.red(`Failed to install for ${CODING_AGENTS[agent].name}: ${errorMsg}`)
|
|
228
228
|
);
|
|
229
|
-
return {
|
|
229
|
+
return { agent, success: false, path: "", error: errorMsg };
|
|
230
230
|
}
|
|
231
231
|
}
|
|
232
|
-
async function installAgent(item,
|
|
232
|
+
async function installAgent(item, agents, scope, method, cwd = process.cwd()) {
|
|
233
233
|
const results = [];
|
|
234
|
-
for (const
|
|
235
|
-
const result = await
|
|
234
|
+
for (const agent of agents) {
|
|
235
|
+
const result = await installAgentForCodingAgent(item, agent, scope, method, cwd);
|
|
236
236
|
results.push(result);
|
|
237
237
|
}
|
|
238
238
|
return results;
|
|
239
239
|
}
|
|
240
|
-
async function uninstallAgent(slug,
|
|
241
|
-
const destDir = getContentPath(
|
|
240
|
+
async function uninstallAgent(slug, agent, scope, cwd = process.cwd()) {
|
|
241
|
+
const destDir = getContentPath(agent, "agent", scope, cwd);
|
|
242
242
|
if (!destDir) return false;
|
|
243
243
|
const destPath = join(destDir, `${slug}.md`);
|
|
244
244
|
if (!await exists(destPath)) {
|
|
@@ -246,8 +246,8 @@ async function uninstallAgent(slug, tool, scope, cwd = process.cwd()) {
|
|
|
246
246
|
}
|
|
247
247
|
return removeFile(destPath);
|
|
248
248
|
}
|
|
249
|
-
async function getInstalledAgents(
|
|
250
|
-
const destDir = getContentPath(
|
|
249
|
+
async function getInstalledAgents(agent, scope, cwd = process.cwd()) {
|
|
250
|
+
const destDir = getContentPath(agent, "agent", scope, cwd);
|
|
251
251
|
if (!destDir || !await exists(destDir)) {
|
|
252
252
|
return [];
|
|
253
253
|
}
|
|
@@ -256,14 +256,14 @@ async function getInstalledAgents(tool, scope, cwd = process.cwd()) {
|
|
|
256
256
|
}
|
|
257
257
|
var agentHandler = {
|
|
258
258
|
type: "agent",
|
|
259
|
-
async install(item,
|
|
260
|
-
return installAgent(item,
|
|
259
|
+
async install(item, agents, scope, method, cwd) {
|
|
260
|
+
return installAgent(item, agents, scope, method, cwd);
|
|
261
261
|
},
|
|
262
|
-
async uninstall(slug,
|
|
263
|
-
return uninstallAgent(slug,
|
|
262
|
+
async uninstall(slug, agent, scope, cwd) {
|
|
263
|
+
return uninstallAgent(slug, agent, scope, cwd);
|
|
264
264
|
},
|
|
265
|
-
async listInstalled(
|
|
266
|
-
return getInstalledAgents(
|
|
265
|
+
async listInstalled(agent, scope, cwd) {
|
|
266
|
+
return getInstalledAgents(agent, scope, cwd);
|
|
267
267
|
}
|
|
268
268
|
};
|
|
269
269
|
|
|
@@ -338,12 +338,12 @@ function findScriptFile(item) {
|
|
|
338
338
|
}
|
|
339
339
|
return null;
|
|
340
340
|
}
|
|
341
|
-
async function
|
|
341
|
+
async function installHookForAgent(item, agent, scope, _method, cwd) {
|
|
342
342
|
const spinner = ora2(
|
|
343
|
-
`Installing ${item.name} for ${
|
|
343
|
+
`Installing ${item.name} for ${CODING_AGENTS[agent].name}...`
|
|
344
344
|
).start();
|
|
345
345
|
try {
|
|
346
|
-
if (
|
|
346
|
+
if (agent !== "claude") {
|
|
347
347
|
throw new Error("Hooks are only supported for Claude Code");
|
|
348
348
|
}
|
|
349
349
|
const triggers = item.contents?.triggers;
|
|
@@ -401,27 +401,27 @@ async function installHookForTool(item, tool, scope, _method, cwd) {
|
|
|
401
401
|
}
|
|
402
402
|
await writeJson(settingsPath, settings);
|
|
403
403
|
spinner.succeed(
|
|
404
|
-
chalk4.green(`Installed ${item.name} for ${
|
|
404
|
+
chalk4.green(`Installed ${item.name} for ${CODING_AGENTS[agent].name}`)
|
|
405
405
|
);
|
|
406
|
-
return {
|
|
406
|
+
return { agent, success: true, path: destScriptPath };
|
|
407
407
|
} catch (error2) {
|
|
408
408
|
const errorMsg = error2 instanceof Error ? error2.message : "Unknown error";
|
|
409
409
|
spinner.fail(
|
|
410
|
-
chalk4.red(`Failed to install for ${
|
|
410
|
+
chalk4.red(`Failed to install for ${CODING_AGENTS[agent].name}: ${errorMsg}`)
|
|
411
411
|
);
|
|
412
|
-
return {
|
|
412
|
+
return { agent, success: false, path: "", error: errorMsg };
|
|
413
413
|
}
|
|
414
414
|
}
|
|
415
|
-
async function installHook(item,
|
|
415
|
+
async function installHook(item, agents, scope, method, cwd = process.cwd()) {
|
|
416
416
|
const results = [];
|
|
417
|
-
for (const
|
|
418
|
-
const result = await
|
|
417
|
+
for (const agent of agents) {
|
|
418
|
+
const result = await installHookForAgent(item, agent, scope, method, cwd);
|
|
419
419
|
results.push(result);
|
|
420
420
|
}
|
|
421
421
|
return results;
|
|
422
422
|
}
|
|
423
|
-
async function uninstallHook(slug,
|
|
424
|
-
if (
|
|
423
|
+
async function uninstallHook(slug, agent, scope, cwd = process.cwd()) {
|
|
424
|
+
if (agent !== "claude") return false;
|
|
425
425
|
const settingsPath = getSettingsPath(scope, cwd);
|
|
426
426
|
if (!await exists(settingsPath)) return false;
|
|
427
427
|
const item = await getItem(slug, "hook");
|
|
@@ -469,8 +469,8 @@ async function uninstallHook(slug, tool, scope, cwd = process.cwd()) {
|
|
|
469
469
|
}
|
|
470
470
|
return removed;
|
|
471
471
|
}
|
|
472
|
-
async function getInstalledHooks(
|
|
473
|
-
if (
|
|
472
|
+
async function getInstalledHooks(agent, scope, cwd = process.cwd()) {
|
|
473
|
+
if (agent !== "claude") return [];
|
|
474
474
|
const settingsPath = getSettingsPath(scope, cwd);
|
|
475
475
|
if (!await exists(settingsPath)) return [];
|
|
476
476
|
const settings = await readJson(settingsPath);
|
|
@@ -488,14 +488,14 @@ async function getInstalledHooks(tool, scope, cwd = process.cwd()) {
|
|
|
488
488
|
}
|
|
489
489
|
var hookHandler = {
|
|
490
490
|
type: "hook",
|
|
491
|
-
async install(item,
|
|
492
|
-
return installHook(item,
|
|
491
|
+
async install(item, agents, scope, method, cwd) {
|
|
492
|
+
return installHook(item, agents, scope, method, cwd);
|
|
493
493
|
},
|
|
494
|
-
async uninstall(slug,
|
|
495
|
-
return uninstallHook(slug,
|
|
494
|
+
async uninstall(slug, agent, scope, cwd) {
|
|
495
|
+
return uninstallHook(slug, agent, scope, cwd);
|
|
496
496
|
},
|
|
497
|
-
async listInstalled(
|
|
498
|
-
return getInstalledHooks(
|
|
497
|
+
async listInstalled(agent, scope, cwd) {
|
|
498
|
+
return getInstalledHooks(agent, scope, cwd);
|
|
499
499
|
}
|
|
500
500
|
};
|
|
501
501
|
|
|
@@ -509,9 +509,9 @@ function parseMcpDefinition(content) {
|
|
|
509
509
|
throw new Error("Invalid MCP definition: must be valid JSON");
|
|
510
510
|
}
|
|
511
511
|
}
|
|
512
|
-
async function
|
|
512
|
+
async function installMcpForAgent(item, agent, scope, _method, cwd) {
|
|
513
513
|
const spinner = ora3(
|
|
514
|
-
`Installing ${item.name} for ${
|
|
514
|
+
`Installing ${item.name} for ${CODING_AGENTS[agent].name}...`
|
|
515
515
|
).start();
|
|
516
516
|
try {
|
|
517
517
|
const content = await getItemContent(item);
|
|
@@ -522,26 +522,26 @@ async function installMcpForTool(item, tool, scope, _method, cwd) {
|
|
|
522
522
|
config.mcpServers[mcpDef.name] = mcpDef.config;
|
|
523
523
|
await writeJson(configPath, config);
|
|
524
524
|
spinner.succeed(
|
|
525
|
-
chalk5.green(`Installed ${item.name} for ${
|
|
525
|
+
chalk5.green(`Installed ${item.name} for ${CODING_AGENTS[agent].name}`)
|
|
526
526
|
);
|
|
527
|
-
return {
|
|
527
|
+
return { agent, success: true, path: configPath };
|
|
528
528
|
} catch (error2) {
|
|
529
529
|
const errorMsg = error2 instanceof Error ? error2.message : "Unknown error";
|
|
530
530
|
spinner.fail(
|
|
531
|
-
chalk5.red(`Failed to install for ${
|
|
531
|
+
chalk5.red(`Failed to install for ${CODING_AGENTS[agent].name}: ${errorMsg}`)
|
|
532
532
|
);
|
|
533
|
-
return {
|
|
533
|
+
return { agent, success: false, path: "", error: errorMsg };
|
|
534
534
|
}
|
|
535
535
|
}
|
|
536
|
-
async function installMcp(item,
|
|
536
|
+
async function installMcp(item, agents, scope, method, cwd = process.cwd()) {
|
|
537
537
|
const results = [];
|
|
538
|
-
for (const
|
|
539
|
-
const result = await
|
|
538
|
+
for (const agent of agents) {
|
|
539
|
+
const result = await installMcpForAgent(item, agent, scope, method, cwd);
|
|
540
540
|
results.push(result);
|
|
541
541
|
}
|
|
542
542
|
return results;
|
|
543
543
|
}
|
|
544
|
-
async function uninstallMcp(slug,
|
|
544
|
+
async function uninstallMcp(slug, _agent, scope, cwd = process.cwd()) {
|
|
545
545
|
const configPath = getMcpPath(scope, cwd);
|
|
546
546
|
if (!await exists(configPath)) return false;
|
|
547
547
|
const config = await readJson(configPath);
|
|
@@ -552,7 +552,7 @@ async function uninstallMcp(slug, _tool, scope, cwd = process.cwd()) {
|
|
|
552
552
|
await writeJson(configPath, config);
|
|
553
553
|
return true;
|
|
554
554
|
}
|
|
555
|
-
async function getInstalledMcpServers(
|
|
555
|
+
async function getInstalledMcpServers(_agent, scope, cwd = process.cwd()) {
|
|
556
556
|
const configPath = getMcpPath(scope, cwd);
|
|
557
557
|
if (!await exists(configPath)) return [];
|
|
558
558
|
const config = await readJson(configPath);
|
|
@@ -560,14 +560,14 @@ async function getInstalledMcpServers(_tool, scope, cwd = process.cwd()) {
|
|
|
560
560
|
}
|
|
561
561
|
var mcpHandler = {
|
|
562
562
|
type: "mcp",
|
|
563
|
-
async install(item,
|
|
564
|
-
return installMcp(item,
|
|
563
|
+
async install(item, agents, scope, method, cwd) {
|
|
564
|
+
return installMcp(item, agents, scope, method, cwd);
|
|
565
565
|
},
|
|
566
|
-
async uninstall(slug,
|
|
567
|
-
return uninstallMcp(slug,
|
|
566
|
+
async uninstall(slug, agent, scope, cwd) {
|
|
567
|
+
return uninstallMcp(slug, agent, scope, cwd);
|
|
568
568
|
},
|
|
569
|
-
async listInstalled(
|
|
570
|
-
return getInstalledMcpServers(
|
|
569
|
+
async listInstalled(agent, scope, cwd) {
|
|
570
|
+
return getInstalledMcpServers(agent, scope, cwd);
|
|
571
571
|
}
|
|
572
572
|
};
|
|
573
573
|
|
|
@@ -581,12 +581,12 @@ function parseSettings(content) {
|
|
|
581
581
|
throw new Error("Invalid settings: must be valid JSON");
|
|
582
582
|
}
|
|
583
583
|
}
|
|
584
|
-
async function
|
|
584
|
+
async function installSettingsForAgent(item, agent, scope, _method, cwd) {
|
|
585
585
|
const spinner = ora4(
|
|
586
|
-
`Installing ${item.name} for ${
|
|
586
|
+
`Installing ${item.name} for ${CODING_AGENTS[agent].name}...`
|
|
587
587
|
).start();
|
|
588
588
|
try {
|
|
589
|
-
if (
|
|
589
|
+
if (agent !== "claude") {
|
|
590
590
|
throw new Error("Settings are only supported for Claude Code");
|
|
591
591
|
}
|
|
592
592
|
const content = await getItemContent(item);
|
|
@@ -596,21 +596,21 @@ async function installSettingsForTool(item, tool, scope, _method, cwd) {
|
|
|
596
596
|
const merged = deepMerge(existingSettings, newSettings);
|
|
597
597
|
await writeJson(settingsPath, merged);
|
|
598
598
|
spinner.succeed(
|
|
599
|
-
chalk6.green(`Installed ${item.name} for ${
|
|
599
|
+
chalk6.green(`Installed ${item.name} for ${CODING_AGENTS[agent].name}`)
|
|
600
600
|
);
|
|
601
|
-
return {
|
|
601
|
+
return { agent, success: true, path: settingsPath };
|
|
602
602
|
} catch (error2) {
|
|
603
603
|
const errorMsg = error2 instanceof Error ? error2.message : "Unknown error";
|
|
604
604
|
spinner.fail(
|
|
605
|
-
chalk6.red(`Failed to install for ${
|
|
605
|
+
chalk6.red(`Failed to install for ${CODING_AGENTS[agent].name}: ${errorMsg}`)
|
|
606
606
|
);
|
|
607
|
-
return {
|
|
607
|
+
return { agent, success: false, path: "", error: errorMsg };
|
|
608
608
|
}
|
|
609
609
|
}
|
|
610
|
-
async function installSettings(item,
|
|
610
|
+
async function installSettings(item, agents, scope, method, cwd = process.cwd()) {
|
|
611
611
|
const results = [];
|
|
612
|
-
for (const
|
|
613
|
-
const result = await
|
|
612
|
+
for (const agent of agents) {
|
|
613
|
+
const result = await installSettingsForAgent(item, agent, scope, method, cwd);
|
|
614
614
|
results.push(result);
|
|
615
615
|
}
|
|
616
616
|
return results;
|
|
@@ -642,8 +642,8 @@ function deepUnmerge(target, source) {
|
|
|
642
642
|
}
|
|
643
643
|
return { result, changed };
|
|
644
644
|
}
|
|
645
|
-
async function uninstallSettings(slug,
|
|
646
|
-
if (
|
|
645
|
+
async function uninstallSettings(slug, agent, scope, cwd = process.cwd()) {
|
|
646
|
+
if (agent !== "claude") return false;
|
|
647
647
|
const item = await getItem(slug, "settings");
|
|
648
648
|
if (!item) return false;
|
|
649
649
|
let content;
|
|
@@ -662,22 +662,22 @@ async function uninstallSettings(slug, tool, scope, cwd = process.cwd()) {
|
|
|
662
662
|
}
|
|
663
663
|
return changed;
|
|
664
664
|
}
|
|
665
|
-
async function getInstalledSettings(
|
|
666
|
-
if (
|
|
665
|
+
async function getInstalledSettings(agent, scope, cwd = process.cwd()) {
|
|
666
|
+
if (agent !== "claude") return [];
|
|
667
667
|
const settingsPath = getSettingsPath(scope, cwd);
|
|
668
668
|
if (!await exists(settingsPath)) return [];
|
|
669
669
|
return [];
|
|
670
670
|
}
|
|
671
671
|
var settingsHandler = {
|
|
672
672
|
type: "settings",
|
|
673
|
-
async install(item,
|
|
674
|
-
return installSettings(item,
|
|
673
|
+
async install(item, agents, scope, method, cwd) {
|
|
674
|
+
return installSettings(item, agents, scope, method, cwd);
|
|
675
675
|
},
|
|
676
|
-
async uninstall(slug,
|
|
677
|
-
return uninstallSettings(slug,
|
|
676
|
+
async uninstall(slug, agent, scope, cwd) {
|
|
677
|
+
return uninstallSettings(slug, agent, scope, cwd);
|
|
678
678
|
},
|
|
679
|
-
async listInstalled(
|
|
680
|
-
return getInstalledSettings(
|
|
679
|
+
async listInstalled(agent, scope, cwd) {
|
|
680
|
+
return getInstalledSettings(agent, scope, cwd);
|
|
681
681
|
}
|
|
682
682
|
};
|
|
683
683
|
|
|
@@ -728,12 +728,12 @@ async function ensureMarketplaceRegistered(marketplace, item) {
|
|
|
728
728
|
};
|
|
729
729
|
await writeJson(KNOWN_MARKETPLACES_PATH, known);
|
|
730
730
|
}
|
|
731
|
-
async function
|
|
731
|
+
async function installPluginForAgent(item, agent, scope, method, cwd) {
|
|
732
732
|
const spinner = ora5(
|
|
733
|
-
`Installing ${item.name} for ${
|
|
733
|
+
`Installing ${item.name} for ${CODING_AGENTS[agent].name}...`
|
|
734
734
|
).start();
|
|
735
735
|
try {
|
|
736
|
-
if (
|
|
736
|
+
if (agent !== "claude") {
|
|
737
737
|
throw new Error("Plugins are only supported for Claude Code");
|
|
738
738
|
}
|
|
739
739
|
const tmpPath = join3(PLUGINS_CACHE_DIR, ".tmp", item.slug);
|
|
@@ -779,27 +779,27 @@ async function installPluginForTool(item, tool, scope, method, cwd) {
|
|
|
779
779
|
settings.enabledPlugins[pluginId] = true;
|
|
780
780
|
await writeJson(settingsPath, settings);
|
|
781
781
|
spinner.succeed(
|
|
782
|
-
chalk7.green(`Installed ${item.name} for ${
|
|
782
|
+
chalk7.green(`Installed ${item.name} for ${CODING_AGENTS[agent].name}`)
|
|
783
783
|
);
|
|
784
|
-
return {
|
|
784
|
+
return { agent, success: true, path: cachePath };
|
|
785
785
|
} catch (error2) {
|
|
786
786
|
const errorMsg = error2 instanceof Error ? error2.message : "Unknown error";
|
|
787
787
|
spinner.fail(
|
|
788
|
-
chalk7.red(`Failed to install for ${
|
|
788
|
+
chalk7.red(`Failed to install for ${CODING_AGENTS[agent].name}: ${errorMsg}`)
|
|
789
789
|
);
|
|
790
|
-
return {
|
|
790
|
+
return { agent, success: false, path: "", error: errorMsg };
|
|
791
791
|
}
|
|
792
792
|
}
|
|
793
|
-
async function installPlugin(item,
|
|
793
|
+
async function installPlugin(item, agents, scope, method, cwd = process.cwd()) {
|
|
794
794
|
const results = [];
|
|
795
|
-
for (const
|
|
796
|
-
const result = await
|
|
795
|
+
for (const agent of agents) {
|
|
796
|
+
const result = await installPluginForAgent(item, agent, scope, method, cwd);
|
|
797
797
|
results.push(result);
|
|
798
798
|
}
|
|
799
799
|
return results;
|
|
800
800
|
}
|
|
801
|
-
async function uninstallPlugin(slug,
|
|
802
|
-
if (
|
|
801
|
+
async function uninstallPlugin(slug, agent, scope, cwd = process.cwd()) {
|
|
802
|
+
if (agent !== "claude") return false;
|
|
803
803
|
const registry = await readJson(INSTALLED_PLUGINS_PATH);
|
|
804
804
|
if (!registry.plugins) return false;
|
|
805
805
|
const matchingKey = Object.keys(registry.plugins).find(
|
|
@@ -824,8 +824,8 @@ async function uninstallPlugin(slug, tool, scope, cwd = process.cwd()) {
|
|
|
824
824
|
}
|
|
825
825
|
return true;
|
|
826
826
|
}
|
|
827
|
-
async function getInstalledPlugins(
|
|
828
|
-
if (
|
|
827
|
+
async function getInstalledPlugins(agent, scope, cwd = process.cwd()) {
|
|
828
|
+
if (agent !== "claude") return [];
|
|
829
829
|
const registry = await readJson(INSTALLED_PLUGINS_PATH);
|
|
830
830
|
if (!registry.plugins) return [];
|
|
831
831
|
const installed = [];
|
|
@@ -842,14 +842,14 @@ async function getInstalledPlugins(tool, scope, cwd = process.cwd()) {
|
|
|
842
842
|
}
|
|
843
843
|
var pluginHandler = {
|
|
844
844
|
type: "plugin",
|
|
845
|
-
async install(item,
|
|
846
|
-
return installPlugin(item,
|
|
845
|
+
async install(item, agents, scope, method, cwd) {
|
|
846
|
+
return installPlugin(item, agents, scope, method, cwd);
|
|
847
847
|
},
|
|
848
|
-
async uninstall(slug,
|
|
849
|
-
return uninstallPlugin(slug,
|
|
848
|
+
async uninstall(slug, agent, scope, cwd) {
|
|
849
|
+
return uninstallPlugin(slug, agent, scope, cwd);
|
|
850
850
|
},
|
|
851
|
-
async listInstalled(
|
|
852
|
-
return getInstalledPlugins(
|
|
851
|
+
async listInstalled(agent, scope, cwd) {
|
|
852
|
+
return getInstalledPlugins(agent, scope, cwd);
|
|
853
853
|
}
|
|
854
854
|
};
|
|
855
855
|
|
|
@@ -904,19 +904,19 @@ async function resolveItem(itemName, type) {
|
|
|
904
904
|
}
|
|
905
905
|
return selected;
|
|
906
906
|
}
|
|
907
|
-
function
|
|
908
|
-
const typeCompatible =
|
|
907
|
+
function resolveAgents(agentsArg, item) {
|
|
908
|
+
const typeCompatible = filterCompatibleAgents(item.type, item.compatibility);
|
|
909
909
|
if (!agentsArg) return [];
|
|
910
|
-
const
|
|
911
|
-
if (agentsArg === "all") return
|
|
912
|
-
const incompatible =
|
|
910
|
+
const agents = parseAgentsArg(agentsArg, typeCompatible);
|
|
911
|
+
if (agentsArg === "all") return agents;
|
|
912
|
+
const incompatible = agents.filter((a) => !typeCompatible.includes(a));
|
|
913
913
|
if (incompatible.length > 0) {
|
|
914
914
|
warn(`${incompatible.join(", ")} not compatible with this ${item.type}`);
|
|
915
|
-
return
|
|
915
|
+
return agents.filter((a) => typeCompatible.includes(a));
|
|
916
916
|
}
|
|
917
|
-
return
|
|
917
|
+
return agents;
|
|
918
918
|
}
|
|
919
|
-
function printDryRunSummary(item,
|
|
919
|
+
function printDryRunSummary(item, agents, scope, method, cwd) {
|
|
920
920
|
info("Dry run - no files will be written\n");
|
|
921
921
|
console.log(chalk8.cyan(" Would install:"));
|
|
922
922
|
console.log(` ${item.type}: ${chalk8.white(item.name)}`);
|
|
@@ -928,13 +928,13 @@ function printDryRunSummary(item, tools, scope, method, cwd) {
|
|
|
928
928
|
console.log(chalk8.cyan(" Central storage:"));
|
|
929
929
|
console.log(` ${chalk8.gray("\u2192")} ${chalk8.gray(centralPath)}`);
|
|
930
930
|
console.log();
|
|
931
|
-
console.log(chalk8.cyan(" Symlinks from
|
|
931
|
+
console.log(chalk8.cyan(" Symlinks from agent folders:"));
|
|
932
932
|
} else {
|
|
933
933
|
console.log(chalk8.cyan(" Target locations:"));
|
|
934
934
|
}
|
|
935
|
-
for (const
|
|
936
|
-
const config =
|
|
937
|
-
const contentPath = getContentPath(
|
|
935
|
+
for (const agent of agents) {
|
|
936
|
+
const config = CODING_AGENTS[agent];
|
|
937
|
+
const contentPath = getContentPath(agent, item.type, scope, cwd);
|
|
938
938
|
if (!contentPath) {
|
|
939
939
|
console.log(` ${chalk8.gray("\u2192")} ${chalk8.white(config.name)}: ${chalk8.red("not supported")}`);
|
|
940
940
|
continue;
|
|
@@ -948,22 +948,22 @@ function printInstallSummary(results) {
|
|
|
948
948
|
const successful = results.filter((r) => r.success);
|
|
949
949
|
const failed = results.filter((r) => !r.success);
|
|
950
950
|
if (successful.length > 0) {
|
|
951
|
-
success(`Installed for ${successful.length}
|
|
951
|
+
success(`Installed for ${successful.length} agent(s)`);
|
|
952
952
|
for (const r of successful) {
|
|
953
953
|
console.log(chalk8.gray(` \u2192 ${r.path}`));
|
|
954
954
|
}
|
|
955
955
|
}
|
|
956
956
|
if (failed.length > 0) {
|
|
957
|
-
error(`Failed for ${failed.length}
|
|
957
|
+
error(`Failed for ${failed.length} agent(s)`);
|
|
958
958
|
for (const r of failed) {
|
|
959
|
-
console.log(chalk8.red(` \xD7 ${r.
|
|
959
|
+
console.log(chalk8.red(` \xD7 ${r.agent}: ${r.error}`));
|
|
960
960
|
}
|
|
961
961
|
process.exit(1);
|
|
962
962
|
}
|
|
963
963
|
}
|
|
964
964
|
var addCommand = new Command("add").description("Install a skill, agent, hook, or other configuration").argument("[name]", "Name of the item to install").option("-t, --type <type>", "Content type: skill, agent, hook, mcp, plugin, settings").option(
|
|
965
|
-
"-a, --agents <
|
|
966
|
-
"Comma-separated
|
|
965
|
+
"-a, --agents <agents>",
|
|
966
|
+
"Comma-separated coding agents or 'all' (claude,copilot,gemini,codex,opencode)"
|
|
967
967
|
).option("-s, --scope <scope>", "Installation scope: project, user, or local").option("-m, --method <method>", "Installation method: symlink or copy").option("-y, --yes", "Skip confirmation prompts").option("-f, --force", "Overwrite existing files").option("-n, --dry-run", "Show what would be installed without making changes").action(async (name, options) => {
|
|
968
968
|
try {
|
|
969
969
|
printLogo();
|
|
@@ -978,25 +978,25 @@ var addCommand = new Command("add").description("Install a skill, agent, hook, o
|
|
|
978
978
|
error(`No handler found for type "${item.type}"`);
|
|
979
979
|
process.exit(1);
|
|
980
980
|
}
|
|
981
|
-
let
|
|
982
|
-
const typeCompatible =
|
|
983
|
-
if (
|
|
981
|
+
let agents = resolveAgents(options.agents, item);
|
|
982
|
+
const typeCompatible = filterCompatibleAgents(item.type, item.compatibility);
|
|
983
|
+
if (agents.length === 0) {
|
|
984
984
|
if (typeCompatible.length === 1) {
|
|
985
|
-
|
|
985
|
+
agents = typeCompatible;
|
|
986
986
|
} else {
|
|
987
|
-
const selected = await
|
|
987
|
+
const selected = await selectAgents(typeCompatible);
|
|
988
988
|
if (p.isCancel(selected)) {
|
|
989
989
|
cancelled();
|
|
990
990
|
return;
|
|
991
991
|
}
|
|
992
|
-
|
|
992
|
+
agents = selected;
|
|
993
993
|
}
|
|
994
994
|
}
|
|
995
|
-
if (
|
|
996
|
-
error("No valid
|
|
995
|
+
if (agents.length === 0) {
|
|
996
|
+
error("No valid agents selected");
|
|
997
997
|
process.exit(1);
|
|
998
998
|
}
|
|
999
|
-
step(`
|
|
999
|
+
step(`Agents: ${chalk8.cyan(agents.join(", "))}`);
|
|
1000
1000
|
let scope;
|
|
1001
1001
|
if (options.scope) {
|
|
1002
1002
|
scope = options.scope;
|
|
@@ -1013,7 +1013,7 @@ var addCommand = new Command("add").description("Install a skill, agent, hook, o
|
|
|
1013
1013
|
let method;
|
|
1014
1014
|
if (options.method) {
|
|
1015
1015
|
method = options.method;
|
|
1016
|
-
} else if (
|
|
1016
|
+
} else if (agents.length === 1) {
|
|
1017
1017
|
method = "copy";
|
|
1018
1018
|
} else {
|
|
1019
1019
|
const symlinkPath = getAgentsPath(item.type, item.slug, process.cwd());
|
|
@@ -1027,7 +1027,7 @@ var addCommand = new Command("add").description("Install a skill, agent, hook, o
|
|
|
1027
1027
|
step(`Method: ${chalk8.cyan(method)}`);
|
|
1028
1028
|
if (options.dryRun) {
|
|
1029
1029
|
console.log();
|
|
1030
|
-
printDryRunSummary(item,
|
|
1030
|
+
printDryRunSummary(item, agents, scope, method, process.cwd());
|
|
1031
1031
|
outro2("Dry run complete");
|
|
1032
1032
|
return;
|
|
1033
1033
|
}
|
|
@@ -1040,7 +1040,7 @@ var addCommand = new Command("add").description("Install a skill, agent, hook, o
|
|
|
1040
1040
|
}
|
|
1041
1041
|
}
|
|
1042
1042
|
console.log();
|
|
1043
|
-
const results = await handler.install(item,
|
|
1043
|
+
const results = await handler.install(item, agents, scope, method, process.cwd());
|
|
1044
1044
|
trackInstalls(item.slug, item.type, results, scope);
|
|
1045
1045
|
printInstallSummary(results);
|
|
1046
1046
|
outro2("Installation complete");
|
|
@@ -1087,7 +1087,7 @@ async function listAvailable(type) {
|
|
|
1087
1087
|
${itemType.toUpperCase()}S`));
|
|
1088
1088
|
console.log(chalk9.gray("\u2500".repeat(SEPARATOR_WIDTH)));
|
|
1089
1089
|
for (const item of typeItems) {
|
|
1090
|
-
const compatIcons = item.compatibility.map((
|
|
1090
|
+
const compatIcons = item.compatibility.map((a) => CODING_AGENTS[a].shortName).join(" ");
|
|
1091
1091
|
const featured = item.featured ? chalk9.yellow("\u2605 ") : " ";
|
|
1092
1092
|
console.log(
|
|
1093
1093
|
`${featured}${chalk9.white(item.slug.padEnd(SLUG_COLUMN_WIDTH))} ${chalk9.gray(compatIcons)}`
|
|
@@ -1105,13 +1105,13 @@ async function listInstalled(scope) {
|
|
|
1105
1105
|
Installed skills (${scope} scope):
|
|
1106
1106
|
`));
|
|
1107
1107
|
let total = 0;
|
|
1108
|
-
for (const
|
|
1108
|
+
for (const agent of ALL_AGENTS) {
|
|
1109
1109
|
const installed = await getInstalledSkills(
|
|
1110
|
-
|
|
1110
|
+
agent,
|
|
1111
1111
|
scope
|
|
1112
1112
|
);
|
|
1113
1113
|
if (installed.length > 0) {
|
|
1114
|
-
console.log(chalk9.blue(
|
|
1114
|
+
console.log(chalk9.blue(CODING_AGENTS[agent].name));
|
|
1115
1115
|
for (const skill of installed) {
|
|
1116
1116
|
console.log(` ${chalk9.white(skill)}`);
|
|
1117
1117
|
total++;
|
|
@@ -1158,37 +1158,37 @@ async function promptConfirm(message, defaultValue = true) {
|
|
|
1158
1158
|
}
|
|
1159
1159
|
|
|
1160
1160
|
// src/commands/remove.ts
|
|
1161
|
-
async function
|
|
1161
|
+
async function findInstalledAgents(slug, type, scope) {
|
|
1162
1162
|
const handler = getHandler(type);
|
|
1163
1163
|
if (!handler) return [];
|
|
1164
|
-
const
|
|
1165
|
-
for (const
|
|
1166
|
-
const installed = await handler.listInstalled(
|
|
1164
|
+
const agents = [];
|
|
1165
|
+
for (const agent of ALL_AGENTS) {
|
|
1166
|
+
const installed = await handler.listInstalled(agent, scope);
|
|
1167
1167
|
if (installed.includes(slug)) {
|
|
1168
|
-
|
|
1168
|
+
agents.push(agent);
|
|
1169
1169
|
}
|
|
1170
1170
|
}
|
|
1171
|
-
return
|
|
1171
|
+
return agents;
|
|
1172
1172
|
}
|
|
1173
|
-
async function
|
|
1173
|
+
async function removeFromAgents(slug, type, agents, scope) {
|
|
1174
1174
|
const handler = getHandler(type);
|
|
1175
1175
|
if (!handler) return 0;
|
|
1176
1176
|
let successCount = 0;
|
|
1177
|
-
for (const
|
|
1178
|
-
const spinner = ora6(`Removing from ${
|
|
1179
|
-
const removed = await handler.uninstall(slug,
|
|
1177
|
+
for (const agent of agents) {
|
|
1178
|
+
const spinner = ora6(`Removing from ${CODING_AGENTS[agent].name}...`).start();
|
|
1179
|
+
const removed = await handler.uninstall(slug, agent, scope);
|
|
1180
1180
|
if (removed) {
|
|
1181
|
-
spinner.succeed(chalk10.green(`Removed from ${
|
|
1181
|
+
spinner.succeed(chalk10.green(`Removed from ${CODING_AGENTS[agent].name}`));
|
|
1182
1182
|
successCount++;
|
|
1183
1183
|
} else {
|
|
1184
|
-
spinner.info(chalk10.gray(`Not found in ${
|
|
1184
|
+
spinner.info(chalk10.gray(`Not found in ${CODING_AGENTS[agent].name}`));
|
|
1185
1185
|
}
|
|
1186
1186
|
}
|
|
1187
1187
|
return successCount;
|
|
1188
1188
|
}
|
|
1189
1189
|
var removeCommand = new Command3("remove").alias("rm").description("Remove an installed item (skill, plugin, agent, hook, mcp)").argument("<name>", "Name/slug of the item to remove").option("-t, --type <type>", "Content type: skill, agent, hook, mcp, plugin, settings").option(
|
|
1190
|
-
"-a, --agents <
|
|
1191
|
-
"Comma-separated
|
|
1190
|
+
"-a, --agents <agents>",
|
|
1191
|
+
"Comma-separated coding agents or 'all'"
|
|
1192
1192
|
).option(
|
|
1193
1193
|
"--scope <scope>",
|
|
1194
1194
|
"Installation scope: project, user, or global",
|
|
@@ -1208,8 +1208,8 @@ var removeCommand = new Command3("remove").alias("rm").description("Remove an in
|
|
|
1208
1208
|
console.log(chalk10.red(`No handler found for type "${type}"`));
|
|
1209
1209
|
process.exit(1);
|
|
1210
1210
|
}
|
|
1211
|
-
const
|
|
1212
|
-
if (
|
|
1211
|
+
const agents = options.agents ? parseAgentsArg(options.agents, ALL_AGENTS) : await findInstalledAgents(name, type, scope);
|
|
1212
|
+
if (agents.length === 0) {
|
|
1213
1213
|
console.log(
|
|
1214
1214
|
chalk10.yellow(`${type} "${name}" is not installed in ${scope} scope`)
|
|
1215
1215
|
);
|
|
@@ -1218,8 +1218,8 @@ var removeCommand = new Command3("remove").alias("rm").description("Remove an in
|
|
|
1218
1218
|
if (!options.yes) {
|
|
1219
1219
|
console.log(chalk10.cyan(`
|
|
1220
1220
|
Will remove ${type} "${name}" from:`));
|
|
1221
|
-
for (const
|
|
1222
|
-
console.log(` - ${
|
|
1221
|
+
for (const agent of agents) {
|
|
1222
|
+
console.log(` - ${CODING_AGENTS[agent].name}`);
|
|
1223
1223
|
}
|
|
1224
1224
|
console.log("");
|
|
1225
1225
|
const confirmed = await promptConfirm("Proceed with removal?");
|
|
@@ -1228,11 +1228,11 @@ Will remove ${type} "${name}" from:`));
|
|
|
1228
1228
|
process.exit(0);
|
|
1229
1229
|
}
|
|
1230
1230
|
}
|
|
1231
|
-
const successCount = await
|
|
1231
|
+
const successCount = await removeFromAgents(name, type, agents, scope);
|
|
1232
1232
|
console.log("");
|
|
1233
1233
|
if (successCount > 0) {
|
|
1234
1234
|
console.log(
|
|
1235
|
-
chalk10.green(`Successfully removed from ${successCount}
|
|
1235
|
+
chalk10.green(`Successfully removed from ${successCount} agent(s)`)
|
|
1236
1236
|
);
|
|
1237
1237
|
} else {
|
|
1238
1238
|
console.log(chalk10.yellow("Nothing to remove"));
|
|
@@ -1247,21 +1247,21 @@ import { Command as Command4 } from "commander";
|
|
|
1247
1247
|
import chalk11 from "chalk";
|
|
1248
1248
|
import ora7 from "ora";
|
|
1249
1249
|
import { join as join4 } from "path";
|
|
1250
|
-
var initCommand = new Command4("init").description("Initialize
|
|
1251
|
-
"-a, --agents <
|
|
1252
|
-
"Comma-separated
|
|
1250
|
+
var initCommand = new Command4("init").description("Initialize coding agent configuration directories").option(
|
|
1251
|
+
"-a, --agents <agents>",
|
|
1252
|
+
"Comma-separated coding agents or 'all'",
|
|
1253
1253
|
"claude"
|
|
1254
1254
|
).option("-y, --yes", "Skip confirmation prompts").action(async (options) => {
|
|
1255
1255
|
try {
|
|
1256
|
-
const
|
|
1257
|
-
if (
|
|
1258
|
-
console.error(chalk11.red("No valid
|
|
1256
|
+
const agents = parseAgentsArg(options.agents, ALL_AGENTS);
|
|
1257
|
+
if (agents.length === 0) {
|
|
1258
|
+
console.error(chalk11.red("No valid agents specified"));
|
|
1259
1259
|
process.exit(1);
|
|
1260
1260
|
}
|
|
1261
1261
|
console.log(chalk11.cyan("\nWill initialize configuration for:"));
|
|
1262
|
-
for (const
|
|
1263
|
-
const path =
|
|
1264
|
-
console.log(` - ${
|
|
1262
|
+
for (const agent of agents) {
|
|
1263
|
+
const path = getAgentPath(agent, "project");
|
|
1264
|
+
console.log(` - ${CODING_AGENTS[agent].name} \u2192 ${path}`);
|
|
1265
1265
|
}
|
|
1266
1266
|
console.log("");
|
|
1267
1267
|
if (!options.yes) {
|
|
@@ -1271,12 +1271,12 @@ var initCommand = new Command4("init").description("Initialize AI tool configura
|
|
|
1271
1271
|
process.exit(0);
|
|
1272
1272
|
}
|
|
1273
1273
|
}
|
|
1274
|
-
for (const
|
|
1275
|
-
const spinner = ora7(`Initializing ${
|
|
1276
|
-
const path =
|
|
1274
|
+
for (const agent of agents) {
|
|
1275
|
+
const spinner = ora7(`Initializing ${CODING_AGENTS[agent].name}...`).start();
|
|
1276
|
+
const path = getAgentPath(agent, "project");
|
|
1277
1277
|
if (await exists(path)) {
|
|
1278
1278
|
spinner.info(
|
|
1279
|
-
chalk11.gray(`${
|
|
1279
|
+
chalk11.gray(`${CODING_AGENTS[agent].name} already initialized`)
|
|
1280
1280
|
);
|
|
1281
1281
|
continue;
|
|
1282
1282
|
}
|
|
@@ -1284,19 +1284,19 @@ var initCommand = new Command4("init").description("Initialize AI tool configura
|
|
|
1284
1284
|
const readmePath = join4(path, "README.md");
|
|
1285
1285
|
await writeTextFile(
|
|
1286
1286
|
readmePath,
|
|
1287
|
-
`# ${
|
|
1287
|
+
`# ${CODING_AGENTS[agent].name} Configuration
|
|
1288
1288
|
|
|
1289
|
-
This directory contains AI configuration files for ${
|
|
1289
|
+
This directory contains AI configuration files for ${CODING_AGENTS[agent].name}.
|
|
1290
1290
|
|
|
1291
1291
|
Add skills with:
|
|
1292
1292
|
\`\`\`bash
|
|
1293
|
-
npx @toolr/seedr add <skill-name> --agents ${
|
|
1293
|
+
npx @toolr/seedr add <skill-name> --agents ${agent}
|
|
1294
1294
|
\`\`\`
|
|
1295
1295
|
|
|
1296
1296
|
Browse available skills at https://seedr.toolr.dev
|
|
1297
1297
|
`
|
|
1298
1298
|
);
|
|
1299
|
-
spinner.succeed(chalk11.green(`Initialized ${
|
|
1299
|
+
spinner.succeed(chalk11.green(`Initialized ${CODING_AGENTS[agent].name}`));
|
|
1300
1300
|
}
|
|
1301
1301
|
console.log("");
|
|
1302
1302
|
console.log(
|
package/dist/index.d.ts
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import { ComponentType,
|
|
2
|
-
export {
|
|
1
|
+
import { ComponentType, CodingAgent, RegistryItem, RegistryManifest } from '@seedr/shared';
|
|
2
|
+
export { CodingAgent, ComponentType, RegistryItem, RegistryManifest } from '@seedr/shared';
|
|
3
3
|
|
|
4
4
|
type InstallScope = "project" | "user" | "local";
|
|
5
5
|
type InstallMethod = "symlink" | "copy";
|
|
6
6
|
type ContentStructure = "directory" | "file" | "json-merge" | "plugin";
|
|
7
7
|
interface ContentTypeConfig {
|
|
8
|
-
/** Relative path from
|
|
8
|
+
/** Relative path from agent root (e.g., "skills", "agents") */
|
|
9
9
|
path: string;
|
|
10
10
|
/** File extension (e.g., ".md") */
|
|
11
11
|
extension: string;
|
|
@@ -18,7 +18,7 @@ interface ContentTypeConfig {
|
|
|
18
18
|
/** For json-merge: field to merge into (e.g., "hooks", "mcpServers") */
|
|
19
19
|
mergeField?: string;
|
|
20
20
|
}
|
|
21
|
-
interface
|
|
21
|
+
interface CodingAgentConfig {
|
|
22
22
|
/** Display name (e.g., "Claude Code") */
|
|
23
23
|
name: string;
|
|
24
24
|
/** Short identifier (e.g., "claude") */
|
|
@@ -41,17 +41,17 @@ interface InstallOptions {
|
|
|
41
41
|
interface InstalledItem {
|
|
42
42
|
slug: string;
|
|
43
43
|
type: string;
|
|
44
|
-
|
|
44
|
+
agent: string;
|
|
45
45
|
scope: InstallScope;
|
|
46
46
|
method: InstallMethod;
|
|
47
47
|
path: string;
|
|
48
48
|
installedAt: string;
|
|
49
49
|
}
|
|
50
50
|
|
|
51
|
-
declare const
|
|
52
|
-
declare const
|
|
53
|
-
declare function
|
|
54
|
-
declare function
|
|
51
|
+
declare const CODING_AGENTS: Record<CodingAgent, CodingAgentConfig>;
|
|
52
|
+
declare const ALL_AGENTS: CodingAgent[];
|
|
53
|
+
declare function getAgentConfig(agent: CodingAgent): CodingAgentConfig;
|
|
54
|
+
declare function getAgentPath(agent: CodingAgent, scope: "project" | "user", cwd?: string): string;
|
|
55
55
|
|
|
56
56
|
declare function loadManifest(): Promise<RegistryManifest>;
|
|
57
57
|
declare function getItem(slug: string, type?: ComponentType): Promise<RegistryItem | undefined>;
|
|
@@ -63,15 +63,15 @@ declare function searchItems(query: string): Promise<RegistryItem[]>;
|
|
|
63
63
|
declare function getItemContent(item: RegistryItem): Promise<string>;
|
|
64
64
|
|
|
65
65
|
interface InstallResult {
|
|
66
|
-
|
|
66
|
+
agent: CodingAgent;
|
|
67
67
|
success: boolean;
|
|
68
68
|
path: string;
|
|
69
69
|
error?: string;
|
|
70
70
|
}
|
|
71
71
|
|
|
72
|
-
declare function installSkill(item: RegistryItem,
|
|
73
|
-
declare function uninstallSkill(slug: string,
|
|
74
|
-
declare function getInstalledSkills(
|
|
72
|
+
declare function installSkill(item: RegistryItem, agents: CodingAgent[], scope: InstallScope, method: InstallMethod, cwd?: string): Promise<InstallResult[]>;
|
|
73
|
+
declare function uninstallSkill(slug: string, agent: CodingAgent, scope: InstallScope, cwd?: string): Promise<boolean>;
|
|
74
|
+
declare function getInstalledSkills(agent: CodingAgent, scope: InstallScope, cwd?: string): Promise<string[]>;
|
|
75
75
|
|
|
76
76
|
/**
|
|
77
77
|
* Strategy pattern interfaces for skill conversion.
|
|
@@ -114,15 +114,15 @@ declare function parseSkillMarkdown(content: string): ParsedSkill;
|
|
|
114
114
|
* @param targetTool - The AI tool to convert for
|
|
115
115
|
* @returns Converted content string
|
|
116
116
|
*/
|
|
117
|
-
declare function convertSkillToTool(content: string, targetTool:
|
|
117
|
+
declare function convertSkillToTool(content: string, targetTool: CodingAgent): string;
|
|
118
118
|
|
|
119
|
-
interface
|
|
120
|
-
|
|
119
|
+
interface DetectedAgent {
|
|
120
|
+
agent: CodingAgent;
|
|
121
121
|
scope: InstallScope;
|
|
122
122
|
path: string;
|
|
123
123
|
}
|
|
124
|
-
declare function
|
|
125
|
-
declare function
|
|
126
|
-
declare function
|
|
124
|
+
declare function detectInstalledAgents(cwd?: string): Promise<DetectedAgent[]>;
|
|
125
|
+
declare function detectProjectAgents(cwd?: string): Promise<CodingAgent[]>;
|
|
126
|
+
declare function isAgentInstalled(agent: CodingAgent, scope: InstallScope, cwd?: string): Promise<boolean>;
|
|
127
127
|
|
|
128
|
-
export {
|
|
128
|
+
export { ALL_AGENTS, CODING_AGENTS, type CodingAgentConfig, type InstallMethod, type InstallOptions, type InstallScope, type InstalledItem, convertSkillToTool, detectInstalledAgents, detectProjectAgents, getAgentConfig, getAgentPath, getInstalledSkills, getItem, getItemContent, installSkill, isAgentInstalled, listItems, loadManifest, parseSkillMarkdown, searchItems, uninstallSkill };
|
package/dist/index.js
CHANGED
|
@@ -1,21 +1,21 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
3
|
+
ALL_AGENTS,
|
|
4
|
+
CODING_AGENTS,
|
|
5
|
+
detectInstalledAgents,
|
|
6
|
+
detectProjectAgents,
|
|
7
|
+
getAgentConfig,
|
|
8
|
+
getAgentPath,
|
|
7
9
|
getInstalledSkills,
|
|
8
10
|
getItem,
|
|
9
11
|
getItemContent,
|
|
10
|
-
getToolConfig,
|
|
11
|
-
getToolPath,
|
|
12
12
|
installSkill,
|
|
13
|
-
|
|
13
|
+
isAgentInstalled,
|
|
14
14
|
listItems,
|
|
15
15
|
loadManifest,
|
|
16
16
|
searchItems,
|
|
17
17
|
uninstallSkill
|
|
18
|
-
} from "./chunk-
|
|
18
|
+
} from "./chunk-TWSBWCGS.js";
|
|
19
19
|
|
|
20
20
|
// src/converters/index.ts
|
|
21
21
|
import matter from "gray-matter";
|
|
@@ -120,18 +120,18 @@ function convertSkillToTool(content, targetTool) {
|
|
|
120
120
|
return converter.convert(skill);
|
|
121
121
|
}
|
|
122
122
|
export {
|
|
123
|
-
|
|
124
|
-
|
|
123
|
+
ALL_AGENTS,
|
|
124
|
+
CODING_AGENTS,
|
|
125
125
|
convertSkillToTool,
|
|
126
|
-
|
|
127
|
-
|
|
126
|
+
detectInstalledAgents,
|
|
127
|
+
detectProjectAgents,
|
|
128
|
+
getAgentConfig,
|
|
129
|
+
getAgentPath,
|
|
128
130
|
getInstalledSkills,
|
|
129
131
|
getItem,
|
|
130
132
|
getItemContent,
|
|
131
|
-
getToolConfig,
|
|
132
|
-
getToolPath,
|
|
133
133
|
installSkill,
|
|
134
|
-
|
|
134
|
+
isAgentInstalled,
|
|
135
135
|
listItems,
|
|
136
136
|
loadManifest,
|
|
137
137
|
parseSkillMarkdown,
|