lean-agents 0.0.0-stage → 0.8.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (132) hide show
  1. package/LICENSE +21 -0
  2. package/README.es.md +454 -0
  3. package/README.md +453 -2
  4. package/core/AGENTS.es.md +60 -0
  5. package/core/AGENTS.md +60 -0
  6. package/core/README.md +8 -0
  7. package/core/agents/debug.md +14 -0
  8. package/core/agents/explore.md +13 -0
  9. package/core/agents/planner.md +14 -0
  10. package/core/agents/research.md +13 -0
  11. package/core/agents/review.md +13 -0
  12. package/core/copilot-usage-tui.js +186 -0
  13. package/core/mcp.json +38 -0
  14. package/core/pins.json +30 -0
  15. package/core/tiers.json +4 -0
  16. package/node_modules/@clack/core/LICENSE +9 -0
  17. package/node_modules/@clack/core/README.md +22 -0
  18. package/node_modules/@clack/core/dist/index.d.mts +503 -0
  19. package/node_modules/@clack/core/dist/index.mjs +1003 -0
  20. package/node_modules/@clack/core/package.json +63 -0
  21. package/node_modules/@clack/prompts/LICENSE +9 -0
  22. package/node_modules/@clack/prompts/README.md +396 -0
  23. package/node_modules/@clack/prompts/dist/index.d.mts +949 -0
  24. package/node_modules/@clack/prompts/dist/index.mjs +1423 -0
  25. package/node_modules/@clack/prompts/package.json +67 -0
  26. package/node_modules/fast-string-truncated-width/dist/index.d.ts +4 -0
  27. package/node_modules/fast-string-truncated-width/dist/index.js +111 -0
  28. package/node_modules/fast-string-truncated-width/dist/types.d.ts +19 -0
  29. package/node_modules/fast-string-truncated-width/dist/types.js +2 -0
  30. package/node_modules/fast-string-truncated-width/dist/utils.d.ts +4 -0
  31. package/node_modules/fast-string-truncated-width/dist/utils.js +20 -0
  32. package/node_modules/fast-string-truncated-width/license +21 -0
  33. package/node_modules/fast-string-truncated-width/package.json +35 -0
  34. package/node_modules/fast-string-truncated-width/readme.md +59 -0
  35. package/node_modules/fast-string-width/dist/index.d.ts +4 -0
  36. package/node_modules/fast-string-width/dist/index.js +14 -0
  37. package/node_modules/fast-string-width/license +21 -0
  38. package/node_modules/fast-string-width/package.json +34 -0
  39. package/node_modules/fast-string-width/readme.md +42 -0
  40. package/node_modules/fast-wrap-ansi/LICENSE +23 -0
  41. package/node_modules/fast-wrap-ansi/README.md +26 -0
  42. package/node_modules/fast-wrap-ansi/lib/main.d.ts +6 -0
  43. package/node_modules/fast-wrap-ansi/lib/main.js +218 -0
  44. package/node_modules/fast-wrap-ansi/package.json +51 -0
  45. package/node_modules/jsonc-parser/CHANGELOG.md +76 -0
  46. package/node_modules/jsonc-parser/LICENSE.md +21 -0
  47. package/node_modules/jsonc-parser/README.md +364 -0
  48. package/node_modules/jsonc-parser/SECURITY.md +41 -0
  49. package/node_modules/jsonc-parser/lib/esm/impl/edit.js +185 -0
  50. package/node_modules/jsonc-parser/lib/esm/impl/format.js +261 -0
  51. package/node_modules/jsonc-parser/lib/esm/impl/parser.js +659 -0
  52. package/node_modules/jsonc-parser/lib/esm/impl/scanner.js +443 -0
  53. package/node_modules/jsonc-parser/lib/esm/impl/string-intern.js +29 -0
  54. package/node_modules/jsonc-parser/lib/esm/main.d.ts +351 -0
  55. package/node_modules/jsonc-parser/lib/esm/main.js +178 -0
  56. package/node_modules/jsonc-parser/lib/umd/impl/edit.js +201 -0
  57. package/node_modules/jsonc-parser/lib/umd/impl/format.js +275 -0
  58. package/node_modules/jsonc-parser/lib/umd/impl/parser.js +682 -0
  59. package/node_modules/jsonc-parser/lib/umd/impl/scanner.js +456 -0
  60. package/node_modules/jsonc-parser/lib/umd/impl/string-intern.js +42 -0
  61. package/node_modules/jsonc-parser/lib/umd/main.d.ts +351 -0
  62. package/node_modules/jsonc-parser/lib/umd/main.js +194 -0
  63. package/node_modules/jsonc-parser/package.json +37 -0
  64. package/node_modules/sisteransi/license +21 -0
  65. package/node_modules/sisteransi/package.json +34 -0
  66. package/node_modules/sisteransi/readme.md +113 -0
  67. package/node_modules/sisteransi/src/index.js +58 -0
  68. package/node_modules/sisteransi/src/sisteransi.d.ts +35 -0
  69. package/package.json +29 -4
  70. package/profiles/README.md +10 -0
  71. package/profiles/anthropic-api/gsd-defaults.json +26 -0
  72. package/profiles/anthropic-api.json +18 -0
  73. package/profiles/antigravity.json +12 -0
  74. package/profiles/claude-subscription/gsd-defaults.json +26 -0
  75. package/profiles/claude-subscription.json +17 -0
  76. package/profiles/github-copilot/gsd-defaults.json +26 -0
  77. package/profiles/github-copilot.json +17 -0
  78. package/profiles/openai-api/gsd-defaults.json +26 -0
  79. package/profiles/openai-api.json +17 -0
  80. package/profiles/opencode-go/gsd-defaults.json +26 -0
  81. package/profiles/opencode-go.json +17 -0
  82. package/profiles/vertex-gemini/gsd-defaults.json +26 -0
  83. package/profiles/vertex-gemini.json +18 -0
  84. package/scripts/adhd-skill.mjs +12 -0
  85. package/scripts/bump-pins.mjs +104 -0
  86. package/scripts/check-private.sh +52 -0
  87. package/scripts/check-readme.mjs +131 -0
  88. package/scripts/ci-download.sh +20 -0
  89. package/scripts/ci-install-opencode-v2.sh +6 -0
  90. package/scripts/ci-latest-report.mjs +38 -0
  91. package/scripts/copilot-context-mode.mjs +33 -0
  92. package/scripts/labels.sh +55 -0
  93. package/scripts/lean.mjs +700 -0
  94. package/scripts/lib/adapters/antigravity.mjs +72 -0
  95. package/scripts/lib/adapters/claude.mjs +122 -0
  96. package/scripts/lib/adapters/copilot-cli.mjs +81 -0
  97. package/scripts/lib/adapters/cursor.mjs +60 -0
  98. package/scripts/lib/adapters/opencode-v1.mjs +86 -0
  99. package/scripts/lib/adapters/opencode-v2.mjs +168 -0
  100. package/scripts/lib/adapters/vscode-copilot.mjs +56 -0
  101. package/scripts/lib/adhd.mjs +28 -0
  102. package/scripts/lib/adopt.mjs +474 -0
  103. package/scripts/lib/agent-lifecycle.mjs +163 -0
  104. package/scripts/lib/copilot-usage.mjs +49 -0
  105. package/scripts/lib/doctor.mjs +207 -0
  106. package/scripts/lib/feedback.mjs +30 -0
  107. package/scripts/lib/fsops.mjs +291 -0
  108. package/scripts/lib/gsd.mjs +42 -0
  109. package/scripts/lib/inventory.mjs +195 -0
  110. package/scripts/lib/lean-update.mjs +30 -0
  111. package/scripts/lib/migrate.mjs +407 -0
  112. package/scripts/lib/network.mjs +79 -0
  113. package/scripts/lib/node-runtime.mjs +85 -0
  114. package/scripts/lib/parallel.mjs +265 -0
  115. package/scripts/lib/pins.mjs +47 -0
  116. package/scripts/lib/project.mjs +38 -0
  117. package/scripts/lib/redact.mjs +30 -0
  118. package/scripts/lib/render.mjs +101 -0
  119. package/scripts/lib/system.mjs +178 -0
  120. package/scripts/lib/terminals.mjs +218 -0
  121. package/scripts/lib/ui.mjs +34 -0
  122. package/scripts/lib/unverified.mjs +49 -0
  123. package/scripts/lib/upgrade.mjs +130 -0
  124. package/scripts/lib/verify-commit.mjs +16 -0
  125. package/scripts/lib/verify-sha256.mjs +20 -0
  126. package/scripts/lint-workflows.mjs +25 -0
  127. package/scripts/models-refresh.mjs +58 -0
  128. package/scripts/parallel.mjs +59 -0
  129. package/scripts/pins-latest.mjs +43 -0
  130. package/scripts/release.mjs +46 -0
  131. package/scripts/verify-pins.mjs +36 -0
  132. package/scripts/version-watch.mjs +118 -0
@@ -0,0 +1,949 @@
1
+ import * as _clack_core from '@clack/core';
2
+ import { State, CANCEL_SYMBOL, AutocompletePrompt, Validate, DateFormat } from '@clack/core';
3
+ export { CANCEL_SYMBOL, ClackSettings, DateFormat, isCancel, settings, updateSettings } from '@clack/core';
4
+ import { Readable, Writable } from 'node:stream';
5
+
6
+ declare const unicode: boolean;
7
+ declare const isCI: () => boolean;
8
+ declare const isTTY: (output: Writable) => boolean;
9
+ declare const unicodeOr: (c: string, fallback: string) => string;
10
+ declare const S_STEP_ACTIVE: string;
11
+ declare const S_STEP_CANCEL: string;
12
+ declare const S_STEP_ERROR: string;
13
+ declare const S_STEP_SUBMIT: string;
14
+ declare const S_BAR_START: string;
15
+ declare const S_BAR: string;
16
+ declare const S_BAR_END: string;
17
+ declare const S_BAR_START_RIGHT: string;
18
+ declare const S_BAR_END_RIGHT: string;
19
+ declare const S_RADIO_ACTIVE: string;
20
+ declare const S_RADIO_INACTIVE: string;
21
+ declare const S_CHECKBOX_ACTIVE: string;
22
+ declare const S_CHECKBOX_SELECTED: string;
23
+ declare const S_CHECKBOX_INACTIVE: string;
24
+ declare const S_PASSWORD_MASK: string;
25
+ declare const S_BAR_H: string;
26
+ declare const S_CORNER_TOP_RIGHT: string;
27
+ declare const S_CONNECT_LEFT: string;
28
+ declare const S_CORNER_BOTTOM_RIGHT: string;
29
+ declare const S_CORNER_BOTTOM_LEFT: string;
30
+ declare const S_CORNER_TOP_LEFT: string;
31
+ declare const S_INFO: string;
32
+ declare const S_SUCCESS: string;
33
+ declare const S_WARN: string;
34
+ declare const S_ERROR: string;
35
+ declare const symbol: (state: State) => string;
36
+ declare const symbolBar: (state: State) => string | undefined;
37
+ interface CommonOptions {
38
+ input?: Readable;
39
+ output?: Writable;
40
+ signal?: AbortSignal;
41
+ withGuide?: boolean;
42
+ }
43
+ declare function formatInstructionFooter(instructions: string[], hasGuide: boolean): string[];
44
+
45
+ declare const SELECT_INSTRUCTIONS: string[];
46
+ type Primitive = Readonly<string | boolean | number>;
47
+ type Option<Value> = Value extends Primitive ? {
48
+ /**
49
+ * Internal data for this option.
50
+ */
51
+ value: Value;
52
+ /**
53
+ * The optional, user-facing text for this option.
54
+ *
55
+ * By default, the `value` is converted to a string.
56
+ */
57
+ label?: string;
58
+ /**
59
+ * An optional hint to display to the user when
60
+ * this option might be selected.
61
+ *
62
+ * By default, no `hint` is displayed.
63
+ */
64
+ hint?: string;
65
+ /**
66
+ * Whether this option is disabled.
67
+ * Disabled options are visible but cannot be selected.
68
+ *
69
+ * By default, options are not disabled.
70
+ */
71
+ disabled?: boolean;
72
+ } : {
73
+ /**
74
+ * Internal data for this option.
75
+ */
76
+ value: Value;
77
+ /**
78
+ * Required. The user-facing text for this option.
79
+ */
80
+ label: string;
81
+ /**
82
+ * An optional hint to display to the user when
83
+ * this option might be selected.
84
+ *
85
+ * By default, no `hint` is displayed.
86
+ */
87
+ hint?: string;
88
+ /**
89
+ * Whether this option is disabled.
90
+ * Disabled options are visible but cannot be selected.
91
+ *
92
+ * By default, options are not disabled.
93
+ */
94
+ disabled?: boolean;
95
+ };
96
+ interface SelectOptions<Value> extends CommonOptions {
97
+ message: string;
98
+ options: Option<Value>[];
99
+ initialValue?: Value;
100
+ maxItems?: number;
101
+ /**
102
+ * Show keyboard instructions below the option list.
103
+ * @default true
104
+ */
105
+ showInstructions?: boolean;
106
+ }
107
+ declare const select: <Value>(opts: SelectOptions<Value>) => Promise<Value | typeof CANCEL_SYMBOL>;
108
+
109
+ /**
110
+ * Options for the {@link autocomplete} prompt.
111
+ */
112
+ interface AutocompleteSharedOptions<Value> extends CommonOptions {
113
+ /**
114
+ * The message or question shown to the user above the input.
115
+ */
116
+ message: string;
117
+ /**
118
+ * The options to present, or a function that returns the options to present
119
+ * allowing for custom search/filtering.
120
+ *
121
+ * @see https://bomb.sh/docs/clack/packages/prompts/#dynamic-options-getter
122
+ */
123
+ options: Option<Value>[] | ((this: AutocompletePrompt<Option<Value>>) => Option<Value>[]);
124
+ /**
125
+ * The maximum number of items/options to display in the autocomplete list at once.
126
+ */
127
+ maxItems?: number;
128
+ /**
129
+ * Placeholder text displayed when the search field is empty. When set, pressing
130
+ * tab copies the placeholder into the input.
131
+ */
132
+ placeholder?: string;
133
+ /**
134
+ * A function or a [Standard Schema](https://github.com/standard-schema/standard-schema)
135
+ * that validates user input. If a custom function is given, you should return a `string` or `Error`
136
+ * to show as a validation error, or `undefined` to accept the result.
137
+ */
138
+ validate?: Validate<Value | Value[]>;
139
+ /**
140
+ * Custom filter function to match options against the search input.
141
+ */
142
+ filter?: (search: string, option: Option<Value>) => boolean;
143
+ }
144
+ interface AutocompleteOptions<Value> extends AutocompleteSharedOptions<Value> {
145
+ /**
146
+ * The initially selected option from the list.
147
+ */
148
+ initialValue?: Value;
149
+ /**
150
+ * The starting value shown in the users input box.
151
+ */
152
+ initialUserInput?: string;
153
+ /**
154
+ * When `true`, pressing Tab fills the input with the currently focused
155
+ * option's value, as if the user had typed it.
156
+ */
157
+ completeOnTab?: boolean;
158
+ }
159
+ /**
160
+ * The `autocomplete` prompt combines a text input with a searchable list of options.
161
+ * It's perfect for when you have a large list of options and want to help users
162
+ * find what they're looking for quickly.
163
+ *
164
+ * @see https://bomb.sh/docs/clack/packages/prompts/#autocomplete
165
+ *
166
+ * @example
167
+ * ```ts
168
+ * import { autocomplete } from '@clack/prompts';
169
+ *
170
+ * const framework = await autocomplete({
171
+ * message: 'Search for a framework',
172
+ * options: [
173
+ * { value: 'next', label: 'Next.js', hint: 'React framework' },
174
+ * { value: 'astro', label: 'Astro', hint: 'Content-focused' },
175
+ * { value: 'svelte', label: 'SvelteKit', hint: 'Compile-time framework' },
176
+ * { value: 'remix', label: 'Remix', hint: 'Full stack framework' },
177
+ * { value: 'nuxt', label: 'Nuxt', hint: 'Vue framework' },
178
+ * ],
179
+ * placeholder: 'Type to search...',
180
+ * maxItems: 5,
181
+ * });
182
+ * ```
183
+ */
184
+ declare const autocomplete: <Value>(opts: AutocompleteOptions<Value>) => Promise<Value | typeof CANCEL_SYMBOL>;
185
+ /**
186
+ * Options for the {@link autocompleteMultiselect} prompt
187
+ */
188
+ interface AutocompleteMultiSelectOptions<Value> extends AutocompleteSharedOptions<Value> {
189
+ /**
190
+ * The initially selected option(s) from the list.
191
+ */
192
+ initialValues?: Value[];
193
+ /**
194
+ * When `true` at least one option must be selected.
195
+ * @default false
196
+ */
197
+ required?: boolean;
198
+ }
199
+ /**
200
+ * The `autocompleteMultiselect` prompt combines the search functionality of autocomplete
201
+ * with the ability to select multiple options.
202
+ *
203
+ * @see https://bomb.sh/docs/clack/packages/prompts/#autocomplete-multiselect
204
+ *
205
+ * @example
206
+ * ```ts
207
+ * import { autocompleteMultiselect } from '@clack/prompts';
208
+ *
209
+ * const frameworks = await autocompleteMultiselect({
210
+ * message: 'Select frameworks',
211
+ * options: [
212
+ * { value: 'next', label: 'Next.js', hint: 'React framework' },
213
+ * { value: 'astro', label: 'Astro', hint: 'Content-focused' },
214
+ * { value: 'svelte', label: 'SvelteKit', hint: 'Compile-time framework' },
215
+ * { value: 'remix', label: 'Remix', hint: 'Full stack framework' },
216
+ * { value: 'nuxt', label: 'Nuxt', hint: 'Vue framework' },
217
+ * ],
218
+ * placeholder: 'Type to search...',
219
+ * maxItems: 5,
220
+ * });
221
+ * ```
222
+ */
223
+ declare const autocompleteMultiselect: <Value>(opts: AutocompleteMultiSelectOptions<Value>) => Promise<Value[] | typeof CANCEL_SYMBOL>;
224
+
225
+ /**
226
+ * Alignment for content or titles within the box.
227
+ */
228
+ type BoxAlignment = 'left' | 'center' | 'right';
229
+ /**
230
+ * Options for the {@link box} prompt.
231
+ */
232
+ interface BoxOptions extends CommonOptions {
233
+ /**
234
+ * Alignment of the content (`'left'`, `'center'`, or `'right'`).
235
+ * @default 'left'
236
+ */
237
+ contentAlign?: BoxAlignment;
238
+ /**
239
+ * Alignment of the title (`'left'`, `'center'`, or `'right'`).
240
+ * @default 'left'
241
+ */
242
+ titleAlign?: BoxAlignment;
243
+ /**
244
+ * The width of the box, either `'auto'` to fit the content or a number for a fixed width.
245
+ * @default 'auto'
246
+ */
247
+ width?: number | 'auto';
248
+ /**
249
+ * Padding around the title.
250
+ * @default 1
251
+ */
252
+ titlePadding?: number;
253
+ /**
254
+ * Padding around the content.
255
+ * @default 2
256
+ */
257
+ contentPadding?: number;
258
+ /**
259
+ * Use rounded corners when `true`, square corners when `false`.
260
+ * @default true
261
+ */
262
+ rounded?: boolean;
263
+ /**
264
+ * Custom function to style the border characters.
265
+ */
266
+ formatBorder?: (text: string) => string;
267
+ }
268
+ /**
269
+ * Renders a customizable box around text content. It's similar to {@link note} but offers
270
+ * more styling options.
271
+ *
272
+ * @see https://bomb.sh/docs/clack/packages/prompts/#box
273
+ *
274
+ * @param message - The content to display inside the box.
275
+ * @param title - The title to display in the top border of the box.
276
+ * @param opts - Optional configuration for the box styling and behavior.
277
+ *
278
+ * @example
279
+ * ```ts
280
+ * import { box } from '@clack/prompts';
281
+ *
282
+ * box('This is the content of the box', 'Box Title', {
283
+ * contentAlign: 'center',
284
+ * titleAlign: 'center',
285
+ * width: 'auto',
286
+ * rounded: true,
287
+ * });
288
+ * ```
289
+ */
290
+ declare const box: (message?: string, title?: string, opts?: BoxOptions) => void;
291
+
292
+ /**
293
+ * Options for the {@link confirm} prompt.
294
+ */
295
+ interface ConfirmOptions extends CommonOptions {
296
+ /**
297
+ * The message or question shown to the user above the input.
298
+ */
299
+ message: string;
300
+ /**
301
+ * The label to use for the active (true) option.
302
+ * @default 'Yes'
303
+ */
304
+ active?: string;
305
+ /**
306
+ * The label to use for the inactive (false) option.
307
+ * @default 'No'
308
+ */
309
+ inactive?: string;
310
+ /**
311
+ * The initial selected value (true or false).
312
+ * @default true
313
+ */
314
+ initialValue?: boolean;
315
+ /**
316
+ * Whether to render the options vertically instead of horizontally.
317
+ * @default false
318
+ */
319
+ vertical?: boolean;
320
+ }
321
+ /**
322
+ * The `confirm` prompt accepts a yes or no choice, returning a boolean value
323
+ * corresponding to the user's selection.
324
+ *
325
+ * @see https://bomb.sh/docs/clack/packages/prompts/#confirmation
326
+ *
327
+ * @example
328
+ * ```ts
329
+ * import { confirm } from '@clack/prompts';
330
+ *
331
+ * const shouldProceed = await confirm({
332
+ * message: 'Do you want to continue?',
333
+ * });
334
+ * ```
335
+ */
336
+ declare const confirm: (opts: ConfirmOptions) => Promise<boolean | typeof CANCEL_SYMBOL>;
337
+
338
+ /**
339
+ * Options for the {@link date} prompt.
340
+ */
341
+ interface DateOptions extends CommonOptions {
342
+ /**
343
+ * The message or question shown to the user above the input.
344
+ */
345
+ message: string;
346
+ /**
347
+ * The date format for the input segments.
348
+ * @deafult based on locale
349
+ */
350
+ format?: DateFormat;
351
+ /**
352
+ * The BCP 47 language tag to use for formatting
353
+ * @see https://developer.mozilla.org/en-US/docs/Glossary/BCP_47_language_tag
354
+ * @example "en-GB"
355
+ */
356
+ locale?: string;
357
+ /**
358
+ * The default value returned when the user doesn't select a date.
359
+ */
360
+ defaultValue?: Date;
361
+ /**
362
+ * The starting date shown when the prompt first renders.
363
+ * Users can edit this value before submitting.
364
+ */
365
+ initialValue?: Date;
366
+ /**
367
+ * The minimum allowed date for validation.
368
+ */
369
+ minDate?: Date;
370
+ /**
371
+ * The maximum allowed date for validation.
372
+ */
373
+ maxDate?: Date;
374
+ /**
375
+ * A function or a [Standard Schema](https://github.com/standard-schema/standard-schema)
376
+ * that validates user input. If a custom function is given, you should return a `string` or `Error`
377
+ * to show as a validation error, or `undefined` to accept the result.
378
+ */
379
+ validate?: Validate<Date>;
380
+ }
381
+ /**
382
+ * The `date` prompt provides an interactive date picker, allowing users
383
+ * to navigate between year, month, and day segments and
384
+ * increment/decrement values using keyboard controls.
385
+ *
386
+ * @see https://bomb.sh/docs/clack/packages/prompts/#date-input
387
+ *
388
+ * @example
389
+ * ```ts
390
+ * import { date } from '@clack/prompts';
391
+ *
392
+ * const birthday = await date({
393
+ * message: 'Pick your birthday',
394
+ * minDate: new Date('1900-01-01'),
395
+ * initialValue: new Date(),
396
+ * maxDate: new Date(),
397
+ * });
398
+ * ```
399
+ */
400
+ declare const date: (opts: DateOptions) => Promise<Date | typeof CANCEL_SYMBOL>;
401
+
402
+ type Prettify<T> = {
403
+ [P in keyof T]: T[P];
404
+ } & {};
405
+ /**
406
+ * The return type of a {@link PromptGroup}.
407
+ * Resolves all prompt results, excluding the cancel symbol.
408
+ */
409
+ type PromptGroupAwaitedReturn<T> = {
410
+ [P in keyof T]: Exclude<Awaited<T[P]>, symbol>;
411
+ };
412
+ /**
413
+ * Options for the {@link group} utility.
414
+ */
415
+ interface PromptGroupOptions<T> {
416
+ /**
417
+ * Called when any one of the prompts is canceled.
418
+ */
419
+ onCancel?: (opts: {
420
+ results: Prettify<Partial<PromptGroupAwaitedReturn<T>>>;
421
+ }) => void;
422
+ }
423
+ /**
424
+ * A group of prompts to be displayed sequentially, with each prompt receiving
425
+ * the results of all previous prompts in the group.
426
+ */
427
+ type PromptGroup<T> = {
428
+ [P in keyof T]: (opts: {
429
+ results: Prettify<Partial<PromptGroupAwaitedReturn<Omit<T, P>>>>;
430
+ }) => undefined | Promise<T[P] | undefined>;
431
+ };
432
+ /**
433
+ * The `group` utility provides a consistent way to combine a series of prompts,
434
+ * combining each answer into one object. Each prompt receives the results of
435
+ * all previously completed prompts, and are displayed sequentially.
436
+ *
437
+ * @see https://bomb.sh/docs/clack/packages/prompts/#group
438
+ *
439
+ * @example
440
+ * ```ts
441
+ * import { group, text, password } from '@clack/prompts';
442
+ *
443
+ * const account = await group({
444
+ * email: () => text({
445
+ * message: 'What is your email address?',
446
+ * }),
447
+ * username: ({ results }) => text({
448
+ * message: 'What is your username?',
449
+ * placeholder: results.email?.replace(/@.+$/, '').toLowerCase() ?? '',
450
+ * }),
451
+ * password: () => password({
452
+ * message: 'Define your password',
453
+ * }),
454
+ * });
455
+ * ```
456
+ */
457
+ declare const group: <T>(prompts: PromptGroup<T>, opts?: PromptGroupOptions<T>) => Promise<Prettify<PromptGroupAwaitedReturn<T>>>;
458
+
459
+ /**
460
+ * Options for the {@link groupMultiselect} prompt.
461
+ */
462
+ interface GroupMultiSelectOptions<Value> extends CommonOptions {
463
+ /**
464
+ * The message or question shown to the user above the input.
465
+ */
466
+ message: string;
467
+ /**
468
+ * Grouped options to display. Each key is a group label, and each value is an array of options.
469
+ */
470
+ options: Record<string, Option<Value>[]>;
471
+ /**
472
+ * The initially selected option(s).
473
+ */
474
+ initialValues?: Value[];
475
+ /**
476
+ * The maximum number of items/options to display at once.
477
+ */
478
+ maxItems?: number;
479
+ /**
480
+ * When `true` at least one option must be selected.
481
+ * @default true
482
+ */
483
+ required?: boolean;
484
+ /**
485
+ * The value the cursor should be positioned at initially.
486
+ */
487
+ cursorAt?: Value;
488
+ /**
489
+ * Whether entire groups can be selected at once.
490
+ * @default true
491
+ */
492
+ selectableGroups?: boolean;
493
+ /**
494
+ * Number of blank lines between groups.
495
+ * @default 0
496
+ */
497
+ groupSpacing?: number;
498
+ /**
499
+ * Show keyboard instructions below the option list.
500
+ * @default true
501
+ */
502
+ showInstructions?: boolean;
503
+ }
504
+ /**
505
+ * The `groupMultiselect` prompt extends the {@link multiselect} prompt to allow
506
+ * arranging distinct Multi-Selects, whilst keeping all of them interactive.
507
+ *
508
+ * @see https://bomb.sh/docs/clack/packages/prompts/#group-multiselect
509
+ *
510
+ * @example
511
+ * ```ts
512
+ * import { groupMultiselect } from '@clack/prompts';
513
+ *
514
+ * const result = await groupMultiselect({
515
+ * message: 'Define your project',
516
+ * options: {
517
+ * 'Testing': [
518
+ * { value: 'Jest', hint: 'JavaScript testing framework' },
519
+ * { value: 'Playwright', hint: 'End-to-end testing' },
520
+ * ],
521
+ * 'Language': [
522
+ * { value: 'js', label: 'JavaScript', hint: 'Dynamic typing' },
523
+ * { value: 'ts', label: 'TypeScript', hint: 'Static typing' },
524
+ * ],
525
+ * },
526
+ * });
527
+ * ```
528
+ *
529
+ * @param opts The options for the group multiselect prompt
530
+ */
531
+ declare const groupMultiselect: <Value>(opts: GroupMultiSelectOptions<Value>) => Promise<Value[] | typeof CANCEL_SYMBOL>;
532
+
533
+ /**
534
+ * Options for the {@link limitOptions} function.
535
+ */
536
+ interface LimitOptionsParams<TOption> extends CommonOptions {
537
+ /**
538
+ * The list of options to display.
539
+ */
540
+ options: TOption[];
541
+ /**
542
+ * The index of the currently active/selected option.
543
+ */
544
+ cursor: number;
545
+ /**
546
+ * A function that styles the given option string.
547
+ *
548
+ * @param option - The option string to style.
549
+ * @param active - Whether the option is currently selected.
550
+ */
551
+ style: (option: TOption, active: boolean) => string;
552
+ /**
553
+ * Maximum number of options to display at once.
554
+ * @default Infinity
555
+ */
556
+ maxItems?: number;
557
+ /**
558
+ * Number of columns to reserve for padding.
559
+ * @default 0
560
+ */
561
+ columnPadding?: number;
562
+ /**
563
+ * Number of rows to reserve for padding.
564
+ * @default 4
565
+ */
566
+ rowPadding?: number;
567
+ }
568
+ /**
569
+ * Trims an option list to what fits the terminal, while keeping the active
570
+ * option (cursor) visible using a Clack style sliding window.
571
+ *
572
+ * @returns The lines to render.
573
+ *
574
+ * @see https://bomb.sh/docs/clack/packages/prompts/#limitoptions
575
+ *
576
+ * @example
577
+ * ```ts
578
+ * import { limitOptions } from '@clack/prompts';
579
+ * import { styleText } from 'node:util';
580
+ *
581
+ * const options = ['apple', 'banana', 'cherry', 'date'];
582
+ * const lines = limitOptions({
583
+ * options,
584
+ * cursor: 2,
585
+ * maxItems: 8,
586
+ * style: (opt, active) =>
587
+ * active ? styleText('cyan', opt) : styleText('dim', opt),
588
+ * });
589
+ * ```
590
+ */
591
+ declare const limitOptions: <TOption>({ cursor, options, style, output, maxItems, columnPadding, rowPadding, }: LimitOptionsParams<TOption>) => string[];
592
+
593
+ interface LogMessageOptions extends CommonOptions {
594
+ symbol?: string;
595
+ spacing?: number;
596
+ secondarySymbol?: string;
597
+ }
598
+ declare const log: {
599
+ message: (message?: string | string[], { symbol, secondarySymbol, output, spacing, withGuide, }?: LogMessageOptions) => void;
600
+ info: (message: string, opts?: LogMessageOptions) => void;
601
+ success: (message: string, opts?: LogMessageOptions) => void;
602
+ step: (message: string, opts?: LogMessageOptions) => void;
603
+ warn: (message: string, opts?: LogMessageOptions) => void;
604
+ /** alias for `log.warn()`. */
605
+ warning: (message: string, opts?: LogMessageOptions) => void;
606
+ error: (message: string, opts?: LogMessageOptions) => void;
607
+ };
608
+
609
+ /**
610
+ * The `cancel` function defines an interruption of an interaction
611
+ * and therefore its end.
612
+ *
613
+ * @param title Optional closing message to be displayed.
614
+ * @param opts Additional configuration options.
615
+ *
616
+ * @see https://bomb.sh/docs/clack/packages/prompts/#cancel
617
+ *
618
+ * @example
619
+ * ```ts
620
+ * import { cancel } from '@clack/prompts';
621
+ * import process from 'node:process';
622
+ *
623
+ * cancel('Installation canceled');
624
+ * process.exit(1);
625
+ * ```
626
+ */
627
+ declare const cancel: (message?: string, opts?: CommonOptions) => void;
628
+ /**
629
+ * The `intro` function defines the beginning of an interaction.
630
+ *
631
+ * @param title Optional title to be displayed.
632
+ * @param opts Additional configuration options.
633
+ *
634
+ * @see https://bomb.sh/docs/clack/packages/prompts/#intro
635
+ *
636
+ * @example
637
+ * ```ts
638
+ * import { intro } from '@clack/prompts';
639
+ *
640
+ * intro('Welcome to clack');
641
+ * ```
642
+ */
643
+ declare const intro: (title?: string, opts?: CommonOptions) => void;
644
+ /**
645
+ * The `outro` function defines the end of an interaction.
646
+ *
647
+ * @param title Optional closing message to be displayed.
648
+ * @param opts Additional configuration options.
649
+ *
650
+ * @see https://bomb.sh/docs/clack/packages/prompts/#outro
651
+ *
652
+ * @example
653
+ * ```ts
654
+ * import { outro } from '@clack/prompts';
655
+ *
656
+ * outro('All operations are finished');
657
+ * ```
658
+ */
659
+ declare const outro: (message?: string, opts?: CommonOptions) => void;
660
+
661
+ /**
662
+ * Options for the {@link text} prompt
663
+ */
664
+ interface TextOptions extends CommonOptions {
665
+ /**
666
+ * The prompt message or question shown to the user above the input.
667
+ */
668
+ message: string;
669
+ /**
670
+ * A visual hint shown when the field has no content.
671
+ */
672
+ placeholder?: string;
673
+ /**
674
+ * A fallback value returned when the user provides nothing (empty input).
675
+ */
676
+ defaultValue?: string;
677
+ /**
678
+ * The starting value shown when the prompt first renders.
679
+ * Users can edit this value before submitting.
680
+ */
681
+ initialValue?: string;
682
+ /**
683
+ * A function or a [Standard Schema](https://github.com/standard-schema/standard-schema)
684
+ * that validates user input. If a custom function is given, you should return a `string` or `Error`
685
+ * to show as a validation error, or `undefined` to accept the result.
686
+ */
687
+ validate?: Validate<string>;
688
+ }
689
+ /**
690
+ * The text prompt accepts a single line of text.
691
+ *
692
+ * @see https://bomb.sh/docs/clack/packages/prompts/#text-input
693
+ *
694
+ * @example
695
+ * ```ts
696
+ * import { text } from '@clack/prompts';
697
+ *
698
+ * const name = await text({
699
+ * message: 'What is your name?',
700
+ * placeholder: 'John Doe',
701
+ * validate: (value) => {
702
+ * if (!value || value.length < 2) return 'Name must be at least 2 characters';
703
+ * return undefined;
704
+ * },
705
+ * });
706
+ * ```
707
+ */
708
+ declare const text: (opts: TextOptions) => Promise<string | typeof CANCEL_SYMBOL>;
709
+
710
+ /**
711
+ * Options for the {@link multiline} prompt
712
+ */
713
+ interface MultiLineOptions extends TextOptions {
714
+ /**
715
+ * When enabled it shows a `[ submit ]` button that can be focused with tab.
716
+ * By default, pressing `Enter` twice submits the input
717
+ *
718
+ * @default false
719
+ */
720
+ showSubmit?: boolean;
721
+ }
722
+ /**
723
+ * The multi-line prompt accepts multiple lines of text input.
724
+ * By default, pressing `Enter` twice submits the input.
725
+ *
726
+ * @see https://bomb.sh/docs/clack/packages/prompts/#multi-line-text
727
+ *
728
+ * @example
729
+ * ```ts
730
+ * import { multiline } from '@clack/prompts';
731
+ *
732
+ * const bio = await multiline({
733
+ * message: 'Enter your bio',
734
+ * placeholder: 'Tell us about yourself...',
735
+ * showSubmit: true,
736
+ * });
737
+ * ```
738
+ */
739
+ declare const multiline: (opts: MultiLineOptions) => Promise<string | typeof CANCEL_SYMBOL>;
740
+
741
+ declare const MULTISELECT_INSTRUCTIONS: string[];
742
+ interface MultiSelectOptions<Value> extends CommonOptions {
743
+ message: string;
744
+ options: Option<Value>[];
745
+ initialValues?: Value[];
746
+ maxItems?: number;
747
+ required?: boolean;
748
+ cursorAt?: Value;
749
+ /**
750
+ * Show keyboard instructions below the option list.
751
+ * @default true
752
+ */
753
+ showInstructions?: boolean;
754
+ }
755
+ declare const multiselect: <Value>(opts: MultiSelectOptions<Value>) => Promise<Value[] | typeof CANCEL_SYMBOL>;
756
+
757
+ type FormatFn = (line: string) => string;
758
+ interface NoteOptions extends CommonOptions {
759
+ format?: FormatFn;
760
+ }
761
+ declare const note: (message?: string, title?: string, opts?: NoteOptions) => void;
762
+
763
+ /**
764
+ * Options for the {@link password} prompt
765
+ */
766
+ interface PasswordOptions extends CommonOptions {
767
+ /**
768
+ * The prompt message or question shown to the user above the input.
769
+ */
770
+ message: string;
771
+ /**
772
+ * Character to use for masking input.
773
+ * @default ▪/•
774
+ */
775
+ mask?: string;
776
+ /**
777
+ * A function or a [Standard Schema](https://github.com/standard-schema/standard-schema)
778
+ * that validates user input. If a custom function is given, you should return a `string` or `Error`
779
+ * to show as a validation error, or `undefined` to accept the result.
780
+ */
781
+ validate?: Validate<string>;
782
+ /**
783
+ * When enabled it causes the input to be cleared if/when validation fails.
784
+ * @default false
785
+ */
786
+ clearOnError?: boolean;
787
+ }
788
+ /**
789
+ * The password prompt behaves like the {@link text} prompt, but the input is masked.
790
+ *
791
+ * @see https://bomb.sh/docs/clack/packages/prompts/#password-input
792
+ *
793
+ * @example
794
+ * ```ts
795
+ * import { password } from '@clack/prompts';
796
+ *
797
+ * const result = await password({
798
+ * message: 'Enter your password',
799
+ * });
800
+ * ```
801
+ */
802
+ declare const password: (opts: PasswordOptions) => Promise<string | typeof CANCEL_SYMBOL>;
803
+
804
+ /**
805
+ * Options for the {@link path} prompt.
806
+ */
807
+ interface PathOptions extends CommonOptions {
808
+ /**
809
+ * The message or question shown to the user above the input.
810
+ */
811
+ message: string;
812
+ /**
813
+ * The starting directory for path suggestions (defaults to current working directory).
814
+ */
815
+ root?: string;
816
+ /**
817
+ * When `true` only **directories** appear in suggestions while you navigate.
818
+ */
819
+ directory?: boolean;
820
+ /**
821
+ * The starting path shown when the prompt first renders, which users can edit
822
+ * before submitting. If not provided it will fall back to the given `root`,
823
+ * or the current working directory.
824
+ *
825
+ * In `directory` mode, if the initial value points to a directory that exists,
826
+ * pressing enter will submit the input instead of jumping to the first child.
827
+ */
828
+ initialValue?: string;
829
+ /**
830
+ * A function or a [Standard Schema](https://github.com/standard-schema/standard-schema)
831
+ * that validates user input. If a custom function is given, you should return a `string` or `Error`
832
+ * to show as a validation error, or `undefined` to accept the result.
833
+ */
834
+ validate?: Validate<string>;
835
+ }
836
+ /**
837
+ * The `path` prompt extends `autocomplete` to provide file and directory suggestions.
838
+ *
839
+ * @see https://bomb.sh/docs/clack/packages/prompts/#path-selection
840
+ *
841
+ * @example
842
+ * ```ts
843
+ * import { path } from '@clack/prompts';
844
+ *
845
+ * const result = await path({
846
+ * message: 'Select a file:',
847
+ * root: process.cwd(),
848
+ * directory: false,
849
+ * });
850
+ * ```
851
+ */
852
+ declare const path: (opts: PathOptions) => Promise<string | typeof _clack_core.CANCEL_SYMBOL>;
853
+
854
+ interface SpinnerOptions extends CommonOptions {
855
+ indicator?: 'dots' | 'timer';
856
+ onCancel?: () => void;
857
+ cancelMessage?: string;
858
+ errorMessage?: string;
859
+ frames?: string[];
860
+ delay?: number;
861
+ styleFrame?: (frame: string) => string;
862
+ }
863
+ interface SpinnerResult {
864
+ start(msg?: string): void;
865
+ stop(msg?: string): void;
866
+ cancel(msg?: string): void;
867
+ error(msg?: string): void;
868
+ message(msg?: string): void;
869
+ clear(): void;
870
+ readonly isCancelled: boolean;
871
+ }
872
+ declare const spinner: ({ indicator, onCancel, output, cancelMessage, errorMessage, frames, delay, signal, ...opts }?: SpinnerOptions) => SpinnerResult;
873
+
874
+ interface ProgressOptions extends SpinnerOptions {
875
+ style?: 'light' | 'heavy' | 'block';
876
+ max?: number;
877
+ size?: number;
878
+ }
879
+ interface ProgressResult extends SpinnerResult {
880
+ advance(step?: number, msg?: string): void;
881
+ }
882
+ declare function progress({ style, max: userMax, size: userSize, ...spinnerOptions }?: ProgressOptions): ProgressResult;
883
+
884
+ interface SelectKeyOptions<Value extends string> extends CommonOptions {
885
+ message: string;
886
+ options: Option<Value>[];
887
+ initialValue?: Value;
888
+ caseSensitive?: boolean;
889
+ }
890
+ declare const selectKey: <Value extends string>(opts: SelectKeyOptions<Value>) => Promise<Value | typeof CANCEL_SYMBOL>;
891
+
892
+ declare const stream: {
893
+ message: (iterable: Iterable<string> | AsyncIterable<string>, { symbol }?: LogMessageOptions) => Promise<void>;
894
+ info: (iterable: Iterable<string> | AsyncIterable<string>) => Promise<void>;
895
+ success: (iterable: Iterable<string> | AsyncIterable<string>) => Promise<void>;
896
+ step: (iterable: Iterable<string> | AsyncIterable<string>) => Promise<void>;
897
+ warn: (iterable: Iterable<string> | AsyncIterable<string>) => Promise<void>;
898
+ /** alias for `log.warn()`. */
899
+ warning: (iterable: Iterable<string> | AsyncIterable<string>) => Promise<void>;
900
+ error: (iterable: Iterable<string> | AsyncIterable<string>) => Promise<void>;
901
+ };
902
+
903
+ type Task = {
904
+ /**
905
+ * Task title
906
+ */
907
+ title: string;
908
+ /**
909
+ * Task function
910
+ */
911
+ task: (message: (string: string) => void) => string | Promise<string> | void | Promise<void>;
912
+ /**
913
+ * If enabled === false the task will be skipped
914
+ */
915
+ enabled?: boolean;
916
+ };
917
+ /**
918
+ * Define a group of tasks to be executed
919
+ */
920
+ declare const tasks: (tasks: Task[], opts?: CommonOptions) => Promise<void>;
921
+
922
+ interface TaskLogOptions extends CommonOptions {
923
+ title: string;
924
+ limit?: number;
925
+ spacing?: number;
926
+ retainLog?: boolean;
927
+ }
928
+ interface TaskLogMessageOptions {
929
+ raw?: boolean;
930
+ }
931
+ interface TaskLogCompletionOptions {
932
+ showLog?: boolean;
933
+ }
934
+ /**
935
+ * Renders a log which clears on success and remains on failure
936
+ */
937
+ declare const taskLog: (opts: TaskLogOptions) => {
938
+ message(msg: string, mopts?: TaskLogMessageOptions): void;
939
+ group(name: string): {
940
+ message(msg: string, mopts?: TaskLogMessageOptions): void;
941
+ error(message: string): void;
942
+ success(message: string): void;
943
+ };
944
+ error(message: string, opts?: TaskLogCompletionOptions): void;
945
+ success(message: string, opts?: TaskLogCompletionOptions): void;
946
+ };
947
+
948
+ export { MULTISELECT_INSTRUCTIONS, SELECT_INSTRUCTIONS, S_BAR, S_BAR_END, S_BAR_END_RIGHT, S_BAR_H, S_BAR_START, S_BAR_START_RIGHT, S_CHECKBOX_ACTIVE, S_CHECKBOX_INACTIVE, S_CHECKBOX_SELECTED, S_CONNECT_LEFT, S_CORNER_BOTTOM_LEFT, S_CORNER_BOTTOM_RIGHT, S_CORNER_TOP_LEFT, S_CORNER_TOP_RIGHT, S_ERROR, S_INFO, S_PASSWORD_MASK, S_RADIO_ACTIVE, S_RADIO_INACTIVE, S_STEP_ACTIVE, S_STEP_CANCEL, S_STEP_ERROR, S_STEP_SUBMIT, S_SUCCESS, S_WARN, autocomplete, autocompleteMultiselect, box, cancel, confirm, date, formatInstructionFooter, group, groupMultiselect, intro, isCI, isTTY, limitOptions, log, multiline, multiselect, note, outro, password, path, progress, select, selectKey, spinner, stream, symbol, symbolBar, taskLog, tasks, text, unicode, unicodeOr };
949
+ export type { AutocompleteMultiSelectOptions, AutocompleteOptions, BoxAlignment, BoxOptions, CommonOptions, ConfirmOptions, DateOptions, GroupMultiSelectOptions, LimitOptionsParams, LogMessageOptions, MultiLineOptions, MultiSelectOptions, NoteOptions, Option, PasswordOptions, PathOptions, ProgressOptions, ProgressResult, PromptGroup, PromptGroupAwaitedReturn, PromptGroupOptions, SelectKeyOptions, SelectOptions, SpinnerOptions, SpinnerResult, Task, TaskLogCompletionOptions, TaskLogMessageOptions, TaskLogOptions, TextOptions };