@vohongtho.infotech/code-intel 1.0.0 → 1.0.2

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.d.ts CHANGED
@@ -202,9 +202,20 @@ declare function detectOverrides(graph: KnowledgeGraph): CodeEdge[];
202
202
 
203
203
  interface LLMConfig {
204
204
  /** Which provider to use. Default: 'ollama'. */
205
- provider?: 'openai' | 'anthropic' | 'ollama';
205
+ provider?: 'openai' | 'anthropic' | 'ollama' | 'custom';
206
206
  /** Model name / ID passed to the provider. Each provider has its own default. */
207
207
  model?: string;
208
+ /**
209
+ * For 'custom' provider: the base URL of the OpenAI-compatible API.
210
+ * e.g. 'http://localhost:1234/v1' (LM Studio), 'https://api.groq.com/openai/v1', etc.
211
+ */
212
+ baseUrl?: string;
213
+ /**
214
+ * API key / token for the provider.
215
+ * For 'custom': passed as Bearer token. For 'openai': falls back to $OPENAI_API_KEY.
216
+ * For 'ollama': not needed.
217
+ */
218
+ apiKey?: string;
208
219
  /** Max concurrent LLM calls per batch. Default: 20. */
209
220
  batchSize?: number;
210
221
  /**
@@ -369,8 +380,13 @@ declare class Bm25Index {
369
380
  */
370
381
  load(): void;
371
382
  /**
372
- * BM25 search. LIMIT pushdown: scores only the posting lists for query terms,
373
- * then partial-sorts to return only the top `limit` results.
383
+ * BM25 search.
384
+ *
385
+ * Performance strategy:
386
+ * 1. Skip ultra-high-df terms (df/N > 0.6) — near-zero IDF, dominate posting
387
+ * lists for common words like "function", "return", "export" in large repos.
388
+ * 2. Min-heap top-K selection — O(n log k) instead of full O(n log n) sort.
389
+ * For k=10 and n=30,000 candidates this is ~10× faster than Array.sort.
374
390
  */
375
391
  search(query: string, limit: number): SearchResult[];
376
392
  /**