@happyvertical/smrt-comments
Tenant-scoped comments on any record, mention notification composition, and a browser-safe RecordComments component.
What it gives you
Tenant-scoped comments on any record, mention notification composition, and a browser-safe RecordComments component.
- 01Comments attach to arbitrary records through a qualified polymorphic metaType and metaId pair
- 02CommentService requires a trusted actor and a host authorizeRecord callback on both create and listForRecord
- 03No runtime dependency on smrt-messages: the host composes mention notifications through a structural interface
Mentions and delivery
Mentions are UUIDs, deduplicated, limited to 50; self-mentions do not notify. Validation finishes before the single insert, so an invalid mention leaves no row. The comment is saved before delivery; a delivery rejection leaves it saved, and the retry is delivery, not create.
The component owns nothing but the view
RecordComments takes authorized comment projections, an onsubmit callback, and a contextKey naming tenant, actor, and record. Changing the key clears drafts and ignores stale submissions. The host owns loading, authentication, mention selection, and refresh. The comments.records recipe has no global navigation: a discussion needs an already-authorized parent record.
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
Not rendered here yet
The package exports RecordCommentsPlayground, a standalone sample-record preview with local-only posting. This site does not install the package, so the preview is not rendered here.
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.
Generated REST, MCP, WebMCP, and CLI access is disabled. Direct model and collection APIs are persistence primitives for trusted code, not authorization boundaries.
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.
Generated REST, MCP, WebMCP, and CLI access is disabled. Direct model and collection APIs are persistence primitives for trusted code, not authorization boundaries.
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.
Generated REST, MCP, WebMCP, and CLI access is disabled. Direct model and collection APIs are persistence primitives for trusted code, not authorization boundaries.
Generated interface
CLI
The app CLI turns manifest resources into predictable operator commands while keeping package-specific actions close to their models.
Generated REST, MCP, WebMCP, and CLI access is disabled. Direct model and collection APIs are persistence primitives for trusted code, not authorization boundaries.