botholomew 0.12.0 → 0.12.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/src/commands/mcpx.ts +32 -3
- package/src/context/capabilities.ts +1 -1
package/package.json
CHANGED
package/src/commands/mcpx.ts
CHANGED
|
@@ -4,7 +4,12 @@ import { homedir } from "node:os";
|
|
|
4
4
|
import { join } from "node:path";
|
|
5
5
|
import { fileURLToPath } from "node:url";
|
|
6
6
|
import type { Command } from "commander";
|
|
7
|
+
import { createSpinner } from "nanospinner";
|
|
8
|
+
import { loadConfig } from "../config/loader.ts";
|
|
7
9
|
import { getMcpxDir } from "../constants.ts";
|
|
10
|
+
import { writeCapabilitiesFile } from "../context/capabilities.ts";
|
|
11
|
+
import { createMcpxClient } from "../mcpx/client.ts";
|
|
12
|
+
import { registerAllTools } from "../tools/registry.ts";
|
|
8
13
|
import { logger } from "../utils/logger.ts";
|
|
9
14
|
|
|
10
15
|
const require = createRequire(import.meta.url);
|
|
@@ -137,10 +142,34 @@ export function registerMcpxCommand(program: Command) {
|
|
|
137
142
|
|
|
138
143
|
if (copied === 0) {
|
|
139
144
|
logger.warn("No config files found in ~/.mcpx to copy.");
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
145
|
+
return;
|
|
146
|
+
}
|
|
147
|
+
|
|
148
|
+
logger.success(
|
|
149
|
+
`Imported ${copied} file(s) from ~/.mcpx into ${projectMcpxDir}`,
|
|
150
|
+
);
|
|
151
|
+
|
|
152
|
+
const projectDir = getDir(program);
|
|
153
|
+
registerAllTools();
|
|
154
|
+
const config = await loadConfig(projectDir);
|
|
155
|
+
const mcpxClient = await createMcpxClient(projectDir);
|
|
156
|
+
const spinner = createSpinner("Rebuilding capabilities.md").start();
|
|
157
|
+
try {
|
|
158
|
+
const result = await writeCapabilitiesFile(
|
|
159
|
+
projectDir,
|
|
160
|
+
mcpxClient,
|
|
161
|
+
config,
|
|
162
|
+
(phase) => spinner.update({ text: phase }),
|
|
143
163
|
);
|
|
164
|
+
spinner.success({
|
|
165
|
+
text: `Rebuilt ${result.path} (${result.counts.internal} built-in, ${result.counts.mcp} MCPX)`,
|
|
166
|
+
});
|
|
167
|
+
} catch (err) {
|
|
168
|
+
spinner.error({
|
|
169
|
+
text: `Failed to rebuild capabilities.md: ${(err as Error).message}`,
|
|
170
|
+
});
|
|
171
|
+
} finally {
|
|
172
|
+
await mcpxClient?.close();
|
|
144
173
|
}
|
|
145
174
|
});
|
|
146
175
|
}
|
|
@@ -438,7 +438,7 @@ export async function generateCapabilitiesMarkdown(
|
|
|
438
438
|
config.anthropic_api_key !== "your-api-key-here";
|
|
439
439
|
if (canSummarize) {
|
|
440
440
|
onPhase?.(
|
|
441
|
-
`Summarizing ${inv.internalTotal} internal + ${inv.mcpTotal} MCPX tools
|
|
441
|
+
`Summarizing ${inv.internalTotal} internal + ${inv.mcpTotal} MCPX tools`,
|
|
442
442
|
);
|
|
443
443
|
}
|
|
444
444
|
summary = await summarizeViaLLM(inv, config);
|