@kjanat/dreamcli 3.0.0-rc.8 → 3.0.0
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 +271 -1
- package/README.md +30 -13
- package/dist/core/cli/dispatch.mjs +0 -11
- package/dist/core/cli/index.d.mts +133 -9
- package/dist/core/cli/index.mjs +119 -27
- package/dist/core/cli/planner.mjs +7 -1
- package/dist/core/cli/root-help.mjs +5 -0
- package/dist/core/cli/runtime-preflight.d.mts +4 -0
- package/dist/core/cli/runtime-preflight.mjs +5 -3
- package/dist/core/completion/shells/shared.mjs +1 -0
- package/dist/core/config/index.d.mts +43 -12
- package/dist/core/config/index.mjs +55 -16
- package/dist/core/config/package-json.d.mts +1 -0
- package/dist/core/errors/index.d.mts +2 -2
- package/dist/core/execution/index.mjs +13 -1
- package/dist/core/help/ansi.d.mts +11 -5
- package/dist/core/help/ansi.mjs +14 -16
- package/dist/core/help/index.d.mts +22 -0
- package/dist/core/help/index.mjs +75 -25
- package/dist/core/json-schema/index.d.mts +20 -8
- package/dist/core/json-schema/index.mjs +285 -87
- package/dist/core/json-schema/meta-descriptions.generated.d.mts +40 -40
- package/dist/core/output/contracts.d.mts +5 -5
- package/dist/core/output/contracts.mjs +1 -1
- package/dist/core/output/index.d.mts +38 -1
- package/dist/core/output/index.mjs +37 -2
- package/dist/core/parse/index.mjs +9 -6
- package/dist/core/resolve/contracts.d.mts +7 -2
- package/dist/core/resolve/flags.d.mts +3 -1
- package/dist/core/resolve/flags.mjs +29 -12
- package/dist/core/resolve/index.mjs +6 -1
- package/dist/core/resolve/property.d.mts +1 -1
- package/dist/core/resolve/standard.d.mts +24 -0
- package/dist/core/resolve/standard.mjs +114 -0
- package/dist/core/schema/arg.d.mts +37 -2
- package/dist/core/schema/arg.mjs +5 -2
- package/dist/core/schema/command.d.mts +49 -7
- package/dist/core/schema/command.mjs +15 -5
- package/dist/core/schema/flag.d.mts +124 -19
- package/dist/core/schema/flag.mjs +7 -3
- package/dist/core/schema/index.d.mts +3 -2
- package/dist/core/schema/prompt.d.mts +1 -1
- package/dist/core/schema/run.d.mts +7 -0
- package/dist/core/schema/standard.d.mts +100 -0
- package/dist/core/schema/standard.mjs +15 -0
- package/dist/core/testkit/index.d.mts +7 -5
- package/dist/core/testkit/index.mjs +12 -7
- package/dist/index.d.mts +6 -5
- package/dist/index.mjs +5 -5
- package/dist/runtime/adapter.d.mts +33 -0
- package/dist/runtime/adapter.mjs +6 -1
- package/dist/runtime/deno.d.mts +4 -0
- package/dist/runtime/deno.mjs +4 -1
- package/dist/runtime/node.mjs +9 -1
- package/dist/version.mjs +2 -2
- package/dreamcli.schema.json +83 -1
- package/examples/basic.ts +2 -2
- package/examples/flag-types.ts +79 -0
- 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/help-config.ts +43 -0
- package/examples/json-mode.ts +8 -4
- package/examples/middleware.ts +1 -1
- package/examples/output-extras.ts +46 -0
- package/examples/parser-control.ts +40 -0
- package/examples/pwsh-demo/package.json +1 -1
- package/examples/pwsh-demo/src/main.ts +1 -1
- package/examples/standard-schema.ts +45 -0
- package/examples/transport-launcher.ts +10 -10
- package/package.json +25 -31
- 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 -29
- package/dist/core/schema-dsl/to-json-schema.mjs +0 -74
|
@@ -6,22 +6,22 @@
|
|
|
6
6
|
*/
|
|
7
7
|
declare const definitionMetaSchemaDescriptions: {
|
|
8
8
|
readonly root: {
|
|
9
|
-
readonly description:
|
|
9
|
+
readonly description: "Runtime descriptor for the CLI program.\n\nStores the program name, version, description, and registered commands.\\\nBuilt incrementally by CLIBuilder.";
|
|
10
10
|
readonly properties: {
|
|
11
11
|
readonly name: {
|
|
12
|
-
readonly description:
|
|
12
|
+
readonly description: "Program name (used in help text, usage lines, and completion scripts).";
|
|
13
13
|
};
|
|
14
14
|
readonly version: {
|
|
15
|
-
readonly description:
|
|
15
|
+
readonly description: "Program version (shown by `--version`).";
|
|
16
16
|
};
|
|
17
17
|
readonly description: {
|
|
18
|
-
readonly description:
|
|
18
|
+
readonly description: "Program description (shown in root help).";
|
|
19
19
|
};
|
|
20
20
|
readonly defaultCommand: {
|
|
21
|
-
readonly description:
|
|
21
|
+
readonly description: "Default command dispatched when no subcommand matches.\n\nWhen set, the CLI root behaves like a hybrid command group: subcommands\ndispatch by name as usual, but empty argv or flags-only argv falls\nthrough to this command instead of showing root help.\n\nSet via the .default() builder method.";
|
|
22
22
|
};
|
|
23
23
|
readonly commands: {
|
|
24
|
-
readonly description:
|
|
24
|
+
readonly description: "Registered commands (type-erased for heterogeneous storage).";
|
|
25
25
|
};
|
|
26
26
|
};
|
|
27
27
|
};
|
|
@@ -33,25 +33,25 @@ declare const definitionMetaSchemaDescriptions: {
|
|
|
33
33
|
readonly description: "The command name (used for dispatch, e.g. `'deploy'`).";
|
|
34
34
|
};
|
|
35
35
|
readonly description: {
|
|
36
|
-
readonly description:
|
|
36
|
+
readonly description: "Human-readable description for help text.";
|
|
37
37
|
};
|
|
38
38
|
readonly aliases: {
|
|
39
|
-
readonly description:
|
|
39
|
+
readonly description: "Alternative names for this command.";
|
|
40
40
|
};
|
|
41
41
|
readonly hidden: {
|
|
42
|
-
readonly description:
|
|
42
|
+
readonly description: "Whether this command is hidden from help listings.";
|
|
43
43
|
};
|
|
44
44
|
readonly examples: {
|
|
45
|
-
readonly description:
|
|
45
|
+
readonly description: "Usage examples for help text.";
|
|
46
46
|
};
|
|
47
47
|
readonly flags: {
|
|
48
|
-
readonly description:
|
|
48
|
+
readonly description: "Named flag schemas, keyed by flag name.";
|
|
49
49
|
};
|
|
50
50
|
readonly args: {
|
|
51
|
-
readonly description:
|
|
51
|
+
readonly description: "Ordered positional arg entries (name + schema).";
|
|
52
52
|
};
|
|
53
53
|
readonly commands: {
|
|
54
|
-
readonly description:
|
|
54
|
+
readonly description: "Nested subcommand schemas (for help rendering and completion).\n\nPure data — no execution closures. Populated by `.command()` on\n`CommandBuilder`. Empty for leaf commands.";
|
|
55
55
|
};
|
|
56
56
|
};
|
|
57
57
|
};
|
|
@@ -59,25 +59,25 @@ declare const definitionMetaSchemaDescriptions: {
|
|
|
59
59
|
readonly description: "The runtime descriptor stored inside every FlagBuilder. Consumers (parser,\nhelp generator, resolution chain) read this to understand the flag's shape\nwithout touching generics.";
|
|
60
60
|
readonly properties: {
|
|
61
61
|
readonly kind: {
|
|
62
|
-
readonly description:
|
|
62
|
+
readonly description: "What kind of value this flag accepts.";
|
|
63
63
|
};
|
|
64
64
|
readonly presence: {
|
|
65
65
|
readonly description: "Presence describes whether a flag value is guaranteed to exist when the\naction handler runs:\n\n- `'optional'` — not required; unresolved value follows the kind-specific\n optional fallback (`undefined` for most flags, `[]` for arrays)\n- `'required'` — must be supplied; error if missing\n- `'defaulted'` — always present (falls back to default value)";
|
|
66
66
|
};
|
|
67
67
|
readonly defaultValue: {
|
|
68
|
-
readonly description:
|
|
68
|
+
readonly description: "Runtime default value (if any).";
|
|
69
69
|
};
|
|
70
70
|
readonly aliases: {
|
|
71
71
|
readonly description: "Short/long aliases (e.g. `[{ name: 'f', hidden: false }]` for `--force`).";
|
|
72
72
|
};
|
|
73
73
|
readonly envVar: {
|
|
74
|
-
readonly description:
|
|
74
|
+
readonly description: "Environment variable name for v0.2+ resolution.";
|
|
75
75
|
};
|
|
76
76
|
readonly configPath: {
|
|
77
77
|
readonly description: "Dotted config path for v0.2+ resolution (e.g. `'deploy.region'`).";
|
|
78
78
|
};
|
|
79
79
|
readonly description: {
|
|
80
|
-
readonly description:
|
|
80
|
+
readonly description: "Human-readable description for help text.";
|
|
81
81
|
};
|
|
82
82
|
readonly enumValues: {
|
|
83
83
|
readonly description: "Allowed literal values when `kind === 'enum'`.";
|
|
@@ -86,13 +86,13 @@ declare const definitionMetaSchemaDescriptions: {
|
|
|
86
86
|
readonly description: "Element schema when `kind === 'array'`.";
|
|
87
87
|
};
|
|
88
88
|
readonly prompt: {
|
|
89
|
-
readonly description:
|
|
89
|
+
readonly description: "Interactive prompt configuration for v0.3+ resolution.";
|
|
90
90
|
};
|
|
91
91
|
readonly deprecated: {
|
|
92
|
-
readonly description:
|
|
92
|
+
readonly description: "Deprecation marker.\n\n- `undefined` — not deprecated (default)\n- `true` — deprecated with no migration message\n- `string` — deprecated with a reason/migration message\n\nWhen a deprecated flag is used, a warning is emitted to stderr.\nHelp text shows `[deprecated]` or `[deprecated: <reason>]`.";
|
|
93
93
|
};
|
|
94
94
|
readonly propagate: {
|
|
95
|
-
readonly description:
|
|
95
|
+
readonly description: "Whether this flag propagates to subcommands in nested command trees.\n\nWhen `true`, the flag is automatically available to all descendant\ncommands. A child command that defines a flag with the same name\nshadows the propagated parent flag.\n\nDefault: `false`";
|
|
96
96
|
};
|
|
97
97
|
readonly negation: {
|
|
98
98
|
readonly description: "Negation settings when `kind === 'boolean'` and `.negatable()` was\ncalled (`undefined` otherwise). See FlagNegation.";
|
|
@@ -103,13 +103,13 @@ declare const definitionMetaSchemaDescriptions: {
|
|
|
103
103
|
};
|
|
104
104
|
};
|
|
105
105
|
readonly negation: {
|
|
106
|
-
readonly description:
|
|
106
|
+
readonly description: "Negation settings for a boolean flag (set by `.negatable()`).\n\nThe negated spelling and the positive form are two spellings of ONE\nlogical flag: they share duplicate policy, and the last CLI occurrence\nwins across both. The negated spelling is presence-only — `--no-foo=x`\nis rejected.";
|
|
107
107
|
readonly properties: {
|
|
108
108
|
readonly alias: {
|
|
109
109
|
readonly description: "Explicit negated spelling without the `--` prefix (e.g. `'no-sandbox'`).\n`undefined` synthesizes `no-<flagName>` wherever the flag name is known.";
|
|
110
110
|
};
|
|
111
111
|
readonly hidden: {
|
|
112
|
-
readonly description:
|
|
112
|
+
readonly description: "Hide the negated spelling from help, completions, and suggestions.";
|
|
113
113
|
};
|
|
114
114
|
};
|
|
115
115
|
};
|
|
@@ -117,25 +117,25 @@ declare const definitionMetaSchemaDescriptions: {
|
|
|
117
117
|
readonly description: "The runtime descriptor stored inside every ArgBuilder. Consumers (parser,\nhelp generator) read this to understand the arg's shape without touching\ngenerics.";
|
|
118
118
|
readonly properties: {
|
|
119
119
|
readonly name: {
|
|
120
|
-
readonly description:
|
|
120
|
+
readonly description: "A named positional argument entry in the command schema.\n\nPairs a user-facing arg name with its ArgSchema descriptor.\nThe array ordering in CommandSchema.args determines CLI position.";
|
|
121
121
|
};
|
|
122
122
|
readonly kind: {
|
|
123
|
-
readonly description:
|
|
123
|
+
readonly description: "What kind of value this arg accepts.";
|
|
124
124
|
};
|
|
125
125
|
readonly presence: {
|
|
126
126
|
readonly description: "Presence describes whether a positional arg is guaranteed to exist when the\naction handler runs:\n\n- `'required'` — must be supplied; error if missing (default)\n- `'optional'` — may be `undefined` if not supplied\n- `'defaulted'` — always present (falls back to default value)";
|
|
127
127
|
};
|
|
128
128
|
readonly variadic: {
|
|
129
|
-
readonly description:
|
|
129
|
+
readonly description: "Whether this arg consumes all remaining positionals.";
|
|
130
130
|
};
|
|
131
131
|
readonly stdinMode: {
|
|
132
|
-
readonly description:
|
|
132
|
+
readonly description: "Whether this arg may read from stdin during resolution.\n\nDefault: `false`";
|
|
133
133
|
};
|
|
134
134
|
readonly defaultValue: {
|
|
135
|
-
readonly description:
|
|
135
|
+
readonly description: "Runtime default value (if any).";
|
|
136
136
|
};
|
|
137
137
|
readonly description: {
|
|
138
|
-
readonly description:
|
|
138
|
+
readonly description: "Human-readable description for help text.";
|
|
139
139
|
};
|
|
140
140
|
readonly envVar: {
|
|
141
141
|
readonly description: "Environment variable name for env resolution.\n\nWhen set and the CLI value is absent, the resolver reads this env var\nand coerces the string to the arg's declared kind.";
|
|
@@ -144,7 +144,7 @@ declare const definitionMetaSchemaDescriptions: {
|
|
|
144
144
|
readonly description: "Allowed literal values when `kind === 'enum'`.";
|
|
145
145
|
};
|
|
146
146
|
readonly deprecated: {
|
|
147
|
-
readonly description:
|
|
147
|
+
readonly description: "Deprecation marker.\n\n- `undefined` — not deprecated (default)\n- `true` — deprecated with no migration message\n- `string` — deprecated with a reason/migration message\n\nWhen a deprecated arg is used, a warning is emitted to stderr.\nHelp text shows `[deprecated]` or `[deprecated: <reason>]`.";
|
|
148
148
|
};
|
|
149
149
|
};
|
|
150
150
|
};
|
|
@@ -155,44 +155,44 @@ declare const definitionMetaSchemaDescriptions: {
|
|
|
155
155
|
readonly description: "The kind of interactive prompt to present.\n\n- `'confirm'` — yes/no boolean question\n- `'input'` — free-text string input\n- `'select'` — single selection from a list\n- `'multiselect'` — multiple selections from a list";
|
|
156
156
|
};
|
|
157
157
|
readonly message: {
|
|
158
|
-
readonly description:
|
|
158
|
+
readonly description: "The question displayed to the user.";
|
|
159
159
|
};
|
|
160
160
|
readonly placeholder: {
|
|
161
|
-
readonly description:
|
|
161
|
+
readonly description: "Placeholder text shown before user types (informational only).";
|
|
162
162
|
};
|
|
163
163
|
readonly choices: {
|
|
164
|
-
readonly description:
|
|
164
|
+
readonly description: "Available choices. When omitted for `enum` flags, the enum values\nfrom the flag schema are used automatically.";
|
|
165
165
|
};
|
|
166
166
|
readonly min: {
|
|
167
|
-
readonly description:
|
|
167
|
+
readonly description: "Minimum number of selections required.\n\nDefault: `0`";
|
|
168
168
|
};
|
|
169
169
|
readonly max: {
|
|
170
|
-
readonly description:
|
|
170
|
+
readonly description: "Maximum number of selections allowed.\n\nDefault: `Infinity`";
|
|
171
171
|
};
|
|
172
172
|
};
|
|
173
173
|
};
|
|
174
174
|
readonly choice: {
|
|
175
|
-
readonly description:
|
|
175
|
+
readonly description: "A selectable option for SelectPromptConfig and MultiselectPromptConfig prompts.";
|
|
176
176
|
readonly properties: {
|
|
177
177
|
readonly value: {
|
|
178
|
-
readonly description:
|
|
178
|
+
readonly description: "The value returned when this choice is selected.";
|
|
179
179
|
};
|
|
180
180
|
readonly label: {
|
|
181
|
-
readonly description:
|
|
181
|
+
readonly description: "Display label shown to the user.\n\nDefault: value";
|
|
182
182
|
};
|
|
183
183
|
readonly description: {
|
|
184
|
-
readonly description:
|
|
184
|
+
readonly description: "Optional description shown alongside the choice.";
|
|
185
185
|
};
|
|
186
186
|
};
|
|
187
187
|
};
|
|
188
188
|
readonly example: {
|
|
189
|
-
readonly description:
|
|
189
|
+
readonly description: "A single usage example shown in help text.";
|
|
190
190
|
readonly properties: {
|
|
191
191
|
readonly command: {
|
|
192
192
|
readonly description: "The command invocation (e.g. `'deploy production --force'`).";
|
|
193
193
|
};
|
|
194
194
|
readonly description: {
|
|
195
|
-
readonly description:
|
|
195
|
+
readonly description: "Optional description of what this example does.";
|
|
196
196
|
};
|
|
197
197
|
};
|
|
198
198
|
};
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import { Fallback, TableOptions } from "../schema/activity.mjs";
|
|
2
2
|
//#region src/core/output/contracts.d.ts
|
|
3
3
|
/** Ordered output verbosity levels owned by the output policy layer. */
|
|
4
|
-
declare const OUTPUT_VERBOSITY_LEVELS: readonly [
|
|
4
|
+
declare const OUTPUT_VERBOSITY_LEVELS: readonly ["normal", "quiet"];
|
|
5
5
|
/** Stable output text streams. */
|
|
6
|
-
declare const OUTPUT_STREAMS: readonly [
|
|
6
|
+
declare const OUTPUT_STREAMS: readonly ["stdout", "stderr"];
|
|
7
7
|
/** Stable activity rendering modes. */
|
|
8
|
-
declare const ACTIVITY_RENDER_MODES: readonly [
|
|
8
|
+
declare const ACTIVITY_RENDER_MODES: readonly ["noop", "static", "tty", "capture"];
|
|
9
9
|
/** Stable activity cleanup actions. */
|
|
10
|
-
declare const ACTIVITY_CLEANUP_KINDS: readonly [
|
|
10
|
+
declare const ACTIVITY_CLEANUP_KINDS: readonly ["none", "stop", "done"];
|
|
11
11
|
/** Stable text verbosity labels. */
|
|
12
12
|
type Verbosity = (typeof OUTPUT_VERBOSITY_LEVELS)[number];
|
|
13
13
|
/** Stable output stream labels. */
|
|
@@ -71,7 +71,7 @@ declare const outputContract: {
|
|
|
71
71
|
declare function resolveOutputPolicy(options: ResolveOutputPolicyOptions): OutputPolicy;
|
|
72
72
|
/** Resolve the default text stream for non-JSON structured output. */
|
|
73
73
|
declare function resolveTextStream(policy: OutputPolicy): OutputStream;
|
|
74
|
-
/** Whether `info()` messages should be emitted under the current policy. */
|
|
74
|
+
/** Whether `info()`/`status()` messages should be emitted under the current policy. */
|
|
75
75
|
declare function shouldEmitInfo(policy: OutputPolicy): boolean;
|
|
76
76
|
/** Resolve the concrete table format under the current policy. */
|
|
77
77
|
declare function resolveTableFormat(policy: OutputPolicy, options?: TableOptions): 'text' | 'json';
|
|
@@ -11,7 +11,7 @@ function resolveOutputPolicy(options) {
|
|
|
11
11
|
function resolveTextStream(policy) {
|
|
12
12
|
return policy.jsonMode ? "stderr" : "stdout";
|
|
13
13
|
}
|
|
14
|
-
/** Whether `info()` messages should be emitted under the current policy. */
|
|
14
|
+
/** Whether `info()`/`status()` messages should be emitted under the current policy. */
|
|
15
15
|
function shouldEmitInfo(policy) {
|
|
16
16
|
return policy.verbosity !== "quiet";
|
|
17
17
|
}
|
|
@@ -57,6 +57,17 @@ interface OutputOptions {
|
|
|
57
57
|
* `FORCE_COLOR`, `--no-color`, `--color`, `CI` are respected).
|
|
58
58
|
*/
|
|
59
59
|
readonly color?: boolean;
|
|
60
|
+
/**
|
|
61
|
+
* Resolved OSC 8 hyperlink support for `out.isHyperlinkSupported`.
|
|
62
|
+
*
|
|
63
|
+
* When set, this wins over the `isTTY` fallback. Callers pass the
|
|
64
|
+
* `NO_HYPERLINKS`/`FORCE_HYPERLINKS` (and `--no-hyperlinks`/`--hyperlinks`)
|
|
65
|
+
* decision here via {@linkcode resolveHyperlinkOverride}, keeping `process`
|
|
66
|
+
* access out of the output layer.
|
|
67
|
+
*
|
|
68
|
+
* @defaultValue `isTTY`
|
|
69
|
+
*/
|
|
70
|
+
readonly hyperlinks?: boolean;
|
|
60
71
|
}
|
|
61
72
|
/** Fully resolved output options with no optional fields. */
|
|
62
73
|
interface ResolvedOutputOptions {
|
|
@@ -66,10 +77,24 @@ interface ResolvedOutputOptions {
|
|
|
66
77
|
readonly verbosity: Verbosity;
|
|
67
78
|
readonly jsonMode: boolean;
|
|
68
79
|
readonly color: boolean;
|
|
80
|
+
readonly isHyperlinkSupported: boolean;
|
|
69
81
|
}
|
|
82
|
+
/** Store the exit code requested through an output channel. @internal */
|
|
70
83
|
declare function setRequestedExitCode(out: Out, code: number): void;
|
|
84
|
+
/** Read the exit code requested through an output channel. @internal */
|
|
71
85
|
declare function getRequestedExitCode(out: Out): number | undefined;
|
|
86
|
+
/** Clear a previously requested exit code from an output channel. @internal */
|
|
72
87
|
declare function clearRequestedExitCode(out: Out): void;
|
|
88
|
+
/**
|
|
89
|
+
* Forced hyperlink decision from `NO_HYPERLINKS`/`FORCE_HYPERLINKS` and the
|
|
90
|
+
* `--no-hyperlinks`/`--hyperlinks` argv flags; `undefined` when unset.
|
|
91
|
+
*
|
|
92
|
+
* Pure over its inputs — callers pass the adapter's `env`/`argv` so the
|
|
93
|
+
* output layer never touches `process` directly.
|
|
94
|
+
*
|
|
95
|
+
* @see https://no-hyperlinks.org/
|
|
96
|
+
*/
|
|
97
|
+
declare function resolveHyperlinkOverride(env: Readonly<Record<string, string | undefined>>, argv: readonly string[]): boolean | undefined;
|
|
73
98
|
/**
|
|
74
99
|
* Concrete implementation of the {@linkcode Out} interface.
|
|
75
100
|
*
|
|
@@ -104,6 +129,13 @@ declare class OutputChannel implements Out {
|
|
|
104
129
|
* colors are off, so handlers can style unconditionally.
|
|
105
130
|
*/
|
|
106
131
|
readonly color: Colors;
|
|
132
|
+
/**
|
|
133
|
+
* Whether OSC 8 hyperlinks should be emitted for this channel.
|
|
134
|
+
*
|
|
135
|
+
* Honors `NO_HYPERLINKS`/`FORCE_HYPERLINKS` and the
|
|
136
|
+
* `--no-hyperlinks`/`--hyperlinks` argv flags, falling back to `isTTY`.
|
|
137
|
+
*/
|
|
138
|
+
readonly isHyperlinkSupported: boolean;
|
|
107
139
|
constructor(options: ResolvedOutputOptions);
|
|
108
140
|
/**
|
|
109
141
|
* Write to stdout (normal output). Always emitted.
|
|
@@ -119,6 +151,11 @@ declare class OutputChannel implements Out {
|
|
|
119
151
|
* In JSON mode, redirected to stderr.
|
|
120
152
|
*/
|
|
121
153
|
info(message: string): void;
|
|
154
|
+
/**
|
|
155
|
+
* Status line to stderr (stdout stays clean for piping).
|
|
156
|
+
* Suppressed when verbosity is `'quiet'`.
|
|
157
|
+
*/
|
|
158
|
+
status(message: string): void;
|
|
122
159
|
/** Warning to stderr. Always emitted. */
|
|
123
160
|
warn(message: string): void;
|
|
124
161
|
/** Error to stderr. Always emitted. */
|
|
@@ -302,4 +339,4 @@ interface CapturedOutput {
|
|
|
302
339
|
*/
|
|
303
340
|
declare function createCaptureOutput(options?: Omit<OutputOptions, 'stdout' | 'stderr'>): [out: Out, captured: CapturedOutput];
|
|
304
341
|
//#endregion
|
|
305
|
-
export { CaptureOutputChannel, CaptureProgressHandle, CaptureSpinnerHandle, type CapturedOutput, OutputChannel, type OutputOptions, StaticProgressHandle, StaticSpinnerHandle, TTYProgressHandle, TTYSpinnerHandle, type Verbosity, type WriteFn, clearRequestedExitCode, createCaptureOutput, createOutput, getRequestedExitCode, noopProgressHandle, noopSpinnerHandle, setRequestedExitCode, writeLine };
|
|
342
|
+
export { CaptureOutputChannel, CaptureProgressHandle, CaptureSpinnerHandle, type CapturedOutput, OutputChannel, type OutputOptions, StaticProgressHandle, StaticSpinnerHandle, TTYProgressHandle, TTYSpinnerHandle, type Verbosity, type WriteFn, clearRequestedExitCode, createCaptureOutput, createOutput, getRequestedExitCode, noopProgressHandle, noopSpinnerHandle, resolveHyperlinkOverride, setRequestedExitCode, writeLine };
|
|
@@ -28,15 +28,33 @@ function validateExitCode(code) {
|
|
|
28
28
|
if (!Number.isInteger(code) || code < 0 || code > 255) throw new RangeError("Exit code must be an integer from 0 to 255");
|
|
29
29
|
return code;
|
|
30
30
|
}
|
|
31
|
+
/** Store the exit code requested through an output channel. @internal */
|
|
31
32
|
function setRequestedExitCode(out, code) {
|
|
32
33
|
requestedExitCodes.set(out, validateExitCode(code));
|
|
33
34
|
}
|
|
35
|
+
/** Read the exit code requested through an output channel. @internal */
|
|
34
36
|
function getRequestedExitCode(out) {
|
|
35
37
|
return requestedExitCodes.get(out);
|
|
36
38
|
}
|
|
39
|
+
/** Clear a previously requested exit code from an output channel. @internal */
|
|
37
40
|
function clearRequestedExitCode(out) {
|
|
38
41
|
requestedExitCodes.delete(out);
|
|
39
42
|
}
|
|
43
|
+
/**
|
|
44
|
+
* Forced hyperlink decision from `NO_HYPERLINKS`/`FORCE_HYPERLINKS` and the
|
|
45
|
+
* `--no-hyperlinks`/`--hyperlinks` argv flags; `undefined` when unset.
|
|
46
|
+
*
|
|
47
|
+
* Pure over its inputs — callers pass the adapter's `env`/`argv` so the
|
|
48
|
+
* output layer never touches `process` directly.
|
|
49
|
+
*
|
|
50
|
+
* @see https://no-hyperlinks.org/
|
|
51
|
+
*/
|
|
52
|
+
function resolveHyperlinkOverride(env, argv) {
|
|
53
|
+
const separator = argv.indexOf("--");
|
|
54
|
+
const flags = separator === -1 ? argv : argv.slice(0, separator);
|
|
55
|
+
if (env.NO_HYPERLINKS || flags.includes("--no-hyperlinks")) return false;
|
|
56
|
+
if (env.FORCE_HYPERLINKS || flags.includes("--hyperlinks")) return true;
|
|
57
|
+
}
|
|
40
58
|
/** Merge user-supplied options with defaults. */
|
|
41
59
|
function resolveOptions(options) {
|
|
42
60
|
const isTTY = options?.isTTY ?? false;
|
|
@@ -47,7 +65,8 @@ function resolveOptions(options) {
|
|
|
47
65
|
isTTY,
|
|
48
66
|
verbosity: options?.verbosity ?? "normal",
|
|
49
67
|
jsonMode,
|
|
50
|
-
color: options?.color ?? (isTTY && !jsonMode && isColorSupported)
|
|
68
|
+
color: options?.color ?? (isTTY && !jsonMode && isColorSupported),
|
|
69
|
+
isHyperlinkSupported: options?.hyperlinks ?? isTTY
|
|
51
70
|
};
|
|
52
71
|
}
|
|
53
72
|
/**
|
|
@@ -84,12 +103,20 @@ var OutputChannel = class {
|
|
|
84
103
|
* colors are off, so handlers can style unconditionally.
|
|
85
104
|
*/
|
|
86
105
|
color;
|
|
106
|
+
/**
|
|
107
|
+
* Whether OSC 8 hyperlinks should be emitted for this channel.
|
|
108
|
+
*
|
|
109
|
+
* Honors `NO_HYPERLINKS`/`FORCE_HYPERLINKS` and the
|
|
110
|
+
* `--no-hyperlinks`/`--hyperlinks` argv flags, falling back to `isTTY`.
|
|
111
|
+
*/
|
|
112
|
+
isHyperlinkSupported;
|
|
87
113
|
constructor(options) {
|
|
88
114
|
this.options = options;
|
|
89
115
|
this.policy = resolveOutputPolicy(options);
|
|
90
116
|
this.jsonMode = options.jsonMode;
|
|
91
117
|
this.isTTY = options.isTTY;
|
|
92
118
|
this.color = createColors(options.color);
|
|
119
|
+
this.isHyperlinkSupported = options.isHyperlinkSupported;
|
|
93
120
|
bindMethods(this);
|
|
94
121
|
}
|
|
95
122
|
/**
|
|
@@ -111,6 +138,14 @@ var OutputChannel = class {
|
|
|
111
138
|
if (!shouldEmitInfo(this.policy)) return;
|
|
112
139
|
writeLine(resolveWriterForStream(this.options, resolveTextStream(this.policy)), message);
|
|
113
140
|
}
|
|
141
|
+
/**
|
|
142
|
+
* Status line to stderr (stdout stays clean for piping).
|
|
143
|
+
* Suppressed when verbosity is `'quiet'`.
|
|
144
|
+
*/
|
|
145
|
+
status(message) {
|
|
146
|
+
if (!shouldEmitInfo(this.policy)) return;
|
|
147
|
+
writeLine(this.options.stderr, message);
|
|
148
|
+
}
|
|
114
149
|
/** Warning to stderr. Always emitted. */
|
|
115
150
|
warn(message) {
|
|
116
151
|
writeLine(this.options.stderr, message);
|
|
@@ -439,4 +474,4 @@ function createCaptureOutput(options) {
|
|
|
439
474
|
}), captured.activity), captured];
|
|
440
475
|
}
|
|
441
476
|
//#endregion
|
|
442
|
-
export { CaptureOutputChannel, CaptureProgressHandle, CaptureSpinnerHandle, OutputChannel, clearRequestedExitCode, createCaptureOutput, createOutput, getRequestedExitCode, setRequestedExitCode, writeLine };
|
|
477
|
+
export { CaptureOutputChannel, CaptureProgressHandle, CaptureSpinnerHandle, OutputChannel, clearRequestedExitCode, createCaptureOutput, createOutput, getRequestedExitCode, resolveHyperlinkOverride, setRequestedExitCode, writeLine };
|
|
@@ -181,12 +181,15 @@ function buildFlagLookup(flags, options) {
|
|
|
181
181
|
parity: false
|
|
182
182
|
});
|
|
183
183
|
}
|
|
184
|
-
if (options?.caseParity !== false)
|
|
185
|
-
const
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
184
|
+
if (options?.caseParity !== false) {
|
|
185
|
+
const declared = [...lookup];
|
|
186
|
+
for (const [spelling, entry] of declared) {
|
|
187
|
+
const counterpart = counterpartSpelling(spelling);
|
|
188
|
+
if (counterpart !== void 0 && !lookup.has(counterpart)) lookup.set(counterpart, {
|
|
189
|
+
...entry,
|
|
190
|
+
parity: true
|
|
191
|
+
});
|
|
192
|
+
}
|
|
190
193
|
}
|
|
191
194
|
return lookup;
|
|
192
195
|
}
|
|
@@ -4,9 +4,9 @@ import "../schema/index.mjs";
|
|
|
4
4
|
import { ParseResult } from "../parse/index.mjs";
|
|
5
5
|
//#region src/core/resolve/contracts.d.ts
|
|
6
6
|
/** Ordered flag resolution stages owned by the resolver. */
|
|
7
|
-
declare const FLAG_RESOLUTION_ORDER: readonly [
|
|
7
|
+
declare const FLAG_RESOLUTION_ORDER: readonly ["cli", "env", "config", "prompt", "default"];
|
|
8
8
|
/** Ordered arg resolution stages owned by the resolver. */
|
|
9
|
-
declare const ARG_RESOLUTION_ORDER: readonly [
|
|
9
|
+
declare const ARG_RESOLUTION_ORDER: readonly ["cli", "stdin", "env", "default"];
|
|
10
10
|
/** Stable flag-source labels for precedence and diagnostics. */
|
|
11
11
|
type FlagResolutionStage = (typeof FLAG_RESOLUTION_ORDER)[number];
|
|
12
12
|
/** Stable arg-source labels for precedence and diagnostics. */
|
|
@@ -53,6 +53,11 @@ interface ResolveOptions {
|
|
|
53
53
|
* `null` when nothing does. When absent, path checks are skipped.
|
|
54
54
|
*/
|
|
55
55
|
readonly stat?: (path: string) => Promise<'file' | 'directory' | null>;
|
|
56
|
+
/**
|
|
57
|
+
* Recursive directory creation for `flag.path()` `create` checks. When
|
|
58
|
+
* absent, missing paths are not created and existence rules apply as-is.
|
|
59
|
+
*/
|
|
60
|
+
readonly mkdir?: (path: string) => Promise<void>;
|
|
56
61
|
}
|
|
57
62
|
/** Structured deprecation notice emitted for explicitly sourced values. */
|
|
58
63
|
interface DeprecationWarning {
|
|
@@ -10,8 +10,10 @@ import { ErasedInteractiveResolver } from "../schema/command.mjs";
|
|
|
10
10
|
* Returns what exists at the path, or `null` when nothing does.
|
|
11
11
|
*/
|
|
12
12
|
type StatFn = (path: string) => Promise<'file' | 'directory' | null>;
|
|
13
|
+
/** Recursive directory creation injected by the caller for `flag.path()` `create` checks. */
|
|
14
|
+
type MkdirFn = (path: string) => Promise<void>;
|
|
13
15
|
/** Walk every declared flag through the resolution chain (cli -> env -> config -> prompt -> default), collecting deprecations and throwing aggregated errors. */
|
|
14
|
-
declare function resolveFlags(flagSchemas: Readonly<Record<string, FlagSchema>>, parsedFlags: Readonly<Record<string, unknown>>, env: Readonly<Record<string, string | undefined>>, config: Readonly<Record<string, unknown>>, prompter: PromptEngine | undefined, interactive: ErasedInteractiveResolver | undefined, deprecations: DeprecationWarning[], stat: StatFn | undefined): Promise<Readonly<Record<string, unknown>>>;
|
|
16
|
+
declare function resolveFlags(flagSchemas: Readonly<Record<string, FlagSchema>>, parsedFlags: Readonly<Record<string, unknown>>, env: Readonly<Record<string, string | undefined>>, config: Readonly<Record<string, unknown>>, prompter: PromptEngine | undefined, interactive: ErasedInteractiveResolver | undefined, deprecations: DeprecationWarning[], stat: StatFn | undefined, mkdir: MkdirFn | undefined): Promise<Readonly<Record<string, unknown>>>;
|
|
15
17
|
/** Maps each flag kind to the prompt kinds that produce compatible values. */
|
|
16
18
|
declare const COMPATIBLE_PROMPT_KINDS: Record<FlagKind, readonly PromptKind[]>;
|
|
17
19
|
//#endregion
|
|
@@ -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, stat) {
|
|
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();
|
|
@@ -125,7 +125,7 @@ async function resolveFlags(flagSchemas, parsedFlags, env, config, prompter, int
|
|
|
125
125
|
const value = resolved[name];
|
|
126
126
|
if (schema.kind === "array" && schema.unique && Array.isArray(value)) resolved[name] = [...new Set(value)];
|
|
127
127
|
if (schema.pathChecks !== void 0 && typeof value === "string" && stat !== void 0) {
|
|
128
|
-
const violation = await validatePathChecks(name, value, schema.pathChecks, stat);
|
|
128
|
+
const violation = await validatePathChecks(name, value, schema.pathChecks, stat, mkdir);
|
|
129
129
|
if (violation !== void 0) errors.push(violation);
|
|
130
130
|
}
|
|
131
131
|
}
|
|
@@ -139,17 +139,34 @@ async function resolveFlags(flagSchemas, parsedFlags, env, config, prompter, int
|
|
|
139
139
|
* {@link ValidationError} with code `'CONSTRAINT_VIOLATED'` otherwise.
|
|
140
140
|
* @internal
|
|
141
141
|
*/
|
|
142
|
-
async function validatePathChecks(flagName, value, checks, stat) {
|
|
142
|
+
async function validatePathChecks(flagName, value, checks, stat, mkdir) {
|
|
143
143
|
const found = await stat(value);
|
|
144
|
-
if (found === null)
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
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
|
+
}
|
|
153
170
|
if (checks.type !== void 0 && found !== checks.type) return new ValidationError(`Path '${value}' for flag --${flagName} is a ${found}, expected a ${checks.type}`, {
|
|
154
171
|
code: "CONSTRAINT_VIOLATED",
|
|
155
172
|
details: {
|
|
@@ -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, options?.stat);
|
|
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,
|
|
@@ -5,7 +5,7 @@ import { FlagSchema } from "../schema/flag.mjs";
|
|
|
5
5
|
import "../schema/index.mjs";
|
|
6
6
|
//#region src/core/resolve/property.d.ts
|
|
7
7
|
/** Flag/arg kinds that share a common coercion path. */
|
|
8
|
-
declare const SHARED_PROPERTY_MODEL_KINDS: readonly [
|
|
8
|
+
declare const SHARED_PROPERTY_MODEL_KINDS: readonly ["string", "number", "enum", "custom"];
|
|
9
9
|
/** Union of kind discriminants that participate in shared coercion. */
|
|
10
10
|
type SharedPropertyKind = (typeof SHARED_PROPERTY_MODEL_KINDS)[number];
|
|
11
11
|
/** Minimal coercion-relevant slice of a flag or arg schema, discriminated by kind. */
|
|
@@ -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 };
|