@socketsecurity/lib 3.0.3 → 3.0.5

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.
Files changed (41) hide show
  1. package/CHANGELOG.md +47 -1
  2. package/dist/dlx.js +1 -1
  3. package/dist/dlx.js.map +2 -2
  4. package/dist/effects/pulse-frames.d.ts +7 -0
  5. package/dist/effects/pulse-frames.js.map +2 -2
  6. package/dist/effects/text-shimmer.d.ts +1 -0
  7. package/dist/effects/text-shimmer.js +13 -1
  8. package/dist/effects/text-shimmer.js.map +2 -2
  9. package/dist/effects/types.d.ts +6 -0
  10. package/dist/effects/types.js.map +1 -1
  11. package/dist/external/@socketregistry/packageurl-js.js +12 -2
  12. package/dist/links/index.js +2 -1
  13. package/dist/links/index.js.map +2 -2
  14. package/dist/logger.js +41 -2
  15. package/dist/logger.js.map +2 -2
  16. package/dist/objects.js.map +2 -2
  17. package/dist/packages/isolation.js +2 -4
  18. package/dist/packages/isolation.js.map +3 -3
  19. package/dist/spinner.d.ts +6 -0
  20. package/dist/spinner.js +14 -2
  21. package/dist/spinner.js.map +2 -2
  22. package/dist/stdio/prompts.d.ts +51 -8
  23. package/dist/stdio/prompts.js +82 -0
  24. package/dist/stdio/prompts.js.map +3 -3
  25. package/dist/themes/context.js.map +2 -2
  26. package/dist/themes/index.d.ts +2 -2
  27. package/dist/themes/index.js +2 -2
  28. package/dist/themes/index.js.map +1 -1
  29. package/dist/themes/themes.d.ts +5 -5
  30. package/dist/themes/themes.js +22 -13
  31. package/dist/themes/themes.js.map +2 -2
  32. package/package.json +2 -18
  33. package/dist/index.d.ts +0 -14
  34. package/dist/index.js +0 -71
  35. package/dist/index.js.map +0 -7
  36. package/dist/prompts/index.d.ts +0 -115
  37. package/dist/prompts/index.js +0 -47
  38. package/dist/prompts/index.js.map +0 -7
  39. package/dist/prompts.d.ts +0 -27
  40. package/dist/prompts.js +0 -60
  41. 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": ";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAKA,qBAA2C;AAE3C,MAAM,kBAAc,+BAAe;AACnC,MAAM,cAAU,2BAAW;AAAA;AAsFpB,SAAS,WACd,gBACgD;AAChD,SAAO,UAAU,SAAS;AACxB,UAAM,cAAe,KAAK,SAAS,IAAI,KAAK,CAAC,IAAI;AAGjD,UAAM,EAAE,SAAS,gBAAgB,GAAG,sBAAsB,IACxD,eAAgB,CAAC;AACnB,UAAM,kBACJ,mBAAmB,SAAY,iBAAiB;AAClD,UAAM,SAAS;AACf,QAAI,aAAa;AACf,WAAK,CAAC,IAAI;AAAA,QACR;AAAA,QACA,GAAG;AAAA,MACL;AAAA,IACF,OAAO;AACL,WAAK,CAAC,IAAI,EAAE,OAAO;AAAA,IACrB;AACA,UAAM,cAAc,CAAC,CAAC,iBAAiB;AACvC,qBAAiB,KAAK;AACtB,QAAI;AACJ,QAAI;AACF,eAAS,MAAM,eAAe,GAAG,IAAI;AAAA,IACvC,SAAS,GAAG;AACV,UAAI,aAAa,WAAW;AAC1B,cAAM;AAAA,MACR;AAAA,IACF;AACA,QAAI,aAAa;AACf,sBAAgB,MAAM;AAAA,IACxB;AACA,WAAQ,OAAO,WAAW,WAAW,OAAO,KAAK,IAAI;AAAA,EAGvD;AACF;AAGA,MAAM,gBAA8B,QAAQ,+BAA+B;AAC3E,MAAM,cAA4B,QAAQ,6BAA6B;AACvE,MAAM,iBAA+B,QAAQ,gCAAgC;AAC7E,MAAM,eAA6B,QAAQ,8BAA8B;AACzE,MAAM,eAA6B,QAAQ,8BAA8B;AACzE,MAAM,aAAa,cAAc,WAAW;AAC5C,MAAM,WAAW,YAAY,WAAW;AACxC,MAAM,cAAc,eAAe,WAAW;AAC9C,MAAM,YAAY,aAAa,WAAW;AAC1C,MAAM,YAAY,aAAa,WAAW;AAC1C,MAAM,kBAAkB,aAAa;AAW9B,MAAM,UAA6B,2BAAW,UAAU;AAUxD,MAAM,QAAyB,2BAAW,QAAQ;AASlD,MAAM,WAA+B,2BAAW,WAAW;AAY3D,MAAM,SAA2B,2BAAW,SAAS;AAerD,MAAM,SAA2B,2BAAW,SAAS;",
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": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAKA,qBAA2C;AAE3C,qBAAyB;AACzB,oBAAuC;AAEvC,mBAA6B;AAC7B,6BAA2B;AAE3B,MAAM,kBAAc,+BAAe;AACnC,MAAM,cAAU,2BAAW;AAO3B,SAAS,WAAW,MAAc,OAA2B;AAC3D,MAAI,OAAO,UAAU,UAAU;AAE7B,WAAQ,uBAAAA,QAAuB,KAAK,EAAE,IAAI;AAAA,EAC5C;AAEA,SAAO,uBAAAA,QAAe,IAAI,MAAM,CAAC,GAAG,MAAM,CAAC,GAAG,MAAM,CAAC,CAAC,EAAE,IAAI;AAC9D;AA6EA,SAAS,aAAa,OAAiC;AACrD,SAAO,OAAO,UAAU,WAAW,qBAAO,KAAK,IAAI;AACrD;AAOA,SAAS,cAAc,OAAgC;AACrD,SACE,OAAO,UAAU,YACjB,UAAU,QACV,UAAU,SACV,YAAY;AAEhB;AAsBO,SAAS,oBACd,OACyB;AAEzB,MAAI,OAAO,UAAU,YAAY,cAAc,KAAK,GAAG;AACrD,UAAM,cAAc,aAAa,KAA0B;AAC3D,UAAM,kBAAc;AAAA,MAClB,YAAY,OAAO;AAAA,MACnB,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IACF;AAGA,QAAI,aAAa;AACf,WAAK,CAAC,IAAI;AAAA,QACR;AAAA,QACA,GAAG;AAAA,MACL;AAAA,IACF,OAAO;AACL,WAAK,CAAC,IAAI,EAAE,OAAO;AAAA,IACrB;AAEA,UAAM,cAAc,CAAC,CAAC,iBAAiB;AACvC,qBAAiB,KAAK;AACtB,QAAI;AACJ,QAAI;AACF,eAAS,MAAM,eAAe,GAAG,IAAI;AAAA,IACvC,SAAS,GAAG;AACV,UAAI,aAAa,WAAW;AAC1B,cAAM;AAAA,MACR;AAAA,IACF;AACA,QAAI,aAAa;AACf,sBAAgB,MAAM;AAAA,IACxB;AACA,WAAQ,OAAO,WAAW,WAAW,OAAO,KAAK,IAAI;AAAA,EAGvD;AACF;AAGA,MAAM,gBAA8B,QAAQ,+BAA+B;AAC3E,MAAM,cAA4B,QAAQ,6BAA6B;AACvE,MAAM,iBAA+B,QAAQ,gCAAgC;AAC7E,MAAM,eAA6B,QAAQ,8BAA8B;AACzE,MAAM,eAA6B,QAAQ,8BAA8B;AACzE,MAAM,aAAa,cAAc,WAAW;AAC5C,MAAM,WAAW,YAAY,WAAW;AACxC,MAAM,cAAc,eAAe,WAAW;AAC9C,MAAM,YAAY,aAAa,WAAW;AAC1C,MAAM,YAAY,aAAa,WAAW;AAC1C,MAAM,kBAAkB,aAAa;AAW9B,MAAM,UAA6B,2BAAW,UAAU;AAUxD,MAAM,QAAyB,2BAAW,QAAQ;AASlD,MAAM,WAA+B,2BAAW,WAAW;AAY3D,MAAM,SAA2B,2BAAW,SAAS;AAerD,MAAM,SAA2B,2BAAW,SAAS;AAuBrD,SAAS,gBACd,MACsC;AACtC,SAAO,IAAI,gBAAgB,IAAI;AACjC;",
6
+ "names": ["yoctocolorsCjs"]
7
7
  }
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../src/themes/context.ts"],
4
- "sourcesContent": ["/**\n * @fileoverview Elegant theme context management.\n * Async-aware theming with automatic context isolation via AsyncLocalStorage.\n */\n\nimport { AsyncLocalStorage } from 'node:async_hooks'\n\nimport type { Theme } from './types'\nimport { SOCKET_THEME, THEMES, type ThemeName } from './themes'\n\n/**\n * Theme change event listener signature.\n */\nexport type ThemeChangeListener = (theme: Theme) => void\n\n/**\n * AsyncLocalStorage for theme context isolation.\n */\nconst themeStorage = new AsyncLocalStorage<Theme>()\n\n/**\n * Fallback theme for global context.\n */\nlet fallbackTheme: Theme = SOCKET_THEME\n\n/**\n * Registered theme change listeners.\n */\nconst listeners: Set<ThemeChangeListener> = new Set()\n\n/**\n * Set the global fallback theme.\n *\n * @param theme - Theme name or object\n *\n * @example\n * ```ts\n * setTheme('socket-firewall')\n * ```\n */\nexport function setTheme(theme: Theme | ThemeName): void {\n fallbackTheme = typeof theme === 'string' ? THEMES[theme] : theme\n emitThemeChange(fallbackTheme)\n}\n\n/**\n * Get the active theme from context.\n *\n * @returns Current theme\n *\n * @example\n * ```ts\n * const theme = getTheme()\n * console.log(theme.displayName)\n * ```\n */\nexport function getTheme(): Theme {\n return themeStorage.getStore() ?? fallbackTheme\n}\n\n/**\n * Execute async operation with scoped theme.\n * Theme automatically restored on completion.\n *\n * @template T - Return type\n * @param theme - Scoped theme\n * @param fn - Async operation\n * @returns Operation result\n *\n * @example\n * ```ts\n * await withTheme('ultra', async () => {\n * // Operations use Ultra theme\n * })\n * ```\n */\nexport async function withTheme<T>(\n theme: Theme | ThemeName,\n fn: () => Promise<T>,\n): Promise<T> {\n const resolvedTheme = typeof theme === 'string' ? THEMES[theme] : theme\n return await themeStorage.run(resolvedTheme, async () => {\n emitThemeChange(resolvedTheme)\n return await fn()\n })\n}\n\n/**\n * Execute sync operation with scoped theme.\n * Theme automatically restored on completion.\n *\n * @template T - Return type\n * @param theme - Scoped theme\n * @param fn - Sync operation\n * @returns Operation result\n *\n * @example\n * ```ts\n * const result = withThemeSync('coana', () => {\n * return processData()\n * })\n * ```\n */\nexport function withThemeSync<T>(theme: Theme | ThemeName, fn: () => T): T {\n const resolvedTheme = typeof theme === 'string' ? THEMES[theme] : theme\n return themeStorage.run(resolvedTheme, () => {\n emitThemeChange(resolvedTheme)\n return fn()\n })\n}\n\n/**\n * Subscribe to theme change events.\n *\n * @param listener - Change handler\n * @returns Unsubscribe function\n *\n * @example\n * ```ts\n * const unsubscribe = onThemeChange((theme) => {\n * console.log('Theme:', theme.displayName)\n * })\n *\n * // Cleanup\n * unsubscribe()\n * ```\n */\nexport function onThemeChange(listener: ThemeChangeListener): () => void {\n listeners.add(listener)\n return () => {\n listeners.delete(listener)\n }\n}\n\n/**\n * Emit theme change event to listeners.\n * @private\n */\nfunction emitThemeChange(theme: Theme): void {\n for (const listener of listeners) {\n listener(theme)\n }\n}\n"],
5
- "mappings": ";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAKA,8BAAkC;AAGlC,oBAAqD;AAUrD,MAAM,eAAe,IAAI,0CAAyB;AAKlD,IAAI,gBAAuB;AAK3B,MAAM,YAAsC,oBAAI,IAAI;AAY7C,SAAS,SAAS,OAAgC;AACvD,kBAAgB,OAAO,UAAU,WAAW,qBAAO,KAAK,IAAI;AAC5D,kBAAgB,aAAa;AAC/B;AAaO,SAAS,WAAkB;AAChC,SAAO,aAAa,SAAS,KAAK;AACpC;AAkBA,eAAsB,UACpB,OACA,IACY;AACZ,QAAM,gBAAgB,OAAO,UAAU,WAAW,qBAAO,KAAK,IAAI;AAClE,SAAO,MAAM,aAAa,IAAI,eAAe,YAAY;AACvD,oBAAgB,aAAa;AAC7B,WAAO,MAAM,GAAG;AAAA,EAClB,CAAC;AACH;AAkBO,SAAS,cAAiB,OAA0B,IAAgB;AACzE,QAAM,gBAAgB,OAAO,UAAU,WAAW,qBAAO,KAAK,IAAI;AAClE,SAAO,aAAa,IAAI,eAAe,MAAM;AAC3C,oBAAgB,aAAa;AAC7B,WAAO,GAAG;AAAA,EACZ,CAAC;AACH;AAkBO,SAAS,cAAc,UAA2C;AACvE,YAAU,IAAI,QAAQ;AACtB,SAAO,MAAM;AACX,cAAU,OAAO,QAAQ;AAAA,EAC3B;AACF;AAMA,SAAS,gBAAgB,OAAoB;AAC3C,aAAW,YAAY,WAAW;AAChC,aAAS,KAAK;AAAA,EAChB;AACF;",
4
+ "sourcesContent": ["/**\n * @fileoverview Elegant theme context management.\n * Async-aware theming with automatic context isolation via AsyncLocalStorage.\n */\n\nimport { AsyncLocalStorage } from 'node:async_hooks'\n\nimport type { Theme } from './types'\nimport { SOCKET_THEME, THEMES, type ThemeName } from './themes'\n\n/**\n * Theme change event listener signature.\n */\nexport type ThemeChangeListener = (theme: Theme) => void\n\n/**\n * AsyncLocalStorage for theme context isolation.\n */\nconst themeStorage = new AsyncLocalStorage<Theme>()\n\n/**\n * Fallback theme for global context.\n */\nlet fallbackTheme: Theme = SOCKET_THEME\n\n/**\n * Registered theme change listeners.\n */\nconst listeners: Set<ThemeChangeListener> = new Set()\n\n/**\n * Set the global fallback theme.\n *\n * @param theme - Theme name or object\n *\n * @example\n * ```ts\n * setTheme('socket-firewall')\n * ```\n */\nexport function setTheme(theme: Theme | ThemeName): void {\n fallbackTheme = typeof theme === 'string' ? THEMES[theme] : theme\n emitThemeChange(fallbackTheme)\n}\n\n/**\n * Get the active theme from context.\n *\n * @returns Current theme\n *\n * @example\n * ```ts\n * const theme = getTheme()\n * console.log(theme.displayName)\n * ```\n */\nexport function getTheme(): Theme {\n return themeStorage.getStore() ?? fallbackTheme\n}\n\n/**\n * Execute async operation with scoped theme.\n * Theme automatically restored on completion.\n *\n * @template T - Return type\n * @param theme - Scoped theme\n * @param fn - Async operation\n * @returns Operation result\n *\n * @example\n * ```ts\n * await withTheme('ultra', async () => {\n * // Operations use Ultra theme\n * })\n * ```\n */\nexport async function withTheme<T>(\n theme: Theme | ThemeName,\n fn: () => Promise<T>,\n): Promise<T> {\n const resolvedTheme: Theme = typeof theme === 'string' ? THEMES[theme] : theme\n return await themeStorage.run(resolvedTheme, async () => {\n emitThemeChange(resolvedTheme)\n return await fn()\n })\n}\n\n/**\n * Execute sync operation with scoped theme.\n * Theme automatically restored on completion.\n *\n * @template T - Return type\n * @param theme - Scoped theme\n * @param fn - Sync operation\n * @returns Operation result\n *\n * @example\n * ```ts\n * const result = withThemeSync('coana', () => {\n * return processData()\n * })\n * ```\n */\nexport function withThemeSync<T>(theme: Theme | ThemeName, fn: () => T): T {\n const resolvedTheme: Theme = typeof theme === 'string' ? THEMES[theme] : theme\n return themeStorage.run(resolvedTheme, () => {\n emitThemeChange(resolvedTheme)\n return fn()\n })\n}\n\n/**\n * Subscribe to theme change events.\n *\n * @param listener - Change handler\n * @returns Unsubscribe function\n *\n * @example\n * ```ts\n * const unsubscribe = onThemeChange((theme) => {\n * console.log('Theme:', theme.displayName)\n * })\n *\n * // Cleanup\n * unsubscribe()\n * ```\n */\nexport function onThemeChange(listener: ThemeChangeListener): () => void {\n listeners.add(listener)\n return () => {\n listeners.delete(listener)\n }\n}\n\n/**\n * Emit theme change event to listeners.\n * @private\n */\nfunction emitThemeChange(theme: Theme): void {\n for (const listener of listeners) {\n listener(theme)\n }\n}\n"],
5
+ "mappings": ";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAKA,8BAAkC;AAGlC,oBAAqD;AAUrD,MAAM,eAAe,IAAI,0CAAyB;AAKlD,IAAI,gBAAuB;AAK3B,MAAM,YAAsC,oBAAI,IAAI;AAY7C,SAAS,SAAS,OAAgC;AACvD,kBAAgB,OAAO,UAAU,WAAW,qBAAO,KAAK,IAAI;AAC5D,kBAAgB,aAAa;AAC/B;AAaO,SAAS,WAAkB;AAChC,SAAO,aAAa,SAAS,KAAK;AACpC;AAkBA,eAAsB,UACpB,OACA,IACY;AACZ,QAAM,gBAAuB,OAAO,UAAU,WAAW,qBAAO,KAAK,IAAI;AACzE,SAAO,MAAM,aAAa,IAAI,eAAe,YAAY;AACvD,oBAAgB,aAAa;AAC7B,WAAO,MAAM,GAAG;AAAA,EAClB,CAAC;AACH;AAkBO,SAAS,cAAiB,OAA0B,IAAgB;AACzE,QAAM,gBAAuB,OAAO,UAAU,WAAW,qBAAO,KAAK,IAAI;AACzE,SAAO,aAAa,IAAI,eAAe,MAAM;AAC3C,oBAAgB,aAAa;AAC7B,WAAO,GAAG;AAAA,EACZ,CAAC;AACH;AAkBO,SAAS,cAAc,UAA2C;AACvE,YAAU,IAAI,QAAQ;AACtB,SAAO,MAAM;AACX,cAAU,OAAO,QAAQ;AAAA,EAC3B;AACF;AAMA,SAAS,gBAAgB,OAAoB;AAC3C,aAAW,YAAY,WAAW;AAChC,aAAS,KAAK;AAAA,EAChB;AACF;",
6
6
  "names": []
7
7
  }
@@ -7,7 +7,7 @@
7
7
  * import { setTheme, THEMES } from '@socketsecurity/lib/themes'
8
8
  *
9
9
  * // Set global theme
10
- * setTheme('brick')
10
+ * setTheme('terracotta')
11
11
  * ```
12
12
  *
13
13
  * @example
@@ -46,7 +46,7 @@
46
46
  // Type system
47
47
  export type { ColorReference, Theme, ThemeColors, ThemeEffects, ThemeMeta, } from './types';
48
48
  // Curated themes
49
- export { BRICK_THEME, LUSH_THEME, SOCKET_THEME, SUNSET_THEME, THEMES, ULTRA_THEME, type ThemeName, } from './themes';
49
+ export { LUSH_THEME, SOCKET_THEME, SUNSET_THEME, TERRACOTTA_THEME, THEMES, ULTRA_THEME, type ThemeName, } from './themes';
50
50
  // Context management
51
51
  export { getTheme, onThemeChange, setTheme, withTheme, withThemeSync, type ThemeChangeListener, } from './context';
52
52
  // Composition utilities
@@ -18,10 +18,10 @@ var __copyProps = (to, from, except, desc) => {
18
18
  var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
19
19
  var themes_exports = {};
20
20
  __export(themes_exports, {
21
- BRICK_THEME: () => import_themes.BRICK_THEME,
22
21
  LUSH_THEME: () => import_themes.LUSH_THEME,
23
22
  SOCKET_THEME: () => import_themes.SOCKET_THEME,
24
23
  SUNSET_THEME: () => import_themes.SUNSET_THEME,
24
+ TERRACOTTA_THEME: () => import_themes.TERRACOTTA_THEME,
25
25
  THEMES: () => import_themes.THEMES,
26
26
  ULTRA_THEME: () => import_themes.ULTRA_THEME,
27
27
  createTheme: () => import_utils.createTheme,
@@ -40,10 +40,10 @@ var import_context = require("./context");
40
40
  var import_utils = require("./utils");
41
41
  // Annotate the CommonJS export names for ESM import in node:
42
42
  0 && (module.exports = {
43
- BRICK_THEME,
44
43
  LUSH_THEME,
45
44
  SOCKET_THEME,
46
45
  SUNSET_THEME,
46
+ TERRACOTTA_THEME,
47
47
  THEMES,
48
48
  ULTRA_THEME,
49
49
  createTheme,
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../src/themes/index.ts"],
4
- "sourcesContent": ["/**\n * @fileoverview Elegant theming system for Socket libraries.\n * Unified visual language across spinners, loggers, prompts, and links.\n *\n * @example\n * ```ts\n * import { setTheme, THEMES } from '@socketsecurity/lib/themes'\n *\n * // Set global theme\n * setTheme('brick')\n * ```\n *\n * @example\n * ```ts\n * import { withTheme } from '@socketsecurity/lib/themes'\n *\n * // Scoped theme context\n * await withTheme('ultra', async () => {\n * // All operations inherit Ultra theme\n * })\n * ```\n *\n * @example\n * ```ts\n * import { createTheme } from '@socketsecurity/lib/themes'\n *\n * // Custom theme creation\n * const myTheme = createTheme({\n * name: 'custom',\n * displayName: 'Custom Theme',\n * colors: {\n * primary: [255, 100, 200],\n * success: 'greenBright',\n * error: 'redBright',\n * warning: 'yellowBright',\n * info: 'blueBright',\n * step: 'cyanBright',\n * text: 'white',\n * textDim: 'gray',\n * link: 'cyanBright',\n * prompt: 'primary'\n * }\n * })\n * ```\n */\n\n// Type system\nexport type {\n ColorReference,\n Theme,\n ThemeColors,\n ThemeEffects,\n ThemeMeta,\n} from './types'\n\n// Curated themes\nexport {\n BRICK_THEME,\n LUSH_THEME,\n SOCKET_THEME,\n SUNSET_THEME,\n THEMES,\n ULTRA_THEME,\n type ThemeName,\n} from './themes'\n\n// Context management\nexport {\n getTheme,\n onThemeChange,\n setTheme,\n withTheme,\n withThemeSync,\n type ThemeChangeListener,\n} from './context'\n\n// Composition utilities\nexport {\n createTheme,\n extendTheme,\n resolveColor,\n resolveShimmerColor,\n} from './utils'\n"],
4
+ "sourcesContent": ["/**\n * @fileoverview Elegant theming system for Socket libraries.\n * Unified visual language across spinners, loggers, prompts, and links.\n *\n * @example\n * ```ts\n * import { setTheme, THEMES } from '@socketsecurity/lib/themes'\n *\n * // Set global theme\n * setTheme('terracotta')\n * ```\n *\n * @example\n * ```ts\n * import { withTheme } from '@socketsecurity/lib/themes'\n *\n * // Scoped theme context\n * await withTheme('ultra', async () => {\n * // All operations inherit Ultra theme\n * })\n * ```\n *\n * @example\n * ```ts\n * import { createTheme } from '@socketsecurity/lib/themes'\n *\n * // Custom theme creation\n * const myTheme = createTheme({\n * name: 'custom',\n * displayName: 'Custom Theme',\n * colors: {\n * primary: [255, 100, 200],\n * success: 'greenBright',\n * error: 'redBright',\n * warning: 'yellowBright',\n * info: 'blueBright',\n * step: 'cyanBright',\n * text: 'white',\n * textDim: 'gray',\n * link: 'cyanBright',\n * prompt: 'primary'\n * }\n * })\n * ```\n */\n\n// Type system\nexport type {\n ColorReference,\n Theme,\n ThemeColors,\n ThemeEffects,\n ThemeMeta,\n} from './types'\n\n// Curated themes\nexport {\n LUSH_THEME,\n SOCKET_THEME,\n SUNSET_THEME,\n TERRACOTTA_THEME,\n THEMES,\n ULTRA_THEME,\n type ThemeName,\n} from './themes'\n\n// Context management\nexport {\n getTheme,\n onThemeChange,\n setTheme,\n withTheme,\n withThemeSync,\n type ThemeChangeListener,\n} from './context'\n\n// Composition utilities\nexport {\n createTheme,\n extendTheme,\n resolveColor,\n resolveShimmerColor,\n} from './utils'\n"],
5
5
  "mappings": ";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAwDA,oBAQO;AAGP,qBAOO;AAGP,mBAKO;",
6
6
  "names": []
7
7
  }
@@ -13,15 +13,15 @@ import type { Theme } from './types';
13
13
  */
14
14
  export declare const SOCKET_THEME: Theme;
15
15
  /**
16
- * Sunset — Crisp azure.
17
- * Clean analytical theme with precise blue tones.
16
+ * Sunset — Vibrant twilight gradient.
17
+ * Warm sunset palette with orange and purple/pink tones.
18
18
  */
19
19
  export declare const SUNSET_THEME: Theme;
20
20
  /**
21
- * Brick — Solid warmth.
21
+ * Terracotta — Solid warmth.
22
22
  * Rich terracotta and ember tones for grounded confidence.
23
23
  */
24
- export declare const BRICK_THEME: Theme;
24
+ export declare const TERRACOTTA_THEME: Theme;
25
25
  /**
26
26
  * Lush — Steel elegance.
27
27
  * Python-inspired steel blue with golden accents.
@@ -39,7 +39,7 @@ export declare const THEMES: {
39
39
  readonly __proto__: any;
40
40
  readonly socket: Theme;
41
41
  readonly sunset: Theme;
42
- readonly brick: Theme;
42
+ readonly terracotta: Theme;
43
43
  readonly lush: Theme;
44
44
  readonly ultra: Theme;
45
45
  };
@@ -18,10 +18,10 @@ var __copyProps = (to, from, except, desc) => {
18
18
  var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
19
19
  var themes_exports = {};
20
20
  __export(themes_exports, {
21
- BRICK_THEME: () => BRICK_THEME,
22
21
  LUSH_THEME: () => LUSH_THEME,
23
22
  SOCKET_THEME: () => SOCKET_THEME,
24
23
  SUNSET_THEME: () => SUNSET_THEME,
24
+ TERRACOTTA_THEME: () => TERRACOTTA_THEME,
25
25
  THEMES: () => THEMES,
26
26
  ULTRA_THEME: () => ULTRA_THEME
27
27
  });
@@ -62,32 +62,41 @@ const SUNSET_THEME = {
62
62
  name: "sunset",
63
63
  displayName: "Sunset",
64
64
  colors: {
65
- primary: [100, 200, 255],
66
- secondary: [50, 150, 200],
65
+ primary: [255, 140, 100],
66
+ secondary: [200, 100, 180],
67
67
  success: "greenBright",
68
68
  error: "redBright",
69
69
  warning: "yellowBright",
70
- info: "blueBright",
71
- step: "cyanBright",
70
+ info: "magentaBright",
71
+ step: "magentaBright",
72
72
  text: "white",
73
73
  textDim: "gray",
74
- link: "cyanBright",
74
+ link: "primary",
75
75
  prompt: "primary"
76
76
  },
77
77
  effects: {
78
78
  spinner: {
79
79
  color: "primary",
80
80
  style: "dots"
81
+ },
82
+ shimmer: {
83
+ enabled: true,
84
+ color: [
85
+ [200, 100, 180],
86
+ [255, 140, 100]
87
+ ],
88
+ direction: "ltr",
89
+ speed: 0.4
81
90
  }
82
91
  },
83
92
  meta: {
84
- description: "Crisp azure theme for precision and clarity",
85
- version: "1.0.0"
93
+ description: "Warm sunset theme with purple-to-orange gradient",
94
+ version: "2.0.0"
86
95
  }
87
96
  };
88
- const BRICK_THEME = {
89
- name: "brick",
90
- displayName: "Brick",
97
+ const TERRACOTTA_THEME = {
98
+ name: "terracotta",
99
+ displayName: "Terracotta",
91
100
  colors: {
92
101
  primary: [255, 100, 50],
93
102
  secondary: [255, 150, 100],
@@ -181,16 +190,16 @@ const THEMES = {
181
190
  __proto__: null,
182
191
  socket: SOCKET_THEME,
183
192
  sunset: SUNSET_THEME,
184
- brick: BRICK_THEME,
193
+ terracotta: TERRACOTTA_THEME,
185
194
  lush: LUSH_THEME,
186
195
  ultra: ULTRA_THEME
187
196
  };
188
197
  // Annotate the CommonJS export names for ESM import in node:
189
198
  0 && (module.exports = {
190
- BRICK_THEME,
191
199
  LUSH_THEME,
192
200
  SOCKET_THEME,
193
201
  SUNSET_THEME,
202
+ TERRACOTTA_THEME,
194
203
  THEMES,
195
204
  ULTRA_THEME
196
205
  });
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../src/themes/themes.ts"],
4
- "sourcesContent": ["/**\n * @fileoverview Elegant theme definitions for Socket libraries.\n * Sophisticated color palettes crafted for clarity and visual harmony.\n *\n * Philosophy: Every color choice serves a purpose. Bright variants ensure\n * terminal legibility without compromising sophistication. Minimal emoji use,\n * refined symbols with color\u2014elegance in restraint.\n */\n\nimport type { Theme } from './types'\n\n/**\n * Socket Security \u2014 The signature theme.\n * Refined violet with subtle shimmer, designed for focus and elegance.\n */\nexport const SOCKET_THEME: Theme = {\n name: 'socket',\n displayName: 'Socket Security',\n colors: {\n primary: [140, 82, 255],\n success: 'greenBright',\n error: 'redBright',\n warning: 'yellowBright',\n info: 'blueBright',\n step: 'cyanBright',\n text: 'white',\n textDim: 'gray',\n link: 'cyanBright',\n prompt: 'primary',\n },\n effects: {\n spinner: {\n color: 'primary',\n style: 'socket',\n },\n shimmer: {\n enabled: true,\n color: 'inherit',\n direction: 'ltr',\n speed: 0.33,\n },\n },\n meta: {\n description: 'Signature theme with refined violet and subtle shimmer',\n version: '1.0.0',\n },\n}\n\n/**\n * Sunset \u2014 Crisp azure.\n * Clean analytical theme with precise blue tones.\n */\nexport const SUNSET_THEME: Theme = {\n name: 'sunset',\n displayName: 'Sunset',\n colors: {\n primary: [100, 200, 255],\n secondary: [50, 150, 200],\n success: 'greenBright',\n error: 'redBright',\n warning: 'yellowBright',\n info: 'blueBright',\n step: 'cyanBright',\n text: 'white',\n textDim: 'gray',\n link: 'cyanBright',\n prompt: 'primary',\n },\n effects: {\n spinner: {\n color: 'primary',\n style: 'dots',\n },\n },\n meta: {\n description: 'Crisp azure theme for precision and clarity',\n version: '1.0.0',\n },\n}\n\n/**\n * Brick \u2014 Solid warmth.\n * Rich terracotta and ember tones for grounded confidence.\n */\nexport const BRICK_THEME: Theme = {\n name: 'brick',\n displayName: 'Brick',\n colors: {\n primary: [255, 100, 50],\n secondary: [255, 150, 100],\n success: 'greenBright',\n error: 'redBright',\n warning: 'yellowBright',\n info: 'blueBright',\n step: 'cyanBright',\n text: 'white',\n textDim: 'gray',\n link: 'secondary',\n prompt: 'primary',\n },\n effects: {\n spinner: {\n color: 'primary',\n style: 'socket',\n },\n shimmer: {\n enabled: true,\n color: 'inherit',\n direction: 'ltr',\n speed: 0.5,\n },\n },\n meta: {\n description: 'Solid theme with rich terracotta and ember warmth',\n version: '1.0.0',\n },\n}\n\n/**\n * Lush \u2014 Steel elegance.\n * Python-inspired steel blue with golden accents.\n */\nexport const LUSH_THEME: Theme = {\n name: 'lush',\n displayName: 'Lush',\n colors: {\n primary: [70, 130, 180],\n secondary: [255, 215, 0],\n success: 'greenBright',\n error: 'redBright',\n warning: 'yellowBright',\n info: 'blueBright',\n step: 'cyanBright',\n text: 'white',\n textDim: 'gray',\n link: 'cyanBright',\n prompt: 'primary',\n },\n effects: {\n spinner: {\n color: 'primary',\n style: 'dots',\n },\n },\n meta: {\n description: 'Elegant theme with steel blue and golden harmony',\n version: '1.0.0',\n },\n}\n\n/**\n * Ultra \u2014 Premium intensity.\n * Prismatic shimmer for deep analysis, where complexity meets elegance.\n */\nexport const ULTRA_THEME: Theme = {\n name: 'ultra',\n displayName: 'Ultra',\n colors: {\n primary: [140, 82, 255],\n success: 'greenBright',\n error: 'redBright',\n warning: 'yellowBright',\n info: 'cyanBright',\n step: 'magentaBright',\n text: 'whiteBright',\n textDim: 'gray',\n link: 'cyanBright',\n prompt: 'primary',\n },\n effects: {\n spinner: {\n color: 'inherit',\n style: 'socket',\n },\n shimmer: {\n enabled: true,\n color: 'rainbow',\n direction: 'bi',\n speed: 0.5,\n },\n },\n meta: {\n description: 'Premium theme with prismatic shimmer for deep analysis',\n version: '1.0.0',\n },\n}\n\n/**\n * Theme registry \u2014 Curated palette collection.\n */\nexport const THEMES = {\n __proto__: null,\n socket: SOCKET_THEME,\n sunset: SUNSET_THEME,\n brick: BRICK_THEME,\n lush: LUSH_THEME,\n ultra: ULTRA_THEME,\n} as const\n\n/**\n * Available theme identifiers.\n */\nexport type ThemeName = keyof typeof THEMES\n"],
5
- "mappings": ";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAeO,M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,WAAW;AAAA,MACX,OAAO;AAAA,IACT;AAAA,EACF;AAAA,EACA,MAAM;AAAA,IACJ,aAAa;AAAA,IACb,SAAS;AAAA,EACX;AACF;AAKO,MAAM,SAAS;AAAA,EACpB,WAAW;AAAA,EACX,QAAQ;AAAA,EACR,QAAQ;AAAA,EACR,OAAO;AAAA,EACP,MAAM;AAAA,EACN,OAAO;AACT;",
4
+ "sourcesContent": ["/**\n * @fileoverview Elegant theme definitions for Socket libraries.\n * Sophisticated color palettes crafted for clarity and visual harmony.\n *\n * Philosophy: Every color choice serves a purpose. Bright variants ensure\n * terminal legibility without compromising sophistication. Minimal emoji use,\n * refined symbols with color\u2014elegance in restraint.\n */\n\nimport type { Theme } from './types'\n\n/**\n * Socket Security \u2014 The signature theme.\n * Refined violet with subtle shimmer, designed for focus and elegance.\n */\nexport const SOCKET_THEME: Theme = {\n name: 'socket',\n displayName: 'Socket Security',\n colors: {\n primary: [140, 82, 255],\n success: 'greenBright',\n error: 'redBright',\n warning: 'yellowBright',\n info: 'blueBright',\n step: 'cyanBright',\n text: 'white',\n textDim: 'gray',\n link: 'cyanBright',\n prompt: 'primary',\n },\n effects: {\n spinner: {\n color: 'primary',\n style: 'socket',\n },\n shimmer: {\n enabled: true,\n color: 'inherit',\n direction: 'ltr',\n speed: 0.33,\n },\n },\n meta: {\n description: 'Signature theme with refined violet and subtle shimmer',\n version: '1.0.0',\n },\n}\n\n/**\n * Sunset \u2014 Vibrant twilight gradient.\n * Warm sunset palette with orange and purple/pink tones.\n */\nexport const SUNSET_THEME: Theme = {\n name: 'sunset',\n displayName: 'Sunset',\n colors: {\n primary: [255, 140, 100],\n secondary: [200, 100, 180],\n success: 'greenBright',\n error: 'redBright',\n warning: 'yellowBright',\n info: 'magentaBright',\n step: 'magentaBright',\n text: 'white',\n textDim: 'gray',\n link: 'primary',\n prompt: 'primary',\n },\n effects: {\n spinner: {\n color: 'primary',\n style: 'dots',\n },\n shimmer: {\n enabled: true,\n color: [\n [200, 100, 180],\n [255, 140, 100],\n ],\n direction: 'ltr',\n speed: 0.4,\n },\n },\n meta: {\n description: 'Warm sunset theme with purple-to-orange gradient',\n version: '2.0.0',\n },\n}\n\n/**\n * Terracotta \u2014 Solid warmth.\n * Rich terracotta and ember tones for grounded confidence.\n */\nexport const TERRACOTTA_THEME: Theme = {\n name: 'terracotta',\n displayName: 'Terracotta',\n colors: {\n primary: [255, 100, 50],\n secondary: [255, 150, 100],\n success: 'greenBright',\n error: 'redBright',\n warning: 'yellowBright',\n info: 'blueBright',\n step: 'cyanBright',\n text: 'white',\n textDim: 'gray',\n link: 'secondary',\n prompt: 'primary',\n },\n effects: {\n spinner: {\n color: 'primary',\n style: 'socket',\n },\n shimmer: {\n enabled: true,\n color: 'inherit',\n direction: 'ltr',\n speed: 0.5,\n },\n },\n meta: {\n description: 'Solid theme with rich terracotta and ember warmth',\n version: '1.0.0',\n },\n}\n\n/**\n * Lush \u2014 Steel elegance.\n * Python-inspired steel blue with golden accents.\n */\nexport const LUSH_THEME: Theme = {\n name: 'lush',\n displayName: 'Lush',\n colors: {\n primary: [70, 130, 180],\n secondary: [255, 215, 0],\n success: 'greenBright',\n error: 'redBright',\n warning: 'yellowBright',\n info: 'blueBright',\n step: 'cyanBright',\n text: 'white',\n textDim: 'gray',\n link: 'cyanBright',\n prompt: 'primary',\n },\n effects: {\n spinner: {\n color: 'primary',\n style: 'dots',\n },\n },\n meta: {\n description: 'Elegant theme with steel blue and golden harmony',\n version: '1.0.0',\n },\n}\n\n/**\n * Ultra \u2014 Premium intensity.\n * Prismatic shimmer for deep analysis, where complexity meets elegance.\n */\nexport const ULTRA_THEME: Theme = {\n name: 'ultra',\n displayName: 'Ultra',\n colors: {\n primary: [140, 82, 255],\n success: 'greenBright',\n error: 'redBright',\n warning: 'yellowBright',\n info: 'cyanBright',\n step: 'magentaBright',\n text: 'whiteBright',\n textDim: 'gray',\n link: 'cyanBright',\n prompt: 'primary',\n },\n effects: {\n spinner: {\n color: 'inherit',\n style: 'socket',\n },\n shimmer: {\n enabled: true,\n color: 'rainbow',\n direction: 'bi',\n speed: 0.5,\n },\n },\n meta: {\n description: 'Premium theme with prismatic shimmer for deep analysis',\n version: '1.0.0',\n },\n}\n\n/**\n * Theme registry \u2014 Curated palette collection.\n */\nexport const THEMES = {\n __proto__: null,\n socket: SOCKET_THEME,\n sunset: SUNSET_THEME,\n terracotta: TERRACOTTA_THEME,\n lush: LUSH_THEME,\n ultra: ULTRA_THEME,\n} as const\n\n/**\n * Available theme identifiers.\n */\nexport type ThemeName = keyof typeof THEMES\n"],
5
+ "mappings": ";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAeO,MAAM,eAAsB;AAAA,EACjC,MAAM;AAAA,EACN,aAAa;AAAA,EACb,QAAQ;AAAA,IACN,SAAS,CAAC,KAAK,IAAI,GAAG;AAAA,IACtB,SAAS;AAAA,IACT,OAAO;AAAA,IACP,SAAS;AAAA,IACT,MAAM;AAAA,IACN,MAAM;AAAA,IACN,MAAM;AAAA,IACN,SAAS;AAAA,IACT,MAAM;AAAA,IACN,QAAQ;AAAA,EACV;AAAA,EACA,SAAS;AAAA,IACP,SAAS;AAAA,MACP,OAAO;AAAA,MACP,OAAO;AAAA,IACT;AAAA,IACA,SAAS;AAAA,MACP,SAAS;AAAA,MACT,OAAO;AAAA,MACP,WAAW;AAAA,MACX,OAAO;AAAA,IACT;AAAA,EACF;AAAA,EACA,MAAM;AAAA,IACJ,aAAa;AAAA,IACb,SAAS;AAAA,EACX;AACF;AAMO,MAAM,eAAsB;AAAA,EACjC,MAAM;AAAA,EACN,aAAa;AAAA,EACb,QAAQ;AAAA,IACN,SAAS,CAAC,KAAK,KAAK,GAAG;AAAA,IACvB,WAAW,CAAC,KAAK,KAAK,GAAG;AAAA,IACzB,SAAS;AAAA,IACT,OAAO;AAAA,IACP,SAAS;AAAA,IACT,MAAM;AAAA,IACN,MAAM;AAAA,IACN,MAA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AA,IACN,SAAS;AAAA,IACT,MAAM;AAAA,IACN,QAAQ;AAAA,EACV;AAAA,EACA,SAAS;AAAA,IACP,SAAS;AAAA,MACP,OAAO;AAAA,MACP,OAAO;AAAA,IACT;AAAA,EACF;AAAA,EACA,MAAM;AAAA,IACJ,aAAa;AAAA,IACb,SAAS;AAAA,EACX;AACF;AAMO,MAAM,cAAqB;AAAA,EAChC,MAAM;AAAA,EACN,aAAa;AAAA,EACb,QAAQ;AAAA,IACN,SAAS,CAAC,KAAK,IAAI,GAAG;AAAA,IACtB,SAAS;AAAA,IACT,OAAO;AAAA,IACP,SAAS;AAAA,IACT,MAAM;AAAA,IACN,MAAM;AAAA,IACN,MAAM;AAAA,IACN,SAAS;AAAA,IACT,MAAM;AAAA,IACN,QAAQ;AAAA,EACV;AAAA,EACA,SAAS;AAAA,IACP,SAAS;AAAA,MACP,OAAO;AAAA,MACP,OAAO;AAAA,IACT;AAAA,IACA,SAAS;AAAA,MACP,SAAS;AAAA,MACT,OAAO;AAAA,MACP,WAAW;AAAA,MACX,OAAO;AAAA,IACT;AAAA,EACF;AAAA,EACA,MAAM;AAAA,IACJ,aAAa;AAAA,IACb,SAAS;AAAA,EACX;AACF;AAKO,MAAM,SAAS;AAAA,EACpB,WAAW;AAAA,EACX,QAAQ;AAAA,EACR,QAAQ;AAAA,EACR,YAAY;AAAA,EACZ,MAAM;AAAA,EACN,OAAO;AACT;",
6
6
  "names": []
7
7
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@socketsecurity/lib",
3
- "version": "3.0.3",
3
+ "version": "3.0.5",
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.1",
592
+ "@socketregistry/packageurl-js": "1.3.2",
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
- }
@@ -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>;
@@ -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
- }