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

@sockt/runtime

v0.2.1

Published

The agent execution engine — the Plan → Act → Observe → Reflect loop, an LLM client wrapping Anthropic/OpenAI/Groq/Bedrock/Ollama, a built-in tool registry (`web_search`, `exec_code`, `create_task`, `write_file`/`read_file`, `http_request`), Docker AI San

Readme

@sockt/runtime

The agent execution engine — the Plan → Act → Observe → Reflect loop, an LLM client wrapping Anthropic/OpenAI/Groq/Bedrock/Ollama, a built-in tool registry (web_search, exec_code, create_task, write_file/read_file, http_request), Docker AI Sandbox integration, and the skill-matching system that lets agents draw on prior successful executions.

This is what actually runs when an agent claims a task — everything else in Sockt (orch, fsm, memory) exists to coordinate and bound what happens here.

Install

bun add @sockt/runtime

What's in here

AgentRunner

The execution loop itself. Given an AgentConfig and a claimed Task, runs Plan → Act → Observe → Reflect until the task completes, escalates, or the budget runs out — whichever comes first.

import { AgentRunner, HttpLlmClient, ToolRegistry, registerBuiltInTools } from "@sockt/runtime";

const toolRegistry = new ToolRegistry();
registerBuiltInTools(toolRegistry, { orchUrl: "http://localhost:3100", tenantId: "acme", agentId: "worker-1" });

const runner = new AgentRunner({
  llmClient: new HttpLlmClient({ provider: "anthropic", model: "claude-sonnet-4-6-20250514", apiKey: process.env.MODEL_API_KEY }),
  toolRegistry,
  orchBaseUrl: "http://localhost:3100",
});

const outcome = await runner.executeTask(agentConfig, claimedTask);
// outcome.status: "completed" | "escalated" | "blocked"

HttpLlmClient

Wraps the Vercel AI SDK across providers — anthropic, openai, groq, bedrock, ollama, plus any OpenAI-compatible custom endpoint via baseUrl. Handles retry with backoff (longer backoff specifically for 429 rate limits), a 90s timeout per call, and an optional inter-call throttle (LLM_CALL_DELAY_MS) for free-tier rate limits.

Built-in tools (registerBuiltInTools)

| Tool | What it does | |---|---| | web_search | Brave Search if BRAVE_SEARCH_API_KEY is set, else DuckDuckGo instant answers | | write_file / read_file | I/O against the agent's scratch directory | | http_request | Generic HTTP fetch with a basic SSRF guard | | create_task | Creates a subtask on the orchestrator with parentId set — how architect agents delegate | | exec_code | Runs Python/JS/TS/Bash inside a Docker AI Sandbox microVM if sbx is installed, else an unsandboxed temp dir with a warning |

ToolRegistry

Register custom tools alongside the built-ins. Supports marking specific tools as requiring human approval (requiresApproval) — the runner will pause and call the configured HitlGate before executing them.

SbxSandbox / DockerSandbox

SbxSandbox wraps the Docker AI Sandbox CLI for microVM-isolated code execution (what exec_code uses). DockerSandbox is a lower-level raw-Docker-socket implementation for container lifecycle management outside the sandbox CLI.

SkillCompiler

After a task completes successfully, compiles its execution trace into a reusable .skill file. On future tasks, findRelevant() scores existing skills against the new task's description (Jaccard similarity via scoreRelevance) and injects the best matches as context — this is separate from, and complements, the pre-written department skill indexes described in docs/DEPARTMENTS.md.

ExecutionTrace

Records every Plan/Act/Observe/Reflect step for a task run — what CADVP later tails from the JSONL log and what SkillCompiler compiles from.

HttpOrchClient

The orchestrator API client this package uses internally (claim/complete/escalate/record-llm-call/register-agent) — exported in case you're building a custom worker loop instead of using AgentRunner.

Environment variables

Full reference: docs/CONFIGURATION.md. The ones specific to this package: MODEL_PROVIDER, MODEL_API_KEY, FRONTIER_MODEL, MAX_TOKENS, LLM_CALL_DELAY_MS, PLAN_CONTEXT_MESSAGES, SKILLS_DIR, BRAVE_SEARCH_API_KEY.

Docs

Agent execution loop and tool isolation model: docs/ARCHITECTURE.md#agent-execution-loop

Sandbox security boundaries: SECURITY.md

License

FSL-1.1-MIT — free for non-competing use, converts to MIT two years after each release.