Skip to content

armgit / cindy

Public Imported from GitHub
0

Consider it done. The open-source AI agent that works out of the box · 想到,就能做到。开源、开箱即用的 AI Agent。

402 B
Raw Blame
export async function writeFileHandleFully(params) {
    let offset = 0;
    while (offset < params.bytes) {
        params.deadline.check();
        const { bytesWritten } = await params.handle.write(params.buffer, offset, params.bytes - offset);
        if (bytesWritten <= 0) {
            throw new Error("archive staging write made no progress");
        }
        offset += bytesWritten;
    }
}