@agents-inc/cli 0.85.0 → 0.87.0
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/CHANGELOG.md +20 -0
- package/dist/{chunk-6VGBO6SZ.js → chunk-5M6Q5UQO.js} +2 -2
- package/dist/chunk-5UJJQFET.js +564 -0
- package/dist/chunk-5UJJQFET.js.map +1 -0
- package/dist/{chunk-TXW257CU.js → chunk-7FFNNDJQ.js} +181 -202
- package/dist/chunk-7FFNNDJQ.js.map +1 -0
- package/dist/{chunk-YJ2URWF7.js → chunk-B6MYECV6.js} +2 -2
- package/dist/{chunk-G2MINRWX.js → chunk-C5IYJ42F.js} +2 -2
- package/dist/{chunk-7UZUDHP7.js → chunk-CXWBVBDM.js} +2 -2
- package/dist/{chunk-CYPCJ536.js → chunk-FBZR46GC.js} +92 -92
- package/dist/chunk-FBZR46GC.js.map +1 -0
- package/dist/{chunk-LTFGEVTM.js → chunk-HH3AWXF4.js} +3 -3
- package/dist/{chunk-2XVLQDNI.js → chunk-HSLVCKVQ.js} +3 -3
- package/dist/{chunk-TAQGYJIS.js → chunk-HZ2IBXVQ.js} +3 -3
- package/dist/{chunk-LN76TJJP.js → chunk-HZQOFFKA.js} +10 -10
- package/dist/{chunk-W7LHI54P.js → chunk-I44YG6VI.js} +2 -2
- package/dist/{chunk-FT46LN7K.js → chunk-I5AZKNNL.js} +7 -8
- package/dist/chunk-I5AZKNNL.js.map +1 -0
- package/dist/chunk-J6PI73YV.js +68 -0
- package/dist/chunk-J6PI73YV.js.map +1 -0
- package/dist/{chunk-L7COG2EX.js → chunk-LZ7XQ3IU.js} +2 -2
- package/dist/{chunk-LMR7VAP3.js → chunk-MMTMXLI4.js} +2 -2
- package/dist/chunk-N6A7A4RA.js +16 -0
- package/dist/chunk-N6A7A4RA.js.map +1 -0
- package/dist/{chunk-WJKD6EGK.js → chunk-NUU3U43A.js} +5 -6
- package/dist/chunk-NUU3U43A.js.map +1 -0
- package/dist/{chunk-YYIWB42G.js → chunk-Q4DMIPZB.js} +2 -2
- package/dist/{chunk-YSLDMYWP.js → chunk-SGZOFIFF.js} +2 -2
- package/dist/{chunk-FKXD3EXJ.js → chunk-TMTUTUEV.js} +42 -228
- package/dist/chunk-TMTUTUEV.js.map +1 -0
- package/dist/{chunk-WCCWQ56J.js → chunk-UNEJKTLP.js} +3 -3
- package/dist/{chunk-ZGD7PLLC.js → chunk-ZOWRO7UQ.js} +3 -3
- package/dist/commands/build/marketplace.js +3 -3
- package/dist/commands/build/plugins.js +5 -5
- package/dist/commands/build/stack.js +5 -5
- package/dist/commands/compile.js +77 -171
- package/dist/commands/compile.js.map +1 -1
- package/dist/commands/config/index.js +5 -5
- package/dist/commands/config/path.js +4 -4
- package/dist/commands/config/show.js +5 -5
- package/dist/commands/diff.js +161 -167
- package/dist/commands/diff.js.map +1 -1
- package/dist/commands/doctor.js +68 -83
- package/dist/commands/doctor.js.map +1 -1
- package/dist/commands/edit.js +275 -209
- package/dist/commands/edit.js.map +1 -1
- package/dist/commands/eject.js +206 -124
- package/dist/commands/eject.js.map +1 -1
- package/dist/commands/import/skill.js +175 -144
- package/dist/commands/import/skill.js.map +1 -1
- package/dist/commands/info.js +58 -102
- package/dist/commands/info.js.map +1 -1
- package/dist/commands/init.js +19 -16
- package/dist/commands/list.js +4 -4
- package/dist/commands/new/agent.js +124 -102
- package/dist/commands/new/agent.js.map +1 -1
- package/dist/commands/new/marketplace.js +6 -6
- package/dist/commands/new/marketplace.js.map +1 -1
- package/dist/commands/new/skill.js +328 -15
- package/dist/commands/new/skill.js.map +1 -1
- package/dist/commands/outdated.js +16 -24
- package/dist/commands/outdated.js.map +1 -1
- package/dist/commands/search.js +166 -132
- package/dist/commands/search.js.map +1 -1
- package/dist/commands/uninstall.js +269 -189
- package/dist/commands/uninstall.js.map +1 -1
- package/dist/commands/update.js +238 -219
- package/dist/commands/update.js.map +1 -1
- package/dist/commands/validate.js +4 -4
- package/dist/components/skill-search/skill-search.js +2 -1
- package/dist/components/wizard/category-grid.test.js +4 -4
- package/dist/components/wizard/domain-selection.js +5 -5
- package/dist/components/wizard/help-modal.js +5 -5
- package/dist/components/wizard/source-grid.test.js +4 -4
- package/dist/components/wizard/stack-selection.js +5 -5
- package/dist/components/wizard/step-agents.js +5 -5
- package/dist/components/wizard/step-agents.test.js +5 -5
- package/dist/components/wizard/step-build.js +5 -5
- package/dist/components/wizard/step-build.test.js +5 -5
- package/dist/components/wizard/step-confirm.test.js +4 -4
- package/dist/components/wizard/step-settings.js +4 -4
- package/dist/components/wizard/step-settings.test.js +7 -7
- package/dist/components/wizard/step-sources.js +5 -5
- package/dist/components/wizard/step-sources.test.js +5 -5
- package/dist/components/wizard/step-stack.js +6 -6
- package/dist/components/wizard/step-stack.test.js +6 -6
- package/dist/components/wizard/wizard-layout.js +6 -6
- package/dist/components/wizard/wizard.js +14 -14
- package/dist/hooks/init.js +19 -16
- package/dist/hooks/init.js.map +1 -1
- package/dist/{loader-GT2A7R7U.js → loader-GSEGPK64.js} +3 -3
- package/dist/{source-loader-TNQW4P47.js → source-loader-OGFTIRIX.js} +4 -4
- package/dist/{source-manager-INRXRFJE.js → source-manager-FMMDDVZA.js} +4 -4
- package/dist/stores/wizard-store.js +4 -4
- package/dist/stores/wizard-store.test.js +4 -4
- package/package.json +1 -1
- package/dist/chunk-AABH2HSE.js +0 -340
- package/dist/chunk-AABH2HSE.js.map +0 -1
- package/dist/chunk-CYPCJ536.js.map +0 -1
- package/dist/chunk-FKXD3EXJ.js.map +0 -1
- package/dist/chunk-FT46LN7K.js.map +0 -1
- package/dist/chunk-TXW257CU.js.map +0 -1
- package/dist/chunk-WJKD6EGK.js.map +0 -1
- /package/dist/{chunk-6VGBO6SZ.js.map → chunk-5M6Q5UQO.js.map} +0 -0
- /package/dist/{chunk-YJ2URWF7.js.map → chunk-B6MYECV6.js.map} +0 -0
- /package/dist/{chunk-G2MINRWX.js.map → chunk-C5IYJ42F.js.map} +0 -0
- /package/dist/{chunk-7UZUDHP7.js.map → chunk-CXWBVBDM.js.map} +0 -0
- /package/dist/{chunk-LTFGEVTM.js.map → chunk-HH3AWXF4.js.map} +0 -0
- /package/dist/{chunk-2XVLQDNI.js.map → chunk-HSLVCKVQ.js.map} +0 -0
- /package/dist/{chunk-TAQGYJIS.js.map → chunk-HZ2IBXVQ.js.map} +0 -0
- /package/dist/{chunk-LN76TJJP.js.map → chunk-HZQOFFKA.js.map} +0 -0
- /package/dist/{chunk-W7LHI54P.js.map → chunk-I44YG6VI.js.map} +0 -0
- /package/dist/{chunk-L7COG2EX.js.map → chunk-LZ7XQ3IU.js.map} +0 -0
- /package/dist/{chunk-LMR7VAP3.js.map → chunk-MMTMXLI4.js.map} +0 -0
- /package/dist/{chunk-YYIWB42G.js.map → chunk-Q4DMIPZB.js.map} +0 -0
- /package/dist/{chunk-YSLDMYWP.js.map → chunk-SGZOFIFF.js.map} +0 -0
- /package/dist/{chunk-WCCWQ56J.js.map → chunk-UNEJKTLP.js.map} +0 -0
- /package/dist/{chunk-ZGD7PLLC.js.map → chunk-ZOWRO7UQ.js.map} +0 -0
- /package/dist/{loader-GT2A7R7U.js.map → loader-GSEGPK64.js.map} +0 -0
- /package/dist/{source-loader-TNQW4P47.js.map → source-loader-OGFTIRIX.js.map} +0 -0
- /package/dist/{source-manager-INRXRFJE.js.map → source-manager-FMMDDVZA.js.map} +0 -0
package/dist/commands/info.js
CHANGED
|
@@ -3,25 +3,24 @@ import {
|
|
|
3
3
|
STATUS_MESSAGES
|
|
4
4
|
} from "../chunk-B7KZLXHV.js";
|
|
5
5
|
import {
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
} from "../chunk-
|
|
9
|
-
import "../chunk-
|
|
6
|
+
loadSource,
|
|
7
|
+
resolveSkillInfo
|
|
8
|
+
} from "../chunk-5UJJQFET.js";
|
|
9
|
+
import "../chunk-N6A7A4RA.js";
|
|
10
|
+
import "../chunk-FBZR46GC.js";
|
|
11
|
+
import "../chunk-TMTUTUEV.js";
|
|
12
|
+
import "../chunk-B6MYECV6.js";
|
|
10
13
|
import {
|
|
11
14
|
matrix
|
|
12
15
|
} from "../chunk-ANXHMG32.js";
|
|
13
16
|
import {
|
|
14
17
|
BaseCommand,
|
|
15
18
|
EXIT_CODES
|
|
16
|
-
} from "../chunk-
|
|
17
|
-
import
|
|
18
|
-
fileExists,
|
|
19
|
-
readFile
|
|
20
|
-
} from "../chunk-WJKD6EGK.js";
|
|
19
|
+
} from "../chunk-MMTMXLI4.js";
|
|
20
|
+
import "../chunk-NUU3U43A.js";
|
|
21
21
|
import "../chunk-6XWHJHNZ.js";
|
|
22
22
|
import {
|
|
23
|
-
CLI_BIN_NAME
|
|
24
|
-
STANDARD_FILES
|
|
23
|
+
CLI_BIN_NAME
|
|
25
24
|
} from "../chunk-6PGL2XMY.js";
|
|
26
25
|
import "../chunk-NPMMU4GY.js";
|
|
27
26
|
import {
|
|
@@ -31,40 +30,7 @@ import {
|
|
|
31
30
|
// src/cli/commands/info.ts
|
|
32
31
|
init_esm_shims();
|
|
33
32
|
import { Args, Flags } from "@oclif/core";
|
|
34
|
-
import path from "path";
|
|
35
33
|
var CONTENT_PREVIEW_LINES = 10;
|
|
36
|
-
var MAX_LINE_LENGTH = 80;
|
|
37
|
-
var MAX_SUGGESTIONS = 5;
|
|
38
|
-
function stripFrontmatter(content) {
|
|
39
|
-
const lines = content.split("\n");
|
|
40
|
-
let inFrontmatter = false;
|
|
41
|
-
let frontmatterEndIndex = 0;
|
|
42
|
-
for (let i = 0; i < lines.length; i++) {
|
|
43
|
-
const line = lines[i].trim();
|
|
44
|
-
if (line === "---") {
|
|
45
|
-
if (!inFrontmatter) {
|
|
46
|
-
inFrontmatter = true;
|
|
47
|
-
} else {
|
|
48
|
-
frontmatterEndIndex = i + 1;
|
|
49
|
-
break;
|
|
50
|
-
}
|
|
51
|
-
}
|
|
52
|
-
}
|
|
53
|
-
return lines.slice(frontmatterEndIndex).join("\n");
|
|
54
|
-
}
|
|
55
|
-
function getPreviewLines(content, maxLines) {
|
|
56
|
-
const body = stripFrontmatter(content);
|
|
57
|
-
const lines = body.split("\n");
|
|
58
|
-
const result = [];
|
|
59
|
-
for (const line of lines) {
|
|
60
|
-
if (result.length >= maxLines) break;
|
|
61
|
-
if (line.trim() || result.length > 0) {
|
|
62
|
-
const truncated = line.length > MAX_LINE_LENGTH ? `${line.slice(0, MAX_LINE_LENGTH - 3)}...` : line;
|
|
63
|
-
result.push(truncated);
|
|
64
|
-
}
|
|
65
|
-
}
|
|
66
|
-
return result;
|
|
67
|
-
}
|
|
68
34
|
function formatRequirements(requirements) {
|
|
69
35
|
if (requirements.length === 0) {
|
|
70
36
|
return "(none)";
|
|
@@ -74,18 +40,6 @@ function formatRequirements(requirements) {
|
|
|
74
40
|
return prefix + req.skillIds.join(", ");
|
|
75
41
|
}).join("; ");
|
|
76
42
|
}
|
|
77
|
-
function findSuggestions(skills, query, maxSuggestions) {
|
|
78
|
-
const lowerQuery = query.toLowerCase();
|
|
79
|
-
const matches = [];
|
|
80
|
-
for (const skill of Object.values(skills)) {
|
|
81
|
-
if (!skill) continue;
|
|
82
|
-
if (matches.length >= maxSuggestions) break;
|
|
83
|
-
if (skill.id.toLowerCase().includes(lowerQuery) || skill.displayName.toLowerCase().includes(lowerQuery) || skill.slug.toLowerCase().includes(lowerQuery)) {
|
|
84
|
-
matches.push(skill.id);
|
|
85
|
-
}
|
|
86
|
-
}
|
|
87
|
-
return matches;
|
|
88
|
-
}
|
|
89
43
|
function formatSkillInfo(skill, isInstalled) {
|
|
90
44
|
const lines = [];
|
|
91
45
|
lines.push(`Skill: ${skill.id}`);
|
|
@@ -148,59 +102,61 @@ var Info = class _Info extends BaseCommand {
|
|
|
148
102
|
};
|
|
149
103
|
async run() {
|
|
150
104
|
const { args, flags } = await this.parse(_Info);
|
|
105
|
+
const projectDir = process.cwd();
|
|
151
106
|
try {
|
|
152
|
-
this.
|
|
153
|
-
const
|
|
154
|
-
|
|
107
|
+
const { sourcePath, isLocal } = await this.loadSourceAndLog(flags.source, projectDir);
|
|
108
|
+
const result = await resolveSkillInfo({
|
|
109
|
+
query: args.skill,
|
|
110
|
+
skills: matrix.skills,
|
|
111
|
+
slugToId: matrix.slugMap.slugToId,
|
|
112
|
+
projectDir,
|
|
113
|
+
sourcePath,
|
|
114
|
+
isLocal,
|
|
115
|
+
includePreview: flags.preview
|
|
155
116
|
});
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
if (!skill) {
|
|
160
|
-
const suggestions = findSuggestions(matrix.skills, args.skill, MAX_SUGGESTIONS);
|
|
161
|
-
this.log("");
|
|
162
|
-
this.error(`Skill "${args.skill}" not found.`, { exit: false });
|
|
163
|
-
if (suggestions.length > 0) {
|
|
164
|
-
this.log("");
|
|
165
|
-
this.log("Did you mean one of these?");
|
|
166
|
-
for (const suggestion of suggestions) {
|
|
167
|
-
this.log(` - ${suggestion}`);
|
|
168
|
-
}
|
|
169
|
-
}
|
|
170
|
-
this.log("");
|
|
171
|
-
this.logInfo(`Use '${CLI_BIN_NAME} search <query>' to find available skills.`);
|
|
172
|
-
this.log("");
|
|
173
|
-
this.exit(EXIT_CODES.ERROR);
|
|
117
|
+
if (!result.resolved) {
|
|
118
|
+
this.reportNotFound(args.skill, result.suggestions);
|
|
119
|
+
return;
|
|
174
120
|
}
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
121
|
+
this.displaySkillInfo(result.resolved, flags.preview);
|
|
122
|
+
} catch (error) {
|
|
123
|
+
this.handleError(error);
|
|
124
|
+
}
|
|
125
|
+
}
|
|
126
|
+
async loadSourceAndLog(sourceFlag, projectDir) {
|
|
127
|
+
this.log(STATUS_MESSAGES.LOADING_SKILLS);
|
|
128
|
+
const { sourceResult } = await loadSource({ sourceFlag, projectDir });
|
|
129
|
+
const { sourcePath, isLocal } = sourceResult;
|
|
130
|
+
this.log(`Loaded from ${isLocal ? "local" : "remote"}: ${sourcePath}`);
|
|
131
|
+
return { sourcePath, isLocal };
|
|
132
|
+
}
|
|
133
|
+
reportNotFound(query, suggestions) {
|
|
134
|
+
this.log("");
|
|
135
|
+
this.error(`Skill "${query}" not found.`, { exit: false });
|
|
136
|
+
if (suggestions.length > 0) {
|
|
178
137
|
this.log("");
|
|
179
|
-
this.log(
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
if (skill.local && skill.localPath) {
|
|
183
|
-
skillMdPath = path.join(process.cwd(), skill.localPath, STANDARD_FILES.SKILL_MD);
|
|
184
|
-
} else {
|
|
185
|
-
const sourceDir = isLocal ? sourcePath : path.dirname(sourcePath);
|
|
186
|
-
skillMdPath = path.join(sourceDir, skill.path, STANDARD_FILES.SKILL_MD);
|
|
187
|
-
}
|
|
188
|
-
if (await fileExists(skillMdPath)) {
|
|
189
|
-
const content = await readFile(skillMdPath);
|
|
190
|
-
const previewLines = getPreviewLines(content, CONTENT_PREVIEW_LINES);
|
|
191
|
-
if (previewLines.length > 0) {
|
|
192
|
-
this.log("");
|
|
193
|
-
this.log(`--- Content Preview (first ${CONTENT_PREVIEW_LINES} lines) ---`);
|
|
194
|
-
for (const line of previewLines) {
|
|
195
|
-
this.log(line);
|
|
196
|
-
}
|
|
197
|
-
}
|
|
198
|
-
}
|
|
138
|
+
this.log("Did you mean one of these?");
|
|
139
|
+
for (const suggestion of suggestions) {
|
|
140
|
+
this.log(` - ${suggestion}`);
|
|
199
141
|
}
|
|
142
|
+
}
|
|
143
|
+
this.log("");
|
|
144
|
+
this.logInfo(`Use '${CLI_BIN_NAME} search <query>' to find available skills.`);
|
|
145
|
+
this.log("");
|
|
146
|
+
this.exit(EXIT_CODES.ERROR);
|
|
147
|
+
}
|
|
148
|
+
displaySkillInfo(resolved, showPreview) {
|
|
149
|
+
const { skill, isInstalled, preview } = resolved;
|
|
150
|
+
this.log("");
|
|
151
|
+
this.log(formatSkillInfo(skill, isInstalled));
|
|
152
|
+
if (showPreview && preview.length > 0) {
|
|
200
153
|
this.log("");
|
|
201
|
-
|
|
202
|
-
|
|
154
|
+
this.log(`--- Content Preview (first ${CONTENT_PREVIEW_LINES} lines) ---`);
|
|
155
|
+
for (const line of preview) {
|
|
156
|
+
this.log(line);
|
|
157
|
+
}
|
|
203
158
|
}
|
|
159
|
+
this.log("");
|
|
204
160
|
}
|
|
205
161
|
};
|
|
206
162
|
export {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/cli/commands/info.ts"],"sourcesContent":["import { Args, Flags } from \"@oclif/core\";\nimport path from \"path\";\nimport { BaseCommand } from \"../base-command.js\";\nimport { loadSkillsMatrixFromSource } from \"../lib/loading/index.js\";\nimport { matrix } from \"../lib/matrix/matrix-provider\";\nimport { discoverLocalSkills } from \"../lib/skills/index.js\";\nimport { fileExists, readFile } from \"../utils/fs.js\";\nimport { CLI_BIN_NAME, STANDARD_FILES } from \"../consts.js\";\nimport { EXIT_CODES } from \"../lib/exit-codes.js\";\nimport { STATUS_MESSAGES } from \"../utils/messages.js\";\nimport type { ResolvedSkill, SkillId, SkillSlug, SkillRequirement } from \"../types/index.js\";\n\nconst CONTENT_PREVIEW_LINES = 10;\nconst MAX_LINE_LENGTH = 80;\nconst MAX_SUGGESTIONS = 5;\n\nfunction stripFrontmatter(content: string): string {\n const lines = content.split(\"\\n\");\n let inFrontmatter = false;\n let frontmatterEndIndex = 0;\n\n for (let i = 0; i < lines.length; i++) {\n const line = lines[i].trim();\n if (line === \"---\") {\n if (!inFrontmatter) {\n inFrontmatter = true;\n } else {\n frontmatterEndIndex = i + 1;\n break;\n }\n }\n }\n\n return lines.slice(frontmatterEndIndex).join(\"\\n\");\n}\n\nfunction getPreviewLines(content: string, maxLines: number): string[] {\n const body = stripFrontmatter(content);\n const lines = body.split(\"\\n\");\n const result: string[] = [];\n\n for (const line of lines) {\n if (result.length >= maxLines) break;\n if (line.trim() || result.length > 0) {\n const truncated =\n line.length > MAX_LINE_LENGTH ? `${line.slice(0, MAX_LINE_LENGTH - 3)}...` : line;\n result.push(truncated);\n }\n }\n\n return result;\n}\n\nfunction formatRequirements(requirements: SkillRequirement[]): string {\n if (requirements.length === 0) {\n return \"(none)\";\n }\n return requirements\n .map((req) => {\n const prefix = req.needsAny ? \"any of: \" : \"\";\n return prefix + req.skillIds.join(\", \");\n })\n .join(\"; \");\n}\n\nfunction findSuggestions(\n skills: Partial<Record<SkillId, ResolvedSkill>>,\n query: string,\n maxSuggestions: number,\n): string[] {\n const lowerQuery = query.toLowerCase();\n const matches: string[] = [];\n\n for (const skill of Object.values(skills)) {\n if (!skill) continue;\n if (matches.length >= maxSuggestions) break;\n if (\n skill.id.toLowerCase().includes(lowerQuery) ||\n skill.displayName.toLowerCase().includes(lowerQuery) ||\n skill.slug.toLowerCase().includes(lowerQuery)\n ) {\n matches.push(skill.id);\n }\n }\n\n return matches;\n}\n\nfunction formatSkillInfo(skill: ResolvedSkill, isInstalled: boolean): string {\n const lines: string[] = [];\n\n lines.push(`Skill: ${skill.id}`);\n if (skill.slug) {\n lines.push(`Slug: ${skill.slug}`);\n }\n lines.push(`Display Name: ${skill.displayName}`);\n lines.push(`Author: ${skill.author}`);\n lines.push(`Category: ${skill.category}`);\n lines.push(\"\");\n lines.push(\"Description:\");\n lines.push(` ${skill.description}`);\n lines.push(\"\");\n lines.push(`Requires: ${formatRequirements(skill.requires)}`);\n lines.push(\n `Conflicts with: ${skill.conflictsWith.length > 0 ? skill.conflictsWith.map((r) => r.skillId).join(\", \") : \"(none)\"}`,\n );\n lines.push(\n `Recommended: ${skill.isRecommended ? `Yes${skill.recommendedReason ? ` — ${skill.recommendedReason}` : \"\"}` : \"No\"}`,\n );\n\n if (skill.usageGuidance) {\n lines.push(\"\");\n lines.push(\"Usage Guidance:\");\n lines.push(` ${skill.usageGuidance}`);\n }\n\n lines.push(\"\");\n lines.push(`Local Status: ${isInstalled ? \"Installed\" : \"Not installed\"}`);\n\n return lines.join(\"\\n\");\n}\n\nexport default class Info extends BaseCommand {\n static summary = \"Show detailed information about a skill\";\n static description =\n \"Display comprehensive information about a skill including metadata, relationships, and content preview\";\n\n static examples = [\n {\n description: \"Show info for a skill by ID\",\n command: \"<%= config.bin %> <%= command.id %> web-framework-react\",\n },\n {\n description: \"Show info without content preview\",\n command: \"<%= config.bin %> <%= command.id %> web-framework-react --no-preview\",\n },\n {\n description: \"Show info from a custom source\",\n command: \"<%= config.bin %> <%= command.id %> my-skill --source github:org/marketplace\",\n },\n ];\n\n static args = {\n skill: Args.string({\n description: \"Skill ID or alias to look up\",\n required: true,\n }),\n };\n\n static flags = {\n ...BaseCommand.baseFlags,\n preview: Flags.boolean({\n description: \"Show content preview from SKILL.md\",\n default: true,\n allowNo: true,\n }),\n };\n\n async run(): Promise<void> {\n const { args, flags } = await this.parse(Info);\n\n try {\n this.log(STATUS_MESSAGES.LOADING_SKILLS);\n\n const { sourcePath, isLocal } = await loadSkillsMatrixFromSource({\n sourceFlag: flags.source,\n });\n\n this.log(`Loaded from ${isLocal ? \"local\" : \"remote\"}: ${sourcePath}`);\n\n // CLI arg is an untyped string — try as skill ID first, then as slug\n const slugResolvedId = matrix.slugMap.slugToId[args.skill as SkillSlug];\n let skill =\n matrix.skills[args.skill as SkillId] ??\n (slugResolvedId ? matrix.skills[slugResolvedId] : undefined);\n\n if (!skill) {\n const suggestions = findSuggestions(matrix.skills, args.skill, MAX_SUGGESTIONS);\n\n this.log(\"\");\n this.error(`Skill \"${args.skill}\" not found.`, { exit: false });\n\n if (suggestions.length > 0) {\n this.log(\"\");\n this.log(\"Did you mean one of these?\");\n for (const suggestion of suggestions) {\n this.log(` - ${suggestion}`);\n }\n }\n\n this.log(\"\");\n this.logInfo(`Use '${CLI_BIN_NAME} search <query>' to find available skills.`);\n this.log(\"\");\n this.exit(EXIT_CODES.ERROR);\n }\n\n const localSkillsResult = await discoverLocalSkills(process.cwd());\n const localSkillIds = localSkillsResult?.skills.map((s) => s.id) || [];\n const isInstalled = localSkillIds.includes(skill.id);\n\n this.log(\"\");\n this.log(formatSkillInfo(skill, isInstalled));\n\n if (flags.preview) {\n let skillMdPath: string;\n\n if (skill.local && skill.localPath) {\n skillMdPath = path.join(process.cwd(), skill.localPath, STANDARD_FILES.SKILL_MD);\n } else {\n const sourceDir = isLocal ? sourcePath : path.dirname(sourcePath);\n skillMdPath = path.join(sourceDir, skill.path, STANDARD_FILES.SKILL_MD);\n }\n\n if (await fileExists(skillMdPath)) {\n const content = await readFile(skillMdPath);\n const previewLines = getPreviewLines(content, CONTENT_PREVIEW_LINES);\n\n if (previewLines.length > 0) {\n this.log(\"\");\n this.log(`--- Content Preview (first ${CONTENT_PREVIEW_LINES} lines) ---`);\n for (const line of previewLines) {\n this.log(line);\n }\n }\n }\n }\n\n this.log(\"\");\n } catch (error) {\n this.handleError(error);\n }\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA,SAAS,MAAM,aAAa;AAC5B,OAAO,UAAU;AAWjB,IAAM,wBAAwB;AAC9B,IAAM,kBAAkB;AACxB,IAAM,kBAAkB;AAExB,SAAS,iBAAiB,SAAyB;AACjD,QAAM,QAAQ,QAAQ,MAAM,IAAI;AAChC,MAAI,gBAAgB;AACpB,MAAI,sBAAsB;AAE1B,WAAS,IAAI,GAAG,IAAI,MAAM,QAAQ,KAAK;AACrC,UAAM,OAAO,MAAM,CAAC,EAAE,KAAK;AAC3B,QAAI,SAAS,OAAO;AAClB,UAAI,CAAC,eAAe;AAClB,wBAAgB;AAAA,MAClB,OAAO;AACL,8BAAsB,IAAI;AAC1B;AAAA,MACF;AAAA,IACF;AAAA,EACF;AAEA,SAAO,MAAM,MAAM,mBAAmB,EAAE,KAAK,IAAI;AACnD;AAEA,SAAS,gBAAgB,SAAiB,UAA4B;AACpE,QAAM,OAAO,iBAAiB,OAAO;AACrC,QAAM,QAAQ,KAAK,MAAM,IAAI;AAC7B,QAAM,SAAmB,CAAC;AAE1B,aAAW,QAAQ,OAAO;AACxB,QAAI,OAAO,UAAU,SAAU;AAC/B,QAAI,KAAK,KAAK,K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AK,QAAQ,UAAU;AAChE,wBAAc,KAAK,KAAK,WAAW,MAAM,MAAM,eAAe,QAAQ;AAAA,QACxE;AAEA,YAAI,MAAM,WAAW,WAAW,GAAG;AACjC,gBAAM,UAAU,MAAM,SAAS,WAAW;AAC1C,gBAAM,eAAe,gBAAgB,SAAS,qBAAqB;AAEnE,cAAI,aAAa,SAAS,GAAG;AAC3B,iBAAK,IAAI,EAAE;AACX,iBAAK,IAAI,8BAA8B,qBAAqB,aAAa;AACzE,uBAAW,QAAQ,cAAc;AAC/B,mBAAK,IAAI,IAAI;AAAA,YACf;AAAA,UACF;AAAA,QACF;AAAA,MACF;AAEA,WAAK,IAAI,EAAE;AAAA,IACb,SAAS,OAAO;AACd,WAAK,YAAY,KAAK;AAAA,IACxB;AAAA,EACF;AACF;","names":[]}
|
|
1
|
+
{"version":3,"sources":["../../src/cli/commands/info.ts"],"sourcesContent":["import { Args, Flags } from \"@oclif/core\";\nimport { BaseCommand } from \"../base-command.js\";\nimport { loadSource, resolveSkillInfo } from \"../lib/operations/index.js\";\nimport { matrix } from \"../lib/matrix/matrix-provider\";\nimport { CLI_BIN_NAME } from \"../consts.js\";\nimport { EXIT_CODES } from \"../lib/exit-codes.js\";\nimport { STATUS_MESSAGES } from \"../utils/messages.js\";\nimport type { ResolvedSkill, SkillRequirement } from \"../types/index.js\";\n\nconst CONTENT_PREVIEW_LINES = 10;\n\nfunction formatRequirements(requirements: SkillRequirement[]): string {\n if (requirements.length === 0) {\n return \"(none)\";\n }\n return requirements\n .map((req) => {\n const prefix = req.needsAny ? \"any of: \" : \"\";\n return prefix + req.skillIds.join(\", \");\n })\n .join(\"; \");\n}\n\nfunction formatSkillInfo(skill: ResolvedSkill, isInstalled: boolean): string {\n const lines: string[] = [];\n\n lines.push(`Skill: ${skill.id}`);\n if (skill.slug) {\n lines.push(`Slug: ${skill.slug}`);\n }\n lines.push(`Display Name: ${skill.displayName}`);\n lines.push(`Author: ${skill.author}`);\n lines.push(`Category: ${skill.category}`);\n lines.push(\"\");\n lines.push(\"Description:\");\n lines.push(` ${skill.description}`);\n lines.push(\"\");\n lines.push(`Requires: ${formatRequirements(skill.requires)}`);\n lines.push(\n `Conflicts with: ${skill.conflictsWith.length > 0 ? skill.conflictsWith.map((r) => r.skillId).join(\", \") : \"(none)\"}`,\n );\n lines.push(\n `Recommended: ${skill.isRecommended ? `Yes${skill.recommendedReason ? ` — ${skill.recommendedReason}` : \"\"}` : \"No\"}`,\n );\n\n if (skill.usageGuidance) {\n lines.push(\"\");\n lines.push(\"Usage Guidance:\");\n lines.push(` ${skill.usageGuidance}`);\n }\n\n lines.push(\"\");\n lines.push(`Local Status: ${isInstalled ? \"Installed\" : \"Not installed\"}`);\n\n return lines.join(\"\\n\");\n}\n\nexport default class Info extends BaseCommand {\n static summary = \"Show detailed information about a skill\";\n static description =\n \"Display comprehensive information about a skill including metadata, relationships, and content preview\";\n\n static examples = [\n {\n description: \"Show info for a skill by ID\",\n command: \"<%= config.bin %> <%= command.id %> web-framework-react\",\n },\n {\n description: \"Show info without content preview\",\n command: \"<%= config.bin %> <%= command.id %> web-framework-react --no-preview\",\n },\n {\n description: \"Show info from a custom source\",\n command: \"<%= config.bin %> <%= command.id %> my-skill --source github:org/marketplace\",\n },\n ];\n\n static args = {\n skill: Args.string({\n description: \"Skill ID or alias to look up\",\n required: true,\n }),\n };\n\n static flags = {\n ...BaseCommand.baseFlags,\n preview: Flags.boolean({\n description: \"Show content preview from SKILL.md\",\n default: true,\n allowNo: true,\n }),\n };\n\n async run(): Promise<void> {\n const { args, flags } = await this.parse(Info);\n const projectDir = process.cwd();\n\n try {\n const { sourcePath, isLocal } = await this.loadSourceAndLog(flags.source, projectDir);\n const result = await resolveSkillInfo({\n query: args.skill,\n skills: matrix.skills,\n slugToId: matrix.slugMap.slugToId,\n projectDir,\n sourcePath,\n isLocal,\n includePreview: flags.preview,\n });\n\n if (!result.resolved) {\n this.reportNotFound(args.skill, result.suggestions);\n return;\n }\n\n this.displaySkillInfo(result.resolved, flags.preview);\n } catch (error) {\n this.handleError(error);\n }\n }\n\n private async loadSourceAndLog(\n sourceFlag: string | undefined,\n projectDir: string,\n ): Promise<{ sourcePath: string; isLocal: boolean }> {\n this.log(STATUS_MESSAGES.LOADING_SKILLS);\n\n const { sourceResult } = await loadSource({ sourceFlag, projectDir });\n const { sourcePath, isLocal } = sourceResult;\n\n this.log(`Loaded from ${isLocal ? \"local\" : \"remote\"}: ${sourcePath}`);\n return { sourcePath, isLocal };\n }\n\n private reportNotFound(query: string, suggestions: string[]): never {\n this.log(\"\");\n this.error(`Skill \"${query}\" not found.`, { exit: false });\n\n if (suggestions.length > 0) {\n this.log(\"\");\n this.log(\"Did you mean one of these?\");\n for (const suggestion of suggestions) {\n this.log(` - ${suggestion}`);\n }\n }\n\n this.log(\"\");\n this.logInfo(`Use '${CLI_BIN_NAME} search <query>' to find available skills.`);\n this.log(\"\");\n this.exit(EXIT_CODES.ERROR);\n }\n\n private displaySkillInfo(\n resolved: { skill: ResolvedSkill; isInstalled: boolean; preview: string[] },\n showPreview: boolean,\n ): void {\n const { skill, isInstalled, preview } = resolved;\n\n this.log(\"\");\n this.log(formatSkillInfo(skill, isInstalled));\n\n if (showPreview && preview.length > 0) {\n this.log(\"\");\n this.log(`--- Content Preview (first ${CONTENT_PREVIEW_LINES} lines) ---`);\n for (const line of preview) {\n this.log(line);\n }\n }\n\n this.log(\"\");\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA,SAAS,MAAM,aAAa;AAS5B,IAAM,wBAAwB;AAE9B,SAAS,mBAAmB,cAA0C;AACpE,MAAI,aAAa,WAAW,GAAG;AAC7B,WAAO;AAAA,EACT;AACA,SAAO,aACJ,IAAI,CAAC,QAAQ;AACZ,UAAM,SAAS,IAAI,WAAW,aAAa;AAC3C,WAAO,SAAS,IAAI,SAAS,KAAK,IAAI;AAAA,EACxC,CAAC,EACA,KAAK,IAAI;AACd;AAEA,SAAS,gBAA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EAAE;AACX,SAAK,MAAM,UAAU,KAAK,gBAAgB,EAAE,MAAM,MAAM,CAAC;AAEzD,QAAI,YAAY,SAAS,GAAG;AAC1B,WAAK,IAAI,EAAE;AACX,WAAK,IAAI,4BAA4B;AACrC,iBAAW,cAAc,aAAa;AACpC,aAAK,IAAI,OAAO,UAAU,EAAE;AAAA,MAC9B;AAAA,IACF;AAEA,SAAK,IAAI,EAAE;AACX,SAAK,QAAQ,QAAQ,YAAY,4CAA4C;AAC7E,SAAK,IAAI,EAAE;AACX,SAAK,KAAK,WAAW,KAAK;AAAA,EAC5B;AAAA,EAEQ,iBACN,UACA,aACM;AACN,UAAM,EAAE,OAAO,aAAa,QAAQ,IAAI;AAExC,SAAK,IAAI,EAAE;AACX,SAAK,IAAI,gBAAgB,OAAO,WAAW,CAAC;AAE5C,QAAI,eAAe,QAAQ,SAAS,GAAG;AACrC,WAAK,IAAI,EAAE;AACX,WAAK,IAAI,8BAA8B,qBAAqB,aAAa;AACzE,iBAAW,QAAQ,SAAS;AAC1B,aAAK,IAAI,IAAI;AAAA,MACf;AAAA,IACF;AAEA,SAAK,IAAI,EAAE;AAAA,EACb;AACF;","names":[]}
|
package/dist/commands/init.js
CHANGED
|
@@ -4,17 +4,17 @@ import {
|
|
|
4
4
|
formatDashboardText,
|
|
5
5
|
getDashboardData,
|
|
6
6
|
showDashboard
|
|
7
|
-
} from "../chunk-
|
|
8
|
-
import "../chunk-
|
|
9
|
-
import "../chunk-
|
|
7
|
+
} from "../chunk-7FFNNDJQ.js";
|
|
8
|
+
import "../chunk-HZQOFFKA.js";
|
|
9
|
+
import "../chunk-UNEJKTLP.js";
|
|
10
10
|
import "../chunk-YVFGISUO.js";
|
|
11
|
-
import "../chunk-
|
|
12
|
-
import "../chunk-
|
|
11
|
+
import "../chunk-ZOWRO7UQ.js";
|
|
12
|
+
import "../chunk-HH3AWXF4.js";
|
|
13
13
|
import "../chunk-V36FRPAU.js";
|
|
14
|
-
import "../chunk-
|
|
15
|
-
import "../chunk-
|
|
16
|
-
import "../chunk-
|
|
17
|
-
import "../chunk-
|
|
14
|
+
import "../chunk-Q4DMIPZB.js";
|
|
15
|
+
import "../chunk-5M6Q5UQO.js";
|
|
16
|
+
import "../chunk-LZ7XQ3IU.js";
|
|
17
|
+
import "../chunk-SGZOFIFF.js";
|
|
18
18
|
import "../chunk-FQTYF3OU.js";
|
|
19
19
|
import "../chunk-K77I4XGL.js";
|
|
20
20
|
import "../chunk-ANZV33N5.js";
|
|
@@ -24,24 +24,27 @@ import "../chunk-7SOPVGDV.js";
|
|
|
24
24
|
import "../chunk-SB2R5KHJ.js";
|
|
25
25
|
import "../chunk-BEZ6ZPDS.js";
|
|
26
26
|
import "../chunk-P2FHS5IS.js";
|
|
27
|
-
import "../chunk-
|
|
27
|
+
import "../chunk-C5IYJ42F.js";
|
|
28
28
|
import "../chunk-NL5EB57E.js";
|
|
29
29
|
import "../chunk-HSKKGAOW.js";
|
|
30
30
|
import "../chunk-4QA5TIBU.js";
|
|
31
31
|
import "../chunk-WJXWYSBT.js";
|
|
32
|
-
import "../chunk-
|
|
32
|
+
import "../chunk-CXWBVBDM.js";
|
|
33
33
|
import "../chunk-XO6X5QE5.js";
|
|
34
34
|
import "../chunk-KUV24B5M.js";
|
|
35
|
-
import "../chunk-
|
|
35
|
+
import "../chunk-HSLVCKVQ.js";
|
|
36
36
|
import "../chunk-HEQVUIHQ.js";
|
|
37
37
|
import "../chunk-U3IGFMCY.js";
|
|
38
38
|
import "../chunk-HK53FRMU.js";
|
|
39
39
|
import "../chunk-B7KZLXHV.js";
|
|
40
|
-
import "../chunk-
|
|
41
|
-
import "../chunk-
|
|
40
|
+
import "../chunk-5UJJQFET.js";
|
|
41
|
+
import "../chunk-N6A7A4RA.js";
|
|
42
|
+
import "../chunk-FBZR46GC.js";
|
|
43
|
+
import "../chunk-TMTUTUEV.js";
|
|
44
|
+
import "../chunk-B6MYECV6.js";
|
|
42
45
|
import "../chunk-ANXHMG32.js";
|
|
43
|
-
import "../chunk-
|
|
44
|
-
import "../chunk-
|
|
46
|
+
import "../chunk-MMTMXLI4.js";
|
|
47
|
+
import "../chunk-NUU3U43A.js";
|
|
45
48
|
import "../chunk-6XWHJHNZ.js";
|
|
46
49
|
import "../chunk-6PGL2XMY.js";
|
|
47
50
|
import "../chunk-NPMMU4GY.js";
|
package/dist/commands/list.js
CHANGED
|
@@ -2,13 +2,13 @@
|
|
|
2
2
|
import {
|
|
3
3
|
formatInstallationDisplay,
|
|
4
4
|
getInstallationInfo
|
|
5
|
-
} from "../chunk-
|
|
6
|
-
import "../chunk-
|
|
5
|
+
} from "../chunk-TMTUTUEV.js";
|
|
6
|
+
import "../chunk-B6MYECV6.js";
|
|
7
7
|
import "../chunk-ANXHMG32.js";
|
|
8
8
|
import {
|
|
9
9
|
BaseCommand
|
|
10
|
-
} from "../chunk-
|
|
11
|
-
import "../chunk-
|
|
10
|
+
} from "../chunk-MMTMXLI4.js";
|
|
11
|
+
import "../chunk-NUU3U43A.js";
|
|
12
12
|
import "../chunk-6XWHJHNZ.js";
|
|
13
13
|
import {
|
|
14
14
|
CLI_BIN_NAME,
|
|
@@ -1,24 +1,24 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import {
|
|
3
3
|
getAgentDefinitions
|
|
4
|
-
} from "../../chunk-
|
|
4
|
+
} from "../../chunk-FBZR46GC.js";
|
|
5
5
|
import {
|
|
6
6
|
isClaudeCLIAvailable,
|
|
7
7
|
loadConfigTypesDataInBackground,
|
|
8
8
|
regenerateConfigTypes,
|
|
9
9
|
resolveSource
|
|
10
|
-
} from "../../chunk-
|
|
11
|
-
import "../../chunk-
|
|
10
|
+
} from "../../chunk-TMTUTUEV.js";
|
|
11
|
+
import "../../chunk-B6MYECV6.js";
|
|
12
12
|
import "../../chunk-ANXHMG32.js";
|
|
13
13
|
import {
|
|
14
14
|
BaseCommand,
|
|
15
15
|
EXIT_CODES
|
|
16
|
-
} from "../../chunk-
|
|
16
|
+
} from "../../chunk-MMTMXLI4.js";
|
|
17
17
|
import {
|
|
18
18
|
fileExists,
|
|
19
19
|
getErrorMessage,
|
|
20
20
|
readFile
|
|
21
|
-
} from "../../chunk-
|
|
21
|
+
} from "../../chunk-NUU3U43A.js";
|
|
22
22
|
import "../../chunk-6XWHJHNZ.js";
|
|
23
23
|
import {
|
|
24
24
|
CLAUDE_DIR,
|
|
@@ -40,7 +40,6 @@ import matter from "gray-matter";
|
|
|
40
40
|
import { render, Box, Text, useApp, useInput } from "ink";
|
|
41
41
|
import path from "path";
|
|
42
42
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
43
|
-
var META_AGENT_NAME = "agent-summoner";
|
|
44
43
|
var SEPARATOR_WIDTH = 60;
|
|
45
44
|
var PurposeInput = ({ onSubmit, onCancel }) => {
|
|
46
45
|
const { exit } = useApp();
|
|
@@ -69,6 +68,121 @@ var PurposeInput = ({ onSubmit, onCancel }) => {
|
|
|
69
68
|
error && /* @__PURE__ */ jsx(Box, { marginTop: 1, children: /* @__PURE__ */ jsx(Text, { color: CLI_COLORS.ERROR, children: error }) })
|
|
70
69
|
] });
|
|
71
70
|
};
|
|
71
|
+
var NewAgent = class _NewAgent extends BaseCommand {
|
|
72
|
+
static summary = "Create a new custom agent using AI generation";
|
|
73
|
+
static description = "Uses the agent-summoner meta-agent to scaffold a new agent with proper structure and documentation.";
|
|
74
|
+
static args = {
|
|
75
|
+
name: Args.string({
|
|
76
|
+
description: "Name of the agent to create",
|
|
77
|
+
required: true
|
|
78
|
+
})
|
|
79
|
+
};
|
|
80
|
+
static flags = {
|
|
81
|
+
...BaseCommand.baseFlags,
|
|
82
|
+
purpose: Flags.string({
|
|
83
|
+
char: "p",
|
|
84
|
+
description: "Purpose/description of the agent",
|
|
85
|
+
required: false
|
|
86
|
+
}),
|
|
87
|
+
"non-interactive": Flags.boolean({
|
|
88
|
+
char: "n",
|
|
89
|
+
description: "Run in non-interactive mode",
|
|
90
|
+
default: false
|
|
91
|
+
}),
|
|
92
|
+
refresh: Flags.boolean({
|
|
93
|
+
char: "r",
|
|
94
|
+
description: "Force refresh remote source",
|
|
95
|
+
default: false
|
|
96
|
+
})
|
|
97
|
+
};
|
|
98
|
+
async run() {
|
|
99
|
+
const { args, flags } = await this.parse(_NewAgent);
|
|
100
|
+
const projectDir = process.cwd();
|
|
101
|
+
const configTypesReady = loadConfigTypesDataInBackground(flags.source, projectDir);
|
|
102
|
+
await this.ensureClaudeCliAvailable();
|
|
103
|
+
const purpose = flags.purpose ?? await this.promptForPurpose();
|
|
104
|
+
const outputDir = path.join(projectDir, CLAUDE_DIR, "agents", "_custom");
|
|
105
|
+
this.logAgentPlan(args.name, purpose, outputDir);
|
|
106
|
+
await this.generateAgent(args.name, purpose, outputDir, flags, projectDir);
|
|
107
|
+
await this.updateConfigTypes(projectDir, configTypesReady, args.name);
|
|
108
|
+
this.log("");
|
|
109
|
+
this.log("\u2500".repeat(SEPARATOR_WIDTH));
|
|
110
|
+
this.logSuccess("Agent creation complete!");
|
|
111
|
+
}
|
|
112
|
+
async ensureClaudeCliAvailable() {
|
|
113
|
+
const cliAvailable = await isClaudeCLIAvailable();
|
|
114
|
+
if (!cliAvailable) {
|
|
115
|
+
this.error(
|
|
116
|
+
"Claude CLI not found. Please install it first:\n npm install -g @anthropic-ai/claude-code",
|
|
117
|
+
{ exit: EXIT_CODES.ERROR }
|
|
118
|
+
);
|
|
119
|
+
}
|
|
120
|
+
}
|
|
121
|
+
async promptForPurpose() {
|
|
122
|
+
let inputResult = null;
|
|
123
|
+
let cancelled = false;
|
|
124
|
+
const { waitUntilExit } = render(
|
|
125
|
+
/* @__PURE__ */ jsx(
|
|
126
|
+
PurposeInput,
|
|
127
|
+
{
|
|
128
|
+
onSubmit: (value) => {
|
|
129
|
+
inputResult = value;
|
|
130
|
+
},
|
|
131
|
+
onCancel: () => {
|
|
132
|
+
cancelled = true;
|
|
133
|
+
}
|
|
134
|
+
}
|
|
135
|
+
)
|
|
136
|
+
);
|
|
137
|
+
await waitUntilExit();
|
|
138
|
+
if (cancelled || !inputResult) {
|
|
139
|
+
this.log("Cancelled");
|
|
140
|
+
this.exit(EXIT_CODES.CANCELLED);
|
|
141
|
+
}
|
|
142
|
+
return inputResult;
|
|
143
|
+
}
|
|
144
|
+
logAgentPlan(name, purpose, outputDir) {
|
|
145
|
+
this.log("");
|
|
146
|
+
this.log(`Agent name: ${name}`);
|
|
147
|
+
this.log(`Purpose: ${purpose}`);
|
|
148
|
+
this.log(`Output: ${outputDir}`);
|
|
149
|
+
this.log("");
|
|
150
|
+
}
|
|
151
|
+
async generateAgent(name, purpose, outputDir, flags, projectDir) {
|
|
152
|
+
this.log("Fetching agent-summoner from source...");
|
|
153
|
+
try {
|
|
154
|
+
const sourceConfig = await resolveSource(flags.source, projectDir);
|
|
155
|
+
const agentDef = await loadMetaAgent({
|
|
156
|
+
projectDir,
|
|
157
|
+
source: sourceConfig.source,
|
|
158
|
+
forceRefresh: flags.refresh
|
|
159
|
+
});
|
|
160
|
+
this.log("Meta-agent loaded");
|
|
161
|
+
this.log("");
|
|
162
|
+
const agentPrompt = buildAgentPrompt(name, purpose, outputDir);
|
|
163
|
+
this.log("Invoking agent-summoner to create your agent...");
|
|
164
|
+
this.log("\u2500".repeat(SEPARATOR_WIDTH));
|
|
165
|
+
this.log("");
|
|
166
|
+
await invokeMetaAgent({
|
|
167
|
+
agentDef,
|
|
168
|
+
prompt: agentPrompt,
|
|
169
|
+
nonInteractive: flags["non-interactive"]
|
|
170
|
+
});
|
|
171
|
+
} catch (error) {
|
|
172
|
+
this.handleError(error);
|
|
173
|
+
}
|
|
174
|
+
}
|
|
175
|
+
async updateConfigTypes(projectDir, configTypesReady, agentName) {
|
|
176
|
+
try {
|
|
177
|
+
await regenerateConfigTypes(projectDir, configTypesReady, {
|
|
178
|
+
extraAgentNames: [agentName]
|
|
179
|
+
});
|
|
180
|
+
} catch (error) {
|
|
181
|
+
this.warn(`Could not update ${STANDARD_FILES.CONFIG_TYPES_TS}: ${getErrorMessage(error)}`);
|
|
182
|
+
}
|
|
183
|
+
}
|
|
184
|
+
};
|
|
185
|
+
var META_AGENT_NAME = "agent-summoner";
|
|
72
186
|
function parseCompiledAgent(content) {
|
|
73
187
|
const { data: frontmatter, content: body } = matter(content);
|
|
74
188
|
const tools = typeof frontmatter.tools === "string" ? frontmatter.tools.split(",").map((t) => t.trim()) : frontmatter.tools;
|
|
@@ -79,7 +193,8 @@ function parseCompiledAgent(content) {
|
|
|
79
193
|
tools
|
|
80
194
|
};
|
|
81
195
|
}
|
|
82
|
-
async function loadMetaAgent(
|
|
196
|
+
async function loadMetaAgent(options) {
|
|
197
|
+
const { projectDir, source, forceRefresh } = options;
|
|
83
198
|
const compiledFileName = `${META_AGENT_NAME}.md`;
|
|
84
199
|
const localAgentPath = path.join(projectDir, CLAUDE_DIR, "agents", compiledFileName);
|
|
85
200
|
if (await fileExists(localAgentPath)) {
|
|
@@ -120,7 +235,8 @@ Requirements:
|
|
|
120
235
|
|
|
121
236
|
Follow the existing agent patterns in the codebase. Keep the agent focused and practical.`;
|
|
122
237
|
}
|
|
123
|
-
async function invokeMetaAgent(
|
|
238
|
+
async function invokeMetaAgent(options) {
|
|
239
|
+
const { agentDef, prompt, nonInteractive } = options;
|
|
124
240
|
const agentsJson = JSON.stringify({
|
|
125
241
|
[META_AGENT_NAME]: {
|
|
126
242
|
description: agentDef.description,
|
|
@@ -151,100 +267,6 @@ async function invokeMetaAgent(agentDef, prompt, nonInteractive) {
|
|
|
151
267
|
});
|
|
152
268
|
});
|
|
153
269
|
}
|
|
154
|
-
var NewAgent = class _NewAgent extends BaseCommand {
|
|
155
|
-
static summary = "Create a new custom agent using AI generation";
|
|
156
|
-
static description = "Uses the agent-summoner meta-agent to scaffold a new agent with proper structure and documentation.";
|
|
157
|
-
static args = {
|
|
158
|
-
name: Args.string({
|
|
159
|
-
description: "Name of the agent to create",
|
|
160
|
-
required: true
|
|
161
|
-
})
|
|
162
|
-
};
|
|
163
|
-
static flags = {
|
|
164
|
-
...BaseCommand.baseFlags,
|
|
165
|
-
purpose: Flags.string({
|
|
166
|
-
char: "p",
|
|
167
|
-
description: "Purpose/description of the agent",
|
|
168
|
-
required: false
|
|
169
|
-
}),
|
|
170
|
-
"non-interactive": Flags.boolean({
|
|
171
|
-
char: "n",
|
|
172
|
-
description: "Run in non-interactive mode",
|
|
173
|
-
default: false
|
|
174
|
-
}),
|
|
175
|
-
refresh: Flags.boolean({
|
|
176
|
-
char: "r",
|
|
177
|
-
description: "Force refresh remote source",
|
|
178
|
-
default: false
|
|
179
|
-
})
|
|
180
|
-
};
|
|
181
|
-
async run() {
|
|
182
|
-
const { args, flags } = await this.parse(_NewAgent);
|
|
183
|
-
const projectDir = process.cwd();
|
|
184
|
-
const configTypesReady = loadConfigTypesDataInBackground(flags.source, projectDir);
|
|
185
|
-
const cliAvailable = await isClaudeCLIAvailable();
|
|
186
|
-
if (!cliAvailable) {
|
|
187
|
-
this.error(
|
|
188
|
-
"Claude CLI not found. Please install it first:\n npm install -g @anthropic-ai/claude-code",
|
|
189
|
-
{ exit: EXIT_CODES.ERROR }
|
|
190
|
-
);
|
|
191
|
-
}
|
|
192
|
-
let purpose = flags.purpose;
|
|
193
|
-
if (!purpose) {
|
|
194
|
-
let inputResult = null;
|
|
195
|
-
let cancelled = false;
|
|
196
|
-
const { waitUntilExit } = render(
|
|
197
|
-
/* @__PURE__ */ jsx(
|
|
198
|
-
PurposeInput,
|
|
199
|
-
{
|
|
200
|
-
onSubmit: (value) => {
|
|
201
|
-
inputResult = value;
|
|
202
|
-
},
|
|
203
|
-
onCancel: () => {
|
|
204
|
-
cancelled = true;
|
|
205
|
-
}
|
|
206
|
-
}
|
|
207
|
-
)
|
|
208
|
-
);
|
|
209
|
-
await waitUntilExit();
|
|
210
|
-
if (cancelled || !inputResult) {
|
|
211
|
-
this.log("Cancelled");
|
|
212
|
-
this.exit(EXIT_CODES.CANCELLED);
|
|
213
|
-
}
|
|
214
|
-
purpose = inputResult;
|
|
215
|
-
}
|
|
216
|
-
const outputDir = path.join(projectDir, CLAUDE_DIR, "agents", "_custom");
|
|
217
|
-
this.log("");
|
|
218
|
-
this.log(`Agent name: ${args.name}`);
|
|
219
|
-
this.log(`Purpose: ${purpose}`);
|
|
220
|
-
this.log(`Output: ${outputDir}`);
|
|
221
|
-
this.log("");
|
|
222
|
-
this.log("Fetching agent-summoner from source...");
|
|
223
|
-
try {
|
|
224
|
-
const sourceConfig = await resolveSource(flags.source, projectDir);
|
|
225
|
-
const agentDef = await loadMetaAgent(projectDir, sourceConfig.source, flags.refresh);
|
|
226
|
-
this.log("Meta-agent loaded");
|
|
227
|
-
this.log("");
|
|
228
|
-
const agentPrompt = buildAgentPrompt(args.name, purpose, outputDir);
|
|
229
|
-
this.log("Invoking agent-summoner to create your agent...");
|
|
230
|
-
this.log("\u2500".repeat(SEPARATOR_WIDTH));
|
|
231
|
-
this.log("");
|
|
232
|
-
await invokeMetaAgent(agentDef, agentPrompt, flags["non-interactive"]);
|
|
233
|
-
try {
|
|
234
|
-
await regenerateConfigTypes(projectDir, configTypesReady, {
|
|
235
|
-
extraAgentNames: [args.name]
|
|
236
|
-
});
|
|
237
|
-
} catch (error) {
|
|
238
|
-
this.warn(`Could not update ${STANDARD_FILES.CONFIG_TYPES_TS}: ${getErrorMessage(error)}`);
|
|
239
|
-
}
|
|
240
|
-
this.log("");
|
|
241
|
-
this.log("\u2500".repeat(SEPARATOR_WIDTH));
|
|
242
|
-
this.logSuccess("Agent creation complete!");
|
|
243
|
-
} catch (error) {
|
|
244
|
-
this.handleError(error);
|
|
245
|
-
}
|
|
246
|
-
}
|
|
247
|
-
};
|
|
248
270
|
export {
|
|
249
271
|
buildAgentPrompt,
|
|
250
272
|
NewAgent as default
|