-- Teams: a deployed multi-agent unit = a baseline TOPOLOGY staffed with real -- workspace claws. The first rung of the deploy ladder (single → team → company -- → org). `graph` is the TopologyGraph whose nodes carry attrs["agent"] = the -- claw's runtime alias (claw_); team_members is the durable node→claw -- binding (each claw is also a normal agents-table row, individually chattable). CREATE TABLE teams ( id UUID PRIMARY KEY, workspace_id UUID NOT NULL REFERENCES workspaces (id) ON DELETE CASCADE, name TEXT NOT NULL, kind TEXT NOT NULL, -- TopologyKind (snake_case) graph JSONB NOT NULL, -- TopologyGraph (nodes/edges) status TEXT NOT NULL DEFAULT 'active', created_at TIMESTAMPTZ NOT NULL DEFAULT now() ); CREATE INDEX teams_workspace_idx ON teams (workspace_id, created_at DESC); CREATE TABLE team_members ( team_id UUID NOT NULL REFERENCES teams (id) ON DELETE CASCADE, node_id TEXT NOT NULL, -- topology node id claw_id UUID NOT NULL REFERENCES agents (id) ON DELETE CASCADE, role TEXT NOT NULL, PRIMARY KEY (team_id, node_id) );