context-mode 0.9.5 → 0.9.6
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/.claude-plugin/marketplace.json +1 -1
- package/.claude-plugin/plugin.json +1 -1
- package/build/cli.js +45 -43
- package/package.json +1 -1
|
@@ -13,7 +13,7 @@
|
|
|
13
13
|
"name": "context-mode",
|
|
14
14
|
"source": "./",
|
|
15
15
|
"description": "Claude Code MCP plugin that saves 98% of your context window. Sandboxed code execution in 11 languages, FTS5 knowledge base with BM25 ranking, and intent-driven search.",
|
|
16
|
-
"version": "0.9.
|
|
16
|
+
"version": "0.9.6",
|
|
17
17
|
"author": {
|
|
18
18
|
"name": "Mert Koseoğlu"
|
|
19
19
|
},
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "context-mode",
|
|
3
|
-
"version": "0.9.
|
|
3
|
+
"version": "0.9.6",
|
|
4
4
|
"description": "Claude Code MCP plugin that saves 98% of your context window. Sandboxed code execution in 11 languages, FTS5 knowledge base with BM25 ranking, and intent-driven search.",
|
|
5
5
|
"author": {
|
|
6
6
|
"name": "Mert Koseoğlu",
|
package/build/cli.js
CHANGED
|
@@ -392,55 +392,57 @@ async function upgrade() {
|
|
|
392
392
|
timeout: 60000,
|
|
393
393
|
});
|
|
394
394
|
s.stop("Dependencies ready");
|
|
395
|
-
// Step 2.5:
|
|
396
|
-
//
|
|
395
|
+
// Step 2.5: Write temp script and spawn to update registry & clean cache
|
|
396
|
+
// Uses a file instead of node -e to avoid shell escaping issues
|
|
397
397
|
s.start("Updating plugin registry");
|
|
398
398
|
try {
|
|
399
|
-
const
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
`;
|
|
439
|
-
const result = execSync(`node -e ${JSON.stringify(postUpgradeScript)}`, {
|
|
399
|
+
const scriptPath = resolve(tmpDir + "-post-upgrade.mjs");
|
|
400
|
+
const scriptContent = [
|
|
401
|
+
`import { readFileSync, writeFileSync, readdirSync, rmSync } from "fs";`,
|
|
402
|
+
`import { resolve } from "path";`,
|
|
403
|
+
`import { homedir } from "os";`,
|
|
404
|
+
`const pluginRoot = ${JSON.stringify(pluginRoot)};`,
|
|
405
|
+
`const newVersion = ${JSON.stringify(newVersion)};`,
|
|
406
|
+
`const ipPath = resolve(homedir(), ".claude", "plugins", "installed_plugins.json");`,
|
|
407
|
+
`try {`,
|
|
408
|
+
` const ipRaw = JSON.parse(readFileSync(ipPath, "utf-8"));`,
|
|
409
|
+
` const plugins = ipRaw.plugins || {};`,
|
|
410
|
+
` let updated = false;`,
|
|
411
|
+
` for (const [key, entries] of Object.entries(plugins)) {`,
|
|
412
|
+
` if (!key.toLowerCase().includes("context-mode")) continue;`,
|
|
413
|
+
` for (const entry of entries) {`,
|
|
414
|
+
` entry.installPath = pluginRoot;`,
|
|
415
|
+
` entry.version = newVersion;`,
|
|
416
|
+
` entry.lastUpdated = new Date().toISOString();`,
|
|
417
|
+
` updated = true;`,
|
|
418
|
+
` }`,
|
|
419
|
+
` }`,
|
|
420
|
+
` if (updated) {`,
|
|
421
|
+
` writeFileSync(ipPath, JSON.stringify(ipRaw, null, 2) + "\\n", "utf-8");`,
|
|
422
|
+
` console.log("REGISTRY_UPDATED");`,
|
|
423
|
+
` }`,
|
|
424
|
+
`} catch (e) { console.error("REGISTRY_FAILED:" + e.message); }`,
|
|
425
|
+
`const m = pluginRoot.match(/^(.*[\\\\/]plugins[\\\\/]cache[\\\\/][^\\\\/]+[\\\\/][^\\\\/]+[\\\\/])([^\\\\/]+)$/);`,
|
|
426
|
+
`if (m) {`,
|
|
427
|
+
` try {`,
|
|
428
|
+
` const dirs = readdirSync(m[1]).filter(d => d !== m[2]);`,
|
|
429
|
+
` for (const old of dirs) {`,
|
|
430
|
+
` try { rmSync(resolve(m[1], old), { recursive: true, force: true }); } catch {}`,
|
|
431
|
+
` }`,
|
|
432
|
+
` if (dirs.length > 0) console.log("CLEANED:" + dirs.length);`,
|
|
433
|
+
` } catch {}`,
|
|
434
|
+
`}`,
|
|
435
|
+
].join("\n");
|
|
436
|
+
writeFileSync(scriptPath, scriptContent, "utf-8");
|
|
437
|
+
const result = execSync(`node ${scriptPath}`, {
|
|
440
438
|
stdio: "pipe",
|
|
441
439
|
timeout: 10000,
|
|
442
440
|
encoding: "utf-8",
|
|
443
441
|
});
|
|
442
|
+
try {
|
|
443
|
+
rmSync(scriptPath, { force: true });
|
|
444
|
+
}
|
|
445
|
+
catch { /* ignore */ }
|
|
444
446
|
if (result.includes("REGISTRY_UPDATED")) {
|
|
445
447
|
s.stop(color.green("Plugin registry updated"));
|
|
446
448
|
changes.push("Updated plugin registry");
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "context-mode",
|
|
3
|
-
"version": "0.9.
|
|
3
|
+
"version": "0.9.6",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "Claude Code MCP plugin that saves 98% of your context window. Sandboxed code execution, FTS5 knowledge base, and intent-driven search.",
|
|
6
6
|
"author": "Mert Koseoğlu",
|