@recapt/mcp 0.0.19-beta → 0.0.20

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.
Files changed (93) hide show
  1. package/dist/cli/index.d.ts +0 -11
  2. package/dist/cli/index.js +1059 -21
  3. package/dist/index.d.ts +0 -19
  4. package/dist/index.js +3210 -89
  5. package/package.json +5 -3
  6. package/dist/api/client.d.ts +0 -6
  7. package/dist/api/client.js +0 -6
  8. package/dist/cli/commands/setup-self-improvement-gh.d.ts +0 -7
  9. package/dist/cli/commands/setup-self-improvement-gh.js +0 -310
  10. package/dist/cli/commands/setup.d.ts +0 -7
  11. package/dist/cli/commands/setup.js +0 -178
  12. package/dist/cli/commands/skill.d.ts +0 -24
  13. package/dist/cli/commands/skill.js +0 -264
  14. package/dist/cli/utils/ide-config.d.ts +0 -31
  15. package/dist/cli/utils/ide-config.js +0 -294
  16. package/dist/cli/utils/prompts.d.ts +0 -22
  17. package/dist/cli/utils/prompts.js +0 -71
  18. package/dist/tools/analyzeFlow.d.ts +0 -7
  19. package/dist/tools/analyzeFlow.js +0 -68
  20. package/dist/tools/analyzeFunnel.d.ts +0 -7
  21. package/dist/tools/analyzeFunnel.js +0 -63
  22. package/dist/tools/catalog/callTool.d.ts +0 -22
  23. package/dist/tools/catalog/callTool.js +0 -92
  24. package/dist/tools/catalog/index.d.ts +0 -11
  25. package/dist/tools/catalog/index.js +0 -11
  26. package/dist/tools/catalog/searchTools.d.ts +0 -22
  27. package/dist/tools/catalog/searchTools.js +0 -194
  28. package/dist/tools/compareCohorts.d.ts +0 -6
  29. package/dist/tools/compareCohorts.js +0 -84
  30. package/dist/tools/comparePeriods.d.ts +0 -6
  31. package/dist/tools/comparePeriods.js +0 -54
  32. package/dist/tools/detectDrift.d.ts +0 -6
  33. package/dist/tools/detectDrift.js +0 -55
  34. package/dist/tools/detectRegressions.d.ts +0 -6
  35. package/dist/tools/detectRegressions.js +0 -63
  36. package/dist/tools/diagnostic.d.ts +0 -6
  37. package/dist/tools/diagnostic.js +0 -109
  38. package/dist/tools/discoverPersonas.d.ts +0 -6
  39. package/dist/tools/discoverPersonas.js +0 -50
  40. package/dist/tools/getActionableIssues.d.ts +0 -7
  41. package/dist/tools/getActionableIssues.js +0 -55
  42. package/dist/tools/getAnomalies.d.ts +0 -6
  43. package/dist/tools/getAnomalies.js +0 -53
  44. package/dist/tools/getConsoleErrors.d.ts +0 -6
  45. package/dist/tools/getConsoleErrors.js +0 -61
  46. package/dist/tools/getDeadClicks.d.ts +0 -6
  47. package/dist/tools/getDeadClicks.js +0 -42
  48. package/dist/tools/getDomains.d.ts +0 -6
  49. package/dist/tools/getDomains.js +0 -34
  50. package/dist/tools/getElementFriction.d.ts +0 -6
  51. package/dist/tools/getElementFriction.js +0 -45
  52. package/dist/tools/getFlowFriction.d.ts +0 -7
  53. package/dist/tools/getFlowFriction.js +0 -57
  54. package/dist/tools/getFormFriction.d.ts +0 -6
  55. package/dist/tools/getFormFriction.js +0 -42
  56. package/dist/tools/getIssues.d.ts +0 -6
  57. package/dist/tools/getIssues.js +0 -82
  58. package/dist/tools/getJourneyPatterns.d.ts +0 -7
  59. package/dist/tools/getJourneyPatterns.js +0 -50
  60. package/dist/tools/getPageMetrics.d.ts +0 -6
  61. package/dist/tools/getPageMetrics.js +0 -47
  62. package/dist/tools/getPageTrends.d.ts +0 -6
  63. package/dist/tools/getPageTrends.js +0 -46
  64. package/dist/tools/getSessionDetails.d.ts +0 -6
  65. package/dist/tools/getSessionDetails.js +0 -70
  66. package/dist/tools/getSessionPages.d.ts +0 -7
  67. package/dist/tools/getSessionPages.js +0 -74
  68. package/dist/tools/getUxHealthReport.d.ts +0 -7
  69. package/dist/tools/getUxHealthReport.js +0 -50
  70. package/dist/tools/improvementRun.d.ts +0 -6
  71. package/dist/tools/improvementRun.js +0 -386
  72. package/dist/tools/knowledge.d.ts +0 -6
  73. package/dist/tools/knowledge.js +0 -186
  74. package/dist/tools/listPages.d.ts +0 -6
  75. package/dist/tools/listPages.js +0 -50
  76. package/dist/tools/listSessions.d.ts +0 -7
  77. package/dist/tools/listSessions.js +0 -67
  78. package/dist/tools/memory.d.ts +0 -7
  79. package/dist/tools/memory.js +0 -119
  80. package/dist/tools/predictOutcomes.d.ts +0 -6
  81. package/dist/tools/predictOutcomes.js +0 -66
  82. package/dist/tools/remediation.d.ts +0 -6
  83. package/dist/tools/remediation.js +0 -335
  84. package/dist/tools/scanSite.d.ts +0 -6
  85. package/dist/tools/scanSite.js +0 -51
  86. package/dist/tools/searchSessions.d.ts +0 -6
  87. package/dist/tools/searchSessions.js +0 -51
  88. package/dist/tools/triage.d.ts +0 -6
  89. package/dist/tools/triage.js +0 -114
  90. package/dist/tools/triageSessions.d.ts +0 -8
  91. package/dist/tools/triageSessions.js +0 -197
  92. package/dist/tools/upgradeOptions.d.ts +0 -7
  93. package/dist/tools/upgradeOptions.js +0 -67
package/package.json CHANGED
@@ -1,12 +1,13 @@
1
1
  {
2
2
  "name": "@recapt/mcp",
3
- "version": "0.0.19-beta",
3
+ "version": "0.0.20",
4
4
  "description": "MCP exposing recapt behavioral intelligence to AI coding agents",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
7
7
  "type": "module",
8
8
  "scripts": {
9
- "build": "npm run generate-catalog && tsc && cp src/tools/catalog/toolCatalog.json src/tools/catalog/anthropicToolCatalog.json dist/tools/catalog/",
9
+ "build": "npm run generate-catalog && tsup",
10
+ "build:tsc": "npm run generate-catalog && tsc && cp src/tools/catalog/toolCatalog.json src/tools/catalog/anthropicToolCatalog.json dist/tools/catalog/",
10
11
  "build:workflows": "tsx scripts/buildWorkflows.ts",
11
12
  "clean": "rimraf ./dist",
12
13
  "dev": "tsx --watch src/index.ts",
@@ -32,6 +33,7 @@
32
33
  "@inquirer/prompts": "^8.3.2",
33
34
  "@modelcontextprotocol/sdk": "^1.12.0",
34
35
  "commander": "^14.0.3",
36
+ "dotenv": "^17.2.2",
35
37
  "zod": "^3.24.0"
36
38
  },
37
39
  "optionalDependencies": {
@@ -39,13 +41,13 @@
39
41
  },
40
42
  "peerDependencies": {
41
43
  "@types/node": "^24.3.1",
42
- "dotenv": "^17.2.2",
43
44
  "prettier": "^3.8.1",
44
45
  "rimraf": "^6.0.1",
45
46
  "tsx": "^4.16.5",
46
47
  "typescript": "5.9.3"
47
48
  },
48
49
  "devDependencies": {
50
+ "tsup": "^8.5.1",
49
51
  "yaml": "^2.8.3"
50
52
  }
51
53
  }
@@ -1,6 +0,0 @@
1
- /**
2
- * HTTP client for calling external-api query endpoints.
3
- *
4
- * Re-exports from @glimt/mcp-tools for backward compatibility.
5
- */
6
- export { isApiConfigured, getApiUrl, apiGet, apiPost, apiPatch, apiDelete, } from "@glimt/mcp-tools";
@@ -1,6 +0,0 @@
1
- /**
2
- * HTTP client for calling external-api query endpoints.
3
- *
4
- * Re-exports from @glimt/mcp-tools for backward compatibility.
5
- */
6
- export { isApiConfigured, getApiUrl, apiGet, apiPost, apiPatch, apiDelete, } from "@glimt/mcp-tools";
@@ -1,7 +0,0 @@
1
- /**
2
- * Setup Self-Improvement GitHub Command
3
- *
4
- * Interactive wizard to set up the self-improvement agentic workflow for GitHub.
5
- */
6
- import { Command } from "commander";
7
- export declare const setupSelfImprovementGhCommand: Command;
@@ -1,310 +0,0 @@
1
- /**
2
- * Setup Self-Improvement GitHub Command
3
- *
4
- * Interactive wizard to set up the self-improvement agentic workflow for GitHub.
5
- */
6
- import { Command } from "commander";
7
- import { exec, execSync } from "child_process";
8
- import fs from "fs";
9
- import path from "path";
10
- import { fileURLToPath } from "url";
11
- import { installSkill } from "./skill.js";
12
- import { confirm, select, multiSelect, input, header, print, success, error, info, warn, newline, } from "../utils/prompts.js";
13
- const __filename = fileURLToPath(import.meta.url);
14
- const __dirname = path.dirname(__filename);
15
- const TEMPLATES_DIR = path.resolve(__dirname, "../../../templates");
16
- const WORKFLOW_TEMPLATE = "self-improvement.md";
17
- const WORKFLOW_DEST = ".github/workflows/self-improvement.md";
18
- const ENGINES = [
19
- { id: "claude", name: "Claude (Anthropic)", secretName: "ANTHROPIC_API_KEY" },
20
- { id: "copilot", name: "GitHub Copilot", secretName: "COPILOT_GITHUB_TOKEN" },
21
- { id: "codex", name: "Codex (OpenAI)", secretName: "OPENAI_API_KEY" },
22
- ];
23
- const API_URL = process.env.RECAPT_API_URL ||
24
- process.env.EXTERNAL_API_URL ||
25
- "https://api.recapt.app";
26
- async function fetchDomains(secretKey) {
27
- try {
28
- const res = await fetch(`${API_URL}/v1beta/query/domains`, {
29
- headers: {
30
- "x-private-key": secretKey,
31
- "Content-Type": "application/json",
32
- },
33
- });
34
- if (!res.ok) {
35
- return null;
36
- }
37
- const data = (await res.json());
38
- return data;
39
- }
40
- catch {
41
- return null;
42
- }
43
- }
44
- function commandExists(cmd) {
45
- try {
46
- execSync(`which ${cmd}`, { stdio: "ignore" });
47
- return true;
48
- }
49
- catch {
50
- return false;
51
- }
52
- }
53
- function ghExtensionInstalled(extension) {
54
- try {
55
- const output = execSync("gh extension list", { encoding: "utf-8" });
56
- return output.includes(extension);
57
- }
58
- catch {
59
- return false;
60
- }
61
- }
62
- function isGitRepo() {
63
- try {
64
- execSync("git rev-parse --is-inside-work-tree", { stdio: "ignore" });
65
- return true;
66
- }
67
- catch {
68
- return false;
69
- }
70
- }
71
- function getRepoUrl() {
72
- try {
73
- const url = execSync("gh repo view --json url -q .url", {
74
- encoding: "utf-8",
75
- }).trim();
76
- return url || null;
77
- }
78
- catch {
79
- return null;
80
- }
81
- }
82
- function openBrowser(url) {
83
- const platform = process.platform;
84
- let command;
85
- switch (platform) {
86
- case "darwin":
87
- command = `open "${url}"`;
88
- break;
89
- case "win32":
90
- command = `start "" "${url}"`;
91
- break;
92
- default:
93
- command = `xdg-open "${url}"`;
94
- }
95
- exec(command, (err) => {
96
- if (err) {
97
- info(`Could not open browser automatically. Please visit: ${url}`);
98
- }
99
- });
100
- }
101
- async function runSetupSelfImprovementGh() {
102
- header("Recapt Self-Improvement GitHub Setup");
103
- const cwd = process.cwd();
104
- print("Checking prerequisites...");
105
- newline();
106
- const hasGh = commandExists("gh");
107
- print(` ${hasGh ? "[x]" : "[ ]"} gh CLI installed`);
108
- if (!hasGh) {
109
- newline();
110
- error("GitHub CLI (gh) is required but not installed.");
111
- info("Install it from: https://cli.github.com/");
112
- process.exit(1);
113
- }
114
- const hasGhAw = ghExtensionInstalled("github/gh-aw");
115
- print(` ${hasGhAw ? "[x]" : "[ ]"} gh-aw extension installed`);
116
- if (!hasGhAw) {
117
- newline();
118
- const shouldInstall = await confirm("gh-aw extension is required. Install it now?", true);
119
- if (shouldInstall) {
120
- print("Installing gh-aw extension...");
121
- try {
122
- execSync("gh extension install github/gh-aw", { stdio: "inherit" });
123
- success("gh-aw extension installed");
124
- }
125
- catch {
126
- error("Failed to install gh-aw extension");
127
- info("Try manually: gh extension install github/gh-aw");
128
- process.exit(1);
129
- }
130
- }
131
- else {
132
- error("gh-aw extension is required to continue.");
133
- process.exit(1);
134
- }
135
- }
136
- const inGitRepo = isGitRepo();
137
- print(` ${inGitRepo ? "[x]" : "[ ]"} Git repository detected`);
138
- if (!inGitRepo) {
139
- newline();
140
- error("This command must be run from within a git repository.");
141
- process.exit(1);
142
- }
143
- newline();
144
- const engineOptions = ENGINES.map((engine) => ({
145
- label: `${engine.name} (requires ${engine.secretName} secret)`,
146
- value: engine,
147
- }));
148
- const selectedEngine = await select("Which AI engine do you want to use?", engineOptions);
149
- if (!selectedEngine) {
150
- error("No engine selected.");
151
- process.exit(1);
152
- }
153
- newline();
154
- // Domain selection
155
- print("Configuring domain filter...");
156
- info("You can optionally limit the workflow to specific domains.");
157
- newline();
158
- let selectedDomains = [];
159
- const recaptKey = await input("Enter your RECAPT_SECRET_KEY to fetch domains (or press Enter to skip)");
160
- if (recaptKey) {
161
- const domains = await fetchDomains(recaptKey);
162
- if (domains && domains.length > 0) {
163
- const domainOptions = [
164
- { label: "All domains", value: "__all__", selected: true },
165
- ...domains.map((d) => ({
166
- label: d.domainName,
167
- value: d.domainName,
168
- selected: false,
169
- })),
170
- ];
171
- const selected = await multiSelect("Which domains should this workflow analyze?", domainOptions);
172
- if (!selected.includes("__all__") && selected.length > 0) {
173
- selectedDomains = selected;
174
- success(`Selected domains: ${selectedDomains.join(", ")}`);
175
- }
176
- else {
177
- info("Will analyze all domains");
178
- }
179
- }
180
- else {
181
- warn("Could not fetch domains. Will analyze all domains.");
182
- }
183
- }
184
- else {
185
- const manualDomain = await input("Enter a specific domain to filter (or press Enter for all domains)");
186
- if (manualDomain) {
187
- selectedDomains = [manualDomain];
188
- success(`Selected domain: ${manualDomain}`);
189
- }
190
- else {
191
- info("Will analyze all domains");
192
- }
193
- }
194
- newline();
195
- print("Installing self-improvement skill...");
196
- const skillInstalled = installSkill(cwd, "self-improvement", true);
197
- if (!skillInstalled) {
198
- error("Failed to install self-improvement skill");
199
- process.exit(1);
200
- }
201
- newline();
202
- print("Creating workflow...");
203
- const templatePath = path.join(TEMPLATES_DIR, WORKFLOW_TEMPLATE);
204
- const destPath = path.join(cwd, WORKFLOW_DEST);
205
- const destDir = path.dirname(destPath);
206
- if (!fs.existsSync(templatePath)) {
207
- error(`Workflow template not found: ${templatePath}`);
208
- process.exit(1);
209
- }
210
- if (!fs.existsSync(destDir)) {
211
- fs.mkdirSync(destDir, { recursive: true });
212
- }
213
- const templateContent = fs.readFileSync(templatePath, "utf-8");
214
- // Build domain config section
215
- let domainConfig = "";
216
- if (selectedDomains.length > 0) {
217
- const domainList = selectedDomains.join(", ");
218
- domainConfig = `### Domain Restriction
219
-
220
- **Target domains:** ${domainList}
221
-
222
- Before doing any work:
223
- 1. Call \`get_domains\` to verify the target domain(s) exist
224
- 2. If any target domain is NOT in the list, stop immediately and report: "Domain not found: [domain]. Available domains: [list]"
225
- 3. If domains are valid, pass the \`domain\` parameter to all tools that support filtering (e.g., \`run_full_diagnostic\`, \`get_page_metrics\`, etc.)
226
-
227
- Do NOT analyze or fix issues for domains not in the target list.
228
-
229
- `;
230
- }
231
- else {
232
- domainConfig = `### Domain Scope
233
-
234
- **Target:** All domains
235
-
236
- Analyze and fix issues across all domains configured in recapt. Call \`get_domains\` first to see available domains.
237
-
238
- `;
239
- }
240
- // Replace placeholders (support both {{VAR}} and { { VAR } } formats)
241
- const workflowContent = templateContent
242
- .replace(/\{\s*\{\s*ENGINE\s*\}\s*\}/g, selectedEngine.id)
243
- .replace(/\{\s*\{\s*DOMAIN_CONFIG\s*\}\s*\}/g, domainConfig);
244
- if (fs.existsSync(destPath)) {
245
- const overwrite = await confirm("Workflow file already exists. Overwrite?", false);
246
- if (!overwrite) {
247
- info("Skipping workflow creation");
248
- }
249
- else {
250
- fs.writeFileSync(destPath, workflowContent);
251
- success(`Created: ${WORKFLOW_DEST}`);
252
- }
253
- }
254
- else {
255
- fs.writeFileSync(destPath, workflowContent);
256
- success(`Created: ${WORKFLOW_DEST}`);
257
- }
258
- newline();
259
- print("Compiling workflow...");
260
- try {
261
- execSync("gh aw compile", { cwd, stdio: "inherit" });
262
- success("Created: .github/workflows/self-improvement.lock.yml");
263
- }
264
- catch {
265
- warn("Failed to compile workflow. You can run 'gh aw compile' manually.");
266
- }
267
- newline();
268
- print("GitHub Secrets Required:");
269
- info(`1. ${selectedEngine.secretName} - For ${selectedEngine.name} to run the agent`);
270
- info("2. RECAPT_SECRET_KEY - For recapt behavioral intelligence");
271
- newline();
272
- const repoUrl = getRepoUrl();
273
- if (repoUrl) {
274
- const secretsUrl = `${repoUrl}/settings/secrets/actions`;
275
- const openSecrets = await confirm("Open GitHub secrets page?", true);
276
- if (openSecrets) {
277
- openBrowser(secretsUrl);
278
- await new Promise((resolve) => setTimeout(resolve, 1000));
279
- }
280
- }
281
- else {
282
- info("Go to your repository Settings → Secrets and variables → Actions");
283
- info(`Add ${selectedEngine.secretName} and RECAPT_SECRET_KEY as secrets.`);
284
- }
285
- newline();
286
- success("Setup complete!");
287
- newline();
288
- print("Next steps:");
289
- print(' 1. git add . && git commit -m "Add recapt self-improvement workflow"');
290
- print(" 2. git push");
291
- print(" 3. Run manually: gh aw run self-improvement");
292
- newline();
293
- warn("Important: Enable PR creation permissions");
294
- info("The workflow needs permission to create pull requests.");
295
- info("Go to Settings → Actions → General → Workflow permissions");
296
- info('Enable "Allow GitHub Actions to create and approve pull requests"');
297
- info("(This may need to be set at the organization level)");
298
- newline();
299
- }
300
- export const setupSelfImprovementGhCommand = new Command("setup-self-improvement-gh")
301
- .description("Set up automated self-improvement workflow for GitHub Actions")
302
- .action(async () => {
303
- try {
304
- await runSetupSelfImprovementGh();
305
- }
306
- catch (err) {
307
- error(`Setup failed: ${err}`);
308
- process.exit(1);
309
- }
310
- });
@@ -1,7 +0,0 @@
1
- /**
2
- * Setup Command
3
- *
4
- * Interactive wizard to configure recapt MCP server across AI IDEs.
5
- */
6
- import { Command } from "commander";
7
- export declare const setupCommand: Command;
@@ -1,178 +0,0 @@
1
- /**
2
- * Setup Command
3
- *
4
- * Interactive wizard to configure recapt MCP server across AI IDEs.
5
- */
6
- import { Command } from "commander";
7
- import { exec } from "child_process";
8
- import { detectInstalledIdes, addRecaptToIdeConfig, } from "../utils/ide-config.js";
9
- import { confirm, secret, multiSelect, header, print, success, error, info, warn, newline, } from "../utils/prompts.js";
10
- import { installAllSkills, installSelectedSkills, getAvailableSkills, } from "./skill.js";
11
- const SETTINGS_URL = "https://dash.recapt.app/settings";
12
- const MCP_KEY_PREFIX = "mcp_sk_";
13
- function openBrowser(url) {
14
- const platform = process.platform;
15
- let command;
16
- switch (platform) {
17
- case "darwin":
18
- command = `open "${url}"`;
19
- break;
20
- case "win32":
21
- command = `start "" "${url}"`;
22
- break;
23
- default:
24
- command = `xdg-open "${url}"`;
25
- }
26
- exec(command, (err) => {
27
- if (err) {
28
- info(`Could not open browser automatically. Please visit: ${url}`);
29
- }
30
- });
31
- }
32
- function validateMcpKey(key) {
33
- return key.startsWith(MCP_KEY_PREFIX);
34
- }
35
- async function promptForKey() {
36
- const hasKey = await confirm("Do you have a Recapt MCP key?", false);
37
- if (!hasKey) {
38
- newline();
39
- info(`Opening ${SETTINGS_URL} (MCP Keys tab)...`);
40
- info("Create a new MCP key and copy it.");
41
- newline();
42
- openBrowser(SETTINGS_URL);
43
- await new Promise((resolve) => setTimeout(resolve, 2000));
44
- }
45
- const key = await secret("Paste your MCP key");
46
- if (!key) {
47
- error("No key provided.");
48
- return null;
49
- }
50
- if (!validateMcpKey(key)) {
51
- error(`Invalid MCP key format. Keys should start with "${MCP_KEY_PREFIX}".`);
52
- return null;
53
- }
54
- return key;
55
- }
56
- async function runSetup() {
57
- header("Recapt MCP Setup");
58
- const detectedIdes = detectInstalledIdes();
59
- const installedIdes = detectedIdes.filter((ide) => ide.detected);
60
- print("Detected AI IDEs:");
61
- newline();
62
- for (const ide of detectedIdes) {
63
- const marker = ide.detected ? "[x]" : "[ ]";
64
- const status = ide.detected ? `(${ide.globalPathResolved})` : "(not found)";
65
- print(` ${marker} ${ide.config.name} ${status}`);
66
- }
67
- newline();
68
- if (installedIdes.length === 0) {
69
- error("No supported AI IDEs detected.");
70
- info("Supported IDEs: Cursor, Claude Code, Windsurf, VS Code");
71
- info("Make sure at least one is installed before running setup.");
72
- process.exit(1);
73
- }
74
- const options = installedIdes.map((ide) => ({
75
- label: ide.config.name,
76
- value: ide.config,
77
- selected: true,
78
- }));
79
- const selectedIdes = await multiSelect("Which IDE(s) do you want to configure?", options);
80
- if (selectedIdes.length === 0) {
81
- info("No IDEs selected. Exiting.");
82
- return;
83
- }
84
- newline();
85
- const mcpKey = await promptForKey();
86
- if (!mcpKey) {
87
- process.exit(1);
88
- }
89
- newline();
90
- print("Writing configuration...");
91
- newline();
92
- const configuredPaths = [];
93
- for (const ide of selectedIdes) {
94
- try {
95
- const configPath = addRecaptToIdeConfig(ide, mcpKey, true);
96
- success(`${ide.name}: ${configPath}`);
97
- configuredPaths.push(configPath);
98
- }
99
- catch (err) {
100
- error(`${ide.name}: Failed to write config - ${err}`);
101
- }
102
- }
103
- if (configuredPaths.length === 0) {
104
- error("Failed to configure any IDEs.");
105
- process.exit(1);
106
- }
107
- newline();
108
- const shouldInstallSkills = await confirm("Install recapt skills?", true);
109
- if (shouldInstallSkills) {
110
- newline();
111
- let availableSkills;
112
- try {
113
- availableSkills = getAvailableSkills();
114
- }
115
- catch (err) {
116
- error(`Failed to load skills: ${err instanceof Error ? err.message : err}`);
117
- availableSkills = [];
118
- }
119
- if (availableSkills.length > 0) {
120
- const skillOptions = [
121
- { label: "Install all skills", value: "__all__", selected: true },
122
- ...availableSkills.map((skill) => ({
123
- label: `${skill.name} - ${skill.description}`,
124
- value: skill.name,
125
- selected: false,
126
- })),
127
- ];
128
- const selectedSkills = await multiSelect("Which skills do you want to install?", skillOptions);
129
- if (selectedSkills.length > 0) {
130
- newline();
131
- print("Installing skills...");
132
- newline();
133
- const cwd = process.cwd();
134
- let result;
135
- if (selectedSkills.includes("__all__")) {
136
- result = installAllSkills(cwd);
137
- }
138
- else {
139
- result = installSelectedSkills(cwd, selectedSkills);
140
- }
141
- if (result.error) {
142
- error(`Failed to load skills: ${result.error}`);
143
- }
144
- else if (result.installed.length > 0) {
145
- success(`Installed ${result.installed.length} skill(s): ${result.installed.join(", ")}`);
146
- if (result.failed.length > 0) {
147
- warn(`Failed to install: ${result.failed.join(", ")}`);
148
- }
149
- }
150
- else if (result.failed.length > 0) {
151
- error(`Failed to install skills: ${result.failed.join(", ")}`);
152
- }
153
- else {
154
- info("No skills were installed.");
155
- }
156
- }
157
- else {
158
- info("No skills selected.");
159
- }
160
- }
161
- }
162
- newline();
163
- success("Setup complete!");
164
- newline();
165
- info("Restart your IDE(s) to activate the MCP server.");
166
- newline();
167
- }
168
- export const setupCommand = new Command("setup")
169
- .description("Configure recapt MCP server for your AI IDE(s)")
170
- .action(async () => {
171
- try {
172
- await runSetup();
173
- }
174
- catch (err) {
175
- error(`Setup failed: ${err}`);
176
- process.exit(1);
177
- }
178
- });
@@ -1,24 +0,0 @@
1
- /**
2
- * Skill Command
3
- *
4
- * Manages recapt workflow skills installation to .agents/recapt/.
5
- * Works across all AI IDEs that support the AGENTS.md standard.
6
- */
7
- import { Command } from "commander";
8
- interface SkillInfo {
9
- name: string;
10
- file: string;
11
- description: string;
12
- }
13
- export type { SkillInfo };
14
- export declare function getAvailableSkills(): SkillInfo[];
15
- export declare function installSkill(cwd: string, skillName: string, force?: boolean): boolean;
16
- export interface InstallResult {
17
- success: boolean;
18
- installed: string[];
19
- failed: string[];
20
- error?: string;
21
- }
22
- export declare function installAllSkills(cwd: string, force?: boolean): InstallResult;
23
- export declare function installSelectedSkills(cwd: string, skillNames: string[], force?: boolean): InstallResult;
24
- export declare const skillCommand: Command;