@kjanat/dreamcli 3.0.0-rc.2 → 3.0.0-rc.20
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +374 -1
- package/README.md +3 -3
- package/dist/core/cli/dispatch.d.mts +6 -5
- package/dist/core/cli/dispatch.mjs +7 -16
- package/dist/core/cli/help-links.d.mts +0 -1
- package/dist/core/cli/index.d.mts +213 -16
- package/dist/core/cli/index.mjs +174 -43
- package/dist/core/cli/planner.d.mts +5 -1
- package/dist/core/cli/planner.mjs +19 -13
- package/dist/core/cli/plugin.d.mts +1 -1
- package/dist/core/cli/propagate.d.mts +1 -1
- package/dist/core/cli/root-help.d.mts +2 -1
- package/dist/core/cli/root-help.mjs +45 -22
- package/dist/core/cli/root-surface.d.mts +12 -1
- package/dist/core/cli/root-surface.mjs +2 -1
- package/dist/core/cli/runtime-preflight.d.mts +18 -2
- package/dist/core/cli/runtime-preflight.mjs +10 -7
- package/dist/core/completion/index.d.mts +0 -1
- package/dist/core/completion/index.mjs +1 -1
- package/dist/core/completion/shells/bash.d.mts +0 -1
- package/dist/core/completion/shells/bash.mjs +8 -4
- package/dist/core/completion/shells/fish.d.mts +0 -1
- package/dist/core/completion/shells/fish.mjs +6 -3
- package/dist/core/completion/shells/powershell.d.mts +0 -1
- package/dist/core/completion/shells/powershell.mjs +10 -5
- package/dist/core/completion/shells/shared.d.mts +13 -2
- package/dist/core/completion/shells/shared.mjs +25 -2
- package/dist/core/completion/shells/zsh.d.mts +0 -1
- package/dist/core/completion/shells/zsh.mjs +11 -4
- package/dist/core/config/index.d.mts +44 -14
- package/dist/core/config/index.mjs +57 -18
- package/dist/core/config/package-json.d.mts +28 -4
- package/dist/core/config/package-json.mjs +20 -19
- package/dist/core/errors/index.d.mts +3 -3
- package/dist/core/execution/index.d.mts +0 -1
- package/dist/core/execution/index.mjs +20 -4
- package/dist/core/help/ansi.d.mts +11 -5
- package/dist/core/help/ansi.mjs +15 -16
- package/dist/core/help/index.d.mts +44 -3
- package/dist/core/help/index.mjs +130 -68
- package/dist/core/help/theme.d.mts +68 -0
- package/dist/core/help/theme.mjs +46 -0
- package/dist/core/json-schema/index.d.mts +21 -9
- package/dist/core/json-schema/index.mjs +316 -87
- package/dist/core/json-schema/meta-descriptions.generated.d.mts +55 -38
- package/dist/core/json-schema/meta-descriptions.generated.mjs +14 -5
- package/dist/core/output/activity.d.mts +0 -1
- package/dist/core/output/contracts.d.mts +5 -6
- package/dist/core/output/contracts.mjs +2 -2
- package/dist/core/output/index.d.mts +38 -2
- package/dist/core/output/index.mjs +37 -2
- package/dist/core/output/renderers.d.mts +0 -1
- package/dist/core/parse/index.d.mts +40 -7
- package/dist/core/parse/index.mjs +212 -40
- package/dist/core/prompt/index.d.mts +1 -0
- package/dist/core/resolve/args.d.mts +1 -1
- package/dist/core/resolve/coerce.d.mts +1 -1
- package/dist/core/resolve/coerce.mjs +71 -14
- package/dist/core/resolve/contracts.d.mts +14 -4
- package/dist/core/resolve/errors.d.mts +0 -1
- package/dist/core/resolve/flags.d.mts +9 -2
- package/dist/core/resolve/flags.mjs +78 -6
- package/dist/core/resolve/index.d.mts +2 -2
- package/dist/core/resolve/index.mjs +6 -1
- package/dist/core/resolve/property.d.mts +4 -1
- package/dist/core/resolve/property.mjs +11 -3
- package/dist/core/resolve/standard.d.mts +24 -0
- package/dist/core/resolve/standard.mjs +114 -0
- package/dist/core/schema/activity.d.mts +31 -11
- package/dist/core/schema/arg.d.mts +38 -4
- package/dist/core/schema/arg.mjs +5 -2
- package/dist/core/schema/command.d.mts +57 -13
- package/dist/core/schema/command.mjs +41 -17
- package/dist/core/schema/flag.d.mts +553 -19
- package/dist/core/schema/flag.mjs +261 -5
- package/dist/core/schema/index.d.mts +6 -3
- package/dist/core/schema/middleware.d.mts +4 -3
- package/dist/core/schema/prompt.d.mts +6 -3
- package/dist/core/schema/run.d.mts +27 -1
- package/dist/core/schema/standard.d.mts +100 -0
- package/dist/core/schema/standard.mjs +15 -0
- package/dist/core/schema/string-constraints.d.mts +97 -0
- package/dist/core/schema/string-constraints.mjs +69 -0
- package/dist/core/schema/value-parsers.d.mts +78 -0
- package/dist/core/schema/value-parsers.mjs +142 -0
- package/dist/core/testkit/index.d.mts +0 -31
- package/dist/core/testkit/index.mjs +1 -1
- package/dist/index.d.mts +12 -7
- package/dist/index.mjs +9 -9
- package/dist/runtime/adapter.d.mts +71 -2
- package/dist/runtime/adapter.mjs +11 -1
- package/dist/runtime/auto.d.mts +2 -3
- package/dist/runtime/auto.mjs +4 -5
- package/dist/runtime/deno.d.mts +28 -5
- package/dist/runtime/deno.mjs +49 -1
- package/dist/runtime/index.d.mts +3 -4
- package/dist/runtime/node.d.mts +8 -2
- package/dist/runtime/node.mjs +60 -1
- package/dist/runtime.d.mts +4 -4
- package/dist/runtime.mjs +2 -3
- package/dist/testkit.d.mts +1 -0
- package/dist/version.d.mts +7 -3
- package/dist/version.mjs +2 -2
- package/dreamcli.schema.json +118 -7
- package/examples/gh/node_modules/typescript/LICENSE +55 -0
- package/examples/gh/node_modules/typescript/NOTICE.txt +436 -0
- package/examples/gh/node_modules/typescript/README.md +49 -0
- package/examples/gh/node_modules/typescript/bin/tsc +2 -0
- package/examples/gh/node_modules/typescript/dist/api/async/api.d.ts +529 -0
- package/examples/gh/node_modules/typescript/dist/api/async/api.d.ts.map +1 -0
- package/examples/gh/node_modules/typescript/dist/api/async/api.js +1657 -0
- package/examples/gh/node_modules/typescript/dist/api/async/api.js.map +1 -0
- package/examples/gh/node_modules/typescript/dist/api/async/client.d.ts +39 -0
- package/examples/gh/node_modules/typescript/dist/api/async/client.d.ts.map +1 -0
- package/examples/gh/node_modules/typescript/dist/api/async/client.js +211 -0
- package/examples/gh/node_modules/typescript/dist/api/async/client.js.map +1 -0
- package/examples/gh/node_modules/typescript/dist/api/async/types.d.ts +310 -0
- package/examples/gh/node_modules/typescript/dist/api/async/types.d.ts.map +1 -0
- package/examples/gh/node_modules/typescript/dist/api/async/types.js +2 -0
- package/examples/gh/node_modules/typescript/dist/api/async/types.js.map +1 -0
- package/examples/gh/node_modules/typescript/dist/api/compilerOptions.d.ts +109 -0
- package/examples/gh/node_modules/typescript/dist/api/compilerOptions.d.ts.map +1 -0
- package/examples/gh/node_modules/typescript/dist/api/compilerOptions.js +2 -0
- package/examples/gh/node_modules/typescript/dist/api/compilerOptions.js.map +1 -0
- package/examples/gh/node_modules/typescript/dist/api/fs.d.ts +23 -0
- package/examples/gh/node_modules/typescript/dist/api/fs.d.ts.map +1 -0
- package/examples/gh/node_modules/typescript/dist/api/fs.js +109 -0
- package/examples/gh/node_modules/typescript/dist/api/fs.js.map +1 -0
- package/examples/gh/node_modules/typescript/dist/api/node/encoder.d.ts +15 -0
- package/examples/gh/node_modules/typescript/dist/api/node/encoder.d.ts.map +1 -0
- package/examples/gh/node_modules/typescript/dist/api/node/encoder.generated.d.ts +5 -0
- package/examples/gh/node_modules/typescript/dist/api/node/encoder.generated.d.ts.map +1 -0
- package/examples/gh/node_modules/typescript/dist/api/node/encoder.generated.js +74 -0
- package/examples/gh/node_modules/typescript/dist/api/node/encoder.generated.js.map +1 -0
- package/examples/gh/node_modules/typescript/dist/api/node/encoder.js +287 -0
- package/examples/gh/node_modules/typescript/dist/api/node/encoder.js.map +1 -0
- package/examples/gh/node_modules/typescript/dist/api/node/msgpack.d.ts +32 -0
- package/examples/gh/node_modules/typescript/dist/api/node/msgpack.d.ts.map +1 -0
- package/examples/gh/node_modules/typescript/dist/api/node/msgpack.js +213 -0
- package/examples/gh/node_modules/typescript/dist/api/node/msgpack.js.map +1 -0
- package/examples/gh/node_modules/typescript/dist/api/node/node.d.ts +76 -0
- package/examples/gh/node_modules/typescript/dist/api/node/node.d.ts.map +1 -0
- package/examples/gh/node_modules/typescript/dist/api/node/node.generated.d.ts +182 -0
- package/examples/gh/node_modules/typescript/dist/api/node/node.generated.d.ts.map +1 -0
- package/examples/gh/node_modules/typescript/dist/api/node/node.generated.js +835 -0
- package/examples/gh/node_modules/typescript/dist/api/node/node.generated.js.map +1 -0
- package/examples/gh/node_modules/typescript/dist/api/node/node.infrastructure.d.ts +62 -0
- package/examples/gh/node_modules/typescript/dist/api/node/node.infrastructure.d.ts.map +1 -0
- package/examples/gh/node_modules/typescript/dist/api/node/node.infrastructure.js +122 -0
- package/examples/gh/node_modules/typescript/dist/api/node/node.infrastructure.js.map +1 -0
- package/examples/gh/node_modules/typescript/dist/api/node/node.js +298 -0
- package/examples/gh/node_modules/typescript/dist/api/node/node.js.map +1 -0
- package/examples/gh/node_modules/typescript/dist/api/node/protocol.d.ts +29 -0
- package/examples/gh/node_modules/typescript/dist/api/node/protocol.d.ts.map +1 -0
- package/examples/gh/node_modules/typescript/dist/api/node/protocol.generated.d.ts +4 -0
- package/examples/gh/node_modules/typescript/dist/api/node/protocol.generated.d.ts.map +1 -0
- package/examples/gh/node_modules/typescript/dist/api/node/protocol.generated.js +241 -0
- package/examples/gh/node_modules/typescript/dist/api/node/protocol.generated.js.map +1 -0
- package/examples/gh/node_modules/typescript/dist/api/node/protocol.js +30 -0
- package/examples/gh/node_modules/typescript/dist/api/node/protocol.js.map +1 -0
- package/examples/gh/node_modules/typescript/dist/api/node/wtf8.d.ts +6 -0
- package/examples/gh/node_modules/typescript/dist/api/node/wtf8.d.ts.map +1 -0
- package/examples/gh/node_modules/typescript/dist/api/node/wtf8.js +61 -0
- package/examples/gh/node_modules/typescript/dist/api/node/wtf8.js.map +1 -0
- package/examples/gh/node_modules/typescript/dist/api/options.d.ts +32 -0
- package/examples/gh/node_modules/typescript/dist/api/options.d.ts.map +1 -0
- package/examples/gh/node_modules/typescript/dist/api/options.js +11 -0
- package/examples/gh/node_modules/typescript/dist/api/options.js.map +1 -0
- package/examples/gh/node_modules/typescript/dist/api/path.d.ts +110 -0
- package/examples/gh/node_modules/typescript/dist/api/path.d.ts.map +1 -0
- package/examples/gh/node_modules/typescript/dist/api/path.js +508 -0
- package/examples/gh/node_modules/typescript/dist/api/path.js.map +1 -0
- package/examples/gh/node_modules/typescript/dist/api/proto.d.ts +239 -0
- package/examples/gh/node_modules/typescript/dist/api/proto.d.ts.map +1 -0
- package/examples/gh/node_modules/typescript/dist/api/proto.js +37 -0
- package/examples/gh/node_modules/typescript/dist/api/proto.js.map +1 -0
- package/examples/gh/node_modules/typescript/dist/api/sourceFileCache.d.ts +79 -0
- package/examples/gh/node_modules/typescript/dist/api/sourceFileCache.d.ts.map +1 -0
- package/examples/gh/node_modules/typescript/dist/api/sourceFileCache.js +169 -0
- package/examples/gh/node_modules/typescript/dist/api/sourceFileCache.js.map +1 -0
- package/examples/gh/node_modules/typescript/dist/api/sync/api.d.ts +529 -0
- package/examples/gh/node_modules/typescript/dist/api/sync/api.d.ts.map +1 -0
- package/examples/gh/node_modules/typescript/dist/api/sync/api.js +1665 -0
- package/examples/gh/node_modules/typescript/dist/api/sync/api.js.map +1 -0
- package/examples/gh/node_modules/typescript/dist/api/sync/client.d.ts +30 -0
- package/examples/gh/node_modules/typescript/dist/api/sync/client.d.ts.map +1 -0
- package/examples/gh/node_modules/typescript/dist/api/sync/client.js +124 -0
- package/examples/gh/node_modules/typescript/dist/api/sync/client.js.map +1 -0
- package/examples/gh/node_modules/typescript/dist/api/sync/types.d.ts +310 -0
- package/examples/gh/node_modules/typescript/dist/api/sync/types.d.ts.map +1 -0
- package/examples/gh/node_modules/typescript/dist/api/sync/types.js +2 -0
- package/examples/gh/node_modules/typescript/dist/api/sync/types.js.map +1 -0
- package/examples/gh/node_modules/typescript/dist/api/syncChannel.d.ts +114 -0
- package/examples/gh/node_modules/typescript/dist/api/syncChannel.d.ts.map +1 -0
- package/examples/gh/node_modules/typescript/dist/api/syncChannel.js +508 -0
- package/examples/gh/node_modules/typescript/dist/api/syncChannel.js.map +1 -0
- package/examples/gh/node_modules/typescript/dist/api/timing.d.ts +175 -0
- package/examples/gh/node_modules/typescript/dist/api/timing.d.ts.map +1 -0
- package/examples/gh/node_modules/typescript/dist/api/timing.js +149 -0
- package/examples/gh/node_modules/typescript/dist/api/timing.js.map +1 -0
- package/examples/gh/node_modules/typescript/dist/ast/ast.d.ts +100 -0
- package/examples/gh/node_modules/typescript/dist/ast/ast.d.ts.map +1 -0
- package/examples/gh/node_modules/typescript/dist/ast/ast.generated.d.ts +1161 -0
- package/examples/gh/node_modules/typescript/dist/ast/ast.generated.d.ts.map +1 -0
- package/examples/gh/node_modules/typescript/dist/ast/ast.generated.js +4 -0
- package/examples/gh/node_modules/typescript/dist/ast/ast.generated.js.map +1 -0
- package/examples/gh/node_modules/typescript/dist/ast/ast.js +7 -0
- package/examples/gh/node_modules/typescript/dist/ast/ast.js.map +1 -0
- package/examples/gh/node_modules/typescript/dist/ast/astnav.d.ts +19 -0
- package/examples/gh/node_modules/typescript/dist/ast/astnav.d.ts.map +1 -0
- package/examples/gh/node_modules/typescript/dist/ast/astnav.js +596 -0
- package/examples/gh/node_modules/typescript/dist/ast/astnav.js.map +1 -0
- package/examples/gh/node_modules/typescript/dist/ast/clone.d.ts +16 -0
- package/examples/gh/node_modules/typescript/dist/ast/clone.d.ts.map +1 -0
- package/examples/gh/node_modules/typescript/dist/ast/clone.js +104 -0
- package/examples/gh/node_modules/typescript/dist/ast/clone.js.map +1 -0
- package/examples/gh/node_modules/typescript/dist/ast/factory.generated.d.ts +520 -0
- package/examples/gh/node_modules/typescript/dist/ast/factory.generated.d.ts.map +1 -0
- package/examples/gh/node_modules/typescript/dist/ast/factory.generated.js +3057 -0
- package/examples/gh/node_modules/typescript/dist/ast/factory.generated.js.map +1 -0
- package/examples/gh/node_modules/typescript/dist/ast/index.d.ts +20 -0
- package/examples/gh/node_modules/typescript/dist/ast/index.d.ts.map +1 -0
- package/examples/gh/node_modules/typescript/dist/ast/index.js +20 -0
- package/examples/gh/node_modules/typescript/dist/ast/index.js.map +1 -0
- package/examples/gh/node_modules/typescript/dist/ast/is.d.ts +35 -0
- package/examples/gh/node_modules/typescript/dist/ast/is.d.ts.map +1 -0
- package/examples/gh/node_modules/typescript/dist/ast/is.generated.d.ts +329 -0
- package/examples/gh/node_modules/typescript/dist/ast/is.generated.d.ts.map +1 -0
- package/examples/gh/node_modules/typescript/dist/ast/is.generated.js +1103 -0
- package/examples/gh/node_modules/typescript/dist/ast/is.generated.js.map +1 -0
- package/examples/gh/node_modules/typescript/dist/ast/is.js +233 -0
- package/examples/gh/node_modules/typescript/dist/ast/is.js.map +1 -0
- package/examples/gh/node_modules/typescript/dist/ast/jsdoc.d.ts +11 -0
- package/examples/gh/node_modules/typescript/dist/ast/jsdoc.d.ts.map +1 -0
- package/examples/gh/node_modules/typescript/dist/ast/jsdoc.js +202 -0
- package/examples/gh/node_modules/typescript/dist/ast/jsdoc.js.map +1 -0
- package/examples/gh/node_modules/typescript/dist/ast/scanner.d.ts +97 -0
- package/examples/gh/node_modules/typescript/dist/ast/scanner.d.ts.map +1 -0
- package/examples/gh/node_modules/typescript/dist/ast/scanner.js +2230 -0
- package/examples/gh/node_modules/typescript/dist/ast/scanner.js.map +1 -0
- package/examples/gh/node_modules/typescript/dist/ast/utils.d.ts +17 -0
- package/examples/gh/node_modules/typescript/dist/ast/utils.d.ts.map +1 -0
- package/examples/gh/node_modules/typescript/dist/ast/utils.js +67 -0
- package/examples/gh/node_modules/typescript/dist/ast/utils.js.map +1 -0
- package/examples/gh/node_modules/typescript/dist/ast/visitor.d.ts +14 -0
- package/examples/gh/node_modules/typescript/dist/ast/visitor.d.ts.map +1 -0
- package/examples/gh/node_modules/typescript/dist/ast/visitor.generated.d.ts +50 -0
- package/examples/gh/node_modules/typescript/dist/ast/visitor.generated.d.ts.map +1 -0
- package/examples/gh/node_modules/typescript/dist/ast/visitor.generated.js +978 -0
- package/examples/gh/node_modules/typescript/dist/ast/visitor.generated.js.map +1 -0
- package/examples/gh/node_modules/typescript/dist/ast/visitor.js +47 -0
- package/examples/gh/node_modules/typescript/dist/ast/visitor.js.map +1 -0
- package/examples/gh/node_modules/typescript/dist/enums/characterCodes.d.ts +2 -0
- package/examples/gh/node_modules/typescript/dist/enums/characterCodes.d.ts.map +1 -0
- package/examples/gh/node_modules/typescript/dist/enums/characterCodes.enum.d.ts +129 -0
- package/examples/gh/node_modules/typescript/dist/enums/characterCodes.enum.d.ts.map +1 -0
- package/examples/gh/node_modules/typescript/dist/enums/characterCodes.enum.js +132 -0
- package/examples/gh/node_modules/typescript/dist/enums/characterCodes.enum.js.map +1 -0
- package/examples/gh/node_modules/typescript/dist/enums/characterCodes.js +130 -0
- package/examples/gh/node_modules/typescript/dist/enums/characterCodes.js.map +1 -0
- package/examples/gh/node_modules/typescript/dist/enums/commentDirectiveType.d.ts +2 -0
- package/examples/gh/node_modules/typescript/dist/enums/commentDirectiveType.d.ts.map +1 -0
- package/examples/gh/node_modules/typescript/dist/enums/commentDirectiveType.enum.d.ts +5 -0
- package/examples/gh/node_modules/typescript/dist/enums/commentDirectiveType.enum.d.ts.map +1 -0
- package/examples/gh/node_modules/typescript/dist/enums/commentDirectiveType.enum.js +6 -0
- package/examples/gh/node_modules/typescript/dist/enums/commentDirectiveType.enum.js.map +1 -0
- package/examples/gh/node_modules/typescript/dist/enums/commentDirectiveType.js +6 -0
- package/examples/gh/node_modules/typescript/dist/enums/commentDirectiveType.js.map +1 -0
- package/examples/gh/node_modules/typescript/dist/enums/completionItemKind.d.ts +2 -0
- package/examples/gh/node_modules/typescript/dist/enums/completionItemKind.d.ts.map +1 -0
- package/examples/gh/node_modules/typescript/dist/enums/completionItemKind.enum.d.ts +28 -0
- package/examples/gh/node_modules/typescript/dist/enums/completionItemKind.enum.d.ts.map +1 -0
- package/examples/gh/node_modules/typescript/dist/enums/completionItemKind.enum.js +30 -0
- package/examples/gh/node_modules/typescript/dist/enums/completionItemKind.enum.js.map +1 -0
- package/examples/gh/node_modules/typescript/dist/enums/completionItemKind.js +30 -0
- package/examples/gh/node_modules/typescript/dist/enums/completionItemKind.js.map +1 -0
- package/examples/gh/node_modules/typescript/dist/enums/diagnosticCategory.d.ts +2 -0
- package/examples/gh/node_modules/typescript/dist/enums/diagnosticCategory.d.ts.map +1 -0
- package/examples/gh/node_modules/typescript/dist/enums/diagnosticCategory.enum.d.ts +7 -0
- package/examples/gh/node_modules/typescript/dist/enums/diagnosticCategory.enum.d.ts.map +1 -0
- package/examples/gh/node_modules/typescript/dist/enums/diagnosticCategory.enum.js +9 -0
- package/examples/gh/node_modules/typescript/dist/enums/diagnosticCategory.enum.js.map +1 -0
- package/examples/gh/node_modules/typescript/dist/enums/diagnosticCategory.js +9 -0
- package/examples/gh/node_modules/typescript/dist/enums/diagnosticCategory.js.map +1 -0
- package/examples/gh/node_modules/typescript/dist/enums/elementFlags.d.ts +2 -0
- package/examples/gh/node_modules/typescript/dist/enums/elementFlags.d.ts.map +1 -0
- package/examples/gh/node_modules/typescript/dist/enums/elementFlags.enum.d.ts +12 -0
- package/examples/gh/node_modules/typescript/dist/enums/elementFlags.enum.d.ts.map +1 -0
- package/examples/gh/node_modules/typescript/dist/enums/elementFlags.enum.js +14 -0
- package/examples/gh/node_modules/typescript/dist/enums/elementFlags.enum.js.map +1 -0
- package/examples/gh/node_modules/typescript/dist/enums/elementFlags.js +14 -0
- package/examples/gh/node_modules/typescript/dist/enums/elementFlags.js.map +1 -0
- package/examples/gh/node_modules/typescript/dist/enums/internalSymbolName.d.ts +2 -0
- package/examples/gh/node_modules/typescript/dist/enums/internalSymbolName.d.ts.map +1 -0
- package/examples/gh/node_modules/typescript/dist/enums/internalSymbolName.enum.d.ts +23 -0
- package/examples/gh/node_modules/typescript/dist/enums/internalSymbolName.enum.d.ts.map +1 -0
- package/examples/gh/node_modules/typescript/dist/enums/internalSymbolName.enum.js +25 -0
- package/examples/gh/node_modules/typescript/dist/enums/internalSymbolName.enum.js.map +1 -0
- package/examples/gh/node_modules/typescript/dist/enums/internalSymbolName.js +25 -0
- package/examples/gh/node_modules/typescript/dist/enums/internalSymbolName.js.map +1 -0
- package/examples/gh/node_modules/typescript/dist/enums/jsxEmit.d.ts +2 -0
- package/examples/gh/node_modules/typescript/dist/enums/jsxEmit.d.ts.map +1 -0
- package/examples/gh/node_modules/typescript/dist/enums/jsxEmit.enum.d.ts +9 -0
- package/examples/gh/node_modules/typescript/dist/enums/jsxEmit.enum.d.ts.map +1 -0
- package/examples/gh/node_modules/typescript/dist/enums/jsxEmit.enum.js +11 -0
- package/examples/gh/node_modules/typescript/dist/enums/jsxEmit.enum.js.map +1 -0
- package/examples/gh/node_modules/typescript/dist/enums/jsxEmit.js +11 -0
- package/examples/gh/node_modules/typescript/dist/enums/jsxEmit.js.map +1 -0
- package/examples/gh/node_modules/typescript/dist/enums/languageVariant.d.ts +2 -0
- package/examples/gh/node_modules/typescript/dist/enums/languageVariant.d.ts.map +1 -0
- package/examples/gh/node_modules/typescript/dist/enums/languageVariant.enum.d.ts +5 -0
- package/examples/gh/node_modules/typescript/dist/enums/languageVariant.enum.d.ts.map +1 -0
- package/examples/gh/node_modules/typescript/dist/enums/languageVariant.enum.js +6 -0
- package/examples/gh/node_modules/typescript/dist/enums/languageVariant.enum.js.map +1 -0
- package/examples/gh/node_modules/typescript/dist/enums/languageVariant.js +6 -0
- package/examples/gh/node_modules/typescript/dist/enums/languageVariant.js.map +1 -0
- package/examples/gh/node_modules/typescript/dist/enums/modifierFlags.d.ts +2 -0
- package/examples/gh/node_modules/typescript/dist/enums/modifierFlags.d.ts.map +1 -0
- package/examples/gh/node_modules/typescript/dist/enums/modifierFlags.enum.d.ts +42 -0
- package/examples/gh/node_modules/typescript/dist/enums/modifierFlags.enum.d.ts.map +1 -0
- package/examples/gh/node_modules/typescript/dist/enums/modifierFlags.enum.js +44 -0
- package/examples/gh/node_modules/typescript/dist/enums/modifierFlags.enum.js.map +1 -0
- package/examples/gh/node_modules/typescript/dist/enums/modifierFlags.js +44 -0
- package/examples/gh/node_modules/typescript/dist/enums/modifierFlags.js.map +1 -0
- package/examples/gh/node_modules/typescript/dist/enums/moduleDetectionKind.d.ts +2 -0
- package/examples/gh/node_modules/typescript/dist/enums/moduleDetectionKind.d.ts.map +1 -0
- package/examples/gh/node_modules/typescript/dist/enums/moduleDetectionKind.enum.d.ts +7 -0
- package/examples/gh/node_modules/typescript/dist/enums/moduleDetectionKind.enum.d.ts.map +1 -0
- package/examples/gh/node_modules/typescript/dist/enums/moduleDetectionKind.enum.js +9 -0
- package/examples/gh/node_modules/typescript/dist/enums/moduleDetectionKind.enum.js.map +1 -0
- package/examples/gh/node_modules/typescript/dist/enums/moduleDetectionKind.js +9 -0
- package/examples/gh/node_modules/typescript/dist/enums/moduleDetectionKind.js.map +1 -0
- package/examples/gh/node_modules/typescript/dist/enums/moduleKind.d.ts +2 -0
- package/examples/gh/node_modules/typescript/dist/enums/moduleKind.d.ts.map +1 -0
- package/examples/gh/node_modules/typescript/dist/enums/moduleKind.enum.d.ts +17 -0
- package/examples/gh/node_modules/typescript/dist/enums/moduleKind.enum.d.ts.map +1 -0
- package/examples/gh/node_modules/typescript/dist/enums/moduleKind.enum.js +19 -0
- package/examples/gh/node_modules/typescript/dist/enums/moduleKind.enum.js.map +1 -0
- package/examples/gh/node_modules/typescript/dist/enums/moduleKind.js +19 -0
- package/examples/gh/node_modules/typescript/dist/enums/moduleKind.js.map +1 -0
- package/examples/gh/node_modules/typescript/dist/enums/moduleResolutionKind.d.ts +2 -0
- package/examples/gh/node_modules/typescript/dist/enums/moduleResolutionKind.d.ts.map +1 -0
- package/examples/gh/node_modules/typescript/dist/enums/moduleResolutionKind.enum.d.ts +9 -0
- package/examples/gh/node_modules/typescript/dist/enums/moduleResolutionKind.enum.d.ts.map +1 -0
- package/examples/gh/node_modules/typescript/dist/enums/moduleResolutionKind.enum.js +11 -0
- package/examples/gh/node_modules/typescript/dist/enums/moduleResolutionKind.enum.js.map +1 -0
- package/examples/gh/node_modules/typescript/dist/enums/moduleResolutionKind.js +11 -0
- package/examples/gh/node_modules/typescript/dist/enums/moduleResolutionKind.js.map +1 -0
- package/examples/gh/node_modules/typescript/dist/enums/newLineKind.d.ts +2 -0
- package/examples/gh/node_modules/typescript/dist/enums/newLineKind.d.ts.map +1 -0
- package/examples/gh/node_modules/typescript/dist/enums/newLineKind.enum.d.ts +6 -0
- package/examples/gh/node_modules/typescript/dist/enums/newLineKind.enum.d.ts.map +1 -0
- package/examples/gh/node_modules/typescript/dist/enums/newLineKind.enum.js +8 -0
- package/examples/gh/node_modules/typescript/dist/enums/newLineKind.enum.js.map +1 -0
- package/examples/gh/node_modules/typescript/dist/enums/newLineKind.js +8 -0
- package/examples/gh/node_modules/typescript/dist/enums/newLineKind.js.map +1 -0
- package/examples/gh/node_modules/typescript/dist/enums/nodeBuilderFlags.d.ts +2 -0
- package/examples/gh/node_modules/typescript/dist/enums/nodeBuilderFlags.d.ts.map +1 -0
- package/examples/gh/node_modules/typescript/dist/enums/nodeBuilderFlags.enum.d.ts +36 -0
- package/examples/gh/node_modules/typescript/dist/enums/nodeBuilderFlags.enum.d.ts.map +1 -0
- package/examples/gh/node_modules/typescript/dist/enums/nodeBuilderFlags.enum.js +38 -0
- package/examples/gh/node_modules/typescript/dist/enums/nodeBuilderFlags.enum.js.map +1 -0
- package/examples/gh/node_modules/typescript/dist/enums/nodeBuilderFlags.js +38 -0
- package/examples/gh/node_modules/typescript/dist/enums/nodeBuilderFlags.js.map +1 -0
- package/examples/gh/node_modules/typescript/dist/enums/nodeFlags.d.ts +2 -0
- package/examples/gh/node_modules/typescript/dist/enums/nodeFlags.d.ts.map +1 -0
- package/examples/gh/node_modules/typescript/dist/enums/nodeFlags.enum.d.ts +44 -0
- package/examples/gh/node_modules/typescript/dist/enums/nodeFlags.enum.d.ts.map +1 -0
- package/examples/gh/node_modules/typescript/dist/enums/nodeFlags.enum.js +46 -0
- package/examples/gh/node_modules/typescript/dist/enums/nodeFlags.enum.js.map +1 -0
- package/examples/gh/node_modules/typescript/dist/enums/nodeFlags.js +46 -0
- package/examples/gh/node_modules/typescript/dist/enums/nodeFlags.js.map +1 -0
- package/examples/gh/node_modules/typescript/dist/enums/objectFlags.d.ts +2 -0
- package/examples/gh/node_modules/typescript/dist/enums/objectFlags.d.ts.map +1 -0
- package/examples/gh/node_modules/typescript/dist/enums/objectFlags.enum.d.ts +50 -0
- package/examples/gh/node_modules/typescript/dist/enums/objectFlags.enum.d.ts.map +1 -0
- package/examples/gh/node_modules/typescript/dist/enums/objectFlags.enum.js +52 -0
- package/examples/gh/node_modules/typescript/dist/enums/objectFlags.enum.js.map +1 -0
- package/examples/gh/node_modules/typescript/dist/enums/objectFlags.js +52 -0
- package/examples/gh/node_modules/typescript/dist/enums/objectFlags.js.map +1 -0
- package/examples/gh/node_modules/typescript/dist/enums/outerExpressionKinds.d.ts +2 -0
- package/examples/gh/node_modules/typescript/dist/enums/outerExpressionKinds.d.ts.map +1 -0
- package/examples/gh/node_modules/typescript/dist/enums/outerExpressionKinds.enum.d.ts +16 -0
- package/examples/gh/node_modules/typescript/dist/enums/outerExpressionKinds.enum.d.ts.map +1 -0
- package/examples/gh/node_modules/typescript/dist/enums/outerExpressionKinds.enum.js +18 -0
- package/examples/gh/node_modules/typescript/dist/enums/outerExpressionKinds.enum.js.map +1 -0
- package/examples/gh/node_modules/typescript/dist/enums/outerExpressionKinds.js +18 -0
- package/examples/gh/node_modules/typescript/dist/enums/outerExpressionKinds.js.map +1 -0
- package/examples/gh/node_modules/typescript/dist/enums/regularExpressionFlags.d.ts +2 -0
- package/examples/gh/node_modules/typescript/dist/enums/regularExpressionFlags.d.ts.map +1 -0
- package/examples/gh/node_modules/typescript/dist/enums/regularExpressionFlags.enum.d.ts +13 -0
- package/examples/gh/node_modules/typescript/dist/enums/regularExpressionFlags.enum.d.ts.map +1 -0
- package/examples/gh/node_modules/typescript/dist/enums/regularExpressionFlags.enum.js +14 -0
- package/examples/gh/node_modules/typescript/dist/enums/regularExpressionFlags.enum.js.map +1 -0
- package/examples/gh/node_modules/typescript/dist/enums/regularExpressionFlags.js +14 -0
- package/examples/gh/node_modules/typescript/dist/enums/regularExpressionFlags.js.map +1 -0
- package/examples/gh/node_modules/typescript/dist/enums/scriptKind.d.ts +2 -0
- package/examples/gh/node_modules/typescript/dist/enums/scriptKind.d.ts.map +1 -0
- package/examples/gh/node_modules/typescript/dist/enums/scriptKind.enum.d.ts +11 -0
- package/examples/gh/node_modules/typescript/dist/enums/scriptKind.enum.d.ts.map +1 -0
- package/examples/gh/node_modules/typescript/dist/enums/scriptKind.enum.js +12 -0
- package/examples/gh/node_modules/typescript/dist/enums/scriptKind.enum.js.map +1 -0
- package/examples/gh/node_modules/typescript/dist/enums/scriptKind.js +12 -0
- package/examples/gh/node_modules/typescript/dist/enums/scriptKind.js.map +1 -0
- package/examples/gh/node_modules/typescript/dist/enums/scriptTarget.d.ts +2 -0
- package/examples/gh/node_modules/typescript/dist/enums/scriptTarget.d.ts.map +1 -0
- package/examples/gh/node_modules/typescript/dist/enums/scriptTarget.enum.d.ts +17 -0
- package/examples/gh/node_modules/typescript/dist/enums/scriptTarget.enum.d.ts.map +1 -0
- package/examples/gh/node_modules/typescript/dist/enums/scriptTarget.enum.js +18 -0
- package/examples/gh/node_modules/typescript/dist/enums/scriptTarget.enum.js.map +1 -0
- package/examples/gh/node_modules/typescript/dist/enums/scriptTarget.js +18 -0
- package/examples/gh/node_modules/typescript/dist/enums/scriptTarget.js.map +1 -0
- package/examples/gh/node_modules/typescript/dist/enums/signatureFlags.d.ts +2 -0
- package/examples/gh/node_modules/typescript/dist/enums/signatureFlags.d.ts.map +1 -0
- package/examples/gh/node_modules/typescript/dist/enums/signatureFlags.enum.d.ts +15 -0
- package/examples/gh/node_modules/typescript/dist/enums/signatureFlags.enum.d.ts.map +1 -0
- package/examples/gh/node_modules/typescript/dist/enums/signatureFlags.enum.js +17 -0
- package/examples/gh/node_modules/typescript/dist/enums/signatureFlags.enum.js.map +1 -0
- package/examples/gh/node_modules/typescript/dist/enums/signatureFlags.js +17 -0
- package/examples/gh/node_modules/typescript/dist/enums/signatureFlags.js.map +1 -0
- package/examples/gh/node_modules/typescript/dist/enums/signatureKind.d.ts +2 -0
- package/examples/gh/node_modules/typescript/dist/enums/signatureKind.d.ts.map +1 -0
- package/examples/gh/node_modules/typescript/dist/enums/signatureKind.enum.d.ts +5 -0
- package/examples/gh/node_modules/typescript/dist/enums/signatureKind.enum.d.ts.map +1 -0
- package/examples/gh/node_modules/typescript/dist/enums/signatureKind.enum.js +7 -0
- package/examples/gh/node_modules/typescript/dist/enums/signatureKind.enum.js.map +1 -0
- package/examples/gh/node_modules/typescript/dist/enums/signatureKind.js +7 -0
- package/examples/gh/node_modules/typescript/dist/enums/signatureKind.js.map +1 -0
- package/examples/gh/node_modules/typescript/dist/enums/symbolFlags.d.ts +2 -0
- package/examples/gh/node_modules/typescript/dist/enums/symbolFlags.d.ts.map +1 -0
- package/examples/gh/node_modules/typescript/dist/enums/symbolFlags.enum.d.ts +71 -0
- package/examples/gh/node_modules/typescript/dist/enums/symbolFlags.enum.d.ts.map +1 -0
- package/examples/gh/node_modules/typescript/dist/enums/symbolFlags.enum.js +73 -0
- package/examples/gh/node_modules/typescript/dist/enums/symbolFlags.enum.js.map +1 -0
- package/examples/gh/node_modules/typescript/dist/enums/symbolFlags.js +73 -0
- package/examples/gh/node_modules/typescript/dist/enums/symbolFlags.js.map +1 -0
- package/examples/gh/node_modules/typescript/dist/enums/syntaxKind.d.ts +2 -0
- package/examples/gh/node_modules/typescript/dist/enums/syntaxKind.d.ts.map +1 -0
- package/examples/gh/node_modules/typescript/dist/enums/syntaxKind.enum.d.ts +389 -0
- package/examples/gh/node_modules/typescript/dist/enums/syntaxKind.enum.d.ts.map +1 -0
- package/examples/gh/node_modules/typescript/dist/enums/syntaxKind.enum.js +391 -0
- package/examples/gh/node_modules/typescript/dist/enums/syntaxKind.enum.js.map +1 -0
- package/examples/gh/node_modules/typescript/dist/enums/syntaxKind.js +391 -0
- package/examples/gh/node_modules/typescript/dist/enums/syntaxKind.js.map +1 -0
- package/examples/gh/node_modules/typescript/dist/enums/tokenFlags.d.ts +2 -0
- package/examples/gh/node_modules/typescript/dist/enums/tokenFlags.d.ts.map +1 -0
- package/examples/gh/node_modules/typescript/dist/enums/tokenFlags.enum.d.ts +30 -0
- package/examples/gh/node_modules/typescript/dist/enums/tokenFlags.enum.d.ts.map +1 -0
- package/examples/gh/node_modules/typescript/dist/enums/tokenFlags.enum.js +32 -0
- package/examples/gh/node_modules/typescript/dist/enums/tokenFlags.enum.js.map +1 -0
- package/examples/gh/node_modules/typescript/dist/enums/tokenFlags.js +32 -0
- package/examples/gh/node_modules/typescript/dist/enums/tokenFlags.js.map +1 -0
- package/examples/gh/node_modules/typescript/dist/enums/typeFlags.d.ts +2 -0
- package/examples/gh/node_modules/typescript/dist/enums/typeFlags.d.ts.map +1 -0
- package/examples/gh/node_modules/typescript/dist/enums/typeFlags.enum.d.ts +76 -0
- package/examples/gh/node_modules/typescript/dist/enums/typeFlags.enum.d.ts.map +1 -0
- package/examples/gh/node_modules/typescript/dist/enums/typeFlags.enum.js +78 -0
- package/examples/gh/node_modules/typescript/dist/enums/typeFlags.enum.js.map +1 -0
- package/examples/gh/node_modules/typescript/dist/enums/typeFlags.js +78 -0
- package/examples/gh/node_modules/typescript/dist/enums/typeFlags.js.map +1 -0
- package/examples/gh/node_modules/typescript/dist/enums/typePredicateKind.d.ts +2 -0
- package/examples/gh/node_modules/typescript/dist/enums/typePredicateKind.d.ts.map +1 -0
- package/examples/gh/node_modules/typescript/dist/enums/typePredicateKind.enum.d.ts +7 -0
- package/examples/gh/node_modules/typescript/dist/enums/typePredicateKind.enum.d.ts.map +1 -0
- package/examples/gh/node_modules/typescript/dist/enums/typePredicateKind.enum.js +9 -0
- package/examples/gh/node_modules/typescript/dist/enums/typePredicateKind.enum.js.map +1 -0
- package/examples/gh/node_modules/typescript/dist/enums/typePredicateKind.js +9 -0
- package/examples/gh/node_modules/typescript/dist/enums/typePredicateKind.js.map +1 -0
- package/examples/gh/node_modules/typescript/dist/internal/utils.d.ts +23 -0
- package/examples/gh/node_modules/typescript/dist/internal/utils.d.ts.map +1 -0
- package/examples/gh/node_modules/typescript/dist/internal/utils.js +25 -0
- package/examples/gh/node_modules/typescript/dist/internal/utils.js.map +1 -0
- package/examples/gh/node_modules/typescript/lib/getExePath.d.ts +2 -0
- package/examples/gh/node_modules/typescript/lib/getExePath.js +70 -0
- package/examples/gh/node_modules/typescript/lib/tsc.js +28 -0
- package/examples/gh/node_modules/typescript/lib/version.cjs +3 -0
- package/examples/gh/node_modules/typescript/lib/version.d.cts +2 -0
- package/examples/gh/node_modules/typescript/package.json +87 -0
- package/examples/gh/node_modules/typescript/vendor/vscode-jsonrpc/License.txt +11 -0
- package/examples/gh/node_modules/typescript/vendor/vscode-jsonrpc/README.md +54 -0
- package/examples/gh/node_modules/typescript/vendor/vscode-jsonrpc/lib/browser/main.d.ts +17 -0
- package/examples/gh/node_modules/typescript/vendor/vscode-jsonrpc/lib/browser/main.js +83 -0
- package/examples/gh/node_modules/typescript/vendor/vscode-jsonrpc/lib/browser/ril.d.ts +22 -0
- package/examples/gh/node_modules/typescript/vendor/vscode-jsonrpc/lib/browser/ril.js +210 -0
- package/examples/gh/node_modules/typescript/vendor/vscode-jsonrpc/lib/common/api.d.ts +14 -0
- package/examples/gh/node_modules/typescript/vendor/vscode-jsonrpc/lib/common/api.js +87 -0
- package/examples/gh/node_modules/typescript/vendor/vscode-jsonrpc/lib/common/cancellation.d.ts +32 -0
- package/examples/gh/node_modules/typescript/vendor/vscode-jsonrpc/lib/common/cancellation.js +132 -0
- package/examples/gh/node_modules/typescript/vendor/vscode-jsonrpc/lib/common/connection.d.ts +367 -0
- package/examples/gh/node_modules/typescript/vendor/vscode-jsonrpc/lib/common/connection.js +1271 -0
- package/examples/gh/node_modules/typescript/vendor/vscode-jsonrpc/lib/common/disposable.d.ts +9 -0
- package/examples/gh/node_modules/typescript/vendor/vscode-jsonrpc/lib/common/disposable.js +16 -0
- package/examples/gh/node_modules/typescript/vendor/vscode-jsonrpc/lib/common/encoding.d.ts +52 -0
- package/examples/gh/node_modules/typescript/vendor/vscode-jsonrpc/lib/common/encoding.js +70 -0
- package/examples/gh/node_modules/typescript/vendor/vscode-jsonrpc/lib/common/events.d.ts +39 -0
- package/examples/gh/node_modules/typescript/vendor/vscode-jsonrpc/lib/common/events.js +135 -0
- package/examples/gh/node_modules/typescript/vendor/vscode-jsonrpc/lib/common/is.d.ts +7 -0
- package/examples/gh/node_modules/typescript/vendor/vscode-jsonrpc/lib/common/is.js +34 -0
- package/examples/gh/node_modules/typescript/vendor/vscode-jsonrpc/lib/common/linkedMap.d.ts +55 -0
- package/examples/gh/node_modules/typescript/vendor/vscode-jsonrpc/lib/common/linkedMap.js +412 -0
- package/examples/gh/node_modules/typescript/vendor/vscode-jsonrpc/lib/common/messageBuffer.d.ts +18 -0
- package/examples/gh/node_modules/typescript/vendor/vscode-jsonrpc/lib/common/messageBuffer.js +155 -0
- package/examples/gh/node_modules/typescript/vendor/vscode-jsonrpc/lib/common/messageReader.d.ts +77 -0
- package/examples/gh/node_modules/typescript/vendor/vscode-jsonrpc/lib/common/messageReader.js +246 -0
- package/examples/gh/node_modules/typescript/vendor/vscode-jsonrpc/lib/common/messageWriter.d.ts +60 -0
- package/examples/gh/node_modules/typescript/vendor/vscode-jsonrpc/lib/common/messageWriter.js +157 -0
- package/examples/gh/node_modules/typescript/vendor/vscode-jsonrpc/lib/common/messages.d.ts +369 -0
- package/examples/gh/node_modules/typescript/vendor/vscode-jsonrpc/lib/common/messages.js +436 -0
- package/examples/gh/node_modules/typescript/vendor/vscode-jsonrpc/lib/common/ral.d.ts +74 -0
- package/examples/gh/node_modules/typescript/vendor/vscode-jsonrpc/lib/common/ral.js +23 -0
- package/examples/gh/node_modules/typescript/vendor/vscode-jsonrpc/lib/common/semaphore.d.ts +10 -0
- package/examples/gh/node_modules/typescript/vendor/vscode-jsonrpc/lib/common/semaphore.js +74 -0
- package/examples/gh/node_modules/typescript/vendor/vscode-jsonrpc/lib/common/sharedArrayCancellation.d.ts +15 -0
- package/examples/gh/node_modules/typescript/vendor/vscode-jsonrpc/lib/common/sharedArrayCancellation.js +77 -0
- package/examples/gh/node_modules/typescript/vendor/vscode-jsonrpc/lib/node/main.d.ts +58 -0
- package/examples/gh/node_modules/typescript/vendor/vscode-jsonrpc/lib/node/main.js +289 -0
- package/examples/gh/node_modules/typescript/vendor/vscode-jsonrpc/lib/node/ril.d.ts +12 -0
- package/examples/gh/node_modules/typescript/vendor/vscode-jsonrpc/lib/node/ril.js +163 -0
- package/examples/gh/node_modules/typescript/vendor/vscode-jsonrpc/package.json +54 -0
- package/examples/gh/node_modules/typescript/vendor/vscode-jsonrpc/typings/thenable.d.ts +5 -0
- package/examples/gh/package.json +11 -5
- package/examples/gh/src/main.ts +10 -4
- package/examples/pwsh-demo/package.json +1 -1
- package/examples/pwsh-demo/src/main.ts +1 -1
- package/package.json +45 -41
- package/dist/core/schema-dsl/runtime.d.mts +0 -144
- package/dist/core/schema-dsl/runtime.mjs +0 -271
- package/dist/core/schema-dsl/to-json-schema.d.mts +0 -30
- package/dist/core/schema-dsl/to-json-schema.mjs +0 -74
- package/dist/runtime/bun.d.mts +0 -28
- package/dist/runtime/bun.mjs +0 -28
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { RuntimeAdapter } from "../../runtime/adapter.mjs";
|
|
2
|
-
import { ManifestDiscoveryOptions, PackageJsonAdapter, PackageJsonData, PackageRepository, discoverManifest, discoverPackageJson, inferCliName, packageRepositoryUrl } from "./package-json.mjs";
|
|
3
|
-
|
|
2
|
+
import { ManifestDiscoveryOptions, PackageJsonAdapter, PackageJsonData, PackageRepository, PackageRepositoryUrlOptions, discoverManifest, discoverPackageJson, inferCliName, packageRepositoryUrl } from "./package-json.mjs";
|
|
4
3
|
//#region src/core/config/index.d.ts
|
|
5
4
|
/**
|
|
6
5
|
* Format loader — parses file content into a config object.
|
|
@@ -42,6 +41,14 @@ interface ConfigDiscoveryOptions {
|
|
|
42
41
|
* Probed in order; first found wins.
|
|
43
42
|
*/
|
|
44
43
|
readonly searchPaths?: readonly string[];
|
|
44
|
+
/**
|
|
45
|
+
* Directory the project-scope ancestor walk starts from.
|
|
46
|
+
* Anchors discovery to a location other than the process working
|
|
47
|
+
* directory (e.g. the directory of a file an editor integration is
|
|
48
|
+
* operating on).
|
|
49
|
+
* @defaultValue `adapter.cwd`
|
|
50
|
+
*/
|
|
51
|
+
readonly baseDir?: string;
|
|
45
52
|
}
|
|
46
53
|
/** Successful config discovery — file found and parsed. */
|
|
47
54
|
interface ConfigFound {
|
|
@@ -61,6 +68,23 @@ interface ConfigNotFound {
|
|
|
61
68
|
}
|
|
62
69
|
/** Discriminated result of config discovery. */
|
|
63
70
|
type ConfigDiscoveryResult = ConfigFound | ConfigNotFound;
|
|
71
|
+
/** Directory scopes feeding {@link buildConfigSearchPaths}. */
|
|
72
|
+
interface ConfigSearchPathOptions {
|
|
73
|
+
/** Directory the project-scope ancestor walk starts from. */
|
|
74
|
+
readonly baseDir: string;
|
|
75
|
+
/**
|
|
76
|
+
* User-scope config roots, highest priority first
|
|
77
|
+
* (XDG / AppData, plus `~/Library/Application Support` on macOS).
|
|
78
|
+
*/
|
|
79
|
+
readonly userConfigDirs: readonly string[];
|
|
80
|
+
/**
|
|
81
|
+
* System-scope config roots (`/etc` on Linux and macOS).
|
|
82
|
+
* @defaultValue `[]`
|
|
83
|
+
*/
|
|
84
|
+
readonly systemConfigDirs?: readonly string[];
|
|
85
|
+
/** Custom {@link FormatLoader}s whose extensions expand the search set. */
|
|
86
|
+
readonly loaders?: readonly FormatLoader[];
|
|
87
|
+
}
|
|
64
88
|
/**
|
|
65
89
|
* Build the default config search paths for an app.
|
|
66
90
|
*
|
|
@@ -69,34 +93,40 @@ type ConfigDiscoveryResult = ConfigFound | ConfigNotFound;
|
|
|
69
93
|
* manually. Exported for debugging, custom discovery flows, and help text.
|
|
70
94
|
*
|
|
71
95
|
* Search order (first match wins):
|
|
72
|
-
* 1.
|
|
73
|
-
*
|
|
74
|
-
*
|
|
75
|
-
*
|
|
76
|
-
*
|
|
96
|
+
* 1. Project scope — for `baseDir` and each ancestor directory up to the
|
|
97
|
+
* filesystem root, nearest first:
|
|
98
|
+
* 1. `{dir}/.{appName}.json` — dotfile
|
|
99
|
+
* 2. `{dir}/{appName}.config.json` — explicit config
|
|
100
|
+
* 3. `{dir}/.config/{appName}.json` — project `.config/` convention
|
|
101
|
+
* 2. User scope — `{userConfigDir}/{appName}/config.json` for each entry of
|
|
102
|
+
* `userConfigDirs`, in order.
|
|
103
|
+
* 3. System scope — `{systemConfigDir}/{appName}/config.json` for each entry
|
|
104
|
+
* of `systemConfigDirs`, in order.
|
|
77
105
|
*
|
|
78
106
|
* When custom {@link ConfigDiscoveryOptions.loaders | loaders} are registered,
|
|
79
107
|
* each path pattern is repeated per supported extension (JSON always first).
|
|
80
108
|
*
|
|
81
109
|
* @param appName - CLI application name used to derive config filenames.
|
|
82
|
-
* @param
|
|
83
|
-
* @param configDir - Platform config directory (XDG / AppData).
|
|
84
|
-
* @param loaders - Optional custom {@link FormatLoader}s whose extensions expand the search set.
|
|
110
|
+
* @param options - Directory scopes and loaders (see {@link ConfigSearchPathOptions}).
|
|
85
111
|
* @returns Ordered list of candidate config file paths (first match wins).
|
|
86
112
|
*
|
|
87
113
|
* @example
|
|
88
114
|
* ```ts
|
|
89
|
-
* const paths = buildConfigSearchPaths('mycli',
|
|
115
|
+
* const paths = buildConfigSearchPaths('mycli', {
|
|
116
|
+
* baseDir: '/repo/packages/app',
|
|
117
|
+
* userConfigDirs: ['/home/me/.config'],
|
|
118
|
+
* systemConfigDirs: ['/etc'],
|
|
119
|
+
* });
|
|
90
120
|
* ```
|
|
91
121
|
*/
|
|
92
|
-
declare function buildConfigSearchPaths(appName: string,
|
|
122
|
+
declare function buildConfigSearchPaths(appName: string, options: ConfigSearchPathOptions): readonly string[];
|
|
93
123
|
/**
|
|
94
124
|
* The subset of {@link RuntimeAdapter} needed for config discovery.
|
|
95
125
|
*
|
|
96
126
|
* Exported so custom hosts and tests can type the minimal adapter required by
|
|
97
127
|
* {@link discoverConfig} without depending on the full runtime adapter shape.
|
|
98
128
|
*/
|
|
99
|
-
type ConfigAdapter = Pick<RuntimeAdapter, 'readFile' | 'cwd' | 'configDir'
|
|
129
|
+
type ConfigAdapter = Pick<RuntimeAdapter, 'readFile' | 'cwd' | 'configDir'> & Partial<Pick<RuntimeAdapter, 'userConfigDirs' | 'systemConfigDirs'>>;
|
|
100
130
|
/**
|
|
101
131
|
* Discover and load a config file.
|
|
102
132
|
*
|
|
@@ -158,4 +188,4 @@ declare function discoverConfig(appName: string, adapter: ConfigAdapter, options
|
|
|
158
188
|
*/
|
|
159
189
|
declare function configFormat(extensions: readonly string[], parse: (content: string) => unknown): FormatLoader;
|
|
160
190
|
//#endregion
|
|
161
|
-
export { type ConfigAdapter, type ConfigDiscoveryOptions, type ConfigDiscoveryResult, type ConfigFound, type ConfigNotFound, type FormatLoader, type ManifestDiscoveryOptions, type PackageJsonAdapter, type PackageJsonData, type PackageRepository, buildConfigSearchPaths, configFormat, discoverConfig, discoverManifest, discoverPackageJson, inferCliName, packageRepositoryUrl };
|
|
191
|
+
export { type ConfigAdapter, type ConfigDiscoveryOptions, type ConfigDiscoveryResult, type ConfigFound, type ConfigNotFound, type ConfigSearchPathOptions, type FormatLoader, type ManifestDiscoveryOptions, type PackageJsonAdapter, type PackageJsonData, type PackageRepository, type PackageRepositoryUrlOptions, buildConfigSearchPaths, configFormat, discoverConfig, discoverManifest, discoverPackageJson, inferCliName, packageRepositoryUrl };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { CLIError } from "../errors/index.mjs";
|
|
2
|
-
import "./package-json.mjs";
|
|
2
|
+
import { discoverManifest, discoverPackageJson, inferCliName, packageRepositoryUrl } from "./package-json.mjs";
|
|
3
3
|
//#region src/core/config/index.ts
|
|
4
4
|
/**
|
|
5
5
|
* Config file discovery and loading.
|
|
@@ -39,7 +39,31 @@ const jsonLoader = {
|
|
|
39
39
|
*/
|
|
40
40
|
function joinPath(base, ...segments) {
|
|
41
41
|
const sep = base.includes("\\") ? "\\" : "/";
|
|
42
|
-
return [base, ...segments].join(sep);
|
|
42
|
+
return [base.endsWith(sep) ? base.slice(0, -1) : base, ...segments].join(sep);
|
|
43
|
+
}
|
|
44
|
+
/**
|
|
45
|
+
* List a directory and every ancestor up to the filesystem root,
|
|
46
|
+
* nearest first. Separator is inferred from the input; POSIX (`/`) and
|
|
47
|
+
* Windows drive roots (`C:\`) both terminate the walk.
|
|
48
|
+
*
|
|
49
|
+
* @internal
|
|
50
|
+
*/
|
|
51
|
+
function ancestorDirs(base) {
|
|
52
|
+
const sep = base.includes("\\") ? "\\" : "/";
|
|
53
|
+
let current = base;
|
|
54
|
+
while (current.length > 1 && current.endsWith(sep) && !current.endsWith(`:${sep}`)) current = current.slice(0, -1);
|
|
55
|
+
const dirs = [current];
|
|
56
|
+
while (true) {
|
|
57
|
+
const idx = current.lastIndexOf(sep);
|
|
58
|
+
if (idx < 0) break;
|
|
59
|
+
let parent = current.slice(0, idx);
|
|
60
|
+
if (parent === "") parent = sep;
|
|
61
|
+
else if (/^[A-Za-z]:$/.test(parent)) parent = `${parent}${sep}`;
|
|
62
|
+
if (parent === current) break;
|
|
63
|
+
dirs.push(parent);
|
|
64
|
+
current = parent;
|
|
65
|
+
}
|
|
66
|
+
return dirs;
|
|
43
67
|
}
|
|
44
68
|
/**
|
|
45
69
|
* Extract the file extension (without leading dot, lowercased).
|
|
@@ -60,32 +84,42 @@ function getExtension(path) {
|
|
|
60
84
|
* manually. Exported for debugging, custom discovery flows, and help text.
|
|
61
85
|
*
|
|
62
86
|
* Search order (first match wins):
|
|
63
|
-
* 1.
|
|
64
|
-
*
|
|
65
|
-
*
|
|
66
|
-
*
|
|
67
|
-
*
|
|
87
|
+
* 1. Project scope — for `baseDir` and each ancestor directory up to the
|
|
88
|
+
* filesystem root, nearest first:
|
|
89
|
+
* 1. `{dir}/.{appName}.json` — dotfile
|
|
90
|
+
* 2. `{dir}/{appName}.config.json` — explicit config
|
|
91
|
+
* 3. `{dir}/.config/{appName}.json` — project `.config/` convention
|
|
92
|
+
* 2. User scope — `{userConfigDir}/{appName}/config.json` for each entry of
|
|
93
|
+
* `userConfigDirs`, in order.
|
|
94
|
+
* 3. System scope — `{systemConfigDir}/{appName}/config.json` for each entry
|
|
95
|
+
* of `systemConfigDirs`, in order.
|
|
68
96
|
*
|
|
69
97
|
* When custom {@link ConfigDiscoveryOptions.loaders | loaders} are registered,
|
|
70
98
|
* each path pattern is repeated per supported extension (JSON always first).
|
|
71
99
|
*
|
|
72
100
|
* @param appName - CLI application name used to derive config filenames.
|
|
73
|
-
* @param
|
|
74
|
-
* @param configDir - Platform config directory (XDG / AppData).
|
|
75
|
-
* @param loaders - Optional custom {@link FormatLoader}s whose extensions expand the search set.
|
|
101
|
+
* @param options - Directory scopes and loaders (see {@link ConfigSearchPathOptions}).
|
|
76
102
|
* @returns Ordered list of candidate config file paths (first match wins).
|
|
77
103
|
*
|
|
78
104
|
* @example
|
|
79
105
|
* ```ts
|
|
80
|
-
* const paths = buildConfigSearchPaths('mycli',
|
|
106
|
+
* const paths = buildConfigSearchPaths('mycli', {
|
|
107
|
+
* baseDir: '/repo/packages/app',
|
|
108
|
+
* userConfigDirs: ['/home/me/.config'],
|
|
109
|
+
* systemConfigDirs: ['/etc'],
|
|
110
|
+
* });
|
|
81
111
|
* ```
|
|
82
112
|
*/
|
|
83
|
-
function buildConfigSearchPaths(appName,
|
|
84
|
-
const extensions = buildExtensionList(loaders);
|
|
113
|
+
function buildConfigSearchPaths(appName, options) {
|
|
114
|
+
const extensions = buildExtensionList(options.loaders);
|
|
85
115
|
const paths = [];
|
|
86
|
-
for (const
|
|
87
|
-
|
|
88
|
-
|
|
116
|
+
for (const dir of ancestorDirs(options.baseDir)) {
|
|
117
|
+
for (const ext of extensions) paths.push(joinPath(dir, `.${appName}.${ext}`));
|
|
118
|
+
for (const ext of extensions) paths.push(joinPath(dir, `${appName}.config.${ext}`));
|
|
119
|
+
for (const ext of extensions) paths.push(joinPath(dir, ".config", `${appName}.${ext}`));
|
|
120
|
+
}
|
|
121
|
+
for (const dir of options.userConfigDirs) for (const ext of extensions) paths.push(joinPath(dir, appName, `config.${ext}`));
|
|
122
|
+
for (const dir of options.systemConfigDirs ?? []) for (const ext of extensions) paths.push(joinPath(dir, appName, `config.${ext}`));
|
|
89
123
|
return paths;
|
|
90
124
|
}
|
|
91
125
|
/**
|
|
@@ -158,7 +192,12 @@ function buildLoaderMap(loaders) {
|
|
|
158
192
|
*/
|
|
159
193
|
async function discoverConfig(appName, adapter, options) {
|
|
160
194
|
const loaderMap = buildLoaderMap(options?.loaders);
|
|
161
|
-
const searchPaths = options?.configPath !== void 0 ? [options.configPath] : options?.searchPaths ?? buildConfigSearchPaths(appName,
|
|
195
|
+
const searchPaths = options?.configPath !== void 0 ? [options.configPath] : options?.searchPaths ?? buildConfigSearchPaths(appName, {
|
|
196
|
+
baseDir: options?.baseDir ?? adapter.cwd,
|
|
197
|
+
userConfigDirs: adapter.userConfigDirs ?? [adapter.configDir],
|
|
198
|
+
systemConfigDirs: adapter.systemConfigDirs ?? [],
|
|
199
|
+
...options?.loaders !== void 0 ? { loaders: options.loaders } : {}
|
|
200
|
+
});
|
|
162
201
|
for (const candidatePath of searchPaths) {
|
|
163
202
|
const content = await adapter.readFile(candidatePath);
|
|
164
203
|
if (content === null) {
|
|
@@ -243,4 +282,4 @@ function configFormat(extensions, parse) {
|
|
|
243
282
|
};
|
|
244
283
|
}
|
|
245
284
|
//#endregion
|
|
246
|
-
export { buildConfigSearchPaths, configFormat, discoverConfig };
|
|
285
|
+
export { buildConfigSearchPaths, configFormat, discoverConfig, discoverManifest, discoverPackageJson, inferCliName, packageRepositoryUrl };
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { RuntimeAdapter } from "../../runtime/adapter.mjs";
|
|
2
|
-
|
|
3
2
|
//#region src/core/config/package-json.d.ts
|
|
4
3
|
/**
|
|
5
4
|
* Object form of the package.json `repository` field
|
|
@@ -133,6 +132,20 @@ declare function discoverManifest(adapter: PackageJsonAdapter, options?: Manifes
|
|
|
133
132
|
* ```
|
|
134
133
|
*/
|
|
135
134
|
declare function discoverPackageJson(adapter: PackageJsonAdapter, startDir?: string): Promise<PackageJsonData | null>;
|
|
135
|
+
/** Options for {@link packageRepositoryUrl}. */
|
|
136
|
+
interface PackageRepositoryUrlOptions {
|
|
137
|
+
/**
|
|
138
|
+
* Throw a `CLIError` (code `INVALID_REPOSITORY`) instead of returning
|
|
139
|
+
* `undefined` when the `repository` field is absent or not a recognisable
|
|
140
|
+
* locator. With `require: true` the return type narrows to `string`, so
|
|
141
|
+
* callers that know their manifest carries a valid repository need no
|
|
142
|
+
* assertion — and a bad manifest fails fast with a real message instead
|
|
143
|
+
* of propagating `undefined`.
|
|
144
|
+
*
|
|
145
|
+
* @defaultValue `false`
|
|
146
|
+
*/
|
|
147
|
+
readonly require?: boolean;
|
|
148
|
+
}
|
|
136
149
|
/**
|
|
137
150
|
* Resolve a package's `repository` field to a browsable `https://` URL.
|
|
138
151
|
*
|
|
@@ -143,15 +156,26 @@ declare function discoverPackageJson(adapter: PackageJsonAdapter, startDir?: str
|
|
|
143
156
|
* - shorthands: `github:u/r`, `gitlab:u/r`, `bitbucket:u/r`, and bare `u/r`
|
|
144
157
|
* (GitHub, per npm convention)
|
|
145
158
|
*
|
|
146
|
-
* Returns `undefined` when the field is absent or unrecognised
|
|
159
|
+
* Returns `undefined` when the field is absent or unrecognised — or, with
|
|
160
|
+
* `{ require: true }`, throws instead and the return type is `string`.
|
|
161
|
+
* (The narrowing cannot key off the input type alone: a present `repository`
|
|
162
|
+
* may still be an empty string, a url-less object, or an unparseable
|
|
163
|
+
* locator, so the `string` promise is backed by the runtime check.)
|
|
147
164
|
*
|
|
148
165
|
* @example
|
|
149
166
|
* ```ts
|
|
150
167
|
* packageRepositoryUrl({ repository: 'git+https://github.com/u/r.git' });
|
|
151
168
|
* // 'https://github.com/u/r'
|
|
169
|
+
*
|
|
170
|
+
* const url: string = packageRepositoryUrl(pkg, { require: true });
|
|
171
|
+
* // throws CLIError when pkg.repository is missing or unrecognised
|
|
152
172
|
* ```
|
|
153
173
|
*/
|
|
154
|
-
declare function packageRepositoryUrl(pkg: PackageJsonData
|
|
174
|
+
declare function packageRepositoryUrl(pkg: PackageJsonData, options: PackageRepositoryUrlOptions & {
|
|
175
|
+
readonly require: true;
|
|
176
|
+
}): string;
|
|
177
|
+
/** Resolve a package repository URL, returning `undefined` for absent or invalid locators. */
|
|
178
|
+
declare function packageRepositoryUrl(pkg: PackageJsonData, options?: PackageRepositoryUrlOptions): string | undefined;
|
|
155
179
|
/**
|
|
156
180
|
* Infer the CLI binary name from manifest data.
|
|
157
181
|
*
|
|
@@ -183,4 +207,4 @@ declare function inferCliName(pkg: PackageJsonData, options?: {
|
|
|
183
207
|
readonly stripScope?: boolean;
|
|
184
208
|
}): string | undefined;
|
|
185
209
|
//#endregion
|
|
186
|
-
export { type ManifestDiscoveryOptions, type PackageJsonAdapter, type PackageJsonData, type PackageRepository, discoverManifest, discoverPackageJson, inferCliName, packageRepositoryUrl };
|
|
210
|
+
export { type ManifestDiscoveryOptions, type PackageJsonAdapter, type PackageJsonData, type PackageRepository, type PackageRepositoryUrlOptions, discoverManifest, discoverPackageJson, inferCliName, packageRepositoryUrl };
|
|
@@ -1,5 +1,15 @@
|
|
|
1
|
+
import { CLIError } from "../errors/index.mjs";
|
|
1
2
|
import { stripTrailing } from "../../strings.mjs";
|
|
2
3
|
//#region src/core/config/package-json.ts
|
|
4
|
+
/**
|
|
5
|
+
* Package.json auto-discovery via directory walk-up.
|
|
6
|
+
*
|
|
7
|
+
* Walks up from `adapter.cwd` to find the nearest `package.json`, parses
|
|
8
|
+
* it, and extracts metadata (name, version, description, bin). All I/O
|
|
9
|
+
* flows through the adapter — fully testable with virtual filesystems.
|
|
10
|
+
*
|
|
11
|
+
* @module dreamcli/core/config/package-json
|
|
12
|
+
*/
|
|
3
13
|
/** Type guard: narrows `unknown` to a plain (non-array) object. */
|
|
4
14
|
function isPlainObject(value) {
|
|
5
15
|
return typeof value === "object" && value !== null && !Array.isArray(value);
|
|
@@ -302,25 +312,16 @@ const SHORTHAND_HOSTS = {
|
|
|
302
312
|
function stripGitSuffix(path) {
|
|
303
313
|
return path.endsWith(".git") ? path.slice(0, -4) : path;
|
|
304
314
|
}
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
* Returns `undefined` when the field is absent or unrecognised.
|
|
316
|
-
*
|
|
317
|
-
* @example
|
|
318
|
-
* ```ts
|
|
319
|
-
* packageRepositoryUrl({ repository: 'git+https://github.com/u/r.git' });
|
|
320
|
-
* // 'https://github.com/u/r'
|
|
321
|
-
* ```
|
|
322
|
-
*/
|
|
323
|
-
function packageRepositoryUrl(pkg) {
|
|
315
|
+
function packageRepositoryUrl(pkg, options) {
|
|
316
|
+
const url = resolveRepositoryUrl(pkg);
|
|
317
|
+
if (url === void 0 && options?.require === true) throw new CLIError(pkg.repository === void 0 ? "package.json has no 'repository' field" : `package.json 'repository' is not a recognisable locator: ${JSON.stringify(pkg.repository)}`, {
|
|
318
|
+
code: "INVALID_REPOSITORY",
|
|
319
|
+
suggest: "Set 'repository' to a supported locator (e.g. 'github:user/repo' or 'git+https://github.com/user/repo.git'), or drop { require: true } and handle undefined"
|
|
320
|
+
});
|
|
321
|
+
return url;
|
|
322
|
+
}
|
|
323
|
+
/** Locator normalization behind {@link packageRepositoryUrl}. @internal */
|
|
324
|
+
function resolveRepositoryUrl(pkg) {
|
|
324
325
|
const raw = typeof pkg.repository === "string" ? pkg.repository : pkg.repository?.url;
|
|
325
326
|
if (raw === void 0) return void 0;
|
|
326
327
|
let locator = raw.trim();
|
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
* @module dreamcli/core/errors
|
|
10
10
|
*/
|
|
11
11
|
/** Codes emitted during argv parsing. */
|
|
12
|
-
type ParseErrorCode = 'UNKNOWN_FLAG' | 'UNKNOWN_COMMAND' | 'MISSING_VALUE' | 'INVALID_VALUE' | 'INVALID_SCHEMA' | 'UNEXPECTED_POSITIONAL';
|
|
12
|
+
type ParseErrorCode = 'UNKNOWN_FLAG' | 'UNKNOWN_COMMAND' | 'MISSING_VALUE' | 'INVALID_VALUE' | 'INVALID_SCHEMA' | 'DUPLICATE_FLAG' | 'UNEXPECTED_POSITIONAL';
|
|
13
13
|
/** Codes emitted during post-parse validation / resolution. */
|
|
14
14
|
type ValidationErrorCode = 'REQUIRED_FLAG' | 'REQUIRED_ARG' | 'INVALID_ENUM' | 'TYPE_MISMATCH' | 'CONSTRAINT_VIOLATED';
|
|
15
15
|
/** Any framework error code (extensible via `string & {}`). */
|
|
@@ -87,7 +87,7 @@ interface ParseErrorOptions extends Omit<CLIErrorOptions, 'code' | 'exitCode'> {
|
|
|
87
87
|
*/
|
|
88
88
|
declare class ParseError extends CLIError {
|
|
89
89
|
/** Always `'ParseError'`. @override */
|
|
90
|
-
readonly name:
|
|
90
|
+
readonly name: "ParseError";
|
|
91
91
|
/** Narrowed to parse-category codes. */
|
|
92
92
|
readonly code: ParseErrorCode;
|
|
93
93
|
/** Create a parse error with exit code defaulting to `2`. */
|
|
@@ -110,7 +110,7 @@ interface ValidationErrorOptions extends Omit<CLIErrorOptions, 'code' | 'exitCod
|
|
|
110
110
|
*/
|
|
111
111
|
declare class ValidationError extends CLIError {
|
|
112
112
|
/** Always `'ValidationError'`. @override */
|
|
113
|
-
readonly name:
|
|
113
|
+
readonly name: "ValidationError";
|
|
114
114
|
/** Narrowed to validation-category codes. */
|
|
115
115
|
readonly code: ValidationErrorCode;
|
|
116
116
|
/** Create a validation error with exit code defaulting to `2`. */
|
|
@@ -2,7 +2,6 @@ import { CapturedOutput } from "../output/index.mjs";
|
|
|
2
2
|
import { CLIError } from "../errors/index.mjs";
|
|
3
3
|
import { RunOptions, RunResult } from "../schema/run.mjs";
|
|
4
4
|
import { CommandMeta, CommandSchema, Out, RunnableCommand } from "../schema/command.mjs";
|
|
5
|
-
|
|
6
5
|
//#region src/core/execution/index.d.ts
|
|
7
6
|
/**
|
|
8
7
|
* Explicit executor input for a single command invocation.
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import { CLIError } from "../errors/index.mjs";
|
|
2
|
+
import { includesBeforeSeparator, parse } from "../parse/index.mjs";
|
|
2
3
|
import { formatHelp } from "../help/index.mjs";
|
|
4
|
+
import { generateCommandSchema } from "../json-schema/index.mjs";
|
|
3
5
|
import { clearRequestedExitCode, getRequestedExitCode } from "../output/index.mjs";
|
|
4
|
-
import { includesBeforeSeparator, parse } from "../parse/index.mjs";
|
|
5
6
|
import { createTestPrompter } from "../prompt/index.mjs";
|
|
6
7
|
import { resolve } from "../resolve/index.mjs";
|
|
7
8
|
//#region src/core/execution/index.ts
|
|
@@ -17,7 +18,20 @@ async function executeCommand(request) {
|
|
|
17
18
|
clearRequestedExitCode(out);
|
|
18
19
|
try {
|
|
19
20
|
if (includesBeforeSeparator(argv, "--help") || includesBeforeSeparator(argv, "-h")) {
|
|
20
|
-
|
|
21
|
+
if (out.jsonMode || options?.jsonMode === true) {
|
|
22
|
+
out.json(generateCommandSchema(schema, void 0, {
|
|
23
|
+
name: options?.help?.binName ?? schema.name,
|
|
24
|
+
version: options?.help?.version
|
|
25
|
+
}));
|
|
26
|
+
return {
|
|
27
|
+
exitCode: 0,
|
|
28
|
+
error: void 0
|
|
29
|
+
};
|
|
30
|
+
}
|
|
31
|
+
const helpText = formatHelp(schema, options?.help?.colors !== void 0 ? options.help : {
|
|
32
|
+
...options?.help,
|
|
33
|
+
colors: out.color
|
|
34
|
+
});
|
|
21
35
|
out.log(helpText);
|
|
22
36
|
return {
|
|
23
37
|
exitCode: 0,
|
|
@@ -42,13 +56,15 @@ async function executeCommand(request) {
|
|
|
42
56
|
meta,
|
|
43
57
|
out
|
|
44
58
|
});
|
|
45
|
-
const parsed = parse(schema, argv);
|
|
59
|
+
const parsed = parse(schema, argv, options?.flags);
|
|
46
60
|
const effectivePrompter = options?.prompter ?? (options?.answers !== void 0 ? createTestPrompter(options.answers) : void 0);
|
|
47
61
|
const resolved = await resolve(schema, parsed, {
|
|
48
62
|
...options?.stdinData !== void 0 ? { stdinData: options.stdinData } : {},
|
|
49
63
|
...options?.env !== void 0 ? { env: options.env } : {},
|
|
50
64
|
...options?.config !== void 0 ? { config: options.config } : {},
|
|
51
|
-
...effectivePrompter !== void 0 ? { prompter: effectivePrompter } : {}
|
|
65
|
+
...effectivePrompter !== void 0 ? { prompter: effectivePrompter } : {},
|
|
66
|
+
...options?.stat !== void 0 ? { stat: options.stat } : {},
|
|
67
|
+
...options?.mkdir !== void 0 ? { mkdir: options.mkdir } : {}
|
|
52
68
|
});
|
|
53
69
|
const resolvedParams = {
|
|
54
70
|
args: resolved.args,
|
|
@@ -13,6 +13,11 @@
|
|
|
13
13
|
/**
|
|
14
14
|
* Remove ANSI CSI and OSC escape sequences from `text`.
|
|
15
15
|
*
|
|
16
|
+
* Delegates to `ansispeck`'s stripper, which handles SGR sequences and OSC
|
|
17
|
+
* hyperlinks under both terminators. Kept as a named export so help
|
|
18
|
+
* formatting and custom help renderers reach the width-aware helpers and
|
|
19
|
+
* their stripper through one module.
|
|
20
|
+
*
|
|
16
21
|
* @param text - Text possibly containing terminal escapes.
|
|
17
22
|
* @returns The text with all escape sequences removed.
|
|
18
23
|
*/
|
|
@@ -39,10 +44,10 @@ declare function visibleWidth(text: string): number;
|
|
|
39
44
|
* Wrap `text` in an [OSC 8 hyperlink](https://gist.github.com/egmontkob/eb114294efbcd5adb1944c9f3cb5feda)
|
|
40
45
|
* pointing at `url`.
|
|
41
46
|
*
|
|
42
|
-
* Supporting terminals render `text` as a clickable link;
|
|
43
|
-
*
|
|
44
|
-
*
|
|
45
|
-
*
|
|
47
|
+
* Supporting terminals render `text` as a clickable link; others show it
|
|
48
|
+
* plain. `text` defaults to the URL, so an omitted label degrades to a
|
|
49
|
+
* usable address. The framework's help layer decides *whether* to link
|
|
50
|
+
* (`help.hyperlinks`); this always emits when called.
|
|
46
51
|
*
|
|
47
52
|
* @param url - Link target (string or `URL` instance).
|
|
48
53
|
* @param text - Visible link text.
|
|
@@ -51,9 +56,10 @@ declare function visibleWidth(text: string): number;
|
|
|
51
56
|
* @example
|
|
52
57
|
* ```ts
|
|
53
58
|
* cli('mycli').version(osc8('https://github.com/me/mycli/releases/tag/v1.0.0', '1.0.0'));
|
|
59
|
+
* osc8('https://dreamcli.kjanat.dev'); // linked, displayed as the URL
|
|
54
60
|
* ```
|
|
55
61
|
*/
|
|
56
|
-
declare function osc8(url: string | URL, text
|
|
62
|
+
declare function osc8(url: string | URL, text?: string): string;
|
|
57
63
|
/**
|
|
58
64
|
* Pad `text` to `length` visible columns with trailing spaces.
|
|
59
65
|
*
|
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,10 +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
|
-
return
|
|
69
|
+
return emitLink(url, text);
|
|
71
70
|
}
|
|
72
71
|
/**
|
|
73
72
|
* Pad `text` to `length` visible columns with trailing spaces.
|
|
@@ -119,4 +118,4 @@ function wrapText(text, width, indent) {
|
|
|
119
118
|
return lines.map((line, i) => i === 0 ? line : `${pad}${line}`).join("\n");
|
|
120
119
|
}
|
|
121
120
|
//#endregion
|
|
122
|
-
export { osc8, padEnd, visibleWidth, wrapText };
|
|
121
|
+
export { osc8, padEnd, stripAnsi, visibleWidth, wrapText };
|
|
@@ -1,6 +1,8 @@
|
|
|
1
|
+
import { HelpTheme, HelpThemeFactory } from "./theme.mjs";
|
|
1
2
|
import { osc8, visibleWidth } from "./ansi.mjs";
|
|
2
3
|
import { CommandSchema } from "../schema/command.mjs";
|
|
3
|
-
|
|
4
|
+
import "../schema/index.mjs";
|
|
5
|
+
import { Colors } from "ansispeck";
|
|
4
6
|
//#region src/core/help/index.d.ts
|
|
5
7
|
/** Options for customising help output. */
|
|
6
8
|
interface HelpOptions {
|
|
@@ -8,6 +10,26 @@ interface HelpOptions {
|
|
|
8
10
|
readonly width?: number;
|
|
9
11
|
/** Binary/program name shown in the usage line. Defaults to command name. */
|
|
10
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;
|
|
11
33
|
/**
|
|
12
34
|
* Emit OSC 8 hyperlinks where link metadata is available (currently the
|
|
13
35
|
* root-help header name/version configured via `CLIBuilder.links()`).
|
|
@@ -42,10 +64,29 @@ interface HelpOptions {
|
|
|
42
64
|
readonly footer?: boolean;
|
|
43
65
|
/** @internal Whether this usage line is being rendered as merged root/default help. */
|
|
44
66
|
readonly isDefaultHelp?: boolean;
|
|
67
|
+
/**
|
|
68
|
+
* Gated ANSI palette used to style help output. Identity formatters mean
|
|
69
|
+
* plain text. `CLIBuilder.execute()`/`.run()` thread the output channel's
|
|
70
|
+
* `out.color` here automatically, so styling follows the same policy as
|
|
71
|
+
* handler output (TTY + color support, no `--json`, `NO_COLOR` honored).
|
|
72
|
+
*
|
|
73
|
+
* @defaultValue `undefined` (plain text)
|
|
74
|
+
*/
|
|
75
|
+
readonly colors?: Colors;
|
|
76
|
+
/**
|
|
77
|
+
* Theme overrides merged over the built-in help theme. Receives the gated
|
|
78
|
+
* palette; never invoked when color is off, so overrides cannot leak
|
|
79
|
+
* escapes into piped output.
|
|
80
|
+
*
|
|
81
|
+
* @defaultValue `undefined` (built-in theme)
|
|
82
|
+
*/
|
|
83
|
+
readonly theme?: HelpThemeFactory;
|
|
45
84
|
}
|
|
46
85
|
/** Formatted flag entry for the flags table. @internal */
|
|
47
86
|
interface FlagEntry {
|
|
87
|
+
/** Preformatted flag names and value hint for the left table column. */
|
|
48
88
|
readonly left: string;
|
|
89
|
+
/** Preformatted help text for the description table column. */
|
|
49
90
|
readonly description: string;
|
|
50
91
|
}
|
|
51
92
|
/**
|
|
@@ -90,7 +131,7 @@ declare function formatHelp(schema: CommandSchema, options?: HelpOptions): strin
|
|
|
90
131
|
* block (built-in flags), so column alignment and description wrapping stay
|
|
91
132
|
* identical across both. Returns `''` when there are no entries.
|
|
92
133
|
*
|
|
93
|
-
* @param title - Section heading (e.g. `'Flags:'`, `'Global options:'`).
|
|
134
|
+
* @param title - Section heading (e.g. `'Flags:'`, `'Global options:'`), pre-styled by the caller.
|
|
94
135
|
* @param entries - Formatted left/description rows.
|
|
95
136
|
* @param width - Terminal width for description wrapping.
|
|
96
137
|
* @returns Multi-line block string, or `''` when `entries` is empty.
|
|
@@ -98,4 +139,4 @@ declare function formatHelp(schema: CommandSchema, options?: HelpOptions): strin
|
|
|
98
139
|
*/
|
|
99
140
|
declare function formatFlagEntriesBlock(title: string, entries: readonly FlagEntry[], width: number): string;
|
|
100
141
|
//#endregion
|
|
101
|
-
export { type FlagEntry, type HelpOptions, formatFlagEntriesBlock, formatHelp, formatHelpSections, osc8, visibleWidth };
|
|
142
|
+
export { type FlagEntry, type HelpOptions, type HelpTheme, type HelpThemeFactory, formatFlagEntriesBlock, formatHelp, formatHelpSections, osc8, visibleWidth };
|