@basaltkit/comments adds threaded comments to any resource — a note, a project, a task — with @mentions and resolve/reopen, scoped per tenant. It emits events that bridge cleanly to realtime (live discussion) and notifications (alert the mentioned).
add extracts @mentions from the body (configurable pattern), stores them on the comment, and emits comment:created plus one comment:mentioned per mentioned user. Also: edit, remove, resolve(id, by), reopen(id).
commentRoutes() (require a logged-in user; author taken from ctx().user): GET /comments?resourceType=&resourceId=, POST /comments, PATCH /comments/:id, DELETE /comments/:id, POST /comments/:id/resolve and /reopen. Editing and deleting are restricted to the comment's author. Everything is tenant-scoped.
Ready-made UI is not needed here — comments render inline in your app — but the same self-contained pattern powers the audit viewer.
Comments
@basaltkit/commentsadds threaded comments to any resource — a note, a project, a task — with @mentions and resolve/reopen, scoped per tenant. It emits events that bridge cleanly to realtime (live discussion) and notifications (alert the mentioned).Setup
Add and read
addextracts @mentions from the body (configurable pattern), stores them on the comment, and emitscomment:createdplus onecomment:mentionedper mentioned user. Also:edit,remove,resolve(id, by),reopen(id).Live discussion + mention notifications
The events do the wiring, with no coupling:
Routes
commentRoutes()(require a logged-in user; author taken fromctx().user):GET /comments?resourceType=&resourceId=,POST /comments,PATCH /comments/:id,DELETE /comments/:id,POST /comments/:id/resolveand/reopen. Editing and deleting are restricted to the comment's author. Everything is tenant-scoped.Ready-made UI is not needed here — comments render inline in your app — but the same self-contained pattern powers the audit viewer.