@graview/core

The graph, the log, the schema and the checker. Everything a Graview app declares, and the CLI that verifies it.

pnpm add @graview/core

Entry points: @graview/core, @graview/core/sqlite, @graview/core/scaffold, @graview/core/cli, @graview/core/testing

What it is

Everything a Graview app declares, and the checker that verifies it.

  • Schema — defineNode and createSchema. Zod is the single source of runtime validation, TypeScript types and JSON Schema.
  • Graph — nodes and edges, with a tracked reader so a mutation records what it read as well as what it wrote.
  • Mutations — defineMutation. Every change is a typed, named, describable act; nothing writes the graph directly.
  • Invariants — rules that judge the graph and name the mutations that would repair them. That naming is the seam derived affordances ride on.
  • Operation log — the graph is a fold over it. Author, intent, reads and writes on every op, which is what makes selective undo a dependency question rather than a stack.
  • Permissions — a Principal is an Author with roles, so what the log blames is what the policy judged.
  • Theme — the token contract, the two shipped palettes, and a contrast checker that measures a brand's palette before it ships.
  • graview check — reads a declaration and reports what is wrong with it, in terms an agent can act on.
npx graview create my-app          # a product on Graview, started (also: npm create graview)
npx graview check ./dist/domain/app.js
npx graview docs ./dist/domain/app.js

create writes the declaration split into domain and UI, a shell, a headless test and a CI workflow, initialises a repository, installs, and says what to do next. --link <path> consumes the framework from a sibling checkout by path instead of a registry — the only way that works until the packages are published — and refuses a framework that is not built. The generator behind it is @graview/core/scaffold, a pure function from a name and a first kind to a list of files, for a host that provisions apps.

What it exports (172)

Read off the package's own barrel, so this is what is there today.

  • actsOn
  • admitArrangement
  • argShape
  • arrange
  • arrangeable
  • arrangeAllows
  • article
  • asksForThePast
  • beginning
  • bindSchema
  • BLOCK
  • brandFromAccent
  • bucketStart
  • capabilitiesOf
  • checkApp
  • checkBrandContrast
  • checkContrast
  • checkKitContrast
  • checkpoint
  • checkpointOn
  • checkpointsBetween
  • checkUndo
  • cityExtent
  • cityMap
  • coloursIn
  • compileMutation
  • composite
  • conditionHolds
  • connectorHueColour
  • connectorKitFor
  • contrast
  • createMemoryAdapter
  • createSchema
  • createSqliteAdapter
  • createViewRegistry
  • DARK
  • DECISION_BRIDGE_PATH
  • declareInstallation
  • DEFAULT_KIT
  • defineApp
  • defineInvariant
  • defineMutation
  • defineNode
  • derivedVia
  • deriveEditMutations
  • deriveMutations
  • deriveRemoveMutations
  • describeApp
  • describeArg
  • describeCapability
  • describeNode
  • describeSearched
  • diffSnapshots
  • edgeId
  • edgesOf
  • editMutationName
  • editVia
  • effectivity
  • EMPTY_DIFF
  • EMPTY_SYNC_STATE
  • evaluate
  • extendInvariants
  • extendMutations
  • FIDELITIES
  • fieldsWrittenBy
  • fieldWords
  • fieldWriters
  • FIGURE_NAMES
  • figureBrief
  • figureFaults
  • FIGURES
  • figureSvg
  • fold
  • foldPresence
  • formatArrangement
  • formatFindings
  • formComplete
  • formField
  • formFields
  • fragmentOf
  • generateAgentsMd
  • generateLlmsTxt
  • googleCalendar
  • googleCalendarMapping
  • Graph
  • GraphError
  • hueFor
  • humaniseField
  • INSTALLATION_MODULE
  • invert
  • isCurrent
  • isEffectiveBetween
  • isEffectiveOn
  • isEmptyDiff
  • isoDate
  • isUnset
  • kitVariables
  • labelOf
  • LIGHT
  • LOCAL_BRIDGE_PATH
  • luminance
  • matches
  • matchNode
  • MAX_SIDE
  • motion
  • mutationToolSchema
  • nameOfAuthor
  • NO_ARRANGEMENT
  • nodeJsonSchema
  • nodeRef
  • nodeRefArgs
  • nodeRefKinds
  • normalise
  • nounOf
  • OperationLog
  • parseArrangement
  • parseQuery
  • PermissionDeniedError
  • permits
  • permittedMutations
  • placeSlug
  • plotsOverlap
  • PRESENCE_TTL_MS
  • providerCan
  • readableFields
  • readerSettings
  • removeMutationName
  • removeVia
  • resolveKit
  • resolveModules
  • roadsOf
  • rolesOf
  • rolesWhoCould
  • samePresence
  • SchemaError
  • schemaJson
  • SCHEMES
  • search
  • searchableFields
  • settableFields
  • sharedEdges
  • sideFor
  • SQLITE_TABLE_SHAPE
  • squeeze
  • Store
  • strengthOf
  • STUDIO_DOOR_PATH
  • subjectKindsOf
  • summarise
  • SYNC_CONFLICTS
  • syncConflictInvariant
  • SyncEngine
  • systemAuthor
  • takesAnId
  • tellApart
  • TEXT_PAIRS
  • textSize
  • toIso
  • toJsonSchema
  • touchWeights
  • TrackedReader
  • undecidableArguments
  • undoPrimitives
  • UnregisteredInvariantError
  • UNSET
  • unwrittenFields
  • violationKey
  • violationsTouching
  • whyNot
  • withArticle
  • writesOf
  • z