@reliverse/rempts 1.7.44 → 1.7.45
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/README.md +1 -1
- package/dist-npm/bin/mod.d.mts +2333 -0
- package/dist-npm/bin/mod.mjs +8236 -0
- package/package.json +84 -42
- package/bin/libs/animate/animate-mod.d.ts +0 -14
- package/bin/libs/animate/animate-mod.js +0 -62
- package/bin/libs/anykey/anykey-mod.d.ts +0 -12
- package/bin/libs/anykey/anykey-mod.js +0 -125
- package/bin/libs/cancel/cancel.d.ts +0 -45
- package/bin/libs/cancel/cancel.js +0 -72
- package/bin/libs/confirm/confirm-alias.d.ts +0 -2
- package/bin/libs/confirm/confirm-alias.js +0 -2
- package/bin/libs/confirm/confirm-mod.d.ts +0 -5
- package/bin/libs/confirm/confirm-mod.js +0 -179
- package/bin/libs/date/date.d.ts +0 -2
- package/bin/libs/date/date.js +0 -236
- package/bin/libs/editor/editor-mod.d.ts +0 -25
- package/bin/libs/editor/editor-mod.js +0 -897
- package/bin/libs/figures/figures-mod.d.ts +0 -461
- package/bin/libs/figures/figures-mod.js +0 -285
- package/bin/libs/group/group-mod.d.ts +0 -33
- package/bin/libs/group/group-mod.js +0 -93
- package/bin/libs/input/input-alias.d.ts +0 -5
- package/bin/libs/input/input-alias.js +0 -4
- package/bin/libs/input/input-mod.d.ts +0 -16
- package/bin/libs/input/input-mod.js +0 -372
- package/bin/libs/intro/intro-alias.d.ts +0 -2
- package/bin/libs/intro/intro-alias.js +0 -3
- package/bin/libs/intro/intro-mod.d.ts +0 -20
- package/bin/libs/intro/intro-mod.js +0 -81
- package/bin/libs/launcher/command-runner.d.ts +0 -18
- package/bin/libs/launcher/command-runner.js +0 -79
- package/bin/libs/launcher/command-typed.d.ts +0 -16
- package/bin/libs/launcher/command-typed.js +0 -60
- package/bin/libs/launcher/launcher-alias.d.ts +0 -2
- package/bin/libs/launcher/launcher-alias.js +0 -2
- package/bin/libs/launcher/launcher-mod.d.ts +0 -162
- package/bin/libs/launcher/launcher-mod.js +0 -1222
- package/bin/libs/launcher/launcher-types.d.ts +0 -159
- package/bin/libs/launcher/launcher-types.js +0 -0
- package/bin/libs/launcher/trpc-orpc-support/completions.d.ts +0 -4
- package/bin/libs/launcher/trpc-orpc-support/completions.js +0 -45
- package/bin/libs/launcher/trpc-orpc-support/errors.d.ts +0 -11
- package/bin/libs/launcher/trpc-orpc-support/errors.js +0 -10
- package/bin/libs/launcher/trpc-orpc-support/index.d.ts +0 -34
- package/bin/libs/launcher/trpc-orpc-support/index.js +0 -641
- package/bin/libs/launcher/trpc-orpc-support/json-schema.d.ts +0 -17
- package/bin/libs/launcher/trpc-orpc-support/json-schema.js +0 -168
- package/bin/libs/launcher/trpc-orpc-support/json.d.ts +0 -44
- package/bin/libs/launcher/trpc-orpc-support/json.js +0 -41
- package/bin/libs/launcher/trpc-orpc-support/logging.d.ts +0 -11
- package/bin/libs/launcher/trpc-orpc-support/logging.js +0 -26
- package/bin/libs/launcher/trpc-orpc-support/parse-procedure.d.ts +0 -2
- package/bin/libs/launcher/trpc-orpc-support/parse-procedure.js +0 -486
- package/bin/libs/launcher/trpc-orpc-support/prompts.d.ts +0 -18
- package/bin/libs/launcher/trpc-orpc-support/prompts.js +0 -534
- package/bin/libs/launcher/trpc-orpc-support/standard-schema/contract.d.ts +0 -53
- package/bin/libs/launcher/trpc-orpc-support/standard-schema/contract.js +0 -0
- package/bin/libs/launcher/trpc-orpc-support/standard-schema/errors.d.ts +0 -9
- package/bin/libs/launcher/trpc-orpc-support/standard-schema/errors.js +0 -47
- package/bin/libs/launcher/trpc-orpc-support/standard-schema/utils.d.ts +0 -3
- package/bin/libs/launcher/trpc-orpc-support/standard-schema/utils.js +0 -6
- package/bin/libs/launcher/trpc-orpc-support/trpc-compat.d.ts +0 -71
- package/bin/libs/launcher/trpc-orpc-support/trpc-compat.js +0 -11
- package/bin/libs/launcher/trpc-orpc-support/types.d.ts +0 -276
- package/bin/libs/launcher/trpc-orpc-support/types.js +0 -0
- package/bin/libs/launcher/trpc-orpc-support/util.d.ts +0 -9
- package/bin/libs/launcher/trpc-orpc-support/util.js +0 -9
- package/bin/libs/log/log-alias.d.ts +0 -1
- package/bin/libs/log/log-alias.js +0 -2
- package/bin/libs/msg-fmt/colors.d.ts +0 -30
- package/bin/libs/msg-fmt/colors.js +0 -42
- package/bin/libs/msg-fmt/logger.d.ts +0 -17
- package/bin/libs/msg-fmt/logger.js +0 -103
- package/bin/libs/msg-fmt/mapping.d.ts +0 -3
- package/bin/libs/msg-fmt/mapping.js +0 -49
- package/bin/libs/msg-fmt/messages.d.ts +0 -35
- package/bin/libs/msg-fmt/messages.js +0 -319
- package/bin/libs/msg-fmt/terminal.d.ts +0 -15
- package/bin/libs/msg-fmt/terminal.js +0 -60
- package/bin/libs/msg-fmt/variants.d.ts +0 -11
- package/bin/libs/msg-fmt/variants.js +0 -52
- package/bin/libs/multiselect/multiselect-alias.d.ts +0 -2
- package/bin/libs/multiselect/multiselect-alias.js +0 -2
- package/bin/libs/multiselect/multiselect-prompt.d.ts +0 -2
- package/bin/libs/multiselect/multiselect-prompt.js +0 -348
- package/bin/libs/next-steps/next-steps.d.ts +0 -14
- package/bin/libs/next-steps/next-steps.js +0 -24
- package/bin/libs/number/number-mod.d.ts +0 -28
- package/bin/libs/number/number-mod.js +0 -194
- package/bin/libs/outro/outro-alias.d.ts +0 -2
- package/bin/libs/outro/outro-alias.js +0 -3
- package/bin/libs/outro/outro-mod.d.ts +0 -8
- package/bin/libs/outro/outro-mod.js +0 -55
- package/bin/libs/results/results.d.ts +0 -7
- package/bin/libs/results/results.js +0 -27
- package/bin/libs/select/nummultiselect-prompt.d.ts +0 -6
- package/bin/libs/select/nummultiselect-prompt.js +0 -105
- package/bin/libs/select/numselect-prompt.d.ts +0 -7
- package/bin/libs/select/numselect-prompt.js +0 -115
- package/bin/libs/select/select-alias.d.ts +0 -9
- package/bin/libs/select/select-alias.js +0 -9
- package/bin/libs/select/select-prompt.d.ts +0 -5
- package/bin/libs/select/select-prompt.js +0 -314
- package/bin/libs/select/toggle-prompt.d.ts +0 -5
- package/bin/libs/select/toggle-prompt.js +0 -209
- package/bin/libs/spinner/spinner-alias.d.ts +0 -1
- package/bin/libs/spinner/spinner-alias.js +0 -2
- package/bin/libs/spinner/spinner-mod.d.ts +0 -106
- package/bin/libs/spinner/spinner-mod.js +0 -265
- package/bin/libs/task/progress.d.ts +0 -2
- package/bin/libs/task/progress.js +0 -57
- package/bin/libs/task/task-spin.d.ts +0 -15
- package/bin/libs/task/task-spin.js +0 -110
- package/bin/libs/utils/colorize.d.ts +0 -2
- package/bin/libs/utils/colorize.js +0 -135
- package/bin/libs/utils/errors.d.ts +0 -1
- package/bin/libs/utils/errors.js +0 -17
- package/bin/libs/utils/prevent.d.ts +0 -8
- package/bin/libs/utils/prevent.js +0 -65
- package/bin/libs/utils/prompt-end.d.ts +0 -8
- package/bin/libs/utils/prompt-end.js +0 -34
- package/bin/libs/utils/stream-text.d.ts +0 -18
- package/bin/libs/utils/stream-text.js +0 -136
- package/bin/libs/utils/system.d.ts +0 -6
- package/bin/libs/utils/system.js +0 -7
- package/bin/libs/utils/validate.d.ts +0 -21
- package/bin/libs/utils/validate.js +0 -17
- package/bin/libs/visual/visual-mod.d.ts +0 -6
- package/bin/libs/visual/visual-mod.js +0 -13
- package/bin/mod.d.ts +0 -69
- package/bin/mod.js +0 -159
- package/bin/types.d.ts +0 -371
- package/bin/types.js +0 -0
|
@@ -0,0 +1,2333 @@
|
|
|
1
|
+
import { AnimationName as AnimationName$1, Animation } from '@figliolia/chalk-animation';
|
|
2
|
+
import { Readable, Writable } from 'node:stream';
|
|
3
|
+
import { Fonts } from 'figlet';
|
|
4
|
+
import { ReliArgParserOptions } from '@reliverse/reliarg';
|
|
5
|
+
import { JSONSchema7 } from 'json-schema';
|
|
6
|
+
import { JsonSchema7Type, JsonSchema7ObjectType } from 'zod-to-json-schema';
|
|
7
|
+
import { Command as Command$1, Argument, Option } from 'commander';
|
|
8
|
+
import * as _reliverse_relinka from '@reliverse/relinka';
|
|
9
|
+
import { SpinnerName } from 'cli-spinners';
|
|
10
|
+
import * as _reliverse_runtime from '@reliverse/runtime';
|
|
11
|
+
import * as server from '@trpc/server';
|
|
12
|
+
export { server as trpcServer };
|
|
13
|
+
export { z } from 'zod/v4';
|
|
14
|
+
import * as zod from 'zod';
|
|
15
|
+
export { zod };
|
|
16
|
+
|
|
17
|
+
type MsgType = "M_NULL" | "M_INFO_NULL" | "M_START" | "M_MIDDLE" | "M_GENERAL" | "M_GENERAL_NULL" | "M_INFO" | "M_ERROR" | "M_ERROR_NULL" | "M_END" | "M_NEWLINE" | "M_BAR";
|
|
18
|
+
type TypographyName = "bold" | "strikethrough" | "underline" | "italic" | "none";
|
|
19
|
+
type BorderColorName = "reset" | "inverse" | "dim" | "black" | "red" | "redBright" | "green" | "greenBright" | "yellow" | "yellowBright" | "blue" | "blueBright" | "magenta" | "magentaBright" | "cyan" | "cyanBright" | "bgCyan" | "bgCyanBright" | "white" | "gray";
|
|
20
|
+
type ColorName = BorderColorName | "gradientGradient" | "rainbowGradient" | "cristalGradient" | "mindGradient" | "passionGradient" | "viceGradient" | "retroGradient" | "none";
|
|
21
|
+
type AnimationName = "rainbow" | "pulse" | "glitch" | "radar" | "neon" | "karaoke";
|
|
22
|
+
type VariantName$1 = "doubleBox" | "none";
|
|
23
|
+
interface MsgConfig {
|
|
24
|
+
symbol: string;
|
|
25
|
+
prefix?: string;
|
|
26
|
+
color?: (text: string) => string;
|
|
27
|
+
newLineBefore?: boolean;
|
|
28
|
+
newLineAfter?: boolean;
|
|
29
|
+
suffix?: string;
|
|
30
|
+
}
|
|
31
|
+
interface PromptOptions {
|
|
32
|
+
schema?: any;
|
|
33
|
+
title?: string;
|
|
34
|
+
titleColor?: ColorName;
|
|
35
|
+
titleTypography?: TypographyName;
|
|
36
|
+
titleVariant?: VariantName$1;
|
|
37
|
+
titleAnimation?: AnimationName;
|
|
38
|
+
titleAnimationDelay?: number;
|
|
39
|
+
content?: string;
|
|
40
|
+
contentColor?: ColorName;
|
|
41
|
+
contentTypography?: TypographyName;
|
|
42
|
+
contentVariant?: VariantName$1;
|
|
43
|
+
hint?: string;
|
|
44
|
+
placeholder?: string;
|
|
45
|
+
validate?: (value: any) => boolean | string | undefined | Promise<boolean | string | undefined>;
|
|
46
|
+
defaultColor?: ColorName;
|
|
47
|
+
defaultTypography?: TypographyName;
|
|
48
|
+
choices?: ChoiceOptions[];
|
|
49
|
+
variantOptions?: {
|
|
50
|
+
box?: {
|
|
51
|
+
limit?: number;
|
|
52
|
+
};
|
|
53
|
+
};
|
|
54
|
+
action?: () => Promise<void>;
|
|
55
|
+
border?: boolean;
|
|
56
|
+
borderColor?: BorderColorName;
|
|
57
|
+
additionalLinesToDelete?: number;
|
|
58
|
+
hintPlaceholderColor?: ColorName;
|
|
59
|
+
hints?: string[];
|
|
60
|
+
required?: boolean;
|
|
61
|
+
initial?: any[];
|
|
62
|
+
endTitle?: string;
|
|
63
|
+
endTitleColor?: ColorName;
|
|
64
|
+
horizontalLine?: boolean;
|
|
65
|
+
horizontalLineLength?: number;
|
|
66
|
+
symbol?: string;
|
|
67
|
+
customSymbol?: string;
|
|
68
|
+
}
|
|
69
|
+
interface ChoiceRequiredOptions {
|
|
70
|
+
id: string;
|
|
71
|
+
title: string;
|
|
72
|
+
}
|
|
73
|
+
interface ChoiceOptionalOptions {
|
|
74
|
+
description?: string;
|
|
75
|
+
titleTypography?: TypographyName;
|
|
76
|
+
action?: () => Promise<void>;
|
|
77
|
+
}
|
|
78
|
+
type ChoiceOptions = ChoiceRequiredOptions & ChoiceOptionalOptions;
|
|
79
|
+
interface SelectOption<T> {
|
|
80
|
+
value: T;
|
|
81
|
+
label: string;
|
|
82
|
+
hint?: string;
|
|
83
|
+
disabled?: boolean;
|
|
84
|
+
}
|
|
85
|
+
/**
|
|
86
|
+
* Standard terminal colors supported by most terminals
|
|
87
|
+
*/
|
|
88
|
+
type StandardColor = "black" | "red" | "green" | "yellow" | "blue" | "magenta" | "cyan" | "white" | "gray";
|
|
89
|
+
/**
|
|
90
|
+
* All possible output colors including special colors
|
|
91
|
+
*/
|
|
92
|
+
type OutputColor = StandardColor | "dim";
|
|
93
|
+
interface EditorExitResult {
|
|
94
|
+
saved: boolean;
|
|
95
|
+
content: string | null;
|
|
96
|
+
filename: string | null;
|
|
97
|
+
}
|
|
98
|
+
type MessageKind = "log" | "info" | "warn" | "error" | "success";
|
|
99
|
+
type VerboseKind = `${MessageKind}-verbose`;
|
|
100
|
+
type AllKinds = MessageKind | VerboseKind;
|
|
101
|
+
interface MessageConfig {
|
|
102
|
+
type: "M_INFO" | "M_ERROR";
|
|
103
|
+
titleColor?: "retroGradient" | "viceGradient" | "yellowBright";
|
|
104
|
+
titleTypography?: "bold";
|
|
105
|
+
contentColor?: "dim";
|
|
106
|
+
contentTypography?: "italic";
|
|
107
|
+
}
|
|
108
|
+
interface StreamOptions {
|
|
109
|
+
delay?: number;
|
|
110
|
+
useSpinner?: boolean;
|
|
111
|
+
spinnerFrames?: string[];
|
|
112
|
+
spinnerDelay?: number;
|
|
113
|
+
}
|
|
114
|
+
interface ProgressBarOptions {
|
|
115
|
+
total: number;
|
|
116
|
+
width?: number;
|
|
117
|
+
completeChar?: string;
|
|
118
|
+
incompleteChar?: string;
|
|
119
|
+
format?: string;
|
|
120
|
+
colorize?: boolean;
|
|
121
|
+
increment?: number;
|
|
122
|
+
desiredTotalTime?: number;
|
|
123
|
+
}
|
|
124
|
+
interface ProgressBar {
|
|
125
|
+
update: (value: number) => Promise<void>;
|
|
126
|
+
increment: (amount?: number) => Promise<void>;
|
|
127
|
+
render: () => Promise<void>;
|
|
128
|
+
}
|
|
129
|
+
/**
|
|
130
|
+
* Union type for available prompt types.
|
|
131
|
+
*/
|
|
132
|
+
type PromptType = "input" | "inputmasked" | "select" | "multiselect" | "nummultiselect" | "numselect" | "toggle" | "confirm" | "spinner" | "progressbar" | "results" | "nextsteps" | "animatedtext" | "date" | "end";
|
|
133
|
+
interface ConfirmPromptOptions {
|
|
134
|
+
title?: string;
|
|
135
|
+
message?: string;
|
|
136
|
+
defaultValue?: boolean;
|
|
137
|
+
initialValue?: boolean;
|
|
138
|
+
content?: string;
|
|
139
|
+
titleColor?: ColorName;
|
|
140
|
+
titleTypography?: TypographyName;
|
|
141
|
+
titleVariant?: VariantName$1;
|
|
142
|
+
contentColor?: ColorName;
|
|
143
|
+
contentTypography?: TypographyName;
|
|
144
|
+
contentVariant?: VariantName$1;
|
|
145
|
+
borderColor?: BorderColorName;
|
|
146
|
+
hintPlaceholderColor?: ColorName;
|
|
147
|
+
variantOptions?: any;
|
|
148
|
+
action?: () => Promise<void>;
|
|
149
|
+
displayInstructions?: boolean;
|
|
150
|
+
debug?: boolean;
|
|
151
|
+
endTitle?: string;
|
|
152
|
+
endTitleColor?: ColorName;
|
|
153
|
+
border?: boolean;
|
|
154
|
+
terminalWidth?: number;
|
|
155
|
+
}
|
|
156
|
+
interface StreamTextOptions {
|
|
157
|
+
/**
|
|
158
|
+
* Text to stream
|
|
159
|
+
*/
|
|
160
|
+
text: string;
|
|
161
|
+
/**
|
|
162
|
+
* Delay between each character in milliseconds
|
|
163
|
+
* @default 50
|
|
164
|
+
*/
|
|
165
|
+
delay?: number;
|
|
166
|
+
/**
|
|
167
|
+
* Whether to show cursor while streaming
|
|
168
|
+
* @default false
|
|
169
|
+
*/
|
|
170
|
+
showCursor?: boolean;
|
|
171
|
+
/**
|
|
172
|
+
* Color to use for the text
|
|
173
|
+
* @default undefined (no color)
|
|
174
|
+
*/
|
|
175
|
+
color?: ColorName;
|
|
176
|
+
/**
|
|
177
|
+
* Whether to inject a newline at the end
|
|
178
|
+
* @default true
|
|
179
|
+
*/
|
|
180
|
+
newline?: boolean;
|
|
181
|
+
/**
|
|
182
|
+
* Whether to clear the line before streaming
|
|
183
|
+
* @default false
|
|
184
|
+
*/
|
|
185
|
+
clearLine?: boolean;
|
|
186
|
+
/**
|
|
187
|
+
* Callback function to update the spinner text
|
|
188
|
+
*/
|
|
189
|
+
onProgress?: (currentText: string) => void;
|
|
190
|
+
}
|
|
191
|
+
interface PreventWrongTerminalSizeOptions {
|
|
192
|
+
isDev?: boolean;
|
|
193
|
+
shouldExit?: boolean;
|
|
194
|
+
minWidth?: number;
|
|
195
|
+
minHeight?: number;
|
|
196
|
+
sizeErrorDescription?: string;
|
|
197
|
+
}
|
|
198
|
+
/**
|
|
199
|
+
* InputPromptOptions
|
|
200
|
+
*
|
|
201
|
+
* Extended options for handling user input prompts, including validation
|
|
202
|
+
* and UI styling. Inherits from PromptOptions.
|
|
203
|
+
*/
|
|
204
|
+
type InputPromptOptions = {
|
|
205
|
+
border?: boolean;
|
|
206
|
+
borderColor?: BorderColorName;
|
|
207
|
+
content?: string;
|
|
208
|
+
contentColor?: ColorName;
|
|
209
|
+
contentTypography?: TypographyName;
|
|
210
|
+
contentVariant?: VariantName$1;
|
|
211
|
+
customSymbol?: string;
|
|
212
|
+
defaultValue?: string;
|
|
213
|
+
initialValue?: string;
|
|
214
|
+
endTitle?: string;
|
|
215
|
+
endTitleColor?: ColorName;
|
|
216
|
+
hardcoded?: {
|
|
217
|
+
userInput?: string;
|
|
218
|
+
errorMessage?: string;
|
|
219
|
+
showPlaceholder?: boolean;
|
|
220
|
+
};
|
|
221
|
+
hint?: string;
|
|
222
|
+
hintPlaceholderColor?: ColorName;
|
|
223
|
+
message?: string;
|
|
224
|
+
mode?: "plain" | "password";
|
|
225
|
+
mask?: string;
|
|
226
|
+
placeholder?: string;
|
|
227
|
+
schema?: any;
|
|
228
|
+
shouldStream?: boolean;
|
|
229
|
+
streamDelay?: number;
|
|
230
|
+
symbol?: SymbolName;
|
|
231
|
+
symbolColor?: ColorName;
|
|
232
|
+
title?: string;
|
|
233
|
+
titleColor?: ColorName;
|
|
234
|
+
titleTypography?: TypographyName;
|
|
235
|
+
titleVariant?: VariantName$1;
|
|
236
|
+
validate?: (value: string) => string | boolean | undefined | Promise<string | boolean | undefined>;
|
|
237
|
+
variantOptions?: unknown;
|
|
238
|
+
} & PromptOptions;
|
|
239
|
+
interface RenderParams {
|
|
240
|
+
border: boolean;
|
|
241
|
+
borderColor?: BorderColorName;
|
|
242
|
+
content?: string;
|
|
243
|
+
contentColor?: ColorName;
|
|
244
|
+
contentTypography?: TypographyName;
|
|
245
|
+
contentVariant?: VariantName$1;
|
|
246
|
+
customSymbol?: string;
|
|
247
|
+
errorMessage: string;
|
|
248
|
+
hint?: string;
|
|
249
|
+
hintPlaceholderColor?: ColorName;
|
|
250
|
+
mask?: string;
|
|
251
|
+
placeholder?: string;
|
|
252
|
+
symbol?: SymbolName;
|
|
253
|
+
symbolColor?: ColorName;
|
|
254
|
+
title?: string;
|
|
255
|
+
titleColor?: ColorName;
|
|
256
|
+
titleTypography?: TypographyName;
|
|
257
|
+
titleVariant?: VariantName$1;
|
|
258
|
+
userInput: string;
|
|
259
|
+
isRerender?: boolean;
|
|
260
|
+
}
|
|
261
|
+
/**
|
|
262
|
+
* Known symbol names that will have IntelliSense support
|
|
263
|
+
*/
|
|
264
|
+
type SymbolName = "pointer" | "start" | "middle" | "end" | "line" | "corner_top_right" | "step_active" | "step_error" | "log" | "success" | "info" | "warn" | "error";
|
|
265
|
+
type Symbols = Record<SymbolName, string>;
|
|
266
|
+
interface FmtMsgOptions {
|
|
267
|
+
type: MsgType;
|
|
268
|
+
title?: string;
|
|
269
|
+
titleAfterAnim?: string;
|
|
270
|
+
content?: string | undefined;
|
|
271
|
+
titleColor?: ColorName;
|
|
272
|
+
titleTypography?: TypographyName;
|
|
273
|
+
titleVariant?: VariantName$1;
|
|
274
|
+
contentColor?: ColorName;
|
|
275
|
+
contentTypography?: TypographyName;
|
|
276
|
+
contentVariant?: VariantName$1;
|
|
277
|
+
hint?: string;
|
|
278
|
+
hintPlaceholderColor?: ColorName;
|
|
279
|
+
hintTypography?: TypographyName;
|
|
280
|
+
border?: boolean;
|
|
281
|
+
borderColor?: ColorName;
|
|
282
|
+
dontRemoveBar?: boolean;
|
|
283
|
+
variantOptions?: {
|
|
284
|
+
box?: {
|
|
285
|
+
limit?: number;
|
|
286
|
+
};
|
|
287
|
+
};
|
|
288
|
+
errorMessage?: string;
|
|
289
|
+
addNewLineBefore?: boolean;
|
|
290
|
+
addNewLineAfter?: boolean;
|
|
291
|
+
placeholder?: string;
|
|
292
|
+
horizontalLine?: boolean;
|
|
293
|
+
horizontalLineLength?: number;
|
|
294
|
+
terminalWidth?: number;
|
|
295
|
+
instructions?: string;
|
|
296
|
+
wrapTitle?: boolean;
|
|
297
|
+
wrapContent?: boolean;
|
|
298
|
+
symbol?: SymbolName;
|
|
299
|
+
customSymbol?: string;
|
|
300
|
+
symbolColor?: ColorName;
|
|
301
|
+
noNewLine?: boolean;
|
|
302
|
+
}
|
|
303
|
+
interface TogglePromptParams<T extends string> {
|
|
304
|
+
title?: string;
|
|
305
|
+
message?: string;
|
|
306
|
+
content?: string;
|
|
307
|
+
options?: [T, T];
|
|
308
|
+
defaultValue?: T;
|
|
309
|
+
initialValue?: T;
|
|
310
|
+
borderColor?: BorderColorName;
|
|
311
|
+
titleColor?: ColorName;
|
|
312
|
+
titleTypography?: TypographyName;
|
|
313
|
+
titleVariant?: VariantName$1;
|
|
314
|
+
contentColor?: ColorName;
|
|
315
|
+
contentTypography?: TypographyName;
|
|
316
|
+
border?: boolean;
|
|
317
|
+
endTitle?: string;
|
|
318
|
+
endTitleColor?: ColorName;
|
|
319
|
+
displayInstructions?: boolean;
|
|
320
|
+
debug?: boolean;
|
|
321
|
+
}
|
|
322
|
+
interface SeparatorOption {
|
|
323
|
+
separator: true;
|
|
324
|
+
width?: number;
|
|
325
|
+
symbol?: SymbolName;
|
|
326
|
+
}
|
|
327
|
+
interface SelectPromptParams<T extends string> {
|
|
328
|
+
title?: string;
|
|
329
|
+
message?: string;
|
|
330
|
+
content?: string;
|
|
331
|
+
options?: (SelectOption<T> | SeparatorOption)[];
|
|
332
|
+
optionsArray?: {
|
|
333
|
+
value: T;
|
|
334
|
+
label?: string;
|
|
335
|
+
hint?: string;
|
|
336
|
+
}[];
|
|
337
|
+
defaultValue?: T;
|
|
338
|
+
initialValue?: T;
|
|
339
|
+
required?: boolean;
|
|
340
|
+
borderColor?: BorderColorName;
|
|
341
|
+
titleColor?: ColorName;
|
|
342
|
+
titleTypography?: TypographyName;
|
|
343
|
+
titleVariant?: VariantName$1;
|
|
344
|
+
contentColor?: ColorName;
|
|
345
|
+
contentTypography?: TypographyName;
|
|
346
|
+
border?: boolean;
|
|
347
|
+
endTitle?: string;
|
|
348
|
+
endTitleColor?: ColorName;
|
|
349
|
+
debug?: boolean;
|
|
350
|
+
terminalWidth?: number;
|
|
351
|
+
displayInstructions?: boolean;
|
|
352
|
+
shouldStream?: boolean;
|
|
353
|
+
streamDelay?: number;
|
|
354
|
+
}
|
|
355
|
+
interface MultiselectPromptParams<T extends string> {
|
|
356
|
+
title?: string;
|
|
357
|
+
message?: string;
|
|
358
|
+
content?: string;
|
|
359
|
+
options: (SelectOption<T> | SeparatorOption)[];
|
|
360
|
+
defaultValue?: T[];
|
|
361
|
+
initialValues?: T[];
|
|
362
|
+
borderColor?: BorderColorName;
|
|
363
|
+
titleColor?: ColorName;
|
|
364
|
+
titleTypography?: TypographyName;
|
|
365
|
+
titleVariant?: VariantName$1;
|
|
366
|
+
contentColor?: ColorName;
|
|
367
|
+
contentTypography?: TypographyName;
|
|
368
|
+
border?: boolean;
|
|
369
|
+
endTitle?: string;
|
|
370
|
+
endTitleColor?: ColorName;
|
|
371
|
+
debug?: boolean;
|
|
372
|
+
terminalWidth?: number;
|
|
373
|
+
displayInstructions?: boolean;
|
|
374
|
+
required?: boolean;
|
|
375
|
+
minSelect?: number;
|
|
376
|
+
maxSelect?: number;
|
|
377
|
+
selectAll?: boolean;
|
|
378
|
+
}
|
|
379
|
+
type DatePromptOptions = PromptOptions & {
|
|
380
|
+
dateFormat: string;
|
|
381
|
+
dateKind: "birthday" | "other";
|
|
382
|
+
defaultValue?: string;
|
|
383
|
+
endTitle?: string;
|
|
384
|
+
endTitleColor?: ColorName;
|
|
385
|
+
border?: boolean;
|
|
386
|
+
};
|
|
387
|
+
|
|
388
|
+
declare const animationMap: Record<AnimationName$1, (text: string) => Animation>;
|
|
389
|
+
declare function animateText({ title, anim, delay, type, titleColor, titleTypography, border, borderColor, horizontalLineLength, }: {
|
|
390
|
+
title: string;
|
|
391
|
+
anim: AnimationName$1;
|
|
392
|
+
delay?: number;
|
|
393
|
+
type?: MsgType;
|
|
394
|
+
titleColor?: ColorName;
|
|
395
|
+
titleTypography?: TypographyName;
|
|
396
|
+
borderColor?: BorderColorName;
|
|
397
|
+
border?: boolean;
|
|
398
|
+
horizontalLineLength?: number;
|
|
399
|
+
}): Promise<void>;
|
|
400
|
+
|
|
401
|
+
interface Options {
|
|
402
|
+
ctrlC?: number | false | "reject";
|
|
403
|
+
preserveLog?: boolean;
|
|
404
|
+
hideMessage?: boolean;
|
|
405
|
+
shouldStream?: boolean;
|
|
406
|
+
streamDelay?: number;
|
|
407
|
+
color?: ColorName;
|
|
408
|
+
placeholderColor?: ColorName;
|
|
409
|
+
}
|
|
410
|
+
declare function anykeyPrompt(message?: string, options?: Options): Promise<void>;
|
|
411
|
+
|
|
412
|
+
/**
|
|
413
|
+
* Special value that indicates a cancelled operation
|
|
414
|
+
*/
|
|
415
|
+
declare const CANCEL: unique symbol;
|
|
416
|
+
/**
|
|
417
|
+
* Type for the cancel value
|
|
418
|
+
*/
|
|
419
|
+
type CancelValue = typeof CANCEL;
|
|
420
|
+
declare const isWindows: boolean;
|
|
421
|
+
/**
|
|
422
|
+
* Sets raw mode on input stream
|
|
423
|
+
*/
|
|
424
|
+
declare function setRawMode(input: Readable, value: boolean): void;
|
|
425
|
+
/**
|
|
426
|
+
* Gets the number of columns in the terminal
|
|
427
|
+
*/
|
|
428
|
+
declare function getColumns(output: Writable): number;
|
|
429
|
+
interface BlockOptions {
|
|
430
|
+
input?: Readable;
|
|
431
|
+
output?: Writable;
|
|
432
|
+
overwrite?: boolean;
|
|
433
|
+
hideCursor?: boolean;
|
|
434
|
+
}
|
|
435
|
+
/**
|
|
436
|
+
* Creates a block for handling input with proper cursor and cleanup
|
|
437
|
+
*/
|
|
438
|
+
declare function block({ input, output, overwrite, hideCursor, }?: BlockOptions): () => void;
|
|
439
|
+
/**
|
|
440
|
+
* Checks if a value represents a cancelled operation
|
|
441
|
+
* @param value - The value to check
|
|
442
|
+
* @returns true if the value represents a cancelled operation
|
|
443
|
+
*/
|
|
444
|
+
declare function isCancel(value: unknown): value is CancelValue;
|
|
445
|
+
/**
|
|
446
|
+
* Handles cancellation of an operation
|
|
447
|
+
* @param message - Optional message to display before exiting
|
|
448
|
+
*/
|
|
449
|
+
declare function cancel(message?: string): never;
|
|
450
|
+
/**
|
|
451
|
+
* Creates a cancel value that can be returned from operations
|
|
452
|
+
* @returns The cancel value
|
|
453
|
+
*/
|
|
454
|
+
declare function createCancel(): CancelValue;
|
|
455
|
+
|
|
456
|
+
declare const confirm: (options: ConfirmPromptOptions) => Promise<boolean>;
|
|
457
|
+
|
|
458
|
+
/**
|
|
459
|
+
* Prompts the user with a yes/no question, returning a boolean based on their input.
|
|
460
|
+
*/
|
|
461
|
+
declare function confirmPrompt(options: ConfirmPromptOptions): Promise<boolean>;
|
|
462
|
+
|
|
463
|
+
declare function datePrompt(opts: DatePromptOptions): Promise<string>;
|
|
464
|
+
|
|
465
|
+
interface EditorConfig {
|
|
466
|
+
syntaxHighlighting?: boolean;
|
|
467
|
+
theme?: "auto" | "light" | "dark";
|
|
468
|
+
defaultAllowSaveAs?: boolean;
|
|
469
|
+
defaultAllowOpen?: boolean;
|
|
470
|
+
defaultAutoCloseOnSave?: boolean;
|
|
471
|
+
defaultReturnContentOnSave?: boolean;
|
|
472
|
+
[key: string]: any;
|
|
473
|
+
}
|
|
474
|
+
interface EditorOptions {
|
|
475
|
+
filename?: string | null;
|
|
476
|
+
initialContent?: string | null;
|
|
477
|
+
onSave?: (content: string, filename: string | null) => Promise<string | boolean | undefined> | string | boolean | undefined;
|
|
478
|
+
onExit?: (content: string | null, saved: boolean, filename: string | null) => Promise<void> | void;
|
|
479
|
+
configOverrides?: Partial<EditorConfig>;
|
|
480
|
+
allowSaveAs?: boolean;
|
|
481
|
+
allowOpen?: boolean;
|
|
482
|
+
autoCloseOnSave?: boolean;
|
|
483
|
+
returnContentOnSave?: boolean;
|
|
484
|
+
mode?: string;
|
|
485
|
+
cwd?: string;
|
|
486
|
+
}
|
|
487
|
+
declare function startEditor(options?: EditorOptions): Promise<EditorExitResult>;
|
|
488
|
+
|
|
489
|
+
declare const mainSymbols: {
|
|
490
|
+
tick: string;
|
|
491
|
+
info: string;
|
|
492
|
+
warning: string;
|
|
493
|
+
cross: string;
|
|
494
|
+
squareSmall: string;
|
|
495
|
+
squareSmallFilled: string;
|
|
496
|
+
circle: string;
|
|
497
|
+
circleFilled: string;
|
|
498
|
+
circleDotted: string;
|
|
499
|
+
circleDouble: string;
|
|
500
|
+
circleCircle: string;
|
|
501
|
+
circleCross: string;
|
|
502
|
+
circlePipe: string;
|
|
503
|
+
radioOn: string;
|
|
504
|
+
radioOff: string;
|
|
505
|
+
checkboxOn: string;
|
|
506
|
+
checkboxOff: string;
|
|
507
|
+
checkboxCircleOn: string;
|
|
508
|
+
checkboxCircleOff: string;
|
|
509
|
+
pointer: string;
|
|
510
|
+
triangleUpOutline: string;
|
|
511
|
+
triangleLeft: string;
|
|
512
|
+
triangleRight: string;
|
|
513
|
+
lozenge: string;
|
|
514
|
+
lozengeOutline: string;
|
|
515
|
+
hamburger: string;
|
|
516
|
+
smiley: string;
|
|
517
|
+
mustache: string;
|
|
518
|
+
star: string;
|
|
519
|
+
play: string;
|
|
520
|
+
nodejs: string;
|
|
521
|
+
oneSeventh: string;
|
|
522
|
+
oneNinth: string;
|
|
523
|
+
oneTenth: string;
|
|
524
|
+
circleQuestionMark: string;
|
|
525
|
+
questionMarkPrefix: string;
|
|
526
|
+
square: string;
|
|
527
|
+
squareDarkShade: string;
|
|
528
|
+
squareMediumShade: string;
|
|
529
|
+
squareLightShade: string;
|
|
530
|
+
squareTop: string;
|
|
531
|
+
squareBottom: string;
|
|
532
|
+
squareLeft: string;
|
|
533
|
+
squareRight: string;
|
|
534
|
+
squareCenter: string;
|
|
535
|
+
bullet: string;
|
|
536
|
+
dot: string;
|
|
537
|
+
ellipsis: string;
|
|
538
|
+
pointerSmall: string;
|
|
539
|
+
triangleUp: string;
|
|
540
|
+
triangleUpSmall: string;
|
|
541
|
+
triangleDown: string;
|
|
542
|
+
triangleDownSmall: string;
|
|
543
|
+
triangleLeftSmall: string;
|
|
544
|
+
triangleRightSmall: string;
|
|
545
|
+
home: string;
|
|
546
|
+
heart: string;
|
|
547
|
+
musicNote: string;
|
|
548
|
+
musicNoteBeamed: string;
|
|
549
|
+
arrowUp: string;
|
|
550
|
+
arrowDown: string;
|
|
551
|
+
arrowLeft: string;
|
|
552
|
+
arrowRight: string;
|
|
553
|
+
arrowLeftRight: string;
|
|
554
|
+
arrowUpDown: string;
|
|
555
|
+
almostEqual: string;
|
|
556
|
+
notEqual: string;
|
|
557
|
+
lessOrEqual: string;
|
|
558
|
+
greaterOrEqual: string;
|
|
559
|
+
identical: string;
|
|
560
|
+
infinity: string;
|
|
561
|
+
subscriptZero: string;
|
|
562
|
+
subscriptOne: string;
|
|
563
|
+
subscriptTwo: string;
|
|
564
|
+
subscriptThree: string;
|
|
565
|
+
subscriptFour: string;
|
|
566
|
+
subscriptFive: string;
|
|
567
|
+
subscriptSix: string;
|
|
568
|
+
subscriptSeven: string;
|
|
569
|
+
subscriptEight: string;
|
|
570
|
+
subscriptNine: string;
|
|
571
|
+
oneHalf: string;
|
|
572
|
+
oneThird: string;
|
|
573
|
+
oneQuarter: string;
|
|
574
|
+
oneFifth: string;
|
|
575
|
+
oneSixth: string;
|
|
576
|
+
oneEighth: string;
|
|
577
|
+
twoThirds: string;
|
|
578
|
+
twoFifths: string;
|
|
579
|
+
threeQuarters: string;
|
|
580
|
+
threeFifths: string;
|
|
581
|
+
threeEighths: string;
|
|
582
|
+
fourFifths: string;
|
|
583
|
+
fiveSixths: string;
|
|
584
|
+
fiveEighths: string;
|
|
585
|
+
sevenEighths: string;
|
|
586
|
+
line: string;
|
|
587
|
+
lineBold: string;
|
|
588
|
+
lineDouble: string;
|
|
589
|
+
lineDashed0: string;
|
|
590
|
+
lineDashed1: string;
|
|
591
|
+
lineDashed2: string;
|
|
592
|
+
lineDashed3: string;
|
|
593
|
+
lineDashed4: string;
|
|
594
|
+
lineDashed5: string;
|
|
595
|
+
lineDashed6: string;
|
|
596
|
+
lineDashed7: string;
|
|
597
|
+
lineDashed8: string;
|
|
598
|
+
lineDashed9: string;
|
|
599
|
+
lineDashed10: string;
|
|
600
|
+
lineDashed11: string;
|
|
601
|
+
lineDashed12: string;
|
|
602
|
+
lineDashed13: string;
|
|
603
|
+
lineDashed14: string;
|
|
604
|
+
lineDashed15: string;
|
|
605
|
+
lineVertical: string;
|
|
606
|
+
lineVerticalBold: string;
|
|
607
|
+
lineVerticalDouble: string;
|
|
608
|
+
lineVerticalDashed0: string;
|
|
609
|
+
lineVerticalDashed1: string;
|
|
610
|
+
lineVerticalDashed2: string;
|
|
611
|
+
lineVerticalDashed3: string;
|
|
612
|
+
lineVerticalDashed4: string;
|
|
613
|
+
lineVerticalDashed5: string;
|
|
614
|
+
lineVerticalDashed6: string;
|
|
615
|
+
lineVerticalDashed7: string;
|
|
616
|
+
lineVerticalDashed8: string;
|
|
617
|
+
lineVerticalDashed9: string;
|
|
618
|
+
lineVerticalDashed10: string;
|
|
619
|
+
lineVerticalDashed11: string;
|
|
620
|
+
lineDownLeft: string;
|
|
621
|
+
lineDownLeftArc: string;
|
|
622
|
+
lineDownBoldLeftBold: string;
|
|
623
|
+
lineDownBoldLeft: string;
|
|
624
|
+
lineDownLeftBold: string;
|
|
625
|
+
lineDownDoubleLeftDouble: string;
|
|
626
|
+
lineDownDoubleLeft: string;
|
|
627
|
+
lineDownLeftDouble: string;
|
|
628
|
+
lineDownRight: string;
|
|
629
|
+
lineDownRightArc: string;
|
|
630
|
+
lineDownBoldRightBold: string;
|
|
631
|
+
lineDownBoldRight: string;
|
|
632
|
+
lineDownRightBold: string;
|
|
633
|
+
lineDownDoubleRightDouble: string;
|
|
634
|
+
lineDownDoubleRight: string;
|
|
635
|
+
lineDownRightDouble: string;
|
|
636
|
+
lineUpLeft: string;
|
|
637
|
+
lineUpLeftArc: string;
|
|
638
|
+
lineUpBoldLeftBold: string;
|
|
639
|
+
lineUpBoldLeft: string;
|
|
640
|
+
lineUpLeftBold: string;
|
|
641
|
+
lineUpDoubleLeftDouble: string;
|
|
642
|
+
lineUpDoubleLeft: string;
|
|
643
|
+
lineUpLeftDouble: string;
|
|
644
|
+
lineUpRight: string;
|
|
645
|
+
lineUpRightArc: string;
|
|
646
|
+
lineUpBoldRightBold: string;
|
|
647
|
+
lineUpBoldRight: string;
|
|
648
|
+
lineUpRightBold: string;
|
|
649
|
+
lineUpDoubleRightDouble: string;
|
|
650
|
+
lineUpDoubleRight: string;
|
|
651
|
+
lineUpRightDouble: string;
|
|
652
|
+
lineUpDownLeft: string;
|
|
653
|
+
lineUpBoldDownBoldLeftBold: string;
|
|
654
|
+
lineUpBoldDownBoldLeft: string;
|
|
655
|
+
lineUpDownLeftBold: string;
|
|
656
|
+
lineUpBoldDownLeftBold: string;
|
|
657
|
+
lineUpDownBoldLeftBold: string;
|
|
658
|
+
lineUpDownBoldLeft: string;
|
|
659
|
+
lineUpBoldDownLeft: string;
|
|
660
|
+
lineUpDoubleDownDoubleLeftDouble: string;
|
|
661
|
+
lineUpDoubleDownDoubleLeft: string;
|
|
662
|
+
lineUpDownLeftDouble: string;
|
|
663
|
+
lineUpDownRight: string;
|
|
664
|
+
lineUpBoldDownBoldRightBold: string;
|
|
665
|
+
lineUpBoldDownBoldRight: string;
|
|
666
|
+
lineUpDownRightBold: string;
|
|
667
|
+
lineUpBoldDownRightBold: string;
|
|
668
|
+
lineUpDownBoldRightBold: string;
|
|
669
|
+
lineUpDownBoldRight: string;
|
|
670
|
+
lineUpBoldDownRight: string;
|
|
671
|
+
lineUpDoubleDownDoubleRightDouble: string;
|
|
672
|
+
lineUpDoubleDownDoubleRight: string;
|
|
673
|
+
lineUpDownRightDouble: string;
|
|
674
|
+
lineDownLeftRight: string;
|
|
675
|
+
lineDownBoldLeftBoldRightBold: string;
|
|
676
|
+
lineDownLeftBoldRightBold: string;
|
|
677
|
+
lineDownBoldLeftRight: string;
|
|
678
|
+
lineDownBoldLeftBoldRight: string;
|
|
679
|
+
lineDownBoldLeftRightBold: string;
|
|
680
|
+
lineDownLeftRightBold: string;
|
|
681
|
+
lineDownLeftBoldRight: string;
|
|
682
|
+
lineDownDoubleLeftDoubleRightDouble: string;
|
|
683
|
+
lineDownDoubleLeftRight: string;
|
|
684
|
+
lineDownLeftDoubleRightDouble: string;
|
|
685
|
+
lineUpLeftRight: string;
|
|
686
|
+
lineUpBoldLeftBoldRightBold: string;
|
|
687
|
+
lineUpLeftBoldRightBold: string;
|
|
688
|
+
lineUpBoldLeftRight: string;
|
|
689
|
+
lineUpBoldLeftBoldRight: string;
|
|
690
|
+
lineUpBoldLeftRightBold: string;
|
|
691
|
+
lineUpLeftRightBold: string;
|
|
692
|
+
lineUpLeftBoldRight: string;
|
|
693
|
+
lineUpDoubleLeftDoubleRightDouble: string;
|
|
694
|
+
lineUpDoubleLeftRight: string;
|
|
695
|
+
lineUpLeftDoubleRightDouble: string;
|
|
696
|
+
lineUpDownLeftRight: string;
|
|
697
|
+
lineUpBoldDownBoldLeftBoldRightBold: string;
|
|
698
|
+
lineUpDownBoldLeftBoldRightBold: string;
|
|
699
|
+
lineUpBoldDownLeftBoldRightBold: string;
|
|
700
|
+
lineUpBoldDownBoldLeftRightBold: string;
|
|
701
|
+
lineUpBoldDownBoldLeftBoldRight: string;
|
|
702
|
+
lineUpBoldDownLeftRight: string;
|
|
703
|
+
lineUpDownBoldLeftRight: string;
|
|
704
|
+
lineUpDownLeftBoldRight: string;
|
|
705
|
+
lineUpDownLeftRightBold: string;
|
|
706
|
+
lineUpBoldDownBoldLeftRight: string;
|
|
707
|
+
lineUpDownLeftBoldRightBold: string;
|
|
708
|
+
lineUpBoldDownLeftBoldRight: string;
|
|
709
|
+
lineUpBoldDownLeftRightBold: string;
|
|
710
|
+
lineUpDownBoldLeftBoldRight: string;
|
|
711
|
+
lineUpDownBoldLeftRightBold: string;
|
|
712
|
+
lineUpDoubleDownDoubleLeftDoubleRightDouble: string;
|
|
713
|
+
lineUpDoubleDownDoubleLeftRight: string;
|
|
714
|
+
lineUpDownLeftDoubleRightDouble: string;
|
|
715
|
+
lineCross: string;
|
|
716
|
+
lineBackslash: string;
|
|
717
|
+
lineSlash: string;
|
|
718
|
+
};
|
|
719
|
+
declare const fallbackSymbols: Record<string, string>;
|
|
720
|
+
declare const figures: {
|
|
721
|
+
tick: string;
|
|
722
|
+
info: string;
|
|
723
|
+
warning: string;
|
|
724
|
+
cross: string;
|
|
725
|
+
squareSmall: string;
|
|
726
|
+
squareSmallFilled: string;
|
|
727
|
+
circle: string;
|
|
728
|
+
circleFilled: string;
|
|
729
|
+
circleDotted: string;
|
|
730
|
+
circleDouble: string;
|
|
731
|
+
circleCircle: string;
|
|
732
|
+
circleCross: string;
|
|
733
|
+
circlePipe: string;
|
|
734
|
+
radioOn: string;
|
|
735
|
+
radioOff: string;
|
|
736
|
+
checkboxOn: string;
|
|
737
|
+
checkboxOff: string;
|
|
738
|
+
checkboxCircleOn: string;
|
|
739
|
+
checkboxCircleOff: string;
|
|
740
|
+
pointer: string;
|
|
741
|
+
triangleUpOutline: string;
|
|
742
|
+
triangleLeft: string;
|
|
743
|
+
triangleRight: string;
|
|
744
|
+
lozenge: string;
|
|
745
|
+
lozengeOutline: string;
|
|
746
|
+
hamburger: string;
|
|
747
|
+
smiley: string;
|
|
748
|
+
mustache: string;
|
|
749
|
+
star: string;
|
|
750
|
+
play: string;
|
|
751
|
+
nodejs: string;
|
|
752
|
+
oneSeventh: string;
|
|
753
|
+
oneNinth: string;
|
|
754
|
+
oneTenth: string;
|
|
755
|
+
circleQuestionMark: string;
|
|
756
|
+
questionMarkPrefix: string;
|
|
757
|
+
square: string;
|
|
758
|
+
squareDarkShade: string;
|
|
759
|
+
squareMediumShade: string;
|
|
760
|
+
squareLightShade: string;
|
|
761
|
+
squareTop: string;
|
|
762
|
+
squareBottom: string;
|
|
763
|
+
squareLeft: string;
|
|
764
|
+
squareRight: string;
|
|
765
|
+
squareCenter: string;
|
|
766
|
+
bullet: string;
|
|
767
|
+
dot: string;
|
|
768
|
+
ellipsis: string;
|
|
769
|
+
pointerSmall: string;
|
|
770
|
+
triangleUp: string;
|
|
771
|
+
triangleUpSmall: string;
|
|
772
|
+
triangleDown: string;
|
|
773
|
+
triangleDownSmall: string;
|
|
774
|
+
triangleLeftSmall: string;
|
|
775
|
+
triangleRightSmall: string;
|
|
776
|
+
home: string;
|
|
777
|
+
heart: string;
|
|
778
|
+
musicNote: string;
|
|
779
|
+
musicNoteBeamed: string;
|
|
780
|
+
arrowUp: string;
|
|
781
|
+
arrowDown: string;
|
|
782
|
+
arrowLeft: string;
|
|
783
|
+
arrowRight: string;
|
|
784
|
+
arrowLeftRight: string;
|
|
785
|
+
arrowUpDown: string;
|
|
786
|
+
almostEqual: string;
|
|
787
|
+
notEqual: string;
|
|
788
|
+
lessOrEqual: string;
|
|
789
|
+
greaterOrEqual: string;
|
|
790
|
+
identical: string;
|
|
791
|
+
infinity: string;
|
|
792
|
+
subscriptZero: string;
|
|
793
|
+
subscriptOne: string;
|
|
794
|
+
subscriptTwo: string;
|
|
795
|
+
subscriptThree: string;
|
|
796
|
+
subscriptFour: string;
|
|
797
|
+
subscriptFive: string;
|
|
798
|
+
subscriptSix: string;
|
|
799
|
+
subscriptSeven: string;
|
|
800
|
+
subscriptEight: string;
|
|
801
|
+
subscriptNine: string;
|
|
802
|
+
oneHalf: string;
|
|
803
|
+
oneThird: string;
|
|
804
|
+
oneQuarter: string;
|
|
805
|
+
oneFifth: string;
|
|
806
|
+
oneSixth: string;
|
|
807
|
+
oneEighth: string;
|
|
808
|
+
twoThirds: string;
|
|
809
|
+
twoFifths: string;
|
|
810
|
+
threeQuarters: string;
|
|
811
|
+
threeFifths: string;
|
|
812
|
+
threeEighths: string;
|
|
813
|
+
fourFifths: string;
|
|
814
|
+
fiveSixths: string;
|
|
815
|
+
fiveEighths: string;
|
|
816
|
+
sevenEighths: string;
|
|
817
|
+
line: string;
|
|
818
|
+
lineBold: string;
|
|
819
|
+
lineDouble: string;
|
|
820
|
+
lineDashed0: string;
|
|
821
|
+
lineDashed1: string;
|
|
822
|
+
lineDashed2: string;
|
|
823
|
+
lineDashed3: string;
|
|
824
|
+
lineDashed4: string;
|
|
825
|
+
lineDashed5: string;
|
|
826
|
+
lineDashed6: string;
|
|
827
|
+
lineDashed7: string;
|
|
828
|
+
lineDashed8: string;
|
|
829
|
+
lineDashed9: string;
|
|
830
|
+
lineDashed10: string;
|
|
831
|
+
lineDashed11: string;
|
|
832
|
+
lineDashed12: string;
|
|
833
|
+
lineDashed13: string;
|
|
834
|
+
lineDashed14: string;
|
|
835
|
+
lineDashed15: string;
|
|
836
|
+
lineVertical: string;
|
|
837
|
+
lineVerticalBold: string;
|
|
838
|
+
lineVerticalDouble: string;
|
|
839
|
+
lineVerticalDashed0: string;
|
|
840
|
+
lineVerticalDashed1: string;
|
|
841
|
+
lineVerticalDashed2: string;
|
|
842
|
+
lineVerticalDashed3: string;
|
|
843
|
+
lineVerticalDashed4: string;
|
|
844
|
+
lineVerticalDashed5: string;
|
|
845
|
+
lineVerticalDashed6: string;
|
|
846
|
+
lineVerticalDashed7: string;
|
|
847
|
+
lineVerticalDashed8: string;
|
|
848
|
+
lineVerticalDashed9: string;
|
|
849
|
+
lineVerticalDashed10: string;
|
|
850
|
+
lineVerticalDashed11: string;
|
|
851
|
+
lineDownLeft: string;
|
|
852
|
+
lineDownLeftArc: string;
|
|
853
|
+
lineDownBoldLeftBold: string;
|
|
854
|
+
lineDownBoldLeft: string;
|
|
855
|
+
lineDownLeftBold: string;
|
|
856
|
+
lineDownDoubleLeftDouble: string;
|
|
857
|
+
lineDownDoubleLeft: string;
|
|
858
|
+
lineDownLeftDouble: string;
|
|
859
|
+
lineDownRight: string;
|
|
860
|
+
lineDownRightArc: string;
|
|
861
|
+
lineDownBoldRightBold: string;
|
|
862
|
+
lineDownBoldRight: string;
|
|
863
|
+
lineDownRightBold: string;
|
|
864
|
+
lineDownDoubleRightDouble: string;
|
|
865
|
+
lineDownDoubleRight: string;
|
|
866
|
+
lineDownRightDouble: string;
|
|
867
|
+
lineUpLeft: string;
|
|
868
|
+
lineUpLeftArc: string;
|
|
869
|
+
lineUpBoldLeftBold: string;
|
|
870
|
+
lineUpBoldLeft: string;
|
|
871
|
+
lineUpLeftBold: string;
|
|
872
|
+
lineUpDoubleLeftDouble: string;
|
|
873
|
+
lineUpDoubleLeft: string;
|
|
874
|
+
lineUpLeftDouble: string;
|
|
875
|
+
lineUpRight: string;
|
|
876
|
+
lineUpRightArc: string;
|
|
877
|
+
lineUpBoldRightBold: string;
|
|
878
|
+
lineUpBoldRight: string;
|
|
879
|
+
lineUpRightBold: string;
|
|
880
|
+
lineUpDoubleRightDouble: string;
|
|
881
|
+
lineUpDoubleRight: string;
|
|
882
|
+
lineUpRightDouble: string;
|
|
883
|
+
lineUpDownLeft: string;
|
|
884
|
+
lineUpBoldDownBoldLeftBold: string;
|
|
885
|
+
lineUpBoldDownBoldLeft: string;
|
|
886
|
+
lineUpDownLeftBold: string;
|
|
887
|
+
lineUpBoldDownLeftBold: string;
|
|
888
|
+
lineUpDownBoldLeftBold: string;
|
|
889
|
+
lineUpDownBoldLeft: string;
|
|
890
|
+
lineUpBoldDownLeft: string;
|
|
891
|
+
lineUpDoubleDownDoubleLeftDouble: string;
|
|
892
|
+
lineUpDoubleDownDoubleLeft: string;
|
|
893
|
+
lineUpDownLeftDouble: string;
|
|
894
|
+
lineUpDownRight: string;
|
|
895
|
+
lineUpBoldDownBoldRightBold: string;
|
|
896
|
+
lineUpBoldDownBoldRight: string;
|
|
897
|
+
lineUpDownRightBold: string;
|
|
898
|
+
lineUpBoldDownRightBold: string;
|
|
899
|
+
lineUpDownBoldRightBold: string;
|
|
900
|
+
lineUpDownBoldRight: string;
|
|
901
|
+
lineUpBoldDownRight: string;
|
|
902
|
+
lineUpDoubleDownDoubleRightDouble: string;
|
|
903
|
+
lineUpDoubleDownDoubleRight: string;
|
|
904
|
+
lineUpDownRightDouble: string;
|
|
905
|
+
lineDownLeftRight: string;
|
|
906
|
+
lineDownBoldLeftBoldRightBold: string;
|
|
907
|
+
lineDownLeftBoldRightBold: string;
|
|
908
|
+
lineDownBoldLeftRight: string;
|
|
909
|
+
lineDownBoldLeftBoldRight: string;
|
|
910
|
+
lineDownBoldLeftRightBold: string;
|
|
911
|
+
lineDownLeftRightBold: string;
|
|
912
|
+
lineDownLeftBoldRight: string;
|
|
913
|
+
lineDownDoubleLeftDoubleRightDouble: string;
|
|
914
|
+
lineDownDoubleLeftRight: string;
|
|
915
|
+
lineDownLeftDoubleRightDouble: string;
|
|
916
|
+
lineUpLeftRight: string;
|
|
917
|
+
lineUpBoldLeftBoldRightBold: string;
|
|
918
|
+
lineUpLeftBoldRightBold: string;
|
|
919
|
+
lineUpBoldLeftRight: string;
|
|
920
|
+
lineUpBoldLeftBoldRight: string;
|
|
921
|
+
lineUpBoldLeftRightBold: string;
|
|
922
|
+
lineUpLeftRightBold: string;
|
|
923
|
+
lineUpLeftBoldRight: string;
|
|
924
|
+
lineUpDoubleLeftDoubleRightDouble: string;
|
|
925
|
+
lineUpDoubleLeftRight: string;
|
|
926
|
+
lineUpLeftDoubleRightDouble: string;
|
|
927
|
+
lineUpDownLeftRight: string;
|
|
928
|
+
lineUpBoldDownBoldLeftBoldRightBold: string;
|
|
929
|
+
lineUpDownBoldLeftBoldRightBold: string;
|
|
930
|
+
lineUpBoldDownLeftBoldRightBold: string;
|
|
931
|
+
lineUpBoldDownBoldLeftRightBold: string;
|
|
932
|
+
lineUpBoldDownBoldLeftBoldRight: string;
|
|
933
|
+
lineUpBoldDownLeftRight: string;
|
|
934
|
+
lineUpDownBoldLeftRight: string;
|
|
935
|
+
lineUpDownLeftBoldRight: string;
|
|
936
|
+
lineUpDownLeftRightBold: string;
|
|
937
|
+
lineUpBoldDownBoldLeftRight: string;
|
|
938
|
+
lineUpDownLeftBoldRightBold: string;
|
|
939
|
+
lineUpBoldDownLeftBoldRight: string;
|
|
940
|
+
lineUpBoldDownLeftRightBold: string;
|
|
941
|
+
lineUpDownBoldLeftBoldRight: string;
|
|
942
|
+
lineUpDownBoldLeftRightBold: string;
|
|
943
|
+
lineUpDoubleDownDoubleLeftDoubleRightDouble: string;
|
|
944
|
+
lineUpDoubleDownDoubleLeftRight: string;
|
|
945
|
+
lineUpDownLeftDoubleRightDouble: string;
|
|
946
|
+
lineCross: string;
|
|
947
|
+
lineBackslash: string;
|
|
948
|
+
lineSlash: string;
|
|
949
|
+
} | Record<string, string>;
|
|
950
|
+
|
|
951
|
+
interface GroupOptions {
|
|
952
|
+
onCancel?: () => void;
|
|
953
|
+
showProgress?: boolean;
|
|
954
|
+
title?: string;
|
|
955
|
+
}
|
|
956
|
+
interface GroupContext<T> {
|
|
957
|
+
results: Partial<T>;
|
|
958
|
+
step: keyof T;
|
|
959
|
+
stepIndex: number;
|
|
960
|
+
totalSteps: number;
|
|
961
|
+
}
|
|
962
|
+
type GroupStep<T, K extends keyof T> = (context: GroupContext<T>) => Promise<T[K]> | T[K];
|
|
963
|
+
type GroupSteps<T> = {
|
|
964
|
+
[K in keyof T]: GroupStep<T, K>;
|
|
965
|
+
};
|
|
966
|
+
/**
|
|
967
|
+
* Runs a series of prompts in sequence, where each prompt can depend on the results of previous prompts.
|
|
968
|
+
*
|
|
969
|
+
* @param steps Object where each key is a step name and each value is a function that returns a promise
|
|
970
|
+
* @param options Optional configuration including onCancel callback and progress display
|
|
971
|
+
* @returns Promise resolving to the complete results object
|
|
972
|
+
*/
|
|
973
|
+
declare function group<T extends Record<string, any>>(steps: GroupSteps<T>, options?: GroupOptions): Promise<T>;
|
|
974
|
+
/**
|
|
975
|
+
* Utility function to create a step that depends on specific previous results
|
|
976
|
+
*/
|
|
977
|
+
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>;
|
|
978
|
+
/**
|
|
979
|
+
* Utility function to create a step that depends on multiple previous results
|
|
980
|
+
*/
|
|
981
|
+
declare function createMultiStep<T, K extends keyof T, D extends (keyof T)[]>(stepFunction: (context: GroupContext<T>, dependencies: {
|
|
982
|
+
[P in D[number]]: T[P];
|
|
983
|
+
}) => Promise<T[K]> | T[K], dependencyKeys: D): GroupStep<T, K>;
|
|
984
|
+
|
|
985
|
+
/**
|
|
986
|
+
* inputPrompt()
|
|
987
|
+
*
|
|
988
|
+
* Main entry point to prompt the user for input.
|
|
989
|
+
* - Renders a text prompt with optional hint, placeholder, and content.
|
|
990
|
+
* - Waits for user input (supporting "plain" or "password" modes).
|
|
991
|
+
* - Validates input with an optional TypeBox schema or custom validate() fn.
|
|
992
|
+
* - Shows errors if invalid, re-prompts if necessary.
|
|
993
|
+
* - Handles Ctrl+C gracefully, optionally printing an endTitle.
|
|
994
|
+
* - Returns the user's validated input, or a default value if empty.
|
|
995
|
+
*
|
|
996
|
+
* @param options InputPromptOptions to customize the prompt.
|
|
997
|
+
* @returns A Promise resolving to the validated user input (string).
|
|
998
|
+
*/
|
|
999
|
+
declare function inputPrompt(options: InputPromptOptions): Promise<string>;
|
|
1000
|
+
|
|
1001
|
+
declare const input: typeof inputPrompt;
|
|
1002
|
+
declare const text: typeof inputPrompt;
|
|
1003
|
+
declare const password: (options: Omit<InputPromptOptions, "mode">) => Promise<string>;
|
|
1004
|
+
|
|
1005
|
+
type StartPromptOptions = PromptOptions & {
|
|
1006
|
+
clearConsole?: boolean;
|
|
1007
|
+
horizontalLine?: boolean;
|
|
1008
|
+
horizontalLineLength?: number;
|
|
1009
|
+
packageName?: string;
|
|
1010
|
+
packageVersion?: string;
|
|
1011
|
+
terminalSizeOptions?: PreventWrongTerminalSizeOptions;
|
|
1012
|
+
isDev?: boolean;
|
|
1013
|
+
prevent?: {
|
|
1014
|
+
unsupportedTTY?: boolean;
|
|
1015
|
+
wrongTerminalSize?: boolean;
|
|
1016
|
+
windowsHomeDirRoot?: boolean;
|
|
1017
|
+
};
|
|
1018
|
+
variant?: "header" | "ascii-art";
|
|
1019
|
+
asciiArtFont?: Fonts;
|
|
1020
|
+
};
|
|
1021
|
+
declare function introPrompt(optionsOrTitle: StartPromptOptions | string): Promise<void>;
|
|
1022
|
+
|
|
1023
|
+
declare const startPrompt: typeof introPrompt;
|
|
1024
|
+
declare const intro: typeof introPrompt;
|
|
1025
|
+
|
|
1026
|
+
/** The Standard Schema interface. */
|
|
1027
|
+
interface StandardSchemaV1<Input = unknown, Output = Input> {
|
|
1028
|
+
/** The Standard Schema properties. */
|
|
1029
|
+
readonly "~standard": StandardSchemaV1Props<Input, Output>;
|
|
1030
|
+
}
|
|
1031
|
+
/** The Standard Schema properties interface. */
|
|
1032
|
+
interface StandardSchemaV1Props<Input = unknown, Output = Input> {
|
|
1033
|
+
/** The version number of the standard. */
|
|
1034
|
+
readonly version: 1;
|
|
1035
|
+
/** The vendor name of the schema library. */
|
|
1036
|
+
readonly vendor: string;
|
|
1037
|
+
/** Validates unknown input values. */
|
|
1038
|
+
readonly validate: (value: unknown) => StandardSchemaV1Result<Output> | Promise<StandardSchemaV1Result<Output>>;
|
|
1039
|
+
/** Inferred types associated with the schema. */
|
|
1040
|
+
readonly types?: StandardSchemaV1Types<Input, Output> | undefined;
|
|
1041
|
+
}
|
|
1042
|
+
/** The result interface of the validate function. */
|
|
1043
|
+
type StandardSchemaV1Result<Output> = StandardSchemaV1SuccessResult<Output> | StandardSchemaV1FailureResult;
|
|
1044
|
+
/** The result interface if validation succeeds. */
|
|
1045
|
+
interface StandardSchemaV1SuccessResult<Output> {
|
|
1046
|
+
/** The typed output value. */
|
|
1047
|
+
readonly value: Output;
|
|
1048
|
+
/** The non-existent issues. */
|
|
1049
|
+
readonly issues?: undefined;
|
|
1050
|
+
}
|
|
1051
|
+
/** The result interface if validation fails. */
|
|
1052
|
+
interface StandardSchemaV1FailureResult {
|
|
1053
|
+
/** The issues of failed validation. */
|
|
1054
|
+
readonly issues: readonly StandardSchemaV1Issue[];
|
|
1055
|
+
}
|
|
1056
|
+
/** The issue interface of the failure output. */
|
|
1057
|
+
interface StandardSchemaV1Issue {
|
|
1058
|
+
/** The error message of the issue. */
|
|
1059
|
+
readonly message: string;
|
|
1060
|
+
/** The path of the issue, if any. */
|
|
1061
|
+
readonly path?: readonly (PropertyKey | StandardSchemaV1PathSegment)[] | undefined;
|
|
1062
|
+
}
|
|
1063
|
+
/** The path segment interface of the issue. */
|
|
1064
|
+
interface StandardSchemaV1PathSegment {
|
|
1065
|
+
/** The key representing a path segment. */
|
|
1066
|
+
readonly key: PropertyKey;
|
|
1067
|
+
}
|
|
1068
|
+
/** The Standard Schema types interface. */
|
|
1069
|
+
interface StandardSchemaV1Types<Input = unknown, Output = Input> {
|
|
1070
|
+
/** The input type of the schema. */
|
|
1071
|
+
readonly input: Input;
|
|
1072
|
+
/** The output type of the schema. */
|
|
1073
|
+
readonly output: Output;
|
|
1074
|
+
}
|
|
1075
|
+
/** Infers the input type of a Standard Schema. */
|
|
1076
|
+
type StandardSchemaV1InferInput<Schema extends StandardSchemaV1> = NonNullable<Schema["~standard"]["types"]>["input"];
|
|
1077
|
+
/** Infers the output type of a Standard Schema. */
|
|
1078
|
+
type StandardSchemaV1InferOutput<Schema extends StandardSchemaV1> = NonNullable<Schema["~standard"]["types"]>["output"];
|
|
1079
|
+
|
|
1080
|
+
/**
|
|
1081
|
+
* Type which looks *enough* like a trpc v11(+?) router to infer its types correctly
|
|
1082
|
+
* This is written from scratch to avoid any kind of dependency on @trpc/server v11+
|
|
1083
|
+
*/
|
|
1084
|
+
interface Trpc11RouterLike {
|
|
1085
|
+
_def: {
|
|
1086
|
+
_config: {
|
|
1087
|
+
$types: {
|
|
1088
|
+
meta: any;
|
|
1089
|
+
ctx: any;
|
|
1090
|
+
};
|
|
1091
|
+
};
|
|
1092
|
+
procedures: Record<string, Trpc11ProcedureLike | Trpc11ProcedureRecordLike | Record<string, Trpc11ProcedureLike>>;
|
|
1093
|
+
};
|
|
1094
|
+
}
|
|
1095
|
+
/** Even though you use `t.router({})` to create a sub-router, the actual type is a record of procedures and sub-routers rather than a root-level router */
|
|
1096
|
+
interface Trpc11ProcedureRecordLike {
|
|
1097
|
+
[key: string]: Trpc11ProcedureLike | Trpc11ProcedureRecordLike;
|
|
1098
|
+
}
|
|
1099
|
+
interface Trpc11ProcedureLike {
|
|
1100
|
+
_def: {
|
|
1101
|
+
type: "mutation" | "query" | "subscription";
|
|
1102
|
+
_type?: undefined;
|
|
1103
|
+
meta?: any;
|
|
1104
|
+
inputs?: unknown[];
|
|
1105
|
+
$types: {
|
|
1106
|
+
input: any;
|
|
1107
|
+
output: any;
|
|
1108
|
+
};
|
|
1109
|
+
};
|
|
1110
|
+
}
|
|
1111
|
+
interface Trpc10RouterLike {
|
|
1112
|
+
_def: {
|
|
1113
|
+
_config: {
|
|
1114
|
+
$types: {
|
|
1115
|
+
meta: any;
|
|
1116
|
+
ctx: any;
|
|
1117
|
+
};
|
|
1118
|
+
};
|
|
1119
|
+
procedures: Record<string, Trpc10ProcedureLike | Trpc10RouterLike>;
|
|
1120
|
+
};
|
|
1121
|
+
}
|
|
1122
|
+
interface Trpc10ProcedureLike {
|
|
1123
|
+
_def: {
|
|
1124
|
+
type?: undefined;
|
|
1125
|
+
mutation?: boolean;
|
|
1126
|
+
query?: boolean;
|
|
1127
|
+
subscription?: boolean;
|
|
1128
|
+
meta?: any;
|
|
1129
|
+
inputs: unknown[];
|
|
1130
|
+
_input_in: any;
|
|
1131
|
+
_output_out: any;
|
|
1132
|
+
};
|
|
1133
|
+
}
|
|
1134
|
+
interface OrpcProcedureLike<Ctx> {
|
|
1135
|
+
"~orpc": {
|
|
1136
|
+
__initialContext?: (context: Ctx) => unknown;
|
|
1137
|
+
inputSchema?: StandardSchemaV1;
|
|
1138
|
+
};
|
|
1139
|
+
}
|
|
1140
|
+
interface OrpcRouterLike<Ctx> {
|
|
1141
|
+
[key: string]: OrpcProcedureLike<Ctx> | OrpcRouterLike<Ctx>;
|
|
1142
|
+
}
|
|
1143
|
+
type CreateCallerFactoryLike<Procedures = Record<string, (input: unknown) => unknown>> = (router: any) => (context: any) => Procedures;
|
|
1144
|
+
type AnyRouter = Trpc10RouterLike | Trpc11RouterLike | OrpcRouterLike<any>;
|
|
1145
|
+
type AnyProcedure = Trpc10ProcedureLike | Trpc11ProcedureLike;
|
|
1146
|
+
type inferRouterContext<R extends AnyRouter> = R extends Trpc10RouterLike | Trpc11RouterLike ? R["_def"]["_config"]["$types"]["ctx"] : R extends OrpcRouterLike<infer Ctx> ? Ctx : never;
|
|
1147
|
+
declare const isTrpc11Procedure: (procedure: AnyProcedure) => procedure is Trpc11ProcedureLike;
|
|
1148
|
+
declare const isTrpc11Router: (router: AnyRouter) => router is Trpc11RouterLike;
|
|
1149
|
+
declare const isOrpcRouter: (router: AnyRouter) => router is OrpcRouterLike<any>;
|
|
1150
|
+
|
|
1151
|
+
type EmptyArgs = Record<string, never>;
|
|
1152
|
+
interface BaseArgProps {
|
|
1153
|
+
description?: string;
|
|
1154
|
+
required?: boolean;
|
|
1155
|
+
allowed?: string[];
|
|
1156
|
+
}
|
|
1157
|
+
interface BaseArgDefinition {
|
|
1158
|
+
type: string;
|
|
1159
|
+
description?: string;
|
|
1160
|
+
required?: boolean;
|
|
1161
|
+
default?: any;
|
|
1162
|
+
allowed?: any[];
|
|
1163
|
+
dependencies?: string[];
|
|
1164
|
+
}
|
|
1165
|
+
type PositionalArgDefinition = BaseArgDefinition & {
|
|
1166
|
+
type: "positional";
|
|
1167
|
+
default?: string;
|
|
1168
|
+
};
|
|
1169
|
+
type BooleanArgDefinition = BaseArgDefinition & {
|
|
1170
|
+
type: "boolean";
|
|
1171
|
+
default?: boolean;
|
|
1172
|
+
allowed?: boolean[];
|
|
1173
|
+
alias?: string;
|
|
1174
|
+
};
|
|
1175
|
+
type StringArgDefinition = BaseArgDefinition & {
|
|
1176
|
+
type: "string";
|
|
1177
|
+
default?: string;
|
|
1178
|
+
alias?: string;
|
|
1179
|
+
};
|
|
1180
|
+
type NumberArgDefinition = BaseArgDefinition & {
|
|
1181
|
+
type: "number";
|
|
1182
|
+
default?: number;
|
|
1183
|
+
allowed?: number[];
|
|
1184
|
+
alias?: string;
|
|
1185
|
+
};
|
|
1186
|
+
type ArrayArgDefinition = BaseArgDefinition & {
|
|
1187
|
+
type: "array";
|
|
1188
|
+
default?: string | readonly string[];
|
|
1189
|
+
alias?: string;
|
|
1190
|
+
};
|
|
1191
|
+
type ArgDefinition = PositionalArgDefinition | BooleanArgDefinition | StringArgDefinition | NumberArgDefinition | ArrayArgDefinition;
|
|
1192
|
+
type ArgDefinitions = Record<string, ArgDefinition>;
|
|
1193
|
+
interface CommandMeta {
|
|
1194
|
+
name: string;
|
|
1195
|
+
version?: string;
|
|
1196
|
+
description?: string;
|
|
1197
|
+
hidden?: boolean;
|
|
1198
|
+
aliases?: string[];
|
|
1199
|
+
}
|
|
1200
|
+
/**
|
|
1201
|
+
* A subcommand can be either:
|
|
1202
|
+
* 1) A string path to a module with a default export of type Command.
|
|
1203
|
+
* 2) A lazy import function returning a Promise that resolves to
|
|
1204
|
+
* { default: Command<any> } or directly to a Command instance.
|
|
1205
|
+
*/
|
|
1206
|
+
type CommandSpec = string | (() => Promise<{
|
|
1207
|
+
default: Command<any>;
|
|
1208
|
+
} | Command<any>>);
|
|
1209
|
+
type CommandsMap = Record<string, CommandSpec>;
|
|
1210
|
+
interface CommandContext<ARGS> {
|
|
1211
|
+
args: ARGS;
|
|
1212
|
+
raw: string[];
|
|
1213
|
+
}
|
|
1214
|
+
type CommandRun<ARGS> = (ctx: CommandContext<ARGS>) => void | Promise<void>;
|
|
1215
|
+
type CommandHook<ARGS> = (ctx: CommandContext<ARGS>) => void | Promise<void>;
|
|
1216
|
+
interface DefineCommandOptions<A extends ArgDefinitions = EmptyArgs> {
|
|
1217
|
+
meta?: CommandMeta;
|
|
1218
|
+
args?: A;
|
|
1219
|
+
run?: CommandRun<InferArgTypes<A>>;
|
|
1220
|
+
/**
|
|
1221
|
+
* Object subcommands for this command.
|
|
1222
|
+
*/
|
|
1223
|
+
commands?: CommandsMap;
|
|
1224
|
+
/**
|
|
1225
|
+
* @deprecated Use `commands` instead. Will be removed in a future major version.
|
|
1226
|
+
*/
|
|
1227
|
+
subCommands?: CommandsMap;
|
|
1228
|
+
/**
|
|
1229
|
+
* Called before the command runs. Receives `{ args, raw }` (parsed args and raw argv).
|
|
1230
|
+
*/
|
|
1231
|
+
onCmdInit?: CommandHook<InferArgTypes<A>>;
|
|
1232
|
+
/**
|
|
1233
|
+
* Called after the command finishes. Receives `{ args, raw }` (parsed args and raw argv).
|
|
1234
|
+
*/
|
|
1235
|
+
onCmdExit?: CommandHook<InferArgTypes<A>>;
|
|
1236
|
+
/**
|
|
1237
|
+
* @deprecated Use onCmdInit instead
|
|
1238
|
+
*/
|
|
1239
|
+
setup?: CommandHook<InferArgTypes<A>>;
|
|
1240
|
+
/**
|
|
1241
|
+
* @deprecated Use onCmdExit instead
|
|
1242
|
+
*/
|
|
1243
|
+
cleanup?: CommandHook<InferArgTypes<A>>;
|
|
1244
|
+
/**
|
|
1245
|
+
* Called once per CLI process, before any command/run() is executed
|
|
1246
|
+
*/
|
|
1247
|
+
onLauncherInit?: () => void | Promise<void>;
|
|
1248
|
+
/**
|
|
1249
|
+
* Called once per CLI process, after all command/run() logic is finished
|
|
1250
|
+
*/
|
|
1251
|
+
onLauncherExit?: () => void | Promise<void>;
|
|
1252
|
+
/**
|
|
1253
|
+
* tRPC/oRPC router for RPC mode. When provided, the command will automatically
|
|
1254
|
+
* switch to RPC mode and use the router's procedures as CLI commands.
|
|
1255
|
+
*/
|
|
1256
|
+
router?: AnyRouter;
|
|
1257
|
+
}
|
|
1258
|
+
interface Command<A extends ArgDefinitions = EmptyArgs> {
|
|
1259
|
+
meta?: CommandMeta;
|
|
1260
|
+
args: A;
|
|
1261
|
+
run?: CommandRun<InferArgTypes<A>>;
|
|
1262
|
+
/**
|
|
1263
|
+
* Object subcommands for this command.
|
|
1264
|
+
*/
|
|
1265
|
+
commands?: CommandsMap;
|
|
1266
|
+
/**
|
|
1267
|
+
* @deprecated Use `commands` instead. Will be removed in a future major version.
|
|
1268
|
+
*/
|
|
1269
|
+
subCommands?: CommandsMap;
|
|
1270
|
+
/**
|
|
1271
|
+
* Called before the command runs. Receives `{ args, raw }` (parsed args and raw argv).
|
|
1272
|
+
*/
|
|
1273
|
+
onCmdInit?: CommandHook<InferArgTypes<A>>;
|
|
1274
|
+
/**
|
|
1275
|
+
* Called after the command finishes. Receives `{ args, raw }` (parsed args and raw argv).
|
|
1276
|
+
*/
|
|
1277
|
+
onCmdExit?: CommandHook<InferArgTypes<A>>;
|
|
1278
|
+
/**
|
|
1279
|
+
* @deprecated Use onCmdInit instead
|
|
1280
|
+
*/
|
|
1281
|
+
setup?: CommandHook<InferArgTypes<A>>;
|
|
1282
|
+
/**
|
|
1283
|
+
* @deprecated Use onCmdExit instead
|
|
1284
|
+
*/
|
|
1285
|
+
cleanup?: CommandHook<InferArgTypes<A>>;
|
|
1286
|
+
/**
|
|
1287
|
+
* Called once per CLI process, before any command/run() is executed
|
|
1288
|
+
*/
|
|
1289
|
+
onLauncherInit?: () => void | Promise<void>;
|
|
1290
|
+
/**
|
|
1291
|
+
* Called once per CLI process, after all command/run() logic is finished
|
|
1292
|
+
*/
|
|
1293
|
+
onLauncherExit?: () => void | Promise<void>;
|
|
1294
|
+
/**
|
|
1295
|
+
* tRPC/oRPC router for RPC mode. When provided, the command will automatically
|
|
1296
|
+
* switch to RPC mode and use the router's procedures as CLI commands.
|
|
1297
|
+
*/
|
|
1298
|
+
router?: AnyRouter;
|
|
1299
|
+
}
|
|
1300
|
+
type InferArgTypes<A extends ArgDefinitions> = {
|
|
1301
|
+
[K in keyof A]: A[K] extends PositionalArgDefinition ? string : A[K] extends BooleanArgDefinition ? boolean : A[K] extends StringArgDefinition ? string : A[K] extends NumberArgDefinition ? number : A[K] extends {
|
|
1302
|
+
type: "array";
|
|
1303
|
+
} ? string[] : never;
|
|
1304
|
+
};
|
|
1305
|
+
interface FileBasedOptions {
|
|
1306
|
+
enable: boolean;
|
|
1307
|
+
cmdsRootPath: string;
|
|
1308
|
+
}
|
|
1309
|
+
|
|
1310
|
+
/**
|
|
1311
|
+
* Load a command from the filesystem.
|
|
1312
|
+
*
|
|
1313
|
+
* @param cmdPath - Path to the command file or directory containing cmd.ts/cmd.js
|
|
1314
|
+
* @returns Promise<Command> - The loaded command
|
|
1315
|
+
*
|
|
1316
|
+
* @example
|
|
1317
|
+
* ```ts
|
|
1318
|
+
* // Load a command
|
|
1319
|
+
* const cmd = await loadCommand("./web/cmd");
|
|
1320
|
+
*
|
|
1321
|
+
* // Use with runCmd - pass args as separate array elements
|
|
1322
|
+
* await runCmd(cmd, ["--dev", "true"]); // ✅ Correct
|
|
1323
|
+
* await runCmd(cmd, [`--dev ${isDev}`]); // ❌ Wrong - creates single string
|
|
1324
|
+
* ```
|
|
1325
|
+
*/
|
|
1326
|
+
declare function loadCommand(cmdPath: string): Promise<Command>;
|
|
1327
|
+
|
|
1328
|
+
/**
|
|
1329
|
+
* Static implementation functions for the typed command system.
|
|
1330
|
+
* These functions are imported by the generated cmds.ts file.
|
|
1331
|
+
*/
|
|
1332
|
+
declare function argsToStringArray(args: Record<string, unknown>): string[];
|
|
1333
|
+
declare function createCallCmd<TCommandArgsMap>(): Promise<(<T extends keyof TCommandArgsMap>(cmdName: T, args?: TCommandArgsMap[T]) => Promise<void>)>;
|
|
1334
|
+
declare function createGetTypedCmd<TCommandArgsMap>(): Promise<(<T extends keyof TCommandArgsMap>(cmdName: T) => Promise<{
|
|
1335
|
+
command: Command;
|
|
1336
|
+
run: (args?: TCommandArgsMap[T]) => Promise<void>;
|
|
1337
|
+
}>)>;
|
|
1338
|
+
declare function callCmdImpl<TCommandArgsMap>(cmdName: keyof TCommandArgsMap, args?: TCommandArgsMap[keyof TCommandArgsMap]): Promise<void>;
|
|
1339
|
+
declare function getTypedCmdImpl<TCommandArgsMap>(cmdName: keyof TCommandArgsMap): Promise<{
|
|
1340
|
+
command: Command;
|
|
1341
|
+
run: (args?: TCommandArgsMap[keyof TCommandArgsMap]) => Promise<void>;
|
|
1342
|
+
}>;
|
|
1343
|
+
|
|
1344
|
+
/**
|
|
1345
|
+
* JSON representation of a commander `Command` instance
|
|
1346
|
+
* Note: this is not necessarily a _complete_ representation of the command - it aims to be a big enough subset to be useful for generating documentation etc.
|
|
1347
|
+
*/
|
|
1348
|
+
interface CommandJSON {
|
|
1349
|
+
name?: string;
|
|
1350
|
+
version?: string;
|
|
1351
|
+
description?: string;
|
|
1352
|
+
usage?: string;
|
|
1353
|
+
commands?: CommandJSON[];
|
|
1354
|
+
arguments?: {
|
|
1355
|
+
name: string;
|
|
1356
|
+
description?: string;
|
|
1357
|
+
required: boolean;
|
|
1358
|
+
defaultValue?: {};
|
|
1359
|
+
defaultValueDescription?: string;
|
|
1360
|
+
variadic: boolean;
|
|
1361
|
+
choices?: string[];
|
|
1362
|
+
}[];
|
|
1363
|
+
options?: {
|
|
1364
|
+
name: string;
|
|
1365
|
+
description?: string;
|
|
1366
|
+
required: boolean;
|
|
1367
|
+
defaultValue?: {};
|
|
1368
|
+
defaultValueDescription?: string;
|
|
1369
|
+
variadic: boolean;
|
|
1370
|
+
attributeName?: string;
|
|
1371
|
+
flags?: string;
|
|
1372
|
+
short?: string;
|
|
1373
|
+
negate: boolean;
|
|
1374
|
+
optional: boolean;
|
|
1375
|
+
choices?: string[];
|
|
1376
|
+
}[];
|
|
1377
|
+
}
|
|
1378
|
+
/**
|
|
1379
|
+
* Convert a commander `Command` instance to a JSON object.
|
|
1380
|
+
*
|
|
1381
|
+
* Note: in theory you could use this with any `Command` instance, it doesn't have
|
|
1382
|
+
* to be one built by `@reliverse/rempts`. Implementing here because it's pretty simple to do and `commander` doesn't seem to provide a way to do it.
|
|
1383
|
+
*
|
|
1384
|
+
* Note: falsy values for strings are replaced with `undefined` in the output - e.g. if there's an empty description, it will be `undefined` in the output.
|
|
1385
|
+
*/
|
|
1386
|
+
declare const commandToJSON: (command: Command$1) => CommandJSON;
|
|
1387
|
+
|
|
1388
|
+
interface TrpcCliParams<R extends AnyRouter> extends Dependencies {
|
|
1389
|
+
/** A tRPC router. Procedures will become CLI commands. */
|
|
1390
|
+
router: R;
|
|
1391
|
+
name?: string;
|
|
1392
|
+
version?: string;
|
|
1393
|
+
description?: string;
|
|
1394
|
+
usage?: string | string[];
|
|
1395
|
+
/** Context to be supplied when invoking the router. */
|
|
1396
|
+
context?: inferRouterContext<R>;
|
|
1397
|
+
/** @deprecated this is actually **removed** not deprecated; use `aliases` on each procedure `meta` instead */
|
|
1398
|
+
alias?: never;
|
|
1399
|
+
/** @deprecated this is actually **removed** not deprecated; set `default: true` on the procedure `meta` instead */
|
|
1400
|
+
_default?: never;
|
|
1401
|
+
/** The `@trpc/server` module to use for calling procedures. Required when using trpc v10. */
|
|
1402
|
+
trpcServer?: TrpcServerModuleLike | Promise<TrpcServerModuleLike>;
|
|
1403
|
+
}
|
|
1404
|
+
/** Rough shape of the `@trpc/server` (v10) module. Needed to pass in to `createRpcCli` when using trpc v10. */
|
|
1405
|
+
interface TrpcServerModuleLike {
|
|
1406
|
+
initTRPC: {
|
|
1407
|
+
create: () => {
|
|
1408
|
+
createCallerFactory: CreateCallerFactoryLike<{}>;
|
|
1409
|
+
};
|
|
1410
|
+
};
|
|
1411
|
+
}
|
|
1412
|
+
/**
|
|
1413
|
+
* Optional interface for describing procedures via meta - if your router conforms to this meta shape, it will contribute to the CLI help text.
|
|
1414
|
+
*/
|
|
1415
|
+
interface TrpcCliMeta {
|
|
1416
|
+
/** Version of the script displayed in `--help` output. Use to avoid enabling `--version` option. */
|
|
1417
|
+
version?: string;
|
|
1418
|
+
/** Description of the script or command to display in `--help` output. */
|
|
1419
|
+
description?: string;
|
|
1420
|
+
/** Usage code examples to display in `--help` output. */
|
|
1421
|
+
usage?: false | string | string[];
|
|
1422
|
+
/** Example code snippets to display in `--help` output. */
|
|
1423
|
+
examples?: string | string[];
|
|
1424
|
+
/** If true, this command will be run if no command is specified. */
|
|
1425
|
+
default?: boolean;
|
|
1426
|
+
aliases?: {
|
|
1427
|
+
/** Aliases for the command. Note: take care to avoid conflicts with other commands. */
|
|
1428
|
+
command?: string[];
|
|
1429
|
+
/** Aliases for the options. Note: take care to avoid conflicts with other options. An error will be thrown if an alias is defined for a non-existent option. */
|
|
1430
|
+
options?: Record<string, string>;
|
|
1431
|
+
};
|
|
1432
|
+
/** If true, will use a single CLI option expect the entire input to be parsed in as JSON, e.g. `--input '{"foo": "bar"}`. Can be useful to opt out of the default mapping of input schemas to CLI options. */
|
|
1433
|
+
jsonInput?: boolean;
|
|
1434
|
+
/** Sub-property for the CLI meta. If present, will take precedence over the top-level meta, to avoid conflicts with other tools. */
|
|
1435
|
+
cliMeta?: TrpcCliMeta;
|
|
1436
|
+
}
|
|
1437
|
+
interface ParsedProcedure {
|
|
1438
|
+
positionalParameters: {
|
|
1439
|
+
name: string;
|
|
1440
|
+
description: string;
|
|
1441
|
+
type: "string" | "number" | "boolean" | (string & {});
|
|
1442
|
+
required: boolean;
|
|
1443
|
+
array: boolean;
|
|
1444
|
+
}[];
|
|
1445
|
+
/** JSON Schema type describing the flags for the procedure */
|
|
1446
|
+
optionsJsonSchema: JsonSchema7Type;
|
|
1447
|
+
/**
|
|
1448
|
+
* Function for taking parsed argv output and transforming it so it can be passed into the procedure.
|
|
1449
|
+
* Needed because this function is where inspect the input schema(s) and determine how to map the argv to the input
|
|
1450
|
+
*/
|
|
1451
|
+
getPojoInput: (argv: {
|
|
1452
|
+
positionalValues: (string | string[])[];
|
|
1453
|
+
options: Record<string, unknown>;
|
|
1454
|
+
}) => unknown;
|
|
1455
|
+
}
|
|
1456
|
+
type Result<T> = {
|
|
1457
|
+
success: true;
|
|
1458
|
+
value: T;
|
|
1459
|
+
} | {
|
|
1460
|
+
success: false;
|
|
1461
|
+
error: string;
|
|
1462
|
+
};
|
|
1463
|
+
/** A function that logs any inputs. e.g. `console.info` */
|
|
1464
|
+
type Log = (...args: unknown[]) => void;
|
|
1465
|
+
/**
|
|
1466
|
+
* A struct which has `info` and `error` functions for logging. Easiest example: `console`
|
|
1467
|
+
* But most loggers like pino, winston etc. have a similar interface.
|
|
1468
|
+
*/
|
|
1469
|
+
interface Logger {
|
|
1470
|
+
info?: Log;
|
|
1471
|
+
error?: Log;
|
|
1472
|
+
}
|
|
1473
|
+
/**
|
|
1474
|
+
* Slim reconstruction of an `omelette` instance. Hand-written here to avoid a hard dependency on `omelette` or its types.
|
|
1475
|
+
* Usually you will just pass in an `omelette` instance by doing something like
|
|
1476
|
+
*
|
|
1477
|
+
* ```ts
|
|
1478
|
+
* import omelette from 'omelette'
|
|
1479
|
+
* import {createRpcCli} from '@reliverse/rempts'
|
|
1480
|
+
*
|
|
1481
|
+
* const cli = createRpcCli({
|
|
1482
|
+
* router: myRouter,
|
|
1483
|
+
* completion: omelette('myprogram'),
|
|
1484
|
+
* })
|
|
1485
|
+
* ```
|
|
1486
|
+
*
|
|
1487
|
+
* Or it also accepts an async function that resolves to an `omelette` instance, so you can use dynamic import:
|
|
1488
|
+
*
|
|
1489
|
+
* ```ts
|
|
1490
|
+
* import {createRpcCli} from '@reliverse/rempts'
|
|
1491
|
+
*
|
|
1492
|
+
* const cli = await createRpcCli({
|
|
1493
|
+
* router: myRouter,
|
|
1494
|
+
* completion: () => import('omelette').then(omelette => omelette.default('myprogram')),
|
|
1495
|
+
* })
|
|
1496
|
+
* ```
|
|
1497
|
+
*/
|
|
1498
|
+
interface OmeletteInstanceLike {
|
|
1499
|
+
on: (event: "complete", callback: (fragment: string, params: {
|
|
1500
|
+
line: string;
|
|
1501
|
+
fragment: number;
|
|
1502
|
+
reply: (suggestions: string[]) => void;
|
|
1503
|
+
}) => void) => void;
|
|
1504
|
+
init: () => void;
|
|
1505
|
+
setupShellInitFile: () => void;
|
|
1506
|
+
cleanupShellInitFile: () => void;
|
|
1507
|
+
tree: (value: any) => this;
|
|
1508
|
+
}
|
|
1509
|
+
interface InquirerPromptOptions {
|
|
1510
|
+
message: string;
|
|
1511
|
+
required?: boolean;
|
|
1512
|
+
validate?: (input: string) => boolean | string;
|
|
1513
|
+
default?: any;
|
|
1514
|
+
}
|
|
1515
|
+
/** looks like the `@inquirer/prompts` package */
|
|
1516
|
+
interface InquirerPromptsLike {
|
|
1517
|
+
input: (params: InquirerPromptOptions) => Promise<string>;
|
|
1518
|
+
confirm: (params: InquirerPromptOptions) => Promise<boolean>;
|
|
1519
|
+
}
|
|
1520
|
+
/** looks like the `prompts` package */
|
|
1521
|
+
interface PromptsLike {
|
|
1522
|
+
prompt: Function;
|
|
1523
|
+
inject: Function;
|
|
1524
|
+
}
|
|
1525
|
+
/** looks like the `enquirer` package */
|
|
1526
|
+
interface EnquirerLike {
|
|
1527
|
+
prompt: <T>(params: {
|
|
1528
|
+
type: "input";
|
|
1529
|
+
name: string;
|
|
1530
|
+
message: string;
|
|
1531
|
+
validate?: (input: string) => boolean | string;
|
|
1532
|
+
initial?: unknown;
|
|
1533
|
+
}) => Promise<T>;
|
|
1534
|
+
}
|
|
1535
|
+
interface ClackPromptsLike {
|
|
1536
|
+
intro: (title: string) => void;
|
|
1537
|
+
outro: (title: string) => void;
|
|
1538
|
+
}
|
|
1539
|
+
type Promptable = InquirerPromptsLike | EnquirerLike | PromptsLike | Prompter | ClackPromptsLike | ((command: CommanderProgramLike) => Prompter);
|
|
1540
|
+
interface TrpcCliRunParams {
|
|
1541
|
+
argv?: string[];
|
|
1542
|
+
logger?: Logger;
|
|
1543
|
+
completion?: OmeletteInstanceLike | (() => Promise<OmeletteInstanceLike>);
|
|
1544
|
+
prompts?: Promptable;
|
|
1545
|
+
/** Format an error thrown by the root procedure before logging to `logger.error` */
|
|
1546
|
+
formatError?: (error: unknown) => string;
|
|
1547
|
+
process?: {
|
|
1548
|
+
exit: (code: number) => never;
|
|
1549
|
+
};
|
|
1550
|
+
}
|
|
1551
|
+
/**
|
|
1552
|
+
* Type that looks like a `commander` Command instance, but doesn't require a dependency on `commander` to avoid awkward typescript errors.
|
|
1553
|
+
* If you need to use it as a `Command` instance, just cast it with `as` to `import('commander').Command`.
|
|
1554
|
+
*/
|
|
1555
|
+
interface CommanderProgramLike {
|
|
1556
|
+
name: () => string;
|
|
1557
|
+
parseAsync: (args: string[], options?: {
|
|
1558
|
+
from: "user" | "node" | "electron";
|
|
1559
|
+
}) => Promise<unknown>;
|
|
1560
|
+
helpInformation: () => string;
|
|
1561
|
+
}
|
|
1562
|
+
interface TrpcCli {
|
|
1563
|
+
/** run the CLI - gets args from `process.argv` by default */
|
|
1564
|
+
run: (params?: TrpcCliRunParams, program?: CommanderProgramLike) => Promise<void>;
|
|
1565
|
+
/**
|
|
1566
|
+
* Build a `Commander` program from the CLI - you can use this to manually customise the program before passing it to `.run(...)`.
|
|
1567
|
+
* Note that you will need to cast the return value to `import('commander').Command` to use it as a `Command` instance.
|
|
1568
|
+
*/
|
|
1569
|
+
buildProgram: (params?: TrpcCliRunParams) => CommanderProgramLike;
|
|
1570
|
+
/**
|
|
1571
|
+
* @experimental
|
|
1572
|
+
* Get a JSON representation of the CLI - useful for generating documentation etc. This function returns basic information about the CLI
|
|
1573
|
+
* and each command - to get any extra details you will need to use the `buildProgram` function and walk the tree of commands yourself.
|
|
1574
|
+
*/
|
|
1575
|
+
toJSON: (program?: CommanderProgramLike) => CommandJSON;
|
|
1576
|
+
}
|
|
1577
|
+
interface Dependencies {
|
|
1578
|
+
"@valibot/to-json-schema"?: {
|
|
1579
|
+
toJsonSchema: (input: unknown, options?: {
|
|
1580
|
+
errorMode?: "throw" | "ignore" | "warn";
|
|
1581
|
+
}) => JSONSchema7;
|
|
1582
|
+
};
|
|
1583
|
+
effect?: {
|
|
1584
|
+
Schema: {
|
|
1585
|
+
isSchema: (input: unknown) => input is "JSONSchemaMakeable";
|
|
1586
|
+
};
|
|
1587
|
+
JSONSchema: {
|
|
1588
|
+
make: (input: "JSONSchemaMakeable") => JSONSchema7;
|
|
1589
|
+
};
|
|
1590
|
+
};
|
|
1591
|
+
}
|
|
1592
|
+
interface PromptContext {
|
|
1593
|
+
input?: NodeJS.ReadableStream;
|
|
1594
|
+
output?: NodeJS.WritableStream;
|
|
1595
|
+
clearPromptOnDone?: boolean;
|
|
1596
|
+
signal?: AbortSignal;
|
|
1597
|
+
/** The command that is being prompted for. Cast this to a `commander.Command` to access the command's name, description, options etc. */
|
|
1598
|
+
command: {
|
|
1599
|
+
name: () => string;
|
|
1600
|
+
};
|
|
1601
|
+
/** The original inputs the user provided - if they passed some but not all arguments/options, this will contain the values they did pass. */
|
|
1602
|
+
inputs: {
|
|
1603
|
+
argv: string[];
|
|
1604
|
+
arguments: {
|
|
1605
|
+
name: string;
|
|
1606
|
+
specified: boolean;
|
|
1607
|
+
value: unknown;
|
|
1608
|
+
}[];
|
|
1609
|
+
options: {
|
|
1610
|
+
name: string;
|
|
1611
|
+
specified: boolean;
|
|
1612
|
+
value: unknown;
|
|
1613
|
+
}[];
|
|
1614
|
+
};
|
|
1615
|
+
/** If set, this is the argument that is being prompted for. Cast to a `commander.Argument`. */
|
|
1616
|
+
argument?: {
|
|
1617
|
+
name: () => string;
|
|
1618
|
+
};
|
|
1619
|
+
/** If set, this is the option that is being prompted for. Cast to a `commander.Option`. */
|
|
1620
|
+
option?: {
|
|
1621
|
+
name: () => string;
|
|
1622
|
+
};
|
|
1623
|
+
}
|
|
1624
|
+
interface Prompter {
|
|
1625
|
+
setup?: (context: PromptContext) => Promise<void>;
|
|
1626
|
+
teardown?: (context: PromptContext) => Promise<void>;
|
|
1627
|
+
input: (params: {
|
|
1628
|
+
message: string;
|
|
1629
|
+
validate?: (input: string) => boolean | string;
|
|
1630
|
+
required?: boolean;
|
|
1631
|
+
default?: string;
|
|
1632
|
+
}, context: PromptContext) => Promise<string>;
|
|
1633
|
+
select: (params: {
|
|
1634
|
+
message: string;
|
|
1635
|
+
choices: string[] | {
|
|
1636
|
+
name: string;
|
|
1637
|
+
value: string;
|
|
1638
|
+
description?: string;
|
|
1639
|
+
}[];
|
|
1640
|
+
required?: boolean;
|
|
1641
|
+
default?: string;
|
|
1642
|
+
validate?: (input: string) => boolean | string;
|
|
1643
|
+
}, context: PromptContext) => Promise<string>;
|
|
1644
|
+
confirm: (params: {
|
|
1645
|
+
message: string;
|
|
1646
|
+
default?: boolean;
|
|
1647
|
+
validate?: (input: string) => boolean | string;
|
|
1648
|
+
}, context: PromptContext) => Promise<boolean>;
|
|
1649
|
+
checkbox: (params: {
|
|
1650
|
+
message: string;
|
|
1651
|
+
choices: {
|
|
1652
|
+
name: string;
|
|
1653
|
+
value: string;
|
|
1654
|
+
checked?: boolean;
|
|
1655
|
+
}[];
|
|
1656
|
+
required?: boolean;
|
|
1657
|
+
default?: string[];
|
|
1658
|
+
}, context: PromptContext) => Promise<string[]>;
|
|
1659
|
+
}
|
|
1660
|
+
|
|
1661
|
+
/**
|
|
1662
|
+
* Defines a command with metadata, argument definitions,
|
|
1663
|
+
* an execution function, and (optional) subCommands.
|
|
1664
|
+
*/
|
|
1665
|
+
declare function defineCommand<A extends ArgDefinitions = EmptyArgs>(options: DefineCommandOptions<A>): Command<A>;
|
|
1666
|
+
/**
|
|
1667
|
+
* Show usage for a given command.
|
|
1668
|
+
*/
|
|
1669
|
+
declare function showUsage<A extends ArgDefinitions>(command: Command<A>, parserOptions?: ReliArgParserOptions & {
|
|
1670
|
+
fileBased?: FileBasedOptions;
|
|
1671
|
+
autoExit?: boolean;
|
|
1672
|
+
metaSettings?: {
|
|
1673
|
+
showDescriptionOnMain?: boolean;
|
|
1674
|
+
};
|
|
1675
|
+
_fileBasedCurrentDir?: string;
|
|
1676
|
+
_fileBasedPathSegments?: string[];
|
|
1677
|
+
_isSubcommand?: boolean;
|
|
1678
|
+
}, globalCliMeta?: {
|
|
1679
|
+
name?: string;
|
|
1680
|
+
version?: string;
|
|
1681
|
+
description?: string;
|
|
1682
|
+
}): Promise<void>;
|
|
1683
|
+
/**
|
|
1684
|
+
* Primary entry point to run a command. This function supports:
|
|
1685
|
+
*
|
|
1686
|
+
* - File-based Commands: scanning for commands within a given commands root.
|
|
1687
|
+
* - Commands defined within the command object.
|
|
1688
|
+
* - Standard flags like --help, --version, and --debug.
|
|
1689
|
+
* - RPC functionality: tRPC/oRPC router integration with automatic CLI generation.
|
|
1690
|
+
*
|
|
1691
|
+
* This function passes along remaining arguments to command runners to ensure
|
|
1692
|
+
* consistent parsing.
|
|
1693
|
+
*/
|
|
1694
|
+
declare function createCli<A extends ArgDefinitions = EmptyArgs>(options: Command<A> | {
|
|
1695
|
+
name?: string;
|
|
1696
|
+
version?: string;
|
|
1697
|
+
description?: string;
|
|
1698
|
+
mainCommand?: Command<A>;
|
|
1699
|
+
fileBased?: FileBasedOptions;
|
|
1700
|
+
autoExit?: boolean;
|
|
1701
|
+
metaSettings?: {
|
|
1702
|
+
showDescriptionOnMain?: boolean;
|
|
1703
|
+
};
|
|
1704
|
+
meta?: Command<A>["meta"];
|
|
1705
|
+
args?: Command<A>["args"];
|
|
1706
|
+
run?: Command<A>["run"];
|
|
1707
|
+
commands?: Command<A>["commands"];
|
|
1708
|
+
onCmdInit?: Command<A>["onCmdInit"];
|
|
1709
|
+
onCmdExit?: Command<A>["onCmdExit"];
|
|
1710
|
+
onLauncherInit?: Command<A>["onLauncherInit"];
|
|
1711
|
+
onLauncherExit?: Command<A>["onLauncherExit"];
|
|
1712
|
+
rpc?: {
|
|
1713
|
+
/** A tRPC router. Procedures will become CLI commands. */
|
|
1714
|
+
router: AnyRouter;
|
|
1715
|
+
/** Context to be supplied when invoking the router. */
|
|
1716
|
+
context?: any;
|
|
1717
|
+
/** The `@trpc/server` module to use for calling procedures. Required when using trpc v10. */
|
|
1718
|
+
trpcServer?: any | Promise<any>;
|
|
1719
|
+
/** Usage code examples to display in `--help` output. */
|
|
1720
|
+
usage?: string | string[];
|
|
1721
|
+
/** Dependencies for schema validation libraries */
|
|
1722
|
+
"@valibot/to-json-schema"?: {
|
|
1723
|
+
toJsonSchema: (input: unknown, options?: {
|
|
1724
|
+
errorMode?: "throw" | "ignore" | "warn";
|
|
1725
|
+
}) => any;
|
|
1726
|
+
};
|
|
1727
|
+
effect?: {
|
|
1728
|
+
Schema: {
|
|
1729
|
+
isSchema: (input: unknown) => input is "JSONSchemaMakeable";
|
|
1730
|
+
};
|
|
1731
|
+
JSONSchema: {
|
|
1732
|
+
make: (input: "JSONSchemaMakeable") => any;
|
|
1733
|
+
};
|
|
1734
|
+
};
|
|
1735
|
+
};
|
|
1736
|
+
rpcRunParams?: {
|
|
1737
|
+
argv?: string[];
|
|
1738
|
+
logger?: Logger;
|
|
1739
|
+
completion?: OmeletteInstanceLike | (() => Promise<OmeletteInstanceLike>);
|
|
1740
|
+
prompts?: Promptable;
|
|
1741
|
+
/** Format an error thrown by the root procedure before logging to `logger.error` */
|
|
1742
|
+
formatError?: (error: unknown) => string;
|
|
1743
|
+
process?: {
|
|
1744
|
+
exit: (code: number) => never;
|
|
1745
|
+
};
|
|
1746
|
+
};
|
|
1747
|
+
}, legacyParserOptions?: ReliArgParserOptions & {
|
|
1748
|
+
fileBased?: FileBasedOptions;
|
|
1749
|
+
autoExit?: boolean;
|
|
1750
|
+
metaSettings?: {
|
|
1751
|
+
showDescriptionOnMain?: boolean;
|
|
1752
|
+
};
|
|
1753
|
+
}): Promise<void> & {
|
|
1754
|
+
run(_ctx?: any): Promise<void>;
|
|
1755
|
+
};
|
|
1756
|
+
/**
|
|
1757
|
+
* Helper to define argument definitions with improved type inference
|
|
1758
|
+
* for IntelliSense and validation for array defaults against options.
|
|
1759
|
+
*/
|
|
1760
|
+
declare function defineArgs<A extends ArgDefinitions>(args: A): A;
|
|
1761
|
+
/**
|
|
1762
|
+
* Programmatically run a command with subcommand support and flexible argument handling.
|
|
1763
|
+
* This function can handle subcommands (including nested), positional arguments, and automatically normalizes
|
|
1764
|
+
* template literals and space-separated strings.
|
|
1765
|
+
*
|
|
1766
|
+
* @param command The command definition (from defineCommand)
|
|
1767
|
+
* @param argv The argv array to parse (default: []). Supports template literals and subcommands.
|
|
1768
|
+
* @param parserOptions Optional reliArgParser options
|
|
1769
|
+
*
|
|
1770
|
+
* @example
|
|
1771
|
+
* ```ts
|
|
1772
|
+
* // ✅ Single command with template literals
|
|
1773
|
+
* await runCmdWithSubcommands(cmd, [`--dev ${isDev}`]);
|
|
1774
|
+
*
|
|
1775
|
+
* // ✅ Subcommand with arguments
|
|
1776
|
+
* await runCmdWithSubcommands(cmd, [`build --input src/mod.ts --someBoolean`]);
|
|
1777
|
+
*
|
|
1778
|
+
* // ✅ Subcommand with positional arguments
|
|
1779
|
+
* await runCmdWithSubcommands(cmd, [`build src/mod.ts --someBoolean`]);
|
|
1780
|
+
*
|
|
1781
|
+
* // ✅ Nested subcommands
|
|
1782
|
+
* await runCmdWithSubcommands(cmd, [`build someSubCmd src/mod.ts --no-cjs`]);
|
|
1783
|
+
* await runCmdWithSubcommands(cmd, [`build sub1 sub2 sub3 file.ts --flag`]);
|
|
1784
|
+
*
|
|
1785
|
+
* // ✅ Mixed array with subcommands
|
|
1786
|
+
* await runCmdWithSubcommands(cmd, [
|
|
1787
|
+
* `build someSubCmd src/mod.ts`,
|
|
1788
|
+
* "--no-cjs",
|
|
1789
|
+
* "--verbose"
|
|
1790
|
+
* ]);
|
|
1791
|
+
* ```
|
|
1792
|
+
*/
|
|
1793
|
+
declare function runCmdWithSubcommands<A extends ArgDefinitions = EmptyArgs>(command: Command<A>, argv?: string[], parserOptions?: ReliArgParserOptions & {
|
|
1794
|
+
fileBased?: FileBasedOptions;
|
|
1795
|
+
autoExit?: boolean;
|
|
1796
|
+
}): Promise<any>;
|
|
1797
|
+
/**
|
|
1798
|
+
* Programmatically run a command's run() handler with parsed arguments.
|
|
1799
|
+
* Does not handle subcommands, file-based commands, or global hooks.
|
|
1800
|
+
* Suitable for use in demos, tests, or programmatic invocation.
|
|
1801
|
+
*
|
|
1802
|
+
* @param command The command definition (from defineCommand)
|
|
1803
|
+
* @param argv The argv array to parse (default: []). Each argument should be a separate array element.
|
|
1804
|
+
* @param parserOptions Optional reliArgParser options
|
|
1805
|
+
*
|
|
1806
|
+
* @example
|
|
1807
|
+
* **each argument as separate array element**:
|
|
1808
|
+
* ```ts
|
|
1809
|
+
* await runCmd(cmd, ["--dev", "true"]);
|
|
1810
|
+
* await runCmd(cmd, ["--name", "John", "--verbose"]);
|
|
1811
|
+
* ```
|
|
1812
|
+
* **automatic normalization of template literals**:
|
|
1813
|
+
* ```ts
|
|
1814
|
+
* await runCmd(cmd, [`--dev ${isDev}`]); // Automatically converted to ["--dev", "true"]
|
|
1815
|
+
* await runCmd(cmd, [`--dev ${isDev} --build mod.ts`]); // ["--dev", "true", "--build", "mod.ts"]
|
|
1816
|
+
* ```
|
|
1817
|
+
*/
|
|
1818
|
+
declare function runCmd<A extends ArgDefinitions = EmptyArgs>(command: Command<A>, argv?: string[], parserOptions?: ReliArgParserOptions): Promise<void>;
|
|
1819
|
+
|
|
1820
|
+
declare const runMain: typeof createCli;
|
|
1821
|
+
|
|
1822
|
+
/** uses omelette to add completions to a commander program */
|
|
1823
|
+
declare function addCompletions(program: Command$1, completion: OmeletteInstanceLike): void;
|
|
1824
|
+
|
|
1825
|
+
/** An error thrown when the trpc procedure results in a bad request */
|
|
1826
|
+
declare class CliValidationError extends Error {
|
|
1827
|
+
}
|
|
1828
|
+
/** An error which is only thrown when a custom \`process\` parameter is used. Under normal circumstances, this should not be used, even internally. */
|
|
1829
|
+
declare class FailedToExitError extends Error {
|
|
1830
|
+
readonly exitCode: number;
|
|
1831
|
+
constructor(message: string, { exitCode, cause }: {
|
|
1832
|
+
exitCode: number;
|
|
1833
|
+
cause: unknown;
|
|
1834
|
+
});
|
|
1835
|
+
}
|
|
1836
|
+
|
|
1837
|
+
declare class TrpcCommand extends Command$1 {
|
|
1838
|
+
/** @internal track the commands that have been run, so that we can find the `__result` of the last command */
|
|
1839
|
+
__ran: TrpcCommand[];
|
|
1840
|
+
__input?: unknown;
|
|
1841
|
+
/** @internal stash the return value of the underlying procedure on the command so to pass to `FailedToExitError` for use in a pinch */
|
|
1842
|
+
__result?: unknown;
|
|
1843
|
+
}
|
|
1844
|
+
/**
|
|
1845
|
+
* @internal takes a trpc router and returns an object that you **could** use to build a CLI, or UI, or a bunch of other things with.
|
|
1846
|
+
* Officially, just internal for building a CLI. GLHF.
|
|
1847
|
+
*/
|
|
1848
|
+
declare const parseRouter: <R extends AnyRouter>({ router, ...params }: TrpcCliParams<R>) => [string, ProcedureInfo][];
|
|
1849
|
+
interface ProcedureInfo {
|
|
1850
|
+
meta: TrpcCliMeta;
|
|
1851
|
+
parsedProcedure: ParsedProcedure;
|
|
1852
|
+
incompatiblePairs: [string, string][];
|
|
1853
|
+
procedure: {};
|
|
1854
|
+
}
|
|
1855
|
+
/**
|
|
1856
|
+
* Run a trpc router as a CLI.
|
|
1857
|
+
*
|
|
1858
|
+
* @param router A trpc router
|
|
1859
|
+
* @param context The context to use when calling the procedures - needed if your router requires a context
|
|
1860
|
+
* @param trpcServer The trpc server module to use. Only needed if using trpc v10.
|
|
1861
|
+
* @returns A CLI object with a `run` method that can be called to run the CLI. The `run` method will parse the command line arguments, call the appropriate trpc procedure, log the result and exit the process. On error, it will log the error and exit with a non-zero exit code.
|
|
1862
|
+
*/
|
|
1863
|
+
declare function createRpcCli<R extends AnyRouter>({ router, ...params }: TrpcCliParams<R>): TrpcCli;
|
|
1864
|
+
|
|
1865
|
+
declare const flattenedProperties: (sch: JsonSchema7Type) => JsonSchema7ObjectType["properties"];
|
|
1866
|
+
/** For a union type, returns a list of pairs of properties which *shouldn't* be used together (because they don't appear in the same type variant) */
|
|
1867
|
+
declare const incompatiblePropertyPairs: (sch: JsonSchema7Type) => [string, string][];
|
|
1868
|
+
/**
|
|
1869
|
+
* Tries fairly hard to build a roughly human-readable description of a json-schema type.
|
|
1870
|
+
* A few common properties are given special treatment, most others are just stringified and output in `key: value` format.
|
|
1871
|
+
*/
|
|
1872
|
+
declare const getDescription: (v: JsonSchema7Type, depth?: number) => string;
|
|
1873
|
+
declare const getSchemaTypes: (propertyValue: JsonSchema7Type) => ("string" | "boolean" | "number" | (string & {}))[];
|
|
1874
|
+
declare const getEnumChoices: (propertyValue: JsonSchema7Type) => {
|
|
1875
|
+
readonly type: "string_enum";
|
|
1876
|
+
readonly choices: string[];
|
|
1877
|
+
} | {
|
|
1878
|
+
readonly type: "number_enum";
|
|
1879
|
+
readonly choices: number[];
|
|
1880
|
+
} | null;
|
|
1881
|
+
|
|
1882
|
+
declare const lineByLineLogger: (logger: Logger) => Logger;
|
|
1883
|
+
/**
|
|
1884
|
+
* A logger which uses `console.log` and `console.error` to log in the following way:
|
|
1885
|
+
* - Primitives are logged directly
|
|
1886
|
+
* - Arrays are logged item-by-item
|
|
1887
|
+
* - Objects are logged as JSON
|
|
1888
|
+
*
|
|
1889
|
+
* This is useful for logging structured data in a human-readable way, and for piping logs to other tools.
|
|
1890
|
+
*/
|
|
1891
|
+
declare const lineByLineConsoleLogger: Logger;
|
|
1892
|
+
|
|
1893
|
+
declare function parseProcedureInputs(inputs: unknown[], dependencies: Dependencies): Result<ParsedProcedure>;
|
|
1894
|
+
|
|
1895
|
+
interface Shadowed<T> {
|
|
1896
|
+
original: T;
|
|
1897
|
+
shadow: T;
|
|
1898
|
+
}
|
|
1899
|
+
type WithValue<T> = Shadowed<T> & {
|
|
1900
|
+
value: string | undefined;
|
|
1901
|
+
specified: boolean;
|
|
1902
|
+
};
|
|
1903
|
+
interface Analysis {
|
|
1904
|
+
command: Shadowed<Command$1>;
|
|
1905
|
+
arguments: WithValue<Argument>[];
|
|
1906
|
+
options: WithValue<Option>[];
|
|
1907
|
+
}
|
|
1908
|
+
declare const createShadowCommand: (command: Command$1, onAnalyze: (params: Analysis) => void | Promise<void>) => Command$1;
|
|
1909
|
+
declare const promptify: (program: CommanderProgramLike, prompts: Promptable) => CommanderProgramLike;
|
|
1910
|
+
|
|
1911
|
+
declare const prettifyStandardSchemaError: (error: unknown) => string | null;
|
|
1912
|
+
declare function toDotPath(path: (string | number | symbol)[]): string;
|
|
1913
|
+
declare class StandardSchemaV1Error extends Error implements StandardSchemaV1FailureResult {
|
|
1914
|
+
issues: StandardSchemaV1FailureResult["issues"];
|
|
1915
|
+
constructor(failure: StandardSchemaV1FailureResult, options?: {
|
|
1916
|
+
cause?: Error;
|
|
1917
|
+
});
|
|
1918
|
+
}
|
|
1919
|
+
|
|
1920
|
+
declare const looksLikeStandardSchemaFailure: (error: unknown) => error is StandardSchemaV1FailureResult;
|
|
1921
|
+
declare const looksLikeStandardSchema: (thing: unknown) => thing is StandardSchemaV1;
|
|
1922
|
+
|
|
1923
|
+
/**
|
|
1924
|
+
* Pretty much like the `instanceof` operator, but should work across different realms. Necessary for zod because some installations
|
|
1925
|
+
* might result in this library using the commonjs zod export, while the user's code uses the esm export.
|
|
1926
|
+
* https://github.com/mmkal/trpc-cli/issues/7
|
|
1927
|
+
*
|
|
1928
|
+
* Tradeoff: It's possible that this function will return false positives if the target class has the same name as an unrelated class in the current realm.
|
|
1929
|
+
* So, only use it for classes that are unlikely to have name conflicts like `ZodAbc` or `TRPCDef`.
|
|
1930
|
+
*/
|
|
1931
|
+
declare const looksLikeInstanceof: <T>(value: unknown, target: string | (new (...args: any[]) => T)) => value is T;
|
|
1932
|
+
|
|
1933
|
+
declare const log: _reliverse_relinka.RelinkaFunction;
|
|
1934
|
+
|
|
1935
|
+
/**
|
|
1936
|
+
* Maps complex colors (gradients, bright, background) to standard terminal colors.
|
|
1937
|
+
* Used by ora spinners and other terminal utilities that only support basic colors.
|
|
1938
|
+
*
|
|
1939
|
+
* Handles:
|
|
1940
|
+
* - Gradient colors -> solid colors (e.g., retroGradient -> cyan)
|
|
1941
|
+
* - Bright colors -> base colors (e.g., redBright -> red)
|
|
1942
|
+
* - Background colors -> foreground colors (e.g., bgRed -> red)
|
|
1943
|
+
* - Special colors -> undefined (reset, inverse, dim, none)
|
|
1944
|
+
*
|
|
1945
|
+
* @param color The complex color to convert
|
|
1946
|
+
* @returns A standard terminal color or undefined for special colors
|
|
1947
|
+
*/
|
|
1948
|
+
declare function toBaseColor(color?: ColorName): StandardColor | undefined;
|
|
1949
|
+
/**
|
|
1950
|
+
* Maps any color type to a standard solid color for consistent display.
|
|
1951
|
+
* Similar to toBaseColor but always returns a color (never undefined).
|
|
1952
|
+
*
|
|
1953
|
+
* Handles:
|
|
1954
|
+
* - Gradient colors -> solid colors (e.g., retroGradient -> cyan)
|
|
1955
|
+
* - Bright colors -> base colors (e.g., redBright -> red)
|
|
1956
|
+
* - Background colors -> foreground colors (e.g., bgRed -> red)
|
|
1957
|
+
* - Special colors (reset, inverse, none) -> dim
|
|
1958
|
+
* - Undefined -> dim
|
|
1959
|
+
*
|
|
1960
|
+
* @param color The color to convert
|
|
1961
|
+
* @returns A standard terminal color, defaulting to "dim" for special cases
|
|
1962
|
+
*/
|
|
1963
|
+
declare function toSolidColor(color?: ColorName): OutputColor;
|
|
1964
|
+
|
|
1965
|
+
/**
|
|
1966
|
+
* Logs messages with configurable styling and formatting.
|
|
1967
|
+
* Doesn't support streaming functionality.
|
|
1968
|
+
*/
|
|
1969
|
+
declare function relinkaByRemptsDeprecated(kind: AllKinds, title: string, content?: string, hint?: string): void;
|
|
1970
|
+
/**
|
|
1971
|
+
* Asynchronous version of relinka that supports streaming functionality.
|
|
1972
|
+
* Use this when you want animated text output with optional spinner.
|
|
1973
|
+
*
|
|
1974
|
+
* Streaming is controlled by the streamOpts parameter:
|
|
1975
|
+
* - Use { useSpinner: true } for spinner animation
|
|
1976
|
+
* - Use { delay: number } for character-by-character streaming
|
|
1977
|
+
* - Content and hint are optional regardless of streaming
|
|
1978
|
+
*/
|
|
1979
|
+
declare const relinkaAsyncByRemptsDeprecated: (kind: AllKinds, title: string, content?: string, hint?: string, streamOpts?: StreamOptions) => Promise<void>;
|
|
1980
|
+
declare const throwError: (error: unknown) => never;
|
|
1981
|
+
|
|
1982
|
+
declare const colorMap: Record<ColorName, (text: string) => string>;
|
|
1983
|
+
declare const typographyMap: Record<TypographyName, (text: string) => string>;
|
|
1984
|
+
|
|
1985
|
+
declare const symbols: Symbols;
|
|
1986
|
+
/**
|
|
1987
|
+
* Returns a colored vertical bar symbol. Prevents gradient colors for bars.
|
|
1988
|
+
*/
|
|
1989
|
+
declare const bar: ({ borderColor }?: {
|
|
1990
|
+
borderColor?: ColorName;
|
|
1991
|
+
}) => string;
|
|
1992
|
+
/**
|
|
1993
|
+
* Main formatter function: builds the final text output based on FmtMsgOptions.
|
|
1994
|
+
*/
|
|
1995
|
+
declare function fmt(opts: FmtMsgOptions): {
|
|
1996
|
+
text: string;
|
|
1997
|
+
lineCount: number;
|
|
1998
|
+
};
|
|
1999
|
+
/**
|
|
2000
|
+
* Logs a formatted message to the console and records how many lines it occupies.
|
|
2001
|
+
*/
|
|
2002
|
+
declare function msg(opts: FmtMsgOptions): void;
|
|
2003
|
+
/**
|
|
2004
|
+
* Undo the last printed message by deleting its lines from the terminal.
|
|
2005
|
+
* @param count How many messages to undo. Defaults to 1.
|
|
2006
|
+
*/
|
|
2007
|
+
declare function msgUndo(count?: number): void;
|
|
2008
|
+
/**
|
|
2009
|
+
* Undo all printed messages so far.
|
|
2010
|
+
*/
|
|
2011
|
+
declare function msgUndoAll(): void;
|
|
2012
|
+
/**
|
|
2013
|
+
* Prints: "│ <text>" (two spaces after the bar).
|
|
2014
|
+
* If text is empty, it just prints "│".
|
|
2015
|
+
* If indent is 1, it prints "│ <text>" (one space).
|
|
2016
|
+
* If indent is 2, it prints "│ <text>" (two spaces), etc.
|
|
2017
|
+
*/
|
|
2018
|
+
declare function printLineBar(text: string, indent?: number): void;
|
|
2019
|
+
|
|
2020
|
+
declare function getTerminalHeight(): number;
|
|
2021
|
+
declare function getExactTerminalWidth(): number;
|
|
2022
|
+
declare function getTerminalWidth(terminalWidth?: number): number;
|
|
2023
|
+
/**
|
|
2024
|
+
* Force line returns at specific width. This function is ANSI code friendly and it'll
|
|
2025
|
+
* ignore invisible codes during width calculation.
|
|
2026
|
+
* @param {string} content
|
|
2027
|
+
* @return {string}
|
|
2028
|
+
*/
|
|
2029
|
+
declare function breakLines(content: string, terminalWidth?: number): string;
|
|
2030
|
+
declare function removeCursor(): void;
|
|
2031
|
+
declare function restoreCursor(): void;
|
|
2032
|
+
declare function deleteLastLine(): void;
|
|
2033
|
+
declare function deleteLastLines(count: number): void;
|
|
2034
|
+
declare function countLines(text: string): number;
|
|
2035
|
+
|
|
2036
|
+
declare const variantMap: {
|
|
2037
|
+
doubleBox: typeof createDoubleBox;
|
|
2038
|
+
};
|
|
2039
|
+
type ValidVariant = keyof typeof variantMap;
|
|
2040
|
+
declare function isValidVariant(variant: string | undefined): variant is ValidVariant;
|
|
2041
|
+
declare function applyVariant(lines: string[] | string, variant?: VariantName$1, options?: {
|
|
2042
|
+
limit?: number;
|
|
2043
|
+
}, borderColor?: ColorName): Promise<string>;
|
|
2044
|
+
declare function createDoubleBox(lines: string[], limit?: number, borderColor?: ColorName): string;
|
|
2045
|
+
|
|
2046
|
+
declare const multiselect: <T extends string>(params: MultiselectPromptParams<T>) => Promise<T[]>;
|
|
2047
|
+
|
|
2048
|
+
declare function multiselectPrompt<T extends string>(params: MultiselectPromptParams<T>): Promise<T[]>;
|
|
2049
|
+
|
|
2050
|
+
interface NextStepsPromptOptions {
|
|
2051
|
+
title?: string;
|
|
2052
|
+
titleColor?: ColorName;
|
|
2053
|
+
titleVariant?: VariantName$1;
|
|
2054
|
+
titleTypography?: TypographyName;
|
|
2055
|
+
content: string[];
|
|
2056
|
+
contentColor?: ColorName;
|
|
2057
|
+
contentVariant?: VariantName$1;
|
|
2058
|
+
contentTypography?: TypographyName;
|
|
2059
|
+
}
|
|
2060
|
+
declare function nextStepsPrompt(options: NextStepsPromptOptions): Promise<void>;
|
|
2061
|
+
|
|
2062
|
+
type VariantName = FmtMsgOptions["titleVariant"];
|
|
2063
|
+
interface NumberPromptOptions {
|
|
2064
|
+
title: string;
|
|
2065
|
+
hint?: string;
|
|
2066
|
+
hintPlaceholderColor?: ColorName;
|
|
2067
|
+
validate?: (value: number) => string | undefined | boolean | Promise<string | undefined | boolean>;
|
|
2068
|
+
defaultValue?: string | number;
|
|
2069
|
+
schema?: any;
|
|
2070
|
+
titleColor?: ColorName;
|
|
2071
|
+
titleTypography?: TypographyName;
|
|
2072
|
+
titleVariant?: VariantName;
|
|
2073
|
+
content?: string;
|
|
2074
|
+
contentColor?: ColorName;
|
|
2075
|
+
contentTypography?: TypographyName;
|
|
2076
|
+
contentVariant?: VariantName;
|
|
2077
|
+
borderColor?: BorderColorName;
|
|
2078
|
+
variantOptions?: any;
|
|
2079
|
+
endTitle?: string;
|
|
2080
|
+
endTitleColor?: ColorName;
|
|
2081
|
+
border?: boolean;
|
|
2082
|
+
hardcoded?: {
|
|
2083
|
+
userInput?: string;
|
|
2084
|
+
errorMessage?: string;
|
|
2085
|
+
};
|
|
2086
|
+
}
|
|
2087
|
+
declare function numberPrompt(opts: NumberPromptOptions): Promise<number>;
|
|
2088
|
+
|
|
2089
|
+
type EndPromptOptions = PromptOptions & {
|
|
2090
|
+
variant?: "footer" | "ascii-art";
|
|
2091
|
+
asciiArtFont?: Fonts;
|
|
2092
|
+
};
|
|
2093
|
+
declare function outroPrompt(optionsOrTitle: EndPromptOptions | string): Promise<void>;
|
|
2094
|
+
|
|
2095
|
+
declare const endPrompt: typeof outroPrompt;
|
|
2096
|
+
declare const outro: typeof outroPrompt;
|
|
2097
|
+
|
|
2098
|
+
interface ResultsType {
|
|
2099
|
+
username: string;
|
|
2100
|
+
}
|
|
2101
|
+
declare function resultPrompt({ results, inline, }: {
|
|
2102
|
+
results: ResultsType;
|
|
2103
|
+
inline?: boolean;
|
|
2104
|
+
}): Promise<void>;
|
|
2105
|
+
|
|
2106
|
+
type NumMultiSelectPromptOptions = PromptOptions & {
|
|
2107
|
+
defaultValue?: string[];
|
|
2108
|
+
};
|
|
2109
|
+
declare function numMultiSelectPrompt(opts: NumMultiSelectPromptOptions): Promise<(string | undefined)[]>;
|
|
2110
|
+
|
|
2111
|
+
type NumSelectPromptOptions = PromptOptions & {
|
|
2112
|
+
inline?: boolean;
|
|
2113
|
+
defaultValue?: string;
|
|
2114
|
+
};
|
|
2115
|
+
declare function numSelectPrompt(opts: NumSelectPromptOptions): Promise<string | number>;
|
|
2116
|
+
|
|
2117
|
+
declare const select: <T extends string>(params: SelectPromptParams<T>) => Promise<T>;
|
|
2118
|
+
declare const selectSimple: <T extends string>(params: Omit<SelectPromptParams<T>, "options"> & {
|
|
2119
|
+
options: {
|
|
2120
|
+
value: T;
|
|
2121
|
+
label?: string;
|
|
2122
|
+
hint?: string;
|
|
2123
|
+
}[];
|
|
2124
|
+
}) => Promise<T>;
|
|
2125
|
+
|
|
2126
|
+
/**
|
|
2127
|
+
* Displays a selectable prompt in the terminal and returns the chosen value.
|
|
2128
|
+
*/
|
|
2129
|
+
declare function selectPrompt<T extends string>(params: SelectPromptParams<T>): Promise<T>;
|
|
2130
|
+
|
|
2131
|
+
/**
|
|
2132
|
+
* A toggle prompt that lets the user choose between two options (Yes/No style).
|
|
2133
|
+
*/
|
|
2134
|
+
declare function togglePrompt<T extends string>(params: TogglePromptParams<T>): Promise<boolean>;
|
|
2135
|
+
|
|
2136
|
+
interface SpinnerOptions {
|
|
2137
|
+
cancelMessage?: string;
|
|
2138
|
+
color?: string;
|
|
2139
|
+
delay?: number;
|
|
2140
|
+
errorMessage?: string;
|
|
2141
|
+
failText?: string;
|
|
2142
|
+
frames?: string[];
|
|
2143
|
+
hideCursor?: boolean;
|
|
2144
|
+
indicator?: "dots" | "timer";
|
|
2145
|
+
onCancel?: () => void;
|
|
2146
|
+
prefixText?: string;
|
|
2147
|
+
signal?: AbortSignal;
|
|
2148
|
+
silent?: boolean;
|
|
2149
|
+
spinner?: string;
|
|
2150
|
+
successText?: string;
|
|
2151
|
+
text: string;
|
|
2152
|
+
}
|
|
2153
|
+
interface ProgressOptions {
|
|
2154
|
+
current: number;
|
|
2155
|
+
total: number;
|
|
2156
|
+
format?: "percentage" | "count" | "both";
|
|
2157
|
+
}
|
|
2158
|
+
interface SpinnerControls {
|
|
2159
|
+
start: (text?: string) => SpinnerControls;
|
|
2160
|
+
stop: (text?: string, code?: number) => void;
|
|
2161
|
+
setText: (text: string) => void;
|
|
2162
|
+
setProgress: (progress: ProgressOptions) => void;
|
|
2163
|
+
succeed: (text?: string) => void;
|
|
2164
|
+
fail: (text?: string) => void;
|
|
2165
|
+
warn: (text?: string) => void;
|
|
2166
|
+
info: (text?: string) => void;
|
|
2167
|
+
isSpinning: () => boolean;
|
|
2168
|
+
clear: () => void;
|
|
2169
|
+
getElapsedTime: () => number;
|
|
2170
|
+
pause: () => void;
|
|
2171
|
+
resume: () => void;
|
|
2172
|
+
dispose: () => void;
|
|
2173
|
+
isCancelled: boolean;
|
|
2174
|
+
}
|
|
2175
|
+
/**
|
|
2176
|
+
* Creates a terminal spinner with enhanced controls and styling options.
|
|
2177
|
+
*
|
|
2178
|
+
* @example
|
|
2179
|
+
* ```typescript
|
|
2180
|
+
* // Basic usage
|
|
2181
|
+
* const spinner = useSpinner({ text: "Loading..." }).start();
|
|
2182
|
+
* spinner.stop();
|
|
2183
|
+
*
|
|
2184
|
+
* // With progress tracking
|
|
2185
|
+
* const spinner = useSpinner({ text: "Processing files..." }).start();
|
|
2186
|
+
* for (let i = 0; i < files.length; i++) {
|
|
2187
|
+
* spinner.setProgress({ current: i + 1, total: files.length });
|
|
2188
|
+
* await processFile(files[i]);
|
|
2189
|
+
* }
|
|
2190
|
+
* spinner.succeed();
|
|
2191
|
+
*
|
|
2192
|
+
* // With custom color and spinner
|
|
2193
|
+
* const spinner = useSpinner({
|
|
2194
|
+
* text: "Processing...",
|
|
2195
|
+
* color: "cyan",
|
|
2196
|
+
* spinner: "dots"
|
|
2197
|
+
* }).start();
|
|
2198
|
+
*
|
|
2199
|
+
* // With success/failure states
|
|
2200
|
+
* const spinner = useSpinner({
|
|
2201
|
+
* text: "Uploading...",
|
|
2202
|
+
* successText: "Upload complete!",
|
|
2203
|
+
* failText: "Upload failed!"
|
|
2204
|
+
* }).start();
|
|
2205
|
+
* try {
|
|
2206
|
+
* await uploadFile();
|
|
2207
|
+
* spinner.succeed();
|
|
2208
|
+
* } catch (error) {
|
|
2209
|
+
* spinner.fail();
|
|
2210
|
+
* }
|
|
2211
|
+
*
|
|
2212
|
+
* // Using the wrapper for async operations
|
|
2213
|
+
* await useSpinner.promise(
|
|
2214
|
+
* async (spinner) => {
|
|
2215
|
+
* await longOperation();
|
|
2216
|
+
* spinner.setProgress({ current: 50, total: 100 });
|
|
2217
|
+
* },
|
|
2218
|
+
* {
|
|
2219
|
+
* text: "Working...",
|
|
2220
|
+
* successText: "Done!",
|
|
2221
|
+
* failText: "Failed!"
|
|
2222
|
+
* }
|
|
2223
|
+
* );
|
|
2224
|
+
* ```
|
|
2225
|
+
*/
|
|
2226
|
+
declare function useSpinner(options: SpinnerOptions): SpinnerControls;
|
|
2227
|
+
declare namespace useSpinner {
|
|
2228
|
+
var promise: <T>(operation: (spinner: SpinnerControls) => Promise<T>, options: SpinnerOptions) => Promise<T>;
|
|
2229
|
+
var nested: (parentOptions: SpinnerOptions) => {
|
|
2230
|
+
start: () => {
|
|
2231
|
+
child: (childOptions: SpinnerOptions) => SpinnerControls;
|
|
2232
|
+
finish: (success: boolean, text?: string) => void;
|
|
2233
|
+
dispose: () => void;
|
|
2234
|
+
};
|
|
2235
|
+
};
|
|
2236
|
+
var withTiming: <T>(operation: (spinner: SpinnerControls) => Promise<T>, options: SpinnerOptions) => Promise<{
|
|
2237
|
+
result: T;
|
|
2238
|
+
duration: number;
|
|
2239
|
+
}>;
|
|
2240
|
+
}
|
|
2241
|
+
|
|
2242
|
+
declare const spinner: typeof useSpinner;
|
|
2243
|
+
|
|
2244
|
+
declare function taskProgressPrompt(options: ProgressBarOptions): Promise<ProgressBar>;
|
|
2245
|
+
|
|
2246
|
+
type SimpleSpinnerType = "default" | "dottedCircle" | "boxSpinner";
|
|
2247
|
+
type OraSpinnerType = Extract<SpinnerName, OraAllowedSpinners>;
|
|
2248
|
+
type OraAllowedSpinners = "dots" | "bouncingBar" | "arc";
|
|
2249
|
+
interface TaskOptions<T extends "simple" | "ora"> {
|
|
2250
|
+
initialMessage: string;
|
|
2251
|
+
successMessage?: string;
|
|
2252
|
+
errorMessage?: string;
|
|
2253
|
+
delay?: number;
|
|
2254
|
+
spinnerSolution: T;
|
|
2255
|
+
spinnerType?: T extends "simple" ? SimpleSpinnerType : OraSpinnerType;
|
|
2256
|
+
action: (updateMessage: (message: string) => void) => Promise<void>;
|
|
2257
|
+
}
|
|
2258
|
+
declare function taskSpinPrompt<T extends "simple" | "ora">(options: TaskOptions<T>): Promise<void>;
|
|
2259
|
+
|
|
2260
|
+
declare function colorize(text: string, colorName?: ColorName, typography?: TypographyName): string;
|
|
2261
|
+
|
|
2262
|
+
declare const errorHandler: (error: Error, customMessage?: string) => never;
|
|
2263
|
+
|
|
2264
|
+
declare function preventUnsupportedTTY(): void;
|
|
2265
|
+
/**
|
|
2266
|
+
* Prevents EISDIR errors when trying to read Windows home directory as a file
|
|
2267
|
+
* @param filePath The file path to check
|
|
2268
|
+
*/
|
|
2269
|
+
declare function preventWindowsHomeDirRoot(filePath: string): never | undefined;
|
|
2270
|
+
declare function preventWrongTerminalSize({ isDev, shouldExit, minWidth, minHeight, sizeErrorDescription, }: PreventWrongTerminalSizeOptions): Promise<void>;
|
|
2271
|
+
|
|
2272
|
+
/**
|
|
2273
|
+
* Ends the prompt by optionally displaying an end message and running the action if confirmed.
|
|
2274
|
+
* Preserves the last prompt state unless there's an endTitle.
|
|
2275
|
+
*/
|
|
2276
|
+
declare function completePrompt(prompt: "input" | "confirm" | "select" | "multiselect" | "toggle", isCtrlC: boolean, _endTitle: string | undefined, _endTitleColor: ColorName | undefined, _titleTypography: TypographyName | undefined, _titleVariant: VariantName$1 | undefined, _border?: boolean, borderColor?: BorderColorName, action?: () => Promise<void>, value?: boolean): Promise<boolean>;
|
|
2277
|
+
declare function renderEndLine(): void;
|
|
2278
|
+
declare function renderEndLineInput(): void;
|
|
2279
|
+
|
|
2280
|
+
/**
|
|
2281
|
+
* Simulates streaming text output in the console, character by character
|
|
2282
|
+
*/
|
|
2283
|
+
declare function streamText({ text, delay, showCursor, color, newline, clearLine, onProgress, }: StreamTextOptions): Promise<void>;
|
|
2284
|
+
/**
|
|
2285
|
+
* Simulates streaming text output in a message box
|
|
2286
|
+
*/
|
|
2287
|
+
declare function streamTextBox({ text, delay, color, borderColor, }: Omit<StreamTextOptions, "showCursor" | "newline" | "clearLine"> & {
|
|
2288
|
+
borderColor?: BorderColorName;
|
|
2289
|
+
}): Promise<void>;
|
|
2290
|
+
/**
|
|
2291
|
+
* Simulates streaming text output with a loading spinner using ora
|
|
2292
|
+
*/
|
|
2293
|
+
declare function streamTextWithSpinner({ text, delay, color, spinnerFrames, spinnerDelay, }: StreamTextOptions & {
|
|
2294
|
+
spinnerFrames?: string[];
|
|
2295
|
+
spinnerDelay?: number;
|
|
2296
|
+
}): Promise<void>;
|
|
2297
|
+
|
|
2298
|
+
declare const pm: _reliverse_runtime.PkgManagerInfo;
|
|
2299
|
+
declare const reliversePrompts: {
|
|
2300
|
+
name: string;
|
|
2301
|
+
version: string;
|
|
2302
|
+
description: string;
|
|
2303
|
+
};
|
|
2304
|
+
|
|
2305
|
+
/**
|
|
2306
|
+
* Checks if the terminal is interactive
|
|
2307
|
+
*/
|
|
2308
|
+
declare function isTerminalInteractive(input?: NodeJS.ReadStream & {
|
|
2309
|
+
fd: 0;
|
|
2310
|
+
}): boolean;
|
|
2311
|
+
/**
|
|
2312
|
+
* Validates a name against allowed characters
|
|
2313
|
+
*/
|
|
2314
|
+
interface ValidationResult {
|
|
2315
|
+
isValid: boolean;
|
|
2316
|
+
message?: string;
|
|
2317
|
+
}
|
|
2318
|
+
declare function isValidName(name: string): ValidationResult;
|
|
2319
|
+
/**
|
|
2320
|
+
* Cleans up project name from config by removing scope and invalid characters.
|
|
2321
|
+
* For paths with multiple segments (e.g. "@org/subpath/cli"), takes the last segment.
|
|
2322
|
+
* This also ensures complex cases (e.g. "@some@weird/path/the-name!" returns "the-name").
|
|
2323
|
+
*/
|
|
2324
|
+
declare function normalizeName(name: string): string;
|
|
2325
|
+
|
|
2326
|
+
declare function createAsciiArt({ message, font, clearConsole, }: {
|
|
2327
|
+
message: string;
|
|
2328
|
+
font?: Fonts;
|
|
2329
|
+
clearConsole?: boolean;
|
|
2330
|
+
}): Promise<void>;
|
|
2331
|
+
|
|
2332
|
+
export { CANCEL, CliValidationError, FailedToExitError, StandardSchemaV1Error, TrpcCommand, addCompletions, animateText, animationMap, anykeyPrompt, applyVariant, argsToStringArray, bar, block, breakLines, callCmdImpl, cancel, colorMap, colorize, commandToJSON, completePrompt, confirm, confirmPrompt, countLines, createAsciiArt, createCallCmd, createCancel, createCli, createGetTypedCmd, createMultiStep, createRpcCli, createShadowCommand, createStep, datePrompt, defineArgs, defineCommand, deleteLastLine, deleteLastLines, endPrompt, errorHandler, fallbackSymbols, figures, flattenedProperties, fmt, getColumns, getDescription, getEnumChoices, getExactTerminalWidth, getSchemaTypes, getTerminalHeight, getTerminalWidth, getTypedCmdImpl, group, incompatiblePropertyPairs, input, inputPrompt, intro, introPrompt, isCancel, isOrpcRouter, isTerminalInteractive, isTrpc11Procedure, isTrpc11Router, isValidName, isValidVariant, isWindows, lineByLineConsoleLogger, lineByLineLogger, loadCommand, log, looksLikeInstanceof, looksLikeStandardSchema, looksLikeStandardSchemaFailure, mainSymbols, msg, msgUndo, msgUndoAll, multiselect, multiselectPrompt, nextStepsPrompt, normalizeName, numMultiSelectPrompt, numSelectPrompt, numberPrompt, outro, outroPrompt, parseProcedureInputs, parseRouter, password, pm, prettifyStandardSchemaError, preventUnsupportedTTY, preventWindowsHomeDirRoot, preventWrongTerminalSize, printLineBar, promptify, relinkaAsyncByRemptsDeprecated, relinkaByRemptsDeprecated, reliversePrompts, removeCursor, renderEndLine, renderEndLineInput, restoreCursor, resultPrompt, runCmd, runCmdWithSubcommands, runMain, select, selectPrompt, selectSimple, setRawMode, showUsage, spinner, startEditor, startPrompt, streamText, streamTextBox, streamTextWithSpinner, symbols, taskProgressPrompt, taskSpinPrompt, text, throwError, toBaseColor, toDotPath, toSolidColor, togglePrompt, typographyMap, useSpinner, variantMap };
|
|
2333
|
+
export type { AllKinds, AnyProcedure, AnyRouter, ArgDefinition, ArgDefinitions, ArrayArgDefinition, BaseArgDefinition, BaseArgProps, BooleanArgDefinition, BorderColorName, CancelValue, ChoiceOptions, ClackPromptsLike, ColorName, Command, CommandContext, CommandHook, CommandJSON, CommandMeta, CommandRun, CommandSpec, CommanderProgramLike, CommandsMap, ConfirmPromptOptions, CreateCallerFactoryLike, DatePromptOptions, DefineCommandOptions, Dependencies, EditorExitResult, EmptyArgs, EnquirerLike, FileBasedOptions, FmtMsgOptions, GroupContext, GroupOptions, GroupStep, GroupSteps, InferArgTypes, InputPromptOptions, InquirerPromptOptions, InquirerPromptsLike, Log, Logger, MessageConfig, MessageKind, MsgConfig, MsgType, MultiselectPromptParams, NumberArgDefinition, OmeletteInstanceLike, OrpcProcedureLike, OrpcRouterLike, OutputColor, ParsedProcedure, PositionalArgDefinition, PreventWrongTerminalSizeOptions, ProgressBar, ProgressBarOptions, PromptContext, PromptOptions, PromptType, Promptable, Prompter, PromptsLike, RenderParams, Result, ResultsType, SelectOption, SelectPromptParams, SeparatorOption, StandardColor, StandardSchemaV1, StandardSchemaV1FailureResult, StandardSchemaV1InferInput, StandardSchemaV1InferOutput, StandardSchemaV1Issue, StandardSchemaV1PathSegment, StandardSchemaV1Props, StandardSchemaV1Result, StandardSchemaV1SuccessResult, StandardSchemaV1Types, StreamOptions, StreamTextOptions, StringArgDefinition, SymbolName, Symbols, TogglePromptParams, Trpc10ProcedureLike, Trpc10RouterLike, Trpc11ProcedureLike, Trpc11ProcedureRecordLike, Trpc11RouterLike, TrpcCli, TrpcCliMeta, TrpcCliParams, TrpcCliRunParams, TrpcServerModuleLike, TypographyName, VariantName$1 as VariantName, inferRouterContext };
|