diff --git a/apps/web/components/agents-view.test.ts b/apps/web/components/agents-view.test.ts new file mode 100644 index 0000000..36907bf --- /dev/null +++ b/apps/web/components/agents-view.test.ts @@ -0,0 +1,35 @@ +import { readFile } from "node:fs/promises"; +import { describe, expect, it } from "vitest"; + +const viewUrl = new URL("./agents-view.tsx", import.meta.url); + +describe("Agent directory", () => { + it("describes agents, not humans", async () => { + const source = await readFile(viewUrl, "utf8"); + expect(source).toContain( + 'description="Permission-scoped agents with governed learning"', + ); + expect(source).not.toContain("human collaborators"); + }); + + it("offers no affordance for agent creation, which has no API", async () => { + const source = await readFile(viewUrl, "utf8"); + expect(source).not.toContain("New agent"); + }); +}); + +describe("Agent detail", () => { + it("routes work assignment to the operations board", async () => { + const source = await readFile(viewUrl, "utf8"); + expect(source).toContain('href="/operations"'); + expect(source).toContain("Assign work"); + expect(source).not.toContain("Invoke"); + }); + + it("keeps every remaining disabled control tied to live state", async () => { + const source = await readFile(viewUrl, "utf8"); + for (const match of source.matchAll(/disabled(?:={([^}]*)})?/g)) { + expect(match[1], "permanently disabled control").toBeTruthy(); + } + }); +}); diff --git a/apps/web/components/agents-view.tsx b/apps/web/components/agents-view.tsx index 94112a1..aa91412 100644 --- a/apps/web/components/agents-view.tsx +++ b/apps/web/components/agents-view.tsx @@ -15,7 +15,7 @@ import { OpsShell } from "@/components/ops-shell"; import { PageHeader } from "@/components/page-header"; import { Avatar } from "@/components/ui/avatar"; import { Badge } from "@/components/ui/badge"; -import { Button } from "@/components/ui/button"; +import { Button, buttonVariants } from "@/components/ui/button"; type EvidenceState = "reported" | "unavailable" | "unknown"; type AgentReadiness = { @@ -130,13 +130,7 @@ export function AgentsView() { - - New agent - - } + description="Permission-scoped agents with governed learning" />