import { cn } from "cn"; import type * as React from "react"; import { Badge } from "@/registry/edmi/ui/badge"; import { Card } from "@/registry/edmi/ui/card"; import type { Elevation } from "@/registry/edmi/ui/elevation"; // Four tones of the board identicon: columns repeat muted-2 / muted / foreground-2 / empty. const TONES = [ "bg-muted-foreground-2", "bg-muted-foreground", "bg-foreground-2", "bg-transparent", ]; function hash(seed: string) { let h = 2166136261; for (let i = 0; i < seed.length; i++) { h ^= seed.charCodeAt(i); h = Math.imul(h, 16777619); } return h >>> 0; } type AgentIdenticonProps = React.ComponentProps<"div"> & { /** Deterministic seed (agent name or address). */ seed: string; /** Edge length in px. */ size?: number; }; /** 5x5 token-colored identicon, deterministic per `seed`. */ function AgentIdenticon({ seed, size = 44, className, style, ...props }: AgentIdenticonProps) { let h = hash(seed); const cells = Array.from({ length: 25 }, (_, i) => { if (i % 5 === 0) h = hash(`${seed}:${i}:${h}`); return TONES[(h >>> ((i % 5) * 2)) & 3]; }); return (
); } type AgentCardStat = { label: string; value: React.ReactNode }; type AgentCardProps = React.ComponentProps