@kjanat/dreamcli 3.0.0-rc.2 → 3.0.0-rc.20
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/CHANGELOG.md +374 -1
- package/README.md +3 -3
- package/dist/core/cli/dispatch.d.mts +6 -5
- package/dist/core/cli/dispatch.mjs +7 -16
- package/dist/core/cli/help-links.d.mts +0 -1
- package/dist/core/cli/index.d.mts +213 -16
- package/dist/core/cli/index.mjs +174 -43
- package/dist/core/cli/planner.d.mts +5 -1
- package/dist/core/cli/planner.mjs +19 -13
- package/dist/core/cli/plugin.d.mts +1 -1
- package/dist/core/cli/propagate.d.mts +1 -1
- package/dist/core/cli/root-help.d.mts +2 -1
- package/dist/core/cli/root-help.mjs +45 -22
- package/dist/core/cli/root-surface.d.mts +12 -1
- package/dist/core/cli/root-surface.mjs +2 -1
- package/dist/core/cli/runtime-preflight.d.mts +18 -2
- package/dist/core/cli/runtime-preflight.mjs +10 -7
- package/dist/core/completion/index.d.mts +0 -1
- package/dist/core/completion/index.mjs +1 -1
- package/dist/core/completion/shells/bash.d.mts +0 -1
- package/dist/core/completion/shells/bash.mjs +8 -4
- package/dist/core/completion/shells/fish.d.mts +0 -1
- package/dist/core/completion/shells/fish.mjs +6 -3
- package/dist/core/completion/shells/powershell.d.mts +0 -1
- package/dist/core/completion/shells/powershell.mjs +10 -5
- package/dist/core/completion/shells/shared.d.mts +13 -2
- package/dist/core/completion/shells/shared.mjs +25 -2
- package/dist/core/completion/shells/zsh.d.mts +0 -1
- package/dist/core/completion/shells/zsh.mjs +11 -4
- package/dist/core/config/index.d.mts +44 -14
- package/dist/core/config/index.mjs +57 -18
- package/dist/core/config/package-json.d.mts +28 -4
- package/dist/core/config/package-json.mjs +20 -19
- package/dist/core/errors/index.d.mts +3 -3
- package/dist/core/execution/index.d.mts +0 -1
- package/dist/core/execution/index.mjs +20 -4
- package/dist/core/help/ansi.d.mts +11 -5
- package/dist/core/help/ansi.mjs +15 -16
- package/dist/core/help/index.d.mts +44 -3
- package/dist/core/help/index.mjs +130 -68
- package/dist/core/help/theme.d.mts +68 -0
- package/dist/core/help/theme.mjs +46 -0
- package/dist/core/json-schema/index.d.mts +21 -9
- package/dist/core/json-schema/index.mjs +316 -87
- package/dist/core/json-schema/meta-descriptions.generated.d.mts +55 -38
- package/dist/core/json-schema/meta-descriptions.generated.mjs +14 -5
- package/dist/core/output/activity.d.mts +0 -1
- package/dist/core/output/contracts.d.mts +5 -6
- package/dist/core/output/contracts.mjs +2 -2
- package/dist/core/output/index.d.mts +38 -2
- package/dist/core/output/index.mjs +37 -2
- package/dist/core/output/renderers.d.mts +0 -1
- package/dist/core/parse/index.d.mts +40 -7
- package/dist/core/parse/index.mjs +212 -40
- package/dist/core/prompt/index.d.mts +1 -0
- package/dist/core/resolve/args.d.mts +1 -1
- package/dist/core/resolve/coerce.d.mts +1 -1
- package/dist/core/resolve/coerce.mjs +71 -14
- package/dist/core/resolve/contracts.d.mts +14 -4
- package/dist/core/resolve/errors.d.mts +0 -1
- package/dist/core/resolve/flags.d.mts +9 -2
- package/dist/core/resolve/flags.mjs +78 -6
- package/dist/core/resolve/index.d.mts +2 -2
- package/dist/core/resolve/index.mjs +6 -1
- package/dist/core/resolve/property.d.mts +4 -1
- package/dist/core/resolve/property.mjs +11 -3
- package/dist/core/resolve/standard.d.mts +24 -0
- package/dist/core/resolve/standard.mjs +114 -0
- package/dist/core/schema/activity.d.mts +31 -11
- package/dist/core/schema/arg.d.mts +38 -4
- package/dist/core/schema/arg.mjs +5 -2
- package/dist/core/schema/command.d.mts +57 -13
- package/dist/core/schema/command.mjs +41 -17
- package/dist/core/schema/flag.d.mts +553 -19
- package/dist/core/schema/flag.mjs +261 -5
- package/dist/core/schema/index.d.mts +6 -3
- package/dist/core/schema/middleware.d.mts +4 -3
- package/dist/core/schema/prompt.d.mts +6 -3
- package/dist/core/schema/run.d.mts +27 -1
- package/dist/core/schema/standard.d.mts +100 -0
- package/dist/core/schema/standard.mjs +15 -0
- package/dist/core/schema/string-constraints.d.mts +97 -0
- package/dist/core/schema/string-constraints.mjs +69 -0
- package/dist/core/schema/value-parsers.d.mts +78 -0
- package/dist/core/schema/value-parsers.mjs +142 -0
- package/dist/core/testkit/index.d.mts +0 -31
- package/dist/core/testkit/index.mjs +1 -1
- package/dist/index.d.mts +12 -7
- package/dist/index.mjs +9 -9
- package/dist/runtime/adapter.d.mts +71 -2
- package/dist/runtime/adapter.mjs +11 -1
- package/dist/runtime/auto.d.mts +2 -3
- package/dist/runtime/auto.mjs +4 -5
- package/dist/runtime/deno.d.mts +28 -5
- package/dist/runtime/deno.mjs +49 -1
- package/dist/runtime/index.d.mts +3 -4
- package/dist/runtime/node.d.mts +8 -2
- package/dist/runtime/node.mjs +60 -1
- package/dist/runtime.d.mts +4 -4
- package/dist/runtime.mjs +2 -3
- package/dist/testkit.d.mts +1 -0
- package/dist/version.d.mts +7 -3
- package/dist/version.mjs +2 -2
- package/dreamcli.schema.json +118 -7
- package/examples/gh/node_modules/typescript/LICENSE +55 -0
- package/examples/gh/node_modules/typescript/NOTICE.txt +436 -0
- package/examples/gh/node_modules/typescript/README.md +49 -0
- package/examples/gh/node_modules/typescript/bin/tsc +2 -0
- package/examples/gh/node_modules/typescript/dist/api/async/api.d.ts +529 -0
- package/examples/gh/node_modules/typescript/dist/api/async/api.d.ts.map +1 -0
- package/examples/gh/node_modules/typescript/dist/api/async/api.js +1657 -0
- package/examples/gh/node_modules/typescript/dist/api/async/api.js.map +1 -0
- package/examples/gh/node_modules/typescript/dist/api/async/client.d.ts +39 -0
- package/examples/gh/node_modules/typescript/dist/api/async/client.d.ts.map +1 -0
- package/examples/gh/node_modules/typescript/dist/api/async/client.js +211 -0
- package/examples/gh/node_modules/typescript/dist/api/async/client.js.map +1 -0
- package/examples/gh/node_modules/typescript/dist/api/async/types.d.ts +310 -0
- package/examples/gh/node_modules/typescript/dist/api/async/types.d.ts.map +1 -0
- package/examples/gh/node_modules/typescript/dist/api/async/types.js +2 -0
- package/examples/gh/node_modules/typescript/dist/api/async/types.js.map +1 -0
- package/examples/gh/node_modules/typescript/dist/api/compilerOptions.d.ts +109 -0
- package/examples/gh/node_modules/typescript/dist/api/compilerOptions.d.ts.map +1 -0
- package/examples/gh/node_modules/typescript/dist/api/compilerOptions.js +2 -0
- package/examples/gh/node_modules/typescript/dist/api/compilerOptions.js.map +1 -0
- package/examples/gh/node_modules/typescript/dist/api/fs.d.ts +23 -0
- package/examples/gh/node_modules/typescript/dist/api/fs.d.ts.map +1 -0
- package/examples/gh/node_modules/typescript/dist/api/fs.js +109 -0
- package/examples/gh/node_modules/typescript/dist/api/fs.js.map +1 -0
- package/examples/gh/node_modules/typescript/dist/api/node/encoder.d.ts +15 -0
- package/examples/gh/node_modules/typescript/dist/api/node/encoder.d.ts.map +1 -0
- package/examples/gh/node_modules/typescript/dist/api/node/encoder.generated.d.ts +5 -0
- package/examples/gh/node_modules/typescript/dist/api/node/encoder.generated.d.ts.map +1 -0
- package/examples/gh/node_modules/typescript/dist/api/node/encoder.generated.js +74 -0
- package/examples/gh/node_modules/typescript/dist/api/node/encoder.generated.js.map +1 -0
- package/examples/gh/node_modules/typescript/dist/api/node/encoder.js +287 -0
- package/examples/gh/node_modules/typescript/dist/api/node/encoder.js.map +1 -0
- package/examples/gh/node_modules/typescript/dist/api/node/msgpack.d.ts +32 -0
- package/examples/gh/node_modules/typescript/dist/api/node/msgpack.d.ts.map +1 -0
- package/examples/gh/node_modules/typescript/dist/api/node/msgpack.js +213 -0
- package/examples/gh/node_modules/typescript/dist/api/node/msgpack.js.map +1 -0
- package/examples/gh/node_modules/typescript/dist/api/node/node.d.ts +76 -0
- package/examples/gh/node_modules/typescript/dist/api/node/node.d.ts.map +1 -0
- package/examples/gh/node_modules/typescript/dist/api/node/node.generated.d.ts +182 -0
- package/examples/gh/node_modules/typescript/dist/api/node/node.generated.d.ts.map +1 -0
- package/examples/gh/node_modules/typescript/dist/api/node/node.generated.js +835 -0
- package/examples/gh/node_modules/typescript/dist/api/node/node.generated.js.map +1 -0
- package/examples/gh/node_modules/typescript/dist/api/node/node.infrastructure.d.ts +62 -0
- package/examples/gh/node_modules/typescript/dist/api/node/node.infrastructure.d.ts.map +1 -0
- package/examples/gh/node_modules/typescript/dist/api/node/node.infrastructure.js +122 -0
- package/examples/gh/node_modules/typescript/dist/api/node/node.infrastructure.js.map +1 -0
- package/examples/gh/node_modules/typescript/dist/api/node/node.js +298 -0
- package/examples/gh/node_modules/typescript/dist/api/node/node.js.map +1 -0
- package/examples/gh/node_modules/typescript/dist/api/node/protocol.d.ts +29 -0
- package/examples/gh/node_modules/typescript/dist/api/node/protocol.d.ts.map +1 -0
- package/examples/gh/node_modules/typescript/dist/api/node/protocol.generated.d.ts +4 -0
- package/examples/gh/node_modules/typescript/dist/api/node/protocol.generated.d.ts.map +1 -0
- package/examples/gh/node_modules/typescript/dist/api/node/protocol.generated.js +241 -0
- package/examples/gh/node_modules/typescript/dist/api/node/protocol.generated.js.map +1 -0
- package/examples/gh/node_modules/typescript/dist/api/node/protocol.js +30 -0
- package/examples/gh/node_modules/typescript/dist/api/node/protocol.js.map +1 -0
- package/examples/gh/node_modules/typescript/dist/api/node/wtf8.d.ts +6 -0
- package/examples/gh/node_modules/typescript/dist/api/node/wtf8.d.ts.map +1 -0
- package/examples/gh/node_modules/typescript/dist/api/node/wtf8.js +61 -0
- package/examples/gh/node_modules/typescript/dist/api/node/wtf8.js.map +1 -0
- package/examples/gh/node_modules/typescript/dist/api/options.d.ts +32 -0
- package/examples/gh/node_modules/typescript/dist/api/options.d.ts.map +1 -0
- package/examples/gh/node_modules/typescript/dist/api/options.js +11 -0
- package/examples/gh/node_modules/typescript/dist/api/options.js.map +1 -0
- package/examples/gh/node_modules/typescript/dist/api/path.d.ts +110 -0
- package/examples/gh/node_modules/typescript/dist/api/path.d.ts.map +1 -0
- package/examples/gh/node_modules/typescript/dist/api/path.js +508 -0
- package/examples/gh/node_modules/typescript/dist/api/path.js.map +1 -0
- package/examples/gh/node_modules/typescript/dist/api/proto.d.ts +239 -0
- package/examples/gh/node_modules/typescript/dist/api/proto.d.ts.map +1 -0
- package/examples/gh/node_modules/typescript/dist/api/proto.js +37 -0
- package/examples/gh/node_modules/typescript/dist/api/proto.js.map +1 -0
- package/examples/gh/node_modules/typescript/dist/api/sourceFileCache.d.ts +79 -0
- package/examples/gh/node_modules/typescript/dist/api/sourceFileCache.d.ts.map +1 -0
- package/examples/gh/node_modules/typescript/dist/api/sourceFileCache.js +169 -0
- package/examples/gh/node_modules/typescript/dist/api/sourceFileCache.js.map +1 -0
- package/examples/gh/node_modules/typescript/dist/api/sync/api.d.ts +529 -0
- package/examples/gh/node_modules/typescript/dist/api/sync/api.d.ts.map +1 -0
- package/examples/gh/node_modules/typescript/dist/api/sync/api.js +1665 -0
- package/examples/gh/node_modules/typescript/dist/api/sync/api.js.map +1 -0
- package/examples/gh/node_modules/typescript/dist/api/sync/client.d.ts +30 -0
- package/examples/gh/node_modules/typescript/dist/api/sync/client.d.ts.map +1 -0
- package/examples/gh/node_modules/typescript/dist/api/sync/client.js +124 -0
- package/examples/gh/node_modules/typescript/dist/api/sync/client.js.map +1 -0
- package/examples/gh/node_modules/typescript/dist/api/sync/types.d.ts +310 -0
- package/examples/gh/node_modules/typescript/dist/api/sync/types.d.ts.map +1 -0
- package/examples/gh/node_modules/typescript/dist/api/sync/types.js +2 -0
- package/examples/gh/node_modules/typescript/dist/api/sync/types.js.map +1 -0
- package/examples/gh/node_modules/typescript/dist/api/syncChannel.d.ts +114 -0
- package/examples/gh/node_modules/typescript/dist/api/syncChannel.d.ts.map +1 -0
- package/examples/gh/node_modules/typescript/dist/api/syncChannel.js +508 -0
- package/examples/gh/node_modules/typescript/dist/api/syncChannel.js.map +1 -0
- package/examples/gh/node_modules/typescript/dist/api/timing.d.ts +175 -0
- package/examples/gh/node_modules/typescript/dist/api/timing.d.ts.map +1 -0
- package/examples/gh/node_modules/typescript/dist/api/timing.js +149 -0
- package/examples/gh/node_modules/typescript/dist/api/timing.js.map +1 -0
- package/examples/gh/node_modules/typescript/dist/ast/ast.d.ts +100 -0
- package/examples/gh/node_modules/typescript/dist/ast/ast.d.ts.map +1 -0
- package/examples/gh/node_modules/typescript/dist/ast/ast.generated.d.ts +1161 -0
- package/examples/gh/node_modules/typescript/dist/ast/ast.generated.d.ts.map +1 -0
- package/examples/gh/node_modules/typescript/dist/ast/ast.generated.js +4 -0
- package/examples/gh/node_modules/typescript/dist/ast/ast.generated.js.map +1 -0
- package/examples/gh/node_modules/typescript/dist/ast/ast.js +7 -0
- package/examples/gh/node_modules/typescript/dist/ast/ast.js.map +1 -0
- package/examples/gh/node_modules/typescript/dist/ast/astnav.d.ts +19 -0
- package/examples/gh/node_modules/typescript/dist/ast/astnav.d.ts.map +1 -0
- package/examples/gh/node_modules/typescript/dist/ast/astnav.js +596 -0
- package/examples/gh/node_modules/typescript/dist/ast/astnav.js.map +1 -0
- package/examples/gh/node_modules/typescript/dist/ast/clone.d.ts +16 -0
- package/examples/gh/node_modules/typescript/dist/ast/clone.d.ts.map +1 -0
- package/examples/gh/node_modules/typescript/dist/ast/clone.js +104 -0
- package/examples/gh/node_modules/typescript/dist/ast/clone.js.map +1 -0
- package/examples/gh/node_modules/typescript/dist/ast/factory.generated.d.ts +520 -0
- package/examples/gh/node_modules/typescript/dist/ast/factory.generated.d.ts.map +1 -0
- package/examples/gh/node_modules/typescript/dist/ast/factory.generated.js +3057 -0
- package/examples/gh/node_modules/typescript/dist/ast/factory.generated.js.map +1 -0
- package/examples/gh/node_modules/typescript/dist/ast/index.d.ts +20 -0
- package/examples/gh/node_modules/typescript/dist/ast/index.d.ts.map +1 -0
- package/examples/gh/node_modules/typescript/dist/ast/index.js +20 -0
- package/examples/gh/node_modules/typescript/dist/ast/index.js.map +1 -0
- package/examples/gh/node_modules/typescript/dist/ast/is.d.ts +35 -0
- package/examples/gh/node_modules/typescript/dist/ast/is.d.ts.map +1 -0
- package/examples/gh/node_modules/typescript/dist/ast/is.generated.d.ts +329 -0
- package/examples/gh/node_modules/typescript/dist/ast/is.generated.d.ts.map +1 -0
- package/examples/gh/node_modules/typescript/dist/ast/is.generated.js +1103 -0
- package/examples/gh/node_modules/typescript/dist/ast/is.generated.js.map +1 -0
- package/examples/gh/node_modules/typescript/dist/ast/is.js +233 -0
- package/examples/gh/node_modules/typescript/dist/ast/is.js.map +1 -0
- package/examples/gh/node_modules/typescript/dist/ast/jsdoc.d.ts +11 -0
- package/examples/gh/node_modules/typescript/dist/ast/jsdoc.d.ts.map +1 -0
- package/examples/gh/node_modules/typescript/dist/ast/jsdoc.js +202 -0
- package/examples/gh/node_modules/typescript/dist/ast/jsdoc.js.map +1 -0
- package/examples/gh/node_modules/typescript/dist/ast/scanner.d.ts +97 -0
- package/examples/gh/node_modules/typescript/dist/ast/scanner.d.ts.map +1 -0
- package/examples/gh/node_modules/typescript/dist/ast/scanner.js +2230 -0
- package/examples/gh/node_modules/typescript/dist/ast/scanner.js.map +1 -0
- package/examples/gh/node_modules/typescript/dist/ast/utils.d.ts +17 -0
- package/examples/gh/node_modules/typescript/dist/ast/utils.d.ts.map +1 -0
- package/examples/gh/node_modules/typescript/dist/ast/utils.js +67 -0
- package/examples/gh/node_modules/typescript/dist/ast/utils.js.map +1 -0
- package/examples/gh/node_modules/typescript/dist/ast/visitor.d.ts +14 -0
- package/examples/gh/node_modules/typescript/dist/ast/visitor.d.ts.map +1 -0
- package/examples/gh/node_modules/typescript/dist/ast/visitor.generated.d.ts +50 -0
- package/examples/gh/node_modules/typescript/dist/ast/visitor.generated.d.ts.map +1 -0
- package/examples/gh/node_modules/typescript/dist/ast/visitor.generated.js +978 -0
- package/examples/gh/node_modules/typescript/dist/ast/visitor.generated.js.map +1 -0
- package/examples/gh/node_modules/typescript/dist/ast/visitor.js +47 -0
- package/examples/gh/node_modules/typescript/dist/ast/visitor.js.map +1 -0
- package/examples/gh/node_modules/typescript/dist/enums/characterCodes.d.ts +2 -0
- package/examples/gh/node_modules/typescript/dist/enums/characterCodes.d.ts.map +1 -0
- package/examples/gh/node_modules/typescript/dist/enums/characterCodes.enum.d.ts +129 -0
- package/examples/gh/node_modules/typescript/dist/enums/characterCodes.enum.d.ts.map +1 -0
- package/examples/gh/node_modules/typescript/dist/enums/characterCodes.enum.js +132 -0
- package/examples/gh/node_modules/typescript/dist/enums/characterCodes.enum.js.map +1 -0
- package/examples/gh/node_modules/typescript/dist/enums/characterCodes.js +130 -0
- package/examples/gh/node_modules/typescript/dist/enums/characterCodes.js.map +1 -0
- package/examples/gh/node_modules/typescript/dist/enums/commentDirectiveType.d.ts +2 -0
- package/examples/gh/node_modules/typescript/dist/enums/commentDirectiveType.d.ts.map +1 -0
- package/examples/gh/node_modules/typescript/dist/enums/commentDirectiveType.enum.d.ts +5 -0
- package/examples/gh/node_modules/typescript/dist/enums/commentDirectiveType.enum.d.ts.map +1 -0
- package/examples/gh/node_modules/typescript/dist/enums/commentDirectiveType.enum.js +6 -0
- package/examples/gh/node_modules/typescript/dist/enums/commentDirectiveType.enum.js.map +1 -0
- package/examples/gh/node_modules/typescript/dist/enums/commentDirectiveType.js +6 -0
- package/examples/gh/node_modules/typescript/dist/enums/commentDirectiveType.js.map +1 -0
- package/examples/gh/node_modules/typescript/dist/enums/completionItemKind.d.ts +2 -0
- package/examples/gh/node_modules/typescript/dist/enums/completionItemKind.d.ts.map +1 -0
- package/examples/gh/node_modules/typescript/dist/enums/completionItemKind.enum.d.ts +28 -0
- package/examples/gh/node_modules/typescript/dist/enums/completionItemKind.enum.d.ts.map +1 -0
- package/examples/gh/node_modules/typescript/dist/enums/completionItemKind.enum.js +30 -0
- package/examples/gh/node_modules/typescript/dist/enums/completionItemKind.enum.js.map +1 -0
- package/examples/gh/node_modules/typescript/dist/enums/completionItemKind.js +30 -0
- package/examples/gh/node_modules/typescript/dist/enums/completionItemKind.js.map +1 -0
- package/examples/gh/node_modules/typescript/dist/enums/diagnosticCategory.d.ts +2 -0
- package/examples/gh/node_modules/typescript/dist/enums/diagnosticCategory.d.ts.map +1 -0
- package/examples/gh/node_modules/typescript/dist/enums/diagnosticCategory.enum.d.ts +7 -0
- package/examples/gh/node_modules/typescript/dist/enums/diagnosticCategory.enum.d.ts.map +1 -0
- package/examples/gh/node_modules/typescript/dist/enums/diagnosticCategory.enum.js +9 -0
- package/examples/gh/node_modules/typescript/dist/enums/diagnosticCategory.enum.js.map +1 -0
- package/examples/gh/node_modules/typescript/dist/enums/diagnosticCategory.js +9 -0
- package/examples/gh/node_modules/typescript/dist/enums/diagnosticCategory.js.map +1 -0
- package/examples/gh/node_modules/typescript/dist/enums/elementFlags.d.ts +2 -0
- package/examples/gh/node_modules/typescript/dist/enums/elementFlags.d.ts.map +1 -0
- package/examples/gh/node_modules/typescript/dist/enums/elementFlags.enum.d.ts +12 -0
- package/examples/gh/node_modules/typescript/dist/enums/elementFlags.enum.d.ts.map +1 -0
- package/examples/gh/node_modules/typescript/dist/enums/elementFlags.enum.js +14 -0
- package/examples/gh/node_modules/typescript/dist/enums/elementFlags.enum.js.map +1 -0
- package/examples/gh/node_modules/typescript/dist/enums/elementFlags.js +14 -0
- package/examples/gh/node_modules/typescript/dist/enums/elementFlags.js.map +1 -0
- package/examples/gh/node_modules/typescript/dist/enums/internalSymbolName.d.ts +2 -0
- package/examples/gh/node_modules/typescript/dist/enums/internalSymbolName.d.ts.map +1 -0
- package/examples/gh/node_modules/typescript/dist/enums/internalSymbolName.enum.d.ts +23 -0
- package/examples/gh/node_modules/typescript/dist/enums/internalSymbolName.enum.d.ts.map +1 -0
- package/examples/gh/node_modules/typescript/dist/enums/internalSymbolName.enum.js +25 -0
- package/examples/gh/node_modules/typescript/dist/enums/internalSymbolName.enum.js.map +1 -0
- package/examples/gh/node_modules/typescript/dist/enums/internalSymbolName.js +25 -0
- package/examples/gh/node_modules/typescript/dist/enums/internalSymbolName.js.map +1 -0
- package/examples/gh/node_modules/typescript/dist/enums/jsxEmit.d.ts +2 -0
- package/examples/gh/node_modules/typescript/dist/enums/jsxEmit.d.ts.map +1 -0
- package/examples/gh/node_modules/typescript/dist/enums/jsxEmit.enum.d.ts +9 -0
- package/examples/gh/node_modules/typescript/dist/enums/jsxEmit.enum.d.ts.map +1 -0
- package/examples/gh/node_modules/typescript/dist/enums/jsxEmit.enum.js +11 -0
- package/examples/gh/node_modules/typescript/dist/enums/jsxEmit.enum.js.map +1 -0
- package/examples/gh/node_modules/typescript/dist/enums/jsxEmit.js +11 -0
- package/examples/gh/node_modules/typescript/dist/enums/jsxEmit.js.map +1 -0
- package/examples/gh/node_modules/typescript/dist/enums/languageVariant.d.ts +2 -0
- package/examples/gh/node_modules/typescript/dist/enums/languageVariant.d.ts.map +1 -0
- package/examples/gh/node_modules/typescript/dist/enums/languageVariant.enum.d.ts +5 -0
- package/examples/gh/node_modules/typescript/dist/enums/languageVariant.enum.d.ts.map +1 -0
- package/examples/gh/node_modules/typescript/dist/enums/languageVariant.enum.js +6 -0
- package/examples/gh/node_modules/typescript/dist/enums/languageVariant.enum.js.map +1 -0
- package/examples/gh/node_modules/typescript/dist/enums/languageVariant.js +6 -0
- package/examples/gh/node_modules/typescript/dist/enums/languageVariant.js.map +1 -0
- package/examples/gh/node_modules/typescript/dist/enums/modifierFlags.d.ts +2 -0
- package/examples/gh/node_modules/typescript/dist/enums/modifierFlags.d.ts.map +1 -0
- package/examples/gh/node_modules/typescript/dist/enums/modifierFlags.enum.d.ts +42 -0
- package/examples/gh/node_modules/typescript/dist/enums/modifierFlags.enum.d.ts.map +1 -0
- package/examples/gh/node_modules/typescript/dist/enums/modifierFlags.enum.js +44 -0
- package/examples/gh/node_modules/typescript/dist/enums/modifierFlags.enum.js.map +1 -0
- package/examples/gh/node_modules/typescript/dist/enums/modifierFlags.js +44 -0
- package/examples/gh/node_modules/typescript/dist/enums/modifierFlags.js.map +1 -0
- package/examples/gh/node_modules/typescript/dist/enums/moduleDetectionKind.d.ts +2 -0
- package/examples/gh/node_modules/typescript/dist/enums/moduleDetectionKind.d.ts.map +1 -0
- package/examples/gh/node_modules/typescript/dist/enums/moduleDetectionKind.enum.d.ts +7 -0
- package/examples/gh/node_modules/typescript/dist/enums/moduleDetectionKind.enum.d.ts.map +1 -0
- package/examples/gh/node_modules/typescript/dist/enums/moduleDetectionKind.enum.js +9 -0
- package/examples/gh/node_modules/typescript/dist/enums/moduleDetectionKind.enum.js.map +1 -0
- package/examples/gh/node_modules/typescript/dist/enums/moduleDetectionKind.js +9 -0
- package/examples/gh/node_modules/typescript/dist/enums/moduleDetectionKind.js.map +1 -0
- package/examples/gh/node_modules/typescript/dist/enums/moduleKind.d.ts +2 -0
- package/examples/gh/node_modules/typescript/dist/enums/moduleKind.d.ts.map +1 -0
- package/examples/gh/node_modules/typescript/dist/enums/moduleKind.enum.d.ts +17 -0
- package/examples/gh/node_modules/typescript/dist/enums/moduleKind.enum.d.ts.map +1 -0
- package/examples/gh/node_modules/typescript/dist/enums/moduleKind.enum.js +19 -0
- package/examples/gh/node_modules/typescript/dist/enums/moduleKind.enum.js.map +1 -0
- package/examples/gh/node_modules/typescript/dist/enums/moduleKind.js +19 -0
- package/examples/gh/node_modules/typescript/dist/enums/moduleKind.js.map +1 -0
- package/examples/gh/node_modules/typescript/dist/enums/moduleResolutionKind.d.ts +2 -0
- package/examples/gh/node_modules/typescript/dist/enums/moduleResolutionKind.d.ts.map +1 -0
- package/examples/gh/node_modules/typescript/dist/enums/moduleResolutionKind.enum.d.ts +9 -0
- package/examples/gh/node_modules/typescript/dist/enums/moduleResolutionKind.enum.d.ts.map +1 -0
- package/examples/gh/node_modules/typescript/dist/enums/moduleResolutionKind.enum.js +11 -0
- package/examples/gh/node_modules/typescript/dist/enums/moduleResolutionKind.enum.js.map +1 -0
- package/examples/gh/node_modules/typescript/dist/enums/moduleResolutionKind.js +11 -0
- package/examples/gh/node_modules/typescript/dist/enums/moduleResolutionKind.js.map +1 -0
- package/examples/gh/node_modules/typescript/dist/enums/newLineKind.d.ts +2 -0
- package/examples/gh/node_modules/typescript/dist/enums/newLineKind.d.ts.map +1 -0
- package/examples/gh/node_modules/typescript/dist/enums/newLineKind.enum.d.ts +6 -0
- package/examples/gh/node_modules/typescript/dist/enums/newLineKind.enum.d.ts.map +1 -0
- package/examples/gh/node_modules/typescript/dist/enums/newLineKind.enum.js +8 -0
- package/examples/gh/node_modules/typescript/dist/enums/newLineKind.enum.js.map +1 -0
- package/examples/gh/node_modules/typescript/dist/enums/newLineKind.js +8 -0
- package/examples/gh/node_modules/typescript/dist/enums/newLineKind.js.map +1 -0
- package/examples/gh/node_modules/typescript/dist/enums/nodeBuilderFlags.d.ts +2 -0
- package/examples/gh/node_modules/typescript/dist/enums/nodeBuilderFlags.d.ts.map +1 -0
- package/examples/gh/node_modules/typescript/dist/enums/nodeBuilderFlags.enum.d.ts +36 -0
- package/examples/gh/node_modules/typescript/dist/enums/nodeBuilderFlags.enum.d.ts.map +1 -0
- package/examples/gh/node_modules/typescript/dist/enums/nodeBuilderFlags.enum.js +38 -0
- package/examples/gh/node_modules/typescript/dist/enums/nodeBuilderFlags.enum.js.map +1 -0
- package/examples/gh/node_modules/typescript/dist/enums/nodeBuilderFlags.js +38 -0
- package/examples/gh/node_modules/typescript/dist/enums/nodeBuilderFlags.js.map +1 -0
- package/examples/gh/node_modules/typescript/dist/enums/nodeFlags.d.ts +2 -0
- package/examples/gh/node_modules/typescript/dist/enums/nodeFlags.d.ts.map +1 -0
- package/examples/gh/node_modules/typescript/dist/enums/nodeFlags.enum.d.ts +44 -0
- package/examples/gh/node_modules/typescript/dist/enums/nodeFlags.enum.d.ts.map +1 -0
- package/examples/gh/node_modules/typescript/dist/enums/nodeFlags.enum.js +46 -0
- package/examples/gh/node_modules/typescript/dist/enums/nodeFlags.enum.js.map +1 -0
- package/examples/gh/node_modules/typescript/dist/enums/nodeFlags.js +46 -0
- package/examples/gh/node_modules/typescript/dist/enums/nodeFlags.js.map +1 -0
- package/examples/gh/node_modules/typescript/dist/enums/objectFlags.d.ts +2 -0
- package/examples/gh/node_modules/typescript/dist/enums/objectFlags.d.ts.map +1 -0
- package/examples/gh/node_modules/typescript/dist/enums/objectFlags.enum.d.ts +50 -0
- package/examples/gh/node_modules/typescript/dist/enums/objectFlags.enum.d.ts.map +1 -0
- package/examples/gh/node_modules/typescript/dist/enums/objectFlags.enum.js +52 -0
- package/examples/gh/node_modules/typescript/dist/enums/objectFlags.enum.js.map +1 -0
- package/examples/gh/node_modules/typescript/dist/enums/objectFlags.js +52 -0
- package/examples/gh/node_modules/typescript/dist/enums/objectFlags.js.map +1 -0
- package/examples/gh/node_modules/typescript/dist/enums/outerExpressionKinds.d.ts +2 -0
- package/examples/gh/node_modules/typescript/dist/enums/outerExpressionKinds.d.ts.map +1 -0
- package/examples/gh/node_modules/typescript/dist/enums/outerExpressionKinds.enum.d.ts +16 -0
- package/examples/gh/node_modules/typescript/dist/enums/outerExpressionKinds.enum.d.ts.map +1 -0
- package/examples/gh/node_modules/typescript/dist/enums/outerExpressionKinds.enum.js +18 -0
- package/examples/gh/node_modules/typescript/dist/enums/outerExpressionKinds.enum.js.map +1 -0
- package/examples/gh/node_modules/typescript/dist/enums/outerExpressionKinds.js +18 -0
- package/examples/gh/node_modules/typescript/dist/enums/outerExpressionKinds.js.map +1 -0
- package/examples/gh/node_modules/typescript/dist/enums/regularExpressionFlags.d.ts +2 -0
- package/examples/gh/node_modules/typescript/dist/enums/regularExpressionFlags.d.ts.map +1 -0
- package/examples/gh/node_modules/typescript/dist/enums/regularExpressionFlags.enum.d.ts +13 -0
- package/examples/gh/node_modules/typescript/dist/enums/regularExpressionFlags.enum.d.ts.map +1 -0
- package/examples/gh/node_modules/typescript/dist/enums/regularExpressionFlags.enum.js +14 -0
- package/examples/gh/node_modules/typescript/dist/enums/regularExpressionFlags.enum.js.map +1 -0
- package/examples/gh/node_modules/typescript/dist/enums/regularExpressionFlags.js +14 -0
- package/examples/gh/node_modules/typescript/dist/enums/regularExpressionFlags.js.map +1 -0
- package/examples/gh/node_modules/typescript/dist/enums/scriptKind.d.ts +2 -0
- package/examples/gh/node_modules/typescript/dist/enums/scriptKind.d.ts.map +1 -0
- package/examples/gh/node_modules/typescript/dist/enums/scriptKind.enum.d.ts +11 -0
- package/examples/gh/node_modules/typescript/dist/enums/scriptKind.enum.d.ts.map +1 -0
- package/examples/gh/node_modules/typescript/dist/enums/scriptKind.enum.js +12 -0
- package/examples/gh/node_modules/typescript/dist/enums/scriptKind.enum.js.map +1 -0
- package/examples/gh/node_modules/typescript/dist/enums/scriptKind.js +12 -0
- package/examples/gh/node_modules/typescript/dist/enums/scriptKind.js.map +1 -0
- package/examples/gh/node_modules/typescript/dist/enums/scriptTarget.d.ts +2 -0
- package/examples/gh/node_modules/typescript/dist/enums/scriptTarget.d.ts.map +1 -0
- package/examples/gh/node_modules/typescript/dist/enums/scriptTarget.enum.d.ts +17 -0
- package/examples/gh/node_modules/typescript/dist/enums/scriptTarget.enum.d.ts.map +1 -0
- package/examples/gh/node_modules/typescript/dist/enums/scriptTarget.enum.js +18 -0
- package/examples/gh/node_modules/typescript/dist/enums/scriptTarget.enum.js.map +1 -0
- package/examples/gh/node_modules/typescript/dist/enums/scriptTarget.js +18 -0
- package/examples/gh/node_modules/typescript/dist/enums/scriptTarget.js.map +1 -0
- package/examples/gh/node_modules/typescript/dist/enums/signatureFlags.d.ts +2 -0
- package/examples/gh/node_modules/typescript/dist/enums/signatureFlags.d.ts.map +1 -0
- package/examples/gh/node_modules/typescript/dist/enums/signatureFlags.enum.d.ts +15 -0
- package/examples/gh/node_modules/typescript/dist/enums/signatureFlags.enum.d.ts.map +1 -0
- package/examples/gh/node_modules/typescript/dist/enums/signatureFlags.enum.js +17 -0
- package/examples/gh/node_modules/typescript/dist/enums/signatureFlags.enum.js.map +1 -0
- package/examples/gh/node_modules/typescript/dist/enums/signatureFlags.js +17 -0
- package/examples/gh/node_modules/typescript/dist/enums/signatureFlags.js.map +1 -0
- package/examples/gh/node_modules/typescript/dist/enums/signatureKind.d.ts +2 -0
- package/examples/gh/node_modules/typescript/dist/enums/signatureKind.d.ts.map +1 -0
- package/examples/gh/node_modules/typescript/dist/enums/signatureKind.enum.d.ts +5 -0
- package/examples/gh/node_modules/typescript/dist/enums/signatureKind.enum.d.ts.map +1 -0
- package/examples/gh/node_modules/typescript/dist/enums/signatureKind.enum.js +7 -0
- package/examples/gh/node_modules/typescript/dist/enums/signatureKind.enum.js.map +1 -0
- package/examples/gh/node_modules/typescript/dist/enums/signatureKind.js +7 -0
- package/examples/gh/node_modules/typescript/dist/enums/signatureKind.js.map +1 -0
- package/examples/gh/node_modules/typescript/dist/enums/symbolFlags.d.ts +2 -0
- package/examples/gh/node_modules/typescript/dist/enums/symbolFlags.d.ts.map +1 -0
- package/examples/gh/node_modules/typescript/dist/enums/symbolFlags.enum.d.ts +71 -0
- package/examples/gh/node_modules/typescript/dist/enums/symbolFlags.enum.d.ts.map +1 -0
- package/examples/gh/node_modules/typescript/dist/enums/symbolFlags.enum.js +73 -0
- package/examples/gh/node_modules/typescript/dist/enums/symbolFlags.enum.js.map +1 -0
- package/examples/gh/node_modules/typescript/dist/enums/symbolFlags.js +73 -0
- package/examples/gh/node_modules/typescript/dist/enums/symbolFlags.js.map +1 -0
- package/examples/gh/node_modules/typescript/dist/enums/syntaxKind.d.ts +2 -0
- package/examples/gh/node_modules/typescript/dist/enums/syntaxKind.d.ts.map +1 -0
- package/examples/gh/node_modules/typescript/dist/enums/syntaxKind.enum.d.ts +389 -0
- package/examples/gh/node_modules/typescript/dist/enums/syntaxKind.enum.d.ts.map +1 -0
- package/examples/gh/node_modules/typescript/dist/enums/syntaxKind.enum.js +391 -0
- package/examples/gh/node_modules/typescript/dist/enums/syntaxKind.enum.js.map +1 -0
- package/examples/gh/node_modules/typescript/dist/enums/syntaxKind.js +391 -0
- package/examples/gh/node_modules/typescript/dist/enums/syntaxKind.js.map +1 -0
- package/examples/gh/node_modules/typescript/dist/enums/tokenFlags.d.ts +2 -0
- package/examples/gh/node_modules/typescript/dist/enums/tokenFlags.d.ts.map +1 -0
- package/examples/gh/node_modules/typescript/dist/enums/tokenFlags.enum.d.ts +30 -0
- package/examples/gh/node_modules/typescript/dist/enums/tokenFlags.enum.d.ts.map +1 -0
- package/examples/gh/node_modules/typescript/dist/enums/tokenFlags.enum.js +32 -0
- package/examples/gh/node_modules/typescript/dist/enums/tokenFlags.enum.js.map +1 -0
- package/examples/gh/node_modules/typescript/dist/enums/tokenFlags.js +32 -0
- package/examples/gh/node_modules/typescript/dist/enums/tokenFlags.js.map +1 -0
- package/examples/gh/node_modules/typescript/dist/enums/typeFlags.d.ts +2 -0
- package/examples/gh/node_modules/typescript/dist/enums/typeFlags.d.ts.map +1 -0
- package/examples/gh/node_modules/typescript/dist/enums/typeFlags.enum.d.ts +76 -0
- package/examples/gh/node_modules/typescript/dist/enums/typeFlags.enum.d.ts.map +1 -0
- package/examples/gh/node_modules/typescript/dist/enums/typeFlags.enum.js +78 -0
- package/examples/gh/node_modules/typescript/dist/enums/typeFlags.enum.js.map +1 -0
- package/examples/gh/node_modules/typescript/dist/enums/typeFlags.js +78 -0
- package/examples/gh/node_modules/typescript/dist/enums/typeFlags.js.map +1 -0
- package/examples/gh/node_modules/typescript/dist/enums/typePredicateKind.d.ts +2 -0
- package/examples/gh/node_modules/typescript/dist/enums/typePredicateKind.d.ts.map +1 -0
- package/examples/gh/node_modules/typescript/dist/enums/typePredicateKind.enum.d.ts +7 -0
- package/examples/gh/node_modules/typescript/dist/enums/typePredicateKind.enum.d.ts.map +1 -0
- package/examples/gh/node_modules/typescript/dist/enums/typePredicateKind.enum.js +9 -0
- package/examples/gh/node_modules/typescript/dist/enums/typePredicateKind.enum.js.map +1 -0
- package/examples/gh/node_modules/typescript/dist/enums/typePredicateKind.js +9 -0
- package/examples/gh/node_modules/typescript/dist/enums/typePredicateKind.js.map +1 -0
- package/examples/gh/node_modules/typescript/dist/internal/utils.d.ts +23 -0
- package/examples/gh/node_modules/typescript/dist/internal/utils.d.ts.map +1 -0
- package/examples/gh/node_modules/typescript/dist/internal/utils.js +25 -0
- package/examples/gh/node_modules/typescript/dist/internal/utils.js.map +1 -0
- package/examples/gh/node_modules/typescript/lib/getExePath.d.ts +2 -0
- package/examples/gh/node_modules/typescript/lib/getExePath.js +70 -0
- package/examples/gh/node_modules/typescript/lib/tsc.js +28 -0
- package/examples/gh/node_modules/typescript/lib/version.cjs +3 -0
- package/examples/gh/node_modules/typescript/lib/version.d.cts +2 -0
- package/examples/gh/node_modules/typescript/package.json +87 -0
- package/examples/gh/node_modules/typescript/vendor/vscode-jsonrpc/License.txt +11 -0
- package/examples/gh/node_modules/typescript/vendor/vscode-jsonrpc/README.md +54 -0
- package/examples/gh/node_modules/typescript/vendor/vscode-jsonrpc/lib/browser/main.d.ts +17 -0
- package/examples/gh/node_modules/typescript/vendor/vscode-jsonrpc/lib/browser/main.js +83 -0
- package/examples/gh/node_modules/typescript/vendor/vscode-jsonrpc/lib/browser/ril.d.ts +22 -0
- package/examples/gh/node_modules/typescript/vendor/vscode-jsonrpc/lib/browser/ril.js +210 -0
- package/examples/gh/node_modules/typescript/vendor/vscode-jsonrpc/lib/common/api.d.ts +14 -0
- package/examples/gh/node_modules/typescript/vendor/vscode-jsonrpc/lib/common/api.js +87 -0
- package/examples/gh/node_modules/typescript/vendor/vscode-jsonrpc/lib/common/cancellation.d.ts +32 -0
- package/examples/gh/node_modules/typescript/vendor/vscode-jsonrpc/lib/common/cancellation.js +132 -0
- package/examples/gh/node_modules/typescript/vendor/vscode-jsonrpc/lib/common/connection.d.ts +367 -0
- package/examples/gh/node_modules/typescript/vendor/vscode-jsonrpc/lib/common/connection.js +1271 -0
- package/examples/gh/node_modules/typescript/vendor/vscode-jsonrpc/lib/common/disposable.d.ts +9 -0
- package/examples/gh/node_modules/typescript/vendor/vscode-jsonrpc/lib/common/disposable.js +16 -0
- package/examples/gh/node_modules/typescript/vendor/vscode-jsonrpc/lib/common/encoding.d.ts +52 -0
- package/examples/gh/node_modules/typescript/vendor/vscode-jsonrpc/lib/common/encoding.js +70 -0
- package/examples/gh/node_modules/typescript/vendor/vscode-jsonrpc/lib/common/events.d.ts +39 -0
- package/examples/gh/node_modules/typescript/vendor/vscode-jsonrpc/lib/common/events.js +135 -0
- package/examples/gh/node_modules/typescript/vendor/vscode-jsonrpc/lib/common/is.d.ts +7 -0
- package/examples/gh/node_modules/typescript/vendor/vscode-jsonrpc/lib/common/is.js +34 -0
- package/examples/gh/node_modules/typescript/vendor/vscode-jsonrpc/lib/common/linkedMap.d.ts +55 -0
- package/examples/gh/node_modules/typescript/vendor/vscode-jsonrpc/lib/common/linkedMap.js +412 -0
- package/examples/gh/node_modules/typescript/vendor/vscode-jsonrpc/lib/common/messageBuffer.d.ts +18 -0
- package/examples/gh/node_modules/typescript/vendor/vscode-jsonrpc/lib/common/messageBuffer.js +155 -0
- package/examples/gh/node_modules/typescript/vendor/vscode-jsonrpc/lib/common/messageReader.d.ts +77 -0
- package/examples/gh/node_modules/typescript/vendor/vscode-jsonrpc/lib/common/messageReader.js +246 -0
- package/examples/gh/node_modules/typescript/vendor/vscode-jsonrpc/lib/common/messageWriter.d.ts +60 -0
- package/examples/gh/node_modules/typescript/vendor/vscode-jsonrpc/lib/common/messageWriter.js +157 -0
- package/examples/gh/node_modules/typescript/vendor/vscode-jsonrpc/lib/common/messages.d.ts +369 -0
- package/examples/gh/node_modules/typescript/vendor/vscode-jsonrpc/lib/common/messages.js +436 -0
- package/examples/gh/node_modules/typescript/vendor/vscode-jsonrpc/lib/common/ral.d.ts +74 -0
- package/examples/gh/node_modules/typescript/vendor/vscode-jsonrpc/lib/common/ral.js +23 -0
- package/examples/gh/node_modules/typescript/vendor/vscode-jsonrpc/lib/common/semaphore.d.ts +10 -0
- package/examples/gh/node_modules/typescript/vendor/vscode-jsonrpc/lib/common/semaphore.js +74 -0
- package/examples/gh/node_modules/typescript/vendor/vscode-jsonrpc/lib/common/sharedArrayCancellation.d.ts +15 -0
- package/examples/gh/node_modules/typescript/vendor/vscode-jsonrpc/lib/common/sharedArrayCancellation.js +77 -0
- package/examples/gh/node_modules/typescript/vendor/vscode-jsonrpc/lib/node/main.d.ts +58 -0
- package/examples/gh/node_modules/typescript/vendor/vscode-jsonrpc/lib/node/main.js +289 -0
- package/examples/gh/node_modules/typescript/vendor/vscode-jsonrpc/lib/node/ril.d.ts +12 -0
- package/examples/gh/node_modules/typescript/vendor/vscode-jsonrpc/lib/node/ril.js +163 -0
- package/examples/gh/node_modules/typescript/vendor/vscode-jsonrpc/package.json +54 -0
- package/examples/gh/node_modules/typescript/vendor/vscode-jsonrpc/typings/thenable.d.ts +5 -0
- package/examples/gh/package.json +11 -5
- package/examples/gh/src/main.ts +10 -4
- package/examples/pwsh-demo/package.json +1 -1
- package/examples/pwsh-demo/src/main.ts +1 -1
- package/package.json +45 -41
- package/dist/core/schema-dsl/runtime.d.mts +0 -144
- package/dist/core/schema-dsl/runtime.mjs +0 -271
- package/dist/core/schema-dsl/to-json-schema.d.mts +0 -30
- package/dist/core/schema-dsl/to-json-schema.mjs +0 -74
- package/dist/runtime/bun.d.mts +0 -28
- package/dist/runtime/bun.mjs +0 -28
|
@@ -11,7 +11,7 @@ import { resolveConfigPath } from "./config.mjs";
|
|
|
11
11
|
* @internal
|
|
12
12
|
*/
|
|
13
13
|
/** Walk every declared flag through the resolution chain (cli -> env -> config -> prompt -> default), collecting deprecations and throwing aggregated errors. */
|
|
14
|
-
async function resolveFlags(flagSchemas, parsedFlags, env, config, prompter, interactive, deprecations) {
|
|
14
|
+
async function resolveFlags(flagSchemas, parsedFlags, env, config, prompter, interactive, deprecations, stat, mkdir) {
|
|
15
15
|
const resolved = {};
|
|
16
16
|
const errors = [];
|
|
17
17
|
const hardErrorFlags = /* @__PURE__ */ new Set();
|
|
@@ -101,6 +101,10 @@ async function resolveFlags(flagSchemas, parsedFlags, env, config, prompter, int
|
|
|
101
101
|
resolved[name] = [];
|
|
102
102
|
continue;
|
|
103
103
|
}
|
|
104
|
+
if (schema.kind === "keyValue" && schema.presence !== "required") {
|
|
105
|
+
resolved[name] = {};
|
|
106
|
+
continue;
|
|
107
|
+
}
|
|
104
108
|
if (schema.presence === "required") {
|
|
105
109
|
const details = {
|
|
106
110
|
flag: name,
|
|
@@ -117,9 +121,63 @@ async function resolveFlags(flagSchemas, parsedFlags, env, config, prompter, int
|
|
|
117
121
|
}
|
|
118
122
|
resolved[name] = void 0;
|
|
119
123
|
}
|
|
124
|
+
for (const [name, schema] of Object.entries(flagSchemas)) {
|
|
125
|
+
const value = resolved[name];
|
|
126
|
+
if (schema.kind === "array" && schema.unique && Array.isArray(value)) resolved[name] = [...new Set(value)];
|
|
127
|
+
if (schema.pathChecks !== void 0 && typeof value === "string" && stat !== void 0) {
|
|
128
|
+
const violation = await validatePathChecks(name, value, schema.pathChecks, stat, mkdir);
|
|
129
|
+
if (violation !== void 0) errors.push(violation);
|
|
130
|
+
}
|
|
131
|
+
}
|
|
120
132
|
if (isNonEmpty(errors)) throwAggregatedErrors(errors);
|
|
121
133
|
return resolved;
|
|
122
134
|
}
|
|
135
|
+
/**
|
|
136
|
+
* Check a resolved path value against its declared filesystem expectations.
|
|
137
|
+
*
|
|
138
|
+
* @returns `undefined` when the path satisfies the checks, or a
|
|
139
|
+
* {@link ValidationError} with code `'CONSTRAINT_VIOLATED'` otherwise.
|
|
140
|
+
* @internal
|
|
141
|
+
*/
|
|
142
|
+
async function validatePathChecks(flagName, value, checks, stat, mkdir) {
|
|
143
|
+
const found = await stat(value);
|
|
144
|
+
if (found === null) {
|
|
145
|
+
if (checks.create && mkdir !== void 0) try {
|
|
146
|
+
await mkdir(value);
|
|
147
|
+
return;
|
|
148
|
+
} catch (error) {
|
|
149
|
+
return new ValidationError(`Failed to create directory '${value}' for flag --${flagName}: ${error instanceof Error ? error.message : String(error)}`, {
|
|
150
|
+
code: "CONSTRAINT_VIOLATED",
|
|
151
|
+
details: {
|
|
152
|
+
flag: flagName,
|
|
153
|
+
value,
|
|
154
|
+
constraint: "create"
|
|
155
|
+
},
|
|
156
|
+
suggest: `Provide a creatable or existing directory path for --${flagName}`
|
|
157
|
+
});
|
|
158
|
+
}
|
|
159
|
+
if (!checks.mustExist) return void 0;
|
|
160
|
+
return new ValidationError(`Path '${value}' for flag --${flagName} does not exist`, {
|
|
161
|
+
code: "CONSTRAINT_VIOLATED",
|
|
162
|
+
details: {
|
|
163
|
+
flag: flagName,
|
|
164
|
+
value,
|
|
165
|
+
constraint: "mustExist"
|
|
166
|
+
},
|
|
167
|
+
suggest: `Provide an existing path for --${flagName}`
|
|
168
|
+
});
|
|
169
|
+
}
|
|
170
|
+
if (checks.type !== void 0 && found !== checks.type) return new ValidationError(`Path '${value}' for flag --${flagName} is a ${found}, expected a ${checks.type}`, {
|
|
171
|
+
code: "CONSTRAINT_VIOLATED",
|
|
172
|
+
details: {
|
|
173
|
+
flag: flagName,
|
|
174
|
+
value,
|
|
175
|
+
constraint: "pathType",
|
|
176
|
+
expected: checks.type
|
|
177
|
+
},
|
|
178
|
+
suggest: `Provide a ${checks.type} path for --${flagName}`
|
|
179
|
+
});
|
|
180
|
+
}
|
|
123
181
|
/** Maps each flag kind to the prompt kinds that produce compatible values. */
|
|
124
182
|
const COMPATIBLE_PROMPT_KINDS = {
|
|
125
183
|
boolean: ["confirm"],
|
|
@@ -132,7 +190,9 @@ const COMPATIBLE_PROMPT_KINDS = {
|
|
|
132
190
|
"select",
|
|
133
191
|
"confirm",
|
|
134
192
|
"multiselect"
|
|
135
|
-
]
|
|
193
|
+
],
|
|
194
|
+
count: [],
|
|
195
|
+
keyValue: []
|
|
136
196
|
};
|
|
137
197
|
/**
|
|
138
198
|
* Check whether a prompt kind is compatible with the flag's declared kind.
|
|
@@ -144,7 +204,18 @@ const COMPATIBLE_PROMPT_KINDS = {
|
|
|
144
204
|
function validatePromptFlagCompatibility(flagName, flagKind, promptKind) {
|
|
145
205
|
const allowed = COMPATIBLE_PROMPT_KINDS[flagKind];
|
|
146
206
|
if (allowed.includes(promptKind)) return void 0;
|
|
147
|
-
|
|
207
|
+
const first = allowed[0];
|
|
208
|
+
if (first === void 0) return new ValidationError(`Prompt kind '${promptKind}' is not compatible with ${flagKind} flag --${flagName}. ${flagKind} flags are not promptable`, {
|
|
209
|
+
code: "CONSTRAINT_VIOLATED",
|
|
210
|
+
details: {
|
|
211
|
+
flag: flagName,
|
|
212
|
+
flagKind,
|
|
213
|
+
promptKind,
|
|
214
|
+
allowed
|
|
215
|
+
},
|
|
216
|
+
suggest: `Remove the prompt config for --${flagName}`
|
|
217
|
+
});
|
|
218
|
+
return new ValidationError(`Prompt kind '${promptKind}' is not compatible with ${flagKind} flag --${flagName}. Use '${first}' instead`, {
|
|
148
219
|
code: "CONSTRAINT_VIOLATED",
|
|
149
220
|
details: {
|
|
150
221
|
flag: flagName,
|
|
@@ -152,7 +223,7 @@ function validatePromptFlagCompatibility(flagName, flagKind, promptKind) {
|
|
|
152
223
|
promptKind,
|
|
153
224
|
allowed
|
|
154
225
|
},
|
|
155
|
-
suggest: `Change the prompt to { kind: '${
|
|
226
|
+
suggest: `Change the prompt to { kind: '${first}' } for --${flagName}`
|
|
156
227
|
});
|
|
157
228
|
}
|
|
158
229
|
/**
|
|
@@ -184,7 +255,8 @@ async function resolvePromptValueWithConfig(flagName, schema, promptConfig, prom
|
|
|
184
255
|
/** Build a human-readable suggestion listing all available sources for a required flag. @internal */
|
|
185
256
|
function buildRequiredFlagSuggest(name, schema) {
|
|
186
257
|
const sources = [];
|
|
187
|
-
|
|
258
|
+
const takesValue = schema.kind !== "boolean" && schema.kind !== "count";
|
|
259
|
+
sources.push(`Provide --${name}${takesValue ? " <value>" : ""}`);
|
|
188
260
|
if (schema.envVar !== void 0) sources.push(`set ${schema.envVar}`);
|
|
189
261
|
if (schema.configPath !== void 0) sources.push(`add ${schema.configPath} to config`);
|
|
190
262
|
if (sources.length <= 1) return sources.join("");
|
|
@@ -193,4 +265,4 @@ function buildRequiredFlagSuggest(name, schema) {
|
|
|
193
265
|
return sources.length === 2 ? `${rest.join("")} or ${last}` : `${rest.join(", ")}, or ${last}`;
|
|
194
266
|
}
|
|
195
267
|
//#endregion
|
|
196
|
-
export { resolveFlags };
|
|
268
|
+
export { COMPATIBLE_PROMPT_KINDS, resolveFlags };
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { ParseResult } from "../parse/index.mjs";
|
|
2
1
|
import { DeprecationWarning, ResolveOptions, ResolveResult } from "./contracts.mjs";
|
|
3
2
|
import { CommandSchema } from "../schema/command.mjs";
|
|
4
|
-
|
|
3
|
+
import "../schema/index.mjs";
|
|
4
|
+
import { ParseResult } from "../parse/index.mjs";
|
|
5
5
|
//#region src/core/resolve/index.d.ts
|
|
6
6
|
/**
|
|
7
7
|
* Resolve parsed values against a command schema.
|
|
@@ -2,6 +2,7 @@ import { isValidationError } from "../errors/index.mjs";
|
|
|
2
2
|
import { collectValidationErrors, isNonEmpty, throwAggregatedErrors } from "./errors.mjs";
|
|
3
3
|
import { resolveArgs } from "./args.mjs";
|
|
4
4
|
import { resolveFlags } from "./flags.mjs";
|
|
5
|
+
import { applyStandardValidators } from "./standard.mjs";
|
|
5
6
|
//#region src/core/resolve/index.ts
|
|
6
7
|
/**
|
|
7
8
|
* Resolution chain: CLI -> env -> config -> prompt -> default.
|
|
@@ -63,7 +64,7 @@ async function resolve(schema, parsed, options) {
|
|
|
63
64
|
let args = {};
|
|
64
65
|
const errors = [];
|
|
65
66
|
try {
|
|
66
|
-
flags = await resolveFlags(schema.flags, parsed.flags, env, config, prompter, schema.interactive, deprecations);
|
|
67
|
+
flags = await resolveFlags(schema.flags, parsed.flags, env, config, prompter, schema.interactive, deprecations, options?.stat, options?.mkdir);
|
|
67
68
|
} catch (error) {
|
|
68
69
|
if (!isValidationError(error)) throw error;
|
|
69
70
|
errors.push(...collectValidationErrors(error));
|
|
@@ -74,6 +75,10 @@ async function resolve(schema, parsed, options) {
|
|
|
74
75
|
if (!isValidationError(error)) throw error;
|
|
75
76
|
errors.push(...collectValidationErrors(error));
|
|
76
77
|
}
|
|
78
|
+
const validated = await applyStandardValidators(schema, flags, args);
|
|
79
|
+
flags = validated.flags;
|
|
80
|
+
args = validated.args;
|
|
81
|
+
errors.push(...validated.errors);
|
|
77
82
|
if (isNonEmpty(errors)) throwAggregatedErrors(errors);
|
|
78
83
|
return {
|
|
79
84
|
flags,
|
|
@@ -1,14 +1,17 @@
|
|
|
1
1
|
import { NumberConstraints } from "../schema/number-constraints.mjs";
|
|
2
2
|
import { ArgSchema } from "../schema/arg.mjs";
|
|
3
|
+
import { StringConstraints } from "../schema/string-constraints.mjs";
|
|
3
4
|
import { FlagSchema } from "../schema/flag.mjs";
|
|
5
|
+
import "../schema/index.mjs";
|
|
4
6
|
//#region src/core/resolve/property.d.ts
|
|
5
7
|
/** Flag/arg kinds that share a common coercion path. */
|
|
6
|
-
declare const SHARED_PROPERTY_MODEL_KINDS: readonly [
|
|
8
|
+
declare const SHARED_PROPERTY_MODEL_KINDS: readonly ["string", "number", "enum", "custom"];
|
|
7
9
|
/** Union of kind discriminants that participate in shared coercion. */
|
|
8
10
|
type SharedPropertyKind = (typeof SHARED_PROPERTY_MODEL_KINDS)[number];
|
|
9
11
|
/** Minimal coercion-relevant slice of a flag or arg schema, discriminated by kind. */
|
|
10
12
|
type SharedPropertySchema = {
|
|
11
13
|
readonly kind: 'string';
|
|
14
|
+
readonly stringConstraints: StringConstraints | undefined;
|
|
12
15
|
} | {
|
|
13
16
|
readonly kind: 'number';
|
|
14
17
|
readonly numberConstraints: NumberConstraints | undefined;
|
|
@@ -2,7 +2,10 @@
|
|
|
2
2
|
/** Extract the shared coercion slice from a flag schema, or `undefined` for boolean/array (handled separately). */
|
|
3
3
|
function toSharedFlagPropertySchema(schema) {
|
|
4
4
|
switch (schema.kind) {
|
|
5
|
-
case "string": return {
|
|
5
|
+
case "string": return {
|
|
6
|
+
kind: "string",
|
|
7
|
+
stringConstraints: schema.stringConstraints
|
|
8
|
+
};
|
|
6
9
|
case "number": return {
|
|
7
10
|
kind: "number",
|
|
8
11
|
numberConstraints: schema.numberConstraints
|
|
@@ -16,13 +19,18 @@ function toSharedFlagPropertySchema(schema) {
|
|
|
16
19
|
parseFn: schema.parseFn
|
|
17
20
|
};
|
|
18
21
|
case "boolean":
|
|
19
|
-
case "array":
|
|
22
|
+
case "array":
|
|
23
|
+
case "count":
|
|
24
|
+
case "keyValue": return;
|
|
20
25
|
}
|
|
21
26
|
}
|
|
22
27
|
/** Extract the shared coercion slice from an arg schema (all arg kinds are shared). */
|
|
23
28
|
function toSharedArgPropertySchema(schema) {
|
|
24
29
|
switch (schema.kind) {
|
|
25
|
-
case "string": return {
|
|
30
|
+
case "string": return {
|
|
31
|
+
kind: "string",
|
|
32
|
+
stringConstraints: void 0
|
|
33
|
+
};
|
|
26
34
|
case "number": return {
|
|
27
35
|
kind: "number",
|
|
28
36
|
numberConstraints: schema.numberConstraints
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { ValidationError } from "../errors/index.mjs";
|
|
2
|
+
import { CommandSchema } from "../schema/command.mjs";
|
|
3
|
+
import "../schema/index.mjs";
|
|
4
|
+
//#region src/core/resolve/standard.d.ts
|
|
5
|
+
/** Resolved values after the Standard Schema pass, plus any issues found. */
|
|
6
|
+
interface StandardValidationResult {
|
|
7
|
+
readonly flags: Readonly<Record<string, unknown>>;
|
|
8
|
+
readonly args: Readonly<Record<string, unknown>>;
|
|
9
|
+
readonly errors: readonly ValidationError[];
|
|
10
|
+
}
|
|
11
|
+
/**
|
|
12
|
+
* Validate resolved flag and arg values against any attached Standard Schema
|
|
13
|
+
* validators. Values without a validator, or resolved to `undefined`, pass
|
|
14
|
+
* through untouched.
|
|
15
|
+
*
|
|
16
|
+
* @param schema - The command schema carrying per-flag/arg validators.
|
|
17
|
+
* @param flags - Resolved flag values, keyed by flag name.
|
|
18
|
+
* @param args - Resolved arg values, keyed by arg name.
|
|
19
|
+
* @returns The (possibly transformed) values and any constraint violations.
|
|
20
|
+
* @internal
|
|
21
|
+
*/
|
|
22
|
+
declare function applyStandardValidators(schema: CommandSchema, flags: Readonly<Record<string, unknown>>, args: Readonly<Record<string, unknown>>): Promise<StandardValidationResult>;
|
|
23
|
+
//#endregion
|
|
24
|
+
export { applyStandardValidators };
|
|
@@ -0,0 +1,114 @@
|
|
|
1
|
+
import { ValidationError } from "../errors/index.mjs";
|
|
2
|
+
//#region src/core/resolve/standard.ts
|
|
3
|
+
/**
|
|
4
|
+
* Standard Schema v1 validation pass.
|
|
5
|
+
*
|
|
6
|
+
* Runs after CLI/env/config/prompt/default resolution so a validator attached
|
|
7
|
+
* via `flag.custom()` / `arg.custom()` sees the final value regardless of its
|
|
8
|
+
* source. `~standard.validate` may be sync or async; both are awaited here.
|
|
9
|
+
* Issues become `CONSTRAINT_VIOLATED` validation errors; a successful result
|
|
10
|
+
* replaces the value with the validator's (possibly transformed) output.
|
|
11
|
+
*
|
|
12
|
+
* @module dreamcli/core/resolve/standard
|
|
13
|
+
*/
|
|
14
|
+
/** Render an issue path (e.g. `['a', 0]` → `a.0`), or `undefined` when empty. */
|
|
15
|
+
function formatIssuePath(path) {
|
|
16
|
+
if (path === void 0 || path.length === 0) return;
|
|
17
|
+
return path.map((segment) => {
|
|
18
|
+
const key = typeof segment === "object" ? segment.key : segment;
|
|
19
|
+
return typeof key === "symbol" ? key.toString() : String(key);
|
|
20
|
+
}).join(".");
|
|
21
|
+
}
|
|
22
|
+
/** Build a `CONSTRAINT_VIOLATED` message from a validator's issues. */
|
|
23
|
+
function issuesMessage(label, issues) {
|
|
24
|
+
return `${label} failed validation: ${issues.map((issue) => {
|
|
25
|
+
const path = formatIssuePath(issue.path);
|
|
26
|
+
return path === void 0 ? issue.message : `${path}: ${issue.message}`;
|
|
27
|
+
}).join("; ")}`;
|
|
28
|
+
}
|
|
29
|
+
/** Await a validator against a single value, mapping failure to a typed error. */
|
|
30
|
+
async function validateValue(label, value, validator) {
|
|
31
|
+
const result = await validator["~standard"].validate(value);
|
|
32
|
+
if (result.issues !== void 0) return {
|
|
33
|
+
ok: false,
|
|
34
|
+
error: new ValidationError(issuesMessage(label, result.issues), {
|
|
35
|
+
code: "CONSTRAINT_VIOLATED",
|
|
36
|
+
details: {
|
|
37
|
+
value,
|
|
38
|
+
issues: result.issues.map((issue) => issue.message)
|
|
39
|
+
},
|
|
40
|
+
suggest: `Provide a value for ${label} that satisfies its validator`
|
|
41
|
+
})
|
|
42
|
+
};
|
|
43
|
+
return {
|
|
44
|
+
ok: true,
|
|
45
|
+
value: result.value
|
|
46
|
+
};
|
|
47
|
+
}
|
|
48
|
+
/**
|
|
49
|
+
* Validate resolved flag and arg values against any attached Standard Schema
|
|
50
|
+
* validators. Values without a validator, or resolved to `undefined`, pass
|
|
51
|
+
* through untouched.
|
|
52
|
+
*
|
|
53
|
+
* @param schema - The command schema carrying per-flag/arg validators.
|
|
54
|
+
* @param flags - Resolved flag values, keyed by flag name.
|
|
55
|
+
* @param args - Resolved arg values, keyed by arg name.
|
|
56
|
+
* @returns The (possibly transformed) values and any constraint violations.
|
|
57
|
+
* @internal
|
|
58
|
+
*/
|
|
59
|
+
async function applyStandardValidators(schema, flags, args) {
|
|
60
|
+
const errors = [];
|
|
61
|
+
const nextFlags = { ...flags };
|
|
62
|
+
for (const [name, flagSchema] of Object.entries(schema.flags)) {
|
|
63
|
+
const value = flags[name];
|
|
64
|
+
if (value === void 0) continue;
|
|
65
|
+
const elementValidator = flagSchema.kind === "array" ? flagSchema.elementSchema?.standard : void 0;
|
|
66
|
+
if (elementValidator !== void 0 && Array.isArray(value)) {
|
|
67
|
+
const nextValue = [];
|
|
68
|
+
for (const [index, element] of value.entries()) {
|
|
69
|
+
const result = await validateValue(`--${name}[${index}]`, element, elementValidator);
|
|
70
|
+
if (result.ok) nextValue.push(result.value);
|
|
71
|
+
else {
|
|
72
|
+
nextValue.push(element);
|
|
73
|
+
errors.push(result.error);
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
nextFlags[name] = nextValue;
|
|
77
|
+
continue;
|
|
78
|
+
}
|
|
79
|
+
const validator = flagSchema.standard;
|
|
80
|
+
if (validator === void 0) continue;
|
|
81
|
+
const result = await validateValue(`--${name}`, value, validator);
|
|
82
|
+
if (result.ok) nextFlags[name] = result.value;
|
|
83
|
+
else errors.push(result.error);
|
|
84
|
+
}
|
|
85
|
+
const nextArgs = { ...args };
|
|
86
|
+
for (const entry of schema.args) {
|
|
87
|
+
const validator = entry.schema.standard;
|
|
88
|
+
const value = args[entry.name];
|
|
89
|
+
if (validator === void 0 || value === void 0) continue;
|
|
90
|
+
if (entry.schema.variadic && Array.isArray(value)) {
|
|
91
|
+
const nextValue = [];
|
|
92
|
+
for (const [index, element] of value.entries()) {
|
|
93
|
+
const result = await validateValue(`<${entry.name}>[${index}]`, element, validator);
|
|
94
|
+
if (result.ok) nextValue.push(result.value);
|
|
95
|
+
else {
|
|
96
|
+
nextValue.push(element);
|
|
97
|
+
errors.push(result.error);
|
|
98
|
+
}
|
|
99
|
+
}
|
|
100
|
+
nextArgs[entry.name] = nextValue;
|
|
101
|
+
continue;
|
|
102
|
+
}
|
|
103
|
+
const result = await validateValue(`<${entry.name}>`, value, validator);
|
|
104
|
+
if (result.ok) nextArgs[entry.name] = result.value;
|
|
105
|
+
else errors.push(result.error);
|
|
106
|
+
}
|
|
107
|
+
return {
|
|
108
|
+
flags: nextFlags,
|
|
109
|
+
args: nextArgs,
|
|
110
|
+
errors
|
|
111
|
+
};
|
|
112
|
+
}
|
|
113
|
+
//#endregion
|
|
114
|
+
export { applyStandardValidators };
|
|
@@ -87,34 +87,54 @@ interface ProgressHandle {
|
|
|
87
87
|
* without polluting stdout/stderr arrays.
|
|
88
88
|
*/
|
|
89
89
|
type ActivityEvent = {
|
|
90
|
-
/** Spinner created and started. */
|
|
90
|
+
/** Spinner created and started. */
|
|
91
|
+
readonly type: 'spinner:start';
|
|
92
|
+
/** Initial spinner text. */
|
|
91
93
|
readonly text: string;
|
|
92
94
|
} | {
|
|
93
|
-
/** Spinner text changed. */
|
|
95
|
+
/** Spinner text changed. */
|
|
96
|
+
readonly type: 'spinner:update';
|
|
97
|
+
/** Updated spinner text. */
|
|
94
98
|
readonly text: string;
|
|
95
99
|
} | {
|
|
96
|
-
/** Spinner completed successfully. */
|
|
100
|
+
/** Spinner completed successfully. */
|
|
101
|
+
readonly type: 'spinner:succeed';
|
|
102
|
+
/** Success message. */
|
|
97
103
|
readonly text: string;
|
|
98
104
|
} | {
|
|
99
|
-
/** Spinner stopped with an error. */
|
|
105
|
+
/** Spinner stopped with an error. */
|
|
106
|
+
readonly type: 'spinner:fail';
|
|
107
|
+
/** Failure message. */
|
|
100
108
|
readonly text: string;
|
|
101
109
|
} | {
|
|
102
|
-
/** Spinner stopped without a final status. */
|
|
110
|
+
/** Spinner stopped without a final status. */
|
|
111
|
+
readonly type: 'spinner:stop';
|
|
103
112
|
} | {
|
|
104
|
-
/** Progress bar created and started. */
|
|
105
|
-
readonly
|
|
113
|
+
/** Progress bar created and started. */
|
|
114
|
+
readonly type: 'progress:start';
|
|
115
|
+
/** Bar label. */
|
|
116
|
+
readonly label: string;
|
|
117
|
+
/** Known total, or `undefined` for indeterminate. */
|
|
106
118
|
readonly total: number | undefined;
|
|
107
119
|
} | {
|
|
108
|
-
/** Progress bar advanced. */
|
|
120
|
+
/** Progress bar advanced. */
|
|
121
|
+
readonly type: 'progress:increment';
|
|
122
|
+
/** Amount advanced. */
|
|
109
123
|
readonly delta: number;
|
|
110
124
|
} | {
|
|
111
|
-
/** Progress bar set to an absolute value. */
|
|
125
|
+
/** Progress bar set to an absolute value. */
|
|
126
|
+
readonly type: 'progress:update';
|
|
127
|
+
/** New absolute value. */
|
|
112
128
|
readonly value: number;
|
|
113
129
|
} | {
|
|
114
|
-
/** Progress bar completed. */
|
|
130
|
+
/** Progress bar completed. */
|
|
131
|
+
readonly type: 'progress:done';
|
|
132
|
+
/** Completion message, if any. */
|
|
115
133
|
readonly text: string | undefined;
|
|
116
134
|
} | {
|
|
117
|
-
/** Progress bar stopped with an error. */
|
|
135
|
+
/** Progress bar stopped with an error. */
|
|
136
|
+
readonly type: 'progress:fail';
|
|
137
|
+
/** Failure message, if any. */
|
|
118
138
|
readonly text: string | undefined;
|
|
119
139
|
};
|
|
120
140
|
/**
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { NumberConstraints } from "./number-constraints.mjs";
|
|
2
|
-
|
|
2
|
+
import { InferStandardOutput, StandardSchemaV1 } from "./standard.mjs";
|
|
3
3
|
//#region src/core/schema/arg.d.ts
|
|
4
4
|
/** All arg presence states as a runtime array. */
|
|
5
|
-
declare const ARG_PRESENCES: readonly [
|
|
5
|
+
declare const ARG_PRESENCES: readonly ["required", "optional", "defaulted"];
|
|
6
6
|
/**
|
|
7
7
|
* Presence describes whether a positional arg is guaranteed to exist when the
|
|
8
8
|
* action handler runs:
|
|
@@ -60,9 +60,9 @@ type ResolvedArgValue<C extends ArgConfig> = C['variadic'] extends true ? C['val
|
|
|
60
60
|
/** Extract the resolved value type from an {@linkcode ArgBuilder}. */
|
|
61
61
|
type InferArg<B> = B extends ArgBuilder<infer C extends ArgConfig> ? ResolvedArgValue<C> : never;
|
|
62
62
|
/** Extract resolved value types from a record of builders. */
|
|
63
|
-
type InferArgs<T extends Record<string, ArgBuilder<ArgConfig>>> = { [K in keyof T]: InferArg<T[K]
|
|
63
|
+
type InferArgs<T extends Record<string, ArgBuilder<ArgConfig>>> = { [K in keyof T]: InferArg<T[K]>; };
|
|
64
64
|
/** All arg kind discriminators as a runtime array. */
|
|
65
|
-
declare const ARG_KINDS: readonly [
|
|
65
|
+
declare const ARG_KINDS: readonly ["string", "number", "enum", "custom"];
|
|
66
66
|
/** Discriminator for the kind of value an arg accepts. */
|
|
67
67
|
type ArgKind = (typeof ARG_KINDS)[number];
|
|
68
68
|
/** Custom parse function for `arg.custom()`. */
|
|
@@ -108,6 +108,15 @@ interface ArgSchema {
|
|
|
108
108
|
readonly numberConstraints: NumberConstraints | undefined;
|
|
109
109
|
/** Custom parse function (only when `kind === 'custom'`). */
|
|
110
110
|
readonly parseFn: ArgParseFn<unknown> | undefined;
|
|
111
|
+
/**
|
|
112
|
+
* Standard Schema v1 validator applied to the resolved value.
|
|
113
|
+
*
|
|
114
|
+
* When set, the value from any source (CLI, env, stdin, default) is
|
|
115
|
+
* validated after resolution via `~standard.validate`. Sync and async
|
|
116
|
+
* validators are both awaited; issues surface as a `CONSTRAINT_VIOLATED`
|
|
117
|
+
* {@link ValidationError}. Only meaningful when `kind === 'custom'`.
|
|
118
|
+
*/
|
|
119
|
+
readonly standard: StandardSchemaV1 | undefined;
|
|
111
120
|
/**
|
|
112
121
|
* Deprecation marker.
|
|
113
122
|
*
|
|
@@ -574,6 +583,31 @@ interface ArgFactory {
|
|
|
574
583
|
readonly variadic: false;
|
|
575
584
|
readonly argKind: 'enum';
|
|
576
585
|
}>;
|
|
586
|
+
/**
|
|
587
|
+
* Custom positional argument validated by a Standard Schema v1 validator
|
|
588
|
+
* (zod, valibot, arktype, …). The resolved value from any source is
|
|
589
|
+
* validated after resolution; the arg's value type is the validator's
|
|
590
|
+
* output type.
|
|
591
|
+
*
|
|
592
|
+
* Sync and async validators are both supported. Validation issues surface
|
|
593
|
+
* as a `CONSTRAINT_VIOLATED` error naming the argument.
|
|
594
|
+
*
|
|
595
|
+
* @example
|
|
596
|
+
* ```ts
|
|
597
|
+
* import { z } from 'zod';
|
|
598
|
+
* arg.custom(z.string().uuid())
|
|
599
|
+
* // inferred type: string
|
|
600
|
+
* ```
|
|
601
|
+
*
|
|
602
|
+
* @param schema - A Standard Schema v1 validator.
|
|
603
|
+
* @returns A required custom {@link ArgBuilder} typed to the validator's output.
|
|
604
|
+
*/
|
|
605
|
+
custom<S extends StandardSchemaV1>(schema: S): ArgBuilder<{
|
|
606
|
+
readonly valueType: InferStandardOutput<S>;
|
|
607
|
+
readonly presence: 'required';
|
|
608
|
+
readonly variadic: false;
|
|
609
|
+
readonly argKind: 'custom';
|
|
610
|
+
}>;
|
|
577
611
|
/**
|
|
578
612
|
* Custom-parsed positional argument. Required by default.
|
|
579
613
|
*
|
package/dist/core/schema/arg.mjs
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { assertNumberConstraints } from "./number-constraints.mjs";
|
|
2
|
+
import { isStandardSchemaV1 } from "./standard.mjs";
|
|
2
3
|
//#region src/core/schema/arg.ts
|
|
3
4
|
/**
|
|
4
5
|
* Positional argument schema builder with full type inference.
|
|
@@ -45,6 +46,7 @@ function createArgSchema(kind, overrides) {
|
|
|
45
46
|
enumValues: void 0,
|
|
46
47
|
numberConstraints: void 0,
|
|
47
48
|
parseFn: void 0,
|
|
49
|
+
standard: void 0,
|
|
48
50
|
deprecated: void 0,
|
|
49
51
|
...overrides
|
|
50
52
|
};
|
|
@@ -455,8 +457,9 @@ const arg = {
|
|
|
455
457
|
enum(values) {
|
|
456
458
|
return new ArgBuilder(createArgSchema("enum", { enumValues: values }));
|
|
457
459
|
},
|
|
458
|
-
custom(
|
|
459
|
-
return new ArgBuilder(createArgSchema("custom", {
|
|
460
|
+
custom(parseFnOrSchema) {
|
|
461
|
+
if (isStandardSchemaV1(parseFnOrSchema)) return new ArgBuilder(createArgSchema("custom", { standard: parseFnOrSchema }));
|
|
462
|
+
return new ArgBuilder(createArgSchema("custom", { parseFn: parseFnOrSchema }));
|
|
460
463
|
}
|
|
461
464
|
};
|
|
462
465
|
//#endregion
|