Skip to content

@e2b/python-sdk@2.28.0

Choose a tag to compare

@github-actions github-actions released this 10 Jun 17:33
· 1 commit to main since this release
da85b1e

Minor Changes

  • 961ffba: feat(sdks): expose user-defined file metadata on sandbox.files

    Adds a metadata option to file uploads (write / writeFiles / write_files) and surfaces persisted metadata on every EntryInfo / WriteInfo returned by getInfo, list, rename, and write responses. On upload, metadata is sent as X-Metadata-<key>: <value> request headers; envd persists the values as extended attributes in the user.e2b. xattr namespace and returns them on subsequent filesystem reads (including user.e2b.* xattrs set out-of-band). Keys are sent as HTTP header names and are lowercased by the sandbox; metadata is validated client-side (keys must be valid HTTP header tokens, values must be printable US-ASCII) and invalid input raises InvalidArgumentError / InvalidArgumentException. The same metadata map is applied to every file in a multi-file upload. Requires envd 0.6.2 or later.

  • da85b1e: Add an includeEntry/include_entry option to filesystem directory watching. When enabled, each FilesystemEvent carries the affected entry's EntryInfo (best-effort; left unset for events where the path no longer exists, such as remove/rename-away). Requires envd 0.6.3 or later; watching with this option against an older sandbox raises a template error.

Patch Changes

  • 7dc861f: fix: align behavior between the JS and Python SDKs

    Python SDK:

    • commands.send_stdin and CommandHandle.send_stdin now accept bytes in addition to str, and the handle's send_stdin / close_stdin now accept a request_timeout.
    • git.reset now accepts a typed GitResetMode and its validation error matches the JS SDK wording/ordering. GitResetMode is now exported.
    • sandbox_url is now propagated through get_api_params.
    • Template.from_image() now raises when only one of username / password is provided.
    • get_info() no longer carries the envd access token on the returned SandboxInfo (the _envd_access_token field was unused), matching the JS SDK which strips it from getInfo.
    • get_metrics() now raises TemplateException (was SandboxException) with the same message as the JS SDK when the sandbox is too old.

    JS SDK:

    • Sandbox.getInfo() now includes sandboxDomain, matching the Python SDK's single get_info. getFullInfo is deprecated and now just wraps getInfo (it no longer returns the envd access token).
    • Sandbox.getMetrics() now returns [] in debug mode, matching the Python SDK. The debug short-circuit for getMetrics / kill is implemented on both the instance and static methods, so it applies consistently whether called as Sandbox.kill(sandboxId) or sandbox.kill().
    • Template.fromImage() now requires both username and password when registry credentials are provided.
    • Template.getBuildStatus() now defaults logsOffset to 0.
    • requestTimeoutMs: 0 now explicitly disables the request timeout.
    • getMetrics() now throws TemplateError (was SandboxError) when the sandbox is too old to support metrics.