Repository navigation
contextSDK 0.3.0 — production hardening across data integrity, providers, security, and onboarding. Verified live against real E2B, Vercel, and Modal sandboxes, including cross-provider hops.
Heads-up — one breaking change:
contextsdk runnow prints the wrapped command's own stdout/stderr and exits with its exit code. Pass--jsonfor the previous{ ok, result }envelope.
Highlights
Data integrity
- Crash-safe saves. Encrypted bundles/images are written under generation-scoped keys and the manifest write is the atomic commit point, guarded by ETag compare-and-swap with re-asserted lock ownership. An interrupted save can no longer strand a manifest pointing at ciphertext it cannot decrypt; superseded objects are garbage-collected.
- Stronger crypto guarantees. GCM auth-tag (16B) and nonce (12B) lengths are pinned so manifest metadata cannot weaken verification; failed decryptions remove partial plaintext; key buffers are zeroed after use.
Providers
- e2b SDK v2 with retrying presigned-URL transfers (no more fresh-sandbox connect-timeout flakiness).
- Session-sized sandbox lifetimes (E2B 30m, Vercel 45m, Modal 60m) with
keepAliveheartbeats, replacing the providers' 5-minute defaults that killed agent sessions. The e2b 60-second per-command timeout is disabled for wrapped work. - Tree contexts attach via the unprivileged directory-bundle path on every provider — no host
mkfs.ext4/e2fsckneeded unless you opt into--format ext4. - Vercel headless auth pass-through (
token/teamId/projectId); adapters only terminate sandboxes they created; the SSH adapter now usesbash,BatchMode, and the bundle path.
Security
- Archive members are validated inside the runtime as well as on the host: path traversal, link escapes, special files, entry-count and decompressed-size caps, and a realpath escape check. Context ids are validated before they reach storage keys.
Onboarding
- Works with zero cloud config. When no S3 bucket is set, contexts live in a local encrypted store (
~/.contextsdk/storage) via the newFsStorage, which implements the same compare-and-swap semantics as S3.
Packaging & project
- Bumped to 0.3.0; adapters declare
@contextsdk/coreas a peer dependency;sideEffects: false; typedRuntimeCommandError. - Added CI (Node 20/22/24), root
LICENSE,CHANGELOG.md,SECURITY.md,CONTRIBUTING.md. Tests expanded from 74 to 115.
Compatibility
- 0.3.0 reads contexts written by 0.1.0/0.2.0 (legacy
current.*keys migrate on next save); 0.2.0 can read contexts saved by 0.3.0. - Packages are ESM-only and require Node >= 20 on a POSIX host (
tar,zstd,python3).
See CHANGELOG.md for the full list.