@happyvertical/smrt-web
A manifest-generated browser data runtime with typed collections, persistence, live updates, and offline mutation replay.
What it gives you
A manifest-generated browser data runtime with typed collections, persistence, live updates, and offline mutation replay.
- 01SvelteKit hydration seeding
- 02SSE live updates with polling fallback
- 03Durable IndexedDB outbox and version-aware persistence
- 04WebMCP tools
- 05Policy-governed bespoke tools and a dependency-free view-intent entry
- 06A page-side registry of the WebMCP tools the page itself registered
The page can see its own tools
installWebMcpPageToolRegistry on the /webmcp-page-tools subpath records every registered tool while forwarding to the native context. An in-page assistant can then list and run the same tools an outside agent sees. The entry is dependency-free. Collection fetches accept a plain array, a list envelope with an items property, or a data envelope.
Offline writes and read persistence solve different problems
OfflineOutboxConfig keeps a durable IndexedDB write queue, with Web Locks leader election, exponential backoff, sync-apply-only replay, and onConflict and onSyncStateChange callbacks. persistCollection is the separate read cache: it rehydrates through SQLite-WASM or OPFS, writes back, and invalidates when the manifest hash changes.
Package UI
No UI layer to carry
This package stays focused on models, runtime behavior, or tooling. Build its interface with smrt-ui, or use a related domain package that exposes a /svelte entry point.
Intentionally headless
Package 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.
import { webMcpToolDefinitions } from '@happyvertical/smrt-virt-web';
import { registerWebMcpTools } from '@happyvertical/smrt-web';
// Omitting an exposure policy registers read-only tools only.
const dispose = registerWebMcpTools(webMcpToolDefinitions);The page keeps its security boundary
- Tools execute through generated REST fetchers as the signed-in page user.
- Authentication, tenant gates, permissions, and field policy stay server-side.
- Feature detection makes registration a safe no-op outside supported browsers.
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.