Skip to content

feat(device): add file push and pull - #25

Closed
lutz-grex wants to merge 1 commit into
mainfrom
lucius/fn-device-files
Closed

lutz-grex wants to merge 1 commit into
mainfrom
lucius/fn-device-files

Conversation

@lutz-grex

Copy link
Copy Markdown
Contributor

Summary

Functions can move files between the run's device and the function with ctx.device.push_file and ctx.device.pull_file.

Changes

  • Device gains push_file(source, device_path) (local path or bytes, full destination path) and pull_file(device_path) -> bytes.
  • Both use the public devices files API through the generated SDK; no storage, no own size limit.
  • Cloud devices only; a local device raises NotAvailableError.
  • README documents both calls with an example.

Testing

  • Tests cover push (bytes and local path), pull of binary content, sync main, and the local-device refusal, using a mock transport.
  • mypy, ruff and pytest pass.

Runtime

Verified against a cloud device: a 16 KB binary file pushed and pulled back with an identical SHA-256.

🤖 Generated with Claude Code

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
@lutz-grex lutz-grex closed this Nov 27, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant