@lastshotlabs/slingshot-interactions
npm install @lastshotlabs/slingshot-interactions
Functions
Section titled “Functions”buttonSchema
Section titled “buttonSchema”Button component schema.
Source: packages/slingshot-interactions/src/components/schema.ts
compileHandlers
Section titled “compileHandlers”Compile declarative handler templates into runtime dispatchers.
function compileHandlers(handlers: Record<string, HandlerTemplate>, deps: { app: Hono<AppEnv>; bus: SlingshotEventBus },): CompiledHandlerTableSource: packages/slingshot-interactions/src/handlers/compile.ts
createInteractionsPackage
Section titled “createInteractionsPackage”Create the interactions package.
Validates rawConfig via interactionsPluginConfigSchema, compiles all
declarative handler templates into dispatchers, and exposes:
POST {mountPath}/dispatch— the bespoke interaction dispatch endpoint.GET /interactionEvents/GET /interactionEvents/:id— entity-generated read routes for the user-scoped audit log (provided by the entity module).
function createInteractionsPackage(rawConfig: unknown): SlingshotPackageDefinitionSource: packages/slingshot-interactions/src/plugin.ts
dispatchInteraction
Section titled “dispatchInteraction”Runtime dependencies required by the interaction orchestrator.
async function dispatchInteraction(deps: DispatchDeps, request: DispatchRequest, userId: string, requestTenantId: string | null,): Promise<DispatchOutcome>Source: packages/slingshot-interactions/src/handlers/dispatch.ts
validateComponentTree
Section titled “validateComponentTree”Validate an arbitrary value as a component tree.
function validateComponentTree(input: unknown): ComponentTreeSource: packages/slingshot-interactions/src/components/validate.ts
verifyWebhookSignature
Section titled “verifyWebhookSignature”Verify a webhook signature and timestamp to prevent replay attacks.
function verifyWebhookSignature(body: string, signature: string, timestamp: string, secret: string, toleranceMs = TIMESTAMP_TOLERANCE_MS,): booleanSource: packages/slingshot-interactions/src/handlers/dispatchers/webhook.ts
Constants
Section titled “Constants”actionRowSchema
Section titled “actionRowSchema”Button component schema.
Source: packages/slingshot-interactions/src/components/schema.ts
componentTreeSchema
Section titled “componentTreeSchema”Button component schema.
Source: packages/slingshot-interactions/src/components/schema.ts
dispatchRequestSchema
Section titled “dispatchRequestSchema”Request schema for the bespoke interactions dispatch route.
Source: packages/slingshot-interactions/src/routes/dispatchRoute.schema.ts
dispatchResultSchema
Section titled “dispatchResultSchema”Request schema for the bespoke interactions dispatch route.
Source: packages/slingshot-interactions/src/routes/dispatchRoute.schema.ts
handlerTemplateSchema
Section titled “handlerTemplateSchema”Declarative handler template used by the interactions package config.
Source: packages/slingshot-interactions/src/handlers/template.ts
InteractionEvent
Section titled “InteractionEvent”Semantic statuses recorded in the interaction audit trail.
Source: packages/slingshot-interactions/src/entities/interactionEvent.ts
interactionEventFactories
Section titled “interactionEventFactories”Store-type keyed factories for the InteractionEvent audit entity.
Source: packages/slingshot-interactions/src/entities/factories.ts
interactionEventOperations
Section titled “interactionEventOperations”Semantic statuses recorded in the interaction audit trail.
Source: packages/slingshot-interactions/src/entities/interactionEvent.ts
Interactions
Section titled “Interactions”Public contract for slingshot-interactions.
Cross-package consumers resolve InteractionsRuntimeCap through
ctx.capabilities.require(...) to read the active interactions runtime
(handler registry, peers, rate limiter). The legacy plugin-state slot at
INTERACTIONS_PLUGIN_STATE_KEY is still published in parallel during the
bridge period.
Source: packages/slingshot-interactions/src/public.ts
INTERACTIONS_PLUGIN_STATE_KEY
Section titled “INTERACTIONS_PLUGIN_STATE_KEY”Stable plugin-state key used in ctx.pluginState.
Source: packages/slingshot-interactions/src/state.ts
interactionsPluginConfigSchema
Section titled “interactionsPluginConfigSchema”Config schema for createInteractionsPackage().
Source: packages/slingshot-interactions/src/config/schema.ts
InteractionsRuntimeCap
Section titled “InteractionsRuntimeCap”Public contract for slingshot-interactions.
Cross-package consumers resolve InteractionsRuntimeCap through
ctx.capabilities.require(...) to read the active interactions runtime
(handler registry, peers, rate limiter). The legacy plugin-state slot at
INTERACTIONS_PLUGIN_STATE_KEY is still published in parallel during the
bridge period.
Source: packages/slingshot-interactions/src/public.ts
modalSchema
Section titled “modalSchema”Button component schema.
Source: packages/slingshot-interactions/src/components/schema.ts
selectMenuSchema
Section titled “selectMenuSchema”Button component schema.
Source: packages/slingshot-interactions/src/components/schema.ts
textInputSchema
Section titled “textInputSchema”Button component schema.
Source: packages/slingshot-interactions/src/components/schema.ts
Interfaces
Section titled “Interfaces”ActionRow
Section titled “ActionRow”Message kinds that can own an interactive component tree.
Source: packages/slingshot-interactions/src/components/types.ts
Button
Section titled “Button”Message kinds that can own an interactive component tree.
Source: packages/slingshot-interactions/src/components/types.ts
ChatInteractionsPeer
Section titled “ChatInteractionsPeer”Peer contract implemented by chat/community owners of component trees.
Source: packages/slingshot-interactions/src/peers/types.ts
CommunityInteractionsPeer
Section titled “CommunityInteractionsPeer”Peer contract implemented by chat/community owners of component trees.
Source: packages/slingshot-interactions/src/peers/types.ts
CompiledHandlerTable
Section titled “CompiledHandlerTable”Normalized payload passed to one compiled dispatcher.
Source: packages/slingshot-interactions/src/handlers/contracts.ts
Dispatcher
Section titled “Dispatcher”Normalized payload passed to one compiled dispatcher.
Source: packages/slingshot-interactions/src/handlers/contracts.ts
DispatchOutcome
Section titled “DispatchOutcome”Runtime dependencies required by the interaction orchestrator.
Source: packages/slingshot-interactions/src/handlers/dispatch.ts
InteractionsPeer
Section titled “InteractionsPeer”Peer contract implemented by chat/community owners of component trees.
Source: packages/slingshot-interactions/src/peers/types.ts
InteractionsPluginState
Section titled “InteractionsPluginState”Stable plugin-state key used in ctx.pluginState.
Source: packages/slingshot-interactions/src/state.ts
Message kinds that can own an interactive component tree.
Source: packages/slingshot-interactions/src/components/types.ts
SelectMenu
Section titled “SelectMenu”Message kinds that can own an interactive component tree.
Source: packages/slingshot-interactions/src/components/types.ts
TextInput
Section titled “TextInput”Message kinds that can own an interactive component tree.
Source: packages/slingshot-interactions/src/components/types.ts
ButtonStyle
Section titled “ButtonStyle”Message kinds that can own an interactive component tree.
Source: packages/slingshot-interactions/src/components/types.ts
ComponentTree
Section titled “ComponentTree”Message kinds that can own an interactive component tree.
Source: packages/slingshot-interactions/src/components/types.ts
DispatchRequest
Section titled “DispatchRequest”Request schema for the bespoke interactions dispatch route.
Source: packages/slingshot-interactions/src/routes/dispatchRoute.schema.ts
DispatchResult
Section titled “DispatchResult”Request schema for the bespoke interactions dispatch route.
Source: packages/slingshot-interactions/src/routes/dispatchRoute.schema.ts
HandlerTemplate
Section titled “HandlerTemplate”Declarative handler template used by the interactions package config.
Source: packages/slingshot-interactions/src/handlers/template.ts
InteractionResponseStatus
Section titled “InteractionResponseStatus”Semantic statuses recorded in the interaction audit trail.
Source: packages/slingshot-interactions/src/entities/interactionEvent.ts
InteractionsPluginConfig
Section titled “InteractionsPluginConfig”Parsed interactions plugin config with defaults applied.
Source: packages/slingshot-interactions/src/config/types.ts
MessageKind
Section titled “MessageKind”Message kinds that can own an interactive component tree.
Source: packages/slingshot-interactions/src/components/types.ts
QueueHandlerTemplate
Section titled “QueueHandlerTemplate”Declarative handler template used by the interactions package config.
Source: packages/slingshot-interactions/src/handlers/template.ts
RouteHandlerTemplate
Section titled “RouteHandlerTemplate”Declarative handler template used by the interactions package config.
Source: packages/slingshot-interactions/src/handlers/template.ts
SelectMenuKind
Section titled “SelectMenuKind”Message kinds that can own an interactive component tree.
Source: packages/slingshot-interactions/src/components/types.ts
WebhookHandlerTemplate
Section titled “WebhookHandlerTemplate”Declarative handler template used by the interactions package config.
Source: packages/slingshot-interactions/src/handlers/template.ts