@hstm-labs/forge-cli 0.1.11
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 +56 -0
- package/dist/cli.d.ts +9 -0
- package/dist/cli.d.ts.map +1 -0
- package/dist/cli.js +14 -0
- package/dist/cli.js.map +1 -0
- package/dist/commands/deliver.d.ts +14 -0
- package/dist/commands/deliver.d.ts.map +1 -0
- package/dist/commands/deliver.js +92 -0
- package/dist/commands/deliver.js.map +1 -0
- package/dist/commands/generate.d.ts +14 -0
- package/dist/commands/generate.d.ts.map +1 -0
- package/dist/commands/generate.js +168 -0
- package/dist/commands/generate.js.map +1 -0
- package/dist/commands/init.d.ts +15 -0
- package/dist/commands/init.d.ts.map +1 -0
- package/dist/commands/init.js +83 -0
- package/dist/commands/init.js.map +1 -0
- package/dist/commands/profile.d.ts +11 -0
- package/dist/commands/profile.d.ts.map +1 -0
- package/dist/commands/profile.js +35 -0
- package/dist/commands/profile.js.map +1 -0
- package/dist/commands/status.d.ts +14 -0
- package/dist/commands/status.d.ts.map +1 -0
- package/dist/commands/status.js +104 -0
- package/dist/commands/status.js.map +1 -0
- package/dist/commands/template.d.ts +11 -0
- package/dist/commands/template.d.ts.map +1 -0
- package/dist/commands/template.js +25 -0
- package/dist/commands/template.js.map +1 -0
- package/dist/commands/verify.d.ts +15 -0
- package/dist/commands/verify.d.ts.map +1 -0
- package/dist/commands/verify.js +167 -0
- package/dist/commands/verify.js.map +1 -0
- package/dist/error-handler.d.ts +16 -0
- package/dist/error-handler.d.ts.map +1 -0
- package/dist/error-handler.js +43 -0
- package/dist/error-handler.js.map +1 -0
- package/dist/formatters/agent-mode-formatter.d.ts +167 -0
- package/dist/formatters/agent-mode-formatter.d.ts.map +1 -0
- package/dist/formatters/agent-mode-formatter.js +271 -0
- package/dist/formatters/agent-mode-formatter.js.map +1 -0
- package/dist/formatters/run-status-formatter.d.ts +53 -0
- package/dist/formatters/run-status-formatter.d.ts.map +1 -0
- package/dist/formatters/run-status-formatter.js +267 -0
- package/dist/formatters/run-status-formatter.js.map +1 -0
- package/dist/index.d.ts +5 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +5 -0
- package/dist/index.js.map +1 -0
- package/dist/output.d.ts +60 -0
- package/dist/output.d.ts.map +1 -0
- package/dist/output.js +78 -0
- package/dist/output.js.map +1 -0
- package/dist/program.d.ts +14 -0
- package/dist/program.d.ts.map +1 -0
- package/dist/program.js +64 -0
- package/dist/program.js.map +1 -0
- package/dist/progress-bar.d.ts +18 -0
- package/dist/progress-bar.d.ts.map +1 -0
- package/dist/progress-bar.js +28 -0
- package/dist/progress-bar.js.map +1 -0
- package/dist/progress-reporter.d.ts +35 -0
- package/dist/progress-reporter.d.ts.map +1 -0
- package/dist/progress-reporter.js +236 -0
- package/dist/progress-reporter.js.map +1 -0
- package/dist/prompts/init-prompts.d.ts +22 -0
- package/dist/prompts/init-prompts.d.ts.map +1 -0
- package/dist/prompts/init-prompts.js +78 -0
- package/dist/prompts/init-prompts.js.map +1 -0
- package/dist/prompts/layout-prompts.d.ts +15 -0
- package/dist/prompts/layout-prompts.d.ts.map +1 -0
- package/dist/prompts/layout-prompts.js +26 -0
- package/dist/prompts/layout-prompts.js.map +1 -0
- package/package.json +46 -0
package/dist/output.d.ts
ADDED
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Output formatting utilities for the Forge CLI.
|
|
3
|
+
*
|
|
4
|
+
* Uses chalk for colored terminal output with redundant encoding
|
|
5
|
+
* (color + symbol) for accessibility. Respects `--no-color` and
|
|
6
|
+
* the `NO_COLOR` environment variable.
|
|
7
|
+
*/
|
|
8
|
+
/** Shared CLI options accessible to all commands. */
|
|
9
|
+
export interface GlobalOptions {
|
|
10
|
+
json: boolean;
|
|
11
|
+
quiet: boolean;
|
|
12
|
+
verbose: boolean;
|
|
13
|
+
color: boolean;
|
|
14
|
+
noInput: boolean;
|
|
15
|
+
logLevel?: string | undefined;
|
|
16
|
+
}
|
|
17
|
+
/** Default global options. */
|
|
18
|
+
export declare const globalOptions: GlobalOptions;
|
|
19
|
+
/**
|
|
20
|
+
* Apply color settings based on global options and environment.
|
|
21
|
+
*
|
|
22
|
+
* Call after parsing CLI flags to disable chalk when `--no-color`
|
|
23
|
+
* is set or the `NO_COLOR` environment variable is present.
|
|
24
|
+
*/
|
|
25
|
+
export declare function applyColorSettings(): void;
|
|
26
|
+
/**
|
|
27
|
+
* Format a success message with green check mark.
|
|
28
|
+
*
|
|
29
|
+
* @param message - The success message
|
|
30
|
+
* @returns Formatted string with `✓` prefix
|
|
31
|
+
*/
|
|
32
|
+
export declare function formatSuccess(message: string): string;
|
|
33
|
+
/**
|
|
34
|
+
* Format an error message with red X.
|
|
35
|
+
*
|
|
36
|
+
* @param message - The error message
|
|
37
|
+
* @returns Formatted string with `✗` prefix
|
|
38
|
+
*/
|
|
39
|
+
export declare function formatError(message: string): string;
|
|
40
|
+
/**
|
|
41
|
+
* Format a warning message with yellow triangle.
|
|
42
|
+
*
|
|
43
|
+
* @param message - The warning message
|
|
44
|
+
* @returns Formatted string with `⚠` prefix
|
|
45
|
+
*/
|
|
46
|
+
export declare function formatWarning(message: string): string;
|
|
47
|
+
/**
|
|
48
|
+
* Format an info message with blue info symbol.
|
|
49
|
+
*
|
|
50
|
+
* @param message - The info message
|
|
51
|
+
* @returns Formatted string with `ℹ` prefix
|
|
52
|
+
*/
|
|
53
|
+
export declare function formatInfo(message: string): string;
|
|
54
|
+
/**
|
|
55
|
+
* Print data as formatted JSON to stdout.
|
|
56
|
+
*
|
|
57
|
+
* @param data - Data to serialize and print
|
|
58
|
+
*/
|
|
59
|
+
export declare function printJson(data: unknown): void;
|
|
60
|
+
//# sourceMappingURL=output.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"output.d.ts","sourceRoot":"","sources":["../src/output.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAQH,qDAAqD;AACrD,MAAM,WAAW,aAAa;IAC5B,IAAI,EAAE,OAAO,CAAC;IACd,KAAK,EAAE,OAAO,CAAC;IACf,OAAO,EAAE,OAAO,CAAC;IACjB,KAAK,EAAE,OAAO,CAAC;IACf,OAAO,EAAE,OAAO,CAAC;IACjB,QAAQ,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;CAC/B;AAED,8BAA8B;AAC9B,eAAO,MAAM,aAAa,EAAE,aAM3B,CAAC;AAMF;;;;;GAKG;AACH,wBAAgB,kBAAkB,IAAI,IAAI,CAIzC;AAMD;;;;;GAKG;AACH,wBAAgB,aAAa,CAAC,OAAO,EAAE,MAAM,GAAG,MAAM,CAErD;AAED;;;;;GAKG;AACH,wBAAgB,WAAW,CAAC,OAAO,EAAE,MAAM,GAAG,MAAM,CAEnD;AAED;;;;;GAKG;AACH,wBAAgB,aAAa,CAAC,OAAO,EAAE,MAAM,GAAG,MAAM,CAErD;AAED;;;;;GAKG;AACH,wBAAgB,UAAU,CAAC,OAAO,EAAE,MAAM,GAAG,MAAM,CAElD;AAED;;;;GAIG;AACH,wBAAgB,SAAS,CAAC,IAAI,EAAE,OAAO,GAAG,IAAI,CAE7C"}
|
package/dist/output.js
ADDED
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Output formatting utilities for the Forge CLI.
|
|
3
|
+
*
|
|
4
|
+
* Uses chalk for colored terminal output with redundant encoding
|
|
5
|
+
* (color + symbol) for accessibility. Respects `--no-color` and
|
|
6
|
+
* the `NO_COLOR` environment variable.
|
|
7
|
+
*/
|
|
8
|
+
import chalk from 'chalk';
|
|
9
|
+
/** Default global options. */
|
|
10
|
+
export const globalOptions = {
|
|
11
|
+
json: false,
|
|
12
|
+
quiet: false,
|
|
13
|
+
verbose: false,
|
|
14
|
+
color: true,
|
|
15
|
+
noInput: false,
|
|
16
|
+
};
|
|
17
|
+
// ---------------------------------------------------------------------------
|
|
18
|
+
// Color control
|
|
19
|
+
// ---------------------------------------------------------------------------
|
|
20
|
+
/**
|
|
21
|
+
* Apply color settings based on global options and environment.
|
|
22
|
+
*
|
|
23
|
+
* Call after parsing CLI flags to disable chalk when `--no-color`
|
|
24
|
+
* is set or the `NO_COLOR` environment variable is present.
|
|
25
|
+
*/
|
|
26
|
+
export function applyColorSettings() {
|
|
27
|
+
if (!globalOptions.color || process.env['NO_COLOR'] !== undefined) {
|
|
28
|
+
chalk.level = 0;
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
// ---------------------------------------------------------------------------
|
|
32
|
+
// Formatters
|
|
33
|
+
// ---------------------------------------------------------------------------
|
|
34
|
+
/**
|
|
35
|
+
* Format a success message with green check mark.
|
|
36
|
+
*
|
|
37
|
+
* @param message - The success message
|
|
38
|
+
* @returns Formatted string with `✓` prefix
|
|
39
|
+
*/
|
|
40
|
+
export function formatSuccess(message) {
|
|
41
|
+
return chalk.green(`✓ ${message}`);
|
|
42
|
+
}
|
|
43
|
+
/**
|
|
44
|
+
* Format an error message with red X.
|
|
45
|
+
*
|
|
46
|
+
* @param message - The error message
|
|
47
|
+
* @returns Formatted string with `✗` prefix
|
|
48
|
+
*/
|
|
49
|
+
export function formatError(message) {
|
|
50
|
+
return chalk.red(`✗ ${message}`);
|
|
51
|
+
}
|
|
52
|
+
/**
|
|
53
|
+
* Format a warning message with yellow triangle.
|
|
54
|
+
*
|
|
55
|
+
* @param message - The warning message
|
|
56
|
+
* @returns Formatted string with `⚠` prefix
|
|
57
|
+
*/
|
|
58
|
+
export function formatWarning(message) {
|
|
59
|
+
return chalk.yellow(`⚠ ${message}`);
|
|
60
|
+
}
|
|
61
|
+
/**
|
|
62
|
+
* Format an info message with blue info symbol.
|
|
63
|
+
*
|
|
64
|
+
* @param message - The info message
|
|
65
|
+
* @returns Formatted string with `ℹ` prefix
|
|
66
|
+
*/
|
|
67
|
+
export function formatInfo(message) {
|
|
68
|
+
return chalk.blue(`ℹ ${message}`);
|
|
69
|
+
}
|
|
70
|
+
/**
|
|
71
|
+
* Print data as formatted JSON to stdout.
|
|
72
|
+
*
|
|
73
|
+
* @param data - Data to serialize and print
|
|
74
|
+
*/
|
|
75
|
+
export function printJson(data) {
|
|
76
|
+
process.stdout.write(JSON.stringify(data, null, 2) + '\n');
|
|
77
|
+
}
|
|
78
|
+
//# sourceMappingURL=output.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"output.js","sourceRoot":"","sources":["../src/output.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,KAAK,MAAM,OAAO,CAAC;AAgB1B,8BAA8B;AAC9B,MAAM,CAAC,MAAM,aAAa,GAAkB;IAC1C,IAAI,EAAE,KAAK;IACX,KAAK,EAAE,KAAK;IACZ,OAAO,EAAE,KAAK;IACd,KAAK,EAAE,IAAI;IACX,OAAO,EAAE,KAAK;CACf,CAAC;AAEF,8EAA8E;AAC9E,gBAAgB;AAChB,8EAA8E;AAE9E;;;;;GAKG;AACH,MAAM,UAAU,kBAAkB;IAChC,IAAI,CAAC,aAAa,CAAC,KAAK,IAAI,OAAO,CAAC,GAAG,CAAC,UAAU,CAAC,KAAK,SAAS,EAAE,CAAC;QAClE,KAAK,CAAC,KAAK,GAAG,CAAC,CAAC;IAClB,CAAC;AACH,CAAC;AAED,8EAA8E;AAC9E,aAAa;AACb,8EAA8E;AAE9E;;;;;GAKG;AACH,MAAM,UAAU,aAAa,CAAC,OAAe;IAC3C,OAAO,KAAK,CAAC,KAAK,CAAC,KAAK,OAAO,EAAE,CAAC,CAAC;AACrC,CAAC;AAED;;;;;GAKG;AACH,MAAM,UAAU,WAAW,CAAC,OAAe;IACzC,OAAO,KAAK,CAAC,GAAG,CAAC,KAAK,OAAO,EAAE,CAAC,CAAC;AACnC,CAAC;AAED;;;;;GAKG;AACH,MAAM,UAAU,aAAa,CAAC,OAAe;IAC3C,OAAO,KAAK,CAAC,MAAM,CAAC,KAAK,OAAO,EAAE,CAAC,CAAC;AACtC,CAAC;AAED;;;;;GAKG;AACH,MAAM,UAAU,UAAU,CAAC,OAAe;IACxC,OAAO,KAAK,CAAC,IAAI,CAAC,KAAK,OAAO,EAAE,CAAC,CAAC;AACpC,CAAC;AAED;;;;GAIG;AACH,MAAM,UAAU,SAAS,CAAC,IAAa;IACrC,OAAO,CAAC,MAAM,CAAC,KAAK,CAAC,IAAI,CAAC,SAAS,CAAC,IAAI,EAAE,IAAI,EAAE,CAAC,CAAC,GAAG,IAAI,CAAC,CAAC;AAC7D,CAAC"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Forge CLI program factory.
|
|
3
|
+
*
|
|
4
|
+
* Separated from the entry point (`cli.ts`) so tests can import
|
|
5
|
+
* `createProgram` without triggering `process.argv` parsing.
|
|
6
|
+
*/
|
|
7
|
+
import { Command } from 'commander';
|
|
8
|
+
/**
|
|
9
|
+
* Create and configure the Forge CLI program.
|
|
10
|
+
*
|
|
11
|
+
* @returns Configured Commander program
|
|
12
|
+
*/
|
|
13
|
+
export declare function createProgram(): Command;
|
|
14
|
+
//# sourceMappingURL=program.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"program.d.ts","sourceRoot":"","sources":["../src/program.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAcpC;;;;GAIG;AACH,wBAAgB,aAAa,IAAI,OAAO,CAyDvC"}
|
package/dist/program.js
ADDED
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Forge CLI program factory.
|
|
3
|
+
*
|
|
4
|
+
* Separated from the entry point (`cli.ts`) so tests can import
|
|
5
|
+
* `createProgram` without triggering `process.argv` parsing.
|
|
6
|
+
*/
|
|
7
|
+
import { Command } from 'commander';
|
|
8
|
+
import { globalOptions, applyColorSettings } from './output.js';
|
|
9
|
+
import { createInitCommand } from './commands/init.js';
|
|
10
|
+
import { createGenerateCommand } from './commands/generate.js';
|
|
11
|
+
import { createVerifyCommand } from './commands/verify.js';
|
|
12
|
+
import { createDeliverCommand } from './commands/deliver.js';
|
|
13
|
+
import { createStatusCommand } from './commands/status.js';
|
|
14
|
+
import { createProfileCommand } from './commands/profile.js';
|
|
15
|
+
import { createTemplateCommand } from './commands/template.js';
|
|
16
|
+
// Import version from package.json (ESM)
|
|
17
|
+
import pkg from '../package.json' with { type: 'json' };
|
|
18
|
+
/**
|
|
19
|
+
* Create and configure the Forge CLI program.
|
|
20
|
+
*
|
|
21
|
+
* @returns Configured Commander program
|
|
22
|
+
*/
|
|
23
|
+
export function createProgram() {
|
|
24
|
+
const program = new Command();
|
|
25
|
+
program
|
|
26
|
+
.name('forge')
|
|
27
|
+
.version(pkg.version)
|
|
28
|
+
.description('Forge — Where Requirements Become Running Systems');
|
|
29
|
+
// -----------------------------------------------------------------------
|
|
30
|
+
// Global flags
|
|
31
|
+
// -----------------------------------------------------------------------
|
|
32
|
+
program
|
|
33
|
+
.option('--json', 'machine-readable JSON output', false)
|
|
34
|
+
.option('-q, --quiet', 'suppress non-essential output', false)
|
|
35
|
+
.option('--verbose', 'verbose output including debug logs', false)
|
|
36
|
+
.option('--no-color', 'disable colored output')
|
|
37
|
+
.option('--log-level <level>', 'set log level (debug, info, warn, error)')
|
|
38
|
+
.option('--no-input', 'disable all interactive prompts (for CI/CD)');
|
|
39
|
+
// -----------------------------------------------------------------------
|
|
40
|
+
// Hook: apply global flags before every command
|
|
41
|
+
// -----------------------------------------------------------------------
|
|
42
|
+
program.hook('preAction', (thisCommand) => {
|
|
43
|
+
const opts = thisCommand.opts();
|
|
44
|
+
globalOptions.json = opts.json;
|
|
45
|
+
globalOptions.quiet = opts.quiet;
|
|
46
|
+
globalOptions.verbose = opts.verbose;
|
|
47
|
+
globalOptions.color = opts.color;
|
|
48
|
+
globalOptions.noInput = !opts.input;
|
|
49
|
+
globalOptions.logLevel = opts.logLevel;
|
|
50
|
+
applyColorSettings();
|
|
51
|
+
});
|
|
52
|
+
// -----------------------------------------------------------------------
|
|
53
|
+
// Register commands
|
|
54
|
+
// -----------------------------------------------------------------------
|
|
55
|
+
program.addCommand(createInitCommand());
|
|
56
|
+
program.addCommand(createGenerateCommand());
|
|
57
|
+
program.addCommand(createVerifyCommand());
|
|
58
|
+
program.addCommand(createDeliverCommand());
|
|
59
|
+
program.addCommand(createStatusCommand());
|
|
60
|
+
program.addCommand(createProfileCommand());
|
|
61
|
+
program.addCommand(createTemplateCommand());
|
|
62
|
+
return program;
|
|
63
|
+
}
|
|
64
|
+
//# sourceMappingURL=program.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"program.js","sourceRoot":"","sources":["../src/program.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,OAAO,EAAE,aAAa,EAAE,kBAAkB,EAAE,MAAM,aAAa,CAAC;AAChE,OAAO,EAAE,iBAAiB,EAAE,MAAM,oBAAoB,CAAC;AACvD,OAAO,EAAE,qBAAqB,EAAE,MAAM,wBAAwB,CAAC;AAC/D,OAAO,EAAE,mBAAmB,EAAE,MAAM,sBAAsB,CAAC;AAC3D,OAAO,EAAE,oBAAoB,EAAE,MAAM,uBAAuB,CAAC;AAC7D,OAAO,EAAE,mBAAmB,EAAE,MAAM,sBAAsB,CAAC;AAC3D,OAAO,EAAE,oBAAoB,EAAE,MAAM,uBAAuB,CAAC;AAC7D,OAAO,EAAE,qBAAqB,EAAE,MAAM,wBAAwB,CAAC;AAG/D,yCAAyC;AACzC,OAAO,GAAG,MAAM,iBAAiB,CAAC,OAAO,IAAI,EAAE,MAAM,EAAE,CAAC;AAExD;;;;GAIG;AACH,MAAM,UAAU,aAAa;IAC3B,MAAM,OAAO,GAAG,IAAI,OAAO,EAAE,CAAC;IAE9B,OAAO;SACJ,IAAI,CAAC,OAAO,CAAC;SACb,OAAO,CAAC,GAAG,CAAC,OAAO,CAAC;SACpB,WAAW,CAAC,mDAAm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UAAU,CAAC,mBAAmB,EAAE,CAAC,CAAC;IAC1C,OAAO,CAAC,UAAU,CAAC,oBAAoB,EAAE,CAAC,CAAC;IAC3C,OAAO,CAAC,UAAU,CAAC,qBAAqB,EAAE,CAAC,CAAC;IAE5C,OAAO,OAAO,CAAC;AACjB,CAAC"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Terminal progress bar renderer for the Forge CLI.
|
|
3
|
+
*
|
|
4
|
+
* Renders a visual progress bar using block characters (or ASCII
|
|
5
|
+
* fallback in `--no-color` mode).
|
|
6
|
+
*/
|
|
7
|
+
/**
|
|
8
|
+
* Render a progress bar string.
|
|
9
|
+
*
|
|
10
|
+
* Uses `█` and `░` block characters when color is enabled,
|
|
11
|
+
* and `#` and `.` when `--no-color` is active (`chalk.level === 0`).
|
|
12
|
+
*
|
|
13
|
+
* @param percent - Completion percentage (0–100)
|
|
14
|
+
* @param width - Character width of the bar (default: 20)
|
|
15
|
+
* @returns Formatted progress bar string (e.g., `[████████████░░░░░░░░] 60%`)
|
|
16
|
+
*/
|
|
17
|
+
export declare function renderProgressBar(percent: number, width?: number): string;
|
|
18
|
+
//# sourceMappingURL=progress-bar.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"progress-bar.d.ts","sourceRoot":"","sources":["../src/progress-bar.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAIH;;;;;;;;;GASG;AACH,wBAAgB,iBAAiB,CAAC,OAAO,EAAE,MAAM,EAAE,KAAK,SAAK,GAAG,MAAM,CAWrE"}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Terminal progress bar renderer for the Forge CLI.
|
|
3
|
+
*
|
|
4
|
+
* Renders a visual progress bar using block characters (or ASCII
|
|
5
|
+
* fallback in `--no-color` mode).
|
|
6
|
+
*/
|
|
7
|
+
import chalk from 'chalk';
|
|
8
|
+
/**
|
|
9
|
+
* Render a progress bar string.
|
|
10
|
+
*
|
|
11
|
+
* Uses `█` and `░` block characters when color is enabled,
|
|
12
|
+
* and `#` and `.` when `--no-color` is active (`chalk.level === 0`).
|
|
13
|
+
*
|
|
14
|
+
* @param percent - Completion percentage (0–100)
|
|
15
|
+
* @param width - Character width of the bar (default: 20)
|
|
16
|
+
* @returns Formatted progress bar string (e.g., `[████████████░░░░░░░░] 60%`)
|
|
17
|
+
*/
|
|
18
|
+
export function renderProgressBar(percent, width = 20) {
|
|
19
|
+
const clamped = Math.max(0, Math.min(100, percent));
|
|
20
|
+
const filled = Math.round((clamped / 100) * width);
|
|
21
|
+
const empty = width - filled;
|
|
22
|
+
const noColor = chalk.level === 0;
|
|
23
|
+
const filledChar = noColor ? '#' : '█';
|
|
24
|
+
const emptyChar = noColor ? '.' : '░';
|
|
25
|
+
const bar = filledChar.repeat(filled) + emptyChar.repeat(empty);
|
|
26
|
+
return `[${bar}] ${String(clamped)}%`;
|
|
27
|
+
}
|
|
28
|
+
//# sourceMappingURL=progress-bar.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"progress-bar.js","sourceRoot":"","sources":["../src/progress-bar.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B;;;;;;;;;GASG;AACH,MAAM,UAAU,iBAAiB,CAAC,OAAe,EAAE,KAAK,GAAG,EAAE;IAC3D,MAAM,OAAO,GAAG,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,IAAI,CAAC,GAAG,CAAC,GAAG,EAAE,OAAO,CAAC,CAAC,CAAC;IACpD,MAAM,MAAM,GAAG,IAAI,CAAC,KAAK,CAAC,CAAC,OAAO,GAAG,GAAG,CAAC,GAAG,KAAK,CAAC,CAAC;IACnD,MAAM,KAAK,GAAG,KAAK,GAAG,MAAM,CAAC;IAE7B,MAAM,OAAO,GAAG,KAAK,CAAC,KAAK,KAAK,CAAC,CAAC;IAClC,MAAM,UAAU,GAAG,OAAO,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,GAAG,CAAC;IACvC,MAAM,SAAS,GAAG,OAAO,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,GAAG,CAAC;IAEtC,MAAM,GAAG,GAAG,UAAU,CAAC,MAAM,CAAC,MAAM,CAAC,GAAG,SAAS,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;IAChE,OAAO,IAAI,GAAG,KAAK,MAAM,CAAC,OAAO,CAAC,GAAG,CAAC;AACxC,CAAC"}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* CLI progress reporter for the Forge generation pipeline.
|
|
3
|
+
*
|
|
4
|
+
* Creates a {@link ProgressListener} that renders real-time stage
|
|
5
|
+
* boundary events to the terminal. Supports human-readable, JSON (NDJSON),
|
|
6
|
+
* quiet, and benchmark summary output modes.
|
|
7
|
+
*/
|
|
8
|
+
import type { RunStore, BenchmarkReport } from '@hstm-labs/forge-common';
|
|
9
|
+
import type { ProgressListener } from '@hstm-labs/forge-core';
|
|
10
|
+
/** Options for creating a CLI progress listener. */
|
|
11
|
+
export interface ProgressReporterOptions {
|
|
12
|
+
/** Whether benchmark mode is active. */
|
|
13
|
+
benchmark?: boolean | undefined;
|
|
14
|
+
/** RunStore for retrieving benchmark report on completion. */
|
|
15
|
+
store?: RunStore | undefined;
|
|
16
|
+
}
|
|
17
|
+
/**
|
|
18
|
+
* Format a benchmark report as a summary table for pipeline completion.
|
|
19
|
+
*
|
|
20
|
+
* @param report - The benchmark report
|
|
21
|
+
* @returns Formatted table string
|
|
22
|
+
*/
|
|
23
|
+
export declare function formatBenchmarkTable(report: BenchmarkReport): string;
|
|
24
|
+
/**
|
|
25
|
+
* Create a CLI progress listener that writes pipeline progress to stdout.
|
|
26
|
+
*
|
|
27
|
+
* Respects {@link globalOptions} for `--quiet`, `--json`, and `--verbose`.
|
|
28
|
+
* When `benchmark` is true and a `store` is provided, appends a benchmark
|
|
29
|
+
* summary table after the pipeline-complete event.
|
|
30
|
+
*
|
|
31
|
+
* @param options - Reporter options
|
|
32
|
+
* @returns A ProgressListener function
|
|
33
|
+
*/
|
|
34
|
+
export declare function createProgressListener(options?: ProgressReporterOptions): ProgressListener;
|
|
35
|
+
//# sourceMappingURL=progress-reporter.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"progress-reporter.d.ts","sourceRoot":"","sources":["../src/progress-reporter.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAGH,OAAO,KAAK,EAAE,QAAQ,EAAE,eAAe,EAAE,MAAM,yBAAyB,CAAC;AACzE,OAAO,KAAK,EAAiB,gBAAgB,EAAE,MAAM,uBAAuB,CAAC;AAY7E,oDAAoD;AACpD,MAAM,WAAW,uBAAuB;IACtC,wCAAwC;IACxC,SAAS,CAAC,EAAE,OAAO,GAAG,SAAS,CAAC;IAChC,8DAA8D;IAC9D,KAAK,CAAC,EAAE,QAAQ,GAAG,SAAS,CAAC;CAC9B;AAqDD;;;;;GAKG;AACH,wBAAgB,oBAAoB,CAAC,MAAM,EAAE,eAAe,GAAG,MAAM,CAwEpE;AAMD;;;;;;;;;GASG;AACH,wBAAgB,sBAAsB,CACpC,OAAO,CAAC,EAAE,uBAAuB,GAChC,gBAAgB,CAsKlB"}
|
|
@@ -0,0 +1,236 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* CLI progress reporter for the Forge generation pipeline.
|
|
3
|
+
*
|
|
4
|
+
* Creates a {@link ProgressListener} that renders real-time stage
|
|
5
|
+
* boundary events to the terminal. Supports human-readable, JSON (NDJSON),
|
|
6
|
+
* quiet, and benchmark summary output modes.
|
|
7
|
+
*/
|
|
8
|
+
import chalk from 'chalk';
|
|
9
|
+
import { globalOptions } from './output.js';
|
|
10
|
+
import { formatAgentPromptExport, agentPromptExportToJson, } from './formatters/agent-mode-formatter.js';
|
|
11
|
+
import { renderProgressBar } from './progress-bar.js';
|
|
12
|
+
// ---------------------------------------------------------------------------
|
|
13
|
+
// Helpers
|
|
14
|
+
// ---------------------------------------------------------------------------
|
|
15
|
+
/**
|
|
16
|
+
* Format milliseconds to a human-readable duration string.
|
|
17
|
+
*
|
|
18
|
+
* @param ms - Duration in milliseconds
|
|
19
|
+
* @returns Formatted duration (e.g., "1.2s", "345ms")
|
|
20
|
+
*/
|
|
21
|
+
function formatDuration(ms) {
|
|
22
|
+
if (ms < 1000)
|
|
23
|
+
return `${String(ms)}ms`;
|
|
24
|
+
return `${(ms / 1000).toFixed(1)}s`;
|
|
25
|
+
}
|
|
26
|
+
/**
|
|
27
|
+
* Pad a string to the right to the given width.
|
|
28
|
+
*
|
|
29
|
+
* @param str - String to pad
|
|
30
|
+
* @param width - Target width
|
|
31
|
+
* @returns Padded string
|
|
32
|
+
*/
|
|
33
|
+
function padRight(str, width) {
|
|
34
|
+
return str + ' '.repeat(Math.max(0, width - str.length));
|
|
35
|
+
}
|
|
36
|
+
/**
|
|
37
|
+
* Pad a string to the left to the given width.
|
|
38
|
+
*
|
|
39
|
+
* @param str - String to pad
|
|
40
|
+
* @param width - Target width
|
|
41
|
+
* @returns Padded string
|
|
42
|
+
*/
|
|
43
|
+
function padLeft(str, width) {
|
|
44
|
+
return ' '.repeat(Math.max(0, width - str.length)) + str;
|
|
45
|
+
}
|
|
46
|
+
/**
|
|
47
|
+
* Format a number with comma-separated thousands.
|
|
48
|
+
*
|
|
49
|
+
* @param n - Number to format
|
|
50
|
+
* @returns Formatted number string (e.g., "62,747")
|
|
51
|
+
*/
|
|
52
|
+
function formatNumber(n) {
|
|
53
|
+
return n.toLocaleString('en-US');
|
|
54
|
+
}
|
|
55
|
+
// ---------------------------------------------------------------------------
|
|
56
|
+
// Benchmark Table
|
|
57
|
+
// ---------------------------------------------------------------------------
|
|
58
|
+
/**
|
|
59
|
+
* Format a benchmark report as a summary table for pipeline completion.
|
|
60
|
+
*
|
|
61
|
+
* @param report - The benchmark report
|
|
62
|
+
* @returns Formatted table string
|
|
63
|
+
*/
|
|
64
|
+
export function formatBenchmarkTable(report) {
|
|
65
|
+
const lines = [];
|
|
66
|
+
lines.push('');
|
|
67
|
+
lines.push(chalk.bold(` Benchmark Summary (run ${report.runId}):`));
|
|
68
|
+
// Column widths
|
|
69
|
+
const colStage = 16;
|
|
70
|
+
const colDuration = 10;
|
|
71
|
+
const colLlmCalls = 11;
|
|
72
|
+
const colTokens = 12;
|
|
73
|
+
const colRetries = 9;
|
|
74
|
+
const top = ` ┌${'─'.repeat(colStage)}┬${'─'.repeat(colDuration)}┬${'─'.repeat(colLlmCalls)}┬${'─'.repeat(colTokens)}┬${'─'.repeat(colRetries)}┐`;
|
|
75
|
+
const headerRow = ` │${padRight(' Stage', colStage)}│${padRight(' Duration', colDuration)}│${padRight(' LLM Calls', colLlmCalls)}│${padRight(' Tokens', colTokens)}│${padRight(' Retries', colRetries)}│`;
|
|
76
|
+
const mid = ` ├${'─'.repeat(colStage)}┼${'─'.repeat(colDuration)}┼${'─'.repeat(colLlmCalls)}┼${'─'.repeat(colTokens)}┼${'─'.repeat(colRetries)}┤`;
|
|
77
|
+
lines.push(top);
|
|
78
|
+
lines.push(headerRow);
|
|
79
|
+
lines.push(mid);
|
|
80
|
+
for (const stage of report.stages) {
|
|
81
|
+
const name = padRight(` ${stage.stageName}`, colStage);
|
|
82
|
+
const duration = padLeft(`${formatDuration(stage.durationMs)} `, colDuration);
|
|
83
|
+
const llmCalls = padLeft(`${formatNumber(stage.llmCalls)} `, colLlmCalls);
|
|
84
|
+
const tokens = padLeft(`${formatNumber(stage.promptTokens + stage.completionTokens)} `, colTokens);
|
|
85
|
+
const retries = padLeft(`${formatNumber(stage.retryCount)} `, colRetries);
|
|
86
|
+
lines.push(` │${name}│${duration}│${llmCalls}│${tokens}│${retries}│`);
|
|
87
|
+
}
|
|
88
|
+
// Totals row
|
|
89
|
+
const totalSep = ` ├${'─'.repeat(colStage)}┼${'─'.repeat(colDuration)}┼${'─'.repeat(colLlmCalls)}┼${'─'.repeat(colTokens)}┼${'─'.repeat(colRetries)}┤`;
|
|
90
|
+
lines.push(totalSep);
|
|
91
|
+
const totalName = padRight(' TOTAL', colStage);
|
|
92
|
+
const totalDuration = padLeft(`${formatDuration(report.totalDurationMs)} `, colDuration);
|
|
93
|
+
const totalLlmCalls = padLeft(`${formatNumber(report.totals.llmCalls)} `, colLlmCalls);
|
|
94
|
+
const totalTokens = padLeft(`${formatNumber(report.totals.promptTokens + report.totals.completionTokens)} `, colTokens);
|
|
95
|
+
const totalRetries = padLeft(`${formatNumber(report.totals.retries)} `, colRetries);
|
|
96
|
+
lines.push(` │${totalName}│${totalDuration}│${totalLlmCalls}│${totalTokens}│${totalRetries}│`);
|
|
97
|
+
const bottom = ` └${'─'.repeat(colStage)}┴${'─'.repeat(colDuration)}┴${'─'.repeat(colLlmCalls)}┴${'─'.repeat(colTokens)}┴${'─'.repeat(colRetries)}┘`;
|
|
98
|
+
lines.push(bottom);
|
|
99
|
+
lines.push(` Data stored in: .forge/forge.db (run ${report.runId})`);
|
|
100
|
+
return lines.join('\n');
|
|
101
|
+
}
|
|
102
|
+
// ---------------------------------------------------------------------------
|
|
103
|
+
// Factory
|
|
104
|
+
// ---------------------------------------------------------------------------
|
|
105
|
+
/**
|
|
106
|
+
* Create a CLI progress listener that writes pipeline progress to stdout.
|
|
107
|
+
*
|
|
108
|
+
* Respects {@link globalOptions} for `--quiet`, `--json`, and `--verbose`.
|
|
109
|
+
* When `benchmark` is true and a `store` is provided, appends a benchmark
|
|
110
|
+
* summary table after the pipeline-complete event.
|
|
111
|
+
*
|
|
112
|
+
* @param options - Reporter options
|
|
113
|
+
* @returns A ProgressListener function
|
|
114
|
+
*/
|
|
115
|
+
export function createProgressListener(options) {
|
|
116
|
+
const benchmark = options?.benchmark ?? false;
|
|
117
|
+
const store = options?.store;
|
|
118
|
+
let totalArtifacts = 0;
|
|
119
|
+
return (event) => {
|
|
120
|
+
// Quiet mode — suppress all progress output
|
|
121
|
+
if (globalOptions.quiet)
|
|
122
|
+
return;
|
|
123
|
+
// JSON mode — emit each event as a NDJSON line
|
|
124
|
+
if (globalOptions.json) {
|
|
125
|
+
// Use structured JSON for stage-awaiting
|
|
126
|
+
if (event.type === 'stage-awaiting' &&
|
|
127
|
+
event.stageName !== undefined &&
|
|
128
|
+
event.runId !== undefined &&
|
|
129
|
+
event.promptPath !== undefined) {
|
|
130
|
+
process.stdout.write(JSON.stringify(agentPromptExportToJson({
|
|
131
|
+
stageName: event.stageName,
|
|
132
|
+
runId: event.runId,
|
|
133
|
+
promptPath: event.promptPath,
|
|
134
|
+
})) + '\n');
|
|
135
|
+
}
|
|
136
|
+
else {
|
|
137
|
+
process.stdout.write(JSON.stringify(event) + '\n');
|
|
138
|
+
}
|
|
139
|
+
// Append benchmark JSON after pipeline-complete
|
|
140
|
+
if (event.type === 'pipeline-complete' &&
|
|
141
|
+
benchmark &&
|
|
142
|
+
store !== undefined &&
|
|
143
|
+
event.runId !== undefined) {
|
|
144
|
+
const report = store.getBenchmarkReport(event.runId);
|
|
145
|
+
if (report !== undefined) {
|
|
146
|
+
process.stdout.write(JSON.stringify({ type: 'benchmark-summary', ...report }) + '\n');
|
|
147
|
+
}
|
|
148
|
+
}
|
|
149
|
+
return;
|
|
150
|
+
}
|
|
151
|
+
// Human-readable output
|
|
152
|
+
switch (event.type) {
|
|
153
|
+
case 'stage-start':
|
|
154
|
+
// No output on start — we show the result line on complete/fail
|
|
155
|
+
break;
|
|
156
|
+
case 'stage-complete': {
|
|
157
|
+
const idx = `[${String(event.stageIndex ?? 0)}/${String(event.totalStages ?? 0)}]`;
|
|
158
|
+
const duration = event.durationMs !== undefined
|
|
159
|
+
? ` (${formatDuration(event.durationMs)})`
|
|
160
|
+
: '';
|
|
161
|
+
const artifacts = event.artifactCount !== undefined && event.artifactCount > 0
|
|
162
|
+
? ` — ${String(event.artifactCount)} artifact${event.artifactCount === 1 ? '' : 's'}`
|
|
163
|
+
: '';
|
|
164
|
+
totalArtifacts += event.artifactCount ?? 0;
|
|
165
|
+
process.stdout.write(` ${chalk.dim(idx)} ${event.stageName ?? 'unknown'} ${chalk.green('✓')}${duration}${artifacts}\n`);
|
|
166
|
+
break;
|
|
167
|
+
}
|
|
168
|
+
case 'stage-fail': {
|
|
169
|
+
const idx = `[${String(event.stageIndex ?? 0)}/${String(event.totalStages ?? 0)}]`;
|
|
170
|
+
const duration = event.durationMs !== undefined
|
|
171
|
+
? ` (${formatDuration(event.durationMs)})`
|
|
172
|
+
: '';
|
|
173
|
+
process.stdout.write(` ${chalk.dim(idx)} ${event.stageName ?? 'unknown'} ${chalk.red('✗')}${duration}\n`);
|
|
174
|
+
if (event.error !== undefined) {
|
|
175
|
+
process.stdout.write(` ${chalk.red(`Error: ${event.error}`)}\n`);
|
|
176
|
+
}
|
|
177
|
+
break;
|
|
178
|
+
}
|
|
179
|
+
case 'stage-awaiting': {
|
|
180
|
+
if (event.promptPath !== undefined && event.stageName !== undefined && event.runId !== undefined) {
|
|
181
|
+
process.stdout.write(formatAgentPromptExport({
|
|
182
|
+
stageName: event.stageName,
|
|
183
|
+
runId: event.runId,
|
|
184
|
+
promptPath: event.promptPath,
|
|
185
|
+
}) + '\n');
|
|
186
|
+
}
|
|
187
|
+
else {
|
|
188
|
+
const idx = `[${String(event.stageIndex ?? 0)}/${String(event.totalStages ?? 0)}]`;
|
|
189
|
+
process.stdout.write(` ${chalk.dim(idx)} ${event.stageName ?? 'unknown'} ${chalk.cyan('⏳')} awaiting agent\n`);
|
|
190
|
+
}
|
|
191
|
+
break;
|
|
192
|
+
}
|
|
193
|
+
case 'pipeline-start':
|
|
194
|
+
// Intentionally no output for pipeline-start in human mode
|
|
195
|
+
break;
|
|
196
|
+
case 'pipeline-complete': {
|
|
197
|
+
const duration = event.durationMs !== undefined
|
|
198
|
+
? formatDuration(event.durationMs)
|
|
199
|
+
: '?';
|
|
200
|
+
const stageCount = event.totalStages ?? 0;
|
|
201
|
+
process.stdout.write('\n');
|
|
202
|
+
process.stdout.write(chalk.green(` Pipeline completed in ${duration} (run ${event.runId ?? 'unknown'})\n`));
|
|
203
|
+
process.stdout.write(` ${String(stageCount)} stage${stageCount === 1 ? '' : 's'} completed, ${String(totalArtifacts)} artifact${totalArtifacts === 1 ? '' : 's'} produced\n`);
|
|
204
|
+
// Benchmark summary table
|
|
205
|
+
if (benchmark &&
|
|
206
|
+
store !== undefined &&
|
|
207
|
+
event.runId !== undefined) {
|
|
208
|
+
const report = store.getBenchmarkReport(event.runId);
|
|
209
|
+
if (report !== undefined) {
|
|
210
|
+
process.stdout.write(formatBenchmarkTable(report) + '\n');
|
|
211
|
+
}
|
|
212
|
+
}
|
|
213
|
+
break;
|
|
214
|
+
}
|
|
215
|
+
case 'pipeline-fail': {
|
|
216
|
+
process.stdout.write('\n');
|
|
217
|
+
process.stdout.write(chalk.red(` Pipeline failed (run ${event.runId ?? 'unknown'})\n`));
|
|
218
|
+
break;
|
|
219
|
+
}
|
|
220
|
+
case 'stage-progress': {
|
|
221
|
+
if (event.current !== undefined && event.total !== undefined) {
|
|
222
|
+
const pct = Math.round((event.current / event.total) * 100);
|
|
223
|
+
const bar = renderProgressBar(pct, 20);
|
|
224
|
+
process.stdout.write(`\r ${bar} ${String(event.current)}/${String(event.total)} ${event.message ?? ''}`);
|
|
225
|
+
}
|
|
226
|
+
break;
|
|
227
|
+
}
|
|
228
|
+
case 'stage-skip':
|
|
229
|
+
// Not currently emitted; reserved for future use
|
|
230
|
+
break;
|
|
231
|
+
default:
|
|
232
|
+
break;
|
|
233
|
+
}
|
|
234
|
+
};
|
|
235
|
+
}
|
|
236
|
+
//# sourceMappingURL=progress-reporter.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"progress-reporter.js","sourceRoot":"","sources":["../src/progress-reporter.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,KAAK,MAAM,OAAO,CAAC;AAG1B,OAAO,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAC5C,OAAO,EACL,uB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K,SAAS,IAAI,KAAK,CAAC,KAAK,KAAK,SAAS,EAAE,CAAC;oBAC7D,MAAM,GAAG,GAAG,IAAI,CAAC,KAAK,CAAC,CAAC,KAAK,CAAC,OAAO,GAAG,KAAK,CAAC,KAAK,CAAC,GAAG,GAAG,CAAC,CAAC;oBAC5D,MAAM,GAAG,GAAG,iBAAiB,CAAC,GAAG,EAAE,EAAE,CAAC,CAAC;oBACvC,OAAO,CAAC,MAAM,CAAC,KAAK,CAClB,OAAO,GAAG,IAAI,MAAM,CAAC,KAAK,CAAC,OAAO,CAAC,IAAI,MAAM,CAAC,KAAK,CAAC,KAAK,CAAC,IAAI,KAAK,CAAC,OAAO,IAAI,EAAE,EAAE,CACpF,CAAC;gBACJ,CAAC;gBACD,MAAM;YACR,CAAC;YAED,KAAK,YAAY;gBACf,iDAAiD;gBACjD,MAAM;YAER;gBACE,MAAM;QACV,CAAC;IACH,CAAC,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Interactive prompts for the `forge init` command.
|
|
3
|
+
*
|
|
4
|
+
* Uses `@inquirer/prompts` for lightweight, modern ESM prompts.
|
|
5
|
+
* Each prompt shows a clear label, default value, and validates input.
|
|
6
|
+
* Ctrl+C aborts natively via inquirer.
|
|
7
|
+
*/
|
|
8
|
+
/** Answers collected from the interactive init prompts. */
|
|
9
|
+
export interface InitPromptAnswers {
|
|
10
|
+
projectName: string;
|
|
11
|
+
outputPath: string;
|
|
12
|
+
profile: string;
|
|
13
|
+
}
|
|
14
|
+
/**
|
|
15
|
+
* Prompt the user interactively for init parameters.
|
|
16
|
+
*
|
|
17
|
+
* @param availableProfiles - List of available profile names to select from
|
|
18
|
+
* @param defaults - Optional default values for each prompt
|
|
19
|
+
* @returns Collected answers
|
|
20
|
+
*/
|
|
21
|
+
export declare function promptForInit(availableProfiles: string[], defaults?: Partial<InitPromptAnswers>): Promise<InitPromptAnswers>;
|
|
22
|
+
//# sourceMappingURL=init-prompts.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"init-prompts.d.ts","sourceRoot":"","sources":["../../src/prompts/init-prompts.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AASH,2DAA2D;AAC3D,MAAM,WAAW,iBAAiB;IAChC,WAAW,EAAE,MAAM,CAAC;IACpB,UAAU,EAAE,MAAM,CAAC;IACnB,OAAO,EAAE,MAAM,CAAC;CACjB;AA2CD;;;;;;GAMG;AACH,wBAAsB,aAAa,CACjC,iBAAiB,EAAE,MAAM,EAAE,EAC3B,QAAQ,CAAC,EAAE,OAAO,CAAC,iBAAiB,CAAC,GACpC,OAAO,CAAC,iBAAiB,CAAC,CA6B5B"}
|