@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
|
@@ -1,9 +1,11 @@
|
|
|
1
1
|
import { NumberConstraints } from "./number-constraints.mjs";
|
|
2
|
+
import { InferStandardOutput, StandardSchemaV1 } from "./standard.mjs";
|
|
2
3
|
import { ConfirmPromptConfig, InputPromptConfig, MultiselectPromptConfig, PROMPT_KINDS, PromptConfig, PromptConfigBase, PromptKind, PromptResult, SelectChoice, SelectPromptConfig } from "./prompt.mjs";
|
|
3
|
-
|
|
4
|
+
import { StringConstraintViolation, StringConstraints } from "./string-constraints.mjs";
|
|
5
|
+
import { DateFlagOptions, UrlFlagOptions } from "./value-parsers.mjs";
|
|
4
6
|
//#region src/core/schema/flag.d.ts
|
|
5
7
|
/** All flag presence states as a runtime array. */
|
|
6
|
-
declare const FLAG_PRESENCES: readonly [
|
|
8
|
+
declare const FLAG_PRESENCES: readonly ["optional", "required", "defaulted"];
|
|
7
9
|
/**
|
|
8
10
|
* Presence describes whether a flag value is guaranteed to exist when the
|
|
9
11
|
* action handler runs:
|
|
@@ -18,9 +20,9 @@ type FlagPresence = (typeof FLAG_PRESENCES)[number];
|
|
|
18
20
|
* Fallback behavior when an optional flag resolves no value from any source.
|
|
19
21
|
*
|
|
20
22
|
* Most optional flags resolve to `undefined`; array flags instead resolve to
|
|
21
|
-
* an empty array `[]`.
|
|
23
|
+
* an empty array `[]`, and key-value flags to an empty object `{}`.
|
|
22
24
|
*/
|
|
23
|
-
type OptionalFallback = 'undefined' | 'empty-array';
|
|
25
|
+
type OptionalFallback = 'undefined' | 'empty-array' | 'empty-object';
|
|
24
26
|
/**
|
|
25
27
|
* Compile-time state carried through the builder chain.
|
|
26
28
|
*
|
|
@@ -36,6 +38,16 @@ interface FlagConfig {
|
|
|
36
38
|
readonly optionalFallback: OptionalFallback;
|
|
37
39
|
/** The runtime kind discriminator, mirroring {@link FlagKind}. */
|
|
38
40
|
readonly flagKind: FlagKind;
|
|
41
|
+
/**
|
|
42
|
+
* Whether this builder may still be passed to `flag.array()` as the
|
|
43
|
+
* element schema.
|
|
44
|
+
*
|
|
45
|
+
* Factories producing element-meaningful kinds start `true`. Flag-level
|
|
46
|
+
* modifiers (`.alias()`, `.env()`, `.prompt()`, `.default()`, …) flip it
|
|
47
|
+
* to `false` — those settings describe the *flag*, are never read from an
|
|
48
|
+
* element schema, and would otherwise be silently ignored.
|
|
49
|
+
*/
|
|
50
|
+
readonly elementEligible: boolean;
|
|
39
51
|
}
|
|
40
52
|
/**
|
|
41
53
|
* Advanced type helper used by {@linkcode FlagBuilder} modifiers to replace presence.
|
|
@@ -46,6 +58,18 @@ type WithPresence<C extends FlagConfig, P extends FlagPresence> = {
|
|
|
46
58
|
readonly presence: P;
|
|
47
59
|
readonly optionalFallback: C['optionalFallback'];
|
|
48
60
|
readonly flagKind: C['flagKind'];
|
|
61
|
+
readonly elementEligible: false;
|
|
62
|
+
};
|
|
63
|
+
/**
|
|
64
|
+
* Advanced type helper: marks a builder as no longer usable as an array
|
|
65
|
+
* element (returned by flag-level modifiers whose settings elements ignore).
|
|
66
|
+
*/
|
|
67
|
+
type WithoutElementEligibility<C extends FlagConfig> = {
|
|
68
|
+
readonly valueType: C['valueType'];
|
|
69
|
+
readonly presence: C['presence'];
|
|
70
|
+
readonly optionalFallback: C['optionalFallback'];
|
|
71
|
+
readonly flagKind: C['flagKind'];
|
|
72
|
+
readonly elementEligible: false;
|
|
49
73
|
};
|
|
50
74
|
/**
|
|
51
75
|
* Compute the final value type from config — this is what handlers receive.
|
|
@@ -54,15 +78,15 @@ type WithPresence<C extends FlagConfig, P extends FlagPresence> = {
|
|
|
54
78
|
* inference. Most apps do not need to mention it explicitly.
|
|
55
79
|
*
|
|
56
80
|
* - `'optional'` + `'undefined'` fallback → `T | undefined`
|
|
57
|
-
* - `'optional'` + `'empty-array'` fallback → `T`
|
|
81
|
+
* - `'optional'` + `'empty-array'` / `'empty-object'` fallback → `T`
|
|
58
82
|
* - `'required'` → `T`
|
|
59
83
|
* - `'defaulted'` → `T`
|
|
60
84
|
*/
|
|
61
|
-
type ResolvedValue<C extends FlagConfig> = C['presence'] extends 'optional' ? C['optionalFallback'] extends '
|
|
85
|
+
type ResolvedValue<C extends FlagConfig> = C['presence'] extends 'optional' ? C['optionalFallback'] extends 'undefined' ? C['valueType'] | undefined : C['valueType'] : C['valueType'];
|
|
62
86
|
/** Extract the resolved value type from a {@linkcode FlagBuilder}. */
|
|
63
87
|
type InferFlag<B> = B extends FlagBuilder<infer C extends FlagConfig> ? ResolvedValue<C> : never;
|
|
64
88
|
/** Extract resolved value types from a record of builders. */
|
|
65
|
-
type InferFlags<T extends Record<string, FlagBuilder<FlagConfig>>> = { [K in keyof T]: InferFlag<T[K]
|
|
89
|
+
type InferFlags<T extends Record<string, FlagBuilder<FlagConfig>>> = { [K in keyof T]: InferFlag<T[K]>; };
|
|
66
90
|
/**
|
|
67
91
|
* Maps a {@linkcode FlagConfig} to the prompt config types that are compatible
|
|
68
92
|
* with the flag's kind. Prevents compile-time mismatches such as
|
|
@@ -74,6 +98,7 @@ type InferFlags<T extends Record<string, FlagBuilder<FlagConfig>>> = { [K in key
|
|
|
74
98
|
* - `'enum'` → {@link SelectPromptConfig} | {@link InputPromptConfig}
|
|
75
99
|
* - `'array'` → {@link MultiselectPromptConfig}
|
|
76
100
|
* - `'custom'` → all prompt kinds ({@link PromptConfig})
|
|
101
|
+
* - `'count'` / `'keyValue'` → `never` (not promptable)
|
|
77
102
|
*/
|
|
78
103
|
type PromptConfigByFlagKind = {
|
|
79
104
|
readonly string: InputPromptConfig | SelectPromptConfig;
|
|
@@ -82,10 +107,13 @@ type PromptConfigByFlagKind = {
|
|
|
82
107
|
readonly enum: SelectPromptConfig | InputPromptConfig;
|
|
83
108
|
readonly array: MultiselectPromptConfig;
|
|
84
109
|
readonly custom: PromptConfig;
|
|
110
|
+
readonly count: never;
|
|
111
|
+
readonly keyValue: never;
|
|
85
112
|
};
|
|
113
|
+
/** Prompt configuration compatible with the kind carried by a {@link FlagConfig}. */
|
|
86
114
|
type AllowedPromptConfig<C extends FlagConfig> = PromptConfigByFlagKind[C['flagKind']];
|
|
87
115
|
/** All flag kind discriminators as a runtime array. */
|
|
88
|
-
declare const FLAG_KINDS: readonly [
|
|
116
|
+
declare const FLAG_KINDS: readonly ["string", "number", "boolean", "enum", "array", "custom", "count", "keyValue"];
|
|
89
117
|
/** Discriminator for the kind of value a flag accepts. */
|
|
90
118
|
type FlagKind = (typeof FLAG_KINDS)[number];
|
|
91
119
|
/**
|
|
@@ -95,6 +123,63 @@ type FlagKind = (typeof FLAG_KINDS)[number];
|
|
|
95
123
|
* value from config files. Narrow inside the function as needed.
|
|
96
124
|
*/
|
|
97
125
|
type FlagParseFn<T> = (raw: unknown) => T;
|
|
126
|
+
/** Options accepted by `flag.path()` for any-kind or file paths. */
|
|
127
|
+
interface FilePathFlagOptions {
|
|
128
|
+
/**
|
|
129
|
+
* Reject the value if nothing exists at the path.
|
|
130
|
+
* @defaultValue `false` (`true` when `type` is set)
|
|
131
|
+
*/
|
|
132
|
+
readonly mustExist?: boolean;
|
|
133
|
+
/**
|
|
134
|
+
* Require the path to be a file or a directory. Implies existence
|
|
135
|
+
* unless `mustExist` is explicitly `false`, in which case a missing
|
|
136
|
+
* path passes and only an existing path is type-checked.
|
|
137
|
+
* @defaultValue `undefined` (any kind)
|
|
138
|
+
*/
|
|
139
|
+
readonly type?: 'file';
|
|
140
|
+
/** Directory creation is only available with `type: 'directory'`. */
|
|
141
|
+
readonly create?: never;
|
|
142
|
+
}
|
|
143
|
+
/** Options accepted by `flag.path()` for directory paths. */
|
|
144
|
+
interface DirectoryPathFlagOptions {
|
|
145
|
+
/**
|
|
146
|
+
* Reject the value if nothing exists at the path.
|
|
147
|
+
* @defaultValue `false` (`true` when `type` is set)
|
|
148
|
+
*/
|
|
149
|
+
readonly mustExist?: boolean;
|
|
150
|
+
/**
|
|
151
|
+
* Require the path to be a directory. Implies existence unless
|
|
152
|
+
* `mustExist` is explicitly `false`, in which case a missing path
|
|
153
|
+
* passes and only an existing path is type-checked.
|
|
154
|
+
*/
|
|
155
|
+
readonly type: 'directory';
|
|
156
|
+
/**
|
|
157
|
+
* Create the directory (recursively) when nothing exists at the path.
|
|
158
|
+
* An existing non-directory path still fails the type check.
|
|
159
|
+
* @defaultValue `false`
|
|
160
|
+
*/
|
|
161
|
+
readonly create?: boolean;
|
|
162
|
+
}
|
|
163
|
+
/** Options accepted by `flag.path()`. */
|
|
164
|
+
type PathFlagOptions = FilePathFlagOptions | DirectoryPathFlagOptions;
|
|
165
|
+
/**
|
|
166
|
+
* Filesystem expectations attached by `flag.path()`.
|
|
167
|
+
*
|
|
168
|
+
* Checked after resolution (not during parse) via the runtime adapter, so
|
|
169
|
+
* `src/core` stays free of platform I/O and all sources (CLI, env, config)
|
|
170
|
+
* are validated identically.
|
|
171
|
+
*/
|
|
172
|
+
interface PathChecks {
|
|
173
|
+
/** Reject the value if nothing exists at the path. */
|
|
174
|
+
readonly mustExist: boolean;
|
|
175
|
+
/**
|
|
176
|
+
* Require the existing path to be a file or a directory. Implies
|
|
177
|
+
* existence when set, unless `mustExist` is `false`.
|
|
178
|
+
*/
|
|
179
|
+
readonly type: 'file' | 'directory' | undefined;
|
|
180
|
+
/** Create the directory (recursively) when nothing exists at the path. */
|
|
181
|
+
readonly create: boolean;
|
|
182
|
+
}
|
|
98
183
|
/** Runtime descriptor for a flag alias. */
|
|
99
184
|
interface FlagAlias {
|
|
100
185
|
/** Alias name without `-` / `--` prefix. */
|
|
@@ -102,6 +187,38 @@ interface FlagAlias {
|
|
|
102
187
|
/** Whether the alias is parser-only and hidden from user-facing surfaces. */
|
|
103
188
|
readonly hidden: boolean;
|
|
104
189
|
}
|
|
190
|
+
/**
|
|
191
|
+
* Negation settings for a boolean flag (set by `.negatable()`).
|
|
192
|
+
*
|
|
193
|
+
* The negated spelling and the positive form are two spellings of ONE
|
|
194
|
+
* logical flag: they share duplicate policy, and the last CLI occurrence
|
|
195
|
+
* wins across both. The negated spelling is presence-only — `--no-foo=x`
|
|
196
|
+
* is rejected.
|
|
197
|
+
*/
|
|
198
|
+
interface FlagNegation {
|
|
199
|
+
/**
|
|
200
|
+
* Explicit negated spelling without the `--` prefix (e.g. `'no-sandbox'`).
|
|
201
|
+
* `undefined` synthesizes `no-<flagName>` wherever the flag name is known.
|
|
202
|
+
*/
|
|
203
|
+
readonly alias: string | undefined;
|
|
204
|
+
/** Hide the negated spelling from help, completions, and suggestions. */
|
|
205
|
+
readonly hidden: boolean;
|
|
206
|
+
}
|
|
207
|
+
/**
|
|
208
|
+
* How repeated CLI occurrences of a singleton flag combine.
|
|
209
|
+
*
|
|
210
|
+
* - `'last'` — last occurrence wins (matches historic behavior)
|
|
211
|
+
* - `'first'` — first occurrence wins; later ones parse but are ignored
|
|
212
|
+
* - `'error'` — a second occurrence is a `ParseError` (`DUPLICATE_FLAG`)
|
|
213
|
+
*
|
|
214
|
+
* Applies to CLI token occurrences only — env/config/prompt/default
|
|
215
|
+
* resolution keeps its precedence semantics and never raises duplicates.
|
|
216
|
+
* Occurrences are counted per *logical* flag: aliases and the negated
|
|
217
|
+
* spelling all count toward the same flag.
|
|
218
|
+
*
|
|
219
|
+
* @defaultValue `'last'`
|
|
220
|
+
*/
|
|
221
|
+
type DuplicatePolicy = 'last' | 'first' | 'error';
|
|
105
222
|
/**
|
|
106
223
|
* The runtime descriptor stored inside every {@linkcode FlagBuilder}. Consumers (parser,
|
|
107
224
|
* help generator, resolution chain) read this to understand the flag's shape
|
|
@@ -131,12 +248,57 @@ interface FlagSchema {
|
|
|
131
248
|
* `true`, so `Infinity` is rejected even when no constraints object is set.
|
|
132
249
|
*/
|
|
133
250
|
readonly numberConstraints: NumberConstraints | undefined;
|
|
251
|
+
/**
|
|
252
|
+
* String constraints when `kind === 'string'` (`undefined` otherwise).
|
|
253
|
+
*
|
|
254
|
+
* Enforced at the parse and resolution boundaries, in fixed order:
|
|
255
|
+
* nonEmpty → minLength → maxLength → pattern.
|
|
256
|
+
*/
|
|
257
|
+
readonly stringConstraints: StringConstraints | undefined;
|
|
134
258
|
/** Element schema when `kind === 'array'`. */
|
|
135
259
|
readonly elementSchema: FlagSchema | undefined;
|
|
260
|
+
/**
|
|
261
|
+
* Value separator when `kind === 'array'` (`undefined` otherwise).
|
|
262
|
+
*
|
|
263
|
+
* When set, each CLI occurrence is split on this separator before element
|
|
264
|
+
* coercion, so `--tag a,b --tag c` yields `['a', 'b', 'c']`. Env and
|
|
265
|
+
* config string values use this separator too (default `','`).
|
|
266
|
+
*/
|
|
267
|
+
readonly separator: string | undefined;
|
|
268
|
+
/**
|
|
269
|
+
* Deduplicate resolved array values when `kind === 'array'`.
|
|
270
|
+
*
|
|
271
|
+
* Applied after all sources resolve, preserving first-seen order.
|
|
272
|
+
* Uses `SameValueZero` semantics (like `Set`).
|
|
273
|
+
*/
|
|
274
|
+
readonly unique: boolean;
|
|
275
|
+
/**
|
|
276
|
+
* Filesystem checks for path-valued flags (set by `flag.path()`).
|
|
277
|
+
*
|
|
278
|
+
* Validated after resolution through the runtime adapter.
|
|
279
|
+
*/
|
|
280
|
+
readonly pathChecks: PathChecks | undefined;
|
|
281
|
+
/**
|
|
282
|
+
* Help placeholder label (e.g. `'url'` renders as `<url>`).
|
|
283
|
+
*
|
|
284
|
+
* Set by the sugar factories (`flag.url()`, `flag.date()`, …) so help
|
|
285
|
+
* output names the expected value shape; `undefined` falls back to the
|
|
286
|
+
* kind-derived hint.
|
|
287
|
+
*/
|
|
288
|
+
readonly valueHint: string | undefined;
|
|
136
289
|
/** Interactive prompt configuration for v0.3+ resolution. */
|
|
137
290
|
readonly prompt: PromptConfig | undefined;
|
|
138
291
|
/** Custom parse function (only when `kind === 'custom'`). */
|
|
139
292
|
readonly parseFn: FlagParseFn<unknown> | undefined;
|
|
293
|
+
/**
|
|
294
|
+
* Standard Schema v1 validator applied to the resolved value.
|
|
295
|
+
*
|
|
296
|
+
* When set, the value from any source (CLI, env, config, prompt, default)
|
|
297
|
+
* is validated after resolution via `~standard.validate`. Sync and async
|
|
298
|
+
* validators are both awaited; issues surface as a `CONSTRAINT_VIOLATED`
|
|
299
|
+
* {@link ValidationError}. Only meaningful when `kind === 'custom'`.
|
|
300
|
+
*/
|
|
301
|
+
readonly standard: StandardSchemaV1 | undefined;
|
|
140
302
|
/**
|
|
141
303
|
* Deprecation marker.
|
|
142
304
|
*
|
|
@@ -158,6 +320,17 @@ interface FlagSchema {
|
|
|
158
320
|
* @defaultValue `false`
|
|
159
321
|
*/
|
|
160
322
|
readonly propagate: boolean;
|
|
323
|
+
/**
|
|
324
|
+
* Negation settings when `kind === 'boolean'` and `.negatable()` was
|
|
325
|
+
* called (`undefined` otherwise). See {@link FlagNegation}.
|
|
326
|
+
*/
|
|
327
|
+
readonly negation: FlagNegation | undefined;
|
|
328
|
+
/**
|
|
329
|
+
* Duplicate policy for repeated CLI occurrences. See {@link DuplicatePolicy}.
|
|
330
|
+
*
|
|
331
|
+
* @defaultValue `'last'`
|
|
332
|
+
*/
|
|
333
|
+
readonly duplicates: DuplicatePolicy;
|
|
161
334
|
}
|
|
162
335
|
/**
|
|
163
336
|
* Low-level overrides accepted by {@link createSchema}.
|
|
@@ -193,6 +366,18 @@ declare function getFlagAliasNames(schema: FlagSchema, options?: {
|
|
|
193
366
|
readonly includeHidden?: boolean;
|
|
194
367
|
readonly kind?: 'all' | 'short' | 'long';
|
|
195
368
|
}): readonly string[];
|
|
369
|
+
/**
|
|
370
|
+
* Effective negated spelling for a flag, or `undefined` when not negatable.
|
|
371
|
+
*
|
|
372
|
+
* The builder cannot know its flag name, so a default (`no-<name>`) is
|
|
373
|
+
* synthesized here — everywhere the canonical name is known (parser, help,
|
|
374
|
+
* completions, collision validation).
|
|
375
|
+
*
|
|
376
|
+
* @param name - Canonical flag name.
|
|
377
|
+
* @param schema - Flag schema (read for {@link FlagNegation}).
|
|
378
|
+
* @returns The negated spelling without the `--` prefix.
|
|
379
|
+
*/
|
|
380
|
+
declare function getFlagNegatedName(name: string, schema: FlagSchema): string | undefined;
|
|
196
381
|
/**
|
|
197
382
|
* Create a raw {@link FlagSchema} object with sensible defaults.
|
|
198
383
|
*
|
|
@@ -303,7 +488,7 @@ declare class FlagBuilder<C extends FlagConfig> {
|
|
|
303
488
|
*/
|
|
304
489
|
alias(name: string, options?: {
|
|
305
490
|
hidden?: boolean;
|
|
306
|
-
}): FlagBuilder<C
|
|
491
|
+
}): FlagBuilder<WithoutElementEligibility<C>>;
|
|
307
492
|
/**
|
|
308
493
|
* Bind to an environment variable (resolved in v0.2+).
|
|
309
494
|
*
|
|
@@ -318,7 +503,7 @@ declare class FlagBuilder<C extends FlagConfig> {
|
|
|
318
503
|
* // $ mycli request --api-key sk-456 → apiKey = 'sk-456' (CLI wins)
|
|
319
504
|
* ```
|
|
320
505
|
*/
|
|
321
|
-
env(varName: string): FlagBuilder<C
|
|
506
|
+
env(varName: string): FlagBuilder<WithoutElementEligibility<C>>;
|
|
322
507
|
/**
|
|
323
508
|
* Bind to a dotted config path (resolved in v0.2+).
|
|
324
509
|
*
|
|
@@ -335,14 +520,14 @@ declare class FlagBuilder<C extends FlagConfig> {
|
|
|
335
520
|
* // # → CLI flag wins
|
|
336
521
|
* ```
|
|
337
522
|
*/
|
|
338
|
-
config(path: string): FlagBuilder<C
|
|
523
|
+
config(path: string): FlagBuilder<WithoutElementEligibility<C>>;
|
|
339
524
|
/**
|
|
340
525
|
* Human-readable description shown in help output.
|
|
341
526
|
*
|
|
342
527
|
* @param description - Text displayed next to the flag in `--help`.
|
|
343
528
|
* @returns The builder (for chaining).
|
|
344
529
|
*/
|
|
345
|
-
describe(description: string): FlagBuilder<C
|
|
530
|
+
describe(description: string): FlagBuilder<WithoutElementEligibility<C>>;
|
|
346
531
|
/**
|
|
347
532
|
* Attach interactive prompt configuration for v0.3+ resolution.
|
|
348
533
|
*
|
|
@@ -362,7 +547,7 @@ declare class FlagBuilder<C extends FlagConfig> {
|
|
|
362
547
|
* // $ mycli init --name foo → skips prompt, uses CLI value
|
|
363
548
|
* ```
|
|
364
549
|
*/
|
|
365
|
-
prompt(config: AllowedPromptConfig<C>): FlagBuilder<C
|
|
550
|
+
prompt(config: AllowedPromptConfig<C>): FlagBuilder<WithoutElementEligibility<C>>;
|
|
366
551
|
/**
|
|
367
552
|
* Mark this flag as deprecated.
|
|
368
553
|
*
|
|
@@ -382,7 +567,7 @@ declare class FlagBuilder<C extends FlagConfig> {
|
|
|
382
567
|
* // ⚠ --dest is deprecated: Use --target instead
|
|
383
568
|
* ```
|
|
384
569
|
*/
|
|
385
|
-
deprecated(message?: string): FlagBuilder<C
|
|
570
|
+
deprecated(message?: string): FlagBuilder<WithoutElementEligibility<C>>;
|
|
386
571
|
/**
|
|
387
572
|
* Mark this flag as propagated to subcommands.
|
|
388
573
|
*
|
|
@@ -404,7 +589,7 @@ declare class FlagBuilder<C extends FlagConfig> {
|
|
|
404
589
|
* // # → same, inherited from parent
|
|
405
590
|
* ```
|
|
406
591
|
*/
|
|
407
|
-
propagate(): FlagBuilder<C
|
|
592
|
+
propagate(): FlagBuilder<WithoutElementEligibility<C>>;
|
|
408
593
|
/**
|
|
409
594
|
* Require an integer value. Composes with other numeric constraints.
|
|
410
595
|
*
|
|
@@ -470,6 +655,150 @@ declare class FlagBuilder<C extends FlagConfig> {
|
|
|
470
655
|
finite(this: FlagBuilder<C & {
|
|
471
656
|
readonly flagKind: 'number';
|
|
472
657
|
}>, allow?: boolean): FlagBuilder<C>;
|
|
658
|
+
/**
|
|
659
|
+
* Reject empty strings. Composes with other string constraints.
|
|
660
|
+
*
|
|
661
|
+
* @param value - Whether to reject empty strings.
|
|
662
|
+
* @defaultValue `true`
|
|
663
|
+
* @returns The builder (for chaining).
|
|
664
|
+
*
|
|
665
|
+
* @example
|
|
666
|
+
* ```ts
|
|
667
|
+
* flag.string().nonEmpty() // rejects '', accepts 'x'
|
|
668
|
+
* ```
|
|
669
|
+
*/
|
|
670
|
+
nonEmpty(this: FlagBuilder<C & {
|
|
671
|
+
readonly flagKind: 'string';
|
|
672
|
+
}>, value?: boolean): FlagBuilder<C>;
|
|
673
|
+
/**
|
|
674
|
+
* Set an inclusive minimum length (UTF-16 code units). Composes with other
|
|
675
|
+
* string constraints; a later call overrides an earlier `minLength`.
|
|
676
|
+
*
|
|
677
|
+
* @param value - Inclusive minimum length.
|
|
678
|
+
* @returns The builder (for chaining).
|
|
679
|
+
*
|
|
680
|
+
* @example
|
|
681
|
+
* ```ts
|
|
682
|
+
* flag.string().minLength(3) // rejects 'ab', accepts 'abc'
|
|
683
|
+
* ```
|
|
684
|
+
*/
|
|
685
|
+
minLength(this: FlagBuilder<C & {
|
|
686
|
+
readonly flagKind: 'string';
|
|
687
|
+
}>, value: number): FlagBuilder<C>;
|
|
688
|
+
/**
|
|
689
|
+
* Set an inclusive maximum length (UTF-16 code units). Composes with other
|
|
690
|
+
* string constraints; a later call overrides an earlier `maxLength`.
|
|
691
|
+
*
|
|
692
|
+
* @param value - Inclusive maximum length.
|
|
693
|
+
* @returns The builder (for chaining).
|
|
694
|
+
*
|
|
695
|
+
* @example
|
|
696
|
+
* ```ts
|
|
697
|
+
* flag.string().maxLength(8) // rejects 9+ chars
|
|
698
|
+
* ```
|
|
699
|
+
*/
|
|
700
|
+
maxLength(this: FlagBuilder<C & {
|
|
701
|
+
readonly flagKind: 'string';
|
|
702
|
+
}>, value: number): FlagBuilder<C>;
|
|
703
|
+
/**
|
|
704
|
+
* Require the value to match a regular expression. Anchor with `^`/`$`
|
|
705
|
+
* for full-string matching. Composes with other string constraints.
|
|
706
|
+
*
|
|
707
|
+
* @param value - Pattern the value must match.
|
|
708
|
+
* @returns The builder (for chaining).
|
|
709
|
+
*
|
|
710
|
+
* @example
|
|
711
|
+
* ```ts
|
|
712
|
+
* flag.string().pattern(/^ghp_/) // rejects 'abc', accepts 'ghp_x'
|
|
713
|
+
* ```
|
|
714
|
+
*/
|
|
715
|
+
pattern(this: FlagBuilder<C & {
|
|
716
|
+
readonly flagKind: 'string';
|
|
717
|
+
}>, value: RegExp): FlagBuilder<C>;
|
|
718
|
+
/**
|
|
719
|
+
* Split each CLI occurrence on a separator before element coercion, so
|
|
720
|
+
* `--tag a,b --tag c` resolves to `['a', 'b', 'c']`. Elements are coerced
|
|
721
|
+
* (and rejected) individually with the element schema's own error format.
|
|
722
|
+
*
|
|
723
|
+
* Env and config string values are split on the same separator (their
|
|
724
|
+
* default split is `','` even without this modifier).
|
|
725
|
+
*
|
|
726
|
+
* @param value - Separator string (e.g. `','`).
|
|
727
|
+
* @returns The builder (for chaining).
|
|
728
|
+
*
|
|
729
|
+
* @example
|
|
730
|
+
* ```ts
|
|
731
|
+
* flag.array(flag.enum(['us', 'eu', 'ap'])).separator(',')
|
|
732
|
+
* // --region us,eu --region ap → ['us', 'eu', 'ap']
|
|
733
|
+
* ```
|
|
734
|
+
*/
|
|
735
|
+
separator(this: FlagBuilder<C & {
|
|
736
|
+
readonly flagKind: 'array';
|
|
737
|
+
}>, value: string): FlagBuilder<C>;
|
|
738
|
+
/**
|
|
739
|
+
* Deduplicate the resolved array, preserving first-seen order. Applied
|
|
740
|
+
* after all sources resolve, using `SameValueZero` semantics (like `Set`).
|
|
741
|
+
*
|
|
742
|
+
* @param value - Whether to deduplicate.
|
|
743
|
+
* @defaultValue `true`
|
|
744
|
+
* @returns The builder (for chaining).
|
|
745
|
+
*
|
|
746
|
+
* @example
|
|
747
|
+
* ```ts
|
|
748
|
+
* flag.array(flag.string()).separator(',').unique()
|
|
749
|
+
* // --tag a,a --tag a → ['a']
|
|
750
|
+
* ```
|
|
751
|
+
*/
|
|
752
|
+
unique(this: FlagBuilder<C & {
|
|
753
|
+
readonly flagKind: 'array';
|
|
754
|
+
}>, value?: boolean): FlagBuilder<C>;
|
|
755
|
+
/**
|
|
756
|
+
* Accept a negated spelling (`--no-<name>`) that sets the flag to `false`.
|
|
757
|
+
*
|
|
758
|
+
* Both spellings are ONE logical flag: the last CLI occurrence wins across
|
|
759
|
+
* them, and they share the duplicate policy. The negated spelling is
|
|
760
|
+
* presence-only — `--no-<name>=true` is rejected. Help renders the flag as
|
|
761
|
+
* `--[no-]<name>` (or lists a custom alias); env/config/prompt/default
|
|
762
|
+
* resolution is unaffected.
|
|
763
|
+
*
|
|
764
|
+
* @param options - Optional custom spelling (`alias`, without `--`) and
|
|
765
|
+
* `hidden` to keep the negated spelling parseable but unadvertised.
|
|
766
|
+
* @returns The builder (for chaining).
|
|
767
|
+
*
|
|
768
|
+
* @example
|
|
769
|
+
* ```ts
|
|
770
|
+
* flag.boolean().default(true).negatable()
|
|
771
|
+
* // $ mycli build --no-sandbox → sandbox = false
|
|
772
|
+
* // $ mycli build --sandbox → sandbox = true
|
|
773
|
+
* ```
|
|
774
|
+
*/
|
|
775
|
+
negatable(this: FlagBuilder<C & {
|
|
776
|
+
readonly flagKind: 'boolean';
|
|
777
|
+
}>, options?: {
|
|
778
|
+
alias?: string;
|
|
779
|
+
hidden?: boolean;
|
|
780
|
+
}): FlagBuilder<WithoutElementEligibility<C>>;
|
|
781
|
+
/**
|
|
782
|
+
* Set how repeated CLI occurrences of this flag combine.
|
|
783
|
+
*
|
|
784
|
+
* Counted per logical flag — aliases and the negated spelling all count
|
|
785
|
+
* toward the same flag. CLI tokens only: env/config/prompt/default
|
|
786
|
+
* resolution keeps its precedence semantics. Not available on `array`,
|
|
787
|
+
* `count`, or `keyValue` flags, which inherently accumulate.
|
|
788
|
+
*
|
|
789
|
+
* @param policy - `'last'` (default), `'first'`, or `'error'`.
|
|
790
|
+
* @returns The builder (for chaining).
|
|
791
|
+
*
|
|
792
|
+
* @example
|
|
793
|
+
* ```ts
|
|
794
|
+
* flag.enum(['session', 'same-dir', 'worktree']).duplicates('error')
|
|
795
|
+
* // $ mycli run --spawn session --spawn worktree
|
|
796
|
+
* // # → Error: Flag --spawn may only be specified once
|
|
797
|
+
* ```
|
|
798
|
+
*/
|
|
799
|
+
duplicates(this: FlagBuilder<C & {
|
|
800
|
+
readonly flagKind: 'boolean' | 'string' | 'number' | 'enum' | 'custom';
|
|
801
|
+
}>, policy: DuplicatePolicy): FlagBuilder<WithoutElementEligibility<C>>;
|
|
473
802
|
}
|
|
474
803
|
/**
|
|
475
804
|
* Factory that creates {@link FlagBuilder} instances seeded with the correct
|
|
@@ -477,15 +806,30 @@ declare class FlagBuilder<C extends FlagConfig> {
|
|
|
477
806
|
*/
|
|
478
807
|
interface FlagFactory {
|
|
479
808
|
/**
|
|
480
|
-
* String-valued flag.
|
|
809
|
+
* String-valued flag, with optional string constraints.
|
|
810
|
+
*
|
|
811
|
+
* Constraints are enforced at the parse and resolution boundaries, in
|
|
812
|
+
* fixed order: nonEmpty → minLength → maxLength → pattern. They also
|
|
813
|
+
* compose via chained methods (`.nonEmpty()`, `.minLength()`,
|
|
814
|
+
* `.maxLength()`, `.pattern()`), which override values set here.
|
|
481
815
|
*
|
|
816
|
+
* @param constraints - Optional string constraints.
|
|
817
|
+
* @defaultValue `undefined` (no constraints)
|
|
482
818
|
* @returns A {@link FlagBuilder} for `string` values.
|
|
819
|
+
*
|
|
820
|
+
* @example
|
|
821
|
+
* ```ts
|
|
822
|
+
* flag.string() // any string
|
|
823
|
+
* flag.string({ nonEmpty: true }) // rejects ''
|
|
824
|
+
* flag.string({ pattern: /^ghp_/ }) // token shapes
|
|
825
|
+
* ```
|
|
483
826
|
*/
|
|
484
|
-
string(): FlagBuilder<{
|
|
827
|
+
string(constraints?: StringConstraints): FlagBuilder<{
|
|
485
828
|
readonly valueType: string;
|
|
486
829
|
readonly presence: 'optional';
|
|
487
830
|
readonly optionalFallback: 'undefined';
|
|
488
831
|
readonly flagKind: 'string';
|
|
832
|
+
readonly elementEligible: true;
|
|
489
833
|
}>;
|
|
490
834
|
/**
|
|
491
835
|
* Number-valued flag, with optional numeric constraints.
|
|
@@ -514,6 +858,7 @@ interface FlagFactory {
|
|
|
514
858
|
readonly presence: 'optional';
|
|
515
859
|
readonly optionalFallback: 'undefined';
|
|
516
860
|
readonly flagKind: 'number';
|
|
861
|
+
readonly elementEligible: true;
|
|
517
862
|
}>;
|
|
518
863
|
/**
|
|
519
864
|
* Boolean flag. Implicitly defaults to `false` — the only flag kind where
|
|
@@ -526,6 +871,7 @@ interface FlagFactory {
|
|
|
526
871
|
readonly presence: 'defaulted';
|
|
527
872
|
readonly optionalFallback: 'undefined';
|
|
528
873
|
readonly flagKind: 'boolean';
|
|
874
|
+
readonly elementEligible: true;
|
|
529
875
|
}>;
|
|
530
876
|
/**
|
|
531
877
|
* Enum flag with literal type inference.
|
|
@@ -547,6 +893,7 @@ interface FlagFactory {
|
|
|
547
893
|
readonly presence: 'optional';
|
|
548
894
|
readonly optionalFallback: 'undefined';
|
|
549
895
|
readonly flagKind: 'enum';
|
|
896
|
+
readonly elementEligible: true;
|
|
550
897
|
}>;
|
|
551
898
|
/**
|
|
552
899
|
* Array flag — collects multiple values of the same element type.
|
|
@@ -560,11 +907,39 @@ interface FlagFactory {
|
|
|
560
907
|
* @param element - {@link FlagBuilder} describing the element type.
|
|
561
908
|
* @returns A {@link FlagBuilder} for arrays of the element type.
|
|
562
909
|
*/
|
|
563
|
-
array<E extends FlagConfig
|
|
910
|
+
array<E extends FlagConfig & {
|
|
911
|
+
readonly elementEligible: true;
|
|
912
|
+
}>(element: FlagBuilder<E>): FlagBuilder<{
|
|
564
913
|
readonly valueType: E['valueType'][];
|
|
565
914
|
readonly presence: 'optional';
|
|
566
915
|
readonly optionalFallback: 'empty-array';
|
|
567
916
|
readonly flagKind: 'array';
|
|
917
|
+
readonly elementEligible: false;
|
|
918
|
+
}>;
|
|
919
|
+
/**
|
|
920
|
+
* Custom flag validated by a Standard Schema v1 validator (zod, valibot,
|
|
921
|
+
* arktype, …). The resolved value from any source is validated after
|
|
922
|
+
* resolution; the flag's value type is the validator's output type.
|
|
923
|
+
*
|
|
924
|
+
* Sync and async validators are both supported. Validation issues surface
|
|
925
|
+
* as a `CONSTRAINT_VIOLATED` error naming the flag.
|
|
926
|
+
*
|
|
927
|
+
* @example
|
|
928
|
+
* ```ts
|
|
929
|
+
* import { z } from 'zod';
|
|
930
|
+
* flag.custom(z.string().url())
|
|
931
|
+
* // inferred type: string | undefined
|
|
932
|
+
* ```
|
|
933
|
+
*
|
|
934
|
+
* @param schema - A Standard Schema v1 validator.
|
|
935
|
+
* @returns A {@link FlagBuilder} whose value type is the validator's output.
|
|
936
|
+
*/
|
|
937
|
+
custom<S extends StandardSchemaV1>(schema: S): FlagBuilder<{
|
|
938
|
+
readonly valueType: InferStandardOutput<S>;
|
|
939
|
+
readonly presence: 'optional';
|
|
940
|
+
readonly optionalFallback: 'undefined';
|
|
941
|
+
readonly flagKind: 'custom';
|
|
942
|
+
readonly elementEligible: true;
|
|
568
943
|
}>;
|
|
569
944
|
/**
|
|
570
945
|
* Custom-parsed flag. The parse function receives the raw value and must
|
|
@@ -600,6 +975,165 @@ interface FlagFactory {
|
|
|
600
975
|
readonly presence: 'optional';
|
|
601
976
|
readonly optionalFallback: 'undefined';
|
|
602
977
|
readonly flagKind: 'custom';
|
|
978
|
+
readonly elementEligible: true;
|
|
979
|
+
}>;
|
|
980
|
+
/**
|
|
981
|
+
* URL-valued flag. Parses into a `URL`; invalid URLs are rejected with an
|
|
982
|
+
* `INVALID_VALUE` error naming the flag.
|
|
983
|
+
*
|
|
984
|
+
* @param options - Optional protocol allowlist (without trailing colon).
|
|
985
|
+
* @returns A {@link FlagBuilder} for `URL` values.
|
|
986
|
+
*
|
|
987
|
+
* @example
|
|
988
|
+
* ```ts
|
|
989
|
+
* flag.url() // any URL
|
|
990
|
+
* flag.url({ protocols: ['https'] }) // https only
|
|
991
|
+
* ```
|
|
992
|
+
*/
|
|
993
|
+
url(options?: UrlFlagOptions): FlagBuilder<{
|
|
994
|
+
readonly valueType: URL;
|
|
995
|
+
readonly presence: 'optional';
|
|
996
|
+
readonly optionalFallback: 'undefined';
|
|
997
|
+
readonly flagKind: 'custom';
|
|
998
|
+
readonly elementEligible: true;
|
|
999
|
+
}>;
|
|
1000
|
+
/**
|
|
1001
|
+
* Path-valued flag. The value stays a `string`; optional filesystem
|
|
1002
|
+
* checks run **after resolution** through the runtime adapter, so CLI,
|
|
1003
|
+
* env, and config values are validated identically.
|
|
1004
|
+
*
|
|
1005
|
+
* @param options - Optional existence/type checks. `type` implies
|
|
1006
|
+
* existence unless `mustExist` is explicitly `false`.
|
|
1007
|
+
* @returns A {@link FlagBuilder} for path strings.
|
|
1008
|
+
*
|
|
1009
|
+
* @example
|
|
1010
|
+
* ```ts
|
|
1011
|
+
* flag.path() // any string, help shows <path>
|
|
1012
|
+
* flag.path({ mustExist: true }) // rejects missing paths
|
|
1013
|
+
* flag.path({ type: 'directory' }) // must exist and be a directory
|
|
1014
|
+
* flag.path({ type: 'directory', mustExist: false })
|
|
1015
|
+
* // missing passes; existing must be a directory
|
|
1016
|
+
* flag.path({ type: 'directory', create: true })
|
|
1017
|
+
* // created recursively when missing
|
|
1018
|
+
* ```
|
|
1019
|
+
*/
|
|
1020
|
+
path(options?: PathFlagOptions): FlagBuilder<{
|
|
1021
|
+
readonly valueType: string;
|
|
1022
|
+
readonly presence: 'optional';
|
|
1023
|
+
readonly optionalFallback: 'undefined';
|
|
1024
|
+
readonly flagKind: 'string';
|
|
1025
|
+
readonly elementEligible: false;
|
|
1026
|
+
}>;
|
|
1027
|
+
/**
|
|
1028
|
+
* Date-valued flag. Accepts strict ISO-8601 (`2026-07-10`,
|
|
1029
|
+
* `2026-07-10T14:30:00Z`) and parses into a `Date`. Lenient `Date.parse`
|
|
1030
|
+
* inputs (`'0'`, `'March 5'`) and calendar-invalid dates (`2026-02-31`)
|
|
1031
|
+
* are rejected.
|
|
1032
|
+
*
|
|
1033
|
+
* Returns `Date` (not `Temporal`) because the supported runtimes do not
|
|
1034
|
+
* all ship Temporal yet; use `flag.custom()` with `Temporal.PlainDate.from`
|
|
1035
|
+
* where the target runtime has it.
|
|
1036
|
+
*
|
|
1037
|
+
* @param options - Optional inclusive `min`/`max` date bounds.
|
|
1038
|
+
* @returns A {@link FlagBuilder} for `Date` values.
|
|
1039
|
+
*
|
|
1040
|
+
* @example
|
|
1041
|
+
* ```ts
|
|
1042
|
+
* flag.date()
|
|
1043
|
+
* flag.date({ min: new Date('2020-01-01') })
|
|
1044
|
+
* ```
|
|
1045
|
+
*/
|
|
1046
|
+
date(options?: DateFlagOptions): FlagBuilder<{
|
|
1047
|
+
readonly valueType: Date;
|
|
1048
|
+
readonly presence: 'optional';
|
|
1049
|
+
readonly optionalFallback: 'undefined';
|
|
1050
|
+
readonly flagKind: 'custom';
|
|
1051
|
+
readonly elementEligible: true;
|
|
1052
|
+
}>;
|
|
1053
|
+
/**
|
|
1054
|
+
* Duration flag. Accepts `'30s'`, `'5m'`, `'1.5h'`, `'250ms'`, `'2d'`,
|
|
1055
|
+
* compounds like `'1h30m'`, or a bare millisecond count, and resolves to
|
|
1056
|
+
* **milliseconds**.
|
|
1057
|
+
*
|
|
1058
|
+
* @returns A {@link FlagBuilder} for duration values in milliseconds.
|
|
1059
|
+
*
|
|
1060
|
+
* @example
|
|
1061
|
+
* ```ts
|
|
1062
|
+
* flag.duration().default(30_000) // --timeout 45s → 45000
|
|
1063
|
+
* ```
|
|
1064
|
+
*/
|
|
1065
|
+
duration(): FlagBuilder<{
|
|
1066
|
+
readonly valueType: number;
|
|
1067
|
+
readonly presence: 'optional';
|
|
1068
|
+
readonly optionalFallback: 'undefined';
|
|
1069
|
+
readonly flagKind: 'custom';
|
|
1070
|
+
readonly elementEligible: true;
|
|
1071
|
+
}>;
|
|
1072
|
+
/**
|
|
1073
|
+
* Byte-size flag. Accepts `'512mb'`, `'1.5gb'`, `'64kb'`, `'100b'` or a
|
|
1074
|
+
* bare byte count, and resolves to **bytes**. Units are binary
|
|
1075
|
+
* (`1kb` = 1024) and case-insensitive.
|
|
1076
|
+
*
|
|
1077
|
+
* @returns A {@link FlagBuilder} for sizes in bytes.
|
|
1078
|
+
*
|
|
1079
|
+
* @example
|
|
1080
|
+
* ```ts
|
|
1081
|
+
* flag.bytes().default(10 * 1024 ** 2) // --max-size 512kb → 524288
|
|
1082
|
+
* ```
|
|
1083
|
+
*/
|
|
1084
|
+
bytes(): FlagBuilder<{
|
|
1085
|
+
readonly valueType: number;
|
|
1086
|
+
readonly presence: 'optional';
|
|
1087
|
+
readonly optionalFallback: 'undefined';
|
|
1088
|
+
readonly flagKind: 'custom';
|
|
1089
|
+
readonly elementEligible: true;
|
|
1090
|
+
}>;
|
|
1091
|
+
/**
|
|
1092
|
+
* Count flag — resolves to how many times the flag appears. `-vvv`,
|
|
1093
|
+
* `-v -v -v`, and `--verbose --verbose --verbose` all yield `3`; absent
|
|
1094
|
+
* yields `0`. An explicit value (`--verbose=2`, env, config) sets the
|
|
1095
|
+
* count directly.
|
|
1096
|
+
*
|
|
1097
|
+
* Not promptable.
|
|
1098
|
+
*
|
|
1099
|
+
* @returns A {@link FlagBuilder} for occurrence counts (defaulted to `0`).
|
|
1100
|
+
*
|
|
1101
|
+
* @example
|
|
1102
|
+
* ```ts
|
|
1103
|
+
* flag.count().alias('v').describe('Increase verbosity')
|
|
1104
|
+
* // $ mycli build -vv → verbose = 2
|
|
1105
|
+
* ```
|
|
1106
|
+
*/
|
|
1107
|
+
count(): FlagBuilder<{
|
|
1108
|
+
readonly valueType: number;
|
|
1109
|
+
readonly presence: 'defaulted';
|
|
1110
|
+
readonly optionalFallback: 'undefined';
|
|
1111
|
+
readonly flagKind: 'count';
|
|
1112
|
+
readonly elementEligible: false;
|
|
1113
|
+
}>;
|
|
1114
|
+
/**
|
|
1115
|
+
* Key-value flag — repeated `KEY=VALUE` occurrences merge into a
|
|
1116
|
+
* `Record<string, string>` (docker/kubectl `--env` style). The value is
|
|
1117
|
+
* split at the **first** `=`, so `--env A=b=c` yields `{ A: 'b=c' }`.
|
|
1118
|
+
* Later occurrences of the same key win. Absent resolves to `{}`.
|
|
1119
|
+
*
|
|
1120
|
+
* Env vars accept separator-joined pairs (`A=1,B=2`); config files accept
|
|
1121
|
+
* a plain object. Not promptable.
|
|
1122
|
+
*
|
|
1123
|
+
* @returns A {@link FlagBuilder} for `Record<string, string>` values.
|
|
1124
|
+
*
|
|
1125
|
+
* @example
|
|
1126
|
+
* ```ts
|
|
1127
|
+
* flag.keyValue().alias('e').describe('Environment variables')
|
|
1128
|
+
* // $ mycli run -e A=1 -e B=2 → env = { A: '1', B: '2' }
|
|
1129
|
+
* ```
|
|
1130
|
+
*/
|
|
1131
|
+
keyValue(): FlagBuilder<{
|
|
1132
|
+
readonly valueType: Record<string, string>;
|
|
1133
|
+
readonly presence: 'optional';
|
|
1134
|
+
readonly optionalFallback: 'empty-object';
|
|
1135
|
+
readonly flagKind: 'keyValue';
|
|
1136
|
+
readonly elementEligible: false;
|
|
603
1137
|
}>;
|
|
604
1138
|
}
|
|
605
1139
|
/**
|
|
@@ -608,4 +1142,4 @@ interface FlagFactory {
|
|
|
608
1142
|
*/
|
|
609
1143
|
declare const flag: FlagFactory;
|
|
610
1144
|
//#endregion
|
|
611
|
-
export { type AllowedPromptConfig, type ConfirmPromptConfig, FLAG_KINDS, FLAG_PRESENCES, type FlagAlias, FlagBuilder, type FlagConfig, type FlagFactory, type FlagKind, type FlagParseFn, type FlagPresence, type FlagSchema, type FlagSchemaOverrides, type InferFlag, type InferFlags, type InputPromptConfig, type MultiselectPromptConfig, type OptionalFallback, PROMPT_KINDS, type PromptConfig, type PromptConfigBase, type PromptKind, type PromptResult, type ResolvedValue, type SelectChoice, type SelectPromptConfig, type WithPresence, createSchema, flag, getFlagAliasNames, normalizeFlagAlias, normalizeFlagAliases };
|
|
1145
|
+
export { type AllowedPromptConfig, type ConfirmPromptConfig, type DateFlagOptions, type DuplicatePolicy, FLAG_KINDS, FLAG_PRESENCES, type FlagAlias, FlagBuilder, type FlagConfig, type FlagFactory, type FlagKind, type FlagNegation, type FlagParseFn, type FlagPresence, type FlagSchema, type FlagSchemaOverrides, type InferFlag, type InferFlags, type InputPromptConfig, type MultiselectPromptConfig, type OptionalFallback, PROMPT_KINDS, type PathChecks, type PathFlagOptions, type PromptConfig, type PromptConfigBase, type PromptConfigByFlagKind, type PromptKind, type PromptResult, type ResolvedValue, type SelectChoice, type SelectPromptConfig, type StringConstraintViolation, type StringConstraints, type UrlFlagOptions, type WithPresence, type WithoutElementEligibility, createSchema, flag, getFlagAliasNames, getFlagNegatedName, normalizeFlagAlias, normalizeFlagAliases };
|