agentsbestfriend 0.4.0 → 0.5.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 CHANGED
@@ -19287,8 +19287,8 @@ async function initCommand(projectPath) {
19287
19287
  llmSpinner.stop(
19288
19288
  `Summaries: ${sumStats.generated} generated, ${sumStats.skipped} skipped (${sumStats.durationMs}ms)`
19289
19289
  );
19290
- } catch {
19291
- llmSpinner.stop("Summary generation failed (Ollama error)");
19290
+ } catch (err) {
19291
+ llmSpinner.stop(`Summary generation failed: ${err.message ?? err}`);
19292
19292
  }
19293
19293
  const embSpinner = clack.spinner();
19294
19294
  embSpinner.start("Generating embeddings...");
@@ -19297,8 +19297,11 @@ async function initCommand(projectPath) {
19297
19297
  embSpinner.stop(
19298
19298
  `Embeddings: ${embStats.generated} generated, ${embStats.skipped} skipped (${embStats.durationMs}ms)`
19299
19299
  );
19300
- } catch {
19301
- embSpinner.stop("Embedding generation failed (Ollama error)");
19300
+ } catch (err) {
19301
+ embSpinner.stop(`Embedding generation failed: ${err.message ?? err}`);
19302
+ clack.log.warn(
19303
+ "Make sure the embedding model is pulled: ollama pull nomic-embed-text"
19304
+ );
19302
19305
  }
19303
19306
  } else {
19304
19307
  clack.log.info(
@@ -19594,8 +19597,8 @@ async function reindex() {
19594
19597
  llmSpinner.stop(
19595
19598
  `Summaries: ${sumStats.generated} generated, ${sumStats.skipped} skipped (${sumStats.durationMs}ms)`
19596
19599
  );
19597
- } catch {
19598
- llmSpinner.stop("Summary generation failed");
19600
+ } catch (err) {
19601
+ llmSpinner.stop(`Summary generation failed: ${err.message ?? err}`);
19599
19602
  }
19600
19603
  const embSpinner = clack3.spinner();
19601
19604
  embSpinner.start("Generating embeddings...");
@@ -19604,8 +19607,11 @@ async function reindex() {
19604
19607
  embSpinner.stop(
19605
19608
  `Embeddings: ${embStats.generated} generated, ${embStats.skipped} skipped (${embStats.durationMs}ms)`
19606
19609
  );
19607
- } catch {
19608
- embSpinner.stop("Embedding generation failed");
19610
+ } catch (err) {
19611
+ embSpinner.stop(`Embedding generation failed: ${err.message ?? err}`);
19612
+ clack3.log.warn(
19613
+ "Make sure the embedding model is pulled: ollama pull nomic-embed-text"
19614
+ );
19609
19615
  }
19610
19616
  } else {
19611
19617
  clack3.log.info("LLM enrichment skipped (Ollama not available).");
@@ -43384,7 +43390,7 @@ function registerPingTool(server) {
43384
43390
  const status = {
43385
43391
  status: "ok",
43386
43392
  server: "agents-best-friend",
43387
- version: "0.4.0",
43393
+ version: "0.5.0",
43388
43394
  projectRoot,
43389
43395
  timestamp: (/* @__PURE__ */ new Date()).toISOString()
43390
43396
  };
@@ -45365,17 +45371,21 @@ init_drizzle_orm();
45365
45371
  // ../server/dist/tools/file-summary.js
45366
45372
  function registerFileSummaryTool(server) {
45367
45373
  server.tool("abf_file_summary", `Search across LLM-generated file summaries using full-text search.
45368
- Returns files whose summaries match the query, ranked by relevance.
45374
+ Returns files whose summaries match the query, ranked by relevance (BM25).
45369
45375
  Useful when exploring a codebase by concept rather than exact code text.
45370
- Requires summaries to be generated first (run abf_index with summarize=true, or abf enrichment).`, {
45371
- query: external_exports3.string().describe("Search query \u2014 keywords to match against file summaries (FTS5 syntax supported)"),
45376
+ Default mode is "or" \u2014 matches files containing ANY of the query terms, ranked by how many match.
45377
+ Use "and" mode to require ALL terms to be present.
45378
+ Requires summaries to be generated first (run abf_index with action=summarize).`, {
45379
+ query: external_exports3.string().describe("Search query \u2014 space-separated keywords to match against file summaries"),
45380
+ match_mode: external_exports3.enum(["or", "and"]).optional().default("or").describe('"or": match files with ANY keyword (default, broader results). "and": require ALL keywords.'),
45372
45381
  max_results: external_exports3.number().int().positive().optional().default(10).describe("Maximum number of results (default: 10)"),
45373
45382
  path_filter: external_exports3.string().optional().describe('Optional prefix filter for file paths, e.g. "src/" or "packages/core"')
45374
- }, async ({ query, max_results, path_filter }) => {
45383
+ }, async ({ query, match_mode, max_results, path_filter }) => {
45375
45384
  const projectRoot = process.env.ABF_PROJECT_ROOT || process.cwd();
45376
45385
  try {
45377
45386
  const db = createProjectDb(projectRoot);
45378
45387
  try {
45388
+ const ftsQuery = match_mode === "and" ? query : query.split(/\s+/).filter(Boolean).join(" OR ");
45379
45389
  let sqlQuery = sql`
45380
45390
  SELECT
45381
45391
  f.path,
@@ -45385,7 +45395,7 @@ Requires summaries to be generated first (run abf_index with summarize=true, or
45385
45395
  bm25(files_fts) AS rank
45386
45396
  FROM files_fts
45387
45397
  JOIN files f ON files_fts.rowid = f.id
45388
- WHERE files_fts MATCH ${query}
45398
+ WHERE files_fts MATCH ${ftsQuery}
45389
45399
  `;
45390
45400
  if (path_filter) {
45391
45401
  sqlQuery = sql`
@@ -45397,7 +45407,7 @@ Requires summaries to be generated first (run abf_index with summarize=true, or
45397
45407
  bm25(files_fts) AS rank
45398
45408
  FROM files_fts
45399
45409
  JOIN files f ON files_fts.rowid = f.id
45400
- WHERE files_fts MATCH ${query}
45410
+ WHERE files_fts MATCH ${ftsQuery}
45401
45411
  AND f.path LIKE ${path_filter + "%"}
45402
45412
  `;
45403
45413
  }
@@ -45509,7 +45519,7 @@ Purely heuristic \u2014 no LLM required. Useful to understand a project's style
45509
45519
 
45510
45520
  // ../server/dist/server.js
45511
45521
  var SERVER_NAME = "agents-best-friend";
45512
- var SERVER_VERSION = "0.4.0";
45522
+ var SERVER_VERSION = "0.5.0";
45513
45523
  function createAbfServer() {
45514
45524
  const server = new McpServer({
45515
45525
  name: SERVER_NAME,
@@ -45558,7 +45568,7 @@ async function startCommand() {
45558
45568
 
45559
45569
  // src/index.ts
45560
45570
  var program = new Command();
45561
- program.name("abf").description("AgentsBestFriend \u2014 AI-first code navigation and analysis tools").version("0.4.0");
45571
+ program.name("abf").description("AgentsBestFriend \u2014 AI-first code navigation and analysis tools").version("0.5.0");
45562
45572
  program.command("start").description("Start the MCP server in stdio mode (for AI agent connections)").action(async () => {
45563
45573
  await startCommand();
45564
45574
  });