Skip to content

feat(sdk): add sandboxId-first top-level sandbox operations#81

Draft
nicoalbanese wants to merge 2 commits intovercel:mainfrom
nicoalbanese:na/41a2dd5c
Draft

feat(sdk): add sandboxId-first top-level sandbox operations#81
nicoalbanese wants to merge 2 commits intovercel:mainfrom
nicoalbanese:na/41a2dd5c

Conversation

@nicoalbanese
Copy link

@nicoalbanese nicoalbanese commented Mar 10, 2026

Open Harness hacking with @LukeSheard.


Summary

Expose sandbox operations as top-level SDK APIs so callers can work directly with a sandboxId without first creating a Sandbox instance.

What changed

  • added a dedicated src/sandbox-operations.ts module for standalone sandbox helpers
  • updated standalone helpers to accept sandboxId as the first argument
  • added optional { client } as the last argument so callers can reuse an existing client
  • updated Sandbox instance methods to delegate to the standalone helpers while passing the instance client
  • re-exported the standalone helpers from the package entrypoint

Example

await mkdir(sandboxId, "tmp", { client });

await writeFile(
  sandboxId,
  { path: "tmp/hello.txt", content: Buffer.from("hello") },
  { client },
);

const cmd = await runCommand(
  sandboxId,
  "cat",
  ["tmp/hello.txt"],
  { client },
);

@vercel
Copy link

vercel bot commented Mar 10, 2026

@nicoalbanese is attempting to deploy a commit to the Vercel Labs Team on Vercel.

A member of the Team first needs to authorize it.

@nicoalbanese nicoalbanese marked this pull request as draft March 10, 2026 13:44
@nicoalbanese nicoalbanese changed the title feat: expose top-level sandbox helpers accepting sandboxId feat(sdk): add sandboxId-first top-level sandbox operations Mar 10, 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