effect 4.0.0-beta.103 → 4.0.0-beta.104
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/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 +28 -7
- 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 -2
- package/dist/Context.d.ts.map +1 -1
- package/dist/Context.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/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 +32 -32
- package/dist/Schema.d.ts.map +1 -1
- package/dist/Schema.js +23 -18
- package/dist/Schema.js.map +1 -1
- package/dist/SchemaAST.d.ts +3 -3
- package/dist/SchemaAST.d.ts.map +1 -1
- package/dist/SchemaAST.js +47 -31
- package/dist/SchemaAST.js.map +1 -1
- package/dist/SchemaParser.d.ts.map +1 -1
- package/dist/SchemaParser.js +35 -53
- package/dist/SchemaParser.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/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/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 +1 -1
- package/dist/testing/TestSchema.d.ts.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 +6 -3
- 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 +12 -0
- 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 +21 -7
- 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/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 +68 -15
- 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 +65 -25
- 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/rpc/RpcClient.d.ts +14 -0
- package/dist/unstable/rpc/RpcClient.d.ts.map +1 -1
- package/dist/unstable/rpc/RpcClient.js +18 -9
- 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/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/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 +2 -8
- package/src/Cache.ts +1 -1
- package/src/Channel.ts +1 -1
- package/src/Config.ts +28 -7
- package/src/ConfigProvider.ts +4 -1
- package/src/Context.ts +5 -5
- 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/Schedule.ts +13 -13
- package/src/Schema.ts +50 -41
- package/src/SchemaAST.ts +69 -37
- package/src/SchemaParser.ts +75 -69
- package/src/ScopedCache.ts +1 -1
- package/src/Sink.ts +1 -1
- 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/toArbitrary.ts +3 -1
- package/src/internal/trie.ts +12 -2
- package/src/testing/TestClock.ts +13 -1
- package/src/testing/TestSchema.ts +1 -1
- 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 +21 -6
- 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 +21 -0
- 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 +47 -28
- 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/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 +119 -21
- package/src/unstable/httpapi/HttpApiClient.ts +104 -41
- 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/rpc/RpcClient.ts +38 -12
- package/src/unstable/rpc/RpcClientError.ts +2 -2
- package/src/unstable/rpc/RpcSerialization.ts +1 -1
- 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/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
|
@@ -54,7 +54,7 @@ const promptCommand: (
|
|
|
54
54
|
) => Effect.Effect<void, CliError.CliError | Terminal.QuitError, Command.Environment> = Effect.fnUntraced(
|
|
55
55
|
function*(command, commandLine, sectionName) {
|
|
56
56
|
const impl = toImpl(command)
|
|
57
|
-
const visibleSubcommands = command.subcommands.flatMap((group) => group.commands.filter((child) => !child.
|
|
57
|
+
const visibleSubcommands = command.subcommands.flatMap((group) => group.commands.filter((child) => !child.unlisted))
|
|
58
58
|
const config = visibleSubcommands.length === 0 ? impl.config : impl.contextConfig
|
|
59
59
|
|
|
60
60
|
if (config.flags.length > 0) {
|
|
@@ -103,7 +103,7 @@ const promptCommand: (
|
|
|
103
103
|
)
|
|
104
104
|
|
|
105
105
|
const hasWizardSteps = (command: Command.Command.Any): boolean => {
|
|
106
|
-
const hasVisibleSubcommands = command.subcommands.some((group) => group.commands.some((child) => !child.
|
|
106
|
+
const hasVisibleSubcommands = command.subcommands.some((group) => group.commands.some((child) => !child.unlisted))
|
|
107
107
|
return hasVisibleSubcommands || toImpl(command).config.orderedParams.length > 0
|
|
108
108
|
}
|
|
109
109
|
|
|
@@ -26,7 +26,7 @@ const TypeId = "~effect/cluster/ClusterError"
|
|
|
26
26
|
* @since 4.0.0
|
|
27
27
|
*/
|
|
28
28
|
export class EntityNotAssignedToRunner
|
|
29
|
-
extends Schema.
|
|
29
|
+
extends Schema.Error<EntityNotAssignedToRunner>(`${TypeId}/EntityNotAssignedToRunner`)({
|
|
30
30
|
_tag: Schema.tag("EntityNotAssignedToRunner"),
|
|
31
31
|
address: EntityAddress
|
|
32
32
|
})
|
|
@@ -60,7 +60,7 @@ export class EntityNotAssignedToRunner
|
|
|
60
60
|
* @category errors
|
|
61
61
|
* @since 4.0.0
|
|
62
62
|
*/
|
|
63
|
-
export class MalformedMessage extends Schema.
|
|
63
|
+
export class MalformedMessage extends Schema.Error<MalformedMessage>(`${TypeId}/MalformedMessage`)({
|
|
64
64
|
_tag: Schema.tag("MalformedMessage"),
|
|
65
65
|
cause: Schema.Defect()
|
|
66
66
|
}) {
|
|
@@ -99,7 +99,7 @@ export class MalformedMessage extends Schema.ErrorClass<MalformedMessage>(`${Typ
|
|
|
99
99
|
* @category errors
|
|
100
100
|
* @since 4.0.0
|
|
101
101
|
*/
|
|
102
|
-
export class PersistenceError extends Schema.
|
|
102
|
+
export class PersistenceError extends Schema.Error<PersistenceError>(`${TypeId}/PersistenceError`)({
|
|
103
103
|
_tag: Schema.tag("PersistenceError"),
|
|
104
104
|
cause: Schema.Defect()
|
|
105
105
|
}) {
|
|
@@ -127,7 +127,7 @@ export class PersistenceError extends Schema.ErrorClass<PersistenceError>(`${Typ
|
|
|
127
127
|
* @category errors
|
|
128
128
|
* @since 4.0.0
|
|
129
129
|
*/
|
|
130
|
-
export class RunnerNotRegistered extends Schema.
|
|
130
|
+
export class RunnerNotRegistered extends Schema.Error<RunnerNotRegistered>(`${TypeId}/RunnerNotRegistered`)({
|
|
131
131
|
_tag: Schema.tag("RunnerNotRegistered"),
|
|
132
132
|
address: RunnerAddress
|
|
133
133
|
}) {
|
|
@@ -145,7 +145,7 @@ export class RunnerNotRegistered extends Schema.ErrorClass<RunnerNotRegistered>(
|
|
|
145
145
|
* @category errors
|
|
146
146
|
* @since 4.0.0
|
|
147
147
|
*/
|
|
148
|
-
export class RunnerUnavailable extends Schema.
|
|
148
|
+
export class RunnerUnavailable extends Schema.Error<RunnerUnavailable>(`${TypeId}/RunnerUnavailable`)({
|
|
149
149
|
_tag: Schema.tag("RunnerUnavailable"),
|
|
150
150
|
address: RunnerAddress
|
|
151
151
|
}) {
|
|
@@ -181,7 +181,7 @@ export class RunnerUnavailable extends Schema.ErrorClass<RunnerUnavailable>(`${T
|
|
|
181
181
|
* @category errors
|
|
182
182
|
* @since 4.0.0
|
|
183
183
|
*/
|
|
184
|
-
export class MailboxFull extends Schema.
|
|
184
|
+
export class MailboxFull extends Schema.Error<MailboxFull>(`${TypeId}/MailboxFull`)({
|
|
185
185
|
_tag: Schema.tag("MailboxFull"),
|
|
186
186
|
address: EntityAddress
|
|
187
187
|
}) {
|
|
@@ -214,7 +214,7 @@ export class MailboxFull extends Schema.ErrorClass<MailboxFull>(`${TypeId}/Mailb
|
|
|
214
214
|
* @since 4.0.0
|
|
215
215
|
*/
|
|
216
216
|
export class AlreadyProcessingMessage
|
|
217
|
-
extends Schema.
|
|
217
|
+
extends Schema.Error<AlreadyProcessingMessage>(`${TypeId}/AlreadyProcessingMessage`)({
|
|
218
218
|
_tag: Schema.tag("AlreadyProcessingMessage"),
|
|
219
219
|
envelopeId: SnowflakeFromString,
|
|
220
220
|
address: EntityAddress
|
|
@@ -618,7 +618,10 @@ export const make = Effect.gen(function*() {
|
|
|
618
618
|
payload: {
|
|
619
619
|
name: options.clock.name,
|
|
620
620
|
workflowName: workflow._tag,
|
|
621
|
-
wakeUp: DateTime.
|
|
621
|
+
wakeUp: DateTime.mapEpochMillis(
|
|
622
|
+
DateTime.addDuration(now, options.clock.duration),
|
|
623
|
+
Math.ceil
|
|
624
|
+
)
|
|
622
625
|
}
|
|
623
626
|
})
|
|
624
627
|
),
|
|
@@ -606,11 +606,7 @@ export const makeEncoded: (encoded: Encoded) => Effect.Effect<
|
|
|
606
606
|
),
|
|
607
607
|
Effect.asVoid
|
|
608
608
|
),
|
|
609
|
-
saveReply: (reply) =>
|
|
610
|
-
Effect.flatMap(
|
|
611
|
-
Reply.serialize(reply),
|
|
612
|
-
encoded.saveReply
|
|
613
|
-
),
|
|
609
|
+
saveReply: (reply) => Effect.flatMap(Reply.serializeOrDefect(reply), encoded.saveReply),
|
|
614
610
|
clearReplies: encoded.clearReplies,
|
|
615
611
|
repliesFor: Effect.fnUntraced(function*(messages) {
|
|
616
612
|
const requestIds = Arr.empty<string>()
|
|
@@ -995,6 +991,14 @@ export class MemoryDriver extends Context.Service<MemoryDriver>()("effect/cluste
|
|
|
995
991
|
resetAddress: () => Effect.void,
|
|
996
992
|
clearAddress: (address) =>
|
|
997
993
|
Effect.sync(() => {
|
|
994
|
+
for (const [primaryKey, entry] of requestsByPrimaryKey) {
|
|
995
|
+
const envelope = entry.envelope
|
|
996
|
+
const sameAddress = address.entityType === envelope.address.entityType &&
|
|
997
|
+
address.entityId === envelope.address.entityId
|
|
998
|
+
if (sameAddress) {
|
|
999
|
+
requestsByPrimaryKey.delete(primaryKey)
|
|
1000
|
+
}
|
|
1001
|
+
}
|
|
998
1002
|
for (let i = journal.length - 1; i >= 0; i--) {
|
|
999
1003
|
const envelope = journal[i]
|
|
1000
1004
|
const sameAddress = address.entityType === envelope.address.entityType &&
|
|
@@ -433,6 +433,27 @@ export const serialize = <R extends Rpc.Any>(
|
|
|
433
433
|
)
|
|
434
434
|
}
|
|
435
435
|
|
|
436
|
+
/**
|
|
437
|
+
* Serializes a `ReplyWithContext`, falling back to a serializable defect reply
|
|
438
|
+
* when the original reply cannot be encoded.
|
|
439
|
+
*
|
|
440
|
+
* @category serialization
|
|
441
|
+
* @since 4.0.0
|
|
442
|
+
*/
|
|
443
|
+
export const serializeOrDefect = <R extends Rpc.Any>(
|
|
444
|
+
self: ReplyWithContext<R>
|
|
445
|
+
): Effect.Effect<Encoded> =>
|
|
446
|
+
Effect.catchTag(
|
|
447
|
+
serialize(self),
|
|
448
|
+
"MalformedMessage",
|
|
449
|
+
(error) =>
|
|
450
|
+
Effect.orDie(serialize(ReplyWithContext.fromDefect({
|
|
451
|
+
id: self.reply.id,
|
|
452
|
+
requestId: self.reply.requestId,
|
|
453
|
+
defect: error
|
|
454
|
+
})))
|
|
455
|
+
)
|
|
456
|
+
|
|
436
457
|
/**
|
|
437
458
|
* Serializes an outgoing request's last received reply when one exists, returning
|
|
438
459
|
* `None` when no reply has been received and refailing encoding errors as
|
|
@@ -42,15 +42,6 @@ const serializeDefectReply = <R extends Rpc.Any>(
|
|
|
42
42
|
defect
|
|
43
43
|
})))
|
|
44
44
|
|
|
45
|
-
const serializeReply = <R extends Rpc.Any>(
|
|
46
|
-
reply: Reply.ReplyWithContext<R>
|
|
47
|
-
): Effect.Effect<Reply.Encoded> =>
|
|
48
|
-
Effect.catchTag(
|
|
49
|
-
Reply.serialize(reply),
|
|
50
|
-
"MalformedMessage",
|
|
51
|
-
(error) => serializeDefectReply(reply, error)
|
|
52
|
-
)
|
|
53
|
-
|
|
54
45
|
/**
|
|
55
46
|
* Layer that handles runner protocol RPCs by forwarding requests to `Sharding`
|
|
56
47
|
* and `MessageStorage`.
|
|
@@ -84,7 +75,7 @@ export const layerHandlers = Runners.Rpcs.toLayer(Effect.gen(function*() {
|
|
|
84
75
|
envelope: request,
|
|
85
76
|
lastSentReply: Option.none(),
|
|
86
77
|
respond(reply) {
|
|
87
|
-
resume(
|
|
78
|
+
resume(Reply.serializeOrDefect(reply))
|
|
88
79
|
return Effect.void
|
|
89
80
|
}
|
|
90
81
|
})
|
|
@@ -138,6 +129,9 @@ export const layerHandlers = Runners.Rpcs.toLayer(Effect.gen(function*() {
|
|
|
138
129
|
return Reply.serialize(reply).pipe(
|
|
139
130
|
Effect.flatMap((reply) => {
|
|
140
131
|
Queue.offerUnsafe(queue, reply)
|
|
132
|
+
if (reply._tag === "WithExit") {
|
|
133
|
+
Queue.endUnsafe(queue)
|
|
134
|
+
}
|
|
141
135
|
return Effect.void
|
|
142
136
|
}),
|
|
143
137
|
Effect.catchTag("MalformedMessage", (error) =>
|
|
@@ -195,29 +195,31 @@ export const makeEncoded = (encoded: Encoded) =>
|
|
|
195
195
|
*
|
|
196
196
|
* **Details**
|
|
197
197
|
*
|
|
198
|
-
*
|
|
199
|
-
* process memory.
|
|
198
|
+
* Runner health and shard acquisition are kept only in process memory.
|
|
200
199
|
*
|
|
201
200
|
* @category constructors
|
|
202
201
|
* @since 4.0.0
|
|
203
202
|
*/
|
|
204
203
|
export const makeMemory = Effect.gen(function*() {
|
|
205
|
-
const runners = MutableHashMap.empty<RunnerAddress, Runner>()
|
|
204
|
+
const runners = MutableHashMap.empty<RunnerAddress, readonly [runner: Runner, healthy: boolean]>()
|
|
206
205
|
let acquired: Array<ShardId.ShardId> = []
|
|
207
206
|
let id = 0
|
|
208
207
|
|
|
209
208
|
return RunnerStorage.of({
|
|
210
|
-
getRunners: Effect.sync(() => Array.from(MutableHashMap.values(runners)
|
|
211
|
-
register: (runner) =>
|
|
209
|
+
getRunners: Effect.sync(() => Array.from(MutableHashMap.values(runners))),
|
|
210
|
+
register: (runner, healthy) =>
|
|
212
211
|
Effect.sync(() => {
|
|
213
|
-
MutableHashMap.set(runners, runner.address, runner)
|
|
212
|
+
MutableHashMap.set(runners, runner.address, [runner, healthy])
|
|
214
213
|
return MachineId.make(id++)
|
|
215
214
|
}),
|
|
216
215
|
unregister: (address) =>
|
|
217
216
|
Effect.sync(() => {
|
|
218
217
|
MutableHashMap.remove(runners, address)
|
|
219
218
|
}),
|
|
220
|
-
setRunnerHealth: () =>
|
|
219
|
+
setRunnerHealth: (address, healthy) =>
|
|
220
|
+
Effect.sync(() => {
|
|
221
|
+
MutableHashMap.modify(runners, address, ([runner]) => [runner, healthy] as const)
|
|
222
|
+
}),
|
|
221
223
|
acquire: (_address, shardIds) => {
|
|
222
224
|
acquired = Array.from(shardIds)
|
|
223
225
|
return Effect.succeed(acquired)
|
|
@@ -240,6 +240,8 @@ const make = Effect.gen(function*() {
|
|
|
240
240
|
const runnerStorage = yield* RunnerStorage
|
|
241
241
|
|
|
242
242
|
const entityManagers = new Map<string, EntityManagerState>()
|
|
243
|
+
let entityRegistrationStartMillis: number | undefined
|
|
244
|
+
let entityRegistrationFallbackStartMillis: number | undefined
|
|
243
245
|
|
|
244
246
|
const shardAssignments = MutableHashMap.empty<ShardId, RunnerAddress>()
|
|
245
247
|
const selfShards = MutableHashSet.empty<ShardId>()
|
|
@@ -591,7 +593,6 @@ const make = Effect.gen(function*() {
|
|
|
591
593
|
const entityRegistrationTimeoutMillis = Duration.toMillis(
|
|
592
594
|
Duration.fromInputUnsafe(config.entityRegistrationTimeout)
|
|
593
595
|
)
|
|
594
|
-
const storageStartMillis = clock.currentTimeMillisUnsafe()
|
|
595
596
|
|
|
596
597
|
yield* Effect.gen(function*() {
|
|
597
598
|
yield* Effect.logDebug("Starting")
|
|
@@ -617,8 +618,15 @@ const make = Effect.gen(function*() {
|
|
|
617
618
|
}
|
|
618
619
|
const state = entityManagers.get(address.entityType)
|
|
619
620
|
if (!state) {
|
|
620
|
-
const
|
|
621
|
-
|
|
621
|
+
const now = clock.currentTimeMillisUnsafe()
|
|
622
|
+
const registrationStarted = entityRegistrationStartMillis !== undefined
|
|
623
|
+
const timeoutStartMillis = entityRegistrationStartMillis ??
|
|
624
|
+
(entityRegistrationFallbackStartMillis ??= now)
|
|
625
|
+
// If registration never starts, allow two intervals from the first missing read before failing.
|
|
626
|
+
const timeoutMillis = registrationStarted
|
|
627
|
+
? entityRegistrationTimeoutMillis
|
|
628
|
+
: entityRegistrationTimeoutMillis * 2
|
|
629
|
+
if (now - timeoutStartMillis < timeoutMillis) {
|
|
622
630
|
// reset address in the case that the entity is slow to register
|
|
623
631
|
MutableHashSet.add(resetAddresses, address)
|
|
624
632
|
return Effect.void
|
|
@@ -961,13 +969,13 @@ const make = Effect.gen(function*() {
|
|
|
961
969
|
void,
|
|
962
970
|
MailboxFull | AlreadyProcessingMessage | PersistenceError
|
|
963
971
|
> {
|
|
972
|
+
const isPersisted = Context.get(
|
|
973
|
+
message._tag === "OutgoingRequest" ? message.annotations : message.rpc.annotations,
|
|
974
|
+
Persisted
|
|
975
|
+
)
|
|
964
976
|
return Effect.catchFilter(
|
|
965
977
|
Effect.suspend(() => {
|
|
966
978
|
const address = message.envelope.address
|
|
967
|
-
const isPersisted = Context.get(
|
|
968
|
-
message._tag === "OutgoingRequest" ? message.annotations : message.rpc.annotations,
|
|
969
|
-
Persisted
|
|
970
|
-
)
|
|
971
979
|
if (isPersisted && !storageEnabled) {
|
|
972
980
|
return Effect.die("Sharding.sendOutgoing: Persisted messages require MessageStorage")
|
|
973
981
|
}
|
|
@@ -989,6 +997,25 @@ const make = Effect.gen(function*() {
|
|
|
989
997
|
? Result.succeed(error)
|
|
990
998
|
: Result.fail(error),
|
|
991
999
|
(error) => {
|
|
1000
|
+
// Abandon the message during teardown: retrying would loop forever once the runner is shutting down
|
|
1001
|
+
if (error._tag === "EntityNotAssignedToRunner") {
|
|
1002
|
+
const targetManager = entityManagers.get(message.envelope.address.entityType)
|
|
1003
|
+
const cannotRecover = MutableRef.get(isShutdown) ||
|
|
1004
|
+
(targetManager !== undefined && targetManager.status !== "alive")
|
|
1005
|
+
if (cannotRecover) {
|
|
1006
|
+
if (!isPersisted) {
|
|
1007
|
+
return Effect.logDebug("Abandoning outgoing message during shutdown", message.envelope.address)
|
|
1008
|
+
}
|
|
1009
|
+
const persist = message._tag === "OutgoingRequest"
|
|
1010
|
+
? storage.saveRequest(message)
|
|
1011
|
+
: storage.saveEnvelope(message)
|
|
1012
|
+
return Effect.catchTag(persist, "MalformedMessage", Effect.die).pipe(
|
|
1013
|
+
Effect.andThen(
|
|
1014
|
+
Effect.logWarning("Persisting outgoing message abandoned during shutdown", message.envelope.address)
|
|
1015
|
+
)
|
|
1016
|
+
)
|
|
1017
|
+
}
|
|
1018
|
+
}
|
|
992
1019
|
if (retries === 0) {
|
|
993
1020
|
return Effect.die(error)
|
|
994
1021
|
}
|
|
@@ -1461,6 +1488,7 @@ const make = Effect.gen(function*() {
|
|
|
1461
1488
|
// register entities while storage is idle
|
|
1462
1489
|
// this ensures message order is preserved
|
|
1463
1490
|
yield* withStorageReadLock(Effect.sync(() => {
|
|
1491
|
+
entityRegistrationStartMillis ??= clock.currentTimeMillisUnsafe()
|
|
1464
1492
|
entityManagers.set(entity.type, state)
|
|
1465
1493
|
if (entityManagerLatches.has(entity.type)) {
|
|
1466
1494
|
entityManagerLatches.get(entity.type)!.openUnsafe()
|
|
@@ -110,7 +110,7 @@ export const make = Effect.fnUntraced(function*<
|
|
|
110
110
|
const clock = yield* Clock
|
|
111
111
|
const context = yield* Effect.context<Rpc.Services<Rpcs> | Rpc.Middleware<Rpcs> | RX>()
|
|
112
112
|
const defectRetryPolicy = options.defectRetryPolicy
|
|
113
|
-
? Schedule.
|
|
113
|
+
? Schedule.concat(options.defectRetryPolicy, defaultRetryPolicy)
|
|
114
114
|
: defaultRetryPolicy
|
|
115
115
|
const retryDriver = yield* Schedule.toStepWithSleep(defectRetryPolicy)
|
|
116
116
|
const entityRpcs = new Map(entity.protocol.requests)
|
|
@@ -65,7 +65,7 @@ export class ResourceMap<K, A, E> {
|
|
|
65
65
|
if (existing) {
|
|
66
66
|
return Deferred.await(existing.deferred)
|
|
67
67
|
}
|
|
68
|
-
const scope =
|
|
68
|
+
const scope = Scope.makeUnsafe()
|
|
69
69
|
const deferred = Deferred.makeUnsafe<A, E>()
|
|
70
70
|
backingSet(this.entries, key, { scope, deferred })
|
|
71
71
|
return Effect.onExit(this.lookup(key, scope), (exit) => {
|
|
@@ -73,7 +73,10 @@ export class ResourceMap<K, A, E> {
|
|
|
73
73
|
return Deferred.done(deferred, exit)
|
|
74
74
|
}
|
|
75
75
|
backingDelete(this.entries, key)
|
|
76
|
-
return
|
|
76
|
+
return Effect.andThen(
|
|
77
|
+
Deferred.done(deferred, exit),
|
|
78
|
+
Scope.close(scope, exit)
|
|
79
|
+
)
|
|
77
80
|
})
|
|
78
81
|
})
|
|
79
82
|
}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import type * as Cause from "../../../Cause.ts"
|
|
1
2
|
import * as Effect from "../../../Effect.ts"
|
|
2
3
|
import * as Exit from "../../../Exit.ts"
|
|
3
4
|
import * as Latch from "../../../Latch.ts"
|
|
@@ -7,7 +8,7 @@ import * as Scope from "../../../Scope.ts"
|
|
|
7
8
|
import { internalInterruptors } from "./interruptors.ts"
|
|
8
9
|
|
|
9
10
|
/** @internal */
|
|
10
|
-
export type State<A> = {
|
|
11
|
+
export type State<A, E> = {
|
|
11
12
|
readonly _tag: "Closed"
|
|
12
13
|
} | {
|
|
13
14
|
readonly _tag: "Acquiring"
|
|
@@ -16,6 +17,10 @@ export type State<A> = {
|
|
|
16
17
|
readonly _tag: "Acquired"
|
|
17
18
|
readonly scope: Scope.Closeable
|
|
18
19
|
readonly value: A
|
|
20
|
+
} | {
|
|
21
|
+
readonly _tag: "Failed"
|
|
22
|
+
readonly scope: Scope.Closeable
|
|
23
|
+
readonly cause: Cause.Cause<E>
|
|
19
24
|
}
|
|
20
25
|
|
|
21
26
|
/** @internal */
|
|
@@ -24,7 +29,7 @@ export class ResourceRef<A, E = never> {
|
|
|
24
29
|
parentScope: Scope.Scope,
|
|
25
30
|
acquire: (scope: Scope.Scope) => Effect.Effect<A, E>
|
|
26
31
|
) {
|
|
27
|
-
const state = MutableRef.make<State<A>>({ _tag: "Closed" })
|
|
32
|
+
const state = MutableRef.make<State<A, E>>({ _tag: "Closed" })
|
|
28
33
|
|
|
29
34
|
yield* Scope.addFinalizerExit(parentScope, (exit) => {
|
|
30
35
|
const s = MutableRef.get(state)
|
|
@@ -44,10 +49,10 @@ export class ResourceRef<A, E = never> {
|
|
|
44
49
|
return new ResourceRef(state, acquire)
|
|
45
50
|
})
|
|
46
51
|
|
|
47
|
-
readonly state: MutableRef.MutableRef<State<A>>
|
|
52
|
+
readonly state: MutableRef.MutableRef<State<A, E>>
|
|
48
53
|
readonly acquire: (scope: Scope.Scope) => Effect.Effect<A, E>
|
|
49
54
|
constructor(
|
|
50
|
-
state: MutableRef.MutableRef<State<A>>,
|
|
55
|
+
state: MutableRef.MutableRef<State<A, E>>,
|
|
51
56
|
acquire: (scope: Scope.Scope) => Effect.Effect<A, E>
|
|
52
57
|
) {
|
|
53
58
|
this.state = state
|
|
@@ -84,15 +89,32 @@ export class ResourceRef<A, E = never> {
|
|
|
84
89
|
MutableRef.set(this.state, { _tag: "Acquired", scope, value })
|
|
85
90
|
return this.latch.open
|
|
86
91
|
})
|
|
92
|
+
).pipe(
|
|
93
|
+
Effect.onExit((exit) => {
|
|
94
|
+
if (Exit.isSuccess(exit)) {
|
|
95
|
+
return Effect.void
|
|
96
|
+
}
|
|
97
|
+
return Scope.close(scope, exit).pipe(
|
|
98
|
+
Effect.ensuring(Effect.sync(() => {
|
|
99
|
+
const state = this.state.current
|
|
100
|
+
if (state._tag === "Acquiring" && state.scope === scope) {
|
|
101
|
+
MutableRef.set(this.state, { _tag: "Failed", scope, cause: exit.cause })
|
|
102
|
+
this.latch.openUnsafe()
|
|
103
|
+
}
|
|
104
|
+
}))
|
|
105
|
+
)
|
|
106
|
+
})
|
|
87
107
|
)
|
|
88
108
|
}
|
|
89
109
|
|
|
90
|
-
await: Effect.Effect<A> = Effect.suspend(() => {
|
|
110
|
+
await: Effect.Effect<A, E> = Effect.suspend(() => {
|
|
91
111
|
const s = this.state.current
|
|
92
112
|
if (s._tag === "Closed") {
|
|
93
113
|
return Effect.interrupt
|
|
94
114
|
} else if (s._tag === "Acquired") {
|
|
95
115
|
return Effect.succeed(s.value)
|
|
116
|
+
} else if (s._tag === "Failed") {
|
|
117
|
+
return Effect.failCause(s.cause)
|
|
96
118
|
}
|
|
97
119
|
return Effect.flatMap(this.latch.await, () => this.await)
|
|
98
120
|
})
|
|
@@ -184,7 +184,8 @@ const makeTracerEffect = Effect.gen(function*() {
|
|
|
184
184
|
return Tracer.make({
|
|
185
185
|
span(options) {
|
|
186
186
|
const span = currentTracer.span(options)
|
|
187
|
-
|
|
187
|
+
// the span is mutated in place, so send a snapshot of its current state
|
|
188
|
+
client.sendUnsafe({ ...span })
|
|
188
189
|
const oldEvent = span.event
|
|
189
190
|
span.event = function(this: Tracer.Span, name, startTime, attributes) {
|
|
190
191
|
client.sendUnsafe({
|
|
@@ -201,7 +202,7 @@ const makeTracerEffect = Effect.gen(function*() {
|
|
|
201
202
|
const oldEnd = span.end
|
|
202
203
|
span.end = function(this: Tracer.Span, endTime, exit) {
|
|
203
204
|
oldEnd.call(this, endTime, exit)
|
|
204
|
-
client.sendUnsafe(span)
|
|
205
|
+
client.sendUnsafe({ ...span })
|
|
205
206
|
}
|
|
206
207
|
|
|
207
208
|
return span
|
|
@@ -0,0 +1,174 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Parses INI configuration files.
|
|
3
|
+
*
|
|
4
|
+
* This module contains the decoding surface used by Effect's CLI without
|
|
5
|
+
* pulling in the complete `ini` package.
|
|
6
|
+
*
|
|
7
|
+
* @since 4.0.0
|
|
8
|
+
*/
|
|
9
|
+
|
|
10
|
+
/*
|
|
11
|
+
* The parser is adapted from `ini` 7.0.0.
|
|
12
|
+
*
|
|
13
|
+
* Copyright (c) Isaac Z. Schlueter and Contributors
|
|
14
|
+
*
|
|
15
|
+
* Permission to use, copy, modify, and/or distribute this software for any
|
|
16
|
+
* purpose with or without fee is hereby granted, provided that the above
|
|
17
|
+
* copyright notice and this permission notice appear in all copies.
|
|
18
|
+
*
|
|
19
|
+
* THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
|
|
20
|
+
* WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
|
|
21
|
+
* MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY
|
|
22
|
+
* SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
|
|
23
|
+
* WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION
|
|
24
|
+
* OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN
|
|
25
|
+
* CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
|
26
|
+
*/
|
|
27
|
+
|
|
28
|
+
const hasOwn = Object.prototype.hasOwnProperty
|
|
29
|
+
|
|
30
|
+
const splitSections = (value: string): Array<string> => {
|
|
31
|
+
const sections: Array<string> = []
|
|
32
|
+
let start = 0
|
|
33
|
+
let index = 0
|
|
34
|
+
while ((index = value.indexOf(".", index)) !== -1) {
|
|
35
|
+
if (index === 0 || value[index - 1] !== "\\") {
|
|
36
|
+
sections.push(value.slice(start, index))
|
|
37
|
+
start = index + 1
|
|
38
|
+
}
|
|
39
|
+
index++
|
|
40
|
+
}
|
|
41
|
+
sections.push(value.slice(start))
|
|
42
|
+
return sections
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
const isQuoted = (value: string): boolean =>
|
|
46
|
+
value.length >= 2 &&
|
|
47
|
+
((value.startsWith("\"") && value.endsWith("\"")) ||
|
|
48
|
+
(value.startsWith("'") && value.endsWith("'")))
|
|
49
|
+
|
|
50
|
+
const unquote = (input: string | undefined): string => {
|
|
51
|
+
let value = (input ?? "").trim()
|
|
52
|
+
if (isQuoted(value)) {
|
|
53
|
+
if (value[0] === "'") {
|
|
54
|
+
value = value.slice(1, -1)
|
|
55
|
+
}
|
|
56
|
+
try {
|
|
57
|
+
return JSON.parse(value)
|
|
58
|
+
} catch {
|
|
59
|
+
return value
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
let escaped = false
|
|
64
|
+
let output = ""
|
|
65
|
+
for (const character of value) {
|
|
66
|
+
if (escaped) {
|
|
67
|
+
output += character === ";" || character === "#" || character === "\\"
|
|
68
|
+
? character
|
|
69
|
+
: `\\${character}`
|
|
70
|
+
escaped = false
|
|
71
|
+
} else if (character === ";" || character === "#") {
|
|
72
|
+
break
|
|
73
|
+
} else if (character === "\\") {
|
|
74
|
+
escaped = true
|
|
75
|
+
} else {
|
|
76
|
+
output += character
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
return output.trim()
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
/**
|
|
83
|
+
* Parses an INI document into a null-prototype record.
|
|
84
|
+
*
|
|
85
|
+
* Section names separated by dots become nested records, repeated keys ending
|
|
86
|
+
* in `[]` become arrays, and the scalar values `true`, `false`, and `null` are
|
|
87
|
+
* decoded. Other scalar values remain strings.
|
|
88
|
+
*
|
|
89
|
+
* @category decoding
|
|
90
|
+
* @since 4.0.0
|
|
91
|
+
*/
|
|
92
|
+
export const parse = (input: string): Record<string, unknown> => {
|
|
93
|
+
const output: Record<string, any> = Object.create(null)
|
|
94
|
+
let current = output
|
|
95
|
+
const sectionPattern = /^\[([^\]]*)\]\s*$/
|
|
96
|
+
const propertyPattern = /^([^=]+)(=(.*))?$/
|
|
97
|
+
|
|
98
|
+
for (const line of input.split(/[\r\n]+/g)) {
|
|
99
|
+
if (line.length === 0 || /^\s*(?:[;#]|$)/.test(line)) {
|
|
100
|
+
continue
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
const sectionMatch = sectionPattern.exec(line)
|
|
104
|
+
if (sectionMatch !== null) {
|
|
105
|
+
const section = unquote(sectionMatch[1])
|
|
106
|
+
if (section === "__proto__") {
|
|
107
|
+
current = Object.create(null)
|
|
108
|
+
} else {
|
|
109
|
+
current = output[section] ??= Object.create(null)
|
|
110
|
+
}
|
|
111
|
+
continue
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
const propertyMatch = propertyPattern.exec(line)
|
|
115
|
+
if (propertyMatch === null) {
|
|
116
|
+
continue
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
const rawKey = unquote(propertyMatch[1])
|
|
120
|
+
const array = rawKey.length > 2 && rawKey.endsWith("[]")
|
|
121
|
+
const key = array ? rawKey.slice(0, -2) : rawKey
|
|
122
|
+
if (key === "__proto__") {
|
|
123
|
+
continue
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
const rawValue = propertyMatch[2] === undefined ? true : unquote(propertyMatch[3])
|
|
127
|
+
const value = rawValue === "true" || rawValue === "false" || rawValue === "null"
|
|
128
|
+
? JSON.parse(rawValue)
|
|
129
|
+
: rawValue
|
|
130
|
+
|
|
131
|
+
if (array) {
|
|
132
|
+
if (!hasOwn.call(current, key)) {
|
|
133
|
+
current[key] = []
|
|
134
|
+
} else if (!Array.isArray(current[key])) {
|
|
135
|
+
current[key] = [current[key]]
|
|
136
|
+
}
|
|
137
|
+
}
|
|
138
|
+
if (Array.isArray(current[key])) {
|
|
139
|
+
current[key].push(value)
|
|
140
|
+
} else {
|
|
141
|
+
current[key] = value
|
|
142
|
+
}
|
|
143
|
+
}
|
|
144
|
+
|
|
145
|
+
const remove: Array<string> = []
|
|
146
|
+
for (const section of Object.keys(output)) {
|
|
147
|
+
if (typeof output[section] !== "object" || output[section] === null || Array.isArray(output[section])) {
|
|
148
|
+
continue
|
|
149
|
+
}
|
|
150
|
+
|
|
151
|
+
const parts = splitSections(section)
|
|
152
|
+
const last = parts.pop()!
|
|
153
|
+
const key = last.replace(/\\\./g, ".")
|
|
154
|
+
current = output
|
|
155
|
+
for (const part of parts) {
|
|
156
|
+
if (part === "__proto__") {
|
|
157
|
+
continue
|
|
158
|
+
}
|
|
159
|
+
if (!hasOwn.call(current, part) || typeof current[part] !== "object" || current[part] === null) {
|
|
160
|
+
current[part] = Object.create(null)
|
|
161
|
+
}
|
|
162
|
+
current = current[part]
|
|
163
|
+
}
|
|
164
|
+
if (current === output && key === last) {
|
|
165
|
+
continue
|
|
166
|
+
}
|
|
167
|
+
current[key] = output[section]
|
|
168
|
+
remove.push(section)
|
|
169
|
+
}
|
|
170
|
+
for (const section of remove) {
|
|
171
|
+
delete output[section]
|
|
172
|
+
}
|
|
173
|
+
return output
|
|
174
|
+
}
|