refactor!: rebrand CCAM to AgentHub

Clean break, no compatibility alias. Renames the product name, the CLI
binary (`ccam` -> `agenthub`), the env var prefix (`CCAM_` ->
`AGENTHUB_`), the Prometheus metric namespace (`ccam_*` ->
`agenthub_*`), the tmux session prefix (`ccam-lane-<id>` ->
`agenthub-lane-<id>`), the per-repo runtime profile directory
(`.ccam/profile` -> `.agenthub/profile`), the lanes state root
(`~/.claude/ccam-lanes` -> `~/.claude/agenthub-lanes`), the bundled
plugins (`plugins/ccam*` -> `plugins/agenthub*`) and their slash
commands (`/ccam-doctor` -> `/agenthub-doctor`, `/ccam:*` ->
`/agenthub:*`).

Because there is no alias, an existing install has to be updated by
hand: rename its `.ccam/profile` directory and any `CCAM_*` variables,
and reinstall the plugin under its new name.

Two other name families are deliberately left alone here, since they are
not just strings: the `Claude-Code-Monitor` repository/marketplace name,
and the `agent-dashboard` npm package plus its `~/.claude/agent-dashboard`
runtime directory, which holds the live database and needs a migration
rather than a rename.

Verified: server 1406/1406, client 459/459, `grep -i ccam` clean across
tracked files, `openapi.yaml` regenerated (95 paths, unchanged count).
This commit is contained in:
2026-09-07 12:09:15 +07:00
parent ae9b3dbcd5
commit 17d56d0e01
345 changed files with 2705 additions and 2727 deletions
+11 -11
View File
@@ -15,7 +15,7 @@ const SETTINGS_PATH = getSettingsPath();
const HOOK_HANDLER = path.resolve(__dirname, "hook-handler.js").replace(/\\/g, "/");
/**
* True when the plugin bootstrap has run on this machine — i.e. the `ccam`
* True when the plugin bootstrap has run on this machine — i.e. the `agenthub`
* plugin is (or was) installed and supplies its own hook entries.
* Read-only and never throws; `plugin-bootstrap.js` is not required here to
* keep this module free of a circular dependency.
@@ -38,8 +38,8 @@ function envFlag(name) {
/**
* True when this process is running inside a container (Docker, Podman, or a
* Kubernetes pod). Detected via the Docker/Podman marker files, the OCI/systemd
* `container` env var, and a Linux cgroup heuristic. `CCAM_FORCE_CONTAINER=1`
* forces a positive result and `CCAM_FORCE_HOST=1` forces a negative result
* `container` env var, and a Linux cgroup heuristic. `AGENTHUB_FORCE_CONTAINER=1`
* forces a positive result and `AGENTHUB_FORCE_HOST=1` forces a negative result
* (used by tests / to override misfiring detection).
*
* Why this matters (GitHub #193): the hook command written into
@@ -53,8 +53,8 @@ function envFlag(name) {
* @returns {boolean}
*/
function isInsideContainer() {
if (envFlag("CCAM_FORCE_CONTAINER")) return true;
if (envFlag("CCAM_FORCE_HOST")) return false;
if (envFlag("AGENTHUB_FORCE_CONTAINER")) return true;
if (envFlag("AGENTHUB_FORCE_HOST")) return false;
try {
if (fs.existsSync("/.dockerenv")) return true; // Docker
if (fs.existsSync("/run/.containerenv")) return true; // Podman
@@ -95,7 +95,7 @@ function containerRefusalMessage() {
" publishes — so a host-installed hook reaches the containerized dashboard.",
"",
" If you genuinely run Claude Code inside this same container, override with:",
" CCAM_ALLOW_CONTAINER_HOOKS=1 npm run install-hooks",
" AGENTHUB_ALLOW_CONTAINER_HOOKS=1 npm run install-hooks",
].join("\n");
}
@@ -138,19 +138,19 @@ function installHooks(silent = false) {
// Host-only guard (issue #193): never write a container-internal handler path
// into a (potentially bind-mounted) host settings file. Honors an explicit
// opt-out for the rare case of running Claude Code inside this same container.
if (isInsideContainer() && !envFlag("CCAM_ALLOW_CONTAINER_HOOKS")) {
if (isInsideContainer() && !envFlag("AGENTHUB_ALLOW_CONTAINER_HOOKS")) {
if (!silent) console.error(containerRefusalMessage());
return false;
}
// The `ccam` plugin installs the same eight hooks itself. Running both means
// The `agenthub` plugin installs the same eight hooks itself. Running both means
// every event is POSTed twice and token/cost figures double — warn loudly
// rather than silently double-count. (`/ccam-doctor` reports the same state.)
// rather than silently double-count. (`/agenthub-doctor` reports the same state.)
if (!silent && pluginBootstrapRan()) {
console.warn(
"WARNING: the ccam plugin is installed and already provides these hooks.\n" +
"WARNING: the agenthub plugin is installed and already provides these hooks.\n" +
" Installing them again double-counts every event. Uninstall the\n" +
" plugin first, or skip this step. Run /ccam-doctor to check."
" plugin first, or skip this step. Run /agenthub-doctor to check."
);
}