@happyvertical/smrt-reactions
Tenant-scoped reactions and lightweight polls on any record, with participation limits enforced by a shared service.
What it gives you
Tenant-scoped reactions and lightweight polls on any record, with participation limits enforced by a shared service.
- 01Reaction, Poll, and PollVote models with a ParticipationRuntime on the server entry
- 02A profile votes once per poll, and a vote keeps its evidence unchanged
- 03ReactionBar and PollCard render authorized projections and call callbacks
- 04SQLite and PostgreSQL only; DuckDB is refused
The host binds the actor
ParticipationRuntime.create opens the database and returns the reaction and poll services. The host authenticates the actor and supplies an authorizeRecord callback. A missing callback, a rejection, or an error fails closed.
Participation limits are shared
ParticipationService from smrt-comments owns entitlement, bans, and quotas. A new reaction or vote reserves quota in the same transaction as the write. A failure rolls both back.
Polls are fixed at creation
A poll has two to fifty unique option ids that never change. An identical vote retry succeeds, and a different choice fails. A poll can close and reopen. The package is not a ballot, an election, or a legal audit system.
Components perform no fetch
The Svelte components receive tally props and async callbacks. They make no request and no authorization decision. Refresh the props after each mutation.
Package UI
Components in this package
Import these public components directly. When the package also exports playground entries, the next tab renders its real components with package-owned example data.
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.
The models disable generated mutation endpoints. Hosts call the reaction and poll services.
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.
The models disable generated mutation endpoints. Hosts call the reaction and poll services.
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.
The models disable generated mutation endpoints. Hosts call the reaction and poll services.
Generated interface
CLI
The app CLI turns manifest resources into predictable operator commands while keeping package-specific actions close to their models.
The models disable generated mutation endpoints. Hosts call the reaction and poll services.