Expand description
Petnames: a deterministic, human-readable label for a mesh node id — Docker’s adjective_color_animal convention with a four-digit suffix (e.g. “happy_green_rabbit_4831”) — so a person skimming a roster, transcript, or room listing can recognize and remember a specific identity without reading 64 hex characters. A pure function of the node id itself, not random per process: the same identity gets the same petname across restarts, across every tool that shows it, and on every other agent’s own roster too (everyone hashes the same public bytes). This is a companion label, never a replacement — every surface that adds one keeps the real node_id right alongside it, since only the real id is addressable.
The suffix exists because the mesh is expected to host THOUSANDS of agents: 40 x 40 x 40 word trios alone collide visibly under the birthday problem at a few hundred identities, while the trio plus a 4-digit hash group (640,000,000 combinations) stays effectively collision-free at fleet scale while remaining scannable.
The word lists and derivation are shared with macula-mcp’s own
src/petname.ts (which this supersedes as the SDK-level home; the
desktop and every future consumer pull it from here): same sha256 of
the lowercased hex id, same 16-bit reads modulo the list lengths,
plus the suffix group.
Functions§
- petname
- The stable “adjective_color_animal_0000” label for a node id, e.g. “happy_green_rabbit_4831”. Same input always produces the same output — derived from a sha256 digest of the id (lowercased first, so a node id that happens to arrive in mixed case still maps to the same petname as its lowercase form), not from anything process-local like a random seed or insertion order.