context-mode 1.0.120 → 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.
@@ -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.120",
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.120",
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 .codex-plugin/marketplace.json .openclaw-plugin/openclaw.plugin.json .openclaw-plugin/package.json openclaw.plugin.json .pi/extensions/context-mode/package.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",
@@ -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
- try {
275
- const { normalizeHooksOnStartup } = await import("../hooks/normalize-hooks.mjs");
276
- normalizeHooksOnStartup({
277
- pluginRoot: pkgRoot,
278
- nodePath: process.execPath,
279
- platform: process.platform,
280
- });
281
- } catch { /* best effort never block install */ }
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
+ }
package/skills/.ignore ADDED
@@ -0,0 +1,7 @@
1
+ # Files in this directory that are NOT skills.
2
+ # Pi's skill loader (@mariozechner/pi-coding-agent) reads `.ignore`, `.gitignore`,
3
+ # and `.fdignore` while scanning skill directories with includeRootFiles=true,
4
+ # and skips matching entries. Keeping this list in-package guarantees Pi will not
5
+ # attempt to parse non-skill markdown as a skill — even if a stale copy of the
6
+ # file ever slips into a published tarball (see issue #496 / v1.0.120 regression).
7
+ UPSTREAM-CREDITS.md