@cloudflare/shell@0.4.0
YassKhazzan/openperplex_backend_os@cloudflare/shell@0.4.0Jun 12, 2026by github-actions[bot]
AI Summary
Introduces the `StateConnector` to expose the `state.*` filesystem API as a codemode connector, allowing tools to accept object-style arguments and optimizing read operations.
Key Highlights
- New `StateConnector` class exposing `readFile`, `writeFile`, `editFile`, etc.
- Tools now take a single object argument (e.g., `state.writeFile({ path, content })`)
- Pure reads are marked `replay: "reexecute"` to avoid storing large contents in logs
- Legacy provider path remains unchanged but also accepts object-style arguments
New Features
- Object-argument convention for state tools
- Connector-based filesystem access
Full Release Notes
### Minor Changes
- [#1656](https://github.com/cloudflare/agents/pull/1656) [`4c2d1a7`](https://github.com/cloudflare/agents/commit/4c2d1a7f7f337bf426b0b35e3c9e8e4901c6360b) Thanks [@cjol](https://github.com/cjol)! - Add `StateConnector` — the `state.*` filesystem API as a codemode connector.
`stateConnector(ctx, backend)` (or `new StateConnector(ctx, backend)`) exposes every `StateBackend` method (`readFile`, `writeFile`, `editFile`, `ls`, `find`, `grep`, `readJson`, `mergeJson`, …) as connector tools for `@cloudflare/codemode`'s durable runtime. Tools take a single object argument (`state.writeFile({ path, content })`), which the connector maps to the backend's positional parameters; pure reads are marked `replay: "reexecute"` so large file contents are never stored in the durable log. The legacy provider path (`createStateToolProvider`/`stateTools`) is unchanged and also accepts object-style arguments now, and the `state.*` type declarations and system prompt were updated to the object-argument convention.
### Patch Changes
- Updated dependencies \[[`b2b6762`](https://github.com/cloudflare/agents/commit/b2b67623deab327042b99344d8ee530ae37a71b2), [`4c2d1a7`](https://github.com/cloudflare/agents/commit/4c2d1a7f7f337bf426b0b35e3c9e8e4901c6360b), [`4c2d1a7`](https://github.com/cloudflare/agents/commit/4c2d1a7f7f337bf426b0b35e3c9e8e4901c6360b)]:
- @cloudflare/codemode@0.4.0