Skip to content

Version Packages#1273

Merged
threepointone merged 1 commit intomainfrom
changeset-release/main
Apr 11, 2026
Merged

Version Packages#1273
threepointone merged 1 commit intomainfrom
changeset-release/main

Conversation

@github-actions
Copy link
Copy Markdown
Contributor

@github-actions github-actions bot commented Apr 7, 2026

This PR was opened by the Changesets release GitHub action. When you're ready to do a release, you can merge this and the packages will be published to npm automatically. If you're not ready to do a release yet, that's fine, whenever you add more changesets to main, this PR will be updated.

Releases

@cloudflare/worker-bundler@0.1.0

Minor Changes

  • #1277 0cd0487 Thanks @zebp! - Introduce FileSystem abstraction for all bundler APIs.

    The files option on createWorker and createApp now accepts any FileSystem
    implementation in addition to a plain Record<string, string>. This lets callers
    back the virtual filesystem with persistent or custom storage — for example, a
    DurableObjectKVFileSystem that buffers writes in memory and flushes to Durable
    Object KV on demand, avoiding a KV write for every individual file operation.

    Three concrete implementations are exported from the package:

    • InMemoryFileSystem — a Map-backed filesystem suitable for tests and
      in-process pipelines. Accepts an optional seed object or Map of initial
      files.
    • DurableObjectKVFileSystem — a Durable Object KV-backed filesystem with a
      write-overlay. Writes accumulate in memory and are flushed to KV in one batch
      when flush() is called. Reads are served from the overlay first, so callers
      always observe their own writes immediately.
    • DurableObjectRawFileSystem — a thin Durable Object KV-backed filesystem
      with no buffering. Every write is committed to KV synchronously. Use when
      per-write durability is preferred over batching.

    createFileSystemSnapshot creates an InMemoryFileSystem from any sync or
    async iterable of [path, content] pairs, bridging async storage backends
    (e.g. Workspace from @cloudflare/shell) to the synchronous FileSystem
    interface.

    The FileSystem.read() method returns string | null (null = file does not
    exist) rather than an empty string, eliminating the need for a separate
    exists() check.

    Plain Record<string, string> objects continue to work unchanged — they are
    wrapped in an InMemoryFileSystem automatically.

  • #1277 0cd0487 Thanks @zebp! - Export installDependencies, hasDependencies, and InstallResult so callers
    can pre-warm a FileSystem with npm packages independently of createWorker or
    createApp.

    When createWorker or createApp encounter a FileSystem that already contains
    a package under node_modules/, that package is skipped during installation,
    avoiding redundant network fetches. This makes a second call to
    installDependencies (or the internal call inside createWorker) a no-op for
    packages that were pre-installed into the same FileSystem.

  • #1277 0cd0487 Thanks @zebp! - Add in-process TypeScript language service via createTypescriptLanguageService.

    createTypescriptLanguageService wraps any FileSystem in a
    TypescriptFileSystem that mirrors every write and delete into an underlying
    virtual TypeScript environment. Diagnostics returned by the language service
    always reflect the current state of the filesystem — an edit that fixes a type
    error immediately clears getSemanticDiagnostics.

    TypeScript is pre-bundled as a browser-safe artifact so it runs inside the
    Workers runtime without Node.js APIs. Lib declarations are fetched from the
    TypeScript npm tarball at runtime.

    Exposed under a separate ./typescript subpath export to keep the TypeScript
    bundle out of the main import path.

agents@0.10.1

Patch Changes

  • #1286 d76f8b9 Thanks @threepointone! - Fix McpAgent.handleMcpMessage crashing with "Attempting to read .name before it was set" when the Durable Object wakes from hibernation via native DO RPC. The method now calls __unsafe_ensureInitialized() to hydrate this.name from storage and run onStart() before processing messages, matching the pattern used by _workflow_* RPC methods and alarm().

  • #1278 8c7caab Thanks @threepointone! - Think now owns the inference loop with lifecycle hooks at every stage.

    Breaking: onChatMessage(), assembleContext(), and getMaxSteps() are removed. Use lifecycle hooks and the maxSteps property instead. If you need full custom inference, extend Agent directly.

    New lifecycle hooks: beforeTurn, beforeToolCall, afterToolCall, onStepFinish, onChunk — fire on every turn from all entry paths (WebSocket, chat(), saveMessages, auto-continuation).

    beforeTurn(ctx) receives the assembled system prompt, messages, tools, and model. Return a TurnConfig to override any part — model, system prompt, messages, tools, activeTools, toolChoice, maxSteps, providerOptions.

    maxSteps is now a property (default 10) instead of a method. Override per-turn via TurnConfig.maxSteps.

    MCP tools auto-merged — no need to manually merge this.mcp.getAITools() in getTools().

    Dynamic context blocks: Session.addContext() and Session.removeContext() allow adding/removing context blocks after session initialization (e.g., from extensions).

    Extension manifest expanded with context (namespaced context block declarations) and hooks fields.

@cloudflare/ai-chat@0.4.1

Patch Changes

  • #1277 0cd0487 Thanks @zebp! - Fix race condition in messageConcurrency where rapid overlapping submits could bypass the latest/merge/debounce strategy. The concurrency decision checked queuedCount() before the turn was enqueued, but an intervening await persistMessages() allowed a second message handler to see a stale count of zero and skip supersede checks. A pending-enqueue counter now bridges this gap so overlapping submits are always detected.

  • #1272 22da9b1 Thanks @threepointone! - Widen useAgentChat agent prop type to accept both typed and untyped useAgent connections. Previously, useAgent<MyAgent>() results could not be passed to useAgentChat due to incompatible call types. The agent prop now uses a structural type matching only the fields useAgentChat actually uses.

@cloudflare/think@0.2.1

Patch Changes

  • #1275 37b2ce3 Thanks @threepointone! - Add built-in workspace to Think. Every Think instance now has this.workspace backed by the DO's SQLite storage, and workspace tools (read, write, edit, list, find, grep, delete) are automatically merged into every chat turn. Override workspace to add R2 spillover for large files. @cloudflare/shell is now a required peer dependency.

  • #1278 8c7caab Thanks @threepointone! - Think now owns the inference loop with lifecycle hooks at every stage.

    Breaking: onChatMessage(), assembleContext(), and getMaxSteps() are removed. Use lifecycle hooks and the maxSteps property instead. If you need full custom inference, extend Agent directly.

    New lifecycle hooks: beforeTurn, beforeToolCall, afterToolCall, onStepFinish, onChunk — fire on every turn from all entry paths (WebSocket, chat(), saveMessages, auto-continuation).

    beforeTurn(ctx) receives the assembled system prompt, messages, tools, and model. Return a TurnConfig to override any part — model, system prompt, messages, tools, activeTools, toolChoice, maxSteps, providerOptions.

    maxSteps is now a property (default 10) instead of a method. Override per-turn via TurnConfig.maxSteps.

    MCP tools auto-merged — no need to manually merge this.mcp.getAITools() in getTools().

    Dynamic context blocks: Session.addContext() and Session.removeContext() allow adding/removing context blocks after session initialization (e.g., from extensions).

    Extension manifest expanded with context (namespaced context block declarations) and hooks fields.

Copy link
Copy Markdown
Contributor

@devin-ai-integration devin-ai-integration bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ Devin Review: No Issues Found

Devin Review analyzed this PR and found no bugs or issues to report.

Open in Devin Review

@github-actions github-actions bot force-pushed the changeset-release/main branch 10 times, most recently from 9f8dcb7 to e8a347e Compare April 10, 2026 13:54
@github-actions github-actions bot force-pushed the changeset-release/main branch from e8a347e to 5fbf041 Compare April 11, 2026 06:02
@threepointone threepointone merged commit cacea7f into main Apr 11, 2026
@threepointone threepointone deleted the changeset-release/main branch April 11, 2026 06:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant