ctxloom-pro 1.0.9 → 1.0.10
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/{chunk-UMFIYUGI.js → chunk-6GFE4SNN.js} +4 -4
- package/dist/{chunk-U3AVIYSJ.js → chunk-TVQ7CBWU.js} +37 -6
- package/dist/{embedder-BV7V7BHZ.js → embedder-VHOY4L6L.js} +2 -2
- package/dist/index.js +6 -6
- package/dist/{src-D3CS3BFE.js → src-JNWHMTLY.js} +3 -3
- package/dist/workers/indexerWorker.js +1 -1
- package/package.json +1 -1
|
@@ -4,7 +4,7 @@ import {
|
|
|
4
4
|
import {
|
|
5
5
|
collectFiles,
|
|
6
6
|
generateEmbedding
|
|
7
|
-
} from "./chunk-
|
|
7
|
+
} from "./chunk-TVQ7CBWU.js";
|
|
8
8
|
import {
|
|
9
9
|
logger
|
|
10
10
|
} from "./chunk-TYDMSHV7.js";
|
|
@@ -6273,7 +6273,7 @@ function registerFullTextSearchTool(registry, ctx) {
|
|
|
6273
6273
|
const { query, mode, case_sensitive, limit, context_lines } = Schema22.parse(args);
|
|
6274
6274
|
if (mode === "semantic") {
|
|
6275
6275
|
try {
|
|
6276
|
-
const { generateEmbedding: generateEmbedding2 } = await import("./embedder-
|
|
6276
|
+
const { generateEmbedding: generateEmbedding2 } = await import("./embedder-VHOY4L6L.js");
|
|
6277
6277
|
const store = await ctx.getStore();
|
|
6278
6278
|
const embedding = await generateEmbedding2(query);
|
|
6279
6279
|
const results = await store.search(embedding, limit);
|
|
@@ -6310,7 +6310,7 @@ function registerFullTextSearchTool(registry, ctx) {
|
|
|
6310
6310
|
let merged = keywordResults.slice(0, limit);
|
|
6311
6311
|
if (mode === "hybrid") {
|
|
6312
6312
|
try {
|
|
6313
|
-
const { generateEmbedding: generateEmbedding2 } = await import("./embedder-
|
|
6313
|
+
const { generateEmbedding: generateEmbedding2 } = await import("./embedder-VHOY4L6L.js");
|
|
6314
6314
|
const store = await ctx.getStore();
|
|
6315
6315
|
const embedding = await generateEmbedding2(query);
|
|
6316
6316
|
const vectorResults = await store.search(embedding, Math.ceil(limit / 2));
|
|
@@ -8420,4 +8420,4 @@ export {
|
|
|
8420
8420
|
track,
|
|
8421
8421
|
captureError
|
|
8422
8422
|
};
|
|
8423
|
-
//# sourceMappingURL=chunk-
|
|
8423
|
+
//# sourceMappingURL=chunk-6GFE4SNN.js.map
|
|
@@ -10,13 +10,44 @@ var EMBEDDING_DIMENSION = 384;
|
|
|
10
10
|
var MODEL_ID = "sentence-transformers/all-MiniLM-L6-v2";
|
|
11
11
|
var CHUNK_SIZE = 4096;
|
|
12
12
|
var embedder = null;
|
|
13
|
+
var embedderInitInFlight = null;
|
|
14
|
+
async function loadEmbedder() {
|
|
15
|
+
return await pipeline("feature-extraction", MODEL_ID, {
|
|
16
|
+
dtype: "fp32"
|
|
17
|
+
});
|
|
18
|
+
}
|
|
13
19
|
async function getEmbedder() {
|
|
14
|
-
if (
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
20
|
+
if (embedder) return embedder;
|
|
21
|
+
if (embedderInitInFlight) return embedderInitInFlight;
|
|
22
|
+
embedderInitInFlight = (async () => {
|
|
23
|
+
const MAX_ATTEMPTS = 3;
|
|
24
|
+
let lastErr;
|
|
25
|
+
for (let attempt = 1; attempt <= MAX_ATTEMPTS; attempt++) {
|
|
26
|
+
try {
|
|
27
|
+
const pipe = await loadEmbedder();
|
|
28
|
+
embedder = pipe;
|
|
29
|
+
return pipe;
|
|
30
|
+
} catch (err) {
|
|
31
|
+
lastErr = err;
|
|
32
|
+
const msg = err instanceof Error ? err.message : String(err);
|
|
33
|
+
const isProtobufRace = /protobuf parsing failed/i.test(msg);
|
|
34
|
+
if (!isProtobufRace || attempt === MAX_ATTEMPTS) break;
|
|
35
|
+
const delay = attempt * 1e3;
|
|
36
|
+
logger.warn("Embedding model load failed; retrying after FS settle", {
|
|
37
|
+
attempt,
|
|
38
|
+
delayMs: delay
|
|
39
|
+
});
|
|
40
|
+
await new Promise((resolve) => setTimeout(resolve, delay));
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
embedderInitInFlight = null;
|
|
44
|
+
throw lastErr;
|
|
45
|
+
})();
|
|
46
|
+
try {
|
|
47
|
+
return await embedderInitInFlight;
|
|
48
|
+
} finally {
|
|
49
|
+
if (embedder) embedderInitInFlight = null;
|
|
18
50
|
}
|
|
19
|
-
return embedder;
|
|
20
51
|
}
|
|
21
52
|
async function generateEmbedding(text) {
|
|
22
53
|
const pipe = await getEmbedder();
|
|
@@ -142,4 +173,4 @@ export {
|
|
|
142
173
|
collectFiles,
|
|
143
174
|
indexDirectory
|
|
144
175
|
};
|
|
145
|
-
//# sourceMappingURL=chunk-
|
|
176
|
+
//# sourceMappingURL=chunk-TVQ7CBWU.js.map
|
|
@@ -3,7 +3,7 @@ import {
|
|
|
3
3
|
collectFiles,
|
|
4
4
|
generateEmbedding,
|
|
5
5
|
indexDirectory
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-TVQ7CBWU.js";
|
|
7
7
|
import "./chunk-TYDMSHV7.js";
|
|
8
8
|
export {
|
|
9
9
|
EMBEDDING_DIMENSION,
|
|
@@ -11,4 +11,4 @@ export {
|
|
|
11
11
|
generateEmbedding,
|
|
12
12
|
indexDirectory
|
|
13
13
|
};
|
|
14
|
-
//# sourceMappingURL=embedder-
|
|
14
|
+
//# sourceMappingURL=embedder-VHOY4L6L.js.map
|
package/dist/index.js
CHANGED
|
@@ -34,14 +34,14 @@ import {
|
|
|
34
34
|
startTrial,
|
|
35
35
|
track,
|
|
36
36
|
writeCODEOWNERS
|
|
37
|
-
} from "./chunk-
|
|
37
|
+
} from "./chunk-6GFE4SNN.js";
|
|
38
38
|
import {
|
|
39
39
|
VectorStore
|
|
40
40
|
} from "./chunk-NEHYSE2Y.js";
|
|
41
41
|
import {
|
|
42
42
|
generateEmbedding,
|
|
43
43
|
indexDirectory
|
|
44
|
-
} from "./chunk-
|
|
44
|
+
} from "./chunk-TVQ7CBWU.js";
|
|
45
45
|
import {
|
|
46
46
|
logger
|
|
47
47
|
} from "./chunk-TYDMSHV7.js";
|
|
@@ -579,7 +579,7 @@ async function checkLicense() {
|
|
|
579
579
|
if (command !== void 0 && LICENSE_GATE_BYPASS_COMMANDS.has(command)) return;
|
|
580
580
|
const ciKey = process.env["CTXLOOM_LICENSE_KEY"];
|
|
581
581
|
if (ciKey) {
|
|
582
|
-
const { ApiClient } = await import("./src-
|
|
582
|
+
const { ApiClient } = await import("./src-JNWHMTLY.js");
|
|
583
583
|
const client = new ApiClient(process.env["CTXLOOM_API_BASE"]);
|
|
584
584
|
try {
|
|
585
585
|
const result = await client.validate(ciKey, "ci-ephemeral");
|
|
@@ -1100,7 +1100,7 @@ Suggested reviewers for ${files.length} file(s):`);
|
|
|
1100
1100
|
process.stderr.write("[ctxloom] --limit must be a non-negative integer (0 for unlimited)\n");
|
|
1101
1101
|
process.exit(2);
|
|
1102
1102
|
}
|
|
1103
|
-
const { loadRulesConfig, RulesChecker, formatText, formatJson, RulesConfigError } = await import("./src-
|
|
1103
|
+
const { loadRulesConfig, RulesChecker, formatText, formatJson, RulesConfigError } = await import("./src-JNWHMTLY.js");
|
|
1104
1104
|
let config;
|
|
1105
1105
|
try {
|
|
1106
1106
|
config = await loadRulesConfig(root);
|
|
@@ -1124,7 +1124,7 @@ Suggested reviewers for ${files.length} file(s):`);
|
|
|
1124
1124
|
}
|
|
1125
1125
|
let graph;
|
|
1126
1126
|
if (useSnapshot) {
|
|
1127
|
-
const { DependencyGraph: DG } = await import("./src-
|
|
1127
|
+
const { DependencyGraph: DG } = await import("./src-JNWHMTLY.js");
|
|
1128
1128
|
graph = new DG();
|
|
1129
1129
|
const loaded = await graph.loadSnapshotOnly(root);
|
|
1130
1130
|
if (!loaded) {
|
|
@@ -1133,7 +1133,7 @@ Suggested reviewers for ${files.length} file(s):`);
|
|
|
1133
1133
|
}
|
|
1134
1134
|
} else {
|
|
1135
1135
|
process.stderr.write("[ctxloom] Building dependency graph...\n");
|
|
1136
|
-
const { ASTParser: ASTParser2, DependencyGraph: DependencyGraph2 } = await import("./src-
|
|
1136
|
+
const { ASTParser: ASTParser2, DependencyGraph: DependencyGraph2 } = await import("./src-JNWHMTLY.js");
|
|
1137
1137
|
let parser;
|
|
1138
1138
|
try {
|
|
1139
1139
|
parser = new ASTParser2();
|
|
@@ -69,7 +69,7 @@ import {
|
|
|
69
69
|
startTrial,
|
|
70
70
|
track,
|
|
71
71
|
writeCODEOWNERS
|
|
72
|
-
} from "./chunk-
|
|
72
|
+
} from "./chunk-6GFE4SNN.js";
|
|
73
73
|
import {
|
|
74
74
|
VectorStore
|
|
75
75
|
} from "./chunk-NEHYSE2Y.js";
|
|
@@ -78,7 +78,7 @@ import {
|
|
|
78
78
|
collectFiles,
|
|
79
79
|
generateEmbedding,
|
|
80
80
|
indexDirectory
|
|
81
|
-
} from "./chunk-
|
|
81
|
+
} from "./chunk-TVQ7CBWU.js";
|
|
82
82
|
import {
|
|
83
83
|
logger
|
|
84
84
|
} from "./chunk-TYDMSHV7.js";
|
|
@@ -160,4 +160,4 @@ export {
|
|
|
160
160
|
track,
|
|
161
161
|
writeCODEOWNERS
|
|
162
162
|
};
|
|
163
|
-
//# sourceMappingURL=src-
|
|
163
|
+
//# sourceMappingURL=src-JNWHMTLY.js.map
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "ctxloom-pro",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.10",
|
|
4
4
|
"description": "ctxloom — The Universal Code Context Engine. A local-first MCP server providing intelligent code context via hybrid Vector + AST + Graph search with Skeletonization (92% token reduction).",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "dist/index.js",
|