@happyvertical/smrt-svelte
The top-of-stack Svelte integration: AppShell, Provider, rich forms, recipe screens, browser AI, live collections, and permissions.
What it gives you
The top-of-stack Svelte integration: AppShell, Provider, rich forms, recipe screens, browser AI, live collections, and permissions.
- 01AppShell composes Provider, ThemeProvider, and the four-edge AdminShell with tenant navigation
- 02Recipe screens, a command palette, overview grids, and CSV import and export on their own subpaths
- 03Tenant navigation built from the manifest, not hand-written
- 04SvelteKit server-to-client collection and message hydration
- 05Live-query bindings and browser AI adapters with a warm cache
The UI and Svelte layers share i18n deliberately
smrt-ui owns defineMessages, useI18n, Trans, and template rendering in the browser. smrt-svelte builds the server snapshot with buildI18nSnapshot and passes it through Provider. Put canonical themes under src/themes; src/theme is a legacy alias during migration.
Gate dock tools and page actions at the boundary
ToolDef.gates and composeDockAvailability decide whether an AdminShell dock tool is available before it is shown or invoked. The use:permission action makes the same permission decision in a component; applications can choose hide-only behavior without treating visibility as authorization. The web subpath also adapts live activity feeds and exposes updateAvailable.
Navigation the manifest already describes
tenantNavFromManifest turns a manifest into ordered navigation sections. It drops collections, internal and test classes, and items without a REST list route. It also drops single-table-inheritance subtypes that share a parent collection because the polymorphic endpoint already includes them. Pass permittedResources to filter the resources that a role can see. The filter checks the inheritance chain, so a permitted subtype keeps its applicable base link. Sorted output prevents manifest changes from reordering the sidebar.
How the shell is composed →AppShell is the composed entry
AppShell on the /app subpath wraps Provider, ThemeProvider, the theme CSS, AdminShell, and TenantNav built from the nav you pass. It is browser-only and lives beside /workspace, so the AdminShell barrel stays free of Provider. A dock snippet receives the data-surface registry, so a host places its assistant there without this package importing smrt-chat. Pass layout and onlayoutchange to own shell layout persistence, or neither to store it in user settings.
How the shell is composed →Screens derived from recipes
RecipeScreens, ListScreen, DetailScreen, and EditForm on the /screens subpath derive their views from a generated web definition and the resolved field policy. The /cookbook subpath builds AppShell sections and recipe surfaces from a cookbook document. CommandPalette mounts once as a shell slot item and owns the global shortcut. OverviewGrid joins the shell layout edit mode; ImportExport maps CSV columns against collection definitions.
AdminShell replaced the first-generation shells
The public workspace surface is the four-edge AdminShell contract. The earlier WorkspaceShell and RoleShell primitives remain only as migration references. No subpath exports them. Compose new work with AdminShell panels and focus tools. The earlier focus-tool dock stays available on the workspace/legacy subpath during application migration.
How the shell is composed →Browser AI preloads on a strategy you choose
Provider accepts a preload strategy of none, eager, idle, or on-visible. The default idle strategy schedules work in an idle callback. eager starts immediately, and none defers each adapter until first use. on-visible is manual: the package schedules nothing, and the application starts the preload. Adapters warm sequentially, and one failure does not stop the remaining adapters. A module-level cache keeps each initialized adapter, so navigation does not download a model again.
Calling a local model from a component
useLLM runs inside the Provider and exposes initialize, chat, and unload alongside reactive isReady, isGenerating, currentModel, error, and downloadProgress values. Streaming is delivered through an onToken callback while chat still resolves to the finished string. Unmounting deliberately does not unload the model, because the download is the expensive part.
One language snapshot per render
buildI18nSnapshot resolves server message templates for a locale, including tenant overrides. Provider accepts the result. The browser interpolates variables. A missing key uses the registered English default and then the key itself. Thus, a partly translated application still renders. The matching useI18n store and Trans component are in the UI foundation.
smrt-ui →Package UI
Component catalog and public contracts
Browse by the job you are doing. Each group shows its focused import path; the Playground tab renders the working controls and composed patterns.
Application context
Wrap the app once, then read session, permissions, mode, theme, and socket state from anywhere inside it.
@happyvertical/smrt-svelteRich form inputs
Provider-backed inputs for the values applications actually collect, beyond the foundation controls. RelationInput moved to @happyvertical/smrt-ui/forms; the re-export here is deprecated.
@happyvertical/smrt-svelte/formsComposed app shell
One browser-only root that composes Provider, ThemeProvider, the theme CSS, AdminShell, and tenant navigation; the template root layout uses it.
@happyvertical/smrt-svelte/appApplication shell
The four-edge AdminShell family and its panels, activity surfaces, and hotkeys.
@happyvertical/smrt-svelte/workspaceCommand palette
A trigger and dialog on one global shortcut, with navigation and manifest providers; mount it once as an AppShell slot item.
@happyvertical/smrt-svelte/command-paletteRecipe screens
List, view, create, and edit screens derived from a generated web definition and the resolved field policy.
@happyvertical/smrt-svelte/screensOverview surfaces
A customizable widget grid joined to the shell layout edit mode, with a host-owned controller; the server load contract is on /overview/server.
@happyvertical/smrt-svelte/overviewCookbook shell
Build AppShell sections and recipe surfaces from a cookbook and the recipe catalog; loadCookbookApp on /cookbook/server reads and validates it.
@happyvertical/smrt-svelte/cookbookImport and export
CSV and TSV import with column mapping, a validation preview, and an error report, plus column-selected export. Both follow the collection definitions and the resolved field policy.
@happyvertical/smrt-svelte/import-exportSortable
Pointer, touch, keyboard, and screen-reader sorting of containers and items on the Board drag engine.
@happyvertical/smrt-svelte/sortableFocus tools dock
The first-generation dock, kept on its own opt-in subpath while applications migrate to AdminShell focus tools.
@happyvertical/smrt-svelte/workspace/legacyBrowser AI components
Speech input, capability gating, and honest model download feedback.
@happyvertical/smrt-svelte/browser-ai/svelteBrowser AI hooks and warm cache
Call a local model from a component, and keep an initialized adapter across navigation.
@happyvertical/smrt-svelteBrowser AI adapters
Framework-neutral capability detection and the adapters behind the hooks. Speech-to-text is browser-speech, whisper-cpp, whisper-local (alias whisper-wasm), or moonshine; the on-device models need the optional @happyvertical/speech peer.
@happyvertical/smrt-svelte/browser-aiLive collections and feeds
Svelte 5 bindings over the browser data runtime, plus an activity feed and an update-available signal.
@happyvertical/smrt-svelte/webPage agent tools
Declare a component-owned browser tool, or bind a declared view intent to a mounted control or data view, for the component's lifetime.
@happyvertical/smrt-svelteServer-side helpers
Build a translated message snapshot on the server so the first render is already in the right language.
@happyvertical/smrt-svelte/i18n/serverSettings catalog
A searchable, paginated settings index with a detail pane.
@happyvertical/smrt-svelte/settingsPackage previews
No playground module yet
This package does not currently export a ./playground module. Its component names and import path remain available in the Components tab.
Intentionally not registered
Generated interface
REST
The exact route set comes from each model's @smrt({ api }) policy
and the application manifest—not from a second controller definition.
This package supports the runtime or build pipeline; it does not define a representative CRUD resource of its own.
Generated interface
MCP
AI tools are generated from the methods you explicitly include. Their inputs are validated against the same model metadata used by REST and CLI.
This package is itself infrastructure, UI, or tooling. Its capabilities are consumed by generated app MCP servers rather than exposed as a model resource.
Browser-native agent interface
WebMCP
The generated web definitions carry the same tool names, descriptions, and JSON Schema
inputs as MCP. smrt-web registers them with document.modelContext.
This package does not define a representative browser tool itself. Its models can still participate when an application exposes them through generated web collections.
Generated interface
CLI
The app CLI turns manifest resources into predictable operator commands while keeping package-specific actions close to their models.
Use this package through its documented build or runtime entry points. It does not contribute a representative generated resource command.