@tushell/kinship-graph
v0.1.0
Published
Relational kinship graph for the Tushell Platform: node/edge types with display metadata, pure graph filtering and analysis, and storage-agnostic CRUD over any Redis-shaped key-value store.
Keywords
Readme
@tushell/kinship-graph
The relational kinship graph of the Tushell Portal: people, entities, projects, concepts, and ceremonies connected by relations like creates, witnesses, teaches, and nurtures.
Implements rispecs/09-kinship/relational-graph.rispec.md.
What's inside
- Types —
KinshipNode,KinshipEdge,KinshipGraph, filters, analysis, layout types, plusNODE_TYPE_META/RELATION_META/DIRECTION_METAdisplay metadata and type guards - Pure graph functions —
filterKinshipGraph()andanalyzeKinshipGraph()operate on in-memory graphs with no I/O - Storage-agnostic CRUD —
createKinshipStore({ store })gives node/edge CRUD, full-graph reads, and depth-limitedgetNodeNeighborhood()BFS over any store with a Redis-shapedget/set/del/sadd/srem/smemberssurface (an@upstash/redisclient works directly)
Usage
import { createKinshipStore, analyzeKinshipGraph } from "@tushell/kinship-graph"
import { Redis } from "@upstash/redis"
const kinship = createKinshipStore({
store: Redis.fromEnv(),
generateId: () => nanoid(), // optional, defaults to crypto.randomUUID
parseNode: KinshipNodeSchema.parse, // optional Zod validation
})
const graph = await kinship.getKinshipGraph()
const analysis = analyzeKinshipGraph(graph)No runtime dependencies.
