| 1825 | } |
| 1826 | |
| 1827 | const char *cbm_hook_admission_notice(cbm_hook_admission_t reason, const char *hook_dialect) { |
| 1828 | /* Only Claude Code (the NULL dialect) consumes a bare stdout JSON object; |
| 1829 | * emitting it into another dialect's channel would corrupt that protocol. */ |
| 1830 | if (hook_dialect) { |
| 1831 | return NULL; |
| 1832 | } |
| 1833 | switch (reason) { |
| 1834 | case CBM_HOOK_ADMISSION_DAEMON_ABSENT: |
| 1835 | return "{\"systemMessage\":\"codebase-memory-mcp: no CBM daemon is running, so graph " |
| 1836 | "augmentation is currently skipped. Run `codebase-memory-mcp daemon start` (or " |
| 1837 | "open an MCP session) to enable it.\"}"; |
| 1838 | case CBM_HOOK_ADMISSION_BUILD_CONFLICT: |
| 1839 | return "{\"systemMessage\":\"codebase-memory-mcp: graph augmentation is skipped: the " |
| 1840 | "active CBM daemon runs a different build than this binary (usually an update was " |
| 1841 | "installed while the old daemon kept running). Run `codebase-memory-mcp daemon " |
| 1842 | "stop`, then retry - the next command starts a matching daemon.\"}"; |
| 1843 | default: |
| 1844 | return NULL; |
| 1845 | } |
| 1846 | } |
no outgoing calls
no test coverage detected