Dashboard › cli › Distillation
8e75b218-02bc-42ef-8ef3-90316d1376be["lore_tm_v1_fhSriYiPObQo0gOil91hZZ3Yl_1i_4xANdtiYTF2C80","lore_tm_v1_uu__-PqRIvSRDsBQl_A68aFsdTs7IPB6WJHTxqcE2To","lore_tm_v1_b3QzsB-pTKwx1x4T7dQ2VmtQGMUl3yKiBC_M3PhIcU8"]
Date: Sep 10, 2026
pickUploadEncoding never selects zstd when the runtime lacks zstdCompressAsync (Node < 22.15); consequently, encodeChunk’s unavailable-zstd branch should be unreachable and must throw rather than send raw bytes mislabeled with Content-Encoding: zstd.packages/cli/src/lib/api/chunk-upload.ts defines UPLOAD_CODECS = ["zstd", "gzip"] as const and UploadEncoding as its element type. Codec preference is zstd first, then legacy gzip; gzip remains sent under the file_gzip multipart field for pre-zstd servers that ignore Content-Encoding.pickUploadEncoding(compression: string[]): UploadEncoding | undefined iterates UPLOAD_CODECS, skips "zstd" when !zstdCompressAsync, returns the first server-advertised supported codec, logs server advertised unsupported codecs [...] ; falling back to plain upload when the server advertises only unsupported nonempty codecs, and otherwise returns undefined for plain uploads.encodeChunk(buf: Buffer, encoding: UploadEncoding | undefined): Promise<Uint8Array> checks encoding === "zstd" and throws Error("zstd encoding requested but unavailable on this runtime (Node < 22.15)") if zstdCompressAsync is unavailable, preventing server-corrupting raw bytes tagged as zstd.ChunkServerOptionsSchema in packages/cli/src/lib/api/chunk-upload.ts defines upload configuration fields: url, chunkSize, chunksPerRequest, maxRequestSize, optional maxFileSize, optional maxWait, hashAlgorithm, concurrency, and compression: z.array(z.string()). maxFileSize omitted or 0 means the CLI falls back to DEFAULT_MAX_DIF_SIZE; maxWait omitted or 0 means no server cap, while nonzero clamps requested waiting.AssembleResponseSchema defines state as "not_found" | "created" | "assembling" | "ok" | "error", optional missingChunks, and nullable optional detail. ChunkInfo contains sha1, offset, and size.packages/cli/src/lib/api/chunk-upload.ts constants are ASSEMBLE_POLL_INTERVAL_MS = 1000, ASSEMBLE_MAX_WAIT_MS = 300_000, and DEFAULT_MAX_DIF_SIZE = 2 * 1024 * 1024 * 1024 (2 GiB), matching legacy DEFAULT_MAX_DIF_SIZE.