{"_id":"@cogineai/mafs-node","name":"@cogineai/mafs-node","dist-tags":{"alpha":"0.1.0-alpha.0","latest":"0.1.0-alpha.0"},"versions":{"0.1.0-alpha.0":{"name":"@cogineai/mafs-node","version":"0.1.0-alpha.0","description":"A Unified Virtual Filesystem For AI Agents","keywords":["bash","fuse","typescript","vfs","ai-agents","agent-sandbox","langchain","virtual-filesystem","llm-agents","agent-tools","claude-code","openai-agents"],"homepage":"https://github.com/cogine-ai/CogineX-mono#readme","bugs":{"url":"https://github.com/cogine-ai/CogineX-mono/issues"},"repository":{"type":"git","url":"git+https://github.com/cogine-ai/CogineX-mono.git","directory":"packages/mafs/typescript/packages/node"},"license":"Apache-2.0","author":{"name":"lc708","email":"kiedis@foxmail.com"},"publishConfig":{"access":"public"},"type":"module","main":"./dist/index.js","types":"./dist/index.d.ts","exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js"}},"dependencies":{"fs-monkey":"^1.1.0","imapflow":"^1.0.0","mailparser":"^3.6.0","mongodb":"^6.10.0","music-metadata":"^11.12.3","nodemailer":"^8.0.0","pg":"^8.13.0","redis":"^5.0.0","ssh2":"^1.16.0","tree-sitter-bash":"^0.25.1","wavefile":"^11.0.0","web-tree-sitter":"^0.26.8","@cogineai/mafs-core":"0.1.0-alpha.0"},"peerDependencies":{"@zkochan/fuse-native":"^0.1.0","sherpa-onnx-node":"^1.12.0"},"peerDependenciesMeta":{"@zkochan/fuse-native":{"optional":true},"sherpa-onnx-node":{"optional":true}},"devDependencies":{"@aws-sdk/client-s3":"^3.0.0","@types/mailparser":"^3.4.6","@types/nodemailer":"^8.0.0","@types/pg":"^8.11.0","@types/ssh2":"^1.15.0","imapflow":"^1.3.2","mailparser":"^3.9.8","mongodb":"^6.10.0","nodemailer":"^8.0.7","pg":"^8.13.0","redis":"^5.0.0","ssh2":"^1.16.0","tsup":"^8.5.0","typescript":"^6.0.0","vitest":"^3.0.0"},"scripts":{"build":"tsup","test":"vitest run","typecheck":"tsc --noEmit"},"_id":"@cogineai/mafs-node@0.1.0-alpha.0","_integrity":"sha512-XSKNxocLeogLcVrTJbTX8Fz9N54v0QLhtS8tqoAy7uViCY6V0x80RcNZHD5Crvo491vxhEVkaWJFA79Ym824Xg==","_resolved":"/private/var/folders/w3/1jnv2n65319gjrn7xmghv87m0000gn/T/a1919562aab0f0a16048b97b208a4af1/cogineai-mafs-node-0.1.0-alpha.0.tgz","_from":"file:cogineai-mafs-node-0.1.0-alpha.0.tgz","_nodeVersion":"22.16.0","_npmVersion":"10.9.2","dist":{"integrity":"sha512-XSKNxocLeogLcVrTJbTX8Fz9N54v0QLhtS8tqoAy7uViCY6V0x80RcNZHD5Crvo491vxhEVkaWJFA79Ym824Xg==","shasum":"bc7602740f0ced241849575c311cb9c5a612ab4d","tarball":"https://registry.npmjs.org/@cogineai/mafs-node/-/mafs-node-0.1.0-alpha.0.tgz","fileCount":191,"unpackedSize":2961311,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEYCIQDE20IBrqdk3wCQZpq8sw4EncS6hi7vel8HjB1OEYXUdgIhAJaHciWA3I6eTIK61L0JeG57nNjxjUELrIysM792LWxQ"}]},"_npmUser":{"name":"lc708","email":"kiedis@foxmail.com"},"directories":{},"maintainers":[{"name":"lc708","email":"kiedis@foxmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/mafs-node_0.1.0-alpha.0_1779464751814_0.24682782415315252"},"_hasShrinkwrap":false}},"time":{"created":"2026-05-22T15:45:51.574Z","0.1.0-alpha.0":"2026-05-22T15:45:52.014Z","modified":"2026-05-22T15:45:52.352Z"},"maintainers":[{"name":"lc708","email":"kiedis@foxmail.com"}],"description":"A Unified Virtual Filesystem For AI Agents","homepage":"https://github.com/cogine-ai/CogineX-mono#readme","keywords":["bash","fuse","typescript","vfs","ai-agents","agent-sandbox","langchain","virtual-filesystem","llm-agents","agent-tools","claude-code","openai-agents"],"repository":{"type":"git","url":"git+https://github.com/cogine-ai/CogineX-mono.git","directory":"packages/mafs/typescript/packages/node"},"author":{"name":"lc708","email":"kiedis@foxmail.com"},"bugs":{"url":"https://github.com/cogine-ai/CogineX-mono/issues"},"license":"Apache-2.0","readme":"# @cogineai/mafs-node\n\n[![npm version](https://img.shields.io/npm/v/%40cogineai%2Fmafs-node.svg)](https://www.npmjs.com/package/@cogineai/mafs-node)\n[![License](https://img.shields.io/npm/l/%40cogineai%2Fmafs-node.svg)](https://github.com/cogine-ai/CogineX-mono/blob/main/packages/mafs/LICENSE)\n\nNode.js bundle for **MAFS — A Unified Virtual File System for AI Agents**.\n\nThis is the package most server-side and CLI consumers want. It re-exports everything from [`@cogineai/mafs-core`](../core) and layers on Node-specific pieces:\n\n- **Disk-backed resources**: `DiskResource`, FUSE mounts via `MafsFS`, native `nativeExec` shell helpers.\n- **Cloud storage with native SDKs**: `S3Resource`, `R2Resource`, `GCSResource`, `OCIResource`, `SupabaseResource`.\n- **Database resources**: `PostgresResource` (with `node-postgres` driver), `MongoDBResource`.\n- **HTTP-only resources** (re-exported, identical to browser): Slack, Discord, Linear, Trello, Langfuse, GitHub, GitHub CI, GDocs/GSheets/GSlides/GDrive, Dropbox, Box, Gmail, Email (IMAP/SMTP).\n- **Redis-backed cache**: `RedisFileCacheStore`, `RedisIndexCacheStore`, `RedisStore`.\n- **Local audio**: `LOCAL_AUDIO_COMMANDS` powered by an optional `sherpa-onnx-node` peer.\n\n## Install\n\n```bash\nnpm install @cogineai/mafs-node\n```\n\nOptional peers — only required if you use the matching feature:\n\n| Peer                   | Used by                                            |\n| ---------------------- | -------------------------------------------------- |\n| `@zkochan/fuse-native` | FUSE mounts (`MafsFS`, `fuseMount`, `FuseManager`) |\n| `sherpa-onnx-node`     | Local audio transcription (`localAudioTranscribe`) |\n\nThe Workspace itself works fine without these peers; importing the corresponding modules without the peer installed surfaces a clear `loadOptionalPeer` error at first use.\n\nRequires Node.js ≥ 20. macOS or Linux for FUSE; Windows is supported for the rest.\n\n## Quick start — S3 + RAM, with cache\n\n```ts\nimport { MountMode, RAMResource, S3Resource, Workspace } from '@cogineai/mafs-node'\n\nconst ws = new Workspace(\n  {\n    '/data': new RAMResource(),\n    '/s3': new S3Resource({\n      bucket: 'logs',\n      region: 'us-west-2',\n      credentials: { accessKeyId: '…', secretAccessKey: '…' },\n    }),\n  },\n  { mode: MountMode.WRITE },\n)\n\n// First call streams from S3 and populates the file cache.\nawait ws.execute('cp /s3/2026/05/22/error.log /data/error.log')\n\n// Subsequent reads of the same key serve from the cache.\nconst lines = await ws.execute('grep \"504 Gateway\" /s3/2026/05/22/error.log | wc -l')\nconsole.log(lines.stdoutText)\n\nawait ws.close()\n```\n\n## Quick start — FUSE-mount a workspace as a real filesystem\n\n```ts\nimport { fuseMount, RAMResource, Workspace } from '@cogineai/mafs-node'\n\nconst ws = new Workspace({ '/': new RAMResource() })\nawait ws.fs.writeFile('/hello.txt', 'mounted via FUSE!\\n')\n\nconst handle = await fuseMount(ws, '/tmp/my-mafs-mnt')\n// `cat /tmp/my-mafs-mnt/hello.txt` from another shell now works.\n\n// Later:\nawait handle.unmount()\nawait ws.close()\n```\n\n## Quick start — Redis cache for shared workers\n\n```ts\nimport {\n  RedisFileCacheStore,\n  RedisIndexCacheStore,\n  S3Resource,\n  Workspace,\n} from '@cogineai/mafs-node'\n\nconst ws = new Workspace(\n  { '/s3': new S3Resource({ bucket: 'my-bucket' }) },\n  {\n    cache: new RedisFileCacheStore({ url: 'redis://localhost:6379/0', limit: '8GB' }),\n    index: new RedisIndexCacheStore({ url: 'redis://localhost:6379/0', ttl: 600 }),\n  },\n)\n```\n\n## What's exported beyond `mafs-core`\n\nThe full list lives in [`packages/mafs/typescript/packages/node/src/index.ts`](https://github.com/cogine-ai/CogineX-mono/blob/main/packages/mafs/typescript/packages/node/src/index.ts). Highlights:\n\n- `DiskResource`, `DiskStore`, `DISK_OPS`\n- `RedisResource`, `RedisStore`, `RedisAccessor`, `REDIS_OPS`\n- `RedisFileCacheStore`, `RedisIndexCacheStore`\n- `MafsFS`, `FuseManager`, `fuseMount`, `fuseMountBackground`\n- `nativeExec`, `nativeExecStream`, `NativeProcess`\n- `S3Resource`, `R2Resource`, `GCSResource`, `OCIResource`, `SupabaseResource`\n- `PostgresResource`, `PostgresStore`\n- `MongoDBResource`, `MongoDBStore`\n- `SSCholarPaperResource`, `SSCholarAuthorResource`, `VercelResource`, `PostHogResource`\n- `SlackResource`, `DiscordResource`, `TrelloResource`, `LinearResource`, `LangfuseResource`, `GitHubResource`, `GitHubCIResource`\n- `GDocsResource`, `GSheetsResource`, `GSlidesResource`, `GDriveResource`, `DropboxResource`, `BoxResource`\n- `GmailResource`, `EmailResource`\n- `patchNodeFs` for transparently routing Node `fs.*` reads through a Workspace\n- `LOCAL_AUDIO_COMMANDS` (optional `sherpa-onnx-node`)\n\nEvery Workspace primitive (`Workspace`, `MountMode`, `FileStat`, …) is also re-exported from `@cogineai/mafs-core`.\n\n## Companion packages\n\n- [`@cogineai/mafs-cli`](../cli) — `coginex` + `mafs` binaries.\n- [`@cogineai/mafs-core`](../core) — runtime-agnostic primitives.\n- [`@cogineai/mafs-browser`](../browser) — browser/edge bundle.\n- [`@cogineai/mafs-server`](../server) — `mafs-daemon` HTTP server.\n- [`@cogineai/mafs-agents`](../agents) — agent framework adapters.\n\n## License & attribution\n\nApache-2.0. MAFS is a fork of [Mirage](https://github.com/strukto-ai/mirage); see the project-level [`NOTICE`](https://github.com/cogine-ai/CogineX-mono/blob/main/packages/mafs/NOTICE) for attribution and the relationship to upstream.\n","readmeFilename":"README.md","_rev":"1-c2c213aa6e6c774550864784d17f021e"}