s-m-r-t
Open the s-m-r-t source on GitHub Switch to dark color scheme
← All packages
Foundation v0.57.40

@happyvertical/smrt-core

The object model, persistence layer, AI operations, manifests, and generated interfaces at the center of every s-m-r-t app.

Source ↗

What it gives you

The object model, persistence layer, AI operations, manifests, and generated interfaces at the center of every s-m-r-t app.

  1. 01Typed, column-backed list projections without object hydration
  2. 02Context memory and semantic search for durable learned patterns
  3. 03Change feeds, conditional reads, sync apply, REST, MCP, WebMCP, and CLI generation
  4. 04Recipes: declared user-facing units collected into the manifest, plus a cookbook document and engine
  5. 05A one-call smrt() Vite preset over the packages declared in smrt.config.ts

Recipes and cookbooks

A SmrtRecipe is a named, user-facing unit smaller than a package, such as Sales or Customers. Its static id, label, models, nav, requires, and options are read structurally by the scanner into the manifest and knowledge recipes. The /cookbook entry validates and migrates a cookbook v1 document; /cookbook/engine runs typed cookbook commands with idempotent retries, atomic batches, and receipts.

One Vite plugin call for a SvelteKit app

smrt() from @happyvertical/smrt-core/vite applies the decorator config and composes smrtConsumer and smrtPlugin with the SvelteKit conventions. The consumed packages are the declared list under consumer.packages in smrt.config.ts; a missing or malformed list fails the build. smrtPlugin and smrtConsumer remain public for custom setups. Generated routes resolve collections through the runtime exported from $lib/server/smrt; a hand-written getCollection export is deprecated.

Move a model or close its surface without a subclass

A class that moves between packages declares its old qualified names in previousQualifiedNames, and lookups by the old name keep resolving. smrt db:migrate-qualified-names rewrites stored names on request. ObjectRegistry.registerOverride closes the generated API, MCP, or CLI surface of a package model, or makes its tenancy required, at startup. Only complete closures are supported; reopening throws. The browser entry builds and evaluates without Node-only modules.