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

carapace-mail-runtime

v1.0.4

Published

🦞🐚 Provider-agnostic mail processing runtime for OpenClaw β€” rule engine, action registry, and dispatch pipeline

Readme

πŸ“¬ carapace-mail-runtime

CI npm

Provider-agnostic mail processing runtime for OpenClaw. Separates where mail comes from from what you do with it β€” any mail source (FastMail, Outlook, webhooks) shares the same rule engine and action handlers.

Install

npm install carapace-mail-runtime

Features

| Feature | Description | |---------|-------------| | πŸ“¨ MailEnvelope | Normalized message shape consumed by rules and actions | | πŸ“‹ Rule engine | Declarative JSON rules with match conditions (sender, subject, domain, regex, body, attachments, DKIM/SPF/DMARC) | | ⚑ Action registry | Named action handlers with automatic body fetching and attachment downloading | | πŸ”Œ Provider protocol | MailProviderClient interface that sources implement to plug into the pipeline | | πŸ“€ Result dispatch | Shared routing of ActionResult values into adapter-owned side effects | | 🧩 ActionPlugin | Extension interface for registering custom actions from external packages |

Quick Start

import {
  ActionRegistry,
  executeRules,
  registerBuiltinActions,
  dispatchResults,
  type MailEnvelope,
  type MailProviderClient,
} from 'carapace-mail-runtime';

// Set up the action registry with built-in actions
const registry = new ActionRegistry();
registerBuiltinActions(registry, {
  mailboxPrefixResolver: (env) => `[${env.mailbox_id}] `,
});

// Define rules
const rules = [
  {
    id: "shipping-tracking",
    match: { sender_domain: ["fedex.com", "ups.com"] },
    actions: [{ name: "detect_tracking" }],
    continue: true,
  },
  {
    id: "notify-all",
    actions: ["notify_email"],
  },
];

// Process an email
const [matched, results] = await executeRules(
  envelope, rules, registry, providerClient,
  { workspace: "/tmp/mail", logger: console.log },
);

// Dispatch results
dispatchResults(results, {
  logger: console.log,
  handlers: {
    message: (payload) => sendNotification(payload.message),
  },
});

Writing an Action Plugin

Any ESM module exporting a register function can be loaded as an action:

import type { ActionPlugin, ActionRegistry } from 'carapace-mail-runtime';

export const register: ActionPlugin['register'] = (registry) => {
  registry.register('my_action', async (ctx, params) => {
    const body = await ctx.provider_client.fetchBody(ctx.envelope);
    return [{ kind: 'message', payload: { text: `Got: ${ctx.envelope.subject}` } }];
  }, { needs_body: true });
};

Built-in Actions

| Action | Description | |--------|-------------| | notify_email | Formats envelope into a notification message with calendar response detection |

Note: detect_tracking is available as an external ActionPlugin from carapace-package-tracking.

Rule Match Conditions

| Condition | Description | |-----------|-------------| | sender_email | Exact email match | | sender_domain | Domain match (includes subdomains) | | sender_name_contains | Substring match on display name | | subject | Exact subject match | | subject_contains | Substring match on subject | | subject_prefix | Subject starts with | | subject_regex | Regex match on subject | | body_contains | Substring match on body | | has_attachments | Boolean presence check | | dkim_pass | Require DKIM pass | | spf_pass | Require SPF pass | | dmarc_pass | Require DMARC pass |

License

MIT