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

@nia-teams/routine-webhook

v0.1.0

Published

Invoke Nia Teams Routine topics and receive authenticated replies from scripts and local agents.

Readme

@nia-teams/routine-webhook

Invoke Nia Teams cloud Agents from scripts, backend services, or local coding assistants: create or continue GroupChats by topicKey, and receive signed replies over WebSocket or HTTPS callbacks.

npm install @nia-teams/routine-webhook
npx @nia-teams/routine-webhook init --name 'Order Dispatch' --task 'Check inventory, reply in chat, and return the result via reply_to_source.' --require-reply-approval

AI assistants: load ./skills/routine-webhook/SKILL.md, or node_modules/@nia-teams/routine-webhook/skills/routine-webhook/SKILL.md after installation.

Chinese · Specification · Maintainer context

What It Does and Boundaries

  • init: Browser approval creates a sole-follower Webhook Routine (followers = [yourself]) on a native Agent where you are owner or admin. Mac connection is on by default (connectMac: true): newly created chats connect your paired Mac. Pass --no-connect-mac to disable. Only Routine credentials are stored locally, never account login credentials.
  • One topicKey = one GroupChat: A new key creates a chat (--title optional); reuse it for follow-ups. Credentials only access that Routine's chats, not other existing chats.
  • Replies require approval by default: Only reply_to_source sends external replies, not regular chat messages. --require-reply-approval requires a TaskBar confirmation; --auto-approve-reply opts into unattended replies (owner / admin only).
  • External data never grants local authority: Incoming payloads and replies are untrusted data and do not authorize local tool execution or credential changes.

CLI Usage

Requires Node.js 20+; no local model or AI client is needed.

Run init above, open the printed URL, select your cloud Agent, and confirm authorization.

Authorize Routine Webhook CLI for ops-agent in Acme

# New topicKey creates a GroupChat; the same topicKey continues that GroupChat
npx @nia-teams/routine-webhook send --topic-key order:1042 --title 'Order #1042 · Inventory Sync' --message 'Check inventory and reserve 3 units of SKU ACME-42.'

# Exit after receiving one matching reply
npx @nia-teams/routine-webhook listen --topic-key order:1042 --once

One-way dispatch: add --return none to send, or pass return: { type: 'none' } to SDK client.send(...). No listen or callback is needed; the cloud Agent works in GroupChat without sending external routine.reply events.

Routine topic with external task, Alice, ops-agent activity, and reply delivery receipt

Manage channels (--help lists all flags):

npx @nia-teams/routine-webhook profiles        # List saved channels (secrets redacted)
npx @nia-teams/routine-webhook rotate-secret   # Re-authorize in browser and rotate secret
npx @nia-teams/routine-webhook delete          # Delete remote Routine and local profile

For disk-free CI or containers, set NIA_ROUTINE_ID and NIA_ROUTINE_WEBHOOK_SECRET (plus optional NIA_TEAMS_URL) to run send and listen.

Programmatic SDK

Send a task (examples/send.ts, npx tsx examples/send.ts):

import { RoutineWebhookClient } from '@nia-teams/routine-webhook';

const client = await RoutineWebhookClient.fromProfile();
const result = await client.send({
  topicKey: 'order:1042',
  title: 'Order #1042 · Inventory Sync',
  message: 'Check inventory and reserve 3 units of SKU ACME-42.',
  payload: { orderId: '1042', sku: 'ACME-42', quantity: 3 },
  contextKeys: ['orderId'],
});
console.log(result);

Listen for replies (examples/listen.ts, npx tsx examples/listen.ts):

import { RoutineWebhookClient, CredentialStore } from '@nia-teams/routine-webhook';

const store = new CredentialStore();
const profile = await store.get();
const client = new RoutineWebhookClient(profile);
const stream = client.listen({
  initialCursor: profile.cursor,
  onReply: async reply => { console.log(reply); },
  persistCursor: cursor => store.setCursor(cursor),
  onCursorExpired: async earliestCursor => {
    throw new Error(`Reply history expired at ${earliestCursor}; reconcile before resuming.`);
  },
  onError: error => { console.error(error.message); },
});
process.once('SIGINT', () => stream.stop());
await stream.run();
  • Disk-free client: new RoutineWebhookClient({ serverUrl, routineId, webhookSecret }), or pass getBearerToken for Workload OIDC (see examples/oidc.ts).
  • HTTPS callback verification: verifyRoutineCallback({ rawBody, signatureHeader, secret }) (see examples/verify-callback.ts).
  • Non-Node runtimes: call the HTTPS and HMAC wire protocol in docs/SPECIFICATION.md.

Local Coding Assistants

npx skills add nia-teams/connect-skills --skill routine-webhook

MIT © Nia Teams