effect 4.0.0-beta.100 → 4.0.0-beta.102
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/Array.d.ts.map +1 -1
- package/dist/Array.js +81 -5
- package/dist/Array.js.map +1 -1
- package/dist/Channel.d.ts.map +1 -1
- package/dist/Channel.js +27 -9
- package/dist/Channel.js.map +1 -1
- package/dist/Config.d.ts +1 -1
- package/dist/Config.d.ts.map +1 -1
- package/dist/Config.js +6 -5
- package/dist/Config.js.map +1 -1
- package/dist/ConfigProvider.js +7 -7
- package/dist/ConfigProvider.js.map +1 -1
- package/dist/Data.d.ts.map +1 -1
- package/dist/Data.js +2 -1
- package/dist/Data.js.map +1 -1
- package/dist/Effect.d.ts +61 -100
- package/dist/Effect.d.ts.map +1 -1
- package/dist/Effect.js +66 -39
- package/dist/Effect.js.map +1 -1
- package/dist/FiberHandle.d.ts.map +1 -1
- package/dist/FiberHandle.js +3 -2
- package/dist/FiberHandle.js.map +1 -1
- package/dist/Iterable.d.ts.map +1 -1
- package/dist/Iterable.js +2 -1
- package/dist/Iterable.js.map +1 -1
- package/dist/JsonPatch.d.ts.map +1 -1
- package/dist/JsonPatch.js +4 -3
- package/dist/JsonPatch.js.map +1 -1
- package/dist/JsonSchema.d.ts.map +1 -1
- package/dist/JsonSchema.js +9 -11
- package/dist/JsonSchema.js.map +1 -1
- package/dist/Logger.d.ts.map +1 -1
- package/dist/Logger.js +3 -2
- package/dist/Logger.js.map +1 -1
- package/dist/ManagedRuntime.d.ts +9 -0
- package/dist/ManagedRuntime.d.ts.map +1 -1
- package/dist/ManagedRuntime.js +3 -0
- package/dist/ManagedRuntime.js.map +1 -1
- package/dist/Metric.d.ts.map +1 -1
- package/dist/Metric.js +4 -3
- package/dist/Metric.js.map +1 -1
- package/dist/MutableList.d.ts.map +1 -1
- package/dist/MutableList.js +4 -0
- package/dist/MutableList.js.map +1 -1
- package/dist/Optic.d.ts.map +1 -1
- package/dist/Optic.js +5 -4
- package/dist/Optic.js.map +1 -1
- package/dist/Option.d.ts.map +1 -1
- package/dist/Option.js +2 -1
- package/dist/Option.js.map +1 -1
- package/dist/PartitionedSemaphore.d.ts.map +1 -1
- package/dist/PartitionedSemaphore.js +1 -4
- package/dist/PartitionedSemaphore.js.map +1 -1
- package/dist/Record.d.ts +93 -1
- package/dist/Record.d.ts.map +1 -1
- package/dist/Record.js +57 -19
- package/dist/Record.js.map +1 -1
- package/dist/References.d.ts +0 -45
- package/dist/References.d.ts.map +1 -1
- package/dist/References.js +0 -45
- package/dist/References.js.map +1 -1
- package/dist/Request.d.ts.map +1 -1
- package/dist/Request.js +9 -6
- package/dist/Request.js.map +1 -1
- package/dist/Result.d.ts.map +1 -1
- package/dist/Result.js +2 -1
- package/dist/Result.js.map +1 -1
- package/dist/Schema.d.ts +1269 -496
- package/dist/Schema.d.ts.map +1 -1
- package/dist/Schema.js +2308 -614
- package/dist/Schema.js.map +1 -1
- package/dist/SchemaAST.d.ts +2 -2
- package/dist/SchemaAST.d.ts.map +1 -1
- package/dist/SchemaAST.js +189 -130
- package/dist/SchemaAST.js.map +1 -1
- package/dist/SchemaError.js +1 -1
- package/dist/SchemaError.js.map +1 -1
- package/dist/SchemaGetter.d.ts +13 -11
- package/dist/SchemaGetter.d.ts.map +1 -1
- package/dist/SchemaGetter.js +34 -24
- package/dist/SchemaGetter.js.map +1 -1
- package/dist/SchemaIssue.js +1 -1
- package/dist/SchemaIssue.js.map +1 -1
- package/dist/SchemaParser.d.ts.map +1 -1
- package/dist/SchemaParser.js +1 -12
- package/dist/SchemaParser.js.map +1 -1
- package/dist/SchemaRepresentation.d.ts +403 -1504
- package/dist/SchemaRepresentation.d.ts.map +1 -1
- package/dist/SchemaRepresentation.js +294 -2852
- package/dist/SchemaRepresentation.js.map +1 -1
- package/dist/SchemaTransformation.d.ts +2 -2
- package/dist/SchemaTransformation.js +3 -3
- package/dist/SchemaTransformation.js.map +1 -1
- package/dist/Semaphore.d.ts +5 -3
- package/dist/Semaphore.d.ts.map +1 -1
- package/dist/Semaphore.js.map +1 -1
- package/dist/Stream.d.ts +15 -9
- package/dist/Stream.d.ts.map +1 -1
- package/dist/Stream.js +46 -16
- package/dist/Stream.js.map +1 -1
- package/dist/Struct.d.ts.map +1 -1
- package/dist/Struct.js +5 -4
- package/dist/Struct.js.map +1 -1
- package/dist/Types.d.ts +1 -3
- package/dist/Types.d.ts.map +1 -1
- package/dist/index.d.ts +0 -4
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +0 -4
- package/dist/index.js.map +1 -1
- package/dist/internal/core.js +3 -2
- package/dist/internal/core.js.map +1 -1
- package/dist/internal/effect.js +119 -53
- package/dist/internal/effect.js.map +1 -1
- package/dist/internal/matcher.js +1 -1
- package/dist/internal/matcher.js.map +1 -1
- package/dist/internal/record.d.ts +0 -3
- package/dist/internal/record.d.ts.map +1 -1
- package/dist/internal/record.js +10 -5
- package/dist/internal/record.js.map +1 -1
- package/dist/internal/references.js +0 -4
- package/dist/internal/references.js.map +1 -1
- package/dist/internal/schema/annotations.js +12 -0
- package/dist/internal/schema/annotations.js.map +1 -1
- package/dist/internal/schema/fromJsonSchemaDocument.d.ts +2 -0
- package/dist/internal/schema/fromJsonSchemaDocument.d.ts.map +1 -0
- package/dist/internal/schema/fromJsonSchemaDocument.js +743 -0
- package/dist/internal/schema/fromJsonSchemaDocument.js.map +1 -0
- package/dist/internal/schema/fromRepresentation.d.ts +2 -0
- package/dist/internal/schema/fromRepresentation.d.ts.map +1 -0
- package/dist/internal/schema/fromRepresentation.js +252 -0
- package/dist/internal/schema/fromRepresentation.js.map +1 -0
- package/dist/internal/schema/schema.js +28 -40
- package/dist/internal/schema/schema.js.map +1 -1
- package/dist/internal/schema/{arbitrary.d.ts → toArbitrary.d.ts} +1 -1
- package/dist/internal/schema/toArbitrary.d.ts.map +1 -0
- package/dist/internal/schema/{arbitrary.js → toArbitrary.js} +8 -9
- package/dist/internal/schema/toArbitrary.js.map +1 -0
- package/dist/internal/schema/toCodeDocument.d.ts +2 -0
- package/dist/internal/schema/toCodeDocument.d.ts.map +1 -0
- package/dist/internal/schema/toCodeDocument.js +438 -0
- package/dist/internal/schema/toCodeDocument.js.map +1 -0
- package/dist/internal/schema/toEquivalence.d.ts +2 -0
- package/dist/internal/schema/toEquivalence.d.ts.map +1 -0
- package/dist/internal/schema/{equivalence.js → toEquivalence.js} +15 -13
- package/dist/internal/schema/toEquivalence.js.map +1 -0
- package/dist/internal/schema/toJsonSchemaDocument.d.ts +2 -0
- package/dist/internal/schema/toJsonSchemaDocument.d.ts.map +1 -0
- package/dist/internal/schema/toJsonSchemaDocument.js +466 -0
- package/dist/internal/schema/toJsonSchemaDocument.js.map +1 -0
- package/dist/internal/schema/toRepresentation.d.ts +2 -0
- package/dist/internal/schema/toRepresentation.d.ts.map +1 -0
- package/dist/internal/schema/toRepresentation.js +369 -0
- package/dist/internal/schema/toRepresentation.js.map +1 -0
- package/dist/internal/stackTraceLimit.js +3 -6
- package/dist/internal/stackTraceLimit.js.map +1 -1
- package/dist/testing/TestClock.js +4 -1
- package/dist/testing/TestClock.js.map +1 -1
- package/dist/unstable/ai/AiError.d.ts +26 -26
- package/dist/unstable/ai/AiError.d.ts.map +1 -1
- package/dist/unstable/ai/AiError.js +5 -4
- package/dist/unstable/ai/AiError.js.map +1 -1
- package/dist/unstable/ai/AnthropicStructuredOutput.d.ts +21 -6
- package/dist/unstable/ai/AnthropicStructuredOutput.d.ts.map +1 -1
- package/dist/unstable/ai/AnthropicStructuredOutput.js +86 -316
- package/dist/unstable/ai/AnthropicStructuredOutput.js.map +1 -1
- package/dist/unstable/ai/EmbeddingModel.d.ts +1 -1
- package/dist/unstable/ai/EmbeddingModel.js +1 -1
- package/dist/unstable/ai/EmbeddingModel.js.map +1 -1
- package/dist/unstable/ai/LanguageModel.d.ts +4 -1
- package/dist/unstable/ai/LanguageModel.d.ts.map +1 -1
- package/dist/unstable/ai/LanguageModel.js +19 -17
- package/dist/unstable/ai/LanguageModel.js.map +1 -1
- package/dist/unstable/ai/McpSchema.d.ts +197 -197
- package/dist/unstable/ai/McpSchema.d.ts.map +1 -1
- package/dist/unstable/ai/McpSchema.js +13 -13
- package/dist/unstable/ai/McpSchema.js.map +1 -1
- package/dist/unstable/ai/McpServer.d.ts +4 -4
- package/dist/unstable/ai/McpServer.d.ts.map +1 -1
- package/dist/unstable/ai/McpServer.js +116 -49
- package/dist/unstable/ai/McpServer.js.map +1 -1
- package/dist/unstable/ai/OpenAiStructuredOutput.d.ts +32 -10
- package/dist/unstable/ai/OpenAiStructuredOutput.d.ts.map +1 -1
- package/dist/unstable/ai/OpenAiStructuredOutput.js +193 -377
- package/dist/unstable/ai/OpenAiStructuredOutput.js.map +1 -1
- package/dist/unstable/ai/Response.d.ts +19 -19
- package/dist/unstable/ai/Response.d.ts.map +1 -1
- package/dist/unstable/ai/Response.js +14 -14
- package/dist/unstable/ai/Response.js.map +1 -1
- package/dist/unstable/ai/Tool.d.ts +4 -0
- package/dist/unstable/ai/Tool.d.ts.map +1 -1
- package/dist/unstable/ai/Tool.js +11 -3
- package/dist/unstable/ai/Tool.js.map +1 -1
- package/dist/unstable/ai/Toolkit.d.ts +9 -1
- package/dist/unstable/ai/Toolkit.d.ts.map +1 -1
- package/dist/unstable/ai/Toolkit.js +14 -10
- package/dist/unstable/ai/Toolkit.js.map +1 -1
- package/dist/unstable/ai/internal/codec-transformer.js +15 -12
- package/dist/unstable/ai/internal/codec-transformer.js.map +1 -1
- package/dist/unstable/ai/internal/structured-output.d.ts +2 -0
- package/dist/unstable/ai/internal/structured-output.d.ts.map +1 -0
- package/dist/unstable/ai/internal/structured-output.js +316 -0
- package/dist/unstable/ai/internal/structured-output.js.map +1 -0
- package/dist/unstable/cli/CliError.d.ts +40 -2
- package/dist/unstable/cli/CliError.d.ts.map +1 -1
- package/dist/unstable/cli/CliError.js +45 -6
- package/dist/unstable/cli/CliError.js.map +1 -1
- package/dist/unstable/cli/Command.js +14 -5
- package/dist/unstable/cli/Command.js.map +1 -1
- package/dist/unstable/cli/Param.js +3 -3
- package/dist/unstable/cli/Param.js.map +1 -1
- package/dist/unstable/cli/Primitive.js +1 -1
- package/dist/unstable/cli/Primitive.js.map +1 -1
- package/dist/unstable/cli/internal/command.d.ts +3 -1
- package/dist/unstable/cli/internal/command.d.ts.map +1 -1
- package/dist/unstable/cli/internal/command.js +11 -4
- package/dist/unstable/cli/internal/command.js.map +1 -1
- package/dist/unstable/cli/internal/config.d.ts +0 -48
- package/dist/unstable/cli/internal/config.d.ts.map +1 -1
- package/dist/unstable/cli/internal/config.js +8 -10
- package/dist/unstable/cli/internal/config.js.map +1 -1
- package/dist/unstable/cluster/ClusterWorkflowEngine.js +1 -1
- package/dist/unstable/cluster/ClusterWorkflowEngine.js.map +1 -1
- package/dist/unstable/cluster/Entity.js +1 -1
- package/dist/unstable/cluster/Entity.js.map +1 -1
- package/dist/unstable/cluster/Envelope.d.ts.map +1 -1
- package/dist/unstable/cluster/Envelope.js +2 -1
- package/dist/unstable/cluster/Envelope.js.map +1 -1
- package/dist/unstable/cluster/Reply.js +1 -1
- package/dist/unstable/cluster/Reply.js.map +1 -1
- package/dist/unstable/cluster/Runner.d.ts +1 -1
- package/dist/unstable/cluster/Runner.js +1 -1
- package/dist/unstable/cluster/Runner.js.map +1 -1
- package/dist/unstable/cluster/RunnerAddress.d.ts +1 -1
- package/dist/unstable/cluster/RunnerAddress.js +1 -1
- package/dist/unstable/cluster/RunnerAddress.js.map +1 -1
- package/dist/unstable/cluster/ShardId.js +1 -1
- package/dist/unstable/cluster/ShardId.js.map +1 -1
- package/dist/unstable/cluster/Sharding.d.ts.map +1 -1
- package/dist/unstable/cluster/Sharding.js +125 -24
- package/dist/unstable/cluster/Sharding.js.map +1 -1
- package/dist/unstable/cluster/ShardingConfig.d.ts +10 -2
- package/dist/unstable/cluster/ShardingConfig.d.ts.map +1 -1
- package/dist/unstable/cluster/ShardingConfig.js.map +1 -1
- package/dist/unstable/cluster/SingleRunner.d.ts +4 -2
- package/dist/unstable/cluster/SingleRunner.d.ts.map +1 -1
- package/dist/unstable/cluster/SingleRunner.js +2 -1
- package/dist/unstable/cluster/SingleRunner.js.map +1 -1
- package/dist/unstable/cluster/SqlMessageStorage.d.ts +7 -4
- package/dist/unstable/cluster/SqlMessageStorage.d.ts.map +1 -1
- package/dist/unstable/cluster/SqlMessageStorage.js +55 -24
- package/dist/unstable/cluster/SqlMessageStorage.js.map +1 -1
- package/dist/unstable/cluster/SqlRunnerStorage.d.ts.map +1 -1
- package/dist/unstable/cluster/SqlRunnerStorage.js +109 -62
- package/dist/unstable/cluster/SqlRunnerStorage.js.map +1 -1
- package/dist/unstable/cluster/internal/entityManager.js +19 -7
- package/dist/unstable/cluster/internal/entityManager.js.map +1 -1
- package/dist/unstable/cluster/internal/shardLock.d.ts +2 -0
- package/dist/unstable/cluster/internal/shardLock.d.ts.map +1 -0
- package/dist/unstable/cluster/internal/shardLock.js +4 -0
- package/dist/unstable/cluster/internal/shardLock.js.map +1 -0
- package/dist/unstable/devtools/DevToolsSchema.d.ts +20 -20
- package/dist/unstable/devtools/DevToolsSchema.d.ts.map +1 -1
- package/dist/unstable/devtools/DevToolsSchema.js +8 -5
- package/dist/unstable/devtools/DevToolsSchema.js.map +1 -1
- package/dist/unstable/eventlog/EventJournal.d.ts +1 -1
- package/dist/unstable/eventlog/EventJournal.js +1 -1
- package/dist/unstable/eventlog/EventJournal.js.map +1 -1
- package/dist/unstable/eventlog/EventLog.d.ts.map +1 -1
- package/dist/unstable/eventlog/EventLog.js +15 -11
- package/dist/unstable/eventlog/EventLog.js.map +1 -1
- package/dist/unstable/eventlog/EventLogEncryption.d.ts +1 -1
- package/dist/unstable/eventlog/EventLogEncryption.js +1 -1
- package/dist/unstable/eventlog/EventLogEncryption.js.map +1 -1
- package/dist/unstable/eventlog/EventLogMessage.d.ts +26 -26
- package/dist/unstable/eventlog/EventLogMessage.d.ts.map +1 -1
- package/dist/unstable/eventlog/EventLogMessage.js +8 -3
- package/dist/unstable/eventlog/EventLogMessage.js.map +1 -1
- package/dist/unstable/eventlog/EventLogRemote.d.ts +1 -1
- package/dist/unstable/eventlog/SqlEventJournal.js +2 -2
- package/dist/unstable/eventlog/SqlEventJournal.js.map +1 -1
- package/dist/unstable/eventlog/SqlEventLogServerEncrypted.js +1 -1
- package/dist/unstable/eventlog/SqlEventLogServerEncrypted.js.map +1 -1
- package/dist/unstable/eventlog/SqlEventLogServerUnencrypted.js +3 -3
- package/dist/unstable/eventlog/SqlEventLogServerUnencrypted.js.map +1 -1
- package/dist/unstable/http/Cookies.d.ts.map +1 -1
- package/dist/unstable/http/Cookies.js +24 -22
- package/dist/unstable/http/Cookies.js.map +1 -1
- package/dist/unstable/http/Headers.js +8 -8
- package/dist/unstable/http/Headers.js.map +1 -1
- package/dist/unstable/http/HttpClientRequest.d.ts +44 -0
- package/dist/unstable/http/HttpClientRequest.d.ts.map +1 -1
- package/dist/unstable/http/HttpClientRequest.js +14 -0
- package/dist/unstable/http/HttpClientRequest.js.map +1 -1
- package/dist/unstable/http/HttpRouter.d.ts +2 -2
- package/dist/unstable/http/HttpRouter.d.ts.map +1 -1
- package/dist/unstable/http/HttpRouter.js.map +1 -1
- package/dist/unstable/http/HttpServerRequest.d.ts.map +1 -1
- package/dist/unstable/http/HttpServerRequest.js +5 -4
- package/dist/unstable/http/HttpServerRequest.js.map +1 -1
- package/dist/unstable/http/Multipart.d.ts.map +1 -1
- package/dist/unstable/http/Multipart.js +17 -15
- package/dist/unstable/http/Multipart.js.map +1 -1
- package/dist/unstable/http/Template.js +1 -1
- package/dist/unstable/http/Template.js.map +1 -1
- package/dist/unstable/http/UrlParams.d.ts.map +1 -1
- package/dist/unstable/http/UrlParams.js +17 -14
- package/dist/unstable/http/UrlParams.js.map +1 -1
- package/dist/unstable/httpapi/HttpApi.js +3 -3
- package/dist/unstable/httpapi/HttpApi.js.map +1 -1
- package/dist/unstable/httpapi/HttpApiClient.js +5 -5
- package/dist/unstable/httpapi/HttpApiClient.js.map +1 -1
- package/dist/unstable/httpapi/HttpApiGroup.js +1 -1
- package/dist/unstable/httpapi/HttpApiGroup.js.map +1 -1
- package/dist/unstable/httpapi/OpenApi.d.ts.map +1 -1
- package/dist/unstable/httpapi/OpenApi.js +37 -24
- package/dist/unstable/httpapi/OpenApi.js.map +1 -1
- package/dist/unstable/observability/OtlpExporter.d.ts +72 -1
- package/dist/unstable/observability/OtlpExporter.d.ts.map +1 -1
- package/dist/unstable/observability/OtlpExporter.js +69 -4
- package/dist/unstable/observability/OtlpExporter.js.map +1 -1
- package/dist/unstable/observability/OtlpLogger.d.ts +4 -3
- 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 +7 -3
- package/dist/unstable/observability/OtlpMetrics.d.ts.map +1 -1
- package/dist/unstable/observability/OtlpMetrics.js +5 -2
- package/dist/unstable/observability/OtlpMetrics.js.map +1 -1
- package/dist/unstable/observability/OtlpTracer.d.ts +4 -3
- package/dist/unstable/observability/OtlpTracer.d.ts.map +1 -1
- package/dist/unstable/observability/OtlpTracer.js +2 -2
- package/dist/unstable/observability/OtlpTracer.js.map +1 -1
- package/dist/unstable/persistence/Persistable.d.ts.map +1 -1
- package/dist/unstable/persistence/Persistable.js +2 -1
- package/dist/unstable/persistence/Persistable.js.map +1 -1
- package/dist/unstable/persistence/RateLimiter.d.ts +2 -2
- package/dist/unstable/persistence/RateLimiter.js +2 -2
- package/dist/unstable/persistence/RateLimiter.js.map +1 -1
- package/dist/unstable/persistence/Redis.d.ts.map +1 -1
- package/dist/unstable/persistence/Redis.js +2 -2
- package/dist/unstable/persistence/Redis.js.map +1 -1
- package/dist/unstable/process/ChildProcessSpawner.js +3 -1
- package/dist/unstable/process/ChildProcessSpawner.js.map +1 -1
- package/dist/unstable/reactivity/AsyncResult.d.ts.map +1 -1
- package/dist/unstable/reactivity/AsyncResult.js +4 -3
- package/dist/unstable/reactivity/AsyncResult.js.map +1 -1
- package/dist/unstable/reactivity/Atom.d.ts +83 -0
- package/dist/unstable/reactivity/Atom.d.ts.map +1 -1
- package/dist/unstable/reactivity/Atom.js +31 -0
- package/dist/unstable/reactivity/Atom.js.map +1 -1
- package/dist/unstable/reactivity/AtomRegistry.js +1 -1
- package/dist/unstable/reactivity/AtomRegistry.js.map +1 -1
- package/dist/unstable/rpc/RpcClient.d.ts.map +1 -1
- package/dist/unstable/rpc/RpcClient.js +2 -1
- package/dist/unstable/rpc/RpcClient.js.map +1 -1
- package/dist/unstable/schema/VariantSchema.d.ts +1 -2
- package/dist/unstable/schema/VariantSchema.d.ts.map +1 -1
- package/dist/unstable/schema/VariantSchema.js +13 -10
- package/dist/unstable/schema/VariantSchema.js.map +1 -1
- package/dist/unstable/socket/Socket.d.ts +1 -1
- package/dist/unstable/socket/Socket.js +1 -1
- package/dist/unstable/socket/Socket.js.map +1 -1
- package/dist/unstable/sql/SqlError.d.ts +2 -2
- package/dist/unstable/sql/SqlError.js +2 -2
- package/dist/unstable/sql/SqlError.js.map +1 -1
- package/dist/unstable/sql/Statement.d.ts.map +1 -1
- package/dist/unstable/sql/Statement.js +7 -6
- package/dist/unstable/sql/Statement.js.map +1 -1
- package/package.json +1 -1
- package/src/Array.ts +86 -25
- package/src/Channel.ts +32 -14
- package/src/Config.ts +6 -5
- package/src/ConfigProvider.ts +7 -7
- package/src/Data.ts +3 -2
- package/src/Effect.ts +70 -116
- package/src/FiberHandle.ts +3 -2
- package/src/Iterable.ts +2 -1
- package/src/JsonPatch.ts +4 -3
- package/src/JsonSchema.ts +9 -11
- package/src/Logger.ts +3 -2
- package/src/ManagedRuntime.ts +13 -0
- package/src/Metric.ts +4 -3
- package/src/MutableList.ts +4 -0
- package/src/Optic.ts +5 -4
- package/src/Option.ts +2 -1
- package/src/PartitionedSemaphore.ts +1 -4
- package/src/Record.ts +119 -22
- package/src/References.ts +0 -46
- package/src/Request.ts +5 -7
- package/src/Result.ts +2 -1
- package/src/Schema.ts +2538 -987
- package/src/SchemaAST.ts +228 -149
- package/src/SchemaError.ts +1 -1
- package/src/SchemaGetter.ts +36 -29
- package/src/SchemaIssue.ts +1 -1
- package/src/SchemaParser.ts +1 -25
- package/src/SchemaRepresentation.ts +697 -3398
- package/src/SchemaTransformation.ts +3 -3
- package/src/Semaphore.ts +5 -3
- package/src/Stream.ts +63 -19
- package/src/Struct.ts +5 -4
- package/src/Types.ts +1 -3
- package/src/index.ts +0 -5
- package/src/internal/core.ts +4 -3
- package/src/internal/effect.ts +132 -70
- package/src/internal/matcher.ts +1 -1
- package/src/internal/record.ts +11 -7
- package/src/internal/references.ts +0 -5
- package/src/internal/schema/annotations.ts +44 -0
- package/src/internal/schema/fromJsonSchemaDocument.ts +957 -0
- package/src/internal/schema/fromRepresentation.ts +345 -0
- package/src/internal/schema/schema.ts +45 -46
- package/src/internal/schema/{arbitrary.ts → toArbitrary.ts} +8 -10
- package/src/internal/schema/toCodeDocument.ts +572 -0
- package/src/internal/schema/{equivalence.ts → toEquivalence.ts} +12 -7
- package/src/internal/schema/toJsonSchemaDocument.ts +475 -0
- package/src/internal/schema/toRepresentation.ts +401 -0
- package/src/internal/stackTraceLimit.ts +3 -7
- package/src/testing/TestClock.ts +1 -1
- package/src/unstable/ai/AiError.ts +5 -4
- package/src/unstable/ai/AnthropicStructuredOutput.ts +102 -333
- package/src/unstable/ai/EmbeddingModel.ts +1 -1
- package/src/unstable/ai/LanguageModel.ts +30 -28
- package/src/unstable/ai/McpSchema.ts +15 -15
- package/src/unstable/ai/McpServer.ts +172 -56
- package/src/unstable/ai/OpenAiStructuredOutput.ts +230 -395
- package/src/unstable/ai/Response.ts +24 -24
- package/src/unstable/ai/Tool.ts +22 -4
- package/src/unstable/ai/Toolkit.ts +19 -7
- package/src/unstable/ai/internal/codec-transformer.ts +13 -7
- package/src/unstable/ai/internal/structured-output.ts +458 -0
- package/src/unstable/cli/CliError.ts +51 -5
- package/src/unstable/cli/Command.ts +4 -4
- package/src/unstable/cli/Param.ts +3 -3
- package/src/unstable/cli/Primitive.ts +1 -1
- package/src/unstable/cli/internal/command.ts +13 -5
- package/src/unstable/cli/internal/config.ts +8 -10
- package/src/unstable/cluster/ClusterWorkflowEngine.ts +3 -3
- package/src/unstable/cluster/Entity.ts +1 -1
- package/src/unstable/cluster/Envelope.ts +2 -1
- package/src/unstable/cluster/Reply.ts +1 -1
- package/src/unstable/cluster/Runner.ts +1 -1
- package/src/unstable/cluster/RunnerAddress.ts +1 -1
- package/src/unstable/cluster/ShardId.ts +1 -1
- package/src/unstable/cluster/Sharding.ts +161 -34
- package/src/unstable/cluster/ShardingConfig.ts +5 -1
- package/src/unstable/cluster/SingleRunner.ts +4 -2
- package/src/unstable/cluster/SqlMessageStorage.ts +83 -35
- package/src/unstable/cluster/SqlRunnerStorage.ts +186 -116
- package/src/unstable/cluster/internal/entityManager.ts +31 -10
- package/src/unstable/cluster/internal/shardLock.ts +9 -0
- package/src/unstable/devtools/DevToolsSchema.ts +10 -5
- package/src/unstable/eventlog/EventJournal.ts +1 -1
- package/src/unstable/eventlog/EventLog.ts +21 -11
- package/src/unstable/eventlog/EventLogEncryption.ts +1 -1
- package/src/unstable/eventlog/EventLogMessage.ts +10 -3
- package/src/unstable/eventlog/SqlEventJournal.ts +2 -2
- package/src/unstable/eventlog/SqlEventLogServerEncrypted.ts +1 -1
- package/src/unstable/eventlog/SqlEventLogServerUnencrypted.ts +6 -3
- package/src/unstable/http/Cookies.ts +29 -24
- package/src/unstable/http/Headers.ts +8 -8
- package/src/unstable/http/HttpClientRequest.ts +57 -0
- package/src/unstable/http/HttpRouter.ts +6 -3
- package/src/unstable/http/HttpServerRequest.ts +5 -4
- package/src/unstable/http/Multipart.ts +16 -13
- package/src/unstable/http/Template.ts +1 -1
- package/src/unstable/http/UrlParams.ts +17 -14
- package/src/unstable/httpapi/HttpApi.ts +3 -3
- package/src/unstable/httpapi/HttpApiClient.ts +5 -5
- package/src/unstable/httpapi/HttpApiGroup.ts +1 -1
- package/src/unstable/httpapi/OpenApi.ts +52 -28
- package/src/unstable/observability/OtlpExporter.ts +109 -5
- package/src/unstable/observability/OtlpLogger.ts +5 -5
- package/src/unstable/observability/OtlpMetrics.ts +8 -4
- package/src/unstable/observability/OtlpTracer.ts +8 -4
- package/src/unstable/persistence/Persistable.ts +3 -2
- package/src/unstable/persistence/RateLimiter.ts +2 -2
- package/src/unstable/persistence/Redis.ts +2 -2
- package/src/unstable/process/ChildProcessSpawner.ts +1 -1
- package/src/unstable/reactivity/AsyncResult.ts +4 -3
- package/src/unstable/reactivity/Atom.ts +92 -0
- package/src/unstable/reactivity/AtomRegistry.ts +1 -1
- package/src/unstable/rpc/RpcClient.ts +2 -1
- package/src/unstable/schema/VariantSchema.ts +14 -24
- package/src/unstable/socket/Socket.ts +1 -1
- package/src/unstable/sql/SqlError.ts +2 -2
- package/src/unstable/sql/Statement.ts +7 -6
- package/dist/SchemaUtils.d.ts +0 -28
- package/dist/SchemaUtils.d.ts.map +0 -1
- package/dist/SchemaUtils.js +0 -45
- package/dist/SchemaUtils.js.map +0 -1
- package/dist/internal/schema/arbitrary.d.ts.map +0 -1
- package/dist/internal/schema/arbitrary.js.map +0 -1
- package/dist/internal/schema/equivalence.d.ts +0 -2
- package/dist/internal/schema/equivalence.d.ts.map +0 -1
- package/dist/internal/schema/equivalence.js.map +0 -1
- package/dist/internal/schema/representation.d.ts +0 -2
- package/dist/internal/schema/representation.d.ts.map +0 -1
- package/dist/internal/schema/representation.js +0 -865
- package/dist/internal/schema/representation.js.map +0 -1
- package/src/SchemaUtils.ts +0 -51
- package/src/internal/schema/representation.ts +0 -795
package/src/Data.ts
CHANGED
|
@@ -10,6 +10,7 @@
|
|
|
10
10
|
*/
|
|
11
11
|
import type * as Cause from "./Cause.ts"
|
|
12
12
|
import * as core from "./internal/core.ts"
|
|
13
|
+
import * as InternalRecord from "./internal/record.ts"
|
|
13
14
|
import * as Pipeable from "./Pipeable.ts"
|
|
14
15
|
import * as Predicate from "./Predicate.ts"
|
|
15
16
|
import type * as Types from "./Types.ts"
|
|
@@ -51,10 +52,10 @@ import type { Unify } from "./Unify.ts"
|
|
|
51
52
|
export const Class: new<A extends Record<string, any> = {}>(
|
|
52
53
|
args: Types.VoidIfEmpty<{ readonly [P in keyof A]: A[P] }>
|
|
53
54
|
) => Readonly<A> & Pipeable.Pipeable = class extends Pipeable.Class {
|
|
54
|
-
constructor(props:
|
|
55
|
+
constructor(props: object | undefined) {
|
|
55
56
|
super()
|
|
56
57
|
if (props) {
|
|
57
|
-
|
|
58
|
+
InternalRecord.assignProperties(this, props)
|
|
58
59
|
}
|
|
59
60
|
}
|
|
60
61
|
} as any
|
package/src/Effect.ts
CHANGED
|
@@ -26,6 +26,7 @@ import * as core from "./internal/core.ts"
|
|
|
26
26
|
import * as internal from "./internal/effect.ts"
|
|
27
27
|
import * as internalExecutionPlan from "./internal/executionPlan.ts"
|
|
28
28
|
import * as internalLayer from "./internal/layer.ts"
|
|
29
|
+
import * as InternalRecord from "./internal/record.ts"
|
|
29
30
|
import * as internalRequest from "./internal/request.ts"
|
|
30
31
|
import * as internalSchedule from "./internal/schedule.ts"
|
|
31
32
|
import type * as Layer from "./Layer.ts"
|
|
@@ -12319,6 +12320,72 @@ export const updateService: {
|
|
|
12319
12320
|
<XA, E, R, I, A>(self: Effect<XA, E, R>, service: Context.Key<I, A>, f: (value: A) => A): Effect<XA, E, R | I>
|
|
12320
12321
|
} = internal.updateService
|
|
12321
12322
|
|
|
12323
|
+
/**
|
|
12324
|
+
* Updates a service for the lifetime of the current scope and restores its
|
|
12325
|
+
* previous value when the scope closes.
|
|
12326
|
+
*
|
|
12327
|
+
* **When to use**
|
|
12328
|
+
*
|
|
12329
|
+
* Use when you need a setup effect to change a service for subsequent effects
|
|
12330
|
+
* in the same scope.
|
|
12331
|
+
*
|
|
12332
|
+
* **Details**
|
|
12333
|
+
*
|
|
12334
|
+
* The updater receives the currently visible service value. A
|
|
12335
|
+
* `Context.Service` remains in the requirements, while a `Context.Reference`
|
|
12336
|
+
* uses its default when no override is present and adds no service requirement.
|
|
12337
|
+
* The returned effect always requires `Scope`. The optional `reset` function
|
|
12338
|
+
* receives the original, updated, and current values when the scope closes,
|
|
12339
|
+
* allowing changes to be merged during restoration. It defaults to returning
|
|
12340
|
+
* the original value.
|
|
12341
|
+
*
|
|
12342
|
+
* **Example** (Updating a reference within a scope)
|
|
12343
|
+
*
|
|
12344
|
+
* ```ts
|
|
12345
|
+
* import { Context, Effect } from "effect"
|
|
12346
|
+
*
|
|
12347
|
+
* const CurrentNumber = Context.Reference<number>("CurrentNumber", {
|
|
12348
|
+
* defaultValue: () => 1
|
|
12349
|
+
* })
|
|
12350
|
+
*
|
|
12351
|
+
* const program = Effect.gen(function*() {
|
|
12352
|
+
* const before = yield* CurrentNumber
|
|
12353
|
+
* const during = yield* Effect.scoped(
|
|
12354
|
+
* Effect.gen(function*() {
|
|
12355
|
+
* yield* Effect.updateServiceScoped(
|
|
12356
|
+
* CurrentNumber,
|
|
12357
|
+
* (value) => value + 1,
|
|
12358
|
+
* {
|
|
12359
|
+
* // Optional: when omitted, the original value is restored
|
|
12360
|
+
* reset: (original, updated, current) =>
|
|
12361
|
+
* Math.max(original, updated, current) + 1
|
|
12362
|
+
* }
|
|
12363
|
+
* )
|
|
12364
|
+
* return yield* CurrentNumber
|
|
12365
|
+
* })
|
|
12366
|
+
* )
|
|
12367
|
+
* const after = yield* CurrentNumber
|
|
12368
|
+
*
|
|
12369
|
+
* console.log([before, during, after])
|
|
12370
|
+
* // [1, 2, 3]
|
|
12371
|
+
* })
|
|
12372
|
+
*
|
|
12373
|
+
* Effect.runPromise(program)
|
|
12374
|
+
* ```
|
|
12375
|
+
*
|
|
12376
|
+
* @see {@link updateService} for updating a service only within a wrapped effect
|
|
12377
|
+
*
|
|
12378
|
+
* @category context
|
|
12379
|
+
* @since 4.0.0
|
|
12380
|
+
*/
|
|
12381
|
+
export const updateServiceScoped: <I, A>(
|
|
12382
|
+
service: Context.Key<I, A>,
|
|
12383
|
+
f: (value: A) => A,
|
|
12384
|
+
options?: {
|
|
12385
|
+
readonly reset?: ((original: A, updated: A, current: A) => A) | undefined
|
|
12386
|
+
} | undefined
|
|
12387
|
+
) => Effect<void, never, I | Scope> = internal.updateServiceScoped
|
|
12388
|
+
|
|
12322
12389
|
/**
|
|
12323
12390
|
* Provides one concrete service implementation to an effect.
|
|
12324
12391
|
*
|
|
@@ -12805,119 +12872,6 @@ export const provideServiceEffect: {
|
|
|
12805
12872
|
): Effect<A, E | E2, Exclude<R, I> | R2>
|
|
12806
12873
|
} = internal.provideServiceEffect
|
|
12807
12874
|
|
|
12808
|
-
// -----------------------------------------------------------------------------
|
|
12809
|
-
// References
|
|
12810
|
-
// -----------------------------------------------------------------------------
|
|
12811
|
-
|
|
12812
|
-
/**
|
|
12813
|
-
* Sets the concurrency level for parallel operations within an effect.
|
|
12814
|
-
*
|
|
12815
|
-
* **Example** (Setting local concurrency)
|
|
12816
|
-
*
|
|
12817
|
-
* ```ts
|
|
12818
|
-
* import { Console, Effect } from "effect"
|
|
12819
|
-
*
|
|
12820
|
-
* const task = (id: number) =>
|
|
12821
|
-
* Effect.gen(function*() {
|
|
12822
|
-
* yield* Console.log(`Task ${id} starting`)
|
|
12823
|
-
* yield* Effect.sleep("100 millis")
|
|
12824
|
-
* yield* Console.log(`Task ${id} completed`)
|
|
12825
|
-
* return id
|
|
12826
|
-
* })
|
|
12827
|
-
*
|
|
12828
|
-
* // Run tasks with limited concurrency (max 2 at a time)
|
|
12829
|
-
* const program = Effect.gen(function*() {
|
|
12830
|
-
* const tasks = [1, 2, 3, 4, 5].map(task)
|
|
12831
|
-
* return yield* Effect.all(tasks, { concurrency: 2 })
|
|
12832
|
-
* }).pipe(
|
|
12833
|
-
* Effect.withConcurrency(2)
|
|
12834
|
-
* )
|
|
12835
|
-
*
|
|
12836
|
-
* Effect.runPromise(program).then(console.log)
|
|
12837
|
-
* // Tasks will run with max 2 concurrent operations
|
|
12838
|
-
* // [1, 2, 3, 4, 5]
|
|
12839
|
-
* ```
|
|
12840
|
-
*
|
|
12841
|
-
* @category references
|
|
12842
|
-
* @since 2.0.0
|
|
12843
|
-
*/
|
|
12844
|
-
export const withConcurrency: {
|
|
12845
|
-
// -----------------------------------------------------------------------------
|
|
12846
|
-
// References
|
|
12847
|
-
// -----------------------------------------------------------------------------
|
|
12848
|
-
|
|
12849
|
-
/**
|
|
12850
|
-
* Sets the concurrency level for parallel operations within an effect.
|
|
12851
|
-
*
|
|
12852
|
-
* **Example** (Setting local concurrency)
|
|
12853
|
-
*
|
|
12854
|
-
* ```ts
|
|
12855
|
-
* import { Console, Effect } from "effect"
|
|
12856
|
-
*
|
|
12857
|
-
* const task = (id: number) =>
|
|
12858
|
-
* Effect.gen(function*() {
|
|
12859
|
-
* yield* Console.log(`Task ${id} starting`)
|
|
12860
|
-
* yield* Effect.sleep("100 millis")
|
|
12861
|
-
* yield* Console.log(`Task ${id} completed`)
|
|
12862
|
-
* return id
|
|
12863
|
-
* })
|
|
12864
|
-
*
|
|
12865
|
-
* // Run tasks with limited concurrency (max 2 at a time)
|
|
12866
|
-
* const program = Effect.gen(function*() {
|
|
12867
|
-
* const tasks = [1, 2, 3, 4, 5].map(task)
|
|
12868
|
-
* return yield* Effect.all(tasks, { concurrency: 2 })
|
|
12869
|
-
* }).pipe(
|
|
12870
|
-
* Effect.withConcurrency(2)
|
|
12871
|
-
* )
|
|
12872
|
-
*
|
|
12873
|
-
* Effect.runPromise(program).then(console.log)
|
|
12874
|
-
* // Tasks will run with max 2 concurrent operations
|
|
12875
|
-
* // [1, 2, 3, 4, 5]
|
|
12876
|
-
* ```
|
|
12877
|
-
*
|
|
12878
|
-
* @category references
|
|
12879
|
-
* @since 2.0.0
|
|
12880
|
-
*/
|
|
12881
|
-
(concurrency: number | "unbounded"): <A, E, R>(self: Effect<A, E, R>) => Effect<A, E, R>
|
|
12882
|
-
// -----------------------------------------------------------------------------
|
|
12883
|
-
// References
|
|
12884
|
-
// -----------------------------------------------------------------------------
|
|
12885
|
-
|
|
12886
|
-
/**
|
|
12887
|
-
* Sets the concurrency level for parallel operations within an effect.
|
|
12888
|
-
*
|
|
12889
|
-
* **Example** (Setting local concurrency)
|
|
12890
|
-
*
|
|
12891
|
-
* ```ts
|
|
12892
|
-
* import { Console, Effect } from "effect"
|
|
12893
|
-
*
|
|
12894
|
-
* const task = (id: number) =>
|
|
12895
|
-
* Effect.gen(function*() {
|
|
12896
|
-
* yield* Console.log(`Task ${id} starting`)
|
|
12897
|
-
* yield* Effect.sleep("100 millis")
|
|
12898
|
-
* yield* Console.log(`Task ${id} completed`)
|
|
12899
|
-
* return id
|
|
12900
|
-
* })
|
|
12901
|
-
*
|
|
12902
|
-
* // Run tasks with limited concurrency (max 2 at a time)
|
|
12903
|
-
* const program = Effect.gen(function*() {
|
|
12904
|
-
* const tasks = [1, 2, 3, 4, 5].map(task)
|
|
12905
|
-
* return yield* Effect.all(tasks, { concurrency: 2 })
|
|
12906
|
-
* }).pipe(
|
|
12907
|
-
* Effect.withConcurrency(2)
|
|
12908
|
-
* )
|
|
12909
|
-
*
|
|
12910
|
-
* Effect.runPromise(program).then(console.log)
|
|
12911
|
-
* // Tasks will run with max 2 concurrent operations
|
|
12912
|
-
* // [1, 2, 3, 4, 5]
|
|
12913
|
-
* ```
|
|
12914
|
-
*
|
|
12915
|
-
* @category references
|
|
12916
|
-
* @since 2.0.0
|
|
12917
|
-
*/
|
|
12918
|
-
<A, E, R>(self: Effect<A, E, R>, concurrency: number | "unbounded"): Effect<A, E, R>
|
|
12919
|
-
} = internal.withConcurrency
|
|
12920
|
-
|
|
12921
12875
|
// -----------------------------------------------------------------------------
|
|
12922
12876
|
// Resource management & finalization
|
|
12923
12877
|
// -----------------------------------------------------------------------------
|
|
@@ -22911,11 +22865,11 @@ export const annotateLogs = dual<
|
|
|
22911
22865
|
...args: [Record<string, unknown>] | [key: string, value: unknown]
|
|
22912
22866
|
): Effect<A, E, R> =>
|
|
22913
22867
|
internal.updateService(effect, CurrentLogAnnotations, (annotations) => {
|
|
22914
|
-
const newAnnotations = { ...annotations }
|
|
22868
|
+
const newAnnotations = args.length === 1 ? { ...annotations, ...args[0] } : { ...annotations }
|
|
22915
22869
|
if (args.length === 1) {
|
|
22916
|
-
|
|
22870
|
+
return newAnnotations
|
|
22917
22871
|
} else {
|
|
22918
|
-
newAnnotations
|
|
22872
|
+
InternalRecord.assignProperty(newAnnotations, args[0], args[1])
|
|
22919
22873
|
}
|
|
22920
22874
|
return newAnnotations
|
|
22921
22875
|
})
|
package/src/FiberHandle.ts
CHANGED
|
@@ -621,10 +621,11 @@ export const clear = <A, E>(self: FiberHandle<A, E>): Effect.Effect<void> =>
|
|
|
621
621
|
if (self.state._tag === "Closed" || self.state.fiber === undefined) {
|
|
622
622
|
return Effect.void
|
|
623
623
|
}
|
|
624
|
+
const fiber = self.state.fiber
|
|
624
625
|
return Effect.andThen(
|
|
625
|
-
restore(Fiber.interruptAs(
|
|
626
|
+
restore(Fiber.interruptAs(fiber, internalFiberId)),
|
|
626
627
|
Effect.sync(() => {
|
|
627
|
-
if (self.state._tag === "Open") {
|
|
628
|
+
if (self.state._tag === "Open" && self.state.fiber === fiber) {
|
|
628
629
|
self.state.fiber = undefined
|
|
629
630
|
}
|
|
630
631
|
})
|
package/src/Iterable.ts
CHANGED
|
@@ -12,6 +12,7 @@
|
|
|
12
12
|
import type { NonEmptyArray } from "./Array.ts"
|
|
13
13
|
import * as Equal from "./Equal.ts"
|
|
14
14
|
import { dual } from "./Function.ts"
|
|
15
|
+
import * as InternalRecord from "./internal/record.ts"
|
|
15
16
|
import type { Option } from "./Option.ts"
|
|
16
17
|
import * as O from "./Option.ts"
|
|
17
18
|
import { isBoolean } from "./Predicate.ts"
|
|
@@ -3023,7 +3024,7 @@ export const groupBy: {
|
|
|
3023
3024
|
if (Object.hasOwn(out, k)) {
|
|
3024
3025
|
out[k].push(a)
|
|
3025
3026
|
} else {
|
|
3026
|
-
out
|
|
3027
|
+
InternalRecord.assignProperty(out, k, [a])
|
|
3027
3028
|
}
|
|
3028
3029
|
}
|
|
3029
3030
|
return out
|
package/src/JsonPatch.ts
CHANGED
|
@@ -8,6 +8,7 @@
|
|
|
8
8
|
* @since 4.0.0
|
|
9
9
|
*/
|
|
10
10
|
import { format } from "./Formatter.ts"
|
|
11
|
+
import * as InternalRecord from "./internal/record.ts"
|
|
11
12
|
import { escapeToken, unescapeToken } from "./JsonPointer.ts"
|
|
12
13
|
import * as Predicate from "./Predicate.ts"
|
|
13
14
|
import type * as Schema from "./Schema.ts"
|
|
@@ -358,7 +359,7 @@ function addAt(doc: Schema.Json, pointer: string, val: Schema.Json): Schema.Json
|
|
|
358
359
|
|
|
359
360
|
if (isJsonObject(parent)) {
|
|
360
361
|
const updated = { ...parent }
|
|
361
|
-
updated
|
|
362
|
+
InternalRecord.assignProperty(updated, lastToken, val)
|
|
362
363
|
return rebuildFromStack(stack, updated)
|
|
363
364
|
}
|
|
364
365
|
|
|
@@ -399,7 +400,7 @@ function setAt(
|
|
|
399
400
|
}
|
|
400
401
|
const updated = { ...parent }
|
|
401
402
|
if (mode === "remove") delete updated[lastToken]
|
|
402
|
-
else updated
|
|
403
|
+
else InternalRecord.assignProperty(updated, lastToken, val!)
|
|
403
404
|
return rebuildFromStack(stack, updated)
|
|
404
405
|
}
|
|
405
406
|
|
|
@@ -460,7 +461,7 @@ function rebuildFromStack(stack: ReadonlyArray<StackEntry>, newParent: Schema.Js
|
|
|
460
461
|
acc = copy
|
|
461
462
|
} else {
|
|
462
463
|
const copy = { ...(container as Schema.JsonObject) }
|
|
463
|
-
copy
|
|
464
|
+
InternalRecord.assignProperty(copy, token as string, acc)
|
|
464
465
|
acc = copy
|
|
465
466
|
}
|
|
466
467
|
}
|
package/src/JsonSchema.ts
CHANGED
|
@@ -9,6 +9,7 @@
|
|
|
9
9
|
* @since 4.0.0
|
|
10
10
|
*/
|
|
11
11
|
import * as Arr from "./Array.ts"
|
|
12
|
+
import * as InternalRecord from "./internal/record.ts"
|
|
12
13
|
import { unescapeToken } from "./JsonPointer.ts"
|
|
13
14
|
import * as Predicate from "./Predicate.ts"
|
|
14
15
|
import * as Rec from "./Record.ts"
|
|
@@ -745,11 +746,11 @@ function rewrite_refs(node: unknown, f: ($ref: string) => string): unknown {
|
|
|
745
746
|
const v = node[k]
|
|
746
747
|
|
|
747
748
|
if (k === "$ref") {
|
|
748
|
-
out
|
|
749
|
+
InternalRecord.assignProperty(out, k, typeof v === "string" ? f(v) : v)
|
|
749
750
|
} else if (Array.isArray(v) || Predicate.isObject(v)) {
|
|
750
|
-
out
|
|
751
|
+
InternalRecord.assignProperty(out, k, rewrite_refs(v, f))
|
|
751
752
|
} else {
|
|
752
|
-
out
|
|
753
|
+
InternalRecord.assignProperty(out, k, v)
|
|
753
754
|
}
|
|
754
755
|
}
|
|
755
756
|
|
|
@@ -762,7 +763,7 @@ function walk_object(
|
|
|
762
763
|
): Record<string, unknown> | undefined {
|
|
763
764
|
if (!Predicate.isObject(value)) return undefined
|
|
764
765
|
const out: Record<string, unknown> = {}
|
|
765
|
-
for (const k of Object.keys(value)) out
|
|
766
|
+
for (const k of Object.keys(value)) InternalRecord.assignProperty(out, k, walk(value[k], false))
|
|
766
767
|
return out
|
|
767
768
|
}
|
|
768
769
|
|
|
@@ -776,15 +777,15 @@ function normalize_OpenApi3_0_to_Draft07(node: unknown): unknown {
|
|
|
776
777
|
for (const k of Object.keys(src)) {
|
|
777
778
|
const v = src[k]
|
|
778
779
|
if (k === "$ref" && typeof v === "string") {
|
|
779
|
-
out
|
|
780
|
+
InternalRecord.assignProperty(out, k, v.replace(RE_COMPONENTS_SCHEMAS, "#/definitions"))
|
|
780
781
|
} else if (k === "example") {
|
|
781
782
|
if (src.examples === undefined) {
|
|
782
783
|
out.examples = [v]
|
|
783
784
|
}
|
|
784
785
|
} else if (Array.isArray(v) || Predicate.isObject(v)) {
|
|
785
|
-
out
|
|
786
|
+
InternalRecord.assignProperty(out, k, normalize_OpenApi3_0_to_Draft07(v))
|
|
786
787
|
} else {
|
|
787
|
-
out
|
|
788
|
+
InternalRecord.assignProperty(out, k, v)
|
|
788
789
|
}
|
|
789
790
|
}
|
|
790
791
|
|
|
@@ -895,10 +896,7 @@ export function resolve$ref($ref: string, definitions: Definitions): JsonSchema
|
|
|
895
896
|
const tokens = $ref.split("/")
|
|
896
897
|
if (tokens.length > 0) {
|
|
897
898
|
const identifier = unescapeToken(tokens[tokens.length - 1])
|
|
898
|
-
|
|
899
|
-
if (definition !== undefined) {
|
|
900
|
-
return definition
|
|
901
|
-
}
|
|
899
|
+
if (Object.hasOwn(definitions, identifier)) return definitions[identifier]
|
|
902
900
|
}
|
|
903
901
|
}
|
|
904
902
|
|
package/src/Logger.ts
CHANGED
|
@@ -20,6 +20,7 @@ import * as Formatter from "./Formatter.ts"
|
|
|
20
20
|
import { dual } from "./Function.ts"
|
|
21
21
|
import { isEffect, withFiber } from "./internal/core.ts"
|
|
22
22
|
import * as effect from "./internal/effect.ts"
|
|
23
|
+
import * as InternalRecord from "./internal/record.ts"
|
|
23
24
|
import * as Layer from "./Layer.ts"
|
|
24
25
|
import type * as LogLevel from "./LogLevel.ts"
|
|
25
26
|
import type { Pipeable } from "./Pipeable.ts"
|
|
@@ -704,13 +705,13 @@ export const formatStructured: Logger<unknown, {
|
|
|
704
705
|
|
|
705
706
|
const annotations = fiber.getRef(CurrentLogAnnotations)
|
|
706
707
|
for (const [key, value] of Object.entries(annotations)) {
|
|
707
|
-
annotationsObj
|
|
708
|
+
InternalRecord.assignProperty(annotationsObj, key, effect.structuredMessage(value))
|
|
708
709
|
}
|
|
709
710
|
|
|
710
711
|
const now = date.getTime()
|
|
711
712
|
const spans = fiber.getRef(CurrentLogSpans)
|
|
712
713
|
for (const [label, timestamp] of spans) {
|
|
713
|
-
spansObj
|
|
714
|
+
InternalRecord.assignProperty(spansObj, label, now - timestamp)
|
|
714
715
|
}
|
|
715
716
|
|
|
716
717
|
const messageArr = Array.ensure(message)
|
package/src/ManagedRuntime.ts
CHANGED
|
@@ -207,6 +207,16 @@ export interface ManagedRuntime<in R, out ER> {
|
|
|
207
207
|
*/
|
|
208
208
|
readonly dispose: () => Promise<void>
|
|
209
209
|
|
|
210
|
+
/**
|
|
211
|
+
* Dispose of the resources associated with the runtime.
|
|
212
|
+
*
|
|
213
|
+
* **When to use**
|
|
214
|
+
*
|
|
215
|
+
* Use with the `await using` syntax to automatically dispose the runtime
|
|
216
|
+
* when it goes out of scope.
|
|
217
|
+
*/
|
|
218
|
+
readonly [Symbol.asyncDispose]: () => Promise<void>
|
|
219
|
+
|
|
210
220
|
/**
|
|
211
221
|
* Dispose of the resources associated with the runtime.
|
|
212
222
|
*
|
|
@@ -324,6 +334,9 @@ export const make = <R, ER>(
|
|
|
324
334
|
dispose(): Promise<void> {
|
|
325
335
|
return Effect.runPromise(self.disposeEffect)
|
|
326
336
|
},
|
|
337
|
+
[Symbol.asyncDispose](): Promise<void> {
|
|
338
|
+
return self.dispose()
|
|
339
|
+
},
|
|
327
340
|
disposeEffect: Effect.suspend(() => {
|
|
328
341
|
;(self as Mutable<ManagedRuntime<R, ER>>).contextEffect = Effect.die("ManagedRuntime disposed")
|
|
329
342
|
self.cachedContext = undefined
|
package/src/Metric.ts
CHANGED
|
@@ -19,6 +19,7 @@ import type { Exit } from "./Exit.ts"
|
|
|
19
19
|
import { constUndefined, dual } from "./Function.ts"
|
|
20
20
|
import * as InternalEffect from "./internal/effect.ts"
|
|
21
21
|
import * as InternalMetric from "./internal/metric.ts"
|
|
22
|
+
import * as InternalRecord from "./internal/record.ts"
|
|
22
23
|
import * as Layer from "./Layer.ts"
|
|
23
24
|
import * as Order from "./Order.ts"
|
|
24
25
|
import type { Pipeable } from "./Pipeable.ts"
|
|
@@ -1912,7 +1913,7 @@ class HistogramMetric extends Metric$<number, HistogramState> {
|
|
|
1912
1913
|
let count = 0
|
|
1913
1914
|
let sum = 0
|
|
1914
1915
|
let min = Number.MAX_VALUE
|
|
1915
|
-
let max = Number.
|
|
1916
|
+
let max = -Number.MAX_VALUE
|
|
1916
1917
|
|
|
1917
1918
|
Arr.map(Arr.sort(bounds, Order.Number), (n, i) => {
|
|
1918
1919
|
boundaries[i] = n
|
|
@@ -1999,7 +2000,7 @@ class SummaryMetric extends Metric$<readonly [value: number, timestamp: number],
|
|
|
1999
2000
|
let count = 0
|
|
2000
2001
|
let sum = 0
|
|
2001
2002
|
let min = Number.MAX_VALUE
|
|
2002
|
-
let max = Number.
|
|
2003
|
+
let max = -Number.MAX_VALUE
|
|
2003
2004
|
|
|
2004
2005
|
const snapshot = (now: number): ReadonlyArray<[number, number | undefined]> => {
|
|
2005
2006
|
const builder: Array<number> = []
|
|
@@ -5195,7 +5196,7 @@ function mergeAttributes(
|
|
|
5195
5196
|
function attributesToRecord(attributes?: Metric.Attributes): Metric.AttributeSet | undefined {
|
|
5196
5197
|
if (Predicate.isNotUndefined(attributes) && Array.isArray(attributes)) {
|
|
5197
5198
|
return attributes.reduce((acc, [key, value]) => {
|
|
5198
|
-
acc
|
|
5199
|
+
InternalRecord.assignProperty(acc, key, value)
|
|
5199
5200
|
return acc
|
|
5200
5201
|
}, {} as Metric.AttributeSet)
|
|
5201
5202
|
}
|
package/src/MutableList.ts
CHANGED
package/src/Optic.ts
CHANGED
|
@@ -14,6 +14,7 @@
|
|
|
14
14
|
|
|
15
15
|
import { format } from "./Formatter.ts"
|
|
16
16
|
import { identity, memoize } from "./Function.ts"
|
|
17
|
+
import * as InternalRecord from "./internal/record.ts"
|
|
17
18
|
import * as Option from "./Option.ts"
|
|
18
19
|
import * as Predicate from "./Predicate.ts"
|
|
19
20
|
import * as Result from "./Result.ts"
|
|
@@ -1072,7 +1073,7 @@ class OptionalImpl<S, A> implements Optional<S, A> {
|
|
|
1072
1073
|
delete copy[key]
|
|
1073
1074
|
}
|
|
1074
1075
|
} else {
|
|
1075
|
-
copy
|
|
1076
|
+
InternalRecord.assignProperty(copy, key, a)
|
|
1076
1077
|
}
|
|
1077
1078
|
return copy
|
|
1078
1079
|
}
|
|
@@ -1110,7 +1111,7 @@ class OptionalImpl<S, A> implements Optional<S, A> {
|
|
|
1110
1111
|
(a, s) => {
|
|
1111
1112
|
if (Object.hasOwn(s, key)) {
|
|
1112
1113
|
const copy = cloneShallow(s)
|
|
1113
|
-
copy
|
|
1114
|
+
InternalRecord.assignProperty(copy, key, a)
|
|
1114
1115
|
return Result.succeed(copy)
|
|
1115
1116
|
} else {
|
|
1116
1117
|
return err
|
|
@@ -1283,12 +1284,12 @@ const recur = memoize((node: Node): Op => {
|
|
|
1283
1284
|
let i = 0
|
|
1284
1285
|
for (; i < path.length - 1; i++) {
|
|
1285
1286
|
const key = path[i]
|
|
1286
|
-
current
|
|
1287
|
+
InternalRecord.assignProperty(current, key, cloneShallow(current[key]))
|
|
1287
1288
|
current = current[key]
|
|
1288
1289
|
}
|
|
1289
1290
|
|
|
1290
1291
|
const finalKey = path[i]
|
|
1291
|
-
current
|
|
1292
|
+
InternalRecord.assignProperty(current, finalKey, a)
|
|
1292
1293
|
|
|
1293
1294
|
return out
|
|
1294
1295
|
}
|
package/src/Option.ts
CHANGED
|
@@ -20,6 +20,7 @@ import type { TypeLambda } from "./HKT.ts"
|
|
|
20
20
|
import type { Inspectable } from "./Inspectable.ts"
|
|
21
21
|
import * as doNotation from "./internal/doNotation.ts"
|
|
22
22
|
import * as option from "./internal/option.ts"
|
|
23
|
+
import * as InternalRecord from "./internal/record.ts"
|
|
23
24
|
import * as result from "./internal/result.ts"
|
|
24
25
|
import type { Order } from "./Order.ts"
|
|
25
26
|
import * as order from "./Order.ts"
|
|
@@ -3025,7 +3026,7 @@ export const all: <const I extends Iterable<Option<any>> | Record<string, Option
|
|
|
3025
3026
|
if (isNone(o)) {
|
|
3026
3027
|
return none()
|
|
3027
3028
|
}
|
|
3028
|
-
out
|
|
3029
|
+
InternalRecord.assignProperty(out, key, o.value)
|
|
3029
3030
|
}
|
|
3030
3031
|
return some(out)
|
|
3031
3032
|
}
|
|
@@ -193,7 +193,6 @@ export const makeUnsafe = <K = unknown>(options: {
|
|
|
193
193
|
}
|
|
194
194
|
|
|
195
195
|
const needed = permits - totalPermits
|
|
196
|
-
const taken = permits - needed
|
|
197
196
|
if (totalPermits > 0) {
|
|
198
197
|
totalPermits = 0
|
|
199
198
|
}
|
|
@@ -228,9 +227,7 @@ export const makeUnsafe = <K = unknown>(options: {
|
|
|
228
227
|
return Effect.sync(() => {
|
|
229
228
|
cleanup()
|
|
230
229
|
waitingPermits -= entry.permits
|
|
231
|
-
|
|
232
|
-
releaseUnsafe(taken)
|
|
233
|
-
}
|
|
230
|
+
releaseUnsafe(permits - entry.permits)
|
|
234
231
|
})
|
|
235
232
|
})
|
|
236
233
|
}
|