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

@humanlayer/agentlayer-yjs-fs-justbash

v0.0.81

Published

A `bash` tool for AgentLayer agents that executes commands against a [`YjsFilesystem`](../yjs-fs) instead of the real OS filesystem, using [`just-bash`](https://github.com/vercel-labs/just-bash) as the shell interpreter. Every file read/write/mkdir/rm/cp/

Readme

@humanlayer/agentlayer-yjs-fs-justbash

A bash tool for AgentLayer agents that executes commands against a YjsFilesystem instead of the real OS filesystem, using just-bash as the shell interpreter. Every file read/write/mkdir/rm/cp/mv the shell performs goes through the CRDT-backed yjs-fs, so bash commands run by an agent participate in the same collaborative document as other AgentLayer filesystem tools.

Install

bun add @humanlayer/agentlayer-yjs-fs-justbash @humanlayer/yjs-fs just-bash

@humanlayer/yjs-fs and just-bash are peer dependencies.

Usage

import { YjsFilesystem } from '@humanlayer/yjs-fs'
import { createYjsFsBashTool, createYjsFsBashPresenceHooks } from '@humanlayer/agentlayer-yjs-fs-justbash'
import { Agent } from '@humanlayer/agentlayer-core'

const fs = new YjsFilesystem()
const bash = createYjsFsBashTool(fs, { cwd: '/' })

const agent = new Agent({
  model,
  tools: { bash },
  hooks: { postToolUse: createYjsFsBashPresenceHooks(fs) },
})

The tool's execute returns { output, operations }: output is the truncated Exit code: N\n<stdout>[\nSTDERR: ...] string sent back to the model, and operations is the list of filesystem operations (read/write/append/list/mkdir/delete/copy/move) the command performed, recorded for the presence hook.

Key exports

  • createYjsFsBashTool(fs, opts?) (./tools) — builds the bash defineTool (name 'bash', input: bashInput, description BASH_DESCRIPTION from agentlayer-core/prompts). opts.bashOptions is passed through to just-bash's Bash constructor (minus fs/cwd, which are fixed to the adapter and opts.cwd).
  • createYjsFsBashPresenceHooks(fs, opts?) (./hooks) — a postToolUse hook (matches BashTool) that updates yjs awareness/presence (currentFile, action, bashOperation(s)) after each bash call and sets a fading text selection (opts.selectionFadeMs, default 5000ms) on the most-recently-touched file. No-ops silently if the doc has no awareness.
  • YjsFsBashAdapter (./src/adapter.ts) — implements just-bash's IFileSystem on top of a YjsFilesystem. Tracks every operation performed since the last consumeOperations() call; unsupported ops (chmod, symlink, link, readlink) throw ENOTSUP.
  • YjsFsBashOperation / YjsFsBashOperationType — the recorded-operation shape (type, path, toPath?, pathType?).

How it fits together

flowchart LR
    Agent -->|"bash tool call"| createYjsFsBashTool
    createYjsFsBashTool --> Bash["just-bash Bash.exec"]
    Bash -->|"IFileSystem"| YjsFsBashAdapter
    YjsFsBashAdapter --> YjsFilesystem
    YjsFsBashAdapter -->|"consumeOperations()"| createYjsFsBashPresenceHooks
    createYjsFsBashPresenceHooks -->|"updateLocalPresence / setLocalSelection"| YjsFilesystem

Testing

Uses shared test mocks from ../agentlayer-yjs-fs/test/mocks (makeToolContext, mockModel, etc.). Run with bun run test from the repo root, or bun test from this directory.