context-mode 0.9.1 → 0.9.3
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 +63 -33
- 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.3",
|
|
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.3",
|
|
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
|
@@ -76,12 +76,26 @@ async function fetchLatestVersion() {
|
|
|
76
76
|
}
|
|
77
77
|
}
|
|
78
78
|
function getMarketplaceVersion() {
|
|
79
|
-
//
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
79
|
+
// Primary: read from installed_plugins.json (source of truth for Claude Code)
|
|
80
|
+
try {
|
|
81
|
+
const ipPath = resolve(homedir(), ".claude", "plugins", "installed_plugins.json");
|
|
82
|
+
const ipRaw = JSON.parse(readFileSync(ipPath, "utf-8"));
|
|
83
|
+
const plugins = ipRaw.plugins ?? {};
|
|
84
|
+
for (const [key, entries] of Object.entries(plugins)) {
|
|
85
|
+
if (!key.toLowerCase().includes("context-mode"))
|
|
86
|
+
continue;
|
|
87
|
+
const arr = entries;
|
|
88
|
+
if (arr.length > 0 && typeof arr[0].version === "string") {
|
|
89
|
+
return arr[0].version;
|
|
90
|
+
}
|
|
91
|
+
}
|
|
92
|
+
}
|
|
93
|
+
catch { /* fallback below */ }
|
|
94
|
+
// Fallback: read from own package.json
|
|
95
|
+
const localVer = getLocalVersion();
|
|
96
|
+
if (localVer !== "unknown")
|
|
97
|
+
return localVer;
|
|
98
|
+
// Last resort: scan common plugin cache locations
|
|
85
99
|
const bases = [
|
|
86
100
|
resolve(homedir(), ".claude"),
|
|
87
101
|
resolve(homedir(), ".config", "claude"),
|
|
@@ -378,38 +392,54 @@ async function upgrade() {
|
|
|
378
392
|
timeout: 60000,
|
|
379
393
|
});
|
|
380
394
|
s.stop("Dependencies ready");
|
|
381
|
-
// Step 2.5:
|
|
382
|
-
const
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
const
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
395
|
+
// Step 2.5: Update installed_plugins.json to point to current directory with new version
|
|
396
|
+
const installedPluginsPath = resolve(homedir(), ".claude", "plugins", "installed_plugins.json");
|
|
397
|
+
s.start("Updating plugin registry");
|
|
398
|
+
try {
|
|
399
|
+
const ipRaw = JSON.parse(readFileSync(installedPluginsPath, "utf-8"));
|
|
400
|
+
const plugins = ipRaw.plugins ?? {};
|
|
401
|
+
let updated = false;
|
|
402
|
+
for (const [key, entries] of Object.entries(plugins)) {
|
|
403
|
+
if (!key.toLowerCase().includes("context-mode"))
|
|
404
|
+
continue;
|
|
405
|
+
for (const entry of entries) {
|
|
406
|
+
entry.installPath = pluginRoot;
|
|
407
|
+
entry.version = newVersion;
|
|
408
|
+
entry.lastUpdated = new Date().toISOString();
|
|
409
|
+
updated = true;
|
|
410
|
+
}
|
|
394
411
|
}
|
|
395
|
-
|
|
396
|
-
|
|
412
|
+
if (updated) {
|
|
413
|
+
writeFileSync(installedPluginsPath, JSON.stringify(ipRaw, null, 2) + "\n", "utf-8");
|
|
414
|
+
s.stop(color.green("Plugin registry updated"));
|
|
415
|
+
changes.push("Updated plugin registry");
|
|
397
416
|
}
|
|
398
|
-
|
|
399
|
-
|
|
417
|
+
else {
|
|
418
|
+
s.stop(color.yellow("No context-mode entry found in plugin registry"));
|
|
419
|
+
}
|
|
420
|
+
}
|
|
421
|
+
catch (err) {
|
|
422
|
+
s.stop(color.yellow("Plugin registry update skipped"));
|
|
423
|
+
p.log.warn(color.yellow("Could not update installed_plugins.json") + color.dim(` — ${err instanceof Error ? err.message : String(err)}`));
|
|
424
|
+
}
|
|
425
|
+
// Clean up old cache directories (keep only current)
|
|
426
|
+
const cacheMatch = pluginRoot.match(/^(.*\/plugins\/cache\/[^/]+\/[^/]+\/)([^/]+)$/);
|
|
427
|
+
if (cacheMatch) {
|
|
428
|
+
const cacheParent = cacheMatch[1];
|
|
429
|
+
const currentDir = cacheMatch[2];
|
|
400
430
|
try {
|
|
401
|
-
const
|
|
402
|
-
const
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
431
|
+
const dirs = readdirSync(cacheParent).filter(d => d !== currentDir);
|
|
432
|
+
for (const old of dirs) {
|
|
433
|
+
try {
|
|
434
|
+
rmSync(resolve(cacheParent, old), { recursive: true, force: true });
|
|
435
|
+
}
|
|
436
|
+
catch { /* skip */ }
|
|
437
|
+
}
|
|
438
|
+
if (dirs.length > 0) {
|
|
439
|
+
p.log.info(color.dim(` Cleaned ${dirs.length} old cache dir(s)`));
|
|
408
440
|
}
|
|
409
441
|
}
|
|
410
|
-
catch {
|
|
411
|
-
p.log.warn(color.yellow("Could not update installed_plugins.json — marketplace may show old version"));
|
|
412
|
-
}
|
|
442
|
+
catch { /* parent doesn't exist or not readable */ }
|
|
413
443
|
}
|
|
414
444
|
// Update global npm package from same GitHub source
|
|
415
445
|
s.start("Updating npm global package");
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "context-mode",
|
|
3
|
-
"version": "0.9.
|
|
3
|
+
"version": "0.9.3",
|
|
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",
|