agentsbestfriend 0.7.2 → 0.9.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/dist/index.js +51 -9
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -19266,7 +19266,7 @@ __export(init_exports, {
|
|
|
19266
19266
|
});
|
|
19267
19267
|
import * as clack from "@clack/prompts";
|
|
19268
19268
|
import { resolve as resolve2 } from "path";
|
|
19269
|
-
import { existsSync as existsSync5, mkdirSync as mkdirSync3 } from "fs";
|
|
19269
|
+
import { existsSync as existsSync5, mkdirSync as mkdirSync3, readFileSync as readFileSync9, appendFileSync } from "fs";
|
|
19270
19270
|
import { execFile as execFile5 } from "child_process";
|
|
19271
19271
|
import { promisify as promisify5 } from "util";
|
|
19272
19272
|
async function initCommand(projectPath) {
|
|
@@ -19284,6 +19284,22 @@ async function initCommand(projectPath) {
|
|
|
19284
19284
|
} else {
|
|
19285
19285
|
clack.log.info(`ABF directory already exists at ${abfDir}`);
|
|
19286
19286
|
}
|
|
19287
|
+
const gitignorePath = resolve2(root, ".gitignore");
|
|
19288
|
+
const gitignoreExists = existsSync5(gitignorePath);
|
|
19289
|
+
const alreadyIgnored = gitignoreExists && readFileSync9(gitignorePath, "utf-8").split("\n").some((line) => line.trim() === ".abf" || line.trim() === ".abf/");
|
|
19290
|
+
if (!alreadyIgnored) {
|
|
19291
|
+
const addToGitignore = await clack.confirm({
|
|
19292
|
+
message: "Add .abf/ to .gitignore?",
|
|
19293
|
+
initialValue: true
|
|
19294
|
+
});
|
|
19295
|
+
if (!clack.isCancel(addToGitignore) && addToGitignore) {
|
|
19296
|
+
const block = `${gitignoreExists ? "\n" : ""}# AgentsBestFriend (MCP) local index
|
|
19297
|
+
.abf/
|
|
19298
|
+
`;
|
|
19299
|
+
appendFileSync(gitignorePath, block, "utf-8");
|
|
19300
|
+
clack.log.info(".abf/ added to .gitignore");
|
|
19301
|
+
}
|
|
19302
|
+
}
|
|
19287
19303
|
const s = clack.spinner();
|
|
19288
19304
|
s.start("Running initial index...");
|
|
19289
19305
|
let stats;
|
|
@@ -19380,7 +19396,27 @@ async function initCommand(projectPath) {
|
|
|
19380
19396
|
clack.outro(isNew ? "Project initialized!" : "Index rebuilt!");
|
|
19381
19397
|
return;
|
|
19382
19398
|
}
|
|
19383
|
-
const
|
|
19399
|
+
const mcpSource = await clack.select({
|
|
19400
|
+
message: "How should agents run ABF?",
|
|
19401
|
+
options: [
|
|
19402
|
+
{
|
|
19403
|
+
value: "npx",
|
|
19404
|
+
label: "npx (recommended)",
|
|
19405
|
+
hint: "Always uses the latest version via npx agentsbestfriend start"
|
|
19406
|
+
},
|
|
19407
|
+
{
|
|
19408
|
+
value: "local",
|
|
19409
|
+
label: "Local install",
|
|
19410
|
+
hint: "Uses your locally installed abf binary"
|
|
19411
|
+
}
|
|
19412
|
+
]
|
|
19413
|
+
});
|
|
19414
|
+
if (clack.isCancel(mcpSource)) {
|
|
19415
|
+
clack.outro(isNew ? "Project initialized!" : "Index rebuilt!");
|
|
19416
|
+
return;
|
|
19417
|
+
}
|
|
19418
|
+
const mcpCommand = mcpSource === "npx" ? "npx agentsbestfriend start" : "abf start";
|
|
19419
|
+
const addMcpArgs = ["add-mcp", mcpCommand, "--name", "abf", "-y"];
|
|
19384
19420
|
for (const agent of selectedAgents) {
|
|
19385
19421
|
addMcpArgs.push("-a", agent);
|
|
19386
19422
|
}
|
|
@@ -19397,16 +19433,22 @@ async function initCommand(projectPath) {
|
|
|
19397
19433
|
timeout: 6e4
|
|
19398
19434
|
});
|
|
19399
19435
|
mcpSpinner.stop("MCP server installed successfully");
|
|
19400
|
-
|
|
19401
|
-
|
|
19436
|
+
if (mcpSource === "npx") {
|
|
19437
|
+
clack.log.info(
|
|
19438
|
+
`Agents will use ABF via "npx agentsbestfriend start" (always latest version).`
|
|
19439
|
+
);
|
|
19440
|
+
} else {
|
|
19441
|
+
clack.log.info(
|
|
19442
|
+
`Agents will use ABF via "abf start".
|
|
19402
19443
|
Make sure abf is installed globally: npm install -g agentsbestfriend`
|
|
19403
|
-
|
|
19444
|
+
);
|
|
19445
|
+
}
|
|
19404
19446
|
} catch (err) {
|
|
19405
19447
|
mcpSpinner.stop("MCP installation failed");
|
|
19406
19448
|
const msg = err instanceof Error ? err.message : String(err);
|
|
19407
19449
|
clack.log.warn(
|
|
19408
19450
|
`Could not install MCP server: ${msg}
|
|
19409
|
-
You can install manually: npx add-mcp "
|
|
19451
|
+
You can install manually: npx add-mcp "${mcpCommand}" --name abf -y`
|
|
19410
19452
|
);
|
|
19411
19453
|
}
|
|
19412
19454
|
clack.outro(isNew ? "Project initialized!" : "Index rebuilt!");
|
|
@@ -43429,7 +43471,7 @@ function registerPingTool(server) {
|
|
|
43429
43471
|
const status = {
|
|
43430
43472
|
status: "ok",
|
|
43431
43473
|
server: "agents-best-friend",
|
|
43432
|
-
version: "0.
|
|
43474
|
+
version: "0.9.0",
|
|
43433
43475
|
projectRoot,
|
|
43434
43476
|
timestamp: (/* @__PURE__ */ new Date()).toISOString()
|
|
43435
43477
|
};
|
|
@@ -45558,7 +45600,7 @@ Purely heuristic \u2014 no LLM required. Useful to understand a project's style
|
|
|
45558
45600
|
|
|
45559
45601
|
// ../server/dist/server.js
|
|
45560
45602
|
var SERVER_NAME = "agents-best-friend";
|
|
45561
|
-
var SERVER_VERSION = "0.
|
|
45603
|
+
var SERVER_VERSION = "0.9.0";
|
|
45562
45604
|
function createAbfServer() {
|
|
45563
45605
|
const server = new McpServer({
|
|
45564
45606
|
name: SERVER_NAME,
|
|
@@ -45607,7 +45649,7 @@ async function startCommand() {
|
|
|
45607
45649
|
|
|
45608
45650
|
// src/index.ts
|
|
45609
45651
|
var program = new Command();
|
|
45610
|
-
program.name("abf").description("AgentsBestFriend \u2014 AI-first code navigation and analysis tools").version("0.
|
|
45652
|
+
program.name("abf").description("AgentsBestFriend \u2014 AI-first code navigation and analysis tools").version("0.9.0");
|
|
45611
45653
|
program.command("start").description("Start the MCP server in stdio mode (for AI agent connections)").action(async () => {
|
|
45612
45654
|
await startCommand();
|
|
45613
45655
|
});
|