From 69cf3fbbd1a5f6a1b3c2501664ce89138417ac23 Mon Sep 17 00:00:00 2001 From: Julius Marminge <51714798+juliusmarminge@users.noreply.github.com> Date: Fri, 27 Nov 2026 00:48:30 -0800 Subject: [PATCH 1/3] chore(repos): sync effect to effect@4.1.6 Upstream: https://github.com/Effect-TS/effect.git 4cc54fe400f5107b5a418466c09dad5d0c618d78 --- .repos/effect/.github/workflows/check.yml | 10 +- .repos/effect/ai-docs/package.json | 4 +- .../annotations/effect__sql-pg__PgClient.yaml | 2 +- .repos/effect/migration/v3-to-v4.md | 2 +- .repos/effect/package.json | 20 +- .../packages/ai/amazon-bedrock/CHANGELOG.md | 7 + .../packages/ai/amazon-bedrock/package.json | 2 +- .../effect/packages/ai/anthropic/CHANGELOG.md | 10 + .../effect/packages/ai/anthropic/codegen.yml | 2 + .../effect/packages/ai/anthropic/package.json | 2 +- .../anthropic/src/AnthropicLanguageModel.ts | 30 +- .../packages/ai/anthropic/src/Generated.ts | 48 +- .../ai/anthropic/test/AnthropicClient.test.ts | 32 +- .../test/AnthropicLanguageModel.test.ts | 87 + .../packages/ai/cloudflare/CHANGELOG.md | 7 + .../packages/ai/cloudflare/package.json | 2 +- .../packages/ai/openai-compat/CHANGELOG.md | 7 + .../packages/ai/openai-compat/package.json | 2 +- .repos/effect/packages/ai/openai/CHANGELOG.md | 8 + .repos/effect/packages/ai/openai/package.json | 2 +- .../ai/openai/src/OpenAiLanguageModel.ts | 3 +- .../openai/test/OpenAiLanguageModel.test.ts | 28 +- .../packages/ai/openrouter/CHANGELOG.md | 8 + .../effect/packages/ai/openrouter/codegen.yml | 2 + .../packages/ai/openrouter/package.json | 2 +- .../packages/ai/openrouter/src/Generated.ts | 4 +- .../openrouter/src/OpenRouterLanguageModel.ts | 9 +- .../test/OpenRouterLanguageModel.test.ts | 19 + .../effect/packages/ai/typesafe/CHANGELOG.md | 7 + .../effect/packages/ai/typesafe/package.json | 2 +- .../effect/packages/atom/react/CHANGELOG.md | 7 + .../effect/packages/atom/react/package.json | 4 +- .../effect/packages/atom/solid/CHANGELOG.md | 7 + .../effect/packages/atom/solid/package.json | 4 +- .repos/effect/packages/atom/vue/CHANGELOG.md | 7 + .repos/effect/packages/atom/vue/package.json | 4 +- .../effect/packages/chat/discord/CHANGELOG.md | 7 + .../effect/packages/chat/discord/package.json | 2 +- .../effect/packages/chat/slack/CHANGELOG.md | 7 + .../effect/packages/chat/slack/package.json | 2 +- .../effect/packages/chat/teams/CHANGELOG.md | 7 + .../effect/packages/chat/teams/package.json | 2 +- .../packages/chat/telegram/CHANGELOG.md | 7 + .../packages/chat/telegram/package.json | 2 +- .../packages/chat/whatsapp/CHANGELOG.md | 7 + .../packages/chat/whatsapp/package.json | 2 +- .repos/effect/packages/effect/CHANGELOG.md | 97 + .repos/effect/packages/effect/package.json | 6 +- .repos/effect/packages/effect/src/Channel.ts | 75 +- .repos/effect/packages/effect/src/Codegen.ts | 9 +- .repos/effect/packages/effect/src/Effect.ts | 162 +- .repos/effect/packages/effect/src/Equal.ts | 164 +- .repos/effect/packages/effect/src/Hash.ts | 52 +- .repos/effect/packages/effect/src/LayerRef.ts | 10 +- .repos/effect/packages/effect/src/Logger.ts | 55 +- .repos/effect/packages/effect/src/Match.ts | 128 +- .repos/effect/packages/effect/src/Order.ts | 2 +- .repos/effect/packages/effect/src/Schema.ts | 375 +--- .../effect/packages/effect/src/SchemaAST.ts | 1 - .../effect/packages/effect/src/ScopedCache.ts | 10 +- .repos/effect/packages/effect/src/Stream.ts | 160 +- .repos/effect/packages/effect/src/String.ts | 2 +- .repos/effect/packages/effect/src/Tracer.ts | 10 + .../packages/effect/src/ai/McpServer.ts | 31 +- .../effect/packages/effect/src/ai/Prompt.ts | 23 +- .repos/effect/packages/effect/src/ai/Skill.ts | 236 ++ .repos/effect/packages/effect/src/ai/index.ts | 6 + .../src/cluster/ClusterWorkflowEngine.ts | 268 ++- .../effect/src/cluster/MessageStorage.ts | 53 +- .../effect/src/cluster/SqlMessageStorage.ts | 115 +- .../src/cluster/internal/entityActivation.ts | 6 + .../src/cluster/internal/entityManager.ts | 12 +- .../packages/effect/src/encoding/Base64.ts | 6 +- .../packages/effect/src/encoding/Base64Url.ts | 7 +- .../packages/effect/src/encoding/Xml.ts | 122 +- .../packages/effect/src/http-api/HttpApi.ts | 37 +- .../effect/src/http-api/HttpApiBuilder.ts | 9 +- .../effect/src/http-api/HttpApiClient.ts | 37 +- .../src/http-api/internal/redactedKeys.ts | 40 + .../effect/src/http/FetchHttpClient.ts | 13 +- .../packages/effect/src/http/Headers.ts | 262 ++- .../packages/effect/src/http/HttpClient.ts | 26 +- .../effect/src/http/HttpClientError.ts | 51 +- .../effect/src/http/HttpClientRequest.ts | 23 + .../effect/src/http/HttpClientResponse.ts | 86 + .../effect/src/http/HttpMiddleware.ts | 2 +- .../effect/src/http/HttpServerResponse.ts | 50 + .../packages/effect/src/http/Multipart.ts | 5 - .../MultipartParser/internal/contentType.ts | 2 +- .../effect/src/http/internal/clientPath.ts | 39 + .../effect/src/http/internal/redactedPath.ts | 4 + .../effect/src/http/internal/tracing.ts | 9 +- .../packages/effect/src/internal/base64.ts | 59 +- .../packages/effect/src/internal/dateTime.ts | 67 +- .../packages/effect/src/internal/effect.ts | 133 +- .../packages/effect/src/internal/equal.ts | 54 +- .../packages/effect/src/internal/hash.ts | 6 +- .../packages/effect/src/internal/matcher.ts | 147 +- .../src/internal/schema/schemaCodegen.ts | 9 +- .../internal/schema/schemaCodegenBuiltIns.ts | 343 +++ .../src/internal/schema/toEquivalence.ts | 8 +- .../packages/effect/src/internal/version.ts | 2 +- .../packages/effect/src/jose/JoseError.ts | 34 + .../effect/src/jose/internal/compact.ts | 19 +- .../packages/effect/src/observability/Otlp.ts | 29 + .../effect/src/observability/OtlpExporter.ts | 281 ++- .../effect/src/observability/OtlpLogger.ts | 26 +- .../effect/src/observability/OtlpMetrics.ts | 2 + .../effect/src/observability/OtlpTracer.ts | 27 +- .../effect/src/persistence/KeyValueStore.ts | 31 +- .../packages/effect/src/reactivity/Atom.ts | 30 +- .../packages/effect/src/rpc/RpcClient.ts | 27 +- .../packages/effect/src/rpc/RpcGroup.ts | 5 +- .../packages/effect/src/sql/Migrator.ts | 13 +- .../packages/effect/src/sql/SqlClient.ts | 22 +- .../packages/effect/src/workflow/Activity.ts | 20 +- .../packages/effect/src/workflow/Workflow.ts | 112 +- .../effect/src/workflow/WorkflowEngine.ts | 53 +- .../effect/src/workflow/internal/retry.ts | 12 + .../effect/src/workflow/internal/scope.ts | 36 + .../packages/effect/test/Channel.test.ts | 22 + .../packages/effect/test/DateTime.test.ts | 19 + .../packages/effect/test/Effect.test.ts | 22 + .../effect/packages/effect/test/Equal.test.ts | 136 ++ .../effect/packages/effect/test/Fiber.test.ts | 34 +- .../packages/effect/test/LayerRef.test.ts | 50 + .../packages/effect/test/Logger.test.ts | 23 + .../effect/packages/effect/test/Match.test.ts | 38 + .../effect/packages/effect/test/Order.test.ts | 19 + .../packages/effect/test/ScopedCache.test.ts | 15 + .../packages/effect/test/Stream.test.ts | 94 + .../packages/effect/test/String.test.ts | 8 + .../packages/effect/test/Tracer.test.ts | 28 +- .../packages/effect/test/ai/Chat.test.ts | 43 + .../McpConformance/ElicitationTest.ts | 24 +- .../McpServer/McpConformance/McpTestPeer.ts | 12 - .../ai/McpServer/McpConformance/RootsTest.ts | 16 +- .../McpServer/McpConformance/SamplingTest.ts | 34 +- .../effect/test/ai/McpServer/Skills.test.ts | 37 + .../packages/effect/test/ai/Prompt.test.ts | 16 +- .../packages/effect/test/ai/Skill.test.ts | 98 + .../cluster/ClusterWorkflowEngine.test.ts | 442 +++- .../test/cluster/MessageStorage.test.ts | 60 + .../effect/test/cluster/Sharding.test.ts | 44 + .../effect/test/crypto/Schema.test.ts | 32 + .../effect/test/encoding/Base64.test.ts | 20 +- .../effect/test/encoding/Base64Url.test.ts | 20 +- .../packages/effect/test/encoding/Xml.test.ts | 50 +- .../effect/test/http/FetchHttpClient.test.ts | 37 +- .../packages/effect/test/http/Headers.test.ts | 67 + .../effect/test/http/HttpClient.test.ts | 21 + .../test/http/HttpClientRequest.test.ts | 11 + .../effect/test/http/HttpMiddleware.test.ts | 16 + .../test/http/HttpServerResponse.test.ts | 12 + .../test/http/SchemaRepresentation.test.ts | 16 +- .../test/httpapi/HttpApiBuilder.test.ts | 100 + .../effect/test/httpapi/HttpApiClient.test.ts | 173 +- .../packages/effect/test/jose/Jws.test.ts | 58 +- .../test/observability/OtlpConfig.test.ts | 52 +- .../test/observability/OtlpExporter.test.ts | 536 ++++- .../test/observability/OtlpLogger.test.ts | 14 +- .../test/observability/OtlpMetrics.test.ts | 12 +- .../test/persistence/KeyValueStoreTest.ts | 2 +- .../test/persistence/PersistedQueueSqlTest.ts | 27 +- .../test/persistence/PersistedQueueTest.ts | 38 +- .../test/process/ChildProcessSpawnerTest.ts | 52 +- .../effect/test/reactivity/Atom.test.ts | 80 +- .../packages/effect/test/rpc/Rpc.test.ts | 8 + .../effect/test/rpc/RpcClient.test.ts | 142 +- .../representation/builtInRevivers.test.ts | 13 +- .../codegen.annotations.test.ts | 75 +- .../schema/representation/codegen.test.ts | 16 + .../effect/test/schema/toEquivalence.test.ts | 23 + .../effect/test/sql/SqlClient.test.ts | 66 +- .../packages/effect/test/utils/encoding.ts | 31 +- .../effect/test/workflow/Workflow.test.ts | 68 +- .../test/workflow/WorkflowEngine.test.ts | 478 ++++- .../packages/effect/typetest/Effect.tst.ts | 167 ++ .../packages/effect/typetest/Match.tst.ts | 32 + .../effect/typetest/ai/McpServer.tst.ts | 17 +- .../packages/opentelemetry/CHANGELOG.md | 7 + .../packages/opentelemetry/package.json | 2 +- .../packages/platform/browser/CHANGELOG.md | 7 + .../packages/platform/browser/package.json | 2 +- .../effect/packages/platform/bun/CHANGELOG.md | 9 + .../effect/packages/platform/bun/package.json | 6 +- .../bun/src/BunChildProcessSpawner.ts | 29 +- .../platform/bun/src/BunHttpPlatform.ts | 12 +- .../platform/bun/test/BunHttpPlatform.test.ts | 8 + .../packages/platform/cloudflare/CHANGELOG.md | 20 + .../packages/platform/cloudflare/README.md | 15 + .../packages/platform/cloudflare/package.json | 4 +- .../src/AlchemyCloudflareCluster.ts | 11 +- .../src/CloudflareDurableObjectPrograms.ts | 31 +- .../cloudflare/src/internal/alchemyCluster.ts | 22 +- .../src/internal/workflowRuntime.ts | 167 +- .../src/internal/workflowStorage.ts | 112 +- .../test/AlchemyCloudflareCluster.test.ts | 50 +- .../CloudflareDurableObjectPrograms.test.ts | 209 +- .../test/CloudflareWorkflowEngine.test.ts | 377 +++- .../packages/platform/deno/CHANGELOG.md | 8 + .../packages/platform/deno/package.json | 6 +- .../platform/node-shared/CHANGELOG.md | 18 + .../platform/node-shared/package.json | 8 +- .../scripts/generateProxyProcessSource.ts | 43 + .../node-shared/src/NodeChildProcessProxy.ts | 62 + .../src/NodeChildProcessSpawner.ts | 295 ++- .../node-shared/src/NodeFileSystem.ts | 123 +- .../platform/node-shared/src/NodeStdio.ts | 47 +- .../platform/node-shared/src/index.ts | 6 + .../src/internal/nodeChildProcessSpawner.ts | 36 + .../node-shared/src/internal/proxyProcess.ts | 548 +++++ .../src/internal/proxyProcessSource.ts | 96 + .../src/internal/proxyProcessWorker.ts | 101 + .../test/NodeChildProcessSpawner.test.ts | 448 +++- .../node-shared/test/NodeFileSystem.test.ts | 40 +- .../node-shared/test/NodeStdio.test.ts | 26 + .../node-shared/test/fixtures/node-stdio.ts | 18 + .../node-shared/test/fixtures/proxy-cli.ts | 20 + .../packages/platform/node/CHANGELOG.md | 11 + .../packages/platform/node/package.json | 14 +- .../node/src/NodeChildProcessProxy.ts | 9 + .../packages/platform/node/src/index.ts | 6 + .../platform/node/test/KeyValueStore.test.ts | 17 + .../platform/node/test/NodeHttpClient.test.ts | 7 +- .../node/test/NodeRedis.integration.test.ts | 2 +- .../SqlMessageStorage.integration.test.ts | 109 +- .../packages/sql/clickhouse/CHANGELOG.md | 8 + .../packages/sql/clickhouse/package.json | 2 +- .repos/effect/packages/sql/d1/CHANGELOG.md | 10 + .repos/effect/packages/sql/d1/package.json | 4 +- .repos/effect/packages/sql/d1/src/D1Client.ts | 16 +- .../packages/sql/d1/test/Client.test.ts | 22 + .../effect/packages/sql/libsql/CHANGELOG.md | 7 + .../effect/packages/sql/libsql/package.json | 4 +- .repos/effect/packages/sql/mssql/CHANGELOG.md | 10 + .repos/effect/packages/sql/mssql/package.json | 6 +- .../packages/sql/mssql/src/MssqlClient.ts | 13 + .../packages/sql/mssql/test/Client.test.ts | 19 +- .../test/Persistence.integration.test.ts | 6 +- .../effect/packages/sql/mysql2/CHANGELOG.md | 7 + .../effect/packages/sql/mysql2/package.json | 4 +- .../test/Persistence.integration.test.ts | 4 +- .repos/effect/packages/sql/pg/CHANGELOG.md | 18 + .repos/effect/packages/sql/pg/README.md | 28 +- .repos/effect/packages/sql/pg/package.json | 8 +- .repos/effect/packages/sql/pg/src/PgClient.ts | 115 +- .../packages/sql/pg/src/PgConnection.ts | 197 +- .repos/effect/packages/sql/pg/src/PgPool.ts | 151 +- .../effect/packages/sql/pg/src/PgProtocol.ts | 6 +- .repos/effect/packages/sql/pg/src/PgTypes.ts | 392 +++- .../sql/pg/src/internal/connection.ts | 2 + .../sql/pg/test/Client.integration.test.ts | 71 +- .../sql/pg/test/ContainerTeardown.test.ts | 98 +- .../pg/test/Persistence.integration.test.ts | 31 +- .../pg/test/PgConnection.in-process.test.ts | 126 +- .../pg/test/PgConnection.integration.test.ts | 33 + .../sql/pg/test/PgPool.in-process.test.ts | 184 +- .../packages/sql/pg/test/PgProtocol.test.ts | 6 +- .../packages/sql/pg/test/PgTypes.test.ts | 83 + .repos/effect/packages/sql/pg/test/utils.ts | 41 +- .../effect/packages/sql/pglite/CHANGELOG.md | 8 + .../effect/packages/sql/pglite/package.json | 4 +- .../packages/sql/sqlite-bun/CHANGELOG.md | 7 + .../packages/sql/sqlite-bun/package.json | 4 +- .../packages/sql/sqlite-do/CHANGELOG.md | 7 + .../packages/sql/sqlite-do/package.json | 4 +- .../packages/sql/sqlite-node/CHANGELOG.md | 7 + .../packages/sql/sqlite-node/package.json | 2 +- .../sqlite-node/test/PersistedQueue.test.ts | 22 + .../sql/sqlite-node/test/Persistence.test.ts | 13 +- .../sqlite-node/test/SqliteMigrator.test.ts | 22 + .../sql/sqlite-react-native/CHANGELOG.md | 7 + .../sql/sqlite-react-native/package.json | 2 +- .../packages/sql/sqlite-wasm/CHANGELOG.md | 7 + .../packages/sql/sqlite-wasm/package.json | 2 +- .../effect/packages/tools/bundle/package.json | 4 +- .../effect/packages/tools/docgen/CHANGELOG.md | 8 + .../effect/packages/tools/docgen/package.json | 2 +- .../packages/tools/doctest/CHANGELOG.md | 8 + .../packages/tools/doctest/package.json | 4 +- .../tools/graphql-generator/CHANGELOG.md | 8 + .../tools/graphql-generator/package.json | 2 +- .../tools/openapi-generator/CHANGELOG.md | 52 + .../tools/openapi-generator/package.json | 4 +- .../src/HttpApiTransformer.ts | 113 +- .../src/JsonSchemaGenerator.ts | 109 +- .../openapi-generator/src/OpenApiGenerator.ts | 164 +- .../tools/openapi-generator/src/main.ts | 4 +- .../test/OpenApiGenerator.test.ts | 266 ++- .repos/effect/packages/tools/oxc/package.json | 2 +- .repos/effect/packages/vitest/CHANGELOG.md | 7 + .repos/effect/packages/vitest/package.json | 2 +- .repos/effect/pnpm-lock.yaml | 1895 ++++++++--------- .repos/effect/pnpm-workspace.yaml | 2 +- 295 files changed, 13124 insertions(+), 3475 deletions(-) create mode 100644 .repos/effect/packages/effect/src/ai/Skill.ts create mode 100644 .repos/effect/packages/effect/src/http-api/internal/redactedKeys.ts create mode 100644 .repos/effect/packages/effect/src/http/internal/clientPath.ts create mode 100644 .repos/effect/packages/effect/src/internal/schema/schemaCodegenBuiltIns.ts create mode 100644 .repos/effect/packages/effect/src/workflow/internal/retry.ts create mode 100644 .repos/effect/packages/effect/src/workflow/internal/scope.ts create mode 100644 .repos/effect/packages/effect/test/ai/Skill.test.ts create mode 100644 .repos/effect/packages/platform/node-shared/scripts/generateProxyProcessSource.ts create mode 100644 .repos/effect/packages/platform/node-shared/src/NodeChildProcessProxy.ts create mode 100644 .repos/effect/packages/platform/node-shared/src/internal/proxyProcess.ts create mode 100644 .repos/effect/packages/platform/node-shared/src/internal/proxyProcessSource.ts create mode 100644 .repos/effect/packages/platform/node-shared/src/internal/proxyProcessWorker.ts create mode 100644 .repos/effect/packages/platform/node-shared/test/fixtures/node-stdio.ts create mode 100644 .repos/effect/packages/platform/node-shared/test/fixtures/proxy-cli.ts create mode 100644 .repos/effect/packages/platform/node/src/NodeChildProcessProxy.ts create mode 100644 .repos/effect/packages/sql/sqlite-node/test/PersistedQueue.test.ts diff --git a/.repos/effect/.github/workflows/check.yml b/.repos/effect/.github/workflows/check.yml index 1bb71e099cd11..d679063384c71 100644 --- a/.repos/effect/.github/workflows/check.yml +++ b/.repos/effect/.github/workflows/check.yml @@ -175,10 +175,12 @@ jobs: - runtime: Deno deno: v2.9.6 bun: "" + pg-lifecycle: true command: deno task test --max-concurrency=10 - runtime: Bun deno: "" bun: 1.4.0 + pg-lifecycle: true command: bun run --bun vitest run --max-concurrency=10 steps: - uses: actions/checkout@d23441a48e516b6c34aea4fa41551a30e30af803 # v6 @@ -200,10 +202,10 @@ jobs: deno-version: ${{ matrix.deno }} bun-version: ${{ matrix.bun }} - name: Test - if: matrix.runtime != 'Deno' + if: ${{ !matrix.pg-lifecycle }} run: ${{ matrix.command }} - name: Test with PostgreSQL lifecycle capture - if: matrix.runtime == 'Deno' + if: matrix.pg-lifecycle shell: bash env: PG_LIFECYCLE_DIAGNOSTICS: "1" @@ -227,10 +229,10 @@ jobs: trap 'exit 143' TERM ${{ matrix.command }} 2>&1 | tee "$capture_dir/tests.log" - name: Upload PostgreSQL lifecycle diagnostics - if: always() && matrix.runtime == 'Deno' && (failure() || cancelled()) + if: always() && matrix.pg-lifecycle && (failure() || cancelled()) uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7 with: - name: deno-pg-lifecycle-${{ github.run_attempt }} + name: ${{ matrix.runtime }}-pg-lifecycle-${{ github.run_attempt }} path: ${{ runner.temp }}/pg-lifecycle if-no-files-found: warn diff --git a/.repos/effect/ai-docs/package.json b/.repos/effect/ai-docs/package.json index 7fa0d5cf96217..94928fa6fc593 100644 --- a/.repos/effect/ai-docs/package.json +++ b/.repos/effect/ai-docs/package.json @@ -27,8 +27,8 @@ "@effect/sql-sqlite-wasm": "workspace:*", "@effect/vitest": "workspace:*", "effect": "workspace:*", - "hono": "^4.13.18", - "nodemailer": "^10.5.0" + "hono": "^4.13.19", + "nodemailer": "^10.6.1" }, "devDependencies": { "@types/nodemailer": "^8.0.2" diff --git a/.repos/effect/migration/annotations/effect__sql-pg__PgClient.yaml b/.repos/effect/migration/annotations/effect__sql-pg__PgClient.yaml index 476d929b42aea..914652a9df1e9 100644 --- a/.repos/effect/migration/annotations/effect__sql-pg__PgClient.yaml +++ b/.repos/effect/migration/annotations/effect__sql-pg__PgClient.yaml @@ -10,7 +10,7 @@ "@effect/sql-pg/PgClient#PgClientConfig": include: true replacement: "@effect/sql-pg/PgClient#PgClientConfig / PgPoolConfig" - note: "Use PgClientConfig for base settings and PgPoolConfig for make/layer; pool sizing, idle timeout, and connection TTL moved to PgPoolConfig. v3 connectTimeout also bounded waits for a free pooled connection through node-pg; v4 connectTimeout covers only opening a connection, so set acquireTimeout to fail with ConnectionError when the pool stays exhausted. The types option takes a PgTypes.Registry rather than node-pg custom types. Timestamp and timestamptz results (including array elements) are Date values with millisecond precision; infinity, -infinity, and out-of-range values become invalid Dates. Numeric readers can use getTime() or register numeric codecs. Date parameters bind as timestamptz; use PgTypes.timestamp(value) to preserve UTC fields when writing a timestamp column instead of applying the session TimeZone." + note: "Use PgClientConfig for base settings and PgPoolConfig for make/layer; pool sizing, idle timeout, and connection TTL moved to PgPoolConfig. v3 connectTimeout also bounded waits for a free pooled connection through node-pg; v4 connectTimeout covers only opening a connection, so set acquireTimeout to fail with ConnectionError when the pool stays exhausted. The types option takes a PgTypes.Registry rather than node-pg custom types. Timestamp and timestamptz results (including array elements) are Date values with millisecond precision; infinity, -infinity, and out-of-range values become invalid Dates. Numeric readers can use getTime() or register numeric codecs. Date parameters bind as timestamptz; use PgTypes.timestamp(value) to preserve UTC fields when writing a timestamp column instead of applying the session TimeZone. Built-in range and multirange results (and arrays of both) are PgTypes.Range values and arrays of them where v3 returned text; cast to ::text if you need the server's text formatting." "@effect/sql-pg/PgClient#PgClientFromPoolOptions": replacement: none note: "The node-pg Pool wrapper options were removed with fromPool. Use PgClient.PgPoolConfig with PgClient.make or PgClient.layer." diff --git a/.repos/effect/migration/v3-to-v4.md b/.repos/effect/migration/v3-to-v4.md index 10c9967c895be..b4746f21bd769 100644 --- a/.repos/effect/migration/v3-to-v4.md +++ b/.repos/effect/migration/v3-to-v4.md @@ -8237,7 +8237,7 @@ effect/rpc/Utils (barrel: effect/rpc) - `PgClient.PgClient` -> `@effect/sql-pg/PgClient#PgClient`: Retained; the service value is now a Context.Service. The listen method returns a scoped Effect acquiring a Queue.Dequeue\; consume it with Queue operations or Stream.fromQueue and read each notification's payload. Connection failures after registration fail the queue with the original SqlError; scope closure interrupts consumers. The PgClient interface no longer extends SqlClient.SqlClient. Yielding the service still gives PgClient & SqlClient, but an effect that requires PgClient no longer type-checks against a SqlClient requirement annotation, and a SqlClient-only layer no longer satisfies PgClient. Annotate a layer chosen between drivers as Layer.Layer\. -- `PgClient.PgClientConfig` -> `@effect/sql-pg/PgClient#PgClientConfig / PgPoolConfig`: Use PgClientConfig for base settings and PgPoolConfig for make/layer; pool sizing, idle timeout, and connection TTL moved to PgPoolConfig. v3 connectTimeout also bounded waits for a free pooled connection through node-pg; v4 connectTimeout covers only opening a connection, so set acquireTimeout to fail with ConnectionError when the pool stays exhausted. The types option takes a PgTypes.Registry rather than node-pg custom types. Timestamp and timestamptz results (including array elements) are Date values with millisecond precision; infinity, -infinity, and out-of-range values become invalid Dates. Numeric readers can use getTime() or register numeric codecs. Date parameters bind as timestamptz; use PgTypes.timestamp(value) to preserve UTC fields when writing a timestamp column instead of applying the session TimeZone. +- `PgClient.PgClientConfig` -> `@effect/sql-pg/PgClient#PgClientConfig / PgPoolConfig`: Use PgClientConfig for base settings and PgPoolConfig for make/layer; pool sizing, idle timeout, and connection TTL moved to PgPoolConfig. v3 connectTimeout also bounded waits for a free pooled connection through node-pg; v4 connectTimeout covers only opening a connection, so set acquireTimeout to fail with ConnectionError when the pool stays exhausted. The types option takes a PgTypes.Registry rather than node-pg custom types. Timestamp and timestamptz results (including array elements) are Date values with millisecond precision; infinity, -infinity, and out-of-range values become invalid Dates. Numeric readers can use getTime() or register numeric codecs. Date parameters bind as timestamptz; use PgTypes.timestamp(value) to preserve UTC fields when writing a timestamp column instead of applying the session TimeZone. Built-in range and multirange results (and arrays of both) are PgTypes.Range values and arrays of them where v3 returned text; cast to ::text if you need the server's text formatting. - `PgClient.PgClientFromPoolOptions` -> `none`: The node-pg Pool wrapper options were removed with fromPool. Use PgClient.PgPoolConfig with PgClient.make or PgClient.layer. diff --git a/.repos/effect/package.json b/.repos/effect/package.json index 37ea98d265ea3..a7ede8cd76ec1 100644 --- a/.repos/effect/package.json +++ b/.repos/effect/package.json @@ -37,9 +37,9 @@ }, "devDependencies": { "@babel/cli": "^8.1.0", - "@babel/core": "^8.1.2", - "@babel/plugin-transform-export-namespace-from": "^8.1.0", - "@babel/plugin-transform-modules-commonjs": "^8.1.2", + "@babel/core": "^8.1.3", + "@babel/plugin-transform-export-namespace-from": "^8.1.3", + "@babel/plugin-transform-modules-commonjs": "^8.1.3", "@changesets/changelog-github": "1.0.1", "@changesets/cli": "3.0.3", "@effect/ai-docgen": "workspace:^", @@ -48,7 +48,7 @@ "@effect/doctest": "workspace:^", "@effect/jsdocs": "workspace:^", "@effect/oxc": "workspace:^", - "@effect/tsgo": "^0.69.0", + "@effect/tsgo": "^0.73.2", "@effect/utils": "workspace:^", "@effect/vitest": "workspace:^", "@faker-js/faker": "^10.6.0", @@ -61,21 +61,21 @@ "@vitest/web-worker": "^5.1.0", "ast-types": "^0.16.3", "babel-plugin-annotate-pure-calls": "^0.5.0", - "dprint": "^0.64.3", - "fast-check": "^4.10.2", + "dprint": "^0.65.0", + "fast-check": "^4.10.3", "glob": "^14.0.6", "happy-dom": "^21.0.4", "jscodeshift": "^17.4.0", "lalph": "^0.3.139", "madge": "^8.0.0", - "oxlint": "^1.93.0", - "pkg-pr-new": "0.0.93", + "oxlint": "^1.94.0", + "pkg-pr-new": "0.0.94", "playwright": "^1.65.1", - "rollup": "^4.68.3", + "rollup": "^4.68.8", "rollup-plugin-bundle-stats": "^4.23.1", "rollup-plugin-esbuild": "^6.2.1", "rollup-plugin-visualizer": "^7.1.3", - "terser": "^5.51.2", + "terser": "^5.51.4", "tstyche": "^7.2.5", "typescript": "^7.0.2", "vite": "^8.3.8", diff --git a/.repos/effect/packages/ai/amazon-bedrock/CHANGELOG.md b/.repos/effect/packages/ai/amazon-bedrock/CHANGELOG.md index cb421298dbebc..83030cd088c30 100644 --- a/.repos/effect/packages/ai/amazon-bedrock/CHANGELOG.md +++ b/.repos/effect/packages/ai/amazon-bedrock/CHANGELOG.md @@ -1,5 +1,12 @@ # @effect/ai-amazon-bedrock +## 4.1.6 + +### Patch Changes + +- Updated dependencies [[`dd5f2f3`](https://github.com/Effect-TS/effect/commit/dd5f2f322fbad042a3a186cef593bf42affe5ce9), [`1d65846`](https://github.com/Effect-TS/effect/commit/1d65846308a6a18c4a95af543988ad30b72ff2b3), [`694c28f`](https://github.com/Effect-TS/effect/commit/694c28f0cfc3eac33f71160d18dda95cb670f506), [`5aaa2cd`](https://github.com/Effect-TS/effect/commit/5aaa2cd216e5e55f92d06db98d4b54946a396eed), [`55814bf`](https://github.com/Effect-TS/effect/commit/55814bf0a780f05ed0a51c82c8affda5d539bb0e), [`92c40a1`](https://github.com/Effect-TS/effect/commit/92c40a1f96a59f9edcacee6c0d6f6fb80397ee17), [`9f415a7`](https://github.com/Effect-TS/effect/commit/9f415a7733cdf8aed7efadbed3b5db22890e164a), [`e367afd`](https://github.com/Effect-TS/effect/commit/e367afdacfa3041a694a67e4670e98a20e41d45c), [`d5d2112`](https://github.com/Effect-TS/effect/commit/d5d21120ff591fcf8da006ce340010812cc91f16), [`fa2e5af`](https://github.com/Effect-TS/effect/commit/fa2e5af4ccc8f3650d97049707be82eab098c168), [`6bf6427`](https://github.com/Effect-TS/effect/commit/6bf6427d195539c387c13156aff79db077929c8f), [`10bc4a4`](https://github.com/Effect-TS/effect/commit/10bc4a47c0ce5bc50ba1998d63a803e3887d1d2b), [`a9540d3`](https://github.com/Effect-TS/effect/commit/a9540d3d50fbe65ade7f9b2f478cdd34a888161e), [`3a250d7`](https://github.com/Effect-TS/effect/commit/3a250d7eb8c310bf4751b3eca0038cf50e1629d8), [`ce44141`](https://github.com/Effect-TS/effect/commit/ce44141ad1bc8d05f3f7399bfa1e87772573205d), [`9318e5b`](https://github.com/Effect-TS/effect/commit/9318e5bafb144ddff65a0bff0148ec4f7ba77b5c), [`c9ecebf`](https://github.com/Effect-TS/effect/commit/c9ecebf7ede8a98895552fd20223d6573bd846fe), [`32f8fbe`](https://github.com/Effect-TS/effect/commit/32f8fbe1a5985aea41754e87531e9a1d0fbf78ec), [`41d6af1`](https://github.com/Effect-TS/effect/commit/41d6af14b7f36e06ade3bf7333b710e73de1e1c2), [`c33fd59`](https://github.com/Effect-TS/effect/commit/c33fd599cb7d49117f77f7bd8f05cb4209112a34), [`1f9e9d3`](https://github.com/Effect-TS/effect/commit/1f9e9d3de552435de6b8f4e1166515d0964c3999), [`594fa71`](https://github.com/Effect-TS/effect/commit/594fa71da417bf94fa6c9be2d3d36c808197e9fe), [`b378c38`](https://github.com/Effect-TS/effect/commit/b378c383cdb29e819e24da5dc725479a2ba4fdf1), [`a9ec9a6`](https://github.com/Effect-TS/effect/commit/a9ec9a60bbe1309960e00527ab62342dce1a86fc), [`310a81b`](https://github.com/Effect-TS/effect/commit/310a81b391e24d42b6608b5e3d641eca63e0d4c0), [`aab2135`](https://github.com/Effect-TS/effect/commit/aab2135d3fe43d4d86c4e486ed378797314fb212), [`6744a72`](https://github.com/Effect-TS/effect/commit/6744a724869539fc2d733929df871ef523bf82e8), [`848d042`](https://github.com/Effect-TS/effect/commit/848d0426f287b3e7ff970219d980a4c66fa441ad), [`077a93e`](https://github.com/Effect-TS/effect/commit/077a93e5db3adbc42e531539cb12b8bdbdfe5328), [`aef50fb`](https://github.com/Effect-TS/effect/commit/aef50fb8b56ec9ff8116f157635579fefd995f26), [`2e4de86`](https://github.com/Effect-TS/effect/commit/2e4de8634431f3da08ca2a90ab1024ee08e216f3), [`482b104`](https://github.com/Effect-TS/effect/commit/482b104caf712a8d5f99aafc64e55b6ea38eb809), [`753e1ed`](https://github.com/Effect-TS/effect/commit/753e1ed88069f73103d136dcdc58188fd10efdf1), [`0d2bb4a`](https://github.com/Effect-TS/effect/commit/0d2bb4a4b6526e1767b81101ee6e8da88ba1de55), [`8161e03`](https://github.com/Effect-TS/effect/commit/8161e03c26d691502afeddcf7e2ee75e6931637f), [`49f5391`](https://github.com/Effect-TS/effect/commit/49f53918a150aa2ea0ce2d444400cec1d6097400), [`3d59bdf`](https://github.com/Effect-TS/effect/commit/3d59bdf6f8f95ceea2091e5b8f375b834a14b3b1), [`8866608`](https://github.com/Effect-TS/effect/commit/88666082f2b6296bb7115bd4a2546151039f64db), [`69fd4b1`](https://github.com/Effect-TS/effect/commit/69fd4b1fba9e2ec5e7c16058ff8d9a1f9a38d90e), [`7d97626`](https://github.com/Effect-TS/effect/commit/7d9762658e515807c2b98678e7abd3ebe94e41ec), [`0e79436`](https://github.com/Effect-TS/effect/commit/0e794366658bd067a2212ea2ac7ed0223904ed31), [`2f8a4e9`](https://github.com/Effect-TS/effect/commit/2f8a4e9b90822d9facfef59027b35819c42d7b48), [`800b753`](https://github.com/Effect-TS/effect/commit/800b7535b4e37a24ac458cae78231054dae0b0f5)]: + - effect@4.1.6 + ## 4.1.5 ### Patch Changes diff --git a/.repos/effect/packages/ai/amazon-bedrock/package.json b/.repos/effect/packages/ai/amazon-bedrock/package.json index 6ed8f413e53d3..18f2958337417 100644 --- a/.repos/effect/packages/ai/amazon-bedrock/package.json +++ b/.repos/effect/packages/ai/amazon-bedrock/package.json @@ -1,6 +1,6 @@ { "name": "@effect/ai-amazon-bedrock", - "version": "4.1.5", + "version": "4.1.6", "type": "module", "license": "MIT", "description": "An Amazon Bedrock provider integration for Effect AI SDK", diff --git a/.repos/effect/packages/ai/anthropic/CHANGELOG.md b/.repos/effect/packages/ai/anthropic/CHANGELOG.md index ea870c6c1546d..97aecbf90b8e5 100644 --- a/.repos/effect/packages/ai/anthropic/CHANGELOG.md +++ b/.repos/effect/packages/ai/anthropic/CHANGELOG.md @@ -1,5 +1,15 @@ # @effect/ai-anthropic +## 4.1.6 + +### Patch Changes + +- [#10933](https://github.com/Effect-TS/effect/pull/10933) [`68d513d`](https://github.com/Effect-TS/effect/commit/68d513d62812b987eb263ba103f50cbcc227c151) Thanks @effect-bot! - Fix decoding of refusal `stop_details` when fallback fields are omitted. + +- [#10896](https://github.com/Effect-TS/effect/pull/10896) [`e0e68b7`](https://github.com/Effect-TS/effect/commit/e0e68b783bfc4d22c16f9a6c5d9a17bfe783ae65) Thanks @Marve10s! - Fix `AnthropicLanguageModel` sending base64 text data URLs as literal document text. +- Updated dependencies [[`dd5f2f3`](https://github.com/Effect-TS/effect/commit/dd5f2f322fbad042a3a186cef593bf42affe5ce9), [`1d65846`](https://github.com/Effect-TS/effect/commit/1d65846308a6a18c4a95af543988ad30b72ff2b3), [`694c28f`](https://github.com/Effect-TS/effect/commit/694c28f0cfc3eac33f71160d18dda95cb670f506), [`5aaa2cd`](https://github.com/Effect-TS/effect/commit/5aaa2cd216e5e55f92d06db98d4b54946a396eed), [`55814bf`](https://github.com/Effect-TS/effect/commit/55814bf0a780f05ed0a51c82c8affda5d539bb0e), [`92c40a1`](https://github.com/Effect-TS/effect/commit/92c40a1f96a59f9edcacee6c0d6f6fb80397ee17), [`9f415a7`](https://github.com/Effect-TS/effect/commit/9f415a7733cdf8aed7efadbed3b5db22890e164a), [`e367afd`](https://github.com/Effect-TS/effect/commit/e367afdacfa3041a694a67e4670e98a20e41d45c), [`d5d2112`](https://github.com/Effect-TS/effect/commit/d5d21120ff591fcf8da006ce340010812cc91f16), [`fa2e5af`](https://github.com/Effect-TS/effect/commit/fa2e5af4ccc8f3650d97049707be82eab098c168), [`6bf6427`](https://github.com/Effect-TS/effect/commit/6bf6427d195539c387c13156aff79db077929c8f), [`10bc4a4`](https://github.com/Effect-TS/effect/commit/10bc4a47c0ce5bc50ba1998d63a803e3887d1d2b), [`a9540d3`](https://github.com/Effect-TS/effect/commit/a9540d3d50fbe65ade7f9b2f478cdd34a888161e), [`3a250d7`](https://github.com/Effect-TS/effect/commit/3a250d7eb8c310bf4751b3eca0038cf50e1629d8), [`ce44141`](https://github.com/Effect-TS/effect/commit/ce44141ad1bc8d05f3f7399bfa1e87772573205d), [`9318e5b`](https://github.com/Effect-TS/effect/commit/9318e5bafb144ddff65a0bff0148ec4f7ba77b5c), [`c9ecebf`](https://github.com/Effect-TS/effect/commit/c9ecebf7ede8a98895552fd20223d6573bd846fe), [`32f8fbe`](https://github.com/Effect-TS/effect/commit/32f8fbe1a5985aea41754e87531e9a1d0fbf78ec), [`41d6af1`](https://github.com/Effect-TS/effect/commit/41d6af14b7f36e06ade3bf7333b710e73de1e1c2), [`c33fd59`](https://github.com/Effect-TS/effect/commit/c33fd599cb7d49117f77f7bd8f05cb4209112a34), [`1f9e9d3`](https://github.com/Effect-TS/effect/commit/1f9e9d3de552435de6b8f4e1166515d0964c3999), [`594fa71`](https://github.com/Effect-TS/effect/commit/594fa71da417bf94fa6c9be2d3d36c808197e9fe), [`b378c38`](https://github.com/Effect-TS/effect/commit/b378c383cdb29e819e24da5dc725479a2ba4fdf1), [`a9ec9a6`](https://github.com/Effect-TS/effect/commit/a9ec9a60bbe1309960e00527ab62342dce1a86fc), [`310a81b`](https://github.com/Effect-TS/effect/commit/310a81b391e24d42b6608b5e3d641eca63e0d4c0), [`aab2135`](https://github.com/Effect-TS/effect/commit/aab2135d3fe43d4d86c4e486ed378797314fb212), [`6744a72`](https://github.com/Effect-TS/effect/commit/6744a724869539fc2d733929df871ef523bf82e8), [`848d042`](https://github.com/Effect-TS/effect/commit/848d0426f287b3e7ff970219d980a4c66fa441ad), [`077a93e`](https://github.com/Effect-TS/effect/commit/077a93e5db3adbc42e531539cb12b8bdbdfe5328), [`aef50fb`](https://github.com/Effect-TS/effect/commit/aef50fb8b56ec9ff8116f157635579fefd995f26), [`2e4de86`](https://github.com/Effect-TS/effect/commit/2e4de8634431f3da08ca2a90ab1024ee08e216f3), [`482b104`](https://github.com/Effect-TS/effect/commit/482b104caf712a8d5f99aafc64e55b6ea38eb809), [`753e1ed`](https://github.com/Effect-TS/effect/commit/753e1ed88069f73103d136dcdc58188fd10efdf1), [`0d2bb4a`](https://github.com/Effect-TS/effect/commit/0d2bb4a4b6526e1767b81101ee6e8da88ba1de55), [`8161e03`](https://github.com/Effect-TS/effect/commit/8161e03c26d691502afeddcf7e2ee75e6931637f), [`49f5391`](https://github.com/Effect-TS/effect/commit/49f53918a150aa2ea0ce2d444400cec1d6097400), [`3d59bdf`](https://github.com/Effect-TS/effect/commit/3d59bdf6f8f95ceea2091e5b8f375b834a14b3b1), [`8866608`](https://github.com/Effect-TS/effect/commit/88666082f2b6296bb7115bd4a2546151039f64db), [`69fd4b1`](https://github.com/Effect-TS/effect/commit/69fd4b1fba9e2ec5e7c16058ff8d9a1f9a38d90e), [`7d97626`](https://github.com/Effect-TS/effect/commit/7d9762658e515807c2b98678e7abd3ebe94e41ec), [`0e79436`](https://github.com/Effect-TS/effect/commit/0e794366658bd067a2212ea2ac7ed0223904ed31), [`2f8a4e9`](https://github.com/Effect-TS/effect/commit/2f8a4e9b90822d9facfef59027b35819c42d7b48), [`800b753`](https://github.com/Effect-TS/effect/commit/800b7535b4e37a24ac458cae78231054dae0b0f5)]: + - effect@4.1.6 + ## 4.1.5 ### Patch Changes diff --git a/.repos/effect/packages/ai/anthropic/codegen.yml b/.repos/effect/packages/ai/anthropic/codegen.yml index f9bbcb4524fd5..8ea1b7322818a 100644 --- a/.repos/effect/packages/ai/anthropic/codegen.yml +++ b/.repos/effect/packages/ai/anthropic/codegen.yml @@ -36,6 +36,8 @@ patches: - '[{"op":"replace","path":"/components/schemas/ResponseCharLocationCitation/required","value":["cited_text","document_index","document_title","end_char_index","start_char_index","type"]},{"op":"replace","path":"/components/schemas/BetaResponseCharLocationCitation/required","value":["cited_text","document_index","document_title","end_char_index","start_char_index","type"]},{"op":"replace","path":"/components/schemas/ResponsePageLocationCitation/required","value":["cited_text","document_index","document_title","end_page_number","start_page_number","type"]},{"op":"replace","path":"/components/schemas/BetaResponsePageLocationCitation/required","value":["cited_text","document_index","document_title","end_page_number","start_page_number","type"]},{"op":"replace","path":"/components/schemas/ResponseContentBlockLocationCitation/required","value":["cited_text","document_index","document_title","end_block_index","start_block_index","type"]},{"op":"replace","path":"/components/schemas/BetaResponseContentBlockLocationCitation/required","value":["cited_text","document_index","document_title","end_block_index","start_block_index","type"]}]' # Make model optional in BetaMessageIterationUsage (gateways and older responses may omit it) - '[{"op":"replace","path":"/components/schemas/BetaMessageIterationUsage/required","value":["cache_creation","cache_creation_input_tokens","cache_read_input_tokens","input_tokens","output_tokens","type"]}]' + # Keep refusal fallback fields optional; the API omits them when no fallback applies (#10932). + - '[{"op":"replace","path":"/components/schemas/BetaRefusalStopDetails/required","value":["category","explanation","type"]}]' # Decode every error envelope and let the status code decide the error, as released. collapseErrorResponses: true # Released schemas that no operation references: stream events, batch results, memory tool diff --git a/.repos/effect/packages/ai/anthropic/package.json b/.repos/effect/packages/ai/anthropic/package.json index 874915015bd17..f938012ffd9d0 100644 --- a/.repos/effect/packages/ai/anthropic/package.json +++ b/.repos/effect/packages/ai/anthropic/package.json @@ -1,6 +1,6 @@ { "name": "@effect/ai-anthropic", - "version": "4.1.5", + "version": "4.1.6", "type": "module", "license": "MIT", "description": "An Anthropic provider integration for Effect AI SDK", diff --git a/.repos/effect/packages/ai/anthropic/src/AnthropicLanguageModel.ts b/.repos/effect/packages/ai/anthropic/src/AnthropicLanguageModel.ts index 138dd6eae8807..ba823d7d4f010 100644 --- a/.repos/effect/packages/ai/anthropic/src/AnthropicLanguageModel.ts +++ b/.repos/effect/packages/ai/anthropic/src/AnthropicLanguageModel.ts @@ -1345,6 +1345,26 @@ const prepareToolResultContent = Effect.fnUntraced(function*( const getBase64Data = (data: string | Uint8Array): string => typeof data === "string" ? data.replace(/^data:[^;]+;base64,/, "") : Base64.encode(data) +const decodeBase64DataUrl = ( + data: typeof Prompt.FilePart.Type["data"] +): Effect.Effect => { + const value = data instanceof URL ? data.href : data + if (typeof value !== "string" || !/^data:[^,]*;base64,/i.test(value)) { + return Effect.succeed(data) + } + return Effect.mapError( + Effect.fromResult(Base64.decode(value.slice(value.indexOf(",") + 1))), + (error) => + AiError.make({ + module: "AnthropicLanguageModel", + method: "prepareMessages", + reason: new AiError.InvalidUserInputError({ + description: `Failed to decode text file data URL: ${error.message}` + }) + }) + ) +} + const prepareFilePart = Effect.fnUntraced(function*( part: Prompt.FilePart, cacheControl: typeof Generated.CacheControlEphemeral.Encoded | null, @@ -1370,17 +1390,19 @@ const prepareFilePart = Effect.fnUntraced(function*( const enableCitations = areCitationsEnabled(part) const documentOptions = getDocumentMetadata(part) - const source = isUrlData(part.data) + const data = part.mediaType === "text/plain" ? yield* decodeBase64DataUrl(part.data) : part.data + + const source = isUrlData(data) ? { type: "url", - url: getUrlString(part.data) + url: getUrlString(data) } as const : part.mediaType === "application/pdf" - ? { type: "base64", media_type: "application/pdf", data: getBase64Data(part.data) } as const + ? { type: "base64", media_type: "application/pdf", data: getBase64Data(data) } as const : { type: "text", media_type: "text/plain", - data: typeof part.data === "string" ? part.data : new TextDecoder().decode(part.data) + data: typeof data === "string" ? data : new TextDecoder().decode(data) } as const return { diff --git a/.repos/effect/packages/ai/anthropic/src/Generated.ts b/.repos/effect/packages/ai/anthropic/src/Generated.ts index 7a68bb4a96e70..3170f9e15de87 100644 --- a/.repos/effect/packages/ai/anthropic/src/Generated.ts +++ b/.repos/effect/packages/ai/anthropic/src/Generated.ts @@ -14560,9 +14560,9 @@ export const BetaStopReason = Schema.Literals([ export type BetaRefusalStopDetails = { readonly "category": BetaRefusalCategory | null readonly "explanation": string | null - readonly "fallback_credit_token": string | null - readonly "fallback_has_prefill_claim": boolean | null - readonly "recommended_model": string | null + readonly "fallback_credit_token"?: string | null + readonly "fallback_has_prefill_claim"?: boolean | null + readonly "recommended_model"?: string | null readonly "type": "refusal" } @@ -14578,24 +14578,30 @@ export const BetaRefusalStopDetails = Schema.Struct({ "Human-readable explanation of the refusal.\n\nThis text is not guaranteed to be stable. `null` when no explanation is available for the category.", "default": null }), - "fallback_credit_token": Schema.Union([Schema.String, Schema.Null]).annotate({ - "title": "Fallback Credit Token", - "description": - "Opaque code that refunds the cache-miss cost when retrying this refused\nrequest on the fallback model. Pass it as `fallback_credit_token` on the\nretry request. Expires 5 minutes after the refusal.\n\nThe retry is sent either with the same request body (`system`, `messages`,\n`tools`, and other render-shaping fields), or with the same body plus one\nappended `assistant` message whose content is the partial text (with any\ntrailing whitespace stripped from the final text block) and paired\nserver-tool blocks from this refusal — which also authorizes that\nappended turn as an assistant-prefill continuation on models that otherwise\ndisallow prefill. A token minted mid-server-tool-loop whose partial content\nwas continuable may only be redeemed the second way — if a same-body retry\nis rejected with a 400 saying the token must be redeemed by continuing the\npartial response, retry the second way instead. Either way: same workspace,\nsame platform; a mismatch is a 400. Resending a token for an already-warm\nprefix is permitted but yields no additional credit.\n\n`null` when the refused model isn't eligible for a fallback credit.", - "default": null - }), - "fallback_has_prefill_claim": Schema.Union([Schema.Boolean, Schema.Null]).annotate({ - "title": "Fallback Has Prefill Claim", - "description": - "Whether the accompanying `fallback_credit_token` may be redeemed with the\nappended-assistant retry form. Only set when `fallback_credit_token` is\npresent.\n\n`true`: retry by resending the same request body plus one appended\n`assistant` message whose content is this response's `content` with any\ntrailing whitespace stripped from the final text block and unpaired\n`tool_use` blocks omitted (the same appended-turn shape described on\n`fallback_credit_token`), with the token attached. `false`: retry by\nresending the original request body unchanged, with the token attached —\nthe appended-assistant form is not available for this refusal (no\ncontinuable partial content, or the request uses `output_format` or a\n`tool_choice` that forces tool use). One exception: when the request used\n`output_format` or a forced `tool_choice` and the refusal arrived after\nserver tools (including MCP connector tools) had already executed, the\ntoken may not be redeemable by either retry form; if the exact-body retry\nis then rejected with a 400 saying the token must be redeemed by\ncontinuing the partial response, discard the token and retry without it.\n\nAdvisory: if an appended-assistant retry is rejected with a 400 despite\n`true`, fall back to resending the original request body with the token.", - "default": null - }), - "recommended_model": Schema.Union([Schema.String, Schema.Null]).annotate({ - "title": "Recommended Model", - "description": - "The server's suggested retry target for this refusal. Populated when a fallback attempt could not be made (the fallback model's rate limit was exhausted, or it was overloaded); names the fallback model the caller can retry directly. Null otherwise.", - "default": null - }), + "fallback_credit_token": Schema.optionalKey( + Schema.Union([Schema.String, Schema.Null]).annotate({ + "title": "Fallback Credit Token", + "description": + "Opaque code that refunds the cache-miss cost when retrying this refused\nrequest on the fallback model. Pass it as `fallback_credit_token` on the\nretry request. Expires 5 minutes after the refusal.\n\nThe retry is sent either with the same request body (`system`, `messages`,\n`tools`, and other render-shaping fields), or with the same body plus one\nappended `assistant` message whose content is the partial text (with any\ntrailing whitespace stripped from the final text block) and paired\nserver-tool blocks from this refusal — which also authorizes that\nappended turn as an assistant-prefill continuation on models that otherwise\ndisallow prefill. A token minted mid-server-tool-loop whose partial content\nwas continuable may only be redeemed the second way — if a same-body retry\nis rejected with a 400 saying the token must be redeemed by continuing the\npartial response, retry the second way instead. Either way: same workspace,\nsame platform; a mismatch is a 400. Resending a token for an already-warm\nprefix is permitted but yields no additional credit.\n\n`null` when the refused model isn't eligible for a fallback credit.", + "default": null + }) + ), + "fallback_has_prefill_claim": Schema.optionalKey( + Schema.Union([Schema.Boolean, Schema.Null]).annotate({ + "title": "Fallback Has Prefill Claim", + "description": + "Whether the accompanying `fallback_credit_token` may be redeemed with the\nappended-assistant retry form. Only set when `fallback_credit_token` is\npresent.\n\n`true`: retry by resending the same request body plus one appended\n`assistant` message whose content is this response's `content` with any\ntrailing whitespace stripped from the final text block and unpaired\n`tool_use` blocks omitted (the same appended-turn shape described on\n`fallback_credit_token`), with the token attached. `false`: retry by\nresending the original request body unchanged, with the token attached —\nthe appended-assistant form is not available for this refusal (no\ncontinuable partial content, or the request uses `output_format` or a\n`tool_choice` that forces tool use). One exception: when the request used\n`output_format` or a forced `tool_choice` and the refusal arrived after\nserver tools (including MCP connector tools) had already executed, the\ntoken may not be redeemable by either retry form; if the exact-body retry\nis then rejected with a 400 saying the token must be redeemed by\ncontinuing the partial response, discard the token and retry without it.\n\nAdvisory: if an appended-assistant retry is rejected with a 400 despite\n`true`, fall back to resending the original request body with the token.", + "default": null + }) + ), + "recommended_model": Schema.optionalKey( + Schema.Union([Schema.String, Schema.Null]).annotate({ + "title": "Recommended Model", + "description": + "The server's suggested retry target for this refusal. Populated when a fallback attempt could not be made (the fallback model's rate limit was exhausted, or it was overloaded); names the fallback model the caller can retry directly. Null otherwise.", + "default": null + }) + ), "type": Schema.Literal("refusal").annotate({ "title": "Type", "default": "refusal" }) }).annotate({ "title": "RefusalStopDetails", diff --git a/.repos/effect/packages/ai/anthropic/test/AnthropicClient.test.ts b/.repos/effect/packages/ai/anthropic/test/AnthropicClient.test.ts index 678ba269d5c4f..0396e9f805430 100644 --- a/.repos/effect/packages/ai/anthropic/test/AnthropicClient.test.ts +++ b/.repos/effect/packages/ai/anthropic/test/AnthropicClient.test.ts @@ -1,7 +1,7 @@ import { AnthropicClient } from "@effect/ai-anthropic" import * as Errors from "@effect/ai-anthropic/internal/errors" import { assert, describe, it } from "@effect/vitest" -import { Context, Duration, Effect, Layer, Redacted, type Schema } from "effect" +import { Context, Duration, Effect, Layer, Redacted, type Schema, Stream } from "effect" import { HttpClient, type HttpClientError, type HttpClientRequest, HttpClientResponse } from "effect/http" describe("AnthropicClient", () => { @@ -222,6 +222,36 @@ describe("AnthropicClient", () => { request_id: null } })))) + + it.effect("decodes refusal stop details without fallback keys", () => { + const stopDetails = { type: "refusal", category: "cyber", explanation: "Refused for cyber harm." } as const + return Effect.gen(function*() { + const client = yield* AnthropicClient.AnthropicClient + const [, stream] = yield* client.createMessageStream({ + payload: { + model: "claude-sonnet-4-20250514", + max_tokens: 1, + messages: [{ role: "user", content: "hello" }] + } + }) + const events = yield* Stream.runCollect(stream) + + assert.deepStrictEqual( + events.flatMap((event) => event.type === "message_delta" ? [event.delta.stop_details] : []), + [stopDetails] + ) + }).pipe(Effect.provide(makeTestLayer({ + _tag: "Sse", + events: [ + { + type: "message_delta", + delta: { stop_reason: "refusal", stop_sequence: null, stop_details: stopDetails }, + usage: { output_tokens: 1 } + }, + { type: "message_stop" } + ] + }))) + }) }) type MockResponse = diff --git a/.repos/effect/packages/ai/anthropic/test/AnthropicLanguageModel.test.ts b/.repos/effect/packages/ai/anthropic/test/AnthropicLanguageModel.test.ts index 62b0d4e48dfbb..896d1754f5b76 100644 --- a/.repos/effect/packages/ai/anthropic/test/AnthropicLanguageModel.test.ts +++ b/.repos/effect/packages/ai/anthropic/test/AnthropicLanguageModel.test.ts @@ -1603,6 +1603,8 @@ describe("AnthropicLanguageModel", () => { assert.strictEqual(toolResult.content, "PLAIN_TEXT_SENTINEL\n") })) + const plaintext = "Café ✓" + const plaintextBase64 = "Q2Fmw6kg4pyT" const png = "iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAAC0lEQVR4nGP4DwQACfsD/fteaysAAAAASUVORK5CYII=" const pdf = "JVBERi0xLjcK" const modelOutputCases = [ @@ -1610,11 +1612,13 @@ describe("AnthropicLanguageModel", () => { label: "as native content blocks", modelOutput: [ Prompt.textPart({ text: "Screenshot of /home" }), + Prompt.filePart({ mediaType: "text/plain", data: `data:text/plain;base64,${plaintextBase64}` }), Prompt.filePart({ mediaType: "image/png", data: png }), Prompt.filePart({ mediaType: "application/pdf", data: `data:application/pdf;base64,${pdf}` }) ], content: [ { type: "text", text: "Screenshot of /home" }, + { type: "document", source: { type: "text", media_type: "text/plain", data: plaintext }, title: null }, { type: "image", source: { type: "base64", media_type: "image/png", data: png } }, { type: "document", source: { type: "base64", media_type: "application/pdf", data: pdf }, title: null } ] @@ -1996,6 +2000,89 @@ describe("AnthropicLanguageModel", () => { assert.strictEqual(clientToolResults.length, 0) })) + it.effect("decodes plaintext files from base64 data URLs", () => + Effect.gen(function*() { + let capturedRequest: HttpClientRequest.HttpClientRequest | undefined + yield* LanguageModel.generateText({ + prompt: Prompt.make([{ + role: "user", + content: [ + Prompt.filePart({ + mediaType: "text/plain", + data: `data:text/plain;charset=utf-8;base64,${plaintextBase64}`, + fileName: "policy.txt", + options: { + anthropic: { + documentTitle: "Policy", + documentContext: "Returns policy", + citations: { enabled: true }, + cacheControl: { type: "ephemeral" } + } + } + }), + Prompt.filePart({ mediaType: "text/plain", data: new URL(`data:text/plain;base64,${plaintextBase64}`) }), + Prompt.filePart({ mediaType: "text/plain", data: "plain text" }) + ] + }]) + }).pipe( + Effect.provide(AnthropicLanguageModel.model("claude-sonnet-4-20250514")), + Effect.provide(AnthropicClient.layer({ apiKey: Redacted.make("test") })), + Effect.provideService( + HttpClient.HttpClient, + makeHttpClient((request) => { + capturedRequest = request + return Effect.succeed(jsonResponse(request, { + id: "msg_text", + type: "message", + role: "assistant", + model: "claude-sonnet-4-20250514", + content: [{ type: "text", text: "ok" }], + stop_reason: "end_turn", + stop_sequence: null, + usage: { input_tokens: 1, output_tokens: 1 } + })) + }) + ) + ) + + assertDefined(capturedRequest) + const body = yield* getRequestBody(capturedRequest) + assert.deepStrictEqual(body.messages[0].content[0], { + type: "document", + source: { type: "text", media_type: "text/plain", data: plaintext }, + title: "Policy", + context: "Returns policy", + citations: { enabled: true }, + cache_control: { type: "ephemeral" } + }) + assert.deepStrictEqual(body.messages[0].content[1].source, { + type: "text", + media_type: "text/plain", + data: plaintext + }) + assert.deepStrictEqual(body.messages[0].content[2].source, { + type: "text", + media_type: "text/plain", + data: "plain text" + }) + })) + + it.effect("rejects malformed base64 plaintext before sending a request", () => + Effect.gen(function*() { + const error = yield* LanguageModel.generateText({ + prompt: Prompt.make([{ + role: "user", + content: [Prompt.filePart({ mediaType: "text/plain", data: "data:text/plain;base64,%%%%" })] + }]) + }).pipe( + Effect.provide(AnthropicLanguageModel.model("claude-sonnet-4-20250514")), + Effect.provide(AnthropicClient.layer({ apiKey: Redacted.make("test") })), + Effect.provideService(HttpClient.HttpClient, makeHttpClient(() => Effect.die("unexpected request"))), + Effect.flip + ) + assert.strictEqual(error.reason._tag, "InvalidUserInputError") + })) + it.effect("encodes plaintext bytes as UTF-8 text", () => Effect.gen(function*() { let body: any diff --git a/.repos/effect/packages/ai/cloudflare/CHANGELOG.md b/.repos/effect/packages/ai/cloudflare/CHANGELOG.md index d6af7cd371d18..5825e0d7ca2c1 100644 --- a/.repos/effect/packages/ai/cloudflare/CHANGELOG.md +++ b/.repos/effect/packages/ai/cloudflare/CHANGELOG.md @@ -1,5 +1,12 @@ # @effect/ai-cloudflare +## 4.1.6 + +### Patch Changes + +- Updated dependencies [[`dd5f2f3`](https://github.com/Effect-TS/effect/commit/dd5f2f322fbad042a3a186cef593bf42affe5ce9), [`1d65846`](https://github.com/Effect-TS/effect/commit/1d65846308a6a18c4a95af543988ad30b72ff2b3), [`694c28f`](https://github.com/Effect-TS/effect/commit/694c28f0cfc3eac33f71160d18dda95cb670f506), [`5aaa2cd`](https://github.com/Effect-TS/effect/commit/5aaa2cd216e5e55f92d06db98d4b54946a396eed), [`55814bf`](https://github.com/Effect-TS/effect/commit/55814bf0a780f05ed0a51c82c8affda5d539bb0e), [`92c40a1`](https://github.com/Effect-TS/effect/commit/92c40a1f96a59f9edcacee6c0d6f6fb80397ee17), [`9f415a7`](https://github.com/Effect-TS/effect/commit/9f415a7733cdf8aed7efadbed3b5db22890e164a), [`e367afd`](https://github.com/Effect-TS/effect/commit/e367afdacfa3041a694a67e4670e98a20e41d45c), [`d5d2112`](https://github.com/Effect-TS/effect/commit/d5d21120ff591fcf8da006ce340010812cc91f16), [`fa2e5af`](https://github.com/Effect-TS/effect/commit/fa2e5af4ccc8f3650d97049707be82eab098c168), [`6bf6427`](https://github.com/Effect-TS/effect/commit/6bf6427d195539c387c13156aff79db077929c8f), [`10bc4a4`](https://github.com/Effect-TS/effect/commit/10bc4a47c0ce5bc50ba1998d63a803e3887d1d2b), [`a9540d3`](https://github.com/Effect-TS/effect/commit/a9540d3d50fbe65ade7f9b2f478cdd34a888161e), [`3a250d7`](https://github.com/Effect-TS/effect/commit/3a250d7eb8c310bf4751b3eca0038cf50e1629d8), [`ce44141`](https://github.com/Effect-TS/effect/commit/ce44141ad1bc8d05f3f7399bfa1e87772573205d), [`9318e5b`](https://github.com/Effect-TS/effect/commit/9318e5bafb144ddff65a0bff0148ec4f7ba77b5c), [`c9ecebf`](https://github.com/Effect-TS/effect/commit/c9ecebf7ede8a98895552fd20223d6573bd846fe), [`32f8fbe`](https://github.com/Effect-TS/effect/commit/32f8fbe1a5985aea41754e87531e9a1d0fbf78ec), [`41d6af1`](https://github.com/Effect-TS/effect/commit/41d6af14b7f36e06ade3bf7333b710e73de1e1c2), [`c33fd59`](https://github.com/Effect-TS/effect/commit/c33fd599cb7d49117f77f7bd8f05cb4209112a34), [`1f9e9d3`](https://github.com/Effect-TS/effect/commit/1f9e9d3de552435de6b8f4e1166515d0964c3999), [`594fa71`](https://github.com/Effect-TS/effect/commit/594fa71da417bf94fa6c9be2d3d36c808197e9fe), [`b378c38`](https://github.com/Effect-TS/effect/commit/b378c383cdb29e819e24da5dc725479a2ba4fdf1), [`a9ec9a6`](https://github.com/Effect-TS/effect/commit/a9ec9a60bbe1309960e00527ab62342dce1a86fc), [`310a81b`](https://github.com/Effect-TS/effect/commit/310a81b391e24d42b6608b5e3d641eca63e0d4c0), [`aab2135`](https://github.com/Effect-TS/effect/commit/aab2135d3fe43d4d86c4e486ed378797314fb212), [`6744a72`](https://github.com/Effect-TS/effect/commit/6744a724869539fc2d733929df871ef523bf82e8), [`848d042`](https://github.com/Effect-TS/effect/commit/848d0426f287b3e7ff970219d980a4c66fa441ad), [`077a93e`](https://github.com/Effect-TS/effect/commit/077a93e5db3adbc42e531539cb12b8bdbdfe5328), [`aef50fb`](https://github.com/Effect-TS/effect/commit/aef50fb8b56ec9ff8116f157635579fefd995f26), [`2e4de86`](https://github.com/Effect-TS/effect/commit/2e4de8634431f3da08ca2a90ab1024ee08e216f3), [`482b104`](https://github.com/Effect-TS/effect/commit/482b104caf712a8d5f99aafc64e55b6ea38eb809), [`753e1ed`](https://github.com/Effect-TS/effect/commit/753e1ed88069f73103d136dcdc58188fd10efdf1), [`0d2bb4a`](https://github.com/Effect-TS/effect/commit/0d2bb4a4b6526e1767b81101ee6e8da88ba1de55), [`8161e03`](https://github.com/Effect-TS/effect/commit/8161e03c26d691502afeddcf7e2ee75e6931637f), [`49f5391`](https://github.com/Effect-TS/effect/commit/49f53918a150aa2ea0ce2d444400cec1d6097400), [`3d59bdf`](https://github.com/Effect-TS/effect/commit/3d59bdf6f8f95ceea2091e5b8f375b834a14b3b1), [`8866608`](https://github.com/Effect-TS/effect/commit/88666082f2b6296bb7115bd4a2546151039f64db), [`69fd4b1`](https://github.com/Effect-TS/effect/commit/69fd4b1fba9e2ec5e7c16058ff8d9a1f9a38d90e), [`7d97626`](https://github.com/Effect-TS/effect/commit/7d9762658e515807c2b98678e7abd3ebe94e41ec), [`0e79436`](https://github.com/Effect-TS/effect/commit/0e794366658bd067a2212ea2ac7ed0223904ed31), [`2f8a4e9`](https://github.com/Effect-TS/effect/commit/2f8a4e9b90822d9facfef59027b35819c42d7b48), [`800b753`](https://github.com/Effect-TS/effect/commit/800b7535b4e37a24ac458cae78231054dae0b0f5)]: + - effect@4.1.6 + ## 4.1.5 ### Patch Changes diff --git a/.repos/effect/packages/ai/cloudflare/package.json b/.repos/effect/packages/ai/cloudflare/package.json index 04432309bcd6e..63ebdae87b5dd 100644 --- a/.repos/effect/packages/ai/cloudflare/package.json +++ b/.repos/effect/packages/ai/cloudflare/package.json @@ -1,6 +1,6 @@ { "name": "@effect/ai-cloudflare", - "version": "4.1.5", + "version": "4.1.6", "type": "module", "license": "MIT", "description": "A Cloudflare Workers AI decision provider for Effect", diff --git a/.repos/effect/packages/ai/openai-compat/CHANGELOG.md b/.repos/effect/packages/ai/openai-compat/CHANGELOG.md index b2c496c01437a..f89ea76d40879 100644 --- a/.repos/effect/packages/ai/openai-compat/CHANGELOG.md +++ b/.repos/effect/packages/ai/openai-compat/CHANGELOG.md @@ -1,5 +1,12 @@ # @effect/ai-openai-compat +## 4.1.6 + +### Patch Changes + +- Updated dependencies [[`dd5f2f3`](https://github.com/Effect-TS/effect/commit/dd5f2f322fbad042a3a186cef593bf42affe5ce9), [`1d65846`](https://github.com/Effect-TS/effect/commit/1d65846308a6a18c4a95af543988ad30b72ff2b3), [`694c28f`](https://github.com/Effect-TS/effect/commit/694c28f0cfc3eac33f71160d18dda95cb670f506), [`5aaa2cd`](https://github.com/Effect-TS/effect/commit/5aaa2cd216e5e55f92d06db98d4b54946a396eed), [`55814bf`](https://github.com/Effect-TS/effect/commit/55814bf0a780f05ed0a51c82c8affda5d539bb0e), [`92c40a1`](https://github.com/Effect-TS/effect/commit/92c40a1f96a59f9edcacee6c0d6f6fb80397ee17), [`9f415a7`](https://github.com/Effect-TS/effect/commit/9f415a7733cdf8aed7efadbed3b5db22890e164a), [`e367afd`](https://github.com/Effect-TS/effect/commit/e367afdacfa3041a694a67e4670e98a20e41d45c), [`d5d2112`](https://github.com/Effect-TS/effect/commit/d5d21120ff591fcf8da006ce340010812cc91f16), [`fa2e5af`](https://github.com/Effect-TS/effect/commit/fa2e5af4ccc8f3650d97049707be82eab098c168), [`6bf6427`](https://github.com/Effect-TS/effect/commit/6bf6427d195539c387c13156aff79db077929c8f), [`10bc4a4`](https://github.com/Effect-TS/effect/commit/10bc4a47c0ce5bc50ba1998d63a803e3887d1d2b), [`a9540d3`](https://github.com/Effect-TS/effect/commit/a9540d3d50fbe65ade7f9b2f478cdd34a888161e), [`3a250d7`](https://github.com/Effect-TS/effect/commit/3a250d7eb8c310bf4751b3eca0038cf50e1629d8), [`ce44141`](https://github.com/Effect-TS/effect/commit/ce44141ad1bc8d05f3f7399bfa1e87772573205d), [`9318e5b`](https://github.com/Effect-TS/effect/commit/9318e5bafb144ddff65a0bff0148ec4f7ba77b5c), [`c9ecebf`](https://github.com/Effect-TS/effect/commit/c9ecebf7ede8a98895552fd20223d6573bd846fe), [`32f8fbe`](https://github.com/Effect-TS/effect/commit/32f8fbe1a5985aea41754e87531e9a1d0fbf78ec), [`41d6af1`](https://github.com/Effect-TS/effect/commit/41d6af14b7f36e06ade3bf7333b710e73de1e1c2), [`c33fd59`](https://github.com/Effect-TS/effect/commit/c33fd599cb7d49117f77f7bd8f05cb4209112a34), [`1f9e9d3`](https://github.com/Effect-TS/effect/commit/1f9e9d3de552435de6b8f4e1166515d0964c3999), [`594fa71`](https://github.com/Effect-TS/effect/commit/594fa71da417bf94fa6c9be2d3d36c808197e9fe), [`b378c38`](https://github.com/Effect-TS/effect/commit/b378c383cdb29e819e24da5dc725479a2ba4fdf1), [`a9ec9a6`](https://github.com/Effect-TS/effect/commit/a9ec9a60bbe1309960e00527ab62342dce1a86fc), [`310a81b`](https://github.com/Effect-TS/effect/commit/310a81b391e24d42b6608b5e3d641eca63e0d4c0), [`aab2135`](https://github.com/Effect-TS/effect/commit/aab2135d3fe43d4d86c4e486ed378797314fb212), [`6744a72`](https://github.com/Effect-TS/effect/commit/6744a724869539fc2d733929df871ef523bf82e8), [`848d042`](https://github.com/Effect-TS/effect/commit/848d0426f287b3e7ff970219d980a4c66fa441ad), [`077a93e`](https://github.com/Effect-TS/effect/commit/077a93e5db3adbc42e531539cb12b8bdbdfe5328), [`aef50fb`](https://github.com/Effect-TS/effect/commit/aef50fb8b56ec9ff8116f157635579fefd995f26), [`2e4de86`](https://github.com/Effect-TS/effect/commit/2e4de8634431f3da08ca2a90ab1024ee08e216f3), [`482b104`](https://github.com/Effect-TS/effect/commit/482b104caf712a8d5f99aafc64e55b6ea38eb809), [`753e1ed`](https://github.com/Effect-TS/effect/commit/753e1ed88069f73103d136dcdc58188fd10efdf1), [`0d2bb4a`](https://github.com/Effect-TS/effect/commit/0d2bb4a4b6526e1767b81101ee6e8da88ba1de55), [`8161e03`](https://github.com/Effect-TS/effect/commit/8161e03c26d691502afeddcf7e2ee75e6931637f), [`49f5391`](https://github.com/Effect-TS/effect/commit/49f53918a150aa2ea0ce2d444400cec1d6097400), [`3d59bdf`](https://github.com/Effect-TS/effect/commit/3d59bdf6f8f95ceea2091e5b8f375b834a14b3b1), [`8866608`](https://github.com/Effect-TS/effect/commit/88666082f2b6296bb7115bd4a2546151039f64db), [`69fd4b1`](https://github.com/Effect-TS/effect/commit/69fd4b1fba9e2ec5e7c16058ff8d9a1f9a38d90e), [`7d97626`](https://github.com/Effect-TS/effect/commit/7d9762658e515807c2b98678e7abd3ebe94e41ec), [`0e79436`](https://github.com/Effect-TS/effect/commit/0e794366658bd067a2212ea2ac7ed0223904ed31), [`2f8a4e9`](https://github.com/Effect-TS/effect/commit/2f8a4e9b90822d9facfef59027b35819c42d7b48), [`800b753`](https://github.com/Effect-TS/effect/commit/800b7535b4e37a24ac458cae78231054dae0b0f5)]: + - effect@4.1.6 + ## 4.1.5 ### Patch Changes diff --git a/.repos/effect/packages/ai/openai-compat/package.json b/.repos/effect/packages/ai/openai-compat/package.json index e7bec4b9a6975..66c7aa380db99 100644 --- a/.repos/effect/packages/ai/openai-compat/package.json +++ b/.repos/effect/packages/ai/openai-compat/package.json @@ -1,6 +1,6 @@ { "name": "@effect/ai-openai-compat", - "version": "4.1.5", + "version": "4.1.6", "type": "module", "license": "MIT", "description": "An OpenAI compat integration for Effect", diff --git a/.repos/effect/packages/ai/openai/CHANGELOG.md b/.repos/effect/packages/ai/openai/CHANGELOG.md index 71f83fa6f807c..efa060aab2edf 100644 --- a/.repos/effect/packages/ai/openai/CHANGELOG.md +++ b/.repos/effect/packages/ai/openai/CHANGELOG.md @@ -1,5 +1,13 @@ # @effect/ai-openai +## 4.1.6 + +### Patch Changes + +- [#10894](https://github.com/Effect-TS/effect/pull/10894) [`b0b861d`](https://github.com/Effect-TS/effect/commit/b0b861d5ea0246efba44eeca947c798e1f1c9aa1) Thanks @Marve10s! - Fix continuing a `Chat` after generating an image with `generateText`. +- Updated dependencies [[`dd5f2f3`](https://github.com/Effect-TS/effect/commit/dd5f2f322fbad042a3a186cef593bf42affe5ce9), [`1d65846`](https://github.com/Effect-TS/effect/commit/1d65846308a6a18c4a95af543988ad30b72ff2b3), [`694c28f`](https://github.com/Effect-TS/effect/commit/694c28f0cfc3eac33f71160d18dda95cb670f506), [`5aaa2cd`](https://github.com/Effect-TS/effect/commit/5aaa2cd216e5e55f92d06db98d4b54946a396eed), [`55814bf`](https://github.com/Effect-TS/effect/commit/55814bf0a780f05ed0a51c82c8affda5d539bb0e), [`92c40a1`](https://github.com/Effect-TS/effect/commit/92c40a1f96a59f9edcacee6c0d6f6fb80397ee17), [`9f415a7`](https://github.com/Effect-TS/effect/commit/9f415a7733cdf8aed7efadbed3b5db22890e164a), [`e367afd`](https://github.com/Effect-TS/effect/commit/e367afdacfa3041a694a67e4670e98a20e41d45c), [`d5d2112`](https://github.com/Effect-TS/effect/commit/d5d21120ff591fcf8da006ce340010812cc91f16), [`fa2e5af`](https://github.com/Effect-TS/effect/commit/fa2e5af4ccc8f3650d97049707be82eab098c168), [`6bf6427`](https://github.com/Effect-TS/effect/commit/6bf6427d195539c387c13156aff79db077929c8f), [`10bc4a4`](https://github.com/Effect-TS/effect/commit/10bc4a47c0ce5bc50ba1998d63a803e3887d1d2b), [`a9540d3`](https://github.com/Effect-TS/effect/commit/a9540d3d50fbe65ade7f9b2f478cdd34a888161e), [`3a250d7`](https://github.com/Effect-TS/effect/commit/3a250d7eb8c310bf4751b3eca0038cf50e1629d8), [`ce44141`](https://github.com/Effect-TS/effect/commit/ce44141ad1bc8d05f3f7399bfa1e87772573205d), [`9318e5b`](https://github.com/Effect-TS/effect/commit/9318e5bafb144ddff65a0bff0148ec4f7ba77b5c), [`c9ecebf`](https://github.com/Effect-TS/effect/commit/c9ecebf7ede8a98895552fd20223d6573bd846fe), [`32f8fbe`](https://github.com/Effect-TS/effect/commit/32f8fbe1a5985aea41754e87531e9a1d0fbf78ec), [`41d6af1`](https://github.com/Effect-TS/effect/commit/41d6af14b7f36e06ade3bf7333b710e73de1e1c2), [`c33fd59`](https://github.com/Effect-TS/effect/commit/c33fd599cb7d49117f77f7bd8f05cb4209112a34), [`1f9e9d3`](https://github.com/Effect-TS/effect/commit/1f9e9d3de552435de6b8f4e1166515d0964c3999), [`594fa71`](https://github.com/Effect-TS/effect/commit/594fa71da417bf94fa6c9be2d3d36c808197e9fe), [`b378c38`](https://github.com/Effect-TS/effect/commit/b378c383cdb29e819e24da5dc725479a2ba4fdf1), [`a9ec9a6`](https://github.com/Effect-TS/effect/commit/a9ec9a60bbe1309960e00527ab62342dce1a86fc), [`310a81b`](https://github.com/Effect-TS/effect/commit/310a81b391e24d42b6608b5e3d641eca63e0d4c0), [`aab2135`](https://github.com/Effect-TS/effect/commit/aab2135d3fe43d4d86c4e486ed378797314fb212), [`6744a72`](https://github.com/Effect-TS/effect/commit/6744a724869539fc2d733929df871ef523bf82e8), [`848d042`](https://github.com/Effect-TS/effect/commit/848d0426f287b3e7ff970219d980a4c66fa441ad), [`077a93e`](https://github.com/Effect-TS/effect/commit/077a93e5db3adbc42e531539cb12b8bdbdfe5328), [`aef50fb`](https://github.com/Effect-TS/effect/commit/aef50fb8b56ec9ff8116f157635579fefd995f26), [`2e4de86`](https://github.com/Effect-TS/effect/commit/2e4de8634431f3da08ca2a90ab1024ee08e216f3), [`482b104`](https://github.com/Effect-TS/effect/commit/482b104caf712a8d5f99aafc64e55b6ea38eb809), [`753e1ed`](https://github.com/Effect-TS/effect/commit/753e1ed88069f73103d136dcdc58188fd10efdf1), [`0d2bb4a`](https://github.com/Effect-TS/effect/commit/0d2bb4a4b6526e1767b81101ee6e8da88ba1de55), [`8161e03`](https://github.com/Effect-TS/effect/commit/8161e03c26d691502afeddcf7e2ee75e6931637f), [`49f5391`](https://github.com/Effect-TS/effect/commit/49f53918a150aa2ea0ce2d444400cec1d6097400), [`3d59bdf`](https://github.com/Effect-TS/effect/commit/3d59bdf6f8f95ceea2091e5b8f375b834a14b3b1), [`8866608`](https://github.com/Effect-TS/effect/commit/88666082f2b6296bb7115bd4a2546151039f64db), [`69fd4b1`](https://github.com/Effect-TS/effect/commit/69fd4b1fba9e2ec5e7c16058ff8d9a1f9a38d90e), [`7d97626`](https://github.com/Effect-TS/effect/commit/7d9762658e515807c2b98678e7abd3ebe94e41ec), [`0e79436`](https://github.com/Effect-TS/effect/commit/0e794366658bd067a2212ea2ac7ed0223904ed31), [`2f8a4e9`](https://github.com/Effect-TS/effect/commit/2f8a4e9b90822d9facfef59027b35819c42d7b48), [`800b753`](https://github.com/Effect-TS/effect/commit/800b7535b4e37a24ac458cae78231054dae0b0f5)]: + - effect@4.1.6 + ## 4.1.5 ### Patch Changes diff --git a/.repos/effect/packages/ai/openai/package.json b/.repos/effect/packages/ai/openai/package.json index 67496b9f46517..6f83fc1dccde4 100644 --- a/.repos/effect/packages/ai/openai/package.json +++ b/.repos/effect/packages/ai/openai/package.json @@ -1,6 +1,6 @@ { "name": "@effect/ai-openai", - "version": "4.1.5", + "version": "4.1.6", "type": "module", "license": "MIT", "description": "An OpenAI provider integration for Effect AI SDK", diff --git a/.repos/effect/packages/ai/openai/src/OpenAiLanguageModel.ts b/.repos/effect/packages/ai/openai/src/OpenAiLanguageModel.ts index 1981876bbd2ea..78432a6528dc9 100644 --- a/.repos/effect/packages/ai/openai/src/OpenAiLanguageModel.ts +++ b/.repos/effect/packages/ai/openai/src/OpenAiLanguageModel.ts @@ -1568,7 +1568,8 @@ const makeResponse = Effect.fnUntraced( isFailure: status !== "completed", result: status === "completed" ? { result: part.result } - : { status, result: part.result } + : { status, result: part.result }, + providerExecuted: true }) break } diff --git a/.repos/effect/packages/ai/openai/test/OpenAiLanguageModel.test.ts b/.repos/effect/packages/ai/openai/test/OpenAiLanguageModel.test.ts index 585ad5b17c9a7..6d306ef6f7df1 100644 --- a/.repos/effect/packages/ai/openai/test/OpenAiLanguageModel.test.ts +++ b/.repos/effect/packages/ai/openai/test/OpenAiLanguageModel.test.ts @@ -2,7 +2,7 @@ import { type Generated, OpenAiClient, OpenAiLanguageModel, OpenAiSchema, OpenAi import { assert, describe, it } from "@effect/vitest" import { assertTrue, deepStrictEqual, strictEqual } from "@effect/vitest/utils" import { Array, Context, Effect, Layer, Redacted, Ref, Schema, SchemaGetter, Stream } from "effect" -import { AiError, LanguageModel, Prompt, Response as AiResponse, Tool, Toolkit } from "effect/ai" +import { AiError, Chat, LanguageModel, Prompt, Response as AiResponse, Tool, Toolkit } from "effect/ai" import { HttpClient, type HttpClientError, HttpClientRequest, HttpClientResponse } from "effect/http" const webSearchFailures = [ @@ -821,6 +821,32 @@ describe("OpenAiLanguageModel", () => { Effect.provide(makeTestLayer({ body: { output: [makeWebSearchCall(), makeTextOutput("Answer")] } })) )) + it.effect.each([false, true])( + "replays Chat after image generation with store=%s", + (store) => + Effect.gen(function*() { + const chat = yield* Chat.empty + const toolkit = Toolkit.make(OpenAiTool.ImageGeneration({})) + + yield* chat.generateText({ prompt: "Draw a cat", toolkit }) + yield* chat.generateText({ prompt: "Thanks", toolkit }) + + const body = yield* getRequestBody((yield* MockHttpClient.requests)[1]) + deepStrictEqual(body.input, [ + { role: "user", content: [{ type: "input_text", text: "Draw a cat" }] }, + ...(store ? [{ type: "item_reference", id: "ig_123" }] : []), + { role: "user", content: [{ type: "input_text", text: "Thanks" }] } + ]) + }).pipe( + Effect.provide(OpenAiLanguageModel.model("gpt-4o-mini", { store })), + Effect.provide(makeTestLayer({ + body: { + output: [{ type: "image_generation_call", id: "ig_123", status: "completed", result: "aW1hZ2U=" }] + } + })) + ) + ) + it.effect("references stored provider-executed items by their stored item ID", () => Effect.gen(function*() { const cases = [ diff --git a/.repos/effect/packages/ai/openrouter/CHANGELOG.md b/.repos/effect/packages/ai/openrouter/CHANGELOG.md index d5f1afbe67837..c076385b22ee8 100644 --- a/.repos/effect/packages/ai/openrouter/CHANGELOG.md +++ b/.repos/effect/packages/ai/openrouter/CHANGELOG.md @@ -1,5 +1,13 @@ # @effect/ai-openrouter +## 4.1.6 + +### Patch Changes + +- [#10907](https://github.com/Effect-TS/effect/pull/10907) [`20c927e`](https://github.com/Effect-TS/effect/commit/20c927e99293942f110c3d6d35fd516a0eb22ffc) Thanks @janitor-chat[bot]! - Preserve the serving provider in `LanguageModel.streamText` finish metadata when OpenRouter reports it on a streamed chunk. +- Updated dependencies [[`dd5f2f3`](https://github.com/Effect-TS/effect/commit/dd5f2f322fbad042a3a186cef593bf42affe5ce9), [`1d65846`](https://github.com/Effect-TS/effect/commit/1d65846308a6a18c4a95af543988ad30b72ff2b3), [`694c28f`](https://github.com/Effect-TS/effect/commit/694c28f0cfc3eac33f71160d18dda95cb670f506), [`5aaa2cd`](https://github.com/Effect-TS/effect/commit/5aaa2cd216e5e55f92d06db98d4b54946a396eed), [`55814bf`](https://github.com/Effect-TS/effect/commit/55814bf0a780f05ed0a51c82c8affda5d539bb0e), [`92c40a1`](https://github.com/Effect-TS/effect/commit/92c40a1f96a59f9edcacee6c0d6f6fb80397ee17), [`9f415a7`](https://github.com/Effect-TS/effect/commit/9f415a7733cdf8aed7efadbed3b5db22890e164a), [`e367afd`](https://github.com/Effect-TS/effect/commit/e367afdacfa3041a694a67e4670e98a20e41d45c), [`d5d2112`](https://github.com/Effect-TS/effect/commit/d5d21120ff591fcf8da006ce340010812cc91f16), [`fa2e5af`](https://github.com/Effect-TS/effect/commit/fa2e5af4ccc8f3650d97049707be82eab098c168), [`6bf6427`](https://github.com/Effect-TS/effect/commit/6bf6427d195539c387c13156aff79db077929c8f), [`10bc4a4`](https://github.com/Effect-TS/effect/commit/10bc4a47c0ce5bc50ba1998d63a803e3887d1d2b), [`a9540d3`](https://github.com/Effect-TS/effect/commit/a9540d3d50fbe65ade7f9b2f478cdd34a888161e), [`3a250d7`](https://github.com/Effect-TS/effect/commit/3a250d7eb8c310bf4751b3eca0038cf50e1629d8), [`ce44141`](https://github.com/Effect-TS/effect/commit/ce44141ad1bc8d05f3f7399bfa1e87772573205d), [`9318e5b`](https://github.com/Effect-TS/effect/commit/9318e5bafb144ddff65a0bff0148ec4f7ba77b5c), [`c9ecebf`](https://github.com/Effect-TS/effect/commit/c9ecebf7ede8a98895552fd20223d6573bd846fe), [`32f8fbe`](https://github.com/Effect-TS/effect/commit/32f8fbe1a5985aea41754e87531e9a1d0fbf78ec), [`41d6af1`](https://github.com/Effect-TS/effect/commit/41d6af14b7f36e06ade3bf7333b710e73de1e1c2), [`c33fd59`](https://github.com/Effect-TS/effect/commit/c33fd599cb7d49117f77f7bd8f05cb4209112a34), [`1f9e9d3`](https://github.com/Effect-TS/effect/commit/1f9e9d3de552435de6b8f4e1166515d0964c3999), [`594fa71`](https://github.com/Effect-TS/effect/commit/594fa71da417bf94fa6c9be2d3d36c808197e9fe), [`b378c38`](https://github.com/Effect-TS/effect/commit/b378c383cdb29e819e24da5dc725479a2ba4fdf1), [`a9ec9a6`](https://github.com/Effect-TS/effect/commit/a9ec9a60bbe1309960e00527ab62342dce1a86fc), [`310a81b`](https://github.com/Effect-TS/effect/commit/310a81b391e24d42b6608b5e3d641eca63e0d4c0), [`aab2135`](https://github.com/Effect-TS/effect/commit/aab2135d3fe43d4d86c4e486ed378797314fb212), [`6744a72`](https://github.com/Effect-TS/effect/commit/6744a724869539fc2d733929df871ef523bf82e8), [`848d042`](https://github.com/Effect-TS/effect/commit/848d0426f287b3e7ff970219d980a4c66fa441ad), [`077a93e`](https://github.com/Effect-TS/effect/commit/077a93e5db3adbc42e531539cb12b8bdbdfe5328), [`aef50fb`](https://github.com/Effect-TS/effect/commit/aef50fb8b56ec9ff8116f157635579fefd995f26), [`2e4de86`](https://github.com/Effect-TS/effect/commit/2e4de8634431f3da08ca2a90ab1024ee08e216f3), [`482b104`](https://github.com/Effect-TS/effect/commit/482b104caf712a8d5f99aafc64e55b6ea38eb809), [`753e1ed`](https://github.com/Effect-TS/effect/commit/753e1ed88069f73103d136dcdc58188fd10efdf1), [`0d2bb4a`](https://github.com/Effect-TS/effect/commit/0d2bb4a4b6526e1767b81101ee6e8da88ba1de55), [`8161e03`](https://github.com/Effect-TS/effect/commit/8161e03c26d691502afeddcf7e2ee75e6931637f), [`49f5391`](https://github.com/Effect-TS/effect/commit/49f53918a150aa2ea0ce2d444400cec1d6097400), [`3d59bdf`](https://github.com/Effect-TS/effect/commit/3d59bdf6f8f95ceea2091e5b8f375b834a14b3b1), [`8866608`](https://github.com/Effect-TS/effect/commit/88666082f2b6296bb7115bd4a2546151039f64db), [`69fd4b1`](https://github.com/Effect-TS/effect/commit/69fd4b1fba9e2ec5e7c16058ff8d9a1f9a38d90e), [`7d97626`](https://github.com/Effect-TS/effect/commit/7d9762658e515807c2b98678e7abd3ebe94e41ec), [`0e79436`](https://github.com/Effect-TS/effect/commit/0e794366658bd067a2212ea2ac7ed0223904ed31), [`2f8a4e9`](https://github.com/Effect-TS/effect/commit/2f8a4e9b90822d9facfef59027b35819c42d7b48), [`800b753`](https://github.com/Effect-TS/effect/commit/800b7535b4e37a24ac458cae78231054dae0b0f5)]: + - effect@4.1.6 + ## 4.1.5 ### Patch Changes diff --git a/.repos/effect/packages/ai/openrouter/codegen.yml b/.repos/effect/packages/ai/openrouter/codegen.yml index 88fb921574faf..2c6522c2f6f9c 100644 --- a/.repos/effect/packages/ai/openrouter/codegen.yml +++ b/.repos/effect/packages/ai/openrouter/codegen.yml @@ -43,6 +43,8 @@ patches: - '[{"op":"remove","path":"/components/schemas/ChatToolCall/required/0"},{"op":"remove","path":"/components/schemas/ChatStreamToolCall/required/0"}]' # Make finish_reason optional (only present on final streaming chunk) - '[{"op":"remove","path":"/components/schemas/ChatStreamChoice/required/1"}]' + # OpenRouter reports the serving provider on streamed chat chunks. + - '[{"op":"add","path":"/components/schemas/ChatStreamChunk/properties/provider","value":{"anyOf":[{"type":"string"},{"type":"null"}]}}]' replacements: # Help TypeScript serialize oversized generated schema values - from: "export const StreamEvents = Schema.Union([" diff --git a/.repos/effect/packages/ai/openrouter/package.json b/.repos/effect/packages/ai/openrouter/package.json index bcaed923db459..b3daff21fe3b1 100644 --- a/.repos/effect/packages/ai/openrouter/package.json +++ b/.repos/effect/packages/ai/openrouter/package.json @@ -1,6 +1,6 @@ { "name": "@effect/ai-openrouter", - "version": "4.1.5", + "version": "4.1.6", "type": "module", "license": "MIT", "description": "An OpenRouter provider integration for Effect AI SDK", diff --git a/.repos/effect/packages/ai/openrouter/src/Generated.ts b/.repos/effect/packages/ai/openrouter/src/Generated.ts index fc9f8f7a91985..0a172b0f8feeb 100644 --- a/.repos/effect/packages/ai/openrouter/src/Generated.ts +++ b/.repos/effect/packages/ai/openrouter/src/Generated.ts @@ -15421,6 +15421,7 @@ export type ChatStreamChunk = { readonly "service_tier"?: string | null readonly "system_fingerprint"?: string readonly "usage"?: ChatUsage + readonly "provider"?: string | null } export const ChatStreamChunk = Schema.Struct({ @@ -15475,7 +15476,8 @@ export const ChatStreamChunk = Schema.Struct({ "system_fingerprint": Schema.optionalKey( Schema.String.annotate({ "description": "System fingerprint", "examples": ["fp_44709d6fcb"] }) ), - "usage": Schema.optionalKey(ChatUsage) + "usage": Schema.optionalKey(ChatUsage), + "provider": Schema.optionalKey(Schema.Union([Schema.String, Schema.Null])) }).annotate({ "description": "Streaming chat completion chunk", "examples": [{ diff --git a/.repos/effect/packages/ai/openrouter/src/OpenRouterLanguageModel.ts b/.repos/effect/packages/ai/openrouter/src/OpenRouterLanguageModel.ts index dd3c492f1a107..649c2bcd57bc9 100644 --- a/.repos/effect/packages/ai/openrouter/src/OpenRouterLanguageModel.ts +++ b/.repos/effect/packages/ai/openrouter/src/OpenRouterLanguageModel.ts @@ -1208,6 +1208,7 @@ const makeStreamResponse = Effect.fnUntraced( let responseMetadataEmitted = false let reasoningDetailsAttachedToToolCall = false let finishReason: Response.FinishReason | undefined = undefined + let provider: string | undefined let openRouterResponseId: string | undefined = undefined let activeReasoningId: string | undefined = undefined let activeTextId: string | undefined = undefined @@ -1247,6 +1248,10 @@ const makeStreamResponse = Effect.fnUntraced( Stream.mapEffect(Effect.fnUntraced(function*(event) { const parts: Array = [] + if (Predicate.isString(event.provider)) { + provider = event.provider + } + if (Predicate.isNotUndefined(event.error)) { finishReason = "error" parts.push({ type: "error", error: event.error }) @@ -1632,9 +1637,7 @@ const makeStreamResponse = Effect.fnUntraced( ? { systemFingerprint: event.system_fingerprint } : undefined), ...(Predicate.isNotUndefined(event.usage) ? { usage: event.usage } : undefined), - ...(Predicate.hasProperty(event, "provider") && Predicate.isString(event.provider) - ? { provider: event.provider } - : undefined), + ...(Predicate.isNotUndefined(provider) ? { provider } : undefined), ...(accumulatedFileAnnotations.length > 0 ? { annotations: accumulatedFileAnnotations } : undefined), ...(accumulatedRefusal.length > 0 ? { refusal: accumulatedRefusal } : undefined) } diff --git a/.repos/effect/packages/ai/openrouter/test/OpenRouterLanguageModel.test.ts b/.repos/effect/packages/ai/openrouter/test/OpenRouterLanguageModel.test.ts index 158bc1258233b..7e0c9c3a5973a 100644 --- a/.repos/effect/packages/ai/openrouter/test/OpenRouterLanguageModel.test.ts +++ b/.repos/effect/packages/ai/openrouter/test/OpenRouterLanguageModel.test.ts @@ -988,6 +988,25 @@ describe("OpenRouterLanguageModel", () => { }) describe("streamText", () => { + it.effect("retains the serving provider when the final usage chunk omits it", () => + Effect.gen(function*() { + const chunk = { id: "response-1", object: "chat.completion.chunk", model: "openai/gpt-4o", created: 1 } as const + const parts = yield* LanguageModel.streamText({ prompt: "Hello" }).pipe( + Stream.runCollect, + Effect.provide(OpenRouterLanguageModel.model(chunk.model)), + Effect.provide(makeStreamTestLayer([ + { + ...chunk, + provider: "OpenAI", + choices: [{ index: 0, delta: { content: "Hello" }, finish_reason: "stop" }] + }, + { ...chunk, choices: [], usage: { prompt_tokens: 2, completion_tokens: 1, total_tokens: 3 } } + ])) + ) + + strictEqual(parts.find((part) => part.type === "finish")?.metadata.openrouter?.provider, "OpenAI") + })) + describe("usage", () => { it.effect("treats streamed reasoning tokens as disjoint when they exceed completion tokens", () => Effect.gen(function*() { diff --git a/.repos/effect/packages/ai/typesafe/CHANGELOG.md b/.repos/effect/packages/ai/typesafe/CHANGELOG.md index c7e1350d22f76..051550f1b3c44 100644 --- a/.repos/effect/packages/ai/typesafe/CHANGELOG.md +++ b/.repos/effect/packages/ai/typesafe/CHANGELOG.md @@ -1,5 +1,12 @@ # @effect/ai-typesafe +## 4.1.6 + +### Patch Changes + +- Updated dependencies [[`dd5f2f3`](https://github.com/Effect-TS/effect/commit/dd5f2f322fbad042a3a186cef593bf42affe5ce9), [`1d65846`](https://github.com/Effect-TS/effect/commit/1d65846308a6a18c4a95af543988ad30b72ff2b3), [`694c28f`](https://github.com/Effect-TS/effect/commit/694c28f0cfc3eac33f71160d18dda95cb670f506), [`5aaa2cd`](https://github.com/Effect-TS/effect/commit/5aaa2cd216e5e55f92d06db98d4b54946a396eed), [`55814bf`](https://github.com/Effect-TS/effect/commit/55814bf0a780f05ed0a51c82c8affda5d539bb0e), [`92c40a1`](https://github.com/Effect-TS/effect/commit/92c40a1f96a59f9edcacee6c0d6f6fb80397ee17), [`9f415a7`](https://github.com/Effect-TS/effect/commit/9f415a7733cdf8aed7efadbed3b5db22890e164a), [`e367afd`](https://github.com/Effect-TS/effect/commit/e367afdacfa3041a694a67e4670e98a20e41d45c), [`d5d2112`](https://github.com/Effect-TS/effect/commit/d5d21120ff591fcf8da006ce340010812cc91f16), [`fa2e5af`](https://github.com/Effect-TS/effect/commit/fa2e5af4ccc8f3650d97049707be82eab098c168), [`6bf6427`](https://github.com/Effect-TS/effect/commit/6bf6427d195539c387c13156aff79db077929c8f), [`10bc4a4`](https://github.com/Effect-TS/effect/commit/10bc4a47c0ce5bc50ba1998d63a803e3887d1d2b), [`a9540d3`](https://github.com/Effect-TS/effect/commit/a9540d3d50fbe65ade7f9b2f478cdd34a888161e), [`3a250d7`](https://github.com/Effect-TS/effect/commit/3a250d7eb8c310bf4751b3eca0038cf50e1629d8), [`ce44141`](https://github.com/Effect-TS/effect/commit/ce44141ad1bc8d05f3f7399bfa1e87772573205d), [`9318e5b`](https://github.com/Effect-TS/effect/commit/9318e5bafb144ddff65a0bff0148ec4f7ba77b5c), [`c9ecebf`](https://github.com/Effect-TS/effect/commit/c9ecebf7ede8a98895552fd20223d6573bd846fe), [`32f8fbe`](https://github.com/Effect-TS/effect/commit/32f8fbe1a5985aea41754e87531e9a1d0fbf78ec), [`41d6af1`](https://github.com/Effect-TS/effect/commit/41d6af14b7f36e06ade3bf7333b710e73de1e1c2), [`c33fd59`](https://github.com/Effect-TS/effect/commit/c33fd599cb7d49117f77f7bd8f05cb4209112a34), [`1f9e9d3`](https://github.com/Effect-TS/effect/commit/1f9e9d3de552435de6b8f4e1166515d0964c3999), [`594fa71`](https://github.com/Effect-TS/effect/commit/594fa71da417bf94fa6c9be2d3d36c808197e9fe), [`b378c38`](https://github.com/Effect-TS/effect/commit/b378c383cdb29e819e24da5dc725479a2ba4fdf1), [`a9ec9a6`](https://github.com/Effect-TS/effect/commit/a9ec9a60bbe1309960e00527ab62342dce1a86fc), [`310a81b`](https://github.com/Effect-TS/effect/commit/310a81b391e24d42b6608b5e3d641eca63e0d4c0), [`aab2135`](https://github.com/Effect-TS/effect/commit/aab2135d3fe43d4d86c4e486ed378797314fb212), [`6744a72`](https://github.com/Effect-TS/effect/commit/6744a724869539fc2d733929df871ef523bf82e8), [`848d042`](https://github.com/Effect-TS/effect/commit/848d0426f287b3e7ff970219d980a4c66fa441ad), [`077a93e`](https://github.com/Effect-TS/effect/commit/077a93e5db3adbc42e531539cb12b8bdbdfe5328), [`aef50fb`](https://github.com/Effect-TS/effect/commit/aef50fb8b56ec9ff8116f157635579fefd995f26), [`2e4de86`](https://github.com/Effect-TS/effect/commit/2e4de8634431f3da08ca2a90ab1024ee08e216f3), [`482b104`](https://github.com/Effect-TS/effect/commit/482b104caf712a8d5f99aafc64e55b6ea38eb809), [`753e1ed`](https://github.com/Effect-TS/effect/commit/753e1ed88069f73103d136dcdc58188fd10efdf1), [`0d2bb4a`](https://github.com/Effect-TS/effect/commit/0d2bb4a4b6526e1767b81101ee6e8da88ba1de55), [`8161e03`](https://github.com/Effect-TS/effect/commit/8161e03c26d691502afeddcf7e2ee75e6931637f), [`49f5391`](https://github.com/Effect-TS/effect/commit/49f53918a150aa2ea0ce2d444400cec1d6097400), [`3d59bdf`](https://github.com/Effect-TS/effect/commit/3d59bdf6f8f95ceea2091e5b8f375b834a14b3b1), [`8866608`](https://github.com/Effect-TS/effect/commit/88666082f2b6296bb7115bd4a2546151039f64db), [`69fd4b1`](https://github.com/Effect-TS/effect/commit/69fd4b1fba9e2ec5e7c16058ff8d9a1f9a38d90e), [`7d97626`](https://github.com/Effect-TS/effect/commit/7d9762658e515807c2b98678e7abd3ebe94e41ec), [`0e79436`](https://github.com/Effect-TS/effect/commit/0e794366658bd067a2212ea2ac7ed0223904ed31), [`2f8a4e9`](https://github.com/Effect-TS/effect/commit/2f8a4e9b90822d9facfef59027b35819c42d7b48), [`800b753`](https://github.com/Effect-TS/effect/commit/800b7535b4e37a24ac458cae78231054dae0b0f5)]: + - effect@4.1.6 + ## 4.1.5 ### Patch Changes diff --git a/.repos/effect/packages/ai/typesafe/package.json b/.repos/effect/packages/ai/typesafe/package.json index e83f7bf3e80ad..9f143278bfc0d 100644 --- a/.repos/effect/packages/ai/typesafe/package.json +++ b/.repos/effect/packages/ai/typesafe/package.json @@ -1,6 +1,6 @@ { "name": "@effect/ai-typesafe", - "version": "4.1.5", + "version": "4.1.6", "type": "module", "license": "MIT", "description": "A TypeSafe DecisionModel provider for Effect", diff --git a/.repos/effect/packages/atom/react/CHANGELOG.md b/.repos/effect/packages/atom/react/CHANGELOG.md index 5992655842acd..f2a3b8e8ac987 100644 --- a/.repos/effect/packages/atom/react/CHANGELOG.md +++ b/.repos/effect/packages/atom/react/CHANGELOG.md @@ -1,5 +1,12 @@ # @effect/atom-react +## 4.1.6 + +### Patch Changes + +- Updated dependencies [[`dd5f2f3`](https://github.com/Effect-TS/effect/commit/dd5f2f322fbad042a3a186cef593bf42affe5ce9), [`1d65846`](https://github.com/Effect-TS/effect/commit/1d65846308a6a18c4a95af543988ad30b72ff2b3), [`694c28f`](https://github.com/Effect-TS/effect/commit/694c28f0cfc3eac33f71160d18dda95cb670f506), [`5aaa2cd`](https://github.com/Effect-TS/effect/commit/5aaa2cd216e5e55f92d06db98d4b54946a396eed), [`55814bf`](https://github.com/Effect-TS/effect/commit/55814bf0a780f05ed0a51c82c8affda5d539bb0e), [`92c40a1`](https://github.com/Effect-TS/effect/commit/92c40a1f96a59f9edcacee6c0d6f6fb80397ee17), [`9f415a7`](https://github.com/Effect-TS/effect/commit/9f415a7733cdf8aed7efadbed3b5db22890e164a), [`e367afd`](https://github.com/Effect-TS/effect/commit/e367afdacfa3041a694a67e4670e98a20e41d45c), [`d5d2112`](https://github.com/Effect-TS/effect/commit/d5d21120ff591fcf8da006ce340010812cc91f16), [`fa2e5af`](https://github.com/Effect-TS/effect/commit/fa2e5af4ccc8f3650d97049707be82eab098c168), [`6bf6427`](https://github.com/Effect-TS/effect/commit/6bf6427d195539c387c13156aff79db077929c8f), [`10bc4a4`](https://github.com/Effect-TS/effect/commit/10bc4a47c0ce5bc50ba1998d63a803e3887d1d2b), [`a9540d3`](https://github.com/Effect-TS/effect/commit/a9540d3d50fbe65ade7f9b2f478cdd34a888161e), [`3a250d7`](https://github.com/Effect-TS/effect/commit/3a250d7eb8c310bf4751b3eca0038cf50e1629d8), [`ce44141`](https://github.com/Effect-TS/effect/commit/ce44141ad1bc8d05f3f7399bfa1e87772573205d), [`9318e5b`](https://github.com/Effect-TS/effect/commit/9318e5bafb144ddff65a0bff0148ec4f7ba77b5c), [`c9ecebf`](https://github.com/Effect-TS/effect/commit/c9ecebf7ede8a98895552fd20223d6573bd846fe), [`32f8fbe`](https://github.com/Effect-TS/effect/commit/32f8fbe1a5985aea41754e87531e9a1d0fbf78ec), [`41d6af1`](https://github.com/Effect-TS/effect/commit/41d6af14b7f36e06ade3bf7333b710e73de1e1c2), [`c33fd59`](https://github.com/Effect-TS/effect/commit/c33fd599cb7d49117f77f7bd8f05cb4209112a34), [`1f9e9d3`](https://github.com/Effect-TS/effect/commit/1f9e9d3de552435de6b8f4e1166515d0964c3999), [`594fa71`](https://github.com/Effect-TS/effect/commit/594fa71da417bf94fa6c9be2d3d36c808197e9fe), [`b378c38`](https://github.com/Effect-TS/effect/commit/b378c383cdb29e819e24da5dc725479a2ba4fdf1), [`a9ec9a6`](https://github.com/Effect-TS/effect/commit/a9ec9a60bbe1309960e00527ab62342dce1a86fc), [`310a81b`](https://github.com/Effect-TS/effect/commit/310a81b391e24d42b6608b5e3d641eca63e0d4c0), [`aab2135`](https://github.com/Effect-TS/effect/commit/aab2135d3fe43d4d86c4e486ed378797314fb212), [`6744a72`](https://github.com/Effect-TS/effect/commit/6744a724869539fc2d733929df871ef523bf82e8), [`848d042`](https://github.com/Effect-TS/effect/commit/848d0426f287b3e7ff970219d980a4c66fa441ad), [`077a93e`](https://github.com/Effect-TS/effect/commit/077a93e5db3adbc42e531539cb12b8bdbdfe5328), [`aef50fb`](https://github.com/Effect-TS/effect/commit/aef50fb8b56ec9ff8116f157635579fefd995f26), [`2e4de86`](https://github.com/Effect-TS/effect/commit/2e4de8634431f3da08ca2a90ab1024ee08e216f3), [`482b104`](https://github.com/Effect-TS/effect/commit/482b104caf712a8d5f99aafc64e55b6ea38eb809), [`753e1ed`](https://github.com/Effect-TS/effect/commit/753e1ed88069f73103d136dcdc58188fd10efdf1), [`0d2bb4a`](https://github.com/Effect-TS/effect/commit/0d2bb4a4b6526e1767b81101ee6e8da88ba1de55), [`8161e03`](https://github.com/Effect-TS/effect/commit/8161e03c26d691502afeddcf7e2ee75e6931637f), [`49f5391`](https://github.com/Effect-TS/effect/commit/49f53918a150aa2ea0ce2d444400cec1d6097400), [`3d59bdf`](https://github.com/Effect-TS/effect/commit/3d59bdf6f8f95ceea2091e5b8f375b834a14b3b1), [`8866608`](https://github.com/Effect-TS/effect/commit/88666082f2b6296bb7115bd4a2546151039f64db), [`69fd4b1`](https://github.com/Effect-TS/effect/commit/69fd4b1fba9e2ec5e7c16058ff8d9a1f9a38d90e), [`7d97626`](https://github.com/Effect-TS/effect/commit/7d9762658e515807c2b98678e7abd3ebe94e41ec), [`0e79436`](https://github.com/Effect-TS/effect/commit/0e794366658bd067a2212ea2ac7ed0223904ed31), [`2f8a4e9`](https://github.com/Effect-TS/effect/commit/2f8a4e9b90822d9facfef59027b35819c42d7b48), [`800b753`](https://github.com/Effect-TS/effect/commit/800b7535b4e37a24ac458cae78231054dae0b0f5)]: + - effect@4.1.6 + ## 4.1.5 ### Patch Changes diff --git a/.repos/effect/packages/atom/react/package.json b/.repos/effect/packages/atom/react/package.json index be04666b65017..402798bf5c403 100644 --- a/.repos/effect/packages/atom/react/package.json +++ b/.repos/effect/packages/atom/react/package.json @@ -1,6 +1,6 @@ { "name": "@effect/atom-react", - "version": "4.1.5", + "version": "4.1.6", "type": "module", "license": "MIT", "description": "React bindings for the Effect Atom modules", @@ -66,7 +66,7 @@ }, "devDependencies": { "@testing-library/dom": "^10.4.2", - "@testing-library/jest-dom": "^7.0.1", + "@testing-library/jest-dom": "^8.0.0", "@testing-library/react": "^16.3.3", "@types/react": "^19.3.0", "@types/react-dom": "^19.3.0", diff --git a/.repos/effect/packages/atom/solid/CHANGELOG.md b/.repos/effect/packages/atom/solid/CHANGELOG.md index 7bed638943eb9..85a7055e60ec5 100644 --- a/.repos/effect/packages/atom/solid/CHANGELOG.md +++ b/.repos/effect/packages/atom/solid/CHANGELOG.md @@ -1,5 +1,12 @@ # @effect/atom-solid +## 4.1.6 + +### Patch Changes + +- Updated dependencies [[`dd5f2f3`](https://github.com/Effect-TS/effect/commit/dd5f2f322fbad042a3a186cef593bf42affe5ce9), [`1d65846`](https://github.com/Effect-TS/effect/commit/1d65846308a6a18c4a95af543988ad30b72ff2b3), [`694c28f`](https://github.com/Effect-TS/effect/commit/694c28f0cfc3eac33f71160d18dda95cb670f506), [`5aaa2cd`](https://github.com/Effect-TS/effect/commit/5aaa2cd216e5e55f92d06db98d4b54946a396eed), [`55814bf`](https://github.com/Effect-TS/effect/commit/55814bf0a780f05ed0a51c82c8affda5d539bb0e), [`92c40a1`](https://github.com/Effect-TS/effect/commit/92c40a1f96a59f9edcacee6c0d6f6fb80397ee17), [`9f415a7`](https://github.com/Effect-TS/effect/commit/9f415a7733cdf8aed7efadbed3b5db22890e164a), [`e367afd`](https://github.com/Effect-TS/effect/commit/e367afdacfa3041a694a67e4670e98a20e41d45c), [`d5d2112`](https://github.com/Effect-TS/effect/commit/d5d21120ff591fcf8da006ce340010812cc91f16), [`fa2e5af`](https://github.com/Effect-TS/effect/commit/fa2e5af4ccc8f3650d97049707be82eab098c168), [`6bf6427`](https://github.com/Effect-TS/effect/commit/6bf6427d195539c387c13156aff79db077929c8f), [`10bc4a4`](https://github.com/Effect-TS/effect/commit/10bc4a47c0ce5bc50ba1998d63a803e3887d1d2b), [`a9540d3`](https://github.com/Effect-TS/effect/commit/a9540d3d50fbe65ade7f9b2f478cdd34a888161e), [`3a250d7`](https://github.com/Effect-TS/effect/commit/3a250d7eb8c310bf4751b3eca0038cf50e1629d8), [`ce44141`](https://github.com/Effect-TS/effect/commit/ce44141ad1bc8d05f3f7399bfa1e87772573205d), [`9318e5b`](https://github.com/Effect-TS/effect/commit/9318e5bafb144ddff65a0bff0148ec4f7ba77b5c), [`c9ecebf`](https://github.com/Effect-TS/effect/commit/c9ecebf7ede8a98895552fd20223d6573bd846fe), [`32f8fbe`](https://github.com/Effect-TS/effect/commit/32f8fbe1a5985aea41754e87531e9a1d0fbf78ec), [`41d6af1`](https://github.com/Effect-TS/effect/commit/41d6af14b7f36e06ade3bf7333b710e73de1e1c2), [`c33fd59`](https://github.com/Effect-TS/effect/commit/c33fd599cb7d49117f77f7bd8f05cb4209112a34), [`1f9e9d3`](https://github.com/Effect-TS/effect/commit/1f9e9d3de552435de6b8f4e1166515d0964c3999), [`594fa71`](https://github.com/Effect-TS/effect/commit/594fa71da417bf94fa6c9be2d3d36c808197e9fe), [`b378c38`](https://github.com/Effect-TS/effect/commit/b378c383cdb29e819e24da5dc725479a2ba4fdf1), [`a9ec9a6`](https://github.com/Effect-TS/effect/commit/a9ec9a60bbe1309960e00527ab62342dce1a86fc), [`310a81b`](https://github.com/Effect-TS/effect/commit/310a81b391e24d42b6608b5e3d641eca63e0d4c0), [`aab2135`](https://github.com/Effect-TS/effect/commit/aab2135d3fe43d4d86c4e486ed378797314fb212), [`6744a72`](https://github.com/Effect-TS/effect/commit/6744a724869539fc2d733929df871ef523bf82e8), [`848d042`](https://github.com/Effect-TS/effect/commit/848d0426f287b3e7ff970219d980a4c66fa441ad), [`077a93e`](https://github.com/Effect-TS/effect/commit/077a93e5db3adbc42e531539cb12b8bdbdfe5328), [`aef50fb`](https://github.com/Effect-TS/effect/commit/aef50fb8b56ec9ff8116f157635579fefd995f26), [`2e4de86`](https://github.com/Effect-TS/effect/commit/2e4de8634431f3da08ca2a90ab1024ee08e216f3), [`482b104`](https://github.com/Effect-TS/effect/commit/482b104caf712a8d5f99aafc64e55b6ea38eb809), [`753e1ed`](https://github.com/Effect-TS/effect/commit/753e1ed88069f73103d136dcdc58188fd10efdf1), [`0d2bb4a`](https://github.com/Effect-TS/effect/commit/0d2bb4a4b6526e1767b81101ee6e8da88ba1de55), [`8161e03`](https://github.com/Effect-TS/effect/commit/8161e03c26d691502afeddcf7e2ee75e6931637f), [`49f5391`](https://github.com/Effect-TS/effect/commit/49f53918a150aa2ea0ce2d444400cec1d6097400), [`3d59bdf`](https://github.com/Effect-TS/effect/commit/3d59bdf6f8f95ceea2091e5b8f375b834a14b3b1), [`8866608`](https://github.com/Effect-TS/effect/commit/88666082f2b6296bb7115bd4a2546151039f64db), [`69fd4b1`](https://github.com/Effect-TS/effect/commit/69fd4b1fba9e2ec5e7c16058ff8d9a1f9a38d90e), [`7d97626`](https://github.com/Effect-TS/effect/commit/7d9762658e515807c2b98678e7abd3ebe94e41ec), [`0e79436`](https://github.com/Effect-TS/effect/commit/0e794366658bd067a2212ea2ac7ed0223904ed31), [`2f8a4e9`](https://github.com/Effect-TS/effect/commit/2f8a4e9b90822d9facfef59027b35819c42d7b48), [`800b753`](https://github.com/Effect-TS/effect/commit/800b7535b4e37a24ac458cae78231054dae0b0f5)]: + - effect@4.1.6 + ## 4.1.5 ### Patch Changes diff --git a/.repos/effect/packages/atom/solid/package.json b/.repos/effect/packages/atom/solid/package.json index 9938eacd53ab7..ba94f4b69ef8c 100644 --- a/.repos/effect/packages/atom/solid/package.json +++ b/.repos/effect/packages/atom/solid/package.json @@ -1,6 +1,6 @@ { "name": "@effect/atom-solid", - "version": "4.1.5", + "version": "4.1.6", "type": "module", "license": "MIT", "description": "SolidJS bindings for the Effect Atom modules", @@ -66,7 +66,7 @@ "devDependencies": { "@solidjs/testing-library": "^0.8.10", "@testing-library/dom": "^10.4.2", - "@testing-library/jest-dom": "^7.0.1", + "@testing-library/jest-dom": "^8.0.0", "effect": "workspace:^", "jsdom": "~30.0.1", "solid-js": "^1.9.19" diff --git a/.repos/effect/packages/atom/vue/CHANGELOG.md b/.repos/effect/packages/atom/vue/CHANGELOG.md index 9a4ea3fc6431f..78f321b75deef 100644 --- a/.repos/effect/packages/atom/vue/CHANGELOG.md +++ b/.repos/effect/packages/atom/vue/CHANGELOG.md @@ -1,5 +1,12 @@ # @effect/atom-vue +## 4.1.6 + +### Patch Changes + +- Updated dependencies [[`dd5f2f3`](https://github.com/Effect-TS/effect/commit/dd5f2f322fbad042a3a186cef593bf42affe5ce9), [`1d65846`](https://github.com/Effect-TS/effect/commit/1d65846308a6a18c4a95af543988ad30b72ff2b3), [`694c28f`](https://github.com/Effect-TS/effect/commit/694c28f0cfc3eac33f71160d18dda95cb670f506), [`5aaa2cd`](https://github.com/Effect-TS/effect/commit/5aaa2cd216e5e55f92d06db98d4b54946a396eed), [`55814bf`](https://github.com/Effect-TS/effect/commit/55814bf0a780f05ed0a51c82c8affda5d539bb0e), [`92c40a1`](https://github.com/Effect-TS/effect/commit/92c40a1f96a59f9edcacee6c0d6f6fb80397ee17), [`9f415a7`](https://github.com/Effect-TS/effect/commit/9f415a7733cdf8aed7efadbed3b5db22890e164a), [`e367afd`](https://github.com/Effect-TS/effect/commit/e367afdacfa3041a694a67e4670e98a20e41d45c), [`d5d2112`](https://github.com/Effect-TS/effect/commit/d5d21120ff591fcf8da006ce340010812cc91f16), [`fa2e5af`](https://github.com/Effect-TS/effect/commit/fa2e5af4ccc8f3650d97049707be82eab098c168), [`6bf6427`](https://github.com/Effect-TS/effect/commit/6bf6427d195539c387c13156aff79db077929c8f), [`10bc4a4`](https://github.com/Effect-TS/effect/commit/10bc4a47c0ce5bc50ba1998d63a803e3887d1d2b), [`a9540d3`](https://github.com/Effect-TS/effect/commit/a9540d3d50fbe65ade7f9b2f478cdd34a888161e), [`3a250d7`](https://github.com/Effect-TS/effect/commit/3a250d7eb8c310bf4751b3eca0038cf50e1629d8), [`ce44141`](https://github.com/Effect-TS/effect/commit/ce44141ad1bc8d05f3f7399bfa1e87772573205d), [`9318e5b`](https://github.com/Effect-TS/effect/commit/9318e5bafb144ddff65a0bff0148ec4f7ba77b5c), [`c9ecebf`](https://github.com/Effect-TS/effect/commit/c9ecebf7ede8a98895552fd20223d6573bd846fe), [`32f8fbe`](https://github.com/Effect-TS/effect/commit/32f8fbe1a5985aea41754e87531e9a1d0fbf78ec), [`41d6af1`](https://github.com/Effect-TS/effect/commit/41d6af14b7f36e06ade3bf7333b710e73de1e1c2), [`c33fd59`](https://github.com/Effect-TS/effect/commit/c33fd599cb7d49117f77f7bd8f05cb4209112a34), [`1f9e9d3`](https://github.com/Effect-TS/effect/commit/1f9e9d3de552435de6b8f4e1166515d0964c3999), [`594fa71`](https://github.com/Effect-TS/effect/commit/594fa71da417bf94fa6c9be2d3d36c808197e9fe), [`b378c38`](https://github.com/Effect-TS/effect/commit/b378c383cdb29e819e24da5dc725479a2ba4fdf1), [`a9ec9a6`](https://github.com/Effect-TS/effect/commit/a9ec9a60bbe1309960e00527ab62342dce1a86fc), [`310a81b`](https://github.com/Effect-TS/effect/commit/310a81b391e24d42b6608b5e3d641eca63e0d4c0), [`aab2135`](https://github.com/Effect-TS/effect/commit/aab2135d3fe43d4d86c4e486ed378797314fb212), [`6744a72`](https://github.com/Effect-TS/effect/commit/6744a724869539fc2d733929df871ef523bf82e8), [`848d042`](https://github.com/Effect-TS/effect/commit/848d0426f287b3e7ff970219d980a4c66fa441ad), [`077a93e`](https://github.com/Effect-TS/effect/commit/077a93e5db3adbc42e531539cb12b8bdbdfe5328), [`aef50fb`](https://github.com/Effect-TS/effect/commit/aef50fb8b56ec9ff8116f157635579fefd995f26), [`2e4de86`](https://github.com/Effect-TS/effect/commit/2e4de8634431f3da08ca2a90ab1024ee08e216f3), [`482b104`](https://github.com/Effect-TS/effect/commit/482b104caf712a8d5f99aafc64e55b6ea38eb809), [`753e1ed`](https://github.com/Effect-TS/effect/commit/753e1ed88069f73103d136dcdc58188fd10efdf1), [`0d2bb4a`](https://github.com/Effect-TS/effect/commit/0d2bb4a4b6526e1767b81101ee6e8da88ba1de55), [`8161e03`](https://github.com/Effect-TS/effect/commit/8161e03c26d691502afeddcf7e2ee75e6931637f), [`49f5391`](https://github.com/Effect-TS/effect/commit/49f53918a150aa2ea0ce2d444400cec1d6097400), [`3d59bdf`](https://github.com/Effect-TS/effect/commit/3d59bdf6f8f95ceea2091e5b8f375b834a14b3b1), [`8866608`](https://github.com/Effect-TS/effect/commit/88666082f2b6296bb7115bd4a2546151039f64db), [`69fd4b1`](https://github.com/Effect-TS/effect/commit/69fd4b1fba9e2ec5e7c16058ff8d9a1f9a38d90e), [`7d97626`](https://github.com/Effect-TS/effect/commit/7d9762658e515807c2b98678e7abd3ebe94e41ec), [`0e79436`](https://github.com/Effect-TS/effect/commit/0e794366658bd067a2212ea2ac7ed0223904ed31), [`2f8a4e9`](https://github.com/Effect-TS/effect/commit/2f8a4e9b90822d9facfef59027b35819c42d7b48), [`800b753`](https://github.com/Effect-TS/effect/commit/800b7535b4e37a24ac458cae78231054dae0b0f5)]: + - effect@4.1.6 + ## 4.1.5 ### Patch Changes diff --git a/.repos/effect/packages/atom/vue/package.json b/.repos/effect/packages/atom/vue/package.json index d4cafa156105b..be401149a453f 100644 --- a/.repos/effect/packages/atom/vue/package.json +++ b/.repos/effect/packages/atom/vue/package.json @@ -1,6 +1,6 @@ { "name": "@effect/atom-vue", - "version": "4.1.5", + "version": "4.1.6", "type": "module", "license": "MIT", "description": "Vue bindings for the Effect Atom modules", @@ -61,7 +61,7 @@ }, "devDependencies": { "effect": "workspace:^", - "vue": "^3.5.45" + "vue": "^3.5.46" }, "peerDependencies": { "effect": "workspace:^", diff --git a/.repos/effect/packages/chat/discord/CHANGELOG.md b/.repos/effect/packages/chat/discord/CHANGELOG.md index 2785ab3a0983c..3c33a078be703 100644 --- a/.repos/effect/packages/chat/discord/CHANGELOG.md +++ b/.repos/effect/packages/chat/discord/CHANGELOG.md @@ -1,5 +1,12 @@ # @effect/chat-discord +## 4.1.6 + +### Patch Changes + +- Updated dependencies [[`dd5f2f3`](https://github.com/Effect-TS/effect/commit/dd5f2f322fbad042a3a186cef593bf42affe5ce9), [`1d65846`](https://github.com/Effect-TS/effect/commit/1d65846308a6a18c4a95af543988ad30b72ff2b3), [`694c28f`](https://github.com/Effect-TS/effect/commit/694c28f0cfc3eac33f71160d18dda95cb670f506), [`5aaa2cd`](https://github.com/Effect-TS/effect/commit/5aaa2cd216e5e55f92d06db98d4b54946a396eed), [`55814bf`](https://github.com/Effect-TS/effect/commit/55814bf0a780f05ed0a51c82c8affda5d539bb0e), [`92c40a1`](https://github.com/Effect-TS/effect/commit/92c40a1f96a59f9edcacee6c0d6f6fb80397ee17), [`9f415a7`](https://github.com/Effect-TS/effect/commit/9f415a7733cdf8aed7efadbed3b5db22890e164a), [`e367afd`](https://github.com/Effect-TS/effect/commit/e367afdacfa3041a694a67e4670e98a20e41d45c), [`d5d2112`](https://github.com/Effect-TS/effect/commit/d5d21120ff591fcf8da006ce340010812cc91f16), [`fa2e5af`](https://github.com/Effect-TS/effect/commit/fa2e5af4ccc8f3650d97049707be82eab098c168), [`6bf6427`](https://github.com/Effect-TS/effect/commit/6bf6427d195539c387c13156aff79db077929c8f), [`10bc4a4`](https://github.com/Effect-TS/effect/commit/10bc4a47c0ce5bc50ba1998d63a803e3887d1d2b), [`a9540d3`](https://github.com/Effect-TS/effect/commit/a9540d3d50fbe65ade7f9b2f478cdd34a888161e), [`3a250d7`](https://github.com/Effect-TS/effect/commit/3a250d7eb8c310bf4751b3eca0038cf50e1629d8), [`ce44141`](https://github.com/Effect-TS/effect/commit/ce44141ad1bc8d05f3f7399bfa1e87772573205d), [`9318e5b`](https://github.com/Effect-TS/effect/commit/9318e5bafb144ddff65a0bff0148ec4f7ba77b5c), [`c9ecebf`](https://github.com/Effect-TS/effect/commit/c9ecebf7ede8a98895552fd20223d6573bd846fe), [`32f8fbe`](https://github.com/Effect-TS/effect/commit/32f8fbe1a5985aea41754e87531e9a1d0fbf78ec), [`41d6af1`](https://github.com/Effect-TS/effect/commit/41d6af14b7f36e06ade3bf7333b710e73de1e1c2), [`c33fd59`](https://github.com/Effect-TS/effect/commit/c33fd599cb7d49117f77f7bd8f05cb4209112a34), [`1f9e9d3`](https://github.com/Effect-TS/effect/commit/1f9e9d3de552435de6b8f4e1166515d0964c3999), [`594fa71`](https://github.com/Effect-TS/effect/commit/594fa71da417bf94fa6c9be2d3d36c808197e9fe), [`b378c38`](https://github.com/Effect-TS/effect/commit/b378c383cdb29e819e24da5dc725479a2ba4fdf1), [`a9ec9a6`](https://github.com/Effect-TS/effect/commit/a9ec9a60bbe1309960e00527ab62342dce1a86fc), [`310a81b`](https://github.com/Effect-TS/effect/commit/310a81b391e24d42b6608b5e3d641eca63e0d4c0), [`aab2135`](https://github.com/Effect-TS/effect/commit/aab2135d3fe43d4d86c4e486ed378797314fb212), [`6744a72`](https://github.com/Effect-TS/effect/commit/6744a724869539fc2d733929df871ef523bf82e8), [`848d042`](https://github.com/Effect-TS/effect/commit/848d0426f287b3e7ff970219d980a4c66fa441ad), [`077a93e`](https://github.com/Effect-TS/effect/commit/077a93e5db3adbc42e531539cb12b8bdbdfe5328), [`aef50fb`](https://github.com/Effect-TS/effect/commit/aef50fb8b56ec9ff8116f157635579fefd995f26), [`2e4de86`](https://github.com/Effect-TS/effect/commit/2e4de8634431f3da08ca2a90ab1024ee08e216f3), [`482b104`](https://github.com/Effect-TS/effect/commit/482b104caf712a8d5f99aafc64e55b6ea38eb809), [`753e1ed`](https://github.com/Effect-TS/effect/commit/753e1ed88069f73103d136dcdc58188fd10efdf1), [`0d2bb4a`](https://github.com/Effect-TS/effect/commit/0d2bb4a4b6526e1767b81101ee6e8da88ba1de55), [`8161e03`](https://github.com/Effect-TS/effect/commit/8161e03c26d691502afeddcf7e2ee75e6931637f), [`49f5391`](https://github.com/Effect-TS/effect/commit/49f53918a150aa2ea0ce2d444400cec1d6097400), [`3d59bdf`](https://github.com/Effect-TS/effect/commit/3d59bdf6f8f95ceea2091e5b8f375b834a14b3b1), [`8866608`](https://github.com/Effect-TS/effect/commit/88666082f2b6296bb7115bd4a2546151039f64db), [`69fd4b1`](https://github.com/Effect-TS/effect/commit/69fd4b1fba9e2ec5e7c16058ff8d9a1f9a38d90e), [`7d97626`](https://github.com/Effect-TS/effect/commit/7d9762658e515807c2b98678e7abd3ebe94e41ec), [`0e79436`](https://github.com/Effect-TS/effect/commit/0e794366658bd067a2212ea2ac7ed0223904ed31), [`2f8a4e9`](https://github.com/Effect-TS/effect/commit/2f8a4e9b90822d9facfef59027b35819c42d7b48), [`800b753`](https://github.com/Effect-TS/effect/commit/800b7535b4e37a24ac458cae78231054dae0b0f5)]: + - effect@4.1.6 + ## 4.1.5 ### Patch Changes diff --git a/.repos/effect/packages/chat/discord/package.json b/.repos/effect/packages/chat/discord/package.json index d49bb02a70a15..2f6f65fda797d 100644 --- a/.repos/effect/packages/chat/discord/package.json +++ b/.repos/effect/packages/chat/discord/package.json @@ -1,6 +1,6 @@ { "name": "@effect/chat-discord", - "version": "4.1.5", + "version": "4.1.6", "type": "module", "license": "MIT", "description": "The Discord adapter for effect/chat", diff --git a/.repos/effect/packages/chat/slack/CHANGELOG.md b/.repos/effect/packages/chat/slack/CHANGELOG.md index 17dcd166b84a1..0fd127533976b 100644 --- a/.repos/effect/packages/chat/slack/CHANGELOG.md +++ b/.repos/effect/packages/chat/slack/CHANGELOG.md @@ -1,5 +1,12 @@ # @effect/chat-slack +## 4.1.6 + +### Patch Changes + +- Updated dependencies [[`dd5f2f3`](https://github.com/Effect-TS/effect/commit/dd5f2f322fbad042a3a186cef593bf42affe5ce9), [`1d65846`](https://github.com/Effect-TS/effect/commit/1d65846308a6a18c4a95af543988ad30b72ff2b3), [`694c28f`](https://github.com/Effect-TS/effect/commit/694c28f0cfc3eac33f71160d18dda95cb670f506), [`5aaa2cd`](https://github.com/Effect-TS/effect/commit/5aaa2cd216e5e55f92d06db98d4b54946a396eed), [`55814bf`](https://github.com/Effect-TS/effect/commit/55814bf0a780f05ed0a51c82c8affda5d539bb0e), [`92c40a1`](https://github.com/Effect-TS/effect/commit/92c40a1f96a59f9edcacee6c0d6f6fb80397ee17), [`9f415a7`](https://github.com/Effect-TS/effect/commit/9f415a7733cdf8aed7efadbed3b5db22890e164a), [`e367afd`](https://github.com/Effect-TS/effect/commit/e367afdacfa3041a694a67e4670e98a20e41d45c), [`d5d2112`](https://github.com/Effect-TS/effect/commit/d5d21120ff591fcf8da006ce340010812cc91f16), [`fa2e5af`](https://github.com/Effect-TS/effect/commit/fa2e5af4ccc8f3650d97049707be82eab098c168), [`6bf6427`](https://github.com/Effect-TS/effect/commit/6bf6427d195539c387c13156aff79db077929c8f), [`10bc4a4`](https://github.com/Effect-TS/effect/commit/10bc4a47c0ce5bc50ba1998d63a803e3887d1d2b), [`a9540d3`](https://github.com/Effect-TS/effect/commit/a9540d3d50fbe65ade7f9b2f478cdd34a888161e), [`3a250d7`](https://github.com/Effect-TS/effect/commit/3a250d7eb8c310bf4751b3eca0038cf50e1629d8), [`ce44141`](https://github.com/Effect-TS/effect/commit/ce44141ad1bc8d05f3f7399bfa1e87772573205d), [`9318e5b`](https://github.com/Effect-TS/effect/commit/9318e5bafb144ddff65a0bff0148ec4f7ba77b5c), [`c9ecebf`](https://github.com/Effect-TS/effect/commit/c9ecebf7ede8a98895552fd20223d6573bd846fe), [`32f8fbe`](https://github.com/Effect-TS/effect/commit/32f8fbe1a5985aea41754e87531e9a1d0fbf78ec), [`41d6af1`](https://github.com/Effect-TS/effect/commit/41d6af14b7f36e06ade3bf7333b710e73de1e1c2), [`c33fd59`](https://github.com/Effect-TS/effect/commit/c33fd599cb7d49117f77f7bd8f05cb4209112a34), [`1f9e9d3`](https://github.com/Effect-TS/effect/commit/1f9e9d3de552435de6b8f4e1166515d0964c3999), [`594fa71`](https://github.com/Effect-TS/effect/commit/594fa71da417bf94fa6c9be2d3d36c808197e9fe), [`b378c38`](https://github.com/Effect-TS/effect/commit/b378c383cdb29e819e24da5dc725479a2ba4fdf1), [`a9ec9a6`](https://github.com/Effect-TS/effect/commit/a9ec9a60bbe1309960e00527ab62342dce1a86fc), [`310a81b`](https://github.com/Effect-TS/effect/commit/310a81b391e24d42b6608b5e3d641eca63e0d4c0), [`aab2135`](https://github.com/Effect-TS/effect/commit/aab2135d3fe43d4d86c4e486ed378797314fb212), [`6744a72`](https://github.com/Effect-TS/effect/commit/6744a724869539fc2d733929df871ef523bf82e8), [`848d042`](https://github.com/Effect-TS/effect/commit/848d0426f287b3e7ff970219d980a4c66fa441ad), [`077a93e`](https://github.com/Effect-TS/effect/commit/077a93e5db3adbc42e531539cb12b8bdbdfe5328), [`aef50fb`](https://github.com/Effect-TS/effect/commit/aef50fb8b56ec9ff8116f157635579fefd995f26), [`2e4de86`](https://github.com/Effect-TS/effect/commit/2e4de8634431f3da08ca2a90ab1024ee08e216f3), [`482b104`](https://github.com/Effect-TS/effect/commit/482b104caf712a8d5f99aafc64e55b6ea38eb809), [`753e1ed`](https://github.com/Effect-TS/effect/commit/753e1ed88069f73103d136dcdc58188fd10efdf1), [`0d2bb4a`](https://github.com/Effect-TS/effect/commit/0d2bb4a4b6526e1767b81101ee6e8da88ba1de55), [`8161e03`](https://github.com/Effect-TS/effect/commit/8161e03c26d691502afeddcf7e2ee75e6931637f), [`49f5391`](https://github.com/Effect-TS/effect/commit/49f53918a150aa2ea0ce2d444400cec1d6097400), [`3d59bdf`](https://github.com/Effect-TS/effect/commit/3d59bdf6f8f95ceea2091e5b8f375b834a14b3b1), [`8866608`](https://github.com/Effect-TS/effect/commit/88666082f2b6296bb7115bd4a2546151039f64db), [`69fd4b1`](https://github.com/Effect-TS/effect/commit/69fd4b1fba9e2ec5e7c16058ff8d9a1f9a38d90e), [`7d97626`](https://github.com/Effect-TS/effect/commit/7d9762658e515807c2b98678e7abd3ebe94e41ec), [`0e79436`](https://github.com/Effect-TS/effect/commit/0e794366658bd067a2212ea2ac7ed0223904ed31), [`2f8a4e9`](https://github.com/Effect-TS/effect/commit/2f8a4e9b90822d9facfef59027b35819c42d7b48), [`800b753`](https://github.com/Effect-TS/effect/commit/800b7535b4e37a24ac458cae78231054dae0b0f5)]: + - effect@4.1.6 + ## 4.1.5 ### Patch Changes diff --git a/.repos/effect/packages/chat/slack/package.json b/.repos/effect/packages/chat/slack/package.json index 4aad311f2fd59..e9e01c6cdf178 100644 --- a/.repos/effect/packages/chat/slack/package.json +++ b/.repos/effect/packages/chat/slack/package.json @@ -1,6 +1,6 @@ { "name": "@effect/chat-slack", - "version": "4.1.5", + "version": "4.1.6", "type": "module", "license": "MIT", "description": "The Slack adapter for effect/chat", diff --git a/.repos/effect/packages/chat/teams/CHANGELOG.md b/.repos/effect/packages/chat/teams/CHANGELOG.md index 46c29a2fbcbfe..990ffdad3094e 100644 --- a/.repos/effect/packages/chat/teams/CHANGELOG.md +++ b/.repos/effect/packages/chat/teams/CHANGELOG.md @@ -1,5 +1,12 @@ # @effect/chat-teams +## 4.1.6 + +### Patch Changes + +- Updated dependencies [[`dd5f2f3`](https://github.com/Effect-TS/effect/commit/dd5f2f322fbad042a3a186cef593bf42affe5ce9), [`1d65846`](https://github.com/Effect-TS/effect/commit/1d65846308a6a18c4a95af543988ad30b72ff2b3), [`694c28f`](https://github.com/Effect-TS/effect/commit/694c28f0cfc3eac33f71160d18dda95cb670f506), [`5aaa2cd`](https://github.com/Effect-TS/effect/commit/5aaa2cd216e5e55f92d06db98d4b54946a396eed), [`55814bf`](https://github.com/Effect-TS/effect/commit/55814bf0a780f05ed0a51c82c8affda5d539bb0e), [`92c40a1`](https://github.com/Effect-TS/effect/commit/92c40a1f96a59f9edcacee6c0d6f6fb80397ee17), [`9f415a7`](https://github.com/Effect-TS/effect/commit/9f415a7733cdf8aed7efadbed3b5db22890e164a), [`e367afd`](https://github.com/Effect-TS/effect/commit/e367afdacfa3041a694a67e4670e98a20e41d45c), [`d5d2112`](https://github.com/Effect-TS/effect/commit/d5d21120ff591fcf8da006ce340010812cc91f16), [`fa2e5af`](https://github.com/Effect-TS/effect/commit/fa2e5af4ccc8f3650d97049707be82eab098c168), [`6bf6427`](https://github.com/Effect-TS/effect/commit/6bf6427d195539c387c13156aff79db077929c8f), [`10bc4a4`](https://github.com/Effect-TS/effect/commit/10bc4a47c0ce5bc50ba1998d63a803e3887d1d2b), [`a9540d3`](https://github.com/Effect-TS/effect/commit/a9540d3d50fbe65ade7f9b2f478cdd34a888161e), [`3a250d7`](https://github.com/Effect-TS/effect/commit/3a250d7eb8c310bf4751b3eca0038cf50e1629d8), [`ce44141`](https://github.com/Effect-TS/effect/commit/ce44141ad1bc8d05f3f7399bfa1e87772573205d), [`9318e5b`](https://github.com/Effect-TS/effect/commit/9318e5bafb144ddff65a0bff0148ec4f7ba77b5c), [`c9ecebf`](https://github.com/Effect-TS/effect/commit/c9ecebf7ede8a98895552fd20223d6573bd846fe), [`32f8fbe`](https://github.com/Effect-TS/effect/commit/32f8fbe1a5985aea41754e87531e9a1d0fbf78ec), [`41d6af1`](https://github.com/Effect-TS/effect/commit/41d6af14b7f36e06ade3bf7333b710e73de1e1c2), [`c33fd59`](https://github.com/Effect-TS/effect/commit/c33fd599cb7d49117f77f7bd8f05cb4209112a34), [`1f9e9d3`](https://github.com/Effect-TS/effect/commit/1f9e9d3de552435de6b8f4e1166515d0964c3999), [`594fa71`](https://github.com/Effect-TS/effect/commit/594fa71da417bf94fa6c9be2d3d36c808197e9fe), [`b378c38`](https://github.com/Effect-TS/effect/commit/b378c383cdb29e819e24da5dc725479a2ba4fdf1), [`a9ec9a6`](https://github.com/Effect-TS/effect/commit/a9ec9a60bbe1309960e00527ab62342dce1a86fc), [`310a81b`](https://github.com/Effect-TS/effect/commit/310a81b391e24d42b6608b5e3d641eca63e0d4c0), [`aab2135`](https://github.com/Effect-TS/effect/commit/aab2135d3fe43d4d86c4e486ed378797314fb212), [`6744a72`](https://github.com/Effect-TS/effect/commit/6744a724869539fc2d733929df871ef523bf82e8), [`848d042`](https://github.com/Effect-TS/effect/commit/848d0426f287b3e7ff970219d980a4c66fa441ad), [`077a93e`](https://github.com/Effect-TS/effect/commit/077a93e5db3adbc42e531539cb12b8bdbdfe5328), [`aef50fb`](https://github.com/Effect-TS/effect/commit/aef50fb8b56ec9ff8116f157635579fefd995f26), [`2e4de86`](https://github.com/Effect-TS/effect/commit/2e4de8634431f3da08ca2a90ab1024ee08e216f3), [`482b104`](https://github.com/Effect-TS/effect/commit/482b104caf712a8d5f99aafc64e55b6ea38eb809), [`753e1ed`](https://github.com/Effect-TS/effect/commit/753e1ed88069f73103d136dcdc58188fd10efdf1), [`0d2bb4a`](https://github.com/Effect-TS/effect/commit/0d2bb4a4b6526e1767b81101ee6e8da88ba1de55), [`8161e03`](https://github.com/Effect-TS/effect/commit/8161e03c26d691502afeddcf7e2ee75e6931637f), [`49f5391`](https://github.com/Effect-TS/effect/commit/49f53918a150aa2ea0ce2d444400cec1d6097400), [`3d59bdf`](https://github.com/Effect-TS/effect/commit/3d59bdf6f8f95ceea2091e5b8f375b834a14b3b1), [`8866608`](https://github.com/Effect-TS/effect/commit/88666082f2b6296bb7115bd4a2546151039f64db), [`69fd4b1`](https://github.com/Effect-TS/effect/commit/69fd4b1fba9e2ec5e7c16058ff8d9a1f9a38d90e), [`7d97626`](https://github.com/Effect-TS/effect/commit/7d9762658e515807c2b98678e7abd3ebe94e41ec), [`0e79436`](https://github.com/Effect-TS/effect/commit/0e794366658bd067a2212ea2ac7ed0223904ed31), [`2f8a4e9`](https://github.com/Effect-TS/effect/commit/2f8a4e9b90822d9facfef59027b35819c42d7b48), [`800b753`](https://github.com/Effect-TS/effect/commit/800b7535b4e37a24ac458cae78231054dae0b0f5)]: + - effect@4.1.6 + ## 4.1.5 ### Patch Changes diff --git a/.repos/effect/packages/chat/teams/package.json b/.repos/effect/packages/chat/teams/package.json index bea1b69328263..5e65ecc0ad0be 100644 --- a/.repos/effect/packages/chat/teams/package.json +++ b/.repos/effect/packages/chat/teams/package.json @@ -1,6 +1,6 @@ { "name": "@effect/chat-teams", - "version": "4.1.5", + "version": "4.1.6", "type": "module", "license": "MIT", "description": "The Microsoft Teams adapter for effect/chat", diff --git a/.repos/effect/packages/chat/telegram/CHANGELOG.md b/.repos/effect/packages/chat/telegram/CHANGELOG.md index 1d55f95ed81f4..8ddab4fd9a070 100644 --- a/.repos/effect/packages/chat/telegram/CHANGELOG.md +++ b/.repos/effect/packages/chat/telegram/CHANGELOG.md @@ -1,5 +1,12 @@ # @effect/chat-telegram +## 4.1.6 + +### Patch Changes + +- Updated dependencies [[`dd5f2f3`](https://github.com/Effect-TS/effect/commit/dd5f2f322fbad042a3a186cef593bf42affe5ce9), [`1d65846`](https://github.com/Effect-TS/effect/commit/1d65846308a6a18c4a95af543988ad30b72ff2b3), [`694c28f`](https://github.com/Effect-TS/effect/commit/694c28f0cfc3eac33f71160d18dda95cb670f506), [`5aaa2cd`](https://github.com/Effect-TS/effect/commit/5aaa2cd216e5e55f92d06db98d4b54946a396eed), [`55814bf`](https://github.com/Effect-TS/effect/commit/55814bf0a780f05ed0a51c82c8affda5d539bb0e), [`92c40a1`](https://github.com/Effect-TS/effect/commit/92c40a1f96a59f9edcacee6c0d6f6fb80397ee17), [`9f415a7`](https://github.com/Effect-TS/effect/commit/9f415a7733cdf8aed7efadbed3b5db22890e164a), [`e367afd`](https://github.com/Effect-TS/effect/commit/e367afdacfa3041a694a67e4670e98a20e41d45c), [`d5d2112`](https://github.com/Effect-TS/effect/commit/d5d21120ff591fcf8da006ce340010812cc91f16), [`fa2e5af`](https://github.com/Effect-TS/effect/commit/fa2e5af4ccc8f3650d97049707be82eab098c168), [`6bf6427`](https://github.com/Effect-TS/effect/commit/6bf6427d195539c387c13156aff79db077929c8f), [`10bc4a4`](https://github.com/Effect-TS/effect/commit/10bc4a47c0ce5bc50ba1998d63a803e3887d1d2b), [`a9540d3`](https://github.com/Effect-TS/effect/commit/a9540d3d50fbe65ade7f9b2f478cdd34a888161e), [`3a250d7`](https://github.com/Effect-TS/effect/commit/3a250d7eb8c310bf4751b3eca0038cf50e1629d8), [`ce44141`](https://github.com/Effect-TS/effect/commit/ce44141ad1bc8d05f3f7399bfa1e87772573205d), [`9318e5b`](https://github.com/Effect-TS/effect/commit/9318e5bafb144ddff65a0bff0148ec4f7ba77b5c), [`c9ecebf`](https://github.com/Effect-TS/effect/commit/c9ecebf7ede8a98895552fd20223d6573bd846fe), [`32f8fbe`](https://github.com/Effect-TS/effect/commit/32f8fbe1a5985aea41754e87531e9a1d0fbf78ec), [`41d6af1`](https://github.com/Effect-TS/effect/commit/41d6af14b7f36e06ade3bf7333b710e73de1e1c2), [`c33fd59`](https://github.com/Effect-TS/effect/commit/c33fd599cb7d49117f77f7bd8f05cb4209112a34), [`1f9e9d3`](https://github.com/Effect-TS/effect/commit/1f9e9d3de552435de6b8f4e1166515d0964c3999), [`594fa71`](https://github.com/Effect-TS/effect/commit/594fa71da417bf94fa6c9be2d3d36c808197e9fe), [`b378c38`](https://github.com/Effect-TS/effect/commit/b378c383cdb29e819e24da5dc725479a2ba4fdf1), [`a9ec9a6`](https://github.com/Effect-TS/effect/commit/a9ec9a60bbe1309960e00527ab62342dce1a86fc), [`310a81b`](https://github.com/Effect-TS/effect/commit/310a81b391e24d42b6608b5e3d641eca63e0d4c0), [`aab2135`](https://github.com/Effect-TS/effect/commit/aab2135d3fe43d4d86c4e486ed378797314fb212), [`6744a72`](https://github.com/Effect-TS/effect/commit/6744a724869539fc2d733929df871ef523bf82e8), [`848d042`](https://github.com/Effect-TS/effect/commit/848d0426f287b3e7ff970219d980a4c66fa441ad), [`077a93e`](https://github.com/Effect-TS/effect/commit/077a93e5db3adbc42e531539cb12b8bdbdfe5328), [`aef50fb`](https://github.com/Effect-TS/effect/commit/aef50fb8b56ec9ff8116f157635579fefd995f26), [`2e4de86`](https://github.com/Effect-TS/effect/commit/2e4de8634431f3da08ca2a90ab1024ee08e216f3), [`482b104`](https://github.com/Effect-TS/effect/commit/482b104caf712a8d5f99aafc64e55b6ea38eb809), [`753e1ed`](https://github.com/Effect-TS/effect/commit/753e1ed88069f73103d136dcdc58188fd10efdf1), [`0d2bb4a`](https://github.com/Effect-TS/effect/commit/0d2bb4a4b6526e1767b81101ee6e8da88ba1de55), [`8161e03`](https://github.com/Effect-TS/effect/commit/8161e03c26d691502afeddcf7e2ee75e6931637f), [`49f5391`](https://github.com/Effect-TS/effect/commit/49f53918a150aa2ea0ce2d444400cec1d6097400), [`3d59bdf`](https://github.com/Effect-TS/effect/commit/3d59bdf6f8f95ceea2091e5b8f375b834a14b3b1), [`8866608`](https://github.com/Effect-TS/effect/commit/88666082f2b6296bb7115bd4a2546151039f64db), [`69fd4b1`](https://github.com/Effect-TS/effect/commit/69fd4b1fba9e2ec5e7c16058ff8d9a1f9a38d90e), [`7d97626`](https://github.com/Effect-TS/effect/commit/7d9762658e515807c2b98678e7abd3ebe94e41ec), [`0e79436`](https://github.com/Effect-TS/effect/commit/0e794366658bd067a2212ea2ac7ed0223904ed31), [`2f8a4e9`](https://github.com/Effect-TS/effect/commit/2f8a4e9b90822d9facfef59027b35819c42d7b48), [`800b753`](https://github.com/Effect-TS/effect/commit/800b7535b4e37a24ac458cae78231054dae0b0f5)]: + - effect@4.1.6 + ## 4.1.5 ### Patch Changes diff --git a/.repos/effect/packages/chat/telegram/package.json b/.repos/effect/packages/chat/telegram/package.json index 1739e0be8170e..5a46c52b6c6e0 100644 --- a/.repos/effect/packages/chat/telegram/package.json +++ b/.repos/effect/packages/chat/telegram/package.json @@ -1,6 +1,6 @@ { "name": "@effect/chat-telegram", - "version": "4.1.5", + "version": "4.1.6", "type": "module", "license": "MIT", "description": "The Telegram Bot API adapter for effect/chat", diff --git a/.repos/effect/packages/chat/whatsapp/CHANGELOG.md b/.repos/effect/packages/chat/whatsapp/CHANGELOG.md index 572f452dadb19..51e1e015fb03c 100644 --- a/.repos/effect/packages/chat/whatsapp/CHANGELOG.md +++ b/.repos/effect/packages/chat/whatsapp/CHANGELOG.md @@ -1,5 +1,12 @@ # @effect/chat-whatsapp +## 4.1.6 + +### Patch Changes + +- Updated dependencies [[`dd5f2f3`](https://github.com/Effect-TS/effect/commit/dd5f2f322fbad042a3a186cef593bf42affe5ce9), [`1d65846`](https://github.com/Effect-TS/effect/commit/1d65846308a6a18c4a95af543988ad30b72ff2b3), [`694c28f`](https://github.com/Effect-TS/effect/commit/694c28f0cfc3eac33f71160d18dda95cb670f506), [`5aaa2cd`](https://github.com/Effect-TS/effect/commit/5aaa2cd216e5e55f92d06db98d4b54946a396eed), [`55814bf`](https://github.com/Effect-TS/effect/commit/55814bf0a780f05ed0a51c82c8affda5d539bb0e), [`92c40a1`](https://github.com/Effect-TS/effect/commit/92c40a1f96a59f9edcacee6c0d6f6fb80397ee17), [`9f415a7`](https://github.com/Effect-TS/effect/commit/9f415a7733cdf8aed7efadbed3b5db22890e164a), [`e367afd`](https://github.com/Effect-TS/effect/commit/e367afdacfa3041a694a67e4670e98a20e41d45c), [`d5d2112`](https://github.com/Effect-TS/effect/commit/d5d21120ff591fcf8da006ce340010812cc91f16), [`fa2e5af`](https://github.com/Effect-TS/effect/commit/fa2e5af4ccc8f3650d97049707be82eab098c168), [`6bf6427`](https://github.com/Effect-TS/effect/commit/6bf6427d195539c387c13156aff79db077929c8f), [`10bc4a4`](https://github.com/Effect-TS/effect/commit/10bc4a47c0ce5bc50ba1998d63a803e3887d1d2b), [`a9540d3`](https://github.com/Effect-TS/effect/commit/a9540d3d50fbe65ade7f9b2f478cdd34a888161e), [`3a250d7`](https://github.com/Effect-TS/effect/commit/3a250d7eb8c310bf4751b3eca0038cf50e1629d8), [`ce44141`](https://github.com/Effect-TS/effect/commit/ce44141ad1bc8d05f3f7399bfa1e87772573205d), [`9318e5b`](https://github.com/Effect-TS/effect/commit/9318e5bafb144ddff65a0bff0148ec4f7ba77b5c), [`c9ecebf`](https://github.com/Effect-TS/effect/commit/c9ecebf7ede8a98895552fd20223d6573bd846fe), [`32f8fbe`](https://github.com/Effect-TS/effect/commit/32f8fbe1a5985aea41754e87531e9a1d0fbf78ec), [`41d6af1`](https://github.com/Effect-TS/effect/commit/41d6af14b7f36e06ade3bf7333b710e73de1e1c2), [`c33fd59`](https://github.com/Effect-TS/effect/commit/c33fd599cb7d49117f77f7bd8f05cb4209112a34), [`1f9e9d3`](https://github.com/Effect-TS/effect/commit/1f9e9d3de552435de6b8f4e1166515d0964c3999), [`594fa71`](https://github.com/Effect-TS/effect/commit/594fa71da417bf94fa6c9be2d3d36c808197e9fe), [`b378c38`](https://github.com/Effect-TS/effect/commit/b378c383cdb29e819e24da5dc725479a2ba4fdf1), [`a9ec9a6`](https://github.com/Effect-TS/effect/commit/a9ec9a60bbe1309960e00527ab62342dce1a86fc), [`310a81b`](https://github.com/Effect-TS/effect/commit/310a81b391e24d42b6608b5e3d641eca63e0d4c0), [`aab2135`](https://github.com/Effect-TS/effect/commit/aab2135d3fe43d4d86c4e486ed378797314fb212), [`6744a72`](https://github.com/Effect-TS/effect/commit/6744a724869539fc2d733929df871ef523bf82e8), [`848d042`](https://github.com/Effect-TS/effect/commit/848d0426f287b3e7ff970219d980a4c66fa441ad), [`077a93e`](https://github.com/Effect-TS/effect/commit/077a93e5db3adbc42e531539cb12b8bdbdfe5328), [`aef50fb`](https://github.com/Effect-TS/effect/commit/aef50fb8b56ec9ff8116f157635579fefd995f26), [`2e4de86`](https://github.com/Effect-TS/effect/commit/2e4de8634431f3da08ca2a90ab1024ee08e216f3), [`482b104`](https://github.com/Effect-TS/effect/commit/482b104caf712a8d5f99aafc64e55b6ea38eb809), [`753e1ed`](https://github.com/Effect-TS/effect/commit/753e1ed88069f73103d136dcdc58188fd10efdf1), [`0d2bb4a`](https://github.com/Effect-TS/effect/commit/0d2bb4a4b6526e1767b81101ee6e8da88ba1de55), [`8161e03`](https://github.com/Effect-TS/effect/commit/8161e03c26d691502afeddcf7e2ee75e6931637f), [`49f5391`](https://github.com/Effect-TS/effect/commit/49f53918a150aa2ea0ce2d444400cec1d6097400), [`3d59bdf`](https://github.com/Effect-TS/effect/commit/3d59bdf6f8f95ceea2091e5b8f375b834a14b3b1), [`8866608`](https://github.com/Effect-TS/effect/commit/88666082f2b6296bb7115bd4a2546151039f64db), [`69fd4b1`](https://github.com/Effect-TS/effect/commit/69fd4b1fba9e2ec5e7c16058ff8d9a1f9a38d90e), [`7d97626`](https://github.com/Effect-TS/effect/commit/7d9762658e515807c2b98678e7abd3ebe94e41ec), [`0e79436`](https://github.com/Effect-TS/effect/commit/0e794366658bd067a2212ea2ac7ed0223904ed31), [`2f8a4e9`](https://github.com/Effect-TS/effect/commit/2f8a4e9b90822d9facfef59027b35819c42d7b48), [`800b753`](https://github.com/Effect-TS/effect/commit/800b7535b4e37a24ac458cae78231054dae0b0f5)]: + - effect@4.1.6 + ## 4.1.5 ### Patch Changes diff --git a/.repos/effect/packages/chat/whatsapp/package.json b/.repos/effect/packages/chat/whatsapp/package.json index 81260f7f720eb..1b88a8a925ea0 100644 --- a/.repos/effect/packages/chat/whatsapp/package.json +++ b/.repos/effect/packages/chat/whatsapp/package.json @@ -1,6 +1,6 @@ { "name": "@effect/chat-whatsapp", - "version": "4.1.5", + "version": "4.1.6", "type": "module", "license": "MIT", "description": "The WhatsApp Cloud API adapter for effect/chat", diff --git a/.repos/effect/packages/effect/CHANGELOG.md b/.repos/effect/packages/effect/CHANGELOG.md index bd7430e52f9c9..4092a943bf611 100644 --- a/.repos/effect/packages/effect/CHANGELOG.md +++ b/.repos/effect/packages/effect/CHANGELOG.md @@ -1,5 +1,102 @@ # effect +## 4.1.6 + +### Patch Changes + +- [#10845](https://github.com/Effect-TS/effect/pull/10845) [`dd5f2f3`](https://github.com/Effect-TS/effect/commit/dd5f2f322fbad042a3a186cef593bf42affe5ce9) Thanks @effect-bot! - Add standalone `effect/ai/Skill` module and accept `Skill` values in `McpServer.registerSkill` and `McpServer.skill`. + +- [#10893](https://github.com/Effect-TS/effect/pull/10893) [`1d65846`](https://github.com/Effect-TS/effect/commit/1d65846308a6a18c4a95af543988ad30b72ff2b3) Thanks @Marve10s! - Fix `Atom.subscriptionRef` setters throwing `AsyncFiberError` when another update holds the ref lock. + +- [#10821](https://github.com/Effect-TS/effect/pull/10821) [`694c28f`](https://github.com/Effect-TS/effect/commit/694c28f0cfc3eac33f71160d18dda95cb670f506) Thanks @effect-bot! - Use `Buffer` for `Base64` and `Base64Url` encoding and decoding when native `Uint8Array` Base64 methods are unavailable. + +- [#10802](https://github.com/Effect-TS/effect/pull/10802) [`5aaa2cd`](https://github.com/Effect-TS/effect/commit/5aaa2cd216e5e55f92d06db98d4b54946a396eed) Thanks @KhraksMamtsov! - Fix `Effect.catchReasons` error-channel inference for exhaustive handlers and failing `orElse` fallbacks. + +- [#10901](https://github.com/Effect-TS/effect/pull/10901) [`55814bf`](https://github.com/Effect-TS/effect/commit/55814bf0a780f05ed0a51c82c8affda5d539bb0e) Thanks @EnesKartal! - Fix data-first `Effect.catchTag` type inference for inline calls such as `Effect.map(...)`. + +- [#10883](https://github.com/Effect-TS/effect/pull/10883) [`92c40a1`](https://github.com/Effect-TS/effect/commit/92c40a1f96a59f9edcacee6c0d6f6fb80397ee17) Thanks @effect-bot! - Fix cluster `Entity.keepAlive` being dropped when disabled and immediately re-enabled. + +- [#10812](https://github.com/Effect-TS/effect/pull/10812) [`9f415a7`](https://github.com/Effect-TS/effect/commit/9f415a7733cdf8aed7efadbed3b5db22890e164a) Thanks @AVtheking! - Fix a memory leak in cluster `MessageStorage.registerReplyHandler` when interrupted reply waiters leave stale request entries behind. + +- [#10908](https://github.com/Effect-TS/effect/pull/10908) [`e367afd`](https://github.com/Effect-TS/effect/commit/e367afdacfa3041a694a67e4670e98a20e41d45c) Thanks @effect-bot! - Fix cluster shard rebalancing stalling workflow activity waits until `entityTerminationTimeout` once in-flight activities complete. + +- [#10840](https://github.com/Effect-TS/effect/pull/10840) [`d5d2112`](https://github.com/Effect-TS/effect/commit/d5d21120ff591fcf8da006ce340010812cc91f16) Thanks @SelmanBoray! - Fix `HttpMiddleware.cors` omitting the `Access-Control-Max-Age` header when `maxAge` is `0`. + +- [#10906](https://github.com/Effect-TS/effect/pull/10906) [`fa2e5af`](https://github.com/Effect-TS/effect/commit/fa2e5af4ccc8f3650d97049707be82eab098c168) Thanks @effect-bot! - Importing `Effect` or `Schedule` no longer makes AOT compilers such as `scriptc` require `Intl`; `Schedule.cron` still needs it. + +- [#10892](https://github.com/Effect-TS/effect/pull/10892) [`6bf6427`](https://github.com/Effect-TS/effect/commit/6bf6427d195539c387c13156aff79db077929c8f) Thanks @Marve10s! - Preserve the input offset in `DateTime.setParts` when valid for the updated local time, falling back to compatible disambiguation otherwise. Edits during or moving into a repeated DST hour from the later offset now stay in the second occurrence (e.g. setting `hour: 1` on `03:30 EST` yields `01:30 EST`). + +- [#10925](https://github.com/Effect-TS/effect/pull/10925) [`10bc4a4`](https://github.com/Effect-TS/effect/commit/10bc4a47c0ce5bc50ba1998d63a803e3887d1d2b) Thanks @effect-bot! - Avoid uncached structural hashing in `Equal.equals` for plain objects and arrays, speeding up one-off structural comparisons while preserving custom `Hash` and cached-hash rejections. Also fixes `Equal.equals` and `Hash.hash` to include inherited properties on objects with custom prototypes whose `constructor` is `Object` (such as `Object.create({ ... })`). + +- [#10860](https://github.com/Effect-TS/effect/pull/10860) [`a9540d3`](https://github.com/Effect-TS/effect/commit/a9540d3d50fbe65ade7f9b2f478cdd34a888161e) Thanks @effect-bot! - Fix `FetchHttpClient` to resolve `globalThis.fetch` on each request instead of caching the first reference it sees. + +- [#10835](https://github.com/Effect-TS/effect/pull/10835) [`3a250d7`](https://github.com/Effect-TS/effect/commit/3a250d7eb8c310bf4751b3eca0038cf50e1629d8) Thanks @Marve10s! - Fix stream `Atom`s settling as `Success` when completing without emitting; they now fail with `NoSuchElementError` and keep `previousSuccess`. + +- [#10836](https://github.com/Effect-TS/effect/pull/10836) [`ce44141`](https://github.com/Effect-TS/effect/commit/ce44141ad1bc8d05f3f7399bfa1e87772573205d) Thanks @Marve10s! - Fix `Chat` history ordering so approved or denied tool results are placed before the assistant response. + +- [#10819](https://github.com/Effect-TS/effect/pull/10819) [`9318e5b`](https://github.com/Effect-TS/effect/commit/9318e5bafb144ddff65a0bff0148ec4f7ba77b5c) Thanks @effect-bot! - Fix forked fibers interrupted before starting sometimes running their effect instead of exiting interrupted. + +- [#10854](https://github.com/Effect-TS/effect/pull/10854) [`c9ecebf`](https://github.com/Effect-TS/effect/commit/c9ecebf7ede8a98895552fd20223d6573bd846fe) Thanks @effect-bot! - Add the missing runtime `pipe` method to `RpcGroup`. + +- [#10850](https://github.com/Effect-TS/effect/pull/10850) [`32f8fbe`](https://github.com/Effect-TS/effect/commit/32f8fbe1a5985aea41754e87531e9a1d0fbf78ec) Thanks @yasirmalik36! - Redact schema-backed `Redacted` params, query, headers, and bodyless payloads in `HttpApi` spans and client errors without listing them in `HttpApi.RedactedNames`. + +- [#10922](https://github.com/Effect-TS/effect/pull/10922) [`41d6af1`](https://github.com/Effect-TS/effect/commit/41d6af14b7f36e06ade3bf7333b710e73de1e1c2) Thanks @yxshee! - Add `JoseError.CryptoFailed` in `effect/jose`: an unsupported signing or encryption provider now returns `JoseError.CryptoFailed` instead of `InvalidKey`, while rejected keys still return `InvalidKey`. + +- [#10898](https://github.com/Effect-TS/effect/pull/10898) [`c33fd59`](https://github.com/Effect-TS/effect/commit/c33fd599cb7d49117f77f7bd8f05cb4209112a34) Thanks @asssslay! - Preserve leading U+FEFF characters when reading string values from `KeyValueStore.layerFileSystem` and `KeyValueStore.layerSql`. + +- [#10902](https://github.com/Effect-TS/effect/pull/10902) [`1f9e9d3`](https://github.com/Effect-TS/effect/commit/1f9e9d3de552435de6b8f4e1166515d0964c3999) Thanks @asssslay! - Fix `LayerRef` reusing the previous context after invalidation or refresh while an earlier borrower still holds it. + +- [#10817](https://github.com/Effect-TS/effect/pull/10817) [`594fa71`](https://github.com/Effect-TS/effect/commit/594fa71da417bf94fa6c9be2d3d36c808197e9fe) Thanks @effect-bot! - Add RFC 8288 `Link` header support (`Headers.parseLink`, `Headers.formatLink`, `Schema.LinkHeaderFromString`, `HttpClientResponse.links`/`link`) and header-appending helpers (`Headers.append`, `HttpClientRequest.appendHeader`, `HttpServerResponse.appendHeader`). + +- [#10876](https://github.com/Effect-TS/effect/pull/10876) [`b378c38`](https://github.com/Effect-TS/effect/commit/b378c383cdb29e819e24da5dc725479a2ba4fdf1) Thanks @jasonkuhrt! - `Match.tags`, `Match.tagsExhaustive`, `Match.tagStartsWith`, `Match.discriminator`, `Match.discriminatorStartsWith`, `Match.discriminators`, `Match.discriminatorsExhaustive`, `Match.literals` and `Match.literalsExhaustive` now accept `Match.fn` matchers and pass the selector's arguments to their handlers. + +- [#10875](https://github.com/Effect-TS/effect/pull/10875) [`a9ec9a6`](https://github.com/Effect-TS/effect/commit/a9ec9a60bbe1309960e00527ab62342dce1a86fc) Thanks @jasonkuhrt! - Fix `Match.type` passing the matched input twice to case and `orElse` handlers. + +- [#10834](https://github.com/Effect-TS/effect/pull/10834) [`310a81b`](https://github.com/Effect-TS/effect/commit/310a81b391e24d42b6608b5e3d641eca63e0d4c0) Thanks @Marve10s! - Fix `Migrator` skipping a migration with id `0` (such as `0000_init`) on a fresh database. + +- [#10811](https://github.com/Effect-TS/effect/pull/10811) [`aab2135`](https://github.com/Effect-TS/effect/commit/aab2135d3fe43d4d86c4e486ed378797314fb212) Thanks @asssslay! - Fix `Order.clamp` (and module `clamp` wrappers) returning the bound instead of the input value when the input compares equal to a bound. + +- [#10887](https://github.com/Effect-TS/effect/pull/10887) [`6744a72`](https://github.com/Effect-TS/effect/commit/6744a724869539fc2d733929df871ef523bf82e8) Thanks @effect-bot! - Bound the OTLP pending export queue with configurable `maxQueueSize` and `onDrop`, cap each batch at `maxBatchSize` with configurable `concurrency` (default `4`, supporting `"unbounded"`, with `OtlpMetrics` serialized at `1`), and make `Flusher.flush` await all in-flight work and pre-flush items without cancelling shared exports on interruption. + +- [#10820](https://github.com/Effect-TS/effect/pull/10820) [`848d042`](https://github.com/Effect-TS/effect/commit/848d0426f287b3e7ff970219d980a4c66fa441ad) Thanks @effect-bot! - Trace batched `RpcClient.layerProtocolHttp` requests in a root `RpcClient.batch` span linked to each caller span. + +- [#10916](https://github.com/Effect-TS/effect/pull/10916) [`077a93e`](https://github.com/Effect-TS/effect/commit/077a93e5db3adbc42e531539cb12b8bdbdfe5328) Thanks @gcanti! - The code that generates TypeScript for built-in schemas and checks now lives in `Codegen`. This makes bundles smaller for apps that use `Schema` without generating code. + + - If you previously read `annotations.toCode` from a built-in, pass its representation to `Codegen.Module.addSchemas` and call `module.print()` to get the TypeScript source. + - Custom types can still define `toCode`. If you change a built-in's representation ID, provide your own `toCode` to tell the generator what to write. + - The generator uses the arguments recorded when you create a schema or check. If you later change a `Date` used as a bound, the generated code uses the original date. + +- [#10920](https://github.com/Effect-TS/effect/pull/10920) [`aef50fb`](https://github.com/Effect-TS/effect/commit/aef50fb8b56ec9ff8116f157635579fefd995f26) Thanks @effect-bot! - Memoize nested schema compilations in `Schema.toEquivalence` so shared sub-schemas are compiled once instead of once per path. + +- [#10899](https://github.com/Effect-TS/effect/pull/10899) [`2e4de86`](https://github.com/Effect-TS/effect/commit/2e4de8634431f3da08ca2a90ab1024ee08e216f3) Thanks @asssslay! - Fix `ScopedCache.get` to move reloaded expired entries to the most recently used position so they are not evicted next at capacity. + +- [#10872](https://github.com/Effect-TS/effect/pull/10872) [`482b104`](https://github.com/Effect-TS/effect/commit/482b104caf712a8d5f99aafc64e55b6ea38eb809) Thanks @effect-bot! - Reduce the overhead of `SqlClient` transactions and savepoints by avoiding a redundant copy of the caller's services. + +- [#10891](https://github.com/Effect-TS/effect/pull/10891) [`753e1ed`](https://github.com/Effect-TS/effect/commit/753e1ed88069f73103d136dcdc58188fd10efdf1) Thanks @Marve10s! - Fix `Stream.toAsyncIterable` dropping values or leaving reads pending after closing when `next()` calls overlap. + +- [#10857](https://github.com/Effect-TS/effect/pull/10857) [`0d2bb4a`](https://github.com/Effect-TS/effect/commit/0d2bb4a4b6526e1767b81101ee6e8da88ba1de55) Thanks @effect-bot! - Start both input sides immediately in `Stream.merge` and `Channel.merge`. + +- [#10829](https://github.com/Effect-TS/effect/pull/10829) [`8161e03`](https://github.com/Effect-TS/effect/commit/8161e03c26d691502afeddcf7e2ee75e6931637f) Thanks @Marve10s! - Fix `String.linesIterator` and `String.linesWithSeparators` iterators restarting from the first line when iterated again, instead of continuing from their current position. + +- [#10818](https://github.com/Effect-TS/effect/pull/10818) [`49f5391`](https://github.com/Effect-TS/effect/commit/49f53918a150aa2ea0ce2d444400cec1d6097400) Thanks @effect-bot! - Fix `Workflow.intoResult` to capture compensation defects in terminal `Complete` results when `Workflow.CaptureDefects` is enabled. + +- [#10844](https://github.com/Effect-TS/effect/pull/10844) [`3d59bdf`](https://github.com/Effect-TS/effect/commit/3d59bdf6f8f95ceea2091e5b8f375b834a14b3b1) Thanks @RhysSullivan! - Fix `Workflow.execute` with `{ discard: true }` being interrupted before dispatch when a sibling suspends on a durable wait. + +- [#10847](https://github.com/Effect-TS/effect/pull/10847) [`8866608`](https://github.com/Effect-TS/effect/commit/88666082f2b6296bb7115bd4a2546151039f64db) Thanks @effect-bot! - Fix `effect/workflow` suspending on durable waits before sibling child workflows, including discarded starts, are dispatched. + +- [#10868](https://github.com/Effect-TS/effect/pull/10868) [`69fd4b1`](https://github.com/Effect-TS/effect/commit/69fd4b1fba9e2ec5e7c16058ff8d9a1f9a38d90e) Thanks @effect-bot! - Fail with a defect instead of hanging when a workflow awaits its own execution. + +- [#10885](https://github.com/Effect-TS/effect/pull/10885) [`7d97626`](https://github.com/Effect-TS/effect/commit/7d9762658e515807c2b98678e7abd3ebe94e41ec) Thanks @effect-bot! - Fix shared child workflow executions leaving additional waiting parents suspended in `ClusterWorkflowEngine`, `WorkflowEngine.layerMemory`, and `CloudflareWorkflowEngine`. + + - `MessageStorage` / `MessageStorage.Encoded`: custom implementations must add `requestsForAddress({ address, tag })`, returning all saved requests (`Envelope.PartialRequestEncoded`, processed or unprocessed, across shards) matching `entityType`, `entityId`, and `tag` exactly. + - `SqlMessageStorage`: migration `0006_address_index` adds an `(entity_type, entity_id, tag)` index on the messages table. + +- [#10909](https://github.com/Effect-TS/effect/pull/10909) [`0e79436`](https://github.com/Effect-TS/effect/commit/0e794366658bd067a2212ea2ac7ed0223904ed31) Thanks @effect-bot! - Fix `Activity.retry` under `Workflow.SuspendOnFailure` so failed attempts reach the retry policy instead of suspending immediately. If the policy is exhausted and the error escapes, the workflow suspends and `resume` replays the stored failures. + +- [#10913](https://github.com/Effect-TS/effect/pull/10913) [`2f8a4e9`](https://github.com/Effect-TS/effect/commit/2f8a4e9b90822d9facfef59027b35819c42d7b48) Thanks @adrian-gierakowski! - Fix memory retention across suspended workflow replays in `ClusterWorkflowEngine` and `WorkflowEngine.layerMemory`. Replays now share a workflow scope while it has no finalizers, so a finalizer or compensation registered late through an earlier run's handle can observe the final run's exit instead of `Exit.void`. + +- [#10684](https://github.com/Effect-TS/effect/pull/10684) [`800b753`](https://github.com/Effect-TS/effect/commit/800b7535b4e37a24ac458cae78231054dae0b0f5) Thanks @jpowersdev! - Support Clark-notation namespace matching (`{uri}local`, `{*}local`, `{}local`) in `Xml.elements`, and preserve `namespace` and `localName` on collected elements and `Xml.toEvents` output. + ## 4.1.5 ### Patch Changes diff --git a/.repos/effect/packages/effect/package.json b/.repos/effect/packages/effect/package.json index 84e1668185be8..ef4ef74f51343 100644 --- a/.repos/effect/packages/effect/package.json +++ b/.repos/effect/packages/effect/package.json @@ -1,7 +1,7 @@ { "name": "effect", "type": "module", - "version": "4.1.5", + "version": "4.1.6", "license": "MIT", "description": "The missing standard library for TypeScript, for writing production-grade software.", "homepage": "https://effect.website", @@ -153,10 +153,10 @@ "esbuild": "^0.28.2", "fake-indexeddb": "^6.2.8", "immer": "^11.2.10", - "jose": "6.2.17", + "jose": "6.2.18", "miniflare": "5.20260925.0-alpha", "protobufjs": "^8.8.1", - "tinybench": "^6.2.3", + "tinybench": "^6.2.4", "valibot": "^1.5.0" } } diff --git a/.repos/effect/packages/effect/src/Channel.ts b/.repos/effect/packages/effect/src/Channel.ts index 7ee65593566c6..cf983b51c4a99 100644 --- a/.repos/effect/packages/effect/src/Channel.ts +++ b/.repos/effect/packages/effect/src/Channel.ts @@ -7,6 +7,23 @@ * higher-level modules instead. This module is useful when implementing stream * operators or specialized streaming workflows. * + * Every channel runs in a scope supplied by its consumer, called the channel + * scope. The run functions create that scope and close it before they return, + * however the channel ends: completion, failure, defect, an early stop by a + * downstream operator, or interruption. `toPull` and `toPullScoped` use the + * scope they are given and leave closing it to its owner. Operators that run + * inner channels, such as `flatMap` and `concat`, may give each inner channel + * a child scope that closes sooner. + * + * `acquireUseRelease`, `ensuring`, `onExit`, and `scoped` finalize when their + * channel ends on its own (completion, failure, or defect), before downstream + * observes that end. `callback`, `callbackArray`, `unwrap`, and + * `acquireRelease` register finalizers in the channel scope, so they run when + * that scope closes. A channel that is abandoned because a downstream operator + * stopped pulling from it is finalized no later than when its channel scope + * closes. Under `toPull`, that can be after the pull has returned its final + * result, so close the scope to release what the channel still holds. + * * @stability stable * @since 2.0.0 */ @@ -496,6 +513,12 @@ const asyncQueue = ( /** * Creates a `Channel` that interacts with a callback function using a queue. * + * **Details** + * + * The callback effect runs in the channel scope. Finalizers it registers, for + * example with `Effect.acquireRelease`, run when that scope closes, not when + * the queue ends. + * * **Example** (Creating channels from callbacks) * * ```ts import.meta.vitest @@ -528,6 +551,12 @@ export const callback = ( /** * Creates a `Channel` that interacts with a callback function using a queue, emitting arrays. * + * **Details** + * + * The callback effect runs in the channel scope. Finalizers it registers, for + * example with `Effect.acquireRelease`, run when that scope closes, not when + * the queue ends. + * * **Example** (Creating array channels from callbacks) * * ```ts import.meta.vitest @@ -585,6 +614,10 @@ export const suspend = ( * Acquisition is uninterruptible. If acquisition fails, `use` is not run and * `release` is not registered. * + * The finalizer runs when the channel ends on its own (completion, failure, or + * defect), before downstream observes that end. If a downstream operator stops + * pulling first, it runs no later than when the channel scope closes. + * * **Example** (Managing resources with acquire-use-release) * * ```ts import.meta.vitest @@ -630,8 +663,9 @@ export const acquireUseRelease = [["resource"], ["resource"]] * ``` * + * @see {@link acquireUseRelease} for releasing when the channel itself ends + * * @stability stable * @category constructors * @since 4.0.0 @@ -6760,7 +6796,7 @@ export const merge: { }) ) ), - Effect.forkIn(forkedScope) + Effect.forkIn(forkedScope, { startImmediately: true }) ) yield* runSide("left", left, Scope.forkUnsafe(forkedScope)) yield* runSide("right", right, Scope.forkUnsafe(forkedScope)) @@ -7145,6 +7181,11 @@ export const restoreUpstreamFailure = ( * Constructs a `Channel` from a scoped effect that will result in a * `Channel` if successful. * + * **Details** + * + * The effect runs in the channel scope, so finalizers it registers run when + * that scope closes. + * * **Example** (Unwrapping channel effects) * * ```ts import.meta.vitest @@ -7188,6 +7229,14 @@ export const unwrap = ( /** * Converts a channel to a Pull within an existing scope. * + * **Details** + * + * The channel runs in the provided scope, which the pull leaves open; close it + * to release any resources the channel still holds. + * * **Example** (Converting channels to scoped pulls) * * ```ts import.meta.vitest diff --git a/.repos/effect/packages/effect/src/Codegen.ts b/.repos/effect/packages/effect/src/Codegen.ts index 7fffb12584c09..e601c468bc71b 100644 --- a/.repos/effect/packages/effect/src/Codegen.ts +++ b/.repos/effect/packages/effect/src/Codegen.ts @@ -509,11 +509,16 @@ export class Module { * Returned keys preserve the requested names even when declaration names must change to avoid collisions. * A root that references a definition of the same name reuses that definition's binding. * The module remains open for further declarations; imports and initialization order are resolved when printing. + * Built-in declarations and filters use their recorded representation ID and payload, including after a JSON + * round trip. A custom `toCode` annotation takes precedence. Replacing a built-in ID with a custom ID requires + * supplying a callback for that ID. * * **Gotchas** * - * Recursive representations must contain explicit suspensions. Custom declarations and checks require supported - * `toCode` callbacks. Each callback is called once and its exceptions pass through unchanged. + * Recursive representations must contain explicit suspensions. Custom declarations and individual filters require + * supported `toCode` callbacks. Each callback is called once and its exceptions pass through unchanged. + * An explicit `toCode: undefined` disables built-in lookup on a live declaration or filter. + * Mutable arguments such as date bounds are printed from the values recorded at schema creation. * Callback output supports imports, qualified names, generic and structural types, API calls, * literal/object/array arguments, and zero-argument arrows. Unsupported syntax throws with its document path. * When another declaration eagerly uses a returned binding, include it in that declaration's dependencies. diff --git a/.repos/effect/packages/effect/src/Effect.ts b/.repos/effect/packages/effect/src/Effect.ts index b8a95b3720513..dbed5d3d695a8 100644 --- a/.repos/effect/packages/effect/src/Effect.ts +++ b/.repos/effect/packages/effect/src/Effect.ts @@ -84,6 +84,7 @@ import type { ExcludeTag, ExtractReason, ExtractTag, + IsUnion, NarrowReason, NoInfer, OmitReason, @@ -2932,12 +2933,13 @@ export const catchTag: { > < A, - E, - R, - const K extends Tags | Arr.NonEmptyReadonlyArray>, - R1, - E1, - A1, + // Default `E` to `any` so `K` is not rejected while TS defers an inline `self` (e.g. `Effect.map(...)`) + E = any, + R = unknown, + const K extends Tags | Arr.NonEmptyReadonlyArray> = never, + R1 = unknown, + E1 = unknown, + A1 = unknown, A2 = unassigned, E2 = never, R2 = never @@ -3189,6 +3191,22 @@ export const catchReason: { > } = internal.catchReason +type RequiredCaseKeys = { + [RK in keyof Cases & string]: {} extends Record ? never + : [Cases] extends [Record) => any>] ? RK + : never +}[keyof Cases & string] + +type CaseReturn = Cases extends unknown ? ReturnType) => any>> + : never + +type UnhandledParent = {} extends Record ? ExtractTag + : IsUnion extends true ? ExtractTag + : ExtractTag extends infer P + ? P extends { readonly reason: { readonly _tag: string } } ? [ExcludeReason] extends [never] ? never : P + : P + : never + /** * Catches multiple reasons within a tagged error using an object of handlers. * @@ -3198,6 +3216,8 @@ export const catchReason: { * is converted to a defect, preserving reason order and interrupts. An * interruption alongside a typed error does not prevent recovery. * + * Only own enumerable properties of `cases` are matched; inherited properties are ignored. + * * **Example** (Handling multiple error reasons) * * ```ts import.meta.vitest @@ -3245,37 +3265,57 @@ export const catchReasons: { error: NarrowReason, K>, RK> ) => Effect }, - A2 = unassigned, + // `A2`, `E2` and `R2` are only for calls that pass explicit type arguments. + A2 = never, E2 = never, - R2 = never + R2 = never, + Ret extends Effect = Effect + >( + errorTag: K, + cases: Cases, + orElse: ( + reason: ExcludeReason, K>, RequiredCaseKeys>, + error: OmitReason, K>, RequiredCaseKeys> + ) => Ret + ): ( + self: Effect + ) => Effect< + A | Success>, + | ExcludeTag + | UnhandledParent + | Error>, + R | Services> + > + < + K extends Tags, + E, + Cases extends { + [RK in ReasonTags, K>>]+?: ( + reason: ExtractReason, K>, RK>, + error: NarrowReason, K>, RK> + ) => Effect + }, + A2 = never, + E2 = never, + R2 = never, + Ret extends Effect = Effect >( errorTag: K, cases: Cases, orElse?: | (( - reason: ExcludeReason, K>, Extract>, - error: OmitReason, K>, Extract> - ) => Effect) + reason: ExcludeReason, K>, RequiredCaseKeys>, + error: OmitReason, K>, RequiredCaseKeys> + ) => Ret) | undefined ): ( self: Effect ) => Effect< - | A - | Exclude - | { - [RK in keyof Cases]: Cases[RK] extends (...args: Array) => Effect ? A : never - }[keyof Cases], + A | Success>, | ExcludeTag - | E2 - | (A2 extends unassigned ? ExtractTag : never) - | { - [RK in keyof Cases]: Cases[RK] extends (...args: Array) => Effect ? E : never - }[keyof Cases], - | R - | R2 - | { - [RK in keyof Cases]: Cases[RK] extends (...args: Array) => Effect ? R : never - }[keyof Cases] + | UnhandledParent> + | Error>, + R | Services> > < A, @@ -3288,36 +3328,56 @@ export const catchReasons: { error: NarrowReason, RK> ) => Effect }, - A2 = unassigned, + A2 = never, E2 = never, - R2 = never + R2 = never, + Ret extends Effect = Effect + >( + self: Effect, + errorTag: K, + cases: Cases, + orElse: ( + reason: ExcludeReason, K>, RequiredCaseKeys>, + error: OmitReason, K>, RequiredCaseKeys> + ) => Ret + ): Effect< + A | Success>, + | ExcludeTag + | UnhandledParent + | Error>, + R | Services> + > + < + A, + E, + R, + K extends Tags, + Cases extends { + [RK in ReasonTags>]+?: ( + reason: ExtractReason, RK>, + error: NarrowReason, RK> + ) => Effect + }, + A2 = never, + E2 = never, + R2 = never, + Ret extends Effect = Effect >( self: Effect, errorTag: K, cases: Cases, orElse?: | (( - reason: ExcludeReason, K>, Extract>, - error: OmitReason, K>, Extract> - ) => Effect) + reason: ExcludeReason, K>, RequiredCaseKeys>, + error: OmitReason, K>, RequiredCaseKeys> + ) => Ret) | undefined ): Effect< - | A - | Exclude - | { - [RK in keyof Cases]: Cases[RK] extends (...args: Array) => Effect ? A : never - }[keyof Cases], + A | Success>, | ExcludeTag - | E2 - | (A2 extends unassigned ? ExtractTag : never) - | { - [RK in keyof Cases]: Cases[RK] extends (...args: Array) => Effect ? E : never - }[keyof Cases], - | R - | R2 - | { - [RK in keyof Cases]: Cases[RK] extends (...args: Array) => Effect ? R : never - }[keyof Cases] + | UnhandledParent> + | Error>, + R | Services> > } = internal.catchReasons @@ -8686,6 +8746,11 @@ export const annotateSpans: { /** * Adds an annotation to the current span if available. * + * **Details** + * + * Does nothing when there is no current span or when the nearest parent span is + * an `ExternalSpan`. + * * **Example** (Annotating the current span) * * ```ts import.meta.vitest @@ -8717,8 +8782,9 @@ export const annotateCurrentSpan: { * * **Details** * - * The effect fails with `NoSuchElementError` when there is no active local - * `Span`. + * The effect fails with `NoSuchElementError` when there is no parent span or + * when the nearest parent span is an `ExternalSpan`. Use `currentParentSpan` to + * read either kind. * * **Example** (Reading the current span) * diff --git a/.repos/effect/packages/effect/src/Equal.ts b/.repos/effect/packages/effect/src/Equal.ts index 459e76d9e60a5..c61ec8df3e455 100644 --- a/.repos/effect/packages/effect/src/Equal.ts +++ b/.repos/effect/packages/effect/src/Equal.ts @@ -12,7 +12,8 @@ */ import type { Equivalence } from "./Equivalence.ts" import * as Hash from "./Hash.ts" -import { bufferBytes, byReferenceInstances, getAllObjectKeys, isArrayBufferLike, viewBytes } from "./internal/equal.ts" +import { byReferenceInstances, getAllObjectKeys, objectKind, toBytes } from "./internal/equal.ts" +import { addBackEdge, backEdges, hashCache } from "./internal/hash.ts" import { hasProperty } from "./Predicate.ts" /** @@ -133,14 +134,14 @@ export interface Equal extends Hash.Hash { * Functions without an `Equal` implementation compare by reference. Circular * structures use coinductive equality. * - * Hash values are checked first as a fast-path rejection. The function also - * supports dual data-last usage: call it with one argument to get a curried - * predicate. + * Custom `Hash` implementations and already-cached structural hashes are + * checked first as a fast-path rejection. The function also supports dual + * data-last usage: call it with one argument to get a curried predicate. * * **Gotchas** * * - Object-pair results are cached in a WeakMap. **Objects must not be - * be mutated after their first comparison.** + * mutated after their first comparison.** * - Map and Set entries are matched within groups of equal hashes, so they * are O(n) for well-distributed hashes and O(n²) when every hash collides. * @@ -184,114 +185,121 @@ export function equals(): any { } function compareBoth(self: unknown, that: unknown): boolean { - if (self === that) return true - if (self == null || that == null) return false + if (self == null || that == null) return self === that const selfType = typeof self - if (selfType !== typeof that) { - return false + if (selfType !== "object" && selfType !== "function") { + return self === that || (self !== self && that !== that) } - // Special case for NaN: NaN should be considered equal to NaN - if (selfType === "number" && self !== self && that !== that) { + if (self === that) { + // A shared reference can close a cycle on one side; hashing records any back-edge. + if (pathLeft.length > 0 && !hashCache.has(self)) Hash.hash(self) return true } - if (selfType !== "object" && selfType !== "function") { - return false - } - - if (byReferenceInstances.has(self) || byReferenceInstances.has(that)) { + if (selfType !== typeof that || byReferenceInstances.has(self) || byReferenceInstances.has(that)) { return false } - return compareObjects(self, that) } function compareObjects(self: object, that: object): boolean { const depth = pathLeft.length - // A repeated pair closes a cycle under coinductive equality. + const prev = seen.get(self) + if (prev === that) return true + let known: WeakMap | undefined + if (!depth || prev !== undefined) { + known = results.get(self) + const cached = known?.get(that) + if (cached !== undefined) return cached + } + let revisited = false for (let i = depth; i-- > 0;) { - if (pathLeft[i] === self && pathRight[i] === that) return true + const sameLeft = pathLeft[i] === self + if (sameLeft || pathRight[i] === that) { + addBackEdge() + // A repeated pair closes a cycle under coinductive equality. + if (sameLeft && pathRight[i] === that) return true + revisited = true + } } - if (depth) return compareOnPath(self, that) - // Only outermost results are independent of path assumptions. - let known = results.get(self) - if (!known) results.set(self, known = new WeakMap()) - let result = known.get(that) - if (result === undefined) known.set(that, result = compareOnPath(self, that)) - return result -} - -function compareOnPath(self: object, that: object): boolean { + // Reject mismatched cycle lengths instead of unrolling both loops. + if (revisited && Hash.hash(self) !== Hash.hash(that)) return false + const seenBack = backEdges pathLeft.push(self) pathRight.push(that) + let result: boolean try { - return compareStructure(self, that) + result = compareStructure(self, that) } finally { pathLeft.pop() pathRight.pop() + if (!depth) seen.clear() + } + // Cyclic hashes depend on entry point; verify hash agreement. + if (seenBack !== backEdges) return result && Hash.hash(self) === Hash.hash(that) + // Only cache acyclic results so nested lookups never skip a back-edge. + if (depth && prev === undefined) { + if (result) seen.set(self, that) + } else { + if (!known) results.set(self, known = new WeakMap()) + known.set(that, result) } + return result } // The pairs on the current comparison's path (the coinductive assumptions). const pathLeft: Array = [] const pathRight: Array = [] +const seen = new Map() const results = new WeakMap>() function compareStructure(self: object, that: object): boolean { - if (Hash.hash(self) !== Hash.hash(that)) { - return false - } else if (self instanceof Date) { - if (!(that instanceof Date)) return false - const selfTime = self.getTime() - const thatTime = that.getTime() - return selfTime === thatTime || (Number.isNaN(selfTime) && Number.isNaN(thatTime)) - } else if (self instanceof RegExp) { - return that instanceof RegExp && self.toString() === that.toString() + const selfHash = hashCache.get(self) + if (selfHash !== undefined && selfHash !== (hashCache.get(that) ?? selfHash)) return false + const kind = objectKind(self) + if (kind === 1 || kind === 2) { + if (objectKind(that) !== kind) return false + if (kind === 2) return self.toString() === that.toString() + if (Hash.hash(self) !== Hash.hash(that)) return false + const a = (self as Date).getTime() + const b = (that as Date).getTime() + return a === b || (a !== a && b !== b) } const bothEquals = isEqual(self) if (bothEquals !== isEqual(that) || (typeof self === "function" && !bothEquals)) { return false - } else if (bothEquals) { + } + if ((bothEquals || Hash.isHash(self) || Hash.isHash(that)) && Hash.hash(self) !== Hash.hash(that)) { + return false + } + if (bothEquals) { return (self as Equal)[symbol](that as Equal) - } else if (Array.isArray(self)) { - if (!Array.isArray(that) || self.length !== that.length) { - return false - } - return compareArrays(self, that) - } else if (isArrayBufferLike(self)) { - if (!isArrayBufferLike(that) || (self instanceof ArrayBuffer) !== (that instanceof ArrayBuffer)) { - return false - } - const selfBytes = bufferBytes(self) - const thatBytes = bufferBytes(that) + } + if (kind !== objectKind(that)) { + return false + } + if (kind >= 7) { + const selfBytes = toBytes(self as ArrayBufferLike | DataView, kind) + const thatBytes = toBytes(that as ArrayBufferLike | DataView, kind) return selfBytes !== undefined && thatBytes !== undefined && compareTypedArrays(selfBytes, thatBytes) - } else if (ArrayBuffer.isView(self)) { - const selfIsDataView = self instanceof DataView - if ( - !ArrayBuffer.isView(that) || - self.byteLength !== that.byteLength || - selfIsDataView !== (that instanceof DataView) - ) { - return false - } - if (selfIsDataView) { - return compareTypedArrays(viewBytes(self), viewBytes(that as DataView)) - } - return compareTypedArrays(self as Uint8Array, that as Uint8Array) - } else if (self instanceof Map) { - if (!(that instanceof Map) || self.size !== that.size) { - return false - } - return compareHashed(self, that, entryHash, equalEntries) - } else if (self instanceof Set) { - if (!(that instanceof Set) || self.size !== that.size) { - return false - } - return compareHashed(self, that, Hash.hash, compareBoth) + } else if (kind === 5) { + return compareArrays(self as Array, that as Array) + } else if (kind === 6) { + return (self as ArrayBufferView).byteLength === (that as ArrayBufferView).byteLength && + compareTypedArrays(self as Uint8Array, that as Uint8Array) + } else if (kind === 3) { + return (self as Map).size === (that as Map).size && + compareHashed(self as Map, that as Map, entryHash, equalEntries) + } else if (kind === 4) { + return (self as Set).size === (that as Set).size && + compareHashed(self as Set, that as Set, Hash.hash, compareBoth) } return compareRecords(self as any, that as any) } function compareArrays(self: Array, that: Array): boolean { + if (self.length !== that.length) { + return false + } for (let i = 0; i < self.length; i++) { if (!compareBoth(self[i], that[i])) { return false @@ -319,17 +327,15 @@ function compareRecords( ): boolean { const selfKeys = getAllObjectKeys(self) const thatKeys = getAllObjectKeys(that) - - if (selfKeys.size !== thatKeys.size) { + const thatIsSet = thatKeys instanceof Set + if ((selfKeys instanceof Set ? selfKeys.size : selfKeys.length) !== (thatIsSet ? thatKeys.size : thatKeys.length)) { return false } - for (const key of selfKeys) { - if (!(thatKeys.has(key)) || !compareBoth(self[key], that[key])) { + if (!(thatIsSet ? thatKeys.has(key) : Object.hasOwn(that, key)) || !compareBoth(self[key], that[key])) { return false } } - return true } diff --git a/.repos/effect/packages/effect/src/Hash.ts b/.repos/effect/packages/effect/src/Hash.ts index b165a31544d95..3f84b9ce39c55 100644 --- a/.repos/effect/packages/effect/src/Hash.ts +++ b/.repos/effect/packages/effect/src/Hash.ts @@ -11,8 +11,8 @@ * @since 2.0.0 */ import { dual } from "./Function.ts" -import { bufferBytes, byReferenceInstances, getAllObjectKeys, isArrayBufferLike, viewBytes } from "./internal/equal.ts" -import { addBackEdge, backEdges } from "./internal/hash.ts" +import { byReferenceInstances, getAllObjectKeys, objectKind, toBytes } from "./internal/equal.ts" +import { addBackEdge, backEdges, hashCache } from "./internal/hash.ts" import { hasProperty } from "./Predicate.ts" /** @@ -117,13 +117,15 @@ export const hash: (self: A) => number = (self: A) => { case "object": { if (self === null) { break - } else if (self instanceof Date) { - if (Number.isNaN(self.getTime())) { + } + const kind = objectKind(self) + if (kind === 1) { + if (Number.isNaN((self as any as Date).getTime())) { return string("Invalid Date") } - return string(self.toISOString()) - } else if (self instanceof RegExp) { - return string(self.toString()) + return string((self as any as Date).toISOString()) + } else if (kind === 2) { + return string((self as any as RegExp).toString()) } else { if (byReferenceInstances.has(self)) { return random(self) @@ -144,17 +146,15 @@ export const hash: (self: A) => number = (self: A) => { h = (self as Hash)[symbol]() } else if (typeof self === "function") { h = random(self) - } else if (isArrayBufferLike(self)) { - const bytes = bufferBytes(self) - h = bytes === undefined ? random(self) : array(bytes) - } else if (self instanceof DataView) { - h = array(viewBytes(self)) - } else if (Array.isArray(self) || ArrayBuffer.isView(self)) { - h = array(self as any) - } else if (self instanceof Map) { - h = hashMap(self) - } else if (self instanceof Set) { - h = hashSet(self) + } else if (kind >= 7) { + const bytes = toBytes(self as any, kind) + h = bytes === undefined ? random(self) : hashIndexed(bytes) + } else if (kind >= 5) { + h = hashIndexed(self as any) + } else if (kind === 3) { + h = hashMap(self as any) + } else if (kind === 4) { + h = hashSet(self as any) } else { h = structure(self) } @@ -203,10 +203,11 @@ export const hash: (self: A) => number = (self: A) => { * @since 2.0.0 */ export const random: (self: A) => number = (self) => { - if (!randomHashCache.has(self)) { - randomHashCache.set(self, optimize((Math.random() * 0x100000000) | 0)) + let h = randomHashCache.get(self) + if (h === undefined) { + randomHashCache.set(self, h = optimize((Math.random() * 0x100000000) | 0)) } - return randomHashCache.get(self)! + return h } // 32-bit MurmurHash3 finalizer. @@ -518,6 +519,14 @@ export const array = (arr: Iterable): number => { return optimize(h) } +const hashIndexed = (arr: ArrayLike): number => { + let h = 6151 + for (let i = 0; i < arr.length; i++) { + h = combine(h, hash(arr[i])) + } + return optimize(h) +} + const hashMap: (map: Iterable) => number = unordered( string("Map"), ([k, v]) => combine(hash(k), hash(v)) @@ -526,5 +535,4 @@ const setSeed = string("Set") const hashSet: (set: Iterable) => number = unordered(setSeed, (element) => combine(setSeed, hash(element))) const randomHashCache = new WeakMap() -const hashCache = new WeakMap() const visitedObjects = new WeakSet() diff --git a/.repos/effect/packages/effect/src/LayerRef.ts b/.repos/effect/packages/effect/src/LayerRef.ts index d795751f16019..71b9018036a99 100644 --- a/.repos/effect/packages/effect/src/LayerRef.ts +++ b/.repos/effect/packages/effect/src/LayerRef.ts @@ -16,7 +16,7 @@ import { getStackTraceLimit, setStackTraceLimit } from "./internal/stackTraceLim import * as Layer from "./Layer.ts" import * as RcRef from "./RcRef.ts" import type * as Schedule from "./Schedule.ts" -import * as Scope from "./Scope.ts" +import type * as Scope from "./Scope.ts" import type { Mutable } from "./Types.ts" const TypeId = "~effect/LayerRef" @@ -157,11 +157,13 @@ export const make = Effect.fnUntraced( Scope.Scope | R | SR > { const context = yield* Effect.context() - const memoMap = Layer.CurrentMemoMap.forkOrCreate(context) const rcRef = yield* RcRef.make({ - acquire: Effect.contextWith((_: Context.Context) => - Layer.buildWithMemoMap(layer, memoMap, Context.get(_, Scope.Scope)) + // Fork the creation-time memo map per acquisition so rebuilds don't reuse + // a live borrow (`Layer.build` would inherit the borrower's memo map). + acquire: Effect.flatMap( + Effect.scope, + (scope) => Layer.buildWithMemoMap(layer, Layer.CurrentMemoMap.forkOrCreate(context), scope) ), idleTimeToLive: options?.idleTimeToLive }) diff --git a/.repos/effect/packages/effect/src/Logger.ts b/.repos/effect/packages/effect/src/Logger.ts index 16edc09af1a51..25b0952349664 100644 --- a/.repos/effect/packages/effect/src/Logger.ts +++ b/.repos/effect/packages/effect/src/Logger.ts @@ -7,6 +7,11 @@ * logger references, console routing helpers, built-in formatters, batching, * file logging, and layers for installing loggers. * + * When a log effect (`Effect.log`, `Effect.logWithLevel`, or a level-specific + * variant) invokes a logger, it does so synchronously in the logging fiber + * before the log effect completes. A logger that defers work says so in its own + * documentation, as `batched` and `toFile` do. + * * @stability stable * @since 2.0.0 */ @@ -37,9 +42,9 @@ const TypeId = "~effect/Logger" * * **Details** * - * The runtime calls `log` with the message, level, cause, fiber, and timestamp - * for each log event. Use `Logger.layer` to install one or more loggers for an - * effect. + * The runtime calls `log` synchronously, in the fiber that logs, with the + * message, level, cause, fiber, and timestamp for each log event. Use + * `Logger.layer` to install one or more loggers for an effect. * * **Example** (Creating custom loggers) * @@ -198,6 +203,10 @@ export const LogToStderr: Context.Reference = effect.LogToStderr * Use when an existing logger's output should be transformed without recreating the * logging logic. * + * **Details** + * + * The returned logger calls `self` and then `f` inside the same `log` call. + * * **Example** (Transforming logger output) * * ```ts import.meta.vitest @@ -245,6 +254,10 @@ export const map = dual< * Use when a logger's string or object output should be routed to `console.log` for * development or debugging. * + * **Details** + * + * Writes to the console inside the `log` call. + * * **Example** (Writing logger output with console.log) * * ```ts import.meta.vitest @@ -286,6 +299,10 @@ export const withConsoleLog = ( * Use when logger output should be routed to `console.error`, such as error logs that * should appear on stderr instead of stdout. * + * **Details** + * + * Writes to the console inside the `log` call. + * * **Example** (Writing logger output with console.error) * * ```ts import.meta.vitest @@ -324,8 +341,9 @@ export const withConsoleError = ( * * **Details** * - * Will use the appropriate console method (i.e. `console.log`, `console.error`, - * etc.) based upon the current `LogLevel`. + * Writes to the console inside the `log` call. Will use the appropriate console + * method (i.e. `console.log`, `console.error`, etc.) based upon the current + * `LogLevel`. * * `Debug` uses `console.debug`, `Info` uses `console.info`, `Trace` uses * `console.trace`, `Warn` uses `console.warn`, `Error` and `Fatal` use @@ -456,6 +474,12 @@ const format = ( * * The log function receives an options object containing the message, log level, * cause, fiber information, and timestamp, and should return the desired output. + * `log` is called synchronously in the fiber that logs, before the log effect + * completes. + * + * **Gotchas** + * + * If `log` throws, the log effect dies with the thrown value as a defect. * * **Example** (Creating loggers from functions) * @@ -684,9 +708,11 @@ export const formatJson = map(formatStructured, Formatter.formatJson) * * **Details** * - * The returned effect starts a scoped background process that periodically - * passes buffered outputs to `flush`. When the scope closes, the background - * process is interrupted and any remaining buffered entries are flushed. + * The returned logger formats each event with `self` and buffers the output + * during the log call. A background fiber passes pending entries to `flush` + * once per window, skipping empty windows. When the scope closes, the + * background fiber is interrupted and the scope finalizer flushes any remaining + * entries. * * **Example** (Batching logger output) * @@ -997,8 +1023,10 @@ export const consoleJson: Logger = withConsoleLog(formatJson) * **Details** * * This logger integrates logging with distributed tracing by recording - * all log messages as events on the current trace span, making them visible - * in tracing tools like OpenTelemetry, Jaeger, or Zipkin. + * all log messages as events on the current local span, making them visible + * in tracing tools like OpenTelemetry, Jaeger, or Zipkin. A log made with no + * current span, or while the nearest parent span is an `ExternalSpan`, is not + * recorded by this logger. * * This logger is included in the default set of loggers for all Effect programs, * so log messages automatically appear as span events unless you override the @@ -1082,9 +1110,10 @@ export const layer = < * * **Details** * - * The returned effect requires `FileSystem` and `Scope`. The file logger batches - * string output, writes each batch to the specified path, and flushes remaining - * entries when the scope closes. + * The returned effect requires `FileSystem` and `Scope`. The file logger is + * built on `batched`, so each log call formats and buffers its string output. + * Each flushed batch is written to the specified path, and remaining entries + * are flushed when the scope closes. * * **Example** (Writing JSON logs to a file) * diff --git a/.repos/effect/packages/effect/src/Match.ts b/.repos/effect/packages/effect/src/Match.ts index f01ead1feab83..e3e984aafa3d5 100644 --- a/.repos/effect/packages/effect/src/Match.ts +++ b/.repos/effect/packages/effect/src/Match.ts @@ -29,12 +29,12 @@ const TypeId = internal.TypeId // intersection loses contextual typing for nested generic calls (microsoft/TypeScript#52864). type Contextual = [P] extends [never] ? Fallback : P -type TagHandlers = { - readonly [Tag in Types.Tags & string]: (_: Extract>) => Ret +type TagHandlers> = { + readonly [Tag in Types.Tags & string]: (_: Extract>, ...args: Args) => Ret } -type PartialTagHandlers = { - readonly [Tag in Types.Tags & string]?: ((_: Extract>) => Ret) | undefined +type PartialTagHandlers> = { + readonly [Tag in Types.Tags & string]?: ((_: Extract>, ...args: Args) => Ret) | undefined } type ValueTagHandlers = { @@ -54,13 +54,13 @@ type LiteralKeys> = R extends string | numb : R : never -type LiteralHandlers = [Exclude>] extends [never] ? { - readonly [K in LiteralKeys]: (_: K) => Ret +type LiteralHandlers> = [Exclude>] extends [never] ? { + readonly [K in LiteralKeys]: (_: K, ...args: Args) => Ret } : never -type PartialLiteralHandlers = { - readonly [K in LiteralKeys]?: ((_: K) => Ret) | undefined +type PartialLiteralHandlers> = { + readonly [K in LiteralKeys]?: ((_: K, ...args: Args) => Ret) | undefined } // Map keys separately so handler-map unions do not distribute. @@ -876,17 +876,24 @@ export const whenAnd: < */ export const discriminator: ( field: D -) => & string, Ret, Fn extends (_: Extract>) => Ret>( +) => < + R, + P extends Types.Tags & string, + Ret, + Fn extends (_: Extract>, ...args: Args) => Ret, + Args extends Array = [] +>( ...pattern: [first: P, ...values: Array

, f: Fn] ) => ( - self: Matcher + self: Matcher ) => Matcher< I, Types.AddWithout>>, Types.ApplyFilters>>>, A | ReturnType, Pr, - Ret + Ret, + Args > = internal.discriminator /** @@ -928,18 +935,25 @@ export const discriminator: ( */ export const discriminatorStartsWith: ( field: D -) => >) => Ret>( +) => < + R, + P extends string, + Ret, + Fn extends (_: Extract>, ...args: Args) => Ret, + Args extends Array = [] +>( pattern: P, f: Fn ) => ( - self: Matcher + self: Matcher ) => Matcher< I, Types.AddWithout>>, Types.ApplyFilters>>>, A | ReturnType, Pr, - Ret + Ret, + Args > = internal.discriminatorStartsWith /** @@ -996,19 +1010,21 @@ export const discriminators: ( R, Ret, P extends - & PartialTagHandlers - & { readonly [Tag in Exclude>]: never } + & PartialTagHandlers + & { readonly [Tag in Exclude>]: never }, + Args extends Array = [] >( - fields: Contextual> + fields: Contextual> ) => ( - self: Matcher + self: Matcher ) => Matcher< I, Types.AddWithout>>>, Types.ApplyFilters>>>>, A | ReturnType, Pr, - Ret + Ret, + Args > = internal.discriminators /** @@ -1060,14 +1076,16 @@ export const discriminatorsExhaustive: ( R, Ret, P extends - & TagHandlers - & { readonly [Tag in Exclude>]: never } + & TagHandlers + & { readonly [Tag in Exclude>]: never }, + Args extends Array = [] >( - fields: Contextual> + fields: Contextual> ) => ( - self: Matcher -) => [Pr] extends [never] ? (u: I) => Unify> : Unify> = - internal.discriminatorsExhaustive + self: Matcher +) => [Pr] extends [never] ? [Args] extends [[]] ? (u: I) => Unify> + : (...args: Args) => Unify> + : Unify> = internal.discriminatorsExhaustive /** * Matches discriminated union members by their `_tag` field. @@ -1167,19 +1185,21 @@ export const tagStartsWith: < R, P extends string, Ret, - Fn extends (_: Extract>) => Ret + Fn extends (_: Extract>, ...args: Args) => Ret, + Args extends Array = [] >( pattern: P, f: Fn ) => ( - self: Matcher + self: Matcher ) => Matcher< I, Types.AddWithout>>, Types.ApplyFilters>>>, ReturnType | A, Pr, - Ret + Ret, + Args > = internal.tagStartsWith /** @@ -1223,19 +1243,21 @@ export const tags: < R, Ret, P extends - & PartialTagHandlers<"_tag", R, Ret> - & { readonly [Tag in Exclude>]: never } + & PartialTagHandlers<"_tag", R, Ret, Args> + & { readonly [Tag in Exclude>]: never }, + Args extends Array = [] >( - fields: Contextual> + fields: Contextual> ) => ( - self: Matcher + self: Matcher ) => Matcher< I, Types.AddWithout>>>, Types.ApplyFilters>>>>, A | ReturnType, Pr, - Ret + Ret, + Args > = internal.tags /** @@ -1279,14 +1301,16 @@ export const tagsExhaustive: < R, Ret, P extends - & TagHandlers<"_tag", R, Ret> - & { readonly [Tag in Exclude>]: never } + & TagHandlers<"_tag", R, Ret, Args> + & { readonly [Tag in Exclude>]: never }, + Args extends Array = [] >( - fields: Contextual> + fields: Contextual> ) => ( - self: Matcher -) => [Pr] extends [never] ? (u: I) => Unify> : Unify> = - internal.tagsExhaustive + self: Matcher +) => [Pr] extends [never] ? [Args] extends [[]] ? (u: I) => Unify> + : (...args: Args) => Unify> + : Unify> = internal.tagsExhaustive /** * Matches string and number literal values, mapping each literal to a @@ -1327,19 +1351,21 @@ export const literals: < R, Ret, P extends - & PartialLiteralHandlers - & { readonly [K in Exclude>]: never } + & PartialLiteralHandlers + & { readonly [K in Exclude>]: never }, + Args extends Array = [] >( - fields: Contextual> + fields: Contextual> ) => ( - self: Matcher + self: Matcher ) => Matcher< I, Types.AddWithout>>, Types.ApplyFilters>>>, A | ReturnType, Pr, - Ret + Ret, + Args > = internal.literals /** @@ -1381,14 +1407,16 @@ export const literalsExhaustive: < R, Ret, P extends - & LiteralHandlers - & { readonly [K in Exclude>]: never } + & LiteralHandlers + & { readonly [K in Exclude>]: never }, + Args extends Array = [] >( - fields: Contextual> + fields: Contextual> ) => ( - self: Matcher -) => [Pr] extends [never] ? (u: I) => Unify> : Unify> = - internal.literalsExhaustive + self: Matcher +) => [Pr] extends [never] ? [Args] extends [[]] ? (u: I) => Unify> + : (...args: Args) => Unify> + : Unify> = internal.literalsExhaustive /** * Creates a pattern that excludes a specific value while allowing all others. diff --git a/.repos/effect/packages/effect/src/Order.ts b/.repos/effect/packages/effect/src/Order.ts index 81bef35a82325..2f76036c0b4bc 100644 --- a/.repos/effect/packages/effect/src/Order.ts +++ b/.repos/effect/packages/effect/src/Order.ts @@ -916,7 +916,7 @@ export const clamp = (O: Order): { (self: A, options: { minimum: A maximum: A - }): A => min(O)(options.maximum, max(O)(options.minimum, self)) + }): A => min(O)(max(O)(self, options.minimum), options.maximum) ) /** diff --git a/.repos/effect/packages/effect/src/Schema.ts b/.repos/effect/packages/effect/src/Schema.ts index 8d367459354ef..7c4563d5e93d0 100644 --- a/.repos/effect/packages/effect/src/Schema.ts +++ b/.repos/effect/packages/effect/src/Schema.ts @@ -6913,7 +6913,6 @@ export function isTrimmed(annotations?: Annotations.Filter) { payload: null }, toJsonSchema: () => ({ pattern: regExp.source }), - toCode: () => ({ runtime: "Schema.isTrimmed()" }), arbitraryConstraint: { patterns: [{ source: TRIMMED_PATTERN, flags: "" }] }, @@ -6948,12 +6947,8 @@ export function isPattern( const source = regExp.source const flags = regExp.flags const canExport = /^[dg]*uy?$/.test(flags) - const runtimeRegExp = flags === "" - ? `new globalThis.RegExp(${format(source)})` - : `new globalThis.RegExp(${format(source)}, ${format(flags)})` return SchemaAST.isPattern(regExp, { toJsonSchema: () => canExport ? { pattern: flags.endsWith("y") ? `^(?:${source})` : source } : [{}, true], - toCode: () => ({ runtime: `Schema.isPattern(${runtimeRegExp})` }), ...annotations }) } @@ -6977,10 +6972,7 @@ export function isPattern( * @since 4.0.0 */ export function isStringFinite(annotations?: Annotations.Filter): SchemaAST.Filter { - return SchemaAST.isStringFinite({ - toCode: () => ({ runtime: "Schema.isStringFinite()" }), - ...annotations - }) + return SchemaAST.isStringFinite(annotations) } /** * Validates that a string is a signed base-10 integer literal for Effect's @@ -7001,10 +6993,7 @@ export function isStringFinite(annotations?: Annotations.Filter): SchemaAST.Filt * @since 4.0.0 */ export function isStringBigInt(annotations?: Annotations.Filter): SchemaAST.Filter { - return SchemaAST.isStringBigInt({ - toCode: () => ({ runtime: "Schema.isStringBigInt()" }), - ...annotations - }) + return SchemaAST.isStringBigInt(annotations) } /** * Validates that a string has the `Symbol(description)` format used by Effect's @@ -7020,10 +7009,7 @@ export function isStringBigInt(annotations?: Annotations.Filter): SchemaAST.Filt * @since 4.0.0 */ export function isStringSymbol(annotations?: Annotations.Filter): SchemaAST.Filter { - return SchemaAST.isStringSymbol({ - toCode: () => ({ runtime: "Schema.isStringSymbol()" }), - ...annotations - }) + return SchemaAST.isStringSymbol(annotations) } const getUUIDRegExp = (version?: 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8): globalThis.RegExp => { @@ -7076,7 +7062,6 @@ export function isUUID(version?: 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8, annotations?: An payload: { version: version ?? null } }, toJsonSchema: () => ({ pattern: regExp.source, format: "uuid" }), - toCode: () => ({ runtime: version === undefined ? "Schema.isUUID()" : `Schema.isUUID(${version})` }), ...annotations } ) @@ -7117,7 +7102,6 @@ export function isGUID(annotations?: Annotations.Filter) { id: "effect/schema/isGUID", payload: null }, - toCode: () => ({ runtime: "Schema.isGUID()" }), ...annotations } ) @@ -7155,7 +7139,6 @@ export function isULID(annotations?: Annotations.Filter) { id: "effect/schema/isULID", payload: null }, - toCode: () => ({ runtime: "Schema.isULID()" }), ...annotations } ) @@ -7200,7 +7183,6 @@ export function isAscii(annotations?: Annotations.Filter) { id: "effect/schema/isAscii", payload: null }, - toCode: () => ({ runtime: "Schema.isAscii()" }), ...annotations } ) @@ -7240,7 +7222,6 @@ export function isBase64(annotations?: Annotations.Filter) { arbitraryConstraint: { patterns: [{ source: pattern, flags: "" }] }, - toCode: () => ({ runtime: "Schema.isBase64()" }), ...annotations } ) @@ -7281,7 +7262,6 @@ export function isBase64Url(annotations?: Annotations.Filter) { arbitraryConstraint: { patterns: [{ source: pattern, flags: "" }] }, - toCode: () => ({ runtime: "Schema.isBase64Url()" }), ...annotations } ) @@ -7323,7 +7303,6 @@ export function isStartingWith(startsWith: string, annotations?: Annotations.Fil payload: { startsWith } }, toJsonSchema: () => literalToJsonSchema(jsonSchemaLiteral, startsWith, `^${RegExp_.escape(jsonSchemaLiteral)}`), - toCode: () => ({ runtime: `Schema.isStartingWith(${format(startsWith)})` }), arbitraryConstraint: { patterns: [{ source: regExp.source, flags: regExp.flags }] }, @@ -7357,7 +7336,6 @@ export function isEndingWith(endsWith: string, annotations?: Annotations.Filter) payload: { endsWith } }, toJsonSchema: () => literalToJsonSchema(jsonSchemaLiteral, endsWith, `${RegExp_.escape(jsonSchemaLiteral)}$`), - toCode: () => ({ runtime: `Schema.isEndingWith(${format(endsWith)})` }), arbitraryConstraint: { patterns: [{ source: regExp.source, flags: regExp.flags }] }, @@ -7392,7 +7370,6 @@ export function isIncluding(includes: string, annotations?: Annotations.Filter) payload: { includes } }, toJsonSchema: () => literalToJsonSchema(jsonSchemaLiteral, includes, RegExp_.escape(jsonSchemaLiteral)), - toCode: () => ({ runtime: `Schema.isIncluding(${format(includes)})` }), arbitraryConstraint: { patterns: [{ source: regExp.source, flags: regExp.flags }] }, @@ -7426,7 +7403,6 @@ export function isUppercased(annotations?: Annotations.Filter) { payload: null }, toJsonSchema: () => [{ pattern: regExp.source }, true], - toCode: () => ({ runtime: "Schema.isUppercased()" }), arbitraryConstraint: { patterns: [{ source: UPPERCASED_PATTERN, flags: "" }] }, @@ -7460,7 +7436,6 @@ export function isLowercased(annotations?: Annotations.Filter) { payload: null }, toJsonSchema: () => [{ pattern: regExp.source }, true], - toCode: () => ({ runtime: "Schema.isLowercased()" }), arbitraryConstraint: { patterns: [{ source: LOWERCASED_PATTERN, flags: "" }] }, @@ -7496,7 +7471,6 @@ export function isCapitalized(annotations?: Annotations.Filter) { payload: null }, toJsonSchema: () => [{ pattern: CAPITALIZED_PATTERN }, true], - toCode: () => ({ runtime: "Schema.isCapitalized()" }), arbitraryConstraint: { patterns: [{ source: CAPITALIZED_PATTERN, flags: "" }] }, @@ -7532,7 +7506,6 @@ export function isUncapitalized(annotations?: Annotations.Filter) { payload: null }, toJsonSchema: () => [{ pattern: UNCAPITALIZED_PATTERN }, true], - toCode: () => ({ runtime: "Schema.isUncapitalized()" }), arbitraryConstraint: { patterns: [{ source: UNCAPITALIZED_PATTERN, flags: "" }] }, @@ -7811,8 +7784,7 @@ export const isGreaterThan: (exclusiveMinimum: number, annotations?: Annotations id: "effect/schema/isGreaterThan", payload: { exclusiveMinimum: encodeNumberPayload(exclusiveMinimum) } }, - toJsonSchema: () => ({ exclusiveMinimum }), - toCode: () => ({ runtime: `Schema.isGreaterThan(${format(exclusiveMinimum)})` }) + toJsonSchema: () => ({ exclusiveMinimum }) }) }) /** @@ -7842,8 +7814,7 @@ export const isGreaterThanOrEqualTo: (minimum: number, annotations?: Annotations id: "effect/schema/isGreaterThanOrEqualTo", payload: { minimum: encodeNumberPayload(minimum) } }, - toJsonSchema: () => ({ minimum }), - toCode: () => ({ runtime: `Schema.isGreaterThanOrEqualTo(${format(minimum)})` }) + toJsonSchema: () => ({ minimum }) }) }) /** @@ -7873,8 +7844,7 @@ export const isLessThan: (exclusiveMaximum: number, annotations?: Annotations.Fi id: "effect/schema/isLessThan", payload: { exclusiveMaximum: encodeNumberPayload(exclusiveMaximum) } }, - toJsonSchema: () => ({ exclusiveMaximum }), - toCode: () => ({ runtime: `Schema.isLessThan(${format(exclusiveMaximum)})` }) + toJsonSchema: () => ({ exclusiveMaximum }) }) }) /** @@ -7904,8 +7874,7 @@ export const isLessThanOrEqualTo: (maximum: number, annotations?: Annotations.Fi id: "effect/schema/isLessThanOrEqualTo", payload: { maximum: encodeNumberPayload(maximum) } }, - toJsonSchema: () => ({ maximum }), - toCode: () => ({ runtime: `Schema.isLessThanOrEqualTo(${format(maximum)})` }) + toJsonSchema: () => ({ maximum }) }) }) /** @@ -7954,11 +7923,6 @@ export const isBetween: (options: { toJsonSchema: () => ({ [exclusiveMinimum ? "exclusiveMinimum" : "minimum"]: options.minimum, [exclusiveMaximum ? "exclusiveMaximum" : "maximum"]: options.maximum - }), - toCode: () => ({ - runtime: `Schema.isBetween({ minimum: ${format(options.minimum)}, maximum: ${ - format(options.maximum) - }, exclusiveMinimum: ${format(exclusiveMinimum)}, exclusiveMaximum: ${format(exclusiveMaximum)} })` }) } } @@ -7999,7 +7963,6 @@ export function isMultipleOf( payload: { divisor } }, toJsonSchema: () => ({ multipleOf: divisor }), - toCode: () => ({ runtime: `Schema.isMultipleOf(${format(divisor)})` }), ...annotations } ) @@ -8037,7 +8000,6 @@ export function isInt(annotations?: Annotations.Filter) { minimum: globalThis.Number.MIN_SAFE_INTEGER, maximum: globalThis.Number.MAX_SAFE_INTEGER }), - toCode: () => ({ runtime: "Schema.isInt()" }), arbitraryConstraint: { number: "integer" }, @@ -8159,9 +8121,6 @@ function encodeDatePayload(date: globalThis.Date): string { return date.toISOString() } -function formatDateRuntime(date: globalThis.Date): string { - return `new globalThis.Date(${format(date.getTime())})` -} /** * Validates that a Date is greater than the specified value (exclusive). * @@ -8187,8 +8146,7 @@ export const isGreaterThanDate: ( id: "effect/schema/isGreaterThanDate", payload: { exclusiveMinimum: encoded } }, - toJsonSchema: () => [{}, true], - toCode: () => ({ runtime: `Schema.isGreaterThanDate(${formatDateRuntime(exclusiveMinimum)})` }) + toJsonSchema: () => [{}, true] } } }) @@ -8223,8 +8181,7 @@ export const isGreaterThanOrEqualToDate: ( id: "effect/schema/isGreaterThanOrEqualToDate", payload: { minimum: encoded } }, - toJsonSchema: () => [{}, true], - toCode: () => ({ runtime: `Schema.isGreaterThanOrEqualToDate(${formatDateRuntime(minimum)})` }) + toJsonSchema: () => [{}, true] } } }) @@ -8253,8 +8210,7 @@ export const isLessThanDate: ( id: "effect/schema/isLessThanDate", payload: { exclusiveMaximum: encoded } }, - toJsonSchema: () => [{}, true], - toCode: () => ({ runtime: `Schema.isLessThanDate(${formatDateRuntime(exclusiveMaximum)})` }) + toJsonSchema: () => [{}, true] } } }) @@ -8289,8 +8245,7 @@ export const isLessThanOrEqualToDate: ( id: "effect/schema/isLessThanOrEqualToDate", payload: { maximum: encoded } }, - toJsonSchema: () => [{}, true], - toCode: () => ({ runtime: `Schema.isLessThanOrEqualToDate(${formatDateRuntime(maximum)})` }) + toJsonSchema: () => [{}, true] } } }) @@ -8334,12 +8289,7 @@ export const isBetweenDate: (options: { id: "effect/schema/isBetweenDate", payload }, - toJsonSchema: () => [{}, true], - toCode: () => ({ - runtime: `Schema.isBetweenDate({ minimum: ${formatDateRuntime(options.minimum)}, maximum: ${ - formatDateRuntime(options.maximum) - }, exclusiveMinimum: ${format(exclusiveMinimum)}, exclusiveMaximum: ${format(exclusiveMaximum)} })` - }) + toJsonSchema: () => [{}, true] } } }) @@ -8368,8 +8318,7 @@ export const isGreaterThanBigInt: ( id: "effect/schema/isGreaterThanBigInt", payload: { exclusiveMinimum: encoded } }, - toJsonSchema: () => [{}, true], - toCode: () => ({ runtime: `Schema.isGreaterThanBigInt(${format(exclusiveMinimum)})` }) + toJsonSchema: () => [{}, true] } } }) @@ -8399,8 +8348,7 @@ export const isGreaterThanOrEqualToBigInt: ( id: "effect/schema/isGreaterThanOrEqualToBigInt", payload: { minimum: encoded } }, - toJsonSchema: () => [{}, true], - toCode: () => ({ runtime: `Schema.isGreaterThanOrEqualToBigInt(${format(minimum)})` }) + toJsonSchema: () => [{}, true] } } }) @@ -8429,8 +8377,7 @@ export const isLessThanBigInt: ( id: "effect/schema/isLessThanBigInt", payload: { exclusiveMaximum: encoded } }, - toJsonSchema: () => [{}, true], - toCode: () => ({ runtime: `Schema.isLessThanBigInt(${format(exclusiveMaximum)})` }) + toJsonSchema: () => [{}, true] } } }) @@ -8460,8 +8407,7 @@ export const isLessThanOrEqualToBigInt: ( id: "effect/schema/isLessThanOrEqualToBigInt", payload: { maximum: encoded } }, - toJsonSchema: () => [{}, true], - toCode: () => ({ runtime: `Schema.isLessThanOrEqualToBigInt(${format(maximum)})` }) + toJsonSchema: () => [{}, true] } } }) @@ -8500,12 +8446,7 @@ export const isBetweenBigInt: (options: { id: "effect/schema/isBetweenBigInt", payload }, - toJsonSchema: () => [{}, true], - toCode: () => ({ - runtime: `Schema.isBetweenBigInt({ minimum: ${format(options.minimum)}, maximum: ${ - format(options.maximum) - }, exclusiveMinimum: ${format(exclusiveMinimum)}, exclusiveMaximum: ${format(exclusiveMaximum)} })` - }) + toJsonSchema: () => [{}, true] } } }) @@ -8569,7 +8510,6 @@ function makeIsMinLength(minLength: number, minCodePoints: number, annotations?: : type === undefined ? [{ minLength: minCodePoints, minItems: minLength }, true] : [{}, true], - toCode: () => ({ runtime: `Schema.isMinLength(${minLength})` }), [InternalAnnotations.STRUCTURAL_ANNOTATION_KEY]: true, arbitraryConstraint: { minLength @@ -8642,7 +8582,6 @@ export function isMaxLength(maxLength: number, annotations?: Annotations.Filter) : type === undefined ? [{ maxLength, maxItems: maxLength }, true] : [{}, true], - toCode: () => ({ runtime: `Schema.isMaxLength(${maxLength})` }), [InternalAnnotations.STRUCTURAL_ANNOTATION_KEY]: true, arbitraryConstraint: { maxLength @@ -8704,7 +8643,6 @@ export function isBetweenLength(minimum: number, maximum: number, annotations?: maxItems: maximum }, true] : [{}, true], - toCode: () => ({ runtime: `Schema.isBetweenLength(${minimum}, ${maximum})` }), [InternalAnnotations.STRUCTURAL_ANNOTATION_KEY]: true, arbitraryConstraint: { minLength: minimum, @@ -8747,7 +8685,6 @@ export function isMinCodePoints(minCodePoints: number, annotations?: Annotations payload: { minCodePoints } }, toJsonSchema: () => ({ minLength: minCodePoints }), - toCode: () => ({ runtime: `Schema.isMinCodePoints(${minCodePoints})` }), arbitraryConstraint: { minCodePoints }, ...annotations } @@ -8786,7 +8723,6 @@ export function isMaxCodePoints(maxCodePoints: number, annotations?: Annotations payload: { maxCodePoints } }, toJsonSchema: () => ({ maxLength: maxCodePoints }), - toCode: () => ({ runtime: `Schema.isMaxCodePoints(${maxCodePoints})` }), arbitraryConstraint: { maxCodePoints }, ...annotations } @@ -8831,7 +8767,6 @@ export function isBetweenCodePoints(minimum: number, maximum: number, annotation payload: { minimum, maximum } }, toJsonSchema: () => ({ allOf: [{ minLength: minimum }, { maxLength: maximum }] }), - toCode: () => ({ runtime: `Schema.isBetweenCodePoints(${minimum}, ${maximum})` }), arbitraryConstraint: { minCodePoints: minimum, maxCodePoints: maximum }, ...annotations } @@ -8886,7 +8821,6 @@ export function isMinSize(minSize: number, annotations?: Annotations.Filter) { payload: { minSize } }, toJsonSchema: () => [{}, true], - toCode: () => ({ runtime: `Schema.isMinSize(${minSize})` }), [InternalAnnotations.STRUCTURAL_ANNOTATION_KEY]: true, arbitraryConstraint: { minSize @@ -8927,7 +8861,6 @@ export function isMaxSize(maxSize: number, annotations?: Annotations.Filter) { payload: { maxSize } }, toJsonSchema: () => [{}, true], - toCode: () => ({ runtime: `Schema.isMaxSize(${maxSize})` }), [InternalAnnotations.STRUCTURAL_ANNOTATION_KEY]: true, arbitraryConstraint: { maxSize @@ -8972,7 +8905,6 @@ export function isBetweenSize(minimum: number, maximum: number, annotations?: An payload: { minimum, maximum } }, toJsonSchema: () => [{}, true], - toCode: () => ({ runtime: `Schema.isBetweenSize(${minimum}, ${maximum})` }), [InternalAnnotations.STRUCTURAL_ANNOTATION_KEY]: true, arbitraryConstraint: { minSize: minimum, @@ -9016,7 +8948,6 @@ export function isMinProperties(minProperties: number, annotations?: Annotations payload: { minProperties } }, toJsonSchema: ({ type }) => type === "object" ? { minProperties } : [{ minProperties }, true], - toCode: () => ({ runtime: `Schema.isMinProperties(${minProperties})` }), [InternalAnnotations.STRUCTURAL_ANNOTATION_KEY]: true, arbitraryConstraint: { minProperties @@ -9059,7 +8990,6 @@ export function isMaxProperties(maxProperties: number, annotations?: Annotations payload: { maxProperties } }, toJsonSchema: ({ type }) => type === "object" ? { maxProperties } : [{ maxProperties }, true], - toCode: () => ({ runtime: `Schema.isMaxProperties(${maxProperties})` }), [InternalAnnotations.STRUCTURAL_ANNOTATION_KEY]: true, arbitraryConstraint: { maxProperties @@ -9112,7 +9042,6 @@ export function isBetweenProperties(minimum: number, maximum: number, annotation type === "object" ? { minProperties: minimum, maxProperties: maximum } : [{ minProperties: minimum, maxProperties: maximum }, true], - toCode: () => ({ runtime: `Schema.isBetweenProperties(${minimum}, ${maximum})` }), [InternalAnnotations.STRUCTURAL_ANNOTATION_KEY]: true, arbitraryConstraint: { minProperties: minimum, @@ -9169,7 +9098,6 @@ export function isPropertyNames(keySchema: Constraint, annotations?: Annotations }, toJsonSchema: ({ schemas, type }) => type === "object" ? { propertyNames: schemas[0] } : [{ propertyNames: schemas[0] }, true], - toCode: ({ schemas }) => ({ runtime: `Schema.isPropertyNames(${schemas[0].runtime})` }), [InternalAnnotations.STRUCTURAL_ANNOTATION_KEY]: true, ...annotations } @@ -9201,7 +9129,6 @@ export function isUnique(annotations?: Annotations.Filter) { payload: null }, toJsonSchema: () => ({ uniqueItems: true }), - toCode: () => ({ runtime: "Schema.isUnique()" }), arbitraryConstraint: { uniqueBy: identity }, @@ -9234,7 +9161,6 @@ export function isUniqueKey(annotations?: Annotations.Filter) { id: "effect/schema/isUniqueKey", payload: null }, - toCode: () => ({ runtime: "Schema.isUniqueKey()" }), arbitraryConstraint: { uniqueBy: (entry: readonly [Key, Value]) => entry[0] }, @@ -9378,12 +9304,6 @@ export function ErrorInstance(options?: ErrorOptions): ErrorInstance { id: "effect/schema/Error", payload: normalizedOptions ?? null }, - toCode: () => ({ - runtime: normalizedOptions !== undefined - ? `Schema.ErrorInstance(${format(normalizedOptions)})` - : `Schema.ErrorInstance()`, - Type: `globalThis.Error` - }), expected: "Error", toCodecJson: () => link()(JsonError, SchemaTransformation.errorFromJsonError(normalizedOptions)) }) @@ -9522,10 +9442,6 @@ export function ReadonlyMap( id: "effect/schema/ReadonlyMap", payload: null }, - toCode: ({ typeParameters }) => ({ - runtime: `Schema.ReadonlyMap(${typeParameters[0].runtime}, ${typeParameters[1].runtime})`, - Type: `globalThis.ReadonlyMap<${typeParameters[0].Type}, ${typeParameters[1].Type}>` - }), expected: "ReadonlyMap", toCodec: ([key, value]) => link>()( @@ -9600,10 +9516,6 @@ export function ReadonlySet(value: Value): $ReadonlySe id: "effect/schema/ReadonlySet", payload: null }, - toCode: ({ typeParameters }) => ({ - runtime: `Schema.ReadonlySet(${typeParameters[0].runtime})`, - Type: `globalThis.ReadonlySet<${typeParameters[0].Type}>` - }), expected: "ReadonlySet", toCodec: ([value]) => link>()( @@ -9645,10 +9557,6 @@ export const RegExp: RegExp = instanceOf( id: "effect/schema/RegExp", payload: null }, - toCode: () => ({ - runtime: `Schema.RegExp`, - Type: `globalThis.RegExp` - }), expected: "RegExp", toCodecJson: () => link()( @@ -9708,10 +9616,6 @@ export const URL: URL = instanceOf( id: "effect/schema/URL", payload: null }, - toCode: () => ({ - runtime: `Schema.URL`, - Type: `globalThis.URL` - }), expected: "URL", toCodecJson: () => link()( @@ -9794,10 +9698,6 @@ export const Date: Date = declare( id: "effect/schema/Date", payload: null }, - toCode: () => ({ - runtime: `Schema.Date`, - Type: `globalThis.Date` - }), expected: "a valid Date", toCodecJson: () => link()( @@ -9968,10 +9868,6 @@ export const File: File = instanceOf(globalThis.File, { id: "effect/schema/File", payload: null }, - toCode: () => ({ - runtime: `Schema.File`, - Type: `globalThis.File` - }), expected: "File", toCodecJson: () => link()( @@ -10049,10 +9945,6 @@ export const FormData: FormData = declare((u): u is globalThis.FormData => u ins id: "effect/schema/FormData", payload: null }, - toCode: () => ({ - runtime: `Schema.FormData`, - Type: `globalThis.FormData` - }), expected: "FormData", toCodecJson: () => link()( @@ -10209,10 +10101,6 @@ export const URLSearchParams: URLSearchParams = instanceOf(globalThis.URLSearchP id: "effect/schema/URLSearchParams", payload: null }, - toCode: () => ({ - runtime: `Schema.URLSearchParams`, - Type: `globalThis.URLSearchParams` - }), expected: "URLSearchParams", toCodecJson: () => link()( @@ -10722,10 +10610,6 @@ export const Uint8Array: Uint8Array = instanceOf(globalThis.Uint8Array ({ - runtime: `Schema.Uint8Array`, - Type: `globalThis.Uint8Array` - }), expected: "Uint8Array", toCodecJson: () => link>()( @@ -10968,11 +10852,6 @@ export const BigDecimal: BigDecimal = declare( id: "effect/schema/BigDecimal", payload: null }, - toCode: () => ({ - runtime: `Schema.BigDecimal`, - Type: `BigDecimal.BigDecimal`, - importDeclarations: [`import * as BigDecimal from "effect/BigDecimal"`] - }), expected: "BigDecimal", toCodecJson: () => link()( @@ -11080,11 +10959,6 @@ export const Rational: Rational = declare( id: "effect/schema/Rational", payload: null }, - toCode: () => ({ - runtime: `Schema.Rational`, - Type: `Rational.Rational`, - importDeclarations: [`import * as Rational from "effect/Rational"`] - }), expected: "Rational", toCodecArbitrary: () => linkDecoding()( @@ -11170,11 +11044,6 @@ export const ByteSize: ByteSize = declare( id: "effect/schema/ByteSize", payload: null }, - toCode: () => ({ - runtime: `Schema.ByteSize`, - Type: `ByteSize.ByteSize`, - importDeclarations: [`import * as ByteSize from "effect/ByteSize"`] - }), expected: "ByteSize", toCodecJson: () => link()( @@ -11386,11 +11255,6 @@ export function CauseReason( id: "effect/schema/CauseReason", payload: null }, - toCode: ({ typeParameters }) => ({ - runtime: `Schema.CauseReason(${typeParameters[0].runtime}, ${typeParameters[1].runtime})`, - Type: `Cause.Reason<${typeParameters[0].Type}>`, - importDeclarations: [`import * as Cause from "effect/Cause"`] - }), expected: "Cause.Failure", toCodec: ([error, defect]) => link>()( @@ -11507,11 +11371,6 @@ export function Cause(error: E, defe id: "effect/schema/Cause", payload: null }, - toCode: ({ typeParameters }) => ({ - runtime: `Schema.Cause(${typeParameters[0].runtime}, ${typeParameters[1].runtime})`, - Type: `Cause.Cause<${typeParameters[0].Type}>`, - importDeclarations: [`import * as Cause from "effect/Cause"`] - }), expected: "Cause", toCodec: ([error, defect]) => link>()( @@ -11607,10 +11466,6 @@ export function Chunk(value: Value): Chunk { id: "effect/schema/Chunk", payload: null }, - toCode: ({ typeParameters }) => ({ - runtime: `Schema.Chunk(${typeParameters[0].runtime})`, - Type: `Chunk.Chunk<${typeParameters[0].Type}>` - }), expected: "Chunk", toCodec: ([value]) => chunkLink(ArraySchema(value)), toCodecArbitrary: ({ constraint, typeParameters: [value] }) => @@ -11795,11 +11650,6 @@ export const DateTimeUtc: DateTimeUtc = declare( id: "effect/schema/DateTimeUtc", payload: null }, - toCode: () => ({ - runtime: `Schema.DateTimeUtc`, - Type: `DateTime.Utc`, - importDeclarations: [`import * as DateTime from "effect/DateTime"`] - }), expected: "DateTime.Utc", toCodecArbitrary: ({ constraint }) => { const [minimum, maximum] = dateTimeArbitraryBounds( @@ -12025,11 +11875,6 @@ export const TimeZoneOffset: TimeZoneOffset = declare( id: "effect/schema/TimeZoneOffset", payload: null }, - toCode: () => ({ - runtime: `Schema.TimeZoneOffset`, - Type: `DateTime.TimeZone.Offset`, - importDeclarations: [`import * as DateTime from "effect/DateTime"`] - }), expected: "DateTime.TimeZone.Offset", toCodecJson: () => link()( @@ -12070,11 +11915,6 @@ export const TimeZoneNamed: TimeZoneNamed = declare( id: "effect/schema/TimeZoneNamed", payload: null }, - toCode: () => ({ - runtime: `Schema.TimeZoneNamed`, - Type: `DateTime.TimeZone.Named`, - importDeclarations: [`import * as DateTime from "effect/DateTime"`] - }), expected: "DateTime.TimeZone.Named", toCodecArbitrary: () => linkDecoding()( @@ -12151,11 +11991,6 @@ export const TimeZone: TimeZone = declare( id: "effect/schema/TimeZone", payload: null }, - toCode: () => ({ - runtime: `Schema.TimeZone`, - Type: `DateTime.TimeZone`, - importDeclarations: [`import * as DateTime from "effect/DateTime"`] - }), expected: "DateTime.TimeZone", toCodecArbitrary: () => linkDecoding()( @@ -12236,11 +12071,6 @@ export const DateTimeZoned: DateTimeZoned = declare( id: "effect/schema/DateTimeZoned", payload: null }, - toCode: () => ({ - runtime: `Schema.DateTimeZoned`, - Type: `DateTime.Zoned`, - importDeclarations: [`import * as DateTime from "effect/DateTime"`] - }), expected: "DateTime.Zoned", toCodecArbitrary: ({ constraint }) => { const [minimum, maximum] = dateTimeArbitraryBounds( @@ -13979,11 +13809,6 @@ export const Duration: Duration = declare( id: "effect/schema/Duration", payload: null }, - toCode: () => ({ - runtime: `Schema.Duration`, - Type: `Duration.Duration`, - importDeclarations: [`import * as Duration from "effect/Duration"`] - }), expected: "Duration", toCodecJson: () => link()( @@ -14580,7 +14405,6 @@ export const DnsRecord: DnsRecord = Union([ // Match operation parameters rather than object identity. RSA modulus length // affects generation only, so it is ignored here as on import. interface CryptoAlgorithm { - readonly _tag?: string readonly name: string readonly hash?: { readonly name: string } readonly modulusLength?: number @@ -14591,20 +14415,6 @@ const cryptoAlgorithmEquals = (self: CryptoAlgorithm, that: CryptoAlgorithm): bo self === that || (self.name === that.name && self.hash?.name === that.hash?.name && self.saltLength === that.saltLength) -const cryptoDigestCode = (hash: { readonly name: string }) => `Digest.${hash.name.toLowerCase().replace("-", "")}` - -const cryptoAlgorithmCode = (family: string, algorithm: CryptoAlgorithm): string => { - if (algorithm.modulusLength === undefined || algorithm.hash === undefined || algorithm._tag === undefined) { - const code = `${family}.${algorithm.name}` - return algorithm.hash === undefined ? code : `{ ...${code}, hash: ${cryptoDigestCode(algorithm.hash)} }` - } - const factory = algorithm._tag.charAt(0).toLowerCase() + algorithm._tag.slice(1) - const saltLength = algorithm.saltLength === undefined ? "" : `, saltLength: ${algorithm.saltLength}` - return `${family}.${factory}({ hash: ${ - cryptoDigestCode(algorithm.hash) - }, modulusLength: ${algorithm.modulusLength}${saltLength} })` -} - const cryptoAlgorithmPayload = (algorithm: CryptoAlgorithm): Json => { const payload: { [key: string]: Json } = { name: algorithm.name } if (algorithm.hash !== undefined) payload.hash = algorithm.hash.name @@ -14620,7 +14430,6 @@ const declareCryptoKey = ( is: (u: unknown) => boolean, algorithm: CryptoAlgorithm ): declare => { - const code = cryptoAlgorithmCode(family, algorithm) const forbidden = SchemaGetter.forbidden(() => `Cannot serialize ${family}.${type} values as JSON, use Schema.${name}FromFormat to read and write keys` ) @@ -14629,14 +14438,6 @@ const declareCryptoKey = ( { expected: `${family}.${type} for ${algorithm.name}`, representation: { id: `effect/crypto/${name}`, payload: cryptoAlgorithmPayload(algorithm) }, - toCode: () => ({ - runtime: `Schema.${name}(${code})`, - Type: `${family}.${type}`, - importDeclarations: [ - `import * as ${family} from "effect/crypto/${family}"`, - ...(code.includes("Digest.") ? [`import * as Digest from "effect/crypto/Digest"`] : []) - ] - }), toCodecJson: () => link()(Unknown, { decode: forbidden, encode: forbidden }), // Keys have no Arbitrary: linking to `Never` makes derivation fail. toCodecArbitrary: () => link()(Never, { decode: forbidden, encode: forbidden }), @@ -15709,13 +15510,6 @@ export function Exit< id: "effect/schema/Exit", payload: null }, - toCode: ({ typeParameters }) => ({ - runtime: `Schema.Exit(${typeParameters[0].runtime}, ${typeParameters[1].runtime}, ${ - typeParameters[2].runtime - })`, - Type: `Exit.Exit<${typeParameters[0].Type}, ${typeParameters[1].Type}>`, - importDeclarations: [`import * as Exit from "effect/Exit"`] - }), expected: "Exit", toCodec: ([value, error, defect]) => link>()( @@ -15993,11 +15787,6 @@ export function Graph ({ - runtime: `Schema.Graph(${format(type)}, ${typeParameters[0].runtime}, ${typeParameters[1].runtime})`, - Type: `Graph.Graph<${typeParameters[0].Type}, ${typeParameters[1].Type}, ${format(type)}>`, - importDeclarations: [`import * as Graph from "effect/Graph"`] - }), expected: `an immutable ${type} Graph`, toCodec: ([node, edge]) => link>()( @@ -16091,11 +15880,6 @@ export function HashMap(key: K id: "effect/schema/HashMap", payload: null }, - toCode: ({ typeParameters }) => ({ - runtime: `Schema.HashMap(${typeParameters[0].runtime}, ${typeParameters[1].runtime})`, - Type: `HashMap.HashMap<${typeParameters[0].Type}, ${typeParameters[1].Type}>`, - importDeclarations: [`import * as HashMap from "effect/HashMap"`] - }), expected: "HashMap", toCodec: ([key, value]) => hashMapLink(ArraySchema(Tuple([key, value]))), toCodecArbitrary: ({ constraint, typeParameters: [key, value] }) => @@ -16186,10 +15970,6 @@ export function HashSet(value: Value): HashSet id: "effect/schema/HashSet", payload: null }, - toCode: ({ typeParameters }) => ({ - runtime: `Schema.HashSet(${typeParameters[0].runtime})`, - Type: `HashSet.HashSet<${typeParameters[0].Type}>` - }), expected: "HashSet", toCodec: ([value]) => hashSetLink(ArraySchema(value)), toCodecArbitrary: ({ constraint, typeParameters: [value] }) => @@ -16280,11 +16060,6 @@ export function Option(value: A): Option { id: "effect/schema/Option", payload: null }, - toCode: ({ typeParameters }) => ({ - runtime: `Schema.Option(${typeParameters[0].runtime})`, - Type: `Option.Option<${typeParameters[0].Type}>`, - importDeclarations: [`import * as Option from "effect/Option"`] - }), expected: "Option", toCodec: ([value]) => link>()( @@ -16419,11 +16194,6 @@ export const Cookie: Cookie = declare( id: "effect/http/Cookie", payload: null }, - toCode: () => ({ - runtime: "Schema.Cookie", - Type: "Cookies.Cookie", - importDeclarations: [`import * as Cookies from "effect/http/Cookies"`] - }), expected: "Cookie" } ) @@ -16463,11 +16233,6 @@ export const Cookies: Cookies = declare( id: "effect/http/Cookies", payload: null }, - toCode: () => ({ - runtime: "Schema.Cookies", - Type: "Cookies.Cookies", - importDeclarations: [`import * as Cookies from "effect/http/Cookies"`] - }), expected: "Cookies", toCodecJson: () => link()( @@ -16549,11 +16314,6 @@ export const Headers: Headers = declare( id: "effect/http/Headers", payload: null }, - toCode: () => ({ - runtime: "Schema.Headers", - Type: "Headers.Headers", - importDeclarations: [`import * as Headers from "effect/http/Headers"`] - }), expected: "Headers", toEquivalence: () => Headers_.Equivalence, toCodec: () => @@ -16671,6 +16431,66 @@ export const RetryAfterFromString: RetryAfterFromString = String.annotate({ ) ) +/** + * Type-level representation of {@link LinkHeaderFromString}. + * + * @stability unstable + * @category models + * @since 4.1.6 + */ +export interface LinkHeaderFromString extends + decodeTo< + $Array< + Struct<{ + readonly target: String + readonly rel: $Array + readonly params: $Record + }> + >, + String + > +{ + readonly "Rebuild": LinkHeaderFromString +} + +/** + * Schema for `Link` header values (RFC 8288), decoded with + * `Headers.parseLink` and encoded with `Headers.formatLink`. + * + * **When to use** + * + * Use with `HttpClientResponse.schemaHeaders` or HTTP API header schemas + * that carry a `Link` header. + * + * **Details** + * + * Decoding never fails on a string, because `Headers.parseLink` is lenient. + * + * **Example** (Decoding a Link header) + * + * ```ts + * import { Schema } from "effect" + * + * const links = Schema.decodeSync(Schema.LinkHeaderFromString)('; rel="next"') + * // => [{ target: "/items?page=2", rel: ["next"], params: {} }] + * ``` + * + * @stability unstable + * @category schemas + * @since 4.1.6 + */ +export const LinkHeaderFromString: LinkHeaderFromString = String.annotate({ + expected: "a Link header value" +}).pipe( + decodeTo( + ArraySchema(Struct({ target: String, rel: ArraySchema(String), params: Record(String, String) })), + SchemaTransformation.transform, string>({ + decode: Headers_.parseLink, + encode: Headers_.formatLink + }) + ) +) + /** * Type-level representation of {@link UrlParams}. * @@ -16705,11 +16525,6 @@ export const UrlParams: UrlParams = declare( id: "effect/http/UrlParams", payload: null }, - toCode: () => ({ - runtime: "Schema.UrlParams", - Type: "UrlParams.UrlParams", - importDeclarations: [`import * as UrlParams from "effect/http/UrlParams"`] - }), expected: "UrlParams", toEquivalence: () => UrlParams_.Equivalence, toCodec: () => @@ -17050,13 +16865,6 @@ export function Redacted(value: S, options?: { id: "effect/schema/Redacted", payload: normalizedOptions ?? null }, - toCode: ({ typeParameters }) => ({ - runtime: normalizedOptions !== undefined - ? `Schema.Redacted(${typeParameters[0].runtime}, ${format(normalizedOptions)})` - : `Schema.Redacted(${typeParameters[0].runtime})`, - Type: `Redacted.Redacted<${typeParameters[0].Type}>`, - importDeclarations: [`import * as Redacted from "effect/Redacted"`] - }), expected: "Redacted", toCodecJson: ([value]) => link>()( @@ -17198,11 +17006,6 @@ export function Result( id: "effect/schema/Result", payload: null }, - toCode: ({ typeParameters }) => ({ - runtime: `Schema.Result(${typeParameters[0].runtime}, ${typeParameters[1].runtime})`, - Type: `Result.Result<${typeParameters[0].Type}, ${typeParameters[1].Type}>`, - importDeclarations: [`import * as Result from "effect/Result"`] - }), expected: "Result", toCodec: ([success, failure]) => link>()( @@ -17279,11 +17082,6 @@ export const SemVer: SemVer = declare( id: "effect/schema/SemVer", payload: null }, - toCode: () => ({ - runtime: `Schema.SemVer`, - Type: `SemVer.SemVer`, - importDeclarations: [`import * as SemVer from "effect/SemVer"`] - }), expected: "SemVer", toCodecArbitrary: () => linkDecoding()( @@ -17359,11 +17157,6 @@ export const SemVerRange: SemVerRange = declare( id: "effect/schema/SemVerRange", payload: null }, - toCode: () => ({ - runtime: `Schema.SemVerRange`, - Type: `SemVerRange.SemVerRange`, - importDeclarations: [`import * as SemVerRange from "effect/SemVerRange"`] - }), expected: "SemVerRange", toCodecArbitrary: () => linkDecoding()( @@ -18812,12 +18605,7 @@ export interface JsonObject { * @category schemas * @since 4.0.0 */ -export const Json: Codec = make(SchemaAST.annotate(SchemaAST.Json, { - toCode: () => ({ - runtime: "Schema.Json", - Type: "Schema.Json" - }) -})) +export const Json: Codec = make(SchemaAST.Json) /** * Schema for readonly string-keyed records whose values are JSON-compatible. * @@ -18882,12 +18670,7 @@ const JsonError = Struct({ * @category schemas * @since 4.0.0 */ -export const MutableJson: Codec = make(SchemaAST.annotate(SchemaAST.MutableJson, { - toCode: () => ({ - runtime: "Schema.MutableJson", - Type: "Schema.MutableJson" - }) -})) +export const MutableJson: Codec = make(SchemaAST.MutableJson) /** * Resolves the typed annotations from a schema. The term "resolve" (rather * than "get") reflects the lookup strategy: if the schema has checks, the diff --git a/.repos/effect/packages/effect/src/SchemaAST.ts b/.repos/effect/packages/effect/src/SchemaAST.ts index 6cc5dd4cce9e6..befe76b47c836 100644 --- a/.repos/effect/packages/effect/src/SchemaAST.ts +++ b/.repos/effect/packages/effect/src/SchemaAST.ts @@ -4288,7 +4288,6 @@ export function isFinite(annotations?: Schema.Annotations.Filter) { payload: null }, toJsonSchema: () => ({ type: "number" }), - toCode: () => ({ runtime: "Schema.isFinite()" }), arbitraryConstraint: { number: "finite" }, diff --git a/.repos/effect/packages/effect/src/ScopedCache.ts b/.repos/effect/packages/effect/src/ScopedCache.ts index e5292437912ec..0e9753f0d1690 100644 --- a/.repos/effect/packages/effect/src/ScopedCache.ts +++ b/.repos/effect/packages/effect/src/ScopedCache.ts @@ -291,11 +291,13 @@ export const get: { return effect.interrupt } const oentry = MutableHashMap.get(state.map, key) - if (Option.isSome(oentry) && !hasExpired(oentry.value, fiber)) { - // Move the entry to the end of the map to keep it fresh + if (Option.isSome(oentry)) { MutableHashMap.remove(state.map, key) - MutableHashMap.set(state.map, key, oentry.value) - return awaitEntry(self, key, oentry.value, restore) + if (!hasExpired(oentry.value, fiber)) { + // Move the entry to the end of the map to keep it fresh + MutableHashMap.set(state.map, key, oentry.value) + return awaitEntry(self, key, oentry.value, restore) + } } const clock = fiber.getRef(effect.ClockRef) const scope = Scope.makeUnsafe() diff --git a/.repos/effect/packages/effect/src/Stream.ts b/.repos/effect/packages/effect/src/Stream.ts index 8b17a55caa645..5e71a15270c3a 100644 --- a/.repos/effect/packages/effect/src/Stream.ts +++ b/.repos/effect/packages/effect/src/Stream.ts @@ -8,6 +8,26 @@ * stream lifecycle: create a stream, transform or combine it, control buffering * and timing, handle failures, and finally consume it. * + * Every stream runs in a scope supplied by its consumer, called the stream's + * scope. The run functions create that scope and close it before they return, + * however the stream ends: completion, failure, defect, an early stop by a + * downstream operator such as `take`, or interruption. `toPull` uses the scope + * it is given and leaves closing it to its owner. Operators that run inner + * streams, such as `flatMap` and `concat`, may give each inner stream a child + * scope that closes sooner. + * + * `ensuring`, `onExit`, and `scoped` finalize when their stream ends on its own + * (completion, failure, or defect), before downstream observes that end. + * `callback` and `unwrap` register finalizers in the stream's scope, so they + * run when that scope closes. A stream that is abandoned because a downstream + * operator such as `take` stopped pulling from it is finalized no later than + * when its scope closes. Under `toPull`, that can be after the pull has + * returned its final result, so close the scope to release what the stream + * still holds. `toQueue` and `toPubSub` use the given scope for the queue or + * pubsub and for the fiber that feeds it. That fiber runs the stream like a run + * function, so the stream's resources are released when it ends, without + * waiting for the scope to close. + * * @stability stable * @since 2.0.0 */ @@ -695,9 +715,15 @@ export const toChannel = ( * Use when you need callback-based code to emit stream values by offering to a * `Queue`, or signal stream completion through the `Queue` module APIs. * - * By default it uses an "unbounded" buffer size. - * You can customize the buffer size and strategy by passing an object as the - * second argument with the `bufferSize` and `strategy` fields. + * **Details** + * + * The callback effect runs in the stream's scope. Finalizers it registers, for + * example with `Effect.acquireRelease`, run when that scope closes, not when + * the queue ends. + * + * By default it uses an "unbounded" buffer size. You can customize the buffer + * size and strategy by passing an object as the second argument with the + * `bufferSize` and `strategy` fields. * * **Example** (Creating a stream from a callback that can emit values into a queue) * @@ -718,6 +744,29 @@ export const toChannel = ( * await Effect.runPromise(Stream.runCollect(stream)) // => [1, 2, 3] * ``` * + * **Example** (Unregistering a listener when the stream scope closes) + * + * ```ts import.meta.vitest + * import { Effect, Queue, Stream } from "effect" + * + * const listeners = new Set<(value: number) => void>() + * + * const stream = Stream.callback(Effect.fnUntraced(function*(queue) { + * const listener = (value: number) => { + * Queue.offerUnsafe(queue, value) + * } + * yield* Effect.acquireRelease( + * Effect.sync(() => listeners.add(listener)), + * () => Effect.sync(() => listeners.delete(listener)) + * ) + * listeners.forEach((notify) => notify(1)) + * })) + * + * const values = await Effect.runPromise(Stream.runCollect(stream.pipe(Stream.take(1)))) + * values // => [1] + * listeners.size // => 0 + * ``` + * * @stability stable * @category constructors * @since 4.0.0 @@ -1692,6 +1741,11 @@ export const never: Stream = fromChannel(Channel.never) /** * Creates a stream produced from an `Effect`. * + * **Details** + * + * The effect runs in the stream's scope, so finalizers it registers run when + * that scope closes. + * * **Example** (Unwrapping a stream effect) * * ```ts import.meta.vitest @@ -1720,6 +1774,14 @@ export const unwrap = ( * Runs a stream that requires `Scope` in a managed scope, ensuring its * finalizers are run when the stream completes. * + * **Details** + * + * The provided scope closes when the stream ends on its own (completion, + * failure, or defect), before downstream observes that end. If a downstream + * operator stops pulling first, it closes no later than when the stream's scope + * closes. It satisfies the `Scope` service requirement only; constructors that + * register finalizers in the stream's scope, such as `callback`, keep using it. + * * **Example** (Scoping a stream) * * ```ts import.meta.vitest @@ -10316,6 +10378,12 @@ export const haltWhen: { /** * Runs the provided finalizer when the stream exits, passing the exit value. * + * **Details** + * + * The finalizer runs when the stream ends on its own (completion, failure, or + * defect), before downstream observes that end. If a downstream operator stops + * pulling first, it runs no later than when the stream's scope closes. + * * **Example** (Running a finalizer on exit) * * ```ts import.meta.vitest @@ -10512,6 +10580,12 @@ export const onEnd: { /** * Executes the provided finalizer after this stream's finalizers run. * + * **Details** + * + * The finalizer runs when the stream ends on its own (completion, failure, or + * defect), before downstream observes that end. If a downstream operator stops + * pulling first, it runs no later than when the stream's scope closes. + * * **Example** (Ensuring finalization) * * ```ts import.meta.vitest @@ -11569,8 +11643,9 @@ export const runDrain = (self: Stream): Effect.Effect => ({ [Symbol.asyncIterator]() { const runPromise = Effect.runPromiseWith(context) - const runFork = Effect.runForkWith(context) + const runPromiseExit = Effect.runPromiseExitWith(context) const scope = Scope.makeUnsafe() let pull: Pull.Pull, E, void, R> | undefined let currentIter: Iterator | undefined - let currentFiber: Fiber.Fiber, E | Cause.Done> | undefined + let currentFiber: Fiber.Fiber | undefined + let reading = false + const queuedReads: Array<() => void> = [] let closePromise: Promise> | undefined const close = (exit: Exit.Exit): Promise> => { if (closePromise) return closePromise @@ -11950,37 +12027,46 @@ export const toAsyncIterableWith: { await runPromise(Effect.logError("Suppressed error while closing Stream async iterator", error)) } } + // Register the fiber before pulling so a reentrant close can interrupt it. + const pullChunk = Effect.withFiber((fiber) => { + currentFiber = fiber + return pull ?? + Effect.flatMap(Channel.toPullScoped(self.channel, scope), (nextPull) => { + pull = nextPull + return nextPull + }) + }) return { async next(): Promise> { - if (closePromise) return closePromise - if (currentIter) { - const next = currentIter.next() - if (!next.done) return next - currentIter = undefined + if (reading) { + await new Promise((resolve) => queuedReads.push(resolve)) } - const fiber = runFork( - pull ?? - Effect.flatMap(Channel.toPullScoped(self.channel, scope), (nextPull) => { - pull = nextPull - return nextPull - }) - ) - currentFiber = fiber - const exit = await runPromise(Fiber.await(fiber)) - if (currentFiber === fiber) { + reading = true + try { + if (closePromise) return closePromise + if (currentIter) { + const next = currentIter.next() + if (!next.done) return next + currentIter = undefined + } + const exit = await runPromiseExit(pullChunk) currentFiber = undefined + if (Exit.isSuccess(exit)) { + currentIter = exit.value[Symbol.iterator]() + return currentIter.next() + } else if (Pull.isDoneCause(exit.cause)) { + return close(Exit.void) + } + if (closePromise && Cause.hasInterruptsOnly(exit.cause)) { + return closePromise + } + await closeAndReportError(exit) + throw Cause.squash(exit.cause) + } finally { + const resume = queuedReads.shift() + if (resume) resume() + else reading = false } - if (Exit.isSuccess(exit)) { - currentIter = exit.value[Symbol.iterator]() - return currentIter.next() - } else if (Pull.isDoneCause(exit.cause)) { - return close(Exit.void) - } - if (closePromise && Cause.hasInterruptsOnly(exit.cause)) { - return closePromise - } - await closeAndReportError(exit) - throw Cause.squash(exit.cause) }, return() { return close(Exit.void) @@ -12107,6 +12193,10 @@ export const runIntoPubSub: { * * **Details** * + * The surrounding scope owns the PubSub and the fiber that feeds it. The stream + * runs like a run function inside that fiber, so its finalizers run when it + * ends, or when the fiber is interrupted by the scope closing. + * * `shutdownOnEnd` indicates whether the PubSub should be shut down when the * stream ends. By default this is `true`. * @@ -12250,6 +12340,10 @@ export const toPubSubTake: { * * **Details** * + * The surrounding scope owns the queue and the fiber that feeds it. The stream + * runs like a run function inside that fiber, so its finalizers run when it + * ends, or when the fiber is interrupted by the scope closing. + * * Elements are offered to the queue as the stream runs. Stream completion is * signaled with `Cause.Done`, stream failures fail the queue, and the queue is * shut down when the surrounding scope closes. diff --git a/.repos/effect/packages/effect/src/String.ts b/.repos/effect/packages/effect/src/String.ts index f284310baea26..27f66b1b70530 100644 --- a/.repos/effect/packages/effect/src/String.ts +++ b/.repos/effect/packages/effect/src/String.ts @@ -1316,7 +1316,7 @@ class LinesIterator implements IterableIterator { } [Symbol.iterator](): IterableIterator { - return new LinesIterator(this.s, this.stripped) + return this } private get done(): boolean { diff --git a/.repos/effect/packages/effect/src/Tracer.ts b/.repos/effect/packages/effect/src/Tracer.ts index 648994e9fb1de..f0dcc80c3f709 100644 --- a/.repos/effect/packages/effect/src/Tracer.ts +++ b/.repos/effect/packages/effect/src/Tracer.ts @@ -182,6 +182,14 @@ export class ParentSpan extends Context.Service()(ParentSpa * identifiers, sampling state, and annotations so it can be used as a parent or * link in Effect tracing. * + * **Details** + * + * An external span identifies a parent or link only. Effect never records on + * it: it has no attributes, events, or end. While the nearest parent span is + * external, `Effect.currentSpan` fails, `Effect.annotateCurrentSpan` does + * nothing, and `Logger.tracerLogger` records nothing. Open a span with + * `Effect.withSpan` to get one that records. + * * **Example** (Creating an external span value) * * ```ts import.meta.vitest @@ -514,6 +522,8 @@ export const make = (options: Tracer): Tracer => options * spans.map((span) => Option.getOrUndefined(span.parent)?.spanId) // => ["span-abc-123"] * ``` * + * @see {@link ExternalSpan} + * * @stability stable * @category constructors * @since 2.0.0 diff --git a/.repos/effect/packages/effect/src/ai/McpServer.ts b/.repos/effect/packages/effect/src/ai/McpServer.ts index 1640df8fc22bb..cb11daa424c4c 100644 --- a/.repos/effect/packages/effect/src/ai/McpServer.ts +++ b/.repos/effect/packages/effect/src/ai/McpServer.ts @@ -97,6 +97,7 @@ import type { ServerCapabilities } from "./McpSchema.ts" import * as AiPrompt from "./Prompt.ts" +import * as Skill from "./Skill.ts" import * as Tool from "./Tool.ts" import * as Toolkit from "./Toolkit.ts" @@ -3955,6 +3956,16 @@ export interface SkillOptions { readonly annotations?: Context.Context | undefined } +/** + * Options for registering a {@link Skill.Skill} with {@link registerSkill} or + * {@link skill}: {@link SkillOptions} without `files`, which come from the skill. + * + * @stability unstable + * @category models + * @since 4.1.6 + */ +export type SkillRegistration = Omit + const skillFileEncoder = new TextEncoder() // Bytes are copied so that later changes by the caller cannot alter what is @@ -3969,6 +3980,9 @@ const toSkillSourceFile = (path: string, file: SkillFile): McpSkills.SourceFile } } +const toSkillOptions = (skillOrOptions: Skill.Skill | SkillOptions, registration?: SkillRegistration): SkillOptions => + skillOrOptions instanceof Skill.Skill ? { ...registration!, files: Skill.toFiles(skillOrOptions) } : skillOrOptions + /** * Registers an Agent Skill under the MCP Skills extension (SEP-2640). * @@ -3996,8 +4010,14 @@ const toSkillSourceFile = (path: string, file: SkillFile): McpSkills.SourceFile * @category handlers * @since 4.1.1 */ -export const registerSkill: (options: SkillOptions) => Effect.Effect = - Effect.fnUntraced(function*(options: SkillOptions) { +export const registerSkill: { + (skill: Skill.Skill, options: SkillRegistration): Effect.Effect + (options: SkillOptions): Effect.Effect +} = (skillOrOptions: Skill.Skill | SkillOptions, registration?: SkillRegistration) => + registerSkillFiles(toSkillOptions(skillOrOptions, registration)) + +const registerSkillFiles: (options: SkillOptions) => Effect.Effect = Effect + .fnUntraced(function*(options: SkillOptions) { const files = Object.entries(options.files).map(([path, file]) => toSkillSourceFile(path, file)) const skill = yield* McpSkills.makeStaticSkill({ uri: options.uri, files }).pipe( Effect.provide(Digest.layerWebCrypto) @@ -4075,8 +4095,11 @@ export const registerSkill: (options: SkillOptions) => Effect.Effect => - Layer.effectDiscard(registerSkill(options)) +export const skill: { + (skill: Skill.Skill, options: SkillRegistration): Layer.Layer + (options: SkillOptions): Layer.Layer +} = (skillOrOptions: Skill.Skill | SkillOptions, registration?: SkillRegistration) => + Layer.effectDiscard(registerSkillFiles(toSkillOptions(skillOrOptions, registration))) /** * Registers an MCP prompt from an Effect program. diff --git a/.repos/effect/packages/effect/src/ai/Prompt.ts b/.repos/effect/packages/effect/src/ai/Prompt.ts index c60798c2b714e..0f1320a0b061e 100644 --- a/.repos/effect/packages/effect/src/ai/Prompt.ts +++ b/.repos/effect/packages/effect/src/ai/Prompt.ts @@ -2198,7 +2198,9 @@ const mergeOptions = (left: ProviderOptions, right: ProviderOptions): ProviderOp * reasoning streams into assistant parts, preserving provider metadata as * prompt options, placing tool calls and approval requests in an assistant * message, and placing non-preliminary tool results in a tool message using - * their encoded results. + * their encoded results. Results for tool calls from an earlier message, such + * as resolved approvals, are placed in a tool message before the assistant + * message. * * **Example** (Creating prompts from response parts) * @@ -2242,6 +2244,13 @@ export const fromResponseParts = (parts: ReadonlyArray): Promp const assistantParts: Array = [] const toolParts: Array = [] + const priorToolParts: Array = [] + const toolCallIds = new Set() + for (const part of parts) { + if (part.type === "tool-call") { + toolCallIds.add(part.id) + } + } const activeTextDeltas = new Map() const activeReasoningDeltas = new Map() @@ -2333,7 +2342,11 @@ export const fromResponseParts = (parts: ReadonlyArray): Promp // Tool Result Parts (skip preliminary results) case "tool-result": { if (part.preliminary !== true) { - const target = part.providerExecuted === true ? assistantParts : toolParts + const target = part.providerExecuted === true + ? assistantParts + : toolCallIds.has(part.id) + ? toolParts + : priorToolParts target.push(makePart("tool-result", { id: part.id, name: part.name, @@ -2368,12 +2381,16 @@ export const fromResponseParts = (parts: ReadonlyArray): Promp const assistantContent = assistantParts.filter((part) => part !== undefined) - if (assistantContent.length === 0 && toolParts.length === 0) { + if (assistantContent.length === 0 && toolParts.length === 0 && priorToolParts.length === 0) { return empty } const messages: Array = [] + if (priorToolParts.length > 0) { + messages.push(makeMessage("tool", { content: priorToolParts })) + } + if (assistantContent.length > 0) { messages.push(makeMessage("assistant", { content: assistantContent })) } diff --git a/.repos/effect/packages/effect/src/ai/Skill.ts b/.repos/effect/packages/effect/src/ai/Skill.ts new file mode 100644 index 0000000000000..891a6b7c3173e --- /dev/null +++ b/.repos/effect/packages/effect/src/ai/Skill.ts @@ -0,0 +1,236 @@ +/** + * Standalone Agent Skill value and schema for local agents and MCP servers. + * + * A `Skill` models an Agent Skill (https://agentskills.io/specification) as + * plain data — validated YAML `frontmatter`, markdown `instructions`, and + * supporting `files` — with `SKILL.md` as its serialization format via + * {@link toFiles} and {@link fromFiles}. + * + * @stability unstable + * @since 4.1.6 + */ +import * as Cause from "../Cause.ts" +import * as Effect from "../Effect.ts" +import * as Yaml from "../encoding/Yaml.ts" +import * as Predicate from "../Predicate.ts" +import * as Schema from "../Schema.ts" +import * as SchemaTransformation from "../SchemaTransformation.ts" + +const SKILL_NAME = /^[a-z0-9]+(?:-[a-z0-9]+)*$/ + +/** + * Schema for the YAML frontmatter of an Agent Skill's `SKILL.md`, as the + * Agent Skills specification defines it (https://agentskills.io/specification). + * + * **Details** + * + * Fields the specification does not define are kept unchanged. + * + * @stability unstable + * @category schemas + * @since 4.1.6 + */ +export const Frontmatter = Schema.StructWithRest( + Schema.Struct({ + /** + * 1 to 64 lowercase letters, digits and hyphens, with no leading, trailing + * or consecutive hyphen. It names the directory holding `SKILL.md`. + */ + name: Schema.String.check(Schema.isMaxLength(64), Schema.isPattern(SKILL_NAME)), + /** + * What the skill does and when to use it, in 1 to 1024 characters. + */ + description: Schema.String.check(Schema.isNonEmpty(), Schema.isMaxLength(1024)), + /** + * The skill's license, or the name of a bundled license file. + */ + license: Schema.optionalKey(Schema.String), + /** + * Environment requirements, in 1 to 500 characters. + */ + compatibility: Schema.optionalKey(Schema.String.check(Schema.isNonEmpty(), Schema.isMaxLength(500))), + /** + * Additional properties not defined by the specification. + */ + metadata: Schema.optionalKey(Schema.Record(Schema.String, Schema.String)), + /** + * Space-separated tools the skill asks to run without approval. Hosts must + * ignore it for a skill served over MCP unless the user approved the grant. + */ + "allowed-tools": Schema.optionalKey(Schema.String) + }), + [Schema.JsonObject] +) + +/** + * The YAML frontmatter of an Agent Skill's `SKILL.md`. + * + * @stability unstable + * @category models + * @since 4.1.6 + */ +export type Frontmatter = typeof Frontmatter.Type + +const isSafeSkillFilePath = (path: string): boolean => + path !== "" && + path !== "SKILL.md" && + !path.includes("\\") && + !/^[A-Za-z]:/.test(path) && + path.split("/").every((segment) => segment !== "" && segment !== "." && segment !== "..") + +const Bytes = Schema.Uint8Array.annotate({ + toCodecJson: () => + Schema.link>()( + Schema.Struct({ base64: Schema.Uint8ArrayFromBase64 }), + SchemaTransformation.transform({ + decode: ({ base64 }) => base64, + encode: (base64) => ({ base64 }) + }) + ) +}) + +const SkillFiles = Schema.Record(Schema.String, Schema.Union([Schema.String, Bytes])).check( + Schema.makeFilter((files) => { + const path = Object.keys(files).find((path) => !isSafeSkillFilePath(path)) + return path === undefined || `Invalid skill file path "${path}"` + }) +) + +/** + * Schema and class for an Agent Skill bundle. + * + * **Details** + * + * Holds validated {@link Frontmatter}, markdown `instructions`, and supporting + * `files` keyed by safe relative paths (excluding `SKILL.md`). When encoded + * with `Schema.toCodecJson`, binary `Uint8Array` files are represented as + * `{ base64: string }` so text and binary files stay distinct. + * + * @see {@link make} for constructing a skill + * @see {@link toFiles} for rendering a skill to a file map including `SKILL.md` + * @see {@link fromFiles} for parsing a skill from a file map containing `SKILL.md` + * + * @stability unstable + * @category models + * @since 4.1.6 + */ +export class Skill extends Schema.Class("effect/ai/Skill")({ + frontmatter: Frontmatter, + instructions: Schema.String, + files: SkillFiles +}) {} + +/** + * Constructs a validated {@link Skill}. + * + * **Gotchas** + * + * Throws an `Error` (with the validation issue on `cause`) when `frontmatter` + * fails validation or any key in `files` is `"SKILL.md"` or an unsafe path. + * Use {@link fromFiles} or `Schema.decodeUnknownEffect(Skill)` for untrusted input. + * + * @see {@link fromFiles} for effectful construction from a raw file map + * + * @stability unstable + * @category constructors + * @since 4.1.6 + */ +export const make = (options: { + readonly frontmatter: Frontmatter + readonly instructions: string + readonly files?: Readonly> | undefined +}): Skill => new Skill({ ...options, files: options.files ?? {} }) + +/** + * Renders a {@link Skill} into a file map that includes the generated + * `SKILL.md` along with all supporting files. + * + * **Details** + * + * Frontmatter keys and values are JSON-encoded so YAML edge cases round-trip + * cleanly through {@link fromFiles}. + * + * @see {@link fromFiles} for parsing a file map back into a {@link Skill} + * + * @stability unstable + * @category conversions + * @since 4.1.6 + */ +export const toFiles = ( + self: Skill +): { readonly "SKILL.md": string } & Readonly> => { + const frontmatter = Object.entries(self.frontmatter) + .map(([key, value]) => `${JSON.stringify(key)}: ${JSON.stringify(value)}`) + .join("\n") + return { "SKILL.md": `---\n${frontmatter}\n---\n\n${self.instructions}`, ...self.files } +} + +const utf8 = new TextDecoder("utf-8", { fatal: true, ignoreBOM: true }) + +const decodeUtf8 = (content: Uint8Array): string | undefined => { + try { + return utf8.decode(content) + } catch { + return undefined + } +} + +const FRONTMATTER = /^\uFEFF?---\r?\n([\s\S]*?)\r?\n---[ \t]*(?:\r?\n|$)/ + +const parseSkillMarkdown = ( + markdown: string +): { readonly frontmatter: Record; readonly instructions: string } | undefined => { + const match = FRONTMATTER.exec(markdown) + if (match === null) return undefined + try { + const parsed = Yaml.parse(match[1]) + if (!Predicate.isObject(parsed)) return undefined + // Keep only JSON values so `.inf` and `.nan` normalize to `null`. + const frontmatter: Record = JSON.parse(JSON.stringify(parsed)) + const instructions = markdown.slice(match[0].length).replace(/^\r?\n/, "") + return { frontmatter, instructions } + } catch { + return undefined + } +} + +const decodeSkill = Schema.decodeUnknownEffect(Skill) + +/** + * Parses a {@link Skill} from a file map containing `SKILL.md` and optional + * supporting files. + * + * **Details** + * + * Fails with `Cause.IllegalArgumentError` when `SKILL.md` is missing, not + * valid UTF-8, lacks a valid YAML frontmatter block, or fails {@link Skill} + * schema validation. + * + * @see {@link toFiles} for the inverse conversion + * @see {@link make} for constructing a skill from structured fields + * + * @stability unstable + * @category constructors + * @since 4.1.6 + */ +export const fromFiles = ( + files: Readonly> +): Effect.Effect => + Effect.suspend(() => { + // Rest destructuring defines own properties, so a file named `__proto__` survives. + const { "SKILL.md": skillMd, ...supportingFiles } = files + if (skillMd === undefined) { + return Effect.fail(new Cause.IllegalArgumentError("Skill is missing SKILL.md")) + } + const markdown = typeof skillMd === "string" ? skillMd : decodeUtf8(skillMd) + if (markdown === undefined) { + return Effect.fail(new Cause.IllegalArgumentError("SKILL.md is not valid UTF-8")) + } + const parsed = parseSkillMarkdown(markdown) + if (parsed === undefined) { + return Effect.fail(new Cause.IllegalArgumentError("SKILL.md is missing valid YAML frontmatter")) + } + return decodeSkill({ ...parsed, files: supportingFiles }).pipe( + Effect.mapError((error) => new Cause.IllegalArgumentError(error.message)) + ) + }) diff --git a/.repos/effect/packages/effect/src/ai/index.ts b/.repos/effect/packages/effect/src/ai/index.ts index 23dc822054dc6..38c2038595a69 100644 --- a/.repos/effect/packages/effect/src/ai/index.ts +++ b/.repos/effect/packages/effect/src/ai/index.ts @@ -137,6 +137,12 @@ export * as Response from "./Response.ts" */ export * as ResponseIdTracker from "./ResponseIdTracker.ts" +/** + * @stability unstable + * @since 4.1.6 + */ +export * as Skill from "./Skill.ts" + /** * @stability unstable * @since 4.0.0 diff --git a/.repos/effect/packages/effect/src/cluster/ClusterWorkflowEngine.ts b/.repos/effect/packages/effect/src/cluster/ClusterWorkflowEngine.ts index e288eaf495c1d..08c444cdfc1a8 100644 --- a/.repos/effect/packages/effect/src/cluster/ClusterWorkflowEngine.ts +++ b/.repos/effect/packages/effect/src/cluster/ClusterWorkflowEngine.ts @@ -16,6 +16,7 @@ import * as Effect from "../Effect.ts" import * as Exit from "../Exit.ts" import * as Fiber from "../Fiber.ts" import * as Headers from "../http/Headers.ts" +import * as Latch from "../Latch.ts" import * as Layer from "../Layer.ts" import * as Option from "../Option.ts" import * as PrimaryKey from "../PrimaryKey.ts" @@ -30,6 +31,8 @@ import * as Semaphore from "../Semaphore.ts" import * as Activity from "../workflow/Activity.ts" import * as DurableClock from "../workflow/DurableClock.ts" import * as DurableDeferred from "../workflow/DurableDeferred.ts" +import { RetryingExecution } from "../workflow/internal/retry.ts" +import { markScopeAbandoned, reuseOrForkScope } from "../workflow/internal/scope.ts" import * as Workflow from "../workflow/Workflow.ts" import * as WorkflowEngine from "../workflow/WorkflowEngine.ts" import * as ClusterSchema from "./ClusterSchema.ts" @@ -40,7 +43,7 @@ import * as EntityId from "./EntityId.ts" import * as EntityType from "./EntityType.ts" import * as Envelope from "./Envelope.ts" import * as ClusterAbandon from "./internal/clusterAbandon.ts" -import { CurrentActivationScope } from "./internal/entityActivation.ts" +import { CurrentActivationScope, CurrentRetirementLatch } from "./internal/entityActivation.ts" import * as Message from "./Message.ts" import { MessageStorage } from "./MessageStorage.ts" import type { WithExitEncoded } from "./Reply.ts" @@ -94,6 +97,7 @@ export const make = Effect.gen(function*() { Schema.declare> > | typeof ResumeRpc + | typeof ParentRpc > >() const partialEntities = new Map< @@ -106,7 +110,6 @@ export const make = Effect.gen(function*() { Schema.Struct<{ name: typeof Schema.String; attempt: typeof Schema.Int }>, Schema.declare> > - | typeof ResumeRpc > >() const ensureEntity = (workflow: Workflow.Any) => { @@ -142,9 +145,8 @@ export const make = Effect.gen(function*() { Effect.suspend(() => { const scope = state.scope if (abandoned) { - for (const instance of state.instances) instance.abandoned = true + markScopeAbandoned(scope) } - state.instances.clear() state.scope = Scope.makeUnsafe() return Scope.close(scope, Exit.void) }) @@ -166,21 +168,21 @@ export const make = Effect.gen(function*() { }), idleTimeToLive: "5 minutes" }) - const entityAddressFor = (options: { - readonly workflow: Workflow.Any - readonly entityType: string - readonly executionId: string - }) => { - const shardGroup = Context.get(options.workflow.annotations, ClusterSchema.ShardGroup)( - options.executionId as EntityId.EntityId - ) - const entityId = EntityId.make(options.executionId) + const shardGroupFor = (workflow: Workflow.Any, executionId: string) => + Context.get(workflow.annotations, ClusterSchema.ShardGroup)(executionId as EntityId.EntityId) + const entityAddress = (entityType: string, executionId: string, shardGroup: string) => { + const entityId = EntityId.make(executionId) return EntityAddress.make({ - entityType: EntityType.make(options.entityType), + entityType: EntityType.make(entityType), entityId, shardId: sharding.getShardId(entityId, shardGroup) }) } + const entityAddressFor = (options: { + readonly workflow: Workflow.Any + readonly entityType: string + readonly executionId: string + }) => entityAddress(options.entityType, options.executionId, shardGroupFor(options.workflow, options.executionId)) const sendDiscard = Effect.fnUntraced(function*(options: { readonly rpc: Rpc.AnyWithProps @@ -249,6 +251,9 @@ export const make = Effect.gen(function*() { return yield* replyForRequestId(requestId.value) }) + const runReply = (workflow: Workflow.Any, executionId: string) => + requestReply({ workflow, entityType: `Workflow/${workflow._tag}`, executionId, tag: "run", id: "" }) + const resetActivityAttempt = Effect.fnUntraced( function*(options: { readonly workflow: Workflow.Any @@ -281,27 +286,11 @@ export const make = Effect.gen(function*() { readonly workflow: Workflow.Any readonly executionId: string }) { - const shardGroup = Context.get(options.workflow.annotations, ClusterSchema.ShardGroup)( - options.executionId as EntityId.EntityId - ) - const entityId = EntityId.make(options.executionId) - const shardId = sharding.getShardId(entityId, shardGroup) - const clockAddress = EntityAddress.make({ - entityType: ClockEntity.type, - entityId, - shardId - }) - yield* storage.clearAddress(clockAddress) + yield* storage.clearAddress(entityAddressFor({ ...options, entityType: ClockEntity.type })) }) const resume = Effect.fnUntraced(function*(workflow: Workflow.Any, executionId: string, mode: WakeMode) { - const maybeReply = yield* requestReply({ - workflow, - entityType: `Workflow/${workflow._tag}`, - executionId, - tag: "run", - id: "" - }) + const maybeReply = yield* runReply(workflow, executionId) const maybeSuspended = Option.filter(maybeReply, isSuspendedReply) @@ -328,25 +317,30 @@ export const make = Effect.gen(function*() { pending.results.has(InterruptSignal.name) }) - const sendResumeParent = Effect.fnUntraced(function*(options: { - readonly workflowName: string - readonly executionId: string - }, childExecutionId: string) { - const requestId = yield* requestIdFor({ - workflow: workflows.get(options.workflowName)!, - entityType: `Workflow/${options.workflowName}`, - executionId: options.executionId, + const sendResumeParent = Effect.fnUntraced(function*(parent: ParentRef, childExecutionId: string) { + // Parents saved before `shardGroup` existed, or in the default group, omit it. + const workflow = workflows.get(parent.workflowName) + const address = entityAddress( + `Workflow/${parent.workflowName}`, + parent.executionId, + parent.shardGroup ?? (workflow ? shardGroupFor(workflow, parent.executionId) : "default") + ) + const requestId = yield* storage.requestIdForPrimaryKey({ + address, tag: "resume", id: childExecutionId }) if (Option.isNone(requestId)) { - const client = (yield* RcMap.get(clientsPartial, options.workflowName))(options.executionId) - return yield* client.resume({ childExecutionId }, { discard: true }) + return yield* sendDiscard({ + rpc: ResumeRpc, + address, + payload: { childExecutionId } + }) } const reply = yield* replyForRequestId(requestId.value) if (Option.isNone(reply)) return yield* sharding.reset(requestId.value, { expectedReplyId: Snowflake.Snowflake(reply.value.id) }) - }, Effect.scoped) + }) // Subscribe to the run's next reply before reading storage, so a reply // cannot fall between the read and the subscription. Returns `true` when the @@ -421,11 +415,7 @@ export const make = Effect.gen(function*() { } const reply = yield* replyForRequestId(requestId.value) - const nonSuspendedReply = Option.filter( - reply, - (reply) => !isSuspendedReply(reply) - ) - if (Option.isSome(nonSuspendedReply)) { + if (isRunSettled(reply)) { return Option.none() } @@ -471,12 +461,15 @@ export const make = Effect.gen(function*() { (decoded.exit._tag === "Success" ? decoded.exit.value : decoded.exit) as Exit.Exit ) } + const retired = Option.getOrUndefined(yield* Effect.serviceOption(CurrentRetirementLatch)) pending = { workflowName: workflow._tag, executionId, results, - instances: new Set(), - scope: Scope.makeUnsafe() + scope: Scope.makeUnsafe(), + retired, + idle: Latch.makeUnsafe(true), + executing: 0 } yield* Scope.addFinalizer(activation, closeRuns(pending, true)) pendingByActivation.set(activation, pending) @@ -488,6 +481,9 @@ export const make = Effect.gen(function*() { readonly instance: WorkflowEngine.WorkflowInstance["Service"] // Activity awaits must wake the run after suspension without preempting it. readonly activityAwaits: Map + // Set once the exiting run starts listing its parents, so a later + // `parent` registration waits for the reply and wakes its own parent. + completing: boolean } | undefined // Concurrent automatic wakes share one wait for the current run to // publish its reply. Explicit wakes cannot be dropped, because an @@ -509,17 +505,30 @@ export const make = Effect.gen(function*() { ) ) ) + // An asynchronous reply releases the RPC concurrency permit while + // the effect waits; the pending request still occupies mailbox capacity. + // The activation owns the fiber so it survives handler rebuilds, + // but activation shutdown still interrupts it for durable redelivery. + const forkReply = (effect: Effect.Effect) => { + const reply = Deferred.makeUnsafe() + return effect.pipe( + Deferred.into(reply), + Effect.forkIn(activation, { startImmediately: true }), + Effect.as(reply) + ) + } return { run: (request: Entity.Request) => { - // Each run gets a fresh scope under the activation's parent, so - // replays rebuild compensations while suspended runs keep theirs. + // A superseded instance retained by a finalizer no longer needs its wait sets. + currentRun?.instance.awaitedDeferreds.clear() + currentRun?.instance.completedDeferreds.clear() const instance = WorkflowEngine.WorkflowInstance.initial(workflow, executionId, { - scope: Scope.forkUnsafe(pending.scope) + scope: reuseOrForkScope(currentRun?.instance.scope, pending.scope) }) - pending.instances.add(instance) - currentRun = { request, instance, activityAwaits: new Map() } + const current = { request, instance, activityAwaits: new Map(), completing: false } + currentRun = current const parent = (request.payload as any)[payloadParentKey] as - | { workflowName: string; executionId: string; detached?: boolean } + | (ParentRef & { readonly detached?: boolean }) | undefined return execute(workflow.payloadSchema.make(request.payload) as object, executionId).pipe( Effect.onExit((exit) => { @@ -531,10 +540,19 @@ export const make = Effect.gen(function*() { if (instance.abandoned) { instance.suspended = false } - // Abandoned runs never wake the parent; another owner replays them. - const resumeParent = parent && !parent.detached && !instance.abandoned - ? ensureSuccess(sendResumeParent(parent, executionId)) - : Effect.void + // Abandoned runs never wake parents; another owner replays them. + const resumeParent = instance.abandoned ? Effect.void : ensureSuccess(Effect.gen(function*() { + current.completing = true + const parents = (yield* storage.requestsForAddress({ address, tag: "parent" })) + .map((registration) => registration.payload as ParentRef) + // Registrations are unique by parent; only an older caller's payload parent can repeat one. + if (parent && !parent.detached && !parents.some((ref) => sameParent(ref, parent))) { + parents.push(parent) + } + for (const ref of parents) { + yield* sendResumeParent(ref, executionId) + } + })) if ( !instance.suspended && !instance.abandoned && @@ -613,9 +631,12 @@ export const make = Effect.gen(function*() { Context.add(CurrentActivationScope, activation), Context.add(Activity.CurrentAttempt, payload.attempt) ) + pending.executing++ + pending.idle.closeUnsafe() return entry.activity.executeEncoded.pipe( Effect.provideContext(context), Workflow.intoResult, + Effect.provideService(RetryingExecution, Context.get(entry.context, RetryingExecution)), Effect.tap((result) => Effect.sync(() => { entry.result = result @@ -629,6 +650,9 @@ export const make = Effect.gen(function*() { ) return suspend ? Effect.succeed(new Workflow.Suspended({})) : Effect.failCause(cause) }), + Effect.ensuring(Effect.sync(() => { + if (--pending.executing === 0) pending.idle.openUnsafe() + })), Effect.provideService(WorkflowEngine.WorkflowInstance, instance), Effect.provideService(Activity.CurrentAttempt, payload.attempt), Rpc.wrap({ fork: true, uninterruptible: true }) @@ -659,24 +683,32 @@ export const make = Effect.gen(function*() { Effect.andThen(resumeCurrentRun(mode)) ) ) - // An asynchronous reply releases the RPC concurrency permit while - // the wake waits; the pending request still occupies mailbox capacity. - // The activation owns the wake so it survives handler rebuilds, - // but activation shutdown still interrupts it for durable redelivery. - const reply = Deferred.makeUnsafe>() - return wake.pipe( - Effect.as(payload.exit), - Deferred.into(reply), - Effect.forkIn(activation, { startImmediately: true }), - Effect.as(reply) - ) + return forkReply(Effect.as(wake, payload.exit as Exit.Exit)) }, - resume: () => resumeCurrentRun("automatic").pipe(Rpc.wrap({ fork: true, uninterruptible: true })) + resume: () => resumeCurrentRun("automatic").pipe(Rpc.wrap({ fork: true, uninterruptible: true })), + + parent: (request: Entity.Request) => { + const ref = request.payload as ParentRef + // The exiting run may have listed parents before this + // registration; wait for its reply, then wake. + if (currentRun?.completing) { + return forkReply( + ensureSuccess( + Effect.andThen(waitForRunReply(workflow, currentRun.request), sendResumeParent(ref, executionId)) + ) + ) + } + return Effect.gen(function*() { + if (isRunSettled(yield* retryPersistence(runReply(workflow, executionId)))) { + yield* ensureSuccess(sendResumeParent(ref, executionId)) + } + }).pipe(Rpc.wrap({ fork: true })) + } } }), - // Alongside the run, let deferred handlers briefly acquire a permit to - // fork their wake and return an asynchronous reply. + // Alongside the run, let deferred and `parent` handlers briefly acquire a + // permit to fork their wake and return an asynchronous reply. { concurrency: 2, maxIdleTime: entityMaxIdleTime } ) as Effect.Effect if (existing === undefined || existing === workflow) return registration @@ -692,20 +724,35 @@ export const make = Effect.gen(function*() { execute: (workflow, { detached, discard, executionId, parent, payload }) => { ensureEntity(workflow) return RcMap.get(clients, workflow._tag).pipe( - Effect.flatMap((make) => - make(executionId).run( - parent ? + Effect.flatMap((make) => { + const client = make(executionId) + // The shard group lets a runner without the parent's workflow address its wake. + const shardGroup = parent && !detached ? shardGroupFor(parent.workflow, parent.executionId) : "default" + const ref: ParentRef | undefined = parent && { + workflowName: parent.workflow._tag, + executionId: parent.executionId, + ...(shardGroup === "default" ? undefined : { shardGroup }) + } + const run = client.run( + ref ? { ...payload, // A detached child keeps its parent for observability only. - [payloadParentKey]: detached - ? { workflowName: parent.workflow._tag, executionId: parent.executionId, detached: true } - : { workflowName: parent.workflow._tag, executionId: parent.executionId } + [payloadParentKey]: detached ? { ...ref, detached: true } : ref } : payload, { discard } ) - ), + if (!ref || detached || sameParent(ref, { workflowName: workflow._tag, executionId })) { + return run + } + // Discarded, so an open transaction or an older runner cannot block it. + const register = Effect.flatMap( + runReply(workflow, executionId), + (reply) => isRunSettled(reply) ? Effect.void : client.parent(ref, { discard: true }) + ) + return Effect.andThen(register, run) + }), // A failed save inside a workflow would be stored as its result. Top-level // calls still fail, so their callers are not blocked during an outage. parent ? retryPersistence : Effect.orDie, @@ -716,13 +763,7 @@ export const make = Effect.gen(function*() { poll: Effect.fnUntraced(function*(workflow, executionId) { const entity = ensureEntity(workflow) const exitSchema = Schema.toCodecJson(Rpc.exitSchema(entity.protocol.requests.get("run")!)) - const reply = yield* requestReply({ - workflow, - entityType: `Workflow/${workflow._tag}`, - executionId, - tag: "run", - id: "" - }) + const reply = yield* runReply(workflow, executionId) if (Option.isNone(reply)) return Option.none() const exit = yield* (Schema.decodeUnknownEffect(exitSchema)(reply.value.exit) as Effect.Effect< Exit.Exit, @@ -791,14 +832,25 @@ export const make = Effect.gen(function*() { if (activities.get(activityId) === entry) activities.delete(activityId) }) ) + const activation = yield* Effect.serviceOption(CurrentActivationScope) + const pending = Option.isSome(activation) ? pendingByActivation.get(activation.value) : undefined + const handoff = pending?.retired && + pending.workflowName === instance.workflow._tag && + pending.executionId === instance.executionId + ? Effect.andThen(pending.retired.await, Effect.as(pending.idle.await, Option.none())) + : Effect.never while (true) { - const result = yield* retryPersistence( + const maybeResult = yield* retryPersistence( client.activity({ name: activity.name, attempt, withTransaction: Context.get(activity.annotations, ClusterSchema.WithTransaction) }) - ) + ).pipe(Effect.asSome, Effect.raceFirst(handoff)) + // The retired entity will not run this activity. Leave the run for + // the next owner, which replays it and reads the saved results. + if (Option.isNone(maybeResult)) return yield* ClusterAbandon.interrupt + const result = maybeResult.value // If the activity has suspended and did not execute, we need to resume // it by resetting the attempt and re-executing. if ( @@ -995,15 +1047,22 @@ interface ActivationState { readonly workflowName: string readonly executionId: string readonly results: Map> - // Every run forks its scope from here, so runs that suspended keep their - // resources and durable finalizers until the execution finishes. + // Parent of every run's scope, so runs that suspended keep their resources + // and durable finalizers until the execution finishes. scope: Scope.Closeable - readonly instances: Set + // Opens when this activation retires; paired with `idle` so in-flight + // activities finish before any waiting run hands off to the next owner. + readonly retired: Latch.Latch | undefined + readonly idle: Latch.Latch + executing: number } const isSuspendedReply = (reply: WithExitEncoded>) => reply.exit._tag === "Success" && reply.exit.value._tag === "Suspended" +const isRunSettled = (reply: Option.Option>>) => + Option.isSome(reply) && !isSuspendedReply(reply.value) + const isFailedReply = (reply: WithExitEncoded>) => reply.exit._tag === "Success" && reply.exit.value._tag === "Suspended" && reply.exit.value.failed === true @@ -1024,6 +1083,24 @@ const ResumeRpc = Rpc.make("resume", { .annotate(ClusterSchema.Persisted, true) .annotate(ClusterSchema.Uninterruptible, "server") +const ParentRefSchema = Schema.Struct({ + workflowName: Schema.String, + executionId: Schema.String, + shardGroup: Schema.optional(Schema.String) +}) +type ParentRef = typeof ParentRefSchema.Type + +// The shard group only routes the wake, so it is not part of a parent's identity. +const sameParent = (a: ParentRef, b: ParentRef) => a.workflowName === b.workflowName && a.executionId === b.executionId + +const ParentRpc = Rpc.make("parent", { + payload: ParentRefSchema.fields, + // Length-prefixed so an execution id containing a separator cannot collide. + primaryKey: (parent) => `${parent.workflowName.length}:${parent.workflowName}:${parent.executionId}` +}) + .annotate(ClusterSchema.Persisted, true) + .annotate(ClusterSchema.Uninterruptible, "server") + const payloadParentKey = "~effect/cluster/ClusterWorkflowEngine/payloadParentKey" // Workflow state is durable, so an idle entity (completed or suspended) can @@ -1038,8 +1115,7 @@ const makeWorkflowEntity = (workflow: Workflow.Any) => payload: { ...workflow.payloadSchema.fields, [payloadParentKey]: Schema.optional(Schema.Struct({ - workflowName: Schema.String, - executionId: Schema.String, + ...ParentRefSchema.fields, detached: Schema.optional(Schema.Boolean) })) }, @@ -1054,13 +1130,13 @@ const makeWorkflowEntity = (workflow: Workflow.Any) => DeferredRpc, ResumeRpc, + ParentRpc, ActivityRpc ]).annotateMerge(workflow.annotations) const makePartialWorkflowEntity = (workflowName: string) => Entity.make(`Workflow/${workflowName}`, [ DeferredRpc, - ResumeRpc, ActivityRpc ]) diff --git a/.repos/effect/packages/effect/src/cluster/MessageStorage.ts b/.repos/effect/packages/effect/src/cluster/MessageStorage.ts index 75326d3b1a3b5..8dadde838122a 100644 --- a/.repos/effect/packages/effect/src/cluster/MessageStorage.ts +++ b/.repos/effect/packages/effect/src/cluster/MessageStorage.ts @@ -118,6 +118,23 @@ export class MessageStorage extends Context.Service Effect.Effect, PersistenceError> + /** + * Retrieves every request saved for the address under the RPC tag, whether + * or not it has been processed, in no particular order. + * + * **Details** + * + * The entity type, entity id and tag must match exactly, including case. The + * shard id is ignored, as in `clearAddress`, so requests saved before a shard + * reassignment are still returned. + */ + readonly requestsForAddress: ( + options: { + readonly address: EntityAddress + readonly tag: string + } + ) => Effect.Effect, PersistenceError> + /** * For locally sent messages, register a handler to process the replies. * @@ -418,6 +435,23 @@ export type Encoded = { primaryKey: string ) => Effect.Effect, PersistenceError> + /** + * Retrieves every request saved for the address under the RPC tag, whether + * or not it has been processed, in no particular order. + * + * **Details** + * + * The entity type, entity id and tag must match exactly, including case. The + * shard id is ignored, as in `clearAddress`, so requests saved before a shard + * reassignment are still returned. + */ + readonly requestsForAddress: ( + options: { + readonly address: EntityAddress + readonly tag: string + } + ) => Effect.Effect, PersistenceError> + /** * Retrieves the replies for the specified requests. * @@ -659,9 +693,11 @@ export const make = ( handlers.push(entry) shardSet.add(entry) return Effect.sync(() => { - const index = handlers.indexOf(entry) - handlers.splice(index, 1) + handlers.splice(handlers.indexOf(entry), 1) shardSet.delete(entry) + if (handlers.length === 0 && replyHandlers.get(requestId) === handlers) { + replyHandlers.delete(requestId) + } }) }) }, @@ -815,6 +851,7 @@ export const makeEncoded: (encoded: Encoded) => Effect.Effect< const primaryKey = Envelope.primaryKeyByAddress(options) return encoded.requestIdForPrimaryKey(primaryKey) }, + requestsForAddress: encoded.requestsForAddress, unprocessedMessages(shardIds, options) { const storage = this as unknown as MessageStorage["Service"] const shards = Array.from(shardIds, (id) => id.toString()) @@ -965,6 +1002,7 @@ export const noop: MessageStorage["Service"] = Effect.runSync(make({ repliesFor: () => Effect.succeed([]), repliesForUnfiltered: () => Effect.succeed([]), requestIdForPrimaryKey: () => Effect.succeedNone, + requestsForAddress: () => Effect.succeed([]), unprocessedMessages: () => Effect.succeed([]), unprocessedMessagesById: () => Effect.succeed([]), resetAddress: () => Effect.void, @@ -1179,6 +1217,17 @@ export class MemoryDriver extends Context.Service()("effect/cluste const entry = requestsByPrimaryKey.get(primaryKey) return Option.map(Option.fromNullishOr(entry?.envelope.requestId), Snowflake.Snowflake) }), + requestsForAddress: ({ address, tag }) => + Effect.sync(() => { + const out: Array = [] + for (const { envelope } of requests.values()) { + if ( + envelope._tag === "Request" && envelope.tag === tag && + envelope.address.entityType === address.entityType && envelope.address.entityId === address.entityId + ) out.push(envelope) + } + return out + }), repliesFor: (requestIds) => Effect.sync(() => repliesFor(requestIds)), repliesForUnfiltered: (requestIds) => Effect.sync(() => requestIds.flatMap((id) => requests.get(String(id))?.replies ?? [])), diff --git a/.repos/effect/packages/effect/src/cluster/SqlMessageStorage.ts b/.repos/effect/packages/effect/src/cluster/SqlMessageStorage.ts index 3562d164d6ebe..2b96164e9be3c 100644 --- a/.repos/effect/packages/effect/src/cluster/SqlMessageStorage.ts +++ b/.repos/effect/packages/effect/src/cluster/SqlMessageStorage.ts @@ -344,18 +344,24 @@ export const makeEncodedStorage: (options?: { `${messageColumns}, ${idAs("r.id", "reply_reply_id")}, ${replyJoinColumns}` ) - const selectByMessageId = (message_id: string): Effect.Effect, SqlError> => + const emptyFragment = sql.literal("") + const selectByMessageId = ( + message_id: string, + lock: Fragment = emptyFragment + ): Effect.Effect, SqlError> => sql` SELECT ${duplicateColumns} FROM ${messagesTableSql} m LEFT JOIN ${repliesTableSql} r ON r.id = m.last_reply_id WHERE m.message_id = ${message_id} + ${lock} ` const maxInsertAttempts = 3 // Runs an insert that reports whether it stored the row, returning the // existing row with the same message_id when it did not const insertUnlessExists = ( - insert: (row: MessageRow, message_id: string) => Effect.Effect + insert: (row: MessageRow, message_id: string) => Effect.Effect, + lock?: Fragment ) => (row: MessageRow, message_id: string): Effect.Effect, SqlError> => { // deleteProcessed can delete the existing row before it is read, so insert @@ -364,7 +370,7 @@ export const makeEncodedStorage: (options?: { Effect.flatMap( insert(row, message_id), (inserted) => - inserted ? Effect.succeed([]) : Effect.flatMap(selectByMessageId(message_id), (rows) => { + inserted ? Effect.succeed([]) : Effect.flatMap(selectByMessageId(message_id, lock), (rows) => { if (rows.length > 0) return Effect.succeed(rows) if (attempt < maxInsertAttempts) return loop(attempt + 1) return Effect.fail( @@ -397,11 +403,15 @@ export const makeEncodedStorage: (options?: { ) ), mysql: () => - insertUnlessExists((row) => - Effect.map( - sql`INSERT IGNORE INTO ${messagesTableSql} ${sql.insert(row)}`.raw, - (result: any) => result.affectedRows > 0 - ) + insertUnlessExists( + (row) => + Effect.map( + sql`INSERT IGNORE INTO ${messagesTableSql} ${sql.insert(row)}`.raw, + (result: any) => result.affectedRows > 0 + ), + // At MySQL's default REPEATABLE READ, a plain SELECT reads the + // transaction's snapshot and misses a row committed after it began. + sql.literal("LOCK IN SHARE MODE") ), mssql: () => insertUnlessExists((row, message_id) => @@ -557,7 +567,6 @@ export const makeEncodedStorage: (options?: { ` }) - const emptyFragment = sql.literal("") // mssql only limits with OFFSET/FETCH, which requires the ORDER BY that // both queries already have const limitFragment = sql.onDialectOrElse({ @@ -847,6 +856,29 @@ export const makeEncodedStorage: (options?: { withTracerDisabled ), + requestsForAddress: ({ address, tag }) => + sql` + SELECT ${sql.literal(messageColumns)} + FROM ${messagesTableSql} m + WHERE m.entity_type = ${address.entityType} + AND m.entity_id = ${address.entityId} + AND m.tag = ${tag} + AND m.kind = ${messageKindRequest} + `.pipe( + // The indexed predicates follow the column collation, which may ignore case, + // accents or trailing spaces, so exact matches are enforced here. + Effect.map((rows) => + rows + .filter((row) => + row.entity_type === address.entityType && row.entity_id === address.entityId && row.tag === tag + ) + .map((row) => messageFromRow(row).envelope as Envelope.PartialRequestEncoded) + ), + Effect.provideService(SqlClient.SafeIntegers, true), + PersistenceError.refail, + withTracerDisabled + ), + repliesForUnfiltered: (requestIds) => sql` SELECT ${replyColumns} @@ -1045,6 +1077,36 @@ export const migrations = (options?: { const messagesTable = table("messages") const repliesTable = table("replies") + const ensureMessagesIndex = Effect.fnUntraced(function*( + name: string, + columnList: string, + mysqlColumnList = columnList + ) { + const sql = (yield* SqlClient.SqlClient).withoutTransforms() + const messagesTableSql = sql(messagesTable) + const index = `${messagesTable}_${name}` + const columns = sql.literal(columnList) + yield* sql.onDialectOrElse({ + mssql: () => + sql` + IF NOT EXISTS (SELECT * FROM sys.indexes WHERE name = ${index} AND object_id = OBJECT_ID(${messagesTable})) + CREATE INDEX ${sql(index)} ON ${messagesTableSql} (${columns}) + `, + mysql: () => + sql` + SELECT 1 FROM information_schema.statistics + WHERE table_schema = DATABASE() AND table_name = ${messagesTable} AND index_name = ${index} + `.pipe( + Effect.flatMap((rows) => + rows.length > 0 + ? Effect.void + : sql`CREATE INDEX ${sql(index)} ON ${messagesTableSql} (${sql.literal(mysqlColumnList)})`.unprepared + ) + ), + orElse: () => sql`CREATE INDEX IF NOT EXISTS ${sql(index)} ON ${messagesTableSql} (${columns})` + }) + }) + // The migrator serializes PostgreSQL DDL. Propagate errors: retrying in an // aborted transaction cannot succeed. return Migrator.fromRecord({ @@ -1353,31 +1415,16 @@ export const migrations = (options?: { }), // Serves deleteProcessed's lookup by entity type and final reply id - "0005_retention_index": Effect.gen(function*() { - const sql = (yield* SqlClient.SqlClient).withoutTransforms() - const messagesTableSql = sql(messagesTable) - const retentionIndex = `${messagesTable}_retention_idx` - const columns = sql.literal("entity_type, processed, last_reply_id") - yield* sql.onDialectOrElse({ - mssql: () => - sql` - IF NOT EXISTS (SELECT * FROM sys.indexes WHERE name = ${retentionIndex} AND object_id = OBJECT_ID(${messagesTable})) - CREATE INDEX ${sql(retentionIndex)} ON ${messagesTableSql} (${columns}) - `, - mysql: () => - sql` - SELECT 1 FROM information_schema.statistics - WHERE table_schema = DATABASE() AND table_name = ${messagesTable} AND index_name = ${retentionIndex} - `.pipe( - Effect.flatMap((rows) => - rows.length > 0 - ? Effect.void - : sql`CREATE INDEX ${sql(retentionIndex)} ON ${messagesTableSql} (${columns})`.unprepared - ) - ), - orElse: () => sql`CREATE INDEX IF NOT EXISTS ${sql(retentionIndex)} ON ${messagesTableSql} (${columns})` - }) - }) + "0005_retention_index": ensureMessagesIndex("retention_idx", "entity_type, processed, last_reply_id"), + + // Serves requestsForAddress and clearAddress. On MySQL, a prefix of + // entity_id keeps the utf8mb4 key within 1,536 bytes (8 KiB pages); + // lookups still compare the full column. + "0006_address_index": ensureMessagesIndex( + "address_idx", + "entity_type, entity_id, tag", + "entity_type, entity_id(128), tag" + ) }) } diff --git a/.repos/effect/packages/effect/src/cluster/internal/entityActivation.ts b/.repos/effect/packages/effect/src/cluster/internal/entityActivation.ts index 9da82263fdccc..55018bc84b826 100644 --- a/.repos/effect/packages/effect/src/cluster/internal/entityActivation.ts +++ b/.repos/effect/packages/effect/src/cluster/internal/entityActivation.ts @@ -1,7 +1,13 @@ import * as Context from "../../Context.ts" +import type * as Latch from "../../Latch.ts" import type * as Scope from "../../Scope.ts" /** The entity lifetime, shared by all handler rebuilds within an activation. @internal */ export class CurrentActivationScope extends Context.Service()( "effect/cluster/internal/CurrentActivationScope" ) {} + +/** Opens when the activation retires and stops accepting new requests. @internal */ +export class CurrentRetirementLatch extends Context.Service()( + "effect/cluster/internal/CurrentRetirementLatch" +) {} diff --git a/.repos/effect/packages/effect/src/cluster/internal/entityManager.ts b/.repos/effect/packages/effect/src/cluster/internal/entityManager.ts index 6ddcbc23a9d9d..96de4069f7b3c 100644 --- a/.repos/effect/packages/effect/src/cluster/internal/entityManager.ts +++ b/.repos/effect/packages/effect/src/cluster/internal/entityManager.ts @@ -39,7 +39,7 @@ import type { Sharding } from "../Sharding.ts" import { ShardingConfig } from "../ShardingConfig.ts" import * as Snowflake from "../Snowflake.ts" import * as ClusterAbandon from "./clusterAbandon.ts" -import { CurrentActivationScope } from "./entityActivation.ts" +import { CurrentActivationScope, CurrentRetirementLatch } from "./entityActivation.ts" import { EntityReaper } from "./entityReaper.ts" import { acquireEntity, releaseEntity } from "./interruptors.ts" import { ResourceMap } from "./resourceMap.ts" @@ -343,6 +343,7 @@ export const make = Effect.fnUntraced(function*< Context.add(CurrentRunnerAddress, options.runnerAddress), Context.add(KeepAliveLatch, keepAliveLatch), Context.add(CurrentActivationScope, scope), + Context.add(CurrentRetirementLatch, retired), Context.add(Scope.Scope, handlerScope), Context.add(CurrentLogAnnotations, {}) ) @@ -643,9 +644,9 @@ export const make = Effect.fnUntraced(function*< scope, Effect.suspend(() => { activeServers.delete(address.entityId) - retired.openUnsafe() closeLatches.closing = true acquireEntity(address) + retired.openUnsafe() drainingServers.set(address.entityId, state) return Effect.raceFirst( Effect.gen(function*() { @@ -801,10 +802,13 @@ export const make = Effect.fnUntraced(function*< if (server.keepAliveRequestId === message.envelope.requestId) return Effect.void if (server.keepAliveRequestId !== undefined) return reply server.keepAliveRequestId = message.envelope.requestId - return server.keepAliveLatch.whenOpen(Effect.suspend(() => { + // Re-check: the latch may close again before this fiber runs. + const release: Effect.Effect = server.keepAliveLatch.whenOpen(Effect.suspend(() => { + if (!server.keepAliveLatch.isOpen()) return release server.keepAliveRequestId = undefined return reply - })).pipe( + })) + return release.pipe( Effect.forkIn(server.scope, { startImmediately: true }), Effect.asVoid ) diff --git a/.repos/effect/packages/effect/src/encoding/Base64.ts b/.repos/effect/packages/effect/src/encoding/Base64.ts index 0efb6fccd64e7..a85b93a831713 100644 --- a/.repos/effect/packages/effect/src/encoding/Base64.ts +++ b/.repos/effect/packages/effect/src/encoding/Base64.ts @@ -252,7 +252,11 @@ const encodeBytes = (bytes: Uint8Array): string => { // Looked up on the prototype at call time, so own or subclass overrides are ignored. const toBase64 = (Uint8Array.prototype as { readonly toBase64?: (this: Uint8Array) => string }).toBase64 // The size guard also keeps detached buffers (length 0) away from native `toBase64`, which throws on them. - if (length >= 32 && typeof toBase64 === "function") return toBase64.call(bytes) + if (length >= 32) { + if (typeof toBase64 === "function") return toBase64.call(bytes) + const encoded = base64.encodeBuffer(bytes, "base64") + if (encoded !== undefined) return encoded + } // Below ~128 bytes, appending to a string beats filling a byte array and decoding it once. return length < 128 ? encodeShort(bytes) : encodeLong(bytes) } diff --git a/.repos/effect/packages/effect/src/encoding/Base64Url.ts b/.repos/effect/packages/effect/src/encoding/Base64Url.ts index 73ccd42a1efe5..ab91aaf0c3023 100644 --- a/.repos/effect/packages/effect/src/encoding/Base64Url.ts +++ b/.repos/effect/packages/effect/src/encoding/Base64Url.ts @@ -173,7 +173,11 @@ const encodeBytes = (bytes: Uint8Array, pad: boolean): string => { readonly toBase64?: (this: Uint8Array, options: NativeEncodeOptions) => string }).toBase64 // The size guard also keeps detached buffers (length 0) away from native `toBase64`, which throws on them. - if (length >= 32 && typeof toBase64 === "function") return toBase64.call(bytes, pad ? paddedOptions : unpaddedOptions) + if (length >= 32) { + if (typeof toBase64 === "function") return toBase64.call(bytes, pad ? paddedOptions : unpaddedOptions) + const encoded = base64.encodeBuffer(bytes, "base64url") + if (encoded !== undefined) return pad ? encoded + padding[encoded.length & 3] : encoded + } // Below ~128 bytes, appending to a string beats filling a byte array and decoding it once. return length < 128 ? encodeShort(bytes, pad) : encodeLong(bytes, pad) } @@ -235,6 +239,7 @@ const nativeDecodeOptions: base64.NativeDecodeOptions = { alphabet: "base64url" const alphabet = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_" const alphabetCodes = encoder.encode(alphabet) const paddingCode = "=".charCodeAt(0) +const padding = ["", "", "==", "="] const codes = new Uint8Array(128) for (let i = 0; i < alphabet.length; i++) codes[alphabet.charCodeAt(i)] = i diff --git a/.repos/effect/packages/effect/src/encoding/Xml.ts b/.repos/effect/packages/effect/src/encoding/Xml.ts index 08e9144fd5f43..e2a6e62abab9d 100644 --- a/.repos/effect/packages/effect/src/encoding/Xml.ts +++ b/.repos/effect/packages/effect/src/encoding/Xml.ts @@ -277,12 +277,28 @@ export type Event = * Adjacent text is merged into one string; comments and processing * instructions are dropped. * + * When the events were decoded with `namespaces: "strict"`, `namespace` and + * `localName` give the element's resolved name. Otherwise they are absent. + * * @stability experimental * @category models * @since 4.0.6 */ export interface Element { readonly name: string + /** + * Namespace name of the element, or `""` for none, with + * `namespaces: "strict"`. + * + * @since 4.1.5 + */ + readonly namespace?: string | undefined + /** + * Local part of the element name, with `namespaces: "strict"`. + * + * @since 4.1.5 + */ + readonly localName?: string | undefined readonly attributes: Readonly> readonly children: ReadonlyArray } @@ -342,8 +358,8 @@ export interface DecodeOptions { * * `maxElementSize` is the maximum size of one collected element, counted as * the UTF-16 code units of its names, attribute names and values, and text. - * Defaults to 16 MiB; `Infinity` disables the limit. Invalid options throw when - * the channel is created. + * `namespace` and `localName` are not counted. Defaults to 16 MiB; `Infinity` + * disables the limit. Invalid options throw when the channel is created. * * @stability experimental * @category configuration @@ -474,17 +490,21 @@ export const decode = (options?: DecodeOptions): Cha * * **Details** * - * `path` lists element names from the root, and `"*"` matches any name. Each - * element whose ancestors and own name match the path is emitted once its end - * tag arrives, with all of its descendants; everything outside the matched - * elements is skipped. Because paths start at the root, an element nested in a - * matched element is part of its tree and is not emitted separately. + * `path` lists element names from the root, and `"*"` matches any name. A name + * in Clark notation, `{uri}local`, matches an element with that namespace and + * local name, `{*}local` matches the local name in any namespace or none, and + * `{}local` matches it in no namespace. Each element whose ancestors and own + * name match the path is emitted once its end tag arrives, with all of its + * descendants; everything outside the matched elements is skipped. Because + * paths start at the root, an element nested in a matched element is part of + * its tree and is not emitted separately. * * **Gotchas** * * - A path that does not start at the root element matches nothing. - * - Paths and `Element` names are names as written, including prefixes, even - * with `namespaces: "strict"`, which only adds namespaces to events. + * - Except in Clark notation, names in a path are matched as written, + * including prefixes, even with `namespaces: "strict"`. `Element` names are + * always as written. * - Whitespace between child elements, such as indentation, is kept as string * children. * - A collected element larger than `maxElementSize` fails with a `Limit` @@ -493,6 +513,11 @@ export const decode = (options?: DecodeOptions): Cha * limit for untrusted input. * - Events that end inside an element, or end an element that was never * started, fail with an `InvalidEvent` `XmlError`. + * - A path with a name in Clark notation needs events decoded with + * `namespaces: "strict"`. Any start tag without `localName` fails with an + * `InvalidEvent` `XmlError`, even outside a matched subtree. + * - Clark notation requires an unprefixed local name. A wildcard in that + * position, such as `{uri}*`, is not supported. * - A path that is empty or contains an invalid name throws when the channel is * created. * @@ -539,13 +564,8 @@ export const elements = ( if (path.length === 0) { throw new Error("Xml: elements path must not be empty") } - for (const name of path) { - if (name !== "*" && !isName(name)) { - throw new Error(`Xml: invalid element name in path: ${JSON.stringify(name)}`) - } - } + const segments = Array.from(path, parseSegment) const maxElementSize = checkLimit("maxElementSize", options?.maxElementSize, defaultMaxElementSize) - const segments = Array.from(path) return makeChannel(() => new Collector(segments, maxElementSize)) } @@ -645,6 +665,10 @@ export const encode = (): Channel.Channel< * empty one. Names and characters are not checked; `encode` and * `encodeString` check them. * + * An element with a `localName`, such as one collected from events decoded + * with `namespaces: "strict"`, keeps its `namespace` and `localName` on its + * start and end events, so paths in Clark notation still match them. + * * **Gotchas** * * A collected subtree does not carry `xmlns` declarations inherited from its @@ -678,12 +702,12 @@ export const encode = (): Channel.Channel< * @since 4.1.5 */ export const toEvents = (element: Element): Arr.NonEmptyReadonlyArray => { - const out: Arr.NonEmptyArray = [{ _tag: "StartElement", name: element.name, attributes: element.attributes }] + const out: Arr.NonEmptyArray = [startEvent(element)] const stack = [{ element, index: 0 }] while (stack.length > 0) { const frame = stack[stack.length - 1] if (frame.index === frame.element.children.length) { - out.push({ _tag: "EndElement", name: frame.element.name }) + out.push(endEvent(frame.element)) stack.pop() continue } @@ -691,13 +715,32 @@ export const toEvents = (element: Element): Arr.NonEmptyReadonlyArray => if (typeof child === "string") { out.push({ _tag: "Text", text: child }) } else { - out.push({ _tag: "StartElement", name: child.name, attributes: child.attributes }) + out.push(startEvent(child)) stack.push({ element: child, index: 0 }) } } return out } +interface ResolvedName { + namespace?: string | undefined + localName?: string | undefined +} + +const withResolvedName = (to: A, from: Readonly): A => { + if (from.localName !== undefined) { + to.namespace = from.namespace + to.localName = from.localName + } + return to +} + +const startEvent = (element: Element): StartElement => + withResolvedName({ _tag: "StartElement", name: element.name, attributes: element.attributes }, element) + +const endEvent = (element: Element): EndElement => + withResolvedName({ _tag: "EndElement", name: element.name }, element) + const defaultMaxTokenSize = 10 * 1024 * 1024 const defaultMaxDepth = 1024 const defaultMaxElementSize = 16 * 1024 * 1024 @@ -2110,12 +2153,30 @@ class Utf8Input implements Machine { } } -interface MutableElement { - readonly name: string - readonly attributes: Readonly> +interface MutableElement extends Element { readonly children: Array } +// `string` is "*" or a literal name; `namespace: undefined` matches any namespace +type Segment = string | { readonly namespace: string | undefined; readonly localName: string } + +const parseSegment = (segment: string): Segment => { + if (segment === "*" || isName(segment)) return segment + // The last "}" ends the namespace: a namespace can contain "}", a local name cannot + const close = segment.lastIndexOf("}") + const localName = segment.slice(close + 1) + if (segment.startsWith("{") && isName(localName) && !localName.includes(":")) { + const namespace = segment.slice(1, close) + return { namespace: namespace === "*" ? undefined : namespace, localName } + } + throw new Error(`Xml: invalid element name in path: ${JSON.stringify(segment)}`) +} + +const matches = (segment: Segment, event: StartElement): boolean => + typeof segment === "string" ? + segment === "*" || segment === event.name : + segment.localName === event.localName && (segment.namespace === undefined || segment.namespace === event.namespace) + class Collector implements Machine { out: Array = [] private depth = 0 @@ -2124,25 +2185,34 @@ class Collector implements Machine { // The element being collected and its open descendants private readonly stack: Array = [] private size = 0 - private readonly path: ReadonlyArray + private readonly path: ReadonlyArray private readonly maxElementSize: number + private readonly clark: boolean - constructor(path: ReadonlyArray, maxElementSize: number) { + constructor(path: ReadonlyArray, maxElementSize: number) { this.path = path this.maxElementSize = maxElementSize + this.clark = path.some((segment) => typeof segment !== "string") } push(event: Event): void { switch (event._tag) { case "StartElement": { + if (this.clark && event.localName === undefined) { + throw invalidEvent( + `start tag <${event.name}> without localName for a path in Clark notation: decode with namespaces: "strict"` + ) + } const depth = this.depth++ if (this.stack.length === 0) { - const segment = this.path[depth] - if (this.matched !== depth || (segment !== "*" && segment !== event.name)) return + if (this.matched !== depth || !matches(this.path[depth], event)) return if (++this.matched < this.path.length) return this.size = 0 } - const element: MutableElement = { name: event.name, attributes: event.attributes, children: [] } + const element = withResolvedName( + { name: event.name, attributes: event.attributes, children: [] }, + event + ) if (this.stack.length > 0) this.stack[this.stack.length - 1].children.push(element) this.stack.push(element) let size = event.name.length diff --git a/.repos/effect/packages/effect/src/http-api/HttpApi.ts b/.repos/effect/packages/effect/src/http-api/HttpApi.ts index 0d047fe3c617d..1156fdf27f199 100644 --- a/.repos/effect/packages/effect/src/http-api/HttpApi.ts +++ b/.repos/effect/packages/effect/src/http-api/HttpApi.ts @@ -11,6 +11,7 @@ */ import type { NonEmptyReadonlyArray } from "../Array.ts" import * as Context from "../Context.ts" +import * as HttpMethod from "../http/HttpMethod.ts" import type { PathInput } from "../http/HttpRouter.ts" import * as InternalRecord from "../internal/record.ts" import { type Pipeable, pipeArguments } from "../Pipeable.ts" @@ -23,6 +24,7 @@ import * as HttpApiEndpoint from "./HttpApiEndpoint.ts" import type * as HttpApiGroup from "./HttpApiGroup.ts" import type * as HttpApiMiddleware from "./HttpApiMiddleware.ts" import * as HttpApiSchema from "./HttpApiSchema.ts" +import { getRedactedKeys } from "./internal/redactedKeys.ts" const TypeId = "~effect/http-api/HttpApi" @@ -512,8 +514,8 @@ export class ErrorParseOptions extends Context.Service< * the names on the group to keep both. * - Only URL and header attributes use these names. `user_agent.original` and * the messages of span errors are recorded as is. - * - `params` apply to server spans and `HttpMiddleware.logger` entries. - * Client spans record the path as sent. + * - `params` apply to client spans and error messages as well as server spans + * and `HttpMiddleware.logger` entries. * - `HttpApiBuilder.endpoint` returns a handler without a route, so set * `redactedParams` on the route it is mounted with. * @@ -590,26 +592,45 @@ export const getEndpointRedactedNames = ( ): EndpointRedactedNames | undefined => { const query: Array = [] const headers: Array = [] + const addQuery = (name: string | RegExp) => { + query.push(name) + if (typeof name === "string") query.push(new RegExp(`^${RegExp_.escape(name)}\\[`, "i")) + } for (const annotations of [api.annotations, group.annotations, endpoint.annotations]) { const options = Context.getOrUndefined(annotations, RedactedNames) if (options === undefined) continue - for (const name of options.query ?? []) { - query.push(name) - if (typeof name === "string") query.push(new RegExp(`^${RegExp_.escape(name)}\\[`, "i")) - } + options.query?.forEach(addQuery) if (options.headers !== undefined) headers.push(...options.headers) } + // Fields whose schema holds a `Redacted` are redacted without being listed. + // Payloads of methods without a body are sent as query parameters. + const querySchemas = HttpMethod.hasBody(endpoint.method) + ? [endpoint.query] + : [endpoint.query, ...HttpApiEndpoint.getPayloadSchemas(endpoint)] + for (const schema of querySchemas) (getRedactedKeys(schema) ?? redactAll).forEach(addQuery) + headers.push(...(getRedactedKeys(endpoint.headers) ?? redactAll)) return query.length === 0 && headers.length === 0 ? undefined : { query, headers } } /** + * Returns the path param names to redact and whether to redact every param in + * the endpoint path (when the schema holds a `Redacted` under unknown wire names). + * * @internal */ export const getEndpointRedactedParams = ( api: Pick, group: HttpApiGroup.Top, endpoint: HttpApiEndpoint.Top -): ReadonlyArray => - [api.annotations, group.annotations, endpoint.annotations].flatMap((annotations) => +): { readonly names: ReadonlyArray; readonly all: boolean } => { + const explicit = [api.annotations, group.annotations, endpoint.annotations].flatMap((annotations) => Context.getOrUndefined(annotations, RedactedNames)?.params ?? [] ) + const keys = getRedactedKeys(endpoint.params) + return keys === undefined + ? { names: explicit, all: true } + : { names: [...explicit, ...keys], all: false } +} + +// Matches every name, for a schema whose wire names are unknown. +const redactAll: ReadonlyArray = [/^/] diff --git a/.repos/effect/packages/effect/src/http-api/HttpApiBuilder.ts b/.repos/effect/packages/effect/src/http-api/HttpApiBuilder.ts index d1283290aca08..08189325a1e98 100644 --- a/.repos/effect/packages/effect/src/http-api/HttpApiBuilder.ts +++ b/.repos/effect/packages/effect/src/http-api/HttpApiBuilder.ts @@ -32,6 +32,7 @@ import * as Respondable from "../http/HttpServerRespondable.ts" import * as Response from "../http/HttpServerResponse.ts" import type { HttpServerResponse } from "../http/HttpServerResponse.ts" import * as MediaType from "../http/internal/mediaType.ts" +import * as RedactedPath from "../http/internal/redactedPath.ts" import { addRedactedNamesUnsafe } from "../http/internal/requestState.ts" import * as Multipart from "../http/Multipart.ts" import * as UrlParams from "../http/UrlParams.ts" @@ -1077,13 +1078,17 @@ export function handlerToRoute( context: Context.Context ): HttpRouter.Route { const endpoint = handler.endpoint + const path = HttpApiPath.toRouterPath(endpoint.path, endpoint.params) + const redactedParams = HttpApi.getEndpointRedactedParams(api, group, endpoint) return HttpRouter.route( endpoint.method, - HttpApiPath.toRouterPath(endpoint.path, endpoint.params) as HttpRouter.PathInput, + path as HttpRouter.PathInput, handlerToHttpEffect(api, group, endpoint, context, handler.handler, handler.isRaw), { uninterruptible: handler.uninterruptible, - redactedParams: HttpApi.getEndpointRedactedParams(api, group, endpoint) + redactedParams: redactedParams.all + ? [...redactedParams.names, ...RedactedPath.allParamNames(path)] + : redactedParams.names } ) } diff --git a/.repos/effect/packages/effect/src/http-api/HttpApiClient.ts b/.repos/effect/packages/effect/src/http-api/HttpApiClient.ts index 95d7c7eec3290..526611131aa14 100644 --- a/.repos/effect/packages/effect/src/http-api/HttpApiClient.ts +++ b/.repos/effect/packages/effect/src/http-api/HttpApiClient.ts @@ -26,6 +26,7 @@ import * as HttpClientError from "../http/HttpClientError.ts" import * as HttpClientRequest from "../http/HttpClientRequest.ts" import type * as HttpClientResponse from "../http/HttpClientResponse.ts" import * as HttpMethod from "../http/HttpMethod.ts" +import { type ClientPath, CurrentClientPath } from "../http/internal/clientPath.ts" import * as MediaType from "../http/internal/mediaType.ts" import * as internalUrlParams from "../http/internal/urlParams.ts" import * as UrlParams from "../http/UrlParams.ts" @@ -421,11 +422,16 @@ export const makeClient = + baseUrl === undefined + ? path + : internalUrlParams.toPath(HttpClientRequest.prependUrl(HttpClientRequest.get(path), baseUrl).url) const httpClient = options.httpClient.pipe( - options?.baseUrl === undefined + baseUrl === undefined ? identity : HttpClient.mapRequest( - HttpClientRequest.prependUrl(options.baseUrl.toString()) + HttpClientRequest.prependUrl(baseUrl) ) ) @@ -508,6 +514,10 @@ export const makeClient = `${tag.key}/Client`) const redactedNames = HttpApi.getEndpointRedactedNames(api, group, endpoint) + const redactedParams = HttpApi.getEndpointRedactedParams(api, group, endpoint) + // Names declared on the API or group may belong to other endpoints. + const redactsPath = redactedParams.all || + redactedParams.names.some((name) => endpoint.path.includes(`:${name}`)) const endpointFn = Effect.fnUntraced(function*( request: { @@ -520,12 +530,20 @@ export const makeClient = - httpRequest = HttpClientRequest.setUrl(httpRequest, makeUrl(params)) + const sent = makeUrl(params) + httpRequest = HttpClientRequest.setUrl(httpRequest, sent) + if (redactsPath) { + redactedPath = { + sent: fullPath(sent), + redacted: fullPath(makeUrl(params, redactedParams.all ? "*" : redactedParams.names)) + } + } } // payload @@ -583,7 +601,10 @@ export const makeClient = (api: Api, options?: { const compilePath = (path: string, schema: Schema.Top | undefined) => { if (schema === undefined || !path.includes(":")) { - return (_: any) => path + return (_: any, _redacted?: ReadonlyArray | "*") => path } const paramNames = HttpApiPath.getParamNames(schema) - return (params: Record) => + return (params: Record, redacted?: ReadonlyArray | "*") => HttpApiPath.replaceParams(path, paramNames, (key, optional) => { const value = params[key] if (value === "." || value === "..") { // dot segments survive encoding and would be resolved by URL normalization throw new Error(`Invalid path parameter: ${key}`) } - if (value !== undefined) return encodeURIComponent(value) + if (value !== undefined) { + return redacted === "*" || redacted?.includes(key) ? "REDACTED" : encodeURIComponent(value) + } if (optional) return undefined throw new Error(`Missing path parameter: ${key}`) }) diff --git a/.repos/effect/packages/effect/src/http-api/internal/redactedKeys.ts b/.repos/effect/packages/effect/src/http-api/internal/redactedKeys.ts new file mode 100644 index 0000000000000..14d3a80495e62 --- /dev/null +++ b/.repos/effect/packages/effect/src/http-api/internal/redactedKeys.ts @@ -0,0 +1,40 @@ +import type * as Schema from "../../Schema.ts" +import * as SchemaAST from "../../SchemaAST.ts" + +/** + * Returns the wire keys of a params, query or headers schema whose values hold + * a `Redacted`, or `undefined` when a `Redacted` is present but the wire keys + * are unknown, so the caller redacts everything. + * + * Keys are only known for a struct whose keys are encoded as is. + * + * @internal + */ +export const getRedactedKeys = (schema: Schema.Top | undefined): ReadonlyArray | undefined => { + if (schema === undefined) return [] + const ast = schema.ast + if (!SchemaAST.isObjects(ast) || ast.encoding !== undefined) return hasRedacted(ast, new Set()) ? undefined : [] + if (ast.indexSignatures.some((is) => hasRedacted(is.type, new Set()))) return undefined + return ast.propertySignatures.filter((ps) => hasRedacted(ps.type, new Set())).map((ps) => String(ps.name)) +} + +const hasRedacted = (ast: SchemaAST.AST, seen: Set): boolean => { + const go = (ast: SchemaAST.AST) => hasRedacted(ast, seen) + switch (ast._tag) { + case "Declaration": + return (ast.annotations as Schema.Annotations.Declaration | undefined)?.representation + ?.id === "effect/schema/Redacted" || ast.typeParameters.some(go) + case "Objects": + return ast.propertySignatures.some((ps) => go(ps.type)) || ast.indexSignatures.some((is) => go(is.type)) + case "Union": + return ast.types.some(go) + case "Arrays": + return ast.elements.some(go) || ast.rest.some(go) + case "Suspend": + if (seen.has(ast)) return false + seen.add(ast) + return go(ast.thunk()) + default: + return false + } +} diff --git a/.repos/effect/packages/effect/src/http/FetchHttpClient.ts b/.repos/effect/packages/effect/src/http/FetchHttpClient.ts index eb201d3c40dd3..540c32bc56e91 100644 --- a/.repos/effect/packages/effect/src/http/FetchHttpClient.ts +++ b/.repos/effect/packages/effect/src/http/FetchHttpClient.ts @@ -26,7 +26,8 @@ import * as HttpClientResponse from "./HttpClientResponse.ts" * * **Details** * - * Defaults to `globalThis.fetch`. + * Defaults to `globalThis.fetch`. When not explicitly provided in context, + * `FetchHttpClient` uses the current `globalThis.fetch` on each request. * * @stability unstable * @category services @@ -116,7 +117,7 @@ const fetch: HttpClient.HttpClient = HttpClient.make((request, url, signal, fibe }) ) } - const fetch = fiber.getRef(Fetch) + const fetch = Context.getOrUndefined(fiber.context, Fetch) const options: globalThis.RequestInit = Context.getOrUndefined(fiber.context, RequestInit) ?? {} let headers = options.headers ? Headers.merge(Headers.fromInput(options.headers as Headers.Input), request.headers) @@ -129,15 +130,17 @@ const fetch: HttpClient.HttpClient = HttpClient.make((request, url, signal, fibe const send = (body: BodyInit | undefined) => Effect.map( Effect.tryPromise({ - try: () => - fetch(url, { + try: () => { + const init: any = { ...options, method: request.method, headers, body, duplex: typeof ReadableStream !== "undefined" && body instanceof ReadableStream ? "half" : undefined, signal: uploadController ? AbortSignal.any([signal, uploadController.signal]) : signal - } as any), + } + return fetch ? fetch(url, init) : globalThis.fetch(url, init) + }, catch: (cause) => new HttpClientError.HttpClientError({ reason: new HttpClientError.TransportError({ diff --git a/.repos/effect/packages/effect/src/http/Headers.ts b/.repos/effect/packages/effect/src/http/Headers.ts index cab1aa4ed2b29..fc04540af1864 100644 --- a/.repos/effect/packages/effect/src/http/Headers.ts +++ b/.repos/effect/packages/effect/src/http/Headers.ts @@ -7,9 +7,10 @@ * when values are inspected. * * It also parses and formats the values of standard headers, such as HTTP - * dates and `Retry-After`, with the tolerance the RFCs allow and nothing more. - * The string codecs for those values live in `Schema`, for example - * `Schema.DateTimeUtcFromHttpDate` and `Schema.RetryAfterFromString`. + * dates, `Retry-After` and `Link`, with the tolerance the RFCs allow and + * nothing more. The string codecs for those values live in `Schema`, for + * example `Schema.DateTimeUtcFromHttpDate`, `Schema.RetryAfterFromString` and + * `Schema.LinkHeaderFromString`. * * @stability unstable * @since 4.0.0 @@ -29,7 +30,9 @@ import * as Record from "../Record.ts" import * as Redactable from "../Redactable.ts" import * as Redacted from "../Redacted.ts" import * as Result from "../Result.ts" +import * as Str from "../String.ts" import type { Mutable } from "../Types.ts" +import { decodeExtValue } from "./MultipartParser/internal/contentType.ts" /** * Runtime type identifier for `Headers` values. @@ -258,6 +261,45 @@ export const set: { return out }) +/** + * Returns a new `Headers` collection with the value added to the given header. + * + * **When to use** + * + * Use when several parts of an application each add to a list-valued header, + * such as `Link`, `Vary` or `Cache-Control`, without replacing values set + * elsewhere. + * + * **Details** + * + * The header name is normalized to lowercase. An existing value is joined with + * the new one by `", "`, and an empty value leaves the headers unchanged. + * + * **Gotchas** + * + * Do not append `Set-Cookie` this way: a comma-joined `Set-Cookie` value is + * not valid. Use the cookie APIs instead. + * + * @see {@link set} to replace a header value + * + * @stability unstable + * @category combinators + * @since 4.1.6 + */ +export const append: { + (key: string, value: string): (self: Headers) => Headers + (self: Headers, key: string, value: string): Headers +} = dual< + (key: string, value: string) => (self: Headers) => Headers, + (self: Headers, key: string, value: string) => Headers +>(3, (self, key, value) => { + if (value === "") return self + const name = key.toLowerCase() + const out = make(self) + out[name] = name in out ? `${out[name]}, ${value}` : value + return out +}) + /** * Returns a new `Headers` collection with all provided headers set. * @@ -785,3 +827,217 @@ export const RetryAfterEquivalence: Equ.Equivalence = (self, that) = self._tag === "Duration" ? that._tag === "Duration" && Duration.Equivalence(self.duration, that.duration) : that._tag === "DateTime" && DateTime.Equivalence(self.dateTime, that.dateTime) + +// ----------------------------------------------------------------------------- +// Link (RFC 8288) +// ----------------------------------------------------------------------------- + +/** + * A single link from a `Link` header. + * + * **Details** + * + * - `target` is the URI reference between `<` and `>`. + * - `rel` holds the relation types; it is empty when the link has no `rel` + * parameter. + * - `params` holds every other parameter by name, such as `anchor`, `title`, + * `type` or `hreflang`. A parameter without a value, such as `nopush`, maps + * to `""`. + * + * @see {@link parseLink} for how parsed links are normalized + * + * @stability unstable + * @category models + * @since 4.1.6 + */ +export interface Link { + readonly target: string + readonly rel: ReadonlyArray + readonly params: { readonly [name: string]: string } +} + +const isLinkWhitespace = (char: string | undefined): boolean => char === " " || char === "\t" + +/** + * Parses a `Link` header value into its links. + * + * **Details** + * + * Parsing follows the forgiving algorithm of RFC 8288 Appendix B and never + * fails, so it returns an array rather than a `Result`. When it reaches input + * that is not a link-value, it stops and returns the links read so far. + * + * - Parameter names and relation types are lowercased. + * - For every parameter, including `rel` and extended parameters such as + * `title*`, the first occurrence wins. + * - An extended parameter such as `title*` is decoded as RFC 8187 and stored + * under `title`, replacing the plain form. An undecodable value is ignored, + * leaving the plain form. `rel*` never sets the relation types. + * + * **Gotchas** + * + * Targets are returned as written, and `anchor` is kept as an ordinary + * parameter. `HttpClientResponse.links` resolves targets against the response + * URL and skips links that have an `anchor` parameter. + * + * **Example** (Reading a pagination link) + * + * ```ts import.meta.vitest + * import { Headers } from "effect/http" + * + * const links = Headers.parseLink('; rel="next last", ; rel="prev"') + * links.find((link) => link.rel.includes("next"))?.target // => "/items?page=2" + * ``` + * + * @see {@link formatLink} for the inverse operation + * + * @stability unstable + * @category header values + * @since 4.1.6 + */ +export const parseLink = (input: string): Array => { + const links: Array = [] + const length = input.length + let i = 0 + const skipWhitespace = () => { + while (isLinkWhitespace(input[i])) i++ + } + while (true) { + while (isLinkWhitespace(input[i]) || input[i] === ",") i++ + if (input[i] !== "<") break + const end = input.indexOf(">", i + 1) + if (end === -1) break + const target = input.slice(i + 1, end) + i = end + 1 + + const plain = new Map() + const extended = new Map() + while (true) { + skipWhitespace() + if (input[i] !== ";") break + i++ + skipWhitespace() + const nameStart = i + while (i < length && input[i] !== "=" && input[i] !== ";" && input[i] !== "," && !isLinkWhitespace(input[i])) i++ + const name = input.slice(nameStart, i).toLowerCase() + skipWhitespace() + let paramValue = "" + if (input[i] === "=") { + i++ + skipWhitespace() + if (input[i] === "\"") { + i++ + while (i < length && input[i] !== "\"") { + if (input[i] === "\\") i++ + paramValue += input.charAt(i) + i++ + } + i++ + } else { + const valueStart = i + while (i < length && input[i] !== ";" && input[i] !== ",") i++ + paramValue = input.slice(valueStart, i).trim() + } + } + if (name.length > 1 && name.endsWith("*")) { + const baseName = name.slice(0, -1) + if (!extended.has(baseName)) extended.set(baseName, decodeExtValue(paramValue)) + } else if (name !== "" && !plain.has(name)) { + plain.set(name, paramValue) + } + } + + // Read rel before merging extended params so rel* cannot set rel, then delete it so rel* stays out of params. + const rel = plain.get("rel") + for (const [name, decoded] of extended) { + if (decoded !== undefined) plain.set(name, decoded) + } + plain.delete("rel") + links.push({ + target, + rel: rel?.toLowerCase().split(/[ \t]+/).filter(Str.isNonEmpty) ?? [], + params: Object.fromEntries(plain) + }) + } + return links +} + +const quotableParamValue = /^[\t\x20-\x7e]*$/ + +// Percent-encode chars outside visible ASCII plus `"` and `\` so a relation type cannot break the quoted rel. +const formatRelationType = (type: string): string => + Str.toWellFormed(type).replace(/[^\x21\x23-\x5b\x5d-\x7e]/gu, encodeURIComponent) + +const formatLinkParam = (name: string, value: string): string => { + if (value === "") return name + if (quotableParamValue.test(value)) return `${name}="${value.replace(/["\\]/g, "\\$&")}"` + const encoded = encodeURIComponent(Str.toWellFormed(value)).replace( + /['()*]/g, + (char) => `%${char.charCodeAt(0).toString(16).toUpperCase()}` + ) + return `${name}*=UTF-8''${encoded}` +} + +/** + * Formats links as a `Link` header value. + * + * **When to use** + * + * Use with `HttpServerResponse.appendHeader` or + * `HttpClientRequest.appendHeader` to add links without replacing a `Link` + * header set elsewhere. + * + * **Details** + * + * Each link is written as ``, then `rel` when it has relation types, + * then the other parameters, and links are joined with `", "`. + * + * - A parameter with the value `""` is written as a bare name. + * - A value made of tabs, spaces and visible ASCII is written as a + * quoted-string, escaping `"` and `\\`. + * - Any other value, such as non-ASCII text or line breaks, is written as an + * RFC 8187 extended parameter, for example `title*=UTF-8''Gr%C3%BC%C3%9Fe`. + * - A `rel` key in `params` is ignored; use the `rel` field. + * - In relation types, `"`, `\\`, whitespace, control characters and + * non-ASCII characters are percent-encoded, as in a URI. + * + * An empty iterable gives `""`. Parsing the result gives back the same links, + * provided their names and relation types are lowercase and need no encoding. + * + * **Gotchas** + * + * `target` and parameter names are written as given. They must not contain + * `>`, line breaks or other characters that are invalid in a header value. + * + * **Example** (Writing canonical and alternate links) + * + * ```ts import.meta.vitest + * import { Headers } from "effect/http" + * + * Headers.formatLink([ + * { target: "https://example.com/en", rel: ["canonical"] }, + * { target: "https://example.com/de", rel: ["alternate"], params: { hreflang: "de" } } + * ]) // => '; rel="canonical", ; rel="alternate"; hreflang="de"' + * ``` + * + * @see {@link parseLink} for the inverse operation + * + * @stability unstable + * @category header values + * @since 4.1.6 + */ +export const formatLink = ( + links: Iterable<{ + readonly target: string + readonly rel: ReadonlyArray + readonly params?: { readonly [name: string]: string } | undefined + }> +): string => + Array.from(links, (link) => { + let out = `<${link.target}>` + if (link.rel.length > 0) out += `; rel="${link.rel.map(formatRelationType).join(" ")}"` + for (const [name, value] of Object.entries(link.params ?? {})) { + if (name.toLowerCase() !== "rel") out += `; ${formatLinkParam(name, value)}` + } + return out + }).join(", ") diff --git a/.repos/effect/packages/effect/src/http/HttpClient.ts b/.repos/effect/packages/effect/src/http/HttpClient.ts index 662388fc0ef53..c229c5facc1ae 100644 --- a/.repos/effect/packages/effect/src/http/HttpClient.ts +++ b/.repos/effect/packages/effect/src/http/HttpClient.ts @@ -46,6 +46,7 @@ import * as HttpClientResponse from "./HttpClientResponse.ts" import * as HttpIncomingMessage from "./HttpIncomingMessage.ts" import * as HttpMethod from "./HttpMethod.ts" import * as TraceContext from "./HttpTraceContext.ts" +import { type ClientPath, CurrentClientPath } from "./internal/clientPath.ts" import * as tracing from "./internal/tracing.ts" import { getWebSource, WebSourceSymbol } from "./internal/webResponse.ts" import * as Url from "./Url.ts" @@ -702,9 +703,10 @@ export const make = ( const scope = fiber.getRef(RequestScope) const controller = new AbortController() const urlParamsRedactedNames = fiber.getRef(UrlParams.CurrentRedactedNames) + const redactedPath = fiber.getRef(CurrentClientPath) const urlResult = Url.make(request.url, request.urlParams, Option.getOrUndefined(request.hash)) if (Result.isFailure(urlResult)) { - return Effect.fail( + const cause = Cause.fail( new Error.HttpClientError({ reason: new Error.InvalidUrlError({ request, @@ -712,6 +714,8 @@ export const make = ( }) }) ) + Error.addFailureRedactedNames(cause, urlParamsRedactedNames, redactedPath) + return Effect.failCause(cause) } const url = urlResult.success const send = (request: HttpClientRequest.HttpClientRequest) => @@ -730,7 +734,13 @@ export const make = ( Effect.uninterruptibleMask((restore) => Effect.matchCauseEffect(restore(send(request)), { onSuccess: (response) => { - response = trackResponse(response, controller, scope !== undefined, urlParamsRedactedNames) + response = trackResponse( + response, + controller, + scope !== undefined, + urlParamsRedactedNames, + redactedPath + ) onResponse?.(response) return Effect.succeed(response) }, @@ -738,7 +748,7 @@ export const make = ( if (Cause.hasInterrupts(cause)) { controller.abort() } - Error.addFailureRedactedNames(cause, urlParamsRedactedNames) + Error.addFailureRedactedNames(cause, urlParamsRedactedNames, redactedPath) return Effect.failCause(cause) } }) @@ -758,7 +768,8 @@ export const make = ( tracing.addUrlAttributes( span, url, - tracing.redactedNames(request.urlParams, urlParamsRedactedNames) + tracing.redactedNames(request.urlParams, urlParamsRedactedNames), + redactedPath ) const headerFilter = fiber.getRef(TracerHeaderFilter) tracing.addHeaderAttributes(span, "request", request.headers, headerFilter, redactedHeaderNames) @@ -2305,15 +2316,16 @@ const trackResponse = ( response: HttpClientResponse.HttpClientResponse, controller: AbortController, scoped: boolean, - urlParamsRedactedNames: ReadonlyArray + urlParamsRedactedNames: ReadonlyArray, + redactedPath: ClientPath | undefined ): HttpClientResponse.HttpClientResponse => { // Body readers create errors with the runner's response, while callers hold // the wrapper, so both carry the names of the executing fiber. - Error.addResponseRedactedNames(response, urlParamsRedactedNames) + Error.addResponseRedactedNames(response, urlParamsRedactedNames, redactedPath) if (!scoped) { responseRegistry.register(response, controller) response = new InterruptibleResponse(response, controller) - Error.addResponseRedactedNames(response, urlParamsRedactedNames) + Error.addResponseRedactedNames(response, urlParamsRedactedNames, redactedPath) } responseControllers.set(response, controller) return response diff --git a/.repos/effect/packages/effect/src/http/HttpClientError.ts b/.repos/effect/packages/effect/src/http/HttpClientError.ts index 4902762eae6e8..0c6d9171d83a1 100644 --- a/.repos/effect/packages/effect/src/http/HttpClientError.ts +++ b/.repos/effect/packages/effect/src/http/HttpClientError.ts @@ -16,6 +16,7 @@ import { hasProperty } from "../Predicate.ts" import * as Schema from "../Schema.ts" import type * as HttpClientRequest from "./HttpClientRequest.ts" import type * as ClientResponse from "./HttpClientResponse.ts" +import { type ClientPath, currentClientPath, redactClientPath } from "./internal/clientPath.ts" import * as UrlParams from "./UrlParams.ts" const TypeId = "~effect/http/HttpClientError" @@ -83,6 +84,13 @@ export class HttpClientError extends Data.TaggedError("HttpClientError")<{ override get message(): string { return this.reason.message } + + override toJSON(): unknown { + const json = super.toJSON() as Record + // A copy of the reason's cause, which `InvalidUrlError` keeps out of its JSON. + if (this.reason._tag === "InvalidUrlError") delete json.cause + return json + } } const formatReason = (tag: string) => tag.endsWith("Error") ? tag.slice(0, -5) : tag @@ -112,17 +120,30 @@ type RedactedNames = ReadonlyArray // redacted: the current fiber may be unrelated to the request when a transport // callback creates the error, so its names add redaction and never decide it. const responseRedactedNames = new WeakMap() +const responseRedactedPaths = new WeakMap>() const redactedUrls = new WeakMap() -const addRedactedNames = (reason: object, names: RedactedNames | undefined): void => { - const url = redactedUrls.get(reason) - if (url !== undefined && names !== undefined) redactedUrls.set(reason, UrlParams.redactUrl(url, names)) +const addRedactedNames = ( + reason: object, + names: RedactedNames | undefined, + paths: ReadonlyArray | undefined +): void => { + let url = redactedUrls.get(reason) + if (url === undefined) return + if (names !== undefined) url = UrlParams.redactUrl(url, names) + for (const path of paths ?? []) url = redactClientPath(url, path) + redactedUrls.set(reason, url) } /** @internal */ -export const addResponseRedactedNames = (response: ClientResponse.HttpClientResponse, names: RedactedNames): void => { +export const addResponseRedactedNames = ( + response: ClientResponse.HttpClientResponse, + names: RedactedNames, + path: ClientPath | undefined +): void => { const existing = responseRedactedNames.get(response) responseRedactedNames.set(response, existing === undefined ? names : [...existing, ...names]) + if (path !== undefined) responseRedactedPaths.set(response, [...(responseRedactedPaths.get(response) ?? []), path]) } /** @@ -131,9 +152,15 @@ export const addResponseRedactedNames = (response: ClientResponse.HttpClientResp * * @internal */ -export const addFailureRedactedNames = (cause: Cause.Cause, names: RedactedNames): void => { +export const addFailureRedactedNames = ( + cause: Cause.Cause, + names: RedactedNames, + path: ClientPath | undefined +): void => { for (const reason of cause.reasons) { - if (Cause.isFailReason(reason) && isHttpClientError(reason.error)) addRedactedNames(reason.error.reason, names) + if (Cause.isFailReason(reason) && isHttpClientError(reason.error)) { + addRedactedNames(reason.error.reason, names, path && [path]) + } } } @@ -141,8 +168,12 @@ const ReasonError = (tag: Tag): ReturnType { constructor(props: ReasonProps) { super(props) - redactedUrls.set(this, UrlParams.redactUrl(props.request.url)) - if (props.response !== undefined) addRedactedNames(this, responseRedactedNames.get(props.response)) + const url = UrlParams.redactUrl(props.request.url) + const path = currentClientPath() + redactedUrls.set(this, path === undefined ? url : redactClientPath(url, path)) + if (props.response !== undefined) { + addRedactedNames(this, responseRedactedNames.get(props.response), responseRedactedPaths.get(props.response)) + } } } return Base as any @@ -270,7 +301,9 @@ export class InvalidUrlError extends ReasonError("InvalidUrlError")<{ } override toJSON(): unknown { - return reasonToJSON(this, super.toJSON()) + // The cause holds the URL as sent, which may include a redacted path param. + const { cause: _, ...rest } = reasonToJSON(this, super.toJSON()) as Record + return rest } } diff --git a/.repos/effect/packages/effect/src/http/HttpClientRequest.ts b/.repos/effect/packages/effect/src/http/HttpClientRequest.ts index 01fb15fb6f67a..9dd512c646123 100644 --- a/.repos/effect/packages/effect/src/http/HttpClientRequest.ts +++ b/.repos/effect/packages/effect/src/http/HttpClientRequest.ts @@ -348,6 +348,29 @@ export const setHeader: { self.body )) +/** + * Adds a value to a request header, keeping any existing value. + * + * **Details** + * + * An existing value is joined with the new one by `", "`, and an empty value + * leaves the request unchanged. + * + * @see {@link setHeader} to replace a header value + * + * @stability unstable + * @category combinators + * @since 4.1.6 + */ +export const appendHeader: { + (key: string, value: string): (self: HttpClientRequest) => HttpClientRequest + (self: HttpClientRequest, key: string, value: string): HttpClientRequest +} = dual( + 3, + (self: HttpClientRequest, key: string, value: string): HttpClientRequest => + value === "" ? self : updateHeaders(self, Headers.append(key, value)) +) + /** * Sets multiple request headers from an input collection, replacing existing values with matching names. * diff --git a/.repos/effect/packages/effect/src/http/HttpClientResponse.ts b/.repos/effect/packages/effect/src/http/HttpClientResponse.ts index fc5951052703b..06eb226249aca 100644 --- a/.repos/effect/packages/effect/src/http/HttpClientResponse.ts +++ b/.repos/effect/packages/effect/src/http/HttpClientResponse.ts @@ -320,6 +320,92 @@ export const filterStatusOk = (self: HttpClientResponse): Effect.Effect => { + const header = self.headers.link + if (header === undefined) return [] + const base = self.url || undefined + const out: Array = [] + for (const link of Headers.parseLink(header)) { + if (Object.hasOwn(link.params, "anchor")) continue + const url = resolveUrl(link.target, base) + if (url !== undefined) out.push({ ...link, target: url.href }) + } + return out +} + +const resolveUrl = (target: string, base: string | undefined): URL | undefined => { + try { + return new URL(target, base) + } catch { + return undefined + } +} + +/** + * Returns the URL of the first link in the response's `Link` header with the + * given relation type. + * + * **When to use** + * + * Use to follow pagination links such as `next` with `Stream.paginate`. + * + * **Details** + * + * The relation type is compared case-insensitively, and the URL is resolved + * against the response URL. Returns `Option.none()` when no link matches. + * Links are read as by {@link links}, so links with an `anchor` parameter + * never match. + * + * **Example** (Reading the next page link) + * + * ```ts import.meta.vitest + * import { Option } from "effect" + * import { HttpClientRequest, HttpClientResponse } from "effect/http" + * + * const response = HttpClientResponse.fromWeb( + * HttpClientRequest.get("https://example.com/items"), + * new Response(null, { headers: { link: '; rel="next"' } }) + * ) + * + * Option.map(HttpClientResponse.link(response, "next"), (url) => url.href) // => Option.some("https://example.com/items?page=2") + * ``` + * + * @see {@link links} to read every link + * + * @stability unstable + * @category accessors + * @since 4.1.6 + */ +export const link: { + (rel: string): (self: HttpClientResponse) => Option.Option + (self: HttpClientResponse, rel: string): Option.Option +} = dual(2, (self: HttpClientResponse, rel: string): Option.Option => { + const type = rel.toLowerCase() + const found = links(self).find((link) => link.rel.includes(type)) + return found === undefined ? Option.none() : Option.some(new URL(found.target)) +}) + // ----------------------------------------------------------------------------- // internal // ----------------------------------------------------------------------------- diff --git a/.repos/effect/packages/effect/src/http/HttpMiddleware.ts b/.repos/effect/packages/effect/src/http/HttpMiddleware.ts index b29759a4014ba..35f63d01d8318 100644 --- a/.repos/effect/packages/effect/src/http/HttpMiddleware.ts +++ b/.repos/effect/packages/effect/src/http/HttpMiddleware.ts @@ -608,7 +608,7 @@ export const cors = (options?: { ? { "access-control-expose-headers": opts.exposedHeaders.join(",") } : undefined - const maxAge = opts.maxAge + const maxAge = opts.maxAge === 0 || opts.maxAge ? { "access-control-max-age": opts.maxAge.toString() } : undefined diff --git a/.repos/effect/packages/effect/src/http/HttpServerResponse.ts b/.repos/effect/packages/effect/src/http/HttpServerResponse.ts index 58d583815ba4a..6670b5000fe95 100644 --- a/.repos/effect/packages/effect/src/http/HttpServerResponse.ts +++ b/.repos/effect/packages/effect/src/http/HttpServerResponse.ts @@ -563,6 +563,56 @@ export const setHeader: { makeResponse(self, Headers.set(self.headers, key, value)) ) +/** + * Returns a response with the value added to the specified header, keeping any + * existing value. + * + * **When to use** + * + * Use when several parts of an application each add to a list-valued header, + * such as `Link` or `Vary`. + * + * **Details** + * + * An existing value is joined with the new one by `", "`, and an empty value + * leaves the response unchanged, so formatting an empty list of links is safe. + * + * **Gotchas** + * + * Do not append `Set-Cookie` this way; use the cookie APIs instead. + * + * **Example** (Adding canonical and alternate links) + * + * ```ts + * import { Headers, HttpServerResponse } from "effect/http" + * + * const withLinks = HttpServerResponse.appendHeader( + * "Link", + * Headers.formatLink([ + * { target: "https://example.com/en", rel: ["canonical"] }, + * { target: "https://example.com/de", rel: ["alternate"], params: { hreflang: "de" } } + * ]) + * ) + * ``` + * + * @see {@link setHeader} to replace a header value + * + * @stability unstable + * @category combinators + * @since 4.1.6 + */ +export const appendHeader: { + (key: string, value: string): (self: HttpServerResponse) => HttpServerResponse + (self: HttpServerResponse, key: string, value: string): HttpServerResponse +} = dual( + 3, + (self: HttpServerResponse, key: string, value: string): HttpServerResponse => { + const headers = Headers.append(self.headers, key, value) + // makeResponse mutates the headers map in place, so never pass self.headers + return headers === self.headers ? self : makeResponse(self, headers) + } +) + /** * Returns a response with the specified header removed. * diff --git a/.repos/effect/packages/effect/src/http/Multipart.ts b/.repos/effect/packages/effect/src/http/Multipart.ts index 333ea65f5f4f3..b7d1c0a63cb88 100644 --- a/.repos/effect/packages/effect/src/http/Multipart.ts +++ b/.repos/effect/packages/effect/src/http/Multipart.ts @@ -350,11 +350,6 @@ export const PersistedFileSchema: PersistedFileSchema = Schema.declare( id: "effect/http/PersistedFile", payload: null }, - toCode: () => ({ - runtime: "Multipart.PersistedFileSchema", - Type: "Multipart.PersistedFile", - importDeclarations: [`import * as Multipart from "effect/http/Multipart"`] - }), expected: "PersistedFile", toCodecJson: () => Schema.link()( diff --git a/.repos/effect/packages/effect/src/http/MultipartParser/internal/contentType.ts b/.repos/effect/packages/effect/src/http/MultipartParser/internal/contentType.ts index f3927dc607dcd..00a3cba9b682e 100644 --- a/.repos/effect/packages/effect/src/http/MultipartParser/internal/contentType.ts +++ b/.repos/effect/packages/effect/src/http/MultipartParser/internal/contentType.ts @@ -116,7 +116,7 @@ const pctEncodedRE = /%([0-9a-f]{2})/gi * ISO-8859-1 is decoded byte by byte because `TextDecoder` treats it as * windows-1252. */ -function decodeExtValue(value: string): string | undefined { +export function decodeExtValue(value: string): string | undefined { const match = extValueRE.exec(value) if (match === null) { return undefined diff --git a/.repos/effect/packages/effect/src/http/internal/clientPath.ts b/.repos/effect/packages/effect/src/http/internal/clientPath.ts new file mode 100644 index 0000000000000..af893f141bd16 --- /dev/null +++ b/.repos/effect/packages/effect/src/http/internal/clientPath.ts @@ -0,0 +1,39 @@ +import * as Context from "../../Context.ts" +import * as Redactable from "../../Redactable.ts" +import { stripSearchAndHash } from "./urlParams.ts" + +/** + * The path of the request a client executes, as sent and as recorded in spans + * and errors. + * + * @internal + */ +export interface ClientPath { + readonly sent: string + readonly redacted: string +} + +/** @internal */ +export const CurrentClientPath = Context.Reference( + "effect/http/internal/clientPath/CurrentClientPath", + { defaultValue: () => undefined } +) + +/** @internal */ +export const currentClientPath = (): ClientPath | undefined => + Context.get((globalThis as any)[Redactable.currentFiberTypeId]?.context ?? Context.empty(), CurrentClientPath) + +/** + * Replaces the path of a URL with its redacted form. A pathname that does not + * match the expected sent pathname is replaced by `/REDACTED`. + * + * @internal + */ +export const redactClientPath = (url: string, path: ClientPath): string => { + const head = stripSearchAndHash(url) + const origin = /^[a-z][a-z\d+.-]*:\/\/[^/]*/i.exec(head)?.[0] ?? "" + const pathname = head.slice(origin.length) + if (pathname === path.redacted) return url + const tail = url.slice(head.length) + return origin + (pathname === path.sent ? path.redacted : "/REDACTED") + tail +} diff --git a/.repos/effect/packages/effect/src/http/internal/redactedPath.ts b/.repos/effect/packages/effect/src/http/internal/redactedPath.ts index 8719990a4ffaf..555afb4af8c42 100644 --- a/.repos/effect/packages/effect/src/http/internal/redactedPath.ts +++ b/.repos/effect/packages/effect/src/http/internal/redactedPath.ts @@ -60,6 +60,10 @@ export const compile = (path: string, redactedParams: ReadonlyArray): Te return ambiguous ? parts.map((part) => typeof part === "string" ? part : { name: part.name, redacted: true }) : parts } +/** @internal */ +export const allParamNames = (path: string): ReadonlyArray => + compile(path, []).flatMap((part) => typeof part === "string" ? [] : [part.name]) + const countCaptures = (regex: string): number => { try { return new RegExp(regex + "|").exec("")!.length - 1 diff --git a/.repos/effect/packages/effect/src/http/internal/tracing.ts b/.repos/effect/packages/effect/src/http/internal/tracing.ts index 4803a8c2c443c..2fa1ba9df820b 100644 --- a/.repos/effect/packages/effect/src/http/internal/tracing.ts +++ b/.repos/effect/packages/effect/src/http/internal/tracing.ts @@ -1,6 +1,7 @@ import type * as Tracer from "../../Tracer.ts" import * as Headers from "../Headers.ts" import * as UrlParams from "../UrlParams.ts" +import { type ClientPath, redactClientPath } from "./clientPath.ts" const defaultPorts: Record = { "http:": 80, @@ -17,11 +18,13 @@ const defaultPorts: Record = { export const addUrlAttributes = ( span: Tracer.Span, url: URL, - redactedNames: ReadonlyArray + redactedNames: ReadonlyArray, + path?: ClientPath | undefined ): void => { + const redactPath = (url: string) => path === undefined ? url : redactClientPath(url, path) const query = UrlParams.redactUrl(url.search, redactedNames).slice(1) - span.attribute("url.full", UrlParams.redactUrl(url.href, redactedNames)) - span.attribute("url.path", url.pathname) + span.attribute("url.full", redactPath(UrlParams.redactUrl(url.href, redactedNames))) + span.attribute("url.path", redactPath(url.pathname)) if (query !== "") { span.attribute("url.query", query) } diff --git a/.repos/effect/packages/effect/src/internal/base64.ts b/.repos/effect/packages/effect/src/internal/base64.ts index 6998732a9fe65..12e031c98d0d1 100644 --- a/.repos/effect/packages/effect/src/internal/base64.ts +++ b/.repos/effect/packages/effect/src/internal/base64.ts @@ -4,7 +4,7 @@ export interface NativeDecodeOptions { } /** - * Decodes `str` with native `Uint8Array.fromBase64`. + * Decodes `str` with native `Uint8Array.fromBase64`, falling back to `Buffer`. * * Returns `undefined` when native decoding is unavailable or skipped for a * short input, and `null` when native decoding rejected the input. In both @@ -28,7 +28,17 @@ export const decodeNative = ( const NativeUint8Array = Uint8Array as { readonly fromBase64?: (string: string, options?: NativeDecodeOptions) => Uint8Array } - if (typeof NativeUint8Array.fromBase64 !== "function") return undefined + if (typeof NativeUint8Array.fromBase64 !== "function") { + const Buffer = getBuffer() + if (Buffer === undefined) return undefined + const encoding = options?.alphabet ?? "base64" + const bytes = new Uint8Array(decodedLength) + const buffer = Buffer.from(bytes.buffer) + // `Buffer` is permissive (skips invalid chars, mixes alphabets, truncates + // code units), so accept only input that round-trips identically. + const canonical = options !== undefined && str.endsWith("=") ? str.slice(0, str.indexOf("=")) : str + return buffer.write(str, encoding) === decodedLength && buffer.toString(encoding) === canonical ? bytes : null + } try { const bytes = NativeUint8Array.fromBase64(str, options) return bytes.length === decodedLength ? bytes : null @@ -37,6 +47,51 @@ export const decodeNative = ( } } +interface BufferLike { + write(string: string, encoding: string): number + toString(encoding: string): string +} + +interface BufferConstructorLike { + from(buffer: ArrayBufferLike, byteOffset?: number, length?: number): BufferLike +} + +const typedArrayPrototype = Object.getPrototypeOf(Uint8Array.prototype) +const typedArrayBuffer = Object.getOwnPropertyDescriptor(typedArrayPrototype, "buffer")!.get as ( + this: Uint8Array +) => ArrayBufferLike +const typedArrayByteOffset = Object.getOwnPropertyDescriptor(typedArrayPrototype, "byteOffset")!.get as ( + this: Uint8Array +) => number +const typedArrayByteLength = Object.getOwnPropertyDescriptor(typedArrayPrototype, "byteLength")!.get as ( + this: Uint8Array +) => number + +// Gate on `process.versions.node` to avoid slow browser/RN `Buffer` polyfills; +// read at call time without importing `node:buffer`. +const getBuffer = (): BufferConstructorLike | undefined => { + const global = globalThis as { + readonly Buffer?: BufferConstructorLike + readonly process?: { readonly versions?: { readonly node?: unknown } } + } + return typeof global.process?.versions?.node === "string" && typeof global.Buffer === "function" + ? global.Buffer + : undefined +} + +/** + * Encodes `bytes` with `Buffer` ("base64" padded, "base64url" unpadded), or returns `undefined` if unavailable. + * + * @internal + */ +export const encodeBuffer = (bytes: Uint8Array, encoding: "base64" | "base64url"): string | undefined => { + const Buffer = getBuffer() + if (Buffer === undefined) return undefined + const byteLength = typedArrayByteLength.call(bytes) + if (byteLength < 32) return undefined + return Buffer.from(typedArrayBuffer.call(bytes), typedArrayByteOffset.call(bytes), byteLength).toString(encoding) +} + /** @internal */ export const stripCrlf = (str: string): string => str.indexOf("\n") === -1 && str.indexOf("\r") === -1 ? str : str.replace(/[\n\r]/g, "") diff --git a/.repos/effect/packages/effect/src/internal/dateTime.ts b/.repos/effect/packages/effect/src/internal/dateTime.ts index b02f1190cf323..c3d807bdac615 100644 --- a/.repos/effect/packages/effect/src/internal/dateTime.ts +++ b/.repos/effect/packages/effect/src/internal/dateTime.ts @@ -334,14 +334,22 @@ export const makeZonedUnsafe = (input: DateTime.DateTime.Input, options?: { } /** @internal */ -export const makeZoned: ( +export const makeZoned = ( input: DateTime.DateTime.Input, options?: { readonly timeZone?: number | string | DateTime.TimeZone | undefined readonly adjustForTimeZone?: boolean | undefined readonly disambiguation?: DateTime.Disambiguation | undefined } -) => Option.Option = Option.liftThrowable(makeZonedUnsafe) +): Option.Option => { + // Do not pass `makeZonedUnsafe` to a top-level call such as `Option.liftThrowable`, + // or AOT compilers that prune per function treat `Intl` as reachable whenever this module loads. + try { + return Option.some(makeZonedUnsafe(input, options)) + } catch { + return Option.none() + } +} /** @internal */ export const make: (input: A) => Option.Option> = @@ -475,9 +483,14 @@ export const zoneMakeOffset = (offset: number): DateTime.TimeZone.Offset => { } /** @internal */ -export const zoneMakeNamed: (zoneId: string) => Option.Option = Option.liftThrowable( - zoneMakeNamedUnsafe -) +export const zoneMakeNamed = (zoneId: string): Option.Option => { + // Plain function for the same reason as `makeZoned`. + try { + return Option.some(zoneMakeNamedUnsafe(zoneId)) + } catch { + return Option.none() + } +} /** @internal */ export const zoneMakeNamedEffect = (zoneId: string): Effect.Effect => @@ -778,7 +791,7 @@ export const setParts: { } = dual( 2, (self: DateTime.DateTime, parts: Partial): DateTime.DateTime => - mutate(self, (date) => setPartsDate(date, parts)) + mutateWithOffset(self, (date) => setPartsDate(date, parts)) ) /** @internal */ @@ -937,6 +950,25 @@ export const mutate: { return makeZonedFromAdjusted(newAdjustedDate.getTime(), self.zone, options?.disambiguation ?? "compatible") }) +// Keep the input offset when valid for the updated wall-clock time so repeated hours stay in the same occurrence. +const mutateWithOffset = ( + self: DateTime.DateTime, + f: (date: Date) => void, + disambiguation: DateTime.Disambiguation = "compatible" +): DateTime.DateTime => { + if (self._tag === "Utc" || self.zone._tag === "Offset") { + return mutate(self, f, { disambiguation }) + } + const date = toDate(self) + const offset = date.getTime() - Math.trunc(self.epochMilliseconds) + f(date) + const adjustedMillis = date.getTime() + const result = makeZonedProto(adjustedMillis - offset, self.zone) + return zonedOffset(result) === offset + ? result + : makeZonedFromAdjusted(adjustedMillis, self.zone, disambiguation) +} + /** @internal */ export const mutateUtc: { (f: (date: Date) => void): (self: A) => A @@ -1089,24 +1121,11 @@ const mutateRounding = ( self: DateTime.DateTime, part: DateTime.DateTime.UnitSingular, f: (date: Date) => void, - disambiguation: DateTime.Disambiguation = "compatible" -): DateTime.DateTime => { - if ( - self._tag === "Utc" || self.zone._tag === "Offset" || - part === "day" || part === "week" || part === "month" || part === "year" - ) { - return mutate(self, f, { disambiguation }) - } - // keep the input's offset so rounding stays in the same occurrence of a repeated hour - const date = toDate(self) - const offset = date.getTime() - Math.trunc(self.epochMilliseconds) - f(date) - const adjustedMillis = date.getTime() - const result = makeZonedProto(adjustedMillis - offset, self.zone) - return zonedOffset(result) === offset - ? result - : makeZonedFromAdjusted(adjustedMillis, self.zone, disambiguation) -} + disambiguation?: DateTime.Disambiguation +): DateTime.DateTime => + part === "day" || part === "week" || part === "month" || part === "year" + ? mutate(self, f, { disambiguation }) + : mutateWithOffset(self, f, disambiguation) const startOfDate = (date: Date, part: DateTime.DateTime.UnitSingular, options?: { readonly weekStartsOn?: 0 | 1 | 2 | 3 | 4 | 5 | 6 | undefined diff --git a/.repos/effect/packages/effect/src/internal/effect.ts b/.repos/effect/packages/effect/src/internal/effect.ts index e339e03b221d4..a6de0b2577ee2 100644 --- a/.repos/effect/packages/effect/src/internal/effect.ts +++ b/.repos/effect/packages/effect/src/internal/effect.ts @@ -3319,108 +3319,29 @@ export const catchReason: { ) /** @internal */ -export const catchReasons: { - < - K extends Tags, - E, - Cases extends { - [RK in ReasonTags, K>>]+?: ( - reason: ExtractReason, K>, RK>, - error: NarrowReason, K>, RK> - ) => Effect.Effect - }, - A2 = unassigned, - E2 = never, - R2 = never - >( - errorTag: K, - cases: Cases, - orElse?: - | (( - reason: ExcludeReason, K>, Extract>, - error: OmitReason, K>, Extract> - ) => Effect.Effect) - | undefined - ): (self: Effect.Effect) => Effect.Effect< - | A - | Exclude - | { [RK in keyof Cases]: Cases[RK] extends (...args: Array) => Effect.Effect ? A : never }[ - keyof Cases - ], - | ExcludeTag - | E2 - | (A2 extends unassigned ? ExtractTag : never) - | { [RK in keyof Cases]: Cases[RK] extends (...args: Array) => Effect.Effect ? E : never }[ - keyof Cases - ], - | R - | R2 - | { [RK in keyof Cases]: Cases[RK] extends (...args: Array) => Effect.Effect ? R : never }[ - keyof Cases - ] - > - < - A, - E, - R, - K extends Tags, - Cases extends { - [RK in ReasonTags>]+?: ( - reason: ExtractReason, RK>, - error: NarrowReason, RK> - ) => Effect.Effect - }, - A2 = unassigned, - E2 = never, - R2 = never - >( - self: Effect.Effect, - errorTag: K, - cases: Cases, - orElse?: - | (( - reason: ExcludeReason, K>, Extract>, - error: OmitReason, K>, Extract> - ) => Effect.Effect) - | undefined - ): Effect.Effect< - | A - | Exclude - | { [RK in keyof Cases]: Cases[RK] extends (...args: Array) => Effect.Effect ? A : never }[ - keyof Cases - ], - | ExcludeTag - | E2 - | (A2 extends unassigned ? ExtractTag : never) - | { [RK in keyof Cases]: Cases[RK] extends (...args: Array) => Effect.Effect ? E : never }[ - keyof Cases - ], - | R - | R2 - | { [RK in keyof Cases]: Cases[RK] extends (...args: Array) => Effect.Effect ? R : never }[ - keyof Cases - ] - > -} = dual((args) => isEffect(args[0]), (self, errorTag, cases, orElse) => { - let keys: Array - return catchIf( - self, - ((e: any) => - isTagged(e, errorTag) && - hasProperty(e, "reason") && - hasProperty(e.reason, "_tag") && - isString(e.reason._tag) && - (orElse !== undefined || (keys ??= Object.keys(cases)).includes(e.reason._tag))) as any, - (e: any) => { - const reason = e.reason - keys ??= Object.keys(cases) - if (keys.includes(reason._tag)) { - return (cases as any)[reason._tag](reason, e) +export const catchReasons: typeof Effect.catchReasons = dual( + (args) => isEffect(args[0]), + (self, errorTag, cases, orElse) => { + let keys: Array + return catchIf( + self, + ((e: any) => + isTagged(e, errorTag) && + hasProperty(e, "reason") && + hasProperty(e.reason, "_tag") && + isString(e.reason._tag) && + (orElse !== undefined || (keys ??= Object.keys(cases)).includes(e.reason._tag))) as any, + (e: any) => { + const reason = e.reason + keys ??= Object.keys(cases) + if (keys.includes(reason._tag)) { + return (cases as any)[reason._tag](reason, e) + } + return orElse ? orElse(reason, e) : fail(e) } - return orElse ? orElse(reason, e) : fail(e) - } - ) -}) + ) + } +) /** @internal */ export const unwrapReason: { @@ -5645,7 +5566,15 @@ export const forkUnsafe = ( } else { // Preserve the fork context rather than the dispatcher's context. child._asyncContext = captureAsyncContext() - parentRuntime.currentDispatcher.scheduleTask(() => child.evaluate(effect as any), 0) + // Cancel the deferred start if an interrupt runs first. + let resumed = false + child.yieldWith(() => { + resumed = true + }) + parentRuntime.currentDispatcher.scheduleTask(() => { + if (resumed) return + child.evaluate(effect as any) + }, 0) } return child } diff --git a/.repos/effect/packages/effect/src/internal/equal.ts b/.repos/effect/packages/effect/src/internal/equal.ts index 87daa6a5d6af5..afa96d9e61f9b 100644 --- a/.repos/effect/packages/effect/src/internal/equal.ts +++ b/.repos/effect/packages/effect/src/internal/equal.ts @@ -3,10 +3,18 @@ // created, not what it is. const errorSiteKeys = ["line", "column", "sourceURL", "originalLine", "originalColumn"] +const ownKeys = (obj: object): Array => { + const names = Object.getOwnPropertyNames(obj) + const syms = Object.getOwnPropertySymbols(obj) + return syms.length > 0 ? [...names, ...syms] : names +} + /** @internal */ -export const getAllObjectKeys = (obj: object): Set => { - const keys = new Set(Reflect.ownKeys(obj)) - if (obj.constructor === Object) return keys +export const getAllObjectKeys = (obj: object): Array | Set => { + const own = ownKeys(obj) + const proto = Object.getPrototypeOf(obj) + if (proto === Object.prototype || proto === null) return own + const keys = new Set(own) if (obj instanceof Error) { keys.delete("stack") @@ -15,17 +23,12 @@ export const getAllObjectKeys = (obj: object): Set => { } } - const proto = Object.getPrototypeOf(obj) let current = proto - while (current !== null && current !== Object.prototype) { - const ownKeys = Reflect.ownKeys(current) - for (let i = 0; i < ownKeys.length; i++) { - keys.add(ownKeys[i]) - } + for (const key of ownKeys(current)) keys.add(key) current = Object.getPrototypeOf(current) } - if (keys.has("constructor") && typeof obj.constructor === "function" && proto === obj.constructor.prototype) { + if (typeof obj.constructor === "function" && proto === obj.constructor.prototype) { keys.delete("constructor") } @@ -36,20 +39,37 @@ export const getAllObjectKeys = (obj: object): Set => { export const byReferenceInstances = new WeakSet() /** @internal */ -export const viewBytes = (view: DataView): Uint8Array => new Uint8Array(view.buffer, view.byteOffset, view.byteLength) - -/** @internal */ -export const isArrayBufferLike = (u: unknown): u is ArrayBufferLike => - u instanceof ArrayBuffer || (typeof SharedArrayBuffer !== "undefined" && u instanceof SharedArrayBuffer) +export const objectKind = (u: object): number => + Array.isArray(u) ? + 5 : + ArrayBuffer.isView(u) ? + (u instanceof DataView ? 7 : 6) : + Object.getPrototypeOf(u) === Object.prototype ? + 0 : + u instanceof Date ? + 1 : + u instanceof RegExp ? + 2 : + u instanceof Map ? + 3 : + u instanceof Set ? + 4 : + u instanceof ArrayBuffer ? + 8 : + typeof SharedArrayBuffer !== "undefined" && u instanceof SharedArrayBuffer ? + 9 : + 0 /** * Returns `undefined` for detached buffers, which can no longer be read. * * @internal */ -export const bufferBytes = (buffer: ArrayBufferLike): Uint8Array | undefined => { +export const toBytes = (u: ArrayBufferLike | DataView, kind: number): Uint8Array | undefined => { try { - return new Uint8Array(buffer) + return kind === 7 ? + new Uint8Array((u as DataView).buffer, (u as DataView).byteOffset, (u as DataView).byteLength) : + new Uint8Array(u as ArrayBufferLike) } catch { return undefined } diff --git a/.repos/effect/packages/effect/src/internal/hash.ts b/.repos/effect/packages/effect/src/internal/hash.ts index c747f99544ba2..600fe692e7e63 100644 --- a/.repos/effect/packages/effect/src/internal/hash.ts +++ b/.repos/effect/packages/effect/src/internal/hash.ts @@ -1,5 +1,6 @@ /** - * Back-edge count used to avoid caching entry-point-dependent hashes. + * Back-edge count used to avoid caching entry-point-dependent hashes and + * comparisons. * * @internal */ @@ -9,3 +10,6 @@ export let backEdges = 0 export const addBackEdge = (): void => { backEdges++ } + +/** @internal */ +export const hashCache = new WeakMap() diff --git a/.repos/effect/packages/effect/src/internal/matcher.ts b/.repos/effect/packages/effect/src/internal/matcher.ts index cb1a7afd8b231..8b28c06b3d00c 100644 --- a/.repos/effect/packages/effect/src/internal/matcher.ts +++ b/.repos/effect/packages/effect/src/internal/matcher.ts @@ -23,21 +23,13 @@ export const TypeId = "~effect/Match/Matcher" /** @internal */ export type Contextual = [P] extends [never] ? Fallback : P -type TagHandlers = { - readonly [Tag in Types.Tags & string]: (_: Extract>) => Ret -} - -type PartialTagHandlers = { - readonly [Tag in Types.Tags & string]?: ((_: Extract>) => Ret) | undefined -} - type ValueTagHandlers = { readonly [Tag in Types.Tags<"_tag", I> & string]: (_: Extract) => any } -type HandledKeys = { - readonly [K in Keys]-?: undefined extends P[K] ? never : K -}[Keys] +type InternalTypeMatcher = TypeMatcher & { + readonly forwardArgs: boolean +} const TypeMatcherProto: Omit, "cases" | "select"> = { [TypeId]: { @@ -50,10 +42,10 @@ const TypeMatcherProto: Omit, "cases" }, _tag: "TypeMatcher", add( - this: TypeMatcher, + this: InternalTypeMatcher, _case: Case ): TypeMatcher { - return makeTypeMatcher(this.select, [...this.cases, _case]) + return makeTypeMatcher(this.select, [...this.cases, _case], this.forwardArgs) }, pipe() { return pipeArguments(this, arguments) @@ -62,11 +54,13 @@ const TypeMatcherProto: Omit, "cases" function makeTypeMatcher>( select: (...args: any) => I, - cases: ReadonlyArray + cases: ReadonlyArray, + forwardArgs: boolean ): TypeMatcher { const matcher = Object.create(TypeMatcherProto) matcher.select = select matcher.cases = cases + matcher.forwardArgs = forwardArgs return matcher } @@ -137,6 +131,8 @@ const makeNot = ( evaluate }) +const matches = (_case: Case, input: unknown): boolean => _case.guard(input) === (_case._tag === "When") + const makePredicate = (pattern: unknown): Predicate.Predicate => { if (typeof pattern === "function") { return pattern as Predicate.Predicate @@ -223,12 +219,12 @@ export const type = (): Matcher< I, never, never -> => makeTypeMatcher(identity, []) +> => makeTypeMatcher(identity, [], false) /** @internal */ export const fn = , I>( select: (...args: Args) => I -): Matcher, I, never, never, any, Args> => makeTypeMatcher(select, []) +): Matcher, I, never, never, any, Args> => makeTypeMatcher(select, [], true) /** @internal */ export const value = ( @@ -265,7 +261,7 @@ export const valueTags: { input: I, fields: Contextual> ): Unify> => { - const match: any = tagsExhaustive(fields as any)(makeTypeMatcher(identity, [])) + const match: any = tagsExhaustive(fields as any)(type()) return match(input) } ) @@ -281,7 +277,7 @@ export const typeTags = () => >( fields: P ) => { - const match: any = tagsExhaustive(fields as any)(makeTypeMatcher(identity, [])) + const match: any = tagsExhaustive(fields as any)(type()) return (input: I): Unify> => match(input) } @@ -376,111 +372,38 @@ export const whenAnd = < } /** @internal */ -export const discriminator = (field: D) => -< - R, - P extends Types.Tags & string, - Ret, - Fn extends (_: Extract>) => Ret ->( - ...pattern: [ - first: P, - ...values: Array

, - f: Fn - ] -) => { +export const discriminator = (field: string) => (...pattern: Array) => { const f = pattern[pattern.length - 1] - const values: Array

= pattern.slice(0, -1) as any + const values = pattern.slice(0, -1) const pred = values.length === 1 ? (_: any) => _ != null && _[field] === values[0] : (_: any) => _ != null && values.includes(_[field]) - return ( - self: Matcher - ): Matcher< - I, - Types.AddWithout>>, - Types.ApplyFilters>>>, - A | ReturnType, - Pr, - Ret - > => (self as any).add(makeWhen(pred, f as any)) as any + return (self: any): any => self.add(makeWhen(pred, f)) } /** @internal */ -export const discriminatorStartsWith = (field: D) => -< - R, - P extends string, - Ret, - Fn extends (_: Extract>) => Ret ->( - pattern: P, - f: Fn -) => { +export const discriminatorStartsWith = (field: string) => (pattern: string, f: (...args: Array) => any) => { const pred = (_: any) => _ != null && typeof _[field] === "string" && _[field].startsWith(pattern) - return ( - self: Matcher - ): Matcher< - I, - Types.AddWithout>>, - Types.ApplyFilters< - I, - Types.AddWithout>> - >, - A | ReturnType, - Pr, - Ret - > => (self as any).add(makeWhen(pred, f as any)) as any + return (self: any): any => self.add(makeWhen(pred, f)) } /** @internal */ -export const discriminators = (field: D) => -< - R, - Ret, - P extends - & PartialTagHandlers - & { readonly [Tag in Exclude>]: never } ->( - fields: Contextual> -) => { +export const discriminators = (field: string) => (fields: object) => { const predicate = makeWhen( (arg: any) => arg != null && Object.hasOwn(fields, arg[field]) && (fields as any)[arg[field]] !== undefined, - (data: any) => (fields as any)[data[field]](data) + (data: any, ...args: Array) => (fields as any)[data[field]](data, ...args) ) - return ( - self: Matcher - ): Matcher< - I, - Types.AddWithout>>>, - Types.ApplyFilters>>>>, - A | ReturnType, - Pr, - Ret - > => (self as any).add(predicate) + return (self: any): any => self.add(predicate) } /** @internal */ -export const discriminatorsExhaustive: ( - field: D -) => < - R, - Ret, - P extends - & TagHandlers - & { readonly [Tag in Exclude>]: never } ->( - fields: Contextual> -) => ( - self: Matcher -) => [Pr] extends [never] ? (u: I) => Unify> - : Unify> = (field: string) => (fields: object) => { - const addCases = discriminators(field)(fields) - return (matcher: any) => exhaustive(addCases(matcher)) - } +export const discriminatorsExhaustive = (field: string) => (fields: object) => { + const addCases = discriminators(field)(fields) + return (matcher: any): any => exhaustive(addCases(matcher)) +} /** @internal */ export const tag: < @@ -522,7 +445,7 @@ export const literals = (fields: object) => { (arg: any) => (typeof arg === "string" || typeof arg === "number") && Object.hasOwn(fields, arg) && (fields as any)[arg] !== undefined, - (data: any) => (fields as any)[data](data) + (data: any, ...args: Array) => (fields as any)[data](data, ...args) ) return (self: any): any => self.add(predicate) } @@ -603,10 +526,11 @@ export const orElse = return toResult._tag === "Success" ? toResult.success as any : (f as any)(toResult.failure) } + const forwardArgs = (self as InternalTypeMatcher).forwardArgs // @ts-expect-error return (...args: Array) => { const a = (toResult as any)(...args) - return Result.isSuccess(a) ? a.success : (f as any)(a.failure, ...args) + return Result.isSuccess(a) ? a.success : forwardArgs ? (f as any)(a.failure, ...args) : (f as any)(a.failure) } } @@ -633,15 +557,14 @@ export const result: >( return self.value } + const forwardArgs = (self as InternalTypeMatcher).forwardArgs const len = self.cases.length if (len === 1) { const _case = self.cases[0] return (...args: Array): Result.Result => { const input = self.select(...args) - if (_case._tag === "When" && _case.guard(input) === true) { - return Result.succeed(_case.evaluate(input, ...args)) - } else if (_case._tag === "Not" && _case.guard(input) === false) { - return Result.succeed(_case.evaluate(input, ...args)) + if (matches(_case, input)) { + return Result.succeed(forwardArgs ? _case.evaluate(input, ...args) : _case.evaluate(input)) } return Result.fail(input as any) } @@ -650,10 +573,8 @@ export const result: >( const input = self.select(...args) for (let i = 0; i < len; i++) { const _case = self.cases[i] - if (_case._tag === "When" && _case.guard(input) === true) { - return Result.succeed(_case.evaluate(input, ...args)) - } else if (_case._tag === "Not" && _case.guard(input) === false) { - return Result.succeed(_case.evaluate(input, ...args)) + if (matches(_case, input)) { + return Result.succeed(forwardArgs ? _case.evaluate(input, ...args) : _case.evaluate(input)) } } diff --git a/.repos/effect/packages/effect/src/internal/schema/schemaCodegen.ts b/.repos/effect/packages/effect/src/internal/schema/schemaCodegen.ts index e1e51b2d85768..97fb3409d84cb 100644 --- a/.repos/effect/packages/effect/src/internal/schema/schemaCodegen.ts +++ b/.repos/effect/packages/effect/src/internal/schema/schemaCodegen.ts @@ -8,6 +8,7 @@ import { errorWithPath } from "../errors.ts" import * as InternalAnnotations from "./annotations.ts" import * as CodeExpression from "./codeExpression.ts" import * as CodeImports from "./codeImports.ts" +import * as BuiltIns from "./schemaCodegenBuiltIns.ts" type Path = ReadonlyArray type CheckRepresentationAnnotation = SchemaRepresentation.CheckRepresentationAnnotation< @@ -296,13 +297,13 @@ export function addSchemas( check: SchemaRepresentation.Check, path: Path ): Fragment { - const callback = check.annotations?.toCode + const callback = BuiltIns.resolveCheck(check, path) let runtime: Fragment if (callback !== undefined) { const schemas = annotationSchemas(check.representation, [...path, "representation"]) runtime = compileCallback( schemas, - (schemas) => (callback as SchemaRepresentation.Generation.Check)({ schemas }), + (schemas) => callback({ schemas }), [...path, "annotations", "toCode"] ).runtime } else if (check._tag === "Filter") { @@ -361,7 +362,7 @@ export function addSchemas( ): Code { switch (representation._tag) { case "Declaration": { - const callback = representation.annotations?.toCode + const callback = BuiltIns.resolveDeclaration(representation, path) if (callback === undefined) { throw errorWithPath("Missing toCode callback", [...path, "annotations", "toCode"]) } @@ -370,7 +371,7 @@ export function addSchemas( ) return compileCallback( typeParameters, - (typeParameters) => (callback as SchemaRepresentation.Generation.Declaration)({ typeParameters }), + (typeParameters) => callback({ typeParameters }), [...path, "annotations", "toCode"] ) } diff --git a/.repos/effect/packages/effect/src/internal/schema/schemaCodegenBuiltIns.ts b/.repos/effect/packages/effect/src/internal/schema/schemaCodegenBuiltIns.ts new file mode 100644 index 0000000000000..bbdaabbeff07b --- /dev/null +++ b/.repos/effect/packages/effect/src/internal/schema/schemaCodegenBuiltIns.ts @@ -0,0 +1,343 @@ +import { format } from "../../Formatter.ts" +import { isObject } from "../../Predicate.ts" +import type { Json } from "../../Schema.ts" +import type * as Representation from "../../SchemaRepresentation.ts" +import { literal } from "../codegen.ts" +import { errorWithPath } from "../errors.ts" + +type Path = ReadonlyArray +type PrintArgument = (value: unknown) => string | undefined + +const noArguments: PrintArgument = (payload) => payload === null ? "" : undefined +const string: PrintArgument = (value) => typeof value === "string" ? literal(value) : undefined +const number: PrintArgument = (value) => + typeof value === "number" && Number.isFinite(value) ? literal(value) : undefined +const natural: PrintArgument = (value) => + typeof value === "number" && Number.isInteger(value) && value >= 0 ? literal(value) : undefined +const bigint: PrintArgument = (value) => + typeof value === "string" && /^-?(?:0|[1-9][0-9]*)$/.test(value) ? literal(BigInt(value)) : undefined +const date: PrintArgument = (value) => { + if (typeof value !== "string") return undefined + const ms = Date.parse(value) + return Number.isFinite(ms) && new Date(ms).toISOString() === value ? `new globalThis.Date(${ms})` : undefined +} + +function fields(render: PrintArgument, ...keys: ReadonlyArray): PrintArgument { + return (payload) => { + if (!isObject(payload)) return undefined + const args: Array = [] + for (const key of keys) { + const arg = render(payload[key]) + if (arg === undefined) return undefined + args.push(arg) + } + return args.join(", ") + } +} + +function between(render: PrintArgument): PrintArgument { + return (payload) => { + if (!isObject(payload)) return undefined + const minimum = render(payload.minimum) + const maximum = render(payload.maximum) + const { exclusiveMaximum, exclusiveMinimum } = payload + if ( + minimum === undefined || maximum === undefined || + exclusiveMinimum !== undefined && exclusiveMinimum !== true || + exclusiveMaximum !== undefined && exclusiveMaximum !== true + ) return undefined + return `{ minimum: ${minimum}, maximum: ${maximum}, exclusiveMinimum: ${exclusiveMinimum}, exclusiveMaximum: ${exclusiveMaximum} }` + } +} + +const checkArguments: Record = { + isTrimmed: noArguments, + isPattern: (payload) => { + if (!isObject(payload) || typeof payload.source !== "string" || typeof payload.flags !== "string") return undefined + const { source, flags } = payload + try { + const pattern = new RegExp(source, flags) + if (pattern.source !== source || pattern.flags !== flags) return undefined + } catch { + return undefined + } + return `new globalThis.RegExp(${literal(source)}${flags === "" ? "" : ", " + literal(flags)})` + }, + isStringFinite: noArguments, + isStringBigInt: noArguments, + isStringSymbol: noArguments, + isUUID: (payload) => { + if (!isObject(payload)) return undefined + const { version } = payload + if (version === null) return "" + return typeof version === "number" && Number.isInteger(version) && version >= 1 && version <= 8 + ? literal(version) + : undefined + }, + isGUID: noArguments, + isULID: noArguments, + isAscii: noArguments, + isBase64: noArguments, + isBase64Url: noArguments, + isStartingWith: fields(string, "startsWith"), + isEndingWith: fields(string, "endsWith"), + isIncluding: fields(string, "includes"), + isUppercased: noArguments, + isLowercased: noArguments, + isCapitalized: noArguments, + isUncapitalized: noArguments, + isFinite: noArguments, + isInt: noArguments, + isGreaterThan: fields(number, "exclusiveMinimum"), + isGreaterThanOrEqualTo: fields(number, "minimum"), + isLessThan: fields(number, "exclusiveMaximum"), + isLessThanOrEqualTo: fields(number, "maximum"), + isBetween: between(number), + isMultipleOf: fields((value) => typeof value === "number" && value > 0 ? number(value) : undefined, "divisor"), + isGreaterThanDate: fields(date, "exclusiveMinimum"), + isGreaterThanOrEqualToDate: fields(date, "minimum"), + isLessThanDate: fields(date, "exclusiveMaximum"), + isLessThanOrEqualToDate: fields(date, "maximum"), + isBetweenDate: between(date), + isGreaterThanBigInt: fields(bigint, "exclusiveMinimum"), + isGreaterThanOrEqualToBigInt: fields(bigint, "minimum"), + isLessThanBigInt: fields(bigint, "exclusiveMaximum"), + isLessThanOrEqualToBigInt: fields(bigint, "maximum"), + isBetweenBigInt: between(bigint), + isMinLength: fields(natural, "minLength"), + isMaxLength: fields(natural, "maxLength"), + isBetweenLength: fields(natural, "minimum", "maximum"), + isMinCodePoints: fields(natural, "minCodePoints"), + isMaxCodePoints: fields(natural, "maxCodePoints"), + isBetweenCodePoints: fields(natural, "minimum", "maximum"), + isMinSize: fields(natural, "minSize"), + isMaxSize: fields(natural, "maxSize"), + isBetweenSize: fields(natural, "minimum", "maximum"), + isMinProperties: fields(natural, "minProperties"), + isMaxProperties: fields(natural, "maxProperties"), + isBetweenProperties: fields(natural, "minimum", "maximum"), + isPropertyNames: noArguments, + isUnique: noArguments, + isUniqueKey: noArguments +} + +function invalidPayload(id: string, path: Path): never { + throw errorWithPath(`Invalid representation payload for ${id}`, [...path, "representation", "payload"]) +} + +function checkArity(id: string, actual: number, expected: number, path: Path): void { + if (actual !== expected) { + throw errorWithPath(`Invalid number of schema arguments for ${id}: expected ${expected}, got ${actual}`, path) + } +} + +/** @internal */ +export function resolveCheck(check: Representation.Check, path: Path): Representation.Generation.Check | undefined { + const { annotations, representation: repr } = check + if (annotations && "toCode" in annotations) return annotations.toCode as Representation.Generation.Check | undefined + if (check._tag !== "Filter" || !repr?.id.startsWith("effect/schema/")) return undefined + const name = repr.id.slice("effect/schema/".length) + if (!Object.hasOwn(checkArguments, name)) return undefined + const args = checkArguments[name](repr.payload) ?? invalidPayload(repr.id, path) + checkArity(repr.id, repr.schemas?.length ?? 0, name === "isPropertyNames" ? 1 : 0, [ + ...path, + "representation", + "schemas" + ]) + return ({ schemas }) => ({ runtime: `Schema.${name}(${schemas[0]?.runtime ?? args})` }) +} + +interface DeclarationRule { + readonly type: string + // An explicit zero distinguishes a call like ErrorInstance() from a constant like Date. + readonly arity?: number + readonly typeArity?: number + readonly module?: string + readonly runtime?: string + readonly argument?: PrintArgument + readonly crypto?: KeyAlgorithms +} + +function options(accepts: (key: string, value: unknown) => boolean): PrintArgument { + return (payload) => { + if (payload === null) return "" + if (!isObject(payload)) return undefined + const entries = Object.entries(payload) + return entries.length > 0 && entries.every(([key, value]) => accepts(key, value)) ? format(payload) : undefined + } +} + +interface KeyAlgorithms { + readonly withoutHash?: ReadonlyArray + readonly withHash?: ReadonlyArray + readonly rsa?: string + readonly rsaWithSalt?: string +} + +const signature: KeyAlgorithms = { + withoutHash: ["ed25519"], + withHash: ["ecdsaP256", "ecdsaP384", "ecdsaP521"], + rsa: "rsaPkcs1v15", + rsaWithSalt: "rsaPss" +} +const keyAgreement: KeyAlgorithms = { withoutHash: ["x25519", "ecdhP256", "ecdhP384", "ecdhP521"] } + +const declarations: Record = { + "effect/schema/Json": { type: "Schema.Json" }, + "effect/schema/MutableJson": { type: "Schema.MutableJson" }, + "effect/schema/Error": { + type: "globalThis.Error", + runtime: "Schema.ErrorInstance", + arity: 0, + argument: options((key, value) => (key === "includeStack" || key === "excludeCause") && value === true) + }, + "effect/schema/RegExp": { type: "globalThis.RegExp" }, + "effect/schema/URL": { type: "globalThis.URL" }, + "effect/schema/Date": { type: "globalThis.Date" }, + "effect/schema/File": { type: "globalThis.File" }, + "effect/schema/FormData": { type: "globalThis.FormData" }, + "effect/schema/URLSearchParams": { type: "globalThis.URLSearchParams" }, + "effect/schema/Uint8Array": { type: "globalThis.Uint8Array" }, + "effect/schema/ReadonlyMap": { type: "globalThis.ReadonlyMap", arity: 2 }, + "effect/schema/ReadonlySet": { type: "globalThis.ReadonlySet", arity: 1 }, + "effect/schema/BigDecimal": { type: "BigDecimal.BigDecimal" }, + "effect/schema/Rational": { type: "Rational.Rational" }, + "effect/schema/ByteSize": { type: "ByteSize.ByteSize" }, + "effect/schema/CauseReason": { type: "Cause.Reason", arity: 2, typeArity: 1 }, + "effect/schema/Cause": { type: "Cause.Cause", arity: 2, typeArity: 1 }, + "effect/schema/Chunk": { type: "Chunk.Chunk", arity: 1 }, + "effect/schema/DateTimeUtc": { type: "DateTime.Utc" }, + "effect/schema/TimeZoneOffset": { type: "DateTime.TimeZone.Offset" }, + "effect/schema/TimeZoneNamed": { type: "DateTime.TimeZone.Named" }, + "effect/schema/TimeZone": { type: "DateTime.TimeZone" }, + "effect/schema/DateTimeZoned": { type: "DateTime.Zoned" }, + "effect/schema/Duration": { type: "Duration.Duration" }, + "effect/schema/Exit": { type: "Exit.Exit", arity: 3, typeArity: 2 }, + "effect/schema/Graph": { + type: "Graph.Graph", + arity: 2, + argument: (kind) => kind === "directed" || kind === "undirected" ? literal(kind) : undefined + }, + "effect/schema/HashMap": { type: "HashMap.HashMap", arity: 2 }, + "effect/schema/HashSet": { type: "HashSet.HashSet", arity: 1 }, + "effect/schema/Option": { type: "Option.Option", arity: 1 }, + "effect/schema/Redacted": { + type: "Redacted.Redacted", + arity: 1, + argument: options((key, value) => + key === "label" ? typeof value === "string" : key === "disallowJsonEncode" && value === true + ) + }, + "effect/schema/Result": { type: "Result.Result", arity: 2 }, + "effect/schema/SemVer": { type: "SemVer.SemVer" }, + "effect/schema/SemVerRange": { type: "SemVerRange.SemVerRange" }, + "effect/http/Cookie": { type: "Cookies.Cookie", module: "effect/http/Cookies" }, + "effect/http/Cookies": { type: "Cookies.Cookies", module: "effect/http/Cookies" }, + "effect/http/Headers": { type: "Headers.Headers", module: "effect/http/Headers" }, + "effect/http/UrlParams": { type: "UrlParams.UrlParams", module: "effect/http/UrlParams" }, + "effect/http/PersistedFile": { + type: "Multipart.PersistedFile", + module: "effect/http/Multipart", + runtime: "Multipart.PersistedFileSchema" + }, + "effect/crypto/MacKey": { + type: "Mac.Key", + crypto: { withHash: ["hmacSha1", "hmacSha256", "hmacSha384", "hmacSha512"] } + }, + "effect/crypto/AeadKey": { + type: "Aead.Key", + crypto: { withoutHash: ["aes128Gcm", "aes256Gcm", "chacha20Poly1305", "xchacha20Poly1305"] } + }, + "effect/crypto/CipherKey": { + type: "Cipher.Key", + crypto: { withoutHash: ["aes128Ctr", "aes256Ctr", "aes128Cbc", "aes256Cbc"] } + }, + "effect/crypto/SignaturePublicKey": { type: "Signature.PublicKey", crypto: signature }, + "effect/crypto/SignaturePrivateKey": { type: "Signature.PrivateKey", crypto: signature }, + "effect/crypto/KeyAgreementPublicKey": { type: "KeyAgreement.PublicKey", crypto: keyAgreement }, + "effect/crypto/KeyAgreementPrivateKey": { type: "KeyAgreement.PrivateKey", crypto: keyAgreement }, + "effect/crypto/KeyWrapKey": { type: "KeyWrap.Key", crypto: { withoutHash: ["aes128Kw", "aes256Kw"] } }, + "effect/crypto/KeyWrapPublicKey": { type: "KeyWrap.PublicKey", crypto: { rsa: "rsaOaep" } }, + "effect/crypto/KeyWrapPrivateKey": { type: "KeyWrap.PrivateKey", crypto: { rsa: "rsaOaep" } } +} + +const digestSuffixes = new Map([ + ["MD5", "Md5"], + ["SHA-1", "Sha1"], + ["SHA-256", "Sha256"], + ["SHA-384", "Sha384"], + ["SHA-512", "Sha512"] +]) + +function cryptoKey( + name: string, + type: string, + algorithms: KeyAlgorithms, + payload: Json +): Representation.Generation.DeclarationOutput | undefined { + if (!isObject(payload) || typeof payload.name !== "string") return undefined + const { hash, modulusLength, saltLength } = payload + const suffix = typeof hash === "string" ? digestSuffixes.get(hash) : undefined + if (hash !== undefined && suffix === undefined) return undefined + const digest = suffix === undefined ? undefined : `Digest.${suffix.toLowerCase()}` + const family = type.split(".")[0] + const imports = [`import * as ${family} from "effect/crypto/${family}"`] + if (digest !== undefined) imports.push("import * as Digest from \"effect/crypto/Digest\"") + let algorithm: string + if (modulusLength === undefined) { + const names = digest === undefined ? algorithms.withoutHash : algorithms.withHash + if (!names?.includes(payload.name) || saltLength !== undefined) return undefined + algorithm = `${family}.${payload.name}` + if (digest !== undefined) algorithm = `{ ...${algorithm}, hash: ${digest} }` + } else { + const factory = saltLength === undefined ? algorithms.rsa : algorithms.rsaWithSalt + if ( + factory === undefined || digest === undefined || !Number.isFinite(modulusLength) || + saltLength !== undefined && !Number.isFinite(saltLength) + ) return undefined + const salt = saltLength === undefined ? "" : `, saltLength: ${saltLength}` + algorithm = `${family}.${factory}({ hash: ${digest}, modulusLength: ${modulusLength}${salt} })` + if (payload.name !== factory + suffix) algorithm = `{ ...${algorithm}, name: ${literal(payload.name)} }` + } + return { runtime: `Schema.${name}(${algorithm})`, Type: type, importDeclarations: imports } +} + +/** @internal */ +export function resolveDeclaration( + node: Representation.Declaration, + path: Path +): Representation.Generation.Declaration | undefined { + const { annotations, representation: repr } = node + if (annotations && "toCode" in annotations) { + return annotations.toCode as Representation.Generation.Declaration | undefined + } + if (!repr || !Object.hasOwn(declarations, repr.id)) return undefined + const { id, payload } = repr + const name = id.slice(id.lastIndexOf("/") + 1) + const rule = declarations[id] + checkArity(id, node.typeParameters.length, rule.arity ?? 0, [...path, "typeParameters"]) + if (rule.crypto) { + const output = cryptoKey(name, rule.type, rule.crypto, payload) ?? invalidPayload(id, path) + return () => output + } + return ({ typeParameters }) => { + const args = typeParameters.map((p) => p.runtime) + const types = typeParameters.slice(0, rule.typeArity).map((p) => p.Type) + const argument = (rule.argument ?? noArguments)(payload) ?? invalidPayload(id, path) + if (id === "effect/schema/Graph") { + args.unshift(argument) + types.push(argument) + } else if (argument !== "") { + args.push(argument) + } + const runtime = rule.runtime ?? `Schema.${name}` + const namespace = rule.type.split(".")[0] + return { + runtime: rule.arity === undefined ? runtime : `${runtime}(${args.join(", ")})`, + Type: types.length > 0 ? `${rule.type}<${types.join(", ")}>` : rule.type, + importDeclarations: namespace === "globalThis" || namespace === "Schema" ? [] : [ + `import * as ${namespace} from "${rule.module ?? "effect/" + namespace}"` + ] + } + } +} diff --git a/.repos/effect/packages/effect/src/internal/schema/toEquivalence.ts b/.repos/effect/packages/effect/src/internal/schema/toEquivalence.ts index 1bb2aafd7daa2..39554f54b4497 100644 --- a/.repos/effect/packages/effect/src/internal/schema/toEquivalence.ts +++ b/.repos/effect/packages/effect/src/internal/schema/toEquivalence.ts @@ -8,14 +8,12 @@ import * as SchemaAST from "../../SchemaAST.ts" import * as SchemaParser from "../../SchemaParser.ts" import * as InternalAnnotations from "./annotations.ts" -const recurMemo = memoize(recur) - /** @internal */ export const toEquivalence = (ast: SchemaAST.AST): Equivalence.Equivalence => { - return recurMemo(SchemaAST.toType(ast)) + return recur(SchemaAST.toType(ast)) } -function recur(ast: SchemaAST.AST): Equivalence.Equivalence { +const recur = memoize((ast: SchemaAST.AST): Equivalence.Equivalence => { // --------------------------------------------- // handle annotations // --------------------------------------------- @@ -156,7 +154,7 @@ function recur(ast: SchemaAST.AST): Equivalence.Equivalence { return Equivalence.make((a, b) => (equivalence ??= toEquivalence(ast.thunk()))(a, b)) } } -} +}) function declarationEquivalence(ast: SchemaAST.Declaration): Equivalence.Equivalence { const representation = (ast.annotations as Schema.Annotations.Declaration | undefined)?.representation diff --git a/.repos/effect/packages/effect/src/internal/version.ts b/.repos/effect/packages/effect/src/internal/version.ts index 70323394ad695..afbd4e4104fbc 100644 --- a/.repos/effect/packages/effect/src/internal/version.ts +++ b/.repos/effect/packages/effect/src/internal/version.ts @@ -1,2 +1,2 @@ /** @internal */ -export const version = "4.1.5" +export const version = "4.1.6" diff --git a/.repos/effect/packages/effect/src/jose/JoseError.ts b/.repos/effect/packages/effect/src/jose/JoseError.ts index de03710966ce5..7a9c10ca3ab3f 100644 --- a/.repos/effect/packages/effect/src/jose/JoseError.ts +++ b/.repos/effect/packages/effect/src/jose/JoseError.ts @@ -16,6 +16,7 @@ * @stability unstable * @since 4.1.1 */ +import type * as CryptoError from "../crypto/CryptoError.ts" import * as Data from "../Data.ts" import * as Predicate from "../Predicate.ts" @@ -69,6 +70,38 @@ export class InvalidKey extends Data.TaggedError("InvalidKey")<{ } } +/** + * Reason for a crypto backend failure other than a rejected key, such as an + * algorithm the provider does not support. + * + * **Details** + * + * `module`, `method`, and `reason` identify the failed backend operation and + * reason tag. The backend description and cause are omitted because they may + * contain secret material. + * + * @stability unstable + * @category errors + * @since 4.1.6 + */ +export class CryptoFailed extends Data.TaggedError("CryptoFailed")<{ + readonly description: string + readonly module: string + readonly method: string + readonly reason: CryptoError.CryptoErrorReason["_tag"] +}> { + /** + * Marks this value as a `JoseError` reason for runtime guards. + * + * @since 4.1.6 + */ + readonly [ReasonTypeId] = ReasonTypeId + + override get message(): string { + return `${this.description} (${this.module}.${this.method}: ${this.reason})` + } +} + /** * Reason for an option or configuration value that the operation rejects * before doing any work, such as a non-HTTPS key-set URL. @@ -253,6 +286,7 @@ export class ClaimValidationFailed extends Data.TaggedError("ClaimValidationFail export type JoseErrorReason = | InvalidToken | InvalidKey + | CryptoFailed | InvalidArgument | AlgorithmNotAllowed | SignatureVerificationFailed diff --git a/.repos/effect/packages/effect/src/jose/internal/compact.ts b/.repos/effect/packages/effect/src/jose/internal/compact.ts index a48e7f0196d6c..32484c1632df9 100644 --- a/.repos/effect/packages/effect/src/jose/internal/compact.ts +++ b/.repos/effect/packages/effect/src/jose/internal/compact.ts @@ -24,14 +24,23 @@ export const invalidArgument = (description: string, cause?: unknown) => fail(new JoseError.InvalidArgument({ description, cause })) /** - * Maps a failure of an operation on secret material, such as signing or - * private-key import, to a fixed description. Backend messages and causes may - * describe the secret, so they are dropped. + * Maps a backend failure without exposing its message or cause, which may + * describe secret material. `InvalidKey` stays `InvalidKey`; other reasons + * become `CryptoFailed`. * * @internal */ -export const cryptoFailure = (description: string) => (_: CryptoError.CryptoError): JoseError.JoseError => - new JoseError.JoseError({ reason: new JoseError.InvalidKey({ description }) }) +export const cryptoFailure = (description: string) => (error: CryptoError.CryptoError): JoseError.JoseError => + new JoseError.JoseError({ + reason: error.reason._tag === "InvalidKey" + ? new JoseError.InvalidKey({ description }) + : new JoseError.CryptoFailed({ + description, + module: error.module, + method: error.method, + reason: error.reason._tag + }) + }) /** * Maps a public-key import failure, keeping the backend diagnostic. diff --git a/.repos/effect/packages/effect/src/observability/Otlp.ts b/.repos/effect/packages/effect/src/observability/Otlp.ts index 773cc23ad35bd..c40544ad7897b 100644 --- a/.repos/effect/packages/effect/src/observability/Otlp.ts +++ b/.repos/effect/packages/effect/src/observability/Otlp.ts @@ -16,6 +16,7 @@ import type * as HttpClient from "../http/HttpClient.ts" import * as HttpClientRequest from "../http/HttpClientRequest.ts" import * as Layer from "../Layer.ts" import type * as Tracer from "../Tracer.ts" +import type { Concurrency } from "../Types.ts" import type * as OtlpExporter from "./OtlpExporter.ts" import * as OtlpLogger from "./OtlpLogger.ts" import type { AggregationTemporality } from "./OtlpMetrics.ts" @@ -53,6 +54,11 @@ export const layer = (options: { */ readonly compression?: "gzip" | "none" | undefined readonly maxBatchSize?: number | undefined + /** Maximum pending queued spans/logs (does not include in-flight batches). */ + readonly maxQueueSize?: number | undefined + /** Maximum concurrent export requests for spans/logs, or `"unbounded"`. Defaults to `4`. */ + readonly concurrency?: Concurrency | undefined + readonly onDrop?: ((count: number) => void) | undefined readonly tracerContext?: ((primitive: Tracer.EffectPrimitive, span: Tracer.AnySpan) => X) | undefined readonly loggerExportInterval?: Duration.Input | undefined readonly loggerExcludeLogSpans?: boolean | undefined @@ -72,6 +78,9 @@ export const layer = (options: { compression: options.compression, exportInterval: options.loggerExportInterval, maxBatchSize: options.maxBatchSize, + maxQueueSize: options.maxQueueSize, + concurrency: options.concurrency, + onDrop: options.onDrop, shutdownTimeout: options.shutdownTimeout, excludeLogSpans: options.loggerExcludeLogSpans, mergeWithExisting: options.loggerMergeWithExisting @@ -92,6 +101,9 @@ export const layer = (options: { compression: options.compression, exportInterval: options.tracerExportInterval, maxBatchSize: options.maxBatchSize, + maxQueueSize: options.maxQueueSize, + concurrency: options.concurrency, + onDrop: options.onDrop, context: options.tracerContext, shutdownTimeout: options.shutdownTimeout }) @@ -119,6 +131,9 @@ export const layerFromConfig = (options?: { readonly attributes?: Record } | undefined readonly headers?: Headers.Input | undefined + /** Maximum concurrent export requests for spans/logs, or `"unbounded"`. Defaults to `4`. */ + readonly concurrency?: Concurrency | undefined + readonly onDrop?: ((count: number) => void) | undefined readonly tracerContext?: ((primitive: Tracer.EffectPrimitive, span: Tracer.AnySpan) => X) | undefined readonly loggerExcludeLogSpans?: boolean | undefined readonly loggerMergeWithExisting?: boolean | undefined @@ -127,6 +142,8 @@ export const layerFromConfig = (options?: { OtlpLogger.layerFromConfig({ resource: options?.resource, headers: options?.headers, + concurrency: options?.concurrency, + onDrop: options?.onDrop, excludeLogSpans: options?.loggerExcludeLogSpans, mergeWithExisting: options?.loggerMergeWithExisting }), @@ -137,6 +154,8 @@ export const layerFromConfig = (options?: { OtlpTracer.layerFromConfig({ resource: options?.resource, headers: options?.headers, + concurrency: options?.concurrency, + onDrop: options?.onDrop, context: options?.tracerContext }) ) @@ -163,6 +182,11 @@ export const layerJson: (options: { */ readonly compression?: "gzip" | "none" | undefined readonly maxBatchSize?: number | undefined + /** Maximum pending queued spans/logs (does not include in-flight batches). */ + readonly maxQueueSize?: number | undefined + /** Maximum concurrent export requests for spans/logs, or `"unbounded"`. Defaults to `4`. */ + readonly concurrency?: Concurrency | undefined + readonly onDrop?: ((count: number) => void) | undefined readonly tracerContext?: ((primitive: Tracer.EffectPrimitive, span: Tracer.AnySpan) => X) | undefined readonly loggerExportInterval?: Duration.Input | undefined readonly loggerExcludeLogSpans?: boolean | undefined @@ -198,6 +222,11 @@ export const layerProtobuf: (options: { */ readonly compression?: "gzip" | "none" | undefined readonly maxBatchSize?: number | undefined + /** Maximum pending queued spans/logs (does not include in-flight batches). */ + readonly maxQueueSize?: number | undefined + /** Maximum concurrent export requests for spans/logs, or `"unbounded"`. Defaults to `4`. */ + readonly concurrency?: Concurrency | undefined + readonly onDrop?: ((count: number) => void) | undefined readonly tracerContext?: ((primitive: Tracer.EffectPrimitive, span: Tracer.AnySpan) => X) | undefined readonly loggerExportInterval?: Duration.Input | undefined readonly loggerExcludeLogSpans?: boolean | undefined diff --git a/.repos/effect/packages/effect/src/observability/OtlpExporter.ts b/.repos/effect/packages/effect/src/observability/OtlpExporter.ts index 588dea4ddd981..a305dd6717b91 100644 --- a/.repos/effect/packages/effect/src/observability/OtlpExporter.ts +++ b/.repos/effect/packages/effect/src/observability/OtlpExporter.ts @@ -13,19 +13,21 @@ import { Clock } from "../Clock.ts" import * as Context from "../Context.ts" import * as Duration from "../Duration.ts" import * as Effect from "../Effect.ts" -import * as Fiber from "../Fiber.ts" -import * as FiberSet from "../FiberSet.ts" +import type * as Fiber from "../Fiber.ts" import { identity } from "../Function.ts" import * as Headers from "../http/Headers.ts" import type { HttpBody } from "../http/HttpBody.ts" import * as HttpClient from "../http/HttpClient.ts" import * as HttpClientError from "../http/HttpClientError.ts" import * as HttpClientRequest from "../http/HttpClientRequest.ts" +import * as Count from "../internal/count.ts" import * as Latch from "../Latch.ts" import * as Layer from "../Layer.ts" +import * as MutableList from "../MutableList.ts" import * as Result from "../Result.ts" import * as Schedule from "../Schedule.ts" import * as Scope from "../Scope.ts" +import type { Concurrency } from "../Types.ts" import * as Version from "../Version.ts" // A missing or invalid Retry-After falls back to a fixed delay. @@ -60,11 +62,15 @@ const policy = Schedule.forever.pipe( * * **Details** * - * Every exporter created by `make` registers its export operation here, so a - * single `flush` drains all signals sharing the registry. `flush` returns only - * after the exports it initiated have settled, cannot fail, and respects each - * exporter's temporary-disable window. Wrap it with `Effect.timeoutOption` to - * bound its duration at the call site. + * Every exporter created by `make` registers its flush operation here, so a + * single `flush` drains all signals sharing the registry concurrently while + * each exporter respects its own `concurrency` limit. For each exporter, + * `flush` returns once every export already in flight when it was called has + * settled and every item accepted before the call has been sent or discarded by + * a failed export (or after one fresh snapshot settles when `exportEmpty` is + * enabled). `flush` cannot fail and respects each exporter's temporary-disable + * window. Wrap it with `Effect.timeoutOption` to bound its duration at the call + * site. * * @stability unstable * @category services @@ -76,8 +82,16 @@ export class Flusher extends Context.Service = Layer.sync(Flusher, () => { * * **Details** * - * The exporter buffers pushed data, periodically posts encoded batches to the - * configured URL, retries transient failures, temporarily disables exporting - * after unhandled failures, and flushes during scope finalization up to - * `shutdownTimeout`. + * The exporter buffers pending pushed items up to `maxQueueSize` (dropping new + * arrivals on overflow and notifying `onDrop`), sends FIFO batches of at most + * `maxBatchSize` with up to `concurrency` exports (including retries) in flight + * at a time, temporarily disables exporting after unhandled failures, and + * drains remaining items during scope finalization up to `shutdownTimeout`. + * `maxQueueSize` bounds only pending queued items, not batches already in + * flight. * * The export interval starts with the first push and stops once an export * empties the buffer, so an idle exporter keeps no timer pending. With @@ -178,6 +196,25 @@ export const make: ( readonly label: string readonly exportInterval: Duration.Input readonly maxBatchSize: number | "disabled" + /** + * Maximum number of pending items buffered in the queue. Does not count + * items already dequeued into in-flight export batches. New items pushed + * while the queue is full are dropped and reported to `onDrop`. + * + * Defaults to `2048` (or `maxBatchSize` if larger). + */ + readonly maxQueueSize?: number | undefined + /** + * Maximum number of export requests (including retries) allowed in flight + * concurrently, or `"unbounded"` for no limit. + * + * Defaults to `4`. + */ + readonly concurrency?: Concurrency | undefined + /** + * Synchronous callback invoked when items are dropped due to queue overflow. + */ + readonly onDrop?: ((count: number) => void) | undefined readonly exportEmpty?: boolean | undefined readonly body: (data: Array) => readonly [body: HttpBody, onSuccess: Effect.Effect] readonly shutdownTimeout: Duration.Input @@ -191,6 +228,15 @@ export const make: ( const clock = Context.get(services, Clock) const scope = Context.get(services, Scope.Scope) const exportInterval = Duration.max(Duration.fromInputUnsafe(options.exportInterval), Duration.zero) + const batchLimit = options.maxBatchSize === "disabled" ? Infinity : Count.normalizeNonEmpty(options.maxBatchSize) + const maxQueueSize = options.maxQueueSize === undefined || Number.isNaN(options.maxQueueSize) + ? Number.isFinite(batchLimit) ? Math.max(2048, batchLimit) : 2048 + : Count.normalize(options.maxQueueSize) + const concurrency = options.concurrency === "unbounded" + ? Infinity + : options.concurrency === undefined || Number.isNaN(options.concurrency) + ? 4 + : Count.normalizeNonEmpty(options.concurrency) const client = Context.get(services, HttpClient.HttpClient).pipe( HttpClient.tap((response) => Effect.ignore(response.arrayBuffer)), @@ -211,93 +257,178 @@ export const make: ( const request = HttpClientRequest.post(options.url, { headers }) const exportsEmpty = options.maxBatchSize === "disabled" && options.exportEmpty === true - let buffer: Array = [] + const queue = MutableList.make() let disabledUntil: number | undefined = undefined + let closed = false const isDisabled = () => { if (disabledUntil === undefined) return false if (clock.currentTimeMillisUnsafe() < disabledUntil) return true disabledUntil = undefined return false } + const isStopped = () => closed || isDisabled() + + // Progress is counted in items, or in snapshots when `exportsEmpty` is set: + // `requested` is how far callers asked to drain and `started` is how far the + // batches dequeued so far reach. `inFlight` maps each working fiber to the + // offset its batch starts at. Offsets only grow and a `Map` keeps insertion + // order, so its first entry is the earliest export in flight and everything + // before it has settled, even when batches complete out of order. + let requested = 0 + let started = 0 + const inFlight = new Map, number>() + const settled = () => closed ? Infinity : inFlight.values().next().value ?? started - const runExport = Effect.suspend(() => { - if (isDisabled() || (buffer.length === 0 && !exportsEmpty)) { - return Effect.void + interface Waiter { + readonly target: number + readonly resume: (effect: Effect.Effect) => void + } + const waiters = new Set() + const notifyWaiters = () => { + const reached = settled() + for (const waiter of waiters) { + if (reached >= waiter.target) { + waiters.delete(waiter) + waiter.resume(Effect.void) + } } - const items = buffer - buffer = [] - const [body, onSuccess] = options.body(items) - const batchRequest = HttpClientRequest.setBody(request, body) - // Compress before client.execute so transient retries reuse the encoded bytes. - const response = options.compression === "gzip" - ? HttpClientRequest.compressBody(batchRequest, "gzip").pipe(Effect.flatMap(client.execute)) - : client.execute(batchRequest) - return response.pipe( - Effect.andThen(onSuccess), - Effect.asVoid, - Effect.withTracerEnabled(false) - ) - }).pipe( - Effect.catchCause((cause) => { - if (disabledUntil !== undefined) return Effect.void - disabledUntil = clock.currentTimeMillisUnsafe() + 60_000 - buffer = [] - return Effect.logWarning("Disabling exporter for 60 seconds", cause) - }), - Effect.annotateLogs({ - package: "@effect/opentelemetry", - module: options.label + } + const awaitSettled = (target: number): Effect.Effect => + Effect.callback((resume) => { + if (settled() >= target) return resume(Effect.void) + const waiter: Waiter = { target, resume } + waiters.add(waiter) + return Effect.sync(() => { + waiters.delete(waiter) + }) }) - ) - const exportFibers = yield* FiberSet.make() - const runExportFork = yield* FiberSet.runtime(exportFibers)() + // `armed` is open while there is something to export. It changes in the + // same synchronous step as the queue check, so a push is never stranded. + const armed = yield* Latch.make(exportsEmpty) + const wake = yield* Latch.make() - yield* Scope.addFinalizer( - scope, + const exportBatch = (items: Array): Effect.Effect => Effect.suspend(() => { - if (disabledUntil !== undefined) return Effect.void - runExportFork(runExport) - return FiberSet.awaitEmpty(exportFibers) + const [body, onSuccess] = options.body(items) + const batchRequest = HttpClientRequest.setBody(request, body) + // Compress before client.execute so transient retries reuse the encoded bytes. + const response = options.compression === "gzip" + ? HttpClientRequest.compressBody(batchRequest, "gzip").pipe(Effect.flatMap(client.execute)) + : client.execute(batchRequest) + return response.pipe( + Effect.andThen(onSuccess), + Effect.withTracerEnabled(false) + ) }).pipe( - Effect.ignore, - Effect.interruptible, - Effect.timeoutOption(options.shutdownTimeout) + Effect.catchCause((cause) => { + MutableList.clear(queue) + // Nothing queued or requested will start now. Count it as started so + // waiters only wait for the exports still in flight. + requested = started = Math.max(started, requested) + if (isDisabled()) return Effect.void + disabledUntil = clock.currentTimeMillisUnsafe() + 60_000 + return Effect.logWarning("Disabling exporter for 60 seconds", cause) + }), + Effect.annotateLogs({ + package: "@effect/opentelemetry", + module: options.label + }) ) - ) - // `armed` is open while there is something to export. It changes in the - // same synchronous step as the buffer check, so a push is never stranded. - const armed = yield* Latch.make(exportsEmpty) - const wake = yield* Latch.make() - const disarmIfEmpty = Effect.sync(() => { - if (exportsEmpty || buffer.length > 0 || !armed.closeUnsafe()) return - wake.openUnsafe() + // Up to `concurrency` workers run on demand while there is work. The + // exporter owns them, so interrupting a flush never cancels a request. + const canStart = () => + inFlight.size < concurrency && !isStopped() && (requested > started || queue.length >= batchLimit) + const workerLoop: Effect.Effect = Effect.withFiber((fiber) => { + if (!canStart()) return Effect.void + const items = MutableList.takeN(queue, batchLimit) + inFlight.set(fiber, started) + started += exportsEmpty ? 1 : items.length + // `exit` keeps the worker alive if the failure handler itself dies, for + // example when a logger throws. + return Effect.exit(exportBatch(items)).pipe( + Effect.ensuring(Effect.sync(() => { + inFlight.delete(fiber) + if (inFlight.size === 0 && !exportsEmpty && queue.length === 0 && armed.closeUnsafe()) { + wake.openUnsafe() + } + notifyWaiters() + })), + Effect.andThen(workerLoop) + ) }) - // Forked after the shutdown finalizer, so the loop stops before the shutdown flush. - if (Duration.isFinite(exportInterval)) { - yield* Effect.gen(function*() { + const runFork = Effect.runForkWith(services) + // A worker normally claims its batch before `runFork` returns. Stop when it + // has not, so a scheduler that yields first cannot make this loop spin. + const startWorkers = () => { + while (canStart() && inFlight.has(runFork(workerLoop))) { + // keep starting workers + } + } + + // Exports everything accepted so far, or one fresh snapshot, and waits for + // it to settle together with every export already in flight. During cooldown, + // no new export starts, but any surviving in-flight export is still awaited. + const drain: Effect.Effect = Effect.suspend(() => { + if (isStopped()) return awaitSettled(started) + const target = started + (exportsEmpty ? 1 : queue.length) + requested = Math.max(requested, target) + startWorkers() + return awaitSettled(target) + }) + + const timer = Duration.isFinite(exportInterval) + ? runFork(Effect.gen(function*() { while (true) { wake.closeUnsafe() yield* armed.await - yield* Effect.race(Effect.sleep(exportInterval), wake.await) - yield* Fiber.await(yield* FiberSet.run(exportFibers, runExport)) - yield* disarmIfEmpty + const expired = yield* Effect.race( + Effect.as(Effect.sleep(exportInterval), true), + Effect.as(wake.await, false) + ) + if (expired) yield* drain } - }).pipe(Effect.forkIn(scope)) - } - const exportNow = Effect.andThen(runExport, disarmIfEmpty) + })) + : undefined + + // A single finalizer stops the timer, drains, then stops active workers in + // that order even in a parallel scope. Workers are interrupted without + // waiting for them, so shutdown ends at `shutdownTimeout` even if the HTTP + // client is uninterruptible. + yield* Scope.addFinalizer( + scope, + Effect.suspend(() => { + timer?.interruptUnsafe() + return drain.pipe( + Effect.interruptible, + Effect.timeoutOption(options.shutdownTimeout), + Effect.andThen(Effect.sync(() => { + closed = true + MutableList.clear(queue) + notifyWaiters() + for (const fiber of inFlight.keys()) { + fiber.interruptUnsafe() + } + })) + ) + }) + ) const flusher = yield* Flusher - yield* flusher.register(exportNow) + yield* flusher.register(drain) return { push(data) { // With no idle timer, the next push ends the disabled window. - if (isDisabled()) return - buffer.push(data) - if (options.maxBatchSize !== "disabled" && buffer.length >= options.maxBatchSize) { - runExportFork(exportNow) + if (isStopped()) return + if (queue.length >= maxQueueSize) { + options.onDrop?.(1) + return + } + MutableList.append(queue, data) + if (queue.length >= batchLimit) { + startWorkers() } else { armed.openUnsafe() } diff --git a/.repos/effect/packages/effect/src/observability/OtlpLogger.ts b/.repos/effect/packages/effect/src/observability/OtlpLogger.ts index c7ed897a92ff5..ef5872d178398 100644 --- a/.repos/effect/packages/effect/src/observability/OtlpLogger.ts +++ b/.repos/effect/packages/effect/src/observability/OtlpLogger.ts @@ -24,6 +24,7 @@ import type * as LogLevel from "../LogLevel.ts" import * as Option from "../Option.ts" import { CurrentLogAnnotations, CurrentLogSpans } from "../References.ts" import type * as Scope from "../Scope.ts" +import type { Concurrency } from "../Types.ts" import * as Version from "../Version.ts" import * as OtlpEnv from "./internal/otlpEnv.ts" import * as Exporter from "./OtlpExporter.ts" @@ -60,6 +61,11 @@ export const make: ( readonly compression?: "gzip" | "none" | undefined readonly exportInterval?: Duration.Input | undefined readonly maxBatchSize?: number | undefined + /** Maximum pending queued log records (does not include in-flight batches). */ + readonly maxQueueSize?: number | undefined + /** Maximum concurrent export requests, or `"unbounded"`. Defaults to `4`. */ + readonly concurrency?: Concurrency | undefined + readonly onDrop?: ((count: number) => void) | undefined readonly shutdownTimeout?: Duration.Input | undefined readonly excludeLogSpans?: boolean | undefined } @@ -81,6 +87,9 @@ export const make: ( headers: options.headers, compression: options.compression, maxBatchSize: options.maxBatchSize ?? 1000, + maxQueueSize: options.maxQueueSize, + concurrency: options.concurrency, + onDrop: options.onDrop, exportInterval: options.exportInterval ?? Duration.seconds(1), body: (data) => [ serialization.logs({ @@ -132,6 +141,11 @@ export const layer = (options: { readonly compression?: "gzip" | "none" | undefined readonly exportInterval?: Duration.Input | undefined readonly maxBatchSize?: number | undefined + /** Maximum pending queued log records (does not include in-flight batches). */ + readonly maxQueueSize?: number | undefined + /** Maximum concurrent export requests, or `"unbounded"`. Defaults to `4`. */ + readonly concurrency?: Concurrency | undefined + readonly onDrop?: ((count: number) => void) | undefined readonly shutdownTimeout?: Duration.Input | undefined readonly excludeLogSpans?: boolean | undefined readonly mergeWithExisting?: boolean | undefined @@ -161,6 +175,9 @@ export const layerFromConfig = (options?: { readonly attributes?: Record } | undefined readonly headers?: Headers.Input | undefined + /** Maximum concurrent export requests, or `"unbounded"`. Defaults to `4`. */ + readonly concurrency?: Concurrency | undefined + readonly onDrop?: ((count: number) => void) | undefined readonly excludeLogSpans?: boolean | undefined readonly mergeWithExisting?: boolean | undefined }): Layer.Layer => @@ -182,7 +199,8 @@ export const layerFromConfig = (options?: { logsTimeout, exportTimeout, scheduleDelay, - maxBatchSize + maxBatchSize, + maxQueueSize } = yield* Config.all({ baseCompression: Config.option(Config.Literals(["gzip", "none"], "OTEL_EXPORTER_OTLP_COMPRESSION")), compression: Config.option(Config.Literals(["gzip", "none"], "OTEL_EXPORTER_OTLP_LOGS_COMPRESSION")), @@ -190,7 +208,8 @@ export const layerFromConfig = (options?: { logsTimeout: Config.option(Config.Int("OTEL_EXPORTER_OTLP_LOGS_TIMEOUT")), exportTimeout: Config.option(Config.Int("OTEL_BLRP_EXPORT_TIMEOUT")), scheduleDelay: Config.option(Config.Int("OTEL_BLRP_SCHEDULE_DELAY")), - maxBatchSize: Config.option(Config.Int("OTEL_BLRP_MAX_EXPORT_BATCH_SIZE")) + maxBatchSize: Config.option(Config.Int("OTEL_BLRP_MAX_EXPORT_BATCH_SIZE")), + maxQueueSize: Config.option(Config.Int("OTEL_BLRP_MAX_QUEUE_SIZE")) }) const shutdownTimeout = Option.firstSomeOf([logsTimeout, baseTimeout, exportTimeout]).pipe( @@ -205,6 +224,9 @@ export const layerFromConfig = (options?: { compression: Option.getOrElse(Option.firstSomeOf([compression, baseCompression]), () => "none" as const), exportInterval: Option.getOrUndefined(exportInterval), maxBatchSize: Option.getOrUndefined(maxBatchSize), + maxQueueSize: Option.getOrUndefined(maxQueueSize), + concurrency: options?.concurrency, + onDrop: options?.onDrop, shutdownTimeout: Option.getOrUndefined(shutdownTimeout), excludeLogSpans: options?.excludeLogSpans, mergeWithExisting: options?.mergeWithExisting diff --git a/.repos/effect/packages/effect/src/observability/OtlpMetrics.ts b/.repos/effect/packages/effect/src/observability/OtlpMetrics.ts index b1dbaff5b60c0..29aca79431234 100644 --- a/.repos/effect/packages/effect/src/observability/OtlpMetrics.ts +++ b/.repos/effect/packages/effect/src/observability/OtlpMetrics.ts @@ -396,6 +396,8 @@ export const make: (options: { headers: options.headers, compression: options.compression, maxBatchSize: "disabled", + // Each snapshot builds on the last one committed, so they go out one at a time. + concurrency: 1, exportEmpty: true, exportInterval: options.exportInterval ?? Duration.seconds(10), body: snapshot, diff --git a/.repos/effect/packages/effect/src/observability/OtlpTracer.ts b/.repos/effect/packages/effect/src/observability/OtlpTracer.ts index 723306309ab6d..4472ee47e05f0 100644 --- a/.repos/effect/packages/effect/src/observability/OtlpTracer.ts +++ b/.repos/effect/packages/effect/src/observability/OtlpTracer.ts @@ -25,7 +25,7 @@ import * as Layer from "../Layer.ts" import * as Option from "../Option.ts" import type * as Scope from "../Scope.ts" import * as Tracer from "../Tracer.ts" -import type { ExtractTag } from "../Types.ts" +import type { Concurrency, ExtractTag } from "../Types.ts" import * as Version from "../Version.ts" import * as OtlpEnv from "./internal/otlpEnv.ts" import * as Exporter from "./OtlpExporter.ts" @@ -62,6 +62,11 @@ export const make: ( readonly compression?: "gzip" | "none" | undefined readonly exportInterval?: Duration.Input | undefined readonly maxBatchSize?: number | undefined + /** Maximum pending queued spans (does not include in-flight batches). */ + readonly maxQueueSize?: number | undefined + /** Maximum concurrent export requests, or `"unbounded"`. Defaults to `4`. */ + readonly concurrency?: Concurrency | undefined + readonly onDrop?: ((count: number) => void) | undefined readonly context?: ((primitive: Tracer.EffectPrimitive, span: Tracer.AnySpan) => X) | undefined readonly shutdownTimeout?: Duration.Input | undefined } @@ -84,6 +89,9 @@ export const make: ( compression: options.compression, exportInterval: options.exportInterval ?? Duration.seconds(5), maxBatchSize: options.maxBatchSize ?? 1000, + maxQueueSize: options.maxQueueSize, + concurrency: options.concurrency, + onDrop: options.onDrop, body(spans) { const data: TraceData = { resourceSpans: [{ @@ -141,6 +149,11 @@ export const layer: (options: { readonly compression?: "gzip" | "none" | undefined readonly exportInterval?: Duration.Input | undefined readonly maxBatchSize?: number | undefined + /** Maximum pending queued spans (does not include in-flight batches). */ + readonly maxQueueSize?: number | undefined + /** Maximum concurrent export requests, or `"unbounded"`. Defaults to `4`. */ + readonly concurrency?: Concurrency | undefined + readonly onDrop?: ((count: number) => void) | undefined readonly context?: ((primitive: Tracer.EffectPrimitive, span: Tracer.AnySpan) => X) | undefined readonly shutdownTimeout?: Duration.Input | undefined }) => Layer.Layer = flow( @@ -170,6 +183,9 @@ export const layerFromConfig = (options?: { readonly attributes?: Record } | undefined readonly headers?: Headers.Input | undefined + /** Maximum concurrent export requests, or `"unbounded"`. Defaults to `4`. */ + readonly concurrency?: Concurrency | undefined + readonly onDrop?: ((count: number) => void) | undefined readonly context?: ((primitive: Tracer.EffectPrimitive, span: Tracer.AnySpan) => X) | undefined }): Layer.Layer => Effect.gen(function*() { @@ -190,7 +206,8 @@ export const layerFromConfig = (options?: { tracesTimeout, exportTimeout, scheduleDelay, - maxBatchSize + maxBatchSize, + maxQueueSize } = yield* Config.all({ baseCompression: Config.option(Config.Literals(["gzip", "none"], "OTEL_EXPORTER_OTLP_COMPRESSION")), compression: Config.option(Config.Literals(["gzip", "none"], "OTEL_EXPORTER_OTLP_TRACES_COMPRESSION")), @@ -202,7 +219,8 @@ export const layerFromConfig = (options?: { Config.map(Duration.millis) ) ), - maxBatchSize: Config.option(Config.Int("OTEL_BSP_MAX_EXPORT_BATCH_SIZE")) + maxBatchSize: Config.option(Config.Int("OTEL_BSP_MAX_EXPORT_BATCH_SIZE")), + maxQueueSize: Config.option(Config.Int("OTEL_BSP_MAX_QUEUE_SIZE")) }) const shutdownTimeout = Option.firstSomeOf([tracesTimeout, baseTimeout, exportTimeout]).pipe( @@ -216,6 +234,9 @@ export const layerFromConfig = (options?: { compression: Option.getOrElse(Option.firstSomeOf([compression, baseCompression]), () => "none" as const), exportInterval: Option.getOrUndefined(scheduleDelay), maxBatchSize: Option.getOrUndefined(maxBatchSize), + maxQueueSize: Option.getOrUndefined(maxQueueSize), + concurrency: options?.concurrency, + onDrop: options?.onDrop, context: options?.context, shutdownTimeout: Option.getOrUndefined(shutdownTimeout) }) diff --git a/.repos/effect/packages/effect/src/persistence/KeyValueStore.ts b/.repos/effect/packages/effect/src/persistence/KeyValueStore.ts index 9d3d2b4ebe888..5a6ba886da675 100644 --- a/.repos/effect/packages/effect/src/persistence/KeyValueStore.ts +++ b/.repos/effect/packages/effect/src/persistence/KeyValueStore.ts @@ -402,6 +402,8 @@ export const layerMemory: Layer.Layer = Layer.sync(KeyValueStore) }) }) +const utf8Decoder = new TextDecoder("utf-8", { ignoreBOM: true }) + /** * Provides a `KeyValueStore` backed by files in the specified directory. * @@ -446,18 +448,20 @@ export const layerFileSystem = ( return make({ get: (key: string) => withKeyPath("get", key, (path) => - Effect.catchTag( - fs.readFileString(path), - "PlatformError", - (cause) => - cause.reason._tag === "NotFound" ? Effect.undefined : Effect.fail( - new KeyValueStoreError({ - method: "get", - key, - message: `Unable to get item with key ${key}`, - cause - }) - ) + fs.readFile(path).pipe( + Effect.map((bytes) => utf8Decoder.decode(bytes)), + Effect.catchTag( + "PlatformError", + (cause) => + cause.reason._tag === "NotFound" ? Effect.undefined : Effect.fail( + new KeyValueStoreError({ + method: "get", + key, + message: `Unable to get item with key ${key}`, + cause + }) + ) + ) )), getUint8Array: (key: string) => withKeyPath("getUint8Array", key, (path) => @@ -705,7 +709,6 @@ export const layerSql = ( }) const encoder = new TextEncoder() - const decoder = new TextDecoder() const ValueTypeString = 0 const ValueTypeUint8Array = 1 @@ -732,7 +735,7 @@ export const layerSql = ( const row = rows[0] switch (row.value_type) { case ValueTypeString: - return Effect.succeed(decoder.decode(row.value)) + return Effect.succeed(utf8Decoder.decode(row.value)) case ValueTypeUint8Array: return Effect.succeed(Base64.encode(row.value)) default: diff --git a/.repos/effect/packages/effect/src/reactivity/Atom.ts b/.repos/effect/packages/effect/src/reactivity/Atom.ts index f6800e506ca35..ca035623efa69 100644 --- a/.repos/effect/packages/effect/src/reactivity/Atom.ts +++ b/.repos/effect/packages/effect/src/reactivity/Atom.ts @@ -20,7 +20,7 @@ import * as Effect from "../Effect.ts" import * as Exit from "../Exit.ts" import * as Fiber from "../Fiber.ts" import type { LazyArg } from "../Function.ts" -import { constant, constTrue, constVoid, dual, pipe } from "../Function.ts" +import { constant, constTrue, constVoid, dual } from "../Function.ts" import type * as Inspectable from "../Inspectable.ts" import { PipeInspectableProto } from "../internal/core.ts" import { getStackTraceLimit } from "../internal/stackTraceLimit.ts" @@ -924,12 +924,14 @@ function makeStream( } services = Context.add(services, AtomRegistry, ctx.registry) + let emitted = false const run = Effect.scopedWith((scope) => Effect.flatMap(Channel.toPullScoped(stream.channel, scope), (pull) => Effect.whileLoop({ while: constTrue, body: () => pull, step(arr) { + emitted = true ctx.setSelf(AsyncResult.success(Arr.lastNonEmpty(arr), { waiting: true })) @@ -937,24 +939,16 @@ function makeStream( })) ).pipe( Effect.catchCause((cause) => { + const current = ctx.self>() if (Pull.isDoneCause(cause)) { - pipe( - ctx.self>(), - Option.flatMap(AsyncResult.value), - Option.match({ - onNone: () => - ctx.setSelf( - AsyncResult.failWithPrevious(new Cause.NoSuchElementError(), { - previous: ctx.self>() - }) - ), - onSome: (a) => ctx.setSelf(AsyncResult.success(a)) - }) + const value = emitted ? Option.flatMap(current, AsyncResult.value) : Option.none() + ctx.setSelf( + Option.isSome(value) + ? AsyncResult.success(value.value) + : AsyncResult.failWithPrevious(new Cause.NoSuchElementError(), { previous: current }) ) } else { - ctx.setSelf(AsyncResult.failureWithPrevious(cause as Cause.Cause, { - previous: ctx.self>() - })) + ctx.setSelf(AsyncResult.failureWithPrevious(cause as Cause.Cause, { previous: current })) } return Effect.void }) @@ -1052,9 +1046,9 @@ const makeSubRef = ( function write(ctx: WriteContext>, value: any) { const ref = ctx.get(refAtom) if (SubscriptionRef.isSubscriptionRef(ref)) { - Effect.runSync(SubscriptionRef.set(ref, value)) + Effect.runFork(SubscriptionRef.set(ref, value)) } else if (AsyncResult.isSuccess(ref)) { - Effect.runSync(SubscriptionRef.set(ref.value, value)) + Effect.runFork(SubscriptionRef.set(ref.value, value)) } } return writable((get) => { diff --git a/.repos/effect/packages/effect/src/rpc/RpcClient.ts b/.repos/effect/packages/effect/src/rpc/RpcClient.ts index fe12c97cd396b..d4667739ac024 100644 --- a/.repos/effect/packages/effect/src/rpc/RpcClient.ts +++ b/.repos/effect/packages/effect/src/rpc/RpcClient.ts @@ -994,6 +994,31 @@ const makeProtocolHttpUnbatched = (client: HttpClient.HttpClient) => } })) +const withBatchSpan = (effect: Effect.Effect, requests: ReadonlyArray) => { + const links: Array = [] + const seen = new Set() + let sampled = false + for (const request of requests) { + if (request.traceId === undefined || request.spanId === undefined || seen.has(request.spanId)) continue + seen.add(request.spanId) + const span = Tracer.externalSpan({ traceId: request.traceId, spanId: request.spanId, sampled: request.sampled }) + sampled ||= span.sampled + links.push({ span, attributes: {} }) + } + if (links.length === 0) return effect + return Effect.withSpan(effect, "RpcClient.batch", { + root: true, + sampled, + links, + attributes: { batchSize: requests.length }, + captureStackTrace: false + }).pipe( + // Do not let the opener's tracing settings suppress tracing for other callers. + Effect.provideService(Tracer.DisablePropagation, false), + Effect.withTracerEnabled(true) + ) +} + const makeProtocolHttpBatched = Effect.fnUntraced(function*(client: HttpClient.HttpClient, options: { readonly window: Duration.Input readonly maxSize?: number | undefined @@ -1031,7 +1056,7 @@ const makeProtocolHttpBatched = Effect.fnUntraced(function*(client: HttpClient.H Effect.raceFirst(Effect.sleep(window), batch.full.await).pipe( Effect.andThen(Effect.suspend(() => { closeBatch(clientId, batch) - return exchange.send(clientId, batch.requests) + return withBatchSpan(exchange.send(clientId, batch.requests), batch.requests) })), Effect.onExit((exit) => { closeBatch(clientId, batch) diff --git a/.repos/effect/packages/effect/src/rpc/RpcGroup.ts b/.repos/effect/packages/effect/src/rpc/RpcGroup.ts index 5d1b93cf2b3ab..8739c94bdd7ae 100644 --- a/.repos/effect/packages/effect/src/rpc/RpcGroup.ts +++ b/.repos/effect/packages/effect/src/rpc/RpcGroup.ts @@ -15,7 +15,7 @@ import * as Effect from "../Effect.ts" import { identity } from "../Function.ts" import type { Headers } from "../http/Headers.ts" import * as Layer from "../Layer.ts" -import type { Pipeable } from "../Pipeable.ts" +import { type Pipeable, pipeArguments } from "../Pipeable.ts" import type * as Queue from "../Queue.ts" import type * as Record from "../Record.ts" import type { Scope } from "../Scope.ts" @@ -394,6 +394,9 @@ const RpcGroupProto = { requests, annotations: this.annotations }) + }, + pipe() { + return pipeArguments(this, arguments) } } diff --git a/.repos/effect/packages/effect/src/sql/Migrator.ts b/.repos/effect/packages/effect/src/sql/Migrator.ts index e697e3837f42d..821fb333f9688 100644 --- a/.repos/effect/packages/effect/src/sql/Migrator.ts +++ b/.repos/effect/packages/effect/src/sql/Migrator.ts @@ -271,16 +271,7 @@ ORDER BY migration_id`, orElse: () => Effect.void }) - const [latestMigrationId, current] = yield* Effect.all([ - Effect.map( - latestMigration, - Option.match({ - onNone: () => 0, - onSome: (_) => _.id - }) - ), - loader - ]) + const [latest, current] = yield* Effect.all([latestMigration, loader]) if (new Set(current.map(([id]) => id)).size !== current.length) { return yield* new MigrationError({ @@ -293,7 +284,7 @@ ORDER BY migration_id`, for (const resolved of current) { const [currentId, currentName] = resolved - if (currentId <= latestMigrationId) { + if (Option.isSome(latest) && currentId <= latest.value.id) { continue } diff --git a/.repos/effect/packages/effect/src/sql/SqlClient.ts b/.repos/effect/packages/effect/src/sql/SqlClient.ts index efad5ac22fb72..e01e823381771 100644 --- a/.repos/effect/packages/effect/src/sql/SqlClient.ts +++ b/.repos/effect/packages/effect/src/sql/SqlClient.ts @@ -746,16 +746,22 @@ export const makeWithTransaction = (options: { Effect.flatMap(() => { const level = [conn, id] as const afterCommitBuffers.set(level, buffer) + const transactionContext = services.pipe( + Context.add(options.transactionService, level), + Context.add(CurrentTransactionService, options.transactionService), + reactivity ? Context.add(Reactivity, deferInvalidations(reactivity)) : identity, + Context.add(transactionSemaphore, Semaphore.makeUnsafe(1)), + Context.add(Tracer.ParentSpan, span) + ) return Effect.onExitPrimitive( - Effect.provideContext( + Effect.updateContext( restore(effect), - services.pipe( - Context.add(options.transactionService, level), - Context.add(CurrentTransactionService, options.transactionService), - reactivity ? Context.add(Reactivity, deferInvalidations(reactivity)) : identity, - Context.add(transactionSemaphore, Semaphore.makeUnsafe(1)), - Context.add(Tracer.ParentSpan, span) - ) + // `transactionContext` already extends `services`, so merging it + // into an unchanged fiber context would only copy every service. + (current: Context.Context) => + (current === services + ? transactionContext + : Context.merge(current, transactionContext)) as Context.Context ), (exit) => { buffer.open = false diff --git a/.repos/effect/packages/effect/src/workflow/Activity.ts b/.repos/effect/packages/effect/src/workflow/Activity.ts index fbd0237887b90..7294feb9b2e0e 100644 --- a/.repos/effect/packages/effect/src/workflow/Activity.ts +++ b/.repos/effect/packages/effect/src/workflow/Activity.ts @@ -21,6 +21,7 @@ import type { Scope } from "../Scope.ts" import type * as Types from "../Types.ts" import * as DurableDeferred from "./DurableDeferred.ts" import { makeHashDigest } from "./internal/crypto.ts" +import { RetryingExecution } from "./internal/retry.ts" import * as Workflow from "./Workflow.ts" import type { WorkflowEngine, WorkflowInstance } from "./WorkflowEngine.ts" @@ -220,6 +221,12 @@ const retryOnInterrupt = ( * Retries an effect with `Effect.retry` while updating `CurrentAttempt` for * each attempt. * + * **Details** + * + * Under `Workflow.SuspendOnFailure`, failed attempts reach the retry policy + * instead of suspending immediately. If the policy is exhausted and the error + * escapes, the workflow suspends and `resume` replays the stored failures. + * * @stability unstable * @category error handling * @since 4.0.0 @@ -235,9 +242,12 @@ export const retry: { } = dual( 2, (effect: Effect.Effect, options: {}) => - Effect.suspend(() => { + Effect.contextWith((context: Context.Context) => { let attempt = 1 - return Effect.suspend(() => Effect.provideService(effect, CurrentAttempt, attempt++)).pipe(Effect.retry(options)) + return Effect.suspend(() => Effect.provideService(effect, CurrentAttempt, attempt++)).pipe( + Effect.provideService(RetryingExecution, Context.getOrUndefined(context, InstanceTag)?.executionId), + Effect.retry(options) + ) }) ) @@ -332,11 +342,13 @@ const makeExecute = Effect.fnUntraced(function*< const attempt = yield* CurrentAttempt yield* Effect.annotateCurrentSpan({ executionId: instance.executionId }) const result = yield* Workflow.wrapActivityResult( - engine.activityExecute(activity, attempt), + Effect.map(engine.activityExecute(activity, attempt), (result) => { + if (result._tag === "Suspended" && result.failed) instance.failed = true + return result + }), (_) => _._tag === "Suspended" ) if (result._tag === "Suspended") { - if (result.failed) instance.failed = true return yield* Workflow.suspend(instance) } return yield* result.exit diff --git a/.repos/effect/packages/effect/src/workflow/Workflow.ts b/.repos/effect/packages/effect/src/workflow/Workflow.ts index d2d19fe065ec7..8b1dee3d48e54 100644 --- a/.repos/effect/packages/effect/src/workflow/Workflow.ts +++ b/.repos/effect/packages/effect/src/workflow/Workflow.ts @@ -31,6 +31,8 @@ import * as SchemaParser from "../SchemaParser.ts" import * as Tranformation from "../SchemaTransformation.ts" import * as Scope from "../Scope.ts" import { makeHashDigest } from "./internal/crypto.ts" +import { RetryingExecution } from "./internal/retry.ts" +import { isScopeAbandoned, markScopeAbandoned } from "./internal/scope.ts" import type { WorkflowEngine, WorkflowInstance } from "./WorkflowEngine.ts" const TypeId = "~effect/workflow/Workflow" @@ -84,18 +86,14 @@ export interface Workflow< * `discard: true` returns the execution ID without waiting for the result. * The child remains linked to its parent for completion wakes and interruption. * - * With `discard: true, detached: true`, the child neither wakes its parent - * nor gets interrupted with it. The cluster engine retains the parent for - * observability. + * With `discard: true, detached: true`, that call does not register the caller + * for completion wakes or interruption linkage. A later non-detached call for + * the same execution still registers its caller for a completion wake. The + * cluster engine retains the parent for observability. * * Inside a workflow, an awaited child that is interrupted fails the parent * with a defect rather than an interrupt, so the parent can recover with * `Effect.catchDefect` or `Effect.exit`. - * - * **Gotchas** - * - * Do not await a detached execution later. Executing the same payload joins - * it, but its completion will not wake the awaiting workflow. */ readonly execute: ( payload: Payload["~type.make.in"], @@ -375,7 +373,9 @@ const Proto = { ) { return Effect.suspend(() => { const payload = this.payloadSchema.make(fields) - const run = Effect.flatMap( + // Register with the parent before the execution id is computed, so a + // sibling that suspends first waits for this child to be dispatched. + return withPendingActivity(Effect.flatMap( EngineTag, (engine) => Effect.flatMap(makeExecutionIdFromPayload(this, payload), (executionId) => @@ -389,10 +389,7 @@ const Proto = { suspendedRetrySchedule: this.suspendedRetrySchedule }) )) - ) - // Register with the parent before the execution id is computed, so a - // sibling that suspends first waits for this child to be dispatched. - return opts?.discard ? run : withPendingActivity(run) + )) }).pipe( Effect.withSpan( `${this._tag}.execute`, @@ -715,7 +712,9 @@ export const intoResult = ( Effect.contextWith((context: Context.Context) => { const instance = Context.get(context, InstanceTag) const captureDefects = Context.get(instance.workflow.annotations, CaptureDefects) - const suspendOnFailure = Context.get(instance.workflow.annotations, SuspendOnFailure) + // Inside `Activity.retry` a failure goes to the retry policy instead. + const suspendOnFailure = Context.get(instance.workflow.annotations, SuspendOnFailure) && + Context.get(context, RetryingExecution) !== instance.executionId return effect.pipe( Effect.forkChild({ startImmediately: true }), // The outer uninterruptible region protects the fork and cancellation hook. @@ -749,6 +748,11 @@ export const intoResult = ( const filtered = reasons.length === 0 ? cause : Cause.fromReasons(reasons) const abandoned = instance.abandoned && !instance.interrupted && hasInterruptsOnly instance.abandoned = abandoned + if (abandoned) { + // Superseded instances can share this scope, which closes before + // the engine marks its parent. + markScopeAbandoned(instance.scope) + } if (instance.suspended && hasInterruptsOnly && !abandoned) { return Effect.succeed( new Suspended(instance.failed ? { cause: instance.cause, failed: true } : { cause: instance.cause }) @@ -767,14 +771,27 @@ export const intoResult = ( } }), (eff) => - Effect.onExitPrimitive(eff, (exit) => { - if (Exit.isFailure(exit)) { - return Scope.close(instance.scope, exit) - } else if (exit.value._tag === "Complete") { - return Scope.close(instance.scope, exit.value.exit) - } - return Effect.void - }, true), + Effect.onExitPrimitive( + eff, + (exit) => Exit.isFailure(exit) ? Scope.close(instance.scope, exit) : undefined, + true + ), + Effect.flatMap((result): Effect.Effect> => { + if (result._tag !== "Complete") { + return Effect.succeed(result) + } + const close = Effect.as(Scope.close(instance.scope, result.exit), result) + return captureDefects + ? Effect.catchCauseIf(close, Cause.hasDies, (closeCause) => + Effect.succeed( + new Complete({ + exit: Exit.failCause( + Exit.isFailure(result.exit) ? Cause.combine(result.exit.cause, closeCause) : closeCause + ) + }) + )) + : close + }), Effect.uninterruptible ) }) @@ -796,23 +813,22 @@ export const wrapActivityResult = ( return Effect.acquireUseRelease( Effect.sync(() => adoptActivityUnsafe(context, instance) ?? registerActivityUnsafe(instance)), () => effect, - (registration, exit) => { - releaseActivityUnsafe(registration) - const isSuspended = Exit.isSuccess(exit) && isSuspend(exit.value) - if ( - Exit.isSuccess(exit) && - isResult(exit.value) && - exit.value._tag === "Suspended" && - exit.value.cause - ) { - instance.cause = instance.cause - ? Cause.combine(instance.cause, exit.value.cause) - : exit.value.cause - } - return isSuspended && instance.activityState.count > 0 - ? waitForZero(instance) - : Effect.void - } + (registration, exit) => + Effect.sync(() => { + releaseActivityUnsafe(registration) + if ( + Exit.isSuccess(exit) && + isResult(exit.value) && + exit.value._tag === "Suspended" && + exit.value.cause + ) { + instance.cause = instance.cause + ? Cause.combine(instance.cause, exit.value.cause) + : exit.value.cause + } + }) + ).pipe( + Effect.tap((value) => isSuspend(value) ? waitForZero(instance) : Effect.void) ) }) @@ -856,9 +872,9 @@ const releaseActivityUnsafe = (registration: ActivityRegistration) => { } /** - * Registers a pending child workflow execution with the current workflow - * instance before any asynchronous work runs. `wrapActivityResult` adopts the - * registration once the execution is dispatched. + * Registers a pending child workflow with the current instance before async + * work runs. Awaited starts are adopted by `wrapActivityResult`; discarded + * starts release when dispatch returns. */ const withPendingActivity = (effect: Effect.Effect): Effect.Effect => Effect.contextWith((context: Context.Context) => { @@ -941,7 +957,10 @@ export const addFinalizer: ( const services = yield* Effect.context() yield* Scope.addFinalizerExit( instance.scope, - (exit) => instance.abandoned ? Effect.void : Effect.provideContext(f(exit), services) + (exit) => + instance.abandoned || isScopeAbandoned(instance.scope) + ? Effect.void + : Effect.provideContext(f(exit), services) ) }) @@ -1024,7 +1043,12 @@ export const CaptureDefects = Context.Reference( * * **Details** * - * The suspended execution can later be resumed with the workflow's `resume` method, for example `MyWorkflow.resume(executionId)`. + * The suspended execution can later be resumed with the workflow's `resume` + * method, for example `MyWorkflow.resume(executionId)`. + * + * Inside `Activity.retry`, failed attempts reach the retry policy instead of + * suspending immediately; if the policy is exhausted and the error escapes, + * the workflow suspends and `resume` replays the stored failures. * * @stability unstable * @category services diff --git a/.repos/effect/packages/effect/src/workflow/WorkflowEngine.ts b/.repos/effect/packages/effect/src/workflow/WorkflowEngine.ts index 712367c390acf..55689bfa2a407 100644 --- a/.repos/effect/packages/effect/src/workflow/WorkflowEngine.ts +++ b/.repos/effect/packages/effect/src/workflow/WorkflowEngine.ts @@ -27,6 +27,8 @@ import * as Semaphore from "../Semaphore.ts" import type * as Activity from "./Activity.ts" import type { DurableClock } from "./DurableClock.ts" import type * as DurableDeferred from "./DurableDeferred.ts" +import { RetryingExecution } from "./internal/retry.ts" +import { reuseOrForkScope } from "./internal/scope.ts" import * as Workflow from "./Workflow.ts" /** @@ -551,8 +553,16 @@ export const makeUnsafe = (options: Encoded): WorkflowEngine["Service"] => yield* Effect.annotateCurrentSpan({ executionId }) let result = Option.none>() - // link interruption with parent workflow const parentInstance = yield* Effect.serviceOption(WorkflowInstance) + if ( + !opts.discard && + Option.isSome(parentInstance) && + parentInstance.value.workflow._tag === self._tag && + parentInstance.value.executionId === executionId + ) { + return yield* Effect.die(`${self._tag}.execute: execution "${executionId}" cannot await itself`) + } + // link interruption with parent workflow if (Option.isSome(parentInstance) && !opts.detached) { const instance = parentInstance.value yield* Effect.addFinalizer(() => { @@ -748,7 +758,7 @@ export const layerMemory: Layer.Layer = Layer.effect(WorkflowEng payload: object, executionId: string ) => Effect.Effect - readonly parent: string | undefined + readonly parents: Set instance: WorkflowInstance["Service"] interrupted: boolean interruptedUnsafe: boolean @@ -809,10 +819,10 @@ export const layerMemory: Layer.Layer = Layer.effect(WorkflowEng state.scope = Scope.makeUnsafe() } const executionScope = state.scope - // Like the cluster engine, each run gets a fresh scope, so replays rebuild - // compensations instead of registering them again. + // A superseded instance retained by a finalizer no longer needs its wait set. + state.instance.awaitedDeferreds.clear() const instance = WorkflowInstance.initial(state.instance.workflow, state.instance.executionId, { - scope: Scope.forkUnsafe(executionScope) + scope: reuseOrForkScope(state.instance.scope, executionScope) }) state.instance = instance state.fiber = yield* state.execute(state.payload, state.instance.executionId).pipe( @@ -835,23 +845,33 @@ export const layerMemory: Layer.Layer = Layer.effect(WorkflowEng // Deferred wakes interrupt only the body, so `intoResult` still reports `Suspended`. (effect) => deferredState.trackRun(instance, effect), Workflow.intoResult, + // Clear any retry region inherited from the caller or child fiber that started or woke this run. + Effect.provideService(RetryingExecution, undefined), Effect.provideService(WorkflowInstance, instance), Effect.provideService(WorkflowEngine, engine), - Effect.tap((result) => { - if (!state.parent || result._tag !== "Complete") { - return Effect.void - } - return Effect.forkIn(resume(state.parent, "automatic"), scope) - }), Effect.onExit((exit) => { if (Exit.isSuccess(exit) && exit.value._tag === "Suspended") return Effect.void // The final run's scope closes with the real exit. Closing the parent // then closes earlier scopes in reverse order with `Exit.void`, so their // superseded compensations are skipped, which means their finalizers // also observe success rather than the outcome. - return Effect.andThen( - Scope.close(executionScope, Exit.void), - Exit.isSuccess(exit) && exit.value._tag === "Complete" ? Deferred.succeed(state.done, void 0) : Effect.void + const close = Scope.close(executionScope, Exit.void) + if (Exit.isFailure(exit)) return close + // Wake parents only after the fiber exits so `poll` already observes + // `Complete` and joins during finalization are included. + const wakeParents = (fiber: Fiber.Fiber) => + Fiber.await(fiber).pipe( + Effect.flatMap(() => + Effect.forEach(state.parents, (parent) => Effect.forkIn(resume(parent, "automatic"), scope), { + discard: true + }) + ), + Effect.forkIn(scope) + ) + return close.pipe( + Effect.andThen(Deferred.succeed(state.done, void 0)), + // A dying finalizer must not strand parents; they observe the defect. + Effect.ensuring(Effect.withFiber(wakeParents)) ) }), Effect.forkIn(entry.scope) @@ -876,6 +896,7 @@ export const layerMemory: Layer.Layer = Layer.effect(WorkflowEng return yield* Effect.orDie(Effect.fail(`Workflow ${workflow._tag} is not registered`)) } + const parentId = options.detached ? undefined : options.parent?.executionId let state = executions.get(options.executionId) if (!state) { state = { @@ -888,10 +909,12 @@ export const layerMemory: Layer.Layer = Layer.effect(WorkflowEng fiber: undefined, done: Deferred.makeUnsafe(), scope: Scope.makeUnsafe(), - parent: options.detached ? undefined : options.parent?.executionId + parents: new Set(parentId === undefined ? [] : [parentId]) } executions.set(options.executionId, state) yield* resume(options.executionId, "explicit") + } else if (parentId !== undefined) { + state.parents.add(parentId) } if (options.discard) return // Capture together so a wake that swaps in a replay cannot desync them. diff --git a/.repos/effect/packages/effect/src/workflow/internal/retry.ts b/.repos/effect/packages/effect/src/workflow/internal/retry.ts new file mode 100644 index 0000000000000..e128a1902e1eb --- /dev/null +++ b/.repos/effect/packages/effect/src/workflow/internal/retry.ts @@ -0,0 +1,12 @@ +import * as Context from "../../Context.ts" +import { constUndefined } from "../../Function.ts" + +/** + * The id of the execution whose `Activity.retry` the current fiber is inside. + * + * @internal + */ +export const RetryingExecution = Context.Reference( + "effect/workflow/Activity/RetryingExecution", + { defaultValue: constUndefined } +) diff --git a/.repos/effect/packages/effect/src/workflow/internal/scope.ts b/.repos/effect/packages/effect/src/workflow/internal/scope.ts new file mode 100644 index 0000000000000..4e9d5b32fa152 --- /dev/null +++ b/.repos/effect/packages/effect/src/workflow/internal/scope.ts @@ -0,0 +1,36 @@ +import * as Scope from "../../Scope.ts" + +const abandonedScopes = new WeakSet() + +/** + * Marks `scope` and its direct children as abandoned, so engines need not + * retain the instances of the runs under it. + * + * @internal + */ +export const markScopeAbandoned = (scope: Scope.Scope): void => { + abandonedScopes.add(scope) +} + +/** + * Reports whether `scope` or its parent scope was marked abandoned. + * + * @internal + */ +export const isScopeAbandoned = (scope: Scope.Scope): boolean => + abandonedScopes.has(scope) || (scope.parent !== undefined && abandonedScopes.has(scope.parent)) + +/** + * Reuses `prev` while it is still an empty child of `parent`, so replays that + * register nothing do not grow `parent`. Otherwise forks a fresh child, which + * keeps a superseded run's compensations apart from the next run's. + * + * @internal + */ +export const reuseOrForkScope = ( + prev: Scope.Closeable | undefined, + parent: Scope.Scope +): Scope.Closeable => + prev !== undefined && prev.parent === parent && prev.state._tag === "Empty" + ? prev + : Scope.forkUnsafe(parent) diff --git a/.repos/effect/packages/effect/test/Channel.test.ts b/.repos/effect/packages/effect/test/Channel.test.ts index 57198f20d94f5..c690871d06e6a 100644 --- a/.repos/effect/packages/effect/test/Channel.test.ts +++ b/.repos/effect/packages/effect/test/Channel.test.ts @@ -359,6 +359,28 @@ describe("Channel", () => { ).pipe(Channel.runDrain, Effect.exit) assert.deepStrictEqual(result, Exit.die("release failure")) })) + + it.effect("acquireUseRelease releases before Done under toPullScoped when ending on its own", () => + Effect.gen(function*() { + const log: Array = [] + const pull = yield* Channel.toPullScoped( + Channel.acquireUseRelease( + Effect.sync(() => { + log.push("acquire") + return 1 + }), + (n) => Channel.succeed(n), + () => + Effect.sync(() => { + log.push("release") + }) + ), + yield* Effect.scope + ) + assert.strictEqual(yield* pull, 1) + assert.deepStrictEqual(yield* Effect.exit(pull), Exit.fail(Cause.Done())) + assert.deepStrictEqual(log, ["acquire", "release"]) + })) }) describe("destructors", () => { diff --git a/.repos/effect/packages/effect/test/DateTime.test.ts b/.repos/effect/packages/effect/test/DateTime.test.ts index f14edd62e35b3..fa1d3749615d8 100644 --- a/.repos/effect/packages/effect/test/DateTime.test.ts +++ b/.repos/effect/packages/effect/test/DateTime.test.ts @@ -411,6 +411,25 @@ describe("DateTime", () => { }) strictEqual(updated.toJSON(), "2023-06-25T00:00:00.000Z") }) + + it("preserves valid offset across DST transitions", () => { + const secondOneThirty = DateTime.makeZonedUnsafe("2025-11-02T06:30:15.250Z", { + timeZone: "America/New_York" + }) + strictEqual( + DateTime.formatIso(DateTime.setParts(secondOneThirty, { second: 0, millisecond: 0 })), + "2025-11-02T06:30:00.000Z" + ) + const afterRepeated = DateTime.makeZonedUnsafe("2025-11-02T08:30:15.250Z", { + timeZone: "America/New_York" + }) + strictEqual(DateTime.formatIso(DateTime.setParts(afterRepeated, { hour: 1 })), "2025-11-02T06:30:15.250Z") + strictEqual(DateTime.formatIso(DateTime.setParts(secondOneThirty, { day: 1 })), "2025-11-01T05:30:15.250Z") + const afterGap = DateTime.makeZonedUnsafe("2025-03-10T06:30:15.250Z", { + timeZone: "America/New_York" + }) + strictEqual(DateTime.formatIso(DateTime.setParts(afterGap, { day: 9 })), "2025-03-09T07:30:15.250Z") + }) }) describe("formatIso", () => { diff --git a/.repos/effect/packages/effect/test/Effect.test.ts b/.repos/effect/packages/effect/test/Effect.test.ts index 5d89de259b264..7d0928824ca1f 100644 --- a/.repos/effect/packages/effect/test/Effect.test.ts +++ b/.repos/effect/packages/effect/test/Effect.test.ts @@ -5187,6 +5187,10 @@ describe("Effect", () => { readonly reason: RateLimitError | QuotaExceededError }> {} + class OtherError extends Data.TaggedError("OtherError")<{ + readonly message: string + }> {} + it.effect("catches with object handlers", () => Effect.gen(function*() { const result = yield* Effect.fail( @@ -5255,6 +5259,24 @@ describe("Effect", () => { Exit.failCause(Cause.combine(Cause.die(error), Cause.die("finalizer failure"))) ) })) + + it.effect("empty handlers with a failing orElse behave like unwrapReason", () => + Effect.gen(function*() { + const reason = new RateLimitError({ retryAfter: 60 }) + const program = Effect.fail(new AiError({ reason })) as Effect.Effect + const exit = yield* program.pipe( + Effect.catchReasons("AiError", {}, (reason) => reason), + Effect.exit + ) + assertExitFailure(exit, Cause.fail(reason)) + assert.deepStrictEqual(exit, yield* Effect.exit(Effect.unwrapReason(program, "AiError"))) + const other = new OtherError({ message: "test" }) + const otherExit = yield* (Effect.fail(other) as Effect.Effect).pipe( + Effect.catchReasons("AiError", {}, (reason) => reason), + Effect.exit + ) + assertExitFailure(otherExit, Cause.fail(other)) + })) }) describe("unwrapReason", () => { diff --git a/.repos/effect/packages/effect/test/Equal.test.ts b/.repos/effect/packages/effect/test/Equal.test.ts index 1cf1568c273e9..1addee143e9f7 100644 --- a/.repos/effect/packages/effect/test/Equal.test.ts +++ b/.repos/effect/packages/effect/test/Equal.test.ts @@ -82,6 +82,48 @@ describe("Equal.equals", () => { assert.isFalse(Equal.equals(p1, q1)) }) + it("keeps differently unrolled plain cycles consistent with Hash and HashMap", () => { + const makeRing = (size: number) => { + const nodes: Array<{ next?: unknown }> = Array.from({ length: size }, () => ({})) + for (let i = 0; i < size; i++) nodes[i].next = nodes[(i + 1) % size] + return nodes[0] + } + const makeShared = (size: number) => { + const a = makeRing(size) + return [a, { next: a.next }] as const + } + const k = Symbol("x") + const j = Symbol("x") + const wrap = (v: object) => ({ [k]: v, [j]: v }) + + const pairs = [ + () => [makeRing(1), makeRing(2)] as const, + () => [makeRing(37), makeRing(41)] as const, + () => { + const a: Array = [] + a.push(a) + const b1: Array = [] + b1.push([b1]) + return [a, b1] as const + }, + () => makeShared(2), + () => { + const [a, b] = makeShared(1) + return [wrap(a), wrap(b)] as const + } + ] + for (const make of pairs) { + for (const prehash of ["none", "left", "right", "both"] as const) { + const [a, b] = make() + if (prehash === "left" || prehash === "both") Hash.hash(a) + if (prehash === "right" || prehash === "both") Hash.hash(b) + assert.isFalse(Equal.equals(a, b), prehash) + assert.isFalse(Equal.equals(b, a), prehash) + assert.isFalse(HashMap.has(HashMap.make([a, 1]), b), prehash) + } + } + }) + it("agrees with bisimilarity on random cyclic graphs", () => { // Compute the greatest bisimulation by eliminating invalid pairs. const bisimilar = (left: Spec, right: Spec): ReadonlyArray> => { @@ -154,6 +196,58 @@ describe("Equal.equals", () => { expect(Equal.equals(obj1, obj2)).toBe(false) }) + it("reads fresh plain objects once and avoids exponential traversal on shared acyclic graphs", () => { + let reads = 0 + const leaf = () => ({ + get v() { + reads++ + return 1 + } + }) + const dag = (tag: number) => { + let node: unknown = leaf() + for (let i = 0; i < 14; i++) node = { l: node, r: node } + return { dag: node, tag } + } + + assert.isTrue(Equal.equals(leaf(), leaf())) + assert.strictEqual(reads, 2) + + reads = 0 + assert.isFalse(Equal.equals(dag(0), dag(1))) + assert.strictEqual(reads, 2) + + reads = 0 + assert.isTrue(Equal.equals(dag(0), dag(0))) + assert.strictEqual(reads, 2) + + reads = 0 + let a: unknown = leaf(), b1: unknown = leaf(), b2: unknown = leaf() + for (let i = 0; i < 14; i++) { + a = { l: a, r: a } + ;[b1, b2] = [{ l: b1, r: b2 }, { l: b2, r: b1 }] + } + assert.isTrue(Equal.equals(a, b1)) + assert.strictEqual(reads, 4) + }) + + it("does not equate plain objects with built-ins that override constructor", () => { + const record = { constructor: Object } + const set = Object.assign(new Set(), record) + assert.isFalse(Equal.equals(record, set)) + assert.isFalse(Equal.equals(set, record)) + }) + + it("includes inherited properties on objects with custom plain prototypes", () => { + const p1 = Object.create({ type: "p" }) + const p2 = Object.create({ type: "p" }) + const q = Object.create({ type: "q" }) + assert.isTrue(Equal.equals(p1, p2)) + assert.strictEqual(Hash.hash(p1), Hash.hash(p2)) + assert.isFalse(Equal.equals(p1, q)) + assert.isFalse(Equal.equals(p1, {})) + }) + // The protocol keys are strings, so data can carry them without implementing the protocols. it("should compare non-callable protocol keys as data", () => { for (const key of [Equal.symbol, Hash.symbol]) { @@ -382,6 +476,18 @@ describe("Equal.equals", () => { const arr2 = [1, 2] expect(Equal.equals(arr1, arr2)).toBe(false) }) + + it("compares arrays by index consistently while keeping Hash.array iterable-based", () => { + const a = Object.assign([1], { + *[Symbol.iterator]() { + yield 2 + } + }) + assert.isTrue(Equal.equals(a, [1])) + assert.strictEqual(Hash.hash(a), Hash.hash([1])) + assert.isTrue(Equal.equals(a, [1])) + assert.strictEqual(Hash.array(a), Hash.array([...a])) + }) }) describe("primitives", () => { @@ -424,6 +530,20 @@ describe("Equal.equals", () => { it("should compare invalid dates without throwing", () => { expect(Equal.equals(new Date(NaN), new Date(NaN))).toBe(true) }) + + it("keeps dates with custom methods consistent with Hash", () => { + const customIso = Object.assign(new Date(0), { toISOString: () => "custom" }) + const plain = new Date(0) + assert.isFalse(Equal.equals(customIso, plain)) + assert.isFalse(Equal.equals(plain, customIso)) + assert.notStrictEqual(Hash.hash(customIso), Hash.hash(plain)) + + const customTime = Object.assign(new Date(0), { getTime: () => 1000 }) + const later = new Date(1000) + assert.isFalse(Equal.equals(customTime, later)) + assert.isFalse(Equal.equals(later, customTime)) + assert.notStrictEqual(Hash.hash(customTime), Hash.hash(later)) + }) }) describe("ArrayBuffer objects", () => { @@ -506,6 +626,22 @@ describe("Equal.equals", () => { expect(Equal.equals(point1, point2)).toBe(true) }) + it("respects Hash-only implementations using reference hashing", () => { + class RefHashed implements Hash.Hash { + constructor(readonly x: number) {} + [Hash.symbol](): number { + return Hash.random(this) + } + } + + const a = new RefHashed(1) + const b = new RefHashed(1) + assert.isTrue(Equal.equals(a, a)) + assert.isFalse(Equal.equals(a, b)) + assert.isFalse(Equal.equals(a, { x: 1 })) + assert.isFalse(Equal.equals({ x: 1 }, a)) + }) + it("clears visited state when a custom Equal throws", () => { let throws = true class Flaky implements Equal.Equal { diff --git a/.repos/effect/packages/effect/test/Fiber.test.ts b/.repos/effect/packages/effect/test/Fiber.test.ts index 281ac215e424b..6b850e0435468 100644 --- a/.repos/effect/packages/effect/test/Fiber.test.ts +++ b/.repos/effect/packages/effect/test/Fiber.test.ts @@ -1,5 +1,5 @@ import { assert, describe, it } from "@effect/vitest" -import { Cause, Context, Deferred, Effect, Exit, Fiber, Latch, References, Result, Scope } from "effect" +import { Cause, Context, Deferred, Effect, Exit, Fiber, Latch, References, Result, type Scheduler, Scope } from "effect" describe("Fiber", () => { for (const name of ["await", "join", "awaitAll"] as const) { @@ -288,4 +288,36 @@ describe("Fiber", () => { assert.isTrue(Exit.hasInterrupts(exit)) assert.deepStrictEqual(events, ["acquired", "finalizer-start", "finalizer-end", "awaited"]) })) + + it("does not lose interruption on a deferred fiber when interrupt evaluation yields", () => { + const tasks: Array<() => void> = [] + const scheduler: Scheduler.Scheduler = { + executionMode: "sync", + shouldYield: (fiber) => fiber.currentOpCount === 1, + makeDispatcher: () => ({ + scheduleTask: (task) => { + tasks.push(task) + }, + flush() {} + }) + } + + let childRan = false + let child!: Fiber.Fiber + const main = Effect.runFork( + Effect.gen(function*() { + child = yield* Effect.forkChild(Effect.sync(() => { + childRan = true + })) + yield* Fiber.interrupt(child) + }), + { scheduler } + ) + + while (tasks.length > 0) tasks.shift()!() + + assert.isFalse(childRan) + assert.isTrue(Exit.hasInterrupts(child.pollUnsafe()!)) + assert.deepStrictEqual(main.pollUnsafe(), Exit.void) + }) }) diff --git a/.repos/effect/packages/effect/test/LayerRef.test.ts b/.repos/effect/packages/effect/test/LayerRef.test.ts index c1f3d3dd8df6b..179e000b3c93c 100644 --- a/.repos/effect/packages/effect/test/LayerRef.test.ts +++ b/.repos/effect/packages/effect/test/LayerRef.test.ts @@ -77,6 +77,56 @@ describe("LayerRef", () => { assert.deepStrictEqual(released, [1, 2]) })) + it.live("invalidate rebuilds while an earlier borrower holds its context", () => + Effect.gen(function*() { + const acquired: Array = [] + const released: Array = [] + const layer = makeLayer(acquired, released) + const ref = yield* LayerRef.make(layer) + + const ids = yield* Effect.gen(function*() { + const provided = yield* Resource + const borrowerScope = yield* Scope.make() + const borrowed = yield* ref.contextEffect.pipe(Scope.provide(borrowerScope)) + + yield* ref.invalidate + const fresh = yield* Effect.scoped(ref.contextEffect) + assert.deepStrictEqual(released, [3]) + + yield* Scope.close(borrowerScope, Exit.void) + assert.deepStrictEqual(released, [3, 2]) + return [provided.id, Context.get(borrowed, Resource).id, Context.get(fresh, Resource).id] + }).pipe(Effect.provide(layer)) + + assert.deepStrictEqual(ids, [1, 2, 3]) + assert.deepStrictEqual(released, [3, 2, 1]) + })) + + it.effect("invalidate shares parent-memoized dependencies across rebuilds", () => + Effect.gen(function*() { + let sharedBuilds = 0 + const acquired: Array = [] + const released: Array = [] + class Shared extends Context.Service()("LayerRefTest/Shared") {} + const sharedLayer = Layer.effect(Shared)(Effect.sync(() => ++sharedBuilds)) + + class ResourceRef extends LayerRef.Service()("LayerRefTest/SharedDepRef", { + layer: makeLayer(acquired, released).pipe(Layer.provide(sharedLayer)), + dependencies: [sharedLayer] + }) {} + + yield* Effect.gen(function*() { + const borrowerScope = yield* Scope.make() + const first = yield* ResourceRef.contextEffect.pipe(Scope.provide(borrowerScope)) + yield* ResourceRef.invalidate + const second = yield* Effect.scoped(ResourceRef.contextEffect) + assert.strictEqual(Context.get(first, Resource).id, 1) + assert.strictEqual(Context.get(second, Resource).id, 2) + assert.strictEqual(sharedBuilds, 1) + yield* Scope.close(borrowerScope, Exit.void) + }).pipe(Effect.provide(ResourceRef.layer)) + })) + it.effect("preload acquires the resource when the LayerRef is created", () => Effect.gen(function*() { const acquired: Array = [] diff --git a/.repos/effect/packages/effect/test/Logger.test.ts b/.repos/effect/packages/effect/test/Logger.test.ts index 062b7a30dc635..57481e0c8b82b 100644 --- a/.repos/effect/packages/effect/test/Logger.test.ts +++ b/.repos/effect/packages/effect/test/Logger.test.ts @@ -268,4 +268,27 @@ describe("Logger", () => { assert.deepStrictEqual(events, ["start:first", "end:first", "start:second", "end:second"]) })) + + it.effect("runs Logger.make synchronously in the logging fiber and defects on throw", () => + Effect.gen(function*() { + const sentinel = new Error("logger failed") + const events: Array = [] + const logger = Logger.make((options) => { + const message = String(options.message) + events.push(`log:${options.fiber.id}:${message}`) + if (message === "boom") { + throw sentinel + } + }) + + yield* Effect.gen(function*() { + const id = yield* Effect.fiberId + yield* Effect.log("ok") + events.push("after-ok") + const exit = yield* Effect.exit(Effect.log("boom")) + + assert.deepStrictEqual(events, [`log:${id}:ok`, "after-ok", `log:${id}:boom`]) + assert.deepStrictEqual(exit, Exit.die(sentinel)) + }).pipe(Effect.provide(Logger.layer([logger]))) + })) }) diff --git a/.repos/effect/packages/effect/test/Match.test.ts b/.repos/effect/packages/effect/test/Match.test.ts index 2d0e2ea558090..7790581ab181c 100644 --- a/.repos/effect/packages/effect/test/Match.test.ts +++ b/.repos/effect/packages/effect/test/Match.test.ts @@ -36,6 +36,44 @@ describe("Match", () => { strictEqual(formatTodo({ status: "Active", title: "Write tests" }), "Active: Write tests") }) + it("fn passes its arguments to record handlers", () => { + const describe = Match.fn((_prefix: string, event: { readonly _tag: "Opened" } | { readonly _tag: "Closed" }) => + event + ).pipe( + Match.tagsExhaustive({ + Opened: (_event, prefix) => `${prefix} opened`, + Closed: (_event, prefix) => `${prefix} closed` + }) + ) + strictEqual(describe("door", { _tag: "Closed" }), "door closed") + + const label = Match.fn((_suffix: string, value: "a" | "b") => value).pipe( + Match.literalsExhaustive({ a: (value, suffix) => value + suffix, b: (value, suffix) => value + suffix }) + ) + strictEqual(label("!", "b"), "b!") + }) + + it("type passes handlers the input alone", () => { + const argCount = (...args: Array) => args.length + + const single = Match.type().pipe( + Match.when(Match.string, parseInt), + Match.orElse(argCount) + ) + strictEqual(single("8"), 8) + strictEqual(single(1), 1) + + const multi = Match.type().pipe( + Match.when(Match.string, argCount), + Match.when(Match.number, argCount), + Match.exhaustive + ) + strictEqual(multi(1), 1) + + const tags = Match.typeTags<{ readonly _tag: "A" }>()({ A: argCount }) + strictEqual(tags({ _tag: "A" }), 1) + }) + it("tag matches an exact _tag and falls through for null", () => { const match = pipe( Match.type<{ _tag: "A" } | null>(), diff --git a/.repos/effect/packages/effect/test/Order.test.ts b/.repos/effect/packages/effect/test/Order.test.ts index 12fc892c91ad2..e6079abbdab75 100644 --- a/.repos/effect/packages/effect/test/Order.test.ts +++ b/.repos/effect/packages/effect/test/Order.test.ts @@ -69,6 +69,25 @@ describe("Order", () => { strictEqual(Order.clamp(Order.Number)({ minimum: 1, maximum: 10 })(2), 2) }) + it("clamp returns the value itself when it is equal to a bound", () => { + const O = Order.mapInput(Order.Number, (a: { readonly n: number }) => a.n) + const minimum = { n: 1 } + const maximum = { n: 10 } + const clamp = Order.clamp(O)({ minimum, maximum }) + const atMinimum = { n: 1 } + const atMaximum = { n: 10 } + strictEqual(clamp(atMinimum), atMinimum) + strictEqual(clamp(atMaximum), atMaximum) + + const equalMin = { n: 5 } + const equalMax = { n: 5 } + const clampEqual = Order.clamp(O)({ minimum: equalMin, maximum: equalMax }) + const atEqual = { n: 5 } + strictEqual(clampEqual(atEqual), atEqual) + strictEqual(clampEqual({ n: 4 }), equalMin) + strictEqual(clampEqual({ n: 6 }), equalMax) + }) + it("isBetween checks inclusive bounds", () => { const between = Order.isBetween(Order.Number)({ minimum: 1, maximum: 10 }) assertTrue(between(2)) diff --git a/.repos/effect/packages/effect/test/ScopedCache.test.ts b/.repos/effect/packages/effect/test/ScopedCache.test.ts index a9d9523be5dca..2a71f12187110 100644 --- a/.repos/effect/packages/effect/test/ScopedCache.test.ts +++ b/.repos/effect/packages/effect/test/ScopedCache.test.ts @@ -1484,6 +1484,21 @@ describe("ScopedCache", () => { assert.isTrue(yield* ScopedCache.has(cache, "d")) })) + it.effect("reloading an expired entry makes it most recently used", () => + Effect.gen(function*() { + const { cache, cleanupTracker } = yield* makeManagedResourceCache(2, "1 second") + + yield* ScopedCache.get(cache, "a") + yield* TestClock.adjust("500 millis") + yield* ScopedCache.get(cache, "b") + yield* TestClock.adjust("600 millis") + yield* ScopedCache.get(cache, "a") + yield* ScopedCache.get(cache, "c") + + assert.deepStrictEqual(yield* ScopedCache.keys(cache), ["a", "c"]) + assert.deepStrictEqual(cleanupTracker.cleanedUp, ["a", "b"]) + })) + it.effect("capacity of 1", () => Effect.gen(function*() { const cache = yield* ScopedCache.make({ diff --git a/.repos/effect/packages/effect/test/Stream.test.ts b/.repos/effect/packages/effect/test/Stream.test.ts index 4f8dc96f33a0c..4013e70d174c1 100644 --- a/.repos/effect/packages/effect/test/Stream.test.ts +++ b/.repos/effect/packages/effect/test/Stream.test.ts @@ -208,6 +208,80 @@ describe("Stream", () => { assert.deepStrictEqual(seen, [1, 2, 3]) })) + it.effect("runDrain closes its scope before completing on early termination", () => + Effect.gen(function*() { + const log: Array = [] + yield* Stream.iterate(0, (n) => n + 1).pipe( + Stream.ensuring(Effect.sync(() => { + log.push("released") + })), + Stream.take(1), + Stream.runDrain + ) + assert.deepStrictEqual(log, ["released"]) + })) + + it.effect("toPull runs ensuring before Done and leaves callback finalizers until scope close", () => + Effect.gen(function*() { + const log: Array = [] + const scope = yield* Scope.make() + const pull = yield* Stream.callback(Effect.fnUntraced(function*(queue) { + yield* Effect.addFinalizer(() => + Effect.sync(() => { + log.push("callback-released") + }) + ) + Queue.offerUnsafe(queue, 1) + Queue.endUnsafe(queue) + })).pipe( + Stream.ensuring(Effect.sync(() => { + log.push("ensuring") + })), + Stream.toPull, + Scope.provide(scope) + ) + assert.deepStrictEqual(yield* pull, [1]) + assert.deepStrictEqual(yield* Effect.exit(pull), Exit.fail(Cause.Done())) + assert.deepStrictEqual(log, ["ensuring"]) + yield* Scope.close(scope, Exit.void) + assert.deepStrictEqual(log, ["ensuring", "callback-released"]) + })) + + it.effect("toPull finalizes a stream stopped by take no later than scope close", () => + Effect.gen(function*() { + const log: Array = [] + const scope = yield* Scope.make() + const pull = yield* Stream.iterate(0, (n) => n + 1).pipe( + Stream.ensuring(Effect.sync(() => { + log.push("released") + })), + Stream.take(1), + Stream.toPull, + Scope.provide(scope) + ) + assert.deepStrictEqual(yield* pull, [0]) + assert.deepStrictEqual(yield* Effect.exit(pull), Exit.fail(Cause.Done())) + yield* Scope.close(scope, Exit.void) + assert.deepStrictEqual(log, ["released"]) + })) + + it.effect("toQueue finalizes the stream before the surrounding scope closes", () => + Effect.gen(function*() { + const log: Array = [] + const queue = yield* Stream.unwrap( + Effect.acquireRelease( + Effect.succeed(Stream.make(1)), + () => + Effect.sync(() => { + log.push("released") + }) + ) + ).pipe(Stream.toQueue({ capacity: "unbounded" })) + assert.strictEqual(yield* Queue.take(queue), 1) + assert.deepStrictEqual(yield* Effect.exit(Queue.take(queue)), Exit.fail(Cause.Done())) + assert.deepStrictEqual(log, ["released"]) + })) + it.effect.each([0, 1])( "toReadableStream - respects upstream demand with highWaterMark %i", (highWaterMark) => @@ -236,6 +310,18 @@ describe("Stream", () => { }) ) + it.effect("toAsyncIterable - overlapping reads preserve buffered values", () => + Effect.gen(function*() { + const iterator = Stream.toAsyncIterable(Stream.range(1, 6, 2))[Symbol.asyncIterator]() + + const results = yield* Effect.promise(() => Promise.all([iterator.next(), iterator.next()])) + + assert.deepStrictEqual(results, [ + { done: false, value: 1 }, + { done: false, value: 2 } + ]) + })) + it.effect("toAsyncIterable - return interrupts an in-flight pull", () => Effect.gen(function*() { const started = yield* Deferred.make() @@ -5161,6 +5247,14 @@ describe("Stream", () => { ) deepStrictEqual(result, [1]) })) + + it.effect("starts both sides immediately", () => + Effect.gen(function*() { + const started = new Set() + const side = (name: string) => Stream.fromEffect(Effect.sync(() => started.add(name))) + yield* Effect.asVoid(Stream.toPull(Stream.merge(side("left"), side("right")))) + deepStrictEqual(started, new Set(["left", "right"])) + })) }) describe("partition", () => { diff --git a/.repos/effect/packages/effect/test/String.test.ts b/.repos/effect/packages/effect/test/String.test.ts index 0296474177c63..11797e6cd12fc 100644 --- a/.repos/effect/packages/effect/test/String.test.ts +++ b/.repos/effect/packages/effect/test/String.test.ts @@ -564,6 +564,14 @@ describe("String", () => { it("handles empty string", () => { deepStrictEqual(Array.from(S.linesIterator("")), []) }) + + it("resumes iteration from the current position", () => { + const iterator = S.linesIterator("a\nb\nc") + + deepStrictEqual(iterator.next(), { done: false, value: "a" }) + deepStrictEqual(Array.from(iterator), ["b", "c"]) + deepStrictEqual(Array.from(iterator), []) + }) }) describe("linesWithSeparators", () => { diff --git a/.repos/effect/packages/effect/test/Tracer.test.ts b/.repos/effect/packages/effect/test/Tracer.test.ts index 020f7f5370e16..34746243e6f87 100644 --- a/.repos/effect/packages/effect/test/Tracer.test.ts +++ b/.repos/effect/packages/effect/test/Tracer.test.ts @@ -1,6 +1,6 @@ import { assert, describe, it } from "@effect/vitest" import { assertNone, deepStrictEqual, strictEqual } from "@effect/vitest/utils" -import { Cause, Context, Duration, Effect, Exit, Fiber, Layer, Scheduler, Tracer } from "effect" +import { Cause, Context, Duration, Effect, Exit, Fiber, Layer, Logger, Scheduler, Tracer } from "effect" import { HttpBody, HttpClient, HttpClientResponse } from "effect/http" import { OtlpSerialization, OtlpTracer } from "effect/observability" import { TestClock } from "effect/testing" @@ -489,6 +489,32 @@ describe("Tracer", () => { annotations: Context.empty() }) )) + + it.effect("treats an external span as parent context rather than a recording target", () => + Effect.gen(function*() { + const external = Tracer.externalSpan({ traceId: "trace", spanId: "span" }) + yield* Effect.gen(function*() { + const outer = (yield* Effect.currentSpan) as Tracer.NativeSpan + yield* Effect.gen(function*() { + yield* Effect.log("under external") + yield* Effect.annotateCurrentSpan("key", "value") + assert.isTrue(Cause.isNoSuchElementError(yield* Effect.flip(Effect.currentSpan))) + strictEqual(yield* Effect.currentParentSpan, external) + const child = (yield* Effect.log("under child").pipe( + Effect.andThen(Effect.currentSpan), + Effect.withSpan("child") + )) as Tracer.NativeSpan + strictEqual(getParent(child), external) + deepStrictEqual(child.events.map(([name]) => name), ["under child"]) + }).pipe(Effect.withParentSpan(external)) + strictEqual(outer.attributes.has("key"), false) + deepStrictEqual(outer.events, []) + }).pipe( + Effect.withSpan("outer"), + Effect.provide(Logger.layer([Logger.tracerLogger])) + ) + deepStrictEqual(external, Tracer.externalSpan({ traceId: "trace", spanId: "span" })) + })) }) describe("Effect.withTracerEnabled", () => { diff --git a/.repos/effect/packages/effect/test/ai/Chat.test.ts b/.repos/effect/packages/effect/test/ai/Chat.test.ts index 13a99e099ac84..f4f411089999b 100644 --- a/.repos/effect/packages/effect/test/ai/Chat.test.ts +++ b/.repos/effect/packages/effect/test/ai/Chat.test.ts @@ -311,6 +311,49 @@ describe("Chat", () => { ) }) + it.effect("replays an approved tool result before the answer generated from it", () => { + const toolkit = Toolkit.make(Tool.make("Deploy", { success: Schema.String, needsApproval: true })) + + return Effect.gen(function*() { + const chat = yield* Chat.empty + const initial = yield* chat.generateText({ prompt: "Deploy", toolkit }).pipe( + TestUtils.withLanguageModel({ + generateText: [{ type: "tool-call", id: "deploy-call", name: "Deploy", params: {} }] + }) + ) + const approval = initial.content.find((part) => part.type === "tool-approval-request") + assert.isDefined(approval) + + yield* chat.generateText({ + toolkit, + prompt: [Prompt.toolMessage({ + content: [Prompt.toolApprovalResponsePart({ approvalId: approval.approvalId, approved: true })] + })] + }).pipe( + TestUtils.withLanguageModel({ generateText: [{ type: "text", text: "Deployed" }] }) + ) + + let prompt = Prompt.empty + yield* chat.generateText({ prompt: "Thanks", toolkit }).pipe( + TestUtils.withLanguageModel({ + generateText: (options) => { + prompt = options.prompt + return [{ type: "text", text: "You're welcome" }] + } + }) + ) + + assert.deepStrictEqual( + prompt.content.map((message) => + `${message.role}(${ + typeof message.content === "string" ? "" : message.content.map((part) => part.type).join(",") + })` + ), + ["user(text)", "assistant(tool-call)", "tool(tool-result)", "assistant(text)", "user(text)"] + ) + }).pipe(Effect.provide(toolkit.toLayer({ Deploy: () => Effect.succeed("ok") }))) + }) + it.effect("preserves approval results when streaming with tool call resolution disabled", () => { let executions = 0 const toolkit = Toolkit.make(Tool.make("Counter", { diff --git a/.repos/effect/packages/effect/test/ai/McpServer/McpConformance/ElicitationTest.ts b/.repos/effect/packages/effect/test/ai/McpServer/McpConformance/ElicitationTest.ts index 70e23481cce3b..88237e682ebef 100644 --- a/.repos/effect/packages/effect/test/ai/McpServer/McpConformance/ElicitationTest.ts +++ b/.repos/effect/packages/effect/test/ai/McpServer/McpConformance/ElicitationTest.ts @@ -248,25 +248,6 @@ export const suite = ( }) ) - it.effect("MUST send elicitation requests when the client advertises elicitation", () => - Effect.gen(function*() { - const test = yield* McpConformance - const peer = yield* test.makePeer({ - capabilities: { elicitation: {} }, - handlers: { - "elicitation/create": () => - Effect.succeed({ - action: "accept", - content: { name: "Ada" } - }) - } - }) - - yield* peer.wireClient["elicitation/create"](request) - - assert.strictEqual((yield* peer.takeRequest).method, "elicitation/create") - })) - it.effect.skipIf(protocol.protocolVersion !== "2025-11-25")( "MUST gate form and URL modes on their independent nested capabilities", () => @@ -306,10 +287,13 @@ export const suite = ( } }) - const result = yield* peer.wireClient["elicitation/create"](request) + const result = yield* peer.reverseClient.elicit( + Schema.decodeUnknownSync(McpSchema.Elicit.payloadSchema)(request) + ) const recorded = yield* peer.takeRequest const payload = yield* decodeElicitationRequest(recorded.payload) + assert.strictEqual(recorded.method, "elicitation/create") assert.strictEqual(payload.message, request.message) assert.deepStrictEqual(payload.requestedSchema, request.requestedSchema) assert.strictEqual(result.action, "accept") diff --git a/.repos/effect/packages/effect/test/ai/McpServer/McpConformance/McpTestPeer.ts b/.repos/effect/packages/effect/test/ai/McpServer/McpConformance/McpTestPeer.ts index a9cf6e32bbc4c..4dcbcaf58d7f9 100644 --- a/.repos/effect/packages/effect/test/ai/McpServer/McpConformance/McpTestPeer.ts +++ b/.repos/effect/packages/effect/test/ai/McpServer/McpConformance/McpTestPeer.ts @@ -7,8 +7,6 @@ import * as Option from "effect/Option" import * as Queue from "effect/Queue" import * as Ref from "effect/Ref" import * as RpcClient from "effect/rpc/RpcClient" -import type * as RpcClientError from "effect/rpc/RpcClientError" -import type * as RpcGroup from "effect/rpc/RpcGroup" import type * as RpcSerialization from "effect/rpc/RpcSerialization" import * as Schema from "effect/Schema" @@ -31,10 +29,6 @@ export interface McpTestPeerOptions { } export interface McpTestPeer { - readonly wireClient: RpcClient.RpcClient< - RpcGroup.Rpcs, - RpcClientError.RpcClientError - > readonly reverseClient: McpSchema.McpReverseClient readonly requests: Effect.Effect> readonly takeRequest: Effect.Effect @@ -111,11 +105,6 @@ export const makeMcpTestPeer = Effect.fn("McpTestPeer.make")(function*( }) ) - const wireClient = yield* RpcClient.make( - protocol.serverRequestRpcs as unknown as typeof McpSchema.ServerRequestRpcs - ).pipe( - Effect.provideService(RpcClient.Protocol, rpcProtocol) - ) const reverseClient = yield* protocol.makeReverseClient({ protocolVersion: protocol.protocolVersion, clientCapabilities: options.capabilities ?? {}, @@ -123,7 +112,6 @@ export const makeMcpTestPeer = Effect.fn("McpTestPeer.make")(function*( }).pipe(Effect.provideService(RpcClient.Protocol, rpcProtocol)) return { - wireClient, reverseClient, requests: Ref.get(requests), takeRequest: Queue.take(inbox) diff --git a/.repos/effect/packages/effect/test/ai/McpServer/McpConformance/RootsTest.ts b/.repos/effect/packages/effect/test/ai/McpServer/McpConformance/RootsTest.ts index 6ebc03349e7fb..e3ea6e2adff20 100644 --- a/.repos/effect/packages/effect/test/ai/McpServer/McpConformance/RootsTest.ts +++ b/.repos/effect/packages/effect/test/ai/McpServer/McpConformance/RootsTest.ts @@ -22,7 +22,7 @@ export const suite = (protocol: McpProtocol.ProtocolAdapter, layer: McpConforman } }) - yield* peer.wireClient["roots/list"](undefined) + yield* peer.reverseClient.listRoots() assert.strictEqual((yield* peer.takeRequest).method, "roots/list") })) @@ -37,7 +37,7 @@ export const suite = (protocol: McpProtocol.ProtocolAdapter, layer: McpConforman } }) - yield* peer.wireClient["roots/list"](undefined) + yield* peer.reverseClient.listRoots() assert.strictEqual((yield* peer.takeRequest).method, "roots/list") })) @@ -57,7 +57,7 @@ export const suite = (protocol: McpProtocol.ProtocolAdapter, layer: McpConforman } }) - const result = yield* peer.wireClient["roots/list"](undefined) + const result = yield* peer.reverseClient.listRoots() assert.deepStrictEqual( result.roots.map((root) => ({ @@ -81,7 +81,7 @@ export const suite = (protocol: McpProtocol.ProtocolAdapter, layer: McpConforman } }) - const result = yield* peer.wireClient["roots/list"](undefined) + const result = yield* peer.reverseClient.listRoots() assert.deepStrictEqual(result.roots, []) })) @@ -101,11 +101,11 @@ export const suite = (protocol: McpProtocol.ProtocolAdapter, layer: McpConforman } }) - const error = yield* peer.wireClient["roots/list"](undefined).pipe(Effect.flip) + const error = yield* peer.reverseClient.listRoots().pipe(Effect.flip) - assert.isTrue("code" in error) - if ("code" in error) assert.strictEqual(error.code, McpSchema.INTERNAL_ERROR_CODE) - assert.strictEqual(error.message, "Roots unavailable") + assert.instanceOf(error, McpSchema.McpReverseOperationError) + assert.strictEqual(error.operation, "roots/list") + assert.deepInclude(error.cause, { code: McpSchema.INTERNAL_ERROR_CODE, message: "Roots unavailable" }) })) }) }) diff --git a/.repos/effect/packages/effect/test/ai/McpServer/McpConformance/SamplingTest.ts b/.repos/effect/packages/effect/test/ai/McpServer/McpConformance/SamplingTest.ts index 2823221b6e07a..218bdfc6539a0 100644 --- a/.repos/effect/packages/effect/test/ai/McpServer/McpConformance/SamplingTest.ts +++ b/.repos/effect/packages/effect/test/ai/McpServer/McpConformance/SamplingTest.ts @@ -19,12 +19,6 @@ const SamplingRequest = Schema.Struct({ }) const decodeSamplingRequest = Schema.decodeUnknownEffect(SamplingRequest) -const decodeSamplingResult = Schema.decodeUnknownEffect(Schema.Struct({ - role: Schema.String, - content: Schema.Record(Schema.String, Schema.Unknown), - model: Schema.String, - stopReason: Schema.optionalKey(Schema.String) -})) const textResponse = { role: "assistant", @@ -84,7 +78,7 @@ export const suite = (protocol: McpProtocol.ProtocolAdapter, layer: McpConforman } }) - yield* peer.wireClient["sampling/createMessage"](samplingRequest) + yield* peer.reverseClient.createMessage(samplingRequest) assert.strictEqual((yield* peer.takeRequest).method, "sampling/createMessage") })) @@ -240,7 +234,7 @@ export const suite = (protocol: McpProtocol.ProtocolAdapter, layer: McpConforman } }) - yield* peer.wireClient["sampling/createMessage"](samplingRequestWithOptions) + yield* peer.reverseClient.createMessage(samplingRequestWithOptions) const recorded = yield* peer.takeRequest const payload = yield* decodeSamplingRequest(recorded.payload) @@ -277,9 +271,7 @@ export const suite = (protocol: McpProtocol.ProtocolAdapter, layer: McpConforman } }) - const result = yield* peer.wireClient["sampling/createMessage"](samplingRequest).pipe( - Effect.flatMap(decodeSamplingResult) - ) + const result = yield* peer.reverseClient.createMessage(samplingRequest) assert.strictEqual(result.role, "assistant") assert.strictEqual(result.model, "test-model") @@ -309,13 +301,11 @@ export const suite = (protocol: McpProtocol.ProtocolAdapter, layer: McpConforman } }) - const result = yield* peer.wireClient["sampling/createMessage"](samplingRequest).pipe( - Effect.flatMap(decodeSamplingResult) - ) + const result = yield* peer.reverseClient.createMessage(samplingRequest) assert.deepStrictEqual(result.content, { type: "image", - data: "AQID", + data: new Uint8Array([1, 2, 3]), mimeType: "image/png" }) })) @@ -341,13 +331,11 @@ export const suite = (protocol: McpProtocol.ProtocolAdapter, layer: McpConforman } }) - const result = yield* peer.wireClient["sampling/createMessage"](samplingRequest).pipe( - Effect.flatMap(decodeSamplingResult) - ) + const result = yield* peer.reverseClient.createMessage(samplingRequest) assert.deepStrictEqual(result.content, { type: "audio", - data: "BAUG", + data: new Uint8Array([4, 5, 6]), mimeType: "audio/wav" }) }) @@ -368,11 +356,11 @@ export const suite = (protocol: McpProtocol.ProtocolAdapter, layer: McpConforman } }) - const error = yield* peer.wireClient["sampling/createMessage"](samplingRequest).pipe(Effect.flip) + const error = yield* peer.reverseClient.createMessage(samplingRequest).pipe(Effect.flip) - assert.isTrue("code" in error) - if ("code" in error) assert.strictEqual(error.code, McpSchema.INTERNAL_ERROR_CODE) - assert.strictEqual(error.message, "Sampling failed") + assert.instanceOf(error, McpSchema.McpReverseOperationError) + assert.strictEqual(error.operation, "sampling/createMessage") + assert.deepInclude(error.cause, { code: McpSchema.INTERNAL_ERROR_CODE, message: "Sampling failed" }) })) it.effect.skipIf(protocol.protocolVersion !== "2025-11-25")( diff --git a/.repos/effect/packages/effect/test/ai/McpServer/Skills.test.ts b/.repos/effect/packages/effect/test/ai/McpServer/Skills.test.ts index 3b55e628fb3e5..5eb85057b07e5 100644 --- a/.repos/effect/packages/effect/test/ai/McpServer/Skills.test.ts +++ b/.repos/effect/packages/effect/test/ai/McpServer/Skills.test.ts @@ -2,6 +2,7 @@ import { assert, describe, it } from "@effect/vitest" import * as McpProtocol from "effect/ai/McpProtocol" import * as McpSchema from "effect/ai/McpSchema" import * as McpServer from "effect/ai/McpServer" +import * as Skill from "effect/ai/Skill" import * as Context from "effect/Context" import * as Effect from "effect/Effect" import * as Exit from "effect/Exit" @@ -137,6 +138,42 @@ describe("McpServer skills", () => { ) })) + it.effect("registers a Skill value with the same manifest and files as the raw-files form", () => + Effect.gen(function*() { + const refundsSkill = Skill.make({ + frontmatter: { + name: "refunds", + description: "Process refunds using the billing tools", + license: "Apache-2.0", + metadata: { "acme-tools": "issue_refund" } + }, + instructions: "Read references/policy.md before issuing a refund.\n", + files: { + "references/policy.md": "Refunds above CHF 500 require manager approval.\n", + "assets/logo.png": PNG + } + }) + const harness = yield* modernHarness( + McpServer.skill(refundsSkill, { uri: "skill://acme/billing/refunds/SKILL.md" }) + ) + const { message } = yield* call(harness, "skills/list") + const [listed] = message.result.skills + assert.strictEqual(listed.uri, "skill://acme/billing/refunds/SKILL.md") + assert.deepStrictEqual(listed.frontmatter, refundsSkill.frontmatter) + assert.deepStrictEqual( + listed.resources.map((resource: any) => resource.uri), + [ + "skill://acme/billing/refunds/SKILL.md", + "skill://acme/billing/refunds/assets/logo.png", + "skill://acme/billing/refunds/references/policy.md" + ] + ) + assert.deepStrictEqual( + yield* readBytes(harness, "skill://acme/billing/refunds/assets/logo.png"), + Buffer.from(PNG) + ) + })) + // Changing the caller's bytes after registration must not change what is served under the listed digest. // A Node `Buffer` is a `Uint8Array` whose `slice` shares memory, so it needs a real copy too. it.effect("serves the bytes given at registration after the caller changes them", () => diff --git a/.repos/effect/packages/effect/test/ai/Prompt.test.ts b/.repos/effect/packages/effect/test/ai/Prompt.test.ts index 9f4b11d1f59a2..b0b1b550ab661 100644 --- a/.repos/effect/packages/effect/test/ai/Prompt.test.ts +++ b/.repos/effect/packages/effect/test/ai/Prompt.test.ts @@ -426,14 +426,7 @@ describe("Prompt", () => { params: {}, providerExecuted: false }), - // Tool call B arrives second - Response.makePart("tool-call", { - id: "call-B", - name: "tool_b", - params: {}, - providerExecuted: false - }), - // But tool B's result arrives before tool A's result + // Tool B's result arrives before tool call B and tool A's result Response.makePart("tool-result", { id: "call-B", name: "tool_b", @@ -443,6 +436,13 @@ describe("Prompt", () => { preliminary: false, providerExecuted: false }), + // Tool call B arrives after its result + Response.makePart("tool-call", { + id: "call-B", + name: "tool_b", + params: {}, + providerExecuted: false + }), Response.makePart("tool-result", { id: "call-A", name: "tool_a", diff --git a/.repos/effect/packages/effect/test/ai/Skill.test.ts b/.repos/effect/packages/effect/test/ai/Skill.test.ts new file mode 100644 index 0000000000000..f3c66a76251ed --- /dev/null +++ b/.repos/effect/packages/effect/test/ai/Skill.test.ts @@ -0,0 +1,98 @@ +import { assert, describe, it } from "@effect/vitest" +import * as Skill from "effect/ai/Skill" +import * as Cause from "effect/Cause" +import * as Effect from "effect/Effect" +import * as Schema from "effect/Schema" + +const PNG = new Uint8Array([0x89, 0x50, 0x4e, 0x47, 0x0d, 0x0a, 0x1a, 0x0a]) + +describe("Skill", () => { + it("validates frontmatter and file paths on construction", () => { + const skill = Skill.make({ + frontmatter: { name: "refunds", description: "Process customer refunds" }, + instructions: "Read references/policy.md before issuing a refund." + }) + assert.instanceOf(skill, Skill.Skill) + assert.deepStrictEqual(skill.files, {}) + + assert.throws(() => + Skill.make({ + frontmatter: { name: "Bad_Name", description: "Process customer refunds" }, + instructions: "" + }) + ) + + assert.throws(() => + Skill.make({ + frontmatter: { name: "refunds", description: "Process customer refunds", revision: 1n as any }, + instructions: "" + }) + ) + + for (const path of ["../secret.txt", "C:/notes.txt", "SKILL.md"]) { + assert.throws(() => + Skill.make({ + frontmatter: { name: "refunds", description: "Process customer refunds" }, + instructions: "", + files: { [path]: "secret" } + }) + ) + } + }) + + it.effect("round-trips through toFiles and fromFiles, and rejects invalid file bundles", () => + Effect.gen(function*() { + const inputFiles: Record = { + "references/policy.md": "Refunds over $100 require approval.", + "assets/logo.png": PNG + } + Object.defineProperty(inputFiles, "__proto__", { + value: "proto-file", + enumerable: true, + writable: true, + configurable: true + }) + const skill = Skill.make({ + frontmatter: { + name: "refunds", + description: "yes: it's #1", + metadata: { version: "1.0" }, + "#note": "retain" + }, + instructions: "Read references/policy.md before issuing a refund.", + files: inputFiles + }) + + const roundTripped = yield* Skill.fromFiles(Skill.toFiles(skill)) + assert.deepStrictEqual(roundTripped, skill) + assert.isTrue(Object.hasOwn(roundTripped.files, "__proto__")) + + const missingSkillMd = yield* Effect.flip(Skill.fromFiles({ "references/policy.md": "orphan" })) + assert.isTrue(Cause.isIllegalArgumentError(missingSkillMd)) + + const badFrontmatter = yield* Effect.flip( + Skill.fromFiles({ "SKILL.md": "---\nname: Bad_Name\ndescription: bad\n---\n\nBody" }) + ) + assert.isTrue(Cause.isIllegalArgumentError(badFrontmatter)) + })) + + it.effect("round-trips text and binary files through JSON", () => + Effect.gen(function*() { + const skill = Skill.make({ + frontmatter: { name: "refunds", description: "Process customer refunds" }, + instructions: "Read references/policy.md before issuing a refund.", + files: { + "references/policy.md": "Refunds over $100 require approval.", + "assets/logo.png": PNG + } + }) + + const codec = Schema.fromJsonString(Schema.toCodecJson(Skill.Skill)) + const encoded = yield* Schema.encodeEffect(codec)(skill) + const decoded = yield* Schema.decodeUnknownEffect(codec)(encoded) + + assert.instanceOf(decoded, Skill.Skill) + assert.instanceOf(decoded.files["assets/logo.png"], Uint8Array) + assert.deepStrictEqual(decoded, skill) + })) +}) diff --git a/.repos/effect/packages/effect/test/cluster/ClusterWorkflowEngine.test.ts b/.repos/effect/packages/effect/test/cluster/ClusterWorkflowEngine.test.ts index d1e1983a51893..7b8c66663ccce 100644 --- a/.repos/effect/packages/effect/test/cluster/ClusterWorkflowEngine.test.ts +++ b/.repos/effect/packages/effect/test/cluster/ClusterWorkflowEngine.test.ts @@ -27,9 +27,12 @@ import { EntityType, type Message, MessageStorage, + Runner, + RunnerAddress, RunnerHealth, Runners, RunnerStorage, + ShardId, Sharding, ShardingConfig, Snowflake @@ -46,6 +49,37 @@ import { import { collectGarbage } from "../utils/gc.ts" describe.concurrent("ClusterWorkflowEngine", () => { + it.effect("fails an awaited self-execution with a stored defect while allowing discarded self-execution", () => + Effect.gen(function*() { + const Self = Workflow.make("SelfExecute", { + payload: { key: Schema.String, discard: Schema.Boolean }, + success: Schema.String, + idempotencyKey: ({ key }) => key + }) + + yield* Effect.gen(function*() { + const discardedId = yield* Self.execute({ key: "discard", discard: true }, { discard: true }) + assert.deepStrictEqual( + yield* pollUntil(Self, discardedId, "Complete"), + new Workflow.Complete({ exit: Exit.succeed(discardedId) }) + ) + + const awaitedId = yield* Self.execute({ key: "await", discard: false }, { discard: true }) + const awaited = yield* pollUntil(Self, awaitedId, "Complete") + assert(awaited._tag === "Complete") + const defect = Exit.findDefect(awaited.exit) + assert(Result.isSuccess(defect)) + assert.include(String(defect.success), Self._tag) + assert.include(String(defect.success), awaitedId) + }).pipe( + Effect.provide( + Self.toLayer((payload) => + Self.execute({ ...payload, discard: !payload.discard }, { discard: payload.discard }) + ).pipe(Layer.provideMerge(makeTestWorkflowEngine())) + ) + ) + })) + for (const transactional of [false, true]) { it.effect( `${transactional ? "reruns a rolled-back" : "reuses a completed"} activity when its reply is redelivered`, @@ -232,6 +266,119 @@ describe.concurrent("ClusterWorkflowEngine", () => { })) } + it.effect.skipIf(process.versions.bun !== undefined || process.versions.deno !== undefined)( + "releases empty scopes, superseded instances, and wait sets across suspended replays", + () => + Effect.gen(function*() { + const gates = [ + DurableDeferred.make("SuspendedReplayRetention/First"), + DurableDeferred.make("SuspendedReplayRetention/Second") + ] + const workflow = Workflow.make("SuspendedReplayRetention", { + payload: {}, + idempotencyKey: () => "one" + }) + let runs = 0 + const control = new WeakRef({}) + let firstInstance: WeakRef | undefined + let firstAwaits: Map | undefined + let secondParent: Scope.Scope | undefined + const layer = workflow.toLayer(() => + Effect.gen(function*() { + const run = ++runs + if (run === 1) { + const instance = yield* WorkflowInstance + firstInstance = new WeakRef(instance) + firstAwaits = instance.awaitedDeferreds + } else if (run === 2) { + secondParent = (yield* WorkflowInstance).scope.parent + } + for (const gate of gates) yield* DurableDeferred.await(gate) + }) + ).pipe(Layer.provideMerge(makeTestWorkflowEngine())) + + yield* Effect.gen(function*() { + const executionId = yield* workflow.execute({}, { discard: true }) + yield* pollUntil(workflow, executionId, "Suspended") + assert.strictEqual(firstAwaits?.size, 1) + + yield* DurableDeferred.succeed(gates[0], { + token: DurableDeferred.tokenFromExecutionId(gates[0], { workflow, executionId }), + value: undefined + }) + yield* pollStorageUntil(() => runs >= 2, "run 2 must start") + yield* pollUntil(workflow, executionId, "Suspended") + assert.strictEqual(firstAwaits?.size, 0) + + yield* collectGarbage + assert.isUndefined(control.deref()) + assert.isUndefined(firstInstance?.deref()) + assert.isDefined(secondParent) + assert.strictEqual(secondParent.state._tag === "Open" ? secondParent.state.finalizers?.size ?? 1 : 0, 1) + + yield* DurableDeferred.succeed(gates[1], { + token: DurableDeferred.tokenFromExecutionId(gates[1], { workflow, executionId }), + value: undefined + }) + assert.deepStrictEqual( + yield* pollUntil(workflow, executionId, "Complete"), + new Workflow.Complete({ exit: Exit.void }) + ) + }).pipe(Effect.provide(layer)) + }), + 20_000 + ) + + it.effect("skips durable finalizers and compensations on a shared scope during owner handoff", () => + Effect.gen(function*() { + const gate = DurableDeferred.make("AbandonedSharedScope/Gate") + const workflow = Workflow.make("AbandonedSharedScope", { + payload: {}, + idempotencyKey: () => "one" + }) + const started = yield* Latch.make() + const release = yield* Latch.make() + const slow = Activity.make({ name: "slow", execute: started.open.pipe(Effect.andThen(release.await)) }) + const after = Activity.make({ name: "after", execute: Effect.void }) + let savedInstance: WorkflowInstance["Service"] | undefined + const layer = workflow.toLayer(() => + Effect.gen(function*() { + savedInstance ??= yield* WorkflowInstance + yield* DurableDeferred.await(gate) + yield* slow + yield* after + }) + ).pipe(Layer.provideMerge(makeTestWorkflowEngine({ config: { entityTerminationTimeout: Duration.minutes(1) } }))) + + const scope = yield* Scope.make() + const context = yield* Layer.buildWithScope(layer, scope) + const executionId = yield* workflow.execute({}, { discard: true }).pipe(Effect.provide(context)) + yield* pollUntil(workflow, executionId, "Suspended").pipe(Effect.provide(context)) + assert.isDefined(savedInstance) + + yield* DurableDeferred.succeed(gate, { + token: DurableDeferred.tokenFromExecutionId(gate, { workflow, executionId }), + value: undefined + }).pipe(Effect.provide(context)) + yield* advanceUntil(() => started.isOpen(), "run 2 slow activity must start").pipe(Effect.provide(context)) + + const cleanup: Array = [] + yield* Effect.gen(function*() { + yield* Scope.addFinalizer(savedInstance!.scope, Effect.sync(() => cleanup.push("local"))) + yield* Workflow.addFinalizer(() => Effect.sync(() => cleanup.push("durable"))) + yield* Workflow.withCompensation(Effect.void, () => Effect.sync(() => cleanup.push("comp"))) + }).pipe(Effect.provideService(WorkflowInstance, savedInstance), Scope.provide(savedInstance.scope)) + + const shutdown = yield* Effect.forkChild(Scope.close(scope, Exit.void), { startImmediately: true }) + for (let i = 0; i < 100 && shutdown.pollUnsafe() === undefined; i++) yield* TestClock.adjust(10) + yield* release.open + for (let i = 0; i < 100 && shutdown.pollUnsafe() === undefined; i++) yield* TestClock.adjust(10) + yield* TestClock.adjust(Duration.minutes(1)) + yield* Fiber.join(shutdown) + + assert.deepStrictEqual(cleanup, ["local"]) + })) + it.effect("wakes an activity deferred completed before a parallel sibling lets the workflow suspend", () => Effect.gen(function*() { const gate = DurableDeferred.make("EarlyActivityWake/Gate", { success: Schema.String }) @@ -504,6 +651,170 @@ describe.concurrent("ClusterWorkflowEngine", () => { }).pipe(Effect.provide(layer(false))) })) + for (const mode of ["sequential", "queued", "pre-persisted"] as const) { + it.effect(`releases a rebalanced shard promptly after an in-flight activity completes (${mode})`, () => + Effect.gen(function*() { + const otherRunner = Runner.make({ + address: RunnerAddress.make("localhost", 9999), + groups: ["default"], + weight: 1 + }) + let assignSelf = true + const releases: Array = [] + const runnerStorage = Layer.effect( + RunnerStorage.RunnerStorage, + Effect.map(RunnerStorage.makeMemory, (storage) => + RunnerStorage.RunnerStorage.of({ + ...storage, + getRunners: Effect.map( + storage.getRunners, + (runners) => + assignSelf ? runners : [...runners.map(([runner]) => [runner, false] as const), [otherRunner, true]] + ), + release: (_address, shardId) => + Effect.sync(() => { + releases.push(shardId) + }) + })) + ) + const storage = yield* makeSharedStorage + let queuedSaves = 0 + let hideQueued = mode !== "sequential" + const isQueuedActivity = (envelope: Message.Incoming["envelope"] | Message.Outgoing["envelope"]) => + envelope._tag === "Request" && + envelope.tag === "activity" && + (envelope.payload as { readonly name?: string }).name === "queued" + const visible = (messages: Array>) => + hideQueued ? messages.filter((message) => !isQueuedActivity(message.envelope)) : messages + const storageLayer = Layer.succeed(MessageStorage.MessageStorage, { + ...storage, + saveRequest: (message) => + Effect.tap( + storage.saveRequest(message), + () => + Effect.sync(() => { + if (isQueuedActivity(message.envelope)) queuedSaves++ + }) + ), + unprocessedMessages: (shardIds, options) => + Effect.map(storage.unprocessedMessages(shardIds, options), visible), + unprocessedMessagesById: (ids) => Effect.map(storage.unprocessedMessagesById(ids), visible) + }) + const workflow = Workflow.make(`RebalanceHandoff/${mode}`, { + payload: {}, + idempotencyKey: () => "one" + }) + const runs = { slow: 0, after: 0, queued: 0 } + const started = yield* Latch.make() + const release = yield* Latch.make() + const slow = Activity.make({ + name: "slow", + execute: Effect.gen(function*() { + runs.slow++ + yield* started.open + yield* release.await + }) + }) + const queued = Activity.make({ + name: "queued", + success: Schema.String, + execute: Effect.sync(() => { + runs.queued++ + return "queued" + }) + }) + const after = Activity.make({ + name: "after", + execute: Effect.sync(() => { + runs.after++ + }) + }) + const layer = workflow.toLayer(() => + Effect.gen(function*() { + if (mode === "sequential") { + yield* slow + } else { + yield* Effect.all([slow, queued], { concurrency: "unbounded" }) + } + yield* after + }) + ).pipe( + Layer.provideMerge(makeTestWorkflowEngine({ + shardingLayer: Sharding.layer.pipe(Layer.provide(runnerStorage)), + storageLayer, + config: { + shardsPerGroup: 1, + availableShardGroups: ["default"], + assignedShardGroups: ["default"], + entityTerminationTimeout: Duration.seconds(90), + entityMessagePollInterval: 10, + refreshAssignmentsInterval: 10 + } + })) + ) + + yield* Effect.gen(function*() { + const sharding = yield* Sharding.Sharding + const shardId = ShardId.make("default", 1) + yield* advanceUntil(() => sharding.hasShardId(shardId), "runner must acquire the shard", 10, 500) + + const executionId = yield* workflow.executionId({}) + const sharedCaller = mode === "pre-persisted" + ? yield* (yield* Entity.make(`Workflow/${workflow._tag}`, [RecoveryActivityRpc]).client)(executionId) + .activity({ name: "queued", attempt: 1, withTransaction: false }) + .pipe(Effect.forkScoped({ startImmediately: true })) + : undefined + if (sharedCaller) { + yield* advanceUntil(() => queuedSaves >= 1, "pre-persisted activity must be saved", 10, 500) + } + + yield* workflow.execute({}, { discard: true }) + const expectedQueuedSaves = mode === "sequential" ? 0 : mode === "queued" ? 1 : 2 + yield* advanceUntil( + () => started.isOpen() && queuedSaves >= expectedQueuedSaves, + "in-flight activity must start", + 10, + 500 + ) + + assignSelf = false + yield* advanceUntil(() => !sharding.hasShardId(shardId), "runner must drop the moved shard", 10, 500) + yield* TestClock.adjust(1000) + assert.strictEqual(releases.length, 0, "shard release must wait for the in-flight activity") + + yield* release.open + yield* TestClock.adjust(1000) + const released = releases.length > 0 + // A stalled release also stalls teardown, so let it time out before failing. + if (!released) yield* TestClock.adjust(Duration.seconds(90)) + assert.isTrue(released, "shard must be released promptly without waiting for entityTerminationTimeout") + assert.deepStrictEqual(runs, { slow: 1, after: 0, queued: 0 }) + if (sharedCaller) assert.isUndefined(sharedCaller.pollUnsafe(), "shared caller must remain waiting") + + assignSelf = true + hideQueued = false + yield* advanceUntil(() => sharding.hasShardId(shardId), "runner must reacquire the shard", 10, 500) + assert.deepStrictEqual( + yield* pollUntil(workflow, executionId, "Complete"), + new Workflow.Complete({ exit: Exit.void }) + ) + assert.deepStrictEqual(runs, { slow: 1, after: 1, queued: mode === "sequential" ? 0 : 1 }) + if (sharedCaller) { + yield* advanceUntil( + () => sharedCaller.pollUnsafe() !== undefined, + "shared caller must receive the activity reply", + 10, + 500 + ) + assert.deepStrictEqual( + yield* Fiber.join(sharedCaller), + new Workflow.Complete({ exit: Exit.succeed("queued") }) + ) + } + }).pipe(Effect.provide(layer)) + })) + } + it.effect("retries an early activity registered while its Suspended reply is still being persisted", () => Effect.gen(function*() { const workflow = Workflow.make("EarlyActivity", { @@ -816,7 +1127,10 @@ describe.concurrent("ClusterWorkflowEngine", () => { const storageLayer = Layer.succeed(MessageStorage.MessageStorage, { ...storage, saveRequest: (envelope) => { - if (envelope.envelope.address.entityType !== `Workflow/${Child._tag}`) { + if ( + envelope.envelope.address.entityType !== `Workflow/${Child._tag}` || + envelope.envelope.tag !== "run" + ) { return storage.saveRequest(envelope) } const save = Effect.tap(storage.saveRequest(envelope), (result) => @@ -857,6 +1171,57 @@ describe.concurrent("ClusterWorkflowEngine", () => { } } + it.effect("wakes every parent awaiting a shared child workflow", () => + Effect.gen(function*() { + const gate = DurableDeferred.make("SharedChild/Gate", { success: Schema.String }) + const Child = Workflow.make("SharedChild/Child", { + payload: { key: Schema.String }, + success: Schema.String, + idempotencyKey: ({ key }) => key + }) + const Parent = Workflow.make("SharedChild/Parent", { + payload: { name: Schema.String }, + success: Schema.String, + idempotencyKey: ({ name }) => name + }) + const layer = Layer.merge( + Child.toLayer(() => DurableDeferred.await(gate)), + Parent.toLayer(Effect.fnUntraced(function*({ name }) { + const value = yield* Child.execute({ key: "shared" }) + return `${name}:${value}` + })) + ).pipe(Layer.provideMerge(makeTestWorkflowEngine())) + + yield* Effect.gen(function*() { + const childId = yield* Child.execute({ key: "shared" }, { discard: true }) + yield* pollUntil(Child, childId, "Suspended") + + const parentA = yield* Parent.execute({ name: "A" }, { discard: true }) + yield* pollUntil(Parent, parentA, "Suspended") + + const parentB = yield* Parent.execute({ name: "B" }, { discard: true }) + yield* pollUntil(Parent, parentB, "Suspended") + + yield* DurableDeferred.succeed(gate, { + token: DurableDeferred.tokenFromExecutionId(gate, { workflow: Child, executionId: childId }), + value: "done" + }) + + assert.deepStrictEqual( + yield* pollUntil(Child, childId, "Complete"), + new Workflow.Complete({ exit: Exit.succeed("done") }) + ) + assert.deepStrictEqual( + yield* pollUntil(Parent, parentA, "Complete"), + new Workflow.Complete({ exit: Exit.succeed("A:done") }) + ) + assert.deepStrictEqual( + yield* pollUntil(Parent, parentB, "Complete"), + new Workflow.Complete({ exit: Exit.succeed("B:done") }) + ) + }).pipe(Effect.provide(layer)) + })) + it.effect("recovers an awaited deferred after a read outage exceeds the old retry budget", () => Effect.gen(function*() { const gate = DurableDeferred.make("DeferredReadRetry/Gate", { success: Schema.String }) @@ -3535,6 +3900,76 @@ describe.concurrent("ClusterWorkflowEngine", () => { assert.include(flags.get("cause"), "boom") }).pipe(Effect.provide(TestWorkflowLayer))) + it.effect("retries a failing activity under SuspendOnFailure", () => + Effect.gen(function*() { + class Failed extends Schema.TaggedError()("Failed", {}) {} + const attempts: Array = [] + const workflow = Workflow.make("SuspendOnFailureRetry", { + payload: { id: Schema.String }, + error: Failed, + idempotencyKey: ({ id }) => id + }).annotate(Workflow.SuspendOnFailure, true) + const layer = workflow.toLayer(() => + Activity.make({ + name: "step", + error: Failed, + execute: Effect.gen(function*() { + const attempt = yield* Activity.CurrentAttempt + attempts.push(attempt) + if (attempts.length <= 2) { + return yield* new Failed() + } + }) + }).pipe(Activity.retry({ times: 3 })) + ).pipe(Layer.provideMerge(makeTestWorkflowEngine())) + + yield* Effect.gen(function*() { + const executionId = yield* workflow.execute({ id: "a" }, { discard: true }) + const result = yield* pollUntil(workflow, executionId, "Complete") + assert.deepStrictEqual(result, new Workflow.Complete({ exit: Exit.void })) + assert.deepStrictEqual(attempts, [1, 2, 3]) + }).pipe(Effect.provide(layer)) + })) + + it.effect("parks an exhausted Activity.retry under SuspendOnFailure and replays stored failures on resume", () => + Effect.gen(function*() { + class Failed extends Schema.TaggedError()("Failed", {}) {} + let runs = 0 + const attempts: Array = [] + const workflow = Workflow.make("SuspendOnFailureRetryExhausted", { + payload: { id: Schema.String }, + error: Failed, + idempotencyKey: ({ id }) => id + }).annotate(Workflow.SuspendOnFailure, true) + const layer = workflow.toLayer(() => { + runs++ + return Activity.make({ + name: "step", + error: Failed, + execute: Effect.gen(function*() { + const attempt = yield* Activity.CurrentAttempt + attempts.push(attempt) + return yield* new Failed() + }) + }).pipe(Activity.retry({ times: 2 })) + }).pipe(Layer.provideMerge(makeTestWorkflowEngine())) + + yield* Effect.gen(function*() { + const executionId = yield* workflow.execute({ id: "a" }, { discard: true }) + const suspended = yield* pollUntil(workflow, executionId, "Suspended") + assert.isTrue(suspended._tag === "Suspended" && suspended.failed) + assert.strictEqual(runs, 1) + assert.deepStrictEqual(attempts, [1, 2, 3]) + + yield* workflow.resume(executionId) + yield* advanceUntil(() => runs >= 2, "resume must replay the workflow body") + const replayed = yield* pollUntil(workflow, executionId, "Suspended") + assert.isTrue(replayed._tag === "Suspended" && replayed.failed) + assert.strictEqual(runs, 2) + assert.deepStrictEqual(attempts, [1, 2, 3]) + }).pipe(Effect.provide(layer)) + })) + it.effect("catchCause activity", () => Effect.gen(function*() { const flags = yield* Flags @@ -3662,7 +4097,10 @@ const pollUntil = Effect.fnUntraced(function* { yield* Fiber.await(fiber) }).pipe(Effect.provide(MemoryLayer))) + it.effect("interrupting reply handlers preserves remaining and later waiters", () => + Effect.gen(function*() { + const storage = yield* MessageStorage.MessageStorage + const request = yield* makeRequest() + yield* storage.saveRequest(request) + + const first = yield* storage.registerReplyHandler(request).pipe( + Effect.forkChild({ startImmediately: true }) + ) + yield* Fiber.interrupt(first) + + const kept = yield* storage.registerReplyHandler(request).pipe( + Effect.forkChild({ startImmediately: true }) + ) + const interrupted = yield* storage.registerReplyHandler(request).pipe( + Effect.forkChild({ startImmediately: true }) + ) + yield* Fiber.interrupt(interrupted) + + yield* storage.saveReply(yield* makeReply(request)) + yield* Fiber.join(kept) + }).pipe(Effect.provide(MemoryLayer))) + it.effect("unregisterShardReplyHandlers fails parked waiters during rebalance", () => Effect.gen(function*() { const storage = yield* MessageStorage.MessageStorage @@ -410,6 +433,43 @@ describe("MessageStorage", () => { const stored = yield* storage.repliesForUnfiltered([request.envelope.requestId]) expect(JSON.stringify(stored)).toContain("MalformedMessage") }).pipe(Effect.provide(MemoryLayer))) + + it.effect("requestsForAddress returns requests matching type, id and tag exactly across shards", () => + Effect.gen(function*() { + const storage = yield* MessageStorage.MessageStorage + const save = (id: number, options?: { + readonly rpc?: Rpc.AnyWithProps + readonly entityType?: string + readonly entityId?: string + readonly shardId?: ShardId.ShardId + }) => + makeRequest({ + ...options, + rpc: options?.rpc ?? PrimaryKeyTest, + payload: options?.rpc ? { id } : PrimaryKeyTest.payloadSchema.make({ id }) + }).pipe(Effect.tap((request) => storage.saveRequest(request))) + + const unprocessed = yield* save(1) + const processed = yield* save(2) + yield* storage.saveReply(yield* makeReply(processed)) + yield* save(3, { rpc: GetUserRpc }) + yield* save(4, { shardId: ShardId.make("default", 2) }) + yield* save(5, { rpc: Rpc.make("primarykeytest", { payload: { id: Schema.Number } }) }) + yield* save(6, { entityId: "2" }) + yield* save(7, { entityType: "Test" }) + + const found = yield* storage.requestsForAddress({ + address: unprocessed.envelope.address, + tag: PrimaryKeyTest._tag + }) + expect(found.map((r) => (r.payload as { readonly id: number }).id).sort()).toEqual([1, 2, 4]) + expect( + yield* MessageStorage.noop.requestsForAddress({ + address: unprocessed.envelope.address, + tag: PrimaryKeyTest._tag + }) + ).toEqual([]) + }).pipe(Effect.provide(MemoryLayer))) }) }) diff --git a/.repos/effect/packages/effect/test/cluster/Sharding.test.ts b/.repos/effect/packages/effect/test/cluster/Sharding.test.ts index 2c9a6a8661051..a6a3485e39484 100644 --- a/.repos/effect/packages/effect/test/cluster/Sharding.test.ts +++ b/.repos/effect/packages/effect/test/cluster/Sharding.test.ts @@ -167,6 +167,50 @@ describe("Sharding claim release regressions", { concurrent: false }, () => { }).pipe(Effect.provide(layer)) })) + it.effect("retains an unanswered keep-alive when disabled and immediately re-enabled", () => + Effect.gen(function*() { + // Persisted handlers are required to trigger the race before the release fiber runs. + const Holder = Entity.make("KeepAliveSwap", [ + Rpc.make("Enable"), + Rpc.make("Swap"), + Rpc.make("Release") + ]).annotateRpcs(ClusterSchema.Persisted, true) + const layer = Holder.toLayer(Effect.gen(function*() { + const address = yield* Entity.CurrentAddress + const keepAlive = (enabled: boolean) => + Entity.keepAlive(enabled).pipe(Effect.provideService(Entity.CurrentAddress, address)) + return Holder.of({ + Enable: () => keepAlive(true), + Swap: () => keepAlive(false).pipe(Effect.andThen(keepAlive(true))), + Release: () => keepAlive(false) + }) + })).pipe(Layer.provideMerge(CappedSharding({}))) + + yield* Effect.gen(function*() { + yield* TestClock.adjust(1) + const driver = yield* MessageStorage.MemoryDriver + const client = (yield* Holder.client)("holder") + const keepAliveReplyCounts = () => + driver.journal.flatMap((envelope) => + envelope._tag === "Request" && envelope.tag === Entity.KeepAliveRpc._tag + ? [driver.requests.get(envelope.requestId)!.replies.length] + : [] + ) + + yield* client.Enable() + yield* TestClock.adjust(1) + assert.deepStrictEqual(keepAliveReplyCounts(), [0]) + + yield* client.Swap() + yield* TestClock.adjust(1) + assert.deepStrictEqual(keepAliveReplyCounts().sort(), [0, 1], "one keep-alive must stay unanswered") + + yield* client.Release() + yield* TestClock.adjust(1) + assert.deepStrictEqual(keepAliveReplyCounts(), [1, 1], "release must answer the retained keep-alive") + }).pipe(Effect.provide(layer)) + })) + it.effect("reactivates a held keep-alive after its runner scope closes without replying", () => Effect.gen(function*() { const inner = yield* makeSharedMemoryStorage diff --git a/.repos/effect/packages/effect/test/crypto/Schema.test.ts b/.repos/effect/packages/effect/test/crypto/Schema.test.ts index 9e3268d10ca4a..26c7f8c4d3b1f 100644 --- a/.repos/effect/packages/effect/test/crypto/Schema.test.ts +++ b/.repos/effect/packages/effect/test/crypto/Schema.test.ts @@ -3,9 +3,12 @@ import * as Arbitrary from "effect/Arbitrary" import * as Config from "effect/Config" import * as ConfigProvider from "effect/ConfigProvider" import * as Aead from "effect/crypto/Aead" +import * as Cipher from "effect/crypto/Cipher" import * as CryptoError from "effect/crypto/CryptoError" import * as Digest from "effect/crypto/Digest" +import * as KeyAgreement from "effect/crypto/KeyAgreement" import * as KeyFormat from "effect/crypto/KeyFormat" +import * as KeyWrap from "effect/crypto/KeyWrap" import * as Mac from "effect/crypto/Mac" import * as Signature from "effect/crypto/Signature" import * as Effect from "effect/Effect" @@ -44,6 +47,35 @@ const failure = (exit: Exit.Exit): SchemaIssue.Leaf => } describe("Schema crypto keys", () => { + it("generates the same key schemas from their persisted algorithms", async () => { + const pss = Signature.rsaPss({ hash: Digest.sha384, modulusLength: 2048, saltLength: 16 }) + const oaep = KeyWrap.rsaOaep({ hash: Digest.sha512, modulusLength: 4096 }) + const schemas = [ + Schema.MacKey(Mac.hmacSha256), + Schema.AeadKey(Aead.aes256Gcm), + Schema.CipherKey(Cipher.aes128Ctr), + Schema.SignaturePublicKey(pss), + Schema.SignaturePrivateKey(Signature.rsaPkcs1v15({ hash: Digest.sha256, modulusLength: 3072 })), + Schema.SignaturePrivateKey({ ...pss, hash: Digest.sha512 }), + Schema.KeyAgreementPublicKey(KeyAgreement.ecdhP384), + Schema.KeyAgreementPrivateKey(KeyAgreement.x25519), + Schema.KeyWrapKey(KeyWrap.aes256Kw), + Schema.KeyWrapPublicKey(oaep), + Schema.KeyWrapPrivateKey(oaep) + ] + for (const schema of schemas) { + const document = SchemaRepresentation.toRepresentations([schema.ast]) + const json = SchemaRepresentation.toJsonMultiDocument(document) + const source = makeModule(SchemaRepresentation.fromJsonMultiDocument(json)).print() + await withGeneratedModule<{ TestRoot0: Schema.Top }>(source, ({ TestRoot0 }) => { + assert.deepStrictEqual( + SchemaRepresentation.toJsonMultiDocument(SchemaRepresentation.toRepresentations([TestRoot0.ast])), + json + ) + }) + } + }) + it.effect("declared schemas reject a key with a different operation-defining hash", () => Effect.gen(function*() { const pair = NodeCrypto.generateKeyPairSync("ec", { namedCurve: "P-256" }) diff --git a/.repos/effect/packages/effect/test/encoding/Base64.test.ts b/.repos/effect/packages/effect/test/encoding/Base64.test.ts index fd56174537bb5..e5a451f9faaa3 100644 --- a/.repos/effect/packages/effect/test/encoding/Base64.test.ts +++ b/.repos/effect/packages/effect/test/encoding/Base64.test.ts @@ -1,8 +1,8 @@ -import { assert, describe, it } from "@effect/vitest" +import { assert, describe, it, vi } from "@effect/vitest" import { Result } from "effect" import * as Base64 from "effect/encoding/Base64" import type * as EncodingError from "effect/encoding/EncodingError" -import { describeWithFallback } from "../utils/encoding.ts" +import { describeWithFallback, describeWithoutNatives } from "../utils/encoding.ts" describeWithFallback("Base64", () => { it("encodes and decodes binary subarrays with and without padding", () => { @@ -172,6 +172,22 @@ describeWithFallback("Base64", () => { }) }) +describeWithoutNatives("Base64 Buffer fallback", () => { + it("encodes and decodes with Buffer", () => { + const bytes = Uint8Array.from({ length: 96 }, (_, i) => (i * 151) & 0xff) + const encoded = btoa(String.fromCharCode(...bytes)) + const from = vi.spyOn(Buffer, "from") + try { + assert.strictEqual(Base64.encode(bytes), encoded) + assert.strictEqual(from.mock.calls.length, 1) + assert.deepStrictEqual(Result.getOrThrow(Base64.decode(encoded)), bytes) + assert.strictEqual(from.mock.calls.length, 2) + } finally { + from.mockRestore() + } + }) +}) + const assertFailure = (raw: string, stripped: string, expected: string) => { const results: ReadonlyArray> = [ Base64.decode(raw), diff --git a/.repos/effect/packages/effect/test/encoding/Base64Url.test.ts b/.repos/effect/packages/effect/test/encoding/Base64Url.test.ts index e6c78d4817b4f..95161717d1aaa 100644 --- a/.repos/effect/packages/effect/test/encoding/Base64Url.test.ts +++ b/.repos/effect/packages/effect/test/encoding/Base64Url.test.ts @@ -1,8 +1,8 @@ -import { assert, it } from "@effect/vitest" +import { assert, it, vi } from "@effect/vitest" import { Result } from "effect" import * as Base64Url from "effect/encoding/Base64Url" import type * as EncodingError from "effect/encoding/EncodingError" -import { describeWithFallback } from "../utils/encoding.ts" +import { describeWithFallback, describeWithoutNatives } from "../utils/encoding.ts" describeWithFallback("Base64Url", () => { it("encodes strings and bytes without padding", () => { @@ -133,6 +133,22 @@ describeWithFallback("Base64Url", () => { }) }) +describeWithoutNatives("Base64Url Buffer fallback", () => { + it("encodes and decodes padded input with Buffer", () => { + const bytes = Uint8Array.from({ length: 97 }, (_, i) => (i * 151) & 0xff) + const padded = btoa(String.fromCharCode(...bytes)).replace(/\+/g, "-").replace(/\//g, "_") + const from = vi.spyOn(Buffer, "from") + try { + assert.strictEqual(Base64Url.encodePadded(bytes), padded) + assert.strictEqual(from.mock.calls.length, 1) + assert.deepStrictEqual(Result.getOrThrow(Base64Url.decode(padded)), bytes) + assert.strictEqual(from.mock.calls.length, 2) + } finally { + from.mockRestore() + } + }) +}) + const assertFailure = (raw: string, stripped: string, expected: string) => { const results: ReadonlyArray> = [ Base64Url.decode(raw), diff --git a/.repos/effect/packages/effect/test/encoding/Xml.test.ts b/.repos/effect/packages/effect/test/encoding/Xml.test.ts index 51a9b92e1de53..7498a31298a1b 100644 --- a/.repos/effect/packages/effect/test/encoding/Xml.test.ts +++ b/.repos/effect/packages/effect/test/encoding/Xml.test.ts @@ -33,9 +33,13 @@ const encodeString = (events: ReadonlyArray) => Stream.mkString ) -const elements = (xml: string, path: ReadonlyArray, options?: Xml.ElementsOptions) => +const elements = ( + xml: string, + path: ReadonlyArray, + options?: Xml.ElementsOptions & Xml.DecodeOptions +) => Stream.make(xml).pipe( - Stream.pipeThroughChannel(Xml.decodeString()), + Stream.pipeThroughChannel(Xml.decodeString(options)), Stream.pipeThroughChannel(Xml.elements(path, options)), Stream.runCollect ) @@ -370,7 +374,9 @@ describe("Xml", () => { assert.throws(() => Xml.elements(["a"], { maxElementSize: value })) } assert.throws(() => Xml.elements([])) - assert.throws(() => Xml.elements(["a b"])) + for (const segment of ["a b", "{urn:a", "{*}*", "{urn:a}b:c", "a}b"]) { + assert.throws(() => Xml.elements([segment]), segment) + } assert.throws(() => Xml.decodeString({ namespaces: "lenient" } as unknown as Xml.DecodeOptions)) }) }) @@ -593,6 +599,27 @@ describe("Xml", () => { ]) })) + it.effect("matches namespaces in Clark notation", () => + Effect.gen(function*() { + const xml = "" + const collect = (segment: string) => elements(xml, ["r", segment], { namespaces: "strict" }) + const names = (segment: string) => Effect.map(collect(segment), (items) => items.map((item) => item.name)) + assert.deepStrictEqual(yield* names("{*}item"), ["x:item", "y:item", "item"]) + assert.deepStrictEqual(yield* names("{}item"), ["item"]) + assert.deepStrictEqual(yield* names("x:item"), ["x:item"]) + assert.deepStrictEqual(yield* collect("{urn:a}b}item"), [ + { + name: "x:item", + namespace: "urn:a}b", + localName: "item", + attributes: {}, + children: [{ name: "y:child", namespace: "urn:a}b", localName: "child", attributes: {}, children: [] }] + }, + { name: "y:item", namespace: "urn:a}b", localName: "item", attributes: {}, children: [] } + ]) + assert.strictEqual((yield* Effect.flip(elements("", ["other", "{}item"]))).kind, "InvalidEvent") + })) + it.effect("fails on oversized elements and unbalanced events", () => Effect.gen(function*() { // Sizes count names, attribute names and values, and text, and restart for each element @@ -635,6 +662,23 @@ describe("Xml", () => { ]) }) + it.effect("keeps the namespaces of strictly decoded trees", () => + Effect.gen(function*() { + const [tree] = yield* elements("", ["{urn:p}r"], { namespaces: "strict" }) + const events = Xml.toEvents(tree) + assert.deepStrictEqual(events, [ + { _tag: "StartElement", name: "p:r", attributes: { "xmlns:p": "urn:p" }, namespace: "urn:p", localName: "r" }, + { _tag: "StartElement", name: "c", attributes: {}, namespace: "", localName: "c" }, + { _tag: "EndElement", name: "c", namespace: "", localName: "c" }, + { _tag: "EndElement", name: "p:r", namespace: "urn:p", localName: "r" } + ]) + const collected = yield* Stream.fromIterable(events).pipe( + Stream.pipeThroughChannel(Xml.elements(["{urn:p}r", "{}c"])), + Stream.runCollect + ) + assert.deepStrictEqual(collected, [{ name: "c", namespace: "", localName: "c", attributes: {}, children: [] }]) + })) + it("converts deep trees without overflowing the stack", () => { let element: Xml.Element = { name: "a", attributes: {}, children: [] } for (let i = 0; i < 100_000; i++) element = { name: "a", attributes: {}, children: [element] } diff --git a/.repos/effect/packages/effect/test/http/FetchHttpClient.test.ts b/.repos/effect/packages/effect/test/http/FetchHttpClient.test.ts index 89d1431da495a..a053d5689abd5 100644 --- a/.repos/effect/packages/effect/test/http/FetchHttpClient.test.ts +++ b/.repos/effect/packages/effect/test/http/FetchHttpClient.test.ts @@ -36,6 +36,10 @@ const streamRequest = () => ) describe("FetchHttpClient", { concurrent: false }, () => { + afterEach(() => { + vi.unstubAllGlobals() + }) + it.effect("sends bodies from Web requests", () => Effect.gen(function*() { const request = HttpClientRequest.fromWeb( @@ -90,11 +94,36 @@ describe("FetchHttpClient", { concurrent: false }, () => { ) }) - describe("streaming request bodies", () => { - afterEach(() => { - vi.unstubAllGlobals() - }) + it.effect("uses the current globalThis.fetch on each request by default", () => + Effect.gen(function*() { + const calls: Array = [] + const stubFetch = (label: string) => { + vi.stubGlobal( + "fetch", + makeFetch(async () => { + calls.push(label) + return new Response() + }) + ) + } + stubFetch("first") + const client = yield* HttpClient.HttpClient + yield* client.get("https://example.test/1") + stubFetch("second") + yield* client.get("https://example.test/2") + yield* client.get("https://example.test/3").pipe( + Effect.provideService( + FetchHttpClient.Fetch, + makeFetch(async () => { + calls.push("override") + return new Response() + }) + ) + ) + assert.deepStrictEqual(calls, ["first", "second", "override"]) + }).pipe(Effect.provide(FetchHttpClient.layer))) + describe("streaming request bodies", () => { it.effect("rejects unsupported streaming without sending the request", () => Effect.gen(function*() { const FetchHttpClient = yield* loadUnsupportedRuntime() diff --git a/.repos/effect/packages/effect/test/http/Headers.test.ts b/.repos/effect/packages/effect/test/http/Headers.test.ts index f2695e5c7067d..32b13df15172b 100644 --- a/.repos/effect/packages/effect/test/http/Headers.test.ts +++ b/.repos/effect/packages/effect/test/http/Headers.test.ts @@ -47,6 +47,14 @@ describe("Headers", () => { deepStrictEqual({ ...headers }, { accept: "text/html, application/json" }) }) + it("append creates, joins and ignores an empty value", () => { + const created = Headers.append(Headers.empty, "Vary", "Accept") + const joined = Headers.append(created, "vary", "Origin") + deepStrictEqual({ ...created }, { vary: "Accept" }) + deepStrictEqual({ ...joined }, { vary: "Accept, Origin" }) + deepStrictEqual({ ...Headers.append(joined, "Vary", "") }, { vary: "Accept, Origin" }) + }) + it("remove", () => { const headers = Headers.fromInput({ foo: "bar", baz: "qux", hello: "world" }) const result = Headers.remove(headers, "baz") @@ -259,3 +267,62 @@ describe("RetryAfter", () => { assertFalse(is({ _tag: "Duration", duration: Duration.infinity })) }) }) + +describe("Link", () => { + it("parses quoted values containing commas and semicolons and multiple relation types", () => { + deepStrictEqual( + Headers.parseLink("; title=\"Page 2, continued; details\"; rel=\"next last\""), + [{ target: "/items?page=2", rel: ["next", "last"], params: { title: "Page 2, continued; details" } }] + ) + }) + + it("parses mixed case names, tokens, valueless and repeated parameters and title*", () => { + deepStrictEqual( + Headers.parseLink( + "; REL=Preload; AS=script; nopush, " + + "; rel=\"alternate\"; hreflang=de; hreflang=fr; title=\"plain\"; title*=UTF-8''Gr%C3%BC%C3%9Fe" + ), + [ + { target: "https://a.example/app.js", rel: ["preload"], params: { as: "script", nopush: "" } }, + { target: "https://b.example/de", rel: ["alternate"], params: { hreflang: "de", title: "Grüße" } } + ] + ) + }) + + it("stops at malformed input and keeps the links read so far", () => { + deepStrictEqual(Headers.parseLink("; rel=\"next\", garbage"), [{ target: "a", rel: ["next"], params: {} }]) + deepStrictEqual(Headers.parseLink("garbage"), []) + deepStrictEqual(Headers.parseLink("; title=\"x\\"), [{ target: "a", rel: [], params: { title: "x" } }]) + }) + + it("ends parameter names at whitespace and keeps the first rel and extended parameter", () => { + deepStrictEqual(Headers.parseLink("; rel=next; anchor junk, ; rel=last"), [ + { target: "a", rel: ["next"], params: { anchor: "" } } + ]) + deepStrictEqual( + Headers.parseLink("; rel=prev; rel*=UTF-8''next; title=plain; title*=bad; title*=UTF-8''later"), + [{ target: "a", rel: ["prev"], params: { title: "plain" } }] + ) + }) + + it("formatLink escapes quoted values, writes non-ASCII values as name* and round trips", () => { + const links = [ + { target: "/a", rel: ["next", "https://example.com/rel;v=1,2"], params: { title: "say \"hi\" \\ there" } }, + { target: "/b", rel: ["alternate"], params: { title: "Grüße" } } + ] + const formatted = Headers.formatLink(links) + strictEqual( + formatted, + "; rel=\"next https://example.com/rel;v=1,2\"; title=\"say \\\"hi\\\" \\\\ there\", ; rel=\"alternate\"; title*=UTF-8''Gr%C3%BC%C3%9Fe" + ) + deepStrictEqual(Headers.parseLink(formatted), links) + strictEqual(Headers.formatLink([{ target: "/c", rel: ["x\"; a=\"b c"] }]), "; rel=\"x%22;%20a=%22b%20c\"") + }) + + it("Schema.LinkHeaderFromString decodes and encodes through Schema", () => { + const header = "; rel=\"canonical\"" + const links = Schema.decodeUnknownSync(Schema.LinkHeaderFromString)(header) + deepStrictEqual(links, [{ target: "https://example.com/", rel: ["canonical"], params: {} }]) + strictEqual(Schema.encodeSync(Schema.LinkHeaderFromString)(links), header) + }) +}) diff --git a/.repos/effect/packages/effect/test/http/HttpClient.test.ts b/.repos/effect/packages/effect/test/http/HttpClient.test.ts index 6b751ad6cc1dd..81d3ef7a9eb6b 100644 --- a/.repos/effect/packages/effect/test/http/HttpClient.test.ts +++ b/.repos/effect/packages/effect/test/http/HttpClient.test.ts @@ -195,6 +195,27 @@ describe("HttpClient", () => { assert.deepStrictEqual(bytes, Array.from(new TextEncoder().encode("data: hello\n\n"))) })) + it("HttpClientResponse.link resolves the first matching link against the request URL", () => { + const request = HttpClientRequest.get("https://example.com/items") + const response = HttpClientResponse.fromWeb( + request, + new Response(null, { + headers: { + link: "; rel=\"next\"; anchor=\"#frag\", " + + "; title=\"Page 2, continued; details\"; rel=\"next last\"" + } + }) + ) + + assert.deepStrictEqual( + Option.map(HttpClientResponse.link(response, "next"), (url) => url.href), + Option.some("https://example.com/items?page=2") + ) + assert.isTrue( + Option.isNone(HttpClientResponse.link(HttpClientResponse.fromWeb(request, new Response(null)), "next")) + ) + }) + it.skipIf(process.versions.bun !== undefined || process.versions.deno !== undefined)( "does not retain unread responses without FinalizationRegistry", async () => { diff --git a/.repos/effect/packages/effect/test/http/HttpClientRequest.test.ts b/.repos/effect/packages/effect/test/http/HttpClientRequest.test.ts index 80ccd953414d2..90b28fd519601 100644 --- a/.repos/effect/packages/effect/test/http/HttpClientRequest.test.ts +++ b/.repos/effect/packages/effect/test/http/HttpClientRequest.test.ts @@ -267,6 +267,17 @@ describe("HttpClientRequest", () => { }) }) + describe("appendHeader", () => { + it("joins onto an existing header", () => { + const request = HttpClientRequest.get("/").pipe( + HttpClientRequest.setHeader("Accept", "text/html"), + HttpClientRequest.appendHeader("accept", "application/json") + ) + + strictEqual(request.headers.accept, "text/html, application/json") + }) + }) + describe("removeHeader", () => { it("removes an existing header", () => { const request = HttpClientRequest.get("/").pipe( diff --git a/.repos/effect/packages/effect/test/http/HttpMiddleware.test.ts b/.repos/effect/packages/effect/test/http/HttpMiddleware.test.ts index 19ea3c8824941..01a793b39fd5c 100644 --- a/.repos/effect/packages/effect/test/http/HttpMiddleware.test.ts +++ b/.repos/effect/packages/effect/test/http/HttpMiddleware.test.ts @@ -133,6 +133,22 @@ describe("HttpMiddleware", () => { assert.strictEqual(response.headers.get("vary"), "Origin") }) ) + + it.effect("sends access-control-max-age when maxAge is 0", () => + Effect.gen(function*() { + const handler = HttpEffect.toWebHandler( + Effect.succeed(HttpServerResponse.empty()).pipe(HttpMiddleware.cors({ maxAge: 0 })) + ) + const response = yield* Effect.promise(() => + handler( + new Request("http://localhost/", { + method: "OPTIONS", + headers: { Origin: "https://client.example" } + }) + ) + ) + assert.strictEqual(response.headers.get("access-control-max-age"), "0") + })) }) describe("logger", () => { diff --git a/.repos/effect/packages/effect/test/http/HttpServerResponse.test.ts b/.repos/effect/packages/effect/test/http/HttpServerResponse.test.ts index 3ee1198a6dda5..91e51a81b58b5 100644 --- a/.repos/effect/packages/effect/test/http/HttpServerResponse.test.ts +++ b/.repos/effect/packages/effect/test/http/HttpServerResponse.test.ts @@ -208,6 +208,18 @@ describe("HttpServerResponse", () => { assert.strictEqual(response.headers["content-length"], "1") }) + it("appendHeader keeps an existing Link header", () => { + const response = HttpServerResponse.empty().pipe( + HttpServerResponse.appendHeader("Link", "; rel=\"canonical\""), + HttpServerResponse.appendHeader("Link", "; rel=\"alternate\"; hreflang=\"de\"") + ) + + assert.strictEqual( + response.headers.link, + "; rel=\"canonical\", ; rel=\"alternate\"; hreflang=\"de\"" + ) + }) + it("keeps explicit content headers when the status, cookies or other headers change", () => { const response = HttpServerResponse.text("body").pipe( HttpServerResponse.setHeaders({ "content-type": "text/custom", "content-length": "1", "x-test": "ok" }) diff --git a/.repos/effect/packages/effect/test/http/SchemaRepresentation.test.ts b/.repos/effect/packages/effect/test/http/SchemaRepresentation.test.ts index 9980f9af30413..d936a0ef8bd3f 100644 --- a/.repos/effect/packages/effect/test/http/SchemaRepresentation.test.ts +++ b/.repos/effect/packages/effect/test/http/SchemaRepresentation.test.ts @@ -1,5 +1,6 @@ import { assert, describe, it } from "@effect/vitest" import { Schema, SchemaRepresentation } from "effect" +import * as Multipart from "effect/http/Multipart" import { assertSchemas, makeModule } from "../utils/schemaCodegen.ts" describe("HTTP schema representations", () => { @@ -8,7 +9,8 @@ describe("HTTP schema representations", () => { Schema.Headers.ast, Schema.Cookies.ast, Schema.Cookie.ast, - Schema.UrlParams.ast + Schema.UrlParams.ast, + Multipart.PersistedFileSchema.ast ]) assert.deepStrictEqual( @@ -19,7 +21,8 @@ describe("HTTP schema representations", () => { { id: "effect/http/Headers", payload: null }, { id: "effect/http/Cookies", payload: null }, { id: "effect/http/Cookie", payload: null }, - { id: "effect/http/UrlParams", payload: null } + { id: "effect/http/UrlParams", payload: null }, + { id: "effect/http/PersistedFile", payload: null } ] ) @@ -27,12 +30,17 @@ describe("HTTP schema representations", () => { TestRoot0: { runtime: `Schema.Headers.annotate({ "expected": "Headers" })`, Type: "Headers.Headers" }, TestRoot1: { runtime: `Schema.Cookies.annotate({ "expected": "Cookies" })`, Type: "Cookies.Cookies" }, TestRoot2: { runtime: `Schema.Cookie.annotate({ "expected": "Cookie" })`, Type: "Cookies.Cookie" }, - TestRoot3: { runtime: `Schema.UrlParams.annotate({ "expected": "UrlParams" })`, Type: "UrlParams.UrlParams" } + TestRoot3: { runtime: `Schema.UrlParams.annotate({ "expected": "UrlParams" })`, Type: "UrlParams.UrlParams" }, + TestRoot4: { + runtime: `Multipart.PersistedFileSchema.annotate({ "expected": "PersistedFile" })`, + Type: "Multipart.PersistedFile" + } }, [ `import * as Schema from "effect/Schema"`, `import * as Headers from "effect/http/Headers"`, `import * as Cookies from "effect/http/Cookies"`, - `import * as UrlParams from "effect/http/UrlParams"` + `import * as UrlParams from "effect/http/UrlParams"`, + `import * as Multipart from "effect/http/Multipart"` ]) }) }) diff --git a/.repos/effect/packages/effect/test/httpapi/HttpApiBuilder.test.ts b/.repos/effect/packages/effect/test/httpapi/HttpApiBuilder.test.ts index 11c3e783f28cd..2f3c237d5f35f 100644 --- a/.repos/effect/packages/effect/test/httpapi/HttpApiBuilder.test.ts +++ b/.repos/effect/packages/effect/test/httpapi/HttpApiBuilder.test.ts @@ -8,8 +8,10 @@ import { Fiber, FileSystem, Layer, + Logger, Path, Redacted, + References, Schema, SchemaTransformation, Stream, @@ -2179,6 +2181,104 @@ describe("HttpApiBuilder RedactedNames", () => { const error = Cause.squash(failed.status.exit.cause) as HttpServerError.HttpServerError assert.strictEqual(error.request.url, "/build/REDACTED?remote=REDACTED&t=fail") }) + + it("redacts Redacted path, query and header fields in server spans and route logs without listing them", async () => { + const Api = HttpApi.make("Api").add( + HttpApiGroup.make("images").add( + HttpApiEndpoint.post("build", "/build/:token", { + params: { token: Schema.RedactedFromValue(Schema.String) }, + query: { remote: Schema.RedactedFromValue(Schema.String), t: Schema.String }, + headers: { "x-registry-config": Schema.optional(Schema.RedactedFromValue(Schema.String)) }, + success: Schema.String + }), + HttpApiEndpoint.get("recordParam", "/record/:tok$1", { + params: Schema.Record(Schema.String, Schema.RedactedFromValue(Schema.String)), + success: Schema.String + }) + ) + ).annotate(HttpApi.RedactedNames, { params: ["tenant"] }) + let received: unknown + let receivedRecord: unknown + const GroupLayer = HttpApiBuilder.group( + Api, + "images", + (handlers) => + handlers + .handle("build", ({ headers, params, query }) => + Effect.sync(() => { + received = { + token: Redacted.value(params.token), + remote: Redacted.value(query.remote), + config: headers["x-registry-config"] && Redacted.value(headers["x-registry-config"]) + } + return "ok" + })) + .handle("recordParam", ({ params }) => + Effect.sync(() => { + receivedRecord = Redacted.value(params["tok$1"]) + return "ok" + })) + ) + const spans: Array = [] + const tracer = Tracer.make({ + span(options) { + const span = new Tracer.NativeSpan(options) + spans.push(span) + return span + } + }) + const loggedUrls: Array = [] + const logger = Logger.make((options) => { + loggedUrls.push(options.fiber.getRef(References.CurrentLogAnnotations)["http.url"]) + }) + const prefixed = Layer.effect( + HttpRouter.HttpRouter, + Effect.map(HttpRouter.HttpRouter, (router) => router.prefixed("/t/:tenant")) + ) + const { dispose, handler } = HttpRouter.toWebHandler( + HttpApiBuilder.layer(Api).pipe(Layer.provide(prefixed), Layer.provide(GroupLayer), Layer.provide(TestServices)) + ) + const context = Context.make(Tracer.Tracer, tracer).pipe( + Context.add(HttpMiddleware.TracerHeaderFilter, () => true), + Context.add(Logger.CurrentLoggers, new Set([logger])) + ) + try { + const response = await handler( + new Request( + "http://localhost/t/tenant-s3cret/build/tok?remote=https%3A%2F%2Fuser%3Apass%40host%2Frepo.git&t=app", + { method: "POST", headers: { "x-registry-config": "cfg-s3cret" } } + ), + context + ) + assert.strictEqual(response.status, 200) + const recordResponse = await handler( + new Request("http://localhost/t/tenant-s3cret/record/tok-s3cret"), + context + ) + assert.strictEqual(recordResponse.status, 200) + } finally { + await dispose() + } + + const [span, recordSpan] = spans + assert.strictEqual( + span.attributes.get("url.full"), + "http://localhost/t/REDACTED/build/REDACTED?remote=REDACTED&t=app" + ) + assert.strictEqual(span.attributes.get("url.path"), "/t/REDACTED/build/REDACTED") + assert.strictEqual(span.attributes.get("url.query"), "remote=REDACTED&t=app") + assert.strictEqual(span.attributes.get("http.request.header.x-registry-config"), "") + // The handler still receives the values. + assert.deepStrictEqual(received, { + token: "tok", + remote: "https://user:pass@host/repo.git", + config: "cfg-s3cret" + }) + assert.strictEqual(recordSpan.attributes.get("url.full"), "http://localhost/t/REDACTED/record/REDACTED") + assert.strictEqual(recordSpan.attributes.get("url.path"), "/t/REDACTED/record/REDACTED") + assert.deepStrictEqual(loggedUrls, ["/t/REDACTED/build/REDACTED", "/t/REDACTED/record/REDACTED"]) + assert.strictEqual(receivedRecord, "tok-s3cret") + }) }) describe("HttpApiBuilder streaming payloads", () => { diff --git a/.repos/effect/packages/effect/test/httpapi/HttpApiClient.test.ts b/.repos/effect/packages/effect/test/httpapi/HttpApiClient.test.ts index b8cbb1538df7b..d115a26de938f 100644 --- a/.repos/effect/packages/effect/test/httpapi/HttpApiClient.test.ts +++ b/.repos/effect/packages/effect/test/httpapi/HttpApiClient.test.ts @@ -1,9 +1,10 @@ import { assert, describe, it } from "@effect/vitest" import { strictEqual } from "@effect/vitest/utils" -import { Cause, Effect, Exit, Fiber, Schema, Stream, Tracer } from "effect" +import { Cause, Effect, Exit, Fiber, Redacted, Schema, Stream, Tracer } from "effect" import { Sse } from "effect/encoding" import { HttpClient, HttpClientError, HttpClientRequest, HttpClientResponse } from "effect/http" import { HttpApi, HttpApiClient, HttpApiEndpoint, HttpApiGroup, HttpApiSchema } from "effect/http-api" +import { TestClock } from "effect/testing" describe("HttpApiClient", () => { describe("ParseOptions", () => { @@ -1275,6 +1276,176 @@ describe("HttpApiClient", () => { strictEqual(capture.span.attributes.get("url.query"), "a=REDACTED&b=REDACTED&c=REDACTED&sig=REDACTED&page=5") strictEqual(capture.sent.url, "http://test/get?a=1&b=2&c=3&sig=4&page=5") })) + + it.effect("redacts Redacted params, query, headers and GET payload fields without listing them", () => + Effect.gen(function*() { + const Api = HttpApi.make("Api").add( + HttpApiGroup.make("test").add( + HttpApiEndpoint.post("build", "/build/:token/:id", { + params: { token: Schema.RedactedFromValue(Schema.String), id: Schema.String }, + query: { + remote: Schema.RedactedFromValue(Schema.String), + filter: Schema.Struct({ secret: Schema.RedactedFromValue(Schema.String) }), + t: Schema.String + }, + headers: { + "x-token": Schema.RedactedFromValue(Schema.String), + "x-optional": Schema.optional(Schema.RedactedFromValue(Schema.String)), + "x-page": Schema.String + } + }), + HttpApiEndpoint.get("search", "/search", { + payload: { token: Schema.RedactedFromValue(Schema.String), q: Schema.String } + }) + ) + ) + const capture = captureRequest() + const client = yield* HttpApiClient.makeWith(Api, { baseUrl: "http://test", httpClient: capture.httpClient }) + + yield* capture.trace(client.test.build({ + params: { token: Redacted.make("s3cret"), id: "s3cret" }, + query: { + remote: Redacted.make("https://user:pass@host/repo.git"), + filter: { secret: Redacted.make("nested-s3cret") }, + t: "app" + }, + headers: { + "x-token": Redacted.make("hdr-s3cret"), + "x-optional": Redacted.make("opt-s3cret"), + "x-page": "1" + } + })) + + strictEqual( + capture.span.attributes.get("url.full"), + "http://test/build/REDACTED/s3cret?remote=REDACTED&filter%5Bsecret%5D=REDACTED&t=app" + ) + strictEqual(capture.span.attributes.get("url.path"), "/build/REDACTED/s3cret") + strictEqual(capture.span.attributes.get("url.query"), "remote=REDACTED&filter%5Bsecret%5D=REDACTED&t=app") + strictEqual(capture.span.attributes.get("http.request.header.x-token"), "") + strictEqual(capture.span.attributes.get("http.request.header.x-optional"), "") + strictEqual(capture.span.attributes.get("http.request.header.x-page"), "1") + // The wire is unchanged. + strictEqual( + capture.sent.url, + "http://test/build/s3cret/s3cret?remote=https%3A%2F%2Fuser%3Apass%40host%2Frepo.git&filter%5Bsecret%5D=nested-s3cret&t=app" + ) + strictEqual(capture.sent.headers["x-token"], "hdr-s3cret") + strictEqual(capture.sent.headers["x-optional"], "opt-s3cret") + + yield* capture.trace(client.test.search({ payload: { token: Redacted.make("s3cret"), q: "app" } })) + + strictEqual(capture.span.attributes.get("url.full"), "http://test/search?token=REDACTED&q=app") + strictEqual(capture.span.attributes.get("url.query"), "token=REDACTED&q=app") + strictEqual(capture.sent.url, "http://test/search?token=s3cret&q=app") + })) + + it.effect("fails closed when Redacted keys are renamed or a middleware rewrites the path prefix", () => + Effect.gen(function*() { + const Api = HttpApi.make("Api").add( + HttpApiGroup.make("test").add( + HttpApiEndpoint.post("renamedQuery", "/renamed", { + query: Schema.Struct({ token: Schema.RedactedFromValue(Schema.String), t: Schema.String }).pipe( + Schema.encodeKeys({ token: "tok" }) + ) + }), + HttpApiEndpoint.get("renamedParams", "/p/:tok/:id", { + params: Schema.Struct({ token: Schema.RedactedFromValue(Schema.String), id: Schema.String }).pipe( + Schema.encodeKeys({ token: "tok" }) + ) + }), + HttpApiEndpoint.get("recordParam", "/record/:tok$1", { + params: Schema.Record(Schema.String, Schema.RedactedFromValue(Schema.String)) + }) + ) + ) + const capture = captureRequest() + const client = yield* HttpApiClient.makeWith(Api, { + baseUrl: "http://test/api/v1", + httpClient: capture.httpClient + }) + + yield* capture.trace(client.test.renamedQuery({ query: { token: Redacted.make("s3cret"), t: "app" } })) + strictEqual(capture.span.attributes.get("url.query"), "tok=REDACTED&t=REDACTED") + strictEqual(capture.sent.url, "http://test/api/v1/renamed?tok=s3cret&t=app") + + yield* capture.trace(client.test.renamedParams({ params: { token: Redacted.make("s3cret"), id: "visible" } })) + strictEqual(capture.span.attributes.get("url.path"), "/api/v1/p/REDACTED/REDACTED") + strictEqual(capture.sent.url, "http://test/api/v1/p/s3cret/visible") + + yield* capture.trace(client.test.recordParam({ params: { tok: Redacted.make("s3cret") } })) + strictEqual(capture.span.attributes.get("url.full"), "http://test/api/v1/record/REDACTED$1") + strictEqual(capture.span.attributes.get("url.path"), "/api/v1/record/REDACTED$1") + strictEqual(capture.sent.url, "http://test/api/v1/record/s3cret$1") + + const errorClient = yield* HttpApiClient.makeWith(Api, { + baseUrl: "http://test/api/v1", + httpClient: clientFromResponse(() => new Response("boom", { status: 500 })) + }) + const recordError = yield* Effect.flip( + errorClient.test.recordParam({ params: { tok: Redacted.make("s3cret") } }) + ) + assert.include(recordError.message, "GET http://test/api/v1/record/REDACTED$1") + assert.notInclude(JSON.stringify(recordError), "s3cret") + + const rewrittenClient = yield* HttpApiClient.makeWith(Api, { + baseUrl: "http://test/api/v1", + httpClient: capture.httpClient.pipe( + HttpClient.mapRequest(HttpClientRequest.prependUrl("/s3cret")) + ) + }) + yield* capture.trace( + rewrittenClient.test.renamedParams({ params: { token: Redacted.make("s3cret"), id: "visible" } }) + ) + strictEqual(capture.span.attributes.get("url.full"), "http://test/REDACTED") + strictEqual(capture.span.attributes.get("url.path"), "/REDACTED") + })) + + it.effect("redacts Redacted path params in client error messages and JSON while keeping plain params visible", () => + Effect.gen(function*() { + const Api = HttpApi.make("Api").add( + HttpApiGroup.make("test").add( + HttpApiEndpoint.get("get", "/p/:token/:id", { + params: { token: Schema.RedactedFromValue(Schema.String), id: Schema.String } + }) + ) + ) + const httpClient = clientFromResponse(() => new Response("boom", { status: 500 })) + const client = yield* HttpApiClient.makeWith(Api, { baseUrl: "http://test", httpClient }) + + const error = yield* Effect.flip(client.test.get({ params: { token: Redacted.make("s3cret"), id: "visible" } })) + + assert.include(error.message, "GET http://test/p/REDACTED/visible") + assert.notInclude(error.message, "s3cret") + assert.include(JSON.stringify(error), "/p/REDACTED/visible") + assert.notInclude(JSON.stringify(error), "s3cret") + + const noBaseClient = yield* HttpApiClient.makeWith(Api, { httpClient }) + const invalidUrl = yield* Effect.flip( + noBaseClient.test.get({ params: { token: Redacted.make("s3cret"), id: "visible" } }) + ) + assert.isTrue(HttpClientError.isHttpClientError(invalidUrl)) + if (!HttpClientError.isHttpClientError(invalidUrl)) return + assert.include(invalidUrl.message, "GET /p/REDACTED/visible") + assert.notInclude(JSON.stringify(invalidUrl), "s3cret") + assert.notInclude(JSON.stringify(invalidUrl.reason), "s3cret") + assert.isDefined(invalidUrl.cause) + + const timeoutClient = yield* HttpApiClient.makeWith(Api, { + baseUrl: "http://test", + httpClient: HttpClient.make(() => Effect.never).pipe(HttpClient.timeout("10 millis")) + }) + const fiber = yield* Effect.forkChild( + Effect.flip(timeoutClient.test.get({ params: { token: Redacted.make("s3cret"), id: "visible" } })) + ) + yield* TestClock.adjust("10 millis") + const timeoutError = yield* Fiber.join(fiber) + assert.isTrue(HttpClientError.isHttpClientError(timeoutError)) + assert.include(timeoutError.message, "GET http://test/p/REDACTED/visible") + assert.notInclude(timeoutError.message, "s3cret") + assert.include(JSON.stringify(timeoutError), "/p/REDACTED/visible") + assert.notInclude(JSON.stringify(timeoutError), "s3cret") + })) }) it.effect("applies transformClient to endpoint clients exactly once", () => diff --git a/.repos/effect/packages/effect/test/jose/Jws.test.ts b/.repos/effect/packages/effect/test/jose/Jws.test.ts index fadefaffe7eba..4c923d546ee90 100644 --- a/.repos/effect/packages/effect/test/jose/Jws.test.ts +++ b/.repos/effect/packages/effect/test/jose/Jws.test.ts @@ -230,33 +230,45 @@ it.effect("resolves the verification key from the Jwks service by algorithm and ) }).pipe(Effect.provide(layer))) -it.effect("never exposes crypto backend diagnostics", () => +it.effect("maps crypto backend failures without exposing diagnostics", () => Effect.gen(function*() { const marker = "backend-secret-marker" - const failure = Effect.fail( - new CryptoError.CryptoError({ - module: "Mac", - method: "verify", - reason: new CryptoError.InvalidArgument({ description: marker, cause: new Error(marker) }) - }) - ) - const failing = Layer.succeed( - Mac.Mac, - Mac.Mac.of({ - generateKey: () => failure, - sign: () => failure, - verify: () => failure - }) - ) + const makeMac = (reason: CryptoError.CryptoErrorReason) => { + const fail = (method: string) => () => Effect.fail(new CryptoError.CryptoError({ module: "Mac", method, reason })) + return Layer.succeed( + Mac.Mac, + Mac.Mac.of({ generateKey: fail("generateKey"), sign: fail("sign"), verify: fail("verify") }) + ) + } const key = yield* Jwk.importSecret(Redacted.make(rfc7515.hs256.jwk), "HS256") - - const operations: Array> = [ - Jws.verify(rfc7515.hs256.token, key), - Jws.sign(utf8("payload"), key) + const operations: ReadonlyArray<{ + readonly effect: Effect.Effect + readonly method: string + readonly description: string + }> = [ + { effect: Jws.sign(utf8("payload"), key), method: "sign", description: "Could not sign with the key" }, + { effect: Jws.verify(rfc7515.hs256.token, key), method: "verify", description: "Could not verify with the key" } ] - for (const operation of operations) { - const error = yield* operation.pipe(Effect.provide(failing), Effect.flip) - assert.isTrue(JoseError.isJoseError(error)) + + const unsupported = makeMac(new CryptoError.Unsupported({ description: marker, cause: new Error(marker) })) + for (const { description, effect, method } of operations) { + const error = yield* effect.pipe(Effect.provide(unsupported), Effect.flip) + assertReason(error, "CryptoFailed") + assert.isTrue(JoseError.isJoseErrorReason(error.reason)) + assert.strictEqual(error.reason.description, description) + assert.strictEqual(error.reason.module, "Mac") + assert.strictEqual(error.reason.method, method) + assert.strictEqual(error.reason.reason, "Unsupported") + assert.strictEqual(error.message, `${description} (Mac.${method}: Unsupported)`) + assert.isUndefined(error.cause) assert.notInclude(NodeUtil.inspect(error, { depth: Infinity }), marker) } + + const invalidKey = makeMac(new CryptoError.InvalidKey({ description: marker, cause: new Error(marker) })) + const error = yield* Jws.sign(utf8("payload"), key).pipe(Effect.provide(invalidKey), Effect.flip) + assertReason(error, "InvalidKey") + assert.strictEqual(error.reason.description, "Could not sign with the key") + assert.strictEqual(error.message, "Could not sign with the key") + assert.isUndefined(error.cause) + assert.notInclude(NodeUtil.inspect(error, { depth: Infinity }), marker) }).pipe(Effect.provide(layer))) diff --git a/.repos/effect/packages/effect/test/observability/OtlpConfig.test.ts b/.repos/effect/packages/effect/test/observability/OtlpConfig.test.ts index 1e84c8e77ba92..39b5ac91090c2 100644 --- a/.repos/effect/packages/effect/test/observability/OtlpConfig.test.ts +++ b/.repos/effect/packages/effect/test/observability/OtlpConfig.test.ts @@ -1,7 +1,7 @@ import { assert, describe, it } from "@effect/vitest" import { Array as Arr, ConfigProvider, Context, Effect, Layer, Metric, Ref } from "effect" import { HttpClient, type HttpClientError, HttpClientResponse } from "effect/http" -import { Otlp, OtlpSerialization } from "effect/observability" +import { Otlp, OtlpExporter, OtlpSerialization } from "effect/observability" import { TestClock } from "effect/testing" describe("Otlp.layerFromConfig", () => { @@ -72,6 +72,52 @@ describe("Otlp.layerFromConfig", () => { OTEL_METRIC_EXPORT_INTERVAL: "1000" })) )) + + it.effect("applies OTEL queue size limits and onDrop from environment config", () => { + let dropped = 0 + return Effect.gen(function*() { + yield* Effect.log("log-1") + yield* Effect.log("log-2") + yield* Effect.log("log-3") + yield* Effect.void.pipe(Effect.withSpan("span-1")) + yield* Effect.void.pipe(Effect.withSpan("span-2")) + yield* Effect.void.pipe(Effect.withSpan("span-3")) + assert.strictEqual(dropped, 2) + + yield* (yield* OtlpExporter.Flusher).flush + const requests = yield* MockHttpClient.requests + const logRequest = findRequest(requests, "http://collector.example/v1/logs") + const traceRequest = findRequest(requests, "http://collector.example/v1/traces") + assert.isDefined(logRequest) + assert.isDefined(traceRequest) + assert.strictEqual( + (logRequest!.body as { resourceLogs: Array<{ scopeLogs: Array<{ logRecords: Array }> }> }) + .resourceLogs[0].scopeLogs[0].logRecords.length, + 2 + ) + assert.strictEqual( + (traceRequest!.body as { resourceSpans: Array<{ scopeSpans: Array<{ spans: Array }> }> }) + .resourceSpans[0].scopeSpans[0].spans.length, + 2 + ) + }).pipe( + Effect.provide(testLayer({ + OTEL_SERVICE_NAME: "otel-config-test", + OTEL_EXPORTER_OTLP_ENDPOINT: "http://collector.example", + OTEL_LOGS_EXPORTER: "otlp", + OTEL_METRICS_EXPORTER: "none", + OTEL_TRACES_EXPORTER: "otlp", + OTEL_BLRP_SCHEDULE_DELAY: "3600000", + OTEL_BLRP_MAX_EXPORT_BATCH_SIZE: "10", + OTEL_BLRP_MAX_QUEUE_SIZE: "2", + OTEL_BSP_SCHEDULE_DELAY: "3600000", + OTEL_BSP_MAX_EXPORT_BATCH_SIZE: "10", + OTEL_BSP_MAX_QUEUE_SIZE: "2" + }, (count) => { + dropped += count + })) + ) + }) }) interface CapturedRequest { @@ -103,8 +149,8 @@ class MockHttpClient extends Context.Service) => - Otlp.layerFromConfig({ loggerMergeWithExisting: false }).pipe( +const testLayer = (env: Record, onDrop?: (count: number) => void) => + Otlp.layerFromConfig({ loggerMergeWithExisting: false, onDrop }).pipe( Layer.provide(OtlpSerialization.layerJson), Layer.provideMerge(HttpClientLayer), Layer.provideMerge(ConfigProvider.layer(ConfigProvider.fromEnv({ env }))) diff --git a/.repos/effect/packages/effect/test/observability/OtlpExporter.test.ts b/.repos/effect/packages/effect/test/observability/OtlpExporter.test.ts index 439febf12bf37..8f7d781f9e102 100644 --- a/.repos/effect/packages/effect/test/observability/OtlpExporter.test.ts +++ b/.repos/effect/packages/effect/test/observability/OtlpExporter.test.ts @@ -1,5 +1,18 @@ import { assert, describe, it } from "@effect/vitest" -import { Clock, ConfigProvider, Deferred, Duration, Effect, Exit, Fiber, Layer, Metric, Ref, Scope } from "effect" +import { + Clock, + ConfigProvider, + Deferred, + Duration, + Effect, + Exit, + Fiber, + Layer, + Metric, + Option, + Ref, + Scope +} from "effect" import { type Headers, HttpBody, HttpClient, type HttpClientError, HttpClientResponse } from "effect/http" import { Otlp, OtlpExporter, OtlpLogger, OtlpMetrics, OtlpSerialization, OtlpTracer } from "effect/observability" import { TestClock } from "effect/testing" @@ -33,6 +46,9 @@ const makeExporter = ( options?: { readonly exportInterval?: Duration.Input readonly maxBatchSize?: number | "disabled" + readonly maxQueueSize?: number | undefined + readonly concurrency?: number | "unbounded" | undefined + readonly onDrop?: ((count: number) => void) | undefined readonly shutdownTimeout?: Duration.Input readonly body?: (data: Array) => HttpBody.HttpBody readonly headers?: Headers.Input | undefined @@ -44,6 +60,9 @@ const makeExporter = ( headers: options?.headers, exportInterval: options?.exportInterval ?? "1 hour", maxBatchSize: options?.maxBatchSize ?? 1, + maxQueueSize: options?.maxQueueSize, + concurrency: options?.concurrency, + onDrop: options?.onDrop, body: (data) => [options?.body?.(data) ?? HttpBody.empty, Effect.void], shutdownTimeout: options?.shutdownTimeout ?? "1 second" }).pipe( @@ -288,10 +307,10 @@ describe("OtlpExporter", () => { yield* Fiber.join(closeFiber) })) - it.effect("exports remaining telemetry concurrently and waits for all requests", () => + it.effect("exports remaining telemetry concurrently and waits for all requests on parallel scope shutdown", () => Effect.gen(function*() { - const scope = yield* Scope.make() - const { httpClient, releases, started } = yield* makeControlledHttpClient(2) + const scope = yield* Scope.make("parallel") + const { httpClient, interrupted, releases, started } = yield* makeControlledHttpClient(2) const batches: Array> = [] const exporter = yield* makeExporter(httpClient, { maxBatchSize: 2, @@ -308,12 +327,15 @@ describe("OtlpExporter", () => { const closeFiber = yield* Effect.forkChild(Scope.close(scope, Exit.void)) yield* Deferred.await(started[1]) + assert.strictEqual(yield* Ref.get(interrupted), 0) assert.deepStrictEqual(batches, [[1, 2], [3]]) - yield* Deferred.succeed(releases[0], undefined) - yield* Effect.yieldNow - assert.isUndefined(closeFiber.pollUnsafe()) + // Complete out of order: finishing batch 1 must not let shutdown return before batch 0 yield* Deferred.succeed(releases[1], undefined) + yield* yieldNowN(3) + assert.isUndefined(closeFiber.pollUnsafe()) + + yield* Deferred.succeed(releases[0], undefined) yield* Fiber.join(closeFiber) })) @@ -335,37 +357,389 @@ describe("OtlpExporter", () => { it.effect("does not initiate or wait for delivery when disabled", () => Effect.gen(function*() { const scope = yield* Scope.make() - const blocked = yield* Deferred.make() - const blockedInterrupted = yield* Deferred.make() - const failed = yield* Deferred.make() + const { httpClient, releases, started } = yield* makeControlledHttpClient(1) const attempts = yield* Ref.make(0) + const failingClient = HttpClient.makeWith( + Effect.fnUntraced(function*(requestEffect) { + const request = yield* requestEffect + yield* Ref.update(attempts, (count) => count + 1) + yield* httpClient.execute(request) + return HttpClientResponse.fromWeb(request, new Response(null, { status: 400 })) + }), + Effect.succeed as HttpClient.HttpClient.Preprocess + ) + let dropped = 0 + const flusher = yield* OtlpExporter.Flusher + const exporter = yield* OtlpExporter.make({ + label: "OtlpExporterTest", + url: "http://localhost:4318/v1/logs", + headers: undefined, + exportInterval: "1 hour", + maxBatchSize: 1, + maxQueueSize: 4, + concurrency: 1, + onDrop: (count) => { + dropped += count + }, + body: () => [HttpBody.empty, Effect.void], + shutdownTimeout: "1 second" + }).pipe( + Effect.provideService(HttpClient.HttpClient, failingClient), + Scope.provide(scope) + ) + + exporter.push({ value: 1 }) + yield* Deferred.await(started[0]) + exporter.push({ value: 2 }) + const flushFiber = yield* Effect.forkChild(flusher.flush) + yield* yieldNowN(2) + assert.isUndefined(flushFiber.pollUnsafe()) + + yield* Deferred.succeed(releases[0], undefined) + yield* Fiber.join(flushFiber) + exporter.push({ value: 3 }) + + // After cooldown expires, an idle flush must not hang on discarded queued items + yield* TestClock.adjust("61 seconds") + yield* flusher.flush + assert.strictEqual(yield* Ref.get(attempts), 1) + + yield* Scope.close(scope, Exit.void) + assert.strictEqual(yield* Ref.get(attempts), 1) + assert.strictEqual(dropped, 0) + }).pipe(Effect.provide(OtlpExporter.layerFlusher))) + + for (const phase of ["before", "during"] as const) { + it.effect(`waits for a healthy in-flight sibling on flush and shutdown ${phase} cooldown`, () => + Effect.gen(function*() { + const scope = yield* Scope.make() + const startedA = yield* Deferred.make() + const startedB = yield* Deferred.make() + const releaseA = yield* Deferred.make() + const releaseB = yield* Deferred.make() + const interruptedA = yield* Ref.make(0) + const batches: Array> = [] + let requestIndex = 0 + let dropped = 0 + + const httpClient = HttpClient.makeWith( + Effect.fnUntraced(function*(requestEffect) { + const request = yield* requestEffect + const index = requestIndex++ + if (index === 0) { + yield* Deferred.succeed(startedA, undefined) + yield* Deferred.await(releaseA).pipe( + Effect.onInterrupt(() => Ref.update(interruptedA, (count) => count + 1)) + ) + return HttpClientResponse.fromWeb(request, new Response()) + } + yield* Deferred.succeed(startedB, undefined) + yield* Deferred.await(releaseB) + return HttpClientResponse.fromWeb(request, new Response(null, { status: 400 })) + }), + Effect.succeed as HttpClient.HttpClient.Preprocess + ) + + const flusher = yield* OtlpExporter.Flusher + const exporter = yield* OtlpExporter.make({ + label: "OtlpExporterTest", + url: "http://localhost:4318/v1/logs", + headers: undefined, + exportInterval: "1 hour", + maxBatchSize: 1, + maxQueueSize: 4, + concurrency: 2, + onDrop: (count) => { + dropped += count + }, + body(data) { + batches.push(data.map((item) => item.value)) + return [HttpBody.empty, Effect.void] + }, + shutdownTimeout: "1 second" + }).pipe( + Effect.provideService(HttpClient.HttpClient, httpClient), + Scope.provide(scope) + ) + + // Start healthy A and failing B in flight, with C queued behind both slots + exporter.push({ value: 1 }) + exporter.push({ value: 2 }) + yield* Deferred.await(startedA) + yield* Deferred.await(startedB) + exporter.push({ value: 3 }) + + if (phase === "during") { + yield* Deferred.succeed(releaseB, undefined) + yield* yieldNowN(3) + exporter.push({ value: 4 }) + } + + const flushFiber = yield* Effect.forkChild(flusher.flush) + yield* yieldNowN(2) + const closeFiber = yield* Effect.forkChild(Scope.close(scope, Exit.void)) + yield* yieldNowN(2) + + if (phase === "before") { + yield* TestClock.adjust("800 millis") + yield* Deferred.succeed(releaseB, undefined) + yield* TestClock.adjust("199 millis") + } else { + yield* TestClock.adjust("999 millis") + } + + yield* yieldNowN(3) + assert.strictEqual(yield* Ref.get(interruptedA), 0) + assert.isUndefined(flushFiber.pollUnsafe()) + assert.isUndefined(closeFiber.pollUnsafe()) + assert.deepStrictEqual(batches, [[1], [2]]) + + if (phase === "before") { + // Original 1 s shutdown deadline fires at 1,000 ms without restarting when cooldown begins at 800 ms + yield* TestClock.adjust("1 millis") + yield* yieldNowN(3) + assert.isDefined(closeFiber.pollUnsafe()) + yield* Fiber.join(closeFiber) + yield* Fiber.join(flushFiber) + assert.strictEqual(yield* Ref.get(interruptedA), 1) + } else { + // Healthy sibling A finishes at 999 ms within the 1 s deadline + yield* Deferred.succeed(releaseA, undefined) + yield* Fiber.join(flushFiber) + yield* Fiber.join(closeFiber) + assert.strictEqual(yield* Ref.get(interruptedA), 0) + } + assert.deepStrictEqual(batches, [[1], [2]]) + assert.strictEqual(dropped, 0) + }).pipe(Effect.provide(OtlpExporter.layerFlusher))) + } + + it.effect("bounds pending queue separately from in-flight batches and caps concurrency including retries", () => + Effect.gen(function*() { + const scope = yield* Scope.make() + const started = yield* Effect.forEach([0, 1, 2, 3], () => Deferred.make()) + const releases = yield* Effect.forEach([0, 1, 2, 3], () => Deferred.make()) + let inFlight = 0 + let maxInFlight = 0 + let attempt = 0 + const batches: Array> = [] + const httpClient = HttpClient.makeWith( Effect.fnUntraced(function*(requestEffect) { const request = yield* requestEffect - const attempt = yield* Ref.updateAndGet(attempts, (count) => count + 1) - if (attempt === 1) { - yield* Deferred.succeed(blocked, undefined) - return yield* Effect.never.pipe( - Effect.onInterrupt(() => Deferred.succeed(blockedInterrupted, undefined)) - ) + inFlight++ + maxInFlight = Math.max(maxInFlight, inFlight) + const current = attempt++ + if (current < 4) { + yield* Deferred.succeed(started[current], undefined) + yield* Deferred.await(releases[current]) } - yield* Deferred.succeed(failed, undefined) - return HttpClientResponse.fromWeb(request, new Response(null, { status: 400 })) + inFlight-- + // First request returns 500 once so retry slot occupation is verified. + if (current === 0) { + return HttpClientResponse.fromWeb(request, new Response(null, { status: 500 })) + } + return HttpClientResponse.fromWeb(request, new Response()) }), Effect.succeed as HttpClient.HttpClient.Preprocess ) - const exporter = yield* makeExporter(httpClient).pipe(Scope.provide(scope)) + let dropped = 0 + const exporter = yield* makeExporter(httpClient, { + maxBatchSize: 2, + maxQueueSize: 3, + concurrency: 2, + onDrop: (count) => { + dropped += count + }, + body(data) { + batches.push(data.map((item) => item.value)) + return HttpBody.empty + } + }).pipe(Scope.provide(scope)) + + // Fill both concurrency slots: [1, 2] (gate 0) and [3, 4] (gate 1) exporter.push({ value: 1 }) - yield* Deferred.await(blocked) exporter.push({ value: 2 }) - yield* Deferred.await(failed) + yield* Deferred.await(started[0]) + exporter.push({ value: 3 }) + exporter.push({ value: 4 }) + yield* Deferred.await(started[1]) + + // While 4 items are in flight, pending queue still holds maxQueueSize (3) before dropping + exporter.push({ value: 5 }) + exporter.push({ value: 6 }) + exporter.push({ value: 7 }) + exporter.push({ value: 8 }) + exporter.push({ value: 9 }) + assert.strictEqual(dropped, 2) + assert.isFalse(yield* Deferred.isDone(started[2])) + + // Batch 0 returns 500 and enters 1s retry backoff; slot stays occupied so [5, 6] cannot start + yield* Deferred.succeed(releases[0], undefined) yield* yieldNowN(3) + assert.deepStrictEqual(batches, [[1, 2], [3, 4]]) + assert.isFalse(yield* Deferred.isDone(started[2])) + + // Batch 1 settles out of order -> frees a slot for FIFO batch [5, 6] (gate 2) + yield* Deferred.succeed(releases[1], undefined) + yield* Deferred.await(started[2]) + assert.deepStrictEqual(batches, [[1, 2], [3, 4], [5, 6]]) + + // Advance retry delay -> retry of [1, 2] runs (gate 3) and succeeds + yield* TestClock.adjust("1 second") + yield* Deferred.await(started[3]) + yield* Deferred.succeed(releases[3], undefined) + yield* Deferred.succeed(releases[2], undefined) + + // Remaining [7] drains on shutdown + yield* Scope.close(scope, Exit.void) + assert.deepStrictEqual(batches, [[1, 2], [3, 4], [5, 6], [7]]) + assert.strictEqual(maxInFlight, 2) + assert.strictEqual(dropped, 2) + })) + + it.effect("serializes overlapping timer and threshold exports when concurrency is 1", () => + Effect.gen(function*() { + const scope = yield* Scope.make() + const { httpClient, releases, started } = yield* makeControlledHttpClient(2) + const batches: Array> = [] + const exporter = yield* makeExporter(httpClient, { + exportInterval: "1 second", + maxBatchSize: 2, + concurrency: 1, + body(data) { + batches.push(data.map((item) => item.value)) + return HttpBody.empty + } + }).pipe(Scope.provide(scope)) + + // Arm timer with item 1, then hit threshold with item 2 + exporter.push({ value: 1 }) + exporter.push({ value: 2 }) + yield* Deferred.await(started[0]) + + // Buffer item 3 and fire the interval while [1, 2] is still in flight exporter.push({ value: 3 }) + yield* TestClock.adjust("1 second") + yield* yieldNowN(3) + assert.isFalse(yield* Deferred.isDone(started[1])) + assert.deepStrictEqual(batches, [[1, 2]]) + // Once [1, 2] finishes, item 3 exports immediately without starting concurrently + yield* Deferred.succeed(releases[0], undefined) + yield* Deferred.await(started[1]) + assert.deepStrictEqual(batches, [[1, 2], [3]]) + yield* Deferred.succeed(releases[1], undefined) yield* Scope.close(scope, Exit.void) - yield* Deferred.await(blockedInterrupted) - assert.strictEqual(yield* Ref.get(attempts), 2) + })) + + it.effect("allows unbounded concurrency when explicitly configured", () => + Effect.gen(function*() { + const scope = yield* Scope.make() + const { httpClient, releases, started } = yield* makeControlledHttpClient(5) + const exporter = yield* makeExporter(httpClient, { + maxBatchSize: 1, + concurrency: "unbounded" + }).pipe(Scope.provide(scope)) + + for (let i = 0; i < 5; i++) { + exporter.push({ value: i }) + } + // All 5 requests (> default 4) start concurrently + for (let i = 0; i < 5; i++) { + yield* Deferred.await(started[i]) + } + for (let i = 0; i < 5; i++) { + yield* Deferred.succeed(releases[i], undefined) + } + yield* Scope.close(scope, Exit.void) + })) + + it.effect("returns from scope close at shutdownTimeout even with an uninterruptible client", () => + Effect.gen(function*() { + const scope = yield* Scope.make() + const started = yield* Effect.forEach([0, 1], () => Deferred.make()) + const gate = yield* Deferred.make() + const batches: Array> = [] + let requestIndex = 0 + const httpClient = HttpClient.makeWith( + Effect.fnUntraced(function*(requestEffect) { + const request = yield* requestEffect + const index = requestIndex++ + if (index < started.length) { + yield* Deferred.succeed(started[index], undefined) + } + yield* Effect.uninterruptible(Deferred.await(gate)) + return HttpClientResponse.fromWeb(request, new Response()) + }), + Effect.succeed as HttpClient.HttpClient.Preprocess + ) + let dropped = 0 + const exporter = yield* makeExporter(httpClient, { + maxBatchSize: 1, + maxQueueSize: 4, + concurrency: 2, + shutdownTimeout: "40 millis", + onDrop: (count) => { + dropped += count + }, + body(data) { + batches.push(data.map((item) => item.value)) + return HttpBody.empty + } + }).pipe(Scope.provide(scope)) + + exporter.push({ value: 1 }) + exporter.push({ value: 2 }) + yield* Deferred.await(started[0]) + yield* Deferred.await(started[1]) + exporter.push({ value: 3 }) + + const closeFiber = yield* Effect.forkChild(Scope.close(scope, Exit.void)) + yield* TestClock.adjust("40 millis") + yield* Fiber.join(closeFiber) + assert.isFalse(yield* Deferred.isDone(gate)) + + // Releasing the gate after shutdown must not start any queued batch + yield* Deferred.succeed(gate, undefined) + yield* yieldNowN(5) + assert.deepStrictEqual(batches, [[1], [2]]) + assert.strictEqual(dropped, 0) + })) + + it.effect("normalizes fractional maxBatchSize and NaN limits without wedging or unbounding", () => + Effect.gen(function*() { + const { httpClient } = yield* makeStatusHttpClient(200) + const batches: Array> = [] + let dropped = 0 + + yield* Effect.scoped(Effect.gen(function*() { + const fractional = yield* makeExporter(httpClient, { + maxBatchSize: 1.5, + concurrency: Number.NaN, + body(data) { + batches.push(data.map((item) => item.value)) + return HttpBody.empty + } + }) + fractional.push({ value: 1 }) + fractional.push({ value: 2 }) + + const bounded = yield* makeExporter(httpClient, { + maxBatchSize: "disabled", + maxQueueSize: Number.NaN, + onDrop: (count) => { + dropped += count + } + }) + for (let i = 0; i < 2049; i++) { + bounded.push({ value: i }) + } + })) + + assert.deepStrictEqual(batches, [[1], [2]]) + assert.strictEqual(dropped, 1) })) it.effect("retries status 429 with numeric retry-after delay", () => @@ -767,5 +1141,121 @@ describe("OtlpExporter", () => { ) ) })) + + it.effect("drains in-flight and pre-flush items across out-of-order completion without cancelling", () => + Effect.gen(function*() { + const { httpClient, interrupted, releases, started } = yield* makeControlledHttpClient(4) + const batches: Array> = [] + + yield* Effect.scoped( + Effect.gen(function*() { + const exporter = yield* OtlpExporter.make({ + label: "OtlpExporterTest", + url: "http://localhost:4318/v1/logs", + headers: undefined, + exportInterval: "1 hour", + maxBatchSize: 2, + concurrency: 2, + body: (items) => { + batches.push(items.map((item) => item.value)) + return [HttpBody.empty, Effect.void] + }, + shutdownTimeout: "1 second" + }) + const flusher = yield* OtlpExporter.Flusher + + // Fill both concurrency slots: [1, 2] (gate 0) and [3, 4] (gate 1), queue [5, 6] + exporter.push({ value: 1 }) + exporter.push({ value: 2 }) + yield* Deferred.await(started[0]) + exporter.push({ value: 3 }) + exporter.push({ value: 4 }) + yield* Deferred.await(started[1]) + exporter.push({ value: 5 }) + exporter.push({ value: 6 }) + + // An interrupted flush (timeout) must not cancel in-flight exports or drop queued items + const timedOut = yield* Effect.forkChild(Effect.timeoutOption(flusher.flush, "10 millis")) + yield* TestClock.adjust("10 millis") + assert.isTrue(Option.isNone(yield* Fiber.join(timedOut))) + assert.strictEqual(yield* Ref.get(interrupted), 0) + + // Start a flush covering [1..6], then push [7, 8] after flush started + const flushFiber = yield* Effect.forkChild(flusher.flush) + yield* yieldNowN(2) + assert.isUndefined(flushFiber.pollUnsafe()) + exporter.push({ value: 7 }) + exporter.push({ value: 8 }) + + // Complete batch 1 ([3, 4]) out of order -> starts batch 2 ([5, 6]); flush still waits for batch 0 + yield* Deferred.succeed(releases[1], undefined) + yield* Deferred.await(started[2]) + assert.isUndefined(flushFiber.pollUnsafe()) + + // Complete batch 2 ([5, 6]) still before batch 0 -> starts post-flush batch 3 ([7, 8]); flush still waits + yield* Deferred.succeed(releases[2], undefined) + yield* Deferred.await(started[3]) + assert.isUndefined(flushFiber.pollUnsafe()) + + // Completing batch 0 settles all pre-flush items -> flush returns without waiting for batch 3 + yield* Deferred.succeed(releases[0], undefined) + yield* Fiber.join(flushFiber) + assert.deepStrictEqual(batches, [[1, 2], [3, 4], [5, 6], [7, 8]]) + + yield* Deferred.succeed(releases[3], undefined) + }).pipe( + Effect.provideService(HttpClient.HttpClient, httpClient), + Effect.provide(OtlpExporter.layerFlusher) + ) + ) + })) + + it.effect("drains pushed items and still exports empty snapshots when exportEmpty is enabled", () => + Effect.gen(function*() { + const { httpClient } = yield* makeStatusHttpClient(200) + const payloads: Array> = [] + let dropped = 0 + + yield* Effect.scoped( + Effect.gen(function*() { + const exporter = yield* OtlpExporter.make({ + label: "OtlpExporterTest", + url: "http://localhost:4318/v1/metrics", + headers: undefined, + exportInterval: "1 hour", + maxBatchSize: "disabled", + maxQueueSize: 2, + onDrop: (count) => { + dropped += count + }, + exportEmpty: true, + body: (items) => { + payloads.push(items) + return [HttpBody.empty, Effect.void] + }, + shutdownTimeout: "1 second" + }) + const flusher = yield* OtlpExporter.Flusher + + exporter.push({ value: 1 }) + yield* flusher.flush + exporter.push({ value: 2 }) + yield* flusher.flush + exporter.push({ value: 3 }) + yield* flusher.flush + }).pipe( + Effect.provideService(HttpClient.HttpClient, httpClient), + Effect.provide(OtlpExporter.layerFlusher) + ) + ) + + assert.strictEqual(dropped, 0) + assert.deepStrictEqual(payloads, [ + [{ value: 1 }], + [{ value: 2 }], + [{ value: 3 }], + [] + ]) + })) }) }) diff --git a/.repos/effect/packages/effect/test/observability/OtlpLogger.test.ts b/.repos/effect/packages/effect/test/observability/OtlpLogger.test.ts index 7b60ed64c7446..ebaee7afa6e96 100644 --- a/.repos/effect/packages/effect/test/observability/OtlpLogger.test.ts +++ b/.repos/effect/packages/effect/test/observability/OtlpLogger.test.ts @@ -62,8 +62,18 @@ describe("OtlpLogger", () => { yield* flush assert.lengthOf(requests, 1) }).pipe( - Effect.provide(Logger.layer([observer], { mergeWithExisting: true })), - Effect.provide(makeTestLayer(httpClient)) + Effect.provide( + OtlpLogger.layer({ + url: "http://localhost:4318/v1/logs", + resource: { serviceName: "test", serviceVersion: "service-version" }, + exportInterval: "1 hour", + mergeWithExisting: true + }).pipe( + Layer.provide(OtlpSerialization.layerJson), + Layer.provide(Layer.succeed(HttpClient.HttpClient, httpClient)) + ) + ), + Effect.provide(Logger.layer([observer], { mergeWithExisting: false })) ) }) diff --git a/.repos/effect/packages/effect/test/observability/OtlpMetrics.test.ts b/.repos/effect/packages/effect/test/observability/OtlpMetrics.test.ts index 881eb92347d30..4dd569059dd79 100644 --- a/.repos/effect/packages/effect/test/observability/OtlpMetrics.test.ts +++ b/.repos/effect/packages/effect/test/observability/OtlpMetrics.test.ts @@ -61,7 +61,7 @@ describe("OtlpMetrics", () => { ) })) - it.effect("does not regress delta checkpoints when exports complete out of order", () => + it.effect("serializes overlapping flushes and sends a fresh delta snapshot", () => Effect.scoped(Effect.gen(function*() { const bodies = yield* Ref.make>([]) const started = yield* Effect.forEach([0, 1], () => Deferred.make()) @@ -102,18 +102,22 @@ describe("OtlpMetrics", () => { yield* TestClock.adjust("1 second") yield* Metric.update(counter, 1) const second = yield* Effect.forkChild(flusher.flush) - yield* Deferred.await(started[1]) + yield* Effect.yieldNow + assert.isFalse(yield* Deferred.isDone(started[1])) - yield* Deferred.succeed(releases[1], undefined) - yield* Fiber.join(second) yield* Deferred.succeed(releases[0], undefined) yield* Fiber.join(first) + yield* Deferred.await(started[1]) + yield* Deferred.succeed(releases[1], undefined) + yield* Fiber.join(second) yield* TestClock.adjust("1 second") yield* flusher.flush }).pipe(Effect.provide(layer), Effect.provideService(Metric.MetricRegistry, new Map())) const requests = yield* Ref.get(bodies) + assert.strictEqual(findMetric(requests[0], "concurrent_delta")?.sum?.dataPoints[0].asDouble, 1) + assert.strictEqual(findMetric(requests[1], "concurrent_delta")?.sum?.dataPoints[0].asDouble, 1) assert.strictEqual(findMetric(requests[2], "concurrent_delta")?.sum?.dataPoints[0].asDouble, 0) }))) diff --git a/.repos/effect/packages/effect/test/persistence/KeyValueStoreTest.ts b/.repos/effect/packages/effect/test/persistence/KeyValueStoreTest.ts index db304a5d6c214..0152c884c8391 100644 --- a/.repos/effect/packages/effect/test/persistence/KeyValueStoreTest.ts +++ b/.repos/effect/packages/effect/test/persistence/KeyValueStoreTest.ts @@ -53,7 +53,7 @@ export const suite = (name: string, layer: Layer.Layer) => { +export const suiteWith = ( + testApi: Vitest.MethodsNonLive, + options?: { + /** + * Run the SQL claim tests concurrently. Disable on dialects where parallel + * table creation deadlocks the system catalog (e.g. SQL Server). + */ + readonly concurrentClaims?: boolean | undefined + } +) => { testApi.layer(Layer.empty, { concurrent: false, timeout: "90 seconds" })("PersistedQueue SQL delays", (it) => { it.effect("never delivers a delayed offer early at a second boundary", () => Effect.gen(function*() { @@ -145,7 +154,12 @@ export const suiteWith = (testApi: Vitest.MethodsNonLive) = }).pipe(TestClock.withLive), { timeout: 30000 }) }) - testApi.layer(Layer.empty, { concurrent: false, timeout: "90 seconds" })("PersistedQueue SQL claims", (it) => { + // Each test uses its own table and private TestClock so paused lock refreshes + // do not interfere across concurrent runs. + testApi.layer(Layer.empty, { + concurrent: options?.concurrentClaims ?? true, + timeout: "90 seconds" + })("PersistedQueue SQL claims", (it) => { const makeOwnershipQueue = Effect.fnUntraced(function*(tableName: string) { const store = yield* PersistedQueue.makeStoreSql({ tableName, @@ -207,15 +221,16 @@ export const suiteWith = (testApi: Vitest.MethodsNonLive) = const duplicate = yield* queue.take((value, metadata) => Effect.succeed({ value, ...metadata })).pipe( Effect.forkScoped ) - // Longer than lockExpiration: stale settlement must neither release - // the replacement nor unregister its lock refresh. - yield* Effect.sleep("1500 millis").pipe(TestClock.withLive) + // Longer than lockExpiration, including dialects with whole-second + // timestamps: stale settlement must neither release the replacement + // nor unregister its lock refresh. + yield* Effect.sleep("2500 millis").pipe(TestClock.withLive) assert.isUndefined(duplicate.pollUnsafe()) yield* Fiber.interrupt(replacement) const redelivered = yield* Fiber.join(duplicate).pipe(Effect.timeout("5 seconds"), TestClock.withLive) assert.deepStrictEqual(redelivered, { value: "job", id: "job-1", attempts: 2 }) - }), + }).pipe(Effect.provide(TestClock.layer())), { timeout: 30000 } ) } diff --git a/.repos/effect/packages/effect/test/persistence/PersistedQueueTest.ts b/.repos/effect/packages/effect/test/persistence/PersistedQueueTest.ts index 877de52d15705..3656489782c1d 100644 --- a/.repos/effect/packages/effect/test/persistence/PersistedQueueTest.ts +++ b/.repos/effect/packages/effect/test/persistence/PersistedQueueTest.ts @@ -24,32 +24,44 @@ export const suiteWith = ( readonly cleanupUsesClock?: boolean | undefined /** Set when the store fails `cleanup` as unsupported instead of running it. */ readonly cleanup?: "supported" | "unsupported" | undefined + /** + * Wall-clock wait for state-only non-delivery assertions (default 1 second). + * Lower only for backends validated against claim/completion mutations. + */ + readonly nonDeliveryWait?: Duration.Input | undefined } ) => { const timeout = options?.timeout ?? "30 seconds" const hookTimeout = options?.hookTimeout ?? timeout + const nonDeliveryWait = options?.nonDeliveryWait ?? "1 second" // Tests share and advance the same TestClock. const testOptions = { timeout: Duration.toMillis(timeout) } // give real-time stores a moment of wall-clock time - const liveSleep = (millis: number) => - options?.virtualTime ? Effect.yieldNow : Effect.sleep(millis).pipe(TestClock.withLive) + const liveSleep = (duration: Duration.Input) => + options?.virtualTime ? Effect.yieldNow : Effect.sleep(duration).pipe(TestClock.withLive) // advance the virtual clock one poll cycle, give real-time stores a moment, - // then check the forked take is still waiting - const assertNotDelivered = Effect.fnUntraced(function*(fiber: Fiber.Fiber) { + // then check the forked take is still waiting. State-only checks use + // `nonDeliveryWait`; offer-delay checks wait 1s so the assertion stays tied + // to the store's clock. + const assertNotDelivered = Effect.fnUntraced(function*( + fiber: Fiber.Fiber, + wait: Duration.Input = nonDeliveryWait + ) { yield* TestClock.adjust(1000) - yield* liveSleep(1000) + yield* liveSleep(wait) assert.isUndefined(fiber.pollUnsafe()) }) // advance both clocks until the forked take completes, including acknowledgement. // Keep advancing while it is pending: an SQL poll can miss a virtual-clock - // wakeup, and acknowledgement retries also sleep on the virtual clock. + // wakeup, and acknowledgement retries also sleep on the virtual clock. Each + // live wait ends as soon as the take settles. const awaitDelivery = Effect.fnUntraced(function*(fiber: Fiber.Fiber) { for (let i = 0; i < 8 && fiber.pollUnsafe() === undefined; i++) { yield* TestClock.adjust(1000) - yield* liveSleep(700) + yield* Effect.raceFirst(Fiber.await(fiber), liveSleep(700)) } assert.isDefined(fiber.pollUnsafe()) return yield* Fiber.join(fiber) @@ -182,7 +194,7 @@ export const suiteWith = ( Effect.forkScoped ) - yield* assertNotDelivered(fiber) + yield* assertNotDelivered(fiber, 1000) // the delay does not consume an attempt assert.deepStrictEqual(yield* awaitDelivery(fiber), { value: { n: 42n }, attempts: 1 }) @@ -235,7 +247,7 @@ export const suiteWith = ( // the undelayed duplicate does not make the element available early const fiber = yield* queue.take(Effect.succeed).pipe(Effect.forkScoped) - yield* assertNotDelivered(fiber) + yield* assertNotDelivered(fiber, 1000) assert.deepStrictEqual(yield* awaitDelivery(fiber), { n: 1n }) const fiber2 = yield* queue.take(Effect.succeed).pipe(Effect.forkScoped) @@ -488,7 +500,7 @@ export const suiteWith = ( // the re-offer is new work and honours its own delay yield* queue.offer({ n: 2n }, { ...offerOptions, delay: "3 seconds" }) const fiber = yield* queue.take(Effect.succeed).pipe(Effect.forkScoped) - yield* assertNotDelivered(fiber) + yield* assertNotDelivered(fiber, 1000) assert.deepStrictEqual(yield* awaitDelivery(fiber), { n: 2n }) }), testOptions) @@ -597,9 +609,5 @@ export const suiteWith = ( export const suite = ( name: string, layer: Layer.Layer, - options?: { - readonly virtualTime?: boolean | undefined - readonly cleanupUsesClock?: boolean | undefined - readonly cleanup?: "supported" | "unsupported" | undefined - } + options?: Parameters[3] ) => suiteWith(name, layer, it, options) diff --git a/.repos/effect/packages/effect/test/process/ChildProcessSpawnerTest.ts b/.repos/effect/packages/effect/test/process/ChildProcessSpawnerTest.ts index 5e16a894a9913..568315d8fad19 100644 --- a/.repos/effect/packages/effect/test/process/ChildProcessSpawnerTest.ts +++ b/.repos/effect/packages/effect/test/process/ChildProcessSpawnerTest.ts @@ -930,10 +930,11 @@ export const suite = ( it.effect("should write data to an input fd (fd3)", () => Effect.gen(function*() { - // Use a shell script that reads from fd3 and echoes it to stdout - // The script reads from file descriptor 3 and outputs to stdout + // Delay the write so `cat` reads before data arrives and fails if fd3 is non-blocking const inputData = "data from parent" - const inputStream = Stream.make(new TextEncoder().encode(inputData)) + const inputStream = Stream.fromEffect( + Effect.as(TestClock.withLive(Effect.sleep("100 millis")), new TextEncoder().encode(inputData)) + ) const handle = yield* ChildProcess.make("sh", ["-c", "cat <&3"], { additionalFds: { @@ -1299,28 +1300,45 @@ export const suite = ( }).pipe(Effect.provide(layer))) it.effect.skipIf(!options.processGroups)( - "should cleanup descendants after an unrefed parent exits non-zero", + "should not cleanup descendants after an unrefed parent exits non-zero", () => Effect.gen(function*() { - const path = yield* Path.Path - const cwd = yield* path.fromFileUrl(new URL("./fixtures/bash/", import.meta.url)) const scope = yield* Scope.make() - const handle = yield* Scope.provide(scope)(Effect.gen(function*() { - return yield* ChildProcess.make({ cwd })`./parent-exits-early.sh` - })).pipe(Effect.provide(layer)) + // The parent leaves a descendant behind and exits once stdin + // receives a line + const handle = yield* Scope.provide(scope)( + ChildProcess.make("sh", ["-c", "sleep 30 & read -r _; exit 1"]) + ).pipe(Effect.provide(layer)) - // @effect-diagnostics-next-line floatingEffect:off - yield* Scope.provide(scope)(handle.unref).pipe(Effect.provide(layer)) - yield* Scope.close(scope, Exit.void) + // Live (non-zombie) members of the parent's process group + const countLiveGroupMembers = ChildProcess.make("sh", [ + "-c", + `ps -A -o pgid= -o stat= | awk '$1 == ${handle.pid} && $2 !~ /^Z/' | wc -l` + ]).pipe( + Effect.flatMap((handle) => decodeByteStream(handle.stdout)), + Effect.map((output) => Number.parseInt(output)) + ) - const exitCode = yield* handle.exitCode - assert.strictEqual(exitCode, ChildProcessSpawner.ExitCode(1)) + yield* Effect.gen(function*() { + // @effect-diagnostics-next-line floatingEffect:off + yield* Scope.provide(scope)(handle.unref).pipe(Effect.provide(layer)) + yield* Stream.run(Stream.make(new TextEncoder().encode("\n")), handle.stdin) - yield* TestClock.withLive(Effect.sleep("100 millis")) + const exitCode = yield* handle.exitCode + assert.strictEqual(exitCode, ChildProcessSpawner.ExitCode(1)) + + yield* TestClock.withLive(Effect.sleep("100 millis")) + + assert.isAbove(yield* countLiveGroupMembers, 0) + + yield* Scope.close(scope, Exit.void) + + assert.isAbove(yield* countLiveGroupMembers, 0) + }).pipe(Effect.ensuring(Effect.ignore(handle.kill({ killSignal: "SIGKILL" })))) - const remaining = yield* countMatchingProcesses("parent-exits-early-") - assert.strictEqual(remaining, 0) + // `handle.kill` still signals the unref'ed group + assert.strictEqual(yield* countLiveGroupMembers, 0) }).pipe(Effect.provide(layer)) ) diff --git a/.repos/effect/packages/effect/test/reactivity/Atom.test.ts b/.repos/effect/packages/effect/test/reactivity/Atom.test.ts index 33d808badfc12..fd82099241782 100644 --- a/.repos/effect/packages/effect/test/reactivity/Atom.test.ts +++ b/.repos/effect/packages/effect/test/reactivity/Atom.test.ts @@ -5,6 +5,7 @@ import { Context, Deferred, Effect, + Fiber, Hash, Latch, Layer, @@ -1926,6 +1927,49 @@ describe("Atom", { concurrent: false }, () => { cancel() }) + it("stream rerun without items produces NoSuchElementError", async () => { + const rows = Atom.make>(["Alice"]) + const atom = Atom.make((get) => Stream.fromIterable(get(rows))) + const r = AtomRegistry.make() + const cancel = r.mount(atom) + + await vitest.advanceTimersByTimeAsync(0) + const initial = r.get(atom) + assert(AsyncResult.isSuccess(initial)) + assert.strictEqual(initial.value, "Alice") + assert.strictEqual(initial.waiting, false) + + r.set(rows, []) + await vitest.advanceTimersByTimeAsync(0) + const result = r.get(atom) + assert(AsyncResult.isFailure(result)) + assert.deepStrictEqual( + AsyncResult.error(result), + Option.some(new Cause.NoSuchElementError()) + ) + assert.deepStrictEqual(AsyncResult.value(result), Option.some("Alice")) + + cancel() + }) + + it("stream completion keeps a value set after the last emission", async () => { + const atom = Atom.make((get) => + Stream.fromIterable(["draft"]).pipe( + Stream.ensuring(Effect.sync(() => get.setSelf(AsyncResult.success("saved")))) + ) + ) + const r = AtomRegistry.make() + const cancel = r.mount(atom) + + await vitest.advanceTimersByTimeAsync(0) + const result = r.get(atom) + assert(AsyncResult.isSuccess(result)) + assert.strictEqual(result.value, "saved") + assert.strictEqual(result.waiting, false) + + cancel() + }) + it("Option is not an Effect", async () => { const atom = Atom.make(Option.none()) const r = AtomRegistry.make() @@ -1972,13 +2016,12 @@ describe("Atom", { concurrent: false }, () => { unmount() }) - it("SubscriptionRef/runtime", async () => { + it("SubscriptionRef/runtime", () => { const atom = counterRuntime.subscriptionRef(SubscriptionRef.make(0)) const r = AtomRegistry.make() const unmount = r.mount(atom) assert.deepStrictEqual(r.get(atom), AsyncResult.success(0, { waiting: true })) r.set(atom, 1) - await new Promise((resolve) => resolve(null)) assert.deepStrictEqual(r.get(atom), AsyncResult.success(1, { waiting: true })) unmount() }) @@ -2007,6 +2050,39 @@ describe("Atom", { concurrent: false }, () => { assert.strictEqual(finalized, true) }) + it.effect("SubscriptionRef queues contended writes", () => + Effect.gen(function*() { + const ref = yield* SubscriptionRef.make(0) + const plain = Atom.subscriptionRef(ref) + const runtime = counterRuntime.subscriptionRef(Effect.succeed(ref)) + const r = AtomRegistry.make() + const release = yield* Latch.make() + try { + r.mount(plain) + r.mount(runtime) + const changes = yield* SubscriptionRef.changes(ref).pipe( + Stream.take(5), + Stream.runCollect, + Effect.forkChild({ startImmediately: true }) + ) + + r.set(plain, 1) + assert.strictEqual(r.get(plain), 1) + + yield* SubscriptionRef.updateEffect(ref, (value) => release.await.pipe(Effect.as(value + 10))).pipe( + Effect.forkChild({ startImmediately: true }) + ) + + r.set(plain, 5) + r.set(runtime, 6) + + yield* release.open + assert.deepStrictEqual(yield* Fiber.join(changes), [0, 1, 11, 5, 6]) + } finally { + r.dispose() + } + })) + it("setLazy(true)", async () => { const count = Atom.make(0).pipe(Atom.keepAlive) let rebuilds = 0 diff --git a/.repos/effect/packages/effect/test/rpc/Rpc.test.ts b/.repos/effect/packages/effect/test/rpc/Rpc.test.ts index 8a1754bc0141d..7f4f2a93bda46 100644 --- a/.repos/effect/packages/effect/test/rpc/Rpc.test.ts +++ b/.repos/effect/packages/effect/test/rpc/Rpc.test.ts @@ -83,4 +83,12 @@ describe("Rpc", () => { assert.strictEqual(some.value.success, Schema.String) assert.strictEqual(some.value.error, Schema.Number) }) + + it("RpcGroup supports pipe on fresh and derived groups", () => { + const group = RpcGroup.make(Rpc.make("one")) + const derived = group.add(Rpc.make("two")) + + assert.strictEqual(group.pipe((g) => g), group) + assert.strictEqual(derived.pipe((g) => g.requests.size, (n) => n + 1), 3) + }) }) diff --git a/.repos/effect/packages/effect/test/rpc/RpcClient.test.ts b/.repos/effect/packages/effect/test/rpc/RpcClient.test.ts index c655d7fd65276..e6128d99f7776 100644 --- a/.repos/effect/packages/effect/test/rpc/RpcClient.test.ts +++ b/.repos/effect/packages/effect/test/rpc/RpcClient.test.ts @@ -149,7 +149,23 @@ const EchoGroup = RpcGroup.make( }) ) -// Connects a batching HTTP client to a real RPC server, counting the HTTP +const withCapturedSpans = (f: (spans: Array) => Effect.Effect) => { + const spans: Array = [] + return f(spans).pipe( + Effect.provideService( + Tracer.Tracer, + Tracer.make({ + span(options) { + const span = new Tracer.NativeSpan(options) + spans.push(span) + return span + } + }) + ) + ) +} + +// Connects a batching HTTP client to a real RPC server, recording the HTTP // requests that cross between them. const makeBatchingClient = Effect.fnUntraced(function*( serializationLayer: Layer.Layer, @@ -163,10 +179,10 @@ const makeBatchingClient = Effect.fnUntraced(function*( )) ) const handler = HttpEffect.toWebHandler(httpEffect) - let httpRequests = 0 + const requests: Array = [] const httpClient = HttpClient.make((request) => Effect.gen(function*() { - httpRequests++ + requests.push(request) yield* beforeRequest const webRequest = yield* Effect.orDie(HttpClientRequest.toWeb(request)) const response = yield* Effect.promise(() => handler(webRequest)) @@ -181,7 +197,7 @@ const makeBatchingClient = Effect.fnUntraced(function*( ) ) ) - return { client, httpRequests: () => httpRequests } + return { client, requests } }) const assertEmptyResponseFailsRequest = Effect.fnUntraced(function*( @@ -1021,7 +1037,7 @@ describe("RpcClient", () => { ) { it.effect(`sends ${name} requests made within the batch window as one HTTP request`, () => Effect.gen(function*() { - const { client, httpRequests } = yield* makeBatchingClient(serializationLayer, { window: "5 millis" }) + const { client, requests } = yield* makeBatchingClient(serializationLayer, { window: "5 millis" }) const results = yield* Effect.all( [client.Echo({ value: "first" }), client.Echo({ value: "second" })], @@ -1030,13 +1046,13 @@ describe("RpcClient", () => { yield* TestClock.adjust("5 millis") assert.deepStrictEqual(yield* Fiber.join(results), ["first", "second"]) - assert.strictEqual(httpRequests(), 1) + assert.strictEqual(requests.length, 1) })) } it.effect("sends a batch as soon as it reaches maxSize", () => Effect.gen(function*() { - const { client, httpRequests } = yield* makeBatchingClient(RpcSerialization.layerJson, { + const { client, requests } = yield* makeBatchingClient(RpcSerialization.layerJson, { window: "1 hour", maxSize: 2 }) @@ -1047,13 +1063,13 @@ describe("RpcClient", () => { ) assert.deepStrictEqual(results, ["first", "second"]) - assert.strictEqual(httpRequests(), 1) + assert.strictEqual(requests.length, 1) })) it.effect("keeps a batch in flight when one of its callers is interrupted", () => Effect.gen(function*() { const release = yield* Deferred.make() - const { client, httpRequests } = yield* makeBatchingClient( + const { client, requests } = yield* makeBatchingClient( RpcSerialization.layerJson, { window: "5 millis" }, Deferred.await(release) @@ -1066,7 +1082,7 @@ describe("RpcClient", () => { yield* Deferred.succeed(release, void 0) assert.strictEqual(yield* Fiber.join(kept), "kept") - assert.strictEqual(httpRequests(), 1) + assert.strictEqual(requests.length, 1) })) it.effect("interrupts batches started while the client is shutting down", () => @@ -1088,7 +1104,7 @@ describe("RpcClient", () => { )) }) const scope = yield* Scope.make() - const { client, httpRequests } = yield* makeBatchingClient( + const { client, requests } = yield* makeBatchingClient( RpcSerialization.layerJson, { window: "5 millis" }, beforeRequest @@ -1110,8 +1126,56 @@ describe("RpcClient", () => { yield* Fiber.join(closing) // every HTTP request that started was interrupted by the shutdown - assert.strictEqual(interrupted.length, httpRequests()) + assert.strictEqual(interrupted.length, requests.length) })) + + it.effect("links a batched HTTP request to every caller RPC span in a root batch span", () => + withCapturedSpans((spans) => + Effect.gen(function*() { + const { client, requests } = yield* makeBatchingClient(RpcSerialization.layerJson, { window: "5 millis" }) + + const results = yield* Effect.all( + [ + client.Echo({ value: "first" }).pipe(Effect.withSpan("caller-1", { root: true })), + client.Echo({ value: "second" }).pipe(Effect.withSpan("caller-2", { root: true })), + client.Echo({ value: "third" }).pipe(Effect.withSpan("caller-3", { root: true })) + ], + { concurrency: "unbounded" } + ).pipe(Effect.forkChild) + yield* TestClock.adjust("5 millis") + + assert.deepStrictEqual(yield* Fiber.join(results), ["first", "second", "third"]) + assert.strictEqual(requests.length, 1) + + const rpcSpans = spans.filter((span) => span.name === "Echo" && span.kind === "client") + assert.strictEqual(rpcSpans.length, 3) + + const batchSpan = spans.find((span) => span.name === "RpcClient.batch") + assert.isDefined(batchSpan) + assert.isTrue(Option.isNone(batchSpan.parent)) + assert.strictEqual(batchSpan.attributes.get("batchSize"), 3) + assert.isFalse(rpcSpans.some((span) => span.traceId === batchSpan.traceId)) + + const toSpanKey = (span: Tracer.AnySpan) => ({ + traceId: span.traceId, + spanId: span.spanId, + sampled: span.sampled + }) + const bySpanId = (a: { readonly spanId: string }, b: { readonly spanId: string }) => + a.spanId.localeCompare(b.spanId) + assert.deepStrictEqual( + batchSpan.links.map((link) => toSpanKey(link.span)).sort(bySpanId), + rpcSpans.map(toSpanKey).sort(bySpanId) + ) + + const httpSpan = spans.find((span) => + span.kind === "client" && span.attributes.get("http.request.method") === "POST" + ) + assert.isDefined(httpSpan) + assert.strictEqual(Option.getOrUndefined(httpSpan.parent)?.spanId, batchSpan.spanId) + assert.strictEqual(requests[0].headers.traceparent, `00-${batchSpan.traceId}-${httpSpan.spanId}-01`) + }) + )) }) for (const failedMessage of ["Request", "Ack"] as const) { @@ -1613,41 +1677,31 @@ describe("RpcClient", () => { const call = ( method: "Ping" | "Events", options: { spanPrefix?: string; spanAttributes?: Record } = {} - ) => { - const spans: Array = [] - return Effect.gen(function*() { - // oxlint-disable-next-line prefer-const - let client!: Effect.Success< - ReturnType, never>> - > - const server = yield* RpcServer.makeNoSerialization(SpanGroup, { - ...options, - onFromServer: (response) => client.write(response) - }) - client = yield* RpcClient.makeNoSerialization(SpanGroup, { - ...options, - supportsAck: true, - onFromClient: ({ message }) => server.write(0, message) - }) - yield* method === "Ping" ? client.client["Echo.Ping"]() : Stream.runDrain(client.client["Echo.Events"]()) - return spans - }).pipe( - Effect.provide(SpanGroup.toLayer({ - "Echo.Ping": () => Effect.succeed("pong"), - "Echo.Events": () => Stream.make("event") - })), - Effect.provideService( - Tracer.Tracer, - Tracer.make({ - span(options) { - const span = new Tracer.NativeSpan(options) - spans.push(span) - return span - } + ) => + withCapturedSpans((spans) => + Effect.gen(function*() { + // oxlint-disable-next-line prefer-const + let client!: Effect.Success< + ReturnType, never>> + > + const server = yield* RpcServer.makeNoSerialization(SpanGroup, { + ...options, + onFromServer: (response) => client.write(response) }) + client = yield* RpcClient.makeNoSerialization(SpanGroup, { + ...options, + supportsAck: true, + onFromClient: ({ message }) => server.write(0, message) + }) + yield* method === "Ping" ? client.client["Echo.Ping"]() : Stream.runDrain(client.client["Echo.Events"]()) + return spans + }).pipe( + Effect.provide(SpanGroup.toLayer({ + "Echo.Ping": () => Effect.succeed("pong"), + "Echo.Events": () => Stream.make("event") + })) ) ) - } it.effect("records RPC span defaults for streaming calls", () => Effect.gen(function*() { diff --git a/.repos/effect/packages/effect/test/schema/representation/builtInRevivers.test.ts b/.repos/effect/packages/effect/test/schema/representation/builtInRevivers.test.ts index 058f709e6d985..65ec10d83f6b4 100644 --- a/.repos/effect/packages/effect/test/schema/representation/builtInRevivers.test.ts +++ b/.repos/effect/packages/effect/test/schema/representation/builtInRevivers.test.ts @@ -1,6 +1,11 @@ import { assert, describe, it } from "@effect/vitest" import { Formatter, Schema, type SchemaAST, SchemaRepresentation } from "effect" import { throws } from "../../utils/assert.ts" +import { makeModule } from "../../utils/schemaCodegen.ts" + +function print(document: SchemaRepresentation.Document): string { + return makeModule({ representations: [document.representation], references: document.references }).print() +} function assertFilterReviver(input: { readonly schema: Schema.Codec @@ -44,7 +49,9 @@ function assertFilterReviver(input: { typeof revivedCheck.annotations?.toJsonSchema, input.hasToJsonSchema === false ? "undefined" : "function" ) - assert.strictEqual(typeof revivedCheck.annotations?.toCode, "function") + const expected = print(document) + assert.strictEqual(print(SchemaRepresentation.fromJson(json)), expected) + assert.strictEqual(print(SchemaRepresentation.toRepresentation(revived.ast)), expected) } function assertDeclarationReviver(input: { @@ -74,7 +81,9 @@ function assertDeclarationReviver(input: { (revived.ast.annotations?.representation as { readonly id?: string } | undefined)?.id, input.id ) - assert.strictEqual(typeof revived.ast.annotations?.toCode, "function") + const expected = print(document) + assert.strictEqual(print(SchemaRepresentation.fromJson(json)), expected) + assert.strictEqual(print(SchemaRepresentation.toRepresentation(revived.ast)), expected) } describe("SchemaRepresentation built-in string revivers", () => { diff --git a/.repos/effect/packages/effect/test/schema/representation/codegen.annotations.test.ts b/.repos/effect/packages/effect/test/schema/representation/codegen.annotations.test.ts index eb09842940358..70f1841c41f03 100644 --- a/.repos/effect/packages/effect/test/schema/representation/codegen.annotations.test.ts +++ b/.repos/effect/packages/effect/test/schema/representation/codegen.annotations.test.ts @@ -34,6 +34,71 @@ const EmptyUnionRepresentation: SchemaRepresentation.Representation = { } describe("Codegen.Module.addSchemas annotations", () => { + it("prefers live overrides on built-ins, including an explicitly removed callback", () => { + const schema = Schema.Option(Schema.String.check(Schema.isMinLength(2, { + toCode: () => ({ runtime: "Custom.check()" }) + }))).annotate({ + toCode: ({ typeParameters: [value] }: SchemaRepresentation.Generation.DeclarationInput) => ({ + runtime: `Custom.box(${value.runtime})`, + Type: value.Type + }) + }) + const source = makeModule(SchemaRepresentation.toRepresentations([schema.ast])).print() + assert.include(source, "Custom.box(Schema.String.check(Custom.check()") + for ( + const disabled of [ + Schema.Date.annotate({ toCode: undefined }), + Schema.String.check(Schema.isMinLength(2, { toCode: undefined })), + Schema.String.check(Schema.isMinLength(2, { representation: { id: "acme/min", payload: 2 } })) + ] + ) { + assert.throws(() => makeModule(SchemaRepresentation.toRepresentations([disabled.ast])), "Missing toCode callback") + } + }) + + it("prints the date bound recorded when the check was created", () => { + const date = new Date(0) + const schema = Schema.Date.check(Schema.isGreaterThanDate(date)) + date.setTime(42) + const source = makeModule(SchemaRepresentation.toRepresentations([schema.ast])).print() + assert.include(source, "Schema.isGreaterThanDate(new globalThis.Date(0))") + }) + + it("validates built-in payloads and schema arguments at their document paths", () => { + for ( + const [id, payload] of [ + ["effect/schema/isMinLength", { minLength: "2" }], + ["effect/schema/isPattern", { source: "[", flags: "" }], + ["effect/schema/isLessThanBigInt", { exclusiveMaximum: "1.5" }] + ] as const + ) { + expectError( + () => + makeModule({ + representations: [{ + _tag: "String", + checks: [{ _tag: "Filter", aborted: false, representation: { id, payload } }] + }], + references: {} + }), + `Invalid representation payload for ${id}\n at ["representations"][0]["checks"][0]["representation"]["payload"]` + ) + } + expectError( + () => + makeModule({ + representations: [{ + _tag: "Declaration", + typeParameters: [], + checks: [], + representation: { id: "effect/schema/Option", payload: null } + }], + references: {} + }), + "Invalid number of schema arguments for effect/schema/Option: expected 1, got 0\n at [\"representations\"][0][\"typeParameters\"]" + ) + }) + it("preserves explicit options on an empty union", () => { assertSchemas( makeModule({ @@ -45,10 +110,14 @@ describe("Codegen.Module.addSchemas annotations", () => { ) }) - it("compiles the isPattern and Option vertical slice", () => { + it("generates isPattern and Option without attaching printers to either built-in", () => { + const pattern = Schema.isPattern(/^a+$/) + const option = Schema.Option(Schema.String) + assert.isUndefined(pattern.annotations?.toCode) + assert.isUndefined(option.ast.annotations?.toCode) const document = SchemaRepresentation.toRepresentations([ - Schema.String.check(Schema.isPattern(/^a+$/)).ast, - Schema.Option(Schema.String).ast + Schema.String.check(pattern).ast, + option.ast ]) const output = makeModule(document) diff --git a/.repos/effect/packages/effect/test/schema/representation/codegen.test.ts b/.repos/effect/packages/effect/test/schema/representation/codegen.test.ts index 7a73f261fd760..fd562d95ffb7b 100644 --- a/.repos/effect/packages/effect/test/schema/representation/codegen.test.ts +++ b/.repos/effect/packages/effect/test/schema/representation/codegen.test.ts @@ -2,9 +2,11 @@ import { afterAll, assert, describe, it } from "@effect/vitest" import { Brand, Cause, + Chunk, type Codegen, Exit, HashMap, + HashSet, JsonSchema, Option, Redacted, @@ -455,6 +457,20 @@ describe("Codegen.Module.addSchemas", { concurrent: false }, () => { accepts: [HashMap.empty(), HashMap.make(["a", 1])], rejects: [HashMap.make(["a", "b"]), {}] }) + example("HashSet", Schema.HashSet(Schema.String), "HashSet.HashSet", { + accepts: [HashSet.make("a")], + rejects: [HashSet.make(1)] + }) + it("Chunk", async () => { + const schema = Schema.Chunk(Schema.String) + const source = generate(schema).print() + register("Chunk", source, ["Chunk.Chunk"]) + await withGeneratedModule<{ TestRoot0: typeof schema }>(source, ({ TestRoot0 }) => { + const decoded = Schema.decodeUnknownSync(TestRoot0)(Chunk.make("a")) + assert.deepStrictEqual(Chunk.toArray(decoded), ["a"]) + assert.isFalse(Schema.is(TestRoot0)(Chunk.make(1))) + }) + }) }) describe("templates", () => { diff --git a/.repos/effect/packages/effect/test/schema/toEquivalence.test.ts b/.repos/effect/packages/effect/test/schema/toEquivalence.test.ts index 6e9c31b75f185..9ec25706bf177 100644 --- a/.repos/effect/packages/effect/test/schema/toEquivalence.test.ts +++ b/.repos/effect/packages/effect/test/schema/toEquivalence.test.ts @@ -451,6 +451,29 @@ describe("toEquivalence", () => { strictEqual(derivations, 1) }) + it("compiles a shared nested schema once", () => { + let derivations = 0 + const leaf = Schema.Number.pipe( + Schema.overrideToEquivalence(() => { + derivations++ + return Equivalence.strictEqual() + }) + ) + const pair = Schema.Struct({ a: leaf, b: leaf }) + const schema = Schema.Struct({ + left: pair, + right: pair, + tuple: Schema.TupleWithRest(Schema.Tuple([leaf]), [leaf, leaf]), + record: Schema.Record(Schema.String, leaf), + union: Schema.Union([leaf, Schema.String]), + option: Schema.Option(leaf), + redacted: Schema.Redacted(leaf) + }) + + Schema.toEquivalence(schema) + strictEqual(derivations, 1) + }) + it("selects transformed Union members on the Type side", () => { const Target = Schema.Struct({ value: Schema.String }).pipe( Schema.overrideToEquivalence(() => Equivalence.make((a, b) => a.value === b.value)) diff --git a/.repos/effect/packages/effect/test/sql/SqlClient.test.ts b/.repos/effect/packages/effect/test/sql/SqlClient.test.ts index 27053aef376d0..82d713071ed6c 100644 --- a/.repos/effect/packages/effect/test/sql/SqlClient.test.ts +++ b/.repos/effect/packages/effect/test/sql/SqlClient.test.ts @@ -135,7 +135,10 @@ const makeHarness = (options: { Effect.flatMap(record(`releaseSavepoint(${id})`), () => release === true ? Effect.void : Effect.fail(release)) }) - return { calls, withTransaction } as const + /** The level of the transaction the caller is in, 0 for a top-level one. */ + const level = Effect.map(Effect.serviceOption(transactionService), Option.map(([, id]) => id)) + + return { calls, level, withTransaction } as const } /** @@ -726,6 +729,67 @@ describe("SqlClient", () => { assert.deepStrictEqual(harness.calls, ["acquireConnection", "begin", "commit", "closeConnection"]) })) + it.effect("provides transaction context and restores caller context on success and failure", () => { + const Caller = Context.Service("test/makeWithTransaction/Caller") + return Effect.gen(function*() { + const { level, withTransaction } = makeHarness() + const callerSpan = yield* Effect.currentSpan + + yield* withTransaction(Effect.gen(function*() { + assert.deepStrictEqual( + [yield* Caller, yield* level, (yield* Effect.currentSpan).name], + ["caller", Option.some(0), "sql.transaction"] + ) + yield* withTransaction(Effect.gen(function*() { + assert.deepStrictEqual([yield* Caller, yield* level], ["caller", Option.some(1)]) + })) + })) + assert.deepStrictEqual(yield* level, Option.none()) + assert.strictEqual(yield* Effect.currentSpan, callerSpan) + + assertTypedFailure(yield* Effect.exit(withTransaction(Effect.fail("boom" as const))), "boom" as const) + assert.deepStrictEqual(yield* level, Option.none()) + assert.strictEqual(yield* Effect.currentSpan, callerSpan) + }).pipe( + Effect.withSpan("caller"), + Effect.provideService(Caller, "caller") + ) + }) + + it.effect("merges transaction context when begin replaces the fiber context", () => { + const Shared = Context.Service("test/makeWithTransaction/Shared") + const Added = Context.Service("test/makeWithTransaction/Added") + const { level, withTransaction } = makeHarness({ + duringBegin: Effect.withFiber((fiber) => { + fiber.setContext(fiber.context.pipe(Context.add(Shared, "begin"), Context.add(Added, "from-begin"))) + return Effect.void + }) + }) + const run = Effect.fnUntraced( + function*(body: Effect.Effect) { + const callerSpan = yield* Effect.currentSpan + const exit = yield* Effect.exit(withTransaction(body)) + assert.deepStrictEqual([yield* Shared, yield* Added, yield* level], ["begin", "from-begin", Option.none()]) + assert.strictEqual(yield* Effect.currentSpan, callerSpan) + return exit + }, + Effect.withSpan("caller"), + Effect.provideService(Shared, "caller") + ) + return Effect.gen(function*() { + assert.deepStrictEqual( + yield* run(Effect.gen(function*() { + assert.deepStrictEqual( + [yield* Shared, yield* Added, yield* level, (yield* Effect.currentSpan).name], + ["caller", "from-begin", Option.some(0), "sql.transaction"] + ) + })), + Exit.void + ) + assertTypedFailure(yield* run(Effect.fail("boom" as const)), "boom" as const) + }) + }) + describe("tracing", () => { it.effect("traces each transaction control as a client span of its transaction level", () => Effect.gen(function*() { diff --git a/.repos/effect/packages/effect/test/utils/encoding.ts b/.repos/effect/packages/effect/test/utils/encoding.ts index 21bc2ccd8d002..7d9e66f18022a 100644 --- a/.repos/effect/packages/effect/test/utils/encoding.ts +++ b/.repos/effect/packages/effect/test/utils/encoding.ts @@ -8,18 +8,20 @@ const natives = [ [Uint8Array.prototype, "toHex"] ] as const -// Registers `suite` twice: once as is, and once with the native methods -// removed, so the fallbacks are covered on runtimes that ship them. The copies -// run sequentially, since the removal is global and the tests run concurrently. -export const describeWithFallback = (name: string, suite: () => void): void => { - describe(name, { concurrent: false }, suite) - describe(`${name} without native methods`, { concurrent: false }, () => { - const descriptors = natives.map(([target, key]) => Object.getOwnPropertyDescriptor(target, key)) +// Registers `suite` with `properties` removed. It runs sequentially, since the +// removal is global and the tests run concurrently. +const describeWithout = ( + name: string, + properties: ReadonlyArray, + suite: () => void +): void => { + describe(name, { concurrent: false }, () => { + const descriptors = properties.map(([target, key]) => Object.getOwnPropertyDescriptor(target, key)) beforeAll(() => { - for (const [target, key] of natives) Reflect.deleteProperty(target, key) + for (const [target, key] of properties) Reflect.deleteProperty(target, key) }) afterAll(() => { - natives.forEach(([target, key], i) => { + properties.forEach(([target, key], i) => { const descriptor = descriptors[i] if (descriptor !== undefined) Reflect.defineProperty(target, key, descriptor) }) @@ -27,3 +29,14 @@ export const describeWithFallback = (name: string, suite: () => void): void => { suite() }) } + +// Registers `suite` with the native methods removed and `Buffer` left in +// place, so the `Buffer` fallback is covered on runtimes that ship them. +export const describeWithoutNatives = (name: string, suite: () => void): void => describeWithout(name, natives, suite) + +// Registers `suite` twice: once as is, and once with the native methods and +// `Buffer` removed, so the JavaScript fallbacks are covered on every runtime. +export const describeWithFallback = (name: string, suite: () => void): void => { + describe(name, { concurrent: false }, suite) + describeWithout(`${name} without native methods`, [...natives, [globalThis, "Buffer"]], suite) +} diff --git a/.repos/effect/packages/effect/test/workflow/Workflow.test.ts b/.repos/effect/packages/effect/test/workflow/Workflow.test.ts index aaf2fe97ea973..aad1741bc4d24 100644 --- a/.repos/effect/packages/effect/test/workflow/Workflow.test.ts +++ b/.repos/effect/packages/effect/test/workflow/Workflow.test.ts @@ -1,5 +1,5 @@ import { assert, describe, it } from "@effect/vitest" -import { Deferred, Effect, Exit, Fiber, Scheduler } from "effect" +import { Cause, Deferred, Effect, Exit, Fiber, Scheduler, Schema } from "effect" import { Activity, Workflow } from "effect/workflow" import { WorkflowInstance } from "effect/workflow/WorkflowEngine" @@ -65,6 +65,72 @@ describe("Workflow.intoResult", () => { yield* Fiber.interrupt(running) assert.deepStrictEqual(order, ["interrupt", "handler-finalizer", "workflow-finalizer"]) })) + + const workflow = Workflow.make("CompensationDefect", { + payload: {}, + error: Schema.String, + idempotencyKey: () => "one" + }) + const defects = (cause: Cause.Cause) => + cause.reasons.filter(Cause.isDieReason).map((reason) => reason.defect) + + it.effect("captures compensation defects in Complete results by default", () => + Effect.gen(function*() { + const failed = yield* Effect.gen(function*() { + yield* Workflow.addFinalizer(() => Effect.die("compensation failed")) + return yield* Effect.fail("refused") + }).pipe( + Workflow.intoResult, + Effect.provideService(WorkflowInstance, WorkflowInstance.initial(workflow, "failed")) + ) + assert(failed._tag === "Complete") + assert(Exit.isFailure(failed.exit)) + assert.deepStrictEqual( + failed.exit.cause.reasons.filter(Cause.isFailReason).map((reason) => reason.error), + ["refused"] + ) + assert.deepStrictEqual(defects(failed.exit.cause), ["compensation failed"]) + + const succeeded = yield* Effect.gen(function*() { + yield* Workflow.addFinalizer(() => Effect.die("compensation failed")) + }).pipe( + Workflow.intoResult, + Effect.provideService(WorkflowInstance, WorkflowInstance.initial(workflow, "succeeded")) + ) + assert(succeeded._tag === "Complete") + assert(Exit.isFailure(succeeded.exit)) + assert.deepStrictEqual(defects(succeeded.exit.cause), ["compensation failed"]) + })) + + it.effect("lets compensation defects escape when CaptureDefects is disabled", () => + Effect.gen(function*() { + const exit = yield* Effect.gen(function*() { + yield* Workflow.addFinalizer(() => Effect.die("compensation failed")) + return yield* Effect.fail("refused") + }).pipe( + Workflow.intoResult, + Effect.provideService( + WorkflowInstance, + WorkflowInstance.initial(workflow.annotate(Workflow.CaptureDefects, false), "one") + ), + Effect.exit + ) + assert(Exit.isFailure(exit)) + assert.deepStrictEqual(defects(exit.cause), ["compensation failed"]) + })) + + it.effect("propagates finalizer interruption without producing a Complete result", () => + Effect.gen(function*() { + const exit = yield* Effect.gen(function*() { + yield* Workflow.addFinalizer(() => Effect.interrupt) + return yield* Effect.fail("refused") + }).pipe( + Workflow.intoResult, + Effect.provideService(WorkflowInstance, WorkflowInstance.initial(workflow, "one")), + Effect.exit + ) + assert(Exit.hasInterrupts(exit) && !Exit.hasDies(exit)) + })) }) describe("Workflow.wrapActivityResult", () => { diff --git a/.repos/effect/packages/effect/test/workflow/WorkflowEngine.test.ts b/.repos/effect/packages/effect/test/workflow/WorkflowEngine.test.ts index 28f55c0b71b73..d032ab11e73da 100644 --- a/.repos/effect/packages/effect/test/workflow/WorkflowEngine.test.ts +++ b/.repos/effect/packages/effect/test/workflow/WorkflowEngine.test.ts @@ -16,6 +16,7 @@ import { } from "effect" import { TestClock } from "effect/testing" import { Activity, DurableClock, DurableDeferred, Workflow, WorkflowEngine } from "effect/workflow" +import { collectGarbage } from "../utils/gc.ts" describe("deferred self-completion", () => { for (const failure of [false, true]) { @@ -86,10 +87,8 @@ describe("deferred self-completion", () => { const result = yield* Fiber.join(execution) if (failure) { assert.ok(Exit.isFailure(result)) - assert.strictEqual(result.cause.reasons.length, 1) - const reason = result.cause.reasons[0] - assert.ok(Cause.isFailReason(reason)) - assert.strictEqual(reason.error, "boom") + assert.ok(result.cause.reasons.length > 0) + assert.ok(result.cause.reasons.every((reason) => Cause.isFailReason(reason) && reason.error === "boom")) } else { assert.deepStrictEqual(result, Exit.succeed("ok")) assert.deepStrictEqual(events, ["start-1", "cleanup-start", "cleanup-end", "end-1", "start-2", "end-2"]) @@ -548,6 +547,23 @@ describe("WorkflowEngine", () => { ) })) + const pollUntil = Effect.fnUntraced(function*( + workflow: Workflow.Workflow, + executionId: string, + tag: "Suspended" | "Complete" + ) { + let result = yield* workflow.poll(executionId) + for (let i = 0; i < 1000 && !(Option.isSome(result) && result.value._tag === tag); i++) { + yield* Effect.yieldNow + result = yield* workflow.poll(executionId) + } + assert( + Option.isSome(result) && result.value._tag === tag, + `workflow must reach ${tag}, got ${Option.isSome(result) ? result.value._tag : "None"}` + ) + return result.value + }) + for (const recover of [false, true]) { it.effect( `layerMemory ${ @@ -570,19 +586,6 @@ describe("WorkflowEngine", () => { yield* recover ? Effect.exit(child) : child })) const ChildLayer = Child.toLayer(() => DurableDeferred.await(Gate)) - const pollUntil = Effect.fnUntraced(function*( - workflow: typeof Parent | typeof Child, - executionId: string, - tag: "Suspended" | "Complete" - ) { - let result = yield* workflow.poll(executionId) - for (let i = 0; i < 1000 && !(Option.isSome(result) && result.value._tag === tag); i++) { - yield* Effect.yieldNow - result = yield* workflow.poll(executionId) - } - assert(Option.isSome(result) && result.value._tag === tag, `workflow must reach ${tag}`) - return result.value - }) yield* Effect.gen(function*() { const parentId = yield* Parent.execute({}, { discard: true }) const childId = yield* Child.executionId({ id: "child" }) @@ -669,6 +672,111 @@ describe("WorkflowEngine", () => { })) } + it.effect("layerMemory dispatches a discarded child forked beside a durable wait before suspending", () => + Effect.gen(function*() { + const Gate = DurableDeferred.make("WorkflowEngine/BesideWaitGate") + let childStarted = false + const Parent = Workflow.make("WorkflowEngine/BesideWaitParent", { + payload: {}, + idempotencyKey: () => "parent" + }) + const Child = Workflow.make("WorkflowEngine/BesideWaitChild", { + payload: {}, + idempotencyKey: () => "child" + }) + const ParentLayer = Parent.toLayer(() => + Effect.all([ + Child.execute({}, { discard: true }), + DurableDeferred.await(Gate) + ], { concurrency: "unbounded", discard: true }) + ) + const ChildLayer = Child.toLayer(() => { + childStarted = true + return Effect.never + }) + yield* Effect.gen(function*() { + const executionId = yield* Parent.execute({}, { discard: true }) + yield* pollUntil(Parent, executionId, "Suspended") + assert.isTrue(childStarted, "the discarded child must be dispatched") + }).pipe( + Effect.provide(Layer.mergeAll(ParentLayer, ChildLayer).pipe(Layer.provideMerge(WorkflowEngine.layerMemory))) + ) + })) + + for (const discard of [false, true]) { + it.effect( + `layerMemory dispatches ${discard ? "discarded children before" : "a child after"} a suspending durable wait`, + () => + Effect.gen(function*() { + let started = 0 + const indexes = discard ? [0, 1, 2, 3] : [0] + const Gate = DurableDeferred.make("WorkflowEngine/SiblingDispatchGate") + const Parent = Workflow.make(`WorkflowEngine/SiblingDispatchParent/${discard}`, { + payload: {}, + idempotencyKey: () => "parent" + }) + const Child = Workflow.make(`WorkflowEngine/SiblingDispatchChild/${discard}`, { + payload: { index: Schema.Number }, + idempotencyKey: ({ index }) => String(index) + }) + const ParentLayer = Parent.toLayer(() => { + const children = indexes.map((index) => Child.execute({ index }, { discard })) + const wait = DurableDeferred.await(Gate) + return Effect.all(discard ? [...children, wait] : [wait, ...children], { + concurrency: "unbounded", + discard: true + }) + }) + const ChildLayer = Child.toLayer(() => + Effect.sync(() => { + started++ + }) + ) + yield* Effect.gen(function*() { + const executionId = yield* Parent.execute({}, { discard: true }) + yield* pollUntil(Parent, executionId, "Suspended") + assert.strictEqual(started, indexes.length) + yield* DurableDeferred.succeed(Gate, { + token: DurableDeferred.tokenFromExecutionId(Gate, { workflow: Parent, executionId }), + value: void 0 + }) + const result = yield* pollUntil(Parent, executionId, "Complete") + assert.deepStrictEqual(result, new Workflow.Complete({ exit: Exit.void })) + assert.strictEqual(started, indexes.length) + }).pipe( + Effect.provide(Layer.mergeAll(ParentLayer, ChildLayer).pipe(Layer.provideMerge(WorkflowEngine.layerMemory))) + ) + }) + ) + } + + it.effect( + "layerMemory cancels a losing DurableDeferred.await race arm while a sibling activity is running", + () => + Effect.gen(function*() { + const Gate = DurableDeferred.make("WorkflowEngine/RaceCancelGate") + const Parent = Workflow.make("WorkflowEngine/RaceCancelParent", { + payload: {}, + idempotencyKey: () => "parent" + }) + const ParentLayer = Parent.toLayer(Effect.fnUntraced(function*() { + const started = yield* Latch.make() + const released = yield* Latch.make() + yield* Effect.all([ + Effect.race(DurableDeferred.await(Gate), started.await).pipe(Effect.andThen(released.open)), + Activity.make({ name: "work", execute: started.open.pipe(Effect.andThen(released.await)) }) + ], { concurrency: "unbounded", discard: true }) + })) + yield* Effect.gen(function*() { + const result = yield* Parent.execute({}) + assert.strictEqual(result, undefined) + }).pipe( + Effect.provide(ParentLayer.pipe(Layer.provideMerge(WorkflowEngine.layerMemory))) + ) + }), + 5_000 + ) + it.effect("discard returns the deterministic execution ID", () => Effect.gen(function*() { const executionId = yield* IncrementWorkflow.executionId({ value: 1 }) @@ -1035,7 +1143,7 @@ describe("WorkflowEngine", () => { }).pipe(Effect.provide(layer)) })) - it.effect("layerMemory closes every suspended run scope when a finalizer dies", () => + it.effect("layerMemory closes every suspended run scope and wakes its parent when a finalizer dies", () => Effect.gen(function*() { const gate = DurableDeferred.make("WorkflowEngine/SuspendedScopeDefect/Gate") const finalized: Array = [] @@ -1044,17 +1152,24 @@ describe("WorkflowEngine", () => { payload: {}, idempotencyKey: () => "one" }) - const layer = Suspends.toLayer(() => - Effect.gen(function*() { - const run = ++runs - yield* Workflow.addFinalizer(() => - Effect.gen(function*() { - finalized.push(run) - if (run === 2) return yield* Effect.die("finalizer defect") - }) - ) - yield* DurableDeferred.await(gate) - }) + const Parent = Workflow.make("WorkflowEngine/SuspendedScopeDefect/Parent", { + payload: {}, + idempotencyKey: () => "parent" + }) + const layer = Layer.mergeAll( + Suspends.toLayer(() => + Effect.gen(function*() { + const run = ++runs + yield* Workflow.addFinalizer(() => + Effect.gen(function*() { + finalized.push(run) + if (run === 2) return yield* Effect.die("finalizer defect") + }) + ) + yield* DurableDeferred.await(gate) + }) + ), + Parent.toLayer(() => Suspends.execute({})) ).pipe(Layer.provideMerge(WorkflowEngine.layerMemory)) yield* Effect.gen(function*() { @@ -1064,6 +1179,12 @@ describe("WorkflowEngine", () => { yield* Effect.yieldNow result = yield* Suspends.poll(executionId) } + const parentId = yield* Parent.execute({}, { discard: true }) + let parent = yield* Parent.poll(parentId) + while (Option.isNone(parent) || parent.value._tag !== "Suspended") { + yield* Effect.yieldNow + parent = yield* Parent.poll(parentId) + } yield* Suspends.resume(executionId) result = yield* Suspends.poll(executionId) @@ -1084,6 +1205,15 @@ describe("WorkflowEngine", () => { assert.strictEqual(runs, 3) assert(Exit.hasDies(exit)) assert.deepStrictEqual(finalized, [3, 2, 1]) + + // The parent is woken despite the dying finalizer and observes the defect. + parent = yield* Parent.poll(parentId) + for (let i = 0; i < 100 && (Option.isNone(parent) || parent.value._tag !== "Complete"); i++) { + yield* Effect.yieldNow + parent = yield* Parent.poll(parentId) + } + assert(Option.isSome(parent) && parent.value._tag === "Complete", "the parent must be woken") + assert(Exit.hasDies(parent.value.exit)) }).pipe(Effect.provide(layer)) })) @@ -1321,4 +1451,294 @@ describe("WorkflowEngine", () => { assert(Exit.hasInterrupts(result.value.exit)) }).pipe(Effect.provide(layer)) })) + + it.effect("layerMemory resumes a waiting parent when a child's compensation defects", () => + Effect.gen(function*() { + const gate = DurableDeferred.make("WorkflowEngine/CompensationDefectParent/Gate") + const Parent = Workflow.make("WorkflowEngine/CompensationDefectParent", { + payload: {}, + error: Schema.String, + idempotencyKey: () => "parent" + }) + const Child = Workflow.make("WorkflowEngine/CompensationDefectChild", { + payload: {}, + error: Schema.String, + idempotencyKey: () => "child" + }) + const ParentLayer = Parent.toLayer(() => Child.execute({})) + const ChildLayer = Child.toLayer(() => + Effect.gen(function*() { + yield* DurableDeferred.await(gate) + yield* Workflow.addFinalizer(() => Effect.die("compensation failed")) + return yield* Effect.fail("refused") + }) + ) + + yield* Effect.gen(function*() { + const parentId = yield* Parent.execute({}, { discard: true }) + const childId = yield* Child.executionId({}) + let parent = yield* Parent.poll(parentId) + for (let i = 0; i < 1000 && !(Option.isSome(parent) && parent.value._tag === "Suspended"); i++) { + yield* Effect.yieldNow + parent = yield* Parent.poll(parentId) + } + assert(Option.isSome(parent) && parent.value._tag === "Suspended", "parent must suspend first") + + const token = DurableDeferred.tokenFromExecutionId(gate, { workflow: Child, executionId: childId }) + yield* DurableDeferred.succeed(gate, { token, value: void 0 }) + + for (let i = 0; i < 1000 && !(Option.isSome(parent) && parent.value._tag === "Complete"); i++) { + yield* Effect.yieldNow + parent = yield* Parent.poll(parentId) + } + assert(Option.isSome(parent) && parent.value._tag === "Complete", "parent must complete") + assert(Exit.isFailure(parent.value.exit)) + assert.deepStrictEqual( + parent.value.exit.cause.reasons.filter(Cause.isFailReason).map((reason) => reason.error), + ["refused"] + ) + assert.deepStrictEqual( + parent.value.exit.cause.reasons.filter(Cause.isDieReason).map((reason) => reason.defect), + ["compensation failed"] + ) + }).pipe( + Effect.provide(Layer.mergeAll(ParentLayer, ChildLayer).pipe(Layer.provideMerge(WorkflowEngine.layerMemory))) + ) + })) + + it.effect("layerMemory retries a failing activity under SuspendOnFailure", () => + Effect.gen(function*() { + class Failed extends Schema.TaggedError()("Failed", {}) {} + const attempts: Array = [] + const workflow = Workflow.make("WorkflowEngine/SuspendOnFailureRetry", { + payload: { id: Schema.String }, + error: Failed, + idempotencyKey: ({ id }) => id + }).annotate(Workflow.SuspendOnFailure, true) + const layer = workflow.toLayer(() => + Activity.make({ + name: "step", + error: Failed, + execute: Effect.gen(function*() { + const attempt = yield* Activity.CurrentAttempt + attempts.push(attempt) + if (attempts.length <= 2) { + return yield* new Failed() + } + }) + }).pipe(Activity.retry({ times: 3 })) + ).pipe(Layer.provideMerge(WorkflowEngine.layerMemory)) + + yield* Effect.gen(function*() { + const executionId = yield* workflow.execute({ id: "a" }, { discard: true }) + const result = yield* pollUntil(workflow, executionId, "Complete") + assert.deepStrictEqual(result, new Workflow.Complete({ exit: Exit.void })) + assert.deepStrictEqual(attempts, [1, 2, 3]) + }).pipe(Effect.provide(layer)) + })) + + it.effect("layerMemory parks an exhausted Activity.retry under SuspendOnFailure and replays stored failures on resume", () => + Effect.gen(function*() { + class Failed extends Schema.TaggedError()("Failed", {}) {} + const replayedRun = yield* Latch.make() + let runs = 0 + const attempts: Array = [] + const workflow = Workflow.make("WorkflowEngine/SuspendOnFailureRetryExhausted", { + payload: { id: Schema.String }, + error: Failed, + idempotencyKey: ({ id }) => id + }).annotate(Workflow.SuspendOnFailure, true) + const layer = workflow.toLayer(() => { + if (++runs === 2) replayedRun.openUnsafe() + return Activity.make({ + name: "step", + error: Failed, + execute: Effect.gen(function*() { + const attempt = yield* Activity.CurrentAttempt + attempts.push(attempt) + return yield* new Failed() + }) + }).pipe(Activity.retry({ times: 2 })) + }).pipe(Layer.provideMerge(WorkflowEngine.layerMemory)) + + yield* Effect.gen(function*() { + const executionId = yield* workflow.execute({ id: "a" }, { discard: true }) + const suspended = yield* pollUntil(workflow, executionId, "Suspended") + assert.isTrue(suspended._tag === "Suspended" && suspended.failed) + assert.strictEqual(runs, 1) + assert.deepStrictEqual(attempts, [1, 2, 3]) + + yield* workflow.resume(executionId) + yield* replayedRun.await + const replayed = yield* pollUntil(workflow, executionId, "Suspended") + assert.isTrue(replayed._tag === "Suspended" && replayed.failed) + assert.strictEqual(runs, 2) + assert.deepStrictEqual(attempts, [1, 2, 3]) + }).pipe(Effect.provide(layer)) + })) + + it.effect("layerMemory isolates RetryingExecution when a child started inside Activity.retry wakes its parent", () => + Effect.gen(function*() { + const gate = DurableDeferred.make("WorkflowEngine/ChildWakeRetryIsolationGate") + const releaseChild = yield* Latch.make() + const secondParentRun = yield* Latch.make() + let parentRuns = 0 + const Child = Workflow.make("WorkflowEngine/ChildWakeRetryIsolationChild", { + payload: { parentId: Schema.String }, + idempotencyKey: ({ parentId }) => parentId + }) + const Parent = Workflow.make("WorkflowEngine/ChildWakeRetryIsolationParent", { + payload: { id: Schema.String }, + error: Schema.String, + idempotencyKey: ({ id }) => id + }).annotate(Workflow.SuspendOnFailure, true) + const layer = Layer.mergeAll( + Child.toLayer(({ parentId }) => + releaseChild.await.pipe( + Effect.andThen( + DurableDeferred.succeed(gate, { + token: DurableDeferred.tokenFromExecutionId(gate, { workflow: Parent, executionId: parentId }), + value: undefined + }) + ) + ) + ), + Parent.toLayer((_, parentId) => { + if (++parentRuns === 2) secondParentRun.openUnsafe() + return Child.execute({ parentId }, { discard: true }).pipe( + Activity.retry({ times: 1 }), + Effect.andThen(DurableDeferred.await(gate)), + Effect.andThen(Effect.fail("outside-retry")) + ) + }) + ).pipe(Layer.provideMerge(WorkflowEngine.layerMemory)) + + yield* Effect.gen(function*() { + const parentId = yield* Parent.execute({ id: "a" }, { discard: true }) + const parkedOnGate = yield* pollUntil(Parent, parentId, "Suspended") + assert(parkedOnGate._tag === "Suspended") + assert.notStrictEqual(parkedOnGate.failed, true) + + yield* releaseChild.open + yield* secondParentRun.await + const parkedOnFailure = yield* pollUntil(Parent, parentId, "Suspended") + assert.isTrue(parkedOnFailure._tag === "Suspended" && parkedOnFailure.failed) + }).pipe(Effect.provide(layer)) + })) + + it.effect.skipIf(process.versions.bun !== undefined || process.versions.deno !== undefined)( + "layerMemory releases empty scopes, superseded instances, and wait sets across suspended replays", + () => + Effect.gen(function*() { + const gates = [ + DurableDeferred.make("WorkflowEngine/SuspendedReplayRetention/First"), + DurableDeferred.make("WorkflowEngine/SuspendedReplayRetention/Second") + ] + const workflow = Workflow.make("WorkflowEngine/SuspendedReplayRetention", { + payload: {}, + idempotencyKey: () => "one" + }) + let runs = 0 + const run2Started = yield* Latch.make() + const control = new WeakRef({}) + let firstInstance: WeakRef | undefined + let firstAwaits: Map | undefined + let secondParent: Scope.Scope | undefined + const layer = workflow.toLayer(() => + Effect.gen(function*() { + const run = ++runs + if (run === 1) { + const instance = yield* WorkflowEngine.WorkflowInstance + firstInstance = new WeakRef(instance) + firstAwaits = instance.awaitedDeferreds + } else if (run === 2) { + run2Started.openUnsafe() + secondParent = (yield* WorkflowEngine.WorkflowInstance).scope.parent + } + for (const gate of gates) yield* DurableDeferred.await(gate) + }) + ).pipe(Layer.provideMerge(WorkflowEngine.layerMemory)) + + yield* Effect.gen(function*() { + const executionId = yield* workflow.execute({}, { discard: true }) + yield* pollUntil(workflow, executionId, "Suspended") + assert.strictEqual(firstAwaits?.size, 1) + + yield* DurableDeferred.succeed(gates[0], { + token: DurableDeferred.tokenFromExecutionId(gates[0], { workflow, executionId }), + value: undefined + }) + yield* run2Started.await + yield* pollUntil(workflow, executionId, "Suspended") + assert.strictEqual(firstAwaits?.size, 0) + + yield* collectGarbage + assert.isUndefined(control.deref()) + assert.isUndefined(firstInstance?.deref()) + assert.isDefined(secondParent) + assert.strictEqual(secondParent.state._tag === "Open" ? secondParent.state.finalizers?.size ?? 1 : 0, 1) + + yield* DurableDeferred.succeed(gates[1], { + token: DurableDeferred.tokenFromExecutionId(gates[1], { workflow, executionId }), + value: undefined + }) + assert.deepStrictEqual( + yield* pollUntil(workflow, executionId, "Complete"), + new Workflow.Complete({ exit: Exit.void }) + ) + }).pipe(Effect.provide(layer)) + }), + 20_000 + ) + + it.effect("layerMemory wakes every parent awaiting a shared child workflow", () => + Effect.gen(function*() { + const gate = DurableDeferred.make("WorkflowEngine/SharedChildGate", { success: Schema.String }) + const Child = Workflow.make("WorkflowEngine/SharedChild", { + payload: { key: Schema.String }, + success: Schema.String, + idempotencyKey: ({ key }) => key + }) + const Parent = Workflow.make("WorkflowEngine/SharedChildParent", { + payload: { name: Schema.String }, + success: Schema.String, + idempotencyKey: ({ name }) => name + }) + const layer = Layer.merge( + Child.toLayer(() => DurableDeferred.await(gate)), + Parent.toLayer(Effect.fnUntraced(function*({ name }) { + const value = yield* Child.execute({ key: "shared" }) + return `${name}:${value}` + })) + ).pipe(Layer.provideMerge(WorkflowEngine.layerMemory)) + + yield* Effect.gen(function*() { + const childId = yield* Child.execute({ key: "shared" }, { discard: true }) + yield* pollUntil(Child, childId, "Suspended") + + const parentA = yield* Parent.execute({ name: "A" }, { discard: true }) + yield* pollUntil(Parent, parentA, "Suspended") + + const parentB = yield* Parent.execute({ name: "B" }, { discard: true }) + yield* pollUntil(Parent, parentB, "Suspended") + + yield* DurableDeferred.succeed(gate, { + token: DurableDeferred.tokenFromExecutionId(gate, { workflow: Child, executionId: childId }), + value: "done" + }) + + assert.deepStrictEqual( + yield* pollUntil(Child, childId, "Complete"), + new Workflow.Complete({ exit: Exit.succeed("done") }) + ) + assert.deepStrictEqual( + yield* pollUntil(Parent, parentA, "Complete"), + new Workflow.Complete({ exit: Exit.succeed("A:done") }) + ) + assert.deepStrictEqual( + yield* pollUntil(Parent, parentB, "Complete"), + new Workflow.Complete({ exit: Exit.succeed("B:done") }) + ) + }).pipe(Effect.provide(layer)) + })) }) diff --git a/.repos/effect/packages/effect/typetest/Effect.tst.ts b/.repos/effect/packages/effect/typetest/Effect.tst.ts index b69da4947b449..ed7130df3d458 100644 --- a/.repos/effect/packages/effect/typetest/Effect.tst.ts +++ b/.repos/effect/packages/effect/typetest/Effect.tst.ts @@ -452,6 +452,129 @@ describe("Effect.catchReasons", () => { ) expect(result).type.toBe>() }) + + it("removes the parent error when handlers are exhaustive", () => { + const cases = { + RateLimitError: () => Effect.succeed(1), + QuotaExceededError: () => Effect.succeed(2), + UnknownAiModelError: () => Effect.fail(new SimpleError({ code: 1 })) + } + const dataLast = pipe(mixedEffect, Effect.catchReasons("AiError", cases)) + const dataFirst = Effect.catchReasons(mixedEffect, "AiError", cases) + expect(dataLast).type.toBe>() + expect(dataFirst).type.toBe>() + }) + + it("keeps the parent error when coverage is not guaranteed", () => { + const partial = { RateLimitError: () => Effect.succeed(1) } + const optionalCases = {} as { + readonly RateLimitError: () => Effect.Effect + readonly QuotaExceededError: () => Effect.Effect + readonly UnknownAiModelError?: () => Effect.Effect + } + const unionCases = {} as + | { + readonly RateLimitError: () => Effect.Effect + readonly QuotaExceededError?: () => Effect.Effect + readonly UnknownAiModelError?: () => Effect.Effect + } + | { + readonly RateLimitError?: () => Effect.Effect + readonly QuotaExceededError: () => Effect.Effect + readonly UnknownAiModelError: () => Effect.Effect + } + const maybeOrElse = undefined as (() => Effect.Effect) | undefined + type ReasonlessVariant = { readonly _tag: "AiError"; readonly message: string } + const mixedVariant = {} as Effect.Effect< + string, + { readonly _tag: "AiError"; readonly reason: RateLimitError } | ReasonlessVariant + > + type OtherAiError = { readonly _tag: "OtherAiError"; readonly reason: RateLimitError } + const unionParent = {} as Effect.Effect< + string, + { readonly _tag: "AiError"; readonly reason: RateLimitError } | OtherAiError + > + const unionTag = "AiError" as "AiError" | "OtherAiError" + const patternCases: Record<`${string}Error`, () => Effect.Effect> = {} + type PatternParent = { readonly _tag: `Err${string}`; readonly reason: RateLimitError } + const patternParent = {} as Effect.Effect + const disjointCases = {} as + | { readonly RateLimitError: () => Effect.Effect } + | { readonly QuotaExceededError: () => Effect.Effect } + + expect(Effect.catchReasons(mixedEffect, "AiError", partial)).type.toBe< + Effect.Effect + >() + expect(pipe(mixedEffect, Effect.catchReasons("AiError", optionalCases))).type.toBe< + Effect.Effect + >() + expect(Effect.catchReasons(mixedEffect, "AiError", unionCases)).type.toBe< + Effect.Effect + >() + expect(pipe(mixedEffect, Effect.catchReasons("AiError", partial, undefined))).type.toBe< + Effect.Effect + >() + expect(Effect.catchReasons(mixedEffect, "AiError", partial, maybeOrElse)).type.toBe< + Effect.Effect + >() + expect(Effect.catchReasons(mixedVariant, "AiError", { RateLimitError: () => Effect.succeed(1) })).type.toBe< + Effect.Effect + >() + expect(Effect.catchReasons(unionParent, unionTag, { RateLimitError: () => Effect.succeed(1) })).type.toBe< + Effect.Effect + >() + expect(Effect.catchReasons(mixedEffect, "AiError", patternCases)).type.toBe< + Effect.Effect + >() + expect( + Effect.catchReasons(patternParent, "Err1" as PatternParent["_tag"], { RateLimitError: () => Effect.succeed(1) }) + ).type.toBe< + Effect.Effect + >() + expect(Effect.catchReasons(aiEffect, "AiError", disjointCases)).type.toBe< + Effect.Effect + >() + }) + + it("supports explicit generic type arguments", () => { + expect( + Effect.catchReasons( + aiEffect, + "AiError", + {}, + () => Effect.fail(new SimpleError({ code: 1 })) + ) + ).type.toBe>() + expect( + Effect.catchReasons( + aiEffect, + "AiError", + {}, + undefined + ) + ).type.toBe>() + expect( + pipe( + aiEffect, + Effect.catchReasons<"AiError", AiError, {}, never, SimpleError, never>( + "AiError", + {}, + () => Effect.fail(new SimpleError({ code: 1 })) + ) + ) + ).type.toBe>() + expect( + pipe(aiEffect, Effect.catchReasons<"AiError", AiError, {}, number, never, never>("AiError", {}, undefined)) + ).type.toBe>() + }) + + it("behaves like unwrapReason with empty cases and a failing orElse", () => { + const unwrapped = pipe(mixedEffect, Effect.unwrapReason("AiError")) + const dataLast = pipe(mixedEffect, Effect.catchReasons("AiError", {}, (reason) => reason)) + const dataFirst = Effect.catchReasons(mixedEffect, "AiError", {}, (reason) => reason) + expect(dataLast).type.toBe() + expect(dataFirst).type.toBe() + }) }) describe("Effect.catchTag", () => { @@ -468,6 +591,50 @@ describe("Effect.catchTag", () => { expect(result).type.toBe>() }) + it("preserves tagged errors for an inline Effect.map in data-first usage", () => { + const scalar = Effect.catchTag( + Effect.map(mixedEffect, (s) => s.length), + "AiError", + (error) => { + expect(error).type.toBe() + return Effect.succeed(0) + } + ) + expect(scalar).type.toBe>() + + const array = Effect.catchTag( + Effect.map(mixedEffect, (s) => s.length), + ["AiError", "OtherError"], + (error) => { + expect(error).type.toBe() + return Effect.succeed(0) + } + ) + expect(array).type.toBe>() + + const withOrElse = Effect.catchTag( + Effect.map(mixedEffect, (s) => s.length), + "AiError", + () => Effect.succeed(0), + (error) => { + expect(error).type.toBe() + return Effect.fail(new SimpleError({ code: 1 })) + } + ) + expect(withOrElse).type.toBe>() + }) + + it("rejects unknown tags and unknown error channels in data-first usage", () => { + expect(Effect.catchTag).type.not.toBeCallableWith(mixedEffect, "UnknownError", () => Effect.succeed("ok")) + expect(Effect.catchTag).type.not.toBeCallableWith( + mixedEffect, + ["AiError", "UnknownError"], + () => Effect.succeed("ok") + ) + const source = Effect.fail({ _tag: "Oops" }) + expect(Effect.catchTag).type.not.toBeCallableWith(source, "Oops", () => Effect.succeed(0)) + }) + it("handles an array of tags", () => { const result = pipe( mixedEffect, diff --git a/.repos/effect/packages/effect/typetest/Match.tst.ts b/.repos/effect/packages/effect/typetest/Match.tst.ts index 318c1a9cb456e..d1754860ba118 100644 --- a/.repos/effect/packages/effect/typetest/Match.tst.ts +++ b/.repos/effect/packages/effect/typetest/Match.tst.ts @@ -91,6 +91,38 @@ describe("Match", () => { >() }) + it("fn threads arguments through record and discriminator combinators", () => { + type Event = { readonly _tag: "A" } | { readonly _tag: "B" } | { readonly _tag: "C" } + const tags = Match.fn((_context: boolean, event: Event) => event).pipe( + Match.tags({ A: (_event, context) => context }), + Match.tagStartsWith("B", (_event, context) => context), + Match.tagsExhaustive({ C: (_event, context) => context }) + ) + expect(tags).type.toBe<(context: boolean, event: Event) => boolean>() + + type Kind = { readonly kind: "A" } | { readonly kind: "B" } | { readonly kind: "C" } | { readonly kind: "D" } + const kinds = Match.fn((_context: boolean, input: Kind) => input).pipe( + Match.discriminator("kind")("A", (_input, context) => context), + Match.discriminatorStartsWith("kind")("B", (_input, context) => context), + Match.discriminators("kind")({ C: (_input, context) => context }), + Match.discriminatorsExhaustive("kind")({ D: (_input, context) => context }) + ) + expect(kinds).type.toBe<(context: boolean, input: Kind) => boolean>() + + const literals = Match.fn((_context: boolean, value: "a" | "b") => value).pipe( + Match.literals({ a: (_value, context) => context }), + Match.literalsExhaustive({ b: (_value, context) => context }) + ) + expect(literals).type.toBe<(context: boolean, value: "a" | "b") => boolean>() + + type ExplicitEvent = { readonly _tag: "A" } + const explicitFields = { A: (event: ExplicitEvent) => event._tag } + const explicit = Match.type().pipe( + Match.tagsExhaustive(explicitFields) + ) + expect(explicit).type.toBe<(u: ExplicitEvent) => "A">() + }) + it("value matchers resolve terminals for generic inputs", () => { // https://github.com/Effect-TS/effect/issues/7315 const orElse = ( diff --git a/.repos/effect/packages/effect/typetest/ai/McpServer.tst.ts b/.repos/effect/packages/effect/typetest/ai/McpServer.tst.ts index e13f95c9072c8..d0a9be8295e67 100644 --- a/.repos/effect/packages/effect/typetest/ai/McpServer.tst.ts +++ b/.repos/effect/packages/effect/typetest/ai/McpServer.tst.ts @@ -1,5 +1,5 @@ import { hole } from "effect" -import { McpProtocol, McpSchema, McpServer, Tool, Toolkit } from "effect/ai" +import { McpProtocol, McpSchema, McpServer, type Skill, Tool, Toolkit } from "effect/ai" import type * as Cause from "effect/Cause" import * as Context from "effect/Context" import * as Effect from "effect/Effect" @@ -485,4 +485,19 @@ describe("McpServer", () => { expect>().type.toBe() }) }) + + describe("skills", () => { + it("should accept a Skill value in registerSkill and skill", () => { + const skill = hole() + expect(McpServer.registerSkill(skill, { uri: "skill://billing/refunds/SKILL.md" })).type.toBe< + Effect.Effect + >() + expect(McpServer.skill(skill, { uri: "skill://billing/refunds/SKILL.md", annotations: Context.empty() })).type + .toBe< + Layer.Layer + >() + expect>().type.toBe<[options: McpServer.SkillOptions]>() + expect>().type.toBe<[options: McpServer.SkillOptions]>() + }) + }) }) diff --git a/.repos/effect/packages/opentelemetry/CHANGELOG.md b/.repos/effect/packages/opentelemetry/CHANGELOG.md index 6e0ee521cf90b..e07b895ee357b 100644 --- a/.repos/effect/packages/opentelemetry/CHANGELOG.md +++ b/.repos/effect/packages/opentelemetry/CHANGELOG.md @@ -1,5 +1,12 @@ # @effect/opentelemetry +## 4.1.6 + +### Patch Changes + +- Updated dependencies [[`dd5f2f3`](https://github.com/Effect-TS/effect/commit/dd5f2f322fbad042a3a186cef593bf42affe5ce9), [`1d65846`](https://github.com/Effect-TS/effect/commit/1d65846308a6a18c4a95af543988ad30b72ff2b3), [`694c28f`](https://github.com/Effect-TS/effect/commit/694c28f0cfc3eac33f71160d18dda95cb670f506), [`5aaa2cd`](https://github.com/Effect-TS/effect/commit/5aaa2cd216e5e55f92d06db98d4b54946a396eed), [`55814bf`](https://github.com/Effect-TS/effect/commit/55814bf0a780f05ed0a51c82c8affda5d539bb0e), [`92c40a1`](https://github.com/Effect-TS/effect/commit/92c40a1f96a59f9edcacee6c0d6f6fb80397ee17), [`9f415a7`](https://github.com/Effect-TS/effect/commit/9f415a7733cdf8aed7efadbed3b5db22890e164a), [`e367afd`](https://github.com/Effect-TS/effect/commit/e367afdacfa3041a694a67e4670e98a20e41d45c), [`d5d2112`](https://github.com/Effect-TS/effect/commit/d5d21120ff591fcf8da006ce340010812cc91f16), [`fa2e5af`](https://github.com/Effect-TS/effect/commit/fa2e5af4ccc8f3650d97049707be82eab098c168), [`6bf6427`](https://github.com/Effect-TS/effect/commit/6bf6427d195539c387c13156aff79db077929c8f), [`10bc4a4`](https://github.com/Effect-TS/effect/commit/10bc4a47c0ce5bc50ba1998d63a803e3887d1d2b), [`a9540d3`](https://github.com/Effect-TS/effect/commit/a9540d3d50fbe65ade7f9b2f478cdd34a888161e), [`3a250d7`](https://github.com/Effect-TS/effect/commit/3a250d7eb8c310bf4751b3eca0038cf50e1629d8), [`ce44141`](https://github.com/Effect-TS/effect/commit/ce44141ad1bc8d05f3f7399bfa1e87772573205d), [`9318e5b`](https://github.com/Effect-TS/effect/commit/9318e5bafb144ddff65a0bff0148ec4f7ba77b5c), [`c9ecebf`](https://github.com/Effect-TS/effect/commit/c9ecebf7ede8a98895552fd20223d6573bd846fe), [`32f8fbe`](https://github.com/Effect-TS/effect/commit/32f8fbe1a5985aea41754e87531e9a1d0fbf78ec), [`41d6af1`](https://github.com/Effect-TS/effect/commit/41d6af14b7f36e06ade3bf7333b710e73de1e1c2), [`c33fd59`](https://github.com/Effect-TS/effect/commit/c33fd599cb7d49117f77f7bd8f05cb4209112a34), [`1f9e9d3`](https://github.com/Effect-TS/effect/commit/1f9e9d3de552435de6b8f4e1166515d0964c3999), [`594fa71`](https://github.com/Effect-TS/effect/commit/594fa71da417bf94fa6c9be2d3d36c808197e9fe), [`b378c38`](https://github.com/Effect-TS/effect/commit/b378c383cdb29e819e24da5dc725479a2ba4fdf1), [`a9ec9a6`](https://github.com/Effect-TS/effect/commit/a9ec9a60bbe1309960e00527ab62342dce1a86fc), [`310a81b`](https://github.com/Effect-TS/effect/commit/310a81b391e24d42b6608b5e3d641eca63e0d4c0), [`aab2135`](https://github.com/Effect-TS/effect/commit/aab2135d3fe43d4d86c4e486ed378797314fb212), [`6744a72`](https://github.com/Effect-TS/effect/commit/6744a724869539fc2d733929df871ef523bf82e8), [`848d042`](https://github.com/Effect-TS/effect/commit/848d0426f287b3e7ff970219d980a4c66fa441ad), [`077a93e`](https://github.com/Effect-TS/effect/commit/077a93e5db3adbc42e531539cb12b8bdbdfe5328), [`aef50fb`](https://github.com/Effect-TS/effect/commit/aef50fb8b56ec9ff8116f157635579fefd995f26), [`2e4de86`](https://github.com/Effect-TS/effect/commit/2e4de8634431f3da08ca2a90ab1024ee08e216f3), [`482b104`](https://github.com/Effect-TS/effect/commit/482b104caf712a8d5f99aafc64e55b6ea38eb809), [`753e1ed`](https://github.com/Effect-TS/effect/commit/753e1ed88069f73103d136dcdc58188fd10efdf1), [`0d2bb4a`](https://github.com/Effect-TS/effect/commit/0d2bb4a4b6526e1767b81101ee6e8da88ba1de55), [`8161e03`](https://github.com/Effect-TS/effect/commit/8161e03c26d691502afeddcf7e2ee75e6931637f), [`49f5391`](https://github.com/Effect-TS/effect/commit/49f53918a150aa2ea0ce2d444400cec1d6097400), [`3d59bdf`](https://github.com/Effect-TS/effect/commit/3d59bdf6f8f95ceea2091e5b8f375b834a14b3b1), [`8866608`](https://github.com/Effect-TS/effect/commit/88666082f2b6296bb7115bd4a2546151039f64db), [`69fd4b1`](https://github.com/Effect-TS/effect/commit/69fd4b1fba9e2ec5e7c16058ff8d9a1f9a38d90e), [`7d97626`](https://github.com/Effect-TS/effect/commit/7d9762658e515807c2b98678e7abd3ebe94e41ec), [`0e79436`](https://github.com/Effect-TS/effect/commit/0e794366658bd067a2212ea2ac7ed0223904ed31), [`2f8a4e9`](https://github.com/Effect-TS/effect/commit/2f8a4e9b90822d9facfef59027b35819c42d7b48), [`800b753`](https://github.com/Effect-TS/effect/commit/800b7535b4e37a24ac458cae78231054dae0b0f5)]: + - effect@4.1.6 + ## 4.1.5 ### Patch Changes diff --git a/.repos/effect/packages/opentelemetry/package.json b/.repos/effect/packages/opentelemetry/package.json index cacdd7937ea4b..cc20814e96c33 100644 --- a/.repos/effect/packages/opentelemetry/package.json +++ b/.repos/effect/packages/opentelemetry/package.json @@ -1,7 +1,7 @@ { "name": "@effect/opentelemetry", "type": "module", - "version": "4.1.5", + "version": "4.1.6", "license": "MIT", "description": "OpenTelemetry integration for Effect", "homepage": "https://effect.website", diff --git a/.repos/effect/packages/platform/browser/CHANGELOG.md b/.repos/effect/packages/platform/browser/CHANGELOG.md index 7c220295aa9a8..e0e7743da0b5f 100644 --- a/.repos/effect/packages/platform/browser/CHANGELOG.md +++ b/.repos/effect/packages/platform/browser/CHANGELOG.md @@ -1,5 +1,12 @@ # @effect/platform-browser +## 4.1.6 + +### Patch Changes + +- Updated dependencies [[`dd5f2f3`](https://github.com/Effect-TS/effect/commit/dd5f2f322fbad042a3a186cef593bf42affe5ce9), [`1d65846`](https://github.com/Effect-TS/effect/commit/1d65846308a6a18c4a95af543988ad30b72ff2b3), [`694c28f`](https://github.com/Effect-TS/effect/commit/694c28f0cfc3eac33f71160d18dda95cb670f506), [`5aaa2cd`](https://github.com/Effect-TS/effect/commit/5aaa2cd216e5e55f92d06db98d4b54946a396eed), [`55814bf`](https://github.com/Effect-TS/effect/commit/55814bf0a780f05ed0a51c82c8affda5d539bb0e), [`92c40a1`](https://github.com/Effect-TS/effect/commit/92c40a1f96a59f9edcacee6c0d6f6fb80397ee17), [`9f415a7`](https://github.com/Effect-TS/effect/commit/9f415a7733cdf8aed7efadbed3b5db22890e164a), [`e367afd`](https://github.com/Effect-TS/effect/commit/e367afdacfa3041a694a67e4670e98a20e41d45c), [`d5d2112`](https://github.com/Effect-TS/effect/commit/d5d21120ff591fcf8da006ce340010812cc91f16), [`fa2e5af`](https://github.com/Effect-TS/effect/commit/fa2e5af4ccc8f3650d97049707be82eab098c168), [`6bf6427`](https://github.com/Effect-TS/effect/commit/6bf6427d195539c387c13156aff79db077929c8f), [`10bc4a4`](https://github.com/Effect-TS/effect/commit/10bc4a47c0ce5bc50ba1998d63a803e3887d1d2b), [`a9540d3`](https://github.com/Effect-TS/effect/commit/a9540d3d50fbe65ade7f9b2f478cdd34a888161e), [`3a250d7`](https://github.com/Effect-TS/effect/commit/3a250d7eb8c310bf4751b3eca0038cf50e1629d8), [`ce44141`](https://github.com/Effect-TS/effect/commit/ce44141ad1bc8d05f3f7399bfa1e87772573205d), [`9318e5b`](https://github.com/Effect-TS/effect/commit/9318e5bafb144ddff65a0bff0148ec4f7ba77b5c), [`c9ecebf`](https://github.com/Effect-TS/effect/commit/c9ecebf7ede8a98895552fd20223d6573bd846fe), [`32f8fbe`](https://github.com/Effect-TS/effect/commit/32f8fbe1a5985aea41754e87531e9a1d0fbf78ec), [`41d6af1`](https://github.com/Effect-TS/effect/commit/41d6af14b7f36e06ade3bf7333b710e73de1e1c2), [`c33fd59`](https://github.com/Effect-TS/effect/commit/c33fd599cb7d49117f77f7bd8f05cb4209112a34), [`1f9e9d3`](https://github.com/Effect-TS/effect/commit/1f9e9d3de552435de6b8f4e1166515d0964c3999), [`594fa71`](https://github.com/Effect-TS/effect/commit/594fa71da417bf94fa6c9be2d3d36c808197e9fe), [`b378c38`](https://github.com/Effect-TS/effect/commit/b378c383cdb29e819e24da5dc725479a2ba4fdf1), [`a9ec9a6`](https://github.com/Effect-TS/effect/commit/a9ec9a60bbe1309960e00527ab62342dce1a86fc), [`310a81b`](https://github.com/Effect-TS/effect/commit/310a81b391e24d42b6608b5e3d641eca63e0d4c0), [`aab2135`](https://github.com/Effect-TS/effect/commit/aab2135d3fe43d4d86c4e486ed378797314fb212), [`6744a72`](https://github.com/Effect-TS/effect/commit/6744a724869539fc2d733929df871ef523bf82e8), [`848d042`](https://github.com/Effect-TS/effect/commit/848d0426f287b3e7ff970219d980a4c66fa441ad), [`077a93e`](https://github.com/Effect-TS/effect/commit/077a93e5db3adbc42e531539cb12b8bdbdfe5328), [`aef50fb`](https://github.com/Effect-TS/effect/commit/aef50fb8b56ec9ff8116f157635579fefd995f26), [`2e4de86`](https://github.com/Effect-TS/effect/commit/2e4de8634431f3da08ca2a90ab1024ee08e216f3), [`482b104`](https://github.com/Effect-TS/effect/commit/482b104caf712a8d5f99aafc64e55b6ea38eb809), [`753e1ed`](https://github.com/Effect-TS/effect/commit/753e1ed88069f73103d136dcdc58188fd10efdf1), [`0d2bb4a`](https://github.com/Effect-TS/effect/commit/0d2bb4a4b6526e1767b81101ee6e8da88ba1de55), [`8161e03`](https://github.com/Effect-TS/effect/commit/8161e03c26d691502afeddcf7e2ee75e6931637f), [`49f5391`](https://github.com/Effect-TS/effect/commit/49f53918a150aa2ea0ce2d444400cec1d6097400), [`3d59bdf`](https://github.com/Effect-TS/effect/commit/3d59bdf6f8f95ceea2091e5b8f375b834a14b3b1), [`8866608`](https://github.com/Effect-TS/effect/commit/88666082f2b6296bb7115bd4a2546151039f64db), [`69fd4b1`](https://github.com/Effect-TS/effect/commit/69fd4b1fba9e2ec5e7c16058ff8d9a1f9a38d90e), [`7d97626`](https://github.com/Effect-TS/effect/commit/7d9762658e515807c2b98678e7abd3ebe94e41ec), [`0e79436`](https://github.com/Effect-TS/effect/commit/0e794366658bd067a2212ea2ac7ed0223904ed31), [`2f8a4e9`](https://github.com/Effect-TS/effect/commit/2f8a4e9b90822d9facfef59027b35819c42d7b48), [`800b753`](https://github.com/Effect-TS/effect/commit/800b7535b4e37a24ac458cae78231054dae0b0f5)]: + - effect@4.1.6 + ## 4.1.5 ### Patch Changes diff --git a/.repos/effect/packages/platform/browser/package.json b/.repos/effect/packages/platform/browser/package.json index 78cd6ce03407f..ff91aadb627dc 100644 --- a/.repos/effect/packages/platform/browser/package.json +++ b/.repos/effect/packages/platform/browser/package.json @@ -1,7 +1,7 @@ { "name": "@effect/platform-browser", "type": "module", - "version": "4.1.5", + "version": "4.1.6", "license": "MIT", "description": "Platform specific implementations for the browser", "homepage": "https://effect.website", diff --git a/.repos/effect/packages/platform/bun/CHANGELOG.md b/.repos/effect/packages/platform/bun/CHANGELOG.md index c8c675a8ef557..19fa1bdd10301 100644 --- a/.repos/effect/packages/platform/bun/CHANGELOG.md +++ b/.repos/effect/packages/platform/bun/CHANGELOG.md @@ -1,5 +1,14 @@ # @effect/platform-bun +## 4.1.6 + +### Patch Changes + +- [#10871](https://github.com/Effect-TS/effect/pull/10871) [`2ccb845`](https://github.com/Effect-TS/effect/commit/2ccb8453251c0f18e0ace3964da23d77dada6571) Thanks @devangpratap! - Infer the `Content-Type` of `HttpServerResponse.fileWeb` responses from the file name when `File.type` is empty, as the Node and Deno platforms do. +- Updated dependencies [[`dd5f2f3`](https://github.com/Effect-TS/effect/commit/dd5f2f322fbad042a3a186cef593bf42affe5ce9), [`1d65846`](https://github.com/Effect-TS/effect/commit/1d65846308a6a18c4a95af543988ad30b72ff2b3), [`694c28f`](https://github.com/Effect-TS/effect/commit/694c28f0cfc3eac33f71160d18dda95cb670f506), [`5aaa2cd`](https://github.com/Effect-TS/effect/commit/5aaa2cd216e5e55f92d06db98d4b54946a396eed), [`55814bf`](https://github.com/Effect-TS/effect/commit/55814bf0a780f05ed0a51c82c8affda5d539bb0e), [`92c40a1`](https://github.com/Effect-TS/effect/commit/92c40a1f96a59f9edcacee6c0d6f6fb80397ee17), [`9f415a7`](https://github.com/Effect-TS/effect/commit/9f415a7733cdf8aed7efadbed3b5db22890e164a), [`e367afd`](https://github.com/Effect-TS/effect/commit/e367afdacfa3041a694a67e4670e98a20e41d45c), [`d5d2112`](https://github.com/Effect-TS/effect/commit/d5d21120ff591fcf8da006ce340010812cc91f16), [`fa2e5af`](https://github.com/Effect-TS/effect/commit/fa2e5af4ccc8f3650d97049707be82eab098c168), [`6bf6427`](https://github.com/Effect-TS/effect/commit/6bf6427d195539c387c13156aff79db077929c8f), [`10bc4a4`](https://github.com/Effect-TS/effect/commit/10bc4a47c0ce5bc50ba1998d63a803e3887d1d2b), [`a9540d3`](https://github.com/Effect-TS/effect/commit/a9540d3d50fbe65ade7f9b2f478cdd34a888161e), [`3a250d7`](https://github.com/Effect-TS/effect/commit/3a250d7eb8c310bf4751b3eca0038cf50e1629d8), [`ce44141`](https://github.com/Effect-TS/effect/commit/ce44141ad1bc8d05f3f7399bfa1e87772573205d), [`9318e5b`](https://github.com/Effect-TS/effect/commit/9318e5bafb144ddff65a0bff0148ec4f7ba77b5c), [`24ff77b`](https://github.com/Effect-TS/effect/commit/24ff77bbec6ebfe991fda20393c895734ef166ba), [`c9ecebf`](https://github.com/Effect-TS/effect/commit/c9ecebf7ede8a98895552fd20223d6573bd846fe), [`32f8fbe`](https://github.com/Effect-TS/effect/commit/32f8fbe1a5985aea41754e87531e9a1d0fbf78ec), [`41d6af1`](https://github.com/Effect-TS/effect/commit/41d6af14b7f36e06ade3bf7333b710e73de1e1c2), [`c33fd59`](https://github.com/Effect-TS/effect/commit/c33fd599cb7d49117f77f7bd8f05cb4209112a34), [`1f9e9d3`](https://github.com/Effect-TS/effect/commit/1f9e9d3de552435de6b8f4e1166515d0964c3999), [`594fa71`](https://github.com/Effect-TS/effect/commit/594fa71da417bf94fa6c9be2d3d36c808197e9fe), [`b378c38`](https://github.com/Effect-TS/effect/commit/b378c383cdb29e819e24da5dc725479a2ba4fdf1), [`a9ec9a6`](https://github.com/Effect-TS/effect/commit/a9ec9a60bbe1309960e00527ab62342dce1a86fc), [`310a81b`](https://github.com/Effect-TS/effect/commit/310a81b391e24d42b6608b5e3d641eca63e0d4c0), [`2576bbc`](https://github.com/Effect-TS/effect/commit/2576bbcbe89fec2362240280e4db2bc371f978e3), [`f409e90`](https://github.com/Effect-TS/effect/commit/f409e9068a4ce2991d0a724187b11b98ae4dd222), [`3498c76`](https://github.com/Effect-TS/effect/commit/3498c76f0968bb32167d0d8a0d6c3888fa733f83), [`aab2135`](https://github.com/Effect-TS/effect/commit/aab2135d3fe43d4d86c4e486ed378797314fb212), [`6744a72`](https://github.com/Effect-TS/effect/commit/6744a724869539fc2d733929df871ef523bf82e8), [`13659f7`](https://github.com/Effect-TS/effect/commit/13659f7245ca526e474403e8066941198c49773d), [`848d042`](https://github.com/Effect-TS/effect/commit/848d0426f287b3e7ff970219d980a4c66fa441ad), [`077a93e`](https://github.com/Effect-TS/effect/commit/077a93e5db3adbc42e531539cb12b8bdbdfe5328), [`aef50fb`](https://github.com/Effect-TS/effect/commit/aef50fb8b56ec9ff8116f157635579fefd995f26), [`2e4de86`](https://github.com/Effect-TS/effect/commit/2e4de8634431f3da08ca2a90ab1024ee08e216f3), [`482b104`](https://github.com/Effect-TS/effect/commit/482b104caf712a8d5f99aafc64e55b6ea38eb809), [`753e1ed`](https://github.com/Effect-TS/effect/commit/753e1ed88069f73103d136dcdc58188fd10efdf1), [`0d2bb4a`](https://github.com/Effect-TS/effect/commit/0d2bb4a4b6526e1767b81101ee6e8da88ba1de55), [`8161e03`](https://github.com/Effect-TS/effect/commit/8161e03c26d691502afeddcf7e2ee75e6931637f), [`9b7b7c2`](https://github.com/Effect-TS/effect/commit/9b7b7c2d1afe85b6f4e61b9af19d9a0e9c9cec82), [`49f5391`](https://github.com/Effect-TS/effect/commit/49f53918a150aa2ea0ce2d444400cec1d6097400), [`3d59bdf`](https://github.com/Effect-TS/effect/commit/3d59bdf6f8f95ceea2091e5b8f375b834a14b3b1), [`8866608`](https://github.com/Effect-TS/effect/commit/88666082f2b6296bb7115bd4a2546151039f64db), [`69fd4b1`](https://github.com/Effect-TS/effect/commit/69fd4b1fba9e2ec5e7c16058ff8d9a1f9a38d90e), [`7d97626`](https://github.com/Effect-TS/effect/commit/7d9762658e515807c2b98678e7abd3ebe94e41ec), [`0e79436`](https://github.com/Effect-TS/effect/commit/0e794366658bd067a2212ea2ac7ed0223904ed31), [`2f8a4e9`](https://github.com/Effect-TS/effect/commit/2f8a4e9b90822d9facfef59027b35819c42d7b48), [`800b753`](https://github.com/Effect-TS/effect/commit/800b7535b4e37a24ac458cae78231054dae0b0f5)]: + - effect@4.1.6 + - @effect/platform-node-shared@4.1.6 + ## 4.1.5 ### Patch Changes diff --git a/.repos/effect/packages/platform/bun/package.json b/.repos/effect/packages/platform/bun/package.json index f3827d8129464..13313cfb2b805 100644 --- a/.repos/effect/packages/platform/bun/package.json +++ b/.repos/effect/packages/platform/bun/package.json @@ -1,7 +1,7 @@ { "name": "@effect/platform-bun", "type": "module", - "version": "4.1.5", + "version": "4.1.6", "license": "MIT", "description": "Platform specific implementations for the Bun runtime", "homepage": "https://effect.website", @@ -70,8 +70,8 @@ "@effect/platform-node-shared": "workspace:*" }, "devDependencies": { - "@types/bun": "^1.4.4", + "@types/bun": "^1.4.5", "effect": "workspace:^", - "tinybench": "^6.2.3" + "tinybench": "^6.2.4" } } diff --git a/.repos/effect/packages/platform/bun/src/BunChildProcessSpawner.ts b/.repos/effect/packages/platform/bun/src/BunChildProcessSpawner.ts index ba6f2fbe44213..f42e7c6f0f9ad 100644 --- a/.repos/effect/packages/platform/bun/src/BunChildProcessSpawner.ts +++ b/.repos/effect/packages/platform/bun/src/BunChildProcessSpawner.ts @@ -4,4 +4,31 @@ * @stability unstable * @since 4.0.0 */ -export * from "@effect/platform-node-shared/NodeChildProcessSpawner" +export { + /** + * Flattens a `Command` into its `StandardCommand`s along with the pipe + * options for each connection. + * + * @stability unstable + * @category re-exports + * @since 4.0.0 + */ + flattenCommand, + /** + * Result of flattening a pipeline of commands. + * + * @stability unstable + * @category re-exports + * @since 4.0.0 + */ + type FlattenedPipeline, + /** + * Layer that provides the shared Node-compatible `ChildProcessSpawner` + * implementation. + * + * @stability unstable + * @category re-exports + * @since 4.0.0 + */ + layer +} from "@effect/platform-node-shared/NodeChildProcessSpawner" diff --git a/.repos/effect/packages/platform/bun/src/BunHttpPlatform.ts b/.repos/effect/packages/platform/bun/src/BunHttpPlatform.ts index b9f2e4dc7f572..e6b19692039dc 100644 --- a/.repos/effect/packages/platform/bun/src/BunHttpPlatform.ts +++ b/.repos/effect/packages/platform/bun/src/BunHttpPlatform.ts @@ -16,7 +16,9 @@ import type { FileSystem } from "effect/FileSystem" import * as Etag from "effect/http/Etag" import * as Platform from "effect/http/HttpPlatform" import * as Response from "effect/http/HttpServerResponse" +import * as Mime from "effect/http/Mime" import * as Layer from "effect/Layer" +import * as Option from "effect/Option" import * as BunFileSystem from "./BunFileSystem.ts" // Bun's CompressionStream supports an extended format set covering brotli and @@ -54,7 +56,15 @@ const make: Effect.Effect< const body = start > 0 || end !== undefined ? (file as File).slice(start, end, file.type) : file - return Response.raw(body, { headers, status, statusText }) + return Response.raw(body, { + headers: { + ...headers, + "content-type": headers["content-type"] ?? + (file.type === "" ? Option.getOrElse(Mime.getType(file.name), () => "application/octet-stream") : file.type) + }, + status, + statusText + }) } }) diff --git a/.repos/effect/packages/platform/bun/test/BunHttpPlatform.test.ts b/.repos/effect/packages/platform/bun/test/BunHttpPlatform.test.ts index 70fb7bba759da..81882b7b8bb65 100644 --- a/.repos/effect/packages/platform/bun/test/BunHttpPlatform.test.ts +++ b/.repos/effect/packages/platform/bun/test/BunHttpPlatform.test.ts @@ -95,6 +95,14 @@ describe("BunHttpPlatform", { concurrent: false }, () => { ) }).pipe(Effect.provide(BunHttpPlatform.layer))) + it.effect("fileWebResponse looks up the content type from the name when File.type is empty", () => + Effect.gen(function*() { + const platform = yield* HttpPlatform.HttpPlatform + const response = yield* platform.fileWebResponse(new File(["

Effect

"], "INDEX.HTML")) + + assert.strictEqual(response.headers["content-type"], "text/html") + }).pipe(Effect.provide(BunHttpPlatform.layer))) + it.effect("fileResponse supports exact and empty ranges", () => Effect.gen(function*() { const platform = yield* HttpPlatform.HttpPlatform diff --git a/.repos/effect/packages/platform/cloudflare/CHANGELOG.md b/.repos/effect/packages/platform/cloudflare/CHANGELOG.md index 9f6ae39784a8c..1ab46e3c5dcf1 100644 --- a/.repos/effect/packages/platform/cloudflare/CHANGELOG.md +++ b/.repos/effect/packages/platform/cloudflare/CHANGELOG.md @@ -1,5 +1,25 @@ # @effect/platform-cloudflare +## 4.1.6 + +### Patch Changes + +- [#10830](https://github.com/Effect-TS/effect/pull/10830) [`72f3929`](https://github.com/Effect-TS/effect/commit/72f392972cb3624be2bbc82d71798174d1b48de2) Thanks @bastiankistner! - Fix cluster parent workflow wakes, scheduled entity replies and keep-alive reaching objects outside the caller's jurisdiction, and add a `jurisdiction` option to `AlchemyCloudflareCluster.make`. + +- [#10918](https://github.com/Effect-TS/effect/pull/10918) [`330fbe9`](https://github.com/Effect-TS/effect/commit/330fbe98bb8f03bb46f1182163424ac9dbb100f7) Thanks @effect-bot! - Avoid redundant clock scans and alarm writes when replaying `DurableClock.sleep` in Cloudflare workflows. + +- [#10905](https://github.com/Effect-TS/effect/pull/10905) [`d478b70`](https://github.com/Effect-TS/effect/commit/d478b70d12677cb18096ac0fac174c77da608de6) Thanks @effect-bot! - Fix Cloudflare workflow Durable Objects firing an expired resume guard alarm before a `DurableClock.sleep` is due, and clear unused alarms on suspension and completion. + +- [#10851](https://github.com/Effect-TS/effect/pull/10851) [`bb02f33`](https://github.com/Effect-TS/effect/commit/bb02f33a66309e62999d16fb87a3278157dd2e79) Thanks @effect-bot! - Update repository dependencies to their latest compatible releases. + +- [#10885](https://github.com/Effect-TS/effect/pull/10885) [`7d97626`](https://github.com/Effect-TS/effect/commit/7d9762658e515807c2b98678e7abd3ebe94e41ec) Thanks @effect-bot! - Fix shared child workflow executions leaving additional waiting parents suspended in `ClusterWorkflowEngine`, `WorkflowEngine.layerMemory`, and `CloudflareWorkflowEngine`. + + - `MessageStorage` / `MessageStorage.Encoded`: custom implementations must add `requestsForAddress({ address, tag })`, returning all saved requests (`Envelope.PartialRequestEncoded`, processed or unprocessed, across shards) matching `entityType`, `entityId`, and `tag` exactly. + - `SqlMessageStorage`: migration `0006_address_index` adds an `(entity_type, entity_id, tag)` index on the messages table. +- Updated dependencies [[`dd5f2f3`](https://github.com/Effect-TS/effect/commit/dd5f2f322fbad042a3a186cef593bf42affe5ce9), [`1d65846`](https://github.com/Effect-TS/effect/commit/1d65846308a6a18c4a95af543988ad30b72ff2b3), [`694c28f`](https://github.com/Effect-TS/effect/commit/694c28f0cfc3eac33f71160d18dda95cb670f506), [`5aaa2cd`](https://github.com/Effect-TS/effect/commit/5aaa2cd216e5e55f92d06db98d4b54946a396eed), [`55814bf`](https://github.com/Effect-TS/effect/commit/55814bf0a780f05ed0a51c82c8affda5d539bb0e), [`92c40a1`](https://github.com/Effect-TS/effect/commit/92c40a1f96a59f9edcacee6c0d6f6fb80397ee17), [`9f415a7`](https://github.com/Effect-TS/effect/commit/9f415a7733cdf8aed7efadbed3b5db22890e164a), [`e367afd`](https://github.com/Effect-TS/effect/commit/e367afdacfa3041a694a67e4670e98a20e41d45c), [`d5d2112`](https://github.com/Effect-TS/effect/commit/d5d21120ff591fcf8da006ce340010812cc91f16), [`fa2e5af`](https://github.com/Effect-TS/effect/commit/fa2e5af4ccc8f3650d97049707be82eab098c168), [`6bf6427`](https://github.com/Effect-TS/effect/commit/6bf6427d195539c387c13156aff79db077929c8f), [`10bc4a4`](https://github.com/Effect-TS/effect/commit/10bc4a47c0ce5bc50ba1998d63a803e3887d1d2b), [`a9540d3`](https://github.com/Effect-TS/effect/commit/a9540d3d50fbe65ade7f9b2f478cdd34a888161e), [`3a250d7`](https://github.com/Effect-TS/effect/commit/3a250d7eb8c310bf4751b3eca0038cf50e1629d8), [`ce44141`](https://github.com/Effect-TS/effect/commit/ce44141ad1bc8d05f3f7399bfa1e87772573205d), [`9318e5b`](https://github.com/Effect-TS/effect/commit/9318e5bafb144ddff65a0bff0148ec4f7ba77b5c), [`c9ecebf`](https://github.com/Effect-TS/effect/commit/c9ecebf7ede8a98895552fd20223d6573bd846fe), [`32f8fbe`](https://github.com/Effect-TS/effect/commit/32f8fbe1a5985aea41754e87531e9a1d0fbf78ec), [`41d6af1`](https://github.com/Effect-TS/effect/commit/41d6af14b7f36e06ade3bf7333b710e73de1e1c2), [`c33fd59`](https://github.com/Effect-TS/effect/commit/c33fd599cb7d49117f77f7bd8f05cb4209112a34), [`1f9e9d3`](https://github.com/Effect-TS/effect/commit/1f9e9d3de552435de6b8f4e1166515d0964c3999), [`594fa71`](https://github.com/Effect-TS/effect/commit/594fa71da417bf94fa6c9be2d3d36c808197e9fe), [`b378c38`](https://github.com/Effect-TS/effect/commit/b378c383cdb29e819e24da5dc725479a2ba4fdf1), [`a9ec9a6`](https://github.com/Effect-TS/effect/commit/a9ec9a60bbe1309960e00527ab62342dce1a86fc), [`310a81b`](https://github.com/Effect-TS/effect/commit/310a81b391e24d42b6608b5e3d641eca63e0d4c0), [`aab2135`](https://github.com/Effect-TS/effect/commit/aab2135d3fe43d4d86c4e486ed378797314fb212), [`6744a72`](https://github.com/Effect-TS/effect/commit/6744a724869539fc2d733929df871ef523bf82e8), [`848d042`](https://github.com/Effect-TS/effect/commit/848d0426f287b3e7ff970219d980a4c66fa441ad), [`077a93e`](https://github.com/Effect-TS/effect/commit/077a93e5db3adbc42e531539cb12b8bdbdfe5328), [`aef50fb`](https://github.com/Effect-TS/effect/commit/aef50fb8b56ec9ff8116f157635579fefd995f26), [`2e4de86`](https://github.com/Effect-TS/effect/commit/2e4de8634431f3da08ca2a90ab1024ee08e216f3), [`482b104`](https://github.com/Effect-TS/effect/commit/482b104caf712a8d5f99aafc64e55b6ea38eb809), [`753e1ed`](https://github.com/Effect-TS/effect/commit/753e1ed88069f73103d136dcdc58188fd10efdf1), [`0d2bb4a`](https://github.com/Effect-TS/effect/commit/0d2bb4a4b6526e1767b81101ee6e8da88ba1de55), [`8161e03`](https://github.com/Effect-TS/effect/commit/8161e03c26d691502afeddcf7e2ee75e6931637f), [`49f5391`](https://github.com/Effect-TS/effect/commit/49f53918a150aa2ea0ce2d444400cec1d6097400), [`3d59bdf`](https://github.com/Effect-TS/effect/commit/3d59bdf6f8f95ceea2091e5b8f375b834a14b3b1), [`8866608`](https://github.com/Effect-TS/effect/commit/88666082f2b6296bb7115bd4a2546151039f64db), [`69fd4b1`](https://github.com/Effect-TS/effect/commit/69fd4b1fba9e2ec5e7c16058ff8d9a1f9a38d90e), [`7d97626`](https://github.com/Effect-TS/effect/commit/7d9762658e515807c2b98678e7abd3ebe94e41ec), [`0e79436`](https://github.com/Effect-TS/effect/commit/0e794366658bd067a2212ea2ac7ed0223904ed31), [`2f8a4e9`](https://github.com/Effect-TS/effect/commit/2f8a4e9b90822d9facfef59027b35819c42d7b48), [`800b753`](https://github.com/Effect-TS/effect/commit/800b7535b4e37a24ac458cae78231054dae0b0f5)]: + - effect@4.1.6 + - @effect/sql-sqlite-do@4.1.6 + ## 4.1.5 ### Patch Changes diff --git a/.repos/effect/packages/platform/cloudflare/README.md b/.repos/effect/packages/platform/cloudflare/README.md index e0a1a5f288a9a..2e3d900508ddd 100644 --- a/.repos/effect/packages/platform/cloudflare/README.md +++ b/.repos/effect/packages/platform/cloudflare/README.md @@ -289,6 +289,21 @@ are internal transport: they trust the same-Worker namespace bindings and must not be exposed on a public route. HTTP or RPC authentication and authorization are user code on the Worker. +## Data location + +To keep cluster Durable Objects inside a +[jurisdiction](https://developers.cloudflare.com/durable-objects/reference/data-location/), +pass jurisdiction subnamespaces (for example `env.CLUSTER_ENTITY.jurisdiction("eu")`) +for all four bindings to `CloudflareCluster.layer`, or pass `jurisdiction: "eu"` +to `AlchemyCloudflareCluster.make`. Under local `wrangler dev`, calling +`.jurisdiction(...)` throws in `workerd` before `CloudflareCluster.layer` receives +the binding, so pass the four unscoped bindings for local development; only +`AlchemyCloudflareCluster.make` falls back automatically to unrestricted bindings +for `workerd`'s unsupported-jurisdiction error (and rethrows other failures). +Internal peer lookups through `ctx.exports` automatically stay in the calling +object's `ctx.id.jurisdiction`. Opting into a jurisdiction does not migrate +existing objects or remove unrestricted twins with the same name. + ## Long waits and delivery - A long ask pins the caller. A delayed ask made directly by a Worker also diff --git a/.repos/effect/packages/platform/cloudflare/package.json b/.repos/effect/packages/platform/cloudflare/package.json index c2490a58c47f5..2fd414a2a7719 100644 --- a/.repos/effect/packages/platform/cloudflare/package.json +++ b/.repos/effect/packages/platform/cloudflare/package.json @@ -1,7 +1,7 @@ { "name": "@effect/platform-cloudflare", "type": "module", - "version": "4.1.5", + "version": "4.1.6", "license": "MIT", "description": "Platform specific implementations for Cloudflare Workers and Durable Objects", "homepage": "https://effect.website", @@ -72,7 +72,7 @@ } }, "dependencies": { - "@cloudflare/workers-types": "^5.20261114.1", + "@cloudflare/workers-types": "^5.20261121.1", "@effect/sql-sqlite-do": "workspace:^" }, "devDependencies": { diff --git a/.repos/effect/packages/platform/cloudflare/src/AlchemyCloudflareCluster.ts b/.repos/effect/packages/platform/cloudflare/src/AlchemyCloudflareCluster.ts index b0542e570e522..f8c7563fa7b20 100644 --- a/.repos/effect/packages/platform/cloudflare/src/AlchemyCloudflareCluster.ts +++ b/.repos/effect/packages/platform/cloudflare/src/AlchemyCloudflareCluster.ts @@ -120,6 +120,14 @@ export interface MakeOptions { * `CloudflareCluster.LayerOptions`. Defaults to 30 seconds. */ readonly keepAliveHeartbeat?: Duration.Input | undefined + /** + * Restricts all four cluster Durable Object bindings to a Cloudflare + * jurisdiction (for example `"eu"`). Opting in does not migrate existing + * objects or remove unrestricted twins with the same name. Falls back to + * unrestricted bindings under `alchemy dev` where local workerd does not + * implement jurisdictions. Defaults to no restriction. + */ + readonly jurisdiction?: DurableObjectJurisdiction | undefined } // One alchemy Durable Object class per cluster program. The outer effect @@ -163,7 +171,8 @@ const makeUnsafe = Effect.fnUntraced(function*(options: MakeOptions) => void } +interface ExportedNamespace { + readonly getByName: (name: string) => Stub + readonly jurisdiction: (jurisdiction: string) => ExportedNamespace +} + +// `ctx.exports` loopback bindings are unrestricted; keep peer lookups in the +// calling object's jurisdiction so the same name resolves the restricted peer. const exportedNamespace = ( state: DurableObjectProgramState, className: string -): { readonly getByName: (name: string) => Stub } | undefined => - (state.exports as Record)[className] as - | { readonly getByName: (name: string) => Stub } - | undefined +): ExportedNamespace | undefined => { + const namespace = (state.exports as Record | undefined>)[className] + const jurisdiction = state.id.jurisdiction + return jurisdiction === undefined ? namespace : namespace?.jurisdiction(jurisdiction) +} /** * Delivery options accepted by the cluster entity transport program. @@ -284,6 +292,7 @@ export const makeClusterWorkflowProgram = Effect.fnUntraced(function*(state: Dur const clock = yield* Clock.Clock const sql = state.storage.sql ensureWorkflowStorage(sql) + let stored: ReturnType let name: string | undefined if (state.id.name !== undefined) { if (decodeName(state.id.name) === undefined) { @@ -293,7 +302,7 @@ export const makeClusterWorkflowProgram = Effect.fnUntraced(function*(state: Dur } else { // An alarm wake carries no `id.name`; recover it from the stored // execution so due clocks still fire after eviction. - const stored = loadExecution(sql) + stored = loadExecution(sql) name = stored === undefined ? undefined : encodeName(stored.workflowName, stored.executionId) } let runtime: ReturnType | undefined @@ -319,7 +328,7 @@ export const makeClusterWorkflowProgram = Effect.fnUntraced(function*(state: Dur return runtime } const wakeUp = earliestClockWakeUp(sql) - if (wakeUp !== undefined) { + if (wakeUp !== undefined && !isComplete((stored ?? loadExecution(sql))?.result)) { yield* armAlarm(state.storage, wakeUp) } const program: ClusterWorkflowProgram = { diff --git a/.repos/effect/packages/platform/cloudflare/src/internal/alchemyCluster.ts b/.repos/effect/packages/platform/cloudflare/src/internal/alchemyCluster.ts index 13281e3a33d05..abcc50f617ca3 100644 --- a/.repos/effect/packages/platform/cloudflare/src/internal/alchemyCluster.ts +++ b/.repos/effect/packages/platform/cloudflare/src/internal/alchemyCluster.ts @@ -28,14 +28,28 @@ export interface ClusterHandleOptions { readonly layer: Layer.Layer readonly env: Record readonly keepAliveHeartbeat?: Duration.Input | undefined + readonly jurisdiction?: DurableObjectJurisdiction | undefined } /** @internal */ export const makeClusterHandle = Effect.fnUntraced(function*(options: ClusterHandleOptions) { - const entityNamespace = options.env.ClusterEntity as DurableObjectNamespace - const workflowNamespace = options.env.ClusterWorkflow as DurableObjectNamespace - const queueNamespace = options.env.ClusterDurableQueue as DurableObjectNamespace - const singletonNamespace = options.env.ClusterSingleton as DurableObjectNamespace + const binding = (name: string) => { + const namespace = options.env[name] as DurableObjectNamespace + if (options.jurisdiction === undefined) return namespace + try { + return namespace.jurisdiction(options.jurisdiction) + } catch (error) { + if (error instanceof Error && error.message === "Jurisdiction restrictions are not implemented in workerd.") { + return namespace + } + throw error + } + } + + const entityNamespace = binding("ClusterEntity") + const workflowNamespace = binding("ClusterWorkflow") + const queueNamespace = binding("ClusterDurableQueue") + const singletonNamespace = binding("ClusterSingleton") // The isolate-lifetime scope. workerd has no isolate-teardown hook, so it // is never closed; the built services live for the isolate, exactly like diff --git a/.repos/effect/packages/platform/cloudflare/src/internal/workflowRuntime.ts b/.repos/effect/packages/platform/cloudflare/src/internal/workflowRuntime.ts index c0c0a9cfdf5d9..c2577d8113bfc 100644 --- a/.repos/effect/packages/platform/cloudflare/src/internal/workflowRuntime.ts +++ b/.repos/effect/packages/platform/cloudflare/src/internal/workflowRuntime.ts @@ -8,7 +8,7 @@ * * @internal */ -import type { SqlStorage } from "@cloudflare/workers-types" +import type { DurableObjectStorage, SqlStorage } from "@cloudflare/workers-types" import * as Cause from "effect/Cause" import * as Context from "effect/Context" import * as Duration from "effect/Duration" @@ -21,7 +21,6 @@ import * as DurableClock from "effect/workflow/DurableClock" import * as Workflow from "effect/workflow/Workflow" import * as WorkflowEngine from "effect/workflow/WorkflowEngine" import { decodeName, encodeName } from "./clusterName.ts" -import { armAlarm, type EntityAlarm } from "./entityStorage.ts" import { CurrentExecutionHandle, deferredState, @@ -47,11 +46,16 @@ const mergeWake = ( mode: WorkflowStorage.WakeMode ): WorkflowStorage.WakeMode => current === "explicit" ? current : mode +const parseResult = (result: string) => JSON.parse(result) as { readonly _tag?: unknown; readonly failed?: unknown } + +/** @internal */ +export type WorkflowAlarm = Pick + /** @internal */ export interface WorkflowRuntimeOptions { readonly name: string readonly sql: SqlStorage - readonly alarm: EntityAlarm + readonly alarm: WorkflowAlarm readonly now: () => number readonly waitUntil: (promise: Promise) => void readonly getStub: (name: string) => WorkflowStub @@ -90,6 +94,7 @@ export const makeWorkflowRuntime = (options: WorkflowRuntimeOptions): WorkflowRu let inflight: Inflight | undefined let resumeRequested: WorkflowStorage.WakeMode | undefined + let guardAt: number | undefined // Parent of every attempt's scope. As in the memory engine, scopes of // attempts that suspended stay open under it, so their finalizers and // resources last until the execution completes or an attempt defects. @@ -110,11 +115,6 @@ export const makeWorkflowRuntime = (options: WorkflowRuntimeOptions): WorkflowRu options.waitUntil(promise.then(() => undefined, () => undefined)) } - const parseResult = (result: string) => JSON.parse(result) as { readonly _tag?: unknown; readonly failed?: unknown } - - const isComplete = (result: string | undefined): boolean => - result !== undefined && parseResult(result)._tag === "Complete" - // As in the memory engine, only an explicit wake replays a failure suspension. const isUnwakeable = (result: string | undefined, mode: WorkflowStorage.WakeMode): boolean => { if (result === undefined) return false @@ -129,7 +129,7 @@ export const makeWorkflowRuntime = (options: WorkflowRuntimeOptions): WorkflowRu */ const requestWake = (mode: WorkflowStorage.WakeMode): boolean => { const row = WorkflowStorage.loadExecution(sql) - if (row === undefined || isComplete(row.result)) return false + if (row === undefined || WorkflowStorage.isComplete(row.result)) return false if (inflight === undefined && isUnwakeable(row.result, mode)) return false const pending = mergeWake(row.resumePending, mode) if (pending !== row.resumePending) WorkflowStorage.setResumePending(sql, pending) @@ -137,9 +137,29 @@ export const makeWorkflowRuntime = (options: WorkflowRuntimeOptions): WorkflowRu return true } - const armResumeGuard = Effect.suspend(() => armAlarm(options.alarm, options.now() + resumeGuardMillis)) + // Only the owning attempt releases the handle; an earlier one may still be settling. + const releaseInflight = (owner: Inflight["instance"] | undefined): void => { + if (inflight?.instance !== owner) return + inflight = undefined + resumeRequested = undefined + } - const resumeParent = (parent: { readonly workflowName: string; readonly executionId: string }) => + // Derive the single alarm from current state so concurrent updates cannot + // write a stale target, and keep an armed guard deadline until it fires. + const syncAlarm = (): Promise => { + const row = WorkflowStorage.loadExecution(sql) + const complete = WorkflowStorage.isComplete(row?.result) + const earliest = complete ? undefined : WorkflowStorage.earliestClockWakeUp(sql) + // A complete execution keeps its guard until every parent is woken. + const needsGuard = inflight !== undefined || (complete + ? WorkflowStorage.hasParents(sql) + : row?.resumePending !== undefined && !isUnwakeable(row.result, row.resumePending)) + guardAt = needsGuard ? guardAt ?? options.now() + resumeGuardMillis : undefined + const target = Math.min(earliest ?? Infinity, guardAt ?? Infinity) + return Number.isFinite(target) ? options.alarm.setAlarm(target) : options.alarm.deleteAlarm() + } + + const resumeParent = (parent: WorkflowStorage.ParentRef) => Effect.promise(() => options.getStub(encodeName(parent.workflowName, parent.executionId)).resume("automatic")).pipe( Effect.sandbox, Effect.retry({ times: 5, schedule: Schedule.exponential(200) }) @@ -149,21 +169,38 @@ export const makeWorkflowRuntime = (options: WorkflowRuntimeOptions): WorkflowRu Effect.logError("Workflow parent resume failed", cause) const deliverParentWake = Effect.suspend(() => { - const row = WorkflowStorage.loadExecution(sql) - if (row === undefined || row.resumePending === undefined || !isComplete(row.result) || row.parent === undefined) { - return Effect.void - } + if (!WorkflowStorage.isComplete(WorkflowStorage.loadExecution(sql)?.result)) return Effect.void + const parents = WorkflowStorage.loadParents(sql) + if (parents.length === 0) return Effect.void // Re-arm before sending so a crash or exhausted retries leave another attempt. - return armResumeGuard.pipe( + return Effect.promise(syncAlarm).pipe( Effect.andThen( - resumeParent(row.parent).pipe( - Effect.tap(() => Effect.sync(() => WorkflowStorage.setResumePending(sql, undefined))), - Effect.catchCause(logResumeParentFailure) + Effect.forEach( + parents, + (parent) => + resumeParent(parent).pipe( + Effect.tap(() => Effect.sync(() => WorkflowStorage.deleteParent(sql, parent))), + Effect.catchCause(logResumeParentFailure) + ), + { concurrency: "unbounded", discard: true } ) - ) + ), + // Clears the guard once every parent is woken, or keeps it for the rest. + Effect.andThen(Effect.promise(syncAlarm)) ) }) + const completeAttempt = Effect.fnUntraced(function*(text: string, owner: Inflight["instance"] | undefined) { + const wakeParents = WorkflowStorage.hasParents(sql) + // Arm before saving so a persisted completion always has a delivery wake. + if (wakeParents) yield* Effect.promise(syncAlarm) + WorkflowStorage.saveCompletion(sql, text) + releaseInflight(owner) + if (wakeParents) options.waitUntil(Effect.runPromise(deliverParentWake)) + else yield* Effect.promise(syncAlarm) + return text + }) + // An attempt the machinery cannot finish (a defect with `CaptureDefects` // off, a payload that no longer decodes, a result that fails to encode, a // dying finalizer, a missing registration) completes the execution with the @@ -171,17 +208,11 @@ export const makeWorkflowRuntime = (options: WorkflowRuntimeOptions): WorkflowRu // object never rejects `run` for such a reason, so a caller can tell the // child's own defect from a transport failure, and a parent replaying a // discarded child finds the result instead of restarting it. - const failAttempt = (cause: Cause.Cause): Promise => + const failAttempt = (cause: Cause.Cause, owner?: Inflight["instance"]): Promise => Effect.runPromise(Effect.gen(function*() { yield* Effect.logError("Workflow execution failed", cause) const text = yield* encodeDefectResult(Cause.squash(cause)) - const parent = WorkflowStorage.loadExecution(sql)?.parent - if (parent !== undefined) yield* armResumeGuard - WorkflowStorage.saveCompletion(sql, text, parent !== undefined) - inflight = undefined - resumeRequested = undefined - if (parent !== undefined) options.waitUntil(Effect.runPromise(deliverParentWake)) - return text + return yield* completeAttempt(text, owner) })) const startAttempt = (row: WorkflowStorage.ExecutionRow): Promise => { @@ -221,34 +252,18 @@ export const makeWorkflowRuntime = (options: WorkflowRuntimeOptions): WorkflowRu }): Promise => Effect.runPromise( Effect.gen(function*() { - const parent = WorkflowStorage.loadExecution(sql)?.parent - if (result._tag === "Complete" && parent !== undefined) { - // Arm before the atomic result/pending save so a persisted - // completion always has a delivery wake. - yield* armResumeGuard - } // Stay in flight until the result is saved so a concurrent resume // queues behind this attempt instead of replaying alongside it. - if (result._tag === "Complete") { - WorkflowStorage.saveCompletion(sql, text, parent !== undefined) - inflight = undefined - resumeRequested = undefined - if (parent !== undefined) options.waitUntil(Effect.runPromise(deliverParentWake)) - return text - } + if (result._tag === "Complete") return yield* completeAttempt(text, instance) const replay = resumeRequested !== undefined && !isUnwakeable(text, resumeRequested) ? resumeRequested : undefined WorkflowStorage.saveSuspension(sql, text, replay) - inflight = undefined - resumeRequested = undefined + releaseInflight(instance) if (replay !== undefined) detach(startAttempt(row)) + else yield* Effect.promise(syncAlarm) return text - }).pipe(Effect.tapCause(() => - Effect.sync(() => { - inflight = undefined - }) - )) + }) ) const finish = (attempt: { readonly result: Workflow.Result @@ -258,11 +273,11 @@ export const makeWorkflowRuntime = (options: WorkflowRuntimeOptions): WorkflowRu // Close retained scopes before saving, so a durable completion never // has unrun finalizers. A dying finalizer fails the attempt instead. return Effect.runPromise(Effect.exit(closeExecutionScope)).then((closed) => - Exit.isSuccess(closed) ? persist(attempt) : failAttempt(closed.cause) + Exit.isSuccess(closed) ? persist(attempt) : failAttempt(closed.cause, instance) ) } const fiber = Effect.runFork(execute) - const promise = Effect.runPromise(Fiber.await(fiber)).then((exit) => { + const settled = Effect.runPromise(Fiber.await(fiber)).then((exit) => { if (Exit.isSuccess(exit)) return finish(exit.value) if (Cause.hasInterruptsOnly(exit.cause) && (instance.interrupted || instance.suspended)) { // A hard interrupt (or a completion preempting the fiber after it @@ -277,9 +292,11 @@ export const makeWorkflowRuntime = (options: WorkflowRuntimeOptions): WorkflowRu // A defect ends every retained attempt; a replay starts in fresh scopes. // Stay in flight while closing so cleanup precedes any replay. return Effect.runPromise(Effect.exit(closeExecutionScope)).then((closed) => - failAttempt(Exit.isSuccess(closed) ? exit.cause : Cause.combine(exit.cause, closed.cause)) + failAttempt(Exit.isSuccess(closed) ? exit.cause : Cause.combine(exit.cause, closed.cause), instance) ) }) + // A rejected save or alarm write must not leave this attempt in flight. + const promise = settled.finally(() => releaseInflight(instance)) inflight = { instance, fiber, promise } return promise } @@ -287,13 +304,11 @@ export const makeWorkflowRuntime = (options: WorkflowRuntimeOptions): WorkflowRu const run = (payload: string, opts: WorkflowRunOptions): Promise => { let row = WorkflowStorage.loadExecution(sql) if (row === undefined) { - WorkflowStorage.createExecution(sql, workflowName, executionId, payload, opts.parent) - row = { workflowName, executionId, payload, parent: opts.parent, result: undefined, resumePending: undefined } - } else if (opts.parent !== undefined && row.parent === undefined) { - // An execution started standalone can gain a parent later; keep the - // first parent so its completion still wakes that parent. - WorkflowStorage.setParent(sql, opts.parent) - row = { ...row, parent: opts.parent } + WorkflowStorage.createExecution(sql, workflowName, executionId, payload) + row = { workflowName, executionId, payload, result: undefined, resumePending: undefined } + } + if (opts.parent !== undefined && !WorkflowStorage.isComplete(row.result)) { + WorkflowStorage.addParent(sql, opts.parent) } if (inflight !== undefined) return opts.discard ? Promise.resolve("") : inflight.promise if (row.result !== undefined) return Promise.resolve(opts.discard ? "" : row.result) @@ -302,7 +317,7 @@ export const makeWorkflowRuntime = (options: WorkflowRuntimeOptions): WorkflowRu // caller awaits it. WorkflowStorage.setResumePending(sql, mergeWake(row.resumePending, "automatic")) const attempt = startAttempt(row) - const armed = Effect.runPromise(armResumeGuard) + const armed = syncAlarm() if (opts.discard) { detach(attempt) return armed.then(() => "") @@ -321,7 +336,7 @@ export const makeWorkflowRuntime = (options: WorkflowRuntimeOptions): WorkflowRu if (!requestWake(mode)) return Promise.resolve() // Persist and guard the resume before acknowledging it, so an abort after // the RPC returns is still recovered. - return Effect.runPromise(armResumeGuard).then(startPending) + return syncAlarm().then(startPending) } const completeDeferred = ( @@ -335,9 +350,9 @@ export const makeWorkflowRuntime = (options: WorkflowRuntimeOptions): WorkflowRu // the execution. The in-flight request is set synchronously so a settling // attempt cannot clear the pending resume without a restart. if (!requestWake(mode)) return Promise.resolve() - return Effect.runPromise( - armResumeGuard.pipe(Effect.andThen(deferredState.deferredDone(executionId, deferredName))) - ).then(() => resume(mode)) + return syncAlarm() + .then(() => Effect.runPromise(deferredState.deferredDone(executionId, deferredName))) + .then(() => resume(mode)) } const deferredDone = (deferredName: string, exitText: string): Promise => @@ -356,7 +371,7 @@ export const makeWorkflowRuntime = (options: WorkflowRuntimeOptions): WorkflowRu Effect.suspend(() => inflight === undefined ? Effect.promise(() => resume("automatic")) : Effect.void) ) ) - return armResumeGuard.pipe( + return Effect.promise(syncAlarm).pipe( Effect.andThen(Effect.forkDetach(wake)), Effect.flatMap((fiber) => Effect.sync(() => detach(Effect.runPromise(Fiber.await(fiber))))) ) @@ -364,7 +379,7 @@ export const makeWorkflowRuntime = (options: WorkflowRuntimeOptions): WorkflowRu const interrupt = (): Promise => { const row = WorkflowStorage.loadExecution(sql) - if (row === undefined || isComplete(row.result)) return Promise.resolve() + if (row === undefined || WorkflowStorage.isComplete(row.result)) return Promise.resolve() return voidExitText().then((exitText) => completeDeferred(InterruptSignalName, exitText, "explicit")) } @@ -378,14 +393,13 @@ export const makeWorkflowRuntime = (options: WorkflowRuntimeOptions): WorkflowRu .then(() => undefined) } - const scheduleClock = (clockName: string, deferredName: string, wakeUp: number): Promise => { - WorkflowStorage.saveClock(sql, clockName, deferredName, wakeUp) - const earliest = WorkflowStorage.earliestClockWakeUp(sql) - return earliest === undefined ? Promise.resolve() : Effect.runPromise(armAlarm(options.alarm, earliest)) - } + const scheduleClock = (clockName: string, deferredName: string, wakeUp: number): Promise => + WorkflowStorage.saveClock(sql, clockName, deferredName, wakeUp) ? syncAlarm() : Promise.resolve() const runAlarm = (): Promise => voidExitText().then((voidExit) => { + // A guard that fired is spent, so the next sync renews it if still needed. + if (guardAt !== undefined && guardAt <= options.now()) guardAt = undefined const completed = WorkflowStorage.dueClocks(sql, options.now()).filter((clock) => { WorkflowStorage.markClockFired(sql, clock.name) return WorkflowStorage.saveDeferred(sql, clock.deferredName, voidExit) @@ -401,18 +415,7 @@ export const makeWorkflowRuntime = (options: WorkflowRuntimeOptions): WorkflowRu const pending = mode !== undefined && !isUnwakeable(row?.result, mode) // A live attempt is not lost: only re-arm the guard. Requesting a wake // would replay the attempt once it suspends, for no reason. - return (pending && inflight === undefined ? resume(mode) : Promise.resolve()).then(() => { - // While a resume is pending a guard alarm stays armed, so a replay - // lost with this isolate is retried instead of sleeping forever. - const targets = [ - WorkflowStorage.earliestClockWakeUp(sql), - pending ? options.now() + resumeGuardMillis : undefined - ].filter((target) => target !== undefined) - if (targets.length === 0) return undefined - // The alarm that fired is spent, so set the next one outright: - // `armAlarm` only ever moves an alarm earlier. - return options.alarm.setAlarm(Math.min(...targets)) - }) + return (pending && inflight === undefined ? resume(mode) : Promise.resolve()).then(syncAlarm) }) }).then(() => Effect.runPromise(deliverParentWake)).then(() => undefined) diff --git a/.repos/effect/packages/platform/cloudflare/src/internal/workflowStorage.ts b/.repos/effect/packages/platform/cloudflare/src/internal/workflowStorage.ts index 2a8ed4bcb09cc..83435027fecd7 100644 --- a/.repos/effect/packages/platform/cloudflare/src/internal/workflowStorage.ts +++ b/.repos/effect/packages/platform/cloudflare/src/internal/workflowStorage.ts @@ -7,6 +7,8 @@ */ import type { SqlStorage } from "@cloudflare/workers-types" +// `parent_name` and `parent_execution_id` are legacy: nothing writes them, and +// `ensureWorkflowStorage` moves any stored value into `workflow_parents`. const ddl = [ `CREATE TABLE IF NOT EXISTS workflow_execution ( id INTEGER PRIMARY KEY CHECK (id = 0), @@ -31,14 +33,38 @@ const ddl = [ deferred_name TEXT NOT NULL, wake_up INTEGER NOT NULL, fired INTEGER NOT NULL DEFAULT 0 + )`, + `CREATE INDEX IF NOT EXISTS workflow_clocks_pending_idx + ON workflow_clocks (wake_up) WHERE fired = 0`, + `CREATE TABLE IF NOT EXISTS workflow_parents ( + workflow_name TEXT NOT NULL, + execution_id TEXT NOT NULL, + PRIMARY KEY (workflow_name, execution_id) )` ] +/** @internal */ +export const isComplete = (result: string | undefined): boolean => + result !== undefined && (JSON.parse(result) as { readonly _tag?: unknown })._tag === "Complete" + /** @internal */ export const ensureWorkflowStorage = (sql: SqlStorage): void => { for (const statement of ddl) { sql.exec(statement) } + const legacy = sql.exec( + `SELECT parent_name, parent_execution_id, result, resume_pending + FROM workflow_execution + WHERE id = 0 AND parent_name IS NOT NULL AND parent_execution_id IS NOT NULL` + ).toArray()[0] + if (legacy === undefined) return + // Once complete, `resume_pending` used to mean the parent wake was undelivered. + const complete = isComplete(legacy.result ?? undefined) + if (!complete || legacy.resume_pending !== 0) { + addParent(sql, { workflowName: legacy.parent_name, executionId: legacy.parent_execution_id }) + } + sql.exec("UPDATE workflow_execution SET parent_name = NULL, parent_execution_id = NULL WHERE id = 0") + if (complete) setResumePending(sql, undefined) } /** @@ -50,6 +76,12 @@ export const ensureWorkflowStorage = (sql: SqlStorage): void => { */ export type WakeMode = "explicit" | "automatic" +/** @internal */ +export interface ParentRef { + readonly workflowName: string + readonly executionId: string +} + /** * The stored `(workflowName, executionId)` also serve to recover the object * name on an alarm wake, where `ctx.id.name` is undefined. @@ -60,11 +92,9 @@ export interface ExecutionRow { readonly workflowName: string readonly executionId: string readonly payload: string - readonly parent: { readonly workflowName: string; readonly executionId: string } | undefined readonly result: string | undefined /** - * The pending replay of an incomplete execution. Once complete, any value - * means the parent completion wake is still undelivered. + * The pending replay of an incomplete execution. */ readonly resumePending: WakeMode | undefined } @@ -73,12 +103,22 @@ type StoredExecutionRow = { readonly workflow_name: string readonly execution_id: string readonly payload: string - readonly parent_name: string | null - readonly parent_execution_id: string | null readonly result: string | null readonly resume_pending: number } +type LegacyParentRow = { + readonly parent_name: string + readonly parent_execution_id: string + readonly result: string | null + readonly resume_pending: number +} + +type ParentRow = { + readonly workflow_name: string + readonly execution_id: string +} + type ExitRow = { readonly exit: string } @@ -101,7 +141,7 @@ const decodeWakeMode = (value: number): WakeMode | undefined => /** @internal */ export const loadExecution = (sql: SqlStorage): ExecutionRow | undefined => { const row = sql.exec( - `SELECT workflow_name, execution_id, payload, parent_name, parent_execution_id, result, resume_pending + `SELECT workflow_name, execution_id, payload, result, resume_pending FROM workflow_execution WHERE id = 0` ).toArray()[0] if (row === undefined) return undefined @@ -109,9 +149,6 @@ export const loadExecution = (sql: SqlStorage): ExecutionRow | undefined => { workflowName: row.workflow_name, executionId: row.execution_id, payload: row.payload, - parent: row.parent_name !== null && row.parent_execution_id !== null - ? { workflowName: row.parent_name, executionId: row.parent_execution_id } - : undefined, result: row.result ?? undefined, resumePending: decodeWakeMode(row.resume_pending) } @@ -122,28 +159,44 @@ export const createExecution = ( sql: SqlStorage, workflowName: string, executionId: string, - payload: string, - parent: { readonly workflowName: string; readonly executionId: string } | undefined + payload: string ): void => { sql.exec( `INSERT OR IGNORE INTO workflow_execution - (id, workflow_name, execution_id, payload, parent_name, parent_execution_id, result) - VALUES (0, ?, ?, ?, ?, ?, NULL)`, + (id, workflow_name, execution_id, payload, result) + VALUES (0, ?, ?, ?, NULL)`, workflowName, executionId, - payload, - parent?.workflowName ?? null, - parent?.executionId ?? null + payload ) } /** @internal */ -export const setParent = ( - sql: SqlStorage, - parent: { readonly workflowName: string; readonly executionId: string } -): void => { +export const addParent = (sql: SqlStorage, parent: ParentRef): void => { sql.exec( - "UPDATE workflow_execution SET parent_name = ?, parent_execution_id = ? WHERE id = 0 AND parent_name IS NULL", + "INSERT OR IGNORE INTO workflow_parents (workflow_name, execution_id) VALUES (?, ?)", + parent.workflowName, + parent.executionId + ) +} + +/** @internal */ +export const loadParents = (sql: SqlStorage): Array => + sql.exec( + "SELECT workflow_name, execution_id FROM workflow_parents" + ).toArray().map((row) => ({ + workflowName: row.workflow_name, + executionId: row.execution_id + })) + +/** @internal */ +export const hasParents = (sql: SqlStorage): boolean => + sql.exec("SELECT 1 FROM workflow_parents LIMIT 1").toArray().length > 0 + +/** @internal */ +export const deleteParent = (sql: SqlStorage, parent: ParentRef): void => { + sql.exec( + "DELETE FROM workflow_parents WHERE workflow_name = ? AND execution_id = ?", parent.workflowName, parent.executionId ) @@ -159,8 +212,8 @@ export const saveSuspension = (sql: SqlStorage, result: string, pending: WakeMod } /** @internal */ -export const saveCompletion = (sql: SqlStorage, result: string, wakeParent: boolean): void => { - sql.exec("UPDATE workflow_execution SET result = ?, resume_pending = ? WHERE id = 0", result, wakeParent ? 1 : 0) +export const saveCompletion = (sql: SqlStorage, result: string): void => { + sql.exec("UPDATE workflow_execution SET result = ?, resume_pending = 0 WHERE id = 0", result) } /** @internal */ @@ -197,15 +250,18 @@ export const saveDeferred = (sql: SqlStorage, name: string, exit: string): boole return true } -/** @internal */ -export const saveClock = (sql: SqlStorage, name: string, deferredName: string, wakeUp: number): void => { +/** + * Returns whether the clock was newly saved. + * + * @internal + */ +export const saveClock = (sql: SqlStorage, name: string, deferredName: string, wakeUp: number): boolean => sql.exec( - "INSERT OR IGNORE INTO workflow_clocks (name, deferred_name, wake_up, fired) VALUES (?, ?, ?, 0)", + "INSERT OR IGNORE INTO workflow_clocks (name, deferred_name, wake_up, fired) VALUES (?, ?, ?, 0) RETURNING 1", name, deferredName, wakeUp - ) -} + ).toArray().length > 0 /** @internal */ export const earliestClockWakeUp = (sql: SqlStorage): number | undefined => { diff --git a/.repos/effect/packages/platform/cloudflare/test/AlchemyCloudflareCluster.test.ts b/.repos/effect/packages/platform/cloudflare/test/AlchemyCloudflareCluster.test.ts index 6353ca3276e67..176bdea08181f 100644 --- a/.repos/effect/packages/platform/cloudflare/test/AlchemyCloudflareCluster.test.ts +++ b/.repos/effect/packages/platform/cloudflare/test/AlchemyCloudflareCluster.test.ts @@ -3,7 +3,7 @@ import type { DurableObjectProgramState } from "@effect/platform-cloudflare/Clou import { makeClusterSingletonProgram } from "@effect/platform-cloudflare/CloudflareDurableObjectPrograms" import { inertClusterHandle, makeClusterHandle } from "@effect/platform-cloudflare/internal/alchemyCluster" import { assert, describe, it } from "@effect/vitest" -import { Context, Cron, Effect, Exit, Fiber } from "effect" +import { Cause, Context, Cron, Effect, Exit, Fiber, Layer } from "effect" import { ClusterCron, Singleton } from "effect/cluster" import { Sharding } from "effect/cluster/Sharding" import { TestClock } from "effect/testing" @@ -215,6 +215,54 @@ describe("AlchemyCloudflareCluster", () => { }) } + const makeRestrictedHandle = (namespace: object) => + makeClusterHandle({ + entities: [], + layer: Layer.empty, + jurisdiction: "eu", + env: { + ClusterEntity: namespace, + ClusterWorkflow: namespace, + ClusterDurableQueue: namespace, + ClusterSingleton: namespace + } + }) + + it.effect("restricts the namespace bindings to the jurisdiction", () => + Effect.gen(function*() { + const jurisdictions: Array = [] + const cluster = yield* makeRestrictedHandle({ + getByName: () => undefined, + jurisdiction: (j: string) => { + jurisdictions.push(j) + return unusedNamespace + } + }) + assert.deepStrictEqual(jurisdictions, ["eu", "eu", "eu", "eu"]) + assert.deepStrictEqual( + [cluster.entityNamespace, cluster.workflowNamespace, cluster.queueNamespace, cluster.singletonNamespace], + [unusedNamespace, unusedNamespace, unusedNamespace, unusedNamespace] as any + ) + })) + + it.effect("falls back to unrestricted bindings only for workerd's unsupported-jurisdiction error", () => + Effect.gen(function*() { + const failingNamespace = (error: Error) => ({ + getByName: () => undefined, + jurisdiction: () => { + throw error + } + }) + const unsupported = failingNamespace(new Error("Jurisdiction restrictions are not implemented in workerd.")) + const cluster = yield* makeRestrictedHandle(unsupported) + assert.strictEqual(cluster.entityNamespace, unsupported as any) + + const unexpected = new Error("Wrapped error: Jurisdiction restrictions are not implemented in workerd.") + const exit = yield* Effect.exit(makeRestrictedHandle(failingNamespace(unexpected))) + assert.isTrue(Exit.isFailure(exit)) + if (Exit.isFailure(exit)) assert.strictEqual(Cause.squash(exit.cause), unexpected) + })) + it.effect("the plan-time handle is inert", () => Effect.gen(function*() { const cluster = inertClusterHandle() diff --git a/.repos/effect/packages/platform/cloudflare/test/CloudflareDurableObjectPrograms.test.ts b/.repos/effect/packages/platform/cloudflare/test/CloudflareDurableObjectPrograms.test.ts index 147918163d129..e081595ebde9f 100644 --- a/.repos/effect/packages/platform/cloudflare/test/CloudflareDurableObjectPrograms.test.ts +++ b/.repos/effect/packages/platform/cloudflare/test/CloudflareDurableObjectPrograms.test.ts @@ -1,3 +1,4 @@ +import type { DurableObjectStorage } from "@cloudflare/workers-types" import type { DurableObjectProgramState } from "@effect/platform-cloudflare/CloudflareDurableObjectPrograms" import { makeClusterDurableQueueProgram, @@ -6,9 +7,27 @@ import { makeClusterWorkflowProgram } from "@effect/platform-cloudflare/CloudflareDurableObjectPrograms" import { encodeName } from "@effect/platform-cloudflare/internal/clusterName" +import { registerEntity, unregisterEntity } from "@effect/platform-cloudflare/internal/entityRegistry" +import type { EntityRegistration } from "@effect/platform-cloudflare/internal/entityRegistry" +import { + ensureEntityStorage, + rememberEntityName, + saveKeepAlive +} from "@effect/platform-cloudflare/internal/entityStorage" import { registerSingleton } from "@effect/platform-cloudflare/internal/singletonRegistry" +import { + addParent, + createExecution, + ensureWorkflowStorage, + saveClock, + saveCompletion +} from "@effect/platform-cloudflare/internal/workflowStorage" import { assert, describe, it } from "@effect/vitest" -import { Cause, Context, Effect, Exit } from "effect" +import { Cause, Context, Deferred, Effect, Exit } from "effect" +import { ClusterSchema, Entity } from "effect/cluster" +import { Rpc } from "effect/rpc" +import { DatabaseSync, type SQLInputValue } from "node:sqlite" +import { SqliteStorage } from "./fixtures/sqliteStorage.ts" class FakeSql { earliestDeliverAt: number | null = null @@ -68,6 +87,57 @@ class FakeState { } } +interface LoopbackCall { + readonly scope: string + readonly name: string + readonly method: string +} + +const makeExportedState = Effect.fnUntraced(function*(name: string, jurisdiction?: string) { + const database = yield* Effect.acquireRelease( + Effect.sync(() => new DatabaseSync(":memory:")), + (database) => Effect.sync(() => database.close()) + ) + const storage = new SqliteStorage(database) + const called = yield* Deferred.make() + const scoped = (scope: string) => ({ + getByName: (target: string) => { + const record = (method: string, result: Promise) => () => { + Deferred.doneUnsafe(called, Exit.succeed({ scope, name: target, method })) + return result + } + return { + hold: record("hold", new Promise(() => {})), + resume: record("resume", Promise.resolve()), + deliverReply: record("deliverReply", Promise.resolve(true)) + } + } + }) + const namespace = { ...scoped("unrestricted"), jurisdiction: scoped } + const state: DurableObjectProgramState = { + id: { name, jurisdiction }, + storage: storage as unknown as DurableObjectStorage, + exports: { ClusterEntity: namespace, ClusterWorkflow: namespace }, + waitUntil: () => {} + } + return { state, storage, called: Deferred.await(called) } +}) + +const registerProbe = Effect.fnUntraced(function*(type: string) { + const entity = Entity.make(type, [Rpc.make("Ping").annotate(ClusterSchema.Persisted, true)]) + const registration: EntityRegistration = { + entity, + keepAliveHeartbeat: 30_000, + build: Effect.succeed(entity.of({ Ping: () => Effect.void })), + options: undefined, + context: Context.empty() + } + yield* Effect.acquireRelease( + Effect.sync(() => registerEntity(type, registration)), + () => Effect.sync(() => unregisterEntity(type, registration)) + ) +}) + describe("CloudflareDurableObjectPrograms", () => { const constructors = [ ["entity", makeClusterEntityProgram], @@ -123,4 +193,141 @@ describe("CloudflareDurableObjectPrograms", () => { assert.strictEqual(fake.deletedAlarms, 1) })) }) + + describe("makeClusterWorkflowProgram", () => { + it.effect("skips leftover clock restoration after completion without clearing a pending parent guard", () => + Effect.gen(function*() { + const { called, state, storage } = yield* makeExportedState(encodeName("Child", "c1")) + ensureWorkflowStorage(storage.sql) + createExecution(storage.sql, "Child", "c1", "{}") + addParent(storage.sql, { workflowName: "Parent", executionId: "p1" }) + saveClock(storage.sql, "long", "long/deferred", 180_000) + saveCompletion(storage.sql, JSON.stringify({ _tag: "Complete" })) + storage.alarm = 60_000 + + const program = yield* makeClusterWorkflowProgram(state) + assert.strictEqual(storage.alarm, 60_000) + + yield* program.alarm() + yield* called + assert.strictEqual(storage.alarm, null) + + const cold = yield* makeClusterWorkflowProgram(state) + assert.strictEqual(yield* cold.poll(), JSON.stringify({ _tag: "Complete" })) + assert.strictEqual(storage.alarm, null) + })) + + it.effect("re-arms a pending clock on construction and indexes clock lookups over fired rows", () => + Effect.gen(function*() { + const { state, storage } = yield* makeExportedState(encodeName("ClockScan", "c1")) + const database = storage.database + // Pre-existing storage without the pending-clock index. + database.exec(`CREATE TABLE workflow_clocks ( + name TEXT PRIMARY KEY, + deferred_name TEXT NOT NULL, + wake_up INTEGER NOT NULL, + fired INTEGER NOT NULL DEFAULT 0 + )`) + database.exec(`INSERT INTO workflow_clocks (name, deferred_name, wake_up, fired) VALUES + ('fired', 'DurableClock/fired', 1000, 1), + ('pending', 'DurableClock/pending', 100000, 0)`) + + const queries: Array<{ readonly query: string; readonly bindings: Array }> = [] + const exec = storage.sql.exec + storage.sql.exec = ((query: string, ...bindings: Array) => { + if (/^\s*SELECT\b/i.test(query) && query.includes("workflow_clocks")) { + queries.push({ query, bindings }) + } + return exec.call(storage.sql, query, ...bindings) + }) as typeof storage.sql.exec + + const program = yield* makeClusterWorkflowProgram(state) + assert.strictEqual(storage.alarm, 100_000) + const onConstruct = queries.length + assert.isAbove(onConstruct, 0) + + yield* program.alarm() + assert.strictEqual(storage.alarm, 100_000) + assert.isAbove(queries.length, onConstruct) + + const partialIndexes = new Set( + (database.prepare( + "SELECT name, sql FROM sqlite_master WHERE type = 'index' AND tbl_name = 'workflow_clocks' AND sql IS NOT NULL" + ).all() as Array<{ readonly name: string; readonly sql: string }>) + .filter((index) => /\bWHERE\b[\s\S]*\bfired\s*=\s*0\b/i.test(index.sql)) + .map((index) => index.name) + ) + assert.isAbove(partialIndexes.size, 0, "expected a partial index on pending workflow_clocks rows") + + for (const { bindings, query } of queries) { + const plan = (database.prepare(`EXPLAIN QUERY PLAN ${query}`).all( + ...bindings as Array + ) as Array<{ readonly detail: string }>).map((row) => row.detail) + assert.isTrue( + plan.some((detail) => { + const match = /USING (?:COVERING )?INDEX (\S+)/.exec(detail) + return match !== null && partialIndexes.has(match[1]) + }), + `expected clock lookup to use a partial pending index, got: ${plan.join("; ")}` + ) + } + })) + }) + + describe("jurisdiction-scoped exports", () => { + for (const jurisdiction of ["eu", undefined] as const) { + it.effect(`child workflow wakes its parent (${jurisdiction ?? "unrestricted"})`, () => + Effect.gen(function*() { + const { called, state, storage } = yield* makeExportedState(encodeName("Child", "c1"), jurisdiction) + ensureWorkflowStorage(storage.sql) + createExecution(storage.sql, "Child", "c1", "{}") + addParent(storage.sql, { workflowName: "Parent", executionId: "p1" }) + saveCompletion(storage.sql, JSON.stringify({ _tag: "Complete" })) + + const program = yield* makeClusterWorkflowProgram(state) + yield* program.alarm() + + assert.deepStrictEqual(yield* called, { + scope: jurisdiction ?? "unrestricted", + name: encodeName("Parent", "p1"), + method: "resume" + }) + })) + } + + it.effect("kept-alive entity holds itself in the same jurisdiction", () => + Effect.gen(function*() { + yield* registerProbe("JurisdictionHold") + const name = encodeName("JurisdictionHold", "k1") + const { called, state, storage } = yield* makeExportedState(name, "eu") + ensureEntityStorage(storage.sql) + rememberEntityName(storage.sql, name) + yield* saveKeepAlive(storage.sql, true) + + const program = yield* makeClusterEntityProgram(state) + yield* program.alarm() + + assert.deepStrictEqual(yield* called, { scope: "eu", name, method: "hold" }) + })) + + it.effect("scheduled ask pushes its reply to the caller in the same jurisdiction", () => + Effect.gen(function*() { + yield* registerProbe("JurisdictionReply") + const caller = encodeName("JurisdictionReply", "caller") + const { called, state } = yield* makeExportedState(encodeName("JurisdictionReply", "r1"), "eu") + const program = yield* makeClusterEntityProgram(state) + const envelope = JSON.stringify({ + _tag: "Request", + requestId: "0198bd72-6a80-72f1-8d87-000000000001", + address: { shardId: { group: "default", id: 1 }, entityType: "JurisdictionReply", entityId: "r1" }, + tag: "Ping", + payload: null, + headers: {} + }) + yield* program.invoke(envelope, false, { deliverAt: 1, replyTo: caller }) + yield* program.alarm() + + assert.deepStrictEqual(yield* called, { scope: "eu", name: caller, method: "deliverReply" }) + })) + }) }) diff --git a/.repos/effect/packages/platform/cloudflare/test/CloudflareWorkflowEngine.test.ts b/.repos/effect/packages/platform/cloudflare/test/CloudflareWorkflowEngine.test.ts index 60a8652fe33ef..304e1fe1ebecc 100644 --- a/.repos/effect/packages/platform/cloudflare/test/CloudflareWorkflowEngine.test.ts +++ b/.repos/effect/packages/platform/cloudflare/test/CloudflareWorkflowEngine.test.ts @@ -1,8 +1,11 @@ import type { SqlStorage } from "@cloudflare/workers-types" import * as CloudflareWorkflowEngine from "@effect/platform-cloudflare/CloudflareWorkflowEngine" import { encodeName } from "@effect/platform-cloudflare/internal/clusterName" -import type { EntityAlarm } from "@effect/platform-cloudflare/internal/entityStorage" -import { makeWorkflowRuntime, type WorkflowRuntime } from "@effect/platform-cloudflare/internal/workflowRuntime" +import { + makeWorkflowRuntime, + type WorkflowAlarm, + type WorkflowRuntime +} from "@effect/platform-cloudflare/internal/workflowRuntime" import { assert, describe, it } from "@effect/vitest" import { Cause, Deferred, Effect, Exit, Fiber, Latch, Layer, Option, Schema } from "effect" import { RpcTest } from "effect/rpc" @@ -19,9 +22,11 @@ import { class FakeSql { execution: Record | undefined + readonly parents = new Map() readonly activities = new Map() readonly deferreds = new Map() readonly clocks = new Map() + clockLookups = 0 exec(query: string, ...bindings: Array) { const rows = this.run(query, bindings) @@ -29,23 +34,23 @@ class FakeSql { } private run(query: string, bindings: Array): Array> { - if (query.startsWith("CREATE TABLE")) return [] + if (query.startsWith("CREATE TABLE") || query.startsWith("CREATE INDEX")) return [] if (query.includes("INSERT OR IGNORE INTO workflow_execution")) { this.execution ??= { workflow_name: bindings[0], execution_id: bindings[1], payload: bindings[2], - parent_name: bindings[3], - parent_execution_id: bindings[4], + parent_name: null, + parent_execution_id: null, result: null, resume_pending: 0 } return [] } - if (query.includes("SET parent_name")) { - if (this.execution !== undefined && this.execution.parent_name === null) { - this.execution.parent_name = bindings[0] - this.execution.parent_execution_id = bindings[1] + if (query.includes("SET parent_name = NULL")) { + if (this.execution !== undefined) { + this.execution.parent_name = null + this.execution.parent_execution_id = null } return [] } @@ -56,13 +61,40 @@ class FakeSql { if (query.includes("UPDATE workflow_execution")) { if (this.execution !== undefined) { this.execution.result = bindings[0] - if (query.includes("resume_pending")) this.execution.resume_pending = bindings[1] + if (query.includes("resume_pending = 0")) this.execution.resume_pending = 0 + else if (query.includes("resume_pending = ?")) this.execution.resume_pending = bindings[1] } return [] } if (query.includes("FROM workflow_execution")) { + if (query.includes("parent_name IS NOT NULL")) { + return this.execution !== undefined && + this.execution.parent_name !== null && + this.execution.parent_execution_id !== null + ? [this.execution] + : [] + } return this.execution === undefined ? [] : [this.execution] } + if (query.includes("INSERT OR IGNORE INTO workflow_parents")) { + const workflowName = String(bindings[0]) + const executionId = String(bindings[1]) + const key = `${workflowName.length}:${workflowName}:${executionId}` + if (!this.parents.has(key)) this.parents.set(key, { workflowName, executionId }) + return [] + } + if (query.includes("DELETE FROM workflow_parents")) { + const workflowName = String(bindings[0]) + const executionId = String(bindings[1]) + this.parents.delete(`${workflowName.length}:${workflowName}:${executionId}`) + return [] + } + if (query.includes("FROM workflow_parents")) { + return Array.from(this.parents.values()).map((parent) => ({ + workflow_name: parent.workflowName, + execution_id: parent.executionId + })) + } if (query.includes("INSERT OR IGNORE INTO workflow_activities")) { if (!this.activities.has(String(bindings[0]))) { this.activities.set(String(bindings[0]), String(bindings[1])) @@ -90,14 +122,17 @@ class FakeSql { wakeUp: Number(bindings[2]), fired: false }) + return [{}] } return [] } if (query.includes("min(wake_up)")) { + this.clockLookups++ const pending = Array.from(this.clocks.values()).filter((clock) => !clock.fired).map((clock) => clock.wakeUp) return [{ wake_up: pending.length === 0 ? null : Math.min(...pending) }] } if (query.includes("wake_up <= ?")) { + this.clockLookups++ return Array.from(this.clocks) .filter(([, clock]) => !clock.fired && clock.wakeUp <= Number(bindings[0])) .map(([name, clock]) => ({ name, deferred_name: clock.deferredName })) @@ -117,17 +152,21 @@ class FakeSql { class FakeAlarm { current: number | null = null + writes = 0 - getAlarm() { - return Promise.resolve(this.current) - } setAlarm(scheduledTime: number) { + this.writes++ this.current = scheduledTime return Promise.resolve() } + deleteAlarm() { + this.writes++ + this.current = null + return Promise.resolve() + } - get alarm(): EntityAlarm { - return this as unknown as EntityAlarm + get alarm(): WorkflowAlarm { + return this as unknown as WorkflowAlarm } } @@ -241,7 +280,7 @@ describe("CloudflareWorkflowEngine", () => { value: undefined }) yield* pollUntil(Child, childId, "Complete") - assert.strictEqual(namespace.store(childName).sql.execution?.resume_pending, 1) + assert.strictEqual(namespace.store(childName).sql.parents.size, 1) assert.strictEqual(namespace.store(childName).alarm.current, 60_000) namespace.hungResumes.clear() @@ -251,7 +290,7 @@ describe("CloudflareWorkflowEngine", () => { yield* Effect.promise(() => namespace.getByName(childName).runAlarm()) const result = yield* pollUntil(Parent, parentId, "Complete") assert(result._tag === "Complete" && Exit.isSuccess(result.exit)) - assert.strictEqual(namespace.store(childName).sql.execution?.resume_pending, 0) + assert.strictEqual(namespace.store(childName).sql.parents.size, 0) }).pipe(Effect.provide(layer)) }) @@ -401,8 +440,8 @@ describe("CloudflareWorkflowEngine", () => { let runs = 0 const Long = Workflow.make("LongAttempt", { payload: {}, idempotencyKey: () => "long" }) const layer = Long.toLayer(Effect.fnUntraced(function*() { - runs++ - yield* Activity.make({ name: "slow", execute: started.open.pipe(Effect.andThen(release.await)) }) + const run = ++runs + yield* Activity.make({ name: `slow-${run}`, execute: started.open.pipe(Effect.andThen(release.await)) }) yield* DurableDeferred.await(Gate) })).pipe(Layer.provideMerge(namespace.layer)) @@ -411,6 +450,10 @@ describe("CloudflareWorkflowEngine", () => { const name = encodeName(Long._tag, executionId) yield* started.await + namespace.now = 50_000 + yield* Effect.promise(() => namespace.getByName(name).runAlarm()) + assert.strictEqual(namespace.store(name).alarm.current, 60_000) + namespace.now = 60_000 yield* Effect.promise(() => namespace.getByName(name).runAlarm()) assert.strictEqual(namespace.store(name).alarm.current, 120_000) @@ -419,9 +462,178 @@ describe("CloudflareWorkflowEngine", () => { yield* pollUntil(Long, executionId, "Suspended") yield* namespace.settle() assert.strictEqual(runs, 1, "a guard alarm during a live attempt must not replay it") + assert.strictEqual(namespace.store(name).alarm.current, null) + + yield* started.close + yield* release.close + namespace.now = 0 + yield* Long.resume(executionId) + yield* started.await + assert.strictEqual(namespace.store(name).alarm.current, 60_000) + + namespace.now = 50_000 + yield* Long.resume(executionId) + assert.strictEqual(namespace.store(name).alarm.current, 60_000) + + namespace.now = 60_000 + yield* Effect.promise(() => namespace.getByName(name).runAlarm()) + assert.strictEqual(namespace.store(name).alarm.current, 120_000) + + yield* release.open + yield* namespace.settle() + assert.strictEqual(namespace.store(name).alarm.current, null) + }).pipe(Effect.ensuring(release.open), Effect.provide(layer)) + })) + + it.effect("targets the durable sleep deadline after suspension instead of the earlier resume guard", () => + Effect.gen(function*() { + const namespace = new FakeWorkflowNamespace() + const release = yield* Latch.make() + const Sleeping = Workflow.make("SleepAfterWork", { payload: {}, idempotencyKey: () => "sleep" }) + const layer = Sleeping.toLayer(Effect.fnUntraced(function*() { + yield* Activity.make({ name: "work", execute: release.await }) + yield* DurableClock.sleep({ name: "nap", duration: "60 seconds" }) + })).pipe(Layer.provideMerge(namespace.layer)) + + yield* Effect.gen(function*() { + const executionId = yield* Sleeping.execute({}, { discard: true }) + const name = encodeName(Sleeping._tag, executionId) + assert.strictEqual(namespace.store(name).alarm.current, 60_000) + + yield* TestClock.adjust("2 seconds") + namespace.now = 2_000 + yield* release.open + yield* pollUntil(Sleeping, executionId, "Suspended") + yield* namespace.settle() + assert.strictEqual(namespace.store(name).alarm.current, 62_000) + }).pipe(Effect.ensuring(release.open), Effect.provide(layer)) + })) + + it.effect("does not let a concurrent resume guard postpone an earlier clock", () => + Effect.gen(function*() { + const namespace = new FakeWorkflowNamespace() + const started = yield* Latch.make() + const release = yield* Latch.make() + let runs = 0 + const Racing = Workflow.make("ClockBeforeGuard", { payload: {}, idempotencyKey: () => "race" }) + const layer = Racing.toLayer(Effect.fnUntraced(function*() { + if (++runs === 2) { + yield* started.open + yield* release.await + } + yield* DurableClock.sleep({ name: "long", duration: "180 seconds" }) + })).pipe(Layer.provideMerge(namespace.layer)) + + yield* Effect.gen(function*() { + const executionId = yield* Racing.execute({}, { discard: true }) + const name = encodeName(Racing._tag, executionId) + yield* pollUntil(Racing, executionId, "Suspended") + yield* namespace.settle() + assert.strictEqual(namespace.store(name).alarm.current, 180_000) + + const stub = namespace.getByName(name) + yield* Effect.promise(() => + Promise.all([ + stub.scheduleClock("short", "short/deferred", 5_000), + stub.resume() + ]) + ) + yield* started.await + assert.strictEqual(namespace.store(name).alarm.current, 5_000) + yield* release.open + yield* namespace.settle() + }).pipe(Effect.ensuring(release.open), Effect.provide(layer)) + })) + + it.effect("does not re-scan clocks or rewrite the alarm when replaying existing sleeps", () => + Effect.gen(function*() { + const namespace = new FakeWorkflowNamespace() + const Looping = Workflow.make("ReplaySleeps", { + payload: {}, + success: Schema.String, + idempotencyKey: () => "loop" + }) + const layer = Looping.toLayer(Effect.fnUntraced(function*() { + for (let step = 0; step < 3; step++) { + yield* DurableClock.sleep({ name: `step-${step}`, duration: "60 seconds" }) + } + return "done" + })).pipe(Layer.provideMerge(namespace.layer)) + + yield* Effect.gen(function*() { + const executionId = yield* Looping.execute({}, { discard: true }) + const name = encodeName(Looping._tag, executionId) + yield* pollUntil(Looping, executionId, "Suspended") + yield* namespace.settle() + const store = namespace.store(name) + + const wake = Effect.fnUntraced(function*() { + const clockLookups = store.sql.clockLookups + const alarmWrites = store.alarm.writes + yield* TestClock.adjust("60 seconds") + namespace.now += 60_000 + yield* Effect.promise(() => namespace.getByName(name).runAlarm()) + yield* namespace.settle() + return { + clockLookups: store.sql.clockLookups - clockLookups, + alarmWrites: store.alarm.writes - alarmWrites + } + }) + + const first = yield* wake() + const second = yield* wake() + assert.deepStrictEqual(second, first) + + yield* wake() + const result = yield* pollUntil(Looping, executionId, "Complete") + assert.deepStrictEqual(result, new Workflow.Complete({ exit: Exit.succeed("done") })) }).pipe(Effect.provide(layer)) })) + it.effect("does not let a rejected alarm write from a settled attempt release its successor", () => + Effect.gen(function*() { + const namespace = new FakeWorkflowNamespace() + const replayed = yield* Latch.make() + const release = yield* Latch.make() + const Gate = DurableDeferred.make("RejectedAlarmWrite/Gate") + let runs = 0 + const Replacing = Workflow.make("RejectedAlarmWrite", { payload: {}, idempotencyKey: () => "replace" }) + const layer = Replacing.toLayer(Effect.fnUntraced(function*() { + if (++runs === 1) return yield* DurableDeferred.await(Gate) + yield* replayed.open + yield* release.await + })).pipe(Layer.provideMerge(namespace.layer)) + + yield* Effect.gen(function*() { + const executionId = yield* Replacing.executionId({}) + const name = encodeName(Replacing._tag, executionId) + const alarm = namespace.store(name).alarm + const deleteAlarm = alarm.deleteAlarm.bind(alarm) + let rejectFirst!: (error: Error) => void + alarm.deleteAlarm = () => { + alarm.deleteAlarm = deleteAlarm + return new Promise((_, reject) => { + rejectFirst = reject + }) + } + + yield* Replacing.execute({}, { discard: true }) + yield* pollUntil(Replacing, executionId, "Suspended") + + yield* Replacing.resume(executionId) + yield* replayed.await + + rejectFirst(new Error("alarm write failed")) + yield* Effect.promise(() => new Promise((resolve) => setTimeout(resolve, 0))) + yield* Replacing.resume(executionId) + + yield* release.open + yield* pollUntil(Replacing, executionId, "Complete") + yield* namespace.settle() + assert.strictEqual(runs, 2) + }).pipe(Effect.ensuring(release.open), Effect.provide(layer)) + })) + it.effect("stores a discarded child's defect and wakes its parent once", () => { const namespace = new FakeWorkflowNamespace() let parentRuns = 0 @@ -516,6 +728,57 @@ describe("CloudflareWorkflowEngine", () => { }).pipe(Effect.provide(layer)) }) + it.effect("wakes every parent awaiting a shared child workflow", () => { + const namespace = new FakeWorkflowNamespace() + const Gate = DurableDeferred.make("SharedChild/Gate", { success: Schema.String }) + const Child = Workflow.make("SharedChild", { + payload: { key: Schema.String }, + success: Schema.String, + idempotencyKey: ({ key }) => key + }) + const Parent = Workflow.make("SharedChildParent", { + payload: { name: Schema.String }, + success: Schema.String, + idempotencyKey: ({ name }) => name + }) + const layer = Layer.merge( + Child.toLayer(() => DurableDeferred.await(Gate)), + Parent.toLayer(Effect.fnUntraced(function*({ name }) { + const value = yield* Child.execute({ key: "shared" }) + return `${name}:${value}` + })) + ).pipe(Layer.provideMerge(namespace.layer)) + + return Effect.gen(function*() { + const childId = yield* Child.execute({ key: "shared" }, { discard: true }) + yield* pollUntil(Child, childId, "Suspended") + + const parentA = yield* Parent.execute({ name: "A" }, { discard: true }) + yield* pollUntil(Parent, parentA, "Suspended") + + const parentB = yield* Parent.execute({ name: "B" }, { discard: true }) + yield* pollUntil(Parent, parentB, "Suspended") + + yield* DurableDeferred.succeed(Gate, { + token: DurableDeferred.tokenFromExecutionId(Gate, { workflow: Child, executionId: childId }), + value: "done" + }) + + assert.deepStrictEqual( + yield* pollUntil(Child, childId, "Complete"), + new Workflow.Complete({ exit: Exit.succeed("done") }) + ) + assert.deepStrictEqual( + yield* pollUntil(Parent, parentA, "Complete"), + new Workflow.Complete({ exit: Exit.succeed("A:done") }) + ) + assert.deepStrictEqual( + yield* pollUntil(Parent, parentB, "Complete"), + new Workflow.Complete({ exit: Exit.succeed("B:done") }) + ) + }).pipe(Effect.provide(layer)) + }) + it.effect("closes finalizers registered before suspension on completion", () => { const namespace = new FakeWorkflowNamespace() const Gate = DurableDeferred.make("SuspendedScope/Gate") @@ -964,10 +1227,8 @@ describe("deferred self-completion", () => { const result = yield* Fiber.join(execution) if (failure) { assert.ok(Exit.isFailure(result)) - assert.strictEqual(result.cause.reasons.length, 1) - const reason = result.cause.reasons[0] - assert.ok(Cause.isFailReason(reason)) - assert.strictEqual(reason.error, "boom") + assert.ok(result.cause.reasons.length > 0) + assert.ok(result.cause.reasons.every((reason) => Cause.isFailReason(reason) && reason.error === "boom")) } else { assert.deepStrictEqual(result, Exit.succeed("ok")) assert.deepStrictEqual(events, ["start-1", "cleanup-start", "cleanup-end", "end-1", "start-2", "end-2"]) @@ -975,4 +1236,74 @@ describe("deferred self-completion", () => { }).pipe(Effect.provide(layer)) }), 5_000) } + + it.effect("retries a failing activity under SuspendOnFailure", () => { + class Failed extends Schema.TaggedError()("Failed", {}) {} + const namespace = new FakeWorkflowNamespace() + const attempts: Array = [] + const workflow = Workflow.make("SuspendOnFailureRetry", { + payload: { id: Schema.String }, + error: Failed, + idempotencyKey: ({ id }) => id + }).annotate(Workflow.SuspendOnFailure, true) + const layer = workflow.toLayer(() => + Activity.make({ + name: "step", + error: Failed, + execute: Effect.gen(function*() { + const attempt = yield* Activity.CurrentAttempt + attempts.push(attempt) + if (attempts.length <= 2) { + return yield* new Failed() + } + }) + }).pipe(Activity.retry({ times: 3 })) + ).pipe(Layer.provideMerge(namespace.layer)) + + return Effect.gen(function*() { + const executionId = yield* workflow.execute({ id: "a" }, { discard: true }) + const result = yield* pollUntil(workflow, executionId, "Complete") + assert.deepStrictEqual(result, new Workflow.Complete({ exit: Exit.void })) + assert.deepStrictEqual(attempts, [1, 2, 3]) + }).pipe(Effect.provide(layer)) + }) + + it.effect("parks an exhausted Activity.retry under SuspendOnFailure and replays stored failures on resume", () => { + class Failed extends Schema.TaggedError()("Failed", {}) {} + const namespace = new FakeWorkflowNamespace() + let runs = 0 + const attempts: Array = [] + const workflow = Workflow.make("SuspendOnFailureRetryExhausted", { + payload: { id: Schema.String }, + error: Failed, + idempotencyKey: ({ id }) => id + }).annotate(Workflow.SuspendOnFailure, true) + const layer = workflow.toLayer(() => { + runs++ + return Activity.make({ + name: "step", + error: Failed, + execute: Effect.gen(function*() { + const attempt = yield* Activity.CurrentAttempt + attempts.push(attempt) + return yield* new Failed() + }) + }).pipe(Activity.retry({ times: 2 })) + }).pipe(Layer.provideMerge(namespace.layer)) + + return Effect.gen(function*() { + const executionId = yield* workflow.execute({ id: "a" }, { discard: true }) + const suspended = yield* pollUntil(workflow, executionId, "Suspended") + assert.isTrue(suspended._tag === "Suspended" && suspended.failed) + assert.strictEqual(runs, 1) + assert.deepStrictEqual(attempts, [1, 2, 3]) + + yield* workflow.resume(executionId) + yield* namespace.settle() + const replayed = yield* pollUntil(workflow, executionId, "Suspended") + assert.isTrue(replayed._tag === "Suspended" && replayed.failed) + assert.strictEqual(runs, 2) + assert.deepStrictEqual(attempts, [1, 2, 3]) + }).pipe(Effect.provide(layer)) + }) }) diff --git a/.repos/effect/packages/platform/deno/CHANGELOG.md b/.repos/effect/packages/platform/deno/CHANGELOG.md index 1ab142d600ab0..f311da2e62b0d 100644 --- a/.repos/effect/packages/platform/deno/CHANGELOG.md +++ b/.repos/effect/packages/platform/deno/CHANGELOG.md @@ -1,5 +1,13 @@ # @effect/platform-deno +## 4.1.6 + +### Patch Changes + +- Updated dependencies [[`dd5f2f3`](https://github.com/Effect-TS/effect/commit/dd5f2f322fbad042a3a186cef593bf42affe5ce9), [`1d65846`](https://github.com/Effect-TS/effect/commit/1d65846308a6a18c4a95af543988ad30b72ff2b3), [`694c28f`](https://github.com/Effect-TS/effect/commit/694c28f0cfc3eac33f71160d18dda95cb670f506), [`5aaa2cd`](https://github.com/Effect-TS/effect/commit/5aaa2cd216e5e55f92d06db98d4b54946a396eed), [`55814bf`](https://github.com/Effect-TS/effect/commit/55814bf0a780f05ed0a51c82c8affda5d539bb0e), [`92c40a1`](https://github.com/Effect-TS/effect/commit/92c40a1f96a59f9edcacee6c0d6f6fb80397ee17), [`9f415a7`](https://github.com/Effect-TS/effect/commit/9f415a7733cdf8aed7efadbed3b5db22890e164a), [`e367afd`](https://github.com/Effect-TS/effect/commit/e367afdacfa3041a694a67e4670e98a20e41d45c), [`d5d2112`](https://github.com/Effect-TS/effect/commit/d5d21120ff591fcf8da006ce340010812cc91f16), [`fa2e5af`](https://github.com/Effect-TS/effect/commit/fa2e5af4ccc8f3650d97049707be82eab098c168), [`6bf6427`](https://github.com/Effect-TS/effect/commit/6bf6427d195539c387c13156aff79db077929c8f), [`10bc4a4`](https://github.com/Effect-TS/effect/commit/10bc4a47c0ce5bc50ba1998d63a803e3887d1d2b), [`a9540d3`](https://github.com/Effect-TS/effect/commit/a9540d3d50fbe65ade7f9b2f478cdd34a888161e), [`3a250d7`](https://github.com/Effect-TS/effect/commit/3a250d7eb8c310bf4751b3eca0038cf50e1629d8), [`ce44141`](https://github.com/Effect-TS/effect/commit/ce44141ad1bc8d05f3f7399bfa1e87772573205d), [`9318e5b`](https://github.com/Effect-TS/effect/commit/9318e5bafb144ddff65a0bff0148ec4f7ba77b5c), [`24ff77b`](https://github.com/Effect-TS/effect/commit/24ff77bbec6ebfe991fda20393c895734ef166ba), [`c9ecebf`](https://github.com/Effect-TS/effect/commit/c9ecebf7ede8a98895552fd20223d6573bd846fe), [`32f8fbe`](https://github.com/Effect-TS/effect/commit/32f8fbe1a5985aea41754e87531e9a1d0fbf78ec), [`41d6af1`](https://github.com/Effect-TS/effect/commit/41d6af14b7f36e06ade3bf7333b710e73de1e1c2), [`c33fd59`](https://github.com/Effect-TS/effect/commit/c33fd599cb7d49117f77f7bd8f05cb4209112a34), [`1f9e9d3`](https://github.com/Effect-TS/effect/commit/1f9e9d3de552435de6b8f4e1166515d0964c3999), [`594fa71`](https://github.com/Effect-TS/effect/commit/594fa71da417bf94fa6c9be2d3d36c808197e9fe), [`b378c38`](https://github.com/Effect-TS/effect/commit/b378c383cdb29e819e24da5dc725479a2ba4fdf1), [`a9ec9a6`](https://github.com/Effect-TS/effect/commit/a9ec9a60bbe1309960e00527ab62342dce1a86fc), [`310a81b`](https://github.com/Effect-TS/effect/commit/310a81b391e24d42b6608b5e3d641eca63e0d4c0), [`2576bbc`](https://github.com/Effect-TS/effect/commit/2576bbcbe89fec2362240280e4db2bc371f978e3), [`f409e90`](https://github.com/Effect-TS/effect/commit/f409e9068a4ce2991d0a724187b11b98ae4dd222), [`3498c76`](https://github.com/Effect-TS/effect/commit/3498c76f0968bb32167d0d8a0d6c3888fa733f83), [`aab2135`](https://github.com/Effect-TS/effect/commit/aab2135d3fe43d4d86c4e486ed378797314fb212), [`6744a72`](https://github.com/Effect-TS/effect/commit/6744a724869539fc2d733929df871ef523bf82e8), [`13659f7`](https://github.com/Effect-TS/effect/commit/13659f7245ca526e474403e8066941198c49773d), [`848d042`](https://github.com/Effect-TS/effect/commit/848d0426f287b3e7ff970219d980a4c66fa441ad), [`077a93e`](https://github.com/Effect-TS/effect/commit/077a93e5db3adbc42e531539cb12b8bdbdfe5328), [`aef50fb`](https://github.com/Effect-TS/effect/commit/aef50fb8b56ec9ff8116f157635579fefd995f26), [`2e4de86`](https://github.com/Effect-TS/effect/commit/2e4de8634431f3da08ca2a90ab1024ee08e216f3), [`482b104`](https://github.com/Effect-TS/effect/commit/482b104caf712a8d5f99aafc64e55b6ea38eb809), [`753e1ed`](https://github.com/Effect-TS/effect/commit/753e1ed88069f73103d136dcdc58188fd10efdf1), [`0d2bb4a`](https://github.com/Effect-TS/effect/commit/0d2bb4a4b6526e1767b81101ee6e8da88ba1de55), [`8161e03`](https://github.com/Effect-TS/effect/commit/8161e03c26d691502afeddcf7e2ee75e6931637f), [`9b7b7c2`](https://github.com/Effect-TS/effect/commit/9b7b7c2d1afe85b6f4e61b9af19d9a0e9c9cec82), [`49f5391`](https://github.com/Effect-TS/effect/commit/49f53918a150aa2ea0ce2d444400cec1d6097400), [`3d59bdf`](https://github.com/Effect-TS/effect/commit/3d59bdf6f8f95ceea2091e5b8f375b834a14b3b1), [`8866608`](https://github.com/Effect-TS/effect/commit/88666082f2b6296bb7115bd4a2546151039f64db), [`69fd4b1`](https://github.com/Effect-TS/effect/commit/69fd4b1fba9e2ec5e7c16058ff8d9a1f9a38d90e), [`7d97626`](https://github.com/Effect-TS/effect/commit/7d9762658e515807c2b98678e7abd3ebe94e41ec), [`0e79436`](https://github.com/Effect-TS/effect/commit/0e794366658bd067a2212ea2ac7ed0223904ed31), [`2f8a4e9`](https://github.com/Effect-TS/effect/commit/2f8a4e9b90822d9facfef59027b35819c42d7b48), [`800b753`](https://github.com/Effect-TS/effect/commit/800b7535b4e37a24ac458cae78231054dae0b0f5)]: + - effect@4.1.6 + - @effect/platform-node-shared@4.1.6 + ## 4.1.5 ### Patch Changes diff --git a/.repos/effect/packages/platform/deno/package.json b/.repos/effect/packages/platform/deno/package.json index bc3bc923ed905..df3c4dceddc7e 100644 --- a/.repos/effect/packages/platform/deno/package.json +++ b/.repos/effect/packages/platform/deno/package.json @@ -1,7 +1,7 @@ { "name": "@effect/platform-deno", "type": "module", - "version": "4.1.5", + "version": "4.1.6", "license": "MIT", "description": "Platform specific implementations for the Deno runtime", "homepage": "https://effect.website", @@ -77,9 +77,9 @@ }, "devDependencies": { "@std/assert": "jsr:^1.0.19", - "@testcontainers/redis": "^12.2.1", + "@testcontainers/redis": "^12.2.2", "@types/deno": "^2.7.0", "effect": "workspace:^", - "tinybench": "^6.2.3" + "tinybench": "^6.2.4" } } diff --git a/.repos/effect/packages/platform/node-shared/CHANGELOG.md b/.repos/effect/packages/platform/node-shared/CHANGELOG.md index 79f26b9fe647f..ecf59f3d43c59 100644 --- a/.repos/effect/packages/platform/node-shared/CHANGELOG.md +++ b/.repos/effect/packages/platform/node-shared/CHANGELOG.md @@ -1,5 +1,23 @@ # @effect/platform-node-shared +## 4.1.6 + +### Patch Changes + +- [#10846](https://github.com/Effect-TS/effect/pull/10846) [`24ff77b`](https://github.com/Effect-TS/effect/commit/24ff77bbec6ebfe991fda20393c895734ef166ba) Thanks @effect-bot! - Fix `NodeChildProcessSpawner` sending process-group signals when terminating non-detached child processes. + +- [#10886](https://github.com/Effect-TS/effect/pull/10886) [`2576bbc`](https://github.com/Effect-TS/effect/commit/2576bbcbe89fec2362240280e4db2bc371f978e3) Thanks @effect-bot! - Add `NodeChildProcessSpawner.layerProxyProcess`, which launches commands from a small proxy process, for Node.js builds where spawning from a process holding a lot of memory stalls the event loop. The layer also provides `NodeChildProcessSpawner.ProxyProcess`, which reports the proxy process ID, and packaged applications can run the proxy process from their own entry point with `NodeChildProcessProxy.run`. + +- [#10930](https://github.com/Effect-TS/effect/pull/10930) [`f409e90`](https://github.com/Effect-TS/effect/commit/f409e9068a4ce2991d0a724187b11b98ae4dd222) Thanks @effect-bot! - Fix `FileSystem.File` reads and writes, and `FileSystem.stream`, failing with `ESPIPE` on pipes, FIFOs, sockets and terminals. + +- [#10816](https://github.com/Effect-TS/effect/pull/10816) [`3498c76`](https://github.com/Effect-TS/effect/commit/3498c76f0968bb32167d0d8a0d6c3888fa733f83) Thanks @effect-bot! - Fix Node processes using `NodeStdio.layer` staying alive after their `Stdio.stdin` consumers finish or are interrupted while stdin is still open. + +- [#10919](https://github.com/Effect-TS/effect/pull/10919) [`13659f7`](https://github.com/Effect-TS/effect/commit/13659f7245ca526e474403e8066941198c49773d) Thanks @effect-bot! - Fix `NodeChildProcessSpawner.layerProxyProcess` leaving additional file descriptors (fd 3 and above) in non-blocking mode. + +- [#10931](https://github.com/Effect-TS/effect/pull/10931) [`9b7b7c2`](https://github.com/Effect-TS/effect/commit/9b7b7c2d1afe85b6f4e61b9af19d9a0e9c9cec82) Thanks @effect-bot! - Fix `NodeChildProcessSpawner` signaling an unref'ed child's process group when the child exits non-zero or its scope closes. This reverses the cleanup added with `unref` in [#1960](https://github.com/Effect-TS/effect/issues/1960); run the returned `Reref` to restore it. +- Updated dependencies [[`dd5f2f3`](https://github.com/Effect-TS/effect/commit/dd5f2f322fbad042a3a186cef593bf42affe5ce9), [`1d65846`](https://github.com/Effect-TS/effect/commit/1d65846308a6a18c4a95af543988ad30b72ff2b3), [`694c28f`](https://github.com/Effect-TS/effect/commit/694c28f0cfc3eac33f71160d18dda95cb670f506), [`5aaa2cd`](https://github.com/Effect-TS/effect/commit/5aaa2cd216e5e55f92d06db98d4b54946a396eed), [`55814bf`](https://github.com/Effect-TS/effect/commit/55814bf0a780f05ed0a51c82c8affda5d539bb0e), [`92c40a1`](https://github.com/Effect-TS/effect/commit/92c40a1f96a59f9edcacee6c0d6f6fb80397ee17), [`9f415a7`](https://github.com/Effect-TS/effect/commit/9f415a7733cdf8aed7efadbed3b5db22890e164a), [`e367afd`](https://github.com/Effect-TS/effect/commit/e367afdacfa3041a694a67e4670e98a20e41d45c), [`d5d2112`](https://github.com/Effect-TS/effect/commit/d5d21120ff591fcf8da006ce340010812cc91f16), [`fa2e5af`](https://github.com/Effect-TS/effect/commit/fa2e5af4ccc8f3650d97049707be82eab098c168), [`6bf6427`](https://github.com/Effect-TS/effect/commit/6bf6427d195539c387c13156aff79db077929c8f), [`10bc4a4`](https://github.com/Effect-TS/effect/commit/10bc4a47c0ce5bc50ba1998d63a803e3887d1d2b), [`a9540d3`](https://github.com/Effect-TS/effect/commit/a9540d3d50fbe65ade7f9b2f478cdd34a888161e), [`3a250d7`](https://github.com/Effect-TS/effect/commit/3a250d7eb8c310bf4751b3eca0038cf50e1629d8), [`ce44141`](https://github.com/Effect-TS/effect/commit/ce44141ad1bc8d05f3f7399bfa1e87772573205d), [`9318e5b`](https://github.com/Effect-TS/effect/commit/9318e5bafb144ddff65a0bff0148ec4f7ba77b5c), [`c9ecebf`](https://github.com/Effect-TS/effect/commit/c9ecebf7ede8a98895552fd20223d6573bd846fe), [`32f8fbe`](https://github.com/Effect-TS/effect/commit/32f8fbe1a5985aea41754e87531e9a1d0fbf78ec), [`41d6af1`](https://github.com/Effect-TS/effect/commit/41d6af14b7f36e06ade3bf7333b710e73de1e1c2), [`c33fd59`](https://github.com/Effect-TS/effect/commit/c33fd599cb7d49117f77f7bd8f05cb4209112a34), [`1f9e9d3`](https://github.com/Effect-TS/effect/commit/1f9e9d3de552435de6b8f4e1166515d0964c3999), [`594fa71`](https://github.com/Effect-TS/effect/commit/594fa71da417bf94fa6c9be2d3d36c808197e9fe), [`b378c38`](https://github.com/Effect-TS/effect/commit/b378c383cdb29e819e24da5dc725479a2ba4fdf1), [`a9ec9a6`](https://github.com/Effect-TS/effect/commit/a9ec9a60bbe1309960e00527ab62342dce1a86fc), [`310a81b`](https://github.com/Effect-TS/effect/commit/310a81b391e24d42b6608b5e3d641eca63e0d4c0), [`aab2135`](https://github.com/Effect-TS/effect/commit/aab2135d3fe43d4d86c4e486ed378797314fb212), [`6744a72`](https://github.com/Effect-TS/effect/commit/6744a724869539fc2d733929df871ef523bf82e8), [`848d042`](https://github.com/Effect-TS/effect/commit/848d0426f287b3e7ff970219d980a4c66fa441ad), [`077a93e`](https://github.com/Effect-TS/effect/commit/077a93e5db3adbc42e531539cb12b8bdbdfe5328), [`aef50fb`](https://github.com/Effect-TS/effect/commit/aef50fb8b56ec9ff8116f157635579fefd995f26), [`2e4de86`](https://github.com/Effect-TS/effect/commit/2e4de8634431f3da08ca2a90ab1024ee08e216f3), [`482b104`](https://github.com/Effect-TS/effect/commit/482b104caf712a8d5f99aafc64e55b6ea38eb809), [`753e1ed`](https://github.com/Effect-TS/effect/commit/753e1ed88069f73103d136dcdc58188fd10efdf1), [`0d2bb4a`](https://github.com/Effect-TS/effect/commit/0d2bb4a4b6526e1767b81101ee6e8da88ba1de55), [`8161e03`](https://github.com/Effect-TS/effect/commit/8161e03c26d691502afeddcf7e2ee75e6931637f), [`49f5391`](https://github.com/Effect-TS/effect/commit/49f53918a150aa2ea0ce2d444400cec1d6097400), [`3d59bdf`](https://github.com/Effect-TS/effect/commit/3d59bdf6f8f95ceea2091e5b8f375b834a14b3b1), [`8866608`](https://github.com/Effect-TS/effect/commit/88666082f2b6296bb7115bd4a2546151039f64db), [`69fd4b1`](https://github.com/Effect-TS/effect/commit/69fd4b1fba9e2ec5e7c16058ff8d9a1f9a38d90e), [`7d97626`](https://github.com/Effect-TS/effect/commit/7d9762658e515807c2b98678e7abd3ebe94e41ec), [`0e79436`](https://github.com/Effect-TS/effect/commit/0e794366658bd067a2212ea2ac7ed0223904ed31), [`2f8a4e9`](https://github.com/Effect-TS/effect/commit/2f8a4e9b90822d9facfef59027b35819c42d7b48), [`800b753`](https://github.com/Effect-TS/effect/commit/800b7535b4e37a24ac458cae78231054dae0b0f5)]: + - effect@4.1.6 + ## 4.1.5 ### Patch Changes diff --git a/.repos/effect/packages/platform/node-shared/package.json b/.repos/effect/packages/platform/node-shared/package.json index 8a5bc31b4a9ba..925377440874c 100644 --- a/.repos/effect/packages/platform/node-shared/package.json +++ b/.repos/effect/packages/platform/node-shared/package.json @@ -1,7 +1,7 @@ { "name": "@effect/platform-node-shared", "type": "module", - "version": "4.1.5", + "version": "4.1.6", "license": "MIT", "description": "Unified interfaces for common platform-specific services", "homepage": "https://effect.website", @@ -60,7 +60,7 @@ "scripts": { "benchmark:datagram": "node benchmark/DatagramSocket.ts", "benchmark:socket": "node benchmark/Socket.ts", - "codegen": "effect-utils codegen", + "codegen": "effect-utils codegen && node scripts/generateProxyProcessSource.ts", "build": "tsc -b tsconfig.json && pnpm babel", "babel": "babel dist --plugins annotate-pure-calls --out-dir dist --source-maps", "check": "tsc -b tsconfig.json" @@ -72,8 +72,8 @@ "@types/node": "^26.6.6", "effect": "workspace:^", "tar": "^7.5.23", - "testcontainers": "^12.2.1", - "tinybench": "^6.2.3" + "testcontainers": "^12.2.2", + "tinybench": "^6.2.4" }, "dependencies": { "@types/ws": "^8.18.2", diff --git a/.repos/effect/packages/platform/node-shared/scripts/generateProxyProcessSource.ts b/.repos/effect/packages/platform/node-shared/scripts/generateProxyProcessSource.ts new file mode 100644 index 0000000000000..0380828079aca --- /dev/null +++ b/.repos/effect/packages/platform/node-shared/scripts/generateProxyProcessSource.ts @@ -0,0 +1,43 @@ +/** + * Generates `src/internal/proxyProcessSource.ts`, the source text of the + * proxy process program that the default launcher runs with `node -e`, from + * `src/internal/proxyProcessWorker.ts`. Run by `pnpm codegen`. With + * `--check`, exits with code 1 if the generated file is out of date. + */ +import * as Fs from "node:fs" +import * as Module from "node:module" + +const worker = new URL("../src/internal/proxyProcessWorker.ts", import.meta.url) +const output = new URL("../src/internal/proxyProcessSource.ts", import.meta.url) + +// Node's type stripper blanks types with spaces at the same offsets. Drop the +// lines that only held types, and the blank line after them, leaving inline +// separators, comments, and string literals untouched. +const stripTypes = (source: string): string => { + const original = source.split("\n") + const stripped = Module.stripTypeScriptTypes(source).split("\n") + const erased = (i: number) => stripped[i].trim() === "" && original[i].trim() !== "" + return stripped.filter((line, i) => !erased(i) && !(line === "" && i > 0 && erased(i - 1))).join("\n") +} + +// The source text of the program, as an ES module that calls `run`. +const program = stripTypes(Fs.readFileSync(worker, "utf8")) + "\nrun()\n" + +const escape = (text: string) => text.replace(/[\\`]|\$\{/g, (match) => "\\" + match) + +if (process.argv.includes("--check")) { + const { source } = await import(output.href) + if (source !== program) { + process.stderr.write("src/internal/proxyProcessSource.ts is out of date; run pnpm codegen\n") + process.exitCode = 1 + } +} else { + Fs.writeFileSync( + output, + `// Generated by scripts/generateProxyProcessSource.ts from proxyProcessWorker.ts. Do not edit. + +/** @internal */ +export const source = \`${escape(program)}\` +` + ) +} diff --git a/.repos/effect/packages/platform/node-shared/src/NodeChildProcessProxy.ts b/.repos/effect/packages/platform/node-shared/src/NodeChildProcessProxy.ts new file mode 100644 index 0000000000000..a48913cf8b425 --- /dev/null +++ b/.repos/effect/packages/platform/node-shared/src/NodeChildProcessProxy.ts @@ -0,0 +1,62 @@ +/** + * The program of the proxy process started by + * `NodeChildProcessSpawner.layerProxyProcess`, for applications that start it + * themselves. + * + * By default the proxy process runs `process.execPath -e `, which + * needs `process.execPath` to be a Node.js binary. A single executable + * application, or any other entry point that cannot run `-e`, dispatches a + * private subcommand to {@link run} instead and passes that subcommand in the + * layer's `args` option. + * + * This module imports only Node.js builtins, so the subcommand can dispatch + * before the application is loaded. + * + * @stability unstable + * @since 4.1.6 + */ +import * as Worker from "./internal/proxyProcessWorker.ts" + +/** + * Runs the proxy process program in the current process. + * + * **When to use** + * + * Use when a packaged or single executable application starts the proxy + * process from its own entry point, to handle the private subcommand passed in + * the `args` option of `NodeChildProcessSpawner.layerProxyProcess`. + * + * **Details** + * + * The program receives its socket and token over the IPC channel, answers that + * it is ready, and then launches commands until the application disconnects. + * It ignores `SIGINT` and `SIGTERM`, and exits once the application has + * disconnected and its commands have exited. + * + * **Gotchas** + * + * - Run without an IPC channel, such as from a terminal, it writes one line to + * stderr and sets `process.exitCode` to 1. + * - It is an ordinary function that compiles no code at runtime, so it runs + * under `--disallow-code-generation-from-strings`. + * - The proxy process holds whatever the entry point loaded before calling + * `run`. Dispatch the subcommand before importing the application, so the + * proxy process stays small. + * + * **Example** (Dispatching a private subcommand) + * + * ```ts + * // bin.ts, the entry point of the packaged application + * if (process.argv[2] === "__proxy-process") { + * const { run } = await import("@effect/platform-node/NodeChildProcessProxy") + * run() + * } else { + * await import("./main.ts") + * } + * ``` + * + * @stability unstable + * @category running + * @since 4.1.6 + */ +export const run: () => void = Worker.run diff --git a/.repos/effect/packages/platform/node-shared/src/NodeChildProcessSpawner.ts b/.repos/effect/packages/platform/node-shared/src/NodeChildProcessSpawner.ts index 12b2f8146785f..d3614e09cebb3 100644 --- a/.repos/effect/packages/platform/node-shared/src/NodeChildProcessSpawner.ts +++ b/.repos/effect/packages/platform/node-shared/src/NodeChildProcessSpawner.ts @@ -6,6 +6,10 @@ * commands in Node-compatible runtimes: commands get scoped process handles * with stdin sinks, stdout and stderr streams, exit-code waiting, * interruption-time cleanup, process killing, and custom file-descriptor pipes. + * Provide {@link layerProxyProcess} instead to launch commands from a separate + * proxy process, for Node.js builds where spawning from a process that holds a + * lot of memory stalls the event loop. Packaged applications that start the + * proxy process themselves run it with `NodeChildProcessProxy.run`. * * The implementation sits below the command-building API. It validates and * resolves `cwd` through the Effect `FileSystem` and `Path` services, @@ -32,12 +36,14 @@ * @since 4.0.0 */ import type * as Arr from "effect/Array" +import * as Context from "effect/Context" import * as Deferred from "effect/Deferred" import * as Duration from "effect/Duration" import * as Effect from "effect/Effect" import * as Exit from "effect/Exit" import * as FileSystem from "effect/FileSystem" import * as Layer from "effect/Layer" +import type * as Option from "effect/Option" import * as Path from "effect/Path" import * as PlatformError from "effect/PlatformError" import * as Predicate from "effect/Predicate" @@ -57,7 +63,8 @@ import * as Sink from "effect/Sink" import * as Stream from "effect/Stream" import * as NodeChildProcess from "node:child_process" import { PassThrough, type Writable } from "node:stream" -import { buildSpawnOptions } from "./internal/nodeChildProcessSpawner.ts" +import { buildSpawnOptions, type SpawnedProcess, type SpawnProcess } from "./internal/nodeChildProcessSpawner.ts" +import * as ProxyProcesses from "./internal/proxyProcess.ts" import { handleErrnoException } from "./internal/utils.ts" import * as NodeSink from "./NodeSink.ts" import * as NodeStream from "./NodeStream.ts" @@ -96,7 +103,9 @@ const findNulCharacter = (command: ChildProcess.StandardCommand): string | undef } type ExitCodeWithSignal = readonly [code: number | null, signal: NodeJS.Signals | null] -type ExitSignal = Deferred.Deferred +// Fails when the exit status can no longer be observed, such as when the proxy +// process that launched the child exits first +type ExitSignal = Deferred.Deferred const processGroupGraceMillis = 1_000 const processGroupPollIntervalMillis = 10 @@ -111,17 +120,12 @@ const handleInputErrors = (writable: Writable): void => { } /** Node has recorded the leader's exit, after which its PID may be reused by an unrelated process. */ -const hasExited = (childProcess: NodeChildProcess.ChildProcess): boolean => +const hasExited = (childProcess: SpawnedProcess): boolean => childProcess.exitCode !== null || childProcess.signalCode !== null -/** - * A non-detached leader shares its parent's process group, so once it has - * exited there is no group of its own left to signal or poll. - */ -const ownsProcessGroup = ( - command: ChildProcess.StandardCommand, - childProcess: NodeChildProcess.ChildProcess -): boolean => command.options.detached !== false || !hasExited(childProcess) +/** Only a detached POSIX child leads its own process group. */ +const ownsProcessGroup = (command: ChildProcess.StandardCommand): boolean => + globalThis.process.platform !== "win32" && command.options.detached !== false /** * The process group exists but has no member that can be signalled, such as @@ -130,15 +134,22 @@ const ownsProcessGroup = ( const isUnsignallableProcessGroup = (error: unknown): boolean => (error as NodeJS.ErrnoException | undefined)?.code === "EPERM" -/** The leader has not exited, or a member of its process group still exists. */ +/** + * The leader has not exited, or a member of its process group still exists. A + * process whose exit status can no longer be observed is not reported alive, + * since it may have exited and its ID been reused. + */ const isProcessAlive = ( command: ChildProcess.StandardCommand, - childProcess: NodeChildProcess.ChildProcess + childProcess: SpawnedProcess ): boolean => { + if (childProcess.lost === true) { + return false + } if (!hasExited(childProcess)) { return true } - if (globalThis.process.platform === "win32" || !ownsProcessGroup(command, childProcess)) { + if (!ownsProcessGroup(command)) { return false } try { @@ -150,7 +161,7 @@ const isProcessAlive = ( } const taskkill = ( - childProcess: NodeChildProcess.ChildProcess, + childProcess: SpawnedProcess, onExit: (error: NodeChildProcess.ExecException | null) => void = () => {} ) => { if (hasExited(childProcess)) { @@ -165,7 +176,12 @@ const taskkill = ( ) } -const make = Effect.gen(function*() { +const spawnDirect: SpawnProcess = (command, args, options) => NodeChildProcess.spawn(command, args, options) + +// Returns the function that launches a command. The proxy process layer waits +// here, interruptibly, for a proxy process that is ready, since the launch +// itself cannot be interrupted. +const makeWith = Effect.fnUntraced(function*(prepareSpawn: Effect.Effect) { const fs = yield* FileSystem.FileSystem const path = yield* Path.Path @@ -293,7 +309,7 @@ const make = Effect.gen(function*() { const setupAdditionalFds = Effect.fnUntraced(function*( command: ChildProcess.StandardCommand, - childProcess: NodeChildProcess.ChildProcess, + childProcess: SpawnedProcess, additionalFds: ReadonlyArray, inputFailure: Deferred.Deferred ) { @@ -309,7 +325,7 @@ const make = Effect.gen(function*() { const setupInput = ( fd: number, - nodeStream: NodeChildProcess.ChildProcess["stdio"][number], + nodeStream: SpawnedProcess["stdio"][number], stream: Stream.Stream | undefined ) => Effect.suspend(() => { @@ -334,7 +350,7 @@ const make = Effect.gen(function*() { const setupOutput = ( fd: number, - nodeStream: NodeChildProcess.ChildProcess["stdio"][number], + nodeStream: SpawnedProcess["stdio"][number], sink: Sink.Sink | undefined ) => { let stream: Stream.Stream = Stream.empty @@ -395,7 +411,7 @@ const make = Effect.gen(function*() { const setupChildStdin = ( command: ChildProcess.StandardCommand, - childProcess: NodeChildProcess.ChildProcess, + childProcess: SpawnedProcess, config: ChildProcess.StdinConfig, inputFailure: Deferred.Deferred ) => @@ -423,7 +439,7 @@ const make = Effect.gen(function*() { const setupChildOutputStreams = ( command: ChildProcess.StandardCommand, - childProcess: NodeChildProcess.ChildProcess, + childProcess: SpawnedProcess, stdoutConfig: ChildProcess.StdoutConfig, stderrConfig: ChildProcess.StderrConfig ): { @@ -467,15 +483,16 @@ const make = Effect.gen(function*() { } const spawn = ( + spawnProcess: SpawnProcess, command: ChildProcess.StandardCommand, spawnOptions: NodeChildProcess.SpawnOptions ) => Effect.callback< - readonly [NodeChildProcess.ChildProcess, ExitSignal], + readonly [SpawnedProcess, ExitSignal], PlatformError.PlatformError >((resume) => { - const deferred = Deferred.makeUnsafe() - const handle = NodeChildProcess.spawn( + const deferred = Deferred.makeUnsafe() + const handle = spawnProcess( command.command, command.args.map(unwrap), spawnOptions @@ -489,9 +506,12 @@ const make = Effect.gen(function*() { } resume(Effect.fail(toPlatformError("spawn", error, command))) }) - handle.on("exit", (...args) => { + handle.on("exit", (...args: ExitCodeWithSignal) => { Deferred.doneUnsafe(deferred, Exit.succeed(args)) }) + handle.on("lost", (error: Error) => { + Deferred.doneUnsafe(deferred, Exit.fail(toPlatformError("exitCode", error, command))) + }) handle.on("spawn", () => { resume(Effect.succeed([handle, deferred])) }) @@ -502,7 +522,7 @@ const make = Effect.gen(function*() { const killProcessGroup = ( command: ChildProcess.StandardCommand, - childProcess: NodeChildProcess.ChildProcess, + childProcess: SpawnedProcess, signal: NodeJS.Signals ) => { if (globalThis.process.platform === "win32") { @@ -525,14 +545,9 @@ const make = Effect.gen(function*() { } const killProcessGroupOnExit = ( - childProcess: NodeChildProcess.ChildProcess, + childProcess: SpawnedProcess, signal: NodeJS.Signals ): void => { - if (globalThis.process.platform === "win32") { - // ignore errors during best-effort cleanup - taskkill(childProcess) - return - } try { globalThis.process.kill(-childProcess.pid!, signal) } catch { @@ -542,7 +557,7 @@ const make = Effect.gen(function*() { const killProcess = ( command: ChildProcess.StandardCommand, - childProcess: NodeChildProcess.ChildProcess, + childProcess: SpawnedProcess, signal: NodeJS.Signals ) => Effect.suspend(() => { @@ -554,10 +569,13 @@ const make = Effect.gen(function*() { return Effect.void }) - /** Waits for the leader and its process group, bounded by native time. */ + /** + * Waits for the leader and its process group, bounded by native time. Stops + * waiting when the exit status can no longer be observed. + */ const awaitProcessExit = ( command: ChildProcess.StandardCommand, - childProcess: NodeChildProcess.ChildProcess, + childProcess: SpawnedProcess, timeoutMillis: number ): Effect.Effect => Effect.callback((resume) => { @@ -566,6 +584,7 @@ const make = Effect.gen(function*() { const stop = () => { clearTimeout(timer) childProcess.removeListener("exit", poll) + childProcess.removeListener("lost", poll) } const poll = () => { clearTimeout(timer) @@ -577,18 +596,20 @@ const make = Effect.gen(function*() { timer = setTimeout(poll, processGroupPollIntervalMillis) } childProcess.on("exit", poll) + childProcess.on("lost", poll) poll() return Effect.sync(stop) }) const terminateProcessGroup = Effect.fnUntraced(function*( command: ChildProcess.StandardCommand, - childProcess: NodeChildProcess.ChildProcess, + childProcess: SpawnedProcess, exitSignal: ExitSignal, options: ChildProcess.KillOptions | undefined ) { + // `taskkill /T` stops the whole process tree on Windows, detached or not. const signalGroup = (signal: NodeJS.Signals) => - ownsProcessGroup(command, childProcess) ? + globalThis.process.platform === "win32" || ownsProcessGroup(command) ? killProcessGroup(command, childProcess, signal).pipe( Effect.catch((error) => // Only zombies remain in the exited leader's group, so nothing is left to signal. @@ -675,24 +696,25 @@ const make = Effect.gen(function*() { const stdio = buildStdioArray(stdinConfig, stdoutConfig, stderrConfig, resolvedAdditionalFds) const releaseProcess = Effect.fnUntraced(function*( - childProcess: NodeChildProcess.ChildProcess, - exitSignal: Deferred.Deferred + childProcess: SpawnedProcess, + exitSignal: ExitSignal ) { - const exited = yield* Deferred.isDone(exitSignal) - if (exited) { - const [code] = yield* Deferred.await(exitSignal) - if (code !== 0 && Predicate.isNotNull(code)) { - yield* Effect.ignore(terminateProcessGroup(cmd, childProcess, exitSignal, cmd.options)) - } else if (isReferenced && process.platform !== "win32" && cmd.options.detached !== false) { - yield* Effect.ignore(terminateProcessGroup(cmd, childProcess, exitSignal, cmd.options)) - } + // A child whose exit status can no longer be observed may have exited + // and its ID been reused, so it is left alone. An unref'ed child and its + // process group are no longer owned by the scope. + if (childProcess.lost === true || !isReferenced) { return } - if (!isReferenced) { - return + if (Deferred.isDoneUnsafe(exitSignal)) { + // Only a lost child fails its exit signal + const [code] = yield* Effect.orDie(Deferred.await(exitSignal)) + if ((code === 0 || Predicate.isNull(code)) && !ownsProcessGroup(cmd)) { + return + } } yield* Effect.ignore(terminateProcessGroup(cmd, childProcess, exitSignal, cmd.options)) }) + const spawnProcess = yield* prepareSpawn // The input feeders run in a standalone scope, so a failed spawn leaves // nothing behind in the caller's scope. It is closed concurrently with // process termination, since either may wait on the other: Bun does not @@ -700,7 +722,7 @@ const make = Effect.gen(function*() { // a child may wait for stdin EOF before exiting. const inputScope = Scope.makeUnsafe() const [childProcess, exitSignal] = yield* Effect.acquireRelease( - spawn(cmd, buildSpawnOptions(cmd.options, { cwd, env, stdio }, process.platform)), + spawn(spawnProcess, cmd, buildSpawnOptions(cmd.options, { cwd, env, stdio }, process.platform)), ([childProcess, exitSignal], exit) => Effect.all([Scope.close(inputScope, exit), releaseProcess(childProcess, exitSignal)], { concurrency: "unbounded", @@ -709,10 +731,9 @@ const make = Effect.gen(function*() { ) const pid = ProcessId(childProcess.pid!) - // A non-detached child leaves no process group of its own to clean up. - if (cmd.options.detached !== false) { + if (ownsProcessGroup(cmd)) { childProcess.on("exit", (code) => { - if (code !== 0 && Predicate.isNotNull(code)) { + if (isReferenced && code !== 0 && Predicate.isNotNull(code)) { killProcessGroupOnExit(childProcess, cmd.options.killSignal ?? "SIGTERM") } }) @@ -736,7 +757,10 @@ const make = Effect.gen(function*() { const { getInputFd, getOutputFd } = yield* Scope.provide(inputScope)( setupAdditionalFds(cmd, childProcess, resolvedAdditionalFds, inputFailure) ) - const isRunning = Effect.map(Deferred.isDone(exitSignal), (done) => !done) + // Fails once the exit status can no longer be observed + const isRunning = Effect.suspend(() => + Deferred.isDoneUnsafe(exitSignal) ? Effect.as(Deferred.await(exitSignal), false) : Effect.succeed(true) + ) // A failed input stream truncates the input of the child process, so // its failure takes precedence over the exit status and is surfaced // without waiting for the child process to exit @@ -873,7 +897,168 @@ export const layer: Layer.Layer< ChildProcessSpawner, never, FileSystem.FileSystem | Path.Path -> = Layer.effect(ChildProcessSpawner, make) +> = Layer.effect(ChildProcessSpawner, makeWith(Effect.succeed(spawnDirect))) + +/** + * Service that reports the proxy process started by {@link layerProxyProcess}. + * + * **Details** + * + * `currentPid` is the process ID of the proxy process that new spawns go to, + * which is the parent process ID of the commands it launches. It is `None` + * from the moment that proxy process is seen to exit, or is replaced after a + * credential change, until the replacement started by a later spawn is ready. + * It is also `None` after the layer's scope closes. + * + * **Gotchas** + * + * - The service does not show which spawner is in context. If a layer + * providing another `ChildProcessSpawner`, such as {@link layer}, is merged + * over {@link layerProxyProcess}, commands are spawned directly while this + * service still reports the proxy process. + * - Commands of a proxy process that was replaced keep their old parent. + * + * @stability unstable + * @category services + * @since 4.1.6 + */ +export class ProxyProcess extends Context.Service> +}>()("@effect/platform-node/NodeChildProcessSpawner/ProxyProcess") {} + +/** + * Creates a layer that provides a `ChildProcessSpawner` which launches commands + * from a small, long-lived proxy process instead of the current process, along + * with the {@link ProxyProcess} service. + * + * **When to use** + * + * Use when spawning a command measurably stalls the event loop of a Node.js + * application on Linux that holds a lot of memory outside the JavaScript heap, + * such as large `Buffer`s. The stall depends on the Node.js + * build, so measure a direct spawn with {@link layer} on the deployed build + * first. + * + * **Details** + * + * Only the spawn request goes through the proxy process. Piped stdio is + * connected to the application over Unix domain sockets, and signals are sent + * to the command directly, so output does not pass through the proxy process. + * + * Building the layer starts the proxy process and waits until it is ready. + * The build fails with a `PlatformError` if it cannot start, does not answer + * within `responseTimeout` (10 seconds by default), or runs on Windows. Fall + * back with `Layer.catch(() => NodeChildProcessSpawner.layer)`. The proxy + * process stops when the layer's scope closes, once its remaining referenced + * commands have exited. Commands keep running if the application exits, as + * with {@link layer}. + * + * By default the proxy process runs + * `process.execPath --input-type=module -e ` with the + * application's environment minus `NODE_OPTIONS`. `executable`, `args` and + * `env` replace these. A custom entry point must call + * `NodeChildProcessProxy.run`. Commands always receive their own environment. + * + * If the proxy process exits, or the application changes its user or group + * IDs, the next spawn starts a new proxy process and waits until it is ready. + * Spawns are not queued: each one waits, interruptibly, and its request is + * created only when it is sent, so a spawn interrupted while waiting never + * starts its command. A spawn whose proxy process fails to start fails with a + * `PlatformError`. Its command was not sent, so retrying is safe. After the + * layer's scope closes, spawns fail without starting a proxy process. + * + * A spawn request is sent at most once. If the proxy process exits, or sends + * nothing within `responseTimeout`, after a request was sent but before it + * replied, the command may already be running. The proxy process is stopped, + * the spawn fails with a `PlatformError`, and the request is not sent again. + * + * **Gotchas** + * + * - A proxy process that does not respond in time is killed, so the exit + * status of every command it launched is lost. + * - A command that started but was never acknowledged cannot be signalled, + * since its process ID was never received. Its stdio is closed. + * - Commands run with the user and group IDs the proxy process started with. + * Build the layer after the application has changed its credentials, and + * before it has grown large, since starting the proxy process from a large + * process stalls once. + * - If the proxy process exits early, commands it launched keep their stdio, + * but `exitCode` and `isRunning` fail with a `PlatformError` because their + * exit can no longer be observed. `kill` still sends its first signal, + * without escalating, and that signal can reach an unrelated process if the + * command has already exited and its ID has been reused. On a + * single-command handle `kill` then fails with a `PlatformError`. A + * pipeline handle's `kill` ignores the failures of its commands, so it + * succeeds. Scope release does not signal these commands, so they keep + * running. + * - Every call creates a separate layer, with its own proxy process. Keep the + * result in one constant to share a proxy process. + * - The socket path under `os.tmpdir()` must fit the platform limit of about + * 100 bytes. + * + * **Example** (Wiring a packaged command-line application) + * + * ```ts + * // bin.ts dispatches `__proxy-process` to `NodeChildProcessProxy.run` before + * // it imports the application + * import * as NodeChildProcessSpawner from "@effect/platform-node/NodeChildProcessSpawner" + * import { Effect, Layer, Option } from "effect" + * import * as NodeSea from "node:sea" + * + * // One constant, so the whole application shares one proxy process + * export const SpawnerLayer = NodeChildProcessSpawner.layerProxyProcess({ + * // In a single executable application, process.execPath is the application + * args: NodeSea.isSea() ? ["__proxy-process"] : undefined + * }).pipe(Layer.catch(() => NodeChildProcessSpawner.layer)) + * + * // The parent process ID of commands spawned from now on + * export const spawnParentPid = Effect.gen(function*() { + * const proxy = yield* Effect.serviceOption(NodeChildProcessSpawner.ProxyProcess) + * const pid = Option.isSome(proxy) ? yield* proxy.value.currentPid : Option.none() + * return Option.getOrElse(pid, () => process.pid) + * }) + * ``` + * + * @stability unstable + * @category layers + * @since 4.1.6 + */ +export const layerProxyProcess = (options?: { + readonly executable?: string | undefined + readonly args?: ReadonlyArray | undefined + readonly env?: Record | undefined + readonly responseTimeout?: Duration.Input | undefined +}): Layer.Layer< + ChildProcessSpawner | ProxyProcess, + PlatformError.PlatformError, + FileSystem.FileSystem | Path.Path +> => + Layer.effectContext(Effect.gen(function*() { + if (globalThis.process.platform === "win32") { + return yield* Effect.fail(PlatformError.systemError({ + _tag: "Unknown", + module: "ChildProcess", + method: "layerProxyProcess", + description: "The proxy process is not supported on Windows" + })) + } + const proxy = yield* Effect.acquireRelease( + Effect.sync(() => + ProxyProcesses.make({ + executable: options?.executable, + args: options?.args, + env: options?.env, + responseTimeoutMillis: Duration.toMillis(options?.responseTimeout ?? "10 seconds") + }) + ), + (proxy) => proxy.close + ) + yield* proxy.ready + const spawner = yield* makeWith(proxy.prepareSpawn) + return Context.make(ChildProcessSpawner, spawner).pipe( + Context.add(ProxyProcess, ProxyProcess.of({ currentPid: proxy.currentPid })) + ) + })) // ============================================================================= // Internal Helpers diff --git a/.repos/effect/packages/platform/node-shared/src/NodeFileSystem.ts b/.repos/effect/packages/platform/node-shared/src/NodeFileSystem.ts index 1eb9cc5f78e64..b36240825e4e9 100644 --- a/.repos/effect/packages/platform/node-shared/src/NodeFileSystem.ts +++ b/.repos/effect/packages/platform/node-shared/src/NodeFileSystem.ts @@ -270,6 +270,9 @@ const openFactory = (method: string): FileSystem.FileSystem["open"] => { } const open = openFactory("open") +const isEspipe = (error: Error.PlatformError) => + (error.reason.cause as NodeJS.ErrnoException | undefined)?.code === "ESPIPE" + const negativePosition = (method: string) => Error.badArgument({ module: "FileSystem", @@ -322,6 +325,7 @@ const makeFile = (() => { private readonly append: boolean private position: bigint = BigInt(0) + private sequential = false constructor( fd: number, @@ -340,6 +344,41 @@ const makeFile = (() => { return nodeSync(this.fd) } + // Runs one read or write at the cursor, then advances it. If the descriptor + // rejects positioned I/O with ESPIPE (pipes, sockets, terminals), retry + // sequentially and stay sequential for this handle. + private atCursor( + f: (position: bigint | null) => Effect.Effect + ): Effect.Effect { + return Effect.suspend(() => { + if (this.sequential) { + return f(null) + } + const position = this.position + return Effect.catchIf( + Effect.map(f(position), (bytes) => { + this.position = position + BigInt(bytes) + return bytes + }), + isEspipe, + () => { + this.sequential = true + return f(null) + } + ) + }) + } + + private writeOnce(method: string, write: typeof nodeWrite, buffer: Uint8Array) { + return this.append ? + Effect.suspend(() => write(this.fd, buffer, undefined)) : + this.atCursor((position) => + position === null + ? write(this.fd, buffer, undefined) + : Effect.flatMap(positionToNumber(position, method), (position) => write(this.fd, buffer, position)) + ) + } + seek(offset: bigint, from: FileSystem.SeekMode) { return Effect.suspend(() => { const position = from === "start" ? offset : this.position + offset @@ -358,19 +397,12 @@ const makeFile = (() => { read(buffer: Uint8Array, options?: FileSystem.File.ReadOptions) { return Effect.suspend(() => { const explicit = options?.position - if (explicit !== undefined) { - return explicit < BigInt(0) - ? Effect.fail(negativePosition("read")) - : nodeRead(this.fd, { buffer, position: explicit }) + if (explicit === undefined) { + return this.atCursor((position) => nodeRead(this.fd, { buffer, position })) } - const position = this.position - return Effect.map( - nodeRead(this.fd, { buffer, position }), - (bytesRead) => { - this.position = position + BigInt(bytesRead) - return bytesRead - } - ) + return explicit < BigInt(0) + ? Effect.fail(negativePosition("read")) + : nodeRead(this.fd, { buffer, position: explicit }) }) } @@ -385,17 +417,13 @@ const makeFile = (() => { return Effect.fail(negativePosition("readAlloc")) } const buffer = Buffer.allocUnsafeSlow(size) - const position = explicit ?? this.position + const read = (position: bigint | null) => nodeReadAlloc(this.fd, { buffer, position }) return Effect.map( - nodeReadAlloc(this.fd, { buffer, position }), + explicit === undefined ? this.atCursor(read) : read(explicit), (bytesRead): Option.Option => { if (bytesRead === 0) { return Option.none() } - - if (explicit === undefined) { - this.position = position + BigInt(bytesRead) - } if (bytesRead === size) { return Option.some(buffer) } @@ -423,53 +451,24 @@ const makeFile = (() => { } write(buffer: Uint8Array) { - return Effect.suspend(() => { - const position = this.position - return Effect.flatMap( - this.append ? Effect.succeed(undefined) : positionToNumber(position, "write"), - (nodePosition) => - Effect.map( - nodeWrite(this.fd, buffer, nodePosition), - (bytesWritten) => { - if (!this.append) { - this.position = position + BigInt(bytesWritten) - } - return bytesWritten - } - ) - ) - }) + return this.writeOnce("write", nodeWrite, buffer) } private writeAllChunk(buffer: Uint8Array): Effect.Effect { - return Effect.suspend(() => { - const position = this.position - return Effect.flatMap( - this.append ? Effect.succeed(undefined) : positionToNumber(position, "writeAll"), - (nodePosition) => - Effect.flatMap( - nodeWriteAll(this.fd, buffer, nodePosition), - (bytesWritten) => { - if (bytesWritten === 0) { - return Effect.fail( - Error.systemError({ - module: "FileSystem", - method: "writeAll", - _tag: "WriteZero", - pathOrDescriptor: this.fd, - description: "write returned 0 bytes written" - }) - ) - } - - if (!this.append) { - this.position = position + BigInt(bytesWritten) - } - - return bytesWritten < buffer.length ? this.writeAllChunk(buffer.subarray(bytesWritten)) : Effect.void - } - ) - ) + // Recurse outside `writeOnce` so an ESPIPE retry only repeats the failed chunk. + return Effect.flatMap(this.writeOnce("writeAll", nodeWriteAll, buffer), (bytesWritten) => { + if (bytesWritten === 0) { + return Effect.fail( + Error.systemError({ + module: "FileSystem", + method: "writeAll", + _tag: "WriteZero", + pathOrDescriptor: this.fd, + description: "write returned 0 bytes written" + }) + ) + } + return bytesWritten < buffer.length ? this.writeAllChunk(buffer.subarray(bytesWritten)) : Effect.void }) } diff --git a/.repos/effect/packages/platform/node-shared/src/NodeStdio.ts b/.repos/effect/packages/platform/node-shared/src/NodeStdio.ts index f42e3ced4ce8e..69f8a129e47b5 100644 --- a/.repos/effect/packages/platform/node-shared/src/NodeStdio.ts +++ b/.repos/effect/packages/platform/node-shared/src/NodeStdio.ts @@ -14,14 +14,34 @@ import * as Effect from "effect/Effect" import * as Layer from "effect/Layer" import { systemError } from "effect/PlatformError" import * as Stdio from "effect/Stdio" +import * as Stream from "effect/Stream" import { fromWritable } from "./NodeSink.ts" import { fromReadable } from "./NodeStream.ts" +// Node only stops reading stdin on `pause`, and `pause` is a no-op until the +// tick after the last `readable` listener is removed. Register this before +// `fromReadable` so it runs after that listener cleanup. +const pauseStdin = Effect.sync(() => { + process.nextTick(() => { + if (process.stdin.readableFlowing === null) { + process.stdin.pause() + } + }) +}) + /** * Provides `Stdio` from `process.argv`, `process.stdin`, `process.stdout`, * and `process.stderr`; stdin remains open and stdout/stderr are not ended by * default. * + * **Gotchas** + * + * When the last `Stdio.stdin` consumer finishes or is interrupted, + * `process.stdin` is paused so the Node process can exit without waiting for + * stdin EOF. Later `Stdio.stdin` consumers resume reading automatically, but + * raw `process.stdin.on("data", ...)` listeners attached afterwards must call + * `process.stdin.resume()`. + * * @stability unstable * @category layers * @since 4.0.0 @@ -57,16 +77,21 @@ export const layer: Layer.Layer = Layer.succeed( }), endOnDone: options?.endOnDone ?? false }), - stdin: fromReadable({ - evaluate: () => process.stdin, - onError: (cause) => - systemError({ - module: "Stdio", - method: "stdin", - _tag: "Unknown", - cause - }), - closeOnDone: false - }) + stdin: Stream.unwrap( + Effect.as( + Effect.addFinalizer(() => pauseStdin), + fromReadable({ + evaluate: () => process.stdin, + onError: (cause) => + systemError({ + module: "Stdio", + method: "stdin", + _tag: "Unknown", + cause + }), + closeOnDone: false + }) + ) + ) }) ) diff --git a/.repos/effect/packages/platform/node-shared/src/index.ts b/.repos/effect/packages/platform/node-shared/src/index.ts index ab3400999c8cb..8e6a3466b8bfd 100644 --- a/.repos/effect/packages/platform/node-shared/src/index.ts +++ b/.repos/effect/packages/platform/node-shared/src/index.ts @@ -11,6 +11,12 @@ */ export * as NodeAddressResolver from "./NodeAddressResolver.ts" +/** + * @stability unstable + * @since 4.1.6 + */ +export * as NodeChildProcessProxy from "./NodeChildProcessProxy.ts" + /** * @stability unstable * @since 4.0.0 diff --git a/.repos/effect/packages/platform/node-shared/src/internal/nodeChildProcessSpawner.ts b/.repos/effect/packages/platform/node-shared/src/internal/nodeChildProcessSpawner.ts index e2e99c73e3291..2e01f3e4a2550 100644 --- a/.repos/effect/packages/platform/node-shared/src/internal/nodeChildProcessSpawner.ts +++ b/.repos/effect/packages/platform/node-shared/src/internal/nodeChildProcessSpawner.ts @@ -1,5 +1,41 @@ import type * as ChildProcess from "effect/process/ChildProcess" import type * as NodeChildProcess from "node:child_process" +import type { Readable, Writable } from "node:stream" + +/** + * The parts of a Node.js `ChildProcess` the spawner uses, so that a command + * launched by a proxy process can stand in for a direct child. Besides the + * `ChildProcess` events, it may emit `"lost"` with an `Error` when its exit + * status can no longer be observed. + * + * @internal + */ +export interface SpawnedProcess { + readonly pid?: number | undefined + readonly stdin: Writable | null + readonly stdout: Readable | null + readonly stderr: Readable | null + readonly stdio: ReadonlyArray + readonly exitCode: number | null + readonly signalCode: NodeJS.Signals | null + /** + * Whether the exit status can no longer be observed. The process may have + * exited and its PID been reused, so it must not be signalled automatically. + */ + readonly lost?: boolean | undefined + kill(signal?: NodeJS.Signals | number): boolean + ref(): void + unref(): void + on(event: string, listener: (...args: Array) => void): this + removeListener(event: string, listener: (...args: Array) => void): this +} + +/** @internal */ +export type SpawnProcess = ( + command: string, + args: ReadonlyArray, + options: NodeChildProcess.SpawnOptions +) => SpawnedProcess export const buildSpawnOptions = ( options: ChildProcess.CommandOptions, diff --git a/.repos/effect/packages/platform/node-shared/src/internal/proxyProcess.ts b/.repos/effect/packages/platform/node-shared/src/internal/proxyProcess.ts new file mode 100644 index 0000000000000..2c6b120502e92 --- /dev/null +++ b/.repos/effect/packages/platform/node-shared/src/internal/proxyProcess.ts @@ -0,0 +1,548 @@ +import * as Deferred from "effect/Deferred" +import * as Effect from "effect/Effect" +import * as Exit from "effect/Exit" +import * as Option from "effect/Option" +import * as PlatformError from "effect/PlatformError" +import { ProcessId } from "effect/process/ChildProcessSpawner" +import * as NodeChildProcess from "node:child_process" +import * as Crypto from "node:crypto" +import { EventEmitter } from "node:events" +import * as Fs from "node:fs" +import * as Net from "node:net" +import * as Os from "node:os" +import * as Path from "node:path" +import type { SpawnedProcess, SpawnProcess } from "./nodeChildProcessSpawner.ts" +import { source } from "./proxyProcessSource.ts" +import { headerLength, tokenLength } from "./proxyProcessWorker.ts" +import { handleErrnoException } from "./utils.ts" + +// macOS limits Unix socket paths to 104 bytes including the terminator, Linux to 108 +const maxSocketPathLength = 103 + +type Message = + | { readonly _tag: "Ready" } + | { readonly _tag: "Spawned"; readonly id: number; readonly pid: number } + | { readonly _tag: "Exit"; readonly id: number; readonly code: number | null; readonly signal: NodeJS.Signals | null } + | { + readonly _tag: "Error" + readonly id: number + readonly error: { readonly message: string } & Partial + } + +const deserializeError = ({ message, ...props }: { readonly message: string }): Error => + Object.assign(new Error(message), props) + +/** @internal */ +export interface ProxiedProcessOwner { + ref(): void + unref(): void + release(id: number): void +} + +/** @internal */ +export class ProxiedProcess extends EventEmitter implements SpawnedProcess { + pid: number | undefined = undefined + lost = false + exitCode: number | null = null + signalCode: NodeJS.Signals | null = null + readonly stdio: Array + private spawned = false + private done = false + private referenced = true + private pendingExit: readonly [number | null, NodeJS.Signals | null] | undefined = undefined + private pendingKill: NodeJS.Signals | number | undefined = undefined + + private readonly proxy: ProxiedProcessOwner + readonly id: number + private readonly pipes: ReadonlyArray + + constructor(proxy: ProxiedProcessOwner, id: number, pipes: ReadonlyArray) { + super() + this.proxy = proxy + this.id = id + this.pipes = pipes + this.stdio = pipes.map(() => null) + proxy.ref() + } + + get stdin() { + return this.stdio[0] ?? null + } + get stdout() { + return this.stdio[1] ?? null + } + get stderr() { + return this.stdio[2] ?? null + } + + kill(signal: NodeJS.Signals | number = "SIGTERM"): boolean { + if (this.exitCode !== null || this.signalCode !== null) return false + if (this.pid === undefined) { + if (this.done) return false + this.pendingKill = signal + return true + } + try { + globalThis.process.kill(this.pid, signal) + return true + } catch { + return false + } + } + + ref(): void { + if (!this.referenced && !this.done) { + this.referenced = true + this.proxy.ref() + } + } + + unref(): void { + if (this.referenced) { + this.referenced = false + this.proxy.unref() + } + } + + attach(fd: number, socket: Net.Socket): boolean { + if (this.done || this.pipes[fd] !== true || this.stdio[fd] !== null) return false + this.stdio[fd] = socket + this.emitSpawn() + return true + } + + onSpawned(pid: number): void { + this.pid = pid + if (this.pendingKill !== undefined) this.kill(this.pendingKill) + this.emitSpawn() + } + + onExit(code: number | null, signal: NodeJS.Signals | null): void { + if (!this.spawned) { + // The exit can overtake the stdio sockets + this.pendingExit = [code, signal] + return + } + this.exitCode = code + this.signalCode = signal + this.finish() + this.emit("exit", code, signal) + } + + /** Fails the spawn, unless the handle has already been published. */ + onError(error: Error): void { + if (this.spawned || this.done) return + this.finish() + for (const socket of this.stdio) socket?.destroy() + this.emit("error", error) + } + + /** + * The exit status can no longer be observed. Marks the process, and returns + * a function that reports it, so that every process of a proxy process is + * marked before listeners can observe any of them. + */ + onLost(error: Error): () => void { + if (this.done) return () => {} + // A spawn still waiting for its stdio sockets fails, and late sockets are rejected + if (!this.spawned) return () => this.onError(error) + this.lost = true + this.finish() + return () => this.emit("lost", error) + } + + private emitSpawn(): void { + if (this.spawned || this.pid === undefined) return + if (this.pipes.some((pipe, fd) => pipe && this.stdio[fd] === null)) return + this.spawned = true + this.emit("spawn") + if (this.pendingExit !== undefined) this.onExit(...this.pendingExit) + } + + private finish(): void { + this.unref() + this.done = true + this.proxy.release(this.id) + } +} + +// Owns a spawn that was refused, which no proxy process hears of +const noOwner: ProxiedProcessOwner = { ref() {}, unref() {}, release() {} } + +// Commands run with the credentials of the proxy process, which are fixed when +// it starts +const credentials = (): string => { + const process = globalThis.process + return [ + process.getuid?.(), + process.geteuid?.(), + process.getgid?.(), + process.getegid?.(), + process.getgroups?.().join(",") + ].join(":") +} + +/** @internal */ +export interface Options { + readonly executable?: string | undefined + readonly args?: ReadonlyArray | undefined + readonly env?: Record | undefined + readonly responseTimeoutMillis: number +} + +class Proxy implements ProxiedProcessOwner { + readonly commands = new Map() + readonly credentials = credentials() + pid: number | undefined = undefined + ready = false + exited = false + retired = false + /** Done once the proxy process is ready, or fails with the error that stopped it first. */ + readonly started = Deferred.makeUnsafe() + private readonly options: Options + private readonly token = Crypto.randomBytes(tokenLength) + private nextId = 0 + // Starting holds a reference, so the application waits for the proxy process to be ready + private refs = 1 + private directory: string | undefined + private server: Net.Server | undefined + private child: NodeChildProcess.ChildProcess | undefined + // Bounds the wait for `Ready`, and for the reply to each sent request + private readonly timers = new Map>() + + constructor(options: Options) { + this.options = options + try { + this.directory = Fs.mkdtempSync(Path.join(Os.tmpdir(), "effect-proxy-")) + const socketPath = Path.join(this.directory, "socket") + if (Buffer.byteLength(socketPath) > maxSocketPathLength) { + throw new Error( + `The proxy process socket path ${socketPath} exceeds ${maxSocketPathLength} bytes; set TMPDIR to a shorter directory` + ) + } + this.server = Net.createServer((socket) => this.accept(socket)) + this.server.on("error", (error) => this.end(error)) + this.server.listen(socketPath) + this.server.unref() + const env = options.env ?? { ...globalThis.process.env } + if (options.env === undefined) { + // Commands receive their environment with each request, and the proxy + // process must not load the application's preloads or inspector + delete env.NODE_OPTIONS + } + this.child = NodeChildProcess.spawn( + options.executable ?? globalThis.process.execPath, + options.args ?? ["--input-type=module", "-e", source], + { env, stdio: ["inherit", "inherit", "inherit", "ipc"], windowsHide: true } + ) + this.pid = this.child.pid + this.child.on("message", (message: Message) => this.receive(message)) + this.child.on("error", (error) => this.end(error)) + this.child.on( + "exit", + (code, signal) => + this.end(new Error(`The proxy process exited with ${signal === null ? `code ${code}` : `signal ${signal}`}`)) + ) + this.startTimer("ready") + // The socket path and token are kept out of the arguments, which other + // users can read + this.send({ _tag: "Init", socketPath, token: this.token.toString("hex") }) + this.updateRef() + } catch (error) { + globalThis.process.nextTick(() => this.end(error as Error)) + } + } + + /** + * Sends a spawn request, at most once. A proxy process that is no longer + * ready to take spawns, or whose credentials are out of date, fails the + * spawn without sending it, so every command it holds has been sent. + */ + spawn(command: string, args: ReadonlyArray, options: NodeChildProcess.SpawnOptions): ProxiedProcess { + if (!this.ready || this.exited || this.retired || this.credentials !== credentials()) { + const refused = new ProxiedProcess(noOwner, 0, []) + const error = new Error("The proxy process stopped taking spawns before the command was sent to it") + globalThis.process.nextTick(() => refused.onError(error)) + return refused + } + const id = this.nextId + this.nextId = (this.nextId + 1) % 0x1_0000_0000 + const stdio = (options.stdio as ReadonlyArray).map((mode) => + mode === undefined || mode === "overlapped" ? "pipe" : mode + ) + const child = new ProxiedProcess(this, id, stdio.map((mode) => mode === "pipe")) + this.commands.set(id, child) + this.startTimer(id) + this.send({ + id, + command, + args, + options: { + cwd: options.cwd ?? globalThis.process.cwd(), + env: options.env ?? globalThis.process.env, + detached: options.detached, + shell: options.shell, + windowsHide: options.windowsHide, + stdio + } + }) + return child + } + + ref(): void { + this.refs++ + this.updateRef() + } + + release(id: number): void { + this.commands.delete(id) + if (this.retired && this.commands.size === 0) this.disconnect() + } + + /** + * Stops taking spawns, and disconnects once the running commands have + * exited. A proxy process that is not ready yet has no commands and is + * stopped. + */ + retire(): void { + this.retired = true + if (!this.ready) return this.stop(new Error("The proxy process was retired before it was ready")) + if (this.commands.size === 0) this.disconnect() + } + + unref(): void { + this.refs-- + this.updateRef() + } + + /** + * Disconnects from the proxy process, which exits once its commands have + * exited. Waits for that unless an unreferenced command may outlive it. + */ + readonly close: Effect.Effect = Effect.callback((resume) => { + const child = this.child + if (this.exited || child === undefined) return resume(Effect.void) + if (!this.ready) { + this.stop(new Error("The proxy process was stopped before it was ready")) + return resume(Effect.void) + } + // Each referenced command holds one reference + const wait = this.refs === this.commands.size + if (wait) { + child.ref() + child.once("exit", () => resume(Effect.void)) + } + this.disconnect() + if (!wait) resume(Effect.void) + }) + + /** Stops a proxy process that has not been sent any command, or has stopped answering. */ + private stop(cause: Error): void { + // Its exit has not been seen, so its ID has not been reused + this.child?.kill("SIGKILL") + this.end(cause) + } + + private send(message: unknown): void { + if (this.child?.connected !== true) return + this.child.send(message as NodeChildProcess.Serializable, (error: Error | null) => { + if (error) this.end(error) + }) + } + + private startTimer(key: number | "ready"): void { + const millis = this.options.responseTimeoutMillis + const timer = setTimeout(() => { + this.stop( + Object.assign(new Error(`The proxy process did not respond within ${millis} ms`), { code: "ETIMEDOUT" }) + ) + }, millis) + // Whatever waits for the reply keeps the application running + timer.unref() + this.timers.set(key, timer) + } + + private stopTimer(key: number | "ready"): void { + clearTimeout(this.timers.get(key)) + this.timers.delete(key) + } + + private disconnect(): void { + if (this.child?.connected === true) this.child.disconnect() + this.closeServer() + } + + private updateRef(): void { + if (this.refs > 0) { + this.child?.ref() + this.child?.channel?.ref() + } else { + this.child?.unref() + this.child?.channel?.unref() + } + } + + private receive(message: Message): void { + if (message._tag === "Ready") return this.onReady() + const command = this.commands.get(message.id) + if (command === undefined) return + switch (message._tag) { + case "Spawned": + this.stopTimer(message.id) + return command.onSpawned(message.pid) + case "Exit": + return command.onExit(message.code, message.signal) + case "Error": + this.stopTimer(message.id) + return command.onError(deserializeError(message.error)) + } + } + + private onReady(): void { + if (this.ready || this.exited) return + this.ready = true + this.stopTimer("ready") + this.unref() + Deferred.doneUnsafe(this.started, Exit.void) + } + + private accept(socket: Net.Socket): void { + // Errors are reported to the readers and writers of the stdio streams + socket.on("error", () => {}) + const onReadable = () => { + const header: Buffer | null = socket.read(headerLength) + if (header === null) return + socket.off("readable", onReadable) + const command = + header.length === headerLength && Crypto.timingSafeEqual(header.subarray(0, tokenLength), this.token) + ? this.commands.get(header.readUInt32BE(tokenLength)) + : undefined + if (command === undefined || !command.attach(header.readUInt32BE(tokenLength + 4), socket)) { + socket.destroy() + } + } + socket.on("readable", onReadable) + } + + /** + * Best effort, and never throws, since it runs while exits and losses are + * being reported. Removal fails if the application has since changed its + * credentials, in which case the directory is left behind. + */ + private closeServer(): void { + const { directory, server } = this + this.directory = undefined + this.server = undefined + server?.close() + if (directory !== undefined) { + try { + Fs.rmSync(directory, { recursive: true, force: true }) + } catch { + // ignored + } + } + } + + private end(cause: Error): void { + if (this.exited) return + this.exited = true + for (const timer of this.timers.values()) clearTimeout(timer) + this.timers.clear() + if (!this.ready) this.unref() + const unacknowledged = new Error( + "The proxy process stopped after the command was sent to it but before it replied, so the command may have started", + { cause } + ) + const lost = new Error("The proxy process exited before the command's exit status was received", { cause }) + // Every command is marked lost before anything else can run + const reports = Array.from( + this.commands.values(), + (command) => command.onLost(command.pid !== undefined ? lost : unacknowledged) + ) + this.disconnect() + for (const report of reports) report() + // Has no effect on a proxy process that was ready + Deferred.doneUnsafe(this.started, Exit.fail(cause)) + } +} + +const toStartError = (options: Options) => (error: NodeJS.ErrnoException): PlatformError.PlatformError => { + const executable = options.executable ?? globalThis.process.execPath + const timedOut = error.code === "ETIMEDOUT" + if (!timedOut && error.syscall !== undefined) { + return handleErrnoException("ChildProcess", "layerProxyProcess")(error, [executable]) + } + return PlatformError.systemError({ + _tag: timedOut ? "TimedOut" : "Unknown", + module: "ChildProcess", + method: "layerProxyProcess", + description: error.message, + pathOrDescriptor: executable, + cause: error + }) +} + +/** + * Starts a proxy process. Another one is started on demand after it exits, or + * after the application changes its credentials. + * + * @internal + */ +export const make = (options: Options) => { + let closed = false + let current = new Proxy(options) + // Retired proxy processes still running commands + const retired = new Set() + const get = () => { + if (current.exited) { + current = new Proxy(options) + } else if (current.credentials !== credentials()) { + // The application changed its credentials, so its commands must not + // run with the old ones + const previous = current + current = new Proxy(options) + retired.add(previous) + previous.retire() + } + for (const proxy of retired) { + if (proxy.exited) retired.delete(proxy) + } + return current + } + const toError = toStartError(options) + // Waits, interruptibly, for a proxy process that is ready to take spawns. + // Nothing has been sent while waiting, so interruption has nothing to undo. + const ready: Effect.Effect = Effect.suspend(() => { + if (closed) { + return Effect.fail(PlatformError.systemError({ + _tag: "BadResource", + module: "ChildProcess", + method: "spawn", + description: "The layerProxyProcess layer has been released" + })) + } + const proxy = get() + return Deferred.await(proxy.started).pipe( + Effect.as(proxy), + // Retired by a credential change while starting, so wait for its replacement + Effect.catch((error) => proxy.retired ? ready : Effect.fail(toError(error))) + ) + }) + return { + prepareSpawn: Effect.map( + ready, + (proxy): SpawnProcess => (command, args, options) => proxy.spawn(command, args, options) + ), + /** Waits for the first proxy process to be ready. */ + ready: Effect.suspend(() => Effect.mapError(Deferred.await(current.started), toError)), + currentPid: Effect.sync(() => + !closed && current.ready && !current.exited && current.pid !== undefined + ? Option.some(ProcessId(current.pid)) + : Option.none() + ), + close: Effect.suspend(() => { + closed = true + return Effect.forEach([current, ...retired], (proxy) => proxy.close, { concurrency: "unbounded", discard: true }) + }) + } +} diff --git a/.repos/effect/packages/platform/node-shared/src/internal/proxyProcessSource.ts b/.repos/effect/packages/platform/node-shared/src/internal/proxyProcessSource.ts new file mode 100644 index 0000000000000..28fc185be97b6 --- /dev/null +++ b/.repos/effect/packages/platform/node-shared/src/internal/proxyProcessSource.ts @@ -0,0 +1,96 @@ +// Generated by scripts/generateProxyProcessSource.ts from proxyProcessWorker.ts. Do not edit. + +/** @internal */ +export const source = `/** + * The program of the proxy process. \`NodeChildProcessProxy.run\` calls + * {@link run} directly, and the default launcher runs it with + * \`node --input-type=module -e\`, from the source text that + * \`scripts/generateProxyProcessSource.ts\` generates from this module. So it + * must not import anything but Node.js builtins. + * + * The application sends the socket path and token in its first message, and + * the proxy process answers \`Ready\`. For each piped fd of a command it + * connects to the application's socket, identifies the socket with a header, + * and hands it to the command as that fd, so no output passes through the + * proxy process. + * + * @internal + */ +import * as ChildProcess from "node:child_process" +import * as Net from "node:net" +import * as Util from "node:util" + +/** @internal */ +export const tokenLength = 16 +/** @internal */ +export const headerLength = tokenLength + 8 + +/** @internal */ +export const run = () => { + if (typeof process.send !== "function") { + process.stderr.write("The proxy process must be started by NodeChildProcessSpawner.layerProxyProcess\\n") + process.exitCode = 1 + return + } + const send = (message ) => { + if (process.connected) process.send?.(message) + } + const serializeError = (error ) => ({ + message: error.message, + code: error.code, + errno: error.errno, + syscall: error.syscall, + path: error.path + }) + const connect = (socketPath , token , id , fd ) => + new Promise ((resolve, reject) => { + const socket = Net.connect(socketPath) + socket.pause() + socket.once("error", reject) + socket.once("connect", () => { + const header = Buffer.alloc(headerLength) + header.write(token, "hex") + header.writeUInt32BE(id, tokenLength) + header.writeUInt32BE(fd, tokenLength + 4) + socket.write(header, (error) => error ? reject(error) : resolve(socket)) + }) + }) + const spawn = async (socketPath , token , { args, command, id, options } ) => { + const stdio = await Promise.allSettled( + options.stdio.map((mode, fd) => mode === "pipe" ? connect(socketPath, token, id, fd) : mode) + ) + const values = stdio.map((result) => result.status === "fulfilled" ? result.value : undefined) + const sockets = values.filter((value) => value instanceof Net.Socket) + try { + const failure = stdio.find((result) => result.status === "rejected") + if (failure) throw failure.reason + // The command shares the file status flags of each socket, and libuv only + // makes fds 0 to 2 blocking + for (const socket of sockets) { + // A socket that has lost its handle is rejected by \`spawn\` + const errno = (socket )._handle?.setBlocking(true) + if (errno) throw new Error(\`setBlocking failed: \${Util.getSystemErrorName(errno)}\`) + } + const child = ChildProcess.spawn(command, args, { ...options, stdio: values }) + child.on("error", (error) => send({ _tag: "Error", id, error: serializeError(error) })) + child.on("spawn", () => send({ _tag: "Spawned", id, pid: child.pid })) + child.on("exit", (code, signal) => send({ _tag: "Exit", id, code, signal })) + } catch (error) { + send({ _tag: "Error", id, error: serializeError(error ) }) + } finally { + // The command holds its own copies of the sockets + for (const socket of sockets) socket.destroy() + } + } + // The application decides how to handle these. Once it has disconnected, + // the proxy process exits when its commands have exited. + process.on("SIGINT", () => {}) + process.on("SIGTERM", () => {}) + process.once("message", ({ socketPath, token } ) => { + process.on("message", (request ) => spawn(socketPath, token, request)) + send({ _tag: "Ready" }) + }) +} + +run() +` diff --git a/.repos/effect/packages/platform/node-shared/src/internal/proxyProcessWorker.ts b/.repos/effect/packages/platform/node-shared/src/internal/proxyProcessWorker.ts new file mode 100644 index 0000000000000..fe88ef6747200 --- /dev/null +++ b/.repos/effect/packages/platform/node-shared/src/internal/proxyProcessWorker.ts @@ -0,0 +1,101 @@ +/** + * The program of the proxy process. `NodeChildProcessProxy.run` calls + * {@link run} directly, and the default launcher runs it with + * `node --input-type=module -e`, from the source text that + * `scripts/generateProxyProcessSource.ts` generates from this module. So it + * must not import anything but Node.js builtins. + * + * The application sends the socket path and token in its first message, and + * the proxy process answers `Ready`. For each piped fd of a command it + * connects to the application's socket, identifies the socket with a header, + * and hands it to the command as that fd, so no output passes through the + * proxy process. + * + * @internal + */ +import * as ChildProcess from "node:child_process" +import * as Net from "node:net" +import * as Util from "node:util" + +/** @internal */ +export const tokenLength = 16 +/** @internal */ +export const headerLength = tokenLength + 8 + +type SocketWithHandle = Net.Socket & { + readonly _handle?: { setBlocking(blocking: boolean): number } | null +} + +type Request = { + readonly id: number + readonly command: string + readonly args: ReadonlyArray + readonly options: ChildProcess.SpawnOptions & { readonly stdio: ReadonlyArray } +} + +/** @internal */ +export const run = (): void => { + if (typeof process.send !== "function") { + process.stderr.write("The proxy process must be started by NodeChildProcessSpawner.layerProxyProcess\n") + process.exitCode = 1 + return + } + const send = (message: object) => { + if (process.connected) process.send?.(message) + } + const serializeError = (error: NodeJS.ErrnoException) => ({ + message: error.message, + code: error.code, + errno: error.errno, + syscall: error.syscall, + path: error.path + }) + const connect = (socketPath: string, token: string, id: number, fd: number) => + new Promise((resolve, reject) => { + const socket = Net.connect(socketPath) + socket.pause() + socket.once("error", reject) + socket.once("connect", () => { + const header = Buffer.alloc(headerLength) + header.write(token, "hex") + header.writeUInt32BE(id, tokenLength) + header.writeUInt32BE(fd, tokenLength + 4) + socket.write(header, (error) => error ? reject(error) : resolve(socket)) + }) + }) + const spawn = async (socketPath: string, token: string, { args, command, id, options }: Request) => { + const stdio = await Promise.allSettled( + options.stdio.map((mode, fd) => mode === "pipe" ? connect(socketPath, token, id, fd) : mode) + ) + const values = stdio.map((result) => result.status === "fulfilled" ? result.value : undefined) + const sockets = values.filter((value) => value instanceof Net.Socket) + try { + const failure = stdio.find((result) => result.status === "rejected") + if (failure) throw failure.reason + // The command shares the file status flags of each socket, and libuv only + // makes fds 0 to 2 blocking + for (const socket of sockets) { + // A socket that has lost its handle is rejected by `spawn` + const errno = (socket as SocketWithHandle)._handle?.setBlocking(true) + if (errno) throw new Error(`setBlocking failed: ${Util.getSystemErrorName(errno)}`) + } + const child = ChildProcess.spawn(command, args, { ...options, stdio: values as Array }) + child.on("error", (error) => send({ _tag: "Error", id, error: serializeError(error) })) + child.on("spawn", () => send({ _tag: "Spawned", id, pid: child.pid })) + child.on("exit", (code, signal) => send({ _tag: "Exit", id, code, signal })) + } catch (error) { + send({ _tag: "Error", id, error: serializeError(error as NodeJS.ErrnoException) }) + } finally { + // The command holds its own copies of the sockets + for (const socket of sockets) socket.destroy() + } + } + // The application decides how to handle these. Once it has disconnected, + // the proxy process exits when its commands have exited. + process.on("SIGINT", () => {}) + process.on("SIGTERM", () => {}) + process.once("message", ({ socketPath, token }: { readonly socketPath: string; readonly token: string }) => { + process.on("message", (request: Request) => spawn(socketPath, token, request)) + send({ _tag: "Ready" }) + }) +} diff --git a/.repos/effect/packages/platform/node-shared/test/NodeChildProcessSpawner.test.ts b/.repos/effect/packages/platform/node-shared/test/NodeChildProcessSpawner.test.ts index 0198314cf38d7..f03d2c8396e08 100644 --- a/.repos/effect/packages/platform/node-shared/test/NodeChildProcessSpawner.test.ts +++ b/.repos/effect/packages/platform/node-shared/test/NodeChildProcessSpawner.test.ts @@ -1,20 +1,28 @@ import { buildSpawnOptions } from "@effect/platform-node-shared/internal/nodeChildProcessSpawner" +import { ProxiedProcess } from "@effect/platform-node-shared/internal/proxyProcess" +import { source as proxyProcessSource } from "@effect/platform-node-shared/internal/proxyProcessSource" import * as NodeChildProcessSpawner from "@effect/platform-node-shared/NodeChildProcessSpawner" import * as NodeFileSystem from "@effect/platform-node-shared/NodeFileSystem" import * as NodePath from "@effect/platform-node-shared/NodePath" import { assert, describe, it } from "@effect/vitest" import * as ChildProcessSpawnerTest from "effect-test/process/ChildProcessSpawnerTest" import * as ByteSize from "effect/ByteSize" +import * as Context from "effect/Context" import * as Deferred from "effect/Deferred" import * as Effect from "effect/Effect" import * as Exit from "effect/Exit" +import * as Fiber from "effect/Fiber" import * as FileSystem from "effect/FileSystem" import * as Layer from "effect/Layer" +import * as Option from "effect/Option" import * as ChildProcess from "effect/process/ChildProcess" +import { ChildProcessSpawner } from "effect/process/ChildProcessSpawner" import * as Scope from "effect/Scope" import * as Stream from "effect/Stream" import NodeChildProcess, { spawnSync } from "node:child_process" +import NodeFs from "node:fs" import { syncBuiltinESMExports } from "node:module" +import * as Net from "node:net" import { join } from "node:path" import { vi } from "vitest" @@ -25,8 +33,358 @@ const NodeServices = NodeChildProcessSpawner.layer.pipe( )) ) -ChildProcessSpawnerTest.suite("NodeChildProcessSpawner", NodeServices, { - processGroups: true +const proxyServices = (options?: Parameters[0]) => + NodeChildProcessSpawner.layerProxyProcess(options).pipe( + Layer.provideMerge(Layer.mergeAll(NodeFileSystem.layer, NodePath.layer)) + ) + +const ProxyServices = proxyServices() + +// The process supervision tests count processes by name, so the suites must +// not run at the same time +describe("shared suite", { concurrent: false }, () => { + ChildProcessSpawnerTest.suite("NodeChildProcessSpawner", NodeServices, { + processGroups: true + }) + + // The proxy process layer fails to build on Windows + if (process.platform !== "win32") { + ChildProcessSpawnerTest.suite("NodeChildProcessSpawner.layerProxyProcess", Layer.orDie(ProxyServices), { + processGroups: true + }) + } +}) + +describe.skipIf(process.platform === "win32")("layerProxyProcess", { concurrent: false }, () => { + // Commands are launched by the proxy process, so their parent is the proxy. + // The tag is the last argument of the spawn request. + const tagged = Effect.fnUntraced(function*(...tag: ReadonlyArray) { + const spawner = yield* ChildProcessSpawner + return Number((yield* spawner.string(ChildProcess.make("sh", ["-c", "echo $PPID", ...tag]))).trim()) + }) + + const proxyPid = tagged() + + const isAlive = (pid: number) => { + try { + process.kill(pid, 0) + return true + } catch { + return false + } + } + + const currentPid = Effect.flatMap(NodeChildProcessSpawner.ProxyProcess, (proxy) => proxy.currentPid) + + // Holds back the `Ready` reply of proxy processes started while `hold` + // exists, and records the tag (last argument) of each spawn request + const heldProxyProgram = (hold: string, requests: string) => + `const fs = process.getBuiltinModule("node:fs") +process.on("message", (message) => { + if (message.command !== undefined) fs.appendFileSync(${JSON.stringify(requests)}, message.args.at(-1) + "\\n") +}) +const sendMessage = process.send.bind(process) +process.send = (message, ...rest) => { + if (message._tag !== "Ready") return sendMessage(message, ...rest) + const release = () => fs.existsSync(${JSON.stringify(hold)}) ? setTimeout(release, 10) : sendMessage(message, ...rest) + release() + return true +} +${proxyProcessSource}` + + // A layer whose proxy processes run the held program + const heldProxy = Effect.gen(function*() { + const fs = yield* FileSystem.FileSystem + const directory = yield* fs.makeTempDirectoryScoped() + const hold = join(directory, "hold") + const requests = join(directory, "requests") + const layer = proxyServices({ args: ["--input-type=module", "-e", heldProxyProgram(hold, requests)] }) + return { fs, hold, requests, layer } + }) + + // Each call makes the application appear to have changed its user ID + const credentialChanges = Effect.gen(function*() { + const uid = process.getuid!() + const getuid = yield* Effect.acquireRelease( + Effect.sync(() => vi.spyOn(process, "getuid")), + (spy) => Effect.sync(() => spy.mockRestore()) + ) + let changes = 0 + return () => { + getuid.mockReturnValue(uid + ++changes) + } + }) + + it.live("stops the proxy process when the layer scope closes", () => + Effect.gen(function*() { + const [pid, proxy, spawner] = yield* Effect.gen(function*() { + const pid = yield* proxyPid + assert.deepStrictEqual(yield* currentPid, Option.some(pid)) + return [pid, yield* NodeChildProcessSpawner.ProxyProcess, yield* ChildProcessSpawner] as const + }).pipe(Effect.provide(ProxyServices)) + assert.notStrictEqual(pid, process.pid) + assert.isFalse(isAlive(pid)) + assert.deepStrictEqual(yield* proxy.currentPid, Option.none()) + // A retained spawner does not start a proxy process the layer no longer owns + const error = yield* Effect.flip(spawner.string(ChildProcess.make("true"))) + assert.strictEqual(error.reason._tag, "BadResource") + })) + + it.live("never sends a spawn that is interrupted while a replacement proxy process starts", () => + Effect.gen(function*() { + const { fs, hold, layer, requests } = yield* heldProxy + yield* Effect.gen(function*() { + const first = Option.getOrThrow(yield* currentPid) + yield* fs.writeFileString(hold, "") + process.kill(first, "SIGKILL") + while (Option.isSome(yield* currentPid)) yield* Effect.sleep("10 millis") + + const interrupted = yield* Effect.forkChild(tagged("interrupted")) + const survivor = yield* Effect.forkChild(tagged("survivor")) + yield* Effect.sleep("100 millis") + // The replacement is starting + assert.deepStrictEqual(yield* currentPid, Option.none()) + yield* Fiber.interrupt(interrupted) + yield* fs.remove(hold) + + const pid = yield* Fiber.join(survivor) + assert.notStrictEqual(pid, first) + assert.deepStrictEqual(yield* currentPid, Option.some(pid)) + assert.strictEqual(yield* fs.readFileString(requests), "survivor\n") + }).pipe(Effect.provide(layer)) + }).pipe(Effect.provide(NodeFileSystem.layer), Effect.scoped)) + + it.live("sends spawns waiting on a proxy process retired while starting to its replacement", () => + Effect.gen(function*() { + const { fs, hold, layer, requests } = yield* heldProxy + const changeCredentials = yield* credentialChanges + yield* Effect.gen(function*() { + yield* fs.writeFileString(hold, "") + // Retires the ready proxy process, and starts one that is held + changeCredentials() + const waiting = yield* Effect.forkChild(tagged("waiting")) + yield* Effect.sleep("100 millis") + // Retires the held one while it starts, and starts another + changeCredentials() + const latest = yield* Effect.forkChild(tagged("latest")) + yield* Effect.sleep("100 millis") + yield* fs.remove(hold) + + const pid = yield* Fiber.join(latest) + assert.strictEqual(yield* Fiber.join(waiting), pid) + assert.deepStrictEqual(yield* currentPid, Option.some(pid)) + assert.deepStrictEqual((yield* fs.readFileString(requests)).split("\n").sort(), ["", "latest", "waiting"]) + }).pipe(Effect.provide(layer)) + }).pipe(Effect.provide(NodeFileSystem.layer), Effect.scoped)) + + it.live("fails to build when the proxy process cannot start or does not answer", () => + Effect.gen(function*() { + const build = (options: Parameters[0]) => + Effect.flip(Effect.scoped(Layer.build(proxyServices(options)))) + const missing = yield* build({ executable: "/nonexistent/node" }) + assert.strictEqual(missing.reason._tag, "NotFound") + + const pidFile = join(yield* FileSystem.FileSystem.use((fs) => fs.makeTempDirectoryScoped()), "pid") + const silent = yield* build({ + args: [ + "-e", + `require("node:fs").writeFileSync(${ + JSON.stringify(pidFile) + }, String(process.pid)); setInterval(() => {}, 60_000)` + ], + responseTimeout: "1 second" + }) + assert.strictEqual(silent.reason._tag, "TimedOut") + const pid = Number(NodeFs.readFileSync(pidFile, "utf8")) + while (isAlive(pid)) yield* Effect.sleep("10 millis") + }).pipe(Effect.provide(NodeFileSystem.layer), Effect.scoped)) + + it("generates the default launcher's program from the worker that run calls", () => { + const script = join(__dirname, "..", "scripts", "generateProxyProcessSource.ts") + const result = spawnSync(process.execPath, [script, "--check"], { encoding: "utf8" }) + // Run `pnpm codegen` after changing the worker + assert.strictEqual(result.status, 0, result.stderr) + }) + + it.live("runs the proxy process from a packaged application's subcommand", () => + Effect.gen(function*() { + const fixture = join(__dirname, "fixtures", "proxy-cli.ts") + // Packaged applications may forbid compiling code from strings + const pid = yield* proxyPid.pipe( + Effect.provide(proxyServices({ args: ["--disallow-code-generation-from-strings", fixture, "__proxy-process"] })) + ) + assert.notStrictEqual(pid, process.pid) + + const { NODE_OPTIONS: _, ...env } = process.env + const result = spawnSync(process.execPath, [fixture, "__proxy-process"], { encoding: "utf8", env }) + assert.strictEqual(result.status, 1) + assert.include(result.stderr, "must be started by NodeChildProcessSpawner.layerProxyProcess") + })) + + it.live("does not send a command again when its acknowledgement is lost", () => + Effect.gen(function*() { + const fs = yield* FileSystem.FileSystem + const directory = yield* fs.makeTempDirectoryScoped() + const runs = join(directory, "runs") + const dropFlag = join(directory, "drop") + yield* fs.writeFileString(dropFlag, "") + // The first proxy process starts commands but never acknowledges them + const program = `const dropSpawned = (() => { + try { + process.getBuiltinModule("node:fs").rmSync(${JSON.stringify(dropFlag)}) + return true + } catch { + return false + } +})() +const sendMessage = process.send.bind(process) +process.send = (message, ...rest) => dropSpawned && message._tag === "Spawned" ? true : sendMessage(message, ...rest) +${proxyProcessSource}` + + yield* Effect.gen(function*() { + const first = Option.getOrThrow(yield* currentPid) + const error = yield* Effect.flip(Effect.scoped(ChildProcess.make("sh", ["-c", "echo run >> \"$0\"", runs]))) + assert.include(String((error.reason.cause as Error).message), "may have started") + assert.deepStrictEqual(yield* currentPid, Option.none()) + // The command ran once + while (!(yield* fs.exists(runs))) yield* Effect.sleep("10 millis") + + const next = yield* proxyPid + assert.notStrictEqual(next, first) + assert.deepStrictEqual(yield* currentPid, Option.some(next)) + assert.strictEqual(yield* fs.readFileString(runs), "run\n") + while (isAlive(first)) yield* Effect.sleep("10 millis") + }).pipe( + Effect.provide(proxyServices({ args: ["--input-type=module", "-e", program], responseTimeout: "1 second" })) + ) + }).pipe(Effect.provide(NodeFileSystem.layer), Effect.scoped)) + + it.live("keeps stdio and kill working, fails exitCode, and restarts when the proxy process exits", () => + Effect.gen(function*() { + const pid = yield* proxyPid + const echo = yield* ChildProcess.make("sh", ["-c", "read line; echo \"got $line\""]) + const sleep = yield* ChildProcess.make("sleep", ["30"]) + process.kill(pid, "SIGKILL") + + const exitCodeError = yield* Effect.flip(echo.exitCode) + assert.strictEqual(exitCodeError._tag, "PlatformError") + assert.deepStrictEqual(yield* currentPid, Option.none()) + assert.strictEqual((yield* Effect.flip(echo.isRunning))._tag, "PlatformError") + + yield* Stream.run(Stream.make(new TextEncoder().encode("hello\n")), echo.stdin) + const output = yield* Stream.mkString(Stream.decodeText(echo.stdout)) + assert.strictEqual(output, "got hello\n") + + // The signal is delivered, but the exit can no longer be observed + assert.strictEqual((yield* Effect.flip(sleep.kill()))._tag, "PlatformError") + // stdout closes once the signalled command has exited + yield* Stream.runDrain(sleep.stdout).pipe(Effect.timeout("2 seconds")) + + const nextPid = yield* proxyPid + assert.notStrictEqual(nextPid, pid) + assert.deepStrictEqual(yield* currentPid, Option.some(nextPid)) + }).pipe(Effect.provide(ProxyServices))) + + // Simulates an application that can no longer remove the socket directory, + // such as after dropping privileges + const denySocketDirectoryRemoval = Effect.gen(function*() { + const rmSync = NodeFs.rmSync + const denied: Array = [] + const spy = vi.spyOn(NodeFs, "rmSync").mockImplementation((path) => { + denied.push(String(path)) + throw Object.assign(new Error("EACCES: permission denied"), { code: "EACCES" }) + }) + syncBuiltinESMExports() + yield* Effect.addFinalizer(() => + Effect.sync(() => { + spy.mockRestore() + syncBuiltinESMExports() + for (const path of denied) rmSync(path, { recursive: true, force: true }) + }) + ) + return denied + }) + + it.live( + "stops escalating, does not signal on release, and restarts on proxy loss even when socket directory removal fails", + () => + Effect.gen(function*() { + const kill = yield* Effect.acquireRelease( + Effect.sync(() => vi.spyOn(process, "kill")), + (spy) => Effect.sync(() => spy.mockRestore()) + ) + const signalsTo = (pid: number) => + kill.mock.calls.filter(([target, signal]) => Math.abs(target) === pid && signal !== 0).map(([, signal]) => + signal + ) + const pid = yield* proxyPid + const scope = yield* Scope.make() + // Ignores SIGTERM, so only an escalation could stop it + const stubborn = yield* Scope.provide(scope)( + ChildProcess.make("sh", ["-c", "trap '' TERM; echo ready; sleep 30"]) + ) + const idle = yield* Scope.provide(scope)(ChildProcess.make("sleep", ["30"])) + yield* Effect.addFinalizer(() => + Effect.forEach([stubborn, idle], (handle) => killDescendant(-handle.pid), { discard: true }) + ) + const denied = yield* denySocketDirectoryRemoval + + yield* Stream.runHead(stubborn.stdout) + const killing = yield* Effect.forkChild(Effect.flip(stubborn.kill({ forceKillAfter: "30 seconds" }))) + while (signalsTo(stubborn.pid).length === 0) yield* Effect.sleep("5 millis") + process.kill(pid, "SIGKILL") + const error = yield* Fiber.join(killing).pipe(Effect.timeout("5 seconds")) + assert.strictEqual(error._tag, "PlatformError") + yield* Scope.close(scope, Exit.void) + + assert.isAbove(denied.length, 0) + assert.deepStrictEqual(signalsTo(stubborn.pid), ["SIGTERM"]) + assert.deepStrictEqual(signalsTo(idle.pid), []) + assert.notStrictEqual(yield* proxyPid, pid) + }).pipe(Effect.provide(ProxyServices), Effect.scoped) + ) + + it.live("retires proxy processes when credentials change even when socket directory removal fails", () => + Effect.gen(function*() { + const denied = yield* denySocketDirectoryRemoval + const changeCredentials = yield* credentialChanges + + // A busy retired proxy process still reports its command's exit + const first = yield* proxyPid + const running = yield* ChildProcess.make("sh", ["-c", "read line; exit 3"]) + changeCredentials() + const second = yield* proxyPid + assert.notStrictEqual(second, first) + yield* Stream.run(Stream.make(new TextEncoder().encode("\n")), running.stdin) + assert.strictEqual(yield* running.exitCode, 3) + + // An idle retired proxy process exits without waiting for commands + changeCredentials() + assert.notStrictEqual(yield* proxyPid, second) + while (isAlive(first) || isAlive(second)) yield* Effect.sleep("10 millis") + assert.isAbove(denied.length, 0) + }).pipe(Effect.provide(ProxyServices), Effect.scoped, Effect.timeout("5 seconds"))) + + it("fails a spawn whose exit is lost while its stdio sockets are pending", () => { + const released: Array = [] + const child = new ProxiedProcess({ ref() {}, unref() {}, release: (id) => released.push(id) }, 7, [true, true]) + const events: Array = [] + child.on("spawn", () => events.push("spawn")) + child.on("lost", () => events.push("lost")) + child.on("error", (error: Error) => events.push(`error: ${error.message}`)) + + const stdin = new Net.Socket() + assert.isTrue(child.attach(0, stdin)) + child.onSpawned(1234) + child.onLost(new Error("proxy exited"))() + + const lateStdout = new Net.Socket() + assert.isFalse(child.attach(1, lateStdout)) + lateStdout.destroy() + assert.deepStrictEqual(events, ["error: proxy exited"]) + assert.isTrue(stdin.destroyed) + assert.deepStrictEqual(released, [7]) + }) }) describe.skipIf(process.platform === "win32")("error descriptions", () => { @@ -43,6 +401,23 @@ describe.skipIf(process.platform === "win32")("error descriptions", () => { }) describe("Windows cleanup", { concurrent: false }, () => { + // Simulated on other platforms + it.live("fails to build the proxy process layer on Windows, and Layer.catch falls back to layer", () => + Effect.gen(function*() { + const platform = Object.getOwnPropertyDescriptor(process, "platform")! + yield* Effect.acquireRelease( + Effect.sync(() => Object.defineProperty(process, "platform", { value: "win32" })), + () => Effect.sync(() => Object.defineProperty(process, "platform", platform)) + ) + const error = yield* Effect.flip(Layer.build(NodeChildProcessSpawner.layerProxyProcess())) + assert.include(error.message, "not supported on Windows") + const context = yield* Layer.build( + NodeChildProcessSpawner.layerProxyProcess().pipe(Layer.catch(() => NodeChildProcessSpawner.layer)) + ) + assert.isTrue(Option.isSome(Context.getOption(context, ChildProcessSpawner))) + assert.isTrue(Option.isNone(Context.getOption(context, NodeChildProcessSpawner.ProxyProcess))) + }).pipe(Effect.provide(Layer.mergeAll(NodeFileSystem.layer, NodePath.layer)), Effect.scoped)) + for (const signal of [false, true]) { it.skipIf(signal && process.platform === "win32")( `does not taskkill a ${signal ? "signal-terminated" : "failed"} child during exit, kill or scope release`, @@ -82,6 +457,17 @@ describe("Windows cleanup", { concurrent: false }, () => { } }) +const assertNoProcessGroupSignals = Effect.fnUntraced( + function*(spawn: Effect.Effect<{ readonly pid: number }, E, R>) { + const kill = vi.spyOn(process, "kill") + yield* Effect.addFinalizer(() => Effect.sync(() => kill.mockRestore())) + const { pid } = yield* Effect.scoped(spawn) + assert.deepStrictEqual(kill.mock.calls.filter(([target]) => target === -pid), []) + }, + Effect.scoped, + Effect.provide(NodeServices) +) + describe.skipIf(process.platform === "win32")("non-detached exit cleanup", { concurrent: false }, () => { for (const signal of [false, true]) { it.live( @@ -89,44 +475,32 @@ describe.skipIf(process.platform === "win32")("non-detached exit cleanup", { con signal ? "signal-terminated" : "failed" } child during exit, kill or scope release`, () => - Effect.gen(function*() { - const kill = vi.spyOn(process, "kill") - yield* Effect.addFinalizer(() => Effect.sync(() => kill.mockRestore())) - let pid = 0 - yield* Effect.scoped(Effect.gen(function*() { - const handle = yield* ChildProcess.make(process.execPath, [ - "-e", - signal ? "process.kill(process.pid, 'SIGTERM')" : "process.exit(1)" - ], { detached: false, forceKillAfter: "100 millis" }) - pid = handle.pid - if (signal) { - assert.isTrue(Exit.isFailure(yield* Effect.exit(handle.exitCode))) - } else { - assert.strictEqual(yield* handle.exitCode, 1) - } - // The exited child's PID may now lead an unrelated process group. - yield* Effect.ignore(handle.kill()) - })) - assert.deepStrictEqual(kill.mock.calls.filter(([target]) => target === -pid), []) - }).pipe(Effect.scoped, Effect.provide(NodeServices)) + assertNoProcessGroupSignals(Effect.gen(function*() { + const handle = yield* ChildProcess.make(process.execPath, [ + "-e", + signal ? "process.kill(process.pid, 'SIGTERM')" : "process.exit(1)" + ], { detached: false, forceKillAfter: "100 millis" }) + if (signal) { + assert.isTrue(Exit.isFailure(yield* Effect.exit(handle.exitCode))) + } else { + assert.strictEqual(yield* handle.exitCode, 1) + } + // The exited child's PID may now lead an unrelated process group. + yield* Effect.ignore(handle.kill()) + return handle + })) ) } - it.live("does not poll or force kill the process group of a child that exits during scope release", () => - Effect.gen(function*() { - const kill = vi.spyOn(process, "kill") - yield* Effect.addFinalizer(() => Effect.sync(() => kill.mockRestore())) - let pid = 0 - yield* Effect.scoped(Effect.gen(function*() { - const handle = yield* ChildProcess.make(process.execPath, ["-e", "setInterval(() => {}, 1000)"], { - detached: false, - forceKillAfter: "1 second" - }) - pid = handle.pid - })) - // Signalling the live child is fine; polling or escalating after it exits is not. - assert.deepStrictEqual(kill.mock.calls.filter(([target, signal]) => target === -pid && signal !== "SIGTERM"), []) - }).pipe(Effect.scoped, Effect.provide(NodeServices))) + it.live("does not signal or poll the process group when terminating a running child", () => + assertNoProcessGroupSignals(Effect.gen(function*() { + const handle = yield* ChildProcess.make(process.execPath, [ + "-e", + "process.on('SIGTERM', () => {}); console.log('READY'); setInterval(() => {}, 1000)" + ], { detached: false, forceKillAfter: "100 millis" }) + yield* Stream.runHead(handle.stdout) + return handle + }))) }) const zombieProbes = 3 diff --git a/.repos/effect/packages/platform/node-shared/test/NodeFileSystem.test.ts b/.repos/effect/packages/platform/node-shared/test/NodeFileSystem.test.ts index 580b7f4849390..4cfab17abef32 100644 --- a/.repos/effect/packages/platform/node-shared/test/NodeFileSystem.test.ts +++ b/.repos/effect/packages/platform/node-shared/test/NodeFileSystem.test.ts @@ -9,6 +9,7 @@ import * as Layer from "effect/Layer" import * as Option from "effect/Option" import * as Stream from "effect/Stream" import * as TestClock from "effect/testing/TestClock" +import * as ChildProcess from "node:child_process" import * as NFS from "node:fs" import * as Path from "node:path" import { afterEach, beforeEach, vi } from "vitest" @@ -91,6 +92,26 @@ describe("FileSystem", { concurrent: false }, () => { Effect.provide(NodeFileSystem.layer) )) + it.effect.skipIf(process.platform === "win32")( + "File handles and stream read and write a FIFO sequentially", + () => + Effect.gen(function*() { + const fs = yield* FileSystem.FileSystem + const fifo = Path.join(yield* fs.makeTempDirectoryScoped(), "fifo") + ChildProcess.execFileSync("mkfifo", [fifo]) + + const [text] = yield* Effect.all([ + fs.stream(fifo).pipe(Stream.decodeText(), Stream.mkString), + Effect.scoped( + Effect.flatMap(fs.open(fifo, { flag: "w" }), (file) => file.writeAll(Buffer.from("piped text"))) + ) + ], { concurrency: 2 }) + assert.strictEqual(text, "piped text") + }).pipe( + Effect.provide(NodeFileSystem.layer) + ) + ) + it.effect("watch reports Create for a new file outside the current directory", () => Effect.gen(function*() { const fs = yield* FileSystem.FileSystem @@ -202,7 +223,8 @@ describe("FileSystem", { concurrent: false }, () => { const state = vi.hoisted(() => ({ enabled: false, values: {} as Record, - positions: [] as Array + positions: [] as Array, + writes: [] as Array })) vi.mock("node:fs", async (importOriginal) => { @@ -235,10 +257,11 @@ vi.mock("node:fs", async (importOriginal) => { _offset: unknown, _length: unknown, position: number | bigint | undefined, - callback: (error: null, bytesWritten: number) => void + callback: (error: NodeJS.ErrnoException | null, bytesWritten?: number) => void ) => { state.positions.push(position) - callback(null, 1) + const result = state.writes.shift() ?? 1 + return typeof result === "number" ? callback(null, result) : callback(result) } } return { @@ -263,6 +286,7 @@ describe("NodeFileSystem precision", { concurrent: false }, () => { beforeEach(() => { state.enabled = true state.positions = [] + state.writes = [] state.values = { size: 4n, blksize: 4096n, @@ -300,6 +324,16 @@ describe("NodeFileSystem precision", { concurrent: false }, () => { assert.strictEqual(yield* file.seek(0n, "current"), maxSafe + 1n) }).pipe(Effect.provide(NodeFileSystem.layer))) + it.effect("writeAll does not rewrite bytes when a later chunk fails with ESPIPE", () => + Effect.gen(function*() { + const espipe = Object.assign(new Error("ESPIPE"), { code: "ESPIPE" }) + state.writes = [1, espipe, espipe] + const fs = yield* FileSystem.FileSystem + const file = yield* fs.open("precision.bin", { flag: "r+" }) + yield* Effect.flip(file.writeAll(new Uint8Array([1, 2, 3]))) + assert.deepStrictEqual(state.positions, [0, 1, undefined]) + }).pipe(Effect.provide(NodeFileSystem.layer))) + for (const method of ["stat", "fstat"] as const) { const getInfo = Effect.gen(function*() { const fs = yield* FileSystem.FileSystem diff --git a/.repos/effect/packages/platform/node-shared/test/NodeStdio.test.ts b/.repos/effect/packages/platform/node-shared/test/NodeStdio.test.ts index 5d7d2ce2b87d3..c47c356af4080 100644 --- a/.repos/effect/packages/platform/node-shared/test/NodeStdio.test.ts +++ b/.repos/effect/packages/platform/node-shared/test/NodeStdio.test.ts @@ -2,8 +2,11 @@ import * as NodeStdio from "@effect/platform-node-shared/NodeStdio" import { assert, describe, it } from "@effect/vitest" import * as Effect from "effect/Effect" import * as Stdio from "effect/Stdio" +import { spawn } from "node:child_process" +import { join } from "node:path" const streams = [process.stdin, process.stdout, process.stderr] as const +const fixture = join(__dirname, "fixtures", "node-stdio.ts") const setIsTTY = (stdin: boolean, stdout: boolean, stderr: boolean | undefined) => Effect.sync(() => { @@ -50,4 +53,27 @@ describe("NodeStdio", () => { assert.isFalse(yield* stdio.stderrIsTerminal) }).pipe(Effect.provide(NodeStdio.layer)) )) + + it.effect( + "exits when stdin consumers stop while the pipe stays open and supports later reads", + () => + Effect.callback((resume) => { + const child = spawn(process.execPath, [fixture], { stdio: ["pipe", "pipe", "inherit"] }) + let stdout = "" + child.stdout.setEncoding("utf8") + child.stdout.on("data", (data) => { + stdout += data + if (stdout === "a") { + child.stdin.write("b") + } + }) + child.on("error", (error) => resume(Effect.die(error))) + child.on("close", (code) => { + resume(Effect.sync(() => assert.deepStrictEqual({ code, stdout }, { code: 0, stdout: "ab" }))) + }) + child.stdin.write("a") + return Effect.sync(() => child.kill()) + }), + { timeout: 15_000 } + ) }) diff --git a/.repos/effect/packages/platform/node-shared/test/fixtures/node-stdio.ts b/.repos/effect/packages/platform/node-shared/test/fixtures/node-stdio.ts new file mode 100644 index 0000000000000..865b779f96371 --- /dev/null +++ b/.repos/effect/packages/platform/node-shared/test/fixtures/node-stdio.ts @@ -0,0 +1,18 @@ +import * as NodeStdio from "@effect/platform-node-shared/NodeStdio" +import * as Effect from "effect/Effect" +import * as Stdio from "effect/Stdio" +import * as Stream from "effect/Stream" + +const program = Effect.gen(function*() { + const stdio = yield* Stdio.Stdio + const echoChunk = stdio.stdin.pipe(Stream.take(1), Stream.run(stdio.stdout())) + + yield* echoChunk + // Let the deferred pause run, so the next read resumes a paused stdin. + yield* Effect.sleep("20 millis") + yield* echoChunk + + yield* stdio.stdin.pipe(Stream.runDrain, Effect.timeoutOption("50 millis")) +}).pipe(Effect.provide(NodeStdio.layer)) + +void Effect.runPromise(program) diff --git a/.repos/effect/packages/platform/node-shared/test/fixtures/proxy-cli.ts b/.repos/effect/packages/platform/node-shared/test/fixtures/proxy-cli.ts new file mode 100644 index 0000000000000..1b8d49b2939d9 --- /dev/null +++ b/.repos/effect/packages/platform/node-shared/test/fixtures/proxy-cli.ts @@ -0,0 +1,20 @@ +// The entry point of a packaged application, which dispatches its private +// subcommand before it loads the application +import { syncBuiltinESMExports } from "node:module" +import Vm from "node:vm" + +// The test runs this under --disallow-code-generation-from-strings, which +// does not restrict node:vm, so the proxy process must not use it either +const forbidden = () => { + throw new Error("The proxy process compiled code at runtime") +} +Vm.runInThisContext = forbidden +Vm.Script = forbidden as unknown as typeof Vm.Script +syncBuiltinESMExports() + +if (process.argv[2] === "__proxy-process") { + const { run } = await import("@effect/platform-node-shared/NodeChildProcessProxy") + run() +} else { + throw new Error("The proxy process must not load the application") +} diff --git a/.repos/effect/packages/platform/node/CHANGELOG.md b/.repos/effect/packages/platform/node/CHANGELOG.md index fbc6a4ee27578..a89002142797e 100644 --- a/.repos/effect/packages/platform/node/CHANGELOG.md +++ b/.repos/effect/packages/platform/node/CHANGELOG.md @@ -1,5 +1,16 @@ # @effect/platform-node +## 4.1.6 + +### Patch Changes + +- [#10886](https://github.com/Effect-TS/effect/pull/10886) [`2576bbc`](https://github.com/Effect-TS/effect/commit/2576bbcbe89fec2362240280e4db2bc371f978e3) Thanks @effect-bot! - Add `NodeChildProcessSpawner.layerProxyProcess`, which launches commands from a small proxy process, for Node.js builds where spawning from a process holding a lot of memory stalls the event loop. The layer also provides `NodeChildProcessSpawner.ProxyProcess`, which reports the proxy process ID, and packaged applications can run the proxy process from their own entry point with `NodeChildProcessProxy.run`. + +- [#10851](https://github.com/Effect-TS/effect/pull/10851) [`bb02f33`](https://github.com/Effect-TS/effect/commit/bb02f33a66309e62999d16fb87a3278157dd2e79) Thanks @effect-bot! - Update repository dependencies to their latest compatible releases. +- Updated dependencies [[`dd5f2f3`](https://github.com/Effect-TS/effect/commit/dd5f2f322fbad042a3a186cef593bf42affe5ce9), [`1d65846`](https://github.com/Effect-TS/effect/commit/1d65846308a6a18c4a95af543988ad30b72ff2b3), [`694c28f`](https://github.com/Effect-TS/effect/commit/694c28f0cfc3eac33f71160d18dda95cb670f506), [`5aaa2cd`](https://github.com/Effect-TS/effect/commit/5aaa2cd216e5e55f92d06db98d4b54946a396eed), [`55814bf`](https://github.com/Effect-TS/effect/commit/55814bf0a780f05ed0a51c82c8affda5d539bb0e), [`92c40a1`](https://github.com/Effect-TS/effect/commit/92c40a1f96a59f9edcacee6c0d6f6fb80397ee17), [`9f415a7`](https://github.com/Effect-TS/effect/commit/9f415a7733cdf8aed7efadbed3b5db22890e164a), [`e367afd`](https://github.com/Effect-TS/effect/commit/e367afdacfa3041a694a67e4670e98a20e41d45c), [`d5d2112`](https://github.com/Effect-TS/effect/commit/d5d21120ff591fcf8da006ce340010812cc91f16), [`fa2e5af`](https://github.com/Effect-TS/effect/commit/fa2e5af4ccc8f3650d97049707be82eab098c168), [`6bf6427`](https://github.com/Effect-TS/effect/commit/6bf6427d195539c387c13156aff79db077929c8f), [`10bc4a4`](https://github.com/Effect-TS/effect/commit/10bc4a47c0ce5bc50ba1998d63a803e3887d1d2b), [`a9540d3`](https://github.com/Effect-TS/effect/commit/a9540d3d50fbe65ade7f9b2f478cdd34a888161e), [`3a250d7`](https://github.com/Effect-TS/effect/commit/3a250d7eb8c310bf4751b3eca0038cf50e1629d8), [`ce44141`](https://github.com/Effect-TS/effect/commit/ce44141ad1bc8d05f3f7399bfa1e87772573205d), [`9318e5b`](https://github.com/Effect-TS/effect/commit/9318e5bafb144ddff65a0bff0148ec4f7ba77b5c), [`24ff77b`](https://github.com/Effect-TS/effect/commit/24ff77bbec6ebfe991fda20393c895734ef166ba), [`c9ecebf`](https://github.com/Effect-TS/effect/commit/c9ecebf7ede8a98895552fd20223d6573bd846fe), [`32f8fbe`](https://github.com/Effect-TS/effect/commit/32f8fbe1a5985aea41754e87531e9a1d0fbf78ec), [`41d6af1`](https://github.com/Effect-TS/effect/commit/41d6af14b7f36e06ade3bf7333b710e73de1e1c2), [`c33fd59`](https://github.com/Effect-TS/effect/commit/c33fd599cb7d49117f77f7bd8f05cb4209112a34), [`1f9e9d3`](https://github.com/Effect-TS/effect/commit/1f9e9d3de552435de6b8f4e1166515d0964c3999), [`594fa71`](https://github.com/Effect-TS/effect/commit/594fa71da417bf94fa6c9be2d3d36c808197e9fe), [`b378c38`](https://github.com/Effect-TS/effect/commit/b378c383cdb29e819e24da5dc725479a2ba4fdf1), [`a9ec9a6`](https://github.com/Effect-TS/effect/commit/a9ec9a60bbe1309960e00527ab62342dce1a86fc), [`310a81b`](https://github.com/Effect-TS/effect/commit/310a81b391e24d42b6608b5e3d641eca63e0d4c0), [`2576bbc`](https://github.com/Effect-TS/effect/commit/2576bbcbe89fec2362240280e4db2bc371f978e3), [`f409e90`](https://github.com/Effect-TS/effect/commit/f409e9068a4ce2991d0a724187b11b98ae4dd222), [`3498c76`](https://github.com/Effect-TS/effect/commit/3498c76f0968bb32167d0d8a0d6c3888fa733f83), [`aab2135`](https://github.com/Effect-TS/effect/commit/aab2135d3fe43d4d86c4e486ed378797314fb212), [`6744a72`](https://github.com/Effect-TS/effect/commit/6744a724869539fc2d733929df871ef523bf82e8), [`13659f7`](https://github.com/Effect-TS/effect/commit/13659f7245ca526e474403e8066941198c49773d), [`848d042`](https://github.com/Effect-TS/effect/commit/848d0426f287b3e7ff970219d980a4c66fa441ad), [`077a93e`](https://github.com/Effect-TS/effect/commit/077a93e5db3adbc42e531539cb12b8bdbdfe5328), [`aef50fb`](https://github.com/Effect-TS/effect/commit/aef50fb8b56ec9ff8116f157635579fefd995f26), [`2e4de86`](https://github.com/Effect-TS/effect/commit/2e4de8634431f3da08ca2a90ab1024ee08e216f3), [`482b104`](https://github.com/Effect-TS/effect/commit/482b104caf712a8d5f99aafc64e55b6ea38eb809), [`753e1ed`](https://github.com/Effect-TS/effect/commit/753e1ed88069f73103d136dcdc58188fd10efdf1), [`0d2bb4a`](https://github.com/Effect-TS/effect/commit/0d2bb4a4b6526e1767b81101ee6e8da88ba1de55), [`8161e03`](https://github.com/Effect-TS/effect/commit/8161e03c26d691502afeddcf7e2ee75e6931637f), [`9b7b7c2`](https://github.com/Effect-TS/effect/commit/9b7b7c2d1afe85b6f4e61b9af19d9a0e9c9cec82), [`49f5391`](https://github.com/Effect-TS/effect/commit/49f53918a150aa2ea0ce2d444400cec1d6097400), [`3d59bdf`](https://github.com/Effect-TS/effect/commit/3d59bdf6f8f95ceea2091e5b8f375b834a14b3b1), [`8866608`](https://github.com/Effect-TS/effect/commit/88666082f2b6296bb7115bd4a2546151039f64db), [`69fd4b1`](https://github.com/Effect-TS/effect/commit/69fd4b1fba9e2ec5e7c16058ff8d9a1f9a38d90e), [`7d97626`](https://github.com/Effect-TS/effect/commit/7d9762658e515807c2b98678e7abd3ebe94e41ec), [`0e79436`](https://github.com/Effect-TS/effect/commit/0e794366658bd067a2212ea2ac7ed0223904ed31), [`2f8a4e9`](https://github.com/Effect-TS/effect/commit/2f8a4e9b90822d9facfef59027b35819c42d7b48), [`800b753`](https://github.com/Effect-TS/effect/commit/800b7535b4e37a24ac458cae78231054dae0b0f5)]: + - effect@4.1.6 + - @effect/platform-node-shared@4.1.6 + ## 4.1.5 ### Patch Changes diff --git a/.repos/effect/packages/platform/node/package.json b/.repos/effect/packages/platform/node/package.json index 3c1140501d464..a184e3fbda504 100644 --- a/.repos/effect/packages/platform/node/package.json +++ b/.repos/effect/packages/platform/node/package.json @@ -1,7 +1,7 @@ { "name": "@effect/platform-node", "type": "module", - "version": "4.1.5", + "version": "4.1.6", "license": "MIT", "description": "Platform specific implementations for the Node.js runtime", "homepage": "https://effect.website", @@ -67,20 +67,20 @@ }, "dependencies": { "@effect/platform-node-shared": "workspace:*", - "undici": "^8.12.4" + "undici": "^8.13.1" }, "peerDependencies": { "effect": "workspace:^", "redis": ">=5.1.0 <7.0.0" }, "devDependencies": { - "@testcontainers/mssqlserver": "^12.2.1", - "@testcontainers/mysql": "^12.2.1", - "@testcontainers/postgresql": "^12.2.1", - "@testcontainers/redis": "^12.2.1", + "@testcontainers/mssqlserver": "^12.2.2", + "@testcontainers/mysql": "^12.2.2", + "@testcontainers/postgresql": "^12.2.2", + "@testcontainers/redis": "^12.2.2", "@types/node": "^26.6.6", "effect": "workspace:^", "redis": "^6.3.1", - "testcontainers": "^12.2.1" + "testcontainers": "^12.2.2" } } diff --git a/.repos/effect/packages/platform/node/src/NodeChildProcessProxy.ts b/.repos/effect/packages/platform/node/src/NodeChildProcessProxy.ts new file mode 100644 index 0000000000000..6375bc1d37c04 --- /dev/null +++ b/.repos/effect/packages/platform/node/src/NodeChildProcessProxy.ts @@ -0,0 +1,9 @@ +/** + * The program of the proxy process started by + * `NodeChildProcessSpawner.layerProxyProcess`, for applications that start it + * themselves. + * + * @stability unstable + * @since 4.1.6 + */ +export * from "@effect/platform-node-shared/NodeChildProcessProxy" diff --git a/.repos/effect/packages/platform/node/src/index.ts b/.repos/effect/packages/platform/node/src/index.ts index f34dadb5f3dbe..b8f73792f1a86 100644 --- a/.repos/effect/packages/platform/node/src/index.ts +++ b/.repos/effect/packages/platform/node/src/index.ts @@ -11,6 +11,12 @@ */ export * as NodeAddressResolver from "./NodeAddressResolver.ts" +/** + * @stability unstable + * @since 4.1.6 + */ +export * as NodeChildProcessProxy from "./NodeChildProcessProxy.ts" + /** * @stability unstable * @since 4.0.0 diff --git a/.repos/effect/packages/platform/node/test/KeyValueStore.test.ts b/.repos/effect/packages/platform/node/test/KeyValueStore.test.ts index ceb4b15ab5059..ddbf47f945df1 100644 --- a/.repos/effect/packages/platform/node/test/KeyValueStore.test.ts +++ b/.repos/effect/packages/platform/node/test/KeyValueStore.test.ts @@ -87,4 +87,21 @@ describe("KeyValueStore / layerFileSystem", () => { }).pipe( Effect.provide(NodeFileSystem.layer) )) + + it.effect("string values keep a leading U+FEFF", () => + Effect.gen(function*() { + const fs = yield* FileSystem.FileSystem + const directory = yield* fs.makeTempDirectoryScoped() + const value = "\uFEFFhello" + + yield* Effect.gen(function*() { + const store = yield* KeyValueStore.KeyValueStore + yield* store.set("bom", value) + assert.strictEqual(yield* store.get("bom"), value) + }).pipe( + Effect.provide(KeyValueStore.layerFileSystem(directory).pipe(Layer.provide(platformLayer))) + ) + }).pipe( + Effect.provide(NodeFileSystem.layer) + )) }) diff --git a/.repos/effect/packages/platform/node/test/NodeHttpClient.test.ts b/.repos/effect/packages/platform/node/test/NodeHttpClient.test.ts index 8eee3569df4a5..82e61ad850890 100644 --- a/.repos/effect/packages/platform/node/test/NodeHttpClient.test.ts +++ b/.repos/effect/packages/platform/node/test/NodeHttpClient.test.ts @@ -104,7 +104,11 @@ const LocalServerRoutes = HttpRouter.serve(HttpRouter.addAll([ return HttpServerResponse.jsonUnsafe({ ...todo, id: 201 }) }) ), - HttpRouter.route("GET", "/text", Effect.succeed(HttpServerResponse.text("test"))), + HttpRouter.route( + "GET", + "/text", + (request) => Effect.succeed(HttpServerResponse.text("test", { headers: { "x-url": request.url } })) + ), HttpRouter.route( "QUERY", "/search", @@ -217,6 +221,7 @@ const LocalServerRoutes = HttpRouter.serve(HttpRouter.addAll([ assert.strictEqual(url.pathname, "/text") assert.strictEqual(url.search, "?existing=1&value=a%23b") assert.strictEqual(url.hash, "") + assert.strictEqual(response.headers["x-url"], "/text?existing=1&value=a%23b") expect(yield* response.text).toBe("test") }).pipe(Effect.provide(localServerTestLayer))) diff --git a/.repos/effect/packages/platform/node/test/NodeRedis.integration.test.ts b/.repos/effect/packages/platform/node/test/NodeRedis.integration.test.ts index 47cc3c9256849..d27e14e930d6e 100644 --- a/.repos/effect/packages/platform/node/test/NodeRedis.integration.test.ts +++ b/.repos/effect/packages/platform/node/test/NodeRedis.integration.test.ts @@ -47,7 +47,7 @@ PersistedQueueTest.suite( pollInterval: "50 millis", lockRefreshInterval: "100 millis" }).pipe(Layer.provide(RedisLayer)), - { cleanupUsesClock: true } + { cleanupUsesClock: true, nonDeliveryWait: "250 millis" } ) RateLimiterTest.suite( diff --git a/.repos/effect/packages/platform/node/test/cluster/SqlMessageStorage.integration.test.ts b/.repos/effect/packages/platform/node/test/cluster/SqlMessageStorage.integration.test.ts index 5c2405b9d48f2..e7e97d94d5d54 100644 --- a/.repos/effect/packages/platform/node/test/cluster/SqlMessageStorage.integration.test.ts +++ b/.repos/effect/packages/platform/node/test/cluster/SqlMessageStorage.integration.test.ts @@ -1,7 +1,7 @@ import { NodeCrypto, NodeFileSystem } from "@effect/platform-node" import { SqliteClient } from "@effect/sql-sqlite-node" import { assert, describe, expect, it } from "@effect/vitest" -import { Effect, Exit, Fiber, FileSystem, Latch, Layer, Option } from "effect" +import { Effect, Exit, Fiber, FileSystem, Latch, Layer, Option, Schema } from "effect" import { Entity, EntityAddress, @@ -20,6 +20,7 @@ import { SqlMessageStorage } from "effect/cluster" import { Reactivity } from "effect/reactivity" +import { Rpc } from "effect/rpc" import { SqlClient, Statement } from "effect/sql" import { TestClock } from "effect/testing" import { MssqlContainer } from "../fixtures/mssql-utils.ts" @@ -490,6 +491,62 @@ describe("SqlMessageStorage", () => { ) expect(Exit.isFailure(exit)).toBe(true) })) + + it.effect( + "saveRequest returns Duplicate under REPEATABLE READ when another tx commits the same primary key", + () => + Effect.gen(function*() { + yield* truncate + const sql = yield* SqlClient.SqlClient + const storage = yield* MessageStorage.MessageStorage + const [{ isolation }] = yield* sql<{ isolation: string }>`SELECT @@transaction_isolation AS isolation` + expect(isolation).toEqual("REPEATABLE-READ") + + const reqA = yield* makeRequest({ + rpc: PrimaryKeyTest, + payload: PrimaryKeyTest.payloadSchema.make({ id: 123 }) + }) + const reqB = yield* makeRequest({ + rpc: PrimaryKeyTest, + payload: PrimaryKeyTest.payloadSchema.make({ id: 123 }) + }) + const bSawEmpty = yield* Latch.make() + const aCommitted = yield* Latch.make() + + const txA = yield* storage.withTransaction(Effect.gen(function*() { + const existing = yield* storage.requestIdForPrimaryKey({ + address: reqA.envelope.address, + tag: reqA.envelope.tag, + id: "123" + }) + expect(existing).toEqual(Option.none()) + yield* bSawEmpty.await + return yield* storage.saveRequest(reqA) + })).pipe( + Effect.tap(() => aCommitted.open), + Effect.forkChild({ startImmediately: true }) + ) + + const txB = yield* storage.withTransaction(Effect.gen(function*() { + const existing = yield* storage.requestIdForPrimaryKey({ + address: reqB.envelope.address, + tag: reqB.envelope.tag, + id: "123" + }) + expect(existing).toEqual(Option.none()) + yield* bSawEmpty.open + yield* aCommitted.await + return yield* storage.saveRequest(reqB) + })).pipe(Effect.forkChild({ startImmediately: true })) + + const savedA = yield* Fiber.join(txA).pipe(Effect.timeout("10 seconds")) + const savedB = yield* Fiber.join(txB).pipe(Effect.timeout("10 seconds")) + expect(savedA._tag).toEqual("Success") + assert(savedB._tag === "Duplicate") + expect(savedB.originalId).toEqual(reqA.envelope.requestId) + }).pipe(TestClock.withLive), + { timeout: 30_000 } + ) } if (label === "mssql") { @@ -1251,6 +1308,56 @@ describe("SqlMessageStorage", () => { messages = yield* storage.unprocessedMessagesById([request.envelope.requestId]) expect(messages).toHaveLength(0) })) + + it.effect("requestsForAddress matches type, id and tag exactly and ignores the shard", () => + Effect.gen(function*() { + yield* truncate + + const storage = yield* MessageStorage.MessageStorage + const address = { entityType: "Workflow/Child", entityId: "Id" } + const request = (id: string, options?: { + readonly rpc?: Rpc.AnyWithProps + readonly entityType?: string + readonly entityId?: string + readonly shardId?: ShardId.ShardId + }) => + makeRequest({ + rpc: options?.rpc ?? LongKeyRpc, + payload: options?.rpc ? { id } : LongKeyRpc.payloadSchema.make({ id }), + entityType: options?.entityType ?? address.entityType, + entityId: options?.entityId ?? address.entityId, + shardId: options?.shardId + }) + const longId = "long-key-".repeat(50) + const unprocessed = yield* request(longId) + const processed = yield* request("short-key") + const otherShard = yield* request("other-shard", { shardId: ShardId.make("default", 2) }) + const others = [ + yield* request("other-tag", { rpc: Rpc.make("OtherTag", { payload: { id: Schema.String } }) }), + // Collations may ignore case, accents or trailing spaces. + yield* request("tag-case", { rpc: Rpc.make("longkeyrpc", { payload: { id: Schema.String } }) }), + yield* request("tag-space", { rpc: Rpc.make("LongKeyRpc ", { payload: { id: Schema.String } }) }), + yield* request("type-case", { entityType: "Workflow/child" }), + yield* request("type-space", { entityType: "Workflow/Child " }), + yield* request("id-case", { entityId: "id" }), + yield* request("id-accent", { entityId: "Íd" }), + yield* request("id-space", { entityId: "Id " }) + ] + + yield* storage.saveRequest(unprocessed) + yield* storage.saveRequest(processed) + yield* storage.saveReply(yield* makeReply(processed)) + yield* storage.saveRequest(otherShard) + for (const other of others) yield* storage.saveRequest(other) + + const found = yield* storage.requestsForAddress({ + address: unprocessed.envelope.address, + tag: LongKeyRpc._tag + }) + expect(found.map((r) => (r.payload as { readonly id: string }).id).sort()).toEqual( + [longId, "other-shard", "short-key"].sort() + ) + })) }) }) diff --git a/.repos/effect/packages/sql/clickhouse/CHANGELOG.md b/.repos/effect/packages/sql/clickhouse/CHANGELOG.md index 91fb956e7f1e4..abe99a93e3cfb 100644 --- a/.repos/effect/packages/sql/clickhouse/CHANGELOG.md +++ b/.repos/effect/packages/sql/clickhouse/CHANGELOG.md @@ -1,5 +1,13 @@ # @effect/sql-clickhouse +## 4.1.6 + +### Patch Changes + +- Updated dependencies [[`dd5f2f3`](https://github.com/Effect-TS/effect/commit/dd5f2f322fbad042a3a186cef593bf42affe5ce9), [`1d65846`](https://github.com/Effect-TS/effect/commit/1d65846308a6a18c4a95af543988ad30b72ff2b3), [`694c28f`](https://github.com/Effect-TS/effect/commit/694c28f0cfc3eac33f71160d18dda95cb670f506), [`5aaa2cd`](https://github.com/Effect-TS/effect/commit/5aaa2cd216e5e55f92d06db98d4b54946a396eed), [`55814bf`](https://github.com/Effect-TS/effect/commit/55814bf0a780f05ed0a51c82c8affda5d539bb0e), [`92c40a1`](https://github.com/Effect-TS/effect/commit/92c40a1f96a59f9edcacee6c0d6f6fb80397ee17), [`9f415a7`](https://github.com/Effect-TS/effect/commit/9f415a7733cdf8aed7efadbed3b5db22890e164a), [`e367afd`](https://github.com/Effect-TS/effect/commit/e367afdacfa3041a694a67e4670e98a20e41d45c), [`d5d2112`](https://github.com/Effect-TS/effect/commit/d5d21120ff591fcf8da006ce340010812cc91f16), [`fa2e5af`](https://github.com/Effect-TS/effect/commit/fa2e5af4ccc8f3650d97049707be82eab098c168), [`6bf6427`](https://github.com/Effect-TS/effect/commit/6bf6427d195539c387c13156aff79db077929c8f), [`10bc4a4`](https://github.com/Effect-TS/effect/commit/10bc4a47c0ce5bc50ba1998d63a803e3887d1d2b), [`a9540d3`](https://github.com/Effect-TS/effect/commit/a9540d3d50fbe65ade7f9b2f478cdd34a888161e), [`3a250d7`](https://github.com/Effect-TS/effect/commit/3a250d7eb8c310bf4751b3eca0038cf50e1629d8), [`ce44141`](https://github.com/Effect-TS/effect/commit/ce44141ad1bc8d05f3f7399bfa1e87772573205d), [`9318e5b`](https://github.com/Effect-TS/effect/commit/9318e5bafb144ddff65a0bff0148ec4f7ba77b5c), [`c9ecebf`](https://github.com/Effect-TS/effect/commit/c9ecebf7ede8a98895552fd20223d6573bd846fe), [`32f8fbe`](https://github.com/Effect-TS/effect/commit/32f8fbe1a5985aea41754e87531e9a1d0fbf78ec), [`41d6af1`](https://github.com/Effect-TS/effect/commit/41d6af14b7f36e06ade3bf7333b710e73de1e1c2), [`c33fd59`](https://github.com/Effect-TS/effect/commit/c33fd599cb7d49117f77f7bd8f05cb4209112a34), [`1f9e9d3`](https://github.com/Effect-TS/effect/commit/1f9e9d3de552435de6b8f4e1166515d0964c3999), [`594fa71`](https://github.com/Effect-TS/effect/commit/594fa71da417bf94fa6c9be2d3d36c808197e9fe), [`b378c38`](https://github.com/Effect-TS/effect/commit/b378c383cdb29e819e24da5dc725479a2ba4fdf1), [`a9ec9a6`](https://github.com/Effect-TS/effect/commit/a9ec9a60bbe1309960e00527ab62342dce1a86fc), [`310a81b`](https://github.com/Effect-TS/effect/commit/310a81b391e24d42b6608b5e3d641eca63e0d4c0), [`2576bbc`](https://github.com/Effect-TS/effect/commit/2576bbcbe89fec2362240280e4db2bc371f978e3), [`aab2135`](https://github.com/Effect-TS/effect/commit/aab2135d3fe43d4d86c4e486ed378797314fb212), [`6744a72`](https://github.com/Effect-TS/effect/commit/6744a724869539fc2d733929df871ef523bf82e8), [`848d042`](https://github.com/Effect-TS/effect/commit/848d0426f287b3e7ff970219d980a4c66fa441ad), [`077a93e`](https://github.com/Effect-TS/effect/commit/077a93e5db3adbc42e531539cb12b8bdbdfe5328), [`aef50fb`](https://github.com/Effect-TS/effect/commit/aef50fb8b56ec9ff8116f157635579fefd995f26), [`2e4de86`](https://github.com/Effect-TS/effect/commit/2e4de8634431f3da08ca2a90ab1024ee08e216f3), [`482b104`](https://github.com/Effect-TS/effect/commit/482b104caf712a8d5f99aafc64e55b6ea38eb809), [`753e1ed`](https://github.com/Effect-TS/effect/commit/753e1ed88069f73103d136dcdc58188fd10efdf1), [`0d2bb4a`](https://github.com/Effect-TS/effect/commit/0d2bb4a4b6526e1767b81101ee6e8da88ba1de55), [`8161e03`](https://github.com/Effect-TS/effect/commit/8161e03c26d691502afeddcf7e2ee75e6931637f), [`bb02f33`](https://github.com/Effect-TS/effect/commit/bb02f33a66309e62999d16fb87a3278157dd2e79), [`49f5391`](https://github.com/Effect-TS/effect/commit/49f53918a150aa2ea0ce2d444400cec1d6097400), [`3d59bdf`](https://github.com/Effect-TS/effect/commit/3d59bdf6f8f95ceea2091e5b8f375b834a14b3b1), [`8866608`](https://github.com/Effect-TS/effect/commit/88666082f2b6296bb7115bd4a2546151039f64db), [`69fd4b1`](https://github.com/Effect-TS/effect/commit/69fd4b1fba9e2ec5e7c16058ff8d9a1f9a38d90e), [`7d97626`](https://github.com/Effect-TS/effect/commit/7d9762658e515807c2b98678e7abd3ebe94e41ec), [`0e79436`](https://github.com/Effect-TS/effect/commit/0e794366658bd067a2212ea2ac7ed0223904ed31), [`2f8a4e9`](https://github.com/Effect-TS/effect/commit/2f8a4e9b90822d9facfef59027b35819c42d7b48), [`800b753`](https://github.com/Effect-TS/effect/commit/800b7535b4e37a24ac458cae78231054dae0b0f5)]: + - effect@4.1.6 + - @effect/platform-node@4.1.6 + ## 4.1.5 ### Patch Changes diff --git a/.repos/effect/packages/sql/clickhouse/package.json b/.repos/effect/packages/sql/clickhouse/package.json index 50786ff9d8154..222be0a619426 100644 --- a/.repos/effect/packages/sql/clickhouse/package.json +++ b/.repos/effect/packages/sql/clickhouse/package.json @@ -1,6 +1,6 @@ { "name": "@effect/sql-clickhouse", - "version": "4.1.5", + "version": "4.1.6", "type": "module", "license": "MIT", "description": "A Clickhouse toolkit for Effect", diff --git a/.repos/effect/packages/sql/d1/CHANGELOG.md b/.repos/effect/packages/sql/d1/CHANGELOG.md index 3f048115d7551..a146f99478634 100644 --- a/.repos/effect/packages/sql/d1/CHANGELOG.md +++ b/.repos/effect/packages/sql/d1/CHANGELOG.md @@ -1,5 +1,15 @@ # @effect/sql-d1 +## 4.1.6 + +### Patch Changes + +- [#10867](https://github.com/Effect-TS/effect/pull/10867) [`49d3c99`](https://github.com/Effect-TS/effect/commit/49d3c99bd88301bbf581eaed356dd0653becec3f) Thanks @effect-bot! - Return a typed `SqlError` instead of dying when `D1Database.prepare()` throws synchronously on `.raw` and `.unprepared` queries. + +- [#10851](https://github.com/Effect-TS/effect/pull/10851) [`bb02f33`](https://github.com/Effect-TS/effect/commit/bb02f33a66309e62999d16fb87a3278157dd2e79) Thanks @effect-bot! - Update repository dependencies to their latest compatible releases. +- Updated dependencies [[`dd5f2f3`](https://github.com/Effect-TS/effect/commit/dd5f2f322fbad042a3a186cef593bf42affe5ce9), [`1d65846`](https://github.com/Effect-TS/effect/commit/1d65846308a6a18c4a95af543988ad30b72ff2b3), [`694c28f`](https://github.com/Effect-TS/effect/commit/694c28f0cfc3eac33f71160d18dda95cb670f506), [`5aaa2cd`](https://github.com/Effect-TS/effect/commit/5aaa2cd216e5e55f92d06db98d4b54946a396eed), [`55814bf`](https://github.com/Effect-TS/effect/commit/55814bf0a780f05ed0a51c82c8affda5d539bb0e), [`92c40a1`](https://github.com/Effect-TS/effect/commit/92c40a1f96a59f9edcacee6c0d6f6fb80397ee17), [`9f415a7`](https://github.com/Effect-TS/effect/commit/9f415a7733cdf8aed7efadbed3b5db22890e164a), [`e367afd`](https://github.com/Effect-TS/effect/commit/e367afdacfa3041a694a67e4670e98a20e41d45c), [`d5d2112`](https://github.com/Effect-TS/effect/commit/d5d21120ff591fcf8da006ce340010812cc91f16), [`fa2e5af`](https://github.com/Effect-TS/effect/commit/fa2e5af4ccc8f3650d97049707be82eab098c168), [`6bf6427`](https://github.com/Effect-TS/effect/commit/6bf6427d195539c387c13156aff79db077929c8f), [`10bc4a4`](https://github.com/Effect-TS/effect/commit/10bc4a47c0ce5bc50ba1998d63a803e3887d1d2b), [`a9540d3`](https://github.com/Effect-TS/effect/commit/a9540d3d50fbe65ade7f9b2f478cdd34a888161e), [`3a250d7`](https://github.com/Effect-TS/effect/commit/3a250d7eb8c310bf4751b3eca0038cf50e1629d8), [`ce44141`](https://github.com/Effect-TS/effect/commit/ce44141ad1bc8d05f3f7399bfa1e87772573205d), [`9318e5b`](https://github.com/Effect-TS/effect/commit/9318e5bafb144ddff65a0bff0148ec4f7ba77b5c), [`c9ecebf`](https://github.com/Effect-TS/effect/commit/c9ecebf7ede8a98895552fd20223d6573bd846fe), [`32f8fbe`](https://github.com/Effect-TS/effect/commit/32f8fbe1a5985aea41754e87531e9a1d0fbf78ec), [`41d6af1`](https://github.com/Effect-TS/effect/commit/41d6af14b7f36e06ade3bf7333b710e73de1e1c2), [`c33fd59`](https://github.com/Effect-TS/effect/commit/c33fd599cb7d49117f77f7bd8f05cb4209112a34), [`1f9e9d3`](https://github.com/Effect-TS/effect/commit/1f9e9d3de552435de6b8f4e1166515d0964c3999), [`594fa71`](https://github.com/Effect-TS/effect/commit/594fa71da417bf94fa6c9be2d3d36c808197e9fe), [`b378c38`](https://github.com/Effect-TS/effect/commit/b378c383cdb29e819e24da5dc725479a2ba4fdf1), [`a9ec9a6`](https://github.com/Effect-TS/effect/commit/a9ec9a60bbe1309960e00527ab62342dce1a86fc), [`310a81b`](https://github.com/Effect-TS/effect/commit/310a81b391e24d42b6608b5e3d641eca63e0d4c0), [`aab2135`](https://github.com/Effect-TS/effect/commit/aab2135d3fe43d4d86c4e486ed378797314fb212), [`6744a72`](https://github.com/Effect-TS/effect/commit/6744a724869539fc2d733929df871ef523bf82e8), [`848d042`](https://github.com/Effect-TS/effect/commit/848d0426f287b3e7ff970219d980a4c66fa441ad), [`077a93e`](https://github.com/Effect-TS/effect/commit/077a93e5db3adbc42e531539cb12b8bdbdfe5328), [`aef50fb`](https://github.com/Effect-TS/effect/commit/aef50fb8b56ec9ff8116f157635579fefd995f26), [`2e4de86`](https://github.com/Effect-TS/effect/commit/2e4de8634431f3da08ca2a90ab1024ee08e216f3), [`482b104`](https://github.com/Effect-TS/effect/commit/482b104caf712a8d5f99aafc64e55b6ea38eb809), [`753e1ed`](https://github.com/Effect-TS/effect/commit/753e1ed88069f73103d136dcdc58188fd10efdf1), [`0d2bb4a`](https://github.com/Effect-TS/effect/commit/0d2bb4a4b6526e1767b81101ee6e8da88ba1de55), [`8161e03`](https://github.com/Effect-TS/effect/commit/8161e03c26d691502afeddcf7e2ee75e6931637f), [`49f5391`](https://github.com/Effect-TS/effect/commit/49f53918a150aa2ea0ce2d444400cec1d6097400), [`3d59bdf`](https://github.com/Effect-TS/effect/commit/3d59bdf6f8f95ceea2091e5b8f375b834a14b3b1), [`8866608`](https://github.com/Effect-TS/effect/commit/88666082f2b6296bb7115bd4a2546151039f64db), [`69fd4b1`](https://github.com/Effect-TS/effect/commit/69fd4b1fba9e2ec5e7c16058ff8d9a1f9a38d90e), [`7d97626`](https://github.com/Effect-TS/effect/commit/7d9762658e515807c2b98678e7abd3ebe94e41ec), [`0e79436`](https://github.com/Effect-TS/effect/commit/0e794366658bd067a2212ea2ac7ed0223904ed31), [`2f8a4e9`](https://github.com/Effect-TS/effect/commit/2f8a4e9b90822d9facfef59027b35819c42d7b48), [`800b753`](https://github.com/Effect-TS/effect/commit/800b7535b4e37a24ac458cae78231054dae0b0f5)]: + - effect@4.1.6 + ## 4.1.5 ### Patch Changes diff --git a/.repos/effect/packages/sql/d1/package.json b/.repos/effect/packages/sql/d1/package.json index b089eabed8b68..db62dac160902 100644 --- a/.repos/effect/packages/sql/d1/package.json +++ b/.repos/effect/packages/sql/d1/package.json @@ -1,6 +1,6 @@ { "name": "@effect/sql-d1", - "version": "4.1.5", + "version": "4.1.6", "type": "module", "license": "MIT", "description": "A Cloudflare D1 integration for Effect", @@ -72,6 +72,6 @@ "effect": "workspace:^" }, "dependencies": { - "@cloudflare/workers-types": "^5.20261114.1" + "@cloudflare/workers-types": "^5.20261121.1" } } diff --git a/.repos/effect/packages/sql/d1/src/D1Client.ts b/.repos/effect/packages/sql/d1/src/D1Client.ts index 56e84d3e9edcc..c5e4f85a400f4 100644 --- a/.repos/effect/packages/sql/d1/src/D1Client.ts +++ b/.repos/effect/packages/sql/d1/src/D1Client.ts @@ -228,14 +228,16 @@ export const make = ( const makeConnection = Effect.gen(function*() { const db = options.db + const prepare = (sql: string) => + Effect.try({ + try: () => db.prepare(sql), + catch: (cause) => new SqlError({ reason: classifyError(cause, "Failed to prepare statement", "prepare") }) + }) + const prepareCache = yield* Cache.make({ capacity: options.prepareCacheSize ?? 200, timeToLive: options.prepareCacheTTL ?? Duration.minutes(10), - lookup: (sql: string) => - Effect.try({ - try: () => db.prepare(sql), - catch: (cause) => new SqlError({ reason: classifyError(cause, "Failed to prepare statement", "prepare") }) - }) + lookup: prepare }) const runStatementRaw = ( @@ -262,7 +264,7 @@ export const make = ( const runRaw = ( sql: string, params: ReadonlyArray = [] - ) => runStatementRaw(db.prepare(sql), params) + ) => Effect.flatMap(prepare(sql), (s) => runStatementRaw(s, params)) const runCached = ( sql: string, @@ -272,7 +274,7 @@ export const make = ( const runUncached = ( sql: string, params: ReadonlyArray = [] - ) => runStatement(db.prepare(sql), params) + ) => Effect.flatMap(prepare(sql), (s) => runStatement(s, params)) const runValues = ( sql: string, diff --git a/.repos/effect/packages/sql/d1/test/Client.test.ts b/.repos/effect/packages/sql/d1/test/Client.test.ts index b31c71b623202..a94c28168a966 100644 --- a/.repos/effect/packages/sql/d1/test/Client.test.ts +++ b/.repos/effect/packages/sql/d1/test/Client.test.ts @@ -40,6 +40,28 @@ describe("Client", { concurrent: false, timeout: 30_000 }, () => { Effect.provide(Reactivity.layer) )) + it.effect("fails with SqlError when prepare throws on raw and unprepared queries", () => + Effect.gen(function*() { + const cause = new Error("prepare failed") + const failingDb = { + prepare: () => { + throw cause + } + } as any + + const client = yield* D1Client.make({ db: failingDb }) + + for (const query of [client`SELECT 1`.raw, client`SELECT 1`.unprepared]) { + const error = yield* Effect.flip(query) + assert.strictEqual(error.reason._tag, "UnknownError") + assert.strictEqual(error.reason.operation, "prepare") + assert.strictEqual(error.reason.cause, cause) + } + }).pipe( + Effect.scoped, + Effect.provide(Reactivity.layer) + )) + it.effect("should handle queries without transactions", () => Effect.gen(function*() { const sql = yield* D1Client.D1Client diff --git a/.repos/effect/packages/sql/libsql/CHANGELOG.md b/.repos/effect/packages/sql/libsql/CHANGELOG.md index cb7aa7506f3ab..7c56af990bc57 100644 --- a/.repos/effect/packages/sql/libsql/CHANGELOG.md +++ b/.repos/effect/packages/sql/libsql/CHANGELOG.md @@ -1,5 +1,12 @@ # @effect/sql-libsql +## 4.1.6 + +### Patch Changes + +- Updated dependencies [[`dd5f2f3`](https://github.com/Effect-TS/effect/commit/dd5f2f322fbad042a3a186cef593bf42affe5ce9), [`1d65846`](https://github.com/Effect-TS/effect/commit/1d65846308a6a18c4a95af543988ad30b72ff2b3), [`694c28f`](https://github.com/Effect-TS/effect/commit/694c28f0cfc3eac33f71160d18dda95cb670f506), [`5aaa2cd`](https://github.com/Effect-TS/effect/commit/5aaa2cd216e5e55f92d06db98d4b54946a396eed), [`55814bf`](https://github.com/Effect-TS/effect/commit/55814bf0a780f05ed0a51c82c8affda5d539bb0e), [`92c40a1`](https://github.com/Effect-TS/effect/commit/92c40a1f96a59f9edcacee6c0d6f6fb80397ee17), [`9f415a7`](https://github.com/Effect-TS/effect/commit/9f415a7733cdf8aed7efadbed3b5db22890e164a), [`e367afd`](https://github.com/Effect-TS/effect/commit/e367afdacfa3041a694a67e4670e98a20e41d45c), [`d5d2112`](https://github.com/Effect-TS/effect/commit/d5d21120ff591fcf8da006ce340010812cc91f16), [`fa2e5af`](https://github.com/Effect-TS/effect/commit/fa2e5af4ccc8f3650d97049707be82eab098c168), [`6bf6427`](https://github.com/Effect-TS/effect/commit/6bf6427d195539c387c13156aff79db077929c8f), [`10bc4a4`](https://github.com/Effect-TS/effect/commit/10bc4a47c0ce5bc50ba1998d63a803e3887d1d2b), [`a9540d3`](https://github.com/Effect-TS/effect/commit/a9540d3d50fbe65ade7f9b2f478cdd34a888161e), [`3a250d7`](https://github.com/Effect-TS/effect/commit/3a250d7eb8c310bf4751b3eca0038cf50e1629d8), [`ce44141`](https://github.com/Effect-TS/effect/commit/ce44141ad1bc8d05f3f7399bfa1e87772573205d), [`9318e5b`](https://github.com/Effect-TS/effect/commit/9318e5bafb144ddff65a0bff0148ec4f7ba77b5c), [`c9ecebf`](https://github.com/Effect-TS/effect/commit/c9ecebf7ede8a98895552fd20223d6573bd846fe), [`32f8fbe`](https://github.com/Effect-TS/effect/commit/32f8fbe1a5985aea41754e87531e9a1d0fbf78ec), [`41d6af1`](https://github.com/Effect-TS/effect/commit/41d6af14b7f36e06ade3bf7333b710e73de1e1c2), [`c33fd59`](https://github.com/Effect-TS/effect/commit/c33fd599cb7d49117f77f7bd8f05cb4209112a34), [`1f9e9d3`](https://github.com/Effect-TS/effect/commit/1f9e9d3de552435de6b8f4e1166515d0964c3999), [`594fa71`](https://github.com/Effect-TS/effect/commit/594fa71da417bf94fa6c9be2d3d36c808197e9fe), [`b378c38`](https://github.com/Effect-TS/effect/commit/b378c383cdb29e819e24da5dc725479a2ba4fdf1), [`a9ec9a6`](https://github.com/Effect-TS/effect/commit/a9ec9a60bbe1309960e00527ab62342dce1a86fc), [`310a81b`](https://github.com/Effect-TS/effect/commit/310a81b391e24d42b6608b5e3d641eca63e0d4c0), [`aab2135`](https://github.com/Effect-TS/effect/commit/aab2135d3fe43d4d86c4e486ed378797314fb212), [`6744a72`](https://github.com/Effect-TS/effect/commit/6744a724869539fc2d733929df871ef523bf82e8), [`848d042`](https://github.com/Effect-TS/effect/commit/848d0426f287b3e7ff970219d980a4c66fa441ad), [`077a93e`](https://github.com/Effect-TS/effect/commit/077a93e5db3adbc42e531539cb12b8bdbdfe5328), [`aef50fb`](https://github.com/Effect-TS/effect/commit/aef50fb8b56ec9ff8116f157635579fefd995f26), [`2e4de86`](https://github.com/Effect-TS/effect/commit/2e4de8634431f3da08ca2a90ab1024ee08e216f3), [`482b104`](https://github.com/Effect-TS/effect/commit/482b104caf712a8d5f99aafc64e55b6ea38eb809), [`753e1ed`](https://github.com/Effect-TS/effect/commit/753e1ed88069f73103d136dcdc58188fd10efdf1), [`0d2bb4a`](https://github.com/Effect-TS/effect/commit/0d2bb4a4b6526e1767b81101ee6e8da88ba1de55), [`8161e03`](https://github.com/Effect-TS/effect/commit/8161e03c26d691502afeddcf7e2ee75e6931637f), [`49f5391`](https://github.com/Effect-TS/effect/commit/49f53918a150aa2ea0ce2d444400cec1d6097400), [`3d59bdf`](https://github.com/Effect-TS/effect/commit/3d59bdf6f8f95ceea2091e5b8f375b834a14b3b1), [`8866608`](https://github.com/Effect-TS/effect/commit/88666082f2b6296bb7115bd4a2546151039f64db), [`69fd4b1`](https://github.com/Effect-TS/effect/commit/69fd4b1fba9e2ec5e7c16058ff8d9a1f9a38d90e), [`7d97626`](https://github.com/Effect-TS/effect/commit/7d9762658e515807c2b98678e7abd3ebe94e41ec), [`0e79436`](https://github.com/Effect-TS/effect/commit/0e794366658bd067a2212ea2ac7ed0223904ed31), [`2f8a4e9`](https://github.com/Effect-TS/effect/commit/2f8a4e9b90822d9facfef59027b35819c42d7b48), [`800b753`](https://github.com/Effect-TS/effect/commit/800b7535b4e37a24ac458cae78231054dae0b0f5)]: + - effect@4.1.6 + ## 4.1.5 ### Patch Changes diff --git a/.repos/effect/packages/sql/libsql/package.json b/.repos/effect/packages/sql/libsql/package.json index 1225908862348..fe9d2db2b6e00 100644 --- a/.repos/effect/packages/sql/libsql/package.json +++ b/.repos/effect/packages/sql/libsql/package.json @@ -1,6 +1,6 @@ { "name": "@effect/sql-libsql", - "version": "4.1.5", + "version": "4.1.6", "type": "module", "license": "MIT", "description": "A libSQL toolkit for Effect", @@ -64,7 +64,7 @@ }, "devDependencies": { "effect": "workspace:^", - "testcontainers": "^12.2.1" + "testcontainers": "^12.2.2" }, "peerDependencies": { "effect": "workspace:^" diff --git a/.repos/effect/packages/sql/mssql/CHANGELOG.md b/.repos/effect/packages/sql/mssql/CHANGELOG.md index 16783dcb0ff35..d44bb4e3fec82 100644 --- a/.repos/effect/packages/sql/mssql/CHANGELOG.md +++ b/.repos/effect/packages/sql/mssql/CHANGELOG.md @@ -1,5 +1,15 @@ # @effect/sql-mssql +## 4.1.6 + +### Patch Changes + +- [#10866](https://github.com/Effect-TS/effect/pull/10866) [`bca3d5d`](https://github.com/Effect-TS/effect/commit/bca3d5d6359b7f0de284ba86f5527cc9b3dd0dd9) Thanks @MrGovindan! - Add `requestTimeout` to `MssqlClientConfig` to configure or disable the 15 second default request timeout. + +- [#10851](https://github.com/Effect-TS/effect/pull/10851) [`bb02f33`](https://github.com/Effect-TS/effect/commit/bb02f33a66309e62999d16fb87a3278157dd2e79) Thanks @effect-bot! - Update repository dependencies to their latest compatible releases. +- Updated dependencies [[`dd5f2f3`](https://github.com/Effect-TS/effect/commit/dd5f2f322fbad042a3a186cef593bf42affe5ce9), [`1d65846`](https://github.com/Effect-TS/effect/commit/1d65846308a6a18c4a95af543988ad30b72ff2b3), [`694c28f`](https://github.com/Effect-TS/effect/commit/694c28f0cfc3eac33f71160d18dda95cb670f506), [`5aaa2cd`](https://github.com/Effect-TS/effect/commit/5aaa2cd216e5e55f92d06db98d4b54946a396eed), [`55814bf`](https://github.com/Effect-TS/effect/commit/55814bf0a780f05ed0a51c82c8affda5d539bb0e), [`92c40a1`](https://github.com/Effect-TS/effect/commit/92c40a1f96a59f9edcacee6c0d6f6fb80397ee17), [`9f415a7`](https://github.com/Effect-TS/effect/commit/9f415a7733cdf8aed7efadbed3b5db22890e164a), [`e367afd`](https://github.com/Effect-TS/effect/commit/e367afdacfa3041a694a67e4670e98a20e41d45c), [`d5d2112`](https://github.com/Effect-TS/effect/commit/d5d21120ff591fcf8da006ce340010812cc91f16), [`fa2e5af`](https://github.com/Effect-TS/effect/commit/fa2e5af4ccc8f3650d97049707be82eab098c168), [`6bf6427`](https://github.com/Effect-TS/effect/commit/6bf6427d195539c387c13156aff79db077929c8f), [`10bc4a4`](https://github.com/Effect-TS/effect/commit/10bc4a47c0ce5bc50ba1998d63a803e3887d1d2b), [`a9540d3`](https://github.com/Effect-TS/effect/commit/a9540d3d50fbe65ade7f9b2f478cdd34a888161e), [`3a250d7`](https://github.com/Effect-TS/effect/commit/3a250d7eb8c310bf4751b3eca0038cf50e1629d8), [`ce44141`](https://github.com/Effect-TS/effect/commit/ce44141ad1bc8d05f3f7399bfa1e87772573205d), [`9318e5b`](https://github.com/Effect-TS/effect/commit/9318e5bafb144ddff65a0bff0148ec4f7ba77b5c), [`c9ecebf`](https://github.com/Effect-TS/effect/commit/c9ecebf7ede8a98895552fd20223d6573bd846fe), [`32f8fbe`](https://github.com/Effect-TS/effect/commit/32f8fbe1a5985aea41754e87531e9a1d0fbf78ec), [`41d6af1`](https://github.com/Effect-TS/effect/commit/41d6af14b7f36e06ade3bf7333b710e73de1e1c2), [`c33fd59`](https://github.com/Effect-TS/effect/commit/c33fd599cb7d49117f77f7bd8f05cb4209112a34), [`1f9e9d3`](https://github.com/Effect-TS/effect/commit/1f9e9d3de552435de6b8f4e1166515d0964c3999), [`594fa71`](https://github.com/Effect-TS/effect/commit/594fa71da417bf94fa6c9be2d3d36c808197e9fe), [`b378c38`](https://github.com/Effect-TS/effect/commit/b378c383cdb29e819e24da5dc725479a2ba4fdf1), [`a9ec9a6`](https://github.com/Effect-TS/effect/commit/a9ec9a60bbe1309960e00527ab62342dce1a86fc), [`310a81b`](https://github.com/Effect-TS/effect/commit/310a81b391e24d42b6608b5e3d641eca63e0d4c0), [`aab2135`](https://github.com/Effect-TS/effect/commit/aab2135d3fe43d4d86c4e486ed378797314fb212), [`6744a72`](https://github.com/Effect-TS/effect/commit/6744a724869539fc2d733929df871ef523bf82e8), [`848d042`](https://github.com/Effect-TS/effect/commit/848d0426f287b3e7ff970219d980a4c66fa441ad), [`077a93e`](https://github.com/Effect-TS/effect/commit/077a93e5db3adbc42e531539cb12b8bdbdfe5328), [`aef50fb`](https://github.com/Effect-TS/effect/commit/aef50fb8b56ec9ff8116f157635579fefd995f26), [`2e4de86`](https://github.com/Effect-TS/effect/commit/2e4de8634431f3da08ca2a90ab1024ee08e216f3), [`482b104`](https://github.com/Effect-TS/effect/commit/482b104caf712a8d5f99aafc64e55b6ea38eb809), [`753e1ed`](https://github.com/Effect-TS/effect/commit/753e1ed88069f73103d136dcdc58188fd10efdf1), [`0d2bb4a`](https://github.com/Effect-TS/effect/commit/0d2bb4a4b6526e1767b81101ee6e8da88ba1de55), [`8161e03`](https://github.com/Effect-TS/effect/commit/8161e03c26d691502afeddcf7e2ee75e6931637f), [`49f5391`](https://github.com/Effect-TS/effect/commit/49f53918a150aa2ea0ce2d444400cec1d6097400), [`3d59bdf`](https://github.com/Effect-TS/effect/commit/3d59bdf6f8f95ceea2091e5b8f375b834a14b3b1), [`8866608`](https://github.com/Effect-TS/effect/commit/88666082f2b6296bb7115bd4a2546151039f64db), [`69fd4b1`](https://github.com/Effect-TS/effect/commit/69fd4b1fba9e2ec5e7c16058ff8d9a1f9a38d90e), [`7d97626`](https://github.com/Effect-TS/effect/commit/7d9762658e515807c2b98678e7abd3ebe94e41ec), [`0e79436`](https://github.com/Effect-TS/effect/commit/0e794366658bd067a2212ea2ac7ed0223904ed31), [`2f8a4e9`](https://github.com/Effect-TS/effect/commit/2f8a4e9b90822d9facfef59027b35819c42d7b48), [`800b753`](https://github.com/Effect-TS/effect/commit/800b7535b4e37a24ac458cae78231054dae0b0f5)]: + - effect@4.1.6 + ## 4.1.5 ### Patch Changes diff --git a/.repos/effect/packages/sql/mssql/package.json b/.repos/effect/packages/sql/mssql/package.json index 1db0c16efb565..129a6ba8aa4da 100644 --- a/.repos/effect/packages/sql/mssql/package.json +++ b/.repos/effect/packages/sql/mssql/package.json @@ -1,6 +1,6 @@ { "name": "@effect/sql-mssql", - "version": "4.1.5", + "version": "4.1.6", "type": "module", "license": "MIT", "description": "A Microsoft SQL Server toolkit for Effect", @@ -61,13 +61,13 @@ "check": "tsc -b tsconfig.json" }, "devDependencies": { - "@testcontainers/mssqlserver": "^12.2.1", + "@testcontainers/mssqlserver": "^12.2.2", "effect": "workspace:^" }, "peerDependencies": { "effect": "workspace:^" }, "dependencies": { - "tedious": "^20.3.9" + "tedious": "^20.4.1" } } diff --git a/.repos/effect/packages/sql/mssql/src/MssqlClient.ts b/.repos/effect/packages/sql/mssql/src/MssqlClient.ts index 47fbc84e47fcf..8e219ca60f7c9 100644 --- a/.repos/effect/packages/sql/mssql/src/MssqlClient.ts +++ b/.repos/effect/packages/sql/mssql/src/MssqlClient.ts @@ -241,6 +241,12 @@ export interface MssqlClientConfig { * the timer) leaves interruption unbounded rather than making it faster. */ readonly cancelTimeout?: Duration.Input | undefined + /** + * How long Tedious waits for the first response packet of a request before + * cancelling and failing it. Defaults to 15 seconds. Pass a zero or infinite + * duration to disable the timeout. + */ + readonly requestTimeout?: Duration.Input | undefined readonly connectionRetryInterval?: Duration.Input | undefined readonly multiSubnetFailover?: boolean | undefined readonly maxRetriesOnTransientErrors?: number | undefined @@ -293,6 +299,12 @@ export const make = ( ): Effect.Effect => Effect.gen(function*() { const parameterTypes = options.parameterTypes ?? defaultParameterTypes + let requestTimeout: number | undefined + if (options.requestTimeout !== undefined) { + const millis = Duration.toMillis(options.requestTimeout) + // Tedious disables the timer for 0; passing Infinity overflows setTimeout. + requestTimeout = Number.isFinite(millis) ? millis : 0 + } const compiler = makeCompiler(options.transformQueryNames) const transformRows = options.transformResultNames ? @@ -337,6 +349,7 @@ export const make = ( cancelTimeout: options.cancelTimeout ? Duration.toMillis(Duration.fromInputUnsafe(options.cancelTimeout)) : undefined, + requestTimeout, connectionRetryInterval: options.connectionRetryInterval ? Duration.toMillis(Duration.fromInputUnsafe(options.connectionRetryInterval)) : undefined, diff --git a/.repos/effect/packages/sql/mssql/test/Client.test.ts b/.repos/effect/packages/sql/mssql/test/Client.test.ts index c4e2575fd1d0b..fff432d73f1f6 100644 --- a/.repos/effect/packages/sql/mssql/test/Client.test.ts +++ b/.repos/effect/packages/sql/mssql/test/Client.test.ts @@ -12,6 +12,7 @@ import type * as Tedious from "tedious" import { vi } from "vitest" interface MockConnection extends EventEmitter { + config: Tedious.ConnectionConfiguration closed: boolean closedSignal: Deferred.Deferred cancellations: number @@ -56,7 +57,7 @@ vi.mock("tedious", async (importOriginal) => { cancellations = 0 readonly queries: Array = [] - constructor() { + constructor(readonly config: Tedious.ConnectionConfiguration) { super() state.connections.push(this) } @@ -384,6 +385,22 @@ const makeClient = MssqlClient.make({ const bounded = (effect: Effect.Effect) => effect.pipe(Effect.timeout("2 seconds")) describe("MssqlClient connection lifecycle", { concurrent: false }, () => { + it.effect("passes requestTimeout to Tedious", () => + Effect.gen(function*() { + reset() + for ( + const [config, expected] of [ + [{}, undefined], + [{ requestTimeout: "30 seconds" }, 30_000], + [{ requestTimeout: 0 }, 0], + [{ requestTimeout: "Infinity" }, 0] + ] as const + ) { + yield* MssqlClient.make({ server: "localhost", ...config }) + assert.strictEqual(state.connections.at(-1)!.config.options?.requestTimeout, expected) + } + }).pipe(Effect.scoped, Effect.provide(Reactivity.layer))) + for (const operation of ["withoutTransforms", "call"] as const) { it.live(`${operation} reuses the transaction connection with a single-connection pool`, () => Effect.gen(function*() { diff --git a/.repos/effect/packages/sql/mssql/test/Persistence.integration.test.ts b/.repos/effect/packages/sql/mssql/test/Persistence.integration.test.ts index d295e49e19557..11dc8b6027a88 100644 --- a/.repos/effect/packages/sql/mssql/test/Persistence.integration.test.ts +++ b/.repos/effect/packages/sql/mssql/test/Persistence.integration.test.ts @@ -27,7 +27,7 @@ PersistedQueueTest.suiteWith( "sql-mssql", PersistedQueue.layerStoreSql().pipe(Layer.provide(MssqlContainer.layerClient)), it, - { hookTimeout: "90 seconds" } + { hookTimeout: "90 seconds", nonDeliveryWait: "250 millis" } ) // Records deadlock graphs in a dedicated session, since system_health can @@ -181,7 +181,9 @@ const makeXactAbortClient = Effect.fnUntraced(function*( }) it.layer(MssqlContainer.layerClient, { timeout: "90 seconds" })((it) => { - PersistedQueueSqlTest.suiteWith(it) + // Keep claim tests serial on SQL Server: concurrent table creation deadlocks + // on the system catalog and competes with the deadlock test below. + PersistedQueueSqlTest.suiteWith(it, { concurrentClaims: false }) it.effect("PersistedQueue offers, claims and settlements do not deadlock", () => Effect.gen(function*() { diff --git a/.repos/effect/packages/sql/mysql2/CHANGELOG.md b/.repos/effect/packages/sql/mysql2/CHANGELOG.md index 4e4a351f58730..28fd615de694a 100644 --- a/.repos/effect/packages/sql/mysql2/CHANGELOG.md +++ b/.repos/effect/packages/sql/mysql2/CHANGELOG.md @@ -1,5 +1,12 @@ # @effect/sql-mysql2 +## 4.1.6 + +### Patch Changes + +- Updated dependencies [[`dd5f2f3`](https://github.com/Effect-TS/effect/commit/dd5f2f322fbad042a3a186cef593bf42affe5ce9), [`1d65846`](https://github.com/Effect-TS/effect/commit/1d65846308a6a18c4a95af543988ad30b72ff2b3), [`694c28f`](https://github.com/Effect-TS/effect/commit/694c28f0cfc3eac33f71160d18dda95cb670f506), [`5aaa2cd`](https://github.com/Effect-TS/effect/commit/5aaa2cd216e5e55f92d06db98d4b54946a396eed), [`55814bf`](https://github.com/Effect-TS/effect/commit/55814bf0a780f05ed0a51c82c8affda5d539bb0e), [`92c40a1`](https://github.com/Effect-TS/effect/commit/92c40a1f96a59f9edcacee6c0d6f6fb80397ee17), [`9f415a7`](https://github.com/Effect-TS/effect/commit/9f415a7733cdf8aed7efadbed3b5db22890e164a), [`e367afd`](https://github.com/Effect-TS/effect/commit/e367afdacfa3041a694a67e4670e98a20e41d45c), [`d5d2112`](https://github.com/Effect-TS/effect/commit/d5d21120ff591fcf8da006ce340010812cc91f16), [`fa2e5af`](https://github.com/Effect-TS/effect/commit/fa2e5af4ccc8f3650d97049707be82eab098c168), [`6bf6427`](https://github.com/Effect-TS/effect/commit/6bf6427d195539c387c13156aff79db077929c8f), [`10bc4a4`](https://github.com/Effect-TS/effect/commit/10bc4a47c0ce5bc50ba1998d63a803e3887d1d2b), [`a9540d3`](https://github.com/Effect-TS/effect/commit/a9540d3d50fbe65ade7f9b2f478cdd34a888161e), [`3a250d7`](https://github.com/Effect-TS/effect/commit/3a250d7eb8c310bf4751b3eca0038cf50e1629d8), [`ce44141`](https://github.com/Effect-TS/effect/commit/ce44141ad1bc8d05f3f7399bfa1e87772573205d), [`9318e5b`](https://github.com/Effect-TS/effect/commit/9318e5bafb144ddff65a0bff0148ec4f7ba77b5c), [`c9ecebf`](https://github.com/Effect-TS/effect/commit/c9ecebf7ede8a98895552fd20223d6573bd846fe), [`32f8fbe`](https://github.com/Effect-TS/effect/commit/32f8fbe1a5985aea41754e87531e9a1d0fbf78ec), [`41d6af1`](https://github.com/Effect-TS/effect/commit/41d6af14b7f36e06ade3bf7333b710e73de1e1c2), [`c33fd59`](https://github.com/Effect-TS/effect/commit/c33fd599cb7d49117f77f7bd8f05cb4209112a34), [`1f9e9d3`](https://github.com/Effect-TS/effect/commit/1f9e9d3de552435de6b8f4e1166515d0964c3999), [`594fa71`](https://github.com/Effect-TS/effect/commit/594fa71da417bf94fa6c9be2d3d36c808197e9fe), [`b378c38`](https://github.com/Effect-TS/effect/commit/b378c383cdb29e819e24da5dc725479a2ba4fdf1), [`a9ec9a6`](https://github.com/Effect-TS/effect/commit/a9ec9a60bbe1309960e00527ab62342dce1a86fc), [`310a81b`](https://github.com/Effect-TS/effect/commit/310a81b391e24d42b6608b5e3d641eca63e0d4c0), [`aab2135`](https://github.com/Effect-TS/effect/commit/aab2135d3fe43d4d86c4e486ed378797314fb212), [`6744a72`](https://github.com/Effect-TS/effect/commit/6744a724869539fc2d733929df871ef523bf82e8), [`848d042`](https://github.com/Effect-TS/effect/commit/848d0426f287b3e7ff970219d980a4c66fa441ad), [`077a93e`](https://github.com/Effect-TS/effect/commit/077a93e5db3adbc42e531539cb12b8bdbdfe5328), [`aef50fb`](https://github.com/Effect-TS/effect/commit/aef50fb8b56ec9ff8116f157635579fefd995f26), [`2e4de86`](https://github.com/Effect-TS/effect/commit/2e4de8634431f3da08ca2a90ab1024ee08e216f3), [`482b104`](https://github.com/Effect-TS/effect/commit/482b104caf712a8d5f99aafc64e55b6ea38eb809), [`753e1ed`](https://github.com/Effect-TS/effect/commit/753e1ed88069f73103d136dcdc58188fd10efdf1), [`0d2bb4a`](https://github.com/Effect-TS/effect/commit/0d2bb4a4b6526e1767b81101ee6e8da88ba1de55), [`8161e03`](https://github.com/Effect-TS/effect/commit/8161e03c26d691502afeddcf7e2ee75e6931637f), [`49f5391`](https://github.com/Effect-TS/effect/commit/49f53918a150aa2ea0ce2d444400cec1d6097400), [`3d59bdf`](https://github.com/Effect-TS/effect/commit/3d59bdf6f8f95ceea2091e5b8f375b834a14b3b1), [`8866608`](https://github.com/Effect-TS/effect/commit/88666082f2b6296bb7115bd4a2546151039f64db), [`69fd4b1`](https://github.com/Effect-TS/effect/commit/69fd4b1fba9e2ec5e7c16058ff8d9a1f9a38d90e), [`7d97626`](https://github.com/Effect-TS/effect/commit/7d9762658e515807c2b98678e7abd3ebe94e41ec), [`0e79436`](https://github.com/Effect-TS/effect/commit/0e794366658bd067a2212ea2ac7ed0223904ed31), [`2f8a4e9`](https://github.com/Effect-TS/effect/commit/2f8a4e9b90822d9facfef59027b35819c42d7b48), [`800b753`](https://github.com/Effect-TS/effect/commit/800b7535b4e37a24ac458cae78231054dae0b0f5)]: + - effect@4.1.6 + ## 4.1.5 ### Patch Changes diff --git a/.repos/effect/packages/sql/mysql2/package.json b/.repos/effect/packages/sql/mysql2/package.json index 4b3abb77e9a3d..9a0691fdd17f2 100644 --- a/.repos/effect/packages/sql/mysql2/package.json +++ b/.repos/effect/packages/sql/mysql2/package.json @@ -1,6 +1,6 @@ { "name": "@effect/sql-mysql2", - "version": "4.1.5", + "version": "4.1.6", "type": "module", "license": "MIT", "description": "A MySQL toolkit for Effect", @@ -61,7 +61,7 @@ "check": "tsc -b tsconfig.json" }, "devDependencies": { - "@testcontainers/mysql": "^12.2.1", + "@testcontainers/mysql": "^12.2.2", "effect": "workspace:^" }, "peerDependencies": { diff --git a/.repos/effect/packages/sql/mysql2/test/Persistence.integration.test.ts b/.repos/effect/packages/sql/mysql2/test/Persistence.integration.test.ts index 615d8a4f4bad7..e7afa8ccd7f34 100644 --- a/.repos/effect/packages/sql/mysql2/test/Persistence.integration.test.ts +++ b/.repos/effect/packages/sql/mysql2/test/Persistence.integration.test.ts @@ -13,7 +13,9 @@ import { MysqlContainer } from "./utils.ts" it.layer(MysqlContainer.layerClient, { timeout: "90 seconds" })("Persistence", (it) => { PersistedCacheTest.suiteWith("sql-mysql2-multi", Persistence.layerSqlMultiTable, it) - PersistedQueueTest.suiteWith("sql-mysql2", PersistedQueue.layerStoreSql(), it) + PersistedQueueTest.suiteWith("sql-mysql2", PersistedQueue.layerStoreSql(), it, { + nonDeliveryWait: "250 millis" + }) PersistedQueueSqlTest.suiteWith(it) diff --git a/.repos/effect/packages/sql/pg/CHANGELOG.md b/.repos/effect/packages/sql/pg/CHANGELOG.md index c3e227def2b57..4e761aa430379 100644 --- a/.repos/effect/packages/sql/pg/CHANGELOG.md +++ b/.repos/effect/packages/sql/pg/CHANGELOG.md @@ -1,5 +1,23 @@ # @effect/sql-pg +## 4.1.6 + +### Patch Changes + +- [#10828](https://github.com/Effect-TS/effect/pull/10828) [`8986046`](https://github.com/Effect-TS/effect/commit/898604683d90e892a8b773becab673b08381cef2) Thanks @effect-bot! - Fix multiplexed `PgConnection` retaining completed queries in memory until the pipeline fully drains. + +- [#10855](https://github.com/Effect-TS/effect/pull/10855) [`296c209`](https://github.com/Effect-TS/effect/commit/296c20943b9b94b13c9925a5d43ad02cb20d1f13) Thanks @effect-bot! - Keep a retired `PgPool` session's `maxConnections` slot occupied until its transport emits `close`. + +- [#10827](https://github.com/Effect-TS/effect/pull/10827) [`8211347`](https://github.com/Effect-TS/effect/commit/82113477d61ded260507080d01529473f15030f2) Thanks @effect-bot! - Document that `multiplex` behind PgBouncer before 1.26.0 needs `prepare: false` or a PgBouncer upgrade to avoid `Unexpected ParseComplete during close` errors. + +- [#10904](https://github.com/Effect-TS/effect/pull/10904) [`070dd47`](https://github.com/Effect-TS/effect/commit/070dd47d444bb6296cbbf940a7d5b939ab14ced3) Thanks @colinhacks! - Add `queryTextValues` to `PgClient` and `PgConnection` to read raw PostgreSQL text results with field metadata. + +- [#10869](https://github.com/Effect-TS/effect/pull/10869) [`adc2909`](https://github.com/Effect-TS/effect/commit/adc2909145c4adf14b4ccf9aebbe48f545b46f78) Thanks @effect-bot! - Decode and encode built-in PostgreSQL ranges (`int4range`, `int8range`, `numrange`, `daterange`, `tsrange`, `tstzrange`), multiranges, and their arrays as `PgTypes.Range` values. + +- [#10911](https://github.com/Effect-TS/effect/pull/10911) [`7790d71`](https://github.com/Effect-TS/effect/commit/7790d71014390b7954df9be108364471e6e5eb7d) Thanks @werkamsus! - Close a pinned `PgConnection` session released inside a transaction it began so it is not returned to `PgPool`. +- Updated dependencies [[`dd5f2f3`](https://github.com/Effect-TS/effect/commit/dd5f2f322fbad042a3a186cef593bf42affe5ce9), [`1d65846`](https://github.com/Effect-TS/effect/commit/1d65846308a6a18c4a95af543988ad30b72ff2b3), [`694c28f`](https://github.com/Effect-TS/effect/commit/694c28f0cfc3eac33f71160d18dda95cb670f506), [`5aaa2cd`](https://github.com/Effect-TS/effect/commit/5aaa2cd216e5e55f92d06db98d4b54946a396eed), [`55814bf`](https://github.com/Effect-TS/effect/commit/55814bf0a780f05ed0a51c82c8affda5d539bb0e), [`92c40a1`](https://github.com/Effect-TS/effect/commit/92c40a1f96a59f9edcacee6c0d6f6fb80397ee17), [`9f415a7`](https://github.com/Effect-TS/effect/commit/9f415a7733cdf8aed7efadbed3b5db22890e164a), [`e367afd`](https://github.com/Effect-TS/effect/commit/e367afdacfa3041a694a67e4670e98a20e41d45c), [`d5d2112`](https://github.com/Effect-TS/effect/commit/d5d21120ff591fcf8da006ce340010812cc91f16), [`fa2e5af`](https://github.com/Effect-TS/effect/commit/fa2e5af4ccc8f3650d97049707be82eab098c168), [`6bf6427`](https://github.com/Effect-TS/effect/commit/6bf6427d195539c387c13156aff79db077929c8f), [`10bc4a4`](https://github.com/Effect-TS/effect/commit/10bc4a47c0ce5bc50ba1998d63a803e3887d1d2b), [`a9540d3`](https://github.com/Effect-TS/effect/commit/a9540d3d50fbe65ade7f9b2f478cdd34a888161e), [`3a250d7`](https://github.com/Effect-TS/effect/commit/3a250d7eb8c310bf4751b3eca0038cf50e1629d8), [`ce44141`](https://github.com/Effect-TS/effect/commit/ce44141ad1bc8d05f3f7399bfa1e87772573205d), [`9318e5b`](https://github.com/Effect-TS/effect/commit/9318e5bafb144ddff65a0bff0148ec4f7ba77b5c), [`c9ecebf`](https://github.com/Effect-TS/effect/commit/c9ecebf7ede8a98895552fd20223d6573bd846fe), [`32f8fbe`](https://github.com/Effect-TS/effect/commit/32f8fbe1a5985aea41754e87531e9a1d0fbf78ec), [`41d6af1`](https://github.com/Effect-TS/effect/commit/41d6af14b7f36e06ade3bf7333b710e73de1e1c2), [`c33fd59`](https://github.com/Effect-TS/effect/commit/c33fd599cb7d49117f77f7bd8f05cb4209112a34), [`1f9e9d3`](https://github.com/Effect-TS/effect/commit/1f9e9d3de552435de6b8f4e1166515d0964c3999), [`594fa71`](https://github.com/Effect-TS/effect/commit/594fa71da417bf94fa6c9be2d3d36c808197e9fe), [`b378c38`](https://github.com/Effect-TS/effect/commit/b378c383cdb29e819e24da5dc725479a2ba4fdf1), [`a9ec9a6`](https://github.com/Effect-TS/effect/commit/a9ec9a60bbe1309960e00527ab62342dce1a86fc), [`310a81b`](https://github.com/Effect-TS/effect/commit/310a81b391e24d42b6608b5e3d641eca63e0d4c0), [`aab2135`](https://github.com/Effect-TS/effect/commit/aab2135d3fe43d4d86c4e486ed378797314fb212), [`6744a72`](https://github.com/Effect-TS/effect/commit/6744a724869539fc2d733929df871ef523bf82e8), [`848d042`](https://github.com/Effect-TS/effect/commit/848d0426f287b3e7ff970219d980a4c66fa441ad), [`077a93e`](https://github.com/Effect-TS/effect/commit/077a93e5db3adbc42e531539cb12b8bdbdfe5328), [`aef50fb`](https://github.com/Effect-TS/effect/commit/aef50fb8b56ec9ff8116f157635579fefd995f26), [`2e4de86`](https://github.com/Effect-TS/effect/commit/2e4de8634431f3da08ca2a90ab1024ee08e216f3), [`482b104`](https://github.com/Effect-TS/effect/commit/482b104caf712a8d5f99aafc64e55b6ea38eb809), [`753e1ed`](https://github.com/Effect-TS/effect/commit/753e1ed88069f73103d136dcdc58188fd10efdf1), [`0d2bb4a`](https://github.com/Effect-TS/effect/commit/0d2bb4a4b6526e1767b81101ee6e8da88ba1de55), [`8161e03`](https://github.com/Effect-TS/effect/commit/8161e03c26d691502afeddcf7e2ee75e6931637f), [`49f5391`](https://github.com/Effect-TS/effect/commit/49f53918a150aa2ea0ce2d444400cec1d6097400), [`3d59bdf`](https://github.com/Effect-TS/effect/commit/3d59bdf6f8f95ceea2091e5b8f375b834a14b3b1), [`8866608`](https://github.com/Effect-TS/effect/commit/88666082f2b6296bb7115bd4a2546151039f64db), [`69fd4b1`](https://github.com/Effect-TS/effect/commit/69fd4b1fba9e2ec5e7c16058ff8d9a1f9a38d90e), [`7d97626`](https://github.com/Effect-TS/effect/commit/7d9762658e515807c2b98678e7abd3ebe94e41ec), [`0e79436`](https://github.com/Effect-TS/effect/commit/0e794366658bd067a2212ea2ac7ed0223904ed31), [`2f8a4e9`](https://github.com/Effect-TS/effect/commit/2f8a4e9b90822d9facfef59027b35819c42d7b48), [`800b753`](https://github.com/Effect-TS/effect/commit/800b7535b4e37a24ac458cae78231054dae0b0f5)]: + - effect@4.1.6 + ## 4.1.5 ### Patch Changes diff --git a/.repos/effect/packages/sql/pg/README.md b/.repos/effect/packages/sql/pg/README.md index 881d79b08b985..2d8450e3aa34d 100644 --- a/.repos/effect/packages/sql/pg/README.md +++ b/.repos/effect/packages/sql/pg/README.md @@ -105,7 +105,8 @@ that cannot be text fails with `PgTypes.CodecError`: The error names the column, its type OID, and its table OID and attribute number when the column comes from a table. It fails only the query that read the row: the rest of the result is discarded and the connection stays usable. -Register a codec for these types, or cast the column to `text` in the query. +Register a codec for these types, cast the column to `text` in the query, or +read it with [`queryTextValues`](#values-as-text). A binary layout with no zero bytes at all, such as `ltree`, still decodes as garbled text without any error. @@ -115,6 +116,12 @@ array of its field values, and each field uses the same codecs as a column. Named composite types (`CREATE TYPE ... AS (...)`) have their own OID and take the fallback above. +Built-in ranges (`int4range`, `int8range`, `numrange`, `daterange`, `tsrange`, +`tstzrange`), their multiranges, and arrays of both decode to +`PgTypes.Range` (finite bounds use the subtype codec) and +`ReadonlyArray>`. User-defined ranges (`CREATE TYPE ... AS +RANGE`) have their own OID and take the fallback above. + Register a codec for a scalar user-defined type with `PgTypes.register(oid, codec)`; registered codecs take precedence over the fallback. `PgTypes.register` cannot attach an array type. For arrays, create a @@ -154,3 +161,22 @@ const PostgresLive = PgClient.layer({ OIDs of user-defined types are assigned per database, so look them up in `pg_type` at startup rather than hard-coding them. + +## Values as text + +Read raw PostgreSQL text values without running result codecs (including custom +`types`) with `queryTextValues`: + +```ts +import { PgClient } from "@effect/sql-pg" +import { Effect } from "effect" + +const program = Effect.gen(function*() { + const sql = yield* PgClient.PgClient + const result = yield* sql.queryTextValues("SELECT now() AS at, 'infinity'::timestamptz AS until") + // result.fields: [{ name: "at", dataTypeId: 1184 }, { name: "until", dataTypeId: 1184 }] + // result.values: [["2026-11-24 22:31:05.123456+00", "infinity"]] +}) +``` + +Inside `withTransaction` it runs on the transaction's connection. diff --git a/.repos/effect/packages/sql/pg/package.json b/.repos/effect/packages/sql/pg/package.json index ffa098cbcd35e..e59b6b280d39a 100644 --- a/.repos/effect/packages/sql/pg/package.json +++ b/.repos/effect/packages/sql/pg/package.json @@ -1,6 +1,6 @@ { "name": "@effect/sql-pg", - "version": "4.1.5", + "version": "4.1.6", "type": "module", "license": "MIT", "description": "A PostgreSQL toolkit for Effect", @@ -63,12 +63,12 @@ "check": "tsc -b tsconfig.json" }, "devDependencies": { - "@testcontainers/postgresql": "^12.2.1", + "@testcontainers/postgresql": "^12.2.2", "@types/node": "^26.6.6", "effect": "workspace:^", "postgres": "^4.1.1", - "testcontainers": "^12.2.1", - "tinybench": "^6.2.3" + "testcontainers": "^12.2.2", + "tinybench": "^6.2.4" }, "peerDependencies": { "effect": "workspace:^" diff --git a/.repos/effect/packages/sql/pg/src/PgClient.ts b/.repos/effect/packages/sql/pg/src/PgClient.ts index 0892ccb889bf3..9af73bbff8374 100644 --- a/.repos/effect/packages/sql/pg/src/PgClient.ts +++ b/.repos/effect/packages/sql/pg/src/PgClient.ts @@ -21,6 +21,7 @@ import { SqlError, UnknownError } from "effect/sql/SqlError" import type { Custom, Fragment } from "effect/sql/Statement" import * as Statement from "effect/sql/Statement" import * as Stream from "effect/Stream" +import * as Tracer from "effect/Tracer" import type { Duplex } from "node:stream" import type { ConnectionOptions } from "node:tls" import { resolveConfig } from "./internal/config.ts" @@ -77,6 +78,36 @@ export interface PgClient extends Client.Base { * on it. */ readonly poolStats: Effect.Effect + /** + * Runs a query and returns field metadata alongside positional rows of raw + * PostgreSQL text values (`string | null`), bypassing result codecs + * (including `types`), `transformResultNames`, and `Statement.CurrentTransformer`. + * + * **Details** + * + * Runs on the active transaction's connection inside `withTransaction`; + * otherwise borrows a connection like any statement. + * + * **Example** (Reading values as text) + * + * ```ts + * import { PgClient } from "@effect/sql-pg" + * import { Effect } from "effect" + * + * const program = Effect.gen(function*() { + * const sql = yield* PgClient.PgClient + * const result = yield* sql.withTransaction( + * sql.queryTextValues("SELECT now() AS at, $1::numeric AS amount", ["1.50"]) + * ) + * // result.fields: [{ name: "at", dataTypeId: 1184 }, { name: "amount", dataTypeId: 1700 }] + * // result.values: [["2026-11-24 12:00:00.123456+00", "1.50"]] + * }) + * ``` + */ + readonly queryTextValues: ( + sql: string, + params?: ReadonlyArray + ) => Effect.Effect } /** @@ -157,6 +188,14 @@ export interface PgClientConfig { * Caches prepared statements by name. Enabled by default. Disable it for * poolers that cannot preserve named statements between queries, such as * PgBouncer in transaction mode with `max_prepared_statements = 0`. + * + * **Gotchas** + * + * With `multiplex` enabled, PgBouncer before 1.26.0 with + * `max_prepared_statements > 0` can misorder or drop responses to pipelined + * `Close` messages, failing connections with + * `Unexpected ParseComplete during close`. Set `prepare: false` or upgrade + * PgBouncer. */ readonly prepare?: boolean | undefined /** How many statements a connection keeps prepared. Defaults to `100`. */ @@ -313,37 +352,63 @@ const makeImpl = Effect.fnUntraced(function*( ): Effect.Effect, SqlError, Scope.Scope> => Effect.flatMap(listenAcquirer, (connection) => connection.listen(channel)) + const spanAttributes: ReadonlyArray = [ + ...(config.spanAttributes ? Object.entries(config.spanAttributes) : []), + [ATTR_DB_SYSTEM_NAME, "postgresql"], + // PostgreSQL connects to the database named after the user when none is given. + [ATTR_DB_NAMESPACE, resolved.startupParameters.database ?? resolved.username], + [ATTR_SERVER_ADDRESS, resolved.host], + [ATTR_SERVER_PORT, resolved.port] + ] + + const client = yield* Client.make({ + driver: "pg", + acquirer, + borrower, + // Postgres prepares transaction control like anything else, and a client + // with preparation turned off falls back to the unnamed path anyway. + prepareTransactionControls: true, + commit, + onCommitFailure, + // A session the server ended has nothing left to roll back. + isTransaction: (conn) => connectionInternals((conn as ConnectionImpl).connection).deadError() === undefined, + releaseSavepoint: (name) => `RELEASE SAVEPOINT ${name}`, + transactionAcquirer, + compiler, + spanAttributes, + transformRows + }) + + // Routed and traced as a statement is, without the connection wait time. + const queryTextValues = (sql: string, params?: ReadonlyArray) => + Effect.useSpan(Statement.spanName(spanAttributes), { kind: "client" }, (span) => + Effect.withFiber((fiber) => { + for (const [key, value] of spanAttributes) { + span.attribute(key, value) + } + span.attribute(ATTR_SQL_METHOD, "executeTextValues") + span.attribute(ATTR_DB_QUERY_TEXT, sql) + const run = (connection: Connection) => (connection as ConnectionImpl).connection.queryTextValues(sql, params) + const transaction = Context.getOrUndefined(fiber.context, client.transactionService) + const execute = transaction !== undefined + ? Effect.flatMap(Client.activeTransactionConnection(transaction), run) + : borrower !== undefined + ? borrower(run) + : Effect.scoped(Effect.flatMap(acquirer, run)) + return fiber.cache.tracerEnabled && fiber.getRef(Statement.SpanPropagationEnabled) + ? Effect.provideService(execute, Tracer.ParentSpan, span) + : execute + })) + return Object.assign( - yield* Client.make({ - driver: "pg", - acquirer, - borrower, - // Postgres prepares transaction control like anything else, and a client - // with preparation turned off falls back to the unnamed path anyway. - prepareTransactionControls: true, - commit, - onCommitFailure, - // A session the server ended has nothing left to roll back. - isTransaction: (conn) => connectionInternals((conn as ConnectionImpl).connection).deadError() === undefined, - releaseSavepoint: (name) => `RELEASE SAVEPOINT ${name}`, - transactionAcquirer, - compiler, - spanAttributes: [ - ...(config.spanAttributes ? Object.entries(config.spanAttributes) : []), - [ATTR_DB_SYSTEM_NAME, "postgresql"], - // PostgreSQL connects to the database named after the user when none is given. - [ATTR_DB_NAMESPACE, resolved.startupParameters.database ?? resolved.username], - [ATTR_SERVER_ADDRESS, resolved.host], - [ATTR_SERVER_PORT, resolved.port] - ], - transformRows - }), + client, { [TypeId]: TypeId as TypeId, config, poolStats: options.poolStats, json: (_: unknown) => Statement.fragment([PgJson(_)]), listen, + queryTextValues, notify: (channel: string, payload: string) => { const channelError = validateChannelName(channel, "notify") return channelError !== undefined ? @@ -573,3 +638,5 @@ const ATTR_DB_SYSTEM_NAME = "db.system.name" const ATTR_DB_NAMESPACE = "db.namespace" const ATTR_SERVER_ADDRESS = "server.address" const ATTR_SERVER_PORT = "server.port" +const ATTR_DB_QUERY_TEXT = "db.query.text" +const ATTR_SQL_METHOD = "effect.sql.method" diff --git a/.repos/effect/packages/sql/pg/src/PgConnection.ts b/.repos/effect/packages/sql/pg/src/PgConnection.ts index e80a20089b7ed..bf6cbb9202165 100644 --- a/.repos/effect/packages/sql/pg/src/PgConnection.ts +++ b/.repos/effect/packages/sql/pg/src/PgConnection.ts @@ -77,6 +77,10 @@ export type TypeId = "~@effect/sql-pg/PgConnection" * `preparedStatementCacheSize`. Disable them for poolers that drop named * statements, such as PgBouncer with `max_prepared_statements = 0`, or for * workloads that generate unique SQL. Streams always use unnamed statements. + * With `multiplex`, PgBouncer before 1.26.0 with `max_prepared_statements > 0` + * can misorder or drop responses to pipelined `Close` messages and fail + * connections with `Unexpected ParseComplete during close`; set + * `prepare: false` or upgrade PgBouncer. * * With `multiplex` enabled, unpinned queries from multiple fibers are * pipelined. Transactions, streams, and listeners remain exclusive. An @@ -133,6 +137,11 @@ export interface Config { * Forwarded without parsing `-c` flags or checking for duplicate GUCs. */ readonly startupOptions?: string | undefined + /** + * Custom streams must emit `close` when their transport closes. Streams + * created with `emitClose: false` are unsupported; without the event, a pool + * slot can remain occupied indefinitely. + */ readonly stream?: (() => Duplex) | undefined readonly types?: PgTypes.Registry | undefined readonly multiplex?: boolean | undefined @@ -190,6 +199,22 @@ export interface Result { readonly fields: ReadonlyArray } +/** + * The result of `queryTextValues`: positional rows holding each value as the + * server's text, or `null` for SQL `NULL`. + * + * @stability unstable + * @category models + * @since 4.1.6 + */ +export interface TextResult { + readonly command: string + readonly rowCount: number + readonly oid: number | null + readonly fields: ReadonlyArray + readonly values: ReadonlyArray> +} + /** * A `NOTIFY` message received while listening on a channel. * @@ -223,8 +248,9 @@ export interface PgConnection { * * After release, queries, streams and listeners through the returned * connection fail, and its `interrupt` does nothing. Releasing a pin with - * an in-flight statement or an open listener closes the session and fails - * any listener queues, as does leaving a transaction the pin began aborted. + * an in-flight statement, an open listener, or an unfinished transaction it + * began closes the session and fails any listener queues. Transactions + * already open before the pin are left to the caller. */ readonly pin: Effect.Effect /** @@ -254,6 +280,17 @@ export interface PgConnection { params?: ReadonlyArray, prepare?: boolean ) => Effect.Effect>, SqlError> + /** + * Runs a query and returns field metadata alongside positional rows of raw + * PostgreSQL text values (`string | null`), bypassing result codecs + * (including `Config.types`). Pass `false` to skip the prepared statement + * cache. Interruption behaves as for `query`. + */ + readonly queryTextValues: ( + sql: string, + params?: ReadonlyArray, + prepare?: boolean + ) => Effect.Effect /** * Streams rows without collecting the full result. The session is pinned for * the lifetime of the stream. An early abort behaves like an interrupted @@ -422,7 +459,11 @@ class PgConnectionImpl implements PgConnection { this[internalsKey] = { base: this, deadError: () => this.deadWith, - retireHooks: this.retireHooks + retireHooks: this.retireHooks, + onTransportClose: (f) => { + if (session.socket.closed) f() + else session.socket.once("close", f) + } } session.parser.onFieldError = this.onFieldError session.socket.on("data", this.onData) @@ -570,8 +611,9 @@ class PgConnectionImpl implements PgConnection { readonly encodeQuery = ( sql: string, params: ReadonlyArray, - cache: PreparedCache | undefined - ): Plan => encodeQuery(sql, params, this.registry, this.bindEncoder, cache) + cache: PreparedCache | undefined, + output: Output = "rows" + ): Plan => encodeQuery(sql, params, this.registry, this.bindEncoder, cache, output === "text") /** * Routes backend messages to the oldest statement still on the wire. @@ -650,8 +692,9 @@ class PgConnectionImpl implements PgConnection { // be in place before the parser reads on. this.session.parser.readField = this.pipelineInFlight[this.pipelineHead]?.machine.readField if (!entry.abandoned) Deferred.doneUnsafe(entry.deferred, result) - if (this.pipelineHead === this.pipelineInFlight.length) { - this.pipelineInFlight.length = 0 + // Compact once half consumed so a continuously busy pipeline stays bounded. + if (this.pipelineHead * 2 >= this.pipelineInFlight.length) { + this.pipelineInFlight.splice(0, this.pipelineHead) this.pipelineHead = 0 } } @@ -708,7 +751,7 @@ class PgConnectionImpl implements PgConnection { private readonly pipelineCycle = ( sql: string, params: ReadonlyArray, - wantRows: boolean, + output: Output, cache: PreparedCache | undefined ): Effect.Effect => Effect.flatMap( @@ -716,13 +759,13 @@ class PgConnectionImpl implements PgConnection { if (this.deadWith !== undefined) return Effect.fail(this.deadWith) let plan: Plan try { - plan = this.encodeQuery(sql, params, cache) + plan = this.encodeQuery(sql, params, cache, output) } catch (cause) { return Effect.fail(queryError(cause, "PgConnection: Failed to encode query")) } const deferred = Deferred.makeUnsafe() let entry: PipelineEntry - const machine = new QueryMachine(this, plan, wantRows, (result) => this.finishPipelineEntry(entry, result)) + const machine = new QueryMachine(this, plan, output, (result) => this.finishPipelineEntry(entry, result)) entry = { plan, deferred, machine, abandoned: false } this.pipelinePending.push(entry) this.consumer = this.pipelineConsumer @@ -738,7 +781,7 @@ class PgConnectionImpl implements PgConnection { ) ) if (cache === undefined || entry.plan.parses) return awaited - return retryStale(entry.plan, cache, awaited, () => this.pipelineCycle(sql, params, wantRows, undefined)) + return retryStale(entry.plan, cache, awaited, () => this.pipelineCycle(sql, params, output, undefined)) } ) @@ -749,9 +792,9 @@ class PgConnectionImpl implements PgConnection { readonly cycleOwned = ( sql: string, params: ReadonlyArray, - wantRows: boolean, + output: Output, cache: PreparedCache | undefined - ): Effect.Effect => Effect.suspend(() => this.attempt(sql, params, wantRows, cache)) + ): Effect.Effect => Effect.suspend(() => this.attempt(sql, params, output, cache)) /** * Runs one cycle. A reused statement the backend has since dropped, or whose @@ -761,19 +804,19 @@ class PgConnectionImpl implements PgConnection { private readonly attempt = ( sql: string, params: ReadonlyArray, - wantRows: boolean, + output: Output, cache: PreparedCache | undefined ): Effect.Effect => { if (this.deadWith !== undefined) return Effect.fail(this.deadWith) let plan: Plan try { - plan = this.encodeQuery(sql, params, cache) + plan = this.encodeQuery(sql, params, cache, output) } catch (cause) { return Effect.fail(queryError(cause, "PgConnection: Failed to encode query")) } - const run = runQuery(this, plan, wantRows) + const run = runQuery(this, plan, output) if (cache === undefined || plan.parses) return run - return retryStale(plan, cache, run, () => this.attempt(sql, params, wantRows, undefined)) + return retryStale(plan, cache, run, () => this.attempt(sql, params, output, undefined)) } /** Sends a `CancelRequest` for this session on a side connection. */ @@ -820,12 +863,12 @@ class PgConnectionImpl implements PgConnection { new Error("Pinned connection released with work outstanding"), "PgConnection: Pinned connection released with work outstanding" )) - } else if (view.startedIdle && this.transactionStatus === "E") { - // A failed cleanup, such as a cancelled `ROLLBACK`, leaves every later - // statement failing. A transaction open before the pin is its caller's. + } else if (view.startedIdle && this.transactionStatus !== "I") { + // An unfinished transaction the pin began would leak into the next + // checkout; transactions open before the pin belong to the caller. this.fatal(connectionQueryError( - new Error("Pinned connection released in an aborted transaction"), - "PgConnection: Pinned connection released in an aborted transaction" + new Error("Pinned connection released inside a transaction"), + "PgConnection: Pinned connection released inside a transaction" )) } return idle ? Effect.andThen(this.wire.release(1), this.owner.release(1)) : this.owner.release(1) @@ -837,24 +880,30 @@ class PgConnectionImpl implements PgConnection { private readonly run = ( sql: string, params: ReadonlyArray, - wantRows: boolean, + output: Output, prepare: boolean ): Effect.Effect => { const cache = prepare ? this.prepared : undefined return this.multiplex - ? this.pipelineCycle(sql, params, wantRows, cache) - : this.owner.withPermit(this.cycleOwned(sql, params, wantRows, cache)) + ? this.pipelineCycle(sql, params, output, cache) + : this.owner.withPermit(this.cycleOwned(sql, params, output, cache)) } readonly query = (sql: string, params?: ReadonlyArray, prepare = true): Effect.Effect => - Effect.map(this.run(sql, params ?? emptyParams, true, prepare), takeResult) + Effect.map(this.run(sql, params ?? emptyParams, "rows", prepare), takeResult) readonly queryValues = ( sql: string, params?: ReadonlyArray, prepare = true ): Effect.Effect>, SqlError> => - Effect.map(this.run(sql, params ?? emptyParams, false, prepare), takeValues) + Effect.map(this.run(sql, params ?? emptyParams, "values", prepare), takeValues) + + readonly queryTextValues = ( + sql: string, + params?: ReadonlyArray, + prepare = true + ): Effect.Effect => Effect.map(this.run(sql, params ?? emptyParams, "text", prepare), takeText) readonly stream = (sql: string, params?: ReadonlyArray): Stream.Stream => streamRows(this, this.pin, sql, params ?? emptyParams) @@ -896,13 +945,13 @@ class PinnedPgConnection implements PgConnection { private cycle( sql: string, params: ReadonlyArray, - wantRows: boolean, + output: Output, prepare: boolean ): Effect.Effect { return this.base.wire.withPermit(Effect.suspend(() => this.released ? Effect.fail(pinReleasedError()) - : this.base.cycleOwned(sql, params, wantRows, prepare ? this.base.prepared : undefined) + : this.base.cycleOwned(sql, params, output, prepare ? this.base.prepared : undefined) )) } @@ -917,14 +966,21 @@ class PinnedPgConnection implements PgConnection { } readonly query = (sql: string, params?: ReadonlyArray, prepare = true): Effect.Effect => - Effect.map(this.cycle(sql, params ?? emptyParams, true, prepare), takeResult) + Effect.map(this.cycle(sql, params ?? emptyParams, "rows", prepare), takeResult) readonly queryValues = ( sql: string, params?: ReadonlyArray, prepare = true ): Effect.Effect>, SqlError> => - Effect.map(this.cycle(sql, params ?? emptyParams, false, prepare), takeValues) + Effect.map(this.cycle(sql, params ?? emptyParams, "values", prepare), takeValues) + + readonly queryTextValues = ( + sql: string, + params?: ReadonlyArray, + prepare = true + ): Effect.Effect => + Effect.map(this.cycle(sql, params ?? emptyParams, "text", prepare), takeText) readonly stream = (sql: string, params?: ReadonlyArray): Stream.Stream => streamRows(this.base, this.pin, sql, params ?? emptyParams) @@ -935,6 +991,9 @@ class PinnedPgConnection implements PgConnection { listenChannel(this.base, this.pin, channel) } +/** What a cycle collects: object rows, decoded positional rows, or positional text. */ +type Output = "rows" | "values" | "text" + interface QueryOutput { readonly result: Result readonly values: ReadonlyArray> @@ -1048,6 +1107,13 @@ const emptyParams: ReadonlyArray = [] const takeResult = (output: QueryOutput): Result => output.result const takeValues = (output: QueryOutput): ReadonlyArray> => output.values +const takeText = ({ result, values }: QueryOutput): TextResult => ({ + command: result.command, + rowCount: result.rowCount, + oid: result.oid, + fields: result.fields, + values: values as ReadonlyArray> +}) /** * The tail of every extended-query frame. `Describe` names the unnamed portal, @@ -1108,11 +1174,12 @@ const encodeUnnamed = ( sql: string, parameters: ReadonlyArray, parameterTypes: ReadonlyArray, - encodeBind: BindEncoder + encodeBind: BindEncoder, + textResults: boolean ): Plan => { const parse = PgProtocol.encodeParse({ name: "", query: sql, parameterTypes }) if (EffectResult.isFailure(parse)) throw parse.failure - const bind = encodeBind({ portal: "", statement: "", parameters }) + const bind = encodeBind({ portal: "", statement: "", parameters, textResults }) if (EffectResult.isFailure(bind)) throw bind.failure return { frame: concat([parse.success, bind.success, describeExecuteSync]), @@ -1140,7 +1207,8 @@ const encodeQuery = ( params: ReadonlyArray, registry: PgTypes.Registry | undefined, encodeBind: BindEncoder, - cache: PreparedCache | undefined + cache: PreparedCache | undefined, + textResults: boolean ): Plan => { const count = params.length const parameters: Array = new Array(count) @@ -1152,17 +1220,17 @@ const encodeQuery = ( } if (cache === undefined) { - return encodeUnnamed(sql, parameters, parameterTypes, encodeBind) + return encodeUnnamed(sql, parameters, parameterTypes, encodeBind, textResults) } - const prepared = cache.get(sql, parameterTypes) + const prepared = cache.get(sql, parameterTypes, textResults) if (!prepared.ready && prepared.parsing) { // Another cycle is already on the wire carrying this name's `Parse`. // Naming it again would collide, and reusing it would mean binding to // columns nobody has seen yet, so this execution goes unnamed. - return encodeUnnamed(sql, parameters, parameterTypes, encodeBind) + return encodeUnnamed(sql, parameters, parameterTypes, encodeBind, textResults) } - const bind = encodeBind({ portal: "", statement: prepared.name, parameters }) + const bind = encodeBind({ portal: "", statement: prepared.name, parameters, textResults }) if (EffectResult.isFailure(bind)) throw bind.failure const parse = prepared.ready ? undefined : PgProtocol.encodeParse({ name: prepared.name, query: sql, parameterTypes }) if (parse !== undefined && EffectResult.isFailure(parse)) throw parse.failure @@ -1197,9 +1265,9 @@ const encodeQuery = ( } /** - * The statements one connection has prepared, keyed by SQL text and the - * parameter OIDs inferred for it: the same text with differently typed - * parameters is a different statement to the backend. + * Prepared statements for one connection, keyed by result format, parameter + * OIDs, and SQL text. Text-format runs are keyed separately because cached + * descriptions hold format-specific column readers. * * The cache is bounded and evicts least-recently-used. An evicted statement is * closed on the backend, but its `Close` waits for the next statement to go @@ -1216,8 +1284,8 @@ class PreparedCache { this.max = max } - get(sql: string, parameterTypes: ReadonlyArray): Prepared { - const key = parameterTypes.length === 0 ? sql : `${sql}\u0000${parameterTypes.join(",")}` + get(sql: string, parameterTypes: ReadonlyArray, textResults: boolean): Prepared { + const key = `${textResults ? "T" : "B"}\u0000${parameterTypes.join(",")}\u0000${sql}` const found = this.statements.get(key) if (found !== undefined) { // Re-insert to move it to the end: `Map` iterates in insertion order, so @@ -1307,6 +1375,7 @@ type BindEncoder = (options: { readonly portal: string readonly statement: string readonly parameters: ReadonlyArray + readonly textResults: boolean }) => EffectResult.Result /** @@ -1407,6 +1476,7 @@ class QueryMachine implements Consumer { /** Object rows, or `undefined` when the caller asked for positional ones. */ private readonly rows: Array | undefined private readonly values: Array> | undefined + private readonly textResults: boolean private closes: number private phase: QueryPhase @@ -1424,14 +1494,15 @@ class QueryMachine implements Consumer { constructor( conn: PgConnectionImpl, plan: Plan, - wantRows: boolean, + output: Output, finish: (effect: Effect.Effect) => void ) { this.conn = conn this.plan = plan this.finish = finish - this.rows = wantRows ? [] : undefined - this.values = wantRows ? undefined : [] + this.rows = output === "rows" ? [] : undefined + this.values = output === "rows" ? undefined : [] + this.textResults = output === "text" this.closes = plan.closes this.phase = plan.closes > 0 ? "close" : plan.parses ? "parse" : "bind" const description = plan.description @@ -1522,7 +1593,7 @@ class QueryMachine implements Consumer { return case "RowDescription": { if (this.phase !== "describe") return this.failDesync(`Unexpected RowDescription during ${this.phase}`) - const description = describe(message.fields, this.conn.registry) + const description = describe(message.fields, this.conn.registry, this.textResults) if (EffectResult.isFailure(description)) { return this.conn.fatal(queryError(description.failure, "PgConnection: Failed to decode row")) } @@ -1652,14 +1723,14 @@ const drainAborted = ( const runQuery = ( conn: PgConnectionImpl, plan: Plan, - wantRows: boolean + output: Output ): Effect.Effect => Effect.callback((resume) => { if (conn.deadWith !== undefined) { resume(Effect.fail(conn.deadWith)) return } - const machine = new QueryMachine(conn, plan, wantRows, (effect) => { + const machine = new QueryMachine(conn, plan, output, (effect) => { conn.consumer = undefined resume(effect) }) @@ -1683,6 +1754,27 @@ const runQuery = ( }) }) +// Preserve leading U+FEFF as data rather than stripping it as a BOM. +const textDecoder = new TextDecoder("utf-8", { fatal: true, ignoreBOM: true }) + +const readText: PgProtocol.FieldReader = (bytes, offset, size) => + size < 0 ? null : textDecoder.decode(bytes.subarray(offset, offset + size)) + +const makeTextReader = ( + fields: ReadonlyArray +): EffectResult.Result, PgTypes.CodecError> => { + for (let index = 0; index < fields.length; index++) { + if (fields[index].format !== 0) { + return EffectResult.fail( + new PgTypes.CodecError({ + message: `Only the text format is supported, column ${index} has format ${fields[index].format}` + }) + ) + } + } + return EffectResult.succeed(readText) +} + /** Turns one decoded row into an object keyed by column name. */ type RowBuilder = (rowValues: ReadonlyArray) => Row @@ -1698,9 +1790,10 @@ const emptyFields: ReadonlyArray = [] /** Derives the per-column readers and the row constructor for a description. */ const describe = ( fields: ReadonlyArray, - registry: PgTypes.Registry | undefined + registry: PgTypes.Registry | undefined, + textResults = false ): EffectResult.Result => { - const reader = PgTypes.makeFieldReader(fields, registry) + const reader = textResults ? makeTextReader(fields) : PgTypes.makeFieldReader(fields, registry) if (EffectResult.isFailure(reader)) return EffectResult.fail(reader.failure) const resultFields: Array = new Array(fields.length) for (let index = 0; index < fields.length; index++) { @@ -2033,7 +2126,7 @@ const unlisten = (conn: PgConnectionImpl, pinned: PinnedPgConnection, identifier unlistenTimeoutMillis ) return Effect.ensuring( - Effect.ignore(conn.cycleOwned(`UNLISTEN ${identifier}`, emptyParams, true, conn.prepared)), + Effect.ignore(conn.cycleOwned(`UNLISTEN ${identifier}`, emptyParams, "rows", conn.prepared)), Effect.andThen(Effect.sync(() => clearTimeout(timeout)), releaseUnlisten(conn, pinned)) ) } diff --git a/.repos/effect/packages/sql/pg/src/PgPool.ts b/.repos/effect/packages/sql/pg/src/PgPool.ts index 1fb1de888e1bf..2a703e0a99ef2 100644 --- a/.repos/effect/packages/sql/pg/src/PgPool.ts +++ b/.repos/effect/packages/sql/pg/src/PgPool.ts @@ -13,6 +13,7 @@ import * as Option from "effect/Option" import * as Pool from "effect/Pool" import { TracerTimingEnabled } from "effect/References" import * as Scope from "effect/Scope" +import * as Semaphore from "effect/Semaphore" import { ConnectionError, SqlError } from "effect/sql/SqlError" import { SpanPropagationEnabled } from "effect/sql/Statement" import * as Tracer from "effect/Tracer" @@ -46,6 +47,7 @@ export type TypeId = "~@effect/sql-pg/PgPool" * * The defaults are 0 to 10 connections and a 60-second idle timeout. * `connectionTTL` replaces connections that exceed the configured lifetime. + * A retired session keeps its `maxConnections` slot until its transport closes. * Every connection is used at least once, so a TTL of zero disables reuse. * `acquireTimeout` bounds how long a checkout takes to acquire a connection, * including opening a new one; by default it waits indefinitely. @@ -143,8 +145,9 @@ export const PgPool = Context.Service("@effect/sql-pg/PgPool") * **Details** * * Connections are opened lazily up to `maxConnections` and released down to - * `minConnections` after `idleTimeout` without use. Closing the scope shuts - * the pool down and releases every session. + * `minConnections` after `idleTimeout` without use. A retired session stops + * being handed out immediately, but its slot is held until its transport + * closes. Closing the scope shuts the pool down and releases every session. * * With `SpanPropagationEnabled`, a statement that waited for a new session gets * a `db.connect` child span covering the part of the connect it waited for. @@ -211,27 +214,38 @@ export const make = Effect.fnUntraced(function*(options: Config): Effect.fn.Retu // Assigned below, once the pool exists. `acquire` only runs when the pool // opens a connection, which is always after that. let pool: Pool.Pool - const acquire = Effect.suspend(() => { - const startTime = clock.currentTimeNanosUnsafe() - return Effect.tap(PgConnection.make(options), (connection) => - Effect.sync(() => { - connects.set(connection, [startTime, clock.currentTimeNanosUnsafe()]) - createdAt.set(connection, clock.currentTimeMillisUnsafe()) - const internals = connectionInternals(connection) - internals.retireHooks.add(() => { - deadConnections.add(connection) - // `deadConnections` is only read by the next checkout, and a checkout - // already waiting for this connection would never get that far. Tell - // the pool now so it can replace the connection and admit them. - runFork(Pool.invalidate(pool, connection)) + const maxConnections = options.maxConnections ?? 10 + // One permit per open transport. The pool replaces a retired session at + // once, but the replacement only connects after the old transport closes. + const transports = Semaphore.makeUnsafe(maxConnections) + const acquire = Effect.uninterruptibleMask((restore) => { + // Closed once: on connect failure/interruption or when the transport closes. + const permit = Scope.makeUnsafe() + return Effect.onError( + Effect.flatMap(restore(Scope.provide(transports.takeScoped(1), permit)), () => { + const startTime = clock.currentTimeNanosUnsafe() + return Effect.map(restore(PgConnection.make(options)), (connection) => { + connects.set(connection, [startTime, clock.currentTimeNanosUnsafe()]) + createdAt.set(connection, clock.currentTimeMillisUnsafe()) + const internals = connectionInternals(connection) + internals.onTransportClose(() => runFork(Scope.close(permit, Exit.void))) + internals.retireHooks.add(() => { + deadConnections.add(connection) + // `deadConnections` is only read by the next checkout, and a checkout + // already waiting for this connection would never get that far. Tell + // the pool now so it can replace the connection and admit them. + runFork(Pool.invalidate(pool, connection)) + }) + // Pinning a shared session has to take it out of circulation, or a + // second checkout lands on the connection its own stream is holding. + if (multiplex) internals.reserve = Pool.reserve(pool, connection) + return connection }) - // Pinning a shared session has to take it out of circulation, or a - // second checkout lands on the connection its own stream is holding. - if (multiplex) internals.reserve = Pool.reserve(pool, connection) - })) + }), + (cause) => Scope.close(permit, Exit.failCause(cause)) + ) }) - const maxConnections = options.maxConnections ?? 10 pool = yield* Pool.makeWithTTL({ acquire, min: options.minConnections ?? 0, @@ -254,9 +268,30 @@ export const make = Effect.fnUntraced(function*(options: Config): Effect.fn.Retu return openedAt !== undefined && clock.currentTimeMillisUnsafe() - openedAt >= connectionTTL } - // A checkout runs per statement, so the case where nothing has died and the - // first connection is usable stays a plain flatMap; retrying is the - // exception and pays for the loop. + // Runs `f` uninterruptibly in a child scope, closing it on failure or + // interruption so acquired resources are returned instead of left on the caller. + const withChildScope = ( + f: ( + scope: Scope.Closeable, + restore: (effect: Effect.Effect) => Effect.Effect + ) => Effect.Effect + ): Effect.Effect => + Effect.uninterruptibleMask((restore) => + Effect.withFiber((fiber) => { + const scope = Scope.forkUnsafe(Context.getUnsafe(fiber.context, Scope.Scope)) + return Effect.onError(f(scope, restore), (cause) => Scope.close(scope, Exit.failCause(cause))) + }) + ) + + // One checkout attempt (`undefined` if rejected). Closes the attempt scope + // before retrying so the rejected transport frees its slot first. + const attempt = withChildScope((scope, restore) => + Effect.flatMap(restore(Scope.provide(Pool.get(pool), scope)), (connection) => + expired(connection) + ? Effect.andThen(Pool.invalidate(pool, connection), Effect.as(Scope.close(scope, Exit.void), undefined)) + : Effect.succeed(connection)) + ) + const retry: Effect.Effect = Effect.gen(function*() { while (true) { if (deadConnections.size > 0) { @@ -264,20 +299,23 @@ export const make = Effect.fnUntraced(function*(options: Config): Effect.fn.Retu deadConnections.clear() yield* Effect.forEach(dead, (connection) => Pool.invalidate(pool, connection), { discard: true }) } - const connection = yield* Pool.get(pool) - if (expired(connection)) { - yield* Pool.invalidate(pool, connection) - continue - } - return connection + const connection = yield* attempt + if (connection !== undefined) return connection } }) - const checkout: Effect.Effect = Effect.suspend(() => - deadConnections.size > 0 ? retry : Effect.flatMap(Pool.get(pool), (connection) => + // Without a TTL, only dead sessions are rejected so the common path stays a + // plain flatMap. With a TTL, an expired session's transport may still be + // open, so every attempt leases into its own scope and a rejected lease is + // released before the next attempt. + const first: Effect.Effect = connectionTTL !== undefined + ? Effect.flatMap(attempt, (connection) => connection === undefined ? retry : Effect.succeed(connection)) + : Effect.flatMap(Pool.get(pool), (connection) => expired(connection) ? Effect.andThen(Pool.invalidate(pool, connection), retry) : Effect.succeed(connection)) + const checkout: Effect.Effect = Effect.suspend(() => + deadConnections.size > 0 ? retry : first ) const acquireTimedOut = () => @@ -291,26 +329,19 @@ export const make = Effect.fnUntraced(function*(options: Config): Effect.fn.Retu }) ) - // The acquisition runs in a child scope, so a timeout or failure gives back - // any lease or reservation it already took instead of leaving them to the - // caller's scope. On success the child scope closes with the caller's. const withAcquireTimeout = ( effect: Effect.Effect ): Effect.Effect => acquireTimeout === undefined ? effect : - Effect.uninterruptibleMask((restore) => - Effect.flatMap(Effect.scope, (parent) => - Effect.flatMap(Scope.fork(parent), (scope) => - Effect.onError( - restore(Effect.timeoutOrElse(Scope.provide(effect, scope), { - duration: acquireTimeout, - orElse: acquireTimedOut - })), - (cause) => Scope.close(scope, Exit.failCause(cause)) - ))) + withChildScope((scope, restore) => + restore(Effect.timeoutOrElse(Scope.provide(effect, scope), { + duration: acquireTimeout, + orElse: acquireTimedOut + })) ) + const rejected: unique symbol = Symbol() const handedOut = Effect.flatMap(checkout, handOut) const get = withAcquireTimeout(handedOut) @@ -318,22 +349,28 @@ export const make = Effect.fnUntraced(function*(options: Config): Effect.fn.Retu // for shared statements to drain, so the acquire timeout covers it too. const reserve = withAcquireTimeout(Effect.flatMap(handedOut, (connection) => connection.pin)) - // `Pool.use` cannot pre-check a session or bound its wait. Use it only when - // no TTL or acquire timeout applies and no connection awaits retirement. - // Checking inside its callback can deadlock a size-one pool while acquiring - // a replacement. + // `Pool.use` cannot bound its wait, so it is used only when no acquire + // timeout applies and no connection awaits retirement. const use = ( f: (connection: PgConnection.PgConnection) => Effect.Effect ): Effect.Effect => - Effect.suspend(() => - connectionTTL === undefined && acquireTimeout === undefined && deadConnections.size === 0 - ? Pool.use( - pool, - (connection) => - connects.has(connection) ? Effect.andThen(reportConnect(connection), f(connection)) : f(connection) - ) - : Effect.scoped(Effect.flatMap(get, f)) - ) + Effect.suspend(() => { + if (acquireTimeout !== undefined || deadConnections.size > 0) return Effect.scoped(Effect.flatMap(get, f)) + const run = (connection: PgConnection.PgConnection) => + connects.has(connection) ? Effect.andThen(reportConnect(connection), f(connection)) : f(connection) + if (connectionTTL === undefined) return Pool.use(pool, run) + // An expired session is rejected inside the lease and replaced after it: + // requesting the replacement while holding the lease can deadlock a + // size-one pool. The callback keeps its own scope, as on the scoped path. + return Effect.flatMap( + Pool.use(pool, (connection): Effect.Effect => + expired(connection) + ? Effect.as(Pool.invalidate(pool, connection), rejected) + : Effect.scoped(run(connection))), + (a): Effect.Effect => + a === rejected ? Effect.scoped(Effect.flatMap(get, f)) : Effect.succeed(a) + ) + }) const pgPool: PgPool = { [TypeId]: TypeId, diff --git a/.repos/effect/packages/sql/pg/src/PgProtocol.ts b/.repos/effect/packages/sql/pg/src/PgProtocol.ts index e26d9ac8940a1..2f9d3a54df1d6 100644 --- a/.repos/effect/packages/sql/pg/src/PgProtocol.ts +++ b/.repos/effect/packages/sql/pg/src/PgProtocol.ts @@ -890,7 +890,8 @@ const valueWriterUnsafe = Symbol.for("@effect/sql-pg/PgProtocol/ValueWriter/unsa * **Details** * * `textFormat` identifies parameters encoded as text. All other parameters - * use the binary format. + * use the binary format. Result columns use binary format unless + * `textResults` is `true`, which requests text format for all columns. * * **Example** (Encoding a `Bind` message) * @@ -913,6 +914,7 @@ export const makeBindEncoder = ( readonly portal: string readonly statement: string readonly parameters: ReadonlyArray + readonly textResults?: boolean | undefined }): Result.Result => { try { const writer = begin(0x42) @@ -972,7 +974,7 @@ export const makeBindEncoder = ( trailer[trailerOffset] = 0 trailer[trailerOffset + 1] = 1 trailer[trailerOffset + 2] = 0 - trailer[trailerOffset + 3] = 1 + trailer[trailerOffset + 3] = options.textResults === true ? 0 : 1 writer.offset = trailerOffset + 4 return Result.succeed(end()) } catch (error) { diff --git a/.repos/effect/packages/sql/pg/src/PgTypes.ts b/.repos/effect/packages/sql/pg/src/PgTypes.ts index ff61c125e6652..2cf523a8d3060 100644 --- a/.repos/effect/packages/sql/pg/src/PgTypes.ts +++ b/.repos/effect/packages/sql/pg/src/PgTypes.ts @@ -30,6 +30,11 @@ * and signed bigint microseconds independently. No units are normalized. * Convert microseconds explicitly before JSON serialization. * + * Built-in ranges (`int4range`, `int8range`, `numrange`, `daterange`, `tsrange`, + * `tstzrange`) decode to `Range` using their subtype codec, and multiranges + * decode to `ReadonlyArray>`. User-defined ranges take the + * unregistered UTF-8 fallback. + * * @stability unstable * @since 4.0.0 */ @@ -369,6 +374,18 @@ export const OID = { record: 2249, uuid: 2950, jsonb: 3802, + int4range: 3904, + numrange: 3906, + tsrange: 3908, + tstzrange: 3910, + daterange: 3912, + int8range: 3926, + int4multirange: 4451, + nummultirange: 4532, + tsmultirange: 4533, + tstzmultirange: 4534, + datemultirange: 4535, + int8multirange: 4536, boolArray: 1000, byteaArray: 1001, nameArray: 1003, @@ -394,7 +411,19 @@ export const OID = { regclassArray: 2210, recordArray: 2287, uuidArray: 2951, - jsonbArray: 3807 + jsonbArray: 3807, + int4rangeArray: 3905, + numrangeArray: 3907, + tsrangeArray: 3909, + tstzrangeArray: 3911, + daterangeArray: 3913, + int8rangeArray: 3927, + int4multirangeArray: 6150, + nummultirangeArray: 6151, + tsmultirangeArray: 6152, + tstzmultirangeArray: 6153, + datemultirangeArray: 6155, + int8multirangeArray: 6157 } as const const arrayToElement = new Map([ @@ -423,7 +452,19 @@ const arrayToElement = new Map([ [OID.regclassArray, OID.regclass], [OID.recordArray, OID.record], [OID.uuidArray, OID.uuid], - [OID.jsonbArray, OID.jsonb] + [OID.jsonbArray, OID.jsonb], + [OID.int4rangeArray, OID.int4range], + [OID.numrangeArray, OID.numrange], + [OID.tsrangeArray, OID.tsrange], + [OID.tstzrangeArray, OID.tstzrange], + [OID.daterangeArray, OID.daterange], + [OID.int8rangeArray, OID.int8range], + [OID.int4multirangeArray, OID.int4multirange], + [OID.nummultirangeArray, OID.nummultirange], + [OID.tsmultirangeArray, OID.tsmultirange], + [OID.tstzmultirangeArray, OID.tstzmultirange], + [OID.datemultirangeArray, OID.datemultirange], + [OID.int8multirangeArray, OID.int8multirange] ]) const elementToArray = new Map( @@ -975,6 +1016,9 @@ interface UnsafeCodec { type Lookup = (oid: number) => UnsafeCodec | undefined +const requireCodec = (oid: number, lookup: Lookup): UnsafeCodec => + lookup(oid) ?? fail(`No codec registered for OID ${oid}`) + const toUnsafeCodec = (codec: Codec): UnsafeCodec => ({ encode(value) { const encoded = codec.encode(value) @@ -1255,6 +1299,22 @@ export interface Interval { readonly microseconds: bigint } +/** + * A PostgreSQL range. `null` represents an unbounded side; an empty range has + * `empty: true` with `null` bounds and `false` inclusivity flags. + * + * @stability unstable + * @category models + * @since 4.0.0 + */ +export interface Range { + readonly lower: A | null + readonly upper: A | null + readonly lowerInclusive: boolean + readonly upperInclusive: boolean + readonly empty: boolean +} + const intervalValue = (value: unknown): Interval => { if (typeof value !== "object" || value === null) return fail("Expected an object for interval") const interval = value as Interval @@ -1434,6 +1494,15 @@ const builtinScalars = new Map>([ [OID.interval, intervalCodec] ]) +const rangeTypes: ReadonlyArray = [ + [OID.int4range, OID.int4, OID.int4multirange], + [OID.numrange, OID.numeric, OID.nummultirange], + [OID.tsrange, OID.timestamp, OID.tsmultirange], + [OID.tstzrange, OID.timestamptz, OID.tstzmultirange], + [OID.daterange, OID.date, OID.datemultirange], + [OID.int8range, OID.int8, OID.int8multirange] +] + const makeArrayCodec = (elementOid: number, lookup: Lookup): UnsafeCodec> => codecOf( (bytes, offset, size) => decodeArray(bytes, offset, size, elementOid, lookup), @@ -1441,6 +1510,20 @@ const makeArrayCodec = (elementOid: number, lookup: Lookup): UnsafeCodec writeArray(sink, value, elementOid, lookup) ) +const makeRangeCodec = (subtypeOid: number, lookup: Lookup): UnsafeCodec> => + codecOf( + (bytes, offset, size) => decodeRange(bytes, offset, size, subtypeOid, lookup), + (value) => encodeRange(value, subtypeOid, lookup), + (sink, value) => writeRange(sink, value, subtypeOid, lookup) + ) + +const makeMultirangeCodec = (rangeOid: number, lookup: Lookup): UnsafeCodec>> => + codecOf( + (bytes, offset, size) => decodeMultirange(bytes, offset, size, rangeOid, lookup), + (value) => encodeMultirange(value, rangeOid, lookup), + (sink, value) => writeMultirange(sink, value, rangeOid, lookup) + ) + /** * Anonymous `record` values (`ROW(...)`, `(a, b)`) decode as an array of their * fields. The binary form names each field's type, so fields use the same @@ -1454,11 +1537,15 @@ const makeRecordCodec = (lookup: Lookup): UnsafeCodec> => ) /** - * The built-ins for one registry. Arrays and records decode their contents - * through the lookup, so each registry builds its own. + * The built-ins for one registry. Arrays, ranges, multiranges, and records + * decode their contents through the lookup, so each registry builds its own. */ const makeBuiltins = (lookup: Lookup): Map> => { const codecs = new Map>(builtinScalars) + for (const [rangeOid, subtypeOid, multirangeOid] of rangeTypes) { + codecs.set(rangeOid, makeRangeCodec(subtypeOid, lookup)) + codecs.set(multirangeOid, makeMultirangeCodec(rangeOid, lookup)) + } for (const [arrayOid, elementOid] of arrayToElement) { codecs.set(arrayOid, makeArrayCodec(elementOid, lookup)) } @@ -1467,9 +1554,8 @@ const makeBuiltins = (lookup: Lookup): Map> => { } /** - * Every built-in OID is below this, and PostgreSQL hands user-defined types - * OIDs from 16384 up, so a direct table covers the common case and the map - * covers registered ones. + * Direct lookup table limit. Multirange OIDs and user-defined types (16384+) + * sit above this and resolve through the map. */ const tableSize = 4096 @@ -1485,7 +1571,9 @@ const builtins = makeBuiltins(lookup) */ const codecs = new Map>(builtins) -for (const [oid, codec] of codecs) table[oid] = codec +for (const [oid, codec] of codecs) { + if (oid < tableSize) table[oid] = codec +} interface RegistryState { readonly codecs: Map> @@ -1579,8 +1667,7 @@ const encodeArray = (value: unknown, elementOid: number, lookup: Lookup): Uint8A if (!Array.isArray(value)) { return fail("Expected an array") } - const codec = lookup(elementOid) - if (codec === undefined) return fail(`No codec registered for OID ${elementOid}`) + const codec = requireCodec(elementOid, lookup) const count = value.length const elements: Array = new Array(count) let hasNull = false @@ -1755,6 +1842,170 @@ const decodeRecord = (bytes: Uint8Array, start: number, size: number, lookup: Lo return values } +// ----------------------------------------------------------------------------- +// ranges and multiranges +// ----------------------------------------------------------------------------- + +const RANGE_EMPTY = 0x01 +const RANGE_LB_INC = 0x02 +const RANGE_UB_INC = 0x04 +const RANGE_LB_INF = 0x08 +const RANGE_UB_INF = 0x10 + +/** The int32 length of the value framed at `offset`, which has to end by `limit`. */ +const frameSize = (bytes: Uint8Array, offset: number, limit: number, name: string): number => { + if (offset + 4 > limit) return fail(`Truncated ${name}`) + const size = readInt32(bytes, offset) + if (size < 0) return fail(`Invalid ${name} length: ${size}`) + if (offset + 4 + size > limit) return fail(`Truncated ${name}`) + return size +} + +const readWith = (codec: UnsafeCodec, bytes: Uint8Array, offset: number, size: number): unknown => + codec.read !== undefined ? codec.read(bytes, offset, size) : codec.decode(region(bytes, offset, size)) + +/** `headerSize` bytes for the caller to fill, then each part behind its int32 length. */ +const framed = (headerSize: number, parts: ReadonlyArray): Uint8Array => { + let size = headerSize + for (const part of parts) size += 4 + part.length + const bytes = new Uint8Array(size) + let offset = headerSize + for (const part of parts) { + writeInt32(bytes, offset, part.length) + bytes.set(part, offset + 4) + offset += 4 + part.length + } + return bytes +} + +const writeFramed = (sink: ValueSink, value: unknown, oid: number, lookup: Lookup): void => { + const token = sink.beginLength() + writeValue(sink, value, oid, lookup) + sink.endLength(token) +} + +const rangeValue = (value: unknown): Range => { + if (typeof value !== "object" || value === null) return fail("Expected an object for range") + const range = value as Range + if (typeof range.empty !== "boolean") return fail("Expected a boolean for range empty") + if (typeof range.lowerInclusive !== "boolean") return fail("Expected a boolean for range lowerInclusive") + if (typeof range.upperInclusive !== "boolean") return fail("Expected a boolean for range upperInclusive") + return range +} + +const rangeFlags = (range: Range): number => { + let flags = 0 + if (range.lower === null) flags |= RANGE_LB_INF + else if (range.lowerInclusive) flags |= RANGE_LB_INC + if (range.upper === null) flags |= RANGE_UB_INF + else if (range.upperInclusive) flags |= RANGE_UB_INC + return flags +} + +/** + * PostgreSQL range_send: a flags byte, then an int32 length and subtype bytes + * for each finite bound when the range is not empty. + */ +const encodeRange = (value: unknown, subtypeOid: number, lookup: Lookup): Uint8Array => { + const range = rangeValue(value) + if (range.empty) return new Uint8Array([RANGE_EMPTY]) + const codec = requireCodec(subtypeOid, lookup) + const bounds: Array = [] + if (range.lower !== null) bounds.push(codec.encode(range.lower)) + if (range.upper !== null) bounds.push(codec.encode(range.upper)) + const bytes = framed(1, bounds) + bytes[0] = rangeFlags(range) + return bytes +} + +const writeRange = (sink: ValueSink, value: unknown, subtypeOid: number, lookup: Lookup): void => { + const range = rangeValue(value) + if (range.empty) return sink.uint8(RANGE_EMPTY) + sink.uint8(rangeFlags(range)) + if (range.lower !== null) writeFramed(sink, range.lower, subtypeOid, lookup) + if (range.upper !== null) writeFramed(sink, range.upper, subtypeOid, lookup) +} + +const decodeRange = ( + bytes: Uint8Array, + start: number, + size: number, + subtypeOid: number, + lookup: Lookup +): Range => { + if (size < 1) return fail("Truncated range value") + const flags = bytes[start] + // An empty range has no bounds, whatever its other flags say. + const hasLower = (flags & (RANGE_EMPTY | RANGE_LB_INF)) === 0 + const hasUpper = (flags & (RANGE_EMPTY | RANGE_UB_INF)) === 0 + const codec = requireCodec(subtypeOid, lookup) + const limit = start + size + let offset = start + 1 + let lower: unknown = null + let upper: unknown = null + if (hasLower) { + const boundSize = frameSize(bytes, offset, limit, "range bound") + lower = readWith(codec, bytes, offset + 4, boundSize) + offset += 4 + boundSize + } + if (hasUpper) { + const boundSize = frameSize(bytes, offset, limit, "range bound") + upper = readWith(codec, bytes, offset + 4, boundSize) + offset += 4 + boundSize + } + if (offset !== limit) return fail("Range value has trailing bytes") + return { + lower, + upper, + lowerInclusive: hasLower && (flags & RANGE_LB_INC) !== 0, + upperInclusive: hasUpper && (flags & RANGE_UB_INC) !== 0, + empty: (flags & RANGE_EMPTY) !== 0 + } +} + +/** + * PostgreSQL multirange_send: an int32 count, then an int32 length and range + * bytes for each range. + */ +const encodeMultirange = (value: unknown, rangeOid: number, lookup: Lookup): Uint8Array => { + if (!Array.isArray(value)) return fail("Expected an array for multirange") + const codec = requireCodec(rangeOid, lookup) + const bytes = framed(4, Array.from(value, (range) => codec.encode(range))) + writeInt32(bytes, 0, value.length) + return bytes +} + +const writeMultirange = (sink: ValueSink, value: unknown, rangeOid: number, lookup: Lookup): void => { + if (!Array.isArray(value)) return fail("Expected an array for multirange") + sink.int32(value.length) + for (let i = 0; i < value.length; i++) writeFramed(sink, value[i], rangeOid, lookup) +} + +const decodeMultirange = ( + bytes: Uint8Array, + start: number, + size: number, + rangeOid: number, + lookup: Lookup +): ReadonlyArray> => { + if (size < 4) return fail("Truncated multirange value") + const count = readInt32(bytes, start) + if (count < 0) return fail(`Invalid multirange length: ${count}`) + // Each range has at least its length, so a larger count cannot be real. + if (count * 4 > size - 4) return fail("Truncated multirange value") + const codec = requireCodec(rangeOid, lookup) + const values: Array> = new Array(count) + const limit = start + size + let offset = start + 4 + for (let i = 0; i < count; i++) { + const rangeSize = frameSize(bytes, offset, limit, "multirange element") + values[i] = readWith(codec, bytes, offset + 4, rangeSize) as Range + offset += 4 + rangeSize + } + if (offset !== limit) return fail("Multirange value has trailing bytes") + return values +} + // ----------------------------------------------------------------------------- // entry points // ----------------------------------------------------------------------------- @@ -1840,11 +2091,7 @@ export const makeFieldReader = ( * @since 4.0.0 */ export const encode = (value: unknown, oid: number, registry?: Registry): Result.Result => - result(() => { - const codec = lookupFor(registry)(oid) - if (codec === undefined) return fail(`No codec registered for OID ${oid}`) - return codec.encode(value) - }) + result(() => requireCodec(oid, lookupFor(registry)).encode(value)) /** * Decodes the binary representation of the given OID. @@ -1933,8 +2180,7 @@ export const encodeParameter = ( parameter.value === null ? Result.succeed(null) : encode(parameter.value, parameter.oid, registry) const writeValue = (sink: ValueSink, value: unknown, oid: number, lookup: Lookup): void => { - const codec = lookup(oid) - if (codec === undefined) return fail(`No codec registered for OID ${oid}`) + const codec = requireCodec(oid, lookup) if (codec.write === undefined) sink.raw(codec.encode(value)) else codec.write(sink, value) } @@ -2218,6 +2464,118 @@ export const timestamptz: (value: Date | number | null) => Parameter = parameter */ export const interval: (value: Interval | null) => Parameter = parameter(OID.interval) +/** + * An `int4range` parameter. + * + * @stability unstable + * @category constructors + * @since 4.0.0 + */ +export const int4range: (value: Range | null) => Parameter = parameter(OID.int4range) + +/** + * An `int8range` parameter. + * + * @stability unstable + * @category constructors + * @since 4.0.0 + */ +export const int8range: (value: Range | null) => Parameter = parameter(OID.int8range) + +/** + * A `numrange` parameter. + * + * @stability unstable + * @category constructors + * @since 4.0.0 + */ +export const numrange: (value: Range | null) => Parameter = parameter(OID.numrange) + +/** + * A `daterange` parameter. + * + * @stability unstable + * @category constructors + * @since 4.0.0 + */ +export const daterange: (value: Range | null) => Parameter = parameter(OID.daterange) + +/** + * A `tsrange` parameter. + * + * @stability unstable + * @category constructors + * @since 4.0.0 + */ +export const tsrange: (value: Range | null) => Parameter = parameter(OID.tsrange) + +/** + * A `tstzrange` parameter. + * + * @stability unstable + * @category constructors + * @since 4.0.0 + */ +export const tstzrange: (value: Range | null) => Parameter = parameter(OID.tstzrange) + +/** + * An `int4multirange` parameter. + * + * @stability unstable + * @category constructors + * @since 4.0.0 + */ +export const int4multirange: (value: ReadonlyArray> | null) => Parameter = parameter(OID.int4multirange) + +/** + * An `int8multirange` parameter. + * + * @stability unstable + * @category constructors + * @since 4.0.0 + */ +export const int8multirange: (value: ReadonlyArray> | null) => Parameter = parameter(OID.int8multirange) + +/** + * A `nummultirange` parameter. + * + * @stability unstable + * @category constructors + * @since 4.0.0 + */ +export const nummultirange: (value: ReadonlyArray> | null) => Parameter = parameter(OID.nummultirange) + +/** + * A `datemultirange` parameter. + * + * @stability unstable + * @category constructors + * @since 4.0.0 + */ +export const datemultirange: (value: ReadonlyArray> | null) => Parameter = parameter(OID.datemultirange) + +/** + * A `tsmultirange` parameter. + * + * @stability unstable + * @category constructors + * @since 4.0.0 + */ +export const tsmultirange: (value: ReadonlyArray> | null) => Parameter = parameter( + OID.tsmultirange +) + +/** + * A `tstzmultirange` parameter. + * + * @stability unstable + * @category constructors + * @since 4.0.0 + */ +export const tstzmultirange: (value: ReadonlyArray> | null) => Parameter = parameter( + OID.tstzmultirange +) + /** * A one-dimensional array parameter whose elements have the given OID. * diff --git a/.repos/effect/packages/sql/pg/src/internal/connection.ts b/.repos/effect/packages/sql/pg/src/internal/connection.ts index a4fa268e75126..d25a6a9562e46 100644 --- a/.repos/effect/packages/sql/pg/src/internal/connection.ts +++ b/.repos/effect/packages/sql/pg/src/internal/connection.ts @@ -12,6 +12,8 @@ export interface ConnectionInternals { readonly deadError: () => SqlError | undefined /** Fired when a pool must stop reusing the connection. */ readonly retireHooks: Set<() => void> + /** Calls back once the transport has emitted `close`. */ + readonly onTransportClose: (f: () => void) => void /** * Installed by a multiplexed pool so that pinning the session also takes it * out of shared circulation for as long as the pin lasts. Every route to an diff --git a/.repos/effect/packages/sql/pg/test/Client.integration.test.ts b/.repos/effect/packages/sql/pg/test/Client.integration.test.ts index 43452dbecfa59..e990daaf59890 100644 --- a/.repos/effect/packages/sql/pg/test/Client.integration.test.ts +++ b/.repos/effect/packages/sql/pg/test/Client.integration.test.ts @@ -1,4 +1,4 @@ -import { PgClient } from "@effect/sql-pg" +import { PgClient, type PgConnection, PgTypes } from "@effect/sql-pg" import { assert, expect, it } from "@effect/vitest" import { Cause, @@ -314,6 +314,58 @@ it.layer(PgContainer.layerClient, { timeout: "30 seconds" })("PgClient", (it) => assert.deepStrictEqual(rows, [{ record: [1, "a", null, [true, [1, 2]]], records: [[1, "a"], [2, "b"]] }]) })) + it.effect("reads and binds built-in ranges and multiranges", () => + Effect.gen(function*() { + const sql = yield* PgClient.PgClient + const tsLower = new Date("2026-01-01T00:00:00.000Z") + const tsUpper = new Date("2026-01-02T12:30:00.000Z") + const boundDateRange: PgTypes.Range = { + lower: "2026-01-01", + upper: null, + lowerInclusive: true, + upperInclusive: false, + empty: false + } + const boundMultirange: ReadonlyArray> = [ + { lower: 1, upper: 5, lowerInclusive: true, upperInclusive: false, empty: false }, + { lower: 10, upper: 21, lowerInclusive: true, upperInclusive: false, empty: false } + ] + const rows = yield* sql` + SELECT daterange(${"2026-01-01"}::date, null) AS r, + int4range(1, 5, '[]') AS int4_r, + int8range(10::int8, 20::int8, '(]') AS int8_r, + numrange(1.5, 2.5, '()') AS num_r, + tsrange('2026-01-01 00:00:00'::timestamp, '2026-01-02 12:30:00'::timestamp, '[)') AS ts_r, + tstzrange('2026-01-01T00:00:00Z'::timestamptz, '2026-01-02T12:30:00Z'::timestamptz, '(]') AS tstz_r, + 'empty'::int4range AS empty_r, + int4multirange(int4range(1, 5), int4range(10, 20, '[]')) AS mr, + ARRAY[int4range(1, 5), NULL] AS range_arr, + ARRAY[int4multirange(int4range(1, 5)), NULL] AS mr_arr, + ${PgTypes.daterange(boundDateRange)} AS param_r, + ${PgTypes.int4multirange(boundMultirange)} AS param_mr + ` + assert.deepStrictEqual(rows, [{ + r: boundDateRange, + int4_r: { lower: 1, upper: 6, lowerInclusive: true, upperInclusive: false, empty: false }, + int8_r: { lower: 11n, upper: 21n, lowerInclusive: true, upperInclusive: false, empty: false }, + num_r: { lower: "1.5", upper: "2.5", lowerInclusive: false, upperInclusive: false, empty: false }, + ts_r: { lower: tsLower, upper: tsUpper, lowerInclusive: true, upperInclusive: false, empty: false }, + tstz_r: { lower: tsLower, upper: tsUpper, lowerInclusive: false, upperInclusive: true, empty: false }, + empty_r: { lower: null, upper: null, lowerInclusive: false, upperInclusive: false, empty: true }, + mr: boundMultirange, + range_arr: [ + { lower: 1, upper: 5, lowerInclusive: true, upperInclusive: false, empty: false }, + null + ], + mr_arr: [ + [{ lower: 1, upper: 5, lowerInclusive: true, upperInclusive: false, empty: false }], + null + ], + param_r: boundDateRange, + param_mr: boundMultirange + }]) + })) + it.effect("reads bytea as Uint8Array", () => Effect.gen(function*() { const sql = yield* PgClient.PgClient @@ -678,6 +730,23 @@ it.layer(PgContainer.layerClientWithTransforms, { timeout: "30 seconds" })("PgCl expect(params).toEqual(["Tim", 10]) })) + it.effect("queryTextValues uses the active transaction and preserves column names", () => + Effect.gen(function*() { + const sql = yield* PgClient.PgClient + yield* sql`CREATE TABLE query_text (recorded_at timestamptz)` + let inside: PgConnection.TextResult | undefined + const rollback = yield* Effect.flip(sql.withTransaction(Effect.gen(function*() { + yield* sql`INSERT INTO query_text VALUES ('infinity')` + inside = yield* sql.queryTextValues("SELECT recorded_at FROM query_text") + return yield* Effect.fail("rollback" as const) + }))) + assert.strictEqual(rollback, "rollback") + const outside = yield* sql.queryTextValues("SELECT recorded_at FROM query_text") + assert.deepStrictEqual(inside?.fields, [{ name: "recorded_at", dataTypeId: PgTypes.OID.timestamptz }]) + assert.deepStrictEqual(inside?.values, [["infinity"]]) + assert.deepStrictEqual(outside.values, []) + })) + it.effect("rejects multi-statement queries", () => Effect.gen(function*() { const sql = yield* SqlClient.SqlClient diff --git a/.repos/effect/packages/sql/pg/test/ContainerTeardown.test.ts b/.repos/effect/packages/sql/pg/test/ContainerTeardown.test.ts index 93d0719cc2b4a..73fd802de26ce 100644 --- a/.repos/effect/packages/sql/pg/test/ContainerTeardown.test.ts +++ b/.repos/effect/packages/sql/pg/test/ContainerTeardown.test.ts @@ -9,12 +9,11 @@ import { pgWaitStrategy, releasePgContainer } from "./utils.ts" // Less than the existing 30s integration hook limit, including all retry attempts. const cleanupBudget = "25 seconds" const testTimeout = 28_000 -// Bounds each wait attempt; the fake daemon answers a healthy wait well within it. -const releaseOptions = { waitTimeout: "1 second" } as const +const releaseOptions = { removeTimeout: "1 second" } as const describe("PostgreSQL container lifecycle", () => { const requests = new Map>() - const interruptedResponses = new Map() + let interrupted = 0 const unexpected: Array = [] let infoRequests = 0 const server = Http.createServer((request, response) => { @@ -28,7 +27,7 @@ describe("PostgreSQL container lifecycle", () => { response.end(JSON.stringify({ ServerVersion: "27.0.0", OperatingSystem: "Docker", OSType: "linux" })) return } - const match = /^\/containers\/([^/]+)(\/wait|\/json|\/exec)?$/.exec(url.pathname) + const match = /^\/containers\/([^/]+)(\/json|\/exec)?$/.exec(url.pathname) if (match === null || !requests.has(match[1])) { unexpected.push(request.method + " " + request.url) response.writeHead(404).end(JSON.stringify({ message: "Unexpected request" })) @@ -44,28 +43,28 @@ describe("PostgreSQL container lifecycle", () => { } else if (request.method === "POST" && match[2] === "/exec") { // An exec that never completes, as observed under Deno in CI. steps.push("exec") - } else if (request.method === "POST" && match[2] === "/wait") { - steps.push("wait") - assert.strictEqual(url.searchParams.get("condition"), "not-running") - const attempt = steps.filter((step) => step === "wait").length - // A wait response that never arrives, as observed under Bun in CI. - if (id === "wait-hangs") return void response.flushHeaders() - if (id === "always-interrupted" || attempt === 1) { - // Docker flushes the wait headers before writing its JSON body. Close - // after a partial body, deterministically exercising docker-modem's - // aborted-response path, not a probabilistic keep-alive reuse race. - response.flushHeaders() - response.write("{\"StatusCode\":", () => { - interruptedResponses.set(id, (interruptedResponses.get(id) ?? 0) + 1) - response.socket!.end() - }) - } else { - response.end(JSON.stringify({ StatusCode: 137 })) - } } else if (request.method === "DELETE" && match[2] === undefined) { steps.push("remove") + assert.strictEqual(url.searchParams.get("force"), "true") assert.strictEqual(url.searchParams.get("v"), "true") - response.writeHead(204).end() + if (id === "retry-succeeds") { + if (steps.length === 1) { + // Close mid-body to deterministically trigger docker-modem's aborted-response path. + response.flushHeaders() + response.write("{\"message\":", () => { + interrupted++ + response.socket!.end() + }) + } else { + response.writeHead(404).end(JSON.stringify({ message: `No such container: ${id}` })) + } + } else if (id === "remove-fails") { + if (steps.length === 1) return void response.flushHeaders() + response.writeHead(500).end(JSON.stringify({ message: "daemon error" })) + } else { + unexpected.push(request.method + " " + request.url) + response.writeHead(404).end(JSON.stringify({ message: "Unexpected request" })) + } } else { unexpected.push(request.method + " " + request.url) response.writeHead(404).end(JSON.stringify({ message: "Unexpected request" })) @@ -112,66 +111,37 @@ describe("PostgreSQL container lifecycle", () => { }), testTimeout) const container = (id: string) => { - const steps: Array = [] - requests.set(id, steps) - return { - getId: () => id, - stop: async (options: { remove: boolean }) => { - assert.deepStrictEqual(options, { remove: false }) - steps.push("stop") - } - } + requests.set(id, []) + return id } - it.live("retries an interrupted wait response before removing the container", () => + it.live("retries an interrupted remove and treats 404 as success", () => Effect.gen(function*() { const result = yield* releasePgContainer(container("retry-succeeds"), releaseOptions).pipe( Effect.exit, Effect.timeoutOption(cleanupBudget) ) - assert.strictEqual(interruptedResponses.get("retry-succeeds"), 1, "daemon did not interrupt the first wait") + assert.strictEqual(interrupted, 1, "daemon did not interrupt the first remove") assert.isTrue(Option.isSome(result), "teardown exceeded the cleanup budget") if (Option.isNone(result)) return assert.isTrue(Exit.isSuccess(result.value), "teardown failed instead of retrying") - assert.deepStrictEqual(requests.get("retry-succeeds"), ["stop", "wait", "wait", "remove"]) + assert.deepStrictEqual(requests.get("retry-succeeds"), ["remove", "remove"]) assert.deepStrictEqual(unexpected, []) }), testTimeout) - it.live( - "surfaces repeated interrupted waits within the cleanup budget without removing", - () => - Effect.gen(function*() { - const result = yield* releasePgContainer(container("always-interrupted"), releaseOptions).pipe( - Effect.exit, - Effect.timeoutOption(cleanupBudget) - ) - assert.isAtLeast(interruptedResponses.get("always-interrupted")!, 1, "daemon did not interrupt a wait") - assert.isTrue(Option.isSome(result), "teardown hung instead of reporting exhausted retries") - if (Option.isNone(result)) return - assert.isTrue(Exit.isFailure(result.value), "cleanup failure was suppressed") - if (Exit.isSuccess(result.value)) return - assert.isFalse(Cause.hasInterruptsOnly(result.value.cause), "failure must be visible, not just interruption") - const steps = requests.get("always-interrupted")! - assert.strictEqual(steps[0], "stop") - assert.isAtLeast(interruptedResponses.get("always-interrupted")!, 2) - assert.isAtMost(interruptedResponses.get("always-interrupted")!, 3) - assert.isFalse(steps.includes("remove"), "remove ran without a successful wait") - assert.deepStrictEqual(unexpected, []) - }), - testTimeout - ) - - // `it.layer` provides TestClock to fixture layers, so their finalizers - // run with it during afterAll. - it.effect("bounds a hung wait under the test services used by it.layer", () => + // it.layer runs fixture finalizers under TestClock. + it.effect("bounds a hung remove and surfaces non-404 failures under TestClock", () => Effect.gen(function*() { const fiber = yield* Effect.forkChild( - releasePgContainer(container("wait-hangs"), releaseOptions).pipe(Effect.exit) + releasePgContainer(container("remove-fails"), releaseOptions).pipe(Effect.exit) ) const result = yield* Fiber.join(fiber).pipe(Effect.timeoutOption(cleanupBudget), TestClock.withLive) assert.isTrue(Option.isSome(result), "teardown hung instead of reporting exhausted retries") if (Option.isNone(result)) return yield* Fiber.interrupt(fiber) assert.isTrue(Exit.isFailure(result.value), "cleanup failure was suppressed") - assert.isFalse(requests.get("wait-hangs")!.includes("remove"), "remove ran without a successful wait") + if (Exit.isSuccess(result.value)) return + assert.isFalse(Cause.hasInterruptsOnly(result.value.cause), "failure must be visible, not just interruption") + assert.deepStrictEqual(requests.get("remove-fails"), ["remove", "remove", "remove"]) + assert.deepStrictEqual(unexpected, []) }), testTimeout) }) diff --git a/.repos/effect/packages/sql/pg/test/Persistence.integration.test.ts b/.repos/effect/packages/sql/pg/test/Persistence.integration.test.ts index 38fd8a27a8009..f8fe66fb1a2ef 100644 --- a/.repos/effect/packages/sql/pg/test/Persistence.integration.test.ts +++ b/.repos/effect/packages/sql/pg/test/Persistence.integration.test.ts @@ -22,7 +22,8 @@ PersistedCacheTest.suite( PersistedQueueTest.suite( "sql-pg", - PersistedQueue.layerStoreSql().pipe(Layer.provide(PgContainer.layerClient)) + PersistedQueue.layerStoreSql().pipe(Layer.provide(PgContainer.layerClient)), + { nonDeliveryWait: "250 millis" } ) it.layer(PgContainer.layerClient, { timeout: "30 seconds" })((it) => PersistedQueueSqlTest.suiteWith(it)) @@ -156,34 +157,6 @@ it.layer(PgContainer.layerClient, { timeout: "30 seconds" })("PersistedQueue SQL } }).pipe(TestClock.withLive), { timeout: 30000 }) - it.effect("recovers elements from crashed workers after lock expiration", () => - Effect.gen(function*() { - const tableName = "effect_queue_crash_recovery" - const store = yield* PersistedQueue.makeStoreSql({ - tableName, - pollInterval: "10 millis", - lockExpiration: "1 second" - }) - const factory = yield* PersistedQueue.makeFactory.pipe( - Effect.provideService(PersistedQueue.PersistedQueueStore, store) - ) - const queue = yield* factory.make({ name: "crash-recovery", schema: Schema.Number }) - const sql = (yield* SqlClient.SqlClient).withoutTransforms() - const table = sql(tableName) - - const id = yield* queue.offer(1) - // simulate a worker that claimed the element and then crashed: the lock - // is held by a dead worker and the claim consumed an attempt - yield* sql` - UPDATE ${table} - SET acquired_by = ${crypto.randomUUID()}, acquired_at = NOW(), attempts = 1 - WHERE id = ${id} - ` - - const attempts = yield* queue.take((_n, metadata) => Effect.succeed(metadata.attempts)) - assert.strictEqual(attempts, 2) - }).pipe(TestClock.withLive), { timeout: 20000 }) - it.effect("dead-letters elements from workers that crashed on the final attempt", () => Effect.gen(function*() { const tableName = "effect_queue_crash_exhausted" diff --git a/.repos/effect/packages/sql/pg/test/PgConnection.in-process.test.ts b/.repos/effect/packages/sql/pg/test/PgConnection.in-process.test.ts index 5ae2954f6f419..4efea65bbf40a 100644 --- a/.repos/effect/packages/sql/pg/test/PgConnection.in-process.test.ts +++ b/.repos/effect/packages/sql/pg/test/PgConnection.in-process.test.ts @@ -90,6 +90,28 @@ const emptyQueryResult = Buffer.concat([ readyForQuery ]) +const textRowResult = (name: string, value: Buffer): Buffer => + Buffer.concat([ + backendMessage("1", Buffer.alloc(0)), + backendMessage("2", Buffer.alloc(0)), + backendMessage( + "T", + Buffer.concat([ + int16(1), + Buffer.from(`${name}\0`), + int32(0), + int16(0), + int32(25), + int16(-1), + int32(-1), + int16(1) + ]) + ), + backendMessage("D", Buffer.concat([int16(1), int32(value.length), value])), + backendMessage("C", Buffer.from("SELECT 1\0")), + readyForQuery + ]) + const frontendTags = (message: Buffer): ReadonlyArray => { const tags: Array = [] let offset = 0 @@ -349,29 +371,7 @@ describe("PgConnection in-process server", () => { it.effect("accepts backend messages over the default limit when configured", () => Effect.gen(function*() { const fieldSize = 16 * 1024 * 1024 - const field = Buffer.alloc(fieldSize, 0x78) - const rowDescription = backendMessage( - "T", - Buffer.concat([ - int16(1), - Buffer.from("big\0"), - int32(0), - int16(0), - int32(25), - int16(-1), - int32(-1), - int16(1) - ]) - ) - const dataRow = backendMessage("D", Buffer.concat([int16(1), int32(field.length), field])) - const result = Buffer.concat([ - backendMessage("1", Buffer.alloc(0)), - backendMessage("2", Buffer.alloc(0)), - rowDescription, - dataRow, - backendMessage("C", Buffer.from("SELECT 1\0")), - readyForQuery - ]) + const result = textRowResult("big", Buffer.alloc(fieldSize, 0x78)) let writes = 0 const socket: Duplex = new Duplex({ read() {}, @@ -469,6 +469,35 @@ describe("PgConnection in-process server", () => { assert.notStrictEqual(firstName[0], secondName[0]) })) + it.effect("does not collide text and binary prepared cache keys on embedded NUL", () => + Effect.gen(function*() { + const writes: Array = [] + const socket: Duplex = new Duplex({ + read() {}, + write(chunk: Buffer, _encoding, callback) { + writes.push(Buffer.from(chunk)) + queueMicrotask(() => { + socket.push( + writes.length === 1 + ? Buffer.concat([authenticationOk, backendKeyData, readyForQuery]) + : emptyQueryResult + ) + }) + callback() + } + }) + + const connection = yield* PgConnection.make({ username: "test", stream: () => socket }) + yield* connection.queryTextValues("SELECT 1") + yield* connection.query("SELECT 1\u0000text") + + const textNames = frontendPreparedNames(writes[1]) + const binaryNames = frontendPreparedNames(writes[2]) + assert.strictEqual(textNames.length, 1) + assert.strictEqual(binaryNames.length, 1) + assert.notStrictEqual(textNames[0], binaryNames[0]) + })) + it.effect("reuses a prepared name after a pending pipeline query is interrupted", () => Effect.gen(function*() { const writes: Array = [] @@ -502,6 +531,57 @@ describe("PgConnection in-process server", () => { assert.match(names[0], /^effect_[0-9a-f]{16}_1$/) })) + it.effect("bounds pipelineInFlight while multiplexed queries keep the pipeline nonempty", () => + Effect.gen(function*() { + const total = 300 + const queryResult = (id: number): Buffer => textRowResult("id", Buffer.from(String(id))) + + let writes = 0 + let received = 0 + let replied = 0 + const socket: Duplex = new Duplex({ + read() {}, + write(chunk: Buffer, _encoding, callback) { + writes++ + if (writes === 1) { + queueMicrotask(() => socket.push(Buffer.concat([authenticationOk, backendKeyData, readyForQuery]))) + } else { + received += frontendTags(chunk).filter((tag) => tag === "S").length + const toReply = received - replied - 1 + if (toReply > 0) { + const replies = Array.from({ length: toReply }, () => queryResult(replied++)) + queueMicrotask(() => socket.push(Buffer.concat(replies))) + } + } + callback() + } + }) + + const connection = yield* PgConnection.make({ + username: "test", + stream: () => socket, + multiplex: true, + prepare: false + }) + const internals = connection as unknown as { readonly pipelineInFlight: ReadonlyArray } + let maxPipelineInFlight = 0 + + let pending = yield* Effect.forkChild(connection.query("SELECT 1"), { startImmediately: true }) + for (let i = 1; i < total; i++) { + const next = yield* Effect.forkChild(connection.query("SELECT 1"), { startImmediately: true }) + const result = yield* Fiber.join(pending) + assert.deepStrictEqual(result.rows, [{ id: String(i - 1) }]) + maxPipelineInFlight = Math.max(maxPipelineInFlight, internals.pipelineInFlight.length) + pending = next + } + + socket.push(queryResult(replied++)) + const last = yield* Fiber.join(pending) + assert.deepStrictEqual(last.rows, [{ id: String(total - 1) }]) + assert.strictEqual(internals.pipelineInFlight.length, 0) + assert.isAtMost(maxPipelineInFlight, 256) + })) + it.live("ends and destroys a custom stream after writing Terminate", () => Effect.gen(function*() { const writes: Array = [] diff --git a/.repos/effect/packages/sql/pg/test/PgConnection.integration.test.ts b/.repos/effect/packages/sql/pg/test/PgConnection.integration.test.ts index 861249bed7412..f76bfb392e9b0 100644 --- a/.repos/effect/packages/sql/pg/test/PgConnection.integration.test.ts +++ b/.repos/effect/packages/sql/pg/test/PgConnection.integration.test.ts @@ -318,6 +318,39 @@ it.layer(PgContainer.layer, { timeout: "30 seconds" })("PgConnection", (it) => { assert.deepStrictEqual(rows, [[BigInt(7), "value"]]) })) + it.effect("returns queryTextValues as the server's text beside binary runs of the same statement", () => + Effect.gen(function*() { + const sql = "SELECT $1::timestamptz AS at, $2::numeric AS amount, $3::text AS bom, NULL::int4 AS missing" + const params = ["2026-01-02 03:04:05.123456+00", "123456789012345678901234567890.5", "\uFEFF"] + const expected: PgConnection.TextResult = { + command: "SELECT", + rowCount: 1, + oid: null, + fields: [ + { name: "at", dataTypeId: PgTypes.OID.timestamptz }, + { name: "amount", dataTypeId: PgTypes.OID.numeric }, + { name: "bom", dataTypeId: PgTypes.OID.text }, + { name: "missing", dataTypeId: PgTypes.OID.int4 } + ], + values: [["2026-01-02 03:04:05.123456+00", "123456789012345678901234567890.5", "\uFEFF", null]] + } + for (const multiplex of [false, true]) { + const connection = yield* makeConnection({ multiplex }) + yield* connection.query("SET TIME ZONE 'UTC'") + // Run twice so the prepared statement is reused in both formats. + for (let run = 0; run < 2; run++) { + const [binary, text, unprepared] = yield* Effect.all([ + connection.query(sql, params), + connection.queryTextValues(sql, params), + connection.queryTextValues(sql, params, false) + ], { concurrency: "unbounded" }) + assert.deepStrictEqual(binary.rows[0].at, new Date("2026-01-02T03:04:05.123Z")) + assert.deepStrictEqual(text, expected) + assert.deepStrictEqual(unprepared, expected) + } + } + })) + it.effect("drains query errors and keeps the connection usable", () => Effect.gen(function*() { const connection = yield* makeConnection() diff --git a/.repos/effect/packages/sql/pg/test/PgPool.in-process.test.ts b/.repos/effect/packages/sql/pg/test/PgPool.in-process.test.ts index 70e9dac7ff2c8..21893c0794c96 100644 --- a/.repos/effect/packages/sql/pg/test/PgPool.in-process.test.ts +++ b/.repos/effect/packages/sql/pg/test/PgPool.in-process.test.ts @@ -1,13 +1,13 @@ import { PgClient, PgPool } from "@effect/sql-pg" import { assert, describe, it } from "@effect/vitest" -import { Cause, Effect, Fiber, Latch, Option, Queue, Redacted, References, Tracer } from "effect" +import { Cause, Clock, Effect, Fiber, Latch, Option, Queue, Redacted, References, Tracer } from "effect" import type * as Duration from "effect/Duration" import * as Reactivity from "effect/reactivity/Reactivity" import type * as Scope from "effect/Scope" import type { SqlError } from "effect/sql/SqlError" import * as Statement from "effect/sql/Statement" import * as TestClock from "effect/testing/TestClock" -import { Duplex } from "node:stream" +import { Duplex, type DuplexOptions } from "node:stream" const backendMessage = (tag: string, payload: Buffer): Buffer => { const length = Buffer.allocUnsafe(4) @@ -490,6 +490,55 @@ describe("PgClient failed transaction cleanup", () => { Effect.scoped, Effect.provide(Reactivity.layer) )) + + it.effect("retires a session left in a pin-owned transaction without retiring closed or caller-owned ones", () => + Effect.scoped(Effect.gen(function*() { + let opened = 0 + let status = "I" + const pool = yield* PgPool.make({ + username: "test", + maxConnections: 1, + prepare: false, + stream: () => { + opened++ + status = "I" + let startup = true + const socket = new Duplex({ + read() {}, + write(chunk: Buffer, _encoding, callback) { + if (startup) { + startup = false + queueMicrotask(() => socket.push(ready)) + } else if (chunk[0] === 0x50) { + status = chunk.includes("BEGIN") ? "T" : "I" + queueMicrotask(() => socket.push(completed(status === "T" ? "BEGIN" : "COMMIT", status))) + } + callback() + } + }) + return socket + } + }) + + yield* Effect.scoped( + Effect.flatMap(pool.reserve, (conn) => Effect.andThen(conn.query("BEGIN"), conn.query("COMMIT"))) + ) + + // Caller-owned transaction: status stays T and COMMIT fails if the pin retired the session. + yield* Effect.scoped(Effect.gen(function*() { + const conn = yield* pool.get + yield* conn.query("BEGIN") + yield* Effect.scoped(conn.pin) + assert.strictEqual(status, "T") + yield* conn.query("COMMIT") + })) + assert.strictEqual(opened, 1) + + yield* Effect.scoped(Effect.flatMap(pool.reserve, (conn) => conn.query("BEGIN"))) + yield* Effect.scoped(pool.get) + assert.strictEqual(opened, 2) + assert.strictEqual(status, "I") + }))) }) const readyStream = () => { @@ -537,3 +586,134 @@ describe("pool stats", () => { })) })).pipe(Effect.provide(Reactivity.layer))) }) + +describe("PgPool transport capacity", () => { + const copyInResponse = backendMessage("G", Buffer.alloc(3)) + + // A backend that completes startup and answers every Parse with `response`. + const backend = (response: Buffer, options?: Pick) => { + let startup = true + const socket: Duplex = new Duplex({ + ...options, + read() {}, + write(chunk: Buffer, _encoding, callback) { + if (startup) { + startup = false + queueMicrotask(() => socket.push(ready)) + } else if (chunk[0] === 0x50) { + queueMicrotask(() => socket.push(response)) + } + callback() + } + }) + return socket + } + + it.effect.each([ + { + name: "pool.use", + runFirst: (pool: PgPool.PgPool) => pool.use((conn) => conn.query("SELECT 1", [], false)) + }, + { + name: "held pool.get", + runFirst: (pool: PgPool.PgPool) => Effect.flatMap(pool.get, (conn) => conn.query("SELECT 1", [], false)) + } + ])("keeps physical pool capacity occupied until a retired transport closes ($name)", ({ runFirst }) => { + let opened = 0 + let firstSocket: Duplex | undefined + let finishDestroy: (() => void) | undefined + const releaseClose = () => { + const finish = finishDestroy + finishDestroy = undefined + finish?.() + } + + return Effect.gen(function*() { + const pool = yield* PgPool.make({ + username: "test", + maxConnections: 1, + prepare: false, + stream: () => + ++opened > 1 ? backend(emptyQueryResult) : (firstSocket = backend(copyInResponse, { + destroy(error, callback) { + finishDestroy = () => callback(error) + } + })) + }) + + const failed = yield* Effect.flip(runFirst(pool)) + assert.strictEqual(failed.reason._tag, "ConnectionError") + + const successor = yield* Effect.forkChild(pool.use((conn) => conn.query("SELECT 2", [], false))) + yield* Effect.sleep("20 millis").pipe(TestClock.withLive) + + assert.isTrue(firstSocket?.destroyed) + assert.isFalse(firstSocket?.closed) + assert.strictEqual(opened, 1) + + releaseClose() + yield* Fiber.join(successor) + assert.strictEqual(opened, 2) + }).pipe(Effect.ensuring(Effect.sync(releaseClose))) + }) + + it.live.each([ + { name: "pool.get", checkOut: (pool: PgPool.PgPool): Effect.Effect => pool.get }, + { name: "pool.use", checkOut: (pool: PgPool.PgPool) => pool.use(() => Effect.void) } + ])( + "does not strand an expired lease when a TTL checkout is interrupted at the expiry check ($name)", + ({ checkOut }) => + Effect.gen(function*() { + let opened = 0 + let onExpiryCheck: (() => void) | undefined + const baseClock = yield* Clock.Clock + const hookedClock: Clock.Clock = Object.assign(Object.create(baseClock), { + currentTimeMillisUnsafe() { + const hook = onExpiryCheck + onExpiryCheck = undefined + hook?.() + return baseClock.currentTimeMillisUnsafe() + } + }) + const pool = yield* PgPool.make({ + username: "test", + maxConnections: 1, + connectionTTL: 0, + prepare: false, + stream: () => { + opened++ + return backend(emptyQueryResult) + } + }).pipe(Effect.provideService(Clock.Clock, hookedClock)) + + yield* pool.use((conn) => conn.query("SELECT 1", [], false)) + + let interruptedAtExpiry = false + let checkout!: Fiber.Fiber + onExpiryCheck = () => { + interruptedAtExpiry = true + checkout.interruptUnsafe() + } + checkout = yield* Effect.forkChild(checkOut(pool)) + yield* Fiber.await(checkout) + assert.isTrue(interruptedAtExpiry) + + yield* pool.use((conn) => conn.query("SELECT 2", [], false)).pipe(Effect.timeout("250 millis")) + assert.strictEqual(opened, 2) + }) + ) + + it.live("closes a pool.use callback's scope with the callback on a TTL pool", () => + Effect.gen(function*() { + const pool = yield* PgPool.make({ + username: "test", + maxConnections: 1, + connectionTTL: "1 day", + prepare: false, + stream: () => backend(emptyQueryResult) + }) + // Left to the test's scope, the pin would block the next statement. + yield* pool.use((conn) => conn.pin) + yield* pool.use((conn) => conn.query("SELECT 1", [], false)).pipe(Effect.timeout("250 millis")) + })) +}) diff --git a/.repos/effect/packages/sql/pg/test/PgProtocol.test.ts b/.repos/effect/packages/sql/pg/test/PgProtocol.test.ts index 0c845be785c8f..be56d7828964b 100644 --- a/.repos/effect/packages/sql/pg/test/PgProtocol.test.ts +++ b/.repos/effect/packages/sql/pg/test/PgProtocol.test.ts @@ -109,9 +109,11 @@ describe("PgProtocol", () => { else sink.raw(value) return Result.void }) + const options = { portal: "p1", statement: "s1", parameters: [bytes("00000001"), null] } + assert.strictEqual(hex(success(encodeBind(options))), frontend.bind) assert.strictEqual( - hex(success(encodeBind({ portal: "p1", statement: "s1", parameters: [bytes("00000001"), null] }))), - frontend.bind + hex(success(encodeBind({ ...options, textResults: true }))), + "42000000207031007331000001000100020000000400000001ffffffff00010000" ) }) diff --git a/.repos/effect/packages/sql/pg/test/PgTypes.test.ts b/.repos/effect/packages/sql/pg/test/PgTypes.test.ts index 571c3911ca27a..38159f7d04396 100644 --- a/.repos/effect/packages/sql/pg/test/PgTypes.test.ts +++ b/.repos/effect/packages/sql/pg/test/PgTypes.test.ts @@ -273,6 +273,89 @@ describe("PgTypes", () => { assertThrowsTagged("PgTypesCodecError", () => PgTypesResult.encode([1], PgTypes.OID.record)) }) }) + describe("ranges", () => { + it("encodes, decodes, and writes range and multirange wire formats", () => { + const int4Range: PgTypesResult.Range = { + lower: 1, + upper: 5, + lowerInclusive: true, + upperInclusive: false, + empty: false + } + const emptyRange: PgTypesResult.Range = { + lower: null, + upper: null, + lowerInclusive: false, + upperInclusive: false, + empty: true + } + const unbounded: PgTypesResult.Range = { + lower: null, + upper: null, + lowerInclusive: false, + upperInclusive: false, + empty: false + } + const int4Wire = bytes("0200000004000000010000000400000005") + assert.deepStrictEqual(PgTypes.encode(int4Range, PgTypes.OID.int4range), int4Wire) + assert.deepStrictEqual(PgTypes.decode(int4Wire, PgTypes.OID.int4range, 1), int4Range) + assert.deepStrictEqual(PgTypes.encode(emptyRange, PgTypes.OID.int4range), bytes("01")) + assert.deepStrictEqual(PgTypes.encode(unbounded, PgTypes.OID.daterange), bytes("18")) + assert.deepStrictEqual(PgTypes.decode(bytes("18"), PgTypes.OID.daterange, 1), unbounded) + assert.deepStrictEqual(PgTypes.decode(bytes("00000000"), PgTypes.OID.int4multirange, 1), []) + + const encodeBind = PgProtocol.makeBindEncoder(PgTypes.writeParameter) + const parameters = [ + PgTypes.int4range(int4Range), + PgTypes.int4range(emptyRange), + PgTypes.daterange(unbounded), + PgTypes.int4multirange([int4Range]) + ] + assert.deepStrictEqual( + encodeBind({ portal: "", statement: "", parameters }), + PgProtocol.encodeBind({ + portal: "", + statement: "", + parameters: parameters.map(PgTypes.encodeParameter) + }) + ) + }) + + it("propagates registry overrides into range bounds, multiranges, and arrays", () => { + const registry = PgTypesResult.makeRegistry() + registry.register(PgTypes.OID.timestamptz, { + encode: (value) => Result.succeed(int64Bytes(value)), + decode: (wire) => Result.succeed(new DataView(wire.buffer, wire.byteOffset, wire.byteLength).getBigInt64(0)) + }) + const value: ReadonlyArray> | null> = [[{ + lower: 123n, + upper: 456n, + lowerInclusive: true, + upperInclusive: false, + empty: false + }], null] + const wire = success(PgTypesResult.encode(value, PgTypes.OID.tstzmultirangeArray, registry)) + assert.deepStrictEqual(success(PgTypesResult.decode(wire, PgTypes.OID.tstzmultirangeArray, 1, registry)), value) + }) + + it("rejects malformed wire values and invalid range inputs", () => { + for (const wire of ["", "0100", "02ffffffff", "02000000040000000100000004000000"]) { + assertThrowsTagged("PgTypesCodecError", () => PgTypesResult.decode(bytes(wire), PgTypes.OID.int4range, 1)) + } + for (const wire of ["0000", "ffffffff", "7fffffff", "000000010000000201", "0000000000"]) { + assertThrowsTagged("PgTypesCodecError", () => PgTypesResult.decode(bytes(wire), PgTypes.OID.int4multirange, 1)) + } + for (const value of [null, { lower: 1, upper: 5 }, { lower: 1, upper: 5, lowerInclusive: true, empty: false }]) { + assertThrowsTagged("PgTypesCodecError", () => PgTypesResult.encode(value, PgTypes.OID.int4range)) + } + assertThrowsTagged( + "PgTypesCodecError", + () => PgTypesResult.encode("not-a-multirange", PgTypes.OID.int4multirange) + ) + const sparse = PgTypesResult.encode(new Array(1), PgTypes.OID.int4multirange) + assert.isTrue(Result.isFailure(sparse) && sparse.failure._tag === "PgTypesCodecError") + }) + }) it("returns codec failures as Result values", () => { for ( const result of [ diff --git a/.repos/effect/packages/sql/pg/test/utils.ts b/.repos/effect/packages/sql/pg/test/utils.ts index 373ad0761cbba..e118338d938c9 100644 --- a/.repos/effect/packages/sql/pg/test/utils.ts +++ b/.repos/effect/packages/sql/pg/test/utils.ts @@ -1,6 +1,6 @@ import { PgClient, type PgConnection } from "@effect/sql-pg" import { PostgreSqlContainer } from "@testcontainers/postgresql" -import { Clock, Context, Data, type Duration, Effect, Layer, Redacted, type Scope, String } from "effect" +import { Clock, Context, Data, type Duration, Effect, Layer, Redacted, Schedule, type Scope, String } from "effect" import * as Fs from "node:fs" import { inspect } from "node:util" import { getContainerRuntimeClient, Wait } from "testcontainers" @@ -74,29 +74,32 @@ const instrumentClient = ( // Shared with the regression tests so they exercise the real container finalizer. export const releasePgContainer = Effect.fnUntraced( - function*(container: { - getId(): string - stop(options: { remove: boolean }): Promise - }, options?: { - // Lets the regression tests exhaust the retries without waiting 15 seconds. - readonly waitTimeout?: Duration.Input | undefined + function*(id: string, options?: { + // Lets the regression tests exhaust the retries quickly. + readonly removeTimeout?: Duration.Input | undefined }) { - const id = container.getId() lifecycleLog(id, "container-release", "start", 0) - yield* Effect.promise(() => lifecycle(id, "stop", () => container.stop({ remove: false }))) const client = yield* Effect.promise(() => lifecycle(id, "runtime-client", () => getContainerRuntimeClient())) - const handle = client.container.getById(container.getId()) - // Stop can return before the daemon processes the exit event; wait before removing. - // docker-modem can leave an aborted response pending forever. Abort each - // timed-out request and retry this read-only wait, never the whole release. + const handle = client.container.getById(id) + // Force-remove in one request; retries are safe (404 = already gone) and + // spaced so an overlapping Docker 409 ("removal already in progress") settles. yield* Effect.tryPromise((signal) => - lifecycle(id, "wait-not-running", () => handle.wait({ condition: "not-running", abortSignal: signal }), signal) - ).pipe(Effect.timeout(options?.waitTimeout ?? "5 seconds"), Effect.retry({ times: 2 })) - yield* Effect.promise(() => lifecycle(id, "remove", () => client.container.remove(handle, { removeVolumes: true }))) + lifecycle( + id, + "remove", + () => + handle.remove({ force: true, v: true, abortSignal: signal }).catch((error) => { + if (error?.statusCode !== 404) throw error + }), + signal + ) + ).pipe( + Effect.timeout(options?.removeTimeout ?? "5 seconds"), + Effect.retry({ times: 2, schedule: Schedule.spaced("500 millis") }) + ) lifecycleLog(id, "container-release", "done", 0) }, - // Bound the entire release below the existing 30s hook limit, including - // stop and removal. Exhausted retries and timeouts remain visible defects. + // Stay below the 30s hook limit and surface exhausted retries as defects. Effect.timeout("20 seconds"), (_) => Effect.orDie(_), // Fixture finalizers inherit TestClock from it.layer; cleanup must use real deadlines. @@ -120,7 +123,7 @@ export class PgContainer extends Context.Service()("test/PgContaine ), catch: (cause) => new ContainerError({ cause }) }).pipe(Effect.tap((container) => marker(container.getId(), "container-started"))), - (container) => releasePgContainer(container) + (container) => releasePgContainer(container.getId()) ) }) { static readonly layer = Layer.effect(this)(this.make) diff --git a/.repos/effect/packages/sql/pglite/CHANGELOG.md b/.repos/effect/packages/sql/pglite/CHANGELOG.md index c51397e911d11..b401deb5c2f8c 100644 --- a/.repos/effect/packages/sql/pglite/CHANGELOG.md +++ b/.repos/effect/packages/sql/pglite/CHANGELOG.md @@ -1,5 +1,13 @@ # @effect/sql-pglite +## 4.1.6 + +### Patch Changes + +- [#10851](https://github.com/Effect-TS/effect/pull/10851) [`bb02f33`](https://github.com/Effect-TS/effect/commit/bb02f33a66309e62999d16fb87a3278157dd2e79) Thanks @effect-bot! - Update repository dependencies to their latest compatible releases. +- Updated dependencies [[`dd5f2f3`](https://github.com/Effect-TS/effect/commit/dd5f2f322fbad042a3a186cef593bf42affe5ce9), [`1d65846`](https://github.com/Effect-TS/effect/commit/1d65846308a6a18c4a95af543988ad30b72ff2b3), [`694c28f`](https://github.com/Effect-TS/effect/commit/694c28f0cfc3eac33f71160d18dda95cb670f506), [`5aaa2cd`](https://github.com/Effect-TS/effect/commit/5aaa2cd216e5e55f92d06db98d4b54946a396eed), [`55814bf`](https://github.com/Effect-TS/effect/commit/55814bf0a780f05ed0a51c82c8affda5d539bb0e), [`92c40a1`](https://github.com/Effect-TS/effect/commit/92c40a1f96a59f9edcacee6c0d6f6fb80397ee17), [`9f415a7`](https://github.com/Effect-TS/effect/commit/9f415a7733cdf8aed7efadbed3b5db22890e164a), [`e367afd`](https://github.com/Effect-TS/effect/commit/e367afdacfa3041a694a67e4670e98a20e41d45c), [`d5d2112`](https://github.com/Effect-TS/effect/commit/d5d21120ff591fcf8da006ce340010812cc91f16), [`fa2e5af`](https://github.com/Effect-TS/effect/commit/fa2e5af4ccc8f3650d97049707be82eab098c168), [`6bf6427`](https://github.com/Effect-TS/effect/commit/6bf6427d195539c387c13156aff79db077929c8f), [`10bc4a4`](https://github.com/Effect-TS/effect/commit/10bc4a47c0ce5bc50ba1998d63a803e3887d1d2b), [`a9540d3`](https://github.com/Effect-TS/effect/commit/a9540d3d50fbe65ade7f9b2f478cdd34a888161e), [`3a250d7`](https://github.com/Effect-TS/effect/commit/3a250d7eb8c310bf4751b3eca0038cf50e1629d8), [`ce44141`](https://github.com/Effect-TS/effect/commit/ce44141ad1bc8d05f3f7399bfa1e87772573205d), [`9318e5b`](https://github.com/Effect-TS/effect/commit/9318e5bafb144ddff65a0bff0148ec4f7ba77b5c), [`c9ecebf`](https://github.com/Effect-TS/effect/commit/c9ecebf7ede8a98895552fd20223d6573bd846fe), [`32f8fbe`](https://github.com/Effect-TS/effect/commit/32f8fbe1a5985aea41754e87531e9a1d0fbf78ec), [`41d6af1`](https://github.com/Effect-TS/effect/commit/41d6af14b7f36e06ade3bf7333b710e73de1e1c2), [`c33fd59`](https://github.com/Effect-TS/effect/commit/c33fd599cb7d49117f77f7bd8f05cb4209112a34), [`1f9e9d3`](https://github.com/Effect-TS/effect/commit/1f9e9d3de552435de6b8f4e1166515d0964c3999), [`594fa71`](https://github.com/Effect-TS/effect/commit/594fa71da417bf94fa6c9be2d3d36c808197e9fe), [`b378c38`](https://github.com/Effect-TS/effect/commit/b378c383cdb29e819e24da5dc725479a2ba4fdf1), [`a9ec9a6`](https://github.com/Effect-TS/effect/commit/a9ec9a60bbe1309960e00527ab62342dce1a86fc), [`310a81b`](https://github.com/Effect-TS/effect/commit/310a81b391e24d42b6608b5e3d641eca63e0d4c0), [`aab2135`](https://github.com/Effect-TS/effect/commit/aab2135d3fe43d4d86c4e486ed378797314fb212), [`6744a72`](https://github.com/Effect-TS/effect/commit/6744a724869539fc2d733929df871ef523bf82e8), [`848d042`](https://github.com/Effect-TS/effect/commit/848d0426f287b3e7ff970219d980a4c66fa441ad), [`077a93e`](https://github.com/Effect-TS/effect/commit/077a93e5db3adbc42e531539cb12b8bdbdfe5328), [`aef50fb`](https://github.com/Effect-TS/effect/commit/aef50fb8b56ec9ff8116f157635579fefd995f26), [`2e4de86`](https://github.com/Effect-TS/effect/commit/2e4de8634431f3da08ca2a90ab1024ee08e216f3), [`482b104`](https://github.com/Effect-TS/effect/commit/482b104caf712a8d5f99aafc64e55b6ea38eb809), [`753e1ed`](https://github.com/Effect-TS/effect/commit/753e1ed88069f73103d136dcdc58188fd10efdf1), [`0d2bb4a`](https://github.com/Effect-TS/effect/commit/0d2bb4a4b6526e1767b81101ee6e8da88ba1de55), [`8161e03`](https://github.com/Effect-TS/effect/commit/8161e03c26d691502afeddcf7e2ee75e6931637f), [`49f5391`](https://github.com/Effect-TS/effect/commit/49f53918a150aa2ea0ce2d444400cec1d6097400), [`3d59bdf`](https://github.com/Effect-TS/effect/commit/3d59bdf6f8f95ceea2091e5b8f375b834a14b3b1), [`8866608`](https://github.com/Effect-TS/effect/commit/88666082f2b6296bb7115bd4a2546151039f64db), [`69fd4b1`](https://github.com/Effect-TS/effect/commit/69fd4b1fba9e2ec5e7c16058ff8d9a1f9a38d90e), [`7d97626`](https://github.com/Effect-TS/effect/commit/7d9762658e515807c2b98678e7abd3ebe94e41ec), [`0e79436`](https://github.com/Effect-TS/effect/commit/0e794366658bd067a2212ea2ac7ed0223904ed31), [`2f8a4e9`](https://github.com/Effect-TS/effect/commit/2f8a4e9b90822d9facfef59027b35819c42d7b48), [`800b753`](https://github.com/Effect-TS/effect/commit/800b7535b4e37a24ac458cae78231054dae0b0f5)]: + - effect@4.1.6 + ## 4.1.5 ### Patch Changes diff --git a/.repos/effect/packages/sql/pglite/package.json b/.repos/effect/packages/sql/pglite/package.json index 0f3d56aa3257c..14f32135b8aaf 100644 --- a/.repos/effect/packages/sql/pglite/package.json +++ b/.repos/effect/packages/sql/pglite/package.json @@ -1,6 +1,6 @@ { "name": "@effect/sql-pglite", - "version": "4.1.5", + "version": "4.1.6", "type": "module", "license": "MIT", "description": "A PGlite toolkit for Effect", @@ -71,6 +71,6 @@ "effect": "workspace:^" }, "dependencies": { - "@electric-sql/pglite": "^0.5.16" + "@electric-sql/pglite": "^0.5.17" } } diff --git a/.repos/effect/packages/sql/sqlite-bun/CHANGELOG.md b/.repos/effect/packages/sql/sqlite-bun/CHANGELOG.md index e8b94e7f2ec98..8941fde8dbca7 100644 --- a/.repos/effect/packages/sql/sqlite-bun/CHANGELOG.md +++ b/.repos/effect/packages/sql/sqlite-bun/CHANGELOG.md @@ -1,5 +1,12 @@ # @effect/sql-sqlite-bun +## 4.1.6 + +### Patch Changes + +- Updated dependencies [[`dd5f2f3`](https://github.com/Effect-TS/effect/commit/dd5f2f322fbad042a3a186cef593bf42affe5ce9), [`1d65846`](https://github.com/Effect-TS/effect/commit/1d65846308a6a18c4a95af543988ad30b72ff2b3), [`694c28f`](https://github.com/Effect-TS/effect/commit/694c28f0cfc3eac33f71160d18dda95cb670f506), [`5aaa2cd`](https://github.com/Effect-TS/effect/commit/5aaa2cd216e5e55f92d06db98d4b54946a396eed), [`55814bf`](https://github.com/Effect-TS/effect/commit/55814bf0a780f05ed0a51c82c8affda5d539bb0e), [`92c40a1`](https://github.com/Effect-TS/effect/commit/92c40a1f96a59f9edcacee6c0d6f6fb80397ee17), [`9f415a7`](https://github.com/Effect-TS/effect/commit/9f415a7733cdf8aed7efadbed3b5db22890e164a), [`e367afd`](https://github.com/Effect-TS/effect/commit/e367afdacfa3041a694a67e4670e98a20e41d45c), [`d5d2112`](https://github.com/Effect-TS/effect/commit/d5d21120ff591fcf8da006ce340010812cc91f16), [`fa2e5af`](https://github.com/Effect-TS/effect/commit/fa2e5af4ccc8f3650d97049707be82eab098c168), [`6bf6427`](https://github.com/Effect-TS/effect/commit/6bf6427d195539c387c13156aff79db077929c8f), [`10bc4a4`](https://github.com/Effect-TS/effect/commit/10bc4a47c0ce5bc50ba1998d63a803e3887d1d2b), [`a9540d3`](https://github.com/Effect-TS/effect/commit/a9540d3d50fbe65ade7f9b2f478cdd34a888161e), [`3a250d7`](https://github.com/Effect-TS/effect/commit/3a250d7eb8c310bf4751b3eca0038cf50e1629d8), [`ce44141`](https://github.com/Effect-TS/effect/commit/ce44141ad1bc8d05f3f7399bfa1e87772573205d), [`9318e5b`](https://github.com/Effect-TS/effect/commit/9318e5bafb144ddff65a0bff0148ec4f7ba77b5c), [`c9ecebf`](https://github.com/Effect-TS/effect/commit/c9ecebf7ede8a98895552fd20223d6573bd846fe), [`32f8fbe`](https://github.com/Effect-TS/effect/commit/32f8fbe1a5985aea41754e87531e9a1d0fbf78ec), [`41d6af1`](https://github.com/Effect-TS/effect/commit/41d6af14b7f36e06ade3bf7333b710e73de1e1c2), [`c33fd59`](https://github.com/Effect-TS/effect/commit/c33fd599cb7d49117f77f7bd8f05cb4209112a34), [`1f9e9d3`](https://github.com/Effect-TS/effect/commit/1f9e9d3de552435de6b8f4e1166515d0964c3999), [`594fa71`](https://github.com/Effect-TS/effect/commit/594fa71da417bf94fa6c9be2d3d36c808197e9fe), [`b378c38`](https://github.com/Effect-TS/effect/commit/b378c383cdb29e819e24da5dc725479a2ba4fdf1), [`a9ec9a6`](https://github.com/Effect-TS/effect/commit/a9ec9a60bbe1309960e00527ab62342dce1a86fc), [`310a81b`](https://github.com/Effect-TS/effect/commit/310a81b391e24d42b6608b5e3d641eca63e0d4c0), [`aab2135`](https://github.com/Effect-TS/effect/commit/aab2135d3fe43d4d86c4e486ed378797314fb212), [`6744a72`](https://github.com/Effect-TS/effect/commit/6744a724869539fc2d733929df871ef523bf82e8), [`848d042`](https://github.com/Effect-TS/effect/commit/848d0426f287b3e7ff970219d980a4c66fa441ad), [`077a93e`](https://github.com/Effect-TS/effect/commit/077a93e5db3adbc42e531539cb12b8bdbdfe5328), [`aef50fb`](https://github.com/Effect-TS/effect/commit/aef50fb8b56ec9ff8116f157635579fefd995f26), [`2e4de86`](https://github.com/Effect-TS/effect/commit/2e4de8634431f3da08ca2a90ab1024ee08e216f3), [`482b104`](https://github.com/Effect-TS/effect/commit/482b104caf712a8d5f99aafc64e55b6ea38eb809), [`753e1ed`](https://github.com/Effect-TS/effect/commit/753e1ed88069f73103d136dcdc58188fd10efdf1), [`0d2bb4a`](https://github.com/Effect-TS/effect/commit/0d2bb4a4b6526e1767b81101ee6e8da88ba1de55), [`8161e03`](https://github.com/Effect-TS/effect/commit/8161e03c26d691502afeddcf7e2ee75e6931637f), [`49f5391`](https://github.com/Effect-TS/effect/commit/49f53918a150aa2ea0ce2d444400cec1d6097400), [`3d59bdf`](https://github.com/Effect-TS/effect/commit/3d59bdf6f8f95ceea2091e5b8f375b834a14b3b1), [`8866608`](https://github.com/Effect-TS/effect/commit/88666082f2b6296bb7115bd4a2546151039f64db), [`69fd4b1`](https://github.com/Effect-TS/effect/commit/69fd4b1fba9e2ec5e7c16058ff8d9a1f9a38d90e), [`7d97626`](https://github.com/Effect-TS/effect/commit/7d9762658e515807c2b98678e7abd3ebe94e41ec), [`0e79436`](https://github.com/Effect-TS/effect/commit/0e794366658bd067a2212ea2ac7ed0223904ed31), [`2f8a4e9`](https://github.com/Effect-TS/effect/commit/2f8a4e9b90822d9facfef59027b35819c42d7b48), [`800b753`](https://github.com/Effect-TS/effect/commit/800b7535b4e37a24ac458cae78231054dae0b0f5)]: + - effect@4.1.6 + ## 4.1.5 ### Patch Changes diff --git a/.repos/effect/packages/sql/sqlite-bun/package.json b/.repos/effect/packages/sql/sqlite-bun/package.json index 091520609aec4..85e0f6b6b2df3 100644 --- a/.repos/effect/packages/sql/sqlite-bun/package.json +++ b/.repos/effect/packages/sql/sqlite-bun/package.json @@ -1,6 +1,6 @@ { "name": "@effect/sql-sqlite-bun", - "version": "4.1.5", + "version": "4.1.6", "type": "module", "license": "MIT", "description": "A SQLite toolkit for Effect", @@ -62,7 +62,7 @@ }, "devDependencies": { "@effect/platform-bun": "workspace:^", - "@types/bun": "^1.4.4", + "@types/bun": "^1.4.5", "effect": "workspace:^" }, "peerDependencies": { diff --git a/.repos/effect/packages/sql/sqlite-do/CHANGELOG.md b/.repos/effect/packages/sql/sqlite-do/CHANGELOG.md index 4c0f5e598af6b..75ab110006c66 100644 --- a/.repos/effect/packages/sql/sqlite-do/CHANGELOG.md +++ b/.repos/effect/packages/sql/sqlite-do/CHANGELOG.md @@ -1,5 +1,12 @@ # @effect/sql-sqlite-do +## 4.1.6 + +### Patch Changes + +- Updated dependencies [[`dd5f2f3`](https://github.com/Effect-TS/effect/commit/dd5f2f322fbad042a3a186cef593bf42affe5ce9), [`1d65846`](https://github.com/Effect-TS/effect/commit/1d65846308a6a18c4a95af543988ad30b72ff2b3), [`694c28f`](https://github.com/Effect-TS/effect/commit/694c28f0cfc3eac33f71160d18dda95cb670f506), [`5aaa2cd`](https://github.com/Effect-TS/effect/commit/5aaa2cd216e5e55f92d06db98d4b54946a396eed), [`55814bf`](https://github.com/Effect-TS/effect/commit/55814bf0a780f05ed0a51c82c8affda5d539bb0e), [`92c40a1`](https://github.com/Effect-TS/effect/commit/92c40a1f96a59f9edcacee6c0d6f6fb80397ee17), [`9f415a7`](https://github.com/Effect-TS/effect/commit/9f415a7733cdf8aed7efadbed3b5db22890e164a), [`e367afd`](https://github.com/Effect-TS/effect/commit/e367afdacfa3041a694a67e4670e98a20e41d45c), [`d5d2112`](https://github.com/Effect-TS/effect/commit/d5d21120ff591fcf8da006ce340010812cc91f16), [`fa2e5af`](https://github.com/Effect-TS/effect/commit/fa2e5af4ccc8f3650d97049707be82eab098c168), [`6bf6427`](https://github.com/Effect-TS/effect/commit/6bf6427d195539c387c13156aff79db077929c8f), [`10bc4a4`](https://github.com/Effect-TS/effect/commit/10bc4a47c0ce5bc50ba1998d63a803e3887d1d2b), [`a9540d3`](https://github.com/Effect-TS/effect/commit/a9540d3d50fbe65ade7f9b2f478cdd34a888161e), [`3a250d7`](https://github.com/Effect-TS/effect/commit/3a250d7eb8c310bf4751b3eca0038cf50e1629d8), [`ce44141`](https://github.com/Effect-TS/effect/commit/ce44141ad1bc8d05f3f7399bfa1e87772573205d), [`9318e5b`](https://github.com/Effect-TS/effect/commit/9318e5bafb144ddff65a0bff0148ec4f7ba77b5c), [`c9ecebf`](https://github.com/Effect-TS/effect/commit/c9ecebf7ede8a98895552fd20223d6573bd846fe), [`32f8fbe`](https://github.com/Effect-TS/effect/commit/32f8fbe1a5985aea41754e87531e9a1d0fbf78ec), [`41d6af1`](https://github.com/Effect-TS/effect/commit/41d6af14b7f36e06ade3bf7333b710e73de1e1c2), [`c33fd59`](https://github.com/Effect-TS/effect/commit/c33fd599cb7d49117f77f7bd8f05cb4209112a34), [`1f9e9d3`](https://github.com/Effect-TS/effect/commit/1f9e9d3de552435de6b8f4e1166515d0964c3999), [`594fa71`](https://github.com/Effect-TS/effect/commit/594fa71da417bf94fa6c9be2d3d36c808197e9fe), [`b378c38`](https://github.com/Effect-TS/effect/commit/b378c383cdb29e819e24da5dc725479a2ba4fdf1), [`a9ec9a6`](https://github.com/Effect-TS/effect/commit/a9ec9a60bbe1309960e00527ab62342dce1a86fc), [`310a81b`](https://github.com/Effect-TS/effect/commit/310a81b391e24d42b6608b5e3d641eca63e0d4c0), [`aab2135`](https://github.com/Effect-TS/effect/commit/aab2135d3fe43d4d86c4e486ed378797314fb212), [`6744a72`](https://github.com/Effect-TS/effect/commit/6744a724869539fc2d733929df871ef523bf82e8), [`848d042`](https://github.com/Effect-TS/effect/commit/848d0426f287b3e7ff970219d980a4c66fa441ad), [`077a93e`](https://github.com/Effect-TS/effect/commit/077a93e5db3adbc42e531539cb12b8bdbdfe5328), [`aef50fb`](https://github.com/Effect-TS/effect/commit/aef50fb8b56ec9ff8116f157635579fefd995f26), [`2e4de86`](https://github.com/Effect-TS/effect/commit/2e4de8634431f3da08ca2a90ab1024ee08e216f3), [`482b104`](https://github.com/Effect-TS/effect/commit/482b104caf712a8d5f99aafc64e55b6ea38eb809), [`753e1ed`](https://github.com/Effect-TS/effect/commit/753e1ed88069f73103d136dcdc58188fd10efdf1), [`0d2bb4a`](https://github.com/Effect-TS/effect/commit/0d2bb4a4b6526e1767b81101ee6e8da88ba1de55), [`8161e03`](https://github.com/Effect-TS/effect/commit/8161e03c26d691502afeddcf7e2ee75e6931637f), [`49f5391`](https://github.com/Effect-TS/effect/commit/49f53918a150aa2ea0ce2d444400cec1d6097400), [`3d59bdf`](https://github.com/Effect-TS/effect/commit/3d59bdf6f8f95ceea2091e5b8f375b834a14b3b1), [`8866608`](https://github.com/Effect-TS/effect/commit/88666082f2b6296bb7115bd4a2546151039f64db), [`69fd4b1`](https://github.com/Effect-TS/effect/commit/69fd4b1fba9e2ec5e7c16058ff8d9a1f9a38d90e), [`7d97626`](https://github.com/Effect-TS/effect/commit/7d9762658e515807c2b98678e7abd3ebe94e41ec), [`0e79436`](https://github.com/Effect-TS/effect/commit/0e794366658bd067a2212ea2ac7ed0223904ed31), [`2f8a4e9`](https://github.com/Effect-TS/effect/commit/2f8a4e9b90822d9facfef59027b35819c42d7b48), [`800b753`](https://github.com/Effect-TS/effect/commit/800b7535b4e37a24ac458cae78231054dae0b0f5)]: + - effect@4.1.6 + ## 4.1.5 ### Patch Changes diff --git a/.repos/effect/packages/sql/sqlite-do/package.json b/.repos/effect/packages/sql/sqlite-do/package.json index 02fc25074d308..b18e6f5ea8d0f 100644 --- a/.repos/effect/packages/sql/sqlite-do/package.json +++ b/.repos/effect/packages/sql/sqlite-do/package.json @@ -1,6 +1,6 @@ { "name": "@effect/sql-sqlite-do", - "version": "4.1.5", + "version": "4.1.6", "type": "module", "license": "MIT", "description": "A SQLite toolkit for Effect", @@ -61,7 +61,7 @@ "check": "tsc -b tsconfig.json" }, "devDependencies": { - "@cloudflare/workers-types": "^5.20261114.1", + "@cloudflare/workers-types": "^5.20261121.1", "effect": "workspace:^", "esbuild": "^0.28.2", "miniflare": "5.20260925.0-alpha" diff --git a/.repos/effect/packages/sql/sqlite-node/CHANGELOG.md b/.repos/effect/packages/sql/sqlite-node/CHANGELOG.md index 6e9a06121658a..501156c3a9d2b 100644 --- a/.repos/effect/packages/sql/sqlite-node/CHANGELOG.md +++ b/.repos/effect/packages/sql/sqlite-node/CHANGELOG.md @@ -1,5 +1,12 @@ # @effect/sql-sqlite-node +## 4.1.6 + +### Patch Changes + +- Updated dependencies [[`dd5f2f3`](https://github.com/Effect-TS/effect/commit/dd5f2f322fbad042a3a186cef593bf42affe5ce9), [`1d65846`](https://github.com/Effect-TS/effect/commit/1d65846308a6a18c4a95af543988ad30b72ff2b3), [`694c28f`](https://github.com/Effect-TS/effect/commit/694c28f0cfc3eac33f71160d18dda95cb670f506), [`5aaa2cd`](https://github.com/Effect-TS/effect/commit/5aaa2cd216e5e55f92d06db98d4b54946a396eed), [`55814bf`](https://github.com/Effect-TS/effect/commit/55814bf0a780f05ed0a51c82c8affda5d539bb0e), [`92c40a1`](https://github.com/Effect-TS/effect/commit/92c40a1f96a59f9edcacee6c0d6f6fb80397ee17), [`9f415a7`](https://github.com/Effect-TS/effect/commit/9f415a7733cdf8aed7efadbed3b5db22890e164a), [`e367afd`](https://github.com/Effect-TS/effect/commit/e367afdacfa3041a694a67e4670e98a20e41d45c), [`d5d2112`](https://github.com/Effect-TS/effect/commit/d5d21120ff591fcf8da006ce340010812cc91f16), [`fa2e5af`](https://github.com/Effect-TS/effect/commit/fa2e5af4ccc8f3650d97049707be82eab098c168), [`6bf6427`](https://github.com/Effect-TS/effect/commit/6bf6427d195539c387c13156aff79db077929c8f), [`10bc4a4`](https://github.com/Effect-TS/effect/commit/10bc4a47c0ce5bc50ba1998d63a803e3887d1d2b), [`a9540d3`](https://github.com/Effect-TS/effect/commit/a9540d3d50fbe65ade7f9b2f478cdd34a888161e), [`3a250d7`](https://github.com/Effect-TS/effect/commit/3a250d7eb8c310bf4751b3eca0038cf50e1629d8), [`ce44141`](https://github.com/Effect-TS/effect/commit/ce44141ad1bc8d05f3f7399bfa1e87772573205d), [`9318e5b`](https://github.com/Effect-TS/effect/commit/9318e5bafb144ddff65a0bff0148ec4f7ba77b5c), [`c9ecebf`](https://github.com/Effect-TS/effect/commit/c9ecebf7ede8a98895552fd20223d6573bd846fe), [`32f8fbe`](https://github.com/Effect-TS/effect/commit/32f8fbe1a5985aea41754e87531e9a1d0fbf78ec), [`41d6af1`](https://github.com/Effect-TS/effect/commit/41d6af14b7f36e06ade3bf7333b710e73de1e1c2), [`c33fd59`](https://github.com/Effect-TS/effect/commit/c33fd599cb7d49117f77f7bd8f05cb4209112a34), [`1f9e9d3`](https://github.com/Effect-TS/effect/commit/1f9e9d3de552435de6b8f4e1166515d0964c3999), [`594fa71`](https://github.com/Effect-TS/effect/commit/594fa71da417bf94fa6c9be2d3d36c808197e9fe), [`b378c38`](https://github.com/Effect-TS/effect/commit/b378c383cdb29e819e24da5dc725479a2ba4fdf1), [`a9ec9a6`](https://github.com/Effect-TS/effect/commit/a9ec9a60bbe1309960e00527ab62342dce1a86fc), [`310a81b`](https://github.com/Effect-TS/effect/commit/310a81b391e24d42b6608b5e3d641eca63e0d4c0), [`aab2135`](https://github.com/Effect-TS/effect/commit/aab2135d3fe43d4d86c4e486ed378797314fb212), [`6744a72`](https://github.com/Effect-TS/effect/commit/6744a724869539fc2d733929df871ef523bf82e8), [`848d042`](https://github.com/Effect-TS/effect/commit/848d0426f287b3e7ff970219d980a4c66fa441ad), [`077a93e`](https://github.com/Effect-TS/effect/commit/077a93e5db3adbc42e531539cb12b8bdbdfe5328), [`aef50fb`](https://github.com/Effect-TS/effect/commit/aef50fb8b56ec9ff8116f157635579fefd995f26), [`2e4de86`](https://github.com/Effect-TS/effect/commit/2e4de8634431f3da08ca2a90ab1024ee08e216f3), [`482b104`](https://github.com/Effect-TS/effect/commit/482b104caf712a8d5f99aafc64e55b6ea38eb809), [`753e1ed`](https://github.com/Effect-TS/effect/commit/753e1ed88069f73103d136dcdc58188fd10efdf1), [`0d2bb4a`](https://github.com/Effect-TS/effect/commit/0d2bb4a4b6526e1767b81101ee6e8da88ba1de55), [`8161e03`](https://github.com/Effect-TS/effect/commit/8161e03c26d691502afeddcf7e2ee75e6931637f), [`49f5391`](https://github.com/Effect-TS/effect/commit/49f53918a150aa2ea0ce2d444400cec1d6097400), [`3d59bdf`](https://github.com/Effect-TS/effect/commit/3d59bdf6f8f95ceea2091e5b8f375b834a14b3b1), [`8866608`](https://github.com/Effect-TS/effect/commit/88666082f2b6296bb7115bd4a2546151039f64db), [`69fd4b1`](https://github.com/Effect-TS/effect/commit/69fd4b1fba9e2ec5e7c16058ff8d9a1f9a38d90e), [`7d97626`](https://github.com/Effect-TS/effect/commit/7d9762658e515807c2b98678e7abd3ebe94e41ec), [`0e79436`](https://github.com/Effect-TS/effect/commit/0e794366658bd067a2212ea2ac7ed0223904ed31), [`2f8a4e9`](https://github.com/Effect-TS/effect/commit/2f8a4e9b90822d9facfef59027b35819c42d7b48), [`800b753`](https://github.com/Effect-TS/effect/commit/800b7535b4e37a24ac458cae78231054dae0b0f5)]: + - effect@4.1.6 + ## 4.1.5 ### Patch Changes diff --git a/.repos/effect/packages/sql/sqlite-node/package.json b/.repos/effect/packages/sql/sqlite-node/package.json index b7233700a756b..a47e2e18f4372 100644 --- a/.repos/effect/packages/sql/sqlite-node/package.json +++ b/.repos/effect/packages/sql/sqlite-node/package.json @@ -1,6 +1,6 @@ { "name": "@effect/sql-sqlite-node", - "version": "4.1.5", + "version": "4.1.6", "type": "module", "license": "MIT", "description": "A SQLite toolkit for Effect", diff --git a/.repos/effect/packages/sql/sqlite-node/test/PersistedQueue.test.ts b/.repos/effect/packages/sql/sqlite-node/test/PersistedQueue.test.ts new file mode 100644 index 0000000000000..3a3c3fc979a61 --- /dev/null +++ b/.repos/effect/packages/sql/sqlite-node/test/PersistedQueue.test.ts @@ -0,0 +1,22 @@ +import * as NodeFileSystem from "@effect/platform-node/NodeFileSystem" +import { SqliteClient } from "@effect/sql-sqlite-node" +import { Effect, FileSystem, Layer } from "effect" +import * as PersistedQueueTest from "effect-test/persistence/PersistedQueueTest" +import { PersistedQueue } from "effect/persistence" + +const ClientLayer = Effect.gen(function*() { + const fs = yield* FileSystem.FileSystem + const dir = yield* fs.makeTempDirectoryScoped() + return SqliteClient.layer({ + filename: dir + "/test.db" + }) +}).pipe( + Layer.unwrap, + Layer.provide(NodeFileSystem.layer) +) + +PersistedQueueTest.suite( + "sql-sqlite-node", + PersistedQueue.layerStoreSql().pipe(Layer.provide(ClientLayer)), + { nonDeliveryWait: "250 millis" } +) diff --git a/.repos/effect/packages/sql/sqlite-node/test/Persistence.test.ts b/.repos/effect/packages/sql/sqlite-node/test/Persistence.test.ts index 4d00e19c41750..4c738295e676d 100644 --- a/.repos/effect/packages/sql/sqlite-node/test/Persistence.test.ts +++ b/.repos/effect/packages/sql/sqlite-node/test/Persistence.test.ts @@ -1,13 +1,11 @@ -import { NodeFileSystem } from "@effect/platform-node" +import * as NodeFileSystem from "@effect/platform-node/NodeFileSystem" import { SqliteClient } from "@effect/sql-sqlite-node" import { assert, expect, it } from "@effect/vitest" import { Duration, Effect, FileSystem, Layer } from "effect" import * as PersistedQueueSqlTest from "effect-test/persistence/PersistedQueueSqlTest" -import * as PersistedQueueTest from "effect-test/persistence/PersistedQueueTest" import * as SqlCleanupTest from "effect-test/persistence/SqlCleanupTest" import * as Arr from "effect/Array" -import { PersistedQueue, Persistence } from "effect/persistence" -import { Reactivity } from "effect/reactivity" +import { Persistence } from "effect/persistence" import * as SqlClient from "effect/sql/SqlClient" import { TestClock } from "effect/testing" @@ -19,7 +17,7 @@ const ClientLayer = Effect.gen(function*() { }) }).pipe( Layer.unwrap, - Layer.provide([NodeFileSystem.layer, Reactivity.layer]) + Layer.provide(NodeFileSystem.layer) ) const testLayer = (layer: Layer.Layer) => @@ -195,11 +193,6 @@ suite("single-table", Persistence.layerBackingSql, { injectionProbe: `') OR store_id='sqli_victim' AND ('1'='1` }) -PersistedQueueTest.suite( - "sql-sqlite-node", - PersistedQueue.layerStoreSql().pipe(Layer.provide(ClientLayer)) -) - it.layer(ClientLayer)((it) => PersistedQueueSqlTest.suiteWith(it)) it.layer(ClientLayer)("Persistence SQL cleanup", (it) => { diff --git a/.repos/effect/packages/sql/sqlite-node/test/SqliteMigrator.test.ts b/.repos/effect/packages/sql/sqlite-node/test/SqliteMigrator.test.ts index bf9b67aa72e5b..6a228ddf65003 100644 --- a/.repos/effect/packages/sql/sqlite-node/test/SqliteMigrator.test.ts +++ b/.repos/effect/packages/sql/sqlite-node/test/SqliteMigrator.test.ts @@ -39,6 +39,28 @@ describe("SqliteMigrator", () => { assert.deepStrictEqual(yield* migratorClient`SELECT migration_id FROM effect_sql_migrations`, []) })) + it.effect("runs migration id 0 on a fresh database", () => + Effect.gen(function*() { + const { migratorClient } = yield* makeClients + const run = SqliteMigrator.run({ + loader: SqliteMigrator.fromRecord({ + "0000_init": Effect.gen(function*() { + const sql = yield* SqlClient.SqlClient + yield* sql`CREATE TABLE items (id integer)` + }) + }) + }).pipe(Effect.provideService(SqlClient.SqlClient, migratorClient)) + + assert.deepStrictEqual(yield* run, [[0, "init"]]) + assert.deepStrictEqual(yield* migratorClient`SELECT id FROM items`, []) + assert.deepStrictEqual( + yield* migratorClient`SELECT migration_id, name FROM effect_sql_migrations`, + [{ migration_id: 0, name: "init" }] + ) + + assert.deepStrictEqual(yield* run, []) + })) + it.effect("fails on lock errors", () => Effect.gen(function*() { const { lockClient, migratorClient } = yield* makeClients diff --git a/.repos/effect/packages/sql/sqlite-react-native/CHANGELOG.md b/.repos/effect/packages/sql/sqlite-react-native/CHANGELOG.md index e49118a380e31..c67829bc4a376 100644 --- a/.repos/effect/packages/sql/sqlite-react-native/CHANGELOG.md +++ b/.repos/effect/packages/sql/sqlite-react-native/CHANGELOG.md @@ -1,5 +1,12 @@ # @effect/sql-sqlite-react-native +## 4.1.6 + +### Patch Changes + +- Updated dependencies [[`dd5f2f3`](https://github.com/Effect-TS/effect/commit/dd5f2f322fbad042a3a186cef593bf42affe5ce9), [`1d65846`](https://github.com/Effect-TS/effect/commit/1d65846308a6a18c4a95af543988ad30b72ff2b3), [`694c28f`](https://github.com/Effect-TS/effect/commit/694c28f0cfc3eac33f71160d18dda95cb670f506), [`5aaa2cd`](https://github.com/Effect-TS/effect/commit/5aaa2cd216e5e55f92d06db98d4b54946a396eed), [`55814bf`](https://github.com/Effect-TS/effect/commit/55814bf0a780f05ed0a51c82c8affda5d539bb0e), [`92c40a1`](https://github.com/Effect-TS/effect/commit/92c40a1f96a59f9edcacee6c0d6f6fb80397ee17), [`9f415a7`](https://github.com/Effect-TS/effect/commit/9f415a7733cdf8aed7efadbed3b5db22890e164a), [`e367afd`](https://github.com/Effect-TS/effect/commit/e367afdacfa3041a694a67e4670e98a20e41d45c), [`d5d2112`](https://github.com/Effect-TS/effect/commit/d5d21120ff591fcf8da006ce340010812cc91f16), [`fa2e5af`](https://github.com/Effect-TS/effect/commit/fa2e5af4ccc8f3650d97049707be82eab098c168), [`6bf6427`](https://github.com/Effect-TS/effect/commit/6bf6427d195539c387c13156aff79db077929c8f), [`10bc4a4`](https://github.com/Effect-TS/effect/commit/10bc4a47c0ce5bc50ba1998d63a803e3887d1d2b), [`a9540d3`](https://github.com/Effect-TS/effect/commit/a9540d3d50fbe65ade7f9b2f478cdd34a888161e), [`3a250d7`](https://github.com/Effect-TS/effect/commit/3a250d7eb8c310bf4751b3eca0038cf50e1629d8), [`ce44141`](https://github.com/Effect-TS/effect/commit/ce44141ad1bc8d05f3f7399bfa1e87772573205d), [`9318e5b`](https://github.com/Effect-TS/effect/commit/9318e5bafb144ddff65a0bff0148ec4f7ba77b5c), [`c9ecebf`](https://github.com/Effect-TS/effect/commit/c9ecebf7ede8a98895552fd20223d6573bd846fe), [`32f8fbe`](https://github.com/Effect-TS/effect/commit/32f8fbe1a5985aea41754e87531e9a1d0fbf78ec), [`41d6af1`](https://github.com/Effect-TS/effect/commit/41d6af14b7f36e06ade3bf7333b710e73de1e1c2), [`c33fd59`](https://github.com/Effect-TS/effect/commit/c33fd599cb7d49117f77f7bd8f05cb4209112a34), [`1f9e9d3`](https://github.com/Effect-TS/effect/commit/1f9e9d3de552435de6b8f4e1166515d0964c3999), [`594fa71`](https://github.com/Effect-TS/effect/commit/594fa71da417bf94fa6c9be2d3d36c808197e9fe), [`b378c38`](https://github.com/Effect-TS/effect/commit/b378c383cdb29e819e24da5dc725479a2ba4fdf1), [`a9ec9a6`](https://github.com/Effect-TS/effect/commit/a9ec9a60bbe1309960e00527ab62342dce1a86fc), [`310a81b`](https://github.com/Effect-TS/effect/commit/310a81b391e24d42b6608b5e3d641eca63e0d4c0), [`aab2135`](https://github.com/Effect-TS/effect/commit/aab2135d3fe43d4d86c4e486ed378797314fb212), [`6744a72`](https://github.com/Effect-TS/effect/commit/6744a724869539fc2d733929df871ef523bf82e8), [`848d042`](https://github.com/Effect-TS/effect/commit/848d0426f287b3e7ff970219d980a4c66fa441ad), [`077a93e`](https://github.com/Effect-TS/effect/commit/077a93e5db3adbc42e531539cb12b8bdbdfe5328), [`aef50fb`](https://github.com/Effect-TS/effect/commit/aef50fb8b56ec9ff8116f157635579fefd995f26), [`2e4de86`](https://github.com/Effect-TS/effect/commit/2e4de8634431f3da08ca2a90ab1024ee08e216f3), [`482b104`](https://github.com/Effect-TS/effect/commit/482b104caf712a8d5f99aafc64e55b6ea38eb809), [`753e1ed`](https://github.com/Effect-TS/effect/commit/753e1ed88069f73103d136dcdc58188fd10efdf1), [`0d2bb4a`](https://github.com/Effect-TS/effect/commit/0d2bb4a4b6526e1767b81101ee6e8da88ba1de55), [`8161e03`](https://github.com/Effect-TS/effect/commit/8161e03c26d691502afeddcf7e2ee75e6931637f), [`49f5391`](https://github.com/Effect-TS/effect/commit/49f53918a150aa2ea0ce2d444400cec1d6097400), [`3d59bdf`](https://github.com/Effect-TS/effect/commit/3d59bdf6f8f95ceea2091e5b8f375b834a14b3b1), [`8866608`](https://github.com/Effect-TS/effect/commit/88666082f2b6296bb7115bd4a2546151039f64db), [`69fd4b1`](https://github.com/Effect-TS/effect/commit/69fd4b1fba9e2ec5e7c16058ff8d9a1f9a38d90e), [`7d97626`](https://github.com/Effect-TS/effect/commit/7d9762658e515807c2b98678e7abd3ebe94e41ec), [`0e79436`](https://github.com/Effect-TS/effect/commit/0e794366658bd067a2212ea2ac7ed0223904ed31), [`2f8a4e9`](https://github.com/Effect-TS/effect/commit/2f8a4e9b90822d9facfef59027b35819c42d7b48), [`800b753`](https://github.com/Effect-TS/effect/commit/800b7535b4e37a24ac458cae78231054dae0b0f5)]: + - effect@4.1.6 + ## 4.1.5 ### Patch Changes diff --git a/.repos/effect/packages/sql/sqlite-react-native/package.json b/.repos/effect/packages/sql/sqlite-react-native/package.json index 1fb11b542a559..c362d4d2b3913 100644 --- a/.repos/effect/packages/sql/sqlite-react-native/package.json +++ b/.repos/effect/packages/sql/sqlite-react-native/package.json @@ -1,6 +1,6 @@ { "name": "@effect/sql-sqlite-react-native", - "version": "4.1.5", + "version": "4.1.6", "type": "module", "license": "MIT", "description": "A SQLite toolkit for Effect", diff --git a/.repos/effect/packages/sql/sqlite-wasm/CHANGELOG.md b/.repos/effect/packages/sql/sqlite-wasm/CHANGELOG.md index 4cdb8c28e80e0..121ef0e1cb262 100644 --- a/.repos/effect/packages/sql/sqlite-wasm/CHANGELOG.md +++ b/.repos/effect/packages/sql/sqlite-wasm/CHANGELOG.md @@ -1,5 +1,12 @@ # @effect/sql-sqlite-wasm +## 4.1.6 + +### Patch Changes + +- Updated dependencies [[`dd5f2f3`](https://github.com/Effect-TS/effect/commit/dd5f2f322fbad042a3a186cef593bf42affe5ce9), [`1d65846`](https://github.com/Effect-TS/effect/commit/1d65846308a6a18c4a95af543988ad30b72ff2b3), [`694c28f`](https://github.com/Effect-TS/effect/commit/694c28f0cfc3eac33f71160d18dda95cb670f506), [`5aaa2cd`](https://github.com/Effect-TS/effect/commit/5aaa2cd216e5e55f92d06db98d4b54946a396eed), [`55814bf`](https://github.com/Effect-TS/effect/commit/55814bf0a780f05ed0a51c82c8affda5d539bb0e), [`92c40a1`](https://github.com/Effect-TS/effect/commit/92c40a1f96a59f9edcacee6c0d6f6fb80397ee17), [`9f415a7`](https://github.com/Effect-TS/effect/commit/9f415a7733cdf8aed7efadbed3b5db22890e164a), [`e367afd`](https://github.com/Effect-TS/effect/commit/e367afdacfa3041a694a67e4670e98a20e41d45c), [`d5d2112`](https://github.com/Effect-TS/effect/commit/d5d21120ff591fcf8da006ce340010812cc91f16), [`fa2e5af`](https://github.com/Effect-TS/effect/commit/fa2e5af4ccc8f3650d97049707be82eab098c168), [`6bf6427`](https://github.com/Effect-TS/effect/commit/6bf6427d195539c387c13156aff79db077929c8f), [`10bc4a4`](https://github.com/Effect-TS/effect/commit/10bc4a47c0ce5bc50ba1998d63a803e3887d1d2b), [`a9540d3`](https://github.com/Effect-TS/effect/commit/a9540d3d50fbe65ade7f9b2f478cdd34a888161e), [`3a250d7`](https://github.com/Effect-TS/effect/commit/3a250d7eb8c310bf4751b3eca0038cf50e1629d8), [`ce44141`](https://github.com/Effect-TS/effect/commit/ce44141ad1bc8d05f3f7399bfa1e87772573205d), [`9318e5b`](https://github.com/Effect-TS/effect/commit/9318e5bafb144ddff65a0bff0148ec4f7ba77b5c), [`c9ecebf`](https://github.com/Effect-TS/effect/commit/c9ecebf7ede8a98895552fd20223d6573bd846fe), [`32f8fbe`](https://github.com/Effect-TS/effect/commit/32f8fbe1a5985aea41754e87531e9a1d0fbf78ec), [`41d6af1`](https://github.com/Effect-TS/effect/commit/41d6af14b7f36e06ade3bf7333b710e73de1e1c2), [`c33fd59`](https://github.com/Effect-TS/effect/commit/c33fd599cb7d49117f77f7bd8f05cb4209112a34), [`1f9e9d3`](https://github.com/Effect-TS/effect/commit/1f9e9d3de552435de6b8f4e1166515d0964c3999), [`594fa71`](https://github.com/Effect-TS/effect/commit/594fa71da417bf94fa6c9be2d3d36c808197e9fe), [`b378c38`](https://github.com/Effect-TS/effect/commit/b378c383cdb29e819e24da5dc725479a2ba4fdf1), [`a9ec9a6`](https://github.com/Effect-TS/effect/commit/a9ec9a60bbe1309960e00527ab62342dce1a86fc), [`310a81b`](https://github.com/Effect-TS/effect/commit/310a81b391e24d42b6608b5e3d641eca63e0d4c0), [`aab2135`](https://github.com/Effect-TS/effect/commit/aab2135d3fe43d4d86c4e486ed378797314fb212), [`6744a72`](https://github.com/Effect-TS/effect/commit/6744a724869539fc2d733929df871ef523bf82e8), [`848d042`](https://github.com/Effect-TS/effect/commit/848d0426f287b3e7ff970219d980a4c66fa441ad), [`077a93e`](https://github.com/Effect-TS/effect/commit/077a93e5db3adbc42e531539cb12b8bdbdfe5328), [`aef50fb`](https://github.com/Effect-TS/effect/commit/aef50fb8b56ec9ff8116f157635579fefd995f26), [`2e4de86`](https://github.com/Effect-TS/effect/commit/2e4de8634431f3da08ca2a90ab1024ee08e216f3), [`482b104`](https://github.com/Effect-TS/effect/commit/482b104caf712a8d5f99aafc64e55b6ea38eb809), [`753e1ed`](https://github.com/Effect-TS/effect/commit/753e1ed88069f73103d136dcdc58188fd10efdf1), [`0d2bb4a`](https://github.com/Effect-TS/effect/commit/0d2bb4a4b6526e1767b81101ee6e8da88ba1de55), [`8161e03`](https://github.com/Effect-TS/effect/commit/8161e03c26d691502afeddcf7e2ee75e6931637f), [`49f5391`](https://github.com/Effect-TS/effect/commit/49f53918a150aa2ea0ce2d444400cec1d6097400), [`3d59bdf`](https://github.com/Effect-TS/effect/commit/3d59bdf6f8f95ceea2091e5b8f375b834a14b3b1), [`8866608`](https://github.com/Effect-TS/effect/commit/88666082f2b6296bb7115bd4a2546151039f64db), [`69fd4b1`](https://github.com/Effect-TS/effect/commit/69fd4b1fba9e2ec5e7c16058ff8d9a1f9a38d90e), [`7d97626`](https://github.com/Effect-TS/effect/commit/7d9762658e515807c2b98678e7abd3ebe94e41ec), [`0e79436`](https://github.com/Effect-TS/effect/commit/0e794366658bd067a2212ea2ac7ed0223904ed31), [`2f8a4e9`](https://github.com/Effect-TS/effect/commit/2f8a4e9b90822d9facfef59027b35819c42d7b48), [`800b753`](https://github.com/Effect-TS/effect/commit/800b7535b4e37a24ac458cae78231054dae0b0f5)]: + - effect@4.1.6 + ## 4.1.5 ### Patch Changes diff --git a/.repos/effect/packages/sql/sqlite-wasm/package.json b/.repos/effect/packages/sql/sqlite-wasm/package.json index 007ae65110eeb..3f69c7b46dbf4 100644 --- a/.repos/effect/packages/sql/sqlite-wasm/package.json +++ b/.repos/effect/packages/sql/sqlite-wasm/package.json @@ -1,6 +1,6 @@ { "name": "@effect/sql-sqlite-wasm", - "version": "4.1.5", + "version": "4.1.6", "type": "module", "license": "MIT", "description": "A SQLite toolkit for Effect", diff --git a/.repos/effect/packages/tools/bundle/package.json b/.repos/effect/packages/tools/bundle/package.json index 21e03c4b9c720..79ee1d405f3eb 100644 --- a/.repos/effect/packages/tools/bundle/package.json +++ b/.repos/effect/packages/tools/bundle/package.json @@ -41,12 +41,12 @@ "@rollup/plugin-terser": "^1.0.2", "effect": "workspace:^", "glob": "^14.0.6", - "rollup": "^4.68.3", + "rollup": "^4.68.8", "rollup-plugin-esbuild": "^6.2.1", "rollup-plugin-visualizer": "^7.1.3" }, "devDependencies": { - "@babel/core": "^8.1.2", + "@babel/core": "^8.1.3", "@types/node": "^26.6.6", "babel-plugin-annotate-pure-calls": "^0.5.0", "esbuild": "^0.28.2" diff --git a/.repos/effect/packages/tools/docgen/CHANGELOG.md b/.repos/effect/packages/tools/docgen/CHANGELOG.md index 8a0aa8467afc5..bd80bc1eb013b 100644 --- a/.repos/effect/packages/tools/docgen/CHANGELOG.md +++ b/.repos/effect/packages/tools/docgen/CHANGELOG.md @@ -1,5 +1,13 @@ # @effect/docgen +## 4.1.6 + +### Patch Changes + +- Updated dependencies [[`dd5f2f3`](https://github.com/Effect-TS/effect/commit/dd5f2f322fbad042a3a186cef593bf42affe5ce9), [`1d65846`](https://github.com/Effect-TS/effect/commit/1d65846308a6a18c4a95af543988ad30b72ff2b3), [`694c28f`](https://github.com/Effect-TS/effect/commit/694c28f0cfc3eac33f71160d18dda95cb670f506), [`5aaa2cd`](https://github.com/Effect-TS/effect/commit/5aaa2cd216e5e55f92d06db98d4b54946a396eed), [`55814bf`](https://github.com/Effect-TS/effect/commit/55814bf0a780f05ed0a51c82c8affda5d539bb0e), [`92c40a1`](https://github.com/Effect-TS/effect/commit/92c40a1f96a59f9edcacee6c0d6f6fb80397ee17), [`9f415a7`](https://github.com/Effect-TS/effect/commit/9f415a7733cdf8aed7efadbed3b5db22890e164a), [`e367afd`](https://github.com/Effect-TS/effect/commit/e367afdacfa3041a694a67e4670e98a20e41d45c), [`d5d2112`](https://github.com/Effect-TS/effect/commit/d5d21120ff591fcf8da006ce340010812cc91f16), [`fa2e5af`](https://github.com/Effect-TS/effect/commit/fa2e5af4ccc8f3650d97049707be82eab098c168), [`6bf6427`](https://github.com/Effect-TS/effect/commit/6bf6427d195539c387c13156aff79db077929c8f), [`10bc4a4`](https://github.com/Effect-TS/effect/commit/10bc4a47c0ce5bc50ba1998d63a803e3887d1d2b), [`a9540d3`](https://github.com/Effect-TS/effect/commit/a9540d3d50fbe65ade7f9b2f478cdd34a888161e), [`3a250d7`](https://github.com/Effect-TS/effect/commit/3a250d7eb8c310bf4751b3eca0038cf50e1629d8), [`ce44141`](https://github.com/Effect-TS/effect/commit/ce44141ad1bc8d05f3f7399bfa1e87772573205d), [`9318e5b`](https://github.com/Effect-TS/effect/commit/9318e5bafb144ddff65a0bff0148ec4f7ba77b5c), [`c9ecebf`](https://github.com/Effect-TS/effect/commit/c9ecebf7ede8a98895552fd20223d6573bd846fe), [`32f8fbe`](https://github.com/Effect-TS/effect/commit/32f8fbe1a5985aea41754e87531e9a1d0fbf78ec), [`41d6af1`](https://github.com/Effect-TS/effect/commit/41d6af14b7f36e06ade3bf7333b710e73de1e1c2), [`c33fd59`](https://github.com/Effect-TS/effect/commit/c33fd599cb7d49117f77f7bd8f05cb4209112a34), [`1f9e9d3`](https://github.com/Effect-TS/effect/commit/1f9e9d3de552435de6b8f4e1166515d0964c3999), [`594fa71`](https://github.com/Effect-TS/effect/commit/594fa71da417bf94fa6c9be2d3d36c808197e9fe), [`b378c38`](https://github.com/Effect-TS/effect/commit/b378c383cdb29e819e24da5dc725479a2ba4fdf1), [`a9ec9a6`](https://github.com/Effect-TS/effect/commit/a9ec9a60bbe1309960e00527ab62342dce1a86fc), [`310a81b`](https://github.com/Effect-TS/effect/commit/310a81b391e24d42b6608b5e3d641eca63e0d4c0), [`2576bbc`](https://github.com/Effect-TS/effect/commit/2576bbcbe89fec2362240280e4db2bc371f978e3), [`aab2135`](https://github.com/Effect-TS/effect/commit/aab2135d3fe43d4d86c4e486ed378797314fb212), [`6744a72`](https://github.com/Effect-TS/effect/commit/6744a724869539fc2d733929df871ef523bf82e8), [`848d042`](https://github.com/Effect-TS/effect/commit/848d0426f287b3e7ff970219d980a4c66fa441ad), [`077a93e`](https://github.com/Effect-TS/effect/commit/077a93e5db3adbc42e531539cb12b8bdbdfe5328), [`aef50fb`](https://github.com/Effect-TS/effect/commit/aef50fb8b56ec9ff8116f157635579fefd995f26), [`2e4de86`](https://github.com/Effect-TS/effect/commit/2e4de8634431f3da08ca2a90ab1024ee08e216f3), [`482b104`](https://github.com/Effect-TS/effect/commit/482b104caf712a8d5f99aafc64e55b6ea38eb809), [`753e1ed`](https://github.com/Effect-TS/effect/commit/753e1ed88069f73103d136dcdc58188fd10efdf1), [`0d2bb4a`](https://github.com/Effect-TS/effect/commit/0d2bb4a4b6526e1767b81101ee6e8da88ba1de55), [`8161e03`](https://github.com/Effect-TS/effect/commit/8161e03c26d691502afeddcf7e2ee75e6931637f), [`bb02f33`](https://github.com/Effect-TS/effect/commit/bb02f33a66309e62999d16fb87a3278157dd2e79), [`49f5391`](https://github.com/Effect-TS/effect/commit/49f53918a150aa2ea0ce2d444400cec1d6097400), [`3d59bdf`](https://github.com/Effect-TS/effect/commit/3d59bdf6f8f95ceea2091e5b8f375b834a14b3b1), [`8866608`](https://github.com/Effect-TS/effect/commit/88666082f2b6296bb7115bd4a2546151039f64db), [`69fd4b1`](https://github.com/Effect-TS/effect/commit/69fd4b1fba9e2ec5e7c16058ff8d9a1f9a38d90e), [`7d97626`](https://github.com/Effect-TS/effect/commit/7d9762658e515807c2b98678e7abd3ebe94e41ec), [`0e79436`](https://github.com/Effect-TS/effect/commit/0e794366658bd067a2212ea2ac7ed0223904ed31), [`2f8a4e9`](https://github.com/Effect-TS/effect/commit/2f8a4e9b90822d9facfef59027b35819c42d7b48), [`800b753`](https://github.com/Effect-TS/effect/commit/800b7535b4e37a24ac458cae78231054dae0b0f5)]: + - effect@4.1.6 + - @effect/platform-node@4.1.6 + ## 4.1.5 ### Patch Changes diff --git a/.repos/effect/packages/tools/docgen/package.json b/.repos/effect/packages/tools/docgen/package.json index 00dcbe1fccb5a..be59cb307a498 100644 --- a/.repos/effect/packages/tools/docgen/package.json +++ b/.repos/effect/packages/tools/docgen/package.json @@ -1,6 +1,6 @@ { "name": "@effect/docgen", - "version": "4.1.5", + "version": "4.1.6", "type": "module", "license": "MIT", "description": "An opinionated documentation generator for Effect projects", diff --git a/.repos/effect/packages/tools/doctest/CHANGELOG.md b/.repos/effect/packages/tools/doctest/CHANGELOG.md index d44ae1484d7e0..d1325f25c0ede 100644 --- a/.repos/effect/packages/tools/doctest/CHANGELOG.md +++ b/.repos/effect/packages/tools/doctest/CHANGELOG.md @@ -1,5 +1,13 @@ # @effect/doctest +## 4.1.6 + +### Patch Changes + +- [#10851](https://github.com/Effect-TS/effect/pull/10851) [`bb02f33`](https://github.com/Effect-TS/effect/commit/bb02f33a66309e62999d16fb87a3278157dd2e79) Thanks @effect-bot! - Update repository dependencies to their latest compatible releases. +- Updated dependencies [[`dd5f2f3`](https://github.com/Effect-TS/effect/commit/dd5f2f322fbad042a3a186cef593bf42affe5ce9), [`1d65846`](https://github.com/Effect-TS/effect/commit/1d65846308a6a18c4a95af543988ad30b72ff2b3), [`694c28f`](https://github.com/Effect-TS/effect/commit/694c28f0cfc3eac33f71160d18dda95cb670f506), [`5aaa2cd`](https://github.com/Effect-TS/effect/commit/5aaa2cd216e5e55f92d06db98d4b54946a396eed), [`55814bf`](https://github.com/Effect-TS/effect/commit/55814bf0a780f05ed0a51c82c8affda5d539bb0e), [`92c40a1`](https://github.com/Effect-TS/effect/commit/92c40a1f96a59f9edcacee6c0d6f6fb80397ee17), [`9f415a7`](https://github.com/Effect-TS/effect/commit/9f415a7733cdf8aed7efadbed3b5db22890e164a), [`e367afd`](https://github.com/Effect-TS/effect/commit/e367afdacfa3041a694a67e4670e98a20e41d45c), [`d5d2112`](https://github.com/Effect-TS/effect/commit/d5d21120ff591fcf8da006ce340010812cc91f16), [`fa2e5af`](https://github.com/Effect-TS/effect/commit/fa2e5af4ccc8f3650d97049707be82eab098c168), [`6bf6427`](https://github.com/Effect-TS/effect/commit/6bf6427d195539c387c13156aff79db077929c8f), [`10bc4a4`](https://github.com/Effect-TS/effect/commit/10bc4a47c0ce5bc50ba1998d63a803e3887d1d2b), [`a9540d3`](https://github.com/Effect-TS/effect/commit/a9540d3d50fbe65ade7f9b2f478cdd34a888161e), [`3a250d7`](https://github.com/Effect-TS/effect/commit/3a250d7eb8c310bf4751b3eca0038cf50e1629d8), [`ce44141`](https://github.com/Effect-TS/effect/commit/ce44141ad1bc8d05f3f7399bfa1e87772573205d), [`9318e5b`](https://github.com/Effect-TS/effect/commit/9318e5bafb144ddff65a0bff0148ec4f7ba77b5c), [`c9ecebf`](https://github.com/Effect-TS/effect/commit/c9ecebf7ede8a98895552fd20223d6573bd846fe), [`32f8fbe`](https://github.com/Effect-TS/effect/commit/32f8fbe1a5985aea41754e87531e9a1d0fbf78ec), [`41d6af1`](https://github.com/Effect-TS/effect/commit/41d6af14b7f36e06ade3bf7333b710e73de1e1c2), [`c33fd59`](https://github.com/Effect-TS/effect/commit/c33fd599cb7d49117f77f7bd8f05cb4209112a34), [`1f9e9d3`](https://github.com/Effect-TS/effect/commit/1f9e9d3de552435de6b8f4e1166515d0964c3999), [`594fa71`](https://github.com/Effect-TS/effect/commit/594fa71da417bf94fa6c9be2d3d36c808197e9fe), [`b378c38`](https://github.com/Effect-TS/effect/commit/b378c383cdb29e819e24da5dc725479a2ba4fdf1), [`a9ec9a6`](https://github.com/Effect-TS/effect/commit/a9ec9a60bbe1309960e00527ab62342dce1a86fc), [`310a81b`](https://github.com/Effect-TS/effect/commit/310a81b391e24d42b6608b5e3d641eca63e0d4c0), [`aab2135`](https://github.com/Effect-TS/effect/commit/aab2135d3fe43d4d86c4e486ed378797314fb212), [`6744a72`](https://github.com/Effect-TS/effect/commit/6744a724869539fc2d733929df871ef523bf82e8), [`848d042`](https://github.com/Effect-TS/effect/commit/848d0426f287b3e7ff970219d980a4c66fa441ad), [`077a93e`](https://github.com/Effect-TS/effect/commit/077a93e5db3adbc42e531539cb12b8bdbdfe5328), [`aef50fb`](https://github.com/Effect-TS/effect/commit/aef50fb8b56ec9ff8116f157635579fefd995f26), [`2e4de86`](https://github.com/Effect-TS/effect/commit/2e4de8634431f3da08ca2a90ab1024ee08e216f3), [`482b104`](https://github.com/Effect-TS/effect/commit/482b104caf712a8d5f99aafc64e55b6ea38eb809), [`753e1ed`](https://github.com/Effect-TS/effect/commit/753e1ed88069f73103d136dcdc58188fd10efdf1), [`0d2bb4a`](https://github.com/Effect-TS/effect/commit/0d2bb4a4b6526e1767b81101ee6e8da88ba1de55), [`8161e03`](https://github.com/Effect-TS/effect/commit/8161e03c26d691502afeddcf7e2ee75e6931637f), [`49f5391`](https://github.com/Effect-TS/effect/commit/49f53918a150aa2ea0ce2d444400cec1d6097400), [`3d59bdf`](https://github.com/Effect-TS/effect/commit/3d59bdf6f8f95ceea2091e5b8f375b834a14b3b1), [`8866608`](https://github.com/Effect-TS/effect/commit/88666082f2b6296bb7115bd4a2546151039f64db), [`69fd4b1`](https://github.com/Effect-TS/effect/commit/69fd4b1fba9e2ec5e7c16058ff8d9a1f9a38d90e), [`7d97626`](https://github.com/Effect-TS/effect/commit/7d9762658e515807c2b98678e7abd3ebe94e41ec), [`0e79436`](https://github.com/Effect-TS/effect/commit/0e794366658bd067a2212ea2ac7ed0223904ed31), [`2f8a4e9`](https://github.com/Effect-TS/effect/commit/2f8a4e9b90822d9facfef59027b35819c42d7b48), [`800b753`](https://github.com/Effect-TS/effect/commit/800b7535b4e37a24ac458cae78231054dae0b0f5)]: + - effect@4.1.6 + ## 4.1.5 ### Patch Changes diff --git a/.repos/effect/packages/tools/doctest/package.json b/.repos/effect/packages/tools/doctest/package.json index 0dd0a4c03658d..eafdbd482d8a9 100644 --- a/.repos/effect/packages/tools/doctest/package.json +++ b/.repos/effect/packages/tools/doctest/package.json @@ -1,6 +1,6 @@ { "name": "@effect/doctest", - "version": "4.1.5", + "version": "4.1.6", "type": "module", "license": "MIT", "description": "Runs TypeScript documentation examples as Vitest tests", @@ -46,7 +46,7 @@ "check": "tsc -b tsconfig.json" }, "dependencies": { - "rolldown": "^1.3.2" + "rolldown": "^1.3.3" }, "peerDependencies": { "effect": "workspace:^", diff --git a/.repos/effect/packages/tools/graphql-generator/CHANGELOG.md b/.repos/effect/packages/tools/graphql-generator/CHANGELOG.md index 15c0db2567575..22a634a6acc40 100644 --- a/.repos/effect/packages/tools/graphql-generator/CHANGELOG.md +++ b/.repos/effect/packages/tools/graphql-generator/CHANGELOG.md @@ -1,5 +1,13 @@ # @effect/graphql-generator +## 4.1.6 + +### Patch Changes + +- Updated dependencies [[`dd5f2f3`](https://github.com/Effect-TS/effect/commit/dd5f2f322fbad042a3a186cef593bf42affe5ce9), [`1d65846`](https://github.com/Effect-TS/effect/commit/1d65846308a6a18c4a95af543988ad30b72ff2b3), [`694c28f`](https://github.com/Effect-TS/effect/commit/694c28f0cfc3eac33f71160d18dda95cb670f506), [`5aaa2cd`](https://github.com/Effect-TS/effect/commit/5aaa2cd216e5e55f92d06db98d4b54946a396eed), [`55814bf`](https://github.com/Effect-TS/effect/commit/55814bf0a780f05ed0a51c82c8affda5d539bb0e), [`92c40a1`](https://github.com/Effect-TS/effect/commit/92c40a1f96a59f9edcacee6c0d6f6fb80397ee17), [`9f415a7`](https://github.com/Effect-TS/effect/commit/9f415a7733cdf8aed7efadbed3b5db22890e164a), [`e367afd`](https://github.com/Effect-TS/effect/commit/e367afdacfa3041a694a67e4670e98a20e41d45c), [`d5d2112`](https://github.com/Effect-TS/effect/commit/d5d21120ff591fcf8da006ce340010812cc91f16), [`fa2e5af`](https://github.com/Effect-TS/effect/commit/fa2e5af4ccc8f3650d97049707be82eab098c168), [`6bf6427`](https://github.com/Effect-TS/effect/commit/6bf6427d195539c387c13156aff79db077929c8f), [`10bc4a4`](https://github.com/Effect-TS/effect/commit/10bc4a47c0ce5bc50ba1998d63a803e3887d1d2b), [`a9540d3`](https://github.com/Effect-TS/effect/commit/a9540d3d50fbe65ade7f9b2f478cdd34a888161e), [`3a250d7`](https://github.com/Effect-TS/effect/commit/3a250d7eb8c310bf4751b3eca0038cf50e1629d8), [`ce44141`](https://github.com/Effect-TS/effect/commit/ce44141ad1bc8d05f3f7399bfa1e87772573205d), [`9318e5b`](https://github.com/Effect-TS/effect/commit/9318e5bafb144ddff65a0bff0148ec4f7ba77b5c), [`c9ecebf`](https://github.com/Effect-TS/effect/commit/c9ecebf7ede8a98895552fd20223d6573bd846fe), [`32f8fbe`](https://github.com/Effect-TS/effect/commit/32f8fbe1a5985aea41754e87531e9a1d0fbf78ec), [`41d6af1`](https://github.com/Effect-TS/effect/commit/41d6af14b7f36e06ade3bf7333b710e73de1e1c2), [`c33fd59`](https://github.com/Effect-TS/effect/commit/c33fd599cb7d49117f77f7bd8f05cb4209112a34), [`1f9e9d3`](https://github.com/Effect-TS/effect/commit/1f9e9d3de552435de6b8f4e1166515d0964c3999), [`594fa71`](https://github.com/Effect-TS/effect/commit/594fa71da417bf94fa6c9be2d3d36c808197e9fe), [`b378c38`](https://github.com/Effect-TS/effect/commit/b378c383cdb29e819e24da5dc725479a2ba4fdf1), [`a9ec9a6`](https://github.com/Effect-TS/effect/commit/a9ec9a60bbe1309960e00527ab62342dce1a86fc), [`310a81b`](https://github.com/Effect-TS/effect/commit/310a81b391e24d42b6608b5e3d641eca63e0d4c0), [`2576bbc`](https://github.com/Effect-TS/effect/commit/2576bbcbe89fec2362240280e4db2bc371f978e3), [`aab2135`](https://github.com/Effect-TS/effect/commit/aab2135d3fe43d4d86c4e486ed378797314fb212), [`6744a72`](https://github.com/Effect-TS/effect/commit/6744a724869539fc2d733929df871ef523bf82e8), [`848d042`](https://github.com/Effect-TS/effect/commit/848d0426f287b3e7ff970219d980a4c66fa441ad), [`077a93e`](https://github.com/Effect-TS/effect/commit/077a93e5db3adbc42e531539cb12b8bdbdfe5328), [`aef50fb`](https://github.com/Effect-TS/effect/commit/aef50fb8b56ec9ff8116f157635579fefd995f26), [`2e4de86`](https://github.com/Effect-TS/effect/commit/2e4de8634431f3da08ca2a90ab1024ee08e216f3), [`482b104`](https://github.com/Effect-TS/effect/commit/482b104caf712a8d5f99aafc64e55b6ea38eb809), [`753e1ed`](https://github.com/Effect-TS/effect/commit/753e1ed88069f73103d136dcdc58188fd10efdf1), [`0d2bb4a`](https://github.com/Effect-TS/effect/commit/0d2bb4a4b6526e1767b81101ee6e8da88ba1de55), [`8161e03`](https://github.com/Effect-TS/effect/commit/8161e03c26d691502afeddcf7e2ee75e6931637f), [`bb02f33`](https://github.com/Effect-TS/effect/commit/bb02f33a66309e62999d16fb87a3278157dd2e79), [`49f5391`](https://github.com/Effect-TS/effect/commit/49f53918a150aa2ea0ce2d444400cec1d6097400), [`3d59bdf`](https://github.com/Effect-TS/effect/commit/3d59bdf6f8f95ceea2091e5b8f375b834a14b3b1), [`8866608`](https://github.com/Effect-TS/effect/commit/88666082f2b6296bb7115bd4a2546151039f64db), [`69fd4b1`](https://github.com/Effect-TS/effect/commit/69fd4b1fba9e2ec5e7c16058ff8d9a1f9a38d90e), [`7d97626`](https://github.com/Effect-TS/effect/commit/7d9762658e515807c2b98678e7abd3ebe94e41ec), [`0e79436`](https://github.com/Effect-TS/effect/commit/0e794366658bd067a2212ea2ac7ed0223904ed31), [`2f8a4e9`](https://github.com/Effect-TS/effect/commit/2f8a4e9b90822d9facfef59027b35819c42d7b48), [`800b753`](https://github.com/Effect-TS/effect/commit/800b7535b4e37a24ac458cae78231054dae0b0f5)]: + - effect@4.1.6 + - @effect/platform-node@4.1.6 + ## 4.1.5 ### Patch Changes diff --git a/.repos/effect/packages/tools/graphql-generator/package.json b/.repos/effect/packages/tools/graphql-generator/package.json index 2f442594eaa8b..7a375537baedb 100644 --- a/.repos/effect/packages/tools/graphql-generator/package.json +++ b/.repos/effect/packages/tools/graphql-generator/package.json @@ -1,7 +1,7 @@ { "name": "@effect/graphql-generator", "type": "module", - "version": "4.1.5", + "version": "4.1.6", "license": "MIT", "description": "Generate Effect GraphQL operations and Schema types from GraphQL documents", "homepage": "https://effect.website", diff --git a/.repos/effect/packages/tools/openapi-generator/CHANGELOG.md b/.repos/effect/packages/tools/openapi-generator/CHANGELOG.md index b4e925dfc96ae..252abdce1273e 100644 --- a/.repos/effect/packages/tools/openapi-generator/CHANGELOG.md +++ b/.repos/effect/packages/tools/openapi-generator/CHANGELOG.md @@ -1,5 +1,57 @@ # @effect/openapi-generator +## 4.1.6 + +### Patch Changes + +- [#10799](https://github.com/Effect-TS/effect/pull/10799) [`66ab992`](https://github.com/Effect-TS/effect/commit/66ab9920271ee7fec3be3f4e3b4438d9222578b1) Thanks @gcanti! - Generated client method comments now show the OpenAPI operation summary above the description, with identical text appearing only once. + +- [#10921](https://github.com/Effect-TS/effect/pull/10921) [`60ae98e`](https://github.com/Effect-TS/effect/commit/60ae98eed32ec80625bb9a54008f74f10ab8f329) Thanks @CheckPickerUpper! - Generated HttpApi groups now drop the group prefix from endpoint names (`balance.read` becomes `read`) while keeping the qualified OpenAPI operation id, reject operations whose names collide within a group, and only emit the parameter schemas grouped endpoints use. + +- [#10839](https://github.com/Effect-TS/effect/pull/10839) [`cf50541`](https://github.com/Effect-TS/effect/commit/cf50541d0deaa1f21df91e938b94eadbe10dd274) Thanks @Marve10s! - Fix generated `multipart/form-data` payloads rejecting `format: binary` files in open object schemas while preserving undeclared form fields. + +- [#10797](https://github.com/Effect-TS/effect/pull/10797) [`f90a026`](https://github.com/Effect-TS/effect/commit/f90a026c0b8acfc062c40b553025d226eba670a2) Thanks @gcanti! - A response with no body can still have a description in the API documentation. For example, an OpenAPI file can describe a `404` as "Order not found". The generator used to copy the status code into the `HttpApi` and drop that text. + + ```ts + // Before + HttpApiSchema.Empty(404) + + // After + HttpApiSchema.Empty(404).annotate({ description: "Order not found" }) + ``` + + Exporting the generated `HttpApi` back to OpenAPI now produces the original "Order not found" description. + + ### A shared `404` with its own description + + In this OpenAPI 3.1 example, `$ref` points to a shared response whose description is "Resource not found". The line below it gives this particular `404` a more specific description. + + ```yaml + responses: + "404": + $ref: "#/components/responses/NotFound" + description: Order not found + ``` + + The generator writes `HttpApiSchema.Empty(404).annotate({ description: "Order not found" })`. If you omit the `description` line, it uses "Resource not found" from the shared response. + + ### An explicit `500` and a fallback + + ```yaml + responses: + "200": + description: OK + "500": + description: Server error + default: + description: Other errors + ``` + + For this input, the generated endpoint has one error response, `HttpApiSchema.Empty(500).annotate({ description: "Server error" })`. The generator skips `default` and emits a warning because it would assign "Other errors" to the same status. If you remove the explicit `500` from this example, the generator uses `default` to produce a `500` described as "Other errors". +- Updated dependencies [[`dd5f2f3`](https://github.com/Effect-TS/effect/commit/dd5f2f322fbad042a3a186cef593bf42affe5ce9), [`1d65846`](https://github.com/Effect-TS/effect/commit/1d65846308a6a18c4a95af543988ad30b72ff2b3), [`694c28f`](https://github.com/Effect-TS/effect/commit/694c28f0cfc3eac33f71160d18dda95cb670f506), [`5aaa2cd`](https://github.com/Effect-TS/effect/commit/5aaa2cd216e5e55f92d06db98d4b54946a396eed), [`55814bf`](https://github.com/Effect-TS/effect/commit/55814bf0a780f05ed0a51c82c8affda5d539bb0e), [`92c40a1`](https://github.com/Effect-TS/effect/commit/92c40a1f96a59f9edcacee6c0d6f6fb80397ee17), [`9f415a7`](https://github.com/Effect-TS/effect/commit/9f415a7733cdf8aed7efadbed3b5db22890e164a), [`e367afd`](https://github.com/Effect-TS/effect/commit/e367afdacfa3041a694a67e4670e98a20e41d45c), [`d5d2112`](https://github.com/Effect-TS/effect/commit/d5d21120ff591fcf8da006ce340010812cc91f16), [`fa2e5af`](https://github.com/Effect-TS/effect/commit/fa2e5af4ccc8f3650d97049707be82eab098c168), [`6bf6427`](https://github.com/Effect-TS/effect/commit/6bf6427d195539c387c13156aff79db077929c8f), [`10bc4a4`](https://github.com/Effect-TS/effect/commit/10bc4a47c0ce5bc50ba1998d63a803e3887d1d2b), [`a9540d3`](https://github.com/Effect-TS/effect/commit/a9540d3d50fbe65ade7f9b2f478cdd34a888161e), [`3a250d7`](https://github.com/Effect-TS/effect/commit/3a250d7eb8c310bf4751b3eca0038cf50e1629d8), [`ce44141`](https://github.com/Effect-TS/effect/commit/ce44141ad1bc8d05f3f7399bfa1e87772573205d), [`9318e5b`](https://github.com/Effect-TS/effect/commit/9318e5bafb144ddff65a0bff0148ec4f7ba77b5c), [`c9ecebf`](https://github.com/Effect-TS/effect/commit/c9ecebf7ede8a98895552fd20223d6573bd846fe), [`32f8fbe`](https://github.com/Effect-TS/effect/commit/32f8fbe1a5985aea41754e87531e9a1d0fbf78ec), [`41d6af1`](https://github.com/Effect-TS/effect/commit/41d6af14b7f36e06ade3bf7333b710e73de1e1c2), [`c33fd59`](https://github.com/Effect-TS/effect/commit/c33fd599cb7d49117f77f7bd8f05cb4209112a34), [`1f9e9d3`](https://github.com/Effect-TS/effect/commit/1f9e9d3de552435de6b8f4e1166515d0964c3999), [`594fa71`](https://github.com/Effect-TS/effect/commit/594fa71da417bf94fa6c9be2d3d36c808197e9fe), [`b378c38`](https://github.com/Effect-TS/effect/commit/b378c383cdb29e819e24da5dc725479a2ba4fdf1), [`a9ec9a6`](https://github.com/Effect-TS/effect/commit/a9ec9a60bbe1309960e00527ab62342dce1a86fc), [`310a81b`](https://github.com/Effect-TS/effect/commit/310a81b391e24d42b6608b5e3d641eca63e0d4c0), [`2576bbc`](https://github.com/Effect-TS/effect/commit/2576bbcbe89fec2362240280e4db2bc371f978e3), [`aab2135`](https://github.com/Effect-TS/effect/commit/aab2135d3fe43d4d86c4e486ed378797314fb212), [`6744a72`](https://github.com/Effect-TS/effect/commit/6744a724869539fc2d733929df871ef523bf82e8), [`848d042`](https://github.com/Effect-TS/effect/commit/848d0426f287b3e7ff970219d980a4c66fa441ad), [`077a93e`](https://github.com/Effect-TS/effect/commit/077a93e5db3adbc42e531539cb12b8bdbdfe5328), [`aef50fb`](https://github.com/Effect-TS/effect/commit/aef50fb8b56ec9ff8116f157635579fefd995f26), [`2e4de86`](https://github.com/Effect-TS/effect/commit/2e4de8634431f3da08ca2a90ab1024ee08e216f3), [`482b104`](https://github.com/Effect-TS/effect/commit/482b104caf712a8d5f99aafc64e55b6ea38eb809), [`753e1ed`](https://github.com/Effect-TS/effect/commit/753e1ed88069f73103d136dcdc58188fd10efdf1), [`0d2bb4a`](https://github.com/Effect-TS/effect/commit/0d2bb4a4b6526e1767b81101ee6e8da88ba1de55), [`8161e03`](https://github.com/Effect-TS/effect/commit/8161e03c26d691502afeddcf7e2ee75e6931637f), [`bb02f33`](https://github.com/Effect-TS/effect/commit/bb02f33a66309e62999d16fb87a3278157dd2e79), [`49f5391`](https://github.com/Effect-TS/effect/commit/49f53918a150aa2ea0ce2d444400cec1d6097400), [`3d59bdf`](https://github.com/Effect-TS/effect/commit/3d59bdf6f8f95ceea2091e5b8f375b834a14b3b1), [`8866608`](https://github.com/Effect-TS/effect/commit/88666082f2b6296bb7115bd4a2546151039f64db), [`69fd4b1`](https://github.com/Effect-TS/effect/commit/69fd4b1fba9e2ec5e7c16058ff8d9a1f9a38d90e), [`7d97626`](https://github.com/Effect-TS/effect/commit/7d9762658e515807c2b98678e7abd3ebe94e41ec), [`0e79436`](https://github.com/Effect-TS/effect/commit/0e794366658bd067a2212ea2ac7ed0223904ed31), [`2f8a4e9`](https://github.com/Effect-TS/effect/commit/2f8a4e9b90822d9facfef59027b35819c42d7b48), [`800b753`](https://github.com/Effect-TS/effect/commit/800b7535b4e37a24ac458cae78231054dae0b0f5)]: + - effect@4.1.6 + - @effect/platform-node@4.1.6 + ## 4.1.5 ### Patch Changes diff --git a/.repos/effect/packages/tools/openapi-generator/package.json b/.repos/effect/packages/tools/openapi-generator/package.json index 03ae3cb1380eb..fb4e7b80ccce6 100644 --- a/.repos/effect/packages/tools/openapi-generator/package.json +++ b/.repos/effect/packages/tools/openapi-generator/package.json @@ -1,7 +1,7 @@ { "name": "@effect/openapi-generator", "type": "module", - "version": "4.1.5", + "version": "4.1.6", "license": "MIT", "description": "Generate Effect Schema types, HTTP clients, and HttpApi modules from OpenAPI specifications", "homepage": "https://effect.website", @@ -73,6 +73,6 @@ "effect": "workspace:^", "json-schema-typed": "^9.0.0", "openapi-typescript": "^7.13.0", - "rolldown": "^1.3.2" + "rolldown": "^1.3.3" } } diff --git a/.repos/effect/packages/tools/openapi-generator/src/HttpApiTransformer.ts b/.repos/effect/packages/tools/openapi-generator/src/HttpApiTransformer.ts index 514944ca7713f..ebdfb4b25a490 100644 --- a/.repos/effect/packages/tools/openapi-generator/src/HttpApiTransformer.ts +++ b/.repos/effect/packages/tools/openapi-generator/src/HttpApiTransformer.ts @@ -10,6 +10,8 @@ * @since 4.0.0 */ import * as Codegen from "effect/Codegen" +import * as Data from "effect/Data" +import * as Result from "effect/Result" import { namedImport, namespaceImport, printImports } from "./internal/module.ts" import type { ParsedOpenApi, @@ -33,10 +35,46 @@ interface GroupRenderModel { readonly identifier: string readonly topLevel: boolean readonly metadata: ParsedOpenApiTag | undefined - readonly operations: ReadonlyArray + readonly endpoints: ReadonlyMap readonly constName: string } +/** + * Two OpenAPI operations resolve to the same local endpoint name within one HttpApi group. + * + * @category errors + * @since 4.0.0 + */ +export class HttpApiEndpointNameCollision extends Data.TaggedError("HttpApiEndpointNameCollision")<{ + readonly group: string + readonly endpoint: string + readonly first: Route + readonly repeated: Route +}> { + override get message(): string { + const format = (route: Route) => `${route.method.toUpperCase()} ${route.path}` + return `${format(this.first)} and ${format(this.repeated)} both resolve to endpoint ` + + `${JSON.stringify(this.endpoint)} in HttpApi group ${JSON.stringify(this.group)}.` + } +} + +type Route = Pick + +const toRoute = ({ method, path, operationId }: ParsedOperation): Route => ({ method, path, operationId }) + +const resolveEndpointName = ( + group: { readonly identifier: string; readonly topLevel: boolean }, + operation: ParsedOperation +): string => { + if (!group.topLevel && operation.operationId !== undefined) { + const prefix = `${group.identifier}.` + if (operation.operationId.startsWith(prefix) && operation.operationId.length > prefix.length) { + return operation.operationId.slice(prefix.length) + } + } + return operation.id +} + interface SecurityRenderModel { readonly securityDeclarations: ReadonlyArray readonly middlewareDeclarations: ReadonlyArray @@ -89,7 +127,8 @@ export const toImplementation = ( parsed: ParsedOpenApi ): string => { const module = new Codegen.Module() - return module.finalize([planImplementation(name, parsed, makeNameAllocator())(parsed)]).roots[0] + const render = Result.getOrThrow(planImplementation(name, parsed, makeNameAllocator())) + return module.finalize([render(parsed)]).roots[0] } /** @internal */ @@ -98,7 +137,7 @@ export const registerModule = ( importName: string, name: string, parsed: ParsedOpenApi -): (parsed: ParsedOpenApi) => Codegen.Fragment => { +): Result.Result<(parsed: ParsedOpenApi) => Codegen.Fragment, HttpApiEndpointNameCollision> => { for (const input of moduleImports(importName, false)) module.addImport(input) const api = module.declare(name) return planImplementation(api.name, parsed, (name) => module.declare(name).name) @@ -108,10 +147,11 @@ const planImplementation = ( name: string, parsed: ParsedOpenApi, allocateName: (name: string) => string -): (parsed: ParsedOpenApi) => Codegen.Fragment => { +): Result.Result<(parsed: ParsedOpenApi) => Codegen.Fragment, HttpApiEndpointNameCollision> => { const security = buildSecurityRenderModel(parsed, allocateName) - const groups = groupOperations(parsed, allocateName) - const positions = new Map(parsed.operations.map((operation, index) => [operation, index])) + const grouped = groupOperations(parsed, allocateName) + if (Result.isFailure(grouped)) return Result.fail(grouped.failure) + const groups = grouped.success const metadataAnnotations = renderApiAnnotations(parsed) let apiValue = Codegen.code`export class ${name} extends ${HttpApi}.make(${JSON.stringify(name)})` @@ -123,33 +163,30 @@ const planImplementation = ( } apiValue = Codegen.code`${apiValue} {}` - return (resolved) => + return Result.succeed((resolved) => Codegen.join([ ...security.securityDeclarations, ...security.middlewareDeclarations, - ...groups.map((group) => - renderGroup({ - ...group, - operations: group.operations.map((operation) => resolved.operations[positions.get(operation)!]) - }, security.endpointMiddlewares) - ), + ...groups.map((group) => renderGroup(group, resolved.operations, security.endpointMiddlewares)), apiValue ], "\n\n") + ) } const groupOperations = ( parsed: ParsedOpenApi, allocateName: (name: string) => string -): ReadonlyArray => { +): Result.Result, HttpApiEndpointNameCollision> => { const tagMetadata = new Map(parsed.tags.map((tag) => [tag.name, tag])) const byIdentifier = new Map + readonly positions: Array }>() - for (const operation of parsed.operations) { + for (let position = 0; position < parsed.operations.length; position++) { + const operation = parsed.operations[position] const identifier = operation.tags[0] ?? fallbackGroupIdentifier const topLevel = operation.tags.length === 0 const existing = byIdentifier.get(identifier) @@ -157,44 +194,65 @@ const groupOperations = ( if (topLevel) { existing.topLevel = true } - existing.operations.push(operation) + existing.positions.push(position) continue } byIdentifier.set(identifier, { identifier, topLevel, metadata: tagMetadata.get(identifier), - operations: [operation] + positions: [position] }) } const groups: Array = [] for (const group of byIdentifier.values()) { + const endpoints = new Map() + for (const position of group.positions) { + const operation = parsed.operations[position] + const endpoint = resolveEndpointName(group, operation) + const previous = endpoints.get(endpoint) + if (previous !== undefined) { + return Result.fail( + new HttpApiEndpointNameCollision({ + group: group.identifier, + endpoint, + first: toRoute(parsed.operations[previous]), + repeated: toRoute(operation) + }) + ) + } + endpoints.set(endpoint, position) + } const baseName = ensureIdentifier(group.identifier, "Group") groups.push({ - ...group, + identifier: group.identifier, + topLevel: group.topLevel, + metadata: group.metadata, + endpoints, constName: allocateName(`${baseName}Group`) }) } - return groups + return Result.succeed(groups) } const renderGroup = ( group: GroupRenderModel, + operations: ReadonlyArray, endpointMiddlewares: ReadonlyMap> ): Codegen.Fragment => { let source = Codegen.code`class ${group.constName} extends ${HttpApiGroup}.make(${JSON.stringify(group.identifier)}${ group.topLevel ? ", { topLevel: true }" : "" })` - const allocateEndpointName = makeNameAllocator() - const endpointSources = group.operations.map((operation) => - renderEndpoint( + const endpointSources = Array.from(group.endpoints, ([endpoint, position]) => { + const operation = operations[position] + return renderEndpoint( operation, - allocateEndpointName(operation.id), + endpoint, endpointMiddlewares.get(toOperationKey(operation)) ?? [] ) - ) + }) if (endpointSources.length > 0) { source = Codegen.code`${source}\n .add(${Codegen.join(endpointSources, ", \n ")})` } @@ -319,7 +377,10 @@ const renderResponseSet = ( } if (response.isEmpty) { - rendered.push(Codegen.code`${HttpApiSchema}.Empty(${status})`) + const annotation = response.description === undefined + ? "" + : `.annotate({ description: ${JSON.stringify(response.description)} })` + rendered.push(Codegen.code`${HttpApiSchema}.Empty(${status})${annotation}`) continue } diff --git a/.repos/effect/packages/tools/openapi-generator/src/JsonSchemaGenerator.ts b/.repos/effect/packages/tools/openapi-generator/src/JsonSchemaGenerator.ts index d3b3bd7464e1d..352069c3e0705 100644 --- a/.repos/effect/packages/tools/openapi-generator/src/JsonSchemaGenerator.ts +++ b/.repos/effect/packages/tools/openapi-generator/src/JsonSchemaGenerator.ts @@ -208,15 +208,12 @@ function prepareSchemas( rootSchemas, (schema, index) => options?.binarySchemas?.has(names[index]) ? Schema.Uint8Array.ast : schema.ast )) + const multipart = multipartRepresentation(representation.references, options?.multipartSchemaRefs) return { - schemas: Object.fromEntries(names.map((name, index) => [ - name, - multipartRepresentation(name, representation.representations[index], options?.multipartSchemaRefs) - ])), - references: Rec.map( - representation.references, - (schema, name) => multipartRepresentation(name, schema, options?.multipartSchemaRefs) - ) + schemas: Object.fromEntries( + names.map((name, index) => [name, multipart(representation.representations[index], name)]) + ), + references: Rec.map(representation.references, multipart) } } @@ -229,34 +226,86 @@ function fromSchemaOpenApi(source: Source, jsonSchema: JsonSchema.JsonSchema) { } } +// Renders the multipart file schemas as their runtime types. Effect index signatures also check declared +// properties, so every open object is widened to admit its own files. function multipartRepresentation( - name: string | undefined, - schema: SchemaRepresentation.Representation, + references: SchemaRepresentation.References, refs: MultipartSchemaRefs | undefined -): SchemaRepresentation.Representation { - if (name === undefined) return schema - const code = multipartCode(name, refs) - if (code === undefined) return schema - return { - _tag: "Declaration", - typeParameters: [], - checks: [], - annotations: { - toCode: () => ({ - ...code, - importDeclarations: refs?.kind === "httpapi" ? ["import { Multipart } from \"effect/http\""] : [] - }) +): (schema: SchemaRepresentation.Representation, name: string) => SchemaRepresentation.Representation { + if (refs === undefined) return (schema) => schema + const hasFile = (schema: SchemaRepresentation.Representation, seen: Set): boolean => { + switch (schema._tag) { + case "Reference": { + if (multipartCode(schema.$ref, refs) !== undefined) return true + if (seen.has(schema.$ref) || !Object.hasOwn(references, schema.$ref)) return false + seen.add(schema.$ref) + return hasFile(references[schema.$ref], seen) + } + case "Suspend": + return hasFile(schema.thunk, seen) + case "Union": + return schema.types.some((member) => hasFile(member, seen)) + case "Arrays": + return schema.rest.some((member) => hasFile(member, seen)) || + schema.elements.some((element) => hasFile(element.type, seen)) + default: + return false + } + } + const admitFiles = (schema: SchemaRepresentation.Representation): SchemaRepresentation.Representation => { + switch (schema._tag) { + case "Suspend": + return { ...schema, thunk: admitFiles(schema.thunk) } + case "Union": + return { ...schema, types: schema.types.map(admitFiles) } + case "Arrays": + return { + ...schema, + elements: schema.elements.map((element) => ({ ...element, type: admitFiles(element.type) })), + rest: schema.rest.map(admitFiles) + } + case "Objects": { + const propertySignatures = schema.propertySignatures.map((property) => ({ + ...property, + type: admitFiles(property.type) + })) + const files = Arr.dedupe( + propertySignatures.map((property) => property.type).filter((type) => hasFile(type, new Set())) + ) + return { + ...schema, + propertySignatures, + indexSignatures: schema.indexSignatures.map((index) => { + const type = admitFiles(index.type) + return { + ...index, + type: files.length === 0 ? type : { _tag: "Union", types: [type, ...files], checks: [] } + } + }) + } + } + default: + return schema + } + } + return (schema, name) => { + const code = multipartCode(name, refs) + if (code === undefined) return admitFiles(schema) + return { + _tag: "Declaration", + typeParameters: [], + checks: [], + annotations: { + toCode: () => ({ + ...code, + importDeclarations: refs.kind === "httpapi" ? ["import { Multipart } from \"effect/http\""] : [] + }) + } } } } -function multipartCode( - $ref: string, - refs: MultipartSchemaRefs | undefined -): SchemaRepresentation.Code | undefined { - if (refs === undefined) { - return undefined - } +function multipartCode($ref: string, refs: MultipartSchemaRefs): SchemaRepresentation.Code | undefined { if ($ref === refs.singleFile) { return refs.kind === "httpapi" ? { Type: "Multipart.PersistedFile", runtime: "Multipart.SingleFileSchema" } diff --git a/.repos/effect/packages/tools/openapi-generator/src/OpenApiGenerator.ts b/.repos/effect/packages/tools/openapi-generator/src/OpenApiGenerator.ts index 66b676500b5ed..882fb6a6501b2 100644 --- a/.repos/effect/packages/tools/openapi-generator/src/OpenApiGenerator.ts +++ b/.repos/effect/packages/tools/openapi-generator/src/OpenApiGenerator.ts @@ -42,7 +42,12 @@ import * as Utils from "./Utils.ts" */ export class OpenApiGenerator extends Context.Service< OpenApiGenerator, - { readonly generate: (spec: OpenAPISpec, options: OpenApiGenerateOptions) => Effect.Effect } + { + readonly generate: ( + spec: OpenAPISpec, + options: OpenApiGenerateOptions + ) => Effect.Effect + } >()("OpenApiGenerator") {} /** @@ -253,7 +258,7 @@ export const make = Effect.gen(function*() { ] ) const registration = options.format === "httpapi" - ? HttpApiTransformer.registerModule(module, importName, options.name, parsed) + ? yield* Effect.fromResult(HttpApiTransformer.registerModule(module, importName, options.name, parsed)) : HttpClientGenerator.registerModule( module, importName, @@ -300,6 +305,7 @@ const parseOpenApi = ( const reservedSchemaNames = new Set(Object.keys(spec.components?.schemas ?? {})) const isHttpApi = format === "httpapi" const dialect = getDialect(spec) + const preserveResponseDescription = isHttpApi && dialect === "openapi-3.1" const securitySchemes = isHttpApi ? parseSecuritySchemes(spec, resolveRef) : [] const addSchema = ( @@ -335,7 +341,8 @@ const parseOpenApi = ( ? Utils.camelize(operation.operationId) : `${method.toUpperCase()}${path}` - const description = Utils.nonEmptyString(operation.description) ?? Utils.nonEmptyString(operation.summary) + const summary = Utils.nonEmptyString(operation.summary) + const description = Utils.nonEmptyString(operation.description) const parameters = resolveOperationParameters( Array.isArray(pathItem.parameters) ? pathItem.parameters : undefined, @@ -347,7 +354,9 @@ const parseOpenApi = ( const op = ParsedOperation.makeDeepMutable({ id, method, - description, + description: summary && description && summary !== description + ? `${summary}\n\n${description}` + : summary ?? description, pathIds, pathTemplate }) @@ -364,8 +373,8 @@ const parseOpenApi = ( }) } op.metadata = { - summary: Utils.nonEmptyString(operation.summary), - description: Utils.nonEmptyString(operation.description), + summary, + description, deprecated: operation.deprecated === true, externalDocs: operation.externalDocs } @@ -429,17 +438,20 @@ const parseOpenApi = ( continue } - const resolvedResponses = Object.entries(operation.responses ?? {}) - .filter(([status]) => isResponseStatus(status)) - .map(([status, response]) => [status, resolveReference(response, resolveRef)] as const) - const hasExplicitSuccessResponse = resolvedResponses.some(([status]) => { - if (!/^\d{3}$/.test(status)) { - return false - } - return Number(status) < 400 - }) + const responses = Object.entries(operation.responses ?? {}).filter(([status]) => isResponseStatus(status)) + const defaultStatus = responses.some(([status]) => Number(status) < 400) ? "500" : "200" + const resolvedResponses = responses.map(([status, response]) => ({ + status, + parsedStatus: isHttpApi && status === "default" ? defaultStatus : status, + response: resolveReference(response, resolveRef, preserveResponseDescription) + })) - if (isHttpApi && hasUnsupportedSuccessfulSseResponse(resolvedResponses, hasExplicitSuccessResponse)) { + if ( + isHttpApi && + resolvedResponses.some(({ parsedStatus, response }) => + Number(parsedStatus) < 400 && hasUnsupportedSseResponse(response) + ) + ) { warnForOperation(emitWarning, op, { code: "sse-operation-skipped", message: @@ -448,25 +460,6 @@ const parseOpenApi = ( continue } - const validParameters = parameters.filter((parameter) => - parameter.in !== "path" && !droppedCookies.has(parameter) - ) - - const combinedParameterSchema = buildParameterSchema(validParameters, (parameter, added) => { - if (parameter.in === "query") { - Utils.spreadElementsInto(added, op.urlParams) - } else if (parameter.in === "header") { - Utils.spreadElementsInto(added, op.headers) - } else if (parameter.in === "cookie") { - Utils.spreadElementsInto(added, op.cookies) - } - }) - - if (combinedParameterSchema !== undefined) { - op.params = addSchema(`${schemaId}Params`, combinedParameterSchema.schema, op) - op.paramsOptional = combinedParameterSchema.optional - } - if (isHttpApi) { const pathParameterSchema = buildParameterSchema(op.parameters.path) if (pathParameterSchema !== undefined) { @@ -484,8 +477,29 @@ const parseOpenApi = ( op.headersSchema = addSchema(`${schemaId}Headers`, headerParameterSchema.schema, op) op.headersSchemaOptional = headerParameterSchema.optional } - } else if (pathSchema !== undefined) { - op.pathSchema = addSchema(`${schemaId}PathParams`, pathSchema, op) + } else { + const validParameters = parameters.filter((parameter) => + parameter.in !== "path" && !droppedCookies.has(parameter) + ) + + const combinedParameterSchema = buildParameterSchema(validParameters, (parameter, added) => { + if (parameter.in === "query") { + Utils.spreadElementsInto(added, op.urlParams) + } else if (parameter.in === "header") { + Utils.spreadElementsInto(added, op.headers) + } else if (parameter.in === "cookie") { + Utils.spreadElementsInto(added, op.cookies) + } + }) + + if (combinedParameterSchema !== undefined) { + op.params = addSchema(`${schemaId}Params`, combinedParameterSchema.schema, op) + op.paramsOptional = combinedParameterSchema.optional + } + + if (pathSchema !== undefined) { + op.pathSchema = addSchema(`${schemaId}PathParams`, pathSchema, op) + } } if (Predicate.isNotUndefined(requestBody) && Predicate.isObject(requestBody)) { @@ -604,19 +618,20 @@ const parseOpenApi = ( } let defaultSchema: string | undefined - for (const [status, response] of resolvedResponses) { + for (const { parsedStatus, response, status } of resolvedResponses) { if (!Predicate.isObject(response)) { continue } - const parsedStatus = isHttpApi - ? remapDefaultResponseStatusForHttpApi(status, hasExplicitSuccessResponse) - : status - if (isHttpApi && status === "default") { + if (status !== parsedStatus) { + const hasExplicitResponse = Object.hasOwn(operation.responses, parsedStatus) warnForOperation(emitWarning, op, { code: "default-response-remapped", - message: `Default response was remapped to status ${parsedStatus} for HttpApi generation.` + message: hasExplicitResponse + ? `Default response was skipped because its remapped status ${parsedStatus} is explicitly defined.` + : `Default response was remapped to status ${parsedStatus} for HttpApi generation.` }) + if (hasExplicitResponse) continue } const content = Predicate.isObject(response.content) @@ -751,7 +766,7 @@ const parseOpenApi = ( const isEmptyResponse = Predicate.isUndefined(content) || Object.keys(content).length === 0 const parsedResponse = { status: parsedStatus, - description: Utils.nonEmptyString(response.description), + description: typeof response.description === "string" ? response.description : undefined, contentTypes: Predicate.isNotUndefined(content) ? Object.keys(content) : [], hasHeaders: Predicate.isNotUndefined(response.headers), isEmpty: isEmptyResponse, @@ -1432,12 +1447,20 @@ const isPrimitiveSchema = ( return members.length > 0 } -const resolveReference = (input: unknown, resolveRef: (ref: string) => unknown): any => { +const resolveReference = ( + input: unknown, + resolveRef: (ref: string) => unknown, + preserveDescription = false +): any => { let current = input + let description: string | undefined while (Predicate.isObject(current) && typeof current.$ref === "string") { + if (preserveDescription && typeof current.description === "string") { + description ??= current.description + } current = resolveRef(current.$ref) } - return current + return description !== undefined && Predicate.isObject(current) ? { ...current, description } : current } const cloneSecurityRequirements = ( @@ -1539,49 +1562,18 @@ const warnForAndSecurityRequirements = ( } } -const hasUnsupportedSuccessfulSseResponse = ( - responses: ReadonlyArray, - hasExplicitSuccessResponse: boolean -): boolean => { - for (const [status, response] of responses) { - if (!Predicate.isObject(response)) { - continue - } - const remappedStatus = remapDefaultResponseStatusForHttpApi(status, hasExplicitSuccessResponse) - const statusCode = Number(remappedStatus) - if (Number.isNaN(statusCode) || statusCode >= 400) { - continue - } - - const content = Predicate.isObject(response.content) - ? response.content as Record - : undefined - if (Predicate.isUndefined(content)) { - continue - } - - for (const [contentType, mediaType] of Object.entries(content)) { - if (!Predicate.isObject(mediaType)) { - continue - } - const streamEncoding = getEffectStreamEncoding(mediaType) - if (streamEncoding === "sse") { - if (Predicate.isUndefined(mediaType.schema) || Predicate.isUndefined(getEffectStreamErrorSchema(mediaType))) { - return true - } - continue - } - if (contentType === "text/event-stream" && streamEncoding !== "ndjson") { - return true - } +const hasUnsupportedSseResponse = (response: unknown): boolean => { + if (!Predicate.isObject(response) || !Predicate.isObject(response.content)) return false + return Object.entries(response.content).some(([contentType, mediaType]) => { + if (!Predicate.isObject(mediaType)) return false + const encoding = getEffectStreamEncoding(mediaType) + if (encoding === "sse") { + return mediaType.schema === undefined || getEffectStreamErrorSchema(mediaType) === undefined } - } - return false + return contentType === "text/event-stream" && encoding !== "ndjson" + }) } -const remapDefaultResponseStatusForHttpApi = (status: string, hasExplicitSuccessResponse: boolean): string => - status === "default" ? (hasExplicitSuccessResponse ? "500" : "200") : status - const methodSupportsRequestBody = (method: Lowercase): boolean => method !== "get" && method !== "head" && method !== "options" && method !== "trace" diff --git a/.repos/effect/packages/tools/openapi-generator/src/main.ts b/.repos/effect/packages/tools/openapi-generator/src/main.ts index b0fd7d498d047..da5b5e1d4d4ba 100644 --- a/.repos/effect/packages/tools/openapi-generator/src/main.ts +++ b/.repos/effect/packages/tools/openapi-generator/src/main.ts @@ -73,7 +73,9 @@ const root = Command.make("openapigen", { spec, format, name, patch }).pipe( onWarning: (warning) => { warnings.push(warning) } - }) + }).pipe( + Effect.mapError((error) => new CliError.UserError({ cause: error })) + ) yield* Effect.forEach( warnings, (warning) => Console.error(OpenApiGenerator.formatWarning(warning)), diff --git a/.repos/effect/packages/tools/openapi-generator/test/OpenApiGenerator.test.ts b/.repos/effect/packages/tools/openapi-generator/test/OpenApiGenerator.test.ts index f39b0a621d632..5807bc8358646 100644 --- a/.repos/effect/packages/tools/openapi-generator/test/OpenApiGenerator.test.ts +++ b/.repos/effect/packages/tools/openapi-generator/test/OpenApiGenerator.test.ts @@ -322,6 +322,14 @@ const generateHttpApi = Effect.fnUntraced(function*(spec: OpenAPISpec) { return { source, warnings } }, Effect.provide(OpenApiGenerator.layerTransformerSchema)) +const withReexportedHttpApi = (source: string, check: (spec: OpenAPISpec) => void) => + Effect.promise(() => + withGeneratedModule<{ TestClient: HttpApi.HttpApi }>( + source, + ({ TestClient }) => check(OpenApi.fromApi(TestClient)) + ) + ) + const findEndpoint = (source: string, method: string, path: string): string => { const line = source.split("\n").find((line) => line.includes(`HttpApiEndpoint.${method}(`) && line.includes(`", ${JSON.stringify(path)}`) @@ -1684,6 +1692,61 @@ export const TestClientError = ( describe("httpapi", () => { const Bytes = Schema.Uint8Array.pipe(HttpApiSchema.asUint8Array()) + + it.effect("uses group-local endpoint names, qualified OpenAPI ids, and grouped parameter schemas", () => + Effect.gen(function*() { + const spec = OpenApi.fromApi( + HttpApi.make("Api").add( + HttpApiGroup.make("balance").add( + HttpApiEndpoint.get("read", "/balance/:accountId", { + params: { accountId: Schema.String }, + query: { currency: Schema.String }, + headers: { "x-trace-id": Schema.String } + }) + ), + HttpApiGroup.make("orders").add(HttpApiEndpoint.get("read", "/orders")) + ) + ) + const { source } = yield* generateHttpApi(spec) + assert.notInclude(source, "BalanceReadParams") + + yield* Effect.promise(() => + withGeneratedModule<{ + TestClient: HttpApi.HttpApi & { + readonly groups: Record }> + } + }>(source, ({ TestClient }) => { + assert.deepStrictEqual(Object.keys(TestClient.groups.balance.endpoints), ["read"]) + assert.deepStrictEqual(Object.keys(TestClient.groups.orders.endpoints), ["read"]) + const reexported = OpenApi.fromApi(TestClient) + assert.strictEqual(reexported.paths["/balance/{accountId}"].get?.operationId, "balance.read") + assert.strictEqual(reexported.paths["/orders"].get?.operationId, "orders.read") + assert.deepStrictEqual( + reexported.paths["/balance/{accountId}"].get?.parameters, + spec.paths["/balance/{accountId}"].get?.parameters + ) + }) + ) + })) + + it.effect("rejects duplicate local endpoint names in the same group", () => + Effect.gen(function*() { + const spec = OpenApi.fromApi( + HttpApi.make("Api").add( + HttpApiGroup.make("balance").add( + HttpApiEndpoint.get("read", "/balance/latest"), + HttpApiEndpoint.get("history", "/balance/history").annotate(OpenApi.Identifier, "read") + ) + ) + ) + const result = yield* Effect.result(generateHttpApi(spec)) + if (result._tag === "Success") { + assert.fail("Expected duplicate local endpoint names in the same group to fail") + } + assert.include(result.failure.message, "GET /balance/latest") + assert.include(result.failure.message, "GET /balance/history") + assert.include(result.failure.message, "read") + })) const event = (name: string) => Schema.Struct({ ...Sse.EventEncoded.fields, event: Schema.Literal(name) }).annotate({ identifier: name }) @@ -1794,6 +1857,111 @@ const unrelated: Events200Sse = { event: "unrelated", data: "payload" } assertIncludes(openApi30SseSpec, ["\"event\": string"], ["\"event\": \"first\"", "\"event\": \"second\""])) } + it.effect("round-trips descriptions of responses without a body", () => + Effect.gen(function*() { + const spec = OpenApi.fromApi( + HttpApi.make("Orders").add( + HttpApiGroup.make("orders").add( + HttpApiEndpoint.delete("deleteOrder", "/order", { + success: HttpApiSchema.Empty(204).annotate({ description: "" }), + error: HttpApiSchema.Empty(404).annotate({ description: "Order not found\n" }) + }) + ) + ) + ) + const { source } = yield* generateHttpApi(spec) + yield* withReexportedHttpApi(source, (generated) => + assert.deepStrictEqual(generated.paths["/order"].delete?.responses, spec.paths["/order"].delete!.responses)) + })) + + it.effect("keeps the explicit response when default would map to the same status", () => + Effect.gen(function*() { + const explicit = { 200: { description: "OK" }, 500: { description: "Server error" } } + const responses = { ...explicit, default: { description: "Other statuses" } } + const { source, warnings } = yield* generateHttpApi({ + openapi: "3.1.0", + info: { title: "Orders", version: "1" }, + paths: { + "/order": { + get: { + operationId: "getOrder", + parameters: [], + tags: ["orders"], + security: [], + responses + } + } + }, + components: { schemas: {}, securitySchemes: {} }, + security: [], + tags: [] + }) + yield* withReexportedHttpApi(source, (generated) => + assert.deepStrictEqual(generated.paths["/order"].get?.responses, explicit)) + assert.deepStrictEqual(warnings, [{ + code: "default-response-remapped", + message: "Default response was skipped because its remapped status 500 is explicitly defined.", + path: "/order", + method: "get", + operationId: "getOrder" + }]) + })) + + it.effect.each([ + { version: "3.1.0", local: "Order not found", empty: "", inherited: "Shared order error" }, + { version: "3.0.3", local: "Missing resource", empty: "Missing resource", inherited: "Missing resource" } + ])( + "resolves response reference descriptions for OpenAPI $version", + ({ version, local, empty, inherited }) => + Effect.gen(function*() { + const shared = { $ref: "#/components/responses/Missing" } + const order = { $ref: "#/components/responses/OrderError" } + const { source } = yield* generateHttpApi({ + openapi: version, + info: { title: "Orders", version: "1" }, + paths: { + "/order": { + get: { + operationId: "getOrder", + parameters: [], + tags: ["orders"], + security: [], + description: "Look up an order", + responses: { + 204: { description: "OK" }, + 400: order, + 403: { ...order, description: "" }, + 404: { ...order, description: "Order not found" }, + 410: shared + } + } + } + }, + components: { + schemas: {}, + securitySchemes: {}, + responses: { + Missing: { description: "Missing resource" }, + OrderError: { ...shared, description: "Shared order error" } + } + }, + security: [], + tags: [] + } as unknown as OpenAPISpec) + yield* withReexportedHttpApi(source, (generated) => { + const operation = generated.paths["/order"].get! + assert.strictEqual(operation.description, "Look up an order") + assert.deepStrictEqual(operation.responses, { + 204: { description: "OK" }, + 400: { description: inherited }, + 403: { description: empty }, + 404: { description: local }, + 410: { description: "Missing resource" } + }) + }) + }) + ) + it.effect("generates tagged groups with endpoint annotations and representable parameters", () => assertHttpApiIncludes( { @@ -1881,7 +2049,7 @@ const unrelated: Events200Sse = { event: "unrelated", data: "payload" } `class UsersGroup extends HttpApiGroup.make("Users")`, `.annotate(OpenApi.Description, "User operations")`, `.annotate(OpenApi.ExternalDocs, {"url":"https://example.com/users"})`, - `HttpApiEndpoint.get("getUser", "/users/:id", { params: GetUserPathParams, query: GetUserQuery, headers: GetUserHeaders, success: GetUser200, error: HttpApiSchema.Empty(404) })`, + `HttpApiEndpoint.get("getUser", "/users/:id", { params: GetUserPathParams, query: GetUserQuery, headers: GetUserHeaders, success: GetUser200, error: HttpApiSchema.Empty(404).annotate({ description: "Not found" }) })`, `.annotate(OpenApi.Identifier, "getUser")`, `.annotate(OpenApi.Summary, "Get user")`, `.annotate(OpenApi.Description, "Read a user")`, @@ -1940,7 +2108,7 @@ const unrelated: Events200Sse = { event: "unrelated", data: "payload" } [ `export type GetApplicationPathParams = { readonly "application_id": string }`, `export const GetApplicationPathParams = Schema.Struct({ "application_id": Schema.String })`, - `HttpApiEndpoint.get("getApplication", "/applications/:application_id", { params: GetApplicationPathParams, success: HttpApiSchema.Empty(200) })` + `HttpApiEndpoint.get("getApplication", "/applications/:application_id", { params: GetApplicationPathParams, success: HttpApiSchema.Empty(200).annotate({ description: "Application" }) })` ], [ `export class GetApplicationPathParams extends Schema.Class("GetApplicationPathParams")({ "application_id": Schema.String }) {}` @@ -1979,7 +2147,7 @@ const unrelated: Events200Sse = { event: "unrelated", data: "payload" } }, [ `class DefaultGroup extends HttpApiGroup.make("default", { topLevel: true })`, - `HttpApiEndpoint.get("getHealth", "/health", { success: HttpApiSchema.Empty(204) })`, + `HttpApiEndpoint.get("getHealth", "/health", { success: HttpApiSchema.Empty(204).annotate({ description: "No content" }) })`, `.add(DefaultGroup)` ] )) @@ -2029,8 +2197,8 @@ const unrelated: Events200Sse = { event: "unrelated", data: "payload" } }, [ `class DefaultGroup extends HttpApiGroup.make("default", { topLevel: true })`, - `HttpApiEndpoint.get("getTagged", "/tagged", { success: HttpApiSchema.Empty(200) })`, - `HttpApiEndpoint.get("getUntagged", "/untagged", { success: HttpApiSchema.Empty(204) })`, + `HttpApiEndpoint.get("getTagged", "/tagged", { success: HttpApiSchema.Empty(200).annotate({ description: "Tagged" }) })`, + `HttpApiEndpoint.get("getUntagged", "/untagged", { success: HttpApiSchema.Empty(204).annotate({ description: "Untagged" }) })`, `.add(DefaultGroup)` ] )) @@ -2156,7 +2324,7 @@ export const __HttpApiMultipartFiles = Multipart.FilesSchema`, export const CreatePayloadRequestText = Schema.String`, `payload: [HttpApiSchema.NoContent, CreatePayloadRequestJson, CreatePayloadRequestFormData.pipe(HttpApiSchema.asMultipart()), CreatePayloadRequestFormUrlEncoded.pipe(HttpApiSchema.asFormUrlEncoded()), CreatePayloadRequestText.pipe(HttpApiSchema.asText()), CreatePayloadRequestBinary.pipe(HttpApiSchema.asUint8Array())]`, - `success: [CreatePayload200, CreatePayload200Text.pipe(HttpApiSchema.asText()), CreatePayload200Binary.pipe(HttpApiSchema.asUint8Array()), HttpApiSchema.Empty(201)]` + `success: [CreatePayload200, CreatePayload200Text.pipe(HttpApiSchema.asText()), CreatePayload200Binary.pipe(HttpApiSchema.asUint8Array()), HttpApiSchema.Empty(201).annotate({ description: "Created" })]` ], [ "Schema.Opaque", @@ -2730,7 +2898,7 @@ export const __HttpApiMultipartSingleFile = Multipart.SingleFileSchema`, export const __HttpApiMultipartFiles = Multipart.FilesSchema`, `export type UploadRequestFormData = { readonly "file": __HttpApiMultipartSingleFile, readonly "files": __HttpApiMultipartFiles }`, `export const UploadRequestFormData = Schema.Struct({ "file": __HttpApiMultipartSingleFile, "files": __HttpApiMultipartFiles })`, - `HttpApiEndpoint.post("upload", "/upload", { payload: UploadRequestFormData.pipe(HttpApiSchema.asMultipart()), success: HttpApiSchema.Empty(200) })` + `HttpApiEndpoint.post("upload", "/upload", { payload: UploadRequestFormData.pipe(HttpApiSchema.asMultipart()), success: HttpApiSchema.Empty(200).annotate({ description: "Uploaded" }) })` ], [ `Schema.String.annotate({ "format": "binary" })`, @@ -2933,7 +3101,7 @@ export const __HttpApiMultipartFiles = Multipart.FilesSchema`, `import { Multipart } from "effect/http"`, `export type UploadWithContentEncodingRequestFormData = { readonly "file": __HttpApiMultipartSingleFile, readonly "files": __HttpApiMultipartFiles }`, `export const UploadWithContentEncodingRequestFormData = Schema.Struct({ "file": __HttpApiMultipartSingleFile, "files": __HttpApiMultipartFiles })`, - `HttpApiEndpoint.post("uploadWithContentEncoding", "/upload-content-encoding", { payload: UploadWithContentEncodingRequestFormData.pipe(HttpApiSchema.asMultipart()), success: HttpApiSchema.Empty(200) })` + `HttpApiEndpoint.post("uploadWithContentEncoding", "/upload-content-encoding", { payload: UploadWithContentEncodingRequestFormData.pipe(HttpApiSchema.asMultipart()), success: HttpApiSchema.Empty(200).annotate({ description: "Uploaded" }) })` ], [ `contentEncoding`, @@ -3174,11 +3342,11 @@ export const __HttpApiMultipartFiles = Multipart.FilesSchema`, `const BasicAuthSecurity = HttpApiSecurity.basic`, `class ApiKeyAuthOrBearerAuthSecurityMiddleware extends HttpApiMiddleware.Service()("apiKeyAuth | bearerAuth security", { security: { "apiKeyAuth": ApiKeyAuthSecurity, "bearerAuth": BearerAuthSecurity } }) {}`, `class ApiKeyAuthAndBasicAuthSecurityMiddleware extends HttpApiMiddleware.Service()("apiKeyAuth & basicAuth security") {}`, - `HttpApiEndpoint.get("getSecure", "/secure", { success: HttpApiSchema.Empty(200) })\n .middleware(ApiKeyAuthOrBearerAuthSecurityMiddleware)\n .middleware(ApiKeyAuthAndBasicAuthSecurityMiddleware)`, - `HttpApiEndpoint.get("getPublic", "/public", { success: HttpApiSchema.Empty(200) })` + `HttpApiEndpoint.get("getSecure", "/secure", { success: HttpApiSchema.Empty(200).annotate({ description: "Secure" }) })\n .middleware(ApiKeyAuthOrBearerAuthSecurityMiddleware)\n .middleware(ApiKeyAuthAndBasicAuthSecurityMiddleware)`, + `HttpApiEndpoint.get("getPublic", "/public", { success: HttpApiSchema.Empty(200).annotate({ description: "Public" }) })` ], excludes: [ - `HttpApiEndpoint.get("getPublic", "/public", { success: HttpApiSchema.Empty(200) })\n .middleware(` + `HttpApiEndpoint.get("getPublic", "/public", { success: HttpApiSchema.Empty(200).annotate({ description: "Public" }) })\n .middleware(` ], warnings: [ { @@ -3331,15 +3499,15 @@ export const __HttpApiMultipartFiles = Multipart.FilesSchema`, includes: [ `class ApiKeyAuthSecurityMiddleware extends HttpApiMiddleware.Service()("apiKeyAuth security", { security: { "apiKeyAuth": ApiKeyAuthSecurity } }) {}`, `class BearerAuthSecurityMiddleware extends HttpApiMiddleware.Service()("bearerAuth security", { security: { "bearerAuth": BearerAuthSecurity } }) {}`, - `HttpApiEndpoint.get("getInherited", "/inherited", { success: HttpApiSchema.Empty(200) })\n .middleware(ApiKeyAuthSecurityMiddleware)`, - `HttpApiEndpoint.get("getInheritedTwo", "/inherited-two", { success: HttpApiSchema.Empty(200) })\n .middleware(ApiKeyAuthSecurityMiddleware)`, - `HttpApiEndpoint.get("getCleared", "/cleared", { success: HttpApiSchema.Empty(200) })`, - `HttpApiEndpoint.get("getAnonymous", "/anonymous", { success: HttpApiSchema.Empty(200) })`, - `HttpApiEndpoint.get("getOverride", "/override", { success: HttpApiSchema.Empty(200) })\n .middleware(BearerAuthSecurityMiddleware)` + `HttpApiEndpoint.get("getInherited", "/inherited", { success: HttpApiSchema.Empty(200).annotate({ description: "Inherited" }) })\n .middleware(ApiKeyAuthSecurityMiddleware)`, + `HttpApiEndpoint.get("getInheritedTwo", "/inherited-two", { success: HttpApiSchema.Empty(200).annotate({ description: "Inherited two" }) })\n .middleware(ApiKeyAuthSecurityMiddleware)`, + `HttpApiEndpoint.get("getCleared", "/cleared", { success: HttpApiSchema.Empty(200).annotate({ description: "Cleared" }) })`, + `HttpApiEndpoint.get("getAnonymous", "/anonymous", { success: HttpApiSchema.Empty(200).annotate({ description: "Anonymous" }) })`, + `HttpApiEndpoint.get("getOverride", "/override", { success: HttpApiSchema.Empty(200).annotate({ description: "Override" }) })\n .middleware(BearerAuthSecurityMiddleware)` ], excludes: [ - `HttpApiEndpoint.get("getCleared", "/cleared", { success: HttpApiSchema.Empty(200) })\n .middleware(`, - `HttpApiEndpoint.get("getAnonymous", "/anonymous", { success: HttpApiSchema.Empty(200) })\n .middleware(` + `HttpApiEndpoint.get("getCleared", "/cleared", { success: HttpApiSchema.Empty(200).annotate({ description: "Cleared" }) })\n .middleware(`, + `HttpApiEndpoint.get("getAnonymous", "/anonymous", { success: HttpApiSchema.Empty(200).annotate({ description: "Anonymous" }) })\n .middleware(` ], occurrences: [ { @@ -3501,10 +3669,10 @@ export const __HttpApiMultipartFiles = Multipart.FilesSchema`, }, { includes: [ - `HttpApiEndpoint.get("getCookie", "/cookies", { success: HttpApiSchema.Empty(200) })`, - `HttpApiEndpoint.get("getHeaders", "/headers", { success: HttpApiSchema.Empty(200) })`, - `HttpApiEndpoint.get("getDefaultSuccess", "/default-success", { success: HttpApiSchema.Empty(200), error: HttpApiSchema.Empty(500) })`, - `HttpApiEndpoint.get("getDefaultOnly", "/default-only", { success: HttpApiSchema.Empty(200) })` + `HttpApiEndpoint.get("getCookie", "/cookies", { success: HttpApiSchema.Empty(200).annotate({ description: "Cookie" }) })`, + `HttpApiEndpoint.get("getHeaders", "/headers", { success: HttpApiSchema.Empty(200).annotate({ description: "Headers" }) })`, + `HttpApiEndpoint.get("getDefaultSuccess", "/default-success", { success: HttpApiSchema.Empty(200).annotate({ description: "OK" }), error: HttpApiSchema.Empty(500).annotate({ description: "Fallback" }) })`, + `HttpApiEndpoint.get("getDefaultOnly", "/default-only", { success: HttpApiSchema.Empty(200).annotate({ description: "Fallback" }) })` ], excludes: [ `HttpApiEndpoint.get("streamEvents", "/sse"`, @@ -3644,7 +3812,7 @@ export const __HttpApiMultipartFiles = Multipart.FilesSchema`, assertHttpApiIncludes(spec, [ `HttpApiEndpoint.get("list", "/search"`, `export const SearchRequestJson = Schema.Struct({ "query": Schema.String })`, - `HttpApiEndpoint.query("search", "/search", { payload: SearchRequestJson, success: HttpApiSchema.Empty(204) })` + `HttpApiEndpoint.query("search", "/search", { payload: SearchRequestJson, success: HttpApiSchema.Empty(204).annotate({ description: "No content" }) })` ], ["legacySearch", "LegacySearch"]) ])) }) @@ -3666,6 +3834,22 @@ export const __HttpApiMultipartFiles = Multipart.FilesSchema`, } } satisfies OpenAPISpec + it.effect.each([ + { + summary: "List pets", + description: "Returns pets available for adoption.", + text: "List pets\n* \n* Returns pets available for adoption." + }, + { summary: "List pets", description: " List pets ", text: "List pets" }, + { summary: "List pets", text: "List pets" }, + { description: "Returns available pets.", text: "Returns available pets." } + ])("documents client methods with summary '$summary' and description '$description'", ({ text, ...metadata }) => { + const get = { ...petsSpec.paths["/pets"].get, ...metadata } + const spec = { ...petsSpec, paths: { "/pets": { get } } } + const expected = [`/**\n* ${text}\n*/\nreadonly "listPets"`] + return Effect.all([assertRuntimeIncludes(spec, expected), assertTypeOnlyIncludes(spec, expected)]) + }) + for (const format of ["httpclient", "httpclient-type-only", "httpapi"] as const) { const layer = format === "httpclient-type-only" ? OpenApiGenerator.layerTransformerTs @@ -4373,6 +4557,42 @@ export const withString: UploadRequestFormData = { file: "upload.txt" } } ) + const openMultipartSpec = multipartSpec({ + type: "object", + properties: { file: { type: "string", format: "binary" }, caption: { type: "string" } }, + required: ["file"] + }) + + itGeneratedClientsCompile("accepts files in open multipart objects for generated clients", openMultipartSpec, { + usage: `export const withFile: UploadRequestFormData = { file: new File([], "upload.txt"), caption: "hi" } +export const withBlob: UploadRequestFormData = { file: new Blob([]), undeclared: "kept" } +` + }) + + it.effect("accepts files in open multipart objects (httpapi)", () => + assertHttpApiIncludes(openMultipartSpec, [ + `[Schema.Record(Schema.String, Schema.Union([Schema.Json.annotate({ "expected": "JSON value" }), __HttpApiMultipartSingleFile]))]` + ])) + + itGeneratedClientsCompile( + "accepts referenced file unions in open multipart objects without widening shared JSON components", + sharedMultipartSpec({ $ref: "#/components/schemas/Upload" }, { + MaybeFile: { anyOf: [{ type: "string", format: "binary" }, { type: "null" }] }, + Upload: { + type: "object", + properties: { file: { $ref: "#/components/schemas/MaybeFile" } }, + required: ["file"] + } + }), + { + usage: `export const multipartBlob: UploadMultipart = { file: new Blob([]), undeclared: "kept" } +export const jsonString: Upload = { file: "text", undeclared: "kept" } +// @ts-expect-error Shared JSON component must still reject files. +export const jsonBlob: Upload = { file: new Blob([]) } +` + } + ) + itGeneratedClientsCompile( "types recursive multipart binary references as File | Blob for generated clients", multipartSpec({ $ref: "#/components/schemas/Node" }, { diff --git a/.repos/effect/packages/tools/oxc/package.json b/.repos/effect/packages/tools/oxc/package.json index 0a245996f769f..07aa1c879cf73 100644 --- a/.repos/effect/packages/tools/oxc/package.json +++ b/.repos/effect/packages/tools/oxc/package.json @@ -56,7 +56,7 @@ "check": "tsc -b tsconfig.json" }, "dependencies": { - "@oxlint/plugins": "^1.93.0" + "@oxlint/plugins": "^1.94.0" }, "peerDependencies": { "typescript": ">=5.0.0 <7.0.0" diff --git a/.repos/effect/packages/vitest/CHANGELOG.md b/.repos/effect/packages/vitest/CHANGELOG.md index 9146782cc8463..d19971aa5ea00 100644 --- a/.repos/effect/packages/vitest/CHANGELOG.md +++ b/.repos/effect/packages/vitest/CHANGELOG.md @@ -1,5 +1,12 @@ # @effect/vitest +## 4.1.6 + +### Patch Changes + +- Updated dependencies [[`dd5f2f3`](https://github.com/Effect-TS/effect/commit/dd5f2f322fbad042a3a186cef593bf42affe5ce9), [`1d65846`](https://github.com/Effect-TS/effect/commit/1d65846308a6a18c4a95af543988ad30b72ff2b3), [`694c28f`](https://github.com/Effect-TS/effect/commit/694c28f0cfc3eac33f71160d18dda95cb670f506), [`5aaa2cd`](https://github.com/Effect-TS/effect/commit/5aaa2cd216e5e55f92d06db98d4b54946a396eed), [`55814bf`](https://github.com/Effect-TS/effect/commit/55814bf0a780f05ed0a51c82c8affda5d539bb0e), [`92c40a1`](https://github.com/Effect-TS/effect/commit/92c40a1f96a59f9edcacee6c0d6f6fb80397ee17), [`9f415a7`](https://github.com/Effect-TS/effect/commit/9f415a7733cdf8aed7efadbed3b5db22890e164a), [`e367afd`](https://github.com/Effect-TS/effect/commit/e367afdacfa3041a694a67e4670e98a20e41d45c), [`d5d2112`](https://github.com/Effect-TS/effect/commit/d5d21120ff591fcf8da006ce340010812cc91f16), [`fa2e5af`](https://github.com/Effect-TS/effect/commit/fa2e5af4ccc8f3650d97049707be82eab098c168), [`6bf6427`](https://github.com/Effect-TS/effect/commit/6bf6427d195539c387c13156aff79db077929c8f), [`10bc4a4`](https://github.com/Effect-TS/effect/commit/10bc4a47c0ce5bc50ba1998d63a803e3887d1d2b), [`a9540d3`](https://github.com/Effect-TS/effect/commit/a9540d3d50fbe65ade7f9b2f478cdd34a888161e), [`3a250d7`](https://github.com/Effect-TS/effect/commit/3a250d7eb8c310bf4751b3eca0038cf50e1629d8), [`ce44141`](https://github.com/Effect-TS/effect/commit/ce44141ad1bc8d05f3f7399bfa1e87772573205d), [`9318e5b`](https://github.com/Effect-TS/effect/commit/9318e5bafb144ddff65a0bff0148ec4f7ba77b5c), [`c9ecebf`](https://github.com/Effect-TS/effect/commit/c9ecebf7ede8a98895552fd20223d6573bd846fe), [`32f8fbe`](https://github.com/Effect-TS/effect/commit/32f8fbe1a5985aea41754e87531e9a1d0fbf78ec), [`41d6af1`](https://github.com/Effect-TS/effect/commit/41d6af14b7f36e06ade3bf7333b710e73de1e1c2), [`c33fd59`](https://github.com/Effect-TS/effect/commit/c33fd599cb7d49117f77f7bd8f05cb4209112a34), [`1f9e9d3`](https://github.com/Effect-TS/effect/commit/1f9e9d3de552435de6b8f4e1166515d0964c3999), [`594fa71`](https://github.com/Effect-TS/effect/commit/594fa71da417bf94fa6c9be2d3d36c808197e9fe), [`b378c38`](https://github.com/Effect-TS/effect/commit/b378c383cdb29e819e24da5dc725479a2ba4fdf1), [`a9ec9a6`](https://github.com/Effect-TS/effect/commit/a9ec9a60bbe1309960e00527ab62342dce1a86fc), [`310a81b`](https://github.com/Effect-TS/effect/commit/310a81b391e24d42b6608b5e3d641eca63e0d4c0), [`aab2135`](https://github.com/Effect-TS/effect/commit/aab2135d3fe43d4d86c4e486ed378797314fb212), [`6744a72`](https://github.com/Effect-TS/effect/commit/6744a724869539fc2d733929df871ef523bf82e8), [`848d042`](https://github.com/Effect-TS/effect/commit/848d0426f287b3e7ff970219d980a4c66fa441ad), [`077a93e`](https://github.com/Effect-TS/effect/commit/077a93e5db3adbc42e531539cb12b8bdbdfe5328), [`aef50fb`](https://github.com/Effect-TS/effect/commit/aef50fb8b56ec9ff8116f157635579fefd995f26), [`2e4de86`](https://github.com/Effect-TS/effect/commit/2e4de8634431f3da08ca2a90ab1024ee08e216f3), [`482b104`](https://github.com/Effect-TS/effect/commit/482b104caf712a8d5f99aafc64e55b6ea38eb809), [`753e1ed`](https://github.com/Effect-TS/effect/commit/753e1ed88069f73103d136dcdc58188fd10efdf1), [`0d2bb4a`](https://github.com/Effect-TS/effect/commit/0d2bb4a4b6526e1767b81101ee6e8da88ba1de55), [`8161e03`](https://github.com/Effect-TS/effect/commit/8161e03c26d691502afeddcf7e2ee75e6931637f), [`49f5391`](https://github.com/Effect-TS/effect/commit/49f53918a150aa2ea0ce2d444400cec1d6097400), [`3d59bdf`](https://github.com/Effect-TS/effect/commit/3d59bdf6f8f95ceea2091e5b8f375b834a14b3b1), [`8866608`](https://github.com/Effect-TS/effect/commit/88666082f2b6296bb7115bd4a2546151039f64db), [`69fd4b1`](https://github.com/Effect-TS/effect/commit/69fd4b1fba9e2ec5e7c16058ff8d9a1f9a38d90e), [`7d97626`](https://github.com/Effect-TS/effect/commit/7d9762658e515807c2b98678e7abd3ebe94e41ec), [`0e79436`](https://github.com/Effect-TS/effect/commit/0e794366658bd067a2212ea2ac7ed0223904ed31), [`2f8a4e9`](https://github.com/Effect-TS/effect/commit/2f8a4e9b90822d9facfef59027b35819c42d7b48), [`800b753`](https://github.com/Effect-TS/effect/commit/800b7535b4e37a24ac458cae78231054dae0b0f5)]: + - effect@4.1.6 + ## 4.1.5 ### Patch Changes diff --git a/.repos/effect/packages/vitest/package.json b/.repos/effect/packages/vitest/package.json index a99ec89673363..c314602d6b0a1 100644 --- a/.repos/effect/packages/vitest/package.json +++ b/.repos/effect/packages/vitest/package.json @@ -1,6 +1,6 @@ { "name": "@effect/vitest", - "version": "4.1.5", + "version": "4.1.6", "type": "module", "license": "MIT", "description": "A set of helpers for testing Effects with vitest", diff --git a/.repos/effect/pnpm-lock.yaml b/.repos/effect/pnpm-lock.yaml index 4f921417ebbf1..ac2b99ccac008 100644 --- a/.repos/effect/pnpm-lock.yaml +++ b/.repos/effect/pnpm-lock.yaml @@ -18,16 +18,16 @@ importers: devDependencies: '@babel/cli': specifier: ^8.1.0 - version: 8.1.0(@babel/core@8.1.2) + version: 8.1.0(@babel/core@8.1.3) '@babel/core': - specifier: ^8.1.2 - version: 8.1.2 + specifier: ^8.1.3 + version: 8.1.3 '@babel/plugin-transform-export-namespace-from': - specifier: ^8.1.0 - version: 8.1.0(@babel/core@8.1.2) + specifier: ^8.1.3 + version: 8.1.3(@babel/core@8.1.3) '@babel/plugin-transform-modules-commonjs': - specifier: ^8.1.2 - version: 8.1.2(@babel/core@8.1.2) + specifier: ^8.1.3 + version: 8.1.3(@babel/core@8.1.3) '@changesets/changelog-github': specifier: 1.0.1 version: 1.0.1 @@ -53,8 +53,8 @@ importers: specifier: workspace:^ version: link:packages/tools/oxc '@effect/tsgo': - specifier: ^0.69.0 - version: 0.69.0 + specifier: ^0.73.2 + version: 0.73.2 '@effect/utils': specifier: workspace:^ version: link:packages/tools/utils @@ -66,13 +66,13 @@ importers: version: 10.6.0 '@rollup/plugin-node-resolve': specifier: ^16.0.3 - version: 16.0.3(rollup@4.68.3) + version: 16.0.3(rollup@4.68.8) '@rollup/plugin-replace': specifier: ^6.0.3 - version: 6.0.3(rollup@4.68.3) + version: 6.0.3(rollup@4.68.8) '@rollup/plugin-terser': specifier: ^1.0.2 - version: 1.0.2(rollup@4.68.3) + version: 1.0.2(rollup@4.68.8) '@types/jscodeshift': specifier: ^17.3.0 version: 17.3.0 @@ -90,13 +90,13 @@ importers: version: 0.16.3 babel-plugin-annotate-pure-calls: specifier: ^0.5.0 - version: 0.5.0(@babel/core@8.1.2) + version: 0.5.0(@babel/core@8.1.3) dprint: - specifier: ^0.64.3 - version: 0.64.3 + specifier: ^0.65.0 + version: 0.65.0 fast-check: - specifier: ^4.10.2 - version: 4.10.2 + specifier: ^4.10.3 + version: 4.10.3 glob: specifier: ^14.0.6 version: 14.0.6 @@ -113,29 +113,29 @@ importers: specifier: ^8.0.0 version: 8.0.0(supports-color@10.2.2)(typescript@7.0.2) oxlint: - specifier: ^1.93.0 - version: 1.93.0 + specifier: ^1.94.0 + version: 1.94.0 pkg-pr-new: - specifier: 0.0.93 - version: 0.0.93 + specifier: 0.0.94 + version: 0.0.94 playwright: specifier: ^1.65.1 version: 1.65.1 rollup: - specifier: ^4.68.3 - version: 4.68.3 + specifier: ^4.68.8 + version: 4.68.8 rollup-plugin-bundle-stats: specifier: ^4.23.1 - version: 4.23.1(core-js@3.47.0)(rolldown@1.3.2)(rollup@4.68.3)(vite@8.3.8(@types/node@26.6.6)(esbuild@0.28.2)(terser@5.51.2)(tsx@4.23.15)(yaml@2.9.1)) + version: 4.23.1(core-js@3.47.0)(rolldown@1.3.3)(rollup@4.68.8)(vite@8.3.8(@types/node@26.6.6)(esbuild@0.28.2)(terser@5.51.4)(tsx@4.23.15)(yaml@2.9.1)) rollup-plugin-esbuild: specifier: ^6.2.1 - version: 6.2.1(esbuild@0.28.2)(rollup@4.68.3)(supports-color@10.2.2) + version: 6.2.1(esbuild@0.28.2)(rollup@4.68.8)(supports-color@10.2.2) rollup-plugin-visualizer: specifier: ^7.1.3 - version: 7.1.3(rolldown@1.3.2)(rollup@4.68.3) + version: 7.1.3(rolldown@1.3.3)(rollup@4.68.8) terser: - specifier: ^5.51.2 - version: 5.51.2 + specifier: ^5.51.4 + version: 5.51.4 tstyche: specifier: ^7.2.5 version: 7.2.5(typescript@7.0.2) @@ -144,10 +144,10 @@ importers: version: 7.0.2 vite: specifier: ^8.3.8 - version: 8.3.8(@types/node@26.6.6)(esbuild@0.28.2)(terser@5.51.2)(tsx@4.23.15)(yaml@2.9.1) + version: 8.3.8(@types/node@26.6.6)(esbuild@0.28.2)(terser@5.51.4)(tsx@4.23.15)(yaml@2.9.1) vitest: specifier: ^5.1.0 - version: 5.1.0(@edge-runtime/vm@5.0.0)(@opentelemetry/api@1.10.0)(@types/node@26.6.6)(@vitest/coverage-v8@5.1.0)(happy-dom@21.0.4)(jsdom@30.0.1)(vite@8.3.8(@types/node@26.6.6)(esbuild@0.28.2)(terser@5.51.2)(tsx@4.23.15)(yaml@2.9.1)) + version: 5.1.0(@edge-runtime/vm@5.0.0)(@opentelemetry/api@1.10.0)(@types/node@26.6.6)(@vitest/coverage-v8@5.1.0)(happy-dom@21.0.4)(jsdom@30.0.1)(vite@8.3.8(@types/node@26.6.6)(esbuild@0.28.2)(terser@5.51.4)(tsx@4.23.15)(yaml@2.9.1)) vitest-websocket-mock: specifier: ^0.8.0 version: 0.8.0(vitest@5.1.0) @@ -227,11 +227,11 @@ importers: specifier: workspace:* version: link:../packages/effect hono: - specifier: ^4.13.18 - version: 4.13.18 + specifier: ^4.13.19 + version: 4.13.19 nodemailer: - specifier: ^10.5.0 - version: 10.5.0 + specifier: ^10.6.1 + version: 10.6.1 devDependencies: '@types/nodemailer': specifier: ^8.0.2 @@ -285,8 +285,8 @@ importers: specifier: ^10.4.2 version: 10.4.2 '@testing-library/jest-dom': - specifier: ^7.0.1 - version: 7.0.1(@testing-library/dom@10.4.2)(vitest@5.1.0) + specifier: ^8.0.0 + version: 8.0.0(@testing-library/dom@10.4.2)(vitest@5.1.0) '@testing-library/react': specifier: ^16.3.3 version: 16.3.3(@testing-library/dom@10.4.2)(@types/react-dom@19.3.0(@types/react@19.3.0))(@types/react@19.3.0)(react-dom@19.3.1(react@19.3.1))(react@19.3.1) @@ -327,8 +327,8 @@ importers: specifier: ^10.4.2 version: 10.4.2 '@testing-library/jest-dom': - specifier: ^7.0.1 - version: 7.0.1(@testing-library/dom@10.4.2)(vitest@5.1.0) + specifier: ^8.0.0 + version: 8.0.0(@testing-library/dom@10.4.2)(vitest@5.1.0) effect: specifier: workspace:^ version: link:../../effect @@ -345,8 +345,8 @@ importers: specifier: workspace:^ version: link:../../effect vue: - specifier: ^3.5.45 - version: 3.5.45(typescript@7.0.2) + specifier: ^3.5.46 + version: 3.5.46(typescript@7.0.2) packages/chat/discord: devDependencies: @@ -417,8 +417,8 @@ importers: specifier: ^11.2.10 version: 11.2.10 jose: - specifier: 6.2.17 - version: 6.2.17 + specifier: 6.2.18 + version: 6.2.18 miniflare: specifier: 5.20260925.0-alpha version: 5.20260925.0-alpha(@types/node@26.6.6) @@ -426,8 +426,8 @@ importers: specifier: ^8.8.1 version: 8.8.1 tinybench: - specifier: ^6.2.3 - version: 6.2.3 + specifier: ^6.2.4 + version: 6.2.4 valibot: specifier: ^1.5.0 version: 1.5.0(typescript@7.0.2) @@ -500,30 +500,30 @@ importers: version: link:../node-shared devDependencies: '@types/bun': - specifier: ^1.4.4 - version: 1.4.4 + specifier: ^1.4.5 + version: 1.4.5 effect: specifier: workspace:^ version: link:../../effect tinybench: - specifier: ^6.2.3 - version: 6.2.3 + specifier: ^6.2.4 + version: 6.2.4 packages/platform/cloudflare: dependencies: '@cloudflare/workers-types': - specifier: ^5.20261114.1 - version: 5.20261114.1 + specifier: ^5.20261121.1 + version: 5.20261121.1 '@effect/sql-sqlite-do': specifier: workspace:^ version: link:../../sql/sqlite-do devDependencies: '@alchemy.run/cloudflare': specifier: 2.0.0-beta.87 - version: 2.0.0-beta.87(@effect/platform-bun@4.1.4(effect@packages+effect))(@effect/platform-node@4.1.4(effect@packages+effect)(redis@6.3.1(@opentelemetry/api@1.10.0)))(@effect/sql-libsql@4.1.4(effect@packages+effect))(@effect/sql-mysql2@4.1.4(@types/node@26.6.6)(effect@packages+effect))(@effect/sql-pg@4.1.4(effect@packages+effect))(@types/node@26.6.6)(alchemy@2.0.0-beta.87(@effect/platform-bun@4.1.4(effect@packages+effect))(@effect/platform-node@4.1.4(effect@packages+effect)(redis@6.3.1(@opentelemetry/api@1.10.0)))(@types/react@19.3.0)(effect@packages+effect)(react-devtools-core@6.1.5)(vite@8.3.8(@types/node@26.6.6)(esbuild@0.28.2)(terser@5.51.2)(tsx@4.23.15)(yaml@2.9.1))(ws@8.23.0))(effect@packages+effect)(mysql2@3.24.6(@types/node@26.6.6))(typescript@7.0.2)(vite@8.3.8(@types/node@26.6.6)(esbuild@0.28.2)(terser@5.51.2)(tsx@4.23.15)(yaml@2.9.1)) + version: 2.0.0-beta.87(@effect/platform-bun@4.1.5(effect@packages+effect))(@effect/platform-node@4.1.5(effect@packages+effect)(redis@6.3.1(@opentelemetry/api@1.10.0)))(@effect/sql-libsql@4.1.5(effect@packages+effect))(@effect/sql-mysql2@4.1.5(@types/node@26.6.6)(effect@packages+effect))(@effect/sql-pg@4.1.5(effect@packages+effect))(@types/node@26.6.6)(alchemy@2.0.0-beta.87(@effect/platform-bun@4.1.5(effect@packages+effect))(@effect/platform-node@4.1.5(effect@packages+effect)(redis@6.3.1(@opentelemetry/api@1.10.0)))(@types/react@19.3.0)(effect@packages+effect)(react-devtools-core@6.1.5)(vite@8.3.8(@types/node@26.6.6)(esbuild@0.28.2)(terser@5.51.4)(tsx@4.23.15)(yaml@2.9.1))(ws@8.23.0))(effect@packages+effect)(mysql2@3.24.6(@types/node@26.6.6))(typescript@7.0.2)(vite@8.3.8(@types/node@26.6.6)(esbuild@0.28.2)(terser@5.51.4)(tsx@4.23.15)(yaml@2.9.1)) alchemy: specifier: 2.0.0-beta.87 - version: 2.0.0-beta.87(@effect/platform-bun@4.1.4(effect@packages+effect))(@effect/platform-node@4.1.4(effect@packages+effect)(redis@6.3.1(@opentelemetry/api@1.10.0)))(@types/react@19.3.0)(effect@packages+effect)(react-devtools-core@6.1.5)(vite@8.3.8(@types/node@26.6.6)(esbuild@0.28.2)(terser@5.51.2)(tsx@4.23.15)(yaml@2.9.1))(ws@8.23.0) + version: 2.0.0-beta.87(@effect/platform-bun@4.1.5(effect@packages+effect))(@effect/platform-node@4.1.5(effect@packages+effect)(redis@6.3.1(@opentelemetry/api@1.10.0)))(@types/react@19.3.0)(effect@packages+effect)(react-devtools-core@6.1.5)(vite@8.3.8(@types/node@26.6.6)(esbuild@0.28.2)(terser@5.51.4)(tsx@4.23.15)(yaml@2.9.1))(ws@8.23.0) effect: specifier: workspace:^ version: link:../../effect @@ -559,8 +559,8 @@ importers: specifier: jsr:^1.0.19 version: '@jsr/std__assert@1.0.19' '@testcontainers/redis': - specifier: ^12.2.1 - version: 12.2.1(bare-buffer@3.7.1)(supports-color@10.2.2) + specifier: ^12.2.2 + version: 12.2.2(bare-buffer@3.7.1)(supports-color@10.2.2) '@types/deno': specifier: ^2.7.0 version: 2.7.0 @@ -568,8 +568,8 @@ importers: specifier: workspace:^ version: link:../../effect tinybench: - specifier: ^6.2.3 - version: 6.2.3 + specifier: ^6.2.4 + version: 6.2.4 packages/platform/node: dependencies: @@ -577,21 +577,21 @@ importers: specifier: workspace:* version: link:../node-shared undici: - specifier: ^8.12.4 - version: 8.12.4 + specifier: ^8.13.1 + version: 8.13.1 devDependencies: '@testcontainers/mssqlserver': - specifier: ^12.2.1 - version: 12.2.1(bare-buffer@3.7.1)(supports-color@10.2.2) + specifier: ^12.2.2 + version: 12.2.2(bare-buffer@3.7.1)(supports-color@10.2.2) '@testcontainers/mysql': - specifier: ^12.2.1 - version: 12.2.1(bare-buffer@3.7.1)(supports-color@10.2.2) + specifier: ^12.2.2 + version: 12.2.2(bare-buffer@3.7.1)(supports-color@10.2.2) '@testcontainers/postgresql': - specifier: ^12.2.1 - version: 12.2.1(bare-buffer@3.7.1)(supports-color@10.2.2) + specifier: ^12.2.2 + version: 12.2.2(bare-buffer@3.7.1)(supports-color@10.2.2) '@testcontainers/redis': - specifier: ^12.2.1 - version: 12.2.1(bare-buffer@3.7.1)(supports-color@10.2.2) + specifier: ^12.2.2 + version: 12.2.2(bare-buffer@3.7.1)(supports-color@10.2.2) '@types/node': specifier: ^26.6.6 version: 26.6.6 @@ -602,8 +602,8 @@ importers: specifier: ^6.3.1 version: 6.3.1(@opentelemetry/api@1.10.0) testcontainers: - specifier: ^12.2.1 - version: 12.2.1(bare-buffer@3.7.1)(supports-color@10.2.2) + specifier: ^12.2.2 + version: 12.2.2(bare-buffer@3.7.1)(supports-color@10.2.2) packages/platform/node-shared: dependencies: @@ -624,11 +624,11 @@ importers: specifier: ^7.5.23 version: 7.5.23 testcontainers: - specifier: ^12.2.1 - version: 12.2.1(bare-buffer@3.7.1)(supports-color@10.2.2) + specifier: ^12.2.2 + version: 12.2.2(bare-buffer@3.7.1)(supports-color@10.2.2) tinybench: - specifier: ^6.2.3 - version: 6.2.3 + specifier: ^6.2.4 + version: 6.2.4 packages/sql/clickhouse: dependencies: @@ -646,8 +646,8 @@ importers: packages/sql/d1: dependencies: '@cloudflare/workers-types': - specifier: ^5.20261114.1 - version: 5.20261114.1 + specifier: ^5.20261121.1 + version: 5.20261121.1 devDependencies: effect: specifier: workspace:^ @@ -666,18 +666,18 @@ importers: specifier: workspace:^ version: link:../../effect testcontainers: - specifier: ^12.2.1 - version: 12.2.1(bare-buffer@3.7.1)(supports-color@10.2.2) + specifier: ^12.2.2 + version: 12.2.2(bare-buffer@3.7.1)(supports-color@10.2.2) packages/sql/mssql: dependencies: tedious: - specifier: ^20.3.9 - version: 20.3.9(supports-color@10.2.2) + specifier: ^20.4.1 + version: 20.4.1(supports-color@10.2.2) devDependencies: '@testcontainers/mssqlserver': - specifier: ^12.2.1 - version: 12.2.1(bare-buffer@3.7.1)(supports-color@10.2.2) + specifier: ^12.2.2 + version: 12.2.2(bare-buffer@3.7.1)(supports-color@10.2.2) effect: specifier: workspace:^ version: link:../../effect @@ -689,8 +689,8 @@ importers: version: 3.24.6(@types/node@26.6.6) devDependencies: '@testcontainers/mysql': - specifier: ^12.2.1 - version: 12.2.1(bare-buffer@3.7.1)(supports-color@10.2.2) + specifier: ^12.2.2 + version: 12.2.2(bare-buffer@3.7.1)(supports-color@10.2.2) effect: specifier: workspace:^ version: link:../../effect @@ -698,8 +698,8 @@ importers: packages/sql/pg: devDependencies: '@testcontainers/postgresql': - specifier: ^12.2.1 - version: 12.2.1(bare-buffer@3.7.1)(supports-color@10.2.2) + specifier: ^12.2.2 + version: 12.2.2(bare-buffer@3.7.1)(supports-color@10.2.2) '@types/node': specifier: ^26.6.6 version: 26.6.6 @@ -710,17 +710,17 @@ importers: specifier: ^4.1.1 version: 4.1.1 testcontainers: - specifier: ^12.2.1 - version: 12.2.1(bare-buffer@3.7.1)(supports-color@10.2.2) + specifier: ^12.2.2 + version: 12.2.2(bare-buffer@3.7.1)(supports-color@10.2.2) tinybench: - specifier: ^6.2.3 - version: 6.2.3 + specifier: ^6.2.4 + version: 6.2.4 packages/sql/pglite: dependencies: '@electric-sql/pglite': - specifier: ^0.5.16 - version: 0.5.16 + specifier: ^0.5.17 + version: 0.5.17 devDependencies: effect: specifier: workspace:^ @@ -732,8 +732,8 @@ importers: specifier: workspace:^ version: link:../../platform/bun '@types/bun': - specifier: ^1.4.4 - version: 1.4.4 + specifier: ^1.4.5 + version: 1.4.5 effect: specifier: workspace:^ version: link:../../effect @@ -741,8 +741,8 @@ importers: packages/sql/sqlite-do: devDependencies: '@cloudflare/workers-types': - specifier: ^5.20261114.1 - version: 5.20261114.1 + specifier: ^5.20261121.1 + version: 5.20261121.1 effect: specifier: workspace:^ version: link:../../effect @@ -769,7 +769,7 @@ importers: devDependencies: '@op-engineering/op-sqlite': specifier: ^18.2.5 - version: 18.2.5(react-native@0.83.0(@babel/core@8.1.2)(@types/react@19.3.0)(react@19.3.1)(supports-color@10.2.2))(react@19.3.1) + version: 18.2.5(react-native@0.83.0(@babel/core@8.1.3)(@types/react@19.3.0)(react@19.3.1)(supports-color@10.2.2))(react@19.3.1) '@types/semver': specifier: ^7.8.0 version: 7.8.0 @@ -856,7 +856,7 @@ importers: version: typescript@6.0.3 vitest: specifier: 5.1.0 - version: 5.1.0(@edge-runtime/vm@5.0.0)(@opentelemetry/api@1.10.0)(@types/node@26.6.6)(@vitest/coverage-v8@5.1.0)(happy-dom@21.0.4)(jsdom@30.0.1)(vite@8.3.8(@types/node@26.6.6)(esbuild@0.28.2)(terser@5.51.2)(tsx@4.23.15)(yaml@2.9.1)) + version: 5.1.0(@edge-runtime/vm@5.0.0)(@opentelemetry/api@1.10.0)(@types/node@26.6.6)(@vitest/coverage-v8@5.1.0)(happy-dom@21.0.4)(jsdom@30.0.1)(vite@8.3.8(@types/node@26.6.6)(esbuild@0.28.2)(terser@5.51.4)(tsx@4.23.15)(yaml@2.9.1)) packages/tools/bundle: dependencies: @@ -865,13 +865,13 @@ importers: version: link:../../platform/node '@rollup/plugin-node-resolve': specifier: ^16.0.3 - version: 16.0.3(rollup@4.68.3) + version: 16.0.3(rollup@4.68.8) '@rollup/plugin-replace': specifier: ^6.0.3 - version: 6.0.3(rollup@4.68.3) + version: 6.0.3(rollup@4.68.8) '@rollup/plugin-terser': specifier: ^1.0.2 - version: 1.0.2(rollup@4.68.3) + version: 1.0.2(rollup@4.68.8) effect: specifier: workspace:^ version: link:../../effect @@ -879,24 +879,24 @@ importers: specifier: ^14.0.6 version: 14.0.6 rollup: - specifier: ^4.68.3 - version: 4.68.3 + specifier: ^4.68.8 + version: 4.68.8 rollup-plugin-esbuild: specifier: ^6.2.1 - version: 6.2.1(esbuild@0.28.2)(rollup@4.68.3)(supports-color@10.2.2) + version: 6.2.1(esbuild@0.28.2)(rollup@4.68.8)(supports-color@10.2.2) rollup-plugin-visualizer: specifier: ^7.1.3 - version: 7.1.3(rolldown@1.3.2)(rollup@4.68.3) + version: 7.1.3(rolldown@1.3.3)(rollup@4.68.8) devDependencies: '@babel/core': - specifier: ^8.1.2 - version: 8.1.2 + specifier: ^8.1.3 + version: 8.1.3 '@types/node': specifier: ^26.6.6 version: 26.6.6 babel-plugin-annotate-pure-calls: specifier: ^0.5.0 - version: 0.5.0(@babel/core@8.1.2) + version: 0.5.0(@babel/core@8.1.3) esbuild: specifier: ^0.28.2 version: 0.28.2 @@ -954,13 +954,13 @@ importers: version: 6.0.3 vitest: specifier: ^5.1.0 - version: 5.1.0(@edge-runtime/vm@5.0.0)(@opentelemetry/api@1.10.0)(@types/node@26.6.6)(@vitest/coverage-v8@5.1.0)(happy-dom@21.0.4)(jsdom@30.0.1)(vite@8.3.8(@types/node@26.6.6)(esbuild@0.28.2)(terser@5.51.2)(tsx@4.23.15)(yaml@2.9.1)) + version: 5.1.0(@edge-runtime/vm@5.0.0)(@opentelemetry/api@1.10.0)(@types/node@26.6.6)(@vitest/coverage-v8@5.1.0)(happy-dom@21.0.4)(jsdom@30.0.1)(vite@8.3.8(@types/node@26.6.6)(esbuild@0.28.2)(terser@5.51.4)(tsx@4.23.15)(yaml@2.9.1)) packages/tools/doctest: dependencies: rolldown: - specifier: ^1.3.2 - version: 1.3.2 + specifier: ^1.3.3 + version: 1.3.3 devDependencies: '@effect/vitest': specifier: workspace:^ @@ -973,10 +973,10 @@ importers: version: link:../../effect vite: specifier: ^8.3.8 - version: 8.3.8(@types/node@26.6.6)(esbuild@0.28.2)(terser@5.51.2)(tsx@4.23.15)(yaml@2.9.1) + version: 8.3.8(@types/node@26.6.6)(esbuild@0.28.2)(terser@5.51.4)(tsx@4.23.15)(yaml@2.9.1) vitest: specifier: ^5.1.0 - version: 5.1.0(@edge-runtime/vm@5.0.0)(@opentelemetry/api@1.10.0)(@types/node@26.6.6)(@vitest/coverage-v8@5.1.0)(happy-dom@21.0.4)(jsdom@30.0.1)(vite@8.3.8(@types/node@26.6.6)(esbuild@0.28.2)(terser@5.51.2)(tsx@4.23.15)(yaml@2.9.1)) + version: 5.1.0(@edge-runtime/vm@5.0.0)(@opentelemetry/api@1.10.0)(@types/node@26.6.6)(@vitest/coverage-v8@5.1.0)(happy-dom@21.0.4)(jsdom@30.0.1)(vite@8.3.8(@types/node@26.6.6)(esbuild@0.28.2)(terser@5.51.4)(tsx@4.23.15)(yaml@2.9.1)) packages/tools/eventlog-server: dependencies: @@ -1027,7 +1027,7 @@ importers: version: 6.0.3 vitest: specifier: ^5.1.0 - version: 5.1.0(@edge-runtime/vm@5.0.0)(@opentelemetry/api@1.10.0)(@types/node@26.6.6)(@vitest/coverage-v8@5.1.0)(happy-dom@21.0.4)(jsdom@30.0.1)(vite@8.3.8(@types/node@26.6.6)(esbuild@0.28.2)(terser@5.51.2)(tsx@4.23.15)(yaml@2.9.1)) + version: 5.1.0(@edge-runtime/vm@5.0.0)(@opentelemetry/api@1.10.0)(@types/node@26.6.6)(@vitest/coverage-v8@5.1.0)(happy-dom@21.0.4)(jsdom@30.0.1)(vite@8.3.8(@types/node@26.6.6)(esbuild@0.28.2)(terser@5.51.4)(tsx@4.23.15)(yaml@2.9.1)) packages/tools/npm-promote: dependencies: @@ -1052,7 +1052,7 @@ importers: version: 7.8.0 vitest: specifier: ^5.1.0 - version: 5.1.0(@edge-runtime/vm@5.0.0)(@opentelemetry/api@1.10.0)(@types/node@26.6.6)(@vitest/coverage-v8@5.1.0)(happy-dom@21.0.4)(jsdom@30.0.1)(vite@8.3.8(@types/node@26.6.6)(esbuild@0.28.2)(terser@5.51.2)(tsx@4.23.15)(yaml@2.9.1)) + version: 5.1.0(@edge-runtime/vm@5.0.0)(@opentelemetry/api@1.10.0)(@types/node@26.6.6)(@vitest/coverage-v8@5.1.0)(happy-dom@21.0.4)(jsdom@30.0.1)(vite@8.3.8(@types/node@26.6.6)(esbuild@0.28.2)(terser@5.51.4)(tsx@4.23.15)(yaml@2.9.1)) packages/tools/openapi-generator: dependencies: @@ -1076,14 +1076,14 @@ importers: specifier: ^7.13.0 version: 7.13.0(typescript@7.0.2) rolldown: - specifier: ^1.3.2 - version: 1.3.2 + specifier: ^1.3.3 + version: 1.3.3 packages/tools/oxc: dependencies: '@oxlint/plugins': - specifier: ^1.93.0 - version: 1.93.0 + specifier: ^1.94.0 + version: 1.94.0 devDependencies: '@types/node': specifier: ^26.6.6 @@ -1093,7 +1093,7 @@ importers: version: 6.0.3 vitest: specifier: ^5.1.0 - version: 5.1.0(@edge-runtime/vm@5.0.0)(@opentelemetry/api@1.10.0)(@types/node@26.6.6)(@vitest/coverage-v8@5.1.0)(happy-dom@21.0.4)(jsdom@30.0.1)(vite@8.3.8(@types/node@26.6.6)(esbuild@0.28.2)(terser@5.51.2)(tsx@4.23.15)(yaml@2.9.1)) + version: 5.1.0(@edge-runtime/vm@5.0.0)(@opentelemetry/api@1.10.0)(@types/node@26.6.6)(@vitest/coverage-v8@5.1.0)(happy-dom@21.0.4)(jsdom@30.0.1)(vite@8.3.8(@types/node@26.6.6)(esbuild@0.28.2)(terser@5.51.4)(tsx@4.23.15)(yaml@2.9.1)) packages/tools/utils: dependencies: @@ -1121,7 +1121,7 @@ importers: version: link:../effect vitest: specifier: 5.1.0 - version: 5.1.0(@edge-runtime/vm@5.0.0)(@opentelemetry/api@1.10.0)(@types/node@26.6.6)(@vitest/coverage-v8@5.1.0)(happy-dom@21.0.4)(jsdom@30.0.1)(vite@8.3.8(@types/node@26.6.6)(esbuild@0.28.2)(terser@5.51.2)(tsx@4.23.15)(yaml@2.9.1)) + version: 5.1.0(@edge-runtime/vm@5.0.0)(@opentelemetry/api@1.10.0)(@types/node@26.6.6)(@vitest/coverage-v8@5.1.0)(happy-dom@21.0.4)(jsdom@30.0.1)(vite@8.3.8(@types/node@26.6.6)(esbuild@0.28.2)(terser@5.51.4)(tsx@4.23.15)(yaml@2.9.1)) scratchpad: dependencies: @@ -1430,20 +1430,16 @@ packages: resolution: {integrity: sha512-j1nvOQCZYSgp7HLmisnCXFTpVvFODiijQ9QHkORfGKWH6YDtskTEeCJS7eV545GZ9UBzrq0e2xsOd5QQ5PjIqw==} engines: {node: '>=6.9.0'} - '@babel/core@8.1.2': - resolution: {integrity: sha512-xqDajHAAOjklW5UtWzFd9vSmlQ16+emgGi0HsyDQFGRQWZ/GjuwCoYGC3PnHxspmOR+HJBzDIOkMxNq/VvC98w==} + '@babel/core@8.1.3': + resolution: {integrity: sha512-kcHuFAOr6mQDd9acrkBd138f+HzIjFmhPAP3yMKL+M3/ncMEYjd3JKvdK7G+b1FR9tc0uhzo9PqgXMtLIL/qzg==} engines: {node: ^22.18.0 || >=24.11.0} '@babel/generator@7.29.13': resolution: {integrity: sha512-T5FRo+RzVHvGjWOuF1Ljc44b+NXAOazodHkGUHp4I3zCkQ4/sNVJm56h1S278LMR0bY5xBhztGziSbli8zObIw==} engines: {node: '>=6.9.0'} - '@babel/generator@8.1.0': - resolution: {integrity: sha512-7fiBJ61wDV3AHbg7n/EfLBv3RU+lsdRP8QNJnydkKWA7e48FnnvKQWbVHsJQCBE7JHTj4xlzZL9fvQYsBUip2A==} - engines: {node: ^22.18.0 || >=24.11.0} - - '@babel/generator@8.1.2': - resolution: {integrity: sha512-tAjURz1NaCZGtdG3hB6gjaIeTVo4XFD4TnbqIEneADVJ1Jpt2NxhPBAjbhius8ulUG5b/P2b56ec1ClJZa2aBQ==} + '@babel/generator@8.1.3': + resolution: {integrity: sha512-lfUz17Qtr+EinAoqyK1+4J5F0GtgsZjXktM5o+QXWM8KRUOauR/WuwBHWGU/aaSp4FI99M7rj6kg851XYWDvmQ==} engines: {node: ^22.18.0 || >=24.11.0} '@babel/helper-annotate-as-pure@7.29.7': @@ -1490,8 +1486,8 @@ packages: peerDependencies: '@babel/core': ^7.0.0 - '@babel/helper-module-transforms@8.1.2': - resolution: {integrity: sha512-iSa4SKZHScghjyCDWgrkcb/gt+huMuoZ8ZpY0iQQUG1C41XH9Iy3nQA0vcNDTcALItQ0kZ9cuWzqm76p/kkHJA==} + '@babel/helper-module-transforms@8.1.3': + resolution: {integrity: sha512-3MW06LMu251Tx0lB0x3pPRxswJtMnHjSZIAxU+6OcIoahS++Mftn+9IQ23uEXWSi7mmwJLDuHZ2ssT9xHPyl/Q==} engines: {node: ^22.18.0 || >=24.11.0} peerDependencies: '@babel/core': ^8.0.0 @@ -1524,12 +1520,8 @@ packages: resolution: {integrity: sha512-fWegr+WsEsiMVW4KUNdIIzzMTZSzNiqhy0//6+2MRi2d5NFNsL/AYwBQW8eBnRbTBVRnDVzjaJEUqKaCWjMMdQ==} engines: {node: '>=6.9.0'} - '@babel/helper-string-parser@8.0.8': - resolution: {integrity: sha512-fVM+gSuKbdv9cpmyRNh5EvsDHUZCdxQH3FdnFKSkNYHpbsn95bbrxm+ES3MVeQjcqwi2O5ur/DjLfmTQaO60ng==} - engines: {node: ^22.18.0 || >=24.11.0} - - '@babel/helper-string-parser@8.1.2': - resolution: {integrity: sha512-TRz5Z0MgfIfWqwEIq/pCpUpEXQxUt2Ig2ZbxG3SdmhSbHMAFFYGOix0kI4JLV371/TA+qWnQ4xWHPWjojkyRFA==} + '@babel/helper-string-parser@8.1.3': + resolution: {integrity: sha512-5HTuREtgj0xIc345zU4gtD2+3vIPkZpJw7wUYytt/mzBTQN2mWpGr1nxYiocYa2E8sWggRkrSg/k7BK51pAxIg==} engines: {node: ^22.18.0 || >=24.11.0} '@babel/helper-validator-identifier@7.29.7': @@ -1552,8 +1544,8 @@ packages: resolution: {integrity: sha512-laoRpD/kO/iA4CDlgJbixHekg7oPvWALK0PQyK3Ob2I2njZRvVAD77RfWCIImtqWCq6KijoBoZK7bp/HlTWASQ==} engines: {node: '>=6.9.0'} - '@babel/helpers@8.1.2': - resolution: {integrity: sha512-BmtiG8H9OUWSTFOgl9jtPYmfDi6uc21Pf4GUxkgGoZnzMIzpDnhkl5gsGJW6wb1jmKCyU565F8IYe5mwOTctfw==} + '@babel/helpers@8.1.3': + resolution: {integrity: sha512-s5s0hMqsgSVikMuK7XHFDlIJvZp5CdAFpJcgNF5b/6oRvVCS8n779zsJVQuwtUUu75/nCYceKvi+K2FDKcogXg==} engines: {node: ^22.18.0 || >=24.11.0} '@babel/parser@7.29.13': @@ -1561,13 +1553,8 @@ packages: engines: {node: '>=6.0.0'} hasBin: true - '@babel/parser@8.1.0': - resolution: {integrity: sha512-fpqZYAC+Tthr19JbEKxXhCGutvfm/+roMe+ULrgUKI+GVyzkQiTMTSheORcWIAzW8T3Oo3W5UavWSvAWmsp7fA==} - engines: {node: ^22.18.0 || >=24.11.0} - hasBin: true - - '@babel/parser@8.1.2': - resolution: {integrity: sha512-ZDKU7vaX0VORd2BhaO+3FKr/30TKjbUy3SMZcydiPngnAb+MesgUoh5SJcE5EwEyBj14M5J6fK56GuBqvYmOpw==} + '@babel/parser@8.1.3': + resolution: {integrity: sha512-v3ck2WN7jn8gEJlEfIDEwTM8dCBjOac1CZjolvB6/r0O1ome6E7xS2cDQEOQqESRQZWWrLrhnjxD0qjmZ8QBgg==} engines: {node: ^22.18.0 || >=24.11.0} hasBin: true @@ -1674,8 +1661,8 @@ packages: peerDependencies: '@babel/core': ^7.0.0-0 - '@babel/plugin-transform-export-namespace-from@8.1.0': - resolution: {integrity: sha512-4NpXrz/RfrjoCC3NZkRNWvLSe+kG/p3RKzWIOFAEqE7AuNOiOPi+3T0iEIUQBqjG42RnmUY0uMV0XlREIubxLQ==} + '@babel/plugin-transform-export-namespace-from@8.1.3': + resolution: {integrity: sha512-5pAX+brkANOGMC3BMhdfRo50RqipfHrAk/ubLE8kERf445XR+hNHCA9P9v+K5oRlDv0T9iam0YiVku9POF40SQ==} engines: {node: ^22.18.0 || >=24.11.0} peerDependencies: '@babel/core': ^8.0.0 @@ -1692,8 +1679,8 @@ packages: peerDependencies: '@babel/core': ^7.0.0-0 - '@babel/plugin-transform-modules-commonjs@8.1.2': - resolution: {integrity: sha512-bYW5KcM2w1DAXUV2a5HnWWVn+KGdz2EqpLocooynARzjdLjNTxLlftPGPP9APhTdmMrdynVEcu3QCUWhW/FIUw==} + '@babel/plugin-transform-modules-commonjs@8.1.3': + resolution: {integrity: sha512-1A75v/R3qnMwBFG/nS6xVHCpgRuaZOQ9x/+lKmMktMtSt+pI7oUYliVMfz31LfHJPLQXhRD7C5wgvGWtiMzdMw==} engines: {node: ^22.18.0 || >=24.11.0} peerDependencies: '@babel/core': ^8.0.0 @@ -1748,10 +1735,6 @@ packages: resolution: {integrity: sha512-puq+Gf35oI24FeN11LkoUQFqv9uwNeWpxXZi/Ji3rRIoKAzKnxRaZ+Gkj0vKS9ZCiTESfng1N9LyOyXvo+m+Gg==} engines: {node: '>=6.9.0'} - '@babel/template@8.0.0': - resolution: {integrity: sha512-eAD0QW/AlbamBbw0FeGiwasbCVPq5ncW0HNVyLP3B9czqLyh4gvw+5JTSNt6le9+ziAU7mqDZsKTHf3jTb4chQ==} - engines: {node: ^22.18.0 || >=24.11.0} - '@babel/template@8.1.2': resolution: {integrity: sha512-9B3FA5HZWK7rTJ7nU2F03qAc/t80O/WB5YQ7NKYdvmMwpq7EUyN04APNQWpkqwSqWtOsuwR0jMSRYLFoAd1m9A==} engines: {node: ^22.18.0 || >=24.11.0} @@ -1760,24 +1743,16 @@ packages: resolution: {integrity: sha512-0ve0xMlFA73dgY1oyJRY6RoW+/bncdcOQqg6jjYcVfXBK90OdLXjm9R6lmRetdZVrPjXkKIoMVBqYFPjcAlZ4Q==} engines: {node: '>=6.9.0'} - '@babel/traverse@8.1.0': - resolution: {integrity: sha512-oQ0QI6MR4cm6bOR/Ua5HLPxvO7vborT7Le5HNt9GmZUKpNsaPl2yj4gsQ440lXaZjc4vmUbSeVgEcK4cHuCL2A==} - engines: {node: ^22.18.0 || >=24.11.0} - - '@babel/traverse@8.1.2': - resolution: {integrity: sha512-J8OoydypQO6HGgRYiiHPMj0iBfz2XpSm5hkmd0+OEHWgQFzYL8TEvYq2y4Gu8vxRCa7g06BilFZ0Imiye5jzzg==} + '@babel/traverse@8.1.3': + resolution: {integrity: sha512-Mil7E37zLel1sjGwcgAF0wn8tbTJp3LLVMb0fqgDxWJJm52NXBv3MJaqmNOp76qzInY/0uDH3rSZfl3BqCjHiw==} engines: {node: ^22.18.0 || >=24.11.0} '@babel/types@7.29.11': resolution: {integrity: sha512-WCsemW40Cpc6gouC1SrY6PBaZ+oLRlEVY9XBvZBI7il/HyUrb2nJ505wE1MHEFyDZNnrWDEuy4jL50WVHfTTSQ==} engines: {node: '>=6.9.0'} - '@babel/types@8.1.0': - resolution: {integrity: sha512-8V8aSTDx012YPmDQF30vrokyxVFdRAU2YBS2VzrnfLAGkP8floVnjckwgFcD0Jrvf6GWMSRdCrYVsk3tyMwZRg==} - engines: {node: ^22.18.0 || >=24.11.0} - - '@babel/types@8.1.2': - resolution: {integrity: sha512-uXt6qt2f5G61jZwNIzK1RKu7l5Xjt1VXtPPOGuVveha9fxbx0QM94U1kM4pFZKTRLjWK+X8vmwjwbIemJjiQTA==} + '@babel/types@8.1.3': + resolution: {integrity: sha512-eBREGwDHRPHtdsg44t071GE2KRDEuJrf0J2uT5/qvJPB2+pfPZOKlx93dMZOFkE7QW5G0JWoczySD7a01Jf0iw==} engines: {node: ^22.18.0 || >=24.11.0} '@balena/dockerignore@1.0.2': @@ -1995,11 +1970,8 @@ packages: cpu: [x64] os: [win32] - '@cloudflare/workers-types@5.20261107.1': - resolution: {integrity: sha512-Q23LVprqgqdoxBYaH3YyTrtmeJZMzVarvcTZjZC6FnQIqrr+Vm/ASdWtezOQ+oq3FvhoGr1Xe7BAU3XZfkqUQw==} - - '@cloudflare/workers-types@5.20261114.1': - resolution: {integrity: sha512-+oSzWssC5/wfY92Ij/O4XUnxcKh6mPrE6EsWDoHrLYYTjLHEsDU520mllwCu4O63WXdZWFUteeUB55BOk7hpZw==} + '@cloudflare/workers-types@5.20261121.1': + resolution: {integrity: sha512-eLzyhm8/Qn+yshOObNIVsV8YJyWR9BOBCnnuqmrqY5uhsVDlLMdCmOQ34oC3eoVLkav94Dc7MWcfC+FuaxdNjA==} '@cspotcode/source-map-support@0.8.1': resolution: {integrity: sha512-IchNf6dN4tHoMFIn/7OE8LWZ19Y6q/67Bmf6vnGREv8RSbBVb9LPJxEcnwrcwX6ixSvaiGoomAUvu4YSxXrVgw==} @@ -2084,109 +2056,109 @@ packages: peerDependencies: effect: ^4.1.2 - '@dprint/android-arm64@0.64.3': - resolution: {integrity: sha512-cRSS8GTClq/xDF3VBFAvkBwO4a0cwovwfUCyMhzKDIVvPOYr8A7zDd3fKoYfU4oCpEGZ4oFBhAw84S3ia1IRSA==} + '@dprint/android-arm64@0.65.0': + resolution: {integrity: sha512-BEE0RLN+yjDZnPHnw/c+QUk6l0YIIoQP/dqbw5WjYWsl0AC5htu/6f9gIYFdtu7H7TzLQhqIQuIq5uRpHEuU3g==} cpu: [arm64] os: [android] - '@dprint/android-x64@0.64.3': - resolution: {integrity: sha512-9dFcs/hXoGW9P/15QMN0zazg6ZmJq5aqDQxsbCM4i9ut7Mv5mH909ZsuuVSJNrIwaCUfFNYQTrGtALjK/CpK6g==} + '@dprint/android-x64@0.65.0': + resolution: {integrity: sha512-oYA0/qqXwY+invZ2+l+7RyzPS3yH96ERh2PL6BWwBMKUSg9IoI/o+O9sgbQRb5UudqGQXq0QBf1uQLRA3u3M9w==} cpu: [x64] os: [android] - '@dprint/darwin-arm64@0.64.3': - resolution: {integrity: sha512-doIkcq1e6kbut7iGC3U+mEDrI8ncLPpZrfP0/jU4x12dX15tH7HUfoeW63AJbKL940rEBKPGemihDWA7DhGUKQ==} + '@dprint/darwin-arm64@0.65.0': + resolution: {integrity: sha512-bfkOminRCL4/chnj9hsQGyWz4S8h2WS32D1wlO5QCVwZU0SEpoGpo1ih8yDfIY/XL+RWfM5ygCtqdarnQ/nrFA==} cpu: [arm64] os: [darwin] - '@dprint/darwin-x64@0.64.3': - resolution: {integrity: sha512-2tLgFrMGWa03WTcoXLjU1JAUmHgIUaq4I91Ik1xPx+jxt7NEkeo0qPny1bqFFtOkCkI13R5CkLAgTrNA5KK8PQ==} + '@dprint/darwin-x64@0.65.0': + resolution: {integrity: sha512-9hsmOWv7V69oILyPtK4xHoqKyT3C2QG4pAL2wHis5vPkQ99iGWNiEd8M5EQhObWzSK59ud/6MrwMRpK2IGeMVw==} cpu: [x64] os: [darwin] - '@dprint/freebsd-arm64@0.64.3': - resolution: {integrity: sha512-fJt4LMMxjNir4ingKZQ1sRSnqaTpAGR/WOmK+1AQDS4gg1cGI73Vqbe4Cgb3NZ5/0TwewNbAi7koGQXlAUNTOQ==} + '@dprint/freebsd-arm64@0.65.0': + resolution: {integrity: sha512-2qGBfSn7PgxDJ4BXkp9YBQkzdx2oUdZPljBSxJ+vUYHlJ5nhXDuQwSY6anY1tQbFUOYKJ++7NO/7VPfYDrkrIQ==} cpu: [arm64] os: [freebsd] - '@dprint/freebsd-x64@0.64.3': - resolution: {integrity: sha512-yfqzdI3Yt4H4AavLyWzE/HjJL17gzh8GIJF5OMNyBb8XeJPeB76U/sv7FgaURQKUr6AhIoPBqp4w+WlVftkCeg==} + '@dprint/freebsd-x64@0.65.0': + resolution: {integrity: sha512-oOD/AZUyBGI5Fu1SWcoTBtk2KrTMzCupOTSN7bzZBQhxwzxufcirrfy0W/IX89S4yU578PvaCdEdgueqs9DGkg==} cpu: [x64] os: [freebsd] - '@dprint/linux-arm64-glibc@0.64.3': - resolution: {integrity: sha512-dJQ5PS0+7COmKG0NHy11pEoCfzeL1slrGuHWS0uQmyIbBskbItFnubR9KsD1J/UfYIq62rySvAm2D+MNw7cYOA==} + '@dprint/linux-arm64-glibc@0.65.0': + resolution: {integrity: sha512-veuVnT240iB2Ysy1RcieOKMT4PAKMv8wmUa3qAIm1zDIVSxWRuaYDECLuqGKnM3LhFmK/MDEk3fVth5K4A9OtA==} cpu: [arm64] os: [linux] libc: [glibc] - '@dprint/linux-arm64-musl@0.64.3': - resolution: {integrity: sha512-UVHeWWRAEQe3qUsM5UD7HnC8OGZIn0U864wuAHqMpGvf2ZcxE2OlGs0x0w6SU3Vwas/4XQqREkG/WgsCykeMNg==} + '@dprint/linux-arm64-musl@0.65.0': + resolution: {integrity: sha512-FAyIptI7XKv6Fh7GUDJO7vnB7qP+bf6XTr2Gzz0k/hGzD1SN6EhKmi7OHXIf4SeojtVZc6gwSL1jknRbMsrZLQ==} cpu: [arm64] os: [linux] libc: [musl] - '@dprint/linux-loong64-glibc@0.64.3': - resolution: {integrity: sha512-HK+8T+8TZ/xANv/8HX+W2YlpMOaHYUW4oUx2h7rUN7wcC79i7vCq6/N5qDwUIRvB5HgJ7e7ArMB5fLHgl79t3Q==} + '@dprint/linux-loong64-glibc@0.65.0': + resolution: {integrity: sha512-aVMSJuq2LKfEk8mxLzuWOkj8q+qamednMpmiWtIwJzqAw0zGth0HrTukR7zpyv6LwQxE5A3ezwZTlaSHcmqOWA==} cpu: [loong64] os: [linux] libc: [glibc] - '@dprint/linux-loong64-musl@0.64.3': - resolution: {integrity: sha512-ozGKUY98D9DwtXRjjwptDuimBK+FClns61wHrns8NTCKOucSPnOURn7YW3adq4uD1bPn1cAN7RxpsmiufZ1e2Q==} + '@dprint/linux-loong64-musl@0.65.0': + resolution: {integrity: sha512-ndMc3Ln8Fz8BrZ5Wlmuc9fb+zdAWoPccimMF0rFVPOUUmbipHynWl9l/FFIEQrZfMoyyKcZUtH27RN8ripvi5A==} cpu: [loong64] os: [linux] libc: [musl] - '@dprint/linux-ppc64-glibc@0.64.3': - resolution: {integrity: sha512-Whxvv7UcZX2GGiHIQy/IWmaMbfwV+9cRr9/Fpl628ipOnqzTjw7l/GVZstfDv5jQgsZYDADsgcb/xCF+zzZp4A==} + '@dprint/linux-ppc64-glibc@0.65.0': + resolution: {integrity: sha512-nZgokeKrkOzDzcZeNEuMu13EXi1dt6rF25+ltHS9o57DLlM0XKdOhf2Iyo3qxFZtBBt+43Zkr7DaT4ljafI/Ow==} cpu: [ppc64] os: [linux] libc: [glibc] - '@dprint/linux-ppc64-musl@0.64.3': - resolution: {integrity: sha512-o3tW/Xv1BpjsUWEaSOGPZlnME2U+qPWR5QmnryeFyQZv8HIF4ustfIqz51w7g9X1R2J+yU0EYjEgIvPvijuFoQ==} + '@dprint/linux-ppc64-musl@0.65.0': + resolution: {integrity: sha512-RJIs8iM4xc7XpCgYhh3S5kPsb/KEj91Ea4XFZ4hbndU7hT/+pnGCe8j8H9z9T4hw6WWJEdNwxJpPm9r0IwxluA==} cpu: [ppc64] os: [linux] libc: [musl] - '@dprint/linux-riscv64-glibc@0.64.3': - resolution: {integrity: sha512-UngEpOD0KUWi9mPUGioYQnGuGon48+sz4sOsKzBNLYdxkeS7tlCFA3416QELcildYmHrsO79VYG9Sw6afvxzsQ==} + '@dprint/linux-riscv64-glibc@0.65.0': + resolution: {integrity: sha512-bSQdJNW91GUeecmUoWeQg7kXWChWxKSZTGCJS9ZwS7/T9yL89H4a7ZxgotBAYOF1bH08nEiySbYeKypXNNVLpQ==} cpu: [riscv64] os: [linux] libc: [glibc] - '@dprint/linux-riscv64-musl@0.64.3': - resolution: {integrity: sha512-dGYX5X6SmVeIlxpGI6/p2Sgu0RH9oSwuuN+h+jyLo66zC9ei+3jb/+5snHuDoQLLpg5MC5KbJQvqfgCWKb4xAQ==} + '@dprint/linux-riscv64-musl@0.65.0': + resolution: {integrity: sha512-NCYhmZQ8qFHhzahGP2bqag98lNlMlfumMUIL1p78TROCcmeDx/jf4xMwp9r92CbG4vxjicaFVCBRJdloKXlgiA==} cpu: [riscv64] os: [linux] libc: [musl] - '@dprint/linux-s390x-glibc@0.64.3': - resolution: {integrity: sha512-DsIPuN98Xz0RerI/kaQW8OGaIJGYpBhR5vPFRDb1EU1LUv8Cc4KdAFTyzGkS2CAIM3YyjgGABAxpln9NDsuKRg==} + '@dprint/linux-s390x-glibc@0.65.0': + resolution: {integrity: sha512-qlOTzlUacVDzgPAUX/UIw5ZHiDj1Z1i990NzhFdLJiUYg5+NFCmAtMKORB2e/JQZ8I2V3xpHXUgIlCryKe4ngQ==} cpu: [s390x] os: [linux] libc: [glibc] - '@dprint/linux-x64-glibc@0.64.3': - resolution: {integrity: sha512-wKVnD6eO8S4U8LbVcZy0l0ioJKfLbsL1OYUr0f4M99lrBv30RA385sii5Fq/NSM8O/sh9gII8zRvdtTMUWbImg==} + '@dprint/linux-x64-glibc@0.65.0': + resolution: {integrity: sha512-edcSFtFrpH/X/j0stOHsPLt4FCDERZ7ov5zKnFUi/kOb7BVt3ffq2aHsLEPmQsVsifZRavM8M3GIcHNzGQvYSw==} cpu: [x64] os: [linux] libc: [glibc] - '@dprint/linux-x64-musl@0.64.3': - resolution: {integrity: sha512-AhhAyhd4gG7UrP9NmV60fWf6EFHqZE3X9QW0B2LeoX9vt+rcWv3ejbGOFD8V4Wkg6LyPl49RyGgeltn9KTwD1g==} + '@dprint/linux-x64-musl@0.65.0': + resolution: {integrity: sha512-8KM8bdLsDd2orYtkBvFFGsL0iNMbckPSIJAQvi/k77qz2uX2i6EokGYP2AzUchNBDsEPypURxcICh6IDRzWNgQ==} cpu: [x64] os: [linux] libc: [musl] - '@dprint/win32-arm64@0.64.3': - resolution: {integrity: sha512-noAymd7nZiKB4pGEW4YbS01647n4pbBYv5GzXlFWYu408xuVWc5+b76Gua4IVO1gkiPtkBRIcmRBStXblfrRyw==} + '@dprint/win32-arm64@0.65.0': + resolution: {integrity: sha512-sdJYY9U1je/K10rgfB+T/W4Bza+pHanvvJt+WWFsS2zaphAU3ZqgaJLbboXykR1sr8BoZoXQmP6FhGZP+1qGEg==} cpu: [arm64] os: [win32] - '@dprint/win32-x64@0.64.3': - resolution: {integrity: sha512-i5yc2BcaLYX8MpvkfCSdIrbEic84AF1t7dKgJCB40m6ckxPUFygMkujfAGHLY4NNE+Q9i9RmRx6N0AiUBwcNVg==} + '@dprint/win32-x64@0.65.0': + resolution: {integrity: sha512-o7QJa5Idq6VocfyXLsXTuJUZF9OBipDEzCcjqRZQWzb1AdxZigwt6jTZeliyclkfsCuCtYc8678DUVe53uGpGw==} cpu: [x64] os: [win32] @@ -2203,22 +2175,22 @@ packages: engines: {node: '>=0.10.0'} hasBin: true - '@effect/platform-bun@4.1.4': - resolution: {integrity: sha512-Vdq82GOrD5HVF43aXVwHeX+4uIOrgAnjju9MEyizzFZ3yt3A6x9prtmHej1q/zAOaeNddtkpPr2ExHEvZ13S6Q==} + '@effect/platform-bun@4.1.5': + resolution: {integrity: sha512-VzUugWhIKQSWp/xtFrYIrCISDcUXWrCFfxSkqg8ul0DZgo23WRqfz+38Y3mJ2NenUv5kUj14FnjLohm2t8ZGCw==} peerDependencies: - effect: ^4.1.4 + effect: ^4.1.5 - '@effect/platform-node-shared@4.1.4': - resolution: {integrity: sha512-DWdfphHGOFJNj/mYadgpT3jIm8aRXDcPrQiGXFBH4p2H4XmA7iYMrPsI8NxVgZ7kNX0q1+FGJZJama0tINHRAg==} + '@effect/platform-node-shared@4.1.5': + resolution: {integrity: sha512-JzlrYe4uKaBFTWihBRXo2pDjkUVB39kQpKdGfXdbp7Co5sKT8hbcjOmdB5pg/WOYESdGTddd3fxD4lwlZELbZQ==} engines: {node: '>=22.19.0'} peerDependencies: - effect: ^4.1.4 + effect: ^4.1.5 - '@effect/platform-node@4.1.4': - resolution: {integrity: sha512-h7QExTPq/RfYtHP/8tMlgfBvqYsuJKhxfkU6w0+NaF/ihqQ8Y3GH9t28ltupQjoqMM7P6W5gy8rOji7F0qVrmg==} + '@effect/platform-node@4.1.5': + resolution: {integrity: sha512-tFnRvxF9EKc3oU17sDHj1JeLP+TL/IkaOEl3IUk2EjgMS0x7AWs0ioUXjdNKLb3Z1LdjVfMf/DxsNh9PW5FFAg==} engines: {node: '>=22.19.0'} peerDependencies: - effect: ^4.1.4 + effect: ^4.1.5 redis: '>=5.1.0 <7.0.0' '@effect/sql-d1@4.1.4': @@ -2226,65 +2198,65 @@ packages: peerDependencies: effect: ^4.1.4 - '@effect/sql-libsql@4.1.4': - resolution: {integrity: sha512-JRjiJhA5fsCtjBNbjl9iZOrd45b8dKFT2K/4q3uierqGF6VQMcwBrEKgDw5qDdz1gExWDO8HNpKa1ugP9bBIEA==} + '@effect/sql-libsql@4.1.5': + resolution: {integrity: sha512-aImqE/iGOF626D2E4nTI9zSkfg6Er0UbUPgAyz3sKZqBEYrc4RsO69ai1eHlAYaj5I7kCF3XWdsR2nYR2+MOCQ==} peerDependencies: - effect: ^4.1.4 + effect: ^4.1.5 - '@effect/sql-mysql2@4.1.4': - resolution: {integrity: sha512-RZ/j8m3d8742q80rZn5YfWwoPUos7fkRPGnJv8XapKgGhAk7O1wxH6yHoB2aR+pVaMdrzG/MN856OIF5BPxzNQ==} + '@effect/sql-mysql2@4.1.5': + resolution: {integrity: sha512-fLjPQ5HiPT/6ZoNhEmJ5bDbOL9PAHq2ak+X7sDjHi6MqanOoNrGubHNSFbQJP+tZTu2IZZrK8KEEzqAUK/MX2g==} peerDependencies: - effect: ^4.1.4 + effect: ^4.1.5 - '@effect/sql-pg@4.1.4': - resolution: {integrity: sha512-DHsmpIfJeCYiJVk3JwMQFAWaQAmKV/elUbBCjHFP7qeZtJ8dViUV/y/AHdUaZ+OmMwtr8J7ZXA7AlsKZ9hPiQA==} + '@effect/sql-pg@4.1.5': + resolution: {integrity: sha512-Fs/5EmXykN4vKzWES54aRSLts0jBiQn65Y2jnGq//IX8Qj2McB7+WGYwaGNwxXUq4mXvagGWZPNMO0GefwDpQw==} peerDependencies: - effect: ^4.1.4 + effect: ^4.1.5 - '@effect/tsgo-darwin-arm64@0.69.0': - resolution: {integrity: sha512-XSkC5Ot7906NmN3tW0uQb+58DV7oVgyX7A20w3Zu7Y26kTve/YibhiDn8ZxhNRH/SiBouyA6IKR6THWjRs1cow==} + '@effect/tsgo-darwin-arm64@0.73.2': + resolution: {integrity: sha512-+6xuv33cSp44tNWc9erzLKmS7qRB/QdPJYUCJrEY+4lfRhFdAsCvRDw6uw2aqzePuZDHfM3gDqfYEl5g/mWBfQ==} cpu: [arm64] os: [darwin] - '@effect/tsgo-darwin-x64@0.69.0': - resolution: {integrity: sha512-QXVmbe8l0gtkByP2yazqPR7Pw9ImJZ6mX+YqYRED6h39DRRgFF4LvzM6jJQ7PVQFQpk816YpOHztO7bJTjSW1A==} + '@effect/tsgo-darwin-x64@0.73.2': + resolution: {integrity: sha512-Oqwft3rP05CWImD1GGPuWB3esJrxz7iSOXGpfku1KIK1eElW0aE9E1vdpgiFJ3lykJruyOOZ4UB+E4US5K/alA==} cpu: [x64] os: [darwin] - '@effect/tsgo-linux-arm64@0.69.0': - resolution: {integrity: sha512-BWb3NxRnpYJikfgr2xD2U9DBM5gHm7rScdHYs8tAGXJytqQ6ioAOOYqDa1XZx2MwO2lG3BEAw2liI77mHMVRfQ==} + '@effect/tsgo-linux-arm64@0.73.2': + resolution: {integrity: sha512-/EuCPqoqZb+kkcdCnypwd/stmSvAO5k/NKS+sQJSv6F2wXQAIgWB4VSNmftt1b/s7dBB0QysLFohscV8OxzCgA==} cpu: [arm64] os: [linux] - '@effect/tsgo-linux-arm@0.69.0': - resolution: {integrity: sha512-XewLmpBZC3CkaKCjhe2f2ZOGfdewZ0hgGIjiCUNiEmHl6Kwt8H8dzNAsYgWPPeahVTi09CSyo5f8iEwEIHt95g==} + '@effect/tsgo-linux-arm@0.73.2': + resolution: {integrity: sha512-JdAFBCv0Q0UyMe4Et7xTjqLoM6jDvci6qsaqWwGCRR8ZZhvc+j9kLw7dN3GJnYlHMr0HUGWnSCxUBISODpX/kA==} cpu: [arm] os: [linux] - '@effect/tsgo-linux-x64@0.69.0': - resolution: {integrity: sha512-LZ3joeZ5D/Tv/tQN4r5uA7yoTQ5cHvCjICF3NcTX9ntlhQ51gJlhRcbOvP8v8AzTkOtrty7YXZW++iUOY0OKpw==} + '@effect/tsgo-linux-x64@0.73.2': + resolution: {integrity: sha512-1g5UQ8nwpqJVwrXvHLstEc7N7jRuqZm2axukryerGV6/e6hD2vc70tHdb1ZVg8zIUR40TWem1MCoFNNIXKOlZg==} cpu: [x64] os: [linux] - '@effect/tsgo-win32-arm64@0.69.0': - resolution: {integrity: sha512-ZlysvNK8BJa0WaQ8KVCUjpY0VgxiqzqchHCQj2+ECJcBwhn178OXcgl4+ZhmFbnr/T4b3ZtsOj0+UXtkr+fPbg==} + '@effect/tsgo-win32-arm64@0.73.2': + resolution: {integrity: sha512-J4kyLNk0Fi6WwIWQV6omCu1OkHcNNY6KMcs5K2AqUV8l+QUMEetko5NkcmEi1Keedh6bNRqOGwvB9dg+Duvypw==} cpu: [arm64] os: [win32] - '@effect/tsgo-win32-x64@0.69.0': - resolution: {integrity: sha512-EIxwudo6cSjandzmfputEmpTfdlAfTd2sWQ29vWh3F3qFb6MC9JDCAYHXQFWSGOPNhMBK6NXd/8humPW/WkpGA==} + '@effect/tsgo-win32-x64@0.73.2': + resolution: {integrity: sha512-N5V9GaTZseqGN38+XhGypLpweX2XiM2DO1V9DUppp26deZIJe0j3QRiRCSUAQoJrR0Lji/k5wo3jki6P38sCPA==} cpu: [x64] os: [win32] - '@effect/tsgo@0.69.0': - resolution: {integrity: sha512-ypgO19woAyrfAG0LzU2QwQnprMpV2G30nEo9ffd4Bc0ow0vXupcx0mcSLG1EfvmRGl0jhiQ3yAbsCuJhqwnRhg==} + '@effect/tsgo@0.73.2': + resolution: {integrity: sha512-eM5ayjlp0fD2l+aL+4O/y9d1LwF1m5in5EdNkOYwLFcXI3kcee8CWP4wr2xTc4L/+KJmS/uaYUGWdOj4G46BDA==} hasBin: true '@effect/wa-sqlite@0.2.1': resolution: {integrity: sha512-vMnGIHKWSIFnDf7+n7lP2vyXPzORJotkaRI8LKyJw3eNjsvFopHYVaaGSeMSSVTm/w45pC5T4JdLrD6nxSR4oQ==} - '@electric-sql/pglite@0.5.16': - resolution: {integrity: sha512-Nj8KcIsJL748W408U2N8q4+9IlONdpRIU8MJypIAAINMJ5nqKyqpX7Mgg/5XKkXiAib3AoZGR6hnJFlrlLBrcg==} + '@electric-sql/pglite@0.5.17': + resolution: {integrity: sha512-8SvKjiUjaU+0O0dbxjOfN+jXz14TEqDWbwDkYOW1aQ11y/ph2JvFVI27ABBo5nfw+ZfSqy4hKCNlbnbB1TDE+g==} '@emnapi/core@2.0.0-beta.2': resolution: {integrity: sha512-MzCVoWtcg4Pm2B3je5mMvYMvj3MmBKw+fU7vbsJc9/iT8ip6/eYIHo/Dsm/mr+wsHB6SEyJDuxB09Yy6r/8+4A==} @@ -3273,133 +3245,133 @@ packages: '@oxc-project/types@0.156.0': resolution: {integrity: sha512-1Duyg48TdJNdyhEB8Xn1L36bT9Pv6GUtlKjHxOys8xkaF/rQq3XJE+bAurSK/AgIz5mGFsb77cn9Pb20+WCScw==} - '@oxc-project/types@0.158.0': - resolution: {integrity: sha512-xZ66qA4WmLbTLlxH3mqMd8f9UKbaOzOT0ATwFf4DH/14pMgpUrtqtjyYzOQmgfl2a0iRAAMbQ9G1th/67jRzGw==} + '@oxc-project/types@0.159.0': + resolution: {integrity: sha512-QWjWhxheluOJ82kDHNyps00UvRpQCtI34B5A/SzpgQycUD/79FuvT4I0aQIfE/bdPwKmX4QPftnywFBH6FxJhQ==} - '@oxlint/binding-android-arm-eabi@1.93.0': - resolution: {integrity: sha512-KKw70pbD5Pvq3G2lJ+WQ71XPMjCmg37rkSe2+mDqCRP3PoTSdDMuEi4UOnE8JBtyNM7bek61EC2s0Jt7S7u+Sg==} + '@oxlint/binding-android-arm-eabi@1.94.0': + resolution: {integrity: sha512-730FKSBsKg/NawYnpI3gXRroXptOVqY32iYBPLUZaSx0vgYzOeiNtwojZL4gJdzo9wDvHUlstShmGRHrWcbRYg==} engines: {node: ^20.19.0 || >=22.12.0} cpu: [arm] os: [android] - '@oxlint/binding-android-arm64@1.93.0': - resolution: {integrity: sha512-fvr1fTUZGelwRxKDt64pf28aL1WaWgviwz3X+E/FcRYvrlEahH0NECRz/c1SY+K+KWmZk5uAf6h1kQnyBkp/2A==} + '@oxlint/binding-android-arm64@1.94.0': + resolution: {integrity: sha512-8v8TICIiZpXLot1HSq5+vsG9NEKQ5czQBYlUqJR75OVfFDr3cGOmRU/CtHDWnS4tm8nW+Z4Y357qGToSfYqFvA==} engines: {node: ^20.19.0 || >=22.12.0} cpu: [arm64] os: [android] - '@oxlint/binding-darwin-arm64@1.93.0': - resolution: {integrity: sha512-VdvSN9JRf4Es6ZzoAdvEeh8tgKdw8L4H82WmA8MMPVfPdZGCwE/nI27Z1HrRHYQhPxOh4kmnxQEioSUFrOvDaw==} + '@oxlint/binding-darwin-arm64@1.94.0': + resolution: {integrity: sha512-NePcRMO/ltt1Pnytohl6pl0bd/QyRX8HbpptuDz9LK7FTsFD4lKxDMBt7di9k6IFLO0J05jO2nm7wGqIh6dRHA==} engines: {node: ^20.19.0 || >=22.12.0} cpu: [arm64] os: [darwin] - '@oxlint/binding-darwin-x64@1.93.0': - resolution: {integrity: sha512-QR1V890Ml0YGRG0F/iV0K9igG+pOhe+VWd+aZnxY849rRHZf3F2gEoQks5+GVHf105X9Mh/6HdShTP5juekG2g==} + '@oxlint/binding-darwin-x64@1.94.0': + resolution: {integrity: sha512-QV+m+OaEgLmYyillvP1wKXhMm6tDZEWx3vG7Wjmx9ybg15+6YMfqzvp6e+uPukC6zNywuule0vMn0fZgihZzZA==} engines: {node: ^20.19.0 || >=22.12.0} cpu: [x64] os: [darwin] - '@oxlint/binding-freebsd-x64@1.93.0': - resolution: {integrity: sha512-jDfIbi30zZaKi+rTvig3sge+Xhi8pFFSgHxb0jzovc4qh8ETm/irKV9c7N/JsuwnYc5sbvf4IC8w1vQQ0IL+BA==} + '@oxlint/binding-freebsd-x64@1.94.0': + resolution: {integrity: sha512-KVZjca581nrV6P71kZ9M1otBib9LH0IMn9rr4mrnbRp18V0HiZhBHbU26gji/Ieq2G34qMacnMc3zrmKmvWqWA==} engines: {node: ^20.19.0 || >=22.12.0} cpu: [x64] os: [freebsd] - '@oxlint/binding-linux-arm-gnueabihf@1.93.0': - resolution: {integrity: sha512-qtxZ714ND/koFgVH00QgxlzZiIbRPmguaPhnHRU5DFFtrtEdOrSnZD4U/H2AzXrXkZ59eQbMBnJwbum5XohrIQ==} + '@oxlint/binding-linux-arm-gnueabihf@1.94.0': + resolution: {integrity: sha512-AMQtgQJk8DgdIV+qaQ5sFoHAko4iKa8zo+gYqELy2grtU8hXWB08DAGB3u90aQL1YSxbd3zqHjgcODBHDFyzBQ==} engines: {node: ^20.19.0 || >=22.12.0} cpu: [arm] os: [linux] - '@oxlint/binding-linux-arm-musleabihf@1.93.0': - resolution: {integrity: sha512-5pJ9NjMvH7WMUqXB6bTTOSemBm39w2cod27Hu3+Yom/GhbTeNXlYcpDx1o4CgBP6fhp0YHG66TNdVaUm6sHjsA==} + '@oxlint/binding-linux-arm-musleabihf@1.94.0': + resolution: {integrity: sha512-ZLzoGVGAmQkp9leeB5rNxAXLcvlmkmd/GY71LKd5uikk+28NEApY3S2FB3pq6MkfOCFFnFg6QgD9lJIjd07D0Q==} engines: {node: ^20.19.0 || >=22.12.0} cpu: [arm] os: [linux] - '@oxlint/binding-linux-arm64-gnu@1.93.0': - resolution: {integrity: sha512-pRf+7jtbt2fHE23SX7qBxRgnBZicUgsoCK1PVIjnOk+t3a6UBkpt/GrKI99WlxsKUxftz/5nv/kfKvScmYywkw==} + '@oxlint/binding-linux-arm64-gnu@1.94.0': + resolution: {integrity: sha512-N1dW6o7cY90hLVkDsvz8nWIFOwbO+n272pvW7uLYB7u47HagJVnLChfK6QA9dWFdiPudud9zfksVUOciHc5PNA==} engines: {node: ^20.19.0 || >=22.12.0} cpu: [arm64] os: [linux] libc: [glibc] - '@oxlint/binding-linux-arm64-musl@1.93.0': - resolution: {integrity: sha512-zM8Fd/K8sqGvsBcJBZ3oVZ3ctGWbszA08IaGt5gFFF5RcunppAI/ZnAXbouABvnWeJ//S44KKlfPZnDDbeiphg==} + '@oxlint/binding-linux-arm64-musl@1.94.0': + resolution: {integrity: sha512-7tCF4OV/bGDQ2xxgb+sDI97SpmmDrUII4JxTG553voJVA9cnkbXSGSXzo78Ax73BuhEOPoQc2Qi6VrfT0cDG2A==} engines: {node: ^20.19.0 || >=22.12.0} cpu: [arm64] os: [linux] libc: [musl] - '@oxlint/binding-linux-ppc64-gnu@1.93.0': - resolution: {integrity: sha512-7qKCnvhZKDXJG2pdbLazd2hw4FxjJHbZOFrrbzyy5PdHfPLH9vnNUa1le01A8uItZuYKPBPncH+HCoEiFT4SgA==} + '@oxlint/binding-linux-ppc64-gnu@1.94.0': + resolution: {integrity: sha512-B5vUHE4wNisVEuaYxwFUn6tY+vw7A+9APxxqGKI+UmP3yKLpkhnt0qsaCrzjpX55F8rCRHBaTvIDdYo32NE36g==} engines: {node: ^20.19.0 || >=22.12.0} cpu: [ppc64] os: [linux] libc: [glibc] - '@oxlint/binding-linux-riscv64-gnu@1.93.0': - resolution: {integrity: sha512-2pgulxC6G8V5wE750NJE/fRkf9aO6i6yoj10wyaR2EdiNtan4OemsOtsQ0ZTXGdY8Q3IoTmlND3GYvjJsvikYg==} + '@oxlint/binding-linux-riscv64-gnu@1.94.0': + resolution: {integrity: sha512-/U0b15+c4hTodo8YhEqDlQ6OjnGKvc8igjM/mh23ukqqCUBKiBCaxqUV8bcaofK9uZ+f8wCygkyXLS6LN25YSA==} engines: {node: ^20.19.0 || >=22.12.0} cpu: [riscv64] os: [linux] libc: [glibc] - '@oxlint/binding-linux-riscv64-musl@1.93.0': - resolution: {integrity: sha512-yWsn6Gg2PnGG5jlyDz5+pHGiMTMiy4adaa4WRMzDgzB8efaShk1JMmTHIBSVLQMh0tYXRs4CN5uJCO79r4Mi4g==} + '@oxlint/binding-linux-riscv64-musl@1.94.0': + resolution: {integrity: sha512-ba94Vwl0qOnwXIXNDR33AEbLXuX++ckM74t+9Te7CiPSPAHivhOYyeEkUAicrvOEei1pxXkWggLbFeBFFBTuHA==} engines: {node: ^20.19.0 || >=22.12.0} cpu: [riscv64] os: [linux] libc: [musl] - '@oxlint/binding-linux-s390x-gnu@1.93.0': - resolution: {integrity: sha512-WCn5plwp/ezS2RDPQKp0/EXEVRr9/dDexUdRKmsMFqzNM5xBSZ1wbsi3PuMk1VfkMRnI5BuazCsziCWMXRDOlw==} + '@oxlint/binding-linux-s390x-gnu@1.94.0': + resolution: {integrity: sha512-GVwwwms3O8pdgbCiPavwq2vltyB4661GkDz6kJduZ0E5nsSJUDJ0svaP+ePYpuDVYi4+K1qhCKnWa/Ec8I4LUA==} engines: {node: ^20.19.0 || >=22.12.0} cpu: [s390x] os: [linux] libc: [glibc] - '@oxlint/binding-linux-x64-gnu@1.93.0': - resolution: {integrity: sha512-F2CGjb9LAkzH+IYTZSzd1klQ1vk5z6Utjax64WeLByCkYXbVDbsun+Oy2hLfW2MDSKCvW+jwy/9ld0EPgdeu+A==} + '@oxlint/binding-linux-x64-gnu@1.94.0': + resolution: {integrity: sha512-iUfCFJN8ZIresSnpTfiIkhF3s8X+XA4I9KJ249QwR2QYTMwh0+pla1pj1xaFi+HtR9McjM4Jaemf70HzX7ilOQ==} engines: {node: ^20.19.0 || >=22.12.0} cpu: [x64] os: [linux] libc: [glibc] - '@oxlint/binding-linux-x64-musl@1.93.0': - resolution: {integrity: sha512-plf5DE2objcG8Tf7mXRuRa8tT8rzDkpjqXQtKoGsKHWkpgsialbON1+cCtoSEUTVbQUjXvuAm8vV9+3rR0yCBw==} + '@oxlint/binding-linux-x64-musl@1.94.0': + resolution: {integrity: sha512-RqWVeWpDACS4Oh0m21OBmy+CQ50CbbhuHFmNNPVS2P/4R3d188MjEuEuV7So82/tAM8UAT+UuMDtRDESd9NJ7g==} engines: {node: ^20.19.0 || >=22.12.0} cpu: [x64] os: [linux] libc: [musl] - '@oxlint/binding-openharmony-arm64@1.93.0': - resolution: {integrity: sha512-Kp2yJrKvoTe9FfKdO/xwLNUbs2bYTMKx0+aoQD1s0h/Tx0kSgtHSdGmrk8tTKdluosjFbo88qYRIaNIX43AfFw==} + '@oxlint/binding-openharmony-arm64@1.94.0': + resolution: {integrity: sha512-K/2DHOUoypwYVqzxJMRPdMuBKjAetZEAsGPP7rHimd+2+5J1TxM+17pG8kw+ayH4+rqBXiPd+H9wgPcU+fF77A==} engines: {node: ^20.19.0 || >=22.12.0} cpu: [arm64] os: [openharmony] - '@oxlint/binding-win32-arm64-msvc@1.93.0': - resolution: {integrity: sha512-vigjcHCFsR6KjnWTEVfaCxcMYapEuaK9FZa1MpewwQ1S+Xud3v0okfkj1RySsD6RF1NRHIjSlQSalTnKIaj3nA==} + '@oxlint/binding-win32-arm64-msvc@1.94.0': + resolution: {integrity: sha512-hYOCaOJiB4ZCGswBWKl3JQrhqu6mnC5DCUw/1UMNzRXgsHIJ0V226J43LAVICVIDGlhFUZTYShFW+wHWpt6qCQ==} engines: {node: ^20.19.0 || >=22.12.0} cpu: [arm64] os: [win32] - '@oxlint/binding-win32-ia32-msvc@1.93.0': - resolution: {integrity: sha512-0Ot3BEe/AAr2/uQhe55r8CmPlperYk2mQmxdutOru7oU0kir6IiEVHb1TG3GORRlfra97lPHVDLhgmihiKzLrg==} + '@oxlint/binding-win32-ia32-msvc@1.94.0': + resolution: {integrity: sha512-1l1FDlzbPmAeDoZ8UGspOE2dOmz1ZL6SlDsvOmRCmWSQjCdTy5LzUepS8mO/SGpAoz4D6WAt/yNZAUyHqbkmkQ==} engines: {node: ^20.19.0 || >=22.12.0} cpu: [ia32] os: [win32] - '@oxlint/binding-win32-x64-msvc@1.93.0': - resolution: {integrity: sha512-ZzzIIVs/Qkm8trUWYKF0OYub5ALlv50/3gsEZbKAvWgz+yNJX6uRmQ8ySPXU2Q0/Y9m4JCOjhpmC8XUYbPHX5Q==} + '@oxlint/binding-win32-x64-msvc@1.94.0': + resolution: {integrity: sha512-I3eZdd4bemIJQDNv9XDV/FEofDxIoN32tzCv98wIgLdW05EqxZb5hF4AwPrRzHD/dQhl0n7KgPy5AQPfM0HWrA==} engines: {node: ^20.19.0 || >=22.12.0} cpu: [x64] os: [win32] - '@oxlint/plugins@1.93.0': - resolution: {integrity: sha512-bKWQI1g9jn8bWUZsvhbOLfgva576Fbp1KwoTNSUCMdT9tlTAvQS2JkifX1UrhPPdyN4GHvM20HhvIMqqU1yotQ==} + '@oxlint/plugins@1.94.0': + resolution: {integrity: sha512-YT6htikBOBQ00XDxZpRZLZ0anEDo7h9s4+YvjRU0/Ng/cLd0D6SZQ3tsms4g/GDer/z8UKlegC5iptEfyRXJcw==} engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} '@pkgjs/parseargs@0.11.0': @@ -3573,8 +3545,8 @@ packages: cpu: [arm] os: [android] - '@rolldown/binding-android-arm-eabi@1.3.2': - resolution: {integrity: sha512-kqR2xcygEx3WwDY69LsKeyf7SVmx4yzMtKZRknyaHieVJdRvvnAM97L0Gq6tUFc9T2YXcW/Ghij2+Um6He0LTw==} + '@rolldown/binding-android-arm-eabi@1.3.3': + resolution: {integrity: sha512-K1itOg1Xl50XyjLDa4qQZqaYsfiQbFbFRWXOEOupOsGr3whhm5ed4lgySd6Inohv2TB0+sdU4AxORKuS/TGang==} engines: {node: ^20.19.0 || >=22.12.0} cpu: [arm] os: [android] @@ -3591,8 +3563,8 @@ packages: cpu: [arm64] os: [android] - '@rolldown/binding-android-arm64@1.3.2': - resolution: {integrity: sha512-gXM4GAAvvIZA7qUuSCQS+Zz91H2fagKa5MNppUdjzysJ8LXMWm9D/gQj4nfOKo6okquDQ5pkjsuo2SUMXNW0Rw==} + '@rolldown/binding-android-arm64@1.3.3': + resolution: {integrity: sha512-re+E0E3YSJXjEFzdOvBgkVUev1Gg49ileia04qy+Djn0lIMBr7pnwVOYQ+4vc9XbLClCmMziasqXHM7KTmKNKQ==} engines: {node: ^20.19.0 || >=22.12.0} cpu: [arm64] os: [android] @@ -3609,8 +3581,8 @@ packages: cpu: [arm64] os: [darwin] - '@rolldown/binding-darwin-arm64@1.3.2': - resolution: {integrity: sha512-OBs5hp3W+LwMEUmDMMMnu08ncG0t6DDgnFU+6TAucKtAfNgerYLZSr2jtREKb/JuPQ1J7bJnWIgKKkxvjuAw1g==} + '@rolldown/binding-darwin-arm64@1.3.3': + resolution: {integrity: sha512-6pMLYsUiQJXPkUj/CG447hOBKtbe+hjWw/wbxe/mucoPKgnLSVRTzey7s0kXfqrjxhDd3gQ2hj6lgUKRumsIzw==} engines: {node: ^20.19.0 || >=22.12.0} cpu: [arm64] os: [darwin] @@ -3627,8 +3599,8 @@ packages: cpu: [x64] os: [darwin] - '@rolldown/binding-darwin-x64@1.3.2': - resolution: {integrity: sha512-X0VGYd4v/gdjfa/IP6uHuMhofPoUDYvK/byk3bC0jQ1pKKgt6RZ4B4puMqP0AHkjmIHAsxA471mM6AxZ39IaTA==} + '@rolldown/binding-darwin-x64@1.3.3': + resolution: {integrity: sha512-Lz+TskwvhceQgwnP+0ox5ZeL7HDDXHKWVRpOqC1Eo05y6rYyfvvep0msGqC95kQTykXrmGgP6qwJB1NdgNZVhg==} engines: {node: ^20.19.0 || >=22.12.0} cpu: [x64] os: [darwin] @@ -3645,8 +3617,8 @@ packages: cpu: [x64] os: [freebsd] - '@rolldown/binding-freebsd-x64@1.3.2': - resolution: {integrity: sha512-mr04K4cp9J/fj9fknrX8e4QvI/V48Sp+4v64PoLwhoirIH8b8L8EBrF/0bTjV1It2IL91hoNG13GblnWLglkxA==} + '@rolldown/binding-freebsd-x64@1.3.3': + resolution: {integrity: sha512-sIzqNDbA7GFDXU8k9/vcJyV1p45mCe+xHOLo9qD7gdbTbMlwB+SpnFoP7WSpC2iYdGfOX9pjBxCfViRn/Nu3Jw==} engines: {node: ^20.19.0 || >=22.12.0} cpu: [x64] os: [freebsd] @@ -3663,8 +3635,8 @@ packages: cpu: [arm] os: [linux] - '@rolldown/binding-linux-arm-gnueabihf@1.3.2': - resolution: {integrity: sha512-VgWy02HU9Tiy6tU8U+kF3Fd4TQwTNdIBvs2MlgViP1ksMtAnQQTIPAj0ZsJzIQXKIOugqQSpqxQgELJ3fkuL5w==} + '@rolldown/binding-linux-arm-gnueabihf@1.3.3': + resolution: {integrity: sha512-HYysnZZ7HD3FM5RIBN6wDMoxtOjw4LS9HhRuQ57MsZt5XGpGRPxVpplvr7vUXRN+9MD8zb6vn1JRP06PXIuMYQ==} engines: {node: ^20.19.0 || >=22.12.0} cpu: [arm] os: [linux] @@ -3683,8 +3655,8 @@ packages: os: [linux] libc: [glibc] - '@rolldown/binding-linux-arm64-gnu@1.3.2': - resolution: {integrity: sha512-0wloJFYqV844gv6boiERbHpErxbxHbmlgnMX5VxP1Ux+DLBqGrUOn0cIpBmCZEcTITes3QUelxya4u8c9ziQvQ==} + '@rolldown/binding-linux-arm64-gnu@1.3.3': + resolution: {integrity: sha512-XAyLqWSoEKVc8wsDbCIz5o2sBY6ye+0YByK9ib5QxFReoM1KHyThSHsdUODa1DKNzlEfae+p9QwK62LsVwo6Nw==} engines: {node: ^20.19.0 || >=22.12.0} cpu: [arm64] os: [linux] @@ -3704,8 +3676,8 @@ packages: os: [linux] libc: [musl] - '@rolldown/binding-linux-arm64-musl@1.3.2': - resolution: {integrity: sha512-Kys8wgFQy8H8vua0MNpC0akMBFoNO8455RHk2yycBM0iayMIAtVAL6xmV9TWAkehFgrrlImTL2fZdX5LXfYtAA==} + '@rolldown/binding-linux-arm64-musl@1.3.3': + resolution: {integrity: sha512-oVyicDPj6vUVFRnuoQS7M2Ab8EkGWoq3a5ntyQqjtZoXfgVykIJqN2IAJSi9q9UyNoQUW0vbBLQSgGtlPJ40Kg==} engines: {node: ^20.19.0 || >=22.12.0} cpu: [arm64] os: [linux] @@ -3725,8 +3697,8 @@ packages: os: [linux] libc: [glibc] - '@rolldown/binding-linux-ppc64-gnu@1.3.2': - resolution: {integrity: sha512-L8eej7+/StRxUHHOPsOVl7Fzx/3tumuGB4hGQZKT73xRI16KZhaSJr0gi3C3WBjNRxeJRKKps2UD4lQukP+oBw==} + '@rolldown/binding-linux-ppc64-gnu@1.3.3': + resolution: {integrity: sha512-k7aFSWgUoi/X7jCst7UEof7pS5jc5ymD8mT/pdFE+pO1IBBI2+JU5Os4HEDqS/tYhetRggwM7MOiLP3cg1bSBQ==} engines: {node: ^20.19.0 || >=22.12.0} cpu: [ppc64] os: [linux] @@ -3746,8 +3718,8 @@ packages: os: [linux] libc: [glibc] - '@rolldown/binding-linux-s390x-gnu@1.3.2': - resolution: {integrity: sha512-MV5CEb/nV8neQOj7l6945q1vy62HXtWO8zPDvfySPusoUzdBoLoJ/DfXXwaYThGTXZCniF+5bCf253WTPPK7Yw==} + '@rolldown/binding-linux-s390x-gnu@1.3.3': + resolution: {integrity: sha512-D5mxHpr1qIb1Pt5UT+Bm2p6vJ7+VxcxWcxZCYVDFzZwWRq9iLiEg4/ROsaXFQl1O8sDQZZJ55UoRWWMK64uH5w==} engines: {node: ^20.19.0 || >=22.12.0} cpu: [s390x] os: [linux] @@ -3767,8 +3739,8 @@ packages: os: [linux] libc: [glibc] - '@rolldown/binding-linux-x64-gnu@1.3.2': - resolution: {integrity: sha512-3qssvvVvkwQookZ1/1avlKWc5orAR85vgKdzDd5noZS8nnHiI/ejOAEt0xfNYvtBBF7/DZmP8dANWkRBJVOBCA==} + '@rolldown/binding-linux-x64-gnu@1.3.3': + resolution: {integrity: sha512-nmW1O4BbNEmQI9+KTHbJgbDv0EuyZy64oBnRlMCtLJ8lQMIJ/H/iziQ0g2IUlHEhNrSebGvs9cRrlRj8oEfP+g==} engines: {node: ^20.19.0 || >=22.12.0} cpu: [x64] os: [linux] @@ -3788,8 +3760,8 @@ packages: os: [linux] libc: [musl] - '@rolldown/binding-linux-x64-musl@1.3.2': - resolution: {integrity: sha512-rJqoFTm/bCZFKKgaT4NzWn/TuJkFDToZ/rzYFnYVBL28jH1nIfg6snx2mDri30nal9H+wcYfKpoPR9jrMQgQQg==} + '@rolldown/binding-linux-x64-musl@1.3.3': + resolution: {integrity: sha512-ivU4JFHK5nFzrRbzp3+vwYdLj8mFckH4oz3hEl5LH/YeThr9/m2N2vF3NvLevtHq6e0COimgrEVyYTwQhh4ODg==} engines: {node: ^20.19.0 || >=22.12.0} cpu: [x64] os: [linux] @@ -3807,8 +3779,8 @@ packages: cpu: [arm64] os: [openharmony] - '@rolldown/binding-openharmony-arm64@1.3.2': - resolution: {integrity: sha512-ozdbCjHfh0N//wJNExjJlSlcDaeIKo8k1ktzkLUyESr2Gu/Qw7nBYxKe3jgtoaxda570vg10WdYosre82263hQ==} + '@rolldown/binding-openharmony-arm64@1.3.3': + resolution: {integrity: sha512-XxZoRIkNZ/7pFgvOA8QJmx3uFjMyVz7zS2/urzlaFffoOGclDvpUAMu3AHKT551E8JBKXLxIjpYxYMdF6Mz9vQ==} engines: {node: ^20.19.0 || >=22.12.0} cpu: [arm64] os: [openharmony] @@ -3818,8 +3790,8 @@ packages: engines: {node: ^20.19.0 || ^22.13.0 || >=23.5.0} cpu: [wasm32] - '@rolldown/binding-wasm32-wasi@1.3.2': - resolution: {integrity: sha512-p5VA6Vk/2cXZPVWf+dDbuE0dkhrcoAo6pISTJmzUnsSdQqNJdusyR8lZgHku095+r27zrYISNLZnJoqrcePW0A==} + '@rolldown/binding-wasm32-wasi@1.3.3': + resolution: {integrity: sha512-bBl1MB2gF26PSPy3CiDLiv+A6JGI546WbsDR34LfKAywSGeBeQXaDanoDG6QdZDJs53M1QyJir5MTKTu1n4ptA==} engines: {node: ^20.19.0 || ^22.13.0 || >=23.5.0} cpu: [wasm32] @@ -3835,8 +3807,8 @@ packages: cpu: [arm64] os: [win32] - '@rolldown/binding-win32-arm64-msvc@1.3.2': - resolution: {integrity: sha512-XDb2U14Orf4r76SwzvJ7avePL00w4gHBmi1Ig4B/itYFEUTmYMNDHVU0dcYuBa0LgNBqyREoJOrQKxQlyYJA7A==} + '@rolldown/binding-win32-arm64-msvc@1.3.3': + resolution: {integrity: sha512-6rZur0hyen4LPhOxWIg7az1YX+Eo8Vvauc0D6lFYGK/QCvN+1XpnB8aFe3jQc/PBUGIReJJnLX3sS8h33/5v7A==} engines: {node: ^20.19.0 || >=22.12.0} cpu: [arm64] os: [win32] @@ -3853,8 +3825,8 @@ packages: cpu: [x64] os: [win32] - '@rolldown/binding-win32-x64-msvc@1.3.2': - resolution: {integrity: sha512-lEsKzKJqIUDZVCBhS4lkZuyQUhV1oRg5UHkI72qlOAqJn7qEXcoVdTridFS7PHNWdZknBl95EAF/4P1Xv0K1eQ==} + '@rolldown/binding-win32-x64-msvc@1.3.3': + resolution: {integrity: sha512-Ggzyuq1mN7claruAZH10aiiM1N3LRCoMP5xDXPdU514ulL0D2bksCWgFqEmEM2/pDzEP7Dq+dcv7IH452jtr1w==} engines: {node: ^20.19.0 || >=22.12.0} cpu: [x64] os: [win32] @@ -3898,146 +3870,146 @@ packages: rollup: optional: true - '@rollup/rollup-android-arm-eabi@4.68.3': - resolution: {integrity: sha512-mqfypgH/liYjaSCoPI4erckUcROgZtmFUUmyOJ05oyayi/tVqOEYAzWP7ufqCoCT3xB31Fw4XIVO/jX42hYvKA==} + '@rollup/rollup-android-arm-eabi@4.68.8': + resolution: {integrity: sha512-7l9FdeCGjhmMTVePgndK4t9u5tLR+VuTTMoyc0PscqZDdYjS07ZsQ0vQYsWsODu/ZZYPG7WVJwbUZ77n1hVT+w==} cpu: [arm] os: [android] - '@rollup/rollup-android-arm64@4.68.3': - resolution: {integrity: sha512-5tY+GC/1gpt79cKS2DQzu6iD824j6BmI4q5Zb6qftZ4kWqIQmvR3DD4eJ2Gclu6/nVMYDk2IVpqxypWOiAuWJg==} + '@rollup/rollup-android-arm64@4.68.8': + resolution: {integrity: sha512-kXkkIiJujBjArHwEToz99BQqIqibn4xdV6SjsoaxuZzvLUCVEzoHQ1Lp62m7xOhpLRpWpCtxL2ZUy/ADKuz9/g==} cpu: [arm64] os: [android] - '@rollup/rollup-android-x64@4.68.3': - resolution: {integrity: sha512-nDBcQ/o3PMmGxmAzGBJFn+n1rb83Va9WSdFIq1AHmlEF3tuibVsyJ3kG5x13r7VIy6WI8SvzCdHVNSlSDIdj8w==} + '@rollup/rollup-android-x64@4.68.8': + resolution: {integrity: sha512-KYoBygnHs3zUOLR0z7SaqhMnUrSF9pbuTOJT/uHK3PrgCXdv/xaMubZD8jCpg6NTo46deasLgZRq38xFTyu8uw==} cpu: [x64] os: [android] - '@rollup/rollup-darwin-arm64@4.68.3': - resolution: {integrity: sha512-dra5zl0QWKkIkaMgNDNPC19gkMlPAfAf41yWlkGztXMIvUQrX9XWZFQRw7abhH3nks+XZGQpybINAxT2pKdFew==} + '@rollup/rollup-darwin-arm64@4.68.8': + resolution: {integrity: sha512-YmBUNjgm5bsjOByO+H1TFbuGZe+ZnHcYtPXYj9+L1cwTu/BG8zjuUzO2PH9KwS85P0UH+WJDSb+mQ2hqjp5uBQ==} cpu: [arm64] os: [darwin] - '@rollup/rollup-darwin-x64@4.68.3': - resolution: {integrity: sha512-xo5xeo/AjEB/ArzQjGn0JRDZuybZicQ5O3VPfko6ocH1li/qNrN4p5+R/WgjavzRz6UwAOaqsau7VvRQA6i6AA==} + '@rollup/rollup-darwin-x64@4.68.8': + resolution: {integrity: sha512-XMX5ybuOmkwiM13KJtsBxakZ69pyaR9thRYU2fMejhaB0VuzLMIkIc+9TBsu2rv34eEf6XaSMOaLOyEgHGWHTQ==} cpu: [x64] os: [darwin] - '@rollup/rollup-freebsd-arm64@4.68.3': - resolution: {integrity: sha512-zdckkcxHDEEKyDbC1t21DeaaiKGymxbkBU9c3zyfaaz+8N96ItJw4nmzHhZF+Mukgt906fnf2tsc90pVyStuHA==} + '@rollup/rollup-freebsd-arm64@4.68.8': + resolution: {integrity: sha512-WuBXScWJDaqPJKwVrotUe1sM9DHWMN937C23RClt0MVHVt7A1rBy285ZfZTLccPEVMxmGJMt2jvdHMOI33lrKA==} cpu: [arm64] os: [freebsd] - '@rollup/rollup-freebsd-x64@4.68.3': - resolution: {integrity: sha512-9oXqI7g/ycEz7TyicdGBC4sL6PfWMXAx8u15f/nd7lYkCLJd8U8VdBfbpc4SSnRBU/e7aPALve3mhzasGDeCYg==} + '@rollup/rollup-freebsd-x64@4.68.8': + resolution: {integrity: sha512-kegwGqP3rMenEMaKo8OzMBb5WvLW2h2jrQ3iKuYptTTF8C/yuxz+hinjBPrtYuIPLJDwxHc/hv2e4u5pmrqo9A==} cpu: [x64] os: [freebsd] - '@rollup/rollup-linux-arm-gnueabihf@4.68.3': - resolution: {integrity: sha512-hbgT4NlaOELE3D5UUzSqF+OFgwz4Scvo2SQD9nZJUFjdIsg9Kg3FabQauUxkHKY9N5yjNXfXRRmiKNN4JpLmFA==} + '@rollup/rollup-linux-arm-gnueabihf@4.68.8': + resolution: {integrity: sha512-Qct0oLM1zGNbvqs1udQnuchg+Q9uHbkMcQqCfs3M7foNn7HvEkUypfFn9o5fklimUI5OF3A2nMknd4/vrEyeVg==} cpu: [arm] os: [linux] libc: [glibc] - '@rollup/rollup-linux-arm-musleabihf@4.68.3': - resolution: {integrity: sha512-yECcXZ/Bl+JVRhLFgld42rYrXgPdE0LtySGAmmmH6OtkaJM17A4cWG/eCzDymMVb52/jZjW0R54YrTHj4xXlSA==} + '@rollup/rollup-linux-arm-musleabihf@4.68.8': + resolution: {integrity: sha512-xTH5vD+lW/5MU3kL/Op8RSSG/O9fxUQZuJcSBmmBeYem9uXYvCq6PDHx/oDSNeyLD/p4pGujG2PVI0R8MjAhSw==} cpu: [arm] os: [linux] libc: [musl] - '@rollup/rollup-linux-arm64-gnu@4.68.3': - resolution: {integrity: sha512-q4Q4/B7wyqM+TFqY5tJYQlaz5+ksGopcRmMeMdu4q6eaPK7N1PymTjIaH5LL32mMJBqIzpRof7BhlYLim5JgNQ==} + '@rollup/rollup-linux-arm64-gnu@4.68.8': + resolution: {integrity: sha512-lPPStmynSHvwWpSrAsuemPFB+EWFObXjwz44EK4Hph47U6SBAk1Kehq5MkI7i8EYVjrXddaAV7YkJH8mX8QSZQ==} cpu: [arm64] os: [linux] libc: [glibc] - '@rollup/rollup-linux-arm64-musl@4.68.3': - resolution: {integrity: sha512-Ich3TGl/7GqhQ6G6jVPzgGQGJjd3E5hECxSVanPYchy6Vwcq+WI8wG/gmEMilHNy+ZYCR6U8EN50EejG3TaIgw==} + '@rollup/rollup-linux-arm64-musl@4.68.8': + resolution: {integrity: sha512-kZkvIYAihM6l6M+giSUHayDDf/JL+TYR5bYWiAX7/jUFWvMkMmysA4GV2F0HOsXQNEyctW3x1xLjww1GqW7Q1w==} cpu: [arm64] os: [linux] libc: [musl] - '@rollup/rollup-linux-loong64-gnu@4.68.3': - resolution: {integrity: sha512-URBmOhwv4Y0Hi5Hhxc3cmqZLtQlx55DOs5PUhhITDC3zu0qwAfhcNAFAIwAhOUdA6NFVEck07CNZX6cBEs1vTg==} + '@rollup/rollup-linux-loong64-gnu@4.68.8': + resolution: {integrity: sha512-XZKLEIY977OJr6zUtK6nlQcLXme34c8HqVp3+WmKQxKVN6Nj+b9qE3ZHWIDHXznHJsGl2AsaMOgB0GL0fkZGUg==} cpu: [loong64] os: [linux] libc: [glibc] - '@rollup/rollup-linux-loong64-musl@4.68.3': - resolution: {integrity: sha512-PTdJXuZplRyaE3ECArlbZubI2LlUHWm0oCipCexnE/8LM+L7qIqUiNbU0piBxt46EB5zxXX+cpmDvHX4Z3WwcQ==} + '@rollup/rollup-linux-loong64-musl@4.68.8': + resolution: {integrity: sha512-+sN+Fj6F9suk8SkL6boIfXDmj9iJwSKPCTeCy8/pfTOHuzNX+duhTb9uyj6154oVK8Odl5zgL4DXRZzXjsRKcw==} cpu: [loong64] os: [linux] libc: [musl] - '@rollup/rollup-linux-ppc64-gnu@4.68.3': - resolution: {integrity: sha512-IlSQPDExSm9YdtrWeZIHj87GPXI9lYygRvHVwQ1o9t91JHIiB2CihrvNIASpc/zI28atqm04jS3proaQuaJMww==} + '@rollup/rollup-linux-ppc64-gnu@4.68.8': + resolution: {integrity: sha512-EBCu3uDFaGwSodUl+XR8yubvVFUkSo6QK9YAIOV1vljqntzTF2/mXLM6utgLaSGf/8oM+qEe8Ai0Jd4+tyMoIQ==} cpu: [ppc64] os: [linux] libc: [glibc] - '@rollup/rollup-linux-ppc64-musl@4.68.3': - resolution: {integrity: sha512-O2ssyDcBTZkH5v2P/9ZaXJreL0hCKvUA5UwuHn0jCKeMLKi4GhspZJ1I5FT5QsHtJ/dPx4pup7pg/Lw0emeY0Q==} + '@rollup/rollup-linux-ppc64-musl@4.68.8': + resolution: {integrity: sha512-hRC0jWdsLBckCijx2wiUfk7zW1SqEW47yMsCNoDGmQfoqq0AjW+9UYZqxg3LTmG76PyHNdNGBSuspB3CqrhGIA==} cpu: [ppc64] os: [linux] libc: [musl] - '@rollup/rollup-linux-riscv64-gnu@4.68.3': - resolution: {integrity: sha512-fesqagxcnc87lH2+aBWne/tFCmQVIGH+YezjY1wQwbUODuTBBlhHoyxju6umwn8LnjHVanjpoeaQdLsXP8JQSQ==} + '@rollup/rollup-linux-riscv64-gnu@4.68.8': + resolution: {integrity: sha512-OZKrTRWyGnLITUTipbeXDdtb2dxQPyFk/Fbw9qER8pIvd2Ja9hHELkY0Fv5p9yYYkimqtzVhApKKXGv0cWGQGw==} cpu: [riscv64] os: [linux] libc: [glibc] - '@rollup/rollup-linux-riscv64-musl@4.68.3': - resolution: {integrity: sha512-WAjFDtLW3HjJ2RAytKoWdFwlK/hW8rJHrjhRZFw14nR+c9JN//WIlSBkyXUjEYCNOFs2sGLNutOEPQG4iVYHgA==} + '@rollup/rollup-linux-riscv64-musl@4.68.8': + resolution: {integrity: sha512-HmhSRSQ+dOeOntPfmYux4rCpOQLtsGbcGLQu4nm8ig3tuVqe/bKfDHorg36LKAqYq4X/nwFr79ImtaFHHsn4ug==} cpu: [riscv64] os: [linux] libc: [musl] - '@rollup/rollup-linux-s390x-gnu@4.68.3': - resolution: {integrity: sha512-+fZiTeHV/1fy/14dRqE4thjYwUOABL6qQjxElOEQg2oHLkCamO8dxhHphVgD4+pFxtVEUIWxsGVduPtwnAlvbg==} + '@rollup/rollup-linux-s390x-gnu@4.68.8': + resolution: {integrity: sha512-wk1Ci1hsMREaBELoKPSnzRAh1oUULI+8kfb2F5vVmTD2IcfR9AKMskCusizZhIAvojOtPZihPj4OdKy6ifZwhQ==} cpu: [s390x] os: [linux] libc: [glibc] - '@rollup/rollup-linux-x64-gnu@4.68.3': - resolution: {integrity: sha512-pfn4Zd9Ic3lEaSwW3GsQhTIDd7929C+eiEkOutsSCT2IHD6rDLblwmMQkgeGOso0oDo9Jk/ERtFdtFr9ElLs+g==} + '@rollup/rollup-linux-x64-gnu@4.68.8': + resolution: {integrity: sha512-mDufoUJ6fnKZnCyjV3sGEDvXQQkM6j1UmINHheGX4Emau3TZWJzX3sCVmbzkNB+W2G84BiFQdDCcF09lv0i0VA==} cpu: [x64] os: [linux] libc: [glibc] - '@rollup/rollup-linux-x64-musl@4.68.3': - resolution: {integrity: sha512-eUXzaeNQbKXKNqseL3g/usUqOPmRu+DbQsvwr9MXMdV+VQFUNb9bcWSNAAs/TRV95PCbFK46kLzHEOhFSzujsg==} + '@rollup/rollup-linux-x64-musl@4.68.8': + resolution: {integrity: sha512-7EGVL9rYRYQZe3UC8JQzfBN9rxk484Rfs4u/yGWumTYKUdJt6tmdP+0Y3qHvAvzJCQ+JQM5rSqZbVyrJARlGpA==} cpu: [x64] os: [linux] libc: [musl] - '@rollup/rollup-openbsd-x64@4.68.3': - resolution: {integrity: sha512-OiUclE7QDU4H/hr3ACRHhVGKWl+gNx+6Emignfq0hmNmzzTkZnT79wzB9NXKd0QH16S4t/wVqlAFBfC17nkZ5A==} + '@rollup/rollup-openbsd-x64@4.68.8': + resolution: {integrity: sha512-Umklz+QSGwKWQVlVrsMJrwFx1oNRYHgrxSGiZM8pJCMpzWnMDMinDhPILf0BvRXfA1QOArsDcs+AE7Jd6dQxvA==} cpu: [x64] os: [openbsd] - '@rollup/rollup-openharmony-arm64@4.68.3': - resolution: {integrity: sha512-s6EclDWmk6zvIfk1yixgYthk7xHNx0xu5cEF5RDpS4IHNTpfswRX6xOXVG5cHF5xWn0B6EpDGARhPQ520KTlsA==} + '@rollup/rollup-openharmony-arm64@4.68.8': + resolution: {integrity: sha512-BlRp6uzQDK5rczAdaXQ8dlSIRFRlkDRBqpb8GGtv8iwZxQdOjoigdFU5t5dcxpnpU0caMoT9mH27MyAl4dWwKw==} cpu: [arm64] os: [openharmony] - '@rollup/rollup-win32-arm64-msvc@4.68.3': - resolution: {integrity: sha512-G2xnmxGnU8XHLwtjnnXNRcLrub+Af3nm9VQ1QzL2aEiAL7woBdRgTCZBslJl8umA+YMqdEFpUh9kJB/Vyzk2wQ==} + '@rollup/rollup-win32-arm64-msvc@4.68.8': + resolution: {integrity: sha512-Sc8Mkf/fVfcV0hBJNDRIM82BjS4kJn2Of0jP8dgQ+TodquxtCZ/5D6FgSsY3uN5IBmNi8Zrb/OHd60IEYKaw+Q==} cpu: [arm64] os: [win32] - '@rollup/rollup-win32-ia32-msvc@4.68.3': - resolution: {integrity: sha512-Y/4tApNVrMUYWbAHsyRWJgwuuJOfhTNhA2B04Xpa6+G9btkPZ9kU3XagUKzPTwF3hg36NpQk748JsnoTVho67Q==} + '@rollup/rollup-win32-ia32-msvc@4.68.8': + resolution: {integrity: sha512-XPTFXclN+I+Cfu3ONWDsw+uvgSZjTJa1B2u2EvtdKlSdgNU6mrOZdgeaMkvN+2T2KPTEXn6fnRY8IODlRg3/Tg==} cpu: [ia32] os: [win32] - '@rollup/rollup-win32-x64-gnu@4.68.3': - resolution: {integrity: sha512-i2vH/OA5BcW+TdNg12ZTRC4rn+vILaPMP9CvHqnv+QEpMjBHGGNLo4k4EnEqzjYvTD6x1Xark9WhsQbH4bTzUQ==} + '@rollup/rollup-win32-x64-gnu@4.68.8': + resolution: {integrity: sha512-63dWiHgvpWcienfdr465lT3SIn4u3535vbDfaLKhSn0F2KJ06bbcUsewDGJZUPZCbJ67qESrPDhb85UnWdb5ew==} cpu: [x64] os: [win32] - '@rollup/rollup-win32-x64-msvc@4.68.3': - resolution: {integrity: sha512-ADb1Uz2MNM0sxVpAlMNdQG16Hw4sgW1aqVL7NeqBMpcZeiHb192d7W6shZdMQs33D+w9ihDYBBPsYqqc4MlD8w==} + '@rollup/rollup-win32-x64-msvc@4.68.8': + resolution: {integrity: sha512-/W1LBsMeQAdiCuH3Z2gkRspl3mlxL+butknhq4vXjmxO45vuT08BqhehxDoE4YS+m6s9lhpq6M9/PjTEAg8PYw==} cpu: [x64] os: [win32] @@ -4109,28 +4081,28 @@ packages: cpu: [x64, ia32] os: [win32] - '@testcontainers/mssqlserver@12.2.1': - resolution: {integrity: sha512-5PO5LOIc5mGp+iq27etwwO/NLY90nGhl3jjfisEuMQI9wAIASgX6qOrHNyDK4rSt+DOpW4oOX/NX8XavFr5KaA==} + '@testcontainers/mssqlserver@12.2.2': + resolution: {integrity: sha512-sdLT3TKng8inhyN3nNz5qwM1Bhgfz9UvZwdrIEYxwr+NKCfeiEwVn2pE9Ny2Ob4IyQDhyBazg5OM72BzbV+fkA==} - '@testcontainers/mysql@12.2.1': - resolution: {integrity: sha512-iNPquIpCf6MufZ1gVxIgKH1bXSkFkyagk7GGPq66oOzfq7Kt/b3gvPVfXWMZQfpxVPpzlEosAjDlUdZjxPwm4A==} + '@testcontainers/mysql@12.2.2': + resolution: {integrity: sha512-+W40Vg34Gfp3/SPRQwcpfFZL8M2z5ogw+Y6AJUg0ELawwdz7TD4DH8cWcEdbWS1sjdWgcvDAY30oaSDIiXFWww==} - '@testcontainers/postgresql@12.2.1': - resolution: {integrity: sha512-MIbI5KjZ9M4SY4+xzxg/w4ZLBeV+Jd6ognXoWn7dh/mhIhBbn7ss0MiZHNg2XbCbu03BW9YQ9+H9xW8PFkJWaA==} + '@testcontainers/postgresql@12.2.2': + resolution: {integrity: sha512-ePhFeUswU6aHJ1HETznfnVKuR0KYtGkMfqE1DTltgSt21WokXFby/I+c7g/fPXSE9sfxfE+GtyoUeohejpVcSA==} - '@testcontainers/redis@12.2.1': - resolution: {integrity: sha512-pF/HAs0LEsSfuQv++Wyp36S9cFNo8vfweddUOJQl/+wuAW1ThlupJLQv7L4PKkpqYGq+epRuaKhPrNKKnmbU3g==} + '@testcontainers/redis@12.2.2': + resolution: {integrity: sha512-Qf4l5sVKo7sxOBMfQYjLYMSIgsZU6Ia0jYsuH9jFoLJhJXInZoALjBjkCicFaHUvmqvm3RCdv0Cd9sntrAH14w==} '@testing-library/dom@10.4.2': resolution: {integrity: sha512-yzr2S9HyAIdhz2/6qHgbs665Q7PKVcDF05vsOlHPxG1mo36gKVesdYVeDLnXgfjJ03CrKRk08knc6+E/9m8v2Q==} engines: {node: '>=18'} - '@testing-library/jest-dom@7.0.1': - resolution: {integrity: sha512-oMDTC3oA+6CXSO2JZnvOI7CA6oVub6kij5ggk9ohwye5slmkwxYDXcPOVxgMw/RQlticjtO0C1RZkR97HgrWMw==} + '@testing-library/jest-dom@8.0.0': + resolution: {integrity: sha512-Nu45KEeFgP/ydCMipnisMblq6YHViqEFi3fKN0a40s+zdKDDD7vEPCEavS0i7i4RxmclcEIL8q2o42pu+WgNgg==} engines: {node: '>=22', npm: '>=6', yarn: '>=1'} peerDependencies: '@testing-library/dom': '>=10 <11' - vitest: '>= 0.32' + vitest: '>=5 <6' peerDependenciesMeta: vitest: optional: true @@ -4193,8 +4165,8 @@ packages: '@types/body-parser@1.19.6': resolution: {integrity: sha512-HLFeCYgz89uk22N5Qg3dvGvsv46B8GLvKKo1zKG4NybA8U2DiEO3w9lqGg29t/tfLRJpJ6iQxnVw4OnB7MoM9g==} - '@types/bun@1.4.4': - resolution: {integrity: sha512-9wkRDXUXK124pEnAutE6n/l18j+i9GC5IAHK8TmX/2nlySETmky0OU6yL5U8pW1AoKh++AN9auDCr647BfurjQ==} + '@types/bun@1.4.5': + resolution: {integrity: sha512-DpgwNI9z0L1S0gtb45QLCWgwCUcMLnsHYMJHQvpNj7erGiCGBvpggltAIeARrtobNMKMuy0UP7i56tKKgwFs/Q==} '@types/chai@5.2.3': resolution: {integrity: sha512-Mw558oeA9fFbv65/y4mHtXDs9bPnFMZAL/jxdPFUpOHHIXX91mcgEHbS5Lahr+pwZFR8A7GQleRWeI6cGFC2UA==} @@ -4202,6 +4174,9 @@ packages: '@types/connect@3.4.38': resolution: {integrity: sha512-K6uROf1LD88uDQqJCktA4yzL1YYAK6NgfsI0v/mTgyPKWsX1CnJ0XPSDhViejru1GcRkLWb8RlzFYJRqGUbaug==} + '@types/convert-source-map@2.0.3': + resolution: {integrity: sha512-ag0BfJLZf6CQz8VIuRIEYQ5Ggwk/82uvTQf27RcpyDNbY0Vw49LIPqAxk5tqYfrCs9xDaIMvl4aj7ZopnYL8bA==} + '@types/debug@4.1.13': resolution: {integrity: sha512-KSVgmQmzMwPlmtljOomayoR89W4FynCAi3E8PPs7vmDVPe84hT+vGPKkJfThkmXs0x0jAaa9U8uW8bbfyS2fWw==} @@ -4303,12 +4278,6 @@ packages: '@types/serve-static@1.15.10': resolution: {integrity: sha512-tRs1dB+g8Itk72rlSI2ZrW6vZg0YrLI81iQSTkMmOqnqCaNr/8Ek4VwWcN5vZgCYWbg/JJSGBlUaYGAOP73qBw==} - '@types/ssh2-streams@0.1.13': - resolution: {integrity: sha512-faHyY3brO9oLEA0QlcO8N2wT7R0+1sHWZvQ+y3rMLwdY1ZyS1z0W3t65j9PqT4HmQ6ALzNe7RZlNuCNE0wBSWA==} - - '@types/ssh2@0.5.52': - resolution: {integrity: sha512-lbLLlXxdCZOSJMCInKH2+9V/77ET2J6NPQHpFI0kda61Dd1KglJs+fPQBchizmzYSOJBgdTajhPqBO1xxLywvg==} - '@types/ssh2@1.15.6': resolution: {integrity: sha512-oGdxhBqcRTwSTKFm+9EiKzkNVYRLEFkcW44lhguvBalGJbWfGnDt/ezwSUZc+SF9m9bMc3VyklNAtp7zICjS5w==} @@ -4479,8 +4448,8 @@ packages: cpu: [x64] os: [win32] - '@typespec/ts-http-runtime@0.3.10': - resolution: {integrity: sha512-vddvvtZ7sejSlCv+OIkn2ztjB1O31Fc2JsxI/YK725r3elXXlF/J3o3lbXJFRhoeWRWK1tjdZ+GTi6Fdtrp+EA==} + '@typespec/ts-http-runtime@0.3.11': + resolution: {integrity: sha512-KZlacW7zFdcIOAcpNiV5U9fy0Tfgw7xdEc4rVyuUtQS+UR1Sn32PXuAz+AJ70Y0yzTWh62/pEEpFmWUJl6YySw==} engines: {node: '>=22.0.0'} '@vitest/coverage-v8@5.1.0': @@ -4519,32 +4488,32 @@ packages: peerDependencies: vitest: 5.1.0 - '@vue/compiler-core@3.5.45': - resolution: {integrity: sha512-XGHJrM6ufZARAc/w+tyOswStw9tdKiqCKBScI4gGaNxD+aaGu/HQWgKJ+JItjRLPqenQ7iE7G8AJC7T5ew1p+g==} + '@vue/compiler-core@3.5.46': + resolution: {integrity: sha512-yb+N8/mgBcoeqCJPVyJI/D3OphLrSMXnB3ZQUNmRLU/1fsMW4bFfdJWNi9oIj7+EA3ULKKkP7b/VCpcYQYeiuQ==} - '@vue/compiler-dom@3.5.45': - resolution: {integrity: sha512-LbP2d19GSOYGPmvMBBCVJVlv7TKtjM1Cfeyu3cYia720pknZP+1cLX7H5MVatvruT6MuJhiPuNbQBW/MDn/EwA==} + '@vue/compiler-dom@3.5.46': + resolution: {integrity: sha512-Bj3lCSw3DQnDRDxw115XqdLDd0+18Nftlgd8OXSGG+ud74hxJIE17eYrM+VWgQrTMsvJbLh9Hzf2MkwAzru36Q==} - '@vue/compiler-sfc@3.5.45': - resolution: {integrity: sha512-MKFjb2UX0M/l/jhfzqMLrI8VM4pfvFKG3pqFZkSZFHRLtNld/O4RtUPZFWSwhro/14qP88UQEkWzHxAZAQ0tsw==} + '@vue/compiler-sfc@3.5.46': + resolution: {integrity: sha512-hjUvMxGh+QIgegwksfp6BRBYleE/a8veZHvTR6sa+o+bM4HU+WnrUZlhN0X+pDcsl8Lhwmbu72xPvLMk3XUwog==} - '@vue/compiler-ssr@3.5.45': - resolution: {integrity: sha512-RF5sbZOfYz5AK00tOJUn2PwFXR2fS1u2HVzI8D9VF9rGAFxuGBqg2bB1kJ3ZHMprqSltXnT9MZE1IsqjSM8oew==} + '@vue/compiler-ssr@3.5.46': + resolution: {integrity: sha512-qebChL3aP0m1k+TlSf+fZWvOwAf3flBCi5o+n01ykR3DX4mTIWheFltmoiQ12+z66/4cGeXqbB2P7sPWkGhQNQ==} - '@vue/reactivity@3.5.45': - resolution: {integrity: sha512-WqkyubNWpI4OYBOipSrjIssMdJO8K1i9Zts/Wm8Er10/0msOEwCyWWWvZnAI7WW3kQsTong6DJp8Cbb+vd4cPA==} + '@vue/reactivity@3.5.46': + resolution: {integrity: sha512-+FHtYTvGxgFoX3oRs7soz6JHizGv50Q26WJN6PWtXuTLXRfkfUpDUTRuoTA/kiZVVt8NMeMpsPQLh9h++ReUjQ==} - '@vue/runtime-core@3.5.45': - resolution: {integrity: sha512-bzIO3+FABjpj85uIKSc+Qnj36/sxDNI3tcH9i6w6xKA1k6e0ejv0G0jMCfeJBvK3yGL5XbJ3DMZj+ClqyCHFYw==} + '@vue/runtime-core@3.5.46': + resolution: {integrity: sha512-eJUzKAUaHAmtnys/l9qduPzUnBrYMkmsCU7TN+vbSOSpm8kcETT7nacKxIO4MBej/XiOraVzq+lSeZv7o1//jQ==} - '@vue/runtime-dom@3.5.45': - resolution: {integrity: sha512-ZvRTFMDgfqTDYWvJfoVpQTJx1RN5M6l7Pyd6wfdY2NaXzbPQVh9ezeQYFbNPP6bIcRVn2SqSSR25N/jSW69BFw==} + '@vue/runtime-dom@3.5.46': + resolution: {integrity: sha512-6L7lbBvXTYBFFjIt25a0pgdpmn3Ns8RqUnNVibRzF4bgyiWJvqOhKEV5MXYWKlCttZE3aGeJN8mveo+6IrIKXA==} - '@vue/server-renderer@3.5.45': - resolution: {integrity: sha512-1fNXUHhhsWf4EVL4XixbGBU5mKdiIXJAB82feHRTyPPo6ZUEYWIJuEeUl3mVV6QDBp50HJOX4obLhxYXlrjrzA==} + '@vue/server-renderer@3.5.46': + resolution: {integrity: sha512-4mc0YWREc6OZ5pDCigvKPDzIUV+aciiH92yvyTS6xaHHxW/80rMceQQn11pYe7OEEBt2YQgYWR9zF8QF30GJUQ==} - '@vue/shared@3.5.45': - resolution: {integrity: sha512-ue9fgHmVNPlP7iW3+cxoBX/Cnlw53dHlVSw0JKGY6z1lObg8pHoj928M2nzG4/yVsMZ3NaRZ2s2z61uC16NDwQ==} + '@vue/shared@3.5.46': + resolution: {integrity: sha512-P1WePbdzHrcIciWtmY2Im9EFhdakd3rZxYqvalOa3SfoxtF35Q8Uhmj1tKn6bWP4utcOpN8ao6BoJUItq0Uf+g==} abort-controller@3.0.0: resolution: {integrity: sha512-h8lQ8tacZYnR3vNQTgibj+tODHI5/+l06Au2Pcriv/Gmet0eaj4TwWH41sO9wnHDiQsEj19q0drzdWdeAHtweg==} @@ -4563,10 +4532,6 @@ packages: resolution: {integrity: sha512-MnA+YT8fwfJPgBx3m60MNqakm30XOkyIoH1y6huTQvC0PwZG7ki8NacLBcrPbNoo8vEZy7Jpuk7+jMO+CUovTQ==} engines: {node: '>= 14'} - agent-base@9.0.0: - resolution: {integrity: sha512-TQf59BsZnytt8GdJKLPfUZ54g/iaUL2OWDSFCCvMOhsHduDQxO8xC4PNeyIkVcA5KwL2phPSv0douC0fgWzmnA==} - engines: {node: '>= 20'} - ajv-draft-04@1.0.0: resolution: {integrity: sha512-mv00Te6nmYbRp5DCwclxtt7yV/joXJPGS7nM+97GdxvuttCOfgI3K4U25zboyeX0O+myI8ERluxQe5wljMmVIw==} peerDependencies: @@ -4679,8 +4644,8 @@ packages: ast-v8-to-istanbul@1.0.7: resolution: {integrity: sha512-kFL68AG6ajd8fg248zwM9GQrUWEp79gsmjum34OEXjs4yHuUMZfYKwOLW9GMmB4oNvVrj+EAGxsP7ye2UR9UlA==} - async-lock@1.4.1: - resolution: {integrity: sha512-Az2ZTpuytrtqENulXwO3GGv1Bztugx6TT37NIo7imr/Qo0gsYiGtSdBa2B6fsXhTpVZDNfu1Qn3pk531e3q+nQ==} + async-lock@1.5.0: + resolution: {integrity: sha512-JgULma1mWaHlyJ67lvicyel5Cq+k55bXafE0gyvJBdHkH0vdE/IGGDF1glNyRInisNS6pZL2oho96S6Hw68kfQ==} async@3.2.6: resolution: {integrity: sha512-htCUDlxyyCLMgaM3xXg0C0LW2xqfuQ6p05pCEIsXuyQ+a1koYKTuBMzRNwmybfLgvJDMd0r1LTn4+E0Ti6C2AA==} @@ -4848,8 +4813,8 @@ packages: resolution: {integrity: sha512-lHblz4ahamxpTmnsk+MNTRWsjYKv965MwOrSJyeD588rR3Jcu7swE+0wN5F+PbL5cjgu/9ObkhfzEPuofEMwLA==} engines: {node: '>=10.0.0'} - bun-types@1.4.4: - resolution: {integrity: sha512-yjrJh5oGX7mMPKGd19YXyIjmEuj4G4zNC30bs7PM9Az7NQ3ndF3j6hbeRdvJTRQEhJ/FYQwW0a2moweEi2hMxQ==} + bun-types@1.4.5: + resolution: {integrity: sha512-ECHn+9dhL3wv0G6u0+7dQvrnaimXiRDxxerYBmhTaLyJEEuvTPWk2Fye3XIf5Y++JIIiHKfQw4Z7V5D8KuiXbg==} bundle-name@4.1.1: resolution: {integrity: sha512-DdH81/zPLVS11EUgWq3tEu/xn+EzljlMYooDNdzWEnFha3R3NBMpMV1UqYIpjYHV/SgpFKMIX1Oh7o06SjM/oA==} @@ -5050,8 +5015,8 @@ packages: css.escape@1.5.1: resolution: {integrity: sha512-YUifsXXuknHlUsmlgyY0PKzgPOr7/FjCePfHNt0jxm83wHZi44VDMQ7/fGNkjY3/jV1MC+1CmZbaHzugyeRtpg==} - csstype@3.2.3: - resolution: {integrity: sha512-z1HGKcYy2xA8AGQfwrn0PAy+PB7X/GSj3UVJW9qKyn43xWa+gl5nXmU4qqLMRzWVLFC8KusUX8T/0kCiOYpAIQ==} + csstype@3.2.4: + resolution: {integrity: sha512-PoKaoPzQapnEoqUSnHx1u6W6ku8CVEgKsnpmmzU3m1nwkidpPBQ8V/Zq2+bWNrsOKoKLwTGdbx6xF7BXP1zLVQ==} data-urls@7.0.0: resolution: {integrity: sha512-23XHcCF+coGYevirZceTVD7NdJOqVn+49IHyxgszm+JIiHLoB2TkmPtsYkNWT1pvRSGkc35L6NHs0yHkN2SumA==} @@ -5215,8 +5180,8 @@ packages: dom-accessibility-api@0.6.3: resolution: {integrity: sha512-7ZgogeTnjuHbo+ct10G9Ffp0mif17idi0IyWNVA/wcwcm7NPOD/WEHVP3n7n3MhXqxoIYm8d6MuZohYWIZ4T3w==} - dprint@0.64.3: - resolution: {integrity: sha512-/ENhr1iBM1ZfDBdLRCwSuOZ6SCv6cN6Tl3xvtJDHJbFJYjiYy6AHrzPtU/FSCvEG16YTcCNqkO/xDBxaDHIh8w==} + dprint@0.65.0: + resolution: {integrity: sha512-K7z0wMfGYAQejZ7T4iOMlEaqLtCKnueJsZ4HVjBP9VCik/zS2opp2qxO4lU1zJDhPsyfm3vSoZwulvSDGV0RVw==} hasBin: true eastasianwidth@0.2.0: @@ -5372,8 +5337,8 @@ packages: resolution: {integrity: sha512-mpVW/HLUqwKXJ6F/s0hMgdK1eQfM4ncTHDioNGHWL0WKV3VcZCoZq1NKgboBbAge07aRCO7L48yziKssL59XEQ==} engines: {node: '>=18'} - fast-check@4.10.2: - resolution: {integrity: sha512-iK2f+YrcmoeGqk6fA0ea2bptcu/itMIm4NfEozq6N25+aG6h7s5HZbB/k1aV7b5w5sFLMCbbtRUsTVR+BgC3xw==} + fast-check@4.10.3: + resolution: {integrity: sha512-SBaU6nhh+sXxb05r2IHAKfxnR/1Pu6MqtHYaewM1BY6V5xzOxOk+4yoWO7WfeeyZG1iArFE6/DO/7iLYMUuOJg==} engines: {node: '>=12.17.0'} fast-deep-equal@3.1.3: @@ -5583,8 +5548,8 @@ packages: hermes-parser@0.35.0: resolution: {integrity: sha512-9JLjeHxBx8T4CAsydZR49PNZUaix+WpQJwu9p2010lu+7Kwl6D/7wYFFJxoz+aXkaaClp9Zfg6W6/zVlSJORaA==} - hono@4.13.18: - resolution: {integrity: sha512-H9q/E1XizaWstJxUW881dmLxEj+t/TrGGnyxINkm4+sK0qUwsMtFdo2BWI9Vs3cIS19MU6b6iCijoUoEf4f3DA==} + hono@4.13.19: + resolution: {integrity: sha512-KmXvQAXwcAHV+muzbIwoJ23niEB5nMoDVr9WcRkU8mvjUECm/1+7v4Jgp7P7a+H6MLFrh+vXrGonGrGS+RQfkA==} engines: {node: '>=16.9.0'} html-encoding-sniffer@6.0.0: @@ -5595,9 +5560,9 @@ packages: resolution: {integrity: sha512-4FbRdAX+bSdmo4AUFuS0WNiPz8NgFt+r8ThgNWmlrjQjt1Q7ZR9+zTlce2859x4KSXrwIsaeTqDoKQmtP8pLmQ==} engines: {node: '>= 0.8'} - http-proxy-agent@9.1.0: - resolution: {integrity: sha512-2NxoveTT58mjYT4n3RPTEfCZGLMbidoO8XEieXfpSYxu+PQJ1qpx4ypwH6N+uF9twBPIvRRgvkvW5HUTYWENig==} - engines: {node: '>= 20'} + http-proxy-agent@7.0.2: + resolution: {integrity: sha512-T1gkAiYYDWYx3V5Bmyu7HcfcvL7mUrTWiM6yOfa3PIphViJ/gFPbvidQ+veqSOHci/PxBcDabeUNCzpOODJZig==} + engines: {node: '>= 14'} http2-client@1.3.5: resolution: {integrity: sha512-EC2utToWl4RKfs5zd36Mxq7nzHHBuomZboI0yYL6Y0RmBgT7Sgkq4rQ0ezFTYoIsSs7Tm9SJe+o2FcAg6GBhGA==} @@ -5606,10 +5571,6 @@ packages: resolution: {integrity: sha512-vK9P5/iUfdl95AI+JVyUuIcVtd4ofvtrOr3HNtM2yxC9bnMbEdp3x01OhQNnjb8IJYi38VlTE3mBXwcfvywuSw==} engines: {node: '>= 14'} - https-proxy-agent@9.1.0: - resolution: {integrity: sha512-ag87y7cJJ9/3+GxFr8Oy4O5faDsGRGnBGsJj/YjOSsSx/5eadKLYTMPlzuR6obgoCDDm0abAAZitXXQkMOPSpA==} - engines: {node: '>= 20'} - human-id@4.2.2: resolution: {integrity: sha512-Z+8unD6em/MJwyrkWQ2M3wygRGI1+MztbutiNwk1DCuEPXOZRWGjtcMPZYP1exY9iNZMhd7ZOSMQSo9WYtiQRw==} hasBin: true @@ -5816,8 +5777,8 @@ packages: jju@1.4.0: resolution: {integrity: sha512-8wb9Yw966OSxApiCt0K3yNJL8pnNeIv+OEq2YMidz4FKP6nonSRoOXc80iXY4JaN2FC11B9qsNmDsm+ZOfMROA==} - jose@6.2.17: - resolution: {integrity: sha512-wOuK9V1yujQFH5S0ZWmLcDZN7+IKh9bUCC2ZPCf2HDlol3WWHy+PPyNjEI75FXRLMp3vDKQcupP59xhVU95hcg==} + jose@6.2.18: + resolution: {integrity: sha512-doV4thUwgkrycJH4yLeqwTGIIZphHl+pk7CPReuMIhYhncmgzdko85MaCG4YQFTxqMFr1/oEH32tZuKKovcDEg==} js-base64@3.9.6: resolution: {integrity: sha512-LjkzbLtU6Lx6fjXMYGEACEB7rdtqZtxkBe9aS1ZpDNUyWgUivw3yBEIhQ37OVygJYRt+C+9e9fVT8PpFzH2Hww==} @@ -6502,8 +6463,8 @@ packages: resolution: {integrity: sha512-71kFFjYaSshDTA8/a2HiTYPLdASWjLJxUyJxGE+ffxU+KhxSBtM9kiLUX+R2yooFdSFKMFpi4n3PFtDy6qXv8A==} engines: {node: '>=18'} - nodemailer@10.5.0: - resolution: {integrity: sha512-L/w/HH5MqpzMDuZD7fQdt/+KqymuvrpaApaIjAH2XA3ILePwlcvXCVVvP75xVrXCEt2ggK2marrrHHFB5Qu0kA==} + nodemailer@10.6.1: + resolution: {integrity: sha512-d7kfFfS/tR4Aca+SBvRaQ+MXKNv7d2JiRe5TxaRcFT/kYMh4GGPnW9aKksTIEvyEbA7d/7HYWE4YPDEHxzJj/g==} engines: {node: '>=20.0.0'} normalize-path@3.0.0: @@ -6577,12 +6538,12 @@ packages: resolution: {integrity: sha512-5b6Y85tPxZZ7QytO+BQzysW31HJku27cRIlkbAXaNx+BdcVi+LlRFmVXzeF6a7JCwJpyw5c4b+YSVImQIrBpuQ==} engines: {node: '>=10'} - oxlint@1.93.0: - resolution: {integrity: sha512-19JMsQFX+YvEbcUTFQxjTwhvs0Ibg0D6CFneSLgpwnACWcY/6LjhpGpkPodh0T5aIT1pjMTLlYaeBFzaVgugTA==} + oxlint@1.94.0: + resolution: {integrity: sha512-Fnt+3wSKRhtLmvgRfxgRX0excSPCoyiXRol4eWKZLtXxWMQtwQ3KjKQUYXOw5loyinfnZfGzh4RCYf7opfL0vw==} engines: {node: ^20.19.0 || >=22.12.0} hasBin: true peerDependencies: - oxlint-tsgolint: '>=7.0.2005' + oxlint-tsgolint: '>=7.0.2007' vite-plus: '*' peerDependenciesMeta: oxlint-tsgolint: @@ -6690,8 +6651,8 @@ packages: resolution: {integrity: sha512-HRDzbaKjC+AOWVXxAU/x54COGeIv9eb+6CkDSQoNTt4XyWoIJvuPsXizxu/Fr23EiekbtZwmh1IcIG/l/a10GQ==} engines: {node: '>=8'} - pkg-pr-new@0.0.93: - resolution: {integrity: sha512-JH3HEO+m8sNFpalNAeGrNKjdwxNcXT3yuEuGMU/65dvLojPo+Ofnmc8la2v2ceisjXTOKQw/738Pj4KNFY7F+w==} + pkg-pr-new@0.0.94: + resolution: {integrity: sha512-+s3ZZl1Vt3wHfsIRH+chHG6/3wsu1N+Z5jitNYAPc0GGCYR8xmju34UShzTAMosi4WAYFCXvp80LZZc/fXSdpQ==} hasBin: true playwright-core@1.65.1: @@ -6776,15 +6737,6 @@ packages: resolution: {integrity: sha512-d9e9179bjXSJdpJ3+R9fP8hzXsnKLyxTjHLG1dUzje8a27pPyXCe6PrcRtgx2rjoM3IZzHd2vAs+6J/BsO1k7Q==} engines: {node: '>=12.0.0'} - proxy-agent-negotiate@1.1.0: - resolution: {integrity: sha512-N8IBcM3UgCVzz2L2Lqv8DVntDnnC8/hiV4nEDUPkqq72TPUgYWjQc+bdZlBPZK9LzPAvOY//gAt0S0DApoOXWQ==} - engines: {node: '>= 20'} - peerDependencies: - kerberos: ^2.0.0 - peerDependenciesMeta: - kerberos: - optional: true - pump@3.0.4: resolution: {integrity: sha512-VS7sjc6KR7e1ukRFhQSY5LM2uBWAUPiOPa/A3mkKmiMwSmRFUITt0xuj+/lesgnCv+dPIEYlkzrcyXgquIHMcA==} @@ -6960,8 +6912,8 @@ packages: engines: {node: ^20.19.0 || >=22.12.0} hasBin: true - rolldown@1.3.2: - resolution: {integrity: sha512-EFHqbVkXiYZA6akmYm2bvJhNbEGdUwAResRhYwl/BO8QhB5KxsG+t3RVHJSIOy5jBEb0XCACvrIGnnl6Z8sMGA==} + rolldown@1.3.3: + resolution: {integrity: sha512-ksB1g74e7haRy02OYm4lOQAlr6sK6hBpAY5R+YC30Gkv4L1COwF6M9umBAYAPxWpGow6Vr+IXtyDjH9fq7A+Zg==} engines: {node: ^20.19.0 || >=22.12.0} hasBin: true @@ -7030,8 +6982,8 @@ packages: vite: optional: true - rollup@4.68.3: - resolution: {integrity: sha512-wd2gavj7CEQv52rdcVqfUupO/KPIKcoJKxyFWl4cOqYZGMQEOSijJRkliz0dRa7gpkj/h4TRqyWa+dJJi6T0OA==} + rollup@4.68.8: + resolution: {integrity: sha512-IHx4DeeTGhoAPke6p1Wlg0JEQFyQoZQQjEe1iD+nhEERk7eoeHK9zyOpVJiGc54Z1MCgI96rN1tD7Ttub8XyPA==} engines: {node: '>=18.0.0', npm: '>=8.0.0'} hasBin: true @@ -7193,9 +7145,9 @@ packages: solid-js@1.9.19: resolution: {integrity: sha512-NIrV/6o1FtmrA9iuAAYvnQJZaHrGcaH3LKSVj4kCiZfwqjCtJNDgIgR9XcqYl6KR/Lb3oRx1HrlyswPWR8SRvw==} - source-map-js@1.2.2: - resolution: {integrity: sha512-KGj/8Y43x35aZVDtt+J4mK1hoLGHULMYfSkODJNQjNDC3oW1PqPoxMwo0pLUsWM/UEGzON/NxeHywEfNXNP3Vw==} - engines: {node: '>=0.10.0'} + source-map-js@1.2.4: + resolution: {integrity: sha512-J7ZjMvHd9O1fcT/5V09QWaaSl2BbWx3F6O08spde82Namf9UB0GxRVIPiNbVsdKkoizHiSpTodo3vp2bAy91MA==} + engines: {node: '>=6.0.0'} source-map-support@0.5.21: resolution: {integrity: sha512-uBHU3L3czsIyYXKX88fdrGovxdSCoTGDRZ6SYXtSRxLZUzHg5P/66Ht6uoUlHu9EZod+inXhKo3qQgwXUT/y1w==} @@ -7222,9 +7174,6 @@ packages: resolution: {integrity: sha512-6CKD38c31SENivxOADeMNLdukOnUxUcflKtzVWzace7Riv1v7cAEym5Cx9Q7gYZ3ezIJI7ZpqecQq8cqNeSSFg==} engines: {bun: '>=1.0.0', deno: '>=2.0.0', node: '>=12.0.0'} - ssh-remote-port-forward@1.0.4: - resolution: {integrity: sha512-x0LV1eVDwjf1gmG7TTnfqIzf+3VPRz7vrNIjX6oYLbeCrf/PeVY6hkT68Mg+q02qXxQhrLjB0jfgvhevoCRmLQ==} - ssh2@1.17.0: resolution: {integrity: sha512-wPldCk3asibAjQ/kziWQQt1Wh3PgDFpC0XpwclzKcdT1vql6KeYxf5LIt4nlFkUeR8WuphYMKqUA56X4rjbfgQ==} engines: {node: '>=10.16.0'} @@ -7373,15 +7322,15 @@ packages: resolution: {integrity: sha512-lkukzdoGngZHJZXxW4S/E4Fp9ghTDlyZXrQGRNoJ/LXvDKcXUTq2sg5yQe74po7Voea6n/IN09+wE/QvJMiifA==} engines: {node: '>=18'} - tedious@20.3.9: - resolution: {integrity: sha512-fiHhg1xcVWzUkJ6uIGFkN41xpC0J2B2W1/IaFSMt0StjEWyhcCUKp2wzXJRBtb0FZyB1HvbAx+n2Go3jf/aicg==} + tedious@20.4.1: + resolution: {integrity: sha512-6PwHbFQMu8Pxqyj8uF/LhteO6O1tT2g+WUs/XQPACVAzaxEpdtJWvpTPGNorljH0ye6wMbOuPaCaN8on4WjGaQ==} engines: {node: '>=22'} teex@1.0.1: resolution: {integrity: sha512-eYE6iEI62Ni1H8oIa7KlDU6uQBtqr4Eajni3wX7rpfXD8ysFx8z0+dri+KWEPWpBsxXfxu58x/0jvTVT1ekOSg==} - terser@5.51.2: - resolution: {integrity: sha512-bWnjSNscmuI+GJze6ZupnHP8G/cTcsJF+bXCeQknk2SHQsgbNJnLrqiH9jZ2W4STPVXH2mDKKRX3iwPhc9Cn/Q==} + terser@5.51.4: + resolution: {integrity: sha512-VPi1CkDvCWLGUVIToctNBG+NdHbSXwOPjHJnQ3pdB0XknaldnI76wSkAFOGxV2ZdkzOP5d6gpQ5c58XvDghRvw==} engines: {node: '>=10'} hasBin: true @@ -7389,8 +7338,8 @@ packages: resolution: {integrity: sha512-cAGWPIyOHU6zlmg88jwm7VRyXnMN7iV68OGAbYDk/Mh/xC/pzVPlQtY6ngoIH/5/tciuhGfvESU8GrHrcxD56w==} engines: {node: '>=8'} - testcontainers@12.2.1: - resolution: {integrity: sha512-JfbCyOvLdzatwgqUI3AvYCwRW0P5mCkKQVBPO8U5qSH1efC2kHvnfWmi9VHloy1rAFG2MEqWZObRH4bq0gU1kQ==} + testcontainers@12.2.2: + resolution: {integrity: sha512-ndmRB+wQnCd7YkelXoUtLVUFUQ3CrbIPmldSWzY8p1pXy09lBC/Hm99RYRCL2brHve/xNWCJX35173peMj5LUg==} engines: {node: '>= 22.22'} text-decoder@1.2.7: @@ -7405,8 +7354,8 @@ packages: tiny-invariant@1.3.3: resolution: {integrity: sha512-+FbBPE1o9QAYvviau/qC5SE3caw21q3xkvWKBtja5vgqOWIHHJ3ioaq1VPfn/Szqctz2bU/oYeKd9/z5BL+PVg==} - tinybench@6.2.3: - resolution: {integrity: sha512-Al01C2JIBnO2CXCAPbpAl6sUiOZHeThGtHYNTa51JRw9PyWOCdr+9Ong05R4qg/Sk3+H645E8ov1h2c58ityNw==} + tinybench@6.2.4: + resolution: {integrity: sha512-SQ52jEncXxbMCzJuY2A/jGIbbAu6NYsBWW7grz2pNE+EnzQdoGaoBfpk4qC/opE7qiUcGmGgaGIz5EoHdS1O9w==} engines: {node: '>=20.0.0'} tinyexec@1.3.1: @@ -7577,8 +7526,8 @@ packages: resolution: {integrity: sha512-IDxfleLmmbSskfWSUATiN1nfn2rDuvnMOqb5CWR92iIfojA0Ud+ulOAAEQ57LPr9rWmsreUyf5lwyao+7GNNVw==} engines: {node: '>=20.18.1'} - undici@8.12.4: - resolution: {integrity: sha512-8Mx+uNKKER2bA4AdtedkqRbwUCIJFr2nJckXRe5yrDqzePqwLP7VNcctN8/XdmDSbF7mS+jJKIszlL+vbam1VA==} + undici@8.13.1: + resolution: {integrity: sha512-Kt7EaPjh0s93lJH/PmW3d5rhkcpUa6fS3jqZ7+YGxNd9L7Xy/i827xe4C2uhhq+pJebM4tQOl5AgHmW11G5Skg==} engines: {node: '>=22.19.0'} unenv@2.0.0-rc.24: @@ -7724,8 +7673,8 @@ packages: vlq@1.0.1: resolution: {integrity: sha512-gQpnTgkubC6hQgdIcRdYGDSDc+SaujOdyesZQMv6JlfQee/9Mp0Qhnys6WxDWvQnL5WZdT7o2Ul187aSt0Rq+w==} - vue@3.5.45: - resolution: {integrity: sha512-3cvsib8m9c0vB24+MDKsgcW4+Da4xaBl9Z/5Tbm2pmSIsRPxcil4cdXjXlVsmJ2g64XJo5h+IRd7rsdGT9pZaw==} + vue@3.5.46: + resolution: {integrity: sha512-0kW5CgfjMPBqmH158049SaE1muufp+K/ZyrwvSEwrwYky6QB7zL2y8kXfruneKb9O12eh0xAJL6CVSpzb9o0Kg==} peerDependencies: typescript: '*' peerDependenciesMeta: @@ -7847,18 +7796,6 @@ packages: utf-8-validate: optional: true - ws@8.22.1: - resolution: {integrity: sha512-oyL6OPYme/CmiFvNuGzeoxCJ4nOrZE2O1FwM9MWM1AsGri6nLXB2pg+lNA8aLeXMSav0J6eIVS1j6vUPzUtK9g==} - engines: {node: '>=10.0.0'} - peerDependencies: - bufferutil: ^4.0.1 - utf-8-validate: '>=5.0.2' - peerDependenciesMeta: - bufferutil: - optional: true - utf-8-validate: - optional: true - ws@8.23.0: resolution: {integrity: sha512-wCkmX8QMOrKjgO8HW2WyDbTSGeqkocxgDzS9iR79rEAexty6/2qzilx3Ag8Tqf9ykop3irLKle0MtVn5qjVnoQ==} engines: {node: '>=10.0.0'} @@ -7949,13 +7886,13 @@ snapshots: '@adobe/css-tools@4.5.0': {} - '@alchemy.run/acme@2.0.0-beta.87(alchemy@2.0.0-beta.87(@effect/platform-bun@4.1.4(effect@packages+effect))(@effect/platform-node@4.1.4(effect@packages+effect)(redis@6.3.1(@opentelemetry/api@1.10.0)))(@types/react@19.3.0)(effect@packages+effect)(react-devtools-core@6.1.5)(vite@8.3.8(@types/node@26.6.6)(esbuild@0.28.2)(terser@5.51.2)(tsx@4.23.15)(yaml@2.9.1))(ws@8.23.0))(effect@packages+effect)': + '@alchemy.run/acme@2.0.0-beta.87(alchemy@2.0.0-beta.87(@effect/platform-bun@4.1.5(effect@packages+effect))(@effect/platform-node@4.1.5(effect@packages+effect)(redis@6.3.1(@opentelemetry/api@1.10.0)))(@types/react@19.3.0)(effect@packages+effect)(react-devtools-core@6.1.5)(vite@8.3.8(@types/node@26.6.6)(esbuild@0.28.2)(terser@5.51.4)(tsx@4.23.15)(yaml@2.9.1))(ws@8.23.0))(effect@packages+effect)': dependencies: '@distilled.cloud/acme': 1.0.0-rc.20(effect@packages+effect) - alchemy: 2.0.0-beta.87(@effect/platform-bun@4.1.4(effect@packages+effect))(@effect/platform-node@4.1.4(effect@packages+effect)(redis@6.3.1(@opentelemetry/api@1.10.0)))(@types/react@19.3.0)(effect@packages+effect)(react-devtools-core@6.1.5)(vite@8.3.8(@types/node@26.6.6)(esbuild@0.28.2)(terser@5.51.2)(tsx@4.23.15)(yaml@2.9.1))(ws@8.23.0) + alchemy: 2.0.0-beta.87(@effect/platform-bun@4.1.5(effect@packages+effect))(@effect/platform-node@4.1.5(effect@packages+effect)(redis@6.3.1(@opentelemetry/api@1.10.0)))(@types/react@19.3.0)(effect@packages+effect)(react-devtools-core@6.1.5)(vite@8.3.8(@types/node@26.6.6)(esbuild@0.28.2)(terser@5.51.4)(tsx@4.23.15)(yaml@2.9.1))(ws@8.23.0) effect: link:packages/effect - '@alchemy.run/cloudflare-runtime@2.0.0-beta.87(@distilled.cloud/cloudflare@1.0.0-rc.20(effect@packages+effect))(@effect/platform-bun@4.1.4(effect@packages+effect))(@effect/platform-node@4.1.4(effect@packages+effect)(redis@6.3.1(@opentelemetry/api@1.10.0)))(@types/node@26.6.6)(effect@packages+effect)(rolldown@1.2.16)(typescript@7.0.2)(vite@8.3.8(@types/node@26.6.6)(esbuild@0.28.2)(terser@5.51.2)(tsx@4.23.15)(yaml@2.9.1))': + '@alchemy.run/cloudflare-runtime@2.0.0-beta.87(@distilled.cloud/cloudflare@1.0.0-rc.20(effect@packages+effect))(@effect/platform-bun@4.1.5(effect@packages+effect))(@effect/platform-node@4.1.5(effect@packages+effect)(redis@6.3.1(@opentelemetry/api@1.10.0)))(@types/node@26.6.6)(effect@packages+effect)(rolldown@1.2.16)(typescript@7.0.2)(vite@8.3.8(@types/node@26.6.6)(esbuild@0.28.2)(terser@5.51.4)(tsx@4.23.15)(yaml@2.9.1))': dependencies: '@alchemy.run/node-utils': 2.0.0-beta.87 '@cloudflare/unenv-preset': 2.16.2(unenv@2.0.0-rc.24)(workerd@1.20261026.1) @@ -7970,37 +7907,37 @@ snapshots: workerd: 1.20261026.1 yauzl: 3.4.0 optionalDependencies: - '@effect/platform-bun': 4.1.4(effect@packages+effect) - '@effect/platform-node': 4.1.4(effect@packages+effect)(redis@6.3.1(@opentelemetry/api@1.10.0)) + '@effect/platform-bun': 4.1.5(effect@packages+effect) + '@effect/platform-node': 4.1.5(effect@packages+effect)(redis@6.3.1(@opentelemetry/api@1.10.0)) rolldown: 1.2.16 - vite: 8.3.8(@types/node@26.6.6)(esbuild@0.28.2)(terser@5.51.2)(tsx@4.23.15)(yaml@2.9.1) + vite: 8.3.8(@types/node@26.6.6)(esbuild@0.28.2)(terser@5.51.4)(tsx@4.23.15)(yaml@2.9.1) transitivePeerDependencies: - '@types/node' - proxy-agent - typescript - '@alchemy.run/cloudflare@2.0.0-beta.87(@effect/platform-bun@4.1.4(effect@packages+effect))(@effect/platform-node@4.1.4(effect@packages+effect)(redis@6.3.1(@opentelemetry/api@1.10.0)))(@effect/sql-libsql@4.1.4(effect@packages+effect))(@effect/sql-mysql2@4.1.4(@types/node@26.6.6)(effect@packages+effect))(@effect/sql-pg@4.1.4(effect@packages+effect))(@types/node@26.6.6)(alchemy@2.0.0-beta.87(@effect/platform-bun@4.1.4(effect@packages+effect))(@effect/platform-node@4.1.4(effect@packages+effect)(redis@6.3.1(@opentelemetry/api@1.10.0)))(@types/react@19.3.0)(effect@packages+effect)(react-devtools-core@6.1.5)(vite@8.3.8(@types/node@26.6.6)(esbuild@0.28.2)(terser@5.51.2)(tsx@4.23.15)(yaml@2.9.1))(ws@8.23.0))(effect@packages+effect)(mysql2@3.24.6(@types/node@26.6.6))(typescript@7.0.2)(vite@8.3.8(@types/node@26.6.6)(esbuild@0.28.2)(terser@5.51.2)(tsx@4.23.15)(yaml@2.9.1))': + '@alchemy.run/cloudflare@2.0.0-beta.87(@effect/platform-bun@4.1.5(effect@packages+effect))(@effect/platform-node@4.1.5(effect@packages+effect)(redis@6.3.1(@opentelemetry/api@1.10.0)))(@effect/sql-libsql@4.1.5(effect@packages+effect))(@effect/sql-mysql2@4.1.5(@types/node@26.6.6)(effect@packages+effect))(@effect/sql-pg@4.1.5(effect@packages+effect))(@types/node@26.6.6)(alchemy@2.0.0-beta.87(@effect/platform-bun@4.1.5(effect@packages+effect))(@effect/platform-node@4.1.5(effect@packages+effect)(redis@6.3.1(@opentelemetry/api@1.10.0)))(@types/react@19.3.0)(effect@packages+effect)(react-devtools-core@6.1.5)(vite@8.3.8(@types/node@26.6.6)(esbuild@0.28.2)(terser@5.51.4)(tsx@4.23.15)(yaml@2.9.1))(ws@8.23.0))(effect@packages+effect)(mysql2@3.24.6(@types/node@26.6.6))(typescript@7.0.2)(vite@8.3.8(@types/node@26.6.6)(esbuild@0.28.2)(terser@5.51.4)(tsx@4.23.15)(yaml@2.9.1))': dependencies: - '@alchemy.run/acme': 2.0.0-beta.87(alchemy@2.0.0-beta.87(@effect/platform-bun@4.1.4(effect@packages+effect))(@effect/platform-node@4.1.4(effect@packages+effect)(redis@6.3.1(@opentelemetry/api@1.10.0)))(@types/react@19.3.0)(effect@packages+effect)(react-devtools-core@6.1.5)(vite@8.3.8(@types/node@26.6.6)(esbuild@0.28.2)(terser@5.51.2)(tsx@4.23.15)(yaml@2.9.1))(ws@8.23.0))(effect@packages+effect) - '@alchemy.run/cloudflare-runtime': 2.0.0-beta.87(@distilled.cloud/cloudflare@1.0.0-rc.20(effect@packages+effect))(@effect/platform-bun@4.1.4(effect@packages+effect))(@effect/platform-node@4.1.4(effect@packages+effect)(redis@6.3.1(@opentelemetry/api@1.10.0)))(@types/node@26.6.6)(effect@packages+effect)(rolldown@1.2.16)(typescript@7.0.2)(vite@8.3.8(@types/node@26.6.6)(esbuild@0.28.2)(terser@5.51.2)(tsx@4.23.15)(yaml@2.9.1)) - '@alchemy.run/docker': 2.0.0-beta.87(@effect/platform-bun@4.1.4(effect@packages+effect))(alchemy@2.0.0-beta.87(@effect/platform-bun@4.1.4(effect@packages+effect))(@effect/platform-node@4.1.4(effect@packages+effect)(redis@6.3.1(@opentelemetry/api@1.10.0)))(@types/react@19.3.0)(effect@packages+effect)(react-devtools-core@6.1.5)(vite@8.3.8(@types/node@26.6.6)(esbuild@0.28.2)(terser@5.51.2)(tsx@4.23.15)(yaml@2.9.1))(ws@8.23.0))(effect@packages+effect) - '@alchemy.run/sql': 2.0.0-beta.87(@effect/sql-libsql@4.1.4(effect@packages+effect))(@effect/sql-mysql2@4.1.4(@types/node@26.6.6)(effect@packages+effect))(@effect/sql-pg@4.1.4(effect@packages+effect))(alchemy@2.0.0-beta.87(@effect/platform-bun@4.1.4(effect@packages+effect))(@effect/platform-node@4.1.4(effect@packages+effect)(redis@6.3.1(@opentelemetry/api@1.10.0)))(@types/react@19.3.0)(effect@packages+effect)(react-devtools-core@6.1.5)(vite@8.3.8(@types/node@26.6.6)(esbuild@0.28.2)(terser@5.51.2)(tsx@4.23.15)(yaml@2.9.1))(ws@8.23.0))(effect@packages+effect)(mysql2@3.24.6(@types/node@26.6.6)) + '@alchemy.run/acme': 2.0.0-beta.87(alchemy@2.0.0-beta.87(@effect/platform-bun@4.1.5(effect@packages+effect))(@effect/platform-node@4.1.5(effect@packages+effect)(redis@6.3.1(@opentelemetry/api@1.10.0)))(@types/react@19.3.0)(effect@packages+effect)(react-devtools-core@6.1.5)(vite@8.3.8(@types/node@26.6.6)(esbuild@0.28.2)(terser@5.51.4)(tsx@4.23.15)(yaml@2.9.1))(ws@8.23.0))(effect@packages+effect) + '@alchemy.run/cloudflare-runtime': 2.0.0-beta.87(@distilled.cloud/cloudflare@1.0.0-rc.20(effect@packages+effect))(@effect/platform-bun@4.1.5(effect@packages+effect))(@effect/platform-node@4.1.5(effect@packages+effect)(redis@6.3.1(@opentelemetry/api@1.10.0)))(@types/node@26.6.6)(effect@packages+effect)(rolldown@1.2.16)(typescript@7.0.2)(vite@8.3.8(@types/node@26.6.6)(esbuild@0.28.2)(terser@5.51.4)(tsx@4.23.15)(yaml@2.9.1)) + '@alchemy.run/docker': 2.0.0-beta.87(@effect/platform-bun@4.1.5(effect@packages+effect))(alchemy@2.0.0-beta.87(@effect/platform-bun@4.1.5(effect@packages+effect))(@effect/platform-node@4.1.5(effect@packages+effect)(redis@6.3.1(@opentelemetry/api@1.10.0)))(@types/react@19.3.0)(effect@packages+effect)(react-devtools-core@6.1.5)(vite@8.3.8(@types/node@26.6.6)(esbuild@0.28.2)(terser@5.51.4)(tsx@4.23.15)(yaml@2.9.1))(ws@8.23.0))(effect@packages+effect) + '@alchemy.run/sql': 2.0.0-beta.87(@effect/sql-libsql@4.1.5(effect@packages+effect))(@effect/sql-mysql2@4.1.5(@types/node@26.6.6)(effect@packages+effect))(@effect/sql-pg@4.1.5(effect@packages+effect))(alchemy@2.0.0-beta.87(@effect/platform-bun@4.1.5(effect@packages+effect))(@effect/platform-node@4.1.5(effect@packages+effect)(redis@6.3.1(@opentelemetry/api@1.10.0)))(@types/react@19.3.0)(effect@packages+effect)(react-devtools-core@6.1.5)(vite@8.3.8(@types/node@26.6.6)(esbuild@0.28.2)(terser@5.51.4)(tsx@4.23.15)(yaml@2.9.1))(ws@8.23.0))(effect@packages+effect)(mysql2@3.24.6(@types/node@26.6.6)) '@distilled.cloud/aws': 1.0.0-rc.20(effect@packages+effect) '@distilled.cloud/aws4signer': 1.0.0-rc.20(effect@packages+effect) '@distilled.cloud/cloudflare': 1.0.0-rc.20(effect@packages+effect) '@distilled.cloud/core': 1.0.0-rc.20(effect@packages+effect) '@distilled.cloud/iceberg': 1.0.0-rc.20(effect@packages+effect) '@effect/sql-d1': 4.1.4(effect@packages+effect) - alchemy: 2.0.0-beta.87(@effect/platform-bun@4.1.4(effect@packages+effect))(@effect/platform-node@4.1.4(effect@packages+effect)(redis@6.3.1(@opentelemetry/api@1.10.0)))(@types/react@19.3.0)(effect@packages+effect)(react-devtools-core@6.1.5)(vite@8.3.8(@types/node@26.6.6)(esbuild@0.28.2)(terser@5.51.2)(tsx@4.23.15)(yaml@2.9.1))(ws@8.23.0) + alchemy: 2.0.0-beta.87(@effect/platform-bun@4.1.5(effect@packages+effect))(@effect/platform-node@4.1.5(effect@packages+effect)(redis@6.3.1(@opentelemetry/api@1.10.0)))(@types/react@19.3.0)(effect@packages+effect)(react-devtools-core@6.1.5)(vite@8.3.8(@types/node@26.6.6)(esbuild@0.28.2)(terser@5.51.4)(tsx@4.23.15)(yaml@2.9.1))(ws@8.23.0) effect: link:packages/effect pathe: 2.0.3 picomatch: 4.0.7 rolldown: 1.2.16 tinyglobby: 0.2.17 optionalDependencies: - '@effect/platform-bun': 4.1.4(effect@packages+effect) - '@effect/platform-node': 4.1.4(effect@packages+effect)(redis@6.3.1(@opentelemetry/api@1.10.0)) - vite: 8.3.8(@types/node@26.6.6)(esbuild@0.28.2)(terser@5.51.2)(tsx@4.23.15)(yaml@2.9.1) + '@effect/platform-bun': 4.1.5(effect@packages+effect) + '@effect/platform-node': 4.1.5(effect@packages+effect)(redis@6.3.1(@opentelemetry/api@1.10.0)) + vite: 8.3.8(@types/node@26.6.6)(esbuild@0.28.2)(terser@5.51.4)(tsx@4.23.15)(yaml@2.9.1) transitivePeerDependencies: - '@effect/sql-libsql' - '@effect/sql-mysql2' @@ -8011,13 +7948,13 @@ snapshots: - proxy-agent - typescript - '@alchemy.run/docker@2.0.0-beta.87(@effect/platform-bun@4.1.4(effect@packages+effect))(alchemy@2.0.0-beta.87(@effect/platform-bun@4.1.4(effect@packages+effect))(@effect/platform-node@4.1.4(effect@packages+effect)(redis@6.3.1(@opentelemetry/api@1.10.0)))(@types/react@19.3.0)(effect@packages+effect)(react-devtools-core@6.1.5)(vite@8.3.8(@types/node@26.6.6)(esbuild@0.28.2)(terser@5.51.2)(tsx@4.23.15)(yaml@2.9.1))(ws@8.23.0))(effect@packages+effect)': + '@alchemy.run/docker@2.0.0-beta.87(@effect/platform-bun@4.1.5(effect@packages+effect))(alchemy@2.0.0-beta.87(@effect/platform-bun@4.1.5(effect@packages+effect))(@effect/platform-node@4.1.5(effect@packages+effect)(redis@6.3.1(@opentelemetry/api@1.10.0)))(@types/react@19.3.0)(effect@packages+effect)(react-devtools-core@6.1.5)(vite@8.3.8(@types/node@26.6.6)(esbuild@0.28.2)(terser@5.51.4)(tsx@4.23.15)(yaml@2.9.1))(ws@8.23.0))(effect@packages+effect)': dependencies: - alchemy: 2.0.0-beta.87(@effect/platform-bun@4.1.4(effect@packages+effect))(@effect/platform-node@4.1.4(effect@packages+effect)(redis@6.3.1(@opentelemetry/api@1.10.0)))(@types/react@19.3.0)(effect@packages+effect)(react-devtools-core@6.1.5)(vite@8.3.8(@types/node@26.6.6)(esbuild@0.28.2)(terser@5.51.2)(tsx@4.23.15)(yaml@2.9.1))(ws@8.23.0) + alchemy: 2.0.0-beta.87(@effect/platform-bun@4.1.5(effect@packages+effect))(@effect/platform-node@4.1.5(effect@packages+effect)(redis@6.3.1(@opentelemetry/api@1.10.0)))(@types/react@19.3.0)(effect@packages+effect)(react-devtools-core@6.1.5)(vite@8.3.8(@types/node@26.6.6)(esbuild@0.28.2)(terser@5.51.4)(tsx@4.23.15)(yaml@2.9.1))(ws@8.23.0) effect: link:packages/effect rolldown: 1.2.16 optionalDependencies: - '@effect/platform-bun': 4.1.4(effect@packages+effect) + '@effect/platform-bun': 4.1.5(effect@packages+effect) '@alchemy.run/node-utils@2.0.0-beta.87': dependencies: @@ -8029,14 +7966,14 @@ snapshots: '@types/react': 19.3.0 react-devtools-core: 6.1.5 - '@alchemy.run/sql@2.0.0-beta.87(@effect/sql-libsql@4.1.4(effect@packages+effect))(@effect/sql-mysql2@4.1.4(@types/node@26.6.6)(effect@packages+effect))(@effect/sql-pg@4.1.4(effect@packages+effect))(alchemy@2.0.0-beta.87(@effect/platform-bun@4.1.4(effect@packages+effect))(@effect/platform-node@4.1.4(effect@packages+effect)(redis@6.3.1(@opentelemetry/api@1.10.0)))(@types/react@19.3.0)(effect@packages+effect)(react-devtools-core@6.1.5)(vite@8.3.8(@types/node@26.6.6)(esbuild@0.28.2)(terser@5.51.2)(tsx@4.23.15)(yaml@2.9.1))(ws@8.23.0))(effect@packages+effect)(mysql2@3.24.6(@types/node@26.6.6))': + '@alchemy.run/sql@2.0.0-beta.87(@effect/sql-libsql@4.1.5(effect@packages+effect))(@effect/sql-mysql2@4.1.5(@types/node@26.6.6)(effect@packages+effect))(@effect/sql-pg@4.1.5(effect@packages+effect))(alchemy@2.0.0-beta.87(@effect/platform-bun@4.1.5(effect@packages+effect))(@effect/platform-node@4.1.5(effect@packages+effect)(redis@6.3.1(@opentelemetry/api@1.10.0)))(@types/react@19.3.0)(effect@packages+effect)(react-devtools-core@6.1.5)(vite@8.3.8(@types/node@26.6.6)(esbuild@0.28.2)(terser@5.51.4)(tsx@4.23.15)(yaml@2.9.1))(ws@8.23.0))(effect@packages+effect)(mysql2@3.24.6(@types/node@26.6.6))': dependencies: - alchemy: 2.0.0-beta.87(@effect/platform-bun@4.1.4(effect@packages+effect))(@effect/platform-node@4.1.4(effect@packages+effect)(redis@6.3.1(@opentelemetry/api@1.10.0)))(@types/react@19.3.0)(effect@packages+effect)(react-devtools-core@6.1.5)(vite@8.3.8(@types/node@26.6.6)(esbuild@0.28.2)(terser@5.51.2)(tsx@4.23.15)(yaml@2.9.1))(ws@8.23.0) + alchemy: 2.0.0-beta.87(@effect/platform-bun@4.1.5(effect@packages+effect))(@effect/platform-node@4.1.5(effect@packages+effect)(redis@6.3.1(@opentelemetry/api@1.10.0)))(@types/react@19.3.0)(effect@packages+effect)(react-devtools-core@6.1.5)(vite@8.3.8(@types/node@26.6.6)(esbuild@0.28.2)(terser@5.51.4)(tsx@4.23.15)(yaml@2.9.1))(ws@8.23.0) effect: link:packages/effect optionalDependencies: - '@effect/sql-libsql': 4.1.4(effect@packages+effect) - '@effect/sql-mysql2': 4.1.4(@types/node@26.6.6)(effect@packages+effect) - '@effect/sql-pg': 4.1.4(effect@packages+effect) + '@effect/sql-libsql': 4.1.5(effect@packages+effect) + '@effect/sql-mysql2': 4.1.5(@types/node@26.6.6)(effect@packages+effect) + '@effect/sql-pg': 4.1.5(effect@packages+effect) mysql2: 3.24.6(@types/node@26.6.6) '@asamuzakjp/css-color@6.0.7': @@ -8060,10 +7997,9 @@ snapshots: '@azure/core-auth': 1.11.0(supports-color@10.2.2) '@azure/core-rest-pipeline': 1.25.0(supports-color@10.2.2) '@azure/core-tracing': 1.4.0 - '@typespec/ts-http-runtime': 0.3.10(supports-color@10.2.2) + '@typespec/ts-http-runtime': 0.3.11(supports-color@10.2.2) tslib: 2.9.1 transitivePeerDependencies: - - kerberos - supports-color '@azure/abort-controller@2.2.0': @@ -8076,7 +8012,6 @@ snapshots: '@azure/core-util': 1.14.0(supports-color@10.2.2) tslib: 2.9.1 transitivePeerDependencies: - - kerberos - supports-color '@azure/core-client@1.11.2(supports-color@10.2.2)': @@ -8089,7 +8024,6 @@ snapshots: '@azure/logger': 1.4.0(supports-color@10.2.2) tslib: 2.9.1 transitivePeerDependencies: - - kerberos - supports-color '@azure/core-lro@2.7.2(supports-color@10.2.2)': @@ -8099,7 +8033,6 @@ snapshots: '@azure/logger': 1.4.0(supports-color@10.2.2) tslib: 2.9.1 transitivePeerDependencies: - - kerberos - supports-color '@azure/core-paging@1.7.0': @@ -8115,10 +8048,9 @@ snapshots: '@azure/core-tracing': 1.4.0 '@azure/core-util': 1.14.0(supports-color@10.2.2) '@azure/logger': 1.4.0(supports-color@10.2.2) - '@typespec/ts-http-runtime': 0.3.10(supports-color@10.2.2) + '@typespec/ts-http-runtime': 0.3.11(supports-color@10.2.2) tslib: 2.9.1 transitivePeerDependencies: - - kerberos - supports-color '@azure/core-tracing@1.4.0': @@ -8128,10 +8060,9 @@ snapshots: '@azure/core-util@1.14.0(supports-color@10.2.2)': dependencies: '@azure/abort-controller': 2.2.0 - '@typespec/ts-http-runtime': 0.3.10(supports-color@10.2.2) + '@typespec/ts-http-runtime': 0.3.11(supports-color@10.2.2) tslib: 2.9.1 transitivePeerDependencies: - - kerberos - supports-color '@azure/identity@4.14.1(supports-color@10.2.2)': @@ -8149,7 +8080,6 @@ snapshots: open: 11.0.4 tslib: 2.9.1 transitivePeerDependencies: - - kerberos - supports-color '@azure/keyvault-common@2.1.1(supports-color@10.2.2)': @@ -8163,7 +8093,6 @@ snapshots: '@azure/logger': 1.4.0(supports-color@10.2.2) tslib: 2.9.1 transitivePeerDependencies: - - kerberos - supports-color '@azure/keyvault-keys@4.10.2(supports-color@10.2.2)': @@ -8180,15 +8109,13 @@ snapshots: '@azure/logger': 1.4.0(supports-color@10.2.2) tslib: 2.9.1 transitivePeerDependencies: - - kerberos - supports-color '@azure/logger@1.4.0(supports-color@10.2.2)': dependencies: - '@typespec/ts-http-runtime': 0.3.10(supports-color@10.2.2) + '@typespec/ts-http-runtime': 0.3.11(supports-color@10.2.2) tslib: 2.9.1 transitivePeerDependencies: - - kerberos - supports-color '@azure/msal-browser@5.29.0': @@ -8202,9 +8129,9 @@ snapshots: '@azure/msal-common': 16.16.1 jsonwebtoken: 9.0.3 - '@babel/cli@8.1.0(@babel/core@8.1.2)': + '@babel/cli@8.1.0(@babel/core@8.1.3)': dependencies: - '@babel/core': 8.1.2 + '@babel/core': 8.1.3 '@jridgewell/trace-mapping': 0.3.31 chokidar: 5.0.0 commander: 14.0.3 @@ -8247,16 +8174,17 @@ snapshots: transitivePeerDependencies: - supports-color - '@babel/core@8.1.2': + '@babel/core@8.1.3': dependencies: '@babel/code-frame': 8.0.6 - '@babel/generator': 8.1.2 + '@babel/generator': 8.1.3 '@babel/helper-compilation-targets': 8.0.7 - '@babel/helpers': 8.1.2 - '@babel/parser': 8.1.2 + '@babel/helpers': 8.1.3 + '@babel/parser': 8.1.3 '@babel/template': 8.1.2 - '@babel/traverse': 8.1.2 - '@babel/types': 8.1.2 + '@babel/traverse': 8.1.3 + '@babel/types': 8.1.3 + '@types/convert-source-map': 2.0.3 '@types/gensync': 1.0.5 convert-source-map: 2.0.0 empathic: 2.1.0 @@ -8274,19 +8202,10 @@ snapshots: '@jridgewell/trace-mapping': 0.3.31 jsesc: 3.1.0 - '@babel/generator@8.1.0': - dependencies: - '@babel/parser': 8.1.0 - '@babel/types': 8.1.0 - '@jridgewell/gen-mapping': 0.4.0-beta.0 - '@jridgewell/trace-mapping': 0.3.31 - '@types/jsesc': 2.5.1 - jsesc: 3.1.0 - - '@babel/generator@8.1.2': + '@babel/generator@8.1.3': dependencies: - '@babel/parser': 8.1.2 - '@babel/types': 8.1.2 + '@babel/parser': 8.1.3 + '@babel/types': 8.1.3 '@jridgewell/gen-mapping': 0.4.0-beta.0 '@jridgewell/trace-mapping': 0.3.31 '@types/jsesc': 2.5.1 @@ -8345,8 +8264,8 @@ snapshots: '@babel/helper-module-imports@8.0.0': dependencies: - '@babel/traverse': 8.1.0 - '@babel/types': 8.1.0 + '@babel/traverse': 8.1.3 + '@babel/types': 8.1.3 '@babel/helper-module-transforms@7.29.13(@babel/core@7.29.13(supports-color@10.2.2))(supports-color@10.2.2)': dependencies: @@ -8357,12 +8276,12 @@ snapshots: transitivePeerDependencies: - supports-color - '@babel/helper-module-transforms@8.1.2(@babel/core@8.1.2)': + '@babel/helper-module-transforms@8.1.3(@babel/core@8.1.3)': dependencies: - '@babel/core': 8.1.2 + '@babel/core': 8.1.3 '@babel/helper-module-imports': 8.0.0 '@babel/helper-validator-identifier': 8.0.6 - '@babel/traverse': 8.1.2 + '@babel/traverse': 8.1.3 '@babel/helper-optimise-call-expression@7.29.7': dependencies: @@ -8370,9 +8289,9 @@ snapshots: '@babel/helper-plugin-utils@7.29.7': {} - '@babel/helper-plugin-utils@8.0.1(@babel/core@8.1.2)': + '@babel/helper-plugin-utils@8.0.1(@babel/core@8.1.3)': dependencies: - '@babel/core': 8.1.2 + '@babel/core': 8.1.3 '@babel/helper-replace-supers@7.29.7(@babel/core@7.29.13(supports-color@10.2.2))(supports-color@10.2.2)': dependencies: @@ -8392,9 +8311,7 @@ snapshots: '@babel/helper-string-parser@7.29.13': {} - '@babel/helper-string-parser@8.0.8': {} - - '@babel/helper-string-parser@8.1.2': {} + '@babel/helper-string-parser@8.1.3': {} '@babel/helper-validator-identifier@7.29.7': {} @@ -8409,41 +8326,37 @@ snapshots: '@babel/template': 7.29.7 '@babel/types': 7.29.11 - '@babel/helpers@8.1.2': + '@babel/helpers@8.1.3': dependencies: '@babel/template': 8.1.2 - '@babel/types': 8.1.2 + '@babel/types': 8.1.3 '@babel/parser@7.29.13': dependencies: '@babel/types': 7.29.11 - '@babel/parser@8.1.0': - dependencies: - '@babel/types': 8.1.0 - - '@babel/parser@8.1.2': + '@babel/parser@8.1.3': dependencies: - '@babel/types': 8.1.2 + '@babel/types': 8.1.3 - '@babel/plugin-syntax-async-generators@7.8.4(@babel/core@8.1.2)': + '@babel/plugin-syntax-async-generators@7.8.4(@babel/core@8.1.3)': dependencies: - '@babel/core': 8.1.2 + '@babel/core': 8.1.3 '@babel/helper-plugin-utils': 7.29.7 - '@babel/plugin-syntax-bigint@7.8.3(@babel/core@8.1.2)': + '@babel/plugin-syntax-bigint@7.8.3(@babel/core@8.1.3)': dependencies: - '@babel/core': 8.1.2 + '@babel/core': 8.1.3 '@babel/helper-plugin-utils': 7.29.7 - '@babel/plugin-syntax-class-properties@7.12.13(@babel/core@8.1.2)': + '@babel/plugin-syntax-class-properties@7.12.13(@babel/core@8.1.3)': dependencies: - '@babel/core': 8.1.2 + '@babel/core': 8.1.3 '@babel/helper-plugin-utils': 7.29.7 - '@babel/plugin-syntax-class-static-block@7.14.5(@babel/core@8.1.2)': + '@babel/plugin-syntax-class-static-block@7.14.5(@babel/core@8.1.3)': dependencies: - '@babel/core': 8.1.2 + '@babel/core': 8.1.3 '@babel/helper-plugin-utils': 7.29.7 '@babel/plugin-syntax-flow@7.29.7(@babel/core@7.29.13(supports-color@10.2.2))': @@ -8451,19 +8364,19 @@ snapshots: '@babel/core': 7.29.13(supports-color@10.2.2) '@babel/helper-plugin-utils': 7.29.7 - '@babel/plugin-syntax-import-attributes@7.29.7(@babel/core@8.1.2)': + '@babel/plugin-syntax-import-attributes@7.29.7(@babel/core@8.1.3)': dependencies: - '@babel/core': 8.1.2 + '@babel/core': 8.1.3 '@babel/helper-plugin-utils': 7.29.7 - '@babel/plugin-syntax-import-meta@7.10.4(@babel/core@8.1.2)': + '@babel/plugin-syntax-import-meta@7.10.4(@babel/core@8.1.3)': dependencies: - '@babel/core': 8.1.2 + '@babel/core': 8.1.3 '@babel/helper-plugin-utils': 7.29.7 - '@babel/plugin-syntax-json-strings@7.8.3(@babel/core@8.1.2)': + '@babel/plugin-syntax-json-strings@7.8.3(@babel/core@8.1.3)': dependencies: - '@babel/core': 8.1.2 + '@babel/core': 8.1.3 '@babel/helper-plugin-utils': 7.29.7 '@babel/plugin-syntax-jsx@7.29.7(@babel/core@7.29.13(supports-color@10.2.2))': @@ -8471,44 +8384,44 @@ snapshots: '@babel/core': 7.29.13(supports-color@10.2.2) '@babel/helper-plugin-utils': 7.29.7 - '@babel/plugin-syntax-logical-assignment-operators@7.10.4(@babel/core@8.1.2)': + '@babel/plugin-syntax-logical-assignment-operators@7.10.4(@babel/core@8.1.3)': dependencies: - '@babel/core': 8.1.2 + '@babel/core': 8.1.3 '@babel/helper-plugin-utils': 7.29.7 - '@babel/plugin-syntax-nullish-coalescing-operator@7.8.3(@babel/core@8.1.2)': + '@babel/plugin-syntax-nullish-coalescing-operator@7.8.3(@babel/core@8.1.3)': dependencies: - '@babel/core': 8.1.2 + '@babel/core': 8.1.3 '@babel/helper-plugin-utils': 7.29.7 - '@babel/plugin-syntax-numeric-separator@7.10.4(@babel/core@8.1.2)': + '@babel/plugin-syntax-numeric-separator@7.10.4(@babel/core@8.1.3)': dependencies: - '@babel/core': 8.1.2 + '@babel/core': 8.1.3 '@babel/helper-plugin-utils': 7.29.7 - '@babel/plugin-syntax-object-rest-spread@7.8.3(@babel/core@8.1.2)': + '@babel/plugin-syntax-object-rest-spread@7.8.3(@babel/core@8.1.3)': dependencies: - '@babel/core': 8.1.2 + '@babel/core': 8.1.3 '@babel/helper-plugin-utils': 7.29.7 - '@babel/plugin-syntax-optional-catch-binding@7.8.3(@babel/core@8.1.2)': + '@babel/plugin-syntax-optional-catch-binding@7.8.3(@babel/core@8.1.3)': dependencies: - '@babel/core': 8.1.2 + '@babel/core': 8.1.3 '@babel/helper-plugin-utils': 7.29.7 - '@babel/plugin-syntax-optional-chaining@7.8.3(@babel/core@8.1.2)': + '@babel/plugin-syntax-optional-chaining@7.8.3(@babel/core@8.1.3)': dependencies: - '@babel/core': 8.1.2 + '@babel/core': 8.1.3 '@babel/helper-plugin-utils': 7.29.7 - '@babel/plugin-syntax-private-property-in-object@7.14.5(@babel/core@8.1.2)': + '@babel/plugin-syntax-private-property-in-object@7.14.5(@babel/core@8.1.3)': dependencies: - '@babel/core': 8.1.2 + '@babel/core': 8.1.3 '@babel/helper-plugin-utils': 7.29.7 - '@babel/plugin-syntax-top-level-await@7.14.5(@babel/core@8.1.2)': + '@babel/plugin-syntax-top-level-await@7.14.5(@babel/core@8.1.3)': dependencies: - '@babel/core': 8.1.2 + '@babel/core': 8.1.3 '@babel/helper-plugin-utils': 7.29.7 '@babel/plugin-syntax-typescript@7.29.7(@babel/core@7.29.13(supports-color@10.2.2))': @@ -8524,10 +8437,10 @@ snapshots: transitivePeerDependencies: - supports-color - '@babel/plugin-transform-export-namespace-from@8.1.0(@babel/core@8.1.2)': + '@babel/plugin-transform-export-namespace-from@8.1.3(@babel/core@8.1.3)': dependencies: - '@babel/core': 8.1.2 - '@babel/helper-plugin-utils': 8.0.1(@babel/core@8.1.2) + '@babel/core': 8.1.3 + '@babel/helper-plugin-utils': 8.0.1(@babel/core@8.1.3) '@babel/plugin-transform-flow-strip-types@7.29.7(@babel/core@7.29.13(supports-color@10.2.2))': dependencies: @@ -8543,11 +8456,11 @@ snapshots: transitivePeerDependencies: - supports-color - '@babel/plugin-transform-modules-commonjs@8.1.2(@babel/core@8.1.2)': + '@babel/plugin-transform-modules-commonjs@8.1.3(@babel/core@8.1.3)': dependencies: - '@babel/core': 8.1.2 - '@babel/helper-module-transforms': 8.1.2(@babel/core@8.1.2) - '@babel/helper-plugin-utils': 8.0.1(@babel/core@8.1.2) + '@babel/core': 8.1.3 + '@babel/helper-module-transforms': 8.1.3(@babel/core@8.1.3) + '@babel/helper-plugin-utils': 8.0.1(@babel/core@8.1.3) '@babel/plugin-transform-nullish-coalescing-operator@7.29.7(@babel/core@7.29.13(supports-color@10.2.2))': dependencies: @@ -8616,17 +8529,11 @@ snapshots: '@babel/parser': 7.29.13 '@babel/types': 7.29.11 - '@babel/template@8.0.0': - dependencies: - '@babel/code-frame': 8.0.6 - '@babel/parser': 8.1.0 - '@babel/types': 8.1.0 - '@babel/template@8.1.2': dependencies: '@babel/code-frame': 8.0.6 - '@babel/parser': 8.1.2 - '@babel/types': 8.1.2 + '@babel/parser': 8.1.3 + '@babel/types': 8.1.3 '@babel/traverse@7.29.13(supports-color@10.2.2)': dependencies: @@ -8640,24 +8547,14 @@ snapshots: transitivePeerDependencies: - supports-color - '@babel/traverse@8.1.0': - dependencies: - '@babel/code-frame': 8.0.6 - '@babel/generator': 8.1.0 - '@babel/helper-globals': 8.0.6 - '@babel/parser': 8.1.0 - '@babel/template': 8.0.0 - '@babel/types': 8.1.0 - obug: 3.0.0 - - '@babel/traverse@8.1.2': + '@babel/traverse@8.1.3': dependencies: '@babel/code-frame': 8.0.6 - '@babel/generator': 8.1.2 + '@babel/generator': 8.1.3 '@babel/helper-globals': 8.0.6 - '@babel/parser': 8.1.2 + '@babel/parser': 8.1.3 '@babel/template': 8.1.2 - '@babel/types': 8.1.2 + '@babel/types': 8.1.3 obug: 3.0.0 '@babel/types@7.29.11': @@ -8665,14 +8562,9 @@ snapshots: '@babel/helper-string-parser': 7.29.13 '@babel/helper-validator-identifier': 7.29.7 - '@babel/types@8.1.0': + '@babel/types@8.1.3': dependencies: - '@babel/helper-string-parser': 8.0.8 - '@babel/helper-validator-identifier': 8.0.6 - - '@babel/types@8.1.2': - dependencies: - '@babel/helper-string-parser': 8.1.2 + '@babel/helper-string-parser': 8.1.3 '@babel/helper-validator-identifier': 8.0.6 '@balena/dockerignore@1.0.2': {} @@ -8894,9 +8786,7 @@ snapshots: '@cloudflare/workerd-windows-64@1.20261026.1': optional: true - '@cloudflare/workers-types@5.20261107.1': {} - - '@cloudflare/workers-types@5.20261114.1': {} + '@cloudflare/workers-types@5.20261121.1': {} '@cspotcode/source-map-support@0.8.1': dependencies: @@ -8970,61 +8860,61 @@ snapshots: '@distilled.cloud/core': 1.0.0-rc.20(effect@packages+effect) effect: link:packages/effect - '@dprint/android-arm64@0.64.3': + '@dprint/android-arm64@0.65.0': optional: true - '@dprint/android-x64@0.64.3': + '@dprint/android-x64@0.65.0': optional: true - '@dprint/darwin-arm64@0.64.3': + '@dprint/darwin-arm64@0.65.0': optional: true - '@dprint/darwin-x64@0.64.3': + '@dprint/darwin-x64@0.65.0': optional: true - '@dprint/freebsd-arm64@0.64.3': + '@dprint/freebsd-arm64@0.65.0': optional: true - '@dprint/freebsd-x64@0.64.3': + '@dprint/freebsd-x64@0.65.0': optional: true - '@dprint/linux-arm64-glibc@0.64.3': + '@dprint/linux-arm64-glibc@0.65.0': optional: true - '@dprint/linux-arm64-musl@0.64.3': + '@dprint/linux-arm64-musl@0.65.0': optional: true - '@dprint/linux-loong64-glibc@0.64.3': + '@dprint/linux-loong64-glibc@0.65.0': optional: true - '@dprint/linux-loong64-musl@0.64.3': + '@dprint/linux-loong64-musl@0.65.0': optional: true - '@dprint/linux-ppc64-glibc@0.64.3': + '@dprint/linux-ppc64-glibc@0.65.0': optional: true - '@dprint/linux-ppc64-musl@0.64.3': + '@dprint/linux-ppc64-musl@0.65.0': optional: true - '@dprint/linux-riscv64-glibc@0.64.3': + '@dprint/linux-riscv64-glibc@0.65.0': optional: true - '@dprint/linux-riscv64-musl@0.64.3': + '@dprint/linux-riscv64-musl@0.65.0': optional: true - '@dprint/linux-s390x-glibc@0.64.3': + '@dprint/linux-s390x-glibc@0.65.0': optional: true - '@dprint/linux-x64-glibc@0.64.3': + '@dprint/linux-x64-glibc@0.65.0': optional: true - '@dprint/linux-x64-musl@0.64.3': + '@dprint/linux-x64-musl@0.65.0': optional: true - '@dprint/win32-arm64@0.64.3': + '@dprint/win32-arm64@0.65.0': optional: true - '@dprint/win32-x64@0.64.3': + '@dprint/win32-x64@0.65.0': optional: true '@edge-runtime/primitives@6.0.0': @@ -9050,16 +8940,16 @@ snapshots: repeat-string: 1.6.1 strip-color: 0.1.0 - '@effect/platform-bun@4.1.4(effect@packages+effect)': + '@effect/platform-bun@4.1.5(effect@packages+effect)': dependencies: - '@effect/platform-node-shared': 4.1.4(effect@packages+effect) + '@effect/platform-node-shared': 4.1.5(effect@packages+effect) effect: link:packages/effect transitivePeerDependencies: - bufferutil - utf-8-validate optional: true - '@effect/platform-node-shared@4.1.4(effect@packages+effect)': + '@effect/platform-node-shared@4.1.5(effect@packages+effect)': dependencies: '@types/ws': 8.18.2 effect: link:packages/effect @@ -9069,12 +8959,12 @@ snapshots: - utf-8-validate optional: true - '@effect/platform-node@4.1.4(effect@packages+effect)(redis@6.3.1(@opentelemetry/api@1.10.0))': + '@effect/platform-node@4.1.5(effect@packages+effect)(redis@6.3.1(@opentelemetry/api@1.10.0))': dependencies: - '@effect/platform-node-shared': 4.1.4(effect@packages+effect) + '@effect/platform-node-shared': 4.1.5(effect@packages+effect) effect: link:packages/effect redis: 6.3.1(@opentelemetry/api@1.10.0) - undici: 8.12.4 + undici: 8.13.1 transitivePeerDependencies: - bufferutil - utf-8-validate @@ -9082,10 +8972,10 @@ snapshots: '@effect/sql-d1@4.1.4(effect@packages+effect)': dependencies: - '@cloudflare/workers-types': 5.20261107.1 + '@cloudflare/workers-types': 5.20261121.1 effect: link:packages/effect - '@effect/sql-libsql@4.1.4(effect@packages+effect)': + '@effect/sql-libsql@4.1.5(effect@packages+effect)': dependencies: '@libsql/client': 0.18.0 effect: link:packages/effect @@ -9094,7 +8984,7 @@ snapshots: - utf-8-validate optional: true - '@effect/sql-mysql2@4.1.4(@types/node@26.6.6)(effect@packages+effect)': + '@effect/sql-mysql2@4.1.5(@types/node@26.6.6)(effect@packages+effect)': dependencies: effect: link:packages/effect mysql2: 3.24.6(@types/node@26.6.6) @@ -9102,45 +8992,45 @@ snapshots: - '@types/node' optional: true - '@effect/sql-pg@4.1.4(effect@packages+effect)': + '@effect/sql-pg@4.1.5(effect@packages+effect)': dependencies: effect: link:packages/effect optional: true - '@effect/tsgo-darwin-arm64@0.69.0': + '@effect/tsgo-darwin-arm64@0.73.2': optional: true - '@effect/tsgo-darwin-x64@0.69.0': + '@effect/tsgo-darwin-x64@0.73.2': optional: true - '@effect/tsgo-linux-arm64@0.69.0': + '@effect/tsgo-linux-arm64@0.73.2': optional: true - '@effect/tsgo-linux-arm@0.69.0': + '@effect/tsgo-linux-arm@0.73.2': optional: true - '@effect/tsgo-linux-x64@0.69.0': + '@effect/tsgo-linux-x64@0.73.2': optional: true - '@effect/tsgo-win32-arm64@0.69.0': + '@effect/tsgo-win32-arm64@0.73.2': optional: true - '@effect/tsgo-win32-x64@0.69.0': + '@effect/tsgo-win32-x64@0.73.2': optional: true - '@effect/tsgo@0.69.0': + '@effect/tsgo@0.73.2': optionalDependencies: - '@effect/tsgo-darwin-arm64': 0.69.0 - '@effect/tsgo-darwin-x64': 0.69.0 - '@effect/tsgo-linux-arm': 0.69.0 - '@effect/tsgo-linux-arm64': 0.69.0 - '@effect/tsgo-linux-x64': 0.69.0 - '@effect/tsgo-win32-arm64': 0.69.0 - '@effect/tsgo-win32-x64': 0.69.0 + '@effect/tsgo-darwin-arm64': 0.73.2 + '@effect/tsgo-darwin-x64': 0.73.2 + '@effect/tsgo-linux-arm': 0.73.2 + '@effect/tsgo-linux-arm64': 0.73.2 + '@effect/tsgo-linux-x64': 0.73.2 + '@effect/tsgo-win32-arm64': 0.73.2 + '@effect/tsgo-win32-x64': 0.73.2 '@effect/wa-sqlite@0.2.1': {} - '@electric-sql/pglite@0.5.16': {} + '@electric-sql/pglite@0.5.17': {} '@emnapi/core@2.0.0-beta.2': dependencies: @@ -9784,7 +9674,7 @@ snapshots: '@libsql/isomorphic-ws@0.1.5': dependencies: '@types/ws': 8.18.2 - ws: 8.22.1 + ws: 8.23.0 transitivePeerDependencies: - bufferutil - utf-8-validate @@ -9834,10 +9724,10 @@ snapshots: '@neon-rs/load@0.0.4': {} - '@op-engineering/op-sqlite@18.2.5(react-native@0.83.0(@babel/core@8.1.2)(@types/react@19.3.0)(react@19.3.1)(supports-color@10.2.2))(react@19.3.1)': + '@op-engineering/op-sqlite@18.2.5(react-native@0.83.0(@babel/core@8.1.3)(@types/react@19.3.0)(react@19.3.1)(supports-color@10.2.2))(react@19.3.1)': dependencies: react: 19.3.1 - react-native: 0.83.0(@babel/core@8.1.2)(@types/react@19.3.0)(react@19.3.1)(supports-color@10.2.2) + react-native: 0.83.0(@babel/core@8.1.3)(@types/react@19.3.0)(react@19.3.1)(supports-color@10.2.2) '@opentelemetry/api-logs@0.223.0': dependencies: @@ -9946,66 +9836,66 @@ snapshots: '@oxc-project/types@0.156.0': {} - '@oxc-project/types@0.158.0': {} + '@oxc-project/types@0.159.0': {} - '@oxlint/binding-android-arm-eabi@1.93.0': + '@oxlint/binding-android-arm-eabi@1.94.0': optional: true - '@oxlint/binding-android-arm64@1.93.0': + '@oxlint/binding-android-arm64@1.94.0': optional: true - '@oxlint/binding-darwin-arm64@1.93.0': + '@oxlint/binding-darwin-arm64@1.94.0': optional: true - '@oxlint/binding-darwin-x64@1.93.0': + '@oxlint/binding-darwin-x64@1.94.0': optional: true - '@oxlint/binding-freebsd-x64@1.93.0': + '@oxlint/binding-freebsd-x64@1.94.0': optional: true - '@oxlint/binding-linux-arm-gnueabihf@1.93.0': + '@oxlint/binding-linux-arm-gnueabihf@1.94.0': optional: true - '@oxlint/binding-linux-arm-musleabihf@1.93.0': + '@oxlint/binding-linux-arm-musleabihf@1.94.0': optional: true - '@oxlint/binding-linux-arm64-gnu@1.93.0': + '@oxlint/binding-linux-arm64-gnu@1.94.0': optional: true - '@oxlint/binding-linux-arm64-musl@1.93.0': + '@oxlint/binding-linux-arm64-musl@1.94.0': optional: true - '@oxlint/binding-linux-ppc64-gnu@1.93.0': + '@oxlint/binding-linux-ppc64-gnu@1.94.0': optional: true - '@oxlint/binding-linux-riscv64-gnu@1.93.0': + '@oxlint/binding-linux-riscv64-gnu@1.94.0': optional: true - '@oxlint/binding-linux-riscv64-musl@1.93.0': + '@oxlint/binding-linux-riscv64-musl@1.94.0': optional: true - '@oxlint/binding-linux-s390x-gnu@1.93.0': + '@oxlint/binding-linux-s390x-gnu@1.94.0': optional: true - '@oxlint/binding-linux-x64-gnu@1.93.0': + '@oxlint/binding-linux-x64-gnu@1.94.0': optional: true - '@oxlint/binding-linux-x64-musl@1.93.0': + '@oxlint/binding-linux-x64-musl@1.94.0': optional: true - '@oxlint/binding-openharmony-arm64@1.93.0': + '@oxlint/binding-openharmony-arm64@1.94.0': optional: true - '@oxlint/binding-win32-arm64-msvc@1.93.0': + '@oxlint/binding-win32-arm64-msvc@1.94.0': optional: true - '@oxlint/binding-win32-ia32-msvc@1.93.0': + '@oxlint/binding-win32-ia32-msvc@1.94.0': optional: true - '@oxlint/binding-win32-x64-msvc@1.93.0': + '@oxlint/binding-win32-x64-msvc@1.94.0': optional: true - '@oxlint/plugins@1.93.0': {} + '@oxlint/plugins@1.94.0': {} '@pkgjs/parseargs@0.11.0': optional: true @@ -10053,9 +9943,9 @@ snapshots: '@react-native/assets-registry@0.83.0': {} - '@react-native/codegen@0.83.0(@babel/core@8.1.2)': + '@react-native/codegen@0.83.0(@babel/core@8.1.3)': dependencies: - '@babel/core': 8.1.2 + '@babel/core': 8.1.3 '@babel/parser': 7.29.13 glob: 7.2.3 hermes-parser: 0.32.0 @@ -10109,12 +9999,12 @@ snapshots: '@react-native/normalize-colors@0.83.0': {} - '@react-native/virtualized-lists@0.83.0(@types/react@19.3.0)(react-native@0.83.0(@babel/core@8.1.2)(@types/react@19.3.0)(react@19.3.1)(supports-color@10.2.2))(react@19.3.1)': + '@react-native/virtualized-lists@0.83.0(@types/react@19.3.0)(react-native@0.83.0(@babel/core@8.1.3)(@types/react@19.3.0)(react@19.3.1)(supports-color@10.2.2))(react@19.3.1)': dependencies: invariant: 2.2.4 nullthrows: 1.1.1 react: 19.3.1 - react-native: 0.83.0(@babel/core@8.1.2)(@types/react@19.3.0)(react@19.3.1)(supports-color@10.2.2) + react-native: 0.83.0(@babel/core@8.1.3)(@types/react@19.3.0)(react@19.3.1)(supports-color@10.2.2) optionalDependencies: '@types/react': 19.3.0 @@ -10167,7 +10057,7 @@ snapshots: '@rolldown/binding-android-arm-eabi@1.2.19': optional: true - '@rolldown/binding-android-arm-eabi@1.3.2': + '@rolldown/binding-android-arm-eabi@1.3.3': optional: true '@rolldown/binding-android-arm64@1.2.16': @@ -10176,7 +10066,7 @@ snapshots: '@rolldown/binding-android-arm64@1.2.19': optional: true - '@rolldown/binding-android-arm64@1.3.2': + '@rolldown/binding-android-arm64@1.3.3': optional: true '@rolldown/binding-darwin-arm64@1.2.16': @@ -10185,7 +10075,7 @@ snapshots: '@rolldown/binding-darwin-arm64@1.2.19': optional: true - '@rolldown/binding-darwin-arm64@1.3.2': + '@rolldown/binding-darwin-arm64@1.3.3': optional: true '@rolldown/binding-darwin-x64@1.2.16': @@ -10194,7 +10084,7 @@ snapshots: '@rolldown/binding-darwin-x64@1.2.19': optional: true - '@rolldown/binding-darwin-x64@1.3.2': + '@rolldown/binding-darwin-x64@1.3.3': optional: true '@rolldown/binding-freebsd-x64@1.2.16': @@ -10203,7 +10093,7 @@ snapshots: '@rolldown/binding-freebsd-x64@1.2.19': optional: true - '@rolldown/binding-freebsd-x64@1.3.2': + '@rolldown/binding-freebsd-x64@1.3.3': optional: true '@rolldown/binding-linux-arm-gnueabihf@1.2.16': @@ -10212,7 +10102,7 @@ snapshots: '@rolldown/binding-linux-arm-gnueabihf@1.2.19': optional: true - '@rolldown/binding-linux-arm-gnueabihf@1.3.2': + '@rolldown/binding-linux-arm-gnueabihf@1.3.3': optional: true '@rolldown/binding-linux-arm64-gnu@1.2.16': @@ -10221,7 +10111,7 @@ snapshots: '@rolldown/binding-linux-arm64-gnu@1.2.19': optional: true - '@rolldown/binding-linux-arm64-gnu@1.3.2': + '@rolldown/binding-linux-arm64-gnu@1.3.3': optional: true '@rolldown/binding-linux-arm64-musl@1.2.16': @@ -10230,7 +10120,7 @@ snapshots: '@rolldown/binding-linux-arm64-musl@1.2.19': optional: true - '@rolldown/binding-linux-arm64-musl@1.3.2': + '@rolldown/binding-linux-arm64-musl@1.3.3': optional: true '@rolldown/binding-linux-ppc64-gnu@1.2.16': @@ -10239,7 +10129,7 @@ snapshots: '@rolldown/binding-linux-ppc64-gnu@1.2.19': optional: true - '@rolldown/binding-linux-ppc64-gnu@1.3.2': + '@rolldown/binding-linux-ppc64-gnu@1.3.3': optional: true '@rolldown/binding-linux-s390x-gnu@1.2.16': @@ -10248,7 +10138,7 @@ snapshots: '@rolldown/binding-linux-s390x-gnu@1.2.19': optional: true - '@rolldown/binding-linux-s390x-gnu@1.3.2': + '@rolldown/binding-linux-s390x-gnu@1.3.3': optional: true '@rolldown/binding-linux-x64-gnu@1.2.16': @@ -10257,7 +10147,7 @@ snapshots: '@rolldown/binding-linux-x64-gnu@1.2.19': optional: true - '@rolldown/binding-linux-x64-gnu@1.3.2': + '@rolldown/binding-linux-x64-gnu@1.3.3': optional: true '@rolldown/binding-linux-x64-musl@1.2.16': @@ -10266,7 +10156,7 @@ snapshots: '@rolldown/binding-linux-x64-musl@1.2.19': optional: true - '@rolldown/binding-linux-x64-musl@1.3.2': + '@rolldown/binding-linux-x64-musl@1.3.3': optional: true '@rolldown/binding-openharmony-arm64@1.2.16': @@ -10275,7 +10165,7 @@ snapshots: '@rolldown/binding-openharmony-arm64@1.2.19': optional: true - '@rolldown/binding-openharmony-arm64@1.3.2': + '@rolldown/binding-openharmony-arm64@1.3.3': optional: true '@rolldown/binding-wasm32-wasi@1.2.19': @@ -10285,7 +10175,7 @@ snapshots: '@napi-rs/wasm-runtime': 1.2.6(@emnapi/core@2.0.0-beta.2)(@emnapi/runtime@2.0.0-beta.2) optional: true - '@rolldown/binding-wasm32-wasi@1.3.2': + '@rolldown/binding-wasm32-wasi@1.3.3': dependencies: '@emnapi/core': 2.0.0-beta.2 '@emnapi/runtime': 2.0.0-beta.2 @@ -10298,7 +10188,7 @@ snapshots: '@rolldown/binding-win32-arm64-msvc@1.2.19': optional: true - '@rolldown/binding-win32-arm64-msvc@1.3.2': + '@rolldown/binding-win32-arm64-msvc@1.3.3': optional: true '@rolldown/binding-win32-x64-msvc@1.2.16': @@ -10307,120 +10197,120 @@ snapshots: '@rolldown/binding-win32-x64-msvc@1.2.19': optional: true - '@rolldown/binding-win32-x64-msvc@1.3.2': + '@rolldown/binding-win32-x64-msvc@1.3.3': optional: true '@rolldown/pluginutils@1.0.1': {} - '@rollup/plugin-node-resolve@16.0.3(rollup@4.68.3)': + '@rollup/plugin-node-resolve@16.0.3(rollup@4.68.8)': dependencies: - '@rollup/pluginutils': 5.5.1(rollup@4.68.3) + '@rollup/pluginutils': 5.5.1(rollup@4.68.8) '@types/resolve': 1.20.2 deepmerge: 4.3.1 is-module: 1.0.0 resolve: 1.22.14 optionalDependencies: - rollup: 4.68.3 + rollup: 4.68.8 - '@rollup/plugin-replace@6.0.3(rollup@4.68.3)': + '@rollup/plugin-replace@6.0.3(rollup@4.68.8)': dependencies: - '@rollup/pluginutils': 5.5.1(rollup@4.68.3) + '@rollup/pluginutils': 5.5.1(rollup@4.68.8) magic-string: 0.30.21 optionalDependencies: - rollup: 4.68.3 + rollup: 4.68.8 - '@rollup/plugin-terser@1.0.2(rollup@4.68.3)': + '@rollup/plugin-terser@1.0.2(rollup@4.68.8)': dependencies: serialize-javascript: 7.1.4 smob: 1.6.2 - terser: 5.51.2 + terser: 5.51.4 optionalDependencies: - rollup: 4.68.3 + rollup: 4.68.8 - '@rollup/pluginutils@5.5.1(rollup@4.68.3)': + '@rollup/pluginutils@5.5.1(rollup@4.68.8)': dependencies: '@types/estree': 1.0.10 estree-walker: 2.0.2 picomatch: 4.0.7 optionalDependencies: - rollup: 4.68.3 + rollup: 4.68.8 - '@rollup/rollup-android-arm-eabi@4.68.3': + '@rollup/rollup-android-arm-eabi@4.68.8': optional: true - '@rollup/rollup-android-arm64@4.68.3': + '@rollup/rollup-android-arm64@4.68.8': optional: true - '@rollup/rollup-android-x64@4.68.3': + '@rollup/rollup-android-x64@4.68.8': optional: true - '@rollup/rollup-darwin-arm64@4.68.3': + '@rollup/rollup-darwin-arm64@4.68.8': optional: true - '@rollup/rollup-darwin-x64@4.68.3': + '@rollup/rollup-darwin-x64@4.68.8': optional: true - '@rollup/rollup-freebsd-arm64@4.68.3': + '@rollup/rollup-freebsd-arm64@4.68.8': optional: true - '@rollup/rollup-freebsd-x64@4.68.3': + '@rollup/rollup-freebsd-x64@4.68.8': optional: true - '@rollup/rollup-linux-arm-gnueabihf@4.68.3': + '@rollup/rollup-linux-arm-gnueabihf@4.68.8': optional: true - '@rollup/rollup-linux-arm-musleabihf@4.68.3': + '@rollup/rollup-linux-arm-musleabihf@4.68.8': optional: true - '@rollup/rollup-linux-arm64-gnu@4.68.3': + '@rollup/rollup-linux-arm64-gnu@4.68.8': optional: true - '@rollup/rollup-linux-arm64-musl@4.68.3': + '@rollup/rollup-linux-arm64-musl@4.68.8': optional: true - '@rollup/rollup-linux-loong64-gnu@4.68.3': + '@rollup/rollup-linux-loong64-gnu@4.68.8': optional: true - '@rollup/rollup-linux-loong64-musl@4.68.3': + '@rollup/rollup-linux-loong64-musl@4.68.8': optional: true - '@rollup/rollup-linux-ppc64-gnu@4.68.3': + '@rollup/rollup-linux-ppc64-gnu@4.68.8': optional: true - '@rollup/rollup-linux-ppc64-musl@4.68.3': + '@rollup/rollup-linux-ppc64-musl@4.68.8': optional: true - '@rollup/rollup-linux-riscv64-gnu@4.68.3': + '@rollup/rollup-linux-riscv64-gnu@4.68.8': optional: true - '@rollup/rollup-linux-riscv64-musl@4.68.3': + '@rollup/rollup-linux-riscv64-musl@4.68.8': optional: true - '@rollup/rollup-linux-s390x-gnu@4.68.3': + '@rollup/rollup-linux-s390x-gnu@4.68.8': optional: true - '@rollup/rollup-linux-x64-gnu@4.68.3': + '@rollup/rollup-linux-x64-gnu@4.68.8': optional: true - '@rollup/rollup-linux-x64-musl@4.68.3': + '@rollup/rollup-linux-x64-musl@4.68.8': optional: true - '@rollup/rollup-openbsd-x64@4.68.3': + '@rollup/rollup-openbsd-x64@4.68.8': optional: true - '@rollup/rollup-openharmony-arm64@4.68.3': + '@rollup/rollup-openharmony-arm64@4.68.8': optional: true - '@rollup/rollup-win32-arm64-msvc@4.68.3': + '@rollup/rollup-win32-arm64-msvc@4.68.8': optional: true - '@rollup/rollup-win32-ia32-msvc@4.68.3': + '@rollup/rollup-win32-ia32-msvc@4.68.8': optional: true - '@rollup/rollup-win32-x64-gnu@4.68.3': + '@rollup/rollup-win32-x64-gnu@4.68.8': optional: true - '@rollup/rollup-win32-x64-msvc@4.68.3': + '@rollup/rollup-win32-x64-msvc@4.68.8': optional: true '@sinclair/typebox@0.27.12': {} @@ -10463,36 +10353,36 @@ snapshots: '@sqliteai/sqlite-vector-win32-x86_64@1.0.0': optional: true - '@testcontainers/mssqlserver@12.2.1(bare-buffer@3.7.1)(supports-color@10.2.2)': + '@testcontainers/mssqlserver@12.2.2(bare-buffer@3.7.1)(supports-color@10.2.2)': dependencies: - testcontainers: 12.2.1(bare-buffer@3.7.1)(supports-color@10.2.2) + testcontainers: 12.2.2(bare-buffer@3.7.1)(supports-color@10.2.2) transitivePeerDependencies: - bare-abort-controller - bare-buffer - react-native-b4a - supports-color - '@testcontainers/mysql@12.2.1(bare-buffer@3.7.1)(supports-color@10.2.2)': + '@testcontainers/mysql@12.2.2(bare-buffer@3.7.1)(supports-color@10.2.2)': dependencies: - testcontainers: 12.2.1(bare-buffer@3.7.1)(supports-color@10.2.2) + testcontainers: 12.2.2(bare-buffer@3.7.1)(supports-color@10.2.2) transitivePeerDependencies: - bare-abort-controller - bare-buffer - react-native-b4a - supports-color - '@testcontainers/postgresql@12.2.1(bare-buffer@3.7.1)(supports-color@10.2.2)': + '@testcontainers/postgresql@12.2.2(bare-buffer@3.7.1)(supports-color@10.2.2)': dependencies: - testcontainers: 12.2.1(bare-buffer@3.7.1)(supports-color@10.2.2) + testcontainers: 12.2.2(bare-buffer@3.7.1)(supports-color@10.2.2) transitivePeerDependencies: - bare-abort-controller - bare-buffer - react-native-b4a - supports-color - '@testcontainers/redis@12.2.1(bare-buffer@3.7.1)(supports-color@10.2.2)': + '@testcontainers/redis@12.2.2(bare-buffer@3.7.1)(supports-color@10.2.2)': dependencies: - testcontainers: 12.2.1(bare-buffer@3.7.1)(supports-color@10.2.2) + testcontainers: 12.2.2(bare-buffer@3.7.1)(supports-color@10.2.2) transitivePeerDependencies: - bare-abort-controller - bare-buffer @@ -10510,7 +10400,7 @@ snapshots: picocolors: 1.1.1 pretty-format: 27.5.1 - '@testing-library/jest-dom@7.0.1(@testing-library/dom@10.4.2)(vitest@5.1.0)': + '@testing-library/jest-dom@8.0.0(@testing-library/dom@10.4.2)(vitest@5.1.0)': dependencies: '@adobe/css-tools': 4.5.0 '@testing-library/dom': 10.4.2 @@ -10520,7 +10410,7 @@ snapshots: picocolors: 1.1.1 redent: 3.0.0 optionalDependencies: - vitest: 5.1.0(@edge-runtime/vm@5.0.0)(@opentelemetry/api@1.10.0)(@types/node@26.6.6)(@vitest/coverage-v8@5.1.0)(happy-dom@21.0.4)(jsdom@30.0.1)(vite@8.3.8(@types/node@26.6.6)(esbuild@0.28.2)(terser@5.51.2)(tsx@4.23.15)(yaml@2.9.1)) + vitest: 5.1.0(@edge-runtime/vm@5.0.0)(@opentelemetry/api@1.10.0)(@types/node@26.6.6)(@vitest/coverage-v8@5.1.0)(happy-dom@21.0.4)(jsdom@30.0.1)(vite@8.3.8(@types/node@26.6.6)(esbuild@0.28.2)(terser@5.51.4)(tsx@4.23.15)(yaml@2.9.1)) '@testing-library/react@16.3.3(@testing-library/dom@10.4.2)(@types/react-dom@19.3.0(@types/react@19.3.0))(@types/react@19.3.0)(react-dom@19.3.1(react@19.3.1))(react@19.3.1)': dependencies: @@ -10589,9 +10479,9 @@ snapshots: '@types/node': 26.6.6 optional: true - '@types/bun@1.4.4': + '@types/bun@1.4.5': dependencies: - bun-types: 1.4.4 + bun-types: 1.4.5 '@types/chai@5.2.3': dependencies: @@ -10603,6 +10493,8 @@ snapshots: '@types/node': 26.6.6 optional: true + '@types/convert-source-map@2.0.3': {} + '@types/debug@4.1.13': dependencies: '@types/ms': 2.1.0 @@ -10697,7 +10589,7 @@ snapshots: '@types/react@19.3.0': dependencies: - csstype: 3.2.3 + csstype: 3.2.4 '@types/readable-stream@4.0.25': dependencies: @@ -10727,15 +10619,6 @@ snapshots: '@types/send': 0.17.6 optional: true - '@types/ssh2-streams@0.1.13': - dependencies: - '@types/node': 26.6.6 - - '@types/ssh2@0.5.52': - dependencies: - '@types/node': 26.6.6 - '@types/ssh2-streams': 0.1.13 - '@types/ssh2@1.15.6': dependencies: '@types/node': 26.6.6 @@ -10856,13 +10739,12 @@ snapshots: '@typescript/typescript-win32-x64@7.0.2': optional: true - '@typespec/ts-http-runtime@0.3.10(supports-color@10.2.2)': + '@typespec/ts-http-runtime@0.3.11(supports-color@10.2.2)': dependencies: - http-proxy-agent: 9.1.0(supports-color@10.2.2) - https-proxy-agent: 9.1.0(supports-color@10.2.2) + http-proxy-agent: 7.0.2(supports-color@10.2.2) + https-proxy-agent: 7.0.6(supports-color@10.2.2) tslib: 2.9.1 transitivePeerDependencies: - - kerberos - supports-color '@vitest/coverage-v8@5.1.0(vitest@5.1.0)': @@ -10875,7 +10757,7 @@ snapshots: obug: 3.0.0 std-env: 4.3.0 tinyrainbow: 3.2.0 - vitest: 5.1.0(@edge-runtime/vm@5.0.0)(@opentelemetry/api@1.10.0)(@types/node@26.6.6)(@vitest/coverage-v8@5.1.0)(happy-dom@21.0.4)(jsdom@30.0.1)(vite@8.3.8(@types/node@26.6.6)(esbuild@0.28.2)(terser@5.51.2)(tsx@4.23.15)(yaml@2.9.1)) + vitest: 5.1.0(@edge-runtime/vm@5.0.0)(@opentelemetry/api@1.10.0)(@types/node@26.6.6)(@vitest/coverage-v8@5.1.0)(happy-dom@21.0.4)(jsdom@30.0.1)(vite@8.3.8(@types/node@26.6.6)(esbuild@0.28.2)(terser@5.51.4)(tsx@4.23.15)(yaml@2.9.1)) '@vitest/istanbul-lib-coverage@2.1.0': {} @@ -10883,75 +10765,75 @@ snapshots: dependencies: '@vitest/istanbul-lib-coverage': 2.1.0 - '@vitest/mocker@5.1.0(vite@8.3.8(@types/node@26.6.6)(esbuild@0.28.2)(terser@5.51.2)(tsx@4.23.15)(yaml@2.9.1))': + '@vitest/mocker@5.1.0(vite@8.3.8(@types/node@26.6.6)(esbuild@0.28.2)(terser@5.51.4)(tsx@4.23.15)(yaml@2.9.1))': dependencies: '@jridgewell/trace-mapping': 0.3.31 '@vitest/spy': 5.1.0 estree-walker: 3.0.3 magic-string: 1.4.5 optionalDependencies: - vite: 8.3.8(@types/node@26.6.6)(esbuild@0.28.2)(terser@5.51.2)(tsx@4.23.15)(yaml@2.9.1) + vite: 8.3.8(@types/node@26.6.6)(esbuild@0.28.2)(terser@5.51.4)(tsx@4.23.15)(yaml@2.9.1) '@vitest/spy@5.1.0': {} '@vitest/web-worker@5.1.0(vitest@5.1.0)': dependencies: obug: 3.0.0 - vitest: 5.1.0(@edge-runtime/vm@5.0.0)(@opentelemetry/api@1.10.0)(@types/node@26.6.6)(@vitest/coverage-v8@5.1.0)(happy-dom@21.0.4)(jsdom@30.0.1)(vite@8.3.8(@types/node@26.6.6)(esbuild@0.28.2)(terser@5.51.2)(tsx@4.23.15)(yaml@2.9.1)) + vitest: 5.1.0(@edge-runtime/vm@5.0.0)(@opentelemetry/api@1.10.0)(@types/node@26.6.6)(@vitest/coverage-v8@5.1.0)(happy-dom@21.0.4)(jsdom@30.0.1)(vite@8.3.8(@types/node@26.6.6)(esbuild@0.28.2)(terser@5.51.4)(tsx@4.23.15)(yaml@2.9.1)) - '@vue/compiler-core@3.5.45': + '@vue/compiler-core@3.5.46': dependencies: '@babel/parser': 7.29.13 - '@vue/shared': 3.5.45 + '@vue/shared': 3.5.46 entities: 7.0.1 estree-walker: 2.0.2 - source-map-js: 1.2.2 + source-map-js: 1.2.4 - '@vue/compiler-dom@3.5.45': + '@vue/compiler-dom@3.5.46': dependencies: - '@vue/compiler-core': 3.5.45 - '@vue/shared': 3.5.45 + '@vue/compiler-core': 3.5.46 + '@vue/shared': 3.5.46 - '@vue/compiler-sfc@3.5.45': + '@vue/compiler-sfc@3.5.46': dependencies: '@babel/parser': 7.29.13 - '@vue/compiler-core': 3.5.45 - '@vue/compiler-dom': 3.5.45 - '@vue/compiler-ssr': 3.5.45 - '@vue/shared': 3.5.45 + '@vue/compiler-core': 3.5.46 + '@vue/compiler-dom': 3.5.46 + '@vue/compiler-ssr': 3.5.46 + '@vue/shared': 3.5.46 estree-walker: 2.0.2 magic-string: 0.30.21 postcss: 8.5.32 - source-map-js: 1.2.2 + source-map-js: 1.2.4 - '@vue/compiler-ssr@3.5.45': + '@vue/compiler-ssr@3.5.46': dependencies: - '@vue/compiler-dom': 3.5.45 - '@vue/shared': 3.5.45 + '@vue/compiler-dom': 3.5.46 + '@vue/shared': 3.5.46 - '@vue/reactivity@3.5.45': + '@vue/reactivity@3.5.46': dependencies: - '@vue/shared': 3.5.45 + '@vue/shared': 3.5.46 - '@vue/runtime-core@3.5.45': + '@vue/runtime-core@3.5.46': dependencies: - '@vue/reactivity': 3.5.45 - '@vue/shared': 3.5.45 + '@vue/reactivity': 3.5.46 + '@vue/shared': 3.5.46 - '@vue/runtime-dom@3.5.45': + '@vue/runtime-dom@3.5.46': dependencies: - '@vue/reactivity': 3.5.45 - '@vue/runtime-core': 3.5.45 - '@vue/shared': 3.5.45 - csstype: 3.2.3 + '@vue/reactivity': 3.5.46 + '@vue/runtime-core': 3.5.46 + '@vue/shared': 3.5.46 + csstype: 3.2.4 - '@vue/server-renderer@3.5.45': + '@vue/server-renderer@3.5.46': dependencies: - '@vue/compiler-ssr': 3.5.45 - '@vue/runtime-dom': 3.5.45 - '@vue/shared': 3.5.45 + '@vue/compiler-ssr': 3.5.46 + '@vue/runtime-dom': 3.5.46 + '@vue/shared': 3.5.46 - '@vue/shared@3.5.45': {} + '@vue/shared@3.5.46': {} abort-controller@3.0.0: dependencies: @@ -10966,8 +10848,6 @@ snapshots: agent-base@7.1.4: {} - agent-base@9.0.0: {} - ajv-draft-04@1.0.0(ajv@8.20.0): optionalDependencies: ajv: 8.20.0 @@ -10979,7 +10859,7 @@ snapshots: json-schema-traverse: 1.0.0 require-from-string: 2.0.2 - alchemy@2.0.0-beta.87(@effect/platform-bun@4.1.4(effect@packages+effect))(@effect/platform-node@4.1.4(effect@packages+effect)(redis@6.3.1(@opentelemetry/api@1.10.0)))(@types/react@19.3.0)(effect@packages+effect)(react-devtools-core@6.1.5)(vite@8.3.8(@types/node@26.6.6)(esbuild@0.28.2)(terser@5.51.2)(tsx@4.23.15)(yaml@2.9.1))(ws@8.23.0): + alchemy@2.0.0-beta.87(@effect/platform-bun@4.1.5(effect@packages+effect))(@effect/platform-node@4.1.5(effect@packages+effect)(redis@6.3.1(@opentelemetry/api@1.10.0)))(@types/react@19.3.0)(effect@packages+effect)(react-devtools-core@6.1.5)(vite@8.3.8(@types/node@26.6.6)(esbuild@0.28.2)(terser@5.51.4)(tsx@4.23.15)(yaml@2.9.1))(ws@8.23.0): dependencies: '@alchemy.run/node-utils': 2.0.0-beta.87 '@alchemy.run/sigil': 0.1.0-alpha.4(@types/react@19.3.0)(react-devtools-core@6.1.5) @@ -10992,9 +10872,9 @@ snapshots: tinyglobby: 0.2.17 yaml: 2.9.1 optionalDependencies: - '@effect/platform-bun': 4.1.4(effect@packages+effect) - '@effect/platform-node': 4.1.4(effect@packages+effect)(redis@6.3.1(@opentelemetry/api@1.10.0)) - vite: 8.3.8(@types/node@26.6.6)(esbuild@0.28.2)(terser@5.51.2)(tsx@4.23.15)(yaml@2.9.1) + '@effect/platform-bun': 4.1.5(effect@packages+effect) + '@effect/platform-node': 4.1.5(effect@packages+effect)(redis@6.3.1(@opentelemetry/api@1.10.0)) + vite: 8.3.8(@types/node@26.6.6)(esbuild@0.28.2)(terser@5.51.4)(tsx@4.23.15)(yaml@2.9.1) ws: 8.23.0 transitivePeerDependencies: - '@types/react' @@ -11081,7 +10961,7 @@ snapshots: estree-walker: 3.0.3 js-tokens: 10.0.0 - async-lock@1.4.1: {} + async-lock@1.5.0: {} async@3.2.6: {} @@ -11093,22 +10973,22 @@ snapshots: b4a@1.9.0: {} - babel-jest@29.7.0(@babel/core@8.1.2)(supports-color@10.2.2): + babel-jest@29.7.0(@babel/core@8.1.3)(supports-color@10.2.2): dependencies: - '@babel/core': 8.1.2 + '@babel/core': 8.1.3 '@jest/transform': 29.7.0(supports-color@10.2.2) '@types/babel__core': 7.20.5 babel-plugin-istanbul: 6.1.1(supports-color@10.2.2) - babel-preset-jest: 29.6.3(@babel/core@8.1.2) + babel-preset-jest: 29.6.3(@babel/core@8.1.3) chalk: 4.1.2 graceful-fs: 4.2.11 slash: 3.0.0 transitivePeerDependencies: - supports-color - babel-plugin-annotate-pure-calls@0.5.0(@babel/core@8.1.2): + babel-plugin-annotate-pure-calls@0.5.0(@babel/core@8.1.3): dependencies: - '@babel/core': 8.1.2 + '@babel/core': 8.1.3 babel-plugin-istanbul@6.1.1(supports-color@10.2.2): dependencies: @@ -11131,30 +11011,30 @@ snapshots: dependencies: hermes-parser: 0.32.0 - babel-preset-current-node-syntax@1.2.0(@babel/core@8.1.2): - dependencies: - '@babel/core': 8.1.2 - '@babel/plugin-syntax-async-generators': 7.8.4(@babel/core@8.1.2) - '@babel/plugin-syntax-bigint': 7.8.3(@babel/core@8.1.2) - '@babel/plugin-syntax-class-properties': 7.12.13(@babel/core@8.1.2) - '@babel/plugin-syntax-class-static-block': 7.14.5(@babel/core@8.1.2) - '@babel/plugin-syntax-import-attributes': 7.29.7(@babel/core@8.1.2) - '@babel/plugin-syntax-import-meta': 7.10.4(@babel/core@8.1.2) - '@babel/plugin-syntax-json-strings': 7.8.3(@babel/core@8.1.2) - '@babel/plugin-syntax-logical-assignment-operators': 7.10.4(@babel/core@8.1.2) - '@babel/plugin-syntax-nullish-coalescing-operator': 7.8.3(@babel/core@8.1.2) - '@babel/plugin-syntax-numeric-separator': 7.10.4(@babel/core@8.1.2) - '@babel/plugin-syntax-object-rest-spread': 7.8.3(@babel/core@8.1.2) - '@babel/plugin-syntax-optional-catch-binding': 7.8.3(@babel/core@8.1.2) - '@babel/plugin-syntax-optional-chaining': 7.8.3(@babel/core@8.1.2) - '@babel/plugin-syntax-private-property-in-object': 7.14.5(@babel/core@8.1.2) - '@babel/plugin-syntax-top-level-await': 7.14.5(@babel/core@8.1.2) - - babel-preset-jest@29.6.3(@babel/core@8.1.2): - dependencies: - '@babel/core': 8.1.2 + babel-preset-current-node-syntax@1.2.0(@babel/core@8.1.3): + dependencies: + '@babel/core': 8.1.3 + '@babel/plugin-syntax-async-generators': 7.8.4(@babel/core@8.1.3) + '@babel/plugin-syntax-bigint': 7.8.3(@babel/core@8.1.3) + '@babel/plugin-syntax-class-properties': 7.12.13(@babel/core@8.1.3) + '@babel/plugin-syntax-class-static-block': 7.14.5(@babel/core@8.1.3) + '@babel/plugin-syntax-import-attributes': 7.29.7(@babel/core@8.1.3) + '@babel/plugin-syntax-import-meta': 7.10.4(@babel/core@8.1.3) + '@babel/plugin-syntax-json-strings': 7.8.3(@babel/core@8.1.3) + '@babel/plugin-syntax-logical-assignment-operators': 7.10.4(@babel/core@8.1.3) + '@babel/plugin-syntax-nullish-coalescing-operator': 7.8.3(@babel/core@8.1.3) + '@babel/plugin-syntax-numeric-separator': 7.10.4(@babel/core@8.1.3) + '@babel/plugin-syntax-object-rest-spread': 7.8.3(@babel/core@8.1.3) + '@babel/plugin-syntax-optional-catch-binding': 7.8.3(@babel/core@8.1.3) + '@babel/plugin-syntax-optional-chaining': 7.8.3(@babel/core@8.1.3) + '@babel/plugin-syntax-private-property-in-object': 7.14.5(@babel/core@8.1.3) + '@babel/plugin-syntax-top-level-await': 7.14.5(@babel/core@8.1.3) + + babel-preset-jest@29.6.3(@babel/core@8.1.3): + dependencies: + '@babel/core': 8.1.3 babel-plugin-jest-hoist: 29.6.3 - babel-preset-current-node-syntax: 1.2.0(@babel/core@8.1.2) + babel-preset-current-node-syntax: 1.2.0(@babel/core@8.1.3) balanced-match@1.0.2: {} @@ -11272,7 +11152,7 @@ snapshots: buildcheck@0.0.7: optional: true - bun-types@1.4.4: + bun-types@1.4.5: dependencies: '@types/node': 26.6.6 undici-types: 8.12.4 @@ -11454,11 +11334,11 @@ snapshots: css-tree@3.2.1: dependencies: mdn-data: 2.27.1 - source-map-js: 1.2.2 + source-map-js: 1.2.4 css.escape@1.5.1: {} - csstype@3.2.3: {} + csstype@3.2.4: {} data-urls@7.0.0: dependencies: @@ -11570,7 +11450,7 @@ snapshots: detective-vue2@2.3.0(supports-color@10.2.2)(typescript@5.9.3): dependencies: '@dependents/detective-less': 5.0.3 - '@vue/compiler-sfc': 3.5.45 + '@vue/compiler-sfc': 3.5.46 detective-es6: 5.0.2 detective-sass: 6.0.2 detective-scss: 5.0.2 @@ -11632,27 +11512,27 @@ snapshots: dom-accessibility-api@0.6.3: {} - dprint@0.64.3: + dprint@0.65.0: optionalDependencies: - '@dprint/android-arm64': 0.64.3 - '@dprint/android-x64': 0.64.3 - '@dprint/darwin-arm64': 0.64.3 - '@dprint/darwin-x64': 0.64.3 - '@dprint/freebsd-arm64': 0.64.3 - '@dprint/freebsd-x64': 0.64.3 - '@dprint/linux-arm64-glibc': 0.64.3 - '@dprint/linux-arm64-musl': 0.64.3 - '@dprint/linux-loong64-glibc': 0.64.3 - '@dprint/linux-loong64-musl': 0.64.3 - '@dprint/linux-ppc64-glibc': 0.64.3 - '@dprint/linux-ppc64-musl': 0.64.3 - '@dprint/linux-riscv64-glibc': 0.64.3 - '@dprint/linux-riscv64-musl': 0.64.3 - '@dprint/linux-s390x-glibc': 0.64.3 - '@dprint/linux-x64-glibc': 0.64.3 - '@dprint/linux-x64-musl': 0.64.3 - '@dprint/win32-arm64': 0.64.3 - '@dprint/win32-x64': 0.64.3 + '@dprint/android-arm64': 0.65.0 + '@dprint/android-x64': 0.65.0 + '@dprint/darwin-arm64': 0.65.0 + '@dprint/darwin-x64': 0.65.0 + '@dprint/freebsd-arm64': 0.65.0 + '@dprint/freebsd-x64': 0.65.0 + '@dprint/linux-arm64-glibc': 0.65.0 + '@dprint/linux-arm64-musl': 0.65.0 + '@dprint/linux-loong64-glibc': 0.65.0 + '@dprint/linux-loong64-musl': 0.65.0 + '@dprint/linux-ppc64-glibc': 0.65.0 + '@dprint/linux-ppc64-musl': 0.65.0 + '@dprint/linux-riscv64-glibc': 0.65.0 + '@dprint/linux-riscv64-musl': 0.65.0 + '@dprint/linux-s390x-glibc': 0.65.0 + '@dprint/linux-x64-glibc': 0.65.0 + '@dprint/linux-x64-musl': 0.65.0 + '@dprint/win32-arm64': 0.65.0 + '@dprint/win32-x64': 0.65.0 eastasianwidth@0.2.0: {} @@ -11790,7 +11670,7 @@ snapshots: fake-indexeddb@6.2.8: {} - fast-check@4.10.2: + fast-check@4.10.3: dependencies: pure-rand: 8.4.2 @@ -11989,7 +11869,7 @@ snapshots: buffer-image-size: 0.6.4 entities: 7.0.1 whatwg-mimetype: 3.0.0 - ws: 8.22.1 + ws: 8.23.0 transitivePeerDependencies: - bufferutil - utf-8-validate @@ -12014,7 +11894,7 @@ snapshots: dependencies: hermes-estree: 0.35.0 - hono@4.13.18: {} + hono@4.13.19: {} html-encoding-sniffer@6.0.0: dependencies: @@ -12030,13 +11910,11 @@ snapshots: statuses: 2.0.2 toidentifier: 1.0.1 - http-proxy-agent@9.1.0(supports-color@10.2.2): + http-proxy-agent@7.0.2(supports-color@10.2.2): dependencies: - agent-base: 9.0.0 + agent-base: 7.1.4 debug: 4.4.3(supports-color@10.2.2) - proxy-agent-negotiate: 1.1.0 transitivePeerDependencies: - - kerberos - supports-color http2-client@1.3.5: {} @@ -12048,15 +11926,6 @@ snapshots: transitivePeerDependencies: - supports-color - https-proxy-agent@9.1.0(supports-color@10.2.2): - dependencies: - agent-base: 9.0.0 - debug: 4.4.3(supports-color@10.2.2) - proxy-agent-negotiate: 1.1.0 - transitivePeerDependencies: - - kerberos - - supports-color - human-id@4.2.2: {} iconv-lite@0.7.3: @@ -12256,7 +12125,7 @@ snapshots: jju@1.4.0: {} - jose@6.2.17: {} + jose@6.2.18: {} js-base64@3.9.6: {} @@ -12319,7 +12188,7 @@ snapshots: saxes: 6.0.0 symbol-tree: 3.2.4 tough-cookie: 6.0.2 - undici: 8.12.4 + undici: 8.13.1 w3c-xmlserializer: 5.0.0 webidl-conversions: 8.0.1 whatwg-mimetype: 5.0.0 @@ -12575,7 +12444,7 @@ snapshots: dependencies: '@babel/parser': 7.29.13 '@babel/types': 7.29.11 - source-map-js: 1.2.2 + source-map-js: 1.2.4 make-dir@2.1.0: dependencies: @@ -12771,7 +12640,7 @@ snapshots: metro-minify-terser@0.83.7: dependencies: flow-enums-runtime: 0.0.6 - terser: 5.51.2 + terser: 5.51.4 metro-resolver@0.83.7: dependencies: @@ -13236,7 +13105,7 @@ snapshots: dependencies: '@babel/parser': 7.29.13 - nodemailer@10.5.0: {} + nodemailer@10.6.1: {} normalize-path@3.0.0: {} @@ -13337,27 +13206,27 @@ snapshots: strip-ansi: 6.0.1 wcwidth: 1.0.1 - oxlint@1.93.0: + oxlint@1.94.0: optionalDependencies: - '@oxlint/binding-android-arm-eabi': 1.93.0 - '@oxlint/binding-android-arm64': 1.93.0 - '@oxlint/binding-darwin-arm64': 1.93.0 - '@oxlint/binding-darwin-x64': 1.93.0 - '@oxlint/binding-freebsd-x64': 1.93.0 - '@oxlint/binding-linux-arm-gnueabihf': 1.93.0 - '@oxlint/binding-linux-arm-musleabihf': 1.93.0 - '@oxlint/binding-linux-arm64-gnu': 1.93.0 - '@oxlint/binding-linux-arm64-musl': 1.93.0 - '@oxlint/binding-linux-ppc64-gnu': 1.93.0 - '@oxlint/binding-linux-riscv64-gnu': 1.93.0 - '@oxlint/binding-linux-riscv64-musl': 1.93.0 - '@oxlint/binding-linux-s390x-gnu': 1.93.0 - '@oxlint/binding-linux-x64-gnu': 1.93.0 - '@oxlint/binding-linux-x64-musl': 1.93.0 - '@oxlint/binding-openharmony-arm64': 1.93.0 - '@oxlint/binding-win32-arm64-msvc': 1.93.0 - '@oxlint/binding-win32-ia32-msvc': 1.93.0 - '@oxlint/binding-win32-x64-msvc': 1.93.0 + '@oxlint/binding-android-arm-eabi': 1.94.0 + '@oxlint/binding-android-arm64': 1.94.0 + '@oxlint/binding-darwin-arm64': 1.94.0 + '@oxlint/binding-darwin-x64': 1.94.0 + '@oxlint/binding-freebsd-x64': 1.94.0 + '@oxlint/binding-linux-arm-gnueabihf': 1.94.0 + '@oxlint/binding-linux-arm-musleabihf': 1.94.0 + '@oxlint/binding-linux-arm64-gnu': 1.94.0 + '@oxlint/binding-linux-arm64-musl': 1.94.0 + '@oxlint/binding-linux-ppc64-gnu': 1.94.0 + '@oxlint/binding-linux-riscv64-gnu': 1.94.0 + '@oxlint/binding-linux-riscv64-musl': 1.94.0 + '@oxlint/binding-linux-s390x-gnu': 1.94.0 + '@oxlint/binding-linux-x64-gnu': 1.94.0 + '@oxlint/binding-linux-x64-musl': 1.94.0 + '@oxlint/binding-openharmony-arm64': 1.94.0 + '@oxlint/binding-win32-arm64-msvc': 1.94.0 + '@oxlint/binding-win32-ia32-msvc': 1.94.0 + '@oxlint/binding-win32-x64-msvc': 1.94.0 p-limit@2.3.0: dependencies: @@ -13435,7 +13304,7 @@ snapshots: dependencies: find-up: 4.1.0 - pkg-pr-new@0.0.93: {} + pkg-pr-new@0.0.94: {} playwright-core@1.65.1: {} @@ -13456,7 +13325,7 @@ snapshots: dependencies: nanoid: 3.3.20 picocolors: 1.1.1 - source-map-js: 1.2.2 + source-map-js: 1.2.4 postgres@4.1.1: {} @@ -13541,8 +13410,6 @@ snapshots: dependencies: long: 5.3.2 - proxy-agent-negotiate@1.1.0: {} - pump@3.0.4: dependencies: end-of-stream: 1.4.5 @@ -13596,20 +13463,20 @@ snapshots: react-is@18.3.1: {} - react-native@0.83.0(@babel/core@8.1.2)(@types/react@19.3.0)(react@19.3.1)(supports-color@10.2.2): + react-native@0.83.0(@babel/core@8.1.3)(@types/react@19.3.0)(react@19.3.1)(supports-color@10.2.2): dependencies: '@jest/create-cache-key-function': 29.7.0 '@react-native/assets-registry': 0.83.0 - '@react-native/codegen': 0.83.0(@babel/core@8.1.2) + '@react-native/codegen': 0.83.0(@babel/core@8.1.3) '@react-native/community-cli-plugin': 0.83.0(supports-color@10.2.2) '@react-native/gradle-plugin': 0.83.0 '@react-native/js-polyfills': 0.83.0 '@react-native/normalize-colors': 0.83.0 - '@react-native/virtualized-lists': 0.83.0(@types/react@19.3.0)(react-native@0.83.0(@babel/core@8.1.2)(@types/react@19.3.0)(react@19.3.1)(supports-color@10.2.2))(react@19.3.1) + '@react-native/virtualized-lists': 0.83.0(@types/react@19.3.0)(react-native@0.83.0(@babel/core@8.1.3)(@types/react@19.3.0)(react@19.3.1)(supports-color@10.2.2))(react@19.3.1) abort-controller: 3.0.0 anser: 1.4.10 ansi-regex: 5.0.1 - babel-jest: 29.7.0(@babel/core@8.1.2)(supports-color@10.2.2) + babel-jest: 29.7.0(@babel/core@8.1.3)(supports-color@10.2.2) babel-plugin-syntax-hermes-parser: 0.32.0 base64-js: 1.5.1 commander: 12.1.0 @@ -13793,106 +13660,106 @@ snapshots: '@rolldown/binding-win32-arm64-msvc': 1.2.19 '@rolldown/binding-win32-x64-msvc': 1.2.19 - rolldown@1.3.2: + rolldown@1.3.3: dependencies: - '@oxc-project/types': 0.158.0 + '@oxc-project/types': 0.159.0 '@rolldown/pluginutils': 1.0.1 optionalDependencies: - '@rolldown/binding-android-arm-eabi': 1.3.2 - '@rolldown/binding-android-arm64': 1.3.2 - '@rolldown/binding-darwin-arm64': 1.3.2 - '@rolldown/binding-darwin-x64': 1.3.2 - '@rolldown/binding-freebsd-x64': 1.3.2 - '@rolldown/binding-linux-arm-gnueabihf': 1.3.2 - '@rolldown/binding-linux-arm64-gnu': 1.3.2 - '@rolldown/binding-linux-arm64-musl': 1.3.2 - '@rolldown/binding-linux-ppc64-gnu': 1.3.2 - '@rolldown/binding-linux-s390x-gnu': 1.3.2 - '@rolldown/binding-linux-x64-gnu': 1.3.2 - '@rolldown/binding-linux-x64-musl': 1.3.2 - '@rolldown/binding-openharmony-arm64': 1.3.2 - '@rolldown/binding-wasm32-wasi': 1.3.2 - '@rolldown/binding-win32-arm64-msvc': 1.3.2 - '@rolldown/binding-win32-x64-msvc': 1.3.2 - - rollup-plugin-bundle-stats@4.23.1(core-js@3.47.0)(rolldown@1.3.2)(rollup@4.68.3)(vite@8.3.8(@types/node@26.6.6)(esbuild@0.28.2)(terser@5.51.2)(tsx@4.23.15)(yaml@2.9.1)): + '@rolldown/binding-android-arm-eabi': 1.3.3 + '@rolldown/binding-android-arm64': 1.3.3 + '@rolldown/binding-darwin-arm64': 1.3.3 + '@rolldown/binding-darwin-x64': 1.3.3 + '@rolldown/binding-freebsd-x64': 1.3.3 + '@rolldown/binding-linux-arm-gnueabihf': 1.3.3 + '@rolldown/binding-linux-arm64-gnu': 1.3.3 + '@rolldown/binding-linux-arm64-musl': 1.3.3 + '@rolldown/binding-linux-ppc64-gnu': 1.3.3 + '@rolldown/binding-linux-s390x-gnu': 1.3.3 + '@rolldown/binding-linux-x64-gnu': 1.3.3 + '@rolldown/binding-linux-x64-musl': 1.3.3 + '@rolldown/binding-openharmony-arm64': 1.3.3 + '@rolldown/binding-wasm32-wasi': 1.3.3 + '@rolldown/binding-win32-arm64-msvc': 1.3.3 + '@rolldown/binding-win32-x64-msvc': 1.3.3 + + rollup-plugin-bundle-stats@4.23.1(core-js@3.47.0)(rolldown@1.3.3)(rollup@4.68.8)(vite@8.3.8(@types/node@26.6.6)(esbuild@0.28.2)(terser@5.51.4)(tsx@4.23.15)(yaml@2.9.1)): dependencies: '@bundle-stats/cli-utils': 4.23.1(core-js@3.47.0) - rollup-plugin-stats: 2.1.3(rolldown@1.3.2)(rollup@4.68.3)(vite@8.3.8(@types/node@26.6.6)(esbuild@0.28.2)(terser@5.51.2)(tsx@4.23.15)(yaml@2.9.1)) - rollup-plugin-webpack-stats: 3.1.3(rolldown@1.3.2)(rollup@4.68.3)(vite@8.3.8(@types/node@26.6.6)(esbuild@0.28.2)(terser@5.51.2)(tsx@4.23.15)(yaml@2.9.1)) + rollup-plugin-stats: 2.1.3(rolldown@1.3.3)(rollup@4.68.8)(vite@8.3.8(@types/node@26.6.6)(esbuild@0.28.2)(terser@5.51.4)(tsx@4.23.15)(yaml@2.9.1)) + rollup-plugin-webpack-stats: 3.1.3(rolldown@1.3.3)(rollup@4.68.8)(vite@8.3.8(@types/node@26.6.6)(esbuild@0.28.2)(terser@5.51.4)(tsx@4.23.15)(yaml@2.9.1)) tslib: 2.8.1 optionalDependencies: - rolldown: 1.3.2 - rollup: 4.68.3 - vite: 8.3.8(@types/node@26.6.6)(esbuild@0.28.2)(terser@5.51.2)(tsx@4.23.15)(yaml@2.9.1) + rolldown: 1.3.3 + rollup: 4.68.8 + vite: 8.3.8(@types/node@26.6.6)(esbuild@0.28.2)(terser@5.51.4)(tsx@4.23.15)(yaml@2.9.1) transitivePeerDependencies: - core-js - rollup-plugin-esbuild@6.2.1(esbuild@0.28.2)(rollup@4.68.3)(supports-color@10.2.2): + rollup-plugin-esbuild@6.2.1(esbuild@0.28.2)(rollup@4.68.8)(supports-color@10.2.2): dependencies: debug: 4.4.3(supports-color@10.2.2) es-module-lexer: 1.7.0 esbuild: 0.28.2 get-tsconfig: 4.14.3 - rollup: 4.68.3 + rollup: 4.68.8 unplugin-utils: 0.2.5 transitivePeerDependencies: - supports-color - rollup-plugin-stats@2.1.3(rolldown@1.3.2)(rollup@4.68.3)(vite@8.3.8(@types/node@26.6.6)(esbuild@0.28.2)(terser@5.51.2)(tsx@4.23.15)(yaml@2.9.1)): + rollup-plugin-stats@2.1.3(rolldown@1.3.3)(rollup@4.68.8)(vite@8.3.8(@types/node@26.6.6)(esbuild@0.28.2)(terser@5.51.4)(tsx@4.23.15)(yaml@2.9.1)): optionalDependencies: - rolldown: 1.3.2 - rollup: 4.68.3 - vite: 8.3.8(@types/node@26.6.6)(esbuild@0.28.2)(terser@5.51.2)(tsx@4.23.15)(yaml@2.9.1) + rolldown: 1.3.3 + rollup: 4.68.8 + vite: 8.3.8(@types/node@26.6.6)(esbuild@0.28.2)(terser@5.51.4)(tsx@4.23.15)(yaml@2.9.1) - rollup-plugin-visualizer@7.1.3(rolldown@1.3.2)(rollup@4.68.3): + rollup-plugin-visualizer@7.1.3(rolldown@1.3.3)(rollup@4.68.8): dependencies: open: 11.0.4 picomatch: 4.0.7 source-map: 0.8.0 yargs: 18.2.0 optionalDependencies: - rolldown: 1.3.2 - rollup: 4.68.3 + rolldown: 1.3.3 + rollup: 4.68.8 - rollup-plugin-webpack-stats@3.1.3(rolldown@1.3.2)(rollup@4.68.3)(vite@8.3.8(@types/node@26.6.6)(esbuild@0.28.2)(terser@5.51.2)(tsx@4.23.15)(yaml@2.9.1)): + rollup-plugin-webpack-stats@3.1.3(rolldown@1.3.3)(rollup@4.68.8)(vite@8.3.8(@types/node@26.6.6)(esbuild@0.28.2)(terser@5.51.4)(tsx@4.23.15)(yaml@2.9.1)): dependencies: - rollup-plugin-stats: 2.1.3(rolldown@1.3.2)(rollup@4.68.3)(vite@8.3.8(@types/node@26.6.6)(esbuild@0.28.2)(terser@5.51.2)(tsx@4.23.15)(yaml@2.9.1)) + rollup-plugin-stats: 2.1.3(rolldown@1.3.3)(rollup@4.68.8)(vite@8.3.8(@types/node@26.6.6)(esbuild@0.28.2)(terser@5.51.4)(tsx@4.23.15)(yaml@2.9.1)) optionalDependencies: - rolldown: 1.3.2 - rollup: 4.68.3 - vite: 8.3.8(@types/node@26.6.6)(esbuild@0.28.2)(terser@5.51.2)(tsx@4.23.15)(yaml@2.9.1) + rolldown: 1.3.3 + rollup: 4.68.8 + vite: 8.3.8(@types/node@26.6.6)(esbuild@0.28.2)(terser@5.51.4)(tsx@4.23.15)(yaml@2.9.1) - rollup@4.68.3: + rollup@4.68.8: dependencies: '@types/estree': 1.0.10 optionalDependencies: - '@rollup/rollup-android-arm-eabi': 4.68.3 - '@rollup/rollup-android-arm64': 4.68.3 - '@rollup/rollup-android-x64': 4.68.3 - '@rollup/rollup-darwin-arm64': 4.68.3 - '@rollup/rollup-darwin-x64': 4.68.3 - '@rollup/rollup-freebsd-arm64': 4.68.3 - '@rollup/rollup-freebsd-x64': 4.68.3 - '@rollup/rollup-linux-arm-gnueabihf': 4.68.3 - '@rollup/rollup-linux-arm-musleabihf': 4.68.3 - '@rollup/rollup-linux-arm64-gnu': 4.68.3 - '@rollup/rollup-linux-arm64-musl': 4.68.3 - '@rollup/rollup-linux-loong64-gnu': 4.68.3 - '@rollup/rollup-linux-loong64-musl': 4.68.3 - '@rollup/rollup-linux-ppc64-gnu': 4.68.3 - '@rollup/rollup-linux-ppc64-musl': 4.68.3 - '@rollup/rollup-linux-riscv64-gnu': 4.68.3 - '@rollup/rollup-linux-riscv64-musl': 4.68.3 - '@rollup/rollup-linux-s390x-gnu': 4.68.3 - '@rollup/rollup-linux-x64-gnu': 4.68.3 - '@rollup/rollup-linux-x64-musl': 4.68.3 - '@rollup/rollup-openbsd-x64': 4.68.3 - '@rollup/rollup-openharmony-arm64': 4.68.3 - '@rollup/rollup-win32-arm64-msvc': 4.68.3 - '@rollup/rollup-win32-ia32-msvc': 4.68.3 - '@rollup/rollup-win32-x64-gnu': 4.68.3 - '@rollup/rollup-win32-x64-msvc': 4.68.3 + '@rollup/rollup-android-arm-eabi': 4.68.8 + '@rollup/rollup-android-arm64': 4.68.8 + '@rollup/rollup-android-x64': 4.68.8 + '@rollup/rollup-darwin-arm64': 4.68.8 + '@rollup/rollup-darwin-x64': 4.68.8 + '@rollup/rollup-freebsd-arm64': 4.68.8 + '@rollup/rollup-freebsd-x64': 4.68.8 + '@rollup/rollup-linux-arm-gnueabihf': 4.68.8 + '@rollup/rollup-linux-arm-musleabihf': 4.68.8 + '@rollup/rollup-linux-arm64-gnu': 4.68.8 + '@rollup/rollup-linux-arm64-musl': 4.68.8 + '@rollup/rollup-linux-loong64-gnu': 4.68.8 + '@rollup/rollup-linux-loong64-musl': 4.68.8 + '@rollup/rollup-linux-ppc64-gnu': 4.68.8 + '@rollup/rollup-linux-ppc64-musl': 4.68.8 + '@rollup/rollup-linux-riscv64-gnu': 4.68.8 + '@rollup/rollup-linux-riscv64-musl': 4.68.8 + '@rollup/rollup-linux-s390x-gnu': 4.68.8 + '@rollup/rollup-linux-x64-gnu': 4.68.8 + '@rollup/rollup-linux-x64-musl': 4.68.8 + '@rollup/rollup-openbsd-x64': 4.68.8 + '@rollup/rollup-openharmony-arm64': 4.68.8 + '@rollup/rollup-win32-arm64-msvc': 4.68.8 + '@rollup/rollup-win32-ia32-msvc': 4.68.8 + '@rollup/rollup-win32-x64-gnu': 4.68.8 + '@rollup/rollup-win32-x64-msvc': 4.68.8 fsevents: 2.3.3 run-applescript@7.1.0: {} @@ -14117,11 +13984,11 @@ snapshots: solid-js@1.9.19: dependencies: - csstype: 3.2.3 + csstype: 3.2.4 seroval: 1.6.12 seroval-plugins: 1.6.12(seroval@1.6.12) - source-map-js@1.2.2: {} + source-map-js@1.2.4: {} source-map-support@0.5.21: dependencies: @@ -14140,11 +14007,6 @@ snapshots: sql-escaper@1.5.2: {} - ssh-remote-port-forward@1.0.4: - dependencies: - '@types/ssh2': 0.5.52 - ssh2: 1.17.0 - ssh2@1.17.0: dependencies: asn1: 0.2.6 @@ -14331,7 +14193,7 @@ snapshots: minizlib: 3.1.0 yallist: 5.0.0 - tedious@20.3.9(supports-color@10.2.2): + tedious@20.4.1(supports-color@10.2.2): dependencies: '@azure/core-auth': 1.11.0(supports-color@10.2.2) '@azure/identity': 4.14.1(supports-color@10.2.2) @@ -14343,7 +14205,6 @@ snapshots: js-md4: 0.3.2 native-duplexpair: 1.0.0 transitivePeerDependencies: - - kerberos - supports-color teex@1.0.1: @@ -14353,7 +14214,7 @@ snapshots: - bare-abort-controller - react-native-b4a - terser@5.51.2: + terser@5.51.4: dependencies: '@jridgewell/source-map': 0.3.11 acorn: 8.19.0 @@ -14366,12 +14227,12 @@ snapshots: glob: 7.2.3 minimatch: 3.1.5 - testcontainers@12.2.1(bare-buffer@3.7.1)(supports-color@10.2.2): + testcontainers@12.2.2(bare-buffer@3.7.1)(supports-color@10.2.2): dependencies: '@balena/dockerignore': 1.0.2 '@types/dockerode': 4.0.2 archiver: 7.0.1(bare-buffer@3.7.1) - async-lock: 1.4.1 + async-lock: 1.5.0 byline: 5.0.0 debug: 4.4.3(supports-color@10.2.2) docker-compose: 1.5.0 @@ -14379,10 +14240,10 @@ snapshots: get-port: 5.1.1 proper-lockfile: 4.1.2 properties-reader: 3.0.1(supports-color@10.2.2) - ssh-remote-port-forward: 1.0.4 + ssh2: 1.17.0 tar-fs: 3.1.3(bare-buffer@3.7.1) tmp: 0.2.7 - undici: 8.12.4 + undici: 8.13.1 transitivePeerDependencies: - bare-abort-controller - bare-buffer @@ -14404,7 +14265,7 @@ snapshots: tiny-invariant@1.3.3: {} - tinybench@6.2.3: {} + tinybench@6.2.4: {} tinyexec@1.3.1: {} @@ -14554,7 +14415,7 @@ snapshots: undici@7.29.0: {} - undici@8.12.4: {} + undici@8.13.1: {} unenv@2.0.0-rc.24: dependencies: @@ -14604,7 +14465,7 @@ snapshots: verkit@0.5.0: {} - vite@8.3.8(@types/node@26.6.6)(esbuild@0.28.2)(terser@5.51.2)(tsx@4.23.15)(yaml@2.9.1): + vite@8.3.8(@types/node@26.6.6)(esbuild@0.28.2)(terser@5.51.4)(tsx@4.23.15)(yaml@2.9.1): dependencies: lightningcss: 1.33.0 picomatch: 4.0.7 @@ -14615,19 +14476,19 @@ snapshots: '@types/node': 26.6.6 esbuild: 0.28.2 fsevents: 2.3.3 - terser: 5.51.2 + terser: 5.51.4 tsx: 4.23.15 yaml: 2.9.1 vitest-websocket-mock@0.8.0(vitest@5.1.0): dependencies: mock-socket: 9.3.1 - vitest: 5.1.0(@edge-runtime/vm@5.0.0)(@opentelemetry/api@1.10.0)(@types/node@26.6.6)(@vitest/coverage-v8@5.1.0)(happy-dom@21.0.4)(jsdom@30.0.1)(vite@8.3.8(@types/node@26.6.6)(esbuild@0.28.2)(terser@5.51.2)(tsx@4.23.15)(yaml@2.9.1)) + vitest: 5.1.0(@edge-runtime/vm@5.0.0)(@opentelemetry/api@1.10.0)(@types/node@26.6.6)(@vitest/coverage-v8@5.1.0)(happy-dom@21.0.4)(jsdom@30.0.1)(vite@8.3.8(@types/node@26.6.6)(esbuild@0.28.2)(terser@5.51.4)(tsx@4.23.15)(yaml@2.9.1)) - vitest@5.1.0(@edge-runtime/vm@5.0.0)(@opentelemetry/api@1.10.0)(@types/node@26.6.6)(@vitest/coverage-v8@5.1.0)(happy-dom@21.0.4)(jsdom@30.0.1)(vite@8.3.8(@types/node@26.6.6)(esbuild@0.28.2)(terser@5.51.2)(tsx@4.23.15)(yaml@2.9.1)): + vitest@5.1.0(@edge-runtime/vm@5.0.0)(@opentelemetry/api@1.10.0)(@types/node@26.6.6)(@vitest/coverage-v8@5.1.0)(happy-dom@21.0.4)(jsdom@30.0.1)(vite@8.3.8(@types/node@26.6.6)(esbuild@0.28.2)(terser@5.51.4)(tsx@4.23.15)(yaml@2.9.1)): dependencies: '@types/chai': 5.2.3 - '@vitest/mocker': 5.1.0(vite@8.3.8(@types/node@26.6.6)(esbuild@0.28.2)(terser@5.51.2)(tsx@4.23.15)(yaml@2.9.1)) + '@vitest/mocker': 5.1.0(vite@8.3.8(@types/node@26.6.6)(esbuild@0.28.2)(terser@5.51.4)(tsx@4.23.15)(yaml@2.9.1)) chai: 6.3.0 es-module-lexer: 2.3.2 expect-type: 1.4.0 @@ -14635,10 +14496,10 @@ snapshots: obug: 3.0.0 picomatch: 4.0.7 std-env: 4.3.0 - tinybench: 6.2.3 + tinybench: 6.2.4 tinyexec: 1.3.1 tinyglobby: 0.2.17 - vite: 8.3.8(@types/node@26.6.6)(esbuild@0.28.2)(terser@5.51.2)(tsx@4.23.15)(yaml@2.9.1) + vite: 8.3.8(@types/node@26.6.6)(esbuild@0.28.2)(terser@5.51.4)(tsx@4.23.15)(yaml@2.9.1) why-is-node-running: 3.2.1 optionalDependencies: '@edge-runtime/vm': 5.0.0 @@ -14652,13 +14513,13 @@ snapshots: vlq@1.0.1: {} - vue@3.5.45(typescript@7.0.2): + vue@3.5.46(typescript@7.0.2): dependencies: - '@vue/compiler-dom': 3.5.45 - '@vue/compiler-sfc': 3.5.45 - '@vue/runtime-dom': 3.5.45 - '@vue/server-renderer': 3.5.45 - '@vue/shared': 3.5.45 + '@vue/compiler-dom': 3.5.46 + '@vue/compiler-sfc': 3.5.46 + '@vue/runtime-dom': 3.5.46 + '@vue/server-renderer': 3.5.46 + '@vue/shared': 3.5.46 optionalDependencies: typescript: 7.0.2 @@ -14771,8 +14632,6 @@ snapshots: ws@8.21.0: {} - ws@8.22.1: {} - ws@8.23.0: {} wsl-utils@1.0.1: diff --git a/.repos/effect/pnpm-workspace.yaml b/.repos/effect/pnpm-workspace.yaml index 83cd9417dbab1..2f223755d2ece 100644 --- a/.repos/effect/pnpm-workspace.yaml +++ b/.repos/effect/pnpm-workspace.yaml @@ -36,7 +36,7 @@ patchedDependencies: '@changesets/get-github-info@1.0.1': patches/@changesets__get-github-info@1.0.1.patch overrides: - # jsdom 30.1.0 fails under Bun when Vitest installs its window error handler. + # jsdom 30.1.0 and 31.0.1 fail under Bun when Vitest installs its window error handler. # Remove after a later jsdom release passes the Atom React and Solid suites under Bun. # Upstream changes: https://github.com/jsdom/jsdom/compare/v30.0.1...v30.1.0 jsdom: ~30.0.1 From 54994c006097f20a9f07dc69a07a8bc439798c2c Mon Sep 17 00:00:00 2001 From: Julius Marminge <51714798+juliusmarminge@users.noreply.github.com> Date: Fri, 27 Nov 2026 00:51:02 -0800 Subject: [PATCH 2/3] chore(deps): update Effect to 4.1.6 4.1.6 ships the SqlClient transaction-context change from #41379, so that part of the effect patch is dropped. The MCP events and vitest patches are ported unchanged, and the spawn seam is rebuilt on 4.1.6's spawner. Co-Authored-By: Claude Opus 5.5 --- .../remoteRegistration.test.ts | 42 +- .../src/provider/AntigravityAuth.test.ts | 2 +- .../@effect__platform-node-shared@4.1.5.patch | 93 -- .../@effect__platform-node-shared@4.1.6.patch | 95 ++ ....1.5.patch => @effect__vitest@4.1.6.patch} | 4 +- ...{effect@4.1.5.patch => effect@4.1.6.patch} | 93 +- pnpm-lock.yaml | 914 +++++++++--------- pnpm-workspace.yaml | 46 +- 8 files changed, 622 insertions(+), 667 deletions(-) delete mode 100644 patches/@effect__platform-node-shared@4.1.5.patch create mode 100644 patches/@effect__platform-node-shared@4.1.6.patch rename patches/{@effect__vitest@4.1.5.patch => @effect__vitest@4.1.6.patch} (98%) rename patches/{effect@4.1.5.patch => effect@4.1.6.patch} (97%) diff --git a/apps/mobile/src/features/agent-awareness/remoteRegistration.test.ts b/apps/mobile/src/features/agent-awareness/remoteRegistration.test.ts index 54048d0234a8d..727583dfae547 100644 --- a/apps/mobile/src/features/agent-awareness/remoteRegistration.test.ts +++ b/apps/mobile/src/features/agent-awareness/remoteRegistration.test.ts @@ -276,6 +276,28 @@ const layerRelayTest = ManagedRelayLayer.layer("https://relay.example.test").pip Layer.merge(layerPersistenceTest), ); +// A relay that issues a DPoP token and accepts every registration. +const stubRelayFetch = () => { + const fetchMock = vi.fn((request: RequestInfo | URL) => { + const url = request instanceof Request ? request.url : String(request); + return Promise.resolve( + Response.json( + url.endsWith("/v1/client/dpop-token") + ? { + access_token: "relay-dpop-token", + issued_token_type: "urn:ietf:params:oauth:token-type:access_token", + token_type: "DPoP", + expires_in: 300, + scope: "mobile:registration", + } + : { ok: true }, + ), + ); + }); + vi.stubGlobal("fetch", fetchMock); + return fetchMock; +}; + const runBackgroundOperations = Effect.fn("TestRemoteRegistration.runBackgroundOperations")( function* () { let idlePasses = 0; @@ -574,23 +596,7 @@ describe("makeRelayDeviceRegistrationRequest", () => { }); it.effect("registers the APNs device when cloud auth becomes available", () => { - const fetchMock = vi.fn((request: RequestInfo | URL) => { - const url = request instanceof Request ? request.url : String(request); - return Promise.resolve( - Response.json( - url.endsWith("/v1/client/dpop-token") - ? { - access_token: "relay-dpop-token", - issued_token_type: "urn:ietf:params:oauth:token-type:access_token", - token_type: "DPoP", - expires_in: 300, - scope: "mobile:registration", - } - : { ok: true }, - ), - ); - }); - vi.stubGlobal("fetch", fetchMock); + const fetchMock = stubRelayFetch(); Constants.expoConfig!.extra = { relay: { url: "https://relay.example.test/", @@ -634,6 +640,7 @@ describe("makeRelayDeviceRegistrationRequest", () => { }); it.effect("keeps a registered status when a later refresh fails", () => { + stubRelayFetch(); Constants.expoConfig!.extra = { relay: { url: "https://relay.example.test/", @@ -670,6 +677,7 @@ describe("makeRelayDeviceRegistrationRequest", () => { }); it.effect("does not re-register the same account when nothing has changed", () => { + stubRelayFetch(); Constants.expoConfig!.extra = { relay: { url: "https://relay.example.test/", diff --git a/apps/server/src/provider/AntigravityAuth.test.ts b/apps/server/src/provider/AntigravityAuth.test.ts index 58eb3344f638d..4ea9f4b6ae015 100644 --- a/apps/server/src/provider/AntigravityAuth.test.ts +++ b/apps/server/src/provider/AntigravityAuth.test.ts @@ -519,7 +519,7 @@ it.layer(Layer.mergeAll(NodeServices.layer, NodeCrypto.layer))("AntigravityAuth" yield* Deferred.succeed(deliveryGate, undefined); const failed = yield* phase(harness.auth, "failed"); assert.include(failed.message ?? "", "Could not deliver"); - assert.isTrue(harness.events.includes("process-close")); + yield* Deferred.await(harness.closed); }), ); diff --git a/patches/@effect__platform-node-shared@4.1.5.patch b/patches/@effect__platform-node-shared@4.1.5.patch deleted file mode 100644 index 6e957eac98f41..0000000000000 --- a/patches/@effect__platform-node-shared@4.1.5.patch +++ /dev/null @@ -1,93 +0,0 @@ -diff --git a/dist/NodeChildProcessSpawner.d.ts b/dist/NodeChildProcessSpawner.d.ts -index 213be4fa2647d800b320fa483c9ede801366fd73..bb7a2bb97e976f85af4760a7299db39506318155 100644 ---- a/dist/NodeChildProcessSpawner.d.ts -+++ b/dist/NodeChildProcessSpawner.d.ts -@@ -31,6 +31,8 @@ - * @stability unstable - * @since 4.0.0 - */ -+import type * as NodeChildProcess from "node:child_process"; -+import type { Readable, Writable } from "node:stream"; - import type * as Arr from "effect/Array"; - import * as FileSystem from "effect/FileSystem"; - import * as Layer from "effect/Layer"; -@@ -45,6 +47,19 @@ import { ChildProcessSpawner } from "effect/process/ChildProcessSpawner"; - * @since 4.0.0 - */ - export declare const layer: Layer.Layer; -+export interface SpawnedChildProcess extends NodeJS.EventEmitter { -+ readonly pid?: number | undefined; -+ readonly exitCode: number | null; -+ readonly signalCode: NodeJS.Signals | null; -+ readonly stdin: Writable | null; -+ readonly stdout: Readable | null; -+ readonly stderr: Readable | null; -+ readonly stdio: ReadonlyArray; -+ kill(signal?: NodeJS.Signals | number): boolean; -+ ref(): void; -+ unref(): void; -+} -+export declare const layerWithSpawn: (spawnProcess: (command: string, args: ReadonlyArray, options: NodeChildProcess.SpawnOptions) => SpawnedChildProcess) => Layer.Layer; - /** - * Result of flattening a pipeline of commands. - * -diff --git a/dist/NodeChildProcessSpawner.js b/dist/NodeChildProcessSpawner.js -index 08d50b16dfe564551f1bffc7cae2d3b53805e172..fbecacc8b39a9eab7725a799aa5019c36bcc32ab 100644 ---- a/dist/NodeChildProcessSpawner.js -+++ b/dist/NodeChildProcessSpawner.js -@@ -81,16 +81,26 @@ const isProcessAlive = (command, childProcess) => { - return isUnsignallableProcessGroup(error); - } - }; --const taskkill = (childProcess, onExit = () => {}) => { -- if (hasExited(childProcess)) { -- onExit(null); -- return; -- } -- NodeChildProcess.execFile("taskkill", ["/pid", String(childProcess.pid), "/T", "/F"], { -- windowsHide: true -- }, onExit); --}; --const make = /*#__PURE__*/Effect.gen(function* () { -+const makeWithSpawn = spawnProcess => Effect.gen(function* () { -+ // Starts taskkill through the injected spawner so it gets the same off-thread launch as commands. -+ const taskkill = (childProcess, onExit = () => {}) => { -+ if (hasExited(childProcess)) { -+ onExit(null); -+ return; -+ } -+ let done = false; -+ const finish = error => { -+ if (done) return; -+ done = true; -+ onExit(error); -+ }; -+ const killer = spawnProcess("taskkill", ["/pid", String(childProcess.pid), "/T", "/F"], { -+ stdio: "ignore", -+ windowsHide: true -+ }); -+ killer.on("error", finish); -+ killer.on("exit", code => finish(code === 0 ? null : new Error(`taskkill exited with code ${code}`))); -+ }; - const fs = yield* FileSystem.FileSystem; - const path = yield* Path.Path; - const resolveWorkingDirectory = Effect.fnUntraced(function* (options) { -@@ -335,7 +345,7 @@ const make = /*#__PURE__*/Effect.gen(function* () { - }; - const spawn = (command, spawnOptions) => Effect.callback(resume => { - const deferred = Deferred.makeUnsafe(); -- const handle = NodeChildProcess.spawn(command.command, command.args.map(unwrap), spawnOptions); -+ const handle = spawnProcess(command.command, command.args.map(unwrap), spawnOptions); - handle.on("error", error => { - // Node copies the arguments into `spawnargs`. - if (command.args.some(Redacted.isRedacted)) { -@@ -665,7 +675,8 @@ const make = /*#__PURE__*/Effect.gen(function* () { - * @category layers - * @since 4.0.0 - */ --export const layer = /*#__PURE__*/Layer.effect(ChildProcessSpawner, make); -+export const layer = /*#__PURE__*/Layer.effect(ChildProcessSpawner, /*#__PURE__*/makeWithSpawn(NodeChildProcess.spawn)); -+export const layerWithSpawn = spawnProcess => Layer.effect(ChildProcessSpawner, makeWithSpawn(spawnProcess)); - /** - * Flattens a `Command` into an array of `StandardCommand`s along with pipe - * options for each connection. diff --git a/patches/@effect__platform-node-shared@4.1.6.patch b/patches/@effect__platform-node-shared@4.1.6.patch new file mode 100644 index 0000000000000..f6a01b5491c36 --- /dev/null +++ b/patches/@effect__platform-node-shared@4.1.6.patch @@ -0,0 +1,95 @@ +diff --git a/dist/NodeChildProcessSpawner.d.ts b/dist/NodeChildProcessSpawner.d.ts +index ac7b044..0ad793f 100644 +--- a/dist/NodeChildProcessSpawner.d.ts ++++ b/dist/NodeChildProcessSpawner.d.ts +@@ -35,6 +35,8 @@ + * @stability unstable + * @since 4.0.0 + */ ++import type * as NodeChildProcess from "node:child_process"; ++import type { Readable, Writable } from "node:stream"; + import type * as Arr from "effect/Array"; + import * as Context from "effect/Context"; + import * as Duration from "effect/Duration"; +@@ -54,6 +56,19 @@ import { ChildProcessSpawner, ProcessId } from "effect/process/ChildProcessSpawn + * @since 4.0.0 + */ + export declare const layer: Layer.Layer; ++export interface SpawnedChildProcess extends NodeJS.EventEmitter { ++ readonly pid?: number | undefined; ++ readonly exitCode: number | null; ++ readonly signalCode: NodeJS.Signals | null; ++ readonly stdin: Writable | null; ++ readonly stdout: Readable | null; ++ readonly stderr: Readable | null; ++ readonly stdio: ReadonlyArray; ++ kill(signal?: NodeJS.Signals | number): boolean; ++ ref(): void; ++ unref(): void; ++} ++export declare const layerWithSpawn: (spawnProcess: (command: string, args: ReadonlyArray, options: NodeChildProcess.SpawnOptions) => SpawnedChildProcess) => Layer.Layer; + declare const ProxyProcess_base: Context.ServiceClass>; + }>; +diff --git a/dist/NodeChildProcessSpawner.js b/dist/NodeChildProcessSpawner.js +index 0257098..f166bc3 100644 +--- a/dist/NodeChildProcessSpawner.js ++++ b/dist/NodeChildProcessSpawner.js +@@ -88,20 +88,36 @@ const isProcessAlive = (command, childProcess) => { + return isUnsignallableProcessGroup(error); + } + }; +-const taskkill = (childProcess, onExit = () => {}) => { ++const taskkill = (childProcess, spawnProcess, onExit = () => {}) => { + if (hasExited(childProcess)) { + onExit(null); + return; + } +- NodeChildProcess.execFile("taskkill", ["/pid", String(childProcess.pid), "/T", "/F"], { ++ if (spawnProcess === undefined) { ++ NodeChildProcess.execFile("taskkill", ["/pid", String(childProcess.pid), "/T", "/F"], { ++ windowsHide: true ++ }, onExit); ++ return; ++ } ++ // Starts taskkill through the injected spawner so it gets the same off-thread launch as commands. ++ let done = false; ++ const finish = error => { ++ if (done) return; ++ done = true; ++ onExit(error); ++ }; ++ const killer = spawnProcess("taskkill", ["/pid", String(childProcess.pid), "/T", "/F"], { ++ stdio: "ignore", + windowsHide: true +- }, onExit); ++ }); ++ killer.on("error", finish); ++ killer.on("exit", code => finish(code === 0 ? null : new Error(`taskkill exited with code ${code}`))); + }; + const spawnDirect = (command, args, options) => NodeChildProcess.spawn(command, args, options); + // Returns the function that launches a command. The proxy process layer waits + // here, interruptibly, for a proxy process that is ready, since the launch + // itself cannot be interrupted. +-const makeWith = /*#__PURE__*/Effect.fnUntraced(function* (prepareSpawn) { ++const makeWith = /*#__PURE__*/Effect.fnUntraced(function* (prepareSpawn, killSpawn) { + const fs = yield* FileSystem.FileSystem; + const path = yield* Path.Path; + const resolveWorkingDirectory = Effect.fnUntraced(function* (options) { +@@ -372,7 +388,7 @@ const makeWith = /*#__PURE__*/Effect.fnUntraced(function* (prepareSpawn) { + const killProcessGroup = (command, childProcess, signal) => { + if (globalThis.process.platform === "win32") { + return Effect.callback(resume => { +- taskkill(childProcess, error => { ++ taskkill(childProcess, killSpawn, error => { + if (error) { + resume(Effect.fail(toPlatformError("kill", toError(error), command))); + } else { +@@ -813,6 +829,7 @@ export class ProxyProcess extends /*#__PURE__*/Context.Service()("@effect/platfo + * @category layers + * @since 4.1.6 + */ ++export const layerWithSpawn = spawnProcess => Layer.effect(ChildProcessSpawner, makeWith(Effect.succeed(spawnProcess), spawnProcess)); + export const layerProxyProcess = options => Layer.effectContext(Effect.gen(function* () { + if (globalThis.process.platform === "win32") { + return yield* Effect.fail(PlatformError.systemError({ diff --git a/patches/@effect__vitest@4.1.5.patch b/patches/@effect__vitest@4.1.6.patch similarity index 98% rename from patches/@effect__vitest@4.1.5.patch rename to patches/@effect__vitest@4.1.6.patch index f25ae532b957f..4df9b83d58c67 100644 --- a/patches/@effect__vitest@4.1.5.patch +++ b/patches/@effect__vitest@4.1.6.patch @@ -59,7 +59,7 @@ index b97edbe..7dfd64a 100644 // Primitives // ---------------------------- diff --git a/package.json b/package.json -index 068e75e..d14a80e 100644 +index 8f6391d..f6b794d 100644 --- a/package.json +++ b/package.json @@ -37,7 +37,6 @@ @@ -67,7 +67,7 @@ index 068e75e..d14a80e 100644 }, "peerDependencies": { - "vitest": ">=5.0.0 <6.0.0", - "effect": "^4.1.5" + "effect": "^4.1.6" }, "devDependencies": { diff --git a/src/index.ts b/src/index.ts diff --git a/patches/effect@4.1.5.patch b/patches/effect@4.1.6.patch similarity index 97% rename from patches/effect@4.1.5.patch rename to patches/effect@4.1.6.patch index e1b4bfd499829..a1793fd5a2bc1 100644 --- a/patches/effect@4.1.5.patch +++ b/patches/effect@4.1.6.patch @@ -1,5 +1,5 @@ diff --git a/dist/ai/McpSchema.d.ts b/dist/ai/McpSchema.d.ts -index 8f86c27..aed42ae 100644 +index f5e7ced..d7b6560 100644 --- a/dist/ai/McpSchema.d.ts +++ b/dist/ai/McpSchema.d.ts @@ -941,6 +941,52 @@ export declare const HEADER_MISMATCH_ERROR_CODE: -32020; @@ -381,7 +381,7 @@ index bff6370..0a6962c 100644 // ============================================================================= /** diff --git a/dist/ai/McpServer.d.ts b/dist/ai/McpServer.d.ts -index fe6f18e..c67169e 100644 +index 5a676a7..49d0793 100644 --- a/dist/ai/McpServer.d.ts +++ b/dist/ai/McpServer.d.ts @@ -17,6 +17,7 @@ import * as Context from "../Context.ts"; @@ -400,7 +400,7 @@ index fe6f18e..c67169e 100644 import type * as Types from "../Types.ts"; import type * as McpProtocol from "./McpProtocol.ts"; import * as McpSchema from "./McpSchema.ts"; -@@ -113,7 +115,7 @@ export interface MiddlewareSuccess { +@@ -114,7 +116,7 @@ export interface MiddlewareSuccess { * @category middleware * @since 4.0.0 */ @@ -409,11 +409,10 @@ index fe6f18e..c67169e 100644 /** * Request metadata passed to MCP middleware. * -@@ -1276,6 +1278,266 @@ export declare const registerSkill: (options: SkillOptions) => Effect.Effect Layer.Layer; -+ +@@ -1426,6 +1428,265 @@ export declare const skill: { + */ + (options: SkillOptions): Layer.Layer; + }; +/** + * A failure an event handler reports to the client: a JSON-RPC error on a + * poll or when a push stream opens, and `notifications/events/terminated` @@ -677,7 +676,7 @@ index fe6f18e..c67169e 100644 * Registers an MCP prompt from an Effect program. * diff --git a/dist/ai/McpServer.js b/dist/ai/McpServer.js -index 4bf6bca..5ad258e 100644 +index 6c3f978..c41ef36 100644 --- a/dist/ai/McpServer.js +++ b/dist/ai/McpServer.js @@ -16,6 +16,8 @@ import * as Cause from "../Cause.js"; @@ -705,7 +704,7 @@ index 4bf6bca..5ad258e 100644 import * as InternalStructuredOutput from "./internal/structured-output.js"; import * as McpSchema from "./McpSchema.js"; import { CallToolResult, ElicitationDeclined, EnabledWhen, GetPromptResult, InternalError, InvalidParams, InvalidRequest, isParam, McpRequestContext, McpServerClient, McpServerClientMiddleware, MethodNotFound, Prompt, Resource, ResourceTemplate, ServerNotificationRpcs, TextContent, Tool as McpTool, ToolJson } from "./McpSchema.js"; -@@ -413,6 +417,9 @@ const notFound = (method, target) => { +@@ -414,6 +418,9 @@ const notFound = (method, target) => { return new McpCore.SkillNotFound({ uri: target }); @@ -715,10 +714,10 @@ index 4bf6bca..5ad258e 100644 } }; const isHidden = error => error instanceof Hidden; -@@ -2637,6 +2644,155 @@ export const registerSkill = /*#__PURE__*/Effect.fnUntraced(function* (options) +@@ -2643,6 +2650,155 @@ const registerSkillFiles = /*#__PURE__*/Effect.fnUntraced(function* (options) { * @since 4.1.1 */ - export const skill = options => Layer.effectDiscard(registerSkill(options)); + export const skill = (skillOrOptions, registration) => Layer.effectDiscard(registerSkillFiles(toSkillOptions(skillOrOptions, registration))); +// ============================================================================= +// Events +// ============================================================================= @@ -2113,7 +2112,7 @@ index ba6c830..1e58fb9 100644 // Prompts // ============================================================================= diff --git a/src/ai/McpServer.ts b/src/ai/McpServer.ts -index 4c2e191..bedd064 100644 +index d80028c..48f66e3 100644 --- a/src/ai/McpServer.ts +++ b/src/ai/McpServer.ts @@ -16,6 +16,8 @@ import * as Cause from "../Cause.ts" @@ -2141,7 +2140,7 @@ index 4c2e191..bedd064 100644 import * as InternalStructuredOutput from "./internal/structured-output.ts" import type * as McpProtocol from "./McpProtocol.ts" import * as McpSchema from "./McpSchema.ts" -@@ -344,6 +348,9 @@ export type MiddlewareMethod = +@@ -345,6 +349,9 @@ export type MiddlewareMethod = | "skills/list" | "skills/get" | "resources/directory/read" @@ -2151,7 +2150,7 @@ index 4c2e191..bedd064 100644 /** * Request metadata passed to MCP middleware. -@@ -819,7 +826,14 @@ const internalError = new InternalError({ message: "Internal error" }) +@@ -820,7 +827,14 @@ const internalError = new InternalError({ message: "Internal error" }) const rejectWith = (error: McpErrorBase) => Effect.fail(new McpCore.RequestRejected({ code: error.code, message: error.message, data: error.data, error })) @@ -2167,7 +2166,7 @@ index 4c2e191..bedd064 100644 type ListMethod = Exclude -@@ -829,6 +843,8 @@ interface NotFoundErrors { +@@ -830,6 +844,8 @@ interface NotFoundErrors { readonly "prompts/get": McpCore.PromptNotFound readonly "completion/complete": InvalidParams readonly "skills/get": McpCore.SkillNotFound @@ -2176,7 +2175,7 @@ index 4c2e191..bedd064 100644 } const notFound = (method: CallMethod, target: string): NotFoundErrors[CallMethod] => { -@@ -843,6 +859,9 @@ const notFound = (method: CallMethod, target: string): NotFoundErrors[CallMethod +@@ -844,6 +860,9 @@ const notFound = (method: CallMethod, target: string): NotFoundErrors[CallMethod return new InvalidParams({ message: "Unknown completion reference or argument" }) case "skills/get": return new McpCore.SkillNotFound({ uri: target }) @@ -2186,9 +2185,9 @@ index 4c2e191..bedd064 100644 } } -@@ -4134,6 +4153,404 @@ export const registerSkill: (options: SkillOptions) => Effect.Effect => - Layer.effectDiscard(registerSkill(options)) +@@ -4291,6 +4310,404 @@ export const skill: { + } = (skillOrOptions: Skill.Skill | SkillOptions, registration?: SkillRegistration) => + Layer.effectDiscard(registerSkillFiles(toSkillOptions(skillOrOptions, registration))) +// ============================================================================= +// Events @@ -4084,57 +4083,3 @@ index 0000000..5b53d08 + size: Effect.sync(() => subscriptions.size) + } satisfies Webhooks +}) -diff --git a/dist/sql/SqlClient.js b/dist/sql/SqlClient.js ---- a/dist/sql/SqlClient.js -+++ b/dist/sql/SqlClient.js -@@ -238,6 +238,9 @@ - log: "Unhandled", - message: "Unhandled error in SqlClient.afterCommit callback" - }); -+// The transaction context extends the fiber's own, so merging the two would only copy every -+// service twice per transaction and savepoint. -+const provideTransactionContext = (effect, services, context) => Effect.updateContext(effect, current => current === services ? context : Context.merge(current, context)); - const makeAfterCommit = transactionService => effect => Effect.withFiber(fiber => { - const transaction = Context.getOrUndefined(fiber.context, transactionService); - const buffer = transaction && afterCommitBuffers.get(transaction); -@@ -328,7 +331,7 @@ - const transaction = Effect.flatMap(conn, ([scope, conn]) => start(conn).pipe(Effect.flatMap(() => { - const level = [conn, id]; - afterCommitBuffers.set(level, buffer); -- return Effect.onExitPrimitive(Effect.provideContext(restore(effect), services.pipe(Context.add(options.transactionService, level), Context.add(CurrentTransactionService, options.transactionService), reactivity ? Context.add(Reactivity, deferInvalidations(reactivity)) : identity, Context.add(transactionSemaphore, Semaphore.makeUnsafe(1)), Context.add(Tracer.ParentSpan, span))), exit => { -+ return Effect.onExitPrimitive(provideTransactionContext(restore(effect), services, services.pipe(Context.add(options.transactionService, level), Context.add(CurrentTransactionService, options.transactionService), reactivity ? Context.add(Reactivity, deferInvalidations(reactivity)) : identity, Context.add(transactionSemaphore, Semaphore.makeUnsafe(1)), Context.add(Tracer.ParentSpan, span))), exit => { - buffer.open = false; - // The savepoint ended with its parent, and the connection - // may already be in another transaction. -diff --git a/src/sql/SqlClient.ts b/src/sql/SqlClient.ts ---- a/src/sql/SqlClient.ts -+++ b/src/sql/SqlClient.ts -@@ -596,6 +596,17 @@ - const runAfterCommit = (effect: Effect.Effect): Effect.Effect => - Effect.ignoreCause(effect, { log: "Unhandled", message: "Unhandled error in SqlClient.afterCommit callback" }) - -+// The transaction context extends the fiber's own, so merging the two would only copy every -+// service twice per transaction and savepoint. -+const provideTransactionContext = ( -+ effect: Effect.Effect, -+ services: Context.Context, -+ context: Context.Context -+): Effect.Effect> => -+ Effect.updateContext(effect, (current: Context.Context>) => -+ (current === services ? context : Context.merge(current, context)) as Context.Context -+ ) -+ - const makeAfterCommit = - (transactionService: Context.Key) => - (effect: Effect.Effect): Effect.Effect => -@@ -747,8 +758,9 @@ - const level = [conn, id] as const - afterCommitBuffers.set(level, buffer) - return Effect.onExitPrimitive( -- Effect.provideContext( -+ provideTransactionContext( - restore(effect), -+ services, - services.pipe( - Context.add(options.transactionService, level), - Context.add(CurrentTransactionService, options.transactionService), diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index ed6efe2713dec..e959f195ad519 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -183,14 +183,14 @@ catalogs: specifier: 1.0.0-rc.18 version: 1.0.0-rc.18 '@effect/graphql-generator': - specifier: 4.1.5 - version: 4.1.5 + specifier: 4.1.6 + version: 4.1.6 '@effect/openapi-generator': - specifier: 4.1.5 - version: 4.1.5 + specifier: 4.1.6 + version: 4.1.6 '@effect/sql-sqlite-do': - specifier: 4.1.5 - version: 4.1.5 + specifier: 4.1.6 + version: 4.1.6 '@noble/curves': specifier: 1.9.1 version: 1.9.1 @@ -327,12 +327,12 @@ overrides: '@clerk/expo': 4.17.6 '@clerk/react': 6.19.6 '@clerk/shared': 4.49.0 - '@effect/atom-react': 4.1.5 - '@effect/platform-bun': 4.1.5 - '@effect/platform-node': 4.1.5 - '@effect/platform-node-shared': 4.1.5 - '@effect/sql-pg': 4.1.5 - '@effect/vitest': 4.1.5 + '@effect/atom-react': 4.1.6 + '@effect/platform-bun': 4.1.6 + '@effect/platform-node': 4.1.6 + '@effect/platform-node-shared': 4.1.6 + '@effect/sql-pg': 4.1.6 + '@effect/vitest': 4.1.6 '@effect/vitest>vitest': '-' '@expo/dom-webview': 58.0.2 expo-constants: 58.0.16 @@ -344,9 +344,9 @@ overrides: '@tailwindcss/oxide': 4.3.3 '@tailwindcss/vite': 4.3.3 '@types/node': 24.12.4 - effect: 4.1.5 - '@opencode/protocol>effect': 4.1.5 - '@opencode/schema>effect': 4.1.5 + effect: 4.1.6 + '@opencode/protocol>effect': 4.1.6 + '@opencode/schema>effect': 4.1.6 node-abi: 4.33.0 '@react-native/metro-config': 0.88.1 electron-webauthn>@electron-webauthn/macos: 1.3.1 @@ -370,8 +370,8 @@ patchedDependencies: '@alchemy.run/test@2.0.0-beta.85': 29c0539ea71d9cc372f0b16558640599beb9bc609605feb2a493da268d72713e '@clerk/expo-native-components@0.4.8': 7a808b92da8460750b85818552e13be3fb73d111691c7db76965970351e124e4 '@cursor/sdk@1.5.0': 7fe8889d7916196c56006cf15a39abba4099feb2c567b4030b82a09364cee500 - '@effect/platform-node-shared@4.1.5': 06952843c6f431ca83c78762fd18d23cda76883801049ee311feced2438ecf14 - '@effect/vitest@4.1.5': dd0bf2b1ae0f63aff0d620ebc67b82d19759b3fa69a608ef85e2a5b40b4d46c5 + '@effect/platform-node-shared@4.1.6': af6bf6e9364037fa069fe80678a04acf389d8d5883600500a7afe5ab0ce6e9bc + '@effect/vitest@4.1.6': f87ba071dd4f5cfa3b1ba14d5d59363e64372cd49af4d8282c322939e6bf3af2 '@exodus/bytes@1.15.1': ceab67463db8cb74dcb2ced48eff4cc8ae9de925ae4cd2173a59a0dfba667bd8 '@expo/ui@58.0.29': 2346ac02073363a401e85357e541055e9737bcbc1cdcb63e056cda9368fa79f6 '@ff-labs/fff-node@0.11.0': 93f62a76399b435a76588b2bef237db0a1e85880c1ac0d0759c416e9cc579252 @@ -386,7 +386,7 @@ patchedDependencies: alchemy@2.0.0-beta.85: 07cc8c7e14b3b9af143ddd40a059f117c27e55139fbf20bd5dde2eb30509cedd app-builder-lib@26.16.1: 0fbe9ae51783f5768ebe197d12d1fdb7d477a08c92e5db2f6356bcce62613c53 dbus-next@0.10.2: cfff57561b0ee59b5addb3b2e6c6f20906e967507a530ab67e8db8108e520ba4 - effect@4.1.5: 14a7acd734809d8dddbf2c19c4ec01fdd2ffae60a612de42b5ed29860216052a + effect@4.1.6: c13237f64561426c002130285a9832acc5bb6ab42fd81e020b306429757ddda1 electron-updater@6.8.9: 91b5648a7eed42761523ef542ebb7e548b037eda41d66533c8152ac65ac72155 expo-audio@58.0.12: ba2ac6874680097b41e03051641696887cc84e875ca157075aa7aeb33e200cb2 expo-modules-core@58.1.0: 664c5922b030643a22ce05bb70f7b24565a100a9fdb3881f8693affbe0ba3d99 @@ -445,8 +445,8 @@ importers: specifier: 0.15.4 version: 0.15.4 '@effect/platform-node': - specifier: 4.1.5 - version: 4.1.5(bufferutil@4.1.0)(effect@4.1.5(patch_hash=14a7acd734809d8dddbf2c19c4ec01fdd2ffae60a612de42b5ed29860216052a))(redis@6.2.1)(utf-8-validate@6.0.6) + specifier: 4.1.6 + version: 4.1.6(bufferutil@4.1.0)(effect@4.1.6(patch_hash=c13237f64561426c002130285a9832acc5bb6ab42fd81e020b306429757ddda1))(redis@6.2.1)(utf-8-validate@6.0.6) '@napi-rs/keyring': specifier: ^1.3.0 version: 1.3.0 @@ -469,8 +469,8 @@ importers: specifier: 0.10.2 version: 0.10.2(patch_hash=cfff57561b0ee59b5addb3b2e6c6f20906e967507a530ab67e8db8108e520ba4) effect: - specifier: 4.1.5 - version: 4.1.5(patch_hash=14a7acd734809d8dddbf2c19c4ec01fdd2ffae60a612de42b5ed29860216052a) + specifier: 4.1.6 + version: 4.1.6(patch_hash=c13237f64561426c002130285a9832acc5bb6ab42fd81e020b306429757ddda1) electron: specifier: 44.10.1 version: 44.10.1(supports-color@8.1.1) @@ -500,8 +500,8 @@ importers: version: 7.4.2 devDependencies: '@effect/vitest': - specifier: 4.1.5 - version: 4.1.5(patch_hash=dd0bf2b1ae0f63aff0d620ebc67b82d19759b3fa69a608ef85e2a5b40b4d46c5)(@astrojs/compiler-rs@0.5.1)(@types/node@24.12.4)(@vitest/browser-playwright@5.1.1)(@vitest/ui@5.1.1)(@volar/typescript@2.4.28(typescript@6.0.3))(bufferutil@4.1.0)(effect@4.1.5(patch_hash=14a7acd734809d8dddbf2c19c4ec01fdd2ffae60a612de42b5ed29860216052a))(esbuild@0.28.2)(jiti@2.7.0)(jsdom@30.1.0(@noble/hashes@1.8.0))(playwright@1.64.1)(terser@5.48.0)(typescript@6.0.3)(unrun@0.2.39)(utf-8-validate@6.0.6)(yaml@2.9.0) + specifier: 4.1.6 + version: 4.1.6(patch_hash=f87ba071dd4f5cfa3b1ba14d5d59363e64372cd49af4d8282c322939e6bf3af2)(@astrojs/compiler-rs@0.5.1)(@types/node@24.12.4)(@vitest/browser-playwright@5.1.1)(@vitest/ui@5.1.1)(@volar/typescript@2.4.28(typescript@6.0.3))(bufferutil@4.1.0)(effect@4.1.6(patch_hash=c13237f64561426c002130285a9832acc5bb6ab42fd81e020b306429757ddda1))(esbuild@0.28.2)(jiti@2.7.0)(jsdom@30.1.0(@noble/hashes@1.8.0))(playwright@1.64.1)(terser@5.48.0)(typescript@6.0.3)(unrun@0.2.39)(utf-8-validate@6.0.6)(yaml@2.9.0) '@types/node': specifier: 24.12.4 version: 24.12.4 @@ -561,8 +561,8 @@ importers: specifier: 0.4.8 version: 0.4.8(patch_hash=7a808b92da8460750b85818552e13be3fb73d111691c7db76965970351e124e4)(expo@58.0.26)(react-native@0.88.1(@babel/core@7.29.7(supports-color@8.1.1))(@react-native/metro-config@0.88.1(@babel/core@7.29.7(supports-color@8.1.1))(bufferutil@4.1.0)(supports-color@8.1.1)(utf-8-validate@6.0.6))(@types/react@19.3.0)(bufferutil@4.1.0)(react@19.3.0)(supports-color@8.1.1)(utf-8-validate@6.0.6))(react@19.3.0)(supports-color@8.1.1)(typescript@6.0.3) '@effect/atom-react': - specifier: 4.1.5 - version: 4.1.5(effect@4.1.5(patch_hash=14a7acd734809d8dddbf2c19c4ec01fdd2ffae60a612de42b5ed29860216052a))(react@19.3.0)(scheduler@0.28.0) + specifier: 4.1.6 + version: 4.1.6(effect@4.1.6(patch_hash=c13237f64561426c002130285a9832acc5bb6ab42fd81e020b306429757ddda1))(react@19.3.0)(scheduler@0.28.0) '@exodus/bytes': specifier: 1.15.1 version: 1.15.1(patch_hash=ceab67463db8cb74dcb2ced48eff4cc8ae9de925ae4cd2173a59a0dfba667bd8)(@noble/hashes@1.8.0) @@ -642,8 +642,8 @@ importers: specifier: 8.0.3 version: 8.0.3 effect: - specifier: 4.1.5 - version: 4.1.5(patch_hash=14a7acd734809d8dddbf2c19c4ec01fdd2ffae60a612de42b5ed29860216052a) + specifier: 4.1.6 + version: 4.1.6(patch_hash=c13237f64561426c002130285a9832acc5bb6ab42fd81e020b306429757ddda1) expo: specifier: 58.0.26 version: 58.0.26(f1276074af5eee14937223530600d31d) @@ -829,8 +829,8 @@ importers: specifier: ^7.29.7 version: 7.29.7(supports-color@8.1.1) '@effect/vitest': - specifier: 4.1.5 - version: 4.1.5(patch_hash=dd0bf2b1ae0f63aff0d620ebc67b82d19759b3fa69a608ef85e2a5b40b4d46c5)(@astrojs/compiler-rs@0.5.1)(@types/node@24.12.4)(@vitest/browser-playwright@5.1.1)(@vitest/ui@5.1.1)(@volar/typescript@2.4.28(typescript@6.0.3))(bufferutil@4.1.0)(effect@4.1.5(patch_hash=14a7acd734809d8dddbf2c19c4ec01fdd2ffae60a612de42b5ed29860216052a))(esbuild@0.28.2)(jiti@2.7.0)(jsdom@30.1.0(@noble/hashes@1.8.0))(playwright@1.64.1)(terser@5.48.0)(typescript@6.0.3)(unrun@0.2.39)(utf-8-validate@6.0.6)(yaml@2.9.0) + specifier: 4.1.6 + version: 4.1.6(patch_hash=f87ba071dd4f5cfa3b1ba14d5d59363e64372cd49af4d8282c322939e6bf3af2)(@astrojs/compiler-rs@0.5.1)(@types/node@24.12.4)(@vitest/browser-playwright@5.1.1)(@vitest/ui@5.1.1)(@volar/typescript@2.4.28(typescript@6.0.3))(bufferutil@4.1.0)(effect@4.1.6(patch_hash=c13237f64561426c002130285a9832acc5bb6ab42fd81e020b306429757ddda1))(esbuild@0.28.2)(jiti@2.7.0)(jsdom@30.1.0(@noble/hashes@1.8.0))(playwright@1.64.1)(terser@5.48.0)(typescript@6.0.3)(unrun@0.2.39)(utf-8-validate@6.0.6)(yaml@2.9.0) '@pierre/trees': specifier: 'catalog:' version: 1.0.0(@pierre/theme@2.0.0)(@shikijs/themes@4.2.0)(react-dom@19.3.0(react@19.3.0))(react@19.3.0)(shiki@4.2.0) @@ -871,11 +871,11 @@ importers: specifier: 1.5.0 version: 1.5.0(patch_hash=7fe8889d7916196c56006cf15a39abba4099feb2c567b4030b82a09364cee500)(zod@4.6.7) '@effect/platform-node': - specifier: 4.1.5 - version: 4.1.5(bufferutil@4.1.0)(effect@4.1.5(patch_hash=14a7acd734809d8dddbf2c19c4ec01fdd2ffae60a612de42b5ed29860216052a))(redis@6.2.1)(utf-8-validate@6.0.6) + specifier: 4.1.6 + version: 4.1.6(bufferutil@4.1.0)(effect@4.1.6(patch_hash=c13237f64561426c002130285a9832acc5bb6ab42fd81e020b306429757ddda1))(redis@6.2.1)(utf-8-validate@6.0.6) '@effect/platform-node-shared': - specifier: 4.1.5 - version: 4.1.5(patch_hash=06952843c6f431ca83c78762fd18d23cda76883801049ee311feced2438ecf14)(bufferutil@4.1.0)(effect@4.1.5(patch_hash=14a7acd734809d8dddbf2c19c4ec01fdd2ffae60a612de42b5ed29860216052a))(utf-8-validate@6.0.6) + specifier: 4.1.6 + version: 4.1.6(patch_hash=af6bf6e9364037fa069fe80678a04acf389d8d5883600500a7afe5ab0ce6e9bc)(bufferutil@4.1.0)(effect@4.1.6(patch_hash=c13237f64561426c002130285a9832acc5bb6ab42fd81e020b306429757ddda1))(utf-8-validate@6.0.6) '@ff-labs/fff-node': specifier: 0.11.0 version: 0.11.0(patch_hash=93f62a76399b435a76588b2bef237db0a1e85880c1ac0d0759c416e9cc579252) @@ -955,8 +955,8 @@ importers: specifier: 8.0.3 version: 8.0.3 effect: - specifier: 4.1.5 - version: 4.1.5(patch_hash=14a7acd734809d8dddbf2c19c4ec01fdd2ffae60a612de42b5ed29860216052a) + specifier: 4.1.6 + version: 4.1.6(patch_hash=c13237f64561426c002130285a9832acc5bb6ab42fd81e020b306429757ddda1) ffi-rs: specifier: 1.3.2 version: 1.3.2 @@ -996,10 +996,10 @@ importers: devDependencies: '@effect/graphql-generator': specifier: 'catalog:' - version: 4.1.5(@effect/platform-node@4.1.5(bufferutil@4.1.0)(effect@4.1.5(patch_hash=14a7acd734809d8dddbf2c19c4ec01fdd2ffae60a612de42b5ed29860216052a))(redis@6.2.1)(utf-8-validate@6.0.6))(effect@4.1.5(patch_hash=14a7acd734809d8dddbf2c19c4ec01fdd2ffae60a612de42b5ed29860216052a)) + version: 4.1.6(@effect/platform-node@4.1.6(bufferutil@4.1.0)(effect@4.1.6(patch_hash=c13237f64561426c002130285a9832acc5bb6ab42fd81e020b306429757ddda1))(redis@6.2.1)(utf-8-validate@6.0.6))(effect@4.1.6(patch_hash=c13237f64561426c002130285a9832acc5bb6ab42fd81e020b306429757ddda1)) '@effect/vitest': - specifier: 4.1.5 - version: 4.1.5(patch_hash=dd0bf2b1ae0f63aff0d620ebc67b82d19759b3fa69a608ef85e2a5b40b4d46c5)(@astrojs/compiler-rs@0.5.1)(@types/node@24.12.4)(@vitest/browser-playwright@5.1.1)(@vitest/ui@5.1.1)(@volar/typescript@2.4.28(typescript@6.0.3))(bufferutil@4.1.0)(effect@4.1.5(patch_hash=14a7acd734809d8dddbf2c19c4ec01fdd2ffae60a612de42b5ed29860216052a))(esbuild@0.28.2)(jiti@2.7.0)(jsdom@30.1.0(@noble/hashes@1.8.0))(playwright@1.64.1)(terser@5.48.0)(typescript@6.0.3)(unrun@0.2.39)(utf-8-validate@6.0.6)(yaml@2.9.0) + specifier: 4.1.6 + version: 4.1.6(patch_hash=f87ba071dd4f5cfa3b1ba14d5d59363e64372cd49af4d8282c322939e6bf3af2)(@astrojs/compiler-rs@0.5.1)(@types/node@24.12.4)(@vitest/browser-playwright@5.1.1)(@vitest/ui@5.1.1)(@volar/typescript@2.4.28(typescript@6.0.3))(bufferutil@4.1.0)(effect@4.1.6(patch_hash=c13237f64561426c002130285a9832acc5bb6ab42fd81e020b306429757ddda1))(esbuild@0.28.2)(jiti@2.7.0)(jsdom@30.1.0(@noble/hashes@1.8.0))(playwright@1.64.1)(terser@5.48.0)(typescript@6.0.3)(unrun@0.2.39)(utf-8-validate@6.0.6)(yaml@2.9.0) '@handy-computer/models': specifier: 0.2.3 version: 0.2.3 @@ -1103,8 +1103,8 @@ importers: specifier: ^3.2.2 version: 3.2.2(react@19.3.0) '@effect/atom-react': - specifier: 4.1.5 - version: 4.1.5(effect@4.1.5(patch_hash=14a7acd734809d8dddbf2c19c4ec01fdd2ffae60a612de42b5ed29860216052a))(react@19.3.0)(scheduler@0.28.0) + specifier: 4.1.6 + version: 4.1.6(effect@4.1.6(patch_hash=c13237f64561426c002130285a9832acc5bb6ab42fd81e020b306429757ddda1))(react@19.3.0)(scheduler@0.28.0) '@fontsource-variable/inter': specifier: ^5.3.0 version: 5.3.0 @@ -1211,8 +1211,8 @@ importers: specifier: ^3.4.17 version: 3.4.17 effect: - specifier: 4.1.5 - version: 4.1.5(patch_hash=14a7acd734809d8dddbf2c19c4ec01fdd2ffae60a612de42b5ed29860216052a) + specifier: 4.1.6 + version: 4.1.6(patch_hash=c13237f64561426c002130285a9832acc5bb6ab42fd81e020b306429757ddda1) entities: specifier: 8.1.0 version: 8.1.0 @@ -1284,11 +1284,11 @@ importers: version: 5.0.14(@types/react@19.3.0)(react@19.3.0)(use-sync-external-store@1.7.0(react@19.3.0)) devDependencies: '@effect/platform-node': - specifier: 4.1.5 - version: 4.1.5(bufferutil@4.1.0)(effect@4.1.5(patch_hash=14a7acd734809d8dddbf2c19c4ec01fdd2ffae60a612de42b5ed29860216052a))(redis@6.2.1)(utf-8-validate@6.0.6) + specifier: 4.1.6 + version: 4.1.6(bufferutil@4.1.0)(effect@4.1.6(patch_hash=c13237f64561426c002130285a9832acc5bb6ab42fd81e020b306429757ddda1))(redis@6.2.1)(utf-8-validate@6.0.6) '@effect/vitest': - specifier: 4.1.5 - version: 4.1.5(patch_hash=dd0bf2b1ae0f63aff0d620ebc67b82d19759b3fa69a608ef85e2a5b40b4d46c5)(@astrojs/compiler-rs@0.5.1)(@types/node@24.12.4)(@vitest/browser-playwright@5.1.1)(@vitest/ui@5.1.1)(@volar/typescript@2.4.28(typescript@6.0.3))(bufferutil@4.1.0)(effect@4.1.5(patch_hash=14a7acd734809d8dddbf2c19c4ec01fdd2ffae60a612de42b5ed29860216052a))(esbuild@0.28.2)(jiti@2.7.0)(jsdom@30.1.0(@noble/hashes@1.8.0))(playwright@1.64.1)(terser@5.48.0)(typescript@6.0.3)(unrun@0.2.39)(utf-8-validate@6.0.6)(yaml@2.9.0) + specifier: 4.1.6 + version: 4.1.6(patch_hash=f87ba071dd4f5cfa3b1ba14d5d59363e64372cd49af4d8282c322939e6bf3af2)(@astrojs/compiler-rs@0.5.1)(@types/node@24.12.4)(@vitest/browser-playwright@5.1.1)(@vitest/ui@5.1.1)(@volar/typescript@2.4.28(typescript@6.0.3))(bufferutil@4.1.0)(effect@4.1.6(patch_hash=c13237f64561426c002130285a9832acc5bb6ab42fd81e020b306429757ddda1))(esbuild@0.28.2)(jiti@2.7.0)(jsdom@30.1.0(@noble/hashes@1.8.0))(playwright@1.64.1)(terser@5.48.0)(typescript@6.0.3)(unrun@0.2.39)(utf-8-validate@6.0.6)(yaml@2.9.0) '@tailwindcss/vite': specifier: 4.3.3 version: 4.3.3(@voidzero-dev/vite-plus-core@8.3.8001(@types/node@24.12.4)(@volar/typescript@2.4.28(typescript@6.0.3))(esbuild@0.28.2)(jiti@2.7.0)(terser@5.48.0)(typescript@6.0.3)(unrun@0.2.39)(yaml@2.9.0)) @@ -1353,8 +1353,8 @@ importers: evals: dependencies: '@effect/platform-node': - specifier: 4.1.5 - version: 4.1.5(bufferutil@4.1.0)(effect@4.1.5(patch_hash=14a7acd734809d8dddbf2c19c4ec01fdd2ffae60a612de42b5ed29860216052a))(redis@6.2.1)(utf-8-validate@6.0.6) + specifier: 4.1.6 + version: 4.1.6(bufferutil@4.1.0)(effect@4.1.6(patch_hash=c13237f64561426c002130285a9832acc5bb6ab42fd81e020b306429757ddda1))(redis@6.2.1)(utf-8-validate@6.0.6) '@t3tools/contracts': specifier: workspace:* version: link:../packages/contracts @@ -1365,12 +1365,12 @@ importers: specifier: workspace:* version: link:../packages/shared effect: - specifier: 4.1.5 - version: 4.1.5(patch_hash=14a7acd734809d8dddbf2c19c4ec01fdd2ffae60a612de42b5ed29860216052a) + specifier: 4.1.6 + version: 4.1.6(patch_hash=c13237f64561426c002130285a9832acc5bb6ab42fd81e020b306429757ddda1) devDependencies: '@effect/vitest': - specifier: 4.1.5 - version: 4.1.5(patch_hash=dd0bf2b1ae0f63aff0d620ebc67b82d19759b3fa69a608ef85e2a5b40b4d46c5)(@astrojs/compiler-rs@0.5.1)(@types/node@24.12.4)(@vitest/browser-playwright@5.1.1)(@vitest/ui@5.1.1)(@volar/typescript@2.4.28(typescript@6.0.3))(bufferutil@4.1.0)(effect@4.1.5(patch_hash=14a7acd734809d8dddbf2c19c4ec01fdd2ffae60a612de42b5ed29860216052a))(esbuild@0.28.2)(jiti@2.7.0)(jsdom@30.1.0(@noble/hashes@1.8.0))(playwright@1.64.1)(terser@5.48.0)(typescript@6.0.3)(unrun@0.2.39)(utf-8-validate@6.0.6)(yaml@2.9.0) + specifier: 4.1.6 + version: 4.1.6(patch_hash=f87ba071dd4f5cfa3b1ba14d5d59363e64372cd49af4d8282c322939e6bf3af2)(@astrojs/compiler-rs@0.5.1)(@types/node@24.12.4)(@vitest/browser-playwright@5.1.1)(@vitest/ui@5.1.1)(@volar/typescript@2.4.28(typescript@6.0.3))(bufferutil@4.1.0)(effect@4.1.6(patch_hash=c13237f64561426c002130285a9832acc5bb6ab42fd81e020b306429757ddda1))(esbuild@0.28.2)(jiti@2.7.0)(jsdom@30.1.0(@noble/hashes@1.8.0))(playwright@1.64.1)(terser@5.48.0)(typescript@6.0.3)(unrun@0.2.39)(utf-8-validate@6.0.6)(yaml@2.9.0) '@types/node': specifier: 24.12.4 version: 24.12.4 @@ -1382,28 +1382,28 @@ importers: dependencies: '@alchemy.run/axiom': specifier: 'catalog:' - version: 2.0.0-beta.85(alchemy@2.0.0-beta.85(patch_hash=07cc8c7e14b3b9af143ddd40a059f117c27e55139fbf20bd5dde2eb30509cedd)(@effect/platform-bun@4.1.5(bufferutil@4.1.0)(effect@4.1.5(patch_hash=14a7acd734809d8dddbf2c19c4ec01fdd2ffae60a612de42b5ed29860216052a))(utf-8-validate@6.0.6))(@effect/platform-node@4.1.5(bufferutil@4.1.0)(effect@4.1.5(patch_hash=14a7acd734809d8dddbf2c19c4ec01fdd2ffae60a612de42b5ed29860216052a))(redis@6.2.1)(utf-8-validate@6.0.6))(@types/react@19.3.0)(@voidzero-dev/vite-plus-core@8.3.8001(@types/node@24.12.4)(@volar/typescript@2.4.28(typescript@6.0.3))(esbuild@0.28.2)(jiti@2.7.0)(terser@5.48.0)(typescript@6.0.3)(unrun@0.2.39)(yaml@2.9.0))(effect@4.1.5(patch_hash=14a7acd734809d8dddbf2c19c4ec01fdd2ffae60a612de42b5ed29860216052a))(react-devtools-core@6.1.5(bufferutil@4.1.0)(utf-8-validate@6.0.6))(ws@8.22.0(bufferutil@4.1.0)(utf-8-validate@6.0.6)))(effect@4.1.5(patch_hash=14a7acd734809d8dddbf2c19c4ec01fdd2ffae60a612de42b5ed29860216052a)) + version: 2.0.0-beta.85(alchemy@2.0.0-beta.85(patch_hash=07cc8c7e14b3b9af143ddd40a059f117c27e55139fbf20bd5dde2eb30509cedd)(@effect/platform-bun@4.1.6(bufferutil@4.1.0)(effect@4.1.6(patch_hash=c13237f64561426c002130285a9832acc5bb6ab42fd81e020b306429757ddda1))(utf-8-validate@6.0.6))(@effect/platform-node@4.1.6(bufferutil@4.1.0)(effect@4.1.6(patch_hash=c13237f64561426c002130285a9832acc5bb6ab42fd81e020b306429757ddda1))(redis@6.2.1)(utf-8-validate@6.0.6))(@types/react@19.3.0)(@voidzero-dev/vite-plus-core@8.3.8001(@types/node@24.12.4)(@volar/typescript@2.4.28(typescript@6.0.3))(esbuild@0.28.2)(jiti@2.7.0)(terser@5.48.0)(typescript@6.0.3)(unrun@0.2.39)(yaml@2.9.0))(effect@4.1.6(patch_hash=c13237f64561426c002130285a9832acc5bb6ab42fd81e020b306429757ddda1))(react-devtools-core@6.1.5(bufferutil@4.1.0)(utf-8-validate@6.0.6))(ws@8.22.0(bufferutil@4.1.0)(utf-8-validate@6.0.6)))(effect@4.1.6(patch_hash=c13237f64561426c002130285a9832acc5bb6ab42fd81e020b306429757ddda1)) '@alchemy.run/cloudflare': specifier: 'catalog:' - version: 2.0.0-beta.85(51317535f95f3dfb59110e0111bc835c) + version: 2.0.0-beta.85(aa5e134efa4e132197ef8c42d9bb2cf1) '@alchemy.run/drizzle': specifier: 'catalog:' - version: 2.0.0-beta.85(c2d19fec0d6fdbaf2493b9094ab8dc0b) + version: 2.0.0-beta.85(fac3646678ff74245ad357aa251302f8) '@alchemy.run/planetscale': specifier: 'catalog:' - version: 2.0.0-beta.85(6906a3a93dff07c63d6ad3b93feb5862) + version: 2.0.0-beta.85(a163f98b55b76c5c61d78bde7530627b) '@clerk/backend': specifier: 3.33.0 version: 3.33.0(react-dom@19.3.0(react@19.3.0))(react@19.3.0) '@distilled.cloud/cloudflare': specifier: 'catalog:' - version: 1.0.0-rc.18(effect@4.1.5(patch_hash=14a7acd734809d8dddbf2c19c4ec01fdd2ffae60a612de42b5ed29860216052a)) + version: 1.0.0-rc.18(effect@4.1.6(patch_hash=c13237f64561426c002130285a9832acc5bb6ab42fd81e020b306429757ddda1)) '@effect/sql-pg': - specifier: 4.1.5 - version: 4.1.5(effect@4.1.5(patch_hash=14a7acd734809d8dddbf2c19c4ec01fdd2ffae60a612de42b5ed29860216052a)) + specifier: 4.1.6 + version: 4.1.6(effect@4.1.6(patch_hash=c13237f64561426c002130285a9832acc5bb6ab42fd81e020b306429757ddda1)) '@effect/sql-sqlite-do': specifier: 'catalog:' - version: 4.1.5(effect@4.1.5(patch_hash=14a7acd734809d8dddbf2c19c4ec01fdd2ffae60a612de42b5ed29860216052a)) + version: 4.1.6(effect@4.1.6(patch_hash=c13237f64561426c002130285a9832acc5bb6ab42fd81e020b306429757ddda1)) '@noble/curves': specifier: 'catalog:' version: 1.9.1 @@ -1421,26 +1421,26 @@ importers: version: link:../../packages/shared alchemy: specifier: 2.0.0-beta.85 - version: 2.0.0-beta.85(patch_hash=07cc8c7e14b3b9af143ddd40a059f117c27e55139fbf20bd5dde2eb30509cedd)(@effect/platform-bun@4.1.5(bufferutil@4.1.0)(effect@4.1.5(patch_hash=14a7acd734809d8dddbf2c19c4ec01fdd2ffae60a612de42b5ed29860216052a))(utf-8-validate@6.0.6))(@effect/platform-node@4.1.5(bufferutil@4.1.0)(effect@4.1.5(patch_hash=14a7acd734809d8dddbf2c19c4ec01fdd2ffae60a612de42b5ed29860216052a))(redis@6.2.1)(utf-8-validate@6.0.6))(@types/react@19.3.0)(@voidzero-dev/vite-plus-core@8.3.8001(@types/node@24.12.4)(@volar/typescript@2.4.28(typescript@6.0.3))(esbuild@0.28.2)(jiti@2.7.0)(terser@5.48.0)(typescript@6.0.3)(unrun@0.2.39)(yaml@2.9.0))(effect@4.1.5(patch_hash=14a7acd734809d8dddbf2c19c4ec01fdd2ffae60a612de42b5ed29860216052a))(react-devtools-core@6.1.5(bufferutil@4.1.0)(utf-8-validate@6.0.6))(ws@8.22.0(bufferutil@4.1.0)(utf-8-validate@6.0.6)) + version: 2.0.0-beta.85(patch_hash=07cc8c7e14b3b9af143ddd40a059f117c27e55139fbf20bd5dde2eb30509cedd)(@effect/platform-bun@4.1.6(bufferutil@4.1.0)(effect@4.1.6(patch_hash=c13237f64561426c002130285a9832acc5bb6ab42fd81e020b306429757ddda1))(utf-8-validate@6.0.6))(@effect/platform-node@4.1.6(bufferutil@4.1.0)(effect@4.1.6(patch_hash=c13237f64561426c002130285a9832acc5bb6ab42fd81e020b306429757ddda1))(redis@6.2.1)(utf-8-validate@6.0.6))(@types/react@19.3.0)(@voidzero-dev/vite-plus-core@8.3.8001(@types/node@24.12.4)(@volar/typescript@2.4.28(typescript@6.0.3))(esbuild@0.28.2)(jiti@2.7.0)(terser@5.48.0)(typescript@6.0.3)(unrun@0.2.39)(yaml@2.9.0))(effect@4.1.6(patch_hash=c13237f64561426c002130285a9832acc5bb6ab42fd81e020b306429757ddda1))(react-devtools-core@6.1.5(bufferutil@4.1.0)(utf-8-validate@6.0.6))(ws@8.22.0(bufferutil@4.1.0)(utf-8-validate@6.0.6)) drizzle-orm: specifier: 1.0.0-rc.5 - version: 1.0.0-rc.5(@cloudflare/workers-types@4.20260604.1)(@effect/sql-d1@4.1.1(effect@4.1.5(patch_hash=14a7acd734809d8dddbf2c19c4ec01fdd2ffae60a612de42b5ed29860216052a)))(@effect/sql-pg@4.1.5(effect@4.1.5(patch_hash=14a7acd734809d8dddbf2c19c4ec01fdd2ffae60a612de42b5ed29860216052a)))(@effect/sql-sqlite-do@4.1.5(effect@4.1.5(patch_hash=14a7acd734809d8dddbf2c19c4ec01fdd2ffae60a612de42b5ed29860216052a)))(@electric-sql/pglite@0.3.15)(@libsql/client@0.17.3(bufferutil@4.1.0)(utf-8-validate@6.0.6))(@types/sql.js@1.4.11)(bun-types@1.3.14)(effect@4.1.5(patch_hash=14a7acd734809d8dddbf2c19c4ec01fdd2ffae60a612de42b5ed29860216052a))(expo-sqlite@58.0.18(expo@58.0.26)(react-native@0.88.1(@babel/core@7.29.7(supports-color@8.1.1))(@react-native/metro-config@0.88.1(@babel/core@7.29.7(supports-color@8.1.1))(bufferutil@4.1.0)(supports-color@8.1.1)(utf-8-validate@6.0.6))(@types/react@19.3.0)(bufferutil@4.1.0)(react@19.3.0)(supports-color@8.1.1)(utf-8-validate@6.0.6))(react@19.3.0))(pg@8.23.0)(sql.js@1.15.0)(zod@4.6.7) + version: 1.0.0-rc.5(@cloudflare/workers-types@4.20260604.1)(@effect/sql-d1@4.1.1(effect@4.1.6(patch_hash=c13237f64561426c002130285a9832acc5bb6ab42fd81e020b306429757ddda1)))(@effect/sql-pg@4.1.6(effect@4.1.6(patch_hash=c13237f64561426c002130285a9832acc5bb6ab42fd81e020b306429757ddda1)))(@effect/sql-sqlite-do@4.1.6(effect@4.1.6(patch_hash=c13237f64561426c002130285a9832acc5bb6ab42fd81e020b306429757ddda1)))(@electric-sql/pglite@0.3.15)(@libsql/client@0.17.3(bufferutil@4.1.0)(utf-8-validate@6.0.6))(@types/sql.js@1.4.11)(bun-types@1.3.14)(effect@4.1.6(patch_hash=c13237f64561426c002130285a9832acc5bb6ab42fd81e020b306429757ddda1))(expo-sqlite@58.0.18(expo@58.0.26)(react-native@0.88.1(@babel/core@7.29.7(supports-color@8.1.1))(@react-native/metro-config@0.88.1(@babel/core@7.29.7(supports-color@8.1.1))(bufferutil@4.1.0)(supports-color@8.1.1)(utf-8-validate@6.0.6))(@types/react@19.3.0)(bufferutil@4.1.0)(react@19.3.0)(supports-color@8.1.1)(utf-8-validate@6.0.6))(react@19.3.0))(pg@8.23.0)(sql.js@1.15.0)(zod@4.6.7) effect: - specifier: 4.1.5 - version: 4.1.5(patch_hash=14a7acd734809d8dddbf2c19c4ec01fdd2ffae60a612de42b5ed29860216052a) + specifier: 4.1.6 + version: 4.1.6(patch_hash=c13237f64561426c002130285a9832acc5bb6ab42fd81e020b306429757ddda1) devDependencies: '@alchemy.run/test': specifier: 'catalog:' - version: 2.0.0-beta.85(patch_hash=29c0539ea71d9cc372f0b16558640599beb9bc609605feb2a493da268d72713e)(3b35ec8f94f326c4644a0d8fa97d0c63) + version: 2.0.0-beta.85(patch_hash=29c0539ea71d9cc372f0b16558640599beb9bc609605feb2a493da268d72713e)(643156d2e34fcc9d3ceb68657dc7004f) '@cloudflare/workers-types': specifier: ^4.20260601.1 version: 4.20260604.1 '@effect/platform-node': - specifier: 4.1.5 - version: 4.1.5(bufferutil@4.1.0)(effect@4.1.5(patch_hash=14a7acd734809d8dddbf2c19c4ec01fdd2ffae60a612de42b5ed29860216052a))(redis@6.2.1)(utf-8-validate@6.0.6) + specifier: 4.1.6 + version: 4.1.6(bufferutil@4.1.0)(effect@4.1.6(patch_hash=c13237f64561426c002130285a9832acc5bb6ab42fd81e020b306429757ddda1))(redis@6.2.1)(utf-8-validate@6.0.6) '@effect/vitest': - specifier: 4.1.5 - version: 4.1.5(patch_hash=dd0bf2b1ae0f63aff0d620ebc67b82d19759b3fa69a608ef85e2a5b40b4d46c5)(@astrojs/compiler-rs@0.5.1)(@types/node@24.12.4)(@vitest/browser-playwright@5.1.1)(@vitest/ui@5.1.1)(@volar/typescript@2.4.28(typescript@6.0.3))(bufferutil@4.1.0)(effect@4.1.5(patch_hash=14a7acd734809d8dddbf2c19c4ec01fdd2ffae60a612de42b5ed29860216052a))(esbuild@0.28.2)(jiti@2.7.0)(jsdom@30.1.0(@noble/hashes@1.8.0))(playwright@1.64.1)(terser@5.48.0)(typescript@6.0.3)(unrun@0.2.39)(utf-8-validate@6.0.6)(yaml@2.9.0) + specifier: 4.1.6 + version: 4.1.6(patch_hash=f87ba071dd4f5cfa3b1ba14d5d59363e64372cd49af4d8282c322939e6bf3af2)(@astrojs/compiler-rs@0.5.1)(@types/node@24.12.4)(@vitest/browser-playwright@5.1.1)(@vitest/ui@5.1.1)(@volar/typescript@2.4.28(typescript@6.0.3))(bufferutil@4.1.0)(effect@4.1.6(patch_hash=c13237f64561426c002130285a9832acc5bb6ab42fd81e020b306429757ddda1))(esbuild@0.28.2)(jiti@2.7.0)(jsdom@30.1.0(@noble/hashes@1.8.0))(playwright@1.64.1)(terser@5.48.0)(typescript@6.0.3)(unrun@0.2.39)(utf-8-validate@6.0.6)(yaml@2.9.0) '@electric-sql/pglite': specifier: 0.3.15 version: 0.3.15 @@ -1449,7 +1449,7 @@ importers: version: 24.12.4 drizzle-kit: specifier: 1.0.0-rc.5 - version: 1.0.0-rc.5(1460f90e852e80b46440e9b4378c92e0) + version: 1.0.0-rc.5(2e7aae405f975aacb858aa45f3c70a34) vite: specifier: npm:@voidzero-dev/vite-plus-core@8.3.8001 version: '@voidzero-dev/vite-plus-core@8.3.8001(@types/node@24.12.4)(@volar/typescript@2.4.28(typescript@6.0.3))(esbuild@0.28.2)(jiti@2.7.0)(terser@5.48.0)(typescript@6.0.3)(unrun@0.2.39)(yaml@2.9.0)' @@ -1461,16 +1461,16 @@ importers: dependencies: '@alchemy.run/axiom': specifier: 'catalog:' - version: 2.0.0-beta.85(alchemy@2.0.0-beta.85(patch_hash=07cc8c7e14b3b9af143ddd40a059f117c27e55139fbf20bd5dde2eb30509cedd)(@effect/platform-bun@4.1.5(bufferutil@4.1.0)(effect@4.1.5(patch_hash=14a7acd734809d8dddbf2c19c4ec01fdd2ffae60a612de42b5ed29860216052a))(utf-8-validate@6.0.6))(@effect/platform-node@4.1.5(bufferutil@4.1.0)(effect@4.1.5(patch_hash=14a7acd734809d8dddbf2c19c4ec01fdd2ffae60a612de42b5ed29860216052a))(redis@6.2.1)(utf-8-validate@6.0.6))(@types/react@19.3.0)(@voidzero-dev/vite-plus-core@8.3.8001(@types/node@24.12.4)(@volar/typescript@2.4.28(typescript@6.0.3))(esbuild@0.28.2)(jiti@2.7.0)(terser@5.48.0)(typescript@6.0.3)(unrun@0.2.39)(yaml@2.9.0))(effect@4.1.5(patch_hash=14a7acd734809d8dddbf2c19c4ec01fdd2ffae60a612de42b5ed29860216052a))(react-devtools-core@6.1.5(bufferutil@4.1.0)(utf-8-validate@6.0.6))(ws@8.22.0(bufferutil@4.1.0)(utf-8-validate@6.0.6)))(effect@4.1.5(patch_hash=14a7acd734809d8dddbf2c19c4ec01fdd2ffae60a612de42b5ed29860216052a)) + version: 2.0.0-beta.85(alchemy@2.0.0-beta.85(patch_hash=07cc8c7e14b3b9af143ddd40a059f117c27e55139fbf20bd5dde2eb30509cedd)(@effect/platform-bun@4.1.6(bufferutil@4.1.0)(effect@4.1.6(patch_hash=c13237f64561426c002130285a9832acc5bb6ab42fd81e020b306429757ddda1))(utf-8-validate@6.0.6))(@effect/platform-node@4.1.6(bufferutil@4.1.0)(effect@4.1.6(patch_hash=c13237f64561426c002130285a9832acc5bb6ab42fd81e020b306429757ddda1))(redis@6.2.1)(utf-8-validate@6.0.6))(@types/react@19.3.0)(@voidzero-dev/vite-plus-core@8.3.8001(@types/node@24.12.4)(@volar/typescript@2.4.28(typescript@6.0.3))(esbuild@0.28.2)(jiti@2.7.0)(terser@5.48.0)(typescript@6.0.3)(unrun@0.2.39)(yaml@2.9.0))(effect@4.1.6(patch_hash=c13237f64561426c002130285a9832acc5bb6ab42fd81e020b306429757ddda1))(react-devtools-core@6.1.5(bufferutil@4.1.0)(utf-8-validate@6.0.6))(ws@8.22.0(bufferutil@4.1.0)(utf-8-validate@6.0.6)))(effect@4.1.6(patch_hash=c13237f64561426c002130285a9832acc5bb6ab42fd81e020b306429757ddda1)) '@alchemy.run/cloudflare': specifier: 'catalog:' - version: 2.0.0-beta.85(51317535f95f3dfb59110e0111bc835c) + version: 2.0.0-beta.85(aa5e134efa4e132197ef8c42d9bb2cf1) alchemy: specifier: 2.0.0-beta.85 - version: 2.0.0-beta.85(patch_hash=07cc8c7e14b3b9af143ddd40a059f117c27e55139fbf20bd5dde2eb30509cedd)(@effect/platform-bun@4.1.5(bufferutil@4.1.0)(effect@4.1.5(patch_hash=14a7acd734809d8dddbf2c19c4ec01fdd2ffae60a612de42b5ed29860216052a))(utf-8-validate@6.0.6))(@effect/platform-node@4.1.5(bufferutil@4.1.0)(effect@4.1.5(patch_hash=14a7acd734809d8dddbf2c19c4ec01fdd2ffae60a612de42b5ed29860216052a))(redis@6.2.1)(utf-8-validate@6.0.6))(@types/react@19.3.0)(@voidzero-dev/vite-plus-core@8.3.8001(@types/node@24.12.4)(@volar/typescript@2.4.28(typescript@6.0.3))(esbuild@0.28.2)(jiti@2.7.0)(terser@5.48.0)(typescript@6.0.3)(unrun@0.2.39)(yaml@2.9.0))(effect@4.1.5(patch_hash=14a7acd734809d8dddbf2c19c4ec01fdd2ffae60a612de42b5ed29860216052a))(react-devtools-core@6.1.5(bufferutil@4.1.0)(utf-8-validate@6.0.6))(ws@8.22.0(bufferutil@4.1.0)(utf-8-validate@6.0.6)) + version: 2.0.0-beta.85(patch_hash=07cc8c7e14b3b9af143ddd40a059f117c27e55139fbf20bd5dde2eb30509cedd)(@effect/platform-bun@4.1.6(bufferutil@4.1.0)(effect@4.1.6(patch_hash=c13237f64561426c002130285a9832acc5bb6ab42fd81e020b306429757ddda1))(utf-8-validate@6.0.6))(@effect/platform-node@4.1.6(bufferutil@4.1.0)(effect@4.1.6(patch_hash=c13237f64561426c002130285a9832acc5bb6ab42fd81e020b306429757ddda1))(redis@6.2.1)(utf-8-validate@6.0.6))(@types/react@19.3.0)(@voidzero-dev/vite-plus-core@8.3.8001(@types/node@24.12.4)(@volar/typescript@2.4.28(typescript@6.0.3))(esbuild@0.28.2)(jiti@2.7.0)(terser@5.48.0)(typescript@6.0.3)(unrun@0.2.39)(yaml@2.9.0))(effect@4.1.6(patch_hash=c13237f64561426c002130285a9832acc5bb6ab42fd81e020b306429757ddda1))(react-devtools-core@6.1.5(bufferutil@4.1.0)(utf-8-validate@6.0.6))(ws@8.22.0(bufferutil@4.1.0)(utf-8-validate@6.0.6)) effect: - specifier: 4.1.5 - version: 4.1.5(patch_hash=14a7acd734809d8dddbf2c19c4ec01fdd2ffae60a612de42b5ed29860216052a) + specifier: 4.1.6 + version: 4.1.6(patch_hash=c13237f64561426c002130285a9832acc5bb6ab42fd81e020b306429757ddda1) jose: specifier: 'catalog:' version: 6.2.2 @@ -1479,11 +1479,11 @@ importers: specifier: ^4.20260601.1 version: 4.20260604.1 '@effect/platform-node': - specifier: 4.1.5 - version: 4.1.5(bufferutil@4.1.0)(effect@4.1.5(patch_hash=14a7acd734809d8dddbf2c19c4ec01fdd2ffae60a612de42b5ed29860216052a))(redis@6.2.1)(utf-8-validate@6.0.6) + specifier: 4.1.6 + version: 4.1.6(bufferutil@4.1.0)(effect@4.1.6(patch_hash=c13237f64561426c002130285a9832acc5bb6ab42fd81e020b306429757ddda1))(redis@6.2.1)(utf-8-validate@6.0.6) '@effect/vitest': - specifier: 4.1.5 - version: 4.1.5(patch_hash=dd0bf2b1ae0f63aff0d620ebc67b82d19759b3fa69a608ef85e2a5b40b4d46c5)(@astrojs/compiler-rs@0.5.1)(@types/node@24.12.4)(@vitest/browser-playwright@5.1.1)(@vitest/ui@5.1.1)(@volar/typescript@2.4.28(typescript@6.0.3))(bufferutil@4.1.0)(effect@4.1.5(patch_hash=14a7acd734809d8dddbf2c19c4ec01fdd2ffae60a612de42b5ed29860216052a))(esbuild@0.28.2)(jiti@2.7.0)(jsdom@30.1.0(@noble/hashes@1.8.0))(playwright@1.64.1)(terser@5.48.0)(typescript@6.0.3)(unrun@0.2.39)(utf-8-validate@6.0.6)(yaml@2.9.0) + specifier: 4.1.6 + version: 4.1.6(patch_hash=f87ba071dd4f5cfa3b1ba14d5d59363e64372cd49af4d8282c322939e6bf3af2)(@astrojs/compiler-rs@0.5.1)(@types/node@24.12.4)(@vitest/browser-playwright@5.1.1)(@vitest/ui@5.1.1)(@volar/typescript@2.4.28(typescript@6.0.3))(bufferutil@4.1.0)(effect@4.1.6(patch_hash=c13237f64561426c002130285a9832acc5bb6ab42fd81e020b306429757ddda1))(esbuild@0.28.2)(jiti@2.7.0)(jsdom@30.1.0(@noble/hashes@1.8.0))(playwright@1.64.1)(terser@5.48.0)(typescript@6.0.3)(unrun@0.2.39)(utf-8-validate@6.0.6)(yaml@2.9.0) '@types/node': specifier: 24.12.4 version: 24.12.4 @@ -1497,15 +1497,15 @@ importers: specifier: ^1.63.0 version: 1.94.0 effect: - specifier: 4.1.5 - version: 4.1.5(patch_hash=14a7acd734809d8dddbf2c19c4ec01fdd2ffae60a612de42b5ed29860216052a) + specifier: 4.1.6 + version: 4.1.6(patch_hash=c13237f64561426c002130285a9832acc5bb6ab42fd81e020b306429757ddda1) devDependencies: '@effect/platform-node': - specifier: 4.1.5 - version: 4.1.5(bufferutil@4.1.0)(effect@4.1.5(patch_hash=14a7acd734809d8dddbf2c19c4ec01fdd2ffae60a612de42b5ed29860216052a))(redis@6.2.1)(utf-8-validate@6.0.6) + specifier: 4.1.6 + version: 4.1.6(bufferutil@4.1.0)(effect@4.1.6(patch_hash=c13237f64561426c002130285a9832acc5bb6ab42fd81e020b306429757ddda1))(redis@6.2.1)(utf-8-validate@6.0.6) '@effect/vitest': - specifier: 4.1.5 - version: 4.1.5(patch_hash=dd0bf2b1ae0f63aff0d620ebc67b82d19759b3fa69a608ef85e2a5b40b4d46c5)(@astrojs/compiler-rs@0.5.1)(@types/node@24.12.4)(@vitest/browser-playwright@5.1.1)(@vitest/ui@5.1.1)(@volar/typescript@2.4.28(typescript@6.0.3))(bufferutil@4.1.0)(effect@4.1.5(patch_hash=14a7acd734809d8dddbf2c19c4ec01fdd2ffae60a612de42b5ed29860216052a))(esbuild@0.28.2)(jiti@2.7.0)(jsdom@30.1.0(@noble/hashes@1.8.0))(playwright@1.64.1)(terser@5.48.0)(typescript@6.0.3)(unrun@0.2.39)(utf-8-validate@6.0.6)(yaml@2.9.0) + specifier: 4.1.6 + version: 4.1.6(patch_hash=f87ba071dd4f5cfa3b1ba14d5d59363e64372cd49af4d8282c322939e6bf3af2)(@astrojs/compiler-rs@0.5.1)(@types/node@24.12.4)(@vitest/browser-playwright@5.1.1)(@vitest/ui@5.1.1)(@volar/typescript@2.4.28(typescript@6.0.3))(bufferutil@4.1.0)(effect@4.1.6(patch_hash=c13237f64561426c002130285a9832acc5bb6ab42fd81e020b306429757ddda1))(esbuild@0.28.2)(jiti@2.7.0)(jsdom@30.1.0(@noble/hashes@1.8.0))(playwright@1.64.1)(terser@5.48.0)(typescript@6.0.3)(unrun@0.2.39)(utf-8-validate@6.0.6)(yaml@2.9.0) vite-plus: specifier: 1.8.0 version: 1.8.0(@astrojs/compiler-rs@0.5.1)(@types/node@24.12.4)(@vitest/browser-playwright@5.1.1)(@vitest/ui@5.1.1)(@volar/typescript@2.4.28(typescript@6.0.3))(bufferutil@4.1.0)(esbuild@0.28.2)(jiti@2.7.0)(jsdom@30.1.0(@noble/hashes@1.8.0))(playwright@1.64.1)(terser@5.48.0)(typescript@6.0.3)(unrun@0.2.39)(utf-8-validate@6.0.6)(yaml@2.9.0) @@ -1564,8 +1564,8 @@ importers: specifier: 2.25.0 version: 2.25.0(patch_hash=cb3596293f7a8a6cfe3fade1ab0be9aa33accc3e96e14c1fc8e17bcd333fdb36) effect: - specifier: 4.1.5 - version: 4.1.5(patch_hash=14a7acd734809d8dddbf2c19c4ec01fdd2ffae60a612de42b5ed29860216052a) + specifier: 4.1.6 + version: 4.1.6(patch_hash=c13237f64561426c002130285a9832acc5bb6ab42fd81e020b306429757ddda1) gt-i18n: specifier: 1.0.40 version: 1.0.40(patch_hash=5126b6d63c869104ca0c002d982627211d0c6d246eb648e1e020227020c2343c) @@ -1580,8 +1580,8 @@ importers: version: 5.0.0 devDependencies: '@effect/vitest': - specifier: 4.1.5 - version: 4.1.5(patch_hash=dd0bf2b1ae0f63aff0d620ebc67b82d19759b3fa69a608ef85e2a5b40b4d46c5)(@astrojs/compiler-rs@0.5.1)(@types/node@24.12.4)(@vitest/browser-playwright@5.1.1)(@vitest/ui@5.1.1)(@volar/typescript@2.4.28(typescript@6.0.3))(bufferutil@4.1.0)(effect@4.1.5(patch_hash=14a7acd734809d8dddbf2c19c4ec01fdd2ffae60a612de42b5ed29860216052a))(esbuild@0.28.2)(jiti@2.7.0)(jsdom@30.1.0(@noble/hashes@1.8.0))(playwright@1.64.1)(terser@5.48.0)(typescript@6.0.3)(unrun@0.2.39)(utf-8-validate@6.0.6)(yaml@2.9.0) + specifier: 4.1.6 + version: 4.1.6(patch_hash=f87ba071dd4f5cfa3b1ba14d5d59363e64372cd49af4d8282c322939e6bf3af2)(@astrojs/compiler-rs@0.5.1)(@types/node@24.12.4)(@vitest/browser-playwright@5.1.1)(@vitest/ui@5.1.1)(@volar/typescript@2.4.28(typescript@6.0.3))(bufferutil@4.1.0)(effect@4.1.6(patch_hash=c13237f64561426c002130285a9832acc5bb6ab42fd81e020b306429757ddda1))(esbuild@0.28.2)(jiti@2.7.0)(jsdom@30.1.0(@noble/hashes@1.8.0))(playwright@1.64.1)(terser@5.48.0)(typescript@6.0.3)(unrun@0.2.39)(utf-8-validate@6.0.6)(yaml@2.9.0) '@types/mdast': specifier: ^4.0.4 version: 4.0.4 @@ -1604,12 +1604,12 @@ importers: packages/contracts: dependencies: effect: - specifier: 4.1.5 - version: 4.1.5(patch_hash=14a7acd734809d8dddbf2c19c4ec01fdd2ffae60a612de42b5ed29860216052a) + specifier: 4.1.6 + version: 4.1.6(patch_hash=c13237f64561426c002130285a9832acc5bb6ab42fd81e020b306429757ddda1) devDependencies: '@effect/vitest': - specifier: 4.1.5 - version: 4.1.5(patch_hash=dd0bf2b1ae0f63aff0d620ebc67b82d19759b3fa69a608ef85e2a5b40b4d46c5)(@astrojs/compiler-rs@0.5.1)(@types/node@24.12.4)(@vitest/browser-playwright@5.1.1)(@vitest/ui@5.1.1)(@volar/typescript@2.4.28(typescript@6.0.3))(bufferutil@4.1.0)(effect@4.1.5(patch_hash=14a7acd734809d8dddbf2c19c4ec01fdd2ffae60a612de42b5ed29860216052a))(esbuild@0.28.2)(jiti@2.7.0)(jsdom@30.1.0(@noble/hashes@1.8.0))(playwright@1.64.1)(terser@5.48.0)(typescript@6.0.3)(unrun@0.2.39)(utf-8-validate@6.0.6)(yaml@2.9.0) + specifier: 4.1.6 + version: 4.1.6(patch_hash=f87ba071dd4f5cfa3b1ba14d5d59363e64372cd49af4d8282c322939e6bf3af2)(@astrojs/compiler-rs@0.5.1)(@types/node@24.12.4)(@vitest/browser-playwright@5.1.1)(@vitest/ui@5.1.1)(@volar/typescript@2.4.28(typescript@6.0.3))(bufferutil@4.1.0)(effect@4.1.6(patch_hash=c13237f64561426c002130285a9832acc5bb6ab42fd81e020b306429757ddda1))(esbuild@0.28.2)(jiti@2.7.0)(jsdom@30.1.0(@noble/hashes@1.8.0))(playwright@1.64.1)(terser@5.48.0)(typescript@6.0.3)(unrun@0.2.39)(utf-8-validate@6.0.6)(yaml@2.9.0) vite-plus: specifier: 1.8.0 version: 1.8.0(@astrojs/compiler-rs@0.5.1)(@types/node@24.12.4)(@vitest/browser-playwright@5.1.1)(@vitest/ui@5.1.1)(@volar/typescript@2.4.28(typescript@6.0.3))(bufferutil@4.1.0)(esbuild@0.28.2)(jiti@2.7.0)(jsdom@30.1.0(@noble/hashes@1.8.0))(playwright@1.64.1)(terser@5.48.0)(typescript@6.0.3)(unrun@0.2.39)(utf-8-validate@6.0.6)(yaml@2.9.0) @@ -1617,18 +1617,18 @@ importers: packages/effect-acp: dependencies: effect: - specifier: 4.1.5 - version: 4.1.5(patch_hash=14a7acd734809d8dddbf2c19c4ec01fdd2ffae60a612de42b5ed29860216052a) + specifier: 4.1.6 + version: 4.1.6(patch_hash=c13237f64561426c002130285a9832acc5bb6ab42fd81e020b306429757ddda1) devDependencies: '@effect/openapi-generator': specifier: 'catalog:' - version: 4.1.5(@effect/platform-node@4.1.5(bufferutil@4.1.0)(effect@4.1.5(patch_hash=14a7acd734809d8dddbf2c19c4ec01fdd2ffae60a612de42b5ed29860216052a))(redis@6.2.1)(utf-8-validate@6.0.6))(effect@4.1.5(patch_hash=14a7acd734809d8dddbf2c19c4ec01fdd2ffae60a612de42b5ed29860216052a))(encoding@0.1.13) + version: 4.1.6(@effect/platform-node@4.1.6(bufferutil@4.1.0)(effect@4.1.6(patch_hash=c13237f64561426c002130285a9832acc5bb6ab42fd81e020b306429757ddda1))(redis@6.2.1)(utf-8-validate@6.0.6))(effect@4.1.6(patch_hash=c13237f64561426c002130285a9832acc5bb6ab42fd81e020b306429757ddda1))(encoding@0.1.13) '@effect/platform-node': - specifier: 4.1.5 - version: 4.1.5(bufferutil@4.1.0)(effect@4.1.5(patch_hash=14a7acd734809d8dddbf2c19c4ec01fdd2ffae60a612de42b5ed29860216052a))(redis@6.2.1)(utf-8-validate@6.0.6) + specifier: 4.1.6 + version: 4.1.6(bufferutil@4.1.0)(effect@4.1.6(patch_hash=c13237f64561426c002130285a9832acc5bb6ab42fd81e020b306429757ddda1))(redis@6.2.1)(utf-8-validate@6.0.6) '@effect/vitest': - specifier: 4.1.5 - version: 4.1.5(patch_hash=dd0bf2b1ae0f63aff0d620ebc67b82d19759b3fa69a608ef85e2a5b40b4d46c5)(@astrojs/compiler-rs@0.5.1)(@types/node@24.12.4)(@vitest/browser-playwright@5.1.1)(@vitest/ui@5.1.1)(@volar/typescript@2.4.28(typescript@6.0.3))(bufferutil@4.1.0)(effect@4.1.5(patch_hash=14a7acd734809d8dddbf2c19c4ec01fdd2ffae60a612de42b5ed29860216052a))(esbuild@0.28.2)(jiti@2.7.0)(jsdom@30.1.0(@noble/hashes@1.8.0))(playwright@1.64.1)(terser@5.48.0)(typescript@6.0.3)(unrun@0.2.39)(utf-8-validate@6.0.6)(yaml@2.9.0) + specifier: 4.1.6 + version: 4.1.6(patch_hash=f87ba071dd4f5cfa3b1ba14d5d59363e64372cd49af4d8282c322939e6bf3af2)(@astrojs/compiler-rs@0.5.1)(@types/node@24.12.4)(@vitest/browser-playwright@5.1.1)(@vitest/ui@5.1.1)(@volar/typescript@2.4.28(typescript@6.0.3))(bufferutil@4.1.0)(effect@4.1.6(patch_hash=c13237f64561426c002130285a9832acc5bb6ab42fd81e020b306429757ddda1))(esbuild@0.28.2)(jiti@2.7.0)(jsdom@30.1.0(@noble/hashes@1.8.0))(playwright@1.64.1)(terser@5.48.0)(typescript@6.0.3)(unrun@0.2.39)(utf-8-validate@6.0.6)(yaml@2.9.0) '@types/node': specifier: 24.12.4 version: 24.12.4 @@ -1639,18 +1639,18 @@ importers: packages/effect-codex-app-server: dependencies: effect: - specifier: 4.1.5 - version: 4.1.5(patch_hash=14a7acd734809d8dddbf2c19c4ec01fdd2ffae60a612de42b5ed29860216052a) + specifier: 4.1.6 + version: 4.1.6(patch_hash=c13237f64561426c002130285a9832acc5bb6ab42fd81e020b306429757ddda1) devDependencies: '@effect/openapi-generator': specifier: 'catalog:' - version: 4.1.5(@effect/platform-node@4.1.5(bufferutil@4.1.0)(effect@4.1.5(patch_hash=14a7acd734809d8dddbf2c19c4ec01fdd2ffae60a612de42b5ed29860216052a))(redis@6.2.1)(utf-8-validate@6.0.6))(effect@4.1.5(patch_hash=14a7acd734809d8dddbf2c19c4ec01fdd2ffae60a612de42b5ed29860216052a))(encoding@0.1.13) + version: 4.1.6(@effect/platform-node@4.1.6(bufferutil@4.1.0)(effect@4.1.6(patch_hash=c13237f64561426c002130285a9832acc5bb6ab42fd81e020b306429757ddda1))(redis@6.2.1)(utf-8-validate@6.0.6))(effect@4.1.6(patch_hash=c13237f64561426c002130285a9832acc5bb6ab42fd81e020b306429757ddda1))(encoding@0.1.13) '@effect/platform-node': - specifier: 4.1.5 - version: 4.1.5(bufferutil@4.1.0)(effect@4.1.5(patch_hash=14a7acd734809d8dddbf2c19c4ec01fdd2ffae60a612de42b5ed29860216052a))(redis@6.2.1)(utf-8-validate@6.0.6) + specifier: 4.1.6 + version: 4.1.6(bufferutil@4.1.0)(effect@4.1.6(patch_hash=c13237f64561426c002130285a9832acc5bb6ab42fd81e020b306429757ddda1))(redis@6.2.1)(utf-8-validate@6.0.6) '@effect/vitest': - specifier: 4.1.5 - version: 4.1.5(patch_hash=dd0bf2b1ae0f63aff0d620ebc67b82d19759b3fa69a608ef85e2a5b40b4d46c5)(@astrojs/compiler-rs@0.5.1)(@types/node@24.12.4)(@vitest/browser-playwright@5.1.1)(@vitest/ui@5.1.1)(@volar/typescript@2.4.28(typescript@6.0.3))(bufferutil@4.1.0)(effect@4.1.5(patch_hash=14a7acd734809d8dddbf2c19c4ec01fdd2ffae60a612de42b5ed29860216052a))(esbuild@0.28.2)(jiti@2.7.0)(jsdom@30.1.0(@noble/hashes@1.8.0))(playwright@1.64.1)(terser@5.48.0)(typescript@6.0.3)(unrun@0.2.39)(utf-8-validate@6.0.6)(yaml@2.9.0) + specifier: 4.1.6 + version: 4.1.6(patch_hash=f87ba071dd4f5cfa3b1ba14d5d59363e64372cd49af4d8282c322939e6bf3af2)(@astrojs/compiler-rs@0.5.1)(@types/node@24.12.4)(@vitest/browser-playwright@5.1.1)(@vitest/ui@5.1.1)(@volar/typescript@2.4.28(typescript@6.0.3))(bufferutil@4.1.0)(effect@4.1.6(patch_hash=c13237f64561426c002130285a9832acc5bb6ab42fd81e020b306429757ddda1))(esbuild@0.28.2)(jiti@2.7.0)(jsdom@30.1.0(@noble/hashes@1.8.0))(playwright@1.64.1)(terser@5.48.0)(typescript@6.0.3)(unrun@0.2.39)(utf-8-validate@6.0.6)(yaml@2.9.0) '@types/node': specifier: 24.12.4 version: 24.12.4 @@ -1667,8 +1667,8 @@ importers: specifier: workspace:* version: link:../source-control-core effect: - specifier: 4.1.5 - version: 4.1.5(patch_hash=14a7acd734809d8dddbf2c19c4ec01fdd2ffae60a612de42b5ed29860216052a) + specifier: 4.1.6 + version: 4.1.6(patch_hash=c13237f64561426c002130285a9832acc5bb6ab42fd81e020b306429757ddda1) remark-gfm: specifier: 'catalog:' version: 4.0.1(supports-color@8.1.1) @@ -1680,8 +1680,8 @@ importers: version: 11.0.5 devDependencies: '@effect/vitest': - specifier: 4.1.5 - version: 4.1.5(patch_hash=dd0bf2b1ae0f63aff0d620ebc67b82d19759b3fa69a608ef85e2a5b40b4d46c5)(@astrojs/compiler-rs@0.5.1)(@types/node@24.12.4)(@vitest/browser-playwright@5.1.1)(@vitest/ui@5.1.1)(@volar/typescript@2.4.28(typescript@6.0.3))(bufferutil@4.1.0)(effect@4.1.5(patch_hash=14a7acd734809d8dddbf2c19c4ec01fdd2ffae60a612de42b5ed29860216052a))(esbuild@0.28.2)(jiti@2.7.0)(jsdom@30.1.0(@noble/hashes@1.8.0))(playwright@1.64.1)(terser@5.48.0)(typescript@6.0.3)(unrun@0.2.39)(utf-8-validate@6.0.6)(yaml@2.9.0) + specifier: 4.1.6 + version: 4.1.6(patch_hash=f87ba071dd4f5cfa3b1ba14d5d59363e64372cd49af4d8282c322939e6bf3af2)(@astrojs/compiler-rs@0.5.1)(@types/node@24.12.4)(@vitest/browser-playwright@5.1.1)(@vitest/ui@5.1.1)(@volar/typescript@2.4.28(typescript@6.0.3))(bufferutil@4.1.0)(effect@4.1.6(patch_hash=c13237f64561426c002130285a9832acc5bb6ab42fd81e020b306429757ddda1))(esbuild@0.28.2)(jiti@2.7.0)(jsdom@30.1.0(@noble/hashes@1.8.0))(playwright@1.64.1)(terser@5.48.0)(typescript@6.0.3)(unrun@0.2.39)(utf-8-validate@6.0.6)(yaml@2.9.0) '@types/node': specifier: 24.12.4 version: 24.12.4 @@ -1698,15 +1698,15 @@ importers: specifier: workspace:* version: link:../source-control-core effect: - specifier: 4.1.5 - version: 4.1.5(patch_hash=14a7acd734809d8dddbf2c19c4ec01fdd2ffae60a612de42b5ed29860216052a) + specifier: 4.1.6 + version: 4.1.6(patch_hash=c13237f64561426c002130285a9832acc5bb6ab42fd81e020b306429757ddda1) devDependencies: '@effect/graphql-generator': specifier: 'catalog:' - version: 4.1.5(@effect/platform-node@4.1.5(bufferutil@4.1.0)(effect@4.1.5(patch_hash=14a7acd734809d8dddbf2c19c4ec01fdd2ffae60a612de42b5ed29860216052a))(redis@6.2.1)(utf-8-validate@6.0.6))(effect@4.1.5(patch_hash=14a7acd734809d8dddbf2c19c4ec01fdd2ffae60a612de42b5ed29860216052a)) + version: 4.1.6(@effect/platform-node@4.1.6(bufferutil@4.1.0)(effect@4.1.6(patch_hash=c13237f64561426c002130285a9832acc5bb6ab42fd81e020b306429757ddda1))(redis@6.2.1)(utf-8-validate@6.0.6))(effect@4.1.6(patch_hash=c13237f64561426c002130285a9832acc5bb6ab42fd81e020b306429757ddda1)) '@effect/vitest': - specifier: 4.1.5 - version: 4.1.5(patch_hash=dd0bf2b1ae0f63aff0d620ebc67b82d19759b3fa69a608ef85e2a5b40b4d46c5)(@astrojs/compiler-rs@0.5.1)(@types/node@24.12.4)(@vitest/browser-playwright@5.1.1)(@vitest/ui@5.1.1)(@volar/typescript@2.4.28(typescript@6.0.3))(bufferutil@4.1.0)(effect@4.1.5(patch_hash=14a7acd734809d8dddbf2c19c4ec01fdd2ffae60a612de42b5ed29860216052a))(esbuild@0.28.2)(jiti@2.7.0)(jsdom@30.1.0(@noble/hashes@1.8.0))(playwright@1.64.1)(terser@5.48.0)(typescript@6.0.3)(unrun@0.2.39)(utf-8-validate@6.0.6)(yaml@2.9.0) + specifier: 4.1.6 + version: 4.1.6(patch_hash=f87ba071dd4f5cfa3b1ba14d5d59363e64372cd49af4d8282c322939e6bf3af2)(@astrojs/compiler-rs@0.5.1)(@types/node@24.12.4)(@vitest/browser-playwright@5.1.1)(@vitest/ui@5.1.1)(@volar/typescript@2.4.28(typescript@6.0.3))(bufferutil@4.1.0)(effect@4.1.6(patch_hash=c13237f64561426c002130285a9832acc5bb6ab42fd81e020b306429757ddda1))(esbuild@0.28.2)(jiti@2.7.0)(jsdom@30.1.0(@noble/hashes@1.8.0))(playwright@1.64.1)(terser@5.48.0)(typescript@6.0.3)(unrun@0.2.39)(utf-8-validate@6.0.6)(yaml@2.9.0) '@types/node': specifier: 24.12.4 version: 24.12.4 @@ -1729,15 +1729,15 @@ importers: specifier: 8.0.3 version: 8.0.3 effect: - specifier: 4.1.5 - version: 4.1.5(patch_hash=14a7acd734809d8dddbf2c19c4ec01fdd2ffae60a612de42b5ed29860216052a) + specifier: 4.1.6 + version: 4.1.6(patch_hash=c13237f64561426c002130285a9832acc5bb6ab42fd81e020b306429757ddda1) devDependencies: '@effect/platform-node': - specifier: 4.1.5 - version: 4.1.5(bufferutil@4.1.0)(effect@4.1.5(patch_hash=14a7acd734809d8dddbf2c19c4ec01fdd2ffae60a612de42b5ed29860216052a))(redis@6.2.1)(utf-8-validate@6.0.6) + specifier: 4.1.6 + version: 4.1.6(bufferutil@4.1.0)(effect@4.1.6(patch_hash=c13237f64561426c002130285a9832acc5bb6ab42fd81e020b306429757ddda1))(redis@6.2.1)(utf-8-validate@6.0.6) '@effect/vitest': - specifier: 4.1.5 - version: 4.1.5(patch_hash=dd0bf2b1ae0f63aff0d620ebc67b82d19759b3fa69a608ef85e2a5b40b4d46c5)(@astrojs/compiler-rs@0.5.1)(@types/node@24.12.4)(@vitest/browser-playwright@5.1.1)(@vitest/ui@5.1.1)(@volar/typescript@2.4.28(typescript@6.0.3))(bufferutil@4.1.0)(effect@4.1.5(patch_hash=14a7acd734809d8dddbf2c19c4ec01fdd2ffae60a612de42b5ed29860216052a))(esbuild@0.28.2)(jiti@2.7.0)(jsdom@30.1.0(@noble/hashes@1.8.0))(playwright@1.64.1)(terser@5.48.0)(typescript@6.0.3)(unrun@0.2.39)(utf-8-validate@6.0.6)(yaml@2.9.0) + specifier: 4.1.6 + version: 4.1.6(patch_hash=f87ba071dd4f5cfa3b1ba14d5d59363e64372cd49af4d8282c322939e6bf3af2)(@astrojs/compiler-rs@0.5.1)(@types/node@24.12.4)(@vitest/browser-playwright@5.1.1)(@vitest/ui@5.1.1)(@volar/typescript@2.4.28(typescript@6.0.3))(bufferutil@4.1.0)(effect@4.1.6(patch_hash=c13237f64561426c002130285a9832acc5bb6ab42fd81e020b306429757ddda1))(esbuild@0.28.2)(jiti@2.7.0)(jsdom@30.1.0(@noble/hashes@1.8.0))(playwright@1.64.1)(terser@5.48.0)(typescript@6.0.3)(unrun@0.2.39)(utf-8-validate@6.0.6)(yaml@2.9.0) '@types/node': specifier: 24.12.4 version: 24.12.4 @@ -1766,15 +1766,15 @@ importers: specifier: workspace:* version: link:../shared effect: - specifier: 4.1.5 - version: 4.1.5(patch_hash=14a7acd734809d8dddbf2c19c4ec01fdd2ffae60a612de42b5ed29860216052a) + specifier: 4.1.6 + version: 4.1.6(patch_hash=c13237f64561426c002130285a9832acc5bb6ab42fd81e020b306429757ddda1) devDependencies: '@effect/platform-node': - specifier: 4.1.5 - version: 4.1.5(bufferutil@4.1.0)(effect@4.1.5(patch_hash=14a7acd734809d8dddbf2c19c4ec01fdd2ffae60a612de42b5ed29860216052a))(redis@6.2.1)(utf-8-validate@6.0.6) + specifier: 4.1.6 + version: 4.1.6(bufferutil@4.1.0)(effect@4.1.6(patch_hash=c13237f64561426c002130285a9832acc5bb6ab42fd81e020b306429757ddda1))(redis@6.2.1)(utf-8-validate@6.0.6) '@effect/vitest': - specifier: 4.1.5 - version: 4.1.5(patch_hash=dd0bf2b1ae0f63aff0d620ebc67b82d19759b3fa69a608ef85e2a5b40b4d46c5)(@astrojs/compiler-rs@0.5.1)(@types/node@24.12.4)(@vitest/browser-playwright@5.1.1)(@vitest/ui@5.1.1)(@volar/typescript@2.4.28(typescript@6.0.3))(bufferutil@4.1.0)(effect@4.1.5(patch_hash=14a7acd734809d8dddbf2c19c4ec01fdd2ffae60a612de42b5ed29860216052a))(esbuild@0.28.2)(jiti@2.7.0)(jsdom@30.1.0(@noble/hashes@1.8.0))(playwright@1.64.1)(terser@5.48.0)(typescript@6.0.3)(unrun@0.2.39)(utf-8-validate@6.0.6)(yaml@2.9.0) + specifier: 4.1.6 + version: 4.1.6(patch_hash=f87ba071dd4f5cfa3b1ba14d5d59363e64372cd49af4d8282c322939e6bf3af2)(@astrojs/compiler-rs@0.5.1)(@types/node@24.12.4)(@vitest/browser-playwright@5.1.1)(@vitest/ui@5.1.1)(@volar/typescript@2.4.28(typescript@6.0.3))(bufferutil@4.1.0)(effect@4.1.6(patch_hash=c13237f64561426c002130285a9832acc5bb6ab42fd81e020b306429757ddda1))(esbuild@0.28.2)(jiti@2.7.0)(jsdom@30.1.0(@noble/hashes@1.8.0))(playwright@1.64.1)(terser@5.48.0)(typescript@6.0.3)(unrun@0.2.39)(utf-8-validate@6.0.6)(yaml@2.9.0) '@t3tools/provider-testing': specifier: workspace:* version: link:../provider-testing @@ -1797,15 +1797,15 @@ importers: specifier: workspace:* version: link:../shared effect: - specifier: 4.1.5 - version: 4.1.5(patch_hash=14a7acd734809d8dddbf2c19c4ec01fdd2ffae60a612de42b5ed29860216052a) + specifier: 4.1.6 + version: 4.1.6(patch_hash=c13237f64561426c002130285a9832acc5bb6ab42fd81e020b306429757ddda1) devDependencies: '@effect/platform-node': - specifier: 4.1.5 - version: 4.1.5(bufferutil@4.1.0)(effect@4.1.5(patch_hash=14a7acd734809d8dddbf2c19c4ec01fdd2ffae60a612de42b5ed29860216052a))(redis@6.2.1)(utf-8-validate@6.0.6) + specifier: 4.1.6 + version: 4.1.6(bufferutil@4.1.0)(effect@4.1.6(patch_hash=c13237f64561426c002130285a9832acc5bb6ab42fd81e020b306429757ddda1))(redis@6.2.1)(utf-8-validate@6.0.6) '@effect/vitest': - specifier: 4.1.5 - version: 4.1.5(patch_hash=dd0bf2b1ae0f63aff0d620ebc67b82d19759b3fa69a608ef85e2a5b40b4d46c5)(@astrojs/compiler-rs@0.5.1)(@types/node@24.12.4)(@vitest/browser-playwright@5.1.1)(@vitest/ui@5.1.1)(@volar/typescript@2.4.28(typescript@6.0.3))(bufferutil@4.1.0)(effect@4.1.5(patch_hash=14a7acd734809d8dddbf2c19c4ec01fdd2ffae60a612de42b5ed29860216052a))(esbuild@0.28.2)(jiti@2.7.0)(jsdom@30.1.0(@noble/hashes@1.8.0))(playwright@1.64.1)(terser@5.48.0)(typescript@6.0.3)(unrun@0.2.39)(utf-8-validate@6.0.6)(yaml@2.9.0) + specifier: 4.1.6 + version: 4.1.6(patch_hash=f87ba071dd4f5cfa3b1ba14d5d59363e64372cd49af4d8282c322939e6bf3af2)(@astrojs/compiler-rs@0.5.1)(@types/node@24.12.4)(@vitest/browser-playwright@5.1.1)(@vitest/ui@5.1.1)(@volar/typescript@2.4.28(typescript@6.0.3))(bufferutil@4.1.0)(effect@4.1.6(patch_hash=c13237f64561426c002130285a9832acc5bb6ab42fd81e020b306429757ddda1))(esbuild@0.28.2)(jiti@2.7.0)(jsdom@30.1.0(@noble/hashes@1.8.0))(playwright@1.64.1)(terser@5.48.0)(typescript@6.0.3)(unrun@0.2.39)(utf-8-validate@6.0.6)(yaml@2.9.0) '@types/node': specifier: 24.12.4 version: 24.12.4 @@ -1828,8 +1828,8 @@ importers: specifier: workspace:* version: link:../shared effect: - specifier: 4.1.5 - version: 4.1.5(patch_hash=14a7acd734809d8dddbf2c19c4ec01fdd2ffae60a612de42b5ed29860216052a) + specifier: 4.1.6 + version: 4.1.6(patch_hash=c13237f64561426c002130285a9832acc5bb6ab42fd81e020b306429757ddda1) jsonc-parser: specifier: 3.3.1 version: 3.3.1 @@ -1838,11 +1838,11 @@ importers: version: 2.9.0 devDependencies: '@effect/platform-node': - specifier: 4.1.5 - version: 4.1.5(bufferutil@4.1.0)(effect@4.1.5(patch_hash=14a7acd734809d8dddbf2c19c4ec01fdd2ffae60a612de42b5ed29860216052a))(redis@6.2.1)(utf-8-validate@6.0.6) + specifier: 4.1.6 + version: 4.1.6(bufferutil@4.1.0)(effect@4.1.6(patch_hash=c13237f64561426c002130285a9832acc5bb6ab42fd81e020b306429757ddda1))(redis@6.2.1)(utf-8-validate@6.0.6) '@effect/vitest': - specifier: 4.1.5 - version: 4.1.5(patch_hash=dd0bf2b1ae0f63aff0d620ebc67b82d19759b3fa69a608ef85e2a5b40b4d46c5)(@astrojs/compiler-rs@0.5.1)(@types/node@24.12.4)(@vitest/browser-playwright@5.1.1)(@vitest/ui@5.1.1)(@volar/typescript@2.4.28(typescript@6.0.3))(bufferutil@4.1.0)(effect@4.1.5(patch_hash=14a7acd734809d8dddbf2c19c4ec01fdd2ffae60a612de42b5ed29860216052a))(esbuild@0.28.2)(jiti@2.7.0)(jsdom@30.1.0(@noble/hashes@1.8.0))(playwright@1.64.1)(terser@5.48.0)(typescript@6.0.3)(unrun@0.2.39)(utf-8-validate@6.0.6)(yaml@2.9.0) + specifier: 4.1.6 + version: 4.1.6(patch_hash=f87ba071dd4f5cfa3b1ba14d5d59363e64372cd49af4d8282c322939e6bf3af2)(@astrojs/compiler-rs@0.5.1)(@types/node@24.12.4)(@vitest/browser-playwright@5.1.1)(@vitest/ui@5.1.1)(@volar/typescript@2.4.28(typescript@6.0.3))(bufferutil@4.1.0)(effect@4.1.6(patch_hash=c13237f64561426c002130285a9832acc5bb6ab42fd81e020b306429757ddda1))(esbuild@0.28.2)(jiti@2.7.0)(jsdom@30.1.0(@noble/hashes@1.8.0))(playwright@1.64.1)(terser@5.48.0)(typescript@6.0.3)(unrun@0.2.39)(utf-8-validate@6.0.6)(yaml@2.9.0) '@t3tools/provider-testing': specifier: workspace:* version: link:../provider-testing @@ -1868,15 +1868,15 @@ importers: specifier: workspace:* version: link:../shared effect: - specifier: 4.1.5 - version: 4.1.5(patch_hash=14a7acd734809d8dddbf2c19c4ec01fdd2ffae60a612de42b5ed29860216052a) + specifier: 4.1.6 + version: 4.1.6(patch_hash=c13237f64561426c002130285a9832acc5bb6ab42fd81e020b306429757ddda1) devDependencies: '@effect/platform-node': - specifier: 4.1.5 - version: 4.1.5(bufferutil@4.1.0)(effect@4.1.5(patch_hash=14a7acd734809d8dddbf2c19c4ec01fdd2ffae60a612de42b5ed29860216052a))(redis@6.2.1)(utf-8-validate@6.0.6) + specifier: 4.1.6 + version: 4.1.6(bufferutil@4.1.0)(effect@4.1.6(patch_hash=c13237f64561426c002130285a9832acc5bb6ab42fd81e020b306429757ddda1))(redis@6.2.1)(utf-8-validate@6.0.6) '@effect/vitest': - specifier: 4.1.5 - version: 4.1.5(patch_hash=dd0bf2b1ae0f63aff0d620ebc67b82d19759b3fa69a608ef85e2a5b40b4d46c5)(@astrojs/compiler-rs@0.5.1)(@types/node@24.12.4)(@vitest/browser-playwright@5.1.1)(@vitest/ui@5.1.1)(@volar/typescript@2.4.28(typescript@6.0.3))(bufferutil@4.1.0)(effect@4.1.5(patch_hash=14a7acd734809d8dddbf2c19c4ec01fdd2ffae60a612de42b5ed29860216052a))(esbuild@0.28.2)(jiti@2.7.0)(jsdom@30.1.0(@noble/hashes@1.8.0))(playwright@1.64.1)(terser@5.48.0)(typescript@6.0.3)(unrun@0.2.39)(utf-8-validate@6.0.6)(yaml@2.9.0) + specifier: 4.1.6 + version: 4.1.6(patch_hash=f87ba071dd4f5cfa3b1ba14d5d59363e64372cd49af4d8282c322939e6bf3af2)(@astrojs/compiler-rs@0.5.1)(@types/node@24.12.4)(@vitest/browser-playwright@5.1.1)(@vitest/ui@5.1.1)(@volar/typescript@2.4.28(typescript@6.0.3))(bufferutil@4.1.0)(effect@4.1.6(patch_hash=c13237f64561426c002130285a9832acc5bb6ab42fd81e020b306429757ddda1))(esbuild@0.28.2)(jiti@2.7.0)(jsdom@30.1.0(@noble/hashes@1.8.0))(playwright@1.64.1)(terser@5.48.0)(typescript@6.0.3)(unrun@0.2.39)(utf-8-validate@6.0.6)(yaml@2.9.0) '@t3tools/provider-testing': specifier: workspace:* version: link:../provider-testing @@ -1905,15 +1905,15 @@ importers: specifier: workspace:* version: link:../shared effect: - specifier: 4.1.5 - version: 4.1.5(patch_hash=14a7acd734809d8dddbf2c19c4ec01fdd2ffae60a612de42b5ed29860216052a) + specifier: 4.1.6 + version: 4.1.6(patch_hash=c13237f64561426c002130285a9832acc5bb6ab42fd81e020b306429757ddda1) devDependencies: '@effect/platform-node': - specifier: 4.1.5 - version: 4.1.5(bufferutil@4.1.0)(effect@4.1.5(patch_hash=14a7acd734809d8dddbf2c19c4ec01fdd2ffae60a612de42b5ed29860216052a))(redis@6.2.1)(utf-8-validate@6.0.6) + specifier: 4.1.6 + version: 4.1.6(bufferutil@4.1.0)(effect@4.1.6(patch_hash=c13237f64561426c002130285a9832acc5bb6ab42fd81e020b306429757ddda1))(redis@6.2.1)(utf-8-validate@6.0.6) '@effect/vitest': - specifier: 4.1.5 - version: 4.1.5(patch_hash=dd0bf2b1ae0f63aff0d620ebc67b82d19759b3fa69a608ef85e2a5b40b4d46c5)(@astrojs/compiler-rs@0.5.1)(@types/node@24.12.4)(@vitest/browser-playwright@5.1.1)(@vitest/ui@5.1.1)(@volar/typescript@2.4.28(typescript@6.0.3))(bufferutil@4.1.0)(effect@4.1.5(patch_hash=14a7acd734809d8dddbf2c19c4ec01fdd2ffae60a612de42b5ed29860216052a))(esbuild@0.28.2)(jiti@2.7.0)(jsdom@30.1.0(@noble/hashes@1.8.0))(playwright@1.64.1)(terser@5.48.0)(typescript@6.0.3)(unrun@0.2.39)(utf-8-validate@6.0.6)(yaml@2.9.0) + specifier: 4.1.6 + version: 4.1.6(patch_hash=f87ba071dd4f5cfa3b1ba14d5d59363e64372cd49af4d8282c322939e6bf3af2)(@astrojs/compiler-rs@0.5.1)(@types/node@24.12.4)(@vitest/browser-playwright@5.1.1)(@vitest/ui@5.1.1)(@volar/typescript@2.4.28(typescript@6.0.3))(bufferutil@4.1.0)(effect@4.1.6(patch_hash=c13237f64561426c002130285a9832acc5bb6ab42fd81e020b306429757ddda1))(esbuild@0.28.2)(jiti@2.7.0)(jsdom@30.1.0(@noble/hashes@1.8.0))(playwright@1.64.1)(terser@5.48.0)(typescript@6.0.3)(unrun@0.2.39)(utf-8-validate@6.0.6)(yaml@2.9.0) '@t3tools/provider-testing': specifier: workspace:* version: link:../provider-testing @@ -1942,15 +1942,15 @@ importers: specifier: workspace:* version: link:../shared effect: - specifier: 4.1.5 - version: 4.1.5(patch_hash=14a7acd734809d8dddbf2c19c4ec01fdd2ffae60a612de42b5ed29860216052a) + specifier: 4.1.6 + version: 4.1.6(patch_hash=c13237f64561426c002130285a9832acc5bb6ab42fd81e020b306429757ddda1) devDependencies: '@effect/platform-node': - specifier: 4.1.5 - version: 4.1.5(bufferutil@4.1.0)(effect@4.1.5(patch_hash=14a7acd734809d8dddbf2c19c4ec01fdd2ffae60a612de42b5ed29860216052a))(redis@6.2.1)(utf-8-validate@6.0.6) + specifier: 4.1.6 + version: 4.1.6(bufferutil@4.1.0)(effect@4.1.6(patch_hash=c13237f64561426c002130285a9832acc5bb6ab42fd81e020b306429757ddda1))(redis@6.2.1)(utf-8-validate@6.0.6) '@effect/vitest': - specifier: 4.1.5 - version: 4.1.5(patch_hash=dd0bf2b1ae0f63aff0d620ebc67b82d19759b3fa69a608ef85e2a5b40b4d46c5)(@astrojs/compiler-rs@0.5.1)(@types/node@24.12.4)(@vitest/browser-playwright@5.1.1)(@vitest/ui@5.1.1)(@volar/typescript@2.4.28(typescript@6.0.3))(bufferutil@4.1.0)(effect@4.1.5(patch_hash=14a7acd734809d8dddbf2c19c4ec01fdd2ffae60a612de42b5ed29860216052a))(esbuild@0.28.2)(jiti@2.7.0)(jsdom@30.1.0(@noble/hashes@1.8.0))(playwright@1.64.1)(terser@5.48.0)(typescript@6.0.3)(unrun@0.2.39)(utf-8-validate@6.0.6)(yaml@2.9.0) + specifier: 4.1.6 + version: 4.1.6(patch_hash=f87ba071dd4f5cfa3b1ba14d5d59363e64372cd49af4d8282c322939e6bf3af2)(@astrojs/compiler-rs@0.5.1)(@types/node@24.12.4)(@vitest/browser-playwright@5.1.1)(@vitest/ui@5.1.1)(@volar/typescript@2.4.28(typescript@6.0.3))(bufferutil@4.1.0)(effect@4.1.6(patch_hash=c13237f64561426c002130285a9832acc5bb6ab42fd81e020b306429757ddda1))(esbuild@0.28.2)(jiti@2.7.0)(jsdom@30.1.0(@noble/hashes@1.8.0))(playwright@1.64.1)(terser@5.48.0)(typescript@6.0.3)(unrun@0.2.39)(utf-8-validate@6.0.6)(yaml@2.9.0) '@t3tools/provider-testing': specifier: workspace:* version: link:../provider-testing @@ -1979,15 +1979,15 @@ importers: specifier: workspace:* version: link:../shared effect: - specifier: 4.1.5 - version: 4.1.5(patch_hash=14a7acd734809d8dddbf2c19c4ec01fdd2ffae60a612de42b5ed29860216052a) + specifier: 4.1.6 + version: 4.1.6(patch_hash=c13237f64561426c002130285a9832acc5bb6ab42fd81e020b306429757ddda1) devDependencies: '@effect/platform-node': - specifier: 4.1.5 - version: 4.1.5(bufferutil@4.1.0)(effect@4.1.5(patch_hash=14a7acd734809d8dddbf2c19c4ec01fdd2ffae60a612de42b5ed29860216052a))(redis@6.2.1)(utf-8-validate@6.0.6) + specifier: 4.1.6 + version: 4.1.6(bufferutil@4.1.0)(effect@4.1.6(patch_hash=c13237f64561426c002130285a9832acc5bb6ab42fd81e020b306429757ddda1))(redis@6.2.1)(utf-8-validate@6.0.6) '@effect/vitest': - specifier: 4.1.5 - version: 4.1.5(patch_hash=dd0bf2b1ae0f63aff0d620ebc67b82d19759b3fa69a608ef85e2a5b40b4d46c5)(@astrojs/compiler-rs@0.5.1)(@types/node@24.12.4)(@vitest/browser-playwright@5.1.1)(@vitest/ui@5.1.1)(@volar/typescript@2.4.28(typescript@6.0.3))(bufferutil@4.1.0)(effect@4.1.5(patch_hash=14a7acd734809d8dddbf2c19c4ec01fdd2ffae60a612de42b5ed29860216052a))(esbuild@0.28.2)(jiti@2.7.0)(jsdom@30.1.0(@noble/hashes@1.8.0))(playwright@1.64.1)(terser@5.48.0)(typescript@6.0.3)(unrun@0.2.39)(utf-8-validate@6.0.6)(yaml@2.9.0) + specifier: 4.1.6 + version: 4.1.6(patch_hash=f87ba071dd4f5cfa3b1ba14d5d59363e64372cd49af4d8282c322939e6bf3af2)(@astrojs/compiler-rs@0.5.1)(@types/node@24.12.4)(@vitest/browser-playwright@5.1.1)(@vitest/ui@5.1.1)(@volar/typescript@2.4.28(typescript@6.0.3))(bufferutil@4.1.0)(effect@4.1.6(patch_hash=c13237f64561426c002130285a9832acc5bb6ab42fd81e020b306429757ddda1))(esbuild@0.28.2)(jiti@2.7.0)(jsdom@30.1.0(@noble/hashes@1.8.0))(playwright@1.64.1)(terser@5.48.0)(typescript@6.0.3)(unrun@0.2.39)(utf-8-validate@6.0.6)(yaml@2.9.0) '@t3tools/provider-testing': specifier: workspace:* version: link:../provider-testing @@ -2005,7 +2005,7 @@ importers: version: 1.15.13 '@opencode/client': specifier: 2.0.28 - version: 2.0.28(effect@4.1.5(patch_hash=14a7acd734809d8dddbf2c19c4ec01fdd2ffae60a612de42b5ed29860216052a)) + version: 2.0.28(effect@4.1.6(patch_hash=c13237f64561426c002130285a9832acc5bb6ab42fd81e020b306429757ddda1)) '@opencode/protocol': specifier: 2.0.28 version: 2.0.28 @@ -2022,15 +2022,15 @@ importers: specifier: workspace:* version: link:../shared effect: - specifier: 4.1.5 - version: 4.1.5(patch_hash=14a7acd734809d8dddbf2c19c4ec01fdd2ffae60a612de42b5ed29860216052a) + specifier: 4.1.6 + version: 4.1.6(patch_hash=c13237f64561426c002130285a9832acc5bb6ab42fd81e020b306429757ddda1) devDependencies: '@effect/platform-node': - specifier: 4.1.5 - version: 4.1.5(bufferutil@4.1.0)(effect@4.1.5(patch_hash=14a7acd734809d8dddbf2c19c4ec01fdd2ffae60a612de42b5ed29860216052a))(redis@6.2.1)(utf-8-validate@6.0.6) + specifier: 4.1.6 + version: 4.1.6(bufferutil@4.1.0)(effect@4.1.6(patch_hash=c13237f64561426c002130285a9832acc5bb6ab42fd81e020b306429757ddda1))(redis@6.2.1)(utf-8-validate@6.0.6) '@effect/vitest': - specifier: 4.1.5 - version: 4.1.5(patch_hash=dd0bf2b1ae0f63aff0d620ebc67b82d19759b3fa69a608ef85e2a5b40b4d46c5)(@astrojs/compiler-rs@0.5.1)(@types/node@24.12.4)(@vitest/browser-playwright@5.1.1)(@vitest/ui@5.1.1)(@volar/typescript@2.4.28(typescript@6.0.3))(bufferutil@4.1.0)(effect@4.1.5(patch_hash=14a7acd734809d8dddbf2c19c4ec01fdd2ffae60a612de42b5ed29860216052a))(esbuild@0.28.2)(jiti@2.7.0)(jsdom@30.1.0(@noble/hashes@1.8.0))(playwright@1.64.1)(terser@5.48.0)(typescript@6.0.3)(unrun@0.2.39)(utf-8-validate@6.0.6)(yaml@2.9.0) + specifier: 4.1.6 + version: 4.1.6(patch_hash=f87ba071dd4f5cfa3b1ba14d5d59363e64372cd49af4d8282c322939e6bf3af2)(@astrojs/compiler-rs@0.5.1)(@types/node@24.12.4)(@vitest/browser-playwright@5.1.1)(@vitest/ui@5.1.1)(@volar/typescript@2.4.28(typescript@6.0.3))(bufferutil@4.1.0)(effect@4.1.6(patch_hash=c13237f64561426c002130285a9832acc5bb6ab42fd81e020b306429757ddda1))(esbuild@0.28.2)(jiti@2.7.0)(jsdom@30.1.0(@noble/hashes@1.8.0))(playwright@1.64.1)(terser@5.48.0)(typescript@6.0.3)(unrun@0.2.39)(utf-8-validate@6.0.6)(yaml@2.9.0) '@t3tools/provider-testing': specifier: workspace:* version: link:../provider-testing @@ -2053,15 +2053,15 @@ importers: specifier: workspace:* version: link:../shared effect: - specifier: 4.1.5 - version: 4.1.5(patch_hash=14a7acd734809d8dddbf2c19c4ec01fdd2ffae60a612de42b5ed29860216052a) + specifier: 4.1.6 + version: 4.1.6(patch_hash=c13237f64561426c002130285a9832acc5bb6ab42fd81e020b306429757ddda1) devDependencies: '@effect/platform-node': - specifier: 4.1.5 - version: 4.1.5(bufferutil@4.1.0)(effect@4.1.5(patch_hash=14a7acd734809d8dddbf2c19c4ec01fdd2ffae60a612de42b5ed29860216052a))(redis@6.2.1)(utf-8-validate@6.0.6) + specifier: 4.1.6 + version: 4.1.6(bufferutil@4.1.0)(effect@4.1.6(patch_hash=c13237f64561426c002130285a9832acc5bb6ab42fd81e020b306429757ddda1))(redis@6.2.1)(utf-8-validate@6.0.6) '@effect/vitest': - specifier: 4.1.5 - version: 4.1.5(patch_hash=dd0bf2b1ae0f63aff0d620ebc67b82d19759b3fa69a608ef85e2a5b40b4d46c5)(@astrojs/compiler-rs@0.5.1)(@types/node@24.12.4)(@vitest/browser-playwright@5.1.1)(@vitest/ui@5.1.1)(@volar/typescript@2.4.28(typescript@6.0.3))(bufferutil@4.1.0)(effect@4.1.5(patch_hash=14a7acd734809d8dddbf2c19c4ec01fdd2ffae60a612de42b5ed29860216052a))(esbuild@0.28.2)(jiti@2.7.0)(jsdom@30.1.0(@noble/hashes@1.8.0))(playwright@1.64.1)(terser@5.48.0)(typescript@6.0.3)(unrun@0.2.39)(utf-8-validate@6.0.6)(yaml@2.9.0) + specifier: 4.1.6 + version: 4.1.6(patch_hash=f87ba071dd4f5cfa3b1ba14d5d59363e64372cd49af4d8282c322939e6bf3af2)(@astrojs/compiler-rs@0.5.1)(@types/node@24.12.4)(@vitest/browser-playwright@5.1.1)(@vitest/ui@5.1.1)(@volar/typescript@2.4.28(typescript@6.0.3))(bufferutil@4.1.0)(effect@4.1.6(patch_hash=c13237f64561426c002130285a9832acc5bb6ab42fd81e020b306429757ddda1))(esbuild@0.28.2)(jiti@2.7.0)(jsdom@30.1.0(@noble/hashes@1.8.0))(playwright@1.64.1)(terser@5.48.0)(typescript@6.0.3)(unrun@0.2.39)(utf-8-validate@6.0.6)(yaml@2.9.0) '@t3tools/provider-testing': specifier: workspace:* version: link:../provider-testing @@ -2075,8 +2075,8 @@ importers: packages/provider-testing: dependencies: '@effect/platform-node': - specifier: 4.1.5 - version: 4.1.5(bufferutil@4.1.0)(effect@4.1.5(patch_hash=14a7acd734809d8dddbf2c19c4ec01fdd2ffae60a612de42b5ed29860216052a))(redis@6.2.1)(utf-8-validate@6.0.6) + specifier: 4.1.6 + version: 4.1.6(bufferutil@4.1.0)(effect@4.1.6(patch_hash=c13237f64561426c002130285a9832acc5bb6ab42fd81e020b306429757ddda1))(redis@6.2.1)(utf-8-validate@6.0.6) '@t3tools/contracts': specifier: workspace:* version: link:../contracts @@ -2087,12 +2087,12 @@ importers: specifier: workspace:* version: link:../shared effect: - specifier: 4.1.5 - version: 4.1.5(patch_hash=14a7acd734809d8dddbf2c19c4ec01fdd2ffae60a612de42b5ed29860216052a) + specifier: 4.1.6 + version: 4.1.6(patch_hash=c13237f64561426c002130285a9832acc5bb6ab42fd81e020b306429757ddda1) devDependencies: '@effect/vitest': - specifier: 4.1.5 - version: 4.1.5(patch_hash=dd0bf2b1ae0f63aff0d620ebc67b82d19759b3fa69a608ef85e2a5b40b4d46c5)(@astrojs/compiler-rs@0.5.1)(@types/node@24.12.4)(@vitest/browser-playwright@5.1.1)(@vitest/ui@5.1.1)(@volar/typescript@2.4.28(typescript@6.0.3))(bufferutil@4.1.0)(effect@4.1.5(patch_hash=14a7acd734809d8dddbf2c19c4ec01fdd2ffae60a612de42b5ed29860216052a))(esbuild@0.28.2)(jiti@2.7.0)(jsdom@30.1.0(@noble/hashes@1.8.0))(playwright@1.64.1)(terser@5.48.0)(typescript@6.0.3)(unrun@0.2.39)(utf-8-validate@6.0.6)(yaml@2.9.0) + specifier: 4.1.6 + version: 4.1.6(patch_hash=f87ba071dd4f5cfa3b1ba14d5d59363e64372cd49af4d8282c322939e6bf3af2)(@astrojs/compiler-rs@0.5.1)(@types/node@24.12.4)(@vitest/browser-playwright@5.1.1)(@vitest/ui@5.1.1)(@volar/typescript@2.4.28(typescript@6.0.3))(bufferutil@4.1.0)(effect@4.1.6(patch_hash=c13237f64561426c002130285a9832acc5bb6ab42fd81e020b306429757ddda1))(esbuild@0.28.2)(jiti@2.7.0)(jsdom@30.1.0(@noble/hashes@1.8.0))(playwright@1.64.1)(terser@5.48.0)(typescript@6.0.3)(unrun@0.2.39)(utf-8-validate@6.0.6)(yaml@2.9.0) '@types/node': specifier: 24.12.4 version: 24.12.4 @@ -2106,15 +2106,15 @@ importers: specifier: workspace:* version: link:../contracts effect: - specifier: 4.1.5 - version: 4.1.5(patch_hash=14a7acd734809d8dddbf2c19c4ec01fdd2ffae60a612de42b5ed29860216052a) + specifier: 4.1.6 + version: 4.1.6(patch_hash=c13237f64561426c002130285a9832acc5bb6ab42fd81e020b306429757ddda1) devDependencies: '@effect/platform-node': - specifier: 4.1.5 - version: 4.1.5(bufferutil@4.1.0)(effect@4.1.5(patch_hash=14a7acd734809d8dddbf2c19c4ec01fdd2ffae60a612de42b5ed29860216052a))(redis@6.2.1)(utf-8-validate@6.0.6) + specifier: 4.1.6 + version: 4.1.6(bufferutil@4.1.0)(effect@4.1.6(patch_hash=c13237f64561426c002130285a9832acc5bb6ab42fd81e020b306429757ddda1))(redis@6.2.1)(utf-8-validate@6.0.6) '@effect/vitest': - specifier: 4.1.5 - version: 4.1.5(patch_hash=dd0bf2b1ae0f63aff0d620ebc67b82d19759b3fa69a608ef85e2a5b40b4d46c5)(@astrojs/compiler-rs@0.5.1)(@types/node@24.12.4)(@vitest/browser-playwright@5.1.1)(@vitest/ui@5.1.1)(@volar/typescript@2.4.28(typescript@6.0.3))(bufferutil@4.1.0)(effect@4.1.5(patch_hash=14a7acd734809d8dddbf2c19c4ec01fdd2ffae60a612de42b5ed29860216052a))(esbuild@0.28.2)(jiti@2.7.0)(jsdom@30.1.0(@noble/hashes@1.8.0))(playwright@1.64.1)(terser@5.48.0)(typescript@6.0.3)(unrun@0.2.39)(utf-8-validate@6.0.6)(yaml@2.9.0) + specifier: 4.1.6 + version: 4.1.6(patch_hash=f87ba071dd4f5cfa3b1ba14d5d59363e64372cd49af4d8282c322939e6bf3af2)(@astrojs/compiler-rs@0.5.1)(@types/node@24.12.4)(@vitest/browser-playwright@5.1.1)(@vitest/ui@5.1.1)(@volar/typescript@2.4.28(typescript@6.0.3))(bufferutil@4.1.0)(effect@4.1.6(patch_hash=c13237f64561426c002130285a9832acc5bb6ab42fd81e020b306429757ddda1))(esbuild@0.28.2)(jiti@2.7.0)(jsdom@30.1.0(@noble/hashes@1.8.0))(playwright@1.64.1)(terser@5.48.0)(typescript@6.0.3)(unrun@0.2.39)(utf-8-validate@6.0.6)(yaml@2.9.0) '@types/node': specifier: 24.12.4 version: 24.12.4 @@ -2146,15 +2146,15 @@ importers: specifier: workspace:* version: link:../shared effect: - specifier: 4.1.5 - version: 4.1.5(patch_hash=14a7acd734809d8dddbf2c19c4ec01fdd2ffae60a612de42b5ed29860216052a) + specifier: 4.1.6 + version: 4.1.6(patch_hash=c13237f64561426c002130285a9832acc5bb6ab42fd81e020b306429757ddda1) devDependencies: '@effect/platform-node': - specifier: 4.1.5 - version: 4.1.5(bufferutil@4.1.0)(effect@4.1.5(patch_hash=14a7acd734809d8dddbf2c19c4ec01fdd2ffae60a612de42b5ed29860216052a))(redis@6.2.1)(utf-8-validate@6.0.6) + specifier: 4.1.6 + version: 4.1.6(bufferutil@4.1.0)(effect@4.1.6(patch_hash=c13237f64561426c002130285a9832acc5bb6ab42fd81e020b306429757ddda1))(redis@6.2.1)(utf-8-validate@6.0.6) '@effect/vitest': - specifier: 4.1.5 - version: 4.1.5(patch_hash=dd0bf2b1ae0f63aff0d620ebc67b82d19759b3fa69a608ef85e2a5b40b4d46c5)(@astrojs/compiler-rs@0.5.1)(@types/node@24.12.4)(@vitest/browser-playwright@5.1.1)(@vitest/ui@5.1.1)(@volar/typescript@2.4.28(typescript@6.0.3))(bufferutil@4.1.0)(effect@4.1.5(patch_hash=14a7acd734809d8dddbf2c19c4ec01fdd2ffae60a612de42b5ed29860216052a))(esbuild@0.28.2)(jiti@2.7.0)(jsdom@30.1.0(@noble/hashes@1.8.0))(playwright@1.64.1)(terser@5.48.0)(typescript@6.0.3)(unrun@0.2.39)(utf-8-validate@6.0.6)(yaml@2.9.0) + specifier: 4.1.6 + version: 4.1.6(patch_hash=f87ba071dd4f5cfa3b1ba14d5d59363e64372cd49af4d8282c322939e6bf3af2)(@astrojs/compiler-rs@0.5.1)(@types/node@24.12.4)(@vitest/browser-playwright@5.1.1)(@vitest/ui@5.1.1)(@volar/typescript@2.4.28(typescript@6.0.3))(bufferutil@4.1.0)(effect@4.1.6(patch_hash=c13237f64561426c002130285a9832acc5bb6ab42fd81e020b306429757ddda1))(esbuild@0.28.2)(jiti@2.7.0)(jsdom@30.1.0(@noble/hashes@1.8.0))(playwright@1.64.1)(terser@5.48.0)(typescript@6.0.3)(unrun@0.2.39)(utf-8-validate@6.0.6)(yaml@2.9.0) '@types/node': specifier: 24.12.4 version: 24.12.4 @@ -2174,8 +2174,8 @@ importers: specifier: workspace:* version: link:../contracts effect: - specifier: 4.1.5 - version: 4.1.5(patch_hash=14a7acd734809d8dddbf2c19c4ec01fdd2ffae60a612de42b5ed29860216052a) + specifier: 4.1.6 + version: 4.1.6(patch_hash=c13237f64561426c002130285a9832acc5bb6ab42fd81e020b306429757ddda1) ffi-rs: specifier: 1.3.2 version: 1.3.2 @@ -2235,11 +2235,11 @@ importers: version: 2.9.0 devDependencies: '@effect/platform-node': - specifier: 4.1.5 - version: 4.1.5(bufferutil@4.1.0)(effect@4.1.5(patch_hash=14a7acd734809d8dddbf2c19c4ec01fdd2ffae60a612de42b5ed29860216052a))(redis@6.2.1)(utf-8-validate@6.0.6) + specifier: 4.1.6 + version: 4.1.6(bufferutil@4.1.0)(effect@4.1.6(patch_hash=c13237f64561426c002130285a9832acc5bb6ab42fd81e020b306429757ddda1))(redis@6.2.1)(utf-8-validate@6.0.6) '@effect/vitest': - specifier: 4.1.5 - version: 4.1.5(patch_hash=dd0bf2b1ae0f63aff0d620ebc67b82d19759b3fa69a608ef85e2a5b40b4d46c5)(@astrojs/compiler-rs@0.5.1)(@types/node@24.12.4)(@vitest/browser-playwright@5.1.1)(@vitest/ui@5.1.1)(@volar/typescript@2.4.28(typescript@6.0.3))(bufferutil@4.1.0)(effect@4.1.5(patch_hash=14a7acd734809d8dddbf2c19c4ec01fdd2ffae60a612de42b5ed29860216052a))(esbuild@0.28.2)(jiti@2.7.0)(jsdom@30.1.0(@noble/hashes@1.8.0))(playwright@1.64.1)(terser@5.48.0)(typescript@6.0.3)(unrun@0.2.39)(utf-8-validate@6.0.6)(yaml@2.9.0) + specifier: 4.1.6 + version: 4.1.6(patch_hash=f87ba071dd4f5cfa3b1ba14d5d59363e64372cd49af4d8282c322939e6bf3af2)(@astrojs/compiler-rs@0.5.1)(@types/node@24.12.4)(@vitest/browser-playwright@5.1.1)(@vitest/ui@5.1.1)(@volar/typescript@2.4.28(typescript@6.0.3))(bufferutil@4.1.0)(effect@4.1.6(patch_hash=c13237f64561426c002130285a9832acc5bb6ab42fd81e020b306429757ddda1))(esbuild@0.28.2)(jiti@2.7.0)(jsdom@30.1.0(@noble/hashes@1.8.0))(playwright@1.64.1)(terser@5.48.0)(typescript@6.0.3)(unrun@0.2.39)(utf-8-validate@6.0.6)(yaml@2.9.0) '@types/hast': specifier: ^3.0.5 version: 3.0.5 @@ -2274,15 +2274,15 @@ importers: specifier: 8.0.3 version: 8.0.3 effect: - specifier: 4.1.5 - version: 4.1.5(patch_hash=14a7acd734809d8dddbf2c19c4ec01fdd2ffae60a612de42b5ed29860216052a) + specifier: 4.1.6 + version: 4.1.6(patch_hash=c13237f64561426c002130285a9832acc5bb6ab42fd81e020b306429757ddda1) devDependencies: '@effect/platform-node': - specifier: 4.1.5 - version: 4.1.5(bufferutil@4.1.0)(effect@4.1.5(patch_hash=14a7acd734809d8dddbf2c19c4ec01fdd2ffae60a612de42b5ed29860216052a))(redis@6.2.1)(utf-8-validate@6.0.6) + specifier: 4.1.6 + version: 4.1.6(bufferutil@4.1.0)(effect@4.1.6(patch_hash=c13237f64561426c002130285a9832acc5bb6ab42fd81e020b306429757ddda1))(redis@6.2.1)(utf-8-validate@6.0.6) '@effect/vitest': - specifier: 4.1.5 - version: 4.1.5(patch_hash=dd0bf2b1ae0f63aff0d620ebc67b82d19759b3fa69a608ef85e2a5b40b4d46c5)(@astrojs/compiler-rs@0.5.1)(@types/node@24.12.4)(@vitest/browser-playwright@5.1.1)(@vitest/ui@5.1.1)(@volar/typescript@2.4.28(typescript@6.0.3))(bufferutil@4.1.0)(effect@4.1.5(patch_hash=14a7acd734809d8dddbf2c19c4ec01fdd2ffae60a612de42b5ed29860216052a))(esbuild@0.28.2)(jiti@2.7.0)(jsdom@30.1.0(@noble/hashes@1.8.0))(playwright@1.64.1)(terser@5.48.0)(typescript@6.0.3)(unrun@0.2.39)(utf-8-validate@6.0.6)(yaml@2.9.0) + specifier: 4.1.6 + version: 4.1.6(patch_hash=f87ba071dd4f5cfa3b1ba14d5d59363e64372cd49af4d8282c322939e6bf3af2)(@astrojs/compiler-rs@0.5.1)(@types/node@24.12.4)(@vitest/browser-playwright@5.1.1)(@vitest/ui@5.1.1)(@volar/typescript@2.4.28(typescript@6.0.3))(bufferutil@4.1.0)(effect@4.1.6(patch_hash=c13237f64561426c002130285a9832acc5bb6ab42fd81e020b306429757ddda1))(esbuild@0.28.2)(jiti@2.7.0)(jsdom@30.1.0(@noble/hashes@1.8.0))(playwright@1.64.1)(terser@5.48.0)(typescript@6.0.3)(unrun@0.2.39)(utf-8-validate@6.0.6)(yaml@2.9.0) '@t3tools/source-control-testing': specifier: workspace:* version: link:../source-control-testing @@ -2308,15 +2308,15 @@ importers: specifier: workspace:* version: link:../source-control-core effect: - specifier: 4.1.5 - version: 4.1.5(patch_hash=14a7acd734809d8dddbf2c19c4ec01fdd2ffae60a612de42b5ed29860216052a) + specifier: 4.1.6 + version: 4.1.6(patch_hash=c13237f64561426c002130285a9832acc5bb6ab42fd81e020b306429757ddda1) devDependencies: '@effect/platform-node': - specifier: 4.1.5 - version: 4.1.5(bufferutil@4.1.0)(effect@4.1.5(patch_hash=14a7acd734809d8dddbf2c19c4ec01fdd2ffae60a612de42b5ed29860216052a))(redis@6.2.1)(utf-8-validate@6.0.6) + specifier: 4.1.6 + version: 4.1.6(bufferutil@4.1.0)(effect@4.1.6(patch_hash=c13237f64561426c002130285a9832acc5bb6ab42fd81e020b306429757ddda1))(redis@6.2.1)(utf-8-validate@6.0.6) '@effect/vitest': - specifier: 4.1.5 - version: 4.1.5(patch_hash=dd0bf2b1ae0f63aff0d620ebc67b82d19759b3fa69a608ef85e2a5b40b4d46c5)(@astrojs/compiler-rs@0.5.1)(@types/node@24.12.4)(@vitest/browser-playwright@5.1.1)(@vitest/ui@5.1.1)(@volar/typescript@2.4.28(typescript@6.0.3))(bufferutil@4.1.0)(effect@4.1.5(patch_hash=14a7acd734809d8dddbf2c19c4ec01fdd2ffae60a612de42b5ed29860216052a))(esbuild@0.28.2)(jiti@2.7.0)(jsdom@30.1.0(@noble/hashes@1.8.0))(playwright@1.64.1)(terser@5.48.0)(typescript@6.0.3)(unrun@0.2.39)(utf-8-validate@6.0.6)(yaml@2.9.0) + specifier: 4.1.6 + version: 4.1.6(patch_hash=f87ba071dd4f5cfa3b1ba14d5d59363e64372cd49af4d8282c322939e6bf3af2)(@astrojs/compiler-rs@0.5.1)(@types/node@24.12.4)(@vitest/browser-playwright@5.1.1)(@vitest/ui@5.1.1)(@volar/typescript@2.4.28(typescript@6.0.3))(bufferutil@4.1.0)(effect@4.1.6(patch_hash=c13237f64561426c002130285a9832acc5bb6ab42fd81e020b306429757ddda1))(esbuild@0.28.2)(jiti@2.7.0)(jsdom@30.1.0(@noble/hashes@1.8.0))(playwright@1.64.1)(terser@5.48.0)(typescript@6.0.3)(unrun@0.2.39)(utf-8-validate@6.0.6)(yaml@2.9.0) '@t3tools/source-control-testing': specifier: workspace:* version: link:../source-control-testing @@ -2336,12 +2336,12 @@ importers: specifier: workspace:* version: link:../shared effect: - specifier: 4.1.5 - version: 4.1.5(patch_hash=14a7acd734809d8dddbf2c19c4ec01fdd2ffae60a612de42b5ed29860216052a) + specifier: 4.1.6 + version: 4.1.6(patch_hash=c13237f64561426c002130285a9832acc5bb6ab42fd81e020b306429757ddda1) devDependencies: '@effect/vitest': - specifier: 4.1.5 - version: 4.1.5(patch_hash=dd0bf2b1ae0f63aff0d620ebc67b82d19759b3fa69a608ef85e2a5b40b4d46c5)(@astrojs/compiler-rs@0.5.1)(@types/node@24.12.4)(@vitest/browser-playwright@5.1.1)(@vitest/ui@5.1.1)(@volar/typescript@2.4.28(typescript@6.0.3))(bufferutil@4.1.0)(effect@4.1.5(patch_hash=14a7acd734809d8dddbf2c19c4ec01fdd2ffae60a612de42b5ed29860216052a))(esbuild@0.28.2)(jiti@2.7.0)(jsdom@30.1.0(@noble/hashes@1.8.0))(playwright@1.64.1)(terser@5.48.0)(typescript@6.0.3)(unrun@0.2.39)(utf-8-validate@6.0.6)(yaml@2.9.0) + specifier: 4.1.6 + version: 4.1.6(patch_hash=f87ba071dd4f5cfa3b1ba14d5d59363e64372cd49af4d8282c322939e6bf3af2)(@astrojs/compiler-rs@0.5.1)(@types/node@24.12.4)(@vitest/browser-playwright@5.1.1)(@vitest/ui@5.1.1)(@volar/typescript@2.4.28(typescript@6.0.3))(bufferutil@4.1.0)(effect@4.1.6(patch_hash=c13237f64561426c002130285a9832acc5bb6ab42fd81e020b306429757ddda1))(esbuild@0.28.2)(jiti@2.7.0)(jsdom@30.1.0(@noble/hashes@1.8.0))(playwright@1.64.1)(terser@5.48.0)(typescript@6.0.3)(unrun@0.2.39)(utf-8-validate@6.0.6)(yaml@2.9.0) '@types/node': specifier: 24.12.4 version: 24.12.4 @@ -2352,8 +2352,8 @@ importers: packages/source-control-cursor-origin: dependencies: '@effect/platform-node': - specifier: 4.1.5 - version: 4.1.5(bufferutil@4.1.0)(effect@4.1.5(patch_hash=14a7acd734809d8dddbf2c19c4ec01fdd2ffae60a612de42b5ed29860216052a))(redis@6.2.1)(utf-8-validate@6.0.6) + specifier: 4.1.6 + version: 4.1.6(bufferutil@4.1.0)(effect@4.1.6(patch_hash=c13237f64561426c002130285a9832acc5bb6ab42fd81e020b306429757ddda1))(redis@6.2.1)(utf-8-validate@6.0.6) '@t3tools/contracts': specifier: workspace:* version: link:../contracts @@ -2367,12 +2367,12 @@ importers: specifier: workspace:* version: link:../source-control-core effect: - specifier: 4.1.5 - version: 4.1.5(patch_hash=14a7acd734809d8dddbf2c19c4ec01fdd2ffae60a612de42b5ed29860216052a) + specifier: 4.1.6 + version: 4.1.6(patch_hash=c13237f64561426c002130285a9832acc5bb6ab42fd81e020b306429757ddda1) devDependencies: '@effect/vitest': - specifier: 4.1.5 - version: 4.1.5(patch_hash=dd0bf2b1ae0f63aff0d620ebc67b82d19759b3fa69a608ef85e2a5b40b4d46c5)(@astrojs/compiler-rs@0.5.1)(@types/node@24.12.4)(@vitest/browser-playwright@5.1.1)(@vitest/ui@5.1.1)(@volar/typescript@2.4.28(typescript@6.0.3))(bufferutil@4.1.0)(effect@4.1.5(patch_hash=14a7acd734809d8dddbf2c19c4ec01fdd2ffae60a612de42b5ed29860216052a))(esbuild@0.28.2)(jiti@2.7.0)(jsdom@30.1.0(@noble/hashes@1.8.0))(playwright@1.64.1)(terser@5.48.0)(typescript@6.0.3)(unrun@0.2.39)(utf-8-validate@6.0.6)(yaml@2.9.0) + specifier: 4.1.6 + version: 4.1.6(patch_hash=f87ba071dd4f5cfa3b1ba14d5d59363e64372cd49af4d8282c322939e6bf3af2)(@astrojs/compiler-rs@0.5.1)(@types/node@24.12.4)(@vitest/browser-playwright@5.1.1)(@vitest/ui@5.1.1)(@volar/typescript@2.4.28(typescript@6.0.3))(bufferutil@4.1.0)(effect@4.1.6(patch_hash=c13237f64561426c002130285a9832acc5bb6ab42fd81e020b306429757ddda1))(esbuild@0.28.2)(jiti@2.7.0)(jsdom@30.1.0(@noble/hashes@1.8.0))(playwright@1.64.1)(terser@5.48.0)(typescript@6.0.3)(unrun@0.2.39)(utf-8-validate@6.0.6)(yaml@2.9.0) '@types/node': specifier: 24.12.4 version: 24.12.4 @@ -2425,15 +2425,15 @@ importers: specifier: workspace:* version: link:../source-control-core effect: - specifier: 4.1.5 - version: 4.1.5(patch_hash=14a7acd734809d8dddbf2c19c4ec01fdd2ffae60a612de42b5ed29860216052a) + specifier: 4.1.6 + version: 4.1.6(patch_hash=c13237f64561426c002130285a9832acc5bb6ab42fd81e020b306429757ddda1) devDependencies: '@effect/platform-node': - specifier: 4.1.5 - version: 4.1.5(bufferutil@4.1.0)(effect@4.1.5(patch_hash=14a7acd734809d8dddbf2c19c4ec01fdd2ffae60a612de42b5ed29860216052a))(redis@6.2.1)(utf-8-validate@6.0.6) + specifier: 4.1.6 + version: 4.1.6(bufferutil@4.1.0)(effect@4.1.6(patch_hash=c13237f64561426c002130285a9832acc5bb6ab42fd81e020b306429757ddda1))(redis@6.2.1)(utf-8-validate@6.0.6) '@effect/vitest': - specifier: 4.1.5 - version: 4.1.5(patch_hash=dd0bf2b1ae0f63aff0d620ebc67b82d19759b3fa69a608ef85e2a5b40b4d46c5)(@astrojs/compiler-rs@0.5.1)(@types/node@24.12.4)(@vitest/browser-playwright@5.1.1)(@vitest/ui@5.1.1)(@volar/typescript@2.4.28(typescript@6.0.3))(bufferutil@4.1.0)(effect@4.1.5(patch_hash=14a7acd734809d8dddbf2c19c4ec01fdd2ffae60a612de42b5ed29860216052a))(esbuild@0.28.2)(jiti@2.7.0)(jsdom@30.1.0(@noble/hashes@1.8.0))(playwright@1.64.1)(terser@5.48.0)(typescript@6.0.3)(unrun@0.2.39)(utf-8-validate@6.0.6)(yaml@2.9.0) + specifier: 4.1.6 + version: 4.1.6(patch_hash=f87ba071dd4f5cfa3b1ba14d5d59363e64372cd49af4d8282c322939e6bf3af2)(@astrojs/compiler-rs@0.5.1)(@types/node@24.12.4)(@vitest/browser-playwright@5.1.1)(@vitest/ui@5.1.1)(@volar/typescript@2.4.28(typescript@6.0.3))(bufferutil@4.1.0)(effect@4.1.6(patch_hash=c13237f64561426c002130285a9832acc5bb6ab42fd81e020b306429757ddda1))(esbuild@0.28.2)(jiti@2.7.0)(jsdom@30.1.0(@noble/hashes@1.8.0))(playwright@1.64.1)(terser@5.48.0)(typescript@6.0.3)(unrun@0.2.39)(utf-8-validate@6.0.6)(yaml@2.9.0) '@t3tools/source-control-testing': specifier: workspace:* version: link:../source-control-testing @@ -2459,12 +2459,12 @@ importers: specifier: workspace:* version: link:../source-control-core effect: - specifier: 4.1.5 - version: 4.1.5(patch_hash=14a7acd734809d8dddbf2c19c4ec01fdd2ffae60a612de42b5ed29860216052a) + specifier: 4.1.6 + version: 4.1.6(patch_hash=c13237f64561426c002130285a9832acc5bb6ab42fd81e020b306429757ddda1) devDependencies: '@effect/vitest': - specifier: 4.1.5 - version: 4.1.5(patch_hash=dd0bf2b1ae0f63aff0d620ebc67b82d19759b3fa69a608ef85e2a5b40b4d46c5)(@astrojs/compiler-rs@0.5.1)(@types/node@24.12.4)(@vitest/browser-playwright@5.1.1)(@vitest/ui@5.1.1)(@volar/typescript@2.4.28(typescript@6.0.3))(bufferutil@4.1.0)(effect@4.1.5(patch_hash=14a7acd734809d8dddbf2c19c4ec01fdd2ffae60a612de42b5ed29860216052a))(esbuild@0.28.2)(jiti@2.7.0)(jsdom@30.1.0(@noble/hashes@1.8.0))(playwright@1.64.1)(terser@5.48.0)(typescript@6.0.3)(unrun@0.2.39)(utf-8-validate@6.0.6)(yaml@2.9.0) + specifier: 4.1.6 + version: 4.1.6(patch_hash=f87ba071dd4f5cfa3b1ba14d5d59363e64372cd49af4d8282c322939e6bf3af2)(@astrojs/compiler-rs@0.5.1)(@types/node@24.12.4)(@vitest/browser-playwright@5.1.1)(@vitest/ui@5.1.1)(@volar/typescript@2.4.28(typescript@6.0.3))(bufferutil@4.1.0)(effect@4.1.6(patch_hash=c13237f64561426c002130285a9832acc5bb6ab42fd81e020b306429757ddda1))(esbuild@0.28.2)(jiti@2.7.0)(jsdom@30.1.0(@noble/hashes@1.8.0))(playwright@1.64.1)(terser@5.48.0)(typescript@6.0.3)(unrun@0.2.39)(utf-8-validate@6.0.6)(yaml@2.9.0) '@t3tools/source-control-testing': specifier: workspace:* version: link:../source-control-testing @@ -2478,8 +2478,8 @@ importers: packages/source-control-github: dependencies: '@effect/platform-node': - specifier: 4.1.5 - version: 4.1.5(bufferutil@4.1.0)(effect@4.1.5(patch_hash=14a7acd734809d8dddbf2c19c4ec01fdd2ffae60a612de42b5ed29860216052a))(redis@6.2.1)(utf-8-validate@6.0.6) + specifier: 4.1.6 + version: 4.1.6(bufferutil@4.1.0)(effect@4.1.6(patch_hash=c13237f64561426c002130285a9832acc5bb6ab42fd81e020b306429757ddda1))(redis@6.2.1)(utf-8-validate@6.0.6) '@t3tools/contracts': specifier: workspace:* version: link:../contracts @@ -2493,18 +2493,18 @@ importers: specifier: workspace:* version: link:../source-control-core effect: - specifier: 4.1.5 - version: 4.1.5(patch_hash=14a7acd734809d8dddbf2c19c4ec01fdd2ffae60a612de42b5ed29860216052a) + specifier: 4.1.6 + version: 4.1.6(patch_hash=c13237f64561426c002130285a9832acc5bb6ab42fd81e020b306429757ddda1) yaml: specifier: ^2.9.0 version: 2.9.0 devDependencies: '@effect/graphql-generator': specifier: 'catalog:' - version: 4.1.5(@effect/platform-node@4.1.5(bufferutil@4.1.0)(effect@4.1.5(patch_hash=14a7acd734809d8dddbf2c19c4ec01fdd2ffae60a612de42b5ed29860216052a))(redis@6.2.1)(utf-8-validate@6.0.6))(effect@4.1.5(patch_hash=14a7acd734809d8dddbf2c19c4ec01fdd2ffae60a612de42b5ed29860216052a)) + version: 4.1.6(@effect/platform-node@4.1.6(bufferutil@4.1.0)(effect@4.1.6(patch_hash=c13237f64561426c002130285a9832acc5bb6ab42fd81e020b306429757ddda1))(redis@6.2.1)(utf-8-validate@6.0.6))(effect@4.1.6(patch_hash=c13237f64561426c002130285a9832acc5bb6ab42fd81e020b306429757ddda1)) '@effect/vitest': - specifier: 4.1.5 - version: 4.1.5(patch_hash=dd0bf2b1ae0f63aff0d620ebc67b82d19759b3fa69a608ef85e2a5b40b4d46c5)(@astrojs/compiler-rs@0.5.1)(@types/node@24.12.4)(@vitest/browser-playwright@5.1.1)(@vitest/ui@5.1.1)(@volar/typescript@2.4.28(typescript@6.0.3))(bufferutil@4.1.0)(effect@4.1.5(patch_hash=14a7acd734809d8dddbf2c19c4ec01fdd2ffae60a612de42b5ed29860216052a))(esbuild@0.28.2)(jiti@2.7.0)(jsdom@30.1.0(@noble/hashes@1.8.0))(playwright@1.64.1)(terser@5.48.0)(typescript@6.0.3)(unrun@0.2.39)(utf-8-validate@6.0.6)(yaml@2.9.0) + specifier: 4.1.6 + version: 4.1.6(patch_hash=f87ba071dd4f5cfa3b1ba14d5d59363e64372cd49af4d8282c322939e6bf3af2)(@astrojs/compiler-rs@0.5.1)(@types/node@24.12.4)(@vitest/browser-playwright@5.1.1)(@vitest/ui@5.1.1)(@volar/typescript@2.4.28(typescript@6.0.3))(bufferutil@4.1.0)(effect@4.1.6(patch_hash=c13237f64561426c002130285a9832acc5bb6ab42fd81e020b306429757ddda1))(esbuild@0.28.2)(jiti@2.7.0)(jsdom@30.1.0(@noble/hashes@1.8.0))(playwright@1.64.1)(terser@5.48.0)(typescript@6.0.3)(unrun@0.2.39)(utf-8-validate@6.0.6)(yaml@2.9.0) '@t3tools/source-control-testing': specifier: workspace:* version: link:../source-control-testing @@ -2527,15 +2527,15 @@ importers: specifier: workspace:* version: link:../source-control-core effect: - specifier: 4.1.5 - version: 4.1.5(patch_hash=14a7acd734809d8dddbf2c19c4ec01fdd2ffae60a612de42b5ed29860216052a) + specifier: 4.1.6 + version: 4.1.6(patch_hash=c13237f64561426c002130285a9832acc5bb6ab42fd81e020b306429757ddda1) devDependencies: '@effect/platform-node': - specifier: 4.1.5 - version: 4.1.5(bufferutil@4.1.0)(effect@4.1.5(patch_hash=14a7acd734809d8dddbf2c19c4ec01fdd2ffae60a612de42b5ed29860216052a))(redis@6.2.1)(utf-8-validate@6.0.6) + specifier: 4.1.6 + version: 4.1.6(bufferutil@4.1.0)(effect@4.1.6(patch_hash=c13237f64561426c002130285a9832acc5bb6ab42fd81e020b306429757ddda1))(redis@6.2.1)(utf-8-validate@6.0.6) '@effect/vitest': - specifier: 4.1.5 - version: 4.1.5(patch_hash=dd0bf2b1ae0f63aff0d620ebc67b82d19759b3fa69a608ef85e2a5b40b4d46c5)(@astrojs/compiler-rs@0.5.1)(@types/node@24.12.4)(@vitest/browser-playwright@5.1.1)(@vitest/ui@5.1.1)(@volar/typescript@2.4.28(typescript@6.0.3))(bufferutil@4.1.0)(effect@4.1.5(patch_hash=14a7acd734809d8dddbf2c19c4ec01fdd2ffae60a612de42b5ed29860216052a))(esbuild@0.28.2)(jiti@2.7.0)(jsdom@30.1.0(@noble/hashes@1.8.0))(playwright@1.64.1)(terser@5.48.0)(typescript@6.0.3)(unrun@0.2.39)(utf-8-validate@6.0.6)(yaml@2.9.0) + specifier: 4.1.6 + version: 4.1.6(patch_hash=f87ba071dd4f5cfa3b1ba14d5d59363e64372cd49af4d8282c322939e6bf3af2)(@astrojs/compiler-rs@0.5.1)(@types/node@24.12.4)(@vitest/browser-playwright@5.1.1)(@vitest/ui@5.1.1)(@volar/typescript@2.4.28(typescript@6.0.3))(bufferutil@4.1.0)(effect@4.1.6(patch_hash=c13237f64561426c002130285a9832acc5bb6ab42fd81e020b306429757ddda1))(esbuild@0.28.2)(jiti@2.7.0)(jsdom@30.1.0(@noble/hashes@1.8.0))(playwright@1.64.1)(terser@5.48.0)(typescript@6.0.3)(unrun@0.2.39)(utf-8-validate@6.0.6)(yaml@2.9.0) '@t3tools/source-control-testing': specifier: workspace:* version: link:../source-control-testing @@ -2558,12 +2558,12 @@ importers: specifier: workspace:* version: link:../source-control-core effect: - specifier: 4.1.5 - version: 4.1.5(patch_hash=14a7acd734809d8dddbf2c19c4ec01fdd2ffae60a612de42b5ed29860216052a) + specifier: 4.1.6 + version: 4.1.6(patch_hash=c13237f64561426c002130285a9832acc5bb6ab42fd81e020b306429757ddda1) devDependencies: '@effect/vitest': - specifier: 4.1.5 - version: 4.1.5(patch_hash=dd0bf2b1ae0f63aff0d620ebc67b82d19759b3fa69a608ef85e2a5b40b4d46c5)(@astrojs/compiler-rs@0.5.1)(@types/node@24.12.4)(@vitest/browser-playwright@5.1.1)(@vitest/ui@5.1.1)(@volar/typescript@2.4.28(typescript@6.0.3))(bufferutil@4.1.0)(effect@4.1.5(patch_hash=14a7acd734809d8dddbf2c19c4ec01fdd2ffae60a612de42b5ed29860216052a))(esbuild@0.28.2)(jiti@2.7.0)(jsdom@30.1.0(@noble/hashes@1.8.0))(playwright@1.64.1)(terser@5.48.0)(typescript@6.0.3)(unrun@0.2.39)(utf-8-validate@6.0.6)(yaml@2.9.0) + specifier: 4.1.6 + version: 4.1.6(patch_hash=f87ba071dd4f5cfa3b1ba14d5d59363e64372cd49af4d8282c322939e6bf3af2)(@astrojs/compiler-rs@0.5.1)(@types/node@24.12.4)(@vitest/browser-playwright@5.1.1)(@vitest/ui@5.1.1)(@volar/typescript@2.4.28(typescript@6.0.3))(bufferutil@4.1.0)(effect@4.1.6(patch_hash=c13237f64561426c002130285a9832acc5bb6ab42fd81e020b306429757ddda1))(esbuild@0.28.2)(jiti@2.7.0)(jsdom@30.1.0(@noble/hashes@1.8.0))(playwright@1.64.1)(terser@5.48.0)(typescript@6.0.3)(unrun@0.2.39)(utf-8-validate@6.0.6)(yaml@2.9.0) '@t3tools/source-control-testing': specifier: workspace:* version: link:../source-control-testing @@ -2577,8 +2577,8 @@ importers: packages/source-control-testing: dependencies: '@effect/platform-node': - specifier: 4.1.5 - version: 4.1.5(bufferutil@4.1.0)(effect@4.1.5(patch_hash=14a7acd734809d8dddbf2c19c4ec01fdd2ffae60a612de42b5ed29860216052a))(redis@6.2.1)(utf-8-validate@6.0.6) + specifier: 4.1.6 + version: 4.1.6(bufferutil@4.1.0)(effect@4.1.6(patch_hash=c13237f64561426c002130285a9832acc5bb6ab42fd81e020b306429757ddda1))(redis@6.2.1)(utf-8-validate@6.0.6) '@t3tools/contracts': specifier: workspace:* version: link:../contracts @@ -2589,8 +2589,8 @@ importers: specifier: workspace:* version: link:../source-control-core effect: - specifier: 4.1.5 - version: 4.1.5(patch_hash=14a7acd734809d8dddbf2c19c4ec01fdd2ffae60a612de42b5ed29860216052a) + specifier: 4.1.6 + version: 4.1.6(patch_hash=c13237f64561426c002130285a9832acc5bb6ab42fd81e020b306429757ddda1) devDependencies: '@types/node': specifier: 24.12.4 @@ -2605,15 +2605,15 @@ importers: specifier: workspace:* version: link:../shared effect: - specifier: 4.1.5 - version: 4.1.5(patch_hash=14a7acd734809d8dddbf2c19c4ec01fdd2ffae60a612de42b5ed29860216052a) + specifier: 4.1.6 + version: 4.1.6(patch_hash=c13237f64561426c002130285a9832acc5bb6ab42fd81e020b306429757ddda1) devDependencies: '@effect/platform-node': - specifier: 4.1.5 - version: 4.1.5(bufferutil@4.1.0)(effect@4.1.5(patch_hash=14a7acd734809d8dddbf2c19c4ec01fdd2ffae60a612de42b5ed29860216052a))(redis@6.2.1)(utf-8-validate@6.0.6) + specifier: 4.1.6 + version: 4.1.6(bufferutil@4.1.0)(effect@4.1.6(patch_hash=c13237f64561426c002130285a9832acc5bb6ab42fd81e020b306429757ddda1))(redis@6.2.1)(utf-8-validate@6.0.6) '@effect/vitest': - specifier: 4.1.5 - version: 4.1.5(patch_hash=dd0bf2b1ae0f63aff0d620ebc67b82d19759b3fa69a608ef85e2a5b40b4d46c5)(@astrojs/compiler-rs@0.5.1)(@types/node@24.12.4)(@vitest/browser-playwright@5.1.1)(@vitest/ui@5.1.1)(@volar/typescript@2.4.28(typescript@6.0.3))(bufferutil@4.1.0)(effect@4.1.5(patch_hash=14a7acd734809d8dddbf2c19c4ec01fdd2ffae60a612de42b5ed29860216052a))(esbuild@0.28.2)(jiti@2.7.0)(jsdom@30.1.0(@noble/hashes@1.8.0))(playwright@1.64.1)(terser@5.48.0)(typescript@6.0.3)(unrun@0.2.39)(utf-8-validate@6.0.6)(yaml@2.9.0) + specifier: 4.1.6 + version: 4.1.6(patch_hash=f87ba071dd4f5cfa3b1ba14d5d59363e64372cd49af4d8282c322939e6bf3af2)(@astrojs/compiler-rs@0.5.1)(@types/node@24.12.4)(@vitest/browser-playwright@5.1.1)(@vitest/ui@5.1.1)(@volar/typescript@2.4.28(typescript@6.0.3))(bufferutil@4.1.0)(effect@4.1.6(patch_hash=c13237f64561426c002130285a9832acc5bb6ab42fd81e020b306429757ddda1))(esbuild@0.28.2)(jiti@2.7.0)(jsdom@30.1.0(@noble/hashes@1.8.0))(playwright@1.64.1)(terser@5.48.0)(typescript@6.0.3)(unrun@0.2.39)(utf-8-validate@6.0.6)(yaml@2.9.0) '@types/node': specifier: 24.12.4 version: 24.12.4 @@ -2630,12 +2630,12 @@ importers: specifier: workspace:* version: link:../shared effect: - specifier: 4.1.5 - version: 4.1.5(patch_hash=14a7acd734809d8dddbf2c19c4ec01fdd2ffae60a612de42b5ed29860216052a) + specifier: 4.1.6 + version: 4.1.6(patch_hash=c13237f64561426c002130285a9832acc5bb6ab42fd81e020b306429757ddda1) devDependencies: '@effect/vitest': - specifier: 4.1.5 - version: 4.1.5(patch_hash=dd0bf2b1ae0f63aff0d620ebc67b82d19759b3fa69a608ef85e2a5b40b4d46c5)(@astrojs/compiler-rs@0.5.1)(@types/node@24.12.4)(@vitest/browser-playwright@5.1.1)(@vitest/ui@5.1.1)(@volar/typescript@2.4.28(typescript@6.0.3))(bufferutil@4.1.0)(effect@4.1.5(patch_hash=14a7acd734809d8dddbf2c19c4ec01fdd2ffae60a612de42b5ed29860216052a))(esbuild@0.28.2)(jiti@2.7.0)(jsdom@30.1.0(@noble/hashes@1.8.0))(playwright@1.64.1)(terser@5.48.0)(typescript@6.0.3)(unrun@0.2.39)(utf-8-validate@6.0.6)(yaml@2.9.0) + specifier: 4.1.6 + version: 4.1.6(patch_hash=f87ba071dd4f5cfa3b1ba14d5d59363e64372cd49af4d8282c322939e6bf3af2)(@astrojs/compiler-rs@0.5.1)(@types/node@24.12.4)(@vitest/browser-playwright@5.1.1)(@vitest/ui@5.1.1)(@volar/typescript@2.4.28(typescript@6.0.3))(bufferutil@4.1.0)(effect@4.1.6(patch_hash=c13237f64561426c002130285a9832acc5bb6ab42fd81e020b306429757ddda1))(esbuild@0.28.2)(jiti@2.7.0)(jsdom@30.1.0(@noble/hashes@1.8.0))(playwright@1.64.1)(terser@5.48.0)(typescript@6.0.3)(unrun@0.2.39)(utf-8-validate@6.0.6)(yaml@2.9.0) '@types/node': specifier: 24.12.4 version: 24.12.4 @@ -2652,8 +2652,8 @@ importers: specifier: 0.15.5 version: 0.15.5(e2e@0.24.0) '@effect/platform-node': - specifier: 4.1.5 - version: 4.1.5(bufferutil@4.1.0)(effect@4.1.5(patch_hash=14a7acd734809d8dddbf2c19c4ec01fdd2ffae60a612de42b5ed29860216052a))(redis@6.2.1)(utf-8-validate@6.0.6) + specifier: 4.1.6 + version: 4.1.6(bufferutil@4.1.0)(effect@4.1.6(patch_hash=c13237f64561426c002130285a9832acc5bb6ab42fd81e020b306429757ddda1))(redis@6.2.1)(utf-8-validate@6.0.6) '@electron/asar': specifier: ^4.3.0 version: 4.3.0 @@ -2679,8 +2679,8 @@ importers: specifier: 0.24.0 version: 0.24.0 effect: - specifier: 4.1.5 - version: 4.1.5(patch_hash=14a7acd734809d8dddbf2c19c4ec01fdd2ffae60a612de42b5ed29860216052a) + specifier: 4.1.6 + version: 4.1.6(patch_hash=c13237f64561426c002130285a9832acc5bb6ab42fd81e020b306429757ddda1) playwright-core: specifier: 1.64.1 version: 1.64.1 @@ -2695,8 +2695,8 @@ importers: version: 0.35.5(@types/node@24.12.4) devDependencies: '@effect/vitest': - specifier: 4.1.5 - version: 4.1.5(patch_hash=dd0bf2b1ae0f63aff0d620ebc67b82d19759b3fa69a608ef85e2a5b40b4d46c5)(@astrojs/compiler-rs@0.5.1)(@types/node@24.12.4)(@vitest/browser-playwright@5.1.1)(@vitest/ui@5.1.1)(@volar/typescript@2.4.28(typescript@6.0.3))(bufferutil@4.1.0)(effect@4.1.5(patch_hash=14a7acd734809d8dddbf2c19c4ec01fdd2ffae60a612de42b5ed29860216052a))(esbuild@0.28.2)(jiti@2.7.0)(jsdom@30.1.0(@noble/hashes@1.8.0))(playwright@1.64.1)(terser@5.48.0)(typescript@6.0.3)(unrun@0.2.39)(utf-8-validate@6.0.6)(yaml@2.9.0) + specifier: 4.1.6 + version: 4.1.6(patch_hash=f87ba071dd4f5cfa3b1ba14d5d59363e64372cd49af4d8282c322939e6bf3af2)(@astrojs/compiler-rs@0.5.1)(@types/node@24.12.4)(@vitest/browser-playwright@5.1.1)(@vitest/ui@5.1.1)(@volar/typescript@2.4.28(typescript@6.0.3))(bufferutil@4.1.0)(effect@4.1.6(patch_hash=c13237f64561426c002130285a9832acc5bb6ab42fd81e020b306429757ddda1))(esbuild@0.28.2)(jiti@2.7.0)(jsdom@30.1.0(@noble/hashes@1.8.0))(playwright@1.64.1)(terser@5.48.0)(typescript@6.0.3)(unrun@0.2.39)(utf-8-validate@6.0.6)(yaml@2.9.0) '@types/plist': specifier: 'catalog:' version: 3.0.5 @@ -2738,21 +2738,21 @@ packages: resolution: {integrity: sha512-hOV18VHG6ivrbPnk35hoqlCQPc6bR8b9soGmHlSkbnPIgVZUg7jpliF9AztSSJbJK4GHcBFc9hWetwCRHzGYAg==} peerDependencies: alchemy: 2.0.0-beta.85 - effect: 4.1.5 + effect: 4.1.6 '@alchemy.run/axiom@2.0.0-beta.85': resolution: {integrity: sha512-dpBBDxZaRlRIiszRYTUB9M3e3yN6hvkyYTpc0E66tJfcESY6rwp2O2fl38Mun5iLEyGJb2Gvv4HqPiURYWzrHw==} peerDependencies: alchemy: 2.0.0-beta.85 - effect: 4.1.5 + effect: 4.1.6 '@alchemy.run/cloudflare-runtime@2.0.0-beta.85': resolution: {integrity: sha512-OyGH/j5R9QaUdMjvm3y6pIUpMa7T9SvVYvlVd+fWo/eltOf+k/KQxC12QHC2fe22GVs3apL28l9f4VUH8N9aEA==} peerDependencies: '@distilled.cloud/cloudflare': 1.0.0-rc.18 - '@effect/platform-bun': 4.1.5 - '@effect/platform-node': 4.1.5 - effect: 4.1.5 + '@effect/platform-bun': 4.1.6 + '@effect/platform-node': 4.1.6 + effect: 4.1.6 rolldown: 1.2.13 vite: ^7.0.0 || ^8.0.0 peerDependenciesMeta: @@ -2770,10 +2770,10 @@ packages: peerDependencies: '@alchemy.run/domain': 2.0.0-beta.85 '@alchemy.run/frontend-frameworks': 2.0.0-beta.85 - '@effect/platform-bun': 4.1.5 - '@effect/platform-node': 4.1.5 + '@effect/platform-bun': 4.1.6 + '@effect/platform-node': 4.1.6 alchemy: 2.0.0-beta.85 - effect: 4.1.5 + effect: 4.1.6 vite: ^7.0.0 || ^8.0.0 peerDependenciesMeta: '@alchemy.run/domain': @@ -2790,9 +2790,9 @@ packages: '@alchemy.run/docker@2.0.0-beta.85': resolution: {integrity: sha512-AhVdcCTu/paBdDUtGc2U4WEa8+gczkkf7oH7XEeIVjlQ+xX3hmYWlspdfejoJ9pb2JT4myfvp5EeXi/Jcp+W2g==} peerDependencies: - '@effect/platform-bun': 4.1.5 + '@effect/platform-bun': 4.1.6 alchemy: 2.0.0-beta.85 - effect: 4.1.5 + effect: 4.1.6 peerDependenciesMeta: '@effect/platform-bun': optional: true @@ -2803,11 +2803,11 @@ packages: '@alchemy.run/cloudflare': 2.0.0-beta.85 '@effect/sql-libsql': ^4.1.0 '@effect/sql-mysql2': ^4.1.0 - '@effect/sql-pg': 4.1.5 + '@effect/sql-pg': 4.1.6 alchemy: 2.0.0-beta.85 drizzle-kit: 1.0.0-rc.5 drizzle-orm: 1.0.0-rc.5 - effect: 4.1.5 + effect: 4.1.6 peerDependenciesMeta: '@alchemy.run/cloudflare': optional: true @@ -2827,7 +2827,7 @@ packages: resolution: {integrity: sha512-rBG26S6nGVF3fzCTnvMKu/Un/5H+YepOIJyld+1JeaAKV78z3U+bYtR+dSWR6KcW8tG8xX9pj83sisZdp0iNog==} peerDependencies: alchemy: 2.0.0-beta.85 - effect: 4.1.5 + effect: 4.1.6 mysql2: ^3.24.2 pg: ^8.22.0 peerDependenciesMeta: @@ -2853,9 +2853,9 @@ packages: peerDependencies: '@effect/sql-libsql': ^4.1.0 '@effect/sql-mysql2': ^4.1.0 - '@effect/sql-pg': 4.1.5 + '@effect/sql-pg': 4.1.6 alchemy: 2.0.0-beta.85 - effect: 4.1.5 + effect: 4.1.6 mysql2: ^3.24.2 pg: ^8.22.0 peerDependenciesMeta: @@ -2875,10 +2875,10 @@ packages: engines: {bun: '>=1.3'} hasBin: true peerDependencies: - '@effect/vitest': 4.1.5 + '@effect/vitest': 4.1.6 '@opentui/core': ^0.6.6 alchemy: 2.0.0-beta.85 - effect: 4.1.5 + effect: 4.1.6 vitest: ^5.0.4 peerDependenciesMeta: '@effect/vitest': @@ -3862,42 +3862,42 @@ packages: '@distilled.cloud/acme@1.0.0-rc.18': resolution: {integrity: sha512-OWO6NG9IcpDqZCzlrN5T4MIQqSbpZ5cw61Ru/dYn1vr3AIyx3Vlg+Ew8NhlunpURr4wqDUW2/7QW3fKbrmfwLg==} peerDependencies: - effect: 4.1.5 + effect: 4.1.6 '@distilled.cloud/aws4signer@1.0.0-rc.18': resolution: {integrity: sha512-eYJi2rsblwjxpa0kj2qUQYqY9cEwD6ow0njiFL6I5ZnlOqrE8I3aLiWvScoc3s9bQUQD5nFdmSnORoPJ5GsHKg==} peerDependencies: - effect: 4.1.5 + effect: 4.1.6 '@distilled.cloud/aws@1.0.0-rc.18': resolution: {integrity: sha512-VZDlOGEXvXvTdY/0sTEoTWnPCGde+fjvq1ZIW3wgiZK/X8ChbbonGArg+Sc9OO4E9tr1WBymASrZ906uLnLWFw==} peerDependencies: - effect: 4.1.5 + effect: 4.1.6 '@distilled.cloud/axiom@1.0.0-rc.18': resolution: {integrity: sha512-8z6PPKm3OlEI9ovuSgqnQBYrGU5Fg8LVrk/Xs85NBDH8kJ69ttdJ8vaSb6hILi9hHluefvYO7SJ1XTOXxH+vCw==} peerDependencies: - effect: 4.1.5 + effect: 4.1.6 '@distilled.cloud/cloudflare@1.0.0-rc.18': resolution: {integrity: sha512-UJB7pitkg7msm7BGTuAE8yYx4GzKdPLRtiOm3G3XHw07xLUlqEiEr4xpSf0CeziWzDygjI53FSkpC2qyVZr49g==} peerDependencies: - effect: 4.1.5 + effect: 4.1.6 '@distilled.cloud/core@1.0.0-rc.18': resolution: {integrity: sha512-Iui60+sNl1CwUu7NKGLuFf3VC4H9xYzfm0Fc8ZQvd87qwf1sDMB3EAWZrq/QFgrwzSY16z2mJ0PNHaBUnGet8A==} peerDependencies: - effect: 4.1.5 + effect: 4.1.6 '@distilled.cloud/iceberg@1.0.0-rc.18': resolution: {integrity: sha512-XjUJ/vEOylhIZbAm85O9H6YqXKWGfVROT5BE9BGA/RXvo0bLK2+sUcjC6BoN77a99lImJkrXJuvbHBhNebObEA==} peerDependencies: - effect: 4.1.5 + effect: 4.1.6 '@distilled.cloud/planetscale@1.0.0-rc.18': resolution: {integrity: sha512-GSpQVfwYq2QKjjQpjiMl4IUBgyS7doNX4mnIzIRzM44BMMtTwx0gMcBj7b7PVAA0O7MyKLKV134Ba1+w3u71kw==} peerDependencies: - effect: 4.1.5 + effect: 4.1.6 '@dnd-kit/accessibility@3.1.1': resolution: {integrity: sha512-2P+YgaXF+gRsIihwwY1gCsQSYnu9Zyj2py8kY5fFvUM1qm2WA2u639R6YNVfU4GWr+ZM5mqEsfHZZLoRONbemw==} @@ -3953,59 +3953,59 @@ packages: peerDependencies: e2e: '>=0.22.1 <1' - '@effect/atom-react@4.1.5': - resolution: {integrity: sha512-7bFJUOa4hatIE4LD4EmuOSS7+jNniZxaltX3TRExBCYAFqMd6vjZs9G/Ez3u24oUaJnkschmjfG3EwVzzebgig==} + '@effect/atom-react@4.1.6': + resolution: {integrity: sha512-Df4DXCrI6T7im/iObhLtZAvVCvXmXApjh/Xj+iVeRlIshUdzDrAgPpJgpa0m8Ti7sf5vO2cj2LDcxdQCx/wl9A==} peerDependencies: - effect: 4.1.5 + effect: 4.1.6 react: '>=19.0.0 <20.0.0' scheduler: '>=0.25.0 <0.29.0' - '@effect/graphql-generator@4.1.5': - resolution: {integrity: sha512-Re1ZD0VkEAICN/TK7Y30TkcBnYk3im9O1iUpfnlvlWS9y4Vl/9C2Du/O5NGanXPpm75MuPitOUu/eCN1nTvRBg==} + '@effect/graphql-generator@4.1.6': + resolution: {integrity: sha512-SG+Vj2C6i/X/eZQBaf/OpA8SILduu5TKo5Lioi+/miaaXznrRJ3aR2xJ9Aj19HLqvLjcv9q0Uxm6foLgIoxbbg==} hasBin: true peerDependencies: - '@effect/platform-node': 4.1.5 - effect: 4.1.5 + '@effect/platform-node': 4.1.6 + effect: 4.1.6 - '@effect/openapi-generator@4.1.5': - resolution: {integrity: sha512-tovGv6oLMX31PsDgGdibh8b/CVVpFCg9Y7zJ84gPMD6u8xS0dSjfwIQiQgbPJiDg5aDKA2aas5h3/pS7KfDhFQ==} + '@effect/openapi-generator@4.1.6': + resolution: {integrity: sha512-7S0Ik8FyuP36+7idsytZbEeUgPzpkX9TwqNULqFlXvPtsPqoaWEev2/YygbnBaCGXRX5zxe1iL4vORTKB4iL9w==} hasBin: true peerDependencies: - '@effect/platform-node': 4.1.5 - effect: 4.1.5 + '@effect/platform-node': 4.1.6 + effect: 4.1.6 - '@effect/platform-bun@4.1.5': - resolution: {integrity: sha512-VzUugWhIKQSWp/xtFrYIrCISDcUXWrCFfxSkqg8ul0DZgo23WRqfz+38Y3mJ2NenUv5kUj14FnjLohm2t8ZGCw==} + '@effect/platform-bun@4.1.6': + resolution: {integrity: sha512-5CINIx/JuIO/VTXbfFtKV+eCzEwXGPcUJD1nnuTQDxx7oYHPcc+g3gJylBt1oKxXrAqhwR3Gxq4oTs4n21OCRQ==} peerDependencies: - effect: 4.1.5 + effect: 4.1.6 - '@effect/platform-node-shared@4.1.5': - resolution: {integrity: sha512-JzlrYe4uKaBFTWihBRXo2pDjkUVB39kQpKdGfXdbp7Co5sKT8hbcjOmdB5pg/WOYESdGTddd3fxD4lwlZELbZQ==} + '@effect/platform-node-shared@4.1.6': + resolution: {integrity: sha512-RWKHX5TEZet2KC/NlBu5prBkZT30m6h8YTSWfJM0wIw0BNMkfEzCuH6N5HOw8mUudclWp5z1XTzsZ7xg0h+6Qw==} engines: {node: '>=22.19.0'} peerDependencies: - effect: 4.1.5 + effect: 4.1.6 - '@effect/platform-node@4.1.5': - resolution: {integrity: sha512-tFnRvxF9EKc3oU17sDHj1JeLP+TL/IkaOEl3IUk2EjgMS0x7AWs0ioUXjdNKLb3Z1LdjVfMf/DxsNh9PW5FFAg==} + '@effect/platform-node@4.1.6': + resolution: {integrity: sha512-DNHzWIRARCCoK6Ez5MOqJ6H81e5FbQecH8GY41ftJGqATENUOVOLkT1iNgxBt6zPi36iF1EpraBen+MjKUqHpw==} engines: {node: '>=22.19.0'} peerDependencies: - effect: 4.1.5 + effect: 4.1.6 redis: '>=5.1.0 <7.0.0' '@effect/sql-d1@4.1.1': resolution: {integrity: sha512-CQMOiw9bmj4ifsUA4KLwIgBJBMpPHaF3OYdXnA9oOxeEmD61+XDLkJUSA2mG7BWCIEZc7MquGxl3HuUVOeqtSA==} peerDependencies: - effect: 4.1.5 + effect: 4.1.6 - '@effect/sql-pg@4.1.5': - resolution: {integrity: sha512-Fs/5EmXykN4vKzWES54aRSLts0jBiQn65Y2jnGq//IX8Qj2McB7+WGYwaGNwxXUq4mXvagGWZPNMO0GefwDpQw==} + '@effect/sql-pg@4.1.6': + resolution: {integrity: sha512-+mLjay2zQ73rQsD9uotTcbb6E/XRnWnCaP7MZvHtb7SRpHfkw9E5QzF6YPYVoTBvXpCUmuE42Oe0nXyLB/Iq4g==} peerDependencies: - effect: 4.1.5 + effect: 4.1.6 - '@effect/sql-sqlite-do@4.1.5': - resolution: {integrity: sha512-489bi5qSHj4g42Lrv4KeTI8faaOdjwuOx54xmbQxLisGkg50GAEXHbl6OD2cglsREAx2xj6YznFByvziFk7MBw==} + '@effect/sql-sqlite-do@4.1.6': + resolution: {integrity: sha512-nJ6UgXsKXb4ytcCzoSjei9nistYfVvKt+VmtBD/am8HCpDaZCUmEWFIKCl8f0jgDbJJgGr2KfSNdwXHbhnHPtA==} peerDependencies: - effect: 4.1.5 + effect: 4.1.6 '@effect/tsgo-darwin-arm64@0.67.1': resolution: {integrity: sha512-q10xwD2s+KvZEwbY5OHGSmfAp9Is4e/a7PS4NiUVnvGnPOCbjOMEbVrYjOImy5uawPAa1CVA+55qxCv4ctaw4g==} @@ -4046,10 +4046,10 @@ packages: resolution: {integrity: sha512-rQLQ3vAStYEPQX3+gCv4AM9ehhmJjWYwY9itqFKVs9NEtRQg6msKH6qo9VYebikDPUDiKOaJJwQAeRcYeybCug==} hasBin: true - '@effect/vitest@4.1.5': - resolution: {integrity: sha512-18u1013wkJtSelk1ZYLc/5aUnluTQyDfi2hAemkJW1GQ9qXw4mtPSiSf0AXZPhesmGCvG1Dk2C4JYD2sz+R72w==} + '@effect/vitest@4.1.6': + resolution: {integrity: sha512-Knb13gPhDbtOuNUnPXE/Sl+UvrKFHRATwU2vy+DGQCpjK1yI3oy1feQo1g2X8ZdOdc63sJB7HJXCMNsDy8xYvg==} peerDependencies: - effect: 4.1.5 + effect: 4.1.6 '@electric-sql/pglite@0.3.15': resolution: {integrity: sha512-Cj++n1Mekf9ETfdc16TlDi+cDDQF0W7EcbyRHYOAeZdsAe8M/FJg18itDTSwyHfar2WIezawM9o0EKaRGVKygQ==} @@ -5492,7 +5492,7 @@ packages: '@opencode/client@2.0.28': resolution: {integrity: sha512-YV0Yxk93/K2h4Xy/sEW/4ZYGMwn7ltxG2Y/Vdy2VCIZ2z0/r9MI6x5/XawSNfCvImBxuHkQNbYtu9Rgp3ArJ4g==} peerDependencies: - effect: 4.1.5 + effect: 4.1.6 solid-js: '>=1.9.0' peerDependenciesMeta: effect: @@ -8156,9 +8156,9 @@ packages: hasBin: true peerDependencies: '@alchemy.run/frontend-frameworks': 2.0.0-beta.85 - '@effect/platform-bun': 4.1.5 - '@effect/platform-node': 4.1.5 - effect: 4.1.5 + '@effect/platform-bun': 4.1.6 + '@effect/platform-node': 4.1.6 + effect: 4.1.6 vite: ^7.0.0 || ^8.0.0 ws: 8.22.0 peerDependenciesMeta: @@ -9010,7 +9010,7 @@ packages: '@effect/sql-d1': '>=4.0.0' '@effect/sql-libsql': '>=4.0.0' '@effect/sql-mysql2': '>=4.0.0' - '@effect/sql-pg': 4.1.5 + '@effect/sql-pg': 4.1.6 '@effect/sql-pglite': '>=4.0.0' '@effect/sql-sqlite-bun': '>=4.0.0' '@effect/sql-sqlite-do': '>=4.0.0' @@ -9041,7 +9041,7 @@ packages: arktype: '>=2.0.0' better-sqlite3: '>=9.3.0' bun-types: '*' - effect: 4.1.5 + effect: 4.1.6 expo-sqlite: '>=14.0.0' mssql: ^11.0.1 mysql2: '>=2' @@ -9196,8 +9196,8 @@ packages: ee-first@1.1.1: resolution: {integrity: sha512-WMwm9LhRUo+WUaRN+vRuETqG89IgZphVSNkdFgeb6sS/E4OrDIN7t48CAewSHXc6C8lefD8KKfr5vY61brQlow==} - effect@4.1.5: - resolution: {integrity: sha512-xyR20KhQI0vg2gD8ILUSQRTTESEYJ0JKdP+QD8J37xbwPTqXRxFM/l0+vUVD9fuSvoYruoTqyt33C4FZv1s4TQ==} + effect@4.1.6: + resolution: {integrity: sha512-P3CxMsdcSCle/7/FnPILd9GJkNqGtduKam2LX9Xsb8LoOjmeQ9Kmsuh16JwtIthaxLyiTCOzUUt+PZsXIohl+A==} ejs@3.1.10: resolution: {integrity: sha512-UeJmFfOrAQS8OJWPZ4qtgHyWExa088/MtK5UEyoJGFH67cDEXkZSviOiKRCZ4Xij0zxI3JECgYs3oKx+AizQBA==} @@ -13334,27 +13334,27 @@ snapshots: dependencies: json-schema: 0.4.0 - '@alchemy.run/acme@2.0.0-beta.85(alchemy@2.0.0-beta.85(patch_hash=07cc8c7e14b3b9af143ddd40a059f117c27e55139fbf20bd5dde2eb30509cedd)(@effect/platform-bun@4.1.5(bufferutil@4.1.0)(effect@4.1.5(patch_hash=14a7acd734809d8dddbf2c19c4ec01fdd2ffae60a612de42b5ed29860216052a))(utf-8-validate@6.0.6))(@effect/platform-node@4.1.5(bufferutil@4.1.0)(effect@4.1.5(patch_hash=14a7acd734809d8dddbf2c19c4ec01fdd2ffae60a612de42b5ed29860216052a))(redis@6.2.1)(utf-8-validate@6.0.6))(@types/react@19.3.0)(@voidzero-dev/vite-plus-core@8.3.8001(@types/node@24.12.4)(@volar/typescript@2.4.28(typescript@6.0.3))(esbuild@0.28.2)(jiti@2.7.0)(terser@5.48.0)(typescript@6.0.3)(unrun@0.2.39)(yaml@2.9.0))(effect@4.1.5(patch_hash=14a7acd734809d8dddbf2c19c4ec01fdd2ffae60a612de42b5ed29860216052a))(react-devtools-core@6.1.5(bufferutil@4.1.0)(utf-8-validate@6.0.6))(ws@8.22.0(bufferutil@4.1.0)(utf-8-validate@6.0.6)))(effect@4.1.5(patch_hash=14a7acd734809d8dddbf2c19c4ec01fdd2ffae60a612de42b5ed29860216052a))': + '@alchemy.run/acme@2.0.0-beta.85(alchemy@2.0.0-beta.85(patch_hash=07cc8c7e14b3b9af143ddd40a059f117c27e55139fbf20bd5dde2eb30509cedd)(@effect/platform-bun@4.1.6(bufferutil@4.1.0)(effect@4.1.6(patch_hash=c13237f64561426c002130285a9832acc5bb6ab42fd81e020b306429757ddda1))(utf-8-validate@6.0.6))(@effect/platform-node@4.1.6(bufferutil@4.1.0)(effect@4.1.6(patch_hash=c13237f64561426c002130285a9832acc5bb6ab42fd81e020b306429757ddda1))(redis@6.2.1)(utf-8-validate@6.0.6))(@types/react@19.3.0)(@voidzero-dev/vite-plus-core@8.3.8001(@types/node@24.12.4)(@volar/typescript@2.4.28(typescript@6.0.3))(esbuild@0.28.2)(jiti@2.7.0)(terser@5.48.0)(typescript@6.0.3)(unrun@0.2.39)(yaml@2.9.0))(effect@4.1.6(patch_hash=c13237f64561426c002130285a9832acc5bb6ab42fd81e020b306429757ddda1))(react-devtools-core@6.1.5(bufferutil@4.1.0)(utf-8-validate@6.0.6))(ws@8.22.0(bufferutil@4.1.0)(utf-8-validate@6.0.6)))(effect@4.1.6(patch_hash=c13237f64561426c002130285a9832acc5bb6ab42fd81e020b306429757ddda1))': dependencies: - '@distilled.cloud/acme': 1.0.0-rc.18(effect@4.1.5(patch_hash=14a7acd734809d8dddbf2c19c4ec01fdd2ffae60a612de42b5ed29860216052a)) - alchemy: 2.0.0-beta.85(patch_hash=07cc8c7e14b3b9af143ddd40a059f117c27e55139fbf20bd5dde2eb30509cedd)(@effect/platform-bun@4.1.5(bufferutil@4.1.0)(effect@4.1.5(patch_hash=14a7acd734809d8dddbf2c19c4ec01fdd2ffae60a612de42b5ed29860216052a))(utf-8-validate@6.0.6))(@effect/platform-node@4.1.5(bufferutil@4.1.0)(effect@4.1.5(patch_hash=14a7acd734809d8dddbf2c19c4ec01fdd2ffae60a612de42b5ed29860216052a))(redis@6.2.1)(utf-8-validate@6.0.6))(@types/react@19.3.0)(@voidzero-dev/vite-plus-core@8.3.8001(@types/node@24.12.4)(@volar/typescript@2.4.28(typescript@6.0.3))(esbuild@0.28.2)(jiti@2.7.0)(terser@5.48.0)(typescript@6.0.3)(unrun@0.2.39)(yaml@2.9.0))(effect@4.1.5(patch_hash=14a7acd734809d8dddbf2c19c4ec01fdd2ffae60a612de42b5ed29860216052a))(react-devtools-core@6.1.5(bufferutil@4.1.0)(utf-8-validate@6.0.6))(ws@8.22.0(bufferutil@4.1.0)(utf-8-validate@6.0.6)) - effect: 4.1.5(patch_hash=14a7acd734809d8dddbf2c19c4ec01fdd2ffae60a612de42b5ed29860216052a) + '@distilled.cloud/acme': 1.0.0-rc.18(effect@4.1.6(patch_hash=c13237f64561426c002130285a9832acc5bb6ab42fd81e020b306429757ddda1)) + alchemy: 2.0.0-beta.85(patch_hash=07cc8c7e14b3b9af143ddd40a059f117c27e55139fbf20bd5dde2eb30509cedd)(@effect/platform-bun@4.1.6(bufferutil@4.1.0)(effect@4.1.6(patch_hash=c13237f64561426c002130285a9832acc5bb6ab42fd81e020b306429757ddda1))(utf-8-validate@6.0.6))(@effect/platform-node@4.1.6(bufferutil@4.1.0)(effect@4.1.6(patch_hash=c13237f64561426c002130285a9832acc5bb6ab42fd81e020b306429757ddda1))(redis@6.2.1)(utf-8-validate@6.0.6))(@types/react@19.3.0)(@voidzero-dev/vite-plus-core@8.3.8001(@types/node@24.12.4)(@volar/typescript@2.4.28(typescript@6.0.3))(esbuild@0.28.2)(jiti@2.7.0)(terser@5.48.0)(typescript@6.0.3)(unrun@0.2.39)(yaml@2.9.0))(effect@4.1.6(patch_hash=c13237f64561426c002130285a9832acc5bb6ab42fd81e020b306429757ddda1))(react-devtools-core@6.1.5(bufferutil@4.1.0)(utf-8-validate@6.0.6))(ws@8.22.0(bufferutil@4.1.0)(utf-8-validate@6.0.6)) + effect: 4.1.6(patch_hash=c13237f64561426c002130285a9832acc5bb6ab42fd81e020b306429757ddda1) - '@alchemy.run/axiom@2.0.0-beta.85(alchemy@2.0.0-beta.85(patch_hash=07cc8c7e14b3b9af143ddd40a059f117c27e55139fbf20bd5dde2eb30509cedd)(@effect/platform-bun@4.1.5(bufferutil@4.1.0)(effect@4.1.5(patch_hash=14a7acd734809d8dddbf2c19c4ec01fdd2ffae60a612de42b5ed29860216052a))(utf-8-validate@6.0.6))(@effect/platform-node@4.1.5(bufferutil@4.1.0)(effect@4.1.5(patch_hash=14a7acd734809d8dddbf2c19c4ec01fdd2ffae60a612de42b5ed29860216052a))(redis@6.2.1)(utf-8-validate@6.0.6))(@types/react@19.3.0)(@voidzero-dev/vite-plus-core@8.3.8001(@types/node@24.12.4)(@volar/typescript@2.4.28(typescript@6.0.3))(esbuild@0.28.2)(jiti@2.7.0)(terser@5.48.0)(typescript@6.0.3)(unrun@0.2.39)(yaml@2.9.0))(effect@4.1.5(patch_hash=14a7acd734809d8dddbf2c19c4ec01fdd2ffae60a612de42b5ed29860216052a))(react-devtools-core@6.1.5(bufferutil@4.1.0)(utf-8-validate@6.0.6))(ws@8.22.0(bufferutil@4.1.0)(utf-8-validate@6.0.6)))(effect@4.1.5(patch_hash=14a7acd734809d8dddbf2c19c4ec01fdd2ffae60a612de42b5ed29860216052a))': + '@alchemy.run/axiom@2.0.0-beta.85(alchemy@2.0.0-beta.85(patch_hash=07cc8c7e14b3b9af143ddd40a059f117c27e55139fbf20bd5dde2eb30509cedd)(@effect/platform-bun@4.1.6(bufferutil@4.1.0)(effect@4.1.6(patch_hash=c13237f64561426c002130285a9832acc5bb6ab42fd81e020b306429757ddda1))(utf-8-validate@6.0.6))(@effect/platform-node@4.1.6(bufferutil@4.1.0)(effect@4.1.6(patch_hash=c13237f64561426c002130285a9832acc5bb6ab42fd81e020b306429757ddda1))(redis@6.2.1)(utf-8-validate@6.0.6))(@types/react@19.3.0)(@voidzero-dev/vite-plus-core@8.3.8001(@types/node@24.12.4)(@volar/typescript@2.4.28(typescript@6.0.3))(esbuild@0.28.2)(jiti@2.7.0)(terser@5.48.0)(typescript@6.0.3)(unrun@0.2.39)(yaml@2.9.0))(effect@4.1.6(patch_hash=c13237f64561426c002130285a9832acc5bb6ab42fd81e020b306429757ddda1))(react-devtools-core@6.1.5(bufferutil@4.1.0)(utf-8-validate@6.0.6))(ws@8.22.0(bufferutil@4.1.0)(utf-8-validate@6.0.6)))(effect@4.1.6(patch_hash=c13237f64561426c002130285a9832acc5bb6ab42fd81e020b306429757ddda1))': dependencies: - '@distilled.cloud/axiom': 1.0.0-rc.18(effect@4.1.5(patch_hash=14a7acd734809d8dddbf2c19c4ec01fdd2ffae60a612de42b5ed29860216052a)) - '@distilled.cloud/core': 1.0.0-rc.18(effect@4.1.5(patch_hash=14a7acd734809d8dddbf2c19c4ec01fdd2ffae60a612de42b5ed29860216052a)) - alchemy: 2.0.0-beta.85(patch_hash=07cc8c7e14b3b9af143ddd40a059f117c27e55139fbf20bd5dde2eb30509cedd)(@effect/platform-bun@4.1.5(bufferutil@4.1.0)(effect@4.1.5(patch_hash=14a7acd734809d8dddbf2c19c4ec01fdd2ffae60a612de42b5ed29860216052a))(utf-8-validate@6.0.6))(@effect/platform-node@4.1.5(bufferutil@4.1.0)(effect@4.1.5(patch_hash=14a7acd734809d8dddbf2c19c4ec01fdd2ffae60a612de42b5ed29860216052a))(redis@6.2.1)(utf-8-validate@6.0.6))(@types/react@19.3.0)(@voidzero-dev/vite-plus-core@8.3.8001(@types/node@24.12.4)(@volar/typescript@2.4.28(typescript@6.0.3))(esbuild@0.28.2)(jiti@2.7.0)(terser@5.48.0)(typescript@6.0.3)(unrun@0.2.39)(yaml@2.9.0))(effect@4.1.5(patch_hash=14a7acd734809d8dddbf2c19c4ec01fdd2ffae60a612de42b5ed29860216052a))(react-devtools-core@6.1.5(bufferutil@4.1.0)(utf-8-validate@6.0.6))(ws@8.22.0(bufferutil@4.1.0)(utf-8-validate@6.0.6)) - effect: 4.1.5(patch_hash=14a7acd734809d8dddbf2c19c4ec01fdd2ffae60a612de42b5ed29860216052a) + '@distilled.cloud/axiom': 1.0.0-rc.18(effect@4.1.6(patch_hash=c13237f64561426c002130285a9832acc5bb6ab42fd81e020b306429757ddda1)) + '@distilled.cloud/core': 1.0.0-rc.18(effect@4.1.6(patch_hash=c13237f64561426c002130285a9832acc5bb6ab42fd81e020b306429757ddda1)) + alchemy: 2.0.0-beta.85(patch_hash=07cc8c7e14b3b9af143ddd40a059f117c27e55139fbf20bd5dde2eb30509cedd)(@effect/platform-bun@4.1.6(bufferutil@4.1.0)(effect@4.1.6(patch_hash=c13237f64561426c002130285a9832acc5bb6ab42fd81e020b306429757ddda1))(utf-8-validate@6.0.6))(@effect/platform-node@4.1.6(bufferutil@4.1.0)(effect@4.1.6(patch_hash=c13237f64561426c002130285a9832acc5bb6ab42fd81e020b306429757ddda1))(redis@6.2.1)(utf-8-validate@6.0.6))(@types/react@19.3.0)(@voidzero-dev/vite-plus-core@8.3.8001(@types/node@24.12.4)(@volar/typescript@2.4.28(typescript@6.0.3))(esbuild@0.28.2)(jiti@2.7.0)(terser@5.48.0)(typescript@6.0.3)(unrun@0.2.39)(yaml@2.9.0))(effect@4.1.6(patch_hash=c13237f64561426c002130285a9832acc5bb6ab42fd81e020b306429757ddda1))(react-devtools-core@6.1.5(bufferutil@4.1.0)(utf-8-validate@6.0.6))(ws@8.22.0(bufferutil@4.1.0)(utf-8-validate@6.0.6)) + effect: 4.1.6(patch_hash=c13237f64561426c002130285a9832acc5bb6ab42fd81e020b306429757ddda1) - '@alchemy.run/cloudflare-runtime@2.0.0-beta.85(@distilled.cloud/cloudflare@1.0.0-rc.18(effect@4.1.5(patch_hash=14a7acd734809d8dddbf2c19c4ec01fdd2ffae60a612de42b5ed29860216052a)))(@effect/platform-bun@4.1.5(bufferutil@4.1.0)(effect@4.1.5(patch_hash=14a7acd734809d8dddbf2c19c4ec01fdd2ffae60a612de42b5ed29860216052a))(utf-8-validate@6.0.6))(@effect/platform-node@4.1.5(bufferutil@4.1.0)(effect@4.1.5(patch_hash=14a7acd734809d8dddbf2c19c4ec01fdd2ffae60a612de42b5ed29860216052a))(redis@6.2.1)(utf-8-validate@6.0.6))(@types/node@24.12.4)(@voidzero-dev/vite-plus-core@8.3.8001(@types/node@24.12.4)(@volar/typescript@2.4.28(typescript@6.0.3))(esbuild@0.28.2)(jiti@2.7.0)(terser@5.48.0)(typescript@6.0.3)(unrun@0.2.39)(yaml@2.9.0))(effect@4.1.5(patch_hash=14a7acd734809d8dddbf2c19c4ec01fdd2ffae60a612de42b5ed29860216052a))(rolldown@1.2.13)(typescript@6.0.3)': + '@alchemy.run/cloudflare-runtime@2.0.0-beta.85(@distilled.cloud/cloudflare@1.0.0-rc.18(effect@4.1.6(patch_hash=c13237f64561426c002130285a9832acc5bb6ab42fd81e020b306429757ddda1)))(@effect/platform-bun@4.1.6(bufferutil@4.1.0)(effect@4.1.6(patch_hash=c13237f64561426c002130285a9832acc5bb6ab42fd81e020b306429757ddda1))(utf-8-validate@6.0.6))(@effect/platform-node@4.1.6(bufferutil@4.1.0)(effect@4.1.6(patch_hash=c13237f64561426c002130285a9832acc5bb6ab42fd81e020b306429757ddda1))(redis@6.2.1)(utf-8-validate@6.0.6))(@types/node@24.12.4)(@voidzero-dev/vite-plus-core@8.3.8001(@types/node@24.12.4)(@volar/typescript@2.4.28(typescript@6.0.3))(esbuild@0.28.2)(jiti@2.7.0)(terser@5.48.0)(typescript@6.0.3)(unrun@0.2.39)(yaml@2.9.0))(effect@4.1.6(patch_hash=c13237f64561426c002130285a9832acc5bb6ab42fd81e020b306429757ddda1))(rolldown@1.2.13)(typescript@6.0.3)': dependencies: '@alchemy.run/node-utils': 2.0.0-beta.85 '@cloudflare/unenv-preset': 2.16.2(unenv@2.0.0-rc.24)(workerd@1.20261026.1) - '@distilled.cloud/cloudflare': 1.0.0-rc.18(effect@4.1.5(patch_hash=14a7acd734809d8dddbf2c19c4ec01fdd2ffae60a612de42b5ed29860216052a)) + '@distilled.cloud/cloudflare': 1.0.0-rc.18(effect@4.1.6(patch_hash=c13237f64561426c002130285a9832acc5bb6ab42fd81e020b306429757ddda1)) '@puppeteer/browsers': 3.2.6(yauzl@3.4.0) capnp-es: 0.0.16(typescript@6.0.3) - effect: 4.1.5(patch_hash=14a7acd734809d8dddbf2c19c4ec01fdd2ffae60a612de42b5ed29860216052a) + effect: 4.1.6(patch_hash=c13237f64561426c002130285a9832acc5bb6ab42fd81e020b306429757ddda1) magic-string: 0.30.21 mime: 4.1.1 sharp: 0.35.5(@types/node@24.12.4) @@ -13362,8 +13362,8 @@ snapshots: workerd: 1.20261026.1 yauzl: 3.4.0 optionalDependencies: - '@effect/platform-bun': 4.1.5(bufferutil@4.1.0)(effect@4.1.5(patch_hash=14a7acd734809d8dddbf2c19c4ec01fdd2ffae60a612de42b5ed29860216052a))(utf-8-validate@6.0.6) - '@effect/platform-node': 4.1.5(bufferutil@4.1.0)(effect@4.1.5(patch_hash=14a7acd734809d8dddbf2c19c4ec01fdd2ffae60a612de42b5ed29860216052a))(redis@6.2.1)(utf-8-validate@6.0.6) + '@effect/platform-bun': 4.1.6(bufferutil@4.1.0)(effect@4.1.6(patch_hash=c13237f64561426c002130285a9832acc5bb6ab42fd81e020b306429757ddda1))(utf-8-validate@6.0.6) + '@effect/platform-node': 4.1.6(bufferutil@4.1.0)(effect@4.1.6(patch_hash=c13237f64561426c002130285a9832acc5bb6ab42fd81e020b306429757ddda1))(redis@6.2.1)(utf-8-validate@6.0.6) rolldown: 1.2.13 vite: '@voidzero-dev/vite-plus-core@8.3.8001(@types/node@24.12.4)(@volar/typescript@2.4.28(typescript@6.0.3))(esbuild@0.28.2)(jiti@2.7.0)(terser@5.48.0)(typescript@6.0.3)(unrun@0.2.39)(yaml@2.9.0)' transitivePeerDependencies: @@ -13371,27 +13371,27 @@ snapshots: - proxy-agent - typescript - '@alchemy.run/cloudflare@2.0.0-beta.85(51317535f95f3dfb59110e0111bc835c)': - dependencies: - '@alchemy.run/acme': 2.0.0-beta.85(alchemy@2.0.0-beta.85(patch_hash=07cc8c7e14b3b9af143ddd40a059f117c27e55139fbf20bd5dde2eb30509cedd)(@effect/platform-bun@4.1.5(bufferutil@4.1.0)(effect@4.1.5(patch_hash=14a7acd734809d8dddbf2c19c4ec01fdd2ffae60a612de42b5ed29860216052a))(utf-8-validate@6.0.6))(@effect/platform-node@4.1.5(bufferutil@4.1.0)(effect@4.1.5(patch_hash=14a7acd734809d8dddbf2c19c4ec01fdd2ffae60a612de42b5ed29860216052a))(redis@6.2.1)(utf-8-validate@6.0.6))(@types/react@19.3.0)(@voidzero-dev/vite-plus-core@8.3.8001(@types/node@24.12.4)(@volar/typescript@2.4.28(typescript@6.0.3))(esbuild@0.28.2)(jiti@2.7.0)(terser@5.48.0)(typescript@6.0.3)(unrun@0.2.39)(yaml@2.9.0))(effect@4.1.5(patch_hash=14a7acd734809d8dddbf2c19c4ec01fdd2ffae60a612de42b5ed29860216052a))(react-devtools-core@6.1.5(bufferutil@4.1.0)(utf-8-validate@6.0.6))(ws@8.22.0(bufferutil@4.1.0)(utf-8-validate@6.0.6)))(effect@4.1.5(patch_hash=14a7acd734809d8dddbf2c19c4ec01fdd2ffae60a612de42b5ed29860216052a)) - '@alchemy.run/cloudflare-runtime': 2.0.0-beta.85(@distilled.cloud/cloudflare@1.0.0-rc.18(effect@4.1.5(patch_hash=14a7acd734809d8dddbf2c19c4ec01fdd2ffae60a612de42b5ed29860216052a)))(@effect/platform-bun@4.1.5(bufferutil@4.1.0)(effect@4.1.5(patch_hash=14a7acd734809d8dddbf2c19c4ec01fdd2ffae60a612de42b5ed29860216052a))(utf-8-validate@6.0.6))(@effect/platform-node@4.1.5(bufferutil@4.1.0)(effect@4.1.5(patch_hash=14a7acd734809d8dddbf2c19c4ec01fdd2ffae60a612de42b5ed29860216052a))(redis@6.2.1)(utf-8-validate@6.0.6))(@types/node@24.12.4)(@voidzero-dev/vite-plus-core@8.3.8001(@types/node@24.12.4)(@volar/typescript@2.4.28(typescript@6.0.3))(esbuild@0.28.2)(jiti@2.7.0)(terser@5.48.0)(typescript@6.0.3)(unrun@0.2.39)(yaml@2.9.0))(effect@4.1.5(patch_hash=14a7acd734809d8dddbf2c19c4ec01fdd2ffae60a612de42b5ed29860216052a))(rolldown@1.2.13)(typescript@6.0.3) - '@alchemy.run/docker': 2.0.0-beta.85(2805735d490e93524ab3db20b0897785) - '@alchemy.run/sql': 2.0.0-beta.85(6906a3a93dff07c63d6ad3b93feb5862) - '@distilled.cloud/aws': 1.0.0-rc.18(effect@4.1.5(patch_hash=14a7acd734809d8dddbf2c19c4ec01fdd2ffae60a612de42b5ed29860216052a)) - '@distilled.cloud/aws4signer': 1.0.0-rc.18(effect@4.1.5(patch_hash=14a7acd734809d8dddbf2c19c4ec01fdd2ffae60a612de42b5ed29860216052a)) - '@distilled.cloud/cloudflare': 1.0.0-rc.18(effect@4.1.5(patch_hash=14a7acd734809d8dddbf2c19c4ec01fdd2ffae60a612de42b5ed29860216052a)) - '@distilled.cloud/core': 1.0.0-rc.18(effect@4.1.5(patch_hash=14a7acd734809d8dddbf2c19c4ec01fdd2ffae60a612de42b5ed29860216052a)) - '@distilled.cloud/iceberg': 1.0.0-rc.18(effect@4.1.5(patch_hash=14a7acd734809d8dddbf2c19c4ec01fdd2ffae60a612de42b5ed29860216052a)) - '@effect/sql-d1': 4.1.1(effect@4.1.5(patch_hash=14a7acd734809d8dddbf2c19c4ec01fdd2ffae60a612de42b5ed29860216052a)) - alchemy: 2.0.0-beta.85(patch_hash=07cc8c7e14b3b9af143ddd40a059f117c27e55139fbf20bd5dde2eb30509cedd)(@effect/platform-bun@4.1.5(bufferutil@4.1.0)(effect@4.1.5(patch_hash=14a7acd734809d8dddbf2c19c4ec01fdd2ffae60a612de42b5ed29860216052a))(utf-8-validate@6.0.6))(@effect/platform-node@4.1.5(bufferutil@4.1.0)(effect@4.1.5(patch_hash=14a7acd734809d8dddbf2c19c4ec01fdd2ffae60a612de42b5ed29860216052a))(redis@6.2.1)(utf-8-validate@6.0.6))(@types/react@19.3.0)(@voidzero-dev/vite-plus-core@8.3.8001(@types/node@24.12.4)(@volar/typescript@2.4.28(typescript@6.0.3))(esbuild@0.28.2)(jiti@2.7.0)(terser@5.48.0)(typescript@6.0.3)(unrun@0.2.39)(yaml@2.9.0))(effect@4.1.5(patch_hash=14a7acd734809d8dddbf2c19c4ec01fdd2ffae60a612de42b5ed29860216052a))(react-devtools-core@6.1.5(bufferutil@4.1.0)(utf-8-validate@6.0.6))(ws@8.22.0(bufferutil@4.1.0)(utf-8-validate@6.0.6)) - effect: 4.1.5(patch_hash=14a7acd734809d8dddbf2c19c4ec01fdd2ffae60a612de42b5ed29860216052a) + '@alchemy.run/cloudflare@2.0.0-beta.85(aa5e134efa4e132197ef8c42d9bb2cf1)': + dependencies: + '@alchemy.run/acme': 2.0.0-beta.85(alchemy@2.0.0-beta.85(patch_hash=07cc8c7e14b3b9af143ddd40a059f117c27e55139fbf20bd5dde2eb30509cedd)(@effect/platform-bun@4.1.6(bufferutil@4.1.0)(effect@4.1.6(patch_hash=c13237f64561426c002130285a9832acc5bb6ab42fd81e020b306429757ddda1))(utf-8-validate@6.0.6))(@effect/platform-node@4.1.6(bufferutil@4.1.0)(effect@4.1.6(patch_hash=c13237f64561426c002130285a9832acc5bb6ab42fd81e020b306429757ddda1))(redis@6.2.1)(utf-8-validate@6.0.6))(@types/react@19.3.0)(@voidzero-dev/vite-plus-core@8.3.8001(@types/node@24.12.4)(@volar/typescript@2.4.28(typescript@6.0.3))(esbuild@0.28.2)(jiti@2.7.0)(terser@5.48.0)(typescript@6.0.3)(unrun@0.2.39)(yaml@2.9.0))(effect@4.1.6(patch_hash=c13237f64561426c002130285a9832acc5bb6ab42fd81e020b306429757ddda1))(react-devtools-core@6.1.5(bufferutil@4.1.0)(utf-8-validate@6.0.6))(ws@8.22.0(bufferutil@4.1.0)(utf-8-validate@6.0.6)))(effect@4.1.6(patch_hash=c13237f64561426c002130285a9832acc5bb6ab42fd81e020b306429757ddda1)) + '@alchemy.run/cloudflare-runtime': 2.0.0-beta.85(@distilled.cloud/cloudflare@1.0.0-rc.18(effect@4.1.6(patch_hash=c13237f64561426c002130285a9832acc5bb6ab42fd81e020b306429757ddda1)))(@effect/platform-bun@4.1.6(bufferutil@4.1.0)(effect@4.1.6(patch_hash=c13237f64561426c002130285a9832acc5bb6ab42fd81e020b306429757ddda1))(utf-8-validate@6.0.6))(@effect/platform-node@4.1.6(bufferutil@4.1.0)(effect@4.1.6(patch_hash=c13237f64561426c002130285a9832acc5bb6ab42fd81e020b306429757ddda1))(redis@6.2.1)(utf-8-validate@6.0.6))(@types/node@24.12.4)(@voidzero-dev/vite-plus-core@8.3.8001(@types/node@24.12.4)(@volar/typescript@2.4.28(typescript@6.0.3))(esbuild@0.28.2)(jiti@2.7.0)(terser@5.48.0)(typescript@6.0.3)(unrun@0.2.39)(yaml@2.9.0))(effect@4.1.6(patch_hash=c13237f64561426c002130285a9832acc5bb6ab42fd81e020b306429757ddda1))(rolldown@1.2.13)(typescript@6.0.3) + '@alchemy.run/docker': 2.0.0-beta.85(7b5ac320fdbe20d095c1f9440486d1fc) + '@alchemy.run/sql': 2.0.0-beta.85(a163f98b55b76c5c61d78bde7530627b) + '@distilled.cloud/aws': 1.0.0-rc.18(effect@4.1.6(patch_hash=c13237f64561426c002130285a9832acc5bb6ab42fd81e020b306429757ddda1)) + '@distilled.cloud/aws4signer': 1.0.0-rc.18(effect@4.1.6(patch_hash=c13237f64561426c002130285a9832acc5bb6ab42fd81e020b306429757ddda1)) + '@distilled.cloud/cloudflare': 1.0.0-rc.18(effect@4.1.6(patch_hash=c13237f64561426c002130285a9832acc5bb6ab42fd81e020b306429757ddda1)) + '@distilled.cloud/core': 1.0.0-rc.18(effect@4.1.6(patch_hash=c13237f64561426c002130285a9832acc5bb6ab42fd81e020b306429757ddda1)) + '@distilled.cloud/iceberg': 1.0.0-rc.18(effect@4.1.6(patch_hash=c13237f64561426c002130285a9832acc5bb6ab42fd81e020b306429757ddda1)) + '@effect/sql-d1': 4.1.1(effect@4.1.6(patch_hash=c13237f64561426c002130285a9832acc5bb6ab42fd81e020b306429757ddda1)) + alchemy: 2.0.0-beta.85(patch_hash=07cc8c7e14b3b9af143ddd40a059f117c27e55139fbf20bd5dde2eb30509cedd)(@effect/platform-bun@4.1.6(bufferutil@4.1.0)(effect@4.1.6(patch_hash=c13237f64561426c002130285a9832acc5bb6ab42fd81e020b306429757ddda1))(utf-8-validate@6.0.6))(@effect/platform-node@4.1.6(bufferutil@4.1.0)(effect@4.1.6(patch_hash=c13237f64561426c002130285a9832acc5bb6ab42fd81e020b306429757ddda1))(redis@6.2.1)(utf-8-validate@6.0.6))(@types/react@19.3.0)(@voidzero-dev/vite-plus-core@8.3.8001(@types/node@24.12.4)(@volar/typescript@2.4.28(typescript@6.0.3))(esbuild@0.28.2)(jiti@2.7.0)(terser@5.48.0)(typescript@6.0.3)(unrun@0.2.39)(yaml@2.9.0))(effect@4.1.6(patch_hash=c13237f64561426c002130285a9832acc5bb6ab42fd81e020b306429757ddda1))(react-devtools-core@6.1.5(bufferutil@4.1.0)(utf-8-validate@6.0.6))(ws@8.22.0(bufferutil@4.1.0)(utf-8-validate@6.0.6)) + effect: 4.1.6(patch_hash=c13237f64561426c002130285a9832acc5bb6ab42fd81e020b306429757ddda1) pathe: 2.0.3 picomatch: 4.0.7 rolldown: 1.2.13 tinyglobby: 0.2.17 optionalDependencies: - '@effect/platform-bun': 4.1.5(bufferutil@4.1.0)(effect@4.1.5(patch_hash=14a7acd734809d8dddbf2c19c4ec01fdd2ffae60a612de42b5ed29860216052a))(utf-8-validate@6.0.6) - '@effect/platform-node': 4.1.5(bufferutil@4.1.0)(effect@4.1.5(patch_hash=14a7acd734809d8dddbf2c19c4ec01fdd2ffae60a612de42b5ed29860216052a))(redis@6.2.1)(utf-8-validate@6.0.6) + '@effect/platform-bun': 4.1.6(bufferutil@4.1.0)(effect@4.1.6(patch_hash=c13237f64561426c002130285a9832acc5bb6ab42fd81e020b306429757ddda1))(utf-8-validate@6.0.6) + '@effect/platform-node': 4.1.6(bufferutil@4.1.0)(effect@4.1.6(patch_hash=c13237f64561426c002130285a9832acc5bb6ab42fd81e020b306429757ddda1))(redis@6.2.1)(utf-8-validate@6.0.6) vite: '@voidzero-dev/vite-plus-core@8.3.8001(@types/node@24.12.4)(@volar/typescript@2.4.28(typescript@6.0.3))(esbuild@0.28.2)(jiti@2.7.0)(terser@5.48.0)(typescript@6.0.3)(unrun@0.2.39)(yaml@2.9.0)' transitivePeerDependencies: - '@effect/sql-libsql' @@ -13403,26 +13403,26 @@ snapshots: - proxy-agent - typescript - '@alchemy.run/docker@2.0.0-beta.85(2805735d490e93524ab3db20b0897785)': + '@alchemy.run/docker@2.0.0-beta.85(7b5ac320fdbe20d095c1f9440486d1fc)': dependencies: - alchemy: 2.0.0-beta.85(patch_hash=07cc8c7e14b3b9af143ddd40a059f117c27e55139fbf20bd5dde2eb30509cedd)(@effect/platform-bun@4.1.5(bufferutil@4.1.0)(effect@4.1.5(patch_hash=14a7acd734809d8dddbf2c19c4ec01fdd2ffae60a612de42b5ed29860216052a))(utf-8-validate@6.0.6))(@effect/platform-node@4.1.5(bufferutil@4.1.0)(effect@4.1.5(patch_hash=14a7acd734809d8dddbf2c19c4ec01fdd2ffae60a612de42b5ed29860216052a))(redis@6.2.1)(utf-8-validate@6.0.6))(@types/react@19.3.0)(@voidzero-dev/vite-plus-core@8.3.8001(@types/node@24.12.4)(@volar/typescript@2.4.28(typescript@6.0.3))(esbuild@0.28.2)(jiti@2.7.0)(terser@5.48.0)(typescript@6.0.3)(unrun@0.2.39)(yaml@2.9.0))(effect@4.1.5(patch_hash=14a7acd734809d8dddbf2c19c4ec01fdd2ffae60a612de42b5ed29860216052a))(react-devtools-core@6.1.5(bufferutil@4.1.0)(utf-8-validate@6.0.6))(ws@8.22.0(bufferutil@4.1.0)(utf-8-validate@6.0.6)) - effect: 4.1.5(patch_hash=14a7acd734809d8dddbf2c19c4ec01fdd2ffae60a612de42b5ed29860216052a) + alchemy: 2.0.0-beta.85(patch_hash=07cc8c7e14b3b9af143ddd40a059f117c27e55139fbf20bd5dde2eb30509cedd)(@effect/platform-bun@4.1.6(bufferutil@4.1.0)(effect@4.1.6(patch_hash=c13237f64561426c002130285a9832acc5bb6ab42fd81e020b306429757ddda1))(utf-8-validate@6.0.6))(@effect/platform-node@4.1.6(bufferutil@4.1.0)(effect@4.1.6(patch_hash=c13237f64561426c002130285a9832acc5bb6ab42fd81e020b306429757ddda1))(redis@6.2.1)(utf-8-validate@6.0.6))(@types/react@19.3.0)(@voidzero-dev/vite-plus-core@8.3.8001(@types/node@24.12.4)(@volar/typescript@2.4.28(typescript@6.0.3))(esbuild@0.28.2)(jiti@2.7.0)(terser@5.48.0)(typescript@6.0.3)(unrun@0.2.39)(yaml@2.9.0))(effect@4.1.6(patch_hash=c13237f64561426c002130285a9832acc5bb6ab42fd81e020b306429757ddda1))(react-devtools-core@6.1.5(bufferutil@4.1.0)(utf-8-validate@6.0.6))(ws@8.22.0(bufferutil@4.1.0)(utf-8-validate@6.0.6)) + effect: 4.1.6(patch_hash=c13237f64561426c002130285a9832acc5bb6ab42fd81e020b306429757ddda1) rolldown: 1.2.13 optionalDependencies: - '@effect/platform-bun': 4.1.5(bufferutil@4.1.0)(effect@4.1.5(patch_hash=14a7acd734809d8dddbf2c19c4ec01fdd2ffae60a612de42b5ed29860216052a))(utf-8-validate@6.0.6) + '@effect/platform-bun': 4.1.6(bufferutil@4.1.0)(effect@4.1.6(patch_hash=c13237f64561426c002130285a9832acc5bb6ab42fd81e020b306429757ddda1))(utf-8-validate@6.0.6) - '@alchemy.run/drizzle@2.0.0-beta.85(c2d19fec0d6fdbaf2493b9094ab8dc0b)': + '@alchemy.run/drizzle@2.0.0-beta.85(fac3646678ff74245ad357aa251302f8)': dependencies: - '@alchemy.run/sql': 2.0.0-beta.85(6906a3a93dff07c63d6ad3b93feb5862) - '@effect/sql-d1': 4.1.1(effect@4.1.5(patch_hash=14a7acd734809d8dddbf2c19c4ec01fdd2ffae60a612de42b5ed29860216052a)) - '@effect/sql-sqlite-do': 4.1.5(effect@4.1.5(patch_hash=14a7acd734809d8dddbf2c19c4ec01fdd2ffae60a612de42b5ed29860216052a)) - alchemy: 2.0.0-beta.85(patch_hash=07cc8c7e14b3b9af143ddd40a059f117c27e55139fbf20bd5dde2eb30509cedd)(@effect/platform-bun@4.1.5(bufferutil@4.1.0)(effect@4.1.5(patch_hash=14a7acd734809d8dddbf2c19c4ec01fdd2ffae60a612de42b5ed29860216052a))(utf-8-validate@6.0.6))(@effect/platform-node@4.1.5(bufferutil@4.1.0)(effect@4.1.5(patch_hash=14a7acd734809d8dddbf2c19c4ec01fdd2ffae60a612de42b5ed29860216052a))(redis@6.2.1)(utf-8-validate@6.0.6))(@types/react@19.3.0)(@voidzero-dev/vite-plus-core@8.3.8001(@types/node@24.12.4)(@volar/typescript@2.4.28(typescript@6.0.3))(esbuild@0.28.2)(jiti@2.7.0)(terser@5.48.0)(typescript@6.0.3)(unrun@0.2.39)(yaml@2.9.0))(effect@4.1.5(patch_hash=14a7acd734809d8dddbf2c19c4ec01fdd2ffae60a612de42b5ed29860216052a))(react-devtools-core@6.1.5(bufferutil@4.1.0)(utf-8-validate@6.0.6))(ws@8.22.0(bufferutil@4.1.0)(utf-8-validate@6.0.6)) - drizzle-orm: 1.0.0-rc.5(@cloudflare/workers-types@4.20260604.1)(@effect/sql-d1@4.1.1(effect@4.1.5(patch_hash=14a7acd734809d8dddbf2c19c4ec01fdd2ffae60a612de42b5ed29860216052a)))(@effect/sql-pg@4.1.5(effect@4.1.5(patch_hash=14a7acd734809d8dddbf2c19c4ec01fdd2ffae60a612de42b5ed29860216052a)))(@effect/sql-sqlite-do@4.1.5(effect@4.1.5(patch_hash=14a7acd734809d8dddbf2c19c4ec01fdd2ffae60a612de42b5ed29860216052a)))(@electric-sql/pglite@0.3.15)(@libsql/client@0.17.3(bufferutil@4.1.0)(utf-8-validate@6.0.6))(@types/sql.js@1.4.11)(bun-types@1.3.14)(effect@4.1.5(patch_hash=14a7acd734809d8dddbf2c19c4ec01fdd2ffae60a612de42b5ed29860216052a))(expo-sqlite@58.0.18(expo@58.0.26)(react-native@0.88.1(@babel/core@7.29.7(supports-color@8.1.1))(@react-native/metro-config@0.88.1(@babel/core@7.29.7(supports-color@8.1.1))(bufferutil@4.1.0)(supports-color@8.1.1)(utf-8-validate@6.0.6))(@types/react@19.3.0)(bufferutil@4.1.0)(react@19.3.0)(supports-color@8.1.1)(utf-8-validate@6.0.6))(react@19.3.0))(pg@8.23.0)(sql.js@1.15.0)(zod@4.6.7) - effect: 4.1.5(patch_hash=14a7acd734809d8dddbf2c19c4ec01fdd2ffae60a612de42b5ed29860216052a) + '@alchemy.run/sql': 2.0.0-beta.85(a163f98b55b76c5c61d78bde7530627b) + '@effect/sql-d1': 4.1.1(effect@4.1.6(patch_hash=c13237f64561426c002130285a9832acc5bb6ab42fd81e020b306429757ddda1)) + '@effect/sql-sqlite-do': 4.1.6(effect@4.1.6(patch_hash=c13237f64561426c002130285a9832acc5bb6ab42fd81e020b306429757ddda1)) + alchemy: 2.0.0-beta.85(patch_hash=07cc8c7e14b3b9af143ddd40a059f117c27e55139fbf20bd5dde2eb30509cedd)(@effect/platform-bun@4.1.6(bufferutil@4.1.0)(effect@4.1.6(patch_hash=c13237f64561426c002130285a9832acc5bb6ab42fd81e020b306429757ddda1))(utf-8-validate@6.0.6))(@effect/platform-node@4.1.6(bufferutil@4.1.0)(effect@4.1.6(patch_hash=c13237f64561426c002130285a9832acc5bb6ab42fd81e020b306429757ddda1))(redis@6.2.1)(utf-8-validate@6.0.6))(@types/react@19.3.0)(@voidzero-dev/vite-plus-core@8.3.8001(@types/node@24.12.4)(@volar/typescript@2.4.28(typescript@6.0.3))(esbuild@0.28.2)(jiti@2.7.0)(terser@5.48.0)(typescript@6.0.3)(unrun@0.2.39)(yaml@2.9.0))(effect@4.1.6(patch_hash=c13237f64561426c002130285a9832acc5bb6ab42fd81e020b306429757ddda1))(react-devtools-core@6.1.5(bufferutil@4.1.0)(utf-8-validate@6.0.6))(ws@8.22.0(bufferutil@4.1.0)(utf-8-validate@6.0.6)) + drizzle-orm: 1.0.0-rc.5(@cloudflare/workers-types@4.20260604.1)(@effect/sql-d1@4.1.1(effect@4.1.6(patch_hash=c13237f64561426c002130285a9832acc5bb6ab42fd81e020b306429757ddda1)))(@effect/sql-pg@4.1.6(effect@4.1.6(patch_hash=c13237f64561426c002130285a9832acc5bb6ab42fd81e020b306429757ddda1)))(@effect/sql-sqlite-do@4.1.6(effect@4.1.6(patch_hash=c13237f64561426c002130285a9832acc5bb6ab42fd81e020b306429757ddda1)))(@electric-sql/pglite@0.3.15)(@libsql/client@0.17.3(bufferutil@4.1.0)(utf-8-validate@6.0.6))(@types/sql.js@1.4.11)(bun-types@1.3.14)(effect@4.1.6(patch_hash=c13237f64561426c002130285a9832acc5bb6ab42fd81e020b306429757ddda1))(expo-sqlite@58.0.18(expo@58.0.26)(react-native@0.88.1(@babel/core@7.29.7(supports-color@8.1.1))(@react-native/metro-config@0.88.1(@babel/core@7.29.7(supports-color@8.1.1))(bufferutil@4.1.0)(supports-color@8.1.1)(utf-8-validate@6.0.6))(@types/react@19.3.0)(bufferutil@4.1.0)(react@19.3.0)(supports-color@8.1.1)(utf-8-validate@6.0.6))(react@19.3.0))(pg@8.23.0)(sql.js@1.15.0)(zod@4.6.7) + effect: 4.1.6(patch_hash=c13237f64561426c002130285a9832acc5bb6ab42fd81e020b306429757ddda1) optionalDependencies: - '@alchemy.run/cloudflare': 2.0.0-beta.85(51317535f95f3dfb59110e0111bc835c) - '@effect/sql-pg': 4.1.5(effect@4.1.5(patch_hash=14a7acd734809d8dddbf2c19c4ec01fdd2ffae60a612de42b5ed29860216052a)) - drizzle-kit: 1.0.0-rc.5(1460f90e852e80b46440e9b4378c92e0) + '@alchemy.run/cloudflare': 2.0.0-beta.85(aa5e134efa4e132197ef8c42d9bb2cf1) + '@effect/sql-pg': 4.1.6(effect@4.1.6(patch_hash=c13237f64561426c002130285a9832acc5bb6ab42fd81e020b306429757ddda1)) + drizzle-kit: 1.0.0-rc.5(2e7aae405f975aacb858aa45f3c70a34) transitivePeerDependencies: - mysql2 - pg @@ -13432,13 +13432,13 @@ snapshots: chokidar: 5.0.0 rolldown: 1.2.13 - '@alchemy.run/planetscale@2.0.0-beta.85(6906a3a93dff07c63d6ad3b93feb5862)': + '@alchemy.run/planetscale@2.0.0-beta.85(a163f98b55b76c5c61d78bde7530627b)': dependencies: - '@alchemy.run/sql': 2.0.0-beta.85(6906a3a93dff07c63d6ad3b93feb5862) - '@distilled.cloud/core': 1.0.0-rc.18(effect@4.1.5(patch_hash=14a7acd734809d8dddbf2c19c4ec01fdd2ffae60a612de42b5ed29860216052a)) - '@distilled.cloud/planetscale': 1.0.0-rc.18(effect@4.1.5(patch_hash=14a7acd734809d8dddbf2c19c4ec01fdd2ffae60a612de42b5ed29860216052a)) - alchemy: 2.0.0-beta.85(patch_hash=07cc8c7e14b3b9af143ddd40a059f117c27e55139fbf20bd5dde2eb30509cedd)(@effect/platform-bun@4.1.5(bufferutil@4.1.0)(effect@4.1.5(patch_hash=14a7acd734809d8dddbf2c19c4ec01fdd2ffae60a612de42b5ed29860216052a))(utf-8-validate@6.0.6))(@effect/platform-node@4.1.5(bufferutil@4.1.0)(effect@4.1.5(patch_hash=14a7acd734809d8dddbf2c19c4ec01fdd2ffae60a612de42b5ed29860216052a))(redis@6.2.1)(utf-8-validate@6.0.6))(@types/react@19.3.0)(@voidzero-dev/vite-plus-core@8.3.8001(@types/node@24.12.4)(@volar/typescript@2.4.28(typescript@6.0.3))(esbuild@0.28.2)(jiti@2.7.0)(terser@5.48.0)(typescript@6.0.3)(unrun@0.2.39)(yaml@2.9.0))(effect@4.1.5(patch_hash=14a7acd734809d8dddbf2c19c4ec01fdd2ffae60a612de42b5ed29860216052a))(react-devtools-core@6.1.5(bufferutil@4.1.0)(utf-8-validate@6.0.6))(ws@8.22.0(bufferutil@4.1.0)(utf-8-validate@6.0.6)) - effect: 4.1.5(patch_hash=14a7acd734809d8dddbf2c19c4ec01fdd2ffae60a612de42b5ed29860216052a) + '@alchemy.run/sql': 2.0.0-beta.85(a163f98b55b76c5c61d78bde7530627b) + '@distilled.cloud/core': 1.0.0-rc.18(effect@4.1.6(patch_hash=c13237f64561426c002130285a9832acc5bb6ab42fd81e020b306429757ddda1)) + '@distilled.cloud/planetscale': 1.0.0-rc.18(effect@4.1.6(patch_hash=c13237f64561426c002130285a9832acc5bb6ab42fd81e020b306429757ddda1)) + alchemy: 2.0.0-beta.85(patch_hash=07cc8c7e14b3b9af143ddd40a059f117c27e55139fbf20bd5dde2eb30509cedd)(@effect/platform-bun@4.1.6(bufferutil@4.1.0)(effect@4.1.6(patch_hash=c13237f64561426c002130285a9832acc5bb6ab42fd81e020b306429757ddda1))(utf-8-validate@6.0.6))(@effect/platform-node@4.1.6(bufferutil@4.1.0)(effect@4.1.6(patch_hash=c13237f64561426c002130285a9832acc5bb6ab42fd81e020b306429757ddda1))(redis@6.2.1)(utf-8-validate@6.0.6))(@types/react@19.3.0)(@voidzero-dev/vite-plus-core@8.3.8001(@types/node@24.12.4)(@volar/typescript@2.4.28(typescript@6.0.3))(esbuild@0.28.2)(jiti@2.7.0)(terser@5.48.0)(typescript@6.0.3)(unrun@0.2.39)(yaml@2.9.0))(effect@4.1.6(patch_hash=c13237f64561426c002130285a9832acc5bb6ab42fd81e020b306429757ddda1))(react-devtools-core@6.1.5(bufferutil@4.1.0)(utf-8-validate@6.0.6))(ws@8.22.0(bufferutil@4.1.0)(utf-8-validate@6.0.6)) + effect: 4.1.6(patch_hash=c13237f64561426c002130285a9832acc5bb6ab42fd81e020b306429757ddda1) optionalDependencies: pg: 8.23.0 transitivePeerDependencies: @@ -13451,21 +13451,21 @@ snapshots: '@types/react': 19.3.0 react-devtools-core: 6.1.5(bufferutil@4.1.0)(utf-8-validate@6.0.6) - '@alchemy.run/sql@2.0.0-beta.85(6906a3a93dff07c63d6ad3b93feb5862)': + '@alchemy.run/sql@2.0.0-beta.85(a163f98b55b76c5c61d78bde7530627b)': dependencies: - alchemy: 2.0.0-beta.85(patch_hash=07cc8c7e14b3b9af143ddd40a059f117c27e55139fbf20bd5dde2eb30509cedd)(@effect/platform-bun@4.1.5(bufferutil@4.1.0)(effect@4.1.5(patch_hash=14a7acd734809d8dddbf2c19c4ec01fdd2ffae60a612de42b5ed29860216052a))(utf-8-validate@6.0.6))(@effect/platform-node@4.1.5(bufferutil@4.1.0)(effect@4.1.5(patch_hash=14a7acd734809d8dddbf2c19c4ec01fdd2ffae60a612de42b5ed29860216052a))(redis@6.2.1)(utf-8-validate@6.0.6))(@types/react@19.3.0)(@voidzero-dev/vite-plus-core@8.3.8001(@types/node@24.12.4)(@volar/typescript@2.4.28(typescript@6.0.3))(esbuild@0.28.2)(jiti@2.7.0)(terser@5.48.0)(typescript@6.0.3)(unrun@0.2.39)(yaml@2.9.0))(effect@4.1.5(patch_hash=14a7acd734809d8dddbf2c19c4ec01fdd2ffae60a612de42b5ed29860216052a))(react-devtools-core@6.1.5(bufferutil@4.1.0)(utf-8-validate@6.0.6))(ws@8.22.0(bufferutil@4.1.0)(utf-8-validate@6.0.6)) - effect: 4.1.5(patch_hash=14a7acd734809d8dddbf2c19c4ec01fdd2ffae60a612de42b5ed29860216052a) + alchemy: 2.0.0-beta.85(patch_hash=07cc8c7e14b3b9af143ddd40a059f117c27e55139fbf20bd5dde2eb30509cedd)(@effect/platform-bun@4.1.6(bufferutil@4.1.0)(effect@4.1.6(patch_hash=c13237f64561426c002130285a9832acc5bb6ab42fd81e020b306429757ddda1))(utf-8-validate@6.0.6))(@effect/platform-node@4.1.6(bufferutil@4.1.0)(effect@4.1.6(patch_hash=c13237f64561426c002130285a9832acc5bb6ab42fd81e020b306429757ddda1))(redis@6.2.1)(utf-8-validate@6.0.6))(@types/react@19.3.0)(@voidzero-dev/vite-plus-core@8.3.8001(@types/node@24.12.4)(@volar/typescript@2.4.28(typescript@6.0.3))(esbuild@0.28.2)(jiti@2.7.0)(terser@5.48.0)(typescript@6.0.3)(unrun@0.2.39)(yaml@2.9.0))(effect@4.1.6(patch_hash=c13237f64561426c002130285a9832acc5bb6ab42fd81e020b306429757ddda1))(react-devtools-core@6.1.5(bufferutil@4.1.0)(utf-8-validate@6.0.6))(ws@8.22.0(bufferutil@4.1.0)(utf-8-validate@6.0.6)) + effect: 4.1.6(patch_hash=c13237f64561426c002130285a9832acc5bb6ab42fd81e020b306429757ddda1) optionalDependencies: - '@effect/sql-pg': 4.1.5(effect@4.1.5(patch_hash=14a7acd734809d8dddbf2c19c4ec01fdd2ffae60a612de42b5ed29860216052a)) + '@effect/sql-pg': 4.1.6(effect@4.1.6(patch_hash=c13237f64561426c002130285a9832acc5bb6ab42fd81e020b306429757ddda1)) pg: 8.23.0 - '@alchemy.run/test@2.0.0-beta.85(patch_hash=29c0539ea71d9cc372f0b16558640599beb9bc609605feb2a493da268d72713e)(3b35ec8f94f326c4644a0d8fa97d0c63)': + '@alchemy.run/test@2.0.0-beta.85(patch_hash=29c0539ea71d9cc372f0b16558640599beb9bc609605feb2a493da268d72713e)(643156d2e34fcc9d3ceb68657dc7004f)': dependencies: - '@effect/platform-bun': 4.1.5(bufferutil@4.1.0)(effect@4.1.5(patch_hash=14a7acd734809d8dddbf2c19c4ec01fdd2ffae60a612de42b5ed29860216052a))(utf-8-validate@6.0.6) - effect: 4.1.5(patch_hash=14a7acd734809d8dddbf2c19c4ec01fdd2ffae60a612de42b5ed29860216052a) + '@effect/platform-bun': 4.1.6(bufferutil@4.1.0)(effect@4.1.6(patch_hash=c13237f64561426c002130285a9832acc5bb6ab42fd81e020b306429757ddda1))(utf-8-validate@6.0.6) + effect: 4.1.6(patch_hash=c13237f64561426c002130285a9832acc5bb6ab42fd81e020b306429757ddda1) optionalDependencies: - '@effect/vitest': 4.1.5(patch_hash=dd0bf2b1ae0f63aff0d620ebc67b82d19759b3fa69a608ef85e2a5b40b4d46c5)(@astrojs/compiler-rs@0.5.1)(@types/node@24.12.4)(@vitest/browser-playwright@5.1.1)(@vitest/ui@5.1.1)(@volar/typescript@2.4.28(typescript@6.0.3))(bufferutil@4.1.0)(effect@4.1.5(patch_hash=14a7acd734809d8dddbf2c19c4ec01fdd2ffae60a612de42b5ed29860216052a))(esbuild@0.28.2)(jiti@2.7.0)(jsdom@30.1.0(@noble/hashes@1.8.0))(playwright@1.64.1)(terser@5.48.0)(typescript@6.0.3)(unrun@0.2.39)(utf-8-validate@6.0.6)(yaml@2.9.0) - alchemy: 2.0.0-beta.85(patch_hash=07cc8c7e14b3b9af143ddd40a059f117c27e55139fbf20bd5dde2eb30509cedd)(@effect/platform-bun@4.1.5(bufferutil@4.1.0)(effect@4.1.5(patch_hash=14a7acd734809d8dddbf2c19c4ec01fdd2ffae60a612de42b5ed29860216052a))(utf-8-validate@6.0.6))(@effect/platform-node@4.1.5(bufferutil@4.1.0)(effect@4.1.5(patch_hash=14a7acd734809d8dddbf2c19c4ec01fdd2ffae60a612de42b5ed29860216052a))(redis@6.2.1)(utf-8-validate@6.0.6))(@types/react@19.3.0)(@voidzero-dev/vite-plus-core@8.3.8001(@types/node@24.12.4)(@volar/typescript@2.4.28(typescript@6.0.3))(esbuild@0.28.2)(jiti@2.7.0)(terser@5.48.0)(typescript@6.0.3)(unrun@0.2.39)(yaml@2.9.0))(effect@4.1.5(patch_hash=14a7acd734809d8dddbf2c19c4ec01fdd2ffae60a612de42b5ed29860216052a))(react-devtools-core@6.1.5(bufferutil@4.1.0)(utf-8-validate@6.0.6))(ws@8.22.0(bufferutil@4.1.0)(utf-8-validate@6.0.6)) + '@effect/vitest': 4.1.6(patch_hash=f87ba071dd4f5cfa3b1ba14d5d59363e64372cd49af4d8282c322939e6bf3af2)(@astrojs/compiler-rs@0.5.1)(@types/node@24.12.4)(@vitest/browser-playwright@5.1.1)(@vitest/ui@5.1.1)(@volar/typescript@2.4.28(typescript@6.0.3))(bufferutil@4.1.0)(effect@4.1.6(patch_hash=c13237f64561426c002130285a9832acc5bb6ab42fd81e020b306429757ddda1))(esbuild@0.28.2)(jiti@2.7.0)(jsdom@30.1.0(@noble/hashes@1.8.0))(playwright@1.64.1)(terser@5.48.0)(typescript@6.0.3)(unrun@0.2.39)(utf-8-validate@6.0.6)(yaml@2.9.0) + alchemy: 2.0.0-beta.85(patch_hash=07cc8c7e14b3b9af143ddd40a059f117c27e55139fbf20bd5dde2eb30509cedd)(@effect/platform-bun@4.1.6(bufferutil@4.1.0)(effect@4.1.6(patch_hash=c13237f64561426c002130285a9832acc5bb6ab42fd81e020b306429757ddda1))(utf-8-validate@6.0.6))(@effect/platform-node@4.1.6(bufferutil@4.1.0)(effect@4.1.6(patch_hash=c13237f64561426c002130285a9832acc5bb6ab42fd81e020b306429757ddda1))(redis@6.2.1)(utf-8-validate@6.0.6))(@types/react@19.3.0)(@voidzero-dev/vite-plus-core@8.3.8001(@types/node@24.12.4)(@volar/typescript@2.4.28(typescript@6.0.3))(esbuild@0.28.2)(jiti@2.7.0)(terser@5.48.0)(typescript@6.0.3)(unrun@0.2.39)(yaml@2.9.0))(effect@4.1.6(patch_hash=c13237f64561426c002130285a9832acc5bb6ab42fd81e020b306429757ddda1))(react-devtools-core@6.1.5(bufferutil@4.1.0)(utf-8-validate@6.0.6))(ws@8.22.0(bufferutil@4.1.0)(utf-8-validate@6.0.6)) vitest: 5.1.1(@types/node@24.12.4)(@vitest/browser-playwright@5.1.1)(@vitest/browser-preview@5.1.1)(@vitest/ui@5.1.1)(@voidzero-dev/vite-plus-core@8.3.8001(@types/node@24.12.4)(@volar/typescript@2.4.28(typescript@6.0.3))(esbuild@0.28.2)(jiti@2.7.0)(terser@5.48.0)(typescript@6.0.3)(unrun@0.2.39)(yaml@2.9.0))(@volar/typescript@2.4.28(typescript@6.0.3))(esbuild@0.28.2)(jiti@2.7.0)(jsdom@30.1.0(@noble/hashes@1.8.0))(terser@5.48.0)(typescript@6.0.3)(unrun@0.2.39)(yaml@2.9.0) transitivePeerDependencies: - bufferutil @@ -14463,45 +14463,45 @@ snapshots: '@dimforge/rapier3d-compat@0.12.0': {} - '@distilled.cloud/acme@1.0.0-rc.18(effect@4.1.5(patch_hash=14a7acd734809d8dddbf2c19c4ec01fdd2ffae60a612de42b5ed29860216052a))': + '@distilled.cloud/acme@1.0.0-rc.18(effect@4.1.6(patch_hash=c13237f64561426c002130285a9832acc5bb6ab42fd81e020b306429757ddda1))': dependencies: - '@distilled.cloud/core': 1.0.0-rc.18(effect@4.1.5(patch_hash=14a7acd734809d8dddbf2c19c4ec01fdd2ffae60a612de42b5ed29860216052a)) - effect: 4.1.5(patch_hash=14a7acd734809d8dddbf2c19c4ec01fdd2ffae60a612de42b5ed29860216052a) + '@distilled.cloud/core': 1.0.0-rc.18(effect@4.1.6(patch_hash=c13237f64561426c002130285a9832acc5bb6ab42fd81e020b306429757ddda1)) + effect: 4.1.6(patch_hash=c13237f64561426c002130285a9832acc5bb6ab42fd81e020b306429757ddda1) - '@distilled.cloud/aws4signer@1.0.0-rc.18(effect@4.1.5(patch_hash=14a7acd734809d8dddbf2c19c4ec01fdd2ffae60a612de42b5ed29860216052a))': + '@distilled.cloud/aws4signer@1.0.0-rc.18(effect@4.1.6(patch_hash=c13237f64561426c002130285a9832acc5bb6ab42fd81e020b306429757ddda1))': dependencies: - '@distilled.cloud/core': 1.0.0-rc.18(effect@4.1.5(patch_hash=14a7acd734809d8dddbf2c19c4ec01fdd2ffae60a612de42b5ed29860216052a)) - effect: 4.1.5(patch_hash=14a7acd734809d8dddbf2c19c4ec01fdd2ffae60a612de42b5ed29860216052a) + '@distilled.cloud/core': 1.0.0-rc.18(effect@4.1.6(patch_hash=c13237f64561426c002130285a9832acc5bb6ab42fd81e020b306429757ddda1)) + effect: 4.1.6(patch_hash=c13237f64561426c002130285a9832acc5bb6ab42fd81e020b306429757ddda1) - '@distilled.cloud/aws@1.0.0-rc.18(effect@4.1.5(patch_hash=14a7acd734809d8dddbf2c19c4ec01fdd2ffae60a612de42b5ed29860216052a))': + '@distilled.cloud/aws@1.0.0-rc.18(effect@4.1.6(patch_hash=c13237f64561426c002130285a9832acc5bb6ab42fd81e020b306429757ddda1))': dependencies: - '@distilled.cloud/aws4signer': 1.0.0-rc.18(effect@4.1.5(patch_hash=14a7acd734809d8dddbf2c19c4ec01fdd2ffae60a612de42b5ed29860216052a)) - '@distilled.cloud/core': 1.0.0-rc.18(effect@4.1.5(patch_hash=14a7acd734809d8dddbf2c19c4ec01fdd2ffae60a612de42b5ed29860216052a)) - effect: 4.1.5(patch_hash=14a7acd734809d8dddbf2c19c4ec01fdd2ffae60a612de42b5ed29860216052a) + '@distilled.cloud/aws4signer': 1.0.0-rc.18(effect@4.1.6(patch_hash=c13237f64561426c002130285a9832acc5bb6ab42fd81e020b306429757ddda1)) + '@distilled.cloud/core': 1.0.0-rc.18(effect@4.1.6(patch_hash=c13237f64561426c002130285a9832acc5bb6ab42fd81e020b306429757ddda1)) + effect: 4.1.6(patch_hash=c13237f64561426c002130285a9832acc5bb6ab42fd81e020b306429757ddda1) - '@distilled.cloud/axiom@1.0.0-rc.18(effect@4.1.5(patch_hash=14a7acd734809d8dddbf2c19c4ec01fdd2ffae60a612de42b5ed29860216052a))': + '@distilled.cloud/axiom@1.0.0-rc.18(effect@4.1.6(patch_hash=c13237f64561426c002130285a9832acc5bb6ab42fd81e020b306429757ddda1))': dependencies: - '@distilled.cloud/core': 1.0.0-rc.18(effect@4.1.5(patch_hash=14a7acd734809d8dddbf2c19c4ec01fdd2ffae60a612de42b5ed29860216052a)) - effect: 4.1.5(patch_hash=14a7acd734809d8dddbf2c19c4ec01fdd2ffae60a612de42b5ed29860216052a) + '@distilled.cloud/core': 1.0.0-rc.18(effect@4.1.6(patch_hash=c13237f64561426c002130285a9832acc5bb6ab42fd81e020b306429757ddda1)) + effect: 4.1.6(patch_hash=c13237f64561426c002130285a9832acc5bb6ab42fd81e020b306429757ddda1) - '@distilled.cloud/cloudflare@1.0.0-rc.18(effect@4.1.5(patch_hash=14a7acd734809d8dddbf2c19c4ec01fdd2ffae60a612de42b5ed29860216052a))': + '@distilled.cloud/cloudflare@1.0.0-rc.18(effect@4.1.6(patch_hash=c13237f64561426c002130285a9832acc5bb6ab42fd81e020b306429757ddda1))': dependencies: - '@distilled.cloud/core': 1.0.0-rc.18(effect@4.1.5(patch_hash=14a7acd734809d8dddbf2c19c4ec01fdd2ffae60a612de42b5ed29860216052a)) - effect: 4.1.5(patch_hash=14a7acd734809d8dddbf2c19c4ec01fdd2ffae60a612de42b5ed29860216052a) + '@distilled.cloud/core': 1.0.0-rc.18(effect@4.1.6(patch_hash=c13237f64561426c002130285a9832acc5bb6ab42fd81e020b306429757ddda1)) + effect: 4.1.6(patch_hash=c13237f64561426c002130285a9832acc5bb6ab42fd81e020b306429757ddda1) - '@distilled.cloud/core@1.0.0-rc.18(effect@4.1.5(patch_hash=14a7acd734809d8dddbf2c19c4ec01fdd2ffae60a612de42b5ed29860216052a))': + '@distilled.cloud/core@1.0.0-rc.18(effect@4.1.6(patch_hash=c13237f64561426c002130285a9832acc5bb6ab42fd81e020b306429757ddda1))': dependencies: - effect: 4.1.5(patch_hash=14a7acd734809d8dddbf2c19c4ec01fdd2ffae60a612de42b5ed29860216052a) + effect: 4.1.6(patch_hash=c13237f64561426c002130285a9832acc5bb6ab42fd81e020b306429757ddda1) - '@distilled.cloud/iceberg@1.0.0-rc.18(effect@4.1.5(patch_hash=14a7acd734809d8dddbf2c19c4ec01fdd2ffae60a612de42b5ed29860216052a))': + '@distilled.cloud/iceberg@1.0.0-rc.18(effect@4.1.6(patch_hash=c13237f64561426c002130285a9832acc5bb6ab42fd81e020b306429757ddda1))': dependencies: - '@distilled.cloud/core': 1.0.0-rc.18(effect@4.1.5(patch_hash=14a7acd734809d8dddbf2c19c4ec01fdd2ffae60a612de42b5ed29860216052a)) - effect: 4.1.5(patch_hash=14a7acd734809d8dddbf2c19c4ec01fdd2ffae60a612de42b5ed29860216052a) + '@distilled.cloud/core': 1.0.0-rc.18(effect@4.1.6(patch_hash=c13237f64561426c002130285a9832acc5bb6ab42fd81e020b306429757ddda1)) + effect: 4.1.6(patch_hash=c13237f64561426c002130285a9832acc5bb6ab42fd81e020b306429757ddda1) - '@distilled.cloud/planetscale@1.0.0-rc.18(effect@4.1.5(patch_hash=14a7acd734809d8dddbf2c19c4ec01fdd2ffae60a612de42b5ed29860216052a))': + '@distilled.cloud/planetscale@1.0.0-rc.18(effect@4.1.6(patch_hash=c13237f64561426c002130285a9832acc5bb6ab42fd81e020b306429757ddda1))': dependencies: - '@distilled.cloud/core': 1.0.0-rc.18(effect@4.1.5(patch_hash=14a7acd734809d8dddbf2c19c4ec01fdd2ffae60a612de42b5ed29860216052a)) - effect: 4.1.5(patch_hash=14a7acd734809d8dddbf2c19c4ec01fdd2ffae60a612de42b5ed29860216052a) + '@distilled.cloud/core': 1.0.0-rc.18(effect@4.1.6(patch_hash=c13237f64561426c002130285a9832acc5bb6ab42fd81e020b306429757ddda1)) + effect: 4.1.6(patch_hash=c13237f64561426c002130285a9832acc5bb6ab42fd81e020b306429757ddda1) '@dnd-kit/accessibility@3.1.1(react@19.3.0)': dependencies: @@ -14553,64 +14553,64 @@ snapshots: e2e: 0.24.0 playwright-core: 1.64.1 - '@effect/atom-react@4.1.5(effect@4.1.5(patch_hash=14a7acd734809d8dddbf2c19c4ec01fdd2ffae60a612de42b5ed29860216052a))(react@19.3.0)(scheduler@0.28.0)': + '@effect/atom-react@4.1.6(effect@4.1.6(patch_hash=c13237f64561426c002130285a9832acc5bb6ab42fd81e020b306429757ddda1))(react@19.3.0)(scheduler@0.28.0)': dependencies: - effect: 4.1.5(patch_hash=14a7acd734809d8dddbf2c19c4ec01fdd2ffae60a612de42b5ed29860216052a) + effect: 4.1.6(patch_hash=c13237f64561426c002130285a9832acc5bb6ab42fd81e020b306429757ddda1) react: 19.3.0 scheduler: 0.28.0 - '@effect/graphql-generator@4.1.5(@effect/platform-node@4.1.5(bufferutil@4.1.0)(effect@4.1.5(patch_hash=14a7acd734809d8dddbf2c19c4ec01fdd2ffae60a612de42b5ed29860216052a))(redis@6.2.1)(utf-8-validate@6.0.6))(effect@4.1.5(patch_hash=14a7acd734809d8dddbf2c19c4ec01fdd2ffae60a612de42b5ed29860216052a))': + '@effect/graphql-generator@4.1.6(@effect/platform-node@4.1.6(bufferutil@4.1.0)(effect@4.1.6(patch_hash=c13237f64561426c002130285a9832acc5bb6ab42fd81e020b306429757ddda1))(redis@6.2.1)(utf-8-validate@6.0.6))(effect@4.1.6(patch_hash=c13237f64561426c002130285a9832acc5bb6ab42fd81e020b306429757ddda1))': dependencies: - '@effect/platform-node': 4.1.5(bufferutil@4.1.0)(effect@4.1.5(patch_hash=14a7acd734809d8dddbf2c19c4ec01fdd2ffae60a612de42b5ed29860216052a))(redis@6.2.1)(utf-8-validate@6.0.6) - effect: 4.1.5(patch_hash=14a7acd734809d8dddbf2c19c4ec01fdd2ffae60a612de42b5ed29860216052a) + '@effect/platform-node': 4.1.6(bufferutil@4.1.0)(effect@4.1.6(patch_hash=c13237f64561426c002130285a9832acc5bb6ab42fd81e020b306429757ddda1))(redis@6.2.1)(utf-8-validate@6.0.6) + effect: 4.1.6(patch_hash=c13237f64561426c002130285a9832acc5bb6ab42fd81e020b306429757ddda1) - '@effect/openapi-generator@4.1.5(@effect/platform-node@4.1.5(bufferutil@4.1.0)(effect@4.1.5(patch_hash=14a7acd734809d8dddbf2c19c4ec01fdd2ffae60a612de42b5ed29860216052a))(redis@6.2.1)(utf-8-validate@6.0.6))(effect@4.1.5(patch_hash=14a7acd734809d8dddbf2c19c4ec01fdd2ffae60a612de42b5ed29860216052a))(encoding@0.1.13)': + '@effect/openapi-generator@4.1.6(@effect/platform-node@4.1.6(bufferutil@4.1.0)(effect@4.1.6(patch_hash=c13237f64561426c002130285a9832acc5bb6ab42fd81e020b306429757ddda1))(redis@6.2.1)(utf-8-validate@6.0.6))(effect@4.1.6(patch_hash=c13237f64561426c002130285a9832acc5bb6ab42fd81e020b306429757ddda1))(encoding@0.1.13)': dependencies: - '@effect/platform-node': 4.1.5(bufferutil@4.1.0)(effect@4.1.5(patch_hash=14a7acd734809d8dddbf2c19c4ec01fdd2ffae60a612de42b5ed29860216052a))(redis@6.2.1)(utf-8-validate@6.0.6) - effect: 4.1.5(patch_hash=14a7acd734809d8dddbf2c19c4ec01fdd2ffae60a612de42b5ed29860216052a) + '@effect/platform-node': 4.1.6(bufferutil@4.1.0)(effect@4.1.6(patch_hash=c13237f64561426c002130285a9832acc5bb6ab42fd81e020b306429757ddda1))(redis@6.2.1)(utf-8-validate@6.0.6) + effect: 4.1.6(patch_hash=c13237f64561426c002130285a9832acc5bb6ab42fd81e020b306429757ddda1) swagger2openapi: 7.0.8(encoding@0.1.13) transitivePeerDependencies: - encoding - '@effect/platform-bun@4.1.5(bufferutil@4.1.0)(effect@4.1.5(patch_hash=14a7acd734809d8dddbf2c19c4ec01fdd2ffae60a612de42b5ed29860216052a))(utf-8-validate@6.0.6)': + '@effect/platform-bun@4.1.6(bufferutil@4.1.0)(effect@4.1.6(patch_hash=c13237f64561426c002130285a9832acc5bb6ab42fd81e020b306429757ddda1))(utf-8-validate@6.0.6)': dependencies: - '@effect/platform-node-shared': 4.1.5(patch_hash=06952843c6f431ca83c78762fd18d23cda76883801049ee311feced2438ecf14)(bufferutil@4.1.0)(effect@4.1.5(patch_hash=14a7acd734809d8dddbf2c19c4ec01fdd2ffae60a612de42b5ed29860216052a))(utf-8-validate@6.0.6) - effect: 4.1.5(patch_hash=14a7acd734809d8dddbf2c19c4ec01fdd2ffae60a612de42b5ed29860216052a) + '@effect/platform-node-shared': 4.1.6(patch_hash=af6bf6e9364037fa069fe80678a04acf389d8d5883600500a7afe5ab0ce6e9bc)(bufferutil@4.1.0)(effect@4.1.6(patch_hash=c13237f64561426c002130285a9832acc5bb6ab42fd81e020b306429757ddda1))(utf-8-validate@6.0.6) + effect: 4.1.6(patch_hash=c13237f64561426c002130285a9832acc5bb6ab42fd81e020b306429757ddda1) transitivePeerDependencies: - bufferutil - utf-8-validate - '@effect/platform-node-shared@4.1.5(patch_hash=06952843c6f431ca83c78762fd18d23cda76883801049ee311feced2438ecf14)(bufferutil@4.1.0)(effect@4.1.5(patch_hash=14a7acd734809d8dddbf2c19c4ec01fdd2ffae60a612de42b5ed29860216052a))(utf-8-validate@6.0.6)': + '@effect/platform-node-shared@4.1.6(patch_hash=af6bf6e9364037fa069fe80678a04acf389d8d5883600500a7afe5ab0ce6e9bc)(bufferutil@4.1.0)(effect@4.1.6(patch_hash=c13237f64561426c002130285a9832acc5bb6ab42fd81e020b306429757ddda1))(utf-8-validate@6.0.6)': dependencies: '@types/ws': 8.18.2 - effect: 4.1.5(patch_hash=14a7acd734809d8dddbf2c19c4ec01fdd2ffae60a612de42b5ed29860216052a) + effect: 4.1.6(patch_hash=c13237f64561426c002130285a9832acc5bb6ab42fd81e020b306429757ddda1) ws: 8.22.0(bufferutil@4.1.0)(utf-8-validate@6.0.6) transitivePeerDependencies: - bufferutil - utf-8-validate - '@effect/platform-node@4.1.5(bufferutil@4.1.0)(effect@4.1.5(patch_hash=14a7acd734809d8dddbf2c19c4ec01fdd2ffae60a612de42b5ed29860216052a))(redis@6.2.1)(utf-8-validate@6.0.6)': + '@effect/platform-node@4.1.6(bufferutil@4.1.0)(effect@4.1.6(patch_hash=c13237f64561426c002130285a9832acc5bb6ab42fd81e020b306429757ddda1))(redis@6.2.1)(utf-8-validate@6.0.6)': dependencies: - '@effect/platform-node-shared': 4.1.5(patch_hash=06952843c6f431ca83c78762fd18d23cda76883801049ee311feced2438ecf14)(bufferutil@4.1.0)(effect@4.1.5(patch_hash=14a7acd734809d8dddbf2c19c4ec01fdd2ffae60a612de42b5ed29860216052a))(utf-8-validate@6.0.6) - effect: 4.1.5(patch_hash=14a7acd734809d8dddbf2c19c4ec01fdd2ffae60a612de42b5ed29860216052a) + '@effect/platform-node-shared': 4.1.6(patch_hash=af6bf6e9364037fa069fe80678a04acf389d8d5883600500a7afe5ab0ce6e9bc)(bufferutil@4.1.0)(effect@4.1.6(patch_hash=c13237f64561426c002130285a9832acc5bb6ab42fd81e020b306429757ddda1))(utf-8-validate@6.0.6) + effect: 4.1.6(patch_hash=c13237f64561426c002130285a9832acc5bb6ab42fd81e020b306429757ddda1) redis: 6.2.1 undici: 8.12.4 transitivePeerDependencies: - bufferutil - utf-8-validate - '@effect/sql-d1@4.1.1(effect@4.1.5(patch_hash=14a7acd734809d8dddbf2c19c4ec01fdd2ffae60a612de42b5ed29860216052a))': + '@effect/sql-d1@4.1.1(effect@4.1.6(patch_hash=c13237f64561426c002130285a9832acc5bb6ab42fd81e020b306429757ddda1))': dependencies: '@cloudflare/workers-types': 5.20261026.1 - effect: 4.1.5(patch_hash=14a7acd734809d8dddbf2c19c4ec01fdd2ffae60a612de42b5ed29860216052a) + effect: 4.1.6(patch_hash=c13237f64561426c002130285a9832acc5bb6ab42fd81e020b306429757ddda1) - '@effect/sql-pg@4.1.5(effect@4.1.5(patch_hash=14a7acd734809d8dddbf2c19c4ec01fdd2ffae60a612de42b5ed29860216052a))': + '@effect/sql-pg@4.1.6(effect@4.1.6(patch_hash=c13237f64561426c002130285a9832acc5bb6ab42fd81e020b306429757ddda1))': dependencies: - effect: 4.1.5(patch_hash=14a7acd734809d8dddbf2c19c4ec01fdd2ffae60a612de42b5ed29860216052a) + effect: 4.1.6(patch_hash=c13237f64561426c002130285a9832acc5bb6ab42fd81e020b306429757ddda1) - '@effect/sql-sqlite-do@4.1.5(effect@4.1.5(patch_hash=14a7acd734809d8dddbf2c19c4ec01fdd2ffae60a612de42b5ed29860216052a))': + '@effect/sql-sqlite-do@4.1.6(effect@4.1.6(patch_hash=c13237f64561426c002130285a9832acc5bb6ab42fd81e020b306429757ddda1))': dependencies: - effect: 4.1.5(patch_hash=14a7acd734809d8dddbf2c19c4ec01fdd2ffae60a612de42b5ed29860216052a) + effect: 4.1.6(patch_hash=c13237f64561426c002130285a9832acc5bb6ab42fd81e020b306429757ddda1) '@effect/tsgo-darwin-arm64@0.67.1': optional: true @@ -14643,9 +14643,9 @@ snapshots: '@effect/tsgo-win32-arm64': 0.67.1 '@effect/tsgo-win32-x64': 0.67.1 - '@effect/vitest@4.1.5(patch_hash=dd0bf2b1ae0f63aff0d620ebc67b82d19759b3fa69a608ef85e2a5b40b4d46c5)(@astrojs/compiler-rs@0.5.1)(@types/node@24.12.4)(@vitest/browser-playwright@5.1.1)(@vitest/ui@5.1.1)(@volar/typescript@2.4.28(typescript@6.0.3))(bufferutil@4.1.0)(effect@4.1.5(patch_hash=14a7acd734809d8dddbf2c19c4ec01fdd2ffae60a612de42b5ed29860216052a))(esbuild@0.28.2)(jiti@2.7.0)(jsdom@30.1.0(@noble/hashes@1.8.0))(playwright@1.64.1)(terser@5.48.0)(typescript@6.0.3)(unrun@0.2.39)(utf-8-validate@6.0.6)(yaml@2.9.0)': + '@effect/vitest@4.1.6(patch_hash=f87ba071dd4f5cfa3b1ba14d5d59363e64372cd49af4d8282c322939e6bf3af2)(@astrojs/compiler-rs@0.5.1)(@types/node@24.12.4)(@vitest/browser-playwright@5.1.1)(@vitest/ui@5.1.1)(@volar/typescript@2.4.28(typescript@6.0.3))(bufferutil@4.1.0)(effect@4.1.6(patch_hash=c13237f64561426c002130285a9832acc5bb6ab42fd81e020b306429757ddda1))(esbuild@0.28.2)(jiti@2.7.0)(jsdom@30.1.0(@noble/hashes@1.8.0))(playwright@1.64.1)(terser@5.48.0)(typescript@6.0.3)(unrun@0.2.39)(utf-8-validate@6.0.6)(yaml@2.9.0)': dependencies: - effect: 4.1.5(patch_hash=14a7acd734809d8dddbf2c19c4ec01fdd2ffae60a612de42b5ed29860216052a) + effect: 4.1.6(patch_hash=c13237f64561426c002130285a9832acc5bb6ab42fd81e020b306429757ddda1) vite-plus: 1.8.0(@astrojs/compiler-rs@0.5.1)(@types/node@24.12.4)(@vitest/browser-playwright@5.1.1)(@vitest/ui@5.1.1)(@volar/typescript@2.4.28(typescript@6.0.3))(bufferutil@4.1.0)(esbuild@0.28.2)(jiti@2.7.0)(jsdom@30.1.0(@noble/hashes@1.8.0))(playwright@1.64.1)(terser@5.48.0)(typescript@6.0.3)(unrun@0.2.39)(utf-8-validate@6.0.6)(yaml@2.9.0) transitivePeerDependencies: - '@arethetypeswrong/core' @@ -16152,22 +16152,22 @@ snapshots: dependencies: cross-spawn: 7.0.6 - '@opencode/client@2.0.28(effect@4.1.5(patch_hash=14a7acd734809d8dddbf2c19c4ec01fdd2ffae60a612de42b5ed29860216052a))': + '@opencode/client@2.0.28(effect@4.1.6(patch_hash=c13237f64561426c002130285a9832acc5bb6ab42fd81e020b306429757ddda1))': dependencies: '@opencode/protocol': 2.0.28 '@opencode/schema': 2.0.28 optionalDependencies: - effect: 4.1.5(patch_hash=14a7acd734809d8dddbf2c19c4ec01fdd2ffae60a612de42b5ed29860216052a) + effect: 4.1.6(patch_hash=c13237f64561426c002130285a9832acc5bb6ab42fd81e020b306429757ddda1) '@opencode/protocol@2.0.28': dependencies: '@opencode/schema': 2.0.28 - effect: 4.1.5(patch_hash=14a7acd734809d8dddbf2c19c4ec01fdd2ffae60a612de42b5ed29860216052a) + effect: 4.1.6(patch_hash=c13237f64561426c002130285a9832acc5bb6ab42fd81e020b306429757ddda1) '@opencode/schema@2.0.28': dependencies: '@standard-schema/spec': 1.1.0 - effect: 4.1.5(patch_hash=14a7acd734809d8dddbf2c19c4ec01fdd2ffae60a612de42b5ed29860216052a) + effect: 4.1.6(patch_hash=c13237f64561426c002130285a9832acc5bb6ab42fd81e020b306429757ddda1) '@oslojs/asn1@1.0.0': dependencies: @@ -18249,12 +18249,12 @@ snapshots: json-schema-traverse: 1.0.0 require-from-string: 2.0.2 - alchemy@2.0.0-beta.85(patch_hash=07cc8c7e14b3b9af143ddd40a059f117c27e55139fbf20bd5dde2eb30509cedd)(@effect/platform-bun@4.1.5(bufferutil@4.1.0)(effect@4.1.5(patch_hash=14a7acd734809d8dddbf2c19c4ec01fdd2ffae60a612de42b5ed29860216052a))(utf-8-validate@6.0.6))(@effect/platform-node@4.1.5(bufferutil@4.1.0)(effect@4.1.5(patch_hash=14a7acd734809d8dddbf2c19c4ec01fdd2ffae60a612de42b5ed29860216052a))(redis@6.2.1)(utf-8-validate@6.0.6))(@types/react@19.3.0)(@voidzero-dev/vite-plus-core@8.3.8001(@types/node@24.12.4)(@volar/typescript@2.4.28(typescript@6.0.3))(esbuild@0.28.2)(jiti@2.7.0)(terser@5.48.0)(typescript@6.0.3)(unrun@0.2.39)(yaml@2.9.0))(effect@4.1.5(patch_hash=14a7acd734809d8dddbf2c19c4ec01fdd2ffae60a612de42b5ed29860216052a))(react-devtools-core@6.1.5(bufferutil@4.1.0)(utf-8-validate@6.0.6))(ws@8.22.0(bufferutil@4.1.0)(utf-8-validate@6.0.6)): + alchemy@2.0.0-beta.85(patch_hash=07cc8c7e14b3b9af143ddd40a059f117c27e55139fbf20bd5dde2eb30509cedd)(@effect/platform-bun@4.1.6(bufferutil@4.1.0)(effect@4.1.6(patch_hash=c13237f64561426c002130285a9832acc5bb6ab42fd81e020b306429757ddda1))(utf-8-validate@6.0.6))(@effect/platform-node@4.1.6(bufferutil@4.1.0)(effect@4.1.6(patch_hash=c13237f64561426c002130285a9832acc5bb6ab42fd81e020b306429757ddda1))(redis@6.2.1)(utf-8-validate@6.0.6))(@types/react@19.3.0)(@voidzero-dev/vite-plus-core@8.3.8001(@types/node@24.12.4)(@volar/typescript@2.4.28(typescript@6.0.3))(esbuild@0.28.2)(jiti@2.7.0)(terser@5.48.0)(typescript@6.0.3)(unrun@0.2.39)(yaml@2.9.0))(effect@4.1.6(patch_hash=c13237f64561426c002130285a9832acc5bb6ab42fd81e020b306429757ddda1))(react-devtools-core@6.1.5(bufferutil@4.1.0)(utf-8-validate@6.0.6))(ws@8.22.0(bufferutil@4.1.0)(utf-8-validate@6.0.6)): dependencies: '@alchemy.run/node-utils': 2.0.0-beta.85 '@alchemy.run/sigil': 0.1.0-alpha.1(@types/react@19.3.0)(react-devtools-core@6.1.5(bufferutil@4.1.0)(utf-8-validate@6.0.6)) capnweb: 0.12.0 - effect: 4.1.5(patch_hash=14a7acd734809d8dddbf2c19c4ec01fdd2ffae60a612de42b5ed29860216052a) + effect: 4.1.6(patch_hash=c13237f64561426c002130285a9832acc5bb6ab42fd81e020b306429757ddda1) fflate: 0.8.3 pathe: 2.0.3 picomatch: 4.0.7 @@ -18262,8 +18262,8 @@ snapshots: tinyglobby: 0.2.17 yaml: 2.9.0 optionalDependencies: - '@effect/platform-bun': 4.1.5(bufferutil@4.1.0)(effect@4.1.5(patch_hash=14a7acd734809d8dddbf2c19c4ec01fdd2ffae60a612de42b5ed29860216052a))(utf-8-validate@6.0.6) - '@effect/platform-node': 4.1.5(bufferutil@4.1.0)(effect@4.1.5(patch_hash=14a7acd734809d8dddbf2c19c4ec01fdd2ffae60a612de42b5ed29860216052a))(redis@6.2.1)(utf-8-validate@6.0.6) + '@effect/platform-bun': 4.1.6(bufferutil@4.1.0)(effect@4.1.6(patch_hash=c13237f64561426c002130285a9832acc5bb6ab42fd81e020b306429757ddda1))(utf-8-validate@6.0.6) + '@effect/platform-node': 4.1.6(bufferutil@4.1.0)(effect@4.1.6(patch_hash=c13237f64561426c002130285a9832acc5bb6ab42fd81e020b306429757ddda1))(redis@6.2.1)(utf-8-validate@6.0.6) vite: '@voidzero-dev/vite-plus-core@8.3.8001(@types/node@24.12.4)(@volar/typescript@2.4.28(typescript@6.0.3))(esbuild@0.28.2)(jiti@2.7.0)(terser@5.48.0)(typescript@6.0.3)(unrun@0.2.39)(yaml@2.9.0)' ws: 8.22.0(bufferutil@4.1.0)(utf-8-validate@6.0.6) transitivePeerDependencies: @@ -19220,21 +19220,21 @@ snapshots: dotenv@16.6.1: {} - drizzle-kit@1.0.0-rc.5(1460f90e852e80b46440e9b4378c92e0): + drizzle-kit@1.0.0-rc.5(2e7aae405f975aacb858aa45f3c70a34): optionalDependencies: - drizzle-orm: 1.0.0-rc.5(@cloudflare/workers-types@4.20260604.1)(@effect/sql-d1@4.1.1(effect@4.1.5(patch_hash=14a7acd734809d8dddbf2c19c4ec01fdd2ffae60a612de42b5ed29860216052a)))(@effect/sql-pg@4.1.5(effect@4.1.5(patch_hash=14a7acd734809d8dddbf2c19c4ec01fdd2ffae60a612de42b5ed29860216052a)))(@effect/sql-sqlite-do@4.1.5(effect@4.1.5(patch_hash=14a7acd734809d8dddbf2c19c4ec01fdd2ffae60a612de42b5ed29860216052a)))(@electric-sql/pglite@0.3.15)(@libsql/client@0.17.3(bufferutil@4.1.0)(utf-8-validate@6.0.6))(@types/sql.js@1.4.11)(bun-types@1.3.14)(effect@4.1.5(patch_hash=14a7acd734809d8dddbf2c19c4ec01fdd2ffae60a612de42b5ed29860216052a))(expo-sqlite@58.0.18(expo@58.0.26)(react-native@0.88.1(@babel/core@7.29.7(supports-color@8.1.1))(@react-native/metro-config@0.88.1(@babel/core@7.29.7(supports-color@8.1.1))(bufferutil@4.1.0)(supports-color@8.1.1)(utf-8-validate@6.0.6))(@types/react@19.3.0)(bufferutil@4.1.0)(react@19.3.0)(supports-color@8.1.1)(utf-8-validate@6.0.6))(react@19.3.0))(pg@8.23.0)(sql.js@1.15.0)(zod@4.6.7) + drizzle-orm: 1.0.0-rc.5(@cloudflare/workers-types@4.20260604.1)(@effect/sql-d1@4.1.1(effect@4.1.6(patch_hash=c13237f64561426c002130285a9832acc5bb6ab42fd81e020b306429757ddda1)))(@effect/sql-pg@4.1.6(effect@4.1.6(patch_hash=c13237f64561426c002130285a9832acc5bb6ab42fd81e020b306429757ddda1)))(@effect/sql-sqlite-do@4.1.6(effect@4.1.6(patch_hash=c13237f64561426c002130285a9832acc5bb6ab42fd81e020b306429757ddda1)))(@electric-sql/pglite@0.3.15)(@libsql/client@0.17.3(bufferutil@4.1.0)(utf-8-validate@6.0.6))(@types/sql.js@1.4.11)(bun-types@1.3.14)(effect@4.1.6(patch_hash=c13237f64561426c002130285a9832acc5bb6ab42fd81e020b306429757ddda1))(expo-sqlite@58.0.18(expo@58.0.26)(react-native@0.88.1(@babel/core@7.29.7(supports-color@8.1.1))(@react-native/metro-config@0.88.1(@babel/core@7.29.7(supports-color@8.1.1))(bufferutil@4.1.0)(supports-color@8.1.1)(utf-8-validate@6.0.6))(@types/react@19.3.0)(bufferutil@4.1.0)(react@19.3.0)(supports-color@8.1.1)(utf-8-validate@6.0.6))(react@19.3.0))(pg@8.23.0)(sql.js@1.15.0)(zod@4.6.7) - drizzle-orm@1.0.0-rc.5(@cloudflare/workers-types@4.20260604.1)(@effect/sql-d1@4.1.1(effect@4.1.5(patch_hash=14a7acd734809d8dddbf2c19c4ec01fdd2ffae60a612de42b5ed29860216052a)))(@effect/sql-pg@4.1.5(effect@4.1.5(patch_hash=14a7acd734809d8dddbf2c19c4ec01fdd2ffae60a612de42b5ed29860216052a)))(@effect/sql-sqlite-do@4.1.5(effect@4.1.5(patch_hash=14a7acd734809d8dddbf2c19c4ec01fdd2ffae60a612de42b5ed29860216052a)))(@electric-sql/pglite@0.3.15)(@libsql/client@0.17.3(bufferutil@4.1.0)(utf-8-validate@6.0.6))(@types/sql.js@1.4.11)(bun-types@1.3.14)(effect@4.1.5(patch_hash=14a7acd734809d8dddbf2c19c4ec01fdd2ffae60a612de42b5ed29860216052a))(expo-sqlite@58.0.18(expo@58.0.26)(react-native@0.88.1(@babel/core@7.29.7(supports-color@8.1.1))(@react-native/metro-config@0.88.1(@babel/core@7.29.7(supports-color@8.1.1))(bufferutil@4.1.0)(supports-color@8.1.1)(utf-8-validate@6.0.6))(@types/react@19.3.0)(bufferutil@4.1.0)(react@19.3.0)(supports-color@8.1.1)(utf-8-validate@6.0.6))(react@19.3.0))(pg@8.23.0)(sql.js@1.15.0)(zod@4.6.7): + drizzle-orm@1.0.0-rc.5(@cloudflare/workers-types@4.20260604.1)(@effect/sql-d1@4.1.1(effect@4.1.6(patch_hash=c13237f64561426c002130285a9832acc5bb6ab42fd81e020b306429757ddda1)))(@effect/sql-pg@4.1.6(effect@4.1.6(patch_hash=c13237f64561426c002130285a9832acc5bb6ab42fd81e020b306429757ddda1)))(@effect/sql-sqlite-do@4.1.6(effect@4.1.6(patch_hash=c13237f64561426c002130285a9832acc5bb6ab42fd81e020b306429757ddda1)))(@electric-sql/pglite@0.3.15)(@libsql/client@0.17.3(bufferutil@4.1.0)(utf-8-validate@6.0.6))(@types/sql.js@1.4.11)(bun-types@1.3.14)(effect@4.1.6(patch_hash=c13237f64561426c002130285a9832acc5bb6ab42fd81e020b306429757ddda1))(expo-sqlite@58.0.18(expo@58.0.26)(react-native@0.88.1(@babel/core@7.29.7(supports-color@8.1.1))(@react-native/metro-config@0.88.1(@babel/core@7.29.7(supports-color@8.1.1))(bufferutil@4.1.0)(supports-color@8.1.1)(utf-8-validate@6.0.6))(@types/react@19.3.0)(bufferutil@4.1.0)(react@19.3.0)(supports-color@8.1.1)(utf-8-validate@6.0.6))(react@19.3.0))(pg@8.23.0)(sql.js@1.15.0)(zod@4.6.7): optionalDependencies: '@cloudflare/workers-types': 4.20260604.1 - '@effect/sql-d1': 4.1.1(effect@4.1.5(patch_hash=14a7acd734809d8dddbf2c19c4ec01fdd2ffae60a612de42b5ed29860216052a)) - '@effect/sql-pg': 4.1.5(effect@4.1.5(patch_hash=14a7acd734809d8dddbf2c19c4ec01fdd2ffae60a612de42b5ed29860216052a)) - '@effect/sql-sqlite-do': 4.1.5(effect@4.1.5(patch_hash=14a7acd734809d8dddbf2c19c4ec01fdd2ffae60a612de42b5ed29860216052a)) + '@effect/sql-d1': 4.1.1(effect@4.1.6(patch_hash=c13237f64561426c002130285a9832acc5bb6ab42fd81e020b306429757ddda1)) + '@effect/sql-pg': 4.1.6(effect@4.1.6(patch_hash=c13237f64561426c002130285a9832acc5bb6ab42fd81e020b306429757ddda1)) + '@effect/sql-sqlite-do': 4.1.6(effect@4.1.6(patch_hash=c13237f64561426c002130285a9832acc5bb6ab42fd81e020b306429757ddda1)) '@electric-sql/pglite': 0.3.15 '@libsql/client': 0.17.3(bufferutil@4.1.0)(utf-8-validate@6.0.6) '@types/sql.js': 1.4.11 bun-types: 1.3.14 - effect: 4.1.5(patch_hash=14a7acd734809d8dddbf2c19c4ec01fdd2ffae60a612de42b5ed29860216052a) + effect: 4.1.6(patch_hash=c13237f64561426c002130285a9832acc5bb6ab42fd81e020b306429757ddda1) expo-sqlite: 58.0.18(expo@58.0.26)(react-native@0.88.1(@babel/core@7.29.7(supports-color@8.1.1))(@react-native/metro-config@0.88.1(@babel/core@7.29.7(supports-color@8.1.1))(bufferutil@4.1.0)(supports-color@8.1.1)(utf-8-validate@6.0.6))(@types/react@19.3.0)(bufferutil@4.1.0)(react@19.3.0)(supports-color@8.1.1)(utf-8-validate@6.0.6))(react@19.3.0) pg: 8.23.0 sql.js: 1.15.0 @@ -19275,7 +19275,7 @@ snapshots: ee-first@1.1.1: {} - effect@4.1.5(patch_hash=14a7acd734809d8dddbf2c19c4ec01fdd2ffae60a612de42b5ed29860216052a): {} + effect@4.1.6(patch_hash=c13237f64561426c002130285a9832acc5bb6ab42fd81e020b306429757ddda1): {} ejs@3.1.10: dependencies: diff --git a/pnpm-workspace.yaml b/pnpm-workspace.yaml index de40b81886096..e88b2e5649fbd 100644 --- a/pnpm-workspace.yaml +++ b/pnpm-workspace.yaml @@ -44,15 +44,15 @@ catalog: # Must match the version alchemy depends on: the relay overrides its # Cloudflare retry policy through this package's Retry service. "@distilled.cloud/cloudflare": 1.0.0-rc.18 - "@effect/atom-react": 4.1.5 - "@effect/graphql-generator": 4.1.5 - "@effect/openapi-generator": 4.1.5 - "@effect/platform-bun": 4.1.5 - "@effect/platform-node": 4.1.5 - "@effect/platform-node-shared": 4.1.5 - "@effect/sql-pg": 4.1.5 - "@effect/sql-sqlite-do": 4.1.5 - "@effect/vitest": 4.1.5 + "@effect/atom-react": 4.1.6 + "@effect/graphql-generator": 4.1.6 + "@effect/openapi-generator": 4.1.6 + "@effect/platform-bun": 4.1.6 + "@effect/platform-node": 4.1.6 + "@effect/platform-node-shared": 4.1.6 + "@effect/sql-pg": 4.1.6 + "@effect/sql-sqlite-do": 4.1.6 + "@effect/vitest": 4.1.6 "@electron-webauthn/macos": 1.3.1 "@legendapp/list": 3.9.0 "@noble/curves": 1.9.1 @@ -69,7 +69,7 @@ catalog: "@types/react-dom": ~19.3.0 "@types/ws": 8.18.2 alchemy: 2.0.0-beta.85 - effect: 4.1.5 + effect: 4.1.6 electron-webauthn: 1.3.1 jose: 6.2.2 lightningcss: 1.33.0 @@ -246,7 +246,7 @@ patchedDependencies: expo-network@58.0.5: patches/expo-network@58.0.5.patch "@clerk/expo-native-components@0.4.8": patches/@clerk__expo-native-components@0.4.8.patch "@alchemy.run/test@2.0.0-beta.85": patches/@alchemy.run__test@2.0.0-beta.85.patch - "@effect/vitest@4.1.5": patches/@effect__vitest@4.1.5.patch + "@effect/vitest@4.1.6": patches/@effect__vitest@4.1.6.patch expo-sharing@58.0.23: patches/expo-sharing@58.0.23.patch expo-widgets@58.0.29: patches/expo-widgets@58.0.29.patch # Android: an RNHostView without a scrolling descendant (an app bar's buttons) is no longer the @@ -276,7 +276,7 @@ patchedDependencies: app-builder-lib@26.16.1: patches/app-builder-lib@26.16.1.patch # The spawner takes an injected spawn function (and uses it for taskkill) so Windows launches # can run on worker threads: apps/server/src/process/SpawnWorker.ts. - "@effect/platform-node-shared@4.1.5": patches/@effect__platform-node-shared@4.1.5.patch + "@effect/platform-node-shared@4.1.6": patches/@effect__platform-node-shared@4.1.6.patch # Electron net requests never emit "socket", so upstream's idle timeout never fires and a # stalled update download hangs forever. electron-updater@6.8.9: patches/electron-updater@6.8.9.patch @@ -293,7 +293,7 @@ patchedDependencies: # before the async native write lands. gt-react-native@11.4.18: patches/gt-react-native@11.4.18.patch # The MCP Events extension (SEP-3415) on effect/ai, until Effect ships it. - effect@4.1.5: patches/effect@4.1.5.patch + effect@4.1.6: patches/effect@4.1.6.patch "@generaltranslation/format@0.1.9": patches/@generaltranslation__format@0.1.9.patch gt-i18n@1.0.40: patches/gt-i18n@1.0.40.patch # A browser test's first tester socket can close before opening on a busy runner; the @@ -353,16 +353,16 @@ minimumReleaseAgeExclude: - "@cursor/sdk-linux-x64@1.5.0" - "@cursor/sdk-win32-x64@1.5.0" - "@cursor/sdk@1.5.0" - - "@effect/atom-react@4.1.5" - - "@effect/graphql-generator@4.1.5" - - "@effect/openapi-generator@4.1.5" - - "@effect/platform-bun@4.1.5" - - "@effect/platform-node-shared@4.1.5" - - "@effect/platform-node@4.1.5" - - "@effect/sql-pg@4.1.5" - - "@effect/sql-sqlite-do@4.1.5" - - "@effect/vitest@4.1.5" - - effect@4.1.5 + - "@effect/atom-react@4.1.6" + - "@effect/graphql-generator@4.1.6" + - "@effect/openapi-generator@4.1.6" + - "@effect/platform-bun@4.1.6" + - "@effect/platform-node-shared@4.1.6" + - "@effect/platform-node@4.1.6" + - "@effect/sql-pg@4.1.6" + - "@effect/sql-sqlite-do@4.1.6" + - "@effect/vitest@4.1.6" + - effect@4.1.6 - "@voidzero-dev/vite-plus-core@8.3.8001" - "@voidzero-dev/vite-plus-darwin-arm64@1.8.0" - "@voidzero-dev/vite-plus-darwin-x64@1.8.0" From 155a26ce80a6eeb894c28450081c0dfc68eafc54 Mon Sep 17 00:00:00 2001 From: Julius Marminge <51714798+juliusmarminge@users.noreply.github.com> Date: Fri, 27 Nov 2026 01:01:10 -0800 Subject: [PATCH 3/3] refactor(server): launch commands through Effect's proxy process Effect 4.1.6 ships NodeChildProcessSpawner.layerProxyProcess, the same small long-lived helper our ProcessLauncher ran, so the launcher now builds on it and drops its own IPC protocol and worker. Single executables still host the helper as the __process-launcher subcommand; other builds run it with node -e. The patch keeps a healthy helper from being killed when a busy server reads its reply after the response deadline: the deadline is checked after one more poll, and only a whole silent window counts. Co-Authored-By: Claude Opus 5.5 --- apps/server/src/bin.ts | 6 +- apps/server/src/process-launcher.ts | 3 - apps/server/src/process/ProcessLauncher.ts | 415 ++---------------- .../src/process/processLauncherWorker.ts | 112 ----- apps/server/src/processRunner.test.ts | 174 +------- apps/server/vite.config.ts | 2 +- knip.jsonc | 1 - .../@effect__platform-node-shared@4.1.6.patch | 49 +++ pnpm-lock.yaml | 10 +- 9 files changed, 117 insertions(+), 655 deletions(-) delete mode 100644 apps/server/src/process-launcher.ts delete mode 100644 apps/server/src/process/processLauncherWorker.ts diff --git a/apps/server/src/bin.ts b/apps/server/src/bin.ts index 4bbc5801d2c83..59594c4fa43be 100644 --- a/apps/server/src/bin.ts +++ b/apps/server/src/bin.ts @@ -54,9 +54,9 @@ if ( if (launcher !== undefined && launcherOptions !== undefined) { await launcher.runServiceLauncherCli(launcherOptions); } else if (process.argv[2] === "__process-launcher") { - // Single executables host the launcher here; other builds start process-launcher.mjs directly. - const { runProcessLauncher } = await import("./process/processLauncherWorker.ts"); - runProcessLauncher(); + // Single executables host the launcher here; other builds run it with `node -e`. + const { run } = await import("@effect/platform-node-shared/NodeChildProcessProxy"); + run(); } else { const { runCliCommand } = await loadCliMain(); await runCliCommand(); diff --git a/apps/server/src/process-launcher.ts b/apps/server/src/process-launcher.ts deleted file mode 100644 index 7399bdc7d72ce..0000000000000 --- a/apps/server/src/process-launcher.ts +++ /dev/null @@ -1,3 +0,0 @@ -import { runProcessLauncher } from "./process/processLauncherWorker.ts"; - -runProcessLauncher(); diff --git a/apps/server/src/process/ProcessLauncher.ts b/apps/server/src/process/ProcessLauncher.ts index 397be7c42885d..21f0db5766183 100644 --- a/apps/server/src/process/ProcessLauncher.ts +++ b/apps/server/src/process/ProcessLauncher.ts @@ -1,26 +1,13 @@ -// @effect-diagnostics nodeBuiltinImport:off globalTimers:off - IPC and timer callbacks implement the spawner boundary, as in the native spawner. -import * as NodeChildProcess from "node:child_process"; -import * as NodeEvents from "node:events"; -import type * as NodeNet from "node:net"; -import type * as NodeStream from "node:stream"; import * as NodeChildProcessSpawner from "@effect/platform-node-shared/NodeChildProcessSpawner"; import * as Context from "effect/Context"; -import * as Deferred from "effect/Deferred"; -import * as Duration from "effect/Duration"; +import type * as Duration from "effect/Duration"; import * as Effect from "effect/Effect"; -import * as Exit from "effect/Exit"; import * as Layer from "effect/Layer"; import * as Option from "effect/Option"; -import * as Path from "effect/Path"; import * as ChildProcessSpawner from "effect/process/ChildProcessSpawner"; import * as HostProcess from "@t3tools/shared/HostProcess"; import * as NonBlockingSpawner from "./NonBlockingSpawner.ts"; -import type { LauncherEvent, LauncherSpawnRequest } from "./processLauncherWorker.ts"; - -// A launcher that misses either is treated as hung; neither happens to a healthy one. -const READY_TIMEOUT = "10 seconds"; -const SPAWN_REPLY_TIMEOUT = "10 seconds"; /** * Exposes the active Linux process-launcher helper PID so callers such as port discovery can @@ -32,366 +19,56 @@ export class ProcessLauncher extends Context.Reference<{ defaultValue: () => ({ currentPid: Effect.undefined }), }) {} -/** A child of the launcher, presented to the native spawner as a Node ChildProcess. */ -class HostedChild - extends NodeEvents.EventEmitter - implements NodeChildProcessSpawner.SpawnedChildProcess -{ - pid: number | undefined; - exitCode: number | null = null; - signalCode: NodeJS.Signals | null = null; - stdin: NodeStream.Writable | null = null; - stdout: NodeStream.Readable | null = null; - stderr: NodeStream.Readable | null = null; - readonly stdio: Array = []; - referenced = true; - /** Its pipes are handed over and the native spawner owns it. */ - started = false; - /** No longer awaited: its spawn failed, timed out or it exited. */ - settled = false; - readonly launcher: Launcher; - /** The fds requested as pipes, each of which must arrive before the child counts as started. */ - readonly pipes: ReadonlyArray; - - constructor(launcher: Launcher, stdio: NodeChildProcess.SpawnOptions["stdio"]) { - super(); - this.launcher = launcher; - this.pipes = stdioModes(stdio).flatMap((mode, fd) => (isPipe(mode) ? [fd] : [])); - } - - kill(signal: NodeJS.Signals | number = "SIGTERM"): boolean { - if (this.pid === undefined || this.exitCode !== null || this.signalCode !== null) return false; - try { - process.kill(this.pid, signal); - return true; - } catch { - return false; - } - } - - ref(): void { - this.referenced = true; - syncRef(this.launcher); - } - - unref(): void { - this.referenced = false; - syncRef(this.launcher); - } - - fail(error: Error): void { - this.settled = true; - this.emit("error", error); - } - - exit(code: number | null, signal: NodeJS.Signals | null): void { - this.settled = true; - this.exitCode = code; - this.signalCode = signal; - // Node destroys stdin at exit and drains output nobody reads, so pipes never hold a child. - this.stdin?.destroy(); - this.emit("exit", code, signal); - process.nextTick(() => { - for (const stream of [this.stdout, this.stderr]) { - if ( - stream && - stream.listenerCount("data") === 0 && - stream.listenerCount("readable") === 0 - ) { - stream.resume(); - } - } - }); - } -} - -const stdioModes = (stdio: NodeChildProcess.SpawnOptions["stdio"]) => - typeof stdio === "string" || stdio === undefined ? Array(3).fill(stdio) : stdio; - -const isPipe = (mode: unknown) => - mode === undefined || mode === null || mode === "pipe" || mode === "overlapped"; - -// The launcher's own stdin and stdout are /dev/null, so only pipes and "ignore" mean the same there. -const isHostable = (stdio: NodeChildProcess.SpawnOptions["stdio"]) => - stdioModes(stdio).every((mode) => isPipe(mode) || mode === "ignore"); - -interface Launcher { - readonly worker: NodeChildProcess.ChildProcess; - readonly children: Map; - readonly ready: Deferred.Deferred; - closed: boolean; - /** Counts messages from the launcher, so a slow server is not mistaken for a hung launcher. */ - heard: number; -} - -const syncRef = (launcher: Launcher) => { - if ([...launcher.children.values()].some((child) => child.referenced)) { - launcher.worker.channel?.ref(); - } else { - launcher.worker.channel?.unref(); - } -}; - -const killGroup = (pid: number) => { - try { - process.kill(-pid, "SIGKILL"); - } catch { - // The group is already gone. - } -}; - -const launcherArguments = Effect.fn("ProcessLauncher.launcherArguments")(function* () { - // A single executable has no sibling script, so it hosts the launcher as a hidden subcommand. - if (yield* HostProcess.IsExecutable) return ["__process-launcher"]; - const path = yield* Path.Path; - const fromSource = import.meta.url.endsWith(".ts"); - return [ - ...(fromSource ? ["--experimental-strip-types"] : []), - yield* path - .fromFileUrl( - new URL(fromSource ? "../process-launcher.ts" : "./process-launcher.mjs", import.meta.url), - ) - .pipe(Effect.orDie), - ]; -}); - // On Linux, libuv forks the whole server for every spawn and blocks the event loop while the // kernel copies its page tables, so commands are launched by a small long-lived helper instead. -// The helper passes each child's pipes back, so the native spawner keeps all of its semantics. -export const make = Effect.fn("ProcessLauncher.make")(function* ( - replyTimeout: Duration.Input = SPAWN_REPLY_TIMEOUT, -) { - const fallback = yield* ChildProcessSpawner.ChildProcessSpawner; - if ((yield* HostProcess.Platform) !== "linux") { - return Context.make(ChildProcessSpawner.ChildProcessSpawner, fallback).pipe( - Context.add(ProcessLauncher, { currentPid: Effect.undefined }), - ); - } - - const executablePath = yield* HostProcess.ExecutablePath; - const args = yield* launcherArguments(); - let current: Launcher | undefined; - // A launcher that never starts will not start next time either; stop forking for it. - let unavailable = false; - let warned = false; - let shutDown = false; - let nextId = 0; - - const close = (launcher: Launcher, hung = false) => { - if (launcher.closed) return; - launcher.closed = true; - if (current === launcher) current = undefined; - const ready = Deferred.isDoneUnsafe(launcher.ready); - if (!ready) unavailable = true; - Deferred.doneUnsafe(launcher.ready, Exit.succeed(false)); - const error = new Error( - hung ? "The process launcher did not respond." : "The process launcher exited.", - ); - for (const child of launcher.children.values()) { - if (child.settled) continue; - if (child.pid !== undefined) killGroup(child.pid); - if (child.started) { - child.exit(null, "SIGKILL"); - } else { - for (const stream of child.stdio) stream?.destroy(); - child.fail(error); - } - } - launcher.children.clear(); - if (launcher.worker.connected) launcher.worker.disconnect(); - // A started launcher kills its children and exits once disconnected; a hung one never reads that. - if (hung || !ready) launcher.worker.kill("SIGKILL"); - }; - - const onEvent = ( - launcher: Launcher, - event: LauncherEvent, - socket: NodeNet.Socket | undefined, - ) => { - launcher.heard++; - if (event.type === "ready") { - Deferred.doneUnsafe(launcher.ready, Exit.succeed(true)); - return; - } - const child = launcher.children.get(event.id); - if (child === undefined) { - socket?.destroy(); - return; - } - switch (event.type) { - case "stdio": - if (child.settled) socket?.destroy(); - else if (socket) { - child.stdio[event.fd] = socket; - if (event.fd === 0) { - // Unlike Node's own stdin pipe this socket also reads, and an unread write resets it. - socket.on("error", () => {}); - child.stdin = socket; - } else if (event.fd === 1) child.stdout = socket; - else if (event.fd === 2) child.stderr = socket; - } - break; - case "pid": - child.pid = event.pid; - break; - case "spawn": - // A lost handle would otherwise read as a command that printed nothing. - if (child.pipes.some((fd) => child.stdio[fd] == null)) { - if (child.pid !== undefined) killGroup(child.pid); - for (const stream of child.stdio) stream?.destroy(); - child.fail(new Error("The process launcher did not hand over the command's pipes.")); - break; - } - child.started = true; - child.emit("spawn"); - break; - case "exit": - launcher.children.delete(event.id); - syncRef(launcher); - if (!child.settled) child.exit(event.code, event.signal); - break; - case "error": - if (child.pid !== undefined || child.settled) break; - launcher.children.delete(event.id); - syncRef(launcher); - child.fail(Object.assign(new Error(event.error.message), event.error)); - break; - } - }; - - const launch = (): Launcher | undefined => { - if (unavailable || shutDown) return undefined; - if (current !== undefined) return current; - const env: NodeJS.ProcessEnv = { ...process.env, ELECTRON_RUN_AS_NODE: "1" }; - delete env.NODE_OPTIONS; - // `node --watch` children would report their imports over the launcher's IPC channel. - delete env.WATCH_REPORT_DEPENDENCIES; - let worker: NodeChildProcess.ChildProcess; - try { - worker = NodeChildProcess.spawn(executablePath, args, { - cwd: "/", - env, - stdio: ["ignore", "ignore", "inherit", "ipc"], - }); - } catch { - // Node throws some errnos, such as ENOMEM, instead of emitting "error". - unavailable = true; - return undefined; - } - const launcher: Launcher = { - worker, - children: new Map(), - ready: Deferred.makeUnsafe(), - closed: false, - heard: 0, - }; - worker.unref(); - worker.channel?.unref(); - worker.on("message", (event: LauncherEvent, socket: NodeNet.Socket | undefined) => - onEvent(launcher, event, socket), - ); - worker.on("error", () => close(launcher)); - worker.once("disconnect", () => close(launcher)); - worker.once("exit", () => close(launcher)); - current = launcher; - return launcher; - }; - - const spawnProcess = ( - command: string, - commandArgs: ReadonlyArray, - options: NodeChildProcess.SpawnOptions, - ): NodeChildProcessSpawner.SpawnedChildProcess => { - const launcher = current; - // Lost or replaced between the readiness check and the spawn; rare enough to fork for. - if ( - launcher === undefined || - launcher.closed || - !Deferred.isDoneUnsafe(launcher.ready) || - !isHostable(options.stdio) - ) { - return NodeChildProcess.spawn(command, [...commandArgs], options); - } - const id = ++nextId; - const child = new HostedChild(launcher, options.stdio); - launcher.children.set(id, child); - syncRef(launcher); - const request: LauncherSpawnRequest = { - type: "spawn", - id, - command, - args: commandArgs, - // The launcher runs in `/` with its own environment; children inherit the server's. - options: { ...options, cwd: options.cwd ?? process.cwd(), env: options.env ?? process.env }, - }; - launcher.worker.send(request, (error) => { - if (error) close(launcher); - }); - // The native spawner waits for the reply uninterruptibly, so a hung launcher must not hold it. - // Hung means silent for a whole window; replies queued behind a busy server count once read. - const watch = (heard: number) => - setTimeout( - () => - setImmediate(() => { - if (child.started || child.settled) return; - if (launcher.heard === heard) close(launcher, true); - else watch(launcher.heard); - }), - Duration.toMillis(replyTimeout), - ).unref(); - watch(launcher.heard); - return child; - }; - - // The trampoline keeps a hung cwd or PATH entry from stalling the launcher, and with it every command. - // Fresh: the server has already built this layer around the forking spawner. - const hosted = Context.get( - yield* Layer.build( - Layer.fresh(NonBlockingSpawner.layer).pipe( - Layer.provide(NodeChildProcessSpawner.layerWithSpawn(spawnProcess)), - ), - ), +export const make = Effect.fn("ProcessLauncher.make")(function* (responseTimeout?: Duration.Input) { + const fallback = Context.make( ChildProcessSpawner.ChildProcessSpawner, - ); - - const warnUnavailable = Effect.suspend(() => { - if (!unavailable || warned || shutDown) return Effect.void; - warned = true; - return Effect.logWarning("The process launcher did not start; commands fork the server."); - }); - - const isReady = Effect.suspend(() => { - const launcher = launch(); - if (launcher === undefined) return Effect.as(warnUnavailable, false); - return Deferred.await(launcher.ready).pipe( - Effect.timeoutOption(READY_TIMEOUT), - Effect.map(Option.getOrElse(() => false)), - Effect.tap((ready) => { - if (ready) return Effect.void; - close(launcher); - return warnUnavailable; - }), - ); + yield* ChildProcessSpawner.ChildProcessSpawner, + ).pipe(Context.add(ProcessLauncher, { currentPid: Effect.undefined })); + if ((yield* HostProcess.Platform) !== "linux") return fallback; + + const helper = NodeChildProcessSpawner.layerProxyProcess({ + executable: yield* HostProcess.ExecutablePath, + // A single executable cannot run `-e`, so it hosts the helper as a hidden subcommand of bin.ts. + args: (yield* HostProcess.IsExecutable) ? ["__process-launcher"] : undefined, + env: { + ...(yield* HostProcess.Environment), + ELECTRON_RUN_AS_NODE: "1", + NODE_OPTIONS: undefined, + // `node --watch` children would report their imports over the helper's IPC channel. + WATCH_REPORT_DEPENDENCIES: undefined, + }, + responseTimeout, }); - - yield* Effect.addFinalizer(() => - Effect.sync(() => { - shutDown = true; - if (current) close(current); + // The trampoline keeps a hung cwd or PATH entry from stalling the helper, and with it every command. + // Fresh: the server has already built this layer around the forking spawner. + const launched = Layer.fresh(NonBlockingSpawner.layer).pipe(Layer.provideMerge(helper)); + return yield* Layer.build(launched).pipe( + Effect.map((context) => { + const proxy = Context.get(context, NodeChildProcessSpawner.ProxyProcess); + return Context.make( + ChildProcessSpawner.ChildProcessSpawner, + Context.get(context, ChildProcessSpawner.ChildProcessSpawner), + ).pipe( + Context.add(ProcessLauncher, { + currentPid: Effect.map(proxy.currentPid, Option.getOrUndefined), + }), + ); }), - ); - // Start while the server is still small; the launcher's own fork is the last full-size one. - launch(); - const spawner = ChildProcessSpawner.make((command) => - Effect.flatMap(isReady, (ready) => (ready ? hosted : fallback).spawn(command)), - ); - return Context.make(ChildProcessSpawner.ChildProcessSpawner, spawner).pipe( - Context.add(ProcessLauncher, { currentPid: Effect.sync(() => current?.worker.pid) }), + Effect.catch((error) => + Effect.as( + Effect.logWarning("The process launcher did not start; commands fork the server.", error), + fallback, + ), + ), ); }); -/** Replaces the ChildProcessSpawner in context, which stays the fallback when the launcher cannot start. */ -export const layer = Layer.effectContext(make()); - -/** The server's one spawner: memoized, so every build site shares a single launcher. */ -export const layerServer = layer.pipe(Layer.provide(NonBlockingSpawner.layer)); +/** + * The server's one spawner: memoized, so every build site shares a single launcher. The provided + * spawner stays the fallback when the launcher cannot start. + */ +export const layerServer = Layer.effectContext(make()).pipe( + Layer.provide(NonBlockingSpawner.layer), +); diff --git a/apps/server/src/process/processLauncherWorker.ts b/apps/server/src/process/processLauncherWorker.ts deleted file mode 100644 index 58918127d90ad..0000000000000 --- a/apps/server/src/process/processLauncherWorker.ts +++ /dev/null @@ -1,112 +0,0 @@ -// @effect-diagnostics nodeBuiltinImport:off - the launcher loads only Node builtins so it starts in milliseconds. -import * as NodeChildProcess from "node:child_process"; -import type * as NodeNet from "node:net"; - -export interface LauncherSpawnRequest { - readonly type: "spawn"; - readonly id: number; - readonly command: string; - readonly args: ReadonlyArray; - readonly options: NodeChildProcess.SpawnOptions; -} - -export interface LauncherError { - readonly message: string; - readonly code?: string | undefined; - readonly errno?: number | undefined; - readonly syscall?: string | undefined; - readonly path?: string | undefined; -} - -/** Per child, in order: `pid`, `stdio` per piped fd (carrying its socket), `spawn`, then `exit`; or `error`. */ -export type LauncherEvent = - | { readonly type: "ready" } - | { readonly type: "pid"; readonly id: number; readonly pid: number } - | { readonly type: "stdio"; readonly id: number; readonly fd: number } - | { readonly type: "spawn"; readonly id: number } - | { - readonly type: "exit"; - readonly id: number; - readonly code: number | null; - readonly signal: NodeJS.Signals | null; - } - | { readonly type: "error"; readonly id: number; readonly error: LauncherError }; - -// Leaves out spawnargs; the server's spawner redacts its own copy. -const toLauncherError = (cause: unknown): LauncherError => { - const error = cause as Partial | undefined; - return { - message: typeof error?.message === "string" ? error.message : String(cause), - code: error?.code, - errno: error?.errno, - syscall: error?.syscall, - path: error?.path, - }; -}; - -// Child stdio has no public paused option; this is what net's pauseOnCreate does. -const stopReading = (socket: NodeNet.Socket) => - (socket as unknown as { _handle?: { readStop?: () => void } | null })._handle?.readStop?.(); - -// Bundled import.meta.main is always true; importing this module must have no side effects. -export function runProcessLauncher(): void { - const channel = process.send?.bind(process); - if (!channel) { - process.stderr.write("The process launcher is started by the T3 server.\n"); - process.exitCode = 1; - return; - } - const send = (event: LauncherEvent, socket?: NodeNet.Socket) => - channel(event, socket, undefined, () => {}); - const children = new Map(); - - // Group signals target the server; this process exits when the server's channel closes. - for (const signal of ["SIGINT", "SIGTERM", "SIGHUP"] as const) process.on(signal, () => {}); - process.on("disconnect", () => { - for (const child of children.values()) { - try { - process.kill(-child.pid!, "SIGKILL"); - } catch { - child.kill("SIGKILL"); - } - } - process.exit(0); - }); - - process.on("message", (request: LauncherSpawnRequest) => { - const { id } = request; - let child: NodeChildProcess.ChildProcess; - try { - child = NodeChildProcess.spawn(request.command, [...request.args], request.options); - } catch (cause) { - send({ type: "error", id, error: toLauncherError(cause) }); - return; - } - const stdio = child.stdio.map((socket) => socket as NodeNet.Socket | null); - // The server reads and writes these pipes itself, so no byte may be consumed here. - for (const socket of stdio) if (socket) stopReading(socket); - // Node flushes and destroys a child's stdio at exit, even while a socket waits to be sent. - child.stdin = null; - child.stdout = null; - child.stderr = null; - child.stdio.fill(null); - child.on("error", (cause) => { - if (child.pid === undefined) for (const socket of stdio) socket?.destroy(); - send({ type: "error", id, error: toLauncherError(cause) }); - }); - child.once("spawn", () => { - children.set(id, child); - // First, so the server can kill the child if this process dies while handing over its pipes. - send({ type: "pid", id, pid: child.pid! }); - stdio.forEach((socket, fd) => { - if (socket) send({ type: "stdio", id, fd }, socket); - }); - send({ type: "spawn", id }); - }); - child.once("exit", (code, signal) => { - children.delete(id); - send({ type: "exit", id, code, signal }); - }); - }); - send({ type: "ready" }); -} diff --git a/apps/server/src/processRunner.test.ts b/apps/server/src/processRunner.test.ts index f31d7411c8625..d5cf2df855bd1 100644 --- a/apps/server/src/processRunner.test.ts +++ b/apps/server/src/processRunner.test.ts @@ -1,9 +1,7 @@ -// @effect-diagnostics nodeBuiltinImport:off - A test kills the helper mid-handoff and watches its child through a FIFO. +// @effect-diagnostics nodeBuiltinImport:off - Tests kill the server or its helper and watch commands through a FIFO. import { isWindowsCommandNotFound } from "@t3tools/provider-core/server/snapshotProbe"; import * as NodeChildProcess from "node:child_process"; -import * as NodeFS from "node:fs"; import * as NodeModule from "node:module"; -import * as NodeNet from "node:net"; import * as NodeServices from "@effect/platform-node/NodeServices"; import { describe, expect, it } from "@effect/vitest"; import * as Context from "effect/Context"; @@ -17,7 +15,7 @@ import * as Layer from "effect/Layer"; import * as PlatformError from "effect/PlatformError"; import * as Sink from "effect/Sink"; import * as Stream from "effect/Stream"; -import { ChildProcess, ChildProcessSpawner } from "effect/process"; +import { ChildProcessSpawner } from "effect/process"; import * as HostProcess from "@t3tools/shared/HostProcess"; import { SpawnExecutableResolution } from "@t3tools/shared/shell"; @@ -322,24 +320,6 @@ describe("ProcessRunner.layer", () => { }).pipe(Effect.provide(layerLaunched.pipe(Layer.provide(NodeServices.layer)))), ); - // The helper's stdin and stdout are /dev/null, so inherited stdio must come from the server. - it.live.skipIf(HostProcess.Platform.defaultValue() !== "linux")( - "forks the server for a command that inherits its stdio", - () => - Effect.gen(function* () { - const spawner = yield* ChildProcessSpawner.ChildProcessSpawner; - const handle = yield* spawner.spawn( - ChildProcess.make("sh", ["-c", "echo $PPID >&2"], { stdin: "inherit" }), - ); - const parent = yield* handle.stderr.pipe(Stream.decodeText(), Stream.mkString); - - expect(Number(parent.trim())).toBe(process.pid); - }).pipe( - Effect.scoped, - Effect.provide(ProcessLauncher.layerServer.pipe(Layer.provideMerge(NodeServices.layer))), - ), - ); - // Node throws some spawn errnos, such as ENOMEM, instead of emitting "error". it.live.skipIf(HostProcess.Platform.defaultValue() !== "linux")( "runs commands natively when starting the helper throws", @@ -353,10 +333,7 @@ describe("ProcessRunner.layer", () => { Effect.sync(() => { childProcess.spawn = ((...args: Parameters) => { const launcherArgs = args[1]; - if ( - Array.isArray(launcherArgs) && - launcherArgs.some((arg) => String(arg).includes("process-launcher")) - ) { + if (Array.isArray(launcherArgs) && launcherArgs.includes("--input-type=module")) { throw Object.assign(new Error("spawn ENOMEM"), { code: "ENOMEM" }); } return spawn(...args); @@ -458,135 +435,6 @@ describe("ProcessRunner.layer", () => { }).pipe(Effect.provide(layerLaunched.pipe(Layer.provide(NodeServices.layer)))), ); - // Descendants keep writing after the leader exits; losing the helper must not truncate that. - it.live.skipIf(HostProcess.Platform.defaultValue() !== "linux")( - "delivers output written after the helper process dies", - () => - Effect.gen(function* () { - const fs = yield* FileSystem.FileSystem; - const spawner = yield* ChildProcessSpawner.ChildProcessSpawner; - const handle = yield* spawner.spawn( - ChildProcess.make("sh", [ - "-c", - `d=$(mktemp -d); mkfifo "$d/f"; (cat "$d/f"; rm -r "$d") & echo "$PPID $d/f"`, - ]), - ); - expect(yield* handle.exitCode).toBe(0); - const output = yield* handle.stdout.pipe( - Stream.tap((chunk) => { - const [helper = "", fifo] = new TextDecoder().decode(chunk).trim().split(" "); - if (fifo === undefined) return Effect.void; - process.kill(expectHelperPid(helper), "SIGKILL"); - return fs.writeFileString(fifo, "complete\n"); - }), - Stream.decodeText(), - Stream.mkString, - ); - - expect(output).toMatch(/ \S+\ncomplete\n$/); - }).pipe( - Effect.scoped, - Effect.provide(ProcessLauncher.layer.pipe(Layer.provideMerge(NodeServices.layer))), - ), - ); - - it.live.skipIf(HostProcess.Platform.defaultValue() !== "linux")( - "kills a command whose helper dies while handing over its pipes", - () => - Effect.gen(function* () { - const fs = yield* FileSystem.FileSystem; - const fifo = `${yield* fs.makeTempDirectoryScoped()}/alive`; - NodeChildProcess.execFileSync("mkfifo", [fifo]); - // Reaches EOF once the command, its only writer, is gone. - const alive = new NodeNet.Socket({ - fd: NodeFS.openSync(fifo, NodeFS.constants.O_RDONLY | NodeFS.constants.O_NONBLOCK), - readable: true, - writable: false, - }); - const commandReady = Deferred.makeUnsafe(); - const commandGone = Deferred.makeUnsafe(); - alive.once("data", () => Deferred.doneUnsafe(commandReady, Exit.void)); - alive.once("end", () => Deferred.doneUnsafe(commandGone, Exit.void)); - - const helperPaused = Deferred.makeUnsafe(); - const childProcess: typeof NodeChildProcess = NodeModule.createRequire(import.meta.url)( - "node:child_process", - ); - const spawn = childProcess.spawn; - yield* Effect.acquireRelease( - Effect.sync(() => { - childProcess.spawn = ((...args: Parameters) => { - const helper = spawn(...args); - helper.on("message", (event: { readonly type: string }) => { - if (event.type !== "stdio" || Deferred.isDoneUnsafe(helperPaused)) return; - process.kill(helper.pid!, "SIGSTOP"); - Deferred.doneUnsafe(helperPaused, Exit.succeed(helper.pid!)); - }); - return helper; - }) as typeof spawn; - NodeModule.syncBuiltinESMExports(); - }), - () => - Effect.sync(() => { - childProcess.spawn = spawn; - NodeModule.syncBuiltinESMExports(); - }), - ); - const runner = Context.get(yield* Layer.build(layerLaunched), ProcessRunner.ProcessRunner); - const run = yield* runner - .run({ - command: "sh", - args: ["-c", `exec 3>"$0"; echo ready >&3; exec sleep 1000`, fifo], - }) - .pipe(Effect.forkChild); - const helper = yield* Deferred.await(helperPaused); - yield* Deferred.await(commandReady); - process.kill(helper, "SIGKILL"); - - expect((yield* Effect.flip(Fiber.join(run)))._tag).toBe("ProcessSpawnError"); - yield* Deferred.await(commandGone); - }).pipe(Effect.scoped, Effect.provide(NodeServices.layer)), - ); - - it.live.skipIf(HostProcess.Platform.defaultValue() !== "linux")( - "fails a command whose output pipe never arrives instead of returning no output", - () => - Effect.gen(function* () { - const childProcess: typeof NodeChildProcess = NodeModule.createRequire(import.meta.url)( - "node:child_process", - ); - const spawn = childProcess.spawn; - yield* Effect.acquireRelease( - Effect.sync(() => { - childProcess.spawn = ((...args: Parameters) => { - const helper = spawn(...args); - const emit = helper.emit.bind(helper); - helper.emit = ((event: string, ...rest: Array) => { - const [message, socket] = rest as [{ type?: string; fd?: number }, NodeNet.Socket?]; - if (event !== "message" || message.type !== "stdio" || message.fd !== 1) { - return emit(event, ...rest); - } - socket?.destroy(); - return emit(event, message, undefined); - }) as typeof helper.emit; - return helper; - }) as typeof spawn; - NodeModule.syncBuiltinESMExports(); - }), - () => - Effect.sync(() => { - childProcess.spawn = spawn; - NodeModule.syncBuiltinESMExports(); - }), - ); - const runner = Context.get(yield* Layer.build(layerLaunched), ProcessRunner.ProcessRunner); - - const error = yield* runner.run({ command: "echo", args: ["output"] }).pipe(Effect.flip); - - expect(error._tag).toBe("ProcessSpawnError"); - }).pipe(Effect.scoped, Effect.provide(NodeServices.layer)), - ); - it.live.skipIf(HostProcess.Platform.defaultValue() !== "linux")( "replaces a helper that stops answering", () => @@ -630,12 +478,16 @@ describe("ProcessRunner.layer", () => { Effect.sync(() => { childProcess.spawn = ((...args: Parameters) => { const helper = spawn(...args); - helper.on("message", (event: { readonly type: string }) => { - if (event.type !== "pid" || blocked) return; - blocked = true; - // Holds the server's event loop past the reply deadline, as a loaded server does. - NodeChildProcess.execFileSync("sleep", ["1.5"]); - }); + const send = helper.send.bind(helper); + helper.send = ((message: { readonly command?: string }, ...rest: Array) => { + const sent = send(message, ...rest); + if (message.command !== undefined && !blocked) { + blocked = true; + // Holds the server's event loop past the reply deadline, as a loaded server does. + NodeChildProcess.execFileSync("sleep", ["1.5"]); + } + return sent; + }) as typeof helper.send; return helper; }) as typeof spawn; NodeModule.syncBuiltinESMExports(); diff --git a/apps/server/vite.config.ts b/apps/server/vite.config.ts index 2bec8830d86c5..f8969481c3b20 100644 --- a/apps/server/vite.config.ts +++ b/apps/server/vite.config.ts @@ -115,7 +115,7 @@ export default mergeConfig( ? ["src/bin.ts"] : packExecutable ? ["src/binMain.ts"] - : ["src/bin.ts", "src/claude-history-worker.ts", "src/process-launcher.ts"], + : ["src/bin.ts", "src/claude-history-worker.ts"], outDir: packBootstrap ? "dist-exe" : packExecutable ? cliAssetDir : "dist", sourcemap: !packExecutable, clean: true, diff --git a/knip.jsonc b/knip.jsonc index 57c5c0a28e26e..421f1b2a549dc 100644 --- a/knip.jsonc +++ b/knip.jsonc @@ -57,7 +57,6 @@ "entry": [ "src/bin.ts!", "src/claude-history-worker.ts!", - "src/process-launcher.ts!", "scripts/cli.ts", "scripts/fetch-expo-schema.ts", "scripts/probe-claude-fork-local-rollback-replay.ts", diff --git a/patches/@effect__platform-node-shared@4.1.6.patch b/patches/@effect__platform-node-shared@4.1.6.patch index f6a01b5491c36..ac89bf69ec76e 100644 --- a/patches/@effect__platform-node-shared@4.1.6.patch +++ b/patches/@effect__platform-node-shared@4.1.6.patch @@ -93,3 +93,52 @@ index 0257098..f166bc3 100644 export const layerProxyProcess = options => Layer.effectContext(Effect.gen(function* () { if (globalThis.process.platform === "win32") { return yield* Effect.fail(PlatformError.systemError({ +diff --git a/dist/internal/proxyProcess.js b/dist/internal/proxyProcess.js +index edd291c..a70868f 100644 +--- a/dist/internal/proxyProcess.js ++++ b/dist/internal/proxyProcess.js +@@ -164,6 +164,7 @@ class Proxy { + child; + // Bounds the wait for `Ready`, and for the reply to each sent request + timers = /*#__PURE__*/new Map(); ++ heard = 0; + constructor(options) { + this.options = options; + try { +@@ -295,14 +296,20 @@ class Proxy { + } + startTimer(key) { + const millis = this.options.responseTimeoutMillis; +- const timer = setTimeout(() => { +- this.stop(Object.assign(new Error(`The proxy process did not respond within ${millis} ms`), { +- code: "ETIMEDOUT" +- })); +- }, millis); +- // Whatever waits for the reply keeps the application running +- timer.unref(); +- this.timers.set(key, timer); ++ // Effect-TS/effect#11008: a blocked event loop runs due timers before it reads waiting replies. ++ const arm = heard => { ++ const timer = setTimeout(() => setImmediate(() => { ++ if (this.timers.get(key) !== timer) return; ++ if (this.heard !== heard) return arm(this.heard); ++ this.stop(Object.assign(new Error(`The proxy process did not respond within ${millis} ms`), { ++ code: "ETIMEDOUT" ++ })); ++ }), millis); ++ // Whatever waits for the reply keeps the application running ++ timer.unref(); ++ this.timers.set(key, timer); ++ }; ++ arm(this.heard); + } + stopTimer(key) { + clearTimeout(this.timers.get(key)); +@@ -322,6 +329,7 @@ class Proxy { + } + } + receive(message) { ++ this.heard++; + if (message._tag === "Ready") return this.onReady(); + const command = this.commands.get(message.id); + if (command === undefined) return; diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index e959f195ad519..1a9b9998b8bc5 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -370,7 +370,7 @@ patchedDependencies: '@alchemy.run/test@2.0.0-beta.85': 29c0539ea71d9cc372f0b16558640599beb9bc609605feb2a493da268d72713e '@clerk/expo-native-components@0.4.8': 7a808b92da8460750b85818552e13be3fb73d111691c7db76965970351e124e4 '@cursor/sdk@1.5.0': 7fe8889d7916196c56006cf15a39abba4099feb2c567b4030b82a09364cee500 - '@effect/platform-node-shared@4.1.6': af6bf6e9364037fa069fe80678a04acf389d8d5883600500a7afe5ab0ce6e9bc + '@effect/platform-node-shared@4.1.6': f6aef893f2212c4eaa4fe97f84cead4d6ef7ba1651be51dfe28506578eb970ed '@effect/vitest@4.1.6': f87ba071dd4f5cfa3b1ba14d5d59363e64372cd49af4d8282c322939e6bf3af2 '@exodus/bytes@1.15.1': ceab67463db8cb74dcb2ced48eff4cc8ae9de925ae4cd2173a59a0dfba667bd8 '@expo/ui@58.0.29': 2346ac02073363a401e85357e541055e9737bcbc1cdcb63e056cda9368fa79f6 @@ -875,7 +875,7 @@ importers: version: 4.1.6(bufferutil@4.1.0)(effect@4.1.6(patch_hash=c13237f64561426c002130285a9832acc5bb6ab42fd81e020b306429757ddda1))(redis@6.2.1)(utf-8-validate@6.0.6) '@effect/platform-node-shared': specifier: 4.1.6 - version: 4.1.6(patch_hash=af6bf6e9364037fa069fe80678a04acf389d8d5883600500a7afe5ab0ce6e9bc)(bufferutil@4.1.0)(effect@4.1.6(patch_hash=c13237f64561426c002130285a9832acc5bb6ab42fd81e020b306429757ddda1))(utf-8-validate@6.0.6) + version: 4.1.6(patch_hash=f6aef893f2212c4eaa4fe97f84cead4d6ef7ba1651be51dfe28506578eb970ed)(bufferutil@4.1.0)(effect@4.1.6(patch_hash=c13237f64561426c002130285a9832acc5bb6ab42fd81e020b306429757ddda1))(utf-8-validate@6.0.6) '@ff-labs/fff-node': specifier: 0.11.0 version: 0.11.0(patch_hash=93f62a76399b435a76588b2bef237db0a1e85880c1ac0d0759c416e9cc579252) @@ -14574,13 +14574,13 @@ snapshots: '@effect/platform-bun@4.1.6(bufferutil@4.1.0)(effect@4.1.6(patch_hash=c13237f64561426c002130285a9832acc5bb6ab42fd81e020b306429757ddda1))(utf-8-validate@6.0.6)': dependencies: - '@effect/platform-node-shared': 4.1.6(patch_hash=af6bf6e9364037fa069fe80678a04acf389d8d5883600500a7afe5ab0ce6e9bc)(bufferutil@4.1.0)(effect@4.1.6(patch_hash=c13237f64561426c002130285a9832acc5bb6ab42fd81e020b306429757ddda1))(utf-8-validate@6.0.6) + '@effect/platform-node-shared': 4.1.6(patch_hash=f6aef893f2212c4eaa4fe97f84cead4d6ef7ba1651be51dfe28506578eb970ed)(bufferutil@4.1.0)(effect@4.1.6(patch_hash=c13237f64561426c002130285a9832acc5bb6ab42fd81e020b306429757ddda1))(utf-8-validate@6.0.6) effect: 4.1.6(patch_hash=c13237f64561426c002130285a9832acc5bb6ab42fd81e020b306429757ddda1) transitivePeerDependencies: - bufferutil - utf-8-validate - '@effect/platform-node-shared@4.1.6(patch_hash=af6bf6e9364037fa069fe80678a04acf389d8d5883600500a7afe5ab0ce6e9bc)(bufferutil@4.1.0)(effect@4.1.6(patch_hash=c13237f64561426c002130285a9832acc5bb6ab42fd81e020b306429757ddda1))(utf-8-validate@6.0.6)': + '@effect/platform-node-shared@4.1.6(patch_hash=f6aef893f2212c4eaa4fe97f84cead4d6ef7ba1651be51dfe28506578eb970ed)(bufferutil@4.1.0)(effect@4.1.6(patch_hash=c13237f64561426c002130285a9832acc5bb6ab42fd81e020b306429757ddda1))(utf-8-validate@6.0.6)': dependencies: '@types/ws': 8.18.2 effect: 4.1.6(patch_hash=c13237f64561426c002130285a9832acc5bb6ab42fd81e020b306429757ddda1) @@ -14591,7 +14591,7 @@ snapshots: '@effect/platform-node@4.1.6(bufferutil@4.1.0)(effect@4.1.6(patch_hash=c13237f64561426c002130285a9832acc5bb6ab42fd81e020b306429757ddda1))(redis@6.2.1)(utf-8-validate@6.0.6)': dependencies: - '@effect/platform-node-shared': 4.1.6(patch_hash=af6bf6e9364037fa069fe80678a04acf389d8d5883600500a7afe5ab0ce6e9bc)(bufferutil@4.1.0)(effect@4.1.6(patch_hash=c13237f64561426c002130285a9832acc5bb6ab42fd81e020b306429757ddda1))(utf-8-validate@6.0.6) + '@effect/platform-node-shared': 4.1.6(patch_hash=f6aef893f2212c4eaa4fe97f84cead4d6ef7ba1651be51dfe28506578eb970ed)(bufferutil@4.1.0)(effect@4.1.6(patch_hash=c13237f64561426c002130285a9832acc5bb6ab42fd81e020b306429757ddda1))(utf-8-validate@6.0.6) effect: 4.1.6(patch_hash=c13237f64561426c002130285a9832acc5bb6ab42fd81e020b306429757ddda1) redis: 6.2.1 undici: 8.12.4