Releases: cnap-tech/codemode
Releases · cnap-tech/codemode
v0.2.0 — QuickJS executor backend
Highlights
- New
QuickJSExecutor— pure-WASM sandbox backend viaquickjs-emscripten. Optional peer dependency. Auto-selected on Bun and other runtimes whereisolated-vmcannot dlopen. createExecutor()— runtime-aware backend picker. Use this as the default for new integrations:executor: await createExecutor({ memoryMB: 128, timeoutMs: 60_000 }).- Stats parity —
ExecuteStatsshape locked across backends so callers can swap transparently. - Shared executor contract test suite — adding a new contract test automatically covers every backend.
When to use which backend
| Backend | Recommended for |
|---|---|
IsolatedVMExecutor |
Production on Node. Native V8 speed, mature, no upstream async bugs. |
QuickJSExecutor |
Fallback only — runtimes where isolated-vm can't load (Bun, Cloudflare Workers, browser). See README for known upstream quickjs-emscripten@0.32.0 regressions and the Promise.all-over-sequential-await guest-code constraint. |
Other changes
- Dep bumps:
vitest3 → 4,typescript5 → 6,jdx/mise-actionv2 → v4, plus non-major patches acrossconvex,hono,isolated-vm,tsx,zod. - 97/97 tests green across both executors.
Full diff: #11
v0.1.5
What's Changed
- feat: Expose execution stats from V8 isolates —
ExecuteResultnow includesstatswith CPU time, wall time, and heap statistics fromisolated-vm - feat: Expose
requestCounton the bridge function returned bycreateRequestBridge()
These additions let consumers (e.g. CodeModeService) record OTel metrics without the library itself depending on OpenTelemetry.
v0.1.4
What's changed
- Revert error response stripping — Error status codes (401, 403, 404) are kept in the spec so agents can debug failures.
- Improved search tool description — Aligned examples with Cloudflare's patterns: tag-based discovery when available, list-all as fallback, split endpoint detail examples by concern (requestBody vs parameters).
v0.1.3
What's changed
- Strip error responses from spec — Only 2xx/default responses are kept in the processed spec. Error schemas (401, 404, 500) are identical boilerplate on every endpoint and were wasting context tokens.
- Full CNAP spec: ~58K → ~26K tokens (56% reduction)
- Single endpoint query: ~990 → ~358 tokens (64% reduction)
v0.1.2
What's changed
- Leaner spec processing —
processSpec()now dropscomponents,info, andoperationIdfrom the output. Since all$refs are resolved inline, these fields were redundant and wasted sandbox memory. - Lower default response token limit —
maxResponseTokensdefault reduced from 25,000 to 6,000 (matching Cloudflare's implementation), keeping agent context usage lean. - Updated tool type declarations —
SPEC_TYPESno longer advertisescomponentsorinfoon thespecglobal.
These changes reduce context overhead without changing the search/execute API.
v0.1.1
Full Changelog: v0.1.0...v0.1.1
v0.1.0
Full Changelog: https://github.com/cnap-tech/codemode/commits/v0.1.0