import type { AwsCredentialIdentity, AwsCredentialIdentityProvider } from '@aws-sdk/types'; import { BlobStore } from '@mastra/core/storage'; import type { StorageBlobEntry } from '@mastra/core/storage'; /** * Configuration for S3BlobStore. * * Compatible with AWS S3, Cloudflare R2, MinIO, DigitalOcean Spaces, etc. */ export interface S3BlobStoreOptions { /** S3 bucket name */ bucket: string; /** AWS region (use 'auto' for R2) */ region: string; /** * AWS credentials or credential provider function. * Accepts static credentials or a provider that auto-refreshes * (e.g. fromNodeProviderChain() from @aws-sdk/credential-providers). * When set, takes precedence over accessKeyId/secretAccessKey/sessionToken. * When ALL credential options are omitted, the SDK default credential * provider chain is used (env vars, ~/.aws, IMDS, ECS container credentials). */ credentials?: AwsCredentialIdentity | AwsCredentialIdentityProvider; /** AWS access key ID. Optional - omit to use the SDK default credential provider chain. */ accessKeyId?: string; /** AWS secret access key. Optional - omit to use the SDK default credential provider chain. */ secretAccessKey?: string; /** AWS session token for temporary credentials (SSO, AssumeRole, container credentials, etc.) */ sessionToken?: string; /** * Custom endpoint URL for S3-compatible storage. * Examples: * - Cloudflare R2: 'https://{accountId}.r2.cloudflarestorage.com' * - MinIO: 'http://localhost:9000' */ endpoint?: string; /** Force path-style URLs (required for some S3-compatible services like MinIO) */ forcePathStyle?: boolean; /** * Key prefix for all blob objects. * Defaults to 'mastra_skill_blobs/'. */ prefix?: string; } /** * S3-backed content-addressable blob store for skill versioning. * * Each blob is stored as an S3 object keyed by its SHA-256 hash. * Metadata (size, mimeType, createdAt) is stored in S3 object user metadata. * * Since blobs are content-addressable, writes are idempotent — the same hash * always maps to the same content, so overwrites are safe and equivalent to * a no-op. * * @example AWS S3 * ```typescript * import { S3BlobStore } from '@mastra/s3'; * * const blobs = new S3BlobStore({ * bucket: 'my-skill-blobs', * region: 'us-east-1', * accessKeyId: process.env.AWS_ACCESS_KEY_ID!, * secretAccessKey: process.env.AWS_SECRET_ACCESS_KEY!, * }); * ``` * * @example MinIO (local) * ```typescript * import { S3BlobStore } from '@mastra/s3'; * * const blobs = new S3BlobStore({ * bucket: 'skill-blobs', * region: 'us-east-1', * accessKeyId: 'minioadmin', * secretAccessKey: 'minioadmin', * endpoint: 'http://localhost:9000', * forcePathStyle: true, * }); * ``` */ export declare class S3BlobStore extends BlobStore { private readonly bucket; private readonly prefix; private _client; private readonly region; private readonly credentials?; private readonly accessKeyId?; private readonly secretAccessKey?; private readonly sessionToken?; private readonly endpoint?; private readonly forcePathStyle; constructor(options: S3BlobStoreOptions); private getClient; private toKey; init(): Promise; put(entry: StorageBlobEntry): Promise; get(hash: string): Promise; has(hash: string): Promise; delete(hash: string): Promise; putMany(entries: StorageBlobEntry[]): Promise; getMany(hashes: string[]): Promise>; dangerouslyClearAll(): Promise; } //# sourceMappingURL=index.d.ts.map