feat(install): wire the code graph into every agent via the upstream installer
make install now runs the codebase-memory-mcp upstream installer: checksum-verified release (static on Linux) into ~/.local/bin, configuring every detected agent (Claude Code, Codex, Gemini, Hermes, OpenClaw, ...); rerunning it updates. This replaces the Arch-only yay install, whose 0.12 build segfaults on glibc 2.44 (DeusData/codebase-memory-mcp#2763), and the Claude-only plugin, which enable-plugins.js now retires so the server never runs twice. Every failure warns instead of aborting make install. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
997a01ccfa
commit
ca98ab4a30
4 files changed
+30
-21
No files matched your search
@@ -13,13 +13,13 @@ if (!settingsPath) {
|
|||||||
const MARKETPLACES = {
|
const MARKETPLACES = {
|
||||||
caveman: { source: { source: "github", repo: "JuliusBrussee/caveman" } },
|
caveman: { source: { source: "github", repo: "JuliusBrussee/caveman" } },
|
||||||
ponytail: { source: { source: "github", repo: "DietrichGebert/ponytail" } },
|
ponytail: { source: { source: "github", repo: "DietrichGebert/ponytail" } },
|
||||||
"codebase-memory": { source: { source: "github", repo: "DeusData/codebase-memory-mcp" } },
|
|
||||||
};
|
};
|
||||||
const PLUGINS = {
|
const PLUGINS = {
|
||||||
"caveman@caveman": true,
|
"caveman@caveman": true,
|
||||||
"ponytail@ponytail": true,
|
"ponytail@ponytail": true,
|
||||||
"codebase-memory@codebase-memory": true,
|
|
||||||
};
|
};
|
||||||
|
// Trip-wire: `codebase-memory-mcp install` registers the same server for every agent, Claude Code included; the plugin on top runs it twice.
|
||||||
|
const RETIRED_PLUGINS = { "codebase-memory@codebase-memory": "codebase-memory" };
|
||||||
const REMINDERS = ["kvb-dream", "kvb-coach"];
|
const REMINDERS = ["kvb-dream", "kvb-coach"];
|
||||||
const RETIRED = [
|
const RETIRED = [
|
||||||
"autotune/hooks/reminder.sh",
|
"autotune/hooks/reminder.sh",
|
||||||
@@ -53,6 +53,10 @@ for (const [name, entry] of Object.entries(MARKETPLACES)) {
|
|||||||
if (!data.extraKnownMarketplaces[name]) data.extraKnownMarketplaces[name] = entry;
|
if (!data.extraKnownMarketplaces[name]) data.extraKnownMarketplaces[name] = entry;
|
||||||
}
|
}
|
||||||
data.enabledPlugins = Object.assign(data.enabledPlugins || {}, PLUGINS);
|
data.enabledPlugins = Object.assign(data.enabledPlugins || {}, PLUGINS);
|
||||||
|
for (const [plugin, marketplace] of Object.entries(RETIRED_PLUGINS)) {
|
||||||
|
delete data.enabledPlugins[plugin];
|
||||||
|
delete data.extraKnownMarketplaces[marketplace];
|
||||||
|
}
|
||||||
data.env = data.env || {};
|
data.env = data.env || {};
|
||||||
if (!data.env.CLAUDE_CODE_AUTO_COMPACT_WINDOW) data.env.CLAUDE_CODE_AUTO_COMPACT_WINDOW = "500000";
|
if (!data.env.CLAUDE_CODE_AUTO_COMPACT_WINDOW) data.env.CLAUDE_CODE_AUTO_COMPACT_WINDOW = "500000";
|
||||||
|
|
||||||
@@ -124,4 +128,4 @@ for (const [script, event, matcher, sub] of SCRIPT_HOOKS) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
fs.writeFileSync(settingsPath, JSON.stringify(data, null, 2) + "\n");
|
fs.writeFileSync(settingsPath, JSON.stringify(data, null, 2) + "\n");
|
||||||
console.log(`skills: enabled the caveman, ponytail and codebase-memory plugins (plugin skill copies dropped from this .claude), the ${REMINDERS.join(" + ")} reminders, the kvb-org-organize claim gate, news hook and resource watch, and the kvb-org-perform log in ${settingsPath}`);
|
console.log(`skills: enabled the caveman and ponytail plugins (plugin skill copies dropped from this .claude), the ${REMINDERS.join(" + ")} reminders, the kvb-org-organize claim gate, news hook and resource watch, and the kvb-org-perform log in ${settingsPath}`);
|
||||||
+5
-6
@@ -64,15 +64,14 @@ if [[ "${TARGET}" == "${HOME}" ]]; then
|
|||||||
else
|
else
|
||||||
warn "skills: no systemd user session; skipped the kvb-dream notification timer."
|
warn "skills: no systemd user session; skipped the kvb-dream notification timer."
|
||||||
fi
|
fi
|
||||||
if ! command -v codebase-memory-mcp &>/dev/null && command -v yay &>/dev/null; then
|
log "skills: installing or updating the codebase-memory-mcp code graph for every detected agent"
|
||||||
log "skills: installing the codebase-memory-mcp code graph"
|
if ! curl -fsSL --proto '=https' https://raw.githubusercontent.com/DeusData/codebase-memory-mcp/main/install.sh | bash; then
|
||||||
yay -S --needed codebase-memory-mcp-bin
|
warn "skills: the codebase-memory-mcp installer failed; the code graph keeps its previous setup."
|
||||||
fi
|
fi
|
||||||
if command -v codebase-memory-mcp &>/dev/null; then
|
if (ulimit -c 0; codebase-memory-mcp config set auto_index true); then
|
||||||
log "skills: auto-indexing every repository a session opens into the code graph"
|
log "skills: auto-indexing every repository a session opens into the code graph"
|
||||||
codebase-memory-mcp config set auto_index true
|
|
||||||
else
|
else
|
||||||
warn "skills: codebase-memory-mcp not installed; the code graph stays off (see kvb-agent-optimize)."
|
warn "skills: codebase-memory-mcp is not runnable from PATH; the code graph stays off (see kvb-agent-optimize)."
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
|||||||
@@ -22,13 +22,13 @@ installed, and the state of the shared snapshot
|
|||||||
|
|
||||||
## Step 2: index
|
## Step 2: index
|
||||||
|
|
||||||
- **Binary missing**: the skills repository's `make install` installs it
|
- **Binary missing**: the skills repository's `make install` runs the
|
||||||
(`yay -S --needed codebase-memory-mcp-bin` where yay exists) and enables
|
upstream installer, which installs the checksum-verified release (static
|
||||||
the `codebase-memory@codebase-memory` plugin with its marketplace in the
|
on Linux) into `~/.local/bin` and wires the graph into every agent it
|
||||||
settings. Installing touches the agent configuration and needs sudo, so it
|
detects (Claude Code, Codex, Gemini, Hermes, OpenClaw and more); rerunning
|
||||||
is the operator's step: hand `make install` (or, without yay, the
|
it updates. It writes the agents' configuration, so it is the operator's
|
||||||
package's install on that system) to the `kvb-org-operator` skill and
|
step: hand `make install` to the `kvb-org-operator` skill and continue
|
||||||
continue after the restart.
|
after the restart.
|
||||||
|
|
||||||
- **Index**: once installed, the skills repository's `make install` switches
|
- **Index**: once installed, the skills repository's `make install` switches
|
||||||
`auto_index` on, so every repository a session opens is indexed and
|
`auto_index` on, so every repository a session opens is indexed and
|
||||||
|
|||||||
+11
-5
@@ -162,12 +162,18 @@ class TestSettingsRegistration(unittest.TestCase):
|
|||||||
self.assertEqual(gate.count("kvb-org-perform/scripts/log.py"), 1)
|
self.assertEqual(gate.count("kvb-org-perform/scripts/log.py"), 1)
|
||||||
self.assertEqual(post.count("kvb-org-perform/scripts/log.py"), 1)
|
self.assertEqual(post.count("kvb-org-perform/scripts/log.py"), 1)
|
||||||
|
|
||||||
def test_code_graph_plugin_is_enabled_with_its_marketplace(self):
|
def test_code_graph_plugin_is_retired_for_the_agent_agnostic_installer(self):
|
||||||
data = self._patch()
|
self.settings.write_text(
|
||||||
self.assertTrue(data["enabledPlugins"]["codebase-memory@codebase-memory"])
|
json.dumps({
|
||||||
self.assertEqual(
|
"enabledPlugins": {"codebase-memory@codebase-memory": True},
|
||||||
data["extraKnownMarketplaces"]["codebase-memory"]["source"]["repo"], "DeusData/codebase-memory-mcp"
|
"extraKnownMarketplaces": {"codebase-memory": {"source": {"source": "github", "repo": "x/y"}}},
|
||||||
|
}),
|
||||||
|
encoding="utf-8",
|
||||||
)
|
)
|
||||||
|
data = self._patch()
|
||||||
|
self.assertNotIn("codebase-memory@codebase-memory", data["enabledPlugins"])
|
||||||
|
self.assertNotIn("codebase-memory", data["extraKnownMarketplaces"])
|
||||||
|
self.assertTrue(data["enabledPlugins"]["caveman@caveman"])
|
||||||
|
|
||||||
def test_compact_window_is_set_once_and_never_overwritten(self):
|
def test_compact_window_is_set_once_and_never_overwritten(self):
|
||||||
self.assertEqual(self._patch()["env"]["CLAUDE_CODE_AUTO_COMPACT_WINDOW"], "500000")
|
self.assertEqual(self._patch()["env"]["CLAUDE_CODE_AUTO_COMPACT_WINDOW"], "500000")
|
||||||
|
|||||||
Reference in new issue
Block a user