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

@agenticprimitives/service-agent

v0.0.0-alpha.4

Published

Generic service-agent capability framework (spec 283): define -> assert -> entitle -> delegate -> primitive-plan -> execute -> receipt. Provider-neutral; all authority evaluators + primitives are injected. Domain catalogs (e.g. @agenticprimitives/treasury

Readme

@agenticprimitives/service-agent

Status: experimental (spec 283 PR1).

A generic framework for building service agents — agents that expose a catalog of capabilities (skills) and execute them under layered authority. It is provider-neutral and Ring-0 pure: it depends only on @agenticprimitives/types and imports no wallet, exchange, RPC, MCP, delegation, or policy code. The concrete providers and authority evaluators are injected by the host.

Domain catalogs — e.g. @agenticprimitives/treasury — are separate packages that supply skill definitions

  • a provider-neutral plan; this package runs the lifecycle.

The lifecycle

define  →  assert  →  entitle / delegate  →  primitive-plan  →  execute  →  receipt
  • define — a SkillDefinition states a skill's meaning: id, version, effect (read|sign|spend|trade|admin), default exposure, the logical capabilities it requires, optional I/O schemas, and a compile() that emits a primitive plan. A definition does NOT claim the host can run it.
  • assertassertSkills resolves each definition's requires against the PrimitiveRegistry. A skill asserts only when every non-optional requirement binds to an installed Primitive whose constraints cover the requirement (monotonic). The result is an AssertionReport (asserted / unavailable / rejected). The optional publishAssertion hook is the seam for public disclosure (spec 282: vault claim → atl:skills → discovery + A2A card).
  • entitle / delegate / guard — the plan's .authorize('entitlement', …), .authorize('delegation', …) and .guard(…) steps call the injected evaluators (mapping to tool-policy/entitlements, delegation, and tool-policy at the host). Every gate must ALLOW; the first denial throws the typed error and nothing further runs (fail-closed).
  • primitive-plan / executerunPlan resolves ref()s, calls registered primitives for .steps (plus built-in ledger.reserve/ledger.finalize), and collects .output.
  • receiptinvoke returns a normalized ExecutionReceipt (authority decisions + primitive bindings
    • outputs); the host sinks/signs it via audit.

Example

import { ServiceAgent, defineSkill, createPrimitiveRegistry, primitivePlan, ref } from '@agenticprimitives/service-agent';

const balance = defineSkill<{ accountId: string }, { balance: string }>({
  id: 'treasury.account.balance', version: '1.0.0', name: 'Read balance',
  effect: 'read', defaultExposure: 'authenticated',
  requires: [{ capability: 'account.balance' }],
  compile: ({ input }) =>
    primitivePlan('plan.balance')
      .step('bal', 'account.balance', { accountId: input.accountId })
      .output({ balance: ref('bal', 'balance') }),
});

const registry = createPrimitiveRegistry();
registry.register(myAccountProvider); // advertises { id: 'account.balance', version, constraints }

const agent = new ServiceAgent({ descriptor: { id: '0x…', name: 'Treasury', version: '1.0.0' }, primitives: registry });
agent.define(balance);
await agent.assert();
const receipt = await agent.invoke({ skillId: 'treasury.account.balance', input: { accountId: 'acct-1' } });

For a spend skill, add .authorize('entitlement', …), .authorize('delegation', …), .guard(…), and the ledger reserve/finalize steps; wire entitlements / delegations / policies / ledger into ServiceAgentOptions. See test/conformance.test.ts for the full lifecycle with fakes.

What lives elsewhere

  • Providers (EVM transfer, swap venue, RPC, KMS signer) — EXTERNAL (ADR-0037); they register as Primitives. Demos ship fakes.
  • Authority logicdelegation, tool-policy, entitlements; injected as evaluators.
  • The treasury catalog@agenticprimitives/treasury. Public disclosure — the app, via publishAssertion (spec 282).