@minhpnq1807/contextos 0.5.18 → 0.5.20
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/CHANGELOG.md +10 -0
- package/bin/ctx.js +15 -10
- package/package.json +1 -1
- package/plugins/ctx/lib/ruler-sync.js +10 -1
- package/plugins/ctx/mcp/server.js +2 -8
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,15 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 0.5.20
|
|
4
|
+
|
|
5
|
+
- Refreshes stale `ctx-mcp` Ruler entries that point at temporary paths such as `/tmp/contextos/...`.
|
|
6
|
+
- Keeps `ctx install` fast by skipping large skill/workflow discovery embedding warmup unless `CONTEXTOS_INSTALL_WARM_DISCOVERY=1` is set.
|
|
7
|
+
|
|
8
|
+
## 0.5.19
|
|
9
|
+
|
|
10
|
+
- Makes `ctx-mcp` startup non-mutating: the MCP server now verifies the local embedding model without warming or rewriting `embeddings.db` during agent initialization.
|
|
11
|
+
- Fixes Antigravity staying on `ctx-mcp initializing...` when a large embedding cache makes startup writes slow or blocked.
|
|
12
|
+
|
|
3
13
|
## 0.5.18
|
|
4
14
|
|
|
5
15
|
- Prevents `ctx sync --rules` from importing project MCP commands that point into temporary directories such as `/tmp/...`.
|
package/bin/ctx.js
CHANGED
|
@@ -299,16 +299,21 @@ async function warmInstallEmbeddings() {
|
|
|
299
299
|
dataDir,
|
|
300
300
|
allowRemote: !modelReady
|
|
301
301
|
});
|
|
302
|
-
const
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
302
|
+
const warmDiscovery = process.env.CONTEXTOS_INSTALL_WARM_DISCOVERY === "1";
|
|
303
|
+
const skillResult = warmDiscovery
|
|
304
|
+
? await warmSkillEmbeddings({
|
|
305
|
+
cwd: process.cwd(),
|
|
306
|
+
dataDir,
|
|
307
|
+
allowRemote: !modelReady
|
|
308
|
+
})
|
|
309
|
+
: { count: 0 };
|
|
310
|
+
const workflowResult = warmDiscovery
|
|
311
|
+
? await warmWorkflowEmbeddings({
|
|
312
|
+
cwd: process.cwd(),
|
|
313
|
+
dataDir,
|
|
314
|
+
allowRemote: !modelReady
|
|
315
|
+
})
|
|
316
|
+
: { count: 0 };
|
|
312
317
|
return { ...result, modelAlreadyCached: modelReady, fileCount: fileResult.count, skillCount: skillResult.count, workflowCount: workflowResult.count };
|
|
313
318
|
}
|
|
314
319
|
|
package/package.json
CHANGED
|
@@ -268,6 +268,10 @@ function readRulerMcpServers({ tomlPath } = {}) {
|
|
|
268
268
|
return servers;
|
|
269
269
|
}
|
|
270
270
|
|
|
271
|
+
function readRulerMcpServer({ tomlPath, name } = {}) {
|
|
272
|
+
return readRulerMcpServers({ tomlPath }).find((server) => server.name === name) || null;
|
|
273
|
+
}
|
|
274
|
+
|
|
271
275
|
function antigravityMcpConfigPaths() {
|
|
272
276
|
const home = process.env.HOME || process.cwd();
|
|
273
277
|
return [
|
|
@@ -415,7 +419,12 @@ export function injectCtxMcp({ tomlPath, mcpServerPath, agents = DEFAULT_AGENTS,
|
|
|
415
419
|
|
|
416
420
|
let content = fs.readFileSync(tomlPath, "utf8");
|
|
417
421
|
const sectionExists = hasTomlSection(content, `mcp_servers.${CTX_MCP_NAME}`);
|
|
418
|
-
if (sectionExists && !force)
|
|
422
|
+
if (sectionExists && !force) {
|
|
423
|
+
const existingServer = readRulerMcpServer({ tomlPath, name: CTX_MCP_NAME });
|
|
424
|
+
const existingPath = existingServer?.command === "node" ? existingServer.args?.[0] : existingServer?.command;
|
|
425
|
+
if (existingPath && isRunnableMcpCommand(existingPath)) return { changed: false, existed: true };
|
|
426
|
+
force = true;
|
|
427
|
+
}
|
|
419
428
|
|
|
420
429
|
if (force) {
|
|
421
430
|
content = removeTomlSection(content, "mcp");
|
|
@@ -4,7 +4,7 @@ import net from "node:net";
|
|
|
4
4
|
|
|
5
5
|
import { StdioServerTransport } from "@modelcontextprotocol/sdk/server/stdio.js";
|
|
6
6
|
|
|
7
|
-
import {
|
|
7
|
+
import { isModelCacheReady, modelCacheDir } from "../lib/embedding-scorer.js";
|
|
8
8
|
import { scoreContext } from "../lib/score-context.js";
|
|
9
9
|
import { ctxMcpSocketPath } from "../lib/ctx-mcp-client.js";
|
|
10
10
|
import { defaultDataRoot } from "../lib/workspace-data.js";
|
|
@@ -24,15 +24,9 @@ await server.connect(new StdioServerTransport());
|
|
|
24
24
|
|
|
25
25
|
async function ensureModelReady() {
|
|
26
26
|
const modelDir = modelCacheDir(dataDir);
|
|
27
|
-
if (!fs.existsSync(modelDir)) {
|
|
27
|
+
if (!fs.existsSync(modelDir) || !isModelCacheReady(dataDir)) {
|
|
28
28
|
throw new Error(`ContextOS model cache missing: ${modelDir}. Run ctx install first.`);
|
|
29
29
|
}
|
|
30
|
-
await warmRuleEmbeddings({
|
|
31
|
-
task: "contextos mcp model ready",
|
|
32
|
-
rules: [{ content: "ContextOS semantic scorer is ready." }],
|
|
33
|
-
dataDir,
|
|
34
|
-
allowRemote: false
|
|
35
|
-
});
|
|
36
30
|
}
|
|
37
31
|
|
|
38
32
|
function startBridge() {
|