CeyNox Sandbox SDK: ceynox-sandbox (Python import ceynox_sandbox)

This directory is a modified copy of part of the E2B SDK.

  Project:  E2B, https://github.com/e2b-dev/E2B
  Taken from: packages/python-sdk at commit 08c4eeba6d08413779ec3fa5e7ac0edf3f608b33
              (2026-11-18), package version 2.64.0
  Copyright (c) 2025 FOUNDRYLABS, INC.

Licences.

- CeyNova Labs' own code and changes: Copyright 2026 CeyNova Labs LLC,
  licensed under the Apache License, Version 2.0, in LICENSE.
- The code taken from upstream stays under its own terms. The upstream package
  directory carries the MIT licence (Copyright (c) 2025 FOUNDRYLABS, INC.),
  kept here unchanged as LICENSE.upstream-package (upstream's LICENSE). The
  upstream repository's root licence is Apache 2.0 (Copyright 2023
  FoundryLabs, Inc.), kept here unchanged as LICENSE.upstream-repository.

All three notices, and this file, stay with every copy of this directory and
ship in the published package. "E2B" is the name of the upstream project and
is used here only to say where the code came from and what it is compatible
with.

Every file taken from upstream says so in its first lines. Files without that
line (the files named below as new) were written for CeyNox Sandbox.

What was changed, by CeyNova Labs, in November 2026:

- Renamed, and pointed at CeyNox Sandbox: the API at https://api.sandbox.ceynox.com,
  the content domain sandbox.ceynoxusercontent.com, the environment variables
  CEYNOX_API_KEY, CEYNOX_DOMAIN and CEYNOX_API_URL (E2B's names are read as a
  fallback), API keys that start with cnx_ (any other key is refused before it
  is sent), and our own User-Agent.
- Sandboxes are created and connected to through POST /sandboxes and
  POST /sandboxes/{id}/connect, the paths the CeyNox Sandbox API has.
- Added: a size option; a "not supported" error; placeholders for Volume
  and Secret; a template builder of our own (template.ts / template.py) with
  upstream's interface for what CeyNox Sandbox builds; the `ceynox-sandbox` command (SSH into a sandbox with a
  short-lived certificate, ceynox_sandbox/cli/).
- Kept from upstream, renamed: the client for the in-sandbox daemon ("envd")
  and what is built on it: commands (foreground, streaming and background,
  input, list, kill, connect), the filesystem module (read, write, list,
  stat, make_dir, rename, remove, watch), the PTY module, and signed file URLs
  (download_url, upload_url), over Connect RPC on pyqwest as upstream. The
  sandbox's own API is reached at <domain> (the sandbox domain itself) with the E2B sandbox
  headers (signed file URLs at 49983-<sandboxId>.<domain>), or at
  CEYNOX_SANDBOX_URL (E2B_SANDBOX_URL is read as a fallback). Commands, files
  and terminals run as the sandbox's `user` account unless root is named.
- Removed, because CeyNox Sandbox has no counterpart yet: the git module,
  upstream's template builder, volumes, secrets, snapshots, forks, metrics,
  network rules, workload identity, the MCP gateway, debug mode and
  idempotency keys. What remains of their interface throws the "not
  supported" error.
- The generated API client was cut down to the operations the service has.
- Retries: without a Should-Retry header, only a 429, or a 503 to a GET, HEAD
  or OPTIONS request, is retried, and running a command is never retried.
- Transport: plain httpx over HTTP/1.1 for the API; the sandbox's own API
  uses upstream's pyqwest transport and the sandbox_url and http_version
  options. The debug and validate_api_key options are gone.
- Sandbox addresses: getHost/get_host returns <port>-<sandboxId>.<domain>;
  the sandbox carries its traffic access token; of the network option only
  allowPublicTraffic is sent.
- New files: ceynox_sandbox/unsupported.py, ceynox_sandbox/profiles.py,
  ceynox_sandbox/cli/. Our tests are not part of the published package.
- Upstream's tests need E2B's own service and were not kept.
