github Effect-TS/effect effect@4.1.5

Patch Changes

  • #10639 3e2030b Thanks @gcanti! - Report unsupported regex patterns and their schema paths when Arbitrary sampling or property checking exhausts its discard budget.

    When constructing Arbitrary.SampleError or Arbitrary.Exhausted values, include the required diagnostics array; use [] when there are no diagnostics.

  • #10401 f9f5f9d Thanks @fubhy! - Shrink Arbitrary string counterexamples by deleting characters anywhere, and defer shrinking work until a property fails. Existing string replay tokens may need to be recorded again.

  • #10613 eecfff5 Thanks @Marve10s! - Fix Atom.kvs showing the value from before its last write after being refreshed or remounted past its idle TTL.

  • #9974 7e9e5df Thanks @danieljvdm! - Add opt-in staleTime to HTTP and non-stream RPC atom queries and run hydrated waiting effects even with skipInitialRun.

  • #10557 ddd142f Thanks @fubhy! - Add Base64.encodeUnpadded for standard Base64 without = padding, and Base64.decodeLenient for input in either Base64 alphabet, with or without padding.

  • #10555 2bd41fe Thanks @filipfalcon! - Add BigInt.nthRoot for integer n-th roots and Rational.nthRoot for exact n-th roots, each with a nthRootUnsafe variant.

  • #10601 36e335a Thanks @filipfalcon! - Speed up BigInt.sqrt and BigInt.sqrtUnsafe on large inputs.

  • #10606 7c36414 Thanks @Marve10s! - Fix Cache and ScopedCache entries failing to expire with a provided clock when the first caller is interrupted during a shared lookup.

  • #10748 284b978 Thanks @haranishi! - Keep closed code blocks together when they fit in a single ChatMarkdown message.

  • #10750 f3957c6 Thanks @haranishi! - Fix ChatTest.failNext scheduling a fault when its times option is zero.

  • #10611 e7f4493 Thanks @Marve10s! - Fix Chunk.fromIterable and TxChunk.fromIterable sharing the caller's array, so later changes to the array no longer change the chunk.

  • #10791 1c990e9 Thanks @brandon-julio-t! - Deliver workflow activity results when a reply is redelivered after a transient shard-ownership check failure or when attempts of the same activity run concurrently.

  • #10754 1cccb18 Thanks @RhysSullivan! - Expose each cron job's effective schedule through ClusterCron.CronSchedule, both inside execute and on the registered entity.

  • #10709 0d5eb2c Thanks @effect-bot! - Fix persisted Entity.keepAlive(true) requests completing prematurely on redelivery, preserving entity recovery after runner restarts.

  • #10704 6b8ea38 Thanks @gcanti! - Fix field discovery and type validation across struct comparisons, schemas, commands, and collection helpers to consistently handle own enumerable string and symbol fields.

    Some field maps declared with interface are no longer accepted. Replace interface Fields { ... } with type Fields = { ... }, or pass a plain object copy by replacing Order.Struct(fields) with Order.Struct({ ...fields }).

  • #10734 ff682e9 Thanks @effect-bot! - Add effect/crypto/Password for storing passwords as PHC strings. The Password service hashes with Argon2id or PBKDF2 from Kdf, verifies against the algorithm and salt recorded in the stored hash, and reports when a stored hash needs rehashing under the configured algorithm. Password.decode and Password.encode convert between PHC strings and PasswordHash values.

  • #10759 45937b7 Thanks @haranishi! - Decode empty CSV header cells according to the selected union member's optional fields.

  • #10562 cda1466 Thanks @asssslay! - Fix DateTime.make rejecting date strings that end in UT, UTC or a US time zone abbreviation such as PDT.

  • #10620 aa5047d Thanks @Marve10s! - Fix DateTime.make ignoring whitespace-separated time zones followed by trailing whitespace or a single non-nested comment.

  • #10690 8bc4e44 Thanks @mvanhorn! - Parse zoneless DateTime strings such as 2024-1-15 as UTC instead of local time.

  • #10581 c61bb44 Thanks @tim-smart! - Add unstable effect/chat APIs and Slack, Discord, WhatsApp, Telegram and Microsoft Teams adapters for chat bots, with grapheme-safe Markdown streaming, buttons, selects, modals, slash commands, private/deferred command replies, and adapter conformance testing.

  • #10675 5caf323 Thanks @tylergibbs1! - Fix SqlEventLogServerEncrypted on SQL Server stalling for seconds when two instances create the same tables at once.

  • #10583 19c76ab Thanks @brandon-julio-t! - Fix Atom.searchParam overwriting the restored URL when Back or Forward is pressed before a debounced write flushes.

  • #10585 c282e64 Thanks @tylergibbs1! - Fix an interrupted fiber losing its exit, such as a finalizer defect, when a child fiber does not stop immediately.

  • #10619 77fa72a Thanks @effect-bot! - Fix slow FindMyWay and HttpRouter lookups for request paths containing many encoded percent signs.

  • #10701 82904fe Thanks @Marve10s! - The Die variant of Schema.CauseReasonIso now declares defect instead of error, matching the existing runtime shape.

  • #10629 df790ca Thanks @effect-bot! - Fix ClusterWorkflowEngine activities repeatedly restarting after durable clock wakeups when using SQL storage.

  • #10646 1b807a0 Thanks @tim-smart! - Fix LayerRef.make and LayerRef.Service exposing layer build errors during creation when preload is omitted.

  • #10796 4d78900 Thanks @effect-bot! - Fix Effect.raceAll and Effect.raceAllFirst not interrupting a loser that settles the race during its own first synchronous step.

  • #10689 0799e39 Thanks @tim-smart! - Fix cluster shards remaining unavailable indefinitely when a runner's lock operations persistently fail while its heartbeat succeeds.

  • #10680 80622bf Thanks @effect-bot! - Fix Metric.summary and Metric.summaryWithTimestamp accepting NaN quantiles.

  • #10546 3d13d1e Thanks @effect-bot! - Fix intermittent SqlRunnerStorage advisory-lock failures after Vitess sessions have been idle.

  • #10735 e373f19 Thanks @effect-bot! - Fix Stream.flattenIterable not closing the active iterator when downstream stops early.

  • #10612 e3aed41 Thanks @Marve10s! - Fix HashMap and HashSet overflowing the stack for keys whose custom hashes are not 32-bit integers.

  • #10627 c49caf7 Thanks @effect-bot! - Fix HttpClient sending invalid trace headers when tracing is disabled with Effect.withTracerEnabled(false).

  • #10790 9f9d58b Thanks @effect-bot! - Add redactedParams to HttpRouter routes and params to HttpApi.RedactedNames to redact path params in server spans and request logs.

  • #10668 5234eed Thanks @0xh3x! - Fix HttpRouter.serve ignoring app-provided references and rebuilding app-provided layers when handling requests.

  • #10768 44f3b48 Thanks @effect-bot! - Fix HttpRouter so an explicit route takes precedence over a wildcard at its bare prefix, regardless of registration order.

  • #10699 31b0a19 Thanks @Marve10s! - Fix HttpApiClient failing to decode single-element arrays in form-urlencoded responses and declared errors.

  • #10724 b01d576 Thanks @effect-bot! - Avoid the startup cost of Intl.Segmenter for CLI commands that never measure text width.

  • #10567 7e155df Thanks @effect-bot! - Fix ConfigProvider.fromEnv() capturing the environment when called instead of at its first lookup, which ignored variables set after import.

    Variables removed before the first lookup are no longer captured; use ConfigProvider.fromEnvRecord({ ...process.env }) to snapshot at a chosen moment.

  • #10752 c74244b Thanks @RhysSullivan! - Fix McpServer to list tools with destructiveHint: false when Tool.Readonly is true and Tool.Destructive is unset.

  • #10740 0082c45 Thanks @typedrat! - Use a tool's toModelOutput parts as McpServer tool result content while preserving structuredContent and downgrading unsupported blocks on older protocol revisions.

  • #10751 e197c57 Thanks @RhysSullivan! - Fix McpServer toolkit registration copying and scanning its registration context once per tool, which made memory use and registration time grow with the square of the tool count.

  • #10733 313194d Thanks @effect-bot! - Allow McpServer.toolkit and McpServer.registerToolkit to return native MCP content blocks for selected tools without advertising an output schema.

  • #10624 ca8ffea Thanks @Marve10s! - Fix EventJournal.makeMemory dropping pending entries imported from another remote during an upload.

  • #10558 7f2919f Thanks @Ishkirat-Singh! - Fix Prompt.Int and Prompt.Number dropping the minus sign when a zero follows it, so typing -0.05 no longer submits 0.05.

  • #10763 f3961b9 Thanks @haranishi! - Generate client and HttpApi operations from local OpenAPI Path Item references.

  • #10698 c31cb76 Thanks @Marve10s! - Fix Order.Struct and Struct.makeOrder ignoring symbol fields when comparing and sorting records.

  • #10729 c239f40 Thanks @effect-bot! - Warn at the default log level when a failed OTLP export disables telemetry export for 60 seconds.

  • #10556 8a4ef37 Thanks @dv-waynehaffenden! - Fix OTLP exporters retaining a background fiber when exportInterval is infinite.

  • #10609 9ef7a47 Thanks @Marve10s! - Fix OtlpLogger exporting invalid trace and span IDs for logs inside spans with tracing or propagation disabled.

  • #10780 e5f2e97 Thanks @effect-bot! - Use Rpc.TracingEnabled to select automatic client and server spans per procedure and remoteParentSpan to parent custom handler or middleware spans.

    When invoking a handler or middleware directly, pass remoteParentSpan: undefined if no client span context was received.

  • #10543 acfbe1b Thanks @effect-bot! - Fix Pool.makeWithTTL usage-based expiration retaining idle excess resources beyond their configured time to live.

  • #9454 22909d5 Thanks @fubhy! - Add ProtobufDescriptor, ProtobufDescriptorProto, and ProtobufMessage for codecs preserving names and unknown fields across proto2, proto3, and editions 2023, 2024 and 2026.

    Replace reader.enter(); read(reader); reader.leave() with read(reader.delimited()). The child reader is bounded to the payload, and the parent advances past it immediately.

    ProtobufWriter.tag now throws RangeError for invalid tags; supply an integer field number from 1 through 536870911 and a wire type from 0 through 5.

  • #10554 5662efa Thanks @fubhy! - Add effect/protobuf with ProtobufReader and ProtobufWriter, a Schema-independent reader and writer of the protobuf wire format, and speed up OTLP protobuf serialization, which now writes log record trace and span ids given as a Uint8Array as those bytes instead of corrupting them.

  • #10737 a9b1998 Thanks @effect-bot! - Deliver the last item taken from a closing queue before notifying its waiters, so a waiter cannot interrupt the take before it returns the item.

  • #10727 b4803f0 Thanks @effect-bot! - Update HttpApiScalar.layer to Scalar 1.81.0: bundled docs omit the undeclared Accept: */* example header, honor customFetch, and support hiding Ask AI with agent.disabled; the unpacked package grows by about 3.7 MB.

  • #10605 689c1ba Thanks @Marve10s! - Fix HttpServerResponse.setStatus, removeHeader and the cookie combinators resetting explicit content-type and content-length headers to the body's values.

  • #10663 f12fefb Thanks @mugnivenko! - Serialize Result.Success under success instead of value in toJSON, JSON.stringify and Node inspection output, matching its success property. Code that reads value from a serialized Result should read success.

  • #10616 f18320b Thanks @effect-bot! - Add useSemicolonDelimiter and decodeStaticPath options to FindMyWay.RouterConfig, and a FindMyWay.strictConfig preset that turns off path normalization and matches static route text literally.

  • #10572 f89f473 Thanks @srid! - Fix a stalled RpcClient stream consumer blocking other responses and keepalive pings on its socket or worker connection.

  • #10579 7cb302b Thanks @roninjin10! - Keep RPC and MCP stdio servers answering after a malformed NDJSON line, replying with a JSON-RPC -32700 parse error and still handling the other frames. RpcSerialization's makeUnsafe accepts onDecodeError to receive malformed NDJSON frames instead of throwing, and a throwing NDJSON decode now discards its pending UTF-8 bytes.

  • #10753 ae947a3 Thanks @RhysSullivan! - Answer RpcServer requests over framed HTTP, and tools/call on McpServer.layerHttpRequestScoped, without waiting for scheduler rounds first.

  • #10658 cbe8b0e Thanks @effect-bot! - Fix RPC socket request and acknowledgement write failures to fail with RpcClientError instead of defects, preserving the socket error reason.

  • #10551 3fcc7fa Thanks @fubhy! - Speed up failed SchemaBinary decoding and encoding.

  • #10569 2402fe3 Thanks @gcanti! - Add the experimental Codegen.Module builder and fix recursive initialization, name collisions, generated types, and symbol identity in schema and OpenAPI generation.

    Remove SchemaRepresentation.toCodeDocument, CodeDocument, Artifact, and makeCode. Generate schema source with Codegen.Module.addSchemas and print; construct { runtime, Type } directly instead of calling makeCode.

    Custom toCode callbacks must interpolate supplied argument strings unchanged and return supported schema/type expressions. Move unsupported code, such as functions with local declarations, into imported helpers.

    The @effect/openapi-generator/OpenApiTransformer module is removed. Use the OpenApiGenerator service to generate from an OpenAPI spec, selecting the output with format.

    Some nullable OpenAI objects, such as Batch.errors, now strip undeclared fields and no longer expose index signatures; use their declared fields instead.

  • #10725 39bd6e0 Thanks @gcanti! - Report SchemaIssue.InvalidValue when SchemaGetter.encodeBase64, encodeBase64Url, encodeHex, or encodeUriComponent encounters an unpaired UTF-16 surrogate during encoding.

  • #10721 57c8873 Thanks @gcanti! - Encode negative zero as "-0" instead of "0" in Schema.NumberFromString, Schema.FiniteFromString, and numeric encodings derived with Schema.toCodecStringTree.

  • #10595 d28a692 Thanks @RhysSullivan! - Fix Semaphore taking quadratic time to drain a long queue of equally sized permit requests.

  • #10688 9851931 Thanks @effect-bot! - Wrap each SQL Migrator run in a Migrator.run tracing span with an effect.sql.migrator.table attribute, including runs with no pending migrations.

  • #10563 7ed0880 Thanks @asssslay! - Fix SQL Server updates failing in repositories created by SqlModel.makeRepository.

  • #10761 7ec6395 Thanks @haranishi! - Preserve completed SSE events when a later event exceeds the size limit in the same chunk.

  • #10561 101e58b Thanks @asssslay! - Fix Stream.filterEffect predicate indices restarting at each chunk instead of counting across the whole stream.

  • #10756 a2654f5 Thanks @haranishi! - Prevent Stream.groupBy and Stream.groupByKey from expiring groups while values are being queued.

  • #10614 9bb48ee Thanks @Marve10s! - Fix LanguageModel.streamText omitting approved and denied tool results when disableToolCallResolution is set, causing Chat.streamText to rerun approved tools on later turns.

  • #10638 ec2c12a Thanks @yuyongyan29-dev! - Preserve Unicode letters, combining marks, and numbers in String word-case helpers, including non-ASCII config keys.

  • #10549 fc69670 Thanks @fubhy! - Add String.isWellFormed and String.toWellFormed, which check for and replace unpaired UTF-16 surrogates with the native ES2024 methods when the runtime has them.

  • #10576 3ec2199 Thanks @jasonkuhrt! - Accept Schema.Enum parts in Schema.TemplateLiteral and Schema.TemplateLiteralParser, which threw "Invalid TemplateLiteral part Enum" although their types accepted them.

  • #10730 b246e24 Thanks @effect-bot! - Fail writes with a SocketError after an accepted socket's reader is released instead of waiting for a connection that cannot reopen.

  • #10682 8564843 Thanks @effect-bot! - Add TestConsole readers for captured warning, info, debug, and trace parameters.

  • #10517 88d028e Thanks @fubhy! - Add TextDiff.hunks, which groups a line diff into diff -u style hunks as data, optionally with the ranges that differ within changed lines.

  • #10760 fec20c5 Thanks @haranishi! - Traverse only matching branches when looking up keys, values, or entries by Trie prefix.

  • #10604 394e32b Thanks @Marve10s! - Fix Effect.tx spinning instead of waiting for a transactional value to change when its body recovers from Effect.txRetry.

  • #10628 c71de85 Thanks @effect-bot! - Add a websocket.highWaterMark inbound byte limit to the Bun, Deno, and Node HTTP servers. A WebSocket that cannot pause now stops reading and closes once Socket.fromWebSocket reports a highWaterMark overflow, and empty frames count as one byte. Deno WebSocket frames that arrive before the client closes are no longer lost.

  • #10781 b19b959 Thanks @effect-bot! - Allow PostgreSQL PersistedQueue offers to continue past the 32-bit sequence limit.

  • #10644 9f00fd5 Thanks @fubhy! - Add SharedMemory allocation and schemas for shared typed arrays in workers.

  • #10695 04e9e83 Thanks @Federaffo! - Fix Workflow.addFinalizer finalizers running before the workflow ends when a durable timer or deferred completes while another step is still running.

  • #10574 ff34753 Thanks @jpowersdev! - Fix Xml.decode to fail with a Syntax error instead of Unsupported when an encoding declaration contradicts the bytes, and to reject a US-ASCII declaration after a UTF-8 byte order mark instead of accepting it.

  • #10635 8745885 Thanks @jpowersdev! - Add a namespaces: "strict" option to Xml.decode and Xml.decodeString that reports the namespace and localName of each element and rejects documents that are not namespace-well-formed.

  • #10687 3058f01 Thanks @jpowersdev! - Add Xml.toEvents for writing an Xml.Element tree with Xml.encode or Xml.encodeString.

Don't miss a new effect release

NewReleases is sending notifications on new releases.