context-mode 1.0.51 → 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/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 +1 -1
- package/start.mjs +5 -3
|
@@ -6,14 +6,14 @@
|
|
|
6
6
|
},
|
|
7
7
|
"metadata": {
|
|
8
8
|
"description": "Claude Code plugins by Mert Koseoğlu",
|
|
9
|
-
"version": "1.0.
|
|
9
|
+
"version": "1.0.52"
|
|
10
10
|
},
|
|
11
11
|
"plugins": [
|
|
12
12
|
{
|
|
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": "1.0.
|
|
16
|
+
"version": "1.0.52",
|
|
17
17
|
"author": {
|
|
18
18
|
"name": "Mert Koseoğlu"
|
|
19
19
|
},
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "context-mode",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.52",
|
|
4
4
|
"description": "MCP server that saves 98% of your context window with session continuity. Sandboxed code execution in 11 languages, FTS5 knowledge base with BM25 ranking, and automatic state restore across compactions.",
|
|
5
5
|
"author": {
|
|
6
6
|
"name": "Mert Koseoğlu",
|
|
@@ -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",
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "context-mode",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.52",
|
|
4
4
|
"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.",
|
|
5
5
|
"author": {
|
|
6
6
|
"name": "Mert Koseoğlu",
|
|
@@ -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",
|
package/start.mjs
CHANGED
|
@@ -115,14 +115,16 @@ if (cacheMatch) {
|
|
|
115
115
|
}
|
|
116
116
|
}
|
|
117
117
|
|
|
118
|
-
// Ensure
|
|
119
|
-
|
|
118
|
+
// Ensure native dependencies are available (shared with hooks via ensure-deps.mjs)
|
|
119
|
+
import { ensureDeps } from "./hooks/ensure-deps.mjs";
|
|
120
|
+
// ensure-deps handles better-sqlite3; also install pure-JS deps used by server
|
|
121
|
+
for (const pkg of ["turndown", "turndown-plugin-gfm", "@mixmark-io/domino"]) {
|
|
120
122
|
if (!existsSync(resolve(__dirname, "node_modules", pkg))) {
|
|
121
123
|
try {
|
|
122
124
|
execSync(`npm install ${pkg} --no-package-lock --no-save --silent`, {
|
|
123
125
|
cwd: __dirname,
|
|
124
126
|
stdio: "pipe",
|
|
125
|
-
timeout:
|
|
127
|
+
timeout: 120000,
|
|
126
128
|
});
|
|
127
129
|
} catch { /* best effort */ }
|
|
128
130
|
}
|