@socketsecurity/lib 3.0.4 → 3.0.6
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 +55 -0
- package/dist/effects/pulse-frames.d.ts +7 -0
- package/dist/effects/pulse-frames.js.map +2 -2
- package/dist/effects/text-shimmer.d.ts +1 -0
- package/dist/effects/text-shimmer.js +13 -1
- package/dist/effects/text-shimmer.js.map +2 -2
- package/dist/effects/types.d.ts +6 -0
- package/dist/effects/types.js.map +1 -1
- package/dist/external/@socketregistry/packageurl-js.js +5 -40
- package/dist/links/index.js +2 -1
- package/dist/links/index.js.map +2 -2
- package/dist/logger.js +41 -2
- package/dist/logger.js.map +2 -2
- package/dist/packages/isolation.js +2 -4
- package/dist/packages/isolation.js.map +3 -3
- package/dist/spinner.d.ts +6 -0
- package/dist/spinner.js +9 -1
- package/dist/spinner.js.map +2 -2
- package/dist/stdio/prompts.d.ts +51 -8
- package/dist/stdio/prompts.js +82 -0
- package/dist/stdio/prompts.js.map +3 -3
- package/package.json +2 -18
- package/dist/index.d.ts +0 -14
- package/dist/index.js +0 -71
- package/dist/index.js.map +0 -7
- package/dist/prompts/index.d.ts +0 -115
- package/dist/prompts/index.js +0 -47
- package/dist/prompts/index.js.map +0 -7
- package/dist/prompts.d.ts +0 -27
- package/dist/prompts.js +0 -60
- package/dist/prompts.js.map +0 -7
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../src/stdio/prompts.ts"],
|
|
4
|
-
"sourcesContent": ["/**\n * @fileoverview User prompt utilities for interactive scripts.\n * Provides inquirer.js integration with spinner support and context handling.\n */\n\nimport { getAbortSignal, getSpinner } from '#constants/process'\n\nconst abortSignal = getAbortSignal()\nconst spinner = getSpinner()\n\n// Type definitions\n\n/**\n * Choice option for select and search prompts.\n *\n * @template Value - Type of the choice value\n */\nexport interface Choice<Value = unknown> {\n /** The value returned when this choice is selected */\n value: Value\n /** Whether this choice is disabled, or a reason string */\n disabled?: boolean | string | undefined\n /** Additional description text shown below the choice */\n description?: string | undefined\n /** Display name for the choice (defaults to value.toString()) */\n name?: string | undefined\n /** Short text shown after selection (defaults to name) */\n short?: string | undefined\n}\n\n/**\n * Context for inquirer prompts.\n * Minimal context interface used by Inquirer prompts.\n * Duplicated from `@inquirer/type` - InquirerContext.\n */\ninterface InquirerContext {\n /** Abort signal for cancelling the prompt */\n signal?: AbortSignal | undefined\n /** Input stream (defaults to process.stdin) */\n input?: NodeJS.ReadableStream | undefined\n /** Output stream (defaults to process.stdout) */\n output?: NodeJS.WritableStream | undefined\n /** Clear the prompt from terminal when done */\n clearPromptOnDone?: boolean | undefined\n}\n\n/**\n * Extended context with spinner support.\n * Allows passing a spinner instance to be managed during prompts.\n */\nexport type Context = import('../objects').Remap<\n InquirerContext & {\n /** Optional spinner to stop/start during prompt display */\n spinner?: import('../spinner').Spinner | undefined\n }\n>\n\n/**\n * Separator for visual grouping in select/checkbox prompts.\n * Creates a non-selectable visual separator line.\n * Duplicated from `@inquirer/select` - Separator.\n * This type definition ensures the Separator type is available in published packages.\n *\n * @example\n * import { Separator } from './prompts'\n *\n * const choices = [\n * { name: 'Option 1', value: 1 },\n * new Separator(),\n * { name: 'Option 2', value: 2 }\n * ]\n */\ndeclare class SeparatorType {\n readonly separator: string\n readonly type: 'separator'\n constructor(separator?: string)\n}\n\nexport type Separator = SeparatorType\n\n/**\n * Wrap an inquirer prompt with spinner handling and signal injection.\n * Automatically stops/starts spinners during prompt display and injects abort signals.\n * Trims string results and handles cancellation gracefully.\n *\n * @template T - Type of the prompt result\n * @param inquirerPrompt - The inquirer prompt function to wrap\n * @returns Wrapped prompt function with spinner and signal handling\n *\n * @example\n * const myPrompt = wrapPrompt(rawInquirerPrompt)\n * const result = await myPrompt({ message: 'Enter name:' })\n */\n/*@__NO_SIDE_EFFECTS__*/\nexport function wrapPrompt<T = unknown>(\n inquirerPrompt: (...args: unknown[]) => Promise<T>,\n): (...args: unknown[]) => Promise<T | undefined> {\n return async (...args) => {\n const origContext = (args.length > 1 ? args[1] : undefined) as\n | Context\n | undefined\n const { spinner: contextSpinner, ...contextWithoutSpinner } =\n origContext ?? ({} as Context)\n const spinnerInstance =\n contextSpinner !== undefined ? contextSpinner : spinner\n const signal = abortSignal\n if (origContext) {\n args[1] = {\n signal,\n ...contextWithoutSpinner,\n }\n } else {\n args[1] = { signal }\n }\n const wasSpinning = !!spinnerInstance?.isSpinning\n spinnerInstance?.stop()\n let result: unknown\n try {\n result = await inquirerPrompt(...args)\n } catch (e) {\n if (e instanceof TypeError) {\n throw e\n }\n }\n if (wasSpinning) {\n spinnerInstance.start()\n }\n return (typeof result === 'string' ? result.trim() : result) as\n | T\n | undefined\n }\n}\n\n// c8 ignore start - Third-party inquirer library requires and exports not testable in isolation.\nconst confirmExport = /*@__PURE__*/ require('../external/@inquirer/confirm')\nconst inputExport = /*@__PURE__*/ require('../external/@inquirer/input')\nconst passwordExport = /*@__PURE__*/ require('../external/@inquirer/password')\nconst searchExport = /*@__PURE__*/ require('../external/@inquirer/search')\nconst selectExport = /*@__PURE__*/ require('../external/@inquirer/select')\nconst confirmRaw = confirmExport.default ?? confirmExport\nconst inputRaw = inputExport.default ?? inputExport\nconst passwordRaw = passwordExport.default ?? passwordExport\nconst searchRaw = searchExport.default ?? searchExport\nconst selectRaw = selectExport.default ?? selectExport\nconst ActualSeparator = selectExport.Separator\n// c8 ignore stop\n\n/**\n * Prompt for a yes/no confirmation.\n * Wrapped with spinner handling and abort signal support.\n *\n * @example\n * const answer = await confirm({ message: 'Continue?' })\n * if (answer) { // user confirmed }\n */\nexport const confirm: typeof confirmRaw = wrapPrompt(confirmRaw)\n\n/**\n * Prompt for text input.\n * Wrapped with spinner handling and abort signal support.\n * Result is automatically trimmed.\n *\n * @example\n * const name = await input({ message: 'Enter your name:' })\n */\nexport const input: typeof inputRaw = wrapPrompt(inputRaw)\n\n/**\n * Prompt for password input (hidden characters).\n * Wrapped with spinner handling and abort signal support.\n *\n * @example\n * const token = await password({ message: 'Enter API token:' })\n */\nexport const password: typeof passwordRaw = wrapPrompt(passwordRaw)\n\n/**\n * Prompt with searchable/filterable choices.\n * Wrapped with spinner handling and abort signal support.\n *\n * @example\n * const result = await search({\n * message: 'Select a package:',\n * source: async (input) => fetchPackages(input)\n * })\n */\nexport const search: typeof searchRaw = wrapPrompt(searchRaw)\n\n/**\n * Prompt to select from a list of choices.\n * Wrapped with spinner handling and abort signal support.\n *\n * @example\n * const choice = await select({\n * message: 'Choose an option:',\n * choices: [\n * { name: 'Option 1', value: 'opt1' },\n * { name: 'Option 2', value: 'opt2' }\n * ]\n * })\n */\nexport const select: typeof selectRaw = wrapPrompt(selectRaw)\n\nexport { ActualSeparator as Separator }\n"],
|
|
5
|
-
"mappings": "
|
|
6
|
-
"names": []
|
|
4
|
+
"sourcesContent": ["/**\n * @fileoverview User prompt utilities for interactive scripts.\n * Provides inquirer.js integration with spinner support, context handling, and theming.\n */\n\nimport { getAbortSignal, getSpinner } from '#constants/process'\nimport type { ColorValue } from '../spinner'\nimport { getTheme } from '../themes/context'\nimport { THEMES, type ThemeName } from '../themes/themes'\nimport type { Theme } from '../themes/types'\nimport { resolveColor } from '../themes/utils'\nimport yoctocolorsCjs from '../external/yoctocolors-cjs'\n\nconst abortSignal = getAbortSignal()\nconst spinner = getSpinner()\n\n/**\n * Apply a color to text using yoctocolors.\n * Handles both named colors and RGB tuples.\n * @private\n */\nfunction applyColor(text: string, color: ColorValue): string {\n if (typeof color === 'string') {\n // Named color like 'green', 'red', etc.\n return (yoctocolorsCjs as any)[color](text)\n }\n // RGB tuple [r, g, b]\n return yoctocolorsCjs.rgb(color[0], color[1], color[2])(text)\n}\n\n// Type definitions\n\n/**\n * Choice option for select and search prompts.\n *\n * @template Value - Type of the choice value\n */\nexport interface Choice<Value = unknown> {\n /** The value returned when this choice is selected */\n value: Value\n /** Display name for the choice (defaults to value.toString()) */\n name?: string | undefined\n /** Additional description text shown below the choice */\n description?: string | undefined\n /** Short text shown after selection (defaults to name) */\n short?: string | undefined\n /** Whether this choice is disabled, or a reason string */\n disabled?: boolean | string | undefined\n}\n\n/**\n * Context for inquirer prompts.\n * Minimal context interface used by Inquirer prompts.\n * Duplicated from `@inquirer/type` - InquirerContext.\n */\ninterface InquirerContext {\n /** Abort signal for cancelling the prompt */\n signal?: AbortSignal | undefined\n /** Input stream (defaults to process.stdin) */\n input?: NodeJS.ReadableStream | undefined\n /** Output stream (defaults to process.stdout) */\n output?: NodeJS.WritableStream | undefined\n /** Clear the prompt from terminal when done */\n clearPromptOnDone?: boolean | undefined\n}\n\n/**\n * Extended context with spinner support.\n * Allows passing a spinner instance to be managed during prompts.\n */\nexport type Context = import('../objects').Remap<\n InquirerContext & {\n /** Optional spinner to stop/start during prompt display */\n spinner?: import('../spinner').Spinner | undefined\n }\n>\n\n/**\n * Separator for visual grouping in select/checkbox prompts.\n * Creates a non-selectable visual separator line.\n * Duplicated from `@inquirer/select` - Separator.\n * This type definition ensures the Separator type is available in published packages.\n *\n * @example\n * import { Separator } from './prompts'\n *\n * const choices = [\n * { name: 'Option 1', value: 1 },\n * new Separator(),\n * { name: 'Option 2', value: 2 }\n * ]\n */\ndeclare class SeparatorType {\n readonly separator: string\n readonly type: 'separator'\n constructor(separator?: string)\n}\n\nexport type Separator = SeparatorType\n\n/**\n * Resolve theme name or object to Theme.\n * @param theme - Theme name or object\n * @returns Resolved Theme\n */\nfunction resolveTheme(theme: Theme | ThemeName): Theme {\n return typeof theme === 'string' ? THEMES[theme] : theme\n}\n\n/**\n * Check if value is a Socket Theme object.\n * @param value - Value to check\n * @returns True if value is a Socket Theme\n */\nfunction isSocketTheme(value: unknown): value is Theme {\n return (\n typeof value === 'object' &&\n value !== null &&\n 'name' in value &&\n 'colors' in value\n )\n}\n\n/**\n * Convert Socket theme to @inquirer theme format.\n * Maps our theme colors to inquirer's style functions.\n * Handles theme names, Theme objects, and passes through @inquirer themes.\n *\n * @param theme - Socket theme name, Theme object, or @inquirer theme\n * @returns @inquirer theme object\n *\n * @example\n * ```ts\n * // Socket theme name\n * createInquirerTheme('sunset')\n *\n * // Socket Theme object\n * createInquirerTheme(SUNSET_THEME)\n *\n * // @inquirer theme (passes through)\n * createInquirerTheme({ style: {...}, icon: {...} })\n * ```\n */\nexport function createInquirerTheme(\n theme: Theme | ThemeName | unknown,\n): Record<string, unknown> {\n // If it's a string (theme name) or Socket Theme object, convert it\n if (typeof theme === 'string' || isSocketTheme(theme)) {\n const socketTheme = resolveTheme(theme as Theme | ThemeName)\n const promptColor = resolveColor(\n socketTheme.colors.prompt,\n socketTheme.colors,\n ) as ColorValue\n const textDimColor = resolveColor(\n socketTheme.colors.textDim,\n socketTheme.colors,\n ) as ColorValue\n const errorColor = socketTheme.colors.error\n const successColor = socketTheme.colors.success\n const primaryColor = socketTheme.colors.primary\n\n return {\n style: {\n // Message text (uses colors.prompt)\n message: (text: string) => applyColor(text, promptColor),\n // Answer text (uses primary color)\n answer: (text: string) => applyColor(text, primaryColor),\n // Help text / descriptions (uses textDim)\n help: (text: string) => applyColor(text, textDimColor),\n description: (text: string) => applyColor(text, textDimColor),\n // Disabled items (uses textDim)\n disabled: (text: string) => applyColor(text, textDimColor),\n // Error messages (uses error color)\n error: (text: string) => applyColor(text, errorColor),\n // Highlight/active (uses primary color)\n highlight: (text: string) => applyColor(text, primaryColor),\n },\n icon: {\n // Use success color for confirmed items\n checked: applyColor('\u2713', successColor),\n unchecked: ' ',\n // Cursor uses primary color\n cursor: applyColor('\u276F', primaryColor),\n },\n }\n }\n\n // Otherwise it's already an @inquirer theme, return as-is\n return theme as Record<string, unknown>\n}\n\n/**\n * Wrap an inquirer prompt with spinner handling, theme injection, and signal injection.\n * Automatically stops/starts spinners during prompt display, injects the current theme,\n * and injects abort signals. Trims string results and handles cancellation gracefully.\n *\n * @template T - Type of the prompt result\n * @param inquirerPrompt - The inquirer prompt function to wrap\n * @returns Wrapped prompt function with spinner, theme, and signal handling\n *\n * @example\n * const myPrompt = wrapPrompt(rawInquirerPrompt)\n * const result = await myPrompt({ message: 'Enter name:' })\n */\n/*@__NO_SIDE_EFFECTS__*/\nexport function wrapPrompt<T = unknown>(\n inquirerPrompt: (...args: unknown[]) => Promise<T>,\n): (...args: unknown[]) => Promise<T | undefined> {\n return async (...args) => {\n const origContext = (args.length > 1 ? args[1] : undefined) as\n | Context\n | undefined\n const { spinner: contextSpinner, ...contextWithoutSpinner } =\n origContext ?? ({} as Context)\n const spinnerInstance =\n contextSpinner !== undefined ? contextSpinner : spinner\n const signal = abortSignal\n\n // Inject theme into config (args[0])\n const config = args[0] as Record<string, unknown>\n if (config && typeof config === 'object') {\n if (!config.theme) {\n // No theme provided, use current theme\n config.theme = createInquirerTheme(getTheme())\n } else {\n // Theme provided - let createInquirerTheme handle detection\n config.theme = createInquirerTheme(config.theme)\n }\n }\n\n // Inject signal into context (args[1])\n if (origContext) {\n args[1] = {\n signal,\n ...contextWithoutSpinner,\n }\n } else {\n args[1] = { signal }\n }\n\n const wasSpinning = !!spinnerInstance?.isSpinning\n spinnerInstance?.stop()\n let result: unknown\n try {\n result = await inquirerPrompt(...args)\n } catch (e) {\n if (e instanceof TypeError) {\n throw e\n }\n }\n if (wasSpinning) {\n spinnerInstance.start()\n }\n return (typeof result === 'string' ? result.trim() : result) as\n | T\n | undefined\n }\n}\n\n// c8 ignore start - Third-party inquirer library requires and exports not testable in isolation.\nconst confirmExport = /*@__PURE__*/ require('../external/@inquirer/confirm')\nconst inputExport = /*@__PURE__*/ require('../external/@inquirer/input')\nconst passwordExport = /*@__PURE__*/ require('../external/@inquirer/password')\nconst searchExport = /*@__PURE__*/ require('../external/@inquirer/search')\nconst selectExport = /*@__PURE__*/ require('../external/@inquirer/select')\nconst confirmRaw = confirmExport.default ?? confirmExport\nconst inputRaw = inputExport.default ?? inputExport\nconst passwordRaw = passwordExport.default ?? passwordExport\nconst searchRaw = searchExport.default ?? searchExport\nconst selectRaw = selectExport.default ?? selectExport\nconst ActualSeparator = selectExport.Separator\n// c8 ignore stop\n\n/**\n * Prompt for a yes/no confirmation.\n * Wrapped with spinner handling and abort signal support.\n *\n * @example\n * const answer = await confirm({ message: 'Continue?' })\n * if (answer) { // user confirmed }\n */\nexport const confirm: typeof confirmRaw = wrapPrompt(confirmRaw)\n\n/**\n * Prompt for text input.\n * Wrapped with spinner handling and abort signal support.\n * Result is automatically trimmed.\n *\n * @example\n * const name = await input({ message: 'Enter your name:' })\n */\nexport const input: typeof inputRaw = wrapPrompt(inputRaw)\n\n/**\n * Prompt for password input (hidden characters).\n * Wrapped with spinner handling and abort signal support.\n *\n * @example\n * const token = await password({ message: 'Enter API token:' })\n */\nexport const password: typeof passwordRaw = wrapPrompt(passwordRaw)\n\n/**\n * Prompt with searchable/filterable choices.\n * Wrapped with spinner handling and abort signal support.\n *\n * @example\n * const result = await search({\n * message: 'Select a package:',\n * source: async (input) => fetchPackages(input)\n * })\n */\nexport const search: typeof searchRaw = wrapPrompt(searchRaw)\n\n/**\n * Prompt to select from a list of choices.\n * Wrapped with spinner handling and abort signal support.\n *\n * @example\n * const choice = await select({\n * message: 'Choose an option:',\n * choices: [\n * { name: 'Option 1', value: 'opt1' },\n * { name: 'Option 2', value: 'opt2' }\n * ]\n * })\n */\nexport const select: typeof selectRaw = wrapPrompt(selectRaw)\n\nexport { ActualSeparator as Separator }\n\n/**\n * Create a separator for select prompts.\n * Creates a visual separator line in choice lists.\n *\n * @param text - Optional separator text (defaults to '\u2500\u2500\u2500\u2500\u2500\u2500\u2500')\n * @returns Separator instance\n *\n * @example\n * import { select, createSeparator } from '@socketsecurity/lib/stdio/prompts'\n *\n * const choice = await select({\n * message: 'Choose an option:',\n * choices: [\n * { name: 'Option 1', value: 1 },\n * createSeparator(),\n * { name: 'Option 2', value: 2 }\n * ]\n * })\n */\nexport function createSeparator(\n text?: string,\n): InstanceType<typeof ActualSeparator> {\n return new ActualSeparator(text)\n}\n"],
|
|
5
|
+
"mappings": "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",
|
|
6
|
+
"names": ["yoctocolorsCjs"]
|
|
7
7
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@socketsecurity/lib",
|
|
3
|
-
"version": "3.0.
|
|
3
|
+
"version": "3.0.6",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"description": "Core utilities and infrastructure for Socket.dev security tools",
|
|
6
6
|
"keywords": [
|
|
@@ -20,14 +20,6 @@
|
|
|
20
20
|
"url": "https://socket.dev"
|
|
21
21
|
},
|
|
22
22
|
"exports": {
|
|
23
|
-
".": {
|
|
24
|
-
"types": "./dist/index.d.ts",
|
|
25
|
-
"default": "./dist/index.js"
|
|
26
|
-
},
|
|
27
|
-
"./index": {
|
|
28
|
-
"types": "./dist/index.d.ts",
|
|
29
|
-
"default": "./dist/index.js"
|
|
30
|
-
},
|
|
31
23
|
"./abort": {
|
|
32
24
|
"types": "./dist/abort.d.ts",
|
|
33
25
|
"default": "./dist/abort.js"
|
|
@@ -396,14 +388,6 @@
|
|
|
396
388
|
"types": "./dist/promises.d.ts",
|
|
397
389
|
"default": "./dist/promises.js"
|
|
398
390
|
},
|
|
399
|
-
"./prompts": {
|
|
400
|
-
"types": "./dist/prompts/index.d.ts",
|
|
401
|
-
"default": "./dist/prompts/index.js"
|
|
402
|
-
},
|
|
403
|
-
"./prompts/index": {
|
|
404
|
-
"types": "./dist/prompts/index.d.ts",
|
|
405
|
-
"default": "./dist/prompts/index.js"
|
|
406
|
-
},
|
|
407
391
|
"./regexps": {
|
|
408
392
|
"types": "./dist/regexps.d.ts",
|
|
409
393
|
"default": "./dist/regexps.js"
|
|
@@ -605,7 +589,7 @@
|
|
|
605
589
|
"@npmcli/package-json": "7.0.0",
|
|
606
590
|
"@npmcli/promise-spawn": "8.0.3",
|
|
607
591
|
"@socketregistry/is-unicode-supported": "1.0.5",
|
|
608
|
-
"@socketregistry/packageurl-js": "1.3.
|
|
592
|
+
"@socketregistry/packageurl-js": "1.3.3",
|
|
609
593
|
"@socketregistry/yocto-spinner": "1.0.19",
|
|
610
594
|
"@types/node": "24.9.2",
|
|
611
595
|
"@typescript/native-preview": "7.0.0-dev.20250920.1",
|
package/dist/index.d.ts
DELETED
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @fileoverview Main entry point for @socketsecurity/lib.
|
|
3
|
-
* Clean, organized exports for better developer experience.
|
|
4
|
-
*/
|
|
5
|
-
// Export logger utilities for convenience
|
|
6
|
-
export { getDefaultLogger, Logger, LOG_SYMBOLS } from './logger';
|
|
7
|
-
// Export spinner utilities for convenience
|
|
8
|
-
export { getDefaultSpinner, Spinner } from './spinner';
|
|
9
|
-
// Export types
|
|
10
|
-
export * from './types';
|
|
11
|
-
// Manifest data helper function
|
|
12
|
-
export declare function getManifestData(ecosystem?: string, packageName?: string): any;
|
|
13
|
-
// Version export
|
|
14
|
-
export declare const version = "3.0.1";
|
package/dist/index.js
DELETED
|
@@ -1,71 +0,0 @@
|
|
|
1
|
-
/* Socket Lib - Built with esbuild */
|
|
2
|
-
var __defProp = Object.defineProperty;
|
|
3
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
-
var __export = (target, all) => {
|
|
7
|
-
for (var name in all)
|
|
8
|
-
__defProp(target, name, { get: all[name], enumerable: true });
|
|
9
|
-
};
|
|
10
|
-
var __copyProps = (to, from, except, desc) => {
|
|
11
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
12
|
-
for (let key of __getOwnPropNames(from))
|
|
13
|
-
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
14
|
-
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
15
|
-
}
|
|
16
|
-
return to;
|
|
17
|
-
};
|
|
18
|
-
var __reExport = (target, mod, secondTarget) => (__copyProps(target, mod, "default"), secondTarget && __copyProps(secondTarget, mod, "default"));
|
|
19
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
20
|
-
var index_exports = {};
|
|
21
|
-
__export(index_exports, {
|
|
22
|
-
LOG_SYMBOLS: () => import_logger.LOG_SYMBOLS,
|
|
23
|
-
Logger: () => import_logger.Logger,
|
|
24
|
-
Spinner: () => import_spinner.Spinner,
|
|
25
|
-
getDefaultLogger: () => import_logger.getDefaultLogger,
|
|
26
|
-
getDefaultSpinner: () => import_spinner.getDefaultSpinner,
|
|
27
|
-
getManifestData: () => getManifestData,
|
|
28
|
-
version: () => version
|
|
29
|
-
});
|
|
30
|
-
module.exports = __toCommonJS(index_exports);
|
|
31
|
-
var import_logger = require("./logger");
|
|
32
|
-
var import_spinner = require("./spinner");
|
|
33
|
-
__reExport(index_exports, require("./types"), module.exports);
|
|
34
|
-
function getManifestData(ecosystem, packageName) {
|
|
35
|
-
try {
|
|
36
|
-
const manifestData = require("../manifest.json");
|
|
37
|
-
if (!ecosystem) {
|
|
38
|
-
return manifestData;
|
|
39
|
-
}
|
|
40
|
-
const ecoData = manifestData[ecosystem];
|
|
41
|
-
if (!ecoData) {
|
|
42
|
-
return void 0;
|
|
43
|
-
}
|
|
44
|
-
if (!packageName) {
|
|
45
|
-
return ecoData;
|
|
46
|
-
}
|
|
47
|
-
if (Array.isArray(ecoData)) {
|
|
48
|
-
const entry = ecoData.find(
|
|
49
|
-
([_purl, data]) => data.package === packageName
|
|
50
|
-
);
|
|
51
|
-
return entry ? entry[1] : void 0;
|
|
52
|
-
}
|
|
53
|
-
const pkgData = ecoData[packageName];
|
|
54
|
-
return pkgData ? [packageName, pkgData] : void 0;
|
|
55
|
-
} catch {
|
|
56
|
-
return void 0;
|
|
57
|
-
}
|
|
58
|
-
}
|
|
59
|
-
const version = "3.0.1";
|
|
60
|
-
// Annotate the CommonJS export names for ESM import in node:
|
|
61
|
-
0 && (module.exports = {
|
|
62
|
-
LOG_SYMBOLS,
|
|
63
|
-
Logger,
|
|
64
|
-
Spinner,
|
|
65
|
-
getDefaultLogger,
|
|
66
|
-
getDefaultSpinner,
|
|
67
|
-
getManifestData,
|
|
68
|
-
version,
|
|
69
|
-
...require("./types")
|
|
70
|
-
});
|
|
71
|
-
//# sourceMappingURL=index.js.map
|
package/dist/index.js.map
DELETED
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../src/index.ts"],
|
|
4
|
-
"sourcesContent": ["/**\n * @fileoverview Main entry point for @socketsecurity/lib.\n * Clean, organized exports for better developer experience.\n */\n\n// Export logger utilities for convenience\nexport { getDefaultLogger, Logger, LOG_SYMBOLS } from './logger'\n// Export spinner utilities for convenience\nexport { getDefaultSpinner, Spinner } from './spinner'\n// Export types\nexport * from './types'\n\n// Manifest data helper function\nexport function getManifestData(ecosystem?: string, packageName?: string) {\n try {\n const manifestData = require('../manifest.json')\n\n if (!ecosystem) {\n return manifestData\n }\n\n const ecoData = manifestData[ecosystem]\n if (!ecoData) {\n return undefined\n }\n\n if (!packageName) {\n return ecoData\n }\n\n // ecoData is an array of [purl, data] entries\n if (Array.isArray(ecoData)) {\n const entry = ecoData.find(\n ([_purl, data]) => data.package === packageName,\n )\n return entry ? entry[1] : undefined\n }\n\n // Fallback for object-based structure\n const pkgData = ecoData[packageName]\n return pkgData ? [packageName, pkgData] : undefined\n } catch {\n return undefined\n }\n}\n\n// Version export\nexport const version = '3.0.1'\n"],
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAMA,oBAAsD;AAEtD,qBAA2C;AAE3C,0BAAc,oBAVd;AAaO,SAAS,gBAAgB,WAAoB,aAAsB;AACxE,MAAI;AACF,UAAM,eAAe,QAAQ,kBAAkB;AAE/C,QAAI,CAAC,WAAW;AACd,aAAO;AAAA,IACT;AAEA,UAAM,UAAU,aAAa,SAAS;AACtC,QAAI,CAAC,SAAS;AACZ,aAAO;AAAA,IACT;AAEA,QAAI,CAAC,aAAa;AAChB,aAAO;AAAA,IACT;AAGA,QAAI,MAAM,QAAQ,OAAO,GAAG;AAC1B,YAAM,QAAQ,QAAQ;AAAA,QACpB,CAAC,CAAC,OAAO,IAAI,MAAM,KAAK,YAAY;AAAA,MACtC;AACA,aAAO,QAAQ,MAAM,CAAC,IAAI;AAAA,IAC5B;AAGA,UAAM,UAAU,QAAQ,WAAW;AACnC,WAAO,UAAU,CAAC,aAAa,OAAO,IAAI;AAAA,EAC5C,QAAQ;AACN,WAAO;AAAA,EACT;AACF;AAGO,MAAM,UAAU;",
|
|
6
|
-
"names": []
|
|
7
|
-
}
|
package/dist/prompts/index.d.ts
DELETED
|
@@ -1,115 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @fileoverview Themed interactive prompts for terminal input.
|
|
3
|
-
* Provides type definitions and utilities for themed prompt interactions.
|
|
4
|
-
*
|
|
5
|
-
* Note: This module provides the theme-aware API structure.
|
|
6
|
-
* Actual prompt implementations should be added based on project needs.
|
|
7
|
-
*/
|
|
8
|
-
import type { Theme } from '../themes/types';
|
|
9
|
-
import type { ThemeName } from '../themes/themes';
|
|
10
|
-
/**
|
|
11
|
-
* Base options for all prompts.
|
|
12
|
-
*/
|
|
13
|
-
export type PromptBaseOptions = {
|
|
14
|
-
/** Prompt message to display */
|
|
15
|
-
message: string;
|
|
16
|
-
/** Theme to use (overrides global) */
|
|
17
|
-
theme?: Theme | ThemeName | undefined;
|
|
18
|
-
};
|
|
19
|
-
/**
|
|
20
|
-
* Options for text input prompts.
|
|
21
|
-
*/
|
|
22
|
-
export type InputPromptOptions = PromptBaseOptions & {
|
|
23
|
-
/** Default value */
|
|
24
|
-
default?: string | undefined;
|
|
25
|
-
/** Validation function */
|
|
26
|
-
validate?: ((value: string) => boolean | string) | undefined;
|
|
27
|
-
/** Placeholder text */
|
|
28
|
-
placeholder?: string | undefined;
|
|
29
|
-
};
|
|
30
|
-
/**
|
|
31
|
-
* Options for confirmation prompts.
|
|
32
|
-
*/
|
|
33
|
-
export type ConfirmPromptOptions = PromptBaseOptions & {
|
|
34
|
-
/** Default value */
|
|
35
|
-
default?: boolean | undefined;
|
|
36
|
-
};
|
|
37
|
-
/**
|
|
38
|
-
* Choice option for select prompts.
|
|
39
|
-
*/
|
|
40
|
-
export type Choice<T = string> = {
|
|
41
|
-
/** Display label */
|
|
42
|
-
label: string;
|
|
43
|
-
/** Value to return */
|
|
44
|
-
value: T;
|
|
45
|
-
/** Optional description */
|
|
46
|
-
description?: string | undefined;
|
|
47
|
-
/** Whether this choice is disabled */
|
|
48
|
-
disabled?: boolean | undefined;
|
|
49
|
-
};
|
|
50
|
-
/**
|
|
51
|
-
* Options for selection prompts.
|
|
52
|
-
*/
|
|
53
|
-
export type SelectPromptOptions<T = string> = PromptBaseOptions & {
|
|
54
|
-
/** Array of choices */
|
|
55
|
-
choices: Array<Choice<T>>;
|
|
56
|
-
/** Default selected value */
|
|
57
|
-
default?: T | undefined;
|
|
58
|
-
};
|
|
59
|
-
/**
|
|
60
|
-
* Text input prompt (themed).
|
|
61
|
-
*
|
|
62
|
-
* @param options - Input prompt configuration
|
|
63
|
-
* @returns Promise resolving to user input
|
|
64
|
-
*
|
|
65
|
-
* @example
|
|
66
|
-
* ```ts
|
|
67
|
-
* import { input } from '@socketsecurity/lib/prompts'
|
|
68
|
-
*
|
|
69
|
-
* const name = await input({
|
|
70
|
-
* message: 'Enter your name:',
|
|
71
|
-
* default: 'User',
|
|
72
|
-
* validate: (v) => v.length > 0 || 'Name required'
|
|
73
|
-
* })
|
|
74
|
-
* ```
|
|
75
|
-
*/
|
|
76
|
-
export declare function input(_options: InputPromptOptions): Promise<string>;
|
|
77
|
-
/**
|
|
78
|
-
* Confirmation prompt (themed).
|
|
79
|
-
*
|
|
80
|
-
* @param options - Confirm prompt configuration
|
|
81
|
-
* @returns Promise resolving to boolean
|
|
82
|
-
*
|
|
83
|
-
* @example
|
|
84
|
-
* ```ts
|
|
85
|
-
* import { confirm } from '@socketsecurity/lib/prompts'
|
|
86
|
-
*
|
|
87
|
-
* const proceed = await confirm({
|
|
88
|
-
* message: 'Continue with installation?',
|
|
89
|
-
* default: true
|
|
90
|
-
* })
|
|
91
|
-
* ```
|
|
92
|
-
*/
|
|
93
|
-
export declare function confirm(_options: ConfirmPromptOptions): Promise<boolean>;
|
|
94
|
-
/**
|
|
95
|
-
* Selection prompt (themed).
|
|
96
|
-
*
|
|
97
|
-
* @template T - Type of choice values
|
|
98
|
-
* @param options - Select prompt configuration
|
|
99
|
-
* @returns Promise resolving to selected value
|
|
100
|
-
*
|
|
101
|
-
* @example
|
|
102
|
-
* ```ts
|
|
103
|
-
* import { select } from '@socketsecurity/lib/prompts'
|
|
104
|
-
*
|
|
105
|
-
* const choice = await select({
|
|
106
|
-
* message: 'Select environment:',
|
|
107
|
-
* choices: [
|
|
108
|
-
* { label: 'Development', value: 'dev' },
|
|
109
|
-
* { label: 'Staging', value: 'staging' },
|
|
110
|
-
* { label: 'Production', value: 'prod' }
|
|
111
|
-
* ]
|
|
112
|
-
* })
|
|
113
|
-
* ```
|
|
114
|
-
*/
|
|
115
|
-
export declare function select<T = string>(_options: SelectPromptOptions<T>): Promise<T>;
|
package/dist/prompts/index.js
DELETED
|
@@ -1,47 +0,0 @@
|
|
|
1
|
-
/* Socket Lib - Built with esbuild */
|
|
2
|
-
var __defProp = Object.defineProperty;
|
|
3
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
-
var __export = (target, all) => {
|
|
7
|
-
for (var name in all)
|
|
8
|
-
__defProp(target, name, { get: all[name], enumerable: true });
|
|
9
|
-
};
|
|
10
|
-
var __copyProps = (to, from, except, desc) => {
|
|
11
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
12
|
-
for (let key of __getOwnPropNames(from))
|
|
13
|
-
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
14
|
-
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
15
|
-
}
|
|
16
|
-
return to;
|
|
17
|
-
};
|
|
18
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
|
-
var prompts_exports = {};
|
|
20
|
-
__export(prompts_exports, {
|
|
21
|
-
confirm: () => confirm,
|
|
22
|
-
input: () => input,
|
|
23
|
-
select: () => select
|
|
24
|
-
});
|
|
25
|
-
module.exports = __toCommonJS(prompts_exports);
|
|
26
|
-
async function input(_options) {
|
|
27
|
-
throw new Error(
|
|
28
|
-
"input() not yet implemented - add prompt library integration"
|
|
29
|
-
);
|
|
30
|
-
}
|
|
31
|
-
async function confirm(_options) {
|
|
32
|
-
throw new Error(
|
|
33
|
-
"confirm() not yet implemented - add prompt library integration"
|
|
34
|
-
);
|
|
35
|
-
}
|
|
36
|
-
async function select(_options) {
|
|
37
|
-
throw new Error(
|
|
38
|
-
"select() not yet implemented - add prompt library integration"
|
|
39
|
-
);
|
|
40
|
-
}
|
|
41
|
-
// Annotate the CommonJS export names for ESM import in node:
|
|
42
|
-
0 && (module.exports = {
|
|
43
|
-
confirm,
|
|
44
|
-
input,
|
|
45
|
-
select
|
|
46
|
-
});
|
|
47
|
-
//# sourceMappingURL=index.js.map
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../../src/prompts/index.ts"],
|
|
4
|
-
"sourcesContent": ["/**\n * @fileoverview Themed interactive prompts for terminal input.\n * Provides type definitions and utilities for themed prompt interactions.\n *\n * Note: This module provides the theme-aware API structure.\n * Actual prompt implementations should be added based on project needs.\n */\n\nimport type { Theme } from '../themes/types'\nimport type { ThemeName } from '../themes/themes'\n\n/**\n * Base options for all prompts.\n */\nexport type PromptBaseOptions = {\n /** Prompt message to display */\n message: string\n /** Theme to use (overrides global) */\n theme?: Theme | ThemeName | undefined\n}\n\n/**\n * Options for text input prompts.\n */\nexport type InputPromptOptions = PromptBaseOptions & {\n /** Default value */\n default?: string | undefined\n /** Validation function */\n validate?: ((value: string) => boolean | string) | undefined\n /** Placeholder text */\n placeholder?: string | undefined\n}\n\n/**\n * Options for confirmation prompts.\n */\nexport type ConfirmPromptOptions = PromptBaseOptions & {\n /** Default value */\n default?: boolean | undefined\n}\n\n/**\n * Choice option for select prompts.\n */\nexport type Choice<T = string> = {\n /** Display label */\n label: string\n /** Value to return */\n value: T\n /** Optional description */\n description?: string | undefined\n /** Whether this choice is disabled */\n disabled?: boolean | undefined\n}\n\n/**\n * Options for selection prompts.\n */\nexport type SelectPromptOptions<T = string> = PromptBaseOptions & {\n /** Array of choices */\n choices: Array<Choice<T>>\n /** Default selected value */\n default?: T | undefined\n}\n\n/**\n * Text input prompt (themed).\n *\n * @param options - Input prompt configuration\n * @returns Promise resolving to user input\n *\n * @example\n * ```ts\n * import { input } from '@socketsecurity/lib/prompts'\n *\n * const name = await input({\n * message: 'Enter your name:',\n * default: 'User',\n * validate: (v) => v.length > 0 || 'Name required'\n * })\n * ```\n */\nexport async function input(_options: InputPromptOptions): Promise<string> {\n // Note: Implement actual prompt logic\n // For now, return a mock implementation\n throw new Error(\n 'input() not yet implemented - add prompt library integration',\n )\n}\n\n/**\n * Confirmation prompt (themed).\n *\n * @param options - Confirm prompt configuration\n * @returns Promise resolving to boolean\n *\n * @example\n * ```ts\n * import { confirm } from '@socketsecurity/lib/prompts'\n *\n * const proceed = await confirm({\n * message: 'Continue with installation?',\n * default: true\n * })\n * ```\n */\nexport async function confirm(\n _options: ConfirmPromptOptions,\n): Promise<boolean> {\n // Note: Implement actual prompt logic\n throw new Error(\n 'confirm() not yet implemented - add prompt library integration',\n )\n}\n\n/**\n * Selection prompt (themed).\n *\n * @template T - Type of choice values\n * @param options - Select prompt configuration\n * @returns Promise resolving to selected value\n *\n * @example\n * ```ts\n * import { select } from '@socketsecurity/lib/prompts'\n *\n * const choice = await select({\n * message: 'Select environment:',\n * choices: [\n * { label: 'Development', value: 'dev' },\n * { label: 'Staging', value: 'staging' },\n * { label: 'Production', value: 'prod' }\n * ]\n * })\n * ```\n */\nexport async function select<T = string>(\n _options: SelectPromptOptions<T>,\n): Promise<T> {\n // Note: Implement actual prompt logic\n throw new Error(\n 'select() not yet implemented - add prompt library integration',\n )\n}\n"],
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAkFA,eAAsB,MAAM,UAA+C;AAGzE,QAAM,IAAI;AAAA,IACR;AAAA,EACF;AACF;AAkBA,eAAsB,QACpB,UACkB;AAElB,QAAM,IAAI;AAAA,IACR;AAAA,EACF;AACF;AAuBA,eAAsB,OACpB,UACY;AAEZ,QAAM,IAAI;AAAA,IACR;AAAA,EACF;AACF;",
|
|
6
|
-
"names": []
|
|
7
|
-
}
|
package/dist/prompts.d.ts
DELETED
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @fileoverview Interactive prompt utilities for CLI applications.
|
|
3
|
-
* Re-exports commonly used prompt functions from inquirer packages.
|
|
4
|
-
*/
|
|
5
|
-
export { default as confirm } from '@inquirer/confirm';
|
|
6
|
-
export { default as input } from '@inquirer/input';
|
|
7
|
-
export { default as password } from '@inquirer/password';
|
|
8
|
-
export { default as search } from '@inquirer/search';
|
|
9
|
-
export { default as select } from '@inquirer/select';
|
|
10
|
-
// Export types - Choice is a type interface, not a direct export
|
|
11
|
-
export interface Choice<Value = unknown> {
|
|
12
|
-
value: Value;
|
|
13
|
-
name?: string;
|
|
14
|
-
description?: string;
|
|
15
|
-
short?: string;
|
|
16
|
-
disabled?: boolean | string;
|
|
17
|
-
}
|
|
18
|
-
// Create a Separator type that matches the expected interface
|
|
19
|
-
export interface Separator {
|
|
20
|
-
type: 'separator';
|
|
21
|
-
separator?: string;
|
|
22
|
-
line?: string;
|
|
23
|
-
}
|
|
24
|
-
/**
|
|
25
|
-
* Create a separator for select prompts.
|
|
26
|
-
*/
|
|
27
|
-
export declare function createSeparator(text?: string): Separator;
|
package/dist/prompts.js
DELETED
|
@@ -1,60 +0,0 @@
|
|
|
1
|
-
/* Socket Lib - Built with esbuild */
|
|
2
|
-
var __create = Object.create;
|
|
3
|
-
var __defProp = Object.defineProperty;
|
|
4
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
5
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
|
-
var __getProtoOf = Object.getPrototypeOf;
|
|
7
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
8
|
-
var __export = (target, all) => {
|
|
9
|
-
for (var name in all)
|
|
10
|
-
__defProp(target, name, { get: all[name], enumerable: true });
|
|
11
|
-
};
|
|
12
|
-
var __copyProps = (to, from, except, desc) => {
|
|
13
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
14
|
-
for (let key of __getOwnPropNames(from))
|
|
15
|
-
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
16
|
-
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
17
|
-
}
|
|
18
|
-
return to;
|
|
19
|
-
};
|
|
20
|
-
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
21
|
-
// If the importer is in node compatibility mode or this is not an ESM
|
|
22
|
-
// file that has been converted to a CommonJS file using a Babel-
|
|
23
|
-
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
24
|
-
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
25
|
-
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
26
|
-
mod
|
|
27
|
-
));
|
|
28
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
29
|
-
var prompts_exports = {};
|
|
30
|
-
__export(prompts_exports, {
|
|
31
|
-
confirm: () => import_confirm.default,
|
|
32
|
-
createSeparator: () => createSeparator,
|
|
33
|
-
input: () => import_input.default,
|
|
34
|
-
password: () => import_password.default,
|
|
35
|
-
search: () => import_search.default,
|
|
36
|
-
select: () => import_select.default
|
|
37
|
-
});
|
|
38
|
-
module.exports = __toCommonJS(prompts_exports);
|
|
39
|
-
var import_confirm = __toESM(require('./external/@inquirer/confirm'));
|
|
40
|
-
var import_input = __toESM(require('./external/@inquirer/input'));
|
|
41
|
-
var import_password = __toESM(require('./external/@inquirer/password'));
|
|
42
|
-
var import_search = __toESM(require('./external/@inquirer/search'));
|
|
43
|
-
var import_select = __toESM(require('./external/@inquirer/select'));
|
|
44
|
-
function createSeparator(text) {
|
|
45
|
-
return {
|
|
46
|
-
type: "separator",
|
|
47
|
-
separator: text || "\u2500\u2500\u2500\u2500\u2500\u2500\u2500",
|
|
48
|
-
line: text || "\u2500\u2500\u2500\u2500\u2500\u2500\u2500"
|
|
49
|
-
};
|
|
50
|
-
}
|
|
51
|
-
// Annotate the CommonJS export names for ESM import in node:
|
|
52
|
-
0 && (module.exports = {
|
|
53
|
-
confirm,
|
|
54
|
-
createSeparator,
|
|
55
|
-
input,
|
|
56
|
-
password,
|
|
57
|
-
search,
|
|
58
|
-
select
|
|
59
|
-
});
|
|
60
|
-
//# sourceMappingURL=prompts.js.map
|
package/dist/prompts.js.map
DELETED
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../src/prompts.ts"],
|
|
4
|
-
"sourcesContent": ["/**\n * @fileoverview Interactive prompt utilities for CLI applications.\n * Re-exports commonly used prompt functions from inquirer packages.\n */\n\nexport { default as confirm } from '@inquirer/confirm'\nexport { default as input } from '@inquirer/input'\nexport { default as password } from '@inquirer/password'\nexport { default as search } from '@inquirer/search'\nexport { default as select } from '@inquirer/select'\n\n// Export types - Choice is a type interface, not a direct export\nexport interface Choice<Value = unknown> {\n value: Value\n name?: string\n description?: string\n short?: string\n disabled?: boolean | string\n}\n\n// Create a Separator type that matches the expected interface\nexport interface Separator {\n type: 'separator'\n separator?: string\n line?: string\n}\n\n/**\n * Create a separator for select prompts.\n */\nexport function createSeparator(text?: string): Separator {\n return {\n type: 'separator',\n separator: text || '\u2500\u2500\u2500\u2500\u2500\u2500\u2500',\n line: text || '\u2500\u2500\u2500\u2500\u2500\u2500\u2500',\n }\n}\n"],
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAKA,qBAAmC;AACnC,mBAAiC;AACjC,sBAAoC;AACpC,oBAAkC;AAClC,oBAAkC;AAqB3B,SAAS,gBAAgB,MAA0B;AACxD,SAAO;AAAA,IACL,MAAM;AAAA,IACN,WAAW,QAAQ;AAAA,IACnB,MAAM,QAAQ;AAAA,EAChB;AACF;",
|
|
6
|
-
"names": []
|
|
7
|
-
}
|