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

@humbleaf/trigger-verify

v0.1.0

Published

The missing middleware for risky workflows. Add one line to stop unsafe Trigger.dev tasks before value moves.

Readme

@humbleaf/trigger-verify

Wrap any Trigger.dev v4 task with policy-gated settlement in one line.

The missing middleware for risky workflows. Before a task sends money, refunds a customer, or deploys to prod, AgentChain evaluates policy and returns a receipt that is safe to settle against.

Quick Start (5 minutes to first blocked action)

1. Install

pnpm add @humbleaf/trigger-verify @humbleaf/agentchain-sdk

2. Register middleware

// trigger/init.ts
import { tasks } from '@trigger.dev/sdk';
import { agentchainMiddleware } from '@humbleaf/trigger-verify';

tasks.middleware('agentchain', agentchainMiddleware({
  apiKey: process.env.AGENTCHAIN_API_KEY!,
  agentId: process.env.AGENTCHAIN_AGENT_ID!,
  approvalMode: 'soft-fail',
}));

3. Add invoiceSafe() to a task

import { task } from '@trigger.dev/sdk';
import { invoiceSafe, agentchain } from '@humbleaf/trigger-verify';

export const payInvoice = task({
  id: 'pay-invoice',

  ...invoiceSafe({
    vendor: (p) => p.vendorWallet,
    amount: (p) => p.amount,
    evidence: (p) => ({ invoiceHash: p.hash, vendorId: p.vendorId }),
  }),

  run: async (payload) => {
    const receipt = agentchain.getReceipt();
    if (receipt?.policyVerdict !== 'released') {
      return { paid: false, approvalUrl: receipt?.approvalUrl };
    }
    const tx = await transferUSDC(payload.vendorWallet, payload.amount);
    return { paid: true, tx, receiptId: receipt.receiptId };
  },
});

4. Happy path → Released ✓

Trigger run: pay-invoice
  Payload: { vendorWallet: "0xAcme", amount: 480, hash: "0xabc..." }
  AgentChain: ✓ Policy passed (5 checks)
  Result: { paid: true, tx: "0x...", receiptId: "rcpt_abc123" }

5. Blocked path → Denied ✗

Trigger run: pay-invoice
  Payload: { vendorWallet: "0xUnknown", amount: 480, hash: "0xdef..." }
  AgentChain: ✗ Denied — COUNTERPARTY_NOT_APPROVED
  Result: { paid: false, reason: "Vendor not on allowlist" }

6. Open dashboard → See receipts

Both results appear as receipts in your AgentChain dashboard with full policy evaluation details.

Presets

| Preset | Use Case | Policies Activated | |---|---|---| | invoiceSafe() | Pay invoices, rewards, refunds | Max value, counterparty allowlist, duplicate prevention, approval threshold | | deploySafe() | Deploy to production | Evidence required, time window, restricted action escalation |

deploySafe() example

import { deploySafe } from '@humbleaf/trigger-verify';

export const deployService = task({
  id: 'deploy-to-prod',
  ...deploySafe({
    service: 'payments-api',
    environment: 'production',
    evidence: (p) => ({
      gitSha: p.commitHash,
      testsPassed: p.ciGreen,
      rollbackArtifact: p.rollbackDigest,
    }),
  }),
  run: async (payload) => { /* ... */ },
});

Approval Mode

Controls what happens when policy returns pending_approval:

| Mode | Behavior | Best For | |---|---|---| | 'throw' | Task fails with AgentChainApprovalRequired | Simple workflows | | 'soft-fail' | Receipt stored, task continues | Queue handoff, Slack alerts | | 'wait' | Polls until approved or timeout | Human-in-the-loop |

agentchainMiddleware({
  apiKey: '...',
  agentId: '...',
  approvalMode: 'soft-fail',  // ← your choice
});

Approval Queue Handoff

When approvalMode: 'soft-fail', use the approval URL for dashboard handoff:

if (receipt?.policyVerdict === 'pending_approval') {
  await slack.send({
    text: `⏳ Invoice $${payload.amount} needs approval`,
    url: receipt.approvalUrl,
  });
}

License

MIT