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

@fabric-harness/channels

v0.30.0

Published

Event-ingress channels (Slack, GitHub, …) for TechFabric Harness agents.

Readme

@fabric-harness/channels

Event-ingress channels for TechFabric Harness — turn platform webhooks (Slack, GitHub, …) into agent dispatches. The core Channel seam lives in @fabric-harness/sdk; this package provides the 18 vendor adapters behind subpath exports so vendor code stays out of core.

Handlers are written against the Web Request/Response API and crypto.subtle, so the same channel runs on Node and Cloudflare.

Maintained subpaths cover Slack, GitHub, Discord, Teams, Telegram, Twilio, Azure SMS, WhatsApp, Google Chat, Linear, Notion, Stripe, Zendesk, Intercom, Shopify, Messenger, Resend, and Salesforce Marketing Cloud. Run fh add channel <name> to install a versioned recipe. Import channelCompatibility from @fabric-harness/channels/compatibility for supported provider APIs and the deprecation contract.

When a provider supplies the raw inbound email, use @fabric-harness/channels/email-auth to verify aligned DKIM after authenticating the webhook. Pass the original MIME bytes and act only on the evidence in verified when the result is pass. See the inbound email guide for Node and Workers examples.

Slack

// .fabricharness/channels/slack.ts
import { createSlackChannel } from '@fabric-harness/channels/slack';

export const channel = createSlackChannel({
  signingSecret: process.env.SLACK_SIGNING_SECRET!,
  agent: 'assistant', // dispatch app mentions / threaded messages here
});

The events handler verifies the v0 HMAC signature, answers the URL-verification challenge, and dispatches app_mention / threaded message events to the agent keyed by the Slack thread — with the Slack event_id as the dedupe key, the team as tenantId, and the user as the acting actor (which powers on-behalf-of governance). A redelivered event is deduplicated while its submission record is kept. The Node server's default submission store is in memory, so a redelivery after a restart runs a second agent turn unless a durable submissionStore is configured.

Outbound, bind the reply tool to the thread at agent init:

import { replyInSlackThread } from '@fabric-harness/channels/slack';

export default createAgent(({ id }) => {
  const thread = channel.parseConversationKey(id);
  return { tools: [replyInSlackThread(thread, { botToken: process.env.SLACK_BOT_TOKEN! })] };
});

Buzz (preview)

Buzz is a self-hostable Nostr-based workspace where humans and agents share channels. Unlike webhook vendors, Buzz pushes over a NIP-01 WebSocket, so ingress uses the buzz-tail transport shim: it holds a NIP-42-authenticated subscription and forwards events to the channel's /events route inside a timestamped X-Fabric-Signature: v1= HMAC envelope (same route a future Buzz workflow call_webhook egress can target). The handler additionally verifies each inner event's Schnorr signature, so the acting actor is the cryptographically proven author pubkey. Requires nostr-tools (declared dependency; the only non-Fetch/WebCrypto adapter, hence status: preview + sdk: nostr-tools in the compatibility contract).

// .fabricharness/channels/buzz.ts
import { buzzPublicKey, createBuzzChannel } from '@fabric-harness/channels/buzz';
import { buzzState } from '../state/buzz.js';

const channels = ['gtm-pipeline'];

export const channel = createBuzzChannel({
  agent: 'assistant',
  sharedSecret: process.env.BUZZ_ENVELOPE_SECRET!,
  selfPubkey: buzzPublicKey(process.env.BUZZ_PRIVATE_KEY!),
  community: 'acme',
  channels,
  decisionReceiptStore: buzzState.deliveryStore,
  onLifecycleEvent(notice) {
    // Content-free evidence only: edits/deletions never enter model context.
    console.info(JSON.stringify({ integration: 'buzz', ...notice }));
  },
});
// tail process (Node >= 22), co-deployed with the app
import { startBuzzTail } from '@fabric-harness/channels/buzz-tail';
import { buzzState } from '../state/buzz.js';

const channels = ['gtm-pipeline'];

startBuzzTail({
  relayUrl: process.env.BUZZ_RELAY_URL!,
  secretKey: process.env.BUZZ_PRIVATE_KEY!,
  community: 'acme', // must equal the channel's server-owned community
  channels, // same server-owned channel allowlist used by createBuzzChannel
  forwardUrl: 'https://app/channels/buzz/events',
  sharedSecret: process.env.BUZZ_ENVELOPE_SECRET!,
  cursorStore: buzzState.cursorStore,
  deadLetterStore: buzzState.deadLetterStore,
  onOperationalEvent(event) {
    // Content-free backfill, delivery, auth, reconnect, and shutdown evidence.
    console.info(JSON.stringify({ integration: 'buzz', ...event }));
  },
});

For PostgreSQL or Databricks Lakebase, inject the application's existing pg.Pool into the dependency-free structural client boundary. One scoped state object supplies all three production stores:

import { createPostgresBuzzPersistence } from '@fabric-harness/channels/buzz-postgres';
import { Pool } from 'pg';

export const buzzState = createPostgresBuzzPersistence({
  client: new Pool({ connectionString: process.env.DATABASE_URL }),
  consumerId: 'gtm-primary', // stable and unique per deployed consumer
});

createPostgresBuzzPersistence() initializes isolated cursor, dead-letter, and decision-card-delivery tables. Pass initialize: false when migrations own DDL and call ensurePostgresBuzzTables() from the migration boundary instead. The same contract works with Lakebase clients that implement the structural query() method; no Databricks or PostgreSQL dependency is loaded by the core channel adapter.

inspectPostgresBuzzHealth() is the read-only certification surface for one consumer. It returns only cursor lag/age, unresolved dead-letter depth, and prepared/published card counts; it never selects event, dead-letter, or decision-card payloads.

The default tail filter also observes stock Buzz message edits and event/channel deletions. createBuzzChannel() never dispatches these lifecycle events to an agent: its optional onLifecycleEvent sink receives a content-free notice with event ids, kind, author, scope, and decisionEffect: "none". Deleting a reaction therefore cannot reverse an immutable decision already committed by Platform. BUZZ_PROTOCOL_SUPPORT exposes this policy for capability discovery; direct messages, media, voice, and free-form edit approval remain unsupported.

The tail is a durable consumer, not a best-effort reconnect loop: it persists a cursor (advanced only after a 2xx forward or durably recorded dead-letter), pages a complete bounded POST /query snapshot backward and forwards it oldest-first on every (re)start, forwards in order with retry classification (408/429/5xx/network retry with bounded backoff; other 4xx go to deadLetterStore for reconciliation), answers NIP-42 challenges including OK acknowledgement and CLOSED re-subscription, enforces NIP-11 limits, and propagates cancellation and per-request timeouts. It fails closed when the cursor, backfill, or dead-letter store is unavailable. Use reconcileBuzzDeadLetters() from a bounded scheduled worker to replay unresolved records through the ordinary verified/governed ingress path. The channel route derives the tenant from its own community option (server-owned configuration) and refuses envelopes claiming any other community with 403 — the tenant is never taken from the event or envelope.

onOperationalEvent emits content-free backfill counts, forwarding outcomes, authentication renewals, reconnect attempts, and shutdown evidence. Sink failures are reported through onError without interrupting durable consumption. Applications generated by Buzz recipe v3 and later wire both operational and lifecycle events. Operators can preview and replay one bounded PostgreSQL/Lakebase dead-letter batch through the normal signed ingress route with:

fh buzz reconcile --dry-run --limit 100
fh buzz reconcile --limit 100 --json

Records are acknowledged only after a 2xx ingress response. Reports contain counts and the consumer id, never stored event content.

Outbound tools: postInBuzzChannel, replyInBuzzThread, addBuzzReaction. The tail also enforces NIP-11 at connect (requiredNips, default [1, 42]) and refuses relays that do not advertise them; probeBuzzRelay is exported for standalone detection.

Decisions are deterministic and model-free (@fabric-harness/channels/buzz-decisions, plan D14): postBuzzDecisionCard renders the canonical card from request data (never agent prose), signs it, and persists the exact immutable event plus its card receipt before relay I/O. A retry reuses the same Nostr event id, queries that id after an ambiguous response, and only then marks publication. The receipt binds (community, channel, cardEventId) to (approvalRequestId, requestVersion, parametersHash, options, expiry). The createBuzzDecisionBridge resolves a signed reaction through the receipt store and a fixed emoji table (👍/✅/+ → approve, 👎/❌/- → reject) into exactly one decision candidate carrying the attested Nostr identity and source-event proof; unmapped emoji surface for audit, free-form replies resolve to edit proposals that require structured confirmation, and everything else is ordinary conversation. The bridge performs zero authorization and signals nothing — the vertical's governed decision action owns binding resolution, capability, validation, and the decision transaction. Reactions from the Buzz Desktop app in block/buzz-app carry the h channel tag and route by it. The earlier Desktop app in block/buzz (0.5.x releases) and the Buzz SDK and CLI emit NIP-25 reactions with an e target and no h channel tag. To support that shape, give createBuzzChannel the same durable receipt store used by postBuzzDecisionCard plus an explicit channels allowlist. The route derives the channel only when the reaction has one target and exactly one receipt matches it inside that allowlist. Missing, malformed, cross-channel, and ambiguous matches are ignored; receipt-store failures fail the forward so the durable tail retries. Receipt correlation only recovers transport scope: the normal governed identity, membership, expiry, request-version, parameter-hash, and compare-and-swap checks remain mandatory downstream.

Migration from channels 0.18.x: postBuzzDecisionCard() now requires deliveryStore: BuzzDecisionCardDeliveryStore instead of a write-only receiptStore. The route still consumes its lookup-only decisionReceiptStore; in production both must be views over the same durable store (buzzState.deliveryStore). This closes the post-succeeded/receipt-write-failed split-brain window. Vendored kind constants are guarded by scripts/sync-buzz-kinds.mjs against a Buzz checkout's buzz-core/src/kind.rs.

See docs/channels-design.md.

Optional forwarding key selection: set forwardKeyId on startBuzzTail (the recipe and example read BUZZ_FORWARD_KEY_ID). CLI dead-letter reconciliation also reads BUZZ_FORWARD_KEY_ID; doctor reports configuration and rejects malformed values. The ID must match ^[A-Za-z0-9._:-]{1,128}$; empty values, whitespace and line terminators are rejected before forwarding. Omit the variable to omit the header. It is sent as x-fabric-key-id, outside the signature. HMAC already binds the key: a swapped ID selects a different secret and verification fails. The signature remains HMAC-SHA256 over <unix-seconds>.<raw body> and the envelope remains {community, relayUrl, event}. The Harness Buzz channel receiver uses its single shared secret and ignores this header; key-ring selection belongs to the receiver.

ElevenLabs Conversational AI

Import createElevenLabsVoiceClient, verifyElevenLabsWebhook, parseElevenLabsPostCallEvent, and reduceElevenLabsPostCallBody from @fabric-harness/channels/elevenlabs-voice. This optional REST and webhook module supports outbound calls through ElevenLabs' Twilio route, not SIP trunks or SDK live audio sessions. Supply an API key, agent id and imported phone number id; recording defaults to disabled. A refused call raises ElevenLabsCallRefusedError; other outbound errors are ElevenLabsRequestError with outcomeUnknown: true. Both classes expose a read-only HTTP status when available; failed reads have outcomeUnknown: false. Applications own admission, deduplication, consent, retention, retries and cleanup. The reducer defaults to keeping no dynamic variables, collection results, termination reason or tool names. It emits an ElevenLabs-shaped body that can be parsed again; repeat reduction is string-stable with the same options. Allowlisted scalar values are retained without content filtering. Initiation-failure events and voicemail detection are documented but unobserved in the reference captures. See the voice telephony guide for runnable request and webhook handling examples.

Twilio messaging client

Import createTwilioMessagingClient, parseTwilioStatusParams, and parseTwilioStatusCallback from @fabric-harness/channels/twilio for outbound SMS and callbacks without an agent. Supply accountSid, authToken, and optionally statusCallbackUrl, timeoutMs (default 10 seconds), or fetchImpl. send requires to, non-empty body, and from or messagingServiceSid (both are allowed). A non-blank per-message statusCallback overrides the default; a blank value falls back to it; callback URLs must be absolute HTTP(S) URLs. The deadline includes response reading and combines with signal.

TwilioMessagingError exposes kind, HTTP status and Twilio code when available. Kinds are opt_out (when Twilio reports code 21610), rate_limited, rejected, server_error, timeout, aborted, network, and invalid_response. Twilio error 20429 describes rejected requests as not processed and safe to retry after backing off; this is why only rate_limited is marked retryable. outcomeUnknown is true for the last five kinds: a message may have been created. The generic error message excludes provider text; providerMessage and moreInfo contain provider details. Transport errors retain their original cause. Applications own retries, deduplication, opt-out state and consent. The client sends no idempotency key and performs no automatic retries. For inbound messages, createTwilioChannel classifies carrier keywords and, when a callback is configured, reports them to onOptOut, onOptIn and onHelp. It stores no opt-out state; see below.

Person takeover

replyWithTwilio(ref, { ownershipStore }) and createTwilioMessagingClient({ ownershipStore }) refuse an agent send while a person owns the conversation, with ConversationOwnedByPersonError from @fabric-harness/sdk, before any request reaches Twilio. Ownership is the SDK's ConversationOwnershipStore record, written by takeOver and handBack. Derive the key with twilioOwnershipKey(accountSid, customer, sender, resolveWhatsAppIdentity), which returns null for an address outside the supported forms listed under supported addresses. Pass the same optional resolver used on the channel and send helpers. For supported addresses the default is twilioConversationKey({ accountSid, from: customer, to: sender }). The client checks ownership using the account and addresses and records conversation.instanceId as the delivery target. With an ownershipStore, an agent send whose key is null, including a Messaging-Service-only send, throws a TypeError before anything is read or sent. Pass sentBy: 'person' to skip the check on the caller's word: set it in trusted application code for an authenticated staff action, and never forward a sender value the model supplied to an agent-facing tool. A store that cannot be read refuses the send with ConversationOwnershipReadError. When an ownership store is configured and the key is valid, each agent send makes one ownership read, after validation, as the last await before the request, keyed by the same account the request uses. A takeover written after the store answered that read, while the answer is on its way back or the request to Twilio is in flight, does not stop that message. The check is only as current as the store's read, so a store that answers from a stale replica can miss a takeover written before the read. The timeout and caller signal on createTwilioMessagingClient().send cover the ownership read. replyWithTwilio honors the tool context signal until the request starts. It then reads the response and records an accepted send when a store is configured.

Wrap the channel with the SDK's withConversationOwnership(channel, { store, onPersonOwnedMessage }) to send inbound messages on a person-owned conversation to your callback instead of the agent. The keyword callbacks and onDeliveryEvent still run; dispatches they would have made go to the callback. Inbound and delivery-status dispatches carry twilioOwnershipKey of the webhook's addresses as their ownershipKey, so a delivery status is decided on the conversation, not on the instanceId recorded with the send. When that key is null, the wrapped channel fails the request with ConversationOwnershipReadError (unknown_conversation) and dispatches nothing. A short code of 3 to 7 digits is accepted on either side. Twilio may still refuse a send to a valid ownership address, such as a short-code SMS recipient (error 21265).

By default, each WhatsApp address has its own key. Set the same resolveWhatsAppIdentity function on the channel, reply tool and messaging client to link a phone number and business-scoped user ID for one account and sender. Use the channel's conversationKey(ref) or pass the resolver to twilioOwnershipKey to take over either alias. Both aliases use the canonical address for new inbound dispatches and ownership checks. The original addresses are used for transport. See the Twilio identity guide for setup, failure behavior and how to reconcile existing conversations.

Inbound compliance keywords

classifyTwilioKeyword(body, optOutType?) returns 'opt_out', 'opt_in', 'help' or undefined. The whole trimmed body, in ASCII letters and without regard to case, must match one of the default keywords on Twilio's Advanced Opt-Out page: STOP, UNSUBSCRIBE, END, QUIT, STOPALL, REVOKE, OPTOUT, CANCEL (opt-out); START, UNSTOP (opt-in); HELP. A sentence containing a keyword is not one, and neither is a body with a non-ASCII look-alike letter, such as ſTART or quıt. A valid OptOutType parameter (STOP, START, HELP) wins over the body; any other value is ignored.

YES and INFO are not in this adapter's fallback list. Twilio can treat them as keywords for some senders; when it does and sends OptOutType, the adapter classifies from OptOutType (Body=YES&OptOutType=START is opt_in, Body=INFO&OptOutType=HELP is help). The same page says Advanced Opt-Out also works with WhatsApp-enabled senders added to a Messaging Service and is disabled by default. A bare WhatsApp START therefore reaches onOptIn, when configured, with source: 'body', which does not show that Twilio applied an opt-in: decide in the callback, and treat source: 'opt_out_type' as Twilio's own classification.

createTwilioChannel applies this to SMS and whatsapp: messages after the signature check. The class callback (onOptOut, onOptIn, onHelp), when configured, is awaited under each of the three policies and runs before dispatch deduplication, so a redelivered webhook calls it again: make it idempotent. With no callback and the default policy, a keyword gets an empty reply, no callback and no agent turn. A signed non-status webhook with a valid OptOutType reaches the callback when one is configured, even without Body; it is not dispatched to the agent under any policy. If a callback throws, nothing is dispatched and the handler rejects, so the host can answer with an error and Twilio sees the failure. keywords: { optOut, optIn, help } sets what reaches the agent: 'callback_only' (default, no dispatch), 'deliver_with_classification' (dispatch plus input.keyword) or 'deliver' (dispatch as before). The policies and callbacks are read once when the channel is created. An unset keywords means the defaults; null, an array, an unsupported policy value, an unknown enumerable key or a callback that is not a function makes createTwilioChannel throw. A status callback is not checked for keywords: it takes the delivery-status path below before classification runs.

parseTwilioStatusParams is pure and does not authenticate. The request parser uses the bounded webhook reader and verifies the signature before returning a record; set webhookUrl to the public URL when a proxy rewrites it. Unknown status strings and additional parameters are preserved (first value per parameter). These parsers do not dispatch to an agent.

Twilio delivery status callbacks

createTwilioChannel treats a signed request to its /messages route that carries a non-empty MessageStatus as a status callback; an empty MessageStatus takes the inbound path. It looks up the MessageSid in the application's sentMessageStore (a TwilioSentMessageStore with recordSent and findSent) and routes the status to the conversation recorded at send time, not to a key built from the callback's From/To (for an outbound message From is the Twilio number, which reverses the inbound key). Record sends with createTwilioMessagingClient({ ..., sentMessageStore }) and send({ ..., conversation: { instanceId, agent?, actor?, tenantId? } }), or with replyWithTwilio(ref, { authToken, statusCallbackUrl, sentMessageStore, agent? }). inMemoryTwilioSentMessageStore() is a test double and is not durable.

Both send paths write the account used for the request URL to TwilioSentMessage.accountSid. Keep this optional string in your store to enable the account check. A callback uses its own AccountSid or the configured channel account when the field is absent. A different recorded account or conflicting callback account values return 403 before either hook or dispatch. Legacy records without an account skip the comparison. A stored account that is blank or has the wrong type returns 500. The delivery event includes the recorded account in conversation when available.

  • A recorded delivered, failed or undelivered status is passed to the awaited onDeliveryEvent as a TwilioDeliveryEvent (status, reason, raw errorCode, messageSid, dedupeKey, conversation, startsAgentTurn). Statuses in dispatchDeliveryStatuses (default ['failed', 'undelivered']) are then dispatched (to onPersonOwnedMessage instead of the agent when the channel is wrapped with withConversationOwnership and a person owns the conversation's address key) as a twilio.delivery signal message with dedupe key ${MessageSid}:status:${status}. Other statuses, such as queued or sent, are acknowledged and nothing else. The dispatch is built before the hook runs from its own copy of the record, and the event holds a separate copy, so a hook that changes its event changes neither the dispatch nor the store's object.
  • Records are copied field by field, not cloned, so a class instance or a record with methods works; extra fields are dropped. A record from findSent whose documented fields have the wrong types, or whose messageSid differs from the callback's, answers 500. A conversation whose fields have the wrong types makes send() throw a TypeError before anything is sent.
  • Each validated, matched delivered, failed or undelivered callback invokes onDeliveryEvent when one is configured. A redelivered callback invokes it again with the same dedupeKey, so make the hook idempotent. The adapter passes that key on the dispatch request; whether a repeat starts a second agent turn depends on the host honoring it. The Node host uses it as the submission id; the Twilio guide describes how that host treats a repeat.
  • With the WhatsApp resolver configured, a WhatsApp status missing an address or a status with neither address still matches by SID. For a matched event, onDeliveryEvent gets startsAgentTurn: false and the route returns 500 if the status was selected for dispatch. A matched status that is not selected gets 200. Supplied address fields still have to pass validation. With no resolver, a missing address continues to give ownershipKey: null for a dispatch to the recorded instance.
  • send() and the replyWithTwilio tool read their input, ref, options and store once, before the request, so replacing the store mid-flight does not change where a send is recorded.
  • A callback with an unambiguous account and a sid that is missing from the store (or no store configured) goes to the awaited onUnmatchedStatus(record, 'not_recorded' | 'no_store') and is not dispatched. Without the hook, the channel writes one console.warn line per callback with four fields: event (twilio.status_unmatched), reason (the cause), status (when it is one of Twilio's documented message statuses, otherwise unrecognized) and messageSid (when it is SM or MM followed by 32 hex digits, otherwise unrecognized). Nothing else from the request is written. Supply the hook to replace or silence it. A channel configured without a store or hook, as fh add channel twilio generates, is inbound-only.
  • A rejected lookup answers 500; a callback or dispatch rejection makes the handler reject.
  • Set webhookUrl without a fragment. Twilio leaves connection overrides such as #rp=5xx out of the signature, but the channel signs webhookUrl as given; put overrides on the statusCallbackUrl only.
  • classifyTwilioDeliveryFailure(code) maps 21610 to opt_out, 30034 to unregistered_sender, 30003, 30005 and 30006 to unreachable, and 30007 to carrier_filtered, per Twilio's error pages (https://www.twilio.com/docs/api/errors/<code>). Other codes are unknown.
  • When Twilio accepts a message but recordSent rejects, the send throws TwilioSentMessageRecordError (messageSent: true). Do not resend; retry the record write.

Before this release a status callback that carried both From and To was dispatched to agent as a twilio.status input on the key built from them. Configure a store and record sends to keep agent notifications. The Twilio channel guide has the full table and migration notes.

Azure Communication Services SMS

Import createAzureSmsChannel, createAzureSmsMessagingClient, and replyWithAzureSms from @fabric-harness/channels/azure-sms. Select Entra or shared-secret webhook authentication and supply the ACS ARM resource topic. The adapter handles Event Grid SMS events, text-only replies, and delivery reports for recorded sends. Outbound requests use ACS access-key signing and per-recipient repeatability fields. See the Azure SMS guide for setup, ownership, delivery behavior, and host requirements.