from @unified-product-graph/core/shapes · re-exported by @sdk
Shapes
Base interfaces every UPG node and edge satisfies.
16 exports · 1 const · 4 type · 11 interface
Since v0.1.0Quick import
import type { UPGBaseNode, UPGEdge, UPGDocument } from '@unified-product-graph/core/shapes'Example
// The canonical shape of any UPG document
import type { UPGDocument } from '@unified-product-graph/core/shapes'
const doc: UPGDocument = {
version: '0.4.3',
product_id: 'demo',
nodes: [{ id: 'p1', type: 'persona', title: 'Sarah Chen', status: 'active', created_at: '2026-05-13' }],
edges: [],
}Base interfaces every UPG node and edge satisfies. Import these when writing code that operates on nodes generically. UPGBaseNode, UPGEdge, and the typed UPGProperty wrapper cover the full structural surface without pulling in domain-specific property types.
Exports
Constants
Types
type UPGCrossEdgeType = | 'shares_persona' | 'shares_competitor' | 'shares_metric' | 'depends_on_product' | 'cannibalises' | 'succeeds'The set of valid cross-product relationship types
type UPGEdgeType = keyof typeof UPG_EDGE_CATALOGUnion of all edge type keys from the canonical edge registry
type UPGMappingConfidence = 'high' | 'medium' | 'low' | 'manual'Confidence level for a type mapping when importing from an external tool.
Interfaces
interface UPGCrossEdgeA cross-product edge links entities across different products within a portfolio.
interface UPGDocumentA UPGDocument is a portable, versioned snapshot of a product's knowledge graph.
interface UPGIntegrityChecksum-backed tamper-evidence metadata stamped into a `UPGDocument` at save time by the MCP server.
interface UPGPortfolioDocumentA UPGPortfolioDocument is a portable, versioned snapshot of a multi-product portfolio.