@prosdevlab/dev-agent 0.10.0 → 0.10.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/README.md CHANGED
@@ -27,8 +27,6 @@ dev mcp install # For Claude Code
27
27
  ## Features
28
28
 
29
29
  - 🔍 **Semantic Code Search** - Natural language queries across your codebase
30
- - 🐙 **GitHub Integration** - Search issues/PRs with semantic understanding
31
- - 📋 **Implementation Planning** - Generate plans from GitHub issues with code context
32
30
  - 🔎 **Code Exploration** - Discover patterns, find similar code, analyze relationships
33
31
  - 💚 **Health Monitoring** - Check component status and system health
34
32
  - 📊 **Repository Status** - View indexing progress and statistics
@@ -38,16 +36,15 @@ dev mcp install # For Claude Code
38
36
  When integrated with Cursor or Claude Code, you get 6 powerful tools:
39
37
 
40
38
  - `dev_search` - Semantic code search
39
+ - `dev_refs` - Find callers/callees of functions
40
+ - `dev_map` - Codebase structure with change frequency
41
+ - `dev_patterns` - File analysis and pattern checking
41
42
  - `dev_status` - Repository status and health
42
- - `dev_inspect` - File analysis and pattern checking
43
- - `dev_plan` - Implementation planning from issues
44
- - `dev_gh` - GitHub issue/PR search
45
43
  - `dev_health` - Component health checks
46
44
 
47
45
  ## Requirements
48
46
 
49
47
  - Node.js >= 22 (LTS)
50
- - For GitHub integration: [GitHub CLI](https://cli.github.com/)
51
48
 
52
49
  ## Production Features
53
50
 
@@ -86,8 +83,8 @@ dev <command> --help # Help for specific command
86
83
  ## How It Works
87
84
 
88
85
  1. **Index** - Scans your TypeScript/JavaScript codebase and builds semantic vectors
89
- 2. **Search** - Uses local embeddings (all-MiniLM-L6-v2) for semantic understanding
90
- 3. **Store** - LanceDB vector storage, all data stays on your machine
86
+ 2. **Search** - Uses local embeddings (BAAI/bge-small-en-v1.5) for semantic understanding
87
+ 3. **Store** - Antfly hybrid search (BM25 + vector), all data stays on your machine
91
88
  4. **Integrate** - MCP protocol connects to Cursor/Claude Code
92
89
  5. **Query** - AI tools can now understand your codebase semantically
93
90
 
@@ -102,8 +99,8 @@ All processing happens on your machine:
102
99
  ## Technology
103
100
 
104
101
  - **Analysis:** TypeScript Compiler API + ts-morph
105
- - **Embeddings:** @xenova/transformers (all-MiniLM-L6-v2)
106
- - **Vector Storage:** LanceDB
102
+ - **Embeddings:** Antfly Termite (ONNX, BAAI/bge-small-en-v1.5)
103
+ - **Vector Storage:** Antfly (hybrid search: BM25 + vector + RRF)
107
104
  - **GitHub:** GitHub CLI for local metadata
108
105
  - **Protocol:** Model Context Protocol (MCP)
109
106
 
@@ -113,14 +110,8 @@ All processing happens on your machine:
113
110
  # Find authentication-related code
114
111
  dev_search: "JWT token validation middleware"
115
112
 
116
- # Plan implementation from GitHub issue
117
- dev_plan: issue #42
118
-
119
113
  # Find similar code patterns
120
- dev_inspect: { action: "compare", query: "src/auth/middleware.ts" }
121
-
122
- # Search GitHub issues semantically
123
- dev_gh: search "memory leak in vector storage"
114
+ dev_patterns: { action: "compare", query: "src/auth/middleware.ts" }
124
115
 
125
116
  # Check system health
126
117
  dev_health: verbose
package/dist/cli.js CHANGED
@@ -47061,10 +47061,7 @@ var require_config = __commonJS({
47061
47061
  search: { enabled: true },
47062
47062
  refs: { enabled: true },
47063
47063
  map: { enabled: true },
47064
- history: { enabled: true },
47065
- plan: { enabled: true },
47066
- explore: { enabled: true },
47067
- github: { enabled: true },
47064
+ inspect: { enabled: true },
47068
47065
  status: { enabled: true },
47069
47066
  health: { enabled: true }
47070
47067
  }
@@ -50164,166 +50161,6 @@ var require_compact = __commonJS({
50164
50161
  }
50165
50162
  });
50166
50163
 
50167
- // ../cli/dist/commands/explore.js
50168
- var require_explore = __commonJS({
50169
- "../cli/dist/commands/explore.js"(exports2) {
50170
- "use strict";
50171
- var __createBinding = exports2 && exports2.__createBinding || (Object.create ? (function(o, m, k, k2) {
50172
- if (k2 === void 0) k2 = k;
50173
- var desc = Object.getOwnPropertyDescriptor(m, k);
50174
- if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
50175
- desc = { enumerable: true, get: function() {
50176
- return m[k];
50177
- } };
50178
- }
50179
- Object.defineProperty(o, k2, desc);
50180
- }) : (function(o, m, k, k2) {
50181
- if (k2 === void 0) k2 = k;
50182
- o[k2] = m[k];
50183
- }));
50184
- var __setModuleDefault = exports2 && exports2.__setModuleDefault || (Object.create ? (function(o, v) {
50185
- Object.defineProperty(o, "default", { enumerable: true, value: v });
50186
- }) : function(o, v) {
50187
- o["default"] = v;
50188
- });
50189
- var __importStar = exports2 && exports2.__importStar || /* @__PURE__ */ (function() {
50190
- var ownKeys = function(o) {
50191
- ownKeys = Object.getOwnPropertyNames || function(o2) {
50192
- var ar = [];
50193
- for (var k in o2) if (Object.prototype.hasOwnProperty.call(o2, k)) ar[ar.length] = k;
50194
- return ar;
50195
- };
50196
- return ownKeys(o);
50197
- };
50198
- return function(mod) {
50199
- if (mod && mod.__esModule) return mod;
50200
- var result = {};
50201
- if (mod != null) {
50202
- for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
50203
- }
50204
- __setModuleDefault(result, mod);
50205
- return result;
50206
- };
50207
- })();
50208
- var __importDefault2 = exports2 && exports2.__importDefault || function(mod) {
50209
- return mod && mod.__esModule ? mod : { "default": mod };
50210
- };
50211
- Object.defineProperty(exports2, "__esModule", { value: true });
50212
- exports2.exploreCommand = void 0;
50213
- var path15 = __importStar(require("path"));
50214
- var dev_agent_core_1 = (init_src3(), __toCommonJS(src_exports3));
50215
- var chalk_12 = __importDefault2((init_source(), __toCommonJS(source_exports)));
50216
- var commander_12 = require_commander();
50217
- var ora_1 = __importDefault2((init_ora(), __toCommonJS(ora_exports)));
50218
- var config_js_1 = require_config();
50219
- var logger_js_1 = require_logger();
50220
- var explore = new commander_12.Command("explore").description("\u{1F50D} Explore and analyze code patterns");
50221
- exports2.exploreCommand = explore;
50222
- explore.command("pattern").description("Search for code patterns using semantic search").argument("<query>", "Pattern to search for").option("-l, --limit <number>", "Number of results", "10").option("-t, --threshold <number>", "Similarity threshold (0-1)", "0.7").action(async (query, options) => {
50223
- const spinner = (0, ora_1.default)("Searching for patterns...").start();
50224
- try {
50225
- const config2 = await (0, config_js_1.loadConfig)();
50226
- const repositoryPath = config2?.repository?.path || config2?.repositoryPath || process.cwd();
50227
- const resolvedRepoPath = path15.resolve(repositoryPath);
50228
- const storagePath = await (0, dev_agent_core_1.getStoragePath)(resolvedRepoPath);
50229
- await (0, dev_agent_core_1.ensureStorageDirectory)(storagePath);
50230
- const filePaths = (0, dev_agent_core_1.getStorageFilePaths)(storagePath);
50231
- const indexer = new dev_agent_core_1.RepositoryIndexer({
50232
- repositoryPath: resolvedRepoPath,
50233
- vectorStorePath: filePaths.vectors,
50234
- excludePatterns: config2?.repository?.excludePatterns || config2?.excludePatterns,
50235
- languages: config2?.repository?.languages || config2?.languages
50236
- });
50237
- await indexer.initialize();
50238
- spinner.text = `Searching: "${query}"`;
50239
- const results = await indexer.search(query, {
50240
- limit: Number.parseInt(options.limit, 10),
50241
- scoreThreshold: Number.parseFloat(options.threshold)
50242
- });
50243
- spinner.succeed(`Found ${results.length} results`);
50244
- if (results.length === 0) {
50245
- logger_js_1.logger.warn("No patterns found");
50246
- await indexer.close();
50247
- return;
50248
- }
50249
- console.log(chalk_12.default.cyan(`
50250
- \u{1F4CA} Pattern Results for: "${query}"
50251
- `));
50252
- for (const [i, result] of results.entries()) {
50253
- const meta3 = result.metadata;
50254
- console.log(chalk_12.default.white(`${i + 1}. ${meta3.name || meta3.type}`));
50255
- console.log(chalk_12.default.gray(` ${meta3.path}${meta3.startLine ? `:${meta3.startLine}` : ""}`));
50256
- console.log(chalk_12.default.green(` ${(result.score * 100).toFixed(1)}% match
50257
- `));
50258
- }
50259
- await indexer.close();
50260
- } catch (error47) {
50261
- spinner.fail("Pattern search failed");
50262
- logger_js_1.logger.error(error47.message);
50263
- process.exit(1);
50264
- }
50265
- });
50266
- explore.command("similar").description("Find code similar to a file").argument("<file>", "File path").option("-l, --limit <number>", "Number of results", "5").option("-t, --threshold <number>", "Similarity threshold (0-1)", "0.5").action(async (file2, options) => {
50267
- const spinner = (0, ora_1.default)("Finding similar code...").start();
50268
- try {
50269
- const config2 = await (0, config_js_1.loadConfig)();
50270
- const repositoryPath = config2?.repository?.path || config2?.repositoryPath || process.cwd();
50271
- const resolvedRepoPath = path15.resolve(repositoryPath);
50272
- const storagePath = await (0, dev_agent_core_1.getStoragePath)(resolvedRepoPath);
50273
- await (0, dev_agent_core_1.ensureStorageDirectory)(storagePath);
50274
- const filePaths = (0, dev_agent_core_1.getStorageFilePaths)(storagePath);
50275
- spinner.text = "Reading file content...";
50276
- const { prepareFileForSearch } = await Promise.resolve().then(() => __toESM(require_file()));
50277
- let fileInfo;
50278
- try {
50279
- fileInfo = await prepareFileForSearch(resolvedRepoPath, file2);
50280
- } catch (error47) {
50281
- spinner.fail(error47.message);
50282
- process.exit(1);
50283
- return;
50284
- }
50285
- const indexer = new dev_agent_core_1.RepositoryIndexer({
50286
- repositoryPath: resolvedRepoPath,
50287
- vectorStorePath: filePaths.vectors,
50288
- excludePatterns: config2?.repository?.excludePatterns || config2?.excludePatterns,
50289
- languages: config2?.repository?.languages || config2?.languages
50290
- });
50291
- await indexer.initialize();
50292
- spinner.text = "Searching for similar code...";
50293
- const results = await indexer.search(fileInfo.content, {
50294
- limit: Number.parseInt(options.limit, 10) + 1,
50295
- scoreThreshold: Number.parseFloat(options.threshold)
50296
- });
50297
- const similar = results.filter((r) => {
50298
- const meta3 = r.metadata;
50299
- return meta3.path !== fileInfo.relativePath;
50300
- }).slice(0, Number.parseInt(options.limit, 10));
50301
- spinner.succeed(`Found ${similar.length} similar files`);
50302
- if (similar.length === 0) {
50303
- logger_js_1.logger.warn("No similar code found");
50304
- await indexer.close();
50305
- return;
50306
- }
50307
- console.log(chalk_12.default.cyan(`
50308
- \u{1F50D} Similar Code to: ${file2}
50309
- `));
50310
- for (const [i, result] of similar.entries()) {
50311
- const meta3 = result.metadata;
50312
- console.log(chalk_12.default.white(`${i + 1}. ${meta3.name || meta3.type}`));
50313
- console.log(chalk_12.default.gray(` ${meta3.path}${meta3.startLine ? `:${meta3.startLine}` : ""}`));
50314
- console.log(chalk_12.default.green(` ${(result.score * 100).toFixed(1)}% similar
50315
- `));
50316
- }
50317
- await indexer.close();
50318
- } catch (error47) {
50319
- spinner.fail("Similar code search failed");
50320
- logger_js_1.logger.error(error47.message);
50321
- process.exit(1);
50322
- }
50323
- });
50324
- }
50325
- });
50326
-
50327
50164
  // ../cli/dist/utils/antfly.js
50328
50165
  var require_antfly = __commonJS({
50329
50166
  "../cli/dist/utils/antfly.js"(exports2) {
@@ -66430,7 +66267,6 @@ var require_schemas3 = __commonJS({
66430
66267
  exports2.InspectArgsSchema = zod_1.z.object({
66431
66268
  query: zod_1.z.string().min(1, "Query must be a non-empty string (file path)"),
66432
66269
  limit: zod_1.z.number().int().min(1).max(50).default(10),
66433
- threshold: zod_1.z.number().min(0).max(1).default(0.7),
66434
66270
  format: exports2.FormatSchema.default("compact")
66435
66271
  }).strict();
66436
66272
  exports2.SearchArgsSchema = zod_1.z.object({
@@ -66918,14 +66754,14 @@ var require_inspect_adapter = __commonJS({
66918
66754
  }
66919
66755
  getToolDefinition() {
66920
66756
  return {
66921
- name: "dev_inspect",
66922
- description: "Inspect a file for pattern analysis. Finds similar code and compares patterns (error handling, naming, types, structure). Returns facts about how this file compares to similar code, without making judgments.",
66757
+ name: "dev_patterns",
66758
+ description: "Analyze coding patterns in a file against the codebase. Compares import style, error handling, type coverage, test coverage, and file size against similar files. Use for code reviews and consistency checks.",
66923
66759
  inputSchema: {
66924
66760
  type: "object",
66925
66761
  properties: {
66926
66762
  query: {
66927
66763
  type: "string",
66928
- description: 'File path to inspect (e.g., "src/auth/middleware.ts")'
66764
+ description: 'File path to analyze (e.g., "src/auth/middleware.ts")'
66929
66765
  },
66930
66766
  limit: {
66931
66767
  type: "number",
@@ -66934,13 +66770,6 @@ var require_inspect_adapter = __commonJS({
66934
66770
  minimum: 1,
66935
66771
  maximum: 50
66936
66772
  },
66937
- threshold: {
66938
- type: "number",
66939
- description: `Similarity threshold 0-1 (default: ${this.defaultThreshold})`,
66940
- default: this.defaultThreshold,
66941
- minimum: 0,
66942
- maximum: 1
66943
- },
66944
66773
  format: {
66945
66774
  type: "string",
66946
66775
  enum: ["compact", "verbose"],
@@ -66957,15 +66786,20 @@ var require_inspect_adapter = __commonJS({
66957
66786
  if (!validation.success) {
66958
66787
  return validation.error;
66959
66788
  }
66960
- const { query, limit, threshold, format: format2 } = validation.data;
66789
+ const { query, limit, format: format2 } = validation.data;
66961
66790
  try {
66962
- context.logger.debug("Executing file inspection", {
66791
+ context.logger.debug("Executing pattern analysis", {
66963
66792
  query,
66964
66793
  limit,
66965
- threshold,
66966
66794
  format: format2
66967
66795
  });
66968
- const { content: content3, similarFilesCount, patternsAnalyzed } = await this.inspectFile(query, limit, threshold, format2);
66796
+ const { content: content3, similarFilesCount, patternsAnalyzed } = await this.inspectFile(
66797
+ query,
66798
+ limit,
66799
+ 0,
66800
+ // No threshold — let the pattern service decide relevance
66801
+ format2
66802
+ );
66969
66803
  context.logger.info("File inspection completed", {
66970
66804
  query,
66971
66805
  similarFilesCount,
@@ -68732,39 +68566,6 @@ var require_prompts = __commonJS({
68732
68566
  * Register default prompts that ship with dev-agent
68733
68567
  */
68734
68568
  registerDefaultPrompts() {
68735
- this.register({
68736
- name: "analyze-issue",
68737
- description: "Analyze a GitHub issue and create an implementation plan",
68738
- arguments: [
68739
- {
68740
- name: "issue_number",
68741
- description: "GitHub issue number to analyze",
68742
- required: true
68743
- },
68744
- {
68745
- name: "detail_level",
68746
- description: "Level of detail for the plan (simple or detailed)",
68747
- required: false
68748
- }
68749
- ]
68750
- }, (args) => ({
68751
- description: `Analyze GitHub issue #${args.issue_number} and create implementation plan`,
68752
- messages: [
68753
- {
68754
- role: "user",
68755
- content: {
68756
- type: "text",
68757
- text: `Please analyze GitHub issue #${args.issue_number} and create a detailed implementation plan.
68758
-
68759
- Steps:
68760
- 1. Use dev_gh with action "context" to get full issue details and related items
68761
- 2. Use dev_search to find relevant code that needs to be modified
68762
- 3. Use dev_plan to generate a structured implementation plan${args.detail_level ? ` with detailLevel "${args.detail_level}"` : ""}
68763
- 4. Summarize the approach, key files, and estimated complexity`
68764
- }
68765
- }
68766
- ]
68767
- }));
68768
68569
  this.register({
68769
68570
  name: "find-pattern",
68770
68571
  description: "Search the codebase for specific patterns or functionality",
@@ -68815,11 +68616,9 @@ Then provide:
68815
68616
  text: `Provide a comprehensive overview of the repository status:
68816
68617
 
68817
68618
  1. Use dev_status with section "summary" and format "verbose" for detailed stats
68818
- 2. Use dev_gh with action "search" to find recent open issues (limit 5)
68819
- 3. Summarize:
68619
+ 2. Summarize:
68820
68620
  - Repository health (indexing status, storage size)
68821
68621
  - Code metrics (files, components, vectors)
68822
- - GitHub activity (open issues, recent PRs)
68823
68622
  - Any recommendations for maintenance`
68824
68623
  }
68825
68624
  }
@@ -68849,7 +68648,7 @@ Then provide:
68849
68648
  type: "text",
68850
68649
  text: `Find code that is similar to "${args.file_path}":
68851
68650
 
68852
- Use dev_inspect with:
68651
+ Use dev_patterns with:
68853
68652
  - query: "${args.file_path}"${args.threshold ? `
68854
68653
  - threshold: ${args.threshold}` : ""}
68855
68654
  - format: "verbose"
@@ -68863,51 +68662,6 @@ Then explain:
68863
68662
  }
68864
68663
  ]
68865
68664
  }));
68866
- this.register({
68867
- name: "search-github",
68868
- description: "Search GitHub issues and pull requests by topic",
68869
- arguments: [
68870
- {
68871
- name: "query",
68872
- description: 'What to search for (e.g., "authentication bug", "performance improvement")',
68873
- required: true
68874
- },
68875
- {
68876
- name: "type",
68877
- description: 'Filter by type: "issue" or "pull_request"',
68878
- required: false
68879
- },
68880
- {
68881
- name: "state",
68882
- description: 'Filter by state: "open", "closed", or "merged"',
68883
- required: false
68884
- }
68885
- ]
68886
- }, (args) => ({
68887
- description: `Search GitHub for: ${args.query}`,
68888
- messages: [
68889
- {
68890
- role: "user",
68891
- content: {
68892
- type: "text",
68893
- text: `Search GitHub for "${args.query}":
68894
-
68895
- Use dev_gh with:
68896
- - action: "search"
68897
- - query: "${args.query}"${args.type ? `
68898
- - type: "${args.type}"` : ""}${args.state ? `
68899
- - state: "${args.state}"` : ""}
68900
- - limit: 10
68901
-
68902
- Provide:
68903
- 1. Summary of relevant items found
68904
- 2. Key themes or patterns
68905
- 3. Status overview (how many open vs closed)
68906
- 4. Suggestions for next steps`
68907
- }
68908
- }
68909
- ]
68910
- }));
68911
68665
  this.register({
68912
68666
  name: "explore-relationships",
68913
68667
  description: "Explore dependencies and relationships in the codebase",
@@ -68929,7 +68683,7 @@ Provide:
68929
68683
 
68930
68684
  Use dev_refs to find what calls or is called by functions in this file.
68931
68685
 
68932
- Alternatively, use dev_inspect with:
68686
+ Alternatively, use dev_patterns with:
68933
68687
  - query: "${args.file_path}"
68934
68688
  - format: "verbose"
68935
68689
 
@@ -68945,50 +68699,6 @@ Then explain:
68945
68699
  }
68946
68700
  ]
68947
68701
  }));
68948
- this.register({
68949
- name: "create-plan",
68950
- description: "Create detailed implementation plan for a GitHub issue",
68951
- arguments: [
68952
- {
68953
- name: "issue_number",
68954
- description: "GitHub issue number to plan for",
68955
- required: true
68956
- },
68957
- {
68958
- name: "detail_level",
68959
- description: 'Plan detail level: "simple" or "detailed" (default)',
68960
- required: false
68961
- },
68962
- {
68963
- name: "use_explorer",
68964
- description: "Use semantic search to find relevant code (true/false, default: true)",
68965
- required: false
68966
- }
68967
- ]
68968
- }, (args) => ({
68969
- description: `Create implementation plan for issue #${args.issue_number}`,
68970
- messages: [
68971
- {
68972
- role: "user",
68973
- content: {
68974
- type: "text",
68975
- text: `Create an implementation plan for GitHub issue #${args.issue_number}:
68976
-
68977
- Use dev_plan with:
68978
- - issue: ${args.issue_number}${args.detail_level ? `
68979
- - detailLevel: "${args.detail_level}"` : ""}${args.use_explorer === "false" ? "\n- useExplorer: false" : ""}
68980
-
68981
- The tool will:
68982
- 1. Fetch the issue details
68983
- 2. Find relevant code using semantic search
68984
- 3. Break down the work into specific tasks
68985
- 4. Estimate complexity and dependencies
68986
-
68987
- Review the plan and suggest any modifications or improvements.`
68988
- }
68989
- }
68990
- ]
68991
- }));
68992
68702
  this.register({
68993
68703
  name: "quick-search",
68994
68704
  description: "Quick semantic search across the codebase",
@@ -69848,7 +69558,7 @@ Setup:
69848
69558
  3. Restart Cursor to activate
69849
69559
 
69850
69560
  Available Tools (6):
69851
- dev_search, dev_status, dev_inspect,
69561
+ dev_search, dev_status, dev_patterns,
69852
69562
  dev_health, dev_refs, dev_map
69853
69563
  `).addCommand(new commander_12.Command("start").description("Start MCP server for current repository").option("-p, --port <port>", "Port for HTTP transport (if not using stdio)").option("-t, --transport <type>", "Transport type: stdio (default) or http", "stdio").option("-v, --verbose", "Verbose logging", false).action(async (options) => {
69854
69564
  const repositoryPath = process.env.WORKSPACE_FOLDER_PATHS || process.env.REPOSITORY_PATH || process.cwd();
@@ -69932,7 +69642,7 @@ Available Tools (6):
69932
69642
  process.on("SIGTERM", shutdown);
69933
69643
  await server.start();
69934
69644
  logger_1.logger.info(chalk_12.default.green("MCP server started successfully!"));
69935
- logger_1.logger.info("Available tools: dev_search, dev_status, dev_inspect, dev_health, dev_refs, dev_map");
69645
+ logger_1.logger.info("Available tools: dev_search, dev_status, dev_patterns, dev_health, dev_refs, dev_map");
69936
69646
  if (options.transport === "stdio") {
69937
69647
  logger_1.logger.info("Server running on stdio transport (for AI tools)");
69938
69648
  } else {
@@ -70280,9 +69990,14 @@ var require_search = __commonJS({
70280
69990
  var commander_12 = require_commander();
70281
69991
  var ora_1 = __importDefault2((init_ora(), __toCommonJS(ora_exports)));
70282
69992
  var config_js_1 = require_config();
69993
+ var file_js_1 = require_file();
70283
69994
  var logger_js_1 = require_logger();
70284
69995
  var output_js_1 = require_output();
70285
- exports2.searchCommand = new commander_12.Command("search").description("Search indexed code semantically").argument("<query>", "Search query").option("-l, --limit <number>", "Maximum number of results", "10").option("-t, --threshold <number>", "Minimum similarity score", "0").option("--json", "Output results as JSON", false).option("-v, --verbose", "Show detailed results with signatures and docs", false).action(async (query, options) => {
69996
+ exports2.searchCommand = new commander_12.Command("search").description("Search indexed code semantically").argument("[query]", "Search query (optional with --similar-to)").option("-l, --limit <number>", "Maximum number of results", "10").option("-t, --threshold <number>", "Minimum similarity score", "0").option("-s, --similar-to <file>", "Find code similar to a file").option("--json", "Output results as JSON", false).option("-v, --verbose", "Show detailed results with signatures and docs", false).action(async (query, options) => {
69997
+ if (!query && !options.similarTo) {
69998
+ console.error("Provide a search query or use --similar-to <file>");
69999
+ process.exit(1);
70000
+ }
70286
70001
  const spinner = (0, ora_1.default)("Searching...").start();
70287
70002
  try {
70288
70003
  const config2 = await (0, config_js_1.loadConfig)();
@@ -70291,7 +70006,6 @@ var require_search = __commonJS({
70291
70006
  const storagePath = await (0, dev_agent_core_1.getStoragePath)(resolvedRepoPath);
70292
70007
  await (0, dev_agent_core_1.ensureStorageDirectory)(storagePath);
70293
70008
  const filePaths = (0, dev_agent_core_1.getStorageFilePaths)(storagePath);
70294
- spinner.text = "Initializing indexer...";
70295
70009
  const indexer = new dev_agent_core_1.RepositoryIndexer({
70296
70010
  repositoryPath: resolvedRepoPath,
70297
70011
  vectorStorePath: filePaths.vectors,
@@ -70299,30 +70013,45 @@ var require_search = __commonJS({
70299
70013
  languages: config2?.repository?.languages || config2?.languages
70300
70014
  });
70301
70015
  await indexer.initialize();
70302
- spinner.text = `Searching for: ${chalk_12.default.cyan(query)}`;
70303
- const results = await indexer.search(query, {
70304
- limit: Number.parseInt(options.limit, 10),
70016
+ let searchQuery = query || "";
70017
+ let similarFile = "";
70018
+ if (options.similarTo) {
70019
+ spinner.text = "Reading file content...";
70020
+ try {
70021
+ const fileInfo = await (0, file_js_1.prepareFileForSearch)(resolvedRepoPath, options.similarTo);
70022
+ searchQuery = fileInfo.content;
70023
+ similarFile = fileInfo.relativePath;
70024
+ } catch (error47) {
70025
+ spinner.fail(error47.message);
70026
+ await indexer.close();
70027
+ process.exit(1);
70028
+ }
70029
+ }
70030
+ spinner.text = options.similarTo ? `Finding code similar to: ${chalk_12.default.cyan(options.similarTo)}` : `Searching for: ${chalk_12.default.cyan(query)}`;
70031
+ const limit = Number.parseInt(options.limit, 10);
70032
+ const results = await indexer.search(searchQuery, {
70033
+ limit: similarFile ? limit + 1 : limit,
70305
70034
  scoreThreshold: Number.parseFloat(options.threshold)
70306
70035
  });
70307
70036
  await indexer.close();
70037
+ const filtered = similarFile ? results.filter((r) => r.metadata.path !== similarFile).slice(0, limit) : results;
70308
70038
  spinner.stop();
70309
- if (results.length === 0) {
70039
+ if (filtered.length === 0) {
70310
70040
  output_js_1.output.log("");
70311
70041
  output_js_1.output.warn("No results found. Try:");
70312
- output_js_1.output.log(` \u2022 Lower threshold: ${chalk_12.default.cyan("--threshold 0.3")}`);
70313
70042
  output_js_1.output.log(` \u2022 Different keywords`);
70314
70043
  output_js_1.output.log(` \u2022 Re-index: ${chalk_12.default.cyan("dev index --force")}`);
70315
70044
  output_js_1.output.log("");
70316
70045
  return;
70317
70046
  }
70318
70047
  if (options.json) {
70319
- console.log(JSON.stringify(results, null, 2));
70048
+ console.log(JSON.stringify(filtered, null, 2));
70320
70049
  return;
70321
70050
  }
70322
70051
  output_js_1.output.log("");
70323
- output_js_1.output.success(`Found ${results.length} result(s)`);
70052
+ output_js_1.output.success(`Found ${filtered.length} result(s)`);
70324
70053
  output_js_1.output.log("");
70325
- output_js_1.output.log((0, output_js_1.formatSearchResults)(results, resolvedRepoPath, { verbose: options.verbose }));
70054
+ output_js_1.output.log((0, output_js_1.formatSearchResults)(filtered, resolvedRepoPath, { verbose: options.verbose }));
70326
70055
  output_js_1.output.log("");
70327
70056
  } catch (error47) {
70328
70057
  spinner.fail("Search failed");
@@ -70830,7 +70559,6 @@ var chalk_1 = __importDefault((init_source(), __toCommonJS(source_exports)));
70830
70559
  var commander_1 = require_commander();
70831
70560
  var clean_js_1 = require_clean();
70832
70561
  var compact_js_1 = require_compact();
70833
- var explore_js_1 = require_explore();
70834
70562
  var index_js_1 = require_commands();
70835
70563
  var map_js_1 = require_map();
70836
70564
  var mcp_js_1 = require_mcp();
@@ -70838,12 +70566,11 @@ var reset_js_1 = require_reset();
70838
70566
  var search_js_1 = require_search();
70839
70567
  var setup_js_1 = require_setup();
70840
70568
  var storage_js_1 = require_storage();
70841
- var VERSION = true ? "0.10.0" : "0.0.0-dev";
70569
+ var VERSION = true ? "0.10.1" : "0.0.0-dev";
70842
70570
  var program = new commander_1.Command();
70843
70571
  program.name("dev").description(chalk_1.default.cyan("\u{1F916} Dev-Agent - Multi-agent code intelligence platform")).version(VERSION);
70844
70572
  program.addCommand(index_js_1.indexCommand);
70845
70573
  program.addCommand(search_js_1.searchCommand);
70846
- program.addCommand(explore_js_1.exploreCommand);
70847
70574
  program.addCommand(map_js_1.mapCommand);
70848
70575
  program.addCommand(compact_js_1.compactCommand);
70849
70576
  program.addCommand(clean_js_1.cleanCommand);