@reliverse/rempts 1.7.65 → 2.2.7

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 (131) hide show
  1. package/LICENSE +21 -21
  2. package/README.md +1534 -1431
  3. package/cleanup.mjs +33 -0
  4. package/dist/cancel.d.ts +31 -0
  5. package/dist/cancel.js +28 -0
  6. package/dist/ffi.d.ts +1 -0
  7. package/dist/ffi.js +165 -0
  8. package/dist/group.d.ts +16 -0
  9. package/dist/group.js +22 -0
  10. package/dist/launcher/command.d.ts +8 -0
  11. package/dist/launcher/command.js +10 -0
  12. package/dist/launcher/discovery.d.ts +3 -0
  13. package/dist/launcher/discovery.js +207 -0
  14. package/dist/launcher/errors.d.ts +15 -0
  15. package/dist/launcher/errors.js +31 -0
  16. package/dist/launcher/help.d.ts +3 -0
  17. package/dist/launcher/help.js +145 -0
  18. package/dist/launcher/mod.d.ts +12 -0
  19. package/dist/launcher/mod.js +222 -0
  20. package/dist/launcher/parser.d.ts +14 -0
  21. package/dist/launcher/parser.js +255 -0
  22. package/dist/launcher/registry.d.ts +10 -0
  23. package/dist/launcher/registry.js +42 -0
  24. package/dist/launcher/types.d.ts +78 -0
  25. package/dist/launcher/validator.d.ts +3 -0
  26. package/dist/launcher/validator.js +39 -0
  27. package/dist/mod.d.ts +6 -0
  28. package/dist/mod.js +6 -0
  29. package/dist/prompt.d.ts +13 -0
  30. package/dist/prompt.js +53 -0
  31. package/dist/selection.d.ts +92 -0
  32. package/dist/selection.js +191 -0
  33. package/dist/spinner.d.ts +26 -0
  34. package/dist/spinner.js +141 -0
  35. package/dist/utils.d.ts +3 -0
  36. package/dist/utils.js +11 -0
  37. package/package.json +41 -47
  38. package/bin/libs/animate/animate-mod.ts.txt +0 -78
  39. package/bin/libs/anykey/anykey-mod.d.ts +0 -12
  40. package/bin/libs/anykey/anykey-mod.js +0 -125
  41. package/bin/libs/cancel/cancel.d.ts +0 -45
  42. package/bin/libs/cancel/cancel.js +0 -72
  43. package/bin/libs/confirm/confirm-alias.d.ts +0 -2
  44. package/bin/libs/confirm/confirm-alias.js +0 -2
  45. package/bin/libs/confirm/confirm-mod.d.ts +0 -5
  46. package/bin/libs/confirm/confirm-mod.js +0 -179
  47. package/bin/libs/date/date.d.ts +0 -2
  48. package/bin/libs/date/date.js +0 -254
  49. package/bin/libs/editor/editor-mod.d.ts +0 -25
  50. package/bin/libs/editor/editor-mod.js +0 -1133
  51. package/bin/libs/figures/figures-mod.d.ts +0 -461
  52. package/bin/libs/figures/figures-mod.js +0 -285
  53. package/bin/libs/group/group-mod.d.ts +0 -33
  54. package/bin/libs/group/group-mod.js +0 -89
  55. package/bin/libs/input/input-alias.d.ts +0 -5
  56. package/bin/libs/input/input-alias.js +0 -4
  57. package/bin/libs/input/input-mod.d.ts +0 -16
  58. package/bin/libs/input/input-mod.js +0 -370
  59. package/bin/libs/intro/intro-alias.d.ts +0 -3
  60. package/bin/libs/intro/intro-alias.js +0 -3
  61. package/bin/libs/intro/intro-mod.d.ts +0 -19
  62. package/bin/libs/intro/intro-mod.js +0 -71
  63. package/bin/libs/launcher/command-runner.d.ts +0 -31
  64. package/bin/libs/launcher/command-runner.js +0 -229
  65. package/bin/libs/launcher/launcher-alias.d.ts +0 -2
  66. package/bin/libs/launcher/launcher-alias.js +0 -2
  67. package/bin/libs/launcher/launcher-mod.d.ts +0 -66
  68. package/bin/libs/launcher/launcher-mod.js +0 -1037
  69. package/bin/libs/launcher/launcher-types.d.ts +0 -176
  70. package/bin/libs/launcher/launcher-types.js +0 -0
  71. package/bin/libs/log/log-alias.d.ts +0 -1
  72. package/bin/libs/log/log-alias.js +0 -2
  73. package/bin/libs/msg-fmt/colors.d.ts +0 -30
  74. package/bin/libs/msg-fmt/colors.js +0 -42
  75. package/bin/libs/msg-fmt/mapping.d.ts +0 -3
  76. package/bin/libs/msg-fmt/mapping.js +0 -41
  77. package/bin/libs/msg-fmt/messages.d.ts +0 -35
  78. package/bin/libs/msg-fmt/messages.js +0 -305
  79. package/bin/libs/msg-fmt/terminal.d.ts +0 -15
  80. package/bin/libs/msg-fmt/terminal.js +0 -60
  81. package/bin/libs/msg-fmt/variants.d.ts +0 -11
  82. package/bin/libs/msg-fmt/variants.js +0 -52
  83. package/bin/libs/multiselect/multiselect-alias.d.ts +0 -2
  84. package/bin/libs/multiselect/multiselect-alias.js +0 -2
  85. package/bin/libs/multiselect/multiselect-prompt.d.ts +0 -2
  86. package/bin/libs/multiselect/multiselect-prompt.js +0 -340
  87. package/bin/libs/next-steps/next-steps.d.ts +0 -13
  88. package/bin/libs/next-steps/next-steps.js +0 -24
  89. package/bin/libs/number/number-mod.d.ts +0 -28
  90. package/bin/libs/number/number-mod.js +0 -234
  91. package/bin/libs/outro/outro-alias.d.ts +0 -3
  92. package/bin/libs/outro/outro-alias.js +0 -3
  93. package/bin/libs/outro/outro-mod.d.ts +0 -7
  94. package/bin/libs/outro/outro-mod.js +0 -49
  95. package/bin/libs/reliarg/reliarg-mod.d.ts +0 -76
  96. package/bin/libs/reliarg/reliarg-mod.js +0 -276
  97. package/bin/libs/results/results.d.ts +0 -7
  98. package/bin/libs/results/results.js +0 -27
  99. package/bin/libs/select/nummultiselect-prompt.d.ts +0 -6
  100. package/bin/libs/select/nummultiselect-prompt.js +0 -141
  101. package/bin/libs/select/numselect-prompt.d.ts +0 -7
  102. package/bin/libs/select/numselect-prompt.js +0 -111
  103. package/bin/libs/select/select-alias.d.ts +0 -9
  104. package/bin/libs/select/select-alias.js +0 -9
  105. package/bin/libs/select/select-prompt.d.ts +0 -5
  106. package/bin/libs/select/select-prompt.js +0 -311
  107. package/bin/libs/select/toggle-prompt.d.ts +0 -5
  108. package/bin/libs/select/toggle-prompt.js +0 -207
  109. package/bin/libs/spinner/spinner-impl.d.ts +0 -70
  110. package/bin/libs/spinner/spinner-impl.js +0 -336
  111. package/bin/libs/spinner/spinner-mod.d.ts +0 -167
  112. package/bin/libs/spinner/spinner-mod.js +0 -447
  113. package/bin/libs/utils/colorize.d.ts +0 -2
  114. package/bin/libs/utils/colorize.js +0 -122
  115. package/bin/libs/utils/errors.d.ts +0 -1
  116. package/bin/libs/utils/errors.js +0 -17
  117. package/bin/libs/utils/prevent.d.ts +0 -8
  118. package/bin/libs/utils/prevent.js +0 -62
  119. package/bin/libs/utils/prompt-end.d.ts +0 -8
  120. package/bin/libs/utils/prompt-end.js +0 -36
  121. package/bin/libs/utils/stream-text.d.ts +0 -18
  122. package/bin/libs/utils/stream-text.js +0 -138
  123. package/bin/libs/utils/system.d.ts +0 -6
  124. package/bin/libs/utils/system.js +0 -7
  125. package/bin/libs/utils/validate.d.ts +0 -21
  126. package/bin/libs/utils/validate.js +0 -17
  127. package/bin/libs/visual/visual-mod.ts.txt +0 -19
  128. package/bin/mod.d.ts +0 -50
  129. package/bin/mod.js +0 -127
  130. package/bin/types.d.ts +0 -372
  131. /package/{bin → dist/launcher}/types.js +0 -0
@@ -1,285 +0,0 @@
1
- import process from "node:process";
2
- function isUnicodeSupported() {
3
- if (process.platform !== "win32") {
4
- return process.env["TERM"] !== "linux";
5
- }
6
- return Boolean(process.env["WT_SESSION"]) || // Windows Terminal
7
- Boolean(process.env["TERMINUS_SUBLIME"]) || // Terminus (<0.2.27)
8
- process.env["ConEmuTask"] === "{cmd::Cmder}" || // ConEmu and cmder
9
- process.env["TERM_PROGRAM"] === "Terminus-Sublime" || process.env["TERM_PROGRAM"] === "vscode" || process.env["TERM"] === "xterm-256color" || process.env["TERM"] === "alacritty" || process.env["TERMINAL_EMULATOR"] === "JetBrains-JediTerm";
10
- }
11
- const common = {
12
- circleQuestionMark: "(?)",
13
- questionMarkPrefix: "(?)",
14
- square: "\u2588",
15
- squareDarkShade: "\u2593",
16
- squareMediumShade: "\u2592",
17
- squareLightShade: "\u2591",
18
- squareTop: "\u2580",
19
- squareBottom: "\u2584",
20
- squareLeft: "\u258C",
21
- squareRight: "\u2590",
22
- squareCenter: "\u25A0",
23
- bullet: "\u25CF",
24
- dot: "\u2024",
25
- ellipsis: "\u2026",
26
- pointerSmall: "\u203A",
27
- triangleUp: "\u25B2",
28
- triangleUpSmall: "\u25B4",
29
- triangleDown: "\u25BC",
30
- triangleDownSmall: "\u25BE",
31
- triangleLeftSmall: "\u25C2",
32
- triangleRightSmall: "\u25B8",
33
- home: "\u2302",
34
- heart: "\u2665",
35
- musicNote: "\u266A",
36
- musicNoteBeamed: "\u266B",
37
- arrowUp: "\u2191",
38
- arrowDown: "\u2193",
39
- arrowLeft: "\u2190",
40
- arrowRight: "\u2192",
41
- arrowLeftRight: "\u2194",
42
- arrowUpDown: "\u2195",
43
- almostEqual: "\u2248",
44
- notEqual: "\u2260",
45
- lessOrEqual: "\u2264",
46
- greaterOrEqual: "\u2265",
47
- identical: "\u2261",
48
- infinity: "\u221E",
49
- subscriptZero: "\u2080",
50
- subscriptOne: "\u2081",
51
- subscriptTwo: "\u2082",
52
- subscriptThree: "\u2083",
53
- subscriptFour: "\u2084",
54
- subscriptFive: "\u2085",
55
- subscriptSix: "\u2086",
56
- subscriptSeven: "\u2087",
57
- subscriptEight: "\u2088",
58
- subscriptNine: "\u2089",
59
- oneHalf: "\xBD",
60
- oneThird: "\u2153",
61
- oneQuarter: "\xBC",
62
- oneFifth: "\u2155",
63
- oneSixth: "\u2159",
64
- oneEighth: "\u215B",
65
- twoThirds: "\u2154",
66
- twoFifths: "\u2156",
67
- threeQuarters: "\xBE",
68
- threeFifths: "\u2157",
69
- threeEighths: "\u215C",
70
- fourFifths: "\u2158",
71
- fiveSixths: "\u215A",
72
- fiveEighths: "\u215D",
73
- sevenEighths: "\u215E",
74
- line: "\u2500",
75
- lineBold: "\u2501",
76
- lineDouble: "\u2550",
77
- lineDashed0: "\u2504",
78
- lineDashed1: "\u2505",
79
- lineDashed2: "\u2508",
80
- lineDashed3: "\u2509",
81
- lineDashed4: "\u254C",
82
- lineDashed5: "\u254D",
83
- lineDashed6: "\u2574",
84
- lineDashed7: "\u2576",
85
- lineDashed8: "\u2578",
86
- lineDashed9: "\u257A",
87
- lineDashed10: "\u257C",
88
- lineDashed11: "\u257E",
89
- lineDashed12: "\u2212",
90
- lineDashed13: "\u2013",
91
- lineDashed14: "\u2010",
92
- lineDashed15: "\u2043",
93
- lineVertical: "\u2502",
94
- lineVerticalBold: "\u2503",
95
- lineVerticalDouble: "\u2551",
96
- lineVerticalDashed0: "\u2506",
97
- lineVerticalDashed1: "\u2507",
98
- lineVerticalDashed2: "\u250A",
99
- lineVerticalDashed3: "\u250B",
100
- lineVerticalDashed4: "\u254E",
101
- lineVerticalDashed5: "\u254F",
102
- lineVerticalDashed6: "\u2575",
103
- lineVerticalDashed7: "\u2577",
104
- lineVerticalDashed8: "\u2579",
105
- lineVerticalDashed9: "\u257B",
106
- lineVerticalDashed10: "\u257D",
107
- lineVerticalDashed11: "\u257F",
108
- lineDownLeft: "\u2510",
109
- lineDownLeftArc: "\u256E",
110
- lineDownBoldLeftBold: "\u2513",
111
- lineDownBoldLeft: "\u2512",
112
- lineDownLeftBold: "\u2511",
113
- lineDownDoubleLeftDouble: "\u2557",
114
- lineDownDoubleLeft: "\u2556",
115
- lineDownLeftDouble: "\u2555",
116
- lineDownRight: "\u250C",
117
- lineDownRightArc: "\u256D",
118
- lineDownBoldRightBold: "\u250F",
119
- lineDownBoldRight: "\u250E",
120
- lineDownRightBold: "\u250D",
121
- lineDownDoubleRightDouble: "\u2554",
122
- lineDownDoubleRight: "\u2553",
123
- lineDownRightDouble: "\u2552",
124
- lineUpLeft: "\u2518",
125
- lineUpLeftArc: "\u256F",
126
- lineUpBoldLeftBold: "\u251B",
127
- lineUpBoldLeft: "\u251A",
128
- lineUpLeftBold: "\u2519",
129
- lineUpDoubleLeftDouble: "\u255D",
130
- lineUpDoubleLeft: "\u255C",
131
- lineUpLeftDouble: "\u255B",
132
- lineUpRight: "\u2514",
133
- lineUpRightArc: "\u2570",
134
- lineUpBoldRightBold: "\u2517",
135
- lineUpBoldRight: "\u2516",
136
- lineUpRightBold: "\u2515",
137
- lineUpDoubleRightDouble: "\u255A",
138
- lineUpDoubleRight: "\u2559",
139
- lineUpRightDouble: "\u2558",
140
- lineUpDownLeft: "\u2524",
141
- lineUpBoldDownBoldLeftBold: "\u252B",
142
- lineUpBoldDownBoldLeft: "\u2528",
143
- lineUpDownLeftBold: "\u2525",
144
- lineUpBoldDownLeftBold: "\u2529",
145
- lineUpDownBoldLeftBold: "\u252A",
146
- lineUpDownBoldLeft: "\u2527",
147
- lineUpBoldDownLeft: "\u2526",
148
- lineUpDoubleDownDoubleLeftDouble: "\u2563",
149
- lineUpDoubleDownDoubleLeft: "\u2562",
150
- lineUpDownLeftDouble: "\u2561",
151
- lineUpDownRight: "\u251C",
152
- lineUpBoldDownBoldRightBold: "\u2523",
153
- lineUpBoldDownBoldRight: "\u2520",
154
- lineUpDownRightBold: "\u251D",
155
- lineUpBoldDownRightBold: "\u2521",
156
- lineUpDownBoldRightBold: "\u2522",
157
- lineUpDownBoldRight: "\u251F",
158
- lineUpBoldDownRight: "\u251E",
159
- lineUpDoubleDownDoubleRightDouble: "\u2560",
160
- lineUpDoubleDownDoubleRight: "\u255F",
161
- lineUpDownRightDouble: "\u255E",
162
- lineDownLeftRight: "\u252C",
163
- lineDownBoldLeftBoldRightBold: "\u2533",
164
- lineDownLeftBoldRightBold: "\u252F",
165
- lineDownBoldLeftRight: "\u2530",
166
- lineDownBoldLeftBoldRight: "\u2531",
167
- lineDownBoldLeftRightBold: "\u2532",
168
- lineDownLeftRightBold: "\u252E",
169
- lineDownLeftBoldRight: "\u252D",
170
- lineDownDoubleLeftDoubleRightDouble: "\u2566",
171
- lineDownDoubleLeftRight: "\u2565",
172
- lineDownLeftDoubleRightDouble: "\u2564",
173
- lineUpLeftRight: "\u2534",
174
- lineUpBoldLeftBoldRightBold: "\u253B",
175
- lineUpLeftBoldRightBold: "\u2537",
176
- lineUpBoldLeftRight: "\u2538",
177
- lineUpBoldLeftBoldRight: "\u2539",
178
- lineUpBoldLeftRightBold: "\u253A",
179
- lineUpLeftRightBold: "\u2536",
180
- lineUpLeftBoldRight: "\u2535",
181
- lineUpDoubleLeftDoubleRightDouble: "\u2569",
182
- lineUpDoubleLeftRight: "\u2568",
183
- lineUpLeftDoubleRightDouble: "\u2567",
184
- lineUpDownLeftRight: "\u253C",
185
- lineUpBoldDownBoldLeftBoldRightBold: "\u254B",
186
- lineUpDownBoldLeftBoldRightBold: "\u2548",
187
- lineUpBoldDownLeftBoldRightBold: "\u2547",
188
- lineUpBoldDownBoldLeftRightBold: "\u254A",
189
- lineUpBoldDownBoldLeftBoldRight: "\u2549",
190
- lineUpBoldDownLeftRight: "\u2540",
191
- lineUpDownBoldLeftRight: "\u2541",
192
- lineUpDownLeftBoldRight: "\u253D",
193
- lineUpDownLeftRightBold: "\u253E",
194
- lineUpBoldDownBoldLeftRight: "\u2542",
195
- lineUpDownLeftBoldRightBold: "\u253F",
196
- lineUpBoldDownLeftBoldRight: "\u2543",
197
- lineUpBoldDownLeftRightBold: "\u2544",
198
- lineUpDownBoldLeftBoldRight: "\u2545",
199
- lineUpDownBoldLeftRightBold: "\u2546",
200
- lineUpDoubleDownDoubleLeftDoubleRightDouble: "\u256C",
201
- lineUpDoubleDownDoubleLeftRight: "\u256B",
202
- lineUpDownLeftDoubleRightDouble: "\u256A",
203
- lineCross: "\u2573",
204
- lineBackslash: "\u2572",
205
- lineSlash: "\u2571"
206
- };
207
- const specialMainSymbols = {
208
- tick: "\u2714",
209
- info: "\u2139",
210
- warning: "\u26A0",
211
- cross: "\u2718",
212
- squareSmall: "\u25FB",
213
- squareSmallFilled: "\u25FC",
214
- circle: "\u25EF",
215
- circleFilled: "\u25C9",
216
- circleDotted: "\u25CC",
217
- circleDouble: "\u25CE",
218
- circleCircle: "\u24DE",
219
- circleCross: "\u24E7",
220
- circlePipe: "\u24BE",
221
- radioOn: "\u25C9",
222
- radioOff: "\u25EF",
223
- checkboxOn: "\u2612",
224
- checkboxOff: "\u2610",
225
- checkboxCircleOn: "\u24E7",
226
- checkboxCircleOff: "\u24BE",
227
- pointer: "\u276F",
228
- triangleUpOutline: "\u25B3",
229
- triangleLeft: "\u25C0",
230
- triangleRight: "\u25B6",
231
- lozenge: "\u25C6",
232
- lozengeOutline: "\u25C7",
233
- hamburger: "\u2630",
234
- smiley: "\u32E1",
235
- mustache: "\u0DF4",
236
- star: "\u2605",
237
- play: "\u25B6",
238
- nodejs: "\u2B22",
239
- oneSeventh: "\u2150",
240
- oneNinth: "\u2151",
241
- oneTenth: "\u2152"
242
- };
243
- const specialFallbackSymbols = {
244
- tick: "\u221A",
245
- info: "i",
246
- warning: "\u203C",
247
- cross: "\xD7",
248
- squareSmall: "\u25A1",
249
- squareSmallFilled: "\u25A0",
250
- circle: "( )",
251
- circleFilled: "(*)",
252
- circleDotted: "( )",
253
- circleDouble: "( )",
254
- circleCircle: "(\u25CB)",
255
- circleCross: "(\xD7)",
256
- circlePipe: "(\u2502)",
257
- radioOn: "(*)",
258
- radioOff: "( )",
259
- checkboxOn: "[\xD7]",
260
- checkboxOff: "[ ]",
261
- checkboxCircleOn: "(\xD7)",
262
- checkboxCircleOff: "( )",
263
- pointer: ">",
264
- triangleUpOutline: "\u2206",
265
- triangleLeft: "\u25C4",
266
- triangleRight: "\u25BA",
267
- lozenge: "\u2666",
268
- lozengeOutline: "\u25CA",
269
- hamburger: "\u2261",
270
- smiley: "\u263A",
271
- mustache: "\u250C\u2500\u2510",
272
- star: "\u2736",
273
- play: "\u25BA",
274
- nodejs: "\u2666",
275
- oneSeventh: "1/7",
276
- oneNinth: "1/9",
277
- oneTenth: "1/10"
278
- };
279
- export const mainSymbols = { ...common, ...specialMainSymbols };
280
- export const fallbackSymbols = {
281
- ...common,
282
- ...specialFallbackSymbols
283
- };
284
- const shouldUseMain = isUnicodeSupported();
285
- export const figures = shouldUseMain ? mainSymbols : fallbackSymbols;
@@ -1,33 +0,0 @@
1
- export interface GroupOptions {
2
- onCancel?: () => void;
3
- showProgress?: boolean;
4
- title?: string;
5
- }
6
- export interface GroupContext<T> {
7
- results: Partial<T>;
8
- step: keyof T;
9
- stepIndex: number;
10
- totalSteps: number;
11
- }
12
- export type GroupStep<T, K extends keyof T> = (context: GroupContext<T>) => Promise<T[K]> | T[K];
13
- export type GroupSteps<T> = {
14
- [K in keyof T]: GroupStep<T, K>;
15
- };
16
- /**
17
- * Runs a series of prompts in sequence, where each prompt can depend on the results of previous prompts.
18
- *
19
- * @param steps Object where each key is a step name and each value is a function that returns a promise
20
- * @param options Optional configuration including onCancel callback and progress display
21
- * @returns Promise resolving to the complete results object
22
- */
23
- export declare function group<T extends Record<string, any>>(steps: GroupSteps<T>, options?: GroupOptions): Promise<T>;
24
- /**
25
- * Utility function to create a step that depends on specific previous results
26
- */
27
- export declare function createStep<T, K extends keyof T, D extends keyof T>(stepFunction: (context: GroupContext<T>, dependency: T[D]) => Promise<T[K]> | T[K], dependencyKey: D): GroupStep<T, K>;
28
- /**
29
- * Utility function to create a step that depends on multiple previous results
30
- */
31
- export declare function createMultiStep<T, K extends keyof T, D extends (keyof T)[]>(stepFunction: (context: GroupContext<T>, dependencies: {
32
- [P in D[number]]: T[P];
33
- }) => Promise<T[K]> | T[K], dependencyKeys: D): GroupStep<T, K>;
@@ -1,89 +0,0 @@
1
- import { msg } from "../msg-fmt/messages.js";
2
- export async function group(steps, options = {}) {
3
- const { showProgress = true, title = "Configuration" } = options;
4
- const stepKeys = Object.keys(steps);
5
- const results = {};
6
- const totalSteps = stepKeys.length;
7
- if (showProgress && title) {
8
- msg({
9
- type: "M_START",
10
- title,
11
- titleColor: "cyan",
12
- titleTypography: "bold"
13
- });
14
- }
15
- for (let stepIndex = 0; stepIndex < stepKeys.length; stepIndex++) {
16
- const stepKey = stepKeys[stepIndex];
17
- const stepFunction = steps[stepKey];
18
- if (showProgress) {
19
- msg({
20
- type: "M_MIDDLE",
21
- title: `Step ${stepIndex + 1}/${totalSteps}: ${String(stepKey)}`,
22
- titleColor: "dim"
23
- });
24
- }
25
- const context = {
26
- results,
27
- step: stepKey,
28
- stepIndex,
29
- totalSteps
30
- };
31
- try {
32
- const result = await stepFunction(context);
33
- results[stepKey] = result;
34
- if (showProgress) {
35
- msg({
36
- type: "M_MIDDLE",
37
- title: `\u2713 ${String(stepKey)} completed`,
38
- titleColor: "green"
39
- });
40
- }
41
- } catch (error) {
42
- if (error instanceof Error && error.message === "CANCEL") {
43
- if (options.onCancel) {
44
- options.onCancel();
45
- }
46
- throw error;
47
- }
48
- if (showProgress) {
49
- msg({
50
- type: "M_ERROR",
51
- title: `\u2717 ${String(stepKey)} failed: ${error instanceof Error ? error.message : String(error)}`,
52
- titleColor: "red"
53
- });
54
- }
55
- throw error;
56
- }
57
- }
58
- if (showProgress) {
59
- msg({
60
- type: "M_END",
61
- title: `${title} completed successfully!`,
62
- titleColor: "green",
63
- titleTypography: "bold"
64
- });
65
- }
66
- return results;
67
- }
68
- export function createStep(stepFunction, dependencyKey) {
69
- return (context) => {
70
- const dependency = context.results[dependencyKey];
71
- if (dependency === void 0) {
72
- throw new Error(`Dependency '${String(dependencyKey)}' is required but not available`);
73
- }
74
- return stepFunction(context, dependency);
75
- };
76
- }
77
- export function createMultiStep(stepFunction, dependencyKeys) {
78
- return (context) => {
79
- const dependencies = {};
80
- for (const key of dependencyKeys) {
81
- const dependency = context.results[key];
82
- if (dependency === void 0) {
83
- throw new Error(`Dependency '${String(key)}' is required but not available`);
84
- }
85
- dependencies[key] = dependency;
86
- }
87
- return stepFunction(context, dependencies);
88
- };
89
- }
@@ -1,5 +0,0 @@
1
- import type { InputPromptOptions } from "../../types";
2
- import { inputPrompt } from "./input-mod";
3
- export declare const input: typeof inputPrompt;
4
- export declare const text: typeof inputPrompt;
5
- export declare const password: (options: Omit<InputPromptOptions, "mode">) => Promise<string>;
@@ -1,4 +0,0 @@
1
- import { inputPrompt } from "./input-mod.js";
2
- export const input = inputPrompt;
3
- export const text = inputPrompt;
4
- export const password = (options) => inputPrompt({ ...options, mode: "password" });
@@ -1,16 +0,0 @@
1
- import type { InputPromptOptions } from "../../types";
2
- /**
3
- * inputPrompt()
4
- *
5
- * Main entry point to prompt the user for input.
6
- * - Renders a text prompt with optional hint, placeholder, and content.
7
- * - Waits for user input (supporting "plain" or "password" modes).
8
- * - Validates input with an optional TypeBox schema or custom validate() fn.
9
- * - Shows errors if invalid, re-prompts if necessary.
10
- * - Handles Ctrl+C gracefully, optionally printing an endTitle.
11
- * - Returns the user's validated input, or a default value if empty.
12
- *
13
- * @param options InputPromptOptions to customize the prompt.
14
- * @returns A Promise resolving to the validated user input (string).
15
- */
16
- export declare function inputPrompt(options: InputPromptOptions): Promise<string>;