new·Earn with mozg — 20% of every monthSend somebody here and take a fifth of every plan payment they make, for as long as they keep paying — not a bounty on the first invoice. Your handle is the link, the window is thirty days, and the commission lands on your balance the second they pay. Free to join: if you have signed in, you already have the link. mozg.sh/earnall news →
mozg.beta
Sign in

Cloudflare Workers · Wrangler · all subjects

integrations/agents

8 notes, read out of this brain and free to use. Each one was extracted from a source and is re-checked against its exam.

sandbox.terminal() method for WebSocket PTY passthrough

The Sandbox SDK provides a terminal() method that proxies a WebSocket upgrade to the container's PTY endpoint, with output buffering for replay on reconnect. The method accepts a request parameter and an options object with cols and rows properties to specify terminal dimensions (e.g., cols: 80, rows: 24).

Multiple isolated terminals per sandbox session

Each session can have its own terminal with an isolated working directory and environment. Multiple terminals can run separate shells side-by-side in the same container, accessed via sandbox.getSession() and calling terminal() on the session object.

SandboxAddon for xterm.js terminal support

The @cloudflare/sandbox/xterm export provides a SandboxAddon class for xterm.js that enables automatic reconnection with exponential backoff and jitter, buffered output replay, and resize forwarding. The addon is instantiated with a config object containing getWebSocketUrl and onStateChange properties, then loaded into an xterm.js terminal and connected with a sandboxId parameter.

Update Sandbox SDK to latest version

To update the Sandbox SDK to the latest version, run: npm i @cloudflare/sandbox@latest

Agents SDK packages support AI SDK v6 and v7

The agents, @cloudflare/ai-chat, @cloudflare/codemode, and @cloudflare/think packages now support both AI SDK v6 and v7. Existing applications can remain on AI SDK v6 when updating these packages, and applications can also adopt v7 without changing the Cloudflare Agents APIs they use.

AI SDK and ai-sdk/react peer dependency ranges

The supported peer ranges are ai@^6 || ^7 and @ai-sdk/react@^3 || ^4. Use matching major versions: pair AI SDK v6 with @ai-sdk/react v3, or pair AI SDK v7 with @ai-sdk/react v4.

Install Agents SDK packages with AI SDK v7

To install the latest packages with AI SDK v7, use: npm install agents@latest @cloudflare/ai-chat@latest @cloudflare/codemode@latest @cloudflare/think@latest ai@^7 @ai-sdk/react@^4

Think normalizes streaming across AI SDK versions

Think normalizes streaming, tool completion events, and telemetry across both AI SDK v6 and v7. Existing v6 applications do not need to migrate these integrations before updating Think.

Give your agent this brain