@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
|
@@ -0,0 +1,360 @@
|
|
|
1
|
+
#!/usr/bin/env python3
|
|
2
|
+
# /// script
|
|
3
|
+
# requires-python = ">=3.13"
|
|
4
|
+
# dependencies = []
|
|
5
|
+
# ///
|
|
6
|
+
"""
|
|
7
|
+
Generate DreamCLI starter files from bundled templates.
|
|
8
|
+
"""
|
|
9
|
+
|
|
10
|
+
import argparse
|
|
11
|
+
import json
|
|
12
|
+
import re
|
|
13
|
+
import sys
|
|
14
|
+
from pathlib import Path
|
|
15
|
+
|
|
16
|
+
MANIFEST_FILENAMES = (
|
|
17
|
+
"package.json",
|
|
18
|
+
"package.json5",
|
|
19
|
+
"package.yaml",
|
|
20
|
+
"package.yml",
|
|
21
|
+
)
|
|
22
|
+
|
|
23
|
+
LOCKFILE_TO_MANAGER = (
|
|
24
|
+
("bun.lock", "bun"),
|
|
25
|
+
("bun.lockb", "bun"),
|
|
26
|
+
("pnpm-lock.yaml", "pnpm"),
|
|
27
|
+
("pnpm-lock.yml", "pnpm"),
|
|
28
|
+
("pnpm-workspace.yaml", "pnpm"),
|
|
29
|
+
("pnpm-workspace.yml", "pnpm"),
|
|
30
|
+
("yarn.lock", "yarn"),
|
|
31
|
+
("package-lock.json", "npm"),
|
|
32
|
+
("npm-shrinkwrap.json", "npm"),
|
|
33
|
+
)
|
|
34
|
+
|
|
35
|
+
|
|
36
|
+
def normalize_name(raw: str) -> str:
|
|
37
|
+
name = raw.strip().lower()
|
|
38
|
+
name = re.sub(r"[^a-z0-9]+", "-", name)
|
|
39
|
+
name = name.strip("-")
|
|
40
|
+
name = re.sub(r"-{2,}", "-", name)
|
|
41
|
+
return name
|
|
42
|
+
|
|
43
|
+
|
|
44
|
+
def read_template(path: Path) -> str:
|
|
45
|
+
if not path.exists():
|
|
46
|
+
raise FileNotFoundError(f"Template not found: {path}")
|
|
47
|
+
return path.read_text()
|
|
48
|
+
|
|
49
|
+
|
|
50
|
+
def render_template(template: str, replacements: dict[str, str]) -> str:
|
|
51
|
+
rendered = template
|
|
52
|
+
for key, value in replacements.items():
|
|
53
|
+
rendered = rendered.replace(key, value)
|
|
54
|
+
if not rendered.endswith("\n"):
|
|
55
|
+
rendered += "\n"
|
|
56
|
+
return rendered
|
|
57
|
+
|
|
58
|
+
|
|
59
|
+
def write_file(path: Path, content: str, force: bool) -> None:
|
|
60
|
+
if path.exists() and not force:
|
|
61
|
+
raise FileExistsError(f"Refusing to overwrite existing file: {path}. Use --force to overwrite.")
|
|
62
|
+
path.parent.mkdir(parents=True, exist_ok=True)
|
|
63
|
+
path.write_text(content)
|
|
64
|
+
|
|
65
|
+
|
|
66
|
+
def iter_ancestors(path: Path):
|
|
67
|
+
current = path.resolve()
|
|
68
|
+
while True:
|
|
69
|
+
yield current
|
|
70
|
+
if current.parent == current:
|
|
71
|
+
break
|
|
72
|
+
current = current.parent
|
|
73
|
+
|
|
74
|
+
|
|
75
|
+
def lockfiles_for_directory(directory: Path) -> list[Path]:
|
|
76
|
+
lockfiles: list[Path] = []
|
|
77
|
+
for lockfile, _ in LOCKFILE_TO_MANAGER:
|
|
78
|
+
candidate = directory / lockfile
|
|
79
|
+
if candidate.exists():
|
|
80
|
+
lockfiles.append(candidate)
|
|
81
|
+
|
|
82
|
+
pnpm_globs = (
|
|
83
|
+
"pnpm-*.yaml",
|
|
84
|
+
"pnpm-*.yml",
|
|
85
|
+
)
|
|
86
|
+
for pattern in pnpm_globs:
|
|
87
|
+
for candidate in sorted(directory.glob(pattern)):
|
|
88
|
+
if candidate not in lockfiles:
|
|
89
|
+
lockfiles.append(candidate)
|
|
90
|
+
return lockfiles
|
|
91
|
+
|
|
92
|
+
|
|
93
|
+
def manifests_for_directory(directory: Path) -> list[Path]:
|
|
94
|
+
manifests: list[Path] = []
|
|
95
|
+
for filename in MANIFEST_FILENAMES:
|
|
96
|
+
candidate = directory / filename
|
|
97
|
+
if candidate.exists():
|
|
98
|
+
manifests.append(candidate)
|
|
99
|
+
return manifests
|
|
100
|
+
|
|
101
|
+
|
|
102
|
+
def package_manager_from_lockfiles(directory: Path) -> str | None:
|
|
103
|
+
for candidate in lockfiles_for_directory(directory):
|
|
104
|
+
if candidate.name.startswith("pnpm-") and candidate.suffix in {".yaml", ".yml"}:
|
|
105
|
+
return "pnpm"
|
|
106
|
+
for lockfile, manager in LOCKFILE_TO_MANAGER:
|
|
107
|
+
if candidate.name == lockfile:
|
|
108
|
+
return manager
|
|
109
|
+
return None
|
|
110
|
+
|
|
111
|
+
|
|
112
|
+
def package_manager_from_manifest(manifest: dict) -> str | None:
|
|
113
|
+
raw_value = manifest.get("packageManager")
|
|
114
|
+
if not isinstance(raw_value, str) or not raw_value.strip():
|
|
115
|
+
return None
|
|
116
|
+
manager = raw_value.split("@", 1)[0].strip().lower()
|
|
117
|
+
if manager in {"bun", "pnpm", "npm", "yarn"}:
|
|
118
|
+
return manager
|
|
119
|
+
return None
|
|
120
|
+
|
|
121
|
+
|
|
122
|
+
def read_text_file(path: Path) -> str | None:
|
|
123
|
+
try:
|
|
124
|
+
return path.read_text(errors="ignore")
|
|
125
|
+
except OSError:
|
|
126
|
+
return None
|
|
127
|
+
|
|
128
|
+
|
|
129
|
+
def package_manager_from_text(raw_text: str) -> str | None:
|
|
130
|
+
match = re.search(
|
|
131
|
+
r'(?mi)^[ \t]*["\']?packageManager["\']?[ \t]*:[ \t]*["\']?([^"\',\n\r#]+)',
|
|
132
|
+
raw_text,
|
|
133
|
+
)
|
|
134
|
+
if match is None:
|
|
135
|
+
return None
|
|
136
|
+
|
|
137
|
+
value = match.group(1).strip()
|
|
138
|
+
manager = value.split("@", 1)[0].strip().lower()
|
|
139
|
+
if manager in {"bun", "pnpm", "npm", "yarn"}:
|
|
140
|
+
return manager
|
|
141
|
+
return None
|
|
142
|
+
|
|
143
|
+
|
|
144
|
+
def manifest_text_uses_vitest(raw_text: str) -> bool:
|
|
145
|
+
return re.search(r"\bvitest\b", raw_text) is not None
|
|
146
|
+
|
|
147
|
+
|
|
148
|
+
def detect_package_manager_with_root(start: Path) -> tuple[str | None, Path | None]:
|
|
149
|
+
for directory in iter_ancestors(start):
|
|
150
|
+
for manifest_path in manifests_for_directory(directory):
|
|
151
|
+
if manifest_path.name == "package.json":
|
|
152
|
+
manifest = read_package_json(manifest_path)
|
|
153
|
+
if manifest is not None:
|
|
154
|
+
from_manifest = package_manager_from_manifest(manifest)
|
|
155
|
+
if from_manifest is not None:
|
|
156
|
+
return (from_manifest, directory)
|
|
157
|
+
|
|
158
|
+
raw_text = read_text_file(manifest_path)
|
|
159
|
+
if raw_text is not None:
|
|
160
|
+
from_text = package_manager_from_text(raw_text)
|
|
161
|
+
if from_text is not None:
|
|
162
|
+
return (from_text, directory)
|
|
163
|
+
|
|
164
|
+
from_lockfile = package_manager_from_lockfiles(directory)
|
|
165
|
+
if from_lockfile is not None:
|
|
166
|
+
return (from_lockfile, directory)
|
|
167
|
+
return (None, None)
|
|
168
|
+
|
|
169
|
+
|
|
170
|
+
def read_package_json(path: Path) -> dict | None:
|
|
171
|
+
try:
|
|
172
|
+
raw = path.read_text()
|
|
173
|
+
parsed = json.loads(raw)
|
|
174
|
+
except (OSError, json.JSONDecodeError):
|
|
175
|
+
return None
|
|
176
|
+
if isinstance(parsed, dict):
|
|
177
|
+
return parsed
|
|
178
|
+
return None
|
|
179
|
+
|
|
180
|
+
|
|
181
|
+
def manifest_uses_vitest(manifest: dict) -> bool:
|
|
182
|
+
dependency_fields = (
|
|
183
|
+
"dependencies",
|
|
184
|
+
"devDependencies",
|
|
185
|
+
"peerDependencies",
|
|
186
|
+
"optionalDependencies",
|
|
187
|
+
)
|
|
188
|
+
for field in dependency_fields:
|
|
189
|
+
deps = manifest.get(field)
|
|
190
|
+
if isinstance(deps, dict) and "vitest" in deps:
|
|
191
|
+
return True
|
|
192
|
+
|
|
193
|
+
scripts = manifest.get("scripts")
|
|
194
|
+
if isinstance(scripts, dict):
|
|
195
|
+
for script in scripts.values():
|
|
196
|
+
if isinstance(script, str) and "vitest" in script:
|
|
197
|
+
return True
|
|
198
|
+
|
|
199
|
+
return False
|
|
200
|
+
|
|
201
|
+
|
|
202
|
+
def find_project_root(start: Path) -> Path | None:
|
|
203
|
+
for directory in iter_ancestors(start):
|
|
204
|
+
if package_manager_from_lockfiles(directory) is not None:
|
|
205
|
+
return directory
|
|
206
|
+
if manifests_for_directory(directory):
|
|
207
|
+
return directory
|
|
208
|
+
return None
|
|
209
|
+
|
|
210
|
+
|
|
211
|
+
def iter_to_ancestor(start: Path, ancestor: Path):
|
|
212
|
+
current = start.resolve()
|
|
213
|
+
target = ancestor.resolve()
|
|
214
|
+
while True:
|
|
215
|
+
yield current
|
|
216
|
+
if current == target:
|
|
217
|
+
break
|
|
218
|
+
if current.parent == current:
|
|
219
|
+
break
|
|
220
|
+
current = current.parent
|
|
221
|
+
|
|
222
|
+
|
|
223
|
+
def detect_vitest_usage_in_project(project_root: Path, manager_root: Path | None) -> bool:
|
|
224
|
+
stop_at = manager_root.resolve() if manager_root is not None else project_root.resolve()
|
|
225
|
+
for directory in iter_to_ancestor(project_root, stop_at):
|
|
226
|
+
for manifest_path in manifests_for_directory(directory):
|
|
227
|
+
if manifest_path.name == "package.json":
|
|
228
|
+
manifest = read_package_json(manifest_path)
|
|
229
|
+
if manifest and manifest_uses_vitest(manifest):
|
|
230
|
+
return True
|
|
231
|
+
|
|
232
|
+
raw_text = read_text_file(manifest_path)
|
|
233
|
+
if raw_text is not None and manifest_text_uses_vitest(raw_text):
|
|
234
|
+
return True
|
|
235
|
+
|
|
236
|
+
if (stop_at / "node_modules" / "vitest" / "package.json").exists():
|
|
237
|
+
return True
|
|
238
|
+
|
|
239
|
+
for lockfile in lockfiles_for_directory(stop_at):
|
|
240
|
+
try:
|
|
241
|
+
if "vitest" in lockfile.read_text(errors="ignore"):
|
|
242
|
+
return True
|
|
243
|
+
except OSError:
|
|
244
|
+
continue
|
|
245
|
+
|
|
246
|
+
return False
|
|
247
|
+
|
|
248
|
+
|
|
249
|
+
def choose_test_template(mode: str, package_manager: str | None, uses_vitest: bool) -> tuple[str, str]:
|
|
250
|
+
if package_manager == "bun" and not uses_vitest:
|
|
251
|
+
return (f"{mode}-command.bun-test.ts.tpl", "bun:test")
|
|
252
|
+
return (f"{mode}-command.test.ts.tpl", "vitest")
|
|
253
|
+
|
|
254
|
+
|
|
255
|
+
def choose_test_command(package_manager: str | None, test_framework: str, test_path: str) -> str:
|
|
256
|
+
if test_framework == "bun:test":
|
|
257
|
+
return f"bun test {test_path}"
|
|
258
|
+
if package_manager == "bun":
|
|
259
|
+
return f"bun test {test_path}"
|
|
260
|
+
if package_manager == "pnpm":
|
|
261
|
+
return f"pnpm vitest run {test_path}"
|
|
262
|
+
if package_manager == "yarn":
|
|
263
|
+
return f"yarn vitest run {test_path}"
|
|
264
|
+
return f"npx vitest run {test_path}"
|
|
265
|
+
|
|
266
|
+
|
|
267
|
+
def format_run_path(path: Path, cwd: Path) -> str:
|
|
268
|
+
try:
|
|
269
|
+
relative = path.relative_to(cwd).as_posix()
|
|
270
|
+
if not relative.startswith((".", "..")):
|
|
271
|
+
return f"./{relative}"
|
|
272
|
+
return relative
|
|
273
|
+
except ValueError:
|
|
274
|
+
return path.as_posix()
|
|
275
|
+
|
|
276
|
+
|
|
277
|
+
def main() -> int:
|
|
278
|
+
parser = argparse.ArgumentParser(description="Scaffold Bun-first DreamCLI starter files from templates.")
|
|
279
|
+
parser.add_argument("--name", required=True, help="CLI name (e.g. mycli)")
|
|
280
|
+
parser.add_argument(
|
|
281
|
+
"--mode",
|
|
282
|
+
choices=["single", "multi"],
|
|
283
|
+
default="single",
|
|
284
|
+
help="Starter shape. single=one root command, multi=nested command groups.",
|
|
285
|
+
)
|
|
286
|
+
parser.add_argument("--out", required=True, help="Output directory")
|
|
287
|
+
parser.add_argument(
|
|
288
|
+
"--no-test",
|
|
289
|
+
action="store_true",
|
|
290
|
+
help="Skip generating the starter test file.",
|
|
291
|
+
)
|
|
292
|
+
parser.add_argument(
|
|
293
|
+
"--force",
|
|
294
|
+
action="store_true",
|
|
295
|
+
help="Overwrite existing files if present.",
|
|
296
|
+
)
|
|
297
|
+
args = parser.parse_args()
|
|
298
|
+
|
|
299
|
+
cli_name = normalize_name(args.name)
|
|
300
|
+
if not cli_name:
|
|
301
|
+
print("[ERROR] --name must include at least one letter or digit.")
|
|
302
|
+
return 1
|
|
303
|
+
|
|
304
|
+
output_dir = Path(args.out).resolve()
|
|
305
|
+
output_dir.mkdir(parents=True, exist_ok=True)
|
|
306
|
+
|
|
307
|
+
skill_root = Path(__file__).resolve().parent.parent
|
|
308
|
+
templates_dir = skill_root / "assets" / "templates"
|
|
309
|
+
|
|
310
|
+
entry_template_path = templates_dir / f"{args.mode}-command.ts.tpl"
|
|
311
|
+
test_template_path = templates_dir / f"{args.mode}-command.test.ts.tpl"
|
|
312
|
+
|
|
313
|
+
entry_filename = f"{cli_name}.ts"
|
|
314
|
+
entry_path = output_dir / entry_filename
|
|
315
|
+
test_path = output_dir / f"{cli_name}.test.ts"
|
|
316
|
+
include_test = not args.no_test
|
|
317
|
+
project_root = find_project_root(output_dir) or find_project_root(Path.cwd()) or output_dir
|
|
318
|
+
package_manager, manager_root = detect_package_manager_with_root(project_root)
|
|
319
|
+
uses_vitest = detect_vitest_usage_in_project(project_root, manager_root)
|
|
320
|
+
test_framework = "none"
|
|
321
|
+
|
|
322
|
+
replacements = {
|
|
323
|
+
"__CLI_NAME__": cli_name,
|
|
324
|
+
"__ENTRY_FILE__": f"./{entry_filename}",
|
|
325
|
+
}
|
|
326
|
+
|
|
327
|
+
try:
|
|
328
|
+
entry_template = read_template(entry_template_path)
|
|
329
|
+
entry_content = render_template(entry_template, replacements)
|
|
330
|
+
write_file(entry_path, entry_content, args.force)
|
|
331
|
+
print(f"[OK] Wrote {entry_path}")
|
|
332
|
+
|
|
333
|
+
if include_test:
|
|
334
|
+
test_template_name, test_framework = choose_test_template(args.mode, package_manager, uses_vitest)
|
|
335
|
+
test_template_path = templates_dir / test_template_name
|
|
336
|
+
test_template = read_template(test_template_path)
|
|
337
|
+
test_content = render_template(test_template, replacements)
|
|
338
|
+
write_file(test_path, test_content, args.force)
|
|
339
|
+
print(f"[OK] Wrote {test_path}")
|
|
340
|
+
except (FileExistsError, FileNotFoundError) as error:
|
|
341
|
+
print(f"[ERROR] {error}")
|
|
342
|
+
return 1
|
|
343
|
+
|
|
344
|
+
print("\nNext steps:")
|
|
345
|
+
run_path = format_run_path(entry_path, Path.cwd())
|
|
346
|
+
test_run_path = format_run_path(test_path, Path.cwd())
|
|
347
|
+
print(f"1. Run: bun {run_path} --help")
|
|
348
|
+
if include_test:
|
|
349
|
+
test_command = choose_test_command(package_manager, test_framework, test_run_path)
|
|
350
|
+
print(f"2. Test: {test_command}")
|
|
351
|
+
if test_framework == "bun:test":
|
|
352
|
+
print(" Detected Bun without vitest; generated a bun:test starter test.")
|
|
353
|
+
else:
|
|
354
|
+
print("2. Re-run without --no-test to include a starter test file")
|
|
355
|
+
print("3. Adapt commands, flags, and prompts to the user request")
|
|
356
|
+
return 0
|
|
357
|
+
|
|
358
|
+
|
|
359
|
+
if __name__ == "__main__":
|
|
360
|
+
sys.exit(main())
|
|
@@ -1,144 +0,0 @@
|
|
|
1
|
-
//#region src/core/schema-dsl/runtime.d.ts
|
|
2
|
-
/**
|
|
3
|
-
* Runtime schema string parser.
|
|
4
|
-
*
|
|
5
|
-
* Parses the same string literals as the compile-time {@link Parse} type,
|
|
6
|
-
* producing a runtime AST ({@link SchemaNode}) that mirrors the inferred
|
|
7
|
-
* TypeScript type. The AST can drive JSON Schema generation, validation,
|
|
8
|
-
* and introspection — all from the same source string.
|
|
9
|
-
*
|
|
10
|
-
* Grammar (matches the type-level parser in `parse.ts`):
|
|
11
|
-
* ```
|
|
12
|
-
* value = union
|
|
13
|
-
* union = postfix ('|' postfix)*
|
|
14
|
-
* postfix = primary ('[]')*
|
|
15
|
-
* primary = object | record | ref | literal | IDENT
|
|
16
|
-
* object = '{' properties '}'
|
|
17
|
-
* properties = (property ';')* property? ';'?
|
|
18
|
-
* property = IDENT '?'? ':' value
|
|
19
|
-
* record = 'Record' '<' value ',' value '>'
|
|
20
|
-
* ref = '@' IDENT
|
|
21
|
-
* literal = "'" CHARS "'"
|
|
22
|
-
* ```
|
|
23
|
-
*
|
|
24
|
-
* @module dreamcli/core/schema-dsl/runtime
|
|
25
|
-
*/
|
|
26
|
-
/** Discriminated union of all schema AST nodes. */
|
|
27
|
-
type SchemaNode = StringNode | NumberNode | IntegerNode | BooleanNode | LiteralTrueNode | LiteralFalseNode | LiteralNullNode | LiteralStringNode | LiteralUndefinedNode | UnknownNode | NeverNode | ArrayNode | ObjectNode | UnionNode | RefNode | RecordNode;
|
|
28
|
-
/** String primitive. */
|
|
29
|
-
interface StringNode {
|
|
30
|
-
/** Identifies this node as a string type. */
|
|
31
|
-
readonly kind: 'string';
|
|
32
|
-
}
|
|
33
|
-
/** Number primitive. */
|
|
34
|
-
interface NumberNode {
|
|
35
|
-
/** Identifies this node as a number type. */
|
|
36
|
-
readonly kind: 'number';
|
|
37
|
-
}
|
|
38
|
-
/** Integer primitive (maps to `number` in TS, `integer` in JSON Schema). */
|
|
39
|
-
interface IntegerNode {
|
|
40
|
-
/** Identifies this node as an integer type. */
|
|
41
|
-
readonly kind: 'integer';
|
|
42
|
-
}
|
|
43
|
-
/** Boolean primitive. */
|
|
44
|
-
interface BooleanNode {
|
|
45
|
-
/** Identifies this node as a boolean type. */
|
|
46
|
-
readonly kind: 'boolean';
|
|
47
|
-
}
|
|
48
|
-
/** Literal `true`. */
|
|
49
|
-
interface LiteralTrueNode {
|
|
50
|
-
/** Identifies this node as the literal `true` value. */
|
|
51
|
-
readonly kind: 'true';
|
|
52
|
-
}
|
|
53
|
-
/** Literal `false`. */
|
|
54
|
-
interface LiteralFalseNode {
|
|
55
|
-
/** Identifies this node as the literal `false` value. */
|
|
56
|
-
readonly kind: 'false';
|
|
57
|
-
}
|
|
58
|
-
/** Literal `null`. */
|
|
59
|
-
interface LiteralNullNode {
|
|
60
|
-
/** Identifies this node as the literal `null` value. */
|
|
61
|
-
readonly kind: 'null';
|
|
62
|
-
}
|
|
63
|
-
/** String literal value (e.g. `'confirm'`). */
|
|
64
|
-
interface LiteralStringNode {
|
|
65
|
-
/** Identifies this node as a string literal. */
|
|
66
|
-
readonly kind: 'literal';
|
|
67
|
-
/** The exact string value this literal represents. */
|
|
68
|
-
readonly value: string;
|
|
69
|
-
}
|
|
70
|
-
/** Literal `undefined`. */
|
|
71
|
-
interface LiteralUndefinedNode {
|
|
72
|
-
/** Identifies this node as the literal `undefined` value. */
|
|
73
|
-
readonly kind: 'undefined';
|
|
74
|
-
}
|
|
75
|
-
/** The `unknown` top type. */
|
|
76
|
-
interface UnknownNode {
|
|
77
|
-
/** Identifies this node as the `unknown` top type. */
|
|
78
|
-
readonly kind: 'unknown';
|
|
79
|
-
}
|
|
80
|
-
/** The `never` bottom type. */
|
|
81
|
-
interface NeverNode {
|
|
82
|
-
/** Identifies this node as the `never` bottom type. */
|
|
83
|
-
readonly kind: 'never';
|
|
84
|
-
}
|
|
85
|
-
/** Array of element type. */
|
|
86
|
-
interface ArrayNode {
|
|
87
|
-
/** Identifies this node as an array type. */
|
|
88
|
-
readonly kind: 'array';
|
|
89
|
-
/** The type of each array element. */
|
|
90
|
-
readonly element: SchemaNode;
|
|
91
|
-
}
|
|
92
|
-
/** Object with named properties. */
|
|
93
|
-
interface ObjectNode {
|
|
94
|
-
/** Identifies this node as an object type. */
|
|
95
|
-
readonly kind: 'object';
|
|
96
|
-
/** Named properties keyed by field name. */
|
|
97
|
-
readonly properties: Readonly<Record<string, PropertyNode>>;
|
|
98
|
-
}
|
|
99
|
-
/** Union of two or more member types. */
|
|
100
|
-
interface UnionNode {
|
|
101
|
-
/** Identifies this node as a union type. */
|
|
102
|
-
readonly kind: 'union';
|
|
103
|
-
/** The constituent types of this union. */
|
|
104
|
-
readonly members: readonly SchemaNode[];
|
|
105
|
-
}
|
|
106
|
-
/** Reference to a named definition (e.g. `@flag` → `$ref: '#/$defs/flag'`). */
|
|
107
|
-
interface RefNode {
|
|
108
|
-
/** Identifies this node as a `$ref` reference. */
|
|
109
|
-
readonly kind: 'ref';
|
|
110
|
-
/** Name of the referenced definition (without the `@` prefix). */
|
|
111
|
-
readonly target: string;
|
|
112
|
-
}
|
|
113
|
-
/** Record/dictionary type (e.g. `Record<string, @flag>`). */
|
|
114
|
-
interface RecordNode {
|
|
115
|
-
/** Identifies this node as a record/dictionary type. */
|
|
116
|
-
readonly kind: 'record';
|
|
117
|
-
/** The type of each record value (keys are always strings). */
|
|
118
|
-
readonly value: SchemaNode;
|
|
119
|
-
}
|
|
120
|
-
/** A named property with optionality flag. */
|
|
121
|
-
interface PropertyNode {
|
|
122
|
-
/** Whether the property is optional (`?` suffix in the schema DSL). */
|
|
123
|
-
readonly optional: boolean;
|
|
124
|
-
/** The property's value type. */
|
|
125
|
-
readonly schema: SchemaNode;
|
|
126
|
-
}
|
|
127
|
-
/**
|
|
128
|
-
* Parse a schema source string into a runtime AST.
|
|
129
|
-
*
|
|
130
|
-
* @param source - Schema string (e.g. `"{ name: string; age: number }"`).
|
|
131
|
-
* @returns The root {@link SchemaNode}.
|
|
132
|
-
* @throws {@link SyntaxError} on malformed input.
|
|
133
|
-
*/
|
|
134
|
-
declare function parseSchema(source: string): SchemaNode;
|
|
135
|
-
/**
|
|
136
|
-
* Validate that `input` conforms to the given AST node.
|
|
137
|
-
*
|
|
138
|
-
* @param node - The schema AST to validate against.
|
|
139
|
-
* @param input - The value to check.
|
|
140
|
-
* @returns `true` if the value matches the schema.
|
|
141
|
-
*/
|
|
142
|
-
declare function validateNode(node: SchemaNode, input: unknown): boolean;
|
|
143
|
-
//#endregion
|
|
144
|
-
export { type ArrayNode, type BooleanNode, type IntegerNode, type LiteralFalseNode, type LiteralNullNode, type LiteralStringNode, type LiteralTrueNode, type LiteralUndefinedNode, type NeverNode, type NumberNode, type ObjectNode, type PropertyNode, type RecordNode, type RefNode, type SchemaNode, type StringNode, type UnionNode, type UnknownNode, parseSchema, validateNode };
|