@kjanat/dreamcli 4.0.0-rc.2 → 4.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/README.md +5 -7
- package/dist/{runtime/adapter.d.mts → adapter-D0hbBNVB.d.mts} +5 -7
- package/dist/completion-D4mz6axB.mjs +6 -0
- package/dist/completion.d.mts +90 -0
- package/dist/completion.mjs +1 -0
- package/dist/config-B9ddC-Kb.mjs +1 -0
- package/dist/config.d.mts +2 -0
- package/dist/config.mjs +1 -0
- package/dist/core-Cp2w8vRq.mjs +17 -0
- package/dist/index-BziI2aKc.d.mts +5440 -0
- package/dist/index-DOfClfYR.d.mts +370 -0
- package/dist/index-DWsnGZlx.d.mts +831 -0
- package/dist/{core/cli/index.d.mts → index-DXROeDPC.d.mts} +149 -25
- package/dist/index-DndPmT8J.d.mts +275 -0
- package/dist/{core/json-schema/index.d.mts → index-DyoaS234.d.mts} +54 -45
- package/dist/index.d.mts +190 -41
- package/dist/index.mjs +1 -26
- package/dist/json-schema-C9SzZ7jY.mjs +52 -0
- package/dist/json-schema.d.mts +2 -0
- package/dist/json-schema.mjs +1 -0
- package/dist/package-json-BgE9YjjQ.mjs +3 -0
- package/dist/prompt.d.mts +48 -0
- package/dist/prompt.mjs +1 -0
- package/dist/rolldown-runtime-G4Kt5YOX.mjs +1 -0
- package/dist/runtime.d.mts +2 -6
- package/dist/runtime.mjs +1 -6
- package/dist/terminal-C8KTXjv5.mjs +6 -0
- package/dist/test-prompter-v__jT2yG.mjs +1 -0
- package/dist/testkit.d.mts +54 -6
- package/dist/testkit.mjs +1 -5
- package/dist/version.d.mts +16 -4
- package/dist/version.mjs +1 -7
- package/dreamcli.schema.json +697 -538
- package/package.json +37 -12
- package/skills/cli-creation/SKILL.md +16 -11
- package/CHANGELOG.md +0 -2453
- package/dist/core/cli/builtins.d.mts +0 -47
- package/dist/core/cli/builtins.mjs +0 -135
- package/dist/core/cli/compiled.d.mts +0 -29
- package/dist/core/cli/compiled.mjs +0 -76
- package/dist/core/cli/dispatch.d.mts +0 -38
- package/dist/core/cli/dispatch.mjs +0 -205
- package/dist/core/cli/help-links.d.mts +0 -15
- package/dist/core/cli/help-links.mjs +0 -41
- package/dist/core/cli/index.mjs +0 -1265
- package/dist/core/cli/planner.d.mts +0 -96
- package/dist/core/cli/planner.mjs +0 -323
- package/dist/core/cli/plugin.d.mts +0 -94
- package/dist/core/cli/plugin.mjs +0 -41
- package/dist/core/cli/propagate.d.mts +0 -39
- package/dist/core/cli/propagate.mjs +0 -57
- package/dist/core/cli/reserved-flags.d.mts +0 -1
- package/dist/core/cli/reserved-flags.mjs +0 -158
- package/dist/core/cli/root-help.d.mts +0 -1
- package/dist/core/cli/root-help.mjs +0 -221
- package/dist/core/cli/root-output-flags.d.mts +0 -1
- package/dist/core/cli/root-output-flags.mjs +0 -169
- package/dist/core/cli/root-surface.d.mts +0 -1
- package/dist/core/cli/root-surface.mjs +0 -28
- package/dist/core/cli/runtime-preflight.d.mts +0 -1
- package/dist/core/cli/runtime-preflight.mjs +0 -221
- package/dist/core/completion/index.d.mts +0 -76
- package/dist/core/completion/index.mjs +0 -90
- package/dist/core/completion/shells/bash.d.mts +0 -22
- package/dist/core/completion/shells/bash.mjs +0 -309
- package/dist/core/completion/shells/fish.d.mts +0 -18
- package/dist/core/completion/shells/fish.mjs +0 -163
- package/dist/core/completion/shells/powershell.d.mts +0 -12
- package/dist/core/completion/shells/powershell.mjs +0 -359
- package/dist/core/completion/shells/shared.d.mts +0 -49
- package/dist/core/completion/shells/shared.mjs +0 -147
- package/dist/core/completion/shells/zsh.d.mts +0 -22
- package/dist/core/completion/shells/zsh.mjs +0 -252
- package/dist/core/config/index.d.mts +0 -191
- package/dist/core/config/index.mjs +0 -285
- package/dist/core/config/package-json.d.mts +0 -179
- package/dist/core/config/package-json.mjs +0 -353
- package/dist/core/errors/index.d.mts +0 -126
- package/dist/core/errors/index.mjs +0 -87
- package/dist/core/execution/index.d.mts +0 -1
- package/dist/core/execution/index.mjs +0 -220
- package/dist/core/help/ansi.d.mts +0 -73
- package/dist/core/help/ansi.mjs +0 -121
- package/dist/core/help/index.d.mts +0 -110
- package/dist/core/help/index.mjs +0 -414
- package/dist/core/help/theme.d.mts +0 -48
- package/dist/core/help/theme.mjs +0 -46
- package/dist/core/json-schema/index.mjs +0 -1007
- package/dist/core/json-schema/meta-descriptions.generated.d.mts +0 -274
- package/dist/core/json-schema/meta-descriptions.generated.mjs +0 -136
- package/dist/core/output/activity.d.mts +0 -1
- package/dist/core/output/activity.mjs +0 -452
- package/dist/core/output/bind.d.mts +0 -1
- package/dist/core/output/bind.mjs +0 -56
- package/dist/core/output/contracts.d.mts +0 -81
- package/dist/core/output/contracts.mjs +0 -57
- package/dist/core/output/display-value.d.mts +0 -1
- package/dist/core/output/display-value.mjs +0 -32
- package/dist/core/output/index.d.mts +0 -160
- package/dist/core/output/index.mjs +0 -512
- package/dist/core/output/renderers.d.mts +0 -1
- package/dist/core/output/renderers.mjs +0 -46
- package/dist/core/output/writer.d.mts +0 -39
- package/dist/core/output/writer.mjs +0 -12
- package/dist/core/parse/index.d.mts +0 -178
- package/dist/core/parse/index.mjs +0 -850
- package/dist/core/parse/occurrences.d.mts +0 -89
- package/dist/core/parse/occurrences.mjs +0 -114
- package/dist/core/prompt/index.d.mts +0 -213
- package/dist/core/prompt/index.mjs +0 -348
- package/dist/core/read-flags/index.d.mts +0 -150
- package/dist/core/read-flags/index.mjs +0 -217
- package/dist/core/resolve/args.d.mts +0 -39
- package/dist/core/resolve/args.mjs +0 -182
- package/dist/core/resolve/coerce.d.mts +0 -79
- package/dist/core/resolve/coerce.mjs +0 -900
- package/dist/core/resolve/config.d.mts +0 -1
- package/dist/core/resolve/config.mjs +0 -19
- package/dist/core/resolve/contracts.d.mts +0 -145
- package/dist/core/resolve/errors.d.mts +0 -10
- package/dist/core/resolve/errors.mjs +0 -148
- package/dist/core/resolve/flags.d.mts +0 -47
- package/dist/core/resolve/flags.mjs +0 -246
- package/dist/core/resolve/index.d.mts +0 -44
- package/dist/core/resolve/index.mjs +0 -123
- package/dist/core/resolve/path-checks.d.mts +0 -47
- package/dist/core/resolve/path-checks.mjs +0 -102
- package/dist/core/resolve/redaction.d.mts +0 -12
- package/dist/core/resolve/redaction.mjs +0 -14
- package/dist/core/resolve/stages.d.mts +0 -85
- package/dist/core/resolve/stages.mjs +0 -170
- package/dist/core/resolve/standard.d.mts +0 -1
- package/dist/core/resolve/standard.mjs +0 -212
- package/dist/core/schema/activity.d.mts +0 -189
- package/dist/core/schema/arg.d.mts +0 -1451
- package/dist/core/schema/arg.mjs +0 -1139
- package/dist/core/schema/brand.d.mts +0 -17
- package/dist/core/schema/cardinality.d.mts +0 -301
- package/dist/core/schema/cardinality.mjs +0 -514
- package/dist/core/schema/command.d.mts +0 -1086
- package/dist/core/schema/command.mjs +0 -999
- package/dist/core/schema/flag.d.mts +0 -1487
- package/dist/core/schema/flag.mjs +0 -1207
- package/dist/core/schema/index.d.mts +0 -15
- package/dist/core/schema/index.mjs +0 -10
- package/dist/core/schema/middleware.d.mts +0 -126
- package/dist/core/schema/middleware.mjs +0 -41
- package/dist/core/schema/number-constraints.d.mts +0 -96
- package/dist/core/schema/number-constraints.mjs +0 -60
- package/dist/core/schema/prompt.d.mts +0 -135
- package/dist/core/schema/provenance.d.mts +0 -99
- package/dist/core/schema/provenance.mjs +0 -28
- package/dist/core/schema/run.d.mts +0 -161
- package/dist/core/schema/source.d.mts +0 -179
- package/dist/core/schema/source.mjs +0 -206
- package/dist/core/schema/standard.d.mts +0 -93
- package/dist/core/schema/standard.mjs +0 -15
- package/dist/core/schema/stdin.d.mts +0 -87
- package/dist/core/schema/stdin.mjs +0 -91
- package/dist/core/schema/string-constraints.d.mts +0 -108
- package/dist/core/schema/string-constraints.mjs +0 -86
- package/dist/core/schema/value-parsers.d.mts +0 -150
- package/dist/core/schema/value-parsers.mjs +0 -160
- package/dist/core/schema/value.d.mts +0 -242
- package/dist/core/schema/value.mjs +0 -573
- package/dist/core/testkit/index.d.mts +0 -56
- package/dist/core/testkit/index.mjs +0 -102
- package/dist/runtime/adapter.mjs +0 -92
- package/dist/runtime/auto.d.mts +0 -25
- package/dist/runtime/auto.mjs +0 -45
- package/dist/runtime/deno.d.mts +0 -99
- package/dist/runtime/deno.mjs +0 -265
- package/dist/runtime/detect.d.mts +0 -86
- package/dist/runtime/detect.mjs +0 -45
- package/dist/runtime/index.d.mts +0 -6
- package/dist/runtime/node.d.mts +0 -71
- package/dist/runtime/node.mjs +0 -228
- package/dist/runtime/paths.d.mts +0 -1
- package/dist/runtime/paths.mjs +0 -48
- package/dist/strings.d.mts +0 -12
- package/dist/strings.mjs +0 -22
- package/examples/basic.ts +0 -37
- package/examples/flag-types.ts +0 -79
- package/examples/gh/node_modules/typescript/LICENSE +0 -55
- package/examples/gh/node_modules/typescript/NOTICE.txt +0 -436
- package/examples/gh/node_modules/typescript/README.md +0 -49
- package/examples/gh/node_modules/typescript/bin/tsc +0 -2
- package/examples/gh/node_modules/typescript/dist/api/async/api.d.ts +0 -529
- package/examples/gh/node_modules/typescript/dist/api/async/api.d.ts.map +0 -1
- package/examples/gh/node_modules/typescript/dist/api/async/api.js +0 -1657
- package/examples/gh/node_modules/typescript/dist/api/async/api.js.map +0 -1
- package/examples/gh/node_modules/typescript/dist/api/async/client.d.ts +0 -39
- package/examples/gh/node_modules/typescript/dist/api/async/client.d.ts.map +0 -1
- package/examples/gh/node_modules/typescript/dist/api/async/client.js +0 -211
- package/examples/gh/node_modules/typescript/dist/api/async/client.js.map +0 -1
- package/examples/gh/node_modules/typescript/dist/api/async/types.d.ts +0 -310
- package/examples/gh/node_modules/typescript/dist/api/async/types.d.ts.map +0 -1
- package/examples/gh/node_modules/typescript/dist/api/async/types.js +0 -2
- package/examples/gh/node_modules/typescript/dist/api/async/types.js.map +0 -1
- package/examples/gh/node_modules/typescript/dist/api/compilerOptions.d.ts +0 -109
- package/examples/gh/node_modules/typescript/dist/api/compilerOptions.d.ts.map +0 -1
- package/examples/gh/node_modules/typescript/dist/api/compilerOptions.js +0 -2
- package/examples/gh/node_modules/typescript/dist/api/compilerOptions.js.map +0 -1
- package/examples/gh/node_modules/typescript/dist/api/fs.d.ts +0 -23
- package/examples/gh/node_modules/typescript/dist/api/fs.d.ts.map +0 -1
- package/examples/gh/node_modules/typescript/dist/api/fs.js +0 -109
- package/examples/gh/node_modules/typescript/dist/api/fs.js.map +0 -1
- package/examples/gh/node_modules/typescript/dist/api/node/encoder.d.ts +0 -15
- package/examples/gh/node_modules/typescript/dist/api/node/encoder.d.ts.map +0 -1
- package/examples/gh/node_modules/typescript/dist/api/node/encoder.generated.d.ts +0 -5
- package/examples/gh/node_modules/typescript/dist/api/node/encoder.generated.d.ts.map +0 -1
- package/examples/gh/node_modules/typescript/dist/api/node/encoder.generated.js +0 -74
- package/examples/gh/node_modules/typescript/dist/api/node/encoder.generated.js.map +0 -1
- package/examples/gh/node_modules/typescript/dist/api/node/encoder.js +0 -287
- package/examples/gh/node_modules/typescript/dist/api/node/encoder.js.map +0 -1
- package/examples/gh/node_modules/typescript/dist/api/node/msgpack.d.ts +0 -32
- package/examples/gh/node_modules/typescript/dist/api/node/msgpack.d.ts.map +0 -1
- package/examples/gh/node_modules/typescript/dist/api/node/msgpack.js +0 -213
- package/examples/gh/node_modules/typescript/dist/api/node/msgpack.js.map +0 -1
- package/examples/gh/node_modules/typescript/dist/api/node/node.d.ts +0 -76
- package/examples/gh/node_modules/typescript/dist/api/node/node.d.ts.map +0 -1
- package/examples/gh/node_modules/typescript/dist/api/node/node.generated.d.ts +0 -182
- package/examples/gh/node_modules/typescript/dist/api/node/node.generated.d.ts.map +0 -1
- package/examples/gh/node_modules/typescript/dist/api/node/node.generated.js +0 -835
- package/examples/gh/node_modules/typescript/dist/api/node/node.generated.js.map +0 -1
- package/examples/gh/node_modules/typescript/dist/api/node/node.infrastructure.d.ts +0 -62
- package/examples/gh/node_modules/typescript/dist/api/node/node.infrastructure.d.ts.map +0 -1
- package/examples/gh/node_modules/typescript/dist/api/node/node.infrastructure.js +0 -122
- package/examples/gh/node_modules/typescript/dist/api/node/node.infrastructure.js.map +0 -1
- package/examples/gh/node_modules/typescript/dist/api/node/node.js +0 -298
- package/examples/gh/node_modules/typescript/dist/api/node/node.js.map +0 -1
- package/examples/gh/node_modules/typescript/dist/api/node/protocol.d.ts +0 -29
- package/examples/gh/node_modules/typescript/dist/api/node/protocol.d.ts.map +0 -1
- package/examples/gh/node_modules/typescript/dist/api/node/protocol.generated.d.ts +0 -4
- package/examples/gh/node_modules/typescript/dist/api/node/protocol.generated.d.ts.map +0 -1
- package/examples/gh/node_modules/typescript/dist/api/node/protocol.generated.js +0 -241
- package/examples/gh/node_modules/typescript/dist/api/node/protocol.generated.js.map +0 -1
- package/examples/gh/node_modules/typescript/dist/api/node/protocol.js +0 -30
- package/examples/gh/node_modules/typescript/dist/api/node/protocol.js.map +0 -1
- package/examples/gh/node_modules/typescript/dist/api/node/wtf8.d.ts +0 -6
- package/examples/gh/node_modules/typescript/dist/api/node/wtf8.d.ts.map +0 -1
- package/examples/gh/node_modules/typescript/dist/api/node/wtf8.js +0 -61
- package/examples/gh/node_modules/typescript/dist/api/node/wtf8.js.map +0 -1
- package/examples/gh/node_modules/typescript/dist/api/options.d.ts +0 -32
- package/examples/gh/node_modules/typescript/dist/api/options.d.ts.map +0 -1
- package/examples/gh/node_modules/typescript/dist/api/options.js +0 -11
- package/examples/gh/node_modules/typescript/dist/api/options.js.map +0 -1
- package/examples/gh/node_modules/typescript/dist/api/path.d.ts +0 -110
- package/examples/gh/node_modules/typescript/dist/api/path.d.ts.map +0 -1
- package/examples/gh/node_modules/typescript/dist/api/path.js +0 -508
- package/examples/gh/node_modules/typescript/dist/api/path.js.map +0 -1
- package/examples/gh/node_modules/typescript/dist/api/proto.d.ts +0 -239
- package/examples/gh/node_modules/typescript/dist/api/proto.d.ts.map +0 -1
- package/examples/gh/node_modules/typescript/dist/api/proto.js +0 -37
- package/examples/gh/node_modules/typescript/dist/api/proto.js.map +0 -1
- package/examples/gh/node_modules/typescript/dist/api/sourceFileCache.d.ts +0 -79
- package/examples/gh/node_modules/typescript/dist/api/sourceFileCache.d.ts.map +0 -1
- package/examples/gh/node_modules/typescript/dist/api/sourceFileCache.js +0 -169
- package/examples/gh/node_modules/typescript/dist/api/sourceFileCache.js.map +0 -1
- package/examples/gh/node_modules/typescript/dist/api/sync/api.d.ts +0 -529
- package/examples/gh/node_modules/typescript/dist/api/sync/api.d.ts.map +0 -1
- package/examples/gh/node_modules/typescript/dist/api/sync/api.js +0 -1665
- package/examples/gh/node_modules/typescript/dist/api/sync/api.js.map +0 -1
- package/examples/gh/node_modules/typescript/dist/api/sync/client.d.ts +0 -30
- package/examples/gh/node_modules/typescript/dist/api/sync/client.d.ts.map +0 -1
- package/examples/gh/node_modules/typescript/dist/api/sync/client.js +0 -124
- package/examples/gh/node_modules/typescript/dist/api/sync/client.js.map +0 -1
- package/examples/gh/node_modules/typescript/dist/api/sync/types.d.ts +0 -310
- package/examples/gh/node_modules/typescript/dist/api/sync/types.d.ts.map +0 -1
- package/examples/gh/node_modules/typescript/dist/api/sync/types.js +0 -2
- package/examples/gh/node_modules/typescript/dist/api/sync/types.js.map +0 -1
- package/examples/gh/node_modules/typescript/dist/api/syncChannel.d.ts +0 -114
- package/examples/gh/node_modules/typescript/dist/api/syncChannel.d.ts.map +0 -1
- package/examples/gh/node_modules/typescript/dist/api/syncChannel.js +0 -508
- package/examples/gh/node_modules/typescript/dist/api/syncChannel.js.map +0 -1
- package/examples/gh/node_modules/typescript/dist/api/timing.d.ts +0 -175
- package/examples/gh/node_modules/typescript/dist/api/timing.d.ts.map +0 -1
- package/examples/gh/node_modules/typescript/dist/api/timing.js +0 -149
- package/examples/gh/node_modules/typescript/dist/api/timing.js.map +0 -1
- package/examples/gh/node_modules/typescript/dist/ast/ast.d.ts +0 -100
- package/examples/gh/node_modules/typescript/dist/ast/ast.d.ts.map +0 -1
- package/examples/gh/node_modules/typescript/dist/ast/ast.generated.d.ts +0 -1161
- package/examples/gh/node_modules/typescript/dist/ast/ast.generated.d.ts.map +0 -1
- package/examples/gh/node_modules/typescript/dist/ast/ast.generated.js +0 -4
- package/examples/gh/node_modules/typescript/dist/ast/ast.generated.js.map +0 -1
- package/examples/gh/node_modules/typescript/dist/ast/ast.js +0 -7
- package/examples/gh/node_modules/typescript/dist/ast/ast.js.map +0 -1
- package/examples/gh/node_modules/typescript/dist/ast/astnav.d.ts +0 -19
- package/examples/gh/node_modules/typescript/dist/ast/astnav.d.ts.map +0 -1
- package/examples/gh/node_modules/typescript/dist/ast/astnav.js +0 -596
- package/examples/gh/node_modules/typescript/dist/ast/astnav.js.map +0 -1
- package/examples/gh/node_modules/typescript/dist/ast/clone.d.ts +0 -16
- package/examples/gh/node_modules/typescript/dist/ast/clone.d.ts.map +0 -1
- package/examples/gh/node_modules/typescript/dist/ast/clone.js +0 -104
- package/examples/gh/node_modules/typescript/dist/ast/clone.js.map +0 -1
- package/examples/gh/node_modules/typescript/dist/ast/factory.generated.d.ts +0 -520
- package/examples/gh/node_modules/typescript/dist/ast/factory.generated.d.ts.map +0 -1
- package/examples/gh/node_modules/typescript/dist/ast/factory.generated.js +0 -3057
- package/examples/gh/node_modules/typescript/dist/ast/factory.generated.js.map +0 -1
- package/examples/gh/node_modules/typescript/dist/ast/index.d.ts +0 -20
- package/examples/gh/node_modules/typescript/dist/ast/index.d.ts.map +0 -1
- package/examples/gh/node_modules/typescript/dist/ast/index.js +0 -20
- package/examples/gh/node_modules/typescript/dist/ast/index.js.map +0 -1
- package/examples/gh/node_modules/typescript/dist/ast/is.d.ts +0 -35
- package/examples/gh/node_modules/typescript/dist/ast/is.d.ts.map +0 -1
- package/examples/gh/node_modules/typescript/dist/ast/is.generated.d.ts +0 -329
- package/examples/gh/node_modules/typescript/dist/ast/is.generated.d.ts.map +0 -1
- package/examples/gh/node_modules/typescript/dist/ast/is.generated.js +0 -1103
- package/examples/gh/node_modules/typescript/dist/ast/is.generated.js.map +0 -1
- package/examples/gh/node_modules/typescript/dist/ast/is.js +0 -233
- package/examples/gh/node_modules/typescript/dist/ast/is.js.map +0 -1
- package/examples/gh/node_modules/typescript/dist/ast/jsdoc.d.ts +0 -11
- package/examples/gh/node_modules/typescript/dist/ast/jsdoc.d.ts.map +0 -1
- package/examples/gh/node_modules/typescript/dist/ast/jsdoc.js +0 -202
- package/examples/gh/node_modules/typescript/dist/ast/jsdoc.js.map +0 -1
- package/examples/gh/node_modules/typescript/dist/ast/scanner.d.ts +0 -97
- package/examples/gh/node_modules/typescript/dist/ast/scanner.d.ts.map +0 -1
- package/examples/gh/node_modules/typescript/dist/ast/scanner.js +0 -2230
- package/examples/gh/node_modules/typescript/dist/ast/scanner.js.map +0 -1
- package/examples/gh/node_modules/typescript/dist/ast/utils.d.ts +0 -17
- package/examples/gh/node_modules/typescript/dist/ast/utils.d.ts.map +0 -1
- package/examples/gh/node_modules/typescript/dist/ast/utils.js +0 -67
- package/examples/gh/node_modules/typescript/dist/ast/utils.js.map +0 -1
- package/examples/gh/node_modules/typescript/dist/ast/visitor.d.ts +0 -14
- package/examples/gh/node_modules/typescript/dist/ast/visitor.d.ts.map +0 -1
- package/examples/gh/node_modules/typescript/dist/ast/visitor.generated.d.ts +0 -50
- package/examples/gh/node_modules/typescript/dist/ast/visitor.generated.d.ts.map +0 -1
- package/examples/gh/node_modules/typescript/dist/ast/visitor.generated.js +0 -978
- package/examples/gh/node_modules/typescript/dist/ast/visitor.generated.js.map +0 -1
- package/examples/gh/node_modules/typescript/dist/ast/visitor.js +0 -47
- package/examples/gh/node_modules/typescript/dist/ast/visitor.js.map +0 -1
- package/examples/gh/node_modules/typescript/dist/enums/characterCodes.d.ts +0 -2
- package/examples/gh/node_modules/typescript/dist/enums/characterCodes.d.ts.map +0 -1
- package/examples/gh/node_modules/typescript/dist/enums/characterCodes.enum.d.ts +0 -129
- package/examples/gh/node_modules/typescript/dist/enums/characterCodes.enum.d.ts.map +0 -1
- package/examples/gh/node_modules/typescript/dist/enums/characterCodes.enum.js +0 -132
- package/examples/gh/node_modules/typescript/dist/enums/characterCodes.enum.js.map +0 -1
- package/examples/gh/node_modules/typescript/dist/enums/characterCodes.js +0 -130
- package/examples/gh/node_modules/typescript/dist/enums/characterCodes.js.map +0 -1
- package/examples/gh/node_modules/typescript/dist/enums/commentDirectiveType.d.ts +0 -2
- package/examples/gh/node_modules/typescript/dist/enums/commentDirectiveType.d.ts.map +0 -1
- package/examples/gh/node_modules/typescript/dist/enums/commentDirectiveType.enum.d.ts +0 -5
- package/examples/gh/node_modules/typescript/dist/enums/commentDirectiveType.enum.d.ts.map +0 -1
- package/examples/gh/node_modules/typescript/dist/enums/commentDirectiveType.enum.js +0 -6
- package/examples/gh/node_modules/typescript/dist/enums/commentDirectiveType.enum.js.map +0 -1
- package/examples/gh/node_modules/typescript/dist/enums/commentDirectiveType.js +0 -6
- package/examples/gh/node_modules/typescript/dist/enums/commentDirectiveType.js.map +0 -1
- package/examples/gh/node_modules/typescript/dist/enums/completionItemKind.d.ts +0 -2
- package/examples/gh/node_modules/typescript/dist/enums/completionItemKind.d.ts.map +0 -1
- package/examples/gh/node_modules/typescript/dist/enums/completionItemKind.enum.d.ts +0 -28
- package/examples/gh/node_modules/typescript/dist/enums/completionItemKind.enum.d.ts.map +0 -1
- package/examples/gh/node_modules/typescript/dist/enums/completionItemKind.enum.js +0 -30
- package/examples/gh/node_modules/typescript/dist/enums/completionItemKind.enum.js.map +0 -1
- package/examples/gh/node_modules/typescript/dist/enums/completionItemKind.js +0 -30
- package/examples/gh/node_modules/typescript/dist/enums/completionItemKind.js.map +0 -1
- package/examples/gh/node_modules/typescript/dist/enums/diagnosticCategory.d.ts +0 -2
- package/examples/gh/node_modules/typescript/dist/enums/diagnosticCategory.d.ts.map +0 -1
- package/examples/gh/node_modules/typescript/dist/enums/diagnosticCategory.enum.d.ts +0 -7
- package/examples/gh/node_modules/typescript/dist/enums/diagnosticCategory.enum.d.ts.map +0 -1
- package/examples/gh/node_modules/typescript/dist/enums/diagnosticCategory.enum.js +0 -9
- package/examples/gh/node_modules/typescript/dist/enums/diagnosticCategory.enum.js.map +0 -1
- package/examples/gh/node_modules/typescript/dist/enums/diagnosticCategory.js +0 -9
- package/examples/gh/node_modules/typescript/dist/enums/diagnosticCategory.js.map +0 -1
- package/examples/gh/node_modules/typescript/dist/enums/elementFlags.d.ts +0 -2
- package/examples/gh/node_modules/typescript/dist/enums/elementFlags.d.ts.map +0 -1
- package/examples/gh/node_modules/typescript/dist/enums/elementFlags.enum.d.ts +0 -12
- package/examples/gh/node_modules/typescript/dist/enums/elementFlags.enum.d.ts.map +0 -1
- package/examples/gh/node_modules/typescript/dist/enums/elementFlags.enum.js +0 -14
- package/examples/gh/node_modules/typescript/dist/enums/elementFlags.enum.js.map +0 -1
- package/examples/gh/node_modules/typescript/dist/enums/elementFlags.js +0 -14
- package/examples/gh/node_modules/typescript/dist/enums/elementFlags.js.map +0 -1
- package/examples/gh/node_modules/typescript/dist/enums/internalSymbolName.d.ts +0 -2
- package/examples/gh/node_modules/typescript/dist/enums/internalSymbolName.d.ts.map +0 -1
- package/examples/gh/node_modules/typescript/dist/enums/internalSymbolName.enum.d.ts +0 -23
- package/examples/gh/node_modules/typescript/dist/enums/internalSymbolName.enum.d.ts.map +0 -1
- package/examples/gh/node_modules/typescript/dist/enums/internalSymbolName.enum.js +0 -25
- package/examples/gh/node_modules/typescript/dist/enums/internalSymbolName.enum.js.map +0 -1
- package/examples/gh/node_modules/typescript/dist/enums/internalSymbolName.js +0 -25
- package/examples/gh/node_modules/typescript/dist/enums/internalSymbolName.js.map +0 -1
- package/examples/gh/node_modules/typescript/dist/enums/jsxEmit.d.ts +0 -2
- package/examples/gh/node_modules/typescript/dist/enums/jsxEmit.d.ts.map +0 -1
- package/examples/gh/node_modules/typescript/dist/enums/jsxEmit.enum.d.ts +0 -9
- package/examples/gh/node_modules/typescript/dist/enums/jsxEmit.enum.d.ts.map +0 -1
- package/examples/gh/node_modules/typescript/dist/enums/jsxEmit.enum.js +0 -11
- package/examples/gh/node_modules/typescript/dist/enums/jsxEmit.enum.js.map +0 -1
- package/examples/gh/node_modules/typescript/dist/enums/jsxEmit.js +0 -11
- package/examples/gh/node_modules/typescript/dist/enums/jsxEmit.js.map +0 -1
- package/examples/gh/node_modules/typescript/dist/enums/languageVariant.d.ts +0 -2
- package/examples/gh/node_modules/typescript/dist/enums/languageVariant.d.ts.map +0 -1
- package/examples/gh/node_modules/typescript/dist/enums/languageVariant.enum.d.ts +0 -5
- package/examples/gh/node_modules/typescript/dist/enums/languageVariant.enum.d.ts.map +0 -1
- package/examples/gh/node_modules/typescript/dist/enums/languageVariant.enum.js +0 -6
- package/examples/gh/node_modules/typescript/dist/enums/languageVariant.enum.js.map +0 -1
- package/examples/gh/node_modules/typescript/dist/enums/languageVariant.js +0 -6
- package/examples/gh/node_modules/typescript/dist/enums/languageVariant.js.map +0 -1
- package/examples/gh/node_modules/typescript/dist/enums/modifierFlags.d.ts +0 -2
- package/examples/gh/node_modules/typescript/dist/enums/modifierFlags.d.ts.map +0 -1
- package/examples/gh/node_modules/typescript/dist/enums/modifierFlags.enum.d.ts +0 -42
- package/examples/gh/node_modules/typescript/dist/enums/modifierFlags.enum.d.ts.map +0 -1
- package/examples/gh/node_modules/typescript/dist/enums/modifierFlags.enum.js +0 -44
- package/examples/gh/node_modules/typescript/dist/enums/modifierFlags.enum.js.map +0 -1
- package/examples/gh/node_modules/typescript/dist/enums/modifierFlags.js +0 -44
- package/examples/gh/node_modules/typescript/dist/enums/modifierFlags.js.map +0 -1
- package/examples/gh/node_modules/typescript/dist/enums/moduleDetectionKind.d.ts +0 -2
- package/examples/gh/node_modules/typescript/dist/enums/moduleDetectionKind.d.ts.map +0 -1
- package/examples/gh/node_modules/typescript/dist/enums/moduleDetectionKind.enum.d.ts +0 -7
- package/examples/gh/node_modules/typescript/dist/enums/moduleDetectionKind.enum.d.ts.map +0 -1
- package/examples/gh/node_modules/typescript/dist/enums/moduleDetectionKind.enum.js +0 -9
- package/examples/gh/node_modules/typescript/dist/enums/moduleDetectionKind.enum.js.map +0 -1
- package/examples/gh/node_modules/typescript/dist/enums/moduleDetectionKind.js +0 -9
- package/examples/gh/node_modules/typescript/dist/enums/moduleDetectionKind.js.map +0 -1
- package/examples/gh/node_modules/typescript/dist/enums/moduleKind.d.ts +0 -2
- package/examples/gh/node_modules/typescript/dist/enums/moduleKind.d.ts.map +0 -1
- package/examples/gh/node_modules/typescript/dist/enums/moduleKind.enum.d.ts +0 -17
- package/examples/gh/node_modules/typescript/dist/enums/moduleKind.enum.d.ts.map +0 -1
- package/examples/gh/node_modules/typescript/dist/enums/moduleKind.enum.js +0 -19
- package/examples/gh/node_modules/typescript/dist/enums/moduleKind.enum.js.map +0 -1
- package/examples/gh/node_modules/typescript/dist/enums/moduleKind.js +0 -19
- package/examples/gh/node_modules/typescript/dist/enums/moduleKind.js.map +0 -1
- package/examples/gh/node_modules/typescript/dist/enums/moduleResolutionKind.d.ts +0 -2
- package/examples/gh/node_modules/typescript/dist/enums/moduleResolutionKind.d.ts.map +0 -1
- package/examples/gh/node_modules/typescript/dist/enums/moduleResolutionKind.enum.d.ts +0 -9
- package/examples/gh/node_modules/typescript/dist/enums/moduleResolutionKind.enum.d.ts.map +0 -1
- package/examples/gh/node_modules/typescript/dist/enums/moduleResolutionKind.enum.js +0 -11
- package/examples/gh/node_modules/typescript/dist/enums/moduleResolutionKind.enum.js.map +0 -1
- package/examples/gh/node_modules/typescript/dist/enums/moduleResolutionKind.js +0 -11
- package/examples/gh/node_modules/typescript/dist/enums/moduleResolutionKind.js.map +0 -1
- package/examples/gh/node_modules/typescript/dist/enums/newLineKind.d.ts +0 -2
- package/examples/gh/node_modules/typescript/dist/enums/newLineKind.d.ts.map +0 -1
- package/examples/gh/node_modules/typescript/dist/enums/newLineKind.enum.d.ts +0 -6
- package/examples/gh/node_modules/typescript/dist/enums/newLineKind.enum.d.ts.map +0 -1
- package/examples/gh/node_modules/typescript/dist/enums/newLineKind.enum.js +0 -8
- package/examples/gh/node_modules/typescript/dist/enums/newLineKind.enum.js.map +0 -1
- package/examples/gh/node_modules/typescript/dist/enums/newLineKind.js +0 -8
- package/examples/gh/node_modules/typescript/dist/enums/newLineKind.js.map +0 -1
- package/examples/gh/node_modules/typescript/dist/enums/nodeBuilderFlags.d.ts +0 -2
- package/examples/gh/node_modules/typescript/dist/enums/nodeBuilderFlags.d.ts.map +0 -1
- package/examples/gh/node_modules/typescript/dist/enums/nodeBuilderFlags.enum.d.ts +0 -36
- package/examples/gh/node_modules/typescript/dist/enums/nodeBuilderFlags.enum.d.ts.map +0 -1
- package/examples/gh/node_modules/typescript/dist/enums/nodeBuilderFlags.enum.js +0 -38
- package/examples/gh/node_modules/typescript/dist/enums/nodeBuilderFlags.enum.js.map +0 -1
- package/examples/gh/node_modules/typescript/dist/enums/nodeBuilderFlags.js +0 -38
- package/examples/gh/node_modules/typescript/dist/enums/nodeBuilderFlags.js.map +0 -1
- package/examples/gh/node_modules/typescript/dist/enums/nodeFlags.d.ts +0 -2
- package/examples/gh/node_modules/typescript/dist/enums/nodeFlags.d.ts.map +0 -1
- package/examples/gh/node_modules/typescript/dist/enums/nodeFlags.enum.d.ts +0 -44
- package/examples/gh/node_modules/typescript/dist/enums/nodeFlags.enum.d.ts.map +0 -1
- package/examples/gh/node_modules/typescript/dist/enums/nodeFlags.enum.js +0 -46
- package/examples/gh/node_modules/typescript/dist/enums/nodeFlags.enum.js.map +0 -1
- package/examples/gh/node_modules/typescript/dist/enums/nodeFlags.js +0 -46
- package/examples/gh/node_modules/typescript/dist/enums/nodeFlags.js.map +0 -1
- package/examples/gh/node_modules/typescript/dist/enums/objectFlags.d.ts +0 -2
- package/examples/gh/node_modules/typescript/dist/enums/objectFlags.d.ts.map +0 -1
- package/examples/gh/node_modules/typescript/dist/enums/objectFlags.enum.d.ts +0 -50
- package/examples/gh/node_modules/typescript/dist/enums/objectFlags.enum.d.ts.map +0 -1
- package/examples/gh/node_modules/typescript/dist/enums/objectFlags.enum.js +0 -52
- package/examples/gh/node_modules/typescript/dist/enums/objectFlags.enum.js.map +0 -1
- package/examples/gh/node_modules/typescript/dist/enums/objectFlags.js +0 -52
- package/examples/gh/node_modules/typescript/dist/enums/objectFlags.js.map +0 -1
- package/examples/gh/node_modules/typescript/dist/enums/outerExpressionKinds.d.ts +0 -2
- package/examples/gh/node_modules/typescript/dist/enums/outerExpressionKinds.d.ts.map +0 -1
- package/examples/gh/node_modules/typescript/dist/enums/outerExpressionKinds.enum.d.ts +0 -16
- package/examples/gh/node_modules/typescript/dist/enums/outerExpressionKinds.enum.d.ts.map +0 -1
- package/examples/gh/node_modules/typescript/dist/enums/outerExpressionKinds.enum.js +0 -18
- package/examples/gh/node_modules/typescript/dist/enums/outerExpressionKinds.enum.js.map +0 -1
- package/examples/gh/node_modules/typescript/dist/enums/outerExpressionKinds.js +0 -18
- package/examples/gh/node_modules/typescript/dist/enums/outerExpressionKinds.js.map +0 -1
- package/examples/gh/node_modules/typescript/dist/enums/regularExpressionFlags.d.ts +0 -2
- package/examples/gh/node_modules/typescript/dist/enums/regularExpressionFlags.d.ts.map +0 -1
- package/examples/gh/node_modules/typescript/dist/enums/regularExpressionFlags.enum.d.ts +0 -13
- package/examples/gh/node_modules/typescript/dist/enums/regularExpressionFlags.enum.d.ts.map +0 -1
- package/examples/gh/node_modules/typescript/dist/enums/regularExpressionFlags.enum.js +0 -14
- package/examples/gh/node_modules/typescript/dist/enums/regularExpressionFlags.enum.js.map +0 -1
- package/examples/gh/node_modules/typescript/dist/enums/regularExpressionFlags.js +0 -14
- package/examples/gh/node_modules/typescript/dist/enums/regularExpressionFlags.js.map +0 -1
- package/examples/gh/node_modules/typescript/dist/enums/scriptKind.d.ts +0 -2
- package/examples/gh/node_modules/typescript/dist/enums/scriptKind.d.ts.map +0 -1
- package/examples/gh/node_modules/typescript/dist/enums/scriptKind.enum.d.ts +0 -11
- package/examples/gh/node_modules/typescript/dist/enums/scriptKind.enum.d.ts.map +0 -1
- package/examples/gh/node_modules/typescript/dist/enums/scriptKind.enum.js +0 -12
- package/examples/gh/node_modules/typescript/dist/enums/scriptKind.enum.js.map +0 -1
- package/examples/gh/node_modules/typescript/dist/enums/scriptKind.js +0 -12
- package/examples/gh/node_modules/typescript/dist/enums/scriptKind.js.map +0 -1
- package/examples/gh/node_modules/typescript/dist/enums/scriptTarget.d.ts +0 -2
- package/examples/gh/node_modules/typescript/dist/enums/scriptTarget.d.ts.map +0 -1
- package/examples/gh/node_modules/typescript/dist/enums/scriptTarget.enum.d.ts +0 -17
- package/examples/gh/node_modules/typescript/dist/enums/scriptTarget.enum.d.ts.map +0 -1
- package/examples/gh/node_modules/typescript/dist/enums/scriptTarget.enum.js +0 -18
- package/examples/gh/node_modules/typescript/dist/enums/scriptTarget.enum.js.map +0 -1
- package/examples/gh/node_modules/typescript/dist/enums/scriptTarget.js +0 -18
- package/examples/gh/node_modules/typescript/dist/enums/scriptTarget.js.map +0 -1
- package/examples/gh/node_modules/typescript/dist/enums/signatureFlags.d.ts +0 -2
- package/examples/gh/node_modules/typescript/dist/enums/signatureFlags.d.ts.map +0 -1
- package/examples/gh/node_modules/typescript/dist/enums/signatureFlags.enum.d.ts +0 -15
- package/examples/gh/node_modules/typescript/dist/enums/signatureFlags.enum.d.ts.map +0 -1
- package/examples/gh/node_modules/typescript/dist/enums/signatureFlags.enum.js +0 -17
- package/examples/gh/node_modules/typescript/dist/enums/signatureFlags.enum.js.map +0 -1
- package/examples/gh/node_modules/typescript/dist/enums/signatureFlags.js +0 -17
- package/examples/gh/node_modules/typescript/dist/enums/signatureFlags.js.map +0 -1
- package/examples/gh/node_modules/typescript/dist/enums/signatureKind.d.ts +0 -2
- package/examples/gh/node_modules/typescript/dist/enums/signatureKind.d.ts.map +0 -1
- package/examples/gh/node_modules/typescript/dist/enums/signatureKind.enum.d.ts +0 -5
- package/examples/gh/node_modules/typescript/dist/enums/signatureKind.enum.d.ts.map +0 -1
- package/examples/gh/node_modules/typescript/dist/enums/signatureKind.enum.js +0 -7
- package/examples/gh/node_modules/typescript/dist/enums/signatureKind.enum.js.map +0 -1
- package/examples/gh/node_modules/typescript/dist/enums/signatureKind.js +0 -7
- package/examples/gh/node_modules/typescript/dist/enums/signatureKind.js.map +0 -1
- package/examples/gh/node_modules/typescript/dist/enums/symbolFlags.d.ts +0 -2
- package/examples/gh/node_modules/typescript/dist/enums/symbolFlags.d.ts.map +0 -1
- package/examples/gh/node_modules/typescript/dist/enums/symbolFlags.enum.d.ts +0 -71
- package/examples/gh/node_modules/typescript/dist/enums/symbolFlags.enum.d.ts.map +0 -1
- package/examples/gh/node_modules/typescript/dist/enums/symbolFlags.enum.js +0 -73
- package/examples/gh/node_modules/typescript/dist/enums/symbolFlags.enum.js.map +0 -1
- package/examples/gh/node_modules/typescript/dist/enums/symbolFlags.js +0 -73
- package/examples/gh/node_modules/typescript/dist/enums/symbolFlags.js.map +0 -1
- package/examples/gh/node_modules/typescript/dist/enums/syntaxKind.d.ts +0 -2
- package/examples/gh/node_modules/typescript/dist/enums/syntaxKind.d.ts.map +0 -1
- package/examples/gh/node_modules/typescript/dist/enums/syntaxKind.enum.d.ts +0 -389
- package/examples/gh/node_modules/typescript/dist/enums/syntaxKind.enum.d.ts.map +0 -1
- package/examples/gh/node_modules/typescript/dist/enums/syntaxKind.enum.js +0 -391
- package/examples/gh/node_modules/typescript/dist/enums/syntaxKind.enum.js.map +0 -1
- package/examples/gh/node_modules/typescript/dist/enums/syntaxKind.js +0 -391
- package/examples/gh/node_modules/typescript/dist/enums/syntaxKind.js.map +0 -1
- package/examples/gh/node_modules/typescript/dist/enums/tokenFlags.d.ts +0 -2
- package/examples/gh/node_modules/typescript/dist/enums/tokenFlags.d.ts.map +0 -1
- package/examples/gh/node_modules/typescript/dist/enums/tokenFlags.enum.d.ts +0 -30
- package/examples/gh/node_modules/typescript/dist/enums/tokenFlags.enum.d.ts.map +0 -1
- package/examples/gh/node_modules/typescript/dist/enums/tokenFlags.enum.js +0 -32
- package/examples/gh/node_modules/typescript/dist/enums/tokenFlags.enum.js.map +0 -1
- package/examples/gh/node_modules/typescript/dist/enums/tokenFlags.js +0 -32
- package/examples/gh/node_modules/typescript/dist/enums/tokenFlags.js.map +0 -1
- package/examples/gh/node_modules/typescript/dist/enums/typeFlags.d.ts +0 -2
- package/examples/gh/node_modules/typescript/dist/enums/typeFlags.d.ts.map +0 -1
- package/examples/gh/node_modules/typescript/dist/enums/typeFlags.enum.d.ts +0 -76
- package/examples/gh/node_modules/typescript/dist/enums/typeFlags.enum.d.ts.map +0 -1
- package/examples/gh/node_modules/typescript/dist/enums/typeFlags.enum.js +0 -78
- package/examples/gh/node_modules/typescript/dist/enums/typeFlags.enum.js.map +0 -1
- package/examples/gh/node_modules/typescript/dist/enums/typeFlags.js +0 -78
- package/examples/gh/node_modules/typescript/dist/enums/typeFlags.js.map +0 -1
- package/examples/gh/node_modules/typescript/dist/enums/typePredicateKind.d.ts +0 -2
- package/examples/gh/node_modules/typescript/dist/enums/typePredicateKind.d.ts.map +0 -1
- package/examples/gh/node_modules/typescript/dist/enums/typePredicateKind.enum.d.ts +0 -7
- package/examples/gh/node_modules/typescript/dist/enums/typePredicateKind.enum.d.ts.map +0 -1
- package/examples/gh/node_modules/typescript/dist/enums/typePredicateKind.enum.js +0 -9
- package/examples/gh/node_modules/typescript/dist/enums/typePredicateKind.enum.js.map +0 -1
- package/examples/gh/node_modules/typescript/dist/enums/typePredicateKind.js +0 -9
- package/examples/gh/node_modules/typescript/dist/enums/typePredicateKind.js.map +0 -1
- package/examples/gh/node_modules/typescript/dist/internal/utils.d.ts +0 -23
- package/examples/gh/node_modules/typescript/dist/internal/utils.d.ts.map +0 -1
- package/examples/gh/node_modules/typescript/dist/internal/utils.js +0 -25
- package/examples/gh/node_modules/typescript/dist/internal/utils.js.map +0 -1
- package/examples/gh/node_modules/typescript/lib/getExePath.d.ts +0 -2
- package/examples/gh/node_modules/typescript/lib/getExePath.js +0 -70
- package/examples/gh/node_modules/typescript/lib/tsc.js +0 -28
- package/examples/gh/node_modules/typescript/lib/version.cjs +0 -3
- package/examples/gh/node_modules/typescript/lib/version.d.cts +0 -2
- package/examples/gh/node_modules/typescript/package.json +0 -87
- package/examples/gh/node_modules/typescript/vendor/vscode-jsonrpc/License.txt +0 -11
- package/examples/gh/node_modules/typescript/vendor/vscode-jsonrpc/README.md +0 -54
- package/examples/gh/node_modules/typescript/vendor/vscode-jsonrpc/lib/browser/main.d.ts +0 -17
- package/examples/gh/node_modules/typescript/vendor/vscode-jsonrpc/lib/browser/main.js +0 -83
- package/examples/gh/node_modules/typescript/vendor/vscode-jsonrpc/lib/browser/ril.d.ts +0 -22
- package/examples/gh/node_modules/typescript/vendor/vscode-jsonrpc/lib/browser/ril.js +0 -210
- package/examples/gh/node_modules/typescript/vendor/vscode-jsonrpc/lib/common/api.d.ts +0 -14
- package/examples/gh/node_modules/typescript/vendor/vscode-jsonrpc/lib/common/api.js +0 -87
- package/examples/gh/node_modules/typescript/vendor/vscode-jsonrpc/lib/common/cancellation.d.ts +0 -32
- package/examples/gh/node_modules/typescript/vendor/vscode-jsonrpc/lib/common/cancellation.js +0 -132
- package/examples/gh/node_modules/typescript/vendor/vscode-jsonrpc/lib/common/connection.d.ts +0 -367
- package/examples/gh/node_modules/typescript/vendor/vscode-jsonrpc/lib/common/connection.js +0 -1271
- package/examples/gh/node_modules/typescript/vendor/vscode-jsonrpc/lib/common/disposable.d.ts +0 -9
- package/examples/gh/node_modules/typescript/vendor/vscode-jsonrpc/lib/common/disposable.js +0 -16
- package/examples/gh/node_modules/typescript/vendor/vscode-jsonrpc/lib/common/encoding.d.ts +0 -52
- package/examples/gh/node_modules/typescript/vendor/vscode-jsonrpc/lib/common/encoding.js +0 -70
- package/examples/gh/node_modules/typescript/vendor/vscode-jsonrpc/lib/common/events.d.ts +0 -39
- package/examples/gh/node_modules/typescript/vendor/vscode-jsonrpc/lib/common/events.js +0 -135
- package/examples/gh/node_modules/typescript/vendor/vscode-jsonrpc/lib/common/is.d.ts +0 -7
- package/examples/gh/node_modules/typescript/vendor/vscode-jsonrpc/lib/common/is.js +0 -34
- package/examples/gh/node_modules/typescript/vendor/vscode-jsonrpc/lib/common/linkedMap.d.ts +0 -55
- package/examples/gh/node_modules/typescript/vendor/vscode-jsonrpc/lib/common/linkedMap.js +0 -412
- package/examples/gh/node_modules/typescript/vendor/vscode-jsonrpc/lib/common/messageBuffer.d.ts +0 -18
- package/examples/gh/node_modules/typescript/vendor/vscode-jsonrpc/lib/common/messageBuffer.js +0 -155
- package/examples/gh/node_modules/typescript/vendor/vscode-jsonrpc/lib/common/messageReader.d.ts +0 -77
- package/examples/gh/node_modules/typescript/vendor/vscode-jsonrpc/lib/common/messageReader.js +0 -246
- package/examples/gh/node_modules/typescript/vendor/vscode-jsonrpc/lib/common/messageWriter.d.ts +0 -60
- package/examples/gh/node_modules/typescript/vendor/vscode-jsonrpc/lib/common/messageWriter.js +0 -157
- package/examples/gh/node_modules/typescript/vendor/vscode-jsonrpc/lib/common/messages.d.ts +0 -369
- package/examples/gh/node_modules/typescript/vendor/vscode-jsonrpc/lib/common/messages.js +0 -436
- package/examples/gh/node_modules/typescript/vendor/vscode-jsonrpc/lib/common/ral.d.ts +0 -74
- package/examples/gh/node_modules/typescript/vendor/vscode-jsonrpc/lib/common/ral.js +0 -23
- package/examples/gh/node_modules/typescript/vendor/vscode-jsonrpc/lib/common/semaphore.d.ts +0 -10
- package/examples/gh/node_modules/typescript/vendor/vscode-jsonrpc/lib/common/semaphore.js +0 -74
- package/examples/gh/node_modules/typescript/vendor/vscode-jsonrpc/lib/common/sharedArrayCancellation.d.ts +0 -15
- package/examples/gh/node_modules/typescript/vendor/vscode-jsonrpc/lib/common/sharedArrayCancellation.js +0 -77
- package/examples/gh/node_modules/typescript/vendor/vscode-jsonrpc/lib/node/main.d.ts +0 -58
- package/examples/gh/node_modules/typescript/vendor/vscode-jsonrpc/lib/node/main.js +0 -289
- package/examples/gh/node_modules/typescript/vendor/vscode-jsonrpc/lib/node/ril.d.ts +0 -12
- package/examples/gh/node_modules/typescript/vendor/vscode-jsonrpc/lib/node/ril.js +0 -163
- package/examples/gh/node_modules/typescript/vendor/vscode-jsonrpc/package.json +0 -54
- package/examples/gh/node_modules/typescript/vendor/vscode-jsonrpc/typings/thenable.d.ts +0 -5
- package/examples/gh/package.json +0 -45
- package/examples/gh/src/commands/auth.ts +0 -66
- package/examples/gh/src/commands/issue.ts +0 -120
- package/examples/gh/src/commands/pr.ts +0 -125
- package/examples/gh/src/data/issues.yaml +0 -5
- package/examples/gh/src/data/issues.yaml.d.ts +0 -17
- package/examples/gh/src/data/pull-requests.yaml +0 -7
- package/examples/gh/src/data/pull-requests.yaml.d.ts +0 -18
- package/examples/gh/src/docs.ts +0 -11
- package/examples/gh/src/lib/auth.ts +0 -37
- package/examples/gh/src/lib/utils.ts +0 -17
- package/examples/gh/src/main.test.ts +0 -307
- package/examples/gh/src/main.ts +0 -46
- package/examples/help-config.ts +0 -43
- package/examples/interactive.ts +0 -67
- package/examples/json-mode.ts +0 -95
- package/examples/middleware.ts +0 -71
- package/examples/multi-command.ts +0 -66
- package/examples/output-extras.ts +0 -46
- package/examples/parser-control.ts +0 -40
- package/examples/pwsh-demo/README.md +0 -40
- package/examples/pwsh-demo/package.json +0 -41
- package/examples/pwsh-demo/pwsh-demo.cmd +0 -3
- package/examples/pwsh-demo/smoke-powershell.ps1 +0 -218
- package/examples/pwsh-demo/src/main.test.ts +0 -45
- package/examples/pwsh-demo/src/main.ts +0 -140
- package/examples/spinner-progress.ts +0 -49
- package/examples/standard-schema.ts +0 -45
- package/examples/testing.ts +0 -147
- package/examples/transport-launcher.ts +0 -85
|
@@ -1,1487 +0,0 @@
|
|
|
1
|
-
import { schemaBrand } from "./brand.mjs";
|
|
2
|
-
import { NumberConstraints } from "./number-constraints.mjs";
|
|
3
|
-
import { ConfirmPromptConfig, InputPromptConfig, MultiselectPromptConfig, PROMPT_KINDS, PromptConfig, PromptConfigBase, PromptKind, PromptResult, SelectChoice, SelectPromptConfig } from "./prompt.mjs";
|
|
4
|
-
import { InferStandardOutput, StandardSchemaV1 } from "./standard.mjs";
|
|
5
|
-
import { STDIN_CONSUMES, STDIN_WHENS, StdinBinding, StdinConsume, StdinOptions, StdinWhen } from "./stdin.mjs";
|
|
6
|
-
import { StringConstraintViolation, StringConstraints } from "./string-constraints.mjs";
|
|
7
|
-
import { DateFlagOptions, PathChecks, PathFlagOptions, UrlFlagOptions } from "./value-parsers.mjs";
|
|
8
|
-
import { DUPLICATE_KEYS, DuplicateKeys, SPLIT_FORMATS, SourceSplitBinding, SplitBinding, SplitFormat, SplitOptions, SplitPolicy, SplitSetting } from "./cardinality.mjs";
|
|
9
|
-
//#region src/core/schema/flag.d.ts
|
|
10
|
-
/** All flag presence states as a runtime array. */
|
|
11
|
-
declare const FLAG_PRESENCES: readonly ["optional", "required", "defaulted"];
|
|
12
|
-
/**
|
|
13
|
-
* Presence describes whether a flag value is guaranteed to exist when the
|
|
14
|
-
* action handler runs:
|
|
15
|
-
*
|
|
16
|
-
* - `'optional'` — not required; unresolved value follows the kind-specific
|
|
17
|
-
* optional fallback (`undefined` for most flags, `[]` for arrays)
|
|
18
|
-
* - `'required'` — must be supplied; error if missing
|
|
19
|
-
* - `'defaulted'` — always present (falls back to default value)
|
|
20
|
-
*/
|
|
21
|
-
type FlagPresence = (typeof FLAG_PRESENCES)[number];
|
|
22
|
-
/**
|
|
23
|
-
* Fallback behavior when an optional flag resolves no value from any source.
|
|
24
|
-
*
|
|
25
|
-
* Most optional flags resolve to `undefined`; array flags instead resolve to
|
|
26
|
-
* an empty array `[]`, and key-value flags to an empty object `{}`.
|
|
27
|
-
*/
|
|
28
|
-
type OptionalFallback = "undefined" | "empty-array" | "empty-object";
|
|
29
|
-
/**
|
|
30
|
-
* Compile-time state carried through the builder chain.
|
|
31
|
-
*
|
|
32
|
-
* Adding new tracked properties only requires extending this interface — no
|
|
33
|
-
* builder signature changes.
|
|
34
|
-
*/
|
|
35
|
-
interface FlagConfig {
|
|
36
|
-
/** The resolved value type (e.g. `string`, `number`, `'us' | 'eu'`). */
|
|
37
|
-
readonly valueType: unknown;
|
|
38
|
-
/** Whether the flag is optional, required, or has a default. */
|
|
39
|
-
readonly presence: FlagPresence;
|
|
40
|
-
/** What an unresolved optional flag becomes at the action boundary. */
|
|
41
|
-
readonly optionalFallback: OptionalFallback;
|
|
42
|
-
/** The runtime kind discriminator, mirroring {@link FlagKind}. */
|
|
43
|
-
readonly flagKind: FlagKind;
|
|
44
|
-
/**
|
|
45
|
-
* Whether this builder may still be passed to `flag.array()` as the
|
|
46
|
-
* element schema.
|
|
47
|
-
*
|
|
48
|
-
* Factories producing element-meaningful kinds start `true`. Flag-level
|
|
49
|
-
* modifiers (`.alias()`, `.env()`, `.prompt()`, `.default()`, …) flip it
|
|
50
|
-
* to `false` — those settings describe the *flag*, are never read from an
|
|
51
|
-
* element schema, and would otherwise be silently ignored.
|
|
52
|
-
*/
|
|
53
|
-
readonly elementEligible: boolean;
|
|
54
|
-
}
|
|
55
|
-
/**
|
|
56
|
-
* Advanced type helper used by {@linkcode FlagBuilder} modifiers to replace presence.
|
|
57
|
-
* Most consumers rely on inference and never reference this directly.
|
|
58
|
-
*/
|
|
59
|
-
type WithPresence<C extends FlagConfig, P extends FlagPresence> = {
|
|
60
|
-
readonly valueType: C["valueType"];
|
|
61
|
-
readonly presence: P;
|
|
62
|
-
readonly optionalFallback: C["optionalFallback"];
|
|
63
|
-
readonly flagKind: C["flagKind"];
|
|
64
|
-
readonly elementEligible: false;
|
|
65
|
-
};
|
|
66
|
-
/**
|
|
67
|
-
* Advanced type helper: marks a builder as no longer usable as an array
|
|
68
|
-
* element (returned by flag-level modifiers whose settings elements ignore).
|
|
69
|
-
*/
|
|
70
|
-
type WithoutElementEligibility<C extends FlagConfig> = {
|
|
71
|
-
readonly valueType: C["valueType"];
|
|
72
|
-
readonly presence: C["presence"];
|
|
73
|
-
readonly optionalFallback: C["optionalFallback"];
|
|
74
|
-
readonly flagKind: C["flagKind"];
|
|
75
|
-
readonly elementEligible: false;
|
|
76
|
-
};
|
|
77
|
-
/**
|
|
78
|
-
* Compute the final value type from config — this is what handlers receive.
|
|
79
|
-
*
|
|
80
|
-
* Advanced type helper: this powers {@link InferFlag} and action-handler
|
|
81
|
-
* inference. Most apps do not need to mention it explicitly.
|
|
82
|
-
*
|
|
83
|
-
* - `'optional'` + `'undefined'` fallback → `T | undefined`
|
|
84
|
-
* - `'optional'` + `'empty-array'` / `'empty-object'` fallback → `T`
|
|
85
|
-
* - `'required'` → `T`
|
|
86
|
-
* - `'defaulted'` → `T`
|
|
87
|
-
*/
|
|
88
|
-
type ResolvedValue<C extends FlagConfig> = C["presence"] extends "optional" ? C["optionalFallback"] extends "undefined" ? C["valueType"] | undefined : C["valueType"] : C["valueType"];
|
|
89
|
-
/**
|
|
90
|
-
* The element config a collection factory assumes when given no element
|
|
91
|
-
* builder: an unconstrained string.
|
|
92
|
-
*/
|
|
93
|
-
type StringElementConfig = {
|
|
94
|
-
/** Element value type. */
|
|
95
|
-
readonly valueType: string;
|
|
96
|
-
/** Elements carry no presence of their own. */
|
|
97
|
-
readonly presence: "optional";
|
|
98
|
-
/** Elements carry no fallback of their own. */
|
|
99
|
-
readonly optionalFallback: "undefined";
|
|
100
|
-
/** Element kind discriminator. */
|
|
101
|
-
readonly flagKind: "string";
|
|
102
|
-
/** Elements are element-eligible by construction. */
|
|
103
|
-
readonly elementEligible: true;
|
|
104
|
-
};
|
|
105
|
-
/** Extract the resolved value type from a {@linkcode FlagBuilder}. */
|
|
106
|
-
type InferFlag<B> = B extends FlagBuilder<infer C extends FlagConfig> ? ResolvedValue<C> : never;
|
|
107
|
-
/** Extract resolved value types from a record of builders. */
|
|
108
|
-
type InferFlags<T extends Record<string, FlagBuilder<FlagConfig>>> = { [K in keyof T]: InferFlag<T[K]>; };
|
|
109
|
-
/**
|
|
110
|
-
* Maps a {@linkcode FlagConfig} to the prompt config types that are compatible
|
|
111
|
-
* with the flag's kind. Prevents compile-time mismatches such as
|
|
112
|
-
* `flag.enum([…]).prompt({ kind: 'multiselect' })`.
|
|
113
|
-
*
|
|
114
|
-
* - `'boolean'` → {@link ConfirmPromptConfig}
|
|
115
|
-
* - `'string'` → {@link InputPromptConfig} | {@link SelectPromptConfig}
|
|
116
|
-
* - `'number'` → {@link InputPromptConfig}
|
|
117
|
-
* - `'enum'` → {@link SelectPromptConfig} | {@link InputPromptConfig}
|
|
118
|
-
* - `'array'` → {@link MultiselectPromptConfig}
|
|
119
|
-
* - `'custom'` → all prompt kinds ({@link PromptConfig})
|
|
120
|
-
* - `'count'` / `'keyValue'` → `never` (not promptable)
|
|
121
|
-
*/
|
|
122
|
-
type PromptConfigByFlagKind = {
|
|
123
|
-
readonly string: InputPromptConfig | SelectPromptConfig;
|
|
124
|
-
readonly number: InputPromptConfig;
|
|
125
|
-
readonly boolean: ConfirmPromptConfig;
|
|
126
|
-
readonly enum: SelectPromptConfig | InputPromptConfig;
|
|
127
|
-
readonly array: MultiselectPromptConfig;
|
|
128
|
-
readonly custom: PromptConfig;
|
|
129
|
-
readonly count: never;
|
|
130
|
-
readonly keyValue: never;
|
|
131
|
-
};
|
|
132
|
-
/** Prompt configuration compatible with the kind carried by a {@link FlagConfig}. */
|
|
133
|
-
type AllowedPromptConfig<C extends FlagConfig> = PromptConfigByFlagKind[C["flagKind"]];
|
|
134
|
-
/** All flag kind discriminators as a runtime array. */
|
|
135
|
-
declare const FLAG_KINDS: readonly ["string", "number", "boolean", "enum", "array", "custom", "count", "keyValue"];
|
|
136
|
-
/** Discriminator for the kind of value a flag accepts. */
|
|
137
|
-
type FlagKind = (typeof FLAG_KINDS)[number];
|
|
138
|
-
/**
|
|
139
|
-
* Custom parse function for `flag.custom()`.
|
|
140
|
-
*
|
|
141
|
-
* Receives `string` from CLI argv and env vars, or any JSON-representable
|
|
142
|
-
* value from config files. Narrow inside the function as needed.
|
|
143
|
-
*/
|
|
144
|
-
type FlagParseFn<T> = (raw: unknown) => T;
|
|
145
|
-
/** Runtime descriptor for a flag alias. */
|
|
146
|
-
interface FlagAlias {
|
|
147
|
-
/** Alias name without `-` / `--` prefix. */
|
|
148
|
-
readonly name: string;
|
|
149
|
-
/** Whether the alias is parser-only and hidden from user-facing surfaces. */
|
|
150
|
-
readonly hidden: boolean;
|
|
151
|
-
}
|
|
152
|
-
/**
|
|
153
|
-
* Negation settings for a boolean flag (set by `.negatable()`).
|
|
154
|
-
*
|
|
155
|
-
* The negated spelling and the positive form are two spellings of ONE
|
|
156
|
-
* logical flag: they share duplicate policy, and the last CLI occurrence
|
|
157
|
-
* wins across both. The negated spelling is presence-only — `--no-foo=x`
|
|
158
|
-
* is rejected.
|
|
159
|
-
*/
|
|
160
|
-
interface FlagNegation {
|
|
161
|
-
/**
|
|
162
|
-
* Explicit negated spelling without the `--` prefix (e.g. `'no-sandbox'`).
|
|
163
|
-
* `undefined` synthesizes `no-<flagName>` wherever the flag name is known.
|
|
164
|
-
*/
|
|
165
|
-
readonly alias: string | undefined;
|
|
166
|
-
/** Hide the negated spelling from help, completions, and suggestions. */
|
|
167
|
-
readonly hidden: boolean;
|
|
168
|
-
}
|
|
169
|
-
/**
|
|
170
|
-
* How repeated CLI occurrences of a singleton flag combine.
|
|
171
|
-
*
|
|
172
|
-
* - `'last'` — last occurrence wins (matches historic behavior)
|
|
173
|
-
* - `'first'` — first occurrence wins; later ones parse but are ignored
|
|
174
|
-
* - `'error'` — a second occurrence is a `ParseError` (`DUPLICATE_FLAG`)
|
|
175
|
-
*
|
|
176
|
-
* Applies to CLI token occurrences only — env/config/prompt/default
|
|
177
|
-
* resolution keeps its precedence semantics and never raises duplicates.
|
|
178
|
-
* Occurrences are counted per *logical* flag: aliases and the negated
|
|
179
|
-
* spelling all count toward the same flag.
|
|
180
|
-
*
|
|
181
|
-
* @defaultValue `'last'`
|
|
182
|
-
*/
|
|
183
|
-
type DuplicatePolicy = "last" | "first" | "error";
|
|
184
|
-
/**
|
|
185
|
-
* The runtime descriptor stored inside every {@linkcode FlagBuilder}. Consumers (parser,
|
|
186
|
-
* help generator, resolution chain) read this to understand the flag's shape
|
|
187
|
-
* without touching generics.
|
|
188
|
-
*/
|
|
189
|
-
interface FlagSchema<K extends FlagKind = FlagKind> {
|
|
190
|
-
/** Type-only seal produced by {@link createFlagSchema}. */
|
|
191
|
-
readonly [schemaBrand]: "flag";
|
|
192
|
-
/** What kind of value this flag accepts. */
|
|
193
|
-
readonly kind: K;
|
|
194
|
-
/** Current presence state. */
|
|
195
|
-
readonly presence: FlagPresence;
|
|
196
|
-
/** Runtime default value (if any). */
|
|
197
|
-
readonly defaultValue: unknown;
|
|
198
|
-
/** Short/long aliases (e.g. `[{ name: 'f', hidden: false }]` for `--force`). */
|
|
199
|
-
readonly aliases: readonly FlagAlias[];
|
|
200
|
-
/**
|
|
201
|
-
* Stdin binding set by `.stdin()` (`undefined` when the flag never reads
|
|
202
|
-
* stdin). See {@link StdinBinding}.
|
|
203
|
-
*/
|
|
204
|
-
readonly stdin: StdinBinding | undefined;
|
|
205
|
-
/** Environment variable name for v0.2+ resolution. */
|
|
206
|
-
readonly envVar: string | undefined;
|
|
207
|
-
/** Dotted config path for v0.2+ resolution (e.g. `'deploy.region'`). */
|
|
208
|
-
readonly configPath: string | undefined;
|
|
209
|
-
/** Human-readable description for help text. */
|
|
210
|
-
readonly description: string | undefined;
|
|
211
|
-
/** Allowed literal values when `kind === 'enum'`. */
|
|
212
|
-
readonly enumValues: readonly string[] | undefined;
|
|
213
|
-
/**
|
|
214
|
-
* Numeric constraints when `kind === 'number'` (`undefined` otherwise).
|
|
215
|
-
*
|
|
216
|
-
* Enforced at the parse and resolution boundaries. `finite` defaults to
|
|
217
|
-
* `true`, so `Infinity` is rejected even when no constraints object is set.
|
|
218
|
-
*/
|
|
219
|
-
readonly numberConstraints: NumberConstraints | undefined;
|
|
220
|
-
/**
|
|
221
|
-
* String constraints when `kind === 'string'` (`undefined` otherwise).
|
|
222
|
-
*
|
|
223
|
-
* Enforced at the parse and resolution boundaries, in fixed order:
|
|
224
|
-
* nonEmpty → minLength → maxLength → pattern.
|
|
225
|
-
*/
|
|
226
|
-
readonly stringConstraints: StringConstraints | undefined;
|
|
227
|
-
/** Element schema when `kind === 'array'` or `kind === 'keyValue'`. */
|
|
228
|
-
readonly elementSchema: FlagSchema | undefined;
|
|
229
|
-
/**
|
|
230
|
-
* CLI value separator for a collection kind (`undefined` otherwise).
|
|
231
|
-
*
|
|
232
|
-
* When set, each CLI occurrence is split on this separator before element
|
|
233
|
-
* coercion, so `--tag a,b --tag c` yields `['a', 'b', 'c']`. Other sources
|
|
234
|
-
* decode through {@link FlagSchema.split}.
|
|
235
|
-
*/
|
|
236
|
-
readonly separator: string | undefined;
|
|
237
|
-
/**
|
|
238
|
-
* Env and stdin split policies for a collection kind (`undefined` otherwise).
|
|
239
|
-
*
|
|
240
|
-
* A source the binding leaves out takes its default: comma-delimited for env,
|
|
241
|
-
* line-delimited for stdin.
|
|
242
|
-
*/
|
|
243
|
-
readonly split: SourceSplitBinding | undefined;
|
|
244
|
-
/**
|
|
245
|
-
* How a repeated key combines when `kind === 'keyValue'`.
|
|
246
|
-
*
|
|
247
|
-
* @defaultValue `'last'`
|
|
248
|
-
*/
|
|
249
|
-
readonly duplicateKeys: DuplicateKeys;
|
|
250
|
-
/**
|
|
251
|
-
* Deduplicate resolved array values when `kind === 'array'`.
|
|
252
|
-
*
|
|
253
|
-
* Applied after all sources resolve, preserving first-seen order.
|
|
254
|
-
* Uses `SameValueZero` semantics (like `Set`).
|
|
255
|
-
*/
|
|
256
|
-
readonly unique: boolean;
|
|
257
|
-
/**
|
|
258
|
-
* Filesystem checks for path-valued flags (set by `flag.path()`).
|
|
259
|
-
*
|
|
260
|
-
* Validated after resolution through the runtime adapter.
|
|
261
|
-
*/
|
|
262
|
-
readonly pathChecks: PathChecks | undefined;
|
|
263
|
-
/**
|
|
264
|
-
* Help placeholder label (e.g. `'url'` renders as `<url>`).
|
|
265
|
-
*
|
|
266
|
-
* Set by the sugar factories (`flag.url()`, `flag.date()`, …) so help
|
|
267
|
-
* output names the expected value shape; `undefined` falls back to the
|
|
268
|
-
* kind-derived hint.
|
|
269
|
-
*/
|
|
270
|
-
readonly valueHint: string | undefined;
|
|
271
|
-
/** Interactive prompt configuration for v0.3+ resolution. */
|
|
272
|
-
readonly prompt: PromptConfig | undefined;
|
|
273
|
-
/** Custom parse function (only when `kind === 'custom'`). */
|
|
274
|
-
readonly parseFn: FlagParseFn<unknown> | undefined;
|
|
275
|
-
/**
|
|
276
|
-
* Standard Schema v1 validator applied to each resolved value.
|
|
277
|
-
*
|
|
278
|
-
* When set, the value from any source (CLI, env, config, prompt, default)
|
|
279
|
-
* is validated after resolution via `~standard.validate`. Sync and async
|
|
280
|
-
* validators are both awaited; issues surface as a `CONSTRAINT_VIOLATED`
|
|
281
|
-
* {@link ValidationError}. On a collection this validates every element,
|
|
282
|
-
* whether it rides here or on {@link FlagSchema.elementSchema}.
|
|
283
|
-
*/
|
|
284
|
-
readonly standard: StandardSchemaV1 | undefined;
|
|
285
|
-
/**
|
|
286
|
-
* Standard Schema v1 validator applied to the completed collection.
|
|
287
|
-
*
|
|
288
|
-
* Set by `.standard()` on a collection builder, so the array or record the
|
|
289
|
-
* aggregation produced is validated as a whole after every element passed.
|
|
290
|
-
*/
|
|
291
|
-
readonly aggregateStandard: StandardSchemaV1 | undefined;
|
|
292
|
-
/**
|
|
293
|
-
* Deprecation marker.
|
|
294
|
-
*
|
|
295
|
-
* - `undefined` — not deprecated (default)
|
|
296
|
-
* - `true` — deprecated with no migration message
|
|
297
|
-
* - `string` — deprecated with a reason/migration message
|
|
298
|
-
*
|
|
299
|
-
* When a deprecated flag is used, a warning is emitted to stderr.
|
|
300
|
-
* Help text shows `[deprecated]` or `[deprecated: <reason>]`.
|
|
301
|
-
*/
|
|
302
|
-
readonly deprecated: string | true | undefined;
|
|
303
|
-
/**
|
|
304
|
-
* Whether this flag propagates to subcommands in nested command trees.
|
|
305
|
-
*
|
|
306
|
-
* When `true`, the flag is automatically available to all descendant
|
|
307
|
-
* commands. A child command that defines a flag with the same name
|
|
308
|
-
* shadows the propagated parent flag.
|
|
309
|
-
*
|
|
310
|
-
* @defaultValue `false`
|
|
311
|
-
*/
|
|
312
|
-
readonly propagate: boolean;
|
|
313
|
-
/**
|
|
314
|
-
* Negation settings when `kind === 'boolean'` and `.negatable()` was
|
|
315
|
-
* called (`undefined` otherwise). See {@link FlagNegation}.
|
|
316
|
-
*/
|
|
317
|
-
readonly negation: FlagNegation | undefined;
|
|
318
|
-
/**
|
|
319
|
-
* Duplicate policy for repeated CLI occurrences. See {@link DuplicatePolicy}.
|
|
320
|
-
*
|
|
321
|
-
* @defaultValue `'last'`
|
|
322
|
-
*/
|
|
323
|
-
readonly duplicates: DuplicatePolicy;
|
|
324
|
-
}
|
|
325
|
-
/** Definition fields accepted by every flag kind. */
|
|
326
|
-
interface FlagDefinitionBase {
|
|
327
|
-
/**
|
|
328
|
-
* Presence state.
|
|
329
|
-
* @defaultValue `'optional'`
|
|
330
|
-
*/
|
|
331
|
-
readonly presence?: FlagPresence | undefined;
|
|
332
|
-
/**
|
|
333
|
-
* Runtime default value.
|
|
334
|
-
* @defaultValue `undefined`
|
|
335
|
-
*/
|
|
336
|
-
readonly defaultValue?: unknown;
|
|
337
|
-
/**
|
|
338
|
-
* Short/long aliases as bare names or {@link FlagAlias} records.
|
|
339
|
-
* @defaultValue `[]`
|
|
340
|
-
*/
|
|
341
|
-
readonly aliases?: readonly (string | FlagAlias)[] | undefined;
|
|
342
|
-
/**
|
|
343
|
-
* Stdin binding. See {@link StdinOptions}.
|
|
344
|
-
* @defaultValue `undefined`
|
|
345
|
-
*/
|
|
346
|
-
readonly stdin?: StdinOptions | undefined;
|
|
347
|
-
/**
|
|
348
|
-
* Environment variable name for env resolution.
|
|
349
|
-
* @defaultValue `undefined`
|
|
350
|
-
*/
|
|
351
|
-
readonly envVar?: string | undefined;
|
|
352
|
-
/**
|
|
353
|
-
* Dotted config path for config resolution (e.g. `'deploy.region'`).
|
|
354
|
-
* @defaultValue `undefined`
|
|
355
|
-
*/
|
|
356
|
-
readonly configPath?: string | undefined;
|
|
357
|
-
/**
|
|
358
|
-
* Human-readable description for help text.
|
|
359
|
-
* @defaultValue `undefined`
|
|
360
|
-
*/
|
|
361
|
-
readonly description?: string | undefined;
|
|
362
|
-
/**
|
|
363
|
-
* Help placeholder label (`'url'` renders as `<url>`).
|
|
364
|
-
* @defaultValue `undefined`
|
|
365
|
-
*/
|
|
366
|
-
readonly valueHint?: string | undefined;
|
|
367
|
-
/**
|
|
368
|
-
* Interactive prompt configuration.
|
|
369
|
-
* @defaultValue `undefined`
|
|
370
|
-
*/
|
|
371
|
-
readonly prompt?: PromptConfig | undefined;
|
|
372
|
-
/**
|
|
373
|
-
* Standard Schema v1 validator applied to each resolved value.
|
|
374
|
-
* @defaultValue `undefined`
|
|
375
|
-
*/
|
|
376
|
-
readonly standard?: StandardSchemaV1 | undefined;
|
|
377
|
-
/**
|
|
378
|
-
* Standard Schema v1 validator applied to a completed collection.
|
|
379
|
-
* @defaultValue `undefined`
|
|
380
|
-
*/
|
|
381
|
-
readonly aggregateStandard?: StandardSchemaV1 | undefined;
|
|
382
|
-
/**
|
|
383
|
-
* Deprecation marker. `true` deprecates without a message, a string carries
|
|
384
|
-
* the migration guidance.
|
|
385
|
-
* @defaultValue `undefined`
|
|
386
|
-
*/
|
|
387
|
-
readonly deprecated?: string | true | undefined;
|
|
388
|
-
/**
|
|
389
|
-
* Whether the flag propagates to descendant commands.
|
|
390
|
-
* @defaultValue `false`
|
|
391
|
-
*/
|
|
392
|
-
readonly propagate?: boolean | undefined;
|
|
393
|
-
/**
|
|
394
|
-
* How repeated CLI occurrences combine. See {@link DuplicatePolicy}.
|
|
395
|
-
* @defaultValue `'last'`
|
|
396
|
-
*/
|
|
397
|
-
readonly duplicates?: DuplicatePolicy | undefined;
|
|
398
|
-
}
|
|
399
|
-
/** Definition of a `string` flag. */
|
|
400
|
-
interface StringFlagDefinition extends FlagDefinitionBase {
|
|
401
|
-
/** Kind discriminator. */
|
|
402
|
-
readonly kind: "string";
|
|
403
|
-
/**
|
|
404
|
-
* String constraints enforced at the parse and resolution boundaries.
|
|
405
|
-
* @defaultValue `undefined`
|
|
406
|
-
*/
|
|
407
|
-
readonly stringConstraints?: StringConstraints | undefined;
|
|
408
|
-
/**
|
|
409
|
-
* Filesystem checks applied after resolution.
|
|
410
|
-
* @defaultValue `undefined`
|
|
411
|
-
*/
|
|
412
|
-
readonly pathChecks?: PathChecks | undefined;
|
|
413
|
-
}
|
|
414
|
-
/** Definition of a `number` flag. */
|
|
415
|
-
interface NumberFlagDefinition extends FlagDefinitionBase {
|
|
416
|
-
/** Kind discriminator. */
|
|
417
|
-
readonly kind: "number";
|
|
418
|
-
/**
|
|
419
|
-
* Numeric constraints enforced at the parse and resolution boundaries.
|
|
420
|
-
* @defaultValue `undefined`
|
|
421
|
-
*/
|
|
422
|
-
readonly numberConstraints?: NumberConstraints | undefined;
|
|
423
|
-
}
|
|
424
|
-
/** Definition of a `boolean` flag. */
|
|
425
|
-
interface BooleanFlagDefinition extends FlagDefinitionBase {
|
|
426
|
-
/** Kind discriminator. */
|
|
427
|
-
readonly kind: "boolean";
|
|
428
|
-
/**
|
|
429
|
-
* Negated-spelling settings. See {@link FlagNegation}.
|
|
430
|
-
* @defaultValue `undefined`
|
|
431
|
-
*/
|
|
432
|
-
readonly negation?: FlagNegation | undefined;
|
|
433
|
-
}
|
|
434
|
-
/** Definition of an `enum` flag. */
|
|
435
|
-
interface EnumFlagDefinition extends FlagDefinitionBase {
|
|
436
|
-
/** Kind discriminator. */
|
|
437
|
-
readonly kind: "enum";
|
|
438
|
-
/** Allowed literal values. */
|
|
439
|
-
readonly enumValues: readonly string[];
|
|
440
|
-
}
|
|
441
|
-
/** Definition of an `array` flag. */
|
|
442
|
-
interface ArrayFlagDefinition extends FlagDefinitionBase {
|
|
443
|
-
/** Kind discriminator. */
|
|
444
|
-
readonly kind: "array";
|
|
445
|
-
/**
|
|
446
|
-
* Element definition or an already-built element schema.
|
|
447
|
-
* @defaultValue `undefined`
|
|
448
|
-
*/
|
|
449
|
-
readonly elementSchema?: FlagDefinition | FlagSchema | undefined;
|
|
450
|
-
/**
|
|
451
|
-
* Value separator each CLI occurrence is split on.
|
|
452
|
-
* @defaultValue `undefined`
|
|
453
|
-
*/
|
|
454
|
-
readonly separator?: string | undefined;
|
|
455
|
-
/**
|
|
456
|
-
* Env and stdin split policies.
|
|
457
|
-
* @defaultValue `undefined`
|
|
458
|
-
*/
|
|
459
|
-
readonly split?: SourceSplitBinding | undefined;
|
|
460
|
-
/**
|
|
461
|
-
* Deduplicate the resolved array, preserving first-seen order.
|
|
462
|
-
* @defaultValue `false`
|
|
463
|
-
*/
|
|
464
|
-
readonly unique?: boolean | undefined;
|
|
465
|
-
}
|
|
466
|
-
/** Definition of a `custom` flag. */
|
|
467
|
-
interface CustomFlagDefinition extends FlagDefinitionBase {
|
|
468
|
-
/** Kind discriminator. */
|
|
469
|
-
readonly kind: "custom";
|
|
470
|
-
/**
|
|
471
|
-
* Parse function applied to the raw value.
|
|
472
|
-
* @defaultValue `undefined`
|
|
473
|
-
*/
|
|
474
|
-
readonly parseFn?: FlagParseFn<unknown> | undefined;
|
|
475
|
-
}
|
|
476
|
-
/** Definition of a `count` flag. */
|
|
477
|
-
interface CountFlagDefinition extends FlagDefinitionBase {
|
|
478
|
-
/** Kind discriminator. */
|
|
479
|
-
readonly kind: "count";
|
|
480
|
-
}
|
|
481
|
-
/** Definition of a `keyValue` flag. */
|
|
482
|
-
interface KeyValueFlagDefinition extends FlagDefinitionBase {
|
|
483
|
-
/** Kind discriminator. */
|
|
484
|
-
readonly kind: "keyValue";
|
|
485
|
-
/**
|
|
486
|
-
* Element definition or an already-built element schema for each entry value.
|
|
487
|
-
* @defaultValue `undefined`
|
|
488
|
-
*/
|
|
489
|
-
readonly elementSchema?: FlagDefinition | FlagSchema | undefined;
|
|
490
|
-
/**
|
|
491
|
-
* Pair separator each CLI occurrence is split on.
|
|
492
|
-
* @defaultValue `undefined`
|
|
493
|
-
*/
|
|
494
|
-
readonly separator?: string | undefined;
|
|
495
|
-
/**
|
|
496
|
-
* Env and stdin split policies.
|
|
497
|
-
* @defaultValue `undefined`
|
|
498
|
-
*/
|
|
499
|
-
readonly split?: SourceSplitBinding | undefined;
|
|
500
|
-
/**
|
|
501
|
-
* How a repeated key combines. See {@link DuplicateKeys}.
|
|
502
|
-
* @defaultValue `'last'`
|
|
503
|
-
*/
|
|
504
|
-
readonly duplicateKeys?: DuplicateKeys | undefined;
|
|
505
|
-
}
|
|
506
|
-
/** Maps each {@link FlagKind} to its definition shape. */
|
|
507
|
-
interface FlagDefinitionByKind {
|
|
508
|
-
/** Definition shape for `string` flags. */
|
|
509
|
-
readonly string: StringFlagDefinition;
|
|
510
|
-
/** Definition shape for `number` flags. */
|
|
511
|
-
readonly number: NumberFlagDefinition;
|
|
512
|
-
/** Definition shape for `boolean` flags. */
|
|
513
|
-
readonly boolean: BooleanFlagDefinition;
|
|
514
|
-
/** Definition shape for `enum` flags. */
|
|
515
|
-
readonly enum: EnumFlagDefinition;
|
|
516
|
-
/** Definition shape for `array` flags. */
|
|
517
|
-
readonly array: ArrayFlagDefinition;
|
|
518
|
-
/** Definition shape for `custom` flags. */
|
|
519
|
-
readonly custom: CustomFlagDefinition;
|
|
520
|
-
/** Definition shape for `count` flags. */
|
|
521
|
-
readonly count: CountFlagDefinition;
|
|
522
|
-
/** Definition shape for `keyValue` flags. */
|
|
523
|
-
readonly keyValue: KeyValueFlagDefinition;
|
|
524
|
-
}
|
|
525
|
-
/** Definition of a flag of kind `K`, including the kind discriminator. */
|
|
526
|
-
type FlagDefinition<K extends FlagKind = FlagKind> = FlagDefinitionByKind[K];
|
|
527
|
-
/** Definition of a flag of kind `K` with the kind discriminator removed. */
|
|
528
|
-
type FlagDefinitionOverrides<K extends FlagKind = FlagKind> = Omit<FlagDefinitionByKind[K], "kind">;
|
|
529
|
-
/** Positional factory arguments, requiring fields that the selected kind requires. */
|
|
530
|
-
type FlagDefinitionArguments<K extends FlagKind> = K extends "enum" ? [overrides: FlagDefinitionOverrides<K>] : [overrides?: FlagDefinitionOverrides<K>];
|
|
531
|
-
/**
|
|
532
|
-
* Normalise an alias input into a full {@link FlagAlias} object.
|
|
533
|
-
*
|
|
534
|
-
* @param alias - Raw alias name or structured alias object.
|
|
535
|
-
* @returns Normalised alias record.
|
|
536
|
-
*/
|
|
537
|
-
declare function normalizeFlagAlias(alias: string | FlagAlias): FlagAlias;
|
|
538
|
-
/**
|
|
539
|
-
* Normalise alias input into immutable alias records.
|
|
540
|
-
*
|
|
541
|
-
* @param aliases - Alias input values.
|
|
542
|
-
* @returns Normalised alias objects.
|
|
543
|
-
*/
|
|
544
|
-
declare function normalizeFlagAliases(aliases: readonly (string | FlagAlias)[]): readonly FlagAlias[];
|
|
545
|
-
/**
|
|
546
|
-
* List alias names for a flag schema.
|
|
547
|
-
*
|
|
548
|
-
* @param schema - Flag schema whose aliases should be listed.
|
|
549
|
-
* @param options - Visibility and length filtering.
|
|
550
|
-
* @returns Alias names in registration order.
|
|
551
|
-
*/
|
|
552
|
-
declare function getFlagAliasNames(schema: FlagSchema, options?: {
|
|
553
|
-
readonly includeHidden?: boolean;
|
|
554
|
-
readonly kind?: "all" | "short" | "long";
|
|
555
|
-
}): readonly string[];
|
|
556
|
-
/**
|
|
557
|
-
* Effective negated spelling for a flag, or `undefined` when not negatable.
|
|
558
|
-
*
|
|
559
|
-
* The builder cannot know its flag name, so a default (`no-<name>`) is
|
|
560
|
-
* synthesized here — everywhere the canonical name is known (parser, help,
|
|
561
|
-
* completions, collision validation).
|
|
562
|
-
*
|
|
563
|
-
* @param name - Canonical flag name.
|
|
564
|
-
* @param schema - Flag schema (read for {@link FlagNegation}).
|
|
565
|
-
* @returns The negated spelling without the `--` prefix.
|
|
566
|
-
*/
|
|
567
|
-
declare function getFlagNegatedName(name: string, schema: FlagSchema): string | undefined;
|
|
568
|
-
/** Flag kinds that can read from stdin: every scalar, plus the collections. */
|
|
569
|
-
declare const STDIN_CAPABLE_FLAG_KINDS: readonly ["string", "number", "boolean", "enum", "custom", "array", "keyValue"];
|
|
570
|
-
type StdinCapableFlagKind = (typeof STDIN_CAPABLE_FLAG_KINDS)[number];
|
|
571
|
-
/**
|
|
572
|
-
* Create a raw {@link FlagSchema} object with sensible defaults.
|
|
573
|
-
*
|
|
574
|
-
* Most consumers should prefer the higher-level {@link flag} factory, which
|
|
575
|
-
* returns an immutable {@link FlagBuilder} with type inference and safe
|
|
576
|
-
* modifier chaining. `createFlagSchema()` is the low-level escape hatch for
|
|
577
|
-
* advanced schema composition, tests, or custom factories that need the plain
|
|
578
|
-
* runtime descriptor.
|
|
579
|
-
*
|
|
580
|
-
* Fields are shallow-merged on top of the default shape, so callers are
|
|
581
|
-
* responsible for keeping the resulting schema internally consistent.
|
|
582
|
-
*
|
|
583
|
-
* @param kind - Discriminator for the value type this flag accepts.
|
|
584
|
-
* @param overrides - Definition fields for `kind`, shallow-merged onto defaults.
|
|
585
|
-
* @returns A fully populated {@link FlagSchema}.
|
|
586
|
-
* @throws {CLIError} With code `'INVALID_SCHEMA'` when a field belongs to a
|
|
587
|
-
* different {@link FlagKind}.
|
|
588
|
-
*
|
|
589
|
-
* @example
|
|
590
|
-
* ```ts
|
|
591
|
-
* const schema = createFlagSchema('enum', {
|
|
592
|
-
* enumValues: ['us', 'eu', 'ap'],
|
|
593
|
-
* description: 'Deployment region',
|
|
594
|
-
* });
|
|
595
|
-
* ```
|
|
596
|
-
*/
|
|
597
|
-
declare function createFlagSchema<K extends FlagKind>(kind: K, ...overrides: FlagDefinitionArguments<K>): FlagSchema<K>;
|
|
598
|
-
/**
|
|
599
|
-
* Create a raw {@link FlagSchema} object from a single definition object.
|
|
600
|
-
*
|
|
601
|
-
* An already-built {@link FlagSchema} is accepted and re-normalized into a
|
|
602
|
-
* deep-equal schema.
|
|
603
|
-
*
|
|
604
|
-
* @param definition - Kind discriminator plus the fields valid for that kind.
|
|
605
|
-
* @returns A fully populated {@link FlagSchema}.
|
|
606
|
-
* @throws {CLIError} With code `'INVALID_SCHEMA'` when a field belongs to a
|
|
607
|
-
* different {@link FlagKind}.
|
|
608
|
-
*
|
|
609
|
-
* @example
|
|
610
|
-
* ```ts
|
|
611
|
-
* const schema = createFlagSchema({
|
|
612
|
-
* kind: 'array',
|
|
613
|
-
* elementSchema: { kind: 'string' },
|
|
614
|
-
* separator: ',',
|
|
615
|
-
* });
|
|
616
|
-
* ```
|
|
617
|
-
*/
|
|
618
|
-
declare function createFlagSchema<K extends FlagKind>(definition: FlagDefinition<K> | FlagSchema<K>): FlagSchema<K>;
|
|
619
|
-
/**
|
|
620
|
-
* Immutable flag schema builder.
|
|
621
|
-
*
|
|
622
|
-
* The type parameter `C` is a phantom that tracks the value type and presence
|
|
623
|
-
* through the fluent chain. Each modifier returns a **new** builder — the
|
|
624
|
-
* original is never mutated.
|
|
625
|
-
*
|
|
626
|
-
* @example
|
|
627
|
-
* ```ts
|
|
628
|
-
* const port = flag.number().default(8080);
|
|
629
|
-
* type Port = InferFlag<typeof port>; // number
|
|
630
|
-
*
|
|
631
|
-
* const region = flag.enum(['us', 'eu', 'ap']);
|
|
632
|
-
* type Region = InferFlag<typeof region>; // 'us' | 'eu' | 'ap' | undefined
|
|
633
|
-
* ```
|
|
634
|
-
*/
|
|
635
|
-
declare class FlagBuilder<C extends FlagConfig> {
|
|
636
|
-
/**
|
|
637
|
-
* Create a flag builder from a pre-built schema descriptor.
|
|
638
|
-
*
|
|
639
|
-
* @param schema - Runtime descriptor seeding this builder's state.
|
|
640
|
-
*/
|
|
641
|
-
constructor(schema: FlagSchema);
|
|
642
|
-
/**
|
|
643
|
-
* Provide a default value. The flag becomes "always present" — handlers
|
|
644
|
-
* will never see `undefined`.
|
|
645
|
-
*
|
|
646
|
-
* The generic constraint `V extends C['valueType']` ensures the default
|
|
647
|
-
* matches the flag's declared type.
|
|
648
|
-
*
|
|
649
|
-
* @param value - Fallback value used when no source provides one.
|
|
650
|
-
* @returns The builder (for chaining).
|
|
651
|
-
*
|
|
652
|
-
* @example
|
|
653
|
-
* ```ts
|
|
654
|
-
* flag.number().default(8080).describe('Port to listen on')
|
|
655
|
-
*
|
|
656
|
-
* // $ mycli serve → port = 8080
|
|
657
|
-
* // $ mycli serve --port 443 → port = 443
|
|
658
|
-
* ```
|
|
659
|
-
*/
|
|
660
|
-
default<V extends C["valueType"]>(value: V): FlagBuilder<WithPresence<C, "defaulted">>;
|
|
661
|
-
/**
|
|
662
|
-
* Mark the flag as required. If not resolved from any source the framework
|
|
663
|
-
* will emit a `ValidationError` before the action handler runs.
|
|
664
|
-
*
|
|
665
|
-
* @returns The builder (for chaining).
|
|
666
|
-
*
|
|
667
|
-
* @example
|
|
668
|
-
* ```ts
|
|
669
|
-
* flag.string().required().describe('Deploy target')
|
|
670
|
-
*
|
|
671
|
-
* // $ mycli deploy
|
|
672
|
-
* // # → Error: Missing required flag --target
|
|
673
|
-
* // $ mycli deploy --target staging
|
|
674
|
-
* // # → target = 'staging'
|
|
675
|
-
* ```
|
|
676
|
-
*/
|
|
677
|
-
required(): FlagBuilder<WithPresence<C, "required">>;
|
|
678
|
-
/**
|
|
679
|
-
* Add a short or long alias (e.g. `'f'` for `--force`, `'verbose'` as an
|
|
680
|
-
* alternative long name).
|
|
681
|
-
*
|
|
682
|
-
* @param name - Single-char short alias or alternative long name.
|
|
683
|
-
* @param options - Optional alias metadata. Hidden aliases remain parseable
|
|
684
|
-
* but are omitted from help, completions, and suggestions.
|
|
685
|
-
* @returns The builder (for chaining).
|
|
686
|
-
*
|
|
687
|
-
* @example
|
|
688
|
-
* ```ts
|
|
689
|
-
* flag.boolean().alias('v').describe('Enable verbose output')
|
|
690
|
-
*
|
|
691
|
-
* // $ mycli build -v → verbose = true
|
|
692
|
-
* // $ mycli build --verbose → verbose = true
|
|
693
|
-
* ```
|
|
694
|
-
*/
|
|
695
|
-
alias(name: string, options?: {
|
|
696
|
-
hidden?: boolean;
|
|
697
|
-
}): FlagBuilder<WithoutElementEligibility<C>>;
|
|
698
|
-
/**
|
|
699
|
-
* Bind to an environment variable (resolved in v0.2+).
|
|
700
|
-
*
|
|
701
|
-
* The env value is read after CLI and stdin, and before config, the prompt,
|
|
702
|
-
* and the default: CLI → stdin → **env** → config → prompt → default.
|
|
703
|
-
*
|
|
704
|
-
* @param varName - Environment variable name (e.g. `'PORT'`).
|
|
705
|
-
* @returns The builder (for chaining).
|
|
706
|
-
*
|
|
707
|
-
* @example
|
|
708
|
-
* ```ts
|
|
709
|
-
* flag.string().env('API_KEY').describe('Service API key')
|
|
710
|
-
*
|
|
711
|
-
* // $ API_KEY=sk-123 mycli request → apiKey = 'sk-123'
|
|
712
|
-
* // $ mycli request --api-key sk-456 → apiKey = 'sk-456' (CLI wins)
|
|
713
|
-
* ```
|
|
714
|
-
*/
|
|
715
|
-
env(varName: string): FlagBuilder<WithoutElementEligibility<C>>;
|
|
716
|
-
/**
|
|
717
|
-
* Let this flag read its value from piped stdin.
|
|
718
|
-
*
|
|
719
|
-
* An explicit `--<name> -` is CLI-sourced with bytes from stdin and keeps
|
|
720
|
-
* CLI precedence. An absent flag takes the stdin fallback stage, which sits
|
|
721
|
-
* between CLI and env, so a flag set in the environment still reads stdin
|
|
722
|
-
* and stdin wins. The whole buffer becomes the value, byte for byte for a
|
|
723
|
-
* string flag; every other kind drops the single line terminator a pipe
|
|
724
|
-
* appends before decoding, and `{ trim: true }` drops it for a string flag
|
|
725
|
-
* too.
|
|
726
|
-
*
|
|
727
|
-
* A collection reads the buffer as elements instead: `--tag -` splices what
|
|
728
|
-
* stdin decodes into the position the `-` occupies, so
|
|
729
|
-
* `--tag before --tag - --tag after` over `'a\nb\n'` resolves to
|
|
730
|
-
* `['before', 'a', 'b', 'after']`. `.split({ stdin })` sets the decoding.
|
|
731
|
-
* Each `-` stands for the whole source, so `--tag - --tag -` splices the
|
|
732
|
-
* buffer twice. A `-` typed beside other occurrences with nothing piped fails
|
|
733
|
-
* with `MISSING_STDIN`; occurrences of nothing but `-` fall through to the
|
|
734
|
-
* later sources.
|
|
735
|
-
*
|
|
736
|
-
* A stdin-enabled flag cannot receive a literal `-` as its value, since the
|
|
737
|
-
* token names the source.
|
|
738
|
-
*
|
|
739
|
-
* Available on every flag kind except `count`. One command may declare a
|
|
740
|
-
* single exclusive stdin consumer; pass `{ consume: 'broadcast' }` on every
|
|
741
|
-
* input that should share the buffer.
|
|
742
|
-
*
|
|
743
|
-
* @param options - When to read stdin, how to share it, and whether to trim.
|
|
744
|
-
* @returns The builder (for chaining).
|
|
745
|
-
* @throws {CLIError} With code `'INVALID_SCHEMA'` on a `count` flag.
|
|
746
|
-
*
|
|
747
|
-
* @example
|
|
748
|
-
* ```ts
|
|
749
|
-
* flag.string().stdin().describe('Message body')
|
|
750
|
-
* // $ echo hi | mycli send → body = 'hi\n'
|
|
751
|
-
* // $ mycli send --body - → body reads stdin
|
|
752
|
-
* // $ mycli send --body hello → body = 'hello'
|
|
753
|
-
*
|
|
754
|
-
* flag.string().stdin({ when: 'dash' })
|
|
755
|
-
* // only `--body -` reads stdin
|
|
756
|
-
*
|
|
757
|
-
* flag.path({ mustExist: true }).stdin({ trim: true })
|
|
758
|
-
* // $ echo ./dist | mycli clean → path = './dist', checked on disk
|
|
759
|
-
* ```
|
|
760
|
-
*/
|
|
761
|
-
stdin(this: FlagBuilder<C & {
|
|
762
|
-
readonly flagKind: StdinCapableFlagKind;
|
|
763
|
-
}>, options?: StdinOptions): FlagBuilder<WithoutElementEligibility<C>>;
|
|
764
|
-
/**
|
|
765
|
-
* Bind to a dotted config path (resolved in v0.2+).
|
|
766
|
-
*
|
|
767
|
-
* The config value is read after CLI, stdin, and env, and before the prompt
|
|
768
|
-
* and the default: CLI → stdin → env → **config** → prompt → default.
|
|
769
|
-
*
|
|
770
|
-
* @param path - Dotted config key (e.g. `'deploy.region'`).
|
|
771
|
-
* @returns The builder (for chaining).
|
|
772
|
-
*
|
|
773
|
-
* @example
|
|
774
|
-
* ```ts
|
|
775
|
-
* flag.string().config('deploy.region').default('us-east-1')
|
|
776
|
-
* // Config file: { "deploy": { "region": "eu-west-1" } }
|
|
777
|
-
* // $ mycli deploy
|
|
778
|
-
* // # → region = 'eu-west-1' (from config)
|
|
779
|
-
* // $ mycli deploy --region ap-south-1
|
|
780
|
-
* // # → CLI flag wins
|
|
781
|
-
* ```
|
|
782
|
-
*/
|
|
783
|
-
config(path: string): FlagBuilder<WithoutElementEligibility<C>>;
|
|
784
|
-
/**
|
|
785
|
-
* Human-readable description shown in help output.
|
|
786
|
-
*
|
|
787
|
-
* @param description - Text displayed next to the flag in `--help`.
|
|
788
|
-
* @returns The builder (for chaining).
|
|
789
|
-
*/
|
|
790
|
-
describe(description: string): FlagBuilder<WithoutElementEligibility<C>>;
|
|
791
|
-
/**
|
|
792
|
-
* Attach interactive prompt configuration for v0.3+ resolution.
|
|
793
|
-
*
|
|
794
|
-
* When a flag value is not resolved from CLI, stdin, env, or config, the
|
|
795
|
-
* prompt engine uses this config to interactively ask the user.
|
|
796
|
-
* In non-interactive contexts (CI, piped stdin) prompts are skipped
|
|
797
|
-
* and resolution falls through to default or required validation.
|
|
798
|
-
*
|
|
799
|
-
* @param config - {@link PromptConfig} describing the interactive prompt.
|
|
800
|
-
* @returns The builder (for chaining).
|
|
801
|
-
*
|
|
802
|
-
* @example
|
|
803
|
-
* ```ts
|
|
804
|
-
* flag.string().prompt({ kind: 'input', message: 'Enter value:' })
|
|
805
|
-
*
|
|
806
|
-
* // $ mycli init → prompts "Enter value:" interactively
|
|
807
|
-
* // $ mycli init --name foo → skips prompt, uses CLI value
|
|
808
|
-
* ```
|
|
809
|
-
*/
|
|
810
|
-
prompt(config: AllowedPromptConfig<C>): FlagBuilder<WithoutElementEligibility<C>>;
|
|
811
|
-
/**
|
|
812
|
-
* Mark this flag as deprecated.
|
|
813
|
-
*
|
|
814
|
-
* When used, a warning is emitted to stderr. Help text shows
|
|
815
|
-
* `[deprecated]` or `[deprecated: <reason>]`.
|
|
816
|
-
*
|
|
817
|
-
* Does not change the flag's type-level config — it's metadata only.
|
|
818
|
-
*
|
|
819
|
-
* @param message - Optional migration reason/guidance.
|
|
820
|
-
* @returns The builder (for chaining).
|
|
821
|
-
*
|
|
822
|
-
* @example
|
|
823
|
-
* ```ts
|
|
824
|
-
* flag.string().deprecated('Use --target instead')
|
|
825
|
-
*
|
|
826
|
-
* // $ mycli deploy --dest staging
|
|
827
|
-
* // ⚠ --dest is deprecated: Use --target instead
|
|
828
|
-
* ```
|
|
829
|
-
*/
|
|
830
|
-
deprecated(message?: string): FlagBuilder<WithoutElementEligibility<C>>;
|
|
831
|
-
/**
|
|
832
|
-
* Mark this flag as propagated to subcommands.
|
|
833
|
-
*
|
|
834
|
-
* Propagated flags are automatically available to all descendant
|
|
835
|
-
* commands in a nested command tree. A child command that defines
|
|
836
|
-
* a flag with the same name shadows the propagated parent flag.
|
|
837
|
-
*
|
|
838
|
-
* Does not change the flag's type-level config — it's metadata only.
|
|
839
|
-
*
|
|
840
|
-
* @returns The builder (for chaining).
|
|
841
|
-
*
|
|
842
|
-
* @example
|
|
843
|
-
* ```ts
|
|
844
|
-
* flag.boolean().alias('v').propagate().describe('Enable verbose output')
|
|
845
|
-
*
|
|
846
|
-
* // $ mycli --verbose deploy staging
|
|
847
|
-
* // # → verbose = true in deploy handler
|
|
848
|
-
* // $ mycli deploy --verbose staging
|
|
849
|
-
* // # → same, inherited from parent
|
|
850
|
-
* ```
|
|
851
|
-
*/
|
|
852
|
-
propagate(): FlagBuilder<WithoutElementEligibility<C>>;
|
|
853
|
-
/**
|
|
854
|
-
* Require an integer value. Composes with other numeric constraints.
|
|
855
|
-
*
|
|
856
|
-
* @param value - Whether to require an integer.
|
|
857
|
-
* @defaultValue `true`
|
|
858
|
-
* @returns The builder (for chaining).
|
|
859
|
-
*
|
|
860
|
-
* @example
|
|
861
|
-
* ```ts
|
|
862
|
-
* flag.number().int() // rejects 3.7, accepts 3
|
|
863
|
-
* flag.number({ int: true }).int(false) // re-allows non-integers
|
|
864
|
-
* ```
|
|
865
|
-
*/
|
|
866
|
-
int(this: FlagBuilder<C & {
|
|
867
|
-
readonly flagKind: "number";
|
|
868
|
-
}>, value?: boolean): FlagBuilder<C>;
|
|
869
|
-
/**
|
|
870
|
-
* Set an inclusive lower bound. Composes with other numeric constraints;
|
|
871
|
-
* a later call overrides an earlier `min` (including one from the options
|
|
872
|
-
* object).
|
|
873
|
-
*
|
|
874
|
-
* @param value - Inclusive minimum.
|
|
875
|
-
* @returns The builder (for chaining).
|
|
876
|
-
*
|
|
877
|
-
* @example
|
|
878
|
-
* ```ts
|
|
879
|
-
* flag.number().min(0) // rejects -1, accepts 0
|
|
880
|
-
* flag.number({ min: 0 }).min(5) // effective min is 5
|
|
881
|
-
* ```
|
|
882
|
-
*/
|
|
883
|
-
min(this: FlagBuilder<C & {
|
|
884
|
-
readonly flagKind: "number";
|
|
885
|
-
}>, value: number): FlagBuilder<C>;
|
|
886
|
-
/**
|
|
887
|
-
* Set an inclusive upper bound. Composes with other numeric constraints;
|
|
888
|
-
* a later call overrides an earlier `max`.
|
|
889
|
-
*
|
|
890
|
-
* @param value - Inclusive maximum.
|
|
891
|
-
* @returns The builder (for chaining).
|
|
892
|
-
*
|
|
893
|
-
* @example
|
|
894
|
-
* ```ts
|
|
895
|
-
* flag.number().max(100) // rejects 101, accepts 100
|
|
896
|
-
* ```
|
|
897
|
-
*/
|
|
898
|
-
max(this: FlagBuilder<C & {
|
|
899
|
-
readonly flagKind: "number";
|
|
900
|
-
}>, value: number): FlagBuilder<C>;
|
|
901
|
-
/**
|
|
902
|
-
* Require (or, with `false`, allow) a finite value. Finiteness is enforced
|
|
903
|
-
* by default, so this is mainly used as `.finite(false)` to re-allow
|
|
904
|
-
* `Infinity` / `-Infinity`.
|
|
905
|
-
*
|
|
906
|
-
* @param allow - Whether to require a finite value.
|
|
907
|
-
* @defaultValue `true`
|
|
908
|
-
* @returns The builder (for chaining).
|
|
909
|
-
*
|
|
910
|
-
* @example
|
|
911
|
-
* ```ts
|
|
912
|
-
* flag.number().finite(false) // accepts Infinity
|
|
913
|
-
* ```
|
|
914
|
-
*/
|
|
915
|
-
finite(this: FlagBuilder<C & {
|
|
916
|
-
readonly flagKind: "number";
|
|
917
|
-
}>, allow?: boolean): FlagBuilder<C>;
|
|
918
|
-
/**
|
|
919
|
-
* Reject empty strings. Composes with other string constraints.
|
|
920
|
-
*
|
|
921
|
-
* @param value - Whether to reject empty strings.
|
|
922
|
-
* @defaultValue `true`
|
|
923
|
-
* @returns The builder (for chaining).
|
|
924
|
-
*
|
|
925
|
-
* @example
|
|
926
|
-
* ```ts
|
|
927
|
-
* flag.string().nonEmpty() // rejects '', accepts 'x'
|
|
928
|
-
* ```
|
|
929
|
-
*/
|
|
930
|
-
nonEmpty(this: FlagBuilder<C & {
|
|
931
|
-
readonly flagKind: "string";
|
|
932
|
-
}>, value?: boolean): FlagBuilder<C>;
|
|
933
|
-
/**
|
|
934
|
-
* Set an inclusive minimum length (UTF-16 code units). Composes with other
|
|
935
|
-
* string constraints; a later call overrides an earlier `minLength`.
|
|
936
|
-
*
|
|
937
|
-
* @param value - Inclusive minimum length.
|
|
938
|
-
* @returns The builder (for chaining).
|
|
939
|
-
*
|
|
940
|
-
* @example
|
|
941
|
-
* ```ts
|
|
942
|
-
* flag.string().minLength(3) // rejects 'ab', accepts 'abc'
|
|
943
|
-
* ```
|
|
944
|
-
*/
|
|
945
|
-
minLength(this: FlagBuilder<C & {
|
|
946
|
-
readonly flagKind: "string";
|
|
947
|
-
}>, value: number): FlagBuilder<C>;
|
|
948
|
-
/**
|
|
949
|
-
* Set an inclusive maximum length (UTF-16 code units). Composes with other
|
|
950
|
-
* string constraints; a later call overrides an earlier `maxLength`.
|
|
951
|
-
*
|
|
952
|
-
* @param value - Inclusive maximum length.
|
|
953
|
-
* @returns The builder (for chaining).
|
|
954
|
-
*
|
|
955
|
-
* @example
|
|
956
|
-
* ```ts
|
|
957
|
-
* flag.string().maxLength(8) // rejects 9+ chars
|
|
958
|
-
* ```
|
|
959
|
-
*/
|
|
960
|
-
maxLength(this: FlagBuilder<C & {
|
|
961
|
-
readonly flagKind: "string";
|
|
962
|
-
}>, value: number): FlagBuilder<C>;
|
|
963
|
-
/**
|
|
964
|
-
* Require the value to match a regular expression. Anchor with `^`/`$`
|
|
965
|
-
* for full-string matching. Composes with other string constraints.
|
|
966
|
-
*
|
|
967
|
-
* @param value - Pattern the value must match.
|
|
968
|
-
* @returns The builder (for chaining).
|
|
969
|
-
*
|
|
970
|
-
* @example
|
|
971
|
-
* ```ts
|
|
972
|
-
* flag.string().pattern(/^ghp_/) // rejects 'abc', accepts 'ghp_x'
|
|
973
|
-
* ```
|
|
974
|
-
*/
|
|
975
|
-
pattern(this: FlagBuilder<C & {
|
|
976
|
-
readonly flagKind: "string";
|
|
977
|
-
}>, value: RegExp): FlagBuilder<C>;
|
|
978
|
-
/**
|
|
979
|
-
* Split each CLI occurrence on a separator before element coercion, so
|
|
980
|
-
* `--tag a,b --tag c` resolves to `['a', 'b', 'c']`. Elements are coerced
|
|
981
|
-
* (and rejected) individually with the element schema's own error format.
|
|
982
|
-
*
|
|
983
|
-
* The separator is the CLI policy alone. Env values split on `','` and the
|
|
984
|
-
* stdin buffer on line terminators unless `.split()` says otherwise.
|
|
985
|
-
*
|
|
986
|
-
* @param value - Separator string (e.g. `','`).
|
|
987
|
-
* @returns The builder (for chaining).
|
|
988
|
-
* @throws {CLIError} With code `'INVALID_SCHEMA'` on a flag that carries a
|
|
989
|
-
* single value.
|
|
990
|
-
*
|
|
991
|
-
* @example
|
|
992
|
-
* ```ts
|
|
993
|
-
* flag.array(flag.enum(['us', 'eu', 'ap'])).separator(',')
|
|
994
|
-
* // --region us,eu --region ap → ['us', 'eu', 'ap']
|
|
995
|
-
* ```
|
|
996
|
-
*/
|
|
997
|
-
separator(this: FlagBuilder<C & {
|
|
998
|
-
readonly flagKind: "array" | "keyValue";
|
|
999
|
-
}>, value: string): FlagBuilder<C>;
|
|
1000
|
-
/**
|
|
1001
|
-
* Set how each source decodes into elements.
|
|
1002
|
-
*
|
|
1003
|
-
* CLI tokens accept `'whole'` and a delimiter; env values also accept
|
|
1004
|
-
* `'json'`; the stdin buffer accepts every format, including `'lines'`. The
|
|
1005
|
-
* strings `'whole'`, `'lines'`, and `'json'` name their format, and every
|
|
1006
|
-
* other string is the delimiter to split on. A source left out keeps what it
|
|
1007
|
-
* already had, or its default: whole CLI tokens (or the `.separator()`
|
|
1008
|
-
* delimiter), comma-delimited env values, line-delimited stdin. A config
|
|
1009
|
-
* value is a native array or object, and a config string decodes under the
|
|
1010
|
-
* env policy. For stdin, `'whole'` passes the complete buffer to a string
|
|
1011
|
-
* element, including its final line terminator.
|
|
1012
|
-
*
|
|
1013
|
-
* @param options - Per-source split settings.
|
|
1014
|
-
* @returns The builder (for chaining).
|
|
1015
|
-
* @throws {CLIError} With code `'INVALID_SCHEMA'` on a format the source does
|
|
1016
|
-
* not accept, an empty delimiter, or a flag that carries a single value.
|
|
1017
|
-
*
|
|
1018
|
-
* @example
|
|
1019
|
-
* ```ts
|
|
1020
|
-
* flag.array(flag.string()).split({ cli: ',', env: { format: 'json' } }).env('TAGS')
|
|
1021
|
-
* // --tag a,b → ['a', 'b']
|
|
1022
|
-
* // TAGS='["a","b"]' → ['a', 'b']
|
|
1023
|
-
* ```
|
|
1024
|
-
*/
|
|
1025
|
-
split(this: FlagBuilder<C & {
|
|
1026
|
-
readonly flagKind: "array" | "keyValue";
|
|
1027
|
-
}>, options: SplitOptions): FlagBuilder<C>;
|
|
1028
|
-
/**
|
|
1029
|
-
* Set how a repeated key combines.
|
|
1030
|
-
*
|
|
1031
|
-
* Applies to repeated CLI occurrences, delimited env pairs, and spliced stdin
|
|
1032
|
-
* reads in the same occurrence order. JSON decoding does not preserve
|
|
1033
|
-
* repeated object member names, so it cannot reliably expose them here.
|
|
1034
|
-
*
|
|
1035
|
-
* @param policy - `'last'` (default), `'first'`, or `'error'`.
|
|
1036
|
-
* @returns The builder (for chaining).
|
|
1037
|
-
* @throws {CLIError} With code `'INVALID_SCHEMA'` on a flag that is not
|
|
1038
|
-
* `keyValue`.
|
|
1039
|
-
*
|
|
1040
|
-
* @example
|
|
1041
|
-
* ```ts
|
|
1042
|
-
* flag.keyValue().duplicateKeys('error').env('VARS')
|
|
1043
|
-
* // $ VARS='A=1,A=2' mycli run
|
|
1044
|
-
* // # → Duplicate key '<redacted>' from env VARS for flag --env (CONSTRAINT_VIOLATED)
|
|
1045
|
-
* ```
|
|
1046
|
-
*/
|
|
1047
|
-
duplicateKeys(this: FlagBuilder<C & {
|
|
1048
|
-
readonly flagKind: "keyValue";
|
|
1049
|
-
}>, policy: DuplicateKeys): FlagBuilder<C>;
|
|
1050
|
-
/**
|
|
1051
|
-
* Validate the resolved value with a Standard Schema v1 validator.
|
|
1052
|
-
*
|
|
1053
|
-
* On a scalar builder the validator sees each value; on a collection builder
|
|
1054
|
-
* it sees the completed array or record, after every element passed its own
|
|
1055
|
-
* validator. `flag.array(flag.string().standard(s))` validates elements,
|
|
1056
|
-
* `flag.array(flag.string()).standard(s)` validates the array.
|
|
1057
|
-
*
|
|
1058
|
-
* @param schema - A Standard Schema v1 validator.
|
|
1059
|
-
* @returns The builder (for chaining).
|
|
1060
|
-
*
|
|
1061
|
-
* @example
|
|
1062
|
-
* ```ts
|
|
1063
|
-
* import { z } from 'zod';
|
|
1064
|
-
* flag.array(flag.string()).standard(z.array(z.string()).min(1))
|
|
1065
|
-
* ```
|
|
1066
|
-
*/
|
|
1067
|
-
standard(schema: StandardSchemaV1): FlagBuilder<C>;
|
|
1068
|
-
/**
|
|
1069
|
-
* Deduplicate the resolved array, preserving first-seen order. Applied
|
|
1070
|
-
* after all sources resolve, using `SameValueZero` semantics (like `Set`).
|
|
1071
|
-
*
|
|
1072
|
-
* @param value - Whether to deduplicate.
|
|
1073
|
-
* @defaultValue `true`
|
|
1074
|
-
* @returns The builder (for chaining).
|
|
1075
|
-
* @throws {CLIError} With code `'INVALID_SCHEMA'` on a flag that is not
|
|
1076
|
-
* `array`.
|
|
1077
|
-
*
|
|
1078
|
-
* @example
|
|
1079
|
-
* ```ts
|
|
1080
|
-
* flag.array(flag.string()).separator(',').unique()
|
|
1081
|
-
* // --tag a,a --tag a → ['a']
|
|
1082
|
-
* ```
|
|
1083
|
-
*/
|
|
1084
|
-
unique(this: FlagBuilder<C & {
|
|
1085
|
-
readonly flagKind: "array";
|
|
1086
|
-
}>, value?: boolean): FlagBuilder<C>;
|
|
1087
|
-
/**
|
|
1088
|
-
* Accept a negated spelling (`--no-<name>`) that sets the flag to `false`.
|
|
1089
|
-
*
|
|
1090
|
-
* Both spellings are ONE logical flag: the last CLI occurrence wins across
|
|
1091
|
-
* them, and they share the duplicate policy. The negated spelling is
|
|
1092
|
-
* presence-only — `--no-<name>=true` is rejected. Help renders the flag as
|
|
1093
|
-
* `--[no-]<name>` (or lists a custom alias); env/config/prompt/default
|
|
1094
|
-
* resolution is unaffected.
|
|
1095
|
-
*
|
|
1096
|
-
* @param options - Optional custom spelling (`alias`, without `--`) and
|
|
1097
|
-
* `hidden` to keep the negated spelling parseable but unadvertised.
|
|
1098
|
-
* @returns The builder (for chaining).
|
|
1099
|
-
* @throws {CLIError} With code `'INVALID_SCHEMA'` on a flag that is not
|
|
1100
|
-
* `boolean`.
|
|
1101
|
-
*
|
|
1102
|
-
* @example
|
|
1103
|
-
* ```ts
|
|
1104
|
-
* flag.boolean().default(true).negatable()
|
|
1105
|
-
* // $ mycli build --no-sandbox → sandbox = false
|
|
1106
|
-
* // $ mycli build --sandbox → sandbox = true
|
|
1107
|
-
* ```
|
|
1108
|
-
*/
|
|
1109
|
-
negatable(this: FlagBuilder<C & {
|
|
1110
|
-
readonly flagKind: "boolean";
|
|
1111
|
-
}>, options?: {
|
|
1112
|
-
alias?: string;
|
|
1113
|
-
hidden?: boolean;
|
|
1114
|
-
}): FlagBuilder<WithoutElementEligibility<C>>;
|
|
1115
|
-
/**
|
|
1116
|
-
* Set how repeated CLI occurrences of this flag combine.
|
|
1117
|
-
*
|
|
1118
|
-
* Counted per logical flag — aliases and the negated spelling all count
|
|
1119
|
-
* toward the same flag. CLI tokens only: env/config/prompt/default
|
|
1120
|
-
* resolution keeps its precedence semantics. Not available on `array`,
|
|
1121
|
-
* `count`, or `keyValue` flags, which inherently accumulate.
|
|
1122
|
-
*
|
|
1123
|
-
* @param policy - `'last'` (default), `'first'`, or `'error'`.
|
|
1124
|
-
* @returns The builder (for chaining).
|
|
1125
|
-
*
|
|
1126
|
-
* @example
|
|
1127
|
-
* ```ts
|
|
1128
|
-
* flag.enum(['session', 'same-dir', 'worktree']).duplicates('error')
|
|
1129
|
-
* // $ mycli run --spawn session --spawn worktree
|
|
1130
|
-
* // # → Error: Flag --spawn may only be specified once
|
|
1131
|
-
* ```
|
|
1132
|
-
*/
|
|
1133
|
-
duplicates(this: FlagBuilder<C & {
|
|
1134
|
-
readonly flagKind: "boolean" | "string" | "number" | "enum" | "custom";
|
|
1135
|
-
}>, policy: DuplicatePolicy): FlagBuilder<WithoutElementEligibility<C>>;
|
|
1136
|
-
}
|
|
1137
|
-
/**
|
|
1138
|
-
* Factory that creates {@link FlagBuilder} instances seeded with the correct
|
|
1139
|
-
* {@link FlagKind} and initial type-level config.
|
|
1140
|
-
*/
|
|
1141
|
-
interface FlagFactory {
|
|
1142
|
-
/**
|
|
1143
|
-
* String-valued flag, with optional string constraints.
|
|
1144
|
-
*
|
|
1145
|
-
* Constraints are enforced at the parse and resolution boundaries, in
|
|
1146
|
-
* fixed order: nonEmpty → minLength → maxLength → pattern. They also
|
|
1147
|
-
* compose via chained methods (`.nonEmpty()`, `.minLength()`,
|
|
1148
|
-
* `.maxLength()`, `.pattern()`), which override values set here.
|
|
1149
|
-
*
|
|
1150
|
-
* @param constraints - Optional string constraints.
|
|
1151
|
-
* @defaultValue `undefined` (no constraints)
|
|
1152
|
-
* @returns A {@link FlagBuilder} for `string` values.
|
|
1153
|
-
*
|
|
1154
|
-
* @example
|
|
1155
|
-
* ```ts
|
|
1156
|
-
* flag.string() // any string
|
|
1157
|
-
* flag.string({ nonEmpty: true }) // rejects ''
|
|
1158
|
-
* flag.string({ pattern: /^ghp_/ }) // token shapes
|
|
1159
|
-
* ```
|
|
1160
|
-
*/
|
|
1161
|
-
string(constraints?: StringConstraints): FlagBuilder<{
|
|
1162
|
-
readonly valueType: string;
|
|
1163
|
-
readonly presence: "optional";
|
|
1164
|
-
readonly optionalFallback: "undefined";
|
|
1165
|
-
readonly flagKind: "string";
|
|
1166
|
-
readonly elementEligible: true;
|
|
1167
|
-
}>;
|
|
1168
|
-
/**
|
|
1169
|
-
* Number-valued flag, with optional numeric constraints.
|
|
1170
|
-
*
|
|
1171
|
-
* Constraints are enforced at the parse and resolution boundaries. The
|
|
1172
|
-
* resolved value type stays `number` — constraints are runtime + schema, not
|
|
1173
|
-
* type-level. Bounds are inclusive.
|
|
1174
|
-
*
|
|
1175
|
-
* Constraints also compose via chained methods (`.int()`, `.min()`,
|
|
1176
|
-
* `.max()`, `.finite()`), which override values set here.
|
|
1177
|
-
*
|
|
1178
|
-
* @param constraints - Optional numeric constraints. `finite` defaults to
|
|
1179
|
-
* `true`, so `Infinity` / `-Infinity` are rejected unless `finite: false`.
|
|
1180
|
-
* @defaultValue `undefined` (finite-only, no bounds, non-integer allowed)
|
|
1181
|
-
* @returns A {@link FlagBuilder} for `number` values.
|
|
1182
|
-
*
|
|
1183
|
-
* @example
|
|
1184
|
-
* ```ts
|
|
1185
|
-
* flag.number() // finite numbers only
|
|
1186
|
-
* flag.number({ int: true, min: 0 }) // non-negative integers
|
|
1187
|
-
* flag.number({ finite: false }) // also accepts Infinity
|
|
1188
|
-
* ```
|
|
1189
|
-
*/
|
|
1190
|
-
number(constraints?: NumberConstraints): FlagBuilder<{
|
|
1191
|
-
readonly valueType: number;
|
|
1192
|
-
readonly presence: "optional";
|
|
1193
|
-
readonly optionalFallback: "undefined";
|
|
1194
|
-
readonly flagKind: "number";
|
|
1195
|
-
readonly elementEligible: true;
|
|
1196
|
-
}>;
|
|
1197
|
-
/**
|
|
1198
|
-
* Boolean flag. Implicitly defaults to `false` — the only flag kind where
|
|
1199
|
-
* the absence of a value is still meaningful (not `undefined`).
|
|
1200
|
-
*
|
|
1201
|
-
* @returns A {@link FlagBuilder} for `boolean` values (defaulted to `false`).
|
|
1202
|
-
*/
|
|
1203
|
-
boolean(): FlagBuilder<{
|
|
1204
|
-
readonly valueType: boolean;
|
|
1205
|
-
readonly presence: "defaulted";
|
|
1206
|
-
readonly optionalFallback: "undefined";
|
|
1207
|
-
readonly flagKind: "boolean";
|
|
1208
|
-
readonly elementEligible: true;
|
|
1209
|
-
}>;
|
|
1210
|
-
/**
|
|
1211
|
-
* Enum flag with literal type inference.
|
|
1212
|
-
*
|
|
1213
|
-
* Requires a **non-empty** readonly tuple so that `T[number]` produces a
|
|
1214
|
-
* union of string literals rather than just `string`.
|
|
1215
|
-
*
|
|
1216
|
-
* @example
|
|
1217
|
-
* ```ts
|
|
1218
|
-
* flag.enum(['us', 'eu', 'ap'])
|
|
1219
|
-
* // inferred type: 'us' | 'eu' | 'ap'
|
|
1220
|
-
* ```
|
|
1221
|
-
*
|
|
1222
|
-
* @param values - Non-empty tuple of allowed string literals.
|
|
1223
|
-
* @returns A {@link FlagBuilder} whose value type is the union of `values`.
|
|
1224
|
-
*/
|
|
1225
|
-
enum<const T extends readonly [string, ...string[]]>(values: T): FlagBuilder<{
|
|
1226
|
-
readonly valueType: T[number];
|
|
1227
|
-
readonly presence: "optional";
|
|
1228
|
-
readonly optionalFallback: "undefined";
|
|
1229
|
-
readonly flagKind: "enum";
|
|
1230
|
-
readonly elementEligible: true;
|
|
1231
|
-
}>;
|
|
1232
|
-
/**
|
|
1233
|
-
* Array flag — collects multiple values of the same element type.
|
|
1234
|
-
*
|
|
1235
|
-
* @example
|
|
1236
|
-
* ```ts
|
|
1237
|
-
* flag.array(flag.string())
|
|
1238
|
-
* // inferred type: string[]
|
|
1239
|
-
* ```
|
|
1240
|
-
*
|
|
1241
|
-
* @param element - {@link FlagBuilder} describing the element type.
|
|
1242
|
-
* @returns A {@link FlagBuilder} for arrays of the element type.
|
|
1243
|
-
*/
|
|
1244
|
-
array<E extends FlagConfig & {
|
|
1245
|
-
readonly elementEligible: true;
|
|
1246
|
-
}>(element: FlagBuilder<E>): FlagBuilder<{
|
|
1247
|
-
readonly valueType: E["valueType"][];
|
|
1248
|
-
readonly presence: "optional";
|
|
1249
|
-
readonly optionalFallback: "empty-array";
|
|
1250
|
-
readonly flagKind: "array";
|
|
1251
|
-
readonly elementEligible: false;
|
|
1252
|
-
}>;
|
|
1253
|
-
/**
|
|
1254
|
-
* Custom flag validated by a Standard Schema v1 validator (zod, valibot,
|
|
1255
|
-
* arktype, …). The resolved value from any source is validated after
|
|
1256
|
-
* resolution; the flag's value type is the validator's output type.
|
|
1257
|
-
*
|
|
1258
|
-
* Sync and async validators are both supported. Validation issues surface
|
|
1259
|
-
* as a `CONSTRAINT_VIOLATED` error naming the flag.
|
|
1260
|
-
*
|
|
1261
|
-
* @example
|
|
1262
|
-
* ```ts
|
|
1263
|
-
* import { z } from 'zod';
|
|
1264
|
-
* flag.custom(z.string().url())
|
|
1265
|
-
* // inferred type: string | undefined
|
|
1266
|
-
* ```
|
|
1267
|
-
*
|
|
1268
|
-
* @param schema - A Standard Schema v1 validator.
|
|
1269
|
-
* @returns A {@link FlagBuilder} whose value type is the validator's output.
|
|
1270
|
-
*/
|
|
1271
|
-
custom<S extends StandardSchemaV1>(schema: S): FlagBuilder<{
|
|
1272
|
-
readonly valueType: InferStandardOutput<S>;
|
|
1273
|
-
readonly presence: "optional";
|
|
1274
|
-
readonly optionalFallback: "undefined";
|
|
1275
|
-
readonly flagKind: "custom";
|
|
1276
|
-
readonly elementEligible: true;
|
|
1277
|
-
}>;
|
|
1278
|
-
/**
|
|
1279
|
-
* Custom-parsed flag. The parse function receives the raw value and must
|
|
1280
|
-
* return a value of type `T`. The return type is inferred from `parseFn`.
|
|
1281
|
-
*
|
|
1282
|
-
* The input is `string` from CLI argv and env vars, or any JSON value
|
|
1283
|
-
* from config files. Narrow inside the function as needed:
|
|
1284
|
-
*
|
|
1285
|
-
* ```ts
|
|
1286
|
-
* flag.custom((raw: unknown): string[] => {
|
|
1287
|
-
* if (Array.isArray(raw)) return raw.map(String);
|
|
1288
|
-
* if (typeof raw === 'string') return raw.split(',');
|
|
1289
|
-
* throw new Error(`Expected string or array, got ${typeof raw}`);
|
|
1290
|
-
* })
|
|
1291
|
-
* ```
|
|
1292
|
-
*
|
|
1293
|
-
* Throw an `Error` (or `ParseError`) to signal invalid input — it will
|
|
1294
|
-
* be wrapped with context and re-thrown as a `ParseError`.
|
|
1295
|
-
*
|
|
1296
|
-
* @see `coerceConfigValue` `'custom'` case in `core/resolve/index.ts`
|
|
1297
|
-
*
|
|
1298
|
-
* @example
|
|
1299
|
-
* ```ts
|
|
1300
|
-
* flag.custom((raw) => new URL(String(raw)))
|
|
1301
|
-
* // inferred type: URL | undefined
|
|
1302
|
-
* ```
|
|
1303
|
-
*
|
|
1304
|
-
* @param parseFn - Converts the raw input into a value of type `T`.
|
|
1305
|
-
* @returns A {@link FlagBuilder} whose value type is inferred from `parseFn`.
|
|
1306
|
-
*/
|
|
1307
|
-
custom<T>(parseFn: FlagParseFn<T>): FlagBuilder<{
|
|
1308
|
-
readonly valueType: T;
|
|
1309
|
-
readonly presence: "optional";
|
|
1310
|
-
readonly optionalFallback: "undefined";
|
|
1311
|
-
readonly flagKind: "custom";
|
|
1312
|
-
readonly elementEligible: true;
|
|
1313
|
-
}>;
|
|
1314
|
-
/**
|
|
1315
|
-
* URL-valued flag. Parses into a `URL`; invalid URLs are rejected with an
|
|
1316
|
-
* `INVALID_VALUE` error naming the flag.
|
|
1317
|
-
*
|
|
1318
|
-
* @param options - Optional protocol allowlist (without trailing colon).
|
|
1319
|
-
* @returns A {@link FlagBuilder} for `URL` values.
|
|
1320
|
-
*
|
|
1321
|
-
* @example
|
|
1322
|
-
* ```ts
|
|
1323
|
-
* flag.url() // any URL
|
|
1324
|
-
* flag.url({ protocols: ['https'] }) // https only
|
|
1325
|
-
* ```
|
|
1326
|
-
*/
|
|
1327
|
-
url(options?: UrlFlagOptions): FlagBuilder<{
|
|
1328
|
-
readonly valueType: URL;
|
|
1329
|
-
readonly presence: "optional";
|
|
1330
|
-
readonly optionalFallback: "undefined";
|
|
1331
|
-
readonly flagKind: "custom";
|
|
1332
|
-
readonly elementEligible: true;
|
|
1333
|
-
}>;
|
|
1334
|
-
/**
|
|
1335
|
-
* Path-valued flag. The value stays a `string`; optional filesystem
|
|
1336
|
-
* checks run **after resolution** through the runtime adapter, so CLI,
|
|
1337
|
-
* env, config, prompted, and defaulted values are all validated.
|
|
1338
|
-
*
|
|
1339
|
-
* @param options - Optional existence/type checks. `type` implies
|
|
1340
|
-
* existence unless `mustExist` is explicitly `false`.
|
|
1341
|
-
* @returns A {@link FlagBuilder} for path strings.
|
|
1342
|
-
*
|
|
1343
|
-
* @example
|
|
1344
|
-
* ```ts
|
|
1345
|
-
* flag.path() // any string, help shows <path>
|
|
1346
|
-
* flag.path({ mustExist: true }) // rejects missing paths
|
|
1347
|
-
* flag.path({ type: 'directory' }) // must exist and be a directory
|
|
1348
|
-
* flag.path({ type: 'directory', mustExist: false })
|
|
1349
|
-
* // missing passes; existing must be a directory
|
|
1350
|
-
* flag.path({ type: 'directory', create: true })
|
|
1351
|
-
* // created recursively when missing
|
|
1352
|
-
* ```
|
|
1353
|
-
*/
|
|
1354
|
-
path(options?: PathFlagOptions): FlagBuilder<{
|
|
1355
|
-
readonly valueType: string;
|
|
1356
|
-
readonly presence: "optional";
|
|
1357
|
-
readonly optionalFallback: "undefined";
|
|
1358
|
-
readonly flagKind: "string";
|
|
1359
|
-
readonly elementEligible: true;
|
|
1360
|
-
}>;
|
|
1361
|
-
/**
|
|
1362
|
-
* Date-valued flag. Accepts strict ISO-8601 (`2026-07-10`,
|
|
1363
|
-
* `2026-07-10T14:30:00Z`) and parses into a `Date`. Lenient `Date.parse`
|
|
1364
|
-
* inputs (`'0'`, `'March 5'`) and calendar-invalid dates (`2026-02-31`)
|
|
1365
|
-
* are rejected.
|
|
1366
|
-
*
|
|
1367
|
-
* Returns `Date` (not `Temporal`) because the supported runtimes do not
|
|
1368
|
-
* all ship Temporal yet; use `flag.custom()` with `Temporal.PlainDate.from`
|
|
1369
|
-
* where the target runtime has it.
|
|
1370
|
-
*
|
|
1371
|
-
* @param options - Optional inclusive `min`/`max` date bounds.
|
|
1372
|
-
* @returns A {@link FlagBuilder} for `Date` values.
|
|
1373
|
-
*
|
|
1374
|
-
* @example
|
|
1375
|
-
* ```ts
|
|
1376
|
-
* flag.date()
|
|
1377
|
-
* flag.date({ min: new Date('2020-01-01') })
|
|
1378
|
-
* ```
|
|
1379
|
-
*/
|
|
1380
|
-
date(options?: DateFlagOptions): FlagBuilder<{
|
|
1381
|
-
readonly valueType: Date;
|
|
1382
|
-
readonly presence: "optional";
|
|
1383
|
-
readonly optionalFallback: "undefined";
|
|
1384
|
-
readonly flagKind: "custom";
|
|
1385
|
-
readonly elementEligible: true;
|
|
1386
|
-
}>;
|
|
1387
|
-
/**
|
|
1388
|
-
* Duration flag. Accepts `'30s'`, `'5m'`, `'1.5h'`, `'250ms'`, `'2d'`,
|
|
1389
|
-
* compounds like `'1h30m'`, or a bare millisecond count, and resolves to
|
|
1390
|
-
* **milliseconds**.
|
|
1391
|
-
*
|
|
1392
|
-
* @returns A {@link FlagBuilder} for duration values in milliseconds.
|
|
1393
|
-
*
|
|
1394
|
-
* @example
|
|
1395
|
-
* ```ts
|
|
1396
|
-
* flag.duration().default(30_000) // --timeout 45s → 45000
|
|
1397
|
-
* ```
|
|
1398
|
-
*/
|
|
1399
|
-
duration(): FlagBuilder<{
|
|
1400
|
-
readonly valueType: number;
|
|
1401
|
-
readonly presence: "optional";
|
|
1402
|
-
readonly optionalFallback: "undefined";
|
|
1403
|
-
readonly flagKind: "custom";
|
|
1404
|
-
readonly elementEligible: true;
|
|
1405
|
-
}>;
|
|
1406
|
-
/**
|
|
1407
|
-
* Byte-size flag. Accepts `'512mb'`, `'1.5gb'`, `'64kb'`, `'100b'` or a
|
|
1408
|
-
* bare byte count, and resolves to **bytes**. Units are binary
|
|
1409
|
-
* (`1kb` = 1024) and case-insensitive.
|
|
1410
|
-
*
|
|
1411
|
-
* @returns A {@link FlagBuilder} for sizes in bytes.
|
|
1412
|
-
*
|
|
1413
|
-
* @example
|
|
1414
|
-
* ```ts
|
|
1415
|
-
* flag.bytes().default(10 * 1024 ** 2) // --max-size 512kb → 524288
|
|
1416
|
-
* ```
|
|
1417
|
-
*/
|
|
1418
|
-
bytes(): FlagBuilder<{
|
|
1419
|
-
readonly valueType: number;
|
|
1420
|
-
readonly presence: "optional";
|
|
1421
|
-
readonly optionalFallback: "undefined";
|
|
1422
|
-
readonly flagKind: "custom";
|
|
1423
|
-
readonly elementEligible: true;
|
|
1424
|
-
}>;
|
|
1425
|
-
/**
|
|
1426
|
-
* Count flag — resolves to how many times the flag appears. `-vvv`,
|
|
1427
|
-
* `-v -v -v`, and `--verbose --verbose --verbose` all yield `3`; absent
|
|
1428
|
-
* yields `0`. An explicit value (`--verbose=2`, env, config) sets the
|
|
1429
|
-
* count directly.
|
|
1430
|
-
*
|
|
1431
|
-
* Not promptable.
|
|
1432
|
-
*
|
|
1433
|
-
* @returns A {@link FlagBuilder} for occurrence counts (defaulted to `0`).
|
|
1434
|
-
*
|
|
1435
|
-
* @example
|
|
1436
|
-
* ```ts
|
|
1437
|
-
* flag.count().alias('v').describe('Increase verbosity')
|
|
1438
|
-
* // $ mycli build -vv → verbose = 2
|
|
1439
|
-
* ```
|
|
1440
|
-
*/
|
|
1441
|
-
count(): FlagBuilder<{
|
|
1442
|
-
readonly valueType: number;
|
|
1443
|
-
readonly presence: "defaulted";
|
|
1444
|
-
readonly optionalFallback: "undefined";
|
|
1445
|
-
readonly flagKind: "count";
|
|
1446
|
-
readonly elementEligible: false;
|
|
1447
|
-
}>;
|
|
1448
|
-
/**
|
|
1449
|
-
* Key-value flag — repeated `KEY=VALUE` occurrences merge into a
|
|
1450
|
-
* `Record<string, string>` (docker/kubectl `--env` style). The value is
|
|
1451
|
-
* split at the **first** `=`, so `--env A=b=c` yields `{ A: 'b=c' }`.
|
|
1452
|
-
* Later occurrences of the same key win, which `.duplicateKeys()` changes.
|
|
1453
|
-
* Absent resolves to `{}`.
|
|
1454
|
-
*
|
|
1455
|
-
* Env vars accept comma-delimited pairs (`A=1,B=2`); config files accept a
|
|
1456
|
-
* plain object; `.split()` sets any of that per source. Not promptable.
|
|
1457
|
-
*
|
|
1458
|
-
* An element builder gives each entry value its own codec, constraints, and
|
|
1459
|
-
* checks, so `flag.keyValue(flag.path())` checks every value on disk.
|
|
1460
|
-
*
|
|
1461
|
-
* @param element - {@link FlagBuilder} describing the value of each entry.
|
|
1462
|
-
* @defaultValue an unconstrained string element
|
|
1463
|
-
* @returns A {@link FlagBuilder} for records of the element type.
|
|
1464
|
-
*
|
|
1465
|
-
* @example
|
|
1466
|
-
* ```ts
|
|
1467
|
-
* flag.keyValue().alias('e').describe('Environment variables')
|
|
1468
|
-
* // $ mycli run -e A=1 -e B=2 → env = { A: '1', B: '2' }
|
|
1469
|
-
* ```
|
|
1470
|
-
*/
|
|
1471
|
-
keyValue<E extends FlagConfig & {
|
|
1472
|
-
readonly elementEligible: true;
|
|
1473
|
-
} = StringElementConfig>(element?: FlagBuilder<E>): FlagBuilder<{
|
|
1474
|
-
readonly valueType: Record<string, E["valueType"]>;
|
|
1475
|
-
readonly presence: "optional";
|
|
1476
|
-
readonly optionalFallback: "empty-object";
|
|
1477
|
-
readonly flagKind: "keyValue";
|
|
1478
|
-
readonly elementEligible: false;
|
|
1479
|
-
}>;
|
|
1480
|
-
}
|
|
1481
|
-
/**
|
|
1482
|
-
* Flag schema factory. Call `flag.<kind>()` to create an immutable
|
|
1483
|
-
* {@link FlagBuilder} with full type inference and safe modifier chaining.
|
|
1484
|
-
*/
|
|
1485
|
-
declare const flag: FlagFactory;
|
|
1486
|
-
//#endregion
|
|
1487
|
-
export { type AllowedPromptConfig, type ArrayFlagDefinition, type BooleanFlagDefinition, type ConfirmPromptConfig, type CountFlagDefinition, type CustomFlagDefinition, DUPLICATE_KEYS, type DateFlagOptions, type DuplicateKeys, type DuplicatePolicy, type EnumFlagDefinition, FLAG_KINDS, FLAG_PRESENCES, type FlagAlias, FlagBuilder, type FlagConfig, type FlagDefinition, type FlagDefinitionBase, type FlagDefinitionByKind, type FlagDefinitionOverrides, type FlagFactory, type FlagKind, type FlagNegation, type FlagParseFn, type FlagPresence, type FlagSchema, type InferFlag, type InferFlags, type InputPromptConfig, type KeyValueFlagDefinition, type MultiselectPromptConfig, type NumberFlagDefinition, type OptionalFallback, PROMPT_KINDS, type PathChecks, type PathFlagOptions, type PromptConfig, type PromptConfigBase, type PromptConfigByFlagKind, type PromptKind, type PromptResult, type ResolvedValue, SPLIT_FORMATS, STDIN_CONSUMES, STDIN_WHENS, type SelectChoice, type SelectPromptConfig, type SourceSplitBinding, type SplitBinding, type SplitFormat, type SplitOptions, type SplitPolicy, type SplitSetting, type StdinBinding, type StdinConsume, type StdinOptions, type StdinWhen, type StringConstraintViolation, type StringConstraints, type StringElementConfig, type StringFlagDefinition, type UrlFlagOptions, type WithPresence, type WithoutElementEligibility, createFlagSchema, flag, getFlagAliasNames, getFlagNegatedName, normalizeFlagAlias, normalizeFlagAliases };
|