context-mode 1.0.7 → 1.0.8

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.
@@ -6,14 +6,14 @@
6
6
  },
7
7
  "metadata": {
8
8
  "description": "Claude Code plugins by Mert Koseoğlu",
9
- "version": "1.0.7"
9
+ "version": "1.0.8"
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.7",
16
+ "version": "1.0.8",
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.7",
3
+ "version": "1.0.8",
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",
package/build/cli.js CHANGED
@@ -14,7 +14,7 @@
14
14
  import * as p from "@clack/prompts";
15
15
  import color from "picocolors";
16
16
  import { execSync } from "node:child_process";
17
- import { readFileSync, cpSync, accessSync, readdirSync, rmSync, closeSync, openSync, constants } from "node:fs";
17
+ import { readFileSync, cpSync, accessSync, existsSync, readdirSync, rmSync, closeSync, openSync, constants } from "node:fs";
18
18
  import { resolve, dirname, join } from "node:path";
19
19
  import { tmpdir, devNull } from "node:os";
20
20
  import { fileURLToPath, pathToFileURL } from "node:url";
@@ -91,7 +91,11 @@ export function toUnixPath(p) {
91
91
  function getPluginRoot() {
92
92
  const __filename = fileURLToPath(import.meta.url);
93
93
  const __dirname = dirname(__filename);
94
- return resolve(__dirname, "..");
94
+ // build/cli.js → go up one level; cli.bundle.mjs at project root → stay here
95
+ if (__dirname.endsWith("/build") || __dirname.endsWith("\\build")) {
96
+ return resolve(__dirname, "..");
97
+ }
98
+ return __dirname;
95
99
  }
96
100
  function getLocalVersion() {
97
101
  try {
@@ -370,7 +374,7 @@ async function upgrade() {
370
374
  }
371
375
  const items = [
372
376
  "build", "src", "hooks", "skills", ".claude-plugin",
373
- "start.mjs", "server.bundle.mjs", "package.json", ".mcp.json",
377
+ "start.mjs", "server.bundle.mjs", "cli.bundle.mjs", "package.json", ".mcp.json",
374
378
  ];
375
379
  for (const item of items) {
376
380
  try {
@@ -445,14 +449,16 @@ async function upgrade() {
445
449
  // Step 5: Set hook script permissions — adapter-aware
446
450
  p.log.step("Setting hook script permissions...");
447
451
  const permSet = adapter.setHookPermissions(pluginRoot);
448
- // Also ensure CLI binary is executable (tsc doesn't set +x)
449
- const cliBin = resolve(pluginRoot, "build", "cli.js");
450
- try {
451
- accessSync(cliBin, constants.F_OK);
452
- execSync(`chmod +x "${cliBin}"`, { stdio: "ignore" });
453
- permSet.push(cliBin);
452
+ // Also ensure CLI binaries are executable (tsc doesn't set +x)
453
+ for (const bin of ["build/cli.js", "cli.bundle.mjs"]) {
454
+ const binPath = resolve(pluginRoot, bin);
455
+ try {
456
+ accessSync(binPath, constants.F_OK);
457
+ execSync(`chmod +x "${binPath}"`, { stdio: "ignore" });
458
+ permSet.push(binPath);
459
+ }
460
+ catch { /* not found — skip */ }
454
461
  }
455
- catch { /* cli.js not found — skip */ }
456
462
  if (permSet.length > 0) {
457
463
  p.log.success(color.green("Permissions set") + color.dim(` — ${permSet.length} hook script(s)`));
458
464
  changes.push(`Set ${permSet.length} hook scripts as executable`);
@@ -472,7 +478,10 @@ async function upgrade() {
472
478
  p.log.step("Running doctor to verify...");
473
479
  console.log();
474
480
  try {
475
- execSync(`node "${resolve(pluginRoot, "build", "cli.js")}" doctor`, {
481
+ const cliBundlePath = resolve(pluginRoot, "cli.bundle.mjs");
482
+ const cliBuildPath = resolve(pluginRoot, "build", "cli.js");
483
+ const cliPath = existsSync(cliBundlePath) ? cliBundlePath : cliBuildPath;
484
+ execSync(`node "${cliPath}" doctor`, {
476
485
  stdio: "inherit",
477
486
  timeout: 30000,
478
487
  cwd: pluginRoot,
package/build/server.js CHANGED
@@ -13,7 +13,7 @@ import { ContentStore, cleanupStaleDBs } from "./store.js";
13
13
  import { readBashPolicies, evaluateCommandDenyOnly, extractShellCommands, readToolDenyPatterns, evaluateFilePath, } from "./security.js";
14
14
  import { detectRuntimes, getRuntimeSummary, getAvailableLanguages, hasBunRuntime, } from "./runtime.js";
15
15
  import { classifyNonZeroExit } from "./exit-classify.js";
16
- const VERSION = "1.0.7";
16
+ const VERSION = "1.0.8";
17
17
  // Prevent silent server death from unhandled async errors
18
18
  process.on("unhandledRejection", (err) => {
19
19
  process.stderr.write(`[context-mode] unhandledRejection: ${err}\n`);