feat(v4): add workspace download helpers

MA
2mo ago
+1323-19

What changed

V4 workspaces could list and upload files, but neither SDK exposed a high-level download helper.

  • Python: add sync and async download() and download_all().
  • TypeScript: add download() and downloadAll().
  • Add concise Python and TypeScript examples to the workspace guide.

Each transfer requests a fresh presigned URL immediately before downloading, streams to a sibling temporary file, and atomically replaces the destination. Failed transfers remove the temporary file and preserve an existing destination. Bulk downloads preserve nested paths and reject traversal.

Tests

  • TypeScript: 28 focused V4 tests passed; 148 full non-live tests passed; typecheck passed; ESM, CJS, and DTS build passed.
  • Python: 61 passed and 22 skipped; source-file Pyright passed; Ruff passed; compileall passed.
  • git diff --check passed.
  • Exact-range TruffleHog scan found 0 verified and 0 unverified secrets.

Summary by cubic

Adds high-level download helpers to the Python and TypeScript V4 workspace SDKs, so callers can pull workspace files to disk without managing presigned URLs manually.

New Features

  • Python adds sync and async download() and download_all(); TypeScript adds download() and downloadAll().
  • Each file requests a fresh presigned URL immediately before streaming and is written via a sibling temp file, then atomically replaces the destination.
  • Failed transfers delete the temp file and leave an existing destination in place.
  • Bulk downloads preserve nested paths and reject path traversal, including symlinked parents.
  • Workspace guide examples now show downloading a single file and a prefix.