Merged
Conversation
9f8dcb7 to
e8a347e
Compare
e8a347e to
5fbf041
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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
0cd0487Thanks @zebp! - IntroduceFileSystemabstraction for all bundler APIs.The
filesoption oncreateWorkerandcreateAppnow accepts anyFileSystemimplementation in addition to a plain
Record<string, string>. This lets callersback the virtual filesystem with persistent or custom storage — for example, a
DurableObjectKVFileSystemthat buffers writes in memory and flushes to DurableObject KV on demand, avoiding a KV write for every individual file operation.
Three concrete implementations are exported from the package:
InMemoryFileSystem— aMap-backed filesystem suitable for tests andin-process pipelines. Accepts an optional seed object or
Mapof initialfiles.
DurableObjectKVFileSystem— a Durable Object KV-backed filesystem with awrite-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 callersalways observe their own writes immediately.
DurableObjectRawFileSystem— a thin Durable Object KV-backed filesystemwith no buffering. Every write is committed to KV synchronously. Use when
per-write durability is preferred over batching.
createFileSystemSnapshotcreates anInMemoryFileSystemfrom any sync orasync iterable of
[path, content]pairs, bridging async storage backends(e.g.
Workspacefrom@cloudflare/shell) to the synchronousFileSysteminterface.
The
FileSystem.read()method returnsstring | null(null = file does notexist) rather than an empty string, eliminating the need for a separate
exists()check.Plain
Record<string, string>objects continue to work unchanged — they arewrapped in an
InMemoryFileSystemautomatically.#1277
0cd0487Thanks @zebp! - ExportinstallDependencies,hasDependencies, andInstallResultso callerscan pre-warm a
FileSystemwith npm packages independently ofcreateWorkerorcreateApp.When
createWorkerorcreateAppencounter aFileSystemthat already containsa 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 insidecreateWorker) a no-op forpackages that were pre-installed into the same
FileSystem.#1277
0cd0487Thanks @zebp! - Add in-process TypeScript language service viacreateTypescriptLanguageService.createTypescriptLanguageServicewraps anyFileSystemin aTypescriptFileSystemthat mirrors every write and delete into an underlyingvirtual 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
./typescriptsubpath export to keep the TypeScriptbundle out of the main import path.
agents@0.10.1
Patch Changes
#1286
d76f8b9Thanks @threepointone! - FixMcpAgent.handleMcpMessagecrashing 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 hydratethis.namefrom storage and runonStart()before processing messages, matching the pattern used by_workflow_*RPC methods andalarm().#1278
8c7caabThanks @threepointone! - Think now owns the inference loop with lifecycle hooks at every stage.Breaking:
onChatMessage(),assembleContext(), andgetMaxSteps()are removed. Use lifecycle hooks and themaxStepsproperty instead. If you need full custom inference, extendAgentdirectly.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 aTurnConfigto override any part — model, system prompt, messages, tools, activeTools, toolChoice, maxSteps, providerOptions.maxStepsis now a property (default 10) instead of a method. Override per-turn viaTurnConfig.maxSteps.MCP tools auto-merged — no need to manually merge
this.mcp.getAITools()ingetTools().Dynamic context blocks:
Session.addContext()andSession.removeContext()allow adding/removing context blocks after session initialization (e.g., from extensions).Extension manifest expanded with
context(namespaced context block declarations) andhooksfields.@cloudflare/ai-chat@0.4.1
Patch Changes
#1277
0cd0487Thanks @zebp! - Fix race condition inmessageConcurrencywhere rapid overlapping submits could bypass thelatest/merge/debouncestrategy. The concurrency decision checkedqueuedCount()before the turn was enqueued, but an interveningawait 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
22da9b1Thanks @threepointone! - WidenuseAgentChatagent prop type to accept both typed and untypeduseAgentconnections. Previously,useAgent<MyAgent>()results could not be passed touseAgentChatdue to incompatiblecalltypes. The agent prop now uses a structural type matching only the fieldsuseAgentChatactually uses.@cloudflare/think@0.2.1
Patch Changes
#1275
37b2ce3Thanks @threepointone! - Add built-in workspace to Think. Every Think instance now hasthis.workspacebacked by the DO's SQLite storage, and workspace tools (read, write, edit, list, find, grep, delete) are automatically merged into every chat turn. Overrideworkspaceto add R2 spillover for large files.@cloudflare/shellis now a required peer dependency.#1278
8c7caabThanks @threepointone! - Think now owns the inference loop with lifecycle hooks at every stage.Breaking:
onChatMessage(),assembleContext(), andgetMaxSteps()are removed. Use lifecycle hooks and themaxStepsproperty instead. If you need full custom inference, extendAgentdirectly.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 aTurnConfigto override any part — model, system prompt, messages, tools, activeTools, toolChoice, maxSteps, providerOptions.maxStepsis now a property (default 10) instead of a method. Override per-turn viaTurnConfig.maxSteps.MCP tools auto-merged — no need to manually merge
this.mcp.getAITools()ingetTools().Dynamic context blocks:
Session.addContext()andSession.removeContext()allow adding/removing context blocks after session initialization (e.g., from extensions).Extension manifest expanded with
context(namespaced context block declarations) andhooksfields.