Files
PaperClipAI/packages
Devin Foley 639e1715d9 feat(adapter-utils): fast single-stream sandbox sync + byte-level progress
Replace the 32 KB serial-printf base64 chunk loop in the command-managed
writeFile with a single `base64 -d` process fed via stdin (temp file +
atomic rename), collapsing thousands of serial round-trips into one. A
bounded large-chunk stdin fallback covers payloads too big for one stdin
string. Stream readFile downloads through the runner's onLog byte counter,
decoding incrementally instead of buffering one big string.

Make writeFile/readFile the byte-level source of truth via an optional
per-call progress hook, and have prepareSandboxManagedRuntime own the
phase labels (workspace + per-asset upload, workspace restore), direction,
and throttled log lines via the shared runtime-progress reporter.

Tests: O(1) upload process for a multi-MB payload with exact (binary-safe)
bytes; streamed download reports monotonic progress to the total; upload
and restore emit throttled, labeled, directional percentage lines.
2026-06-19 11:47:40 -07:00
..