@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
package/dist/core/cli/index.mjs
CHANGED
|
@@ -1,18 +1,19 @@
|
|
|
1
|
-
import { getFlagAliasNames } from "../schema/flag.mjs";
|
|
2
1
|
import { CLIError } from "../errors/index.mjs";
|
|
3
|
-
import {
|
|
4
|
-
import { formatHelp } from "../help/index.mjs";
|
|
5
|
-
import { clearRequestedExitCode, createCaptureOutput, createOutput } from "../output/index.mjs";
|
|
2
|
+
import { getFlagAliasNames } from "../schema/flag.mjs";
|
|
6
3
|
import { arg } from "../schema/arg.mjs";
|
|
7
4
|
import { command } from "../schema/command.mjs";
|
|
8
5
|
import { includesBeforeSeparator } from "../parse/index.mjs";
|
|
6
|
+
import { SHELLS, detectShell, generateCompletion, normalizeShell } from "../completion/index.mjs";
|
|
7
|
+
import { formatHelp } from "../help/index.mjs";
|
|
8
|
+
import { generateCommandSchema, generateSchema } from "../json-schema/index.mjs";
|
|
9
|
+
import { clearRequestedExitCode, createCaptureOutput, createOutput, resolveHyperlinkOverride } from "../output/index.mjs";
|
|
9
10
|
import { buildRunResult, executeCommand } from "../execution/index.mjs";
|
|
10
11
|
import { runCommand } from "../testkit/index.mjs";
|
|
11
12
|
import { stripTrailing } from "../../strings.mjs";
|
|
12
13
|
import { createAdapter } from "../../runtime/auto.mjs";
|
|
13
14
|
import { deriveHelpLinks } from "./help-links.mjs";
|
|
14
15
|
import { planInvocation } from "./planner.mjs";
|
|
15
|
-
import "./plugin.mjs";
|
|
16
|
+
import { plugin } from "./plugin.mjs";
|
|
16
17
|
import { formatRootHelp } from "./root-help.mjs";
|
|
17
18
|
import { prepareRuntimePreflight } from "./runtime-preflight.mjs";
|
|
18
19
|
//#region src/core/cli/index.ts
|
|
@@ -99,6 +100,55 @@ function eraseCommand(cmd) {
|
|
|
99
100
|
};
|
|
100
101
|
}
|
|
101
102
|
/**
|
|
103
|
+
* Resolve the render context for content built before `.run()`.
|
|
104
|
+
*
|
|
105
|
+
* Content styled ahead of execution — hand-rendered banners, custom help, or
|
|
106
|
+
* anything else emitted outside an action handler — has no `out` to consult,
|
|
107
|
+
* which pushes consumers into re-deriving the framework's decisions from raw
|
|
108
|
+
* argv (`argv.includes('--json')` misreads a post-`--` literal). This probe
|
|
109
|
+
* runs the same composition `.execute()`/`.run()` feed into the output
|
|
110
|
+
* channel — `--`-aware `--json` detection, the color gate, and the hyperlink
|
|
111
|
+
* override — so pre-run styling matches the channel that will render.
|
|
112
|
+
*
|
|
113
|
+
* @param argv - Raw argv tokens (NOT including the binary/script path,
|
|
114
|
+
* i.e. equivalent to `process.argv.slice(2)`).
|
|
115
|
+
* @param options - Host facts and overrides.
|
|
116
|
+
* @returns The resolved output decisions.
|
|
117
|
+
*
|
|
118
|
+
* @example
|
|
119
|
+
* ```ts
|
|
120
|
+
* const ctx = resolveRenderContext(process.argv.slice(2), {
|
|
121
|
+
* isTTY: process.stdout.isTTY === true,
|
|
122
|
+
* env: process.env,
|
|
123
|
+
* });
|
|
124
|
+
* const banner = ctx.color.bold('mycli');
|
|
125
|
+
* ```
|
|
126
|
+
*/
|
|
127
|
+
function resolveRenderContext(argv, options) {
|
|
128
|
+
const out = createOutput({
|
|
129
|
+
jsonMode: includesBeforeSeparator(argv, "--json") || options?.jsonMode === true,
|
|
130
|
+
isTTY: options?.isTTY ?? false,
|
|
131
|
+
...options?.color !== void 0 ? { color: options.color } : {},
|
|
132
|
+
...hyperlinksOption(resolveHyperlinkOverride(options?.env ?? {}, argv))
|
|
133
|
+
});
|
|
134
|
+
return {
|
|
135
|
+
jsonMode: out.jsonMode,
|
|
136
|
+
isTTY: out.isTTY,
|
|
137
|
+
color: out.color,
|
|
138
|
+
isHyperlinkSupported: out.isHyperlinkSupported
|
|
139
|
+
};
|
|
140
|
+
}
|
|
141
|
+
/**
|
|
142
|
+
* Conditional-spread wrapper for the output channel's `hyperlinks` option:
|
|
143
|
+
* omit the key entirely when there is no override so `exactOptionalPropertyTypes`
|
|
144
|
+
* stays happy and the channel falls back to `isTTY`.
|
|
145
|
+
*
|
|
146
|
+
* @internal
|
|
147
|
+
*/
|
|
148
|
+
function hyperlinksOption(override) {
|
|
149
|
+
return override !== void 0 ? { hyperlinks: override } : {};
|
|
150
|
+
}
|
|
151
|
+
/**
|
|
102
152
|
* Build {@linkcode RunOptions} from {@linkcode CLIRunOptions}, conditionally spreading each
|
|
103
153
|
* field to satisfy `exactOptionalPropertyTypes`.
|
|
104
154
|
*
|
|
@@ -119,11 +169,14 @@ function buildCommandRunOptions(options, helpOptions, meta) {
|
|
|
119
169
|
...options?.stdinData !== void 0 ? { stdinData: options.stdinData } : {},
|
|
120
170
|
...options?.prompter !== void 0 ? { prompter: options.prompter } : {},
|
|
121
171
|
...options?.answers !== void 0 ? { answers: options.answers } : {},
|
|
172
|
+
...options?.stat !== void 0 ? { stat: options.stat } : {},
|
|
173
|
+
...options?.mkdir !== void 0 ? { mkdir: options.mkdir } : {},
|
|
122
174
|
...options?.verbosity !== void 0 ? { verbosity: options.verbosity } : {},
|
|
123
175
|
...options?.jsonMode !== void 0 ? { jsonMode: options.jsonMode } : {},
|
|
124
176
|
...options?.isTTY !== void 0 ? { isTTY: options.isTTY } : {},
|
|
125
177
|
...options?.out !== void 0 ? { out: options.out } : {},
|
|
126
|
-
...options?.captured !== void 0 ? { captured: options.captured } : {}
|
|
178
|
+
...options?.captured !== void 0 ? { captured: options.captured } : {},
|
|
179
|
+
...options?.flags !== void 0 ? { flags: options.flags } : {}
|
|
127
180
|
};
|
|
128
181
|
}
|
|
129
182
|
/**
|
|
@@ -261,12 +314,16 @@ var CLIBuilder = class CLIBuilder {
|
|
|
261
314
|
/**
|
|
262
315
|
* Enable automatic config file discovery.
|
|
263
316
|
*
|
|
264
|
-
* When enabled, `.run()` probes standard paths before dispatching
|
|
265
|
-
*
|
|
266
|
-
*
|
|
267
|
-
*
|
|
268
|
-
*
|
|
317
|
+
* When enabled, `.run()` probes standard paths before dispatching,
|
|
318
|
+
* first match wins, no merging:
|
|
319
|
+
* 1. Project scope — for `$CWD` and each ancestor directory up to the
|
|
320
|
+
* filesystem root, nearest first:
|
|
321
|
+
* `.{appName}.json`, `{appName}.config.json`, `.config/{appName}.json`
|
|
322
|
+
* 2. User scope — `{dir}/{appName}/config.json` for each user config
|
|
323
|
+
* root (`$XDG_CONFIG_HOME` / `~/.config` on Unix, plus
|
|
324
|
+
* `~/Library/Application Support` on macOS,
|
|
269
325
|
* `%APPDATA%` / `%USERPROFILE%\\AppData\\Roaming` on Windows)
|
|
326
|
+
* 3. System scope — `/etc/{appName}/config.json` on Linux and macOS
|
|
270
327
|
*
|
|
271
328
|
* The user can override the path via `--config <path>` or `--config=<path>`.
|
|
272
329
|
*
|
|
@@ -375,10 +432,17 @@ var CLIBuilder = class CLIBuilder {
|
|
|
375
432
|
* this command instead of showing root help.
|
|
376
433
|
*
|
|
377
434
|
* The default command is the CLI's root *surface*: its flags and arguments
|
|
378
|
-
* are rendered inline in root help.
|
|
379
|
-
* cannot be invoked by its own name (`mycli mycmd` does not
|
|
380
|
-
* it is omitted from the root `Commands:` list
|
|
381
|
-
* `.help({ showDefaultInCommands: true })`). Only one default is
|
|
435
|
+
* are rendered inline in root help. By default it is **not** a named
|
|
436
|
+
* subcommand — it cannot be invoked by its own name (`mycli mycmd` does not
|
|
437
|
+
* route to it) and it is omitted from the root `Commands:` list (re-enable
|
|
438
|
+
* listing with `.help({ showDefaultInCommands: true })`). Only one default is
|
|
439
|
+
* allowed.
|
|
440
|
+
*
|
|
441
|
+
* Pass `{ route: true }` to *also* expose the command under its own name as a
|
|
442
|
+
* routable top-level command: `mycli` and `mycli <name>` then run the same
|
|
443
|
+
* command object, and it is listed in `Commands:` beside its siblings. This
|
|
444
|
+
* avoids duplicating the command just to keep both forms equivalent during a
|
|
445
|
+
* v3 migration.
|
|
382
446
|
*
|
|
383
447
|
* @example
|
|
384
448
|
* ```ts
|
|
@@ -395,12 +459,21 @@ var CLIBuilder = class CLIBuilder {
|
|
|
395
459
|
* .default(deploy)
|
|
396
460
|
* .command(status)
|
|
397
461
|
* .run();
|
|
462
|
+
*
|
|
463
|
+
* // Default that is also a named route — `mytool` and `mytool status` are
|
|
464
|
+
* // the same surface, and `status` is listed beside `logs`:
|
|
465
|
+
* cli('mytool')
|
|
466
|
+
* .default(status, { route: true })
|
|
467
|
+
* .command(logs)
|
|
468
|
+
* .run();
|
|
398
469
|
* ```
|
|
399
470
|
*
|
|
400
471
|
* @param cmd - {@link CommandBuilder} to register as the default.
|
|
472
|
+
* @param options - Default-command options. `{ route: true }` also exposes
|
|
473
|
+
* the command under its own name (see {@link DefaultCommandOptions}).
|
|
401
474
|
* @returns The builder (for chaining).
|
|
402
475
|
*/
|
|
403
|
-
default(cmd) {
|
|
476
|
+
default(cmd, options) {
|
|
404
477
|
if (this.schema.defaultCommand !== void 0) throw new CLIError("Only one default command is allowed", {
|
|
405
478
|
code: "DUPLICATE_DEFAULT",
|
|
406
479
|
suggest: "Call .default() only once when building the CLI"
|
|
@@ -410,7 +483,8 @@ var CLIBuilder = class CLIBuilder {
|
|
|
410
483
|
const erased = eraseCommand(cmd);
|
|
411
484
|
return new CLIBuilder({
|
|
412
485
|
...this.schema,
|
|
413
|
-
defaultCommand: erased
|
|
486
|
+
defaultCommand: erased,
|
|
487
|
+
defaultCommandRouted: options?.route ?? false
|
|
414
488
|
});
|
|
415
489
|
}
|
|
416
490
|
/**
|
|
@@ -496,8 +570,9 @@ var CLIBuilder = class CLIBuilder {
|
|
|
496
570
|
});
|
|
497
571
|
else out.log(script);
|
|
498
572
|
});
|
|
573
|
+
const withCompletions = this.command(cmd);
|
|
499
574
|
return new CLIBuilder({
|
|
500
|
-
...
|
|
575
|
+
...withCompletions.schema,
|
|
501
576
|
hasBuiltInCompletions: true
|
|
502
577
|
});
|
|
503
578
|
}
|
|
@@ -514,10 +589,12 @@ var CLIBuilder = class CLIBuilder {
|
|
|
514
589
|
*/
|
|
515
590
|
async execute(argv, options) {
|
|
516
591
|
const jsonMode = includesBeforeSeparator(argv, "--json") || options?.jsonMode === true;
|
|
592
|
+
const verbosity = includesBeforeSeparator(argv, "--quiet") || includesBeforeSeparator(argv, "-q") ? "quiet" : options?.verbosity;
|
|
517
593
|
const captureOptions = {
|
|
518
|
-
...
|
|
594
|
+
...verbosity !== void 0 ? { verbosity } : {},
|
|
519
595
|
...jsonMode ? { jsonMode } : {},
|
|
520
|
-
...options?.isTTY !== void 0 ? { isTTY: options.isTTY } : {}
|
|
596
|
+
...options?.isTTY !== void 0 ? { isTTY: options.isTTY } : {},
|
|
597
|
+
...hyperlinksOption(resolveHyperlinkOverride(options?.env ?? {}, argv))
|
|
521
598
|
};
|
|
522
599
|
let out;
|
|
523
600
|
let captured;
|
|
@@ -530,24 +607,33 @@ var CLIBuilder = class CLIBuilder {
|
|
|
530
607
|
};
|
|
531
608
|
} else [out, captured] = createCaptureOutput(Object.keys(captureOptions).length > 0 ? captureOptions : void 0);
|
|
532
609
|
clearRequestedExitCode(out);
|
|
610
|
+
const resolvedVersion = options?.help?.version ?? this.schema.version;
|
|
533
611
|
const helpOptions = {
|
|
534
612
|
...this.schema.helpConfig,
|
|
535
613
|
...options?.help,
|
|
536
614
|
binName: options?.help?.binName ?? this.schema.name,
|
|
537
|
-
hyperlinks: options?.help?.hyperlinks ?? this.schema.helpConfig?.hyperlinks ?? out.
|
|
615
|
+
hyperlinks: options?.help?.hyperlinks ?? this.schema.helpConfig?.hyperlinks ?? out.isHyperlinkSupported,
|
|
616
|
+
colors: options?.help?.colors ?? out.color,
|
|
617
|
+
...resolvedVersion !== void 0 ? { version: resolvedVersion } : {}
|
|
538
618
|
};
|
|
619
|
+
const flagSettings = options?.flags ?? this.schema.flagSettings;
|
|
539
620
|
const effectiveOptions = {
|
|
540
621
|
...options,
|
|
541
622
|
plugins: this.schema.plugins,
|
|
542
|
-
...jsonMode ? { jsonMode } : {}
|
|
623
|
+
...jsonMode ? { jsonMode } : {},
|
|
624
|
+
...verbosity !== void 0 ? { verbosity } : {},
|
|
625
|
+
...flagSettings !== void 0 ? { flags: flagSettings } : {}
|
|
543
626
|
};
|
|
544
627
|
const output = {
|
|
545
628
|
jsonMode,
|
|
546
629
|
isTTY: out.isTTY,
|
|
547
|
-
verbosity:
|
|
630
|
+
verbosity: verbosity ?? "normal"
|
|
548
631
|
};
|
|
549
632
|
const planned = planInvocation({
|
|
550
|
-
schema:
|
|
633
|
+
schema: options?.flags !== void 0 ? {
|
|
634
|
+
...this.schema,
|
|
635
|
+
flagSettings
|
|
636
|
+
} : this.schema,
|
|
551
637
|
argv,
|
|
552
638
|
help: helpOptions,
|
|
553
639
|
output
|
|
@@ -590,14 +676,19 @@ var CLIBuilder = class CLIBuilder {
|
|
|
590
676
|
error: void 0
|
|
591
677
|
}, captured);
|
|
592
678
|
}
|
|
593
|
-
case "root-help":
|
|
594
|
-
|
|
595
|
-
|
|
679
|
+
case "root-help":
|
|
680
|
+
if (jsonMode) out.json(generateSchema(this.schema, void 0, {
|
|
681
|
+
name: planned.help.binName ?? this.schema.name,
|
|
682
|
+
version: planned.help.version ?? this.schema.version
|
|
683
|
+
}));
|
|
684
|
+
else {
|
|
685
|
+
const helpText = formatRootHelp(resolveHelpLinksSchema(this.schema), planned.help);
|
|
686
|
+
out.log(helpText);
|
|
687
|
+
}
|
|
596
688
|
return buildRunResult({
|
|
597
689
|
exitCode: 0,
|
|
598
690
|
error: void 0
|
|
599
691
|
}, captured);
|
|
600
|
-
}
|
|
601
692
|
case "dispatch-error":
|
|
602
693
|
if (jsonMode) out.json({ error: planned.error.toJSON() });
|
|
603
694
|
else {
|
|
@@ -608,14 +699,19 @@ var CLIBuilder = class CLIBuilder {
|
|
|
608
699
|
exitCode: planned.error.exitCode,
|
|
609
700
|
error: planned.error
|
|
610
701
|
}, captured);
|
|
611
|
-
case "needs-subcommand":
|
|
612
|
-
|
|
613
|
-
|
|
702
|
+
case "needs-subcommand":
|
|
703
|
+
if (jsonMode) out.json(generateCommandSchema(planned.command.schema, void 0, {
|
|
704
|
+
name: planned.help.binName ?? planned.command.schema.name,
|
|
705
|
+
version: planned.help.version
|
|
706
|
+
}));
|
|
707
|
+
else {
|
|
708
|
+
const helpText = formatHelp(planned.command.schema, planned.help);
|
|
709
|
+
out.log(helpText);
|
|
710
|
+
}
|
|
614
711
|
return buildRunResult({
|
|
615
712
|
exitCode: 0,
|
|
616
713
|
error: void 0
|
|
617
714
|
}, captured);
|
|
618
|
-
}
|
|
619
715
|
case "match": {
|
|
620
716
|
const commandRunOptions = buildCommandRunOptions(effectiveOptions, planned.plan.help ?? helpOptions, planned.plan.meta);
|
|
621
717
|
if (planned.plan.command._command === void 0) return planned.plan.command._execute(planned.plan.argv, {
|
|
@@ -667,15 +763,23 @@ var CLIBuilder = class CLIBuilder {
|
|
|
667
763
|
return adapter.exit(preflight.error.exitCode);
|
|
668
764
|
}
|
|
669
765
|
const effectiveBuilder = preflight.schema === this.schema ? this : new CLIBuilder(preflight.schema);
|
|
766
|
+
const terminalSize = adapter.getTerminalSize();
|
|
767
|
+
const runtimeHelpWidth = options?.help?.width === void 0 && preflight.schema.helpConfig?.width === void 0 ? terminalSize?.columns : void 0;
|
|
768
|
+
const runtimeHelpOptions = runtimeHelpWidth !== void 0 ? {
|
|
769
|
+
...options?.help,
|
|
770
|
+
width: runtimeHelpWidth
|
|
771
|
+
} : options?.help;
|
|
670
772
|
const executeOptions = {
|
|
671
773
|
...options,
|
|
672
774
|
...preflight.inputs,
|
|
775
|
+
...runtimeHelpOptions !== void 0 ? { help: runtimeHelpOptions } : {},
|
|
673
776
|
out: createOutput({
|
|
674
777
|
stdout: adapter.stdout,
|
|
675
778
|
stderr: adapter.stderr,
|
|
676
779
|
jsonMode: preflight.inputs.jsonMode,
|
|
677
780
|
isTTY: preflight.inputs.isTTY,
|
|
678
|
-
...preflight.inputs.verbosity !== "normal" ? { verbosity: preflight.inputs.verbosity } : {}
|
|
781
|
+
...preflight.inputs.verbosity !== "normal" ? { verbosity: preflight.inputs.verbosity } : {},
|
|
782
|
+
...hyperlinksOption(resolveHyperlinkOverride(adapter.env, adapter.argv))
|
|
679
783
|
})
|
|
680
784
|
};
|
|
681
785
|
const result = await effectiveBuilder.execute(preflight.filteredArgv, executeOptions);
|
|
@@ -834,8 +938,8 @@ function buildManifestSchema(schema, input, defaultFiles, pinFiles) {
|
|
|
834
938
|
}
|
|
835
939
|
/**
|
|
836
940
|
* Coerce a {@link ResolvedManifestSettings.from | `manifest.from`} input
|
|
837
|
-
* (string path, `file:` URL string,
|
|
838
|
-
* filesystem path string. `undefined` passes through unchanged.
|
|
941
|
+
* (string path, `file:` URL string, {@link URL} instance, or `import.meta`) to
|
|
942
|
+
* a plain filesystem path string. `undefined` passes through unchanged.
|
|
839
943
|
*
|
|
840
944
|
* Runtime-agnostic by design — relies only on the `URL` global (available in
|
|
841
945
|
* every JS runtime) rather than `node:url`, keeping core free of Node
|
|
@@ -845,10 +949,11 @@ function buildManifestSchema(schema, input, defaultFiles, pinFiles) {
|
|
|
845
949
|
*/
|
|
846
950
|
function normalizeFromSetting(from) {
|
|
847
951
|
if (from === void 0) return void 0;
|
|
848
|
-
|
|
849
|
-
|
|
850
|
-
|
|
851
|
-
|
|
952
|
+
const source = typeof from === "object" && !(from instanceof URL) ? from.url : from;
|
|
953
|
+
if (source instanceof URL) {
|
|
954
|
+
if (source.protocol !== "file:") return source.href;
|
|
955
|
+
} else if (!source.startsWith("file:")) return source;
|
|
956
|
+
const decoded = decodeURIComponent(new URL(source).pathname);
|
|
852
957
|
if (/^\/[A-Za-z]:/.test(decoded)) return decoded.slice(1).replace(/\//g, "\\");
|
|
853
958
|
return decoded;
|
|
854
959
|
}
|
|
@@ -880,22 +985,48 @@ function isPackageJsonData(value) {
|
|
|
880
985
|
if (typeof value !== "object" || value === null || Array.isArray(value)) return false;
|
|
881
986
|
return "name" in value || "version" in value || "description" in value || "bin" in value || "homepage" in value || "repository" in value;
|
|
882
987
|
}
|
|
883
|
-
function cli(nameOrOptions) {
|
|
988
|
+
function cli(nameOrOptions, extraOptions) {
|
|
989
|
+
const options = typeof nameOrOptions === "string" ? {
|
|
990
|
+
name: nameOrOptions,
|
|
991
|
+
...extraOptions
|
|
992
|
+
} : nameOrOptions;
|
|
884
993
|
return new CLIBuilder({
|
|
885
|
-
name:
|
|
886
|
-
inheritName:
|
|
994
|
+
name: options.name ?? "cli",
|
|
995
|
+
inheritName: options.inherit ?? false,
|
|
887
996
|
version: void 0,
|
|
888
997
|
description: void 0,
|
|
889
998
|
commands: [],
|
|
890
999
|
defaultCommand: void 0,
|
|
1000
|
+
defaultCommandRouted: false,
|
|
891
1001
|
configSettings: void 0,
|
|
892
1002
|
packageJsonSettings: void 0,
|
|
893
1003
|
helpLinks: void 0,
|
|
894
1004
|
hasBuiltInCompletions: false,
|
|
895
1005
|
completionsFlag: void 0,
|
|
896
1006
|
helpConfig: void 0,
|
|
1007
|
+
flagSettings: options.flags,
|
|
897
1008
|
plugins: []
|
|
898
1009
|
});
|
|
899
1010
|
}
|
|
1011
|
+
/**
|
|
1012
|
+
* Report whether the calling module is the process entrypoint, cross-runtime.
|
|
1013
|
+
*
|
|
1014
|
+
* Node, Bun, and Deno set `import.meta.main` on the module invoked directly;
|
|
1015
|
+
* projects with the runtime's ambient types can read that property directly.
|
|
1016
|
+
* This helper is a compatibility form for projects whose `tsconfig.json` `lib`
|
|
1017
|
+
* override drops those `ImportMeta` extras: passing `import.meta` whole avoids
|
|
1018
|
+
* a direct `.main` access without requiring global augmentation.
|
|
1019
|
+
*
|
|
1020
|
+
* @param meta - The calling module's `import.meta`.
|
|
1021
|
+
* @returns `true` when the module was run as the entrypoint.
|
|
1022
|
+
*
|
|
1023
|
+
* @example
|
|
1024
|
+
* ```ts
|
|
1025
|
+
* if (isMainModule(import.meta)) cli('mycli').command(deploy).run();
|
|
1026
|
+
* ```
|
|
1027
|
+
*/
|
|
1028
|
+
function isMainModule(meta) {
|
|
1029
|
+
return meta.main === true;
|
|
1030
|
+
}
|
|
900
1031
|
//#endregion
|
|
901
|
-
export { CLIBuilder, cli };
|
|
1032
|
+
export { CLIBuilder, cli, formatRootHelp, isMainModule, plugin, resolveRenderContext };
|
|
@@ -3,9 +3,9 @@ import { CLIPlugin } from "./plugin.mjs";
|
|
|
3
3
|
import { CLIError } from "../errors/index.mjs";
|
|
4
4
|
import { HelpOptions } from "../help/index.mjs";
|
|
5
5
|
import { CommandMeta, CommandSchema, ErasedCommand } from "../schema/command.mjs";
|
|
6
|
+
import { ParseOptions } from "../parse/index.mjs";
|
|
6
7
|
import { CompletionOptions } from "../completion/shells/shared.mjs";
|
|
7
8
|
import { Shell } from "../completion/index.mjs";
|
|
8
|
-
|
|
9
9
|
//#region src/core/cli/planner.d.ts
|
|
10
10
|
/**
|
|
11
11
|
* Structural subset of CLISchema used by the planner.
|
|
@@ -23,6 +23,8 @@ interface PlannerSchemaLike {
|
|
|
23
23
|
readonly commands: readonly ErasedCommand[];
|
|
24
24
|
/** Fallback command when no subcommand token matches. */
|
|
25
25
|
readonly defaultCommand: ErasedCommand | undefined;
|
|
26
|
+
/** Whether the default command is also exposed as a named top-level route. */
|
|
27
|
+
readonly defaultCommandRouted: boolean;
|
|
26
28
|
/**
|
|
27
29
|
* Eager `--completions <shell>` flag configuration, when `.completions()`
|
|
28
30
|
* was registered with `{ as: 'flag' }`. `undefined` disables interception.
|
|
@@ -31,6 +33,8 @@ interface PlannerSchemaLike {
|
|
|
31
33
|
readonly shells: readonly Shell[];
|
|
32
34
|
readonly options: CompletionOptions | undefined;
|
|
33
35
|
} | undefined;
|
|
36
|
+
/** Flag-parsing behavior settings (case parity) applied to flag lookups. */
|
|
37
|
+
readonly flagSettings?: ParseOptions | undefined;
|
|
34
38
|
/** Plugins forwarded into every matched execution plan. */
|
|
35
39
|
readonly plugins: readonly CLIPlugin[];
|
|
36
40
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { collectPropagatedFlags } from "./propagate.mjs";
|
|
2
1
|
import { CLIError, ParseError } from "../errors/index.mjs";
|
|
3
|
-
import { normalizeShell } from "../completion/index.mjs";
|
|
4
2
|
import { buildFlagLookup, flagExpectsValue, includesBeforeSeparator } from "../parse/index.mjs";
|
|
3
|
+
import { collectPropagatedFlags } from "./propagate.mjs";
|
|
4
|
+
import { normalizeShell } from "../completion/index.mjs";
|
|
5
5
|
import { dispatch, findClosestCommand } from "./dispatch.mjs";
|
|
6
6
|
//#region src/core/cli/planner.ts
|
|
7
7
|
function buildMeta(schema, helpOptions, commandName) {
|
|
@@ -75,8 +75,8 @@ function buildPlannerMatchOutcome(schema, command, commandPath, argv, help, outp
|
|
|
75
75
|
function canDelegateUnknownRootToDefault(command, input) {
|
|
76
76
|
return input === "" || command.schema.args.length > 0;
|
|
77
77
|
}
|
|
78
|
-
function findUnknownFlagBeforePositional(argv, flags) {
|
|
79
|
-
const lookup = buildFlagLookup(flags);
|
|
78
|
+
function findUnknownFlagBeforePositional(argv, flags, parseOptions) {
|
|
79
|
+
const lookup = buildFlagLookup(flags, parseOptions);
|
|
80
80
|
for (let index = 0; index < argv.length; index++) {
|
|
81
81
|
const token = argv[index];
|
|
82
82
|
if (token === void 0 || token === "--") return void 0;
|
|
@@ -86,7 +86,7 @@ function findUnknownFlagBeforePositional(argv, flags) {
|
|
|
86
86
|
const name = token.slice(2, equalsIndex === -1 ? void 0 : equalsIndex);
|
|
87
87
|
const entry = lookup.get(name);
|
|
88
88
|
if (entry === void 0) return equalsIndex === -1 ? token : `--${name}`;
|
|
89
|
-
if (equalsIndex === -1 && flagExpectsValue(entry
|
|
89
|
+
if (equalsIndex === -1 && flagExpectsValue(entry.schema)) index++;
|
|
90
90
|
continue;
|
|
91
91
|
}
|
|
92
92
|
const chars = token.slice(1);
|
|
@@ -94,7 +94,7 @@ function findUnknownFlagBeforePositional(argv, flags) {
|
|
|
94
94
|
const char = chars.charAt(charIndex);
|
|
95
95
|
const entry = lookup.get(char);
|
|
96
96
|
if (entry === void 0) return `-${char}`;
|
|
97
|
-
if (!flagExpectsValue(entry
|
|
97
|
+
if (!flagExpectsValue(entry.schema)) continue;
|
|
98
98
|
if (charIndex === chars.length - 1) index++;
|
|
99
99
|
break;
|
|
100
100
|
}
|
|
@@ -128,13 +128,13 @@ function scanRootHead(head, valueFlags) {
|
|
|
128
128
|
const equalsIndex = token.indexOf("=");
|
|
129
129
|
const name = token.slice(2, equalsIndex === -1 ? void 0 : equalsIndex);
|
|
130
130
|
const entry = valueFlags?.get(name);
|
|
131
|
-
if (entry !== void 0 && equalsIndex === -1 && flagExpectsValue(entry
|
|
131
|
+
if (entry !== void 0 && equalsIndex === -1 && flagExpectsValue(entry.schema)) index++;
|
|
132
132
|
continue;
|
|
133
133
|
}
|
|
134
134
|
const chars = token.slice(1);
|
|
135
135
|
for (let charIndex = 0; charIndex < chars.length; charIndex++) {
|
|
136
136
|
const entry = valueFlags?.get(chars.charAt(charIndex));
|
|
137
|
-
if (entry === void 0 || !flagExpectsValue(entry
|
|
137
|
+
if (entry === void 0 || !flagExpectsValue(entry.schema)) continue;
|
|
138
138
|
if (charIndex === chars.length - 1) index++;
|
|
139
139
|
break;
|
|
140
140
|
}
|
|
@@ -190,6 +190,12 @@ function planCompletionsFlag(argv, config) {
|
|
|
190
190
|
};
|
|
191
191
|
}
|
|
192
192
|
}
|
|
193
|
+
/** Root-level output flags stripped before dispatch (never part of a command schema). */
|
|
194
|
+
const ROOT_OUTPUT_FLAGS = /* @__PURE__ */ new Set([
|
|
195
|
+
"--json",
|
|
196
|
+
"--quiet",
|
|
197
|
+
"-q"
|
|
198
|
+
]);
|
|
193
199
|
/**
|
|
194
200
|
* Decide what to do with an argv invocation before any command executes.
|
|
195
201
|
*
|
|
@@ -202,10 +208,10 @@ function planInvocation(options) {
|
|
|
202
208
|
const separatorIndex = options.argv.indexOf("--");
|
|
203
209
|
const head = separatorIndex === -1 ? options.argv : options.argv.slice(0, separatorIndex);
|
|
204
210
|
const tail = separatorIndex === -1 ? [] : options.argv.slice(separatorIndex);
|
|
205
|
-
const filteredHead = head.
|
|
211
|
+
const filteredHead = head.some((arg) => ROOT_OUTPUT_FLAGS.has(arg)) ? head.filter((arg) => !ROOT_OUTPUT_FLAGS.has(arg)) : head;
|
|
206
212
|
const filteredArgv = separatorIndex === -1 ? filteredHead : [...filteredHead, ...tail];
|
|
207
213
|
const defaultCommand = options.schema.defaultCommand;
|
|
208
|
-
const rootValueFlags = defaultCommand !== void 0 ? buildFlagLookup(defaultCommand.schema.flags) : void 0;
|
|
214
|
+
const rootValueFlags = defaultCommand !== void 0 ? buildFlagLookup(defaultCommand.schema.flags, options.schema.flagSettings) : void 0;
|
|
209
215
|
if (options.schema.version !== void 0 && (includesBeforeSeparator(options.argv, "--version") || includesBeforeSeparator(options.argv, "-V"))) return {
|
|
210
216
|
kind: "root-version",
|
|
211
217
|
version: options.schema.version
|
|
@@ -243,12 +249,12 @@ function planInvocation(options) {
|
|
|
243
249
|
kind: "root-help",
|
|
244
250
|
help: options.help
|
|
245
251
|
};
|
|
246
|
-
const result = dispatch(filteredArgv, buildRootCommandMap(options.schema.commands), [], rootValueFlags);
|
|
252
|
+
const result = dispatch(filteredArgv, buildRootCommandMap(defaultCommand !== void 0 && options.schema.defaultCommandRouted ? [...options.schema.commands, defaultCommand] : options.schema.commands), [], rootValueFlags, options.schema.flagSettings);
|
|
247
253
|
switch (result.kind) {
|
|
248
254
|
case "unknown": {
|
|
249
255
|
if (defaultCommand !== void 0 && result.parentPath.length === 0) {
|
|
250
256
|
if ((result.input !== "" ? findClosestCommand(result.input, result.candidates) : void 0) === void 0 && canDelegateUnknownRootToDefault(defaultCommand, result.input)) return buildPlannerMatchOutcome(options.schema, defaultCommand, [defaultCommand.schema], filteredArgv, options.help, options.output);
|
|
251
|
-
const unknownFlag = findUnknownFlagBeforePositional(filteredArgv, defaultCommand.schema.flags);
|
|
257
|
+
const unknownFlag = findUnknownFlagBeforePositional(filteredArgv, defaultCommand.schema.flags, options.schema.flagSettings);
|
|
252
258
|
if (unknownFlag !== void 0) return {
|
|
253
259
|
kind: "dispatch-error",
|
|
254
260
|
error: new ParseError(`Unknown flag ${unknownFlag}`, {
|
|
@@ -297,4 +303,4 @@ function planInvocation(options) {
|
|
|
297
303
|
}
|
|
298
304
|
}
|
|
299
305
|
//#endregion
|
|
300
|
-
export { planInvocation };
|
|
306
|
+
export { buildCommandExecutionPlan, buildRootCommandMap, mergeCommandSchema, planInvocation };
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { DeprecationWarning } from "../resolve/contracts.mjs";
|
|
2
|
+
import "../resolve/index.mjs";
|
|
2
3
|
import { CommandMeta, CommandSchema, Out } from "../schema/command.mjs";
|
|
3
|
-
|
|
4
4
|
//#region src/core/cli/plugin.d.ts
|
|
5
5
|
/** Shared hook payload for a concrete command execution. */
|
|
6
6
|
interface PluginCommandContext {
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { HelpOptions } from "../help/index.mjs";
|
|
2
2
|
import { CommandSchema } from "../schema/command.mjs";
|
|
3
|
-
|
|
4
3
|
//#region src/core/cli/root-help.d.ts
|
|
5
4
|
/** Structural subset of `CLISchema` — avoids circular imports through the barrel. */
|
|
6
5
|
interface CLISchemaLike {
|
|
@@ -13,6 +12,8 @@ interface CLISchemaLike {
|
|
|
13
12
|
readonly defaultCommand: {
|
|
14
13
|
readonly schema: CommandSchema;
|
|
15
14
|
} | undefined;
|
|
15
|
+
/** Whether the default is also a named route — listed in `Commands:` when so. */
|
|
16
|
+
readonly defaultCommandRouted?: boolean | undefined;
|
|
16
17
|
readonly helpLinks?: {
|
|
17
18
|
readonly name: string | undefined;
|
|
18
19
|
readonly version: string | undefined;
|