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:
@@ -13,7 +13,7 @@ const path = require("node:path");
|
||||
const fs = require("node:fs");
|
||||
const http = require("node:http");
|
||||
|
||||
const SUITE_ROOT = fs.mkdtempSync(path.join(os.tmpdir(), "ccam-usage-api-"));
|
||||
const SUITE_ROOT = fs.mkdtempSync(path.join(os.tmpdir(), "agenthub-usage-api-"));
|
||||
process.env.DASHBOARD_DB_PATH = path.join(SUITE_ROOT, "dashboard.db");
|
||||
process.env.LANES_ROOT = path.join(SUITE_ROOT, "lanes");
|
||||
|
||||
@@ -175,33 +175,36 @@ describe("GET /api/workflows/skill-usage", () => {
|
||||
// Two full calls of the same skill: each emits Pre + Post, so a naive
|
||||
// COUNT(*) would report four.
|
||||
for (let i = 0; i < 2; i += 1) {
|
||||
ev("PreToolUse", "Skill", { tool_input: { skill: "ccam:ship-feature" } });
|
||||
ev("PostToolUse", "Skill", { tool_input: { skill: "ccam:ship-feature" } });
|
||||
ev("PreToolUse", "Skill", { tool_input: { skill: "agenthub:ship-feature" } });
|
||||
ev("PostToolUse", "Skill", { tool_input: { skill: "agenthub:ship-feature" } });
|
||||
}
|
||||
ev("PreToolUse", "Skill", { tool_input: { skill: "daily-report" } });
|
||||
ev("PreToolUse", "mcp__plugin_ccam_ccam__dashboard_health_check", {});
|
||||
ev("PostToolUse", "mcp__plugin_ccam_ccam__dashboard_health_check", {});
|
||||
ev("PreToolUse", "mcp__plugin_agenthub_agenthub__dashboard_health_check", {});
|
||||
ev("PostToolUse", "mcp__plugin_agenthub_agenthub__dashboard_health_check", {});
|
||||
});
|
||||
|
||||
it("counts one call per invocation, not one per hook event", async () => {
|
||||
const res = await get("/api/workflows/skill-usage");
|
||||
assert.equal(res.status, 200);
|
||||
const ship = res.body.skills.find((s) => s.name === "ccam:ship-feature");
|
||||
const ship = res.body.skills.find((s) => s.name === "agenthub:ship-feature");
|
||||
assert.equal(ship.count, 2);
|
||||
assert.equal(ship.sessions, 1);
|
||||
});
|
||||
|
||||
it("attributes a prefixed skill to its plugin and leaves a bare one unattributed", async () => {
|
||||
const res = await get("/api/workflows/skill-usage");
|
||||
assert.equal(res.body.skills.find((s) => s.name === "ccam:ship-feature").plugin, "ccam");
|
||||
assert.equal(
|
||||
res.body.skills.find((s) => s.name === "agenthub:ship-feature").plugin,
|
||||
"agenthub"
|
||||
);
|
||||
assert.equal(res.body.skills.find((s) => s.name === "daily-report").plugin, null);
|
||||
});
|
||||
|
||||
it("adds a plugin's own MCP tool calls to its totals", async () => {
|
||||
const res = await get("/api/workflows/skill-usage");
|
||||
const ccam = res.body.plugins.find((p) => p.name === "ccam");
|
||||
const agenthub = res.body.plugins.find((p) => p.name === "agenthub");
|
||||
assert.deepEqual(
|
||||
{ skills: ccam.skills, skillCalls: ccam.skillCalls, mcpCalls: ccam.mcpCalls },
|
||||
{ skills: agenthub.skills, skillCalls: agenthub.skillCalls, mcpCalls: agenthub.mcpCalls },
|
||||
{ skills: 1, skillCalls: 2, mcpCalls: 1 }
|
||||
);
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user