@kjanat/dreamcli 3.0.0-rc.9 → 3.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +262 -1
- package/README.md +32 -13
- package/dist/core/cli/dispatch.mjs +0 -11
- package/dist/core/cli/index.d.mts +133 -9
- package/dist/core/cli/index.mjs +108 -21
- package/dist/core/cli/planner.mjs +7 -1
- package/dist/core/cli/root-help.mjs +5 -0
- package/dist/core/cli/runtime-preflight.d.mts +4 -0
- package/dist/core/cli/runtime-preflight.mjs +5 -3
- package/dist/core/completion/shells/shared.mjs +1 -0
- package/dist/core/config/index.d.mts +43 -12
- package/dist/core/config/index.mjs +55 -16
- package/dist/core/config/package-json.d.mts +1 -0
- package/dist/core/errors/index.d.mts +2 -2
- package/dist/core/execution/index.mjs +6 -2
- package/dist/core/help/ansi.d.mts +11 -5
- package/dist/core/help/ansi.mjs +14 -16
- package/dist/core/help/index.d.mts +22 -0
- package/dist/core/help/index.mjs +75 -25
- package/dist/core/json-schema/index.d.mts +7 -8
- package/dist/core/json-schema/index.mjs +271 -88
- package/dist/core/json-schema/meta-descriptions.generated.d.mts +40 -40
- package/dist/core/output/contracts.d.mts +5 -5
- package/dist/core/output/contracts.mjs +1 -1
- package/dist/core/output/index.d.mts +38 -1
- package/dist/core/output/index.mjs +37 -2
- package/dist/core/parse/index.mjs +9 -6
- package/dist/core/resolve/contracts.d.mts +7 -2
- package/dist/core/resolve/flags.d.mts +3 -1
- package/dist/core/resolve/flags.mjs +29 -12
- package/dist/core/resolve/index.mjs +6 -1
- package/dist/core/resolve/property.d.mts +1 -1
- package/dist/core/resolve/standard.d.mts +24 -0
- package/dist/core/resolve/standard.mjs +114 -0
- package/dist/core/schema/arg.d.mts +37 -2
- package/dist/core/schema/arg.mjs +5 -2
- package/dist/core/schema/command.d.mts +49 -7
- package/dist/core/schema/command.mjs +15 -5
- package/dist/core/schema/flag.d.mts +77 -9
- package/dist/core/schema/flag.mjs +7 -3
- package/dist/core/schema/index.d.mts +3 -2
- package/dist/core/schema/prompt.d.mts +1 -1
- package/dist/core/schema/run.d.mts +7 -0
- package/dist/core/schema/standard.d.mts +100 -0
- package/dist/core/schema/standard.mjs +15 -0
- package/dist/core/testkit/index.d.mts +7 -5
- package/dist/core/testkit/index.mjs +12 -7
- package/dist/index.d.mts +5 -4
- package/dist/index.mjs +4 -4
- package/dist/runtime/adapter.d.mts +33 -0
- package/dist/runtime/adapter.mjs +6 -1
- package/dist/runtime/deno.d.mts +4 -0
- package/dist/runtime/deno.mjs +4 -1
- package/dist/runtime/node.mjs +9 -1
- package/dist/version.mjs +2 -2
- package/dreamcli.schema.json +82 -0
- package/examples/basic.ts +2 -2
- package/examples/flag-types.ts +79 -0
- package/examples/gh/node_modules/typescript/LICENSE +55 -0
- package/examples/gh/node_modules/typescript/NOTICE.txt +436 -0
- package/examples/gh/node_modules/typescript/README.md +49 -0
- package/examples/gh/node_modules/typescript/bin/tsc +2 -0
- package/examples/gh/node_modules/typescript/dist/api/async/api.d.ts +529 -0
- package/examples/gh/node_modules/typescript/dist/api/async/api.d.ts.map +1 -0
- package/examples/gh/node_modules/typescript/dist/api/async/api.js +1657 -0
- package/examples/gh/node_modules/typescript/dist/api/async/api.js.map +1 -0
- package/examples/gh/node_modules/typescript/dist/api/async/client.d.ts +39 -0
- package/examples/gh/node_modules/typescript/dist/api/async/client.d.ts.map +1 -0
- package/examples/gh/node_modules/typescript/dist/api/async/client.js +211 -0
- package/examples/gh/node_modules/typescript/dist/api/async/client.js.map +1 -0
- package/examples/gh/node_modules/typescript/dist/api/async/types.d.ts +310 -0
- package/examples/gh/node_modules/typescript/dist/api/async/types.d.ts.map +1 -0
- package/examples/gh/node_modules/typescript/dist/api/async/types.js +2 -0
- package/examples/gh/node_modules/typescript/dist/api/async/types.js.map +1 -0
- package/examples/gh/node_modules/typescript/dist/api/compilerOptions.d.ts +109 -0
- package/examples/gh/node_modules/typescript/dist/api/compilerOptions.d.ts.map +1 -0
- package/examples/gh/node_modules/typescript/dist/api/compilerOptions.js +2 -0
- package/examples/gh/node_modules/typescript/dist/api/compilerOptions.js.map +1 -0
- package/examples/gh/node_modules/typescript/dist/api/fs.d.ts +23 -0
- package/examples/gh/node_modules/typescript/dist/api/fs.d.ts.map +1 -0
- package/examples/gh/node_modules/typescript/dist/api/fs.js +109 -0
- package/examples/gh/node_modules/typescript/dist/api/fs.js.map +1 -0
- package/examples/gh/node_modules/typescript/dist/api/node/encoder.d.ts +15 -0
- package/examples/gh/node_modules/typescript/dist/api/node/encoder.d.ts.map +1 -0
- package/examples/gh/node_modules/typescript/dist/api/node/encoder.generated.d.ts +5 -0
- package/examples/gh/node_modules/typescript/dist/api/node/encoder.generated.d.ts.map +1 -0
- package/examples/gh/node_modules/typescript/dist/api/node/encoder.generated.js +74 -0
- package/examples/gh/node_modules/typescript/dist/api/node/encoder.generated.js.map +1 -0
- package/examples/gh/node_modules/typescript/dist/api/node/encoder.js +287 -0
- package/examples/gh/node_modules/typescript/dist/api/node/encoder.js.map +1 -0
- package/examples/gh/node_modules/typescript/dist/api/node/msgpack.d.ts +32 -0
- package/examples/gh/node_modules/typescript/dist/api/node/msgpack.d.ts.map +1 -0
- package/examples/gh/node_modules/typescript/dist/api/node/msgpack.js +213 -0
- package/examples/gh/node_modules/typescript/dist/api/node/msgpack.js.map +1 -0
- package/examples/gh/node_modules/typescript/dist/api/node/node.d.ts +76 -0
- package/examples/gh/node_modules/typescript/dist/api/node/node.d.ts.map +1 -0
- package/examples/gh/node_modules/typescript/dist/api/node/node.generated.d.ts +182 -0
- package/examples/gh/node_modules/typescript/dist/api/node/node.generated.d.ts.map +1 -0
- package/examples/gh/node_modules/typescript/dist/api/node/node.generated.js +835 -0
- package/examples/gh/node_modules/typescript/dist/api/node/node.generated.js.map +1 -0
- package/examples/gh/node_modules/typescript/dist/api/node/node.infrastructure.d.ts +62 -0
- package/examples/gh/node_modules/typescript/dist/api/node/node.infrastructure.d.ts.map +1 -0
- package/examples/gh/node_modules/typescript/dist/api/node/node.infrastructure.js +122 -0
- package/examples/gh/node_modules/typescript/dist/api/node/node.infrastructure.js.map +1 -0
- package/examples/gh/node_modules/typescript/dist/api/node/node.js +298 -0
- package/examples/gh/node_modules/typescript/dist/api/node/node.js.map +1 -0
- package/examples/gh/node_modules/typescript/dist/api/node/protocol.d.ts +29 -0
- package/examples/gh/node_modules/typescript/dist/api/node/protocol.d.ts.map +1 -0
- package/examples/gh/node_modules/typescript/dist/api/node/protocol.generated.d.ts +4 -0
- package/examples/gh/node_modules/typescript/dist/api/node/protocol.generated.d.ts.map +1 -0
- package/examples/gh/node_modules/typescript/dist/api/node/protocol.generated.js +241 -0
- package/examples/gh/node_modules/typescript/dist/api/node/protocol.generated.js.map +1 -0
- package/examples/gh/node_modules/typescript/dist/api/node/protocol.js +30 -0
- package/examples/gh/node_modules/typescript/dist/api/node/protocol.js.map +1 -0
- package/examples/gh/node_modules/typescript/dist/api/node/wtf8.d.ts +6 -0
- package/examples/gh/node_modules/typescript/dist/api/node/wtf8.d.ts.map +1 -0
- package/examples/gh/node_modules/typescript/dist/api/node/wtf8.js +61 -0
- package/examples/gh/node_modules/typescript/dist/api/node/wtf8.js.map +1 -0
- package/examples/gh/node_modules/typescript/dist/api/options.d.ts +32 -0
- package/examples/gh/node_modules/typescript/dist/api/options.d.ts.map +1 -0
- package/examples/gh/node_modules/typescript/dist/api/options.js +11 -0
- package/examples/gh/node_modules/typescript/dist/api/options.js.map +1 -0
- package/examples/gh/node_modules/typescript/dist/api/path.d.ts +110 -0
- package/examples/gh/node_modules/typescript/dist/api/path.d.ts.map +1 -0
- package/examples/gh/node_modules/typescript/dist/api/path.js +508 -0
- package/examples/gh/node_modules/typescript/dist/api/path.js.map +1 -0
- package/examples/gh/node_modules/typescript/dist/api/proto.d.ts +239 -0
- package/examples/gh/node_modules/typescript/dist/api/proto.d.ts.map +1 -0
- package/examples/gh/node_modules/typescript/dist/api/proto.js +37 -0
- package/examples/gh/node_modules/typescript/dist/api/proto.js.map +1 -0
- package/examples/gh/node_modules/typescript/dist/api/sourceFileCache.d.ts +79 -0
- package/examples/gh/node_modules/typescript/dist/api/sourceFileCache.d.ts.map +1 -0
- package/examples/gh/node_modules/typescript/dist/api/sourceFileCache.js +169 -0
- package/examples/gh/node_modules/typescript/dist/api/sourceFileCache.js.map +1 -0
- package/examples/gh/node_modules/typescript/dist/api/sync/api.d.ts +529 -0
- package/examples/gh/node_modules/typescript/dist/api/sync/api.d.ts.map +1 -0
- package/examples/gh/node_modules/typescript/dist/api/sync/api.js +1665 -0
- package/examples/gh/node_modules/typescript/dist/api/sync/api.js.map +1 -0
- package/examples/gh/node_modules/typescript/dist/api/sync/client.d.ts +30 -0
- package/examples/gh/node_modules/typescript/dist/api/sync/client.d.ts.map +1 -0
- package/examples/gh/node_modules/typescript/dist/api/sync/client.js +124 -0
- package/examples/gh/node_modules/typescript/dist/api/sync/client.js.map +1 -0
- package/examples/gh/node_modules/typescript/dist/api/sync/types.d.ts +310 -0
- package/examples/gh/node_modules/typescript/dist/api/sync/types.d.ts.map +1 -0
- package/examples/gh/node_modules/typescript/dist/api/sync/types.js +2 -0
- package/examples/gh/node_modules/typescript/dist/api/sync/types.js.map +1 -0
- package/examples/gh/node_modules/typescript/dist/api/syncChannel.d.ts +114 -0
- package/examples/gh/node_modules/typescript/dist/api/syncChannel.d.ts.map +1 -0
- package/examples/gh/node_modules/typescript/dist/api/syncChannel.js +508 -0
- package/examples/gh/node_modules/typescript/dist/api/syncChannel.js.map +1 -0
- package/examples/gh/node_modules/typescript/dist/api/timing.d.ts +175 -0
- package/examples/gh/node_modules/typescript/dist/api/timing.d.ts.map +1 -0
- package/examples/gh/node_modules/typescript/dist/api/timing.js +149 -0
- package/examples/gh/node_modules/typescript/dist/api/timing.js.map +1 -0
- package/examples/gh/node_modules/typescript/dist/ast/ast.d.ts +100 -0
- package/examples/gh/node_modules/typescript/dist/ast/ast.d.ts.map +1 -0
- package/examples/gh/node_modules/typescript/dist/ast/ast.generated.d.ts +1161 -0
- package/examples/gh/node_modules/typescript/dist/ast/ast.generated.d.ts.map +1 -0
- package/examples/gh/node_modules/typescript/dist/ast/ast.generated.js +4 -0
- package/examples/gh/node_modules/typescript/dist/ast/ast.generated.js.map +1 -0
- package/examples/gh/node_modules/typescript/dist/ast/ast.js +7 -0
- package/examples/gh/node_modules/typescript/dist/ast/ast.js.map +1 -0
- package/examples/gh/node_modules/typescript/dist/ast/astnav.d.ts +19 -0
- package/examples/gh/node_modules/typescript/dist/ast/astnav.d.ts.map +1 -0
- package/examples/gh/node_modules/typescript/dist/ast/astnav.js +596 -0
- package/examples/gh/node_modules/typescript/dist/ast/astnav.js.map +1 -0
- package/examples/gh/node_modules/typescript/dist/ast/clone.d.ts +16 -0
- package/examples/gh/node_modules/typescript/dist/ast/clone.d.ts.map +1 -0
- package/examples/gh/node_modules/typescript/dist/ast/clone.js +104 -0
- package/examples/gh/node_modules/typescript/dist/ast/clone.js.map +1 -0
- package/examples/gh/node_modules/typescript/dist/ast/factory.generated.d.ts +520 -0
- package/examples/gh/node_modules/typescript/dist/ast/factory.generated.d.ts.map +1 -0
- package/examples/gh/node_modules/typescript/dist/ast/factory.generated.js +3057 -0
- package/examples/gh/node_modules/typescript/dist/ast/factory.generated.js.map +1 -0
- package/examples/gh/node_modules/typescript/dist/ast/index.d.ts +20 -0
- package/examples/gh/node_modules/typescript/dist/ast/index.d.ts.map +1 -0
- package/examples/gh/node_modules/typescript/dist/ast/index.js +20 -0
- package/examples/gh/node_modules/typescript/dist/ast/index.js.map +1 -0
- package/examples/gh/node_modules/typescript/dist/ast/is.d.ts +35 -0
- package/examples/gh/node_modules/typescript/dist/ast/is.d.ts.map +1 -0
- package/examples/gh/node_modules/typescript/dist/ast/is.generated.d.ts +329 -0
- package/examples/gh/node_modules/typescript/dist/ast/is.generated.d.ts.map +1 -0
- package/examples/gh/node_modules/typescript/dist/ast/is.generated.js +1103 -0
- package/examples/gh/node_modules/typescript/dist/ast/is.generated.js.map +1 -0
- package/examples/gh/node_modules/typescript/dist/ast/is.js +233 -0
- package/examples/gh/node_modules/typescript/dist/ast/is.js.map +1 -0
- package/examples/gh/node_modules/typescript/dist/ast/jsdoc.d.ts +11 -0
- package/examples/gh/node_modules/typescript/dist/ast/jsdoc.d.ts.map +1 -0
- package/examples/gh/node_modules/typescript/dist/ast/jsdoc.js +202 -0
- package/examples/gh/node_modules/typescript/dist/ast/jsdoc.js.map +1 -0
- package/examples/gh/node_modules/typescript/dist/ast/scanner.d.ts +97 -0
- package/examples/gh/node_modules/typescript/dist/ast/scanner.d.ts.map +1 -0
- package/examples/gh/node_modules/typescript/dist/ast/scanner.js +2230 -0
- package/examples/gh/node_modules/typescript/dist/ast/scanner.js.map +1 -0
- package/examples/gh/node_modules/typescript/dist/ast/utils.d.ts +17 -0
- package/examples/gh/node_modules/typescript/dist/ast/utils.d.ts.map +1 -0
- package/examples/gh/node_modules/typescript/dist/ast/utils.js +67 -0
- package/examples/gh/node_modules/typescript/dist/ast/utils.js.map +1 -0
- package/examples/gh/node_modules/typescript/dist/ast/visitor.d.ts +14 -0
- package/examples/gh/node_modules/typescript/dist/ast/visitor.d.ts.map +1 -0
- package/examples/gh/node_modules/typescript/dist/ast/visitor.generated.d.ts +50 -0
- package/examples/gh/node_modules/typescript/dist/ast/visitor.generated.d.ts.map +1 -0
- package/examples/gh/node_modules/typescript/dist/ast/visitor.generated.js +978 -0
- package/examples/gh/node_modules/typescript/dist/ast/visitor.generated.js.map +1 -0
- package/examples/gh/node_modules/typescript/dist/ast/visitor.js +47 -0
- package/examples/gh/node_modules/typescript/dist/ast/visitor.js.map +1 -0
- package/examples/gh/node_modules/typescript/dist/enums/characterCodes.d.ts +2 -0
- package/examples/gh/node_modules/typescript/dist/enums/characterCodes.d.ts.map +1 -0
- package/examples/gh/node_modules/typescript/dist/enums/characterCodes.enum.d.ts +129 -0
- package/examples/gh/node_modules/typescript/dist/enums/characterCodes.enum.d.ts.map +1 -0
- package/examples/gh/node_modules/typescript/dist/enums/characterCodes.enum.js +132 -0
- package/examples/gh/node_modules/typescript/dist/enums/characterCodes.enum.js.map +1 -0
- package/examples/gh/node_modules/typescript/dist/enums/characterCodes.js +130 -0
- package/examples/gh/node_modules/typescript/dist/enums/characterCodes.js.map +1 -0
- package/examples/gh/node_modules/typescript/dist/enums/commentDirectiveType.d.ts +2 -0
- package/examples/gh/node_modules/typescript/dist/enums/commentDirectiveType.d.ts.map +1 -0
- package/examples/gh/node_modules/typescript/dist/enums/commentDirectiveType.enum.d.ts +5 -0
- package/examples/gh/node_modules/typescript/dist/enums/commentDirectiveType.enum.d.ts.map +1 -0
- package/examples/gh/node_modules/typescript/dist/enums/commentDirectiveType.enum.js +6 -0
- package/examples/gh/node_modules/typescript/dist/enums/commentDirectiveType.enum.js.map +1 -0
- package/examples/gh/node_modules/typescript/dist/enums/commentDirectiveType.js +6 -0
- package/examples/gh/node_modules/typescript/dist/enums/commentDirectiveType.js.map +1 -0
- package/examples/gh/node_modules/typescript/dist/enums/completionItemKind.d.ts +2 -0
- package/examples/gh/node_modules/typescript/dist/enums/completionItemKind.d.ts.map +1 -0
- package/examples/gh/node_modules/typescript/dist/enums/completionItemKind.enum.d.ts +28 -0
- package/examples/gh/node_modules/typescript/dist/enums/completionItemKind.enum.d.ts.map +1 -0
- package/examples/gh/node_modules/typescript/dist/enums/completionItemKind.enum.js +30 -0
- package/examples/gh/node_modules/typescript/dist/enums/completionItemKind.enum.js.map +1 -0
- package/examples/gh/node_modules/typescript/dist/enums/completionItemKind.js +30 -0
- package/examples/gh/node_modules/typescript/dist/enums/completionItemKind.js.map +1 -0
- package/examples/gh/node_modules/typescript/dist/enums/diagnosticCategory.d.ts +2 -0
- package/examples/gh/node_modules/typescript/dist/enums/diagnosticCategory.d.ts.map +1 -0
- package/examples/gh/node_modules/typescript/dist/enums/diagnosticCategory.enum.d.ts +7 -0
- package/examples/gh/node_modules/typescript/dist/enums/diagnosticCategory.enum.d.ts.map +1 -0
- package/examples/gh/node_modules/typescript/dist/enums/diagnosticCategory.enum.js +9 -0
- package/examples/gh/node_modules/typescript/dist/enums/diagnosticCategory.enum.js.map +1 -0
- package/examples/gh/node_modules/typescript/dist/enums/diagnosticCategory.js +9 -0
- package/examples/gh/node_modules/typescript/dist/enums/diagnosticCategory.js.map +1 -0
- package/examples/gh/node_modules/typescript/dist/enums/elementFlags.d.ts +2 -0
- package/examples/gh/node_modules/typescript/dist/enums/elementFlags.d.ts.map +1 -0
- package/examples/gh/node_modules/typescript/dist/enums/elementFlags.enum.d.ts +12 -0
- package/examples/gh/node_modules/typescript/dist/enums/elementFlags.enum.d.ts.map +1 -0
- package/examples/gh/node_modules/typescript/dist/enums/elementFlags.enum.js +14 -0
- package/examples/gh/node_modules/typescript/dist/enums/elementFlags.enum.js.map +1 -0
- package/examples/gh/node_modules/typescript/dist/enums/elementFlags.js +14 -0
- package/examples/gh/node_modules/typescript/dist/enums/elementFlags.js.map +1 -0
- package/examples/gh/node_modules/typescript/dist/enums/internalSymbolName.d.ts +2 -0
- package/examples/gh/node_modules/typescript/dist/enums/internalSymbolName.d.ts.map +1 -0
- package/examples/gh/node_modules/typescript/dist/enums/internalSymbolName.enum.d.ts +23 -0
- package/examples/gh/node_modules/typescript/dist/enums/internalSymbolName.enum.d.ts.map +1 -0
- package/examples/gh/node_modules/typescript/dist/enums/internalSymbolName.enum.js +25 -0
- package/examples/gh/node_modules/typescript/dist/enums/internalSymbolName.enum.js.map +1 -0
- package/examples/gh/node_modules/typescript/dist/enums/internalSymbolName.js +25 -0
- package/examples/gh/node_modules/typescript/dist/enums/internalSymbolName.js.map +1 -0
- package/examples/gh/node_modules/typescript/dist/enums/jsxEmit.d.ts +2 -0
- package/examples/gh/node_modules/typescript/dist/enums/jsxEmit.d.ts.map +1 -0
- package/examples/gh/node_modules/typescript/dist/enums/jsxEmit.enum.d.ts +9 -0
- package/examples/gh/node_modules/typescript/dist/enums/jsxEmit.enum.d.ts.map +1 -0
- package/examples/gh/node_modules/typescript/dist/enums/jsxEmit.enum.js +11 -0
- package/examples/gh/node_modules/typescript/dist/enums/jsxEmit.enum.js.map +1 -0
- package/examples/gh/node_modules/typescript/dist/enums/jsxEmit.js +11 -0
- package/examples/gh/node_modules/typescript/dist/enums/jsxEmit.js.map +1 -0
- package/examples/gh/node_modules/typescript/dist/enums/languageVariant.d.ts +2 -0
- package/examples/gh/node_modules/typescript/dist/enums/languageVariant.d.ts.map +1 -0
- package/examples/gh/node_modules/typescript/dist/enums/languageVariant.enum.d.ts +5 -0
- package/examples/gh/node_modules/typescript/dist/enums/languageVariant.enum.d.ts.map +1 -0
- package/examples/gh/node_modules/typescript/dist/enums/languageVariant.enum.js +6 -0
- package/examples/gh/node_modules/typescript/dist/enums/languageVariant.enum.js.map +1 -0
- package/examples/gh/node_modules/typescript/dist/enums/languageVariant.js +6 -0
- package/examples/gh/node_modules/typescript/dist/enums/languageVariant.js.map +1 -0
- package/examples/gh/node_modules/typescript/dist/enums/modifierFlags.d.ts +2 -0
- package/examples/gh/node_modules/typescript/dist/enums/modifierFlags.d.ts.map +1 -0
- package/examples/gh/node_modules/typescript/dist/enums/modifierFlags.enum.d.ts +42 -0
- package/examples/gh/node_modules/typescript/dist/enums/modifierFlags.enum.d.ts.map +1 -0
- package/examples/gh/node_modules/typescript/dist/enums/modifierFlags.enum.js +44 -0
- package/examples/gh/node_modules/typescript/dist/enums/modifierFlags.enum.js.map +1 -0
- package/examples/gh/node_modules/typescript/dist/enums/modifierFlags.js +44 -0
- package/examples/gh/node_modules/typescript/dist/enums/modifierFlags.js.map +1 -0
- package/examples/gh/node_modules/typescript/dist/enums/moduleDetectionKind.d.ts +2 -0
- package/examples/gh/node_modules/typescript/dist/enums/moduleDetectionKind.d.ts.map +1 -0
- package/examples/gh/node_modules/typescript/dist/enums/moduleDetectionKind.enum.d.ts +7 -0
- package/examples/gh/node_modules/typescript/dist/enums/moduleDetectionKind.enum.d.ts.map +1 -0
- package/examples/gh/node_modules/typescript/dist/enums/moduleDetectionKind.enum.js +9 -0
- package/examples/gh/node_modules/typescript/dist/enums/moduleDetectionKind.enum.js.map +1 -0
- package/examples/gh/node_modules/typescript/dist/enums/moduleDetectionKind.js +9 -0
- package/examples/gh/node_modules/typescript/dist/enums/moduleDetectionKind.js.map +1 -0
- package/examples/gh/node_modules/typescript/dist/enums/moduleKind.d.ts +2 -0
- package/examples/gh/node_modules/typescript/dist/enums/moduleKind.d.ts.map +1 -0
- package/examples/gh/node_modules/typescript/dist/enums/moduleKind.enum.d.ts +17 -0
- package/examples/gh/node_modules/typescript/dist/enums/moduleKind.enum.d.ts.map +1 -0
- package/examples/gh/node_modules/typescript/dist/enums/moduleKind.enum.js +19 -0
- package/examples/gh/node_modules/typescript/dist/enums/moduleKind.enum.js.map +1 -0
- package/examples/gh/node_modules/typescript/dist/enums/moduleKind.js +19 -0
- package/examples/gh/node_modules/typescript/dist/enums/moduleKind.js.map +1 -0
- package/examples/gh/node_modules/typescript/dist/enums/moduleResolutionKind.d.ts +2 -0
- package/examples/gh/node_modules/typescript/dist/enums/moduleResolutionKind.d.ts.map +1 -0
- package/examples/gh/node_modules/typescript/dist/enums/moduleResolutionKind.enum.d.ts +9 -0
- package/examples/gh/node_modules/typescript/dist/enums/moduleResolutionKind.enum.d.ts.map +1 -0
- package/examples/gh/node_modules/typescript/dist/enums/moduleResolutionKind.enum.js +11 -0
- package/examples/gh/node_modules/typescript/dist/enums/moduleResolutionKind.enum.js.map +1 -0
- package/examples/gh/node_modules/typescript/dist/enums/moduleResolutionKind.js +11 -0
- package/examples/gh/node_modules/typescript/dist/enums/moduleResolutionKind.js.map +1 -0
- package/examples/gh/node_modules/typescript/dist/enums/newLineKind.d.ts +2 -0
- package/examples/gh/node_modules/typescript/dist/enums/newLineKind.d.ts.map +1 -0
- package/examples/gh/node_modules/typescript/dist/enums/newLineKind.enum.d.ts +6 -0
- package/examples/gh/node_modules/typescript/dist/enums/newLineKind.enum.d.ts.map +1 -0
- package/examples/gh/node_modules/typescript/dist/enums/newLineKind.enum.js +8 -0
- package/examples/gh/node_modules/typescript/dist/enums/newLineKind.enum.js.map +1 -0
- package/examples/gh/node_modules/typescript/dist/enums/newLineKind.js +8 -0
- package/examples/gh/node_modules/typescript/dist/enums/newLineKind.js.map +1 -0
- package/examples/gh/node_modules/typescript/dist/enums/nodeBuilderFlags.d.ts +2 -0
- package/examples/gh/node_modules/typescript/dist/enums/nodeBuilderFlags.d.ts.map +1 -0
- package/examples/gh/node_modules/typescript/dist/enums/nodeBuilderFlags.enum.d.ts +36 -0
- package/examples/gh/node_modules/typescript/dist/enums/nodeBuilderFlags.enum.d.ts.map +1 -0
- package/examples/gh/node_modules/typescript/dist/enums/nodeBuilderFlags.enum.js +38 -0
- package/examples/gh/node_modules/typescript/dist/enums/nodeBuilderFlags.enum.js.map +1 -0
- package/examples/gh/node_modules/typescript/dist/enums/nodeBuilderFlags.js +38 -0
- package/examples/gh/node_modules/typescript/dist/enums/nodeBuilderFlags.js.map +1 -0
- package/examples/gh/node_modules/typescript/dist/enums/nodeFlags.d.ts +2 -0
- package/examples/gh/node_modules/typescript/dist/enums/nodeFlags.d.ts.map +1 -0
- package/examples/gh/node_modules/typescript/dist/enums/nodeFlags.enum.d.ts +44 -0
- package/examples/gh/node_modules/typescript/dist/enums/nodeFlags.enum.d.ts.map +1 -0
- package/examples/gh/node_modules/typescript/dist/enums/nodeFlags.enum.js +46 -0
- package/examples/gh/node_modules/typescript/dist/enums/nodeFlags.enum.js.map +1 -0
- package/examples/gh/node_modules/typescript/dist/enums/nodeFlags.js +46 -0
- package/examples/gh/node_modules/typescript/dist/enums/nodeFlags.js.map +1 -0
- package/examples/gh/node_modules/typescript/dist/enums/objectFlags.d.ts +2 -0
- package/examples/gh/node_modules/typescript/dist/enums/objectFlags.d.ts.map +1 -0
- package/examples/gh/node_modules/typescript/dist/enums/objectFlags.enum.d.ts +50 -0
- package/examples/gh/node_modules/typescript/dist/enums/objectFlags.enum.d.ts.map +1 -0
- package/examples/gh/node_modules/typescript/dist/enums/objectFlags.enum.js +52 -0
- package/examples/gh/node_modules/typescript/dist/enums/objectFlags.enum.js.map +1 -0
- package/examples/gh/node_modules/typescript/dist/enums/objectFlags.js +52 -0
- package/examples/gh/node_modules/typescript/dist/enums/objectFlags.js.map +1 -0
- package/examples/gh/node_modules/typescript/dist/enums/outerExpressionKinds.d.ts +2 -0
- package/examples/gh/node_modules/typescript/dist/enums/outerExpressionKinds.d.ts.map +1 -0
- package/examples/gh/node_modules/typescript/dist/enums/outerExpressionKinds.enum.d.ts +16 -0
- package/examples/gh/node_modules/typescript/dist/enums/outerExpressionKinds.enum.d.ts.map +1 -0
- package/examples/gh/node_modules/typescript/dist/enums/outerExpressionKinds.enum.js +18 -0
- package/examples/gh/node_modules/typescript/dist/enums/outerExpressionKinds.enum.js.map +1 -0
- package/examples/gh/node_modules/typescript/dist/enums/outerExpressionKinds.js +18 -0
- package/examples/gh/node_modules/typescript/dist/enums/outerExpressionKinds.js.map +1 -0
- package/examples/gh/node_modules/typescript/dist/enums/regularExpressionFlags.d.ts +2 -0
- package/examples/gh/node_modules/typescript/dist/enums/regularExpressionFlags.d.ts.map +1 -0
- package/examples/gh/node_modules/typescript/dist/enums/regularExpressionFlags.enum.d.ts +13 -0
- package/examples/gh/node_modules/typescript/dist/enums/regularExpressionFlags.enum.d.ts.map +1 -0
- package/examples/gh/node_modules/typescript/dist/enums/regularExpressionFlags.enum.js +14 -0
- package/examples/gh/node_modules/typescript/dist/enums/regularExpressionFlags.enum.js.map +1 -0
- package/examples/gh/node_modules/typescript/dist/enums/regularExpressionFlags.js +14 -0
- package/examples/gh/node_modules/typescript/dist/enums/regularExpressionFlags.js.map +1 -0
- package/examples/gh/node_modules/typescript/dist/enums/scriptKind.d.ts +2 -0
- package/examples/gh/node_modules/typescript/dist/enums/scriptKind.d.ts.map +1 -0
- package/examples/gh/node_modules/typescript/dist/enums/scriptKind.enum.d.ts +11 -0
- package/examples/gh/node_modules/typescript/dist/enums/scriptKind.enum.d.ts.map +1 -0
- package/examples/gh/node_modules/typescript/dist/enums/scriptKind.enum.js +12 -0
- package/examples/gh/node_modules/typescript/dist/enums/scriptKind.enum.js.map +1 -0
- package/examples/gh/node_modules/typescript/dist/enums/scriptKind.js +12 -0
- package/examples/gh/node_modules/typescript/dist/enums/scriptKind.js.map +1 -0
- package/examples/gh/node_modules/typescript/dist/enums/scriptTarget.d.ts +2 -0
- package/examples/gh/node_modules/typescript/dist/enums/scriptTarget.d.ts.map +1 -0
- package/examples/gh/node_modules/typescript/dist/enums/scriptTarget.enum.d.ts +17 -0
- package/examples/gh/node_modules/typescript/dist/enums/scriptTarget.enum.d.ts.map +1 -0
- package/examples/gh/node_modules/typescript/dist/enums/scriptTarget.enum.js +18 -0
- package/examples/gh/node_modules/typescript/dist/enums/scriptTarget.enum.js.map +1 -0
- package/examples/gh/node_modules/typescript/dist/enums/scriptTarget.js +18 -0
- package/examples/gh/node_modules/typescript/dist/enums/scriptTarget.js.map +1 -0
- package/examples/gh/node_modules/typescript/dist/enums/signatureFlags.d.ts +2 -0
- package/examples/gh/node_modules/typescript/dist/enums/signatureFlags.d.ts.map +1 -0
- package/examples/gh/node_modules/typescript/dist/enums/signatureFlags.enum.d.ts +15 -0
- package/examples/gh/node_modules/typescript/dist/enums/signatureFlags.enum.d.ts.map +1 -0
- package/examples/gh/node_modules/typescript/dist/enums/signatureFlags.enum.js +17 -0
- package/examples/gh/node_modules/typescript/dist/enums/signatureFlags.enum.js.map +1 -0
- package/examples/gh/node_modules/typescript/dist/enums/signatureFlags.js +17 -0
- package/examples/gh/node_modules/typescript/dist/enums/signatureFlags.js.map +1 -0
- package/examples/gh/node_modules/typescript/dist/enums/signatureKind.d.ts +2 -0
- package/examples/gh/node_modules/typescript/dist/enums/signatureKind.d.ts.map +1 -0
- package/examples/gh/node_modules/typescript/dist/enums/signatureKind.enum.d.ts +5 -0
- package/examples/gh/node_modules/typescript/dist/enums/signatureKind.enum.d.ts.map +1 -0
- package/examples/gh/node_modules/typescript/dist/enums/signatureKind.enum.js +7 -0
- package/examples/gh/node_modules/typescript/dist/enums/signatureKind.enum.js.map +1 -0
- package/examples/gh/node_modules/typescript/dist/enums/signatureKind.js +7 -0
- package/examples/gh/node_modules/typescript/dist/enums/signatureKind.js.map +1 -0
- package/examples/gh/node_modules/typescript/dist/enums/symbolFlags.d.ts +2 -0
- package/examples/gh/node_modules/typescript/dist/enums/symbolFlags.d.ts.map +1 -0
- package/examples/gh/node_modules/typescript/dist/enums/symbolFlags.enum.d.ts +71 -0
- package/examples/gh/node_modules/typescript/dist/enums/symbolFlags.enum.d.ts.map +1 -0
- package/examples/gh/node_modules/typescript/dist/enums/symbolFlags.enum.js +73 -0
- package/examples/gh/node_modules/typescript/dist/enums/symbolFlags.enum.js.map +1 -0
- package/examples/gh/node_modules/typescript/dist/enums/symbolFlags.js +73 -0
- package/examples/gh/node_modules/typescript/dist/enums/symbolFlags.js.map +1 -0
- package/examples/gh/node_modules/typescript/dist/enums/syntaxKind.d.ts +2 -0
- package/examples/gh/node_modules/typescript/dist/enums/syntaxKind.d.ts.map +1 -0
- package/examples/gh/node_modules/typescript/dist/enums/syntaxKind.enum.d.ts +389 -0
- package/examples/gh/node_modules/typescript/dist/enums/syntaxKind.enum.d.ts.map +1 -0
- package/examples/gh/node_modules/typescript/dist/enums/syntaxKind.enum.js +391 -0
- package/examples/gh/node_modules/typescript/dist/enums/syntaxKind.enum.js.map +1 -0
- package/examples/gh/node_modules/typescript/dist/enums/syntaxKind.js +391 -0
- package/examples/gh/node_modules/typescript/dist/enums/syntaxKind.js.map +1 -0
- package/examples/gh/node_modules/typescript/dist/enums/tokenFlags.d.ts +2 -0
- package/examples/gh/node_modules/typescript/dist/enums/tokenFlags.d.ts.map +1 -0
- package/examples/gh/node_modules/typescript/dist/enums/tokenFlags.enum.d.ts +30 -0
- package/examples/gh/node_modules/typescript/dist/enums/tokenFlags.enum.d.ts.map +1 -0
- package/examples/gh/node_modules/typescript/dist/enums/tokenFlags.enum.js +32 -0
- package/examples/gh/node_modules/typescript/dist/enums/tokenFlags.enum.js.map +1 -0
- package/examples/gh/node_modules/typescript/dist/enums/tokenFlags.js +32 -0
- package/examples/gh/node_modules/typescript/dist/enums/tokenFlags.js.map +1 -0
- package/examples/gh/node_modules/typescript/dist/enums/typeFlags.d.ts +2 -0
- package/examples/gh/node_modules/typescript/dist/enums/typeFlags.d.ts.map +1 -0
- package/examples/gh/node_modules/typescript/dist/enums/typeFlags.enum.d.ts +76 -0
- package/examples/gh/node_modules/typescript/dist/enums/typeFlags.enum.d.ts.map +1 -0
- package/examples/gh/node_modules/typescript/dist/enums/typeFlags.enum.js +78 -0
- package/examples/gh/node_modules/typescript/dist/enums/typeFlags.enum.js.map +1 -0
- package/examples/gh/node_modules/typescript/dist/enums/typeFlags.js +78 -0
- package/examples/gh/node_modules/typescript/dist/enums/typeFlags.js.map +1 -0
- package/examples/gh/node_modules/typescript/dist/enums/typePredicateKind.d.ts +2 -0
- package/examples/gh/node_modules/typescript/dist/enums/typePredicateKind.d.ts.map +1 -0
- package/examples/gh/node_modules/typescript/dist/enums/typePredicateKind.enum.d.ts +7 -0
- package/examples/gh/node_modules/typescript/dist/enums/typePredicateKind.enum.d.ts.map +1 -0
- package/examples/gh/node_modules/typescript/dist/enums/typePredicateKind.enum.js +9 -0
- package/examples/gh/node_modules/typescript/dist/enums/typePredicateKind.enum.js.map +1 -0
- package/examples/gh/node_modules/typescript/dist/enums/typePredicateKind.js +9 -0
- package/examples/gh/node_modules/typescript/dist/enums/typePredicateKind.js.map +1 -0
- package/examples/gh/node_modules/typescript/dist/internal/utils.d.ts +23 -0
- package/examples/gh/node_modules/typescript/dist/internal/utils.d.ts.map +1 -0
- package/examples/gh/node_modules/typescript/dist/internal/utils.js +25 -0
- package/examples/gh/node_modules/typescript/dist/internal/utils.js.map +1 -0
- package/examples/gh/node_modules/typescript/lib/getExePath.d.ts +2 -0
- package/examples/gh/node_modules/typescript/lib/getExePath.js +70 -0
- package/examples/gh/node_modules/typescript/lib/tsc.js +28 -0
- package/examples/gh/node_modules/typescript/lib/version.cjs +3 -0
- package/examples/gh/node_modules/typescript/lib/version.d.cts +2 -0
- package/examples/gh/node_modules/typescript/package.json +87 -0
- package/examples/gh/node_modules/typescript/vendor/vscode-jsonrpc/License.txt +11 -0
- package/examples/gh/node_modules/typescript/vendor/vscode-jsonrpc/README.md +54 -0
- package/examples/gh/node_modules/typescript/vendor/vscode-jsonrpc/lib/browser/main.d.ts +17 -0
- package/examples/gh/node_modules/typescript/vendor/vscode-jsonrpc/lib/browser/main.js +83 -0
- package/examples/gh/node_modules/typescript/vendor/vscode-jsonrpc/lib/browser/ril.d.ts +22 -0
- package/examples/gh/node_modules/typescript/vendor/vscode-jsonrpc/lib/browser/ril.js +210 -0
- package/examples/gh/node_modules/typescript/vendor/vscode-jsonrpc/lib/common/api.d.ts +14 -0
- package/examples/gh/node_modules/typescript/vendor/vscode-jsonrpc/lib/common/api.js +87 -0
- package/examples/gh/node_modules/typescript/vendor/vscode-jsonrpc/lib/common/cancellation.d.ts +32 -0
- package/examples/gh/node_modules/typescript/vendor/vscode-jsonrpc/lib/common/cancellation.js +132 -0
- package/examples/gh/node_modules/typescript/vendor/vscode-jsonrpc/lib/common/connection.d.ts +367 -0
- package/examples/gh/node_modules/typescript/vendor/vscode-jsonrpc/lib/common/connection.js +1271 -0
- package/examples/gh/node_modules/typescript/vendor/vscode-jsonrpc/lib/common/disposable.d.ts +9 -0
- package/examples/gh/node_modules/typescript/vendor/vscode-jsonrpc/lib/common/disposable.js +16 -0
- package/examples/gh/node_modules/typescript/vendor/vscode-jsonrpc/lib/common/encoding.d.ts +52 -0
- package/examples/gh/node_modules/typescript/vendor/vscode-jsonrpc/lib/common/encoding.js +70 -0
- package/examples/gh/node_modules/typescript/vendor/vscode-jsonrpc/lib/common/events.d.ts +39 -0
- package/examples/gh/node_modules/typescript/vendor/vscode-jsonrpc/lib/common/events.js +135 -0
- package/examples/gh/node_modules/typescript/vendor/vscode-jsonrpc/lib/common/is.d.ts +7 -0
- package/examples/gh/node_modules/typescript/vendor/vscode-jsonrpc/lib/common/is.js +34 -0
- package/examples/gh/node_modules/typescript/vendor/vscode-jsonrpc/lib/common/linkedMap.d.ts +55 -0
- package/examples/gh/node_modules/typescript/vendor/vscode-jsonrpc/lib/common/linkedMap.js +412 -0
- package/examples/gh/node_modules/typescript/vendor/vscode-jsonrpc/lib/common/messageBuffer.d.ts +18 -0
- package/examples/gh/node_modules/typescript/vendor/vscode-jsonrpc/lib/common/messageBuffer.js +155 -0
- package/examples/gh/node_modules/typescript/vendor/vscode-jsonrpc/lib/common/messageReader.d.ts +77 -0
- package/examples/gh/node_modules/typescript/vendor/vscode-jsonrpc/lib/common/messageReader.js +246 -0
- package/examples/gh/node_modules/typescript/vendor/vscode-jsonrpc/lib/common/messageWriter.d.ts +60 -0
- package/examples/gh/node_modules/typescript/vendor/vscode-jsonrpc/lib/common/messageWriter.js +157 -0
- package/examples/gh/node_modules/typescript/vendor/vscode-jsonrpc/lib/common/messages.d.ts +369 -0
- package/examples/gh/node_modules/typescript/vendor/vscode-jsonrpc/lib/common/messages.js +436 -0
- package/examples/gh/node_modules/typescript/vendor/vscode-jsonrpc/lib/common/ral.d.ts +74 -0
- package/examples/gh/node_modules/typescript/vendor/vscode-jsonrpc/lib/common/ral.js +23 -0
- package/examples/gh/node_modules/typescript/vendor/vscode-jsonrpc/lib/common/semaphore.d.ts +10 -0
- package/examples/gh/node_modules/typescript/vendor/vscode-jsonrpc/lib/common/semaphore.js +74 -0
- package/examples/gh/node_modules/typescript/vendor/vscode-jsonrpc/lib/common/sharedArrayCancellation.d.ts +15 -0
- package/examples/gh/node_modules/typescript/vendor/vscode-jsonrpc/lib/common/sharedArrayCancellation.js +77 -0
- package/examples/gh/node_modules/typescript/vendor/vscode-jsonrpc/lib/node/main.d.ts +58 -0
- package/examples/gh/node_modules/typescript/vendor/vscode-jsonrpc/lib/node/main.js +289 -0
- package/examples/gh/node_modules/typescript/vendor/vscode-jsonrpc/lib/node/ril.d.ts +12 -0
- package/examples/gh/node_modules/typescript/vendor/vscode-jsonrpc/lib/node/ril.js +163 -0
- package/examples/gh/node_modules/typescript/vendor/vscode-jsonrpc/package.json +54 -0
- package/examples/gh/node_modules/typescript/vendor/vscode-jsonrpc/typings/thenable.d.ts +5 -0
- package/examples/gh/package.json +11 -5
- package/examples/gh/src/main.ts +10 -4
- package/examples/help-config.ts +43 -0
- package/examples/json-mode.ts +8 -4
- package/examples/middleware.ts +1 -1
- package/examples/output-extras.ts +46 -0
- package/examples/parser-control.ts +40 -0
- package/examples/pwsh-demo/package.json +1 -1
- package/examples/pwsh-demo/src/main.ts +1 -1
- package/examples/standard-schema.ts +45 -0
- package/examples/transport-launcher.ts +10 -10
- package/package.json +26 -31
- package/skills/cli-creation/SKILL.md +140 -0
- package/skills/cli-creation/agents/openai.yaml +4 -0
- package/skills/cli-creation/assets/templates/multi-command.bun-test.ts.tpl +20 -0
- package/skills/cli-creation/assets/templates/multi-command.test.ts.tpl +20 -0
- package/skills/cli-creation/assets/templates/multi-command.ts.tpl +89 -0
- package/skills/cli-creation/assets/templates/single-command.bun-test.ts.tpl +29 -0
- package/skills/cli-creation/assets/templates/single-command.test.ts.tpl +29 -0
- package/skills/cli-creation/assets/templates/single-command.ts.tpl +47 -0
- package/skills/cli-creation/references/consumer-workflow.md +65 -0
- package/skills/cli-creation/references/pattern-cookbook.md +293 -0
- package/skills/cli-creation/references/runtime-notes.md +29 -0
- package/skills/cli-creation/scripts/scaffold_cli.py +360 -0
- package/dist/core/schema-dsl/runtime.d.mts +0 -144
- package/dist/core/schema-dsl/runtime.mjs +0 -271
- package/dist/core/schema-dsl/to-json-schema.d.mts +0 -29
- package/dist/core/schema-dsl/to-json-schema.mjs +0 -74
package/dist/core/help/ansi.mjs
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { createColors, strip } from "ansispeck";
|
|
1
2
|
//#region src/core/help/ansi.ts
|
|
2
3
|
/**
|
|
3
4
|
* ANSI/OSC-aware text helpers for help formatting.
|
|
@@ -11,20 +12,18 @@
|
|
|
11
12
|
* @module dreamcli/core/help/ansi
|
|
12
13
|
*/
|
|
13
14
|
/**
|
|
14
|
-
* Matches ANSI escape sequences: CSI (e.g. SGR color codes like `\x1b[31m`)
|
|
15
|
-
* and OSC (e.g. OSC 8 hyperlinks), with both BEL and ST terminators.
|
|
16
|
-
*
|
|
17
|
-
* @internal
|
|
18
|
-
*/
|
|
19
|
-
const ANSI_PATTERN = /\u001B(?:\[[0-?]*[ -/]*[@-~]|\][^\u0007\u001B]*(?:\u0007|\u001B\\))/g;
|
|
20
|
-
/**
|
|
21
15
|
* Remove ANSI CSI and OSC escape sequences from `text`.
|
|
22
16
|
*
|
|
17
|
+
* Delegates to `ansispeck`'s stripper, which handles SGR sequences and OSC
|
|
18
|
+
* hyperlinks under both terminators. Kept as a named export so help
|
|
19
|
+
* formatting and custom help renderers reach the width-aware helpers and
|
|
20
|
+
* their stripper through one module.
|
|
21
|
+
*
|
|
23
22
|
* @param text - Text possibly containing terminal escapes.
|
|
24
23
|
* @returns The text with all escape sequences removed.
|
|
25
24
|
*/
|
|
26
25
|
function stripAnsi(text) {
|
|
27
|
-
return text
|
|
26
|
+
return strip(text);
|
|
28
27
|
}
|
|
29
28
|
/**
|
|
30
29
|
* Measure the visible column width of `text`, ignoring ANSI/OSC escapes.
|
|
@@ -46,16 +45,15 @@ function stripAnsi(text) {
|
|
|
46
45
|
function visibleWidth(text) {
|
|
47
46
|
return stripAnsi(text).length;
|
|
48
47
|
}
|
|
49
|
-
const
|
|
50
|
-
const BEL = "\x07";
|
|
48
|
+
const emitLink = createColors(false, true).link;
|
|
51
49
|
/**
|
|
52
50
|
* Wrap `text` in an [OSC 8 hyperlink](https://gist.github.com/egmontkob/eb114294efbcd5adb1944c9f3cb5feda)
|
|
53
51
|
* pointing at `url`.
|
|
54
52
|
*
|
|
55
|
-
* Supporting terminals render `text` as a clickable link;
|
|
56
|
-
*
|
|
57
|
-
*
|
|
58
|
-
*
|
|
53
|
+
* Supporting terminals render `text` as a clickable link; others show it
|
|
54
|
+
* plain. `text` defaults to the URL, so an omitted label degrades to a
|
|
55
|
+
* usable address. The framework's help layer decides *whether* to link
|
|
56
|
+
* (`help.hyperlinks`); this always emits when called.
|
|
59
57
|
*
|
|
60
58
|
* @param url - Link target (string or `URL` instance).
|
|
61
59
|
* @param text - Visible link text.
|
|
@@ -64,11 +62,11 @@ const BEL = "\x07";
|
|
|
64
62
|
* @example
|
|
65
63
|
* ```ts
|
|
66
64
|
* cli('mycli').version(osc8('https://github.com/me/mycli/releases/tag/v1.0.0', '1.0.0'));
|
|
65
|
+
* osc8('https://dreamcli.kjanat.dev'); // linked, displayed as the URL
|
|
67
66
|
* ```
|
|
68
67
|
*/
|
|
69
68
|
function osc8(url, text) {
|
|
70
|
-
|
|
71
|
-
return `${OSC}8;;${href}${BEL}${text}${OSC}8;;${BEL}`;
|
|
69
|
+
return emitLink(url, text);
|
|
72
70
|
}
|
|
73
71
|
/**
|
|
74
72
|
* Pad `text` to `length` visible columns with trailing spaces.
|
|
@@ -10,6 +10,26 @@ interface HelpOptions {
|
|
|
10
10
|
readonly width?: number;
|
|
11
11
|
/** Binary/program name shown in the usage line. Defaults to command name. */
|
|
12
12
|
readonly binName?: string;
|
|
13
|
+
/** Program version passed to function-form examples as `meta.version`. */
|
|
14
|
+
readonly version?: string;
|
|
15
|
+
/**
|
|
16
|
+
* Order of flags in the `Flags:` table.
|
|
17
|
+
*
|
|
18
|
+
* - `'alphabetical'` — short-aliased flags first, then alphabetical by name.
|
|
19
|
+
* - `'declaration'` — the order `.flag()` was called.
|
|
20
|
+
*
|
|
21
|
+
* Ignored when {@link HelpOptions.sortFlags} is set.
|
|
22
|
+
*
|
|
23
|
+
* @defaultValue `'alphabetical'`
|
|
24
|
+
*/
|
|
25
|
+
readonly flagOrder?: 'alphabetical' | 'declaration';
|
|
26
|
+
/**
|
|
27
|
+
* Custom comparator over flag long names for the `Flags:` table. When set,
|
|
28
|
+
* it wins over {@link HelpOptions.flagOrder}.
|
|
29
|
+
*
|
|
30
|
+
* @defaultValue `undefined` (use `flagOrder`)
|
|
31
|
+
*/
|
|
32
|
+
readonly sortFlags?: (a: string, b: string) => number;
|
|
13
33
|
/**
|
|
14
34
|
* Emit OSC 8 hyperlinks where link metadata is available (currently the
|
|
15
35
|
* root-help header name/version configured via `CLIBuilder.links()`).
|
|
@@ -64,7 +84,9 @@ interface HelpOptions {
|
|
|
64
84
|
}
|
|
65
85
|
/** Formatted flag entry for the flags table. @internal */
|
|
66
86
|
interface FlagEntry {
|
|
87
|
+
/** Preformatted flag names and value hint for the left table column. */
|
|
67
88
|
readonly left: string;
|
|
89
|
+
/** Preformatted help text for the description table column. */
|
|
68
90
|
readonly description: string;
|
|
69
91
|
}
|
|
70
92
|
/**
|
package/dist/core/help/index.mjs
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { getFlagAliasNames } from "../schema/flag.mjs";
|
|
2
|
+
import { resolveExampleCommand } from "../schema/command.mjs";
|
|
2
3
|
import { formatDisplayValue } from "../output/display-value.mjs";
|
|
3
4
|
import { osc8, padEnd, visibleWidth, wrapText } from "./ansi.mjs";
|
|
4
5
|
import { resolveHelpTheme } from "./theme.mjs";
|
|
@@ -14,6 +15,9 @@ function resolveOptions(options) {
|
|
|
14
15
|
return {
|
|
15
16
|
width: options?.width ?? DEFAULT_WIDTH,
|
|
16
17
|
binName: options?.binName,
|
|
18
|
+
version: options?.version,
|
|
19
|
+
flagOrder: options?.flagOrder ?? "alphabetical",
|
|
20
|
+
sortFlags: options?.sortFlags,
|
|
17
21
|
isDefaultHelp: options?.isDefaultHelp ?? false,
|
|
18
22
|
theme: resolveHelpTheme(options?.colors, options?.theme)
|
|
19
23
|
};
|
|
@@ -96,32 +100,45 @@ function formatFlagDescription(schema, theme) {
|
|
|
96
100
|
return parts.join(" ");
|
|
97
101
|
}
|
|
98
102
|
/**
|
|
99
|
-
*
|
|
103
|
+
* Default flag order: short-aliased flags first, then alphabetical by name.
|
|
104
|
+
*/
|
|
105
|
+
function defaultFlagOrder(a, b, flags) {
|
|
106
|
+
const aSchema = flags[a];
|
|
107
|
+
const bSchema = flags[b];
|
|
108
|
+
if (aSchema === void 0 || bSchema === void 0) return 0;
|
|
109
|
+
const aHasShort = getFlagAliasNames(aSchema, { kind: "short" }).length > 0;
|
|
110
|
+
const bHasShort = getFlagAliasNames(bSchema, { kind: "short" }).length > 0;
|
|
111
|
+
if (aHasShort && !bHasShort) return -1;
|
|
112
|
+
if (!aHasShort && bHasShort) return 1;
|
|
113
|
+
return a.localeCompare(b);
|
|
114
|
+
}
|
|
115
|
+
/**
|
|
116
|
+
* Order flag names for the table: an explicit `sortFlags` comparator wins,
|
|
117
|
+
* then `'declaration'` preserves `.flag()` call order, otherwise the default
|
|
118
|
+
* short-first alphabetical order.
|
|
119
|
+
*/
|
|
120
|
+
function orderFlagNames(names, flags, opts) {
|
|
121
|
+
if (opts.sortFlags !== void 0) return [...names].sort(opts.sortFlags);
|
|
122
|
+
if (opts.flagOrder === "declaration") return names;
|
|
123
|
+
return [...names].sort((a, b) => defaultFlagOrder(a, b, flags));
|
|
124
|
+
}
|
|
125
|
+
/**
|
|
126
|
+
* Build the flag entries in the configured order.
|
|
100
127
|
*
|
|
101
128
|
* @param flags - Map of flag names to {@link FlagSchema} definitions.
|
|
102
|
-
* @param
|
|
103
|
-
* @returns
|
|
129
|
+
* @param opts - Resolved help options (theme + flag ordering).
|
|
130
|
+
* @returns Array of {@link FlagEntry} objects for the flags table.
|
|
104
131
|
*/
|
|
105
|
-
function buildFlagEntries(flags,
|
|
132
|
+
function buildFlagEntries(flags, opts) {
|
|
106
133
|
const names = Object.keys(flags);
|
|
107
134
|
if (names.length === 0) return [];
|
|
108
|
-
const sorted = [...names].sort((a, b) => {
|
|
109
|
-
const aSchema = flags[a];
|
|
110
|
-
const bSchema = flags[b];
|
|
111
|
-
if (aSchema === void 0 || bSchema === void 0) return 0;
|
|
112
|
-
const aHasShort = getFlagAliasNames(aSchema, { kind: "short" }).length > 0;
|
|
113
|
-
const bHasShort = getFlagAliasNames(bSchema, { kind: "short" }).length > 0;
|
|
114
|
-
if (aHasShort && !bHasShort) return -1;
|
|
115
|
-
if (!aHasShort && bHasShort) return 1;
|
|
116
|
-
return a.localeCompare(b);
|
|
117
|
-
});
|
|
118
135
|
const entries = [];
|
|
119
|
-
for (const name of
|
|
136
|
+
for (const name of orderFlagNames(names, flags, opts)) {
|
|
120
137
|
const schema = flags[name];
|
|
121
138
|
if (schema === void 0) continue;
|
|
122
139
|
entries.push({
|
|
123
|
-
left: formatFlagLeft(name, schema, theme),
|
|
124
|
-
description: formatFlagDescription(schema, theme)
|
|
140
|
+
left: formatFlagLeft(name, schema, opts.theme),
|
|
141
|
+
description: formatFlagDescription(schema, opts.theme)
|
|
125
142
|
});
|
|
126
143
|
}
|
|
127
144
|
return entries;
|
|
@@ -171,7 +188,13 @@ function formatHelpSections(schema, options) {
|
|
|
171
188
|
if (visibleCommands.length > 0) sections.push(formatCommandsSection(visibleCommands, opts));
|
|
172
189
|
if (schema.args.length > 0) sections.push(formatArgsSection(schema.args, opts));
|
|
173
190
|
if (Object.keys(schema.flags).length > 0) sections.push(formatFlagsSection(schema.flags, opts));
|
|
174
|
-
if (schema.examples.length > 0)
|
|
191
|
+
if (schema.examples.length > 0) {
|
|
192
|
+
const meta = {
|
|
193
|
+
name: opts.binName ?? schema.name,
|
|
194
|
+
version: opts.version
|
|
195
|
+
};
|
|
196
|
+
sections.push(formatExamplesSection(schema.examples, opts.theme, meta));
|
|
197
|
+
}
|
|
175
198
|
return sections;
|
|
176
199
|
}
|
|
177
200
|
/**
|
|
@@ -259,7 +282,7 @@ function formatArgsSection(args, opts) {
|
|
|
259
282
|
* @returns Multi-line flags section string.
|
|
260
283
|
*/
|
|
261
284
|
function formatFlagsSection(flags, opts) {
|
|
262
|
-
return formatFlagEntriesBlock(opts.theme.sectionTitle("Flags:"), buildFlagEntries(flags, opts
|
|
285
|
+
return formatFlagEntriesBlock(opts.theme.sectionTitle("Flags:"), buildFlagEntries(flags, opts), opts.width);
|
|
263
286
|
}
|
|
264
287
|
/**
|
|
265
288
|
* Render a titled two-column flag block from pre-built {@link FlagEntry} rows.
|
|
@@ -322,19 +345,46 @@ function formatCommandsSection(commands, opts) {
|
|
|
322
345
|
return lines.join("\n");
|
|
323
346
|
}
|
|
324
347
|
/**
|
|
348
|
+
* One shell token: a single- or double-quoted span (kept whole so internal
|
|
349
|
+
* spaces don't split it) or a run of non-whitespace characters.
|
|
350
|
+
*/
|
|
351
|
+
const EXAMPLE_TOKEN = /(?:'[^']*'|"[^"]*"|\S)+/g;
|
|
352
|
+
/**
|
|
353
|
+
* Highlight an example command per token: the leading binary via `usageBin`,
|
|
354
|
+
* flag tokens (`-x`, `--long`) via `flag`, everything else plain.
|
|
355
|
+
*
|
|
356
|
+
* Uses `replace` so only the token spans are wrapped and the whitespace
|
|
357
|
+
* between them is preserved verbatim — with the color gate off (identity
|
|
358
|
+
* formatters) the result equals `command`, so `stripAnsi(highlighted)` stays
|
|
359
|
+
* equal to the plain rendering.
|
|
360
|
+
*/
|
|
361
|
+
function highlightExampleCommand(command, theme) {
|
|
362
|
+
let index = 0;
|
|
363
|
+
return command.replace(EXAMPLE_TOKEN, (token) => {
|
|
364
|
+
const styled = index === 0 ? theme.usageBin(token) : token.startsWith("-") ? theme.flag(token) : token;
|
|
365
|
+
index += 1;
|
|
366
|
+
return styled;
|
|
367
|
+
});
|
|
368
|
+
}
|
|
369
|
+
/**
|
|
325
370
|
* Render the `Examples:` help section.
|
|
326
371
|
*
|
|
327
372
|
* @param examples - Array of {@link CommandExample} entries.
|
|
328
|
-
* @param theme - Theme applied to the section title
|
|
373
|
+
* @param theme - Theme applied to the section title, `$` prompt marker, and
|
|
374
|
+
* per-token command highlighting.
|
|
375
|
+
* @param meta - Program name/version passed to function-form example commands.
|
|
329
376
|
* @returns Multi-line examples section string.
|
|
330
377
|
*/
|
|
331
|
-
function formatExamplesSection(examples, theme) {
|
|
378
|
+
function formatExamplesSection(examples, theme, meta) {
|
|
332
379
|
const lines = [theme.sectionTitle("Examples:")];
|
|
333
380
|
const prompt = theme.examplePrompt("$");
|
|
334
|
-
for (const example of examples)
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
381
|
+
for (const example of examples) {
|
|
382
|
+
const command = highlightExampleCommand(resolveExampleCommand(example.command, meta), theme);
|
|
383
|
+
if (example.description !== void 0) {
|
|
384
|
+
lines.push(` ${example.description}:`);
|
|
385
|
+
lines.push(` ${prompt} ${command}`);
|
|
386
|
+
} else lines.push(` ${prompt} ${command}`);
|
|
387
|
+
}
|
|
338
388
|
return lines.join("\n");
|
|
339
389
|
}
|
|
340
390
|
//#endregion
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { CommandSchema } from "../schema/command.mjs";
|
|
1
|
+
import { CommandSchema, ExampleMeta } from "../schema/command.mjs";
|
|
2
2
|
import "../schema/index.mjs";
|
|
3
3
|
import { CLISchema } from "../cli/index.mjs";
|
|
4
4
|
//#region src/core/json-schema/index.d.ts
|
|
@@ -43,6 +43,8 @@ interface JsonSchemaOptions {
|
|
|
43
43
|
*
|
|
44
44
|
* @param schema - The CLI schema from `CLIBuilder.schema`.
|
|
45
45
|
* @param options - Generation options.
|
|
46
|
+
* @param meta - Program name/version for function-form examples; defaults to
|
|
47
|
+
* the CLI schema's own `name`/`version`.
|
|
46
48
|
* @returns A plain object suitable for `JSON.stringify()`.
|
|
47
49
|
*
|
|
48
50
|
* @example
|
|
@@ -52,7 +54,7 @@ interface JsonSchemaOptions {
|
|
|
52
54
|
* writeFileSync('cli-schema.json', JSON.stringify(definition, null, 2));
|
|
53
55
|
* ```
|
|
54
56
|
*/
|
|
55
|
-
declare function generateSchema(schema: CLISchema, options?: JsonSchemaOptions): Record<string, unknown>;
|
|
57
|
+
declare function generateSchema(schema: CLISchema, options?: JsonSchemaOptions, meta?: ExampleMeta): Record<string, unknown>;
|
|
56
58
|
/**
|
|
57
59
|
* Generate the definition metadata document for a single command.
|
|
58
60
|
*
|
|
@@ -63,9 +65,11 @@ declare function generateSchema(schema: CLISchema, options?: JsonSchemaOptions):
|
|
|
63
65
|
*
|
|
64
66
|
* @param schema - The command schema to serialize.
|
|
65
67
|
* @param options - Generation options.
|
|
68
|
+
* @param meta - Program name/version for function-form examples; defaults to
|
|
69
|
+
* the command's own name with no version.
|
|
66
70
|
* @returns A plain object suitable for `JSON.stringify()`.
|
|
67
71
|
*/
|
|
68
|
-
declare function generateCommandSchema(schema: CommandSchema, options?: JsonSchemaOptions): Record<string, unknown>;
|
|
72
|
+
declare function generateCommandSchema(schema: CommandSchema, options?: JsonSchemaOptions, meta?: ExampleMeta): Record<string, unknown>;
|
|
69
73
|
/**
|
|
70
74
|
* Generate a JSON Schema (draft 2020-12) for validating CLI input as JSON.
|
|
71
75
|
*
|
|
@@ -98,11 +102,6 @@ declare function generateInputSchema(schema: CLISchema | CommandSchema, options?
|
|
|
98
102
|
/**
|
|
99
103
|
* JSON Schema (draft 2020-12) that validates the output of {@link generateSchema}.
|
|
100
104
|
*
|
|
101
|
-
* Each `$defs` entry is defined once as a schema DSL string — the DSL
|
|
102
|
-
* parser produces a runtime AST, and {@link nodeToJsonSchema} converts
|
|
103
|
-
* that AST to a JSON Schema fragment. No probe fixtures, no override
|
|
104
|
-
* maps, no manually maintained type definitions.
|
|
105
|
-
*
|
|
106
105
|
* Hosted at {@link DEFINITION_SCHEMA_URL} for `$schema` resolution. Also
|
|
107
106
|
* exported so tooling can validate definition documents without a network
|
|
108
107
|
* round-trip.
|