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

@agent-tool-platform/runtime

v0.1.2

Published

Shared runtime for hosted agent tool servers: capability definition, tool registry, MCP/HTTP/OpenAPI transports, auth, lifecycle, and safety primitives.

Readme

@agent-tool-platform/runtime

The shared runtime every agent-tool-server-* capability consumes.

This package owns transports, contracts, and safety primitives. It contains no domain behaviour and never will: the moment it learns what an AST, a repository, or an Azure resource is, it stops being a platform.

Version 0.1.0 is publicly available from the primary npm registry.

npm install @agent-tool-platform/runtime

Import surface

The root export carries everything:

import {
  defineAgentToolCapability,
  defineTool,
  startAgentToolApplication,
  startStdioAgentToolApplication,
} from '@agent-tool-platform/runtime';

Starting a capability

| Entry point | Use for | | --------------------------------------------------- | -------------------------------------------------------------------------- | | startAgentToolApplication(capability, options?) | A hosted deployment. Binds the HTTP listener and installs signal handlers. | | startStdioAgentToolApplication(capability, opts?) | A local stdio process launched by an agent host. Binds no listener. | | createAgentToolApplication(capability, options?) | Tests and advanced callers. Assembles the application and starts nothing. |

The stdio helper is the preferred startup mechanism for a local entry point. It owns the whole local lifecycle — silent logger, local execution semantics, capability start hook, MCP server, transport, SIGINT/SIGTERM handling, ordered teardown, and the process exit code — so a capability entry point is only its own environment policy:

import { startStdioAgentToolApplication } from '@agent-tool-platform/runtime';
import capability from './capability.js';

await startStdioAgentToolApplication(capability, {
  env: {
    ...process.env,
    // A capability-specific default. The platform never learns what this variable means.
    CAPABILITY_WORKSPACE_ROOT: process.env.CAPABILITY_WORKSPACE_ROOT?.trim() || process.cwd(),
  },
});

It resolves to { application, server, transport, close }. close() drains the application, runs the capability stop hook, and closes the MCP server, once however often it is called. Signal handlers are released only after all of that has settled, so a signal arriving during a long drain cannot cut teardown short. A startup that fails after the capability has begun starting rolls the application and any half-connected server back before rethrowing the original error.

Because stdio is a local pipe with no network peer, the helper applies local execution semantics over the environment it is given — authentication disabled, non-production NODE_ENV (a test environment is preserved), loopback host — after the caller's own values, so an inherited production environment cannot change how a local process runs. No listener is ever bound, and the default logger is silent because stdout carries protocol traffic. Hosted HTTP semantics are unchanged: disabled authentication is still refused in production there.

Deliberate subpath exports exist for narrower imports:

| Subpath | Contents | | --------------- | ---------------------------------------------------------------------------------------------------------------------------------------- | | /errors | AppError, the twelve error codes, constructors, toAppError, status and retryability mapping. | | /cancellation | Deadline, linkSignals, whenAborted, neverCancelled. | | /auth | Principal, Authenticator, API-key and Entra JWT authenticators, credential strength and fingerprinting. | | /capability | defineAgentToolCapability, createAgentToolApplication, startAgentToolApplication, startStdioAgentToolApplication, ToolInvoker. | | /concurrency | BoundedSemaphore, BoundedQueue. | | /config | PlatformConfig, defineCapabilityConfig, loadCapabilityConfig, env parsing helpers. | | /context | Request-id resolution and bounds. | | /fs | RootBoundary and path containment helpers. | | /http | createHttpServer, FixedWindowRateLimiter, the Fastify adapter. | | /lifecycle | ApplicationLifecycle, ReadinessAggregator, readiness helpers, installShutdownSignalHandlers. | | /limits | Clamping, ceilings, bounded text, lists, and warnings. | | /logging | createLogger, redaction paths, createSilentLogger. | | /mcp | createMcpServer, stdio and Streamable HTTP adapters. | | /metadata | Capability metadata validation. | | /mutations | MutationGate, decideMutation. | | /openapi | buildOpenApiDocument. | | /process | buildChildEnvironment, resolveExecutable, runBoundedProcess. | | /telemetry | The telemetry contract, sinks, and measurement sanitization. | | /tools | ToolDefinition, ToolRegistry, routing grammar and rendering. |

Binary

agent-tool-validate-metadata --server server.json --package package.json [--registry entry.json]

Validates a capability repository's metadata: schema shape, semantic versioning, version agreement between server.json and package.json, truthful package and remote declarations, and the absence of placeholder content.

Documentation

See the repository README for the architecture, the capability contract, and the ownership boundaries between the platform, capabilities, and agent repositories.