effect 4.0.0-beta.103 → 4.0.0-beta.105
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/AGENTS.md +381 -0
- package/CLAUDE.md +381 -0
- package/ai-docs/README.md +44 -0
- package/ai-docs/package.json +36 -0
- package/ai-docs/src/01_effect/01_basics/01_effect-gen.ts +30 -0
- package/ai-docs/src/01_effect/01_basics/02_effect-fn.ts +39 -0
- package/ai-docs/src/01_effect/01_basics/10_creating-effects.ts +74 -0
- package/ai-docs/src/01_effect/01_basics/index.md +5 -0
- package/ai-docs/src/01_effect/02_schema/10_schema-basics.ts +43 -0
- package/ai-docs/src/01_effect/02_schema/index.md +7 -0
- package/ai-docs/src/01_effect/03_services/01_service.ts +45 -0
- package/ai-docs/src/01_effect/03_services/10_reference.ts +10 -0
- package/ai-docs/src/01_effect/03_services/20_layer-composition.ts +70 -0
- package/ai-docs/src/01_effect/03_services/20_layer-unwrap.ts +66 -0
- package/ai-docs/src/01_effect/03_services/index.md +5 -0
- package/ai-docs/src/01_effect/04_errors/01_error-handling.ts +30 -0
- package/ai-docs/src/01_effect/04_errors/10_catch-tags.ts +24 -0
- package/ai-docs/src/01_effect/04_errors/20_reason-errors.ts +64 -0
- package/ai-docs/src/01_effect/04_errors/index.md +1 -0
- package/ai-docs/src/01_effect/05_resources/10_acquire-release.ts +105 -0
- package/ai-docs/src/01_effect/05_resources/20_layer-side-effects.ts +31 -0
- package/ai-docs/src/01_effect/05_resources/30_layer-map.ts +86 -0
- package/ai-docs/src/01_effect/05_resources/index.md +3 -0
- package/ai-docs/src/01_effect/06_running/10_run-main.ts +30 -0
- package/ai-docs/src/01_effect/06_running/20_layer-launch.ts +27 -0
- package/ai-docs/src/01_effect/06_running/index.md +1 -0
- package/ai-docs/src/01_effect/07_pubsub/10_pubsub.ts +56 -0
- package/ai-docs/src/01_effect/07_pubsub/index.md +3 -0
- package/ai-docs/src/03_stream/10_creating-streams.ts +103 -0
- package/ai-docs/src/03_stream/20_consuming-streams.ts +137 -0
- package/ai-docs/src/03_stream/30_encoding.ts +165 -0
- package/ai-docs/src/03_stream/index.md +4 -0
- package/ai-docs/src/04_integration/10_managed-runtime.ts +129 -0
- package/ai-docs/src/04_integration/index.md +5 -0
- package/ai-docs/src/05_batching/10_request-resolver.ts +89 -0
- package/ai-docs/src/05_batching/index.md +3 -0
- package/ai-docs/src/06_schedule/10_schedules.ts +110 -0
- package/ai-docs/src/06_schedule/index.md +3 -0
- package/ai-docs/src/07_datetime/10_creating-and-formatting.ts +30 -0
- package/ai-docs/src/07_datetime/20_time-zones.ts +44 -0
- package/ai-docs/src/07_datetime/index.md +5 -0
- package/ai-docs/src/08_observability/10_logging.ts +66 -0
- package/ai-docs/src/08_observability/20_otlp-tracing.ts +95 -0
- package/ai-docs/src/08_observability/index.md +7 -0
- package/ai-docs/src/09_testing/10_effect-tests.ts +55 -0
- package/ai-docs/src/09_testing/20_layer-tests.ts +138 -0
- package/ai-docs/src/09_testing/index.md +1 -0
- package/ai-docs/src/10_predicate/01_basics.ts +14 -0
- package/ai-docs/src/10_predicate/index.md +9 -0
- package/ai-docs/src/50_http-client/10_basics.ts +102 -0
- package/ai-docs/src/50_http-client/index.md +3 -0
- package/ai-docs/src/51_http-server/10_basics.ts +116 -0
- package/ai-docs/src/51_http-server/fixtures/api/Api.ts +14 -0
- package/ai-docs/src/51_http-server/fixtures/api/Authorization.ts +36 -0
- package/ai-docs/src/51_http-server/fixtures/api/System.ts +10 -0
- package/ai-docs/src/51_http-server/fixtures/api/Users.ts +91 -0
- package/ai-docs/src/51_http-server/fixtures/domain/User.ts +12 -0
- package/ai-docs/src/51_http-server/fixtures/domain/UserErrors.ts +22 -0
- package/ai-docs/src/51_http-server/fixtures/server/Authorization.ts +36 -0
- package/ai-docs/src/51_http-server/fixtures/server/Users/http.ts +71 -0
- package/ai-docs/src/51_http-server/fixtures/server/Users.ts +62 -0
- package/ai-docs/src/51_http-server/index.md +3 -0
- package/ai-docs/src/60_child-process/10_working-with-child-processes.ts +117 -0
- package/ai-docs/src/60_child-process/index.md +3 -0
- package/ai-docs/src/70_cli/10_basics.ts +136 -0
- package/ai-docs/src/70_cli/index.md +5 -0
- package/ai-docs/src/71_ai/10_language-model.ts +156 -0
- package/ai-docs/src/71_ai/20_tools.ts +226 -0
- package/ai-docs/src/71_ai/30_chat.ts +158 -0
- package/ai-docs/src/71_ai/fixtures/domain/LaunchPlan.ts +9 -0
- package/ai-docs/src/71_ai/index.md +5 -0
- package/ai-docs/src/80_cluster/10_entities.ts +97 -0
- package/ai-docs/src/80_cluster/index.md +4 -0
- package/ai-docs/src/index.md +10 -0
- package/ai-docs/tsconfig.json +24 -0
- package/dist/Brand.d.ts +3 -3
- package/dist/Brand.d.ts.map +1 -1
- package/dist/Brand.js +4 -3
- package/dist/Brand.js.map +1 -1
- package/dist/Cache.js +1 -1
- package/dist/Cache.js.map +1 -1
- package/dist/Channel.d.ts +1 -1
- package/dist/Channel.d.ts.map +1 -1
- package/dist/Channel.js.map +1 -1
- package/dist/Config.d.ts.map +1 -1
- package/dist/Config.js +30 -8
- package/dist/Config.js.map +1 -1
- package/dist/ConfigProvider.d.ts.map +1 -1
- package/dist/ConfigProvider.js +2 -1
- package/dist/ConfigProvider.js.map +1 -1
- package/dist/Context.d.ts +2 -3
- package/dist/Context.d.ts.map +1 -1
- package/dist/Context.js +1 -22
- package/dist/Context.js.map +1 -1
- package/dist/Cron.d.ts +31 -0
- package/dist/Cron.d.ts.map +1 -1
- package/dist/Cron.js +58 -2
- package/dist/Cron.js.map +1 -1
- package/dist/Crypto.d.ts.map +1 -1
- package/dist/Crypto.js +13 -5
- package/dist/Crypto.js.map +1 -1
- package/dist/Duration.d.ts.map +1 -1
- package/dist/Duration.js +12 -1
- package/dist/Duration.js.map +1 -1
- package/dist/Effect.d.ts +132 -14
- package/dist/Effect.d.ts.map +1 -1
- package/dist/Effect.js +38 -0
- package/dist/Effect.js.map +1 -1
- package/dist/Equal.d.ts.map +1 -1
- package/dist/Equal.js +10 -2
- package/dist/Equal.js.map +1 -1
- package/dist/ExecutionPlan.d.ts +73 -0
- package/dist/ExecutionPlan.d.ts.map +1 -1
- package/dist/ExecutionPlan.js +1 -1
- package/dist/ExecutionPlan.js.map +1 -1
- package/dist/FiberSet.js +1 -1
- package/dist/FileSystem.d.ts +2 -2
- package/dist/Function.d.ts +4 -3
- package/dist/Function.d.ts.map +1 -1
- package/dist/Function.js +5 -5
- package/dist/Function.js.map +1 -1
- package/dist/Iterable.d.ts.map +1 -1
- package/dist/Iterable.js +11 -10
- package/dist/Iterable.js.map +1 -1
- package/dist/Layer.d.ts.map +1 -1
- package/dist/Layer.js +7 -5
- package/dist/Layer.js.map +1 -1
- package/dist/Optic.d.ts +35 -21
- package/dist/Optic.d.ts.map +1 -1
- package/dist/Optic.js +33 -34
- package/dist/Optic.js.map +1 -1
- package/dist/Schedule.d.ts +8 -8
- package/dist/Schedule.d.ts.map +1 -1
- package/dist/Schedule.js +4 -4
- package/dist/Schedule.js.map +1 -1
- package/dist/Schema.d.ts +105 -57
- package/dist/Schema.d.ts.map +1 -1
- package/dist/Schema.js +105 -67
- package/dist/Schema.js.map +1 -1
- package/dist/SchemaAST.d.ts +33 -3
- package/dist/SchemaAST.d.ts.map +1 -1
- package/dist/SchemaAST.js +87 -63
- package/dist/SchemaAST.js.map +1 -1
- package/dist/SchemaError.d.ts +8 -8
- package/dist/SchemaError.d.ts.map +1 -1
- package/dist/SchemaError.js +7 -6
- package/dist/SchemaError.js.map +1 -1
- package/dist/SchemaGetter.d.ts +8 -5
- package/dist/SchemaGetter.d.ts.map +1 -1
- package/dist/SchemaGetter.js +41 -37
- package/dist/SchemaGetter.js.map +1 -1
- package/dist/SchemaIssue.d.ts +195 -38
- package/dist/SchemaIssue.d.ts.map +1 -1
- package/dist/SchemaIssue.js +243 -68
- package/dist/SchemaIssue.js.map +1 -1
- package/dist/SchemaParser.d.ts +30 -0
- package/dist/SchemaParser.d.ts.map +1 -1
- package/dist/SchemaParser.js +74 -62
- package/dist/SchemaParser.js.map +1 -1
- package/dist/SchemaTransformation.d.ts +2 -2
- package/dist/SchemaTransformation.d.ts.map +1 -1
- package/dist/SchemaTransformation.js +26 -26
- package/dist/SchemaTransformation.js.map +1 -1
- package/dist/ScopedCache.js +1 -1
- package/dist/ScopedCache.js.map +1 -1
- package/dist/Sink.d.ts +1 -1
- package/dist/Sink.d.ts.map +1 -1
- package/dist/Stdio.d.ts +17 -4
- package/dist/Stdio.d.ts.map +1 -1
- package/dist/Stdio.js +6 -3
- package/dist/Stdio.js.map +1 -1
- package/dist/Stream.d.ts +27 -4
- package/dist/Stream.d.ts.map +1 -1
- package/dist/Stream.js +27 -2
- package/dist/Stream.js.map +1 -1
- package/dist/SynchronizedRef.js +1 -1
- package/dist/SynchronizedRef.js.map +1 -1
- package/dist/Terminal.js +1 -1
- package/dist/Terminal.js.map +1 -1
- package/dist/Tuple.d.ts +6 -4
- package/dist/Tuple.d.ts.map +1 -1
- package/dist/Tuple.js.map +1 -1
- package/dist/TxReentrantLock.d.ts +0 -56
- package/dist/TxReentrantLock.d.ts.map +1 -1
- package/dist/TxReentrantLock.js +8 -8
- package/dist/TxReentrantLock.js.map +1 -1
- package/dist/internal/dateTime.js +1 -1
- package/dist/internal/dateTime.js.map +1 -1
- package/dist/internal/executionPlan.js +51 -3
- package/dist/internal/executionPlan.js.map +1 -1
- package/dist/internal/hashMap.js +12 -8
- package/dist/internal/hashMap.js.map +1 -1
- package/dist/internal/matcher.js +1 -1
- package/dist/internal/matcher.js.map +1 -1
- package/dist/internal/schedule.js.map +1 -1
- package/dist/internal/schema/annotations.js +2 -0
- package/dist/internal/schema/annotations.js.map +1 -1
- package/dist/internal/schema/schema.js +1 -9
- package/dist/internal/schema/schema.js.map +1 -1
- package/dist/internal/schema/toArbitrary.js +1 -1
- package/dist/internal/schema/toArbitrary.js.map +1 -1
- package/dist/internal/trie.js +13 -3
- package/dist/internal/trie.js.map +1 -1
- package/dist/testing/TestClock.d.ts.map +1 -1
- package/dist/testing/TestClock.js +11 -1
- package/dist/testing/TestClock.js.map +1 -1
- package/dist/testing/TestSchema.d.ts +2 -2
- package/dist/testing/TestSchema.d.ts.map +1 -1
- package/dist/testing/TestSchema.js +8 -7
- package/dist/testing/TestSchema.js.map +1 -1
- package/dist/unstable/ai/AiError.js +19 -19
- package/dist/unstable/ai/AiError.js.map +1 -1
- package/dist/unstable/ai/Chat.js +1 -1
- package/dist/unstable/ai/Chat.js.map +1 -1
- package/dist/unstable/ai/LanguageModel.js +4 -2
- package/dist/unstable/ai/LanguageModel.js.map +1 -1
- package/dist/unstable/ai/McpSchema.d.ts +132 -132
- package/dist/unstable/ai/McpSchema.d.ts.map +1 -1
- package/dist/unstable/ai/McpSchema.js +8 -8
- package/dist/unstable/ai/McpSchema.js.map +1 -1
- package/dist/unstable/ai/McpServer.js +1 -1
- package/dist/unstable/ai/McpServer.js.map +1 -1
- package/dist/unstable/ai/Prompt.d.ts +15 -3
- package/dist/unstable/ai/Prompt.d.ts.map +1 -1
- package/dist/unstable/ai/Prompt.js +10 -7
- package/dist/unstable/ai/Prompt.js.map +1 -1
- package/dist/unstable/cli/CliError.d.ts +3 -3
- package/dist/unstable/cli/CliError.js +11 -11
- package/dist/unstable/cli/CliError.js.map +1 -1
- package/dist/unstable/cli/Command.d.ts +9 -9
- package/dist/unstable/cli/Command.d.ts.map +1 -1
- package/dist/unstable/cli/Command.js +8 -6
- package/dist/unstable/cli/Command.js.map +1 -1
- package/dist/unstable/cli/Param.d.ts +7 -5
- package/dist/unstable/cli/Param.d.ts.map +1 -1
- package/dist/unstable/cli/Param.js +15 -11
- package/dist/unstable/cli/Param.js.map +1 -1
- package/dist/unstable/cli/Primitive.d.ts.map +1 -1
- package/dist/unstable/cli/Primitive.js +31 -24
- package/dist/unstable/cli/Primitive.js.map +1 -1
- package/dist/unstable/cli/Prompt.d.ts.map +1 -1
- package/dist/unstable/cli/Prompt.js +31 -17
- package/dist/unstable/cli/Prompt.js.map +1 -1
- package/dist/unstable/cli/internal/ansi.js +2 -2
- package/dist/unstable/cli/internal/ansi.js.map +1 -1
- package/dist/unstable/cli/internal/command.d.ts +2 -2
- package/dist/unstable/cli/internal/command.d.ts.map +1 -1
- package/dist/unstable/cli/internal/command.js +10 -9
- package/dist/unstable/cli/internal/command.js.map +1 -1
- package/dist/unstable/cli/internal/completions/bash.js +69 -9
- package/dist/unstable/cli/internal/completions/bash.js.map +1 -1
- package/dist/unstable/cli/internal/completions/descriptor.js +24 -18
- package/dist/unstable/cli/internal/completions/descriptor.js.map +1 -1
- package/dist/unstable/cli/internal/completions/fish.js +5 -5
- package/dist/unstable/cli/internal/completions/fish.js.map +1 -1
- package/dist/unstable/cli/internal/help.d.ts.map +1 -1
- package/dist/unstable/cli/internal/help.js +4 -2
- package/dist/unstable/cli/internal/help.js.map +1 -1
- package/dist/unstable/cli/internal/parser.js +3 -3
- package/dist/unstable/cli/internal/parser.js.map +1 -1
- package/dist/unstable/cli/internal/wizard.js +2 -2
- package/dist/unstable/cli/internal/wizard.js.map +1 -1
- package/dist/unstable/cluster/ClusterError.js +7 -7
- package/dist/unstable/cluster/ClusterError.js.map +1 -1
- package/dist/unstable/cluster/ClusterWorkflowEngine.d.ts.map +1 -1
- package/dist/unstable/cluster/ClusterWorkflowEngine.js +1 -1
- package/dist/unstable/cluster/ClusterWorkflowEngine.js.map +1 -1
- package/dist/unstable/cluster/MessageStorage.d.ts.map +1 -1
- package/dist/unstable/cluster/MessageStorage.js +8 -1
- package/dist/unstable/cluster/MessageStorage.js.map +1 -1
- package/dist/unstable/cluster/Reply.d.ts +8 -0
- package/dist/unstable/cluster/Reply.d.ts.map +1 -1
- package/dist/unstable/cluster/Reply.js +16 -4
- package/dist/unstable/cluster/Reply.js.map +1 -1
- package/dist/unstable/cluster/RunnerServer.d.ts.map +1 -1
- package/dist/unstable/cluster/RunnerServer.js +4 -2
- package/dist/unstable/cluster/RunnerServer.js.map +1 -1
- package/dist/unstable/cluster/RunnerStorage.d.ts +1 -2
- package/dist/unstable/cluster/RunnerStorage.d.ts.map +1 -1
- package/dist/unstable/cluster/RunnerStorage.js +7 -6
- package/dist/unstable/cluster/RunnerStorage.js.map +1 -1
- package/dist/unstable/cluster/Sharding.d.ts.map +1 -1
- package/dist/unstable/cluster/Sharding.js +22 -4
- package/dist/unstable/cluster/Sharding.js.map +1 -1
- package/dist/unstable/cluster/internal/entityManager.js +1 -1
- package/dist/unstable/cluster/internal/entityManager.js.map +1 -1
- package/dist/unstable/cluster/internal/resourceMap.js +2 -2
- package/dist/unstable/cluster/internal/resourceMap.js.map +1 -1
- package/dist/unstable/cluster/internal/resourceRef.js +17 -0
- package/dist/unstable/cluster/internal/resourceRef.js.map +1 -1
- package/dist/unstable/devtools/DevToolsClient.d.ts.map +1 -1
- package/dist/unstable/devtools/DevToolsClient.js +7 -2
- package/dist/unstable/devtools/DevToolsClient.js.map +1 -1
- package/dist/unstable/encoding/Ini.d.ts +20 -0
- package/dist/unstable/encoding/Ini.d.ts.map +1 -0
- package/dist/unstable/encoding/Ini.js +153 -0
- package/dist/unstable/encoding/Ini.js.map +1 -0
- package/dist/unstable/encoding/Msgpack.d.ts +2 -1
- package/dist/unstable/encoding/Msgpack.d.ts.map +1 -1
- package/dist/unstable/encoding/Msgpack.js +27 -13
- package/dist/unstable/encoding/Msgpack.js.map +1 -1
- package/dist/unstable/encoding/Ndjson.d.ts.map +1 -1
- package/dist/unstable/encoding/Ndjson.js +7 -1
- package/dist/unstable/encoding/Ndjson.js.map +1 -1
- package/dist/unstable/encoding/Sse.d.ts.map +1 -1
- package/dist/unstable/encoding/Sse.js +14 -23
- package/dist/unstable/encoding/Sse.js.map +1 -1
- package/dist/unstable/encoding/Toml.d.ts +19 -0
- package/dist/unstable/encoding/Toml.d.ts.map +1 -0
- package/dist/unstable/encoding/Toml.js +434 -0
- package/dist/unstable/encoding/Toml.js.map +1 -0
- package/dist/unstable/encoding/Yaml.d.ts +19 -0
- package/dist/unstable/encoding/Yaml.d.ts.map +1 -0
- package/dist/unstable/encoding/Yaml.js +461 -0
- package/dist/unstable/encoding/Yaml.js.map +1 -0
- package/dist/unstable/encoding/index.d.ts +12 -0
- package/dist/unstable/encoding/index.d.ts.map +1 -1
- package/dist/unstable/encoding/index.js +12 -0
- package/dist/unstable/encoding/index.js.map +1 -1
- package/dist/unstable/eventlog/EventJournal.d.ts +1 -1
- package/dist/unstable/eventlog/EventJournal.d.ts.map +1 -1
- package/dist/unstable/eventlog/EventJournal.js +13 -5
- package/dist/unstable/eventlog/EventJournal.js.map +1 -1
- package/dist/unstable/eventlog/EventLogMessage.js +1 -1
- package/dist/unstable/eventlog/EventLogMessage.js.map +1 -1
- package/dist/unstable/eventlog/EventLogServerUnencrypted.js +1 -1
- package/dist/unstable/eventlog/EventLogServerUnencrypted.js.map +1 -1
- package/dist/unstable/eventlog/SqlEventJournal.d.ts.map +1 -1
- package/dist/unstable/eventlog/SqlEventJournal.js +1 -4
- package/dist/unstable/eventlog/SqlEventJournal.js.map +1 -1
- package/dist/unstable/http/FindMyWay/internal/queryString.d.ts +11 -0
- package/dist/unstable/http/FindMyWay/internal/queryString.d.ts.map +1 -0
- package/dist/unstable/http/FindMyWay/internal/queryString.js +259 -0
- package/dist/unstable/http/FindMyWay/internal/queryString.js.map +1 -0
- package/dist/unstable/http/FindMyWay/internal/router.d.ts +2 -0
- package/dist/unstable/http/FindMyWay/internal/router.d.ts.map +1 -0
- package/dist/unstable/http/FindMyWay/internal/router.js +665 -0
- package/dist/unstable/http/FindMyWay/internal/router.js.map +1 -0
- package/dist/unstable/http/FindMyWay.d.ts +33 -8
- package/dist/unstable/http/FindMyWay.d.ts.map +1 -1
- package/dist/unstable/http/FindMyWay.js +4 -7
- package/dist/unstable/http/FindMyWay.js.map +1 -1
- package/dist/unstable/http/HttpClient.d.ts +59 -3
- package/dist/unstable/http/HttpClient.d.ts.map +1 -1
- package/dist/unstable/http/HttpClient.js +33 -19
- package/dist/unstable/http/HttpClient.js.map +1 -1
- package/dist/unstable/http/HttpClientError.js +1 -1
- package/dist/unstable/http/HttpClientError.js.map +1 -1
- package/dist/unstable/http/HttpClientRequest.d.ts.map +1 -1
- package/dist/unstable/http/HttpClientRequest.js +2 -14
- package/dist/unstable/http/HttpClientRequest.js.map +1 -1
- package/dist/unstable/http/HttpClientResponse.js +1 -16
- package/dist/unstable/http/HttpClientResponse.js.map +1 -1
- package/dist/unstable/http/HttpPlatform.d.ts.map +1 -1
- package/dist/unstable/http/HttpPlatform.js +21 -3
- package/dist/unstable/http/HttpPlatform.js.map +1 -1
- package/dist/unstable/http/HttpServerRequest.d.ts.map +1 -1
- package/dist/unstable/http/HttpServerRequest.js +7 -6
- package/dist/unstable/http/HttpServerRequest.js.map +1 -1
- package/dist/unstable/http/HttpServerResponse.d.ts.map +1 -1
- package/dist/unstable/http/HttpServerResponse.js +8 -6
- package/dist/unstable/http/HttpServerResponse.js.map +1 -1
- package/dist/unstable/http/Multipart.d.ts +1 -1
- package/dist/unstable/http/Multipart.d.ts.map +1 -1
- package/dist/unstable/http/Multipart.js +9 -2
- package/dist/unstable/http/Multipart.js.map +1 -1
- package/dist/unstable/http/MultipartParser/HeadersParser.d.ts +53 -0
- package/dist/unstable/http/MultipartParser/HeadersParser.d.ts.map +1 -0
- package/dist/unstable/http/MultipartParser/HeadersParser.js +14 -0
- package/dist/unstable/http/MultipartParser/HeadersParser.js.map +1 -0
- package/dist/unstable/http/MultipartParser/Search.d.ts +11 -0
- package/dist/unstable/http/MultipartParser/Search.d.ts.map +1 -0
- package/dist/unstable/http/MultipartParser/Search.js +14 -0
- package/dist/unstable/http/MultipartParser/Search.js.map +1 -0
- package/dist/unstable/http/MultipartParser/internal/contentType.d.ts +5 -0
- package/dist/unstable/http/MultipartParser/internal/contentType.d.ts.map +1 -0
- package/dist/unstable/http/MultipartParser/internal/contentType.js +82 -0
- package/dist/unstable/http/MultipartParser/internal/contentType.js.map +1 -0
- package/dist/unstable/http/MultipartParser/internal/headers.d.ts +3 -0
- package/dist/unstable/http/MultipartParser/internal/headers.d.ts.map +1 -0
- package/dist/unstable/http/MultipartParser/internal/headers.js +194 -0
- package/dist/unstable/http/MultipartParser/internal/headers.js.map +1 -0
- package/dist/unstable/http/MultipartParser/internal/multipart.d.ts +8 -0
- package/dist/unstable/http/MultipartParser/internal/multipart.d.ts.map +1 -0
- package/dist/unstable/http/MultipartParser/internal/multipart.js +226 -0
- package/dist/unstable/http/MultipartParser/internal/multipart.js.map +1 -0
- package/dist/unstable/http/MultipartParser/internal/search.d.ts +5 -0
- package/dist/unstable/http/MultipartParser/internal/search.d.ts.map +1 -0
- package/dist/unstable/http/MultipartParser/internal/search.js +120 -0
- package/dist/unstable/http/MultipartParser/internal/search.js.map +1 -0
- package/dist/unstable/http/MultipartParser.d.ts +98 -0
- package/dist/unstable/http/MultipartParser.d.ts.map +1 -0
- package/dist/unstable/http/MultipartParser.js +23 -0
- package/dist/unstable/http/MultipartParser.js.map +1 -0
- package/dist/unstable/http/Template.d.ts.map +1 -1
- package/dist/unstable/http/Template.js +2 -2
- package/dist/unstable/http/Template.js.map +1 -1
- package/dist/unstable/http/index.d.ts +1 -1
- package/dist/unstable/http/index.d.ts.map +1 -1
- package/dist/unstable/http/index.js +1 -1
- package/dist/unstable/http/index.js.map +1 -1
- package/dist/unstable/http/internal/httpBody.d.ts +2 -0
- package/dist/unstable/http/internal/httpBody.d.ts.map +1 -0
- package/dist/unstable/http/internal/httpBody.js +10 -0
- package/dist/unstable/http/internal/httpBody.js.map +1 -0
- package/dist/unstable/httpapi/HttpApi.d.ts.map +1 -1
- package/dist/unstable/httpapi/HttpApi.js +5 -5
- package/dist/unstable/httpapi/HttpApi.js.map +1 -1
- package/dist/unstable/httpapi/HttpApiBuilder.js +73 -20
- package/dist/unstable/httpapi/HttpApiBuilder.js.map +1 -1
- package/dist/unstable/httpapi/HttpApiClient.d.ts +1 -1
- package/dist/unstable/httpapi/HttpApiClient.d.ts.map +1 -1
- package/dist/unstable/httpapi/HttpApiClient.js +74 -34
- package/dist/unstable/httpapi/HttpApiClient.js.map +1 -1
- package/dist/unstable/httpapi/HttpApiEndpoint.d.ts +6 -4
- package/dist/unstable/httpapi/HttpApiEndpoint.d.ts.map +1 -1
- package/dist/unstable/httpapi/HttpApiEndpoint.js +73 -16
- package/dist/unstable/httpapi/HttpApiEndpoint.js.map +1 -1
- package/dist/unstable/httpapi/HttpApiError.d.ts +5 -5
- package/dist/unstable/httpapi/HttpApiError.d.ts.map +1 -1
- package/dist/unstable/httpapi/HttpApiError.js +17 -17
- package/dist/unstable/httpapi/HttpApiError.js.map +1 -1
- package/dist/unstable/httpapi/HttpApiMiddleware.d.ts +1 -1
- package/dist/unstable/httpapi/HttpApiMiddleware.js +1 -1
- package/dist/unstable/httpapi/HttpApiSchema.d.ts +219 -0
- package/dist/unstable/httpapi/HttpApiSchema.d.ts.map +1 -1
- package/dist/unstable/httpapi/HttpApiSchema.js +170 -0
- package/dist/unstable/httpapi/HttpApiSchema.js.map +1 -1
- package/dist/unstable/httpapi/OpenApi.d.ts +8 -0
- package/dist/unstable/httpapi/OpenApi.d.ts.map +1 -1
- package/dist/unstable/httpapi/OpenApi.js +45 -18
- package/dist/unstable/httpapi/OpenApi.js.map +1 -1
- package/dist/unstable/observability/OtlpExporter.d.ts +1 -1
- package/dist/unstable/observability/OtlpExporter.d.ts.map +1 -1
- package/dist/unstable/observability/OtlpExporter.js +2 -1
- package/dist/unstable/observability/OtlpExporter.js.map +1 -1
- package/dist/unstable/observability/OtlpLogger.d.ts.map +1 -1
- package/dist/unstable/observability/OtlpLogger.js +2 -2
- package/dist/unstable/observability/OtlpLogger.js.map +1 -1
- package/dist/unstable/observability/OtlpMetrics.d.ts +2 -2
- package/dist/unstable/observability/OtlpMetrics.d.ts.map +1 -1
- package/dist/unstable/observability/OtlpMetrics.js +28 -15
- package/dist/unstable/observability/OtlpMetrics.js.map +1 -1
- package/dist/unstable/observability/OtlpTracer.js +1 -1
- package/dist/unstable/observability/OtlpTracer.js.map +1 -1
- package/dist/unstable/persistence/PersistedQueue.d.ts.map +1 -1
- package/dist/unstable/persistence/PersistedQueue.js +9 -9
- package/dist/unstable/persistence/PersistedQueue.js.map +1 -1
- package/dist/unstable/persistence/Persistence.d.ts.map +1 -1
- package/dist/unstable/persistence/Persistence.js +17 -7
- package/dist/unstable/persistence/Persistence.js.map +1 -1
- package/dist/unstable/persistence/RateLimiter.d.ts +22 -12
- package/dist/unstable/persistence/RateLimiter.d.ts.map +1 -1
- package/dist/unstable/persistence/RateLimiter.js +15 -42
- package/dist/unstable/persistence/RateLimiter.js.map +1 -1
- package/dist/unstable/persistence/Redis.js +1 -1
- package/dist/unstable/persistence/Redis.js.map +1 -1
- package/dist/unstable/reactivity/AsyncResult.d.ts.map +1 -1
- package/dist/unstable/reactivity/AsyncResult.js +4 -4
- package/dist/unstable/reactivity/AsyncResult.js.map +1 -1
- package/dist/unstable/reactivity/Atom.d.ts +26 -11
- package/dist/unstable/reactivity/Atom.d.ts.map +1 -1
- package/dist/unstable/reactivity/Atom.js +9 -22
- package/dist/unstable/reactivity/Atom.js.map +1 -1
- package/dist/unstable/rpc/RpcClient.d.ts +14 -0
- package/dist/unstable/rpc/RpcClient.d.ts.map +1 -1
- package/dist/unstable/rpc/RpcClient.js +21 -10
- package/dist/unstable/rpc/RpcClient.js.map +1 -1
- package/dist/unstable/rpc/RpcClientError.js +2 -2
- package/dist/unstable/rpc/RpcClientError.js.map +1 -1
- package/dist/unstable/rpc/RpcSerialization.js +3 -1
- package/dist/unstable/rpc/RpcSerialization.js.map +1 -1
- package/dist/unstable/rpc/RpcServer.d.ts.map +1 -1
- package/dist/unstable/rpc/RpcServer.js +3 -2
- package/dist/unstable/rpc/RpcServer.js.map +1 -1
- package/dist/unstable/schema/Model.d.ts +1 -1
- package/dist/unstable/schema/Model.d.ts.map +1 -1
- package/dist/unstable/schema/VariantSchema.d.ts +5 -5
- package/dist/unstable/schema/VariantSchema.d.ts.map +1 -1
- package/dist/unstable/schema/VariantSchema.js +17 -9
- package/dist/unstable/schema/VariantSchema.js.map +1 -1
- package/dist/unstable/socket/Socket.d.ts.map +1 -1
- package/dist/unstable/socket/Socket.js +28 -12
- package/dist/unstable/socket/Socket.js.map +1 -1
- package/dist/unstable/sql/SqlClient.d.ts.map +1 -1
- package/dist/unstable/sql/SqlClient.js +7 -3
- package/dist/unstable/sql/SqlClient.js.map +1 -1
- package/dist/unstable/sql/SqlError.js +13 -13
- package/dist/unstable/sql/SqlError.js.map +1 -1
- package/dist/unstable/sql/SqlResolver.js +8 -6
- package/dist/unstable/sql/SqlResolver.js.map +1 -1
- package/dist/unstable/sql/Statement.d.ts.map +1 -1
- package/dist/unstable/sql/Statement.js +8 -6
- package/dist/unstable/sql/Statement.js.map +1 -1
- package/dist/unstable/workers/WorkerError.js +5 -5
- package/dist/unstable/workers/WorkerError.js.map +1 -1
- package/dist/unstable/workflow/Workflow.d.ts.map +1 -1
- package/dist/unstable/workflow/Workflow.js +2 -2
- package/dist/unstable/workflow/Workflow.js.map +1 -1
- package/dist/unstable/workflow/WorkflowEngine.d.ts +1 -1
- package/dist/unstable/workflow/WorkflowEngine.d.ts.map +1 -1
- package/dist/unstable/workflow/WorkflowEngine.js +3 -3
- package/dist/unstable/workflow/WorkflowEngine.js.map +1 -1
- package/package.json +6 -9
- package/src/Brand.ts +4 -4
- package/src/Cache.ts +1 -1
- package/src/Channel.ts +1 -1
- package/src/Config.ts +31 -8
- package/src/ConfigProvider.ts +4 -1
- package/src/Context.ts +6 -28
- package/src/Cron.ts +65 -2
- package/src/Crypto.ts +17 -8
- package/src/Duration.ts +16 -2
- package/src/Effect.ts +141 -17
- package/src/Equal.ts +10 -2
- package/src/ExecutionPlan.ts +78 -1
- package/src/FiberSet.ts +1 -1
- package/src/FileSystem.ts +2 -2
- package/src/Function.ts +6 -6
- package/src/Iterable.ts +11 -10
- package/src/Layer.ts +7 -5
- package/src/Optic.ts +59 -58
- package/src/Schedule.ts +13 -13
- package/src/Schema.ts +195 -112
- package/src/SchemaAST.ts +154 -85
- package/src/SchemaError.ts +9 -9
- package/src/SchemaGetter.ts +89 -30
- package/src/SchemaIssue.ts +285 -80
- package/src/SchemaParser.ts +126 -86
- package/src/SchemaTransformation.ts +66 -18
- package/src/ScopedCache.ts +1 -1
- package/src/Sink.ts +1 -1
- package/src/Stdio.ts +23 -4
- package/src/Stream.ts +77 -10
- package/src/SynchronizedRef.ts +1 -1
- package/src/Terminal.ts +1 -1
- package/src/Tuple.ts +7 -4
- package/src/TxReentrantLock.ts +39 -35
- package/src/internal/dateTime.ts +1 -1
- package/src/internal/executionPlan.ts +105 -10
- package/src/internal/hashMap.ts +20 -14
- package/src/internal/matcher.ts +2 -2
- package/src/internal/schedule.ts +4 -4
- package/src/internal/schema/annotations.ts +3 -0
- package/src/internal/schema/schema.ts +1 -17
- package/src/internal/schema/toArbitrary.ts +3 -1
- package/src/internal/trie.ts +12 -2
- package/src/testing/TestClock.ts +13 -1
- package/src/testing/TestSchema.ts +9 -9
- package/src/unstable/ai/AiError.ts +19 -19
- package/src/unstable/ai/Chat.ts +1 -1
- package/src/unstable/ai/LanguageModel.ts +4 -2
- package/src/unstable/ai/McpSchema.ts +17 -16
- package/src/unstable/ai/McpServer.ts +1 -1
- package/src/unstable/ai/Prompt.ts +35 -10
- package/src/unstable/cli/CliError.ts +12 -12
- package/src/unstable/cli/Command.ts +12 -10
- package/src/unstable/cli/Param.ts +41 -19
- package/src/unstable/cli/Primitive.ts +11 -5
- package/src/unstable/cli/Prompt.ts +36 -20
- package/src/unstable/cli/internal/ansi.ts +2 -2
- package/src/unstable/cli/internal/command.ts +15 -10
- package/src/unstable/cli/internal/completions/bash.ts +59 -9
- package/src/unstable/cli/internal/completions/descriptor.ts +14 -20
- package/src/unstable/cli/internal/completions/fish.ts +5 -7
- package/src/unstable/cli/internal/help.ts +4 -2
- package/src/unstable/cli/internal/parser.ts +3 -3
- package/src/unstable/cli/internal/wizard.ts +2 -2
- package/src/unstable/cluster/ClusterError.ts +7 -7
- package/src/unstable/cluster/ClusterWorkflowEngine.ts +4 -1
- package/src/unstable/cluster/MessageStorage.ts +9 -5
- package/src/unstable/cluster/Reply.ts +25 -4
- package/src/unstable/cluster/RunnerServer.ts +4 -10
- package/src/unstable/cluster/RunnerStorage.ts +9 -7
- package/src/unstable/cluster/Sharding.ts +35 -7
- package/src/unstable/cluster/internal/entityManager.ts +1 -1
- package/src/unstable/cluster/internal/resourceMap.ts +5 -2
- package/src/unstable/cluster/internal/resourceRef.ts +27 -5
- package/src/unstable/devtools/DevToolsClient.ts +3 -2
- package/src/unstable/encoding/Ini.ts +174 -0
- package/src/unstable/encoding/Msgpack.ts +59 -36
- package/src/unstable/encoding/Ndjson.ts +9 -1
- package/src/unstable/encoding/Sse.ts +11 -21
- package/src/unstable/encoding/Toml.ts +504 -0
- package/src/unstable/encoding/Yaml.ts +541 -0
- package/src/unstable/encoding/index.ts +15 -0
- package/src/unstable/eventlog/EventJournal.ts +14 -6
- package/src/unstable/eventlog/EventLogMessage.ts +1 -1
- package/src/unstable/eventlog/EventLogServerUnencrypted.ts +1 -1
- package/src/unstable/eventlog/SqlEventJournal.ts +6 -4
- package/src/unstable/http/FindMyWay/internal/queryString.ts +420 -0
- package/src/unstable/http/FindMyWay/internal/router.ts +950 -0
- package/src/unstable/http/FindMyWay.ts +65 -6
- package/src/unstable/http/HttpClient.ts +132 -23
- package/src/unstable/http/HttpClientError.ts +1 -1
- package/src/unstable/http/HttpClientRequest.ts +2 -14
- package/src/unstable/http/HttpClientResponse.ts +1 -17
- package/src/unstable/http/HttpPlatform.ts +34 -6
- package/src/unstable/http/HttpServerRequest.ts +14 -6
- package/src/unstable/http/HttpServerResponse.ts +9 -7
- package/src/unstable/http/Multipart.ts +9 -2
- package/src/unstable/http/MultipartParser/HeadersParser.ts +68 -0
- package/src/unstable/http/MultipartParser/Search.ts +17 -0
- package/src/unstable/http/MultipartParser/internal/contentType.ts +103 -0
- package/src/unstable/http/MultipartParser/internal/headers.ts +615 -0
- package/src/unstable/http/MultipartParser/internal/multipart.ts +262 -0
- package/src/unstable/http/MultipartParser/internal/search.ts +167 -0
- package/src/unstable/http/MultipartParser.ts +115 -0
- package/src/unstable/http/Template.ts +6 -5
- package/src/unstable/http/index.ts +1 -1
- package/src/unstable/http/internal/httpBody.ts +15 -0
- package/src/unstable/httpapi/HttpApi.ts +6 -7
- package/src/unstable/httpapi/HttpApiBuilder.ts +142 -25
- package/src/unstable/httpapi/HttpApiClient.ts +130 -49
- package/src/unstable/httpapi/HttpApiEndpoint.ts +117 -29
- package/src/unstable/httpapi/HttpApiError.ts +33 -39
- package/src/unstable/httpapi/HttpApiMiddleware.ts +1 -1
- package/src/unstable/httpapi/HttpApiSchema.ts +353 -0
- package/src/unstable/httpapi/OpenApi.ts +70 -20
- package/src/unstable/observability/OtlpExporter.ts +4 -2
- package/src/unstable/observability/OtlpLogger.ts +3 -1
- package/src/unstable/observability/OtlpMetrics.ts +32 -18
- package/src/unstable/observability/OtlpTracer.ts +1 -1
- package/src/unstable/persistence/PersistedQueue.ts +12 -9
- package/src/unstable/persistence/Persistence.ts +27 -7
- package/src/unstable/persistence/RateLimiter.ts +54 -31
- package/src/unstable/persistence/Redis.ts +1 -1
- package/src/unstable/reactivity/AsyncResult.ts +11 -6
- package/src/unstable/reactivity/Atom.ts +44 -25
- package/src/unstable/rpc/RpcClient.ts +42 -13
- package/src/unstable/rpc/RpcClientError.ts +2 -2
- package/src/unstable/rpc/RpcSerialization.ts +1 -1
- package/src/unstable/rpc/RpcServer.ts +4 -2
- package/src/unstable/schema/VariantSchema.ts +36 -18
- package/src/unstable/socket/Socket.ts +24 -14
- package/src/unstable/sql/SqlClient.ts +65 -56
- package/src/unstable/sql/SqlError.ts +13 -13
- package/src/unstable/sql/SqlResolver.ts +8 -6
- package/src/unstable/sql/Statement.ts +13 -8
- package/src/unstable/workers/WorkerError.ts +5 -5
- package/src/unstable/workflow/Workflow.ts +2 -5
- package/src/unstable/workflow/WorkflowEngine.ts +8 -3
- package/dist/unstable/http/Multipasta/HeadersParser.d.ts +0 -14
- package/dist/unstable/http/Multipasta/HeadersParser.d.ts.map +0 -1
- package/dist/unstable/http/Multipasta/HeadersParser.js +0 -14
- package/dist/unstable/http/Multipasta/HeadersParser.js.map +0 -1
- package/dist/unstable/http/Multipasta/Node.d.ts +0 -14
- package/dist/unstable/http/Multipasta/Node.d.ts.map +0 -1
- package/dist/unstable/http/Multipasta/Node.js +0 -14
- package/dist/unstable/http/Multipasta/Node.js.map +0 -1
- package/dist/unstable/http/Multipasta/Search.d.ts +0 -14
- package/dist/unstable/http/Multipasta/Search.d.ts.map +0 -1
- package/dist/unstable/http/Multipasta/Search.js +0 -14
- package/dist/unstable/http/Multipasta/Search.js.map +0 -1
- package/dist/unstable/http/Multipasta/Web.d.ts +0 -14
- package/dist/unstable/http/Multipasta/Web.d.ts.map +0 -1
- package/dist/unstable/http/Multipasta/Web.js +0 -14
- package/dist/unstable/http/Multipasta/Web.js.map +0 -1
- package/dist/unstable/http/Multipasta.d.ts +0 -15
- package/dist/unstable/http/Multipasta.d.ts.map +0 -1
- package/dist/unstable/http/Multipasta.js +0 -15
- package/dist/unstable/http/Multipasta.js.map +0 -1
- package/src/unstable/http/Multipasta/HeadersParser.ts +0 -14
- package/src/unstable/http/Multipasta/Node.ts +0 -14
- package/src/unstable/http/Multipasta/Search.ts +0 -14
- package/src/unstable/http/Multipasta/Web.ts +0 -14
- package/src/unstable/http/Multipasta.ts +0 -15
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "effect",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "4.0.0-beta.
|
|
4
|
+
"version": "4.0.0-beta.105",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"description": "The missing standard library for TypeScript, for writing production-grade software.",
|
|
7
7
|
"homepage": "https://effect.website",
|
|
@@ -60,14 +60,16 @@
|
|
|
60
60
|
"dist/**/*.js",
|
|
61
61
|
"dist/**/*.js.map",
|
|
62
62
|
"dist/**/*.d.ts",
|
|
63
|
-
"dist/**/*.d.ts.map"
|
|
63
|
+
"dist/**/*.d.ts.map",
|
|
64
|
+
"AGENTS.md",
|
|
65
|
+
"CLAUDE.md",
|
|
66
|
+
"ai-docs/**/*"
|
|
64
67
|
],
|
|
65
68
|
"publishConfig": {
|
|
66
69
|
"access": "public",
|
|
67
70
|
"provenance": true
|
|
68
71
|
},
|
|
69
72
|
"devDependencies": {
|
|
70
|
-
"@types/ini": "^4.1.1",
|
|
71
73
|
"@types/node": "^26.1.2",
|
|
72
74
|
"ajv": "^8.20.0",
|
|
73
75
|
"ajv-draft-04": "^1.0.0",
|
|
@@ -79,14 +81,9 @@
|
|
|
79
81
|
"dependencies": {
|
|
80
82
|
"@standard-schema/spec": "^1.1.0",
|
|
81
83
|
"fast-check": "^4.9.0",
|
|
82
|
-
"find-my-way-ts": "^0.1.6",
|
|
83
|
-
"ini": "^7.0.0",
|
|
84
84
|
"kubernetes-types": "^1.30.0",
|
|
85
85
|
"msgpackr": "^2.0.4",
|
|
86
|
-
"
|
|
87
|
-
"toml": "^4.1.2",
|
|
88
|
-
"uuid": "^14.0.1",
|
|
89
|
-
"yaml": "^2.9.0"
|
|
86
|
+
"uuid": "^14.0.1"
|
|
90
87
|
},
|
|
91
88
|
"scripts": {
|
|
92
89
|
"codegen": "effect-utils codegen",
|
package/src/Brand.ts
CHANGED
|
@@ -12,7 +12,7 @@ import * as Option from "./Option.ts"
|
|
|
12
12
|
import * as Result from "./Result.ts"
|
|
13
13
|
import type * as Schema from "./Schema.ts"
|
|
14
14
|
import * as SchemaAST from "./SchemaAST.ts"
|
|
15
|
-
import
|
|
15
|
+
import * as SchemaIssue from "./SchemaIssue.ts"
|
|
16
16
|
import type * as Types from "./Types.ts"
|
|
17
17
|
|
|
18
18
|
const TypeId = "~effect/Brand"
|
|
@@ -92,8 +92,8 @@ export interface Constructor<in out B extends Brand<any>> {
|
|
|
92
92
|
*
|
|
93
93
|
* **Details**
|
|
94
94
|
*
|
|
95
|
-
* The error wraps a `SchemaIssue.Issue`,
|
|
96
|
-
*
|
|
95
|
+
* The error wraps a `SchemaIssue.Issue`, renders `message` with the default
|
|
96
|
+
* schema issue formatter, and formats as `BrandError(<message>)`.
|
|
97
97
|
*
|
|
98
98
|
* **Gotchas**
|
|
99
99
|
*
|
|
@@ -131,7 +131,7 @@ export class BrandError {
|
|
|
131
131
|
* @since 4.0.0
|
|
132
132
|
*/
|
|
133
133
|
get message() {
|
|
134
|
-
return this.issue
|
|
134
|
+
return SchemaIssue.defaultFormatter(this.issue)
|
|
135
135
|
}
|
|
136
136
|
/**
|
|
137
137
|
* Formats the brand error together with its validation message.
|
package/src/Cache.ts
CHANGED
|
@@ -305,7 +305,7 @@ export const make = <
|
|
|
305
305
|
> =>
|
|
306
306
|
makeWith<Key, A, E, R, ServiceMode>(options.lookup, {
|
|
307
307
|
...options,
|
|
308
|
-
timeToLive: options.timeToLive ? () => options.timeToLive! : defaultTimeToLive
|
|
308
|
+
timeToLive: options.timeToLive !== undefined ? () => options.timeToLive! : defaultTimeToLive
|
|
309
309
|
})
|
|
310
310
|
|
|
311
311
|
const Proto = {
|
package/src/Channel.ts
CHANGED
|
@@ -10830,7 +10830,7 @@ export const bindTo: {
|
|
|
10830
10830
|
*/
|
|
10831
10831
|
export const runCount = <OutElem, OutErr, OutDone, Env>(
|
|
10832
10832
|
self: Channel<OutElem, OutErr, OutDone, unknown, unknown, unknown, Env>
|
|
10833
|
-
): Effect.Effect<
|
|
10833
|
+
): Effect.Effect<number, OutErr, Env> => runFold(self, () => 0, (acc) => acc + 1)
|
|
10834
10834
|
|
|
10835
10835
|
/**
|
|
10836
10836
|
* Runs a channel and discards all output elements, returning only the final result.
|
package/src/Config.ts
CHANGED
|
@@ -17,6 +17,7 @@ import * as LogLevel_ from "./LogLevel.ts"
|
|
|
17
17
|
import * as Option from "./Option.ts"
|
|
18
18
|
import * as Predicate from "./Predicate.ts"
|
|
19
19
|
import * as Rec from "./Record.ts"
|
|
20
|
+
import * as Result from "./Result.ts"
|
|
20
21
|
import * as Schema from "./Schema.ts"
|
|
21
22
|
import * as SchemaAST from "./SchemaAST.ts"
|
|
22
23
|
import * as SchemaGetter from "./SchemaGetter.ts"
|
|
@@ -193,13 +194,15 @@ const evaluationFailure = (error: ConfigError, hasInput: boolean): EvaluationFai
|
|
|
193
194
|
hasInput
|
|
194
195
|
})
|
|
195
196
|
|
|
197
|
+
const isSourceError = (u: unknown): u is ConfigProvider.SourceError => Predicate.isTagged(u, "SourceError")
|
|
198
|
+
|
|
196
199
|
const catchSourceError = <A, E, R>(
|
|
197
200
|
self: Effect.Effect<A, E, R>,
|
|
198
201
|
hasInput: boolean
|
|
199
202
|
): Effect.Effect<A, E | EvaluationFailure, R> =>
|
|
200
203
|
self.pipe(
|
|
201
204
|
Effect.catchDefect((defect) =>
|
|
202
|
-
defect
|
|
205
|
+
isSourceError(defect)
|
|
203
206
|
? Effect.fail(evaluationFailure(new ConfigError(defect), hasInput))
|
|
204
207
|
: Effect.die(defect)
|
|
205
208
|
)
|
|
@@ -630,14 +633,14 @@ export function all<const Arg extends Iterable<Config<any>> | Record<string, Con
|
|
|
630
633
|
if (Array.isArray(configs)) {
|
|
631
634
|
return make((provider, pathPrefix) =>
|
|
632
635
|
Effect.flatMapEager(
|
|
633
|
-
Effect.all(configs.map((config) => evaluateAt(config, provider, pathPrefix))),
|
|
636
|
+
Effect.all(configs.map((config) => Effect.result(evaluateAt(config, provider, pathPrefix)))),
|
|
634
637
|
resolveArray
|
|
635
638
|
)
|
|
636
639
|
) as any
|
|
637
640
|
} else {
|
|
638
641
|
return make((provider, pathPrefix) =>
|
|
639
642
|
Effect.flatMapEager(
|
|
640
|
-
Effect.all(Rec.map(configs, (config) => evaluateAt(config, provider, pathPrefix))),
|
|
643
|
+
Effect.all(Rec.map(configs, (config) => Effect.result(evaluateAt(config, provider, pathPrefix)))),
|
|
641
644
|
resolveRecord
|
|
642
645
|
)
|
|
643
646
|
) as any
|
|
@@ -645,12 +648,19 @@ export function all<const Arg extends Iterable<Config<any>> | Record<string, Con
|
|
|
645
648
|
}
|
|
646
649
|
|
|
647
650
|
const resolveArray = (
|
|
648
|
-
|
|
651
|
+
results: ReadonlyArray<Result.Result<Resolution<any>, EvaluationFailure>>
|
|
649
652
|
): Effect.Effect<Resolution<Array<any>>, EvaluationFailure> => {
|
|
650
653
|
const values: Array<any> = []
|
|
654
|
+
let firstFailure: EvaluationFailure | undefined
|
|
651
655
|
let firstAbsent: Absent | undefined
|
|
652
656
|
let hasInput = false
|
|
653
|
-
for (const
|
|
657
|
+
for (const result of results) {
|
|
658
|
+
if (Result.isFailure(result)) {
|
|
659
|
+
firstFailure ??= result.failure
|
|
660
|
+
hasInput = hasInput || result.failure.hasInput
|
|
661
|
+
continue
|
|
662
|
+
}
|
|
663
|
+
const resolution = result.success
|
|
654
664
|
if (resolution._tag === "Absent") {
|
|
655
665
|
firstAbsent ??= resolution
|
|
656
666
|
} else {
|
|
@@ -658,6 +668,9 @@ const resolveArray = (
|
|
|
658
668
|
hasInput = hasInput || resolution.hasInput
|
|
659
669
|
}
|
|
660
670
|
}
|
|
671
|
+
if (firstFailure !== undefined) {
|
|
672
|
+
return Effect.fail(evaluationFailure(firstFailure.error, hasInput))
|
|
673
|
+
}
|
|
661
674
|
if (firstAbsent !== undefined) {
|
|
662
675
|
return hasInput ? Effect.fail(evaluationFailure(firstAbsent.error, true)) : Effect.succeed(firstAbsent)
|
|
663
676
|
}
|
|
@@ -665,13 +678,20 @@ const resolveArray = (
|
|
|
665
678
|
}
|
|
666
679
|
|
|
667
680
|
const resolveRecord = (
|
|
668
|
-
|
|
681
|
+
results: Record<string, Result.Result<Resolution<any>, EvaluationFailure>>
|
|
669
682
|
): Effect.Effect<Resolution<Record<string, any>>, EvaluationFailure> => {
|
|
670
683
|
const values: Record<string, any> = {}
|
|
684
|
+
let firstFailure: EvaluationFailure | undefined
|
|
671
685
|
let firstAbsent: Absent | undefined
|
|
672
686
|
let hasInput = false
|
|
673
|
-
for (const key in
|
|
674
|
-
const
|
|
687
|
+
for (const key in results) {
|
|
688
|
+
const result = results[key]
|
|
689
|
+
if (Result.isFailure(result)) {
|
|
690
|
+
firstFailure ??= result.failure
|
|
691
|
+
hasInput = hasInput || result.failure.hasInput
|
|
692
|
+
continue
|
|
693
|
+
}
|
|
694
|
+
const resolution = result.success
|
|
675
695
|
if (resolution._tag === "Absent") {
|
|
676
696
|
firstAbsent ??= resolution
|
|
677
697
|
} else {
|
|
@@ -679,6 +699,9 @@ const resolveRecord = (
|
|
|
679
699
|
hasInput = hasInput || resolution.hasInput
|
|
680
700
|
}
|
|
681
701
|
}
|
|
702
|
+
if (firstFailure !== undefined) {
|
|
703
|
+
return Effect.fail(evaluationFailure(firstFailure.error, hasInput))
|
|
704
|
+
}
|
|
682
705
|
if (firstAbsent !== undefined) {
|
|
683
706
|
return hasInput ? Effect.fail(evaluationFailure(firstAbsent.error, true)) : Effect.succeed(firstAbsent)
|
|
684
707
|
}
|
package/src/ConfigProvider.ts
CHANGED
|
@@ -1354,9 +1354,12 @@ function interpolate(envValue: string, parsed: Record<string, string>): string {
|
|
|
1354
1354
|
|
|
1355
1355
|
if (match !== null) {
|
|
1356
1356
|
const [_, group, variableName, defaultValue] = match
|
|
1357
|
+
const value = Object.hasOwn(parsed, variableName) && parsed[variableName] !== ""
|
|
1358
|
+
? parsed[variableName]
|
|
1359
|
+
: defaultValue ?? ""
|
|
1357
1360
|
|
|
1358
1361
|
return interpolate(
|
|
1359
|
-
envValue.replace(group,
|
|
1362
|
+
envValue.replace(group, value),
|
|
1360
1363
|
parsed
|
|
1361
1364
|
)
|
|
1362
1365
|
}
|
package/src/Context.ts
CHANGED
|
@@ -17,7 +17,6 @@ import { dual, type LazyArg } from "./Function.ts"
|
|
|
17
17
|
import * as Hash from "./Hash.ts"
|
|
18
18
|
import type { Inspectable } from "./Inspectable.ts"
|
|
19
19
|
import { exitSucceed, PipeInspectableProto, withFiber } from "./internal/core.ts"
|
|
20
|
-
import { getStackTraceLimit, setStackTraceLimit } from "./internal/stackTraceLimit.ts"
|
|
21
20
|
import * as Option from "./Option.ts"
|
|
22
21
|
import type { Pipeable } from "./Pipeable.ts"
|
|
23
22
|
import { hasProperty } from "./Predicate.ts"
|
|
@@ -67,7 +66,6 @@ export interface Key<out Identifier, out Shape> extends Effect<Shape, never, Ide
|
|
|
67
66
|
readonly Service: Shape
|
|
68
67
|
readonly Identifier: Identifier
|
|
69
68
|
readonly key: string
|
|
70
|
-
readonly stack?: string | undefined
|
|
71
69
|
}
|
|
72
70
|
|
|
73
71
|
/**
|
|
@@ -394,19 +392,9 @@ export const Service: {
|
|
|
394
392
|
>
|
|
395
393
|
& { readonly make: Make }
|
|
396
394
|
} = function() {
|
|
397
|
-
const prevLimit = getStackTraceLimit()
|
|
398
|
-
setStackTraceLimit(2)
|
|
399
|
-
const err = new Error()
|
|
400
|
-
setStackTraceLimit(prevLimit)
|
|
401
395
|
function KeyClass() {}
|
|
402
396
|
const self = KeyClass as any as Types.Mutable<Reference<any>>
|
|
403
397
|
Object.setPrototypeOf(self, ServiceProto)
|
|
404
|
-
// @effect-diagnostics-next-line floatingEffect:off
|
|
405
|
-
Object.defineProperty(self, "stack", {
|
|
406
|
-
get() {
|
|
407
|
-
return err.stack
|
|
408
|
-
}
|
|
409
|
-
})
|
|
410
398
|
const init = (key: string, options?: {
|
|
411
399
|
readonly defaultValue?: any
|
|
412
400
|
readonly make?: any
|
|
@@ -439,8 +427,7 @@ const ServiceProto: any = {
|
|
|
439
427
|
toJSON<I, A>(this: Service<I, A>) {
|
|
440
428
|
return {
|
|
441
429
|
_id: "Service",
|
|
442
|
-
key: this.key
|
|
443
|
-
stack: this.stack
|
|
430
|
+
key: this.key
|
|
444
431
|
}
|
|
445
432
|
},
|
|
446
433
|
of<Service>(this: void, self: Service): Service {
|
|
@@ -1094,7 +1081,7 @@ export const addOrOmit: {
|
|
|
1094
1081
|
* @category combining
|
|
1095
1082
|
* @since 4.0.0
|
|
1096
1083
|
*/
|
|
1097
|
-
<I, S>(key: Key<I, S>, service: Option.Option<Types.NoInfer<S>>): <Services>(self: Context<Services>) => Context<Services
|
|
1084
|
+
<I, S>(key: Key<I, S>, service: Option.Option<Types.NoInfer<S>>): <Services>(self: Context<Services>) => Context<Exclude<Services, I>>
|
|
1098
1085
|
/**
|
|
1099
1086
|
* Adds or removes a service depending on an `Option`.
|
|
1100
1087
|
*
|
|
@@ -1134,15 +1121,15 @@ export const addOrOmit: {
|
|
|
1134
1121
|
self: Context<Services>,
|
|
1135
1122
|
key: Key<I, S>,
|
|
1136
1123
|
service: Option.Option<Types.NoInfer<S>>
|
|
1137
|
-
): Context<Services
|
|
1124
|
+
): Context<Exclude<Services, I>>
|
|
1138
1125
|
} = dual(3, <Services, I, S>(
|
|
1139
1126
|
self: Context<Services>,
|
|
1140
1127
|
key: Key<I, S>,
|
|
1141
1128
|
service: Option.Option<Types.NoInfer<S>>
|
|
1142
|
-
): Context<Services
|
|
1129
|
+
): Context<Exclude<Services, I>> =>
|
|
1143
1130
|
service._tag === "None"
|
|
1144
|
-
? omit(key)(self)
|
|
1145
|
-
: add(self, key, service.value))
|
|
1131
|
+
? omit(key)(self)
|
|
1132
|
+
: add(self, key, service.value) as any)
|
|
1146
1133
|
|
|
1147
1134
|
/**
|
|
1148
1135
|
* Gets the service for a key, or evaluates the fallback when a non-reference
|
|
@@ -1593,15 +1580,6 @@ const serviceNotFoundError = (service: Key<any, any>) => {
|
|
|
1593
1580
|
const error = new Error(
|
|
1594
1581
|
`Service not found${service.key ? `: ${String(service.key)}` : ""}`
|
|
1595
1582
|
)
|
|
1596
|
-
if (service.stack) {
|
|
1597
|
-
const lines = service.stack.split("\n")
|
|
1598
|
-
if (lines.length > 2) {
|
|
1599
|
-
const afterAt = lines[2].match(/at (.*)/)
|
|
1600
|
-
if (afterAt) {
|
|
1601
|
-
error.message = error.message + ` (defined at ${afterAt[1]})`
|
|
1602
|
-
}
|
|
1603
|
-
}
|
|
1604
|
-
}
|
|
1605
1583
|
if (error.stack) {
|
|
1606
1584
|
const lines = error.stack.split("\n")
|
|
1607
1585
|
lines.splice(1, 3)
|
package/src/Cron.ts
CHANGED
|
@@ -12,7 +12,7 @@ import * as Data from "./Data.ts"
|
|
|
12
12
|
import type * as DateTime from "./DateTime.ts"
|
|
13
13
|
import * as Equal from "./Equal.ts"
|
|
14
14
|
import * as Equ from "./Equivalence.ts"
|
|
15
|
-
import { format } from "./Formatter.ts"
|
|
15
|
+
import { format as formatValue } from "./Formatter.ts"
|
|
16
16
|
import { constVoid, dual, pipe } from "./Function.ts"
|
|
17
17
|
import * as Hash from "./Hash.ts"
|
|
18
18
|
import { type Inspectable, NodeInspectSymbol } from "./Inspectable.ts"
|
|
@@ -152,7 +152,7 @@ const CronProto = {
|
|
|
152
152
|
return toPojo(this)
|
|
153
153
|
},
|
|
154
154
|
toString(this: Cron) {
|
|
155
|
-
return `Cron(${
|
|
155
|
+
return `Cron(${formatValue(toPojo(this))})`
|
|
156
156
|
},
|
|
157
157
|
toJSON(this: Cron) {
|
|
158
158
|
const out = toPojo(this)
|
|
@@ -612,6 +612,69 @@ export const parse = (cron: string, tz?: DateTime.TimeZone | string): Result.Res
|
|
|
612
612
|
*/
|
|
613
613
|
export const parseUnsafe = (cron: string, tz?: DateTime.TimeZone | string): Cron => Result.getOrThrow(parse(cron, tz))
|
|
614
614
|
|
|
615
|
+
/**
|
|
616
|
+
* Formats a `Cron` instance as a cron expression.
|
|
617
|
+
*
|
|
618
|
+
* **Details**
|
|
619
|
+
*
|
|
620
|
+
* The default seconds field (`0`) is omitted unless `includeSeconds` is `true`.
|
|
621
|
+
* Other seconds configurations are always included.
|
|
622
|
+
*
|
|
623
|
+
* **Gotchas**
|
|
624
|
+
*
|
|
625
|
+
* Formatting drops the timezone information and the `and` restriction between
|
|
626
|
+
* days and weekdays. Parsing the result is therefore not guaranteed to produce
|
|
627
|
+
* an equivalent schedule.
|
|
628
|
+
*
|
|
629
|
+
* **Example** (Formatting a cron expression)
|
|
630
|
+
*
|
|
631
|
+
* ```ts import.meta.vitest
|
|
632
|
+
* import { Cron } from "effect"
|
|
633
|
+
*
|
|
634
|
+
* const cron = Cron.parseUnsafe("23 0-20/2 * * 0", "UTC")
|
|
635
|
+
*
|
|
636
|
+
* Cron.format(cron) // => "23 0-20/2 * * 0"
|
|
637
|
+
* Cron.format(cron, { includeSeconds: true }) // => "0 23 0-20/2 * * 0"
|
|
638
|
+
* ```
|
|
639
|
+
*
|
|
640
|
+
* @category getters
|
|
641
|
+
* @since 4.0.0
|
|
642
|
+
*/
|
|
643
|
+
export const format = (cron: Cron, options?: {
|
|
644
|
+
readonly includeSeconds?: boolean | undefined
|
|
645
|
+
}): string => {
|
|
646
|
+
const segments = [cron.seconds, cron.minutes, cron.hours, cron.days, cron.months, cron.weekdays]
|
|
647
|
+
.map(formatSegment)
|
|
648
|
+
return (
|
|
649
|
+
options?.includeSeconds !== true && cron.seconds.size === 1 && cron.seconds.has(0) ? segments.slice(1) : segments
|
|
650
|
+
).join(" ")
|
|
651
|
+
}
|
|
652
|
+
|
|
653
|
+
const formatSegment = (values: ReadonlySet<number>): string => {
|
|
654
|
+
if (values.size === 0) {
|
|
655
|
+
return "*"
|
|
656
|
+
}
|
|
657
|
+
const array = Array.from(values)
|
|
658
|
+
const segments: Array<string> = []
|
|
659
|
+
let index = 0
|
|
660
|
+
while (index < array.length) {
|
|
661
|
+
const start = array[index]!
|
|
662
|
+
const step = array[index + 1]! - start
|
|
663
|
+
if (index + 2 < array.length && array[index + 2]! - array[index + 1]! === step) {
|
|
664
|
+
let end = index + 2
|
|
665
|
+
while (end + 1 < array.length && array[end + 1]! - array[end]! === step) {
|
|
666
|
+
end++
|
|
667
|
+
}
|
|
668
|
+
segments.push(`${start}-${array[end]}${step === 1 ? "" : `/${step}`}`)
|
|
669
|
+
index = end + 1
|
|
670
|
+
} else {
|
|
671
|
+
segments.push(`${start}`)
|
|
672
|
+
index++
|
|
673
|
+
}
|
|
674
|
+
}
|
|
675
|
+
return segments.join(",")
|
|
676
|
+
}
|
|
677
|
+
|
|
615
678
|
/**
|
|
616
679
|
* Returns `true` when a date/time matches a `Cron` schedule.
|
|
617
680
|
*
|
package/src/Crypto.ts
CHANGED
|
@@ -222,15 +222,24 @@ export const make = (
|
|
|
222
222
|
|
|
223
223
|
const randomBytes: Crypto["randomBytes"] = (size) => Effect.map(validateSize("randomBytes", size), randomBytesUnsafe)
|
|
224
224
|
|
|
225
|
-
const
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
}
|
|
225
|
+
const readUint53 = (bytes: Uint8Array): number =>
|
|
226
|
+
((bytes[0] & 0x1f) * 2 ** 48) + (bytes[1] * 2 ** 40) + (bytes[2] * 2 ** 32) +
|
|
227
|
+
(bytes[3] * 2 ** 24) + (bytes[4] * 2 ** 16) + (bytes[5] * 2 ** 8) + bytes[6]
|
|
228
|
+
|
|
229
|
+
const nextDoubleUnsafe = (): number => readUint53(randomBytesUnsafe(7)) / 2 ** 53
|
|
231
230
|
|
|
232
|
-
const nextIntUnsafe = (): number =>
|
|
233
|
-
|
|
231
|
+
const nextIntUnsafe = (): number => {
|
|
232
|
+
while (true) {
|
|
233
|
+
const bytes = randomBytesUnsafe(7)
|
|
234
|
+
const value = readUint53(bytes)
|
|
235
|
+
if ((bytes[0] & 0x20) === 0) {
|
|
236
|
+
return value + Number.MIN_SAFE_INTEGER
|
|
237
|
+
}
|
|
238
|
+
if (value < Number.MAX_SAFE_INTEGER) {
|
|
239
|
+
return value + 1
|
|
240
|
+
}
|
|
241
|
+
}
|
|
242
|
+
}
|
|
234
243
|
|
|
235
244
|
return Crypto.of({
|
|
236
245
|
[TypeId]: TypeId,
|
package/src/Duration.ts
CHANGED
|
@@ -27,6 +27,8 @@ const TypeId = "~effect/time/Duration"
|
|
|
27
27
|
|
|
28
28
|
const bigint0 = BigInt(0)
|
|
29
29
|
const bigint1 = BigInt(1)
|
|
30
|
+
const bigint2 = BigInt(2)
|
|
31
|
+
const bigint10 = BigInt(10)
|
|
30
32
|
const bigint24 = BigInt(24)
|
|
31
33
|
const bigint60 = BigInt(60)
|
|
32
34
|
const bigint1e3 = BigInt(1_000)
|
|
@@ -38,8 +40,20 @@ const roundTiesAwayFromZero = (input: number): bigint =>
|
|
|
38
40
|
|
|
39
41
|
const roundMillisToNanos = (millis: number): bigint => roundTiesAwayFromZero(millis * 1_000_000)
|
|
40
42
|
|
|
41
|
-
const parseNanos = (input: string, scale: bigint): bigint =>
|
|
42
|
-
input.
|
|
43
|
+
const parseNanos = (input: string, scale: bigint): bigint => {
|
|
44
|
+
const decimalIndex = input.indexOf(".")
|
|
45
|
+
if (decimalIndex === -1) return BigInt(input) * scale
|
|
46
|
+
|
|
47
|
+
const isNegative = input[0] === "-"
|
|
48
|
+
const fractional = input.slice(decimalIndex + 1)
|
|
49
|
+
const fractionalScale = bigint10 ** BigInt(fractional.length)
|
|
50
|
+
const scaled = (
|
|
51
|
+
BigInt(input.slice(isNegative ? 1 : 0, decimalIndex)) * fractionalScale + BigInt(fractional)
|
|
52
|
+
) * scale
|
|
53
|
+
const rounded = scaled / fractionalScale +
|
|
54
|
+
(scaled % fractionalScale * bigint2 >= fractionalScale ? bigint1 : bigint0)
|
|
55
|
+
return isNegative ? -rounded : rounded
|
|
56
|
+
}
|
|
43
57
|
|
|
44
58
|
const nanosToHrTime = (nanos: bigint): [seconds: number, nanos: number] => {
|
|
45
59
|
const sign = nanos < bigint0 ? -bigint1 : bigint1
|