context-mode 1.0.121 → 1.0.122

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.
Files changed (53) hide show
  1. package/.claude-plugin/marketplace.json +2 -2
  2. package/.claude-plugin/plugin.json +1 -1
  3. package/.openclaw-plugin/openclaw.plugin.json +1 -1
  4. package/.openclaw-plugin/package.json +1 -1
  5. package/README.md +4 -4
  6. package/build/adapters/claude-code/hooks.d.ts +16 -1
  7. package/build/adapters/claude-code/hooks.js +16 -0
  8. package/build/adapters/claude-code/index.js +2 -11
  9. package/build/adapters/codex/hooks.d.ts +19 -0
  10. package/build/adapters/codex/hooks.js +22 -0
  11. package/build/adapters/codex/index.js +8 -1
  12. package/build/adapters/copilot-base.d.ts +17 -1
  13. package/build/adapters/copilot-base.js +18 -2
  14. package/build/adapters/cursor/hooks.d.ts +14 -1
  15. package/build/adapters/cursor/hooks.js +14 -0
  16. package/build/adapters/detect.d.ts +12 -2
  17. package/build/adapters/detect.js +70 -3
  18. package/build/adapters/gemini-cli/hooks.d.ts +16 -0
  19. package/build/adapters/gemini-cli/hooks.js +19 -0
  20. package/build/adapters/gemini-cli/index.js +4 -2
  21. package/build/adapters/kiro/hooks.d.ts +16 -1
  22. package/build/adapters/kiro/hooks.js +19 -0
  23. package/build/adapters/pi/extension.d.ts +9 -0
  24. package/build/adapters/pi/extension.js +47 -0
  25. package/build/adapters/qwen-code/hooks.d.ts +26 -0
  26. package/build/adapters/qwen-code/hooks.js +29 -0
  27. package/build/adapters/qwen-code/index.js +6 -0
  28. package/build/cli.js +26 -1
  29. package/build/executor.js +18 -3
  30. package/build/lifecycle.d.ts +15 -0
  31. package/build/lifecycle.js +24 -1
  32. package/build/runtime.js +34 -13
  33. package/build/session/extract.js +150 -48
  34. package/build/session/snapshot.js +46 -0
  35. package/cli.bundle.mjs +137 -136
  36. package/configs/codex/hooks.json +1 -1
  37. package/configs/cursor/hooks.json +1 -1
  38. package/configs/kiro/agent.json +1 -1
  39. package/hooks/core/routing.mjs +56 -1
  40. package/hooks/cursor/hooks.json +1 -1
  41. package/hooks/ensure-deps.mjs +22 -3
  42. package/hooks/hooks.json +9 -0
  43. package/hooks/routing-block.mjs +5 -0
  44. package/hooks/session-extract.bundle.mjs +2 -2
  45. package/hooks/session-snapshot.bundle.mjs +21 -20
  46. package/openclaw.plugin.json +1 -1
  47. package/package.json +3 -3
  48. package/scripts/heal-better-sqlite3.mjs +188 -10
  49. package/scripts/heal-installed-plugins.mjs +111 -0
  50. package/scripts/postinstall.mjs +18 -2
  51. package/server.bundle.mjs +111 -111
  52. package/start.mjs +14 -1
  53. package/.mcp.json +0 -8
package/start.mjs CHANGED
@@ -122,7 +122,7 @@ if (cacheMatch) {
122
122
  // truth) so users who fix themselves via `npm install -g context-mode`
123
123
  // follow the exact same code path. Best-effort, never blocks MCP boot.
124
124
  try {
125
- const { healInstalledPlugins, healSettingsEnabledPlugins, healPluginJsonMcpServers } =
125
+ const { healInstalledPlugins, healSettingsEnabledPlugins, healPluginJsonMcpServers, healMcpJsonArgs } =
126
126
  await import("./scripts/heal-installed-plugins.mjs");
127
127
  const pluginKey = "context-mode@context-mode";
128
128
  const registryPath = resolve(homedir(), ".claude", "plugins", "installed_plugins.json");
@@ -140,6 +140,12 @@ try {
140
140
  // path baked in. Iterates EVERY installed cache entry's installPath so
141
141
  // multi-version installs all self-recover. Each call is independently wrapped
142
142
  // because one poisoned entry must not block heals on the others. Best effort.
143
+ //
144
+ // v1.0.122 — Layer 5b extended (Issue #531): asymmetric-heal sibling for the
145
+ // `.mcp.json` file Claude Code reads at plugin load. Same per-entry loop, same
146
+ // defensive wrap. Covers both the #253/aea633c bare `./start.mjs` fresh-install
147
+ // regression AND the /ctx-upgrade tmpdir leak class. Both heals must run on
148
+ // every boot so users self-recover regardless of which drift shape hit them.
143
149
  try {
144
150
  if (existsSync(registryPath)) {
145
151
  const ip = JSON.parse(readFileSync(registryPath, "utf-8"));
@@ -155,6 +161,13 @@ try {
155
161
  pluginKey,
156
162
  });
157
163
  } catch { /* best effort — per-entry */ }
164
+ try {
165
+ healMcpJsonArgs({
166
+ pluginRoot: installPath,
167
+ pluginCacheRoot,
168
+ pluginKey,
169
+ });
170
+ } catch { /* best effort — per-entry */ }
158
171
  }
159
172
  }
160
173
  }
package/.mcp.json DELETED
@@ -1,8 +0,0 @@
1
- {
2
- "mcpServers": {
3
- "context-mode": {
4
- "command": "node",
5
- "args": ["./start.mjs"]
6
- }
7
- }
8
- }