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 🙏

© 2024 – Pkg Stats / Ryan Hefner

speedybot-hub

v0.0.6

Published

speedybot-hub: zero fuss conversational design infra

Downloads

7

Readme

🏖 speedybot hub "cloud-native" conversation design infrastructure

A super-fast, "no ops" way to host conversation design infrastructure

╔═╗ ╔═╗ ╔═╗ ╔═╗ ╔╦╗ ╦ ╦ ╔╗  ╔═╗ ╔╦╗
╚═╗ ╠═╝ ║╣  ║╣   ║║ ╚╦╝ ╠╩╗ ║ ║  ║
╚═╝ ╩   ╚═╝ ╚═╝ ═╩╝  ╩  ╚═╝ ╚═╝  ╩ HUB
tl:dr; serverless chat that actually works

See quickstart.md on how to get up and running fast

Motivation

Speedybot-hub is a zero-config and really fast central "hub" for all your conversation design needs-- especially rich components & 3rd-party integrations.

Think of these little "hubs" as central locations around which your conversation design infrastructure can gather-- webhooks & all.

It needs to fast in all respects-- fast to develop, fast to deploy, fast to make edits, fast response times, fast at handling incoming webhooks-- everything should be fast. What matters in a conversational agent is not writing glue code or managing but the content + rich integrations. In the future we will probably be writing less individual "keyword" handlers and instead integrate with 3rd-party conversation services like Voiceflow, Amazon Lex, DialogFlow

Features

  • 🌟 Zero External Dependencies 🌟
  • Suggestion "chips"
  • SpeedyCard support (create rich Adpative Cards without wrangling JSON)
  • Support multiple keywords for single handlers (without duplicating handlers)
  • Milisecond response times (writtent to operate in V8 Isolates, not containers)
  • Can extend storage to reach any provider (ie dynamoDB, KV store, etc) with key namespaced personId_roomId_yourKeyHere
  • Edit conversation content & functionality directly in a browser-based editor

Special "magic" keywords

  • <@submit> (get the result of an AdaptiveCard form submission)
  • <@fileupload> (triggers when files uploaded-- $bot.getFile can retrieve the name + raw data)
  • <@catchall> (runs on every received message, useful when "passing" chat to a
  • <@botadded> (send a message to space whenever a bot is added)
  • <@nomatch> (runs when no)

Important

Wherever you host your Speedybot-hub, make sure to register its publically accessible URL with this command:

npm init speedybot webhook create -t __bot_token_here__ -w https://speedybot-hub.yourusername.workers.dev

Usage

const config = {
  token: 'vvv-www-xxx-yyy-zzz',
  debug: true, // Will log errors to chat agent as a message or log
  // valdiate: () => true, // [optional] pass in a function to validate incoming requests
  // storage: { async save(key, data) {}, async get(key) {}, async delete(key) {}} // [optional] pass in your own storage provided (ex dynamoDB, KV store, etc, keys are prefixed with personId_roomId_yourkeyname)
  // memberships: true, // Whether or not to acknowledge membership events
}

const handlers = {
  keyword: 'hi',
  handler($bot, trigger) {
    $bot.say(`Hi ${trigger.person.displayName}!!`)
  },
  keyword: '<@nomatch>',
  handler($bot) {
    $bot.say(`Sorry I don't know what to do with ${trigger.message.text}`)
  },
}

const inst = await SpeedybotMini(config.token, handlers)

// Incoming webhook
inst(webhookRequest)

Configuration

If you want to go really hardcode, break up your handlers into an object

{
    '<@catchall>': {
        async handler(bot, trigger) {},
        helpText:'n/a'
    },
      '<@submit>': {
        async handler(bot, trigger) {},
        helpText:'n/a'
    },
    '<@fileupload>': {
        async handler(bot, trigger) {},
        helpText:'n/a'
    },
       '<@nomatch>': {
        async handler(bot, trigger) {},
        helpText:'n/a'
    },
    'hi': {
        async handler($bot, trigger) {
            bot.sendRandom(['a','b','c'])
            bot.say(`Hi ${trigger.displayName}!`)
        },
        helpText:'n/a'
    },
}