@lastshotlabs/slingshot-chat
npm install @lastshotlabs/slingshot-chat
Functions
Section titled “Functions”createChatPackage
Section titled “createChatPackage”Chat package factory.
Creates a SlingshotPackageDefinition that mounts the 10 chat entities
(Room, RoomMember, Message, ReadReceipt, MessageReaction, Pin, Block,
FavoriteRoom, RoomInvite, Reminder), wires adapter-dependent middleware
(archiveGuard, broadcastGuard, dmRoomGuard, roomCreatorGrant, memberGrant,
messagePostCreate, messageNotify, memberInviteNotify, replyCountUpdate,
replyCountDecrement), publishes the ChatInteractionsPeerCap capability,
registers push formatters, opportunistically integrates with
slingshot-embeds, and starts the two 30-second schedulers (reminders +
scheduled messages) plus the WebSocket incoming-event dispatch.
Every adapter ref, middleware closure, scheduler timer, and lazy notification-builder reference is owned by the factory’s closure (Rule 3) — multiple package instances in the same process do not share state.
function createChatPackage(rawConfig: ChatPluginConfig): SlingshotPackageDefinitionSource: packages/slingshot-chat/src/plugin.ts
Constants
Section titled “Constants”Source: packages/slingshot-chat/src/public.ts
CHAT_PLUGIN_STATE_KEY
Section titled “CHAT_PLUGIN_STATE_KEY”Plugin state key for slingshot-chat.
Single-sourced constant — no magic string 'slingshot-chat' anywhere in
cross-package contracts (cold-start invariant #7).
Source: packages/slingshot-chat/src/state.ts
ChatEntities
Section titled “ChatEntities”Public contract for slingshot-chat.
Two layers:
-
ChatEntities— the canonical adapter surface. Each ref names a read-only slice of an entity adapter (Room.getById, Message.list, etc.). Consumers resolve these viarequireEntityAdapter(carrier, ref)from@lastshotlabs/slingshot-core. The adapters are published into pluginState by the framework’s package compiler during the package’ssetupRoutesphase, so consumers must read insetupPostor per-request handlers. -
ChatInteractionsPeerCap— the cross-package peer capability used byslingshot-interactionsfor component-tree resolution and updates. Resolved viactx.capabilities.require(ChatInteractionsPeerCap).
Source: packages/slingshot-chat/src/public.ts
ChatInteractionsPeerCap
Section titled “ChatInteractionsPeerCap”Source: packages/slingshot-chat/src/public.ts
ChatModerationPeerCap
Section titled “ChatModerationPeerCap”Source: packages/slingshot-chat/src/public.ts
Classes
Section titled “Classes”ChatRepoNotImplementedError
Section titled “ChatRepoNotImplementedError”Thrown when a repository backend operation has not been implemented yet. Replace with actual implementation — do not catch and ignore.
Source: packages/slingshot-chat/src/factories/errors.ts
Interfaces
Section titled “Interfaces”A chat room.
Source: packages/slingshot-chat/src/types.ts
BlockAdapter
Section titled “BlockAdapter”A chat room.
Source: packages/slingshot-chat/src/types.ts
ChatAesGcmEncryptionConfig
Section titled “ChatAesGcmEncryptionConfig”A chat room.
Source: packages/slingshot-chat/src/types.ts
ChatInteractionsPeer
Section titled “ChatInteractionsPeer”Public contract for slingshot-chat.
Two layers:
-
ChatEntities— the canonical adapter surface. Each ref names a read-only slice of an entity adapter (Room.getById, Message.list, etc.). Consumers resolve these viarequireEntityAdapter(carrier, ref)from@lastshotlabs/slingshot-core. The adapters are published into pluginState by the framework’s package compiler during the package’ssetupRoutesphase, so consumers must read insetupPostor per-request handlers. -
ChatInteractionsPeerCap— the cross-package peer capability used byslingshot-interactionsfor component-tree resolution and updates. Resolved viactx.capabilities.require(ChatInteractionsPeerCap).
Source: packages/slingshot-chat/src/public.ts
ChatMessageDeletedPayload
Section titled “ChatMessageDeletedPayload”A chat room.
Source: packages/slingshot-chat/src/types.ts
ChatModerationPeer
Section titled “ChatModerationPeer”Public contract for slingshot-chat.
Two layers:
-
ChatEntities— the canonical adapter surface. Each ref names a read-only slice of an entity adapter (Room.getById, Message.list, etc.). Consumers resolve these viarequireEntityAdapter(carrier, ref)from@lastshotlabs/slingshot-core. The adapters are published into pluginState by the framework’s package compiler during the package’ssetupRoutesphase, so consumers must read insetupPostor per-request handlers. -
ChatInteractionsPeerCap— the cross-package peer capability used byslingshot-interactionsfor component-tree resolution and updates. Resolved viactx.capabilities.require(ChatInteractionsPeerCap).
Source: packages/slingshot-chat/src/public.ts
ChatNoEncryptionConfig
Section titled “ChatNoEncryptionConfig”A chat room.
Source: packages/slingshot-chat/src/types.ts
ChatPermissionsConfig
Section titled “ChatPermissionsConfig”A chat room.
Source: packages/slingshot-chat/src/types.ts
ChatPingPayload
Section titled “ChatPingPayload”A chat room.
Source: packages/slingshot-chat/src/types.ts
ChatPluginConfig
Section titled “ChatPluginConfig”A chat room.
Source: packages/slingshot-chat/src/types.ts
ChatReadBroadcastPayload
Section titled “ChatReadBroadcastPayload”A chat room.
Source: packages/slingshot-chat/src/types.ts
ChatReadPayload
Section titled “ChatReadPayload”A chat room.
Source: packages/slingshot-chat/src/types.ts
ChatTypingPayload
Section titled “ChatTypingPayload”A chat room.
Source: packages/slingshot-chat/src/types.ts
CreateMemberInput
Section titled “CreateMemberInput”A chat room.
Source: packages/slingshot-chat/src/types.ts
CreateMessageInput
Section titled “CreateMessageInput”A chat room.
Source: packages/slingshot-chat/src/types.ts
CreateRoomInput
Section titled “CreateRoomInput”A chat room.
Source: packages/slingshot-chat/src/types.ts
FavoriteRoom
Section titled “FavoriteRoom”A chat room.
Source: packages/slingshot-chat/src/types.ts
FavoriteRoomAdapter
Section titled “FavoriteRoomAdapter”A chat room.
Source: packages/slingshot-chat/src/types.ts
Message
Section titled “Message”A chat room.
Source: packages/slingshot-chat/src/types.ts
MessageAdapter
Section titled “MessageAdapter”A chat room.
Source: packages/slingshot-chat/src/types.ts
MessageReaction
Section titled “MessageReaction”A chat room.
Source: packages/slingshot-chat/src/types.ts
MessageReactionAdapter
Section titled “MessageReactionAdapter”A chat room.
Source: packages/slingshot-chat/src/types.ts
A chat room.
Source: packages/slingshot-chat/src/types.ts
PinAdapter
Section titled “PinAdapter”A chat room.
Source: packages/slingshot-chat/src/types.ts
ReactionCountPayload
Section titled “ReactionCountPayload”A chat room.
Source: packages/slingshot-chat/src/types.ts
ReadReceipt
Section titled “ReadReceipt”A chat room.
Source: packages/slingshot-chat/src/types.ts
ReadReceiptAdapter
Section titled “ReadReceiptAdapter”A chat room.
Source: packages/slingshot-chat/src/types.ts
ReadReceiptCreatedPayload
Section titled “ReadReceiptCreatedPayload”A chat room.
Source: packages/slingshot-chat/src/types.ts
Reminder
Section titled “Reminder”A chat room.
Source: packages/slingshot-chat/src/types.ts
ReminderAdapter
Section titled “ReminderAdapter”A chat room.
Source: packages/slingshot-chat/src/types.ts
RoomInvite
Section titled “RoomInvite”A chat room.
Source: packages/slingshot-chat/src/types.ts
RoomInviteAdapter
Section titled “RoomInviteAdapter”A chat room.
Source: packages/slingshot-chat/src/types.ts
RoomMember
Section titled “RoomMember”A chat room.
Source: packages/slingshot-chat/src/types.ts
RoomMemberAdapter
Section titled “RoomMemberAdapter”A chat room.
Source: packages/slingshot-chat/src/types.ts
UpdateMemberInput
Section titled “UpdateMemberInput”A chat room.
Source: packages/slingshot-chat/src/types.ts
UpdateMessageInput
Section titled “UpdateMessageInput”A chat room.
Source: packages/slingshot-chat/src/types.ts
UpdateRoomInput
Section titled “UpdateRoomInput”A chat room.
Source: packages/slingshot-chat/src/types.ts
UserKeyBundle
Section titled “UserKeyBundle”Source: packages/slingshot-chat/src/encryption/stub.ts
AddMemberInput
Section titled “AddMemberInput”A chat room.
Source: packages/slingshot-chat/src/types.ts
ChatEncryptionConfig
Section titled “ChatEncryptionConfig”A chat room.
Source: packages/slingshot-chat/src/types.ts
ChatMessageUpdatedPayload
Section titled “ChatMessageUpdatedPayload”A chat room.
Source: packages/slingshot-chat/src/types.ts
MemberRole
Section titled “MemberRole”A chat room.
Source: packages/slingshot-chat/src/types.ts
MessageType
Section titled “MessageType”A chat room.
Source: packages/slingshot-chat/src/types.ts
NotifyPreference
Section titled “NotifyPreference”A chat room.
Source: packages/slingshot-chat/src/types.ts
RoomType
Section titled “RoomType”A chat room.
Source: packages/slingshot-chat/src/types.ts