/** * codebaseMemory.js — code-graph + semantic codebase memory skill, backed by * the DeusData/codebase-memory-mcp binary BAKED INTO the agent image. * * WHAT IT IS * ────────── * A hand-written stdio MCP skill (same shape as kvMemory.js) that points the * agent at the `codebase-memory-mcp` server binary already on the image PATH * (/usr/local/bin/codebase-memory-mcp — see agent-ops/Dockerfile and * backend/lib/docker/zibby-agent/Dockerfile, which fetch the v0.8.1 portable * static build at build time, sha256-verified, multi-arch). The server indexes * a checked-out repository into a code graph + embeddings (Apache-2.0 nomic * embeddings) and exposes architecture / search / trace tools over it. * * RELATIONSHIP TO THE BINARY (VERIFIED GROUND TRUTH for v0.8.1) * ───────────────────────────────────────────────────────────── * - stdio MCP server = the BARE binary, NO subcommand → command + args:[]. * - imperative one-shot = `codebase-memory-mcp cli ''`. * Indexing = `cli index_repository '{"repo_path":""}'`. * - DB / cache dir env = CBM_CACHE_DIR (we point it at a writable workspace * dir so a read-only / ephemeral HOME never wedges the server). * * WHY UNGATED (no integration token) * ────────────────────────────────── * Fully local — no API, no OAuth, no paste-token. It is therefore deliberately * LEFT OUT of backend/src/services/skill-integrations.js * (REQUIRED_/OPTIONAL_INTEGRATION_MAP). Leaving it out = ungated = correct. * The skill ACTIVATES ONLY when a node declares 'codebase-memory' in its * `skills` array — the registry never auto-loads it, so existing agents are * unaffected (this is what makes the integration additive). `alwaysLoad: true` * (matching every other skill) only means: once a node HAS declared it, its * MCP tools load eagerly rather than lazily — it does NOT make the skill * global. * * INDEX-AT-START HOOK * ─────────────────── * invokeAgentOptions() runs ONCE per run (idempotent via a per-repo marker * file under CBM_CACHE_DIR) to index the checked-out repo with the imperative * `cli index_repository` path BEFORE the node's agent runs, so the graph/search * tools have data on the very first tool call. It is wrapped in try/catch and * NEVER throws — a failed index degrades to "tools return empty", not a crashed * run. The hook returns {} (it contributes no agent-visible options); its only * job is the side-effect of building the index. * * It only helps agents whose repo is ALREADY checked out when the node starts. * An agent that clones INSIDE its own run has nothing to index at hook time — * the hook then NO-OPS (see repoDirToIndex) and that agent must call * index_repository itself right after cloning. Do NOT "fix" the empty case by * falling back to the workspace root: that indexes the agent's own template * source, which is worse than no index at all. */ export declare const codebaseMemorySkill: any;