/** * S3Connector — AWS S3 / S3-compatible object storage filesystem-face connector. * Mounts by syncing objects to a local directory. * * Every filesystem call here is async and deadline-bounded. `ctx.mountTarget` * resolves against the workspace directory, so an s3 connector declared with * `mount.target: workspace` writes straight onto the rclone FUSE mount — and * `downloadAll` is re-entered from the live `filesystem.sync` face, not only at * connect time. A synchronous write there parks the whole event loop in an * uninterruptible kernel wait: a hang, not an error, so `try/catch` never fires. */ import type { ConnectContext, ConnectorDeclaration, ConnectorHandle, FilesystemFace } from "@skaile/workspaces/connectors"; import { AbstractConnector } from "@skaile/workspaces/connectors"; /** * Minimal shape of the AWS S3 SDK module used internally. * Declared here so tests can provide a lightweight fake without importing the * real (optional) `@aws-sdk/client-s3` package. */ export interface S3SdkModule { S3Client: new (config: object) => { send(cmd: object): Promise; destroy(): void; }; ListObjectsV2Command: new (input: object) => object; GetObjectCommand: new (input: object) => object; } /** * Filesystem-face connector for AWS S3 and S3-compatible object storage — downloads all * objects from a bucket prefix into a local directory on connect and re-downloads on sync. * Requires the `@aws-sdk/client-s3` optional peer dependency. * @docLink packages/factory-assets/concepts#s3-connector */ export declare class S3Connector extends AbstractConnector { readonly name = "s3"; /** Optional SDK module override — used in tests to avoid importing the real AWS SDK. */ private _sdkOverride?; constructor(sdkOverride?: S3SdkModule); readonly filesystem: FilesystemFace; private _loadSdk; connect(declaration: ConnectorDeclaration, ctx: ConnectContext): Promise; disconnect(handle: ConnectorHandle): Promise; private _sync; /** * Fetch one object's bytes, or `null` when it yields none. * * S3-side failures are contained here — a single `GetObject` miss is * survivable and must not abort the whole sync. Local filesystem failures are * deliberately *not* in scope: see the write path in {@link downloadAll}. */ private fetchObject; private downloadAll; } /** * Creates a new S3Connector instance. * @param sdkOverride - Optional SDK module to use instead of dynamically importing * `@aws-sdk/client-s3`. Intended for testing only. * @returns Configured S3Connector ready to be registered in the connector registry. * @docLink packages/factory-assets/api-reference#s3-connector-factory */ export declare function createConnector(sdkOverride?: S3SdkModule): S3Connector; //# sourceMappingURL=driver.d.ts.map