effect 4.1.4 → 4.1.5
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/THIRD_PARTY_NOTICES.md +88 -0
- package/ai-docs/package.json +2 -2
- package/dist/Arbitrary.d.ts +44 -2
- package/dist/Arbitrary.d.ts.map +1 -1
- package/dist/Arbitrary.js +9 -1
- package/dist/Arbitrary.js.map +1 -1
- package/dist/BigInt.d.ts +200 -1
- package/dist/BigInt.d.ts.map +1 -1
- package/dist/BigInt.js +105 -9
- package/dist/BigInt.js.map +1 -1
- package/dist/Cache.d.ts.map +1 -1
- package/dist/Cache.js +4 -2
- package/dist/Cache.js.map +1 -1
- package/dist/Cause.d.ts +3 -3
- package/dist/Cause.js +1 -1
- package/dist/Chunk.d.ts +5 -0
- package/dist/Chunk.d.ts.map +1 -1
- package/dist/Chunk.js +7 -2
- package/dist/Chunk.js.map +1 -1
- package/dist/Clock.d.ts +5 -2
- package/dist/Clock.d.ts.map +1 -1
- package/dist/Clock.js +2 -1
- package/dist/Clock.js.map +1 -1
- package/dist/Codegen.d.ts +295 -0
- package/dist/Codegen.d.ts.map +1 -0
- package/dist/Codegen.js +521 -0
- package/dist/Codegen.js.map +1 -0
- package/dist/Config.d.ts +31 -2
- package/dist/Config.d.ts.map +1 -1
- package/dist/Config.js +12 -1
- package/dist/Config.js.map +1 -1
- package/dist/ConfigProvider.d.ts +11 -1
- package/dist/ConfigProvider.d.ts.map +1 -1
- package/dist/ConfigProvider.js +17 -6
- package/dist/ConfigProvider.js.map +1 -1
- package/dist/Effect.d.ts +869 -109
- package/dist/Effect.d.ts.map +1 -1
- package/dist/Effect.js +400 -47
- package/dist/Effect.js.map +1 -1
- package/dist/Equivalence.d.ts +11 -9
- package/dist/Equivalence.d.ts.map +1 -1
- package/dist/Equivalence.js +15 -12
- package/dist/Equivalence.js.map +1 -1
- package/dist/Fiber.d.ts +58 -8
- package/dist/Fiber.d.ts.map +1 -1
- package/dist/Fiber.js +28 -4
- package/dist/Fiber.js.map +1 -1
- package/dist/FiberHandle.d.ts +81 -10
- package/dist/FiberHandle.d.ts.map +1 -1
- package/dist/FiberHandle.js +40 -8
- package/dist/FiberHandle.js.map +1 -1
- package/dist/FiberMap.d.ts +80 -10
- package/dist/FiberMap.d.ts.map +1 -1
- package/dist/FiberMap.js +37 -6
- package/dist/FiberMap.js.map +1 -1
- package/dist/FiberSet.d.ts +93 -8
- package/dist/FiberSet.d.ts.map +1 -1
- package/dist/FiberSet.js +46 -4
- package/dist/FiberSet.js.map +1 -1
- package/dist/Formatter.d.ts +2 -0
- package/dist/Formatter.d.ts.map +1 -1
- package/dist/Formatter.js +2 -0
- package/dist/Formatter.js.map +1 -1
- package/dist/LayerMap.d.ts +12 -3
- package/dist/LayerMap.d.ts.map +1 -1
- package/dist/LayerMap.js +12 -2
- package/dist/LayerMap.js.map +1 -1
- package/dist/LayerRef.d.ts +2 -2
- package/dist/Match.d.ts +12 -0
- package/dist/Match.d.ts.map +1 -1
- package/dist/Match.js +16 -0
- package/dist/Match.js.map +1 -1
- package/dist/Metric.js +1 -1
- package/dist/Metric.js.map +1 -1
- package/dist/Option.d.ts +4 -1
- package/dist/Option.d.ts.map +1 -1
- package/dist/Option.js +6 -2
- package/dist/Option.js.map +1 -1
- package/dist/Order.d.ts +7 -5
- package/dist/Order.d.ts.map +1 -1
- package/dist/Order.js +7 -2
- package/dist/Order.js.map +1 -1
- package/dist/Pool.d.ts +4 -3
- package/dist/Pool.d.ts.map +1 -1
- package/dist/Pool.js +21 -18
- package/dist/Pool.js.map +1 -1
- package/dist/Predicate.d.ts +4 -1
- package/dist/Predicate.d.ts.map +1 -1
- package/dist/Predicate.js +5 -1
- package/dist/Predicate.js.map +1 -1
- package/dist/Queue.d.ts +69 -22
- package/dist/Queue.d.ts.map +1 -1
- package/dist/Queue.js +40 -18
- package/dist/Queue.js.map +1 -1
- package/dist/Rational.d.ts +179 -0
- package/dist/Rational.d.ts.map +1 -1
- package/dist/Rational.js +63 -0
- package/dist/Rational.js.map +1 -1
- package/dist/Request.d.ts +20 -0
- package/dist/Request.d.ts.map +1 -1
- package/dist/Request.js +20 -0
- package/dist/Request.js.map +1 -1
- package/dist/Result.d.ts +3 -1
- package/dist/Result.d.ts.map +1 -1
- package/dist/Result.js +5 -2
- package/dist/Result.js.map +1 -1
- package/dist/Schema.d.ts +49 -19
- package/dist/Schema.d.ts.map +1 -1
- package/dist/Schema.js +44 -27
- package/dist/Schema.js.map +1 -1
- package/dist/SchemaAST.d.ts.map +1 -1
- package/dist/SchemaAST.js +11 -4
- package/dist/SchemaAST.js.map +1 -1
- package/dist/SchemaGetter.d.ts +5 -6
- package/dist/SchemaGetter.d.ts.map +1 -1
- package/dist/SchemaGetter.js +14 -10
- package/dist/SchemaGetter.js.map +1 -1
- package/dist/SchemaRepresentation.d.ts +19 -64
- package/dist/SchemaRepresentation.d.ts.map +1 -1
- package/dist/SchemaRepresentation.js +1 -28
- package/dist/SchemaRepresentation.js.map +1 -1
- package/dist/SchemaTransformation.d.ts +11 -10
- package/dist/SchemaTransformation.d.ts.map +1 -1
- package/dist/SchemaTransformation.js +12 -11
- package/dist/SchemaTransformation.js.map +1 -1
- package/dist/Scope.d.ts +12 -6
- package/dist/Scope.d.ts.map +1 -1
- package/dist/Scope.js +12 -6
- package/dist/Scope.js.map +1 -1
- package/dist/ScopedCache.d.ts.map +1 -1
- package/dist/ScopedCache.js +2 -1
- package/dist/ScopedCache.js.map +1 -1
- package/dist/Semaphore.d.ts.map +1 -1
- package/dist/Semaphore.js +18 -4
- package/dist/Semaphore.js.map +1 -1
- package/dist/Stream.d.ts.map +1 -1
- package/dist/Stream.js +55 -14
- package/dist/Stream.js.map +1 -1
- package/dist/String.d.ts +57 -3
- package/dist/String.d.ts.map +1 -1
- package/dist/String.js +62 -4
- package/dist/String.js.map +1 -1
- package/dist/Struct.d.ts +135 -1
- package/dist/Struct.d.ts.map +1 -1
- package/dist/Struct.js +64 -5
- package/dist/Struct.js.map +1 -1
- package/dist/TextDiff.d.ts +105 -0
- package/dist/TextDiff.d.ts.map +1 -1
- package/dist/TextDiff.js +137 -24
- package/dist/TextDiff.js.map +1 -1
- package/dist/TxPriorityQueue.js +2 -2
- package/dist/TxPriorityQueue.js.map +1 -1
- package/dist/ai/LanguageModel.d.ts.map +1 -1
- package/dist/ai/LanguageModel.js +1 -1
- package/dist/ai/LanguageModel.js.map +1 -1
- package/dist/ai/McpSchema.d.ts +88 -88
- package/dist/ai/McpSchema.d.ts.map +1 -1
- package/dist/ai/McpServer.d.ts +47 -2
- package/dist/ai/McpServer.d.ts.map +1 -1
- package/dist/ai/McpServer.js +135 -16
- package/dist/ai/McpServer.js.map +1 -1
- package/dist/ai/Tool.d.ts +3 -2
- package/dist/ai/Tool.d.ts.map +1 -1
- package/dist/ai/Tool.js +3 -2
- package/dist/ai/Tool.js.map +1 -1
- package/dist/ai/Toolkit.d.ts.map +1 -1
- package/dist/ai/Toolkit.js +5 -1
- package/dist/ai/Toolkit.js.map +1 -1
- package/dist/chat/Chat.d.ts +90 -0
- package/dist/chat/Chat.d.ts.map +1 -0
- package/dist/chat/Chat.js +127 -0
- package/dist/chat/Chat.js.map +1 -0
- package/dist/chat/ChatAdapter.d.ts +386 -0
- package/dist/chat/ChatAdapter.d.ts.map +1 -0
- package/dist/chat/ChatAdapter.js +110 -0
- package/dist/chat/ChatAdapter.js.map +1 -0
- package/dist/chat/ChatError.d.ts +500 -0
- package/dist/chat/ChatError.d.ts.map +1 -0
- package/dist/chat/ChatError.js +521 -0
- package/dist/chat/ChatError.js.map +1 -0
- package/dist/chat/ChatEvent.d.ts +321 -0
- package/dist/chat/ChatEvent.d.ts.map +1 -0
- package/dist/chat/ChatEvent.js +163 -0
- package/dist/chat/ChatEvent.js.map +1 -0
- package/dist/chat/ChatHandler.d.ts +81 -0
- package/dist/chat/ChatHandler.d.ts.map +1 -0
- package/dist/chat/ChatHandler.js +85 -0
- package/dist/chat/ChatHandler.js.map +1 -0
- package/dist/chat/ChatInteraction.d.ts +1519 -0
- package/dist/chat/ChatInteraction.d.ts.map +1 -0
- package/dist/chat/ChatInteraction.js +1052 -0
- package/dist/chat/ChatInteraction.js.map +1 -0
- package/dist/chat/ChatMarkdown.d.ts +280 -0
- package/dist/chat/ChatMarkdown.d.ts.map +1 -0
- package/dist/chat/ChatMarkdown.js +1172 -0
- package/dist/chat/ChatMarkdown.js.map +1 -0
- package/dist/chat/ChatMessage.d.ts +224 -0
- package/dist/chat/ChatMessage.d.ts.map +1 -0
- package/dist/chat/ChatMessage.js +172 -0
- package/dist/chat/ChatMessage.js.map +1 -0
- package/dist/chat/ChatTest.d.ts +407 -0
- package/dist/chat/ChatTest.d.ts.map +1 -0
- package/dist/chat/ChatTest.js +2145 -0
- package/dist/chat/ChatTest.js.map +1 -0
- package/dist/chat/ChatThread.d.ts +92 -0
- package/dist/chat/ChatThread.d.ts.map +1 -0
- package/dist/chat/ChatThread.js +116 -0
- package/dist/chat/ChatThread.js.map +1 -0
- package/dist/chat/ChatUi.d.ts +362 -0
- package/dist/chat/ChatUi.d.ts.map +1 -0
- package/dist/chat/ChatUi.js +209 -0
- package/dist/chat/ChatUi.js.map +1 -0
- package/dist/chat/index.d.ts +60 -0
- package/dist/chat/index.d.ts.map +1 -0
- package/dist/chat/index.js +61 -0
- package/dist/chat/index.js.map +1 -0
- package/dist/chat/internal/retries.d.ts +2 -0
- package/dist/chat/internal/retries.d.ts.map +1 -0
- package/dist/chat/internal/retries.js +7 -0
- package/dist/chat/internal/retries.js.map +1 -0
- package/dist/cli/CliOutput.d.ts.map +1 -1
- package/dist/cli/CliOutput.js +6 -7
- package/dist/cli/CliOutput.js.map +1 -1
- package/dist/cli/Command.d.ts +20 -2
- package/dist/cli/Command.d.ts.map +1 -1
- package/dist/cli/Command.js +4 -0
- package/dist/cli/Command.js.map +1 -1
- package/dist/cli/Prompt.d.ts +5 -6
- package/dist/cli/Prompt.d.ts.map +1 -1
- package/dist/cli/Prompt.js +9 -4
- package/dist/cli/Prompt.js.map +1 -1
- package/dist/cli/internal/command.d.ts +1 -1
- package/dist/cli/internal/command.d.ts.map +1 -1
- package/dist/cli/internal/config.d.ts +1 -1
- package/dist/cli/internal/config.d.ts.map +1 -1
- package/dist/cli/internal/config.js +3 -3
- package/dist/cli/internal/config.js.map +1 -1
- package/dist/cluster/ClusterCron.d.ts +21 -1
- package/dist/cluster/ClusterCron.d.ts.map +1 -1
- package/dist/cluster/ClusterCron.js +24 -6
- package/dist/cluster/ClusterCron.js.map +1 -1
- package/dist/cluster/ClusterWorkflowEngine.d.ts.map +1 -1
- package/dist/cluster/ClusterWorkflowEngine.js +30 -22
- package/dist/cluster/ClusterWorkflowEngine.js.map +1 -1
- package/dist/cluster/Sharding.d.ts.map +1 -1
- package/dist/cluster/Sharding.js +15 -3
- package/dist/cluster/Sharding.js.map +1 -1
- package/dist/cluster/ShardingConfig.d.ts +6 -0
- package/dist/cluster/ShardingConfig.d.ts.map +1 -1
- package/dist/cluster/ShardingConfig.js.map +1 -1
- package/dist/cluster/SqlMessageStorage.d.ts.map +1 -1
- package/dist/cluster/SqlMessageStorage.js +13 -15
- package/dist/cluster/SqlMessageStorage.js.map +1 -1
- package/dist/cluster/SqlRunnerStorage.d.ts.map +1 -1
- package/dist/cluster/SqlRunnerStorage.js +18 -8
- package/dist/cluster/SqlRunnerStorage.js.map +1 -1
- package/dist/cluster/internal/entityManager.js +12 -8
- package/dist/cluster/internal/entityManager.js.map +1 -1
- package/dist/cluster/internal/entityReaper.js +1 -1
- package/dist/cluster/internal/entityReaper.js.map +1 -1
- package/dist/crypto/Kdf.d.ts +2 -1
- package/dist/crypto/Kdf.d.ts.map +1 -1
- package/dist/crypto/Kdf.js +2 -1
- package/dist/crypto/Kdf.js.map +1 -1
- package/dist/crypto/Password.d.ts +162 -0
- package/dist/crypto/Password.d.ts.map +1 -0
- package/dist/crypto/Password.js +217 -0
- package/dist/crypto/Password.js.map +1 -0
- package/dist/crypto/index.d.ts +5 -0
- package/dist/crypto/index.d.ts.map +1 -1
- package/dist/crypto/index.js +5 -0
- package/dist/crypto/index.js.map +1 -1
- package/dist/encoding/Base64.d.ts +63 -0
- package/dist/encoding/Base64.d.ts.map +1 -1
- package/dist/encoding/Base64.js +77 -0
- package/dist/encoding/Base64.js.map +1 -1
- package/dist/encoding/Base64Url.d.ts +1 -0
- package/dist/encoding/Base64Url.d.ts.map +1 -1
- package/dist/encoding/Base64Url.js +1 -0
- package/dist/encoding/Base64Url.js.map +1 -1
- package/dist/encoding/Csv.d.ts.map +1 -1
- package/dist/encoding/Csv.js +44 -16
- package/dist/encoding/Csv.js.map +1 -1
- package/dist/encoding/Hex.d.ts +5 -0
- package/dist/encoding/Hex.d.ts.map +1 -1
- package/dist/encoding/Hex.js +5 -0
- package/dist/encoding/Hex.js.map +1 -1
- package/dist/encoding/SchemaBinary.d.ts.map +1 -1
- package/dist/encoding/SchemaBinary.js +13 -124
- package/dist/encoding/SchemaBinary.js.map +1 -1
- package/dist/encoding/Sse.d.ts +1 -0
- package/dist/encoding/Sse.d.ts.map +1 -1
- package/dist/encoding/Sse.js +7 -5
- package/dist/encoding/Sse.js.map +1 -1
- package/dist/encoding/Xml.d.ts +117 -11
- package/dist/encoding/Xml.d.ts.map +1 -1
- package/dist/encoding/Xml.js +332 -42
- package/dist/encoding/Xml.js.map +1 -1
- package/dist/eventlog/EventJournal.d.ts.map +1 -1
- package/dist/eventlog/EventJournal.js +3 -8
- package/dist/eventlog/EventJournal.js.map +1 -1
- package/dist/eventlog/SqlEventLogServerEncrypted.js +6 -8
- package/dist/eventlog/SqlEventLogServerEncrypted.js.map +1 -1
- package/dist/http/FindMyWay/internal/router.js +163 -116
- package/dist/http/FindMyWay/internal/router.js.map +1 -1
- package/dist/http/FindMyWay.d.ts +99 -0
- package/dist/http/FindMyWay.d.ts.map +1 -1
- package/dist/http/FindMyWay.js +39 -0
- package/dist/http/FindMyWay.js.map +1 -1
- package/dist/http/HttpClient.d.ts.map +1 -1
- package/dist/http/HttpClient.js +1 -1
- package/dist/http/HttpClient.js.map +1 -1
- package/dist/http/HttpMiddleware.d.ts.map +1 -1
- package/dist/http/HttpMiddleware.js +15 -8
- package/dist/http/HttpMiddleware.js.map +1 -1
- package/dist/http/HttpRouter.d.ts +49 -1
- package/dist/http/HttpRouter.d.ts.map +1 -1
- package/dist/http/HttpRouter.js +70 -20
- package/dist/http/HttpRouter.js.map +1 -1
- package/dist/http/HttpServerResponse.d.ts.map +1 -1
- package/dist/http/HttpServerResponse.js +24 -58
- package/dist/http/HttpServerResponse.js.map +1 -1
- package/dist/http/Mime.d.ts.map +1 -1
- package/dist/http/Mime.js +3 -2
- package/dist/http/Mime.js.map +1 -1
- package/dist/http/internal/compression.d.ts.map +1 -1
- package/dist/http/internal/compression.js +2 -2
- package/dist/http/internal/compression.js.map +1 -1
- package/dist/http/internal/mediaType.d.ts.map +1 -0
- package/dist/{http-api → http}/internal/mediaType.js +4 -0
- package/dist/{http-api → http}/internal/mediaType.js.map +1 -1
- package/dist/http/internal/redactedPath.d.ts +2 -0
- package/dist/http/internal/redactedPath.d.ts.map +1 -0
- package/dist/http/internal/redactedPath.js +138 -0
- package/dist/http/internal/redactedPath.js.map +1 -0
- package/dist/http/internal/requestState.js +1 -0
- package/dist/http/internal/requestState.js.map +1 -1
- package/dist/http-api/HttpApi.d.ts +13 -2
- package/dist/http-api/HttpApi.d.ts.map +1 -1
- package/dist/http-api/HttpApi.js +16 -2
- package/dist/http-api/HttpApi.js.map +1 -1
- package/dist/http-api/HttpApiBuilder.d.ts.map +1 -1
- package/dist/http-api/HttpApiBuilder.js +3 -2
- package/dist/http-api/HttpApiBuilder.js.map +1 -1
- package/dist/http-api/HttpApiClient.d.ts.map +1 -1
- package/dist/http-api/HttpApiClient.js +6 -6
- package/dist/http-api/HttpApiClient.js.map +1 -1
- package/dist/http-api/HttpApiEndpoint.d.ts.map +1 -1
- package/dist/http-api/HttpApiEndpoint.js +1 -1
- package/dist/http-api/HttpApiEndpoint.js.map +1 -1
- package/dist/http-api/HttpApiScalar.d.ts +4 -0
- package/dist/http-api/HttpApiScalar.d.ts.map +1 -1
- package/dist/http-api/HttpApiScalar.js +10 -1
- package/dist/http-api/HttpApiScalar.js.map +1 -1
- package/dist/http-api/HttpApiSchema.d.ts.map +1 -1
- package/dist/http-api/HttpApiSchema.js +1 -1
- package/dist/http-api/HttpApiSchema.js.map +1 -1
- package/dist/http-api/OpenApi.d.ts +2 -0
- package/dist/http-api/OpenApi.d.ts.map +1 -1
- package/dist/http-api/internal/httpApiScalar.js +5 -2
- package/dist/http-api/internal/httpApiScalar.js.map +1 -1
- package/dist/index.d.ts +5 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +5 -0
- package/dist/index.js.map +1 -1
- package/dist/internal/arbitrary/model.js +0 -5
- package/dist/internal/arbitrary/model.js.map +1 -1
- package/dist/internal/arbitrary/regexp.js +2 -1
- package/dist/internal/arbitrary/regexp.js.map +1 -1
- package/dist/internal/arbitrary/runner.d.ts.map +1 -1
- package/dist/internal/arbitrary/runner.js +21 -16
- package/dist/internal/arbitrary/runner.js.map +1 -1
- package/dist/internal/arbitrary/schema.js +140 -23
- package/dist/internal/arbitrary/schema.js.map +1 -1
- package/dist/internal/codegen.d.ts +2 -0
- package/dist/internal/codegen.d.ts.map +1 -0
- package/dist/internal/codegen.js +59 -0
- package/dist/internal/codegen.js.map +1 -0
- package/dist/internal/core.js +3 -3
- package/dist/internal/core.js.map +1 -1
- package/dist/internal/dateTime.js +26 -12
- package/dist/internal/dateTime.js.map +1 -1
- package/dist/internal/effect.js +21 -7
- package/dist/internal/effect.js.map +1 -1
- package/dist/internal/hashMap.js +7 -7
- package/dist/internal/hashMap.js.map +1 -1
- package/dist/internal/matcher.js +2 -1
- package/dist/internal/matcher.js.map +1 -1
- package/dist/internal/record.js +18 -4
- package/dist/internal/record.js.map +1 -1
- package/dist/internal/result.js +1 -1
- package/dist/internal/result.js.map +1 -1
- package/dist/internal/schema/codeExpression.d.ts +4 -0
- package/dist/internal/schema/codeExpression.d.ts.map +1 -0
- package/dist/internal/schema/codeExpression.js +179 -0
- package/dist/internal/schema/codeExpression.js.map +1 -0
- package/dist/internal/schema/codeImports.d.ts +8 -0
- package/dist/internal/schema/codeImports.d.ts.map +1 -0
- package/dist/internal/schema/codeImports.js +135 -0
- package/dist/internal/schema/codeImports.js.map +1 -0
- package/dist/internal/schema/codeTokens.d.ts +8 -0
- package/dist/internal/schema/codeTokens.d.ts.map +1 -0
- package/dist/internal/schema/codeTokens.js +17 -0
- package/dist/internal/schema/codeTokens.js.map +1 -0
- package/dist/internal/schema/passthrough.d.ts +2 -0
- package/dist/internal/schema/passthrough.d.ts.map +1 -0
- package/dist/internal/schema/passthrough.js +8 -0
- package/dist/internal/schema/passthrough.js.map +1 -0
- package/dist/internal/schema/schemaCodegen.d.ts +2 -0
- package/dist/internal/schema/schemaCodegen.d.ts.map +1 -0
- package/dist/internal/schema/schemaCodegen.js +377 -0
- package/dist/internal/schema/schemaCodegen.js.map +1 -0
- package/dist/internal/schema/toJsonSchemaDocument.js +11 -4
- package/dist/internal/schema/toJsonSchemaDocument.js.map +1 -1
- package/dist/internal/trie.js +51 -64
- package/dist/internal/trie.js.map +1 -1
- package/dist/internal/utf8.d.ts +2 -0
- package/dist/internal/utf8.d.ts.map +1 -0
- package/dist/internal/utf8.js +151 -0
- package/dist/internal/utf8.js.map +1 -0
- package/dist/internal/version.js +1 -1
- package/dist/jose/Jwks.d.ts +13 -0
- package/dist/jose/Jwks.d.ts.map +1 -1
- package/dist/jose/Jwks.js +10 -2
- package/dist/jose/Jwks.js.map +1 -1
- package/dist/observability/OtlpExporter.d.ts.map +1 -1
- package/dist/observability/OtlpExporter.js +12 -10
- package/dist/observability/OtlpExporter.js.map +1 -1
- package/dist/observability/OtlpLogger.d.ts.map +1 -1
- package/dist/observability/OtlpLogger.js +5 -3
- package/dist/observability/OtlpLogger.js.map +1 -1
- package/dist/observability/internal/otlpProtobuf.d.ts +4 -2
- package/dist/observability/internal/otlpProtobuf.d.ts.map +1 -1
- package/dist/observability/internal/otlpProtobuf.js +238 -156
- package/dist/observability/internal/otlpProtobuf.js.map +1 -1
- package/dist/persistence/PersistedQueue.d.ts.map +1 -1
- package/dist/persistence/PersistedQueue.js +20 -3
- package/dist/persistence/PersistedQueue.js.map +1 -1
- package/dist/protobuf/ProtobufDescriptor.d.ts +377 -0
- package/dist/protobuf/ProtobufDescriptor.d.ts.map +1 -0
- package/dist/protobuf/ProtobufDescriptor.js +135 -0
- package/dist/protobuf/ProtobufDescriptor.js.map +1 -0
- package/dist/protobuf/ProtobufDescriptorProto.d.ts +2083 -0
- package/dist/protobuf/ProtobufDescriptorProto.d.ts.map +1 -0
- package/dist/protobuf/ProtobufDescriptorProto.js +2674 -0
- package/dist/protobuf/ProtobufDescriptorProto.js.map +1 -0
- package/dist/protobuf/ProtobufMessage.d.ts +183 -0
- package/dist/protobuf/ProtobufMessage.d.ts.map +1 -0
- package/dist/protobuf/ProtobufMessage.js +232 -0
- package/dist/protobuf/ProtobufMessage.js.map +1 -0
- package/dist/protobuf/ProtobufReader.d.ts +350 -0
- package/dist/protobuf/ProtobufReader.d.ts.map +1 -0
- package/dist/protobuf/ProtobufReader.js +698 -0
- package/dist/protobuf/ProtobufReader.js.map +1 -0
- package/dist/protobuf/ProtobufWriter.d.ts +224 -0
- package/dist/protobuf/ProtobufWriter.d.ts.map +1 -0
- package/dist/protobuf/ProtobufWriter.js +483 -0
- package/dist/protobuf/ProtobufWriter.js.map +1 -0
- package/dist/protobuf/index.d.ts +30 -0
- package/dist/protobuf/index.d.ts.map +1 -0
- package/dist/protobuf/index.js +31 -0
- package/dist/protobuf/index.js.map +1 -0
- package/dist/protobuf/internal/binary.d.ts +2 -0
- package/dist/protobuf/internal/binary.d.ts.map +1 -0
- package/dist/protobuf/internal/binary.js +966 -0
- package/dist/protobuf/internal/binary.js.map +1 -0
- package/dist/protobuf/internal/resolve.d.ts +2 -0
- package/dist/protobuf/internal/resolve.d.ts.map +1 -0
- package/dist/protobuf/internal/resolve.js +463 -0
- package/dist/protobuf/internal/resolve.js.map +1 -0
- package/dist/protobuf/internal/wireType.d.ts +2 -0
- package/dist/protobuf/internal/wireType.d.ts.map +1 -0
- package/dist/protobuf/internal/wireType.js +10 -0
- package/dist/protobuf/internal/wireType.js.map +1 -0
- package/dist/reactivity/AsyncResult.d.ts +3 -0
- package/dist/reactivity/AsyncResult.d.ts.map +1 -1
- package/dist/reactivity/AsyncResult.js +4 -1
- package/dist/reactivity/AsyncResult.js.map +1 -1
- package/dist/reactivity/Atom.d.ts +10 -4
- package/dist/reactivity/Atom.d.ts.map +1 -1
- package/dist/reactivity/Atom.js +38 -13
- package/dist/reactivity/Atom.js.map +1 -1
- package/dist/reactivity/AtomHttpApi.d.ts +5 -0
- package/dist/reactivity/AtomHttpApi.d.ts.map +1 -1
- package/dist/reactivity/AtomHttpApi.js +5 -1
- package/dist/reactivity/AtomHttpApi.js.map +1 -1
- package/dist/reactivity/AtomRegistry.js +13 -0
- package/dist/reactivity/AtomRegistry.js.map +1 -1
- package/dist/reactivity/AtomRpc.d.ts +5 -0
- package/dist/reactivity/AtomRpc.d.ts.map +1 -1
- package/dist/reactivity/AtomRpc.js +6 -1
- package/dist/reactivity/AtomRpc.js.map +1 -1
- package/dist/rpc/Rpc.d.ts +25 -0
- package/dist/rpc/Rpc.d.ts.map +1 -1
- package/dist/rpc/Rpc.js +18 -0
- package/dist/rpc/Rpc.js.map +1 -1
- package/dist/rpc/RpcClient.d.ts.map +1 -1
- package/dist/rpc/RpcClient.js +38 -21
- package/dist/rpc/RpcClient.js.map +1 -1
- package/dist/rpc/RpcGroup.d.ts +5 -0
- package/dist/rpc/RpcGroup.d.ts.map +1 -1
- package/dist/rpc/RpcGroup.js.map +1 -1
- package/dist/rpc/RpcMiddleware.d.ts +9 -0
- package/dist/rpc/RpcMiddleware.d.ts.map +1 -1
- package/dist/rpc/RpcMiddleware.js.map +1 -1
- package/dist/rpc/RpcSerialization.d.ts +7 -1
- package/dist/rpc/RpcSerialization.d.ts.map +1 -1
- package/dist/rpc/RpcSerialization.js +22 -5
- package/dist/rpc/RpcSerialization.js.map +1 -1
- package/dist/rpc/RpcServer.d.ts.map +1 -1
- package/dist/rpc/RpcServer.js +33 -18
- package/dist/rpc/RpcServer.js.map +1 -1
- package/dist/schema/SchemaCompiler/runtime.js +2 -1
- package/dist/schema/SchemaCompiler/runtime.js.map +1 -1
- package/dist/schema/VariantSchema.d.ts +10 -2
- package/dist/schema/VariantSchema.d.ts.map +1 -1
- package/dist/schema/VariantSchema.js +7 -1
- package/dist/schema/VariantSchema.js.map +1 -1
- package/dist/socket/Socket.d.ts +24 -10
- package/dist/socket/Socket.d.ts.map +1 -1
- package/dist/socket/Socket.js +52 -17
- package/dist/socket/Socket.js.map +1 -1
- package/dist/sql/Migrator.d.ts +3 -0
- package/dist/sql/Migrator.d.ts.map +1 -1
- package/dist/sql/Migrator.js +10 -1
- package/dist/sql/Migrator.js.map +1 -1
- package/dist/sql/SqlModel.d.ts.map +1 -1
- package/dist/sql/SqlModel.js +1 -0
- package/dist/sql/SqlModel.js.map +1 -1
- package/dist/testing/TestConsole.d.ts +96 -0
- package/dist/testing/TestConsole.d.ts.map +1 -1
- package/dist/testing/TestConsole.js +78 -6
- package/dist/testing/TestConsole.js.map +1 -1
- package/dist/testing/TestSchema.d.ts +5 -1
- package/dist/testing/TestSchema.d.ts.map +1 -1
- package/dist/testing/TestSchema.js +7 -2
- package/dist/testing/TestSchema.js.map +1 -1
- package/dist/workers/SharedMemory.d.ts +115 -0
- package/dist/workers/SharedMemory.d.ts.map +1 -0
- package/dist/workers/SharedMemory.js +149 -0
- package/dist/workers/SharedMemory.js.map +1 -0
- package/dist/workers/Transferable.d.ts.map +1 -1
- package/dist/workers/Transferable.js +1 -4
- package/dist/workers/Transferable.js.map +1 -1
- package/dist/workers/index.d.ts +5 -0
- package/dist/workers/index.d.ts.map +1 -1
- package/dist/workers/index.js +5 -0
- package/dist/workers/index.js.map +1 -1
- package/dist/workflow/WorkflowEngine.d.ts.map +1 -1
- package/dist/workflow/WorkflowEngine.js +3 -1
- package/dist/workflow/WorkflowEngine.js.map +1 -1
- package/package.json +7 -4
- package/src/Arbitrary.ts +60 -3
- package/src/BigInt.ts +247 -9
- package/src/Cache.ts +4 -2
- package/src/Cause.ts +3 -3
- package/src/Chunk.ts +7 -3
- package/src/Clock.ts +5 -2
- package/src/Codegen.ts +741 -0
- package/src/Config.ts +35 -4
- package/src/ConfigProvider.ts +24 -7
- package/src/Effect.ts +871 -109
- package/src/Equivalence.ts +16 -13
- package/src/Fiber.ts +58 -8
- package/src/FiberHandle.ts +86 -12
- package/src/FiberMap.ts +83 -10
- package/src/FiberSet.ts +96 -8
- package/src/Formatter.ts +2 -0
- package/src/LayerMap.ts +14 -4
- package/src/LayerRef.ts +2 -2
- package/src/Match.ts +16 -0
- package/src/Metric.ts +1 -1
- package/src/Option.ts +9 -5
- package/src/Order.ts +9 -4
- package/src/Pool.ts +22 -17
- package/src/Predicate.ts +7 -3
- package/src/Queue.ts +84 -31
- package/src/Rational.ts +198 -0
- package/src/Request.ts +20 -0
- package/src/Result.ts +9 -6
- package/src/Schema.ts +69 -32
- package/src/SchemaAST.ts +15 -4
- package/src/SchemaGetter.ts +17 -10
- package/src/SchemaRepresentation.ts +19 -74
- package/src/SchemaTransformation.ts +12 -11
- package/src/Scope.ts +12 -6
- package/src/ScopedCache.ts +2 -1
- package/src/Semaphore.ts +18 -4
- package/src/Stream.ts +66 -20
- package/src/String.ts +83 -6
- package/src/Struct.ts +138 -5
- package/src/TextDiff.ts +186 -30
- package/src/TxPriorityQueue.ts +2 -2
- package/src/ai/LanguageModel.ts +2 -1
- package/src/ai/McpServer.ts +145 -22
- package/src/ai/Tool.ts +3 -2
- package/src/ai/Toolkit.ts +3 -1
- package/src/chat/Chat.ts +164 -0
- package/src/chat/ChatAdapter.ts +444 -0
- package/src/chat/ChatError.ts +684 -0
- package/src/chat/ChatEvent.ts +221 -0
- package/src/chat/ChatHandler.ts +102 -0
- package/src/chat/ChatInteraction.ts +1979 -0
- package/src/chat/ChatMarkdown.ts +1406 -0
- package/src/chat/ChatMessage.ts +213 -0
- package/src/chat/ChatTest.ts +2606 -0
- package/src/chat/ChatThread.ts +132 -0
- package/src/chat/ChatUi.ts +320 -0
- package/src/chat/index.ts +72 -0
- package/src/chat/internal/retries.ts +7 -0
- package/src/cli/CliOutput.ts +4 -5
- package/src/cli/Command.ts +20 -2
- package/src/cli/Prompt.ts +15 -9
- package/src/cli/internal/config.ts +8 -8
- package/src/cluster/ClusterCron.ts +33 -10
- package/src/cluster/ClusterWorkflowEngine.ts +42 -23
- package/src/cluster/Sharding.ts +17 -3
- package/src/cluster/ShardingConfig.ts +3 -0
- package/src/cluster/SqlMessageStorage.ts +16 -20
- package/src/cluster/SqlRunnerStorage.ts +21 -8
- package/src/cluster/internal/entityManager.ts +19 -10
- package/src/cluster/internal/entityReaper.ts +1 -1
- package/src/crypto/Kdf.ts +2 -1
- package/src/crypto/Password.ts +258 -0
- package/src/crypto/index.ts +6 -0
- package/src/encoding/Base64.ts +79 -0
- package/src/encoding/Base64Url.ts +1 -0
- package/src/encoding/Csv.ts +47 -20
- package/src/encoding/Hex.ts +5 -0
- package/src/encoding/SchemaBinary.ts +13 -79
- package/src/encoding/Sse.ts +7 -5
- package/src/encoding/Xml.ts +394 -47
- package/src/eventlog/EventJournal.ts +3 -8
- package/src/eventlog/SqlEventLogServerEncrypted.ts +9 -9
- package/src/http/FindMyWay/internal/router.ts +181 -129
- package/src/http/FindMyWay.ts +106 -0
- package/src/http/HttpClient.ts +2 -1
- package/src/http/HttpMiddleware.ts +22 -9
- package/src/http/HttpRouter.ts +84 -20
- package/src/http/HttpServerResponse.ts +33 -61
- package/src/http/Mime.ts +3 -2
- package/src/http/internal/compression.ts +2 -2
- package/src/{http-api → http}/internal/mediaType.ts +4 -0
- package/src/http/internal/redactedPath.ts +144 -0
- package/src/http/internal/requestState.ts +2 -0
- package/src/http-api/HttpApi.ts +25 -2
- package/src/http-api/HttpApiBuilder.ts +5 -2
- package/src/http-api/HttpApiClient.ts +10 -6
- package/src/http-api/HttpApiEndpoint.ts +1 -1
- package/src/http-api/HttpApiScalar.ts +9 -1
- package/src/http-api/HttpApiSchema.ts +1 -1
- package/src/http-api/OpenApi.ts +2 -0
- package/src/http-api/internal/httpApiScalar.ts +5 -1
- package/src/index.ts +6 -0
- package/src/internal/arbitrary/model.ts +3 -9
- package/src/internal/arbitrary/regexp.ts +3 -1
- package/src/internal/arbitrary/runner.ts +28 -14
- package/src/internal/arbitrary/schema.ts +140 -35
- package/src/internal/codegen.ts +53 -0
- package/src/internal/core.ts +3 -3
- package/src/internal/dateTime.ts +30 -13
- package/src/internal/effect.ts +25 -9
- package/src/internal/hashMap.ts +8 -7
- package/src/internal/matcher.ts +2 -1
- package/src/internal/record.ts +19 -4
- package/src/internal/result.ts +1 -1
- package/src/internal/schema/codeExpression.ts +179 -0
- package/src/internal/schema/codeImports.ts +142 -0
- package/src/internal/schema/codeTokens.ts +39 -0
- package/src/internal/schema/passthrough.ts +8 -0
- package/src/internal/schema/schemaCodegen.ts +543 -0
- package/src/internal/schema/toJsonSchemaDocument.ts +13 -4
- package/src/internal/trie.ts +46 -60
- package/src/internal/utf8.ts +106 -0
- package/src/internal/version.ts +1 -1
- package/src/jose/Jwks.ts +23 -4
- package/src/observability/OtlpExporter.ts +12 -10
- package/src/observability/OtlpLogger.ts +5 -3
- package/src/observability/internal/otlpProtobuf.ts +386 -457
- package/src/persistence/PersistedQueue.ts +21 -4
- package/src/protobuf/ProtobufDescriptor.ts +503 -0
- package/src/protobuf/ProtobufDescriptorProto.ts +3611 -0
- package/src/protobuf/ProtobufMessage.ts +277 -0
- package/src/protobuf/ProtobufReader.ts +756 -0
- package/src/protobuf/ProtobufWriter.ts +530 -0
- package/src/protobuf/index.ts +36 -0
- package/src/protobuf/internal/binary.ts +1215 -0
- package/src/protobuf/internal/resolve.ts +533 -0
- package/src/protobuf/internal/wireType.ts +9 -0
- package/src/reactivity/AsyncResult.ts +6 -1
- package/src/reactivity/Atom.ts +55 -16
- package/src/reactivity/AtomHttpApi.ts +10 -1
- package/src/reactivity/AtomRegistry.ts +16 -0
- package/src/reactivity/AtomRpc.ts +11 -1
- package/src/rpc/Rpc.ts +31 -0
- package/src/rpc/RpcClient.ts +30 -21
- package/src/rpc/RpcGroup.ts +5 -0
- package/src/rpc/RpcMiddleware.ts +9 -0
- package/src/rpc/RpcSerialization.ts +26 -6
- package/src/rpc/RpcServer.ts +33 -20
- package/src/schema/SchemaCompiler/runtime.ts +2 -3
- package/src/schema/VariantSchema.ts +12 -4
- package/src/socket/Socket.ts +67 -20
- package/src/sql/Migrator.ts +8 -1
- package/src/sql/SqlModel.ts +4 -0
- package/src/testing/TestConsole.ts +119 -9
- package/src/testing/TestSchema.ts +8 -3
- package/src/workers/SharedMemory.ts +227 -0
- package/src/workers/Transferable.ts +1 -5
- package/src/workers/index.ts +6 -0
- package/src/workflow/WorkflowEngine.ts +3 -1
- package/dist/http-api/internal/mediaType.d.ts.map +0 -1
- package/dist/internal/schema/toCodeDocument.d.ts +0 -2
- package/dist/internal/schema/toCodeDocument.d.ts.map +0 -1
- package/dist/internal/schema/toCodeDocument.js +0 -447
- package/dist/internal/schema/toCodeDocument.js.map +0 -1
- package/dist/observability/internal/protobuf.d.ts +0 -2
- package/dist/observability/internal/protobuf.d.ts.map +0 -1
- package/dist/observability/internal/protobuf.js +0 -169
- package/dist/observability/internal/protobuf.js.map +0 -1
- package/src/internal/schema/toCodeDocument.ts +0 -578
- package/src/observability/internal/protobuf.ts +0 -225
- /package/dist/{http-api → http}/internal/mediaType.d.ts +0 -0
|
@@ -0,0 +1,377 @@
|
|
|
1
|
+
import * as Result from "../Result.ts";
|
|
2
|
+
import type { DescriptorProto, EnumDescriptorProto, EnumValueDescriptorProto, FieldDescriptorProto, FileDescriptorProto, MethodDescriptorProto, OneofDescriptorProto, ServiceDescriptorProto } from "./ProtobufDescriptorProto.ts";
|
|
3
|
+
/**
|
|
4
|
+
* The editions this module resolves. proto2 and proto3 files are the editions
|
|
5
|
+
* of their syntax.
|
|
6
|
+
*
|
|
7
|
+
* @stability experimental
|
|
8
|
+
* @category models
|
|
9
|
+
* @since 4.1.5
|
|
10
|
+
*/
|
|
11
|
+
export type EditionName = "proto2" | "proto3" | "2023" | "2024" | "2026";
|
|
12
|
+
/**
|
|
13
|
+
* The scalar types of protobuf fields.
|
|
14
|
+
*
|
|
15
|
+
* @stability experimental
|
|
16
|
+
* @category models
|
|
17
|
+
* @since 4.1.5
|
|
18
|
+
*/
|
|
19
|
+
export type ScalarType = "double" | "float" | "int64" | "uint64" | "int32" | "fixed64" | "fixed32" | "bool" | "string" | "bytes" | "uint32" | "sfixed32" | "sfixed64" | "sint32" | "sint64";
|
|
20
|
+
/**
|
|
21
|
+
* How a value of a 64-bit integer field is held: a `bigint`, or a `number` or
|
|
22
|
+
* a decimal `string`, as `[jstype = JS_NUMBER]` and `[jstype = JS_STRING]`
|
|
23
|
+
* ask.
|
|
24
|
+
*
|
|
25
|
+
* @stability experimental
|
|
26
|
+
* @category models
|
|
27
|
+
* @since 4.1.5
|
|
28
|
+
*/
|
|
29
|
+
export type JsType = "bigint" | "number" | "string";
|
|
30
|
+
/**
|
|
31
|
+
* When a singular field is present.
|
|
32
|
+
*
|
|
33
|
+
* **Details**
|
|
34
|
+
*
|
|
35
|
+
* - `"implicit"`: when it is not its zero value, as proto3 fields without
|
|
36
|
+
* `optional`
|
|
37
|
+
* - `"explicit"`: when it is set, even to its zero value
|
|
38
|
+
* - `"required"`: always, as proto2 `required` fields
|
|
39
|
+
*
|
|
40
|
+
* @stability experimental
|
|
41
|
+
* @category models
|
|
42
|
+
* @since 4.1.5
|
|
43
|
+
*/
|
|
44
|
+
export type Presence = "implicit" | "explicit" | "required";
|
|
45
|
+
/**
|
|
46
|
+
* A resolved `.proto` file.
|
|
47
|
+
*
|
|
48
|
+
* @stability experimental
|
|
49
|
+
* @category models
|
|
50
|
+
* @since 4.1.5
|
|
51
|
+
*/
|
|
52
|
+
export interface FileDescriptor {
|
|
53
|
+
readonly _tag: "FileDescriptor";
|
|
54
|
+
readonly name: string;
|
|
55
|
+
readonly package: string;
|
|
56
|
+
readonly edition: EditionName;
|
|
57
|
+
readonly dependencies: ReadonlyArray<FileDescriptor>;
|
|
58
|
+
readonly messages: ReadonlyArray<MessageDescriptor>;
|
|
59
|
+
readonly enums: ReadonlyArray<EnumDescriptor>;
|
|
60
|
+
readonly extensions: ReadonlyArray<ExtensionDescriptor>;
|
|
61
|
+
readonly services: ReadonlyArray<ServiceDescriptor>;
|
|
62
|
+
readonly proto: FileDescriptorProto;
|
|
63
|
+
}
|
|
64
|
+
/**
|
|
65
|
+
* A message type. `fields` are in declaration order. Map entry messages are
|
|
66
|
+
* not part of `messages`; their fields are described by the map field.
|
|
67
|
+
*
|
|
68
|
+
* @stability experimental
|
|
69
|
+
* @category models
|
|
70
|
+
* @since 4.1.5
|
|
71
|
+
*/
|
|
72
|
+
export interface MessageDescriptor {
|
|
73
|
+
readonly _tag: "MessageDescriptor";
|
|
74
|
+
readonly typeName: string;
|
|
75
|
+
readonly name: string;
|
|
76
|
+
readonly file: FileDescriptor;
|
|
77
|
+
readonly parent: MessageDescriptor | undefined;
|
|
78
|
+
readonly fields: ReadonlyArray<FieldDescriptor>;
|
|
79
|
+
readonly oneofs: ReadonlyArray<OneofDescriptor>;
|
|
80
|
+
readonly messages: ReadonlyArray<MessageDescriptor>;
|
|
81
|
+
readonly enums: ReadonlyArray<EnumDescriptor>;
|
|
82
|
+
readonly extensions: ReadonlyArray<ExtensionDescriptor>;
|
|
83
|
+
/** Whether its extensions are encoded as MessageSet items. */
|
|
84
|
+
readonly messageSetWireFormat: boolean;
|
|
85
|
+
readonly proto: DescriptorProto;
|
|
86
|
+
}
|
|
87
|
+
/**
|
|
88
|
+
* A field of a message, or of an extension.
|
|
89
|
+
*
|
|
90
|
+
* **Details**
|
|
91
|
+
*
|
|
92
|
+
* - `"singular"`: one value, present as its {@link Presence} says
|
|
93
|
+
* - `"list"`: a repeated field, an array of values
|
|
94
|
+
* - `"map"`: a map field, a record from keys to values
|
|
95
|
+
*
|
|
96
|
+
* `name` is the property that holds the field in a message value: the
|
|
97
|
+
* original protobuf name, without casing changes or escaping.
|
|
98
|
+
*
|
|
99
|
+
* @stability experimental
|
|
100
|
+
* @category models
|
|
101
|
+
* @since 4.1.5
|
|
102
|
+
*/
|
|
103
|
+
export type FieldDescriptor = SingularFieldDescriptor | ListFieldDescriptor | MapFieldDescriptor;
|
|
104
|
+
interface FieldBase {
|
|
105
|
+
readonly _tag: "FieldDescriptor";
|
|
106
|
+
readonly name: string;
|
|
107
|
+
readonly number: number;
|
|
108
|
+
/** The message the field belongs to, or that an extension extends. */
|
|
109
|
+
readonly parent: MessageDescriptor;
|
|
110
|
+
readonly oneof: OneofDescriptor | undefined;
|
|
111
|
+
readonly proto: FieldDescriptorProto;
|
|
112
|
+
}
|
|
113
|
+
/**
|
|
114
|
+
* A singular field.
|
|
115
|
+
*
|
|
116
|
+
* @stability experimental
|
|
117
|
+
* @category models
|
|
118
|
+
* @since 4.1.5
|
|
119
|
+
*/
|
|
120
|
+
export interface SingularFieldDescriptor extends FieldBase {
|
|
121
|
+
readonly kind: "singular";
|
|
122
|
+
readonly type: ValueType;
|
|
123
|
+
readonly presence: Presence;
|
|
124
|
+
}
|
|
125
|
+
/**
|
|
126
|
+
* A repeated field. `packed` decides how number, boolean and enum elements
|
|
127
|
+
* are written; both encodings are read. Strings, bytes and messages are never
|
|
128
|
+
* packed.
|
|
129
|
+
*
|
|
130
|
+
* @stability experimental
|
|
131
|
+
* @category models
|
|
132
|
+
* @since 4.1.5
|
|
133
|
+
*/
|
|
134
|
+
export interface ListFieldDescriptor extends FieldBase {
|
|
135
|
+
readonly kind: "list";
|
|
136
|
+
readonly type: ValueType;
|
|
137
|
+
readonly packed: boolean;
|
|
138
|
+
}
|
|
139
|
+
/**
|
|
140
|
+
* A map field. `key` is a scalar type other than a float, double or bytes.
|
|
141
|
+
*
|
|
142
|
+
* @stability experimental
|
|
143
|
+
* @category models
|
|
144
|
+
* @since 4.1.5
|
|
145
|
+
*/
|
|
146
|
+
export interface MapFieldDescriptor extends FieldBase {
|
|
147
|
+
readonly kind: "map";
|
|
148
|
+
readonly key: ScalarValueType;
|
|
149
|
+
readonly type: ValueType;
|
|
150
|
+
}
|
|
151
|
+
/**
|
|
152
|
+
* The type of a value of a field: of a singular field, an element of a list,
|
|
153
|
+
* or a value of a map.
|
|
154
|
+
*
|
|
155
|
+
* @stability experimental
|
|
156
|
+
* @category models
|
|
157
|
+
* @since 4.1.5
|
|
158
|
+
*/
|
|
159
|
+
export type ValueType = ScalarValueType | EnumValueType | MessageValueType;
|
|
160
|
+
/**
|
|
161
|
+
* A scalar value. `jsType` applies to 64-bit integers, and `validateUtf8` to
|
|
162
|
+
* strings.
|
|
163
|
+
*
|
|
164
|
+
* @stability experimental
|
|
165
|
+
* @category models
|
|
166
|
+
* @since 4.1.5
|
|
167
|
+
*/
|
|
168
|
+
export interface ScalarValueType {
|
|
169
|
+
readonly kind: "scalar";
|
|
170
|
+
readonly scalar: ScalarType;
|
|
171
|
+
readonly jsType: JsType;
|
|
172
|
+
readonly validateUtf8: boolean;
|
|
173
|
+
}
|
|
174
|
+
/**
|
|
175
|
+
* An enum value, held as its number.
|
|
176
|
+
*
|
|
177
|
+
* @stability experimental
|
|
178
|
+
* @category models
|
|
179
|
+
* @since 4.1.5
|
|
180
|
+
*/
|
|
181
|
+
export interface EnumValueType {
|
|
182
|
+
readonly kind: "enum";
|
|
183
|
+
readonly enum: EnumDescriptor;
|
|
184
|
+
}
|
|
185
|
+
/**
|
|
186
|
+
* A message value. `delimited` messages are encoded as groups.
|
|
187
|
+
*
|
|
188
|
+
* @stability experimental
|
|
189
|
+
* @category models
|
|
190
|
+
* @since 4.1.5
|
|
191
|
+
*/
|
|
192
|
+
export interface MessageValueType {
|
|
193
|
+
readonly kind: "message";
|
|
194
|
+
readonly message: MessageDescriptor;
|
|
195
|
+
readonly delimited: boolean;
|
|
196
|
+
}
|
|
197
|
+
/**
|
|
198
|
+
* A oneof. Synthetic oneofs, of proto3 `optional` fields, are not oneofs here:
|
|
199
|
+
* their fields have explicit presence.
|
|
200
|
+
*
|
|
201
|
+
* @stability experimental
|
|
202
|
+
* @category models
|
|
203
|
+
* @since 4.1.5
|
|
204
|
+
*/
|
|
205
|
+
export interface OneofDescriptor {
|
|
206
|
+
readonly _tag: "OneofDescriptor";
|
|
207
|
+
readonly name: string;
|
|
208
|
+
readonly parent: MessageDescriptor;
|
|
209
|
+
readonly fields: ReadonlyArray<FieldDescriptor>;
|
|
210
|
+
readonly proto: OneofDescriptorProto;
|
|
211
|
+
}
|
|
212
|
+
/**
|
|
213
|
+
* An enum type. An open enum holds any number; a closed enum holds only its
|
|
214
|
+
* values, and decoding keeps other numbers as unknown fields.
|
|
215
|
+
*
|
|
216
|
+
* @stability experimental
|
|
217
|
+
* @category models
|
|
218
|
+
* @since 4.1.5
|
|
219
|
+
*/
|
|
220
|
+
export interface EnumDescriptor {
|
|
221
|
+
readonly _tag: "EnumDescriptor";
|
|
222
|
+
readonly typeName: string;
|
|
223
|
+
readonly name: string;
|
|
224
|
+
readonly file: FileDescriptor;
|
|
225
|
+
readonly parent: MessageDescriptor | undefined;
|
|
226
|
+
readonly values: ReadonlyArray<EnumValueDescriptor>;
|
|
227
|
+
readonly open: boolean;
|
|
228
|
+
readonly proto: EnumDescriptorProto;
|
|
229
|
+
}
|
|
230
|
+
/**
|
|
231
|
+
* A value of an enum.
|
|
232
|
+
*
|
|
233
|
+
* @stability experimental
|
|
234
|
+
* @category models
|
|
235
|
+
* @since 4.1.5
|
|
236
|
+
*/
|
|
237
|
+
export interface EnumValueDescriptor {
|
|
238
|
+
readonly _tag: "EnumValueDescriptor";
|
|
239
|
+
readonly name: string;
|
|
240
|
+
readonly number: number;
|
|
241
|
+
readonly parent: EnumDescriptor;
|
|
242
|
+
readonly proto: EnumValueDescriptorProto;
|
|
243
|
+
}
|
|
244
|
+
/**
|
|
245
|
+
* An extension: a field of `extendee` declared outside of it.
|
|
246
|
+
*
|
|
247
|
+
* @stability experimental
|
|
248
|
+
* @category models
|
|
249
|
+
* @since 4.1.5
|
|
250
|
+
*/
|
|
251
|
+
export interface ExtensionDescriptor {
|
|
252
|
+
readonly _tag: "ExtensionDescriptor";
|
|
253
|
+
readonly typeName: string;
|
|
254
|
+
readonly name: string;
|
|
255
|
+
readonly file: FileDescriptor;
|
|
256
|
+
/** The message the extension is declared in, if any. */
|
|
257
|
+
readonly parent: MessageDescriptor | undefined;
|
|
258
|
+
readonly extendee: MessageDescriptor;
|
|
259
|
+
readonly field: SingularFieldDescriptor | ListFieldDescriptor;
|
|
260
|
+
readonly proto: FieldDescriptorProto;
|
|
261
|
+
}
|
|
262
|
+
/**
|
|
263
|
+
* A service.
|
|
264
|
+
*
|
|
265
|
+
* @stability experimental
|
|
266
|
+
* @category models
|
|
267
|
+
* @since 4.1.5
|
|
268
|
+
*/
|
|
269
|
+
export interface ServiceDescriptor {
|
|
270
|
+
readonly _tag: "ServiceDescriptor";
|
|
271
|
+
readonly typeName: string;
|
|
272
|
+
readonly name: string;
|
|
273
|
+
readonly file: FileDescriptor;
|
|
274
|
+
readonly methods: ReadonlyArray<MethodDescriptor>;
|
|
275
|
+
readonly proto: ServiceDescriptorProto;
|
|
276
|
+
}
|
|
277
|
+
/**
|
|
278
|
+
* A method of a service.
|
|
279
|
+
*
|
|
280
|
+
* @stability experimental
|
|
281
|
+
* @category models
|
|
282
|
+
* @since 4.1.5
|
|
283
|
+
*/
|
|
284
|
+
export interface MethodDescriptor {
|
|
285
|
+
readonly _tag: "MethodDescriptor";
|
|
286
|
+
readonly name: string;
|
|
287
|
+
readonly parent: ServiceDescriptor;
|
|
288
|
+
readonly input: MessageDescriptor;
|
|
289
|
+
readonly output: MessageDescriptor;
|
|
290
|
+
readonly clientStreaming: boolean;
|
|
291
|
+
readonly serverStreaming: boolean;
|
|
292
|
+
readonly idempotency: "unknown" | "noSideEffects" | "idempotent";
|
|
293
|
+
readonly proto: MethodDescriptorProto;
|
|
294
|
+
}
|
|
295
|
+
/**
|
|
296
|
+
* The resolved files of a set of `.proto` files, and their types by full
|
|
297
|
+
* name, such as `"acme.v1.User"`.
|
|
298
|
+
*
|
|
299
|
+
* @stability experimental
|
|
300
|
+
* @category models
|
|
301
|
+
* @since 4.1.5
|
|
302
|
+
*/
|
|
303
|
+
export interface Registry {
|
|
304
|
+
readonly files: ReadonlyArray<FileDescriptor>;
|
|
305
|
+
readonly getFile: (name: string) => FileDescriptor | undefined;
|
|
306
|
+
readonly getMessage: (typeName: string) => MessageDescriptor | undefined;
|
|
307
|
+
readonly getEnum: (typeName: string) => EnumDescriptor | undefined;
|
|
308
|
+
readonly getService: (typeName: string) => ServiceDescriptor | undefined;
|
|
309
|
+
readonly getExtension: (typeName: string) => ExtensionDescriptor | undefined;
|
|
310
|
+
/** The extension of `extendee`, by its full name, with field `number`. */
|
|
311
|
+
readonly findExtension: (extendee: string, number: number) => ExtensionDescriptor | undefined;
|
|
312
|
+
}
|
|
313
|
+
declare const ProtobufDescriptorError_base: new <A extends Record<string, any> = {}>(args: import("../Types.ts").VoidIfEmpty<{ readonly [P in keyof A as P extends "_tag" ? never : P]: A[P]; }>) => import("../Cause.ts").YieldableError & {
|
|
314
|
+
readonly _tag: "ProtobufDescriptorError";
|
|
315
|
+
} & Readonly<A>;
|
|
316
|
+
/**
|
|
317
|
+
* The error for descriptors that do not resolve, such as a missing
|
|
318
|
+
* dependency or type, or an unsupported edition.
|
|
319
|
+
*
|
|
320
|
+
* @stability experimental
|
|
321
|
+
* @category errors
|
|
322
|
+
* @since 4.1.5
|
|
323
|
+
*/
|
|
324
|
+
export declare class ProtobufDescriptorError extends ProtobufDescriptorError_base<{
|
|
325
|
+
readonly message: string;
|
|
326
|
+
}> {
|
|
327
|
+
}
|
|
328
|
+
/**
|
|
329
|
+
* Resolves `FileDescriptorProto`s into a {@link Registry}. Files may come in
|
|
330
|
+
* any order, but every dependency must be among them.
|
|
331
|
+
*
|
|
332
|
+
* **Details**
|
|
333
|
+
*
|
|
334
|
+
* Resolving checks references and the field layout used by the message codec,
|
|
335
|
+
* including field-number bounds, duplicate names and numbers, oneof membership,
|
|
336
|
+
* and map key types. Invalid layouts return a {@link ProtobufDescriptorError}.
|
|
337
|
+
* This does not replace protoc's validation of `.proto` source files.
|
|
338
|
+
*
|
|
339
|
+
* **Example** (Resolving a file)
|
|
340
|
+
*
|
|
341
|
+
* ```ts import.meta.vitest
|
|
342
|
+
* import { Result } from "effect"
|
|
343
|
+
* import { ProtobufDescriptor } from "effect/protobuf"
|
|
344
|
+
*
|
|
345
|
+
* const registry = Result.getOrThrow(ProtobufDescriptor.make([{
|
|
346
|
+
* name: "point.proto",
|
|
347
|
+
* syntax: "proto3",
|
|
348
|
+
* dependency: [],
|
|
349
|
+
* message_type: [{
|
|
350
|
+
* name: "Point",
|
|
351
|
+
* field: [
|
|
352
|
+
* { name: "x", number: 1, label: 1, type: 5 },
|
|
353
|
+
* { name: "y", number: 2, label: 1, type: 5 }
|
|
354
|
+
* ]
|
|
355
|
+
* }]
|
|
356
|
+
* }]))
|
|
357
|
+
*
|
|
358
|
+
* const x = registry.getMessage("Point")!.fields[0]
|
|
359
|
+
* x.kind === "singular" && x.presence // => "implicit"
|
|
360
|
+
* ```
|
|
361
|
+
*
|
|
362
|
+
* @stability experimental
|
|
363
|
+
* @category constructors
|
|
364
|
+
* @since 4.1.5
|
|
365
|
+
*/
|
|
366
|
+
export declare const make: (files: Iterable<FileDescriptorProto>) => Result.Result<Registry, ProtobufDescriptorError>;
|
|
367
|
+
/**
|
|
368
|
+
* Decodes a `FileDescriptorSet`, as `protoc --descriptor_set_out` and
|
|
369
|
+
* `buf build` write it, and resolves its files into a {@link Registry}.
|
|
370
|
+
*
|
|
371
|
+
* @stability experimental
|
|
372
|
+
* @category constructors
|
|
373
|
+
* @since 4.1.5
|
|
374
|
+
*/
|
|
375
|
+
export declare const fromFileDescriptorSet: (bytes: Uint8Array) => Result.Result<Registry, ProtobufDescriptorError>;
|
|
376
|
+
export * from "./ProtobufDescriptorProto.ts";
|
|
377
|
+
//# sourceMappingURL=ProtobufDescriptor.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ProtobufDescriptor.d.ts","sourceRoot":"","sources":["../../src/protobuf/ProtobufDescriptor.ts"],"names":[],"mappings":"AAsDA,OAAO,KAAK,MAAM,MAAM,cAAc,CAAA;AAItC,OAAO,KAAK,EACV,eAAe,EACf,mBAAmB,EACnB,wBAAwB,EACxB,oBAAoB,EACpB,mBAAmB,EAEnB,qBAAqB,EACrB,oBAAoB,EACpB,sBAAsB,EACvB,MAAM,8BAA8B,CAAA;AAMrC;;;;;;;GAOG;AACH,MAAM,MAAM,WAAW,GAAG,QAAQ,GAAG,QAAQ,GAAG,MAAM,GAAG,MAAM,GAAG,MAAM,CAAA;AAExE;;;;;;GAMG;AACH,MAAM,MAAM,UAAU,GAClB,QAAQ,GACR,OAAO,GACP,OAAO,GACP,QAAQ,GACR,OAAO,GACP,SAAS,GACT,SAAS,GACT,MAAM,GACN,QAAQ,GACR,OAAO,GACP,QAAQ,GACR,UAAU,GACV,UAAU,GACV,QAAQ,GACR,QAAQ,CAAA;AAEZ;;;;;;;;GAQG;AACH,MAAM,MAAM,MAAM,GAAG,QAAQ,GAAG,QAAQ,GAAG,QAAQ,CAAA;AAEnD;;;;;;;;;;;;;GAaG;AACH,MAAM,MAAM,QAAQ,GAAG,UAAU,GAAG,UAAU,GAAG,UAAU,CAAA;AAE3D;;;;;;GAMG;AACH,MAAM,WAAW,cAAc;IAC7B,QAAQ,CAAC,IAAI,EAAE,gBAAgB,CAAA;IAC/B,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAA;IACrB,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAA;IACx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1,135 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Descriptors of `.proto` files: their messages, enums, extensions and
|
|
3
|
+
* services, resolved from the `FileDescriptorProto`s that protoc, buf, gRPC
|
|
4
|
+
* server reflection and protoc plugins exchange.
|
|
5
|
+
*
|
|
6
|
+
* **Mental model**
|
|
7
|
+
*
|
|
8
|
+
* - A {@link Registry} holds the files of one set of `.proto` files and finds
|
|
9
|
+
* their types by full name, such as `"acme.v1.User"`.
|
|
10
|
+
* - Descriptors are resolved: every field states its presence, packing,
|
|
11
|
+
* encoding and UTF-8 validation, as the file's syntax or edition and its
|
|
12
|
+
* features decide them, and refers to the descriptor of its type.
|
|
13
|
+
* - `ProtobufMessage` encodes and decodes the values of a message descriptor.
|
|
14
|
+
* Neither module depends on Effect Schema. A Schema can separately transform
|
|
15
|
+
* these plain values into application types.
|
|
16
|
+
* - Field and oneof names are preserved exactly in JavaScript values.
|
|
17
|
+
*
|
|
18
|
+
* **Gotchas**
|
|
19
|
+
*
|
|
20
|
+
* - Type references must be fully qualified, with a leading dot, as protoc and
|
|
21
|
+
* buf write them.
|
|
22
|
+
* - proto2, proto3 and editions 2023, 2024 and 2026 are supported. Unknown
|
|
23
|
+
* editions are rejected rather than interpreted with older defaults.
|
|
24
|
+
* - Descriptors are compiler output. Source-level naming, visibility and
|
|
25
|
+
* definition-size rules are enforced by protoc, before runtime resolution.
|
|
26
|
+
* - `descriptor.proto` itself is part of this module: `descriptorFile`,
|
|
27
|
+
* and per message an interface and a `MessageDescriptor` of the same name,
|
|
28
|
+
* such as `FileDescriptorProto`, generated from protoc's descriptor of it.
|
|
29
|
+
*
|
|
30
|
+
* **Example** (Finding a message)
|
|
31
|
+
*
|
|
32
|
+
* ```ts import.meta.vitest
|
|
33
|
+
* import { Result } from "effect"
|
|
34
|
+
* import { ProtobufDescriptor } from "effect/protobuf"
|
|
35
|
+
*
|
|
36
|
+
* const registry = Result.getOrThrow(ProtobufDescriptor.make([{
|
|
37
|
+
* name: "user.proto",
|
|
38
|
+
* package: "acme.v1",
|
|
39
|
+
* syntax: "proto3",
|
|
40
|
+
* dependency: [],
|
|
41
|
+
* message_type: [{
|
|
42
|
+
* name: "User",
|
|
43
|
+
* field: [{ name: "display_name", number: 1, label: 1, type: 9 }]
|
|
44
|
+
* }]
|
|
45
|
+
* }]))
|
|
46
|
+
*
|
|
47
|
+
* const user = registry.getMessage("acme.v1.User")!
|
|
48
|
+
* user.fields.map((field) => field.name) // => ["display_name"]
|
|
49
|
+
* ```
|
|
50
|
+
*
|
|
51
|
+
* @stability experimental
|
|
52
|
+
* @since 4.1.5
|
|
53
|
+
*/
|
|
54
|
+
import * as Data from "../Data.js";
|
|
55
|
+
import * as Result from "../Result.js";
|
|
56
|
+
import * as Binary from "./internal/binary.js";
|
|
57
|
+
import * as Resolve from "./internal/resolve.js";
|
|
58
|
+
import { FileDescriptorSet as FileDescriptorSetMessage } from "./ProtobufDescriptorProto.js";
|
|
59
|
+
/**
|
|
60
|
+
* The error for descriptors that do not resolve, such as a missing
|
|
61
|
+
* dependency or type, or an unsupported edition.
|
|
62
|
+
*
|
|
63
|
+
* @stability experimental
|
|
64
|
+
* @category errors
|
|
65
|
+
* @since 4.1.5
|
|
66
|
+
*/
|
|
67
|
+
export class ProtobufDescriptorError extends /*#__PURE__*/Data.TaggedError("ProtobufDescriptorError") {}
|
|
68
|
+
/**
|
|
69
|
+
* Resolves `FileDescriptorProto`s into a {@link Registry}. Files may come in
|
|
70
|
+
* any order, but every dependency must be among them.
|
|
71
|
+
*
|
|
72
|
+
* **Details**
|
|
73
|
+
*
|
|
74
|
+
* Resolving checks references and the field layout used by the message codec,
|
|
75
|
+
* including field-number bounds, duplicate names and numbers, oneof membership,
|
|
76
|
+
* and map key types. Invalid layouts return a {@link ProtobufDescriptorError}.
|
|
77
|
+
* This does not replace protoc's validation of `.proto` source files.
|
|
78
|
+
*
|
|
79
|
+
* **Example** (Resolving a file)
|
|
80
|
+
*
|
|
81
|
+
* ```ts import.meta.vitest
|
|
82
|
+
* import { Result } from "effect"
|
|
83
|
+
* import { ProtobufDescriptor } from "effect/protobuf"
|
|
84
|
+
*
|
|
85
|
+
* const registry = Result.getOrThrow(ProtobufDescriptor.make([{
|
|
86
|
+
* name: "point.proto",
|
|
87
|
+
* syntax: "proto3",
|
|
88
|
+
* dependency: [],
|
|
89
|
+
* message_type: [{
|
|
90
|
+
* name: "Point",
|
|
91
|
+
* field: [
|
|
92
|
+
* { name: "x", number: 1, label: 1, type: 5 },
|
|
93
|
+
* { name: "y", number: 2, label: 1, type: 5 }
|
|
94
|
+
* ]
|
|
95
|
+
* }]
|
|
96
|
+
* }]))
|
|
97
|
+
*
|
|
98
|
+
* const x = registry.getMessage("Point")!.fields[0]
|
|
99
|
+
* x.kind === "singular" && x.presence // => "implicit"
|
|
100
|
+
* ```
|
|
101
|
+
*
|
|
102
|
+
* @stability experimental
|
|
103
|
+
* @category constructors
|
|
104
|
+
* @since 4.1.5
|
|
105
|
+
*/
|
|
106
|
+
export const make = files => {
|
|
107
|
+
try {
|
|
108
|
+
return Result.succeed(Resolve.resolve(files));
|
|
109
|
+
} catch (e) {
|
|
110
|
+
if (e instanceof Resolve.ResolveError) return Result.fail(new ProtobufDescriptorError({
|
|
111
|
+
message: e.message
|
|
112
|
+
}));
|
|
113
|
+
throw e;
|
|
114
|
+
}
|
|
115
|
+
};
|
|
116
|
+
/**
|
|
117
|
+
* Decodes a `FileDescriptorSet`, as `protoc --descriptor_set_out` and
|
|
118
|
+
* `buf build` write it, and resolves its files into a {@link Registry}.
|
|
119
|
+
*
|
|
120
|
+
* @stability experimental
|
|
121
|
+
* @category constructors
|
|
122
|
+
* @since 4.1.5
|
|
123
|
+
*/
|
|
124
|
+
export const fromFileDescriptorSet = bytes => {
|
|
125
|
+
const set = Binary.decode(FileDescriptorSetMessage, bytes, undefined);
|
|
126
|
+
if (Result.isFailure(set)) return Result.fail(new ProtobufDescriptorError({
|
|
127
|
+
message: set.failure.message
|
|
128
|
+
}));
|
|
129
|
+
return make(set.success.file ?? []);
|
|
130
|
+
};
|
|
131
|
+
// -----------------------------------------------------------------------------
|
|
132
|
+
// descriptor.proto
|
|
133
|
+
// -----------------------------------------------------------------------------
|
|
134
|
+
export * from "./ProtobufDescriptorProto.js";
|
|
135
|
+
//# sourceMappingURL=ProtobufDescriptor.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ProtobufDescriptor.js","names":[],"sources":["../../src/protobuf/ProtobufDescriptor.ts"],"sourcesContent":[null],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAqDA,OAAO,KAAK,IAAI,MAAM,YAAY;AAClC,OAAO,KAAK,MAAM,MAAM,cAAc;AACtC,OAAO,KAAK,MAAM,MAAM,sBAAsB;AAC9C,OAAO,KAAK,OAAO,MAAM,uBAAuB;AAChD,SAAS,iBAAiB,IAAI,wBAAwB,QAAQ,8BAA8B;AAgX5F;;;;;;;;AAQA,OAAM,MAAO,uBAAwB,sBAAQ,IAAI,CAAC,WAAW,CAAC,yBAAyB,CAErF;AAEF;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAsCA,OAAO,MAAM,IAAI,GAAI,KAAoC,IAAsD;EAC7G,IAAI;IACF,OAAO,MAAM,CAAC,OAAO,CAAC,OAAO,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC;EAC/C,CAAC,CAAC,OAAO,CAAC,EAAE;IACV,IAAI,CAAC,YAAY,OAAO,CAAC,YAAY,EAAE,OAAO,MAAM,CAAC,IAAI,CAAC,IAAI,uBAAuB,CAAC;MAAE,OAAO,EAAE,CAAC,CAAC;IAAO,CAAE,CAAC,CAAC;IAC9G,MAAM,CAAC;EACT;AACF,CAAC;AAED;;;;;;;;AAQA,OAAO,MAAM,qBAAqB,GAAI,KAAiB,IAAsD;EAC3G,MAAM,GAAG,GAAG,MAAM,CAAC,MAAM,CAAC,wBAAwB,EAAE,KAAK,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