import { readFile } from "node:fs/promises";
import { isSea, getAsset } from "node:sea";
export async function readCliTextAsset(assetKey, fileUrl) {
    if (isSea()) {
        return getAsset(assetKey, "utf8");
    }
    return readFile(fileUrl, "utf8");
}
export async function readCliBinaryAsset(assetKey, fileUrl) {
    if (isSea()) {
        const value = getAsset(assetKey);
        if (value instanceof Uint8Array) {
            return value;
        }
        if (value instanceof ArrayBuffer) {
            return new Uint8Array(value);
        }
        return Buffer.from(value, "utf8");
    }
    return readFile(fileUrl);
}
//# sourceMappingURL=sea-assets.js.map