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

@agentdock-ai/contracts

v0.1.0

Published

Framework-independent AgentDock data contracts

Readme

@agentdock-ai/contracts

Framework-independent AgentDock contracts shared by backend runtimes, frontends, and future transport packages.

This package contains JSON-compatible public data types only. It does not depend on LangChain, LangGraph, Node.js runtime APIs, or database adapters.

import type {
  AgentEvent,
  AgentRunResult,
  AgentSessionRecord,
} from "@agentdock-ai/contracts";

Runtime implementation types such as BaseChatModel, BaseCheckpointSaver, tool functions, and LangGraph workflow state remain in the @agentdock-ai/agentdock package.

The event contract provides structured content parts, explicit lifecycle events, generic interrupt records, usage and finish metadata, and reduceAgentEvent() for rebuilding a UI-safe snapshot. The reducer rejects out-of-order events and ignores exact duplicate event IDs so reconnects are deterministic; reusing an ID with different data is rejected. Every event carries the numeric AGENT_EVENT_PROTOCOL_VERSION and consumers must reject unsupported versions.

The lifecycle event names are run.started, message.started, message.part.delta, message.completed, tool.called, tool.progress, tool.completed, tool.failed, interrupt.required, interrupt.resolved, usage.updated, run.completed, run.failed, and run.cancelled. The reducer tracks multiple assistant messages, tool progress/results/errors, the current interrupt, usage, limits, and terminal metadata. A delta requires a started message; tool results require a known tool call; events after a terminal event are rejected.

All public contract values are strict JSON. cloneJsonValue() and cloneJsonObject() reject cycles, undefined, functions, symbols, BigInt, Date, Map, Set, and non-finite numbers.

Normalized Message.content and AgentRunResult.content use the same ContentPart[] contract. Tool calls and tool results are content parts rather than a second message-specific representation. Media parts identify exactly one source: url, base64 data, or fileId.

cloneJsonSchema() accepts a JSON Schema object or boolean. AgentDock’s ordinary model-tool boundary requires an object-root schema; the supported raw subset is documented in the @agentdock-ai/agentdock package.