v1.4.0
Add Alibaba Cloud Object Storage Service (OSS) adapter (
files-sdk/alibaba). Thin wrapper around the S3 adapter — endpoint derived from the region code (oss-<region>.aliyuncs.com), virtual-hosted-style addressing, errors relabelled as "Alibaba Cloud error". Auto-loads fromALIBABA_ACCESS_KEY_IDandALIBABA_ACCESS_KEY_SECRET.Add
filesCLI for agents and scripts. One binary covers every adapter via--provider <name>with lazy imports — cold-start cost matches whichever single provider you select. EachAdaptermethod maps to a subcommand (upload,download,head,exists,delete,copy,list,url,sign-upload), with JSON-by-default output,stdin/stdoutstreaming for binary bodies,--dry-runand--verbosemodes, and a stable exit-code mapping (NotFound→ 1,Provider→ 2,Unauthorized→ 3,Conflict→ 4). Provider credentials come from each adapter's existing env-var conventions, and--config-jsonis an escape hatch for the long tail of adapter options.files ... mcpboots a stdio MCP server exposing every command as a tool — provider and credentials bind at startup, so the agent only passes operation arguments.Add Cloudinary adapter (
files-sdk/cloudinary). Defaults toresource_type: "raw"for arbitrary-bytes storage; switch toimage/videofor transforms. ReadsCLOUDINARY_URLor individualCLOUDINARY_*env vars. Full Adapter surface including signed delivery URLs forprivate/authenticatedtypes and form-POST signed upload URLs.Add Firebase Storage adapter (
files-sdk/firebase-storage). Wraps the officialfirebase-adminSDK; the underlyinggetStorage().bucket()returns a@google-cloud/storageBucket, so V4 signed read URLs, POST policy uploads withmaxSize, server-side copy, and the full metadata round-trip all work out of the box. Auto-loads credentials fromFIREBASE_PROJECT_ID/FIREBASE_CLIENT_EMAIL/FIREBASE_PRIVATE_KEY/FIREBASE_STORAGE_BUCKET, falling back to a service-account JSON path (GOOGLE_APPLICATION_CREDENTIALS) and then to Application Default Credentials. Accepts an existingApporBucketviaappto share initialization with Firestore/Auth. The bucket name defaults to<projectId>.firebasestorage.appwhen neitherbucketnorFIREBASE_STORAGE_BUCKETis set. Firebase's?alt=media&token=…download-token URL form is out of scope for v1 — reach foradapter.rawif you need it.Add PocketBase adapter (
files-sdk/pocketbase). Wraps the officialpocketbaseJS SDK and maps the unified key/blob API onto a dedicated collection: each upload becomes (or updates) a record whose configurablekeyField(unique-indexed text, default"key") holds the user-facing key and whose configurablefileField(single-value file, default"file") holds the body. Auto-loads fromPOCKETBASE_URLplus eitherPOCKETBASE_ADMIN_EMAIL+POCKETBASE_ADMIN_PASSWORD(admin login on first call) orPOCKETBASE_AUTH_TOKEN(pre-issued token); accepts an existingPocketBaseclient viaclient.url()returnspb.files.getURL(), threading a short-lived file token frompb.files.getToken()for authenticated clients; setpublicBaseUrlfor a CDN override.signedUploadUrl()throws — PocketBase has no presigned upload primitive.copy()is read-then-write (no server-side copy).list()paginates via page number encoded as a numeric cursor string.UploadOptionscacheControlandmetadatathrow — PocketBase has no per-file HTTP cache headers and no arbitrary-metadata field on the file; add extra typed columns to the collection and write viarawif you need them.responseContentDispositiononurl()throws — userawand the?download=truequery string instead.Add SharePoint adapter (
files-sdk/sharepoint). ResolvessiteUrland nameddocumentLibraryto a drive via Microsoft Graph, then delegates to the OneDrive adapter for file operations. Falls back toSHAREPOINT_*env vars then toONEDRIVE_*. Resolution is lazy and cached after the first call.Add Tencent Cloud Object Storage (COS) adapter (
files-sdk/tencent). Thin wrapper around the S3 adapter — endpoint derived from the region code (cos.<region>.myqcloud.com), virtual-hosted-style addressing, errors relabelled as "Tencent Cloud error". Auto-loads fromTENCENT_SECRET_IDandTENCENT_SECRET_KEY. Bucket name must include the-<appid>suffix per COS's namespacing.Add Yandex Object Storage adapter (
files-sdk/yandex). Thin wrapper around the S3 adapter — fixed global endpoint (storage.yandexcloud.net), region defaults toru-central1for signing, virtual-hosted-style addressing, errors relabelled as "Yandex Cloud error". Auto-loads fromYANDEX_ACCESS_KEY_IDandYANDEX_SECRET_ACCESS_KEY.Add Bun S3 adapter at
files-sdk/bun-s3, backed by Bun's nativeBun.S3Clientinstead of@aws-sdk/client-s3. Use this when you're already on Bun and want to skip the AWS SDK dependency. Implements the full adapter surface (upload, download, head, exists, delete, copy, list, url, signedUploadUrl) with three deliberate limitations vsfiles-sdk/s3:copy()is client-side (Bun has no server-sideCopyObjectprimitive), andupload(metadata|cacheControl)plussignedUploadUrl(maxSize)throw becauseBun.S3Clientdoesn't expose equivalent options. Passclient: Bun.s3to reuse the global singleton, or hand in any customBun.S3Client-shaped instance.Add Bunny Storage adapter (
files-sdk/bunny-storage). Wraps the official@bunny.net/storage-sdkand connects to a Storage Zone via zone name + access key + region. Auto-loads fromBUNNY_STORAGE_ZONE/BUNNY_STORAGE_ACCESS_KEY/BUNNY_STORAGE_REGION, withSTORAGE_*accepted as aliases (the names used in the Bunny SDK's README).url()requirespublicBaseUrl(typically a Bunny Pull Zone) and returns a permanent CDN URL — Bunny has no signed-read primitive, soexpiresInis ignored andresponseContentDispositionthrows.signedUploadUrl()throws because Bunny writes require the Storage APIAccessKeyheader.copy()is a read-then-write (no server-side copy primitive in the SDK). CustommetadataandcacheControlon upload throw — configure cache behavior on the Pull Zone instead.Move provider SDKs to optional peer dependencies. Installing
files-sdkno longer pulls in every provider SDK by default — the package fully installs at a fraction of the previous size, and unused providers can't drag in transitive CVEs. Install only what you use:# S3 (and any S3-compatible: R2, MinIO, DigitalOcean Spaces, …)npm install files-sdk @aws-sdk/client-s3 @aws-sdk/s3-presigned-post @aws-sdk/s3-request-presigner# GCSnpm install files-sdk @google-cloud/storage google-auth-library# Azurenpm install files-sdk @azure/storage-blob @azure/identityBreaking (install-time only): if you upgrade and your project doesn't list the relevant provider SDK in its own
package.json, the next adapter import will throwERR_MODULE_NOT_FOUND. Fix is onenpm install. The published JS for each adapter subpath (files-sdk/s3,files-sdk/gcs, …) is byte-identical to the previous release — provider SDKs were already externalized, so runtime behavior, tree-shaking, and bundle sizes don't change. ThefilesCLI keepscommanderas a regular dep, sonpx filesworks out of the box. Fixes #34.
Expand adapter test coverage for error-recovery branches that were previously unexercised:
exists()swallowing a thrownNotFound(azure, gcs, netlify-blobs, r2) versus rethrowing other mapped errors; the supabase stream-download error envelope; and dropbox'sexists()returning false forfolder/deleted.tags plus theshared_link_already_existsrecovery falling through when no usable URL is embedded. No runtime behavior changes.