npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@lastshotlabs/slingshot-interactions

v0.0.2

Published

Interactive message components and dispatch orchestration for slingshot

Readme


title: Human Guide description: Human-maintained guidance for @lastshotlabs/slingshot-interactions

@lastshotlabs/slingshot-interactions provides the dispatch layer for interactive components such as buttons, menus, and action payloads emitted from chat or community surfaces. It compiles declarative handler templates, stores interaction events, and exposes one dispatch endpoint for component actions.

When To Use It

Use this package when your app needs:

  • a single backend route for dispatching interactive component actions
  • audited interaction events stored as entities
  • declarative routing of actions to webhooks, routes, or queues
  • optional integration with Slingshot chat and community packages

Do not use it as a generic job queue. This package is specifically for user-triggered interaction dispatch.

What You Need Before Wiring It In

createInteractionsPlugin() depends on:

  • slingshot-auth
  • slingshot-permissions

The plugin throws during setup if shared permissions state is missing.

Minimum Setup

Defaults are:

  • mountPath: '/interactions'
  • rateLimit.windowMs: 60_000
  • rateLimit.max: 20
  • handlers: {}

The main required work is defining handlers, which map action prefixes to compiled dispatch targets.

What You Get

The plugin mounts:

  • POST {mountPath}/dispatch
  • entity-backed read routes for interactionEvents

It also:

  • compiles declarative handler templates once at plugin construction time
  • publishes plugin state under INTERACTIONS_PLUGIN_STATE_KEY
  • registers client-safe bus events for interactions:event.dispatched and interactions:event.failed
  • probes chat and community peers when present so interactions can integrate cleanly with those packages

Common Customization

The main knobs are:

  • mountPath
  • rateLimit
  • handlers, keyed by action prefix

If you need to extend the system, start in:

  • src/config/schema.ts for config shape and defaults
  • src/handlers/ for template compilation and dispatcher behavior
  • src/routes/dispatchRoute.ts for the public dispatch endpoint
  • src/peers/ for chat and community integration points

Gotchas

  • The longest matching handler prefix wins. Action naming conventions matter because routing is prefix-based, not exact-match only.
  • The plugin owns an interaction-event entity surface in addition to the dispatch route. If you remove that entity layer, you also remove auditability.
  • Chat and community integrations are optional probes, not hard dependencies. Your handlers should still behave sensibly when those peers are absent.
  • Runtime handler registration overlays the compiled config. Treat that as an extension path, not a substitute for keeping manifest config accurate.

Key Files

  • src/index.ts
  • src/plugin.ts
  • src/config/schema.ts
  • src/components/schema.ts
  • src/handlers/compile.ts
  • src/routes/dispatchRoute.ts
  • src/entities/interactionEvent.ts