Packages

@cloudflare/codemode

0.5.5 · 20 Oct 2026MIT456.9k / weekRepositorynpmAtom feed

34 stable releases, newest first, by release line. Notes are quoted as the maintainers published them.

  1. 0.5.x · latest line
  2. 0.5.5

    20 Oct 2026
    • Release tool calls left pending when an execution settles, so unawaited calls no longer leak Dynamic Worker concurrency slots. See Unawaited tool calls.

  3. 0.5.4

    13 Oct 2026
    • ToolSetConnector now forwards each AI SDK tool's outputSchema into its connector descriptors, so durable codemode.describe() shows the output type instead of unknown, as McpConnector already does. Input and output schemas that convert asynchronously (jsonSchema(promise)) are now awaited instead of being dropped.

      Output types, in both generateTypes and connector descriptors, now describe the value a tool returns rather than the input side of its schema. A .default() field is now required and a .pipe() field has the piped type. A .transform(), which JSON Schema can't express, shows as unknown instead of the pre-transform type.

  4. 0.5.3

    2 Oct 2026
    • Declare the Code Mode tool input as { code: string } in its Standard Schema metadata so compatible consumers infer its type. See Code Mode.

  5. 0.5.2

    11 Sep 2026
    • Truncate structured results structurally instead of slicing their JSON.

      truncateResult (the default transformResult in Think's execute tool and the browser tools) and the codeMcpServer / openApiMcpServer response path used to pretty-print an oversized object and cut it at a character count, leaving the model with half a JSON document. Oversized values are now shrunk in place, largest values first: strings are clipped with a --- TRUNCATED --- <n> chars suffix, arrays keep their leading items and end with a --- TRUNCATED --- <n> more items element, and an object only loses entries (largest first, named in a "--- TRUNCATED ---" entry) when its values cannot share the budget. The output is always valid JSON of the original shape and small values pass through untouched.

      The Code Mode tool now carries a toModelOutput that projects calls out of what the model sees and bounds the sandbox logs the same way a result is bounded. The durable call log — every connector call's args and result — stays on the persisted tool part for UIs and audit, but no longer rides into the model's context uncapped alongside the transformed result. The projection never throws: a BigInt or cyclic value is rendered rather than failing a completed run at model assembly.

      The MCP servers apply the response budget to the text they emit, pretty-printing only while that still fits.

      Fixes #2009, #2143 and #2182.

  6. 0.5.1

    27 Jul 2026
    • Add MCP SDK v2 client and server support. MCPClientConnection now uses the exact-pinned @modelcontextprotocol/client@2.0.0-beta.5. It probes for stateless MCP with server/discover, then falls back to the legacy initialize handshake on the same connection when needed. The SDK auto-fulfills stateless elicitation input_required results through the existing form and URL elicitation handlers while callTool, getPrompt, and readResource remain pending. OAuth reauthorization discards redirect-scoped discovery after token issuance and preserves discovery-triggered authentication, allowing a changed authorization server to be rediscovered and registered without reusing the prior issuer's credentials. Legacy pushed elicitation, Streamable HTTP, SSE, RPC, OAuth, and hibernation recovery remain supported. Codemode's MCP connector now uses an SDK-neutral structural boundary compatible with both MCP client generations.

      Add MCP SDK v2 support to createMcpHandler. Pass a factory returning McpServer or Server from the exact-pinned @modelcontextprotocol/server@2.0.0-beta.5 peer dependency to serve stateless MCP with legacy compatibility by default. The new agents/mcp/server entry exports the stateless Agents handler without retaining McpAgent, WorkerTransport, MCP client transports, PartyServer, or SDK v1 modules. The returned handler remains callable for Worker dispatch and exposes the lower-level SDK fetch(request, options?) method plus typed notify methods; upstream close and event-bus internals are not part of the Agents surface. The retained v1 server APIs use the exact-pinned @modelcontextprotocol/sdk@1.29.0 peer dependency.

      The legacy compatibility fallback now uses SDK v2's web-standard transport, including fail-fast handling for unsupported server-to-client requests, active-request teardown, and the same 25-second Cloudflare SSE keepalive previously supplied by WorkerTransport. It returns 405 for session-only GET and DELETE requests without constructing an application server. createLegacyMcpHandler remains an explicit public API for SDK v1 servers and complete WorkerTransport options.

      The MCP client storage codec now preserves stateless discovery data with resumed HTTP sessions and preserves the binding name and props required to restore RPC servers. Stored HTTP session IDs from older Agents versions have no associated protocol version. The upgraded client discards those IDs and reconnects instead of sending an unsafe resumed request, so in-flight work tied to an old remote session does not resume.

      The v2 callable handler maps verified provider-issued metadata from compatible @cloudflare/workers-oauth-provider releases to standard MCP AuthInfo while preserving getMcpAuthContext().props.

      The Workers handler rejects malformed, opaque, and non-HTTP browser Origins. Its default allowlist includes localhost-class Origins, the endpoint's workers.dev hostname, and a concrete corsOptions.origin hostname. It applies matching Host checks to localhost and workers.dev endpoints. Custom-domain deployments with wildcard CORS can set allowedHostnames and allowedOriginHostnames explicitly, or set allowedOriginHostnames: "*" when trusted upstream middleware already enforces the required Origin policy. Requests without Origin remain valid for non-browser MCP clients. Default CORS preflights allow the stateless Mcp-Method and Mcp-Name request headers.

      @cloudflare/codemode is now an optional peer. Applications that import agents/skills or agents/browser install Codemode explicitly; MCP-only applications no longer install it transitively.

      Deprecations in this release:

      experimental_createMcpHandler was already deprecated and remains scheduled for removal in the next major release. Its warning now directs users to an SDK v2 factory first and names createLegacyMcpHandler only as a temporary bridge for sessionful SDK v1 behavior.

  7. 0.5.0

    23 Jul 2026

    Reading the note…

  8. 0.4.x
  9. 0.4.4

    22 Jul 2026

    Reading the note…

  10. 0.4.3

    13 Jul 2026

    Reading the note…

  11. 0.4.2

    26 Jun 2026

    Reading the note…

  12. 0.4.1

    16 Jun 2026

    Reading the note…

  13. 0.4.0

    12 Jun 2026

    Reading the note…

  14. 0.3.x
  15. 0.3.8

    26 May 2026

    Reading the note…

  16. 0.3.7

    19 May 2026

    Reading the note…

  17. 0.3.6

    14 May 2026

    Reading the note…

  18. 0.3.5

    13 May 2026

    Reading the note…

  19. 0.3.4

    7 Apr 2026

    Reading the note…

  20. 0.3.3

    1 Apr 2026

    Reading the note…

  21. 0.3.2

    26 Mar 2026

    Reading the note…

  22. 0.3.1

    24 Mar 2026

    Reading the note…

  23. 0.3.0

    23 Mar 2026

    Reading the note…

  24. 0.2.x
  25. 0.2.2

    19 Mar 2026

    Reading the note…

  26. 0.2.1

    17 Mar 2026

    Reading the note…

  27. 0.2.0

    13 Mar 2026

    Reading the note…

  28. 0.1.x
  29. 0.1.3

    11 Mar 2026

    Reading the note…

  30. 0.1.2

    2 Mar 2026

    Reading the note…

  31. 0.1.1

    25 Feb 2026

    Reading the note…

  32. 0.1.0

    20 Feb 2026

    Reading the note…

  33. 0.0.x
  34. 0.0.8

    17 Feb 2026

    Reading the note…

  35. 0.0.7

    9 Feb 2026

    Reading the note…

  36. 0.0.6

    3 Feb 2026

    Reading the note…

  37. 0.0.5

    17 Jan 2026

    Reading the note…

  38. 0.0.4

    9 Jan 2026

    Reading the note…

  39. 0.0.3

    29 Dec 2025

    Reading the note…

  40. 0.0.1

    29 Dec 2025

    Reading the note…