effect 4.0.0-beta.103 → 4.0.0-beta.104
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/Cache.js +1 -1
- package/dist/Cache.js.map +1 -1
- package/dist/Channel.d.ts +1 -1
- package/dist/Channel.d.ts.map +1 -1
- package/dist/Channel.js.map +1 -1
- package/dist/Config.d.ts.map +1 -1
- package/dist/Config.js +28 -7
- package/dist/Config.js.map +1 -1
- package/dist/ConfigProvider.d.ts.map +1 -1
- package/dist/ConfigProvider.js +2 -1
- package/dist/ConfigProvider.js.map +1 -1
- package/dist/Context.d.ts +2 -2
- package/dist/Context.d.ts.map +1 -1
- package/dist/Context.js.map +1 -1
- package/dist/Crypto.d.ts.map +1 -1
- package/dist/Crypto.js +13 -5
- package/dist/Crypto.js.map +1 -1
- package/dist/Duration.d.ts.map +1 -1
- package/dist/Duration.js +12 -1
- package/dist/Duration.js.map +1 -1
- package/dist/Effect.d.ts +132 -14
- package/dist/Effect.d.ts.map +1 -1
- package/dist/Effect.js +38 -0
- package/dist/Effect.js.map +1 -1
- package/dist/Equal.d.ts.map +1 -1
- package/dist/Equal.js +10 -2
- package/dist/Equal.js.map +1 -1
- package/dist/ExecutionPlan.d.ts +73 -0
- package/dist/ExecutionPlan.d.ts.map +1 -1
- package/dist/ExecutionPlan.js +1 -1
- package/dist/ExecutionPlan.js.map +1 -1
- package/dist/FiberSet.js +1 -1
- package/dist/FileSystem.d.ts +2 -2
- package/dist/Function.d.ts +4 -3
- package/dist/Function.d.ts.map +1 -1
- package/dist/Function.js +5 -5
- package/dist/Function.js.map +1 -1
- package/dist/Iterable.d.ts.map +1 -1
- package/dist/Iterable.js +11 -10
- package/dist/Iterable.js.map +1 -1
- package/dist/Layer.d.ts.map +1 -1
- package/dist/Layer.js +7 -5
- package/dist/Layer.js.map +1 -1
- package/dist/Schedule.d.ts +8 -8
- package/dist/Schedule.d.ts.map +1 -1
- package/dist/Schedule.js +4 -4
- package/dist/Schedule.js.map +1 -1
- package/dist/Schema.d.ts +32 -32
- package/dist/Schema.d.ts.map +1 -1
- package/dist/Schema.js +23 -18
- package/dist/Schema.js.map +1 -1
- package/dist/SchemaAST.d.ts +3 -3
- package/dist/SchemaAST.d.ts.map +1 -1
- package/dist/SchemaAST.js +47 -31
- package/dist/SchemaAST.js.map +1 -1
- package/dist/SchemaParser.d.ts.map +1 -1
- package/dist/SchemaParser.js +35 -53
- package/dist/SchemaParser.js.map +1 -1
- package/dist/ScopedCache.js +1 -1
- package/dist/ScopedCache.js.map +1 -1
- package/dist/Sink.d.ts +1 -1
- package/dist/Sink.d.ts.map +1 -1
- package/dist/Stream.d.ts +27 -4
- package/dist/Stream.d.ts.map +1 -1
- package/dist/Stream.js +27 -2
- package/dist/Stream.js.map +1 -1
- package/dist/SynchronizedRef.js +1 -1
- package/dist/SynchronizedRef.js.map +1 -1
- package/dist/Terminal.js +1 -1
- package/dist/Terminal.js.map +1 -1
- package/dist/Tuple.d.ts +6 -4
- package/dist/Tuple.d.ts.map +1 -1
- package/dist/Tuple.js.map +1 -1
- package/dist/TxReentrantLock.d.ts +0 -56
- package/dist/TxReentrantLock.d.ts.map +1 -1
- package/dist/TxReentrantLock.js +8 -8
- package/dist/TxReentrantLock.js.map +1 -1
- package/dist/internal/dateTime.js +1 -1
- package/dist/internal/dateTime.js.map +1 -1
- package/dist/internal/executionPlan.js +51 -3
- package/dist/internal/executionPlan.js.map +1 -1
- package/dist/internal/hashMap.js +12 -8
- package/dist/internal/hashMap.js.map +1 -1
- package/dist/internal/matcher.js +1 -1
- package/dist/internal/matcher.js.map +1 -1
- package/dist/internal/schedule.js.map +1 -1
- package/dist/internal/schema/annotations.js +2 -0
- package/dist/internal/schema/annotations.js.map +1 -1
- package/dist/internal/schema/toArbitrary.js +1 -1
- package/dist/internal/schema/toArbitrary.js.map +1 -1
- package/dist/internal/trie.js +13 -3
- package/dist/internal/trie.js.map +1 -1
- package/dist/testing/TestClock.d.ts.map +1 -1
- package/dist/testing/TestClock.js +11 -1
- package/dist/testing/TestClock.js.map +1 -1
- package/dist/testing/TestSchema.d.ts +1 -1
- package/dist/testing/TestSchema.d.ts.map +1 -1
- package/dist/unstable/ai/AiError.js +19 -19
- package/dist/unstable/ai/AiError.js.map +1 -1
- package/dist/unstable/ai/Chat.js +1 -1
- package/dist/unstable/ai/Chat.js.map +1 -1
- package/dist/unstable/ai/LanguageModel.js +4 -2
- package/dist/unstable/ai/LanguageModel.js.map +1 -1
- package/dist/unstable/ai/McpSchema.d.ts +132 -132
- package/dist/unstable/ai/McpSchema.d.ts.map +1 -1
- package/dist/unstable/ai/McpSchema.js +8 -8
- package/dist/unstable/ai/McpSchema.js.map +1 -1
- package/dist/unstable/ai/McpServer.js +1 -1
- package/dist/unstable/ai/McpServer.js.map +1 -1
- package/dist/unstable/ai/Prompt.d.ts +15 -3
- package/dist/unstable/ai/Prompt.d.ts.map +1 -1
- package/dist/unstable/ai/Prompt.js +6 -3
- package/dist/unstable/ai/Prompt.js.map +1 -1
- package/dist/unstable/cli/CliError.d.ts +3 -3
- package/dist/unstable/cli/CliError.js +11 -11
- package/dist/unstable/cli/CliError.js.map +1 -1
- package/dist/unstable/cli/Command.d.ts +9 -9
- package/dist/unstable/cli/Command.d.ts.map +1 -1
- package/dist/unstable/cli/Command.js +8 -6
- package/dist/unstable/cli/Command.js.map +1 -1
- package/dist/unstable/cli/Param.d.ts +7 -5
- package/dist/unstable/cli/Param.d.ts.map +1 -1
- package/dist/unstable/cli/Param.js +15 -11
- package/dist/unstable/cli/Param.js.map +1 -1
- package/dist/unstable/cli/Primitive.d.ts.map +1 -1
- package/dist/unstable/cli/Primitive.js +31 -24
- package/dist/unstable/cli/Primitive.js.map +1 -1
- package/dist/unstable/cli/Prompt.d.ts.map +1 -1
- package/dist/unstable/cli/Prompt.js +31 -17
- package/dist/unstable/cli/Prompt.js.map +1 -1
- package/dist/unstable/cli/internal/ansi.js +2 -2
- package/dist/unstable/cli/internal/ansi.js.map +1 -1
- package/dist/unstable/cli/internal/command.d.ts +2 -2
- package/dist/unstable/cli/internal/command.d.ts.map +1 -1
- package/dist/unstable/cli/internal/command.js +10 -9
- package/dist/unstable/cli/internal/command.js.map +1 -1
- package/dist/unstable/cli/internal/completions/bash.js +69 -9
- package/dist/unstable/cli/internal/completions/bash.js.map +1 -1
- package/dist/unstable/cli/internal/completions/descriptor.js +24 -18
- package/dist/unstable/cli/internal/completions/descriptor.js.map +1 -1
- package/dist/unstable/cli/internal/completions/fish.js +5 -5
- package/dist/unstable/cli/internal/completions/fish.js.map +1 -1
- package/dist/unstable/cli/internal/help.d.ts.map +1 -1
- package/dist/unstable/cli/internal/help.js +4 -2
- package/dist/unstable/cli/internal/help.js.map +1 -1
- package/dist/unstable/cli/internal/parser.js +3 -3
- package/dist/unstable/cli/internal/parser.js.map +1 -1
- package/dist/unstable/cli/internal/wizard.js +2 -2
- package/dist/unstable/cli/internal/wizard.js.map +1 -1
- package/dist/unstable/cluster/ClusterError.js +7 -7
- package/dist/unstable/cluster/ClusterError.js.map +1 -1
- package/dist/unstable/cluster/ClusterWorkflowEngine.d.ts.map +1 -1
- package/dist/unstable/cluster/ClusterWorkflowEngine.js +1 -1
- package/dist/unstable/cluster/ClusterWorkflowEngine.js.map +1 -1
- package/dist/unstable/cluster/MessageStorage.d.ts.map +1 -1
- package/dist/unstable/cluster/MessageStorage.js +8 -1
- package/dist/unstable/cluster/MessageStorage.js.map +1 -1
- package/dist/unstable/cluster/Reply.d.ts +8 -0
- package/dist/unstable/cluster/Reply.d.ts.map +1 -1
- package/dist/unstable/cluster/Reply.js +12 -0
- package/dist/unstable/cluster/Reply.js.map +1 -1
- package/dist/unstable/cluster/RunnerServer.d.ts.map +1 -1
- package/dist/unstable/cluster/RunnerServer.js +4 -2
- package/dist/unstable/cluster/RunnerServer.js.map +1 -1
- package/dist/unstable/cluster/RunnerStorage.d.ts +1 -2
- package/dist/unstable/cluster/RunnerStorage.d.ts.map +1 -1
- package/dist/unstable/cluster/RunnerStorage.js +7 -6
- package/dist/unstable/cluster/RunnerStorage.js.map +1 -1
- package/dist/unstable/cluster/Sharding.d.ts.map +1 -1
- package/dist/unstable/cluster/Sharding.js +22 -4
- package/dist/unstable/cluster/Sharding.js.map +1 -1
- package/dist/unstable/cluster/internal/entityManager.js +1 -1
- package/dist/unstable/cluster/internal/entityManager.js.map +1 -1
- package/dist/unstable/cluster/internal/resourceMap.js +2 -2
- package/dist/unstable/cluster/internal/resourceMap.js.map +1 -1
- package/dist/unstable/cluster/internal/resourceRef.js +17 -0
- package/dist/unstable/cluster/internal/resourceRef.js.map +1 -1
- package/dist/unstable/devtools/DevToolsClient.d.ts.map +1 -1
- package/dist/unstable/devtools/DevToolsClient.js +7 -2
- package/dist/unstable/devtools/DevToolsClient.js.map +1 -1
- package/dist/unstable/encoding/Ini.d.ts +20 -0
- package/dist/unstable/encoding/Ini.d.ts.map +1 -0
- package/dist/unstable/encoding/Ini.js +153 -0
- package/dist/unstable/encoding/Ini.js.map +1 -0
- package/dist/unstable/encoding/Msgpack.d.ts +2 -1
- package/dist/unstable/encoding/Msgpack.d.ts.map +1 -1
- package/dist/unstable/encoding/Msgpack.js +21 -7
- package/dist/unstable/encoding/Msgpack.js.map +1 -1
- package/dist/unstable/encoding/Ndjson.d.ts.map +1 -1
- package/dist/unstable/encoding/Ndjson.js +7 -1
- package/dist/unstable/encoding/Ndjson.js.map +1 -1
- package/dist/unstable/encoding/Sse.d.ts.map +1 -1
- package/dist/unstable/encoding/Sse.js +14 -23
- package/dist/unstable/encoding/Sse.js.map +1 -1
- package/dist/unstable/encoding/Toml.d.ts +19 -0
- package/dist/unstable/encoding/Toml.d.ts.map +1 -0
- package/dist/unstable/encoding/Toml.js +434 -0
- package/dist/unstable/encoding/Toml.js.map +1 -0
- package/dist/unstable/encoding/Yaml.d.ts +19 -0
- package/dist/unstable/encoding/Yaml.d.ts.map +1 -0
- package/dist/unstable/encoding/Yaml.js +461 -0
- package/dist/unstable/encoding/Yaml.js.map +1 -0
- package/dist/unstable/encoding/index.d.ts +12 -0
- package/dist/unstable/encoding/index.d.ts.map +1 -1
- package/dist/unstable/encoding/index.js +12 -0
- package/dist/unstable/encoding/index.js.map +1 -1
- package/dist/unstable/eventlog/EventJournal.d.ts +1 -1
- package/dist/unstable/eventlog/EventJournal.d.ts.map +1 -1
- package/dist/unstable/eventlog/EventJournal.js +13 -5
- package/dist/unstable/eventlog/EventJournal.js.map +1 -1
- package/dist/unstable/eventlog/EventLogMessage.js +1 -1
- package/dist/unstable/eventlog/EventLogMessage.js.map +1 -1
- package/dist/unstable/eventlog/EventLogServerUnencrypted.js +1 -1
- package/dist/unstable/eventlog/EventLogServerUnencrypted.js.map +1 -1
- package/dist/unstable/eventlog/SqlEventJournal.d.ts.map +1 -1
- package/dist/unstable/eventlog/SqlEventJournal.js +1 -4
- package/dist/unstable/eventlog/SqlEventJournal.js.map +1 -1
- package/dist/unstable/http/FindMyWay/internal/queryString.d.ts +11 -0
- package/dist/unstable/http/FindMyWay/internal/queryString.d.ts.map +1 -0
- package/dist/unstable/http/FindMyWay/internal/queryString.js +259 -0
- package/dist/unstable/http/FindMyWay/internal/queryString.js.map +1 -0
- package/dist/unstable/http/FindMyWay/internal/router.d.ts +2 -0
- package/dist/unstable/http/FindMyWay/internal/router.d.ts.map +1 -0
- package/dist/unstable/http/FindMyWay/internal/router.js +665 -0
- package/dist/unstable/http/FindMyWay/internal/router.js.map +1 -0
- package/dist/unstable/http/FindMyWay.d.ts +33 -8
- package/dist/unstable/http/FindMyWay.d.ts.map +1 -1
- package/dist/unstable/http/FindMyWay.js +4 -7
- package/dist/unstable/http/FindMyWay.js.map +1 -1
- package/dist/unstable/http/HttpClientError.js +1 -1
- package/dist/unstable/http/HttpClientError.js.map +1 -1
- package/dist/unstable/http/HttpClientRequest.d.ts.map +1 -1
- package/dist/unstable/http/HttpClientRequest.js +2 -14
- package/dist/unstable/http/HttpClientRequest.js.map +1 -1
- package/dist/unstable/http/HttpClientResponse.js +1 -16
- package/dist/unstable/http/HttpClientResponse.js.map +1 -1
- package/dist/unstable/http/HttpPlatform.d.ts.map +1 -1
- package/dist/unstable/http/HttpPlatform.js +21 -3
- package/dist/unstable/http/HttpPlatform.js.map +1 -1
- package/dist/unstable/http/HttpServerRequest.d.ts.map +1 -1
- package/dist/unstable/http/HttpServerRequest.js +7 -6
- package/dist/unstable/http/HttpServerRequest.js.map +1 -1
- package/dist/unstable/http/HttpServerResponse.d.ts.map +1 -1
- package/dist/unstable/http/HttpServerResponse.js +8 -6
- package/dist/unstable/http/HttpServerResponse.js.map +1 -1
- package/dist/unstable/http/Multipart.d.ts +1 -1
- package/dist/unstable/http/Multipart.d.ts.map +1 -1
- package/dist/unstable/http/Multipart.js +9 -2
- package/dist/unstable/http/Multipart.js.map +1 -1
- package/dist/unstable/http/MultipartParser/HeadersParser.d.ts +53 -0
- package/dist/unstable/http/MultipartParser/HeadersParser.d.ts.map +1 -0
- package/dist/unstable/http/MultipartParser/HeadersParser.js +14 -0
- package/dist/unstable/http/MultipartParser/HeadersParser.js.map +1 -0
- package/dist/unstable/http/MultipartParser/Search.d.ts +11 -0
- package/dist/unstable/http/MultipartParser/Search.d.ts.map +1 -0
- package/dist/unstable/http/MultipartParser/Search.js +14 -0
- package/dist/unstable/http/MultipartParser/Search.js.map +1 -0
- package/dist/unstable/http/MultipartParser/internal/contentType.d.ts +5 -0
- package/dist/unstable/http/MultipartParser/internal/contentType.d.ts.map +1 -0
- package/dist/unstable/http/MultipartParser/internal/contentType.js +82 -0
- package/dist/unstable/http/MultipartParser/internal/contentType.js.map +1 -0
- package/dist/unstable/http/MultipartParser/internal/headers.d.ts +3 -0
- package/dist/unstable/http/MultipartParser/internal/headers.d.ts.map +1 -0
- package/dist/unstable/http/MultipartParser/internal/headers.js +194 -0
- package/dist/unstable/http/MultipartParser/internal/headers.js.map +1 -0
- package/dist/unstable/http/MultipartParser/internal/multipart.d.ts +8 -0
- package/dist/unstable/http/MultipartParser/internal/multipart.d.ts.map +1 -0
- package/dist/unstable/http/MultipartParser/internal/multipart.js +226 -0
- package/dist/unstable/http/MultipartParser/internal/multipart.js.map +1 -0
- package/dist/unstable/http/MultipartParser/internal/search.d.ts +5 -0
- package/dist/unstable/http/MultipartParser/internal/search.d.ts.map +1 -0
- package/dist/unstable/http/MultipartParser/internal/search.js +120 -0
- package/dist/unstable/http/MultipartParser/internal/search.js.map +1 -0
- package/dist/unstable/http/MultipartParser.d.ts +98 -0
- package/dist/unstable/http/MultipartParser.d.ts.map +1 -0
- package/dist/unstable/http/MultipartParser.js +23 -0
- package/dist/unstable/http/MultipartParser.js.map +1 -0
- package/dist/unstable/http/Template.d.ts.map +1 -1
- package/dist/unstable/http/Template.js +2 -2
- package/dist/unstable/http/Template.js.map +1 -1
- package/dist/unstable/http/index.d.ts +1 -1
- package/dist/unstable/http/index.d.ts.map +1 -1
- package/dist/unstable/http/index.js +1 -1
- package/dist/unstable/http/index.js.map +1 -1
- package/dist/unstable/http/internal/httpBody.d.ts +2 -0
- package/dist/unstable/http/internal/httpBody.d.ts.map +1 -0
- package/dist/unstable/http/internal/httpBody.js +10 -0
- package/dist/unstable/http/internal/httpBody.js.map +1 -0
- package/dist/unstable/httpapi/HttpApi.d.ts.map +1 -1
- package/dist/unstable/httpapi/HttpApi.js +5 -5
- package/dist/unstable/httpapi/HttpApi.js.map +1 -1
- package/dist/unstable/httpapi/HttpApiBuilder.js +68 -15
- package/dist/unstable/httpapi/HttpApiBuilder.js.map +1 -1
- package/dist/unstable/httpapi/HttpApiClient.d.ts +1 -1
- package/dist/unstable/httpapi/HttpApiClient.d.ts.map +1 -1
- package/dist/unstable/httpapi/HttpApiClient.js +65 -25
- package/dist/unstable/httpapi/HttpApiClient.js.map +1 -1
- package/dist/unstable/httpapi/HttpApiEndpoint.d.ts +6 -4
- package/dist/unstable/httpapi/HttpApiEndpoint.d.ts.map +1 -1
- package/dist/unstable/httpapi/HttpApiEndpoint.js +73 -16
- package/dist/unstable/httpapi/HttpApiEndpoint.js.map +1 -1
- package/dist/unstable/httpapi/HttpApiError.d.ts +5 -5
- package/dist/unstable/httpapi/HttpApiError.d.ts.map +1 -1
- package/dist/unstable/httpapi/HttpApiError.js +17 -17
- package/dist/unstable/httpapi/HttpApiError.js.map +1 -1
- package/dist/unstable/httpapi/HttpApiMiddleware.d.ts +1 -1
- package/dist/unstable/httpapi/HttpApiMiddleware.js +1 -1
- package/dist/unstable/httpapi/HttpApiSchema.d.ts +219 -0
- package/dist/unstable/httpapi/HttpApiSchema.d.ts.map +1 -1
- package/dist/unstable/httpapi/HttpApiSchema.js +170 -0
- package/dist/unstable/httpapi/HttpApiSchema.js.map +1 -1
- package/dist/unstable/httpapi/OpenApi.d.ts +8 -0
- package/dist/unstable/httpapi/OpenApi.d.ts.map +1 -1
- package/dist/unstable/httpapi/OpenApi.js +45 -18
- package/dist/unstable/httpapi/OpenApi.js.map +1 -1
- package/dist/unstable/observability/OtlpExporter.d.ts +1 -1
- package/dist/unstable/observability/OtlpExporter.d.ts.map +1 -1
- package/dist/unstable/observability/OtlpExporter.js +2 -1
- package/dist/unstable/observability/OtlpExporter.js.map +1 -1
- package/dist/unstable/observability/OtlpLogger.d.ts.map +1 -1
- package/dist/unstable/observability/OtlpLogger.js +2 -2
- package/dist/unstable/observability/OtlpLogger.js.map +1 -1
- package/dist/unstable/observability/OtlpMetrics.d.ts +2 -2
- package/dist/unstable/observability/OtlpMetrics.d.ts.map +1 -1
- package/dist/unstable/observability/OtlpMetrics.js +28 -15
- package/dist/unstable/observability/OtlpMetrics.js.map +1 -1
- package/dist/unstable/observability/OtlpTracer.js +1 -1
- package/dist/unstable/observability/OtlpTracer.js.map +1 -1
- package/dist/unstable/persistence/PersistedQueue.d.ts.map +1 -1
- package/dist/unstable/persistence/PersistedQueue.js +9 -9
- package/dist/unstable/persistence/PersistedQueue.js.map +1 -1
- package/dist/unstable/persistence/Persistence.d.ts.map +1 -1
- package/dist/unstable/persistence/Persistence.js +17 -7
- package/dist/unstable/persistence/Persistence.js.map +1 -1
- package/dist/unstable/persistence/RateLimiter.d.ts +22 -12
- package/dist/unstable/persistence/RateLimiter.d.ts.map +1 -1
- package/dist/unstable/persistence/RateLimiter.js +15 -42
- package/dist/unstable/persistence/RateLimiter.js.map +1 -1
- package/dist/unstable/persistence/Redis.js +1 -1
- package/dist/unstable/persistence/Redis.js.map +1 -1
- package/dist/unstable/rpc/RpcClient.d.ts +14 -0
- package/dist/unstable/rpc/RpcClient.d.ts.map +1 -1
- package/dist/unstable/rpc/RpcClient.js +18 -9
- package/dist/unstable/rpc/RpcClient.js.map +1 -1
- package/dist/unstable/rpc/RpcClientError.js +2 -2
- package/dist/unstable/rpc/RpcClientError.js.map +1 -1
- package/dist/unstable/rpc/RpcSerialization.js +3 -1
- package/dist/unstable/rpc/RpcSerialization.js.map +1 -1
- package/dist/unstable/schema/Model.d.ts +1 -1
- package/dist/unstable/schema/Model.d.ts.map +1 -1
- package/dist/unstable/schema/VariantSchema.d.ts +5 -5
- package/dist/unstable/schema/VariantSchema.d.ts.map +1 -1
- package/dist/unstable/schema/VariantSchema.js +17 -9
- package/dist/unstable/schema/VariantSchema.js.map +1 -1
- package/dist/unstable/socket/Socket.d.ts.map +1 -1
- package/dist/unstable/socket/Socket.js +28 -12
- package/dist/unstable/socket/Socket.js.map +1 -1
- package/dist/unstable/sql/SqlClient.d.ts.map +1 -1
- package/dist/unstable/sql/SqlClient.js +7 -3
- package/dist/unstable/sql/SqlClient.js.map +1 -1
- package/dist/unstable/sql/SqlError.js +13 -13
- package/dist/unstable/sql/SqlError.js.map +1 -1
- package/dist/unstable/sql/SqlResolver.js +8 -6
- package/dist/unstable/sql/SqlResolver.js.map +1 -1
- package/dist/unstable/sql/Statement.d.ts.map +1 -1
- package/dist/unstable/sql/Statement.js +8 -6
- package/dist/unstable/sql/Statement.js.map +1 -1
- package/dist/unstable/workers/WorkerError.js +5 -5
- package/dist/unstable/workers/WorkerError.js.map +1 -1
- package/dist/unstable/workflow/WorkflowEngine.d.ts +1 -1
- package/dist/unstable/workflow/WorkflowEngine.d.ts.map +1 -1
- package/dist/unstable/workflow/WorkflowEngine.js +3 -3
- package/dist/unstable/workflow/WorkflowEngine.js.map +1 -1
- package/package.json +2 -8
- package/src/Cache.ts +1 -1
- package/src/Channel.ts +1 -1
- package/src/Config.ts +28 -7
- package/src/ConfigProvider.ts +4 -1
- package/src/Context.ts +5 -5
- package/src/Crypto.ts +17 -8
- package/src/Duration.ts +16 -2
- package/src/Effect.ts +141 -17
- package/src/Equal.ts +10 -2
- package/src/ExecutionPlan.ts +78 -1
- package/src/FiberSet.ts +1 -1
- package/src/FileSystem.ts +2 -2
- package/src/Function.ts +6 -6
- package/src/Iterable.ts +11 -10
- package/src/Layer.ts +7 -5
- package/src/Schedule.ts +13 -13
- package/src/Schema.ts +50 -41
- package/src/SchemaAST.ts +69 -37
- package/src/SchemaParser.ts +75 -69
- package/src/ScopedCache.ts +1 -1
- package/src/Sink.ts +1 -1
- package/src/Stream.ts +77 -10
- package/src/SynchronizedRef.ts +1 -1
- package/src/Terminal.ts +1 -1
- package/src/Tuple.ts +7 -4
- package/src/TxReentrantLock.ts +39 -35
- package/src/internal/dateTime.ts +1 -1
- package/src/internal/executionPlan.ts +105 -10
- package/src/internal/hashMap.ts +20 -14
- package/src/internal/matcher.ts +2 -2
- package/src/internal/schedule.ts +4 -4
- package/src/internal/schema/annotations.ts +3 -0
- package/src/internal/schema/toArbitrary.ts +3 -1
- package/src/internal/trie.ts +12 -2
- package/src/testing/TestClock.ts +13 -1
- package/src/testing/TestSchema.ts +1 -1
- package/src/unstable/ai/AiError.ts +19 -19
- package/src/unstable/ai/Chat.ts +1 -1
- package/src/unstable/ai/LanguageModel.ts +4 -2
- package/src/unstable/ai/McpSchema.ts +17 -16
- package/src/unstable/ai/McpServer.ts +1 -1
- package/src/unstable/ai/Prompt.ts +21 -6
- package/src/unstable/cli/CliError.ts +12 -12
- package/src/unstable/cli/Command.ts +12 -10
- package/src/unstable/cli/Param.ts +41 -19
- package/src/unstable/cli/Primitive.ts +11 -5
- package/src/unstable/cli/Prompt.ts +36 -20
- package/src/unstable/cli/internal/ansi.ts +2 -2
- package/src/unstable/cli/internal/command.ts +15 -10
- package/src/unstable/cli/internal/completions/bash.ts +59 -9
- package/src/unstable/cli/internal/completions/descriptor.ts +14 -20
- package/src/unstable/cli/internal/completions/fish.ts +5 -7
- package/src/unstable/cli/internal/help.ts +4 -2
- package/src/unstable/cli/internal/parser.ts +3 -3
- package/src/unstable/cli/internal/wizard.ts +2 -2
- package/src/unstable/cluster/ClusterError.ts +7 -7
- package/src/unstable/cluster/ClusterWorkflowEngine.ts +4 -1
- package/src/unstable/cluster/MessageStorage.ts +9 -5
- package/src/unstable/cluster/Reply.ts +21 -0
- package/src/unstable/cluster/RunnerServer.ts +4 -10
- package/src/unstable/cluster/RunnerStorage.ts +9 -7
- package/src/unstable/cluster/Sharding.ts +35 -7
- package/src/unstable/cluster/internal/entityManager.ts +1 -1
- package/src/unstable/cluster/internal/resourceMap.ts +5 -2
- package/src/unstable/cluster/internal/resourceRef.ts +27 -5
- package/src/unstable/devtools/DevToolsClient.ts +3 -2
- package/src/unstable/encoding/Ini.ts +174 -0
- package/src/unstable/encoding/Msgpack.ts +47 -28
- package/src/unstable/encoding/Ndjson.ts +9 -1
- package/src/unstable/encoding/Sse.ts +11 -21
- package/src/unstable/encoding/Toml.ts +504 -0
- package/src/unstable/encoding/Yaml.ts +541 -0
- package/src/unstable/encoding/index.ts +15 -0
- package/src/unstable/eventlog/EventJournal.ts +14 -6
- package/src/unstable/eventlog/EventLogMessage.ts +1 -1
- package/src/unstable/eventlog/EventLogServerUnencrypted.ts +1 -1
- package/src/unstable/eventlog/SqlEventJournal.ts +6 -4
- package/src/unstable/http/FindMyWay/internal/queryString.ts +420 -0
- package/src/unstable/http/FindMyWay/internal/router.ts +950 -0
- package/src/unstable/http/FindMyWay.ts +65 -6
- package/src/unstable/http/HttpClientError.ts +1 -1
- package/src/unstable/http/HttpClientRequest.ts +2 -14
- package/src/unstable/http/HttpClientResponse.ts +1 -17
- package/src/unstable/http/HttpPlatform.ts +34 -6
- package/src/unstable/http/HttpServerRequest.ts +14 -6
- package/src/unstable/http/HttpServerResponse.ts +9 -7
- package/src/unstable/http/Multipart.ts +9 -2
- package/src/unstable/http/MultipartParser/HeadersParser.ts +68 -0
- package/src/unstable/http/MultipartParser/Search.ts +17 -0
- package/src/unstable/http/MultipartParser/internal/contentType.ts +103 -0
- package/src/unstable/http/MultipartParser/internal/headers.ts +615 -0
- package/src/unstable/http/MultipartParser/internal/multipart.ts +262 -0
- package/src/unstable/http/MultipartParser/internal/search.ts +167 -0
- package/src/unstable/http/MultipartParser.ts +115 -0
- package/src/unstable/http/Template.ts +6 -5
- package/src/unstable/http/index.ts +1 -1
- package/src/unstable/http/internal/httpBody.ts +15 -0
- package/src/unstable/httpapi/HttpApi.ts +6 -7
- package/src/unstable/httpapi/HttpApiBuilder.ts +119 -21
- package/src/unstable/httpapi/HttpApiClient.ts +104 -41
- package/src/unstable/httpapi/HttpApiEndpoint.ts +117 -29
- package/src/unstable/httpapi/HttpApiError.ts +33 -39
- package/src/unstable/httpapi/HttpApiMiddleware.ts +1 -1
- package/src/unstable/httpapi/HttpApiSchema.ts +353 -0
- package/src/unstable/httpapi/OpenApi.ts +70 -20
- package/src/unstable/observability/OtlpExporter.ts +4 -2
- package/src/unstable/observability/OtlpLogger.ts +3 -1
- package/src/unstable/observability/OtlpMetrics.ts +32 -18
- package/src/unstable/observability/OtlpTracer.ts +1 -1
- package/src/unstable/persistence/PersistedQueue.ts +12 -9
- package/src/unstable/persistence/Persistence.ts +27 -7
- package/src/unstable/persistence/RateLimiter.ts +54 -31
- package/src/unstable/persistence/Redis.ts +1 -1
- package/src/unstable/rpc/RpcClient.ts +38 -12
- package/src/unstable/rpc/RpcClientError.ts +2 -2
- package/src/unstable/rpc/RpcSerialization.ts +1 -1
- package/src/unstable/schema/VariantSchema.ts +36 -18
- package/src/unstable/socket/Socket.ts +24 -14
- package/src/unstable/sql/SqlClient.ts +65 -56
- package/src/unstable/sql/SqlError.ts +13 -13
- package/src/unstable/sql/SqlResolver.ts +8 -6
- package/src/unstable/sql/Statement.ts +13 -8
- package/src/unstable/workers/WorkerError.ts +5 -5
- package/src/unstable/workflow/WorkflowEngine.ts +8 -3
- package/dist/unstable/http/Multipasta/HeadersParser.d.ts +0 -14
- package/dist/unstable/http/Multipasta/HeadersParser.d.ts.map +0 -1
- package/dist/unstable/http/Multipasta/HeadersParser.js +0 -14
- package/dist/unstable/http/Multipasta/HeadersParser.js.map +0 -1
- package/dist/unstable/http/Multipasta/Node.d.ts +0 -14
- package/dist/unstable/http/Multipasta/Node.d.ts.map +0 -1
- package/dist/unstable/http/Multipasta/Node.js +0 -14
- package/dist/unstable/http/Multipasta/Node.js.map +0 -1
- package/dist/unstable/http/Multipasta/Search.d.ts +0 -14
- package/dist/unstable/http/Multipasta/Search.d.ts.map +0 -1
- package/dist/unstable/http/Multipasta/Search.js +0 -14
- package/dist/unstable/http/Multipasta/Search.js.map +0 -1
- package/dist/unstable/http/Multipasta/Web.d.ts +0 -14
- package/dist/unstable/http/Multipasta/Web.d.ts.map +0 -1
- package/dist/unstable/http/Multipasta/Web.js +0 -14
- package/dist/unstable/http/Multipasta/Web.js.map +0 -1
- package/dist/unstable/http/Multipasta.d.ts +0 -15
- package/dist/unstable/http/Multipasta.d.ts.map +0 -1
- package/dist/unstable/http/Multipasta.js +0 -15
- package/dist/unstable/http/Multipasta.js.map +0 -1
- package/src/unstable/http/Multipasta/HeadersParser.ts +0 -14
- package/src/unstable/http/Multipasta/Node.ts +0 -14
- package/src/unstable/http/Multipasta/Search.ts +0 -14
- package/src/unstable/http/Multipasta/Web.ts +0 -14
- package/src/unstable/http/Multipasta.ts +0 -15
|
@@ -12,7 +12,7 @@
|
|
|
12
12
|
*/
|
|
13
13
|
import * as Config from "../../Config.ts"
|
|
14
14
|
import * as Effect from "../../Effect.ts"
|
|
15
|
-
import { dual, identity } from "../../Function.ts"
|
|
15
|
+
import { dual, identity, type LazyArg } from "../../Function.ts"
|
|
16
16
|
import * as Option from "../../Option.ts"
|
|
17
17
|
import { type Pipeable, pipeArguments } from "../../Pipeable.ts"
|
|
18
18
|
import * as Predicate from "../../Predicate.ts"
|
|
@@ -226,7 +226,11 @@ export interface Transform<Kind extends ParamKind, in out A, out B> extends Para
|
|
|
226
226
|
readonly _tag: "Transform"
|
|
227
227
|
readonly kind: Kind
|
|
228
228
|
readonly param: Param<Kind, A>
|
|
229
|
-
readonly
|
|
229
|
+
readonly alternatives: ReadonlyArray<LazyArg<Param<Kind, unknown>>>
|
|
230
|
+
readonly f: (
|
|
231
|
+
parse: Parse<A>,
|
|
232
|
+
alternatives: ReadonlyArray<LazyArg<Parse<unknown>>>
|
|
233
|
+
) => Parse<B>
|
|
230
234
|
}
|
|
231
235
|
|
|
232
236
|
/**
|
|
@@ -1209,15 +1213,22 @@ export const map: {
|
|
|
1209
1213
|
|
|
1210
1214
|
const transform = <Kind extends ParamKind, A, B>(
|
|
1211
1215
|
self: Param<Kind, A>,
|
|
1212
|
-
f: (
|
|
1213
|
-
|
|
1214
|
-
|
|
1216
|
+
f: (
|
|
1217
|
+
parse: Parse<A>,
|
|
1218
|
+
alternatives: ReadonlyArray<LazyArg<Parse<unknown>>>
|
|
1219
|
+
) => Parse<B>,
|
|
1220
|
+
alternatives: ReadonlyArray<LazyArg<Param<Kind, unknown>>> = []
|
|
1221
|
+
): Transform<Kind, A, B> => {
|
|
1222
|
+
const alternativeParsers = alternatives.map((alternative) => () => alternative().parse)
|
|
1223
|
+
return Object.assign(Object.create(Proto), {
|
|
1215
1224
|
_tag: "Transform",
|
|
1216
1225
|
kind: self.kind,
|
|
1217
1226
|
param: self,
|
|
1227
|
+
alternatives,
|
|
1218
1228
|
f,
|
|
1219
|
-
parse: f(self.parse)
|
|
1229
|
+
parse: f(self.parse, alternativeParsers)
|
|
1220
1230
|
})
|
|
1231
|
+
}
|
|
1221
1232
|
|
|
1222
1233
|
/**
|
|
1223
1234
|
* Transforms the parsed value of an option using an effectful mapping function.
|
|
@@ -2719,7 +2730,7 @@ export const orElse: {
|
|
|
2719
2730
|
* @category combinators
|
|
2720
2731
|
* @since 4.0.0
|
|
2721
2732
|
*/
|
|
2722
|
-
<B, Kind extends ParamKind>(orElse:
|
|
2733
|
+
<B, Kind extends ParamKind>(orElse: LazyArg<Param<Kind, B>>): <A>(self: Param<Kind, A>) => Param<Kind, A | B>
|
|
2723
2734
|
/**
|
|
2724
2735
|
* Provides a fallback param to use if this param fails to parse.
|
|
2725
2736
|
*
|
|
@@ -2737,14 +2748,16 @@ export const orElse: {
|
|
|
2737
2748
|
* @category combinators
|
|
2738
2749
|
* @since 4.0.0
|
|
2739
2750
|
*/
|
|
2740
|
-
<Kind extends ParamKind, A, B>(self: Param<Kind, A>, orElse:
|
|
2751
|
+
<Kind extends ParamKind, A, B>(self: Param<Kind, A>, orElse: LazyArg<Param<Kind, B>>): Param<Kind, A | B>
|
|
2741
2752
|
} = dual(2, <Kind extends ParamKind, A, B>(
|
|
2742
2753
|
self: Param<Kind, A>,
|
|
2743
|
-
orElse:
|
|
2754
|
+
orElse: LazyArg<Param<Kind, B>>
|
|
2744
2755
|
) =>
|
|
2745
2756
|
transform(
|
|
2746
2757
|
self,
|
|
2747
|
-
(parse: Parse<A
|
|
2758
|
+
(parse: Parse<A>, alternatives): Parse<A | B> => (args: ParsedArgs) =>
|
|
2759
|
+
Effect.catch(parse(args), () => (alternatives[0]!() as Parse<B>)(args)),
|
|
2760
|
+
[orElse]
|
|
2748
2761
|
))
|
|
2749
2762
|
|
|
2750
2763
|
/**
|
|
@@ -2796,7 +2809,7 @@ export const orElseResult: {
|
|
|
2796
2809
|
* @category combinators
|
|
2797
2810
|
* @since 4.0.0
|
|
2798
2811
|
*/
|
|
2799
|
-
<Kind extends ParamKind, B>(orElse:
|
|
2812
|
+
<Kind extends ParamKind, B>(orElse: LazyArg<Param<Kind, B>>): <A>(self: Param<Kind, A>) => Param<Kind, Result.Result<A, B>>
|
|
2800
2813
|
/**
|
|
2801
2814
|
* Provides a fallback param and returns a `Result` indicating which param
|
|
2802
2815
|
* succeeded.
|
|
@@ -2821,22 +2834,23 @@ export const orElseResult: {
|
|
|
2821
2834
|
* @category combinators
|
|
2822
2835
|
* @since 4.0.0
|
|
2823
2836
|
*/
|
|
2824
|
-
<Kind extends ParamKind, A, B>(self: Param<Kind, A>, orElse:
|
|
2837
|
+
<Kind extends ParamKind, A, B>(self: Param<Kind, A>, orElse: LazyArg<Param<Kind, B>>): Param<Kind, Result.Result<A, B>>
|
|
2825
2838
|
} = dual(2, <Kind extends ParamKind, A, B>(
|
|
2826
2839
|
self: Param<Kind, A>,
|
|
2827
|
-
orElse:
|
|
2840
|
+
orElse: LazyArg<Param<Kind, B>>
|
|
2828
2841
|
) => {
|
|
2829
2842
|
return transform(
|
|
2830
2843
|
self,
|
|
2831
|
-
(parse: Parse<A
|
|
2844
|
+
(parse: Parse<A>, alternatives): Parse<Result.Result<A, B>> => (args: ParsedArgs) =>
|
|
2832
2845
|
Effect.catch(
|
|
2833
2846
|
Effect.map(parse(args), ([leftover, value]) => [leftover, Result.succeed(value)] as const),
|
|
2834
|
-
(
|
|
2847
|
+
() =>
|
|
2835
2848
|
Effect.map(
|
|
2836
|
-
|
|
2849
|
+
(alternatives[0]!() as Parse<B>)(args),
|
|
2837
2850
|
([leftover, value]) => [leftover, Result.fail(value)] as const
|
|
2838
2851
|
)
|
|
2839
|
-
)
|
|
2852
|
+
),
|
|
2853
|
+
[orElse]
|
|
2840
2854
|
)
|
|
2841
2855
|
})
|
|
2842
2856
|
|
|
@@ -3053,7 +3067,12 @@ const transformSingle = <Kind extends ParamKind, A>(
|
|
|
3053
3067
|
return matchParam(param, {
|
|
3054
3068
|
Single: (single) => f(single),
|
|
3055
3069
|
Map: (mapped) => map(transformSingle(mapped.param, f), mapped.f),
|
|
3056
|
-
Transform: (mapped) =>
|
|
3070
|
+
Transform: (mapped) =>
|
|
3071
|
+
transform(
|
|
3072
|
+
transformSingle(mapped.param, f),
|
|
3073
|
+
mapped.f,
|
|
3074
|
+
mapped.alternatives.map((alternative) => () => transformSingle(alternative(), f))
|
|
3075
|
+
),
|
|
3057
3076
|
Optional: (p) => optional(transformSingle(p.param, f)) as Param<Kind, A>,
|
|
3058
3077
|
Variadic: (p) =>
|
|
3059
3078
|
variadic(transformSingle(p.param, f), {
|
|
@@ -3075,7 +3094,10 @@ export const extractSingleParams = <Kind extends ParamKind, A>(
|
|
|
3075
3094
|
return matchParam(param, {
|
|
3076
3095
|
Single: (single) => [single as Single<Kind, unknown>],
|
|
3077
3096
|
Map: (mapped) => extractSingleParams(mapped.param),
|
|
3078
|
-
Transform: (mapped) =>
|
|
3097
|
+
Transform: (mapped) => [
|
|
3098
|
+
...extractSingleParams(mapped.param),
|
|
3099
|
+
...mapped.alternatives.flatMap((alternative) => extractSingleParams(alternative()))
|
|
3100
|
+
],
|
|
3079
3101
|
Optional: (optional) => extractSingleParams(optional.param),
|
|
3080
3102
|
Variadic: (variadic) => extractSingleParams(variadic.param)
|
|
3081
3103
|
})
|
|
@@ -10,9 +10,6 @@
|
|
|
10
10
|
*
|
|
11
11
|
* @since 4.0.0
|
|
12
12
|
*/
|
|
13
|
-
import * as Ini from "ini"
|
|
14
|
-
import * as Toml from "toml"
|
|
15
|
-
import * as Yaml from "yaml"
|
|
16
13
|
import * as Config from "../../Config.ts"
|
|
17
14
|
import * as Effect from "../../Effect.ts"
|
|
18
15
|
import * as FileSystem from "../../FileSystem.ts"
|
|
@@ -24,6 +21,9 @@ import * as Schema from "../../Schema.ts"
|
|
|
24
21
|
import type { Formatter } from "../../SchemaIssue.ts"
|
|
25
22
|
import type * as Struct from "../../Struct.ts"
|
|
26
23
|
import type { Covariant } from "../../Types.ts"
|
|
24
|
+
import * as Ini from "../encoding/Ini.ts"
|
|
25
|
+
import * as Toml from "../encoding/Toml.ts"
|
|
26
|
+
import * as Yaml from "../encoding/Yaml.ts"
|
|
27
27
|
import type { Environment } from "./Command.ts"
|
|
28
28
|
|
|
29
29
|
const TypeId = "~effect/cli/Primitive"
|
|
@@ -479,8 +479,8 @@ export type PathType = "file" | "directory" | "either"
|
|
|
479
479
|
export const path = (
|
|
480
480
|
pathType: PathType,
|
|
481
481
|
mustExist?: boolean
|
|
482
|
-
): Primitive<string> =>
|
|
483
|
-
makePrimitive(
|
|
482
|
+
): Primitive<string> => {
|
|
483
|
+
const primitive = makePrimitive(
|
|
484
484
|
"Path",
|
|
485
485
|
Effect.fnUntraced(function*(value) {
|
|
486
486
|
const fs = yield* FileSystem.FileSystem
|
|
@@ -518,6 +518,8 @@ export const path = (
|
|
|
518
518
|
return absolutePath
|
|
519
519
|
})
|
|
520
520
|
)
|
|
521
|
+
return Object.assign(primitive, { pathType })
|
|
522
|
+
}
|
|
521
523
|
|
|
522
524
|
/**
|
|
523
525
|
* Creates a primitive that wraps string input in `Redacted`.
|
|
@@ -984,3 +986,7 @@ export const getTypeName = <A>(primitive: Primitive<A>): string => {
|
|
|
984
986
|
/** @internal */
|
|
985
987
|
export const getChoiceKeys = (primitive: Primitive<unknown>): ReadonlyArray<string> | undefined =>
|
|
986
988
|
primitive._tag === "Choice" ? (primitive as any).choiceKeys : undefined
|
|
989
|
+
|
|
990
|
+
/** @internal */
|
|
991
|
+
export const getPathType = (primitive: Primitive<unknown>): PathType | undefined =>
|
|
992
|
+
primitive._tag === "Path" ? (primitive as any).pathType : undefined
|
|
@@ -693,10 +693,13 @@ export const all: <
|
|
|
693
693
|
if (arguments.length === 1) {
|
|
694
694
|
if (isPrompt(arguments[0])) {
|
|
695
695
|
return map(arguments[0], (x) => [x]) as any
|
|
696
|
-
} else if (
|
|
697
|
-
return allTupled(arguments[0]) as any
|
|
696
|
+
} else if (Predicate.isIterable(arguments[0])) {
|
|
697
|
+
return allTupled(Arr.fromIterable(arguments[0] as Iterable<Prompt<any>>)) as any
|
|
698
698
|
} else {
|
|
699
699
|
const entries = Object.entries(arguments[0] as Readonly<{ [K: string]: Prompt<any> }>)
|
|
700
|
+
if (entries.length === 0) {
|
|
701
|
+
return succeed({}) as any
|
|
702
|
+
}
|
|
700
703
|
let result = map(entries[0][1], (value) => ({ [entries[0][0]]: value }))
|
|
701
704
|
if (entries.length === 1) {
|
|
702
705
|
return result as any
|
|
@@ -1274,7 +1277,7 @@ export const multiSelect = <const A>(
|
|
|
1274
1277
|
const initialSelected = new Set<number>()
|
|
1275
1278
|
for (let i = 0; i < opts.choices.length; i++) {
|
|
1276
1279
|
const choice = opts.choices[i] as SelectChoice<A>
|
|
1277
|
-
if (choice.selected === true) {
|
|
1280
|
+
if (choice.selected === true && !choice.disabled) {
|
|
1278
1281
|
initialSelected.add(i)
|
|
1279
1282
|
}
|
|
1280
1283
|
}
|
|
@@ -2057,6 +2060,9 @@ class Day extends DatePart {
|
|
|
2057
2060
|
}
|
|
2058
2061
|
|
|
2059
2062
|
private ordinalIndicator(day: number): string {
|
|
2063
|
+
if (day >= 11 && day <= 13) {
|
|
2064
|
+
return "th"
|
|
2065
|
+
}
|
|
2060
2066
|
switch (day % 10) {
|
|
2061
2067
|
case 1:
|
|
2062
2068
|
return "st"
|
|
@@ -2115,7 +2121,7 @@ class Year extends DatePart {
|
|
|
2115
2121
|
override toString() {
|
|
2116
2122
|
const year = `${this.date.getFullYear()}`.padStart(4, "0")
|
|
2117
2123
|
return this.token.length === 2
|
|
2118
|
-
? year.
|
|
2124
|
+
? year.slice(-2)
|
|
2119
2125
|
: year
|
|
2120
2126
|
}
|
|
2121
2127
|
}
|
|
@@ -2132,7 +2138,7 @@ class Meridiem extends DatePart {
|
|
|
2132
2138
|
setValue(_value: string): void {}
|
|
2133
2139
|
|
|
2134
2140
|
override toString() {
|
|
2135
|
-
const meridiem = this.date.getHours()
|
|
2141
|
+
const meridiem = this.date.getHours() >= 12 ? "pm" : "am"
|
|
2136
2142
|
return /A/.test(this.token)
|
|
2137
2143
|
? meridiem.toUpperCase()
|
|
2138
2144
|
: meridiem;
|
|
@@ -2619,9 +2625,9 @@ const renderMultiSelectChoices = <A>(
|
|
|
2619
2625
|
renderOptions?: RenderOptions | undefined
|
|
2620
2626
|
) => {
|
|
2621
2627
|
const choices = options.choices
|
|
2622
|
-
const
|
|
2623
|
-
const selectedCount = state.selectedIndices.
|
|
2624
|
-
const allSelected = selectedCount ===
|
|
2628
|
+
const selectableCount = choices.filter((choice) => !choice.disabled).length
|
|
2629
|
+
const selectedCount = Array.from(state.selectedIndices).filter((index) => !choices[index].disabled).length
|
|
2630
|
+
const allSelected = selectedCount === selectableCount
|
|
2625
2631
|
|
|
2626
2632
|
const selectAllText = allSelected
|
|
2627
2633
|
? options?.selectNone ?? "Select None"
|
|
@@ -2657,8 +2663,9 @@ const renderMultiSelectChoices = <A>(
|
|
|
2657
2663
|
const annotatedCheckbox = isHighlighted && renderOptions?.plain !== true
|
|
2658
2664
|
? Ansi.annotate(checkbox, Ansi.cyanBright)
|
|
2659
2665
|
: checkbox
|
|
2660
|
-
const
|
|
2661
|
-
const
|
|
2666
|
+
const selectChoice = choice as SelectChoice<A>
|
|
2667
|
+
const title = renderChoiceTitle(selectChoice, isHighlighted, renderOptions)
|
|
2668
|
+
const description = renderChoiceDescription(selectChoice, isHighlighted, renderOptions)
|
|
2662
2669
|
documents.push(prefix + " " + annotatedCheckbox + " " + title + " " + description)
|
|
2663
2670
|
}
|
|
2664
2671
|
}
|
|
@@ -2707,16 +2714,20 @@ const processSpace = <A>(
|
|
|
2707
2714
|
) => {
|
|
2708
2715
|
const selectedIndices = new Set(state.selectedIndices)
|
|
2709
2716
|
if (state.index === 0) {
|
|
2710
|
-
|
|
2717
|
+
const selectableCount = options.choices.filter((choice) => !choice.disabled).length
|
|
2718
|
+
const selectedCount = Array.from(state.selectedIndices).filter((index) => !options.choices[index].disabled).length
|
|
2719
|
+
if (selectedCount === selectableCount) {
|
|
2711
2720
|
selectedIndices.clear()
|
|
2712
2721
|
} else {
|
|
2713
2722
|
for (let i = 0; i < options.choices.length; i++) {
|
|
2714
|
-
|
|
2723
|
+
if (!options.choices[i].disabled) {
|
|
2724
|
+
selectedIndices.add(i)
|
|
2725
|
+
}
|
|
2715
2726
|
}
|
|
2716
2727
|
}
|
|
2717
2728
|
} else if (state.index === 1) {
|
|
2718
2729
|
for (let i = 0; i < options.choices.length; i++) {
|
|
2719
|
-
if (state.selectedIndices.has(i)) {
|
|
2730
|
+
if (options.choices[i].disabled || state.selectedIndices.has(i)) {
|
|
2720
2731
|
selectedIndices.delete(i)
|
|
2721
2732
|
} else {
|
|
2722
2733
|
selectedIndices.add(i)
|
|
@@ -2724,7 +2735,9 @@ const processSpace = <A>(
|
|
|
2724
2735
|
}
|
|
2725
2736
|
} else {
|
|
2726
2737
|
const choiceIndex = state.index - metaOptionsCount
|
|
2727
|
-
if (
|
|
2738
|
+
if (options.choices[choiceIndex].disabled) {
|
|
2739
|
+
return Effect.succeed(Action.Beep())
|
|
2740
|
+
} else if (selectedIndices.has(choiceIndex)) {
|
|
2728
2741
|
selectedIndices.delete(choiceIndex)
|
|
2729
2742
|
} else {
|
|
2730
2743
|
selectedIndices.add(choiceIndex)
|
|
@@ -2764,7 +2777,8 @@ const handleMultiSelectProcess = <A>(options: SelectOptionsReq<A> & MultiSelectO
|
|
|
2764
2777
|
}
|
|
2765
2778
|
case "enter":
|
|
2766
2779
|
case "return": {
|
|
2767
|
-
const
|
|
2780
|
+
const selectedIndices = Array.from(state.selectedIndices).filter((index) => !options.choices[index].disabled)
|
|
2781
|
+
const selectedCount = selectedIndices.length
|
|
2768
2782
|
if (options.min !== undefined && selectedCount < options.min) {
|
|
2769
2783
|
return Effect.succeed(
|
|
2770
2784
|
Action.NextFrame({ state: { ...state, error: Option.some(`At least ${options.min} are required`) } })
|
|
@@ -2775,9 +2789,7 @@ const handleMultiSelectProcess = <A>(options: SelectOptionsReq<A> & MultiSelectO
|
|
|
2775
2789
|
Action.NextFrame({ state: { ...state, error: Option.some(`At most ${options.max} choices are allowed`) } })
|
|
2776
2790
|
)
|
|
2777
2791
|
}
|
|
2778
|
-
const selectedValues =
|
|
2779
|
-
options.choices[index].value
|
|
2780
|
-
)
|
|
2792
|
+
const selectedValues = selectedIndices.sort(EffectNumber.Order).map((index) => options.choices[index].value)
|
|
2781
2793
|
return Effect.succeed(Action.Submit({ value: selectedValues }))
|
|
2782
2794
|
}
|
|
2783
2795
|
default: {
|
|
@@ -2933,10 +2945,14 @@ const defaultFloatProcessor = (input: string, state: NumberState) => {
|
|
|
2933
2945
|
return Effect.succeed(Action.NextFrame({
|
|
2934
2946
|
state: {
|
|
2935
2947
|
...state,
|
|
2936
|
-
value: input === "."
|
|
2948
|
+
value: input === "."
|
|
2949
|
+
? `${parsed}.`
|
|
2950
|
+
: state.value.includes(".") && /^\d$/.test(input)
|
|
2951
|
+
? state.value + input
|
|
2952
|
+
: `${parsed}`,
|
|
2937
2953
|
error: Option.none()
|
|
2938
2954
|
}
|
|
2939
|
-
}))
|
|
2955
|
+
}));
|
|
2940
2956
|
}
|
|
2941
2957
|
}
|
|
2942
2958
|
|
|
@@ -79,9 +79,9 @@ export const combine = (...styles: Array<string>): Array<string> => styles
|
|
|
79
79
|
/** @internal */
|
|
80
80
|
export const cursorTo = (column: number, row?: number): string => {
|
|
81
81
|
if (row === undefined) {
|
|
82
|
-
return
|
|
82
|
+
return `${ESC}${Math.max(column + 1, 0)}G`
|
|
83
83
|
}
|
|
84
|
-
return
|
|
84
|
+
return `${ESC}${row + 1}${SEP}${Math.max(column + 1, 0)}H`
|
|
85
85
|
}
|
|
86
86
|
|
|
87
87
|
/** @internal */
|
|
@@ -98,7 +98,7 @@ export const makeCommand = <const Name extends string, Input, E, R, ContextInput
|
|
|
98
98
|
readonly description?: string | undefined
|
|
99
99
|
readonly shortDescription?: string | undefined
|
|
100
100
|
readonly alias?: string | undefined
|
|
101
|
-
readonly
|
|
101
|
+
readonly unlisted?: boolean | undefined
|
|
102
102
|
readonly examples?: ReadonlyArray<Command.Example> | undefined
|
|
103
103
|
readonly subcommands?: ReadonlyArray<SubcommandGroup> | undefined
|
|
104
104
|
readonly parse?: ((input: ParsedTokens) => Effect.Effect<Input, CliError.CliError, Environment>) | undefined
|
|
@@ -139,7 +139,8 @@ export const makeCommand = <const Name extends string, Input, E, R, ContextInput
|
|
|
139
139
|
name: single.name,
|
|
140
140
|
type: single.typeName ?? Primitive.getTypeName(single.primitiveType),
|
|
141
141
|
description: single.description,
|
|
142
|
-
required: !metadata.isOptional
|
|
142
|
+
required: !metadata.isOptional &&
|
|
143
|
+
(!metadata.isVariadic || Option.exists(metadata.variadicMin, (min) => min > 0)),
|
|
143
144
|
variadic: metadata.isVariadic
|
|
144
145
|
})
|
|
145
146
|
}
|
|
@@ -147,8 +148,8 @@ export const makeCommand = <const Name extends string, Input, E, R, ContextInput
|
|
|
147
148
|
|
|
148
149
|
let usage = commandPath.length > 0 ? commandPath.join(" ") : options.name
|
|
149
150
|
// Only render `<subcommand>` in usage when at least one visible subcommand
|
|
150
|
-
// exists; an all-
|
|
151
|
-
if (subcommands.some((group) => group.commands.some((c) => !c.
|
|
151
|
+
// exists; an all-unlisted subcommand tree should look like a leaf command.
|
|
152
|
+
if (subcommands.some((group) => group.commands.some((c) => !c.unlisted))) {
|
|
152
153
|
usage += " <subcommand>"
|
|
153
154
|
}
|
|
154
155
|
usage += " [flags]"
|
|
@@ -159,21 +160,22 @@ export const makeCommand = <const Name extends string, Input, E, R, ContextInput
|
|
|
159
160
|
|
|
160
161
|
for (const option of config.flags) {
|
|
161
162
|
const singles = Param.extractSingleParams(option)
|
|
163
|
+
const metadata = Param.getParamMetadata(option)
|
|
162
164
|
for (const single of singles) {
|
|
163
165
|
// Hidden flags still parse on the command line but are omitted from
|
|
164
166
|
// generated --help output.
|
|
165
167
|
if (single.hidden) continue
|
|
166
|
-
flags.push(toFlagDoc(single))
|
|
168
|
+
flags.push(toFlagDoc(single, metadata))
|
|
167
169
|
}
|
|
168
170
|
}
|
|
169
171
|
|
|
170
172
|
const subcommandDocs: Array<SubcommandGroupDoc> = []
|
|
171
173
|
|
|
172
174
|
for (const group of subcommands) {
|
|
173
|
-
//
|
|
175
|
+
// Unlisted subcommands still parse on the command line but are omitted
|
|
174
176
|
// from --help. Drop the whole group when nothing visible remains so we
|
|
175
177
|
// don't render an empty heading.
|
|
176
|
-
const visible = group.commands.filter((c) => !c.
|
|
178
|
+
const visible = group.commands.filter((c) => !c.unlisted)
|
|
177
179
|
if (visible.length === 0) continue
|
|
178
180
|
subcommandDocs.push({
|
|
179
181
|
group: group.group,
|
|
@@ -206,7 +208,7 @@ export const makeCommand = <const Name extends string, Input, E, R, ContextInput
|
|
|
206
208
|
annotations,
|
|
207
209
|
globalFlags,
|
|
208
210
|
subcommands,
|
|
209
|
-
|
|
211
|
+
unlisted: options.unlisted ?? false,
|
|
210
212
|
config,
|
|
211
213
|
contextConfig,
|
|
212
214
|
service,
|
|
@@ -233,14 +235,17 @@ export const makeCommand = <const Name extends string, Input, E, R, ContextInput
|
|
|
233
235
|
/**
|
|
234
236
|
* Converts a single flag param into a FlagDoc for help display.
|
|
235
237
|
*/
|
|
236
|
-
export const toFlagDoc = (
|
|
238
|
+
export const toFlagDoc = (
|
|
239
|
+
single: Param.Single<typeof Param.flagKind, unknown>,
|
|
240
|
+
metadata: ReturnType<typeof Param.getParamMetadata>
|
|
241
|
+
): FlagDoc => {
|
|
237
242
|
const formattedAliases = single.aliases.map((alias) => alias.length === 1 ? `-${alias}` : `--${alias}`)
|
|
238
243
|
return {
|
|
239
244
|
name: single.name,
|
|
240
245
|
aliases: formattedAliases,
|
|
241
246
|
type: single.typeName ?? Primitive.getTypeName(single.primitiveType),
|
|
242
247
|
description: appendChoiceKeys(single.description, Primitive.getChoiceKeys(single.primitiveType)),
|
|
243
|
-
required: single.primitiveType._tag !== "Boolean"
|
|
248
|
+
required: single.primitiveType._tag !== "Boolean" && !metadata.isOptional
|
|
244
249
|
}
|
|
245
250
|
}
|
|
246
251
|
|
|
@@ -100,7 +100,8 @@ const generateFunction = (
|
|
|
100
100
|
|
|
101
101
|
lines.push(`${funcName}()`)
|
|
102
102
|
lines.push(`{`)
|
|
103
|
-
lines.push(` local cur prev words cword`)
|
|
103
|
+
lines.push(` local cur prev words cword i`)
|
|
104
|
+
lines.push(parentPath.length === 0 ? ` local _command_index=0` : ` local _command_index="$1"`)
|
|
104
105
|
lines.push(` _init_completion || return`)
|
|
105
106
|
lines.push(``)
|
|
106
107
|
|
|
@@ -129,13 +130,23 @@ const generateFunction = (
|
|
|
129
130
|
// Subcommand dispatch
|
|
130
131
|
if (descriptor.subcommands.length > 0) {
|
|
131
132
|
lines.push(` # Subcommand dispatch`)
|
|
132
|
-
lines.push(` local
|
|
133
|
-
lines.push(` for ((i = 1; i < cword; i++)); do`)
|
|
133
|
+
lines.push(` local cmd _skip_next=0`)
|
|
134
|
+
lines.push(` for ((i = _command_index + 1; i < cword; i++)); do`)
|
|
135
|
+
lines.push(` if (( _skip_next )); then`)
|
|
136
|
+
lines.push(` _skip_next=0`)
|
|
137
|
+
lines.push(` continue`)
|
|
138
|
+
lines.push(` fi`)
|
|
134
139
|
lines.push(` case "\${words[i]}" in`)
|
|
140
|
+
for (const flag of descriptor.flags) {
|
|
141
|
+
if (flag.type._tag === "Boolean") continue
|
|
142
|
+
const forms = flagNamesForWordlist(flag)
|
|
143
|
+
lines.push(` ${forms.join("|")}) _skip_next=1 ;;`)
|
|
144
|
+
lines.push(` ${forms.map((form) => `${form}=*`).join("|")}) ;;`)
|
|
145
|
+
}
|
|
135
146
|
for (const sub of descriptor.subcommands) {
|
|
136
147
|
const subFuncName = `_${[...currentPath, sub.name].map(sanitizeFunctionName).join("_")}`
|
|
137
148
|
lines.push(` ${sub.name})`)
|
|
138
|
-
lines.push(` ${subFuncName}`)
|
|
149
|
+
lines.push(` ${subFuncName} "$i"`)
|
|
139
150
|
lines.push(` return`)
|
|
140
151
|
lines.push(` ;;`)
|
|
141
152
|
}
|
|
@@ -159,13 +170,52 @@ const generateFunction = (
|
|
|
159
170
|
}
|
|
160
171
|
|
|
161
172
|
// Positional argument completion
|
|
162
|
-
const argsWithCompletions = descriptor.arguments.
|
|
173
|
+
const argsWithCompletions = descriptor.arguments.flatMap((argument, index) => {
|
|
174
|
+
const completion = argCompletion(argument.type)
|
|
175
|
+
return completion === undefined ? [] : [{ argument, completion, index }]
|
|
176
|
+
})
|
|
163
177
|
if (argsWithCompletions.length > 0) {
|
|
164
178
|
lines.push(` # Positional argument completions`)
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
179
|
+
lines.push(` local _position=0 _skip_next=0 _end_of_options=0`)
|
|
180
|
+
lines.push(` for ((i = _command_index + 1; i < cword; i++)); do`)
|
|
181
|
+
lines.push(` if (( _skip_next )); then`)
|
|
182
|
+
lines.push(` _skip_next=0`)
|
|
183
|
+
lines.push(` continue`)
|
|
184
|
+
lines.push(` fi`)
|
|
185
|
+
lines.push(` if (( _end_of_options )); then`)
|
|
186
|
+
lines.push(` ((_position += 1))`)
|
|
187
|
+
lines.push(` continue`)
|
|
188
|
+
lines.push(` fi`)
|
|
189
|
+
lines.push(` case "\${words[i]}" in`)
|
|
190
|
+
lines.push(` --) _end_of_options=1 ;;`)
|
|
191
|
+
for (const flag of descriptor.flags) {
|
|
192
|
+
const forms = flagNamesForWordlist(flag)
|
|
193
|
+
if (flag.type._tag === "Boolean") {
|
|
194
|
+
lines.push(` ${forms.join("|")}) ;;`)
|
|
195
|
+
} else {
|
|
196
|
+
lines.push(` ${forms.join("|")}) _skip_next=1 ;;`)
|
|
197
|
+
lines.push(` ${forms.map((form) => `${form}=*`).join("|")}) ;;`)
|
|
198
|
+
}
|
|
199
|
+
}
|
|
200
|
+
lines.push(` -*) ;;`)
|
|
201
|
+
lines.push(` *) ((_position += 1)) ;;`)
|
|
202
|
+
lines.push(` esac`)
|
|
203
|
+
lines.push(` done`)
|
|
204
|
+
lines.push(` case "$_position" in`)
|
|
205
|
+
for (const { argument, completion, index } of argsWithCompletions) {
|
|
206
|
+
if (argument.variadic) continue
|
|
207
|
+
lines.push(` ${index})`)
|
|
208
|
+
lines.push(` ${completion}`)
|
|
209
|
+
lines.push(` return`)
|
|
210
|
+
lines.push(` ;;`)
|
|
211
|
+
}
|
|
212
|
+
lines.push(` esac`)
|
|
213
|
+
const variadic = argsWithCompletions.find(({ argument }) => argument.variadic)
|
|
214
|
+
if (variadic !== undefined) {
|
|
215
|
+
lines.push(` if (( _position >= ${variadic.index} )); then`)
|
|
216
|
+
lines.push(` ${variadic.completion}`)
|
|
217
|
+
lines.push(` return`)
|
|
218
|
+
lines.push(` fi`)
|
|
169
219
|
}
|
|
170
220
|
} else if (descriptor.subcommands.length > 0) {
|
|
171
221
|
const subNames = descriptor.subcommands.map((s) => s.name)
|
|
@@ -30,15 +30,12 @@ const toFlagType = (single: Param.Single<"flag", unknown>): Completions.FlagType
|
|
|
30
30
|
const keys = Primitive.getChoiceKeys(single.primitiveType)
|
|
31
31
|
return { _tag: "Choice", values: keys ?? [] }
|
|
32
32
|
}
|
|
33
|
-
case "Path":
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
: "either"
|
|
40
|
-
return { _tag: "Path", pathType }
|
|
41
|
-
}
|
|
33
|
+
case "Path":
|
|
34
|
+
return { _tag: "Path", pathType: Primitive.getPathType(single.primitiveType) ?? "either" }
|
|
35
|
+
case "FileText":
|
|
36
|
+
case "FileParse":
|
|
37
|
+
case "FileSchema":
|
|
38
|
+
return { _tag: "Path", pathType: "file" }
|
|
42
39
|
default:
|
|
43
40
|
return { _tag: "String" }
|
|
44
41
|
}
|
|
@@ -57,15 +54,12 @@ const toArgumentType = (single: Param.Single<"argument", unknown>): Completions.
|
|
|
57
54
|
const keys = Primitive.getChoiceKeys(single.primitiveType)
|
|
58
55
|
return { _tag: "Choice", values: keys ?? [] }
|
|
59
56
|
}
|
|
60
|
-
case "Path":
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
: "either"
|
|
67
|
-
return { _tag: "Path", pathType }
|
|
68
|
-
}
|
|
57
|
+
case "Path":
|
|
58
|
+
return { _tag: "Path", pathType: Primitive.getPathType(single.primitiveType) ?? "either" }
|
|
59
|
+
case "FileText":
|
|
60
|
+
case "FileParse":
|
|
61
|
+
case "FileSchema":
|
|
62
|
+
return { _tag: "Path", pathType: "file" }
|
|
69
63
|
default:
|
|
70
64
|
return { _tag: "String" }
|
|
71
65
|
}
|
|
@@ -116,9 +110,9 @@ export const fromCommand = (cmd: Command.Any): Completions.CommandDescriptor =>
|
|
|
116
110
|
const subcommands: Array<Completions.CommandDescriptor> = []
|
|
117
111
|
for (const group of cmd.subcommands) {
|
|
118
112
|
for (const subcommand of group.commands) {
|
|
119
|
-
// Omit
|
|
113
|
+
// Omit unlisted subcommands from completion scripts so tab-completion in
|
|
120
114
|
// the shell does not advertise commands that are absent from --help.
|
|
121
|
-
if (subcommand.
|
|
115
|
+
if (subcommand.unlisted) continue
|
|
122
116
|
subcommands.push(fromCommand(subcommand))
|
|
123
117
|
}
|
|
124
118
|
}
|
|
@@ -18,7 +18,7 @@ const escapeFishString = (s: string): string => s.replace(/'/g, "\\'")
|
|
|
18
18
|
* Build a Fish condition that checks the current subcommand context.
|
|
19
19
|
*
|
|
20
20
|
* For root-level completions with subcommands: `__fish_use_subcommand`
|
|
21
|
-
* For nested commands: verify the parent
|
|
21
|
+
* For nested commands: verify the full parent path is active AND none of its
|
|
22
22
|
* child subcommands have been entered yet.
|
|
23
23
|
*/
|
|
24
24
|
const subcommandCondition = (
|
|
@@ -31,14 +31,12 @@ const subcommandCondition = (
|
|
|
31
31
|
}
|
|
32
32
|
return ``
|
|
33
33
|
}
|
|
34
|
-
const
|
|
34
|
+
const parentCondition = parentPath.map((parent) => `__fish_seen_subcommand_from ${parent}`).join("; and ")
|
|
35
35
|
if (childSubcommandNames.length > 0) {
|
|
36
|
-
// Show only when parent is active but no child subcommand has been entered
|
|
37
|
-
return
|
|
38
|
-
childSubcommandNames.join(" ")
|
|
39
|
-
}`
|
|
36
|
+
// Show only when the parent path is active but no child subcommand has been entered
|
|
37
|
+
return `${parentCondition}; and not __fish_seen_subcommand_from ${childSubcommandNames.join(" ")}`
|
|
40
38
|
}
|
|
41
|
-
return
|
|
39
|
+
return parentCondition
|
|
42
40
|
}
|
|
43
41
|
|
|
44
42
|
/**
|
|
@@ -111,6 +111,7 @@ const getSharedFlagsForCommandPath = (
|
|
|
111
111
|
const ancestorImpl = toImpl(ancestor)
|
|
112
112
|
for (const flag of ancestorImpl.contextConfig.flags) {
|
|
113
113
|
const singles = Param.extractSingleParams(flag)
|
|
114
|
+
const metadata = Param.getParamMetadata(flag)
|
|
114
115
|
for (const single of singles) {
|
|
115
116
|
if (seen.has(single.name)) {
|
|
116
117
|
continue
|
|
@@ -122,7 +123,7 @@ const getSharedFlagsForCommandPath = (
|
|
|
122
123
|
continue
|
|
123
124
|
}
|
|
124
125
|
seen.add(single.name)
|
|
125
|
-
sharedFlags.push(toFlagDoc(single))
|
|
126
|
+
sharedFlags.push(toFlagDoc(single, metadata))
|
|
126
127
|
}
|
|
127
128
|
}
|
|
128
129
|
}
|
|
@@ -165,13 +166,14 @@ export const getHelpForCommandPath = <Name extends string, Input, E, R, ContextI
|
|
|
165
166
|
const globalFlagDocs: Array<FlagDoc> = []
|
|
166
167
|
for (const flag of flags) {
|
|
167
168
|
const singles = Param.extractSingleParams(flag.flag)
|
|
169
|
+
const metadata = Param.getParamMetadata(flag.flag)
|
|
168
170
|
for (const single of singles) {
|
|
169
171
|
// Same rule as command-local flags: hidden globals are still parsed
|
|
170
172
|
// and still trigger their handlers, they just don't appear under
|
|
171
173
|
// "GLOBAL FLAGS" in --help.
|
|
172
174
|
if (single.hidden) continue
|
|
173
175
|
globalFlagDocs.push({
|
|
174
|
-
...toFlagDoc(single),
|
|
176
|
+
...toFlagDoc(single, metadata),
|
|
175
177
|
required: false
|
|
176
178
|
})
|
|
177
179
|
}
|
|
@@ -826,12 +826,12 @@ const resolveFirstValue = (
|
|
|
826
826
|
// Not a subcommand. Check if this looks like a typo.
|
|
827
827
|
const expectsArgs = toImpl(command).config.arguments.length > 0
|
|
828
828
|
if (!expectsArgs && subIndex.size > 0) {
|
|
829
|
-
// Exclude
|
|
830
|
-
// that was intentionally kept out of --help.
|
|
829
|
+
// Exclude unlisted subcommands so a typo cannot reveal a subcommand name
|
|
830
|
+
// that was intentionally kept out of --help. Unlisted commands still
|
|
831
831
|
// resolve via subIndex when invoked by exact name.
|
|
832
832
|
const visibleKeys: Array<string> = []
|
|
833
833
|
for (const [key, sub] of subIndex) {
|
|
834
|
-
if (!sub.
|
|
834
|
+
if (!sub.unlisted) visibleKeys.push(key)
|
|
835
835
|
}
|
|
836
836
|
const suggestions = suggest(value, visibleKeys)
|
|
837
837
|
state.errors.push(
|