Strip session-only routes (auth, me, teams, hosts, channels, admin,
audit-logs) from api/openapi.yaml via new scripts/prune_openapi.py,
which is wired into `make generate` and `make prune-spec`. Spec drops
from 4787 to 1717 lines; regenerated _generated.py drops from 906 to
415 lines with all obsolete models removed.
Add SDK methods on CapsulesResource / AsyncCapsulesResource for the
apiKey-usable routes that were previously unwrapped:
- capsules.stats(range=...) -> CapsuleStats
- capsules.usage(from_=..., to=...) -> UsageResponse (accepts date)
- capsules.metrics(id, range=...) -> CapsuleMetrics
Add EventsResource / AsyncEventsResource exposing
WrennClient.events.stream() over /v1/events/stream (SSE). Parser
handles `:keepalive` comments and multi-line `data:` frames.
Re-export new models (CapsuleStats, CapsuleMetrics, MetricPoint,
UsageResponse, SSEEvent, Resource, Actor) from wrenn.models.
Drop email-validator runtime dep (no EmailStr remains). Bump version
to 0.3.0 (pyproject + __version__). Add pyyaml to dev deps and
types-PyYAML to the pre-commit mypy hook for the prune script.
Normalize docstrings on new methods/classes to Google style with
Example:: blocks where useful. Regenerate docs/reference.md.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Sync OpenAPI spec to v0.2.0, fix type annotation shadowing by using
builtins.list in annotated signatures, guard poll interval lookup
against None status, and reorder capsule ID assignment to validate
before storing.
Bugs fixed:
- files.py: use typed error checking (_raise_for_status) instead of raw
raise_for_status(), ensuring WrennNotFoundError etc. are raised
correctly
- exceptions.py: check both "capsule_ids" and "sandbox_ids" response
keys
for backwards compatibility
- code_interpreter: retry _ensure_kernel on 5xx errors (only fail on
4xx),
remove redundant TimeoutError in bare except, clean up non-standard
top-level msg_id/msg_type from Jupyter messages
Resource leaks fixed:
- capsule.py: close WrennClient if capsule creation or init fails
- code_interpreter: add close()/__del__ for _proxy_client cleanup when
not using context manager
Logic fixes:
- pty.py: yield exit events to callers instead of silently discarding
them
- capsule.py: auto-resume paused capsules in wait_ready instead of
failing
- capsule.py: log warnings on destroy failure in __exit__ instead of
silently swallowing errors
- Update Woodpecker to run unit and integration tests in parallel
- Add GitHub Actions workflow for PyPI trusted publishing on main
- Add license, classifiers, keywords, and URLs to pyproject.toml
- Fix ruff lint errors (unused imports, duplicate class name) and formatting
Replace the WrennClient-centric API with a top-level Capsule class that
mirrors e2b's Sandbox interface, enabling drop-in migration. Key changes:
- Capsule/AsyncCapsule with direct construction (reads WRENN_API_KEY and
WRENN_BASE_URL env vars), namespaced sub-objects (capsule.commands,
capsule.files), dual instance/static lifecycle methods via _DualMethod
descriptor (capsule.kill() and Capsule.kill(id))
- WrennClient simplified to API-key-only endpoints (capsules, snapshots);
JWT-based resources (auth, hosts, teams) removed
- wrenn.code_interpreter submodule with Capsule subclass defaulting to
code-runner-beta template and run_code() support
- Sandbox alias emits FutureWarning instead of DeprecationWarning
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Introduces the core Wrenn client and a dedicated sandbox execution
environment. This includes automated model generation and a custom
exception hierarchy to support robust integration.
- Add `WrennClient` in `src/wrenn/client.py` for API interaction.
- Implement `Sandbox` in `src/wrenn/sandbox.py` for isolated execution.
- Add Pydantic/model support via `_generated.py`.
- Define project-specific error types in `exceptions.py`.
- Include AGENTS.md documentation for specialized logic.
- Add comprehensive unit and integration tests.
- Update build system (Makefile, uv.lock, pyproject.toml) and LICENSE.