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/treasury-service-agent

v0.0.0-alpha.4

Published

Intent-native DeFi Treasury Agent (spec 284): a domain composition over service-agent — skill catalog + profiles + treasury authority-scope/receipt helpers, evolving toward intent resolution, solver brokering, and DAG execution. Catalog = definitions + pl

Downloads

80

Readme

@agenticprimitives/treasury-service-agent

Status: experimental (spec 284 PR-A — relocated from packages/treasury).

The intent-native DeFi Treasury Agent: an intent compiler + DeFi skill fabric + solver broker + settlement coordinator (see spec 284). A domain composition over @agenticprimitives/service-agent, not a generic packages/* primitive.

PR-A ships the catalog/profiles baseline — the wallet-operation surface as vendor-neutral skill definitions, plans, and profiles (this is the payments profile of the larger agent). Intent resolution, solver brokering, DAG execution, autonomous strategies, and risk land in later phases. Catalog = definitions + plans only — no provider implementations. Concrete providers (EVM transfer/sign, swap/perp/prediction venues, market data, RPC) live in external repos (ADR-0037) and register into the host; the demo apps ship fakes.

What's inside

  • TREASURY_CAPABILITIES — the logical capability vocabulary skills require (account.read, transfer.execute, signing.sign, swap.execute, …).
  • Catalog — ~26 skills across service / network / account / market-data / signing / transaction / transfer / swap / perp / prediction / delegation / entitlement. Each declares an effect (read|sign|spend|trade|admin), a default exposure, required capabilities, and a compile() → plan.
  • Profilesreadonly, payments, markets, administration, full.
  • TreasuryAuthorityScope + treasuryScopeToCaveatTerms — the neutral input to the connect-treasury ceremony; the ceremony maps the abstract caveat terms onto real delegation caveats.
  • summarizeTreasuryReceipt — projects the generic ExecutionReceipt into a treasury audit summary.

Gating

| skill kind | exposure | gates | | --- | --- | --- | | service / network / market-data | public | none | | account / quote / positions / simulate / entitlement.check | authenticated | entitlement | | transfer / swap.execute / perp / prediction.bet | authenticated | entitlement ∩ delegation ∩ policy (+ ledger reserve/finalize) | | signing / transaction.send / delegation.* / entitlement.issue/consume | private | entitlement ∩ delegation ∩ policy |

Gates are fail-closed and monotonic — the first denial throws and nothing further runs. Asserting a skill proves the host can run it; per-call authority is still decided fresh at invoke.

Example

import { ServiceAgent, createPrimitiveRegistry } from '@agenticprimitives/service-agent';
import { paymentsProfile, ASSET_TYPE } from '@agenticprimitives/treasury';

const registry = createPrimitiveRegistry();
registry.register(myTransferProvider);  // advertises 'transfer.execute' (external / fake)
// …register account/network/market-data providers…

const agent = new ServiceAgent({
  descriptor: { id: treasurySaAddress, name: 'Treasury', version: '1.0.0' },
  primitives: registry,
  entitlements, delegations, policies, ledger,   // injected: tool-policy / delegation / entitlements / ledger
});
agent.defineProfile(paymentsProfile);
await agent.assert();   // asserts the skills whose providers are present

const receipt = await agent.invoke({
  skillId: 'treasury.transfer.native',
  input: { account: treasurySaAddress, network: 'eip155:84532', to, asset: { type: ASSET_TYPE.native }, amount: '100' },
  idempotencyKey: 'transfer-0001',
});

What lives elsewhere

  • The framework (registry, plan runner, ServiceAgent, assertion) → @agenticprimitives/service-agent.
  • Providers → external repos (ADR-0037); fakes → the demo apps (PR3) + this package's tests.
  • The connect-treasury ceremony + a treasury UI → demo-sso-next / demo-web-payment (PR4).