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

@onkeiki/channels

v0.1.6

Published

Framework-free helpers for Keiki external harness channels

Readme

@onkeiki/channels

Framework-free helpers for applications that receive Keiki external-harness turns. The package verifies signed turn and cancellation payloads and provides a client for reporting messages, streamed text, typing, and turn completion back to Keiki.

import { createTurnClient, verifyKeikiRequest } from '@onkeiki/channels'

const request = verifyKeikiRequest({
  rawBody,
  headers: requestHeaders,
}, {
  signingSecret: process.env.KEIKI_SIGNING_SECRET!,
})

if (request.kind === 'turn') {
  const turn = createTurnClient({
    turnUrl: request.turn.turnUrl,
    turnToken: request.turnToken,
  })
  await turn.message('Hello.', { idempotencyKey: request.turn.turnId })
  await turn.complete({ status: 'completed' })
}

turn.message(text, { idempotencyKey, replyToMessageId?, effect? }) sends a threaded reply or an iMessage effect, and turn.action({ action: 'react' | 'edit' | 'delete' | 'send_file', ... }) runs a native channel action; a channel that cannot do it answers 400 unsupported before anything is sent. turn.sendFile({ data, filename, contentType?, caption? }) uploads a file from your server and sends it. Inbound files are on message.attachments: each has a short-lived download url, and turn.downloadAttachment(id) fetches it for as long as the turn is open. verifyKeikiRequest also returns { kind: 'reaction', reaction } for a contact's keiki.reaction event, which never needs a turn token. Give your model keikiMessagePrompt(message) (or keikiMessagesPrompt(turn.messages)) rather than raw text: it uses Keiki's annotated content, which carries the message id the reply guidance names, and prefixes PROMPT_GUARD_NOTE to screened messages.

The dispatch signature covers ${timestamp}.${rawBody} using HMAC-SHA256. Keep the signing secret and per-turn ht_ token private. For runtimes that cannot carry the dispatch token between processes, use signTurnAuth({ signingSecret, agentId, turnId }) to create a short-lived kts1.… bearer credential; verifyKeikiRequest(..., { requireTurnToken: false }) verifies the dispatch without requiring its Keiki-Turn-Token header. Turn clients accept a static bearer or a provider resolved afresh on every request and retry. Message delivery uses the API's idempotencyKey JSON field; a 502 from message() is not retried because delivery may have succeeded despite the response. Only typing and completion calls retry transient failures.