Adapter

Filesystem

Overview

The filesystem adapter targets node:fs/promises. Data lives at <root>/<folder>/; snapshots and forks land as sibling folders directly under <root> — not nested inside the data folder.

Primarily for local development and tests where you don’t want to spin up a real provider.

Configuration

import { Storage } from '@storagesdk/core';
import { fs } from '@storagesdk/adapters/fs';

const storage = new Storage({
  adapter: fs({
    root: './.storage',
    folder: 'agent-runs',
  }),
});
fs({
  root: string;     // parent directory under which the folder and siblings live
  folder: string;   // the folder this adapter operates on
});

For the call above, layout on disk:

./.storage/
├── agent-runs/                                  ← this adapter's data
│   ├── hello.txt
│   └── .storagesdk.metadata.json
├── agent-runs-snapshot-1747318800123456789012/  ← a snapshot
└── agent-runs-exp/                              ← a fork named `agent-runs-exp`

Notes

Compatibility

CapabilitySupport
SnapshotsSibling folders under root
ForksSibling folders under root
Byte-range reads
Multipart upload
Enforced upload limitsn/a
User metadata
Signed URLsn/a