context-mode 1.0.134 → 1.0.136
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/.codex-plugin/hooks.json +65 -0
- package/.codex-plugin/mcp.json +9 -0
- package/.codex-plugin/plugin.json +31 -0
- package/.openclaw-plugin/openclaw.plugin.json +1 -1
- package/.openclaw-plugin/package.json +1 -1
- package/README.md +60 -12
- package/build/adapters/detect.d.ts +3 -1
- package/build/adapters/detect.js +7 -2
- package/build/adapters/pi/mcp-bridge.d.ts +44 -0
- package/build/adapters/pi/mcp-bridge.js +149 -3
- package/build/cli.js +17 -0
- package/build/lifecycle.d.ts +13 -13
- package/build/lifecycle.js +14 -14
- package/build/runtime.js +8 -5
- package/build/session/analytics.d.ts +0 -13
- package/build/session/analytics.js +50 -1
- package/build/session/extract.js +39 -1
- package/build/util/claude-config.d.ts +12 -6
- package/build/util/claude-config.js +16 -23
- package/cli.bundle.mjs +135 -133
- package/configs/kilo/kilo.json +9 -2
- package/configs/opencode/opencode.json +9 -2
- package/hooks/codex/platform.mjs +1 -0
- package/hooks/codex/posttooluse.mjs +1 -0
- package/hooks/codex/precompact.mjs +1 -0
- package/hooks/codex/pretooluse.mjs +1 -0
- package/hooks/codex/sessionstart.mjs +24 -1
- package/hooks/codex/stop.mjs +1 -0
- package/hooks/codex/userpromptsubmit.mjs +1 -0
- package/hooks/core/platform-detect.mjs +1 -1
- package/hooks/core/routing.mjs +112 -10
- package/hooks/ensure-deps.mjs +14 -3
- package/hooks/normalize-hooks.mjs +5 -2
- package/hooks/security.bundle.mjs +1 -1
- package/hooks/session-extract.bundle.mjs +2 -2
- package/openclaw.plugin.json +1 -1
- package/package.json +2 -1
- package/scripts/heal-installed-plugins.mjs +67 -0
- package/server.bundle.mjs +99 -99
- package/start.mjs +73 -11
- package/build/openclaw-plugin.d.ts +0 -130
- package/build/openclaw-plugin.js +0 -626
- package/build/opencode-plugin.d.ts +0 -122
- package/build/opencode-plugin.js +0 -372
- package/build/pi-extension.d.ts +0 -14
- package/build/pi-extension.js +0 -451
- package/build/util/db-lock.d.ts +0 -65
- package/build/util/db-lock.js +0 -166
|
@@ -394,3 +394,70 @@ export function healMcpJsonArgs({ pluginRoot, pluginCacheRoot, pluginKey }) {
|
|
|
394
394
|
|
|
395
395
|
return { healed };
|
|
396
396
|
}
|
|
397
|
+
|
|
398
|
+
/**
|
|
399
|
+
* Heal user-level ~/.claude.json MCP server registrations that point to an
|
|
400
|
+
* old context-mode version dir in the plugin cache.
|
|
401
|
+
*
|
|
402
|
+
* Users who work around the Claude Code plugin MCP tool-exposure bug
|
|
403
|
+
* (anthropics/claude-code#59310) by running `claude mcp add --scope user`
|
|
404
|
+
* end up with an absolute path to a specific version dir in ~/.claude.json.
|
|
405
|
+
* After /ctx-upgrade that path is stale — this heal detects and updates it.
|
|
406
|
+
*
|
|
407
|
+
* @param {{
|
|
408
|
+
* dotClaudeJsonPath: string,
|
|
409
|
+
* pluginCacheParent: string,
|
|
410
|
+
* newPluginRoot: string,
|
|
411
|
+
* }} opts
|
|
412
|
+
* @returns {HealResult}
|
|
413
|
+
*/
|
|
414
|
+
export function healClaudeJsonMcpArgs({ dotClaudeJsonPath, pluginCacheParent, newPluginRoot }) {
|
|
415
|
+
if (!dotClaudeJsonPath || !existsSync(dotClaudeJsonPath)) {
|
|
416
|
+
return { healed: [], skipped: "no-claude-json" };
|
|
417
|
+
}
|
|
418
|
+
|
|
419
|
+
let raw;
|
|
420
|
+
try { raw = readFileSync(dotClaudeJsonPath, "utf-8"); }
|
|
421
|
+
catch (err) { return { healed: [], error: `read-failed: ${(err && err.message) || err}` }; }
|
|
422
|
+
|
|
423
|
+
let config;
|
|
424
|
+
try { config = JSON.parse(raw); }
|
|
425
|
+
catch (err) { return { healed: [], error: `parse-failed: ${(err && err.message) || err}` }; }
|
|
426
|
+
|
|
427
|
+
const servers = config && config.mcpServers;
|
|
428
|
+
if (!servers || typeof servers !== "object") {
|
|
429
|
+
return { healed: [], skipped: "no-mcp-servers" };
|
|
430
|
+
}
|
|
431
|
+
|
|
432
|
+
const cacheParentFwd = pluginCacheParent.replace(/\\/g, "/");
|
|
433
|
+
|
|
434
|
+
let mutated = false;
|
|
435
|
+
for (const srv of Object.values(servers)) {
|
|
436
|
+
if (!srv || typeof srv !== "object" || !Array.isArray(srv.args)) continue;
|
|
437
|
+
for (let i = 0; i < srv.args.length; i++) {
|
|
438
|
+
const arg = srv.args[i];
|
|
439
|
+
if (typeof arg !== "string") continue;
|
|
440
|
+
const argFwd = arg.replace(/\\/g, "/");
|
|
441
|
+
if (!argFwd.startsWith(cacheParentFwd + "/")) continue;
|
|
442
|
+
const rel = argFwd.slice(cacheParentFwd.length + 1);
|
|
443
|
+
const slashIdx = rel.indexOf("/");
|
|
444
|
+
if (slashIdx < 0) continue;
|
|
445
|
+
const suffix = rel.slice(slashIdx + 1);
|
|
446
|
+
const newArg = resolve(newPluginRoot, suffix);
|
|
447
|
+
if (newArg !== arg) {
|
|
448
|
+
srv.args[i] = newArg;
|
|
449
|
+
mutated = true;
|
|
450
|
+
}
|
|
451
|
+
}
|
|
452
|
+
}
|
|
453
|
+
|
|
454
|
+
if (!mutated) return { healed: [] };
|
|
455
|
+
|
|
456
|
+
try {
|
|
457
|
+
writeFileSync(dotClaudeJsonPath, JSON.stringify(config, null, 2), "utf-8");
|
|
458
|
+
} catch (err) {
|
|
459
|
+
return { healed: [], error: `write-failed: ${(err && err.message) || err}` };
|
|
460
|
+
}
|
|
461
|
+
|
|
462
|
+
return { healed: ["claude-json-mcp-args"] };
|
|
463
|
+
}
|