Skip to content

Conversation

@imrishabh18
Copy link
Member

Motivation

  • tsci clone previously assumed file content was returned as text and failed to restore binary files.
  • The registry exposes an is_text flag on package_files/get and a separate package_files/download endpoint for binary content, so the clone flow must use those to restore files correctly.

Description

  • Update the package_files/get response type to include package_file_id, is_text, and nullable content_text and read those fields.
  • When is_text is true and content_text is a string, write the file with fs.writeFileSync(fullPath, contentText); otherwise call package_files/download with the package_file_id and write the returned arrayBuffer as a Buffer.
  • Preserve existing error handling and add a warning when a file has no content or cannot be restored.
  • Changes are contained in cli/clone/register.ts and only affect the clone file restore logic.

Testing

  • No automated tests were run for this change.

Codex Task

@imrishabh18 imrishabh18 merged commit b101a85 into main Jan 15, 2026
10 checks passed
@imrishabh18 imrishabh18 deleted the codex/fix-tsci-clone-not-downloading-binaries branch January 15, 2026 12:14
@tscircuitbot
Copy link
Contributor


Thank you for your contribution! 🎉

PR Rating: ⭐⭐
Impact: Minor

Track your contributions and see the leaderboard at: tscircuit Contribution Tracker


Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants