import type { Credentials } from "@distilled.cloud/aws/Credentials"; import { Region } from "@distilled.cloud/aws/Region"; import * as s3 from "@distilled.cloud/aws/s3"; import * as Context from "effect/Context"; import * as Effect from "effect/Effect"; import * as Layer from "effect/Layer"; import * as Option from "effect/Option"; import type { HttpClient } from "effect/unstable/http/HttpClient"; import { AWSEnvironment } from "./Environment.ts"; /** * Tag key used to identify the alchemy assets bucket. */ export declare const ASSETS_BUCKET_TAG = "alchemy::assets-bucket"; /** * Error type for Assets service operations. */ export type AssetsError = { readonly _tag: "AssetsUploadError"; readonly message: string; readonly cause?: unknown; } | { readonly _tag: "AssetsCheckError"; readonly message: string; readonly cause?: unknown; }; /** * Requirements for Assets operations (S3 operations need these). */ export type AssetsRequirements = Region | Credentials | HttpClient | AWSEnvironment; declare const Assets_base: Context.ServiceClass; /** * Upload an asset to the assets bucket. * Uses content-addressed storage: `lambda/{hash}.zip` * * @param hash - The content hash of the asset * @param content - The asset content (zip file) * @returns The S3 key where the asset was uploaded */ readonly uploadAsset: (hash: string, content: Uint8Array) => Effect.Effect; /** * Check if an asset already exists in the assets bucket. * * @param hash - The content hash to check * @returns true if the asset exists */ readonly hasAsset: (hash: string) => Effect.Effect; }>; export declare class Assets extends Assets_base { static BucketName: Effect.Effect; } /** * Layer that provides the Assets service. * Looks up the assets bucket on initialization. * If the bucket doesn't exist, the layer will fail - use `assetsLayerWithFallback` for graceful fallback. */ export declare const AssetsLive: Layer.Layer; export declare const lookupAssetsBuckets: Effect.Effect; export declare const lookupAssetsBucket: Effect.Effect, s3.ListBucketsError, AWSEnvironment | Credentials | HttpClient>; /** * Build an account-regional namespace bucket name. * * Account-regional buckets must follow the naming convention: * `---an` * * @see https://docs.aws.amazon.com/AmazonS3/latest/userguide/gpbucketnamespaces.html#account-regional-gp-buckets */ export declare const createAssetsBucketName: (accountId: string, region: string) => string; /** * Create the tagged assets bucket for the current account+region and wait for * it to be addressable. Idempotent — used by `alchemy aws bootstrap` and by * the transparent local-emulator bootstrap in {@link AssetsLive}. */ export declare const createAssetsBucket: Effect.Effect; export declare const ensureAssetsBucketTags: (bucketName: string) => Effect.Effect; export {}; //# sourceMappingURL=Assets.d.ts.map