@colbymchenry/codegraph-darwin-arm64 0.9.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/bin/codegraph +3 -0
- package/lib/dist/bin/codegraph.d.ts +21 -0
- package/lib/dist/bin/codegraph.d.ts.map +1 -0
- package/lib/dist/bin/codegraph.js +1273 -0
- package/lib/dist/bin/codegraph.js.map +1 -0
- package/lib/dist/bin/node-version-check.d.ts +37 -0
- package/lib/dist/bin/node-version-check.d.ts.map +1 -0
- package/lib/dist/bin/node-version-check.js +79 -0
- package/lib/dist/bin/node-version-check.js.map +1 -0
- package/lib/dist/bin/uninstall.d.ts +14 -0
- package/lib/dist/bin/uninstall.d.ts.map +1 -0
- package/lib/dist/bin/uninstall.js +36 -0
- package/lib/dist/bin/uninstall.js.map +1 -0
- package/lib/dist/config.d.ts +51 -0
- package/lib/dist/config.d.ts.map +1 -0
- package/lib/dist/config.js +321 -0
- package/lib/dist/config.js.map +1 -0
- package/lib/dist/context/formatter.d.ts +30 -0
- package/lib/dist/context/formatter.d.ts.map +1 -0
- package/lib/dist/context/formatter.js +244 -0
- package/lib/dist/context/formatter.js.map +1 -0
- package/lib/dist/context/index.d.ts +97 -0
- package/lib/dist/context/index.d.ts.map +1 -0
- package/lib/dist/context/index.js +1050 -0
- package/lib/dist/context/index.js.map +1 -0
- package/lib/dist/db/index.d.ts +83 -0
- package/lib/dist/db/index.d.ts.map +1 -0
- package/lib/dist/db/index.js +219 -0
- package/lib/dist/db/index.js.map +1 -0
- package/lib/dist/db/migrations.d.ts +44 -0
- package/lib/dist/db/migrations.d.ts.map +1 -0
- package/lib/dist/db/migrations.js +131 -0
- package/lib/dist/db/migrations.js.map +1 -0
- package/lib/dist/db/queries.d.ts +253 -0
- package/lib/dist/db/queries.d.ts.map +1 -0
- package/lib/dist/db/queries.js +1207 -0
- package/lib/dist/db/queries.js.map +1 -0
- package/lib/dist/db/schema.sql +151 -0
- package/lib/dist/db/sqlite-adapter.d.ts +46 -0
- package/lib/dist/db/sqlite-adapter.d.ts.map +1 -0
- package/lib/dist/db/sqlite-adapter.js +114 -0
- package/lib/dist/db/sqlite-adapter.js.map +1 -0
- package/lib/dist/directory.d.ts +57 -0
- package/lib/dist/directory.d.ts.map +1 -0
- package/lib/dist/directory.js +264 -0
- package/lib/dist/directory.js.map +1 -0
- package/lib/dist/errors.d.ts +136 -0
- package/lib/dist/errors.d.ts.map +1 -0
- package/lib/dist/errors.js +219 -0
- package/lib/dist/errors.js.map +1 -0
- package/lib/dist/extraction/dfm-extractor.d.ts +31 -0
- package/lib/dist/extraction/dfm-extractor.d.ts.map +1 -0
- package/lib/dist/extraction/dfm-extractor.js +151 -0
- package/lib/dist/extraction/dfm-extractor.js.map +1 -0
- package/lib/dist/extraction/grammars.d.ts +78 -0
- package/lib/dist/extraction/grammars.d.ts.map +1 -0
- package/lib/dist/extraction/grammars.js +332 -0
- package/lib/dist/extraction/grammars.js.map +1 -0
- package/lib/dist/extraction/index.d.ts +130 -0
- package/lib/dist/extraction/index.d.ts.map +1 -0
- package/lib/dist/extraction/index.js +1305 -0
- package/lib/dist/extraction/index.js.map +1 -0
- package/lib/dist/extraction/languages/c-cpp.d.ts +4 -0
- package/lib/dist/extraction/languages/c-cpp.d.ts.map +1 -0
- package/lib/dist/extraction/languages/c-cpp.js +126 -0
- package/lib/dist/extraction/languages/c-cpp.js.map +1 -0
- package/lib/dist/extraction/languages/csharp.d.ts +3 -0
- package/lib/dist/extraction/languages/csharp.d.ts.map +1 -0
- package/lib/dist/extraction/languages/csharp.js +72 -0
- package/lib/dist/extraction/languages/csharp.js.map +1 -0
- package/lib/dist/extraction/languages/dart.d.ts +3 -0
- package/lib/dist/extraction/languages/dart.d.ts.map +1 -0
- package/lib/dist/extraction/languages/dart.js +192 -0
- package/lib/dist/extraction/languages/dart.js.map +1 -0
- package/lib/dist/extraction/languages/go.d.ts +3 -0
- package/lib/dist/extraction/languages/go.d.ts.map +1 -0
- package/lib/dist/extraction/languages/go.js +58 -0
- package/lib/dist/extraction/languages/go.js.map +1 -0
- package/lib/dist/extraction/languages/index.d.ts +10 -0
- package/lib/dist/extraction/languages/index.d.ts.map +1 -0
- package/lib/dist/extraction/languages/index.js +49 -0
- package/lib/dist/extraction/languages/index.js.map +1 -0
- package/lib/dist/extraction/languages/java.d.ts +3 -0
- package/lib/dist/extraction/languages/java.d.ts.map +1 -0
- package/lib/dist/extraction/languages/java.js +64 -0
- package/lib/dist/extraction/languages/java.js.map +1 -0
- package/lib/dist/extraction/languages/javascript.d.ts +3 -0
- package/lib/dist/extraction/languages/javascript.d.ts.map +1 -0
- package/lib/dist/extraction/languages/javascript.js +90 -0
- package/lib/dist/extraction/languages/javascript.js.map +1 -0
- package/lib/dist/extraction/languages/kotlin.d.ts +3 -0
- package/lib/dist/extraction/languages/kotlin.d.ts.map +1 -0
- package/lib/dist/extraction/languages/kotlin.js +253 -0
- package/lib/dist/extraction/languages/kotlin.js.map +1 -0
- package/lib/dist/extraction/languages/lua.d.ts +3 -0
- package/lib/dist/extraction/languages/lua.d.ts.map +1 -0
- package/lib/dist/extraction/languages/lua.js +150 -0
- package/lib/dist/extraction/languages/lua.js.map +1 -0
- package/lib/dist/extraction/languages/luau.d.ts +3 -0
- package/lib/dist/extraction/languages/luau.d.ts.map +1 -0
- package/lib/dist/extraction/languages/luau.js +37 -0
- package/lib/dist/extraction/languages/luau.js.map +1 -0
- package/lib/dist/extraction/languages/pascal.d.ts +3 -0
- package/lib/dist/extraction/languages/pascal.d.ts.map +1 -0
- package/lib/dist/extraction/languages/pascal.js +66 -0
- package/lib/dist/extraction/languages/pascal.js.map +1 -0
- package/lib/dist/extraction/languages/php.d.ts +3 -0
- package/lib/dist/extraction/languages/php.d.ts.map +1 -0
- package/lib/dist/extraction/languages/php.js +107 -0
- package/lib/dist/extraction/languages/php.js.map +1 -0
- package/lib/dist/extraction/languages/python.d.ts +3 -0
- package/lib/dist/extraction/languages/python.d.ts.map +1 -0
- package/lib/dist/extraction/languages/python.js +56 -0
- package/lib/dist/extraction/languages/python.js.map +1 -0
- package/lib/dist/extraction/languages/ruby.d.ts +3 -0
- package/lib/dist/extraction/languages/ruby.d.ts.map +1 -0
- package/lib/dist/extraction/languages/ruby.js +114 -0
- package/lib/dist/extraction/languages/ruby.js.map +1 -0
- package/lib/dist/extraction/languages/rust.d.ts +3 -0
- package/lib/dist/extraction/languages/rust.d.ts.map +1 -0
- package/lib/dist/extraction/languages/rust.js +109 -0
- package/lib/dist/extraction/languages/rust.js.map +1 -0
- package/lib/dist/extraction/languages/scala.d.ts +3 -0
- package/lib/dist/extraction/languages/scala.d.ts.map +1 -0
- package/lib/dist/extraction/languages/scala.js +139 -0
- package/lib/dist/extraction/languages/scala.js.map +1 -0
- package/lib/dist/extraction/languages/swift.d.ts +3 -0
- package/lib/dist/extraction/languages/swift.d.ts.map +1 -0
- package/lib/dist/extraction/languages/swift.js +91 -0
- package/lib/dist/extraction/languages/swift.js.map +1 -0
- package/lib/dist/extraction/languages/typescript.d.ts +3 -0
- package/lib/dist/extraction/languages/typescript.d.ts.map +1 -0
- package/lib/dist/extraction/languages/typescript.js +129 -0
- package/lib/dist/extraction/languages/typescript.js.map +1 -0
- package/lib/dist/extraction/liquid-extractor.d.ts +52 -0
- package/lib/dist/extraction/liquid-extractor.d.ts.map +1 -0
- package/lib/dist/extraction/liquid-extractor.js +313 -0
- package/lib/dist/extraction/liquid-extractor.js.map +1 -0
- package/lib/dist/extraction/parse-worker.d.ts +8 -0
- package/lib/dist/extraction/parse-worker.d.ts.map +1 -0
- package/lib/dist/extraction/parse-worker.js +94 -0
- package/lib/dist/extraction/parse-worker.js.map +1 -0
- package/lib/dist/extraction/svelte-extractor.d.ts +56 -0
- package/lib/dist/extraction/svelte-extractor.d.ts.map +1 -0
- package/lib/dist/extraction/svelte-extractor.js +272 -0
- package/lib/dist/extraction/svelte-extractor.js.map +1 -0
- package/lib/dist/extraction/tree-sitter-helpers.d.ts +28 -0
- package/lib/dist/extraction/tree-sitter-helpers.d.ts.map +1 -0
- package/lib/dist/extraction/tree-sitter-helpers.js +103 -0
- package/lib/dist/extraction/tree-sitter-helpers.js.map +1 -0
- package/lib/dist/extraction/tree-sitter-types.d.ts +179 -0
- package/lib/dist/extraction/tree-sitter-types.d.ts.map +1 -0
- package/lib/dist/extraction/tree-sitter-types.js +10 -0
- package/lib/dist/extraction/tree-sitter-types.js.map +1 -0
- package/lib/dist/extraction/tree-sitter.d.ts +233 -0
- package/lib/dist/extraction/tree-sitter.d.ts.map +1 -0
- package/lib/dist/extraction/tree-sitter.js +2425 -0
- package/lib/dist/extraction/tree-sitter.js.map +1 -0
- package/lib/dist/extraction/vue-extractor.d.ts +36 -0
- package/lib/dist/extraction/vue-extractor.d.ts.map +1 -0
- package/lib/dist/extraction/vue-extractor.js +163 -0
- package/lib/dist/extraction/vue-extractor.js.map +1 -0
- package/lib/dist/extraction/wasm/tree-sitter-lua.wasm +0 -0
- package/lib/dist/extraction/wasm/tree-sitter-luau.wasm +0 -0
- package/lib/dist/extraction/wasm/tree-sitter-pascal.wasm +0 -0
- package/lib/dist/extraction/wasm/tree-sitter-scala.wasm +0 -0
- package/lib/dist/graph/index.d.ts +8 -0
- package/lib/dist/graph/index.d.ts.map +1 -0
- package/lib/dist/graph/index.js +13 -0
- package/lib/dist/graph/index.js.map +1 -0
- package/lib/dist/graph/queries.d.ts +106 -0
- package/lib/dist/graph/queries.d.ts.map +1 -0
- package/lib/dist/graph/queries.js +366 -0
- package/lib/dist/graph/queries.js.map +1 -0
- package/lib/dist/graph/traversal.d.ts +127 -0
- package/lib/dist/graph/traversal.d.ts.map +1 -0
- package/lib/dist/graph/traversal.js +493 -0
- package/lib/dist/graph/traversal.js.map +1 -0
- package/lib/dist/index.d.ts +453 -0
- package/lib/dist/index.d.ts.map +1 -0
- package/lib/dist/index.js +833 -0
- package/lib/dist/index.js.map +1 -0
- package/lib/dist/installer/claude-md-template.d.ts +14 -0
- package/lib/dist/installer/claude-md-template.d.ts.map +1 -0
- package/lib/dist/installer/claude-md-template.js +21 -0
- package/lib/dist/installer/claude-md-template.js.map +1 -0
- package/lib/dist/installer/config-writer.d.ts +29 -0
- package/lib/dist/installer/config-writer.d.ts.map +1 -0
- package/lib/dist/installer/config-writer.js +111 -0
- package/lib/dist/installer/config-writer.js.map +1 -0
- package/lib/dist/installer/index.d.ts +65 -0
- package/lib/dist/installer/index.d.ts.map +1 -0
- package/lib/dist/installer/index.js +406 -0
- package/lib/dist/installer/index.js.map +1 -0
- package/lib/dist/installer/instructions-template.d.ts +28 -0
- package/lib/dist/installer/instructions-template.d.ts.map +1 -0
- package/lib/dist/installer/instructions-template.js +64 -0
- package/lib/dist/installer/instructions-template.js.map +1 -0
- package/lib/dist/installer/targets/claude.d.ts +47 -0
- package/lib/dist/installer/targets/claude.d.ts.map +1 -0
- package/lib/dist/installer/targets/claude.js +401 -0
- package/lib/dist/installer/targets/claude.js.map +1 -0
- package/lib/dist/installer/targets/codex.d.ts +18 -0
- package/lib/dist/installer/targets/codex.d.ts.map +1 -0
- package/lib/dist/installer/targets/codex.js +185 -0
- package/lib/dist/installer/targets/codex.js.map +1 -0
- package/lib/dist/installer/targets/cursor.d.ts +35 -0
- package/lib/dist/installer/targets/cursor.d.ts.map +1 -0
- package/lib/dist/installer/targets/cursor.js +229 -0
- package/lib/dist/installer/targets/cursor.js.map +1 -0
- package/lib/dist/installer/targets/opencode.d.ts +30 -0
- package/lib/dist/installer/targets/opencode.d.ts.map +1 -0
- package/lib/dist/installer/targets/opencode.js +235 -0
- package/lib/dist/installer/targets/opencode.js.map +1 -0
- package/lib/dist/installer/targets/registry.d.ts +35 -0
- package/lib/dist/installer/targets/registry.d.ts.map +1 -0
- package/lib/dist/installer/targets/registry.js +83 -0
- package/lib/dist/installer/targets/registry.js.map +1 -0
- package/lib/dist/installer/targets/shared.d.ts +77 -0
- package/lib/dist/installer/targets/shared.d.ts.map +1 -0
- package/lib/dist/installer/targets/shared.js +246 -0
- package/lib/dist/installer/targets/shared.js.map +1 -0
- package/lib/dist/installer/targets/toml.d.ts +52 -0
- package/lib/dist/installer/targets/toml.d.ts.map +1 -0
- package/lib/dist/installer/targets/toml.js +147 -0
- package/lib/dist/installer/targets/toml.js.map +1 -0
- package/lib/dist/installer/targets/types.d.ts +116 -0
- package/lib/dist/installer/targets/types.d.ts.map +1 -0
- package/lib/dist/installer/targets/types.js +16 -0
- package/lib/dist/installer/targets/types.js.map +1 -0
- package/lib/dist/mcp/index.d.ts +94 -0
- package/lib/dist/mcp/index.d.ts.map +1 -0
- package/lib/dist/mcp/index.js +453 -0
- package/lib/dist/mcp/index.js.map +1 -0
- package/lib/dist/mcp/server-instructions.d.ts +19 -0
- package/lib/dist/mcp/server-instructions.d.ts.map +1 -0
- package/lib/dist/mcp/server-instructions.js +71 -0
- package/lib/dist/mcp/server-instructions.js.map +1 -0
- package/lib/dist/mcp/tools.d.ts +257 -0
- package/lib/dist/mcp/tools.d.ts.map +1 -0
- package/lib/dist/mcp/tools.js +1646 -0
- package/lib/dist/mcp/tools.js.map +1 -0
- package/lib/dist/mcp/transport.d.ts +106 -0
- package/lib/dist/mcp/transport.d.ts.map +1 -0
- package/lib/dist/mcp/transport.js +233 -0
- package/lib/dist/mcp/transport.js.map +1 -0
- package/lib/dist/resolution/frameworks/cargo-workspace.d.ts +18 -0
- package/lib/dist/resolution/frameworks/cargo-workspace.d.ts.map +1 -0
- package/lib/dist/resolution/frameworks/cargo-workspace.js +225 -0
- package/lib/dist/resolution/frameworks/cargo-workspace.js.map +1 -0
- package/lib/dist/resolution/frameworks/csharp.d.ts +8 -0
- package/lib/dist/resolution/frameworks/csharp.d.ts.map +1 -0
- package/lib/dist/resolution/frameworks/csharp.js +213 -0
- package/lib/dist/resolution/frameworks/csharp.js.map +1 -0
- package/lib/dist/resolution/frameworks/express.d.ts +8 -0
- package/lib/dist/resolution/frameworks/express.d.ts.map +1 -0
- package/lib/dist/resolution/frameworks/express.js +225 -0
- package/lib/dist/resolution/frameworks/express.js.map +1 -0
- package/lib/dist/resolution/frameworks/go.d.ts +8 -0
- package/lib/dist/resolution/frameworks/go.d.ts.map +1 -0
- package/lib/dist/resolution/frameworks/go.js +158 -0
- package/lib/dist/resolution/frameworks/go.js.map +1 -0
- package/lib/dist/resolution/frameworks/index.d.ts +42 -0
- package/lib/dist/resolution/frameworks/index.d.ts.map +1 -0
- package/lib/dist/resolution/frameworks/index.js +133 -0
- package/lib/dist/resolution/frameworks/index.js.map +1 -0
- package/lib/dist/resolution/frameworks/java.d.ts +8 -0
- package/lib/dist/resolution/frameworks/java.d.ts.map +1 -0
- package/lib/dist/resolution/frameworks/java.js +177 -0
- package/lib/dist/resolution/frameworks/java.js.map +1 -0
- package/lib/dist/resolution/frameworks/laravel.d.ts +13 -0
- package/lib/dist/resolution/frameworks/laravel.d.ts.map +1 -0
- package/lib/dist/resolution/frameworks/laravel.js +248 -0
- package/lib/dist/resolution/frameworks/laravel.js.map +1 -0
- package/lib/dist/resolution/frameworks/nestjs.d.ts +26 -0
- package/lib/dist/resolution/frameworks/nestjs.d.ts.map +1 -0
- package/lib/dist/resolution/frameworks/nestjs.js +374 -0
- package/lib/dist/resolution/frameworks/nestjs.js.map +1 -0
- package/lib/dist/resolution/frameworks/python.d.ts +10 -0
- package/lib/dist/resolution/frameworks/python.d.ts.map +1 -0
- package/lib/dist/resolution/frameworks/python.js +278 -0
- package/lib/dist/resolution/frameworks/python.js.map +1 -0
- package/lib/dist/resolution/frameworks/react.d.ts +8 -0
- package/lib/dist/resolution/frameworks/react.d.ts.map +1 -0
- package/lib/dist/resolution/frameworks/react.js +272 -0
- package/lib/dist/resolution/frameworks/react.js.map +1 -0
- package/lib/dist/resolution/frameworks/ruby.d.ts +8 -0
- package/lib/dist/resolution/frameworks/ruby.d.ts.map +1 -0
- package/lib/dist/resolution/frameworks/ruby.js +198 -0
- package/lib/dist/resolution/frameworks/ruby.js.map +1 -0
- package/lib/dist/resolution/frameworks/rust.d.ts +8 -0
- package/lib/dist/resolution/frameworks/rust.d.ts.map +1 -0
- package/lib/dist/resolution/frameworks/rust.js +207 -0
- package/lib/dist/resolution/frameworks/rust.js.map +1 -0
- package/lib/dist/resolution/frameworks/svelte.d.ts +9 -0
- package/lib/dist/resolution/frameworks/svelte.d.ts.map +1 -0
- package/lib/dist/resolution/frameworks/svelte.js +249 -0
- package/lib/dist/resolution/frameworks/svelte.js.map +1 -0
- package/lib/dist/resolution/frameworks/swift.d.ts +10 -0
- package/lib/dist/resolution/frameworks/swift.d.ts.map +1 -0
- package/lib/dist/resolution/frameworks/swift.js +376 -0
- package/lib/dist/resolution/frameworks/swift.js.map +1 -0
- package/lib/dist/resolution/frameworks/vue.d.ts +9 -0
- package/lib/dist/resolution/frameworks/vue.d.ts.map +1 -0
- package/lib/dist/resolution/frameworks/vue.js +306 -0
- package/lib/dist/resolution/frameworks/vue.js.map +1 -0
- package/lib/dist/resolution/import-resolver.d.ts +40 -0
- package/lib/dist/resolution/import-resolver.d.ts.map +1 -0
- package/lib/dist/resolution/import-resolver.js +663 -0
- package/lib/dist/resolution/import-resolver.js.map +1 -0
- package/lib/dist/resolution/index.d.ts +106 -0
- package/lib/dist/resolution/index.d.ts.map +1 -0
- package/lib/dist/resolution/index.js +709 -0
- package/lib/dist/resolution/index.js.map +1 -0
- package/lib/dist/resolution/name-matcher.d.ts +32 -0
- package/lib/dist/resolution/name-matcher.d.ts.map +1 -0
- package/lib/dist/resolution/name-matcher.js +384 -0
- package/lib/dist/resolution/name-matcher.js.map +1 -0
- package/lib/dist/resolution/path-aliases.d.ts +68 -0
- package/lib/dist/resolution/path-aliases.d.ts.map +1 -0
- package/lib/dist/resolution/path-aliases.js +238 -0
- package/lib/dist/resolution/path-aliases.js.map +1 -0
- package/lib/dist/resolution/strip-comments.d.ts +27 -0
- package/lib/dist/resolution/strip-comments.d.ts.map +1 -0
- package/lib/dist/resolution/strip-comments.js +441 -0
- package/lib/dist/resolution/strip-comments.js.map +1 -0
- package/lib/dist/resolution/types.d.ts +172 -0
- package/lib/dist/resolution/types.d.ts.map +1 -0
- package/lib/dist/resolution/types.js +8 -0
- package/lib/dist/resolution/types.js.map +1 -0
- package/lib/dist/search/query-parser.d.ts +57 -0
- package/lib/dist/search/query-parser.d.ts.map +1 -0
- package/lib/dist/search/query-parser.js +177 -0
- package/lib/dist/search/query-parser.js.map +1 -0
- package/lib/dist/search/query-utils.d.ts +53 -0
- package/lib/dist/search/query-utils.d.ts.map +1 -0
- package/lib/dist/search/query-utils.js +350 -0
- package/lib/dist/search/query-utils.js.map +1 -0
- package/lib/dist/sync/git-hooks.d.ts +45 -0
- package/lib/dist/sync/git-hooks.d.ts.map +1 -0
- package/lib/dist/sync/git-hooks.js +223 -0
- package/lib/dist/sync/git-hooks.js.map +1 -0
- package/lib/dist/sync/index.d.ts +17 -0
- package/lib/dist/sync/index.d.ts.map +1 -0
- package/lib/dist/sync/index.js +28 -0
- package/lib/dist/sync/index.js.map +1 -0
- package/lib/dist/sync/watch-policy.d.ts +48 -0
- package/lib/dist/sync/watch-policy.d.ts.map +1 -0
- package/lib/dist/sync/watch-policy.js +124 -0
- package/lib/dist/sync/watch-policy.js.map +1 -0
- package/lib/dist/sync/watcher.d.ts +81 -0
- package/lib/dist/sync/watcher.d.ts.map +1 -0
- package/lib/dist/sync/watcher.js +194 -0
- package/lib/dist/sync/watcher.js.map +1 -0
- package/lib/dist/types.d.ts +423 -0
- package/lib/dist/types.d.ts.map +1 -0
- package/lib/dist/types.js +262 -0
- package/lib/dist/types.js.map +1 -0
- package/lib/dist/ui/glyphs.d.ts +42 -0
- package/lib/dist/ui/glyphs.d.ts.map +1 -0
- package/lib/dist/ui/glyphs.js +78 -0
- package/lib/dist/ui/glyphs.js.map +1 -0
- package/lib/dist/ui/shimmer-progress.d.ts +11 -0
- package/lib/dist/ui/shimmer-progress.d.ts.map +1 -0
- package/lib/dist/ui/shimmer-progress.js +90 -0
- package/lib/dist/ui/shimmer-progress.js.map +1 -0
- package/lib/dist/ui/shimmer-worker.d.ts +2 -0
- package/lib/dist/ui/shimmer-worker.d.ts.map +1 -0
- package/lib/dist/ui/shimmer-worker.js +118 -0
- package/lib/dist/ui/shimmer-worker.js.map +1 -0
- package/lib/dist/ui/types.d.ts +17 -0
- package/lib/dist/ui/types.d.ts.map +1 -0
- package/lib/dist/ui/types.js +3 -0
- package/lib/dist/ui/types.js.map +1 -0
- package/lib/dist/utils.d.ts +205 -0
- package/lib/dist/utils.d.ts.map +1 -0
- package/lib/dist/utils.js +549 -0
- package/lib/dist/utils.js.map +1 -0
- package/lib/node_modules/.package-lock.json +116 -0
- package/lib/node_modules/@clack/core/CHANGELOG.md +348 -0
- package/lib/node_modules/@clack/core/LICENSE +9 -0
- package/lib/node_modules/@clack/core/README.md +22 -0
- package/lib/node_modules/@clack/core/dist/index.d.mts +363 -0
- package/lib/node_modules/@clack/core/dist/index.mjs +17 -0
- package/lib/node_modules/@clack/core/dist/index.mjs.map +1 -0
- package/lib/node_modules/@clack/core/package.json +63 -0
- package/lib/node_modules/@clack/prompts/CHANGELOG.md +591 -0
- package/lib/node_modules/@clack/prompts/LICENSE +9 -0
- package/lib/node_modules/@clack/prompts/README.md +375 -0
- package/lib/node_modules/@clack/prompts/dist/index.d.mts +396 -0
- package/lib/node_modules/@clack/prompts/dist/index.mjs +144 -0
- package/lib/node_modules/@clack/prompts/dist/index.mjs.map +1 -0
- package/lib/node_modules/@clack/prompts/package.json +68 -0
- package/lib/node_modules/commander/LICENSE +22 -0
- package/lib/node_modules/commander/Readme.md +1176 -0
- package/lib/node_modules/commander/esm.mjs +16 -0
- package/lib/node_modules/commander/index.js +24 -0
- package/lib/node_modules/commander/lib/argument.js +150 -0
- package/lib/node_modules/commander/lib/command.js +2777 -0
- package/lib/node_modules/commander/lib/error.js +39 -0
- package/lib/node_modules/commander/lib/help.js +747 -0
- package/lib/node_modules/commander/lib/option.js +380 -0
- package/lib/node_modules/commander/lib/suggestSimilar.js +101 -0
- package/lib/node_modules/commander/package-support.json +19 -0
- package/lib/node_modules/commander/package.json +82 -0
- package/lib/node_modules/commander/typings/esm.d.mts +3 -0
- package/lib/node_modules/commander/typings/index.d.ts +1113 -0
- package/lib/node_modules/fast-string-truncated-width/dist/index.d.ts +4 -0
- package/lib/node_modules/fast-string-truncated-width/dist/index.js +111 -0
- package/lib/node_modules/fast-string-truncated-width/dist/types.d.ts +19 -0
- package/lib/node_modules/fast-string-truncated-width/dist/types.js +2 -0
- package/lib/node_modules/fast-string-truncated-width/dist/utils.d.ts +4 -0
- package/lib/node_modules/fast-string-truncated-width/dist/utils.js +20 -0
- package/lib/node_modules/fast-string-truncated-width/license +21 -0
- package/lib/node_modules/fast-string-truncated-width/package.json +35 -0
- package/lib/node_modules/fast-string-truncated-width/readme.md +59 -0
- package/lib/node_modules/fast-string-width/dist/index.d.ts +4 -0
- package/lib/node_modules/fast-string-width/dist/index.js +14 -0
- package/lib/node_modules/fast-string-width/license +21 -0
- package/lib/node_modules/fast-string-width/package.json +34 -0
- package/lib/node_modules/fast-string-width/readme.md +42 -0
- package/lib/node_modules/fast-wrap-ansi/LICENSE +23 -0
- package/lib/node_modules/fast-wrap-ansi/README.md +26 -0
- package/lib/node_modules/fast-wrap-ansi/lib/main.d.ts +6 -0
- package/lib/node_modules/fast-wrap-ansi/lib/main.js +219 -0
- package/lib/node_modules/fast-wrap-ansi/lib/main.js.map +1 -0
- package/lib/node_modules/fast-wrap-ansi/package.json +51 -0
- package/lib/node_modules/jsonc-parser/CHANGELOG.md +76 -0
- package/lib/node_modules/jsonc-parser/LICENSE.md +21 -0
- package/lib/node_modules/jsonc-parser/README.md +364 -0
- package/lib/node_modules/jsonc-parser/SECURITY.md +41 -0
- package/lib/node_modules/jsonc-parser/lib/esm/impl/edit.js +185 -0
- package/lib/node_modules/jsonc-parser/lib/esm/impl/format.js +261 -0
- package/lib/node_modules/jsonc-parser/lib/esm/impl/parser.js +659 -0
- package/lib/node_modules/jsonc-parser/lib/esm/impl/scanner.js +443 -0
- package/lib/node_modules/jsonc-parser/lib/esm/impl/string-intern.js +29 -0
- package/lib/node_modules/jsonc-parser/lib/esm/main.d.ts +351 -0
- package/lib/node_modules/jsonc-parser/lib/esm/main.js +178 -0
- package/lib/node_modules/jsonc-parser/lib/umd/impl/edit.js +201 -0
- package/lib/node_modules/jsonc-parser/lib/umd/impl/format.js +275 -0
- package/lib/node_modules/jsonc-parser/lib/umd/impl/parser.js +682 -0
- package/lib/node_modules/jsonc-parser/lib/umd/impl/scanner.js +456 -0
- package/lib/node_modules/jsonc-parser/lib/umd/impl/string-intern.js +42 -0
- package/lib/node_modules/jsonc-parser/lib/umd/main.d.ts +351 -0
- package/lib/node_modules/jsonc-parser/lib/umd/main.js +194 -0
- package/lib/node_modules/jsonc-parser/package.json +37 -0
- package/lib/node_modules/picomatch/LICENSE +21 -0
- package/lib/node_modules/picomatch/README.md +738 -0
- package/lib/node_modules/picomatch/index.js +17 -0
- package/lib/node_modules/picomatch/lib/constants.js +180 -0
- package/lib/node_modules/picomatch/lib/parse.js +1085 -0
- package/lib/node_modules/picomatch/lib/picomatch.js +341 -0
- package/lib/node_modules/picomatch/lib/scan.js +391 -0
- package/lib/node_modules/picomatch/lib/utils.js +72 -0
- package/lib/node_modules/picomatch/package.json +83 -0
- package/lib/node_modules/picomatch/posix.js +3 -0
- package/lib/node_modules/sisteransi/license +21 -0
- package/lib/node_modules/sisteransi/package.json +34 -0
- package/lib/node_modules/sisteransi/readme.md +113 -0
- package/lib/node_modules/sisteransi/src/index.js +58 -0
- package/lib/node_modules/sisteransi/src/sisteransi.d.ts +35 -0
- package/lib/node_modules/tree-sitter-wasms/LICENSE +24 -0
- package/lib/node_modules/tree-sitter-wasms/README.md +23 -0
- package/lib/node_modules/tree-sitter-wasms/out/tree-sitter-bash.wasm +0 -0
- package/lib/node_modules/tree-sitter-wasms/out/tree-sitter-c.wasm +0 -0
- package/lib/node_modules/tree-sitter-wasms/out/tree-sitter-c_sharp.wasm +0 -0
- package/lib/node_modules/tree-sitter-wasms/out/tree-sitter-cpp.wasm +0 -0
- package/lib/node_modules/tree-sitter-wasms/out/tree-sitter-css.wasm +0 -0
- package/lib/node_modules/tree-sitter-wasms/out/tree-sitter-dart.wasm +0 -0
- package/lib/node_modules/tree-sitter-wasms/out/tree-sitter-elisp.wasm +0 -0
- package/lib/node_modules/tree-sitter-wasms/out/tree-sitter-elixir.wasm +0 -0
- package/lib/node_modules/tree-sitter-wasms/out/tree-sitter-elm.wasm +0 -0
- package/lib/node_modules/tree-sitter-wasms/out/tree-sitter-embedded_template.wasm +0 -0
- package/lib/node_modules/tree-sitter-wasms/out/tree-sitter-go.wasm +0 -0
- package/lib/node_modules/tree-sitter-wasms/out/tree-sitter-html.wasm +0 -0
- package/lib/node_modules/tree-sitter-wasms/out/tree-sitter-java.wasm +0 -0
- package/lib/node_modules/tree-sitter-wasms/out/tree-sitter-javascript.wasm +0 -0
- package/lib/node_modules/tree-sitter-wasms/out/tree-sitter-json.wasm +0 -0
- package/lib/node_modules/tree-sitter-wasms/out/tree-sitter-kotlin.wasm +0 -0
- package/lib/node_modules/tree-sitter-wasms/out/tree-sitter-lua.wasm +0 -0
- package/lib/node_modules/tree-sitter-wasms/out/tree-sitter-objc.wasm +0 -0
- package/lib/node_modules/tree-sitter-wasms/out/tree-sitter-ocaml.wasm +0 -0
- package/lib/node_modules/tree-sitter-wasms/out/tree-sitter-php.wasm +0 -0
- package/lib/node_modules/tree-sitter-wasms/out/tree-sitter-python.wasm +0 -0
- package/lib/node_modules/tree-sitter-wasms/out/tree-sitter-ql.wasm +0 -0
- package/lib/node_modules/tree-sitter-wasms/out/tree-sitter-rescript.wasm +0 -0
- package/lib/node_modules/tree-sitter-wasms/out/tree-sitter-ruby.wasm +0 -0
- package/lib/node_modules/tree-sitter-wasms/out/tree-sitter-rust.wasm +0 -0
- package/lib/node_modules/tree-sitter-wasms/out/tree-sitter-scala.wasm +0 -0
- package/lib/node_modules/tree-sitter-wasms/out/tree-sitter-solidity.wasm +0 -0
- package/lib/node_modules/tree-sitter-wasms/out/tree-sitter-swift.wasm +0 -0
- package/lib/node_modules/tree-sitter-wasms/out/tree-sitter-systemrdl.wasm +0 -0
- package/lib/node_modules/tree-sitter-wasms/out/tree-sitter-tlaplus.wasm +0 -0
- package/lib/node_modules/tree-sitter-wasms/out/tree-sitter-toml.wasm +0 -0
- package/lib/node_modules/tree-sitter-wasms/out/tree-sitter-tsx.wasm +0 -0
- package/lib/node_modules/tree-sitter-wasms/out/tree-sitter-typescript.wasm +0 -0
- package/lib/node_modules/tree-sitter-wasms/out/tree-sitter-vue.wasm +0 -0
- package/lib/node_modules/tree-sitter-wasms/out/tree-sitter-yaml.wasm +0 -0
- package/lib/node_modules/tree-sitter-wasms/out/tree-sitter-zig.wasm +0 -0
- package/lib/node_modules/tree-sitter-wasms/package.json +64 -0
- package/lib/node_modules/web-tree-sitter/LICENSE +21 -0
- package/lib/node_modules/web-tree-sitter/README.md +269 -0
- package/lib/node_modules/web-tree-sitter/debug/tree-sitter.cjs +4558 -0
- package/lib/node_modules/web-tree-sitter/debug/tree-sitter.cjs.map +7 -0
- package/lib/node_modules/web-tree-sitter/debug/tree-sitter.js +4516 -0
- package/lib/node_modules/web-tree-sitter/debug/tree-sitter.js.map +7 -0
- package/lib/node_modules/web-tree-sitter/debug/tree-sitter.wasm +0 -0
- package/lib/node_modules/web-tree-sitter/debug/tree-sitter.wasm.map +31 -0
- package/lib/node_modules/web-tree-sitter/lib/alloc.c +48 -0
- package/lib/node_modules/web-tree-sitter/lib/alloc.h +41 -0
- package/lib/node_modules/web-tree-sitter/lib/array.h +291 -0
- package/lib/node_modules/web-tree-sitter/lib/atomic.h +68 -0
- package/lib/node_modules/web-tree-sitter/lib/clock.h +146 -0
- package/lib/node_modules/web-tree-sitter/lib/error_costs.h +11 -0
- package/lib/node_modules/web-tree-sitter/lib/get_changed_ranges.c +523 -0
- package/lib/node_modules/web-tree-sitter/lib/get_changed_ranges.h +36 -0
- package/lib/node_modules/web-tree-sitter/lib/host.h +21 -0
- package/lib/node_modules/web-tree-sitter/lib/language.c +293 -0
- package/lib/node_modules/web-tree-sitter/lib/language.h +293 -0
- package/lib/node_modules/web-tree-sitter/lib/length.h +52 -0
- package/lib/node_modules/web-tree-sitter/lib/lexer.c +483 -0
- package/lib/node_modules/web-tree-sitter/lib/lexer.h +54 -0
- package/lib/node_modules/web-tree-sitter/lib/lib.c +12 -0
- package/lib/node_modules/web-tree-sitter/lib/node.c +875 -0
- package/lib/node_modules/web-tree-sitter/lib/parser.c +2297 -0
- package/lib/node_modules/web-tree-sitter/lib/parser.h +286 -0
- package/lib/node_modules/web-tree-sitter/lib/point.h +48 -0
- package/lib/node_modules/web-tree-sitter/lib/query.c +4347 -0
- package/lib/node_modules/web-tree-sitter/lib/reduce_action.h +34 -0
- package/lib/node_modules/web-tree-sitter/lib/reusable_node.h +95 -0
- package/lib/node_modules/web-tree-sitter/lib/stack.c +912 -0
- package/lib/node_modules/web-tree-sitter/lib/stack.h +133 -0
- package/lib/node_modules/web-tree-sitter/lib/subtree.c +1034 -0
- package/lib/node_modules/web-tree-sitter/lib/subtree.h +399 -0
- package/lib/node_modules/web-tree-sitter/lib/tree-sitter.c +987 -0
- package/lib/node_modules/web-tree-sitter/lib/tree-sitter.cjs +2988 -0
- package/lib/node_modules/web-tree-sitter/lib/tree-sitter.wasm +0 -0
- package/lib/node_modules/web-tree-sitter/lib/tree-sitter.wasm.map +1 -0
- package/lib/node_modules/web-tree-sitter/lib/tree.c +170 -0
- package/lib/node_modules/web-tree-sitter/lib/tree.h +31 -0
- package/lib/node_modules/web-tree-sitter/lib/tree_cursor.c +716 -0
- package/lib/node_modules/web-tree-sitter/lib/tree_cursor.h +48 -0
- package/lib/node_modules/web-tree-sitter/lib/ts_assert.h +11 -0
- package/lib/node_modules/web-tree-sitter/lib/unicode.h +75 -0
- package/lib/node_modules/web-tree-sitter/lib/wasm_store.c +1937 -0
- package/lib/node_modules/web-tree-sitter/lib/wasm_store.h +31 -0
- package/lib/node_modules/web-tree-sitter/package.json +98 -0
- package/lib/node_modules/web-tree-sitter/src/bindings.ts +26 -0
- package/lib/node_modules/web-tree-sitter/src/constants.ts +133 -0
- package/lib/node_modules/web-tree-sitter/src/index.ts +31 -0
- package/lib/node_modules/web-tree-sitter/src/language.ts +291 -0
- package/lib/node_modules/web-tree-sitter/src/lookahead_iterator.ts +75 -0
- package/lib/node_modules/web-tree-sitter/src/marshal.ts +176 -0
- package/lib/node_modules/web-tree-sitter/src/node.ts +646 -0
- package/lib/node_modules/web-tree-sitter/src/parser.ts +325 -0
- package/lib/node_modules/web-tree-sitter/src/query.ts +973 -0
- package/lib/node_modules/web-tree-sitter/src/tree.ts +145 -0
- package/lib/node_modules/web-tree-sitter/src/tree_cursor.ts +318 -0
- package/lib/node_modules/web-tree-sitter/tree-sitter.cjs +4031 -0
- package/lib/node_modules/web-tree-sitter/tree-sitter.cjs.map +7 -0
- package/lib/node_modules/web-tree-sitter/tree-sitter.js +3980 -0
- package/lib/node_modules/web-tree-sitter/tree-sitter.js.map +7 -0
- package/lib/node_modules/web-tree-sitter/tree-sitter.wasm +0 -0
- package/lib/node_modules/web-tree-sitter/tree-sitter.wasm.map +30 -0
- package/lib/node_modules/web-tree-sitter/web-tree-sitter.d.ts +1030 -0
- package/lib/node_modules/web-tree-sitter/web-tree-sitter.d.ts.map +56 -0
- package/lib/package.json +55 -0
- package/node +0 -0
- package/package.json +17 -0
|
@@ -0,0 +1,396 @@
|
|
|
1
|
+
import { State, AutocompletePrompt, DateFormat } from '@clack/core';
|
|
2
|
+
export { ClackSettings, DateFormat, isCancel, settings, updateSettings } from '@clack/core';
|
|
3
|
+
import { Readable, Writable } from 'node:stream';
|
|
4
|
+
|
|
5
|
+
declare const unicode: boolean;
|
|
6
|
+
declare const isCI: () => boolean;
|
|
7
|
+
declare const isTTY: (output: Writable) => boolean;
|
|
8
|
+
declare const unicodeOr: (c: string, fallback: string) => string;
|
|
9
|
+
declare const S_STEP_ACTIVE: string;
|
|
10
|
+
declare const S_STEP_CANCEL: string;
|
|
11
|
+
declare const S_STEP_ERROR: string;
|
|
12
|
+
declare const S_STEP_SUBMIT: string;
|
|
13
|
+
declare const S_BAR_START: string;
|
|
14
|
+
declare const S_BAR: string;
|
|
15
|
+
declare const S_BAR_END: string;
|
|
16
|
+
declare const S_BAR_START_RIGHT: string;
|
|
17
|
+
declare const S_BAR_END_RIGHT: string;
|
|
18
|
+
declare const S_RADIO_ACTIVE: string;
|
|
19
|
+
declare const S_RADIO_INACTIVE: string;
|
|
20
|
+
declare const S_CHECKBOX_ACTIVE: string;
|
|
21
|
+
declare const S_CHECKBOX_SELECTED: string;
|
|
22
|
+
declare const S_CHECKBOX_INACTIVE: string;
|
|
23
|
+
declare const S_PASSWORD_MASK: string;
|
|
24
|
+
declare const S_BAR_H: string;
|
|
25
|
+
declare const S_CORNER_TOP_RIGHT: string;
|
|
26
|
+
declare const S_CONNECT_LEFT: string;
|
|
27
|
+
declare const S_CORNER_BOTTOM_RIGHT: string;
|
|
28
|
+
declare const S_CORNER_BOTTOM_LEFT: string;
|
|
29
|
+
declare const S_CORNER_TOP_LEFT: string;
|
|
30
|
+
declare const S_INFO: string;
|
|
31
|
+
declare const S_SUCCESS: string;
|
|
32
|
+
declare const S_WARN: string;
|
|
33
|
+
declare const S_ERROR: string;
|
|
34
|
+
declare const symbol: (state: State) => string;
|
|
35
|
+
declare const symbolBar: (state: State) => string;
|
|
36
|
+
interface CommonOptions {
|
|
37
|
+
input?: Readable;
|
|
38
|
+
output?: Writable;
|
|
39
|
+
signal?: AbortSignal;
|
|
40
|
+
withGuide?: boolean;
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
type Primitive = Readonly<string | boolean | number>;
|
|
44
|
+
type Option<Value> = Value extends Primitive ? {
|
|
45
|
+
/**
|
|
46
|
+
* Internal data for this option.
|
|
47
|
+
*/
|
|
48
|
+
value: Value;
|
|
49
|
+
/**
|
|
50
|
+
* The optional, user-facing text for this option.
|
|
51
|
+
*
|
|
52
|
+
* By default, the `value` is converted to a string.
|
|
53
|
+
*/
|
|
54
|
+
label?: string;
|
|
55
|
+
/**
|
|
56
|
+
* An optional hint to display to the user when
|
|
57
|
+
* this option might be selected.
|
|
58
|
+
*
|
|
59
|
+
* By default, no `hint` is displayed.
|
|
60
|
+
*/
|
|
61
|
+
hint?: string;
|
|
62
|
+
/**
|
|
63
|
+
* Whether this option is disabled.
|
|
64
|
+
* Disabled options are visible but cannot be selected.
|
|
65
|
+
*
|
|
66
|
+
* By default, options are not disabled.
|
|
67
|
+
*/
|
|
68
|
+
disabled?: boolean;
|
|
69
|
+
} : {
|
|
70
|
+
/**
|
|
71
|
+
* Internal data for this option.
|
|
72
|
+
*/
|
|
73
|
+
value: Value;
|
|
74
|
+
/**
|
|
75
|
+
* Required. The user-facing text for this option.
|
|
76
|
+
*/
|
|
77
|
+
label: string;
|
|
78
|
+
/**
|
|
79
|
+
* An optional hint to display to the user when
|
|
80
|
+
* this option might be selected.
|
|
81
|
+
*
|
|
82
|
+
* By default, no `hint` is displayed.
|
|
83
|
+
*/
|
|
84
|
+
hint?: string;
|
|
85
|
+
/**
|
|
86
|
+
* Whether this option is disabled.
|
|
87
|
+
* Disabled options are visible but cannot be selected.
|
|
88
|
+
*
|
|
89
|
+
* By default, options are not disabled.
|
|
90
|
+
*/
|
|
91
|
+
disabled?: boolean;
|
|
92
|
+
};
|
|
93
|
+
interface SelectOptions<Value> extends CommonOptions {
|
|
94
|
+
message: string;
|
|
95
|
+
options: Option<Value>[];
|
|
96
|
+
initialValue?: Value;
|
|
97
|
+
maxItems?: number;
|
|
98
|
+
}
|
|
99
|
+
declare const select: <Value>(opts: SelectOptions<Value>) => Promise<Value | symbol>;
|
|
100
|
+
|
|
101
|
+
interface AutocompleteSharedOptions<Value> extends CommonOptions {
|
|
102
|
+
/**
|
|
103
|
+
* The message to display to the user.
|
|
104
|
+
*/
|
|
105
|
+
message: string;
|
|
106
|
+
/**
|
|
107
|
+
* Available options for the autocomplete prompt.
|
|
108
|
+
*/
|
|
109
|
+
options: Option<Value>[] | ((this: AutocompletePrompt<Option<Value>>) => Option<Value>[]);
|
|
110
|
+
/**
|
|
111
|
+
* Maximum number of items to display at once.
|
|
112
|
+
*/
|
|
113
|
+
maxItems?: number;
|
|
114
|
+
/**
|
|
115
|
+
* Placeholder text to display when no input is provided.
|
|
116
|
+
*/
|
|
117
|
+
placeholder?: string;
|
|
118
|
+
/**
|
|
119
|
+
* Validates the value
|
|
120
|
+
*/
|
|
121
|
+
validate?: (value: Value | Value[] | undefined) => string | Error | undefined;
|
|
122
|
+
/**
|
|
123
|
+
* Custom filter function to match options against search input.
|
|
124
|
+
* If not provided, a default filter that matches label, hint, and value is used.
|
|
125
|
+
*/
|
|
126
|
+
filter?: (search: string, option: Option<Value>) => boolean;
|
|
127
|
+
}
|
|
128
|
+
interface AutocompleteOptions<Value> extends AutocompleteSharedOptions<Value> {
|
|
129
|
+
/**
|
|
130
|
+
* The initial selected value.
|
|
131
|
+
*/
|
|
132
|
+
initialValue?: Value;
|
|
133
|
+
/**
|
|
134
|
+
* The initial user input
|
|
135
|
+
*/
|
|
136
|
+
initialUserInput?: string;
|
|
137
|
+
}
|
|
138
|
+
declare const autocomplete: <Value>(opts: AutocompleteOptions<Value>) => Promise<Value | symbol>;
|
|
139
|
+
interface AutocompleteMultiSelectOptions<Value> extends AutocompleteSharedOptions<Value> {
|
|
140
|
+
/**
|
|
141
|
+
* The initial selected values
|
|
142
|
+
*/
|
|
143
|
+
initialValues?: Value[];
|
|
144
|
+
/**
|
|
145
|
+
* If true, at least one option must be selected
|
|
146
|
+
*/
|
|
147
|
+
required?: boolean;
|
|
148
|
+
}
|
|
149
|
+
/**
|
|
150
|
+
* Integrated autocomplete multiselect - combines type-ahead filtering with multiselect in one UI
|
|
151
|
+
*/
|
|
152
|
+
declare const autocompleteMultiselect: <Value>(opts: AutocompleteMultiSelectOptions<Value>) => Promise<Value[] | symbol>;
|
|
153
|
+
|
|
154
|
+
type BoxAlignment = 'left' | 'center' | 'right';
|
|
155
|
+
interface BoxOptions extends CommonOptions {
|
|
156
|
+
contentAlign?: BoxAlignment;
|
|
157
|
+
titleAlign?: BoxAlignment;
|
|
158
|
+
width?: number | 'auto';
|
|
159
|
+
titlePadding?: number;
|
|
160
|
+
contentPadding?: number;
|
|
161
|
+
rounded?: boolean;
|
|
162
|
+
formatBorder?: (text: string) => string;
|
|
163
|
+
}
|
|
164
|
+
declare const box: (message?: string, title?: string, opts?: BoxOptions) => void;
|
|
165
|
+
|
|
166
|
+
interface ConfirmOptions extends CommonOptions {
|
|
167
|
+
message: string;
|
|
168
|
+
active?: string;
|
|
169
|
+
inactive?: string;
|
|
170
|
+
initialValue?: boolean;
|
|
171
|
+
vertical?: boolean;
|
|
172
|
+
}
|
|
173
|
+
declare const confirm: (opts: ConfirmOptions) => Promise<boolean | symbol>;
|
|
174
|
+
|
|
175
|
+
interface DateOptions extends CommonOptions {
|
|
176
|
+
message: string;
|
|
177
|
+
format?: DateFormat;
|
|
178
|
+
locale?: string;
|
|
179
|
+
defaultValue?: Date;
|
|
180
|
+
initialValue?: Date;
|
|
181
|
+
minDate?: Date;
|
|
182
|
+
maxDate?: Date;
|
|
183
|
+
validate?: (value: Date | undefined) => string | Error | undefined;
|
|
184
|
+
}
|
|
185
|
+
declare const date: (opts: DateOptions) => Promise<Date | symbol>;
|
|
186
|
+
|
|
187
|
+
type Prettify<T> = {
|
|
188
|
+
[P in keyof T]: T[P];
|
|
189
|
+
} & {};
|
|
190
|
+
type PromptGroupAwaitedReturn<T> = {
|
|
191
|
+
[P in keyof T]: Exclude<Awaited<T[P]>, symbol>;
|
|
192
|
+
};
|
|
193
|
+
interface PromptGroupOptions<T> {
|
|
194
|
+
/**
|
|
195
|
+
* Control how the group can be canceled
|
|
196
|
+
* if one of the prompts is canceled.
|
|
197
|
+
*/
|
|
198
|
+
onCancel?: (opts: {
|
|
199
|
+
results: Prettify<Partial<PromptGroupAwaitedReturn<T>>>;
|
|
200
|
+
}) => void;
|
|
201
|
+
}
|
|
202
|
+
type PromptGroup<T> = {
|
|
203
|
+
[P in keyof T]: (opts: {
|
|
204
|
+
results: Prettify<Partial<PromptGroupAwaitedReturn<Omit<T, P>>>>;
|
|
205
|
+
}) => undefined | Promise<T[P] | undefined>;
|
|
206
|
+
};
|
|
207
|
+
/**
|
|
208
|
+
* Define a group of prompts to be displayed
|
|
209
|
+
* and return a results of objects within the group
|
|
210
|
+
*/
|
|
211
|
+
declare const group: <T>(prompts: PromptGroup<T>, opts?: PromptGroupOptions<T>) => Promise<Prettify<PromptGroupAwaitedReturn<T>>>;
|
|
212
|
+
|
|
213
|
+
interface GroupMultiSelectOptions<Value> extends CommonOptions {
|
|
214
|
+
message: string;
|
|
215
|
+
options: Record<string, Option<Value>[]>;
|
|
216
|
+
initialValues?: Value[];
|
|
217
|
+
required?: boolean;
|
|
218
|
+
cursorAt?: Value;
|
|
219
|
+
selectableGroups?: boolean;
|
|
220
|
+
groupSpacing?: number;
|
|
221
|
+
}
|
|
222
|
+
declare const groupMultiselect: <Value>(opts: GroupMultiSelectOptions<Value>) => Promise<Value[] | symbol>;
|
|
223
|
+
|
|
224
|
+
interface LimitOptionsParams<TOption> extends CommonOptions {
|
|
225
|
+
options: TOption[];
|
|
226
|
+
cursor: number;
|
|
227
|
+
style: (option: TOption, active: boolean) => string;
|
|
228
|
+
maxItems?: number;
|
|
229
|
+
columnPadding?: number;
|
|
230
|
+
rowPadding?: number;
|
|
231
|
+
}
|
|
232
|
+
declare const limitOptions: <TOption>({ cursor, options, style, output, maxItems, columnPadding, rowPadding, }: LimitOptionsParams<TOption>) => string[];
|
|
233
|
+
|
|
234
|
+
interface LogMessageOptions extends CommonOptions {
|
|
235
|
+
symbol?: string;
|
|
236
|
+
spacing?: number;
|
|
237
|
+
secondarySymbol?: string;
|
|
238
|
+
}
|
|
239
|
+
declare const log: {
|
|
240
|
+
message: (message?: string | string[], { symbol, secondarySymbol, output, spacing, withGuide, }?: LogMessageOptions) => void;
|
|
241
|
+
info: (message: string, opts?: LogMessageOptions) => void;
|
|
242
|
+
success: (message: string, opts?: LogMessageOptions) => void;
|
|
243
|
+
step: (message: string, opts?: LogMessageOptions) => void;
|
|
244
|
+
warn: (message: string, opts?: LogMessageOptions) => void;
|
|
245
|
+
/** alias for `log.warn()`. */
|
|
246
|
+
warning: (message: string, opts?: LogMessageOptions) => void;
|
|
247
|
+
error: (message: string, opts?: LogMessageOptions) => void;
|
|
248
|
+
};
|
|
249
|
+
|
|
250
|
+
declare const cancel: (message?: string, opts?: CommonOptions) => void;
|
|
251
|
+
declare const intro: (title?: string, opts?: CommonOptions) => void;
|
|
252
|
+
declare const outro: (message?: string, opts?: CommonOptions) => void;
|
|
253
|
+
|
|
254
|
+
interface TextOptions extends CommonOptions {
|
|
255
|
+
message: string;
|
|
256
|
+
placeholder?: string;
|
|
257
|
+
defaultValue?: string;
|
|
258
|
+
initialValue?: string;
|
|
259
|
+
validate?: (value: string | undefined) => string | Error | undefined;
|
|
260
|
+
}
|
|
261
|
+
declare const text: (opts: TextOptions) => Promise<string | symbol>;
|
|
262
|
+
|
|
263
|
+
interface MultiLineOptions extends TextOptions {
|
|
264
|
+
showSubmit?: boolean;
|
|
265
|
+
}
|
|
266
|
+
declare const multiline: (opts: MultiLineOptions) => Promise<string | symbol>;
|
|
267
|
+
|
|
268
|
+
interface MultiSelectOptions<Value> extends CommonOptions {
|
|
269
|
+
message: string;
|
|
270
|
+
options: Option<Value>[];
|
|
271
|
+
initialValues?: Value[];
|
|
272
|
+
maxItems?: number;
|
|
273
|
+
required?: boolean;
|
|
274
|
+
cursorAt?: Value;
|
|
275
|
+
}
|
|
276
|
+
declare const multiselect: <Value>(opts: MultiSelectOptions<Value>) => Promise<Value[] | symbol>;
|
|
277
|
+
|
|
278
|
+
type FormatFn = (line: string) => string;
|
|
279
|
+
interface NoteOptions extends CommonOptions {
|
|
280
|
+
format?: FormatFn;
|
|
281
|
+
}
|
|
282
|
+
declare const note: (message?: string, title?: string, opts?: NoteOptions) => void;
|
|
283
|
+
|
|
284
|
+
interface PasswordOptions extends CommonOptions {
|
|
285
|
+
message: string;
|
|
286
|
+
mask?: string;
|
|
287
|
+
validate?: (value: string | undefined) => string | Error | undefined;
|
|
288
|
+
clearOnError?: boolean;
|
|
289
|
+
}
|
|
290
|
+
declare const password: (opts: PasswordOptions) => Promise<string | symbol>;
|
|
291
|
+
|
|
292
|
+
interface PathOptions extends CommonOptions {
|
|
293
|
+
root?: string;
|
|
294
|
+
directory?: boolean;
|
|
295
|
+
initialValue?: string;
|
|
296
|
+
message: string;
|
|
297
|
+
validate?: (value: string | undefined) => string | Error | undefined;
|
|
298
|
+
}
|
|
299
|
+
declare const path: (opts: PathOptions) => Promise<string | symbol>;
|
|
300
|
+
|
|
301
|
+
interface SpinnerOptions extends CommonOptions {
|
|
302
|
+
indicator?: 'dots' | 'timer';
|
|
303
|
+
onCancel?: () => void;
|
|
304
|
+
cancelMessage?: string;
|
|
305
|
+
errorMessage?: string;
|
|
306
|
+
frames?: string[];
|
|
307
|
+
delay?: number;
|
|
308
|
+
styleFrame?: (frame: string) => string;
|
|
309
|
+
}
|
|
310
|
+
interface SpinnerResult {
|
|
311
|
+
start(msg?: string): void;
|
|
312
|
+
stop(msg?: string): void;
|
|
313
|
+
cancel(msg?: string): void;
|
|
314
|
+
error(msg?: string): void;
|
|
315
|
+
message(msg?: string): void;
|
|
316
|
+
clear(): void;
|
|
317
|
+
readonly isCancelled: boolean;
|
|
318
|
+
}
|
|
319
|
+
declare const spinner: ({ indicator, onCancel, output, cancelMessage, errorMessage, frames, delay, signal, ...opts }?: SpinnerOptions) => SpinnerResult;
|
|
320
|
+
|
|
321
|
+
interface ProgressOptions extends SpinnerOptions {
|
|
322
|
+
style?: 'light' | 'heavy' | 'block';
|
|
323
|
+
max?: number;
|
|
324
|
+
size?: number;
|
|
325
|
+
}
|
|
326
|
+
interface ProgressResult extends SpinnerResult {
|
|
327
|
+
advance(step?: number, msg?: string): void;
|
|
328
|
+
}
|
|
329
|
+
declare function progress({ style, max: userMax, size: userSize, ...spinnerOptions }?: ProgressOptions): ProgressResult;
|
|
330
|
+
|
|
331
|
+
interface SelectKeyOptions<Value extends string> extends CommonOptions {
|
|
332
|
+
message: string;
|
|
333
|
+
options: Option<Value>[];
|
|
334
|
+
initialValue?: Value;
|
|
335
|
+
caseSensitive?: boolean;
|
|
336
|
+
}
|
|
337
|
+
declare const selectKey: <Value extends string>(opts: SelectKeyOptions<Value>) => Promise<Value | symbol>;
|
|
338
|
+
|
|
339
|
+
declare const stream: {
|
|
340
|
+
message: (iterable: Iterable<string> | AsyncIterable<string>, { symbol }?: LogMessageOptions) => Promise<void>;
|
|
341
|
+
info: (iterable: Iterable<string> | AsyncIterable<string>) => Promise<void>;
|
|
342
|
+
success: (iterable: Iterable<string> | AsyncIterable<string>) => Promise<void>;
|
|
343
|
+
step: (iterable: Iterable<string> | AsyncIterable<string>) => Promise<void>;
|
|
344
|
+
warn: (iterable: Iterable<string> | AsyncIterable<string>) => Promise<void>;
|
|
345
|
+
/** alias for `log.warn()`. */
|
|
346
|
+
warning: (iterable: Iterable<string> | AsyncIterable<string>) => Promise<void>;
|
|
347
|
+
error: (iterable: Iterable<string> | AsyncIterable<string>) => Promise<void>;
|
|
348
|
+
};
|
|
349
|
+
|
|
350
|
+
type Task = {
|
|
351
|
+
/**
|
|
352
|
+
* Task title
|
|
353
|
+
*/
|
|
354
|
+
title: string;
|
|
355
|
+
/**
|
|
356
|
+
* Task function
|
|
357
|
+
*/
|
|
358
|
+
task: (message: (string: string) => void) => string | Promise<string> | void | Promise<void>;
|
|
359
|
+
/**
|
|
360
|
+
* If enabled === false the task will be skipped
|
|
361
|
+
*/
|
|
362
|
+
enabled?: boolean;
|
|
363
|
+
};
|
|
364
|
+
/**
|
|
365
|
+
* Define a group of tasks to be executed
|
|
366
|
+
*/
|
|
367
|
+
declare const tasks: (tasks: Task[], opts?: CommonOptions) => Promise<void>;
|
|
368
|
+
|
|
369
|
+
interface TaskLogOptions extends CommonOptions {
|
|
370
|
+
title: string;
|
|
371
|
+
limit?: number;
|
|
372
|
+
spacing?: number;
|
|
373
|
+
retainLog?: boolean;
|
|
374
|
+
}
|
|
375
|
+
interface TaskLogMessageOptions {
|
|
376
|
+
raw?: boolean;
|
|
377
|
+
}
|
|
378
|
+
interface TaskLogCompletionOptions {
|
|
379
|
+
showLog?: boolean;
|
|
380
|
+
}
|
|
381
|
+
/**
|
|
382
|
+
* Renders a log which clears on success and remains on failure
|
|
383
|
+
*/
|
|
384
|
+
declare const taskLog: (opts: TaskLogOptions) => {
|
|
385
|
+
message(msg: string, mopts?: TaskLogMessageOptions): void;
|
|
386
|
+
group(name: string): {
|
|
387
|
+
message(msg: string, mopts?: TaskLogMessageOptions): void;
|
|
388
|
+
error(message: string): void;
|
|
389
|
+
success(message: string): void;
|
|
390
|
+
};
|
|
391
|
+
error(message: string, opts?: TaskLogCompletionOptions): void;
|
|
392
|
+
success(message: string, opts?: TaskLogCompletionOptions): void;
|
|
393
|
+
};
|
|
394
|
+
|
|
395
|
+
export { S_BAR, S_BAR_END, S_BAR_END_RIGHT, S_BAR_H, S_BAR_START, S_BAR_START_RIGHT, S_CHECKBOX_ACTIVE, S_CHECKBOX_INACTIVE, S_CHECKBOX_SELECTED, S_CONNECT_LEFT, S_CORNER_BOTTOM_LEFT, S_CORNER_BOTTOM_RIGHT, S_CORNER_TOP_LEFT, S_CORNER_TOP_RIGHT, S_ERROR, S_INFO, S_PASSWORD_MASK, S_RADIO_ACTIVE, S_RADIO_INACTIVE, S_STEP_ACTIVE, S_STEP_CANCEL, S_STEP_ERROR, S_STEP_SUBMIT, S_SUCCESS, S_WARN, autocomplete, autocompleteMultiselect, box, cancel, confirm, date, group, groupMultiselect, intro, isCI, isTTY, limitOptions, log, multiline, multiselect, note, outro, password, path, progress, select, selectKey, spinner, stream, symbol, symbolBar, taskLog, tasks, text, unicode, unicodeOr };
|
|
396
|
+
export type { AutocompleteMultiSelectOptions, AutocompleteOptions, BoxAlignment, BoxOptions, CommonOptions, ConfirmOptions, DateOptions, GroupMultiSelectOptions, LimitOptionsParams, LogMessageOptions, MultiLineOptions, MultiSelectOptions, NoteOptions, Option, PasswordOptions, PathOptions, ProgressOptions, ProgressResult, PromptGroup, PromptGroupAwaitedReturn, PromptGroupOptions, SelectKeyOptions, SelectOptions, SpinnerOptions, SpinnerResult, Task, TaskLogCompletionOptions, TaskLogMessageOptions, TaskLogOptions, TextOptions };
|
|
@@ -0,0 +1,144 @@
|
|
|
1
|
+
import{getColumns as X,getRows as Bt,AutocompletePrompt as vt,settings as _,ConfirmPrompt as Lt,wrapTextWithPrefix as O,DatePrompt as Dt,isCancel as Wt,GroupMultiSelectPrompt as Ft,MultiLinePrompt as Ht,MultiSelectPrompt as Ut,PasswordPrompt as Kt,block as qt,SelectPrompt as Jt,SelectKeyPrompt as Yt,TextPrompt as Xt}from"@clack/core";export{isCancel,settings,updateSettings}from"@clack/core";import{styleText as e,stripVTControlCharacters as nt}from"node:util";import j from"node:process";import{wrapAnsi as q}from"fast-wrap-ansi";import k from"fast-string-width";import{existsSync as zt,lstatSync as wt,readdirSync as Qt}from"node:fs";import{dirname as bt,join as Zt}from"node:path";import{cursor as St,erase as Ct}from"sisteransi";function te(){return j.platform!=="win32"?j.env.TERM!=="linux":!!j.env.CI||!!j.env.WT_SESSION||!!j.env.TERMINUS_SUBLIME||j.env.ConEmuTask==="{cmd::Cmder}"||j.env.TERM_PROGRAM==="Terminus-Sublime"||j.env.TERM_PROGRAM==="vscode"||j.env.TERM==="xterm-256color"||j.env.TERM==="alacritty"||j.env.TERMINAL_EMULATOR==="JetBrains-JediTerm"}const tt=te(),at=()=>process.env.CI==="true",Tt=t=>t.isTTY===!0,w=(t,r)=>tt?t:r,_t=w("\u25C6","*"),ot=w("\u25A0","x"),ut=w("\u25B2","x"),F=w("\u25C7","o"),lt=w("\u250C","T"),$=w("\u2502","|"),E=w("\u2514","\u2014"),It=w("\u2510","T"),Et=w("\u2518","\u2014"),z=w("\u25CF",">"),H=w("\u25CB"," "),et=w("\u25FB","[\u2022]"),U=w("\u25FC","[+]"),J=w("\u25FB","[ ]"),Gt=w("\u25AA","\u2022"),st=w("\u2500","-"),ct=w("\u256E","+"),xt=w("\u251C","+"),$t=w("\u256F","+"),dt=w("\u2570","+"),Ot=w("\u256D","+"),ht=w("\u25CF","\u2022"),pt=w("\u25C6","*"),mt=w("\u25B2","!"),gt=w("\u25A0","x"),M=t=>{switch(t){case"initial":case"active":return e("cyan",_t);case"cancel":return e("red",ot);case"error":return e("yellow",ut);case"submit":return e("green",F)}},yt=t=>{switch(t){case"initial":case"active":return e("cyan",$);case"cancel":return e("red",$);case"error":return e("yellow",$);case"submit":return e("green",$)}},ee=(t,r,s,i,u)=>{let n=r,o=0;for(let c=s;c<i;c++){const a=t[c];if(n=n-a.length,o++,n<=u)break}return{lineCount:n,removals:o}},Y=({cursor:t,options:r,style:s,output:i=process.stdout,maxItems:u=Number.POSITIVE_INFINITY,columnPadding:n=0,rowPadding:o=4})=>{const c=X(i)-n,a=Bt(i),l=e("dim","..."),d=Math.max(a-o,0),y=Math.max(Math.min(u,d),5);let p=0;t>=y-3&&(p=Math.max(Math.min(t-y+3,r.length-y),0));let m=y<r.length&&p>0,g=y<r.length&&p+y<r.length;const S=Math.min(p+y,r.length),h=[];let f=0;m&&f++,g&&f++;const v=p+(m?1:0),T=S-(g?1:0);for(let b=v;b<T;b++){const G=q(s(r[b],b===t),c,{hard:!0,trim:!1}).split(`
|
|
2
|
+
`);h.push(G),f+=G.length}if(f>d){let b=0,G=0,x=f;const A=t-v,P=(N,D)=>ee(h,x,N,D,d);m?({lineCount:x,removals:b}=P(0,A),x>d&&({lineCount:x,removals:G}=P(A+1,h.length))):({lineCount:x,removals:G}=P(A+1,h.length),x>d&&({lineCount:x,removals:b}=P(0,A))),b>0&&(m=!0,h.splice(0,b)),G>0&&(g=!0,h.splice(h.length-G,G))}const C=[];m&&C.push(l);for(const b of h)for(const G of b)C.push(G);return g&&C.push(l),C};function Mt(t){return t.label??String(t.value??"")}function Rt(t,r){if(!t)return!0;const s=(r.label??String(r.value??"")).toLowerCase(),i=(r.hint??"").toLowerCase(),u=String(r.value).toLowerCase(),n=t.toLowerCase();return s.includes(n)||i.includes(n)||u.includes(n)}function se(t,r){const s=[];for(const i of r)t.includes(i.value)&&s.push(i);return s}const At=t=>new vt({options:t.options,initialValue:t.initialValue?[t.initialValue]:void 0,initialUserInput:t.initialUserInput,placeholder:t.placeholder,filter:t.filter??((r,s)=>Rt(r,s)),signal:t.signal,input:t.input,output:t.output,validate:t.validate,render(){const r=t.withGuide??_.withGuide,s=r?[`${e("gray",$)}`,`${M(this.state)} ${t.message}`]:[`${M(this.state)} ${t.message}`],i=this.userInput,u=this.options,n=t.placeholder,o=i===""&&n!==void 0,c=(a,l)=>{const d=Mt(a),y=a.hint&&a.value===this.focusedValue?e("dim",` (${a.hint})`):"";switch(l){case"active":return`${e("green",z)} ${d}${y}`;case"inactive":return`${e("dim",H)} ${e("dim",d)}`;case"disabled":return`${e("gray",H)} ${e(["strikethrough","gray"],d)}`}};switch(this.state){case"submit":{const a=se(this.selectedValues,u),l=a.length>0?` ${e("dim",a.map(Mt).join(", "))}`:"",d=r?e("gray",$):"";return`${s.join(`
|
|
3
|
+
`)}
|
|
4
|
+
${d}${l}`}case"cancel":{const a=i?` ${e(["strikethrough","dim"],i)}`:"",l=r?e("gray",$):"";return`${s.join(`
|
|
5
|
+
`)}
|
|
6
|
+
${l}${a}`}default:{const a=this.state==="error"?"yellow":"cyan",l=r?`${e(a,$)} `:"",d=r?e(a,E):"";let y="";if(this.isNavigating||o){const v=o?n:i;y=v!==""?` ${e("dim",v)}`:""}else y=` ${this.userInputWithCursor}`;const p=this.filteredOptions.length!==u.length?e("dim",` (${this.filteredOptions.length} match${this.filteredOptions.length===1?"":"es"})`):"",m=this.filteredOptions.length===0&&i?[`${l}${e("yellow","No matches found")}`]:[],g=this.state==="error"?[`${l}${e("yellow",this.error)}`]:[];r&&s.push(`${l.trimEnd()}`),s.push(`${l}${e("dim","Search:")}${y}${p}`,...m,...g);const S=[`${e("dim","\u2191/\u2193")} to select`,`${e("dim","Enter:")} confirm`,`${e("dim","Type:")} to search`],h=[`${l}${S.join(" \u2022 ")}`,d],f=this.filteredOptions.length===0?[]:Y({cursor:this.cursor,options:this.filteredOptions,columnPadding:r?3:0,rowPadding:s.length+h.length,style:(v,T)=>c(v,v.disabled?"disabled":T?"active":"inactive"),maxItems:t.maxItems,output:t.output});return[...s,...f.map(v=>`${l}${v}`),...h].join(`
|
|
7
|
+
`)}}}}).prompt(),ie=t=>{const r=(i,u,n,o)=>{const c=n.includes(i.value),a=i.label??String(i.value??""),l=i.hint&&o!==void 0&&i.value===o?e("dim",` (${i.hint})`):"",d=c?e("green",U):e("dim",J);return i.disabled?`${e("gray",J)} ${e(["strikethrough","gray"],a)}`:u?`${d} ${a}${l}`:`${d} ${e("dim",a)}`},s=new vt({options:t.options,multiple:!0,placeholder:t.placeholder,filter:t.filter??((i,u)=>Rt(i,u)),validate:()=>{if(t.required&&s.selectedValues.length===0)return"Please select at least one item"},initialValue:t.initialValues,signal:t.signal,input:t.input,output:t.output,render(){const i=t.withGuide??_.withGuide,u=`${i?`${e("gray",$)}
|
|
8
|
+
`:""}${M(this.state)} ${t.message}
|
|
9
|
+
`,n=this.userInput,o=t.placeholder,c=n===""&&o!==void 0,a=this.isNavigating||c?e("dim",c?o:n):this.userInputWithCursor,l=this.options,d=this.filteredOptions.length!==l.length?e("dim",` (${this.filteredOptions.length} match${this.filteredOptions.length===1?"":"es"})`):"";switch(this.state){case"submit":return`${u}${i?`${e("gray",$)} `:""}${e("dim",`${this.selectedValues.length} items selected`)}`;case"cancel":return`${u}${i?`${e("gray",$)} `:""}${e(["strikethrough","dim"],n)}`;default:{const y=this.state==="error"?"yellow":"cyan",p=i?`${e(y,$)} `:"",m=i?e(y,E):"",g=[`${e("dim","\u2191/\u2193")} to navigate`,`${e("dim",this.isNavigating?"Space/Tab:":"Tab:")} select`,`${e("dim","Enter:")} confirm`,`${e("dim","Type:")} to search`],S=this.filteredOptions.length===0&&n?[`${p}${e("yellow","No matches found")}`]:[],h=this.state==="error"?[`${p}${e("yellow",this.error)}`]:[],f=[...`${u}${i?e(y,$):""}`.split(`
|
|
10
|
+
`),`${p}${e("dim","Search:")} ${a}${d}`,...S,...h],v=[`${p}${g.join(" \u2022 ")}`,m],T=Y({cursor:this.cursor,options:this.filteredOptions,style:(C,b)=>r(C,b,this.selectedValues,this.focusedValue),maxItems:t.maxItems,output:t.output,rowPadding:f.length+v.length});return[...f,...T.map(C=>`${p}${C}`),...v].join(`
|
|
11
|
+
`)}}}});return s.prompt()},re=[Ot,ct,dt,$t],ne=[lt,It,E,Et];function Pt(t,r,s,i){let u=s,n=s;return i==="center"?u=Math.floor((r-t)/2):i==="right"&&(u=r-t-s),n=r-u-t,[u,n]}const ae=t=>t,oe=(t="",r="",s)=>{const i=s?.output??process.stdout,u=X(i),n=2,o=s?.titlePadding??1,c=s?.contentPadding??2,a=s?.width===void 0||s.width==="auto"?1:Math.min(1,s.width),l=s?.withGuide??_.withGuide?`${$} `:"",d=s?.formatBorder??ae,y=(s?.rounded?re:ne).map(d),p=d(st),m=d($),g=k(l),S=k(r),h=u-g;let f=Math.floor(u*a)-g;if(s?.width==="auto"){const P=t.split(`
|
|
12
|
+
`);let N=S+o*2;for(const rt of P){const W=k(rt)+c*2;W>N&&(N=W)}const D=N+n;D<f&&(f=D)}f%2!==0&&(f<h?f++:f--);const v=f-n,T=v-o*2,C=S>T?`${r.slice(0,T-3)}...`:r,[b,G]=Pt(k(C),v,o,s?.titleAlign),x=q(t,v-c*2,{hard:!0,trim:!1});i.write(`${l}${y[0]}${p.repeat(b)}${C}${p.repeat(G)}${y[1]}
|
|
13
|
+
`);const A=x.split(`
|
|
14
|
+
`);for(const P of A){const[N,D]=Pt(k(P),v,c,s?.contentAlign);i.write(`${l}${m}${" ".repeat(N)}${P}${" ".repeat(D)}${m}
|
|
15
|
+
`)}i.write(`${l}${y[2]}${p.repeat(v)}${y[3]}
|
|
16
|
+
`)},ue=t=>{const r=t.active??"Yes",s=t.inactive??"No";return new Lt({active:r,inactive:s,signal:t.signal,input:t.input,output:t.output,initialValue:t.initialValue??!0,render(){const i=t.withGuide??_.withGuide,u=`${M(this.state)} `,n=i?`${e("gray",$)} `:"",o=O(t.output,t.message,n,u),c=`${i?`${e("gray",$)}
|
|
17
|
+
`:""}${o}
|
|
18
|
+
`,a=this.value?r:s;switch(this.state){case"submit":{const l=i?`${e("gray",$)} `:"";return`${c}${l}${e("dim",a)}`}case"cancel":{const l=i?`${e("gray",$)} `:"";return`${c}${l}${e(["strikethrough","dim"],a)}${i?`
|
|
19
|
+
${e("gray",$)}`:""}`}default:{const l=i?`${e("cyan",$)} `:"",d=i?e("cyan",E):"";return`${c}${l}${this.value?`${e("green",z)} ${r}`:`${e("dim",H)} ${e("dim",r)}`}${t.vertical?i?`
|
|
20
|
+
${e("cyan",$)} `:`
|
|
21
|
+
`:` ${e("dim","/")} `}${this.value?`${e("dim",H)} ${e("dim",s)}`:`${e("green",z)} ${s}`}
|
|
22
|
+
${d}
|
|
23
|
+
`}}}}).prompt()},le=t=>{const r=t.validate;return new Dt({...t,validate(s){if(s===void 0)return t.defaultValue!==void 0?void 0:r?r(s):_.date.messages.required;const i=u=>u.toISOString().slice(0,10);if(t.minDate&&i(s)<i(t.minDate))return _.date.messages.afterMin(t.minDate);if(t.maxDate&&i(s)>i(t.maxDate))return _.date.messages.beforeMax(t.maxDate);if(r)return r(s)},render(){const s=(t?.withGuide??_.withGuide)!==!1,i=`${`${s?`${e("gray",$)}
|
|
24
|
+
`:""}${M(this.state)} `}${t.message}
|
|
25
|
+
`,u=this.state!=="initial"?this.state:"active",n=ce(this,u),o=this.value instanceof Date?this.formattedValue:"";switch(this.state){case"error":{const c=this.error?` ${e("yellow",this.error)}`:"",a=s?`${e("yellow",$)} `:"",l=s?e("yellow",E):"";return`${i.trim()}
|
|
26
|
+
${a}${n}
|
|
27
|
+
${l}${c}
|
|
28
|
+
`}case"submit":{const c=o?` ${e("dim",o)}`:"",a=s?e("gray",$):"";return`${i}${a}${c}`}case"cancel":{const c=o?` ${e(["strikethrough","dim"],o)}`:"",a=s?e("gray",$):"";return`${i}${a}${c}${o.trim()?`
|
|
29
|
+
${a}`:""}`}default:{const c=s?`${e("cyan",$)} `:"",a=s?e("cyan",E):"",l=s?`${e("cyan",$)} `:"",d=this.inlineError?`
|
|
30
|
+
${l}${e("yellow",this.inlineError)}`:"";return`${i}${c}${n}${d}
|
|
31
|
+
${a}
|
|
32
|
+
`}}}}).prompt()};function ce(t,r){const s=t.segmentValues,i=t.segmentCursor;if(r==="submit"||r==="cancel")return t.formattedValue;const u=e("gray",t.separator);return t.segments.map((n,o)=>{const c=o===i.segmentIndex&&!["submit","cancel"].includes(r),a=de[n.type];return $e(s[n.type],{isActive:c,label:a})}).join(u)}function $e(t,r){const s=!t||t.replace(/_/g,"")==="";return r.isActive?e("inverse",s?r.label:t.replace(/_/g," ")):s?e("dim",r.label):t.replace(/_/g,e("dim"," "))}const de={year:"yyyy",month:"mm",day:"dd"},he=async(t,r)=>{const s={},i=Object.keys(t);for(const u of i){const n=t[u],o=await n({results:s})?.catch(c=>{throw c});if(typeof r?.onCancel=="function"&&Wt(o)){s[u]="canceled",r.onCancel({results:s});continue}s[u]=o}return s},pe=t=>{const{selectableGroups:r=!0,groupSpacing:s=0}=t,i=(n,o,c=[])=>{const a=n.label??String(n.value),l=typeof n.group=="string",d=l&&(c[c.indexOf(n)+1]??{group:!0}),y=l&&d&&d.group===!0,p=l?r?`${y?E:$} `:" ":"";let m="";if(s>0&&!l){const S=`
|
|
33
|
+
${e("cyan",$)}`;m=`${S.repeat(s-1)}${S} `}if(o==="active")return`${m}${e("dim",p)}${e("cyan",et)} ${a}${n.hint?` ${e("dim",`(${n.hint})`)}`:""}`;if(o==="group-active")return`${m}${p}${e("cyan",et)} ${e("dim",a)}`;if(o==="group-active-selected")return`${m}${p}${e("green",U)} ${e("dim",a)}`;if(o==="selected"){const S=l||r?e("green",U):"";return`${m}${e("dim",p)}${S} ${e("dim",a)}${n.hint?` ${e("dim",`(${n.hint})`)}`:""}`}if(o==="cancelled")return`${e(["strikethrough","dim"],a)}`;if(o==="active-selected")return`${m}${e("dim",p)}${e("green",U)} ${a}${n.hint?` ${e("dim",`(${n.hint})`)}`:""}`;if(o==="submitted")return`${e("dim",a)}`;const g=l||r?e("dim",J):"";return`${m}${e("dim",p)}${g} ${e("dim",a)}`},u=t.required??!0;return new Ft({options:t.options,signal:t.signal,input:t.input,output:t.output,initialValues:t.initialValues,required:u,cursorAt:t.cursorAt,selectableGroups:r,validate(n){if(u&&(n===void 0||n.length===0))return`Please select at least one option.
|
|
34
|
+
${e("reset",e("dim",`Press ${e(["gray","bgWhite","inverse"]," space ")} to select, ${e("gray",e(["bgWhite","inverse"]," enter "))} to submit`))}`},render(){const n=t.withGuide??_.withGuide,o=`${n?`${e("gray",$)}
|
|
35
|
+
`:""}${M(this.state)} ${t.message}
|
|
36
|
+
`,c=this.value??[];switch(this.state){case"submit":{const a=this.options.filter(({value:d})=>c.includes(d)).map(d=>i(d,"submitted")),l=a.length===0?"":` ${a.join(e("dim",", "))}`;return`${o}${n?e("gray",$):""}${l}`}case"cancel":{const a=this.options.filter(({value:l})=>c.includes(l)).map(l=>i(l,"cancelled")).join(e("dim",", "));return`${o}${n?`${e("gray",$)} `:""}${a.trim()?`${a}${n?`
|
|
37
|
+
${e("gray",$)}`:""}`:""}`}case"error":{const a=this.error.split(`
|
|
38
|
+
`).map((l,d)=>d===0?`${n?`${e("yellow",E)} `:""}${e("yellow",l)}`:` ${l}`).join(`
|
|
39
|
+
`);return`${o}${n?`${e("yellow",$)} `:""}${this.options.map((l,d,y)=>{const p=c.includes(l.value)||l.group===!0&&this.isGroupSelected(`${l.value}`),m=d===this.cursor;return!m&&typeof l.group=="string"&&this.options[this.cursor].value===l.group?i(l,p?"group-active-selected":"group-active",y):m&&p?i(l,"active-selected",y):p?i(l,"selected",y):i(l,m?"active":"inactive",y)}).join(`
|
|
40
|
+
${n?`${e("yellow",$)} `:""}`)}
|
|
41
|
+
${a}
|
|
42
|
+
`}default:{const a=this.options.map((d,y,p)=>{const m=c.includes(d.value)||d.group===!0&&this.isGroupSelected(`${d.value}`),g=y===this.cursor,S=!g&&typeof d.group=="string"&&this.options[this.cursor].value===d.group;let h="";return S?h=i(d,m?"group-active-selected":"group-active",p):g&&m?h=i(d,"active-selected",p):m?h=i(d,"selected",p):h=i(d,g?"active":"inactive",p),`${y!==0&&!h.startsWith(`
|
|
43
|
+
`)?" ":""}${h}`}).join(`
|
|
44
|
+
${n?e("cyan",$):""}`),l=a.startsWith(`
|
|
45
|
+
`)?"":" ";return`${o}${n?e("cyan",$):""}${l}${a}
|
|
46
|
+
${n?e("cyan",E):""}
|
|
47
|
+
`}}}}).prompt()},R={message:(t=[],{symbol:r=e("gray",$),secondarySymbol:s=e("gray",$),output:i=process.stdout,spacing:u=1,withGuide:n}={})=>{const o=[],c=n??_.withGuide,a=c?s:"",l=c?`${r} `:"",d=c?`${s} `:"";for(let p=0;p<u;p++)o.push(a);const y=Array.isArray(t)?t:t.split(`
|
|
48
|
+
`);if(y.length>0){const[p,...m]=y;p.length>0?o.push(`${l}${p}`):o.push(c?r:"");for(const g of m)g.length>0?o.push(`${d}${g}`):o.push(c?s:"")}i.write(`${o.join(`
|
|
49
|
+
`)}
|
|
50
|
+
`)},info:(t,r)=>{R.message(t,{...r,symbol:e("blue",ht)})},success:(t,r)=>{R.message(t,{...r,symbol:e("green",pt)})},step:(t,r)=>{R.message(t,{...r,symbol:e("green",F)})},warn:(t,r)=>{R.message(t,{...r,symbol:e("yellow",mt)})},warning:(t,r)=>{R.warn(t,r)},error:(t,r)=>{R.message(t,{...r,symbol:e("red",gt)})}},me=(t="",r)=>{const s=r?.output??process.stdout,i=r?.withGuide??_.withGuide?`${e("gray",E)} `:"";s.write(`${i}${e("red",t)}
|
|
51
|
+
|
|
52
|
+
`)},ge=(t="",r)=>{const s=r?.output??process.stdout,i=r?.withGuide??_.withGuide?`${e("gray",lt)} `:"";s.write(`${i}${t}
|
|
53
|
+
`)},ye=(t="",r)=>{const s=r?.output??process.stdout,i=r?.withGuide??_.withGuide?`${e("gray",$)}
|
|
54
|
+
${e("gray",E)} `:"";s.write(`${i}${t}
|
|
55
|
+
|
|
56
|
+
`)},fe=t=>new Ht({validate:t.validate,placeholder:t.placeholder,defaultValue:t.defaultValue,initialValue:t.initialValue,showSubmit:t.showSubmit,output:t.output,signal:t.signal,input:t.input,render(){const r=t?.withGuide??_.withGuide,s=`${`${r?`${e("gray",$)}
|
|
57
|
+
`:""}${M(this.state)} `}${t.message}
|
|
58
|
+
`,i=t.placeholder?e("inverse",t.placeholder[0])+e("dim",t.placeholder.slice(1)):e(["inverse","hidden"],"_"),u=this.userInput?this.userInputWithCursor:i,n=this.value??"",o=t.showSubmit?`
|
|
59
|
+
${e(this.focused==="submit"?"cyan":"dim","[ submit ]")}`:"";switch(this.state){case"error":{const c=`${e("yellow",$)} `,a=r?O(t.output,u,c,void 0):u,l=e("yellow",E);return`${s}${a}
|
|
60
|
+
${l} ${e("yellow",this.error)}${o}
|
|
61
|
+
`}case"submit":{const c=`${e("gray",$)} `,a=r?O(t.output,n,c,void 0,l=>e("dim",l)):n?e("dim",n):"";return`${s}${a}`}case"cancel":{const c=`${e("gray",$)} `,a=r?O(t.output,n,c,void 0,l=>e(["strikethrough","dim"],l)):n?e(["strikethrough","dim"],n):"";return`${s}${a}`}default:{const c=r?`${e("cyan",$)} `:"",a=r?e("cyan",E):"",l=r?O(t.output,u,c):u;return`${s}${l}
|
|
62
|
+
${a}${o}
|
|
63
|
+
`}}}}).prompt(),Q=(t,r)=>t.split(`
|
|
64
|
+
`).map(s=>r(s)).join(`
|
|
65
|
+
`),ve=t=>{const r=(i,u)=>{const n=i.label??String(i.value);return u==="disabled"?`${e("gray",J)} ${Q(n,o=>e(["strikethrough","gray"],o))}${i.hint?` ${e("dim",`(${i.hint??"disabled"})`)}`:""}`:u==="active"?`${e("cyan",et)} ${n}${i.hint?` ${e("dim",`(${i.hint})`)}`:""}`:u==="selected"?`${e("green",U)} ${Q(n,o=>e("dim",o))}${i.hint?` ${e("dim",`(${i.hint})`)}`:""}`:u==="cancelled"?`${Q(n,o=>e(["strikethrough","dim"],o))}`:u==="active-selected"?`${e("green",U)} ${n}${i.hint?` ${e("dim",`(${i.hint})`)}`:""}`:u==="submitted"?`${Q(n,o=>e("dim",o))}`:`${e("dim",J)} ${Q(n,o=>e("dim",o))}`},s=t.required??!0;return new Ut({options:t.options,signal:t.signal,input:t.input,output:t.output,initialValues:t.initialValues,required:s,cursorAt:t.cursorAt,validate(i){if(s&&(i===void 0||i.length===0))return`Please select at least one option.
|
|
66
|
+
${e("reset",e("dim",`Press ${e(["gray","bgWhite","inverse"]," space ")} to select, ${e("gray",e("bgWhite",e("inverse"," enter ")))} to submit`))}`},render(){const i=t.withGuide??_.withGuide,u=O(t.output,t.message,i?`${yt(this.state)} `:"",`${M(this.state)} `),n=`${i?`${e("gray",$)}
|
|
67
|
+
`:""}${u}
|
|
68
|
+
`,o=this.value??[],c=(a,l)=>{if(a.disabled)return r(a,"disabled");const d=o.includes(a.value);return l&&d?r(a,"active-selected"):d?r(a,"selected"):r(a,l?"active":"inactive")};switch(this.state){case"submit":{const a=this.options.filter(({value:d})=>o.includes(d)).map(d=>r(d,"submitted")).join(e("dim",", "))||e("dim","none"),l=O(t.output,a,i?`${e("gray",$)} `:"");return`${n}${l}`}case"cancel":{const a=this.options.filter(({value:d})=>o.includes(d)).map(d=>r(d,"cancelled")).join(e("dim",", "));if(a.trim()==="")return`${n}${e("gray",$)}`;const l=O(t.output,a,i?`${e("gray",$)} `:"");return`${n}${l}${i?`
|
|
69
|
+
${e("gray",$)}`:""}`}case"error":{const a=i?`${e("yellow",$)} `:"",l=this.error.split(`
|
|
70
|
+
`).map((p,m)=>m===0?`${i?`${e("yellow",E)} `:""}${e("yellow",p)}`:` ${p}`).join(`
|
|
71
|
+
`),d=n.split(`
|
|
72
|
+
`).length,y=l.split(`
|
|
73
|
+
`).length+1;return`${n}${a}${Y({output:t.output,options:this.options,cursor:this.cursor,maxItems:t.maxItems,columnPadding:a.length,rowPadding:d+y,style:c}).join(`
|
|
74
|
+
${a}`)}
|
|
75
|
+
${l}
|
|
76
|
+
`}default:{const a=i?`${e("cyan",$)} `:"",l=n.split(`
|
|
77
|
+
`).length,d=i?2:1;return`${n}${a}${Y({output:t.output,options:this.options,cursor:this.cursor,maxItems:t.maxItems,columnPadding:a.length,rowPadding:l+d,style:c}).join(`
|
|
78
|
+
${a}`)}
|
|
79
|
+
${i?e("cyan",E):""}
|
|
80
|
+
`}}}}).prompt()},we=t=>e("dim",t),be=(t,r,s)=>{const i={hard:!0,trim:!1},u=q(t,r,i).split(`
|
|
81
|
+
`),n=u.reduce((a,l)=>Math.max(k(l),a),0),o=u.map(s).reduce((a,l)=>Math.max(k(l),a),0),c=r-(o-n);return q(t,c,i)},Se=(t="",r="",s)=>{const i=s?.output??j.stdout,u=s?.withGuide??_.withGuide,n=s?.format??we,o=["",...be(t,X(i)-6,n).split(`
|
|
82
|
+
`).map(n),""],c=k(r),a=Math.max(o.reduce((p,m)=>{const g=k(m);return g>p?g:p},0),c)+2,l=o.map(p=>`${e("gray",$)} ${p}${" ".repeat(a-k(p))}${e("gray",$)}`).join(`
|
|
83
|
+
`),d=u?`${e("gray",$)}
|
|
84
|
+
`:"",y=u?xt:dt;i.write(`${d}${e("green",F)} ${e("reset",r)} ${e("gray",st.repeat(Math.max(a-c-1,1))+ct)}
|
|
85
|
+
${l}
|
|
86
|
+
${e("gray",y+st.repeat(a+2)+$t)}
|
|
87
|
+
`)},Ce=t=>new Kt({validate:t.validate,mask:t.mask??Gt,signal:t.signal,input:t.input,output:t.output,render(){const r=t.withGuide??_.withGuide,s=`${r?`${e("gray",$)}
|
|
88
|
+
`:""}${M(this.state)} ${t.message}
|
|
89
|
+
`,i=this.userInputWithCursor,u=this.masked;switch(this.state){case"error":{const n=r?`${e("yellow",$)} `:"",o=r?`${e("yellow",E)} `:"",c=u??"";return t.clearOnError&&this.clear(),`${s.trim()}
|
|
90
|
+
${n}${c}
|
|
91
|
+
${o}${e("yellow",this.error)}
|
|
92
|
+
`}case"submit":{const n=r?`${e("gray",$)} `:"",o=u?e("dim",u):"";return`${s}${n}${o}`}case"cancel":{const n=r?`${e("gray",$)} `:"",o=u?e(["strikethrough","dim"],u):"";return`${s}${n}${o}${u&&r?`
|
|
93
|
+
${e("gray",$)}`:""}`}default:{const n=r?`${e("cyan",$)} `:"",o=r?e("cyan",E):"";return`${s}${n}${i}
|
|
94
|
+
${o}
|
|
95
|
+
`}}}}).prompt(),Te=t=>{const r=t.validate;return At({...t,initialUserInput:t.initialValue??t.root??process.cwd(),maxItems:5,validate(s){if(!Array.isArray(s)){if(!s)return"Please select a path";if(r)return r(s)}},options(){const s=this.userInput;if(s==="")return[];try{let i;zt(s)?wt(s).isDirectory()&&(!t.directory||s.endsWith("/"))?i=s:i=bt(s):i=bt(s);const u=s.length>1&&s.endsWith("/")?s.slice(0,-1):s;return Qt(i).map(n=>{const o=Zt(i,n),c=wt(o);return{name:n,path:o,isDirectory:c.isDirectory()}}).filter(({path:n,isDirectory:o})=>n.startsWith(u)&&(o||!t.directory)).map(n=>({value:n.path}))}catch{return[]}}})},_e=t=>e("magenta",t),ft=({indicator:t="dots",onCancel:r,output:s=process.stdout,cancelMessage:i,errorMessage:u,frames:n=tt?["\u25D2","\u25D0","\u25D3","\u25D1"]:["\u2022","o","O","0"],delay:o=tt?80:120,signal:c,...a}={})=>{const l=at();let d,y,p=!1,m=!1,g="",S,h=performance.now();const f=X(s),v=a?.styleFrame??_e,T=I=>{const V=I>1?u??_.messages.error:i??_.messages.cancel;m=I===1,p&&(W(V,I),m&&typeof r=="function"&&r())},C=()=>T(2),b=()=>T(1),G=()=>{process.on("uncaughtExceptionMonitor",C),process.on("unhandledRejection",C),process.on("SIGINT",b),process.on("SIGTERM",b),process.on("exit",T),c&&c.addEventListener("abort",b)},x=()=>{process.removeListener("uncaughtExceptionMonitor",C),process.removeListener("unhandledRejection",C),process.removeListener("SIGINT",b),process.removeListener("SIGTERM",b),process.removeListener("exit",T),c&&c.removeEventListener("abort",b)},A=()=>{if(S===void 0)return;l&&s.write(`
|
|
96
|
+
`);const I=q(S,f,{hard:!0,trim:!1}).split(`
|
|
97
|
+
`);I.length>1&&s.write(St.up(I.length-1)),s.write(St.to(0)),s.write(Ct.down())},P=I=>I.replace(/\.+$/,""),N=I=>{const V=(performance.now()-I)/1e3,B=Math.floor(V/60),L=Math.floor(V%60);return B>0?`[${B}m ${L}s]`:`[${L}s]`},D=a.withGuide??_.withGuide,rt=(I="")=>{p=!0,d=qt({output:s}),g=P(I),h=performance.now(),D&&s.write(`${e("gray",$)}
|
|
98
|
+
`);let V=0,B=0;G(),y=setInterval(()=>{if(l&&g===S)return;A(),S=g;const L=v(n[V]);let Z;if(l)Z=`${L} ${g}...`;else if(t==="timer")Z=`${L} ${g} ${N(h)}`;else{const kt=".".repeat(Math.floor(B)).slice(0,3);Z=`${L} ${g}${kt}`}const Nt=q(Z,f,{hard:!0,trim:!1});s.write(Nt),V=V+1<n.length?V+1:0,B=B<4?B+.125:0},o)},W=(I="",V=0,B=!1)=>{if(!p)return;p=!1,clearInterval(y),A();const L=V===0?e("green",F):V===1?e("red",ot):e("red",ut);g=I??g,B||(t==="timer"?s.write(`${L} ${g} ${N(h)}
|
|
99
|
+
`):s.write(`${L} ${g}
|
|
100
|
+
`)),x(),d()};return{start:rt,stop:(I="")=>W(I,0),message:(I="")=>{g=P(I??g)},cancel:(I="")=>W(I,1),error:(I="")=>W(I,2),clear:()=>W("",0,!0),get isCancelled(){return m}}},Vt={light:w("\u2500","-"),heavy:w("\u2501","="),block:w("\u2588","#")};function Ie({style:t="heavy",max:r=100,size:s=40,...i}={}){const u=ft(i);let n=0,o="";const c=Math.max(1,r),a=Math.max(1,s),l=m=>{switch(m){case"initial":case"active":return g=>e("magenta",g);case"error":case"cancel":return g=>e("red",g);case"submit":return g=>e("green",g);default:return g=>e("magenta",g)}},d=(m,g)=>{const S=Math.floor(n/c*a);return`${l(m)(Vt[t].repeat(S))}${e("dim",Vt[t].repeat(a-S))} ${g}`},y=(m="")=>{o=m,u.start(d("initial",m))},p=(m=1,g)=>{n=Math.min(c,m+n),u.message(d("active",g??o)),o=g??o};return{start:y,stop:u.stop,cancel:u.cancel,error:u.error,clear:u.clear,advance:p,isCancelled:u.isCancelled,message:m=>p(0,m)}}const it=(t,r)=>t.includes(`
|
|
101
|
+
`)?t.split(`
|
|
102
|
+
`).map(s=>r(s)).join(`
|
|
103
|
+
`):r(t),Ee=t=>{const r=(s,i)=>{const u=s.label??String(s.value);switch(i){case"disabled":return`${e("gray",H)} ${it(u,n=>e("gray",n))}${s.hint?` ${e("dim",`(${s.hint??"disabled"})`)}`:""}`;case"selected":return`${it(u,n=>e("dim",n))}`;case"active":return`${e("green",z)} ${u}${s.hint?` ${e("dim",`(${s.hint})`)}`:""}`;case"cancelled":return`${it(u,n=>e(["strikethrough","dim"],n))}`;default:return`${e("dim",H)} ${it(u,n=>e("dim",n))}`}};return new Jt({options:t.options,signal:t.signal,input:t.input,output:t.output,initialValue:t.initialValue,render(){const s=t.withGuide??_.withGuide,i=`${M(this.state)} `,u=`${yt(this.state)} `,n=O(t.output,t.message,u,i),o=`${s?`${e("gray",$)}
|
|
104
|
+
`:""}${n}
|
|
105
|
+
`;switch(this.state){case"submit":{const c=s?`${e("gray",$)} `:"",a=O(t.output,r(this.options[this.cursor],"selected"),c);return`${o}${a}`}case"cancel":{const c=s?`${e("gray",$)} `:"",a=O(t.output,r(this.options[this.cursor],"cancelled"),c);return`${o}${a}${s?`
|
|
106
|
+
${e("gray",$)}`:""}`}default:{const c=s?`${e("cyan",$)} `:"",a=s?e("cyan",E):"",l=o.split(`
|
|
107
|
+
`).length,d=s?2:1;return`${o}${c}${Y({output:t.output,cursor:this.cursor,options:this.options,maxItems:t.maxItems,columnPadding:c.length,rowPadding:l+d,style:(y,p)=>r(y,y.disabled?"disabled":p?"active":"inactive")}).join(`
|
|
108
|
+
${c}`)}
|
|
109
|
+
${a}
|
|
110
|
+
`}}}}).prompt()},Ge=t=>{const r=(s,i="inactive")=>{const u=s.label??String(s.value);return i==="selected"?`${e("dim",u)}`:i==="cancelled"?`${e(["strikethrough","dim"],u)}`:i==="active"?`${e(["bgCyan","gray"],` ${s.value} `)} ${u}${s.hint?` ${e("dim",`(${s.hint})`)}`:""}`:`${e(["gray","bgWhite","inverse"],` ${s.value} `)} ${u}${s.hint?` ${e("dim",`(${s.hint})`)}`:""}`};return new Yt({options:t.options,signal:t.signal,input:t.input,output:t.output,initialValue:t.initialValue,caseSensitive:t.caseSensitive,render(){const s=t.withGuide??_.withGuide,i=`${s?`${e("gray",$)}
|
|
111
|
+
`:""}${M(this.state)} ${t.message}
|
|
112
|
+
`;switch(this.state){case"submit":{const u=s?`${e("gray",$)} `:"",n=this.options.find(c=>c.value===this.value)??t.options[0],o=O(t.output,r(n,"selected"),u);return`${i}${o}`}case"cancel":{const u=s?`${e("gray",$)} `:"",n=O(t.output,r(this.options[0],"cancelled"),u);return`${i}${n}${s?`
|
|
113
|
+
${e("gray",$)}`:""}`}default:{const u=s?`${e("cyan",$)} `:"",n=s?e("cyan",E):"",o=this.options.map((c,a)=>O(t.output,r(c,a===this.cursor?"active":"inactive"),u)).join(`
|
|
114
|
+
`);return`${i}${o}
|
|
115
|
+
${n}
|
|
116
|
+
`}}}}).prompt()},jt=`${e("gray",$)} `,K={message:async(t,{symbol:r=e("gray",$)}={})=>{process.stdout.write(`${e("gray",$)}
|
|
117
|
+
${r} `);let s=3;for await(let i of t){i=i.replace(/\n/g,`
|
|
118
|
+
${jt}`),i.includes(`
|
|
119
|
+
`)&&(s=3+nt(i.slice(i.lastIndexOf(`
|
|
120
|
+
`))).length);const u=nt(i).length;s+u<process.stdout.columns?(s+=u,process.stdout.write(i)):(process.stdout.write(`
|
|
121
|
+
${jt}${i.trimStart()}`),s=3+nt(i.trimStart()).length)}process.stdout.write(`
|
|
122
|
+
`)},info:t=>K.message(t,{symbol:e("blue",ht)}),success:t=>K.message(t,{symbol:e("green",pt)}),step:t=>K.message(t,{symbol:e("green",F)}),warn:t=>K.message(t,{symbol:e("yellow",mt)}),warning:t=>K.warn(t),error:t=>K.message(t,{symbol:e("red",gt)})},xe=async(t,r)=>{for(const s of t){if(s.enabled===!1)continue;const i=ft(r);i.start(s.title);const u=await s.task(i.message);i.stop(u||s.title)}},Oe=t=>t.replace(/\x1b\[(?:\d+;)*\d*[ABCDEFGHfJKSTsu]|\x1b\[(s|u)/g,""),Me=t=>{const r=t.output??process.stdout,s=X(r),i=e("gray",$),u=t.spacing??1,n=3,o=t.retainLog===!0,c=!at()&&Tt(r);r.write(`${i}
|
|
123
|
+
`),r.write(`${e("green",F)} ${t.title}
|
|
124
|
+
`);for(let h=0;h<u;h++)r.write(`${i}
|
|
125
|
+
`);const a=[{value:"",full:""}];let l=!1;const d=h=>{if(a.length===0)return;let f=0;h&&(f+=u+2);for(const v of a){const{value:T,result:C}=v;let b=C?.message??T;if(b.length===0)continue;C===void 0&&v.header!==void 0&&v.header!==""&&(b+=`
|
|
126
|
+
${v.header}`);const G=b.split(`
|
|
127
|
+
`).reduce((x,A)=>A===""?x+1:x+Math.ceil((A.length+n)/s),0);f+=G}f>0&&(f+=1,r.write(Ct.lines(f)))},y=(h,f,v)=>{const T=v?`${h.full}
|
|
128
|
+
${h.value}`:h.value;h.header!==void 0&&h.header!==""&&R.message(h.header.split(`
|
|
129
|
+
`).map(C=>e("bold",C)),{output:r,secondarySymbol:i,symbol:i,spacing:0}),R.message(T.split(`
|
|
130
|
+
`).map(C=>e("dim",C)),{output:r,secondarySymbol:i,symbol:i,spacing:f??u})},p=()=>{for(const h of a){const{header:f,value:v,full:T}=h;(f===void 0||f.length===0)&&v.length===0||y(h,void 0,o===!0&&T.length>0)}},m=(h,f,v)=>{if(d(!1),(v?.raw!==!0||!l)&&h.value!==""&&(h.value+=`
|
|
131
|
+
`),h.value+=Oe(f),l=v?.raw===!0,t.limit!==void 0){const T=h.value.split(`
|
|
132
|
+
`),C=T.length-t.limit;if(C>0){const b=T.splice(0,C);o&&(h.full+=(h.full===""?"":`
|
|
133
|
+
`)+b.join(`
|
|
134
|
+
`))}h.value=T.join(`
|
|
135
|
+
`)}c&&g()},g=()=>{for(const h of a)h.result?h.result.status==="error"?R.error(h.result.message,{output:r,secondarySymbol:i,spacing:0}):R.success(h.result.message,{output:r,secondarySymbol:i,spacing:0}):h.value!==""&&y(h,0)},S=(h,f)=>{d(!1),h.result=f,c&&g()};return{message(h,f){m(a[0],h,f)},group(h){const f={header:h,value:"",full:""};return a.push(f),{message(v,T){m(f,v,T)},error(v){S(f,{status:"error",message:v})},success(v){S(f,{status:"success",message:v})}}},error(h,f){d(!0),R.error(h,{output:r,secondarySymbol:i,spacing:1}),f?.showLog!==!1&&p(),a.splice(1,a.length-1),a[0].value="",a[0].full=""},success(h,f){d(!0),R.success(h,{output:r,secondarySymbol:i,spacing:1}),f?.showLog===!0&&p(),a.splice(1,a.length-1),a[0].value="",a[0].full=""}}},Re=t=>new Xt({validate:t.validate,placeholder:t.placeholder,defaultValue:t.defaultValue,initialValue:t.initialValue,output:t.output,signal:t.signal,input:t.input,render(){const r=t?.withGuide??_.withGuide,s=`${`${r?`${e("gray",$)}
|
|
136
|
+
`:""}${M(this.state)} `}${t.message}
|
|
137
|
+
`,i=t.placeholder?e("inverse",t.placeholder[0])+e("dim",t.placeholder.slice(1)):e(["inverse","hidden"],"_"),u=this.userInput?this.userInputWithCursor:i,n=this.value??"";switch(this.state){case"error":{const o=this.error?` ${e("yellow",this.error)}`:"",c=r?`${e("yellow",$)} `:"",a=r?e("yellow",E):"";return`${s.trim()}
|
|
138
|
+
${c}${u}
|
|
139
|
+
${a}${o}
|
|
140
|
+
`}case"submit":{const o=n?` ${e("dim",n)}`:"",c=r?e("gray",$):"";return`${s}${c}${o}`}case"cancel":{const o=n?` ${e(["strikethrough","dim"],n)}`:"",c=r?e("gray",$):"";return`${s}${c}${o}${n.trim()?`
|
|
141
|
+
${c}`:""}`}default:{const o=r?`${e("cyan",$)} `:"",c=r?e("cyan",E):"";return`${s}${o}${u}
|
|
142
|
+
${c}
|
|
143
|
+
`}}}}).prompt();export{$ as S_BAR,E as S_BAR_END,Et as S_BAR_END_RIGHT,st as S_BAR_H,lt as S_BAR_START,It as S_BAR_START_RIGHT,et as S_CHECKBOX_ACTIVE,J as S_CHECKBOX_INACTIVE,U as S_CHECKBOX_SELECTED,xt as S_CONNECT_LEFT,dt as S_CORNER_BOTTOM_LEFT,$t as S_CORNER_BOTTOM_RIGHT,Ot as S_CORNER_TOP_LEFT,ct as S_CORNER_TOP_RIGHT,gt as S_ERROR,ht as S_INFO,Gt as S_PASSWORD_MASK,z as S_RADIO_ACTIVE,H as S_RADIO_INACTIVE,_t as S_STEP_ACTIVE,ot as S_STEP_CANCEL,ut as S_STEP_ERROR,F as S_STEP_SUBMIT,pt as S_SUCCESS,mt as S_WARN,At as autocomplete,ie as autocompleteMultiselect,oe as box,me as cancel,ue as confirm,le as date,he as group,pe as groupMultiselect,ge as intro,at as isCI,Tt as isTTY,Y as limitOptions,R as log,fe as multiline,ve as multiselect,Se as note,ye as outro,Ce as password,Te as path,Ie as progress,Ee as select,Ge as selectKey,ft as spinner,K as stream,M as symbol,yt as symbolBar,Me as taskLog,xe as tasks,Re as text,tt as unicode,w as unicodeOr};
|
|
144
|
+
//# sourceMappingURL=index.mjs.map
|