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

@cef-ai/agent-sdk

v0.1.0

Published

Author agents for the Cere Execution Fabric: a small surface of decorators and types that maps directly to the runtime contract.

Readme

@cef-ai/agent-sdk

Author agents for the Cere Execution Fabric: a small surface of decorators and types that maps directly to the runtime contract.

Install

pnpm add @cef-ai/agent-sdk

For tests, also install the harness:

pnpm add -D @cef-ai/testing

Quickstart

An agent is a default-exported class with decorated methods. @OnEvent binds an event type to a handler; @OnStart and @OnClose are lifecycle hooks. Context is the single object the runtime threads through every call.

import {
  OnClose,
  OnEvent,
  OnStart,
  type Context,
  type Event,
  type OnCloseReason,
} from "@cef-ai/agent-sdk";

interface UserMessage {
  text: string;
}

export default class Echo {
  @OnStart
  async onStart(ctx: Context) {
    ctx.log.info("started");
  }

  @OnEvent("user_message")
  async onMessage(event: Event<UserMessage>, ctx: Context) {
    await ctx
      .cubby("history")
      .exec("INSERT INTO messages(text, ts) VALUES (?, ?)", [
        event.payload.text,
        event.ts,
      ]);
    await ctx.publish("ack", { for: event.id });
  }

  @OnClose
  async onClose(ctx: Context, reason: OnCloseReason) {
    ctx.log.info("closing", { reason });
  }
}

Pair the class with a cef.config.ts:

import { defineAgent } from "@cef-ai/agent-sdk/config";

export default defineAgent({
  id: "echo",
  version: "1.0.0",
  entry: "./agent.ts",
  cubbies: [{ alias: "history", migrations: "./migrations/history" }],
});

API summary

| Kind | Symbol | Notes | | --- | --- | --- | | Decorator | @OnEvent(type) | Bind an event type (string literal) to a handler. | | Decorator | @OnStart | Mark the start lifecycle hook. | | Decorator | @OnClose | Mark the close lifecycle hook. | | Type | Context | Per-instance ctx — cubby, models, fetch, publish, settings, close, log. | | Type | Event<P> | { id, type, ts, from, payload: P }. | | Type | CubbyHandle | query(sql, params) / exec(sql, params) over per-alias storage. | | Type | ModelHandle<I,O> | infer(input) / stream(input) per declared model alias. | | Type | Logger | Leveled structured log: info / warn / error / debug. | | Type | OnCloseReason | "revoked" \| "idle_timeout" \| "closed_by_agent" \| "failed". | | Type | FetchInit | Subset of RequestInit accepted by ctx.fetch. | | Interface | KnownEventTypes | Declaration-merged event-type map populated by typegen. | | Function | defineAgent(config) | Identity helper that preserves literal types of AgentConfig. | | Type | AgentConfig | Top-level config: id, version, entry, cubbies, models, settings, fetch, publishes, lifecycle. |

Subpath exports

| Specifier | Purpose | | --- | --- | | @cef-ai/agent-sdk | Decorators, Context, Event, KnownEventTypes, Logger, ModelHandle, CubbyHandle, FetchInit, OnCloseReason. | | @cef-ai/agent-sdk/config | defineAgent and the AgentConfig shape — used in cef.config.ts. |

For testing, use @cef-ai/testing directly — import { testAgent } from "@cef-ai/testing".

Companion packages

  • @cef-ai/clicef build (esbuild + manifest), cef typegen (populates KnownEventTypes), cef inspect.
  • @cef-ai/testing — simulator harness for unit and integration tests.
  • @cef-ai/eslint-plugin — editor-time lints mirroring the build-time checks.

References

  • Agent SDK spec: ../../../company-memory-bank/specs/platform/03-components/agent-sdk.md
  • Runtime integration contract: ../../../company-memory-bank/specs/platform/03-components/sdk-runtime-integration-contract.md
  • Implementation plan: ../../../company-memory-bank/plans/2026-04-27-sdk-implementation-plan.md

The ../company-memory-bank/... paths are local references to an internal sibling repo and are not browsable from a fresh clone.