@agent-sh/harness-read
v0.4.0
Published
Read tool for AI agent harnesses — safe, bounded, line-numbered file reading with pluggable I/O, permissions, ledger, and cache
Maintainers
Readme
@agent-sh/harness-read
Safe, bounded, line-numbered file reading with pagination, binary refusal, and fuzzy-sibling NOT_FOUND.
Part of the @agent-sh/harness-* monorepo — see the top-level README for architectural context and the full tool surface.
Install
npm install @agent-sh/harness-readRequires Node ≥ 20.
Usage
import { read } from "@agent-sh/harness-read";
const r = await read(
{ path: "src/index.ts", offset: 1, limit: 200 },
{ cwd: process.cwd(), permissions: { roots: [process.cwd()], sensitivePatterns: [] } },
);
if (r.kind === "text") console.log(r.output);Contract
The full contract — input shape, output discriminated-union, error codes, permission model, and acceptance tests — lives in agent-knowledge/design/read.md. Changes to this package must stay in sync with that spec.
License
MIT © Avi Fenesh
