| 1439 | } |
| 1440 | |
| 1441 | const char *cbm_hook_admission_notice(cbm_hook_admission_t reason, const char *hook_dialect) { |
| 1442 | /* Only Claude Code (the NULL dialect) consumes a bare stdout JSON object; |
| 1443 | * emitting it into another dialect's channel would corrupt that protocol. */ |
| 1444 | if (hook_dialect) { |
| 1445 | return NULL; |
| 1446 | } |
| 1447 | switch (reason) { |
| 1448 | case CBM_HOOK_ADMISSION_DAEMON_ABSENT: |
| 1449 | return "{\"systemMessage\":\"codebase-memory-mcp: no CBM daemon is running, so graph " |
| 1450 | "augmentation is currently skipped. Run `codebase-memory-mcp daemon start` (or " |
| 1451 | "open an MCP session) to enable it.\"}"; |
| 1452 | case CBM_HOOK_ADMISSION_BUILD_CONFLICT: |
| 1453 | return "{\"systemMessage\":\"codebase-memory-mcp: graph augmentation is skipped: the " |
| 1454 | "active CBM daemon runs a different build than this binary (usually an update was " |
| 1455 | "installed while the old daemon kept running). Run `codebase-memory-mcp daemon " |
| 1456 | "stop`, then retry - the next command starts a matching daemon.\"}"; |
| 1457 | default: |
| 1458 | return NULL; |
| 1459 | } |
| 1460 | } |
no outgoing calls
no test coverage detected