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

@qmilab/lodestar-adapter-filesystem

v0.5.0

Published

Filesystem adapter for the Lodestar Action Kernel: governed reads and root-confined writes. Part of Lodestar, the trust layer for AI agents.

Readme

@qmilab/lodestar-adapter-filesystem

Filesystem adapter for the Lodestar Action Kernel: governed reads and writes confined to an operator-fixed root. Part of Lodestar — the trust layer for AI agents.

Registers the fs.read@1 tool: a sandbox-respecting file read with a declared input schema, a Zod-validated output schema, and an observation emitter for the epistemic chain.

It also registers fs.write@1: a governed write (trust L3, write-local, compensable) hard-confined under a writableRoot — no ../absolute/symlink escape, no host-env expansion (~/$VAR are literal), oversized contents rejected rather than truncated, missing parents created only via explicit createDirs, and an output that records created/previous_bytes for the audit trail.

It also registers doc.read: the same sandbox-respecting read, but it emits a documentation.source@1 observation tagged with a kind (package_json | markdown | source) so the cognitive core's DocumentationExtractor can read into the file content and extract documentation claims. Used by examples/documentation-agent/.

Install

npm install @qmilab/lodestar-adapter-filesystem
# or
bun add @qmilab/lodestar-adapter-filesystem

Usage

import { registerFsReadTool } from "@qmilab/lodestar-adapter-filesystem"
import { ActionKernel } from "@qmilab/lodestar-action-kernel"

// projectRoot is required — every fs.read input path is resolved
// relative to it, and reads outside that root are rejected.
registerFsReadTool(process.cwd())

const kernel = new ActionKernel(policyGate, preconditionChecker, observationSink)
const action = kernel.propose({
  intent: "read project file",
  tool: "fs.read",
  inputs: { path: "README.md" },
  contract: { /* ... */ },
  proposed_by: "agent-1",
})
const arbitrated = await kernel.arbitrate(action)
if (arbitrated.phase === "approved") {
  const executed = await kernel.execute(arbitrated)
}

What it provides

  • makeFsReadTool(projectRoot) — constructs the Tool object without registering it.
  • registerFsReadTool(projectRoot) — convenience that registers it under the name fs.read with output_schema_key: "fs.read@1".
  • FsReadOutputSchema — Zod schema for the tool's output, registered against fs.read@1 in @qmilab/lodestar-core's schema registry.
  • makeDocReadTool(projectRoot) / registerDocReadTool(projectRoot) — the doc.read tool, plus DocumentationSourceOutputSchema registered against documentation.source@1.
  • makeFsWriteTool(options) / registerFsWriteTool(options) — the fs.write tool ({ writableRoot, maxBytes?, createDirs? }), plus FsWriteOutputSchema registered against fs.write@1.

Invariants

  • Path confinement. Every path resolves against a root fixed at construction; .., absolute-path, and symlink escapes are refused (a write destination that is itself a symlink is refused, not followed). No host-env expansion — ~/$VAR are literal.
  • Reads are read-only; writes are explicit. fs.read/doc.read claim only fs.read at L0. fs.write claims fs.write at L3 with a declared world_state_change effect, rejects contents over its byte cap (never truncates), and creates missing parents only when the operator opted in via createDirs. A policy gate can refuse the contract before execution based on the requested path.
  • Honest observations. The Observation emitted carries the resolved path, file size, and a content hash — enough for downstream cognition to extract claims from.

License

Apache 2.0.