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

@reactive-agents/tools

v0.10.6

Published

Tool system for Reactive Agents — registry, sandboxed execution, and MCP client

Readme

@reactive-agents/tools

Version: 0.10.3 — tool system for Reactive Agents.

A type-safe tool registry, sandboxed execution (process + Docker), an MCP (Model Context Protocol) client, native + text-parse function-calling drivers, the healing pipeline that recovers malformed tool calls, the Conductor's Suite of meta-tools, and a full RAG pipeline (chunk → load → ingest → search).

Installation

bun add @reactive-agents/tools

What this package provides

  • ToolBuilder — fluent API for declaring tools.
  • defineTool / tool — schema-inferred and minimal tool wrappers.
  • ToolService / makeToolRegistry — Effect service + registry.
  • SandboxesmakeSandbox (in-process) and makeDockerSandbox (rootless Docker with seccomp) for code-execution tools.
  • MCP client — connect over stdio (Bun.spawn) to any MCP server; SSE/WebSocket transports are stubbed.
  • Tool-calling driversNativeFCDriver and TextParseDriver covering all providers.
  • Healing pipeline — 4-stage repair (tool-name → param-name → path → type coercion).
  • Conductor's Suite — meta-tools the kernel uses to run itself: find, recall, brief, pulse, checkpoint, task-complete, final-answer, context-status, discover-tools.
  • Built-in skills — web search, file I/O, HTTP, code execute, docker execute, shell execute, scratchpad, RAG ingest/search, skill activation.
  • Sub-agent adapters — wrap an agent as a tool (createAgentTool), call remote agents (createRemoteAgentTool), or spawn sub-agents at runtime (createSpawnAgentTool / createSpawnAgentsTool).

Quick example

import { ReactiveAgents } from "@reactive-agents/runtime";
import { Effect } from "effect";

// Built-in skills (web search, file I/O, HTTP, code execution, scratchpad) are auto-registered.
const agent = await ReactiveAgents.create()
  .withName("research-agent")
  .withProvider("anthropic")
  .withModel("claude-sonnet-4-20250514")
  .withReasoning()
  .withTools()
  .build();

// Or register custom tools at build time:
const agentWithCustomTools = await ReactiveAgents.create()
  .withName("custom-agent")
  .withProvider("anthropic")
  .withTools({
    tools: [
      {
        definition: {
          name: "lookup",
          description: "Look up a value in the database",
          parameters: [
            { name: "key", type: "string", description: "Lookup key", required: true },
          ],
          riskLevel: "low",
          timeoutMs: 5_000,
          requiresApproval: false,
          source: "function",
        },
        handler: (args) => Effect.succeed(`Value for ${args.key}`),
      },
    ],
  })
  .build();

ToolBuilder

import { ToolBuilder } from "@reactive-agents/tools";

const lookup = ToolBuilder.create("lookup")
  .description("Look up a value in the database")
  .param("key", "string", { description: "Lookup key", required: true })
  .riskLevel("low")
  .timeoutMs(5_000)
  .handler(async (args) => `Value for ${args.key}`)
  .build();

defineTool (schema-inferred) and tool() (minimal wrapper) are also available.

Conductor's Suite (meta-tools)

The kernel uses these meta-tools to run itself; they are auto-registered when reasoning is enabled and can be opted out via withMetaTools(false).

| Meta-tool | Purpose | |---|---| | find | Discover registered tools by intent | | recall | Retrieve past observations + memory hits | | brief | Get a structured task brief (skills, entropy grade) | | pulse | Lightweight progress / entropy snapshot | | checkpoint | Persist intermediate state for resumption | | task-complete | Declare task done (visibility-gated) | | final-answer | Capture the canonical final answer | | context-status | Inspect the current message window / curator state | | discover-tools | Surface tools added at runtime | | activate-skill / get-skill-section | Pull a skill into context on demand | | spawn-agent / spawn-agents | Dynamically dispatch sub-agents (with .withDynamicSubAgents()) |

Built-in capability tools

| Tool | Module | |---|---| | web-search | webSearchTool (Tavily / SerpAPI / custom provider) | | file-read / file-write | fileReadTool / fileWriteTool | | http-get | httpGetTool | | code-execute | codeExecuteTool (in-process JS sandbox) | | docker-execute | dockerExecuteTool (rootless Docker with seccomp) | | shell-execute | shellExecuteTool (allowlist + blocklist; opt-in via .withTerminalTools()) | | scratchpad-read / scratchpad-write | Per-run mutable workspace | | rag-ingest / rag-search | RAG pipeline tools |

Healing pipeline

When a model emits a malformed tool call, the healing pipeline attempts repair before failing:

import { runHealingPipeline } from "@reactive-agents/tools";

const repaired = await runHealingPipeline({
  candidate,            // model-emitted ToolCall
  registry,             // available tools
  observed,             // observed alias frequencies
});

Stages: tool-name fuzzy match → param-name fuzzy match → path resolution → JSON-Schema type coercion. Recovers ~87% of malformed calls in v0.10.x with negligible overhead.

MCP client

Connect to any MCP-compatible tool server over stdio:

import { makeMCPClient } from "@reactive-agents/tools";
import { Effect } from "effect";

const program = Effect.gen(function* () {
  const client = yield* makeMCPClient;

  yield* client.connect({
    name: "filesystem",
    transport: "stdio",
    command: "npx",
    args: ["-y", "@modelcontextprotocol/server-filesystem", "/tmp"],
  });

  const result = yield* client.callTool("filesystem", "read_file", {
    path: "/tmp/example.txt",
  });

  yield* client.disconnect("filesystem");
  return result;
});

Transports: stdio is fully implemented (background reader loop, tracked pending requests, clean teardown). SSE and WebSocket are stubbed.

Sub-agents

Wrap another agent as a callable tool:

import { createAgentTool, createSpawnAgentTool } from "@reactive-agents/tools";

const reviewerTool = createAgentTool({
  name: "code-reviewer",
  description: "Review TypeScript diffs",
  agent: reviewerAgent,
});

createSpawnAgentTool lets the parent agent dynamically dispatch sub-agents at runtime (.withDynamicSubAgents() builder shortcut). Recursion depth and parent-context passthrough are bounded (MAX_RECURSION_DEPTH, MAX_PARENT_CONTEXT_CHARS).

RAG pipeline

import {
  loadMarkdown,
  chunkByMarkdownSections,
  ragIngestTool,
  ragSearchTool,
} from "@reactive-agents/tools";

const docs = await loadMarkdown("./docs/handbook.md");
const chunks = chunkByMarkdownSections(docs, { maxTokens: 800 });
// Pass chunks through ragIngestTool → ragSearchTool, or via runtime `.withDocuments()`.

Caching

ToolResultCache caches deterministic tool results within a run (and optionally across runs):

import { ToolResultCacheLive } from "@reactive-agents/tools";

Documentation

License

MIT