context-mode 1.0.113 → 1.0.115
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/build/cli.js +66 -0
- package/build/server.js +6 -2
- package/build/util/project-dir.d.ts +32 -2
- package/build/util/project-dir.js +109 -3
- package/cli.bundle.mjs +142 -141
- package/openclaw.plugin.json +1 -1
- package/package.json +2 -1
- package/scripts/heal-installed-plugins.mjs +129 -0
- package/scripts/postinstall.mjs +58 -0
- package/server.bundle.mjs +98 -97
- package/start.mjs +26 -0
package/start.mjs
CHANGED
|
@@ -108,6 +108,32 @@ if (cacheMatch) {
|
|
|
108
108
|
}
|
|
109
109
|
}
|
|
110
110
|
|
|
111
|
+
// ── Self-heal Layer 3 + 4: installed_plugins.json registry repair ──
|
|
112
|
+
// v1.0.113 hotfix follow-up. /ctx-upgrade can leave installed_plugins.json
|
|
113
|
+
// with two distinct kinds of poison:
|
|
114
|
+
// HEAL 3: per-entry `version` drifts away from the actual cache dir's
|
|
115
|
+
// plugin.json `version` field. Claude Code's plugin loader then
|
|
116
|
+
// rejects the entry as a manifest mismatch and silently
|
|
117
|
+
// disconnects context-mode.
|
|
118
|
+
// HEAL 4: top-level `enabledPlugins[<key>]` is missing or emptied.
|
|
119
|
+
// Claude Code skips disabled plugins, so MCP never starts and
|
|
120
|
+
// the user has no /ctx-upgrade escape hatch.
|
|
121
|
+
// Logic is shared verbatim with scripts/postinstall.mjs (single source of
|
|
122
|
+
// truth) so users who fix themselves via `npm install -g context-mode`
|
|
123
|
+
// follow the exact same code path. Best-effort, never blocks MCP boot.
|
|
124
|
+
try {
|
|
125
|
+
const { healInstalledPlugins } = await import("./scripts/heal-installed-plugins.mjs");
|
|
126
|
+
const registryPath = resolve(homedir(), ".claude", "plugins", "installed_plugins.json");
|
|
127
|
+
const pluginCacheRoot = resolve(homedir(), ".claude", "plugins", "cache");
|
|
128
|
+
try {
|
|
129
|
+
healInstalledPlugins({
|
|
130
|
+
registryPath,
|
|
131
|
+
pluginCacheRoot,
|
|
132
|
+
pluginKey: "context-mode@context-mode",
|
|
133
|
+
});
|
|
134
|
+
} catch { /* best effort — never block MCP boot */ }
|
|
135
|
+
} catch { /* best effort — never block MCP boot */ }
|
|
136
|
+
|
|
111
137
|
// ── Self-heal Layer 4: Deploy global SessionStart hook + register in settings.json ──
|
|
112
138
|
// This hook lives outside the plugin directory (~/.claude/hooks/) so it works
|
|
113
139
|
// even when the plugin cache is completely broken. It creates symlinks for any
|