effect@4.0.0-rc.116
Pre-releasePatch Changes
-
#7908
c19c63fThanks @gcanti! - Add experimental JIT and AOT schema compilers that work through the existing
SchemaParserAPIs and share a decoder registry. Enable JIT globally with
effect/unstable/schema/SchemaJITCompiler/enable, selectively with
SchemaJITCompiler.enable(ast), or install generated AOT decoders without
requiring dynamic function construction. The new
effect/unstable/schema/SchemaAOTCompiler/Buildentrypoint discovers direct
Schema exports from explicit module loaders and writes a self-installing AOT
module through Effect'sFileSystemandPathservices. Compiled decoders can
provide optional synchronousdecodeandmakeoperations; normal
SchemaParsercalls consume them transparently and retaindecodeEffectand
makeEffectas the detailed fallbacks. AOT targets declare the operations to
prepare, so generated modules contain only those operation families and use
the interpreter if an omitted operation is later called.Breaking changes
SchemaGetter.Getteris now a tagged union that distinguishes synchronous,
optional, and effectful transformations. Getter values now expose onlypipe.
Use the dualSchemaGetter.map,SchemaGetter.compose, andSchemaGetter.run
functions instead of the former methods. Keeping these operations standalone
lets bundlers remove composition code when an application does not use it.The public
Getterconstructor is removed. Use
SchemaGetter.transformOptionalEffectinstead ofnew SchemaGetter.Getter.
SchemaGetter.onSomeandSchemaGetter.onNoneare also removed. Use
transformEffectfor an effectful transformation of present values and
transformOptionalEffectwhen the transformation handles missing values.Transformation#composeis replaced by the dual standalone function
SchemaTransformation.composeTransformation. Replacefirst.compose(second)
withSchemaTransformation.composeTransformation(first, second)or
SchemaTransformation.composeTransformation(second)(first).SchemaTransformation.makeis renamed to
SchemaTransformation.makeTransformation.SchemaTransformation.Transformation
andSchemaTransformation.Middlewarenow implementPipeable, so both values
can be passed through standalone combinators with.pipe(...).SchemaAST.Context.constructorDefaultnow stores the constructor-default
Effectdirectly instead of wrapping it in aSchemaAST.Link. Constructor
defaults apply only during construction, so the direct representation avoids
giving them encoding semantics and lets construction reuse already-completed
synchronous Effects. Code that constructs or inspectsSchemaAST.Context
should pass or read the defaultEffectdirectly. -
#8287
8cb0a4fThanks @tim-smart! - AddDecisionandDecisionModeltoeffect/unstable/aifor batched classification, rating, and probability estimates over schema-encoded input. -
#8221
8f420bbThanks @gcanti! - AddArbitrary.array(item, { minLength, maxLength })for variable-length arrays of custom Arbitraries. Shrinking removes blocks of commands while preserving the remaining values and their order, and also simplifies individual elements.Schema-derived arrays now also try removing prefixes and interior blocks. Shrinking composed values and Schema objects preserves child candidates that were previously lost when exploring another branch.
Shrunk results and replay paths may change from earlier native releases. Re-run affected properties to obtain new replay tokens, and preserve important failing inputs as regression tests.
-
#8233
1393080Thanks @gold-beyond! - AddCrypto.randomULIDto generate ULIDs from the currentClocktimestamp and cryptographically secure random bytes. -
#8256
ccae354Thanks @tim-smart! - Align theEffectandStreamAPIs and fix several Stream type signatures.Effect.orElseSucceednow passes the error to the fallback function, matchingStream.orElseSucceed.Effect.isEffectnarrows toEffect<unknown, unknown, unknown>instead ofany.Stream.bind,Stream.bindEffectandStream.letallow re-binding an existing field and produce the same record type as theirEffectcounterparts.Stream.Success,Stream.ErrorandStream.Servicesare unconstrained and distributive like theEffectversions.Stream.partitionreturns[passes, fails]and takes acapacityoption, matchingStream.partitionQueueandStream.partitionEffect. Its default capacity remains 16.Stream.mapBothtakesonElement/onError, matchingStream.tapBoth.Stream.scanandStream.scanEffecttake a lazy initial state.Stream.catchTagsrejects unknown tag keys likeEffect.catchTags.- Fixed the data-first overloads of
Stream.runIntoPubSub(error type was dropped),Stream.cross(swapped type parameter names) andStream.mapAccumArray(onHaltreturn type). - Added
Stream.as,Stream.tapDefect,Stream.tapErrorTagandStream.unwrapReason. - Stream concurrency options use the
Types.Concurrencyalias, and JSDoc categories were consolidated across both modules.
-
#8235
553c403Thanks @tim-smart! - Retain durable deferred completions received before a workflow owner's first local run so replay can complete while the deferred reply is still being persisted.Keep pending completions in a cache keyed weakly by cluster activation. Handler rebuilds retain completions, and overlapping activations cannot clear each other's results. Results can be collected once their activation scope becomes unreachable; closing a scope alone does not guarantee collection.
Release RPC stream and queue consumers when their request write fiber is interrupted.
-
#8243
45b5103Thanks @tim-smart! - Fix lost durable deferred wake-ups when a ClusterWorkflowEngine execution suspends before its run reply is persisted. Deferred completions now wait for the current run reply before resuming, so discarded executions can replay without relying on caller retries. -
#8254
77a5612Thanks @tim-smart! - Fix file response content types: honor thecontentTypeoption and preserve explicit headers, including MIME types set byHttpStaticServer. The defaultHttpPlatform.layernow infers missing content types from file extensions.Web file responses on the default, Node, and Deno platforms prefer explicit content types, then nonempty
File.type, then the file extension.Removed the unused
contentLengthoption fromHttpServerResponse.file; lengths are calculated from the file and requested range. -
#8229
1076170Thanks @tim-smart! - Fix a deadlock in the memory workflow engine when a durable deferred is completed from a finalizer in the workflow awaiting it, includingDurableDeferred.intoinsideDurableDeferred.raceAll. -
#8206
f110af1Thanks @tim-smart! - Fix multipart file streams hanging on body read errors and preserve error causes when persisting files. -
#8284
0045152Thanks @tim-smart! -HttpServerResponse.toWebnow keeps a rawResponse's headers andSet-Cookievalues when the body is omitted (HEAD, or status 204, 205 or 304). Bodyless outer statuses keep the outer status and status text; HEAD keeps the rawResponse's. Outer cookies are appended to nativeSet-Cookieheaders instead of replacing them. -
#8202
51d4a2fThanks @xia-chao! - FixRcRef.maketo treatidleTimeToLive: 0likeDuration.zeroand"0 millis"instead of an omitted option. -
#8298
4d4c4e8Thanks @gcanti! - FixSchema.Redactedto wrap the transformed result of its inner schema during decoding and encoding. -
#8227
ccfe152Thanks @tim-smart! - Release non-persisted, interruptibleRunnerServerhandlers and mailbox slots when callers disconnect.Preserve dynamic
WithTransactionannotations during replay and re-delivery. -
#8261
d30a0c8Thanks @nikhilsnayak! - Add HTTPQUERYsupport to clients, routers, HttpApi endpoints, and AI request metadata. Configure CORS support throughallowedMethods; defaults are unchanged.OpenAPI 3.1 output represents
QUERYthroughx-oai-additionalOperations, which requires consumer support for that extension. The OpenAPI generator accepts the extension and the native OpenAPI 3.2queryfield. -
#8255
84fe64aThanks @tim-smart! - Preserve literal suffixes such as:waitin/operations/:id:waitacrossHttpApiClient,HttpApiBuilder, and OpenAPI paths.Server routes without a params schema keep their existing matching for
RouteContextconsumers. Schemas whose keys cannot be enumerated keep the existing fallback. -
#8228
49e4b37Thanks @lloydrichards! - Support prompt titles inMcpServer.promptandMcpServer.registerPrompt. -
#8228
49e4b37Thanks @lloydrichards! - Add aninstructionsoption to MCP servers for initialization and discovery responses. -
#7265
a2c4154Thanks @lloydrichards! - Add server support for MCP protocol version 2026-07-28 through 2026_07_28 -
#8272
23a58c0Thanks @fubhy! - AddNetAddress.formatHostandNetAddress.inetAddressFromHostStringfor socket APIs that accept numeric hosts and ports separately, preserving IPv6 scope IDs. AddNetAddress.scopeIdsFromInterfacesto build a scope map for resolving named IPv6 zones from supplied network interface entries without performing operating-system lookups. -
#8293
feef90cThanks @gcanti! - TreatNeveras an uninhabited branch duringArbitrary.schemaderivation. Schemas with another finite generation path, including optional properties, unions, and empty collections, no longer fail derivation. -
#8212
755e863Thanks @IMax153! - RestrictByteSize.Inputstrings to canonical non-negative integers with recognized units, rejecting malformed literals at compile time. Parse external strings and fractional quantities withByteSize.fromStringorByteSize.fromStringUnsafebefore passing them to APIs acceptingByteSize.Input. -
#8228
49e4b37Thanks @lloydrichards! - HonorTool.Strictin MCP input schemas and argument validation. Strict dynamic tools require Effect schemas; raw JSON Schema is rejected at registration.Support identified input schemas for non-strict tools. Invalid arguments use
InvalidParamson protocols before 2025-11-25 andisError: trueresults on newer protocols.Distinguish validation failures from declared handler failures. Declared failures return
isError: truewithoutstructuredContent: error mode usesError.messageor schema-encoded text, and return mode uses the encoded payload. Declared failures do not produce internal-error diagnostics.Log and report internal failures, including defects and encoding errors, while keeping client messages generic.
Allow
Toolkit.handleto acceptSchemaAST.ParseOptionsfor parameter decoding. Expose theToolkit.FailureOrigincause annotation and sharedTool.FailureOrigintype, with the same origin available inTool.HandlerResult.failureOriginon returned failures. -
#8269
9ad9891Thanks @tim-smart! - AddHttpApi.ParseOptionsto configure server and client codecs at the API, group, or endpoint level.Sse.decodeSchemaandChannelSchema.decodeaccept parse options, andSchema.Causeencodes reasons to their wire fields.SSE decoding omits absent IDs, including with default options. Use
Schema.optional(Schema.String)instead ofSchema.UndefinedOr(Schema.String)for IDs. WithonExcessProperty: "error", declareevent(default:"message") and anyid, including inherited IDs.HttpApiSchema.StreamSsedata-mode types and OpenAPI schemas now makeidoptional. -
#8296
0beded0Thanks @gcanti! - Improve Schema-derived BigInt and BigDecimal arbitraries with wider magnitude, precision, and exponent coverage and numeric boundary shrinking.Cover intermediate magnitudes up to large one-sided BigInt bounds, handle BigDecimal bounds with widely different scales, and refine decimal counterexamples between simple values.
-
#8260
2940742Thanks @xia-chao! - Fix repeatedtext,json,arrayBuffer, andurlParamsBodyreads inHttpServerResponse.toClientResponsefor raw WebResponsebodies, preserving the original response for serving. -
#8270
63c1566Thanks @tim-smart! - Fix YAML indentless sequences, multiline scalar folding, and comments. Reject unsupported compact nested sequences (- - value) and document streams.Previously accepted values such as
description: Use when: deployanddescription: Deploy:now throwSyntaxError: YAML forbids colons followed by whitespace or end-of-value in plain scalars. Quote these values, for exampledescription: "Use when: deploy".