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

@harness-pi/tools

v0.4.0

Published

First-party coding tools for harness-pi agents

Readme

@harness-pi/tools

First-party coding tools (read, bash, edit, write, grep, find, ls) as HarnessTool factories.

This package provides the built-in coding tools used to give an agent access to a workspace: reading and writing files, running shell commands, and searching the filesystem. Each tool is exposed as a factory bound to a working directory, returning a HarnessTool you hand to an agent. It is part of harness-pi, a production harness for pi-ai-based agents.

Install

pnpm add @harness-pi/tools

Requires @harness-pi/core (the agent kernel that consumes these tools).

Quick start

import { AgentSession } from "@harness-pi/core";
import { createCodingTools, createReadOnlyTools } from "@harness-pi/tools";

// All factories are bound to a workspace cwd. They resolve every path
// argument relative to it and refuse to escape it by default.
const cwd = process.cwd();

// Full read/write coding toolset: read, bash, edit, write.
const tools = createCodingTools(cwd);

// Or a sandboxed, read-only set: read, grep, find, ls.
// const tools = createReadOnlyTools(cwd);

// `model` is your pi-ai Model<Api>; see @harness-pi/core for how to obtain one.
const session = new AgentSession({ model, tools });

const result = await session.run("Summarize the files in this directory.");

Both createCodingTools(cwd) and createReadOnlyTools(cwd) return a HarnessTool[], which is exactly the shape AgentSession's tools option expects.

What's inside

Tools (each a factory bound to a cwd, returning a HarnessTool):

  • read (createReadTool) — Read a text file or image; long output is truncated with continuation hints.
  • bash (createBashTool) — Run a shell command; returns stdout/stderr, supports a timeout and a sanitized env.
  • edit (createEditTool) — Replace a unique text range in an existing file.
  • write (createWriteTool) — Write a complete file, creating parent directories as needed.
  • grep (createGrepTool) — Search file contents by regex or literal, honoring .gitignore.
  • find (createFindTool) — Find files by glob pattern, returning workspace-relative paths.
  • ls (createLsTool) — List directory contents, alphabetized with a / suffix for directories.

Presets (each returns a ready-to-use collection):

  • createAllTools — All seven tools as a Record<ToolName, HarnessTool>.
  • createCodingToolsHarnessTool[] of read, bash, edit, write.
  • createReadOnlyToolsHarnessTool[] of read, grep, find, ls.

Concurrency and safety:

  • Concurrency — Read-only tools (read, grep, find, ls) report isConcurrencySafe and may run in parallel; bash is not concurrency-safe.
  • Cancellation — All tools honor the AbortSignal passed by the kernel.
  • bash control — Supports a per-call timeout (seconds; default 120s), a configurable working directory, and a sanitized environment that strips secret-like variables.

License

MIT