context-mode 1.0.119 → 1.0.121
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 +2 -2
- package/.claude-plugin/plugin.json +1 -1
- package/.openclaw-plugin/openclaw.plugin.json +1 -1
- package/.openclaw-plugin/package.json +1 -1
- package/build/adapters/openclaw/mcp-tools.js +10 -1
- package/build/cli.js +18 -0
- package/build/server.js +79 -22
- package/build/session/purge.d.ts +27 -0
- package/build/session/purge.js +105 -3
- package/cli.bundle.mjs +171 -149
- package/openclaw.plugin.json +1 -1
- package/package.json +2 -2
- package/scripts/postinstall.mjs +19 -8
- package/server.bundle.mjs +132 -110
- package/skills/.ignore +7 -0
- package/skills/ctx-purge/SKILL.md +23 -9
package/openclaw.plugin.json
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
"name": "Context Mode",
|
|
4
4
|
"kind": "tool",
|
|
5
5
|
"description": "OpenClaw plugin that saves 98% of your context window. Sandboxed code execution in 11 languages, FTS5 knowledge base with BM25 ranking, and intent-driven search.",
|
|
6
|
-
"version": "1.0.
|
|
6
|
+
"version": "1.0.121",
|
|
7
7
|
"sandbox": {
|
|
8
8
|
"mode": "permissive",
|
|
9
9
|
"filesystem_access": "full",
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "context-mode",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.121",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "MCP plugin that saves 98% of your context window. Works with Claude Code, Gemini CLI, VS Code Copilot, OpenCode, and Codex CLI. Sandboxed code execution, FTS5 knowledge base, and intent-driven search.",
|
|
6
6
|
"author": "Mert Koseoğlu",
|
|
@@ -88,7 +88,7 @@
|
|
|
88
88
|
"assert-bundle": "node scripts/assert-bundle.mjs server.bundle.mjs cli.bundle.mjs hooks/session-extract.bundle.mjs hooks/session-snapshot.bundle.mjs hooks/session-db.bundle.mjs",
|
|
89
89
|
"bundle": "esbuild src/server.ts --bundle --platform=node --target=node18 --format=esm --outfile=server.bundle.mjs --external:better-sqlite3 --external:turndown --external:turndown-plugin-gfm --external:@mixmark-io/domino --minify && esbuild src/cli.ts --bundle --platform=node --target=node18 --format=esm --outfile=cli.bundle.mjs --external:better-sqlite3 --minify && esbuild src/session/extract.ts --bundle --platform=node --target=node18 --format=esm --outfile=hooks/session-extract.bundle.mjs --minify && esbuild src/session/snapshot.ts --bundle --platform=node --target=node18 --format=esm --outfile=hooks/session-snapshot.bundle.mjs --minify && esbuild src/session/db.ts --bundle --platform=node --target=node18 --format=esm --outfile=hooks/session-db.bundle.mjs --external:better-sqlite3 --minify",
|
|
90
90
|
"version-sync": "node scripts/version-sync.mjs",
|
|
91
|
-
"version": "node scripts/version-sync.mjs && git add package.json .claude-plugin/plugin.json .claude-plugin/marketplace.json .cursor-plugin/plugin.json .codex-plugin/plugin.json .
|
|
91
|
+
"version": "node scripts/version-sync.mjs && git add package.json .claude-plugin/plugin.json .claude-plugin/marketplace.json .cursor-plugin/plugin.json .codex-plugin/plugin.json .openclaw-plugin/openclaw.plugin.json .openclaw-plugin/package.json openclaw.plugin.json .pi/extensions/context-mode/package.json",
|
|
92
92
|
"prepublishOnly": "npm run build",
|
|
93
93
|
"dev": "npx tsx src/server.ts",
|
|
94
94
|
"setup": "npx tsx src/cli.ts setup",
|
package/scripts/postinstall.mjs
CHANGED
|
@@ -271,11 +271,22 @@ try { healBetterSqlite3Binding(pkgRoot); } catch { /* best effort — don't bloc
|
|
|
271
271
|
// PATH lookup failure). start.mjs normalizes on every MCP boot, but normalizing
|
|
272
272
|
// here too closes the gap for the very first hook fire after a fresh install
|
|
273
273
|
// (before any MCP server has run).
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
274
|
+
//
|
|
275
|
+
// Guard: /ctx-upgrade clones the repo to `<tmpdir>/context-mode-upgrade-<epoch>/`
|
|
276
|
+
// and runs `npm install` there before `cpSync`-ing files into the real pluginRoot
|
|
277
|
+
// (src/cli.ts). If we normalize here, pkgRoot is the tmpdir → hooks.json gets
|
|
278
|
+
// the tmpdir's absolute paths baked in → cpSync copies that poisoned hooks.json
|
|
279
|
+
// into the real plugin dir → tmpdir is later cleaned → every hook fires with
|
|
280
|
+
// `MODULE_NOT_FOUND`. Detect the upgrade staging path and skip; start.mjs will
|
|
281
|
+
// normalize correctly on the next MCP boot from the real pluginRoot.
|
|
282
|
+
const TMPDIR_UPGRADE_RE = /[/\\]context-mode-upgrade-\d+[/\\]?$/;
|
|
283
|
+
if (!TMPDIR_UPGRADE_RE.test(pkgRoot)) {
|
|
284
|
+
try {
|
|
285
|
+
const { normalizeHooksOnStartup } = await import("../hooks/normalize-hooks.mjs");
|
|
286
|
+
normalizeHooksOnStartup({
|
|
287
|
+
pluginRoot: pkgRoot,
|
|
288
|
+
nodePath: process.execPath,
|
|
289
|
+
platform: process.platform,
|
|
290
|
+
});
|
|
291
|
+
} catch { /* best effort — never block install */ }
|
|
292
|
+
}
|