claude-local-docs 1.0.13 → 1.0.15
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/.mcp.json +2 -1
- package/README.md +124 -58
- package/commands/fetch-docs.md +54 -28
- package/commands/index-codebase.md +53 -0
- package/dist/code-indexer.d.ts +14 -0
- package/dist/code-indexer.js +519 -0
- package/dist/code-indexer.js.map +1 -0
- package/dist/code-search.d.ts +14 -0
- package/dist/code-search.js +155 -0
- package/dist/code-search.js.map +1 -0
- package/dist/code-store.d.ts +39 -0
- package/dist/code-store.js +206 -0
- package/dist/code-store.js.map +1 -0
- package/dist/code.test.d.ts +7 -0
- package/dist/code.test.js +197 -0
- package/dist/code.test.js.map +1 -0
- package/dist/discovery.js +56 -4
- package/dist/discovery.js.map +1 -1
- package/dist/docs.test.d.ts +7 -0
- package/dist/docs.test.js +105 -0
- package/dist/docs.test.js.map +1 -0
- package/dist/file-walker.d.ts +34 -0
- package/dist/file-walker.js +199 -0
- package/dist/file-walker.js.map +1 -0
- package/dist/index.js +321 -22
- package/dist/index.js.map +1 -1
- package/dist/indexer.js +4 -23
- package/dist/indexer.js.map +1 -1
- package/dist/integration.test.d.ts +3 -2
- package/dist/integration.test.js +461 -11
- package/dist/integration.test.js.map +1 -1
- package/dist/reranker.d.ts +2 -2
- package/dist/reranker.js +10 -12
- package/dist/reranker.js.map +1 -1
- package/dist/rrf.d.ts +17 -0
- package/dist/rrf.js +25 -0
- package/dist/rrf.js.map +1 -0
- package/dist/search.d.ts +2 -0
- package/dist/search.js +30 -52
- package/dist/search.js.map +1 -1
- package/dist/sfc-extractor.d.ts +14 -0
- package/dist/sfc-extractor.js +70 -0
- package/dist/sfc-extractor.js.map +1 -0
- package/dist/store.d.ts +2 -0
- package/dist/store.js +39 -24
- package/dist/store.js.map +1 -1
- package/dist/tei-client.d.ts +70 -0
- package/dist/tei-client.js +153 -0
- package/dist/tei-client.js.map +1 -0
- package/dist/types.d.ts +49 -0
- package/dist/types.js +4 -1
- package/dist/types.js.map +1 -1
- package/dist/unit.test.d.ts +8 -0
- package/dist/unit.test.js +1241 -0
- package/dist/unit.test.js.map +1 -0
- package/docker-compose.nvidia.yml +7 -0
- package/docker-compose.yml +9 -0
- package/package.json +8 -2
- package/scripts/ensure-tei.sh +93 -19
- package/start-tei.sh +17 -3
|
@@ -0,0 +1,153 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Shared TEI (Text Embeddings Inference) HTTP client with retry, timeout, and batching.
|
|
3
|
+
* Centralizes all TEI communication so embed, rerank, and code-embed share
|
|
4
|
+
* consistent error handling and diagnostics.
|
|
5
|
+
*/
|
|
6
|
+
const RETRYABLE_STATUSES = new Set([502, 503, 504]);
|
|
7
|
+
export class TeiClient {
|
|
8
|
+
baseUrl;
|
|
9
|
+
timeoutMs;
|
|
10
|
+
maxRetries;
|
|
11
|
+
retryDelayMs;
|
|
12
|
+
maxBatchSize;
|
|
13
|
+
constructor(options) {
|
|
14
|
+
this.baseUrl = options.baseUrl;
|
|
15
|
+
this.timeoutMs = options.timeoutMs ?? 30_000;
|
|
16
|
+
this.maxRetries = options.maxRetries ?? 2;
|
|
17
|
+
this.retryDelayMs = options.retryDelayMs ?? 500;
|
|
18
|
+
this.maxBatchSize = options.maxBatchSize ?? 32;
|
|
19
|
+
}
|
|
20
|
+
/**
|
|
21
|
+
* Embed texts, automatically splitting into batches.
|
|
22
|
+
* Returns one embedding vector per input text.
|
|
23
|
+
*/
|
|
24
|
+
async embed(inputs, options) {
|
|
25
|
+
const embeddings = [];
|
|
26
|
+
for (let i = 0; i < inputs.length; i += this.maxBatchSize) {
|
|
27
|
+
const batch = inputs.slice(i, i + this.maxBatchSize);
|
|
28
|
+
const body = { inputs: batch };
|
|
29
|
+
if (options?.truncate !== undefined)
|
|
30
|
+
body.truncate = options.truncate;
|
|
31
|
+
const data = await this.fetchWithRetry(`${this.baseUrl}/embed`, body);
|
|
32
|
+
embeddings.push(...data);
|
|
33
|
+
}
|
|
34
|
+
return embeddings;
|
|
35
|
+
}
|
|
36
|
+
/**
|
|
37
|
+
* Rerank texts against a query, automatically splitting into batches.
|
|
38
|
+
* Returns scored results sorted by score descending.
|
|
39
|
+
*/
|
|
40
|
+
async rerank(query, texts) {
|
|
41
|
+
const allResults = [];
|
|
42
|
+
for (let i = 0; i < texts.length; i += this.maxBatchSize) {
|
|
43
|
+
const batch = texts.slice(i, i + this.maxBatchSize);
|
|
44
|
+
const data = await this.fetchWithRetry(`${this.baseUrl}/rerank`, {
|
|
45
|
+
query,
|
|
46
|
+
texts: batch,
|
|
47
|
+
});
|
|
48
|
+
const results = data;
|
|
49
|
+
// Offset indices back to original positions
|
|
50
|
+
for (const r of results) {
|
|
51
|
+
allResults.push({ index: r.index + i, score: r.score });
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
return allResults.sort((a, b) => b.score - a.score);
|
|
55
|
+
}
|
|
56
|
+
/**
|
|
57
|
+
* Check if the TEI endpoint is healthy.
|
|
58
|
+
*/
|
|
59
|
+
async checkHealth() {
|
|
60
|
+
try {
|
|
61
|
+
const res = await fetch(`${this.baseUrl}/health`, {
|
|
62
|
+
signal: AbortSignal.timeout(5_000),
|
|
63
|
+
});
|
|
64
|
+
if (res.ok)
|
|
65
|
+
return { healthy: true };
|
|
66
|
+
return { healthy: false, error: `HTTP ${res.status}` };
|
|
67
|
+
}
|
|
68
|
+
catch (err) {
|
|
69
|
+
return { healthy: false, error: err.message ?? String(err) };
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
async fetchWithRetry(url, body) {
|
|
73
|
+
let lastError = null;
|
|
74
|
+
for (let attempt = 0; attempt <= this.maxRetries; attempt++) {
|
|
75
|
+
try {
|
|
76
|
+
const res = await fetch(url, {
|
|
77
|
+
method: "POST",
|
|
78
|
+
headers: { "Content-Type": "application/json" },
|
|
79
|
+
body: JSON.stringify(body),
|
|
80
|
+
signal: AbortSignal.timeout(this.timeoutMs),
|
|
81
|
+
});
|
|
82
|
+
if (res.ok) {
|
|
83
|
+
return await res.json();
|
|
84
|
+
}
|
|
85
|
+
// Non-retryable HTTP error — fail immediately
|
|
86
|
+
if (!RETRYABLE_STATUSES.has(res.status)) {
|
|
87
|
+
const text = await res.text();
|
|
88
|
+
throw new Error(`TEI error: ${res.status} ${text}`);
|
|
89
|
+
}
|
|
90
|
+
// Retryable status — store error and retry
|
|
91
|
+
lastError = new Error(`TEI error: ${res.status}`);
|
|
92
|
+
}
|
|
93
|
+
catch (err) {
|
|
94
|
+
// Retryable network errors (ECONNREFUSED, timeout, etc.)
|
|
95
|
+
const isRetryable = err.name === "TimeoutError" ||
|
|
96
|
+
err.cause?.code === "ECONNREFUSED" ||
|
|
97
|
+
err.cause?.code === "ECONNRESET" ||
|
|
98
|
+
RETRYABLE_STATUSES.has(err.status);
|
|
99
|
+
if (!isRetryable || attempt === this.maxRetries) {
|
|
100
|
+
throw err;
|
|
101
|
+
}
|
|
102
|
+
lastError = err;
|
|
103
|
+
}
|
|
104
|
+
// Exponential backoff: 500ms, 1000ms
|
|
105
|
+
if (attempt < this.maxRetries) {
|
|
106
|
+
await new Promise((r) => setTimeout(r, this.retryDelayMs * (attempt + 1)));
|
|
107
|
+
}
|
|
108
|
+
}
|
|
109
|
+
throw lastError ?? new Error("TEI request failed after retries");
|
|
110
|
+
}
|
|
111
|
+
}
|
|
112
|
+
// --- Pre-configured singletons ---
|
|
113
|
+
export const docEmbedClient = new TeiClient({
|
|
114
|
+
baseUrl: process.env.TEI_EMBED_URL ?? "http://localhost:39281",
|
|
115
|
+
maxBatchSize: 32,
|
|
116
|
+
});
|
|
117
|
+
export const rerankClient = new TeiClient({
|
|
118
|
+
baseUrl: process.env.TEI_RERANK_URL ?? "http://localhost:39282",
|
|
119
|
+
maxBatchSize: 32,
|
|
120
|
+
});
|
|
121
|
+
export const codeEmbedClient = new TeiClient({
|
|
122
|
+
baseUrl: process.env.TEI_CODE_EMBED_URL ?? "http://localhost:39283",
|
|
123
|
+
maxBatchSize: 8, // must match --max-client-batch-size 8 in docker-compose.yml / start-tei.sh
|
|
124
|
+
});
|
|
125
|
+
/**
|
|
126
|
+
* Truncate vectors to `dim` dimensions and L2-normalize.
|
|
127
|
+
* Shared by doc embeddings (Matryoshka 384-dim) and code embeddings (1536-dim).
|
|
128
|
+
*/
|
|
129
|
+
export function truncateAndNormalize(vectors, dim) {
|
|
130
|
+
return vectors.map(vec => {
|
|
131
|
+
const truncated = vec.slice(0, dim);
|
|
132
|
+
const norm = Math.sqrt(truncated.reduce((s, v) => s + v * v, 0));
|
|
133
|
+
return truncated.map(v => v / (norm || 1));
|
|
134
|
+
});
|
|
135
|
+
}
|
|
136
|
+
/**
|
|
137
|
+
* Check health of all 3 TEI endpoints.
|
|
138
|
+
* Returns per-endpoint status and an overall allHealthy flag.
|
|
139
|
+
*/
|
|
140
|
+
export async function checkAllTeiHealth() {
|
|
141
|
+
const [embed, rerank, codeEmbed] = await Promise.all([
|
|
142
|
+
docEmbedClient.checkHealth(),
|
|
143
|
+
rerankClient.checkHealth(),
|
|
144
|
+
codeEmbedClient.checkHealth(),
|
|
145
|
+
]);
|
|
146
|
+
return {
|
|
147
|
+
allHealthy: embed.healthy && rerank.healthy && codeEmbed.healthy,
|
|
148
|
+
embed,
|
|
149
|
+
rerank,
|
|
150
|
+
codeEmbed,
|
|
151
|
+
};
|
|
152
|
+
}
|
|
153
|
+
//# sourceMappingURL=tei-client.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tei-client.js","sourceRoot":"","sources":["../src/tei-client.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAUH,MAAM,kBAAkB,GAAG,IAAI,GAAG,CAAC,CAAC,GAAG,EAAE,GAAG,EAAE,GAAG,CAAC,CAAC,CAAC;AAEpD,MAAM,OAAO,SAAS;IACX,OAAO,CAAS;IACjB,SAAS,CAAS;IAClB,UAAU,CAAS;IACnB,YAAY,CAAS;IACrB,YAAY,CAAS;IAE7B,YAAY,OAAy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SAAS,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC,CAAC,GAAG,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC;QACjE,OAAO,SAAS,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,GAAG,CAAC,IAAI,IAAI,CAAC,CAAC,CAAC,CAAC;IAC7C,CAAC,CAAC,CAAC;AACL,CAAC;AAED;;;GAGG;AACH,MAAM,CAAC,KAAK,UAAU,iBAAiB;IAMrC,MAAM,CAAC,KAAK,EAAE,MAAM,EAAE,SAAS,CAAC,GAAG,MAAM,OAAO,CAAC,GAAG,CAAC;QACnD,cAAc,CAAC,WAAW,EAAE;QAC5B,YAAY,CAAC,WAAW,EAAE;QAC1B,eAAe,CAAC,WAAW,EAAE;KAC9B,CAAC,CAAC;IACH,OAAO;QACL,UAAU,EAAE,KAAK,CAAC,OAAO,IAAI,MAAM,CAAC,OAAO,IAAI,SAAS,CAAC,OAAO;QAChE,KAAK;QACL,MAAM;QACN,SAAS;KACV,CAAC;AACJ,CAAC"}
|
package/dist/types.d.ts
CHANGED
|
@@ -33,3 +33,52 @@ export interface DocRow {
|
|
|
33
33
|
text: string;
|
|
34
34
|
vector: number[];
|
|
35
35
|
}
|
|
36
|
+
export type CodeEntityType = "function" | "class" | "method" | "interface" | "type_alias" | "enum" | "import" | "variable" | "module" | "namespace" | "other";
|
|
37
|
+
/** Shape of a code chunk row stored in LanceDB "code" table */
|
|
38
|
+
export interface CodeRow {
|
|
39
|
+
id: number;
|
|
40
|
+
filePath: string;
|
|
41
|
+
language: string;
|
|
42
|
+
entityType: CodeEntityType;
|
|
43
|
+
entityName: string;
|
|
44
|
+
signature: string;
|
|
45
|
+
scopeChain: string;
|
|
46
|
+
lineStart: number;
|
|
47
|
+
lineEnd: number;
|
|
48
|
+
jsdoc: string;
|
|
49
|
+
decorators: string;
|
|
50
|
+
isExported: boolean;
|
|
51
|
+
isAsync: boolean;
|
|
52
|
+
isAbstract: boolean;
|
|
53
|
+
text: string;
|
|
54
|
+
vector: number[];
|
|
55
|
+
}
|
|
56
|
+
export interface CodeSearchResult {
|
|
57
|
+
score: number;
|
|
58
|
+
filePath: string;
|
|
59
|
+
language: string;
|
|
60
|
+
entityType: CodeEntityType;
|
|
61
|
+
entityName: string;
|
|
62
|
+
signature: string;
|
|
63
|
+
scopeChain: string[];
|
|
64
|
+
lineStart: number;
|
|
65
|
+
lineEnd: number;
|
|
66
|
+
content: string;
|
|
67
|
+
chunkId: number;
|
|
68
|
+
}
|
|
69
|
+
export interface IndexedFileMetadata {
|
|
70
|
+
filePath: string;
|
|
71
|
+
sha256: string;
|
|
72
|
+
language: string;
|
|
73
|
+
chunkCount: number;
|
|
74
|
+
indexedAt: string;
|
|
75
|
+
}
|
|
76
|
+
export interface CodeMetadata {
|
|
77
|
+
projectRoot: string;
|
|
78
|
+
files: IndexedFileMetadata[];
|
|
79
|
+
lastFullIndexAt?: string;
|
|
80
|
+
schemaVersion?: number;
|
|
81
|
+
lastIndexedCommit?: string;
|
|
82
|
+
}
|
|
83
|
+
/** Escape a string for use in LanceDB SQL filter expressions. */
|
|
84
|
+
export declare function sqlEscapeString(value: string): string;
|
package/dist/types.js
CHANGED
package/dist/types.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.js","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":""}
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAiGA,iEAAiE;AACjE,MAAM,UAAU,eAAe,CAAC,KAAa;IAC3C,OAAO,KAAK,CAAC,OAAO,CAAC,IAAI,EAAE,IAAI,CAAC,CAAC;AACnC,CAAC"}
|