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
+13 -13
View File
@@ -2,7 +2,7 @@
* @file Tests the host-only guard in scripts/install-hooks.js (issue #193):
* the installer must refuse to write a container-internal handler path into a
* (possibly bind-mounted) host ~/.claude/settings.json. Container detection is
* driven deterministically via CCAM_FORCE_CONTAINER / CCAM_FORCE_HOST so these
* driven deterministically via AGENTHUB_FORCE_CONTAINER / AGENTHUB_FORCE_HOST so these
* tests pass whether or not the CI runner itself is containerized.
* @author Nguyễn Ngọc Trí Vĩ <vinnt@smartgift.vn>
*/
@@ -16,7 +16,7 @@ const path = require("path");
// Point the installer at a throwaway CLAUDE_HOME BEFORE requiring it — the
// settings path is resolved at module load. (`node --test` isolates each test
// file in its own process, so this does not leak into other suites.)
const TMP_HOME = fs.mkdtempSync(path.join(os.tmpdir(), "ccam-hooks-"));
const TMP_HOME = fs.mkdtempSync(path.join(os.tmpdir(), "agenthub-hooks-"));
process.env.CLAUDE_HOME = TMP_HOME;
const SETTINGS = path.join(TMP_HOME, "settings.json");
@@ -34,9 +34,9 @@ const HOOK_TYPES = [
];
function clearEnv() {
delete process.env.CCAM_FORCE_CONTAINER;
delete process.env.CCAM_FORCE_HOST;
delete process.env.CCAM_ALLOW_CONTAINER_HOOKS;
delete process.env.AGENTHUB_FORCE_CONTAINER;
delete process.env.AGENTHUB_FORCE_HOST;
delete process.env.AGENTHUB_ALLOW_CONTAINER_HOOKS;
}
function rmSettings() {
@@ -63,7 +63,7 @@ describe("install-hooks host-only guard (#193)", () => {
});
it("refuses inside a container and writes no settings file", () => {
process.env.CCAM_FORCE_CONTAINER = "1";
process.env.AGENTHUB_FORCE_CONTAINER = "1";
const ok = installHooks(true);
assert.equal(ok, false);
assert.equal(
@@ -74,8 +74,8 @@ describe("install-hooks host-only guard (#193)", () => {
});
it("writes when the explicit container override is set", () => {
process.env.CCAM_FORCE_CONTAINER = "1";
process.env.CCAM_ALLOW_CONTAINER_HOOKS = "1";
process.env.AGENTHUB_FORCE_CONTAINER = "1";
process.env.AGENTHUB_ALLOW_CONTAINER_HOOKS = "1";
const ok = installHooks(true);
assert.equal(ok, true);
assert.ok(fs.existsSync(SETTINGS));
@@ -87,14 +87,14 @@ describe("install-hooks host-only guard (#193)", () => {
});
it("writes on a host (not a container)", () => {
process.env.CCAM_FORCE_HOST = "1";
process.env.AGENTHUB_FORCE_HOST = "1";
const ok = installHooks(true);
assert.equal(ok, true);
assert.ok(fs.existsSync(SETTINGS));
});
it("is idempotent — re-running updates in place with no duplicate entries", () => {
process.env.CCAM_FORCE_HOST = "1";
process.env.AGENTHUB_FORCE_HOST = "1";
installHooks(true);
installHooks(true);
const settings = JSON.parse(fs.readFileSync(SETTINGS, "utf8"));
@@ -105,10 +105,10 @@ describe("install-hooks host-only guard (#193)", () => {
});
it("isInsideContainer honors the force flags", () => {
process.env.CCAM_FORCE_CONTAINER = "1";
process.env.AGENTHUB_FORCE_CONTAINER = "1";
assert.equal(isInsideContainer(), true);
delete process.env.CCAM_FORCE_CONTAINER;
process.env.CCAM_FORCE_HOST = "1";
delete process.env.AGENTHUB_FORCE_CONTAINER;
process.env.AGENTHUB_FORCE_HOST = "1";
assert.equal(isInsideContainer(), false);
});
});