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

@sovereignclaw/core

v0.2.0

Published

Agent runtime, inference adapter, and tool runtime for SovereignClaw.

Readme

@sovereignclaw/core

Agent runtime for SovereignClaw. Provides the Agent class, the sealed0GInference adapter (TEE-verified chat completions through the 0G Compute Router), pluggable tool/memory/reflection hooks, and typed events for the whole run lifecycle.

Install

pnpm add @sovereignclaw/core @sovereignclaw/memory ethers

10-line quickstart

import { Agent, sealed0GInference } from '@sovereignclaw/core';
import { InMemory } from '@sovereignclaw/memory';

const agent = new Agent({
  role: 'researcher',
  systemPrompt: 'You are a careful researcher.',
  inference: sealed0GInference({
    model: 'qwen/qwen-2.5-7b-instruct',
    apiKey: process.env.COMPUTE_ROUTER_API_KEY!,
    baseUrl: process.env.COMPUTE_ROUTER_BASE_URL!,
    verifiable: true,
  }),
  memory: InMemory({ namespace: 'quickstart' }),
});
const out = await agent.run('What year was the Transformer paper published?');
console.log(out?.text, out?.attestation?.teeVerified);
await agent.close();

API

| Export | Kind | Purpose | | -------------------------- | --------- | ------------------------------------------------------------------------------------------ | | Agent | class | Runtime. Wires inference + memory + tools + reflection; emits events. | | AgentConfig | type | role, systemPrompt, inference, memory?, tools?, reflect?. | | sealed0GInference(opts) | fn | Inference adapter for the 0G Compute Router with verify_tee. | | InferenceAdapter | interface | complete({ messages, options }){ text, attestation, billing }. | | defineTool / executeTool | fn | Small tool DSL with Zod validation, timeout, and typed errors. | | httpRequestTool | tool | Built-in safe-fetch tool for agents that need HTTP. | | listRecentLearnings | fn | Pull the N most recent reflection learnings from a MemoryProvider. | | LEARNING_PREFIX | const | Key prefix used when reflection persists learning records. | | ReflectionConfig | interface | Structural contract for the reflect hook — satisfied by @sovereignclaw/reflection. | | AgentEvents | type map | Typed lifecycle events: agent.start, tool.*, reflect.*, agent.done, agent.error. |

Errors

All extend CoreError:

| Error | When | | --------------------------------------- | --------------------------------------------------------------- | | RouterAuthError | 0G Router 401/403 (bad COMPUTE_ROUTER_API_KEY). | | RouterBalanceError | 0G Router 402 (no compute credits). | | RouterClientError | Router 4xx not covered by auth/balance. | | RouterServerError | Router 5xx. | | InferenceTimeoutError | Request exceeded the configured timeout. | | EmptyInferenceResponseError | Router returned 200 but no choices/content. | | DirectModeUnsupportedError | sealed0GInference called without a provider that supports it. | | ToolValidationError | Tool input failed its Zod schema. | | ToolExecutionError / ToolTimeoutError | Tool implementation threw or hung. | | AgentClosedError | agent.run() after agent.close(). |

Events

Subscribe with agent.on(name, handler):

  • agent.start / agent.done / agent.error
  • inference.start / inference.complete
  • tool.start / tool.complete / tool.error
  • reflect.start / reflect.complete (only fire when a reflect adapter is configured)

Further reading

License

MIT — see the repo root.