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

@cogineai/mafs-browser

v0.1.0-alpha.0

Published

A Unified Virtual Filesystem For AI Agents

Readme

@cogineai/mafs-browser

npm version License

Browser / edge-runtime bundle for MAFS — A Unified Virtual File System for AI Agents.

This is the package to use in browser SPAs, Cloudflare Workers, Vercel Edge Functions, Deno Deploy, and other non-Node JavaScript runtimes. It re-exports everything from @cogineai/mafs-core and adds:

  • OPFS-backed durable storage (OPFSResource) for in-browser persistence using the Origin Private File System.
  • Browser-friendly cloud storage through pre-signed URLs and Workers Driver patterns: S3Resource, R2Resource, GCSResource, OCIResource, SupabaseResource (use S3BrowserPresignedUrlProvider instead of long-lived credentials).
  • HTTP transports for SaaS APIs: Slack, Discord, Trello, Linear, Notion, Langfuse, GitHub, GitHub CI, GDocs/GSheets/GSlides/GDrive, Dropbox, Box, Gmail.
  • Database resources via HTTP drivers: PostgresResource (Neon Pg driver), MongoDBResource (HttpMongoDriver), VercelResource, PostHogResource, SSCholarPaperResource, SSCholarAuthorResource.

No native bindings, no FUSE, no fs — entirely portable. ~Zero Node-specific code paths in the bundle that ships to your users.

Install

npm install @cogineai/mafs-browser

Bundlers (Vite, Webpack, Rollup, esbuild, …) will pick the browser ESM entry automatically.

Quick start — in-memory agent sandbox

import { MountMode, RAMResource, Workspace } from '@cogineai/mafs-browser'

const ws = new Workspace({ '/': new RAMResource() }, { mode: MountMode.WRITE })

await ws.fs.writeFile('/notes.md', '# scratchpad\n')
await ws.execute('echo "- bullet" >> /notes.md')
const notes = await ws.fs.readFileText('/notes.md')
console.log(notes)

await ws.close()

Quick start — durable in-browser storage with OPFS

import { MountMode, OPFSResource, Workspace } from '@cogineai/mafs-browser'

const ws = new Workspace({ '/': await OPFSResource.create() }, { mode: MountMode.WRITE })

// Files written here survive page reloads.
await ws.fs.writeFile('/state.json', JSON.stringify({ ok: true }))

await ws.close()

Quick start — read-only S3 via presigned URLs

In a browser you should never ship long-lived AWS credentials. Use a presigned-URL provider that fetches short-lived URLs from your backend:

import {
  MountMode,
  S3Resource,
  type S3BrowserPresignedUrlProvider,
  Workspace,
} from '@cogineai/mafs-browser'

const presigned: S3BrowserPresignedUrlProvider = {
  async sign({ key, operation }) {
    const res = await fetch('/api/s3/presign', {
      method: 'POST',
      body: JSON.stringify({ key, operation }),
    })
    return (await res.json()).url
  },
}

const ws = new Workspace(
  {
    '/s3': new S3Resource({
      bucket: 'public-reports',
      browser: { presigned },
    }),
  },
  { mode: MountMode.READ },
)

const lines = await ws.execute('grep alert /s3/2026/05/report.csv | wc -l')
console.log(lines.stdoutText)

What's exported beyond mafs-core

The full list lives in packages/mafs/typescript/packages/browser/src/index.ts. Notable additions:

  • OPFSResource, OPFSAccessor, OPFS_OPS, OPFS_COMMANDS, OPFS_PROMPT
  • S3Resource with S3_BROWSER_PROMPT and S3BrowserPresignedUrlProvider
  • R2Resource, R2_BROWSER_PROMPT, plus the r2ToS3Config(), ociToS3Config(), gcsToS3Config(), supabaseToS3Config() adapters that let you route alternate S3-compatible providers through one resource implementation
  • PostgresResource + NeonPgDriver (HTTP-only Postgres driver — works in Workers / Edge)
  • MongoDBResource + HttpMongoDriver
  • SSCholarPaperResource + HttpSSCholarDriver
  • VercelResource + HttpVercelDriver
  • PostHogResource + HttpPostHogDriver
  • NotionResource (browser-friendly MCP transport)
  • All HTTP-only SaaS resources (Slack, Discord, Trello, Linear, Langfuse, GitHub, …)

What's not here (and lives in @cogineai/mafs-node instead):

  • DiskResource, FUSE, native shell exec, native RedisResource/RedisStore, IMAP/SMTP EmailResource, local audio (sherpa-onnx-node), node-postgres-backed Postgres.

Companion packages

License & attribution

Apache-2.0. MAFS is a fork of Mirage; see the project-level NOTICE for attribution and the relationship to upstream.