@recapt/mcp 0.0.15-beta → 0.0.17-beta

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.
@@ -0,0 +1,7 @@
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,7 +1,7 @@
1
1
  /**
2
- * Setup Self-Healing GitHub Command
2
+ * Setup Self-Improvement GitHub Command
3
3
  *
4
- * Interactive wizard to set up the self-healing agentic workflow for GitHub.
4
+ * Interactive wizard to set up the self-improvement agentic workflow for GitHub.
5
5
  */
6
6
  import { Command } from "commander";
7
7
  import { exec, execSync } from "child_process";
@@ -13,8 +13,8 @@ import { confirm, select, multiSelect, input, header, print, success, error, inf
13
13
  const __filename = fileURLToPath(import.meta.url);
14
14
  const __dirname = path.dirname(__filename);
15
15
  const TEMPLATES_DIR = path.resolve(__dirname, "../../../templates");
16
- const WORKFLOW_TEMPLATE = "self-healing.md";
17
- const WORKFLOW_DEST = ".github/workflows/self-healing.md";
16
+ const WORKFLOW_TEMPLATE = "self-improvement.md";
17
+ const WORKFLOW_DEST = ".github/workflows/self-improvement.md";
18
18
  const ENGINES = [
19
19
  { id: "claude", name: "Claude (Anthropic)", secretName: "ANTHROPIC_API_KEY" },
20
20
  { id: "copilot", name: "GitHub Copilot", secretName: "COPILOT_GITHUB_TOKEN" },
@@ -98,8 +98,8 @@ function openBrowser(url) {
98
98
  }
99
99
  });
100
100
  }
101
- async function runSetupSelfHealingGh() {
102
- header("Recapt Self-Healing GitHub Setup");
101
+ async function runSetupSelfImprovementGh() {
102
+ header("Recapt Self-Improvement GitHub Setup");
103
103
  const cwd = process.cwd();
104
104
  print("Checking prerequisites...");
105
105
  newline();
@@ -192,10 +192,10 @@ async function runSetupSelfHealingGh() {
192
192
  }
193
193
  }
194
194
  newline();
195
- print("Installing self-healing skill...");
196
- const skillInstalled = installSkill(cwd, "self-healing");
195
+ print("Installing self-improvement skill...");
196
+ const skillInstalled = installSkill(cwd, "self-improvement", true);
197
197
  if (!skillInstalled) {
198
- error("Failed to install self-healing skill");
198
+ error("Failed to install self-improvement skill");
199
199
  process.exit(1);
200
200
  }
201
201
  newline();
@@ -259,7 +259,7 @@ Analyze and fix issues across all domains configured in recapt. Call \`get_domai
259
259
  print("Compiling workflow...");
260
260
  try {
261
261
  execSync("gh aw compile", { cwd, stdio: "inherit" });
262
- success("Created: .github/workflows/self-healing.lock.yml");
262
+ success("Created: .github/workflows/self-improvement.lock.yml");
263
263
  }
264
264
  catch {
265
265
  warn("Failed to compile workflow. You can run 'gh aw compile' manually.");
@@ -286,9 +286,9 @@ Analyze and fix issues across all domains configured in recapt. Call \`get_domai
286
286
  success("Setup complete!");
287
287
  newline();
288
288
  print("Next steps:");
289
- print(' 1. git add . && git commit -m "Add recapt self-healing workflow"');
289
+ print(' 1. git add . && git commit -m "Add recapt self-improvement workflow"');
290
290
  print(" 2. git push");
291
- print(" 3. Run manually: gh aw run self-healing");
291
+ print(" 3. Run manually: gh aw run self-improvement");
292
292
  newline();
293
293
  warn("Important: Enable PR creation permissions");
294
294
  info("The workflow needs permission to create pull requests.");
@@ -297,11 +297,11 @@ Analyze and fix issues across all domains configured in recapt. Call \`get_domai
297
297
  info("(This may need to be set at the organization level)");
298
298
  newline();
299
299
  }
300
- export const setupSelfHealingGhCommand = new Command("setup-self-healing-gh")
301
- .description("Set up automated self-healing workflow for GitHub Actions")
300
+ export const setupSelfImprovementGhCommand = new Command("setup-self-improvement-gh")
301
+ .description("Set up automated self-improvement workflow for GitHub Actions")
302
302
  .action(async () => {
303
303
  try {
304
- await runSetupSelfHealingGh();
304
+ await runSetupSelfImprovementGh();
305
305
  }
306
306
  catch (err) {
307
307
  error(`Setup failed: ${err}`);
@@ -12,13 +12,13 @@ interface SkillInfo {
12
12
  }
13
13
  export type { SkillInfo };
14
14
  export declare function getAvailableSkills(): SkillInfo[];
15
- export declare function installSkill(cwd: string, skillName: string): boolean;
15
+ export declare function installSkill(cwd: string, skillName: string, force?: boolean): boolean;
16
16
  export interface InstallResult {
17
17
  success: boolean;
18
18
  installed: string[];
19
19
  failed: string[];
20
20
  error?: string;
21
21
  }
22
- export declare function installAllSkills(cwd: string): InstallResult;
23
- export declare function installSelectedSkills(cwd: string, skillNames: string[]): InstallResult;
22
+ export declare function installAllSkills(cwd: string, force?: boolean): InstallResult;
23
+ export declare function installSelectedSkills(cwd: string, skillNames: string[], force?: boolean): InstallResult;
24
24
  export declare const skillCommand: Command;
@@ -115,7 +115,7 @@ ${MARKER_END}`;
115
115
  }
116
116
  writeAgentsMd(cwd, content + "\n");
117
117
  }
118
- export function installSkill(cwd, skillName) {
118
+ export function installSkill(cwd, skillName, force = false) {
119
119
  let skills;
120
120
  try {
121
121
  skills = getAvailableSkills();
@@ -134,11 +134,23 @@ export function installSkill(cwd, skillName) {
134
134
  const sourcePath = path.join(SKILLS_DIR, skill.file);
135
135
  const destPath = path.join(cwd, AGENTS_DIR, skill.file);
136
136
  if (fs.existsSync(destPath)) {
137
- console.log(`Skill already installed: ${skillName}`);
138
- return true;
137
+ const sourceContent = fs.readFileSync(sourcePath, "utf-8");
138
+ const destContent = fs.readFileSync(destPath, "utf-8");
139
+ if (sourceContent === destContent) {
140
+ console.log(`Skill already up to date: ${skillName}`);
141
+ return true;
142
+ }
143
+ if (!force) {
144
+ console.log(`Skill outdated: ${skillName} (use --force to update)`);
145
+ return true;
146
+ }
147
+ fs.copyFileSync(sourcePath, destPath);
148
+ console.log(`Updated: ${skillName} → ${AGENTS_DIR}/${skill.file}`);
149
+ }
150
+ else {
151
+ fs.copyFileSync(sourcePath, destPath);
152
+ console.log(`Installed: ${skillName} → ${AGENTS_DIR}/${skill.file}`);
139
153
  }
140
- fs.copyFileSync(sourcePath, destPath);
141
- console.log(`Installed: ${skillName} → ${AGENTS_DIR}/${skill.file}`);
142
154
  updateAgentsMdReferences(cwd);
143
155
  return true;
144
156
  }
@@ -180,7 +192,7 @@ function listSkills(cwd) {
180
192
  }
181
193
  console.log();
182
194
  }
183
- export function installAllSkills(cwd) {
195
+ export function installAllSkills(cwd, force = false) {
184
196
  let skills;
185
197
  try {
186
198
  skills = getAvailableSkills();
@@ -190,14 +202,14 @@ export function installAllSkills(cwd) {
190
202
  console.error(`Failed to load skills: ${message}`);
191
203
  return { success: false, installed: [], failed: [], error: message };
192
204
  }
193
- return installSelectedSkills(cwd, skills.map((s) => s.name));
205
+ return installSelectedSkills(cwd, skills.map((s) => s.name), force);
194
206
  }
195
- export function installSelectedSkills(cwd, skillNames) {
207
+ export function installSelectedSkills(cwd, skillNames, force = false) {
196
208
  const installed = [];
197
209
  const failed = [];
198
210
  for (const skillName of skillNames) {
199
211
  try {
200
- if (installSkill(cwd, skillName)) {
212
+ if (installSkill(cwd, skillName, force)) {
201
213
  installed.push(skillName);
202
214
  }
203
215
  else {
@@ -224,17 +236,18 @@ const installCommand = new Command("install")
224
236
  .description("Install a skill")
225
237
  .argument("[name]", "Skill name to install")
226
238
  .option("-a, --all", "Install all skills")
239
+ .option("-f, --force", "Force update if skill already exists")
227
240
  .action((name, options) => {
228
241
  const cwd = process.cwd();
229
242
  if (options.all) {
230
- installAllSkills(cwd);
243
+ installAllSkills(cwd, options.force);
231
244
  return;
232
245
  }
233
246
  if (!name) {
234
247
  console.error("Usage: recapt skill install <name> or recapt skill install --all");
235
248
  process.exit(1);
236
249
  }
237
- if (installSkill(cwd, name)) {
250
+ if (installSkill(cwd, name, options.force)) {
238
251
  console.log(`\nSkill reference added to ${AGENTS_MD}`);
239
252
  }
240
253
  });
@@ -5,8 +5,8 @@
5
5
  * Unified command-line interface for recapt MCP server management.
6
6
  *
7
7
  * Commands:
8
- * setup - Configure recapt MCP server for your AI IDE(s)
9
- * setup-self-healing-gh - Set up automated self-healing workflow for GitHub
10
- * skill - Manage recapt workflow skills
8
+ * setup - Configure recapt MCP server for your AI IDE(s)
9
+ * setup-self-improvement-gh - Set up automated self-improvement workflow for GitHub
10
+ * skill - Manage recapt workflow skills
11
11
  */
12
12
  export {};
package/dist/cli/index.js CHANGED
@@ -5,15 +5,15 @@
5
5
  * Unified command-line interface for recapt MCP server management.
6
6
  *
7
7
  * Commands:
8
- * setup - Configure recapt MCP server for your AI IDE(s)
9
- * setup-self-healing-gh - Set up automated self-healing workflow for GitHub
10
- * skill - Manage recapt workflow skills
8
+ * setup - Configure recapt MCP server for your AI IDE(s)
9
+ * setup-self-improvement-gh - Set up automated self-improvement workflow for GitHub
10
+ * skill - Manage recapt workflow skills
11
11
  */
12
12
  import { Command } from "commander";
13
13
  import { createRequire } from "module";
14
14
  import { skillCommand } from "./commands/skill.js";
15
15
  import { setupCommand } from "./commands/setup.js";
16
- import { setupSelfHealingGhCommand } from "./commands/setup-self-healing-gh.js";
16
+ import { setupSelfImprovementGhCommand } from "./commands/setup-self-improvement-gh.js";
17
17
  const require = createRequire(import.meta.url);
18
18
  const pkg = require("../../package.json");
19
19
  const program = new Command();
@@ -22,6 +22,6 @@ program
22
22
  .description("Recapt MCP CLI - Configure and manage recapt for AI IDEs")
23
23
  .version(pkg.version);
24
24
  program.addCommand(setupCommand);
25
- program.addCommand(setupSelfHealingGhCommand);
25
+ program.addCommand(setupSelfImprovementGhCommand);
26
26
  program.addCommand(skillCommand);
27
27
  program.parse();
@@ -17,10 +17,11 @@ export async function input(message, defaultValue) {
17
17
  });
18
18
  }
19
19
  export async function secret(message) {
20
- return inquirerPassword({
20
+ const value = await inquirerPassword({
21
21
  message,
22
22
  mask: "*",
23
23
  });
24
+ return value.trim();
24
25
  }
25
26
  export async function multiSelect(message, options) {
26
27
  return inquirerCheckbox({
package/dist/index.d.ts CHANGED
@@ -10,7 +10,7 @@
10
10
  * - search_tools: Discover tools by intent
11
11
  * - call_tool: Execute discovered tools
12
12
  * - get_domains: List tracked domains
13
- * - run_full_diagnostic: Self-healing entry point
13
+ * - run_full_diagnostic: Self-improvement entry point
14
14
  * - triage_sessions: Find sessions needing attention
15
15
  * - memory_save, memory_recall, memory_list, memory_delete, memory_clear
16
16
  *
package/dist/index.js CHANGED
@@ -10,7 +10,7 @@
10
10
  * - search_tools: Discover tools by intent
11
11
  * - call_tool: Execute discovered tools
12
12
  * - get_domains: List tracked domains
13
- * - run_full_diagnostic: Self-healing entry point
13
+ * - run_full_diagnostic: Self-improvement entry point
14
14
  * - triage_sessions: Find sessions needing attention
15
15
  * - memory_save, memory_recall, memory_list, memory_delete, memory_clear
16
16
  *
@@ -204,12 +204,12 @@ function registerHiddenTools() {
204
204
  })));
205
205
  registerToolHandler("delete_site_knowledge", createApiHandler("DELETE", (args) => `/knowledge/${args.knowledge_id}`));
206
206
  registerToolHandler("get_similar_fixes", createApiHandler("GET", "/knowledge/similar-fixes"));
207
- // Healing Runs (workflow tracking)
208
- registerToolHandler("start_healing_run", createApiHandler("POST", "/healing-runs"));
209
- registerToolHandler("update_healing_run", createApiHandler("PATCH", (args) => `/healing-runs/${args.run_id}`));
210
- registerToolHandler("record_healing_action", createApiHandler("POST", (args) => `/healing-runs/${args.run_id}/actions`));
211
- registerToolHandler("get_healing_run", createApiHandler("GET", (args) => `/healing-runs/${args.run_id}`));
212
- registerToolHandler("list_healing_runs", createApiHandler("GET", "/healing-runs"));
207
+ // Improvement Runs (workflow tracking)
208
+ registerToolHandler("start_improvement_run", createApiHandler("POST", "/improvement-runs"));
209
+ registerToolHandler("update_improvement_run", createApiHandler("PATCH", (args) => `/improvement-runs/${args.run_id}`));
210
+ registerToolHandler("record_improvement_action", createApiHandler("POST", (args) => `/improvement-runs/${args.run_id}/actions`));
211
+ registerToolHandler("get_improvement_run", createApiHandler("GET", (args) => `/improvement-runs/${args.run_id}`));
212
+ registerToolHandler("list_improvement_runs", createApiHandler("GET", "/improvement-runs"));
213
213
  }
214
214
  // ─────────────────────────────────────────────────────────────────────────────
215
215
  // Server Instructions
@@ -298,10 +298,10 @@ Some tools have built-in limits for performance:
298
298
 
299
299
  ## Installable Skills
300
300
 
301
- For guided workflows (self-healing, deep-dive analysis, regression hunting), install recapt skills:
301
+ For guided workflows (self-improvement, deep-dive analysis, regression hunting), install recapt skills:
302
302
  \`\`\`bash
303
303
  npx @recapt/mcp skill list
304
- npx @recapt/mcp skill install self-healing
304
+ npx @recapt/mcp skill install self-improvement
305
305
  \`\`\`
306
306
  Skills provide step-by-step guidance for complex multi-tool workflows.`;
307
307
  // ─────────────────────────────────────────────────────────────────────────────