context-mode 1.0.50 → 1.0.52
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/cli.bundle.mjs +96 -96
- package/hooks/cursor/posttooluse.mjs +1 -0
- package/hooks/cursor/sessionstart.mjs +1 -0
- package/hooks/ensure-deps.mjs +39 -0
- package/hooks/gemini-cli/aftertool.mjs +1 -0
- package/hooks/gemini-cli/precompress.mjs +1 -0
- package/hooks/gemini-cli/sessionstart.mjs +1 -0
- package/hooks/kiro/posttooluse.mjs +1 -0
- package/hooks/posttooluse.mjs +1 -0
- package/hooks/precompact.mjs +1 -0
- package/hooks/sessionstart.mjs +1 -0
- package/hooks/userpromptsubmit.mjs +1 -0
- package/hooks/vscode-copilot/posttooluse.mjs +1 -0
- package/hooks/vscode-copilot/precompact.mjs +1 -0
- package/hooks/vscode-copilot/sessionstart.mjs +1 -0
- package/openclaw.plugin.json +1 -1
- package/package.json +2 -2
- package/server.bundle.mjs +80 -80
- package/start.mjs +5 -3
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Shared dependency bootstrap for hooks and start.mjs.
|
|
3
|
+
*
|
|
4
|
+
* Single source of truth — ensures native deps (better-sqlite3) are
|
|
5
|
+
* installed in the plugin cache before any hook or server code runs.
|
|
6
|
+
*
|
|
7
|
+
* Pattern: same as suppress-stderr.mjs — imported at the top of every
|
|
8
|
+
* hook that needs native modules. Fast path: existsSync check (~0.1ms).
|
|
9
|
+
* Slow path: npm install (first run only, ~5-30s).
|
|
10
|
+
*
|
|
11
|
+
* @see https://github.com/mksglu/context-mode/issues/172
|
|
12
|
+
*/
|
|
13
|
+
|
|
14
|
+
import { existsSync } from "node:fs";
|
|
15
|
+
import { execSync } from "node:child_process";
|
|
16
|
+
import { resolve, dirname } from "node:path";
|
|
17
|
+
import { fileURLToPath } from "node:url";
|
|
18
|
+
|
|
19
|
+
const __dirname = dirname(fileURLToPath(import.meta.url));
|
|
20
|
+
const root = resolve(__dirname, "..");
|
|
21
|
+
|
|
22
|
+
const NATIVE_DEPS = ["better-sqlite3"];
|
|
23
|
+
|
|
24
|
+
export function ensureDeps() {
|
|
25
|
+
for (const pkg of NATIVE_DEPS) {
|
|
26
|
+
if (!existsSync(resolve(root, "node_modules", pkg))) {
|
|
27
|
+
try {
|
|
28
|
+
execSync(`npm install ${pkg} --no-package-lock --no-save --silent`, {
|
|
29
|
+
cwd: root,
|
|
30
|
+
stdio: "pipe",
|
|
31
|
+
timeout: 120000,
|
|
32
|
+
});
|
|
33
|
+
} catch { /* best effort — hook degrades gracefully without DB */ }
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
// Auto-run on import (like suppress-stderr.mjs)
|
|
39
|
+
ensureDeps();
|
package/hooks/posttooluse.mjs
CHANGED
package/hooks/precompact.mjs
CHANGED
package/hooks/sessionstart.mjs
CHANGED
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.52",
|
|
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.52",
|
|
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",
|
|
@@ -59,7 +59,7 @@
|
|
|
59
59
|
"LICENSE"
|
|
60
60
|
],
|
|
61
61
|
"scripts": {
|
|
62
|
-
"build": "tsc && node -e \"if(process.platform!=='win32'){require('fs').chmodSync('build/cli.js',0o755)}\"",
|
|
62
|
+
"build": "tsc && node -e \"if(process.platform!=='win32'){require('fs').chmodSync('build/cli.js',0o755)}\" && npm run bundle",
|
|
63
63
|
"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",
|
|
64
64
|
"version-sync": "node scripts/version-sync.mjs",
|
|
65
65
|
"version": "node scripts/version-sync.mjs && git add .claude-plugin/plugin.json .claude-plugin/marketplace.json .openclaw-plugin/openclaw.plugin.json .openclaw-plugin/package.json openclaw.plugin.json .pi/extensions/context-mode/package.json",
|