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

@reaatech/agent-handoff-validation

v0.1.0

Published

Payload validation (zod or manual) for the Agent Handoff Protocol

Downloads

120

Readme

@reaatech/agent-handoff-validation

npm version License: MIT CI

Status: Pre-1.0 — APIs may change in minor versions. Pin to a specific version in production.

Payload validation and agent compatibility checking for the Agent Handoff Protocol. Works with or without Zod — lazily loads Zod schemas if available, falls back to manual validation otherwise.

Installation

npm install @reaatech/agent-handoff-validation
# or
pnpm add @reaatech/agent-handoff-validation

With Zod (optional, for stricter validation):

npm install @reaatech/agent-handoff-validation zod

Feature Overview

  • Schema validation — validates HandoffPayload structure against the protocol shape
  • Agent compatibility — checks language support, capacity, availability, and history size
  • Zod support (optional) — complete Zod schemas for HandoffPayload and AgentCapabilities; lazily loaded
  • Manual fallback — identical validation without Zod — no peer dependency required
  • Rejection classification — categorizes failures into 6 typed reasons: capability_mismatch, overloaded, invalid_payload, timeout, unavailable, unknown

Quick Start

import { HandoffValidator } from '@reaatech/agent-handoff-validation';

const validator = new HandoffValidator();

const result = await validator.validatePayload(payload, agentCapabilities);

if (!result.isValid) {
  console.error('Validation errors:', result.errors);
}

Exports

HandoffValidator

new HandoffValidator()

| Method | Description | |---|---| | validatePayload(payload, agent) | Full validation: schema structure + compatibility checks |

Returns { isValid: boolean; errors: string[] }. Validates: payload schema (zod or manual), language compatibility, agent capacity, availability status, and conversation history size.

Manual Validation (no Zod required)

| Export | Description | |---|---| | validatePayloadManual(payload, agent?) | Schema-only validation of HandoffPayload structure | | validateAgentCapabilitiesManual(capabilities) | Validate an AgentCapabilities object standalone | | validateCompatibilityManual(payload, agent) | Compatibility checks: language, load, availability |

Rejection Classification

| Export | Description | |---|---| | classifyRejectionReason(message, statusCode?) | Map HTTP responses and error messages to a RejectionReason | | RejectionReason | Type: 'capability_mismatch' \| 'overloaded' \| 'invalid_payload' \| 'timeout' \| 'unavailable' \| 'unknown' |

Zod Integration (optional)

| Export | Description | |---|---| | createZodValidator() | Returns a validator function using Zod schemas (requires zod installed) |

The Zod schemas are lazily loaded: HandoffValidator tries import('zod') on construction. If Zod is available, validation uses the full schema with detailed error messages. If not, it falls back to manual validation — identical API, identical behavior.

Related Packages

License

MIT