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

@hitl-sdk/adapter-chat-sdk

v1.0.0

Published

Vercel's Chat SDK channel plugin for hitl: deliver approvals to Slack, Teams, Discord and more from one adapter.

Readme

@hitl-sdk/adapter-chat-sdk

A hitl channel adapter backed by the Vercel Chat SDK. One adapter delivers approvals to Slack, Teams, Discord, and every other Chat SDK platform — the SDK owns webhook verification, payload parsing, and native card rendering (Block Kit, Adaptive Cards, embeds + modal).

Install

pnpm add @hitl-sdk/adapter-chat-sdk chat @chat-adapter/slack

chat and the @chat-adapter/* packages are peer dependencies — install the adapters for the platforms you use.

Usage

import { Hitl } from "@hitl-sdk/hitl";
import { createChatSdkAdapter } from "@hitl-sdk/adapter-chat-sdk";
import { workflowResolver } from "@hitl-sdk/resolver-workflow-sdk";
import { Chat } from "chat";
import { createSlackAdapter } from "@chat-adapter/slack";

const bot = new Chat({
  adapters: { slack: createSlackAdapter() }, // Chat SDK platform adapters
  state: createRedisState(), // any Chat SDK state adapter
});

export const hitl = new Hitl({
  resolver: workflowResolver(),
  adapters: [ // hitl channel adapters
    // `inbox` is lazy: `new Hitl()` needs the adapters before hitl.inbox exists.
    createChatSdkAdapter({
      id: "approvals",
      bot,
      defaultChannel: "slack:C123",
      inbox: () => hitl.inbox,
    }),
  ],
});

// Mount the Chat SDK webhook — it owns signature verification + parsing:
export const POST = bot.webhooks.slack; // app/api/webhooks/slack/route.ts

createChatSdkAdapter registers approve/deny and modal handlers on the bot, so the Chat SDK webhook resolves approvals through hitl.inbox. Multiple createChatSdkAdapter adapters sharing one bot register the handlers only once.

One adapter, multiple channels

Route per-request to any Chat SDK channel ref the bot can post into:

await waitForHuman({
  channel: "approvals:slack:C456", // adapter id + Chat SDK channel ref
  message: "Approve?",
  actions,
});

// Adapter id only uses defaultChannel when configured:
await waitForHuman({ channel: "approvals", message: "...", actions });

// Or omit defaultChannel and always pass adapter_id:destination:
await waitForHuman({ channel: "approvals:slack:C456", message: "...", actions });

Escalation uses the same routing key:

reminders: [escalate.to("approvals:slack:C999").after("1h", { mode: "redeliver" })],

Post in a thread

Include the Chat SDK thread ref in the channel destination (everything after adapter_id:):

await waitForHuman({
  channel: "approvals:slack:C123:1710000000.123456",
  message: "Approve?",
  actions,
});

Inside a workflow, chain later steps with after — hitl resolves the thread from state:

const pending = await requestHuman({ message: "Step 1", actions });
await notify({ after: pending, message: "Extra context" });

TimelineAnchor.externalRef

requestHuman and notify return a TimelineAnchor with an externalRef string: the adapter-native ref for the message hitl posted. waitForHuman returns the same field on HumanResult once the step resolves or times out — use it when you no longer have the pending anchor. With this adapter the format is channel#messageId (e.g. slack:C123#1710000000.123456). It is output-only — the library does not read it for routing. When the adapter returns no id, externalRef is "".

Use it to correlate hitl deliveries with your Chat SDK bot, for example to post a side note in the same thread:

const response = await waitForHuman({ message: "Approve?", actions, channel: "approvals" });

if (response.externalRef) {
  const threadRef = response.externalRef.replace("#", ":");
  await bot.thread(threadRef).post("Side note from the bot");
}